haze-ui 1.34.0 → 1.35.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 (99) hide show
  1. package/README.md +26 -0
  2. package/dist/THIRD-PARTY-NOTICES.md +2 -1
  3. package/dist/components/Anchor/Anchor.js +84 -65
  4. package/dist/components/BackToTop/BackToTop.js +18 -12
  5. package/dist/components/Combobox/Combobox.js +109 -99
  6. package/dist/components/CopyButton/CopyButton.js +13 -12
  7. package/dist/components/DataTable/DataTable.js +16 -16
  8. package/dist/components/FloatButton/FloatButton.js +11 -19
  9. package/dist/components/FollowUpSuggestions/FollowUpSuggestions.js +45 -0
  10. package/dist/components/FollowUpSuggestions/index.js +3 -0
  11. package/dist/components/LocaleProvider/ar-sa.js +9 -0
  12. package/dist/components/LocaleProvider/de-de.js +9 -0
  13. package/dist/components/LocaleProvider/es-es.js +9 -0
  14. package/dist/components/LocaleProvider/fr-fr.js +9 -0
  15. package/dist/components/LocaleProvider/it-it.js +9 -0
  16. package/dist/components/LocaleProvider/ja-jp.js +9 -0
  17. package/dist/components/LocaleProvider/ko-kr.js +9 -0
  18. package/dist/components/LocaleProvider/locale.js +9 -0
  19. package/dist/components/LocaleProvider/pt-br.js +9 -0
  20. package/dist/components/LocaleProvider/ru-ru.js +9 -0
  21. package/dist/components/LocaleProvider/zh-cn.js +9 -0
  22. package/dist/components/NavigationBar/NavLink.js +15 -16
  23. package/dist/components/NotificationCenter/NotificationCenter.js +294 -0
  24. package/dist/components/NotificationCenter/index.js +3 -0
  25. package/dist/components/Tabs/Tab.js +58 -50
  26. package/dist/components/TaskList/TaskList.js +96 -0
  27. package/dist/components/TaskList/index.js +3 -0
  28. package/dist/components/Toggle/Toggle.js +8 -8
  29. package/dist/components/Toggle/ToggleCore.js +4 -5
  30. package/dist/components/Toolbar/ToolbarButton.js +7 -7
  31. package/dist/components/Toolbar/ToolbarToggle.js +9 -9
  32. package/dist/components/Tree/Tree.js +159 -137
  33. package/dist/components/Tree/index.js +2 -1
  34. package/dist/components/Tree/useTree.js +32 -0
  35. package/dist/components/Tree/utils.js +21 -11
  36. package/dist/css/anchor.css +1 -1
  37. package/dist/css/combobox.css +1 -1
  38. package/dist/css/copy-button.css +1 -1
  39. package/dist/css/data-table.css +1 -1
  40. package/dist/css/follow-up-suggestions.css +4 -0
  41. package/dist/css/notification-center.css +5 -0
  42. package/dist/css/task-list.css +4 -0
  43. package/dist/css/tokens.css +1 -0
  44. package/dist/css-manifest.json +21 -0
  45. package/dist/haze-ui.css +18 -4
  46. package/dist/headless/index.js +2 -1
  47. package/dist/hooks/index.js +25 -0
  48. package/dist/hooks/useAnchorSpy.js +49 -0
  49. package/dist/hooks/useElementSize.js +31 -0
  50. package/dist/hooks/useIdle.js +45 -0
  51. package/dist/hooks/useMutationObserver.js +31 -0
  52. package/dist/hooks/useNetwork.js +28 -0
  53. package/dist/hooks/useOrientation.js +27 -0
  54. package/dist/hooks/useResizeObserver.js +16 -0
  55. package/dist/icons/index.js +9 -0
  56. package/dist/index.js +323 -318
  57. package/dist/mcp-docs.json +535 -13
  58. package/dist/registry.json +387 -7
  59. package/dist/sitemap.xml +6 -0
  60. package/dist/tokens/index.js +2 -1
  61. package/dist/tokens/zoom.js +6 -0
  62. package/dist/types/components/Anchor/Anchor.d.ts +5 -1
  63. package/dist/types/components/BackToTop/BackToTop.d.ts +23 -5
  64. package/dist/types/components/Combobox/Combobox.d.ts +17 -1
  65. package/dist/types/components/ConfigProvider/ConfigContext.d.ts +6 -0
  66. package/dist/types/components/CopyButton/CopyButton.d.ts +16 -4
  67. package/dist/types/components/DataTable/DataTable.bench.d.ts +1 -0
  68. package/dist/types/components/FloatButton/FloatButton.d.ts +25 -5
  69. package/dist/types/components/FollowUpSuggestions/FollowUpSuggestions.d.ts +27 -0
  70. package/dist/types/components/FollowUpSuggestions/index.d.ts +2 -0
  71. package/dist/types/components/LocaleProvider/locale.d.ts +9 -0
  72. package/dist/types/components/NavigationBar/NavLink.d.ts +24 -32
  73. package/dist/types/components/NotificationCenter/NotificationCenter.d.ts +111 -0
  74. package/dist/types/components/NotificationCenter/index.d.ts +2 -0
  75. package/dist/types/components/Select/Select.bench.d.ts +1 -0
  76. package/dist/types/components/Tabs/Tab.d.ts +26 -4
  77. package/dist/types/components/TaskList/TaskList.d.ts +50 -0
  78. package/dist/types/components/TaskList/index.d.ts +2 -0
  79. package/dist/types/components/Toggle/Toggle.d.ts +15 -8
  80. package/dist/types/components/Toggle/ToggleCore.d.ts +16 -7
  81. package/dist/types/components/Toolbar/ToolbarButton.d.ts +17 -5
  82. package/dist/types/components/Toolbar/ToolbarToggle.d.ts +22 -5
  83. package/dist/types/components/Tree/Tree.d.ts +1 -1
  84. package/dist/types/components/Tree/index.d.ts +4 -1
  85. package/dist/types/components/Tree/types.d.ts +20 -0
  86. package/dist/types/components/Tree/useTree.d.ts +96 -0
  87. package/dist/types/components/Tree/utils.d.ts +7 -0
  88. package/dist/types/components/VirtualList/VirtualList.bench.d.ts +1 -0
  89. package/dist/types/headless/index.d.ts +16 -0
  90. package/dist/types/hooks/index.d.ts +4 -0
  91. package/dist/types/hooks/useAnchorSpy.d.ts +62 -0
  92. package/dist/types/icons/index.d.ts +138 -0
  93. package/dist/types/index.d.ts +10 -2
  94. package/dist/types/tokens/index.d.ts +1 -0
  95. package/dist/types/tokens/zoom.d.ts +33 -0
  96. package/dist/types/utils/deprecate.d.ts +13 -0
  97. package/dist/types/utils/portal.d.ts +29 -0
  98. package/dist/utils/portal.js +13 -0
  99. package/package.json +40 -8
