@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,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./components-
|
|
2
|
+
cn2
|
|
3
|
+
} from "./components-ezxhrmer.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./components-
|
|
5
|
+
GooIndicator
|
|
6
|
+
} from "./components-chacnk61.js";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
} from "./components-
|
|
8
|
+
spring2
|
|
9
|
+
} from "./components-1v7rxytx.js";
|
|
10
10
|
|
|
11
11
|
// lib/fluid-hover-highlight.tsx
|
|
12
12
|
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
@@ -20,7 +20,7 @@ function resolveHighlightSource(props) {
|
|
|
20
20
|
}
|
|
21
21
|
return { rect: props.rect, session: props.session };
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function FluidHoverHighlight2(props) {
|
|
24
24
|
const { from, className, transition } = props;
|
|
25
25
|
const { rect, session } = resolveHighlightSource(props);
|
|
26
26
|
const reduceMotion = useReducedMotion() ?? false;
|
|
@@ -30,16 +30,16 @@ function FluidHoverHighlight(props) {
|
|
|
30
30
|
className: "pointer-events-none absolute top-0 left-0",
|
|
31
31
|
initial: { opacity: 0 },
|
|
32
32
|
animate: { opacity: 1 },
|
|
33
|
-
exit: { opacity: 0, transition:
|
|
33
|
+
exit: { opacity: 0, transition: spring2.fast.exit },
|
|
34
34
|
transition: fade,
|
|
35
35
|
children: /* @__PURE__ */ jsx(GooIndicator, {
|
|
36
36
|
rect,
|
|
37
37
|
from,
|
|
38
|
-
className:
|
|
39
|
-
transition: transition === false || reduceMotion ? false : transition ??
|
|
38
|
+
className: cn2("bg-hover", className),
|
|
39
|
+
transition: transition === false || reduceMotion ? false : transition ?? spring2.fast
|
|
40
40
|
})
|
|
41
41
|
}, session)
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
export {
|
|
45
|
+
export { FluidHoverHighlight2 };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MorphSurface
|
|
3
|
-
} from "./components-
|
|
3
|
+
} from "./components-0q0sqfh4.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
useMorphOrigin,
|
|
6
|
+
useMorph
|
|
7
|
+
} from "./components-hqeq3w9q.js";
|
|
7
8
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} from "./components-7nww01w4.js";
|
|
9
|
+
cn2
|
|
10
|
+
} from "./components-ezxhrmer.js";
|
|
11
11
|
import {
|
|
12
|
-
|
|
13
|
-
} from "./components-
|
|
12
|
+
useShape
|
|
13
|
+
} from "./components-cv16mryv.js";
|
|
14
14
|
|
|
15
15
|
// components/overlays/tooltip/index.tsx
|
|
16
16
|
import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip";
|
|
@@ -18,7 +18,7 @@ import { motion, useMotionValue } from "motion/react";
|
|
|
18
18
|
import { createContext, useContext, useEffect, useRef, useState } from "react";
|
|
19
19
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
20
20
|
var TooltipPortalContainerContext = createContext(null);
|
|
21
|
-
function
|
|
21
|
+
function TooltipPortalContainer2({ value, children }) {
|
|
22
22
|
return /* @__PURE__ */ jsx(TooltipPortalContainerContext.Provider, {
|
|
23
23
|
value,
|
|
24
24
|
children
|
|
@@ -26,7 +26,7 @@ function TooltipPortalContainer({ value, children }) {
|
|
|
26
26
|
}
|
|
27
27
|
var DEFAULT_DELAY = 200;
|
|
28
28
|
var TooltipGroupContext = createContext(false);
|
|
29
|
-
function
|
|
29
|
+
function TooltipProvider2({ children, delayDuration = DEFAULT_DELAY, skipDelayDuration = 300 }) {
|
|
30
30
|
return /* @__PURE__ */ jsx(TooltipGroupContext.Provider, {
|
|
31
31
|
value: true,
|
|
32
32
|
children: /* @__PURE__ */ jsx(TooltipPrimitive.Provider, {
|
|
@@ -36,7 +36,7 @@ function TooltipProvider({ children, delayDuration = DEFAULT_DELAY, skipDelayDur
|
|
|
36
36
|
})
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function Tooltip2({
|
|
40
40
|
content,
|
|
41
41
|
children,
|
|
42
42
|
side = "top",
|
|
@@ -95,7 +95,7 @@ function Tooltip({
|
|
|
95
95
|
children: /* @__PURE__ */ jsx(TooltipPrimitive.Positioner, {
|
|
96
96
|
side,
|
|
97
97
|
sideOffset,
|
|
98
|
-
className:
|
|
98
|
+
className: cn2("z-50", contentClassName),
|
|
99
99
|
children: /* @__PURE__ */ jsx(TooltipPrimitive.Popup, {
|
|
100
100
|
ref: morph.popupRef,
|
|
101
101
|
className: "relative outline-none",
|
|
@@ -106,7 +106,7 @@ function Tooltip({
|
|
|
106
106
|
morph,
|
|
107
107
|
bg: "bg-foreground",
|
|
108
108
|
radius: shape.bg,
|
|
109
|
-
className:
|
|
109
|
+
className: cn2("text-background text-caption px-2 py-1", "[text-box:trim-both_cap_alphabetic] supports-[text-box:trim-both]:py-2", "weight-medium", className),
|
|
110
110
|
children: content
|
|
111
111
|
})
|
|
112
112
|
})
|
|
@@ -121,8 +121,8 @@ function Tooltip({
|
|
|
121
121
|
children: tooltip
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
var tooltip_default =
|
|
124
|
+
Tooltip2.Provider = TooltipProvider2;
|
|
125
|
+
Tooltip2.PortalContainer = TooltipPortalContainer2;
|
|
126
|
+
var tooltip_default = Tooltip2;
|
|
127
127
|
|
|
128
|
-
export {
|
|
128
|
+
export { TooltipPortalContainer2, TooltipProvider2, Tooltip2, tooltip_default };
|
|
@@ -1,62 +1,62 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
opensInPlace,
|
|
3
|
+
inPlaceOffset,
|
|
4
|
+
useMorphOrigin,
|
|
5
|
+
useMorph
|
|
6
|
+
} from "./components-hqeq3w9q.js";
|
|
4
7
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
useSelectionRuns
|
|
8
|
-
} from "./components-rc63qsy6.js";
|
|
8
|
+
cn2
|
|
9
|
+
} from "./components-ezxhrmer.js";
|
|
9
10
|
import {
|
|
10
|
-
|
|
11
|
-
} from "./components-
|
|
11
|
+
FluidHoverHighlight2
|
|
12
|
+
} from "./components-kvr7f9hy.js";
|
|
12
13
|
import {
|
|
13
|
-
|
|
14
|
-
} from "./components-
|
|
14
|
+
MorphSurface
|
|
15
|
+
} from "./components-0q0sqfh4.js";
|
|
15
16
|
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
popupViewportClass
|
|
19
|
-
} from "./components-jw16snbn.js";
|
|
17
|
+
shapeMap
|
|
18
|
+
} from "./components-cv16mryv.js";
|
|
20
19
|
import {
|
|
21
|
-
|
|
22
|
-
} from "./components-
|
|
20
|
+
useSize2
|
|
21
|
+
} from "./components-0sn7ypjw.js";
|
|
23
22
|
import {
|
|
24
23
|
SURFACE_BG,
|
|
25
24
|
SURFACE_SHADOW,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} from "./components-
|
|
25
|
+
useSurface2,
|
|
26
|
+
SurfaceProvider2
|
|
27
|
+
} from "./components-zx6b6yby.js";
|
|
29
28
|
import {
|
|
30
|
-
|
|
31
|
-
} from "./components-
|
|
29
|
+
useControllableState
|
|
30
|
+
} from "./components-n7mjr357.js";
|
|
32
31
|
import {
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
useFluidHover2,
|
|
33
|
+
useRegisterFluidHoverItem2
|
|
34
|
+
} from "./components-59efxjd9.js";
|
|
35
35
|
import {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
useSelectionRuns,
|
|
37
|
+
useMergeSplitBlocks,
|
|
38
|
+
SelectionBackgrounds
|
|
39
|
+
} from "./components-5xc2j8jz.js";
|
|
39
40
|
import {
|
|
40
|
-
|
|
41
|
-
} from "./components-
|
|
41
|
+
ScrollArea2
|
|
42
|
+
} from "./components-hawvy2qz.js";
|
|
42
43
|
import {
|
|
43
|
-
|
|
44
|
-
} from "./components-
|
|
44
|
+
SizeProvider2
|
|
45
|
+
} from "./components-jjw69c4c.js";
|
|
45
46
|
import {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
useMorph,
|
|
49
|
-
useMorphOrigin
|
|
50
|
-
} from "./components-7nww01w4.js";
|
|
47
|
+
Elevated2
|
|
48
|
+
} from "./components-vc7vq5nz.js";
|
|
51
49
|
import {
|
|
52
|
-
|
|
53
|
-
} from "./components-
|
|
50
|
+
useIcon
|
|
51
|
+
} from "./components-zrkzcayz.js";
|
|
54
52
|
import {
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
popupScrollAreaClass,
|
|
54
|
+
popupViewportClass,
|
|
55
|
+
isDisabledRow
|
|
56
|
+
} from "./components-vynjtrk6.js";
|
|
57
57
|
import {
|
|
58
|
-
|
|
59
|
-
} from "./components-
|
|
58
|
+
spring2
|
|
59
|
+
} from "./components-1v7rxytx.js";
|
|
60
60
|
|
|
61
61
|
// components/overlays/dropdown/index.tsx
|
|
62
62
|
import { Menu } from "@base-ui/react/menu";
|
|
@@ -149,7 +149,7 @@ function useDropdownSearchHost(open, { containerRef, setActiveIndex }) {
|
|
|
149
149
|
highlightFirst
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
|
-
var
|
|
152
|
+
var DropdownSearch2 = forwardRef(({
|
|
153
153
|
value,
|
|
154
154
|
onValueChange,
|
|
155
155
|
filter = false,
|
|
@@ -161,7 +161,7 @@ var DropdownSearch = forwardRef(({
|
|
|
161
161
|
...props
|
|
162
162
|
}, ref) => {
|
|
163
163
|
const SearchIcon = useIcon("search");
|
|
164
|
-
const sizeClasses =
|
|
164
|
+
const sizeClasses = useSize2();
|
|
165
165
|
const compact = sizeClasses.variant === "compact";
|
|
166
166
|
const host = useContext(DropdownSearchHostContext);
|
|
167
167
|
const open = host?.open ?? true;
|
|
@@ -172,7 +172,7 @@ var DropdownSearch = forwardRef(({
|
|
|
172
172
|
managed?.setQuery(next);
|
|
173
173
|
onValueChange?.(next);
|
|
174
174
|
}, [managed, onValueChange]);
|
|
175
|
-
const surface =
|
|
175
|
+
const surface = useSurface2();
|
|
176
176
|
const inputRef = useRef(null);
|
|
177
177
|
const valueRef = useRef(query);
|
|
178
178
|
valueRef.current = query;
|
|
@@ -238,7 +238,7 @@ var DropdownSearch = forwardRef(({
|
|
|
238
238
|
}
|
|
239
239
|
};
|
|
240
240
|
return /* @__PURE__ */ jsxs("div", {
|
|
241
|
-
className:
|
|
241
|
+
className: cn2("group/search sticky top-0 z-20 -mx-1 -mt-1 mb-0.5 flex shrink-0 items-center border-b border-border/60", SURFACE_BG[surface], sizeClasses.control, sizeClasses.gap, compact ? "px-2.5" : "px-3", className),
|
|
242
242
|
children: [
|
|
243
243
|
/* @__PURE__ */ jsx(SearchIcon, {
|
|
244
244
|
size: sizeClasses.icon,
|
|
@@ -262,24 +262,24 @@ var DropdownSearch = forwardRef(({
|
|
|
262
262
|
onChange: (e) => setQuery(e.target.value),
|
|
263
263
|
onKeyDown: handleKeyDown,
|
|
264
264
|
placeholder,
|
|
265
|
-
className:
|
|
265
|
+
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"),
|
|
266
266
|
...props
|
|
267
267
|
})
|
|
268
268
|
]
|
|
269
269
|
});
|
|
270
270
|
});
|
|
271
|
-
|
|
272
|
-
var
|
|
273
|
-
const sizeClasses =
|
|
271
|
+
DropdownSearch2.displayName = "DropdownSearch";
|
|
272
|
+
var DropdownEmpty2 = forwardRef(({ className, ...props }, ref) => {
|
|
273
|
+
const sizeClasses = useSize2();
|
|
274
274
|
return /* @__PURE__ */ jsx("div", {
|
|
275
275
|
ref,
|
|
276
276
|
role: "status",
|
|
277
277
|
"aria-live": "polite",
|
|
278
|
-
className:
|
|
278
|
+
className: cn2("px-2 py-6 text-center text-muted-foreground", sizeClasses.text, className),
|
|
279
279
|
...props
|
|
280
280
|
});
|
|
281
281
|
});
|
|
282
|
-
|
|
282
|
+
DropdownEmpty2.displayName = "DropdownEmpty";
|
|
283
283
|
|
|
284
284
|
// components/overlays/dropdown/menu-item.tsx
|
|
285
285
|
import { AnimatePresence, motion } from "motion/react";
|
|
@@ -293,16 +293,16 @@ import {
|
|
|
293
293
|
import { jsx as jsx2, jsxs as jsxs2, Fragment } from "react/jsx-runtime";
|
|
294
294
|
var shape = shapeMap.rounded;
|
|
295
295
|
var DropdownContext = createContext2(null);
|
|
296
|
-
function
|
|
296
|
+
function useDropdown2() {
|
|
297
297
|
const ctx = useContext2(DropdownContext);
|
|
298
298
|
if (!ctx)
|
|
299
299
|
throw new Error("useDropdown must be used within a Dropdown");
|
|
300
300
|
return ctx;
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function useDropdownMaybe2() {
|
|
303
303
|
return useContext2(DropdownContext);
|
|
304
304
|
}
|
|
305
|
-
var
|
|
305
|
+
var MenuItem2 = forwardRef2(({ icon: Icon, label, index, checked, onSelect, disabled, closeOnClick, sourceIndex, className, onClick, ...props }, ref) => {
|
|
306
306
|
const internalRef = useRef2(null);
|
|
307
307
|
const hasMounted = useRef2(false);
|
|
308
308
|
const {
|
|
@@ -314,17 +314,17 @@ var MenuItem = forwardRef2(({ icon: Icon, label, index, checked, onSelect, disab
|
|
|
314
314
|
renderMenuItem,
|
|
315
315
|
selfManaged,
|
|
316
316
|
toggleIndex
|
|
317
|
-
} =
|
|
317
|
+
} = useDropdown2();
|
|
318
318
|
const panelChecked = multiple ? checkedIndices?.includes(index) ?? false : checkedIndex === index;
|
|
319
319
|
const isChecked = checked ?? (selfManaged ? panelChecked : undefined);
|
|
320
320
|
const isCheckbox = !!multiple && typeof isChecked === "boolean";
|
|
321
|
-
|
|
321
|
+
useRegisterFluidHoverItem2(registerItem, index, internalRef);
|
|
322
322
|
useEffect2(() => {
|
|
323
323
|
hasMounted.current = true;
|
|
324
324
|
}, []);
|
|
325
325
|
const isActive = activeIndex === index;
|
|
326
326
|
const skipAnimation = !hasMounted.current;
|
|
327
|
-
const sizeClasses =
|
|
327
|
+
const sizeClasses = useSize2();
|
|
328
328
|
const mergeRef = (node) => {
|
|
329
329
|
internalRef.current = node;
|
|
330
330
|
if (typeof ref === "function")
|
|
@@ -341,7 +341,7 @@ var MenuItem = forwardRef2(({ icon: Icon, label, index, checked, onSelect, disab
|
|
|
341
341
|
onClick?.(e);
|
|
342
342
|
activate();
|
|
343
343
|
};
|
|
344
|
-
const itemClassName =
|
|
344
|
+
const itemClassName = cn2(`relative z-10 flex ${sizeClasses.control} shrink-0 items-center ${sizeClasses.gap} ${shape.item} ${sizeClasses.itemPx} cursor-pointer outline-none`, disabled && "opacity-50 pointer-events-none", className);
|
|
345
345
|
const content = /* @__PURE__ */ jsxs2(Fragment, {
|
|
346
346
|
children: [
|
|
347
347
|
Icon && /* @__PURE__ */ jsxs2("span", {
|
|
@@ -357,12 +357,12 @@ var MenuItem = forwardRef2(({ icon: Icon, label, index, checked, onSelect, disab
|
|
|
357
357
|
/* @__PURE__ */ jsx2(Icon, {
|
|
358
358
|
size: sizeClasses.icon,
|
|
359
359
|
strokeWidth: isActive || isChecked ? 2 : 1.5,
|
|
360
|
-
className:
|
|
360
|
+
className: cn2("col-start-1 row-start-1 transition-[color,stroke-width] duration-fast", isActive || isChecked ? "text-foreground" : "text-muted-foreground")
|
|
361
361
|
})
|
|
362
362
|
]
|
|
363
363
|
}),
|
|
364
364
|
/* @__PURE__ */ jsxs2("span", {
|
|
365
|
-
className:
|
|
365
|
+
className: cn2("inline-grid flex-1", sizeClasses.text),
|
|
366
366
|
children: [
|
|
367
367
|
/* @__PURE__ */ jsx2("span", {
|
|
368
368
|
className: "col-start-1 row-start-1 invisible [text-box:trim-both_cap_alphabetic] weight-semibold",
|
|
@@ -370,7 +370,7 @@ var MenuItem = forwardRef2(({ icon: Icon, label, index, checked, onSelect, disab
|
|
|
370
370
|
children: label
|
|
371
371
|
}),
|
|
372
372
|
/* @__PURE__ */ jsx2("span", {
|
|
373
|
-
className:
|
|
373
|
+
className: cn2("col-start-1 row-start-1 transition-[color,font-variation-settings] duration-fast [text-box:trim-both_cap_alphabetic]", isActive || isChecked ? "text-foreground" : "text-muted-foreground", isChecked ? "weight-semibold" : "weight-normal"),
|
|
374
374
|
children: label
|
|
375
375
|
})
|
|
376
376
|
]
|
|
@@ -394,7 +394,7 @@ var MenuItem = forwardRef2(({ icon: Icon, label, index, checked, onSelect, disab
|
|
|
394
394
|
initial: { pathLength: skipAnimation ? 1 : 0 },
|
|
395
395
|
animate: {
|
|
396
396
|
pathLength: 1,
|
|
397
|
-
transition: { duration:
|
|
397
|
+
transition: { duration: spring2.fast.duration, ease: "easeOut" }
|
|
398
398
|
},
|
|
399
399
|
exit: {
|
|
400
400
|
pathLength: 0,
|
|
@@ -447,7 +447,7 @@ var MenuItem = forwardRef2(({ icon: Icon, label, index, checked, onSelect, disab
|
|
|
447
447
|
children: content
|
|
448
448
|
});
|
|
449
449
|
});
|
|
450
|
-
|
|
450
|
+
MenuItem2.displayName = "MenuItem";
|
|
451
451
|
|
|
452
452
|
// components/overlays/dropdown/index.tsx
|
|
453
453
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
@@ -497,7 +497,7 @@ function usePanelSelection({
|
|
|
497
497
|
}
|
|
498
498
|
function usePanelRows(children) {
|
|
499
499
|
const [query, setQuery] = useState2("");
|
|
500
|
-
const filtering = useMemo2(() => Children.toArray(children).some((child) => isValidElement(child) && child.type ===
|
|
500
|
+
const filtering = useMemo2(() => Children.toArray(children).some((child) => isValidElement(child) && child.type === DropdownSearch2 && child.props.filter), [children]);
|
|
501
501
|
const filterCtx = useMemo2(() => ({ query, setQuery }), [query]);
|
|
502
502
|
const { content, sourceOf } = useMemo2(() => {
|
|
503
503
|
if (!filtering)
|
|
@@ -511,7 +511,7 @@ function usePanelRows(children) {
|
|
|
511
511
|
rendered.push(child);
|
|
512
512
|
continue;
|
|
513
513
|
}
|
|
514
|
-
if (child.type ===
|
|
514
|
+
if (child.type === DropdownEmpty2) {
|
|
515
515
|
empties.push(child);
|
|
516
516
|
continue;
|
|
517
517
|
}
|
|
@@ -534,7 +534,7 @@ function usePanelRows(children) {
|
|
|
534
534
|
}, [children, filtering, query]);
|
|
535
535
|
return { content, sourceOf, filtering, filterCtx: filtering ? filterCtx : null };
|
|
536
536
|
}
|
|
537
|
-
var
|
|
537
|
+
var Dropdown2 = forwardRef3(({
|
|
538
538
|
children,
|
|
539
539
|
checkedIndex,
|
|
540
540
|
defaultCheckedIndex,
|
|
@@ -547,7 +547,7 @@ var Dropdown = forwardRef3(({
|
|
|
547
547
|
...props
|
|
548
548
|
}, ref) => {
|
|
549
549
|
const containerRef = useRef3(null);
|
|
550
|
-
const hover =
|
|
550
|
+
const hover = useFluidHover2(containerRef, { isItemDisabled: isDisabledRow });
|
|
551
551
|
const { activeIndex, setActiveIndex, itemRects, handlers, registerItem } = hover;
|
|
552
552
|
const [focusedIndex, setFocusedIndex] = useState2(null);
|
|
553
553
|
const rows = usePanelRows(children);
|
|
@@ -585,7 +585,7 @@ var Dropdown = forwardRef3(({
|
|
|
585
585
|
value: panelCtx,
|
|
586
586
|
children: /* @__PURE__ */ jsx3(DropdownFilterContext.Provider, {
|
|
587
587
|
value: rows.filterCtx,
|
|
588
|
-
children: /* @__PURE__ */ jsxs3(
|
|
588
|
+
children: /* @__PURE__ */ jsxs3(Elevated2, {
|
|
589
589
|
offset: 2,
|
|
590
590
|
shadowLevel: 3,
|
|
591
591
|
ref: (node) => {
|
|
@@ -631,7 +631,7 @@ var Dropdown = forwardRef3(({
|
|
|
631
631
|
}
|
|
632
632
|
},
|
|
633
633
|
role: "group",
|
|
634
|
-
className:
|
|
634
|
+
className: cn2(`relative flex flex-col w-72 max-w-full p-1 select-none`, className),
|
|
635
635
|
...props,
|
|
636
636
|
children: [
|
|
637
637
|
multiple && /* @__PURE__ */ jsx3(SelectionBackgrounds, {
|
|
@@ -648,14 +648,14 @@ var Dropdown = forwardRef3(({
|
|
|
648
648
|
height: checkedRect.height,
|
|
649
649
|
opacity: 1
|
|
650
650
|
},
|
|
651
|
-
exit: { opacity: 0, transition:
|
|
651
|
+
exit: { opacity: 0, transition: spring2.moderate.exit },
|
|
652
652
|
transition: {
|
|
653
|
-
...
|
|
654
|
-
opacity: { duration:
|
|
653
|
+
...spring2.moderate,
|
|
654
|
+
opacity: { duration: spring2.fast.duration }
|
|
655
655
|
}
|
|
656
656
|
})
|
|
657
657
|
}),
|
|
658
|
-
/* @__PURE__ */ jsx3(
|
|
658
|
+
/* @__PURE__ */ jsx3(FluidHoverHighlight2, {
|
|
659
659
|
hover,
|
|
660
660
|
from: checkedRect,
|
|
661
661
|
className: shape2.bg
|
|
@@ -670,10 +670,10 @@ var Dropdown = forwardRef3(({
|
|
|
670
670
|
width: focusRect.width + 4,
|
|
671
671
|
height: focusRect.height + 4
|
|
672
672
|
},
|
|
673
|
-
exit: { opacity: 0, transition:
|
|
673
|
+
exit: { opacity: 0, transition: spring2.fast.exit },
|
|
674
674
|
transition: {
|
|
675
|
-
...
|
|
676
|
-
opacity: { duration:
|
|
675
|
+
...spring2.fast,
|
|
676
|
+
opacity: { duration: spring2.fast.duration }
|
|
677
677
|
}
|
|
678
678
|
})
|
|
679
679
|
}),
|
|
@@ -682,12 +682,12 @@ var Dropdown = forwardRef3(({
|
|
|
682
682
|
})
|
|
683
683
|
})
|
|
684
684
|
});
|
|
685
|
-
return size ? /* @__PURE__ */ jsx3(
|
|
685
|
+
return size ? /* @__PURE__ */ jsx3(SizeProvider2, {
|
|
686
686
|
size,
|
|
687
687
|
children: panel
|
|
688
688
|
}) : panel;
|
|
689
689
|
});
|
|
690
|
-
|
|
690
|
+
Dropdown2.displayName = "Dropdown";
|
|
691
691
|
var DropdownMenuContext = createContext3(null);
|
|
692
692
|
function useDropdownMenuContext() {
|
|
693
693
|
const ctx = useContext3(DropdownMenuContext);
|
|
@@ -695,7 +695,7 @@ function useDropdownMenuContext() {
|
|
|
695
695
|
throw new Error("DropdownMenu compound components must be inside <DropdownMenu>");
|
|
696
696
|
return ctx;
|
|
697
697
|
}
|
|
698
|
-
function
|
|
698
|
+
function DropdownMenu2({
|
|
699
699
|
children,
|
|
700
700
|
open: openProp,
|
|
701
701
|
defaultOpen = false,
|
|
@@ -724,14 +724,14 @@ function DropdownMenu({
|
|
|
724
724
|
children
|
|
725
725
|
})
|
|
726
726
|
});
|
|
727
|
-
return size ? /* @__PURE__ */ jsx3(
|
|
727
|
+
return size ? /* @__PURE__ */ jsx3(SizeProvider2, {
|
|
728
728
|
size,
|
|
729
729
|
children: root
|
|
730
730
|
}) : root;
|
|
731
731
|
}
|
|
732
|
-
|
|
733
|
-
var
|
|
734
|
-
var
|
|
732
|
+
DropdownMenu2.displayName = "DropdownMenu";
|
|
733
|
+
var DropdownTrigger2 = Menu.Trigger;
|
|
734
|
+
var DropdownContent2 = forwardRef3(({
|
|
735
735
|
className,
|
|
736
736
|
children,
|
|
737
737
|
checkedIndex,
|
|
@@ -751,9 +751,9 @@ var DropdownContent = forwardRef3(({
|
|
|
751
751
|
const { open, origin } = useDropdownMenuContext();
|
|
752
752
|
const morph = useMorph(open, origin, { from, effect, hideSource, tier });
|
|
753
753
|
useImperativeHandle(ref, () => morph.popup, [morph.popup]);
|
|
754
|
-
const level = Math.min(
|
|
754
|
+
const level = Math.min(useSurface2() + 2, 8);
|
|
755
755
|
const containerRef = useRef3(null);
|
|
756
|
-
const hover =
|
|
756
|
+
const hover = useFluidHover2(containerRef, { isItemDisabled: isDisabledRow });
|
|
757
757
|
const { activeIndex, setActiveIndex, itemRects, handlers, registerItem, remeasure } = hover;
|
|
758
758
|
const rows = usePanelRows(children);
|
|
759
759
|
const selection = usePanelSelection({
|
|
@@ -812,7 +812,7 @@ var DropdownContent = forwardRef3(({
|
|
|
812
812
|
closeOnClick,
|
|
813
813
|
onClick,
|
|
814
814
|
element,
|
|
815
|
-
children
|
|
815
|
+
children
|
|
816
816
|
}) => checkbox ? /* @__PURE__ */ jsx3(Menu.CheckboxItem, {
|
|
817
817
|
checked: !!checked,
|
|
818
818
|
disabled,
|
|
@@ -820,7 +820,7 @@ var DropdownContent = forwardRef3(({
|
|
|
820
820
|
closeOnClick,
|
|
821
821
|
onClick,
|
|
822
822
|
render: element,
|
|
823
|
-
children
|
|
823
|
+
children
|
|
824
824
|
}) : radio ? /* @__PURE__ */ jsx3(Menu.RadioItem, {
|
|
825
825
|
value,
|
|
826
826
|
disabled,
|
|
@@ -828,14 +828,14 @@ var DropdownContent = forwardRef3(({
|
|
|
828
828
|
closeOnClick,
|
|
829
829
|
onClick,
|
|
830
830
|
render: element,
|
|
831
|
-
children
|
|
831
|
+
children
|
|
832
832
|
}) : /* @__PURE__ */ jsx3(Menu.Item, {
|
|
833
833
|
disabled,
|
|
834
834
|
label,
|
|
835
835
|
closeOnClick,
|
|
836
836
|
onClick,
|
|
837
837
|
render: element,
|
|
838
|
-
children
|
|
838
|
+
children
|
|
839
839
|
}), []);
|
|
840
840
|
const contentCtx = useMemo2(() => ({
|
|
841
841
|
registerItem,
|
|
@@ -896,17 +896,17 @@ var DropdownContent = forwardRef3(({
|
|
|
896
896
|
setActiveIndex(null);
|
|
897
897
|
},
|
|
898
898
|
className: "relative select-none outline-none",
|
|
899
|
-
children: /* @__PURE__ */ jsx3(
|
|
899
|
+
children: /* @__PURE__ */ jsx3(SurfaceProvider2, {
|
|
900
900
|
value: level,
|
|
901
901
|
children: /* @__PURE__ */ jsx3(MorphSurface, {
|
|
902
902
|
morph,
|
|
903
903
|
bg: SURFACE_BG[level],
|
|
904
904
|
shadow: SURFACE_SHADOW[3],
|
|
905
905
|
radius: shape2.container,
|
|
906
|
-
className:
|
|
907
|
-
children: /* @__PURE__ */ jsx3(
|
|
906
|
+
className: cn2(`flex flex-col w-72 max-w-full min-w-[var(--anchor-width)] max-h-[min(480px,var(--available-height))] overflow-hidden ${shape2.container}`, className),
|
|
907
|
+
children: /* @__PURE__ */ jsx3(ScrollArea2, {
|
|
908
908
|
className: popupScrollAreaClass,
|
|
909
|
-
viewportClassName:
|
|
909
|
+
viewportClassName: cn2(popupViewportClass, !searchMounted && "scroll-fade"),
|
|
910
910
|
children: /* @__PURE__ */ jsxs3("div", {
|
|
911
911
|
ref: containerRef,
|
|
912
912
|
className: "relative flex flex-col p-1",
|
|
@@ -925,14 +925,14 @@ var DropdownContent = forwardRef3(({
|
|
|
925
925
|
height: checkedRect.height,
|
|
926
926
|
opacity: 1
|
|
927
927
|
},
|
|
928
|
-
exit: { opacity: 0, transition:
|
|
928
|
+
exit: { opacity: 0, transition: spring2.moderate.exit },
|
|
929
929
|
transition: {
|
|
930
|
-
...
|
|
931
|
-
opacity: { duration:
|
|
930
|
+
...spring2.moderate,
|
|
931
|
+
opacity: { duration: spring2.fast.duration }
|
|
932
932
|
}
|
|
933
933
|
})
|
|
934
934
|
}),
|
|
935
|
-
/* @__PURE__ */ jsx3(
|
|
935
|
+
/* @__PURE__ */ jsx3(FluidHoverHighlight2, {
|
|
936
936
|
hover,
|
|
937
937
|
from: checkedRect,
|
|
938
938
|
className: shape2.bg
|
|
@@ -954,33 +954,33 @@ var DropdownContent = forwardRef3(({
|
|
|
954
954
|
})
|
|
955
955
|
});
|
|
956
956
|
});
|
|
957
|
-
|
|
958
|
-
var
|
|
959
|
-
const compact =
|
|
957
|
+
DropdownContent2.displayName = "DropdownContent";
|
|
958
|
+
var DropdownLabel2 = forwardRef3(({ className, ...props }, ref) => {
|
|
959
|
+
const compact = useSize2().variant === "compact";
|
|
960
960
|
return /* @__PURE__ */ jsx3("div", {
|
|
961
961
|
ref,
|
|
962
|
-
className:
|
|
962
|
+
className: cn2("px-2 py-1.5 shrink-0 text-muted-foreground", compact ? "text-caption-compact" : "text-caption", className),
|
|
963
963
|
...props
|
|
964
964
|
});
|
|
965
965
|
});
|
|
966
|
-
|
|
967
|
-
var
|
|
966
|
+
DropdownLabel2.displayName = "DropdownLabel";
|
|
967
|
+
var DropdownSeparator2 = forwardRef3(({ className, ...props }, ref) => /* @__PURE__ */ jsx3("div", {
|
|
968
968
|
ref,
|
|
969
969
|
role: "separator",
|
|
970
|
-
className:
|
|
970
|
+
className: cn2("my-1 -mx-1 h-px shrink-0 bg-border/60", className),
|
|
971
971
|
...props
|
|
972
972
|
}));
|
|
973
|
-
|
|
974
|
-
Object.assign(
|
|
975
|
-
Menu:
|
|
976
|
-
Trigger:
|
|
977
|
-
Content:
|
|
978
|
-
Item:
|
|
979
|
-
Label:
|
|
980
|
-
Separator:
|
|
981
|
-
Search:
|
|
982
|
-
Empty:
|
|
973
|
+
DropdownSeparator2.displayName = "DropdownSeparator";
|
|
974
|
+
Object.assign(Dropdown2, {
|
|
975
|
+
Menu: DropdownMenu2,
|
|
976
|
+
Trigger: DropdownTrigger2,
|
|
977
|
+
Content: DropdownContent2,
|
|
978
|
+
Item: MenuItem2,
|
|
979
|
+
Label: DropdownLabel2,
|
|
980
|
+
Separator: DropdownSeparator2,
|
|
981
|
+
Search: DropdownSearch2,
|
|
982
|
+
Empty: DropdownEmpty2
|
|
983
983
|
});
|
|
984
|
-
var dropdown_default =
|
|
984
|
+
var dropdown_default = Dropdown2;
|
|
985
985
|
|
|
986
|
-
export {
|
|
986
|
+
export { DropdownSearch2, DropdownEmpty2, DropdownContext, useDropdown2, useDropdownMaybe2, MenuItem2, Dropdown2, DropdownMenu2, DropdownTrigger2, DropdownContent2, DropdownLabel2, DropdownSeparator2, dropdown_default };
|