haze-ui 1.34.1 → 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 (98) 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/data-table.css +1 -1
  39. package/dist/css/follow-up-suggestions.css +4 -0
  40. package/dist/css/notification-center.css +5 -0
  41. package/dist/css/task-list.css +4 -0
  42. package/dist/css/tokens.css +1 -0
  43. package/dist/css-manifest.json +21 -0
  44. package/dist/haze-ui.css +17 -3
  45. package/dist/headless/index.js +2 -1
  46. package/dist/hooks/index.js +25 -0
  47. package/dist/hooks/useAnchorSpy.js +49 -0
  48. package/dist/hooks/useElementSize.js +31 -0
  49. package/dist/hooks/useIdle.js +45 -0
  50. package/dist/hooks/useMutationObserver.js +31 -0
  51. package/dist/hooks/useNetwork.js +28 -0
  52. package/dist/hooks/useOrientation.js +27 -0
  53. package/dist/hooks/useResizeObserver.js +16 -0
  54. package/dist/icons/index.js +9 -0
  55. package/dist/index.js +323 -318
  56. package/dist/mcp-docs.json +535 -13
  57. package/dist/registry.json +387 -7
  58. package/dist/sitemap.xml +6 -0
  59. package/dist/tokens/index.js +2 -1
  60. package/dist/tokens/zoom.js +6 -0
  61. package/dist/types/components/Anchor/Anchor.d.ts +5 -1
  62. package/dist/types/components/BackToTop/BackToTop.d.ts +23 -5
  63. package/dist/types/components/Combobox/Combobox.d.ts +17 -1
  64. package/dist/types/components/ConfigProvider/ConfigContext.d.ts +6 -0
  65. package/dist/types/components/CopyButton/CopyButton.d.ts +16 -4
  66. package/dist/types/components/DataTable/DataTable.bench.d.ts +1 -0
  67. package/dist/types/components/FloatButton/FloatButton.d.ts +25 -5
  68. package/dist/types/components/FollowUpSuggestions/FollowUpSuggestions.d.ts +27 -0
  69. package/dist/types/components/FollowUpSuggestions/index.d.ts +2 -0
  70. package/dist/types/components/LocaleProvider/locale.d.ts +9 -0
  71. package/dist/types/components/NavigationBar/NavLink.d.ts +24 -32
  72. package/dist/types/components/NotificationCenter/NotificationCenter.d.ts +111 -0
  73. package/dist/types/components/NotificationCenter/index.d.ts +2 -0
  74. package/dist/types/components/Select/Select.bench.d.ts +1 -0
  75. package/dist/types/components/Tabs/Tab.d.ts +26 -4
  76. package/dist/types/components/TaskList/TaskList.d.ts +50 -0
  77. package/dist/types/components/TaskList/index.d.ts +2 -0
  78. package/dist/types/components/Toggle/Toggle.d.ts +15 -8
  79. package/dist/types/components/Toggle/ToggleCore.d.ts +16 -7
  80. package/dist/types/components/Toolbar/ToolbarButton.d.ts +17 -5
  81. package/dist/types/components/Toolbar/ToolbarToggle.d.ts +22 -5
  82. package/dist/types/components/Tree/Tree.d.ts +1 -1
  83. package/dist/types/components/Tree/index.d.ts +4 -1
  84. package/dist/types/components/Tree/types.d.ts +20 -0
  85. package/dist/types/components/Tree/useTree.d.ts +96 -0
  86. package/dist/types/components/Tree/utils.d.ts +7 -0
  87. package/dist/types/components/VirtualList/VirtualList.bench.d.ts +1 -0
  88. package/dist/types/headless/index.d.ts +16 -0
  89. package/dist/types/hooks/index.d.ts +4 -0
  90. package/dist/types/hooks/useAnchorSpy.d.ts +62 -0
  91. package/dist/types/icons/index.d.ts +138 -0
  92. package/dist/types/index.d.ts +10 -2
  93. package/dist/types/tokens/index.d.ts +1 -0
  94. package/dist/types/tokens/zoom.d.ts +33 -0
  95. package/dist/types/utils/deprecate.d.ts +13 -0
  96. package/dist/types/utils/portal.d.ts +29 -0
  97. package/dist/utils/portal.js +13 -0
  98. package/package.json +40 -8
