@surreal-ui/svelte 0.5.1 → 0.5.3
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/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/src/components/GlassmorphismAlert.svelte +1 -1
- package/src/components/GlassmorphismButton.svelte +1 -1
- package/src/components/GlassmorphismCard.svelte +1 -1
- package/src/components/GlassmorphismEmptyState.svelte +2 -2
- package/src/components/GlassmorphismInputGroup.svelte +2 -2
- package/src/components/GlassmorphismMenubar.svelte +2 -2
- package/src/components/GlassmorphismScrollArea.svelte +2 -2
- package/src/components/GlassmorphismTable.svelte +4 -4
- package/src/components/GlassmorphismTypography.svelte +2 -2
- package/src/components/MinimalistAccordion.svelte +5 -5
- package/src/components/MinimalistAlert.svelte +1 -1
- package/src/components/MinimalistAlertDialog.svelte +9 -9
- package/src/components/MinimalistAspectRatio.svelte +1 -1
- package/src/components/MinimalistAvatar.svelte +6 -6
- package/src/components/MinimalistBadge.svelte +6 -6
- package/src/components/MinimalistBreadcrumb.svelte +8 -4
- package/src/components/MinimalistButton.svelte +7 -7
- package/src/components/MinimalistButtonGroup.svelte +16 -10
- package/src/components/MinimalistCalendar.svelte +8 -8
- package/src/components/MinimalistCard.svelte +2 -2
- package/src/components/MinimalistCarousel.svelte +6 -6
- package/src/components/MinimalistChart.svelte +8 -8
- package/src/components/MinimalistCheckbox.svelte +2 -2
- package/src/components/MinimalistCodeBlock.svelte +13 -13
- package/src/components/MinimalistCollapsible.svelte +2 -2
- package/src/components/MinimalistCommand.svelte +7 -7
- package/src/components/MinimalistContextMenu.svelte +9 -9
- package/src/components/MinimalistDialog.svelte +10 -6
- package/src/components/MinimalistDrawer.svelte +14 -6
- package/src/components/MinimalistDropdownMenu.svelte +8 -8
- package/src/components/MinimalistEmpty.svelte +15 -10
- package/src/components/MinimalistEmptyState.svelte +2 -2
- package/src/components/MinimalistField.svelte +14 -14
- package/src/components/MinimalistForm.svelte +15 -6
- package/src/components/MinimalistHoverCard.svelte +2 -2
- package/src/components/MinimalistInput.svelte +3 -3
- package/src/components/MinimalistInputGroup.svelte +22 -17
- package/src/components/MinimalistInputOtp.svelte +3 -3
- package/src/components/MinimalistItem.svelte +22 -18
- package/src/components/MinimalistKbd.svelte +8 -3
- package/src/components/MinimalistLabel.svelte +2 -2
- package/src/components/MinimalistMenubar.svelte +11 -11
- package/src/components/MinimalistNativeSelect.svelte +3 -3
- package/src/components/MinimalistNavigationMenu.svelte +6 -6
- package/src/components/MinimalistPagination.svelte +16 -11
- package/src/components/MinimalistPopover.svelte +7 -3
- package/src/components/MinimalistProgress.svelte +2 -2
- package/src/components/MinimalistRadioGroup.svelte +2 -2
- package/src/components/MinimalistRangeCalendar.svelte +9 -9
- package/src/components/MinimalistResizable.svelte +2 -2
- package/src/components/MinimalistScrollArea.svelte +4 -2
- package/src/components/MinimalistSelect.svelte +13 -9
- package/src/components/MinimalistSeparator.svelte +2 -2
- package/src/components/MinimalistSheet.svelte +14 -4
- package/src/components/MinimalistSidebar.svelte +37 -25
- package/src/components/MinimalistSkeleton.svelte +1 -1
- package/src/components/MinimalistSlider.svelte +3 -3
- package/src/components/MinimalistSonner.svelte +1 -1
- package/src/components/MinimalistSpinner.svelte +1 -1
- package/src/components/MinimalistSwitch.svelte +3 -3
- package/src/components/MinimalistTable.svelte +4 -2
- package/src/components/MinimalistTabs.svelte +8 -8
- package/src/components/MinimalistTextarea.svelte +2 -2
- package/src/components/MinimalistToggle.svelte +7 -7
- package/src/components/MinimalistToggleGroup.svelte +11 -11
- package/src/components/MinimalistTooltip.svelte +3 -3
- package/src/components/MinimalistTypography.svelte +2 -2
- package/src/components/NeubrutalismCard.svelte +1 -1
- package/src/components/NeubrutalismItem.svelte +1 -1
- package/src/components/ShadcnAccordion.svelte +5 -5
- package/src/components/ShadcnAlertDialog.svelte +9 -9
- package/src/components/ShadcnAspectRatio.svelte +1 -1
- package/src/components/ShadcnAvatar.svelte +6 -6
- package/src/components/ShadcnBadge.svelte +6 -6
- package/src/components/ShadcnBreadcrumb.svelte +8 -4
- package/src/components/ShadcnButton.svelte +7 -7
- package/src/components/ShadcnButtonGroup.svelte +16 -10
- package/src/components/ShadcnCalendar.svelte +8 -8
- package/src/components/ShadcnCarousel.svelte +6 -6
- package/src/components/ShadcnChart.svelte +8 -8
- package/src/components/ShadcnCheckbox.svelte +2 -2
- package/src/components/ShadcnCodeBlock.svelte +13 -13
- package/src/components/ShadcnCollapsible.svelte +2 -2
- package/src/components/ShadcnCommand.svelte +7 -7
- package/src/components/ShadcnContextMenu.svelte +9 -9
- package/src/components/ShadcnDialog.svelte +10 -6
- package/src/components/ShadcnDrawer.svelte +14 -6
- package/src/components/ShadcnDropdownMenu.svelte +8 -8
- package/src/components/ShadcnEmpty.svelte +15 -10
- package/src/components/ShadcnField.svelte +14 -14
- package/src/components/ShadcnForm.svelte +15 -6
- package/src/components/ShadcnHoverCard.svelte +2 -2
- package/src/components/ShadcnInput.svelte +3 -3
- package/src/components/ShadcnInputGroup.svelte +22 -17
- package/src/components/ShadcnInputOtp.svelte +3 -3
- package/src/components/ShadcnItem.svelte +22 -18
- package/src/components/ShadcnKbd.svelte +8 -3
- package/src/components/ShadcnLabel.svelte +2 -2
- package/src/components/ShadcnMenubar.svelte +11 -11
- package/src/components/ShadcnNativeSelect.svelte +3 -3
- package/src/components/ShadcnNavigationMenu.svelte +6 -6
- package/src/components/ShadcnPagination.svelte +16 -11
- package/src/components/ShadcnPopover.svelte +7 -3
- package/src/components/ShadcnProgress.svelte +2 -2
- package/src/components/ShadcnRadioGroup.svelte +2 -2
- package/src/components/ShadcnRangeCalendar.svelte +9 -9
- package/src/components/ShadcnSelect.svelte +13 -9
- package/src/components/ShadcnSeparator.svelte +2 -2
- package/src/components/ShadcnSheet.svelte +14 -4
- package/src/components/ShadcnSidebar.svelte +37 -25
- package/src/components/ShadcnSkeleton.svelte +1 -1
- package/src/components/ShadcnSlider.svelte +3 -3
- package/src/components/ShadcnSonner.svelte +1 -1
- package/src/components/ShadcnSpinner.svelte +1 -1
- package/src/components/ShadcnSwitch.svelte +3 -3
- package/src/components/ShadcnTabs.svelte +8 -8
- package/src/components/ShadcnTextarea.svelte +2 -2
- package/src/components/ShadcnToggle.svelte +7 -7
- package/src/components/ShadcnToggleGroup.svelte +11 -11
- package/src/components/ShadcnTooltip.svelte +3 -3
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
data-slot="context-menu-content"
|
|
34
34
|
class={cn(
|
|
35
35
|
'min-w-36 rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 z-50 overflow-x-hidden overflow-y-auto outline-none',
|
|
36
|
-
className
|
|
36
|
+
className
|
|
37
37
|
)}
|
|
38
38
|
{...contentProps}
|
|
39
39
|
>
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
data-variant={variant}
|
|
56
56
|
class={cn(
|
|
57
57
|
"gap-1.5 rounded-md px-1.5 py-1 text-sm focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive group/context-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
58
|
-
className
|
|
58
|
+
className
|
|
59
59
|
)}
|
|
60
60
|
{...itemProps}
|
|
61
61
|
>
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
{checked}
|
|
77
77
|
class={cn(
|
|
78
78
|
"gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm focus:bg-accent focus:text-accent-foreground data-inset:pl-7 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
79
|
-
className
|
|
79
|
+
className
|
|
80
80
|
)}
|
|
81
81
|
{...checkboxProps}
|
|
82
82
|
>
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
{value}
|
|
121
121
|
class={cn(
|
|
122
122
|
"gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm focus:bg-accent focus:text-accent-foreground data-inset:pl-7 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
123
|
-
className
|
|
123
|
+
className
|
|
124
124
|
)}
|
|
125
125
|
{...radioItemProps}
|
|
126
126
|
>
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
data-inset={inset}
|
|
142
142
|
class={cn(
|
|
143
143
|
'px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7 data-inset:pl-8',
|
|
144
|
-
className
|
|
144
|
+
className
|
|
145
145
|
)}
|
|
146
146
|
{...labelProps}
|
|
147
147
|
>
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
data-slot="context-menu-shortcut"
|
|
163
163
|
class={cn(
|
|
164
164
|
'ml-auto text-xs tracking-widest text-muted-foreground group-focus/context-menu-item:text-accent-foreground',
|
|
165
|
-
className
|
|
165
|
+
className
|
|
166
166
|
)}
|
|
167
167
|
{...shortcutProps}
|
|
168
168
|
>
|
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
data-inset={inset}
|
|
210
210
|
class={cn(
|
|
211
211
|
"gap-1.5 rounded-md px-1.5 py-1 text-sm focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center outline-hidden select-none data-inset:ps-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
212
|
-
className
|
|
212
|
+
className
|
|
213
213
|
)}
|
|
214
214
|
{...subTriggerProps}
|
|
215
215
|
>
|
|
@@ -223,7 +223,7 @@
|
|
|
223
223
|
data-slot="context-menu-sub-content"
|
|
224
224
|
class={cn(
|
|
225
225
|
'min-w-32 rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',
|
|
226
|
-
className
|
|
226
|
+
className
|
|
227
227
|
)}
|
|
228
228
|
{...subContentProps}
|
|
229
229
|
>
|
|
@@ -233,4 +233,4 @@
|
|
|
233
233
|
|
|
234
234
|
<ContextMenuPrimitive.Root bind:open {...restProps}>
|
|
235
235
|
{@render children?.()}
|
|
236
|
-
</ContextMenuPrimitive.Root>
|
|
236
|
+
</ContextMenuPrimitive.Root>
|
|
@@ -84,13 +84,17 @@
|
|
|
84
84
|
{@render children?.()}
|
|
85
85
|
{/snippet}
|
|
86
86
|
|
|
87
|
-
{#snippet DialogOverlay({
|
|
87
|
+
{#snippet DialogOverlay({
|
|
88
|
+
class: className = '',
|
|
89
|
+
onclick,
|
|
90
|
+
...props
|
|
91
|
+
}: ShadcnDialogOverlayProps = {})}
|
|
88
92
|
<div
|
|
89
93
|
role="presentation"
|
|
90
94
|
data-slot="dialog-overlay"
|
|
91
95
|
class={cn(
|
|
92
96
|
'bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 fixed inset-0 isolate z-50',
|
|
93
|
-
className
|
|
97
|
+
className
|
|
94
98
|
)}
|
|
95
99
|
onclick={(e) => {
|
|
96
100
|
handleOpenChange(false);
|
|
@@ -114,7 +118,7 @@
|
|
|
114
118
|
data-slot="dialog-content"
|
|
115
119
|
class={cn(
|
|
116
120
|
'grid max-w-[calc(100%-2rem)] gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none shadow-lg',
|
|
117
|
-
className
|
|
121
|
+
className
|
|
118
122
|
)}
|
|
119
123
|
{...props}
|
|
120
124
|
>
|
|
@@ -160,7 +164,7 @@
|
|
|
160
164
|
data-slot="dialog-description"
|
|
161
165
|
class={cn(
|
|
162
166
|
'text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground',
|
|
163
|
-
className
|
|
167
|
+
className
|
|
164
168
|
)}
|
|
165
169
|
{...props}
|
|
166
170
|
>
|
|
@@ -178,7 +182,7 @@
|
|
|
178
182
|
data-slot="dialog-footer"
|
|
179
183
|
class={cn(
|
|
180
184
|
'-mx-4 -mb-4 rounded-b-xl border-t bg-muted/50 p-4 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end',
|
|
181
|
-
className
|
|
185
|
+
className
|
|
182
186
|
)}
|
|
183
187
|
{...props}
|
|
184
188
|
>
|
|
@@ -215,4 +219,4 @@
|
|
|
215
219
|
</button>
|
|
216
220
|
{/snippet}
|
|
217
221
|
|
|
218
|
-
{@render children?.()}
|
|
222
|
+
{@render children?.()}
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
onOpenChange,
|
|
61
61
|
direction = 'bottom',
|
|
62
62
|
shouldScaleBackground = true,
|
|
63
|
-
children
|
|
63
|
+
children
|
|
64
64
|
}: ShadcnDrawerRootProps = $props();
|
|
65
65
|
|
|
66
66
|
function setOpen(value: boolean) {
|
|
@@ -93,14 +93,18 @@
|
|
|
93
93
|
{@render children?.()}
|
|
94
94
|
{/snippet}
|
|
95
95
|
|
|
96
|
-
{#snippet DrawerOverlay({
|
|
96
|
+
{#snippet DrawerOverlay({
|
|
97
|
+
class: className = '',
|
|
98
|
+
onclick,
|
|
99
|
+
...props
|
|
100
|
+
}: ShadcnDrawerOverlayProps = {})}
|
|
97
101
|
{#if open}
|
|
98
102
|
<div
|
|
99
103
|
data-slot="drawer-overlay"
|
|
100
104
|
data-state={open ? 'open' : 'closed'}
|
|
101
105
|
class={cn(
|
|
102
106
|
'fixed inset-0 z-50 bg-black/80 supports-backdrop-filter:backdrop-blur-xs transition-opacity duration-300 animate-in fade-in-0',
|
|
103
|
-
className
|
|
107
|
+
className
|
|
104
108
|
)}
|
|
105
109
|
onclick={(e) => {
|
|
106
110
|
onclick?.(e);
|
|
@@ -111,7 +115,11 @@
|
|
|
111
115
|
{/if}
|
|
112
116
|
{/snippet}
|
|
113
117
|
|
|
114
|
-
{#snippet DrawerContent({
|
|
118
|
+
{#snippet DrawerContent({
|
|
119
|
+
class: className = '',
|
|
120
|
+
children,
|
|
121
|
+
...props
|
|
122
|
+
}: ShadcnDrawerContentProps = {})}
|
|
115
123
|
{#if open}
|
|
116
124
|
{@render DrawerOverlay()}
|
|
117
125
|
<div
|
|
@@ -128,7 +136,7 @@
|
|
|
128
136
|
'inset-y-0 left-0 w-3/4 max-w-sm rounded-r-xl border-r animate-in slide-in-from-left',
|
|
129
137
|
direction === 'right' &&
|
|
130
138
|
'inset-y-0 right-0 w-3/4 max-w-sm rounded-l-xl border-l animate-in slide-in-from-right',
|
|
131
|
-
className
|
|
139
|
+
className
|
|
132
140
|
)}
|
|
133
141
|
{...props}
|
|
134
142
|
>
|
|
@@ -206,4 +214,4 @@
|
|
|
206
214
|
|
|
207
215
|
<div data-slot="drawer-root" data-state={open ? 'open' : 'closed'}>
|
|
208
216
|
{@render children?.()}
|
|
209
|
-
</div>
|
|
217
|
+
</div>
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
tabindex={-1}
|
|
133
133
|
class={cn(
|
|
134
134
|
'absolute z-50 min-w-32 rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 animate-in fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 overflow-x-hidden overflow-y-auto outline-none',
|
|
135
|
-
className
|
|
135
|
+
className
|
|
136
136
|
)}
|
|
137
137
|
style="margin-top: {sideOffset}px;"
|
|
138
138
|
{...props}
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
data-disabled={disabled ? '' : undefined}
|
|
162
162
|
class={cn(
|
|
163
163
|
"gap-1.5 rounded-md px-1.5 py-1 text-sm focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-[inset]:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
164
|
-
className
|
|
164
|
+
className
|
|
165
165
|
)}
|
|
166
166
|
onclick={(e) => {
|
|
167
167
|
if (disabled) return;
|
|
@@ -192,7 +192,7 @@
|
|
|
192
192
|
data-disabled={disabled ? '' : undefined}
|
|
193
193
|
class={cn(
|
|
194
194
|
"gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
195
|
-
className
|
|
195
|
+
className
|
|
196
196
|
)}
|
|
197
197
|
onclick={(e) => {
|
|
198
198
|
if (disabled) return;
|
|
@@ -233,7 +233,7 @@
|
|
|
233
233
|
data-disabled={disabled ? '' : undefined}
|
|
234
234
|
class={cn(
|
|
235
235
|
"gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
236
|
-
className
|
|
236
|
+
className
|
|
237
237
|
)}
|
|
238
238
|
onclick={(e) => {
|
|
239
239
|
if (disabled) return;
|
|
@@ -301,7 +301,7 @@
|
|
|
301
301
|
data-slot="dropdown-menu-shortcut"
|
|
302
302
|
class={cn(
|
|
303
303
|
'ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground',
|
|
304
|
-
className
|
|
304
|
+
className
|
|
305
305
|
)}
|
|
306
306
|
{...props}
|
|
307
307
|
>
|
|
@@ -322,7 +322,7 @@
|
|
|
322
322
|
data-open={open ? '' : undefined}
|
|
323
323
|
class={cn(
|
|
324
324
|
"gap-1.5 rounded-md px-1.5 py-1 text-sm focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
325
|
-
className
|
|
325
|
+
className
|
|
326
326
|
)}
|
|
327
327
|
{...props}
|
|
328
328
|
>
|
|
@@ -336,7 +336,7 @@
|
|
|
336
336
|
data-slot="dropdown-menu-sub-content"
|
|
337
337
|
class={cn(
|
|
338
338
|
'min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 animate-in fade-in-0 zoom-in-95 w-auto',
|
|
339
|
-
className
|
|
339
|
+
className
|
|
340
340
|
)}
|
|
341
341
|
{...props}
|
|
342
342
|
>
|
|
@@ -346,4 +346,4 @@
|
|
|
346
346
|
|
|
347
347
|
<div class="relative inline-block text-left" data-slot="dropdown-menu">
|
|
348
348
|
{@render children?.()}
|
|
349
|
-
</div>
|
|
349
|
+
</div>
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
12
|
default: 'bg-transparent',
|
|
13
|
-
icon: "flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4"
|
|
14
|
-
}
|
|
13
|
+
icon: "flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4"
|
|
14
|
+
}
|
|
15
15
|
},
|
|
16
16
|
defaultVariants: {
|
|
17
|
-
variant: 'default'
|
|
18
|
-
}
|
|
19
|
-
}
|
|
17
|
+
variant: 'default'
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
20
|
);
|
|
21
21
|
|
|
22
22
|
export type EmptyMediaVariant = VariantProps<typeof emptyMediaVariants>['variant'];
|
|
@@ -54,7 +54,12 @@
|
|
|
54
54
|
</script>
|
|
55
55
|
|
|
56
56
|
<script lang="ts">
|
|
57
|
-
let {
|
|
57
|
+
let {
|
|
58
|
+
ref = $bindable(null),
|
|
59
|
+
class: className,
|
|
60
|
+
children,
|
|
61
|
+
...restProps
|
|
62
|
+
}: ShadcnEmptyProps = $props();
|
|
58
63
|
</script>
|
|
59
64
|
|
|
60
65
|
{#snippet EmptyHeader({ class: className = '', children, ...props }: ShadcnEmptyHeaderProps = {})}
|
|
@@ -102,7 +107,7 @@
|
|
|
102
107
|
data-slot="empty-description"
|
|
103
108
|
class={cn(
|
|
104
109
|
'text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary',
|
|
105
|
-
className
|
|
110
|
+
className
|
|
106
111
|
)}
|
|
107
112
|
{...props}
|
|
108
113
|
>
|
|
@@ -115,7 +120,7 @@
|
|
|
115
120
|
data-slot="empty-content"
|
|
116
121
|
class={cn(
|
|
117
122
|
'gap-2.5 text-sm flex w-full max-w-sm min-w-0 flex-col items-center text-balance',
|
|
118
|
-
className
|
|
123
|
+
className
|
|
119
124
|
)}
|
|
120
125
|
{...props}
|
|
121
126
|
>
|
|
@@ -128,9 +133,9 @@
|
|
|
128
133
|
data-slot="empty"
|
|
129
134
|
class={cn(
|
|
130
135
|
'gap-4 rounded-xl border-dashed p-6 flex w-full min-w-0 flex-1 flex-col items-center justify-center text-center text-balance',
|
|
131
|
-
className
|
|
136
|
+
className
|
|
132
137
|
)}
|
|
133
138
|
{...restProps}
|
|
134
139
|
>
|
|
135
140
|
{@render children?.()}
|
|
136
|
-
</div>
|
|
141
|
+
</div>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import type {
|
|
6
6
|
HTMLAttributes,
|
|
7
7
|
HTMLLabelAttributes,
|
|
8
|
-
HTMLFieldsetAttributes
|
|
8
|
+
HTMLFieldsetAttributes
|
|
9
9
|
} from 'svelte/elements';
|
|
10
10
|
|
|
11
11
|
export const shadcnFieldVariants = cva(
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
horizontal:
|
|
18
18
|
'cn-field-orientation-horizontal flex-row items-center has-[>[data-slot=field-content]]:items-start [&>[data-slot=field-label]]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',
|
|
19
19
|
responsive:
|
|
20
|
-
'cn-field-orientation-responsive flex-col @md/field-group:flex-row @md/field-group:items-center @md/field-group:has-[>[data-slot=field-content]]:items-start [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto @md/field-group:[&>[data-slot=field-label]]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px'
|
|
21
|
-
}
|
|
20
|
+
'cn-field-orientation-responsive flex-col @md/field-group:flex-row @md/field-group:items-center @md/field-group:has-[>[data-slot=field-content]]:items-start [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto @md/field-group:[&>[data-slot=field-label]]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px'
|
|
21
|
+
}
|
|
22
22
|
},
|
|
23
23
|
defaultVariants: {
|
|
24
|
-
orientation: 'vertical'
|
|
25
|
-
}
|
|
26
|
-
}
|
|
24
|
+
orientation: 'vertical'
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
27
|
);
|
|
28
28
|
|
|
29
29
|
export type ShadcnFieldOrientation = VariantProps<typeof shadcnFieldVariants>['orientation'];
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
data-slot="field-description"
|
|
101
101
|
class={cn(
|
|
102
102
|
'text-left text-sm text-muted-foreground [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance last:mt-0 nth-last-2:-mt-1 [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary',
|
|
103
|
-
descClass
|
|
103
|
+
descClass
|
|
104
104
|
)}
|
|
105
105
|
{...descProps}
|
|
106
106
|
>
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
data-slot="field-group"
|
|
139
139
|
class={cn(
|
|
140
140
|
'gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4 group/field-group @container/field-group flex w-full flex-col',
|
|
141
|
-
groupClass
|
|
141
|
+
groupClass
|
|
142
142
|
)}
|
|
143
143
|
{...groupProps}
|
|
144
144
|
>
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
data-slot="field-label"
|
|
152
152
|
class={cn(
|
|
153
153
|
'gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10 group/field-label peer/field-label flex w-fit cursor-pointer text-sm font-medium text-foreground has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col',
|
|
154
|
-
labelClass
|
|
154
|
+
labelClass
|
|
155
155
|
)}
|
|
156
156
|
{...labelProps}
|
|
157
157
|
>
|
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
data-variant={variant}
|
|
171
171
|
class={cn(
|
|
172
172
|
'mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base text-foreground',
|
|
173
|
-
legendClass
|
|
173
|
+
legendClass
|
|
174
174
|
)}
|
|
175
175
|
{...legendProps}
|
|
176
176
|
>
|
|
@@ -184,7 +184,7 @@
|
|
|
184
184
|
data-content={!!separatorChildren}
|
|
185
185
|
class={cn(
|
|
186
186
|
'-my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2 relative flex items-center justify-center',
|
|
187
|
-
separatorClass
|
|
187
|
+
separatorClass
|
|
188
188
|
)}
|
|
189
189
|
{...separatorProps}
|
|
190
190
|
>
|
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
data-slot="field-set"
|
|
206
206
|
class={cn(
|
|
207
207
|
'gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3 flex flex-col border-0 p-0 m-0',
|
|
208
|
-
setClass
|
|
208
|
+
setClass
|
|
209
209
|
)}
|
|
210
210
|
{...setProps}
|
|
211
211
|
>
|
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
data-slot="field-label"
|
|
219
219
|
class={cn(
|
|
220
220
|
'gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center text-foreground',
|
|
221
|
-
titleClass
|
|
221
|
+
titleClass
|
|
222
222
|
)}
|
|
223
223
|
{...titleProps}
|
|
224
224
|
>
|
|
@@ -236,4 +236,4 @@
|
|
|
236
236
|
{...restProps}
|
|
237
237
|
>
|
|
238
238
|
{@render children?.()}
|
|
239
|
-
</div>
|
|
239
|
+
</div>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
HTMLAttributes,
|
|
6
6
|
HTMLButtonAttributes,
|
|
7
7
|
HTMLLabelAttributes,
|
|
8
|
-
HTMLFieldSetAttributes
|
|
8
|
+
HTMLFieldSetAttributes
|
|
9
9
|
} from 'svelte/elements';
|
|
10
10
|
|
|
11
11
|
export interface ShadcnFormItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -59,13 +59,18 @@
|
|
|
59
59
|
</div>
|
|
60
60
|
{/snippet}
|
|
61
61
|
|
|
62
|
-
{#snippet Label({
|
|
62
|
+
{#snippet Label({
|
|
63
|
+
class: className = '',
|
|
64
|
+
error = false,
|
|
65
|
+
children,
|
|
66
|
+
...props
|
|
67
|
+
}: ShadcnFormLabelProps = {})}
|
|
63
68
|
<label
|
|
64
69
|
data-slot="form-label"
|
|
65
70
|
data-error={error ? '' : undefined}
|
|
66
71
|
class={cn(
|
|
67
72
|
'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 data-[error]:text-destructive',
|
|
68
|
-
className
|
|
73
|
+
className
|
|
69
74
|
)}
|
|
70
75
|
{...props}
|
|
71
76
|
>
|
|
@@ -73,7 +78,11 @@
|
|
|
73
78
|
</label>
|
|
74
79
|
{/snippet}
|
|
75
80
|
|
|
76
|
-
{#snippet Description({
|
|
81
|
+
{#snippet Description({
|
|
82
|
+
class: className = '',
|
|
83
|
+
children,
|
|
84
|
+
...props
|
|
85
|
+
}: ShadcnFormDescriptionProps = {})}
|
|
77
86
|
<p data-slot="form-description" class={cn('text-sm text-muted-foreground', className)} {...props}>
|
|
78
87
|
{@render children?.()}
|
|
79
88
|
</p>
|
|
@@ -144,7 +153,7 @@
|
|
|
144
153
|
variant === 'secondary' && 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
|
145
154
|
variant === 'ghost' && 'hover:bg-accent hover:text-accent-foreground',
|
|
146
155
|
variant === 'link' && 'text-primary underline-offset-4 hover:underline',
|
|
147
|
-
className
|
|
156
|
+
className
|
|
148
157
|
)}
|
|
149
158
|
{...props}
|
|
150
159
|
>
|
|
@@ -154,4 +163,4 @@
|
|
|
154
163
|
|
|
155
164
|
<form class={cn('space-y-6', className)} {...props}>
|
|
156
165
|
{@render children?.()}
|
|
157
|
-
</form>
|
|
166
|
+
</form>
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
{sideOffset}
|
|
58
58
|
class={cn(
|
|
59
59
|
'z-50 w-64 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 origin-(--transform-origin) outline-hidden',
|
|
60
|
-
className
|
|
60
|
+
className
|
|
61
61
|
)}
|
|
62
62
|
{...props}
|
|
63
63
|
>
|
|
@@ -68,4 +68,4 @@
|
|
|
68
68
|
|
|
69
69
|
<HoverCardPrimitive.Root bind:open {...restProps}>
|
|
70
70
|
{@render children?.()}
|
|
71
|
-
</HoverCardPrimitive.Root>
|
|
71
|
+
</HoverCardPrimitive.Root>
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
data-slot={dataSlot}
|
|
32
32
|
class={cn(
|
|
33
33
|
'h-8 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:bg-input/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
|
|
34
|
-
className
|
|
34
|
+
className
|
|
35
35
|
)}
|
|
36
36
|
type="file"
|
|
37
37
|
bind:files
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
data-slot={dataSlot}
|
|
45
45
|
class={cn(
|
|
46
46
|
'h-8 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:bg-input/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
|
|
47
|
-
className
|
|
47
|
+
className
|
|
48
48
|
)}
|
|
49
49
|
{type}
|
|
50
50
|
bind:value
|
|
51
51
|
{...restProps}
|
|
52
52
|
/>
|
|
53
|
-
{/if}
|
|
53
|
+
{/if}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
HTMLAttributes,
|
|
6
6
|
HTMLInputAttributes,
|
|
7
7
|
HTMLTextareaAttributes,
|
|
8
|
-
HTMLButtonAttributes
|
|
8
|
+
HTMLButtonAttributes
|
|
9
9
|
} from 'svelte/elements';
|
|
10
10
|
import type { Snippet } from 'svelte';
|
|
11
11
|
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
'block-start':
|
|
20
20
|
'px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start',
|
|
21
21
|
'block-end':
|
|
22
|
-
'px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start'
|
|
23
|
-
}
|
|
22
|
+
'px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start'
|
|
23
|
+
}
|
|
24
24
|
},
|
|
25
25
|
defaultVariants: {
|
|
26
|
-
align: 'inline-start'
|
|
27
|
-
}
|
|
28
|
-
}
|
|
26
|
+
align: 'inline-start'
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
29
|
);
|
|
30
30
|
|
|
31
31
|
export const inputGroupButtonVariants = cva(
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
xs: "h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",
|
|
37
37
|
sm: 'h-7 gap-1.5 rounded-md px-2 text-xs',
|
|
38
38
|
'icon-xs': 'size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0',
|
|
39
|
-
'icon-sm': 'size-8 p-0 has-[>svg]:p-0'
|
|
40
|
-
}
|
|
39
|
+
'icon-sm': 'size-8 p-0 has-[>svg]:p-0'
|
|
40
|
+
}
|
|
41
41
|
},
|
|
42
42
|
defaultVariants: {
|
|
43
|
-
size: 'xs'
|
|
44
|
-
}
|
|
45
|
-
}
|
|
43
|
+
size: 'xs'
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
46
|
);
|
|
47
47
|
|
|
48
48
|
export type InputGroupAddonAlign = VariantProps<typeof inputGroupAddonVariants>['align'];
|
|
@@ -82,7 +82,12 @@
|
|
|
82
82
|
</script>
|
|
83
83
|
|
|
84
84
|
<script lang="ts">
|
|
85
|
-
let {
|
|
85
|
+
let {
|
|
86
|
+
ref = $bindable(null),
|
|
87
|
+
class: className,
|
|
88
|
+
children,
|
|
89
|
+
...props
|
|
90
|
+
}: ShadcnInputGroupProps = $props();
|
|
86
91
|
</script>
|
|
87
92
|
|
|
88
93
|
{#snippet Addon({ class: className = '', align = 'inline-start', children, ...addonProps })}
|
|
@@ -121,7 +126,7 @@
|
|
|
121
126
|
{value}
|
|
122
127
|
class={cn(
|
|
123
128
|
'flex-1 rounded-none border-0 bg-transparent px-2.5 py-1 text-sm shadow-none ring-0 outline-none placeholder:text-muted-foreground focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent',
|
|
124
|
-
className
|
|
129
|
+
className
|
|
125
130
|
)}
|
|
126
131
|
{...inputProps}
|
|
127
132
|
/>
|
|
@@ -131,7 +136,7 @@
|
|
|
131
136
|
<span
|
|
132
137
|
class={cn(
|
|
133
138
|
"gap-2 text-sm text-muted-foreground [&_svg:not([class*='size-'])]:size-4 flex items-center [&_svg]:pointer-events-none",
|
|
134
|
-
className
|
|
139
|
+
className
|
|
135
140
|
)}
|
|
136
141
|
{...textProps}
|
|
137
142
|
>
|
|
@@ -145,7 +150,7 @@
|
|
|
145
150
|
{value}
|
|
146
151
|
class={cn(
|
|
147
152
|
'flex-1 resize-none rounded-none border-0 bg-transparent px-2.5 py-2 text-sm shadow-none ring-0 outline-none placeholder:text-muted-foreground focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent',
|
|
148
|
-
className
|
|
153
|
+
className
|
|
149
154
|
)}
|
|
150
155
|
{...textareaProps}
|
|
151
156
|
></textarea>
|
|
@@ -157,9 +162,9 @@
|
|
|
157
162
|
role="group"
|
|
158
163
|
class={cn(
|
|
159
164
|
'group/input-group h-8 rounded-lg border border-input transition-colors in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto',
|
|
160
|
-
className
|
|
165
|
+
className
|
|
161
166
|
)}
|
|
162
167
|
{...props}
|
|
163
168
|
>
|
|
164
169
|
{@render children?.()}
|
|
165
|
-
</div>
|
|
170
|
+
</div>
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
disabled: () => disabled,
|
|
100
100
|
activeIndex: () => activeIndex,
|
|
101
101
|
isFocused: () => isFocused,
|
|
102
|
-
onSlotClick: handleSlotClick
|
|
102
|
+
onSlotClick: handleSlotClick
|
|
103
103
|
});
|
|
104
104
|
</script>
|
|
105
105
|
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
class={cn(
|
|
121
121
|
'relative flex h-9 w-9 items-center justify-center border-y border-r border-input text-sm shadow-xs transition-all first:rounded-l-md first:border-l last:rounded-r-md',
|
|
122
122
|
isActive && 'z-10 ring-1 ring-ring border-ring',
|
|
123
|
-
slotClass
|
|
123
|
+
slotClass
|
|
124
124
|
)}
|
|
125
125
|
onclick={() => ctx?.onSlotClick(index)}
|
|
126
126
|
{...slotProps}
|
|
@@ -168,4 +168,4 @@
|
|
|
168
168
|
onblur={() => (isFocused = false)}
|
|
169
169
|
/>
|
|
170
170
|
{@render children?.()}
|
|
171
|
-
</div>
|
|
171
|
+
</div>
|