haze-ui 1.24.1 → 1.25.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 +139 -0
- package/dist/components/Alert/Alert.js +19 -18
- package/dist/components/ApprovalCard/ApprovalCard.js +27 -25
- package/dist/components/AsyncSection/AsyncSection.js +32 -30
- package/dist/components/AvatarGroup/AvatarGroup.js +29 -0
- package/dist/components/AvatarGroup/index.js +2 -0
- package/dist/components/BackToTop/BackToTop.js +15 -14
- package/dist/components/Banner/Banner.js +19 -18
- package/dist/components/Breadcrumb/Breadcrumb.js +18 -17
- package/dist/components/Calendar/Calendar.js +152 -0
- package/dist/components/Calendar/index.js +2 -0
- package/dist/components/Carousel/Carousel.js +42 -40
- package/dist/components/Cascader/Cascader.js +227 -0
- package/dist/components/Cascader/index.js +2 -0
- package/dist/components/ChatInput/ChatInput.js +30 -29
- package/dist/components/ChatMessage/ChatMessage.js +28 -27
- package/dist/components/Chip/Chip.js +20 -19
- package/dist/components/ColorPicker/ColorPickerCore.js +28 -26
- package/dist/components/Combobox/Combobox.js +62 -41
- package/dist/components/ConfirmDialog/ConfirmDialog.js +40 -39
- package/dist/components/DataTable/DataTable.js +151 -0
- package/dist/components/DataTable/index.js +2 -0
- package/dist/components/DateRangePicker/DateRangePickerCore.js +21 -19
- package/dist/components/Datepicker/Datepicker.js +10 -8
- package/dist/components/Datepicker/DatepickerCore.js +18 -16
- package/dist/components/Empty/Empty.js +21 -19
- package/dist/components/FileInput/FileInput.js +14 -13
- package/dist/components/HoverCard/HoverCard.js +53 -0
- package/dist/components/HoverCard/index.js +2 -0
- package/dist/components/InlineEdit/InlineEdit.js +32 -31
- package/dist/components/Kbd/Kbd.js +21 -0
- package/dist/components/Kbd/index.js +2 -0
- package/dist/components/LocaleProvider/LocaleContext.js +5 -0
- package/dist/components/LocaleProvider/LocaleProvider.js +21 -0
- package/dist/components/LocaleProvider/index.js +4 -0
- package/dist/components/LocaleProvider/locale.js +126 -0
- package/dist/components/LocaleProvider/useStrings.js +17 -0
- package/dist/components/LogViewer/LogViewer.js +44 -43
- package/dist/components/MarkdownRenderer/MarkdownRenderer.js +19 -19
- package/dist/components/MarkdownRenderer/markdown-blocks.js +41 -0
- package/dist/components/ModelPicker/ModelPicker.js +16 -15
- package/dist/components/NumberInput/NumberInputCore.js +34 -33
- package/dist/components/OTPInput/OTPInputCore.js +35 -30
- package/dist/components/Pagination/Pagination.js +31 -30
- package/dist/components/PasswordInput/PasswordInputCore.js +22 -21
- package/dist/components/Progress/Progress.js +40 -39
- package/dist/components/Rating/RatingCore.js +28 -26
- package/dist/components/Sidebar/Sidebar.js +112 -0
- package/dist/components/Sidebar/index.js +2 -0
- package/dist/components/Spinner/Spinner.js +14 -12
- package/dist/components/StreamingText/StreamingText.js +38 -18
- package/dist/components/Tag/Tag.js +16 -14
- package/dist/components/TagGroup/TagGroupItem.js +12 -10
- package/dist/components/TagInput/TagInputCore.js +52 -50
- package/dist/components/ThinkingIndicator/ThinkingIndicator.js +13 -11
- package/dist/components/Toast/ToastContainer.js +44 -28
- package/dist/components/Toast/index.js +4 -3
- package/dist/components/Toast/toast2.js +44 -0
- package/dist/components/TokenCounter/TokenCounter.js +19 -18
- package/dist/components/ToolCallCard/ToolCallCard.js +39 -37
- package/dist/components/Toolbar/Toolbar.js +59 -0
- package/dist/components/Toolbar/ToolbarButton.js +25 -0
- package/dist/components/Toolbar/ToolbarContext.js +8 -0
- package/dist/components/Toolbar/ToolbarSeparator.js +22 -0
- package/dist/components/Toolbar/index.js +4 -0
- package/dist/components/Tour/Tour.js +197 -0
- package/dist/components/Tour/index.js +2 -0
- package/dist/components/Transfer/TransferCore.js +61 -67
- package/dist/components/Tree/TreeItem.js +56 -55
- package/dist/components/Upload/UploadCore.js +36 -35
- package/dist/components/VirtualList/VirtualList.js +140 -26
- package/dist/css/affix.css +1 -1
- package/dist/css/avatar-group.css +2 -0
- package/dist/css/calendar.css +2 -0
- package/dist/css/carousel.css +1 -1
- package/dist/css/cascader.css +2 -0
- package/dist/css/chat-message.css +1 -1
- package/dist/css/chip.css +1 -1
- package/dist/css/code-block.css +1 -1
- package/dist/css/combobox.css +1 -1
- package/dist/css/container.css +1 -1
- package/dist/css/context-menu.css +1 -1
- package/dist/css/conversation-list.css +1 -1
- package/dist/css/data-table.css +2 -0
- package/dist/css/datepicker.css +0 -1
- package/dist/css/diff-viewer.css +1 -1
- package/dist/css/dropdown-menu.css +1 -1
- package/dist/css/hover-card.css +2 -0
- package/dist/css/kbd.css +2 -0
- package/dist/css/list.css +1 -1
- package/dist/css/markdown-renderer.css +1 -1
- package/dist/css/menu.css +1 -1
- package/dist/css/model-picker.css +1 -1
- package/dist/css/navigation-bar.css +1 -1
- package/dist/css/password-input.css +1 -1
- package/dist/css/radio.css +1 -1
- package/dist/css/select.css +1 -1
- package/dist/css/sidebar.css +2 -0
- package/dist/css/step-timeline.css +1 -1
- package/dist/css/stepper.css +1 -1
- package/dist/css/streaming-text.css +1 -1
- package/dist/css/table.css +1 -1
- package/dist/css/toolbar.css +4 -0
- package/dist/css/tour.css +2 -0
- package/dist/css/tree.css +1 -1
- package/dist/css/virtual-list.css +1 -1
- package/dist/css-manifest.json +19 -0
- package/dist/haze-ui.css +36 -26
- package/dist/index.js +130 -115
- package/dist/registry.json +247 -0
- package/dist/types/components/AvatarGroup/AvatarGroup.d.ts +9 -0
- package/dist/types/components/AvatarGroup/index.d.ts +2 -0
- package/dist/types/components/Calendar/Calendar.d.ts +21 -0
- package/dist/types/components/Calendar/index.d.ts +2 -0
- package/dist/types/components/Cascader/Cascader.d.ts +26 -0
- package/dist/types/components/Cascader/index.d.ts +2 -0
- package/dist/types/components/Combobox/Combobox.d.ts +7 -1
- package/dist/types/components/DataTable/DataTable.d.ts +61 -0
- package/dist/types/components/DataTable/index.d.ts +2 -0
- package/dist/types/components/Datepicker/Datepicker.d.ts +3 -1
- package/dist/types/components/Datepicker/DatepickerCore.d.ts +3 -1
- package/dist/types/components/HoverCard/HoverCard.d.ts +49 -0
- package/dist/types/components/HoverCard/index.d.ts +2 -0
- package/dist/types/components/Kbd/Kbd.d.ts +6 -0
- package/dist/types/components/Kbd/index.d.ts +2 -0
- package/dist/types/components/LocaleProvider/LocaleContext.d.ts +19 -0
- package/dist/types/components/LocaleProvider/LocaleProvider.d.ts +13 -0
- package/dist/types/components/LocaleProvider/index.d.ts +6 -0
- package/dist/types/components/LocaleProvider/locale.d.ts +176 -0
- package/dist/types/components/LocaleProvider/useStrings.d.ts +9 -0
- package/dist/types/components/MarkdownRenderer/markdown-blocks.d.ts +6 -0
- package/dist/types/components/Sidebar/Sidebar.d.ts +64 -0
- package/dist/types/components/Sidebar/index.d.ts +4 -0
- package/dist/types/components/Toast/index.d.ts +2 -0
- package/dist/types/components/Toast/toast.d.ts +46 -0
- package/dist/types/components/Toolbar/Toolbar.d.ts +16 -0
- package/dist/types/components/Toolbar/ToolbarButton.d.ts +20 -0
- package/dist/types/components/Toolbar/ToolbarContext.d.ts +5 -0
- package/dist/types/components/Toolbar/ToolbarSeparator.d.ts +14 -0
- package/dist/types/components/Toolbar/index.d.ts +6 -0
- package/dist/types/components/Tour/Tour.d.ts +46 -0
- package/dist/types/components/Tour/index.d.ts +2 -0
- package/dist/types/components/VirtualList/VirtualList.d.ts +58 -4
- package/dist/types/components/VirtualList/index.d.ts +1 -1
- package/dist/types/index.d.ts +24 -3
- package/package.json +25 -11
- package/dist/components/Datepicker/Calendar.js +0 -120
- package/dist/types/components/Datepicker/Calendar.d.ts +0 -8
|
@@ -1,45 +1,47 @@
|
|
|
1
1
|
|
|
2
2
|
import { classnames as e } from "../../utils/classnames.js";
|
|
3
3
|
import { FloatingPanel as t, useFloating as n } from "../../utils/floating.js";
|
|
4
|
-
import r from "
|
|
4
|
+
import r from "../Calendar/Calendar.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
7
|
import { useCallback as o, useId as s, useRef as c } from "react";
|
|
8
8
|
//#region src/lib/components/Datepicker/DatepickerCore.tsx
|
|
9
9
|
var l = "haze-DatepickerCore__wrapper", u = "haze-DatepickerCore__input", d = "haze-DatepickerCore__dropdown";
|
|
10
|
-
function f({ value: f, onChange: p, open: m, onOpenChange: h, min: g, max: _,
|
|
11
|
-
let
|
|
10
|
+
function f({ value: f, onChange: p, open: m, onOpenChange: h, min: g, max: _, locale: v, weekStartsOn: y, placeholder: b = "Select date", className: x }) {
|
|
11
|
+
let S = c(null), C = c(null), w = s(), T = o((e) => h(typeof e == "function" ? e(m) : e), [h, m]), E = n({
|
|
12
12
|
open: m,
|
|
13
|
-
setOpen:
|
|
14
|
-
triggerRef:
|
|
15
|
-
panelRef:
|
|
13
|
+
setOpen: T,
|
|
14
|
+
triggerRef: S,
|
|
15
|
+
panelRef: C,
|
|
16
16
|
animated: !0
|
|
17
17
|
});
|
|
18
18
|
return /* @__PURE__ */ a("div", {
|
|
19
|
-
className: e([l,
|
|
19
|
+
className: e([l, x]),
|
|
20
20
|
children: [/* @__PURE__ */ i("input", {
|
|
21
|
-
ref:
|
|
21
|
+
ref: S,
|
|
22
22
|
readOnly: !0,
|
|
23
|
-
style:
|
|
23
|
+
style: E.triggerStyle,
|
|
24
24
|
className: u,
|
|
25
25
|
value: f,
|
|
26
|
-
placeholder:
|
|
26
|
+
placeholder: b,
|
|
27
27
|
role: "combobox",
|
|
28
28
|
"aria-haspopup": "dialog",
|
|
29
29
|
"aria-expanded": m,
|
|
30
|
-
"aria-controls":
|
|
31
|
-
onPointerDown:
|
|
32
|
-
onClick:
|
|
30
|
+
"aria-controls": w,
|
|
31
|
+
onPointerDown: E.onTriggerPointerDown,
|
|
32
|
+
onClick: E.onTriggerClick
|
|
33
33
|
}), /* @__PURE__ */ i(t, {
|
|
34
|
-
ref:
|
|
35
|
-
behavior:
|
|
34
|
+
ref: C,
|
|
35
|
+
behavior: E,
|
|
36
36
|
placement: "bottom",
|
|
37
37
|
visualClass: d,
|
|
38
|
-
id:
|
|
38
|
+
id: w,
|
|
39
39
|
children: /* @__PURE__ */ i(r, {
|
|
40
40
|
value: f,
|
|
41
41
|
min: g,
|
|
42
42
|
max: _,
|
|
43
|
+
locale: v,
|
|
44
|
+
weekStartsOn: y,
|
|
43
45
|
onSelect: (e) => {
|
|
44
46
|
p(e), h(!1);
|
|
45
47
|
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
|
|
2
2
|
import { classnames as e } from "../../utils/classnames.js";
|
|
3
|
+
import { useStrings as t } from "../LocaleProvider/useStrings.js";
|
|
3
4
|
/* empty css */
|
|
4
|
-
import { jsx as
|
|
5
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
6
|
//#region src/lib/components/Empty/Empty.tsx
|
|
6
|
-
var
|
|
7
|
+
var i = "haze-Empty__base", a = "haze-Empty__imageStyle", o = "haze-Empty__descStyle", s = "haze-Empty__actionStyle", c = /* @__PURE__ */ r("svg", {
|
|
7
8
|
width: "64",
|
|
8
9
|
height: "64",
|
|
9
10
|
viewBox: "0 0 64 64",
|
|
10
11
|
fill: "none",
|
|
11
12
|
xmlns: "http://www.w3.org/2000/svg",
|
|
12
13
|
children: [
|
|
13
|
-
/* @__PURE__ */
|
|
14
|
+
/* @__PURE__ */ n("rect", {
|
|
14
15
|
x: "8",
|
|
15
16
|
y: "16",
|
|
16
17
|
width: "48",
|
|
@@ -19,24 +20,24 @@ var r = "haze-Empty__base", i = "haze-Empty__imageStyle", a = "haze-Empty__descS
|
|
|
19
20
|
stroke: "var(--haze-color-border)",
|
|
20
21
|
strokeWidth: "2"
|
|
21
22
|
}),
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
+
/* @__PURE__ */ n("path", {
|
|
23
24
|
d: "M8 28h48",
|
|
24
25
|
stroke: "var(--haze-color-border)",
|
|
25
26
|
strokeWidth: "2"
|
|
26
27
|
}),
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
+
/* @__PURE__ */ n("circle", {
|
|
28
29
|
cx: "20",
|
|
29
30
|
cy: "22",
|
|
30
31
|
r: "2",
|
|
31
32
|
fill: "var(--haze-color-border)"
|
|
32
33
|
}),
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
+
/* @__PURE__ */ n("circle", {
|
|
34
35
|
cx: "28",
|
|
35
36
|
cy: "22",
|
|
36
37
|
r: "2",
|
|
37
38
|
fill: "var(--haze-color-border)"
|
|
38
39
|
}),
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ n("path", {
|
|
40
41
|
d: "M24 38l6-6 4 4 8-8",
|
|
41
42
|
stroke: "var(--haze-color-border)",
|
|
42
43
|
strokeWidth: "2",
|
|
@@ -45,24 +46,25 @@ var r = "haze-Empty__base", i = "haze-Empty__imageStyle", a = "haze-Empty__descS
|
|
|
45
46
|
})
|
|
46
47
|
]
|
|
47
48
|
});
|
|
48
|
-
function
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
function l({ description: l, image: u, className: d, children: f }) {
|
|
50
|
+
let p = t("empty"), m = l ?? p.description;
|
|
51
|
+
return /* @__PURE__ */ r("div", {
|
|
52
|
+
className: e([i, d]),
|
|
51
53
|
children: [
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
className: e([i]),
|
|
54
|
-
children: l ?? s
|
|
55
|
-
}),
|
|
56
|
-
/* @__PURE__ */ t("div", {
|
|
54
|
+
/* @__PURE__ */ n("div", {
|
|
57
55
|
className: e([a]),
|
|
58
|
-
children: c
|
|
56
|
+
children: u ?? c
|
|
59
57
|
}),
|
|
60
|
-
|
|
58
|
+
/* @__PURE__ */ n("div", {
|
|
61
59
|
className: e([o]),
|
|
62
|
-
children:
|
|
60
|
+
children: m
|
|
61
|
+
}),
|
|
62
|
+
f && /* @__PURE__ */ n("div", {
|
|
63
|
+
className: e([s]),
|
|
64
|
+
children: f
|
|
63
65
|
})
|
|
64
66
|
]
|
|
65
67
|
});
|
|
66
68
|
}
|
|
67
69
|
//#endregion
|
|
68
|
-
export {
|
|
70
|
+
export { l as default };
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
|
|
2
2
|
import { classnames as e } from "../../utils/classnames.js";
|
|
3
|
+
import { useStrings as t } from "../LocaleProvider/useStrings.js";
|
|
3
4
|
/* empty css */
|
|
4
|
-
import { jsx as
|
|
5
|
-
import { useRef as
|
|
5
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
6
|
+
import { useRef as i } from "react";
|
|
6
7
|
//#region src/lib/components/FileInput/FileInput.tsx
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
let
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
-
className: e([
|
|
12
|
-
children: [/* @__PURE__ */
|
|
13
|
-
ref:
|
|
8
|
+
var a = "haze-FileInput__hiddenInput", o = "haze-FileInput__trigger";
|
|
9
|
+
function s({ children: s, className: c, ...l }) {
|
|
10
|
+
let u = i(null), d = t("fileInput");
|
|
11
|
+
return /* @__PURE__ */ r("label", {
|
|
12
|
+
className: e([o, c]),
|
|
13
|
+
children: [/* @__PURE__ */ n("input", {
|
|
14
|
+
ref: u,
|
|
14
15
|
type: "file",
|
|
15
|
-
className:
|
|
16
|
-
...
|
|
17
|
-
}),
|
|
16
|
+
className: a,
|
|
17
|
+
...l
|
|
18
|
+
}), s ?? d.label]
|
|
18
19
|
});
|
|
19
20
|
}
|
|
20
21
|
//#endregion
|
|
21
|
-
export {
|
|
22
|
+
export { s as default };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
|
|
2
|
+
import { FloatingPanel as e, useFloating as t } from "../../utils/floating.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
+
import { useEffect as i, useId as a, useMemo as o, useRef as s } from "react";
|
|
6
|
+
import { useControl as c } from "react-use-control";
|
|
7
|
+
//#region src/lib/components/HoverCard/HoverCard.tsx
|
|
8
|
+
var l = "haze-HoverCard__container", u = "haze-HoverCard__panelVisuals";
|
|
9
|
+
function d({ content: d, openDelay: f = 200, closeDelay: p = 120, placement: m = "bottom-span", open: h, collisionPadding: g, className: _, children: v }) {
|
|
10
|
+
let [y, b] = c(h, !1), x = a(), S = s(null), C = s(null), w = o(() => g === void 0 ? void 0 : { collisionPadding: g }, [g]), T = t({
|
|
11
|
+
open: y,
|
|
12
|
+
setOpen: b,
|
|
13
|
+
triggerRef: S,
|
|
14
|
+
panelRef: C,
|
|
15
|
+
animated: !0,
|
|
16
|
+
collision: w
|
|
17
|
+
}), E = s(0), D = s(0);
|
|
18
|
+
i(() => () => {
|
|
19
|
+
window.clearTimeout(E.current), window.clearTimeout(D.current);
|
|
20
|
+
}, []);
|
|
21
|
+
let O = () => {
|
|
22
|
+
window.clearTimeout(E.current), window.clearTimeout(D.current);
|
|
23
|
+
}, k = () => {
|
|
24
|
+
O(), !y && (E.current = window.setTimeout(() => b(!0), f));
|
|
25
|
+
}, A = () => {
|
|
26
|
+
O(), y && (D.current = window.setTimeout(() => b(!1), p));
|
|
27
|
+
};
|
|
28
|
+
return /* @__PURE__ */ r("span", {
|
|
29
|
+
className: l,
|
|
30
|
+
children: [/* @__PURE__ */ n("span", {
|
|
31
|
+
ref: S,
|
|
32
|
+
style: T.triggerStyle,
|
|
33
|
+
"aria-describedby": x,
|
|
34
|
+
onMouseEnter: k,
|
|
35
|
+
onMouseLeave: A,
|
|
36
|
+
onFocus: k,
|
|
37
|
+
onBlur: A,
|
|
38
|
+
children: v
|
|
39
|
+
}), /* @__PURE__ */ n(e, {
|
|
40
|
+
ref: C,
|
|
41
|
+
behavior: T,
|
|
42
|
+
placement: m,
|
|
43
|
+
id: x,
|
|
44
|
+
visualClass: u,
|
|
45
|
+
className: _,
|
|
46
|
+
onMouseEnter: O,
|
|
47
|
+
onMouseLeave: A,
|
|
48
|
+
children: d
|
|
49
|
+
})]
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
export { d as default };
|
|
@@ -1,47 +1,48 @@
|
|
|
1
1
|
|
|
2
2
|
import { classnames as e } from "../../utils/classnames.js";
|
|
3
|
+
import { useStrings as t } from "../LocaleProvider/useStrings.js";
|
|
3
4
|
/* empty css */
|
|
4
|
-
import { jsx as
|
|
5
|
-
import { useEffect as
|
|
6
|
-
import { useControl as
|
|
5
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
6
|
+
import { useEffect as r, useRef as i, useState as a } from "react";
|
|
7
|
+
import { useControl as o } from "react-use-control";
|
|
7
8
|
//#region src/lib/components/InlineEdit/InlineEdit.tsx
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
let [
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}, [
|
|
14
|
-
let
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
|
|
9
|
+
var s = "haze-InlineEdit__display", c = "haze-InlineEdit__editing", l = "haze-InlineEdit__placeholderStyle";
|
|
10
|
+
function u({ value: u, onChange: d, placeholder: f, disabled: p, className: m }) {
|
|
11
|
+
let [h, g] = o(u, ""), [_, v] = a(!1), [y, b] = a(h), x = i(null), S = t("inlineEdit"), C = f ?? S.placeholder;
|
|
12
|
+
r(() => {
|
|
13
|
+
_ && (x.current?.focus(), x.current?.select());
|
|
14
|
+
}, [_]);
|
|
15
|
+
let w = () => {
|
|
16
|
+
p || (b(h), v(!0));
|
|
17
|
+
}, T = () => {
|
|
18
|
+
v(!1), y !== h && (g(y), d?.(y));
|
|
19
|
+
}, E = () => {
|
|
20
|
+
v(!1), b(h);
|
|
20
21
|
};
|
|
21
|
-
return
|
|
22
|
-
ref:
|
|
23
|
-
"aria-label":
|
|
24
|
-
value:
|
|
25
|
-
onChange: (e) =>
|
|
26
|
-
onBlur:
|
|
22
|
+
return _ ? /* @__PURE__ */ n("input", {
|
|
23
|
+
ref: x,
|
|
24
|
+
"aria-label": C,
|
|
25
|
+
value: y,
|
|
26
|
+
onChange: (e) => b(e.target.value),
|
|
27
|
+
onBlur: T,
|
|
27
28
|
onKeyDown: (e) => {
|
|
28
|
-
e.key === "Enter" &&
|
|
29
|
+
e.key === "Enter" && T(), e.key === "Escape" && E();
|
|
29
30
|
},
|
|
30
|
-
className: e([
|
|
31
|
-
}) : /* @__PURE__ */
|
|
32
|
-
onClick:
|
|
31
|
+
className: e([c, m])
|
|
32
|
+
}) : /* @__PURE__ */ n("span", {
|
|
33
|
+
onClick: w,
|
|
33
34
|
role: "button",
|
|
34
35
|
tabIndex: 0,
|
|
35
36
|
onKeyDown: (e) => {
|
|
36
|
-
e.key === "Enter" &&
|
|
37
|
+
e.key === "Enter" && w();
|
|
37
38
|
},
|
|
38
39
|
className: e([
|
|
39
|
-
|
|
40
|
-
!
|
|
41
|
-
|
|
40
|
+
s,
|
|
41
|
+
!h && l,
|
|
42
|
+
m
|
|
42
43
|
]),
|
|
43
|
-
children:
|
|
44
|
+
children: h || C
|
|
44
45
|
});
|
|
45
46
|
}
|
|
46
47
|
//#endregion
|
|
47
|
-
export {
|
|
48
|
+
export { u as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
import { classnames as e } from "../../utils/classnames.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
5
|
+
//#region src/lib/components/Kbd/Kbd.tsx
|
|
6
|
+
var n = "haze-Kbd__base", r = {
|
|
7
|
+
sm: "haze-Kbd__sm",
|
|
8
|
+
md: "haze-Kbd__md"
|
|
9
|
+
};
|
|
10
|
+
function i({ size: i = "md", className: a, ...o }) {
|
|
11
|
+
return /* @__PURE__ */ t("kbd", {
|
|
12
|
+
...o,
|
|
13
|
+
className: e([
|
|
14
|
+
n,
|
|
15
|
+
r[i],
|
|
16
|
+
a
|
|
17
|
+
])
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { i as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { LocaleContext as e } from "./LocaleContext.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { useContext as n, useMemo as r } from "react";
|
|
4
|
+
//#region src/lib/components/LocaleProvider/LocaleProvider.tsx
|
|
5
|
+
function i({ locale: i, strings: a, children: o }) {
|
|
6
|
+
let s = n(e), c = r(() => ({
|
|
7
|
+
locale: i ?? s?.locale,
|
|
8
|
+
strings: a,
|
|
9
|
+
parent: s
|
|
10
|
+
}), [
|
|
11
|
+
i,
|
|
12
|
+
a,
|
|
13
|
+
s
|
|
14
|
+
]);
|
|
15
|
+
return /* @__PURE__ */ t(e.Provider, {
|
|
16
|
+
value: c,
|
|
17
|
+
children: o
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { i as default };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
//#region src/lib/components/LocaleProvider/locale.ts
|
|
2
|
+
var e = {
|
|
3
|
+
alert: { close: "Close" },
|
|
4
|
+
approvalCard: {
|
|
5
|
+
title: "Approval Required",
|
|
6
|
+
approve: "Approve",
|
|
7
|
+
deny: "Deny"
|
|
8
|
+
},
|
|
9
|
+
asyncSection: {
|
|
10
|
+
loading: "Loading…",
|
|
11
|
+
error: "Something went wrong",
|
|
12
|
+
retry: "Retry"
|
|
13
|
+
},
|
|
14
|
+
avatarGroup: { more: "+{count}" },
|
|
15
|
+
calendar: {
|
|
16
|
+
previousMonth: "Previous month",
|
|
17
|
+
nextMonth: "Next month",
|
|
18
|
+
today: "Today"
|
|
19
|
+
},
|
|
20
|
+
cascader: { expand: "Expand" },
|
|
21
|
+
sidebar: {
|
|
22
|
+
toggle: "Toggle sidebar",
|
|
23
|
+
expand: "Expand sidebar",
|
|
24
|
+
collapse: "Collapse sidebar"
|
|
25
|
+
},
|
|
26
|
+
tour: {
|
|
27
|
+
next: "Next",
|
|
28
|
+
back: "Back",
|
|
29
|
+
done: "Done",
|
|
30
|
+
skip: "Skip",
|
|
31
|
+
stepOf: "Step {current} of {total}"
|
|
32
|
+
},
|
|
33
|
+
backToTop: { label: "Back to top" },
|
|
34
|
+
banner: { close: "Close" },
|
|
35
|
+
breadcrumb: { label: "Breadcrumb" },
|
|
36
|
+
carousel: {
|
|
37
|
+
label: "Carousel",
|
|
38
|
+
previousSlide: "Previous slide",
|
|
39
|
+
nextSlide: "Next slide",
|
|
40
|
+
goToSlide: "Go to slide {index}"
|
|
41
|
+
},
|
|
42
|
+
chatInput: {
|
|
43
|
+
placeholder: "Type a message...",
|
|
44
|
+
send: "Send"
|
|
45
|
+
},
|
|
46
|
+
chatMessage: {
|
|
47
|
+
sending: "Sending...",
|
|
48
|
+
sent: "Sent",
|
|
49
|
+
failedToSend: "Failed to send"
|
|
50
|
+
},
|
|
51
|
+
chip: { remove: "Remove" },
|
|
52
|
+
colorPicker: {
|
|
53
|
+
pickColor: "Pick color",
|
|
54
|
+
hexColor: "Hex color"
|
|
55
|
+
},
|
|
56
|
+
confirmDialog: {
|
|
57
|
+
confirm: "Confirm",
|
|
58
|
+
cancel: "Cancel"
|
|
59
|
+
},
|
|
60
|
+
dateRangePicker: {
|
|
61
|
+
startDate: "Start date",
|
|
62
|
+
endDate: "End date"
|
|
63
|
+
},
|
|
64
|
+
empty: { description: "No data" },
|
|
65
|
+
fileInput: { label: "Choose file" },
|
|
66
|
+
inlineEdit: { placeholder: "Click to edit" },
|
|
67
|
+
logViewer: {
|
|
68
|
+
all: "All",
|
|
69
|
+
noLogs: "No logs"
|
|
70
|
+
},
|
|
71
|
+
modelPicker: { label: "Model" },
|
|
72
|
+
numberInput: {
|
|
73
|
+
decrease: "Decrease",
|
|
74
|
+
increase: "Increase"
|
|
75
|
+
},
|
|
76
|
+
otpInput: { digitLabel: "Digit {index} of {total}" },
|
|
77
|
+
pagination: {
|
|
78
|
+
previous: "Previous",
|
|
79
|
+
next: "Next"
|
|
80
|
+
},
|
|
81
|
+
passwordInput: {
|
|
82
|
+
label: "Password",
|
|
83
|
+
show: "Show password",
|
|
84
|
+
hide: "Hide password"
|
|
85
|
+
},
|
|
86
|
+
progress: { label: "Progress" },
|
|
87
|
+
rating: {
|
|
88
|
+
star: "{count} star",
|
|
89
|
+
stars: "{count} stars"
|
|
90
|
+
},
|
|
91
|
+
spinner: { loading: "Loading" },
|
|
92
|
+
tag: { remove: "Remove" },
|
|
93
|
+
tagGroup: { remove: "Remove" },
|
|
94
|
+
tagInput: {
|
|
95
|
+
placeholder: "Add tag",
|
|
96
|
+
removeTag: "Remove {tag}",
|
|
97
|
+
tagCount: "{count} tags",
|
|
98
|
+
tagCountSingular: "{count} tag"
|
|
99
|
+
},
|
|
100
|
+
thinkingIndicator: { text: "Thinking" },
|
|
101
|
+
tokenCounter: { label: "Tokens" },
|
|
102
|
+
toolCallCard: {
|
|
103
|
+
pending: "Pending",
|
|
104
|
+
running: "Running...",
|
|
105
|
+
done: "Done",
|
|
106
|
+
error: "Error",
|
|
107
|
+
inputLabel: "Input",
|
|
108
|
+
outputLabel: "Output"
|
|
109
|
+
},
|
|
110
|
+
transfer: {
|
|
111
|
+
source: "Source ({count})",
|
|
112
|
+
target: "Target ({count})",
|
|
113
|
+
moveToTarget: ">",
|
|
114
|
+
moveToSource: "<"
|
|
115
|
+
},
|
|
116
|
+
tree: {
|
|
117
|
+
expand: "Expand",
|
|
118
|
+
collapse: "Collapse"
|
|
119
|
+
},
|
|
120
|
+
upload: { hint: "Drag & drop files here, or click to upload" }
|
|
121
|
+
};
|
|
122
|
+
function t(e, t) {
|
|
123
|
+
return e.replace(/\{(\w+)\}/g, (e, n) => Object.prototype.hasOwnProperty.call(t, n) ? String(t[n]) : e);
|
|
124
|
+
}
|
|
125
|
+
//#endregion
|
|
126
|
+
export { e as defaultStrings, t as formatString };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LocaleContext as e } from "./LocaleContext.js";
|
|
2
|
+
import { defaultStrings as t } from "./locale.js";
|
|
3
|
+
import { useContext as n } from "react";
|
|
4
|
+
//#region src/lib/components/LocaleProvider/useStrings.ts
|
|
5
|
+
function r(e) {
|
|
6
|
+
if (!e) return [];
|
|
7
|
+
let t = r(e.parent);
|
|
8
|
+
return e.strings ? [...t, e.strings] : t;
|
|
9
|
+
}
|
|
10
|
+
function i(i) {
|
|
11
|
+
return r(n(e)).map((e) => e[i]).filter((e) => e !== void 0).reduce((e, t) => ({
|
|
12
|
+
...e,
|
|
13
|
+
...t
|
|
14
|
+
}), t[i]);
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { i as useStrings };
|
|
@@ -1,66 +1,67 @@
|
|
|
1
1
|
|
|
2
2
|
import { classnames as e } from "../../utils/classnames.js";
|
|
3
|
+
import { useStrings as t } from "../LocaleProvider/useStrings.js";
|
|
3
4
|
/* empty css */
|
|
4
|
-
import { jsx as
|
|
5
|
-
import { useMemo as
|
|
6
|
-
import { useControl as
|
|
5
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
6
|
+
import { useMemo as i } from "react";
|
|
7
|
+
import { useControl as a } from "react-use-control";
|
|
7
8
|
//#region src/lib/components/LogViewer/LogViewer.tsx
|
|
8
|
-
var
|
|
9
|
-
debug:
|
|
10
|
-
info:
|
|
11
|
-
warn:
|
|
12
|
-
error:
|
|
13
|
-
},
|
|
9
|
+
var o = "haze-LogViewer__wrapper", s = "haze-LogViewer__toolbar", c = "haze-LogViewer__filterBtn", l = "haze-LogViewer__filterActive", u = "haze-LogViewer__body", d = "haze-LogViewer__entry", f = "haze-LogViewer__timestamp", p = "haze-LogViewer__levelBadge", m = "haze-LogViewer__levelDebug", h = "haze-LogViewer__levelInfo", g = "haze-LogViewer__levelWarn", _ = "haze-LogViewer__levelError", v = "haze-LogViewer__messageStyle", y = {
|
|
10
|
+
debug: m,
|
|
11
|
+
info: h,
|
|
12
|
+
warn: g,
|
|
13
|
+
error: _
|
|
14
|
+
}, b = [
|
|
14
15
|
"debug",
|
|
15
16
|
"info",
|
|
16
17
|
"warn",
|
|
17
18
|
"error"
|
|
18
19
|
];
|
|
19
|
-
function
|
|
20
|
-
let [
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
className: e([
|
|
23
|
-
children: [/* @__PURE__ */
|
|
24
|
-
className: e([
|
|
25
|
-
children: [/* @__PURE__ */
|
|
20
|
+
function x({ logs: m, filter: h, className: g }) {
|
|
21
|
+
let [_, x] = a(h, null), S = t("logViewer"), C = i(() => _ ? m.filter((e) => e.level === _) : m, [m, _]);
|
|
22
|
+
return /* @__PURE__ */ r("div", {
|
|
23
|
+
className: e([o, g]),
|
|
24
|
+
children: [/* @__PURE__ */ r("div", {
|
|
25
|
+
className: e([s]),
|
|
26
|
+
children: [/* @__PURE__ */ n("button", {
|
|
26
27
|
type: "button",
|
|
27
|
-
onClick: () =>
|
|
28
|
-
className: e([
|
|
29
|
-
children:
|
|
30
|
-
}),
|
|
28
|
+
onClick: () => x(null),
|
|
29
|
+
className: e([c, !_ && l]),
|
|
30
|
+
children: S.all
|
|
31
|
+
}), b.map((t) => /* @__PURE__ */ n("button", {
|
|
31
32
|
type: "button",
|
|
32
|
-
onClick: () =>
|
|
33
|
-
className: e([
|
|
34
|
-
children:
|
|
35
|
-
},
|
|
36
|
-
}), /* @__PURE__ */
|
|
37
|
-
className: e([
|
|
38
|
-
children: [
|
|
39
|
-
className: e([
|
|
33
|
+
onClick: () => x(t),
|
|
34
|
+
className: e([c, _ === t && l]),
|
|
35
|
+
children: t
|
|
36
|
+
}, t))]
|
|
37
|
+
}), /* @__PURE__ */ r("div", {
|
|
38
|
+
className: e([u]),
|
|
39
|
+
children: [C.map((t, i) => /* @__PURE__ */ r("div", {
|
|
40
|
+
className: e([d]),
|
|
40
41
|
children: [
|
|
41
|
-
|
|
42
|
-
className: e([
|
|
43
|
-
children:
|
|
42
|
+
t.timestamp && /* @__PURE__ */ n("span", {
|
|
43
|
+
className: e([f]),
|
|
44
|
+
children: t.timestamp
|
|
44
45
|
}),
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
className: e([
|
|
47
|
-
children:
|
|
46
|
+
/* @__PURE__ */ n("span", {
|
|
47
|
+
className: e([p, y[t.level]]),
|
|
48
|
+
children: t.level
|
|
48
49
|
}),
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
className: e([
|
|
51
|
-
children:
|
|
50
|
+
/* @__PURE__ */ n("span", {
|
|
51
|
+
className: e([v]),
|
|
52
|
+
children: t.message
|
|
52
53
|
})
|
|
53
54
|
]
|
|
54
|
-
}, i)),
|
|
55
|
-
className: e([
|
|
56
|
-
children: /* @__PURE__ */
|
|
55
|
+
}, i)), C.length === 0 && /* @__PURE__ */ n("div", {
|
|
56
|
+
className: e([d]),
|
|
57
|
+
children: /* @__PURE__ */ n("span", {
|
|
57
58
|
style: { color: "var(--haze-color-text-muted)" },
|
|
58
|
-
className: e([
|
|
59
|
-
children:
|
|
59
|
+
className: e([v]),
|
|
60
|
+
children: S.noLogs
|
|
60
61
|
})
|
|
61
62
|
})]
|
|
62
63
|
})]
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
66
|
//#endregion
|
|
66
|
-
export {
|
|
67
|
+
export { x as default };
|