haze-ui 1.14.0 → 1.16.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 (33) hide show
  1. package/README.md +89 -0
  2. package/dist/components/Button/Button.js +11 -25
  3. package/dist/components/Button/ButtonLink.js +23 -0
  4. package/dist/components/Button/styles.js +18 -0
  5. package/dist/components/Carousel/Carousel.js +5 -5
  6. package/dist/components/ChatInput/ChatInput.js +3 -3
  7. package/dist/components/Collapsible/Collapsible.js +6 -6
  8. package/dist/components/Combobox/Combobox.js +4 -4
  9. package/dist/components/Command/Command.js +8 -8
  10. package/dist/components/ContextMenu/ContextMenu.js +4 -4
  11. package/dist/components/Dialog/Dialog.js +4 -4
  12. package/dist/components/Disclosure/Disclosure.js +4 -4
  13. package/dist/components/Drawer/Drawer.js +4 -4
  14. package/dist/components/DropdownMenu/DropdownMenu.js +3 -3
  15. package/dist/components/InlineEdit/InlineEdit.js +4 -4
  16. package/dist/components/LogViewer/LogViewer.js +3 -3
  17. package/dist/components/Menu/Menu.js +3 -3
  18. package/dist/components/Popover/Popover.js +3 -3
  19. package/dist/components/Stepper/Stepper.js +4 -4
  20. package/dist/components/Tooltip/Tooltip.js +5 -5
  21. package/dist/components/Transfer/Transfer.js +3 -3
  22. package/dist/components/Tree/Tree.js +3 -3
  23. package/dist/css/button.css +2 -1
  24. package/dist/form/FormItem.js +33 -22
  25. package/dist/haze-ui.css +2 -1
  26. package/dist/index.js +139 -138
  27. package/dist/types/components/Button/ButtonLink.d.ts +31 -0
  28. package/dist/types/components/Button/index.d.ts +2 -0
  29. package/dist/types/components/Button/styles.d.ts +29 -0
  30. package/dist/types/form/FormItem.d.ts +70 -4
  31. package/dist/types/form/index.d.ts +1 -1
  32. package/dist/types/index.d.ts +3 -3
  33. package/package.json +1 -1
package/README.md CHANGED
@@ -49,6 +49,42 @@ Component CSS files are kebab-case versions of the component name
49
49
  cover that component's rules — tokens (themes, spacing, typography)
50
50
  always come from `haze-ui/css/tokens.css`.
51
51
 
52
+ ## ButtonLink: a real anchor with the Button skin
53
+
54
+ Navigation that must look like a button should still *be* a link —
55
+ rendering `as={Button}` drops `href` onto a `<button>` (an invalid
56
+ attribute: no ⌘/middle-click new tab, nothing for crawlers or no-JS).
57
+ `ButtonLink` renders a native `<a>` wearing Button's full appearance —
58
+ same `variant`/`size`/`square` props, same hover/active/focus and
59
+ disabled visual states:
60
+
61
+ ```jsx
62
+ import { ButtonLink } from 'haze-ui';
63
+
64
+ <ButtonLink href='/page/2' variant='outline'>Next page</ButtonLink>
65
+
66
+ // anchors have no `disabled` attribute — report the state with
67
+ // aria-disabled (+ tabIndex={-1} to leave the focus order); ButtonLink
68
+ // styles it exactly like Button's :disabled
69
+ <ButtonLink href='/prev' aria-disabled tabIndex={-1}>← Previous</ButtonLink>
70
+ ```
71
+
72
+ Everything else extends the native `<a>` attributes and is spread onto
73
+ the anchor (`target`, `rel`, `download`, `aria-*`, …), with the ref
74
+ forwarded — the same composition shape `NavLink` uses, so routers can
75
+ swap their own Link element through an `as` prop:
76
+
77
+ ```jsx
78
+ // with a typed router Link (href + SPA onClick injected by the router):
79
+ <TypedLink to='/articles' search={{offset: 20}} as={ButtonLink}>
80
+ Next page
81
+ </TypedLink>
82
+ ```
83
+
84
+ Both components share one skin (a styles module), so a theme tweak to
85
+ `Button` re-skins `ButtonLink` in lockstep. CSS: `haze-ui/css/button.css`
86
+ covers both.
87
+
52
88
  ## react-f0rm Integration
53
89
 
54
90
  react-f0rm owns form field state, and its headless `useField` hook is
@@ -154,6 +190,59 @@ render-prop are mutually exclusive.
154
190
  - With a typed form, `validate`'s value argument is the field's actual
155
191
  type (`PathValueOf<TValues, P>`), not `any`.
156
192
 
