sv5ui 1.1.2 → 1.2.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 (155) hide show
  1. package/README.md +6 -0
  2. package/dist/Alert/Alert.svelte +33 -22
  3. package/dist/Alert/Alert.svelte.d.ts +1 -1
  4. package/dist/Alert/alert.types.d.ts +4 -0
  5. package/dist/Avatar/Avatar.svelte +72 -46
  6. package/dist/Avatar/avatar.types.d.ts +36 -3
  7. package/dist/Avatar/avatar.variants.d.ts +138 -0
  8. package/dist/Avatar/avatar.variants.js +23 -12
  9. package/dist/Avatar/index.d.ts +1 -1
  10. package/dist/AvatarGroup/AvatarGroup.svelte +11 -6
  11. package/dist/AvatarGroup/AvatarGroup.svelte.d.ts +1 -1
  12. package/dist/AvatarGroup/avatar-group.types.d.ts +18 -3
  13. package/dist/AvatarGroup/avatar-group.variants.d.ts +85 -0
  14. package/dist/AvatarGroup/avatar-group.variants.js +19 -29
  15. package/dist/Badge/Badge.svelte +4 -3
  16. package/dist/Badge/Badge.svelte.d.ts +1 -1
  17. package/dist/Badge/badge.types.d.ts +9 -0
  18. package/dist/Breadcrumb/Breadcrumb.svelte +20 -7
  19. package/dist/Breadcrumb/Breadcrumb.svelte.d.ts +1 -1
  20. package/dist/Breadcrumb/breadcrumb.types.d.ts +5 -1
  21. package/dist/Breadcrumb/breadcrumb.variants.d.ts +15 -5
  22. package/dist/Breadcrumb/breadcrumb.variants.js +7 -3
  23. package/dist/Button/Button.svelte +71 -16
  24. package/dist/Button/Button.svelte.d.ts +0 -1
  25. package/dist/Button/button.types.d.ts +61 -2
  26. package/dist/Calendar/Calendar.svelte +4 -0
  27. package/dist/Calendar/Calendar.svelte.d.ts +1 -1
  28. package/dist/Calendar/calendar.types.d.ts +4 -0
  29. package/dist/Card/Card.svelte +5 -4
  30. package/dist/Card/Card.svelte.d.ts +1 -1
  31. package/dist/Card/card.types.d.ts +5 -1
  32. package/dist/Checkbox/Checkbox.svelte +37 -11
  33. package/dist/Checkbox/Checkbox.svelte.d.ts +1 -1
  34. package/dist/Checkbox/checkbox.types.d.ts +16 -1
  35. package/dist/Checkbox/checkbox.variants.d.ts +90 -0
  36. package/dist/Checkbox/checkbox.variants.js +73 -4
  37. package/dist/Chip/Chip.svelte +3 -2
  38. package/dist/Chip/Chip.svelte.d.ts +1 -1
  39. package/dist/Chip/chip.types.d.ts +5 -1
  40. package/dist/Chip/chip.variants.d.ts +135 -45
  41. package/dist/Chip/chip.variants.js +9 -9
  42. package/dist/ContextMenu/ContextMenu.svelte +87 -77
  43. package/dist/ContextMenu/ContextMenu.svelte.d.ts +1 -1
  44. package/dist/ContextMenu/context-menu.types.d.ts +9 -3
  45. package/dist/ContextMenu/context-menu.types.js +1 -1
  46. package/dist/ContextMenu/context-menu.variants.d.ts +74 -160
  47. package/dist/ContextMenu/context-menu.variants.js +63 -95
  48. package/dist/DropdownMenu/DropdownMenu.svelte +37 -43
  49. package/dist/DropdownMenu/DropdownMenu.svelte.d.ts +1 -1
  50. package/dist/DropdownMenu/dropdown-menu.types.d.ts +9 -3
  51. package/dist/DropdownMenu/dropdown-menu.types.js +1 -1
  52. package/dist/DropdownMenu/dropdown-menu.variants.d.ts +79 -230
  53. package/dist/DropdownMenu/dropdown-menu.variants.js +68 -111
  54. package/dist/DropdownMenu/index.d.ts +1 -1
  55. package/dist/Empty/Empty.svelte +68 -33
  56. package/dist/Empty/Empty.svelte.d.ts +1 -1
  57. package/dist/Empty/empty.types.d.ts +26 -9
  58. package/dist/Empty/empty.variants.d.ts +150 -130
  59. package/dist/Empty/empty.variants.js +33 -324
  60. package/dist/FieldGroup/FieldGroup.svelte +11 -6
  61. package/dist/FieldGroup/FieldGroup.svelte.d.ts +1 -1
  62. package/dist/FieldGroup/field-group.types.d.ts +4 -0
  63. package/dist/FormField/FormField.svelte +17 -18
  64. package/dist/FormField/FormField.svelte.d.ts +1 -1
  65. package/dist/FormField/form-field.types.d.ts +4 -0
  66. package/dist/Icon/Icon.svelte +13 -7
  67. package/dist/Icon/icon.types.d.ts +18 -9
  68. package/dist/Input/Input.svelte +30 -29
  69. package/dist/Kbd/Kbd.svelte +13 -3
  70. package/dist/Kbd/Kbd.svelte.d.ts +1 -1
  71. package/dist/Kbd/index.d.ts +1 -1
  72. package/dist/Kbd/kbd.types.d.ts +15 -1
  73. package/dist/Kbd/kbd.variants.d.ts +92 -30
  74. package/dist/Kbd/kbd.variants.js +55 -35
  75. package/dist/Kbd/useKbd.svelte.d.ts +2 -2
  76. package/dist/Kbd/useKbd.svelte.js +34 -41
  77. package/dist/Link/Link.svelte +69 -24
  78. package/dist/Link/Link.svelte.d.ts +1 -1
  79. package/dist/Link/link.types.d.ts +26 -8
  80. package/dist/Link/link.variants.d.ts +35 -60
  81. package/dist/Link/link.variants.js +8 -110
  82. package/dist/Modal/Modal.svelte +9 -1
  83. package/dist/Modal/modal.types.d.ts +5 -0
  84. package/dist/Modal/modal.variants.d.ts +5 -0
  85. package/dist/Modal/modal.variants.js +1 -0
  86. package/dist/Pagination/Pagination.svelte +143 -94
  87. package/dist/Pagination/Pagination.svelte.d.ts +1 -1
  88. package/dist/Pagination/index.d.ts +1 -1
  89. package/dist/Pagination/pagination.types.d.ts +21 -2
  90. package/dist/Pagination/pagination.variants.d.ts +21 -387
  91. package/dist/Pagination/pagination.variants.js +63 -59
  92. package/dist/Popover/Popover.svelte +9 -12
  93. package/dist/Popover/Popover.svelte.d.ts +1 -1
  94. package/dist/Popover/popover.types.d.ts +4 -0
  95. package/dist/Popover/popover.variants.d.ts +5 -75
  96. package/dist/Popover/popover.variants.js +6 -16
  97. package/dist/Progress/Progress.svelte +58 -30
  98. package/dist/Progress/progress.types.d.ts +9 -1
  99. package/dist/Progress/progress.variants.d.ts +55 -25
  100. package/dist/Progress/progress.variants.js +34 -28
  101. package/dist/RadioGroup/RadioGroup.svelte +105 -61
  102. package/dist/RadioGroup/RadioGroup.svelte.d.ts +1 -1
  103. package/dist/RadioGroup/radio-group.types.d.ts +16 -1
  104. package/dist/RadioGroup/radio-group.variants.d.ts +90 -0
  105. package/dist/RadioGroup/radio-group.variants.js +73 -4
  106. package/dist/Select/Select.svelte +9 -6
  107. package/dist/Select/Select.svelte.d.ts +1 -1
  108. package/dist/Select/select.types.d.ts +4 -0
  109. package/dist/SelectMenu/SelectMenu.svelte +436 -0
  110. package/dist/SelectMenu/SelectMenu.svelte.d.ts +5 -0
  111. package/dist/SelectMenu/index.d.ts +2 -0
  112. package/dist/SelectMenu/index.js +1 -0
  113. package/dist/SelectMenu/select-menu.types.d.ts +262 -0
  114. package/dist/SelectMenu/select-menu.types.js +1 -0
  115. package/dist/SelectMenu/select-menu.variants.d.ts +759 -0
  116. package/dist/SelectMenu/select-menu.variants.js +33 -0
  117. package/dist/Separator/Separator.svelte +1 -2
  118. package/dist/Separator/separator.variants.d.ts +1 -5
  119. package/dist/Separator/separator.variants.js +2 -2
  120. package/dist/Skeleton/Skeleton.svelte +18 -2
  121. package/dist/Skeleton/Skeleton.svelte.d.ts +1 -1
  122. package/dist/Skeleton/skeleton.types.d.ts +10 -1
  123. package/dist/Slideover/Slideover.svelte +9 -1
  124. package/dist/Slideover/slideover.types.d.ts +5 -0
  125. package/dist/Slideover/slideover.variants.d.ts +20 -5
  126. package/dist/Slideover/slideover.variants.js +4 -29
  127. package/dist/Switch/Switch.svelte +32 -31
  128. package/dist/Switch/Switch.svelte.d.ts +1 -1
  129. package/dist/Switch/switch.types.d.ts +6 -1
  130. package/dist/Switch/switch.variants.js +6 -6
  131. package/dist/Tabs/Tabs.svelte +6 -9
  132. package/dist/Tabs/Tabs.svelte.d.ts +1 -1
  133. package/dist/Tabs/tabs.types.d.ts +4 -0
  134. package/dist/Tabs/tabs.variants.js +2 -0
  135. package/dist/Textarea/Textarea.svelte +26 -25
  136. package/dist/ThemeModeButton/theme-mode-button.types.d.ts +7 -2
  137. package/dist/Timeline/Timeline.svelte +62 -19
  138. package/dist/Timeline/Timeline.svelte.d.ts +1 -1
  139. package/dist/Timeline/index.d.ts +1 -1
  140. package/dist/Timeline/timeline.types.d.ts +8 -0
  141. package/dist/Tooltip/Tooltip.svelte +12 -10
  142. package/dist/Tooltip/Tooltip.svelte.d.ts +1 -1
  143. package/dist/Tooltip/tooltip.types.d.ts +8 -4
  144. package/dist/Tooltip/tooltip.variants.d.ts +10 -75
  145. package/dist/Tooltip/tooltip.variants.js +8 -17
  146. package/dist/User/User.svelte +13 -9
  147. package/dist/User/User.svelte.d.ts +1 -1
  148. package/dist/User/user.types.d.ts +4 -0
  149. package/dist/User/user.variants.d.ts +60 -0
  150. package/dist/User/user.variants.js +13 -1
  151. package/dist/config.d.ts +4 -0
  152. package/dist/config.js +4 -0
  153. package/dist/index.d.ts +1 -1
  154. package/dist/index.js +1 -1
  155. package/package.json +2 -2
