@jonmilner/ui 0.21.2 → 0.23.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/README.md +17 -0
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/Alert/Alert.css +2 -0
- package/dist/Alert/Alert.css.mjs +9 -0
- package/dist/Alert/index.d.mts +13 -0
- package/dist/Alert/index.mjs +45 -0
- package/dist/AlertDialog/client.mjs +4 -4
- package/dist/AlertDialog/index.d.mts +3 -2
- package/dist/AlertDialog/index.mjs +10 -9
- package/dist/Avatar/Avatar.css +1 -1
- package/dist/Avatar/index.d.mts +1 -1
- package/dist/Avatar/index.mjs +5 -5
- package/dist/Badge/Badge.css +1 -1
- package/dist/Badge/index.d.mts +1 -1
- package/dist/Badge/index.mjs +12 -12
- package/dist/Body/index.d.mts +9 -0
- package/dist/Body/index.mjs +12 -0
- package/dist/Box/Box.css +1 -1
- package/dist/Box/index.mjs +1 -1
- package/dist/Button/Button.css +1 -1
- package/dist/Button/index.d.mts +1 -1
- package/dist/Button/index.mjs +22 -22
- package/dist/Caption/index.d.mts +6 -0
- package/dist/Caption/index.mjs +14 -0
- package/dist/Checkbox/Checkbox.css +1 -1
- package/dist/Checkbox/index.mjs +7 -7
- package/dist/Chip/Chip.css +1 -1
- package/dist/Chip/index.mjs +35 -35
- package/dist/Clickable/Clickable.css +1 -1
- package/dist/Clickable/index.d.mts +1 -1
- package/dist/Clickable/index.mjs +4 -4
- package/dist/Code/Code.css +2 -0
- package/dist/Code/Code.css.mjs +7 -0
- package/dist/Code/index.d.mts +10 -0
- package/dist/Code/index.mjs +40 -0
- package/dist/ColorField/ColorField.css +2 -2
- package/dist/ColorField/client.mjs +6 -6
- package/dist/ColorField/index.mjs +14 -14
- package/dist/Combobox/Combobox.css +2 -2
- package/dist/Combobox/client.mjs +26 -26
- package/dist/Combobox/index.mjs +20 -20
- package/dist/Dialog/Dialog.css +2 -2
- package/dist/Dialog/client.d.mts +1 -1
- package/dist/Dialog/client.mjs +30 -28
- package/dist/Dialog/index.d.mts +2 -2
- package/dist/Dialog/index.mjs +19 -19
- package/dist/Field/Field.css +1 -1
- package/dist/Field/client.mjs +6 -6
- package/dist/Field/index.mjs +29 -29
- package/dist/Flex/index.d.mts +5 -0
- package/dist/Flex/index.mjs +14 -0
- package/dist/Heading/Heading.css +1 -1
- package/dist/Icon/Icon.css +1 -1
- package/dist/IconButton/IconButton.css +2 -2
- 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/Inline.css +1 -1
- package/dist/Inline/index.d.mts +2 -2
- package/dist/Inline/index.mjs +4 -4
- package/dist/Label/index.d.mts +9 -0
- package/dist/Label/index.mjs +19 -0
- package/dist/Menu/Menu.css +2 -2
- package/dist/Menu/Menu.css.mjs +1 -1
- package/dist/Menu/client.d.mts +1 -0
- package/dist/Menu/client.mjs +83 -62
- package/dist/Menu/index.d.mts +8 -0
- package/dist/Menu/index.mjs +123 -87
- package/dist/Menu/item-row.mjs +2 -2
- package/dist/MultiSelect/MultiSelect.css +2 -2
- package/dist/MultiSelect/client.mjs +4 -4
- package/dist/MultiSelect/index.mjs +8 -8
- package/dist/NavList/NavList.css +2 -2
- 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 +2 -2
- package/dist/NumberField/index.mjs +17 -17
- package/dist/Popover/Popover.css +2 -0
- package/dist/Popover/Popover.css.mjs +7 -0
- package/dist/Popover/client.d.mts +11 -0
- package/dist/Popover/client.mjs +54 -0
- package/dist/Popover/index.d.mts +20 -0
- package/dist/Popover/index.mjs +39 -0
- package/dist/RadioGroup/RadioGroup.css +1 -1
- package/dist/RadioGroup/index.mjs +23 -23
- package/dist/SearchField/SearchField.css +2 -2
- package/dist/SearchField/client.mjs +13 -13
- package/dist/SearchField/index.mjs +16 -16
- package/dist/Select/Select.css +2 -2
- package/dist/Select/client.mjs +11 -11
- package/dist/Select/index.mjs +8 -8
- package/dist/Sidebar/Sidebar.css +1 -1
- package/dist/Sidebar/index.d.mts +1 -1
- package/dist/Sidebar/index.mjs +21 -21
- package/dist/SidebarLayout/SidebarLayout.css +1 -1
- package/dist/SidebarLayout/index.d.mts +1 -1
- package/dist/SidebarLayout/index.mjs +8 -8
- package/dist/Stack/Stack.css +1 -1
- package/dist/Stack/index.d.mts +2 -2
- package/dist/Stack/index.mjs +4 -4
- package/dist/Switch/Switch.css +1 -1
- package/dist/Switch/index.mjs +13 -13
- package/dist/Table/Table.css +2 -2
- package/dist/Table/Table.css.mjs +4 -2
- package/dist/Table/index.d.mts +4 -10
- package/dist/Table/index.mjs +80 -94
- package/dist/Tabs/Tabs.css +1 -1
- package/dist/Tabs/index.mjs +26 -26
- package/dist/Tag/Tag.css +1 -1
- package/dist/Tag/index.d.mts +1 -1
- package/dist/Tag/index.mjs +16 -16
- package/dist/Text/Text.css +1 -1
- package/dist/Text/index.d.mts +2 -2
- package/dist/Text/index.mjs +4 -4
- package/dist/TextField/TextField.css +2 -2
- package/dist/TextField/index.mjs +16 -16
- package/dist/Textarea/Textarea.css +2 -2
- package/dist/Textarea/index.mjs +9 -9
- package/dist/Toast/Toast.css +2 -2
- package/dist/Toast/Toast.css.mjs +10 -7
- package/dist/Toast/client.d.mts +5 -19
- package/dist/Toast/client.mjs +117 -152
- package/dist/Tooltip/Tooltip.css +1 -1
- package/dist/Tooltip/base.mjs +13 -13
- package/dist/VisuallyHidden/VisuallyHidden.css +1 -1
- package/dist/base.css +2 -2
- package/dist/brands/default.mjs +2 -1
- package/dist/brands/forced-colors.mjs +2 -1
- package/dist/brands/neutral.mjs +8 -7
- package/dist/contrast/contrast.d.mts +1 -1
- package/dist/contrast/contrast.mjs +42 -34
- package/dist/contrast/mixes.mjs +37 -30
- package/dist/docs/Alert.md +106 -0
- package/dist/docs/AlertDialog.md +25 -11
- package/dist/docs/Body.md +74 -0
- package/dist/docs/Box.md +4 -3
- package/dist/docs/Caption.md +77 -0
- package/dist/docs/Code.md +84 -0
- package/dist/docs/ColorField.md +1 -1
- package/dist/docs/Combobox.md +3 -1
- package/dist/docs/Dialog.md +28 -4
- package/dist/docs/Flex.md +76 -0
- package/dist/docs/Icon.md +1 -0
- package/dist/docs/IconButton.md +9 -1
- package/dist/docs/Inline.md +3 -2
- package/dist/docs/Label.md +77 -0
- package/dist/docs/Menu.md +54 -6
- package/dist/docs/MultiSelect.md +2 -0
- package/dist/docs/NavList.md +2 -2
- package/dist/docs/NumberField.md +1 -1
- package/dist/docs/Popover.md +135 -0
- package/dist/docs/SearchField.md +1 -1
- package/dist/docs/Select.md +2 -0
- package/dist/docs/Stack.md +12 -10
- package/dist/docs/Table.md +5 -5
- package/dist/docs/Text.md +30 -23
- package/dist/docs/TextField.md +1 -1
- package/dist/docs/Textarea.md +1 -1
- package/dist/docs/Toast.md +14 -7
- package/dist/docs/Tooltip.md +2 -2
- package/dist/docs/lint.md +18 -0
- package/dist/docs/llms.txt +20 -11
- package/dist/docs/manifest.json +732 -65
- package/dist/docs/migrations/0.22.0.md +35 -0
- package/dist/docs/migrations/0.23.0.md +84 -0
- package/dist/docs/theming.md +3 -3
- package/dist/icons/TriangleAlertIcon.d.mts +2 -0
- package/dist/icons/TriangleAlertIcon.mjs +10 -0
- package/dist/icons/index.d.mts +6 -5
- package/dist/icons/index.mjs +35 -34
- package/dist/index.d.mts +24 -16
- package/dist/index.mjs +47 -40
- package/dist/lint/index.d.mts +20 -1
- package/dist/lint/index.mjs +19 -3
- package/dist/popup/client.d.mts +1 -1
- package/dist/popup/client.mjs +59 -41
- package/dist/popup/direction.d.mts +2 -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/positioner.mjs +27 -0
- package/dist/popup/tooltip.d.mts +1 -0
- package/dist/popup/tooltip.mjs +48 -42
- package/dist/scroll-region/scroll-region.d.mts +12 -0
- package/dist/scroll-region/scroll-region.mjs +29 -0
- package/dist/status-message/status-message.d.mts +5 -0
- package/dist/status-message/status-message.mjs +74 -0
- package/dist/status-message/tones.d.mts +7 -0
- package/dist/status-message/tones.mjs +8 -0
- package/dist/styles/atom-values.mjs +131 -0
- package/dist/styles/atoms.css +1 -1
- package/dist/styles/layers.css +1 -1
- package/dist/styles/responsive.css +1 -1
- package/dist/styles/scroll-region.css +2 -0
- package/dist/styles/scroll-region.css.mjs +7 -0
- package/dist/styles/status-message.css +2 -0
- package/dist/styles/status-message.css.mjs +7 -0
- package/dist/theme/define-theme.mjs +42 -42
- package/dist/tokens/contract.d.mts +1 -1
- package/dist/tokens/roles.d.mts +1 -1
- package/dist/tokens/roles.mjs +1 -1
- package/package.json +30 -2
package/dist/popup/client.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Button as e } from "../Button/index.mjs";
|
|
3
|
+
import { Clickable as t } from "../Clickable/index.mjs";
|
|
4
4
|
import { useThemeContainer as n } from "../theme/use-theme-container.mjs";
|
|
5
5
|
import { createContext as r, use as i, useCallback as a, useLayoutEffect as o, useRef as s } from "react";
|
|
6
6
|
import { jsx as c } from "react/jsx-runtime";
|
|
@@ -12,37 +12,52 @@ var l = r({
|
|
|
12
12
|
}), u = r({ current: {
|
|
13
13
|
keyboard: !1,
|
|
14
14
|
opener: null
|
|
15
|
-
} });
|
|
16
|
-
function
|
|
17
|
-
|
|
15
|
+
} }), d = r(null);
|
|
16
|
+
function f(e, t) {
|
|
17
|
+
return e.element = t, e.parent?.current.nested.add(e), () => {
|
|
18
|
+
e.element = null, e.parent?.current.nested.delete(e);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function p(e, t) {
|
|
22
|
+
return !!e.element?.contains(t) || [...e.nested].some((e) => p(e, t));
|
|
23
|
+
}
|
|
24
|
+
function m({ children: e, nested: t = !1 }) {
|
|
25
|
+
let r = s({
|
|
18
26
|
keyboard: !1,
|
|
19
27
|
opener: null
|
|
28
|
+
}), a = i(d), o = s({
|
|
29
|
+
element: null,
|
|
30
|
+
nested: /* @__PURE__ */ new Set(),
|
|
31
|
+
parent: t ? a : null
|
|
20
32
|
});
|
|
21
33
|
return /* @__PURE__ */ c(l, {
|
|
22
34
|
value: n(),
|
|
23
35
|
children: /* @__PURE__ */ c(u, {
|
|
24
|
-
value:
|
|
25
|
-
children:
|
|
36
|
+
value: r,
|
|
37
|
+
children: /* @__PURE__ */ c(d, {
|
|
38
|
+
value: o,
|
|
39
|
+
children: e
|
|
40
|
+
})
|
|
26
41
|
})
|
|
27
42
|
});
|
|
28
43
|
}
|
|
29
|
-
function
|
|
44
|
+
function h() {
|
|
30
45
|
return i(l);
|
|
31
46
|
}
|
|
32
|
-
function
|
|
33
|
-
return n || r || i || a || o ? /* @__PURE__ */ c(
|
|
47
|
+
function g({ variant: n, size: r, iconStart: i, iconEnd: a, uppercase: o, ...s }) {
|
|
48
|
+
return n || r || i || a || o ? /* @__PURE__ */ c(e, {
|
|
34
49
|
...s,
|
|
35
50
|
variant: n,
|
|
36
51
|
size: r,
|
|
37
52
|
iconStart: i,
|
|
38
53
|
iconEnd: a,
|
|
39
54
|
uppercase: o
|
|
40
|
-
}) : /* @__PURE__ */ c(
|
|
55
|
+
}) : /* @__PURE__ */ c(t, { ...s });
|
|
41
56
|
}
|
|
42
|
-
function
|
|
57
|
+
function _(e) {
|
|
43
58
|
let t = i(u);
|
|
44
59
|
return (n, r) => {
|
|
45
|
-
t.current = n ? {
|
|
60
|
+
e?.(n, r), r.isCanceled || (t.current = n ? {
|
|
46
61
|
keyboard: !1,
|
|
47
62
|
opener: r.trigger ?? null,
|
|
48
63
|
recorded: !0
|
|
@@ -51,10 +66,10 @@ function m(e) {
|
|
|
51
66
|
keyboard: r.event instanceof KeyboardEvent,
|
|
52
67
|
reason: r.reason,
|
|
53
68
|
recorded: !1
|
|
54
|
-
}
|
|
69
|
+
});
|
|
55
70
|
};
|
|
56
71
|
}
|
|
57
|
-
function
|
|
72
|
+
function v(e, t) {
|
|
58
73
|
if (typeof e == "function") {
|
|
59
74
|
let n = e(t);
|
|
60
75
|
return typeof n == "function" ? n : () => e(null);
|
|
@@ -63,43 +78,44 @@ function h(e, t) {
|
|
|
63
78
|
e && (e.current = null);
|
|
64
79
|
};
|
|
65
80
|
}
|
|
66
|
-
var
|
|
81
|
+
var y = /* @__PURE__ */ new Set([
|
|
67
82
|
"trigger-hover",
|
|
68
83
|
"focus-out",
|
|
69
|
-
"outside-press"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
84
|
+
"outside-press",
|
|
85
|
+
"sibling-open"
|
|
86
|
+
]), b;
|
|
87
|
+
function x(e) {
|
|
88
|
+
return b === void 0 && (b = !1, e.createElement("div").focus({ get preventScroll() {
|
|
89
|
+
return b = !0, !1;
|
|
90
|
+
} })), b;
|
|
75
91
|
}
|
|
76
|
-
function
|
|
77
|
-
let { trigger:
|
|
78
|
-
|
|
79
|
-
let n =
|
|
92
|
+
function S(e, { finalFocus: t, modal: n = !1, open: r, returnTo: c }) {
|
|
93
|
+
let { trigger: l } = h(), m = i(u), g = i(d), _ = s(null), b = a((t) => {
|
|
94
|
+
_.current = t;
|
|
95
|
+
let n = v(e, t), r = g && f(g.current, t);
|
|
80
96
|
return () => {
|
|
81
|
-
|
|
97
|
+
_.current = null, r?.(), n();
|
|
82
98
|
};
|
|
83
|
-
}, [e]);
|
|
99
|
+
}, [e, g]);
|
|
84
100
|
return o(() => {
|
|
85
|
-
let e =
|
|
86
|
-
if (!r || !e ||
|
|
101
|
+
let e = _.current;
|
|
102
|
+
if (!r || !e || m.current.recorded) return;
|
|
87
103
|
let { activeElement: t, body: n } = e.ownerDocument, i = t === n || e.contains(t) ? null : t;
|
|
88
|
-
|
|
104
|
+
m.current = {
|
|
89
105
|
keyboard: !1,
|
|
90
106
|
opener: i
|
|
91
107
|
};
|
|
92
|
-
}, [r,
|
|
93
|
-
let e =
|
|
108
|
+
}, [r, m]), o(() => {
|
|
109
|
+
let e = _.current;
|
|
94
110
|
if (!e) return;
|
|
95
111
|
if (r) {
|
|
96
112
|
e.inert = !1;
|
|
97
113
|
return;
|
|
98
114
|
}
|
|
99
|
-
let { reason: i, keyboard: a, opener: o } =
|
|
100
|
-
|
|
101
|
-
let s = o?.isConnected ? o :
|
|
102
|
-
if (!t && s instanceof HTMLElement && (
|
|
115
|
+
let { reason: i, keyboard: a, opener: o } = m.current;
|
|
116
|
+
m.current.recorded = !1;
|
|
117
|
+
let s = c?.current ?? (o?.isConnected ? o : l.current), { activeElement: u } = e.ownerDocument, d = n && i === "outside-press" && x(e.ownerDocument), f = e.contains(u) || [...g?.current.nested ?? []].some((e) => p(e, u));
|
|
118
|
+
if (!t && s instanceof HTMLElement && (d || f && !y.has(i ?? ""))) {
|
|
103
119
|
let e = { preventScroll: !0 };
|
|
104
120
|
a && (e.focusVisible = !0), s.focus(e);
|
|
105
121
|
}
|
|
@@ -108,11 +124,13 @@ function y(e, { finalFocus: t, modal: n = !1, open: r }) {
|
|
|
108
124
|
r,
|
|
109
125
|
t,
|
|
110
126
|
n,
|
|
111
|
-
|
|
112
|
-
|
|
127
|
+
c,
|
|
128
|
+
m,
|
|
129
|
+
g,
|
|
130
|
+
l
|
|
113
131
|
]), {
|
|
114
132
|
"aria-hidden": !r || void 0,
|
|
115
|
-
ref:
|
|
133
|
+
ref: b
|
|
116
134
|
};
|
|
117
135
|
}
|
|
118
|
-
export {
|
|
136
|
+
export { m as PopupScope, g as triggerElement, S as useClosingRule, h as usePopupScope, _ as useRecordOpenChange };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext as e, use as t, useCallback as n, useLayoutEffect as r, useMemo as i, useRef as a, useState as o } from "react";
|
|
3
|
+
// src/popup/direction.tsx
|
|
4
|
+
var s = e({ rtl: !1 });
|
|
5
|
+
function c(e, t, s) {
|
|
6
|
+
let [c, l] = o(!1), u = a(!1), d = n((e) => {
|
|
7
|
+
e?.isConnected && (u.current = !0, l(getComputedStyle(e).direction === "rtl"));
|
|
8
|
+
}, []);
|
|
9
|
+
return r(() => {
|
|
10
|
+
e ? u.current || d(t.current) : u.current = !1;
|
|
11
|
+
}, [
|
|
12
|
+
e,
|
|
13
|
+
t,
|
|
14
|
+
d
|
|
15
|
+
]), [i(() => ({ rtl: c }), [c]), (e, n) => {
|
|
16
|
+
s?.(e, n), e && !n.isCanceled && d(n.trigger ?? t.current);
|
|
17
|
+
}];
|
|
18
|
+
}
|
|
19
|
+
function l(e) {
|
|
20
|
+
let { rtl: n } = t(s);
|
|
21
|
+
return e === "inline-start" ? n ? "right" : "left" : e === "inline-end" ? n ? "left" : "right" : e;
|
|
22
|
+
}
|
|
23
|
+
export { s as TriggerDirection, l as usePhysicalSide, c as useTriggerDirection };
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { Box as e } from "../Box/base.mjs";
|
|
3
|
+
import { Field as t } from "../Field/index.mjs";
|
|
4
|
+
import { ChevronDownIcon as n } from "../icons/ChevronDownIcon.mjs";
|
|
5
|
+
import { splitStyleProps as r } from "../styles/split-style-props.mjs";
|
|
6
|
+
import { PopupScope as i, triggerElement as a, useClosingRule as o } from "./client.mjs";
|
|
7
7
|
import { createContext as s, use as c, useId as l } from "react";
|
|
8
8
|
import { jsx as u } from "react/jsx-runtime";
|
|
9
9
|
// src/popup/listbox-base.tsx
|
|
10
10
|
var d = s(void 0);
|
|
11
11
|
function f({ children: e }) {
|
|
12
|
-
return /* @__PURE__ */ u(
|
|
12
|
+
return /* @__PURE__ */ u(i, { children: /* @__PURE__ */ u(d, {
|
|
13
13
|
value: l(),
|
|
14
14
|
children: e
|
|
15
15
|
}) });
|
|
16
16
|
}
|
|
17
|
-
function p({ children: e, className:
|
|
18
|
-
return /* @__PURE__ */ u(
|
|
19
|
-
className:
|
|
17
|
+
function p({ children: e, className: n }) {
|
|
18
|
+
return /* @__PURE__ */ u(t.Label, {
|
|
19
|
+
className: n,
|
|
20
20
|
id: c(d),
|
|
21
21
|
nativeLabel: !1,
|
|
22
22
|
children: e
|
|
@@ -25,24 +25,24 @@ function p({ children: e, className: t }) {
|
|
|
25
25
|
function m() {
|
|
26
26
|
return c(d);
|
|
27
27
|
}
|
|
28
|
-
function h({ children: e, className: t, iconStart:
|
|
29
|
-
return
|
|
28
|
+
function h({ children: e, className: t, iconStart: r, size: i }) {
|
|
29
|
+
return a({
|
|
30
30
|
variant: "secondary",
|
|
31
31
|
size: i,
|
|
32
32
|
backgroundColor: "bg",
|
|
33
33
|
color: "fg",
|
|
34
|
-
iconStart:
|
|
35
|
-
iconEnd:
|
|
34
|
+
iconStart: r,
|
|
35
|
+
iconEnd: n,
|
|
36
36
|
className: t,
|
|
37
37
|
children: e
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
function g(
|
|
41
|
-
return /* @__PURE__ */ u(
|
|
40
|
+
function g(t) {
|
|
41
|
+
return /* @__PURE__ */ u(e, {
|
|
42
42
|
backgroundColor: "bgRaised",
|
|
43
43
|
borderRadius: "med",
|
|
44
44
|
boxShadow: "med",
|
|
45
|
-
className:
|
|
45
|
+
className: t,
|
|
46
46
|
padding: "4"
|
|
47
47
|
});
|
|
48
48
|
}
|
|
@@ -52,19 +52,19 @@ var _ = {
|
|
|
52
52
|
side: "bottom",
|
|
53
53
|
sideOffset: 4
|
|
54
54
|
};
|
|
55
|
-
function v(
|
|
56
|
-
let [,
|
|
55
|
+
function v(e, { open: t }) {
|
|
56
|
+
let [, n] = r(e);
|
|
57
57
|
return /* @__PURE__ */ u(y, {
|
|
58
|
-
...
|
|
59
|
-
open:
|
|
58
|
+
...n,
|
|
59
|
+
open: t
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
function y({ open:
|
|
63
|
-
return /* @__PURE__ */ u(
|
|
62
|
+
function y({ open: t, ref: n, ...r }) {
|
|
63
|
+
return /* @__PURE__ */ u(e, {
|
|
64
64
|
...r,
|
|
65
|
-
...
|
|
65
|
+
...o(n, {
|
|
66
66
|
finalFocus: !1,
|
|
67
|
-
open:
|
|
67
|
+
open: t
|
|
68
68
|
}),
|
|
69
69
|
zIndex: "popover"
|
|
70
70
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { CheckIcon as e } from "../icons/CheckIcon.mjs";
|
|
2
|
+
import { Text as t } from "../Text/index.mjs";
|
|
3
3
|
import { listboxRow as n } from "./listbox-row.mjs";
|
|
4
4
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
5
|
import { Select as a } from "@base-ui/react/select";
|
|
@@ -11,13 +11,13 @@ function o({ checkClassName: o, itemClassName: s, options: c }) {
|
|
|
11
11
|
render: n(s),
|
|
12
12
|
value: c.value,
|
|
13
13
|
children: [/* @__PURE__ */ r(a.ItemText, {
|
|
14
|
-
render: /* @__PURE__ */ r(
|
|
14
|
+
render: /* @__PURE__ */ r(t, {
|
|
15
15
|
as: "span",
|
|
16
16
|
font: "label",
|
|
17
17
|
size: "sm"
|
|
18
18
|
}),
|
|
19
19
|
children: c.label
|
|
20
|
-
}), /* @__PURE__ */ r(
|
|
20
|
+
}), /* @__PURE__ */ r(e, {
|
|
21
21
|
className: o,
|
|
22
22
|
size: "sm"
|
|
23
23
|
})]
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Box as e } from "../Box/base.mjs";
|
|
3
|
+
import { splitStyleProps as t } from "../styles/split-style-props.mjs";
|
|
4
|
+
import { useClosingRule as n } from "./client.mjs";
|
|
5
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
6
|
+
// src/popup/positioner.tsx
|
|
7
|
+
function i(e) {
|
|
8
|
+
return function(n, { open: i }) {
|
|
9
|
+
let [, o] = t(n);
|
|
10
|
+
return /* @__PURE__ */ r(a, {
|
|
11
|
+
...o,
|
|
12
|
+
finalFocus: e,
|
|
13
|
+
open: i
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function a({ open: t, finalFocus: i, ref: a, ...o }) {
|
|
18
|
+
return /* @__PURE__ */ r(e, {
|
|
19
|
+
...o,
|
|
20
|
+
...n(a, {
|
|
21
|
+
finalFocus: i,
|
|
22
|
+
open: t
|
|
23
|
+
}),
|
|
24
|
+
zIndex: "popover"
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export { i as positionerElement };
|
package/dist/popup/tooltip.d.mts
CHANGED
package/dist/popup/tooltip.mjs
CHANGED
|
@@ -1,81 +1,87 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
2
|
+
import { Box as e } from "../Box/base.mjs";
|
|
3
|
+
import { join as t } from "../styles/join.mjs";
|
|
4
|
+
import { splitStyleProps as n } from "../styles/split-style-props.mjs";
|
|
5
|
+
import { TriggerDirection as r, usePhysicalSide as i, useTriggerDirection as a } from "./direction.mjs";
|
|
6
|
+
import { createContext as o, use as s, useCallback as c, useId as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
7
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
8
|
+
import { Tooltip as m } from "@base-ui/react/tooltip";
|
|
8
9
|
// src/popup/tooltip.tsx
|
|
9
|
-
var
|
|
10
|
+
var h = o({
|
|
10
11
|
attach: () => {},
|
|
11
12
|
container: null,
|
|
12
13
|
describes: !0,
|
|
13
14
|
id: void 0
|
|
14
15
|
});
|
|
15
|
-
function
|
|
16
|
-
let
|
|
17
|
-
e &&
|
|
18
|
-
}, []),
|
|
19
|
-
id:
|
|
16
|
+
function g({ describes: e = !0, children: t, onOpenChange: n, ...i }) {
|
|
17
|
+
let o = l(), s = d(null), [g, _] = a(i.open ?? i.defaultOpen, s, n), [v, y] = f(null), b = c((e) => {
|
|
18
|
+
s.current = e, e && y(e.closest("[data-brand]") ?? e.ownerDocument.body);
|
|
19
|
+
}, []), x = u(() => ({
|
|
20
|
+
id: i.disabled || !e ? void 0 : o,
|
|
20
21
|
describes: e,
|
|
21
|
-
container:
|
|
22
|
-
attach:
|
|
22
|
+
container: v,
|
|
23
|
+
attach: b
|
|
23
24
|
}), [
|
|
24
|
-
|
|
25
|
+
i.disabled,
|
|
25
26
|
e,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
o,
|
|
28
|
+
v,
|
|
29
|
+
b
|
|
29
30
|
]);
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
value:
|
|
32
|
-
children: /* @__PURE__ */
|
|
33
|
-
|
|
34
|
-
children:
|
|
31
|
+
return /* @__PURE__ */ p(h, {
|
|
32
|
+
value: x,
|
|
33
|
+
children: /* @__PURE__ */ p(r, {
|
|
34
|
+
value: g,
|
|
35
|
+
children: /* @__PURE__ */ p(m.Root, {
|
|
36
|
+
...i,
|
|
37
|
+
onOpenChange: _,
|
|
38
|
+
children: t
|
|
39
|
+
})
|
|
35
40
|
})
|
|
36
41
|
});
|
|
37
42
|
}
|
|
38
|
-
function
|
|
39
|
-
let { attach: t } =
|
|
40
|
-
return /* @__PURE__ */
|
|
43
|
+
function _({ render: e }) {
|
|
44
|
+
let { attach: t } = s(h);
|
|
45
|
+
return /* @__PURE__ */ p(m.Trigger, {
|
|
41
46
|
id: e.props.id,
|
|
42
47
|
ref: t,
|
|
43
48
|
render: e
|
|
44
49
|
});
|
|
45
50
|
}
|
|
46
|
-
function
|
|
47
|
-
let { container: t, describes: n } =
|
|
48
|
-
return /* @__PURE__ */
|
|
51
|
+
function v({ children: e }) {
|
|
52
|
+
let { container: t, describes: n } = s(h);
|
|
53
|
+
return /* @__PURE__ */ p(m.Portal, {
|
|
49
54
|
container: t,
|
|
50
55
|
keepMounted: n,
|
|
51
56
|
children: e
|
|
52
57
|
});
|
|
53
58
|
}
|
|
54
|
-
function
|
|
55
|
-
return /* @__PURE__ */
|
|
56
|
-
...
|
|
59
|
+
function y({ className: e, side: r = "top", ...a }) {
|
|
60
|
+
return /* @__PURE__ */ p(m.Positioner, {
|
|
61
|
+
...a,
|
|
57
62
|
collisionPadding: 8,
|
|
58
63
|
render: (r) => {
|
|
59
|
-
let [, i] =
|
|
60
|
-
return /* @__PURE__ */
|
|
64
|
+
let [, i] = n(r);
|
|
65
|
+
return /* @__PURE__ */ p(b, {
|
|
61
66
|
...i,
|
|
62
|
-
className: e
|
|
67
|
+
className: t(e, i.className)
|
|
63
68
|
});
|
|
64
69
|
},
|
|
70
|
+
side: i(r),
|
|
65
71
|
sideOffset: 4
|
|
66
72
|
});
|
|
67
73
|
}
|
|
68
|
-
function
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
-
...
|
|
74
|
+
function b(t) {
|
|
75
|
+
return /* @__PURE__ */ p(e, {
|
|
76
|
+
...t,
|
|
71
77
|
zIndex: "tooltip"
|
|
72
78
|
});
|
|
73
79
|
}
|
|
74
|
-
function
|
|
75
|
-
return /* @__PURE__ */
|
|
80
|
+
function x(e) {
|
|
81
|
+
return /* @__PURE__ */ p(m.Popup, {
|
|
76
82
|
...e,
|
|
77
|
-
id:
|
|
83
|
+
id: s(h).id,
|
|
78
84
|
role: "tooltip"
|
|
79
85
|
});
|
|
80
86
|
}
|
|
81
|
-
export {
|
|
87
|
+
export { _ as TooltipElementTrigger, h as TooltipLink, x as TooltipPopupPart, v as TooltipPortal, y as TooltipPositioner, g as TooltipRootScope };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "../Box/base.mjs";
|
|
2
|
+
import { PartProps } from "../styles/part-props.mjs";
|
|
3
|
+
import { ComponentPropsWithRef, ReactNode } from "react";
|
|
4
|
+
export type NamedScrollRegionProps = Omit<PartProps<Omit<ComponentPropsWithRef<"section">, "aria-label" | "aria-labelledby">>, "blockSize" | "minBlockSize" | "maxBlockSize"> & ({
|
|
5
|
+
/** The region's name. Required unless `aria-labelledby` names it. */
|
|
6
|
+
"aria-label": string;
|
|
7
|
+
"aria-labelledby"?: never;
|
|
8
|
+
} | {
|
|
9
|
+
"aria-label"?: never;
|
|
10
|
+
/** The id of the element that names the region. Required unless `aria-label` names it. */
|
|
11
|
+
"aria-labelledby": string;
|
|
12
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Box as e } from "../Box/base.mjs";
|
|
2
|
+
import { join as t } from "../styles/join.mjs";
|
|
3
|
+
import { scrollThumb as n, scrollbar as r, viewport as i } from "../styles/scroll-region.css.mjs";
|
|
4
|
+
import { splitStyleProps as a } from "../styles/split-style-props.mjs";
|
|
5
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
import { ScrollArea as c } from "@base-ui/react/scroll-area";
|
|
7
|
+
// src/scroll-region/scroll-region.tsx
|
|
8
|
+
function l({ children: l, className: u, ref: d, rootProps: f, style: p, viewportClassName: m, ...h }) {
|
|
9
|
+
let [g, _] = a(h);
|
|
10
|
+
return /* @__PURE__ */ s(c.Root, {
|
|
11
|
+
render: /* @__PURE__ */ o(e, {
|
|
12
|
+
...f,
|
|
13
|
+
...g,
|
|
14
|
+
className: u,
|
|
15
|
+
style: p
|
|
16
|
+
}),
|
|
17
|
+
children: [/* @__PURE__ */ o(c.Viewport, {
|
|
18
|
+
..._,
|
|
19
|
+
className: t(i, m),
|
|
20
|
+
render: /* @__PURE__ */ o("section", { ref: d }),
|
|
21
|
+
children: /* @__PURE__ */ o(c.Content, { children: l })
|
|
22
|
+
}), /* @__PURE__ */ o(c.Scrollbar, {
|
|
23
|
+
className: r,
|
|
24
|
+
orientation: "horizontal",
|
|
25
|
+
children: /* @__PURE__ */ o(c.Thumb, { className: n })
|
|
26
|
+
})]
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
export { l as ScrollRegion };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Box as e } from "../Box/base.mjs";
|
|
2
|
+
import { CircleAlertIcon as t } from "../icons/CircleAlertIcon.mjs";
|
|
3
|
+
import { CircleCheckIcon as n } from "../icons/CircleCheckIcon.mjs";
|
|
4
|
+
import { InfoIcon as r } from "../icons/InfoIcon.mjs";
|
|
5
|
+
import { TriangleAlertIcon as i } from "../icons/TriangleAlertIcon.mjs";
|
|
6
|
+
import { join as a } from "../styles/join.mjs";
|
|
7
|
+
import { close as o, content as s, message as c, row as l, title as u } from "../styles/status-message.css.mjs";
|
|
8
|
+
import { subtleFills as d } from "../styles/subtle-fills.mjs";
|
|
9
|
+
import { Text as f } from "../Text/index.mjs";
|
|
10
|
+
import { statusTones as p } from "./tones.mjs";
|
|
11
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
12
|
+
// src/status-message/status-message.tsx
|
|
13
|
+
var g = {
|
|
14
|
+
info: r,
|
|
15
|
+
success: n,
|
|
16
|
+
warning: i,
|
|
17
|
+
danger: t
|
|
18
|
+
};
|
|
19
|
+
function _({ variant: t, close: n, children: r, className: i, ...o }) {
|
|
20
|
+
let u = g[t], { backgroundColor: f, color: _ } = d[p[t]];
|
|
21
|
+
return /* @__PURE__ */ m(e, {
|
|
22
|
+
backgroundColor: f,
|
|
23
|
+
borderRadius: "med",
|
|
24
|
+
color: _,
|
|
25
|
+
padding: "12",
|
|
26
|
+
...o,
|
|
27
|
+
className: a(c, i),
|
|
28
|
+
children: /* @__PURE__ */ h(e, {
|
|
29
|
+
alignItems: "start",
|
|
30
|
+
className: l,
|
|
31
|
+
display: "flex",
|
|
32
|
+
gap: "12",
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ m(e, {
|
|
35
|
+
display: "flex",
|
|
36
|
+
flexShrink: 0,
|
|
37
|
+
paddingBlock: "2",
|
|
38
|
+
children: /* @__PURE__ */ m(u, {})
|
|
39
|
+
}),
|
|
40
|
+
/* @__PURE__ */ m(e, {
|
|
41
|
+
alignItems: "start",
|
|
42
|
+
className: s,
|
|
43
|
+
display: "flex",
|
|
44
|
+
flexDirection: "column",
|
|
45
|
+
flexGrow: 1,
|
|
46
|
+
gap: "8",
|
|
47
|
+
children: r
|
|
48
|
+
}),
|
|
49
|
+
n && /* @__PURE__ */ m(e, {
|
|
50
|
+
className: "_1ed90zt5",
|
|
51
|
+
display: "flex",
|
|
52
|
+
flexShrink: 0,
|
|
53
|
+
children: n
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function v({ className: e, ...t }) {
|
|
60
|
+
return /* @__PURE__ */ m(f, {
|
|
61
|
+
as: "div",
|
|
62
|
+
weight: "medium",
|
|
63
|
+
...t,
|
|
64
|
+
className: a(u, e)
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function y(e) {
|
|
68
|
+
return /* @__PURE__ */ m(f, {
|
|
69
|
+
as: "div",
|
|
70
|
+
size: "sm",
|
|
71
|
+
...e
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
export { _ as StatusMessage, y as StatusMessageDescription, v as StatusMessageTitle, o as statusMessageClose, p as statusTones };
|