@@ -0,0 +1,294 @@
1
+
2
+ "use client";
3
+ import { classnames as e } from "../../utils/classnames.js";
4
+ import { formatString as t } from "../LocaleProvider/locale.js";
5
+ import { useStrings as n } from "../LocaleProvider/useStrings.js";
6
+ import { useConfigDefaults as r } from "../ConfigProvider/useConfigDefaults.js";
7
+ import { FloatingPanel as i, useFloating as a } from "../../utils/floating.js";
8
+ import ee from "../Badge/Badge.js";
9
+ import { useFocusScope as o } from "../../utils/focus-scope.js";
10
+ import { useMenuKeyboard as s, useRovingTabindex as c } from "../../utils/menuKeyboard.js";
11
+ import l from "../Icon/Icon.js";
12
+ /* empty css */
13
+ import { c as u } from "react/compiler-runtime";
14
+ import { useCallback as d, useId as te, useRef as f } from "react";
15
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
16
+ import { useControl as h } from "react-use-control";
17
+ //#region src/lib/components/NotificationCenter/NotificationCenter.tsx
18
+ var g = "haze-NotificationCenter__container", _ = "haze-NotificationCenter__triggerBtn", v = "haze-NotificationCenter__badgeWrap", y = "haze-NotificationCenter__panelVisuals", b = "haze-NotificationCenter__panelHeader", x = "haze-NotificationCenter__panelTitle", S = "haze-NotificationCenter__notificationList", C = "haze-NotificationCenter__notificationItem", w = "haze-NotificationCenter__itemUnread", T = "haze-NotificationCenter__unreadDot", ne = "haze-NotificationCenter__itemIconWrap", re = {
19
+ info: "haze-NotificationCenter__info",
20
+ success: "haze-NotificationCenter__success",
21
+ warning: "haze-NotificationCenter__warning",
22
+ danger: "haze-NotificationCenter__danger"
23
+ }, E = "haze-NotificationCenter__itemBody", D = "haze-NotificationCenter__itemTitle", O = "haze-NotificationCenter__itemDescription", k = "haze-NotificationCenter__itemTimestamp", A = "haze-NotificationCenter__panelActions", j = "haze-NotificationCenter__actionBtn", M = "haze-NotificationCenter__emptyState";
24
+ function N() {
25
+ let e = u(1), t;
26
+ return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ m("svg", {
27
+ viewBox: "0 0 24 24",
28
+ fill: "none",
29
+ stroke: "currentColor",
30
+ strokeWidth: 2,
31
+ strokeLinecap: "round",
32
+ strokeLinejoin: "round",
33
+ "aria-hidden": "true",
34
+ children: [/* @__PURE__ */ p("path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" }), /* @__PURE__ */ p("path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0" })]
35
+ }), e[0] = t) : t = e[0], t;
36
+ }
37
+ function P() {
38
+ let e = u(1), t;
39
+ return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ m("svg", {
40
+ viewBox: "0 0 24 24",
41
+ fill: "none",
42
+ stroke: "currentColor",
43
+ strokeWidth: 2,
44
+ strokeLinecap: "round",
45
+ strokeLinejoin: "round",
46
+ "aria-hidden": "true",
47
+ children: [
48
+ /* @__PURE__ */ p("rect", {
49
+ x: "3",
50
+ y: "4",
51
+ width: "7",
52
+ height: "7",
53
+ rx: "1"
54
+ }),
55
+ /* @__PURE__ */ p("path", { d: "m5 7.5 1.5 1.5L9.5 5.5" }),
56
+ /* @__PURE__ */ p("path", { d: "M13 6h8" }),
57
+ /* @__PURE__ */ p("path", { d: "M13 12h8" }),
58
+ /* @__PURE__ */ p("path", { d: "M13 18h8" }),
59
+ /* @__PURE__ */ p("path", { d: "M3.5 13.5 5 15" }),
60
+ /* @__PURE__ */ p("path", { d: "M7.5 12.5 5 15l-1.5 4" })
61
+ ]
62
+ }), e[0] = t) : t = e[0], t;
63
+ }
64
+ function F() {
65
+ let e = u(1), t;
66
+ return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ m("svg", {
67
+ viewBox: "0 0 24 24",
68
+ fill: "none",
69
+ stroke: "currentColor",
70
+ strokeWidth: 2,
71
+ strokeLinecap: "round",
72
+ strokeLinejoin: "round",
73
+ "aria-hidden": "true",
74
+ children: [
75
+ /* @__PURE__ */ p("rect", {
76
+ x: "5",
77
+ y: "9",
78
+ width: "14",
79
+ height: "11",
80
+ rx: "2"
81
+ }),
82
+ /* @__PURE__ */ p("path", { d: "M12 9V5" }),
83
+ /* @__PURE__ */ p("circle", {
84
+ cx: "12",
85
+ cy: "3.5",
86
+ r: "1.5"
87
+ }),
88
+ /* @__PURE__ */ p("path", { d: "M9 14v1.5" }),
89
+ /* @__PURE__ */ p("path", { d: "M15 14v1.5" })
90
+ ]
91
+ }), e[0] = t) : t = e[0], t;
92
+ }
93
+ function I() {
94
+ let e = u(1), t;
95
+ return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ m("svg", {
96
+ viewBox: "0 0 24 24",
97
+ fill: "none",
98
+ stroke: "currentColor",
99
+ strokeWidth: 2,
100
+ strokeLinecap: "round",
101
+ strokeLinejoin: "round",
102
+ "aria-hidden": "true",
103
+ children: [
104
+ /* @__PURE__ */ p("rect", {
105
+ x: "6",
106
+ y: "6",
107
+ width: "12",
108
+ height: "12",
109
+ rx: "2"
110
+ }),
111
+ /* @__PURE__ */ p("rect", {
112
+ x: "10",
113
+ y: "10",
114
+ width: "4",
115
+ height: "4",
116
+ rx: "1"
117
+ }),
118
+ /* @__PURE__ */ p("path", { d: "M12 2v4" }),
119
+ /* @__PURE__ */ p("path", { d: "M12 18v4" }),
120
+ /* @__PURE__ */ p("path", { d: "M2 12h4" }),
121
+ /* @__PURE__ */ p("path", { d: "M18 12h4" })
122
+ ]
123
+ }), e[0] = t) : t = e[0], t;
124
+ }
125
+ var L = {
126
+ task: /* @__PURE__ */ p(P, {}),
127
+ agent: /* @__PURE__ */ p(F, {}),
128
+ system: /* @__PURE__ */ p(I, {})
129
+ }, R = ":where([data-slot='notification-item'], [data-slot='mark-all-read'], [data-slot='clear-all']):not([disabled])";
130
+ function z({ items: u = [], open: P, maxBadgeCount: F = 99, onMarkAllRead: I, onClearAll: z, classNames: B, className: ie, ref: V, ...H }) {
131
+ let [U, W] = h(P, !1), G = n("notificationCenter"), K = r("NotificationCenter"), q = K.classNames ? {
132
+ ...K.classNames,
133
+ ...B
134
+ } : B, J = te(), Y = f(null), X = f(null), Z = a({
135
+ open: U,
136
+ setOpen: W,
137
+ triggerRef: Y,
138
+ panelRef: X,
139
+ animated: !0
140
+ });
141
+ c({
142
+ menuRef: X,
143
+ active: U,
144
+ selector: R
145
+ });
146
+ let ae = s({
147
+ menuRef: X,
148
+ onClose: () => W(!1),
149
+ selector: R
150
+ }), Q = o({
151
+ enabled: U,
152
+ autoFocus: !0,
153
+ returnFocus: !0
154
+ }), oe = d((e) => {
155
+ X.current = e, Q(e);
156
+ }, [Q]), $ = u.reduce((e, t) => t.read ? e : e + 1, 0), se = $ > 0 ? t(G.triggerLabelUnread, { count: $ }) : G.triggerLabel, ce = $ > F ? `${F}+` : String($);
157
+ return /* @__PURE__ */ m("span", {
158
+ ref: V,
159
+ "data-slot": "notification-center",
160
+ ...H,
161
+ className: e([g, q?.root]),
162
+ children: [/* @__PURE__ */ m("button", {
163
+ ref: Y,
164
+ type: "button",
165
+ "data-slot": "trigger",
166
+ style: Z.triggerStyle,
167
+ "aria-haspopup": "dialog",
168
+ "aria-expanded": U,
169
+ "aria-controls": J,
170
+ "aria-label": se,
171
+ onPointerDown: Z.onTriggerPointerDown,
172
+ onClick: Z.onTriggerClick,
173
+ className: e([_, q?.trigger]),
174
+ children: [/* @__PURE__ */ p(l, {
175
+ size: "md",
176
+ children: /* @__PURE__ */ p(N, {})
177
+ }), $ > 0 && /* @__PURE__ */ p("span", {
178
+ "data-slot": "badge",
179
+ className: e([v, q?.badge]),
180
+ children: /* @__PURE__ */ p(ee, {
181
+ color: "danger",
182
+ size: "sm",
183
+ children: ce
184
+ })
185
+ })]
186
+ }), /* @__PURE__ */ m(i, {
187
+ ref: oe,
188
+ behavior: Z,
189
+ placement: "bottom-end",
190
+ id: J,
191
+ role: "dialog",
192
+ "aria-label": G.panelTitle,
193
+ visualClass: y,
194
+ className: e(q?.panel, ie),
195
+ onKeyDown: ae,
196
+ children: [
197
+ /* @__PURE__ */ p("div", {
198
+ "data-slot": "header",
199
+ className: e([b, q?.header]),
200
+ children: /* @__PURE__ */ p("h2", {
201
+ "data-slot": "title",
202
+ className: e([x, q?.title]),
203
+ children: G.panelTitle
204
+ })
205
+ }),
206
+ u.length > 0 ? /* @__PURE__ */ p("ul", {
207
+ "data-slot": "list",
208
+ className: e([S, q?.list]),
209
+ children: u.map((t) => {
210
+ let n = t.severity ?? "info", r = t.kind ?? "system", i = t.read !== !0;
211
+ return /* @__PURE__ */ m("li", {
212
+ "data-slot": "notification-item",
213
+ "data-severity": n,
214
+ "data-kind": r,
215
+ className: e([
216
+ C,
217
+ i && w,
218
+ q?.item
219
+ ]),
220
+ children: [
221
+ i && /* @__PURE__ */ p("span", {
222
+ "data-slot": "unread-dot",
223
+ role: "img",
224
+ "aria-label": G.unreadLabel,
225
+ className: e([T, q?.unreadDot])
226
+ }),
227
+ /* @__PURE__ */ p("span", {
228
+ "data-slot": "item-icon",
229
+ className: e([
230
+ ne,
231
+ re[n],
232
+ q?.itemIcon
233
+ ]),
234
+ children: /* @__PURE__ */ p(l, {
235
+ size: "sm",
236
+ children: L[r]
237
+ })
238
+ }),
239
+ /* @__PURE__ */ m("span", {
240
+ "data-slot": "item-body",
241
+ className: e([E, q?.itemBody]),
242
+ children: [
243
+ /* @__PURE__ */ p("span", {
244
+ "data-slot": "item-title",
245
+ className: e([D, q?.itemTitle]),
246
+ children: t.title
247
+ }),
248
+ t.description !== void 0 && /* @__PURE__ */ p("span", {
249
+ "data-slot": "item-description",
250
+ className: e([O, q?.itemDescription]),
251
+ children: t.description
252
+ }),
253
+ t.timestamp !== void 0 && /* @__PURE__ */ p("span", {
254
+ "data-slot": "item-timestamp",
255
+ className: e([k, q?.itemTimestamp]),
256
+ children: t.timestamp
257
+ })
258
+ ]
259
+ })
260
+ ]
261
+ }, t.key);
262
+ })
263
+ }) : /* @__PURE__ */ p("div", {
264
+ "data-slot": "empty",
265
+ className: e([M, q?.empty]),
266
+ children: G.empty
267
+ }),
268
+ /* @__PURE__ */ m("div", {
269
+ "data-slot": "actions",
270
+ className: e([A, q?.actions]),
271
+ children: [/* @__PURE__ */ p("button", {
272
+ type: "button",
273
+ "data-slot": "mark-all-read",
274
+ tabIndex: -1,
275
+ disabled: $ === 0,
276
+ onClick: I,
277
+ className: e([j, q?.markAllRead]),
278
+ children: G.markAllRead
279
+ }), /* @__PURE__ */ p("button", {
280
+ type: "button",
281
+ "data-slot": "clear-all",
282
+ tabIndex: -1,
283
+ disabled: u.length === 0,
284
+ onClick: z,
285
+ className: e([j, q?.clearAll]),
286
+ children: G.clearAll
287
+ })]
288
+ })
289
+ ]
290
+ })]
291
+ });
292
+ }
293
+ //#endregion
294
+ export { z as default };
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ import e from "./NotificationCenter.js";
3
+ export { e as NotificationCenter };
@@ -25,89 +25,97 @@ function y(t) {
25
25
  className: e([f, a])
26
26
  }), n[0] = a, n[1] = s), s;