@@ -11,8 +11,8 @@ export const checkboxVariants = tv({
11
11
  ],
12
12
  container: 'flex items-center',
13
13
  indicator: 'flex items-center justify-center',
14
- icon: 'shrink-0 text-white',
15
- wrapper: 'ms-2',
14
+ icon: 'shrink-0 text-surface',
15
+ wrapper: '',
16
16
  label: 'block font-medium text-on-surface',
17
17
  description: 'text-on-surface-variant'
18
18
  },
@@ -59,6 +59,24 @@ export const checkboxVariants = tv({
59
59
  wrapper: 'text-base'
60
60
  }
61
61
  },
62
+ variant: {
63
+ list: '',
64
+ card: {
65
+ root: 'border border-outline-variant rounded-lg cursor-pointer select-none'
66
+ }
67
+ },
68
+ indicator: {
69
+ start: {
70
+ wrapper: 'ms-2'
71
+ },
72
+ end: {
73
+ root: 'flex-row-reverse',
74
+ wrapper: 'me-2'
75
+ },
76
+ hidden: {
77
+ container: 'sr-only'
78
+ }
79
+ },
62
80
  loading: {
63
81
  true: {
64
82
  icon: 'animate-spin'
@@ -127,11 +145,62 @@ export const checkboxVariants = tv({
127
145
  class: {
128
146
  base: 'data-[state=checked]:bg-on-surface data-[state=checked]:border-on-surface data-[state=indeterminate]:bg-on-surface data-[state=indeterminate]:border-on-surface focus-visible:outline-outline'
129
147
  }
130
- }
148
+ },
149
+ // ========== CARD × SIZE (padding) ==========
150
+ { variant: 'card', size: 'xs', class: { root: 'p-2' } },
151
+ { variant: 'card', size: 'sm', class: { root: 'p-2.5' } },
152
+ { variant: 'card', size: 'md', class: { root: 'p-3' } },
153
+ { variant: 'card', size: 'lg', class: { root: 'p-3.5' } },
154
+ { variant: 'card', size: 'xl', class: { root: 'p-4' } },
155
+ // ========== CARD × COLOR (checked border) ==========
156
+ {
157
+ variant: 'card',
158
+ color: 'primary',
159
+ class: { root: 'has-[[data-state=checked]]:border-primary' }
160
+ },
161
+ {
162
+ variant: 'card',
163
+ color: 'secondary',
164
+ class: { root: 'has-[[data-state=checked]]:border-secondary' }
165
+ },
166
+ {
167
+ variant: 'card',
168
+ color: 'tertiary',
169
+ class: { root: 'has-[[data-state=checked]]:border-tertiary' }
170
+ },
171
+ {
172
+ variant: 'card',
173
+ color: 'success',
174
+ class: { root: 'has-[[data-state=checked]]:border-success' }
175
+ },
176
+ {
177
+ variant: 'card',
178
+ color: 'warning',
179
+ class: { root: 'has-[[data-state=checked]]:border-warning' }
180
+ },
181
+ {
182
+ variant: 'card',
183
+ color: 'error',
184
+ class: { root: 'has-[[data-state=checked]]:border-error' }
185
+ },
186
+ {
187
+ variant: 'card',
188
+ color: 'info',
189
+ class: { root: 'has-[[data-state=checked]]:border-info' }
190
+ },
191
+ {
192
+ variant: 'card',
193
+ color: 'surface',
194
+ class: { root: 'has-[[data-state=checked]]:border-on-surface' }
195
+ },
196
+ // ========== CARD × DISABLED ==========
197
+ { variant: 'card', disabled: true, class: { root: 'cursor-not-allowed' } }
131
198
  ],
132
199
  defaultVariants: {
133
200
  color: 'primary',
134
- size: 'md'
201
+ size: 'md',
202
+ variant: 'list',
203
+ indicator: 'start'
135
204
  }
136
205
  });
