haze-ui 1.15.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.
- package/README.md +36 -0
- package/dist/components/Button/Button.js +11 -25
- package/dist/components/Button/ButtonLink.js +23 -0
- package/dist/components/Button/styles.js +18 -0
- package/dist/components/Carousel/Carousel.js +5 -5
- package/dist/components/ChatInput/ChatInput.js +3 -3
- package/dist/components/Collapsible/Collapsible.js +6 -6
- package/dist/components/Combobox/Combobox.js +4 -4
- package/dist/components/Command/Command.js +8 -8
- package/dist/components/ContextMenu/ContextMenu.js +4 -4
- package/dist/components/Dialog/Dialog.js +4 -4
- package/dist/components/Disclosure/Disclosure.js +4 -4
- package/dist/components/Drawer/Drawer.js +4 -4
- package/dist/components/DropdownMenu/DropdownMenu.js +3 -3
- package/dist/components/InlineEdit/InlineEdit.js +4 -4
- package/dist/components/LogViewer/LogViewer.js +3 -3
- package/dist/components/Menu/Menu.js +3 -3
- package/dist/components/Popover/Popover.js +3 -3
- package/dist/components/Stepper/Stepper.js +4 -4
- package/dist/components/Tooltip/Tooltip.js +5 -5
- package/dist/components/Transfer/Transfer.js +3 -3
- package/dist/components/Tree/Tree.js +3 -3
- package/dist/css/button.css +2 -1
- package/dist/haze-ui.css +2 -1
- package/dist/index.js +139 -138
- package/dist/types/components/Button/ButtonLink.d.ts +31 -0
- package/dist/types/components/Button/index.d.ts +2 -0
- package/dist/types/components/Button/styles.d.ts +29 -0
- package/dist/types/index.d.ts +2 -2
- 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
|
|
@@ -1,33 +1,19 @@
|
|
|
1
|
-
|
|
2
1
|
import { classnames as e } from "../../utils/classnames.js";
|
|
3
|
-
|
|
4
|
-
import { jsx as
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
...
|
|
9
|
+
...u,
|
|
24
10
|
className: e([
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
11
|
+
t,
|
|
12
|
+
i[o],
|
|
13
|
+
d,
|
|
14
|
+
l
|
|
29
15
|
])
|
|
30
16
|
});
|
|
31
17
|
}
|
|
32
18
|
//#endregion
|
|
33
|
-
export {
|
|
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 {
|
|
6
|
-
import {
|
|
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] =
|
|
11
|
-
return
|
|
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]),
|
|
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 {
|
|
6
|
-
import {
|
|
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] =
|
|
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 {
|
|
6
|
-
import {
|
|
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 =
|
|
8
|
+
var a = n(void 0);
|
|
9
9
|
function o() {
|
|
10
|
-
let e =
|
|
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:
|
|
16
|
-
let [l, u] = n
|
|
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 {
|
|
8
|
-
import {
|
|
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] =
|
|
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
|
-
|
|
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 {
|
|
7
|
-
import {
|
|
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 =
|
|
9
|
+
var d = "[role=\"option\"]", f = a(void 0);
|
|
10
10
|
function p() {
|
|
11
|
-
let e =
|
|
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 [
|
|
18
|
-
query:
|
|
19
|
-
setQuery:
|
|
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 {
|
|
8
|
-
import {
|
|
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] =
|
|
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 =
|
|
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 {
|
|
6
|
-
import {
|
|
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] =
|
|
11
|
-
return
|
|
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 {
|
|
6
|
-
import {
|
|
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] =
|
|
11
|
-
return
|
|
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 {
|
|
6
|
-
import {
|
|
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] =
|
|
16
|
-
return
|
|
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 {
|
|
8
|
-
import {
|
|
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] =
|
|
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 {
|
|
6
|
-
import {
|
|
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] =
|
|
11
|
-
|
|
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 {
|
|
6
|
-
import {
|
|
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] =
|
|
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 {
|
|
8
|
-
import {
|
|
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] =
|
|
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 {
|
|
6
|
-
import {
|
|
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] =
|
|
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 {
|
|
7
|
-
import {
|
|
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] =
|
|
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:
|
|
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 {
|
|
7
|
-
import {
|
|
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] =
|
|
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 =
|
|
27
|
-
|
|
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 {
|
|
6
|
-
import {
|
|
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, _] =
|
|
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 {
|
|
8
|
-
import {
|
|
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] =
|
|
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
|
package/dist/css/button.css
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
/* haze-ui button — generated by scripts/split-css.mjs, do not edit */
|
|
2
|
-
.haze-
|
|
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)}
|
package/dist/haze-ui.css
CHANGED
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
.haze-BottomSheet__overlay{z-index:100;-webkit-align-items:flex-end;-webkit-box-align:flex-end;-ms-flex-align:flex-end;background:#0006;justify-content:center;align-items:flex-end;display:flex;position:fixed;inset:0}.haze-BottomSheet__sheet{background:var(--haze-color-bg);border-radius:var(--haze-radius-xl) var(--haze-radius-xl) 0 0;padding:var(--haze-space-4) var(--haze-space-6) calc(var(--haze-space-4) + env(safe-area-inset-bottom));width:100%;max-width:640px;max-height:80vh;font-family:var(--haze-font-sans);color:var(--haze-color-text);box-shadow:var(--haze-shadow-xl);overflow-y:auto}.haze-BottomSheet__handle{background:var(--haze-color-border);border-radius:var(--haze-radius-full);width:2rem;height:.25rem;margin:0 auto var(--haze-space-4)}
|
|
15
15
|
.haze-Breadcrumb__nav{font-family:var(--haze-font-sans);font-size:var(--haze-text-sm)}.haze-Breadcrumb__list{align-items:center;gap:var(--haze-space-2);white-space:nowrap;margin:0;padding:0;list-style:none;display:flex;overflow-x:auto}.haze-Breadcrumb__sep{color:var(--haze-color-text-muted);-webkit-user-select:none;user-select:none}
|
|
16
16
|
.haze-BreadcrumbItem__link{color:var(--haze-color-primary);-webkit-text-decoration:none;text-decoration:none;transition:color .15s}.haze-BreadcrumbItem__link:hover{color:var(--haze-color-primary-hover);-webkit-text-decoration:underline;text-decoration:underline}.haze-BreadcrumbItem__link:focus-visible{box-shadow:0 0 0 3px var(--haze-color-focus-ring);border-radius:var(--haze-radius-sm);outline:none}.haze-BreadcrumbItem__current{color:var(--haze-color-text);font-weight:var(--haze-weight-medium)}
|
|
17
|
-
.haze-
|
|
17
|
+
.haze-ButtonLink__link{-webkit-text-decoration:none;text-decoration:none}.haze-ButtonLink__link[aria-disabled=true]{opacity:.5;cursor:not-allowed;pointer-events:none}
|
|
18
|
+
.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)}
|
|
18
19
|
.haze-Card__base{border-radius:var(--haze-radius-lg);padding:var(--haze-space-5);font-family:var(--haze-font-sans);color:var(--haze-color-text)}.haze-Card__elevated{background:var(--haze-color-bg);box-shadow:var(--haze-shadow-md)}.haze-Card__outlined{background:var(--haze-color-bg);border:1px solid var(--haze-color-border)}.haze-Card__filled{background:var(--haze-color-bg-subtle)}
|
|
19
20
|
.haze-Carousel__wrapper{border-radius:var(--haze-radius-lg);position:relative;overflow:hidden}.haze-Carousel__track{-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;scroll-behavior:smooth;scrollbar-width:none;display:flex;overflow-x:auto}.haze-Carousel__track::-webkit-scrollbar{display:none}.haze-Carousel__navBtn{z-index:1;appearance:none;border-radius:var(--haze-radius-full);background:var(--haze-color-bg);width:2.5rem;height:2.5rem;color:var(--haze-color-text);font-size:var(--haze-text-lg);cursor:pointer;box-shadow:var(--haze-shadow-md);border:none;justify-content:center;align-items:center;transition:background .15s;display:flex;position:absolute;top:50%;transform:translateY(-50%)}.haze-Carousel__navBtn:hover{background:var(--haze-color-bg-subtle)}.haze-Carousel__navBtn:focus-visible{box-shadow:var(--haze-shadow-md),0 0 0 3px var(--haze-color-focus-ring);outline:none}.haze-Carousel__prevBtn{left:var(--haze-space-2)}.haze-Carousel__nextBtn{right:var(--haze-space-2)}.haze-Carousel__indicators{justify-content:center;gap:var(--haze-space-1);padding:var(--haze-space-2) 0;display:flex}.haze-Carousel__dot{border-radius:var(--haze-radius-full);background:var(--haze-color-bg-muted);cursor:pointer;border:none;width:.625rem;height:.625rem;padding:.375rem;transition:background .15s}.haze-Carousel__dotActive{background:var(--haze-color-primary)}
|
|
20
21
|
.haze-CarouselSlide__slide{scroll-snap-snap-align:start;scroll-snap-align:start;flex:0 0 100%;min-width:0}
|
package/dist/index.js
CHANGED
|
@@ -3,141 +3,142 @@ import { spacing as n } from "./tokens/spacing.js";
|
|
|
3
3
|
import { typography as r } from "./tokens/typography.js";
|
|
4
4
|
import { COMPONENT_TOKENS as i, TOKEN_REGISTRY as a } from "./tokens/registry.js";
|
|
5
5
|
import o from "./components/Button/Button.js";
|
|
6
|
-
import s from "./components/
|
|
7
|
-
import c from "./components/Input/
|
|
8
|
-
import l from "./components/
|
|
9
|
-
import u from "./components/Select/
|
|
10
|
-
import d from "./components/Select/
|
|
11
|
-
import f from "./components/
|
|
12
|
-
import p from "./components/Checkbox/
|
|
13
|
-
import m from "./components/
|
|
14
|
-
import h from "./components/Switch/
|
|
15
|
-
import g from "./components/
|
|
16
|
-
import _ from "./components/
|
|
17
|
-
import v from "./components/
|
|
18
|
-
import y from "./components/
|
|
19
|
-
import b from "./components/
|
|
20
|
-
import x from "./components/
|
|
21
|
-
import S from "./components/Radio/
|
|
22
|
-
import C from "./components/Radio/
|
|
23
|
-
import w from "./components/
|
|
24
|
-
import T from "./components/Textarea/
|
|
25
|
-
import E from "./components/
|
|
26
|
-
import D from "./components/Slider/
|
|
27
|
-
import O from "./components/
|
|
28
|
-
import k from "./components/Tabs/
|
|
29
|
-
import A from "./components/Tabs/
|
|
30
|
-
import j from "./components/Tabs/
|
|
31
|
-
import M from "./components/
|
|
32
|
-
import N from "./components/Accordion/
|
|
33
|
-
import P from "./components/
|
|
34
|
-
import F from "./components/
|
|
35
|
-
import I from "./components/
|
|
36
|
-
import L from "./components/
|
|
37
|
-
import R from "./components/
|
|
38
|
-
import z from "./components/
|
|
39
|
-
import B from "./components/
|
|
40
|
-
import V from "./components/
|
|
41
|
-
import H from "./components/Breadcrumb/
|
|
42
|
-
import U from "./components/
|
|
43
|
-
import W from "./components/
|
|
44
|
-
import G from "./components/Menu/
|
|
45
|
-
import K from "./components/Menu/
|
|
46
|
-
import q from "./components/
|
|
47
|
-
import J from "./components/NumberInput/
|
|
48
|
-
import Y from "./components/
|
|
49
|
-
import X from "./components/
|
|
50
|
-
import Z from "./components/Toast/
|
|
51
|
-
import Q from "./components/Toast/
|
|
52
|
-
import $ from "./components/
|
|
53
|
-
import ee from "./components/List/
|
|
54
|
-
import te from "./components/
|
|
55
|
-
import ne from "./components/
|
|
56
|
-
import re from "./components/Table/
|
|
57
|
-
import ie from "./components/Table/
|
|
58
|
-
import ae from "./components/Table/
|
|
59
|
-
import oe from "./components/Table/
|
|
60
|
-
import se from "./components/
|
|
61
|
-
import ce from "./components/Carousel/
|
|
62
|
-
import le from "./components/
|
|
63
|
-
import ue from "./components/Datepicker/
|
|
64
|
-
import de from "./components/
|
|
65
|
-
import fe from "./components/
|
|
66
|
-
import pe from "./components/
|
|
67
|
-
import me from "./components/
|
|
68
|
-
import he from "./components/
|
|
69
|
-
import ge from "./components/
|
|
70
|
-
import _e from "./components/
|
|
71
|
-
import ve from "./components/Grid/
|
|
72
|
-
import ye from "./components/
|
|
73
|
-
import be from "./components/
|
|
74
|
-
import xe from "./components/Stepper/
|
|
75
|
-
import Se
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import Me from "./components/
|
|
79
|
-
import Ne from "./components/
|
|
80
|
-
import Pe from "./components/
|
|
81
|
-
import Fe from "./components/ColorPicker/
|
|
82
|
-
import Ie from "./components/
|
|
83
|
-
import Le from "./components/Rating/
|
|
84
|
-
import
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import Ge from "./components/
|
|
88
|
-
import Ke from "./components/Segmented/
|
|
89
|
-
import qe from "./components/
|
|
90
|
-
import Je from "./components/
|
|
91
|
-
import Ye from "./components/
|
|
92
|
-
import Xe from "./components/TimePicker/
|
|
93
|
-
import Ze from "./components/
|
|
94
|
-
import Qe from "./components/DateRangePicker/
|
|
95
|
-
import $e from "./components/
|
|
96
|
-
import et from "./components/OTPInput/
|
|
97
|
-
import tt from "./components/
|
|
98
|
-
import nt from "./components/PasswordInput/
|
|
99
|
-
import rt from "./components/
|
|
100
|
-
import it from "./components/TagInput/
|
|
101
|
-
import at from "./components/
|
|
102
|
-
import ot from "./components/
|
|
103
|
-
import st from "./components/DropdownMenu/
|
|
104
|
-
import ct from "./components/DropdownMenu/
|
|
105
|
-
import lt from "./components/DropdownMenu/
|
|
106
|
-
import ut from "./components/DropdownMenu/
|
|
107
|
-
import dt from "./components/
|
|
108
|
-
import ft from "./components/ContextMenu/
|
|
109
|
-
import pt from "./components/ContextMenu/
|
|
110
|
-
import mt from "./components/ContextMenu/
|
|
111
|
-
import ht from "./components/ContextMenu/
|
|
112
|
-
import gt from "./components/
|
|
113
|
-
import _t from "./components/NavigationBar/
|
|
114
|
-
import vt from "./components/
|
|
115
|
-
import yt from "./components/
|
|
116
|
-
import bt from "./components/
|
|
117
|
-
import xt from "./components/
|
|
118
|
-
import St from "./components/
|
|
119
|
-
import Ct from "./components/
|
|
120
|
-
import wt from "./components/
|
|
121
|
-
import Tt from "./components/
|
|
122
|
-
import Et from "./components/
|
|
123
|
-
import Dt from "./components/TagGroup/
|
|
124
|
-
import Ot from "./components/
|
|
125
|
-
import kt from "./components/
|
|
126
|
-
import At from "./components/
|
|
127
|
-
import jt from "./components/
|
|
128
|
-
import Mt from "./components/
|
|
129
|
-
import Nt from "./components/
|
|
130
|
-
import Pt from "./components/
|
|
131
|
-
import Ft from "./components/
|
|
132
|
-
import It from "./components/
|
|
133
|
-
import Lt
|
|
134
|
-
import zt from "./components/
|
|
135
|
-
import Bt from "./components/
|
|
136
|
-
import Vt from "./components/
|
|
137
|
-
import Ht from "./components/
|
|
138
|
-
import Ut from "./components/ConversationList/
|
|
139
|
-
import Wt from "./components/
|
|
140
|
-
import Gt from "./components/
|
|
141
|
-
import Kt from "./
|
|
142
|
-
import
|
|
143
|
-
|
|
6
|
+
import s from "./components/Button/ButtonLink.js";
|
|
7
|
+
import c from "./components/Input/InputCore.js";
|
|
8
|
+
import l from "./components/Input/Input.js";
|
|
9
|
+
import u from "./components/Select/SelectCore.js";
|
|
10
|
+
import d from "./components/Select/Select.js";
|
|
11
|
+
import f from "./components/Select/Option.js";
|
|
12
|
+
import p from "./components/Checkbox/CheckboxCore.js";
|
|
13
|
+
import m from "./components/Checkbox/Checkbox.js";
|
|
14
|
+
import h from "./components/Switch/SwitchCore.js";
|
|
15
|
+
import g from "./components/Switch/Switch.js";
|
|
16
|
+
import _ from "./components/Badge/Badge.js";
|
|
17
|
+
import v from "./components/Dialog/Dialog.js";
|
|
18
|
+
import y from "./components/Tooltip/Tooltip.js";
|
|
19
|
+
import b from "./components/Popover/Popover.js";
|
|
20
|
+
import x from "./components/Card/Card.js";
|
|
21
|
+
import S from "./components/Radio/Radio.js";
|
|
22
|
+
import C from "./components/Radio/RadioGroupCore.js";
|
|
23
|
+
import w from "./components/Radio/RadioGroup.js";
|
|
24
|
+
import T from "./components/Textarea/TextareaCore.js";
|
|
25
|
+
import E from "./components/Textarea/Textarea.js";
|
|
26
|
+
import D from "./components/Slider/SliderCore.js";
|
|
27
|
+
import O from "./components/Slider/Slider.js";
|
|
28
|
+
import k from "./components/Tabs/Tabs.js";
|
|
29
|
+
import A from "./components/Tabs/TabList.js";
|
|
30
|
+
import j from "./components/Tabs/Tab.js";
|
|
31
|
+
import M from "./components/Tabs/TabPanel.js";
|
|
32
|
+
import N from "./components/Accordion/Accordion.js";
|
|
33
|
+
import P from "./components/Accordion/AccordionItem.js";
|
|
34
|
+
import F from "./components/Alert/Alert.js";
|
|
35
|
+
import I from "./components/Avatar/Avatar.js";
|
|
36
|
+
import L from "./components/Tag/Tag.js";
|
|
37
|
+
import R from "./components/Skeleton/Skeleton.js";
|
|
38
|
+
import z from "./components/Icon/Icon.js";
|
|
39
|
+
import B from "./components/Image/Image.js";
|
|
40
|
+
import V from "./components/Flex/Flex.js";
|
|
41
|
+
import H from "./components/Breadcrumb/Breadcrumb.js";
|
|
42
|
+
import U from "./components/Breadcrumb/BreadcrumbItem.js";
|
|
43
|
+
import W from "./components/Disclosure/Disclosure.js";
|
|
44
|
+
import G from "./components/Menu/Menu.js";
|
|
45
|
+
import K from "./components/Menu/MenuItem.js";
|
|
46
|
+
import q from "./components/Menu/MenuDivider.js";
|
|
47
|
+
import J from "./components/NumberInput/NumberInputCore.js";
|
|
48
|
+
import Y from "./components/NumberInput/NumberInput.js";
|
|
49
|
+
import X from "./components/FileInput/FileInput.js";
|
|
50
|
+
import Z from "./components/Toast/Toast.js";
|
|
51
|
+
import Q from "./components/Toast/ToastContainer.js";
|
|
52
|
+
import $ from "./components/Toast/useToast.js";
|
|
53
|
+
import ee from "./components/List/List.js";
|
|
54
|
+
import te from "./components/List/ListItem.js";
|
|
55
|
+
import ne from "./components/Combobox/Combobox.js";
|
|
56
|
+
import re from "./components/Table/Table.js";
|
|
57
|
+
import ie from "./components/Table/TableHead.js";
|
|
58
|
+
import ae from "./components/Table/TableBody.js";
|
|
59
|
+
import oe from "./components/Table/TableRow.js";
|
|
60
|
+
import se from "./components/Table/TableCell.js";
|
|
61
|
+
import ce from "./components/Carousel/Carousel.js";
|
|
62
|
+
import le from "./components/Carousel/CarouselSlide.js";
|
|
63
|
+
import ue from "./components/Datepicker/DatepickerCore.js";
|
|
64
|
+
import de from "./components/Datepicker/Datepicker.js";
|
|
65
|
+
import fe from "./components/Tree/Tree.js";
|
|
66
|
+
import pe from "./components/Divider/Divider.js";
|
|
67
|
+
import me from "./components/Spinner/Spinner.js";
|
|
68
|
+
import he from "./components/Empty/Empty.js";
|
|
69
|
+
import ge from "./components/Progress/Progress.js";
|
|
70
|
+
import _e from "./components/Pagination/Pagination.js";
|
|
71
|
+
import ve from "./components/Grid/Grid.js";
|
|
72
|
+
import ye from "./components/Grid/GridItem.js";
|
|
73
|
+
import be from "./components/Drawer/Drawer.js";
|
|
74
|
+
import xe from "./components/Stepper/Stepper.js";
|
|
75
|
+
import Se from "./components/Stepper/Step.js";
|
|
76
|
+
import Ce, { CommandInput as we, CommandItem as Te, CommandList as Ee } from "./components/Command/Command.js";
|
|
77
|
+
import { ResizableGroup as De, ResizableHandle as Oe, ResizablePanel as ke } from "./components/Resizable/Resizable.js";
|
|
78
|
+
import { Collapsible as Ae, CollapsibleContent as je, CollapsibleTrigger as Me } from "./components/Collapsible/Collapsible.js";
|
|
79
|
+
import Ne from "./components/Transfer/Transfer.js";
|
|
80
|
+
import Pe from "./components/Upload/Upload.js";
|
|
81
|
+
import Fe from "./components/ColorPicker/ColorPickerCore.js";
|
|
82
|
+
import Ie from "./components/ColorPicker/ColorPicker.js";
|
|
83
|
+
import Le from "./components/Rating/RatingCore.js";
|
|
84
|
+
import Re from "./components/Rating/Rating.js";
|
|
85
|
+
import { Timeline as ze, TimelineItem as Be } from "./components/Timeline/Timeline.js";
|
|
86
|
+
import { Paragraph as Ve, Text as He, Title as Ue } from "./components/Typography/Typography.js";
|
|
87
|
+
import { Stat as We, StatGroup as Ge } from "./components/Stat/Stat.js";
|
|
88
|
+
import Ke from "./components/Segmented/SegmentedCore.js";
|
|
89
|
+
import qe from "./components/Segmented/Segmented.js";
|
|
90
|
+
import Je from "./components/Chip/Chip.js";
|
|
91
|
+
import Ye from "./components/ScrollArea/ScrollArea.js";
|
|
92
|
+
import Xe from "./components/TimePicker/TimePickerCore.js";
|
|
93
|
+
import Ze from "./components/TimePicker/TimePicker.js";
|
|
94
|
+
import Qe from "./components/DateRangePicker/DateRangePickerCore.js";
|
|
95
|
+
import $e from "./components/DateRangePicker/DateRangePicker.js";
|
|
96
|
+
import et from "./components/OTPInput/OTPInputCore.js";
|
|
97
|
+
import tt from "./components/OTPInput/OTPInput.js";
|
|
98
|
+
import nt from "./components/PasswordInput/PasswordInputCore.js";
|
|
99
|
+
import rt from "./components/PasswordInput/PasswordInput.js";
|
|
100
|
+
import it from "./components/TagInput/TagInputCore.js";
|
|
101
|
+
import at from "./components/TagInput/TagInput.js";
|
|
102
|
+
import ot from "./components/InlineEdit/InlineEdit.js";
|
|
103
|
+
import st from "./components/DropdownMenu/DropdownMenu.js";
|
|
104
|
+
import ct from "./components/DropdownMenu/DropdownMenuTrigger.js";
|
|
105
|
+
import lt from "./components/DropdownMenu/DropdownMenuContent.js";
|
|
106
|
+
import ut from "./components/DropdownMenu/DropdownMenuItem.js";
|
|
107
|
+
import dt from "./components/DropdownMenu/DropdownMenuSeparator.js";
|
|
108
|
+
import ft from "./components/ContextMenu/ContextMenu.js";
|
|
109
|
+
import pt from "./components/ContextMenu/ContextMenuTrigger.js";
|
|
110
|
+
import mt from "./components/ContextMenu/ContextMenuContent.js";
|
|
111
|
+
import ht from "./components/ContextMenu/ContextMenuItem.js";
|
|
112
|
+
import gt from "./components/ContextMenu/ContextMenuSeparator.js";
|
|
113
|
+
import _t from "./components/NavigationBar/NavigationBar.js";
|
|
114
|
+
import vt from "./components/NavigationBar/NavLink.js";
|
|
115
|
+
import yt from "./components/BackToTop/BackToTop.js";
|
|
116
|
+
import bt from "./components/Affix/Affix.js";
|
|
117
|
+
import xt from "./components/Container/Container.js";
|
|
118
|
+
import St from "./components/Banner/Banner.js";
|
|
119
|
+
import Ct from "./components/ConfirmDialog/ConfirmDialog.js";
|
|
120
|
+
import wt from "./components/CodeBlock/CodeBlock.js";
|
|
121
|
+
import Tt from "./components/AspectRatio/AspectRatio.js";
|
|
122
|
+
import Et from "./components/VirtualList/VirtualList.js";
|
|
123
|
+
import Dt from "./components/TagGroup/TagGroup.js";
|
|
124
|
+
import Ot from "./components/TagGroup/TagGroupItem.js";
|
|
125
|
+
import kt from "./components/BottomSheet/BottomSheet.js";
|
|
126
|
+
import At from "./components/SwipeAction/SwipeAction.js";
|
|
127
|
+
import jt from "./components/ChatMessage/ChatMessage.js";
|
|
128
|
+
import Mt from "./components/ChatContainer/ChatContainer.js";
|
|
129
|
+
import Nt from "./components/ChatInput/ChatInput.js";
|
|
130
|
+
import Pt from "./components/StreamingText/StreamingText.js";
|
|
131
|
+
import Ft from "./components/MarkdownRenderer/MarkdownRenderer.js";
|
|
132
|
+
import It from "./components/ToolCallCard/ToolCallCard.js";
|
|
133
|
+
import Lt from "./components/ThinkingIndicator/ThinkingIndicator.js";
|
|
134
|
+
import Rt, { StepTimelineItem as zt } from "./components/StepTimeline/StepTimeline.js";
|
|
135
|
+
import Bt from "./components/ApprovalCard/ApprovalCard.js";
|
|
136
|
+
import Vt from "./components/TokenCounter/TokenCounter.js";
|
|
137
|
+
import Ht from "./components/ModelPicker/ModelPicker.js";
|
|
138
|
+
import Ut from "./components/ConversationList/ConversationList.js";
|
|
139
|
+
import Wt from "./components/ConversationList/ConversationItem.js";
|
|
140
|
+
import Gt from "./components/DiffViewer/DiffViewer.js";
|
|
141
|
+
import Kt from "./components/LogViewer/LogViewer.js";
|
|
142
|
+
import qt from "./form/FormItem.js";
|
|
143
|
+
import { useControl as Jt } from "react-use-control";
|
|
144
|
+
export { N as Accordion, P as AccordionItem, bt as Affix, F as Alert, Bt as ApprovalCard, Tt as AspectRatio, I as Avatar, yt as BackToTop, _ as Badge, St as Banner, kt as BottomSheet, H as Breadcrumb, U as BreadcrumbItem, o as Button, s as ButtonLink, i as COMPONENT_TOKENS, x as Card, ce as Carousel, le as CarouselSlide, Mt as ChatContainer, Nt as ChatInput, jt as ChatMessage, m as Checkbox, p as CheckboxCore, Je as Chip, wt as CodeBlock, Ae as Collapsible, je as CollapsibleContent, Me as CollapsibleTrigger, Ie as ColorPicker, Fe as ColorPickerCore, ne as Combobox, Ce as Command, we as CommandInput, Te as CommandItem, Ee as CommandList, Ct as ConfirmDialog, xt as Container, ft as ContextMenu, mt as ContextMenuContent, ht as ContextMenuItem, gt as ContextMenuSeparator, pt as ContextMenuTrigger, Wt as ConversationItem, Ut as ConversationList, $e as DateRangePicker, Qe as DateRangePickerCore, de as Datepicker, ue as DatepickerCore, v as Dialog, Gt as DiffViewer, W as Disclosure, pe as Divider, be as Drawer, st as DropdownMenu, lt as DropdownMenuContent, ut as DropdownMenuItem, dt as DropdownMenuSeparator, ct as DropdownMenuTrigger, he as Empty, X as FileInput, V as Flex, qt as FormItem, ve as Grid, ye as GridItem, z as Icon, B as Image, ot as InlineEdit, l as Input, c as InputCore, ee as List, te as ListItem, Kt as LogViewer, Ft as MarkdownRenderer, G as Menu, q as MenuDivider, K as MenuItem, Ht as ModelPicker, vt as NavLink, _t as NavigationBar, Y as NumberInput, J as NumberInputCore, tt as OTPInput, et as OTPInputCore, f as Option, _e as Pagination, Ve as Paragraph, rt as PasswordInput, nt as PasswordInputCore, b as Popover, ge as Progress, S as Radio, w as RadioGroup, C as RadioGroupCore, Re as Rating, Le as RatingCore, De as ResizableGroup, Oe as ResizableHandle, ke as ResizablePanel, Ye as ScrollArea, qe as Segmented, Ke as SegmentedCore, d as Select, u as SelectCore, R as Skeleton, O as Slider, D as SliderCore, me as Spinner, We as Stat, Ge as StatGroup, Se as Step, Rt as StepTimeline, zt as StepTimelineItem, xe as Stepper, Pt as StreamingText, At as SwipeAction, g as Switch, h as SwitchCore, a as TOKEN_REGISTRY, j as Tab, A as TabList, M as TabPanel, re as Table, ae as TableBody, se as TableCell, ie as TableHead, oe as TableRow, k as Tabs, L as Tag, Dt as TagGroup, Ot as TagGroupItem, at as TagInput, it as TagInputCore, He as Text, E as Textarea, T as TextareaCore, Lt as ThinkingIndicator, Ze as TimePicker, Xe as TimePickerCore, ze as Timeline, Be as TimelineItem, Ue as Title, Z as Toast, Q as ToastContainer, Vt as TokenCounter, It as ToolCallCard, y as Tooltip, Ne as Transfer, fe as Tree, Pe as Upload, Et as VirtualList, e as darkTheme, t as lightTheme, n as spacing, r as typography, Jt as useControl, $ as useToast };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A real `<a>` with the full Button appearance — for navigation that
|
|
4
|
+
* must look like a button. Rendering `as={Button}` puts `href` on a
|
|
5
|
+
* `<button>` (an invalid attribute: no ⌘/middle-click, no crawlable
|
|
6
|
+
* link); ButtonLink keeps the anchor semantics and wears Button's skin
|
|
7
|
+
* (same `variant`/`size`/`square` props, same focus/disabled visual
|
|
8
|
+
* states).
|
|
9
|
+
*
|
|
10
|
+
* Extends the native `<a>` attributes — everything not listed below is
|
|
11
|
+
* spread onto the anchor, so routers composing their own `Link` through
|
|
12
|
+
* an `as` prop can inject `href`, `onClick`, `target`, `rel` and
|
|
13
|
+
* friends (NavLink-style).
|
|
14
|
+
*
|
|
15
|
+
* Anchors have no `disabled` attribute: report the state with
|
|
16
|
+
* `aria-disabled` (and `tabIndex={-1}` to drop it from the focus
|
|
17
|
+
* order) — ButtonLink styles `aria-disabled` exactly like Button's
|
|
18
|
+
* `:disabled`.
|
|
19
|
+
*/
|
|
20
|
+
type ButtonLinkProps = {
|
|
21
|
+
variant?: 'solid' | 'outline' | 'ghost';
|
|
22
|
+
size?: 'sm' | 'md' | 'lg';
|
|
23
|
+
square?: boolean;
|
|
24
|
+
} & ComponentPropsWithoutRef<'a'>;
|
|
25
|
+
declare const _default: import("react").ForwardRefExoticComponent<{
|
|
26
|
+
variant?: "solid" | "outline" | "ghost";
|
|
27
|
+
size?: "sm" | "md" | "lg";
|
|
28
|
+
square?: boolean;
|
|
29
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
30
|
+
export default _default;
|
|
31
|
+
export type { ButtonLinkProps };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Button skin — the base, variant and size classes `Button` and
|
|
3
|
+
* `ButtonLink` both wear. Living in their own module keeps the two
|
|
4
|
+
* components' visual contract in one place (one edit re-skins both) and
|
|
5
|
+
* keeps component files free of style internals; split-css groups the
|
|
6
|
+
* emitted CSS into `haze-ui/css/button.css` with them.
|
|
7
|
+
*/
|
|
8
|
+
export declare const base: import("@linaria/core").LinariaClassName;
|
|
9
|
+
export declare const variants: {
|
|
10
|
+
readonly solid: import("@linaria/core").LinariaClassName;
|
|
11
|
+
readonly outline: import("@linaria/core").LinariaClassName;
|
|
12
|
+
readonly ghost: import("@linaria/core").LinariaClassName;
|
|
13
|
+
};
|
|
14
|
+
export declare const sizeSm: import("@linaria/core").LinariaClassName;
|
|
15
|
+
export declare const sizeMd: import("@linaria/core").LinariaClassName;
|
|
16
|
+
export declare const sizeLg: import("@linaria/core").LinariaClassName;
|
|
17
|
+
export declare const squareSm: import("@linaria/core").LinariaClassName;
|
|
18
|
+
export declare const squareMd: import("@linaria/core").LinariaClassName;
|
|
19
|
+
export declare const squareLg: import("@linaria/core").LinariaClassName;
|
|
20
|
+
export declare const sizes: {
|
|
21
|
+
readonly sm: import("@linaria/core").LinariaClassName;
|
|
22
|
+
readonly md: import("@linaria/core").LinariaClassName;
|
|
23
|
+
readonly lg: import("@linaria/core").LinariaClassName;
|
|
24
|
+
};
|
|
25
|
+
export declare const squareSizes: {
|
|
26
|
+
readonly sm: import("@linaria/core").LinariaClassName;
|
|
27
|
+
readonly md: import("@linaria/core").LinariaClassName;
|
|
28
|
+
readonly lg: import("@linaria/core").LinariaClassName;
|
|
29
|
+
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ export { spacing } from './tokens/spacing';
|
|
|
3
3
|
export { typography } from './tokens/typography';
|
|
4
4
|
export { TOKEN_REGISTRY, COMPONENT_TOKENS } from './tokens/registry';
|
|
5
5
|
export type { TokenDef } from './tokens/registry';
|
|
6
|
-
export { Button } from './components/Button';
|
|
7
|
-
export type { ButtonProps } from './components/Button';
|
|
6
|
+
export { Button, ButtonLink } from './components/Button';
|
|
7
|
+
export type { ButtonProps, ButtonLinkProps } from './components/Button';
|
|
8
8
|
export { Input, InputCore } from './components/Input';
|
|
9
9
|
export type { InputProps, InputCoreProps } from './components/Input';
|
|
10
10
|
export { Select, Option, SelectCore } from './components/Select';
|