sv5ui 1.2.0 → 1.4.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/README.md +16 -11
  2. package/dist/CheckboxGroup/CheckboxGroup.svelte +215 -0
  3. package/dist/CheckboxGroup/CheckboxGroup.svelte.d.ts +5 -0
  4. package/dist/CheckboxGroup/checkbox-group.types.d.ts +130 -0
  5. package/dist/CheckboxGroup/checkbox-group.types.js +1 -0
  6. package/dist/CheckboxGroup/checkbox-group.variants.d.ts +553 -0
  7. package/dist/CheckboxGroup/checkbox-group.variants.js +231 -0
  8. package/dist/CheckboxGroup/index.d.ts +2 -0
  9. package/dist/CheckboxGroup/index.js +1 -0
  10. package/dist/Collapsible/Collapsible.svelte +69 -0
  11. package/dist/Collapsible/Collapsible.svelte.d.ts +6 -0
  12. package/dist/Collapsible/CollapsibleTestWrapper.svelte +17 -0
  13. package/dist/Collapsible/CollapsibleTestWrapper.svelte.d.ts +4 -0
  14. package/dist/Collapsible/collapsible.types.d.ts +75 -0
  15. package/dist/Collapsible/collapsible.types.js +1 -0
  16. package/dist/Collapsible/collapsible.variants.d.ts +53 -0
  17. package/dist/Collapsible/collapsible.variants.js +21 -0
  18. package/dist/Collapsible/index.d.ts +2 -0
  19. package/dist/Collapsible/index.js +1 -0
  20. package/dist/Command/Command.svelte +183 -0
  21. package/dist/Command/Command.svelte.d.ts +6 -0
  22. package/dist/Command/CommandTestWrapper.svelte +13 -0
  23. package/dist/Command/CommandTestWrapper.svelte.d.ts +4 -0
  24. package/dist/Command/command.types.d.ts +98 -0
  25. package/dist/Command/command.types.js +1 -0
  26. package/dist/Command/command.variants.d.ts +226 -0
  27. package/dist/Command/command.variants.js +86 -0
  28. package/dist/Command/index.d.ts +2 -0
  29. package/dist/Command/index.js +1 -0
  30. package/dist/FileUpload/FileUpload.svelte +561 -0
  31. package/dist/FileUpload/FileUpload.svelte.d.ts +8 -0
  32. package/dist/FileUpload/file-upload.types.d.ts +164 -0
  33. package/dist/FileUpload/file-upload.types.js +1 -0
  34. package/dist/FileUpload/file-upload.variants.d.ts +397 -0
  35. package/dist/FileUpload/file-upload.variants.js +224 -0
  36. package/dist/FileUpload/index.d.ts +2 -0
  37. package/dist/FileUpload/index.js +1 -0
  38. package/dist/PinInput/PinInput.svelte +150 -0
  39. package/dist/PinInput/PinInput.svelte.d.ts +6 -0
  40. package/dist/PinInput/index.d.ts +2 -0
  41. package/dist/PinInput/index.js +1 -0
  42. package/dist/PinInput/pin-input.types.d.ts +99 -0
  43. package/dist/PinInput/pin-input.types.js +1 -0
  44. package/dist/PinInput/pin-input.variants.d.ts +303 -0
  45. package/dist/PinInput/pin-input.variants.js +196 -0
  46. package/dist/Select/select.variants.js +1 -1
  47. package/dist/SelectMenu/select-menu.variants.js +1 -1
  48. package/dist/Slider/Slider.svelte +135 -0
  49. package/dist/Slider/Slider.svelte.d.ts +6 -0
  50. package/dist/Slider/index.d.ts +2 -0
  51. package/dist/Slider/index.js +1 -0
  52. package/dist/Slider/slider.types.d.ts +55 -0
  53. package/dist/Slider/slider.types.js +1 -0
  54. package/dist/Slider/slider.variants.d.ts +383 -0
  55. package/dist/Slider/slider.variants.js +102 -0
  56. package/dist/Toast/Toaster.svelte +618 -0
  57. package/dist/Toast/Toaster.svelte.d.ts +5 -0
  58. package/dist/Toast/index.d.ts +4 -0
  59. package/dist/Toast/index.js +2 -0
  60. package/dist/Toast/toast.d.ts +38 -0
  61. package/dist/Toast/toast.js +73 -0
  62. package/dist/Toast/toast.types.d.ts +19 -0
  63. package/dist/Toast/toast.types.js +1 -0
  64. package/dist/Toast/toast.variants.d.ts +7 -0
  65. package/dist/Toast/toast.variants.js +5 -0
  66. package/dist/config.d.ts +5 -0
  67. package/dist/config.js +6 -1
  68. package/dist/index.d.ts +7 -0
  69. package/dist/index.js +7 -0
  70. package/dist/theme.css +36 -0
  71. package/package.json +2 -1