137
206
  export const checkboxDefaults = {
@@ -11,6 +11,7 @@
11
11
  const config = getComponentConfig('chip', chipDefaults)
12
12
 
13
13
  let {
14
+ ref = $bindable(null),
14
15
  as = 'div',
15
16
  ui,
16
17
  text,
@@ -19,7 +20,7 @@
19
20
  position = config.defaultVariants.position,
20
21
  inset = false,
21
22
  standalone = false,
22
- show = true,
23
+ show = $bindable(true),
23
24
  class: className,
24
25
  children,
25
26
  content,
@@ -35,7 +36,7 @@
35
36
  })
36
37
  </script>
37
38
 
38
- <svelte:element this={as} class={classes.root} {...restProps}>
39
+ <svelte:element this={as} bind:this={ref} class={classes.root} {...restProps}>
39
40
  {@render children?.()}
40
41
 
41
42
  {#if show}
@@ -1,5 +1,5 @@
1
1
  import type { ChipProps } from './chip.types.js';
2
2
  export type Props = ChipProps;
3
- declare const Chip: import("svelte").Component<ChipProps, {}, "">;
3
+ declare const Chip: import("svelte").Component<ChipProps, {}, "show" | "ref">;
4
4
  type Chip = ReturnType<typeof Chip>;
5
5
  export default Chip;
@@ -3,6 +3,10 @@ import type { ClassNameValue } from 'tailwind-merge';
3
3
  import type { HTMLAttributes } from 'svelte/elements';
4
4
  import type { ChipVariantProps, ChipSlots } from './chip.variants.js';
5
5
  export type ChipProps = Omit<HTMLAttributes<HTMLElement>, 'class'> & {
6
+ /**
7
+ * Bind to the root DOM element.
8
+ */
9
+ ref?: HTMLElement | null;
6
10
  /**
7
11
  * The HTML element to render as.
8
12
  * @default 'div'
@@ -42,7 +46,7 @@ export type ChipProps = Omit<HTMLAttributes<HTMLElement>, 'class'> & {
42
46
  */
43
47
  standalone?: boolean;
44
48
  /**
45
- * Controls the visibility of the chip.
49
+ * Controls the visibility of the chip. Supports `bind:show`.
46
50
  * @default true
47
51
  */
48
52
  show?: boolean;
@@ -27,15 +27,33 @@ export declare const chipVariants: import("tailwind-variants").TVReturnType<{
27
27
  };
28
28
  };
29
29
  size: {
30
- '3xs': string;
31
- '2xs': string;
32
- xs: string;
33
- sm: string;
34
- md: string;
35
- lg: string;
36
- xl: string;
37
- '2xl': string;
38
- '3xl': string;
30
+ '3xs': {
31
+ base: string;
32
+ };
33
+ '2xs': {
34
+ base: string;
35
+ };
36
+ xs: {
37
+ base: string;
38
+ };
39
+ sm: {
40
+ base: string;
41
+ };
42
+ md: {
43
+ base: string;
44
+ };
45
+ lg: {
46
+ base: string;
47
+ };
48
+ xl: {
49
+ base: string;
50
+ };
51
+ '2xl': {
52
+ base: string;
53
+ };
54
+ '3xl': {
55
+ base: string;
56
+ };
39
57
  };
40
58
  position: {
41
59
  'top-right': {
@@ -91,15 +109,33 @@ export declare const chipVariants: import("tailwind-variants").TVReturnType<{
91
109
  };
92
110
  };
93
111
  size: {
94
- '3xs': string;
95
- '2xs': string;
96
- xs: string;
97
- sm: string;
98
- md: string;
99
- lg: string;
100
- xl: string;
101
- '2xl': string;
102
- '3xl': string;
112
+ '3xs': {
113
+ base: string;
114
+ };
115
+ '2xs': {
116
+ base: string;
117
+ };
118
+ xs: {
119
+ base: string;
120
+ };
121
+ sm: {
122
+ base: string;
123
+ };
124
+ md: {
125
+ base: string;
126
+ };
127
+ lg: {
128
+ base: string;
129
+ };
130
+ xl: {
131
+ base: string;
132
+ };
133
+ '2xl': {
134
+ base: string;
135
+ };
136
+ '3xl': {
137
+ base: string;
138
+ };
103
139
  };
104
140
  position: {
105
141
  'top-right': {
@@ -155,15 +191,33 @@ export declare const chipVariants: import("tailwind-variants").TVReturnType<{
155
191
  };
156
192
  };
157
193
  size: {
158
- '3xs': string;
159
- '2xs': string;
160
- xs: string;
161
- sm: string;
162
- md: string;
163
- lg: string;
164
- xl: string;
165
- '2xl': string;
166
- '3xl': string;
194
+ '3xs': {
195
+ base: string;
196
+ };
197
+ '2xs': {
198
+ base: string;
199
+ };
200
+ xs: {
201
+ base: string;
202
+ };
203
+ sm: {
204
+ base: string;
205
+ };
206
+ md: {
207
+ base: string;
208
+ };
209
+ lg: {
210
+ base: string;
211
+ };
212
+ xl: {
213
+ base: string;
214
+ };
215
+ '2xl': {
216
+ base: string;
217
+ };
218
+ '3xl': {
219
+ base: string;
220
+ };
167
221
  };
168
222
  position: {
169
223
  'top-right': {
@@ -223,15 +277,33 @@ export declare const chipDefaults: {
223
277
  };
224
278
  };
225
279
  size: {
226
- '3xs': string;
227
- '2xs': string;
228
- xs: string;
229
- sm: string;
230
- md: string;
231
- lg: string;
232
- xl: string;
233
- '2xl': string;
234
- '3xl': string;
280
+ '3xs': {
281
+ base: string;
282
+ };
283
+ '2xs': {
284
+ base: string;
285
+ };
286
+ xs: {
287
+ base: string;
288
+ };
289
+ sm: {
290
+ base: string;
291
+ };
292
+ md: {
293
+ base: string;
294
+ };
295
+ lg: {
296
+ base: string;
297
+ };
298
+ xl: {
299
+ base: string;
300
+ };
301
+ '2xl': {
302
+ base: string;
303
+ };
304
+ '3xl': {
305
+ base: string;
306
+ };
235
307
  };
236
308
  position: {
237
309
  'top-right': {
@@ -287,15 +359,33 @@ export declare const chipDefaults: {
287
359
  };
288
360
  };
289
361
  size: {
290
- '3xs': string;
291
- '2xs': string;
292
- xs: string;
293
- sm: string;
294
- md: string;
295
- lg: string;
296
- xl: string;
297
- '2xl': string;
298
- '3xl': string;
362
+ '3xs': {
363
+ base: string;
364
+ };
365
+ '2xs': {
366
+ base: string;
367
+ };
368
+ xs: {
369
+ base: string;
370
+ };
371
+ sm: {
372
+ base: string;
373
+ };
374
+ md: {
375
+ base: string;
376
+ };
377
+ lg: {
378
+ base: string;
379
+ };
380
+ xl: {
381
+ base: string;
382
+ };
383
+ '2xl': {
384
+ base: string;
385
+ };
386
+ '3xl': {
387
+ base: string;
388
+ };
299
389
  };
300
390
  position: {
301
391
  'top-right': {
@@ -16,15 +16,15 @@ export const chipVariants = tv({
16
16
  surface: { base: 'bg-inverse-surface text-inverse-on-surface' }
17
17
  },
18
18
  size: {
19
- '3xs': 'h-[4px] min-w-[4px] text-[4px]',
20
- '2xs': 'h-[5px] min-w-[5px] text-[5px]',
21
- xs: 'h-[6px] min-w-[6px] text-[6px]',
22
- sm: 'h-[7px] min-w-[7px] text-[7px]',
23
- md: 'h-[8px] min-w-[8px] text-[8px]',
24
- lg: 'h-[9px] min-w-[9px] text-[9px]',
25
- xl: 'h-[10px] min-w-[10px] text-[10px]',
26
- '2xl': 'h-[11px] min-w-[11px] text-[11px]',
27
- '3xl': 'h-[12px] min-w-[12px] text-[12px]'
19
+ '3xs': { base: 'h-[4px] min-w-[4px] text-[4px]' },
20
+ '2xs': { base: 'h-[5px] min-w-[5px] text-[5px]' },
21
+ xs: { base: 'h-[6px] min-w-[6px] text-[6px]' },
22
+ sm: { base: 'h-[7px] min-w-[7px] text-[7px]' },
23
+ md: { base: 'h-[8px] min-w-[8px] text-[8px]' },
24
+ lg: { base: 'h-[9px] min-w-[9px] text-[9px]' },
25
+ xl: { base: 'h-[10px] min-w-[10px] text-[10px]' },
26
+ '2xl': { base: 'h-[11px] min-w-[11px] text-[11px]' },
27
+ '3xl': { base: 'h-[12px] min-w-[12px] text-[12px]' }
28
28
  },
29
29
  position: {
30
30
  'top-right': { base: 'top-0 right-0' },