@jonmilner/ui 0.21.1 → 0.22.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/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/AlertDialog/index.d.mts +1 -1
- package/dist/Avatar/index.d.mts +1 -1
- package/dist/Avatar/index.mjs +5 -5
- package/dist/Badge/index.d.mts +1 -1
- package/dist/Badge/index.mjs +12 -12
- package/dist/Box/index.mjs +1 -1
- package/dist/Button/index.d.mts +1 -1
- package/dist/Button/index.mjs +22 -22
- package/dist/Checkbox/index.mjs +7 -7
- package/dist/Chip/index.mjs +35 -35
- package/dist/Clickable/index.d.mts +1 -1
- package/dist/Clickable/index.mjs +4 -4
- package/dist/ColorField/ColorField.css +1 -1
- package/dist/ColorField/client.mjs +6 -6
- package/dist/ColorField/index.mjs +14 -14
- package/dist/Combobox/Combobox.css +1 -1
- package/dist/Combobox/client.mjs +26 -26
- package/dist/Combobox/index.mjs +20 -20
- package/dist/Dialog/client.mjs +26 -26
- package/dist/Dialog/index.d.mts +1 -1
- package/dist/Dialog/index.mjs +19 -19
- package/dist/Field/client.mjs +6 -6
- package/dist/Field/index.mjs +29 -29
- package/dist/IconButton/IconButton.css +1 -1
- package/dist/IconButton/IconButton.css.mjs +2 -2
- package/dist/IconButton/index.d.mts +5 -2
- package/dist/IconButton/index.mjs +60 -21
- package/dist/Inline/index.d.mts +2 -2
- package/dist/Inline/index.mjs +4 -4
- package/dist/Menu/Menu.css +1 -1
- package/dist/Menu/Menu.css.mjs +2 -2
- package/dist/Menu/client.d.mts +1 -0
- package/dist/Menu/client.mjs +95 -53
- package/dist/Menu/index.d.mts +8 -0
- package/dist/Menu/index.mjs +123 -87
- package/dist/MultiSelect/MultiSelect.css +1 -1
- package/dist/MultiSelect/client.mjs +4 -4
- package/dist/MultiSelect/index.mjs +8 -8
- package/dist/NavList/NavList.css +1 -1
- package/dist/NavList/client.mjs +3 -3
- package/dist/NavList/index.d.mts +3 -3
- package/dist/NavList/index.mjs +67 -65
- package/dist/NumberField/NumberField.css +1 -1
- package/dist/NumberField/index.mjs +17 -17
- package/dist/RadioGroup/index.mjs +23 -23
- package/dist/SearchField/SearchField.css +1 -1
- package/dist/SearchField/client.mjs +13 -13
- package/dist/SearchField/index.mjs +16 -16
- package/dist/Select/Select.css +1 -1
- package/dist/Select/client.mjs +11 -11
- package/dist/Select/index.mjs +8 -8
- package/dist/Sidebar/index.d.mts +1 -1
- package/dist/Sidebar/index.mjs +21 -21
- package/dist/SidebarLayout/index.d.mts +1 -1
- package/dist/SidebarLayout/index.mjs +8 -8
- package/dist/Stack/index.d.mts +2 -2
- package/dist/Stack/index.mjs +4 -4
- package/dist/Switch/index.mjs +13 -13
- package/dist/Table/index.d.mts +1 -1
- package/dist/Table/index.mjs +59 -59
- package/dist/Tabs/index.mjs +26 -26
- package/dist/Tag/index.d.mts +1 -1
- package/dist/Tag/index.mjs +16 -16
- package/dist/Text/index.d.mts +2 -2
- package/dist/Text/index.mjs +4 -4
- package/dist/TextField/TextField.css +1 -1
- package/dist/TextField/index.mjs +16 -16
- package/dist/Textarea/Textarea.css +1 -1
- package/dist/Textarea/index.mjs +9 -9
- package/dist/Toast/client.d.mts +2 -1
- package/dist/Toast/client.mjs +62 -55
- package/dist/Tooltip/base.mjs +13 -13
- package/dist/contrast/contrast.d.mts +1 -1
- package/dist/contrast/contrast.mjs +9 -9
- package/dist/contrast/mixes.mjs +27 -27
- package/dist/docs/Combobox.md +1 -0
- package/dist/docs/IconButton.md +9 -1
- package/dist/docs/Menu.md +51 -3
- package/dist/docs/MultiSelect.md +1 -0
- package/dist/docs/NavList.md +2 -2
- package/dist/docs/Select.md +1 -0
- package/dist/docs/Toast.md +7 -0
- package/dist/docs/llms.txt +1 -1
- package/dist/docs/manifest.json +118 -1
- package/dist/docs/migrations/0.22.0.md +35 -0
- package/dist/icons/index.d.mts +3 -3
- package/dist/icons/index.mjs +33 -33
- package/dist/index.d.mts +16 -16
- package/dist/index.mjs +39 -39
- package/dist/lint/index.mjs +1 -0
- package/dist/popup/client.d.mts +1 -1
- package/dist/popup/client.mjs +49 -32
- package/dist/popup/direction.d.mts +1 -0
- package/dist/popup/direction.mjs +23 -0
- package/dist/popup/listbox-base.mjs +24 -24
- package/dist/popup/listbox-options.mjs +4 -4
- package/dist/popup/listbox-row.mjs +1 -0
- package/dist/popup/tooltip.d.mts +1 -0
- package/dist/popup/tooltip.mjs +48 -42
- package/dist/theme/define-theme.mjs +42 -42
- package/package.json +2 -2
package/dist/Combobox/client.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Box as e } from "../Box/base.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { CheckIcon as t } from "../icons/CheckIcon.mjs";
|
|
4
4
|
import { usePopupScope as n, useRecordOpenChange as r } from "../popup/client.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { listboxPlacement as i, listboxPopupBox as a, listboxTriggerLook as o, renderListboxPositioner as s, useListboxLabelId as c } from "../popup/listbox-base.mjs";
|
|
6
|
+
import { listboxRow as l } from "../popup/listbox-row.mjs";
|
|
7
|
+
import { ListboxSummary as u } from "../popup/listbox-summary.mjs";
|
|
8
|
+
import { Text as d } from "../Text/index.mjs";
|
|
9
9
|
import { check as f, count as p, item as m, labels as h, list as g, popup as _, summary as v, trigger as y, value as b } from "./Combobox.css.mjs";
|
|
10
10
|
import { createContext as x, use as S, useMemo as C, useState as w } from "react";
|
|
11
11
|
import { jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
@@ -50,32 +50,32 @@ function A({ children: e, defaultValue: t, multiple: n, onValueChange: i, option
|
|
|
50
50
|
})
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
-
function j({ countLabel:
|
|
54
|
-
let { ref:
|
|
53
|
+
function j({ countLabel: t, disabled: r, placeholder: i, size: a }) {
|
|
54
|
+
let { ref: s } = n(), { labelOf: c } = S(O);
|
|
55
55
|
return /* @__PURE__ */ T(D.Trigger, {
|
|
56
|
-
disabled:
|
|
57
|
-
ref:
|
|
58
|
-
render:
|
|
56
|
+
disabled: r,
|
|
57
|
+
ref: s,
|
|
58
|
+
render: o({
|
|
59
59
|
className: y,
|
|
60
|
-
size:
|
|
60
|
+
size: a,
|
|
61
61
|
children: /* @__PURE__ */ T(D.Value, { children: (n) => {
|
|
62
|
-
let
|
|
62
|
+
let r = k(n);
|
|
63
63
|
return /* @__PURE__ */ T(e, {
|
|
64
64
|
as: "span",
|
|
65
65
|
className: b,
|
|
66
|
-
"data-placeholder":
|
|
67
|
-
children:
|
|
66
|
+
"data-placeholder": r.length === 0 ? "" : void 0,
|
|
67
|
+
children: r.length === 0 ? i : typeof n == "string" ? /* @__PURE__ */ T(d, {
|
|
68
68
|
as: "span",
|
|
69
69
|
truncate: "box",
|
|
70
|
-
children:
|
|
71
|
-
}) : /* @__PURE__ */ T(
|
|
70
|
+
children: c(n)
|
|
71
|
+
}) : /* @__PURE__ */ T(u, {
|
|
72
72
|
classNames: {
|
|
73
73
|
count: p,
|
|
74
74
|
labels: h,
|
|
75
75
|
summary: v
|
|
76
76
|
},
|
|
77
|
-
count:
|
|
78
|
-
labels:
|
|
77
|
+
count: t.replaceAll("{count}", String(r.length)),
|
|
78
|
+
labels: r.map(c)
|
|
79
79
|
})
|
|
80
80
|
});
|
|
81
81
|
} })
|
|
@@ -91,33 +91,33 @@ function M({ children: e }) {
|
|
|
91
91
|
}
|
|
92
92
|
function N({ children: e }) {
|
|
93
93
|
return /* @__PURE__ */ T(D.Positioner, {
|
|
94
|
-
...
|
|
95
|
-
render:
|
|
94
|
+
...i,
|
|
95
|
+
render: s,
|
|
96
96
|
children: e
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
function P({ children: e }) {
|
|
100
100
|
return /* @__PURE__ */ T(D.Popup, {
|
|
101
|
-
"aria-labelledby":
|
|
102
|
-
render:
|
|
101
|
+
"aria-labelledby": c(),
|
|
102
|
+
render: a(_),
|
|
103
103
|
children: e
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
function F() {
|
|
107
107
|
let { labelOf: e, option: n } = S(O);
|
|
108
108
|
return /* @__PURE__ */ T(D.List, {
|
|
109
|
-
"aria-labelledby":
|
|
109
|
+
"aria-labelledby": c(),
|
|
110
110
|
className: g,
|
|
111
111
|
children: (r) => /* @__PURE__ */ E(D.Item, {
|
|
112
112
|
disabled: n(r).disabled,
|
|
113
|
-
render:
|
|
113
|
+
render: l(m),
|
|
114
114
|
value: r,
|
|
115
|
-
children: [/* @__PURE__ */ T(
|
|
115
|
+
children: [/* @__PURE__ */ T(d, {
|
|
116
116
|
as: "span",
|
|
117
117
|
font: "label",
|
|
118
118
|
size: "sm",
|
|
119
119
|
children: e(r)
|
|
120
|
-
}), /* @__PURE__ */ T(
|
|
120
|
+
}), /* @__PURE__ */ T(t, {
|
|
121
121
|
className: f,
|
|
122
122
|
size: "sm"
|
|
123
123
|
})]
|
package/dist/Combobox/index.mjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { Field as e } from "../Field/index.mjs";
|
|
2
|
+
import { ListboxLabel as t, ListboxScope as n } from "../popup/listbox-base.mjs";
|
|
3
|
+
import { controlText as r } from "../styles/control-size.mjs";
|
|
4
|
+
import { Text as i } from "../Text/index.mjs";
|
|
5
|
+
import { ComboboxList as a, ComboboxPopup as o, ComboboxPortal as s, ComboboxPositioner as c, ComboboxRoot as l, ComboboxTrigger as u } from "./client.mjs";
|
|
6
|
+
import { empty as d, hiddenLabel as f, input as p } from "./Combobox.css.mjs";
|
|
7
7
|
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
8
8
|
import { Combobox as g } from "@base-ui/react/combobox";
|
|
9
9
|
// src/Combobox/index.tsx
|
|
10
10
|
function _({ options: _, multiple: v = !1, value: y, defaultValue: b, onValueChange: x, label: S, hideLabel: C = !1, description: w, error: T, placeholder: E = "Select", filterLabel: D = "Filter", emptyLabel: O = "No matches", countLabel: k = "{count} selected", disabled: A = !1, required: j = !1, size: M = "med", name: N, className: P, style: F, ...I }) {
|
|
11
|
-
return /* @__PURE__ */ h(
|
|
11
|
+
return /* @__PURE__ */ h(e, {
|
|
12
12
|
...I,
|
|
13
13
|
className: P,
|
|
14
14
|
disabled: A,
|
|
15
15
|
invalid: T != null && T !== !1 && T !== "",
|
|
16
16
|
style: F,
|
|
17
17
|
children: [
|
|
18
|
-
/* @__PURE__ */ m(
|
|
18
|
+
/* @__PURE__ */ m(n, { children: /* @__PURE__ */ h(l, {
|
|
19
19
|
defaultValue: b,
|
|
20
20
|
disabled: A,
|
|
21
21
|
multiple: v,
|
|
@@ -25,40 +25,40 @@ function _({ options: _, multiple: v = !1, value: y, defaultValue: b, onValueCha
|
|
|
25
25
|
required: j,
|
|
26
26
|
value: y,
|
|
27
27
|
children: [
|
|
28
|
-
/* @__PURE__ */ m(
|
|
29
|
-
className: C ?
|
|
28
|
+
/* @__PURE__ */ m(t, {
|
|
29
|
+
className: C ? f : void 0,
|
|
30
30
|
children: S
|
|
31
31
|
}),
|
|
32
|
-
/* @__PURE__ */ m(
|
|
32
|
+
/* @__PURE__ */ m(u, {
|
|
33
33
|
countLabel: k,
|
|
34
34
|
disabled: A,
|
|
35
35
|
placeholder: E,
|
|
36
36
|
size: M
|
|
37
37
|
}),
|
|
38
|
-
/* @__PURE__ */ m(
|
|
38
|
+
/* @__PURE__ */ m(s, { children: /* @__PURE__ */ m(c, { children: /* @__PURE__ */ h(o, { children: [
|
|
39
39
|
/* @__PURE__ */ m(g.Input, {
|
|
40
40
|
"aria-label": D,
|
|
41
41
|
"aria-labelledby": void 0,
|
|
42
|
-
render: /* @__PURE__ */ m(
|
|
42
|
+
render: /* @__PURE__ */ m(i, {
|
|
43
43
|
as: "input",
|
|
44
|
-
className:
|
|
45
|
-
size:
|
|
44
|
+
className: p({ size: M }),
|
|
45
|
+
size: r[M]
|
|
46
46
|
})
|
|
47
47
|
}),
|
|
48
48
|
/* @__PURE__ */ m(g.Empty, {
|
|
49
|
-
render: /* @__PURE__ */ m(
|
|
50
|
-
className:
|
|
49
|
+
render: /* @__PURE__ */ m(i, {
|
|
50
|
+
className: d,
|
|
51
51
|
color: "fgMuted",
|
|
52
52
|
size: "sm"
|
|
53
53
|
}),
|
|
54
54
|
children: O
|
|
55
55
|
}),
|
|
56
|
-
/* @__PURE__ */ m(
|
|
56
|
+
/* @__PURE__ */ m(a, {})
|
|
57
57
|
] }) }) })
|
|
58
58
|
]
|
|
59
59
|
}) }),
|
|
60
|
-
w != null && /* @__PURE__ */ m(
|
|
61
|
-
/* @__PURE__ */ m(
|
|
60
|
+
w != null && /* @__PURE__ */ m(e.Description, { children: w }),
|
|
61
|
+
/* @__PURE__ */ m(e.Error, { children: T })
|
|
62
62
|
]
|
|
63
63
|
});
|
|
64
64
|
}
|
package/dist/Dialog/client.mjs
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { Box as e } from "../Box/base.mjs";
|
|
3
|
+
import { PopupScope as t, triggerElement as n, useClosingRule as r, usePopupScope as i, useRecordOpenChange as a } from "../popup/client.mjs";
|
|
4
|
+
import { join as o } from "../styles/join.mjs";
|
|
5
|
+
import { splitStyleProps as s } from "../styles/split-style-props.mjs";
|
|
6
6
|
import { jsx as c } from "react/jsx-runtime";
|
|
7
7
|
import { Dialog as l } from "@base-ui/react/dialog";
|
|
8
8
|
// src/Dialog/client.tsx
|
|
9
|
-
function u({ disabled: e = !1, handle: t, payload:
|
|
10
|
-
let { ref: s } =
|
|
9
|
+
function u({ disabled: e = !1, handle: t, payload: r, id: a, ...o }) {
|
|
10
|
+
let { ref: s } = i();
|
|
11
11
|
return /* @__PURE__ */ c(l.Trigger, {
|
|
12
12
|
disabled: e,
|
|
13
13
|
handle: t,
|
|
14
|
-
payload:
|
|
15
|
-
id:
|
|
14
|
+
payload: r,
|
|
15
|
+
id: a,
|
|
16
16
|
ref: s,
|
|
17
|
-
render:
|
|
17
|
+
render: n(o)
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
function d({ disabled: e = !1, ...t }) {
|
|
21
21
|
return /* @__PURE__ */ c(l.Close, {
|
|
22
22
|
disabled: e,
|
|
23
|
-
render:
|
|
23
|
+
render: n(t)
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
function f({ children: e }) {
|
|
27
|
-
let { container: t } =
|
|
27
|
+
let { container: t } = i();
|
|
28
28
|
return /* @__PURE__ */ c(l.Portal, {
|
|
29
29
|
container: t,
|
|
30
30
|
children: e
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
function p(e) {
|
|
34
|
-
return /* @__PURE__ */ c(
|
|
34
|
+
return /* @__PURE__ */ c(t, { children: /* @__PURE__ */ c(m, { ...e }) });
|
|
35
35
|
}
|
|
36
36
|
function m({ onOpenChange: e, ...t }) {
|
|
37
37
|
return /* @__PURE__ */ c(l.Root, {
|
|
38
38
|
...t,
|
|
39
|
-
onOpenChange:
|
|
39
|
+
onOpenChange: a(e)
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
function h({ frame: e, ...
|
|
43
|
-
let
|
|
42
|
+
function h({ frame: e, ...t }) {
|
|
43
|
+
let n = t.finalFocus !== void 0 && t.finalFocus !== !0;
|
|
44
44
|
return /* @__PURE__ */ c(l.Popup, {
|
|
45
|
-
...
|
|
46
|
-
render: (
|
|
47
|
-
let [,
|
|
45
|
+
...t,
|
|
46
|
+
render: (t, { open: r }) => {
|
|
47
|
+
let [, i] = s(t);
|
|
48
48
|
return /* @__PURE__ */ c(g, {
|
|
49
|
-
...
|
|
50
|
-
finalFocus:
|
|
49
|
+
...i,
|
|
50
|
+
finalFocus: n,
|
|
51
51
|
frame: e,
|
|
52
|
-
open:
|
|
52
|
+
open: r
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
-
function g({ open: t, finalFocus:
|
|
58
|
-
return /* @__PURE__ */ c(
|
|
57
|
+
function g({ open: t, finalFocus: n, frame: i, ref: a, className: s, style: l, ...u }) {
|
|
58
|
+
return /* @__PURE__ */ c(e, {
|
|
59
59
|
...u,
|
|
60
60
|
...i,
|
|
61
|
-
...a
|
|
62
|
-
finalFocus:
|
|
61
|
+
...r(a, {
|
|
62
|
+
finalFocus: n,
|
|
63
63
|
modal: !0,
|
|
64
64
|
open: t
|
|
65
65
|
}),
|
|
66
|
-
className:
|
|
66
|
+
className: o(s, i.className),
|
|
67
67
|
style: {
|
|
68
68
|
...l,
|
|
69
69
|
...i.style
|
package/dist/Dialog/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BoxProps } from "../Box/base.mjs";
|
|
2
2
|
import { PartProps } from "../styles/part-props.mjs";
|
|
3
|
-
import { size as size$1 } from "./Dialog.css.mjs";
|
|
4
3
|
import { DialogClose, DialogCloseProps, DialogTrigger, DialogTriggerProps } from "./client.mjs";
|
|
4
|
+
import { size as size$1 } from "./Dialog.css.mjs";
|
|
5
5
|
import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
|
|
6
6
|
import { ReactNode } from "react";
|
|
7
7
|
export type DialogProps = Pick<Dialog$1.Root.Props, "open" | "defaultOpen" | "onOpenChange" | "onOpenChangeComplete"> & {
|
package/dist/Dialog/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { Box as e } from "../Box/base.mjs";
|
|
2
|
+
import { Heading as t } from "../Heading/index.mjs";
|
|
3
|
+
import { join as n } from "../styles/join.mjs";
|
|
4
|
+
import { splitStyleProps as r } from "../styles/split-style-props.mjs";
|
|
5
|
+
import { Text as i } from "../Text/index.mjs";
|
|
6
6
|
import { DialogClose as a, DialogPopupFrame as o, DialogPortal as s, DialogRootScope as c, DialogTrigger as l } from "./client.mjs";
|
|
7
7
|
import { backdrop as u, popup as d, size as f } from "./Dialog.css.mjs";
|
|
8
8
|
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
@@ -12,8 +12,8 @@ function g(e) {
|
|
|
12
12
|
return /* @__PURE__ */ p(c, { ...e });
|
|
13
13
|
}
|
|
14
14
|
function _({ title: a, description: c, size: l = "med", position: g = "fixed", margin: _ = "auto", blockSize: v = "fit", display: y = "flex", flexDirection: b = "column", gap: x = "16", padding: S = "24", backgroundColor: C = "bgRaised", borderRadius: w = "lg", boxShadow: T = "lg", overflow: E = "auto", className: D, style: O, children: k, ...A }) {
|
|
15
|
-
let [j, M] =
|
|
16
|
-
return /* @__PURE__ */ m(s, { children: [/* @__PURE__ */ p(h.Backdrop, { render: /* @__PURE__ */ p(
|
|
15
|
+
let [j, M] = r(A);
|
|
16
|
+
return /* @__PURE__ */ m(s, { children: [/* @__PURE__ */ p(h.Backdrop, { render: /* @__PURE__ */ p(e, {
|
|
17
17
|
className: u,
|
|
18
18
|
position: "fixed",
|
|
19
19
|
zIndex: "modal"
|
|
@@ -34,38 +34,38 @@ function _({ title: a, description: c, size: l = "med", position: g = "fixed", m
|
|
|
34
34
|
boxShadow: T,
|
|
35
35
|
overflow: E,
|
|
36
36
|
...j,
|
|
37
|
-
className:
|
|
37
|
+
className: n(d, f[l], D),
|
|
38
38
|
style: O
|
|
39
39
|
},
|
|
40
|
-
children: [/* @__PURE__ */ m(
|
|
40
|
+
children: [/* @__PURE__ */ m(e, {
|
|
41
41
|
display: "flex",
|
|
42
42
|
flexDirection: "column",
|
|
43
43
|
gap: "8",
|
|
44
44
|
children: [/* @__PURE__ */ p(h.Title, {
|
|
45
|
-
render: /* @__PURE__ */ p(
|
|
45
|
+
render: /* @__PURE__ */ p(t, {
|
|
46
46
|
as: "h2",
|
|
47
47
|
size: "lg"
|
|
48
48
|
}),
|
|
49
49
|
children: a
|
|
50
50
|
}), c == null ? null : /* @__PURE__ */ p(h.Description, {
|
|
51
|
-
render: /* @__PURE__ */ p(
|
|
51
|
+
render: /* @__PURE__ */ p(i, { color: "fgMuted" }),
|
|
52
52
|
children: c
|
|
53
53
|
})]
|
|
54
54
|
}), k]
|
|
55
55
|
})] });
|
|
56
56
|
}
|
|
57
|
-
function v({ display:
|
|
58
|
-
return /* @__PURE__ */ p(
|
|
59
|
-
display:
|
|
60
|
-
flexDirection:
|
|
57
|
+
function v({ display: t = "flex", flexDirection: n = "column", gap: r = "12", ...i }) {
|
|
58
|
+
return /* @__PURE__ */ p(e, {
|
|
59
|
+
display: t,
|
|
60
|
+
flexDirection: n,
|
|
61
61
|
gap: r,
|
|
62
62
|
...i
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
-
function y({ display:
|
|
66
|
-
return /* @__PURE__ */ p(
|
|
67
|
-
display:
|
|
68
|
-
flexWrap:
|
|
65
|
+
function y({ display: t = "flex", flexWrap: n = "wrap", justifyContent: r = "end", gap: i = "8", ...a }) {
|
|
66
|
+
return /* @__PURE__ */ p(e, {
|
|
67
|
+
display: t,
|
|
68
|
+
flexWrap: n,
|
|
69
69
|
justifyContent: r,
|
|
70
70
|
gap: i,
|
|
71
71
|
...a
|
package/dist/Field/client.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { Box as e } from "../Box/base.mjs";
|
|
3
|
+
import { CircleAlertIcon as t } from "../icons/CircleAlertIcon.mjs";
|
|
4
|
+
import { splitStyleProps as n } from "../styles/split-style-props.mjs";
|
|
5
5
|
import { icon as r } from "./Field.css.mjs";
|
|
6
6
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
7
|
import { Field as o } from "@base-ui/react/field";
|
|
@@ -10,11 +10,11 @@ function s({ size: s, ...c }) {
|
|
|
10
10
|
return /* @__PURE__ */ i(o.Error, {
|
|
11
11
|
...c,
|
|
12
12
|
render: (o) => {
|
|
13
|
-
let [, c] =
|
|
14
|
-
return /* @__PURE__ */ a(
|
|
13
|
+
let [, c] = n(o);
|
|
14
|
+
return /* @__PURE__ */ a(e, {
|
|
15
15
|
as: "span",
|
|
16
16
|
...c,
|
|
17
|
-
children: [/* @__PURE__ */ i(
|
|
17
|
+
children: [/* @__PURE__ */ i(t, {
|
|
18
18
|
className: r,
|
|
19
19
|
size: s
|
|
20
20
|
}), o.children]
|
package/dist/Field/index.mjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { Box as e } from "../Box/base.mjs";
|
|
2
|
+
import { join as t } from "../styles/join.mjs";
|
|
3
|
+
import { splitStyleProps as n } from "../styles/split-style-props.mjs";
|
|
4
|
+
import { splitTextProps as r } from "../styles/split-text-props.mjs";
|
|
5
|
+
import { Text as i } from "../Text/index.mjs";
|
|
6
|
+
import { FieldErrorMessage as a } from "./client.mjs";
|
|
7
|
+
import { error as o, label as s } from "./Field.css.mjs";
|
|
8
8
|
import { Children as c } from "react";
|
|
9
9
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
10
|
import { Field as d } from "@base-ui/react/field";
|
|
11
11
|
// src/Field/index.tsx
|
|
12
|
-
function f({ display:
|
|
13
|
-
let [c, u] =
|
|
12
|
+
function f({ display: t = "flex", flexDirection: r = "column", gap: i = "8", className: a, style: o, ...s }) {
|
|
13
|
+
let [c, u] = n(s);
|
|
14
14
|
return /* @__PURE__ */ l(d.Root, {
|
|
15
15
|
...u,
|
|
16
|
-
render: /* @__PURE__ */ l(
|
|
17
|
-
display:
|
|
16
|
+
render: /* @__PURE__ */ l(e, {
|
|
17
|
+
display: t,
|
|
18
18
|
flexDirection: r,
|
|
19
19
|
gap: i,
|
|
20
20
|
...c,
|
|
@@ -23,29 +23,29 @@ function f({ display: e = "flex", flexDirection: r = "column", gap: i = "8", cla
|
|
|
23
23
|
})
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
function p({ nativeLabel:
|
|
27
|
-
let [m, h] =
|
|
26
|
+
function p({ nativeLabel: e = !0, size: a = "sm", font: o = "label", weight: c = "medium", className: u, style: f, ...p }) {
|
|
27
|
+
let [m, h] = r(p), [g, _] = n(h);
|
|
28
28
|
return /* @__PURE__ */ l(d.Label, {
|
|
29
29
|
..._,
|
|
30
|
-
nativeLabel:
|
|
31
|
-
render: /* @__PURE__ */ l(
|
|
32
|
-
as:
|
|
33
|
-
font:
|
|
30
|
+
nativeLabel: e,
|
|
31
|
+
render: /* @__PURE__ */ l(i, {
|
|
32
|
+
as: e ? "label" : "span",
|
|
33
|
+
font: o,
|
|
34
34
|
size: a,
|
|
35
35
|
weight: c,
|
|
36
36
|
...m,
|
|
37
37
|
...g,
|
|
38
|
-
className:
|
|
38
|
+
className: t(s, u),
|
|
39
39
|
style: f
|
|
40
40
|
})
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
function m({ size: e = "sm", color:
|
|
44
|
-
let [c, u] =
|
|
43
|
+
function m({ size: e = "sm", color: t = "fgMuted", className: a, style: o, ...s }) {
|
|
44
|
+
let [c, u] = r(s), [f, p] = n(u);
|
|
45
45
|
return /* @__PURE__ */ l(d.Description, {
|
|
46
46
|
...p,
|
|
47
|
-
render: /* @__PURE__ */ l(
|
|
48
|
-
color:
|
|
47
|
+
render: /* @__PURE__ */ l(i, {
|
|
48
|
+
color: t,
|
|
49
49
|
size: e,
|
|
50
50
|
...c,
|
|
51
51
|
...f,
|
|
@@ -54,9 +54,9 @@ function m({ size: e = "sm", color: n = "fgMuted", className: a, style: o, ...s
|
|
|
54
54
|
})
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
-
function h({ children:
|
|
58
|
-
let [g, _] =
|
|
59
|
-
return /* @__PURE__ */ u(
|
|
57
|
+
function h({ children: e, match: s, size: d = "sm", color: f = "danger", className: p, style: m, ...h }) {
|
|
58
|
+
let [g, _] = r(h), [v, y] = n(_), b = c.toArray(e).some((e) => e !== "");
|
|
59
|
+
return /* @__PURE__ */ u(i, {
|
|
60
60
|
"aria-atomic": !0,
|
|
61
61
|
"aria-live": "assertive",
|
|
62
62
|
as: "div",
|
|
@@ -64,12 +64,12 @@ function h({ children: n, match: o, size: d = "sm", color: f = "danger", classNa
|
|
|
64
64
|
size: d,
|
|
65
65
|
...g,
|
|
66
66
|
...v,
|
|
67
|
-
className:
|
|
67
|
+
className: t(o, p),
|
|
68
68
|
style: m,
|
|
69
|
-
children: [/* @__PURE__ */ l(
|
|
69
|
+
children: [/* @__PURE__ */ l(a, {
|
|
70
70
|
...y,
|
|
71
|
-
...b && { children:
|
|
72
|
-
match:
|
|
71
|
+
...b && { children: e },
|
|
72
|
+
match: s ?? (b || void 0),
|
|
73
73
|
size: d
|
|
74
74
|
}), ""]
|
|
75
75
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
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.icon-button{.n2fy8x0{--_5qoq940:transparent;--_5qoq941:40%;--_5qoq942:var(--space-12);border-width:var(--space-1);border-style:solid}.n2fy8x0[aria-disabled=true]{background-color:var(--color-bg-muted);border-color:var(--color-border-strong);color:var(--color-fg-muted);border-style:dashed}.n2fy8x0:not([aria-disabled=true]):not([aria-busy=true])[aria-expanded=true]{--_5qoq941:70%;--_5qoq942:var(--space-20);background-image:linear-gradient(color-mix(in srgb, var(--color-fg) 15%, transparent), color-mix(in srgb, var(--color-fg) 15%, transparent));box-shadow:inset 0 0 0 var(--space-1) currentColor, 0 0 var(--_5qoq942) color-mix(in srgb, var(--_5qoq940) var(--_5qoq941), transparent)}.n2fy8x0:not([aria-disabled=true]):not([aria-busy=true]):focus-visible{--_5qoq941:70%;--_5qoq942:var(--space-20)}.n2fy8x2{--_5qoq940:var(--color-accent-fill);border-color:#0000}.n2fy8x3{border-color:var(--color-border)}.n2fy8x4{border-color:#0000}.n2fy8x8{color:var(--color-fg-muted)}.
|
|
2
|
+
@keyframes n2fy8xa{to{opacity:.25}}@layer components.icon-button{.n2fy8x0{--_5qoq940:transparent;--_5qoq941:40%;--_5qoq942:var(--space-12);border-width:var(--space-1);border-style:solid}.n2fy8x0[aria-disabled=true]{background-color:var(--color-bg-muted);border-color:var(--color-border-strong);color:var(--color-fg-muted);border-style:dashed}.n2fy8x0:not([aria-disabled=true]):not([aria-busy=true])[aria-expanded=true]{--_5qoq941:70%;--_5qoq942:var(--space-20);background-image:linear-gradient(color-mix(in srgb, var(--color-fg) 15%, transparent), color-mix(in srgb, var(--color-fg) 15%, transparent));box-shadow:inset 0 0 0 var(--space-1) currentColor, 0 0 var(--_5qoq942) color-mix(in srgb, var(--_5qoq940) var(--_5qoq941), transparent)}.n2fy8x0:not([aria-disabled=true]):not([aria-busy=true]):focus-visible{--_5qoq941:70%;--_5qoq942:var(--space-20)}.n2fy8x2{--_5qoq940:var(--color-accent-fill);border-color:#0000}.n2fy8x3{border-color:var(--color-border)}.n2fy8x4{border-color:#0000}.n2fy8x8{justify-items:center}.n2fy8x9{grid-area:1/1}.n2fy8x0[aria-busy=true] .n2fy8x9{opacity:0}.n2fy8xb{grid-area:1/1}.n2fy8xc{animation-name:n2fy8xa;animation-duration:var(--duration-slow);animation-timing-function:var(--easing-standard);animation-iteration-count:infinite;animation-direction:alternate}.n2fy8xc:nth-child(2){animation-delay:calc(var(--duration-slow) / 3)}.n2fy8xc:nth-child(3){animation-delay:calc(var(--duration-slow) * 2 / 3)}.n2fy8xd{color:var(--color-fg-muted)}.n2fy8xd:not([aria-disabled=true])[aria-busy=true],.n2fy8xd:not([aria-disabled=true]):not([aria-busy=true]):focus-visible,.n2fy8xd:not([aria-disabled=true]):not([aria-busy=true])[aria-expanded=true]{color:var(--color-fg)}@media (hover:hover){.n2fy8x0:not([aria-disabled=true]):not([aria-busy=true]):hover{--_5qoq941:70%;--_5qoq942:var(--space-20);background-image:linear-gradient(color-mix(in srgb, var(--color-fg) 15%, transparent), color-mix(in srgb, var(--color-fg) 15%, transparent))}.n2fy8xd:not([aria-disabled=true]):not([aria-busy=true]):hover{color:var(--color-fg)}}@media (forced-colors:active){.n2fy8x0{forced-color-adjust:none}.n2fy8x0:not([aria-disabled=true]):not([aria-busy=true]):hover{background-image:none}.n2fy8x0[aria-disabled=true]{color:graytext;border-color:graytext}.n2fy8x0:not([aria-disabled=true]):not([aria-busy=true])[aria-expanded=true]{box-shadow:inset 0 0 0 var(--space-1) currentColor;background-image:none}.n2fy8x3{--color-fg:ButtonText}.n2fy8x4{border-color:var(--color-border-strong)}}@media (prefers-reduced-motion:reduce){.n2fy8xc{animation-name:none}}}@layer reset{.n2fy8x0{box-shadow:0 0 var(--_5qoq942) color-mix(in srgb, var(--_5qoq940) var(--_5qoq941), transparent)}.n2fy8x0[aria-disabled=true]{box-shadow:none}@media (forced-colors:active){.n2fy8x0{box-shadow:none}}}
|
|
@@ -20,5 +20,5 @@ var t = "n2fy8x0", n = e({
|
|
|
20
20
|
},
|
|
21
21
|
defaultVariants: {},
|
|
22
22
|
compoundVariants: []
|
|
23
|
-
}), r = "n2fy8x8";
|
|
24
|
-
export { n as iconButton,
|
|
23
|
+
}), r = "n2fy8x8", i = "n2fy8x9", a = "n2fy8xb", o = "n2fy8xc", s = "n2fy8xd";
|
|
24
|
+
export { i as content, o as dot, n as iconButton, s as muted, t as root, a as spinner, r as stack };
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { PolymorphicProps } from "../types.mjs";
|
|
2
1
|
import { StyleProps } from "../Box/base.mjs";
|
|
3
2
|
import { ClickableOwnProps } from "../Clickable/index.mjs";
|
|
4
3
|
import { IconProps } from "../Icon/index.mjs";
|
|
4
|
+
import { PolymorphicProps } from "../types.mjs";
|
|
5
5
|
import { ComponentType, ElementType } from "react";
|
|
6
6
|
export type IconButtonOwnProps = {
|
|
7
7
|
icon: ComponentType<IconProps>;
|
|
8
8
|
label: string;
|
|
9
|
+
loading?: boolean;
|
|
9
10
|
size?: "sm" | "med" | "lg";
|
|
10
11
|
variant?: "primary" | "secondary" | "ghost";
|
|
11
12
|
};
|
|
12
13
|
export type IconButtonProps<T extends ElementType = "button"> = PolymorphicProps<T, StyleProps & IconButtonOwnProps & Omit<ClickableOwnProps, "busy">, "busy" | "aria-disabled" | "aria-busy" | "aria-label" | "aria-labelledby" | "children">;
|
|
13
|
-
export declare function IconButton<T extends ElementType = "button">({ label, icon: IconComponent, variant, size, minInlineSize, minBlockSize, borderRadius, backgroundColor, color: colorProp, className, ...props }: IconButtonProps<T>
|
|
14
|
+
export declare function IconButton<T extends ElementType = "button">({ label, icon: IconComponent, variant, size, loading: loadingProp, minInlineSize, minBlockSize, borderRadius, backgroundColor, color: colorProp, className, "aria-busy": ariaBusy, ...props }: IconButtonProps<T> & {
|
|
15
|
+
"aria-busy"?: boolean | "true" | "false";
|
|
16
|
+
}): import("react").JSX.Element;
|
|
@@ -1,26 +1,65 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Box as e } from "../Box/base.mjs";
|
|
2
2
|
import { Clickable as t } from "../Clickable/index.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { Icon as n } from "../Icon/index.mjs";
|
|
4
|
+
import { fills as r } from "../styles/button-fills.mjs";
|
|
5
|
+
import { controlHeight as i, controlText as a } from "../styles/control-size.mjs";
|
|
6
|
+
import { join as o } from "../styles/join.mjs";
|
|
7
|
+
import { content as s, iconButton as c, root as l, stack as u } from "./IconButton.css.mjs";
|
|
8
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
7
9
|
// src/IconButton/index.tsx
|
|
8
|
-
function
|
|
9
|
-
let
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
-
...
|
|
12
|
-
"aria-label":
|
|
10
|
+
function p({ label: p, icon: m, variant: h = "ghost", size: g = "med", loading: _ = !1, minInlineSize: v = i[g], minBlockSize: y = i[g], borderRadius: b = "sm", backgroundColor: x = r[h].backgroundColor, color: S, className: C, "aria-busy": w, ...T }) {
|
|
11
|
+
let E = _ || String(w) === "true", D = T, O = h === "ghost" && S === void 0, k = O ? void 0 : S ?? r[h].color;
|
|
12
|
+
return /* @__PURE__ */ d(t, {
|
|
13
|
+
...D,
|
|
14
|
+
"aria-label": p,
|
|
13
15
|
"aria-labelledby": void 0,
|
|
14
|
-
backgroundColor:
|
|
15
|
-
borderRadius:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
backgroundColor: x,
|
|
17
|
+
borderRadius: b,
|
|
18
|
+
busy: E,
|
|
19
|
+
className: o(l, c({
|
|
20
|
+
variant: h,
|
|
21
|
+
size: g
|
|
22
|
+
}), O && "n2fy8xd", C),
|
|
23
|
+
color: k,
|
|
24
|
+
minBlockSize: y,
|
|
25
|
+
minInlineSize: v,
|
|
26
|
+
children: /* @__PURE__ */ f(e, {
|
|
27
|
+
alignItems: "center",
|
|
28
|
+
as: "span",
|
|
29
|
+
className: u,
|
|
30
|
+
display: "grid",
|
|
31
|
+
children: [/* @__PURE__ */ d(e, {
|
|
32
|
+
as: "span",
|
|
33
|
+
className: s,
|
|
34
|
+
display: "flex",
|
|
35
|
+
children: /* @__PURE__ */ d(m, { size: a[g] })
|
|
36
|
+
}), E && /* @__PURE__ */ f(n, {
|
|
37
|
+
className: "n2fy8xb",
|
|
38
|
+
fill: "currentColor",
|
|
39
|
+
size: a[g],
|
|
40
|
+
stroke: "none",
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ d("circle", {
|
|
43
|
+
className: "n2fy8xc",
|
|
44
|
+
cx: "5",
|
|
45
|
+
cy: "12",
|
|
46
|
+
r: "2"
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ d("circle", {
|
|
49
|
+
className: "n2fy8xc",
|
|
50
|
+
cx: "12",
|
|
51
|
+
cy: "12",
|
|
52
|
+
r: "2"
|
|
53
|
+
}),
|
|
54
|
+
/* @__PURE__ */ d("circle", {
|
|
55
|
+
className: "n2fy8xc",
|
|
56
|
+
cx: "19",
|
|
57
|
+
cy: "12",
|
|
58
|
+
r: "2"
|
|
59
|
+
})
|
|
60
|
+
]
|
|
61
|
+
})]
|
|
62
|
+
})
|
|
24
63
|
});
|
|
25
64
|
}
|
|
26
|
-
export {
|
|
65
|
+
export { p as IconButton };
|
package/dist/Inline/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PolymorphicProps } from "../types.mjs";
|
|
2
|
-
import { StyleProps } from "../Box/base.mjs";
|
|
3
1
|
import "../Box/index.mjs";
|
|
2
|
+
import { StyleProps } from "../Box/base.mjs";
|
|
3
|
+
import { PolymorphicProps } from "../types.mjs";
|
|
4
4
|
import { ElementType } from "react";
|
|
5
5
|
type Gap = StyleProps["gap"];
|
|
6
6
|
type Token = Extract<Gap, string>;
|