sv5ui 1.6.0 → 1.8.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.
Files changed (71) hide show
  1. package/dist/Banner/Banner.svelte +162 -0
  2. package/dist/Banner/Banner.svelte.d.ts +5 -0
  3. package/dist/Banner/banner.types.d.ts +148 -0
  4. package/dist/Banner/banner.types.js +1 -0
  5. package/dist/Banner/banner.variants.d.ts +293 -0
  6. package/dist/Banner/banner.variants.js +86 -0
  7. package/dist/Banner/index.d.ts +2 -0
  8. package/dist/Banner/index.js +1 -0
  9. package/dist/Calendar/Calendar.svelte +48 -6
  10. package/dist/Calendar/calendar.types.d.ts +19 -0
  11. package/dist/Calendar/calendar.variants.js +2 -1
  12. package/dist/Carousel/Carousel.svelte +279 -0
  13. package/dist/Carousel/Carousel.svelte.d.ts +26 -0
  14. package/dist/Carousel/carousel.types.d.ts +242 -0
  15. package/dist/Carousel/carousel.types.js +1 -0
  16. package/dist/Carousel/carousel.variants.d.ts +408 -0
  17. package/dist/Carousel/carousel.variants.js +88 -0
  18. package/dist/Carousel/index.d.ts +2 -0
  19. package/dist/Carousel/index.js +1 -0
  20. package/dist/Editor/Editor.svelte +738 -0
  21. package/dist/Editor/Editor.svelte.d.ts +6 -0
  22. package/dist/Editor/EditorUrlPrompt.svelte +111 -0
  23. package/dist/Editor/EditorUrlPrompt.svelte.d.ts +15 -0
  24. package/dist/Editor/SlashPopup.svelte +67 -0
  25. package/dist/Editor/SlashPopup.svelte.d.ts +9 -0
  26. package/dist/Editor/editor.extensions.d.ts +23 -0
  27. package/dist/Editor/editor.extensions.js +123 -0
  28. package/dist/Editor/editor.schemas.d.ts +4 -0
  29. package/dist/Editor/editor.schemas.js +3 -0
  30. package/dist/Editor/editor.slash.svelte.d.ts +34 -0
  31. package/dist/Editor/editor.slash.svelte.js +273 -0
  32. package/dist/Editor/editor.suggestion.d.ts +7 -0
  33. package/dist/Editor/editor.suggestion.js +142 -0
  34. package/dist/Editor/editor.toolbar.d.ts +11 -0
  35. package/dist/Editor/editor.toolbar.js +212 -0
  36. package/dist/Editor/editor.types.d.ts +347 -0
  37. package/dist/Editor/editor.types.js +1 -0
  38. package/dist/Editor/editor.variants.d.ts +308 -0
  39. package/dist/Editor/editor.variants.js +150 -0
  40. package/dist/Editor/index.d.ts +53 -0
  41. package/dist/Editor/index.js +52 -0
  42. package/dist/FileUpload/FileUpload.svelte +81 -10
  43. package/dist/FileUpload/file-upload.types.d.ts +39 -0
  44. package/dist/FileUpload/index.d.ts +1 -1
  45. package/dist/Modal/Modal.svelte +14 -3
  46. package/dist/Modal/modal.types.d.ts +15 -4
  47. package/dist/Modal/modal.variants.d.ts +110 -20
  48. package/dist/Modal/modal.variants.js +27 -9
  49. package/dist/PinInput/PinInput.svelte +18 -4
  50. package/dist/PinInput/pin-input.types.d.ts +11 -0
  51. package/dist/Select/Select.svelte +98 -28
  52. package/dist/Select/select.types.d.ts +44 -2
  53. package/dist/SelectMenu/SelectMenu.svelte +210 -25
  54. package/dist/SelectMenu/select-menu.types.d.ts +62 -1
  55. package/dist/SelectMenu/select-menu.variants.d.ts +26 -0
  56. package/dist/SelectMenu/select-menu.variants.js +34 -6
  57. package/dist/Slideover/Slideover.svelte +13 -2
  58. package/dist/Slideover/slideover.types.d.ts +14 -3
  59. package/dist/Slideover/slideover.variants.d.ts +85 -5
  60. package/dist/Slideover/slideover.variants.js +42 -12
  61. package/dist/Stepper/Stepper.svelte +292 -0
  62. package/dist/Stepper/Stepper.svelte.d.ts +5 -0
  63. package/dist/Stepper/index.d.ts +2 -0
  64. package/dist/Stepper/index.js +1 -0
  65. package/dist/Stepper/stepper.types.d.ts +223 -0
  66. package/dist/Stepper/stepper.types.js +1 -0
  67. package/dist/Stepper/stepper.variants.d.ts +428 -0
  68. package/dist/Stepper/stepper.variants.js +204 -0
  69. package/dist/index.d.ts +3 -0
  70. package/dist/index.js +3 -0
  71. package/package.json +102 -1
