@r2digisolutions/components 0.14.5 → 0.14.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -43,50 +43,57 @@
43
43
  }
44
44
 
45
45
  const itemClass = (item: NavRailItem) => [
46
- 'relative flex h-10 w-10 items-center justify-center rounded-lg transition-colors',
46
+ 'group relative flex h-10 w-10 items-center justify-center rounded-lg transition-colors',
47
47
  'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/30',
48
48
  value === item.id
49
- ? 'bg-surface-overlay text-primary'
49
+ ? 'bg-brand-500/15 text-brand-500'
50
50
  : 'text-secondary hover:bg-surface-overlay hover:text-primary',
51
51
  item.disabled && 'pointer-events-none cursor-not-allowed opacity-40'
52
52
  ];
53
+
54
+ const glyphClass = (item: NavRailItem) => [
55
+ 'h-5 w-5',
56
+ value === item.id ? 'text-brand-500' : 'text-secondary group-hover:text-primary'
57
+ ];
53
58
  </script>
54
59
 
55
60
  {#snippet railButton(item: NavRailItem)}
56
- <Tooltip content={item.label} side="right">
57
- <span class="relative inline-flex">
58
- <RailMark active={value === item.id} length="short" inset="sm" />
59
- {#if item.href && !item.disabled}
60
- <a
61
- href={item.href}
62
- aria-label={item.label}
63
- aria-current={value === item.id ? 'page' : undefined}
64
- class={itemClass(item)}
65
- onclick={() => select(item.id, item.disabled)}
66
- >
67
- {#if item.icon}
68
- <item.icon class="h-5 w-5" strokeWidth={1.75} />
69
- {:else}
70
- <span class="text-xs font-semibold">{item.label.slice(0, 1)}</span>
71
- {/if}
72
- </a>
73
- {:else}
74
- <button
75
- type="button"
76
- aria-label={item.label}
77
- aria-current={value === item.id ? 'page' : undefined}
78
- disabled={item.disabled}
79
- class={itemClass(item)}
80
- onclick={() => select(item.id, item.disabled)}
81
- >
82
- {#if item.icon}
83
- <item.icon class="h-5 w-5" strokeWidth={1.75} />
84
- {:else}
85
- <span class="text-xs font-semibold">{item.label.slice(0, 1)}</span>
86
- {/if}
87
- </button>
88
- {/if}
89
- </span>
61
+ <Tooltip content={item.label} side="right" class="relative w-full justify-center">
62
+ <RailMark active={value === item.id} length="full" class="z-10" />
63
+ {#if item.href && !item.disabled}
64
+ <a
65
+ href={item.href}
66
+ aria-label={item.label}
67
+ aria-current={value === item.id ? 'page' : undefined}
68
+ class={itemClass(item)}
69
+ onclick={() => select(item.id, item.disabled)}
70
+ >
71
+ {#if item.icon}
72
+ <item.icon class={glyphClass(item)} strokeWidth={1.75} />
73
+ {:else}
74
+ <span class={['text-xs font-semibold', value === item.id && 'text-brand-500']}>
75
+ {item.label.slice(0, 1)}
76
+ </span>
77
+ {/if}
78
+ </a>
79
+ {:else}
80
+ <button
81
+ type="button"
82
+ aria-label={item.label}
83
+ aria-current={value === item.id ? 'page' : undefined}
84
+ disabled={item.disabled}
85
+ class={itemClass(item)}
86
+ onclick={() => select(item.id, item.disabled)}
87
+ >
88
+ {#if item.icon}
89
+ <item.icon class={glyphClass(item)} strokeWidth={1.75} />
90
+ {:else}
91
+ <span class={['text-xs font-semibold', value === item.id && 'text-brand-500']}>
92
+ {item.label.slice(0, 1)}
93
+ </span>
94
+ {/if}
95
+ </button>
96
+ {/if}
90
97
  </Tooltip>
91
98
  {/snippet}
92
99
 
@@ -102,7 +109,7 @@
102
109
  </div>
103
110
  {/if}
104
111
 
105
- <nav class="gap-1 flex flex-1 flex-col items-center" aria-label="Rail">
112
+ <nav class="gap-1 flex w-full flex-1 flex-col items-center" aria-label="Rail">
106
113
  {#each items as item (item.id)}
107
114
  {@render railButton(item)}
108
115
  {/each}
@@ -110,7 +117,7 @@
110
117
 
111
118
  {#if footerItems.length > 0}
112
119
  <div class="w-8 py-2"><Divider /></div>
113
- <nav class="gap-1 flex flex-col items-center" aria-label="Rail footer">
120
+ <nav class="gap-1 flex w-full flex-col items-center" aria-label="Rail footer">
114
121
  {#each footerItems as item (item.id)}
115
122
  {@render railButton(item)}
116
123
  {/each}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@r2digisolutions/components",
3
- "version": "0.14.5",
3
+ "version": "0.14.6",
4
4
  "private": false,
5
5
  "description": "R2DigiSolutions Svelte 5 component library — Atomic Design, Tailwind 4, Light/Dark mode",
6
6
  "license": "MIT",