sv5ui 1.1.3 → 1.3.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/README.md +6 -0
- package/dist/Alert/Alert.svelte +33 -22
- package/dist/Alert/Alert.svelte.d.ts +1 -1
- package/dist/Alert/alert.types.d.ts +4 -0
- package/dist/Avatar/Avatar.svelte +72 -46
- package/dist/Avatar/avatar.types.d.ts +36 -3
- package/dist/Avatar/avatar.variants.d.ts +138 -0
- package/dist/Avatar/avatar.variants.js +23 -12
- package/dist/Avatar/index.d.ts +1 -1
- package/dist/AvatarGroup/AvatarGroup.svelte +11 -6
- package/dist/AvatarGroup/AvatarGroup.svelte.d.ts +1 -1
- package/dist/AvatarGroup/avatar-group.types.d.ts +18 -3
- package/dist/AvatarGroup/avatar-group.variants.d.ts +85 -0
- package/dist/AvatarGroup/avatar-group.variants.js +19 -29
- package/dist/Badge/Badge.svelte +4 -3
- package/dist/Badge/Badge.svelte.d.ts +1 -1
- package/dist/Badge/badge.types.d.ts +9 -0
- package/dist/Breadcrumb/Breadcrumb.svelte +20 -7
- package/dist/Breadcrumb/Breadcrumb.svelte.d.ts +1 -1
- package/dist/Breadcrumb/breadcrumb.types.d.ts +5 -1
- package/dist/Breadcrumb/breadcrumb.variants.d.ts +15 -5
- package/dist/Breadcrumb/breadcrumb.variants.js +7 -3
- package/dist/Button/Button.svelte +71 -16
- package/dist/Button/Button.svelte.d.ts +0 -1
- package/dist/Button/button.types.d.ts +61 -2
- package/dist/Calendar/Calendar.svelte +4 -0
- package/dist/Calendar/Calendar.svelte.d.ts +1 -1
- package/dist/Calendar/calendar.types.d.ts +4 -0
- package/dist/Card/Card.svelte +5 -4
- package/dist/Card/Card.svelte.d.ts +1 -1
- package/dist/Card/card.types.d.ts +5 -1
- package/dist/Checkbox/Checkbox.svelte +37 -11
- package/dist/Checkbox/Checkbox.svelte.d.ts +1 -1
- package/dist/Checkbox/checkbox.types.d.ts +16 -1
- package/dist/Checkbox/checkbox.variants.d.ts +90 -0
- package/dist/Checkbox/checkbox.variants.js +73 -4
- package/dist/CheckboxGroup/CheckboxGroup.svelte +215 -0
- package/dist/CheckboxGroup/CheckboxGroup.svelte.d.ts +5 -0
- package/dist/CheckboxGroup/checkbox-group.types.d.ts +130 -0
- package/dist/CheckboxGroup/checkbox-group.types.js +1 -0
- package/dist/CheckboxGroup/checkbox-group.variants.d.ts +553 -0
- package/dist/CheckboxGroup/checkbox-group.variants.js +231 -0
- package/dist/CheckboxGroup/index.d.ts +2 -0
- package/dist/CheckboxGroup/index.js +1 -0
- package/dist/Chip/Chip.svelte +3 -2
- package/dist/Chip/Chip.svelte.d.ts +1 -1
- package/dist/Chip/chip.types.d.ts +5 -1
- package/dist/Chip/chip.variants.d.ts +135 -45
- package/dist/Chip/chip.variants.js +9 -9
- package/dist/ContextMenu/ContextMenu.svelte +87 -77
- package/dist/ContextMenu/ContextMenu.svelte.d.ts +1 -1
- package/dist/ContextMenu/context-menu.types.d.ts +9 -3
- package/dist/ContextMenu/context-menu.types.js +1 -1
- package/dist/ContextMenu/context-menu.variants.d.ts +74 -160
- package/dist/ContextMenu/context-menu.variants.js +63 -95
- package/dist/DropdownMenu/DropdownMenu.svelte +37 -43
- package/dist/DropdownMenu/DropdownMenu.svelte.d.ts +1 -1
- package/dist/DropdownMenu/dropdown-menu.types.d.ts +9 -3
- package/dist/DropdownMenu/dropdown-menu.types.js +1 -1
- package/dist/DropdownMenu/dropdown-menu.variants.d.ts +79 -230
- package/dist/DropdownMenu/dropdown-menu.variants.js +68 -111
- package/dist/DropdownMenu/index.d.ts +1 -1
- package/dist/Empty/Empty.svelte +68 -33
- package/dist/Empty/Empty.svelte.d.ts +1 -1
- package/dist/Empty/empty.types.d.ts +26 -9
- package/dist/Empty/empty.variants.d.ts +150 -130
- package/dist/Empty/empty.variants.js +33 -324
- package/dist/FieldGroup/FieldGroup.svelte +11 -6
- package/dist/FieldGroup/FieldGroup.svelte.d.ts +1 -1
- package/dist/FieldGroup/field-group.types.d.ts +4 -0
- package/dist/FileUpload/FileUpload.svelte +561 -0
- package/dist/FileUpload/FileUpload.svelte.d.ts +8 -0
- package/dist/FileUpload/file-upload.types.d.ts +164 -0
- package/dist/FileUpload/file-upload.types.js +1 -0
- package/dist/FileUpload/file-upload.variants.d.ts +397 -0
- package/dist/FileUpload/file-upload.variants.js +224 -0
- package/dist/FileUpload/index.d.ts +2 -0
- package/dist/FileUpload/index.js +1 -0
- package/dist/FormField/FormField.svelte +17 -18
- package/dist/FormField/FormField.svelte.d.ts +1 -1
- package/dist/FormField/form-field.types.d.ts +4 -0
- package/dist/Icon/Icon.svelte +13 -7
- package/dist/Icon/icon.types.d.ts +18 -9
- package/dist/Input/Input.svelte +30 -29
- package/dist/Kbd/Kbd.svelte +13 -3
- package/dist/Kbd/Kbd.svelte.d.ts +1 -1
- package/dist/Kbd/index.d.ts +1 -1
- package/dist/Kbd/kbd.types.d.ts +15 -1
- package/dist/Kbd/kbd.variants.d.ts +92 -30
- package/dist/Kbd/kbd.variants.js +55 -35
- package/dist/Kbd/useKbd.svelte.d.ts +2 -2
- package/dist/Kbd/useKbd.svelte.js +34 -41
- package/dist/Link/Link.svelte +69 -24
- package/dist/Link/Link.svelte.d.ts +1 -1
- package/dist/Link/link.types.d.ts +26 -8
- package/dist/Link/link.variants.d.ts +35 -60
- package/dist/Link/link.variants.js +8 -110
- package/dist/Modal/Modal.svelte +9 -1
- package/dist/Modal/modal.types.d.ts +5 -0
- package/dist/Modal/modal.variants.d.ts +5 -0
- package/dist/Modal/modal.variants.js +1 -0
- package/dist/Pagination/Pagination.svelte +143 -94
- package/dist/Pagination/Pagination.svelte.d.ts +1 -1
- package/dist/Pagination/index.d.ts +1 -1
- package/dist/Pagination/pagination.types.d.ts +21 -2
- package/dist/Pagination/pagination.variants.d.ts +21 -387
- package/dist/Pagination/pagination.variants.js +63 -59
- package/dist/PinInput/PinInput.svelte +150 -0
- package/dist/PinInput/PinInput.svelte.d.ts +6 -0
- package/dist/PinInput/index.d.ts +2 -0
- package/dist/PinInput/index.js +1 -0
- package/dist/PinInput/pin-input.types.d.ts +99 -0
- package/dist/PinInput/pin-input.types.js +1 -0
- package/dist/PinInput/pin-input.variants.d.ts +303 -0
- package/dist/PinInput/pin-input.variants.js +196 -0
- package/dist/Popover/Popover.svelte +9 -12
- package/dist/Popover/Popover.svelte.d.ts +1 -1
- package/dist/Popover/popover.types.d.ts +4 -0
- package/dist/Popover/popover.variants.d.ts +5 -75
- package/dist/Popover/popover.variants.js +6 -16
- package/dist/Progress/Progress.svelte +58 -30
- package/dist/Progress/progress.types.d.ts +9 -1
- package/dist/Progress/progress.variants.d.ts +55 -25
- package/dist/Progress/progress.variants.js +34 -28
- package/dist/RadioGroup/RadioGroup.svelte +105 -61
- package/dist/RadioGroup/RadioGroup.svelte.d.ts +1 -1
- package/dist/RadioGroup/radio-group.types.d.ts +16 -1
- package/dist/RadioGroup/radio-group.variants.d.ts +90 -0
- package/dist/RadioGroup/radio-group.variants.js +73 -4
- package/dist/Select/Select.svelte +9 -6
- package/dist/Select/Select.svelte.d.ts +1 -1
- package/dist/Select/select.types.d.ts +4 -0
- package/dist/SelectMenu/SelectMenu.svelte +436 -0
- package/dist/SelectMenu/SelectMenu.svelte.d.ts +5 -0
- package/dist/SelectMenu/index.d.ts +2 -0
- package/dist/SelectMenu/index.js +1 -0
- package/dist/SelectMenu/select-menu.types.d.ts +262 -0
- package/dist/SelectMenu/select-menu.types.js +1 -0
- package/dist/SelectMenu/select-menu.variants.d.ts +759 -0
- package/dist/SelectMenu/select-menu.variants.js +33 -0
- package/dist/Separator/Separator.svelte +1 -2
- package/dist/Separator/separator.variants.d.ts +1 -5
- package/dist/Separator/separator.variants.js +2 -2
- package/dist/Skeleton/Skeleton.svelte +18 -2
- package/dist/Skeleton/Skeleton.svelte.d.ts +1 -1
- package/dist/Skeleton/skeleton.types.d.ts +10 -1
- package/dist/Slideover/Slideover.svelte +9 -1
- package/dist/Slideover/slideover.types.d.ts +5 -0
- package/dist/Slideover/slideover.variants.d.ts +20 -5
- package/dist/Slideover/slideover.variants.js +4 -29
- package/dist/Slider/Slider.svelte +135 -0
- package/dist/Slider/Slider.svelte.d.ts +6 -0
- package/dist/Slider/index.d.ts +2 -0
- package/dist/Slider/index.js +1 -0
- package/dist/Slider/slider.types.d.ts +55 -0
- package/dist/Slider/slider.types.js +1 -0
- package/dist/Slider/slider.variants.d.ts +383 -0
- package/dist/Slider/slider.variants.js +102 -0
- package/dist/Switch/Switch.svelte +32 -31
- package/dist/Switch/Switch.svelte.d.ts +1 -1
- package/dist/Switch/switch.types.d.ts +6 -1
- package/dist/Switch/switch.variants.js +6 -6
- package/dist/Tabs/Tabs.svelte +6 -9
- package/dist/Tabs/Tabs.svelte.d.ts +1 -1
- package/dist/Tabs/tabs.types.d.ts +4 -0
- package/dist/Tabs/tabs.variants.js +2 -0
- package/dist/Textarea/Textarea.svelte +26 -25
- package/dist/ThemeModeButton/theme-mode-button.types.d.ts +7 -2
- package/dist/Timeline/Timeline.svelte +62 -19
- package/dist/Timeline/Timeline.svelte.d.ts +1 -1
- package/dist/Timeline/index.d.ts +1 -1
- package/dist/Timeline/timeline.types.d.ts +8 -0
- package/dist/Tooltip/Tooltip.svelte +12 -10
- package/dist/Tooltip/Tooltip.svelte.d.ts +1 -1
- package/dist/Tooltip/tooltip.types.d.ts +8 -4
- package/dist/Tooltip/tooltip.variants.d.ts +10 -75
- package/dist/Tooltip/tooltip.variants.js +8 -17
- package/dist/User/User.svelte +13 -9
- package/dist/User/User.svelte.d.ts +1 -1
- package/dist/User/user.types.d.ts +4 -0
- package/dist/User/user.variants.d.ts +60 -0
- package/dist/User/user.variants.js +13 -1
- package/dist/config.d.ts +8 -0
- package/dist/config.js +9 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/package.json +2 -2
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import { type VariantProps } from 'tailwind-variants';
|
|
2
|
+
export declare const pinInputVariants: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
variant: {
|
|
4
|
+
outline: {
|
|
5
|
+
base: string;
|
|
6
|
+
};
|
|
7
|
+
soft: {
|
|
8
|
+
base: string;
|
|
9
|
+
};
|
|
10
|
+
subtle: {
|
|
11
|
+
base: string;
|
|
12
|
+
};
|
|
13
|
+
ghost: {
|
|
14
|
+
base: string;
|
|
15
|
+
};
|
|
16
|
+
none: {
|
|
17
|
+
base: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
color: {
|
|
21
|
+
primary: {};
|
|
22
|
+
secondary: {};
|
|
23
|
+
tertiary: {};
|
|
24
|
+
success: {};
|
|
25
|
+
warning: {};
|
|
26
|
+
error: {};
|
|
27
|
+
info: {};
|
|
28
|
+
surface: {};
|
|
29
|
+
};
|
|
30
|
+
size: {
|
|
31
|
+
xs: {
|
|
32
|
+
base: string;
|
|
33
|
+
};
|
|
34
|
+
sm: {
|
|
35
|
+
base: string;
|
|
36
|
+
};
|
|
37
|
+
md: {
|
|
38
|
+
base: string;
|
|
39
|
+
};
|
|
40
|
+
lg: {
|
|
41
|
+
base: string;
|
|
42
|
+
};
|
|
43
|
+
xl: {
|
|
44
|
+
base: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
highlight: {
|
|
48
|
+
true: {};
|
|
49
|
+
};
|
|
50
|
+
fixed: {
|
|
51
|
+
false: {};
|
|
52
|
+
};
|
|
53
|
+
disabled: {
|
|
54
|
+
true: {
|
|
55
|
+
root: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
}, {
|
|
59
|
+
root: string;
|
|
60
|
+
base: string[];
|
|
61
|
+
}, undefined, {
|
|
62
|
+
variant: {
|
|
63
|
+
outline: {
|
|
64
|
+
base: string;
|
|
65
|
+
};
|
|
66
|
+
soft: {
|
|
67
|
+
base: string;
|
|
68
|
+
};
|
|
69
|
+
subtle: {
|
|
70
|
+
base: string;
|
|
71
|
+
};
|
|
72
|
+
ghost: {
|
|
73
|
+
base: string;
|
|
74
|
+
};
|
|
75
|
+
none: {
|
|
76
|
+
base: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
color: {
|
|
80
|
+
primary: {};
|
|
81
|
+
secondary: {};
|
|
82
|
+
tertiary: {};
|
|
83
|
+
success: {};
|
|
84
|
+
warning: {};
|
|
85
|
+
error: {};
|
|
86
|
+
info: {};
|
|
87
|
+
surface: {};
|
|
88
|
+
};
|
|
89
|
+
size: {
|
|
90
|
+
xs: {
|
|
91
|
+
base: string;
|
|
92
|
+
};
|
|
93
|
+
sm: {
|
|
94
|
+
base: string;
|
|
95
|
+
};
|
|
96
|
+
md: {
|
|
97
|
+
base: string;
|
|
98
|
+
};
|
|
99
|
+
lg: {
|
|
100
|
+
base: string;
|
|
101
|
+
};
|
|
102
|
+
xl: {
|
|
103
|
+
base: string;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
highlight: {
|
|
107
|
+
true: {};
|
|
108
|
+
};
|
|
109
|
+
fixed: {
|
|
110
|
+
false: {};
|
|
111
|
+
};
|
|
112
|
+
disabled: {
|
|
113
|
+
true: {
|
|
114
|
+
root: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
}, {
|
|
118
|
+
root: string;
|
|
119
|
+
base: string[];
|
|
120
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
121
|
+
variant: {
|
|
122
|
+
outline: {
|
|
123
|
+
base: string;
|
|
124
|
+
};
|
|
125
|
+
soft: {
|
|
126
|
+
base: string;
|
|
127
|
+
};
|
|
128
|
+
subtle: {
|
|
129
|
+
base: string;
|
|
130
|
+
};
|
|
131
|
+
ghost: {
|
|
132
|
+
base: string;
|
|
133
|
+
};
|
|
134
|
+
none: {
|
|
135
|
+
base: string;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
color: {
|
|
139
|
+
primary: {};
|
|
140
|
+
secondary: {};
|
|
141
|
+
tertiary: {};
|
|
142
|
+
success: {};
|
|
143
|
+
warning: {};
|
|
144
|
+
error: {};
|
|
145
|
+
info: {};
|
|
146
|
+
surface: {};
|
|
147
|
+
};
|
|
148
|
+
size: {
|
|
149
|
+
xs: {
|
|
150
|
+
base: string;
|
|
151
|
+
};
|
|
152
|
+
sm: {
|
|
153
|
+
base: string;
|
|
154
|
+
};
|
|
155
|
+
md: {
|
|
156
|
+
base: string;
|
|
157
|
+
};
|
|
158
|
+
lg: {
|
|
159
|
+
base: string;
|
|
160
|
+
};
|
|
161
|
+
xl: {
|
|
162
|
+
base: string;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
highlight: {
|
|
166
|
+
true: {};
|
|
167
|
+
};
|
|
168
|
+
fixed: {
|
|
169
|
+
false: {};
|
|
170
|
+
};
|
|
171
|
+
disabled: {
|
|
172
|
+
true: {
|
|
173
|
+
root: string;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
}, {
|
|
177
|
+
root: string;
|
|
178
|
+
base: string[];
|
|
179
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
180
|
+
export type PinInputVariantProps = VariantProps<typeof pinInputVariants>;
|
|
181
|
+
export type PinInputSlots = keyof ReturnType<typeof pinInputVariants>;
|
|
182
|
+
export declare const pinInputDefaults: {
|
|
183
|
+
defaultVariants: import("tailwind-variants").TVDefaultVariants<{
|
|
184
|
+
variant: {
|
|
185
|
+
outline: {
|
|
186
|
+
base: string;
|
|
187
|
+
};
|
|
188
|
+
soft: {
|
|
189
|
+
base: string;
|
|
190
|
+
};
|
|
191
|
+
subtle: {
|
|
192
|
+
base: string;
|
|
193
|
+
};
|
|
194
|
+
ghost: {
|
|
195
|
+
base: string;
|
|
196
|
+
};
|
|
197
|
+
none: {
|
|
198
|
+
base: string;
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
color: {
|
|
202
|
+
primary: {};
|
|
203
|
+
secondary: {};
|
|
204
|
+
tertiary: {};
|
|
205
|
+
success: {};
|
|
206
|
+
warning: {};
|
|
207
|
+
error: {};
|
|
208
|
+
info: {};
|
|
209
|
+
surface: {};
|
|
210
|
+
};
|
|
211
|
+
size: {
|
|
212
|
+
xs: {
|
|
213
|
+
base: string;
|
|
214
|
+
};
|
|
215
|
+
sm: {
|
|
216
|
+
base: string;
|
|
217
|
+
};
|
|
218
|
+
md: {
|
|
219
|
+
base: string;
|
|
220
|
+
};
|
|
221
|
+
lg: {
|
|
222
|
+
base: string;
|
|
223
|
+
};
|
|
224
|
+
xl: {
|
|
225
|
+
base: string;
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
highlight: {
|
|
229
|
+
true: {};
|
|
230
|
+
};
|
|
231
|
+
fixed: {
|
|
232
|
+
false: {};
|
|
233
|
+
};
|
|
234
|
+
disabled: {
|
|
235
|
+
true: {
|
|
236
|
+
root: string;
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
}, {
|
|
240
|
+
root: string;
|
|
241
|
+
base: string[];
|
|
242
|
+
}, {
|
|
243
|
+
variant: {
|
|
244
|
+
outline: {
|
|
245
|
+
base: string;
|
|
246
|
+
};
|
|
247
|
+
soft: {
|
|
248
|
+
base: string;
|
|
249
|
+
};
|
|
250
|
+
subtle: {
|
|
251
|
+
base: string;
|
|
252
|
+
};
|
|
253
|
+
ghost: {
|
|
254
|
+
base: string;
|
|
255
|
+
};
|
|
256
|
+
none: {
|
|
257
|
+
base: string;
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
color: {
|
|
261
|
+
primary: {};
|
|
262
|
+
secondary: {};
|
|
263
|
+
tertiary: {};
|
|
264
|
+
success: {};
|
|
265
|
+
warning: {};
|
|
266
|
+
error: {};
|
|
267
|
+
info: {};
|
|
268
|
+
surface: {};
|
|
269
|
+
};
|
|
270
|
+
size: {
|
|
271
|
+
xs: {
|
|
272
|
+
base: string;
|
|
273
|
+
};
|
|
274
|
+
sm: {
|
|
275
|
+
base: string;
|
|
276
|
+
};
|
|
277
|
+
md: {
|
|
278
|
+
base: string;
|
|
279
|
+
};
|
|
280
|
+
lg: {
|
|
281
|
+
base: string;
|
|
282
|
+
};
|
|
283
|
+
xl: {
|
|
284
|
+
base: string;
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
highlight: {
|
|
288
|
+
true: {};
|
|
289
|
+
};
|
|
290
|
+
fixed: {
|
|
291
|
+
false: {};
|
|
292
|
+
};
|
|
293
|
+
disabled: {
|
|
294
|
+
true: {
|
|
295
|
+
root: string;
|
|
296
|
+
};
|
|
297
|
+
};
|
|
298
|
+
}, {
|
|
299
|
+
root: string;
|
|
300
|
+
base: string[];
|
|
301
|
+
}>;
|
|
302
|
+
slots: Partial<Record<PinInputSlots, string>>;
|
|
303
|
+
};
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
export const pinInputVariants = tv({
|
|
3
|
+
slots: {
|
|
4
|
+
root: 'relative inline-flex items-center gap-1.5 align-top',
|
|
5
|
+
base: [
|
|
6
|
+
'relative flex items-center justify-center rounded-md',
|
|
7
|
+
'select-none cursor-text transition-colors'
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
outline: {
|
|
13
|
+
base: 'text-on-surface bg-surface ring-2 ring-inset ring-outline-variant'
|
|
14
|
+
},
|
|
15
|
+
soft: {
|
|
16
|
+
base: 'text-on-surface bg-surface-container/50 data-[active]:bg-surface-container disabled:bg-surface-container/50'
|
|
17
|
+
},
|
|
18
|
+
subtle: {
|
|
19
|
+
base: 'text-on-surface bg-surface-container ring-2 ring-inset ring-outline-variant'
|
|
20
|
+
},
|
|
21
|
+
ghost: {
|
|
22
|
+
base: 'text-on-surface bg-transparent data-[active]:bg-surface-container'
|
|
23
|
+
},
|
|
24
|
+
none: {
|
|
25
|
+
base: 'text-on-surface bg-transparent'
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
color: {
|
|
29
|
+
primary: {},
|
|
30
|
+
secondary: {},
|
|
31
|
+
tertiary: {},
|
|
32
|
+
success: {},
|
|
33
|
+
warning: {},
|
|
34
|
+
error: {},
|
|
35
|
+
info: {},
|
|
36
|
+
surface: {}
|
|
37
|
+
},
|
|
38
|
+
size: {
|
|
39
|
+
xs: { base: 'size-6 text-sm/4' },
|
|
40
|
+
sm: { base: 'size-7 text-sm/4' },
|
|
41
|
+
md: { base: 'size-8 text-base/5' },
|
|
42
|
+
lg: { base: 'size-9 text-base/5' },
|
|
43
|
+
xl: { base: 'size-10 text-base' }
|
|
44
|
+
},
|
|
45
|
+
highlight: {
|
|
46
|
+
true: {}
|
|
47
|
+
},
|
|
48
|
+
fixed: {
|
|
49
|
+
false: {}
|
|
50
|
+
},
|
|
51
|
+
disabled: {
|
|
52
|
+
true: {
|
|
53
|
+
root: 'opacity-75 cursor-not-allowed'
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
compoundVariants: [
|
|
58
|
+
// outline + color → active cell ring
|
|
59
|
+
{
|
|
60
|
+
variant: 'outline',
|
|
61
|
+
color: 'primary',
|
|
62
|
+
class: {
|
|
63
|
+
base: 'data-[active]:ring-2 data-[active]:ring-inset data-[active]:ring-primary'
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
variant: 'outline',
|
|
68
|
+
color: 'secondary',
|
|
69
|
+
class: {
|
|
70
|
+
base: 'data-[active]:ring-2 data-[active]:ring-inset data-[active]:ring-secondary'
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
variant: 'outline',
|
|
75
|
+
color: 'tertiary',
|
|
76
|
+
class: {
|
|
77
|
+
base: 'data-[active]:ring-2 data-[active]:ring-inset data-[active]:ring-tertiary'
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
variant: 'outline',
|
|
82
|
+
color: 'success',
|
|
83
|
+
class: {
|
|
84
|
+
base: 'data-[active]:ring-2 data-[active]:ring-inset data-[active]:ring-success'
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
variant: 'outline',
|
|
89
|
+
color: 'warning',
|
|
90
|
+
class: {
|
|
91
|
+
base: 'data-[active]:ring-2 data-[active]:ring-inset data-[active]:ring-warning'
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
variant: 'outline',
|
|
96
|
+
color: 'error',
|
|
97
|
+
class: {
|
|
98
|
+
base: 'data-[active]:ring-2 data-[active]:ring-inset data-[active]:ring-error'
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
variant: 'outline',
|
|
103
|
+
color: 'info',
|
|
104
|
+
class: { base: 'data-[active]:ring-2 data-[active]:ring-inset data-[active]:ring-info' }
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
variant: 'outline',
|
|
108
|
+
color: 'surface',
|
|
109
|
+
class: {
|
|
110
|
+
base: 'data-[active]:ring-2 data-[active]:ring-inset data-[active]:ring-on-surface'
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
// subtle + color → active cell ring
|
|
114
|
+
{
|
|
115
|
+
variant: 'subtle',
|
|
116
|
+
color: 'primary',
|
|
117
|
+
class: {
|
|
118
|
+
base: 'data-[active]:ring-2 data-[active]:ring-inset data-[active]:ring-primary'
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
variant: 'subtle',
|
|
123
|
+
color: 'secondary',
|
|
124
|
+
class: {
|
|
125
|
+
base: 'data-[active]:ring-2 data-[active]:ring-inset data-[active]:ring-secondary'
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
variant: 'subtle',
|
|
130
|
+
color: 'tertiary',
|
|
131
|
+
class: {
|
|
132
|
+
base: 'data-[active]:ring-2 data-[active]:ring-inset data-[active]:ring-tertiary'
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
variant: 'subtle',
|
|
137
|
+
color: 'success',
|
|
138
|
+
class: {
|
|
139
|
+
base: 'data-[active]:ring-2 data-[active]:ring-inset data-[active]:ring-success'
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
variant: 'subtle',
|
|
144
|
+
color: 'warning',
|
|
145
|
+
class: {
|
|
146
|
+
base: 'data-[active]:ring-2 data-[active]:ring-inset data-[active]:ring-warning'
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
variant: 'subtle',
|
|
151
|
+
color: 'error',
|
|
152
|
+
class: {
|
|
153
|
+
base: 'data-[active]:ring-2 data-[active]:ring-inset data-[active]:ring-error'
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
variant: 'subtle',
|
|
158
|
+
color: 'info',
|
|
159
|
+
class: { base: 'data-[active]:ring-2 data-[active]:ring-inset data-[active]:ring-info' }
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
variant: 'subtle',
|
|
163
|
+
color: 'surface',
|
|
164
|
+
class: {
|
|
165
|
+
base: 'data-[active]:ring-2 data-[active]:ring-inset data-[active]:ring-on-surface'
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
// highlight + color → all cells always show color ring
|
|
169
|
+
{ highlight: true, color: 'primary', class: { base: 'ring-2 ring-inset ring-primary' } },
|
|
170
|
+
{
|
|
171
|
+
highlight: true,
|
|
172
|
+
color: 'secondary',
|
|
173
|
+
class: { base: 'ring-2 ring-inset ring-secondary' }
|
|
174
|
+
},
|
|
175
|
+
{ highlight: true, color: 'tertiary', class: { base: 'ring-2 ring-inset ring-tertiary' } },
|
|
176
|
+
{ highlight: true, color: 'success', class: { base: 'ring-2 ring-inset ring-success' } },
|
|
177
|
+
{ highlight: true, color: 'warning', class: { base: 'ring-2 ring-inset ring-warning' } },
|
|
178
|
+
{ highlight: true, color: 'error', class: { base: 'ring-2 ring-inset ring-error' } },
|
|
179
|
+
{ highlight: true, color: 'info', class: { base: 'ring-2 ring-inset ring-info' } },
|
|
180
|
+
{ highlight: true, color: 'surface', class: { base: 'ring-2 ring-inset ring-on-surface' } },
|
|
181
|
+
// fixed=false → responsive text (smaller on mobile)
|
|
182
|
+
{ fixed: false, size: 'xs', class: { base: 'md:text-xs' } },
|
|
183
|
+
{ fixed: false, size: 'sm', class: { base: 'md:text-xs' } },
|
|
184
|
+
{ fixed: false, size: 'md', class: { base: 'md:text-sm' } },
|
|
185
|
+
{ fixed: false, size: 'lg', class: { base: 'md:text-sm' } }
|
|
186
|
+
],
|
|
187
|
+
defaultVariants: {
|
|
188
|
+
variant: 'outline',
|
|
189
|
+
color: 'primary',
|
|
190
|
+
size: 'md'
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
export const pinInputDefaults = {
|
|
194
|
+
defaultVariants: pinInputVariants.defaultVariants,
|
|
195
|
+
slots: {}
|
|
196
|
+
};
|
|
@@ -12,10 +12,11 @@
|
|
|
12
12
|
const config = getComponentConfig('popover', popoverDefaults)
|
|
13
13
|
|
|
14
14
|
let {
|
|
15
|
+
ref = $bindable(null),
|
|
15
16
|
open = $bindable(false),
|
|
16
17
|
onOpenChange,
|
|
17
18
|
onOpenChangeComplete,
|
|
18
|
-
side =
|
|
19
|
+
side = 'bottom',
|
|
19
20
|
sideOffset = 8,
|
|
20
21
|
align = 'center',
|
|
21
22
|
alignOffset = 0,
|
|
@@ -38,12 +39,11 @@
|
|
|
38
39
|
ui,
|
|
39
40
|
class: className,
|
|
40
41
|
children,
|
|
41
|
-
content: contentSlot
|
|
42
|
+
content: contentSlot,
|
|
43
|
+
...restProps
|
|
42
44
|
}: Props = $props()
|
|
43
45
|
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
const variantSlots = $derived(popoverVariants({ side, transition }))
|
|
46
|
+
const variantSlots = $derived(popoverVariants({ transition }))
|
|
47
47
|
const classes = $derived({
|
|
48
48
|
content: variantSlots.content({ class: [config.slots.content, ui?.content] }),
|
|
49
49
|
arrow: variantSlots.arrow({ class: [config.slots.arrow, ui?.arrow] })
|
|
@@ -61,15 +61,11 @@
|
|
|
61
61
|
function close() {
|
|
62
62
|
open = false
|
|
63
63
|
}
|
|
64
|
-
|
|
65
|
-
function handleOpenChange(value: boolean) {
|
|
66
|
-
open = value
|
|
67
|
-
onOpenChange?.(value)
|
|
68
|
-
}
|
|
69
64
|
</script>
|
|
70
65
|
|
|
71
66
|
{#snippet popoverContentEl()}
|
|
72
67
|
<Popover.Content
|
|
68
|
+
bind:ref
|
|
73
69
|
{side}
|
|
74
70
|
{sideOffset}
|
|
75
71
|
{align}
|
|
@@ -89,12 +85,13 @@
|
|
|
89
85
|
{onInteractOutside}
|
|
90
86
|
{forceMount}
|
|
91
87
|
class={[classes.content, !children ? className : undefined]}
|
|
88
|
+
{...restProps}
|
|
92
89
|
>
|
|
93
90
|
{#if contentSlot}
|
|
94
91
|
{@render contentSlot({ open, close })}
|
|
95
92
|
{/if}
|
|
96
93
|
|
|
97
|
-
{#if
|
|
94
|
+
{#if arrow}
|
|
98
95
|
<Popover.Arrow
|
|
99
96
|
width={arrowProps.width}
|
|
100
97
|
height={arrowProps.height}
|
|
@@ -104,7 +101,7 @@
|
|
|
104
101
|
</Popover.Content>
|
|
105
102
|
{/snippet}
|
|
106
103
|
|
|
107
|
-
<Popover.Root bind:open onOpenChange
|
|
104
|
+
<Popover.Root bind:open {onOpenChange} {onOpenChangeComplete}>
|
|
108
105
|
{#if children}
|
|
109
106
|
<Popover.Trigger>
|
|
110
107
|
{#snippet child({ props })}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PopoverProps } from './popover.types.js';
|
|
2
2
|
export type Props = PopoverProps;
|
|
3
3
|
import { Popover } from 'bits-ui';
|
|
4
|
-
declare const Popover: import("svelte").Component<PopoverProps, {}, "open">;
|
|
4
|
+
declare const Popover: import("svelte").Component<PopoverProps, {}, "ref" | "open">;
|
|
5
5
|
type Popover = ReturnType<typeof Popover>;
|
|
6
6
|
export default Popover;
|
|
@@ -5,6 +5,10 @@ import type { PopoverRootPropsWithoutHTML, PopoverContentPropsWithoutHTML, Popov
|
|
|
5
5
|
type RootProps = Pick<PopoverRootPropsWithoutHTML, 'open' | 'onOpenChange' | 'onOpenChangeComplete'>;
|
|
6
6
|
type ContentProps = Pick<PopoverContentPropsWithoutHTML, 'side' | 'sideOffset' | 'align' | 'alignOffset' | 'avoidCollisions' | 'collisionBoundary' | 'collisionPadding' | 'sticky' | 'hideWhenDetached' | 'trapFocus' | 'preventScroll' | 'onOpenAutoFocus' | 'onCloseAutoFocus' | 'onEscapeKeydown' | 'onInteractOutside' | 'forceMount'>;
|
|
7
7
|
export interface PopoverProps extends RootProps, ContentProps {
|
|
8
|
+
/**
|
|
9
|
+
* Bindable reference to the content DOM element.
|
|
10
|
+
*/
|
|
11
|
+
ref?: HTMLElement | null;
|
|
8
12
|
/**
|
|
9
13
|
* Display an arrow alongside the popover.
|
|
10
14
|
* Can be a boolean or arrow props for customization.
|
|
@@ -1,68 +1,26 @@
|
|
|
1
1
|
import { type VariantProps } from 'tailwind-variants';
|
|
2
2
|
export declare const popoverVariants: import("tailwind-variants").TVReturnType<{
|
|
3
|
-
side: {
|
|
4
|
-
top: {
|
|
5
|
-
content: string;
|
|
6
|
-
};
|
|
7
|
-
right: {
|
|
8
|
-
content: string;
|
|
9
|
-
};
|
|
10
|
-
bottom: {
|
|
11
|
-
content: string;
|
|
12
|
-
};
|
|
13
|
-
left: {
|
|
14
|
-
content: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
3
|
transition: {
|
|
18
4
|
true: {
|
|
19
|
-
content: string;
|
|
5
|
+
content: string[];
|
|
20
6
|
};
|
|
21
7
|
};
|
|
22
8
|
}, {
|
|
23
9
|
content: string[];
|
|
24
10
|
arrow: string;
|
|
25
11
|
}, undefined, {
|
|
26
|
-
side: {
|
|
27
|
-
top: {
|
|
28
|
-
content: string;
|
|
29
|
-
};
|
|
30
|
-
right: {
|
|
31
|
-
content: string;
|
|
32
|
-
};
|
|
33
|
-
bottom: {
|
|
34
|
-
content: string;
|
|
35
|
-
};
|
|
36
|
-
left: {
|
|
37
|
-
content: string;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
12
|
transition: {
|
|
41
13
|
true: {
|
|
42
|
-
content: string;
|
|
14
|
+
content: string[];
|
|
43
15
|
};
|
|
44
16
|
};
|
|
45
17
|
}, {
|
|
46
18
|
content: string[];
|
|
47
19
|
arrow: string;
|
|
48
20
|
}, import("tailwind-variants").TVReturnType<{
|
|
49
|
-
side: {
|
|
50
|
-
top: {
|
|
51
|
-
content: string;
|
|
52
|
-
};
|
|
53
|
-
right: {
|
|
54
|
-
content: string;
|
|
55
|
-
};
|
|
56
|
-
bottom: {
|
|
57
|
-
content: string;
|
|
58
|
-
};
|
|
59
|
-
left: {
|
|
60
|
-
content: string;
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
21
|
transition: {
|
|
64
22
|
true: {
|
|
65
|
-
content: string;
|
|
23
|
+
content: string[];
|
|
66
24
|
};
|
|
67
25
|
};
|
|
68
26
|
}, {
|
|
@@ -73,46 +31,18 @@ export type PopoverVariantProps = VariantProps<typeof popoverVariants>;
|
|
|
73
31
|
export type PopoverSlots = keyof ReturnType<typeof popoverVariants>;
|
|
74
32
|
export declare const popoverDefaults: {
|
|
75
33
|
defaultVariants: import("tailwind-variants").TVDefaultVariants<{
|
|
76
|
-
side: {
|
|
77
|
-
top: {
|
|
78
|
-
content: string;
|
|
79
|
-
};
|
|
80
|
-
right: {
|
|
81
|
-
content: string;
|
|
82
|
-
};
|
|
83
|
-
bottom: {
|
|
84
|
-
content: string;
|
|
85
|
-
};
|
|
86
|
-
left: {
|
|
87
|
-
content: string;
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
34
|
transition: {
|
|
91
35
|
true: {
|
|
92
|
-
content: string;
|
|
36
|
+
content: string[];
|
|
93
37
|
};
|
|
94
38
|
};
|
|
95
39
|
}, {
|
|
96
40
|
content: string[];
|
|
97
41
|
arrow: string;
|
|
98
42
|
}, {
|
|
99
|
-
side: {
|
|
100
|
-
top: {
|
|
101
|
-
content: string;
|
|
102
|
-
};
|
|
103
|
-
right: {
|
|
104
|
-
content: string;
|
|
105
|
-
};
|
|
106
|
-
bottom: {
|
|
107
|
-
content: string;
|
|
108
|
-
};
|
|
109
|
-
left: {
|
|
110
|
-
content: string;
|
|
111
|
-
};
|
|
112
|
-
};
|
|
113
43
|
transition: {
|
|
114
44
|
true: {
|
|
115
|
-
content: string;
|
|
45
|
+
content: string[];
|
|
116
46
|
};
|
|
117
47
|
};
|
|
118
48
|
}, {
|