@@ -377,45 +377,136 @@ export function CreateWorkItemModal({ isOpen, onClose, parentWorkItemId, positio
377377 < div className = "max-h-[70vh] overflow-y-auto scrollbar-thin scrollbar-thumb-gray-600 scrollbar-track-gray-800 hover:scrollbar-thumb-gray-500" >
378378 < form onSubmit = { handleSubmit } className = "px-6 py-6 space-y-5 relative" >
379379 { parentWorkItemId && (
380- < div className = "space-y-2 mb-2 " >
381- < div className = "bg-gradient-to-br from-gray-800/30 to-gray-700/20 border border-gray-600/30 rounded-lg p-2 shadow-lg backdrop-blur-sm" >
382- < div className = "flex items-center space-x-2 mb-1 " >
383- < p className = "text-xs font-semibold text-blue-200" > Connection Setup</ p >
380+ < div className = "space-y-4 mb-4 " >
381+ < div className = "bg-gradient-to-br from-gray-800/40 to-gray-700/30 border border-gray-600/40 rounded-xl p-4 shadow-lg backdrop-blur-sm" >
382+ < div className = "flex items-center space-x-2 mb-2 " >
383+ < p className = "text-sm font-semibold text-blue-200" > Connection Setup</ p >
384384 </ div >
385- < p className = "text-xs text-blue-100 leading-relaxed" >
385+ < p className = "text-sm text-blue-100 leading-relaxed" >
386386 A new work item will be created and automatically connected with your selected relationship type.
387387 </ p >
388388 </ div >
389389
390390 < div >
391- < div className = "flex items-center space-x-2 mb-1 " >
391+ < div className = "flex items-center space-x-2 mb-3 " >
392392 < label className = "text-base font-bold text-gray-100 tracking-wide" >
393393 Relationship Type
394394 </ label >
395395 </ div >
396- < div className = "grid grid-cols-2 gap-2" >
397- { RELATIONSHIP_OPTIONS . map ( ( relation ) => (
398- < button
399- key = { relation . type }
400- type = "button"
401- onClick = { ( ) => setSelectedRelationType ( relation . type ) }
402- className = { `p-2 rounded-lg text-left transition-all duration-200 border group ${
403- selectedRelationType === relation . type
404- ? 'bg-gradient-to-br from-blue-600/20 via-blue-700/25 to-blue-800/20 border-blue-400/50 shadow-lg shadow-blue-500/10'
405- : 'bg-gradient-to-br from-gray-700/30 to-gray-800/30 hover:from-gray-600/40 hover:to-gray-700/40 border-gray-600/30 hover:border-gray-500/50 hover:shadow-md'
406- } `}
407- >
408- < div className = "flex items-center space-x-1.5 mb-0.5" >
409- { getRelationshipIconElement ( relation . type , `h-4 w-4 ${ selectedRelationType === relation . type ? 'text-blue-400' : '' } ` ) }
410- < span className = { `font-medium text-xs ${ selectedRelationType === relation . type ? 'text-blue-400' : relation . color } ` } >
411- { relation . label }
412- </ span >
396+ < div className = "grid grid-cols-4 gap-3" >
397+ { RELATIONSHIP_OPTIONS . map ( ( relation , index ) => {
398+ const isSelected = selectedRelationType === relation . type ;
399+ const shadowClass = relation . hexColor ;
400+
401+ // Static Tailwind classes for each relationship type
402+ const getSelectedStyles = ( type : RelationshipType ) => {
403+ const styles : Record < RelationshipType , string > = {
404+ 'DEFAULT_EDGE' : 'border-gray-400 bg-gradient-to-br from-gray-400/20 to-gray-400/10' ,
405+ 'DEPENDS_ON' : 'border-emerald-400 bg-gradient-to-br from-emerald-400/20 to-emerald-400/10' ,
406+ 'BLOCKS' : 'border-rose-400 bg-gradient-to-br from-rose-400/20 to-rose-400/10' ,
407+ 'ENABLES' : 'border-green-400 bg-gradient-to-br from-green-400/20 to-green-400/10' ,
408+ 'RELATES_TO' : 'border-purple-400 bg-gradient-to-br from-purple-400/20 to-purple-400/10' ,
409+ 'IS_PART_OF' : 'border-orange-400 bg-gradient-to-br from-orange-400/20 to-orange-400/10' ,
410+ 'FOLLOWS' : 'border-indigo-400 bg-gradient-to-br from-indigo-400/20 to-indigo-400/10' ,
411+ 'PARALLEL_WITH' : 'border-teal-400 bg-gradient-to-br from-teal-400/20 to-teal-400/10' ,
412+ 'DUPLICATES' : 'border-yellow-400 bg-gradient-to-br from-yellow-400/20 to-yellow-400/10' ,
413+ 'CONFLICTS_WITH' : 'border-red-500 bg-gradient-to-br from-red-500/20 to-red-500/10' ,
414+ 'VALIDATES' : 'border-lime-400 bg-gradient-to-br from-lime-400/20 to-lime-400/10' ,
415+ 'REFERENCES' : 'border-fuchsia-400 bg-gradient-to-br from-fuchsia-400/20 to-fuchsia-400/10' ,
416+ 'CONTAINS' : 'border-blue-400 bg-gradient-to-br from-blue-400/20 to-blue-400/10' ,
417+ 'SUPERSEDES' : 'border-cyan-400 bg-gradient-to-br from-cyan-400/20 to-cyan-400/10' ,
418+ 'EXTENDS' : 'border-pink-400 bg-gradient-to-br from-pink-400/20 to-pink-400/10' ,
419+ 'TRIGGERS' : 'border-sky-300 bg-gradient-to-br from-sky-300/20 to-sky-300/10' ,
420+ } ;
421+ return styles [ type ] || styles . DEFAULT_EDGE ;
422+ } ;
423+
424+ const getHoverStyles = ( type : RelationshipType ) => {
425+ const hoverStyles : Record < RelationshipType , string > = {
426+ 'DEFAULT_EDGE' : 'hover:border-gray-400/70 hover:bg-gray-400/10' ,
427+ 'DEPENDS_ON' : 'hover:border-emerald-400/70 hover:bg-emerald-400/10' ,
428+ 'BLOCKS' : 'hover:border-rose-400/70 hover:bg-rose-400/10' ,
429+ 'ENABLES' : 'hover:border-green-400/70 hover:bg-green-400/10' ,
430+ 'RELATES_TO' : 'hover:border-purple-400/70 hover:bg-purple-400/10' ,
431+ 'IS_PART_OF' : 'hover:border-orange-400/70 hover:bg-orange-400/10' ,
432+ 'FOLLOWS' : 'hover:border-indigo-400/70 hover:bg-indigo-400/10' ,
433+ 'PARALLEL_WITH' : 'hover:border-teal-400/70 hover:bg-teal-400/10' ,
434+ 'DUPLICATES' : 'hover:border-yellow-400/70 hover:bg-yellow-400/10' ,
435+ 'CONFLICTS_WITH' : 'hover:border-red-500/70 hover:bg-red-500/10' ,
436+ 'VALIDATES' : 'hover:border-lime-400/70 hover:bg-lime-400/10' ,
437+ 'REFERENCES' : 'hover:border-fuchsia-400/70 hover:bg-fuchsia-400/10' ,
438+ 'CONTAINS' : 'hover:border-blue-400/70 hover:bg-blue-400/10' ,
439+ 'SUPERSEDES' : 'hover:border-cyan-400/70 hover:bg-cyan-400/10' ,
440+ 'EXTENDS' : 'hover:border-pink-400/70 hover:bg-pink-400/10' ,
441+ 'TRIGGERS' : 'hover:border-sky-300/70 hover:bg-sky-300/10' ,
442+ } ;
443+ return hoverStyles [ type ] || hoverStyles . DEFAULT_EDGE ;
444+ } ;
445+
446+ // Determine tooltip position based on column (4-column grid)
447+ const columnIndex = index % 4 ;
448+ const isFirstColumn = columnIndex === 0 ;
449+ const isLastColumn = columnIndex === 3 ;
450+
451+ const tooltipPositionClass = isFirstColumn
452+ ? 'left-0'
453+ : isLastColumn
454+ ? 'right-0'
455+ : 'left-1/2 -translate-x-1/2' ;
456+
457+ const arrowPositionClass = isFirstColumn
458+ ? 'left-4'
459+ : isLastColumn
460+ ? 'right-4'
461+ : 'left-1/2 -translate-x-1/2' ;
462+
463+ return (
464+ < div key = { relation . type } className = "relative group/tooltip" >
465+ < button
466+ type = "button"
467+ onClick = { ( ) => setSelectedRelationType ( relation . type ) }
468+ className = { `w-full p-3 rounded-xl transition-all duration-300 border-2 backdrop-blur-sm relative overflow-hidden ${
469+ isSelected
470+ ? `${ getSelectedStyles ( relation . type ) } shadow-lg scale-105`
471+ : `border-gray-600/50 bg-gradient-to-br from-gray-700/40 to-gray-800/40 ${ getHoverStyles ( relation . type ) } hover:shadow-lg hover:scale-105 active:scale-95`
472+ } `}
473+ style = { {
474+ animationDelay : `${ index * 20 } ms` ,
475+ ...( isSelected && { boxShadow : `0 10px 25px -5px ${ shadowClass } 40, 0 8px 10px -6px ${ shadowClass } 30` } )
476+ } }
477+ >
478+ < div className = "flex flex-col items-center justify-center space-y-1.5" >
479+ < div className = { `transition-all duration-300 ${ isSelected ? 'scale-110' : 'group-hover:scale-110' } ` } >
480+ { getRelationshipIconElement ( relation . type , `h-5 w-5` ) }
481+ </ div >
482+ < span className = { `font-semibold text-[10px] text-center leading-tight transition-colors duration-300 ${
483+ isSelected ? relation . color : 'text-gray-300 group-hover:text-white'
484+ } `} >
485+ { relation . label }
486+ </ span >
487+ </ div >
488+ { isSelected && (
489+ < div
490+ className = "absolute top-1 right-1 w-4 h-4 text-white rounded-full flex items-center justify-center text-[8px] shadow-lg animate-in zoom-in duration-200"
491+ style = { { background : shadowClass } }
492+ >
493+ ✓
494+ </ div >
495+ ) }
496+ </ button >
497+
498+ { /* Premium Tooltip on Hover */ }
499+ < div className = { `absolute bottom-full ${ tooltipPositionClass } mb-2 px-3 py-2 bg-gradient-to-br from-gray-900/98 to-black/98 backdrop-blur-xl rounded-lg border border-gray-600/50 shadow-2xl opacity-0 invisible group-hover/tooltip:opacity-100 group-hover/tooltip:visible transition-all duration-300 pointer-events-none z-50 whitespace-nowrap` } >
500+ < div className = "text-xs text-gray-300 leading-relaxed" >
501+ { relation . description }
502+ </ div >
503+ < div className = { `absolute top-full ${ arrowPositionClass } -mt-px` } >
504+ < div className = "border-4 border-transparent border-t-gray-900/98" > </ div >
505+ </ div >
506+ </ div >
413507 </ div >
414- < p className = "text-[10px] text-gray-400" >
415- { relation . description }
416- </ p >
417- </ button >
418- ) ) }
508+ ) ;
509+ } ) }
419510 </ div >
420511 </ div >
421512 </ div >
0 commit comments