haze-ui 1.17.0 → 1.18.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 +8 -7
- package/dist/components/Transfer/Transfer.js +13 -90
- package/dist/components/Transfer/TransferCore.js +90 -0
- package/dist/components/Upload/Upload.js +16 -56
- package/dist/components/Upload/UploadCore.js +64 -0
- package/dist/css/transfer.css +1 -1
- package/dist/css/upload.css +1 -1
- package/dist/haze-ui.css +2 -2
- package/dist/index.js +68 -66
- package/dist/types/components/Transfer/Transfer.d.ts +1 -5
- package/dist/types/components/Transfer/TransferCore.d.ts +19 -0
- package/dist/types/components/Transfer/index.d.ts +2 -0
- package/dist/types/components/Upload/Upload.d.ts +6 -1
- package/dist/types/components/Upload/UploadCore.d.ts +15 -0
- package/dist/types/components/Upload/index.d.ts +2 -0
- package/dist/types/form/FormItem.d.ts +2 -1
- package/dist/types/index.d.ts +4 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -90,8 +90,8 @@ covers both.
|
|
|
90
90
|
react-f0rm owns form field state, and its headless `useField` hook is
|
|
91
91
|
the single binding layer — the same channel its built-in
|
|
92
92
|
`Field`/`Checkbox`/`Select` components use. haze-ui contributes the
|
|
93
|
-
views: controlled cores (`InputCore`, `SelectCore`, `SwitchCore`,
|
|
94
|
-
`
|
|
93
|
+
views: controlled cores (`InputCore`, `SelectCore`, `SwitchCore`, `TextareaCore`,
|
|
94
|
+
`TagInputCore`, `TransferCore`, `UploadCore`, ...) take the plain `{value, onChange}`
|
|
95
95
|
pair with zero adapters, and `FormItem` wraps the hook's state in label,
|
|
96
96
|
error and aria wiring. The sugar components (`Input`, `Select`, ...)
|
|
97
97
|
keep their `ControlOrValue<T>` (`Control<T> | T`) API for standalone use outside forms.
|
|
@@ -224,11 +224,12 @@ rest of the JSX goes straight to it, type-checked against its own props:
|
|
|
224
224
|
|
|
225
225
|
`input` wires the same id/aria/`onBlur`/`onChange`/value contract as `as`
|
|
226
226
|
— every haze core (`InputCore`, `TextareaCore`, `SelectCore`,
|
|
227
|
-
`TagInputCore`, `CheckboxCore`, `SwitchCore`, …)
|
|
228
|
-
`{value, onChange}` pair, so the default adapters need
|
|
229
|
-
(`TagInputCore`'s `onChange` already emits the next `string[]`;
|
|
230
|
-
|
|
231
|
-
`
|
|
227
|
+
`TagInputCore`, `TransferCore`, `UploadCore`, `CheckboxCore`, `SwitchCore`, …)
|
|
228
|
+
speaks the plain `{value, onChange}` pair, so the default adapters need
|
|
229
|
+
nothing (`TagInputCore`'s `onChange` already emits the next `string[]`;
|
|
230
|
+
`TransferCore` emits the next `string[]` plus move metadata, `UploadCore`
|
|
231
|
+
the next `File[]`; a checkbox-style core pairs with `valueToProps`). The
|
|
232
|
+
differences from `as`:
|
|
232
233
|
|
|
233
234
|
- Forwarded props are **type-checked against the core's own props** —
|
|
234
235
|
`input={InputCore} size="xl"` is a compile error, while `asProps` is an
|
|
@@ -1,94 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
5
|
-
import { useState as r } from "react";
|
|
6
|
-
import { useControl as i } from "react-use-control";
|
|
1
|
+
import e from "./TransferCore.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { useControl as n } from "react-use-control";
|
|
7
4
|
//#region src/lib/components/Transfer/Transfer.tsx
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
className:
|
|
17
|
-
children: [
|
|
18
|
-
/* @__PURE__ */ n("div", {
|
|
19
|
-
className: e([o]),
|
|
20
|
-
children: [/* @__PURE__ */ n("div", {
|
|
21
|
-
className: e([s]),
|
|
22
|
-
children: [
|
|
23
|
-
"Source (",
|
|
24
|
-
S.length,
|
|
25
|
-
")"
|
|
26
|
-
]
|
|
27
|
-
}), /* @__PURE__ */ t("div", {
|
|
28
|
-
className: e([c]),
|
|
29
|
-
children: S.map((r) => /* @__PURE__ */ n("label", {
|
|
30
|
-
className: e([l]),
|
|
31
|
-
children: [/* @__PURE__ */ t("input", {
|
|
32
|
-
type: "checkbox",
|
|
33
|
-
checked: v.includes(r.key),
|
|
34
|
-
disabled: r.disabled,
|
|
35
|
-
onChange: () => w(r.key),
|
|
36
|
-
"aria-label": r.title
|
|
37
|
-
}), r.title]
|
|
38
|
-
}, r.key))
|
|
39
|
-
})]
|
|
40
|
-
}),
|
|
41
|
-
/* @__PURE__ */ n("div", {
|
|
42
|
-
className: e([u]),
|
|
43
|
-
children: [/* @__PURE__ */ t("button", {
|
|
44
|
-
type: "button",
|
|
45
|
-
disabled: v.length === 0,
|
|
46
|
-
onClick: () => {
|
|
47
|
-
if (v.length === 0) return;
|
|
48
|
-
let e = [...g, ...v];
|
|
49
|
-
_(e), m?.(e, "right", v), y([]);
|
|
50
|
-
},
|
|
51
|
-
"aria-label": ">",
|
|
52
|
-
className: e([d]),
|
|
53
|
-
children: "›"
|
|
54
|
-
}), /* @__PURE__ */ t("button", {
|
|
55
|
-
type: "button",
|
|
56
|
-
disabled: b.length === 0,
|
|
57
|
-
onClick: () => {
|
|
58
|
-
if (b.length === 0) return;
|
|
59
|
-
let e = g.filter((e) => !b.includes(e));
|
|
60
|
-
_(e), m?.(e, "left", b), x([]);
|
|
61
|
-
},
|
|
62
|
-
"aria-label": "<",
|
|
63
|
-
className: e([d]),
|
|
64
|
-
children: "‹"
|
|
65
|
-
})]
|
|
66
|
-
}),
|
|
67
|
-
/* @__PURE__ */ n("div", {
|
|
68
|
-
className: e([o]),
|
|
69
|
-
children: [/* @__PURE__ */ n("div", {
|
|
70
|
-
className: e([s]),
|
|
71
|
-
children: [
|
|
72
|
-
"Target (",
|
|
73
|
-
C.length,
|
|
74
|
-
")"
|
|
75
|
-
]
|
|
76
|
-
}), /* @__PURE__ */ t("div", {
|
|
77
|
-
className: e([c]),
|
|
78
|
-
children: C.map((r) => /* @__PURE__ */ n("label", {
|
|
79
|
-
className: e([l]),
|
|
80
|
-
children: [/* @__PURE__ */ t("input", {
|
|
81
|
-
type: "checkbox",
|
|
82
|
-
checked: b.includes(r.key),
|
|
83
|
-
disabled: r.disabled,
|
|
84
|
-
onChange: () => T(r.key),
|
|
85
|
-
"aria-label": r.title
|
|
86
|
-
}), r.title]
|
|
87
|
-
}, r.key))
|
|
88
|
-
})]
|
|
89
|
-
})
|
|
90
|
-
]
|
|
5
|
+
function r({ dataSource: r, targetKeys: i, onChange: a, className: o }) {
|
|
6
|
+
let [s, c] = n(i, []);
|
|
7
|
+
return /* @__PURE__ */ t(e, {
|
|
8
|
+
dataSource: r,
|
|
9
|
+
value: s,
|
|
10
|
+
onChange: (e, t, n) => {
|
|
11
|
+
c(e), a?.(e, t, n);
|
|
12
|
+
},
|
|
13
|
+
className: o
|
|
91
14
|
});
|
|
92
15
|
}
|
|
93
16
|
//#endregion
|
|
94
|
-
export {
|
|
17
|
+
export { r as default };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
|
|
2
|
+
import { classnames as e } from "../../utils/classnames.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
5
|
+
import { useState as r } from "react";
|
|
6
|
+
//#region src/lib/components/Transfer/TransferCore.tsx
|
|
7
|
+
var i = "haze-TransferCore__container", a = "haze-TransferCore__panel", o = "haze-TransferCore__panelHeader", s = "haze-TransferCore__panelBody", c = "haze-TransferCore__itemStyle", l = "haze-TransferCore__actions", u = "haze-TransferCore__actionBtn";
|
|
8
|
+
function d({ dataSource: d, value: f, onChange: p, className: m, ...h }) {
|
|
9
|
+
let [g, _] = r([]), [v, y] = r([]), b = d.filter((e) => !f.includes(e.key)), x = d.filter((e) => f.includes(e.key)), S = (e) => {
|
|
10
|
+
_((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
11
|
+
}, C = (e) => {
|
|
12
|
+
y((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
13
|
+
}, w = () => {
|
|
14
|
+
g.length !== 0 && (p([...f, ...g], "right", g), _([]));
|
|
15
|
+
}, T = () => {
|
|
16
|
+
v.length !== 0 && (p(f.filter((e) => !v.includes(e)), "left", v), y([]));
|
|
17
|
+
};
|
|
18
|
+
return /* @__PURE__ */ n("div", {
|
|
19
|
+
...h,
|
|
20
|
+
className: e([i, m]),
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ n("div", {
|
|
23
|
+
className: e([a]),
|
|
24
|
+
children: [/* @__PURE__ */ n("div", {
|
|
25
|
+
className: e([o]),
|
|
26
|
+
children: [
|
|
27
|
+
"Source (",
|
|
28
|
+
b.length,
|
|
29
|
+
")"
|
|
30
|
+
]
|
|
31
|
+
}), /* @__PURE__ */ t("div", {
|
|
32
|
+
className: e([s]),
|
|
33
|
+
children: b.map((r) => /* @__PURE__ */ n("label", {
|
|
34
|
+
className: e([c]),
|
|
35
|
+
children: [/* @__PURE__ */ t("input", {
|
|
36
|
+
type: "checkbox",
|
|
37
|
+
checked: g.includes(r.key),
|
|
38
|
+
disabled: r.disabled,
|
|
39
|
+
onChange: () => S(r.key),
|
|
40
|
+
"aria-label": r.title
|
|
41
|
+
}), r.title]
|
|
42
|
+
}, r.key))
|
|
43
|
+
})]
|
|
44
|
+
}),
|
|
45
|
+
/* @__PURE__ */ n("div", {
|
|
46
|
+
className: e([l]),
|
|
47
|
+
children: [/* @__PURE__ */ t("button", {
|
|
48
|
+
type: "button",
|
|
49
|
+
disabled: g.length === 0,
|
|
50
|
+
onClick: w,
|
|
51
|
+
"aria-label": ">",
|
|
52
|
+
className: e([u]),
|
|
53
|
+
children: "›"
|
|
54
|
+
}), /* @__PURE__ */ t("button", {
|
|
55
|
+
type: "button",
|
|
56
|
+
disabled: v.length === 0,
|
|
57
|
+
onClick: T,
|
|
58
|
+
"aria-label": "<",
|
|
59
|
+
className: e([u]),
|
|
60
|
+
children: "‹"
|
|
61
|
+
})]
|
|
62
|
+
}),
|
|
63
|
+
/* @__PURE__ */ n("div", {
|
|
64
|
+
className: e([a]),
|
|
65
|
+
children: [/* @__PURE__ */ n("div", {
|
|
66
|
+
className: e([o]),
|
|
67
|
+
children: [
|
|
68
|
+
"Target (",
|
|
69
|
+
x.length,
|
|
70
|
+
")"
|
|
71
|
+
]
|
|
72
|
+
}), /* @__PURE__ */ t("div", {
|
|
73
|
+
className: e([s]),
|
|
74
|
+
children: x.map((r) => /* @__PURE__ */ n("label", {
|
|
75
|
+
className: e([c]),
|
|
76
|
+
children: [/* @__PURE__ */ t("input", {
|
|
77
|
+
type: "checkbox",
|
|
78
|
+
checked: v.includes(r.key),
|
|
79
|
+
disabled: r.disabled,
|
|
80
|
+
onChange: () => C(r.key),
|
|
81
|
+
"aria-label": r.title
|
|
82
|
+
}), r.title]
|
|
83
|
+
}, r.key))
|
|
84
|
+
})]
|
|
85
|
+
})
|
|
86
|
+
]
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
//#endregion
|
|
90
|
+
export { d as default };
|
|
@@ -1,60 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
-
import { useCallback as i, useRef as a } from "react";
|
|
1
|
+
import e from "./UploadCore.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { useControl as n } from "react-use-control";
|
|
6
4
|
//#region src/lib/components/Upload/Upload.tsx
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
e.preventDefault();
|
|
20
|
-
}, []);
|
|
21
|
-
return /* @__PURE__ */ r("div", {
|
|
22
|
-
onClick: h,
|
|
23
|
-
onDrop: _,
|
|
24
|
-
onDragOver: v,
|
|
25
|
-
role: "button",
|
|
26
|
-
tabIndex: 0,
|
|
27
|
-
className: e([o, f]),
|
|
28
|
-
children: [/* @__PURE__ */ n("input", {
|
|
29
|
-
ref: m,
|
|
30
|
-
type: "file",
|
|
31
|
-
accept: l,
|
|
32
|
-
multiple: u,
|
|
33
|
-
onChange: g,
|
|
34
|
-
hidden: !0,
|
|
35
|
-
className: e([c])
|
|
36
|
-
}), p || /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ r("svg", {
|
|
37
|
-
width: "40",
|
|
38
|
-
height: "40",
|
|
39
|
-
viewBox: "0 0 24 24",
|
|
40
|
-
fill: "none",
|
|
41
|
-
stroke: "currentColor",
|
|
42
|
-
strokeWidth: "2",
|
|
43
|
-
strokeLinecap: "round",
|
|
44
|
-
strokeLinejoin: "round",
|
|
45
|
-
className: e([s]),
|
|
46
|
-
children: [
|
|
47
|
-
/* @__PURE__ */ n("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
48
|
-
/* @__PURE__ */ n("polyline", { points: "17 8 12 3 7 8" }),
|
|
49
|
-
/* @__PURE__ */ n("line", {
|
|
50
|
-
x1: "12",
|
|
51
|
-
y1: "3",
|
|
52
|
-
x2: "12",
|
|
53
|
-
y2: "15"
|
|
54
|
-
})
|
|
55
|
-
]
|
|
56
|
-
}), /* @__PURE__ */ n("div", { children: "Drag & drop files here, or click to upload" })] })]
|
|
5
|
+
function r({ value: r, accept: i, multiple: a = !1, onChange: o, className: s, children: c }) {
|
|
6
|
+
let [l, u] = n(r, []);
|
|
7
|
+
return /* @__PURE__ */ t(e, {
|
|
8
|
+
value: l,
|
|
9
|
+
onChange: (e) => {
|
|
10
|
+
let t = e.filter((e) => !l.includes(e));
|
|
11
|
+
u(e), o?.(t);
|
|
12
|
+
},
|
|
13
|
+
accept: i,
|
|
14
|
+
multiple: a,
|
|
15
|
+
className: s,
|
|
16
|
+
children: c
|
|
57
17
|
});
|
|
58
18
|
}
|
|
59
19
|
//#endregion
|
|
60
|
-
export {
|
|
20
|
+
export { r as default };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
|
|
2
|
+
import { classnames as e } from "../../utils/classnames.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
+
import { useCallback as i, useRef as a } from "react";
|
|
6
|
+
//#region src/lib/components/Upload/UploadCore.tsx
|
|
7
|
+
var o = "haze-UploadCore__dropzone", s = "haze-UploadCore__iconStyle", c = "haze-UploadCore__hiddenInput";
|
|
8
|
+
function l({ value: l, onChange: u, accept: d, multiple: f = !1, className: p, children: m, ...h }) {
|
|
9
|
+
let g = a(null), _ = i((e) => {
|
|
10
|
+
e.length !== 0 && u(f ? [...l, ...e] : e);
|
|
11
|
+
}, [
|
|
12
|
+
l,
|
|
13
|
+
f,
|
|
14
|
+
u
|
|
15
|
+
]), v = i(() => {
|
|
16
|
+
g.current?.click();
|
|
17
|
+
}, []), y = i((e) => {
|
|
18
|
+
_(Array.from(e.target.files || [])), e.target.value = "";
|
|
19
|
+
}, [_]), b = i((e) => {
|
|
20
|
+
e.preventDefault(), _(Array.from(e.dataTransfer.files));
|
|
21
|
+
}, [_]), x = i((e) => {
|
|
22
|
+
e.preventDefault();
|
|
23
|
+
}, []);
|
|
24
|
+
return /* @__PURE__ */ r("div", {
|
|
25
|
+
...h,
|
|
26
|
+
onClick: v,
|
|
27
|
+
onDrop: b,
|
|
28
|
+
onDragOver: x,
|
|
29
|
+
role: "button",
|
|
30
|
+
tabIndex: 0,
|
|
31
|
+
className: e([o, p]),
|
|
32
|
+
children: [/* @__PURE__ */ n("input", {
|
|
33
|
+
ref: g,
|
|
34
|
+
type: "file",
|
|
35
|
+
accept: d,
|
|
36
|
+
multiple: f,
|
|
37
|
+
onChange: y,
|
|
38
|
+
hidden: !0,
|
|
39
|
+
className: e([c])
|
|
40
|
+
}), m || /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ r("svg", {
|
|
41
|
+
width: "40",
|
|
42
|
+
height: "40",
|
|
43
|
+
viewBox: "0 0 24 24",
|
|
44
|
+
fill: "none",
|
|
45
|
+
stroke: "currentColor",
|
|
46
|
+
strokeWidth: "2",
|
|
47
|
+
strokeLinecap: "round",
|
|
48
|
+
strokeLinejoin: "round",
|
|
49
|
+
className: e([s]),
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ n("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
52
|
+
/* @__PURE__ */ n("polyline", { points: "17 8 12 3 7 8" }),
|
|
53
|
+
/* @__PURE__ */ n("line", {
|
|
54
|
+
x1: "12",
|
|
55
|
+
y1: "3",
|
|
56
|
+
x2: "12",
|
|
57
|
+
y2: "15"
|
|
58
|
+
})
|
|
59
|
+
]
|
|
60
|
+
}), /* @__PURE__ */ n("div", { children: "Drag & drop files here, or click to upload" })] })]
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
export { l as default };
|
package/dist/css/transfer.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* haze-ui transfer — generated by scripts/split-css.mjs, do not edit */
|
|
2
|
-
.haze-
|
|
2
|
+
.haze-TransferCore__container{-webkit-box-flex-wrap:wrap;gap:var(--haze-space-4);font-family:var(--haze-font-sans);flex-wrap:wrap;display:flex}.haze-TransferCore__panel{border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-md);flex:1;min-width:200px;overflow:hidden}.haze-TransferCore__panelHeader{padding:var(--haze-space-2) var(--haze-space-3);border-bottom:1px solid var(--haze-color-border);background:var(--haze-color-bg-subtle);font-size:var(--haze-text-sm);font-weight:var(--haze-weight-medium);color:var(--haze-color-text-secondary)}.haze-TransferCore__panelBody{max-height:200px;padding:var(--haze-space-1);overflow-y:auto}.haze-TransferCore__itemStyle{align-items:center;gap:var(--haze-space-2);padding:var(--haze-space-1) var(--haze-space-2);border-radius:var(--haze-radius-sm);font-size:var(--haze-text-sm);cursor:pointer;display:flex}.haze-TransferCore__itemStyle:hover{background:var(--haze-color-bg-subtle)}.haze-TransferCore__actions{justify-content:center;align-items:center;gap:var(--haze-space-2);flex-direction:column;display:flex}.haze-TransferCore__actionBtn{border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-md);background:var(--haze-color-bg);width:2.25rem;height:2.25rem;color:var(--haze-color-text);font-size:var(--haze-text-sm);cursor:pointer;justify-content:center;align-items:center;display:inline-flex}.haze-TransferCore__actionBtn:hover:not(:disabled){background:var(--haze-color-bg-subtle);border-color:var(--haze-color-border-hover)}.haze-TransferCore__actionBtn:disabled{opacity:.5;cursor:not-allowed}
|
package/dist/css/upload.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* haze-ui upload — generated by scripts/split-css.mjs, do not edit */
|
|
2
|
-
.haze-
|
|
2
|
+
.haze-UploadCore__dropzone{padding:var(--haze-space-8) var(--haze-space-4);border:2px dashed var(--haze-color-border);border-radius:var(--haze-radius-lg);background:var(--haze-color-bg-subtle);color:var(--haze-color-text-muted);font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);cursor:pointer;text-align:center;flex-direction:column;justify-content:center;align-items:center;transition:border-color .15s,background .15s;display:flex}.haze-UploadCore__dropzone:hover{border-color:var(--haze-color-primary);background:var(--haze-color-primary-subtle)}.haze-UploadCore__iconStyle{margin-bottom:var(--haze-space-3);color:var(--haze-color-text-muted)}.haze-UploadCore__hiddenInput{display:none}
|
package/dist/haze-ui.css
CHANGED
|
@@ -121,9 +121,9 @@
|
|
|
121
121
|
.haze-ToolCallCard__card{border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-md);font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);overflow:hidden}.haze-ToolCallCard__header{align-items:center;gap:var(--haze-space-2);padding:var(--haze-space-2) var(--haze-space-3);background:var(--haze-color-muted);font-family:var(--haze-font-mono);font-size:var(--haze-text-xs);display:flex}.haze-ToolCallCard__statusIcon{border-radius:var(--haze-radius-full);flex-shrink:0;width:.5rem;height:.5rem}.haze-ToolCallCard__statusPending{background:var(--haze-color-text-muted)}.haze-ToolCallCard__statusRunning{background:var(--haze-color-primary);animation:1.5s infinite pulse}.haze-ToolCallCard__statusDone{background:var(--haze-color-success,#16a34a)}.haze-ToolCallCard__statusError{background:var(--haze-color-danger,#dc2626)}.haze-ToolCallCard__body{padding:var(--haze-space-3)}.haze-ToolCallCard__section{margin-bottom:var(--haze-space-2)}.haze-ToolCallCard__sectionLabel{font-size:var(--haze-text-xs);color:var(--haze-color-text-muted);margin-bottom:var(--haze-space-1);text-transform:uppercase;letter-spacing:.05em}.haze-ToolCallCard__content{font-family:var(--haze-font-mono);font-size:var(--haze-text-xs);white-space:pre-wrap;word-break:break-all;color:var(--haze-color-text)}
|
|
122
122
|
.haze-Tooltip__wrapper{display:inline-flex;position:relative}.haze-Tooltip__bubble{padding:var(--haze-space-1) var(--haze-space-2);border-radius:var(--haze-radius-md);background:var(--haze-color-text);color:var(--haze-color-text-inverse);font-family:var(--haze-font-sans);font-size:var(--haze-text-xs);line-height:var(--haze-leading-normal);white-space:nowrap;pointer-events:none}
|
|
123
123
|
.haze-floating__floatingNative{margin:0;inset:auto}.haze-floating__floatingAnchored{position-anchor:var(--haze-floating-anchor)}.haze-floating__floatingFixed{position:fixed}.haze-floating__floatingHidden{display:none}.haze-floating__anchoredBottom{position-area:bottom left;margin-top:var(--haze-space-1);position-try-fallbacks:flip-block}.haze-floating__anchoredBottomSpan{position-area:bottom span-left;margin-top:var(--haze-space-1);position-try-fallbacks:flip-block}.haze-floating__anchoredBottomCenter{position-area:bottom center;margin-top:var(--haze-space-1);position-try-fallbacks:flip-block}.haze-floating__anchoredBottomEnd{position-area:bottom right;margin-top:var(--haze-space-1);position-try-fallbacks:flip-block}.haze-floating__anchoredTop{position-area:top center;margin-bottom:var(--haze-space-1);position-try-fallbacks:flip-block}.haze-floating__anchoredLeft{position-area:left center;margin-right:var(--haze-space-1);position-try-fallbacks:flip-inline}.haze-floating__anchoredRight{position-area:right center;margin-left:var(--haze-space-1);position-try-fallbacks:flip-inline}.haze-floating__fallbackBottom{z-index:1000;margin-top:var(--haze-space-1);position:absolute;top:100%;left:0}.haze-floating__fallbackBottomCenter{z-index:1000;margin-top:var(--haze-space-1);position:absolute;top:100%;left:50%;transform:translate(-50%)}.haze-floating__fallbackBottomEnd{z-index:1000;margin-top:var(--haze-space-1);position:absolute;top:100%;right:0}.haze-floating__fallbackTop{z-index:1000;margin-bottom:var(--haze-space-1);position:absolute;bottom:100%;left:50%;transform:translate(-50%)}.haze-floating__fallbackLeft{z-index:1000;margin-right:var(--haze-space-1);position:absolute;top:50%;right:100%;transform:translateY(-50%)}.haze-floating__fallbackRight{z-index:1000;margin-left:var(--haze-space-1);position:absolute;top:50%;left:100%;transform:translateY(-50%)}.haze-floating__gapBelow{margin-top:var(--haze-space-1)}.haze-floating__gapAbove{margin-bottom:var(--haze-space-1)}.haze-floating__gapBefore{margin-right:var(--haze-space-1)}.haze-floating__gapAfter{margin-left:var(--haze-space-1)}
|
|
124
|
-
.haze-
|
|
124
|
+
.haze-TransferCore__container{-webkit-box-flex-wrap:wrap;gap:var(--haze-space-4);font-family:var(--haze-font-sans);flex-wrap:wrap;display:flex}.haze-TransferCore__panel{border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-md);flex:1;min-width:200px;overflow:hidden}.haze-TransferCore__panelHeader{padding:var(--haze-space-2) var(--haze-space-3);border-bottom:1px solid var(--haze-color-border);background:var(--haze-color-bg-subtle);font-size:var(--haze-text-sm);font-weight:var(--haze-weight-medium);color:var(--haze-color-text-secondary)}.haze-TransferCore__panelBody{max-height:200px;padding:var(--haze-space-1);overflow-y:auto}.haze-TransferCore__itemStyle{align-items:center;gap:var(--haze-space-2);padding:var(--haze-space-1) var(--haze-space-2);border-radius:var(--haze-radius-sm);font-size:var(--haze-text-sm);cursor:pointer;display:flex}.haze-TransferCore__itemStyle:hover{background:var(--haze-color-bg-subtle)}.haze-TransferCore__actions{justify-content:center;align-items:center;gap:var(--haze-space-2);flex-direction:column;display:flex}.haze-TransferCore__actionBtn{border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-md);background:var(--haze-color-bg);width:2.25rem;height:2.25rem;color:var(--haze-color-text);font-size:var(--haze-text-sm);cursor:pointer;justify-content:center;align-items:center;display:inline-flex}.haze-TransferCore__actionBtn:hover:not(:disabled){background:var(--haze-color-bg-subtle);border-color:var(--haze-color-border-hover)}.haze-TransferCore__actionBtn:disabled{opacity:.5;cursor:not-allowed}
|
|
125
125
|
.haze-Tree__base{font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);color:var(--haze-color-text);overflow:auto}.haze-Tree__group{min-width:0}
|
|
126
126
|
.haze-TreeItem__item{cursor:pointer;-webkit-user-select:none;user-select:none;border-radius:var(--haze-radius-sm);align-items:center;min-height:2rem;padding:2px 0;transition:background .15s;display:flex}.haze-TreeItem__item:hover{background:var(--haze-color-bg-subtle)}.haze-TreeItem__item:focus-visible{box-shadow:inset 0 0 0 2px var(--haze-color-focus-ring);outline:none}.haze-TreeItem__blockItem{padding:var(--haze-space-1) var(--haze-space-2);border-radius:var(--haze-radius-sm)}.haze-TreeItem__blockItem:hover{background:var(--haze-color-bg-subtle)}.haze-TreeItem__selectedStyle{background:var(--haze-color-primary-subtle);color:var(--haze-color-primary);font-weight:var(--haze-weight-medium)}.haze-TreeItem__disabledStyle{opacity:.5;cursor:not-allowed;pointer-events:none}.haze-TreeItem__switcher{cursor:pointer;width:1.5rem;height:1.5rem;color:var(--haze-color-text-muted);-webkit-transition:-webkit-transform .2s;flex-shrink:0;justify-content:center;align-items:center;transition:transform .2s;display:inline-flex}.haze-TreeItem__switcher:hover{color:var(--haze-color-text)}.haze-TreeItem__switcher svg{width:12px;height:12px}.haze-TreeItem__switcherExpanded{transform:rotate(90deg)}.haze-TreeItem__checkbox{width:1.25rem;height:1.25rem;margin-right:var(--haze-space-2);border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-sm);background:var(--haze-color-bg);cursor:pointer;flex-shrink:0;justify-content:center;align-items:center;transition:all .15s;display:inline-flex}.haze-TreeItem__checkbox:hover{border-color:var(--haze-color-primary)}.haze-TreeItem__checkbox svg{color:#fff;width:12px;height:12px}.haze-TreeItem__checkboxChecked,.haze-TreeItem__checkboxHalfChecked{background:var(--haze-color-primary);border-color:var(--haze-color-primary)}.haze-TreeItem__nodeIcon{width:16px;height:16px;margin-right:var(--haze-space-2);color:var(--haze-color-text-muted);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.haze-TreeItem__nodeIcon svg{width:16px;height:16px}.haze-TreeItem__title{font-size:var(--haze-text-sm);color:var(--haze-color-text);text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.haze-TreeItem__loadingIcon{animation:1s linear infinite spin-haze-TreeItem__loadingIcon;display:inline-flex}@keyframes spin-haze-TreeItem__loadingIcon{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.haze-TreeItem__indentLine{flex-shrink:0;width:24px;display:inline-block}.haze-TreeItem__indentLineWithBorder{border-left:1px solid var(--haze-color-border)}
|
|
127
127
|
.haze-Typography__titleBase{font-family:var(--haze-font-sans);font-weight:var(--haze-weight-bold);color:var(--haze-color-text);margin:0}.haze-Typography__1{font-size:var(--haze-text-3xl);line-height:var(--haze-leading-tight)}.haze-Typography__2{font-size:var(--haze-text-2xl);line-height:var(--haze-leading-tight)}.haze-Typography__3{font-size:var(--haze-text-xl);line-height:var(--haze-leading-tight)}.haze-Typography__4{font-size:var(--haze-text-lg);line-height:var(--haze-leading-normal)}.haze-Typography__5{font-size:var(--haze-text-base);line-height:var(--haze-leading-normal)}.haze-Typography__textBase{font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);line-height:var(--haze-leading-normal)}.haze-Typography__default{color:var(--haze-color-text)}.haze-Typography__secondary{color:var(--haze-color-text-secondary)}.haze-Typography__muted{color:var(--haze-color-text-muted)}.haze-Typography__textStrong{font-weight:var(--haze-weight-bold)}.haze-Typography__textCode{font-family:var(--haze-font-mono);font-size:var(--haze-text-xs);padding:var(--haze-space-0) var(--haze-space-1);background:var(--haze-color-bg-muted);border-radius:var(--haze-radius-sm)}.haze-Typography__textMark{background:color-mix(in srgb, var(--haze-color-warning) 25%, transparent);padding:0 var(--haze-space-1)}.haze-Typography__paragraphBase{font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);line-height:var(--haze-leading-relaxed);color:var(--haze-color-text);margin:0 0 var(--haze-space-4)}
|
|
128
|
-
.haze-
|
|
128
|
+
.haze-UploadCore__dropzone{padding:var(--haze-space-8) var(--haze-space-4);border:2px dashed var(--haze-color-border);border-radius:var(--haze-radius-lg);background:var(--haze-color-bg-subtle);color:var(--haze-color-text-muted);font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);cursor:pointer;text-align:center;flex-direction:column;justify-content:center;align-items:center;transition:border-color .15s,background .15s;display:flex}.haze-UploadCore__dropzone:hover{border-color:var(--haze-color-primary);background:var(--haze-color-primary-subtle)}.haze-UploadCore__iconStyle{margin-bottom:var(--haze-space-3);color:var(--haze-color-text-muted)}.haze-UploadCore__hiddenInput{display:none}
|
|
129
129
|
.haze-VirtualList__container{font-family:var(--haze-font-sans);overflow-y:auto}.haze-VirtualList__viewport{width:100%;position:relative}
|
package/dist/index.js
CHANGED
|
@@ -76,69 +76,71 @@ import Se from "./components/Stepper/Step.js";
|
|
|
76
76
|
import Ce, { CommandInput as we, CommandItem as Te, CommandList as Ee } from "./components/Command/Command.js";
|
|
77
77
|
import { ResizableGroup as De, ResizableHandle as Oe, ResizablePanel as ke } from "./components/Resizable/Resizable.js";
|
|
78
78
|
import { Collapsible as Ae, CollapsibleContent as je, CollapsibleTrigger as Me } from "./components/Collapsible/Collapsible.js";
|
|
79
|
-
import Ne from "./components/Transfer/
|
|
80
|
-
import Pe from "./components/
|
|
81
|
-
import Fe from "./components/
|
|
82
|
-
import Ie from "./components/
|
|
83
|
-
import Le from "./components/
|
|
84
|
-
import Re from "./components/
|
|
85
|
-
import
|
|
86
|
-
import
|
|
87
|
-
import {
|
|
88
|
-
import
|
|
89
|
-
import qe from "./components/
|
|
90
|
-
import Je from "./components/
|
|
91
|
-
import Ye from "./components/
|
|
92
|
-
import Xe from "./components/
|
|
93
|
-
import Ze from "./components/
|
|
94
|
-
import Qe from "./components/
|
|
95
|
-
import $e from "./components/
|
|
96
|
-
import et from "./components/
|
|
97
|
-
import tt from "./components/
|
|
98
|
-
import nt from "./components/
|
|
99
|
-
import rt from "./components/
|
|
100
|
-
import it from "./components/
|
|
101
|
-
import at from "./components/
|
|
102
|
-
import ot from "./components/
|
|
103
|
-
import st from "./components/
|
|
104
|
-
import ct from "./components/
|
|
105
|
-
import lt from "./components/DropdownMenu/
|
|
106
|
-
import ut from "./components/DropdownMenu/
|
|
107
|
-
import dt from "./components/DropdownMenu/
|
|
108
|
-
import ft from "./components/
|
|
109
|
-
import pt from "./components/
|
|
110
|
-
import mt from "./components/ContextMenu/
|
|
111
|
-
import ht from "./components/ContextMenu/
|
|
112
|
-
import gt from "./components/ContextMenu/
|
|
113
|
-
import _t from "./components/
|
|
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/
|
|
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 from "./components/
|
|
134
|
-
import Rt
|
|
135
|
-
import
|
|
136
|
-
import Vt from "./components/
|
|
137
|
-
import Ht from "./components/
|
|
138
|
-
import Ut from "./components/
|
|
139
|
-
import Wt from "./components/
|
|
140
|
-
import Gt from "./components/
|
|
141
|
-
import Kt from "./components/
|
|
142
|
-
import qt from "./
|
|
143
|
-
import
|
|
144
|
-
|
|
79
|
+
import Ne from "./components/Transfer/TransferCore.js";
|
|
80
|
+
import Pe from "./components/Transfer/Transfer.js";
|
|
81
|
+
import Fe from "./components/Upload/UploadCore.js";
|
|
82
|
+
import Ie from "./components/Upload/Upload.js";
|
|
83
|
+
import Le from "./components/ColorPicker/ColorPickerCore.js";
|
|
84
|
+
import Re from "./components/ColorPicker/ColorPicker.js";
|
|
85
|
+
import ze from "./components/Rating/RatingCore.js";
|
|
86
|
+
import Be from "./components/Rating/Rating.js";
|
|
87
|
+
import { Timeline as Ve, TimelineItem as He } from "./components/Timeline/Timeline.js";
|
|
88
|
+
import { Paragraph as Ue, Text as We, Title as Ge } from "./components/Typography/Typography.js";
|
|
89
|
+
import { Stat as Ke, StatGroup as qe } from "./components/Stat/Stat.js";
|
|
90
|
+
import Je from "./components/Segmented/SegmentedCore.js";
|
|
91
|
+
import Ye from "./components/Segmented/Segmented.js";
|
|
92
|
+
import Xe from "./components/Chip/Chip.js";
|
|
93
|
+
import Ze from "./components/ScrollArea/ScrollArea.js";
|
|
94
|
+
import Qe from "./components/TimePicker/TimePickerCore.js";
|
|
95
|
+
import $e from "./components/TimePicker/TimePicker.js";
|
|
96
|
+
import et from "./components/DateRangePicker/DateRangePickerCore.js";
|
|
97
|
+
import tt from "./components/DateRangePicker/DateRangePicker.js";
|
|
98
|
+
import nt from "./components/OTPInput/OTPInputCore.js";
|
|
99
|
+
import rt from "./components/OTPInput/OTPInput.js";
|
|
100
|
+
import it from "./components/PasswordInput/PasswordInputCore.js";
|
|
101
|
+
import at from "./components/PasswordInput/PasswordInput.js";
|
|
102
|
+
import ot from "./components/TagInput/TagInputCore.js";
|
|
103
|
+
import st from "./components/TagInput/TagInput.js";
|
|
104
|
+
import ct from "./components/InlineEdit/InlineEdit.js";
|
|
105
|
+
import lt from "./components/DropdownMenu/DropdownMenu.js";
|
|
106
|
+
import ut from "./components/DropdownMenu/DropdownMenuTrigger.js";
|
|
107
|
+
import dt from "./components/DropdownMenu/DropdownMenuContent.js";
|
|
108
|
+
import ft from "./components/DropdownMenu/DropdownMenuItem.js";
|
|
109
|
+
import pt from "./components/DropdownMenu/DropdownMenuSeparator.js";
|
|
110
|
+
import mt from "./components/ContextMenu/ContextMenu.js";
|
|
111
|
+
import ht from "./components/ContextMenu/ContextMenuTrigger.js";
|
|
112
|
+
import gt from "./components/ContextMenu/ContextMenuContent.js";
|
|
113
|
+
import _t from "./components/ContextMenu/ContextMenuItem.js";
|
|
114
|
+
import vt from "./components/ContextMenu/ContextMenuSeparator.js";
|
|
115
|
+
import yt from "./components/NavigationBar/NavigationBar.js";
|
|
116
|
+
import bt from "./components/NavigationBar/NavLink.js";
|
|
117
|
+
import xt from "./components/BackToTop/BackToTop.js";
|
|
118
|
+
import St from "./components/Affix/Affix.js";
|
|
119
|
+
import Ct from "./components/Container/Container.js";
|
|
120
|
+
import wt from "./components/Banner/Banner.js";
|
|
121
|
+
import Tt from "./components/ConfirmDialog/ConfirmDialog.js";
|
|
122
|
+
import Et from "./components/CodeBlock/CodeBlock.js";
|
|
123
|
+
import Dt from "./components/AspectRatio/AspectRatio.js";
|
|
124
|
+
import Ot from "./components/VirtualList/VirtualList.js";
|
|
125
|
+
import kt from "./components/TagGroup/TagGroup.js";
|
|
126
|
+
import At from "./components/TagGroup/TagGroupItem.js";
|
|
127
|
+
import jt from "./components/BottomSheet/BottomSheet.js";
|
|
128
|
+
import Mt from "./components/SwipeAction/SwipeAction.js";
|
|
129
|
+
import Nt from "./components/ChatMessage/ChatMessage.js";
|
|
130
|
+
import Pt from "./components/ChatContainer/ChatContainer.js";
|
|
131
|
+
import Ft from "./components/ChatInput/ChatInput.js";
|
|
132
|
+
import It from "./components/StreamingText/StreamingText.js";
|
|
133
|
+
import Lt from "./components/MarkdownRenderer/MarkdownRenderer.js";
|
|
134
|
+
import Rt from "./components/ToolCallCard/ToolCallCard.js";
|
|
135
|
+
import zt from "./components/ThinkingIndicator/ThinkingIndicator.js";
|
|
136
|
+
import Bt, { StepTimelineItem as Vt } from "./components/StepTimeline/StepTimeline.js";
|
|
137
|
+
import Ht from "./components/ApprovalCard/ApprovalCard.js";
|
|
138
|
+
import Ut from "./components/TokenCounter/TokenCounter.js";
|
|
139
|
+
import Wt from "./components/ModelPicker/ModelPicker.js";
|
|
140
|
+
import Gt from "./components/ConversationList/ConversationList.js";
|
|
141
|
+
import Kt from "./components/ConversationList/ConversationItem.js";
|
|
142
|
+
import qt from "./components/DiffViewer/DiffViewer.js";
|
|
143
|
+
import Jt from "./components/LogViewer/LogViewer.js";
|
|
144
|
+
import Yt from "./form/FormItem.js";
|
|
145
|
+
import { useControl as Xt } from "react-use-control";
|
|
146
|
+
export { N as Accordion, P as AccordionItem, St as Affix, F as Alert, Ht as ApprovalCard, Dt as AspectRatio, I as Avatar, xt as BackToTop, _ as Badge, wt as Banner, jt 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, Pt as ChatContainer, Ft as ChatInput, Nt as ChatMessage, m as Checkbox, p as CheckboxCore, Xe as Chip, Et as CodeBlock, Ae as Collapsible, je as CollapsibleContent, Me as CollapsibleTrigger, Re as ColorPicker, Le as ColorPickerCore, ne as Combobox, Ce as Command, we as CommandInput, Te as CommandItem, Ee as CommandList, Tt as ConfirmDialog, Ct as Container, mt as ContextMenu, gt as ContextMenuContent, _t as ContextMenuItem, vt as ContextMenuSeparator, ht as ContextMenuTrigger, Kt as ConversationItem, Gt as ConversationList, tt as DateRangePicker, et as DateRangePickerCore, de as Datepicker, ue as DatepickerCore, v as Dialog, qt as DiffViewer, W as Disclosure, pe as Divider, be as Drawer, lt as DropdownMenu, dt as DropdownMenuContent, ft as DropdownMenuItem, pt as DropdownMenuSeparator, ut as DropdownMenuTrigger, he as Empty, X as FileInput, V as Flex, Yt as FormItem, ve as Grid, ye as GridItem, z as Icon, B as Image, ct as InlineEdit, l as Input, c as InputCore, ee as List, te as ListItem, Jt as LogViewer, Lt as MarkdownRenderer, G as Menu, q as MenuDivider, K as MenuItem, Wt as ModelPicker, bt as NavLink, yt as NavigationBar, Y as NumberInput, J as NumberInputCore, rt as OTPInput, nt as OTPInputCore, f as Option, _e as Pagination, Ue as Paragraph, at as PasswordInput, it as PasswordInputCore, b as Popover, ge as Progress, S as Radio, w as RadioGroup, C as RadioGroupCore, Be as Rating, ze as RatingCore, De as ResizableGroup, Oe as ResizableHandle, ke as ResizablePanel, Ze as ScrollArea, Ye as Segmented, Je as SegmentedCore, d as Select, u as SelectCore, R as Skeleton, O as Slider, D as SliderCore, me as Spinner, Ke as Stat, qe as StatGroup, Se as Step, Bt as StepTimeline, Vt as StepTimelineItem, xe as Stepper, It as StreamingText, Mt 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, kt as TagGroup, At as TagGroupItem, st as TagInput, ot as TagInputCore, We as Text, E as Textarea, T as TextareaCore, zt as ThinkingIndicator, $e as TimePicker, Qe as TimePickerCore, Ve as Timeline, He as TimelineItem, Ge as Title, Z as Toast, Q as ToastContainer, Ut as TokenCounter, Rt as ToolCallCard, y as Tooltip, Pe as Transfer, Ne as TransferCore, fe as Tree, Ie as Upload, Fe as UploadCore, Ot as VirtualList, e as darkTheme, t as lightTheme, n as spacing, r as typography, Xt as useControl, $ as useToast };
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import type { ControlOrValue } from 'react-use-control';
|
|
2
|
-
type TransferItem
|
|
3
|
-
key: string;
|
|
4
|
-
title: string;
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
};
|
|
2
|
+
import type { TransferItem } from './TransferCore';
|
|
7
3
|
type TransferProps = {
|
|
8
4
|
dataSource: TransferItem[];
|
|
9
5
|
targetKeys?: ControlOrValue<string[]>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
type TransferItem = {
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
};
|
|
7
|
+
type TransferCoreProps = {
|
|
8
|
+
dataSource: TransferItem[];
|
|
9
|
+
/** Keys currently on the target side — the field value, emitted
|
|
10
|
+
* verbatim by `onChange`. */
|
|
11
|
+
value: string[];
|
|
12
|
+
/** Emits the next value plus move metadata; the first argument is
|
|
13
|
+
* always the complete next `string[]`, so a plain value channel
|
|
14
|
+
* (e.g. FormItem's `input` bridge) can ignore the rest. */
|
|
15
|
+
onChange: (value: string[], direction: 'left' | 'right', moveKeys: string[]) => void;
|
|
16
|
+
className?: string;
|
|
17
|
+
} & Omit<ComponentPropsWithoutRef<'div'>, 'onChange' | 'children'>;
|
|
18
|
+
export default function TransferCore({ dataSource, value: targetKeys, onChange, className, ...rest }: TransferCoreProps): import("react").JSX.Element;
|
|
19
|
+
export type { TransferCoreProps, TransferItem };
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ControlOrValue } from 'react-use-control';
|
|
2
3
|
type UploadProps = {
|
|
4
|
+
/** Selected files; uncontrolled (accumulating internally) when omitted. */
|
|
5
|
+
value?: ControlOrValue<File[]>;
|
|
3
6
|
accept?: string;
|
|
4
7
|
multiple?: boolean;
|
|
8
|
+
/** Fires with the freshly picked files only — the accumulated list is
|
|
9
|
+
* the `value` channel (or internal state when uncontrolled). */
|
|
5
10
|
onChange?: (files: File[]) => void;
|
|
6
11
|
className?: string;
|
|
7
12
|
children?: ReactNode;
|
|
8
13
|
};
|
|
9
|
-
export default function Upload({ accept, multiple, onChange, className, children, }: UploadProps): import("react").JSX.Element;
|
|
14
|
+
export default function Upload({ value: valueControl, accept, multiple, onChange, className, children, }: UploadProps): import("react").JSX.Element;
|
|
10
15
|
export type { UploadProps };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
type UploadCoreProps = {
|
|
3
|
+
/** The selected files — the field value, emitted verbatim (as the
|
|
4
|
+
* complete next list) by `onChange`. */
|
|
5
|
+
value: File[];
|
|
6
|
+
/** Emits the next file list: a single pick replaces `value`, a
|
|
7
|
+
* `multiple` pick appends to it. */
|
|
8
|
+
onChange: (files: File[]) => void;
|
|
9
|
+
accept?: string;
|
|
10
|
+
multiple?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
} & Omit<ComponentPropsWithoutRef<'div'>, 'value' | 'onChange' | 'children' | 'onClick' | 'onDrop' | 'onDragOver' | 'role' | 'tabIndex'>;
|
|
14
|
+
export default function UploadCore({ value, onChange, accept, multiple, className, children, ...rest }: UploadCoreProps): import("react").JSX.Element;
|
|
15
|
+
export type { UploadCoreProps };
|
|
@@ -149,7 +149,8 @@ export type FormItemProps<TValues extends Record<string, any> = any, P extends F
|
|
|
149
149
|
* Declarative binding for the field control, in two forms:
|
|
150
150
|
*
|
|
151
151
|
* - a component (`InputCore`, `TextareaCore`, `TagInputCore`,
|
|
152
|
-
* `SelectCore`, `CheckboxCore`, …,
|
|
152
|
+
* `SelectCore`, `TransferCore`, `UploadCore`, `CheckboxCore`, …,
|
|
153
|
+
* or any DOM-element-shaped
|
|
153
154
|
* component): FormItem wires `id`, `aria-invalid`,
|
|
154
155
|
* `aria-describedby`, `onBlur`, `onChange` and the value channel
|
|
155
156
|
* itself. Haze cores' `onChange` emits the next plain value
|
package/dist/types/index.d.ts
CHANGED
|
@@ -93,10 +93,10 @@ export { ResizableGroup, ResizablePanel, ResizableHandle } from './components/Re
|
|
|
93
93
|
export type { ResizableGroupProps, ResizablePanelProps, ResizableHandleProps } from './components/Resizable';
|
|
94
94
|
export { Collapsible, CollapsibleTrigger, CollapsibleContent } from './components/Collapsible';
|
|
95
95
|
export type { CollapsibleProps, CollapsibleTriggerProps, CollapsibleContentProps } from './components/Collapsible';
|
|
96
|
-
export { Transfer } from './components/Transfer';
|
|
97
|
-
export type { TransferProps, TransferItem } from './components/Transfer';
|
|
98
|
-
export { Upload } from './components/Upload';
|
|
99
|
-
export type { UploadProps } from './components/Upload';
|
|
96
|
+
export { Transfer, TransferCore } from './components/Transfer';
|
|
97
|
+
export type { TransferProps, TransferItem, TransferCoreProps } from './components/Transfer';
|
|
98
|
+
export { Upload, UploadCore } from './components/Upload';
|
|
99
|
+
export type { UploadProps, UploadCoreProps } from './components/Upload';
|
|
100
100
|
export { ColorPicker, ColorPickerCore } from './components/ColorPicker';
|
|
101
101
|
export type { ColorPickerProps, ColorPickerCoreProps } from './components/ColorPicker';
|
|
102
102
|
export { Rating, RatingCore } from './components/Rating';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "haze-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.18.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React UI component library powered by react-use-control and Linaria",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"@linaria/core": "^7.0.0 || ^8.0.0",
|
|
54
54
|
"react": "^19.0.0",
|
|
55
|
-
"react-f0rm": ">=0.7.0 <0.
|
|
55
|
+
"react-f0rm": ">=0.7.0 <0.12.0"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"react-use-control": "^1.5.0"
|