@@ -8,9 +8,9 @@ import i from "../VirtualList/VirtualList.js";
8
8
  import { filterTreeByQuery as a, findNodeByKey as o, flattenVisibleTree as s, getChildKeys as c, getParentKey as l, mergeLoadedChildren as u, pruneLoadedChildren as d } from "./utils.js";
9
9
  import ee from "./TreeItem.js";
10
10
  /* empty css */
11
- import { useCallback as f, useEffect as p, useMemo as m, useRef as h, useState as g } from "react";
12
- import { jsx as _, jsxs as te } from "react/jsx-runtime";
13
- import { useControl as v } from "react-use-control";
11
+ import { useCallback as f, useEffect as p, useImperativeHandle as m, useMemo as h, useRef as g, useState as _ } from "react";
12
+ import { jsx as v, jsxs as te } from "react/jsx-runtime";
13
+ import { useControl as y } from "react-use-control";
14
14
  //#region src/lib/components/Tree/Tree.tsx
15
15
  var ne = "haze-Tree__base", re = "haze-Tree__virtualTree", ie = 320, ae = 32, oe = "haze-Tree__group", se = "haze-Tree__emptyBlock";
16
16
  function ce(e, t) {
@@ -36,275 +36,297 @@ function le(e, t, n) {
36
36
  halfChecked: Array.from(i)
37
37
  };
38
38
  }
