@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.
Files changed (204) hide show
  1. package/README.md +17 -0
  2. package/THIRD_PARTY_NOTICES.md +1 -1
  3. package/dist/Alert/Alert.css +2 -0
  4. package/dist/Alert/Alert.css.mjs +9 -0
  5. package/dist/Alert/index.d.mts +13 -0
  6. package/dist/Alert/index.mjs +45 -0
  7. package/dist/AlertDialog/client.mjs +4 -4
  8. package/dist/AlertDialog/index.d.mts +3 -2
  9. package/dist/AlertDialog/index.mjs +10 -9
  10. package/dist/Avatar/Avatar.css +1 -1
  11. package/dist/Avatar/index.d.mts +1 -1
  12. package/dist/Avatar/index.mjs +5 -5
  13. package/dist/Badge/Badge.css +1 -1
  14. package/dist/Badge/index.d.mts +1 -1
  15. package/dist/Badge/index.mjs +12 -12
  16. package/dist/Body/index.d.mts +9 -0
  17. package/dist/Body/index.mjs +12 -0
  18. package/dist/Box/Box.css +1 -1
  19. package/dist/Box/index.mjs +1 -1
  20. package/dist/Button/Button.css +1 -1
  21. package/dist/Button/index.d.mts +1 -1
  22. package/dist/Button/index.mjs +22 -22
  23. package/dist/Caption/index.d.mts +6 -0
  24. package/dist/Caption/index.mjs +14 -0
  25. package/dist/Checkbox/Checkbox.css +1 -1
  26. package/dist/Checkbox/index.mjs +7 -7
  27. package/dist/Chip/Chip.css +1 -1
  28. package/dist/Chip/index.mjs +35 -35
  29. package/dist/Clickable/Clickable.css +1 -1
  30. package/dist/Clickable/index.d.mts +1 -1
  31. package/dist/Clickable/index.mjs +4 -4
  32. package/dist/Code/Code.css +2 -0
  33. package/dist/Code/Code.css.mjs +7 -0
  34. package/dist/Code/index.d.mts +10 -0
  35. package/dist/Code/index.mjs +40 -0
  36. package/dist/ColorField/ColorField.css +2 -2
  37. package/dist/ColorField/client.mjs +6 -6
  38. package/dist/ColorField/index.mjs +14 -14
  39. package/dist/Combobox/Combobox.css +2 -2
  40. package/dist/Combobox/client.mjs +26 -26
  41. package/dist/Combobox/index.mjs +20 -20
  42. package/dist/Dialog/Dialog.css +2 -2
  43. package/dist/Dialog/client.d.mts +1 -1
  44. package/dist/Dialog/client.mjs +30 -28
  45. package/dist/Dialog/index.d.mts +2 -2
  46. package/dist/Dialog/index.mjs +19 -19
  47. package/dist/Field/Field.css +1 -1
  48. package/dist/Field/client.mjs +6 -6
  49. package/dist/Field/index.mjs +29 -29
  50. package/dist/Flex/index.d.mts +5 -0
  51. package/dist/Flex/index.mjs +14 -0
  52. package/dist/Heading/Heading.css +1 -1
  53. package/dist/Icon/Icon.css +1 -1
  54. package/dist/IconButton/IconButton.css +2 -2
  55. package/dist/IconButton/IconButton.css.mjs +2 -2
  56. package/dist/IconButton/index.d.mts +5 -2
  57. package/dist/IconButton/index.mjs +60 -21
  58. package/dist/Inline/Inline.css +1 -1
  59. package/dist/Inline/index.d.mts +2 -2
  60. package/dist/Inline/index.mjs +4 -4
  61. package/dist/Label/index.d.mts +9 -0
  62. package/dist/Label/index.mjs +19 -0
  63. package/dist/Menu/Menu.css +2 -2
  64. package/dist/Menu/Menu.css.mjs +1 -1
  65. package/dist/Menu/client.d.mts +1 -0
  66. package/dist/Menu/client.mjs +83 -62
  67. package/dist/Menu/index.d.mts +8 -0
  68. package/dist/Menu/index.mjs +123 -87
  69. package/dist/Menu/item-row.mjs +2 -2
  70. package/dist/MultiSelect/MultiSelect.css +2 -2
  71. package/dist/MultiSelect/client.mjs +4 -4
  72. package/dist/MultiSelect/index.mjs +8 -8
  73. package/dist/NavList/NavList.css +2 -2
  74. package/dist/NavList/client.mjs +3 -3
  75. package/dist/NavList/index.d.mts +3 -3
  76. package/dist/NavList/index.mjs +67 -65
  77. package/dist/NumberField/NumberField.css +2 -2
  78. package/dist/NumberField/index.mjs +17 -17
  79. package/dist/Popover/Popover.css +2 -0
  80. package/dist/Popover/Popover.css.mjs +7 -0
  81. package/dist/Popover/client.d.mts +11 -0
  82. package/dist/Popover/client.mjs +54 -0
  83. package/dist/Popover/index.d.mts +20 -0
  84. package/dist/Popover/index.mjs +39 -0
  85. package/dist/RadioGroup/RadioGroup.css +1 -1
  86. package/dist/RadioGroup/index.mjs +23 -23
  87. package/dist/SearchField/SearchField.css +2 -2
  88. package/dist/SearchField/client.mjs +13 -13
  89. package/dist/SearchField/index.mjs +16 -16
  90. package/dist/Select/Select.css +2 -2
  91. package/dist/Select/client.mjs +11 -11
  92. package/dist/Select/index.mjs +8 -8
  93. package/dist/Sidebar/Sidebar.css +1 -1
  94. package/dist/Sidebar/index.d.mts +1 -1
  95. package/dist/Sidebar/index.mjs +21 -21
  96. package/dist/SidebarLayout/SidebarLayout.css +1 -1
  97. package/dist/SidebarLayout/index.d.mts +1 -1
  98. package/dist/SidebarLayout/index.mjs +8 -8
  99. package/dist/Stack/Stack.css +1 -1
  100. package/dist/Stack/index.d.mts +2 -2
  101. package/dist/Stack/index.mjs +4 -4
  102. package/dist/Switch/Switch.css +1 -1
  103. package/dist/Switch/index.mjs +13 -13
  104. package/dist/Table/Table.css +2 -2
  105. package/dist/Table/Table.css.mjs +4 -2
  106. package/dist/Table/index.d.mts +4 -10
  107. package/dist/Table/index.mjs +80 -94
  108. package/dist/Tabs/Tabs.css +1 -1
  109. package/dist/Tabs/index.mjs +26 -26
  110. package/dist/Tag/Tag.css +1 -1
  111. package/dist/Tag/index.d.mts +1 -1
  112. package/dist/Tag/index.mjs +16 -16
  113. package/dist/Text/Text.css +1 -1
  114. package/dist/Text/index.d.mts +2 -2
  115. package/dist/Text/index.mjs +4 -4
  116. package/dist/TextField/TextField.css +2 -2
  117. package/dist/TextField/index.mjs +16 -16
  118. package/dist/Textarea/Textarea.css +2 -2
  119. package/dist/Textarea/index.mjs +9 -9
  120. package/dist/Toast/Toast.css +2 -2
  121. package/dist/Toast/Toast.css.mjs +10 -7
  122. package/dist/Toast/client.d.mts +5 -19
  123. package/dist/Toast/client.mjs +117 -152
  124. package/dist/Tooltip/Tooltip.css +1 -1
  125. package/dist/Tooltip/base.mjs +13 -13
  126. package/dist/VisuallyHidden/VisuallyHidden.css +1 -1
  127. package/dist/base.css +2 -2
  128. package/dist/brands/default.mjs +2 -1
  129. package/dist/brands/forced-colors.mjs +2 -1
  130. package/dist/brands/neutral.mjs +8 -7
  131. package/dist/contrast/contrast.d.mts +1 -1
  132. package/dist/contrast/contrast.mjs +42 -34
  133. package/dist/contrast/mixes.mjs +37 -30
  134. package/dist/docs/Alert.md +106 -0
  135. package/dist/docs/AlertDialog.md +25 -11
  136. package/dist/docs/Body.md +74 -0
  137. package/dist/docs/Box.md +4 -3
  138. package/dist/docs/Caption.md +77 -0
  139. package/dist/docs/Code.md +84 -0
  140. package/dist/docs/ColorField.md +1 -1
  141. package/dist/docs/Combobox.md +3 -1
  142. package/dist/docs/Dialog.md +28 -4
  143. package/dist/docs/Flex.md +76 -0
  144. package/dist/docs/Icon.md +1 -0
  145. package/dist/docs/IconButton.md +9 -1
  146. package/dist/docs/Inline.md +3 -2
  147. package/dist/docs/Label.md +77 -0
  148. package/dist/docs/Menu.md +54 -6
  149. package/dist/docs/MultiSelect.md +2 -0
  150. package/dist/docs/NavList.md +2 -2
  151. package/dist/docs/NumberField.md +1 -1
  152. package/dist/docs/Popover.md +135 -0
  153. package/dist/docs/SearchField.md +1 -1
  154. package/dist/docs/Select.md +2 -0
  155. package/dist/docs/Stack.md +12 -10
  156. package/dist/docs/Table.md +5 -5
  157. package/dist/docs/Text.md +30 -23
  158. package/dist/docs/TextField.md +1 -1
  159. package/dist/docs/Textarea.md +1 -1
  160. package/dist/docs/Toast.md +14 -7
  161. package/dist/docs/Tooltip.md +2 -2
  162. package/dist/docs/lint.md +18 -0
  163. package/dist/docs/llms.txt +20 -11
  164. package/dist/docs/manifest.json +732 -65
  165. package/dist/docs/migrations/0.22.0.md +35 -0
  166. package/dist/docs/migrations/0.23.0.md +84 -0
  167. package/dist/docs/theming.md +3 -3
  168. package/dist/icons/TriangleAlertIcon.d.mts +2 -0
  169. package/dist/icons/TriangleAlertIcon.mjs +10 -0
  170. package/dist/icons/index.d.mts +6 -5
  171. package/dist/icons/index.mjs +35 -34
  172. package/dist/index.d.mts +24 -16
  173. package/dist/index.mjs +47 -40
  174. package/dist/lint/index.d.mts +20 -1
  175. package/dist/lint/index.mjs +19 -3
  176. package/dist/popup/client.d.mts +1 -1
  177. package/dist/popup/client.mjs +59 -41
  178. package/dist/popup/direction.d.mts +2 -0
  179. package/dist/popup/direction.mjs +23 -0
  180. package/dist/popup/listbox-base.mjs +24 -24
  181. package/dist/popup/listbox-options.mjs +4 -4
  182. package/dist/popup/listbox-row.mjs +1 -0
  183. package/dist/popup/positioner.mjs +27 -0
  184. package/dist/popup/tooltip.d.mts +1 -0
  185. package/dist/popup/tooltip.mjs +48 -42
  186. package/dist/scroll-region/scroll-region.d.mts +12 -0
  187. package/dist/scroll-region/scroll-region.mjs +29 -0
  188. package/dist/status-message/status-message.d.mts +5 -0
  189. package/dist/status-message/status-message.mjs +74 -0
  190. package/dist/status-message/tones.d.mts +7 -0
  191. package/dist/status-message/tones.mjs +8 -0
  192. package/dist/styles/atom-values.mjs +131 -0
  193. package/dist/styles/atoms.css +1 -1
  194. package/dist/styles/layers.css +1 -1
  195. package/dist/styles/responsive.css +1 -1
  196. package/dist/styles/scroll-region.css +2 -0
  197. package/dist/styles/scroll-region.css.mjs +7 -0
  198. package/dist/styles/status-message.css +2 -0
  199. package/dist/styles/status-message.css.mjs +7 -0
  200. package/dist/theme/define-theme.mjs +42 -42
  201. package/dist/tokens/contract.d.mts +1 -1
  202. package/dist/tokens/roles.d.mts +1 -1
  203. package/dist/tokens/roles.mjs +1 -1
  204. package/package.json +30 -2
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { Clickable as e } from "../Clickable/index.mjs";
3
- import { Button as t } from "../Button/index.mjs";
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 d({ children: e }) {
17
- let t = s({
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: t,
25
- children: e
36
+ value: r,
37
+ children: /* @__PURE__ */ c(d, {
38
+ value: o,
39
+ children: e
40
+ })
26
41
  })
27
42
  });
