@justanarthur/modo-ui 2.5.0 → 2.6.1
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/blocks/desktop-shell/index.tsx +3 -2
- package/components/data-display/diff/index.tsx +5 -4
- package/components/data-display/markdown/index.tsx +6 -6
- package/components/inputs/editable-text/index.tsx +7 -2
- package/components/navigation/tabs/list.tsx +1 -5
- package/dist/blocks/desktop-shell/index.js +27 -27
- package/dist/blocks/sidebar-app/index.js +37 -37
- package/dist/components/actions/button/index.js +4 -4
- package/dist/components/actions/copy/index.js +12 -12
- package/dist/components/containers/accordion/index.js +16 -16
- package/dist/components/containers/card/index.js +14 -14
- package/dist/components/data-display/avatar/index.js +3 -3
- package/dist/components/data-display/badge/index.js +2 -2
- package/dist/components/data-display/diff/index.d.ts +2 -1
- package/dist/components/data-display/diff/index.js +5 -4
- package/dist/components/data-display/list/index.js +3 -3
- package/dist/components/data-display/log-view/index.js +8 -8
- package/dist/components/data-display/markdown/index.js +16 -16
- package/dist/components/data-display/table/index.js +10 -10
- package/dist/components/feedback/empty-state/index.js +3 -3
- package/dist/components/feedback/meter/index.js +2 -2
- package/dist/components/feedback/progress/index.js +2 -2
- package/dist/components/inputs/checkbox/index.js +13 -13
- package/dist/components/inputs/choice-list/index.js +10 -10
- package/dist/components/inputs/color-picker/index.js +22 -22
- package/dist/components/inputs/combobox/index.js +22 -21
- package/dist/components/inputs/date-time/calendar/index.js +9 -9
- package/dist/components/inputs/date-time/date-picker/index.js +28 -28
- package/dist/components/inputs/date-time/date-range-picker/index.js +28 -28
- package/dist/components/inputs/date-time/duration-picker/index.js +27 -27
- package/dist/components/inputs/date-time/month-picker/index.js +26 -26
- package/dist/components/inputs/date-time/time-picker/index.js +27 -27
- package/dist/components/inputs/editable-text/index.d.ts +4 -1
- package/dist/components/inputs/editable-text/index.js +2 -2
- package/dist/components/inputs/field/index.js +5 -5
- package/dist/components/inputs/file-dropzone/index.js +8 -8
- package/dist/components/inputs/input/index.js +6 -6
- package/dist/components/inputs/key-value/index.js +12 -12
- package/dist/components/inputs/number-input/index.js +7 -7
- package/dist/components/inputs/radio/index.js +12 -12
- package/dist/components/inputs/search/index.js +24 -23
- package/dist/components/inputs/select/index.js +22 -21
- package/dist/components/inputs/slider/index.js +4 -4
- package/dist/components/inputs/switch/index.js +9 -9
- package/dist/components/inputs/textarea/index.js +5 -5
- package/dist/components/navigation/breadcrumb/index.js +25 -25
- package/dist/components/navigation/navigation-menu/index.js +17 -17
- package/dist/components/navigation/pagination/index.js +16 -16
- package/dist/components/navigation/sidebar/index.js +25 -25
- package/dist/components/navigation/tabs/index.js +13 -13
- package/dist/components/navigation/tree/index.js +9 -9
- package/dist/components/overlays/alert-dialog/index.js +15 -15
- package/dist/components/overlays/command/index.js +22 -21
- package/dist/components/overlays/context-menu/index.js +25 -25
- package/dist/components/overlays/dialog/index.js +14 -14
- package/dist/components/overlays/dropdown/index.js +24 -24
- package/dist/components/overlays/lightbox/index.js +12 -12
- package/dist/components/overlays/popover/index.js +10 -10
- package/dist/components/overlays/preview-card/index.js +10 -10
- package/dist/components/overlays/sheet/index.js +15 -15
- package/dist/components/overlays/toast/index.js +11 -11
- package/dist/components/overlays/tooltip/index.js +7 -7
- package/dist/docs/index.js +18 -18
- package/dist/index.d.ts +19 -8
- package/dist/index.js +79 -79
- package/dist/lib/fluid-hover-highlight.js +4 -4
- package/dist/lib/focus-ring.js +2 -2
- package/dist/lib/goo-indicator.js +3 -3
- package/dist/lib/morph-layers.js +4 -4
- package/dist/lib/morph-part.js +2 -2
- package/dist/lib/overlay.js +4 -4
- package/dist/lib/popup-rows.js +2 -2
- package/dist/lib/popup-surface.js +7 -7
- package/dist/lib/scroll-column.js +6 -6
- package/dist/lib/use-autosize-textarea.d.ts +6 -4
- package/dist/lib/use-autosize-textarea.js +1 -1
- package/dist/lib/use-merge-split.js +4 -4
- package/dist/lib/use-morph.js +2 -2
- package/dist/primitives/content/code/index.d.ts +3 -1
- package/dist/primitives/content/code/index.js +4 -3
- package/dist/primitives/layout/resizable/index.js +2 -2
- package/dist/primitives/layout/scroll-area/index.d.ts +4 -1
- package/dist/primitives/layout/scroll-area/index.js +2 -1
- package/dist/primitives/layout/sortable/index.js +5 -5
- package/dist/primitives/systems/craft/index.js +3 -3
- package/dist/primitives/systems/fluid-hover/index.js +6 -6
- package/dist/primitives/systems/morph/index.js +13 -13
- package/dist/primitives/systems/motion/index.js +6 -6
- package/dist/primitives/systems/sizes/index.js +2 -2
- package/dist/shared/{components-yfx0skxc.js → components-07nbrsr5.js} +1 -1
- package/dist/shared/{components-jnjw9j2z.js → components-0t4a8wkh.js} +9 -9
- package/dist/shared/{components-qrtcc8aw.js → components-25mzyrp5.js} +3 -3
- package/dist/shared/{components-0ep66sg9.js → components-2amv2322.js} +2 -2
- package/dist/shared/{components-wq9hrera.js → components-313rmbxy.js} +2 -2
- package/dist/shared/{components-b2fag579.js → components-3pcrvb6c.js} +11 -11
- package/dist/shared/{components-8nnhzeb3.js → components-46cav8vk.js} +1 -1
- package/dist/shared/{components-mb80a9wg.js → components-4as7ke76.js} +3 -3
- package/dist/shared/{components-9yrajpy0.js → components-4k5gtrp0.js} +3 -3
- package/dist/shared/{components-8xe4h118.js → components-4resn8g6.js} +4 -7
- package/dist/shared/{components-v1zzr668.js → components-54cxavcc.js} +5 -5
- package/dist/shared/{components-resqc2d2.js → components-5fet4gqt.js} +59 -7
- package/dist/shared/{components-eawe4nxm.js → components-5gbczwgv.js} +2 -2
- package/dist/shared/{components-bxqmbcz2.js → components-5mhrz0bz.js} +1 -1
- package/dist/shared/{components-zckgawt6.js → components-6pnc6yff.js} +1 -1
- package/dist/shared/{components-t0c1rw40.js → components-7v6869ga.js} +1 -1
- package/dist/shared/components-7v6ncqfc.js +80 -0
- package/dist/shared/{components-zv63s4fh.js → components-85dz3xx3.js} +3 -3
- package/dist/shared/{components-4d0v8nzm.js → components-89gqy9dx.js} +4 -4
- package/dist/shared/{components-s2pnh8h9.js → components-8qkd3659.js} +1 -1
- package/dist/shared/{components-nxqrw789.js → components-90sfqz5t.js} +1 -1
- package/dist/shared/{components-1f5624hb.js → components-9hysh6d3.js} +1 -1
- package/dist/shared/{components-br6t88cb.js → components-9j2kfdje.js} +5 -5
- package/dist/shared/{components-fpgfs01m.js → components-9y6pt2jm.js} +3 -3
- package/dist/shared/{components-vcmky8ns.js → components-9zyw4da7.js} +3 -3
- package/dist/shared/{components-9b2m90st.js → components-a3twtgef.js} +1 -1
- package/dist/shared/{components-abqfs5fh.js → components-ajgwbabq.js} +4 -4
- package/dist/shared/{components-d4gkhy26.js → components-avxbkpyq.js} +1 -1
- package/dist/shared/{components-k8awpmbn.js → components-b189975f.js} +6 -6
- package/dist/shared/{components-4m9stj7d.js → components-b5cnztd6.js} +4 -4
- package/dist/shared/{components-3qcgeay1.js → components-b7a6s0cz.js} +2 -2
- package/dist/shared/{components-4fay97sm.js → components-cfegytd4.js} +7 -7
- package/dist/shared/{components-gr82tz50.js → components-d35g9d6b.js} +4 -3
- package/dist/shared/{components-ft5dgjg6.js → components-d83d42wc.js} +1 -1
- package/dist/shared/{components-766w1xcw.js → components-dkx9se7d.js} +6 -6
- package/dist/shared/{components-y9se9mx5.js → components-ea97qgh7.js} +3 -3
- package/dist/shared/{components-z14s3avn.js → components-f0qgww3t.js} +9 -9
- package/dist/shared/{components-8hzwz162.js → components-fk9m24pg.js} +8 -7
- package/dist/shared/{components-nmbcfwx8.js → components-frshs2x3.js} +4 -4
- package/dist/shared/{components-pfwjhxd8.js → components-h7mpem9e.js} +10 -10
- package/dist/shared/{components-8m5e493q.js → components-hz4vjjkb.js} +2 -2
- package/dist/shared/{components-1qw8hqwq.js → components-k7pvrn80.js} +5 -5
- package/dist/shared/{components-q28xct6t.js → components-kvfzrb1r.js} +5 -5
- package/dist/shared/{components-t4j0r23n.js → components-mamtvenk.js} +2 -2
- package/dist/shared/{components-fymenepq.js → components-mgdjq5zv.js} +4 -4
- package/dist/shared/{components-5w7hxa1n.js → components-p3nsjhbh.js} +10 -6
- package/dist/shared/{components-4t2cjav8.js → components-pgs3p035.js} +1 -1
- package/dist/shared/{components-3sb31vw5.js → components-ppc2dmxs.js} +1 -1
- package/dist/shared/{components-2c22zpm2.js → components-qsbcc57j.js} +3 -3
- package/dist/shared/{components-gd8gmr6w.js → components-rmhdr4g1.js} +1 -1
- package/dist/shared/{components-mzdbtgvz.js → components-smhnc4dt.js} +8 -8
- package/dist/shared/{components-4fhjk3jz.js → components-tn8m9wq7.js} +2 -2
- package/dist/shared/{components-0v4jxw7z.js → components-ts40dgzr.js} +3 -3
- package/dist/shared/{components-rtwfh1gc.js → components-twngan89.js} +3 -3
- package/dist/shared/{components-5xs8pkkj.js → components-w5p7mfb4.js} +1 -1
- package/dist/shared/{components-8dgrpegd.js → components-w8ffqns0.js} +4 -2
- package/dist/shared/{components-m3vxpz2z.js → components-wjxyscry.js} +1 -1
- package/dist/shared/{components-7rn454aq.js → components-xxrsqp60.js} +3 -3
- package/dist/shared/{components-895m1f3s.js → components-xzqh7g3t.js} +4 -4
- package/dist/shared/{components-af44r4y9.js → components-ycx7d6wx.js} +1 -1
- package/dist/shared/{components-ac0x7zpq.js → components-yjz0bbvj.js} +4 -4
- package/dist/shared/{components-hjk6dwsp.js → components-z52eyy5f.js} +2 -2
- package/dist/shared/{components-66aw235e.js → components-z93zp2tm.js} +3 -3
- package/dist/shared/{components-9am5511q.js → components-zef9ab75.js} +3 -3
- package/dist/shared/{components-gzve0nkp.js → components-zhsjckqd.js} +8 -8
- package/dist/shared/{components-3rt5c1qt.js → components-zk1tj5za.js} +3 -3
- package/dist/shared/{components-ypxst3cn.js → components-zwkqmb71.js} +1 -1
- package/dist/styles.css +2 -2
- package/lib/use-autosize-textarea.ts +65 -18
- package/package.json +6 -1
- package/primitives/content/code/index.tsx +11 -6
- package/primitives/layout/resizable/index.tsx +15 -6
- package/primitives/layout/scroll-area/examples.mdx +16 -0
- package/primitives/layout/scroll-area/index.tsx +69 -9
- package/dist/shared/components-vpkh6j83.js +0 -42
- /package/dist/shared/{components-jw45ck66.js → components-02683eqd.js} +0 -0
- /package/dist/shared/{components-5wykqxph.js → components-1r1b57ew.js} +0 -0
- /package/dist/shared/{components-ycwhrqe1.js → components-31pkxwfz.js} +0 -0
- /package/dist/shared/{components-q0hs5rqn.js → components-6c52v58g.js} +0 -0
- /package/dist/shared/{components-nz14rwtd.js → components-ffng9rpa.js} +0 -0
- /package/dist/shared/{components-vx286kq7.js → components-h9se5cz5.js} +0 -0
- /package/dist/shared/{components-knryyjme.js → components-hbqyf35a.js} +0 -0
- /package/dist/shared/{components-8pnvkrbw.js → components-mp7en54n.js} +0 -0
- /package/dist/shared/{components-pa43g2r2.js → components-wddr0r6a.js} +0 -0
- /package/dist/shared/{components-ymq8tbq9.js → components-wqac4434.js} +0 -0
- /package/dist/shared/{components-92mvpt9h.js → components-zwgxvktt.js} +0 -0
|
@@ -31,13 +31,13 @@ import {
|
|
|
31
31
|
} from "./components-wwd093xg.js";
|
|
32
32
|
import {
|
|
33
33
|
SizeScope2
|
|
34
|
-
} from "./components-
|
|
34
|
+
} from "./components-ffng9rpa.js";
|
|
35
35
|
import {
|
|
36
36
|
FluidHoverHighlight2
|
|
37
|
-
} from "./components-
|
|
37
|
+
} from "./components-a3twtgef.js";
|
|
38
38
|
import {
|
|
39
39
|
button_default
|
|
40
|
-
} from "./components-
|
|
40
|
+
} from "./components-31pkxwfz.js";
|
|
41
41
|
import {
|
|
42
42
|
WeightLabel2
|
|
43
43
|
} from "./components-y09nr7fe.js";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./components-xnp09586.js";
|
|
15
15
|
import {
|
|
16
16
|
SizeScope2
|
|
17
|
-
} from "./components-
|
|
17
|
+
} from "./components-ffng9rpa.js";
|
|
18
18
|
|
|
19
19
|
// components/data-display/avatar/index.tsx
|
|
20
20
|
import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar";
|
|
@@ -14,9 +14,10 @@ import {
|
|
|
14
14
|
} from "./components-xnp09586.js";
|
|
15
15
|
import {
|
|
16
16
|
scroll_area_default
|
|
17
|
-
} from "./components-
|
|
17
|
+
} from "./components-5fet4gqt.js";
|
|
18
18
|
|
|
19
19
|
// components/data-display/diff/index.tsx
|
|
20
|
+
import { useMemo } from "react";
|
|
20
21
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
22
|
var ROW = {
|
|
22
23
|
add: "bg-status-success/16",
|
|
@@ -70,7 +71,7 @@ function parsePatch2(patch) {
|
|
|
70
71
|
function Diff2({ patch, path, lineNumbers = true, wrap = false, actions, className }) {
|
|
71
72
|
const level = useLift2(1);
|
|
72
73
|
const FileIcon = useIcon2("file-diff");
|
|
73
|
-
const lines = parsePatch2(patch);
|
|
74
|
+
const lines = useMemo(() => parsePatch2(patch), [patch]);
|
|
74
75
|
const added = lines.filter((l) => l.kind === "add").length;
|
|
75
76
|
const removed = lines.filter((l) => l.kind === "remove").length;
|
|
76
77
|
const body = /* @__PURE__ */ jsx("div", {
|
|
@@ -144,6 +145,7 @@ function Diff2({ patch, path, lineNumbers = true, wrap = false, actions, classNa
|
|
|
144
145
|
]
|
|
145
146
|
}),
|
|
146
147
|
wrap ? body : /* @__PURE__ */ jsx(scroll_area_default, {
|
|
148
|
+
native: true,
|
|
147
149
|
orientation: "horizontal",
|
|
148
150
|
viewportClassName: "scroll-fade-x",
|
|
149
151
|
children: body
|
|
@@ -69,7 +69,7 @@ function EditableText2({
|
|
|
69
69
|
const cell = cn2("col-start-1 row-start-1 min-w-0 truncate whitespace-pre", size.text);
|
|
70
70
|
return /* @__PURE__ */ jsxs("div", {
|
|
71
71
|
...field.props,
|
|
72
|
-
className: cn2(field.props.className, "inline-flex max-w-full min-w-0 items-center has-[:focus-visible]:!ring-focus-ring", size.control, size.gap, className),
|
|
72
|
+
className: cn2(field.props.className, "inline-flex max-w-full min-w-0 items-center has-[button:focus-visible]:!ring-focus-ring", size.control, size.gap, className),
|
|
73
73
|
children: [
|
|
74
74
|
/* @__PURE__ */ jsx("span", {
|
|
75
75
|
className: "inline-grid min-w-0 flex-1",
|
|
@@ -5,20 +5,20 @@ import {
|
|
|
5
5
|
} from "./components-bkwjvvkh.js";
|
|
6
6
|
import {
|
|
7
7
|
useMorph2
|
|
8
|
-
} from "./components-
|
|
8
|
+
} from "./components-mp7en54n.js";
|
|
9
9
|
import {
|
|
10
10
|
cn2
|
|
11
11
|
} from "./components-xnp09586.js";
|
|
12
12
|
import {
|
|
13
13
|
MorphSurface2
|
|
14
|
-
} from "./components-
|
|
14
|
+
} from "./components-313rmbxy.js";
|
|
15
15
|
import {
|
|
16
16
|
useOverlayRoot2,
|
|
17
17
|
useOpenedOnce2,
|
|
18
18
|
positionerProps2,
|
|
19
19
|
PortalContainer2,
|
|
20
20
|
usePortalContainer2
|
|
21
|
-
} from "./components-
|
|
21
|
+
} from "./components-d83d42wc.js";
|
|
22
22
|
import {
|
|
23
23
|
useShape2
|
|
24
24
|
} from "./components-kxpcj2ry.js";
|
|
@@ -12,16 +12,16 @@ import {
|
|
|
12
12
|
} from "./components-xnp09586.js";
|
|
13
13
|
import {
|
|
14
14
|
GooIndicator2
|
|
15
|
-
} from "./components-
|
|
15
|
+
} from "./components-5mhrz0bz.js";
|
|
16
16
|
import {
|
|
17
17
|
FluidHoverHighlight2
|
|
18
|
-
} from "./components-
|
|
18
|
+
} from "./components-a3twtgef.js";
|
|
19
19
|
import {
|
|
20
20
|
useShape2
|
|
21
21
|
} from "./components-kxpcj2ry.js";
|
|
22
22
|
import {
|
|
23
23
|
FocusRing2
|
|
24
|
-
} from "./components-
|
|
24
|
+
} from "./components-1r1b57ew.js";
|
|
25
25
|
import {
|
|
26
26
|
mergeRefs2
|
|
27
27
|
} from "./components-bkwjvvkh.js";
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
} from "./components-y09nr7fe.js";
|
|
45
45
|
import {
|
|
46
46
|
SizeScope2
|
|
47
|
-
} from "./components-
|
|
47
|
+
} from "./components-ffng9rpa.js";
|
|
48
48
|
|
|
49
49
|
// components/inputs/radio/index.tsx
|
|
50
50
|
import { Radio as RadioPrimitive } from "@base-ui/react/radio";
|
|
@@ -5,19 +5,19 @@ import {
|
|
|
5
5
|
} from "./components-bkwjvvkh.js";
|
|
6
6
|
import {
|
|
7
7
|
useMorph2
|
|
8
|
-
} from "./components-
|
|
8
|
+
} from "./components-mp7en54n.js";
|
|
9
9
|
import {
|
|
10
10
|
cn2
|
|
11
11
|
} from "./components-xnp09586.js";
|
|
12
12
|
import {
|
|
13
13
|
usePortalContainer2
|
|
14
|
-
} from "./components-
|
|
14
|
+
} from "./components-d83d42wc.js";
|
|
15
15
|
import {
|
|
16
16
|
useShape2
|
|
17
17
|
} from "./components-kxpcj2ry.js";
|
|
18
18
|
import {
|
|
19
19
|
PopupSurface2
|
|
20
|
-
} from "./components-
|
|
20
|
+
} from "./components-90sfqz5t.js";
|
|
21
21
|
import {
|
|
22
22
|
useDialogState2,
|
|
23
23
|
DialogTrigger2,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
DialogTitle2,
|
|
28
28
|
DialogDescription2,
|
|
29
29
|
DialogState2
|
|
30
|
-
} from "./components-
|
|
30
|
+
} from "./components-9j2kfdje.js";
|
|
31
31
|
|
|
32
32
|
// components/overlays/sheet/index.tsx
|
|
33
33
|
import { Drawer as DrawerPrimitive } from "@base-ui/react/drawer";
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./components-7wjkag2j.js";
|
|
6
6
|
import {
|
|
7
7
|
button_default
|
|
8
|
-
} from "./components-
|
|
8
|
+
} from "./components-31pkxwfz.js";
|
|
9
9
|
import {
|
|
10
10
|
DialogTrigger2,
|
|
11
11
|
DialogClose2,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
DialogTitle2,
|
|
16
16
|
DialogDescription2,
|
|
17
17
|
DialogState2
|
|
18
|
-
} from "./components-
|
|
18
|
+
} from "./components-9j2kfdje.js";
|
|
19
19
|
|
|
20
20
|
// components/overlays/alert-dialog/index.tsx
|
|
21
21
|
import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./components-xnp09586.js";
|
|
10
10
|
import {
|
|
11
11
|
FluidHoverHighlight2
|
|
12
|
-
} from "./components-
|
|
12
|
+
} from "./components-a3twtgef.js";
|
|
13
13
|
import {
|
|
14
14
|
useIcon2
|
|
15
15
|
} from "./components-jnhpgpfk.js";
|
|
@@ -21,10 +21,10 @@ import {
|
|
|
21
21
|
} from "./components-znspksk0.js";
|
|
22
22
|
import {
|
|
23
23
|
SizeScope2
|
|
24
|
-
} from "./components-
|
|
24
|
+
} from "./components-ffng9rpa.js";
|
|
25
25
|
import {
|
|
26
26
|
dropdown_default
|
|
27
|
-
} from "./components-
|
|
27
|
+
} from "./components-h7mpem9e.js";
|
|
28
28
|
|
|
29
29
|
// components/navigation/breadcrumb/index.tsx
|
|
30
30
|
import { Children, isValidElement, useLayoutEffect, useRef, useState } from "react";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
} from "./components-xnp09586.js";
|
|
23
23
|
import {
|
|
24
24
|
calendar_default
|
|
25
|
-
} from "./components-
|
|
25
|
+
} from "./components-hz4vjjkb.js";
|
|
26
26
|
import {
|
|
27
27
|
readDateValue,
|
|
28
28
|
writeDateValue,
|
|
@@ -34,10 +34,10 @@ import {
|
|
|
34
34
|
invalidOf,
|
|
35
35
|
PickerShell,
|
|
36
36
|
PickerInput
|
|
37
|
-
} from "./components-
|
|
37
|
+
} from "./components-zhsjckqd.js";
|
|
38
38
|
import {
|
|
39
39
|
TimeColumns
|
|
40
|
-
} from "./components-
|
|
40
|
+
} from "./components-avxbkpyq.js";
|
|
41
41
|
|
|
42
42
|
// components/inputs/date-time/date-picker/index.tsx
|
|
43
43
|
import { format, set } from "date-fns";
|
|
@@ -22,36 +22,36 @@ import {
|
|
|
22
22
|
} from "./components-bkwjvvkh.js";
|
|
23
23
|
import {
|
|
24
24
|
useMorph2
|
|
25
|
-
} from "./components-
|
|
25
|
+
} from "./components-mp7en54n.js";
|
|
26
26
|
import {
|
|
27
27
|
OverlayContext2,
|
|
28
28
|
useOverlayRoot2,
|
|
29
29
|
useOverlay2,
|
|
30
30
|
positionerProps2
|
|
31
|
-
} from "./components-
|
|
31
|
+
} from "./components-d83d42wc.js";
|
|
32
32
|
import {
|
|
33
33
|
PopupSurface2
|
|
34
|
-
} from "./components-
|
|
34
|
+
} from "./components-90sfqz5t.js";
|
|
35
35
|
import {
|
|
36
36
|
dividedColumns2
|
|
37
|
-
} from "./components-
|
|
37
|
+
} from "./components-6pnc6yff.js";
|
|
38
38
|
import {
|
|
39
39
|
useIsMobile2
|
|
40
40
|
} from "./components-8wp8d8q1.js";
|
|
41
41
|
import {
|
|
42
42
|
SizeScope2
|
|
43
|
-
} from "./components-
|
|
43
|
+
} from "./components-ffng9rpa.js";
|
|
44
44
|
import {
|
|
45
45
|
button_default
|
|
46
|
-
} from "./components-
|
|
46
|
+
} from "./components-31pkxwfz.js";
|
|
47
47
|
import {
|
|
48
48
|
sheet_default
|
|
49
|
-
} from "./components-
|
|
49
|
+
} from "./components-yjz0bbvj.js";
|
|
50
50
|
import {
|
|
51
51
|
InputAdornment2,
|
|
52
52
|
InputAction2,
|
|
53
53
|
input_default
|
|
54
|
-
} from "./components-
|
|
54
|
+
} from "./components-ycx7d6wx.js";
|
|
55
55
|
|
|
56
56
|
// components/inputs/date-time/picker-shell.tsx
|
|
57
57
|
import { Popover } from "@base-ui/react/popover";
|
|
@@ -14,13 +14,13 @@ import {
|
|
|
14
14
|
holdExit2,
|
|
15
15
|
useMorphOrigin2,
|
|
16
16
|
useMorph2
|
|
17
|
-
} from "./components-
|
|
17
|
+
} from "./components-mp7en54n.js";
|
|
18
18
|
import {
|
|
19
19
|
cn2
|
|
20
20
|
} from "./components-xnp09586.js";
|
|
21
21
|
import {
|
|
22
22
|
MorphSurface2
|
|
23
|
-
} from "./components-
|
|
23
|
+
} from "./components-313rmbxy.js";
|
|
24
24
|
import {
|
|
25
25
|
useShape2
|
|
26
26
|
} from "./components-kxpcj2ry.js";
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
} from "./components-wwd093xg.js";
|
|
38
38
|
import {
|
|
39
39
|
button_default
|
|
40
|
-
} from "./components-
|
|
40
|
+
} from "./components-31pkxwfz.js";
|
|
41
41
|
|
|
42
42
|
// components/overlays/lightbox/index.tsx
|
|
43
43
|
import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
|
package/dist/styles.css
CHANGED
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
}
|
|
63
63
|
/* layer: theme */
|
|
64
64
|
@layer theme{
|
|
65
|
-
:root, :host { --spacing: 0.25rem; --
|
|
65
|
+
:root, :host { --spacing: 0.25rem; --default-transition-timingFunction: cubic-bezier(0.4, 0, 0.2, 1); --default-transition-duration: 150ms; --radius-none: 0; --ease-DEFAULT: cubic-bezier(0.4, 0, 0.2, 1); --radius-md: 0.375rem; --radius-DEFAULT: 0.25rem; --font-sans: 'Inter Variable', ui-sans-serif, system-ui, sans-serif; --ease-out: cubic-bezier(0, 0, 0.2, 1); --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace; --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1); --radius-lg: 0.5rem; --radius-xl: 0.75rem; --leading-tight: 1.25; --leading-relaxed: 1.625; --radius-3xl: 1.5rem; --container-2xl: 42rem; --radius-sm: 0.25rem; --leading-none: 1; --container-sm: 24rem; --radius-2xl: 1rem; --radius-xs: 0.125rem; --leading-snug: 1.375; --leading-normal: 1.5; --default-font-family: var(--font-sans); --default-monoFont-family: var(--font-mono); }
|
|
66
66
|
}
|
|
67
67
|
/* layer: base */
|
|
68
68
|
@layer base{
|
|
@@ -739,7 +739,7 @@
|
|
|
739
739
|
.focus-visible\:ring-1:focus-visible{--un-ring-shadow:var(--un-ring-inset,) 0 0 0 calc(1px + var(--un-ring-offset-width)) var(--un-ring-color, currentColor);box-shadow:var(--un-inset-shadow), var(--un-inset-ring-shadow), var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow);}
|
|
740
740
|
.group:active .group-active\:ring-0{--un-ring-shadow:var(--un-ring-inset,) 0 0 0 calc(0px + var(--un-ring-offset-width)) var(--un-ring-color, currentColor);box-shadow:var(--un-inset-shadow), var(--un-inset-ring-shadow), var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow);}
|
|
741
741
|
.\[\&\:has\(\:focus-visible\)\]\:\!ring-focus-ring:has(:focus-visible),
|
|
742
|
-
.has-\[\:focus-visible\]\:\!ring-focus-ring:has(:focus-visible){--un-ring-color:color-mix(in srgb, var(--focus-ring) var(--un-ring-opacity), transparent) !important;}
|
|
742
|
+
.has-\[button\:focus-visible\]\:\!ring-focus-ring:has(button:focus-visible){--un-ring-color:color-mix(in srgb, var(--focus-ring) var(--un-ring-opacity), transparent) !important;}
|
|
743
743
|
.data-\[active\]\:ring-border[data-active],
|
|
744
744
|
.data-\[disabled\]\:ring-border[data-disabled],
|
|
745
745
|
.ring-border{--un-ring-color:color-mix(in srgb, var(--border) var(--un-ring-opacity), transparent);}
|
|
@@ -15,50 +15,97 @@ interface AutosizeRows {
|
|
|
15
15
|
maxRows: number
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
// `field-sizing: content` (WebKit 26, Chromium 123) sizes the box inside the
|
|
19
|
+
// browser's own layout: no measure, no observer.
|
|
20
|
+
const nativeSizing = typeof CSS !== 'undefined' && CSS.supports('field-sizing', 'content')
|
|
21
|
+
|
|
18
22
|
function lineHeightOf(el: HTMLElement) {
|
|
19
23
|
const style = getComputedStyle(el)
|
|
20
24
|
// `line-height: normal` computes to the keyword, which parses to NaN.
|
|
21
25
|
return Number.parseFloat(style.lineHeight) || Number.parseFloat(style.fontSize) * 1.2
|
|
22
26
|
}
|
|
23
27
|
|
|
28
|
+
function fit(el: HTMLTextAreaElement, height: number, max: number) {
|
|
29
|
+
const next = `${Math.min(height, max)}px`
|
|
30
|
+
const overflow = height > max ? 'auto' : 'hidden'
|
|
31
|
+
if (el.style.height !== next) el.style.height = next
|
|
32
|
+
if (el.style.overflowY !== overflow) el.style.overflowY = overflow
|
|
33
|
+
}
|
|
34
|
+
|
|
24
35
|
/**
|
|
25
36
|
* Sizes the textarea to its content between `minRows` and `maxRows`, then
|
|
26
|
-
* scrolls.
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
37
|
+
* scrolls. Where the browser supports `field-sizing: content`, the box sizes
|
|
38
|
+
* itself between a `min-height` and `max-height` in line units. Elsewhere it
|
|
39
|
+
* measures before paint whenever `deps` change (pass the value and anything
|
|
40
|
+
* else that changes the text's height, such as the size step), and when the
|
|
41
|
+
* textarea's width changes. Returns the measure, for a caller that changes
|
|
42
|
+
* the content outside React.
|
|
30
43
|
*/
|
|
31
44
|
export function useAutosizeTextarea(
|
|
32
45
|
ref: RefObject<HTMLTextAreaElement | null>,
|
|
33
46
|
{ minRows, maxRows }: AutosizeRows,
|
|
34
47
|
deps: DependencyList,
|
|
35
48
|
) {
|
|
36
|
-
|
|
49
|
+
// `grow` reads the text's height off the current box, which only holds
|
|
50
|
+
// while the text is at least as tall as the box.
|
|
51
|
+
const measure = useCallback(
|
|
52
|
+
(grow: boolean) => {
|
|
53
|
+
const el = ref.current
|
|
54
|
+
if (!el || nativeSizing) return
|
|
55
|
+
const line = lineHeightOf(el)
|
|
56
|
+
const floor = line * minRows
|
|
57
|
+
const max = line * Math.max(maxRows, minRows)
|
|
58
|
+
// An empty box is one line at most: the floor holds it unmeasured.
|
|
59
|
+
if (el.value === '' && minRows >= 1) return fit(el, floor, max)
|
|
60
|
+
if (!grow) el.style.height = 'auto'
|
|
61
|
+
fit(el, Math.max(el.scrollHeight, floor), max)
|
|
62
|
+
},
|
|
63
|
+
[ref, minRows, maxRows],
|
|
64
|
+
)
|
|
65
|
+
const resize = useCallback(() => measure(false), [measure])
|
|
66
|
+
|
|
67
|
+
useIsoLayoutEffect(() => {
|
|
37
68
|
const el = ref.current
|
|
38
|
-
if (!el) return
|
|
39
|
-
el.style.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
el.style.
|
|
43
|
-
el.style.overflowY = el.scrollHeight > max ? 'auto' : 'hidden'
|
|
69
|
+
if (!el || !nativeSizing) return
|
|
70
|
+
el.style.setProperty('field-sizing', 'content')
|
|
71
|
+
el.style.minHeight = `${minRows}lh`
|
|
72
|
+
el.style.maxHeight = `${Math.max(maxRows, minRows)}lh`
|
|
73
|
+
el.style.overflowY = 'auto'
|
|
44
74
|
}, [ref, minRows, maxRows])
|
|
45
75
|
|
|
46
76
|
useIsoLayoutEffect(resize, [resize, ...deps])
|
|
47
77
|
|
|
48
78
|
// The first measure can run while an ancestor is still at (near-)zero
|
|
49
|
-
// width
|
|
79
|
+
// width, and a pane drag changes the width every frame. Narrower text can
|
|
80
|
+
// only grow, which the box's own scrollHeight shows without a re-layout;
|
|
81
|
+
// wider text may shrink, which needs the full measure, once per frame.
|
|
82
|
+
// Gated on width, so the observer never loops on its own height writes.
|
|
50
83
|
useEffect(() => {
|
|
51
84
|
const el = ref.current
|
|
52
|
-
if (!el) return
|
|
85
|
+
if (!el || nativeSizing) return
|
|
53
86
|
let width = el.offsetWidth
|
|
87
|
+
let frame = 0
|
|
54
88
|
const observer = new ResizeObserver(() => {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
89
|
+
const next = el.offsetWidth
|
|
90
|
+
const wider = next > width
|
|
91
|
+
if (next === width) return
|
|
92
|
+
width = next
|
|
93
|
+
if (el.value === '') return
|
|
94
|
+
if (!wider) {
|
|
95
|
+
if (el.scrollHeight > el.clientHeight) measure(true)
|
|
96
|
+
return
|
|
97
|
+
}
|
|
98
|
+
frame ||= requestAnimationFrame(() => {
|
|
99
|
+
frame = 0
|
|
100
|
+
resize()
|
|
101
|
+
})
|
|
58
102
|
})
|
|
59
103
|
observer.observe(el)
|
|
60
|
-
return () =>
|
|
61
|
-
|
|
104
|
+
return () => {
|
|
105
|
+
observer.disconnect()
|
|
106
|
+
cancelAnimationFrame(frame)
|
|
107
|
+
}
|
|
108
|
+
}, [ref, measure, resize])
|
|
62
109
|
|
|
63
110
|
return resize
|
|
64
111
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justanarthur/modo-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.6.1",
|
|
5
5
|
"description": "Fluid Functionalism (Base UI flavor, MIT © 2026 Micka Touillaud) ported to UnoCSS: motion springs, fluid hover, a two-step size ladder and an eight-level elevated surface system. Documented with modo.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"keywords": [
|
|
@@ -50,6 +50,11 @@
|
|
|
50
50
|
"engines": {
|
|
51
51
|
"node": ">=20"
|
|
52
52
|
},
|
|
53
|
+
"sideEffects": [
|
|
54
|
+
"**/*.css",
|
|
55
|
+
"**/*.ts",
|
|
56
|
+
"**/*.tsx"
|
|
57
|
+
],
|
|
53
58
|
"module": "./dist/index.js",
|
|
54
59
|
"types": "./dist/index.d.ts",
|
|
55
60
|
"exports": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import { Fragment } from 'react'
|
|
3
|
+
import { Fragment, useMemo } from 'react'
|
|
4
4
|
import type { TokenType } from 'sugar-high'
|
|
5
5
|
import { parse } from 'sugar-high/core'
|
|
6
6
|
import { type Language, lang, languages } from 'sugar-high/lang'
|
|
@@ -45,7 +45,9 @@ function highlight(source: string, language: Language['id']) {
|
|
|
45
45
|
*
|
|
46
46
|
* sugar-high tokenizes; each token type takes a `--syntax-*` token from
|
|
47
47
|
* tokens/colors.css, so code follows light and dark like everything else.
|
|
48
|
-
* Long lines scroll sideways under a fading edge instead of wrapping
|
|
48
|
+
* Long lines scroll sideways under a fading edge instead of wrapping, on the
|
|
49
|
+
* platform's own scrollbar (ScrollArea's `native`), so hundreds of blocks
|
|
50
|
+
* cost nothing while their column resizes. It is
|
|
49
51
|
* also the docs chrome's Code slot: every example's source and every fenced
|
|
50
52
|
* block on these pages renders through it.
|
|
51
53
|
*
|
|
@@ -64,17 +66,20 @@ export default function Code({
|
|
|
64
66
|
className?: string
|
|
65
67
|
}) {
|
|
66
68
|
const level = useLift(1)
|
|
67
|
-
const source = children.trim()
|
|
68
69
|
const id = lang(language)
|
|
70
|
+
// The same element on every render, so React skips the token spans.
|
|
71
|
+
const code = useMemo(() => {
|
|
72
|
+
const source = children.trim()
|
|
73
|
+
return <code>{id && id !== 'plaintext' ? highlight(source, id) : source}</code>
|
|
74
|
+
}, [children, id])
|
|
69
75
|
return (
|
|
70
76
|
<ScrollArea
|
|
77
|
+
native
|
|
71
78
|
orientation="horizontal"
|
|
72
79
|
viewportClassName="scroll-fade-x"
|
|
73
80
|
className={cn('rounded-xl', SURFACE_BG[level], className)}
|
|
74
81
|
>
|
|
75
|
-
<pre className="m-0 w-max min-w-full p-4 font-mono text-caption leading-relaxed text-foreground">
|
|
76
|
-
<code>{id && id !== 'plaintext' ? highlight(source, id) : source}</code>
|
|
77
|
-
</pre>
|
|
82
|
+
<pre className="m-0 w-max min-w-full p-4 font-mono text-caption leading-relaxed text-foreground">{code}</pre>
|
|
78
83
|
</ScrollArea>
|
|
79
84
|
)
|
|
80
85
|
}
|
|
@@ -312,16 +312,25 @@ const Resizable = forwardRef<HTMLDivElement, ResizableProps>(
|
|
|
312
312
|
const panels = items.filter(
|
|
313
313
|
(child): child is ReactElement<ResizablePanelProps> => isValidElement(child) && child.type === ResizablePanel,
|
|
314
314
|
)
|
|
315
|
-
const
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
315
|
+
const limitKey = panels.map(({ props }) => `${props.minSize}:${props.maxSize}:${props.collapsible}`).join()
|
|
316
|
+
const limits = useMemo(
|
|
317
|
+
() =>
|
|
318
|
+
panels.map(({ props }) => ({
|
|
319
|
+
min: props.minSize ?? 0,
|
|
320
|
+
max: props.maxSize ?? 100,
|
|
321
|
+
collapsible: props.collapsible ?? false,
|
|
322
|
+
})),
|
|
323
|
+
[limitKey],
|
|
324
|
+
)
|
|
320
325
|
const sizeKey = panels.map(({ props }) => props.defaultSize).join()
|
|
321
326
|
const defaults = useMemo(() => defaultSizes(panels.map(({ props }) => props.defaultSize)), [sizeKey])
|
|
322
327
|
const [current, setCurrent] = useControllableState(sizes, defaults, onSizesChange)
|
|
323
328
|
const [dragging, setDragging] = useState(false)
|
|
324
|
-
|
|
329
|
+
// A new context value walks the whole subtree for consumers, so it changes only with what it holds.
|
|
330
|
+
const group = useMemo(
|
|
331
|
+
() => ({ id, direction, sizes: current, limits, defaults, step, setSizes: setCurrent, dragging, setDragging }),
|
|
332
|
+
[id, direction, current, limits, defaults, step, setCurrent, dragging],
|
|
333
|
+
)
|
|
325
334
|
|
|
326
335
|
let panel = -1
|
|
327
336
|
const indexed = items.map(child => {
|
|
@@ -31,6 +31,22 @@ content keep its natural width instead of squeezing in.
|
|
|
31
31
|
</div>
|
|
32
32
|
</ScrollArea>
|
|
33
33
|
|
|
34
|
+
# Native
|
|
35
|
+
|
|
36
|
+
`native` scrolls on the platform's own scrollbar (an overlay one on macOS)
|
|
37
|
+
with no observers behind it, for scrollers that come by the hundred: every
|
|
38
|
+
Code block is one. The fade stays the same.
|
|
39
|
+
|
|
40
|
+
<ScrollArea native orientation="horizontal" viewportClassName="scroll-fade-x" className="w-full">
|
|
41
|
+
<div className="flex gap-2 p-3 w-max">
|
|
42
|
+
{['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'].map((month) => (
|
|
43
|
+
<div key={month} className="flex items-center justify-center h-20 w-28 shrink-0 border border-border rounded-lg text-body text-foreground">
|
|
44
|
+
{month}
|
|
45
|
+
</div>
|
|
46
|
+
))}
|
|
47
|
+
</div>
|
|
48
|
+
</ScrollArea>
|
|
49
|
+
|
|
34
50
|
# Double overflow
|
|
35
51
|
|
|
36
52
|
A grid taller and wider than its box. `orientation="both"` adds both
|