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
|
@@ -7,50 +7,30 @@ export declare const paginationVariants: import("tailwind-variants").TVReturnTyp
|
|
|
7
7
|
item: string;
|
|
8
8
|
ellipsis: string;
|
|
9
9
|
ellipsisIcon: string;
|
|
10
|
-
firstIcon: string;
|
|
11
|
-
prevIcon: string;
|
|
12
|
-
nextIcon: string;
|
|
13
|
-
lastIcon: string;
|
|
14
10
|
};
|
|
15
11
|
sm: {
|
|
16
12
|
list: string;
|
|
17
13
|
item: string;
|
|
18
14
|
ellipsis: string;
|
|
19
15
|
ellipsisIcon: string;
|
|
20
|
-
firstIcon: string;
|
|
21
|
-
prevIcon: string;
|
|
22
|
-
nextIcon: string;
|
|
23
|
-
lastIcon: string;
|
|
24
16
|
};
|
|
25
17
|
md: {
|
|
26
18
|
list: string;
|
|
27
19
|
item: string;
|
|
28
20
|
ellipsis: string;
|
|
29
21
|
ellipsisIcon: string;
|
|
30
|
-
firstIcon: string;
|
|
31
|
-
prevIcon: string;
|
|
32
|
-
nextIcon: string;
|
|
33
|
-
lastIcon: string;
|
|
34
22
|
};
|
|
35
23
|
lg: {
|
|
36
24
|
list: string;
|
|
37
25
|
item: string;
|
|
38
26
|
ellipsis: string;
|
|
39
27
|
ellipsisIcon: string;
|
|
40
|
-
firstIcon: string;
|
|
41
|
-
prevIcon: string;
|
|
42
|
-
nextIcon: string;
|
|
43
|
-
lastIcon: string;
|
|
44
28
|
};
|
|
45
29
|
xl: {
|
|
46
30
|
list: string;
|
|
47
31
|
item: string;
|
|
48
32
|
ellipsis: string;
|
|
49
33
|
ellipsisIcon: string;
|
|
50
|
-
firstIcon: string;
|
|
51
|
-
prevIcon: string;
|
|
52
|
-
nextIcon: string;
|
|
53
|
-
lastIcon: string;
|
|
54
34
|
};
|
|
55
35
|
};
|
|
56
36
|
disabled: {
|
|
@@ -68,10 +48,6 @@ export declare const paginationVariants: import("tailwind-variants").TVReturnTyp
|
|
|
68
48
|
next: string;
|
|
69
49
|
last: string;
|
|
70
50
|
ellipsisIcon: string;
|
|
71
|
-
firstIcon: string;
|
|
72
|
-
prevIcon: string;
|
|
73
|
-
nextIcon: string;
|
|
74
|
-
lastIcon: string;
|
|
75
51
|
}, undefined, {
|
|
76
52
|
size: {
|
|
77
53
|
xs: {
|
|
@@ -79,50 +55,30 @@ export declare const paginationVariants: import("tailwind-variants").TVReturnTyp
|
|
|
79
55
|
item: string;
|
|
80
56
|
ellipsis: string;
|
|
81
57
|
ellipsisIcon: string;
|
|
82
|
-
firstIcon: string;
|
|
83
|
-
prevIcon: string;
|
|
84
|
-
nextIcon: string;
|
|
85
|
-
lastIcon: string;
|
|
86
58
|
};
|
|
87
59
|
sm: {
|
|
88
60
|
list: string;
|
|
89
61
|
item: string;
|
|
90
62
|
ellipsis: string;
|
|
91
63
|
ellipsisIcon: string;
|
|
92
|
-
firstIcon: string;
|
|
93
|
-
prevIcon: string;
|
|
94
|
-
nextIcon: string;
|
|
95
|
-
lastIcon: string;
|
|
96
64
|
};
|
|
97
65
|
md: {
|
|
98
66
|
list: string;
|
|
99
67
|
item: string;
|
|
100
68
|
ellipsis: string;
|
|
101
69
|
ellipsisIcon: string;
|
|
102
|
-
firstIcon: string;
|
|
103
|
-
prevIcon: string;
|
|
104
|
-
nextIcon: string;
|
|
105
|
-
lastIcon: string;
|
|
106
70
|
};
|
|
107
71
|
lg: {
|
|
108
72
|
list: string;
|
|
109
73
|
item: string;
|
|
110
74
|
ellipsis: string;
|
|
111
75
|
ellipsisIcon: string;
|
|
112
|
-
firstIcon: string;
|
|
113
|
-
prevIcon: string;
|
|
114
|
-
nextIcon: string;
|
|
115
|
-
lastIcon: string;
|
|
116
76
|
};
|
|
117
77
|
xl: {
|
|
118
78
|
list: string;
|
|
119
79
|
item: string;
|
|
120
80
|
ellipsis: string;
|
|
121
81
|
ellipsisIcon: string;
|
|
122
|
-
firstIcon: string;
|
|
123
|
-
prevIcon: string;
|
|
124
|
-
nextIcon: string;
|
|
125
|
-
lastIcon: string;
|
|
126
82
|
};
|
|
127
83
|
};
|
|
128
84
|
disabled: {
|
|
@@ -140,10 +96,6 @@ export declare const paginationVariants: import("tailwind-variants").TVReturnTyp
|
|
|
140
96
|
next: string;
|
|
141
97
|
last: string;
|
|
142
98
|
ellipsisIcon: string;
|
|
143
|
-
firstIcon: string;
|
|
144
|
-
prevIcon: string;
|
|
145
|
-
nextIcon: string;
|
|
146
|
-
lastIcon: string;
|
|
147
99
|
}, import("tailwind-variants").TVReturnType<{
|
|
148
100
|
size: {
|
|
149
101
|
xs: {
|
|
@@ -151,50 +103,30 @@ export declare const paginationVariants: import("tailwind-variants").TVReturnTyp
|
|
|
151
103
|
item: string;
|
|
152
104
|
ellipsis: string;
|
|
153
105
|
ellipsisIcon: string;
|
|
154
|
-
firstIcon: string;
|
|
155
|
-
prevIcon: string;
|
|
156
|
-
nextIcon: string;
|
|
157
|
-
lastIcon: string;
|
|
158
106
|
};
|
|
159
107
|
sm: {
|
|
160
108
|
list: string;
|
|
161
109
|
item: string;
|
|
162
110
|
ellipsis: string;
|
|
163
111
|
ellipsisIcon: string;
|
|
164
|
-
firstIcon: string;
|
|
165
|
-
prevIcon: string;
|
|
166
|
-
nextIcon: string;
|
|
167
|
-
lastIcon: string;
|
|
168
112
|
};
|
|
169
113
|
md: {
|
|
170
114
|
list: string;
|
|
171
115
|
item: string;
|
|
172
116
|
ellipsis: string;
|
|
173
117
|
ellipsisIcon: string;
|
|
174
|
-
firstIcon: string;
|
|
175
|
-
prevIcon: string;
|
|
176
|
-
nextIcon: string;
|
|
177
|
-
lastIcon: string;
|
|
178
118
|
};
|
|
179
119
|
lg: {
|
|
180
120
|
list: string;
|
|
181
121
|
item: string;
|
|
182
122
|
ellipsis: string;
|
|
183
123
|
ellipsisIcon: string;
|
|
184
|
-
firstIcon: string;
|
|
185
|
-
prevIcon: string;
|
|
186
|
-
nextIcon: string;
|
|
187
|
-
lastIcon: string;
|
|
188
124
|
};
|
|
189
125
|
xl: {
|
|
190
126
|
list: string;
|
|
191
127
|
item: string;
|
|
192
128
|
ellipsis: string;
|
|
193
129
|
ellipsisIcon: string;
|
|
194
|
-
firstIcon: string;
|
|
195
|
-
prevIcon: string;
|
|
196
|
-
nextIcon: string;
|
|
197
|
-
lastIcon: string;
|
|
198
130
|
};
|
|
199
131
|
};
|
|
200
132
|
disabled: {
|
|
@@ -212,10 +144,6 @@ export declare const paginationVariants: import("tailwind-variants").TVReturnTyp
|
|
|
212
144
|
next: string;
|
|
213
145
|
last: string;
|
|
214
146
|
ellipsisIcon: string;
|
|
215
|
-
firstIcon: string;
|
|
216
|
-
prevIcon: string;
|
|
217
|
-
nextIcon: string;
|
|
218
|
-
lastIcon: string;
|
|
219
147
|
}, undefined, unknown, unknown, undefined>>;
|
|
220
148
|
export type PaginationVariantProps = VariantProps<typeof paginationVariants>;
|
|
221
149
|
export type PaginationSlots = keyof ReturnType<typeof paginationVariants>;
|
|
@@ -68,11 +68,7 @@ export const paginationVariants = tv({
|
|
|
68
68
|
prev: '',
|
|
69
69
|
next: '',
|
|
70
70
|
last: '',
|
|
71
|
-
ellipsisIcon: navIcon
|
|
72
|
-
firstIcon: navIcon,
|
|
73
|
-
prevIcon: navIcon,
|
|
74
|
-
nextIcon: navIcon,
|
|
75
|
-
lastIcon: navIcon
|
|
71
|
+
ellipsisIcon: navIcon
|
|
76
72
|
},
|
|
77
73
|
variants: {
|
|
78
74
|
size: {
|
|
@@ -80,51 +76,31 @@ export const paginationVariants = tv({
|
|
|
80
76
|
list: 'gap-0.5',
|
|
81
77
|
item: 'size-7 text-xs',
|
|
82
78
|
ellipsis: 'size-7 text-xs',
|
|
83
|
-
ellipsisIcon: 'size-3'
|
|
84
|
-
firstIcon: 'size-3',
|
|
85
|
-
prevIcon: 'size-3',
|
|
86
|
-
nextIcon: 'size-3',
|
|
87
|
-
lastIcon: 'size-3'
|
|
79
|
+
ellipsisIcon: 'size-3'
|
|
88
80
|
},
|
|
89
81
|
sm: {
|
|
90
82
|
list: 'gap-0.5',
|
|
91
83
|
item: 'size-8 text-xs',
|
|
92
84
|
ellipsis: 'size-8 text-xs',
|
|
93
|
-
ellipsisIcon: 'size-3.5'
|
|
94
|
-
firstIcon: 'size-3.5',
|
|
95
|
-
prevIcon: 'size-3.5',
|
|
96
|
-
nextIcon: 'size-3.5',
|
|
97
|
-
lastIcon: 'size-3.5'
|
|
85
|
+
ellipsisIcon: 'size-3.5'
|
|
98
86
|
},
|
|
99
87
|
md: {
|
|
100
88
|
list: 'gap-1',
|
|
101
89
|
item: 'size-9 text-sm',
|
|
102
90
|
ellipsis: 'size-9 text-sm',
|
|
103
|
-
ellipsisIcon: 'size-4'
|
|
104
|
-
firstIcon: 'size-4',
|
|
105
|
-
prevIcon: 'size-4',
|
|
106
|
-
nextIcon: 'size-4',
|
|
107
|
-
lastIcon: 'size-4'
|
|
91
|
+
ellipsisIcon: 'size-4'
|
|
108
92
|
},
|
|
109
93
|
lg: {
|
|
110
94
|
list: 'gap-1',
|
|
111
95
|
item: 'size-10 text-sm',
|
|
112
96
|
ellipsis: 'size-10 text-sm',
|
|
113
|
-
ellipsisIcon: 'size-5'
|
|
114
|
-
firstIcon: 'size-5',
|
|
115
|
-
prevIcon: 'size-5',
|
|
116
|
-
nextIcon: 'size-5',
|
|
117
|
-
lastIcon: 'size-5'
|
|
97
|
+
ellipsisIcon: 'size-5'
|
|
118
98
|
},
|
|
119
99
|
xl: {
|
|
120
100
|
list: 'gap-1.5',
|
|
121
101
|
item: 'size-11 text-base',
|
|
122
102
|
ellipsis: 'size-11 text-base',
|
|
123
|
-
ellipsisIcon: 'size-5'
|
|
124
|
-
firstIcon: 'size-5',
|
|
125
|
-
prevIcon: 'size-5',
|
|
126
|
-
nextIcon: 'size-5',
|
|
127
|
-
lastIcon: 'size-5'
|
|
103
|
+
ellipsisIcon: 'size-5'
|
|
128
104
|
}
|
|
129
105
|
},
|
|
130
106
|
disabled: {
|
|
@@ -67,7 +67,8 @@
|
|
|
67
67
|
itemLabel: itemLabelSlot,
|
|
68
68
|
itemTrailing,
|
|
69
69
|
selected: selectedSlot,
|
|
70
|
-
content: contentSlot
|
|
70
|
+
content: contentSlot,
|
|
71
|
+
...restProps
|
|
71
72
|
}: Props = $props()
|
|
72
73
|
|
|
73
74
|
// ---- Form context ----
|
|
@@ -371,6 +372,7 @@
|
|
|
371
372
|
{/if}
|
|
372
373
|
|
|
373
374
|
<Select.Trigger
|
|
375
|
+
{...restProps}
|
|
374
376
|
id={resolvedId}
|
|
375
377
|
name={resolvedName}
|
|
376
378
|
aria-describedby={ariaDescribedBy}
|
|
@@ -2,7 +2,7 @@ import type { Snippet } from 'svelte';
|
|
|
2
2
|
import type { ClassNameValue } from 'tailwind-merge';
|
|
3
3
|
import type { SelectVariantProps, SelectSlots } from './select.variants.js';
|
|
4
4
|
import type { AvatarProps } from '../Avatar/avatar.types.js';
|
|
5
|
-
import type { SelectRootPropsWithoutHTML, SelectContentPropsWithoutHTML } from 'bits-ui';
|
|
5
|
+
import type { SelectRootPropsWithoutHTML, SelectContentPropsWithoutHTML, SelectTriggerProps } from 'bits-ui';
|
|
6
6
|
/**
|
|
7
7
|
* The value shape for the Select.
|
|
8
8
|
* - When `multiple` is `false` (or omitted), the value is a single string (or undefined).
|
|
@@ -102,7 +102,10 @@ type ContentProps = Pick<SelectContentPropsWithoutHTML, 'side' | 'sideOffset' |
|
|
|
102
102
|
*
|
|
103
103
|
* @see https://bits-ui.com/docs/components/select
|
|
104
104
|
*/
|
|
105
|
-
|
|
105
|
+
type TriggerHTMLProps = Pick<SelectTriggerProps, 'style' | 'title' | 'role' | 'tabindex' | 'aria-label' | 'aria-labelledby' | 'onclick' | 'onkeydown' | 'onmouseenter' | 'onmouseleave' | 'onfocus' | 'onblur'>;
|
|
106
|
+
export interface SelectProps extends RootProps, ContentProps, TriggerHTMLProps {
|
|
107
|
+
/** Custom data attributes are forwarded to the trigger element. */
|
|
108
|
+
[key: `data-${string}`]: unknown;
|
|
106
109
|
/**
|
|
107
110
|
* Bindable reference to the root DOM element.
|
|
108
111
|
*/
|
|
@@ -114,13 +117,6 @@ export interface SelectProps extends RootProps, ContentProps {
|
|
|
114
117
|
* - When `multiple` is `true`, this is a `string[]`.
|
|
115
118
|
*/
|
|
116
119
|
value?: string | string[];
|
|
117
|
-
/**
|
|
118
|
-
* The default selected value when uncontrolled.
|
|
119
|
-
*
|
|
120
|
-
* - When `multiple` is `false`/omitted, this is a `string`.
|
|
121
|
-
* - When `multiple` is `true`, this is a `string[]`.
|
|
122
|
-
*/
|
|
123
|
-
defaultValue?: string | string[];
|
|
124
120
|
/**
|
|
125
121
|
* Whether multiple items can be selected at once.
|
|
126
122
|
* When `true`, `value` becomes a `string[]` and the trigger displays
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
} from '../FieldGroup/field-group.variants.js'
|
|
22
22
|
import Icon from '../Icon/Icon.svelte'
|
|
23
23
|
import Avatar from '../Avatar/Avatar.svelte'
|
|
24
|
-
import Input from '../Input/Input.svelte'
|
|
25
24
|
import type { AvatarSize } from '../Avatar/avatar.types.js'
|
|
26
25
|
import { useFormField, useFormFieldEmit } from '../hooks/useFormField.svelte.js'
|
|
27
26
|
|
|
@@ -82,7 +81,8 @@
|
|
|
82
81
|
itemTrailing,
|
|
83
82
|
selected: selectedSlot,
|
|
84
83
|
empty: emptySlot,
|
|
85
|
-
content: contentSlot
|
|
84
|
+
content: contentSlot,
|
|
85
|
+
...restProps
|
|
86
86
|
}: Props = $props()
|
|
87
87
|
|
|
88
88
|
// ---- Form context ----
|
|
@@ -444,7 +444,9 @@
|
|
|
444
444
|
{forceMount}
|
|
445
445
|
class={contentClass}
|
|
446
446
|
>
|
|
447
|
-
|
|
447
|
+
<!-- svelte-ignore a11y_autofocus -->
|
|
448
|
+
<input
|
|
449
|
+
type="text"
|
|
448
450
|
autofocus
|
|
449
451
|
placeholder={searchPlaceholder}
|
|
450
452
|
value={searchTerm}
|
|
@@ -455,8 +457,6 @@
|
|
|
455
457
|
e.preventDefault()
|
|
456
458
|
handleCreate()
|
|
457
459
|
}}
|
|
458
|
-
variant="none"
|
|
459
|
-
size={resolvedSize}
|
|
460
460
|
class={inputClass}
|
|
461
461
|
/>
|
|
462
462
|
|
|
@@ -539,6 +539,7 @@
|
|
|
539
539
|
/>
|
|
540
540
|
|
|
541
541
|
<Combobox.Trigger
|
|
542
|
+
{...restProps}
|
|
542
543
|
id={resolvedId}
|
|
543
544
|
aria-describedby={ariaDescribedBy}
|
|
544
545
|
aria-invalid={resolvedHighlight ? true : undefined}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import FormField from '../FormField/FormField.svelte'
|
|
3
|
+
import SelectMenu from './SelectMenu.svelte'
|
|
4
|
+
import type { SelectMenuItemType } from './select-menu.types.js'
|
|
5
|
+
|
|
6
|
+
let { items = [] }: { items?: SelectMenuItemType[] } = $props()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<FormField name="fruit" label="Fruit">
|
|
10
|
+
<SelectMenu open {items} placeholder="Pick" />
|
|
11
|
+
</FormField>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SelectMenuItemType } from './select-menu.types.js';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
items?: SelectMenuItemType[];
|
|
4
|
+
};
|
|
5
|
+
declare const SelectMenuFormFieldTestWrapper: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
6
|
+
type SelectMenuFormFieldTestWrapper = ReturnType<typeof SelectMenuFormFieldTestWrapper>;
|
|
7
|
+
export default SelectMenuFormFieldTestWrapper;
|
|
@@ -2,7 +2,7 @@ import type { Snippet } from 'svelte';
|
|
|
2
2
|
import type { ClassNameValue } from 'tailwind-merge';
|
|
3
3
|
import type { SelectMenuVariantProps, SelectMenuSlots } from './select-menu.variants.js';
|
|
4
4
|
import type { AvatarProps } from '../Avatar/avatar.types.js';
|
|
5
|
-
import type { ComboboxContentPropsWithoutHTML } from 'bits-ui';
|
|
5
|
+
import type { ComboboxContentPropsWithoutHTML, ComboboxTriggerProps } from 'bits-ui';
|
|
6
6
|
/**
|
|
7
7
|
* A single selectable option within the SelectMenu.
|
|
8
8
|
*/
|
|
@@ -87,7 +87,10 @@ type ContentProps = Pick<ComboboxContentPropsWithoutHTML, 'side' | 'sideOffset'
|
|
|
87
87
|
*
|
|
88
88
|
* @see https://bits-ui.com/docs/components/combobox
|
|
89
89
|
*/
|
|
90
|
-
|
|
90
|
+
type TriggerHTMLProps = Pick<ComboboxTriggerProps, 'style' | 'title' | 'role' | 'tabindex' | 'aria-label' | 'aria-labelledby' | 'onclick' | 'onkeydown' | 'onmouseenter' | 'onmouseleave' | 'onfocus' | 'onblur'>;
|
|
91
|
+
export interface SelectMenuProps extends ContentProps, TriggerHTMLProps {
|
|
92
|
+
/** Custom data attributes are forwarded to the trigger element. */
|
|
93
|
+
[key: `data-${string}`]: unknown;
|
|
91
94
|
/**
|
|
92
95
|
* Bindable reference to the root DOM element.
|
|
93
96
|
*/
|
|
@@ -2,26 +2,31 @@ import { type VariantProps } from 'tailwind-variants';
|
|
|
2
2
|
export declare const selectMenuVariants: import("tailwind-variants").TVReturnType<{
|
|
3
3
|
size: {
|
|
4
4
|
xs: {
|
|
5
|
+
input: string;
|
|
5
6
|
empty: string;
|
|
6
7
|
createItem: string;
|
|
7
8
|
createItemIcon: string;
|
|
8
9
|
};
|
|
9
10
|
sm: {
|
|
11
|
+
input: string;
|
|
10
12
|
empty: string;
|
|
11
13
|
createItem: string;
|
|
12
14
|
createItemIcon: string;
|
|
13
15
|
};
|
|
14
16
|
md: {
|
|
17
|
+
input: string;
|
|
15
18
|
empty: string;
|
|
16
19
|
createItem: string;
|
|
17
20
|
createItemIcon: string;
|
|
18
21
|
};
|
|
19
22
|
lg: {
|
|
23
|
+
input: string;
|
|
20
24
|
empty: string;
|
|
21
25
|
createItem: string;
|
|
22
26
|
createItemIcon: string;
|
|
23
27
|
};
|
|
24
28
|
xl: {
|
|
29
|
+
input: string;
|
|
25
30
|
empty: string;
|
|
26
31
|
createItem: string;
|
|
27
32
|
createItemIcon: string;
|
|
@@ -29,7 +34,7 @@ export declare const selectMenuVariants: import("tailwind-variants").TVReturnTyp
|
|
|
29
34
|
};
|
|
30
35
|
}, {
|
|
31
36
|
content: string[];
|
|
32
|
-
input: string;
|
|
37
|
+
input: string[];
|
|
33
38
|
viewport: string;
|
|
34
39
|
empty: string;
|
|
35
40
|
createItem: string[];
|
|
@@ -606,26 +611,31 @@ export declare const selectMenuDefaults: {
|
|
|
606
611
|
defaultVariants: import("tailwind-variants").TVDefaultVariants<{
|
|
607
612
|
size: {
|
|
608
613
|
xs: {
|
|
614
|
+
input: string;
|
|
609
615
|
empty: string;
|
|
610
616
|
createItem: string;
|
|
611
617
|
createItemIcon: string;
|
|
612
618
|
};
|
|
613
619
|
sm: {
|
|
620
|
+
input: string;
|
|
614
621
|
empty: string;
|
|
615
622
|
createItem: string;
|
|
616
623
|
createItemIcon: string;
|
|
617
624
|
};
|
|
618
625
|
md: {
|
|
626
|
+
input: string;
|
|
619
627
|
empty: string;
|
|
620
628
|
createItem: string;
|
|
621
629
|
createItemIcon: string;
|
|
622
630
|
};
|
|
623
631
|
lg: {
|
|
632
|
+
input: string;
|
|
624
633
|
empty: string;
|
|
625
634
|
createItem: string;
|
|
626
635
|
createItemIcon: string;
|
|
627
636
|
};
|
|
628
637
|
xl: {
|
|
638
|
+
input: string;
|
|
629
639
|
empty: string;
|
|
630
640
|
createItem: string;
|
|
631
641
|
createItemIcon: string;
|
|
@@ -633,7 +643,7 @@ export declare const selectMenuDefaults: {
|
|
|
633
643
|
};
|
|
634
644
|
}, {
|
|
635
645
|
content: string[];
|
|
636
|
-
input: string;
|
|
646
|
+
input: string[];
|
|
637
647
|
viewport: string;
|
|
638
648
|
empty: string;
|
|
639
649
|
createItem: string[];
|
|
@@ -13,7 +13,11 @@ export const selectMenuVariants = tv({
|
|
|
13
13
|
'overflow-hidden',
|
|
14
14
|
'flex flex-col'
|
|
15
15
|
],
|
|
16
|
-
input:
|
|
16
|
+
input: [
|
|
17
|
+
'w-full border-0 border-b border-outline-variant bg-transparent',
|
|
18
|
+
'text-on-surface placeholder:text-on-surface-variant/50',
|
|
19
|
+
'focus:outline-none focus:ring-0'
|
|
20
|
+
],
|
|
17
21
|
viewport: 'p-1 flex-1 overflow-y-auto scrollbar-thin',
|
|
18
22
|
empty: 'text-center text-on-surface-variant',
|
|
19
23
|
createItem: [
|
|
@@ -28,26 +32,31 @@ export const selectMenuVariants = tv({
|
|
|
28
32
|
variants: {
|
|
29
33
|
size: {
|
|
30
34
|
xs: {
|
|
35
|
+
input: 'px-2 py-1 text-xs',
|
|
31
36
|
empty: 'p-2 text-xs',
|
|
32
37
|
createItem: 'py-1 text-xs',
|
|
33
38
|
createItemIcon: 'size-3'
|
|
34
39
|
},
|
|
35
40
|
sm: {
|
|
41
|
+
input: 'px-2.5 py-1.5 text-xs',
|
|
36
42
|
empty: 'p-2.5 text-xs',
|
|
37
43
|
createItem: 'py-1.5 text-xs',
|
|
38
44
|
createItemIcon: 'size-3.5'
|
|
39
45
|
},
|
|
40
46
|
md: {
|
|
47
|
+
input: 'px-3 py-2 text-sm',
|
|
41
48
|
empty: 'p-2.5 text-sm',
|
|
42
49
|
createItem: 'py-1.5 text-sm',
|
|
43
50
|
createItemIcon: 'size-4'
|
|
44
51
|
},
|
|
45
52
|
lg: {
|
|
53
|
+
input: 'px-4 py-2.5 text-sm',
|
|
46
54
|
empty: 'p-3 text-sm',
|
|
47
55
|
createItem: 'py-2 text-sm',
|
|
48
56
|
createItemIcon: 'size-5'
|
|
49
57
|
},
|
|
50
58
|
xl: {
|
|
59
|
+
input: 'px-5 py-3 text-base',
|
|
51
60
|
empty: 'p-3 text-base',
|
|
52
61
|
createItem: 'py-2.5 text-base',
|
|
53
62
|
createItemIcon: 'size-5'
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
size = config.defaultVariants.size,
|
|
25
25
|
type = config.defaultVariants.type,
|
|
26
26
|
orientation = config.defaultVariants.orientation,
|
|
27
|
+
position = config.defaultVariants.position,
|
|
27
28
|
decorative = false,
|
|
28
29
|
class: className,
|
|
29
30
|
content,
|
|
@@ -46,9 +47,11 @@
|
|
|
46
47
|
</script>
|
|
47
48
|
|
|
48
49
|
<Separator.Root bind:ref class={classes.root} {orientation} {decorative} {...restProps}>
|
|
49
|
-
<div class={classes.border}></div>
|
|
50
|
-
|
|
51
50
|
{#if hasContent}
|
|
51
|
+
{#if position !== 'start'}
|
|
52
|
+
<div class={classes.border}></div>
|
|
53
|
+
{/if}
|
|
54
|
+
|
|
52
55
|
<div class={classes.container}>
|
|
53
56
|
{#if content}
|
|
54
57
|
{@render content()}
|
|
@@ -65,6 +68,10 @@
|
|
|
65
68
|
{/if}
|
|
66
69
|
</div>
|
|
67
70
|
|
|
71
|
+
{#if position !== 'end'}
|
|
72
|
+
<div class={classes.border}></div>
|
|
73
|
+
{/if}
|
|
74
|
+
{:else}
|
|
68
75
|
<div class={classes.border}></div>
|
|
69
76
|
{/if}
|
|
70
77
|
</Separator.Root>
|
|
@@ -19,6 +19,11 @@ export type SeparatorProps = Separator.RootProps & {
|
|
|
19
19
|
* @default 'solid'
|
|
20
20
|
*/
|
|
21
21
|
type?: NonNullable<SeparatorVariantProps['type']>;
|
|
22
|
+
/**
|
|
23
|
+
* Position of the label/icon/avatar/content along the separator.
|
|
24
|
+
* @default 'center'
|
|
25
|
+
*/
|
|
26
|
+
position?: NonNullable<SeparatorVariantProps['position']>;
|
|
22
27
|
/**
|
|
23
28
|
* Text content displayed in the center of the separator.
|
|
24
29
|
*/
|
|
@@ -87,6 +87,11 @@ export declare const separatorVariants: import("tailwind-variants").TVReturnType
|
|
|
87
87
|
container: string;
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
|
+
position: {
|
|
91
|
+
start: string;
|
|
92
|
+
center: string;
|
|
93
|
+
end: string;
|
|
94
|
+
};
|
|
90
95
|
}, {
|
|
91
96
|
root: string;
|
|
92
97
|
border: string;
|
|
@@ -182,6 +187,11 @@ export declare const separatorVariants: import("tailwind-variants").TVReturnType
|
|
|
182
187
|
container: string;
|
|
183
188
|
};
|
|
184
189
|
};
|
|
190
|
+
position: {
|
|
191
|
+
start: string;
|
|
192
|
+
center: string;
|
|
193
|
+
end: string;
|
|
194
|
+
};
|
|
185
195
|
}, {
|
|
186
196
|
root: string;
|
|
187
197
|
border: string;
|
|
@@ -277,6 +287,11 @@ export declare const separatorVariants: import("tailwind-variants").TVReturnType
|
|
|
277
287
|
container: string;
|
|
278
288
|
};
|
|
279
289
|
};
|
|
290
|
+
position: {
|
|
291
|
+
start: string;
|
|
292
|
+
center: string;
|
|
293
|
+
end: string;
|
|
294
|
+
};
|
|
280
295
|
}, {
|
|
281
296
|
root: string;
|
|
282
297
|
border: string;
|
|
@@ -376,6 +391,11 @@ export declare const separatorDefaults: {
|
|
|
376
391
|
container: string;
|
|
377
392
|
};
|
|
378
393
|
};
|
|
394
|
+
position: {
|
|
395
|
+
start: string;
|
|
396
|
+
center: string;
|
|
397
|
+
end: string;
|
|
398
|
+
};
|
|
379
399
|
}, {
|
|
380
400
|
root: string;
|
|
381
401
|
border: string;
|
|
@@ -471,6 +491,11 @@ export declare const separatorDefaults: {
|
|
|
471
491
|
container: string;
|
|
472
492
|
};
|
|
473
493
|
};
|
|
494
|
+
position: {
|
|
495
|
+
start: string;
|
|
496
|
+
center: string;
|
|
497
|
+
end: string;
|
|
498
|
+
};
|
|
474
499
|
}, {
|
|
475
500
|
root: string;
|
|
476
501
|
border: string;
|
|
@@ -74,6 +74,11 @@ export const separatorVariants = tv({
|
|
|
74
74
|
border: 'h-full flex-1',
|
|
75
75
|
container: 'my-2'
|
|
76
76
|
}
|
|
77
|
+
},
|
|
78
|
+
position: {
|
|
79
|
+
start: '',
|
|
80
|
+
center: '',
|
|
81
|
+
end: ''
|
|
77
82
|
}
|
|
78
83
|
},
|
|
79
84
|
compoundVariants: [
|
|
@@ -94,7 +99,8 @@ export const separatorVariants = tv({
|
|
|
94
99
|
color: 'surface',
|
|
95
100
|
size: 'xs',
|
|
96
101
|
type: 'solid',
|
|
97
|
-
orientation: 'horizontal'
|
|
102
|
+
orientation: 'horizontal',
|
|
103
|
+
position: 'center'
|
|
98
104
|
}
|
|
99
105
|
});
|
|
100
106
|
export const separatorDefaults = {
|