@@ -0,0 +1,223 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { ClassNameValue } from 'tailwind-merge';
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+ import type { StepperSlots, StepperVariantProps } from './stepper.variants.js';
5
+ /** Lifecycle state of a single step relative to the active step. */
6
+ export type StepperItemState = 'pending' | 'active' | 'completed';
7
+ /**
8
+ * Configuration for an individual step inside the Stepper.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const item: StepperItem = {
13
+ * value: 'shipping',
14
+ * title: 'Shipping',
15
+ * description: 'Where to deliver',
16
+ * icon: 'lucide:truck'
17
+ * }
18
+ * ```
19
+ */
20
+ export interface StepperItem {
21
+ /**
22
+ * Unique identifier for this step.
23
+ * Falls back to the item's zero-based index when omitted.
24
+ */
25
+ value?: string | number;
26
+ /**
27
+ * Title shown next to (or below) the indicator.
28
+ */
29
+ title?: string;
30
+ /**
31
+ * Sub-text rendered under the title.
32
+ */
33
+ description?: string;
34
+ /**
35
+ * Iconify icon name rendered inside the indicator.
36
+ * Overrides the default number/check fallback.
37
+ */
38
+ icon?: string;
39
+ /**
40
+ * Whether this step cannot be activated by the user.
41
+ * @default false
42
+ */
43
+ disabled?: boolean;
44
+ /**
45
+ * Plain text body content for the active step's content panel.
46
+ * For complex content, use the `body` snippet instead.
47
+ */
48
+ content?: string;
49
+ /**
50
+ * Additional CSS classes applied to this step's wrapper element.
51
+ */
52
+ class?: ClassNameValue;
53
+ /**
54
+ * Per-step overrides for individual slot classes.
55
+ */
56
+ ui?: Partial<Pick<Record<StepperSlots, ClassNameValue>, 'item' | 'trigger' | 'container' | 'indicator' | 'separator' | 'wrapper' | 'title' | 'description' | 'content'>>;
57
+ }
58
+ /**
59
+ * Context passed to every Stepper snippet (`indicator`, `titleSlot`,
60
+ * `descriptionSlot`, `body`).
61
+ */
62
+ export interface StepperSlotProps {
63
+ /** The current step item data. */
64
+ item: StepperItem;
65
+ /** Zero-based position in the `items` array. */
66
+ index: number;
67
+ /** Human-friendly one-based position (`index + 1`). */
68
+ number: number;
69
+ /** Lifecycle state of this step. */
70
+ state: StepperItemState;
71
+ /** Convenience: whether this step is the active one. */
72
+ active: boolean;
73
+ }
74
+ /**
75
+ * Imperative API exposed via `bind:api`. Useful when driving the Stepper from
76
+ * external buttons (e.g. wizard form with Back/Next).
77
+ *
78
+ * @example
79
+ * ```svelte
80
+ * <script>
81
+ * let api = $state<StepperApi>()
82
+ * </script>
83
+ *
84
+ * <Stepper bind:api items={steps} bind:value={current} />
85
+ *
86
+ * <Button onclick={() => api?.prev()} disabled={!api?.hasPrev}>Back</Button>
87
+ * <Button onclick={() => api?.next()} disabled={!api?.hasNext}>Next</Button>
88
+ * ```
89
+ */
90
+ export interface StepperApi {
91
+ /**
92
+ * Advance to the next step. Always bypasses the `linear` gating (the
93
+ * caller is assumed to have validated already).
94
+ */
95
+ next: () => void;
96
+ /**
97
+ * Move back to the previous step. No-op when already at the first step.
98
+ */
99
+ prev: () => void;
100
+ /**
101
+ * Jump to a specific step by its `value`. Always bypasses gating.
102
+ */
103
+ goTo: (value: string | number) => void;
104
+ /** Whether `next()` would move forward. */
105
+ readonly hasNext: boolean;
106
+ /** Whether `prev()` would move back. */
107
+ readonly hasPrev: boolean;
108
+ /** Current active step's zero-based index, or `-1` when none matches. */
109
+ readonly activeIndex: number;
110
+ }
111
+ /**
112
+ * Props for the Stepper component.
113
+ *
114
+ * Renders a horizontal or vertical progression indicator suitable for
115
+ * multi-step wizards and form flows.
116
+ *
117
+ * @example
118
+ * ```svelte
119
+ * <Stepper
120
+ * items={steps}
121
+ * bind:value={current}
122
+ * bind:api
123
+ * color="primary"
124
+ * />
125
+ * ```
126
+ */
127
+ export interface StepperProps extends Omit<HTMLAttributes<HTMLElement>, 'class'> {
128
+ /**
129
+ * Bindable reference to the root DOM element.
130
+ */
131
+ ref?: HTMLElement | null;
132
+ /**
133
+ * The HTML element to render as.
134
+ * @default 'div'
135
+ */
136
+ as?: keyof HTMLElementTagNameMap;
137
+ /**
138
+ * Array of steps to render.
139
+ */
140
+ items?: StepperItem[];
141
+ /**
142
+ * The currently active step's value. Use `bind:value` for two-way binding.
143
+ * Falls back to `defaultValue` when omitted.
144
+ */
145
+ value?: string | number;
146
+ /**
147
+ * Initial active value when uncontrolled. Defaults to the first item's
148
+ * value (or `0` when items have no explicit `value`).
149
+ */
150
+ defaultValue?: string | number;
151
+ /**
152
+ * Fired whenever the active step changes (via click, keyboard, or `api`).
153
+ */
154
+ onValueChange?: (value: string | number) => void;
155
+ /**
156
+ * Bindable imperative controller. Useful for wiring up external Back/Next
157
+ * buttons that bypass the `linear` gating.
158
+ */
159
+ api?: StepperApi;
160
+ /**
161
+ * When `true`, clicking only allows advancing one step at a time. Already
162
+ * completed steps remain freely navigable. The imperative `api.next()`
163
+ * always bypasses this gate.
164
+ * @default true
165
+ */
166
+ linear?: boolean;
167
+ /**
168
+ * Whether all steps are disabled.
169
+ * @default false
170
+ */
171
+ disabled?: boolean;
172
+ /**
173
+ * Layout direction.
174
+ * - `'horizontal'`: indicators in a row, title/description below
175
+ * - `'vertical'`: indicators in a column, title/description to the side
176
+ * @default 'horizontal'
177
+ */
178
+ orientation?: NonNullable<StepperVariantProps['orientation']>;
179
+ /**
180
+ * Size variant controlling indicator dimensions and text sizes.
181
+ * @default 'md'
182
+ */
183
+ size?: NonNullable<StepperVariantProps['size']>;
184
+ /**
185
+ * Color theme for active/completed indicators and separators.
186
+ * @default 'primary'
187
+ */
188
+ color?: NonNullable<StepperVariantProps['color']>;
189
+ /**
190
+ * Whether to render the content panel for the active step.
191
+ * Disable when step content lives elsewhere in the layout.
192
+ * @default true
193
+ */
194
+ content?: boolean;
195
+ /**
196
+ * Additional CSS classes for the root element.
197
+ */
198
+ class?: ClassNameValue;
199
+ /**
200
+ * Override classes for component slots.
201
+ */
202
+ ui?: Partial<Record<StepperSlots, ClassNameValue>>;
203
+ /**
204
+ * Custom indicator content. Receives `{ item, index, number, state, active }`.
205
+ * Replaces the default number/check/icon rendering.
206
+ */
207
+ indicator?: Snippet<[StepperSlotProps]>;
208
+ /**
209
+ * Custom title renderer for every step.
210
+ * Falls back to `item.title` when omitted.
211
+ */
212
+ titleSlot?: Snippet<[StepperSlotProps]>;
213
+ /**
214
+ * Custom description renderer for every step.
215
+ * Falls back to `item.description` when omitted.
216
+ */
217
+ descriptionSlot?: Snippet<[StepperSlotProps]>;
218
+ /**
219
+ * Custom body content shown in the active step's content panel.
220
+ * Falls back to `item.content` text when omitted.
221
+ */
222
+ body?: Snippet<[StepperSlotProps]>;
223
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -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
+ };