@jonmilner/ui 0.21.2 → 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/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/index.mjs +17 -17
- package/dist/RadioGroup/index.mjs +23 -23
- 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/index.mjs +16 -16
- 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/index.mjs
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
1
|
+
import { AlertDialog as e } from "./AlertDialog/index.mjs";
|
|
2
|
+
import { Avatar as t } from "./Avatar/index.mjs";
|
|
3
|
+
import { Badge as n } from "./Badge/index.mjs";
|
|
4
|
+
import { Box as r } from "./Box/index.mjs";
|
|
5
|
+
import { Button as i } from "./Button/index.mjs";
|
|
6
|
+
import { Checkbox as a } from "./Checkbox/index.mjs";
|
|
7
|
+
import { Chip as o, ChipGroup as s } from "./Chip/index.mjs";
|
|
8
|
+
import { Clickable as c } from "./Clickable/index.mjs";
|
|
9
|
+
import { ColorField as l } from "./ColorField/index.mjs";
|
|
10
|
+
import { Combobox as u } from "./Combobox/index.mjs";
|
|
11
|
+
import { Dialog as d } from "./Dialog/index.mjs";
|
|
12
|
+
import { Field as f } from "./Field/index.mjs";
|
|
13
|
+
import { Heading as p } from "./Heading/index.mjs";
|
|
14
|
+
import { Icon as m } from "./Icon/index.mjs";
|
|
15
|
+
import { IconButton as h } from "./IconButton/index.mjs";
|
|
16
|
+
import { Inline as g } from "./Inline/index.mjs";
|
|
17
|
+
import { Menu as _ } from "./Menu/index.mjs";
|
|
18
|
+
import { MultiSelect as v } from "./MultiSelect/index.mjs";
|
|
19
|
+
import { NavList as y } from "./NavList/index.mjs";
|
|
20
|
+
import { NumberField as b } from "./NumberField/index.mjs";
|
|
21
|
+
import { RadioGroup as x } from "./RadioGroup/index.mjs";
|
|
22
|
+
import { SearchField as S } from "./SearchField/index.mjs";
|
|
23
|
+
import { Select as C } from "./Select/index.mjs";
|
|
24
|
+
import { Sidebar as w } from "./Sidebar/index.mjs";
|
|
25
|
+
import { SidebarLayout as T } from "./SidebarLayout/index.mjs";
|
|
26
|
+
import { Stack as E } from "./Stack/index.mjs";
|
|
27
|
+
import { Switch as D } from "./Switch/index.mjs";
|
|
28
|
+
import { Table as O } from "./Table/index.mjs";
|
|
29
|
+
import { Tabs as k } from "./Tabs/index.mjs";
|
|
30
|
+
import { Tag as A } from "./Tag/index.mjs";
|
|
31
|
+
import { Text as j } from "./Text/index.mjs";
|
|
32
|
+
import { Textarea as M } from "./Textarea/index.mjs";
|
|
33
|
+
import { TextField as N } from "./TextField/index.mjs";
|
|
34
|
+
import { defineTheme as P } from "./theme/define-theme.mjs";
|
|
35
|
+
import { ThemeProvider as F } from "./theme/ThemeProvider.mjs";
|
|
36
|
+
import { Toast as I } from "./Toast/index.mjs";
|
|
37
37
|
import { useToast as L } from "./Toast/client.mjs";
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
export {
|
|
38
|
+
import { Tooltip as R } from "./Tooltip/index.mjs";
|
|
39
|
+
import { VisuallyHidden as z } from "./VisuallyHidden/index.mjs";
|
|
40
|
+
export { e as AlertDialog, t as Avatar, n as Badge, r as Box, i as Button, a as Checkbox, o as Chip, s as ChipGroup, c as Clickable, l as ColorField, u as Combobox, d as Dialog, f as Field, p as Heading, m as Icon, h as IconButton, g as Inline, _ as Menu, v as MultiSelect, y as NavList, b as NumberField, x as RadioGroup, S as SearchField, C as Select, w as Sidebar, T as SidebarLayout, E as Stack, D as Switch, O as Table, k as Tabs, A as Tag, j as Text, N as TextField, M as Textarea, F as ThemeProvider, I as Toast, R as Tooltip, z as VisuallyHidden, P as defineTheme, L as useToast };
|
package/dist/lint/index.mjs
CHANGED
package/dist/popup/client.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ClickableProps } from "../Clickable/index.mjs";
|
|
2
1
|
import { ButtonOwnProps } from "../Button/index.mjs";
|
|
2
|
+
import { ClickableProps } from "../Clickable/index.mjs";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
export type TriggerLookProps = {
|
|
5
5
|
variant?: Exclude<ButtonOwnProps["variant"], "danger">;
|
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,34 +12,49 @@ 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
60
|
t.current = n ? {
|
|
@@ -54,7 +69,7 @@ function m(e) {
|
|
|
54
69
|
}, e?.(n, r);
|
|
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,26 +78,27 @@ 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: c } =
|
|
78
|
-
|
|
79
|
-
let n =
|
|
92
|
+
function S(e, { finalFocus: t, modal: n = !1, open: r }) {
|
|
93
|
+
let { trigger: c } = h(), l = i(u), m = i(d), g = s(null), _ = a((t) => {
|
|
94
|
+
g.current = t;
|
|
95
|
+
let n = v(e, t), r = m && f(m.current, t);
|
|
80
96
|
return () => {
|
|
81
|
-
|
|
97
|
+
g.current = null, r?.(), n();
|
|
82
98
|
};
|
|
83
|
-
}, [e]);
|
|
99
|
+
}, [e, m]);
|
|
84
100
|
return o(() => {
|
|
85
|
-
let e =
|
|
101
|
+
let e = g.current;
|
|
86
102
|
if (!r || !e || l.current.recorded) return;
|
|
87
103
|
let { activeElement: t, body: n } = e.ownerDocument, i = t === n || e.contains(t) ? null : t;
|
|
88
104
|
l.current = {
|
|
@@ -90,7 +106,7 @@ function y(e, { finalFocus: t, modal: n = !1, open: r }) {
|
|
|
90
106
|
opener: i
|
|
91
107
|
};
|
|
92
108
|
}, [r, l]), o(() => {
|
|
93
|
-
let e =
|
|
109
|
+
let e = g.current;
|
|
94
110
|
if (!e) return;
|
|
95
111
|
if (r) {
|
|
96
112
|
e.inert = !1;
|
|
@@ -98,8 +114,8 @@ function y(e, { finalFocus: t, modal: n = !1, open: r }) {
|
|
|
98
114
|
}
|
|
99
115
|
let { reason: i, keyboard: a, opener: o } = l.current;
|
|
100
116
|
l.current.recorded = !1;
|
|
101
|
-
let s = o?.isConnected ? o : c.current, { activeElement: u } = e.ownerDocument,
|
|
102
|
-
if (!t && s instanceof HTMLElement && (
|
|
117
|
+
let s = o?.isConnected ? o : c.current, { activeElement: u } = e.ownerDocument, d = n && i === "outside-press" && x(e.ownerDocument), f = e.contains(u) || [...m?.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
|
}
|
|
@@ -109,10 +125,11 @@ function y(e, { finalFocus: t, modal: n = !1, open: r }) {
|
|
|
109
125
|
t,
|
|
110
126
|
n,
|
|
111
127
|
l,
|
|
128
|
+
m,
|
|
112
129
|
c
|
|
113
130
|
]), {
|
|
114
131
|
"aria-hidden": !r || void 0,
|
|
115
|
-
ref:
|
|
132
|
+
ref: _
|
|
116
133
|
};
|
|
117
134
|
}
|
|
118
|
-
export {
|
|
135
|
+
export { m as PopupScope, g as triggerElement, S as useClosingRule, h as usePopupScope, _ as useRecordOpenChange };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "react";
|
|
@@ -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
|
})]
|
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 };
|