@r2digisolutions/components 0.13.0 → 0.14.0
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.
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
'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-
|
|
49
|
+
? 'bg-surface-overlay text-primary'
|
|
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
|
];
|
|
@@ -91,16 +91,16 @@
|
|
|
91
91
|
aria-current={value === item.id ? 'page' : undefined}
|
|
92
92
|
onclick={() => select(item.id)}
|
|
93
93
|
class={[
|
|
94
|
-
'
|
|
95
|
-
'focus-visible:
|
|
94
|
+
'rounded-lg px-3 py-2 block w-full text-left transition-colors',
|
|
95
|
+
'focus-visible:ring-brand-500/30 focus-visible:ring-2 focus-visible:outline-none',
|
|
96
96
|
value === item.id
|
|
97
|
-
? 'bg-
|
|
97
|
+
? 'bg-surface-overlay font-medium text-primary'
|
|
98
98
|
: 'text-secondary hover:bg-surface-overlay hover:text-primary'
|
|
99
99
|
]}
|
|
100
100
|
>
|
|
101
|
-
<span class="
|
|
101
|
+
<span class="text-sm font-medium block">{item.label}</span>
|
|
102
102
|
{#if item.description}
|
|
103
|
-
<span class="mt-0.5
|
|
103
|
+
<span class="mt-0.5 text-xs text-muted block">{item.description}</span>
|
|
104
104
|
{/if}
|
|
105
105
|
</a>
|
|
106
106
|
{:else}
|
|
@@ -110,17 +110,17 @@
|
|
|
110
110
|
aria-current={value === item.id ? 'page' : undefined}
|
|
111
111
|
onclick={() => select(item.id, item.disabled)}
|
|
112
112
|
class={[
|
|
113
|
-
'
|
|
114
|
-
'focus-visible:
|
|
113
|
+
'rounded-lg px-3 py-2 w-full text-left transition-colors',
|
|
114
|
+
'focus-visible:ring-brand-500/30 focus-visible:ring-2 focus-visible:outline-none',
|
|
115
115
|
value === item.id
|
|
116
|
-
? 'bg-
|
|
116
|
+
? 'bg-surface-overlay font-medium text-primary'
|
|
117
117
|
: 'text-secondary hover:bg-surface-overlay hover:text-primary',
|
|
118
118
|
item.disabled && 'cursor-not-allowed opacity-40'
|
|
119
119
|
]}
|
|
120
120
|
>
|
|
121
|
-
<span class="
|
|
121
|
+
<span class="text-sm font-medium block">{item.label}</span>
|
|
122
122
|
{#if item.description}
|
|
123
|
-
<span class="mt-0.5
|
|
123
|
+
<span class="mt-0.5 text-xs text-muted block">{item.description}</span>
|
|
124
124
|
{/if}
|
|
125
125
|
</button>
|
|
126
126
|
{/if}
|
|
@@ -128,37 +128,37 @@
|
|
|
128
128
|
|
|
129
129
|
<div
|
|
130
130
|
class={[
|
|
131
|
-
'
|
|
131
|
+
'rounded-2xl border-border bg-surface-elevated lg:min-h-112 lg:flex-row flex w-full flex-col overflow-hidden border',
|
|
132
132
|
className
|
|
133
133
|
]}
|
|
134
134
|
>
|
|
135
135
|
<!-- Desktop aside -->
|
|
136
136
|
<aside
|
|
137
|
-
class="
|
|
137
|
+
class="w-56 border-border bg-surface lg:flex hidden shrink-0 flex-col border-r"
|
|
138
138
|
aria-label={title}
|
|
139
139
|
>
|
|
140
|
-
<div class="border-
|
|
140
|
+
<div class="border-border px-4 py-4 border-b">
|
|
141
141
|
<p class="text-sm font-semibold text-primary">{title}</p>
|
|
142
142
|
{#if description}
|
|
143
143
|
<p class="mt-0.5 text-xs text-muted">{description}</p>
|
|
144
144
|
{/if}
|
|
145
145
|
</div>
|
|
146
146
|
|
|
147
|
-
<nav class="flex-1 overflow-y-auto
|
|
147
|
+
<nav class="px-2 py-3 flex-1 overflow-y-auto" aria-label={`${title} sections`}>
|
|
148
148
|
{#each resolvedGroups as group, gi (group.id)}
|
|
149
149
|
{#if group.label}
|
|
150
150
|
<p
|
|
151
151
|
class={[
|
|
152
|
-
'mb-1 px-2
|
|
152
|
+
'mb-1 px-2 font-semibold tracking-wide text-muted text-[11px] uppercase',
|
|
153
153
|
gi > 0 && 'mt-4'
|
|
154
154
|
]}
|
|
155
155
|
>
|
|
156
156
|
{group.label}
|
|
157
157
|
</p>
|
|
158
158
|
{:else if gi > 0}
|
|
159
|
-
<div class="my-2 border-
|
|
159
|
+
<div class="my-2 border-border border-t" aria-hidden="true"></div>
|
|
160
160
|
{/if}
|
|
161
|
-
<ul class="flex flex-col
|
|
161
|
+
<ul class="gap-0.5 flex flex-col">
|
|
162
162
|
{#each group.items as item (item.id)}
|
|
163
163
|
<li>{@render navButton(item)}</li>
|
|
164
164
|
{/each}
|
|
@@ -167,16 +167,16 @@
|
|
|
167
167
|
</nav>
|
|
168
168
|
|
|
169
169
|
{#if footer}
|
|
170
|
-
<div class="mt-auto border-t
|
|
170
|
+
<div class="border-border p-3 mt-auto border-t">
|
|
171
171
|
{@render footer()}
|
|
172
172
|
</div>
|
|
173
173
|
{/if}
|
|
174
174
|
</aside>
|
|
175
175
|
|
|
176
176
|
<!-- Main panel -->
|
|
177
|
-
<section class="
|
|
177
|
+
<section class="min-w-0 flex flex-1 flex-col">
|
|
178
178
|
<!-- Mobile top bar -->
|
|
179
|
-
<div class="space-y-3 border-
|
|
179
|
+
<div class="space-y-3 border-border px-4 py-3 lg:hidden border-b">
|
|
180
180
|
<div>
|
|
181
181
|
<p class="text-sm font-semibold text-primary">{title}</p>
|
|
182
182
|
{#if description}
|
|
@@ -189,14 +189,14 @@
|
|
|
189
189
|
{#if showHeader || header}
|
|
190
190
|
<div
|
|
191
191
|
class={[
|
|
192
|
-
'border-
|
|
193
|
-
stickyHeader && '
|
|
192
|
+
'border-border px-4 py-4 sm:px-6 border-b',
|
|
193
|
+
stickyHeader && 'top-0 bg-surface-elevated/95 backdrop-blur sticky z-10'
|
|
194
194
|
]}
|
|
195
195
|
>
|
|
196
196
|
{#if header}
|
|
197
197
|
{@render header()}
|
|
198
198
|
{:else if showHeader && active}
|
|
199
|
-
<div class="
|
|
199
|
+
<div class="gap-3 sm:flex-row sm:items-start sm:justify-between flex flex-col">
|
|
200
200
|
<div class="min-w-0 space-y-1">
|
|
201
201
|
<Heading level={2} size="lg">{active.label}</Heading>
|
|
202
202
|
{#if active.description}
|
|
@@ -204,7 +204,7 @@
|
|
|
204
204
|
{/if}
|
|
205
205
|
</div>
|
|
206
206
|
{#if actionsSlot}
|
|
207
|
-
<div class="flex shrink-0 flex-wrap items-center
|
|
207
|
+
<div class="gap-2 flex shrink-0 flex-wrap items-center">
|
|
208
208
|
{@render actionsSlot()}
|
|
209
209
|
</div>
|
|
210
210
|
{/if}
|
|
@@ -213,7 +213,7 @@
|
|
|
213
213
|
</div>
|
|
214
214
|
{/if}
|
|
215
215
|
|
|
216
|
-
<div class="min-w-0
|
|
216
|
+
<div class="min-w-0 px-4 py-5 sm:px-6 sm:py-6 flex-1">
|
|
217
217
|
{#if children}{@render children()}{/if}
|
|
218
218
|
</div>
|
|
219
219
|
</section>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Component, Snippet } from 'svelte';
|
|
3
3
|
import Divider from '../../atoms/Divider/Divider.svelte';
|
|
4
|
+
import RailMark from '../../atoms/RailMark/RailMark.svelte';
|
|
4
5
|
|
|
5
6
|
export type SidebarIcon = Component<{
|
|
6
7
|
class?: string;
|
|
@@ -55,10 +56,10 @@
|
|
|
55
56
|
|
|
56
57
|
function itemClass(item: SidebarItem) {
|
|
57
58
|
return [
|
|
58
|
-
'flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-sm transition-colors',
|
|
59
|
+
'relative flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-sm transition-colors',
|
|
59
60
|
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/30',
|
|
60
61
|
value === item.id
|
|
61
|
-
? 'bg-
|
|
62
|
+
? 'bg-surface-overlay font-medium text-primary'
|
|
62
63
|
: 'text-secondary hover:bg-surface-overlay hover:text-primary',
|
|
63
64
|
item.disabled && 'pointer-events-none cursor-not-allowed opacity-40',
|
|
64
65
|
collapsed && 'justify-center'
|
|
@@ -87,6 +88,7 @@
|
|
|
87
88
|
class={itemClass(item)}
|
|
88
89
|
onclick={() => select(item.id, item.disabled)}
|
|
89
90
|
>
|
|
91
|
+
<RailMark active={value === item.id} side="right" length="short" inset="sm" />
|
|
90
92
|
{@render itemGlyph(item)}
|
|
91
93
|
{#if !collapsed}
|
|
92
94
|
<span class="truncate">{item.label}</span>
|
|
@@ -101,6 +103,7 @@
|
|
|
101
103
|
class={itemClass(item)}
|
|
102
104
|
onclick={() => select(item.id, item.disabled)}
|
|
103
105
|
>
|
|
106
|
+
<RailMark active={value === item.id} side="right" length="short" inset="sm" />
|
|
104
107
|
{@render itemGlyph(item)}
|
|
105
108
|
{#if !collapsed}
|
|
106
109
|
<span class="truncate">{item.label}</span>
|