@justanarthur/modo-ui 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -15
- package/dist/blocks/sidebar-app/index.d.ts +1 -1
- package/dist/blocks/sidebar-app/index.js +28 -31
- package/dist/components/{inputs → AI}/input-message/index.d.ts +1 -1
- package/dist/components/AI/input-message/index.js +25 -0
- package/dist/components/{thinking-indicator → AI/thinking-indicator}/index.d.ts +1 -1
- package/dist/components/AI/thinking-indicator/index.js +13 -0
- package/dist/components/{navigation/accordion → accordion}/index.d.ts +1 -1
- package/dist/components/accordion/index.js +28 -0
- package/dist/components/badge/index.d.ts +1 -1
- package/dist/components/badge/index.js +12 -14
- package/dist/components/button/index.d.ts +1 -1
- package/dist/components/button/index.js +10 -12
- package/dist/components/card/index.d.ts +1 -1
- package/dist/components/card/index.js +38 -40
- package/dist/components/{inputs/input-copy → copy}/index.d.ts +7 -7
- package/dist/components/copy/index.js +16 -0
- package/dist/components/inputs/checkbox/index.d.ts +62 -0
- package/dist/components/inputs/checkbox/index.js +22 -0
- package/dist/components/inputs/color-picker/index.d.ts +1 -1
- package/dist/components/inputs/color-picker/index.js +31 -33
- package/dist/components/inputs/combobox/index.d.ts +2 -2
- package/dist/components/inputs/combobox/index.js +31 -34
- package/dist/components/inputs/date-time/calendar/index.d.ts +1 -1
- package/dist/components/inputs/date-time/calendar/index.js +14 -16
- package/dist/components/inputs/date-time/date-picker/index.d.ts +1 -1
- package/dist/components/inputs/date-time/date-picker/index.js +28 -30
- package/dist/components/inputs/date-time/date-range-picker/index.d.ts +1 -1
- package/dist/components/inputs/date-time/date-range-picker/index.js +27 -29
- package/dist/components/inputs/date-time/duration-picker/index.d.ts +1 -1
- package/dist/components/inputs/date-time/duration-picker/index.js +27 -29
- package/dist/components/inputs/date-time/month-picker/index.d.ts +1 -1
- package/dist/components/inputs/date-time/month-picker/index.js +26 -28
- package/dist/components/inputs/date-time/time-picker/index.d.ts +1 -1
- package/dist/components/inputs/date-time/time-picker/index.js +27 -29
- package/dist/components/inputs/input/index.d.ts +1 -1
- package/dist/components/inputs/input/index.js +15 -16
- package/dist/components/inputs/{radio-group → radio}/index.d.ts +30 -30
- package/dist/components/inputs/radio/index.js +21 -0
- package/dist/components/inputs/search/index.d.ts +1 -1
- package/dist/components/inputs/search/index.js +21 -24
- package/dist/components/inputs/select/index.d.ts +1 -1
- package/dist/components/inputs/select/index.js +30 -33
- package/dist/components/inputs/slider/index.d.ts +1 -1
- package/dist/components/inputs/slider/index.js +10 -12
- package/dist/components/inputs/switch/index.d.ts +27 -6
- package/dist/components/inputs/switch/index.js +17 -12
- package/dist/components/navigation/sidebar/index.d.ts +3 -3
- package/dist/components/navigation/sidebar/index.js +95 -97
- package/dist/components/navigation/tabs/index.d.ts +1 -1
- package/dist/components/navigation/tabs/index.js +19 -21
- package/dist/components/navigation/tabs-subtle/index.d.ts +1 -1
- package/dist/components/navigation/tabs-subtle/index.js +17 -19
- package/dist/components/overlays/alert-dialog/index.d.ts +2 -2
- package/dist/components/overlays/alert-dialog/index.js +18 -20
- package/dist/components/overlays/command/index.d.ts +1 -1
- package/dist/components/overlays/command/index.js +32 -35
- package/dist/components/overlays/context-menu/index.d.ts +1 -1
- package/dist/components/overlays/context-menu/index.js +25 -28
- package/dist/components/overlays/dialog/index.d.ts +1 -1
- package/dist/components/overlays/dialog/index.js +33 -35
- package/dist/components/overlays/dropdown/index.d.ts +3 -3
- package/dist/components/overlays/dropdown/index.js +40 -43
- package/dist/components/overlays/popover/index.d.ts +1 -1
- package/dist/components/overlays/popover/index.js +22 -24
- package/dist/components/overlays/preview-card/index.d.ts +1 -1
- package/dist/components/overlays/preview-card/index.js +15 -17
- package/dist/components/overlays/sheet/index.d.ts +1 -1
- package/dist/components/overlays/sheet/index.js +20 -22
- package/dist/components/overlays/toast/index.d.ts +1 -1
- package/dist/components/overlays/toast/index.js +17 -19
- package/dist/components/overlays/tooltip/index.d.ts +1 -1
- package/dist/components/overlays/tooltip/index.js +13 -15
- package/dist/components/table/index.d.ts +1 -1
- package/dist/components/table/index.js +22 -24
- package/dist/index.d.ts +828 -795
- package/dist/index.js +509 -508
- package/dist/preset.d.ts +1 -1
- package/dist/preset.js +5 -5
- package/dist/primitives/code/index.d.ts +1 -1
- package/dist/primitives/code/index.js +8 -9
- package/dist/primitives/craft/index.d.ts +1 -1
- package/dist/primitives/craft/index.js +6 -8
- package/dist/primitives/fluid-hover/index.d.ts +1 -1
- package/dist/primitives/fluid-hover/index.js +18 -20
- package/dist/primitives/morph/index.d.ts +3 -3
- package/dist/primitives/morph/index.js +15 -17
- package/dist/primitives/motion/index.d.ts +1 -1
- package/dist/primitives/motion/index.js +15 -16
- package/dist/primitives/scroll-area/index.d.ts +1 -1
- package/dist/primitives/scroll-area/index.js +8 -9
- package/dist/primitives/sizes/index.d.ts +3 -3
- package/dist/primitives/sizes/index.js +17 -18
- package/dist/primitives/surface/index.d.ts +1 -1
- package/dist/primitives/surface/index.js +11 -12
- package/dist/shared/{components-jxgznftn.js → components-0q0sqfh4.js} +16 -16
- package/dist/shared/{components-x3rz4cyn.js → components-0sn7ypjw.js} +14 -14
- package/dist/shared/components-1434p1mh.js +123 -0
- package/dist/shared/{components-vc1k7yv2.js → components-1v7rxytx.js} +3 -3
- package/dist/shared/{components-6phwsry6.js → components-1z6tdadk.js} +25 -25
- package/dist/shared/{components-5zry9te1.js → components-27nnvrwe.js} +27 -27
- package/dist/shared/{components-ess3ch6w.js → components-2dxkv6zm.js} +23 -23
- package/dist/shared/{components-s5pkbjx1.js → components-2n3whx7z.js} +56 -56
- package/dist/shared/{components-v7es8aan.js → components-2nhgyh31.js} +15 -15
- package/dist/shared/{components-6t6nr33r.js → components-39jq9va1.js} +26 -26
- package/dist/shared/{components-4hh0gm0v.js → components-39vmfq9s.js} +61 -61
- package/dist/shared/{components-zx2hr57f.js → components-3fbbvq5j.js} +15 -15
- package/dist/shared/{components-6y1th6k4.js → components-3mkepka5.js} +31 -31
- package/dist/shared/{components-e46kf6cp.js → components-59efxjd9.js} +8 -8
- package/dist/shared/{components-rc63qsy6.js → components-5xc2j8jz.js} +10 -10
- package/dist/shared/{components-hzfp4tjb.js → components-7btqt08d.js} +42 -42
- package/dist/shared/{components-9p8s8n5q.js → components-7r3etddy.js} +22 -22
- package/dist/shared/{components-j65qt1mq.js → components-8ey44d79.js} +101 -101
- package/dist/shared/{components-hjkrv00c.js → components-8snj490h.js} +120 -23
- package/dist/shared/{components-40j34hdb.js → components-a86dytt0.js} +116 -116
- package/dist/shared/{components-tm88ghva.js → components-ar66gnt0.js} +58 -58
- package/dist/shared/{components-5pkcfprd.js → components-b2wyq2cq.js} +22 -22
- package/dist/shared/{components-vktws5r6.js → components-b3c5et5b.js} +73 -73
- package/dist/shared/{components-4xxtggzp.js → components-bshdmf75.js} +18 -18
- package/dist/shared/{components-kf2ehztc.js → components-chacnk61.js} +16 -16
- package/dist/shared/{components-7zp99w5d.js → components-cv16mryv.js} +2 -2
- package/dist/shared/{components-gjfrycb5.js → components-d6xtjht3.js} +66 -69
- package/dist/shared/{components-aaq3yk4f.js → components-dk0gjr5a.js} +43 -43
- package/dist/shared/{components-0f0as45n.js → components-ezxhrmer.js} +2 -2
- package/dist/shared/{components-7gv95yfy.js → components-frw34b65.js} +83 -83
- package/dist/shared/{components-s3yfvfkr.js → components-gc5vtq2f.js} +42 -42
- package/dist/shared/components-gf5s6ap9.js +42 -0
- package/dist/shared/{components-7cqq1sqy.js → components-gvr9w41t.js} +40 -40
- package/dist/shared/{components-x2xyckd5.js → components-gz8zf3ec.js} +20 -20
- package/dist/shared/{components-ed7cmssr.js → components-hawvy2qz.js} +18 -18
- package/dist/shared/{components-7nww01w4.js → components-hqeq3w9q.js} +34 -34
- package/dist/shared/{components-zvb11ker.js → components-hw9yk32z.js} +47 -47
- package/dist/shared/{components-y3cqdrgy.js → components-hyq23phv.js} +73 -54
- package/dist/shared/{components-bf2d9k02.js → components-jbbmdr74.js} +94 -94
- package/dist/shared/{components-vb033rns.js → components-jjw69c4c.js} +6 -6
- package/dist/shared/{components-r2gke5p6.js → components-jthe1pwb.js} +125 -125
- package/dist/shared/{components-tad5h7ta.js → components-jwst3vtj.js} +48 -48
- package/dist/shared/{components-xszag63d.js → components-k809mbn0.js} +12 -12
- package/dist/shared/{components-r22vtgqc.js → components-kvr7f9hy.js} +11 -11
- package/dist/shared/{components-r4jt6hgd.js → components-mjthm1kf.js} +6 -6
- package/dist/shared/{components-nn6xezy2.js → components-nb87fjy4.js} +226 -226
- package/dist/shared/{components-gndm6am4.js → components-ng72k97e.js} +17 -17
- package/dist/shared/{components-54nf2x99.js → components-pbmqctfa.js} +52 -45
- package/dist/shared/{components-peg09pzs.js → components-q5xj5c16.js} +11 -11
- package/dist/shared/{components-taxmgbnh.js → components-re6rs21k.js} +17 -17
- package/dist/shared/{components-r43mqnd6.js → components-rr7a6ja9.js} +46 -46
- package/dist/shared/{components-p2vmyfe1.js → components-s083f38z.js} +43 -43
- package/dist/shared/{components-bkvb6nem.js → components-s2bz1xpk.js} +11 -11
- package/dist/shared/components-ta7shw28.js +19 -0
- package/dist/shared/components-vc7vq5nz.js +32 -0
- package/dist/shared/{components-6hzwfmfd.js → components-vfbhxf5r.js} +8 -8
- package/dist/shared/{components-8hk9ve3r.js → components-wvp1m52g.js} +57 -57
- package/dist/shared/{components-brnzrp2t.js → components-xxvdw7k1.js} +41 -41
- package/dist/shared/{components-61ckf42z.js → components-zfnmn5d4.js} +64 -64
- package/dist/shared/{components-m5br529r.js → components-zrkzcayz.js} +2 -2
- package/dist/shared/{components-csxz9f52.js → components-zx6b6yby.js} +4 -4
- package/dist/styles.css +1 -1
- package/package.json +3 -3
- package/dist/components/inputs/checkbox-group/index.d.ts +0 -50
- package/dist/components/inputs/checkbox-group/index.js +0 -23
- package/dist/components/inputs/input-copy/index.js +0 -18
- package/dist/components/inputs/input-message/index.js +0 -27
- package/dist/components/inputs/radio-group/index.js +0 -22
- package/dist/components/navigation/accordion/index.js +0 -30
- package/dist/components/thinking-indicator/index.js +0 -15
- package/dist/shared/components-74c20v2f.js +0 -32
- package/dist/shared/components-8hzbsfbd.js +0 -123
- package/dist/shared/components-dphg9gjr.js +0 -42
- package/dist/shared/components-kpbcms10.js +0 -9
- /package/dist/shared/{components-5vxtcp88.js → components-3ky44908.js} +0 -0
- /package/dist/shared/{components-4xxddc44.js → components-c6s6b43g.js} +0 -0
- /package/dist/shared/{components-nnnd2xef.js → components-men63rwj.js} +0 -0
- /package/dist/shared/{components-de8xsm9y.js → components-mhd39z7x.js} +0 -0
- /package/dist/shared/{components-dg0w8g5p.js → components-n7mjr357.js} +0 -0
- /package/dist/shared/{components-jw16snbn.js → components-vynjtrk6.js} +0 -0
|
@@ -1,61 +1,61 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "./components-
|
|
2
|
+
fieldVariants,
|
|
3
|
+
fieldIconClasses
|
|
4
|
+
} from "./components-mhd39z7x.js";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
opensInPlace,
|
|
7
|
+
inPlaceOffset,
|
|
8
|
+
useMorphOrigin,
|
|
9
|
+
useMorph
|
|
10
|
+
} from "./components-hqeq3w9q.js";
|
|
10
11
|
import {
|
|
11
|
-
|
|
12
|
-
} from "./components-
|
|
12
|
+
cn2
|
|
13
|
+
} from "./components-ezxhrmer.js";
|
|
14
|
+
import {
|
|
15
|
+
FluidHoverHighlight2
|
|
16
|
+
} from "./components-kvr7f9hy.js";
|
|
13
17
|
import {
|
|
14
18
|
useIcon
|
|
15
|
-
} from "./components-
|
|
19
|
+
} from "./components-zrkzcayz.js";
|
|
16
20
|
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
MorphSurface
|
|
22
|
+
} from "./components-0q0sqfh4.js";
|
|
23
|
+
import {
|
|
24
|
+
shapeMap,
|
|
25
|
+
useShape
|
|
26
|
+
} from "./components-cv16mryv.js";
|
|
21
27
|
import {
|
|
22
|
-
|
|
23
|
-
} from "./components-
|
|
28
|
+
useSize2
|
|
29
|
+
} from "./components-0sn7ypjw.js";
|
|
24
30
|
import {
|
|
25
31
|
SURFACE_BG,
|
|
26
32
|
SURFACE_SHADOW,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} from "./components-
|
|
33
|
+
useSurface2,
|
|
34
|
+
SurfaceProvider2
|
|
35
|
+
} from "./components-zx6b6yby.js";
|
|
30
36
|
import {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
FluidHoverHighlight
|
|
35
|
-
} from "./components-r22vtgqc.js";
|
|
36
|
-
import {
|
|
37
|
-
useFluidHover,
|
|
38
|
-
useRegisterFluidHoverItem
|
|
39
|
-
} from "./components-e46kf6cp.js";
|
|
37
|
+
useFluidHover2,
|
|
38
|
+
useRegisterFluidHoverItem2
|
|
39
|
+
} from "./components-59efxjd9.js";
|
|
40
40
|
import {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
useSelectionRuns,
|
|
42
|
+
useMergeSplitBlocks,
|
|
43
|
+
SelectionBackgrounds
|
|
44
|
+
} from "./components-5xc2j8jz.js";
|
|
44
45
|
import {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
useMorph,
|
|
48
|
-
useMorphOrigin
|
|
49
|
-
} from "./components-7nww01w4.js";
|
|
46
|
+
ScrollArea2
|
|
47
|
+
} from "./components-hawvy2qz.js";
|
|
50
48
|
import {
|
|
51
|
-
|
|
52
|
-
} from "./components-
|
|
49
|
+
SizeProvider2
|
|
50
|
+
} from "./components-jjw69c4c.js";
|
|
53
51
|
import {
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
popupScrollAreaClass,
|
|
53
|
+
popupViewportClass,
|
|
54
|
+
isDisabledRow
|
|
55
|
+
} from "./components-vynjtrk6.js";
|
|
56
56
|
import {
|
|
57
|
-
|
|
58
|
-
} from "./components-
|
|
57
|
+
spring2
|
|
58
|
+
} from "./components-1v7rxytx.js";
|
|
59
59
|
|
|
60
60
|
// components/inputs/combobox/index.tsx
|
|
61
61
|
import { Combobox as ComboboxPrimitive } from "@base-ui/react/combobox";
|
|
@@ -102,7 +102,7 @@ function toValues(v) {
|
|
|
102
102
|
return v;
|
|
103
103
|
return v === "" ? [] : [v];
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function Combobox2({
|
|
106
106
|
children,
|
|
107
107
|
items,
|
|
108
108
|
multiple,
|
|
@@ -230,27 +230,27 @@ function Combobox({
|
|
|
230
230
|
})
|
|
231
231
|
})
|
|
232
232
|
});
|
|
233
|
-
return size ? /* @__PURE__ */ jsx(
|
|
233
|
+
return size ? /* @__PURE__ */ jsx(SizeProvider2, {
|
|
234
234
|
size,
|
|
235
235
|
children: root
|
|
236
236
|
}) : root;
|
|
237
237
|
}
|
|
238
|
-
|
|
238
|
+
Combobox2.displayName = "Combobox";
|
|
239
239
|
var popupShape = shapeMap.rounded;
|
|
240
240
|
var ALWAYS_HIGHLIGHT = "always";
|
|
241
241
|
var fieldButtonClass = "flex shrink-0 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors duration-fast hover:text-foreground focus-visible:ring-1 focus-visible:ring-focus-ring data-[disabled]:pointer-events-none";
|
|
242
|
-
var clearButtonClass =
|
|
243
|
-
var chipRemoveClass =
|
|
242
|
+
var clearButtonClass = cn2(fieldButtonClass, "hover:bg-hover active:bg-active transition-[color,background-color]");
|
|
243
|
+
var chipRemoveClass = cn2(fieldButtonClass, "rounded hover:bg-active");
|
|
244
244
|
function FieldControls({ clearable, compact, iconSize }) {
|
|
245
245
|
const XIcon = useIcon("x");
|
|
246
246
|
const pill = useShape().variant === "pill";
|
|
247
247
|
return /* @__PURE__ */ jsxs(Fragment, {
|
|
248
248
|
children: [
|
|
249
249
|
clearable && /* @__PURE__ */ jsx("span", {
|
|
250
|
-
className:
|
|
250
|
+
className: cn2("flex shrink-0 items-center justify-center", compact ? "size-5" : "size-6"),
|
|
251
251
|
children: /* @__PURE__ */ jsx(ComboboxPrimitive.Clear, {
|
|
252
252
|
"aria-label": "Clear",
|
|
253
|
-
className:
|
|
253
|
+
className: cn2(clearButtonClass, pill && "rounded-full", compact ? "size-5" : "size-6"),
|
|
254
254
|
children: /* @__PURE__ */ jsx(XIcon, {
|
|
255
255
|
size: iconSize,
|
|
256
256
|
strokeWidth: 1.5
|
|
@@ -260,7 +260,7 @@ function FieldControls({ clearable, compact, iconSize }) {
|
|
|
260
260
|
/* @__PURE__ */ jsx(ComboboxPrimitive.Trigger, {
|
|
261
261
|
"aria-label": "Open",
|
|
262
262
|
tabIndex: -1,
|
|
263
|
-
className:
|
|
263
|
+
className: cn2(fieldButtonClass, compact ? "size-5" : "size-6"),
|
|
264
264
|
children: /* @__PURE__ */ jsx("svg", {
|
|
265
265
|
width: iconSize,
|
|
266
266
|
height: iconSize,
|
|
@@ -279,9 +279,9 @@ function FieldControls({ clearable, compact, iconSize }) {
|
|
|
279
279
|
]
|
|
280
280
|
});
|
|
281
281
|
}
|
|
282
|
-
var
|
|
282
|
+
var ComboboxInput2 = forwardRef(({ className, variant, icon: Icon, placeholder = "Search…", error, clearable = false, size, ...props }, ref) => {
|
|
283
283
|
const shape = useShape();
|
|
284
|
-
const sizeClasses =
|
|
284
|
+
const sizeClasses = useSize2(size);
|
|
285
285
|
const compact = sizeClasses.variant === "compact";
|
|
286
286
|
const { anchorRef } = useComboboxContext();
|
|
287
287
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -290,7 +290,7 @@ var ComboboxInput = forwardRef(({ className, variant, icon: Icon, placeholder =
|
|
|
290
290
|
/* @__PURE__ */ jsxs(ComboboxPrimitive.InputGroup, {
|
|
291
291
|
ref: anchorRef,
|
|
292
292
|
"data-invalid": !!error || undefined,
|
|
293
|
-
className:
|
|
293
|
+
className: cn2(fieldVariants({ variant: variant ?? "bordered" }), "flex items-center", sizeClasses.control, sizeClasses.gap, compact ? "px-2" : "px-2.5", compact ? "min-w-[128px]" : "min-w-[160px]", shape.input, className),
|
|
294
294
|
children: [
|
|
295
295
|
Icon && /* @__PURE__ */ jsx(Icon, {
|
|
296
296
|
size: sizeClasses.icon,
|
|
@@ -301,7 +301,7 @@ var ComboboxInput = forwardRef(({ className, variant, icon: Icon, placeholder =
|
|
|
301
301
|
ref,
|
|
302
302
|
placeholder,
|
|
303
303
|
"aria-invalid": !!error || undefined,
|
|
304
|
-
className:
|
|
304
|
+
className: cn2("min-w-0 flex-1 rounded-none bg-transparent text-foreground placeholder:text-muted-foreground outline-none font-[inherit]", sizeClasses.text, compact ? "leading-5" : "leading-6"),
|
|
305
305
|
...props
|
|
306
306
|
}),
|
|
307
307
|
/* @__PURE__ */ jsx(FieldControls, {
|
|
@@ -318,7 +318,7 @@ var ComboboxInput = forwardRef(({ className, variant, icon: Icon, placeholder =
|
|
|
318
318
|
]
|
|
319
319
|
});
|
|
320
320
|
});
|
|
321
|
-
|
|
321
|
+
ComboboxInput2.displayName = "ComboboxInput";
|
|
322
322
|
function useChipRowHeight(padY) {
|
|
323
323
|
const height = useMotionValue("auto");
|
|
324
324
|
const roRef = useRef(null);
|
|
@@ -336,7 +336,7 @@ function useChipRowHeight(padY) {
|
|
|
336
336
|
if (height.get() === "auto")
|
|
337
337
|
height.set(target);
|
|
338
338
|
else if (height.get() !== target)
|
|
339
|
-
animate(height, target,
|
|
339
|
+
animate(height, target, spring2.fast);
|
|
340
340
|
};
|
|
341
341
|
measure();
|
|
342
342
|
const ro = new ResizeObserver(measure);
|
|
@@ -345,10 +345,10 @@ function useChipRowHeight(padY) {
|
|
|
345
345
|
}, [height]);
|
|
346
346
|
return { ref, height };
|
|
347
347
|
}
|
|
348
|
-
var
|
|
348
|
+
var ComboboxChips2 = forwardRef(({ className, variant, icon: Icon, placeholder = "Search…", error, clearable = false, size, ...props }, ref) => {
|
|
349
349
|
const XIcon = useIcon("x");
|
|
350
350
|
const shape = useShape();
|
|
351
|
-
const sizeClasses =
|
|
351
|
+
const sizeClasses = useSize2(size);
|
|
352
352
|
const compact = sizeClasses.variant === "compact";
|
|
353
353
|
const { anchorRef, open, disabled, inputValue, values } = useComboboxContext();
|
|
354
354
|
const rowHeight = useChipRowHeight(compact ? 8 : 12);
|
|
@@ -363,10 +363,10 @@ var ComboboxChips = forwardRef(({ className, variant, icon: Icon, placeholder =
|
|
|
363
363
|
"data-disabled": disabled || undefined,
|
|
364
364
|
"data-invalid": !!error || undefined,
|
|
365
365
|
"data-popup-open": open || undefined,
|
|
366
|
-
className:
|
|
366
|
+
className: cn2(fieldVariants({ variant: variant ?? "bordered" }), "flex items-center", "transition-[color,background-color,border-radius,box-shadow,opacity]", "!items-start", compact ? "min-h-7 py-1" : "min-h-9 py-1.5", sizeClasses.gap, compact ? "px-2" : "px-2.5", compact ? "min-w-[128px]" : "min-w-[160px]", shape.input, className),
|
|
367
367
|
children: [
|
|
368
368
|
Icon && /* @__PURE__ */ jsx("span", {
|
|
369
|
-
className:
|
|
369
|
+
className: cn2("flex shrink-0 items-center", compact ? "h-5" : "h-6"),
|
|
370
370
|
children: /* @__PURE__ */ jsx(Icon, {
|
|
371
371
|
size: sizeClasses.icon,
|
|
372
372
|
strokeWidth: 1.5,
|
|
@@ -375,7 +375,7 @@ var ComboboxChips = forwardRef(({ className, variant, icon: Icon, placeholder =
|
|
|
375
375
|
}),
|
|
376
376
|
/* @__PURE__ */ jsx("div", {
|
|
377
377
|
ref: rowHeight.ref,
|
|
378
|
-
className:
|
|
378
|
+
className: cn2("relative flex min-w-0 flex-1 flex-wrap items-center gap-1", !Icon && values.length > 0 && "-ml-1"),
|
|
379
379
|
children: /* @__PURE__ */ jsx(ComboboxPrimitive.Value, {
|
|
380
380
|
children: (selected) => /* @__PURE__ */ jsxs(Fragment, {
|
|
381
381
|
children: [
|
|
@@ -392,14 +392,14 @@ var ComboboxChips = forwardRef(({ className, variant, icon: Icon, placeholder =
|
|
|
392
392
|
opacity: 0,
|
|
393
393
|
scale: 0.9,
|
|
394
394
|
pointerEvents: "none",
|
|
395
|
-
transition:
|
|
395
|
+
transition: spring2.fast.exit
|
|
396
396
|
},
|
|
397
|
-
transition:
|
|
397
|
+
transition: spring2.fast,
|
|
398
398
|
style: { originX: 0 },
|
|
399
399
|
className: "inline-flex max-w-full shrink-0",
|
|
400
400
|
children: /* @__PURE__ */ jsxs(ComboboxPrimitive.Chip, {
|
|
401
401
|
"aria-label": label,
|
|
402
|
-
className:
|
|
402
|
+
className: cn2("inline-flex max-w-full shrink-0 items-center gap-0.5 bg-hover pl-2 pr-0.5 text-foreground outline-none", shape.variant === "pill" ? "rounded-full" : "rounded-md", "focus-visible:ring-1 focus-visible:ring-focus-ring", compact ? "h-5 text-caption-compact" : "h-6 text-caption"),
|
|
403
403
|
children: [
|
|
404
404
|
/* @__PURE__ */ jsx("span", {
|
|
405
405
|
className: "truncate",
|
|
@@ -407,7 +407,7 @@ var ComboboxChips = forwardRef(({ className, variant, icon: Icon, placeholder =
|
|
|
407
407
|
}),
|
|
408
408
|
/* @__PURE__ */ jsx(ComboboxPrimitive.ChipRemove, {
|
|
409
409
|
"aria-label": `Remove ${label}`,
|
|
410
|
-
className:
|
|
410
|
+
className: cn2(chipRemoveClass, shape.variant === "pill" && "rounded-full", compact ? "size-4" : "size-5"),
|
|
411
411
|
children: /* @__PURE__ */ jsx(XIcon, {
|
|
412
412
|
size: compact ? 10 : 12,
|
|
413
413
|
strokeWidth: 2
|
|
@@ -425,7 +425,7 @@ var ComboboxChips = forwardRef(({ className, variant, icon: Icon, placeholder =
|
|
|
425
425
|
size: Math.max(1, inputValue.length + 1),
|
|
426
426
|
placeholder: selected?.length ? undefined : placeholder,
|
|
427
427
|
"aria-invalid": !!error || undefined,
|
|
428
|
-
className:
|
|
428
|
+
className: cn2("w-full min-w-0 rounded-none bg-transparent text-foreground placeholder:text-muted-foreground outline-none font-[inherit]", compact ? "h-5 leading-5" : "h-6 leading-6", sizeClasses.text),
|
|
429
429
|
...props
|
|
430
430
|
})
|
|
431
431
|
})
|
|
@@ -447,8 +447,8 @@ var ComboboxChips = forwardRef(({ className, variant, icon: Icon, placeholder =
|
|
|
447
447
|
]
|
|
448
448
|
});
|
|
449
449
|
});
|
|
450
|
-
|
|
451
|
-
var
|
|
450
|
+
ComboboxChips2.displayName = "ComboboxChips";
|
|
451
|
+
var ComboboxContent2 = forwardRef(({
|
|
452
452
|
className,
|
|
453
453
|
children,
|
|
454
454
|
side = "bottom",
|
|
@@ -462,7 +462,7 @@ var ComboboxContent = forwardRef(({
|
|
|
462
462
|
const { open, origin, anchorRef } = useComboboxContext();
|
|
463
463
|
const morph = useMorph(open, origin, { from, effect, hideSource, tier });
|
|
464
464
|
useImperativeHandle(ref, () => morph.popup, [morph.popup]);
|
|
465
|
-
const level = Math.min(
|
|
465
|
+
const level = Math.min(useSurface2() + 2, 8);
|
|
466
466
|
const shape = popupShape;
|
|
467
467
|
return /* @__PURE__ */ jsx(ComboboxPrimitive.Portal, {
|
|
468
468
|
children: /* @__PURE__ */ jsx(ComboboxPrimitive.Positioner, {
|
|
@@ -474,14 +474,14 @@ var ComboboxContent = forwardRef(({
|
|
|
474
474
|
children: /* @__PURE__ */ jsx(ComboboxPrimitive.Popup, {
|
|
475
475
|
ref: morph.popupRef,
|
|
476
476
|
className: "relative select-none outline-none",
|
|
477
|
-
children: /* @__PURE__ */ jsx(
|
|
477
|
+
children: /* @__PURE__ */ jsx(SurfaceProvider2, {
|
|
478
478
|
value: level,
|
|
479
479
|
children: /* @__PURE__ */ jsx(MorphSurface, {
|
|
480
480
|
morph,
|
|
481
481
|
bg: SURFACE_BG[level],
|
|
482
482
|
shadow: SURFACE_SHADOW[3],
|
|
483
483
|
radius: shape.container,
|
|
484
|
-
className:
|
|
484
|
+
className: cn2(`flex flex-col min-w-[var(--anchor-width)] max-h-[min(300px,var(--available-height))] overflow-hidden ${shape.container}`, className),
|
|
485
485
|
children
|
|
486
486
|
})
|
|
487
487
|
})
|
|
@@ -489,14 +489,14 @@ var ComboboxContent = forwardRef(({
|
|
|
489
489
|
})
|
|
490
490
|
});
|
|
491
491
|
});
|
|
492
|
-
|
|
493
|
-
var
|
|
492
|
+
ComboboxContent2.displayName = "ComboboxContent";
|
|
493
|
+
var ComboboxList2 = forwardRef(({ className, children }, ref) => {
|
|
494
494
|
const { open, values, multiple, inputValue, createRow } = useComboboxContext();
|
|
495
495
|
const highlight = useContext(ComboboxHighlightContext);
|
|
496
496
|
const PlusIcon = useIcon("plus");
|
|
497
497
|
const shape = popupShape;
|
|
498
498
|
const containerRef = useRef(null);
|
|
499
|
-
const hover =
|
|
499
|
+
const hover = useFluidHover2(containerRef, { isItemDisabled: isDisabledRow });
|
|
500
500
|
const { activeIndex, setActiveIndex, itemRects, isMeasured, handlers, registerItem, remeasure } = hover;
|
|
501
501
|
const [checkedIndices, setCheckedIndices] = useState([]);
|
|
502
502
|
useEffect(() => {
|
|
@@ -559,9 +559,9 @@ var ComboboxList = forwardRef(({ className, children }, ref) => {
|
|
|
559
559
|
const contentCtx = useMemo(() => ({ registerItem, activeIndex }), [registerItem, activeIndex]);
|
|
560
560
|
return /* @__PURE__ */ jsx(ComboboxContentContext.Provider, {
|
|
561
561
|
value: contentCtx,
|
|
562
|
-
children: /* @__PURE__ */ jsx(
|
|
562
|
+
children: /* @__PURE__ */ jsx(ScrollArea2, {
|
|
563
563
|
className: popupScrollAreaClass,
|
|
564
|
-
viewportClassName:
|
|
564
|
+
viewportClassName: cn2(popupViewportClass, "scroll-fade"),
|
|
565
565
|
children: /* @__PURE__ */ jsxs(ComboboxPrimitive.List, {
|
|
566
566
|
ref: (node) => {
|
|
567
567
|
containerRef.current = node;
|
|
@@ -574,7 +574,7 @@ var ComboboxList = forwardRef(({ className, children }, ref) => {
|
|
|
574
574
|
onMouseMove: handlers.onMouseMove,
|
|
575
575
|
onMouseLeave: handlers.onMouseLeave,
|
|
576
576
|
onClick: handlers.onClick,
|
|
577
|
-
className:
|
|
577
|
+
className: cn2("relative flex flex-col p-1 outline-none data-[empty]:p-0", className),
|
|
578
578
|
children: [
|
|
579
579
|
open && multiple && /* @__PURE__ */ jsx(SelectionBackgrounds, {
|
|
580
580
|
blocks: reflowSnap ? blocks.map((b) => ({ ...b, instant: true })) : blocks
|
|
@@ -591,11 +591,11 @@ var ComboboxList = forwardRef(({ className, children }, ref) => {
|
|
|
591
591
|
height: checkedRect.height,
|
|
592
592
|
opacity: 1
|
|
593
593
|
},
|
|
594
|
-
exit: { opacity: 0, transition:
|
|
595
|
-
transition: reflowSnap ? { duration: 0 } : { ...
|
|
594
|
+
exit: { opacity: 0, transition: spring2.moderate.exit },
|
|
595
|
+
transition: reflowSnap ? { duration: 0 } : { ...spring2.moderate, opacity: { duration: spring2.fast.duration } }
|
|
596
596
|
}, "checked")
|
|
597
597
|
}),
|
|
598
|
-
open && /* @__PURE__ */ jsx(
|
|
598
|
+
open && /* @__PURE__ */ jsx(FluidHoverHighlight2, {
|
|
599
599
|
hover,
|
|
600
600
|
className: shape.bg,
|
|
601
601
|
transition: reflowSnap ? false : undefined
|
|
@@ -603,7 +603,7 @@ var ComboboxList = forwardRef(({ className, children }, ref) => {
|
|
|
603
603
|
/* @__PURE__ */ jsx(ComboboxPrimitive.Collection, {
|
|
604
604
|
children: (item, index) => /* @__PURE__ */ jsx(ComboboxItemIndexContext.Provider, {
|
|
605
605
|
value: index,
|
|
606
|
-
children: isCreateItem(item) ? /* @__PURE__ */ jsx(
|
|
606
|
+
children: isCreateItem(item) ? /* @__PURE__ */ jsx(ComboboxItem2, {
|
|
607
607
|
value: CREATE_VALUE,
|
|
608
608
|
icon: PlusIcon,
|
|
609
609
|
children: createRow
|
|
@@ -615,21 +615,21 @@ var ComboboxList = forwardRef(({ className, children }, ref) => {
|
|
|
615
615
|
})
|
|
616
616
|
});
|
|
617
617
|
});
|
|
618
|
-
|
|
619
|
-
var
|
|
618
|
+
ComboboxList2.displayName = "ComboboxList";
|
|
619
|
+
var ComboboxItem2 = forwardRef(({ className, children, icon: Icon, value, disabled = false, ...props }, ref) => {
|
|
620
620
|
const comboboxCtx = useComboboxContext();
|
|
621
621
|
const contentCtx = useContext(ComboboxContentContext);
|
|
622
622
|
const index = useContext(ComboboxItemIndexContext);
|
|
623
623
|
const internalRef = useRef(null);
|
|
624
624
|
const shape = popupShape;
|
|
625
|
-
const sizeClasses =
|
|
625
|
+
const sizeClasses = useSize2();
|
|
626
626
|
const compact = sizeClasses.variant === "compact";
|
|
627
627
|
const hasMounted = useRef(false);
|
|
628
628
|
useEffect(() => {
|
|
629
629
|
hasMounted.current = true;
|
|
630
630
|
}, []);
|
|
631
631
|
const registerItem = contentCtx?.registerItem;
|
|
632
|
-
|
|
632
|
+
useRegisterFluidHoverItem2(registerItem, index, internalRef);
|
|
633
633
|
const isActive = contentCtx?.activeIndex === index;
|
|
634
634
|
const isChecked = comboboxCtx.values.includes(value);
|
|
635
635
|
const skipAnimation = !hasMounted.current;
|
|
@@ -648,7 +648,7 @@ var ComboboxItem = forwardRef(({ className, children, icon: Icon, value, disable
|
|
|
648
648
|
},
|
|
649
649
|
"data-fluid-hover-index": index,
|
|
650
650
|
"data-value": value,
|
|
651
|
-
className:
|
|
651
|
+
className: cn2(`relative z-10 flex ${sizeClasses.control} shrink-0 items-center ${sizeClasses.gap} ${shape.item} ${sizeClasses.itemPx} ${sizeClasses.text} cursor-pointer outline-none select-none`, "transition-[color] duration-fast", isActive || isChecked ? "text-foreground" : "text-muted-foreground", disabled && "opacity-50 pointer-events-none", className),
|
|
652
652
|
...props
|
|
653
653
|
}),
|
|
654
654
|
children: [
|
|
@@ -663,7 +663,7 @@ var ComboboxItem = forwardRef(({ className, children, icon: Icon, value, disable
|
|
|
663
663
|
}),
|
|
664
664
|
/* @__PURE__ */ jsx("span", {
|
|
665
665
|
"aria-hidden": true,
|
|
666
|
-
className:
|
|
666
|
+
className: cn2("shrink-0", compact ? "w-3.5 h-3.5" : "w-4 h-4"),
|
|
667
667
|
children: /* @__PURE__ */ jsx(AnimatePresence, {
|
|
668
668
|
children: isChecked && /* @__PURE__ */ jsx(motion.svg, {
|
|
669
669
|
width: sizeClasses.icon,
|
|
@@ -683,7 +683,7 @@ var ComboboxItem = forwardRef(({ className, children, icon: Icon, value, disable
|
|
|
683
683
|
initial: { pathLength: skipAnimation ? 1 : 0 },
|
|
684
684
|
animate: {
|
|
685
685
|
pathLength: 1,
|
|
686
|
-
transition: { duration:
|
|
686
|
+
transition: { duration: spring2.fast.duration, ease: "easeOut" }
|
|
687
687
|
},
|
|
688
688
|
exit: {
|
|
689
689
|
pathLength: 0,
|
|
@@ -696,24 +696,24 @@ var ComboboxItem = forwardRef(({ className, children, icon: Icon, value, disable
|
|
|
696
696
|
]
|
|
697
697
|
});
|
|
698
698
|
});
|
|
699
|
-
|
|
700
|
-
var
|
|
701
|
-
const sizeClasses =
|
|
699
|
+
ComboboxItem2.displayName = "ComboboxItem";
|
|
700
|
+
var ComboboxEmpty2 = forwardRef(({ className, children, allSelected, ...props }, ref) => {
|
|
701
|
+
const sizeClasses = useSize2();
|
|
702
702
|
const ctx = useComboboxContext();
|
|
703
703
|
return /* @__PURE__ */ jsx(ComboboxPrimitive.Empty, {
|
|
704
704
|
ref,
|
|
705
|
-
className:
|
|
705
|
+
className: cn2("px-3 text-center text-muted-foreground [&:not(:empty)]:py-6", sizeClasses.text, className),
|
|
706
706
|
...props,
|
|
707
707
|
children: ctx.allSelected && allSelected !== undefined ? allSelected : children
|
|
708
708
|
});
|
|
709
709
|
});
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
var combobox_default =
|
|
710
|
+
ComboboxEmpty2.displayName = "ComboboxEmpty";
|
|
711
|
+
Combobox2.Input = ComboboxInput2;
|
|
712
|
+
Combobox2.Chips = ComboboxChips2;
|
|
713
|
+
Combobox2.Content = ComboboxContent2;
|
|
714
|
+
Combobox2.List = ComboboxList2;
|
|
715
|
+
Combobox2.Item = ComboboxItem2;
|
|
716
|
+
Combobox2.Empty = ComboboxEmpty2;
|
|
717
|
+
var combobox_default = Combobox2;
|
|
718
718
|
|
|
719
|
-
export {
|
|
719
|
+
export { Combobox2, ComboboxInput2, ComboboxChips2, ComboboxContent2, ComboboxList2, ComboboxItem2, ComboboxEmpty2, combobox_default };
|
|
@@ -1,23 +1,51 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./components-
|
|
2
|
+
cn2
|
|
3
|
+
} from "./components-ezxhrmer.js";
|
|
4
4
|
import {
|
|
5
5
|
GooIndicator
|
|
6
|
-
} from "./components-
|
|
6
|
+
} from "./components-chacnk61.js";
|
|
7
|
+
import {
|
|
8
|
+
FluidHoverHighlight2
|
|
9
|
+
} from "./components-kvr7f9hy.js";
|
|
10
|
+
import {
|
|
11
|
+
IndexedRows,
|
|
12
|
+
useRowIndex
|
|
13
|
+
} from "./components-ta7shw28.js";
|
|
14
|
+
import {
|
|
15
|
+
useShape
|
|
16
|
+
} from "./components-cv16mryv.js";
|
|
17
|
+
import {
|
|
18
|
+
useSize2
|
|
19
|
+
} from "./components-0sn7ypjw.js";
|
|
20
|
+
import {
|
|
21
|
+
useControllableState
|
|
22
|
+
} from "./components-n7mjr357.js";
|
|
7
23
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
24
|
+
useFluidHover2,
|
|
25
|
+
useRegisterFluidHoverItem2
|
|
26
|
+
} from "./components-59efxjd9.js";
|
|
10
27
|
import {
|
|
11
|
-
|
|
12
|
-
} from "./components-
|
|
28
|
+
SizeProvider2
|
|
29
|
+
} from "./components-jjw69c4c.js";
|
|
13
30
|
import {
|
|
14
|
-
|
|
15
|
-
} from "./components-
|
|
31
|
+
spring2
|
|
32
|
+
} from "./components-1v7rxytx.js";
|
|
16
33
|
|
|
17
34
|
// components/inputs/switch/index.tsx
|
|
18
35
|
import { Switch as SwitchPrimitive } from "@base-ui/react/switch";
|
|
19
|
-
import {
|
|
36
|
+
import {
|
|
37
|
+
Children,
|
|
38
|
+
createContext,
|
|
39
|
+
forwardRef,
|
|
40
|
+
isValidElement,
|
|
41
|
+
useCallback,
|
|
42
|
+
useContext,
|
|
43
|
+
useId,
|
|
44
|
+
useRef,
|
|
45
|
+
useState
|
|
46
|
+
} from "react";
|
|
20
47
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
48
|
+
var SwitchGroupContext = createContext(null);
|
|
21
49
|
var METRICS = {
|
|
22
50
|
default: {
|
|
23
51
|
trackWidth: 34,
|
|
@@ -38,8 +66,10 @@ var METRICS = {
|
|
|
38
66
|
};
|
|
39
67
|
var THUMB_OFFSET = 2;
|
|
40
68
|
var DRAG_DEAD_ZONE = 2;
|
|
41
|
-
var
|
|
69
|
+
var Switch2 = forwardRef(({
|
|
42
70
|
label,
|
|
71
|
+
description,
|
|
72
|
+
trackSide = "start",
|
|
43
73
|
checked,
|
|
44
74
|
defaultChecked = false,
|
|
45
75
|
onToggle,
|
|
@@ -56,9 +86,16 @@ var Switch = forwardRef(({
|
|
|
56
86
|
onToggle?.();
|
|
57
87
|
}, [setChecked, onToggle]);
|
|
58
88
|
const labelId = useId();
|
|
89
|
+
const descriptionId = useId();
|
|
90
|
+
const group = useContext(SwitchGroupContext);
|
|
91
|
+
const index = useRowIndex();
|
|
92
|
+
const rowRef = useRef(null);
|
|
93
|
+
useRegisterFluidHoverItem2(disabled ? undefined : group?.registerItem, index, rowRef);
|
|
94
|
+
const end = trackSide === "end" || !!group;
|
|
95
|
+
const divider = !!group && index < group.count - 1 && group.activeIndex !== index && group.activeIndex !== index + 1;
|
|
59
96
|
const [hovered, setHovered] = useState(false);
|
|
60
97
|
const [pressed, setPressed] = useState(false);
|
|
61
|
-
const sizeClasses =
|
|
98
|
+
const sizeClasses = useSize2(size);
|
|
62
99
|
const m = METRICS[sizeClasses.variant];
|
|
63
100
|
const thumbTravel = m.trackWidth - m.thumbSize - THUMB_OFFSET * 2;
|
|
64
101
|
const dragging = useRef(false);
|
|
@@ -138,8 +175,14 @@ var Switch = forwardRef(({
|
|
|
138
175
|
pointerStart.current = null;
|
|
139
176
|
}, [setDragX]);
|
|
140
177
|
return /* @__PURE__ */ jsxs("div", {
|
|
141
|
-
ref
|
|
142
|
-
|
|
178
|
+
ref: (node) => {
|
|
179
|
+
rowRef.current = node;
|
|
180
|
+
if (typeof ref === "function")
|
|
181
|
+
ref(node);
|
|
182
|
+
else if (ref)
|
|
183
|
+
ref.current = node;
|
|
184
|
+
},
|
|
185
|
+
className: cn2("relative z-10 flex items-center cursor-pointer select-none touch-none", sizeClasses.gap, sizeClasses.px, sizeClasses.variant === "compact" ? "py-1" : "py-2", group && (sizeClasses.variant === "compact" ? "px-3 py-2.5" : "px-4 py-3.5"), disabled && "opacity-50 pointer-events-none", className),
|
|
143
186
|
onPointerEnter: (e) => {
|
|
144
187
|
if (e.pointerType === "mouse")
|
|
145
188
|
setHovered(true);
|
|
@@ -159,9 +202,10 @@ var Switch = forwardRef(({
|
|
|
159
202
|
/* @__PURE__ */ jsx(SwitchPrimitive.Root, {
|
|
160
203
|
checked: isChecked,
|
|
161
204
|
"aria-labelledby": labelId,
|
|
205
|
+
"aria-describedby": description ? descriptionId : undefined,
|
|
162
206
|
disabled,
|
|
163
207
|
tabIndex: 0,
|
|
164
|
-
className:
|
|
208
|
+
className: cn2("relative shrink-0 rounded-full outline-none cursor-pointer", end && "order-last", "transition-colors duration-fast", "focus-visible:ring-1 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background", isChecked ? hovered ? "bg-brand-hover" : "bg-brand" : hovered ? "bg-accent-hover" : "bg-accent"),
|
|
165
209
|
style: {
|
|
166
210
|
width: m.trackWidth,
|
|
167
211
|
height: m.trackHeight
|
|
@@ -173,19 +217,72 @@ var Switch = forwardRef(({
|
|
|
173
217
|
rect: thumb,
|
|
174
218
|
className: "rounded-full bg-thumb",
|
|
175
219
|
shadow: "shadow-thumb",
|
|
176
|
-
transition: dragX === null ? thumbTransition ??
|
|
220
|
+
transition: dragX === null ? thumbTransition ?? spring2.moderate : false
|
|
177
221
|
})
|
|
178
222
|
})
|
|
179
223
|
}),
|
|
180
|
-
/* @__PURE__ */
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
224
|
+
/* @__PURE__ */ jsxs("span", {
|
|
225
|
+
className: cn2("flex min-w-0 flex-col gap-1", end && "flex-1"),
|
|
226
|
+
children: [
|
|
227
|
+
/* @__PURE__ */ jsx("span", {
|
|
228
|
+
id: labelId,
|
|
229
|
+
className: cn2("[text-box:trim-both_cap_alphabetic] transition-[color] duration-fast", sizeClasses.text, description ? "text-foreground weight-medium" : isChecked ? "text-foreground" : "text-muted-foreground"),
|
|
230
|
+
children: label
|
|
231
|
+
}),
|
|
232
|
+
description && /* @__PURE__ */ jsx("span", {
|
|
233
|
+
id: descriptionId,
|
|
234
|
+
className: cn2("leading-relaxed text-muted-foreground", sizeClasses.variant === "compact" ? "text-caption-compact" : "text-caption"),
|
|
235
|
+
children: description
|
|
236
|
+
})
|
|
237
|
+
]
|
|
238
|
+
}),
|
|
239
|
+
divider && /* @__PURE__ */ jsx("span", {
|
|
240
|
+
"aria-hidden": true,
|
|
241
|
+
className: "pointer-events-none absolute inset-x-0 bottom-0 h-px bg-border/60"
|
|
184
242
|
})
|
|
185
243
|
]
|
|
186
244
|
});
|
|
187
245
|
});
|
|
188
|
-
|
|
189
|
-
var
|
|
246
|
+
Switch2.displayName = "Switch";
|
|
247
|
+
var SwitchGroup2 = forwardRef(({ children, size, className, ...props }, ref) => {
|
|
248
|
+
const containerRef = useRef(null);
|
|
249
|
+
const hover = useFluidHover2(containerRef, { gapClick: false });
|
|
250
|
+
const shape = useShape();
|
|
251
|
+
const count = Children.toArray(children).filter(isValidElement).length;
|
|
252
|
+
const group = /* @__PURE__ */ jsx(SwitchGroupContext.Provider, {
|
|
253
|
+
value: { registerItem: hover.registerItem, activeIndex: hover.activeIndex, count },
|
|
254
|
+
children: /* @__PURE__ */ jsxs("fieldset", {
|
|
255
|
+
ref: (node) => {
|
|
256
|
+
containerRef.current = node;
|
|
257
|
+
if (typeof ref === "function")
|
|
258
|
+
ref(node);
|
|
259
|
+
else if (ref)
|
|
260
|
+
ref.current = node;
|
|
261
|
+
},
|
|
262
|
+
onMouseEnter: hover.handlers.onMouseEnter,
|
|
263
|
+
onMouseMove: hover.handlers.onMouseMove,
|
|
264
|
+
onMouseLeave: hover.handlers.onMouseLeave,
|
|
265
|
+
onClick: hover.handlers.onClick,
|
|
266
|
+
className: cn2("relative flex min-w-0 flex-col overflow-hidden border border-border/60 select-none", shape.container, className),
|
|
267
|
+
...props,
|
|
268
|
+
children: [
|
|
269
|
+
/* @__PURE__ */ jsx(FluidHoverHighlight2, {
|
|
270
|
+
hover,
|
|
271
|
+
className: cn2("z-0", shape.container)
|
|
272
|
+
}),
|
|
273
|
+
/* @__PURE__ */ jsx(IndexedRows, {
|
|
274
|
+
children
|
|
275
|
+
})
|
|
276
|
+
]
|
|
277
|
+
})
|
|
278
|
+
});
|
|
279
|
+
return size ? /* @__PURE__ */ jsx(SizeProvider2, {
|
|
280
|
+
size,
|
|
281
|
+
children: group
|
|
282
|
+
}) : group;
|
|
283
|
+
});
|
|
284
|
+
SwitchGroup2.displayName = "SwitchGroup";
|
|
285
|
+
Object.assign(Switch2, { Group: SwitchGroup2 });
|
|
286
|
+
var switch_default = Switch2;
|
|
190
287
|
|
|
191
|
-
export {
|
|
288
|
+
export { Switch2, SwitchGroup2, switch_default };
|