@justanarthur/modo-ui 0.1.0 → 0.2.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/blocks/sidebar-app/index.d.ts +1 -1
- package/dist/blocks/sidebar-app/index.js +28 -31
- 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/checkbox-group/index.d.ts +1 -1
- package/dist/components/inputs/checkbox-group/index.js +17 -19
- 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 +1 -1
- 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/input-copy/index.d.ts +1 -1
- package/dist/components/inputs/input-copy/index.js +12 -14
- package/dist/components/inputs/input-message/index.d.ts +1 -1
- package/dist/components/inputs/input-message/index.js +21 -23
- package/dist/components/inputs/radio-group/index.d.ts +1 -1
- package/dist/components/inputs/radio-group/index.js +16 -18
- 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 +1 -1
- package/dist/components/inputs/switch/index.js +10 -12
- package/dist/components/navigation/accordion/index.d.ts +1 -1
- package/dist/components/navigation/accordion/index.js +24 -26
- 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 +1 -1
- 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/components/thinking-indicator/index.d.ts +1 -1
- package/dist/components/thinking-indicator/index.js +9 -11
- package/dist/index.d.ts +51 -51
- package/dist/index.js +506 -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 +1 -1
- 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 +1 -1
- 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-0ke6xada.js +123 -0
- 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-p2vmyfe1.js → components-1j9791sn.js} +42 -42
- package/dist/shared/{components-6phwsry6.js → components-1rfwbyyc.js} +25 -25
- package/dist/shared/{components-vc1k7yv2.js → components-1v7rxytx.js} +3 -3
- package/dist/shared/{components-tm88ghva.js → components-1xekx2hx.js} +58 -58
- package/dist/shared/{components-6t6nr33r.js → components-39jq9va1.js} +26 -26
- package/dist/shared/{components-j65qt1mq.js → components-3gae8nta.js} +101 -101
- package/dist/shared/{components-r2gke5p6.js → components-3k8xpnpq.js} +125 -125
- package/dist/shared/{components-6y1th6k4.js → components-3mkepka5.js} +31 -31
- package/dist/shared/{components-vktws5r6.js → components-3wk0w46f.js} +72 -72
- package/dist/shared/{components-zx2hr57f.js → components-4cnjmgex.js} +15 -15
- 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-7gv95yfy.js → components-62ybc7t2.js} +83 -83
- package/dist/shared/{components-brnzrp2t.js → components-66mv71kx.js} +41 -41
- package/dist/shared/{components-taxmgbnh.js → components-7ans7ce5.js} +17 -17
- 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-5zry9te1.js → components-7x9kawxv.js} +26 -26
- package/dist/shared/{components-4hh0gm0v.js → components-8fpr3s4p.js} +61 -61
- package/dist/shared/{components-x2xyckd5.js → components-9jvzzvt1.js} +20 -20
- package/dist/shared/{components-bf2d9k02.js → components-apdwtweq.js} +94 -94
- package/dist/shared/{components-hjkrv00c.js → components-asr5pg50.js} +18 -18
- package/dist/shared/{components-5pkcfprd.js → components-b2wyq2cq.js} +22 -22
- package/dist/shared/{components-nn6xezy2.js → components-ca2c898n.js} +226 -226
- package/dist/shared/{components-xszag63d.js → components-cbxjn9p8.js} +12 -12
- 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-4xxtggzp.js → components-ez65vtbq.js} +18 -18
- package/dist/shared/{components-0f0as45n.js → components-ezxhrmer.js} +2 -2
- 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-ess3ch6w.js → components-h2dpcwgc.js} +23 -23
- 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-vb033rns.js → components-jjw69c4c.js} +6 -6
- package/dist/shared/{components-tad5h7ta.js → components-jwst3vtj.js} +48 -48
- package/dist/shared/{components-r22vtgqc.js → components-kvr7f9hy.js} +11 -11
- package/dist/shared/{components-gndm6am4.js → components-ng72k97e.js} +17 -17
- package/dist/shared/{components-40j34hdb.js → components-nh8tma1n.js} +116 -116
- package/dist/shared/{components-s5pkbjx1.js → components-njzgqdwy.js} +56 -56
- package/dist/shared/{components-54nf2x99.js → components-ny774h8p.js} +42 -42
- package/dist/shared/{components-r4jt6hgd.js → components-q4daerx0.js} +6 -6
- package/dist/shared/{components-peg09pzs.js → components-q5xj5c16.js} +11 -11
- package/dist/shared/{components-r43mqnd6.js → components-rr7a6ja9.js} +46 -46
- package/dist/shared/{components-bkvb6nem.js → components-s2bz1xpk.js} +11 -11
- package/dist/shared/{components-zvb11ker.js → components-tqvarbfv.js} +47 -47
- package/dist/shared/{components-aaq3yk4f.js → components-v6xp325t.js} +43 -43
- package/dist/shared/{components-v7es8aan.js → components-v7wtz8hk.js} +15 -15
- 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-gjfrycb5.js → components-yh3kwdhr.js} +63 -66
- package/dist/shared/{components-y3cqdrgy.js → components-ytb2tefr.js} +43 -43
- 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/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,50 +1,50 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
opensInPlace,
|
|
3
|
+
inPlaceOffset,
|
|
4
|
+
useMorphOrigin,
|
|
5
|
+
useMorph
|
|
6
|
+
} from "./components-hqeq3w9q.js";
|
|
4
7
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
popupScrollAreaClass,
|
|
8
|
-
popupViewportClass
|
|
9
|
-
} from "./components-jw16snbn.js";
|
|
8
|
+
cn2
|
|
9
|
+
} from "./components-ezxhrmer.js";
|
|
10
10
|
import {
|
|
11
|
-
|
|
12
|
-
} from "./components-
|
|
13
|
-
import {
|
|
14
|
-
SURFACE_BG,
|
|
15
|
-
SURFACE_SHADOW,
|
|
16
|
-
SurfaceProvider,
|
|
17
|
-
useSurface
|
|
18
|
-
} from "./components-csxz9f52.js";
|
|
11
|
+
FluidHoverHighlight2
|
|
12
|
+
} from "./components-kvr7f9hy.js";
|
|
19
13
|
import {
|
|
20
14
|
MorphSurface
|
|
21
|
-
} from "./components-
|
|
22
|
-
import {
|
|
23
|
-
FluidHoverHighlight
|
|
24
|
-
} from "./components-r22vtgqc.js";
|
|
25
|
-
import {
|
|
26
|
-
useFluidHover,
|
|
27
|
-
useRegisterFluidHoverItem
|
|
28
|
-
} from "./components-e46kf6cp.js";
|
|
15
|
+
} from "./components-0q0sqfh4.js";
|
|
29
16
|
import {
|
|
30
17
|
shapeMap,
|
|
31
18
|
useShape
|
|
32
|
-
} from "./components-
|
|
19
|
+
} from "./components-cv16mryv.js";
|
|
33
20
|
import {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
21
|
+
useSize2
|
|
22
|
+
} from "./components-0sn7ypjw.js";
|
|
23
|
+
import {
|
|
24
|
+
SURFACE_BG,
|
|
25
|
+
SURFACE_SHADOW,
|
|
26
|
+
useSurface2,
|
|
27
|
+
SurfaceProvider2
|
|
28
|
+
} from "./components-zx6b6yby.js";
|
|
39
29
|
import {
|
|
40
|
-
|
|
41
|
-
|
|
30
|
+
useFluidHover2,
|
|
31
|
+
useRegisterFluidHoverItem2
|
|
32
|
+
} from "./components-59efxjd9.js";
|
|
42
33
|
import {
|
|
43
|
-
|
|
44
|
-
} from "./components-
|
|
34
|
+
ScrollArea2
|
|
35
|
+
} from "./components-hawvy2qz.js";
|
|
36
|
+
import {
|
|
37
|
+
SizeProvider2
|
|
38
|
+
} from "./components-jjw69c4c.js";
|
|
39
|
+
import {
|
|
40
|
+
popupScrollAreaClass,
|
|
41
|
+
popupViewportClass,
|
|
42
|
+
POPUP_NAV_KEYS,
|
|
43
|
+
isDisabledRow
|
|
44
|
+
} from "./components-vynjtrk6.js";
|
|
45
45
|
import {
|
|
46
|
-
|
|
47
|
-
} from "./components-
|
|
46
|
+
spring2
|
|
47
|
+
} from "./components-1v7rxytx.js";
|
|
48
48
|
|
|
49
49
|
// components/inputs/select/index.tsx
|
|
50
50
|
import { Select as SelectPrimitive } from "@base-ui/react/select";
|
|
@@ -109,7 +109,7 @@ function collectSelectItems(node, out = []) {
|
|
|
109
109
|
});
|
|
110
110
|
return out;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function Select2({ children, value, defaultValue, onValueChange, disabled = false, name, required, size }) {
|
|
113
113
|
const [internalValue, setInternalValue] = useState(defaultValue ?? "");
|
|
114
114
|
const [open, setOpen] = useState(false);
|
|
115
115
|
const { origin, capture } = useMorphOrigin();
|
|
@@ -159,13 +159,13 @@ function Select({ children, value, defaultValue, onValueChange, disabled = false
|
|
|
159
159
|
children
|
|
160
160
|
})
|
|
161
161
|
});
|
|
162
|
-
return size ? /* @__PURE__ */ jsx(
|
|
162
|
+
return size ? /* @__PURE__ */ jsx(SizeProvider2, {
|
|
163
163
|
size,
|
|
164
164
|
children: root
|
|
165
165
|
}) : root;
|
|
166
166
|
}
|
|
167
|
-
|
|
168
|
-
var
|
|
167
|
+
Select2.displayName = "Select";
|
|
168
|
+
var triggerVariants2 = cva([
|
|
169
169
|
"group inline-flex items-center justify-between outline-none cursor-pointer",
|
|
170
170
|
"transition-all duration-fast",
|
|
171
171
|
"disabled:opacity-50 disabled:pointer-events-none",
|
|
@@ -181,9 +181,9 @@ var triggerVariants = cva([
|
|
|
181
181
|
variant: "bordered"
|
|
182
182
|
}
|
|
183
183
|
});
|
|
184
|
-
var
|
|
184
|
+
var SelectTrigger2 = forwardRef(({ className, variant, icon: Icon, placeholder = "Select…", error, size, ...props }, ref) => {
|
|
185
185
|
const shape = useShape();
|
|
186
|
-
const sizeClasses =
|
|
186
|
+
const sizeClasses = useSize2(size);
|
|
187
187
|
const compact = sizeClasses.variant === "compact";
|
|
188
188
|
return /* @__PURE__ */ jsxs("div", {
|
|
189
189
|
className: "flex flex-col gap-1",
|
|
@@ -191,11 +191,11 @@ var SelectTrigger = forwardRef(({ className, variant, icon: Icon, placeholder =
|
|
|
191
191
|
/* @__PURE__ */ jsxs(SelectPrimitive.Trigger, {
|
|
192
192
|
ref,
|
|
193
193
|
"aria-invalid": !!error || undefined,
|
|
194
|
-
className:
|
|
194
|
+
className: cn2(triggerVariants2({ variant }), sizeClasses.control, sizeClasses.text, sizeClasses.px, sizeClasses.gap, compact ? "min-w-[128px]" : "min-w-[160px]", shape.input, error && "border-destructive/50 hover:border-destructive/50", className),
|
|
195
195
|
...props,
|
|
196
196
|
children: [
|
|
197
197
|
/* @__PURE__ */ jsxs("span", {
|
|
198
|
-
className:
|
|
198
|
+
className: cn2("flex items-center min-w-0 flex-1", sizeClasses.gap),
|
|
199
199
|
children: [
|
|
200
200
|
Icon && /* @__PURE__ */ jsx(Icon, {
|
|
201
201
|
size: sizeClasses.icon,
|
|
@@ -231,15 +231,15 @@ var SelectTrigger = forwardRef(({ className, variant, icon: Icon, placeholder =
|
|
|
231
231
|
]
|
|
232
232
|
});
|
|
233
233
|
});
|
|
234
|
-
|
|
235
|
-
var
|
|
234
|
+
SelectTrigger2.displayName = "SelectTrigger";
|
|
235
|
+
var SelectContent2 = forwardRef(({ from, effect, hideSource, tier = "moderate", className, children }, ref) => {
|
|
236
236
|
const { open, value, origin } = useSelectContext();
|
|
237
237
|
const morph = useMorph(open, origin, { from, effect, hideSource, tier });
|
|
238
238
|
useImperativeHandle(ref, () => morph.popup, [morph.popup]);
|
|
239
|
-
const level = Math.min(
|
|
239
|
+
const level = Math.min(useSurface2() + 2, 8);
|
|
240
240
|
const shape = popupShape;
|
|
241
241
|
const containerRef = useRef2(null);
|
|
242
|
-
const hover =
|
|
242
|
+
const hover = useFluidHover2(containerRef, { isItemDisabled: isDisabledRow });
|
|
243
243
|
const { activeIndex, setActiveIndex, itemRects, isMeasured, handlers, registerItem, remeasure } = hover;
|
|
244
244
|
const [focusedIndex, setFocusedIndex] = useState(null);
|
|
245
245
|
const { keyboardNavRef, trackKeyboardNav } = useKeyboardNavGate(open);
|
|
@@ -312,17 +312,17 @@ var SelectContent = forwardRef(({ from, effect, hideSource, tier = "moderate", c
|
|
|
312
312
|
setActiveIndex(null);
|
|
313
313
|
},
|
|
314
314
|
className: "relative select-none outline-none",
|
|
315
|
-
children: /* @__PURE__ */ jsx(
|
|
315
|
+
children: /* @__PURE__ */ jsx(SurfaceProvider2, {
|
|
316
316
|
value: level,
|
|
317
317
|
children: /* @__PURE__ */ jsx(MorphSurface, {
|
|
318
318
|
morph,
|
|
319
319
|
bg: SURFACE_BG[level],
|
|
320
320
|
shadow: SURFACE_SHADOW[3],
|
|
321
321
|
radius: shape.container,
|
|
322
|
-
className:
|
|
323
|
-
children: /* @__PURE__ */ jsx(
|
|
322
|
+
className: cn2(`flex flex-col min-w-[var(--anchor-width)] max-h-[min(300px,var(--available-height))] overflow-hidden ${shape.container}`, className),
|
|
323
|
+
children: /* @__PURE__ */ jsx(ScrollArea2, {
|
|
324
324
|
className: popupScrollAreaClass,
|
|
325
|
-
viewportClassName:
|
|
325
|
+
viewportClassName: cn2(popupViewportClass, "scroll-fade"),
|
|
326
326
|
children: /* @__PURE__ */ jsxs("div", {
|
|
327
327
|
ref: containerRef,
|
|
328
328
|
className: "relative flex flex-col p-1",
|
|
@@ -338,14 +338,14 @@ var SelectContent = forwardRef(({ from, effect, hideSource, tier = "moderate", c
|
|
|
338
338
|
height: checkedRect.height,
|
|
339
339
|
opacity: 1
|
|
340
340
|
},
|
|
341
|
-
exit: { opacity: 0, transition:
|
|
341
|
+
exit: { opacity: 0, transition: spring2.moderate.exit },
|
|
342
342
|
transition: {
|
|
343
|
-
...
|
|
344
|
-
opacity: { duration:
|
|
343
|
+
...spring2.moderate,
|
|
344
|
+
opacity: { duration: spring2.fast.duration }
|
|
345
345
|
}
|
|
346
346
|
})
|
|
347
347
|
}),
|
|
348
|
-
/* @__PURE__ */ jsx(
|
|
348
|
+
/* @__PURE__ */ jsx(FluidHoverHighlight2, {
|
|
349
349
|
hover,
|
|
350
350
|
hidden: !open,
|
|
351
351
|
className: shape.bg
|
|
@@ -360,10 +360,10 @@ var SelectContent = forwardRef(({ from, effect, hideSource, tier = "moderate", c
|
|
|
360
360
|
width: focusRect.width + 4,
|
|
361
361
|
height: focusRect.height + 4
|
|
362
362
|
},
|
|
363
|
-
exit: { opacity: 0, transition:
|
|
363
|
+
exit: { opacity: 0, transition: spring2.fast.exit },
|
|
364
364
|
transition: {
|
|
365
|
-
...
|
|
366
|
-
opacity: { duration:
|
|
365
|
+
...spring2.fast,
|
|
366
|
+
opacity: { duration: spring2.fast.duration }
|
|
367
367
|
}
|
|
368
368
|
})
|
|
369
369
|
}),
|
|
@@ -378,20 +378,20 @@ var SelectContent = forwardRef(({ from, effect, hideSource, tier = "moderate", c
|
|
|
378
378
|
})
|
|
379
379
|
});
|
|
380
380
|
});
|
|
381
|
-
|
|
382
|
-
var
|
|
381
|
+
SelectContent2.displayName = "SelectContent";
|
|
382
|
+
var SelectItem2 = forwardRef(({ className, children, icon: Icon, value, index, disabled = false, ...props }, ref) => {
|
|
383
383
|
const selectCtx = useSelectContext();
|
|
384
384
|
const contentCtx = useContext(SelectContentContext);
|
|
385
385
|
const internalRef = useRef2(null);
|
|
386
386
|
const shape = popupShape;
|
|
387
|
-
const sizeClasses =
|
|
387
|
+
const sizeClasses = useSize2();
|
|
388
388
|
const compact = sizeClasses.variant === "compact";
|
|
389
389
|
const hasMounted = useRef2(false);
|
|
390
390
|
useEffect2(() => {
|
|
391
391
|
hasMounted.current = true;
|
|
392
392
|
}, []);
|
|
393
393
|
const registerItem = contentCtx?.registerItem;
|
|
394
|
-
|
|
394
|
+
useRegisterFluidHoverItem2(registerItem, index, internalRef);
|
|
395
395
|
const isActive = contentCtx?.activeIndex === index;
|
|
396
396
|
const isChecked = selectCtx.value === value;
|
|
397
397
|
const skipAnimation = !hasMounted.current;
|
|
@@ -409,7 +409,7 @@ var SelectItem = forwardRef(({ className, children, icon: Icon, value, index, di
|
|
|
409
409
|
},
|
|
410
410
|
"data-fluid-hover-index": index,
|
|
411
411
|
"data-value": value,
|
|
412
|
-
className:
|
|
412
|
+
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),
|
|
413
413
|
...props
|
|
414
414
|
}),
|
|
415
415
|
children: [
|
|
@@ -426,7 +426,7 @@ var SelectItem = forwardRef(({ className, children, icon: Icon, value, index, di
|
|
|
426
426
|
}),
|
|
427
427
|
/* @__PURE__ */ jsx("span", {
|
|
428
428
|
"aria-hidden": true,
|
|
429
|
-
className:
|
|
429
|
+
className: cn2("shrink-0", compact ? "w-3.5 h-3.5" : "w-4 h-4"),
|
|
430
430
|
children: /* @__PURE__ */ jsx(AnimatePresence, {
|
|
431
431
|
children: isChecked && /* @__PURE__ */ jsx(motion.svg, {
|
|
432
432
|
width: sizeClasses.icon,
|
|
@@ -446,7 +446,7 @@ var SelectItem = forwardRef(({ className, children, icon: Icon, value, index, di
|
|
|
446
446
|
initial: { pathLength: skipAnimation ? 1 : 0 },
|
|
447
447
|
animate: {
|
|
448
448
|
pathLength: 1,
|
|
449
|
-
transition: { duration:
|
|
449
|
+
transition: { duration: spring2.fast.duration, ease: "easeOut" }
|
|
450
450
|
},
|
|
451
451
|
exit: {
|
|
452
452
|
pathLength: 0,
|
|
@@ -459,8 +459,8 @@ var SelectItem = forwardRef(({ className, children, icon: Icon, value, index, di
|
|
|
459
459
|
]
|
|
460
460
|
});
|
|
461
461
|
});
|
|
462
|
-
|
|
463
|
-
function
|
|
462
|
+
SelectItem2.displayName = "SelectItem";
|
|
463
|
+
function SelectGroup2({ children, className, ...props }) {
|
|
464
464
|
return /* @__PURE__ */ jsx("div", {
|
|
465
465
|
role: "group",
|
|
466
466
|
className,
|
|
@@ -468,29 +468,29 @@ function SelectGroup({ children, className, ...props }) {
|
|
|
468
468
|
children
|
|
469
469
|
});
|
|
470
470
|
}
|
|
471
|
-
|
|
472
|
-
var
|
|
473
|
-
const compact =
|
|
471
|
+
SelectGroup2.displayName = "SelectGroup";
|
|
472
|
+
var SelectLabel2 = forwardRef(({ className, ...props }, ref) => {
|
|
473
|
+
const compact = useSize2().variant === "compact";
|
|
474
474
|
return /* @__PURE__ */ jsx("div", {
|
|
475
475
|
ref,
|
|
476
|
-
className:
|
|
476
|
+
className: cn2("px-2 py-1.5 shrink-0 text-muted-foreground", compact ? "text-caption-compact" : "text-caption", className),
|
|
477
477
|
...props
|
|
478
478
|
});
|
|
479
479
|
});
|
|
480
|
-
|
|
481
|
-
var
|
|
480
|
+
SelectLabel2.displayName = "SelectLabel";
|
|
481
|
+
var SelectSeparator2 = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", {
|
|
482
482
|
ref,
|
|
483
483
|
role: "separator",
|
|
484
|
-
className:
|
|
484
|
+
className: cn2("my-1 -mx-1 h-px shrink-0 bg-border/60", className),
|
|
485
485
|
...props
|
|
486
486
|
}));
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
var select_default =
|
|
487
|
+
SelectSeparator2.displayName = "SelectSeparator";
|
|
488
|
+
Select2.Trigger = SelectTrigger2;
|
|
489
|
+
Select2.Content = SelectContent2;
|
|
490
|
+
Select2.Item = SelectItem2;
|
|
491
|
+
Select2.Group = SelectGroup2;
|
|
492
|
+
Select2.Label = SelectLabel2;
|
|
493
|
+
Select2.Separator = SelectSeparator2;
|
|
494
|
+
var select_default = Select2;
|
|
495
495
|
|
|
496
|
-
export {
|
|
496
|
+
export { Select2, triggerVariants2, SelectTrigger2, SelectContent2, SelectItem2, SelectGroup2, SelectLabel2, SelectSeparator2, select_default };
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CommandList,
|
|
3
|
-
CommandListRoot,
|
|
4
|
-
CommandShortcut
|
|
5
|
-
} from "./components-4hh0gm0v.js";
|
|
6
1
|
import {
|
|
7
2
|
useIcon
|
|
8
|
-
} from "./components-
|
|
3
|
+
} from "./components-zrkzcayz.js";
|
|
9
4
|
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
SurfaceProvider,
|
|
13
|
-
useSurface
|
|
14
|
-
} from "./components-csxz9f52.js";
|
|
5
|
+
useReduceMotion
|
|
6
|
+
} from "./components-men63rwj.js";
|
|
15
7
|
import {
|
|
16
8
|
MorphSurface
|
|
17
|
-
} from "./components-
|
|
9
|
+
} from "./components-0q0sqfh4.js";
|
|
10
|
+
import {
|
|
11
|
+
useMorph
|
|
12
|
+
} from "./components-hqeq3w9q.js";
|
|
13
|
+
import {
|
|
14
|
+
cn2
|
|
15
|
+
} from "./components-ezxhrmer.js";
|
|
18
16
|
import {
|
|
19
17
|
shapeMap,
|
|
20
18
|
useShape
|
|
21
|
-
} from "./components-
|
|
19
|
+
} from "./components-cv16mryv.js";
|
|
22
20
|
import {
|
|
23
|
-
|
|
24
|
-
} from "./components-
|
|
25
|
-
import {
|
|
26
|
-
useMorph
|
|
27
|
-
} from "./components-7nww01w4.js";
|
|
21
|
+
useSize2
|
|
22
|
+
} from "./components-0sn7ypjw.js";
|
|
28
23
|
import {
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
SURFACE_BG,
|
|
25
|
+
SURFACE_SHADOW,
|
|
26
|
+
useSurface2,
|
|
27
|
+
SurfaceProvider2
|
|
28
|
+
} from "./components-zx6b6yby.js";
|
|
31
29
|
import {
|
|
32
|
-
|
|
33
|
-
} from "./components-
|
|
30
|
+
useControllableState
|
|
31
|
+
} from "./components-n7mjr357.js";
|
|
34
32
|
import {
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
CommandListRoot2,
|
|
34
|
+
CommandShortcut2,
|
|
35
|
+
CommandList2
|
|
36
|
+
} from "./components-8fpr3s4p.js";
|
|
37
37
|
import {
|
|
38
|
-
|
|
39
|
-
} from "./components-
|
|
38
|
+
spring2
|
|
39
|
+
} from "./components-1v7rxytx.js";
|
|
40
40
|
|
|
41
41
|
// components/inputs/search/index.tsx
|
|
42
42
|
import { Autocomplete } from "@base-ui/react/autocomplete";
|
|
@@ -48,7 +48,7 @@ var INSET = { default: "pl-2.5", compact: "pl-[7px]" };
|
|
|
48
48
|
var SQUARE = { default: "w-9", compact: "w-7" };
|
|
49
49
|
var PILL = { default: "min-w-[160px]", compact: "min-w-[128px]" };
|
|
50
50
|
var isEditable = (target) => target instanceof HTMLElement && (target.isContentEditable || target.closest("input, textarea, select") !== null);
|
|
51
|
-
function
|
|
51
|
+
function Search2({
|
|
52
52
|
variant = "pill",
|
|
53
53
|
placeholder = "Search",
|
|
54
54
|
items,
|
|
@@ -74,8 +74,8 @@ function Search({
|
|
|
74
74
|
const [rest, setRest] = useState(0);
|
|
75
75
|
const reduced = useReduceMotion();
|
|
76
76
|
const shape = useShape();
|
|
77
|
-
const size =
|
|
78
|
-
const level = Math.min(
|
|
77
|
+
const size = useSize2();
|
|
78
|
+
const level = Math.min(useSurface2() + 2, 8);
|
|
79
79
|
const SearchIcon = useIcon("search");
|
|
80
80
|
const XIcon = useIcon("x");
|
|
81
81
|
const button = useRef(null);
|
|
@@ -135,7 +135,7 @@ function Search({
|
|
|
135
135
|
placeholder,
|
|
136
136
|
"aria-label": placeholder,
|
|
137
137
|
onKeyDown,
|
|
138
|
-
className:
|
|
138
|
+
className: cn2("h-full min-w-0 flex-1 bg-transparent text-foreground outline-none placeholder:text-muted-foreground [&::-webkit-search-cancel-button]:hidden", size.text)
|
|
139
139
|
};
|
|
140
140
|
const root = /* @__PURE__ */ jsx("search", {
|
|
141
141
|
onBlur: (event) => {
|
|
@@ -143,7 +143,7 @@ function Search({
|
|
|
143
143
|
return;
|
|
144
144
|
collapse(false);
|
|
145
145
|
},
|
|
146
|
-
className:
|
|
146
|
+
className: cn2("group/search relative inline-flex shrink-0 align-middle", className),
|
|
147
147
|
children: /* @__PURE__ */ jsxs("form", {
|
|
148
148
|
className: "contents",
|
|
149
149
|
onSubmit: (event) => {
|
|
@@ -156,7 +156,7 @@ function Search({
|
|
|
156
156
|
type: "button",
|
|
157
157
|
"aria-label": placeholder,
|
|
158
158
|
onClick: expand,
|
|
159
|
-
className:
|
|
159
|
+
className: cn2("relative z-[1] flex items-center outline-none focus-visible:ring-1 focus-visible:ring-focus-ring", size.control, size.gap, size.text, shape.input, variant === "icon" ? cn2("cursor-pointer justify-center", SQUARE[size.variant]) : cn2("cursor-text pr-2.5", INSET[size.variant], PILL[size.variant]), isExpanded && "invisible"),
|
|
160
160
|
children: [
|
|
161
161
|
/* @__PURE__ */ jsx(SearchIcon, {
|
|
162
162
|
size: size.icon,
|
|
@@ -167,7 +167,7 @@ function Search({
|
|
|
167
167
|
className: "text-muted-foreground",
|
|
168
168
|
children: placeholder
|
|
169
169
|
}),
|
|
170
|
-
variant === "pill" && shortcut && /* @__PURE__ */ jsx(
|
|
170
|
+
variant === "pill" && shortcut && /* @__PURE__ */ jsx(CommandShortcut2, {
|
|
171
171
|
className: "pl-4",
|
|
172
172
|
children: shortcut
|
|
173
173
|
})
|
|
@@ -175,13 +175,13 @@ function Search({
|
|
|
175
175
|
}),
|
|
176
176
|
rest > 0 && /* @__PURE__ */ jsx(motion.div, {
|
|
177
177
|
ref: field,
|
|
178
|
-
className:
|
|
178
|
+
className: cn2("absolute top-0 h-full overflow-hidden ring-1 transition-[box-shadow] duration-moderate", align === "end" ? "right-0" : "left-0", shape.input, lifted ? cn2("z-10 ring-transparent", SURFACE_BG[level], SURFACE_SHADOW[3]) : "ring-border group-hover/search:bg-muted/50"),
|
|
179
179
|
initial: false,
|
|
180
180
|
animate: { width: isExpanded ? width : rest },
|
|
181
|
-
transition: reduced ? { duration: 0 } : isExpanded ?
|
|
181
|
+
transition: reduced ? { duration: 0 } : isExpanded ? spring2.slow : spring2.slow.exit,
|
|
182
182
|
onAnimationComplete: () => setSettled(isExpanded),
|
|
183
183
|
children: lifted && /* @__PURE__ */ jsxs("div", {
|
|
184
|
-
className:
|
|
184
|
+
className: cn2("flex h-full items-center pr-1.5", size.gap, INSET[size.variant]),
|
|
185
185
|
style: { width },
|
|
186
186
|
children: [
|
|
187
187
|
/* @__PURE__ */ jsx(SearchIcon, {
|
|
@@ -219,7 +219,7 @@ function Search({
|
|
|
219
219
|
});
|
|
220
220
|
if (!suggestions)
|
|
221
221
|
return root;
|
|
222
|
-
return /* @__PURE__ */ jsxs(
|
|
222
|
+
return /* @__PURE__ */ jsxs(CommandListRoot2, {
|
|
223
223
|
items: suggestions,
|
|
224
224
|
value: query,
|
|
225
225
|
onValueChange: setQuery,
|
|
@@ -237,7 +237,7 @@ function Search({
|
|
|
237
237
|
children: /* @__PURE__ */ jsx(Autocomplete.Popup, {
|
|
238
238
|
ref: morph.popupRef,
|
|
239
239
|
className: "relative outline-none",
|
|
240
|
-
children: /* @__PURE__ */ jsx(
|
|
240
|
+
children: /* @__PURE__ */ jsx(SurfaceProvider2, {
|
|
241
241
|
value: level,
|
|
242
242
|
children: /* @__PURE__ */ jsx(MorphSurface, {
|
|
243
243
|
morph,
|
|
@@ -245,7 +245,7 @@ function Search({
|
|
|
245
245
|
shadow: SURFACE_SHADOW[3],
|
|
246
246
|
radius: shapeMap.rounded.container,
|
|
247
247
|
className: "flex max-h-[min(300px,var(--available-height))] w-[var(--anchor-width)] flex-col overflow-hidden",
|
|
248
|
-
children: /* @__PURE__ */ jsx(
|
|
248
|
+
children: /* @__PURE__ */ jsx(CommandList2, {
|
|
249
249
|
emptyMessage,
|
|
250
250
|
onPick: (item) => onSubmit?.(item.label)
|
|
251
251
|
})
|
|
@@ -257,6 +257,6 @@ function Search({
|
|
|
257
257
|
]
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
|
-
var search_default =
|
|
260
|
+
var search_default = Search2;
|
|
261
261
|
|
|
262
|
-
export {
|
|
262
|
+
export { Search2, search_default };
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
|
-
pad
|
|
3
|
-
} from "./components-r4jt6hgd.js";
|
|
4
|
-
import {
|
|
5
|
-
PickerInput,
|
|
6
|
-
PickerShell
|
|
7
|
-
} from "./components-hzfp4tjb.js";
|
|
8
|
-
import {
|
|
9
|
-
ScrollColumn,
|
|
10
2
|
defaultLocale,
|
|
3
|
+
fieldLabel,
|
|
11
4
|
dividedColumns,
|
|
12
|
-
|
|
13
|
-
} from "./components-
|
|
5
|
+
ScrollColumn
|
|
6
|
+
} from "./components-9jvzzvt1.js";
|
|
7
|
+
import {
|
|
8
|
+
cn2
|
|
9
|
+
} from "./components-ezxhrmer.js";
|
|
14
10
|
import {
|
|
15
11
|
useControllableState
|
|
16
|
-
} from "./components-
|
|
12
|
+
} from "./components-n7mjr357.js";
|
|
13
|
+
import {
|
|
14
|
+
PickerShell,
|
|
15
|
+
PickerInput
|
|
16
|
+
} from "./components-7btqt08d.js";
|
|
17
17
|
import {
|
|
18
|
-
|
|
19
|
-
} from "./components-
|
|
18
|
+
pad
|
|
19
|
+
} from "./components-q4daerx0.js";
|
|
20
20
|
|
|
21
21
|
// components/inputs/date-time/duration-picker/index.tsx
|
|
22
22
|
import { formatDuration } from "date-fns";
|
|
23
23
|
import { useMemo, useRef } from "react";
|
|
24
24
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
25
25
|
var TYPED = /^\s*(\d{1,3})(?::(\d{1,2}))?\s*$/;
|
|
26
|
-
function
|
|
26
|
+
function DurationPicker2({
|
|
27
27
|
value: valueProp,
|
|
28
28
|
defaultValue = null,
|
|
29
29
|
onValueChange,
|
|
@@ -95,7 +95,7 @@ function DurationPicker({
|
|
|
95
95
|
tier,
|
|
96
96
|
className,
|
|
97
97
|
children: /* @__PURE__ */ jsxs("div", {
|
|
98
|
-
className:
|
|
98
|
+
className: cn2(dividedColumns, "h-56"),
|
|
99
99
|
children: [
|
|
100
100
|
/* @__PURE__ */ jsx(ScrollColumn, {
|
|
101
101
|
label: fieldLabel(locale, "hour"),
|
|
@@ -115,6 +115,6 @@ function DurationPicker({
|
|
|
115
115
|
})
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
|
-
var duration_picker_default =
|
|
118
|
+
var duration_picker_default = DurationPicker2;
|
|
119
119
|
|
|
120
|
-
export {
|
|
120
|
+
export { DurationPicker2, duration_picker_default };
|