@@ -0,0 +1,164 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import type { ClassNameValue } from 'tailwind-merge';
4
+ import type { FileUploadVariantProps, FileUploadSlots } from './file-upload.variants.js';
5
+ export type FileUploadProps = Omit<HTMLAttributes<HTMLElement>, 'class' | 'children'> & {
6
+ /**
7
+ * Bindable reference to the root DOM element.
8
+ */
9
+ ref?: HTMLElement | null;
10
+ /**
11
+ * The list of selected files. Supports two-way binding with `bind:value`.
12
+ * @default []
13
+ */
14
+ value?: File[];
15
+ /**
16
+ * Callback when the selected files change.
17
+ */
18
+ onValueChange?: (value: File[]) => void;
19
+ /**
20
+ * Allow multiple files to be selected.
21
+ * @default false
22
+ */
23
+ multiple?: boolean;
24
+ /**
25
+ * Accepted file types as MIME types or extensions (e.g. "image/*,.pdf").
26
+ */
27
+ accept?: string;
28
+ /**
29
+ * Enable drag-and-drop file upload.
30
+ * @default true
31
+ */
32
+ dropzone?: boolean;
33
+ /**
34
+ * Whether clicking the area opens the file dialog.
35
+ * @default true
36
+ */
37
+ interactive?: boolean;
38
+ /**
39
+ * Label text displayed in the upload area.
40
+ * @default 'Drop files here or click to upload'
41
+ */
42
+ label?: string;
43
+ /**
44
+ * Description text displayed below the label.
45
+ */
46
+ description?: string;
47
+ /**
48
+ * Icon displayed in the upload area.
49
+ * @default 'lucide:upload'
50
+ */
51
+ icon?: string;
52
+ /**
53
+ * Color scheme of the upload area.
54
+ * @default 'primary'
55
+ */
56
+ color?: NonNullable<FileUploadVariantProps['color']>;
57
+ /**
58
+ * Size of the upload area and file items.
59
+ * @default 'md'
60
+ */
61
+ size?: NonNullable<FileUploadVariantProps['size']>;
62
+ /**
63
+ * Visual style of the upload trigger.
64
+ * @default 'area'
65
+ */
66
+ variant?: NonNullable<FileUploadVariantProps['variant']>;
67
+ /**
68
+ * Layout of the file list.
69
+ * @default 'list'
70
+ */
71
+ layout?: NonNullable<FileUploadVariantProps['layout']>;
72
+ /**
73
+ * Whether the upload area is disabled.
74
+ * @default false
75
+ */
76
+ disabled?: boolean;
77
+ /**
78
+ * Show a loading state on the upload area.
79
+ * @default false
80
+ */
81
+ loading?: boolean;
82
+ /**
83
+ * Icon displayed in the loading state.
84
+ * @default Uses `icons.loading` from app config
85
+ */
86
+ loadingIcon?: string;
87
+ /**
88
+ * Show the file list after selection.
89
+ * @default true
90
+ */
91
+ preview?: boolean;
92
+ /**
93
+ * Highlight the upload area border with the active color.
94
+ * @default false
95
+ */
96
+ highlight?: boolean;
97
+ /**
98
+ * The name attribute for the file input (used in form submission).
99
+ */
100
+ name?: string;
101
+ /**
102
+ * The HTML id attribute for the root element.
103
+ */
104
+ id?: string;
105
+ /**
106
+ * Mark the file input as required for form submission.
107
+ * @default false
108
+ */
109
+ required?: boolean;
110
+ /**
111
+ * Icon displayed for non-image files.
112
+ * @default 'lucide:file'
113
+ */
114
+ fileIcon?: string;
115
+ /**
116
+ * Show a preview button on image files in the list to open a lightbox.
117
+ * @default true
118
+ */
119
+ imagePreview?: boolean;
120
+ /**
121
+ * Custom snippet for the leading icon/avatar inside the upload area.
122
+ */
123
+ leadingSlot?: Snippet;
124
+ /**
125
+ * Custom snippet for the label text.
126
+ */
127
+ labelSlot?: Snippet;
128
+ /**
129
+ * Custom snippet for the description text.
130
+ */
131
+ descriptionSlot?: Snippet;
132
+ /**
133
+ * Custom snippet for action buttons. Receives `open()` to trigger the file dialog.
134
+ */
135
+ actionsSlot?: Snippet<[{
136
+ open: () => void;
137
+ }]>;
138
+ /**
139
+ * Custom snippet to replace the entire file list.
140
+ */
141
+ filesSlot?: Snippet<[{
142
+ files: File[];
143
+ }]>;
144
+ /**
145
+ * Custom snippet for each file item.
146
+ */
147
+ fileSlot?: Snippet<[{
148
+ file: File;
149
+ index: number;
150
+ remove: () => void;
151
+ }]>;
152
+ /**
153
+ * Default slot for additional content inside the upload area.
154
+ */
155
+ children?: Snippet;
156
+ /**
157
+ * Additional CSS classes for the root element.
158
+ */
159
+ class?: ClassNameValue;
160
+ /**
161
+ * Override styles for specific upload slots.
162
+ */
163
+ ui?: Partial<Record<FileUploadSlots, ClassNameValue>>;
164
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,397 @@
1
+ import { type VariantProps } from 'tailwind-variants';
2
+ export declare const fileUploadVariants: import("tailwind-variants").TVReturnType<{
3
+ color: {
4
+ primary: {
5
+ base: string;
6
+ };
7
+ secondary: {
8
+ base: string;
9
+ };
10
+ tertiary: {
11
+ base: string;
12
+ };
13
+ success: {
14
+ base: string;
15
+ };
16
+ warning: {
17
+ base: string;
18
+ };
19
+ error: {
20
+ base: string;
21
+ };
22
+ info: {
23
+ base: string;
24
+ };
25
+ surface: {
26
+ base: string;
27
+ };
28
+ };
29
+ variant: {
30
+ area: {
31
+ base: string;
32
+ wrapper: string;
33
+ };
34
+ button: {};
35
+ };
36
+ size: {
37
+ xs: {
38
+ base: string;
39
+ icon: string;
40
+ label: string;
41
+ description: string;
42
+ file: string;
43
+ fileWrapper: string;
44
+ };
45
+ sm: {
46
+ base: string;
47
+ icon: string;
48
+ label: string;
49
+ description: string;
50
+ file: string;
51
+ fileWrapper: string;
52
+ };
53
+ md: {
54
+ base: string;
55
+ icon: string;
56
+ label: string;
57
+ description: string;
58
+ file: string;
59
+ };
60
+ lg: {
61
+ base: string;
62
+ icon: string;
63
+ label: string;
64
+ description: string;
65
+ file: string;
66
+ fileSize: string;
67
+ };
68
+ xl: {
69
+ base: string;
70
+ icon: string;
71
+ label: string;
72
+ description: string;
73
+ file: string;
74
+ };
75
+ };
76
+ layout: {
77
+ list: {
78
+ root: string;
79
+ files: string;
80
+ file: string;
81
+ fileTrailing: string;
82
+ };
83
+ grid: {
84
+ root: string;
85
+ files: string;
86
+ file: string;
87
+ fileWrapper: string;
88
+ fileLeading: string;
89
+ fileTrailing: string;
90
+ };
91
+ };
92
+ dropzone: {
93
+ true: {
94
+ base: string;
95
+ };
96
+ };
97
+ interactive: {
98
+ true: {
99
+ base: string;
100
+ };
101
+ };
102
+ highlight: {
103
+ true: {};
104
+ };
105
+ multiple: {
106
+ true: {};
107
+ };
108
+ disabled: {
109
+ true: {
110
+ base: string;
111
+ };
112
+ };
113
+ }, {
114
+ root: string;
115
+ base: string[];
116
+ wrapper: string;
117
+ icon: string;
118
+ label: string;
119
+ description: string;
120
+ actions: string;
121
+ files: string;
122
+ file: string;
123
+ fileLeading: string;
124
+ fileWrapper: string;
125
+ fileName: string;
126
+ fileSize: string;
127
+ fileTrailing: string;
128
+ previewContent: string;
129
+ previewBody: string;
130
+ }, undefined, {
131
+ color: {
132
+ primary: {
133
+ base: string;
134
+ };
135
+ secondary: {
136
+ base: string;
137
+ };
138
+ tertiary: {
139
+ base: string;
140
+ };
141
+ success: {
142
+ base: string;
143
+ };
144
+ warning: {
145
+ base: string;
146
+ };
147
+ error: {
148
+ base: string;
149
+ };
150
+ info: {
151
+ base: string;
152
+ };
153
+ surface: {
154
+ base: string;
155
+ };
156
+ };
157
+ variant: {
158
+ area: {
159
+ base: string;
160
+ wrapper: string;
161
+ };
162
+ button: {};
163
+ };
164
+ size: {
165
+ xs: {
166
+ base: string;
167
+ icon: string;
168
+ label: string;
169
+ description: string;
170
+ file: string;
171
+ fileWrapper: string;
172
+ };
173
+ sm: {
174
+ base: string;
175
+ icon: string;
176
+ label: string;
177
+ description: string;
178
+ file: string;
179
+ fileWrapper: string;
180
+ };
181
+ md: {
182
+ base: string;
183
+ icon: string;
184
+ label: string;
185
+ description: string;
186
+ file: string;
187
+ };
188
+ lg: {
189
+ base: string;
190
+ icon: string;
191
+ label: string;
192
+ description: string;
193
+ file: string;
194
+ fileSize: string;
195
+ };
196
+ xl: {
197
+ base: string;
198
+ icon: string;
199
+ label: string;
200
+ description: string;
201
+ file: string;
202
+ };
203
+ };
204
+ layout: {
205
+ list: {
206
+ root: string;
207
+ files: string;
208
+ file: string;
209
+ fileTrailing: string;
210
+ };
211
+ grid: {
212
+ root: string;
213
+ files: string;
214
+ file: string;
215
+ fileWrapper: string;
216
+ fileLeading: string;
217
+ fileTrailing: string;
218
+ };
219
+ };
220
+ dropzone: {
221
+ true: {
222
+ base: string;
223
+ };
224
+ };
225
+ interactive: {
226
+ true: {
227
+ base: string;
228
+ };
229
+ };
230
+ highlight: {
231
+ true: {};
232
+ };
233
+ multiple: {
234
+ true: {};
235
+ };
236
+ disabled: {
237
+ true: {
238
+ base: string;
239
+ };
240
+ };
241
+ }, {
242
+ root: string;
243
+ base: string[];
244
+ wrapper: string;
245
+ icon: string;
246
+ label: string;
247
+ description: string;
248
+ actions: string;
249
+ files: string;
250
+ file: string;
251
+ fileLeading: string;
252
+ fileWrapper: string;
253
+ fileName: string;
254
+ fileSize: string;
255
+ fileTrailing: string;
256
+ previewContent: string;
257
+ previewBody: string;
258
+ }, import("tailwind-variants").TVReturnType<{
259
+ color: {
260
+ primary: {
261
+ base: string;
262
+ };
263
+ secondary: {
264
+ base: string;
265
+ };
266
+ tertiary: {
267
+ base: string;
268
+ };
269
+ success: {
270
+ base: string;
271
+ };
272
+ warning: {
273
+ base: string;
274
+ };
275
+ error: {
276
+ base: string;
277
+ };
278
+ info: {
279
+ base: string;
280
+ };
281
+ surface: {
282
+ base: string;
283
+ };
284
+ };
285
+ variant: {
286
+ area: {
287
+ base: string;
288
+ wrapper: string;
289
+ };
290
+ button: {};
291
+ };
292
+ size: {
293
+ xs: {
294
+ base: string;
295
+ icon: string;
296
+ label: string;
297
+ description: string;
298
+ file: string;
299
+ fileWrapper: string;
300
+ };
301
+ sm: {
302
+ base: string;
303
+ icon: string;
304
+ label: string;
305
+ description: string;
306
+ file: string;
307
+ fileWrapper: string;
308
+ };
309
+ md: {
310
+ base: string;
311
+ icon: string;
312
+ label: string;
313
+ description: string;
314
+ file: string;
315
+ };
316
+ lg: {
317
+ base: string;
318
+ icon: string;
319
+ label: string;
320
+ description: string;
321
+ file: string;
322
+ fileSize: string;
323
+ };
324
+ xl: {
325
+ base: string;
326
+ icon: string;
327
+ label: string;
328
+ description: string;
329
+ file: string;
330
+ };
331
+ };
332
+ layout: {
333
+ list: {
334
+ root: string;
335
+ files: string;
336
+ file: string;
337
+ fileTrailing: string;
338
+ };
339
+ grid: {
340
+ root: string;
341
+ files: string;
342
+ file: string;
343
+ fileWrapper: string;
344
+ fileLeading: string;
345
+ fileTrailing: string;
346
+ };
347
+ };
348
+ dropzone: {
349
+ true: {
350
+ base: string;
351
+ };
352
+ };
353
+ interactive: {
354
+ true: {
355
+ base: string;
356
+ };
357
+ };
358
+ highlight: {
359
+ true: {};
360
+ };
361
+ multiple: {
362
+ true: {};
363
+ };
364
+ disabled: {
365
+ true: {
366
+ base: string;
367
+ };
368
+ };
369
+ }, {
370
+ root: string;
371
+ base: string[];
372
+ wrapper: string;
373
+ icon: string;
374
+ label: string;
375
+ description: string;
376
+ actions: string;
377
+ files: string;
378
+ file: string;
379
+ fileLeading: string;
380
+ fileWrapper: string;
381
+ fileName: string;
382
+ fileSize: string;
383
+ fileTrailing: string;
384
+ previewContent: string;
385
+ previewBody: string;
386
+ }, undefined, unknown, unknown, undefined>>;
387
+ export type FileUploadVariantProps = VariantProps<typeof fileUploadVariants>;
388
+ export type FileUploadSlots = keyof ReturnType<typeof fileUploadVariants>;
389
+ export declare const fileUploadDefaults: {
390
+ defaultVariants: {
391
+ color: NonNullable<FileUploadVariantProps["color"]>;
392
+ variant: NonNullable<FileUploadVariantProps["variant"]>;
393
+ size: NonNullable<FileUploadVariantProps["size"]>;
394
+ layout: NonNullable<FileUploadVariantProps["layout"]>;
395
+ };
396
+ slots: Partial<Record<FileUploadSlots, string>>;
397
+ };