39
- function y({ treeData: y, multiple: ue = !1, checkable: b = !1, checkStrictly: x = !1, selectable: S = !0, disabled: C = !1, blockNode: de = !1, showLine: fe = !1, showIcon: pe = !1, switcherIcon: me, loadingIcon: he, titleRender: ge, iconRender: _e, virtualized: w, loadData: T, searchValue: E, rowWrap: D, keyboardNavigation: ve = !0, expandedKeys: ye, selectedKeys: be, checkedKeys: xe, ref: Se, className: O, onExpand: Ce, onSelect: we, onCheck: Te }) {
40
- let Ee = n("tree"), [k, De] = v(ye, []), [A, Oe] = v(be, []), [ke, Ae] = v(xe, []), je = ke, j = !!T, [M, Me] = g({}), [N, P] = g({}), F = h(/* @__PURE__ */ new Set()), I = m(() => d(M, y), [M, y]);
39
+ function b({ treeData: b, multiple: ue = !1, checkable: x = !1, checkStrictly: S = !1, selectable: C = !0, disabled: w = !1, blockNode: de = !1, showLine: fe = !1, showIcon: pe = !1, switcherIcon: me, loadingIcon: he, titleRender: ge, iconRender: _e, virtualized: T, loadData: E, searchValue: D, rowWrap: O, keyboardNavigation: ve = !0, scrollHandleRef: ye, expandedKeys: be, selectedKeys: xe, checkedKeys: Se, ref: Ce, className: k, onExpand: we, onSelect: Te, onCheck: Ee }) {
40
+ let De = n("tree"), [A, Oe] = y(be, []), [j, ke] = y(xe, []), [Ae, je] = y(Se, []), Me = Ae, M = !!E, [N, Ne] = _({}), [P, F] = _({}), I = g(/* @__PURE__ */ new Set()), L = h(() => d(N, b), [N, b]);
41
41
  p(() => {
42
- I !== M && Me(I);
43
- }, [I, M]);
44
- let L = m(() => u(y, I), [y, I]), R = f((e, t) => {
45
- T && !F.current.has(e) && (F.current.add(e), P((t) => ({
42
+ L !== N && Ne(L);
43
+ }, [L, N]);
44
+ let R = h(() => u(b, L), [b, L]), z = f((e, t) => {
45
+ E && !I.current.has(e) && (I.current.add(e), F((t) => ({
46
46
  ...t,
47
47
  [e]: "loading"
48
- })), T(t).then((t) => {
49
- F.current.delete(e), Me((n) => ({
48
+ })), E(t).then((t) => {
49
+ I.current.delete(e), Ne((n) => ({
50
50
  ...n,
51
51
  [e]: t
52
- })), P((t) => ce(t, e));
52
+ })), F((t) => ce(t, e));
53
53
  }).catch(() => {
54
- F.current.delete(e), P((t) => ({
54
+ I.current.delete(e), F((t) => ({
55
55
  ...t,
56
56
  [e]: "error"
57
57
  }));
58
58
  }));
59
- }, [T]);
60
- function Ne(e) {
61
- let t = o(L, e);
62
- t && R(e, t);
59
+ }, [E]);
60
+ function Pe(e) {
61
+ let t = o(R, e);
62
+ t && z(e, t);
63
63
  }
64
- let z = m(() => a(L, E), [L, E]), Pe = z !== null, B = z ? z.tree : L, V = m(() => !z || z.ancestorKeys.length === 0 ? k : Array.from(/* @__PURE__ */ new Set([...k, ...z.ancestorKeys])), [k, z]);
64
+ let B = h(() => a(R, D), [R, D]), Fe = B !== null, V = B ? B.tree : R, H = h(() => !B || B.ancestorKeys.length === 0 ? A : Array.from(/* @__PURE__ */ new Set([...A, ...B.ancestorKeys])), [A, B]);
65
65
  p(() => {
66
- if (T) for (let e of V) {
67
- let t = o(L, e);
68
- t && !t.children?.length && t.isLeaf !== !0 && I[e] === void 0 && N[e] === void 0 && R(e, t);
66
+ if (E) for (let e of H) {
67
+ let t = o(R, e);
68
+ t && !t.children?.length && t.isLeaf !== !0 && L[e] === void 0 && P[e] === void 0 && z(e, t);
69
69
  }
70
70
  }, [
71
- T,
71
+ E,
72
+ z,
72
73
  R,
74
+ H,
73
75
  L,
74
- V,
75
- I,
76
- N
76
+ P
77
77
  ]);
78
- let Fe = m(() => le(je, L, x), [
79
- je,
80
- L,
81
- x
82
- ]), H = Fe.checked, Ie = Fe.halfChecked, Le = w !== void 0 && w !== !1, U = typeof w == "object" ? w : void 0, [Re, ze] = g(null), [W, Be] = g(null), Ve = h(null), He = h(null), G = f((e) => r(Ve, Se)(e), [Se]), K = m(() => s(B, V, C), [
83
- B,
78
+ let Ie = h(() => le(Me, R, S), [
79
+ Me,
80
+ R,
81
+ S
82
+ ]), U = Ie.checked, Le = Ie.halfChecked, W = T !== void 0 && T !== !1, G = typeof T == "object" ? T : void 0, [Re, ze] = _(null), [K, Be] = _(null), q = g(null), Ve = g(null), He = f((e) => r(q, Ce)(e), [Ce]), J = h(() => s(V, H, w), [
84
83
  V,
85
- C
84
+ H,
85
+ w
86
86
  ]), Ue = (() => {
87
- let e = K.find((e) => e.key === Re && !e.disabled);
88
- return e ? e.key : K.find((e) => !e.disabled)?.key ?? null;
87
+ let e = J.find((e) => e.key === Re && !e.disabled);
88
+ return e ? e.key : J.find((e) => !e.disabled)?.key ?? null;
89
89
  })();
90
- function q(e) {
91
- let t = K[e];
92
- t && !t.disabled && (Le && He.current?.scrollToIndex(e, "auto"), ze(t.key), Be(t.key));
90
+ function Y(e) {
91
+ let t = J[e];
92
+ t && !t.disabled && (W && Ve.current?.scrollToIndex(e, "auto"), ze(t.key), Be(t.key));
93
93
  }
94
- function J(e, t) {
95
- for (let n = e + t; n >= 0 && n < K.length; n += t) {
96
- let e = K[n];
94
+ function X(e, t) {
95
+ for (let n = e + t; n >= 0 && n < J.length; n += t) {
96
+ let e = J[n];
97
97
  if (e && !e.disabled) return n;
98
98
  }
99
99
  return -1;
100
100
  }
101
- function Y(e) {
101
+ function Z(e) {
102
102
  let t = e.target;
103
103
  if (t.getAttribute("role") !== "treeitem") return;
104
104
  let n = t.dataset.treeKey;
105
105
  n && ze(n);
106
106
  }
107
- function X(e) {
107
+ function We(e) {
108
108
  if (!ve) return;
109
- let n = K;
109
+ let n = J;
110
110
  if (n.length === 0) return;
111
111
  let r = e.target;
112
112
  if (r.getAttribute("role") !== "treeitem") return;
113
113
  let i = r.dataset.treeKey, a = i ? n.findIndex((e) => e.key === i) : -1, o = a >= 0 ? n[a] : void 0;
114
114
  if (!o || o.disabled) return;
115
- let s = o.node.isLeaf ?? (!o.node.children?.length && !j), c = t(e.currentTarget) === "rtl", l = c ? "ArrowLeft" : "ArrowRight", u = c ? "ArrowRight" : "ArrowLeft";
115
+ let s = o.node.isLeaf ?? (!o.node.children?.length && !M), c = t(e.currentTarget) === "rtl", l = c ? "ArrowLeft" : "ArrowRight", u = c ? "ArrowRight" : "ArrowLeft";
116
116
  switch (e.key) {
117
117
  case "ArrowDown":
118
- e.preventDefault(), q(J(a, 1));
118
+ e.preventDefault(), Y(X(a, 1));
119
119
  return;
120
120
  case "ArrowUp":
121
- e.preventDefault(), q(J(a, -1));
121
+ e.preventDefault(), Y(X(a, -1));
122
122
  return;
123
123
  case l:
124
124
  if (e.preventDefault(), s) return;
125
- V.includes(o.key) ? q(J(a, 1)) : Z(o.key);
125
+ H.includes(o.key) ? Y(X(a, 1)) : $(o.key);
126
126
  return;
127
127
  case u: {
128
- if (e.preventDefault(), !s && V.includes(o.key)) {
129
- Z(o.key);
128
+ if (e.preventDefault(), !s && H.includes(o.key)) {
129
+ $(o.key);
130
130
  return;
131
131
  }
132
132
  let t = o.parentKey === null ? -1 : n.findIndex((e) => e.key === o.parentKey);
133
- t >= 0 && q(t);
133
+ t >= 0 && Y(t);
134
134
  return;
135
135
  }
136
136
  case "Home":
137
- e.preventDefault(), q(J(-1, 1));
137
+ e.preventDefault(), Y(X(-1, 1));
138
138
  return;
139
139
  case "End":
140
- e.preventDefault(), q(J(n.length, -1));
140
+ e.preventDefault(), Y(X(n.length, -1));
141
141
  return;
142
142
  case "Enter":
143
- e.preventDefault(), Q(o.key);
143
+ e.preventDefault(), qe(o.key);
144
144
  return;
145
145
  case " ":
146
146
  case "Space":
147
- if (!b) return;
148
- e.preventDefault(), $(o.key);
147
+ if (!x) return;
148
+ e.preventDefault(), Je(o.key);
149
149
  return;
150
150
  }
151
151
  }
152
152
  p(() => {
153
- if (W === null) return;
154
- let e = Ve.current;
153
+ if (K === null) return;
154
+ let e = q.current;
155
155
  if (!e) return;
156
- let t = Array.from(e.querySelectorAll("[role=\"treeitem\"]")).find((e) => e.dataset.treeKey === W);
156
+ let t = Array.from(e.querySelectorAll("[role=\"treeitem\"]")).find((e) => e.dataset.treeKey === K);
157
157
  t && (t.focus(), Be(null));
158
- }, [W, K]);
159
- function Z(e) {
160
- let t = k.includes(e), n = t ? k.filter((t) => t !== e) : [...k, e];
161
- De(n), !t && N[e] === "error" && P((t) => ce(t, e)), Ce?.(n, {
158
+ }, [K, J]);
159
+ let [Q, Ge] = _(null), Ke = f((e, t = "auto") => {
160
+ Ge({
161
+ key: e,
162
+ align: t
163
+ });
164
+ }, []);
165
+ m(ye, () => ({ scrollToKey: Ke }), [Ke]), p(() => {
166
+ if (!Q) return;
167
+ let e = J.findIndex((e) => e.key === Q.key);
168
+ if (!(e < 0)) {
169
+ if (W) Ve.current?.scrollToIndex(e, Q.align);
170
+ else {
171
+ let e = Array.from(q.current?.querySelectorAll("[role=\"treeitem\"]") ?? []).find((e) => e.dataset.treeKey === Q.key), t = Q.align === "start" ? "start" : Q.align === "end" ? "end" : Q.align === "center" ? "center" : "nearest";
172
+ e?.scrollIntoView({ block: t });
173
+ }
174
+ Ge(null);
175
+ }
176
+ }, [
177
+ Q,
178
+ J,
179
+ W
180
+ ]);
181
+ function $(e) {
182
+ let t = A.includes(e), n = t ? A.filter((t) => t !== e) : [...A, e];
183
+ Oe(n), !t && P[e] === "error" && F((t) => ce(t, e)), we?.(n, {
162
184
  expanded: !t,
163
- node: o(L, e)
185
+ node: o(R, e)
164
186
  });
165
187
  }
166
- function Q(e) {
167
- let t = o(L, e);
168
- if (!t?.selectable && t?.selectable !== void 0 || !S) return;
188
+ function qe(e) {
189
+ let t = o(R, e);
190
+ if (!t?.selectable && t?.selectable !== void 0 || !C) return;
169
191
  let n;
170
- n = ue ? A.indexOf(e) >= 0 ? A.filter((t) => t !== e) : [...A, e] : A.includes(e) ? [] : [e], Oe(n), we?.(n, {
192
+ n = ue ? j.indexOf(e) >= 0 ? j.filter((t) => t !== e) : [...j, e] : j.includes(e) ? [] : [e], ke(n), Te?.(n, {
171
193
  selected: n.includes(e),
172
- selectedNodes: n.map((e) => o(L, e)).filter(Boolean),
194
+ selectedNodes: n.map((e) => o(R, e)).filter(Boolean),
173
195
  node: t
174
196
  });
175
197
  }
176
- function $(e) {
177
- if (!b || o(L, e)?.disableCheckbox) return;
178
- let t = H.includes(e), n;
179
- if (x) n = t ? H.filter((t) => t !== e) : [...H, e];
198
+ function Je(e) {
199
+ if (!x || o(R, e)?.disableCheckbox) return;
200
+ let t = U.includes(e), n;
201
+ if (S) n = t ? U.filter((t) => t !== e) : [...U, e];
180
202
  else {
181
- let r = c(L, e);
203
+ let r = c(R, e);
182
204
  if (t) {
183
- n = H.filter((t) => t !== e && !r.includes(t));
184
- let t = l(L, e);
185
- for (; t;) n = n.filter((e) => e !== t), t = l(L, t);
205
+ n = U.filter((t) => t !== e && !r.includes(t));
206
+ let t = l(R, e);
207
+ for (; t;) n = n.filter((e) => e !== t), t = l(R, t);
186
208
  } else {
187
- let t = [e, ...r].filter((e) => !H.includes(e));
188
- n = [...H, ...t];
189
- let i = l(L, e);
190
- for (; i;) c(L, i).every((e) => n.includes(e)) && !n.includes(i) && n.push(i), i = l(L, i);
209
+ let t = [e, ...r].filter((e) => !U.includes(e));
210
+ n = [...U, ...t];
211
+ let i = l(R, e);
212
+ for (; i;) c(R, i).every((e) => n.includes(e)) && !n.includes(i) && n.push(i), i = l(R, i);
191
213
  }
192
214
  }
193
- let r = le(n, L, x);
194
- Ae(x ? n : r.checked), Te?.(x ? n : r, {
215
+ let r = le(n, R, S);
216
+ je(S ? n : r.checked), Ee?.(S ? n : r, {
195
217
  checked: !t,
196
- checkedNodes: n.map((e) => o(L, e)).filter(Boolean),
197
- node: o(L, e),
218
+ checkedNodes: n.map((e) => o(R, e)).filter(Boolean),
219
+ node: o(R, e),
198
220
  halfCheckedKeys: r.halfChecked
199
221
  });
200
222
  }
201
- function We(t, n, r) {
223
+ function Ye(t, n, r) {
202
224
  return t.map((i, a) => {
203
- let o = !!i.children?.length, s = V.includes(i.key), c = A.includes(i.key), l = H.includes(i.key), u = Ie.includes(i.key), d = N[i.key], f = l ? "checked" : u ? "halfChecked" : "unchecked", p = a === t.length - 1, m = [...r, p], h = /* @__PURE__ */ _(ee, {
225
+ let o = !!i.children?.length, s = H.includes(i.key), c = j.includes(i.key), l = U.includes(i.key), u = Le.includes(i.key), d = P[i.key], f = l ? "checked" : u ? "halfChecked" : "unchecked", p = a === t.length - 1, m = [...r, p], h = /* @__PURE__ */ v(ee, {
204
226
  node: i,
205
227
  level: n,
206
228
  expanded: s,
207
229
  selected: c,
208
230
  checked: f,
209
- disabled: C,
210
- checkable: b,
211
- selectable: S,
231
+ disabled: w,
232
+ checkable: x,
233
+ selectable: C,
212
234
  blockNode: de,
213
235
  showLine: fe,
214
236
  showIcon: pe,
215
237
  switcherIcon: me,
216
238
  loadingIcon: he,
217
239
  loading: d === "loading",
218
- loadable: j,
240
+ loadable: M,
219
241
  loadFailed: d === "error",
220
- searchValue: E,
242
+ searchValue: D,
221
243
  titleRender: ge,
222
244
  iconRender: _e,
223
245
  isLast: m,
224
246
  tabIndex: i.key === Ue ? 0 : -1,
225
- onToggle: () => Z(i.key),
226
- onSelect: () => Q(i.key),
227
- onCheck: () => $(i.key),
228
- onRetry: () => Ne(i.key)
247
+ onToggle: () => $(i.key),
248
+ onSelect: () => qe(i.key),
249
+ onCheck: () => Je(i.key),
250
+ onRetry: () => Pe(i.key)
229
251
  });
230
252
  return /* @__PURE__ */ te("div", {
231
253
  role: "group",
232
254
  "data-slot": "group",
233
255
  className: e(oe),
234
- children: [D ? D(h, i) : h, o && s && /* @__PURE__ */ _("div", {
256
+ children: [O ? O(h, i) : h, o && s && /* @__PURE__ */ v("div", {
235
257
  "data-slot": "list",
236
- children: We(i.children, n + 1, m)
258
+ children: Ye(i.children, n + 1, m)
237
259
  })]
238
260
  }, i.key);
239
261
  });
240
262
  }
241
- function Ge(e) {
242
- let t = H.includes(e.key), n = Ie.includes(e.key), r = N[e.key], i = t ? "checked" : n ? "halfChecked" : "unchecked", a = /* @__PURE__ */ _(ee, {
263
+ function Xe(e) {
264
+ let t = U.includes(e.key), n = Le.includes(e.key), r = P[e.key], i = t ? "checked" : n ? "halfChecked" : "unchecked", a = /* @__PURE__ */ v(ee, {
243
265
  node: e.node,
244
266
  level: e.level,
245
- expanded: V.includes(e.key),
246
- selected: A.includes(e.key),
267
+ expanded: H.includes(e.key),
268
+ selected: j.includes(e.key),
247
269
  checked: i,
248
- disabled: C,
249
- checkable: b,
250
- selectable: S,
270
+ disabled: w,
271
+ checkable: x,
272
+ selectable: C,
251
273
  blockNode: de,
252
274
  showLine: fe,
253
275
  showIcon: pe,
254
276
  switcherIcon: me,
255
277
  loadingIcon: he,
256
278
  loading: r === "loading",
257
- loadable: j,
279
+ loadable: M,
258
280
  loadFailed: r === "error",
259
- searchValue: E,
281
+ searchValue: D,
260
282
  titleRender: ge,
261
283
  iconRender: _e,
262
284
  isLast: e.isLast,
263
285
  tabIndex: e.key === Ue ? 0 : -1,
264
- onToggle: () => Z(e.key),
265
- onSelect: () => Q(e.key),
266
- onCheck: () => $(e.key),
267
- onRetry: () => Ne(e.key)
286
+ onToggle: () => $(e.key),
287
+ onSelect: () => qe(e.key),
288
+ onCheck: () => Je(e.key),
289
+ onRetry: () => Pe(e.key)
268
290
  });
269
- return D ? D(a, e.node) : a;
291
+ return O ? O(a, e.node) : a;
270
292
  }
271
- return Pe && B.length === 0 ? /* @__PURE__ */ _("div", {
293
+ return Fe && V.length === 0 ? /* @__PURE__ */ v("div", {
272
294
  role: "tree",
273
295
  "data-slot": "tree",
274
- ref: G,
275
- onKeyDown: X,
276
- onFocus: Y,
277
- className: e([ne, O]),
278
- children: _("div", {
296
+ ref: He,
297
+ onKeyDown: We,
298
+ onFocus: Z,
299
+ className: e([ne, k]),
300
+ children: v("div", {
279
301
  "data-slot": "empty",
280
302
  className: e(se),
281
- children: Ee.noMatch
303
+ children: De.noMatch
282
304
  })
283
- }) : Le ? /* @__PURE__ */ _("div", {
305
+ }) : W ? /* @__PURE__ */ v("div", {
284
306
  role: "tree",
285
307
  "data-slot": "tree",
286
- ref: G,
287
- onKeyDown: X,
288
- onFocus: Y,
289
- className: e([re, O]),
290
- children: _(i, {
291
- ref: He,
308
+ ref: He,
309
+ onKeyDown: We,
310
+ onFocus: Z,
311
+ className: e([re, k]),
312
+ children: v(i, {
313
+ ref: Ve,
292
314
  "data-virtualized": !0,
293
- items: K,
294
- height: U?.height ?? ie,
295
- itemHeight: U?.itemHeight ?? ae,
296
- overscan: U?.overscan,
297
- renderItem: Ge
315
+ items: J,
316
+ height: G?.height ?? ie,
317
+ itemHeight: G?.itemHeight ?? ae,
318
+ overscan: G?.overscan,
319
+ renderItem: Xe
298
320
  })
299
- }) : /* @__PURE__ */ _("div", {
321
+ }) : /* @__PURE__ */ v("div", {
300
322
  role: "tree",
301
323
  "data-slot": "tree",
302
- ref: G,
303
- onKeyDown: X,
304
- onFocus: Y,
305
- className: e([ne, O]),
306
- children: We(B, 0, [])
324
+ ref: He,
325
+ onKeyDown: We,
326
+ onFocus: Z,
327
+ className: e([ne, k]),
328
+ children: Ye(V, 0, [])
307
329
  });
308
330
  }
309
331
  //#endregion
310
- export { y as default };
332
+ export { b as default };
@@ -1,4 +1,5 @@
1
1
  "use client";
2
2
  import e from "./Tree.js";
3
3
  import t from "./SortableTree.js";
4
- export { t as SortableTree, e as Tree };
4
+ import { useTree as n } from "./useTree.js";
5
+ export { t as SortableTree, e as Tree, n as useTree };
@@ -0,0 +1,32 @@
1
+ "use client";
2
+ import { flattenVisibleTree as e, getNodePath as t } from "./utils.js";
3
+ import { useCallback as n, useRef as r } from "react";
4
+ import { useControl as i } from "react-use-control";
5
+ //#region src/lib/components/Tree/useTree.ts
6
+ function a(a) {
7
+ let { treeData: o, expandedKeys: s } = a, [c, l, u] = i(s, []), d = r(null), f = n((e) => t(o, e), [o]), p = n(() => e(o, c, !1), [o, c]), m = n((e, n) => {
8
+ let { autoExpand: r = !1, align: i = "auto" } = n ?? {};
9
+ if (r) {
10
+ let n = t(o, e).slice(0, -1).map((e) => e.key);
11
+ n.length > 0 && l((e) => {
12
+ let t = n.filter((t) => !e.includes(t));
13
+ return t.length === 0 ? e : [...e, ...t];
14
+ });
15
+ }
16
+ d.current?.scrollToKey(e, i);
17
+ }, [o, l]);
18
+ return {
19
+ treeProps: {
20
+ treeData: o,
21
+ expandedKeys: u,
22
+ scrollHandleRef: d
23
+ },
24
+ expandedKeys: c,
25
+ setExpandedKeys: l,
26
+ getPath: f,
27
+ flattenVisible: p,
28
+ scrollTo: m
29
+ };
30
+ }
31
+ //#endregion
32
+ export { a as useTree };
@@ -45,26 +45,36 @@ function r(e, t, n) {
45
45
  return null;
46
46
  }
47
47
  function i(e, t) {
48
+ for (let n of e) {
49
+ if (n.key === t) return [n];
50
+ if (n.children?.length) {
51
+ let e = i(n.children, t);
52
+ if (e.length > 0) return [n, ...e];
53
+ }
54
+ }
55
+ return [];
56
+ }
57
+ function a(e, t) {
48
58
  if (!t) return [];
49
59
  let n = e.toLowerCase(), r = t.toLowerCase(), i = [], a = n.indexOf(r);
50
60
  for (; a !== -1;) i.push([a, a + r.length]), a = n.indexOf(r, a + r.length);
51
61
  return i;
52
62
  }
53
- function a(e, t) {
54
- return typeof e.title == "string" && i(e.title, t).length > 0;
55
- }
56
63
  function o(e, t) {
64
+ return typeof e.title == "string" && a(e.title, t).length > 0;
65
+ }
66
+ function s(e, t) {
57
67
  if (!t) return null;
58
68
  let n = [], r = [], i = (e) => {
59
- let o = [];
69
+ let a = [];
60
70
  for (let s of e) {
61
- let e = s.children?.length ? i(s.children) : [], c = a(s, t);
62
- c && n.push(s.key), (c || e.length !== 0) && (e.length > 0 ? (r.push(s.key), o.push({
71
+ let e = s.children?.length ? i(s.children) : [], c = o(s, t);
72
+ c && n.push(s.key), (c || e.length !== 0) && (e.length > 0 ? (r.push(s.key), a.push({
63
73
  ...s,
64
74
  children: e
65
- })) : o.push(s));
75
+ })) : a.push(s));
66
76
  }
67
- return o;
77
+ return a;
68
78
  };
69
79
  return {
70
80
  tree: i(e),
@@ -72,7 +82,7 @@ function o(e, t) {
72
82
  ancestorKeys: r
73
83
  };
74
84
  }
75
- function s(e, t) {
85
+ function c(e, t) {
76
86
  if (Object.keys(t).length === 0) return e;
77
87
  let n = (e) => e.map((e) => {
78
88
  if (e.children?.length) return {
@@ -90,7 +100,7 @@ function s(e, t) {
90
100
  });
91
101
  return n(e);
92
102
  }
93
- function c(e, n) {
103
+ function l(e, n) {
94
104
  let r = Object.entries(e);
95
105
  if (r.length === 0) return e;
96
106
  let i = {}, a = !1;
@@ -101,4 +111,4 @@ function c(e, n) {
101
111
  return a ? i : e;
102
112
  }
103
113
  //#endregion
104
- export { o as filterTreeByQuery, t as findNodeByKey, e as flattenVisibleTree, n as getChildKeys, r as getParentKey, i as matchRanges, s as mergeLoadedChildren, a as nodeTitleMatches, c as pruneLoadedChildren };
114
+ export { s as filterTreeByQuery, t as findNodeByKey, e as flattenVisibleTree, n as getChildKeys, i as getNodePath, r as getParentKey, a as matchRanges, c as mergeLoadedChildren, o as nodeTitleMatches, l as pruneLoadedChildren };
@@ -1,4 +1,4 @@
1
1
  /* haze-ui anchor — generated by scripts/split-css.mjs, do not edit */
2
2
  @layer haze {
3
- .haze-Anchor__nav{font-size:var(--haze-text-sm);position:sticky;top:0}.haze-Anchor__list{gap:var(--haze-space-1);flex-direction:column;margin:0;padding:0;list-style:none;display:flex}.haze-Anchor__link{padding:var(--haze-space-1) var(--haze-space-2);border-inline-start:var(--haze-space-1) solid transparent;border-radius:0 var(--haze-radius-sm) var(--haze-radius-sm) 0;color:var(--haze-color-text-muted);-webkit-transition:color var(--haze-duration-fast) var(--haze-ease),border-color var(--haze-duration-fast) var(--haze-ease);transition:color var(--haze-duration-fast) var(--haze-ease),border-color var(--haze-duration-fast) var(--haze-ease);-webkit-text-decoration:none;text-decoration:none;display:block}.haze-Anchor__link:hover{color:var(--haze-color-text)}.haze-Anchor__linkActive{border-inline-start-color:var(--haze-color-primary);color:var(--haze-color-primary);font-weight:var(--haze-weight-medium)}
3
+ .haze-Anchor__nav{font-size:var(--haze-text-sm);position:sticky;top:0}.haze-Anchor__list{gap:var(--haze-space-1);flex-direction:column;margin:0;padding:0;list-style:none;display:flex}.haze-Anchor__sublist{gap:var(--haze-space-1);margin:var(--haze-space-1) 0 0;-webkit-padding-start:var(--haze-space-4);flex-direction:column;padding-inline-start:var(--haze-space-4);list-style:none;display:flex}.haze-Anchor__link{padding:var(--haze-space-1) var(--haze-space-2);border-inline-start:var(--haze-space-1) solid transparent;border-radius:0 var(--haze-radius-sm) var(--haze-radius-sm) 0;color:var(--haze-color-text-muted);-webkit-transition:color var(--haze-duration-fast) var(--haze-ease),border-color var(--haze-duration-fast) var(--haze-ease);transition:color var(--haze-duration-fast) var(--haze-ease),border-color var(--haze-duration-fast) var(--haze-ease);-webkit-text-decoration:none;text-decoration:none;display:block}.haze-Anchor__link:hover{color:var(--haze-color-text)}.haze-Anchor__linkActive{color:var(--haze-color-primary);font-weight:var(--haze-weight-medium)}.haze-Anchor__linkActiveBar{border-inline-start-color:var(--haze-color-primary)}.haze-Anchor__indicatorBar{inset-inline-start:0;width:var(--haze-space-1);border-radius:var(--haze-radius-sm);background:var(--haze-color-primary);pointer-events:none;-webkit-transition:-webkit-transform var(--haze-duration-normal) var(--haze-ease),height var(--haze-duration-normal) var(--haze-ease),opacity var(--haze-duration-fast) var(--haze-ease);transition:transform var(--haze-duration-normal) var(--haze-ease),height var(--haze-duration-normal) var(--haze-ease),opacity var(--haze-duration-fast) var(--haze-ease);position:absolute;top:0}@media (prefers-reduced-motion:reduce){.haze-Anchor__indicatorBar{transition:none}}.haze-Anchor__indicatorHidden{opacity:0}
4
4
  }
@@ -1,6 +1,6 @@
1
1
  /* haze-ui combobox — generated by scripts/split-css.mjs, do not edit */
2
2
  @layer haze {
3
- .haze-Combobox__wrapper{width:100%;display:inline-block;position:relative}.haze-Combobox__input{border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-md);background:var(--haze-color-bg);width:100%;color:var(--haze-color-text);font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);padding:var(--haze-space-2) var(--haze-space-3);line-height:var(--haze-leading-normal);-webkit-transition:border-color var(--haze-duration-fast),box-shadow var(--haze-duration-fast);transition:border-color var(--haze-duration-fast),box-shadow var(--haze-duration-fast);box-sizing:border-box;display:block}.haze-Combobox__input:focus{border-color:var(--haze-color-primary);box-shadow:0 0 0 3px var(--haze-color-focus-ring);outline:none}.haze-Combobox__multiBox{-webkit-box-flex-wrap:wrap;align-items:center;gap:var(--haze-space-1);box-sizing:border-box;border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-md);background:var(--haze-color-bg);cursor:text;width:100%;padding:var(--haze-space-1) var(--haze-space-2);-webkit-transition:border-color var(--haze-duration-fast),box-shadow var(--haze-duration-fast);transition:border-color var(--haze-duration-fast),box-shadow var(--haze-duration-fast);flex-wrap:wrap;display:flex}.haze-Combobox__multiBox:focus-within{border-color:var(--haze-color-primary);box-shadow:0 0 0 3px var(--haze-color-focus-ring)}.haze-Combobox__multiInput{min-width:4rem;padding:var(--haze-space-1) 0;color:var(--haze-color-text);font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);line-height:var(--haze-leading-normal);background:0 0;border:none;outline:none;flex:1}.haze-Combobox__multiInput::-webkit-input-placeholder{color:var(--haze-color-text-muted)}.haze-Combobox__multiInput::placeholder{color:var(--haze-color-text-muted)}.haze-Combobox__multiInput:-ms-placeholder-shown{color:var(--haze-color-text-muted)}.haze-Combobox__multiInput::placeholder{color:var(--haze-color-text-muted)}.haze-Combobox__matchMark{background:var(--haze-color-primary-subtle);color:var(--haze-color-primary);border-radius:var(--haze-radius-sm);padding:0}.haze-Combobox__stateRow{justify-content:center;align-items:center;gap:var(--haze-space-2);padding:var(--haze-space-2) var(--haze-space-3);font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);color:var(--haze-color-text-muted);cursor:default;display:flex}.haze-Combobox__groupHeadingText{font-family:var(--haze-font-sans);font-size:var(--haze-text-xs);color:var(--haze-color-text-muted)}.haze-Combobox__listbox{box-sizing:border-box;min-width:100%;min-width:anchor-size(width);border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-md);background:var(--haze-color-bg);max-height:200px;box-shadow:var(--haze-shadow-lg);overflow-y:auto}.haze-Combobox__listboxVirtual{box-sizing:border-box;min-width:100%;min-width:anchor-size(width);border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-md);background:var(--haze-color-bg);box-shadow:var(--haze-shadow-lg)}.haze-Combobox__virtualRow{box-sizing:border-box;height:100%}
3
+ .haze-Combobox__wrapper{width:100%;display:inline-block;position:relative}.haze-Combobox__input{border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-md);background:var(--haze-color-bg);width:100%;color:var(--haze-color-text);font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);padding:var(--haze-space-2) var(--haze-space-3);line-height:var(--haze-leading-normal);-webkit-transition:border-color var(--haze-duration-fast),box-shadow var(--haze-duration-fast);transition:border-color var(--haze-duration-fast),box-shadow var(--haze-duration-fast);box-sizing:border-box;display:block}.haze-Combobox__input:focus{border-color:var(--haze-color-primary);box-shadow:0 0 0 3px var(--haze-color-focus-ring);outline:none}.haze-Combobox__multiBox{-webkit-box-flex-wrap:wrap;align-items:center;gap:var(--haze-space-1);box-sizing:border-box;border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-md);background:var(--haze-color-bg);cursor:text;width:100%;padding:var(--haze-space-1) var(--haze-space-2);-webkit-transition:border-color var(--haze-duration-fast),box-shadow var(--haze-duration-fast);transition:border-color var(--haze-duration-fast),box-shadow var(--haze-duration-fast);flex-wrap:wrap;display:flex}.haze-Combobox__multiBox:focus-within{border-color:var(--haze-color-primary);box-shadow:0 0 0 3px var(--haze-color-focus-ring)}.haze-Combobox__multiInput{min-width:4rem;padding:var(--haze-space-1) 0;color:var(--haze-color-text);font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);line-height:var(--haze-leading-normal);background:0 0;border:none;outline:none;flex:1}.haze-Combobox__multiInput::-webkit-input-placeholder{color:var(--haze-color-text-muted)}.haze-Combobox__multiInput::placeholder{color:var(--haze-color-text-muted)}.haze-Combobox__multiInput:-ms-placeholder-shown{color:var(--haze-color-text-muted)}.haze-Combobox__multiInput::placeholder{color:var(--haze-color-text-muted)}.haze-Combobox__overflowBadge{border-radius:var(--haze-radius-full);background:var(--haze-color-bg-muted);color:var(--haze-color-text-secondary);font-family:var(--haze-font-sans);font-size:var(--haze-text-xs);font-weight:var(--haze-weight-medium);white-space:nowrap;padding:var(--haze-space-1) var(--haze-space-2);cursor:default;align-items:center;line-height:1;display:inline-flex}.haze-Combobox__matchMark{background:var(--haze-color-primary-subtle);color:var(--haze-color-primary);border-radius:var(--haze-radius-sm);padding:0}.haze-Combobox__stateRow{justify-content:center;align-items:center;gap:var(--haze-space-2);padding:var(--haze-space-2) var(--haze-space-3);font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);color:var(--haze-color-text-muted);cursor:default;display:flex}.haze-Combobox__groupHeadingText{font-family:var(--haze-font-sans);font-size:var(--haze-text-xs);color:var(--haze-color-text-muted)}.haze-Combobox__listbox{box-sizing:border-box;min-width:100%;min-width:anchor-size(width);border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-md);background:var(--haze-color-bg);max-height:200px;box-shadow:var(--haze-shadow-lg);overflow-y:auto}.haze-Combobox__listboxVirtual{box-sizing:border-box;min-width:100%;min-width:anchor-size(width);border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-md);background:var(--haze-color-bg);box-shadow:var(--haze-shadow-lg)}.haze-Combobox__virtualRow{box-sizing:border-box;height:100%}
4
4
  .haze-ComboboxGroup__groupHeading{z-index:var(--haze-z-local-1);box-sizing:border-box;background:var(--haze-color-bg);border-bottom:1px solid var(--haze-color-border);padding:var(--haze-space-1) var(--haze-space-3);font-family:var(--haze-font-sans);font-size:var(--haze-text-xs);color:var(--haze-color-text-muted);position:sticky;top:0}
5
5
  .haze-ComboboxOption__option{padding:var(--haze-space-2) var(--haze-space-3);font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);color:var(--haze-color-text);cursor:pointer;-webkit-transition:background var(--haze-duration-fast);transition:background var(--haze-duration-fast);align-items:center;display:flex}.haze-ComboboxOption__option:hover:not([data-disabled]){background:var(--haze-color-bg-subtle)}.haze-ComboboxOption__option:active:not([data-disabled]){background:var(--haze-color-bg-muted)}.haze-ComboboxOption__option[data-disabled]{opacity:.5;cursor:not-allowed}.haze-ComboboxOption__highlightedStyle{background:var(--haze-color-bg-subtle)}.haze-ComboboxOption__selectedStyle{font-weight:var(--haze-weight-medium);color:var(--haze-color-primary)}
6
6
  .haze-floating__floatingNative{margin:0;inset:auto}.haze-floating__floatingAnchored{position-anchor:var(--haze-floating-anchor)}.haze-floating__floatingFixed{position:fixed}.haze-floating__floatingHidden{display:none}.haze-floating__floatingAnimated[data-state=open]{-webkit-animation:haze-floating-in-haze-floating__floatingAnimated var(--haze-duration-fast) var(--haze-ease);animation:haze-floating-in-haze-floating__floatingAnimated var(--haze-duration-fast) var(--haze-ease)}.haze-floating__floatingAnimated[data-state=closed]{-webkit-animation:haze-floating-out-haze-floating__floatingAnimated var(--haze-duration-fast) var(--haze-ease) forwards;animation:haze-floating-out-haze-floating__floatingAnimated var(--haze-duration-fast) var(--haze-ease) forwards}@keyframes haze-floating-in-haze-floating__floatingAnimated{0%{opacity:0}}@keyframes haze-floating-out-haze-floating__floatingAnimated{to{opacity:0}}.haze-floating__anchoredBottom,.haze-floating__anchoredBottomSpan{position-area:bottom span-right;margin-top:var(--haze-space-1);position-try-fallbacks:flip-block}.haze-floating__anchoredBottomCenter{position-area:bottom center;margin-top:var(--haze-space-1);position-try-fallbacks:flip-block}.haze-floating__anchoredBottomEnd{position-area:bottom span-left;margin-top:var(--haze-space-1);position-try-fallbacks:flip-block}.haze-floating__anchoredTop{position-area:top center;margin-bottom:var(--haze-space-1);position-try-fallbacks:flip-block}.haze-floating__anchoredLeft{position-area:left center;margin-right:var(--haze-space-1);position-try-fallbacks:flip-inline}.haze-floating__anchoredRight{position-area:right center;margin-left:var(--haze-space-1);position-try-fallbacks:flip-inline}.haze-floating__anchoredLogicalBottom{position-area:span-inline-end block-end;position-try-fallbacks:flip-block;margin-block-start:var(--haze-space-1)}.haze-floating__anchoredLogicalBottomCenter{position-area:block-end center;position-try-fallbacks:flip-block;margin-block-start:var(--haze-space-1)}.haze-floating__anchoredLogicalBottomEnd{position-area:span-inline-start block-end;position-try-fallbacks:flip-block;margin-block-start:var(--haze-space-1)}.haze-floating__anchoredLogicalTop{position-area:block-start center;position-try-fallbacks:flip-block;margin-block-end:var(--haze-space-1)}.haze-floating__anchoredLogicalLeft{position-area:inline-start center;-webkit-margin-end:var(--haze-space-1);position-try-fallbacks:flip-inline;margin-inline-end:var(--haze-space-1)}.haze-floating__anchoredLogicalRight{position-area:inline-end center;-webkit-margin-start:var(--haze-space-1);position-try-fallbacks:flip-inline;margin-inline-start:var(--haze-space-1)}.haze-floating__fallbackBottom{z-index:var(--haze-z-overlay-fallback);margin-top:var(--haze-space-1);position:absolute;top:100%;left:0}.haze-floating__fallbackBottomCenter{z-index:var(--haze-z-overlay-fallback);margin-top:var(--haze-space-1);position:absolute;top:100%;left:50%;transform:translate(-50%)}.haze-floating__fallbackBottomEnd{z-index:var(--haze-z-overlay-fallback);margin-top:var(--haze-space-1);position:absolute;top:100%;right:0}.haze-floating__fallbackTop{z-index:var(--haze-z-overlay-fallback);margin-bottom:var(--haze-space-1);position:absolute;bottom:100%;left:50%;transform:translate(-50%)}.haze-floating__fallbackLeft{z-index:var(--haze-z-overlay-fallback);margin-right:var(--haze-space-1);position:absolute;top:50%;right:100%;transform:translateY(-50%)}.haze-floating__fallbackRight{z-index:var(--haze-z-overlay-fallback);margin-left:var(--haze-space-1);position:absolute;top:50%;left:100%;transform:translateY(-50%)}.haze-floating__gapBelow{margin-top:var(--haze-space-1)}.haze-floating__gapAbove{margin-bottom:var(--haze-space-1)}.haze-floating__gapBefore{margin-right:var(--haze-space-1)}.haze-floating__gapAfter{margin-left:var(--haze-space-1)}
@@ -1,5 +1,5 @@
1
1
  /* haze-ui copy-button — generated by scripts/split-css.mjs, do not edit */
2
2
  @layer haze {
3
3
  .haze-copy-button-styles__sm{width:var(--haze-space-3);height:var(--haze-space-3)}.haze-copy-button-styles__md{width:var(--haze-space-4);height:var(--haze-space-4)}.haze-copy-button-styles__lg{width:var(--haze-space-5);height:var(--haze-space-5)}.haze-copy-button-styles__copiedSkin[data-copied]{color:var(--haze-color-success)}
4
- .haze-snippet-styles__snippet{align-items:center;gap:var(--haze-space-1);max-width:100%;padding-inline:var(--haze-space-3) var(--haze-space-1);padding-block:var(--haze-space-1);background:var(--haze-color-bg-muted);border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-md);font-family:var(--haze-font-mono);display:inline-flex}.haze-snippet-styles__content{text-overflow:ellipsis;white-space:nowrap;font-size:var(--haze-text-sm);line-height:var(--haze-leading-relaxed);color:var(--haze-color-text);overflow:hidden}
4
+ .haze-snippet-styles__snippet{align-items:center;gap:var(--haze-space-1);max-width:100%;padding-inline:var(--haze-space-3) var(--haze-space-1);padding-block:var(--haze-space-1);background:var(--haze-color-bg-muted);border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-md);font-family:var(--haze-font-mono);display:inline-flex}.haze-snippet-styles__content{text-overflow:ellipsis;white-space:nowrap;font-family:inherit;font-size:var(--haze-text-sm);line-height:var(--haze-leading-relaxed);color:var(--haze-color-text);overflow:hidden}
5
5
  }