@jonmilner/ui 0.8.1 → 0.9.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/Avatar/Avatar.css +1 -1
- package/dist/Avatar/index.d.mts +1 -1
- package/dist/Avatar/index.mjs +1 -1
- package/dist/Badge/Badge.css +1 -1
- package/dist/Badge/index.d.mts +1 -1
- package/dist/Badge/index.mjs +1 -1
- package/dist/Box/Box.css +1 -1
- package/dist/Box/ResponsiveCheck.mjs +17 -0
- package/dist/Box/base.d.mts +8 -0
- package/dist/Box/base.mjs +17 -0
- package/dist/Box/index.d.mts +4 -7
- package/dist/Box/index.mjs +4 -13
- package/dist/Button/Button.css +1 -1
- package/dist/Button/index.d.mts +1 -1
- package/dist/Button/index.mjs +1 -1
- package/dist/Checkbox/Checkbox.css +1 -1
- package/dist/Checkbox/index.mjs +1 -1
- package/dist/Chip/Chip.css +1 -1
- package/dist/Chip/index.mjs +1 -1
- package/dist/Clickable/Clickable.css +1 -1
- package/dist/Clickable/index.d.mts +1 -1
- package/dist/Clickable/index.mjs +1 -1
- package/dist/ColorField/ColorField.css +1 -1
- package/dist/ColorField/client.mjs +8 -8
- package/dist/ColorField/index.d.mts +1 -1
- package/dist/Dialog/Dialog.css +1 -1
- package/dist/Dialog/client.d.mts +1 -1
- package/dist/Dialog/client.mjs +1 -1
- package/dist/Dialog/index.d.mts +1 -1
- package/dist/Dialog/index.mjs +1 -1
- package/dist/Field/Field.css +1 -1
- package/dist/Field/client.mjs +1 -1
- package/dist/Field/index.mjs +18 -18
- package/dist/Heading/Heading.css +1 -1
- package/dist/Icon/Icon.css +1 -1
- package/dist/IconButton/IconButton.css +1 -1
- package/dist/IconButton/index.d.mts +1 -1
- package/dist/Inline/Inline.css +1 -1
- package/dist/Inline/index.d.mts +2 -1
- package/dist/Menu/Menu.css +2 -2
- package/dist/Menu/Menu.css.mjs +2 -2
- package/dist/Menu/client.d.mts +17 -2
- package/dist/Menu/client.mjs +71 -28
- package/dist/Menu/index.d.mts +8 -5
- package/dist/Menu/index.mjs +75 -63
- package/dist/MultiSelect/MultiSelect.css +1 -1
- package/dist/MultiSelect/client.mjs +25 -25
- package/dist/MultiSelect/index.d.mts +1 -1
- package/dist/MultiSelect/index.mjs +1 -1
- package/dist/SearchField/SearchField.css +1 -1
- package/dist/SearchField/client.mjs +9 -9
- package/dist/SearchField/index.d.mts +1 -1
- package/dist/Stack/Stack.css +1 -1
- package/dist/Stack/index.d.mts +2 -1
- package/dist/Tabs/Tabs.css +1 -1
- package/dist/Tabs/index.mjs +1 -1
- package/dist/Tag/Tag.css +1 -1
- package/dist/Tag/index.d.mts +1 -1
- package/dist/Tag/index.mjs +1 -1
- package/dist/Text/Text.css +1 -1
- package/dist/Text/index.d.mts +1 -1
- package/dist/Text/index.mjs +1 -1
- package/dist/TextField/TextField.css +1 -1
- package/dist/TextField/index.d.mts +1 -1
- package/dist/Toast/Toast.css +1 -1
- package/dist/Toast/client.mjs +42 -42
- package/dist/VisuallyHidden/VisuallyHidden.css +1 -1
- package/dist/base.css +1 -1
- package/dist/docs/Menu.md +41 -5
- package/dist/docs/manifest.json +33 -1
- package/dist/docs/migrations/0.9.0.md +27 -0
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +11 -11
- package/dist/popup/client.mjs +24 -24
- package/dist/styles/atoms.css +2 -2
- package/dist/styles/atoms.css.d.mts +31 -31
- package/dist/styles/atoms.css.mjs +1500 -1500
- package/dist/styles/layers.css +2 -2
- package/dist/styles/part-props.d.mts +1 -1
- package/dist/styles/responsive.css +2 -0
- package/dist/styles/responsive.css.mjs +6 -0
- package/package.json +5 -3
package/dist/Menu/client.mjs
CHANGED
|
@@ -1,48 +1,91 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { join as e } from "../styles/join.mjs";
|
|
3
3
|
import { splitStyleProps as t } from "../styles/split-style-props.mjs";
|
|
4
|
-
import { Box as n } from "../Box/
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { Box as n } from "../Box/base.mjs";
|
|
5
|
+
import { Text as r } from "../Text/index.mjs";
|
|
6
|
+
import { PopupScope as i, triggerElement as a, useClosingRule as o, usePopupScope as s, useRecordOpenChange as c } from "../popup/client.mjs";
|
|
7
|
+
import { IconButton as l } from "../IconButton/index.mjs";
|
|
8
|
+
import { description as u, positioner as d } from "./Menu.css.mjs";
|
|
9
|
+
import { useId as f } from "react";
|
|
10
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
11
|
+
import { Menu as g } from "@base-ui/react/menu";
|
|
9
12
|
//#region src/Menu/client.tsx
|
|
10
|
-
function
|
|
11
|
-
let { ref:
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
+
function _({ disabled: e = !1, openOnHover: t, delay: n, closeDelay: r, handle: i, payload: o, icon: c, label: u, ...d }) {
|
|
14
|
+
let { ref: f } = s();
|
|
15
|
+
return /* @__PURE__ */ m(g.Trigger, {
|
|
13
16
|
disabled: e,
|
|
14
17
|
openOnHover: t,
|
|
15
18
|
delay: n,
|
|
16
19
|
closeDelay: r,
|
|
17
|
-
handle:
|
|
18
|
-
payload:
|
|
19
|
-
ref:
|
|
20
|
-
render:
|
|
20
|
+
handle: i,
|
|
21
|
+
payload: o,
|
|
22
|
+
ref: f,
|
|
23
|
+
render: c ? /* @__PURE__ */ m(l, {
|
|
24
|
+
...d,
|
|
25
|
+
icon: c,
|
|
26
|
+
label: u
|
|
27
|
+
}) : a(d)
|
|
21
28
|
});
|
|
22
29
|
}
|
|
23
|
-
function
|
|
24
|
-
let
|
|
25
|
-
return
|
|
30
|
+
function v(e, t, i) {
|
|
31
|
+
let a = f();
|
|
32
|
+
return t === void 0 ? { content: e } : {
|
|
33
|
+
aria: { "aria-describedby": i ? `${a} ${i}` : a },
|
|
34
|
+
content: /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(n, {
|
|
35
|
+
alignItems: "center",
|
|
36
|
+
as: "span",
|
|
37
|
+
display: "flex",
|
|
38
|
+
gap: "8",
|
|
39
|
+
children: e
|
|
40
|
+
}), /* @__PURE__ */ m(r, {
|
|
41
|
+
"aria-hidden": !0,
|
|
42
|
+
as: "span",
|
|
43
|
+
className: u,
|
|
44
|
+
id: a,
|
|
45
|
+
size: "xs",
|
|
46
|
+
children: t
|
|
47
|
+
})] })
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function y({ description: e, children: t, ...n }) {
|
|
51
|
+
let { aria: r, content: i } = v(t, e, n["aria-describedby"]);
|
|
52
|
+
return /* @__PURE__ */ m(g.Item, {
|
|
53
|
+
...n,
|
|
54
|
+
...r,
|
|
55
|
+
children: i
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function b({ description: e, children: t, ...n }) {
|
|
59
|
+
let { aria: r, content: i } = v(t, e, n["aria-describedby"]);
|
|
60
|
+
return /* @__PURE__ */ m(g.LinkItem, {
|
|
61
|
+
...n,
|
|
62
|
+
...r,
|
|
63
|
+
children: i
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function x({ children: e }) {
|
|
67
|
+
let { container: t } = s();
|
|
68
|
+
return /* @__PURE__ */ m(g.Portal, {
|
|
26
69
|
container: t,
|
|
27
70
|
children: e
|
|
28
71
|
});
|
|
29
72
|
}
|
|
30
|
-
function
|
|
31
|
-
return /* @__PURE__ */
|
|
73
|
+
function S(e) {
|
|
74
|
+
return /* @__PURE__ */ m(i, { children: /* @__PURE__ */ m(C, { ...e }) });
|
|
32
75
|
}
|
|
33
|
-
function
|
|
34
|
-
return /* @__PURE__ */
|
|
76
|
+
function C({ onOpenChange: e, ...t }) {
|
|
77
|
+
return /* @__PURE__ */ m(g.Root, {
|
|
35
78
|
...t,
|
|
36
|
-
onOpenChange:
|
|
79
|
+
onOpenChange: c(e)
|
|
37
80
|
});
|
|
38
81
|
}
|
|
39
|
-
function
|
|
40
|
-
return /* @__PURE__ */
|
|
82
|
+
function w({ finalFocus: e, ...n }) {
|
|
83
|
+
return /* @__PURE__ */ m(g.Positioner, {
|
|
41
84
|
...n,
|
|
42
85
|
collisionPadding: 8,
|
|
43
86
|
render: (n, { open: r }) => {
|
|
44
87
|
let [, i] = t(n);
|
|
45
|
-
return /* @__PURE__ */
|
|
88
|
+
return /* @__PURE__ */ m(T, {
|
|
46
89
|
...i,
|
|
47
90
|
finalFocus: e,
|
|
48
91
|
open: r
|
|
@@ -51,16 +94,16 @@ function h({ finalFocus: e, ...n }) {
|
|
|
51
94
|
sideOffset: 4
|
|
52
95
|
});
|
|
53
96
|
}
|
|
54
|
-
function
|
|
55
|
-
return /* @__PURE__ */
|
|
97
|
+
function T({ open: t, finalFocus: r, ref: i, className: a, ...s }) {
|
|
98
|
+
return /* @__PURE__ */ m(n, {
|
|
56
99
|
...s,
|
|
57
|
-
...
|
|
100
|
+
...o(i, {
|
|
58
101
|
finalFocus: r,
|
|
59
102
|
open: t
|
|
60
103
|
}),
|
|
61
|
-
className: e(
|
|
104
|
+
className: e(d, a),
|
|
62
105
|
zIndex: "popover"
|
|
63
106
|
});
|
|
64
107
|
}
|
|
65
108
|
//#endregion
|
|
66
|
-
export {
|
|
109
|
+
export { y as MenuItemPart, b as MenuLinkItemPart, x as MenuPortal, w as MenuPositioner, S as MenuRootScope, _ as MenuTrigger };
|
package/dist/Menu/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StyleProps } from "../Box/
|
|
1
|
+
import { StyleProps } from "../Box/base.mjs";
|
|
2
2
|
import { MenuTrigger, MenuTriggerProps } from "./client.mjs";
|
|
3
3
|
import { CSSProperties, ReactNode } from "react";
|
|
4
4
|
import { Menu as Menu$1 } from "@base-ui/react/menu";
|
|
@@ -11,10 +11,13 @@ export type MenuProps = Pick<Menu$1.Root.Props, "open" | "defaultOpen" | "onOpen
|
|
|
11
11
|
children?: ReactNode;
|
|
12
12
|
};
|
|
13
13
|
export type MenuPopupProps = PartProps<Menu$1.Popup.Props> & Pick<Menu$1.Positioner.Props, "side" | "align">;
|
|
14
|
-
|
|
14
|
+
type ItemDescription = {
|
|
15
|
+
description?: ReactNode;
|
|
16
|
+
};
|
|
17
|
+
export type MenuItemProps = PartProps<Menu$1.Item.Props> & ItemDescription & {
|
|
15
18
|
variant?: "neutral" | "danger";
|
|
16
19
|
};
|
|
17
|
-
export type MenuLinkItemProps = PartProps<Menu$1.LinkItem.Props> & {
|
|
20
|
+
export type MenuLinkItemProps = PartProps<Menu$1.LinkItem.Props> & ItemDescription & {
|
|
18
21
|
disabled?: boolean;
|
|
19
22
|
href: string;
|
|
20
23
|
};
|
|
@@ -24,8 +27,8 @@ export type MenuGroupProps = PartProps<Menu$1.Group.Props> & {
|
|
|
24
27
|
};
|
|
25
28
|
declare function MenuRoot(props: MenuProps): import("react").JSX.Element;
|
|
26
29
|
declare function MenuPopup({ side, align, backgroundColor, borderRadius, boxShadow, padding, className, style, ...props }: MenuPopupProps): import("react").JSX.Element;
|
|
27
|
-
declare function MenuItem({ variant,
|
|
28
|
-
declare function MenuLinkItem({ href, disabled, closeOnClick, onClick,
|
|
30
|
+
declare function MenuItem({ variant, description, display, minBlockSize, paddingInline, borderRadius, color, className, style, children, ...props }: MenuItemProps): import("react").JSX.Element;
|
|
31
|
+
declare function MenuLinkItem({ href, disabled, closeOnClick, onClick, description, display, minBlockSize, paddingInline, borderRadius, color, className, style, children, ...props }: MenuLinkItemProps): import("react").JSX.Element;
|
|
29
32
|
declare function MenuSeparator({ paddingBlock, paddingInline, className, style, ...props }: MenuSeparatorProps): import("react").JSX.Element;
|
|
30
33
|
declare function MenuGroup({ label, className, style, children, ...props }: MenuGroupProps): import("react").JSX.Element;
|
|
31
34
|
export declare const Menu: typeof MenuRoot & {
|
package/dist/Menu/index.mjs
CHANGED
|
@@ -1,92 +1,104 @@
|
|
|
1
1
|
import { join as e } from "../styles/join.mjs";
|
|
2
2
|
import { splitStyleProps as t } from "../styles/split-style-props.mjs";
|
|
3
|
-
import { Box as n } from "../Box/
|
|
3
|
+
import { Box as n } from "../Box/base.mjs";
|
|
4
4
|
import { Text as r } from "../Text/index.mjs";
|
|
5
5
|
import { item as i, linkItem as a, popup as o, separator as s } from "./Menu.css.mjs";
|
|
6
|
-
import {
|
|
7
|
-
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
6
|
+
import { MenuItemPart as c, MenuLinkItemPart as l, MenuPortal as u, MenuPositioner as d, MenuRootScope as f, MenuTrigger as p } from "./client.mjs";
|
|
8
7
|
import { Children as m } from "react";
|
|
9
|
-
import {
|
|
8
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
9
|
+
import { Menu as _ } from "@base-ui/react/menu";
|
|
10
10
|
//#region src/Menu/index.tsx
|
|
11
|
-
function
|
|
12
|
-
return /* @__PURE__ */ f
|
|
11
|
+
function v(e) {
|
|
12
|
+
return /* @__PURE__ */ h(f, { ...e });
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
let [
|
|
16
|
-
return /* @__PURE__ */
|
|
14
|
+
function y({ side: r = "bottom", align: i = "start", backgroundColor: a = "bgRaised", borderRadius: s = "med", boxShadow: c = "med", padding: l = "4", className: f, style: p, ...m }) {
|
|
15
|
+
let [g, v] = t(m);
|
|
16
|
+
return /* @__PURE__ */ h(u, { children: /* @__PURE__ */ h(d, {
|
|
17
17
|
align: i,
|
|
18
18
|
finalFocus: v.finalFocus !== void 0 && v.finalFocus !== !0,
|
|
19
19
|
side: r,
|
|
20
|
-
children: /* @__PURE__ */
|
|
20
|
+
children: /* @__PURE__ */ h(_.Popup, {
|
|
21
21
|
...v,
|
|
22
|
-
render: /* @__PURE__ */
|
|
22
|
+
render: /* @__PURE__ */ h(n, {
|
|
23
23
|
backgroundColor: a,
|
|
24
24
|
borderRadius: s,
|
|
25
|
-
boxShadow:
|
|
26
|
-
padding:
|
|
27
|
-
...
|
|
28
|
-
className: e(o,
|
|
29
|
-
style:
|
|
25
|
+
boxShadow: c,
|
|
26
|
+
padding: l,
|
|
27
|
+
...g,
|
|
28
|
+
className: e(o, f),
|
|
29
|
+
style: p
|
|
30
30
|
})
|
|
31
31
|
})
|
|
32
32
|
}) });
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
return m.map(e, (e) => typeof e == "string" || typeof e == "number" ? /* @__PURE__ */
|
|
34
|
+
function b(e) {
|
|
35
|
+
return m.map(e, (e) => typeof e == "string" || typeof e == "number" ? /* @__PURE__ */ h(r, {
|
|
36
36
|
as: "span",
|
|
37
37
|
font: "label",
|
|
38
38
|
size: "sm",
|
|
39
39
|
children: e
|
|
40
40
|
}) : e);
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
var x = (e) => e == null || e === !1 || e === "" ? void 0 : e, S = (e, t) => t !== void 0 && (typeof e == "string" || typeof e == "number") ? String(e) : void 0, C = (e) => e ? {
|
|
43
|
+
flexDirection: "column",
|
|
44
|
+
alignItems: "stretch",
|
|
45
|
+
justifyContent: "center",
|
|
46
|
+
gap: "4",
|
|
47
|
+
paddingBlock: "8"
|
|
48
|
+
} : {
|
|
49
|
+
alignItems: "center",
|
|
50
|
+
gap: "8"
|
|
51
|
+
};
|
|
52
|
+
function w({ variant: r = "neutral", description: a, display: o = "flex", minBlockSize: s = "sm", paddingInline: l = "12", borderRadius: u = "sm", color: d = r === "danger" ? "danger" : "fg", className: f, style: p, children: m, ...g }) {
|
|
53
|
+
let [_, v] = t(g), y = x(a);
|
|
54
|
+
return /* @__PURE__ */ h(c, {
|
|
55
|
+
label: S(m, y),
|
|
56
|
+
...v,
|
|
57
|
+
description: y,
|
|
58
|
+
render: /* @__PURE__ */ h(n, {
|
|
59
|
+
...C(y !== void 0),
|
|
60
|
+
display: o,
|
|
61
|
+
minBlockSize: s,
|
|
51
62
|
paddingInline: l,
|
|
52
63
|
borderRadius: u,
|
|
53
64
|
color: d,
|
|
54
|
-
...
|
|
55
|
-
className: e(i,
|
|
56
|
-
style:
|
|
65
|
+
..._,
|
|
66
|
+
className: e(i, f),
|
|
67
|
+
style: p
|
|
57
68
|
}),
|
|
58
|
-
children:
|
|
69
|
+
children: b(m)
|
|
59
70
|
});
|
|
60
71
|
}
|
|
61
|
-
function
|
|
62
|
-
let [
|
|
63
|
-
return /* @__PURE__ */
|
|
64
|
-
|
|
72
|
+
function T({ href: r, disabled: o = !1, closeOnClick: s = !0, onClick: c, description: u, display: d = "flex", minBlockSize: f = "sm", paddingInline: p = "12", borderRadius: m = "sm", color: g = "fg", className: _, style: v, children: y, ...w }) {
|
|
73
|
+
let [T, E] = t(w), D = x(u);
|
|
74
|
+
return /* @__PURE__ */ h(l, {
|
|
75
|
+
label: S(y, D),
|
|
76
|
+
...E,
|
|
65
77
|
"aria-disabled": o || void 0,
|
|
66
78
|
closeOnClick: !o && s,
|
|
79
|
+
description: D,
|
|
67
80
|
href: o ? void 0 : r,
|
|
68
81
|
onClick: o ? void 0 : c,
|
|
69
|
-
render: /* @__PURE__ */
|
|
82
|
+
render: /* @__PURE__ */ h(n, {
|
|
70
83
|
as: "a",
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
style: b
|
|
84
|
+
...C(D !== void 0),
|
|
85
|
+
display: d,
|
|
86
|
+
minBlockSize: f,
|
|
87
|
+
paddingInline: p,
|
|
88
|
+
borderRadius: m,
|
|
89
|
+
color: g,
|
|
90
|
+
...T,
|
|
91
|
+
className: e(i, a, _),
|
|
92
|
+
style: v
|
|
81
93
|
}),
|
|
82
|
-
children:
|
|
94
|
+
children: b(y)
|
|
83
95
|
});
|
|
84
96
|
}
|
|
85
|
-
function
|
|
97
|
+
function E({ paddingBlock: r = "4", paddingInline: i = "8", className: a, style: o, ...c }) {
|
|
86
98
|
let [l, u] = t(c);
|
|
87
|
-
return /* @__PURE__ */
|
|
99
|
+
return /* @__PURE__ */ h(_.Separator, {
|
|
88
100
|
...u,
|
|
89
|
-
render: /* @__PURE__ */
|
|
101
|
+
render: /* @__PURE__ */ h(n, {
|
|
90
102
|
paddingBlock: r,
|
|
91
103
|
paddingInline: i,
|
|
92
104
|
...l,
|
|
@@ -95,17 +107,17 @@ function x({ paddingBlock: r = "4", paddingInline: i = "8", className: a, style:
|
|
|
95
107
|
})
|
|
96
108
|
});
|
|
97
109
|
}
|
|
98
|
-
function
|
|
110
|
+
function D({ label: e, className: i, style: a, children: o, ...s }) {
|
|
99
111
|
let [c, l] = t(s);
|
|
100
|
-
return /* @__PURE__ */
|
|
112
|
+
return /* @__PURE__ */ g(_.Group, {
|
|
101
113
|
...l,
|
|
102
|
-
render: /* @__PURE__ */
|
|
114
|
+
render: /* @__PURE__ */ h(n, {
|
|
103
115
|
...c,
|
|
104
116
|
className: i,
|
|
105
117
|
style: a
|
|
106
118
|
}),
|
|
107
|
-
children: [/* @__PURE__ */
|
|
108
|
-
render: /* @__PURE__ */
|
|
119
|
+
children: [/* @__PURE__ */ h(_.GroupLabel, {
|
|
120
|
+
render: /* @__PURE__ */ h(r, {
|
|
109
121
|
as: "div",
|
|
110
122
|
color: "fgMuted",
|
|
111
123
|
font: "label",
|
|
@@ -117,13 +129,13 @@ function S({ label: e, className: i, style: a, children: o, ...s }) {
|
|
|
117
129
|
}), o]
|
|
118
130
|
});
|
|
119
131
|
}
|
|
120
|
-
var
|
|
121
|
-
Trigger:
|
|
122
|
-
Popup:
|
|
123
|
-
Item:
|
|
124
|
-
LinkItem:
|
|
125
|
-
Separator:
|
|
126
|
-
Group:
|
|
132
|
+
var O = Object.assign(v, {
|
|
133
|
+
Trigger: p,
|
|
134
|
+
Popup: y,
|
|
135
|
+
Item: w,
|
|
136
|
+
LinkItem: T,
|
|
137
|
+
Separator: E,
|
|
138
|
+
Group: D
|
|
127
139
|
});
|
|
128
140
|
//#endregion
|
|
129
|
-
export {
|
|
141
|
+
export { O as Menu };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@layer tokens, reset, atoms, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.search-field, components.tabs, components.tag, components.text-field, components.toast, components.visually-hidden;
|
|
1
|
+
@layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.search-field, components.tabs, components.tag, components.text-field, components.toast, components.visually-hidden;
|
|
2
2
|
@layer components.multiselect{._1seauxl0{text-align:start;justify-content:stretch}:where(._1seauxl0) ._1gwwloa0{flex:auto;justify-items:stretch;min-inline-size:0}:where(._1seauxl0) ._1gwwloa1{min-inline-size:0}:where(._1seauxl0) ._1gwwloa2{flex:auto;min-inline-size:0}._1seauxl1{min-inline-size:0;display:block}._1seauxl1[data-placeholder]{color:var(--color-fg-muted)}._1seauxl2{min-inline-size:0;display:grid}._1seauxl3{grid-area:1/1}._1seauxl3[aria-hidden=true]{visibility:hidden}._1seauxl4{grid-area:1/1}._1seauxl5{border:var(--space-1) solid var(--color-border);min-inline-size:var(--anchor-width);max-block-size:var(--available-height);transform-origin:var(--transform-origin);transition:opacity var(--duration-fast) var(--easing-standard), scale var(--duration-fast) var(--easing-enter);overflow-y:auto}._1seauxl5:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}._1seauxl5[data-starting-style],._1seauxl5[data-ending-style]{opacity:0;scale:calc(1 - var(--scale-med))}._1seauxl6{cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}._1seauxl6:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:calc(-1 * var(--space-2))}._1seauxl6[data-highlighted]{background-color:light-dark(var(--color-bg-muted),color-mix(in srgb, var(--color-fg) 10%, var(--color-bg-raised)))}._1seauxl6[aria-disabled=true]{color:var(--color-fg-muted);cursor:not-allowed}._1seauxl7{visibility:hidden;flex-shrink:0}._1seauxl6[aria-selected=true] ._1seauxl7{visibility:visible}@media (forced-colors:active){._1seauxl6[data-highlighted]{forced-color-adjust:none;color:highlighttext;background-color:highlight}._1seauxl6[data-highlighted]:focus-visible{color:canvastext;background-color:canvas}._1seauxl6[aria-disabled=true]{color:graytext}}}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { splitStyleProps as e } from "../styles/split-style-props.mjs";
|
|
3
|
-
import { Box as t } from "../Box/
|
|
3
|
+
import { Box as t } from "../Box/base.mjs";
|
|
4
4
|
import { Text as n } from "../Text/index.mjs";
|
|
5
5
|
import { PopupScope as r, triggerElement as i, useClosingRule as a, usePopupScope as o, useRecordOpenChange as s } from "../popup/client.mjs";
|
|
6
6
|
import { Field as c } from "../Field/index.mjs";
|
|
7
7
|
import { ChevronDownIcon as l } from "../icons/ChevronDownIcon.mjs";
|
|
8
8
|
import { labels as u, popup as d, summary as f, trigger as p, value as m } from "./MultiSelect.css.mjs";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { createContext as h, use as g, useId as _, useLayoutEffect as v, useMemo as y, useRef as b, useState as x } from "react";
|
|
10
|
+
import { jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
11
11
|
import { Select as w } from "@base-ui/react/select";
|
|
12
12
|
//#region src/MultiSelect/client.tsx
|
|
13
13
|
function T({ options: e, placeholder: t, countLabel: n, disabled: r, size: a }) {
|
|
14
|
-
let { ref: s } = o(), c =
|
|
15
|
-
return /* @__PURE__ */
|
|
14
|
+
let { ref: s } = o(), c = y(() => new Map(e.map((e) => [e.value, e.label])), [e]);
|
|
15
|
+
return /* @__PURE__ */ S(w.Trigger, {
|
|
16
16
|
disabled: r,
|
|
17
17
|
ref: s,
|
|
18
18
|
render: i({
|
|
@@ -20,10 +20,10 @@ function T({ options: e, placeholder: t, countLabel: n, disabled: r, size: a })
|
|
|
20
20
|
size: a,
|
|
21
21
|
iconEnd: l,
|
|
22
22
|
className: p,
|
|
23
|
-
children: /* @__PURE__ */
|
|
23
|
+
children: /* @__PURE__ */ S(w.Value, {
|
|
24
24
|
className: m,
|
|
25
25
|
placeholder: t,
|
|
26
|
-
children: (e) => e.length > 0 ? /* @__PURE__ */
|
|
26
|
+
children: (e) => e.length > 0 ? /* @__PURE__ */ S(E, {
|
|
27
27
|
count: n.replaceAll("{count}", String(e.length)),
|
|
28
28
|
labels: e.map((e) => c.get(e) ?? e)
|
|
29
29
|
}) : t
|
|
@@ -32,8 +32,8 @@ function T({ options: e, placeholder: t, countLabel: n, disabled: r, size: a })
|
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
function E({ labels: e, count: r }) {
|
|
35
|
-
let i =
|
|
36
|
-
|
|
35
|
+
let i = b(null), [a, o] = x(!0), s = e.join(", ");
|
|
36
|
+
v(() => {
|
|
37
37
|
let e = i.current;
|
|
38
38
|
if (!e) return;
|
|
39
39
|
let t = () => o(e.scrollWidth <= e.clientWidth);
|
|
@@ -42,17 +42,17 @@ function E({ labels: e, count: r }) {
|
|
|
42
42
|
return n.observe(e), () => n.disconnect();
|
|
43
43
|
}, [s]);
|
|
44
44
|
let c = !a && e.length > 1;
|
|
45
|
-
return /* @__PURE__ */
|
|
45
|
+
return /* @__PURE__ */ C(t, {
|
|
46
46
|
as: "span",
|
|
47
47
|
className: f,
|
|
48
|
-
children: [/* @__PURE__ */
|
|
48
|
+
children: [/* @__PURE__ */ S(n, {
|
|
49
49
|
"aria-hidden": c || void 0,
|
|
50
50
|
as: "span",
|
|
51
51
|
className: u,
|
|
52
52
|
ref: i,
|
|
53
53
|
truncate: "box",
|
|
54
54
|
children: s
|
|
55
|
-
}), c && /* @__PURE__ */
|
|
55
|
+
}), c && /* @__PURE__ */ S(n, {
|
|
56
56
|
as: "span",
|
|
57
57
|
className: "_1seauxl4",
|
|
58
58
|
truncate: "box",
|
|
@@ -60,31 +60,31 @@ function E({ labels: e, count: r }) {
|
|
|
60
60
|
})]
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
|
-
var D =
|
|
63
|
+
var D = h(void 0);
|
|
64
64
|
function O({ children: e }) {
|
|
65
|
-
return /* @__PURE__ */
|
|
66
|
-
value:
|
|
65
|
+
return /* @__PURE__ */ S(r, { children: /* @__PURE__ */ S(D, {
|
|
66
|
+
value: _(),
|
|
67
67
|
children: e
|
|
68
68
|
}) });
|
|
69
69
|
}
|
|
70
70
|
function k(e) {
|
|
71
|
-
return /* @__PURE__ */
|
|
71
|
+
return /* @__PURE__ */ S(w.Root, {
|
|
72
72
|
...e,
|
|
73
73
|
multiple: !0,
|
|
74
74
|
onOpenChange: s()
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
function A({ children: e }) {
|
|
78
|
-
return /* @__PURE__ */
|
|
79
|
-
id:
|
|
78
|
+
return /* @__PURE__ */ S(c.Label, {
|
|
79
|
+
id: g(D),
|
|
80
80
|
nativeLabel: !1,
|
|
81
81
|
children: e
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
function j({ children: e }) {
|
|
85
|
-
return /* @__PURE__ */
|
|
86
|
-
"aria-labelledby":
|
|
87
|
-
render: /* @__PURE__ */
|
|
85
|
+
return /* @__PURE__ */ S(w.Popup, {
|
|
86
|
+
"aria-labelledby": g(D),
|
|
87
|
+
render: /* @__PURE__ */ S(t, {
|
|
88
88
|
backgroundColor: "bgRaised",
|
|
89
89
|
borderRadius: "med",
|
|
90
90
|
boxShadow: "med",
|
|
@@ -96,19 +96,19 @@ function j({ children: e }) {
|
|
|
96
96
|
}
|
|
97
97
|
function M({ children: e }) {
|
|
98
98
|
let { container: t } = o();
|
|
99
|
-
return /* @__PURE__ */
|
|
99
|
+
return /* @__PURE__ */ S(w.Portal, {
|
|
100
100
|
container: t,
|
|
101
101
|
children: e
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
104
|
function N({ children: t }) {
|
|
105
|
-
return /* @__PURE__ */
|
|
105
|
+
return /* @__PURE__ */ S(w.Positioner, {
|
|
106
106
|
align: "start",
|
|
107
107
|
alignItemWithTrigger: !1,
|
|
108
108
|
collisionPadding: 8,
|
|
109
109
|
render: (t, { open: n }) => {
|
|
110
110
|
let [, r] = e(t);
|
|
111
|
-
return /* @__PURE__ */
|
|
111
|
+
return /* @__PURE__ */ S(P, {
|
|
112
112
|
...r,
|
|
113
113
|
open: n
|
|
114
114
|
});
|
|
@@ -119,7 +119,7 @@ function N({ children: t }) {
|
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
121
|
function P({ open: e, ref: n, ...r }) {
|
|
122
|
-
return /* @__PURE__ */
|
|
122
|
+
return /* @__PURE__ */ S(t, {
|
|
123
123
|
...r,
|
|
124
124
|
...a(n, {
|
|
125
125
|
finalFocus: !1,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@layer tokens, reset, atoms, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.search-field, components.tabs, components.tag, components.text-field, components.toast, components.visually-hidden;
|
|
1
|
+
@layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.search-field, components.tabs, components.tag, components.text-field, components.toast, components.visually-hidden;
|
|
2
2
|
@layer components.search-field{._1cj8r6g0{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:0;padding:0;position:absolute;overflow:hidden}._1cj8r6g2{grid-template-columns:var(--space-8) auto minmax(0, 1fr) auto var(--space-4)}._1cj8r6g3{grid-template-columns:var(--space-12) auto minmax(0, 1fr) auto var(--space-4)}._1cj8r6g4{grid-template-columns:var(--space-16) auto minmax(0, 1fr) auto var(--space-4)}._1cj8r6g5{appearance:none;border-width:var(--space-1);border-style:solid;border-color:var(--color-border-strong);border-radius:var(--radius-med);background-color:var(--color-bg);inline-size:100%;min-inline-size:0;color:var(--color-fg);grid-area:1/1/auto/-1;padding-block:0}._1cj8r6g5::placeholder{color:var(--color-fg-muted);opacity:1}._1cj8r6g5:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}._1cj8r6g5:disabled{background-color:var(--color-bg-muted);color:var(--color-fg-muted);cursor:not-allowed;border-style:dashed}._1cj8r6g5[aria-invalid=true]{border-color:var(--color-danger)}._1cj8r6g5::-webkit-search-cancel-button{appearance:none}._1cj8r6g5::-webkit-search-decoration{appearance:none}._1cj8r6g6{block-size:var(--size-sm);padding-inline-start:calc(var(--space-8) + var(--space-8) + var(--font-size-sm));padding-inline-end:var(--size-sm)}._1cj8r6g7{block-size:var(--size-med);padding-inline-start:calc(var(--space-12) + var(--space-8) + var(--font-size-med));padding-inline-end:var(--size-med)}._1cj8r6g8{block-size:var(--size-lg);padding-inline-start:calc(var(--space-16) + var(--space-8) + var(--font-size-lg));padding-inline-end:var(--size-lg)}._1cj8r6g9{pointer-events:none;color:var(--color-fg-muted);grid-area:1/2}._1cj8r6ga{border-color:#0000;grid-area:1/4}@media (forced-colors:active){._1cj8r6g5:disabled{color:graytext;border-color:graytext}}}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Box as e } from "../Box/
|
|
2
|
+
import { Box as e } from "../Box/base.mjs";
|
|
3
3
|
import { Text as t } from "../Text/index.mjs";
|
|
4
4
|
import { IconButton as n } from "../IconButton/index.mjs";
|
|
5
5
|
import { SearchIcon as r } from "../icons/SearchIcon.mjs";
|
|
6
6
|
import { XIcon as i } from "../icons/XIcon.mjs";
|
|
7
7
|
import { icon as a, input as o, root as s } from "./SearchField.css.mjs";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { useRef as c, useState as l } from "react";
|
|
9
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
10
10
|
import { Input as f } from "@base-ui/react/input";
|
|
11
11
|
//#region src/SearchField/client.tsx
|
|
12
12
|
var p = {
|
|
@@ -24,26 +24,26 @@ var p = {
|
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
function m({ value: m, defaultValue: h, onValueChange: g, placeholder: _, size: v, disabled: y, required: b, name: x, clearLabel: S, inputProps: { ref: C, onKeyDown: w, ...T } = {} }) {
|
|
27
|
-
let E =
|
|
27
|
+
let E = c(null), [D, O] = l(h), k = m ?? D, A = (e) => {
|
|
28
28
|
m === void 0 && O(e), g?.(e);
|
|
29
29
|
}, j = k !== "" && (m === void 0 || g !== void 0), M = (e) => {
|
|
30
30
|
if (w?.(e), e.defaultPrevented) return;
|
|
31
31
|
let t = e.nativeEvent.isComposing || e.keyCode === 229;
|
|
32
32
|
e.key === "Escape" && j && !t && (e.preventDefault(), e.stopPropagation(), A(""));
|
|
33
33
|
}, N = p[v];
|
|
34
|
-
return /* @__PURE__ */
|
|
34
|
+
return /* @__PURE__ */ d(e, {
|
|
35
35
|
alignItems: "center",
|
|
36
36
|
className: s({ size: v }),
|
|
37
37
|
display: "grid",
|
|
38
38
|
children: [
|
|
39
|
-
/* @__PURE__ */
|
|
39
|
+
/* @__PURE__ */ u(f, {
|
|
40
40
|
...T,
|
|
41
41
|
name: x,
|
|
42
42
|
onKeyDown: M,
|
|
43
43
|
onValueChange: A,
|
|
44
44
|
placeholder: _,
|
|
45
45
|
ref: C,
|
|
46
|
-
render: /* @__PURE__ */
|
|
46
|
+
render: /* @__PURE__ */ u(t, {
|
|
47
47
|
as: "input",
|
|
48
48
|
className: o({ size: v }),
|
|
49
49
|
ref: E,
|
|
@@ -53,11 +53,11 @@ function m({ value: m, defaultValue: h, onValueChange: g, placeholder: _, size:
|
|
|
53
53
|
type: "search",
|
|
54
54
|
value: k
|
|
55
55
|
}),
|
|
56
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ u(r, {
|
|
57
57
|
className: a,
|
|
58
58
|
size: v
|
|
59
59
|
}),
|
|
60
|
-
k !== "" && !y && /* @__PURE__ */
|
|
60
|
+
k !== "" && !y && /* @__PURE__ */ u(n, {
|
|
61
61
|
className: "_1cj8r6ga",
|
|
62
62
|
icon: i,
|
|
63
63
|
label: S,
|
package/dist/Stack/Stack.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@layer tokens, reset, atoms, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.search-field, components.tabs, components.tag, components.text-field, components.toast, components.visually-hidden;
|
|
1
|
+
@layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.search-field, components.tabs, components.tag, components.text-field, components.toast, components.visually-hidden;
|
|
2
2
|
@layer components.stack;
|
package/dist/Stack/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PolymorphicProps } from "../types.mjs";
|
|
2
|
-
import { StyleProps } from "../Box/
|
|
2
|
+
import { StyleProps } from "../Box/base.mjs";
|
|
3
|
+
import "../Box/index.mjs";
|
|
3
4
|
import { ElementType } from "react";
|
|
4
5
|
//#region src/Stack/index.d.ts
|
|
5
6
|
type Gap = StyleProps["gap"];
|
package/dist/Tabs/Tabs.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@layer tokens, reset, atoms, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.search-field, components.tabs, components.tag, components.text-field, components.toast, components.visually-hidden;
|
|
1
|
+
@layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.search-field, components.tabs, components.tag, components.text-field, components.toast, components.visually-hidden;
|
|
2
2
|
@layer components.tabs{.xowpd00{border-block-end:var(--space-1) solid var(--color-border)}.xowpd00[aria-orientation=vertical]{border-block-end:none;border-inline-end:var(--space-1) solid var(--color-border);flex-direction:column}.xowpd01{transition:color var(--duration-fast) var(--easing-standard)}.xowpd01[aria-selected=true]{color:var(--color-fg)}.xowpd01[aria-disabled=true]{opacity:.5}.xowpd02{border-block-end:var(--space-2) solid var(--color-accent);opacity:0;scale:calc(1 - var(--scale-lg)) 1;transition:opacity var(--duration-med) var(--easing-standard), scale var(--duration-med) var(--easing-standard);pointer-events:none;inset-block-end:calc(-1 * var(--space-1));inset-inline:0}[data-orientation=vertical]>.xowpd02{inset-inline:auto;border-block-end:none;border-inline-end:var(--space-2) solid var(--color-accent);scale:1 calc(1 - var(--scale-lg));inset-block:0;inset-inline-end:calc(-1 * var(--space-1))}[aria-selected=true]>.xowpd02{opacity:1;scale:1}.xowpd03:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}.xowpd03[data-orientation=vertical]{flex-basis:0}@media (hover:hover){.xowpd01:not([aria-disabled=true]):hover{color:var(--color-fg)}}@media (forced-colors:active){.xowpd01[aria-disabled=true]{color:graytext}.xowpd02{border-color:highlight}}}
|
package/dist/Tabs/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { join as e } from "../styles/join.mjs";
|
|
2
2
|
import { splitStyleProps as t } from "../styles/split-style-props.mjs";
|
|
3
|
-
import { Box as n } from "../Box/
|
|
3
|
+
import { Box as n } from "../Box/base.mjs";
|
|
4
4
|
import { Clickable as r } from "../Clickable/index.mjs";
|
|
5
5
|
import { Text as i } from "../Text/index.mjs";
|
|
6
6
|
import { splitTextProps as a } from "../styles/split-text-props.mjs";
|