@jonmilner/ui 0.18.0 → 0.20.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/Badge/Badge.css +1 -1
- package/dist/Box/Box.css +1 -1
- package/dist/Button/Button.css +1 -1
- package/dist/Checkbox/Checkbox.css +1 -1
- package/dist/Chip/Chip.css +2 -2
- package/dist/Chip/Chip.css.mjs +7 -2
- package/dist/Chip/index.d.mts +3 -2
- package/dist/Chip/index.mjs +57 -39
- package/dist/Clickable/Clickable.css +1 -1
- package/dist/ColorField/ColorField.css +2 -2
- package/dist/ColorField/ColorField.css.mjs +28 -2
- package/dist/ColorField/client.d.mts +1 -1
- package/dist/ColorField/client.mjs +40 -35
- package/dist/ColorField/index.d.mts +3 -2
- package/dist/ColorField/index.mjs +39 -28
- package/dist/Combobox/Combobox.css +1 -1
- package/dist/Dialog/Dialog.css +1 -1
- package/dist/Field/Field.css +1 -1
- package/dist/Heading/Heading.css +1 -1
- package/dist/Icon/Icon.css +1 -1
- package/dist/IconButton/IconButton.css +1 -1
- package/dist/Inline/Inline.css +1 -1
- package/dist/Menu/Menu.css +2 -2
- package/dist/Menu/Menu.css.mjs +2 -2
- package/dist/Menu/client.mjs +45 -54
- package/dist/Menu/index.d.mts +5 -4
- package/dist/Menu/index.mjs +74 -85
- package/dist/Menu/item-row.mjs +52 -0
- package/dist/MultiSelect/MultiSelect.css +1 -1
- package/dist/MultiSelect/client.mjs +5 -4
- package/dist/MultiSelect/index.d.mts +3 -1
- package/dist/MultiSelect/index.mjs +16 -15
- package/dist/NavList/NavList.css +2 -2
- package/dist/NavList/NavList.css.mjs +2 -2
- package/dist/NavList/index.d.mts +3 -1
- package/dist/NavList/index.mjs +67 -63
- package/dist/NumberField/NumberField.css +1 -1
- package/dist/RadioGroup/RadioGroup.css +1 -1
- package/dist/SearchField/SearchField.css +2 -2
- package/dist/SearchField/SearchField.css.mjs +28 -11
- package/dist/SearchField/client.d.mts +1 -1
- package/dist/SearchField/client.mjs +27 -31
- package/dist/SearchField/index.d.mts +3 -2
- package/dist/SearchField/index.mjs +37 -28
- package/dist/Select/Select.css +1 -1
- package/dist/Select/client.mjs +5 -4
- package/dist/Select/index.d.mts +3 -1
- package/dist/Select/index.mjs +15 -14
- package/dist/Sidebar/Sidebar.css +1 -1
- package/dist/Sidebar/index.mjs +1 -2
- package/dist/SidebarLayout/SidebarLayout.css +1 -1
- package/dist/Stack/Stack.css +1 -1
- package/dist/Switch/Switch.css +1 -1
- package/dist/Table/Table.css +1 -1
- package/dist/Table/index.mjs +9 -9
- package/dist/Tabs/Tabs.css +1 -1
- package/dist/Tag/Tag.css +2 -2
- package/dist/Tag/Tag.css.mjs +48 -18
- package/dist/Tag/index.d.mts +2 -1
- package/dist/Tag/index.mjs +55 -47
- package/dist/Text/Text.css +1 -1
- package/dist/TextField/TextField.css +2 -2
- package/dist/TextField/TextField.css.mjs +28 -2
- package/dist/TextField/index.d.mts +3 -2
- package/dist/TextField/index.mjs +45 -33
- package/dist/Textarea/Textarea.css +1 -1
- package/dist/Toast/Toast.css +1 -1
- package/dist/Tooltip/Tooltip.css +1 -1
- package/dist/VisuallyHidden/VisuallyHidden.css +1 -1
- package/dist/base.css +1 -1
- package/dist/docs/Chip.md +10 -3
- package/dist/docs/ColorField.md +7 -0
- package/dist/docs/Menu.md +24 -1
- package/dist/docs/MultiSelect.md +6 -0
- package/dist/docs/NavList.md +10 -7
- package/dist/docs/SearchField.md +6 -0
- package/dist/docs/Select.md +6 -0
- package/dist/docs/Sidebar.md +3 -3
- package/dist/docs/Tag.md +11 -2
- package/dist/docs/TextField.md +13 -1
- package/dist/docs/lint.md +4 -1
- package/dist/docs/llms.txt +3 -3
- package/dist/docs/manifest.json +85 -1
- package/dist/docs/migrations/0.19.0.md +90 -0
- package/dist/docs/migrations/0.20.0.md +48 -0
- package/dist/icon-slot/input-icons.mjs +23 -0
- package/dist/icon-slot/slot.mjs +17 -13
- package/dist/index.mjs +11 -11
- package/dist/lint/index.d.mts +3 -2
- package/dist/lint/index.mjs +1 -1
- package/dist/popup/listbox-base.mjs +3 -2
- package/dist/popup/listbox.mjs +5 -4
- package/dist/styles/atoms.css +1 -1
- package/dist/styles/layers.css +1 -1
- package/dist/styles/responsive.css +1 -1
- package/package.json +1 -1
package/dist/Menu/client.mjs
CHANGED
|
@@ -2,90 +2,81 @@
|
|
|
2
2
|
import { join as e } from "../styles/join.mjs";
|
|
3
3
|
import { splitStyleProps as t } from "../styles/split-style-props.mjs";
|
|
4
4
|
import { Box as n } from "../Box/base.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { useId as
|
|
10
|
-
import {
|
|
11
|
-
import { Menu as
|
|
5
|
+
import { PopupScope as r, triggerElement as i, useClosingRule as a, usePopupScope as o, useRecordOpenChange as s } from "../popup/client.mjs";
|
|
6
|
+
import { IconButton as c } from "../IconButton/index.mjs";
|
|
7
|
+
import { positioner as l } from "./Menu.css.mjs";
|
|
8
|
+
import { DescribedContent as u } from "./item-row.mjs";
|
|
9
|
+
import { useId as d } from "react";
|
|
10
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
11
|
+
import { Menu as p } from "@base-ui/react/menu";
|
|
12
12
|
// src/Menu/client.tsx
|
|
13
|
-
function
|
|
14
|
-
let { ref:
|
|
15
|
-
return /* @__PURE__ */
|
|
13
|
+
function m({ disabled: e = !1, openOnHover: t, delay: n, closeDelay: r, handle: a, payload: s, icon: l, label: u, ...d }) {
|
|
14
|
+
let { ref: m } = o();
|
|
15
|
+
return /* @__PURE__ */ f(p.Trigger, {
|
|
16
16
|
disabled: e,
|
|
17
17
|
openOnHover: t,
|
|
18
18
|
delay: n,
|
|
19
19
|
closeDelay: r,
|
|
20
|
-
handle:
|
|
21
|
-
payload:
|
|
22
|
-
ref:
|
|
23
|
-
render:
|
|
20
|
+
handle: a,
|
|
21
|
+
payload: s,
|
|
22
|
+
ref: m,
|
|
23
|
+
render: l ? /* @__PURE__ */ f(c, {
|
|
24
24
|
...d,
|
|
25
|
-
icon:
|
|
25
|
+
icon: l,
|
|
26
26
|
label: u
|
|
27
|
-
}) :
|
|
27
|
+
}) : i(d)
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
let
|
|
30
|
+
function h(e, t, n) {
|
|
31
|
+
let r = d();
|
|
32
32
|
return t === void 0 ? { content: e } : {
|
|
33
|
-
aria: { "aria-describedby":
|
|
34
|
-
content: /* @__PURE__ */
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
display: "flex",
|
|
38
|
-
gap: "8",
|
|
33
|
+
aria: { "aria-describedby": n ? `${r} ${n}` : r },
|
|
34
|
+
content: /* @__PURE__ */ f(u, {
|
|
35
|
+
description: t,
|
|
36
|
+
id: r,
|
|
39
37
|
children: e
|
|
40
|
-
})
|
|
41
|
-
"aria-hidden": !0,
|
|
42
|
-
as: "span",
|
|
43
|
-
className: u,
|
|
44
|
-
id: a,
|
|
45
|
-
size: "xs",
|
|
46
|
-
children: t
|
|
47
|
-
})] })
|
|
38
|
+
})
|
|
48
39
|
};
|
|
49
40
|
}
|
|
50
|
-
function
|
|
51
|
-
let { aria: r, content: i } =
|
|
52
|
-
return /* @__PURE__ */
|
|
41
|
+
function g({ description: e, children: t, ...n }) {
|
|
42
|
+
let { aria: r, content: i } = h(t, e, n["aria-describedby"]);
|
|
43
|
+
return /* @__PURE__ */ f(p.Item, {
|
|
53
44
|
...n,
|
|
54
45
|
...r,
|
|
55
46
|
children: i
|
|
56
47
|
});
|
|
57
48
|
}
|
|
58
|
-
function
|
|
59
|
-
let { aria: r, content: i } =
|
|
60
|
-
return /* @__PURE__ */
|
|
49
|
+
function _({ description: e, children: t, ...n }) {
|
|
50
|
+
let { aria: r, content: i } = h(t, e, n["aria-describedby"]);
|
|
51
|
+
return /* @__PURE__ */ f(p.LinkItem, {
|
|
61
52
|
...n,
|
|
62
53
|
...r,
|
|
63
54
|
children: i
|
|
64
55
|
});
|
|
65
56
|
}
|
|
66
|
-
function
|
|
67
|
-
let { container: t } =
|
|
68
|
-
return /* @__PURE__ */
|
|
57
|
+
function v({ children: e }) {
|
|
58
|
+
let { container: t } = o();
|
|
59
|
+
return /* @__PURE__ */ f(p.Portal, {
|
|
69
60
|
container: t,
|
|
70
61
|
children: e
|
|
71
62
|
});
|
|
72
63
|
}
|
|
73
|
-
function
|
|
74
|
-
return /* @__PURE__ */
|
|
64
|
+
function y(e) {
|
|
65
|
+
return /* @__PURE__ */ f(r, { children: /* @__PURE__ */ f(b, { ...e }) });
|
|
75
66
|
}
|
|
76
|
-
function
|
|
77
|
-
return /* @__PURE__ */
|
|
67
|
+
function b({ onOpenChange: e, ...t }) {
|
|
68
|
+
return /* @__PURE__ */ f(p.Root, {
|
|
78
69
|
...t,
|
|
79
|
-
onOpenChange:
|
|
70
|
+
onOpenChange: s(e)
|
|
80
71
|
});
|
|
81
72
|
}
|
|
82
|
-
function
|
|
83
|
-
return /* @__PURE__ */
|
|
73
|
+
function x({ finalFocus: e, ...n }) {
|
|
74
|
+
return /* @__PURE__ */ f(p.Positioner, {
|
|
84
75
|
...n,
|
|
85
76
|
collisionPadding: 8,
|
|
86
77
|
render: (n, { open: r }) => {
|
|
87
78
|
let [, i] = t(n);
|
|
88
|
-
return /* @__PURE__ */
|
|
79
|
+
return /* @__PURE__ */ f(S, {
|
|
89
80
|
...i,
|
|
90
81
|
finalFocus: e,
|
|
91
82
|
open: r
|
|
@@ -94,15 +85,15 @@ function w({ finalFocus: e, ...n }) {
|
|
|
94
85
|
sideOffset: 4
|
|
95
86
|
});
|
|
96
87
|
}
|
|
97
|
-
function
|
|
98
|
-
return /* @__PURE__ */
|
|
88
|
+
function S({ open: t, finalFocus: r, ref: i, className: o, ...s }) {
|
|
89
|
+
return /* @__PURE__ */ f(n, {
|
|
99
90
|
...s,
|
|
100
|
-
...
|
|
91
|
+
...a(i, {
|
|
101
92
|
finalFocus: r,
|
|
102
93
|
open: t
|
|
103
94
|
}),
|
|
104
|
-
className: e(
|
|
95
|
+
className: e(l, o),
|
|
105
96
|
zIndex: "popover"
|
|
106
97
|
});
|
|
107
98
|
}
|
|
108
|
-
export {
|
|
99
|
+
export { g as MenuItemPart, _ as MenuLinkItemPart, v as MenuPortal, x as MenuPositioner, y as MenuRootScope, m as MenuTrigger };
|
package/dist/Menu/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { StyleProps } from "../Box/base.mjs";
|
|
2
|
+
import { IconSlotProps } from "../icon-slot/slot.mjs";
|
|
2
3
|
import { MenuTrigger, MenuTriggerProps } from "./client.mjs";
|
|
3
4
|
import { CSSProperties, ReactNode } from "react";
|
|
4
5
|
import { Menu as Menu$1 } from "@base-ui/react/menu";
|
|
@@ -13,10 +14,10 @@ export type MenuPopupProps = PartProps<Menu$1.Popup.Props> & Pick<Menu$1.Positio
|
|
|
13
14
|
type ItemDescription = {
|
|
14
15
|
description?: ReactNode;
|
|
15
16
|
};
|
|
16
|
-
export type MenuItemProps = PartProps<Menu$1.Item.Props> & ItemDescription & {
|
|
17
|
+
export type MenuItemProps = PartProps<Menu$1.Item.Props> & IconSlotProps & ItemDescription & {
|
|
17
18
|
variant?: "neutral" | "danger";
|
|
18
19
|
};
|
|
19
|
-
export type MenuLinkItemProps = PartProps<Menu$1.LinkItem.Props> & ItemDescription & {
|
|
20
|
+
export type MenuLinkItemProps = PartProps<Menu$1.LinkItem.Props> & IconSlotProps & ItemDescription & {
|
|
20
21
|
disabled?: boolean;
|
|
21
22
|
href: string;
|
|
22
23
|
};
|
|
@@ -26,8 +27,8 @@ export type MenuGroupProps = PartProps<Menu$1.Group.Props> & {
|
|
|
26
27
|
};
|
|
27
28
|
declare function MenuRoot(props: MenuProps): import("react").JSX.Element;
|
|
28
29
|
declare function MenuPopup({ side, align, backgroundColor, borderRadius, boxShadow, padding, className, style, ...props }: MenuPopupProps): import("react").JSX.Element;
|
|
29
|
-
declare function MenuItem({ variant, description, display, minBlockSize, paddingInline, borderRadius, color, className, style, children, ...props }: MenuItemProps): import("react").JSX.Element;
|
|
30
|
-
declare function MenuLinkItem({ href, disabled, closeOnClick, onClick, description, display, minBlockSize, paddingInline, borderRadius, color, className, style, children, ...props }: MenuLinkItemProps): import("react").JSX.Element;
|
|
30
|
+
declare function MenuItem({ variant, description, iconStart, iconEnd, display, minBlockSize, paddingInline, borderRadius, color, className, style, children, ...props }: MenuItemProps): import("react").JSX.Element;
|
|
31
|
+
declare function MenuLinkItem({ href, disabled, closeOnClick, onClick, description, iconStart, iconEnd, display, minBlockSize, paddingInline, borderRadius, color, className, style, children, ...props }: MenuLinkItemProps): import("react").JSX.Element;
|
|
31
32
|
declare function MenuSeparator({ paddingBlock, paddingInline, className, style, ...props }: MenuSeparatorProps): import("react").JSX.Element;
|
|
32
33
|
declare function MenuGroup({ label, className, style, children, ...props }: MenuGroupProps): import("react").JSX.Element;
|
|
33
34
|
export declare const Menu: typeof MenuRoot & {
|
package/dist/Menu/index.mjs
CHANGED
|
@@ -3,102 +3,91 @@ import { splitStyleProps as t } from "../styles/split-style-props.mjs";
|
|
|
3
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 {
|
|
8
|
-
import { jsx as
|
|
9
|
-
import { Menu as
|
|
6
|
+
import { itemChildren as c, itemLayout as l } from "./item-row.mjs";
|
|
7
|
+
import { MenuItemPart as u, MenuLinkItemPart as d, MenuPortal as f, MenuPositioner as p, MenuRootScope as m, MenuTrigger as h } from "./client.mjs";
|
|
8
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
9
|
+
import { Menu as v } from "@base-ui/react/menu";
|
|
10
10
|
// src/Menu/index.tsx
|
|
11
|
-
function
|
|
12
|
-
return /* @__PURE__ */
|
|
11
|
+
function y(e) {
|
|
12
|
+
return /* @__PURE__ */ g(m, { ...e });
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
let [
|
|
16
|
-
return /* @__PURE__ */
|
|
14
|
+
function b({ side: r = "bottom", align: i = "start", backgroundColor: a = "bgRaised", borderRadius: s = "med", boxShadow: c = "med", padding: l = "4", className: u, style: d, ...m }) {
|
|
15
|
+
let [h, _] = t(m);
|
|
16
|
+
return /* @__PURE__ */ g(f, { children: /* @__PURE__ */ g(p, {
|
|
17
17
|
align: i,
|
|
18
|
-
finalFocus:
|
|
18
|
+
finalFocus: _.finalFocus !== void 0 && _.finalFocus !== !0,
|
|
19
19
|
side: r,
|
|
20
|
-
children: /* @__PURE__ */
|
|
21
|
-
...
|
|
22
|
-
render: /* @__PURE__ */
|
|
20
|
+
children: /* @__PURE__ */ g(v.Popup, {
|
|
21
|
+
..._,
|
|
22
|
+
render: /* @__PURE__ */ g(n, {
|
|
23
23
|
backgroundColor: a,
|
|
24
24
|
borderRadius: s,
|
|
25
25
|
boxShadow: c,
|
|
26
26
|
padding: l,
|
|
27
|
-
...
|
|
28
|
-
className: e(o,
|
|
29
|
-
style:
|
|
27
|
+
...h,
|
|
28
|
+
className: e(o, u),
|
|
29
|
+
style: d
|
|
30
30
|
})
|
|
31
31
|
})
|
|
32
32
|
}) });
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
};
|
|
52
|
-
function w({ variant: r = "neutral", description: a, display: o = "flex", minBlockSize: s = "sm", paddingInline: l = "12", borderRadius: u = "xs", 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,
|
|
62
|
-
paddingInline: l,
|
|
63
|
-
borderRadius: u,
|
|
64
|
-
color: d,
|
|
65
|
-
..._,
|
|
66
|
-
className: e(i, f),
|
|
67
|
-
style: p
|
|
34
|
+
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;
|
|
35
|
+
function C({ variant: r = "neutral", description: a, iconStart: o, iconEnd: s, display: d = "flex", minBlockSize: f = "sm", paddingInline: p = "12", borderRadius: m = "xs", color: h = r === "danger" ? "danger" : "fg", className: _, style: v, children: y, ...b }) {
|
|
36
|
+
let [C, w] = t(b), T = x(a);
|
|
37
|
+
return /* @__PURE__ */ g(u, {
|
|
38
|
+
label: S(y, T),
|
|
39
|
+
...w,
|
|
40
|
+
description: T,
|
|
41
|
+
render: /* @__PURE__ */ g(n, {
|
|
42
|
+
...l(T !== void 0),
|
|
43
|
+
display: d,
|
|
44
|
+
minBlockSize: f,
|
|
45
|
+
paddingInline: p,
|
|
46
|
+
borderRadius: m,
|
|
47
|
+
color: h,
|
|
48
|
+
...C,
|
|
49
|
+
className: e(i, _),
|
|
50
|
+
style: v
|
|
68
51
|
}),
|
|
69
|
-
children:
|
|
52
|
+
children: c(y, {
|
|
53
|
+
iconStart: o,
|
|
54
|
+
iconEnd: s
|
|
55
|
+
})
|
|
70
56
|
});
|
|
71
57
|
}
|
|
72
|
-
function
|
|
73
|
-
let [
|
|
74
|
-
return /* @__PURE__ */
|
|
75
|
-
label: S(
|
|
76
|
-
...
|
|
58
|
+
function w({ href: r, disabled: o = !1, closeOnClick: s = !0, onClick: u, description: f, iconStart: p, iconEnd: m, display: h = "flex", minBlockSize: _ = "sm", paddingInline: v = "12", borderRadius: y = "xs", color: b = "fg", className: C, style: w, children: T, ...E }) {
|
|
59
|
+
let [D, O] = t(E), k = x(f);
|
|
60
|
+
return /* @__PURE__ */ g(d, {
|
|
61
|
+
label: S(T, k),
|
|
62
|
+
...O,
|
|
77
63
|
"aria-disabled": o || void 0,
|
|
78
64
|
closeOnClick: !o && s,
|
|
79
|
-
description:
|
|
65
|
+
description: k,
|
|
80
66
|
href: o ? void 0 : r,
|
|
81
|
-
onClick: o ? void 0 :
|
|
82
|
-
render: /* @__PURE__ */
|
|
67
|
+
onClick: o ? void 0 : u,
|
|
68
|
+
render: /* @__PURE__ */ g(n, {
|
|
83
69
|
as: "a",
|
|
84
|
-
...
|
|
85
|
-
display:
|
|
86
|
-
minBlockSize:
|
|
87
|
-
paddingInline:
|
|
88
|
-
borderRadius:
|
|
89
|
-
color:
|
|
90
|
-
...
|
|
91
|
-
className: e(i, a,
|
|
92
|
-
style:
|
|
70
|
+
...l(k !== void 0),
|
|
71
|
+
display: h,
|
|
72
|
+
minBlockSize: _,
|
|
73
|
+
paddingInline: v,
|
|
74
|
+
borderRadius: y,
|
|
75
|
+
color: b,
|
|
76
|
+
...D,
|
|
77
|
+
className: e(i, a, C),
|
|
78
|
+
style: w
|
|
93
79
|
}),
|
|
94
|
-
children:
|
|
80
|
+
children: c(T, {
|
|
81
|
+
iconStart: p,
|
|
82
|
+
iconEnd: m
|
|
83
|
+
})
|
|
95
84
|
});
|
|
96
85
|
}
|
|
97
|
-
function
|
|
86
|
+
function T({ paddingBlock: r = "4", paddingInline: i = "8", className: a, style: o, ...c }) {
|
|
98
87
|
let [l, u] = t(c);
|
|
99
|
-
return /* @__PURE__ */
|
|
88
|
+
return /* @__PURE__ */ g(v.Separator, {
|
|
100
89
|
...u,
|
|
101
|
-
render: /* @__PURE__ */
|
|
90
|
+
render: /* @__PURE__ */ g(n, {
|
|
102
91
|
paddingBlock: r,
|
|
103
92
|
paddingInline: i,
|
|
104
93
|
...l,
|
|
@@ -107,17 +96,17 @@ function E({ paddingBlock: r = "4", paddingInline: i = "8", className: a, style:
|
|
|
107
96
|
})
|
|
108
97
|
});
|
|
109
98
|
}
|
|
110
|
-
function
|
|
99
|
+
function E({ label: e, className: i, style: a, children: o, ...s }) {
|
|
111
100
|
let [c, l] = t(s);
|
|
112
|
-
return /* @__PURE__ */
|
|
101
|
+
return /* @__PURE__ */ _(v.Group, {
|
|
113
102
|
...l,
|
|
114
|
-
render: /* @__PURE__ */
|
|
103
|
+
render: /* @__PURE__ */ g(n, {
|
|
115
104
|
...c,
|
|
116
105
|
className: i,
|
|
117
106
|
style: a
|
|
118
107
|
}),
|
|
119
|
-
children: [/* @__PURE__ */
|
|
120
|
-
render: /* @__PURE__ */
|
|
108
|
+
children: [/* @__PURE__ */ g(v.GroupLabel, {
|
|
109
|
+
render: /* @__PURE__ */ g(r, {
|
|
121
110
|
as: "div",
|
|
122
111
|
color: "fgMuted",
|
|
123
112
|
font: "label",
|
|
@@ -129,12 +118,12 @@ function D({ label: e, className: i, style: a, children: o, ...s }) {
|
|
|
129
118
|
}), o]
|
|
130
119
|
});
|
|
131
120
|
}
|
|
132
|
-
var
|
|
133
|
-
Trigger:
|
|
134
|
-
Popup:
|
|
135
|
-
Item:
|
|
136
|
-
LinkItem:
|
|
137
|
-
Separator:
|
|
138
|
-
Group:
|
|
121
|
+
var D = Object.assign(y, {
|
|
122
|
+
Trigger: h,
|
|
123
|
+
Popup: b,
|
|
124
|
+
Item: C,
|
|
125
|
+
LinkItem: w,
|
|
126
|
+
Separator: T,
|
|
127
|
+
Group: E
|
|
139
128
|
});
|
|
140
|
-
export {
|
|
129
|
+
export { D as Menu };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Box as e } from "../Box/base.mjs";
|
|
2
|
+
import { iconGap as t } from "../icon-slot/gap.mjs";
|
|
3
|
+
import { Text as n } from "../Text/index.mjs";
|
|
4
|
+
import { description as r } from "./Menu.css.mjs";
|
|
5
|
+
import { Children as i } from "react";
|
|
6
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
|
+
// src/Menu/item-row.tsx
|
|
8
|
+
function c(e, { iconStart: t, iconEnd: r }) {
|
|
9
|
+
return /* @__PURE__ */ s(a, { children: [
|
|
10
|
+
t && /* @__PURE__ */ o(t, {
|
|
11
|
+
className: "_393eil4",
|
|
12
|
+
size: "sm"
|
|
13
|
+
}),
|
|
14
|
+
i.map(e, (e) => typeof e == "string" || typeof e == "number" ? /* @__PURE__ */ o(n, {
|
|
15
|
+
as: "span",
|
|
16
|
+
font: "label",
|
|
17
|
+
size: "sm",
|
|
18
|
+
children: e
|
|
19
|
+
}) : e),
|
|
20
|
+
r && /* @__PURE__ */ o(r, {
|
|
21
|
+
className: "_393eil4",
|
|
22
|
+
size: "sm"
|
|
23
|
+
})
|
|
24
|
+
] });
|
|
25
|
+
}
|
|
26
|
+
var l = (e) => e ? {
|
|
27
|
+
flexDirection: "column",
|
|
28
|
+
alignItems: "stretch",
|
|
29
|
+
justifyContent: "center",
|
|
30
|
+
gap: "4",
|
|
31
|
+
paddingBlock: "8"
|
|
32
|
+
} : {
|
|
33
|
+
alignItems: "center",
|
|
34
|
+
gap: t.sm
|
|
35
|
+
};
|
|
36
|
+
function u({ children: i, description: c, id: l }) {
|
|
37
|
+
return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(e, {
|
|
38
|
+
alignItems: "center",
|
|
39
|
+
as: "span",
|
|
40
|
+
display: "flex",
|
|
41
|
+
gap: t.sm,
|
|
42
|
+
children: i
|
|
43
|
+
}), /* @__PURE__ */ o(n, {
|
|
44
|
+
"aria-hidden": !0,
|
|
45
|
+
as: "span",
|
|
46
|
+
className: r,
|
|
47
|
+
id: l,
|
|
48
|
+
size: "xs",
|
|
49
|
+
children: c
|
|
50
|
+
})] });
|
|
51
|
+
}
|
|
52
|
+
export { u as DescribedContent, c as itemChildren, l as itemLayout };
|
|
@@ -1,2 +1,2 @@
|
|
|
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.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.number-field, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.
|
|
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.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.number-field, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.visually-hidden, components.nav-list, components.table;
|
|
2
2
|
@layer components.multiselect{._1seauxl0{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:0;padding:0;position:absolute;overflow:hidden}._1seauxl1{text-align:start;border-color:var(--color-border-strong);justify-content:stretch}:where(._1seauxl1) ._1gwwloa0{flex:auto;justify-items:stretch;min-inline-size:0}:where(._1seauxl1) ._1gwwloa1{min-inline-size:0}:where(._1seauxl1) ._1gwwloa2{flex:auto;min-inline-size:0}._1seauxl2{min-inline-size:0;display:block}._1seauxl2[data-placeholder]{color:var(--color-fg-muted)}._1seauxl3{min-inline-size:0;display:grid}._1seauxl4{grid-area:1/1}._1seauxl4[aria-hidden=true]{visibility:hidden}._1seauxl5{grid-area:1/1}._1seauxl6{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}._1seauxl6:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}._1seauxl6[data-starting-style],._1seauxl6[data-ending-style]{opacity:0;scale:calc(1 - var(--scale-med))}._1seauxl7{cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}._1seauxl7:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:calc(-1 * var(--space-2))}._1seauxl7[data-highlighted]{background-color:light-dark(var(--color-bg-muted),color-mix(in srgb, var(--color-fg) 10%, var(--color-bg-raised)))}._1seauxl7[aria-disabled=true]{color:var(--color-fg-muted);cursor:not-allowed}._1seauxl8{visibility:hidden;flex-shrink:0}._1seauxl7[aria-selected=true] ._1seauxl8{visibility:visible}@media (forced-colors:active){._1seauxl1{--color-fg:CanvasText}._1seauxl1[aria-disabled=true]{border-color:graytext}._1seauxl7[data-highlighted]{forced-color-adjust:none;color:highlighttext;background-color:highlight}._1seauxl7[data-highlighted]:focus-visible{color:canvastext;background-color:canvas}._1seauxl7[aria-disabled=true]{color:graytext}}@supports (text-box:trim-both cap alphabetic){._1seauxl4,._1seauxl5{text-box-trim:trim-both}}}
|
|
@@ -7,12 +7,13 @@ import { useMemo as c } from "react";
|
|
|
7
7
|
import { jsx as l } from "react/jsx-runtime";
|
|
8
8
|
import { Select as u } from "@base-ui/react/select";
|
|
9
9
|
// src/MultiSelect/client.tsx
|
|
10
|
-
function d({ options: e, placeholder: d, countLabel: f, disabled: p,
|
|
11
|
-
let
|
|
10
|
+
function d({ options: e, placeholder: d, countLabel: f, disabled: p, iconStart: m, size: h }) {
|
|
11
|
+
let g = c(() => new Map(e.map((e) => [e.value, e.label])), [e]);
|
|
12
12
|
return /* @__PURE__ */ l(n, {
|
|
13
13
|
className: o,
|
|
14
14
|
disabled: p,
|
|
15
|
-
|
|
15
|
+
iconStart: m,
|
|
16
|
+
size: h,
|
|
16
17
|
children: /* @__PURE__ */ l(u.Value, {
|
|
17
18
|
className: s,
|
|
18
19
|
placeholder: d,
|
|
@@ -23,7 +24,7 @@ function d({ options: e, placeholder: d, countLabel: f, disabled: p, size: m })
|
|
|
23
24
|
summary: a
|
|
24
25
|
},
|
|
25
26
|
count: f.replaceAll("{count}", String(e.length)),
|
|
26
|
-
labels: e.map((e) =>
|
|
27
|
+
labels: e.map((e) => g.get(e) ?? e)
|
|
27
28
|
}) : d
|
|
28
29
|
})
|
|
29
30
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { StyleProps } from "../Box/base.mjs";
|
|
2
|
+
import { IconSlotProps } from "../icon-slot/slot.mjs";
|
|
2
3
|
import { ListboxOption } from "../popup/listbox-row.mjs";
|
|
3
4
|
import { CSSProperties, ReactNode } from "react";
|
|
4
5
|
export type MultiSelectOption = ListboxOption;
|
|
@@ -10,6 +11,7 @@ export type MultiSelectProps = StyleProps & {
|
|
|
10
11
|
disabled?: boolean;
|
|
11
12
|
error?: ReactNode;
|
|
12
13
|
hideLabel?: boolean;
|
|
14
|
+
iconStart?: IconSlotProps["iconStart"];
|
|
13
15
|
label: ReactNode;
|
|
14
16
|
name?: string;
|
|
15
17
|
onValueChange?: (value: string[]) => void;
|
|
@@ -20,4 +22,4 @@ export type MultiSelectProps = StyleProps & {
|
|
|
20
22
|
style?: CSSProperties;
|
|
21
23
|
value?: readonly string[];
|
|
22
24
|
};
|
|
23
|
-
export declare function MultiSelect({ options, value, defaultValue, onValueChange, label, hideLabel, description, error, placeholder, countLabel, disabled, required, size, name, className, style, ...atoms }: MultiSelectProps): import("react").JSX.Element;
|
|
25
|
+
export declare function MultiSelect({ options, value, defaultValue, onValueChange, label, hideLabel, iconStart, description, error, placeholder, countLabel, disabled, required, size, name, className, style, ...atoms }: MultiSelectProps): import("react").JSX.Element;
|
|
@@ -6,20 +6,20 @@ import { check as s, hiddenLabel as c, item as l, popup as u } from "./MultiSele
|
|
|
6
6
|
import { MultiSelectRoot as d, MultiSelectTrigger as f } from "./client.mjs";
|
|
7
7
|
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
8
8
|
// src/MultiSelect/index.tsx
|
|
9
|
-
function h({ options: h, value: g, defaultValue: _, onValueChange: v, label: y, hideLabel: b = !1,
|
|
9
|
+
function h({ options: h, value: g, defaultValue: _, onValueChange: v, label: y, hideLabel: b = !1, iconStart: x, description: S, error: C, placeholder: w = "Select", countLabel: T = "{count} selected", disabled: E = !1, required: D = !1, size: O = "med", name: k, className: A, style: j, ...M }) {
|
|
10
10
|
return /* @__PURE__ */ m(e, {
|
|
11
|
-
...
|
|
12
|
-
className:
|
|
13
|
-
disabled:
|
|
14
|
-
invalid:
|
|
15
|
-
style:
|
|
11
|
+
...M,
|
|
12
|
+
className: A,
|
|
13
|
+
disabled: E,
|
|
14
|
+
invalid: C != null && C !== !1 && C !== "",
|
|
15
|
+
style: j,
|
|
16
16
|
children: [
|
|
17
17
|
/* @__PURE__ */ p(n, { children: /* @__PURE__ */ m(d, {
|
|
18
18
|
defaultValue: _,
|
|
19
|
-
disabled:
|
|
20
|
-
name:
|
|
19
|
+
disabled: E,
|
|
20
|
+
name: k,
|
|
21
21
|
onValueChange: v,
|
|
22
|
-
required:
|
|
22
|
+
required: D,
|
|
23
23
|
value: g,
|
|
24
24
|
children: [
|
|
25
25
|
/* @__PURE__ */ p(t, {
|
|
@@ -27,11 +27,12 @@ function h({ options: h, value: g, defaultValue: _, onValueChange: v, label: y,
|
|
|
27
27
|
children: y
|
|
28
28
|
}),
|
|
29
29
|
/* @__PURE__ */ p(f, {
|
|
30
|
-
countLabel:
|
|
31
|
-
disabled:
|
|
30
|
+
countLabel: T,
|
|
31
|
+
disabled: E,
|
|
32
|
+
iconStart: x,
|
|
32
33
|
options: h,
|
|
33
|
-
placeholder:
|
|
34
|
-
size:
|
|
34
|
+
placeholder: w,
|
|
35
|
+
size: O
|
|
35
36
|
}),
|
|
36
37
|
/* @__PURE__ */ p(i, { children: /* @__PURE__ */ p(a, { children: /* @__PURE__ */ p(r, {
|
|
37
38
|
className: u,
|
|
@@ -43,8 +44,8 @@ function h({ options: h, value: g, defaultValue: _, onValueChange: v, label: y,
|
|
|
43
44
|
}) }) })
|
|
44
45
|
]
|
|
45
46
|
}) }),
|
|
46
|
-
|
|
47
|
-
/* @__PURE__ */ p(e.Error, { children:
|
|
47
|
+
S != null && /* @__PURE__ */ p(e.Description, { children: S }),
|
|
48
|
+
/* @__PURE__ */ p(e.Error, { children: C })
|
|
48
49
|
]
|
|
49
50
|
});
|
|
50
51
|
}
|
package/dist/NavList/NavList.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
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.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.number-field, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.
|
|
2
|
-
@layer components.nav-list{._1kvngp01{padding-inline-start:0;list-style:none}._1kvngp02:not(:first-child),:where(._1kvngp02)+._1kvngp03{padding-block-start:var(--space-16)}._1kvngp05{cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}._1kvngp05:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}._1kvngp06{overflow-wrap:anywhere;min-inline-size:0}._1kvngp08{
|
|
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.sidebar, components.sidebar-layout, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.combobox, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.number-field, components.radio-group, components.search-field, components.select, components.switch, components.tabs, components.tag, components.text-field, components.textarea, components.toast, components.tooltip, components.visually-hidden, components.nav-list, components.table;
|
|
2
|
+
@layer components.nav-list{._1kvngp01{padding-inline-start:0;list-style:none}._1kvngp02:not(:first-child),:where(._1kvngp02)+._1kvngp03{padding-block-start:var(--space-16)}._1kvngp05{cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}._1kvngp05:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}._1kvngp06{overflow-wrap:anywhere;min-inline-size:0}._1kvngp08{position:relative}._1kvngp09{inline-size:var(--space-6);block-size:var(--space-6);border-radius:var(--radius-full);background-color:var(--color-success);pointer-events:none;box-shadow:0 0 0 calc(var(--space-2) + var(--space-1)) color-mix(in oklch, var(--color-success) 18%, transparent);flex-shrink:0}._1kvngp0a{inline-size:var(--space-6);block-size:var(--space-6);border-radius:var(--radius-full);background-color:var(--color-success);pointer-events:none;box-shadow:0 0 0 var(--space-2) var(--color-bg-panel);flex-shrink:0;display:none;position:absolute;inset-block-start:calc(var(--space-6) / -2);inset-inline-end:calc(var(--space-6) / -2)}@container _1n4s23v1 (inline-size>=0){._1kvngp04{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:0;padding:0;position:absolute;overflow:hidden}._1kvngp05{--_1kvngp00:1;inline-size:var(--size-med);block-size:var(--size-med);justify-content:center}._1kvngp06,._1kvngp07{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:0;padding:0;position:absolute;overflow:hidden}._1kvngp09{display:none}._1kvngp0a{display:block}}@media (hover:hover){._1kvngp05:not([aria-current=page]):hover{background-image:linear-gradient(color-mix(in srgb, var(--color-fg) 15%, transparent), color-mix(in srgb, var(--color-fg) 15%, transparent))}}@media (forced-colors:active){._1kvngp05:not([aria-current=page]):hover{background-image:none}._1kvngp05[aria-current=page]{color:highlighttext;background-color:highlight}._1kvngp09{forced-color-adjust:none;box-shadow:none;background-color:currentColor}._1kvngp0a{forced-color-adjust:none;box-shadow:0 0 0 var(--space-2) Canvas;background-color:currentColor}}}@layer reset{._1kvngp05{color:inherit;text-decoration:none}}
|
|
@@ -5,5 +5,5 @@ import "./NavList.css";
|
|
|
5
5
|
/* empty css */
|
|
6
6
|
/* empty css */
|
|
7
7
|
// src/NavList/NavList.css.ts
|
|
8
|
-
var e = "var(--_1kvngp00)", t = "_1kvngp01", n = "_1kvngp02", r = "_1kvngp03", i = "_1kvngp04", a = "_1kvngp05", o = "_1kvngp06", s = "_1kvngp07", c = "_1kvngp08";
|
|
9
|
-
export { s as count, r as entry, n as group, i as heading,
|
|
8
|
+
var e = "var(--_1kvngp00)", t = "_1kvngp01", n = "_1kvngp02", r = "_1kvngp03", i = "_1kvngp04", a = "_1kvngp05", o = "_1kvngp06", s = "_1kvngp07", c = "_1kvngp08", l = "_1kvngp09", u = "_1kvngp0a";
|
|
9
|
+
export { u as cornerDot, s as count, r as entry, n as group, i as heading, a as item, o as label, c as lead, t as list, l as liveDot, e as railFlag };
|
package/dist/NavList/index.d.mts
CHANGED
|
@@ -21,6 +21,8 @@ export type NavListItemOwnProps = {
|
|
|
21
21
|
count?: ReactNode;
|
|
22
22
|
current?: boolean;
|
|
23
23
|
icon?: ComponentType<IconProps>;
|
|
24
|
+
live?: boolean;
|
|
25
|
+
liveLabel?: string;
|
|
24
26
|
};
|
|
25
27
|
type NavListItemLeading = {
|
|
26
28
|
avatar?: never;
|
|
@@ -30,7 +32,7 @@ type NavListItemLeading = {
|
|
|
30
32
|
export type NavListItemProps<T extends ElementType = "a"> = PolymorphicProps<T, StyleProps & NavListItemOwnProps, "aria-current"> & NavListItemLeading;
|
|
31
33
|
declare function NavListRoot({ children, ...props }: NavListProps): import("react").JSX.Element;
|
|
32
34
|
declare function NavListGroup({ label, headingLevel, display, flexDirection, gap, className, children, ...props }: NavListGroupProps): import("react").JSX.Element;
|
|
33
|
-
declare function NavListItem<T extends ElementType = "a">({ as, current, icon: ItemIcon, avatar, count, display, alignItems, gap, position, minBlockSize, paddingBlock, paddingInline, borderRadius, backgroundColor, color, className, children, ...props }: NavListItemProps<T>): import("react").JSX.Element;
|
|
35
|
+
declare function NavListItem<T extends ElementType = "a">({ as, current, icon: ItemIcon, avatar, count, live, liveLabel, display, alignItems, gap, position, minBlockSize, paddingBlock, paddingInline, borderRadius, backgroundColor, color, className, children, ...props }: NavListItemProps<T>): import("react").JSX.Element;
|
|
34
36
|
export declare const NavList: typeof NavListRoot & {
|
|
35
37
|
Group: typeof NavListGroup;
|
|
36
38
|
Item: typeof NavListItem;
|