@moduix/solid-tailwind 1.0.0 → 1.1.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/components/accordion/Accordion.js +19 -13
- package/dist/components/accordion/Accordion.jsx +7 -7
- package/dist/components/alert/Alert.js +19 -13
- package/dist/components/alert/Alert.jsx +7 -7
- package/dist/components/angle-slider/AngleSlider.d.ts +2 -6
- package/dist/components/angle-slider/AngleSlider.js +21 -16
- package/dist/components/angle-slider/AngleSlider.jsx +10 -11
- package/dist/components/avatar/Avatar.js +10 -7
- package/dist/components/avatar/Avatar.jsx +6 -6
- package/dist/components/bleed/Bleed.js +1 -1
- package/dist/components/bleed/Bleed.jsx +1 -1
- package/dist/components/button/Button.js +1 -6
- package/dist/components/button/Button.jsx +2 -4
- package/dist/components/card/Card.js +54 -44
- package/dist/components/card/Card.jsx +12 -12
- package/dist/components/carousel/Carousel.d.ts +1 -1
- package/dist/components/carousel/Carousel.js +32 -23
- package/dist/components/carousel/Carousel.jsx +12 -13
- package/dist/components/checkbox/Checkbox.js +16 -14
- package/dist/components/checkbox/Checkbox.jsx +6 -6
- package/dist/components/clipboard/Clipboard.js +28 -17
- package/dist/components/clipboard/Clipboard.jsx +12 -11
- package/dist/components/collapsible/Collapsible.js +16 -11
- package/dist/components/collapsible/Collapsible.jsx +6 -6
- package/dist/components/color-picker/ColorPicker.js +69 -48
- package/dist/components/color-picker/ColorPicker.jsx +28 -28
- package/dist/components/combobox/Combobox.js +44 -31
- package/dist/components/combobox/Combobox.jsx +18 -18
- package/dist/components/command-palette/CommandPalette.js +71 -52
- package/dist/components/command-palette/CommandPalette.jsx +28 -31
- package/dist/components/container/Container.js +5 -5
- package/dist/components/container/Container.jsx +5 -5
- package/dist/components/date-input/DateInput.js +18 -12
- package/dist/components/date-input/DateInput.jsx +7 -7
- package/dist/components/date-picker/DatePicker.js +73 -51
- package/dist/components/date-picker/DatePicker.jsx +29 -29
- package/dist/components/dialog/Dialog.js +30 -20
- package/dist/components/dialog/Dialog.jsx +10 -10
- package/dist/components/drawer/Drawer.js +45 -30
- package/dist/components/drawer/Drawer.jsx +15 -15
- package/dist/components/editable/Editable.js +24 -17
- package/dist/components/editable/Editable.jsx +10 -10
- package/dist/components/empty/Empty.js +1 -1
- package/dist/components/empty/Empty.jsx +1 -1
- package/dist/components/file-upload/FileUpload.js +39 -28
- package/dist/components/file-upload/FileUpload.jsx +17 -17
- package/dist/components/floating-panel/FloatingPanel.js +35 -23
- package/dist/components/floating-panel/FloatingPanel.jsx +12 -12
- package/dist/components/hover-card/HoverCard.js +16 -11
- package/dist/components/hover-card/HoverCard.jsx +6 -6
- package/dist/components/image-cropper/ImageCropper.js +21 -14
- package/dist/components/image-cropper/ImageCropper.jsx +7 -7
- package/dist/components/input-group/InputGroup.js +3 -2
- package/dist/components/input-group/InputGroup.jsx +3 -2
- package/dist/components/json-tree-view/JsonTreeView.js +1 -1
- package/dist/components/json-tree-view/JsonTreeView.jsx +1 -1
- package/dist/components/lightbox/Lightbox.d.ts +1 -0
- package/dist/components/lightbox/Lightbox.js +41 -27
- package/dist/components/lightbox/Lightbox.jsx +13 -12
- package/dist/components/listbox/Listbox.js +48 -32
- package/dist/components/listbox/Listbox.jsx +17 -17
- package/dist/components/marquee/Marquee.js +18 -12
- package/dist/components/marquee/Marquee.jsx +9 -9
- package/dist/components/menu/Menu.js +66 -44
- package/dist/components/menu/Menu.jsx +28 -28
- package/dist/components/navigation-menu/NavigationMenu.js +36 -24
- package/dist/components/navigation-menu/NavigationMenu.jsx +12 -12
- package/dist/components/number-input/NumberInput.js +19 -14
- package/dist/components/number-input/NumberInput.jsx +9 -9
- package/dist/components/pagination/Pagination.js +10 -9
- package/dist/components/pagination/Pagination.jsx +8 -8
- package/dist/components/password-input/PasswordInput.js +16 -11
- package/dist/components/password-input/PasswordInput.jsx +6 -6
- package/dist/components/pin-input/PinInput.js +15 -10
- package/dist/components/pin-input/PinInput.jsx +6 -6
- package/dist/components/popover/Popover.js +37 -25
- package/dist/components/popover/Popover.jsx +13 -13
- package/dist/components/progress-circular/ProgressCircular.js +18 -13
- package/dist/components/progress-circular/ProgressCircular.jsx +8 -8
- package/dist/components/progress-linear/ProgressLinear.js +17 -12
- package/dist/components/progress-linear/ProgressLinear.jsx +7 -7
- package/dist/components/qr-code/QrCode.js +8 -7
- package/dist/components/qr-code/QrCode.jsx +6 -6
- package/dist/components/rating-group/RatingGroup.js +15 -10
- package/dist/components/rating-group/RatingGroup.jsx +6 -6
- package/dist/components/segment-group/SegmentGroup.js +17 -12
- package/dist/components/segment-group/SegmentGroup.jsx +7 -7
- package/dist/components/select/Select.js +50 -35
- package/dist/components/select/Select.jsx +20 -20
- package/dist/components/sidebar/Sidebar.js +72 -43
- package/dist/components/sidebar/Sidebar.jsx +34 -27
- package/dist/components/signature-pad/SignaturePad.js +16 -12
- package/dist/components/signature-pad/SignaturePad.jsx +8 -8
- package/dist/components/slider/Slider.js +29 -20
- package/dist/components/slider/Slider.jsx +11 -11
- package/dist/components/split-button/SplitButton.d.ts +4 -3
- package/dist/components/split-button/SplitButton.js +20 -9
- package/dist/components/split-button/SplitButton.jsx +13 -7
- package/dist/components/splitter/Splitter.js +13 -9
- package/dist/components/splitter/Splitter.jsx +5 -5
- package/dist/components/steps/Steps.js +34 -23
- package/dist/components/steps/Steps.jsx +12 -12
- package/dist/components/swap/Swap.js +9 -6
- package/dist/components/swap/Swap.jsx +3 -3
- package/dist/components/switch/Switch.js +9 -7
- package/dist/components/switch/Switch.jsx +5 -5
- package/dist/components/tabs/Tabs.js +18 -12
- package/dist/components/tabs/Tabs.jsx +6 -6
- package/dist/components/tags-input/TagsInput.js +28 -20
- package/dist/components/tags-input/TagsInput.jsx +12 -12
- package/dist/components/timer/Timer.js +21 -14
- package/dist/components/timer/Timer.jsx +7 -7
- package/dist/components/toast/Toast.js +11 -9
- package/dist/components/toast/Toast.jsx +7 -7
- package/dist/components/toc/Toc.js +31 -20
- package/dist/components/toc/Toc.jsx +10 -10
- package/dist/components/tooltip/Tooltip.js +13 -9
- package/dist/components/tooltip/Tooltip.jsx +5 -5
- package/dist/components/tour/Tour.js +38 -26
- package/dist/components/tour/Tour.jsx +13 -13
- package/dist/components/tree-view/TreeView.js +39 -28
- package/dist/components/tree-view/TreeView.jsx +17 -17
- package/dist/styles/animations.css +8 -8
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ import { children, createEffect, onCleanup, splitProps } from "solid-js";
|
|
|
5
5
|
import { cn } from "../../internal/cn.js";
|
|
6
6
|
import { OverlayPortal, OverlayPortalProvider } from "../../internal/overlayPortal.js";
|
|
7
7
|
import { CloseButton } from "../close-button/index.js";
|
|
8
|
-
var _tmpl$ = /*#__PURE__*/ template("<img
|
|
8
|
+
var _tmpl$ = /*#__PURE__*/ template("<img>");
|
|
9
9
|
const DEFAULT_CLOSE_LABEL = 'Close image';
|
|
10
10
|
function preloadImage(src) {
|
|
11
11
|
if (!src || "u" < typeof Image) return;
|
|
@@ -101,11 +101,12 @@ function LightboxTrigger(props) {
|
|
|
101
101
|
get asChild () {
|
|
102
102
|
return local.asChild;
|
|
103
103
|
},
|
|
104
|
-
"data-slot": "lightbox-trigger",
|
|
105
104
|
get ["class"] () {
|
|
106
105
|
return cn('cursor-zoom-in focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring', local.class);
|
|
107
106
|
}
|
|
108
|
-
}, others
|
|
107
|
+
}, others, {
|
|
108
|
+
"data-slot": "lightbox-trigger"
|
|
109
|
+
}));
|
|
109
110
|
}
|
|
110
111
|
function LightboxBackdrop(props) {
|
|
111
112
|
const [local, others] = splitProps(props, [
|
|
@@ -114,11 +115,12 @@ function LightboxBackdrop(props) {
|
|
|
114
115
|
return createComponent(OverlayPortal, {
|
|
115
116
|
get children () {
|
|
116
117
|
return createComponent(Dialog.Backdrop, mergeProps({
|
|
117
|
-
"data-slot": "lightbox-backdrop",
|
|
118
118
|
get ["class"] () {
|
|
119
119
|
return cn('fixed inset-0 z-[calc(40+var(--layer-index,0))] min-h-dvh bg-overlay backdrop-blur-xs data-[state=closed]:animate-[moduix-fade-out_200ms_ease-in-out_forwards] data-[state=open]:animate-[moduix-fade-in_200ms_ease-in-out] motion-reduce:[animation-delay:0ms] motion-reduce:[animation-duration:1ms]', local.class);
|
|
120
120
|
}
|
|
121
|
-
}, others
|
|
121
|
+
}, others, {
|
|
122
|
+
"data-slot": "lightbox-backdrop"
|
|
123
|
+
}));
|
|
122
124
|
}
|
|
123
125
|
});
|
|
124
126
|
}
|
|
@@ -129,11 +131,12 @@ function LightboxPositioner(props) {
|
|
|
129
131
|
return createComponent(OverlayPortal, {
|
|
130
132
|
get children () {
|
|
131
133
|
return createComponent(Dialog.Positioner, mergeProps({
|
|
132
|
-
"data-slot": "lightbox-positioner",
|
|
133
134
|
get ["class"] () {
|
|
134
135
|
return cn('fixed inset-0 z-[calc(50+var(--layer-index,0))] box-border grid place-items-center overflow-auto overscroll-contain p-4', local.class);
|
|
135
136
|
}
|
|
136
|
-
}, others
|
|
137
|
+
}, others, {
|
|
138
|
+
"data-slot": "lightbox-positioner"
|
|
139
|
+
}));
|
|
137
140
|
}
|
|
138
141
|
});
|
|
139
142
|
}
|
|
@@ -142,33 +145,36 @@ function LightboxContent(props) {
|
|
|
142
145
|
'class'
|
|
143
146
|
]);
|
|
144
147
|
return createComponent(Dialog.Content, mergeProps({
|
|
145
|
-
"data-slot": "lightbox-content",
|
|
146
148
|
get ["class"] () {
|
|
147
149
|
return cn('relative box-border grid max-h-[min(80dvh,calc(100dvh-2rem))] w-fit max-w-[min(80vw,calc(100vw-2rem))] gap-3 border-0 bg-transparent outline-0 data-[state=closed]:animate-moduix-menu-closed data-[state=open]:animate-moduix-menu-open motion-reduce:[animation-delay:0ms] motion-reduce:[animation-duration:1ms]', local.class);
|
|
148
150
|
}
|
|
149
|
-
}, others
|
|
151
|
+
}, others, {
|
|
152
|
+
"data-slot": "lightbox-content"
|
|
153
|
+
}));
|
|
150
154
|
}
|
|
151
155
|
function LightboxTitle(props) {
|
|
152
156
|
const [local, others] = splitProps(props, [
|
|
153
157
|
'class'
|
|
154
158
|
]);
|
|
155
159
|
return createComponent(Dialog.Title, mergeProps({
|
|
156
|
-
"data-slot": "lightbox-title",
|
|
157
160
|
get ["class"] () {
|
|
158
161
|
return cn('m-0 text-md leading-6 font-semibold text-foreground', local.class);
|
|
159
162
|
}
|
|
160
|
-
}, others
|
|
163
|
+
}, others, {
|
|
164
|
+
"data-slot": "lightbox-title"
|
|
165
|
+
}));
|
|
161
166
|
}
|
|
162
167
|
function LightboxDescription(props) {
|
|
163
168
|
const [local, others] = splitProps(props, [
|
|
164
169
|
'class'
|
|
165
170
|
]);
|
|
166
171
|
return createComponent(Dialog.Description, mergeProps({
|
|
167
|
-
"data-slot": "lightbox-description",
|
|
168
172
|
get ["class"] () {
|
|
169
173
|
return cn('m-0 text-sm leading-5 text-muted-foreground', local.class);
|
|
170
174
|
}
|
|
171
|
-
}, others
|
|
175
|
+
}, others, {
|
|
176
|
+
"data-slot": "lightbox-description"
|
|
177
|
+
}));
|
|
172
178
|
}
|
|
173
179
|
function LightboxCloseTrigger(props) {
|
|
174
180
|
const [local, others] = splitProps(props, [
|
|
@@ -179,11 +185,12 @@ function LightboxCloseTrigger(props) {
|
|
|
179
185
|
get asChild () {
|
|
180
186
|
return local.asChild;
|
|
181
187
|
},
|
|
182
|
-
"data-slot": "lightbox-close-trigger",
|
|
183
188
|
get ["class"] () {
|
|
184
189
|
return local.class;
|
|
185
190
|
}
|
|
186
|
-
}, others
|
|
191
|
+
}, others, {
|
|
192
|
+
"data-slot": "lightbox-close-trigger"
|
|
193
|
+
}));
|
|
187
194
|
}
|
|
188
195
|
function LightboxCloseIcon(props) {
|
|
189
196
|
const [local, others] = splitProps(props, [
|
|
@@ -219,6 +226,7 @@ function LightboxImage(props) {
|
|
|
219
226
|
const [local, others] = splitProps(props, [
|
|
220
227
|
'class',
|
|
221
228
|
'closeOnClick',
|
|
229
|
+
'data-close-on-click',
|
|
222
230
|
'onClick'
|
|
223
231
|
]);
|
|
224
232
|
const dialog = useDialogContext();
|
|
@@ -230,13 +238,15 @@ function LightboxImage(props) {
|
|
|
230
238
|
var _el$ = _tmpl$();
|
|
231
239
|
_el$.$$click = handleClick;
|
|
232
240
|
spread(_el$, mergeProps({
|
|
233
|
-
get ["data-close-on-click"] () {
|
|
234
|
-
return local.closeOnClick ? '' : void 0;
|
|
235
|
-
},
|
|
236
241
|
get ["class"] () {
|
|
237
242
|
return cn('block max-h-[min(80dvh,100%)] max-w-[min(80vw,100%)] rounded-md object-contain shadow-lg select-none data-[close-on-click]:cursor-zoom-out', local.class);
|
|
238
243
|
}
|
|
239
|
-
}, others
|
|
244
|
+
}, others, {
|
|
245
|
+
get ["data-close-on-click"] () {
|
|
246
|
+
return local.closeOnClick ? '' : void 0;
|
|
247
|
+
},
|
|
248
|
+
"data-slot": "lightbox-image"
|
|
249
|
+
}), false, false);
|
|
240
250
|
return _el$;
|
|
241
251
|
})();
|
|
242
252
|
}
|
|
@@ -245,44 +255,48 @@ function LightboxGallery(props) {
|
|
|
245
255
|
'class'
|
|
246
256
|
]);
|
|
247
257
|
return createComponent(ark.div, mergeProps({
|
|
248
|
-
"data-slot": "lightbox-gallery",
|
|
249
258
|
get ["class"] () {
|
|
250
259
|
return cn('[&_[data-slot=carousel-indicator-group]]:mx-auto', 'max-w-[min(72rem,calc(100vw-2rem))] justify-self-center [&_[data-slot=carousel-control]]:items-center [&_[data-slot=carousel-indicator-group]]:w-fit [&_[data-slot=carousel-indicator-group]]:max-w-full [&_[data-slot=carousel-indicator-group]]:flex-wrap [&_[data-slot=carousel-indicator]:has(img)]:h-control-xl [&_[data-slot=carousel-indicator]:has(img)]:w-20 [&_[data-slot=carousel-indicator]:has(img)]:overflow-hidden [&_[data-slot=carousel-indicator]:has(img)]:rounded-md [&_[data-slot=carousel-indicator]:has(img)]:border [&_[data-slot=carousel-indicator]:has(img)]:border-transparent [&_[data-slot=carousel-indicator]:has(img)]:bg-transparent [&_[data-slot=carousel-indicator]:has(img)]:opacity-[0.65] [&_[data-slot=carousel-indicator]:has(img)]:transition [&_[data-slot=carousel-indicator]:has(img)]:duration-150 [&_[data-slot=carousel-indicator]:has(img)]:ease-in-out [&_[data-slot=carousel-indicator]:has(img)_img]:block [&_[data-slot=carousel-indicator]:has(img)_img]:size-full [&_[data-slot=carousel-indicator]:has(img)_img]:object-cover [&_[data-slot=carousel-indicator]:has(img):hover]:opacity-90 [&_[data-slot=carousel-indicator]:has(img)[data-current]]:-translate-y-px [&_[data-slot=carousel-indicator]:has(img)[data-current]]:border-primary [&_[data-slot=carousel-indicator]:has(img)[data-current]]:opacity-100 [&_[data-slot=carousel-item-group]]:aspect-[16/10] [&_[data-slot=carousel-item-group]]:max-h-[68dvh] [&_[data-slot=carousel-item-group]]:bg-black/90 [&_[data-slot=carousel-item]]:grid [&_[data-slot=carousel-item]]:h-full [&_[data-slot=carousel-item]]:place-items-center [&_[data-slot=carousel-item]_img]:block [&_[data-slot=carousel-item]_img]:size-full [&_[data-slot=carousel-item]_img]:rounded-md [&_[data-slot=carousel-item]_img]:object-contain [&_[data-slot=carousel-item]_img]:select-none [&_[data-slot=carousel-item]_video]:block [&_[data-slot=carousel-item]_video]:size-full [&_[data-slot=carousel-item]_video]:rounded-md [&_[data-slot=carousel-item]_video]:object-contain [&_[data-slot=carousel-item]_video]:select-none', local.class);
|
|
251
260
|
}
|
|
252
|
-
}, others
|
|
261
|
+
}, others, {
|
|
262
|
+
"data-slot": "lightbox-gallery"
|
|
263
|
+
}));
|
|
253
264
|
}
|
|
254
265
|
function LightboxHeader(props) {
|
|
255
266
|
const [local, others] = splitProps(props, [
|
|
256
267
|
'class'
|
|
257
268
|
]);
|
|
258
269
|
return createComponent(ark.div, mergeProps({
|
|
259
|
-
"data-slot": "lightbox-header",
|
|
260
270
|
get ["class"] () {
|
|
261
271
|
return cn('grid gap-1', local.class);
|
|
262
272
|
}
|
|
263
|
-
}, others
|
|
273
|
+
}, others, {
|
|
274
|
+
"data-slot": "lightbox-header"
|
|
275
|
+
}));
|
|
264
276
|
}
|
|
265
277
|
function LightboxBody(props) {
|
|
266
278
|
const [local, others] = splitProps(props, [
|
|
267
279
|
'class'
|
|
268
280
|
]);
|
|
269
281
|
return createComponent(ark.div, mergeProps({
|
|
270
|
-
"data-slot": "lightbox-body",
|
|
271
282
|
get ["class"] () {
|
|
272
283
|
return cn('grid gap-3', local.class);
|
|
273
284
|
}
|
|
274
|
-
}, others
|
|
285
|
+
}, others, {
|
|
286
|
+
"data-slot": "lightbox-body"
|
|
287
|
+
}));
|
|
275
288
|
}
|
|
276
289
|
function LightboxFooter(props) {
|
|
277
290
|
const [local, others] = splitProps(props, [
|
|
278
291
|
'class'
|
|
279
292
|
]);
|
|
280
293
|
return createComponent(ark.div, mergeProps({
|
|
281
|
-
"data-slot": "lightbox-footer",
|
|
282
294
|
get ["class"] () {
|
|
283
295
|
return cn('flex items-center justify-end gap-2 text-sm leading-5 text-muted-foreground', local.class);
|
|
284
296
|
}
|
|
285
|
-
}, others
|
|
297
|
+
}, others, {
|
|
298
|
+
"data-slot": "lightbox-footer"
|
|
299
|
+
}));
|
|
286
300
|
}
|
|
287
301
|
function LightboxBind(props) {
|
|
288
302
|
const [local] = splitProps(props, [
|
|
@@ -61,14 +61,14 @@ function LightboxTrigger(props) {
|
|
|
61
61
|
'asChild',
|
|
62
62
|
'class'
|
|
63
63
|
]);
|
|
64
|
-
return <Dialog.Trigger asChild={local.asChild}
|
|
64
|
+
return <Dialog.Trigger asChild={local.asChild} class={cn('cursor-zoom-in focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring', local.class)} {...others} data-slot="lightbox-trigger"/>;
|
|
65
65
|
}
|
|
66
66
|
function LightboxBackdrop(props) {
|
|
67
67
|
const [local, others] = splitProps(props, [
|
|
68
68
|
'class'
|
|
69
69
|
]);
|
|
70
70
|
return <OverlayPortal>
|
|
71
|
-
<Dialog.Backdrop
|
|
71
|
+
<Dialog.Backdrop class={cn('fixed inset-0 z-[calc(40+var(--layer-index,0))] min-h-dvh bg-overlay backdrop-blur-xs data-[state=closed]:animate-[moduix-fade-out_200ms_ease-in-out_forwards] data-[state=open]:animate-[moduix-fade-in_200ms_ease-in-out] motion-reduce:[animation-delay:0ms] motion-reduce:[animation-duration:1ms]', local.class)} {...others} data-slot="lightbox-backdrop"/>
|
|
72
72
|
</OverlayPortal>;
|
|
73
73
|
}
|
|
74
74
|
function LightboxPositioner(props) {
|
|
@@ -76,33 +76,33 @@ function LightboxPositioner(props) {
|
|
|
76
76
|
'class'
|
|
77
77
|
]);
|
|
78
78
|
return <OverlayPortal>
|
|
79
|
-
<Dialog.Positioner
|
|
79
|
+
<Dialog.Positioner class={cn('fixed inset-0 z-[calc(50+var(--layer-index,0))] box-border grid place-items-center overflow-auto overscroll-contain p-4', local.class)} {...others} data-slot="lightbox-positioner"/>
|
|
80
80
|
</OverlayPortal>;
|
|
81
81
|
}
|
|
82
82
|
function LightboxContent(props) {
|
|
83
83
|
const [local, others] = splitProps(props, [
|
|
84
84
|
'class'
|
|
85
85
|
]);
|
|
86
|
-
return <Dialog.Content
|
|
86
|
+
return <Dialog.Content class={cn('relative box-border grid max-h-[min(80dvh,calc(100dvh-2rem))] w-fit max-w-[min(80vw,calc(100vw-2rem))] gap-3 border-0 bg-transparent outline-0 data-[state=closed]:animate-moduix-menu-closed data-[state=open]:animate-moduix-menu-open motion-reduce:[animation-delay:0ms] motion-reduce:[animation-duration:1ms]', local.class)} {...others} data-slot="lightbox-content"/>;
|
|
87
87
|
}
|
|
88
88
|
function LightboxTitle(props) {
|
|
89
89
|
const [local, others] = splitProps(props, [
|
|
90
90
|
'class'
|
|
91
91
|
]);
|
|
92
|
-
return <Dialog.Title
|
|
92
|
+
return <Dialog.Title class={cn('m-0 text-md leading-6 font-semibold text-foreground', local.class)} {...others} data-slot="lightbox-title"/>;
|
|
93
93
|
}
|
|
94
94
|
function LightboxDescription(props) {
|
|
95
95
|
const [local, others] = splitProps(props, [
|
|
96
96
|
'class'
|
|
97
97
|
]);
|
|
98
|
-
return <Dialog.Description
|
|
98
|
+
return <Dialog.Description class={cn('m-0 text-sm leading-5 text-muted-foreground', local.class)} {...others} data-slot="lightbox-description"/>;
|
|
99
99
|
}
|
|
100
100
|
function LightboxCloseTrigger(props) {
|
|
101
101
|
const [local, others] = splitProps(props, [
|
|
102
102
|
'asChild',
|
|
103
103
|
'class'
|
|
104
104
|
]);
|
|
105
|
-
return <Dialog.CloseTrigger asChild={local.asChild}
|
|
105
|
+
return <Dialog.CloseTrigger asChild={local.asChild} class={local.class} {...others} data-slot="lightbox-close-trigger"/>;
|
|
106
106
|
}
|
|
107
107
|
function LightboxCloseIcon(props) {
|
|
108
108
|
const [local, others] = splitProps(props, [
|
|
@@ -121,6 +121,7 @@ function LightboxImage(props) {
|
|
|
121
121
|
const [local, others] = splitProps(props, [
|
|
122
122
|
'class',
|
|
123
123
|
'closeOnClick',
|
|
124
|
+
'data-close-on-click',
|
|
124
125
|
'onClick'
|
|
125
126
|
]);
|
|
126
127
|
const dialog = useDialogContext();
|
|
@@ -128,31 +129,31 @@ function LightboxImage(props) {
|
|
|
128
129
|
local.onClick?.(event);
|
|
129
130
|
if (local.closeOnClick && !event.defaultPrevented) dialog().setOpen(false);
|
|
130
131
|
};
|
|
131
|
-
return <img
|
|
132
|
+
return <img class={cn('block max-h-[min(80dvh,100%)] max-w-[min(80vw,100%)] rounded-md object-contain shadow-lg select-none data-[close-on-click]:cursor-zoom-out', local.class)} onClick={handleClick} {...others} data-close-on-click={local.closeOnClick ? '' : void 0} data-slot="lightbox-image"/>;
|
|
132
133
|
}
|
|
133
134
|
function LightboxGallery(props) {
|
|
134
135
|
const [local, others] = splitProps(props, [
|
|
135
136
|
'class'
|
|
136
137
|
]);
|
|
137
|
-
return <ark.div
|
|
138
|
+
return <ark.div class={cn('[&_[data-slot=carousel-indicator-group]]:mx-auto', 'max-w-[min(72rem,calc(100vw-2rem))] justify-self-center [&_[data-slot=carousel-control]]:items-center [&_[data-slot=carousel-indicator-group]]:w-fit [&_[data-slot=carousel-indicator-group]]:max-w-full [&_[data-slot=carousel-indicator-group]]:flex-wrap [&_[data-slot=carousel-indicator]:has(img)]:h-control-xl [&_[data-slot=carousel-indicator]:has(img)]:w-20 [&_[data-slot=carousel-indicator]:has(img)]:overflow-hidden [&_[data-slot=carousel-indicator]:has(img)]:rounded-md [&_[data-slot=carousel-indicator]:has(img)]:border [&_[data-slot=carousel-indicator]:has(img)]:border-transparent [&_[data-slot=carousel-indicator]:has(img)]:bg-transparent [&_[data-slot=carousel-indicator]:has(img)]:opacity-[0.65] [&_[data-slot=carousel-indicator]:has(img)]:transition [&_[data-slot=carousel-indicator]:has(img)]:duration-150 [&_[data-slot=carousel-indicator]:has(img)]:ease-in-out [&_[data-slot=carousel-indicator]:has(img)_img]:block [&_[data-slot=carousel-indicator]:has(img)_img]:size-full [&_[data-slot=carousel-indicator]:has(img)_img]:object-cover [&_[data-slot=carousel-indicator]:has(img):hover]:opacity-90 [&_[data-slot=carousel-indicator]:has(img)[data-current]]:-translate-y-px [&_[data-slot=carousel-indicator]:has(img)[data-current]]:border-primary [&_[data-slot=carousel-indicator]:has(img)[data-current]]:opacity-100 [&_[data-slot=carousel-item-group]]:aspect-[16/10] [&_[data-slot=carousel-item-group]]:max-h-[68dvh] [&_[data-slot=carousel-item-group]]:bg-black/90 [&_[data-slot=carousel-item]]:grid [&_[data-slot=carousel-item]]:h-full [&_[data-slot=carousel-item]]:place-items-center [&_[data-slot=carousel-item]_img]:block [&_[data-slot=carousel-item]_img]:size-full [&_[data-slot=carousel-item]_img]:rounded-md [&_[data-slot=carousel-item]_img]:object-contain [&_[data-slot=carousel-item]_img]:select-none [&_[data-slot=carousel-item]_video]:block [&_[data-slot=carousel-item]_video]:size-full [&_[data-slot=carousel-item]_video]:rounded-md [&_[data-slot=carousel-item]_video]:object-contain [&_[data-slot=carousel-item]_video]:select-none', local.class)} {...others} data-slot="lightbox-gallery"/>;
|
|
138
139
|
}
|
|
139
140
|
function LightboxHeader(props) {
|
|
140
141
|
const [local, others] = splitProps(props, [
|
|
141
142
|
'class'
|
|
142
143
|
]);
|
|
143
|
-
return <ark.div
|
|
144
|
+
return <ark.div class={cn('grid gap-1', local.class)} {...others} data-slot="lightbox-header"/>;
|
|
144
145
|
}
|
|
145
146
|
function LightboxBody(props) {
|
|
146
147
|
const [local, others] = splitProps(props, [
|
|
147
148
|
'class'
|
|
148
149
|
]);
|
|
149
|
-
return <ark.div
|
|
150
|
+
return <ark.div class={cn('grid gap-3', local.class)} {...others} data-slot="lightbox-body"/>;
|
|
150
151
|
}
|
|
151
152
|
function LightboxFooter(props) {
|
|
152
153
|
const [local, others] = splitProps(props, [
|
|
153
154
|
'class'
|
|
154
155
|
]);
|
|
155
|
-
return <ark.div
|
|
156
|
+
return <ark.div class={cn('flex items-center justify-end gap-2 text-sm leading-5 text-muted-foreground', local.class)} {...others} data-slot="lightbox-footer"/>;
|
|
156
157
|
}
|
|
157
158
|
function LightboxBind(props) {
|
|
158
159
|
const [local] = splitProps(props, [
|
|
@@ -5,50 +5,54 @@ import { children, splitProps } from "solid-js";
|
|
|
5
5
|
import { cn } from "../../internal/cn.js";
|
|
6
6
|
import { CheckIcon, SearchIcon } from "../../internal/icons/ui/Icons.js";
|
|
7
7
|
import { CloseButton } from "../close-button/index.js";
|
|
8
|
-
var _tmpl$ = /*#__PURE__*/ template("<div
|
|
8
|
+
var _tmpl$ = /*#__PURE__*/ template("<div>");
|
|
9
9
|
const Listbox_ListboxRoot = function(props) {
|
|
10
10
|
const [local, others] = splitProps(props, [
|
|
11
11
|
'class'
|
|
12
12
|
]);
|
|
13
13
|
return createComponent(Listbox.Root, mergeProps({
|
|
14
|
-
"data-slot": "listbox-root",
|
|
15
14
|
get ["class"] () {
|
|
16
15
|
return cn('box-border flex w-64 max-w-full min-w-0 flex-col gap-3 text-foreground data-disabled:opacity-50', local.class);
|
|
17
16
|
}
|
|
18
|
-
}, others
|
|
17
|
+
}, others, {
|
|
18
|
+
"data-slot": "listbox-root"
|
|
19
|
+
}));
|
|
19
20
|
};
|
|
20
21
|
const Listbox_ListboxRootProvider = function(props) {
|
|
21
22
|
const [local, others] = splitProps(props, [
|
|
22
23
|
'class'
|
|
23
24
|
]);
|
|
24
25
|
return createComponent(Listbox.RootProvider, mergeProps({
|
|
25
|
-
"data-slot": "listbox-root-provider",
|
|
26
26
|
get ["class"] () {
|
|
27
27
|
return cn('box-border flex w-64 max-w-full min-w-0 flex-col gap-3 text-foreground data-disabled:opacity-50', local.class);
|
|
28
28
|
}
|
|
29
|
-
}, others
|
|
29
|
+
}, others, {
|
|
30
|
+
"data-slot": "listbox-root-provider"
|
|
31
|
+
}));
|
|
30
32
|
};
|
|
31
33
|
function ListboxLabel(props) {
|
|
32
34
|
const [local, others] = splitProps(props, [
|
|
33
35
|
'class'
|
|
34
36
|
]);
|
|
35
37
|
return createComponent(Listbox.Label, mergeProps({
|
|
36
|
-
"data-slot": "listbox-label",
|
|
37
38
|
get ["class"] () {
|
|
38
39
|
return cn('text-sm leading-5 font-medium text-foreground select-none', local.class);
|
|
39
40
|
}
|
|
40
|
-
}, others
|
|
41
|
+
}, others, {
|
|
42
|
+
"data-slot": "listbox-label"
|
|
43
|
+
}));
|
|
41
44
|
}
|
|
42
45
|
function ListboxInput(props) {
|
|
43
46
|
const [local, others] = splitProps(props, [
|
|
44
47
|
'class'
|
|
45
48
|
]);
|
|
46
49
|
return createComponent(Listbox.Input, mergeProps({
|
|
47
|
-
"data-slot": "listbox-input",
|
|
48
50
|
get ["class"] () {
|
|
49
51
|
return cn('m-0 box-border min-h-control-md w-full rounded-md border border-border bg-background px-3 py-1 text-md leading-6 text-foreground outline-1 -outline-offset-1 outline-transparent transition-[border-color,outline-color,opacity] duration-200 ease-in-out group-has-[[data-slot=listbox-filter-icon]]/listbox-filter:ps-9 group-has-[[data-slot=listbox-filter-icon]]/listbox-filter:pe-10 group-has-[+_[data-slot=listbox-content]]/listbox-filter:rounded-b-none group-has-[+_[data-slot=listbox-content]]/listbox-filter:border-b-0 placeholder:text-muted-foreground focus-visible:outline-ring disabled:cursor-default disabled:opacity-50 data-disabled:cursor-default data-disabled:opacity-50 motion-reduce:transition-none', local.class);
|
|
50
52
|
}
|
|
51
|
-
}, others
|
|
53
|
+
}, others, {
|
|
54
|
+
"data-slot": "listbox-input"
|
|
55
|
+
}));
|
|
52
56
|
}
|
|
53
57
|
function ListboxFilter(props) {
|
|
54
58
|
const [local, others] = splitProps(props, [
|
|
@@ -61,7 +65,9 @@ function ListboxFilter(props) {
|
|
|
61
65
|
get ["class"] () {
|
|
62
66
|
return cn('group/listbox-filter peer/listbox-filter relative box-border w-full', local.class);
|
|
63
67
|
}
|
|
64
|
-
}, others
|
|
68
|
+
}, others, {
|
|
69
|
+
"data-slot": "listbox-filter"
|
|
70
|
+
}), false, true);
|
|
65
71
|
insert(_el$, createComponent(SearchIcon, {
|
|
66
72
|
"data-slot": "listbox-filter-icon",
|
|
67
73
|
class: "pointer-events-none absolute start-3 top-1/2 z-1 size-4 -translate-y-1/2 text-muted-foreground"
|
|
@@ -79,7 +85,6 @@ function ListboxClearTrigger(props) {
|
|
|
79
85
|
]);
|
|
80
86
|
const resolvedChildren = children(()=>local.children);
|
|
81
87
|
return createComponent(CloseButton.Root, mergeProps({
|
|
82
|
-
"data-slot": "listbox-clear-trigger",
|
|
83
88
|
get ["class"] () {
|
|
84
89
|
return cn('absolute end-3 top-1/2 size-control-xs -translate-y-1/2 rounded-sm bg-transparent text-muted-foreground [&>svg]:size-4 [@media(hover:hover)]:hover:bg-muted [@media(hover:hover)]:hover:text-foreground', local.class);
|
|
85
90
|
},
|
|
@@ -90,6 +95,7 @@ function ListboxClearTrigger(props) {
|
|
|
90
95
|
return local['aria-label'] ?? 'Clear search';
|
|
91
96
|
}
|
|
92
97
|
}, others, {
|
|
98
|
+
"data-slot": "listbox-clear-trigger",
|
|
93
99
|
get children () {
|
|
94
100
|
return resolvedChildren();
|
|
95
101
|
}
|
|
@@ -100,66 +106,72 @@ function ListboxContent(props) {
|
|
|
100
106
|
'class'
|
|
101
107
|
]);
|
|
102
108
|
return createComponent(Listbox.Content, mergeProps({
|
|
103
|
-
"data-slot": "listbox-content",
|
|
104
109
|
get ["class"] () {
|
|
105
110
|
return cn('box-border flex max-h-56 min-h-0 scroll-py-1 [scrollbar-gutter:stable] flex-col overflow-x-hidden overflow-y-auto overscroll-contain rounded-md border border-border bg-background py-1 text-foreground outline-1 -outline-offset-1 outline-transparent transition-[border-color,outline-color] duration-200 ease-in-out peer-data-[slot=listbox-filter]/listbox-filter:-mt-3 peer-data-[slot=listbox-filter]/listbox-filter:rounded-t-none focus-visible:outline-ring data-[layout=grid]:grid data-[layout=grid]:grid-cols-[repeat(var(--column-count),minmax(0,1fr))] data-[layout=grid]:gap-1 data-[layout=grid]:p-2 data-[orientation=horizontal]:not-data-[layout=grid]:max-h-none data-[orientation=horizontal]:not-data-[layout=grid]:flex-row data-[orientation=horizontal]:not-data-[layout=grid]:gap-2 data-[orientation=horizontal]:not-data-[layout=grid]:overflow-x-auto data-[orientation=horizontal]:not-data-[layout=grid]:overflow-y-hidden data-[orientation=horizontal]:not-data-[layout=grid]:px-1 motion-reduce:transition-none', local.class);
|
|
106
111
|
}
|
|
107
|
-
}, others
|
|
112
|
+
}, others, {
|
|
113
|
+
"data-slot": "listbox-content"
|
|
114
|
+
}));
|
|
108
115
|
}
|
|
109
116
|
function ListboxEmpty(props) {
|
|
110
117
|
const [local, others] = splitProps(props, [
|
|
111
118
|
'class'
|
|
112
119
|
]);
|
|
113
120
|
return createComponent(Listbox.Empty, mergeProps({
|
|
114
|
-
"data-slot": "listbox-empty",
|
|
115
121
|
get ["class"] () {
|
|
116
122
|
return cn('px-3 py-1 text-center text-sm leading-5 text-muted-foreground', local.class);
|
|
117
123
|
}
|
|
118
|
-
}, others
|
|
124
|
+
}, others, {
|
|
125
|
+
"data-slot": "listbox-empty"
|
|
126
|
+
}));
|
|
119
127
|
}
|
|
120
128
|
function ListboxItemGroup(props) {
|
|
121
129
|
const [local, others] = splitProps(props, [
|
|
122
130
|
'class'
|
|
123
131
|
]);
|
|
124
132
|
return createComponent(Listbox.ItemGroup, mergeProps({
|
|
125
|
-
"data-slot": "listbox-item-group",
|
|
126
133
|
get ["class"] () {
|
|
127
134
|
return cn('flex flex-col [&+&]:mt-2', local.class);
|
|
128
135
|
}
|
|
129
|
-
}, others
|
|
136
|
+
}, others, {
|
|
137
|
+
"data-slot": "listbox-item-group"
|
|
138
|
+
}));
|
|
130
139
|
}
|
|
131
140
|
function ListboxItemGroupLabel(props) {
|
|
132
141
|
const [local, others] = splitProps(props, [
|
|
133
142
|
'class'
|
|
134
143
|
]);
|
|
135
144
|
return createComponent(Listbox.ItemGroupLabel, mergeProps({
|
|
136
|
-
"data-slot": "listbox-item-group-label",
|
|
137
145
|
get ["class"] () {
|
|
138
146
|
return cn('px-2 py-1 text-xs leading-4 font-normal text-muted-foreground select-none', local.class);
|
|
139
147
|
}
|
|
140
|
-
}, others
|
|
148
|
+
}, others, {
|
|
149
|
+
"data-slot": "listbox-item-group-label"
|
|
150
|
+
}));
|
|
141
151
|
}
|
|
142
152
|
function ListboxItem(props) {
|
|
143
153
|
const [local, others] = splitProps(props, [
|
|
144
154
|
'class'
|
|
145
155
|
]);
|
|
146
156
|
return createComponent(Listbox.Item, mergeProps({
|
|
147
|
-
"data-slot": "listbox-item",
|
|
148
157
|
get ["class"] () {
|
|
149
158
|
return cn('relative mx-1 box-border grid min-h-control-sm w-[calc(100%-0.5rem)] cursor-pointer grid-cols-[minmax(0,1fr)_1rem] items-center gap-2 rounded-sm bg-transparent px-3 py-1 text-sm leading-5 text-foreground outline-0 transition-[background-color,color] duration-200 ease-in-out select-none data-disabled:pointer-events-none data-disabled:cursor-default data-disabled:text-muted-foreground data-disabled:opacity-50 data-highlighted:bg-accent data-highlighted:text-accent-foreground data-[layout=grid]:mx-0 data-[layout=grid]:w-full data-[layout=grid]:min-w-0 data-[layout=grid]:grid-cols-1 data-[layout=grid]:justify-items-center data-[layout=grid]:text-center data-[layout=grid]:data-selected:bg-muted data-[layout=grid]:data-selected:text-foreground data-[orientation=horizontal]:not-data-[layout=grid]:w-44 data-[orientation=horizontal]:not-data-[layout=grid]:min-w-44 data-[orientation=horizontal]:not-data-[layout=grid]:items-start motion-reduce:transition-none [@media(hover:hover)]:[&:not([data-disabled]):hover]:bg-accent [@media(hover:hover)]:[&:not([data-disabled]):hover]:text-accent-foreground', local.class);
|
|
150
159
|
}
|
|
151
|
-
}, others
|
|
160
|
+
}, others, {
|
|
161
|
+
"data-slot": "listbox-item"
|
|
162
|
+
}));
|
|
152
163
|
}
|
|
153
164
|
function ListboxItemText(props) {
|
|
154
165
|
const [local, others] = splitProps(props, [
|
|
155
166
|
'class'
|
|
156
167
|
]);
|
|
157
168
|
return createComponent(Listbox.ItemText, mergeProps({
|
|
158
|
-
"data-slot": "listbox-item-text",
|
|
159
169
|
get ["class"] () {
|
|
160
170
|
return cn('min-w-0 overflow-hidden text-ellipsis whitespace-nowrap', local.class);
|
|
161
171
|
}
|
|
162
|
-
}, others
|
|
172
|
+
}, others, {
|
|
173
|
+
"data-slot": "listbox-item-text"
|
|
174
|
+
}));
|
|
163
175
|
}
|
|
164
176
|
function ListboxItemIndicator(props) {
|
|
165
177
|
const [local, others] = splitProps(props, [
|
|
@@ -168,11 +180,11 @@ function ListboxItemIndicator(props) {
|
|
|
168
180
|
]);
|
|
169
181
|
const resolvedChildren = children(()=>local.children);
|
|
170
182
|
return createComponent(Listbox.ItemIndicator, mergeProps({
|
|
171
|
-
"data-slot": "listbox-item-indicator",
|
|
172
183
|
get ["class"] () {
|
|
173
184
|
return cn('inline-flex size-4 shrink-0 items-center justify-center data-[state=unchecked]:invisible [&>svg]:size-3', local.class);
|
|
174
185
|
}
|
|
175
186
|
}, others, {
|
|
187
|
+
"data-slot": "listbox-item-indicator",
|
|
176
188
|
get children () {
|
|
177
189
|
return resolvedChildren() ?? createComponent(CheckIcon, {});
|
|
178
190
|
}
|
|
@@ -183,44 +195,48 @@ function ListboxValueText(props) {
|
|
|
183
195
|
'class'
|
|
184
196
|
]);
|
|
185
197
|
return createComponent(Listbox.ValueText, mergeProps({
|
|
186
|
-
"data-slot": "listbox-value-text",
|
|
187
198
|
get ["class"] () {
|
|
188
199
|
return cn('text-sm leading-5 text-muted-foreground', local.class);
|
|
189
200
|
}
|
|
190
|
-
}, others
|
|
201
|
+
}, others, {
|
|
202
|
+
"data-slot": "listbox-value-text"
|
|
203
|
+
}));
|
|
191
204
|
}
|
|
192
205
|
function ListboxItemTextContent(props) {
|
|
193
206
|
const [local, others] = splitProps(props, [
|
|
194
207
|
'class'
|
|
195
208
|
]);
|
|
196
209
|
return createComponent(ark.span, mergeProps({
|
|
197
|
-
"data-slot": "listbox-item-text-content",
|
|
198
210
|
get ["class"] () {
|
|
199
211
|
return cn('inline-flex max-w-full min-w-0 items-center gap-2 align-top', local.class);
|
|
200
212
|
}
|
|
201
|
-
}, others
|
|
213
|
+
}, others, {
|
|
214
|
+
"data-slot": "listbox-item-text-content"
|
|
215
|
+
}));
|
|
202
216
|
}
|
|
203
217
|
function ListboxItemTextIcon(props) {
|
|
204
218
|
const [local, others] = splitProps(props, [
|
|
205
219
|
'class'
|
|
206
220
|
]);
|
|
207
221
|
return createComponent(ark.span, mergeProps({
|
|
208
|
-
"data-slot": "listbox-item-text-icon",
|
|
209
222
|
get ["class"] () {
|
|
210
223
|
return cn('inline-flex size-4 shrink-0 items-center justify-center', local.class);
|
|
211
224
|
}
|
|
212
|
-
}, others
|
|
225
|
+
}, others, {
|
|
226
|
+
"data-slot": "listbox-item-text-icon"
|
|
227
|
+
}));
|
|
213
228
|
}
|
|
214
229
|
function ListboxItemTextLabel(props) {
|
|
215
230
|
const [local, others] = splitProps(props, [
|
|
216
231
|
'class'
|
|
217
232
|
]);
|
|
218
233
|
return createComponent(ark.span, mergeProps({
|
|
219
|
-
"data-slot": "listbox-item-text-label",
|
|
220
234
|
get ["class"] () {
|
|
221
235
|
return cn('min-w-0 overflow-hidden text-ellipsis whitespace-nowrap', local.class);
|
|
222
236
|
}
|
|
223
|
-
}, others
|
|
237
|
+
}, others, {
|
|
238
|
+
"data-slot": "listbox-item-text-label"
|
|
239
|
+
}));
|
|
224
240
|
}
|
|
225
241
|
const Listbox_Listbox = Object.assign(Listbox_ListboxRoot, {
|
|
226
242
|
Root: Listbox_ListboxRoot,
|