28
43
  }
29
- function f() {
44
+ function h() {
30
45
  return i(l);
31
46
  }
32
- function p({ variant: n, size: r, iconStart: i, iconEnd: a, uppercase: o, ...s }) {
33
- return n || r || i || a || o ? /* @__PURE__ */ c(t, {
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(e, { ...s });
55
+ }) : /* @__PURE__ */ c(t, { ...s });
41
56
  }
42
- function m(e) {
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
- }, e?.(n, r);
69
+ });
55
70
  };
56
71
  }
57
- function h(e, t) {
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 g = /* @__PURE__ */ new Set([
81
+ var y = /* @__PURE__ */ new Set([
67
82
  "trigger-hover",
68
83
  "focus-out",
69
- "outside-press"
70
- ]), _;
71
- function v(e) {
72
- return _ === void 0 && (_ = !1, e.createElement("div").focus({ get preventScroll() {
73
- return _ = !0, !1;
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 y(e, { finalFocus: t, modal: n = !1, open: r }) {
77
- let { trigger: c } = f(), l = i(u), d = s(null), p = a((t) => {
78
- d.current = t;
79
- let n = h(e, t);
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
- d.current = null, n();
97
+ _.current = null, r?.(), n();
82
98
  };
83
- }, [e]);
99
+ }, [e, g]);
84
100
  return o(() => {
85
- let e = d.current;
86
- if (!r || !e || l.current.recorded) return;
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
- l.current = {
104
+ m.current = {
89
105
  keyboard: !1,
90
106
  opener: i
91
107
  };
92
- }, [r, l]), o(() => {
93
- let e = d.current;
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 } = l.current;
100
- l.current.recorded = !1;
101
- let s = o?.isConnected ? o : c.current, { activeElement: u } = e.ownerDocument, f = n && i === "outside-press" && v(e.ownerDocument);
102
- if (!t && s instanceof HTMLElement && (f || e.contains(u) && !g.has(i ?? ""))) {
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
- l,
112
- c
127
+ c,
128
+ m,
129
+ g,
130
+ l
113
131
  ]), {
114
132
  "aria-hidden": !r || void 0,
115
- ref: p
133
+ ref: b
116
134
  };
117
135
  }
118
- export { d as PopupScope, p as triggerElement, y as useClosingRule, f as usePopupScope, m as useRecordOpenChange };
136
+ export { m as PopupScope, g as triggerElement, S as useClosingRule, h as usePopupScope, _ as useRecordOpenChange };
@@ -0,0 +1,2 @@
1
+ import "react";
2
+ export type PopupSide = "top" | "bottom" | "left" | "right" | "inline-start" | "inline-end";
@@ -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 { splitStyleProps as e } from "../styles/split-style-props.mjs";
3
- import { Box as t } from "../Box/base.mjs";
4
- import { PopupScope as n, triggerElement as r, useClosingRule as i } from "./client.mjs";
5
- import { Field as a } from "../Field/index.mjs";
6
- import { ChevronDownIcon as o } from "../icons/ChevronDownIcon.mjs";
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(n, { children: /* @__PURE__ */ u(d, {
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: t }) {
18
- return /* @__PURE__ */ u(a.Label, {
19
- className: t,
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: n, size: i }) {
29
- return r({
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: n,
35
- iconEnd: o,
34
+ iconStart: r,
35
+ iconEnd: n,
36
36
  className: t,
37
37
  children: e
38
38
  });
39
39
  }
40
- function g(e) {
41
- return /* @__PURE__ */ u(t, {
40
+ function g(t) {
41
+ return /* @__PURE__ */ u(e, {
42
42
  backgroundColor: "bgRaised",
43
43
  borderRadius: "med",
44
44
  boxShadow: "med",
45
- className: e,
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(t, { open: n }) {
56
- let [, r] = e(t);
55
+ function v(e, { open: t }) {
56
+ let [, n] = r(e);
57
57
  return /* @__PURE__ */ u(y, {
58
- ...r,
59
- open: n
58
+ ...n,
59
+ open: t
60
60
  });
61
61
  }
62
- function y({ open: e, ref: n, ...r }) {
63
- return /* @__PURE__ */ u(t, {
62
+ function y({ open: t, ref: n, ...r }) {
63
+ return /* @__PURE__ */ u(e, {
64
64
  ...r,
65
- ...i(n, {
65
+ ...o(n, {
66
66
  finalFocus: !1,
67
- open: e
67
+ open: t
68
68
  }),
69
69
  zIndex: "popover"
70
70
  });
@@ -1,5 +1,5 @@
1
- import { Text as e } from "../Text/index.mjs";
2
- import { CheckIcon as t } from "../icons/CheckIcon.mjs";
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(e, {
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(t, {
20
+ }), /* @__PURE__ */ r(e, {
21
21
  className: o,
22
22
  size: "sm"
23
23
  })]
@@ -10,6 +10,7 @@ function n(n) {
10
10
  gap: "8",
11
11
  justifyContent: "space-between",
12
12
  minBlockSize: "sm",
13
+ paddingBlock: "8",
13
14
  paddingInline: "12"
14
15
  });
15
16
  }
@@ -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 };
@@ -1,3 +1,4 @@
1
+ import "./direction.mjs";
1
2
  import { ReactElement, ReactNode } from "react";
2
3
  import { Tooltip } from "@base-ui/react/tooltip";
3
4
  export type TooltipRootScopeProps = Pick<Tooltip.Root.Props, "open" | "defaultOpen" | "onOpenChange" | "disabled"> & {
@@ -1,81 +1,87 @@
1
1
  "use client";
2
- import { join as e } from "../styles/join.mjs";
3
- import { splitStyleProps as t } from "../styles/split-style-props.mjs";
4
- import { Box as n } from "../Box/base.mjs";
5
- import { createContext as r, use as i, useCallback as a, useId as o, useMemo as s, useState as c } from "react";
6
- import { jsx as l } from "react/jsx-runtime";
7
- import { Tooltip as u } from "@base-ui/react/tooltip";
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 d = r({
10
+ var h = o({
10
11
  attach: () => {},
11
12
  container: null,
12
13
  describes: !0,
13
14
  id: void 0
14
15
  });
15
- function f({ describes: e = !0, children: t, ...n }) {
16
- let r = o(), [i, f] = c(null), p = a((e) => {
17
- e && f(e.closest("[data-brand]") ?? e.ownerDocument.body);
18
- }, []), m = s(() => ({
19
- id: n.disabled || !e ? void 0 : r,
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: i,
22
- attach: p
22
+ container: v,
23
+ attach: b
23
24
  }), [
24
- n.disabled,
25
+ i.disabled,
25
26
  e,
26
- r,
27
- i,
28
- p
27
+ o,
28
+ v,
29
+ b
29
30
  ]);
30
- return /* @__PURE__ */ l(d, {
31
- value: m,
32
- children: /* @__PURE__ */ l(u.Root, {
33
- ...n,
34
- children: t
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 p({ render: e }) {
39
- let { attach: t } = i(d);
40
- return /* @__PURE__ */ l(u.Trigger, {
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 m({ children: e }) {
47
- let { container: t, describes: n } = i(d);
48
- return /* @__PURE__ */ l(u.Portal, {
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 h({ className: n, ...r }) {
55
- return /* @__PURE__ */ l(u.Positioner, {
56
- ...r,
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] = t(r);
60
- return /* @__PURE__ */ l(g, {
64
+ let [, i] = n(r);
65
+ return /* @__PURE__ */ p(b, {
61
66
  ...i,
62
- className: e(n, i.className)
67
+ className: t(e, i.className)
63
68
  });
64
69
  },
70
+ side: i(r),
65
71
  sideOffset: 4
66
72
  });
67
73
  }
68
- function g(e) {
69
- return /* @__PURE__ */ l(n, {
70
- ...e,
74
+ function b(t) {
75
+ return /* @__PURE__ */ p(e, {
76
+ ...t,
71
77
  zIndex: "tooltip"
72
78
  });
73
79
  }
74
- function _(e) {
75
- return /* @__PURE__ */ l(u.Popup, {
80
+ function x(e) {
81
+ return /* @__PURE__ */ p(m.Popup, {
76
82
  ...e,
77
- id: i(d).id,
83
+ id: s(h).id,
78
84
  role: "tooltip"
79
85
  });
80
86
  }
81
- export { p as TooltipElementTrigger, d as TooltipLink, _ as TooltipPopupPart, m as TooltipPortal, h as TooltipPositioner, f as TooltipRootScope };
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,5 @@
1
+ import "../Box/base.mjs";
2
+ import "../Text/index.mjs";
3
+ import { StatusVariant, statusTones } from "./tones.mjs";
4
+ import { ReactNode } from "react";
5
+ export type { StatusVariant };
@@ -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 };
@@ -0,0 +1,7 @@
1
+ export declare const statusTones: {
2
+ readonly info: "accent";
3
+ readonly success: "success";
4
+ readonly warning: "warning";
5
+ readonly danger: "danger";
6
+ };
7
+ export type StatusVariant = keyof typeof statusTones;
@@ -0,0 +1,8 @@
1
+ // src/status-message/tones.ts
2
+ var e = {
3
+ info: "accent",
4
+ success: "success",
5
+ warning: "warning",
6
+ danger: "danger"
7
+ };
8
+ export { e as statusTones };