sv5ui 1.7.0 → 2.0.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.
- package/dist/Alert/alert.types.d.ts +1 -1
- package/dist/AvatarGroup/AvatarGroup.svelte +5 -3
- package/dist/Banner/Banner.svelte +162 -0
- package/dist/Banner/Banner.svelte.d.ts +5 -0
- package/dist/Banner/banner.types.d.ts +148 -0
- package/dist/Banner/banner.types.js +1 -0
- package/dist/Banner/banner.variants.d.ts +293 -0
- package/dist/Banner/banner.variants.js +86 -0
- package/dist/Banner/index.d.ts +2 -0
- package/dist/Banner/index.js +1 -0
- package/dist/Button/Button.svelte +7 -6
- package/dist/Button/button.types.d.ts +3 -3
- package/dist/Collapsible/collapsible.types.d.ts +4 -2
- package/dist/Drawer/Drawer.svelte +3 -1
- package/dist/DropdownMenu/DropdownMenu.svelte +1 -3
- package/dist/DropdownMenu/DropdownMenuTriggerTestWrapper.svelte +12 -0
- package/dist/DropdownMenu/DropdownMenuTriggerTestWrapper.svelte.d.ts +7 -0
- package/dist/DropdownMenu/dropdown-menu.types.d.ts +17 -9
- package/dist/Editor/Editor.svelte +738 -0
- package/dist/Editor/Editor.svelte.d.ts +6 -0
- package/dist/Editor/EditorUrlPrompt.svelte +111 -0
- package/dist/Editor/EditorUrlPrompt.svelte.d.ts +15 -0
- package/dist/Editor/SlashPopup.svelte +67 -0
- package/dist/Editor/SlashPopup.svelte.d.ts +9 -0
- package/dist/Editor/editor.extensions.d.ts +23 -0
- package/dist/Editor/editor.extensions.js +123 -0
- package/dist/Editor/editor.schemas.d.ts +4 -0
- package/dist/Editor/editor.schemas.js +3 -0
- package/dist/Editor/editor.slash.svelte.d.ts +34 -0
- package/dist/Editor/editor.slash.svelte.js +273 -0
- package/dist/Editor/editor.suggestion.d.ts +7 -0
- package/dist/Editor/editor.suggestion.js +142 -0
- package/dist/Editor/editor.toolbar.d.ts +11 -0
- package/dist/Editor/editor.toolbar.js +212 -0
- package/dist/Editor/editor.types.d.ts +347 -0
- package/dist/Editor/editor.types.js +1 -0
- package/dist/Editor/editor.variants.d.ts +308 -0
- package/dist/Editor/editor.variants.js +150 -0
- package/dist/Editor/index.d.ts +53 -0
- package/dist/Editor/index.js +52 -0
- package/dist/Icon/icon.types.d.ts +4 -1
- package/dist/Input/Input.svelte +22 -16
- package/dist/Input/input.variants.d.ts +0 -15
- package/dist/Input/input.variants.js +1 -20
- package/dist/Link/Link.svelte +4 -3
- package/dist/Link/link.types.d.ts +2 -2
- package/dist/Pagination/Pagination.svelte +7 -1
- package/dist/Pagination/pagination.types.d.ts +4 -1
- package/dist/Pagination/pagination.variants.d.ts +0 -72
- package/dist/Pagination/pagination.variants.js +6 -30
- package/dist/Select/Select.svelte +3 -1
- package/dist/Select/select.types.d.ts +5 -9
- package/dist/SelectMenu/SelectMenu.svelte +6 -5
- package/dist/SelectMenu/SelectMenuFormFieldTestWrapper.svelte +11 -0
- package/dist/SelectMenu/SelectMenuFormFieldTestWrapper.svelte.d.ts +7 -0
- package/dist/SelectMenu/select-menu.types.d.ts +5 -2
- package/dist/SelectMenu/select-menu.variants.d.ts +12 -2
- package/dist/SelectMenu/select-menu.variants.js +10 -1
- package/dist/Separator/Separator.svelte +9 -2
- package/dist/Separator/separator.types.d.ts +5 -0
- package/dist/Separator/separator.variants.d.ts +25 -0
- package/dist/Separator/separator.variants.js +7 -1
- package/dist/Stepper/Stepper.svelte +292 -0
- package/dist/Stepper/Stepper.svelte.d.ts +5 -0
- package/dist/Stepper/index.d.ts +2 -0
- package/dist/Stepper/index.js +1 -0
- package/dist/Stepper/stepper.types.d.ts +223 -0
- package/dist/Stepper/stepper.types.js +1 -0
- package/dist/Stepper/stepper.variants.d.ts +428 -0
- package/dist/Stepper/stepper.variants.js +204 -0
- package/dist/Tabs/Tabs.svelte +4 -2
- package/dist/Tabs/tabs.types.d.ts +4 -6
- package/dist/hooks/HookContextProbe.svelte +7 -0
- package/dist/hooks/HookContextProbe.svelte.d.ts +18 -0
- package/dist/hooks/HookContextProvider.svelte +9 -0
- package/dist/hooks/HookContextProvider.svelte.d.ts +18 -0
- package/dist/hooks/HookEmitProbe.svelte +14 -0
- package/dist/hooks/HookEmitProbe.svelte.d.ts +18 -0
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useFormField.svelte.d.ts +0 -31
- package/dist/hooks/useFormField.svelte.js +0 -21
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/package.json +97 -1
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
import { type VariantProps } from 'tailwind-variants';
|
|
2
|
+
export declare const stepperVariants: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
orientation: {
|
|
4
|
+
horizontal: {
|
|
5
|
+
list: string;
|
|
6
|
+
item: string;
|
|
7
|
+
trigger: string;
|
|
8
|
+
container: string;
|
|
9
|
+
wrapper: string;
|
|
10
|
+
separator: string;
|
|
11
|
+
};
|
|
12
|
+
vertical: {
|
|
13
|
+
list: string;
|
|
14
|
+
item: string;
|
|
15
|
+
trigger: string;
|
|
16
|
+
container: string;
|
|
17
|
+
wrapper: string;
|
|
18
|
+
separator: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
size: {
|
|
22
|
+
xs: {
|
|
23
|
+
indicator: string;
|
|
24
|
+
title: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
sm: {
|
|
28
|
+
indicator: string;
|
|
29
|
+
title: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
md: {
|
|
33
|
+
indicator: string;
|
|
34
|
+
title: string;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
lg: {
|
|
38
|
+
indicator: string;
|
|
39
|
+
title: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
xl: {
|
|
43
|
+
indicator: string;
|
|
44
|
+
title: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
color: {
|
|
49
|
+
primary: {
|
|
50
|
+
indicator: string;
|
|
51
|
+
};
|
|
52
|
+
secondary: {
|
|
53
|
+
indicator: string;
|
|
54
|
+
};
|
|
55
|
+
tertiary: {
|
|
56
|
+
indicator: string;
|
|
57
|
+
};
|
|
58
|
+
success: {
|
|
59
|
+
indicator: string;
|
|
60
|
+
};
|
|
61
|
+
warning: {
|
|
62
|
+
indicator: string;
|
|
63
|
+
};
|
|
64
|
+
error: {
|
|
65
|
+
indicator: string;
|
|
66
|
+
};
|
|
67
|
+
info: {
|
|
68
|
+
indicator: string;
|
|
69
|
+
};
|
|
70
|
+
surface: {
|
|
71
|
+
indicator: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
}, {
|
|
75
|
+
root: string;
|
|
76
|
+
list: string;
|
|
77
|
+
item: string;
|
|
78
|
+
trigger: string[];
|
|
79
|
+
container: string;
|
|
80
|
+
indicator: string[];
|
|
81
|
+
separator: string;
|
|
82
|
+
wrapper: string;
|
|
83
|
+
title: string;
|
|
84
|
+
description: string;
|
|
85
|
+
content: string;
|
|
86
|
+
}, undefined, {
|
|
87
|
+
orientation: {
|
|
88
|
+
horizontal: {
|
|
89
|
+
list: string;
|
|
90
|
+
item: string;
|
|
91
|
+
trigger: string;
|
|
92
|
+
container: string;
|
|
93
|
+
wrapper: string;
|
|
94
|
+
separator: string;
|
|
95
|
+
};
|
|
96
|
+
vertical: {
|
|
97
|
+
list: string;
|
|
98
|
+
item: string;
|
|
99
|
+
trigger: string;
|
|
100
|
+
container: string;
|
|
101
|
+
wrapper: string;
|
|
102
|
+
separator: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
size: {
|
|
106
|
+
xs: {
|
|
107
|
+
indicator: string;
|
|
108
|
+
title: string;
|
|
109
|
+
description: string;
|
|
110
|
+
};
|
|
111
|
+
sm: {
|
|
112
|
+
indicator: string;
|
|
113
|
+
title: string;
|
|
114
|
+
description: string;
|
|
115
|
+
};
|
|
116
|
+
md: {
|
|
117
|
+
indicator: string;
|
|
118
|
+
title: string;
|
|
119
|
+
description: string;
|
|
120
|
+
};
|
|
121
|
+
lg: {
|
|
122
|
+
indicator: string;
|
|
123
|
+
title: string;
|
|
124
|
+
description: string;
|
|
125
|
+
};
|
|
126
|
+
xl: {
|
|
127
|
+
indicator: string;
|
|
128
|
+
title: string;
|
|
129
|
+
description: string;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
color: {
|
|
133
|
+
primary: {
|
|
134
|
+
indicator: string;
|
|
135
|
+
};
|
|
136
|
+
secondary: {
|
|
137
|
+
indicator: string;
|
|
138
|
+
};
|
|
139
|
+
tertiary: {
|
|
140
|
+
indicator: string;
|
|
141
|
+
};
|
|
142
|
+
success: {
|
|
143
|
+
indicator: string;
|
|
144
|
+
};
|
|
145
|
+
warning: {
|
|
146
|
+
indicator: string;
|
|
147
|
+
};
|
|
148
|
+
error: {
|
|
149
|
+
indicator: string;
|
|
150
|
+
};
|
|
151
|
+
info: {
|
|
152
|
+
indicator: string;
|
|
153
|
+
};
|
|
154
|
+
surface: {
|
|
155
|
+
indicator: string;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
}, {
|
|
159
|
+
root: string;
|
|
160
|
+
list: string;
|
|
161
|
+
item: string;
|
|
162
|
+
trigger: string[];
|
|
163
|
+
container: string;
|
|
164
|
+
indicator: string[];
|
|
165
|
+
separator: string;
|
|
166
|
+
wrapper: string;
|
|
167
|
+
title: string;
|
|
168
|
+
description: string;
|
|
169
|
+
content: string;
|
|
170
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
171
|
+
orientation: {
|
|
172
|
+
horizontal: {
|
|
173
|
+
list: string;
|
|
174
|
+
item: string;
|
|
175
|
+
trigger: string;
|
|
176
|
+
container: string;
|
|
177
|
+
wrapper: string;
|
|
178
|
+
separator: string;
|
|
179
|
+
};
|
|
180
|
+
vertical: {
|
|
181
|
+
list: string;
|
|
182
|
+
item: string;
|
|
183
|
+
trigger: string;
|
|
184
|
+
container: string;
|
|
185
|
+
wrapper: string;
|
|
186
|
+
separator: string;
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
size: {
|
|
190
|
+
xs: {
|
|
191
|
+
indicator: string;
|
|
192
|
+
title: string;
|
|
193
|
+
description: string;
|
|
194
|
+
};
|
|
195
|
+
sm: {
|
|
196
|
+
indicator: string;
|
|
197
|
+
title: string;
|
|
198
|
+
description: string;
|
|
199
|
+
};
|
|
200
|
+
md: {
|
|
201
|
+
indicator: string;
|
|
202
|
+
title: string;
|
|
203
|
+
description: string;
|
|
204
|
+
};
|
|
205
|
+
lg: {
|
|
206
|
+
indicator: string;
|
|
207
|
+
title: string;
|
|
208
|
+
description: string;
|
|
209
|
+
};
|
|
210
|
+
xl: {
|
|
211
|
+
indicator: string;
|
|
212
|
+
title: string;
|
|
213
|
+
description: string;
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
color: {
|
|
217
|
+
primary: {
|
|
218
|
+
indicator: string;
|
|
219
|
+
};
|
|
220
|
+
secondary: {
|
|
221
|
+
indicator: string;
|
|
222
|
+
};
|
|
223
|
+
tertiary: {
|
|
224
|
+
indicator: string;
|
|
225
|
+
};
|
|
226
|
+
success: {
|
|
227
|
+
indicator: string;
|
|
228
|
+
};
|
|
229
|
+
warning: {
|
|
230
|
+
indicator: string;
|
|
231
|
+
};
|
|
232
|
+
error: {
|
|
233
|
+
indicator: string;
|
|
234
|
+
};
|
|
235
|
+
info: {
|
|
236
|
+
indicator: string;
|
|
237
|
+
};
|
|
238
|
+
surface: {
|
|
239
|
+
indicator: string;
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
}, {
|
|
243
|
+
root: string;
|
|
244
|
+
list: string;
|
|
245
|
+
item: string;
|
|
246
|
+
trigger: string[];
|
|
247
|
+
container: string;
|
|
248
|
+
indicator: string[];
|
|
249
|
+
separator: string;
|
|
250
|
+
wrapper: string;
|
|
251
|
+
title: string;
|
|
252
|
+
description: string;
|
|
253
|
+
content: string;
|
|
254
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
255
|
+
export type StepperVariantProps = VariantProps<typeof stepperVariants>;
|
|
256
|
+
export type StepperSlots = keyof ReturnType<typeof stepperVariants>;
|
|
257
|
+
export declare const stepperDefaults: {
|
|
258
|
+
defaultVariants: import("tailwind-variants").TVDefaultVariants<{
|
|
259
|
+
orientation: {
|
|
260
|
+
horizontal: {
|
|
261
|
+
list: string;
|
|
262
|
+
item: string;
|
|
263
|
+
trigger: string;
|
|
264
|
+
container: string;
|
|
265
|
+
wrapper: string;
|
|
266
|
+
separator: string;
|
|
267
|
+
};
|
|
268
|
+
vertical: {
|
|
269
|
+
list: string;
|
|
270
|
+
item: string;
|
|
271
|
+
trigger: string;
|
|
272
|
+
container: string;
|
|
273
|
+
wrapper: string;
|
|
274
|
+
separator: string;
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
size: {
|
|
278
|
+
xs: {
|
|
279
|
+
indicator: string;
|
|
280
|
+
title: string;
|
|
281
|
+
description: string;
|
|
282
|
+
};
|
|
283
|
+
sm: {
|
|
284
|
+
indicator: string;
|
|
285
|
+
title: string;
|
|
286
|
+
description: string;
|
|
287
|
+
};
|
|
288
|
+
md: {
|
|
289
|
+
indicator: string;
|
|
290
|
+
title: string;
|
|
291
|
+
description: string;
|
|
292
|
+
};
|
|
293
|
+
lg: {
|
|
294
|
+
indicator: string;
|
|
295
|
+
title: string;
|
|
296
|
+
description: string;
|
|
297
|
+
};
|
|
298
|
+
xl: {
|
|
299
|
+
indicator: string;
|
|
300
|
+
title: string;
|
|
301
|
+
description: string;
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
color: {
|
|
305
|
+
primary: {
|
|
306
|
+
indicator: string;
|
|
307
|
+
};
|
|
308
|
+
secondary: {
|
|
309
|
+
indicator: string;
|
|
310
|
+
};
|
|
311
|
+
tertiary: {
|
|
312
|
+
indicator: string;
|
|
313
|
+
};
|
|
314
|
+
success: {
|
|
315
|
+
indicator: string;
|
|
316
|
+
};
|
|
317
|
+
warning: {
|
|
318
|
+
indicator: string;
|
|
319
|
+
};
|
|
320
|
+
error: {
|
|
321
|
+
indicator: string;
|
|
322
|
+
};
|
|
323
|
+
info: {
|
|
324
|
+
indicator: string;
|
|
325
|
+
};
|
|
326
|
+
surface: {
|
|
327
|
+
indicator: string;
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
}, {
|
|
331
|
+
root: string;
|
|
332
|
+
list: string;
|
|
333
|
+
item: string;
|
|
334
|
+
trigger: string[];
|
|
335
|
+
container: string;
|
|
336
|
+
indicator: string[];
|
|
337
|
+
separator: string;
|
|
338
|
+
wrapper: string;
|
|
339
|
+
title: string;
|
|
340
|
+
description: string;
|
|
341
|
+
content: string;
|
|
342
|
+
}, {
|
|
343
|
+
orientation: {
|
|
344
|
+
horizontal: {
|
|
345
|
+
list: string;
|
|
346
|
+
item: string;
|
|
347
|
+
trigger: string;
|
|
348
|
+
container: string;
|
|
349
|
+
wrapper: string;
|
|
350
|
+
separator: string;
|
|
351
|
+
};
|
|
352
|
+
vertical: {
|
|
353
|
+
list: string;
|
|
354
|
+
item: string;
|
|
355
|
+
trigger: string;
|
|
356
|
+
container: string;
|
|
357
|
+
wrapper: string;
|
|
358
|
+
separator: string;
|
|
359
|
+
};
|
|
360
|
+
};
|
|
361
|
+
size: {
|
|
362
|
+
xs: {
|
|
363
|
+
indicator: string;
|
|
364
|
+
title: string;
|
|
365
|
+
description: string;
|
|
366
|
+
};
|
|
367
|
+
sm: {
|
|
368
|
+
indicator: string;
|
|
369
|
+
title: string;
|
|
370
|
+
description: string;
|
|
371
|
+
};
|
|
372
|
+
md: {
|
|
373
|
+
indicator: string;
|
|
374
|
+
title: string;
|
|
375
|
+
description: string;
|
|
376
|
+
};
|
|
377
|
+
lg: {
|
|
378
|
+
indicator: string;
|
|
379
|
+
title: string;
|
|
380
|
+
description: string;
|
|
381
|
+
};
|
|
382
|
+
xl: {
|
|
383
|
+
indicator: string;
|
|
384
|
+
title: string;
|
|
385
|
+
description: string;
|
|
386
|
+
};
|
|
387
|
+
};
|
|
388
|
+
color: {
|
|
389
|
+
primary: {
|
|
390
|
+
indicator: string;
|
|
391
|
+
};
|
|
392
|
+
secondary: {
|
|
393
|
+
indicator: string;
|
|
394
|
+
};
|
|
395
|
+
tertiary: {
|
|
396
|
+
indicator: string;
|
|
397
|
+
};
|
|
398
|
+
success: {
|
|
399
|
+
indicator: string;
|
|
400
|
+
};
|
|
401
|
+
warning: {
|
|
402
|
+
indicator: string;
|
|
403
|
+
};
|
|
404
|
+
error: {
|
|
405
|
+
indicator: string;
|
|
406
|
+
};
|
|
407
|
+
info: {
|
|
408
|
+
indicator: string;
|
|
409
|
+
};
|
|
410
|
+
surface: {
|
|
411
|
+
indicator: string;
|
|
412
|
+
};
|
|
413
|
+
};
|
|
414
|
+
}, {
|
|
415
|
+
root: string;
|
|
416
|
+
list: string;
|
|
417
|
+
item: string;
|
|
418
|
+
trigger: string[];
|
|
419
|
+
container: string;
|
|
420
|
+
indicator: string[];
|
|
421
|
+
separator: string;
|
|
422
|
+
wrapper: string;
|
|
423
|
+
title: string;
|
|
424
|
+
description: string;
|
|
425
|
+
content: string;
|
|
426
|
+
}>;
|
|
427
|
+
slots: Partial<Record<StepperSlots, string>>;
|
|
428
|
+
};
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
export const stepperVariants = tv({
|
|
3
|
+
slots: {
|
|
4
|
+
root: 'flex flex-col gap-4 w-full',
|
|
5
|
+
list: 'flex list-none p-0 m-0',
|
|
6
|
+
item: 'group relative flex flex-1',
|
|
7
|
+
trigger: [
|
|
8
|
+
'group/trigger relative z-10 flex w-full gap-3 text-start rounded-md',
|
|
9
|
+
'enabled:cursor-pointer select-none',
|
|
10
|
+
'focus-visible:outline-none',
|
|
11
|
+
'disabled:cursor-not-allowed disabled:opacity-60'
|
|
12
|
+
],
|
|
13
|
+
container: 'flex shrink-0 items-center justify-center',
|
|
14
|
+
indicator: [
|
|
15
|
+
'relative z-10 inline-flex items-center justify-center shrink-0 rounded-full font-medium',
|
|
16
|
+
'bg-surface-container-highest text-on-surface-variant',
|
|
17
|
+
'transition-colors',
|
|
18
|
+
'group-focus-visible/trigger:ring-2 group-focus-visible/trigger:ring-offset-2 group-focus-visible/trigger:ring-offset-surface'
|
|
19
|
+
],
|
|
20
|
+
separator: 'shrink-0 z-0 rounded-full bg-surface-container-highest transition-colors',
|
|
21
|
+
wrapper: 'flex flex-col min-w-0',
|
|
22
|
+
title: 'font-medium text-on-surface transition-colors',
|
|
23
|
+
description: 'text-on-surface-variant',
|
|
24
|
+
content: 'focus:outline-none'
|
|
25
|
+
},
|
|
26
|
+
variants: {
|
|
27
|
+
orientation: {
|
|
28
|
+
horizontal: {
|
|
29
|
+
list: 'flex-row w-full',
|
|
30
|
+
item: 'flex-col items-center',
|
|
31
|
+
trigger: 'flex-col items-center',
|
|
32
|
+
container: 'w-full',
|
|
33
|
+
wrapper: 'items-center text-center pt-2',
|
|
34
|
+
separator: 'absolute h-0.5 left-1/2 right-[-50%] -translate-y-1/2'
|
|
35
|
+
},
|
|
36
|
+
vertical: {
|
|
37
|
+
list: 'flex-col',
|
|
38
|
+
item: 'flex-row',
|
|
39
|
+
trigger: 'flex-row items-stretch',
|
|
40
|
+
container: 'self-stretch flex-col',
|
|
41
|
+
wrapper: 'items-start',
|
|
42
|
+
separator: 'w-0.5 flex-1 my-1'
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
size: {
|
|
46
|
+
xs: {
|
|
47
|
+
indicator: 'size-6 text-[10px] *:size-3.5',
|
|
48
|
+
title: 'text-xs',
|
|
49
|
+
description: 'text-[11px]'
|
|
50
|
+
},
|
|
51
|
+
sm: {
|
|
52
|
+
indicator: 'size-7 text-xs *:size-4',
|
|
53
|
+
title: 'text-sm',
|
|
54
|
+
description: 'text-xs'
|
|
55
|
+
},
|
|
56
|
+
md: {
|
|
57
|
+
indicator: 'size-8 text-sm *:size-5',
|
|
58
|
+
title: 'text-sm',
|
|
59
|
+
description: 'text-sm'
|
|
60
|
+
},
|
|
61
|
+
lg: {
|
|
62
|
+
indicator: 'size-10 text-base *:size-5',
|
|
63
|
+
title: 'text-base',
|
|
64
|
+
description: 'text-sm'
|
|
65
|
+
},
|
|
66
|
+
xl: {
|
|
67
|
+
indicator: 'size-12 text-lg *:size-6',
|
|
68
|
+
title: 'text-base',
|
|
69
|
+
description: 'text-sm'
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
color: {
|
|
73
|
+
primary: { indicator: 'group-focus-visible/trigger:ring-primary' },
|
|
74
|
+
secondary: { indicator: 'group-focus-visible/trigger:ring-secondary' },
|
|
75
|
+
tertiary: { indicator: 'group-focus-visible/trigger:ring-tertiary' },
|
|
76
|
+
success: { indicator: 'group-focus-visible/trigger:ring-success' },
|
|
77
|
+
warning: { indicator: 'group-focus-visible/trigger:ring-warning' },
|
|
78
|
+
error: { indicator: 'group-focus-visible/trigger:ring-error' },
|
|
79
|
+
info: { indicator: 'group-focus-visible/trigger:ring-info' },
|
|
80
|
+
surface: { indicator: 'group-focus-visible/trigger:ring-outline' }
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
compoundVariants: [
|
|
84
|
+
// -------------------------------------------------------------------
|
|
85
|
+
// Color × state — indicator background, separator fill, active title
|
|
86
|
+
// -------------------------------------------------------------------
|
|
87
|
+
{
|
|
88
|
+
color: 'primary',
|
|
89
|
+
class: {
|
|
90
|
+
indicator: [
|
|
91
|
+
'group-data-[state=completed]:bg-primary group-data-[state=completed]:text-on-primary',
|
|
92
|
+
'group-data-[state=active]:bg-primary group-data-[state=active]:text-on-primary'
|
|
93
|
+
],
|
|
94
|
+
separator: 'group-data-[state=completed]:bg-primary',
|
|
95
|
+
title: 'group-data-[state=active]:text-primary'
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
color: 'secondary',
|
|
100
|
+
class: {
|
|
101
|
+
indicator: [
|
|
102
|
+
'group-data-[state=completed]:bg-secondary group-data-[state=completed]:text-on-secondary',
|
|
103
|
+
'group-data-[state=active]:bg-secondary group-data-[state=active]:text-on-secondary'
|
|
104
|
+
],
|
|
105
|
+
separator: 'group-data-[state=completed]:bg-secondary',
|
|
106
|
+
title: 'group-data-[state=active]:text-secondary'
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
color: 'tertiary',
|
|
111
|
+
class: {
|
|
112
|
+
indicator: [
|
|
113
|
+
'group-data-[state=completed]:bg-tertiary group-data-[state=completed]:text-on-tertiary',
|
|
114
|
+
'group-data-[state=active]:bg-tertiary group-data-[state=active]:text-on-tertiary'
|
|
115
|
+
],
|
|
116
|
+
separator: 'group-data-[state=completed]:bg-tertiary',
|
|
117
|
+
title: 'group-data-[state=active]:text-tertiary'
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
color: 'success',
|
|
122
|
+
class: {
|
|
123
|
+
indicator: [
|
|
124
|
+
'group-data-[state=completed]:bg-success group-data-[state=completed]:text-on-success',
|
|
125
|
+
'group-data-[state=active]:bg-success group-data-[state=active]:text-on-success'
|
|
126
|
+
],
|
|
127
|
+
separator: 'group-data-[state=completed]:bg-success',
|
|
128
|
+
title: 'group-data-[state=active]:text-success'
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
color: 'warning',
|
|
133
|
+
class: {
|
|
134
|
+
indicator: [
|
|
135
|
+
'group-data-[state=completed]:bg-warning group-data-[state=completed]:text-on-warning',
|
|
136
|
+
'group-data-[state=active]:bg-warning group-data-[state=active]:text-on-warning'
|
|
137
|
+
],
|
|
138
|
+
separator: 'group-data-[state=completed]:bg-warning',
|
|
139
|
+
title: 'group-data-[state=active]:text-warning'
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
color: 'error',
|
|
144
|
+
class: {
|
|
145
|
+
indicator: [
|
|
146
|
+
'group-data-[state=completed]:bg-error group-data-[state=completed]:text-on-error',
|
|
147
|
+
'group-data-[state=active]:bg-error group-data-[state=active]:text-on-error'
|
|
148
|
+
],
|
|
149
|
+
separator: 'group-data-[state=completed]:bg-error',
|
|
150
|
+
title: 'group-data-[state=active]:text-error'
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
color: 'info',
|
|
155
|
+
class: {
|
|
156
|
+
indicator: [
|
|
157
|
+
'group-data-[state=completed]:bg-info group-data-[state=completed]:text-on-info',
|
|
158
|
+
'group-data-[state=active]:bg-info group-data-[state=active]:text-on-info'
|
|
159
|
+
],
|
|
160
|
+
separator: 'group-data-[state=completed]:bg-info',
|
|
161
|
+
title: 'group-data-[state=active]:text-info'
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
color: 'surface',
|
|
166
|
+
class: {
|
|
167
|
+
indicator: [
|
|
168
|
+
'group-data-[state=completed]:bg-inverse-surface group-data-[state=completed]:text-inverse-on-surface',
|
|
169
|
+
'group-data-[state=active]:bg-inverse-surface group-data-[state=active]:text-inverse-on-surface'
|
|
170
|
+
],
|
|
171
|
+
separator: 'group-data-[state=completed]:bg-inverse-surface',
|
|
172
|
+
title: 'group-data-[state=active]:text-on-surface'
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
// -------------------------------------------------------------------
|
|
176
|
+
// Horizontal × size — separator vertically centered on indicator,
|
|
177
|
+
// horizontal margins equal indicator radius so the line stops at each
|
|
178
|
+
// indicator's edge (never enters the indicator — important so faded
|
|
179
|
+
// disabled indicators don't reveal the line behind them).
|
|
180
|
+
// -------------------------------------------------------------------
|
|
181
|
+
{ orientation: 'horizontal', size: 'xs', class: { separator: 'top-3 mx-3' } },
|
|
182
|
+
{ orientation: 'horizontal', size: 'sm', class: { separator: 'top-3.5 mx-3.5' } },
|
|
183
|
+
{ orientation: 'horizontal', size: 'md', class: { separator: 'top-4 mx-4' } },
|
|
184
|
+
{ orientation: 'horizontal', size: 'lg', class: { separator: 'top-5 mx-5' } },
|
|
185
|
+
{ orientation: 'horizontal', size: 'xl', class: { separator: 'top-6 mx-6' } },
|
|
186
|
+
// -------------------------------------------------------------------
|
|
187
|
+
// Vertical × size — wrapper bottom padding creates visible line height
|
|
188
|
+
// -------------------------------------------------------------------
|
|
189
|
+
{ orientation: 'vertical', size: 'xs', class: { wrapper: 'pb-6' } },
|
|
190
|
+
{ orientation: 'vertical', size: 'sm', class: { wrapper: 'pb-7' } },
|
|
191
|
+
{ orientation: 'vertical', size: 'md', class: { wrapper: 'pb-8' } },
|
|
192
|
+
{ orientation: 'vertical', size: 'lg', class: { wrapper: 'pb-10' } },
|
|
193
|
+
{ orientation: 'vertical', size: 'xl', class: { wrapper: 'pb-12' } }
|
|
194
|
+
],
|
|
195
|
+
defaultVariants: {
|
|
196
|
+
orientation: 'horizontal',
|
|
197
|
+
size: 'md',
|
|
198
|
+
color: 'primary'
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
export const stepperDefaults = {
|
|
202
|
+
defaultVariants: stepperVariants.defaultVariants,
|
|
203
|
+
slots: {}
|
|
204
|
+
};
|
package/dist/Tabs/Tabs.svelte
CHANGED
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
leading,
|
|
33
33
|
label: labelSlot,
|
|
34
34
|
trailing,
|
|
35
|
-
body: bodySlot
|
|
35
|
+
body: bodySlot,
|
|
36
|
+
...restProps
|
|
36
37
|
}: Props = $props()
|
|
37
38
|
|
|
38
39
|
// Initialize value if not provided (intentionally reads initial values only)
|
|
@@ -131,6 +132,7 @@
|
|
|
131
132
|
</script>
|
|
132
133
|
|
|
133
134
|
<Tabs.Root
|
|
135
|
+
{...restProps}
|
|
134
136
|
bind:ref
|
|
135
137
|
bind:value
|
|
136
138
|
{onValueChange}
|
|
@@ -141,7 +143,7 @@
|
|
|
141
143
|
class={classes.root}
|
|
142
144
|
>
|
|
143
145
|
<Tabs.List bind:ref={listEl} class={classes.list}>
|
|
144
|
-
<div class={classes.indicator} style={indicatorStyle}></div>
|
|
146
|
+
<div class={classes.indicator} style={indicatorStyle} aria-hidden="true"></div>
|
|
145
147
|
|
|
146
148
|
{#each items as item, index (item.value ?? index)}
|
|
147
149
|
{@const itemValue = getItemValue(item, index)}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
import type { ClassNameValue } from 'tailwind-merge';
|
|
3
|
+
import type { TabsRootProps } from 'bits-ui';
|
|
3
4
|
import type { TabsSlots, TabsVariantProps } from './tabs.variants.js';
|
|
4
5
|
/**
|
|
5
6
|
* Configuration for an individual tab item.
|
|
@@ -41,11 +42,6 @@ export interface TabsItem {
|
|
|
41
42
|
* For complex content, use the `body` snippet instead.
|
|
42
43
|
*/
|
|
43
44
|
content?: string;
|
|
44
|
-
/**
|
|
45
|
-
* Named slot identifier for custom content rendering.
|
|
46
|
-
* When provided, allows using dynamic snippet slots for this item.
|
|
47
|
-
*/
|
|
48
|
-
slot?: string;
|
|
49
45
|
/**
|
|
50
46
|
* Additional CSS classes applied to this item's trigger element.
|
|
51
47
|
*/
|
|
@@ -86,7 +82,9 @@ export interface TabsSlotProps {
|
|
|
86
82
|
*
|
|
87
83
|
* @see https://bits-ui.com/docs/components/tabs
|
|
88
84
|
*/
|
|
89
|
-
export interface TabsProps {
|
|
85
|
+
export interface TabsProps extends Pick<TabsRootProps, 'id' | 'style' | 'title' | 'role' | 'tabindex' | 'aria-label' | 'aria-labelledby' | 'aria-describedby' | 'onclick' | 'onkeydown' | 'onmouseenter' | 'onmouseleave' | 'onfocus' | 'onblur'> {
|
|
86
|
+
/** Custom data attributes are forwarded to the root element. */
|
|
87
|
+
[key: `data-${string}`]: unknown;
|
|
90
88
|
/**
|
|
91
89
|
* Bindable reference to the root DOM element.
|
|
92
90
|
*/
|