193
+ #### `input`: declarative binding for haze-ui cores (typed prop forwarding)
194
+
195
+ The ergonomic form for the controlled cores — pass the component and the
196
+ rest of the JSX goes straight to it, type-checked against its own props:
197
+
198
+ ```jsx
199
+ <FormItem
200
+ form={form}
201
+ name="email"
202
+ label="Email"
203
+ input={InputCore}
204
+ placeholder="you@x.dev"
205
+ mode="onBlur"
206
+ validate={(v) => (v.includes('@') ? undefined : 'must be an email')}
207
+ />
208
+
209
+ // JSX children forward too — a SelectCore's options:
210
+ <FormItem form={form} name="role" label="Role" input={SelectCore}>
211
+ <option value="admin">Admin</option>
212
+ <option value="viewer">Viewer</option>
213
+ </FormItem>
214
+
215
+ // checkbox-style controls keep the valueToProps adapter:
216
+ <FormItem
217
+ form={form}
218
+ name="subscribed"
219
+ label="Subscribe"
220
+ input={CheckboxCore}
221
+ valueToProps={(checked) => ({ checked })}
222
+ />
223
+ ```
224
+
225
+ `input` wires the same id/aria/`onBlur`/`onChange`/value contract as `as`
226
+ — every haze core (`InputCore`, `TextareaCore`, `SelectCore`,
227
+ `TagInputCore`, `CheckboxCore`, `SwitchCore`, …) speaks the plain
228
+ `{value, onChange}` pair, so the default adapters need nothing
229
+ (`TagInputCore`'s `onChange` already emits the next `string[]`; a
230
+ checkbox-style core pairs with `valueToProps`). The differences from
231
+ `as`:
232
+
233
+ - Forwarded props are **type-checked against the core's own props** —
234
+ `input={InputCore} size="xl"` is a compile error, while `asProps` is an
235
+ untyped bag.
236
+ - JSX **children** forward to the core (a `SelectCore`'s `<option>`s);
237
+ the render-prop children and `input` are mutually exclusive (a
238
+ render-prop next to `input` throws — it's a migration leftover).
239
+ - The wiring (`id`, `aria-invalid`, `aria-describedby`, `onBlur`,
240
+ `onChange`, `value`/`checked`) and FormItem's own prop names are
241
+ **reserved**: they are excluded from the forwarded type and always win
242
+ at runtime. A control prop that collides with one (e.g. CheckboxCore's
243
+ own `label`) is unreachable through `input` — use the render-prop or
244
+ `as`/`asProps` for it.
245
+
157
246
  #### `mode`: per-field validation timing (react-f0rm ≥ 0.6)
158
247
 
159
248
  Pass `mode` to validate one field on its own schedule instead of the
@@ -1,33 +1,19 @@
1
-
2
1
  import { classnames as e } from "../../utils/classnames.js";
3
- /* empty css */
4
- import { jsx as t } from "react/jsx-runtime";
2
+ import { base as t, sizes as n, squareSizes as r, variants as i } from "./styles.js";
3
+ import { jsx as a } from "react/jsx-runtime";
5
4
  //#region src/lib/components/Button/Button.tsx
6
- var n = "haze-Button__base", r = {
7
- solid: "haze-Button__solid",
8
- outline: "haze-Button__outline",
9
- ghost: "haze-Button__ghost"
10
- }, i = "haze-Button__sizeSm", a = "haze-Button__sizeMd", o = "haze-Button__sizeLg", s = "haze-Button__squareSm", c = "haze-Button__squareMd", l = "haze-Button__squareLg", u = {
11
- sm: i,
12
- md: a,
13
- lg: o
14
- }, d = {
15
- sm: s,
16
- md: c,
17
- lg: l
18
- };
19
- function f({ variant: i = "solid", size: a = "md", square: o = !1, className: s, ...c }) {
20
- let l = o ? d[a] : u[a];
21
- return /* @__PURE__ */ t("button", {
5
+ function o({ variant: o = "solid", size: s = "md", square: c = !1, className: l, ...u }) {
6
+ let d = c ? r[s] : n[s];
7
+ return /* @__PURE__ */ a("button", {
22
8
  type: "button",
23
- ...c,
9
+ ...u,
24
10
  className: e([
25
- n,
26
- r[i],
27
- l,
28
- s
11
+ t,
12
+ i[o],
13
+ d,
14
+ l
29
15
  ])
30
16
  });
31
17
  }
32
18
  //#endregion
33
- export { f as default };
19
+ export { o as default };
@@ -0,0 +1,23 @@
1
+
2
+ import { classnames as e } from "../../utils/classnames.js";
3
+ import { base as t, sizes as n, squareSizes as r, variants as i } from "./styles.js";
4
+ /* empty css */
5
+ import { jsx as a } from "react/jsx-runtime";
6
+ import { forwardRef as o } from "react";
7
+ //#region src/lib/components/Button/ButtonLink.tsx
8
+ var s = "haze-ButtonLink__link", c = o(function({ variant: o = "solid", size: c = "md", square: l = !1, className: u, ...d }, f) {
9
+ let p = l ? r[c] : n[c];
10
+ return /* @__PURE__ */ a("a", {
11
+ ref: f,
12
+ ...d,
13
+ className: e([
14
+ t,
15
+ i[o],
16
+ p,
17
+ s,
18
+ u
19
+ ])
20
+ });
21
+ });
22
+ //#endregion
23
+ export { c as default };
@@ -0,0 +1,18 @@
1
+
2
+ /* empty css */
3
+ //#region src/lib/components/Button/styles.ts
4
+ var e = "haze-styles__base", t = {
5
+ solid: "haze-styles__solid",
6
+ outline: "haze-styles__outline",
7
+ ghost: "haze-styles__ghost"
8
+ }, n = "haze-styles__sizeSm", r = "haze-styles__sizeMd", i = "haze-styles__sizeLg", a = "haze-styles__squareSm", o = "haze-styles__squareMd", s = "haze-styles__squareLg", c = {
9
+ sm: n,
10
+ md: r,
11
+ lg: i
12
+ }, l = {
13
+ sm: a,
14
+ md: o,
15
+ lg: s
16
+ };
17
+ //#endregion
18
+ export { e as base, i as sizeLg, r as sizeMd, n as sizeSm, c as sizes, s as squareLg, o as squareMd, l as squareSizes, a as squareSm, t as variants };
@@ -2,13 +2,13 @@
2
2
  import { classnames as e } from "../../utils/classnames.js";
3
3
  /* empty css */
4
4
  import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
5
- import { useControl as i } from "react-use-control";
6
- import { Children as a, useEffect as o, useRef as s } from "react";
5
+ import { Children as i, useEffect as a, useRef as o } from "react";
6
+ import { useControl as s } from "react-use-control";
7
7
  //#region src/lib/components/Carousel/Carousel.tsx
8
8
  var c = "haze-Carousel__wrapper", l = "haze-Carousel__track", u = "haze-Carousel__navBtn", d = "haze-Carousel__prevBtn", f = "haze-Carousel__nextBtn", p = "haze-Carousel__indicators", m = "haze-Carousel__dot", h = "haze-Carousel__dotActive";
9
9
  function g({ value: g, autoPlay: _ = !1, interval: v = 5e3, className: y, children: b }) {
10
- let [x, S] = i(g, 0), C = s(null), w = a.count(b);
11
- return o(() => {
10
+ let [x, S] = s(g, 0), C = o(null), w = i.count(b);
11
+ return a(() => {
12
12
  let e = C.current;
13
13
  if (!e) return;
14
14
  let t = e.children[x];
@@ -17,7 +17,7 @@ function g({ value: g, autoPlay: _ = !1, interval: v = 5e3, className: y, childr
17
17
  block: "nearest",
18
18
  inline: "start"
19
19
  });
20
- }, [x]), o(() => {
20
+ }, [x]), a(() => {
21
21
  if (!_ || w <= 1) return;
22
22
  let e = setInterval(() => {
23
23
  S((e) => (e + 1) % w);
@@ -2,12 +2,12 @@
2
2
  import { classnames as e } from "../../utils/classnames.js";
3
3
  /* empty css */
4
4
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
5
- import { useControl as r } from "react-use-control";
6
- import { useCallback as i, useRef as a } from "react";
5
+ import { useCallback as r, useRef as i } from "react";
6
+ import { useControl as a } from "react-use-control";
7
7
  //#region src/lib/components/ChatInput/ChatInput.tsx
8
8
  var o = "haze-ChatInput__wrapper", s = "haze-ChatInput__textarea", c = "haze-ChatInput__sendBtn";
9
9
  function l({ value: l, onSend: u, placeholder: d = "Type a message...", disabled: f, maxLength: p, className: m }) {
10
- let [h, g] = r(l, ""), _ = a(null), v = i(() => {
10
+ let [h, g] = a(l, ""), _ = i(null), v = r(() => {
11
11
  let e = h.trim();
12
12
  !e || f || (u?.(e), g(""), _.current && (_.current.style.height = "auto"));
13
13
  }, [
@@ -2,18 +2,18 @@
2
2
  import { classnames as e } from "../../utils/classnames.js";
3
3
  /* empty css */
4
4
  import { jsx as t } from "react/jsx-runtime";
5
- import { useControl as n } from "react-use-control";
6
- import { createContext as r, useContext as i } from "react";
5
+ import { createContext as n, useContext as r } from "react";
6
+ import { useControl as i } from "react-use-control";
7
7
  //#region src/lib/components/Collapsible/Collapsible.tsx
8
- var a = r(void 0);
8
+ var a = n(void 0);
9
9
  function o() {
10
- let e = i(a);
10
+ let e = r(a);
11
11
  if (!e) throw Error("Collapsible sub-components must be used within <Collapsible>");
12
12
  return e;
13
13
  }
14
14
  var s = "haze-Collapsible__base";
15
- function c({ open: r, defaultOpen: i = !1, children: o, className: c }) {
16
- let [l, u] = n(r, i);
15
+ function c({ open: n, defaultOpen: r = !1, children: o, className: c }) {
16
+ let [l, u] = i(n, r);
17
17
  return /* @__PURE__ */ t(a.Provider, {
18
18
  value: {
19
19
  open: l,
@@ -4,18 +4,18 @@ import { FloatingPanel as t, useFloating as n } from "../../utils/floating.js";
4
4
  import r from "./ComboboxOption.js";
5
5
  /* empty css */
6
6
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
- import { useControl as o } from "react-use-control";
8
- import { useEffect as s, useId as c, useRef as l, useState as u } from "react";
7
+ import { useEffect as o, useId as s, useRef as c, useState as l } from "react";
8
+ import { useControl as u } from "react-use-control";
9
9
  //#region src/lib/components/Combobox/Combobox.tsx
10
10
  var d = "haze-Combobox__wrapper", f = "haze-Combobox__input", p = "haze-Combobox__listbox";
11
11
  function m({ value: m, open: h, options: g, placeholder: _, className: v }) {
12
- let [y, b] = o(m, ""), [x, S] = u(""), [C, w] = o(h, !1), [T, E] = u(-1), D = c(), O = l(null), k = l(null), A = n({
12
+ let [y, b] = u(m, ""), [x, S] = l(""), [C, w] = u(h, !1), [T, E] = l(-1), D = s(), O = c(null), k = c(null), A = n({
13
13
  open: C,
14
14
  setOpen: w,
15
15
  triggerRef: O,
16
16
  panelRef: k
17
17
  }), j = g.filter((e) => e.label.toLowerCase().includes(x.toLowerCase()));
18
- s(() => {
18
+ o(() => {
19
19
  E(-1);
20
20
  }, [x]);
21
21
  let M = (e) => {
@@ -3,26 +3,26 @@ import { classnames as e } from "../../utils/classnames.js";
3
3
  import { getEnabledMenuItems as t, useMenuKeyboard as n, useRovingTabindex as r } from "../../utils/menuKeyboard.js";
4
4
  /* empty css */
5
5
  import { jsx as i } from "react/jsx-runtime";
6
- import { useControl as a } from "react-use-control";
7
- import { createContext as o, useContext as s, useId as c, useMemo as l, useRef as u } from "react";
6
+ import { createContext as a, useContext as o, useId as s, useMemo as c, useRef as l } from "react";
7
+ import { useControl as u } from "react-use-control";
8
8
  //#region src/lib/components/Command/Command.tsx
9
- var d = "[role=\"option\"]", f = o(void 0);
9
+ var d = "[role=\"option\"]", f = a(void 0);
10
10
  function p() {
11
- let e = s(f);
11
+ let e = o(f);
12
12
  if (!e) throw Error("Command sub-components must be used within <Command>");
13
13
  return e;
14
14
  }
15
15
  var m = "haze-Command__base";
16
16
  function h({ query: t, children: n, className: r }) {
17
- let [o, s] = a(t, ""), d = u(null), p = u(null), h = c(), g = l(() => ({
18
- query: o,
19
- setQuery: s,
17
+ let [a, o] = u(t, ""), d = l(null), p = l(null), h = s(), g = c(() => ({
18
+ query: a,
19
+ setQuery: o,
20
20
  inputRef: d,
21
21
  listRef: p,
22
22
  listId: h
23
23
  }), [
24
+ a,
24
25
  o,
25
- s,
26
26
  h
27
27
  ]);
28
28
  return /* @__PURE__ */ i(f.Provider, {
@@ -4,19 +4,19 @@ import { useFloating as t } from "../../utils/floating.js";
4
4
  import { ContextMenuProvider as n } from "./ContextMenuContext.js";
5
5
  /* empty css */
6
6
  import { jsx as r } from "react/jsx-runtime";
7
- import { useControl as i } from "react-use-control";
8
- import { useCallback as a, useRef as o, useState as s } from "react";
7
+ import { useCallback as i, useRef as a, useState as o } from "react";
8
+ import { useControl as s } from "react-use-control";
9
9
  //#region src/lib/components/ContextMenu/ContextMenu.tsx
10
10
  var c = "haze-ContextMenu__wrapper";
11
11
  function l({ open: l, onOpenChange: u, children: d, className: f }) {
12
- let [p, m] = i(l, !1), [h, g] = s(0), [_, v] = s(0), y = o(null), b = o(null), x = a((e) => {
12
+ let [p, m] = s(l, !1), [h, g] = o(0), [_, v] = o(0), y = a(null), b = a(null), x = i((e) => {
13
13
  let t = typeof e == "function" ? e(p) : e;
14
14
  m(t), u?.(t);
15
15
  }, [
16
16
  p,
17
17
  m,
18
18
  u
19
- ]), S = a((e, t) => {
19
+ ]), S = i((e, t) => {
20
20
  g(e), v(t);
21
21
  }, []), C = t({
22
22
  open: p,
@@ -2,13 +2,13 @@
2
2
  import { classnames as e } from "../../utils/classnames.js";
3
3
  /* empty css */
4
4
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
5
- import { useControl as r } from "react-use-control";
6
- import { useEffect as i, useId as a, useRef as o } from "react";
5
+ import { useEffect as r, useId as i, useRef as a } from "react";
6
+ import { useControl as o } from "react-use-control";
7
7
  //#region src/lib/components/Dialog/Dialog.tsx
8
8
  var s = "haze-Dialog__overlay", c = "haze-Dialog__titleText";
9
9
  function l({ open: l, onClose: u, title: d, className: f, children: p }) {
10
- let [m, h] = r(l, !1), g = o(null), _ = o(null), v = `haze-dialog-title-${a()}`;
11
- return i(() => {
10
+ let [m, h] = o(l, !1), g = a(null), _ = a(null), v = `haze-dialog-title-${i()}`;
11
+ return r(() => {
12
12
  let e = g.current;
13
13
  e && (m && !e.open ? (_.current = document.activeElement instanceof HTMLElement ? document.activeElement : null, e.showModal()) : !m && e.open && e.close());
14
14
  }, [m]), /* @__PURE__ */ n("dialog", {
@@ -2,13 +2,13 @@
2
2
  import { classnames as e } from "../../utils/classnames.js";
3
3
  /* empty css */
4
4
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
5
- import { useControl as r } from "react-use-control";
6
- import { useEffect as i, useRef as a } from "react";
5
+ import { useEffect as r, useRef as i } from "react";
6
+ import { useControl as a } from "react-use-control";
7
7
  //#region src/lib/components/Disclosure/Disclosure.tsx
8
8
  var o = "haze-Disclosure__details", s = "haze-Disclosure__summaryStyle", c = "haze-Disclosure__content";
9
9
  function l({ open: l, summary: u, className: d, children: f }) {
10
- let [p] = r(l, !1), m = a(null);
11
- return i(() => {
10
+ let [p] = a(l, !1), m = i(null);
11
+ return r(() => {
12
12
  m.current && (m.current.open = p);
13
13
  }, [p]), /* @__PURE__ */ n("details", {
14
14
  ref: m,
@@ -2,8 +2,8 @@
2
2
  import { classnames as e } from "../../utils/classnames.js";
3
3
  /* empty css */
4
4
  import { jsx as t } from "react/jsx-runtime";
5
- import { useControl as n } from "react-use-control";
6
- import { useEffect as r, useRef as i } from "react";
5
+ import { useEffect as n, useRef as r } from "react";
6
+ import { useControl as i } from "react-use-control";
7
7
  //#region src/lib/components/Drawer/Drawer.tsx
8
8
  var a = "haze-Drawer__overlay", o = {
9
9
  left: "haze-Drawer__left",
@@ -12,8 +12,8 @@ var a = "haze-Drawer__overlay", o = {
12
12
  bottom: "haze-Drawer__bottom"
13
13
  };
14
14
  function s({ open: s, placement: c = "right", onClose: l, className: u, children: d }) {
15
- let [f, p] = n(s, !1), m = i(null);
16
- return r(() => {
15
+ let [f, p] = i(s, !1), m = r(null);
16
+ return n(() => {
17
17
  let e = m.current;
18
18
  e && (f && !e.open ? e.showModal() : !f && e.open && e.close());
19
19
  }, [f]), /* @__PURE__ */ t("dialog", {
@@ -4,12 +4,12 @@ import { useFloating as t } from "../../utils/floating.js";
4
4
  import { DropdownMenuProvider as n } from "./DropdownMenuContext.js";
5
5
  /* empty css */
6
6
  import { jsx as r } from "react/jsx-runtime";
7
- import { useControl as i } from "react-use-control";
8
- import { useCallback as a, useId as o, useRef as s } from "react";
7
+ import { useCallback as i, useId as a, useRef as o } from "react";
8
+ import { useControl as s } from "react-use-control";
9
9
  //#region src/lib/components/DropdownMenu/DropdownMenu.tsx
10
10
  var c = "haze-DropdownMenu__wrapper";
11
11
  function l({ open: l, onOpenChange: u, children: d, className: f }) {
12
- let [p, m] = i(l, !1), h = s(null), g = s(null), _ = o(), v = s(null), y = a((e) => {
12
+ let [p, m] = s(l, !1), h = o(null), g = o(null), _ = a(), v = o(null), y = i((e) => {
13
13
  let t = typeof e == "function" ? e(p) : e;
14
14
  m(t), u?.(t);
15
15
  }, [
@@ -2,13 +2,13 @@
2
2
  import { classnames as e } from "../../utils/classnames.js";
3
3
  /* empty css */
4
4
  import { jsx as t } from "react/jsx-runtime";
5
- import { useControl as n } from "react-use-control";
6
- import { useEffect as r, useRef as i, useState as a } from "react";
5
+ import { useEffect as n, useRef as r, useState as i } from "react";
6
+ import { useControl as a } from "react-use-control";
7
7
  //#region src/lib/components/InlineEdit/InlineEdit.tsx
8
8
  var o = "haze-InlineEdit__display", s = "haze-InlineEdit__editing", c = "haze-InlineEdit__placeholderStyle";
9
9
  function l({ value: l, onChange: u, placeholder: d = "Click to edit", disabled: f, className: p }) {
10
- let [m, h] = n(l, ""), [g, _] = a(!1), [v, y] = a(m), b = i(null);
11
- r(() => {
10
+ let [m, h] = a(l, ""), [g, _] = i(!1), [v, y] = i(m), b = r(null);
11
+ n(() => {
12
12
  g && (b.current?.focus(), b.current?.select());
13
13
  }, [g]);
14
14
  let x = () => {
@@ -2,8 +2,8 @@
2
2
  import { classnames as e } from "../../utils/classnames.js";
3
3
  /* empty css */
4
4
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
5
- import { useControl as r } from "react-use-control";
6
- import { useMemo as i } from "react";
5
+ import { useMemo as r } from "react";
6
+ import { useControl as i } from "react-use-control";
7
7
  //#region src/lib/components/LogViewer/LogViewer.tsx
8
8
  var a = "haze-LogViewer__wrapper", o = "haze-LogViewer__toolbar", s = "haze-LogViewer__filterBtn", c = "haze-LogViewer__filterActive", l = "haze-LogViewer__body", u = "haze-LogViewer__entry", d = "haze-LogViewer__timestamp", f = "haze-LogViewer__levelBadge", p = "haze-LogViewer__levelDebug", m = "haze-LogViewer__levelInfo", h = "haze-LogViewer__levelWarn", g = "haze-LogViewer__levelError", _ = "haze-LogViewer__messageStyle", v = {
9
9
  debug: p,
@@ -17,7 +17,7 @@ var a = "haze-LogViewer__wrapper", o = "haze-LogViewer__toolbar", s = "haze-LogV
17
17
  "error"
18
18
  ];
19
19
  function b({ logs: p, filter: m, className: h }) {
20
- let [g, b] = r(m, null), x = i(() => g ? p.filter((e) => e.level === g) : p, [p, g]);
20
+ let [g, b] = i(m, null), x = r(() => g ? p.filter((e) => e.level === g) : p, [p, g]);
21
21
  return /* @__PURE__ */ n("div", {
22
22
  className: e([a, h]),
23
23
  children: [/* @__PURE__ */ n("div", {
@@ -4,12 +4,12 @@ import { FloatingPanel as t, useFloating as n } from "../../utils/floating.js";
4
4
  import { useMenuKeyboard as r, useRovingTabindex as i } from "../../utils/menuKeyboard.js";
5
5
  /* empty css */
6
6
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
- import { useControl as s } from "react-use-control";
8
- import { useRef as c } from "react";
7
+ import { useRef as s } from "react";
8
+ import { useControl as c } from "react-use-control";
9
9
  //#region src/lib/components/Menu/Menu.tsx
10
10
  var l = "haze-Menu__container", u = "haze-Menu__panel";
11
11
  function d({ open: d, trigger: f, className: p, children: m }) {
12
- let [h, g] = s(d, !1), _ = c(null), v = c(null), y = n({
12
+ let [h, g] = c(d, !1), _ = s(null), v = s(null), y = n({
13
13
  open: h,
14
14
  setOpen: g,
15
15
  triggerRef: _,
@@ -2,12 +2,12 @@
2
2
  import { FloatingPanel as e, useFloating as t } from "../../utils/floating.js";
3
3
  /* empty css */
4
4
  import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
- import { useControl as i } from "react-use-control";
6
- import { useId as a, useRef as o } from "react";
5
+ import { useId as i, useRef as a } from "react";
6
+ import { useControl as o } from "react-use-control";
7
7
  //#region src/lib/components/Popover/Popover.tsx
8
8
  var s = "haze-Popover__container", c = "haze-Popover__panelVisuals";
9
9
  function l({ content: l, open: u, className: d, children: f }) {
10
- let [p, m] = i(u, !1), h = a(), g = o(null), _ = o(null), v = t({
10
+ let [p, m] = o(u, !1), h = i(), g = a(null), _ = a(null), v = t({
11
11
  open: p,
12
12
  setOpen: m,
13
13
  triggerRef: g,
@@ -3,12 +3,12 @@ import { classnames as e } from "../../utils/classnames.js";
3
3
  import { StepperProvider as t } from "./StepperContext.js";
4
4
  /* empty css */
5
5
  import { jsx as n } from "react/jsx-runtime";
6
- import { useControl as r } from "react-use-control";
7
- import { Children as i, cloneElement as a, isValidElement as o } from "react";
6
+ import { Children as r, cloneElement as i, isValidElement as a } from "react";
7
+ import { useControl as o } from "react-use-control";
8
8
  //#region src/lib/components/Stepper/Stepper.tsx
9
9
  var s = "haze-Stepper__stepper";
10
10
  function c({ activeStep: c, children: l, className: u }) {
11
- let [d, f] = r(c, 0), p = i.count(l);
11
+ let [d, f] = o(c, 0), p = r.count(l);
12
12
  return /* @__PURE__ */ n(t, {
13
13
  value: {
14
14
  activeStep: d,
@@ -18,7 +18,7 @@ function c({ activeStep: c, children: l, className: u }) {
18
18
  children: n("div", {
19
19
  role: "list",
20
20
  className: e([s, u]),
21
- children: i.map(l, (e, t) => o(e) ? a(e, { index: t }) : e)
21
+ children: r.map(l, (e, t) => a(e) ? i(e, { index: t }) : e)
22
22
  })
23
23
  });
24
24
  }
@@ -3,8 +3,8 @@ import { classnames as e } from "../../utils/classnames.js";
3
3
  import { floatingPlacementClasses as t, useFloating as n, useFloatingPosition as r } from "../../utils/floating.js";
4
4
  /* empty css */
5
5
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
- import { useControl as o } from "react-use-control";
7
- import { useEffect as s, useId as c, useRef as l } from "react";
6
+ import { useEffect as o, useId as s, useRef as c } from "react";
7
+ import { useControl as l } from "react-use-control";
8
8
  //#region src/lib/components/Tooltip/Tooltip.tsx
9
9
  var u = "haze-Tooltip__wrapper", d = "haze-Tooltip__bubble", f = {
10
10
  top: "top",
@@ -13,7 +13,7 @@ var u = "haze-Tooltip__wrapper", d = "haze-Tooltip__bubble", f = {
13
13
  right: "right"
14
14
  };
15
15
  function p({ content: p, position: m = "top", delay: h = 150, open: g, className: _, children: v }) {
16
- let [y, b] = o(g, !1), x = c(), S = l(null), C = l(null), w = f[m], T = n({
16
+ let [y, b] = l(g, !1), x = s(), S = c(null), C = c(null), w = f[m], T = n({
17
17
  open: y,
18
18
  setOpen: b,
19
19
  triggerRef: S,
@@ -23,8 +23,8 @@ function p({ content: p, position: m = "top", delay: h = 150, open: g, className
23
23
  behavior: T,
24
24
  placement: w
25
25
  });
26
- let E = l(0);
27
- s(() => () => window.clearTimeout(E.current), []);
26
+ let E = c(0);
27
+ o(() => () => window.clearTimeout(E.current), []);
28
28
  let D = () => {
29
29
  window.clearTimeout(E.current), E.current = window.setTimeout(() => b(!0), h);
30
30
  }, O = () => {
@@ -2,12 +2,12 @@
2
2
  import { classnames as e } from "../../utils/classnames.js";
3
3
  /* empty css */
4
4
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
5
- import { useControl as r } from "react-use-control";
6
- import { useState as i } from "react";
5
+ import { useState as r } from "react";
6
+ import { useControl as i } from "react-use-control";
7
7
  //#region src/lib/components/Transfer/Transfer.tsx
8
8
  var a = "haze-Transfer__container", o = "haze-Transfer__panel", s = "haze-Transfer__panelHeader", c = "haze-Transfer__panelBody", l = "haze-Transfer__itemStyle", u = "haze-Transfer__actions", d = "haze-Transfer__actionBtn";
9
9
  function f({ dataSource: f, targetKeys: p, onChange: m, className: h }) {
10
- let [g, _] = r(p, []), [v, y] = i([]), [b, x] = i([]), S = f.filter((e) => !g.includes(e.key)), C = f.filter((e) => g.includes(e.key)), w = (e) => {
10
+ let [g, _] = i(p, []), [v, y] = r([]), [b, x] = r([]), S = f.filter((e) => !g.includes(e.key)), C = f.filter((e) => g.includes(e.key)), w = (e) => {
11
11
  y((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
12
12
  }, T = (e) => {
13
13
  x((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
@@ -4,8 +4,8 @@ import t from "./TreeItem.js";
4
4
  import { findNodeByKey as n, getChildKeys as r, getParentKey as i } from "./utils.js";
5
5
  /* empty css */
6
6
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
- import { useControl as s } from "react-use-control";
8
- import { useMemo as c } from "react";
7
+ import { useMemo as s } from "react";
8
+ import { useControl as c } from "react-use-control";
9
9
  //#region src/lib/components/Tree/Tree.tsx
10
10
  var l = "haze-Tree__base", u = "haze-Tree__group";
11
11
  function d(e, t, n) {
@@ -26,7 +26,7 @@ function d(e, t, n) {
26
26
  };
27
27
  }
28
28
  function f({ treeData: f, multiple: p = !1, checkable: m = !1, checkStrictly: h = !1, selectable: g = !0, disabled: _ = !1, blockNode: v = !1, showLine: y = !1, showIcon: b = !1, switcherIcon: x, loadingIcon: S, titleRender: C, iconRender: w, expandedKeys: T, selectedKeys: E, checkedKeys: D, className: O, onExpand: k, onSelect: A, onCheck: j }) {
29
- let [M, N] = s(T, []), [P, F] = s(E, []), [I, L] = s(D, []), R = I, z = c(() => d(R, f, h), [
29
+ let [M, N] = c(T, []), [P, F] = c(E, []), [I, L] = c(D, []), R = I, z = s(() => d(R, f, h), [
30
30
  R,
31
31
  f,
32
32
  h
@@ -1,2 +1,3 @@
1
1
  /* haze-ui button — generated by scripts/split-css.mjs, do not edit */
2
- .haze-Button__base{justify-content:center;align-items:center;gap:var(--haze-space-2);border-radius:var(--haze-radius-md);font-family:var(--haze-font-sans);font-weight:var(--haze-weight-medium);line-height:var(--haze-leading-tight);cursor:pointer;-webkit-user-select:none;user-select:none;border:1px solid #0000;transition:background .15s,color .15s,border-color .15s,box-shadow .15s;display:inline-flex}.haze-Button__base:focus-visible{box-shadow:0 0 0 3px var(--haze-color-focus-ring);outline:none}.haze-Button__base:disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.haze-Button__solid{background:var(--haze-color-primary);color:var(--haze-color-text-inverse)}.haze-Button__solid:hover{background:var(--haze-color-primary-hover)}.haze-Button__solid:active{background:var(--haze-color-primary-active)}.haze-Button__outline{border-color:var(--haze-color-border);color:var(--haze-color-text);background:0 0}.haze-Button__outline:hover{border-color:var(--haze-color-border-hover);background:var(--haze-color-bg-subtle)}.haze-Button__outline:active{background:var(--haze-color-bg-muted)}.haze-Button__ghost{color:var(--haze-color-text);background:0 0}.haze-Button__ghost:hover{background:var(--haze-color-bg-subtle)}.haze-Button__ghost:active{background:var(--haze-color-bg-muted)}.haze-Button__sizeSm{padding:var(--haze-space-1) var(--haze-space-3);font-size:var(--haze-text-sm)}.haze-Button__sizeMd{padding:var(--haze-space-2) var(--haze-space-4);font-size:var(--haze-text-sm)}.haze-Button__sizeLg{padding:var(--haze-space-3) var(--haze-space-6);font-size:var(--haze-text-base)}.haze-Button__squareSm{padding:var(--haze-space-1);font-size:var(--haze-text-sm)}.haze-Button__squareMd{padding:var(--haze-space-2);font-size:var(--haze-text-sm)}.haze-Button__squareLg{padding:var(--haze-space-3);font-size:var(--haze-text-base)}
2
+ .haze-ButtonLink__link{-webkit-text-decoration:none;text-decoration:none}.haze-ButtonLink__link[aria-disabled=true]{opacity:.5;cursor:not-allowed;pointer-events:none}
3
+ .haze-styles__base{justify-content:center;align-items:center;gap:var(--haze-space-2);border-radius:var(--haze-radius-md);font-family:var(--haze-font-sans);font-weight:var(--haze-weight-medium);line-height:var(--haze-leading-tight);cursor:pointer;-webkit-user-select:none;user-select:none;border:1px solid #0000;transition:background .15s,color .15s,border-color .15s,box-shadow .15s;display:inline-flex}.haze-styles__base:focus-visible{box-shadow:0 0 0 3px var(--haze-color-focus-ring);outline:none}.haze-styles__base:disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.haze-styles__solid{background:var(--haze-color-primary);color:var(--haze-color-text-inverse)}.haze-styles__solid:hover{background:var(--haze-color-primary-hover)}.haze-styles__solid:active{background:var(--haze-color-primary-active)}.haze-styles__outline{border-color:var(--haze-color-border);color:var(--haze-color-text);background:0 0}.haze-styles__outline:hover{border-color:var(--haze-color-border-hover);background:var(--haze-color-bg-subtle)}.haze-styles__outline:active{background:var(--haze-color-bg-muted)}.haze-styles__ghost{color:var(--haze-color-text);background:0 0}.haze-styles__ghost:hover{background:var(--haze-color-bg-subtle)}.haze-styles__ghost:active{background:var(--haze-color-bg-muted)}.haze-styles__sizeSm{padding:var(--haze-space-1) var(--haze-space-3);font-size:var(--haze-text-sm)}.haze-styles__sizeMd{padding:var(--haze-space-2) var(--haze-space-4);font-size:var(--haze-text-sm)}.haze-styles__sizeLg{padding:var(--haze-space-3) var(--haze-space-6);font-size:var(--haze-text-base)}.haze-styles__squareSm{padding:var(--haze-space-1);font-size:var(--haze-text-sm)}.haze-styles__squareMd{padding:var(--haze-space-2);font-size:var(--haze-text-sm)}.haze-styles__squareLg{padding:var(--haze-space-3);font-size:var(--haze-text-base)}