|
562 | 562 | {:else if directAsset} |
563 | 563 | <!-- Back button --> |
564 | 564 | <button |
565 | | - class="inline-flex items-center gap-1.5 mb-6 text-sm font-medium rounded-lg px-3 py-1.5 transition-colors" |
566 | | - style="color: var(--ds-text-subtle); background: transparent;" |
567 | | - onmouseenter={(e) => e.currentTarget.style.background = 'var(--ds-background-neutral-hovered)'} |
568 | | - onmouseleave={(e) => e.currentTarget.style.background = 'transparent'} |
| 565 | + class="hover-bg inline-flex items-center gap-1.5 mb-6 text-sm font-medium rounded-lg px-3 py-1.5 transition-colors" |
| 566 | + style="color: var(--ds-text-subtle);" |
569 | 567 | onclick={() => navigate('/assets')} |
570 | 568 | > |
571 | 569 | <IconArrowLeft class="w-4 h-4" /> |
|
577 | 575 | <h1 class="text-2xl font-semibold" style="color: var(--ds-text);">{directAsset.title}</h1> |
578 | 576 | <div class="flex items-center gap-2"> |
579 | 577 | <button |
580 | | - class="p-2 rounded-lg transition-colors" |
581 | | - style="background: transparent;" |
582 | | - onmouseenter={(e) => e.currentTarget.style.background = 'var(--ds-background-neutral-hovered)'} |
583 | | - onmouseleave={(e) => e.currentTarget.style.background = 'transparent'} |
| 578 | + class="hover-bg p-2 rounded-lg transition-colors" |
584 | 579 | onclick={() => { showRelationshipGraph = true; }} |
585 | 580 | title="Relationship Graph" |
586 | 581 | > |
|
589 | 584 | {#if canEdit} |
590 | 585 | <button |
591 | 586 | data-testid="asset-edit" |
592 | | - class="p-2 rounded-lg transition-colors" |
593 | | - style="background: transparent;" |
594 | | - onmouseenter={(e) => e.currentTarget.style.background = 'var(--ds-background-neutral-hovered)'} |
595 | | - onmouseleave={(e) => e.currentTarget.style.background = 'transparent'} |
| 587 | + class="hover-bg p-2 rounded-lg transition-colors" |
596 | 588 | onclick={() => showEditAssetForm(directAsset)} |
597 | 589 | title={t('common.edit')} |
598 | 590 | > |
599 | 591 | <IconEdit class="w-4 h-4" style="color: var(--ds-icon);" /> |
600 | 592 | </button> |
601 | 593 | <button |
602 | | - class="p-2 rounded-lg transition-colors" |
603 | | - style="background: transparent; color: var(--ds-text-danger);" |
604 | | - onmouseenter={(e) => e.currentTarget.style.background = 'var(--ds-background-neutral-hovered)'} |
605 | | - onmouseleave={(e) => e.currentTarget.style.background = 'transparent'} |
| 594 | + class="hover-bg p-2 rounded-lg transition-colors" |
| 595 | + style="color: var(--ds-text-danger);" |
606 | 596 | onclick={() => deleteAsset(directAsset.id)} |
607 | 597 | title={t('common.delete')} |
608 | 598 | > |
|
647 | 637 | <!-- Category tree --> |
648 | 638 | <div class="flex-1 overflow-auto p-4"> |
649 | 639 | <button |
650 | | - class="w-full text-left px-3 py-2 rounded-lg text-sm font-medium transition-all flex items-center gap-2" |
651 | | - style={selectedCategoryId === null ? 'background: var(--ds-surface-selected); color: var(--ds-text);' : 'color: var(--ds-text-subtle);'} |
652 | | - onmouseenter={(e) => { if (selectedCategoryId !== null) e.currentTarget.style.cssText = 'background: var(--ds-background-neutral-hovered); color: var(--ds-text);'; }} |
653 | | - onmouseleave={(e) => { if (selectedCategoryId !== null) e.currentTarget.style.cssText = 'color: var(--ds-text-subtle);'; }} |
| 640 | + class="nav-link w-full text-left px-3 py-2 rounded-lg text-sm font-medium transition-all flex items-center gap-2" |
| 641 | +
|
| 642 | + class:active={selectedCategoryId === null} |
654 | 643 | onclick={() => selectCategory(null)} |
655 | 644 | > |
656 | 645 | <IconPackage class="w-4 h-4" /> |
|
664 | 653 | <div |
665 | 654 | role="button" |
666 | 655 | tabindex="0" |
667 | | - class="w-full text-left px-3 py-1.5 rounded-lg text-sm font-medium transition-all flex items-center gap-1 cursor-pointer" |
668 | | - style={selectedCategoryId === category.id ? 'background: var(--ds-surface-selected); color: var(--ds-text);' : 'color: var(--ds-text-subtle);'} |
669 | | - onmouseenter={(e) => { if (selectedCategoryId !== category.id) e.currentTarget.style.cssText = 'background: var(--ds-background-neutral-hovered); color: var(--ds-text);'; }} |
670 | | - onmouseleave={(e) => { if (selectedCategoryId !== category.id) e.currentTarget.style.cssText = 'color: var(--ds-text-subtle);'; }} |
| 656 | + class="nav-link w-full text-left px-3 py-1.5 rounded-lg text-sm font-medium transition-all flex items-center gap-1 cursor-pointer" |
| 657 | +
|
| 658 | + class:active={selectedCategoryId === category.id} |
671 | 659 | onclick={() => selectCategory(category.id)} |
672 | 660 | onkeydown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); selectCategory(category.id); } }} |
673 | 661 | > |
674 | 662 | {#if category.has_children} |
675 | 663 | <button |
676 | 664 | type="button" |
677 | | - class="p-0.5 rounded" |
678 | | - style="background: transparent;" |
679 | | - onmouseenter={(e) => e.currentTarget.style.background = 'var(--ds-background-neutral-hovered)'} |
680 | | - onmouseleave={(e) => e.currentTarget.style.background = 'transparent'} |
| 665 | + class="hover-bg p-0.5 rounded" |
681 | 666 | onclick={(e) => { e.stopPropagation(); toggleCategory(category.id); }} |
682 | 667 | > |
683 | 668 | {#if expandedCategories.has(category.id)} |
|
899 | 884 | <h2 class="font-semibold truncate" style="color: var(--ds-text);">{selectedAsset.title}</h2> |
900 | 885 | <div class="flex items-center gap-1"> |
901 | 886 | <button |
902 | | - class="p-1 rounded" |
903 | | - style="background: transparent;" |
904 | | - onmouseenter={(e) => e.currentTarget.style.background = 'var(--ds-background-neutral-hovered)'} |
905 | | - onmouseleave={(e) => e.currentTarget.style.background = 'transparent'} |
| 887 | + class="hover-bg p-1 rounded" |
906 | 888 | onclick={() => { showRelationshipGraph = true; }} |
907 | 889 | title="Relationship Graph" |
908 | 890 | > |
|
911 | 893 | {#if canEdit} |
912 | 894 | <button |
913 | 895 | data-testid="asset-edit" |
914 | | - class="p-1 rounded" |
915 | | - style="background: transparent;" |
916 | | - onmouseenter={(e) => e.currentTarget.style.background = 'var(--ds-background-neutral-hovered)'} |
917 | | - onmouseleave={(e) => e.currentTarget.style.background = 'transparent'} |
| 896 | + class="hover-bg p-1 rounded" |
918 | 897 | onclick={() => showEditAssetForm(selectedAsset)} |
919 | 898 | title={t('common.edit')} |
920 | 899 | > |
921 | 900 | <IconEdit class="w-4 h-4" style="color: var(--ds-icon);" /> |
922 | 901 | </button> |
923 | 902 | {/if} |
924 | 903 | <button |
925 | | - class="p-1 rounded" |
926 | | - style="background: transparent;" |
927 | | - onmouseenter={(e) => e.currentTarget.style.background = 'var(--ds-background-neutral-hovered)'} |
928 | | - onmouseleave={(e) => e.currentTarget.style.background = 'transparent'} |
| 904 | + class="hover-bg p-1 rounded" |
929 | 905 | onclick={() => { selectedAsset = null; updateQueryParams({ asset: null }); }} |
930 | 906 | > |
931 | 907 | <IconChevronRight class="w-4 h-4" style="color: var(--ds-icon);" /> |
|
1044 | 1020 | {#if selectedAsset} |
1045 | 1021 | <AssetRelationshipGraph bind:isOpen={showRelationshipGraph} assetId={selectedAsset.id} /> |
1046 | 1022 | {/if} |
| 1023 | +
|
| 1024 | +<style> |
| 1025 | + .nav-link { |
| 1026 | + color: var(--ds-text-subtle); |
| 1027 | + } |
| 1028 | +
|
| 1029 | + .nav-link:hover:not(.active) { |
| 1030 | + background: var(--ds-background-neutral-hovered); |
| 1031 | + color: var(--ds-text); |
| 1032 | + } |
| 1033 | +
|
| 1034 | + .nav-link.active { |
| 1035 | + background: var(--ds-surface-selected); |
| 1036 | + color: var(--ds-text); |
| 1037 | + } |
| 1038 | +</style> |
0 commit comments