27
27
  }
28
- function b({ value: i, icon: f, status: p, statusLabel: b, closable: x = !1, closeLabel: S, onClose: C, disabled: w = !1, className: T, children: E }) {
29
- let { value: D, setValue: O, variant: k, classNames: A } = n(), j = t("tabs"), M = D === i, N = r[k], P = (e) => {
28
+ function b({ value: i, icon: f, status: p, statusLabel: b, closable: x = !1, closeLabel: S, onClose: C, disabled: w = !1, as: T, className: E, children: D, onClick: O, ...k }) {
29
+ let { value: A, setValue: j, variant: M, classNames: N } = n(), P = t("tabs"), F = A === i, I = r[M], L = T ?? "button", R = T === void 0 || T === "button", z = (e) => {
30
30
  e.stopPropagation(), C?.(e);
31
- }, F = () => {
32
- w || O(i);
33
- }, I = /* @__PURE__ */ s(a, { children: [
31
+ }, B = () => {
32
+ w || j(i);
33
+ }, V = (e) => {
34
+ O?.(e), B();
35
+ }, H = /* @__PURE__ */ s(a, { children: [
34
36
  f !== void 0 && /* @__PURE__ */ o("span", {
35
37
  "data-slot": "icon",
36
38
  "aria-hidden": "true",
37
39
  className: e(d),
38
40
  children: f
39
41
  }),
40
- E,
42
+ D,
41
43
  p !== void 0 && /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(y, { status: p }), /* @__PURE__ */ o("span", {
42
44
  className: e(m),
43
- children: b ?? j[v[p]]
45
+ children: b ?? P[v[p]]
44
46
  })] })
45
47
  ] });
46
- return x ? /* @__PURE__ */ s("div", {
48
+ if (!x) return /* @__PURE__ */ o(L, {
49
+ ...R ? {
50
+ type: "button",
51
+ disabled: w
52
+ } : { "aria-disabled": w || void 0 },
47
53
  "data-slot": "tab",
48
- "data-variant": k,
54
+ "data-variant": M,
49
55
  role: "tab",
50
- "aria-selected": M,
51
- "aria-disabled": w || void 0,
56
+ "aria-selected": F,
52
57
  "aria-controls": `tabpanel-${i}`,
53
- tabIndex: M ? 0 : -1,
58
+ tabIndex: F ? 0 : -1,
54
59
  "data-haze-tab-value": i,
55
- onKeyDown: (e) => {
56
- if (!w) {
57
- if (e.key === "Enter" || e.key === " ") {
58
- e.preventDefault(), O(i);
59
- return;
60
- }
61
- e.key === "Delete" && (e.preventDefault(), C?.(e));
60
+ ...k,
61
+ onClick: V,
62
+ className: e([
63
+ c,
64
+ I.idle,
65
+ F && l,
66
+ F && I.active,
67
+ w && u,
68
+ E,
69
+ N?.tab
70
+ ]),
71
+ children: H
72
+ });
73
+ let U = (e) => {
74
+ if (!w) {
75
+ if (e.key === "Enter" || e.key === " ") {
76
+ e.preventDefault(), j(i);
77
+ return;
62
78
  }
63
- },
64
- onClick: F,
79
+ e.key === "Delete" && (e.preventDefault(), C?.(e));
80
+ }
81
+ };
82
+ return /* @__PURE__ */ s("div", {
83
+ "data-slot": "tab",
84
+ "data-variant": M,
85
+ role: "tab",
86
+ "aria-selected": F,
87
+ "aria-disabled": w || void 0,
88
+ "aria-controls": `tabpanel-${i}`,
89
+ tabIndex: F ? 0 : -1,
90
+ "data-haze-tab-value": i,
91
+ ...k,
92
+ onKeyDown: U,
93
+ onClick: V,
65
94
  className: e([
66
95
  c,
67
- N.idle,
68
- M && l,
69
- M && N.active,
96
+ I.idle,
97
+ F && l,
98
+ F && I.active,
70
99
  w && u,
71
100
  _,
72
- T,
73
- A?.tab
101
+ E,
102
+ N?.tab
74
103
  ]),
75
104
  children: [/* @__PURE__ */ o("span", {
76
105
  "data-slot": "tab-label",
77
106
  className: e(h),
78
- children: I
107
+ children: H
79
108
  }), /* @__PURE__ */ o("span", {
80
109
  role: "button",
81
110
  "data-slot": "tab-close",
82
- "aria-label": S ?? j.close,
83
- onClick: P,
111
+ "aria-label": S ?? P.close,
112
+ onClick: z,
84
113
  className: e(g),
85
114
  children: /* @__PURE__ */ o("span", {
86
115
  "aria-hidden": "true",
87
116
  children: "×"
88
117
  })
89
118
  })]
90
- }) : /* @__PURE__ */ o("button", {
91
- type: "button",
92
- "data-slot": "tab",
93
- "data-variant": k,
94
- role: "tab",
95
- "aria-selected": M,
96
- "aria-controls": `tabpanel-${i}`,
97
- tabIndex: M ? 0 : -1,
98
- "data-haze-tab-value": i,
99
- disabled: w,
100
- onClick: F,
101
- className: e([
102
- c,
103
- N.idle,
104
- M && l,
105
- M && N.active,
106
- w && u,
107
- T,
108
- A?.tab
109
- ]),
110
- children: I
111
119
  });
112
120
  }
113
121
  //#endregion
@@ -0,0 +1,96 @@
1
+
2
+ "use client";
3
+ import { classnames as e } from "../../utils/classnames.js";
4
+ import t from "../Checkbox/CheckboxCore.js";
5
+ /* empty css */
6
+ import { c as n } from "react/compiler-runtime";
7
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
8
+ import { useControl as a } from "react-use-control";
9
+ //#region src/lib/components/TaskList/TaskList.tsx
10
+ var o = "haze-TaskList__list", s = "haze-TaskList__item", c = "haze-TaskList__row", l = "haze-TaskList__rowLabel", u = "haze-TaskList__indicatorSlot", d = "haze-TaskList__body", f = "haze-TaskList__titleStyle", p = "haze-TaskList__titleDone", m = "haze-TaskList__descriptionStyle", h = "haze-TaskList__actionsStyle";
11
+ function g(o) {
12
+ let g = n(38), _, v, y, b, x, S, C, w;
13
+ g[0] === o ? (_ = g[1], v = g[2], y = g[3], b = g[4], x = g[5], S = g[6], C = g[7], w = g[8]) : ({checked: v, onCheckedChange: S, title: w, description: b, indicator: x, actions: _, className: y, ...C} = o, g[0] = o, g[1] = _, g[2] = v, g[3] = y, g[4] = b, g[5] = x, g[6] = S, g[7] = C, g[8] = w);
14
+ let [T, E] = a(v, !1), D;
15
+ g[9] !== S || g[10] !== E ? (D = (e) => {
16
+ E(e), S?.(e);
17
+ }, g[9] = S, g[10] = E, g[11] = D) : D = g[11];
18
+ let O = D, k;
19
+ g[12] === Symbol.for("react.memo_cache_sentinel") ? (k = [d], g[12] = k) : k = g[12];
20
+ let A = T && p, j;
21
+ g[13] === A ? j = g[14] : (j = [f, A], g[13] = A, g[14] = j);
22
+ let M;
23
+ g[15] !== j || g[16] !== w ? (M = /* @__PURE__ */ r("div", {
24
+ "data-slot": "task-title",
25
+ className: e(j),
26
+ children: w
27
+ }), g[15] = j, g[16] = w, g[17] = M) : M = g[17];
28
+ let N;
29
+ g[18] === b ? N = g[19] : (N = b && /* @__PURE__ */ r("div", {
30
+ "data-slot": "task-description",
31
+ className: e([m]),
32
+ children: b
33
+ }), g[18] = b, g[19] = N);
34
+ let P;
35
+ g[20] !== M || g[21] !== N ? (P = /* @__PURE__ */ i("div", {
36
+ "data-slot": "task-body",
37
+ className: e(k),
38
+ children: [M, N]
39
+ }), g[20] = M, g[21] = N, g[22] = P) : P = g[22];
40
+ let F = P, I;
41
+ g[23] === y ? I = g[24] : (I = [s, y], g[23] = y, g[24] = I);
42
+ let L;
43
+ g[25] !== F || g[26] !== T || g[27] !== O || g[28] !== x ? (L = x ? /* @__PURE__ */ i("div", {
44
+ "data-slot": "task-row",
45
+ className: e([c]),
46
+ children: [/* @__PURE__ */ r("span", {
47
+ "data-slot": "task-indicator",
48
+ className: e([u]),
49
+ children: x
50
+ }), F]
51
+ }) : /* @__PURE__ */ i("label", {
52
+ "data-slot": "task-row",
53
+ className: e([c, l]),
54
+ children: [/* @__PURE__ */ r(t, {
55
+ checked: T,
56
+ onChange: O
57
+ }), F]
58
+ }), g[25] = F, g[26] = T, g[27] = O, g[28] = x, g[29] = L) : L = g[29];
59
+ let R;
60
+ g[30] === _ ? R = g[31] : (R = _ && /* @__PURE__ */ r("div", {
61
+ "data-slot": "task-actions",
62
+ className: e([h]),
63
+ children: _
64
+ }), g[30] = _, g[31] = R);
65
+ let z;
66
+ return g[32] !== T || g[33] !== C || g[34] !== R || g[35] !== I || g[36] !== L ? (z = /* @__PURE__ */ i("li", {
67
+ "data-slot": "task-item",
68
+ "data-checked": T,
69
+ ...C,
70
+ className: e(I),
71
+ children: [L, R]
72
+ }), g[32] = T, g[33] = C, g[34] = R, g[35] = I, g[36] = L, g[37] = z) : z = g[37], z;
73
+ }
74
+ function _(t) {
75
+ let i = n(15), a, s, c, l;
76
+ i[0] === t ? (a = i[1], s = i[2], c = i[3], l = i[4]) : ({items: c, children: a, className: s, ...l} = t, i[0] = t, i[1] = a, i[2] = s, i[3] = c, i[4] = l);
77
+ let u = c !== void 0;
78
+ u && a != null && console.error("[haze-ui] TaskList: `items` and compound `children` are mutually exclusive — rendering `items` and ignoring `children`.");
79
+ let d;
80
+ i[5] === s ? d = i[6] : (d = [o, s], i[5] = s, i[6] = d);
81
+ let f;
82
+ i[7] !== a || i[8] !== c || i[9] !== u ? (f = u ? c.map(v) : a, i[7] = a, i[8] = c, i[9] = u, i[10] = f) : f = i[10];
83
+ let p;
84
+ return i[11] !== l || i[12] !== d || i[13] !== f ? (p = /* @__PURE__ */ r("ul", {
85
+ "data-slot": "task-list",
86
+ ...l,
87
+ className: e(d),
88
+ children: f
89
+ }), i[11] = l, i[12] = d, i[13] = f, i[14] = p) : p = i[14], p;
90
+ }
91
+ function v(e) {
92
+ let { key: t, ...n } = e;
93
+ return /* @__PURE__ */ r(g, { ...n }, t);
94
+ }
95
+ //#endregion
96
+ export { g as TaskListItem, _ as default };
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ import e, { TaskListItem as t } from "./TaskList.js";
3
+ export { e as TaskList, t as TaskListItem };
@@ -6,18 +6,18 @@ import { useControl as r } from "react-use-control";
6
6
  //#region src/lib/components/Toggle/Toggle.tsx
7
7
  function i(i) {
8
8
  let a = t(17), o, s, c, l, u, d, f;
9
- a[0] === i ? (o = a[1], s = a[2], c = a[3], l = a[4], u = a[5], d = a[6], f = a[7]) : ({pressed: c, size: d, square: f, className: o, onClick: s, ref: l, ...u} = i, a[0] = i, a[1] = o, a[2] = s, a[3] = c, a[4] = l, a[5] = u, a[6] = d, a[7] = f);
10
- let [p, m] = r(c, !1), h;
11
- return a[8] !== o || a[9] !== s || a[10] !== p || a[11] !== l || a[12] !== u || a[13] !== m || a[14] !== d || a[15] !== f ? (h = /* @__PURE__ */ n(e, {
12
- ref: l,
9
+ a[0] === i ? (o = a[1], s = a[2], c = a[3], l = a[4], u = a[5], d = a[6], f = a[7]) : ({pressed: l, size: d, square: f, as: o, className: s, onClick: c, ...u} = i, a[0] = i, a[1] = o, a[2] = s, a[3] = c, a[4] = l, a[5] = u, a[6] = d, a[7] = f);
10
+ let [p, m] = r(l, !1), h = u, g;
11
+ return a[8] !== o || a[9] !== s || a[10] !== c || a[11] !== p || a[12] !== m || a[13] !== d || a[14] !== f || a[15] !== h ? (g = /* @__PURE__ */ n(e, {
12
+ ...h,
13
+ as: o,
13
14
  pressed: p,
14
15
  onPressedChange: m,
15
- onNativeClick: s,
16
+ onNativeClick: c,
16
17
  size: d,
17
18
  square: f,
18
- className: o,
19
- ...u
20
- }), a[8] = o, a[9] = s, a[10] = p, a[11] = l, a[12] = u, a[13] = m, a[14] = d, a[15] = f, a[16] = h) : h = a[16], h;
19
+ className: s
20
+ }), a[8] = o, a[9] = s, a[10] = c, a[11] = p, a[12] = m, a[13] = d, a[14] = f, a[15] = h, a[16] = g) : g = a[16], g;
21
21
  }
22
22
  //#endregion
23
23
  export { i as default };
@@ -9,11 +9,10 @@ var a = {
9
9
  rest: "haze-ToggleCore__rest",
10
10
  pressed: "haze-ToggleCore__pressed"
11
11
  };
12
- function o({ pressed: o, onPressedChange: s, onNativeClick: c, size: l = "md", square: u = !1, className: d, ref: f, ...p }) {
12
+ function o({ pressed: o, onPressedChange: s, onNativeClick: c, size: l = "md", square: u = !1, as: d, className: f, ...p }) {
13
13
  let m = u ? r[l] : n[l];
14
- return /* @__PURE__ */ i("button", {
15
- ref: f,
16
- type: "button",
14
+ return /* @__PURE__ */ i(d ?? "button", {
15
+ ...d === void 0 || d === "button" ? { type: "button" } : {},
17
16
  "aria-pressed": o,
18
17
  "data-slot": "toggle",
19
18
  onClick: (e) => {
@@ -24,7 +23,7 @@ function o({ pressed: o, onPressedChange: s, onNativeClick: c, size: l = "md", s
24
23
  t,
25
24
  a[o ? "pressed" : "rest"],
26
25
  m,
27
- d
26
+ f
28
27
  ])
29
28
  });
30
29
  }
@@ -6,20 +6,20 @@ import { base as t, sizes as n, squareSizes as r, variants as i } from "../Butto
6
6
  import { jsx as a } from "react/jsx-runtime";
7
7
  //#region src/lib/components/Toolbar/ToolbarButton.tsx
8
8
  var o = "haze-ToolbarButton__toolbarItem";
9
- function s({ variant: s = "ghost", size: c = "md", square: l = !1, className: u, ...d }) {
10
- let f = l ? r[c] : n[c];
11
- return /* @__PURE__ */ a("button", {
12
- type: "button",
9
+ function s({ variant: s = "ghost", size: c = "md", square: l = !1, as: u, className: d, ...f }) {
10
+ let p = l ? r[c] : n[c];
11
+ return /* @__PURE__ */ a(u ?? "button", {
12
+ ...u === void 0 || u === "button" ? { type: "button" } : {},
13
13
  "data-slot": "toolbar-button",
14
14
  "data-haze-toolbar-item": "",
15
15
  tabIndex: -1,
16
- ...d,
16
+ ...f,
17
17
  className: e([
18
18
  t,
19
19
  i[s],
20
- f,
20
+ p,
21
21
  o,
22
- u
22
+ d
23
23
  ])
24
24
  });
25
25
  }
@@ -7,24 +7,24 @@ import { jsx as a } from "react/jsx-runtime";
7
7
  import { useControl as o } from "react-use-control";
8
8
  //#region src/lib/components/Toolbar/ToolbarToggle.tsx
9
9
  var s = "haze-ToolbarToggle__toolbarItem";
10
- function c({ pressed: c, variant: l = "ghost", size: u = "md", square: d = !1, className: f, onClick: p, ...m }) {
11
- let [h, g] = o(c, !1), _ = d ? r[u] : n[u];
12
- return /* @__PURE__ */ a("button", {
13
- type: "button",
10
+ function c({ pressed: c, variant: l = "ghost", size: u = "md", square: d = !1, as: f, className: p, onClick: m, ...h }) {
11
+ let [g, _] = o(c, !1), v = d ? r[u] : n[u];
12
+ return /* @__PURE__ */ a(f ?? "button", {
13
+ ...f === void 0 || f === "button" ? { type: "button" } : {},
14
14
  "data-slot": "toolbar-toggle",
15
15
  "data-haze-toolbar-item": "",
16
16
  tabIndex: -1,
17
- "aria-pressed": h,
17
+ "aria-pressed": g,
18
18
  onClick: (e) => {
19
- g(!h), p?.(e);
19
+ _(!g), m?.(e);
20
20
  },
21
- ...m,
21
+ ...h,
22
22
  className: e([
23
23
  t,
24
24
  i[l],
25
- _,
25
+ v,
26
26
  s,
27
- f
27
+ p
28
28
  ])
29
29
  });
30
30
  }