@jc-times/business-ui 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/THIRD_PARTY_NOTICES.md +5 -0
  3. package/assets/pdf-fonts/NotoSans-Bold.ttf +0 -0
  4. package/assets/pdf-fonts/NotoSans-BoldItalic.ttf +0 -0
  5. package/assets/pdf-fonts/NotoSans-Italic.ttf +0 -0
  6. package/assets/pdf-fonts/NotoSans-Regular.ttf +0 -0
  7. package/assets/pdf-fonts/NotoSansHans-Regular.otf +0 -0
  8. package/assets/pdf-fonts/OFL-CJK.txt +92 -0
  9. package/assets/pdf-fonts/OFL-Latin.txt +94 -0
  10. package/assets/pdf-fonts/README.md +11 -0
  11. package/dist/Alert.js +5 -1
  12. package/dist/Button.js +1 -1
  13. package/dist/Cascader.js +19 -19
  14. package/dist/Combobox.js +38 -38
  15. package/dist/DataTableIcons.js +25 -25
  16. package/dist/DateInput.js +67 -67
  17. package/dist/DropdownMenu.js +35 -35
  18. package/dist/EmptyState.js +8 -8
  19. package/dist/ExplainableButton.js +11 -11
  20. package/dist/FloatingControls.js +31 -31
  21. package/dist/ModalShell.js +32 -32
  22. package/dist/MultiSelect.js +37 -37
  23. package/dist/Pagination.js +27 -27
  24. package/dist/RecoverableAsyncState.js +8 -8
  25. package/dist/Select.js +17 -17
  26. package/dist/SortableList.js +18 -18
  27. package/dist/Toast.js +30 -30
  28. package/dist/TreeSelect.js +107 -107
  29. package/dist/data-table.js +71 -71
  30. package/dist/document-viewer/PdfToolbar.js +12 -12
  31. package/dist/document-viewer/PdfWorkspace.js +15 -15
  32. package/dist/document-viewer-v2/DocumentViewerV2.js +49 -48
  33. package/dist/document-viewer-v2/HeadlessPdfViewer.js +128 -124
  34. package/dist/document-viewer-v2/pdf-font-fallback.js +35 -0
  35. package/dist/types/document-viewer-v2/pdf-font-fallback.d.ts +2 -0
  36. package/dist/vendor/embedpdf-zoom-react.js +3 -186
  37. package/dist/vendor/embedpdf-zoom-react10.js +6 -0
  38. package/dist/vendor/embedpdf-zoom-react11.js +30 -0
  39. package/dist/vendor/embedpdf-zoom-react12.js +16 -0
  40. package/dist/vendor/embedpdf-zoom-react13.js +15 -0
  41. package/dist/vendor/embedpdf-zoom-react14.js +33 -0
  42. package/dist/vendor/embedpdf-zoom-react15.js +20 -0
  43. package/dist/vendor/embedpdf-zoom-react16.js +26 -0
  44. package/dist/vendor/embedpdf-zoom-react17.js +25 -0
  45. package/dist/vendor/embedpdf-zoom-react18.js +17 -0
  46. package/dist/vendor/embedpdf-zoom-react19.js +187 -0
  47. package/dist/vendor/embedpdf-zoom-react2.js +13 -0
  48. package/dist/vendor/embedpdf-zoom-react3.js +14 -0
  49. package/dist/vendor/embedpdf-zoom-react4.js +8 -0
  50. package/dist/vendor/embedpdf-zoom-react5.js +4 -0
  51. package/dist/vendor/embedpdf-zoom-react6.js +14 -0
  52. package/dist/vendor/embedpdf-zoom-react7.js +40 -0
  53. package/dist/vendor/embedpdf-zoom-react8.js +17 -0
  54. package/dist/vendor/embedpdf-zoom-react9.js +7 -0
  55. package/docs/agent-guide.md +2 -0
  56. package/docs/document-viewer-v2.md +2 -2
  57. package/package.json +7 -3
package/dist/DateInput.js CHANGED
@@ -1,38 +1,38 @@
1
1
  import { useOverlayContainer as e } from "./OverlayContainer.js";
2
- import { CalendarDays as t, ChevronLeft as n, ChevronRight as r, X as ee } from "lucide-react";
3
- import { forwardRef as i, useCallback as te, useEffect as a, useId as ne, useRef as o, useState as s } from "react";
4
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
5
- import * as u from "@radix-ui/react-popover";
6
- import { Button as d, Calendar as re, CalendarCell as ie, CalendarGrid as ae, CalendarGridBody as oe, CalendarGridHeader as se, CalendarHeaderCell as ce, Heading as le, I18nProvider as ue } from "react-aria-components";
7
- import { CalendarDate as de, getLocalTimeZone as f, parseDate as p, today as m } from "@internationalized/date";
2
+ import { forwardRef as t, useCallback as n, useEffect as r, useId as ee, useRef as i, useState as a } from "react";
3
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
4
+ import { CalendarDays as te, ChevronLeft as ne, ChevronRight as re, X as c } from "lucide-react";
5
+ import * as l from "@radix-ui/react-popover";
6
+ import { Button as u, Calendar as ie, CalendarCell as ae, CalendarGrid as oe, CalendarGridBody as se, CalendarGridHeader as ce, CalendarHeaderCell as le, Heading as ue, I18nProvider as de } from "react-aria-components";
7
+ import { CalendarDate as fe, getLocalTimeZone as d, parseDate as f, today as p } from "@internationalized/date";
8
8
  //#region src/DateInput.tsx
9
- var h = "jc-business-ui-date-input-open", g = i(function({ value: i, onValueChange: p, inputRef: g, inputClassName: b, className: S = "", disabled: C, readOnly: w, required: T, inputMode: fe = "numeric", autoComplete: pe = "off", onFocus: me, onBlur: he, onKeyDown: ge, min: E, max: D, minDate: _e, maxDate: ve, isDateUnavailable: O, onValidationError: ye, ...k }, A) {
10
- let j = `ui-date-calendar-${ne().replaceAll(":", "")}`, be = e(), M = o(null), N = o(!1), P = o(!1), F = o(!1), [I, L] = s(!1), [R, z] = s(() => _(i)), [B, V] = s(""), H = v(i), U = v(_e ?? (E === void 0 ? "" : String(E))), W = v(ve ?? (D === void 0 ? "" : String(D))), [G, K] = s(() => H ?? m(f())), q = !!(C || w), xe = te((e) => {
11
- M.current = e, x(g, e), x(A, e);
12
- }, [g, A]);
13
- a(() => {
14
- z(_(i)), V(""), M.current?.setCustomValidity("");
15
- }, [i]), a(() => {
9
+ var m = "jc-business-ui-date-input-open", h = t(function({ value: t, onValueChange: f, inputRef: h, inputClassName: y, className: x = "", disabled: S, readOnly: C, required: w, inputMode: pe = "numeric", autoComplete: me = "off", onFocus: T, onBlur: he, onKeyDown: ge, min: E, max: D, minDate: _e, maxDate: ve, isDateUnavailable: O, onValidationError: ye, ...k }, A) {
10
+ let j = `ui-date-calendar-${ee().replaceAll(":", "")}`, be = e(), M = i(null), N = i(!1), P = i(!1), F = i(!1), [I, L] = a(!1), [R, z] = a(() => g(t)), [B, V] = a(""), H = _(t), U = _(_e ?? (E === void 0 ? "" : String(E))), W = _(ve ?? (D === void 0 ? "" : String(D))), [G, K] = a(() => H ?? p(d())), q = !!(S || C), xe = n((e) => {
11
+ M.current = e, b(h, e), b(A, e);
12
+ }, [h, A]);
13
+ r(() => {
14
+ z(g(t)), V(""), M.current?.setCustomValidity("");
15
+ }, [t]), r(() => {
16
16
  q && L(!1);
17
- }, [q]), a(() => {
17
+ }, [q]), r(() => {
18
18
  let e = (e) => {
19
19
  e.detail !== j && L(!1);
20
20
  };
21
- return document.addEventListener(h, e), () => document.removeEventListener(h, e);
21
+ return document.addEventListener(m, e), () => document.removeEventListener(m, e);
22
22
  }, [j]);
23
23
  function J(e) {
24
24
  if (!(e && q)) {
25
25
  if (e && !I) {
26
- document.dispatchEvent(new CustomEvent(h, { detail: j }));
27
- let e = H ?? m(f());
26
+ document.dispatchEvent(new CustomEvent(m, { detail: j }));
27
+ let e = H ?? p(d());
28
28
  U && e.compare(U) < 0 && (e = U), W && e.compare(W) > 0 && (e = W), K(e);
29
29
  }
30
30
  L(e);
31
31
  }
32
32
  }
33
33
  function Y(e) {
34
- if (!e) return T ? "请选择日期" : "";
35
- let t = v(e);
34
+ if (!e) return w ? "请选择日期" : "";
35
+ let t = _(e);
36
36
  return t ? U && t.compare(U) < 0 ? `日期不能早于 ${U}` : W && t.compare(W) > 0 ? `日期不能晚于 ${W}` : O?.(t.toString()) ? "该日期不可选择" : "" : "请输入有效日期(YYYY/MM/DD)";
37
37
  }
38
38
  function X(e) {
@@ -40,33 +40,33 @@ var h = "jc-business-ui-date-input-open", g = i(function({ value: i, onValueChan
40
40
  }
41
41
  function Z() {
42
42
  if (q) return;
43
- let e = R.trim() ? y(R) : "", t = e === null ? "请输入有效日期(YYYY/MM/DD)" : Y(e);
44
- X(t), !t && e !== null && (z(_(e)), e !== i && p(e));
43
+ let e = R.trim() ? v(R) : "", n = e === null ? "请输入有效日期(YYYY/MM/DD)" : Y(e);
44
+ X(n), !n && e !== null && (z(g(e)), e !== t && f(e));
45
45
  }
46
46
  function Q(e) {
47
47
  if (q) return;
48
48
  let t = Y(e);
49
- X(t), !t && (F.current = !0, p(e), z(_(e)), L(!1));
49
+ X(t), !t && (F.current = !0, f(e), z(g(e)), L(!1));
50
50
  }
51
- let $ = m(f()).toString();
52
- return /* @__PURE__ */ l(u.Root, {
51
+ let $ = p(d()).toString();
52
+ return /* @__PURE__ */ s(l.Root, {
53
53
  open: I && !q,
54
54
  onOpenChange: J,
55
55
  children: [
56
- /* @__PURE__ */ c(u.Anchor, {
56
+ /* @__PURE__ */ o(l.Anchor, {
57
57
  asChild: !0,
58
- children: /* @__PURE__ */ l("span", {
59
- className: `ui-date-input${I ? " open" : ""}${S ? ` ${S}` : ""}`,
60
- children: [/* @__PURE__ */ c("input", {
58
+ children: /* @__PURE__ */ s("span", {
59
+ className: `ui-date-input${I ? " open" : ""}${x ? ` ${x}` : ""}`,
60
+ children: [/* @__PURE__ */ o("input", {
61
61
  ...k,
62
62
  ref: xe,
63
- className: b,
63
+ className: y,
64
64
  type: "text",
65
- inputMode: fe,
66
- autoComplete: pe,
67
- disabled: C,
68
- readOnly: w,
69
- required: T,
65
+ inputMode: pe,
66
+ autoComplete: me,
67
+ disabled: S,
68
+ readOnly: C,
69
+ required: w,
70
70
  value: R,
71
71
  placeholder: k.placeholder ?? "YYYY/MM/DD",
72
72
  "aria-haspopup": "dialog",
@@ -75,7 +75,7 @@ var h = "jc-business-ui-date-input-open", g = i(function({ value: i, onValueChan
75
75
  "aria-invalid": B ? !0 : k["aria-invalid"],
76
76
  "aria-describedby": [k["aria-describedby"], B ? `${j}-error` : ""].filter(Boolean).join(" ") || void 0,
77
77
  onFocus: (e) => {
78
- me?.(e), !e.defaultPrevented && !N.current && J(!0);
78
+ T?.(e), !e.defaultPrevented && !N.current && J(!0);
79
79
  },
80
80
  onChange: (e) => {
81
81
  z(e.target.value), B && X("");
@@ -86,7 +86,7 @@ var h = "jc-business-ui-date-input-open", g = i(function({ value: i, onValueChan
86
86
  onKeyDown: (e) => {
87
87
  ge?.(e), !(e.defaultPrevented || e.nativeEvent.isComposing || e.keyCode === 229 || q) && (e.key === "ArrowDown" && (e.preventDefault(), P.current = !0, J(!0), I && document.getElementById(j)?.querySelector("[role=\"gridcell\"] [tabindex=\"0\"]")?.focus()), e.key === "Enter" && (e.preventDefault(), Z()));
88
88
  }
89
- }), /* @__PURE__ */ c("button", {
89
+ }), /* @__PURE__ */ o("button", {
90
90
  type: "button",
91
91
  className: "ui-date-trigger",
92
92
  disabled: q,
@@ -96,22 +96,22 @@ var h = "jc-business-ui-date-input-open", g = i(function({ value: i, onValueChan
96
96
  onClick: () => {
97
97
  P.current = !0, J(!I);
98
98
  },
99
- children: /* @__PURE__ */ c(t, {
99
+ children: /* @__PURE__ */ o(te, {
100
100
  size: 17,
101
101
  "aria-hidden": "true"
102
102
  })
103
103
  })]
104
104
  })
105
105
  }),
106
- B && /* @__PURE__ */ c("span", {
106
+ B && /* @__PURE__ */ o("span", {
107
107
  id: `${j}-error`,
108
108
  className: "ui-form-error",
109
109
  role: "alert",
110
110
  children: B
111
111
  }),
112
- /* @__PURE__ */ c(u.Portal, {
112
+ /* @__PURE__ */ o(l.Portal, {
113
113
  container: be,
114
- children: /* @__PURE__ */ l(u.Content, {
114
+ children: /* @__PURE__ */ s(l.Content, {
115
115
  id: j,
116
116
  className: "ui-date-calendar",
117
117
  "aria-label": "选择日期",
@@ -129,9 +129,9 @@ var h = "jc-business-ui-date-input-open", g = i(function({ value: i, onValueChan
129
129
  onInteractOutside: (e) => {
130
130
  M.current?.parentElement?.contains(e.target) && e.preventDefault();
131
131
  },
132
- children: [/* @__PURE__ */ c(ue, {
132
+ children: [/* @__PURE__ */ o(de, {
133
133
  locale: "zh-CN",
134
- children: /* @__PURE__ */ l(re, {
134
+ children: /* @__PURE__ */ s(ie, {
135
135
  "aria-label": "选择日期",
136
136
  value: H,
137
137
  onChange: (e) => Q(e.toString()),
@@ -139,51 +139,51 @@ var h = "jc-business-ui-date-input-open", g = i(function({ value: i, onValueChan
139
139
  maxValue: W ?? void 0,
140
140
  isDateUnavailable: (e) => O?.(e.toString()) ?? !1,
141
141
  focusedValue: G,
142
- onFocusChange: (e) => K(new de(e.year, e.month, e.day)),
142
+ onFocusChange: (e) => K(new fe(e.year, e.month, e.day)),
143
143
  children: [
144
- /* @__PURE__ */ l("header", { children: [
145
- /* @__PURE__ */ c(d, {
144
+ /* @__PURE__ */ s("header", { children: [
145
+ /* @__PURE__ */ o(u, {
146
146
  slot: "previous",
147
147
  "aria-label": "上个月",
148
- children: /* @__PURE__ */ c(n, { size: 18 })
148
+ children: /* @__PURE__ */ o(ne, { size: 18 })
149
149
  }),
150
- /* @__PURE__ */ c(le, {}),
151
- /* @__PURE__ */ c(d, {
150
+ /* @__PURE__ */ o(ue, {}),
151
+ /* @__PURE__ */ o(u, {
152
152
  slot: "next",
153
153
  "aria-label": "下个月",
154
- children: /* @__PURE__ */ c(r, { size: 18 })
154
+ children: /* @__PURE__ */ o(re, { size: 18 })
155
155
  })
156
156
  ] }),
157
- /* @__PURE__ */ l("label", {
157
+ /* @__PURE__ */ s("label", {
158
158
  className: "ui-date-month-jump",
159
- children: ["跳转年月", /* @__PURE__ */ c("input", {
159
+ children: ["跳转年月", /* @__PURE__ */ o("input", {
160
160
  type: "month",
161
161
  "aria-label": "跳转年月",
162
162
  value: `${G.year.toString().padStart(4, "0")}-${String(G.month).padStart(2, "0")}`,
163
163
  min: U?.toString().slice(0, 7),
164
164
  max: W?.toString().slice(0, 7),
165
165
  onChange: (e) => {
166
- let t = v(`${e.target.value}-01`);
166
+ let t = _(`${e.target.value}-01`);
167
167
  t && K(U && t.compare(U) < 0 ? U : W && t.compare(W) > 0 ? W : t);
168
168
  }
169
169
  })]
170
170
  }),
171
- /* @__PURE__ */ l(ae, {
171
+ /* @__PURE__ */ s(oe, {
172
172
  className: "ui-aria-calendar-grid",
173
- children: [/* @__PURE__ */ c(se, { children: (e) => /* @__PURE__ */ c(ce, { children: e }) }), /* @__PURE__ */ c(oe, { children: (e) => /* @__PURE__ */ c(ie, {
173
+ children: [/* @__PURE__ */ o(ce, { children: (e) => /* @__PURE__ */ o(le, { children: e }) }), /* @__PURE__ */ o(se, { children: (e) => /* @__PURE__ */ o(ae, {
174
174
  date: e,
175
175
  "data-date": e.toString()
176
176
  }) })]
177
177
  })
178
178
  ]
179
179
  })
180
- }), /* @__PURE__ */ l("footer", { children: [/* @__PURE__ */ l("button", {
180
+ }), /* @__PURE__ */ s("footer", { children: [/* @__PURE__ */ s("button", {
181
181
  type: "button",
182
182
  className: "ui-date-clear",
183
- disabled: !i || T,
183
+ disabled: !t || w,
184
184
  onClick: () => Q(""),
185
- children: [/* @__PURE__ */ c(ee, { size: 14 }), "清除"]
186
- }), /* @__PURE__ */ c("button", {
185
+ children: [/* @__PURE__ */ o(c, { size: 14 }), "清除"]
186
+ }), /* @__PURE__ */ o("button", {
187
187
  type: "button",
188
188
  className: "ui-date-today",
189
189
  disabled: !!Y($),
@@ -195,29 +195,29 @@ var h = "jc-business-ui-date-input-open", g = i(function({ value: i, onValueChan
195
195
  ]
196
196
  });
197
197
  });
198
- function _(e) {
198
+ function g(e) {
199
199
  return /^\d{4}-\d{2}-\d{2}$/.test(e) ? e.replaceAll("-", "/") : e;
200
200
  }
201
- function v(e) {
202
- let t = y(e);
203
- return t ? p(t) : null;
201
+ function _(e) {
202
+ let t = v(e);
203
+ return t ? f(t) : null;
204
204
  }
205
- function y(e) {
205
+ function v(e) {
206
206
  let t = e.trim().match(/^(\d{4})[/.\-](\d{1,2})[/.\-](\d{1,2})$/);
207
207
  if (!t || Number(t[1]) < 1) return null;
208
208
  let n = `${t[1]}-${t[2].padStart(2, "0")}-${t[3].padStart(2, "0")}`;
209
209
  try {
210
- return p(n).toString();
210
+ return f(n).toString();
211
211
  } catch {
212
212
  return null;
213
213
  }
214
214
  }
215
- function b(e, t) {
215
+ function y(e, t) {
216
216
  let n = new Date(e, t, 1), r = new Date(e, t, 1 - n.getDay());
217
217
  return Array.from({ length: 42 }, (e, t) => ({ date: new Date(r.getFullYear(), r.getMonth(), r.getDate() + t) }));
218
218
  }
219
- function x(e, t) {
219
+ function b(e, t) {
220
220
  typeof e == "function" ? e(t) : e && (e.current = t);
221
221
  }
222
222
  //#endregion
223
- export { g as DateInput, b as calendarDays, y as parseDate };
223
+ export { h as DateInput, y as calendarDays, v as parseDate };
@@ -1,55 +1,55 @@
1
1
  import { buttonClassName as e } from "./Button.js";
2
2
  import { useOverlayContainer as t } from "./OverlayContainer.js";
3
- import { Check as n, ChevronRight as r } from "lucide-react";
4
- import { createElement as i, useId as a } from "react";
5
- import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
3
+ import { createElement as n, useId as r } from "react";
4
+ import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
5
+ import { Check as s, ChevronRight as c } from "lucide-react";
6
6
  import { Button as l, Header as u, Menu as d, MenuItem as f, MenuSection as p, MenuTrigger as m, Popover as h, Separator as g, SubmenuTrigger as _ } from "react-aria-components";
7
7
  //#region src/DropdownMenu.tsx
8
- function v({ trigger: n, triggerLabel: r, triggerVariant: i = "secondary", triggerSize: o = "default", items: u, menuLabel: f, triggerRef: p, triggerProps: g, menuRef: _, menuProps: v, placement: b = "bottom start", portalContainer: S, disabled: C = !1, className: w = "", selectionMode: T = "none", selectedKeys: E, defaultSelectedKeys: D, onSelectionChange: O }) {
9
- let k = v?.["aria-label"] ?? f, A = t(S), j = a(), M = T === "none" ? { selectionMode: T } : {
8
+ function v({ trigger: n, triggerLabel: i, triggerVariant: s = "secondary", triggerSize: c = "default", items: u, menuLabel: f, triggerRef: p, triggerProps: g, menuRef: _, menuProps: v, placement: b = "bottom start", portalContainer: S, disabled: C = !1, className: w = "", selectionMode: T = "none", selectedKeys: E, defaultSelectedKeys: D, onSelectionChange: O }) {
9
+ let k = v?.["aria-label"] ?? f, A = t(S), j = r(), M = T === "none" ? { selectionMode: T } : {
10
10
  selectionMode: T,
11
11
  selectedKeys: E,
12
12
  defaultSelectedKeys: D,
13
13
  onSelectionChange: O ? (e) => O(x(e)) : void 0
14
14
  };
15
- return /* @__PURE__ */ c(m, { children: [/* @__PURE__ */ s(l, {
15
+ return /* @__PURE__ */ o(m, { children: [/* @__PURE__ */ a(l, {
16
16
  ...g,
17
17
  ref: p,
18
18
  className: e({
19
- variant: i,
20
- size: o
19
+ variant: s,
20
+ size: c
21
21
  }),
22
- "aria-label": g?.["aria-label"] ?? r,
22
+ "aria-label": g?.["aria-label"] ?? i,
23
23
  isDisabled: C,
24
24
  children: n
25
- }), /* @__PURE__ */ c(h, {
25
+ }), /* @__PURE__ */ o(h, {
26
26
  className: `ui-dropdown-popover ${w}`.trim(),
27
27
  "data-ui-aria-overlay": "",
28
28
  placement: b,
29
29
  UNSTABLE_portalContainer: A,
30
- children: [k === void 0 ? null : /* @__PURE__ */ s("span", {
30
+ children: [k === void 0 ? null : /* @__PURE__ */ a("span", {
31
31
  id: j,
32
32
  className: "ui-visually-hidden",
33
33
  children: k
34
- }), /* @__PURE__ */ s(d, {
34
+ }), /* @__PURE__ */ a(d, {
35
35
  ...v,
36
36
  ...M,
37
37
  ref: _,
38
38
  className: "ui-dropdown-menu",
39
- "aria-label": k === void 0 ? r ?? "操作菜单" : void 0,
39
+ "aria-label": k === void 0 ? i ?? "操作菜单" : void 0,
40
40
  "aria-labelledby": k === void 0 ? v?.["aria-labelledby"] : j,
41
41
  children: y(u, M, A)
42
42
  })]
43
43
  })] });
44
44
  }
45
- function y(e, t, n) {
46
- return e.map((e) => e.type === "separator" ? /* @__PURE__ */ s(g, { className: "ui-dropdown-separator" }, e.id) : e.type === "group" ? /* @__PURE__ */ c(p, {
45
+ function y(e, t, r) {
46
+ return e.map((e) => e.type === "separator" ? /* @__PURE__ */ a(g, { className: "ui-dropdown-separator" }, e.id) : e.type === "group" ? /* @__PURE__ */ o(p, {
47
47
  className: "ui-dropdown-group",
48
- children: [e.label === void 0 ? null : /* @__PURE__ */ s(u, {
48
+ children: [e.label === void 0 ? null : /* @__PURE__ */ a(u, {
49
49
  className: "ui-dropdown-header",
50
50
  children: e.label
51
- }), y(e.items, t, n)]
52
- }, e.id) : e.type === "submenu" ? /* @__PURE__ */ c(_, { children: [/* @__PURE__ */ s(f, {
51
+ }), y(e.items, t, r)]
52
+ }, e.id) : e.type === "submenu" ? /* @__PURE__ */ o(_, { children: [/* @__PURE__ */ a(f, {
53
53
  ...e.itemProps,
54
54
  ref: S(e.current, e.itemRef),
55
55
  id: e.id,
@@ -57,26 +57,26 @@ function y(e, t, n) {
57
57
  isDisabled: e.disabled,
58
58
  "aria-current": e.current,
59
59
  className: "ui-dropdown-item",
60
- children: (t) => /* @__PURE__ */ s(b, {
60
+ children: (t) => /* @__PURE__ */ a(b, {
61
61
  item: e,
62
62
  selected: t.isSelected,
63
- fallbackEnd: /* @__PURE__ */ s(r, {
63
+ fallbackEnd: /* @__PURE__ */ a(c, {
64
64
  size: 15,
65
65
  "aria-hidden": "true"
66
66
  })
67
67
  })
68
- }), /* @__PURE__ */ s(h, {
68
+ }), /* @__PURE__ */ a(h, {
69
69
  className: "ui-dropdown-popover",
70
70
  "data-ui-aria-overlay": "",
71
71
  placement: "right top",
72
- UNSTABLE_portalContainer: n,
73
- children: /* @__PURE__ */ s(d, {
72
+ UNSTABLE_portalContainer: r,
73
+ children: /* @__PURE__ */ a(d, {
74
74
  ...t,
75
75
  className: "ui-dropdown-menu",
76
76
  "aria-label": e.textValue,
77
- children: y(e.items, t, n)
77
+ children: y(e.items, t, r)
78
78
  })
79
- })] }, e.id) : /* @__PURE__ */ i(f, {
79
+ })] }, e.id) : /* @__PURE__ */ n(f, {
80
80
  ...e.itemProps,
81
81
  key: e.id,
82
82
  ref: S(e.current, e.itemRef),
@@ -86,35 +86,35 @@ function y(e, t, n) {
86
86
  "aria-current": e.current,
87
87
  onAction: e.onAction,
88
88
  className: `ui-dropdown-item${e.dangerous ? " dangerous" : ""}`
89
- }, (t) => /* @__PURE__ */ s(b, {
89
+ }, (t) => /* @__PURE__ */ a(b, {
90
90
  item: e,
91
91
  selected: t.isSelected
92
92
  })));
93
93
  }
94
- function b({ item: e, selected: t, fallbackEnd: r }) {
95
- let i = e.selectedIcon ?? /* @__PURE__ */ s(n, {
94
+ function b({ item: e, selected: t, fallbackEnd: n }) {
95
+ let r = e.selectedIcon ?? /* @__PURE__ */ a(s, {
96
96
  size: 15,
97
97
  "aria-hidden": "true"
98
98
  });
99
- return /* @__PURE__ */ c(o, { children: [
100
- e.startIcon === void 0 ? null : /* @__PURE__ */ s("span", {
99
+ return /* @__PURE__ */ o(i, { children: [
100
+ e.startIcon === void 0 ? null : /* @__PURE__ */ a("span", {
101
101
  className: "ui-dropdown-item-icon",
102
102
  "aria-hidden": "true",
103
103
  children: e.startIcon
104
104
  }),
105
- /* @__PURE__ */ s("span", {
105
+ /* @__PURE__ */ a("span", {
106
106
  className: "ui-dropdown-item-label",
107
107
  children: e.label
108
108
  }),
109
- e.endSlot === void 0 ? null : /* @__PURE__ */ s("span", {
109
+ e.endSlot === void 0 ? null : /* @__PURE__ */ a("span", {
110
110
  className: "ui-dropdown-item-status",
111
111
  children: e.endSlot
112
112
  }),
113
- t ? /* @__PURE__ */ s("span", {
113
+ t ? /* @__PURE__ */ a("span", {
114
114
  className: "ui-dropdown-item-selected",
115
115
  "aria-hidden": "true",
116
- children: i
117
- }) : r
116
+ children: r
117
+ }) : n
118
118
  ] });
119
119
  }
120
120
  function x(e) {
@@ -1,22 +1,22 @@
1
- import { Inbox as e } from "lucide-react";
2
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
+ import { Inbox as n } from "lucide-react";
3
3
  //#region src/EmptyState.tsx
4
4
  function r({ icon: r, title: i, description: a, action: o, compact: s = !1, className: c = "", ...l }) {
5
- return /* @__PURE__ */ n("div", {
5
+ return /* @__PURE__ */ t("div", {
6
6
  ...l,
7
7
  className: `ui-empty-state${s ? " compact" : ""} ${c}`.trim(),
8
8
  children: [
9
- /* @__PURE__ */ t("div", {
9
+ /* @__PURE__ */ e("div", {
10
10
  className: "ui-empty-icon",
11
11
  "aria-hidden": "true",
12
- children: r ?? /* @__PURE__ */ t(e, { size: 24 })
12
+ children: r ?? /* @__PURE__ */ e(n, { size: 24 })
13
13
  }),
14
- /* @__PURE__ */ t("strong", { children: i }),
15
- a === void 0 ? null : /* @__PURE__ */ t("div", {
14
+ /* @__PURE__ */ e("strong", { children: i }),
15
+ a === void 0 ? null : /* @__PURE__ */ e("div", {
16
16
  className: "ui-empty-description",
17
17
  children: a
18
18
  }),
19
- o === void 0 ? null : /* @__PURE__ */ t("div", {
19
+ o === void 0 ? null : /* @__PURE__ */ e("div", {
20
20
  className: "ui-empty-action",
21
21
  children: o
22
22
  })
@@ -1,11 +1,11 @@
1
1
  import { Button as e } from "./Button.js";
2
- import { CircleHelp as t } from "lucide-react";
3
- import { useEffect as n, useId as r, useRef as i, useState as a } from "react";
4
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
2
+ import { useEffect as t, useId as n, useRef as r, useState as i } from "react";
3
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
4
+ import { CircleHelp as s } from "lucide-react";
5
5
  //#region src/ExplainableButton.tsx
6
6
  function c({ disabled: c = !1, disabledReason: l, reasonPresentation: u = "inline", onClick: d, onFocus: f, onBlur: p, onKeyDown: m, children: h, ...g }) {
7
- let _ = `ui-action-reason-${r().replace(/:/g, "")}`, v = c && !!l, y = v && u === "popover", [b, x] = a(!1), S = i(null), C = [g["aria-describedby"], v ? _ : void 0].filter(Boolean).join(" ") || void 0;
8
- n(() => {
7
+ let _ = `ui-action-reason-${n().replace(/:/g, "")}`, v = c && !!l, y = v && u === "popover", [b, x] = i(!1), S = r(null), C = [g["aria-describedby"], v ? _ : void 0].filter(Boolean).join(" ") || void 0;
8
+ t(() => {
9
9
  if (!y || !b) return;
10
10
  let e = (e) => {
11
11
  S.current?.contains(e.target) || x(!1);
@@ -15,7 +15,7 @@ function c({ disabled: c = !1, disabledReason: l, reasonPresentation: u = "inlin
15
15
  return window.addEventListener("pointerdown", e), window.addEventListener("keydown", t), () => {
16
16
  window.removeEventListener("pointerdown", e), window.removeEventListener("keydown", t);
17
17
  };
18
- }, [y, b]), n(() => {
18
+ }, [y, b]), t(() => {
19
19
  y || x(!1);
20
20
  }, [y]);
21
21
  function w(e) {
@@ -46,21 +46,21 @@ function c({ disabled: c = !1, disabledReason: l, reasonPresentation: u = "inlin
46
46
  onBlur: E,
47
47
  onKeyDown: D
48
48
  };
49
- return /* @__PURE__ */ s("span", {
49
+ return /* @__PURE__ */ o("span", {
50
50
  ref: S,
51
51
  className: `ui-explainable-action${v ? " is-blocked" : ""}${y ? " reason-popover" : ""}${b ? " reason-open" : ""}`,
52
- children: [/* @__PURE__ */ o(e, {
52
+ children: [/* @__PURE__ */ a(e, {
53
53
  ...O,
54
54
  children: h
55
- }), v && /* @__PURE__ */ s("small", {
55
+ }), v && /* @__PURE__ */ o("small", {
56
56
  className: "ui-explainable-reason",
57
57
  id: _,
58
58
  role: y ? "tooltip" : "note",
59
59
  "aria-live": y ? "polite" : void 0,
60
- children: [/* @__PURE__ */ o(t, {
60
+ children: [/* @__PURE__ */ a(s, {
61
61
  "aria-hidden": "true",
62
62
  size: 14
63
- }), /* @__PURE__ */ o("span", { children: l })]
63
+ }), /* @__PURE__ */ a("span", { children: l })]
64
64
  })]
65
65
  });
66
66
  }
@@ -1,27 +1,27 @@
1
1
  import { Button as e } from "./Button.js";
2
2
  import { useOverlayContainer as t } from "./OverlayContainer.js";
3
- import { X as n } from "lucide-react";
4
- import { useId as r, useState as i } from "react";
5
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
3
+ import { useId as n, useState as r } from "react";
4
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
+ import { X as o } from "lucide-react";
6
6
  import * as s from "@radix-ui/react-popover";
7
7
  import * as c from "@radix-ui/react-tooltip";
8
8
  //#region src/FloatingControls.tsx
9
- function l({ children: e, content: n, side: r = "top", delayDuration: i = 450, disabled: s = !1, contentClassName: l = "" }) {
9
+ function l({ children: e, content: n, side: r = "top", delayDuration: o = 450, disabled: s = !1, contentClassName: l = "" }) {
10
10
  let u = t();
11
- return s ? e : /* @__PURE__ */ a(c.Provider, {
12
- delayDuration: i,
11
+ return s ? e : /* @__PURE__ */ i(c.Provider, {
12
+ delayDuration: o,
13
13
  skipDelayDuration: 250,
14
- children: /* @__PURE__ */ o(c.Root, { children: [/* @__PURE__ */ a(c.Trigger, {
14
+ children: /* @__PURE__ */ a(c.Root, { children: [/* @__PURE__ */ i(c.Trigger, {
15
15
  asChild: !0,
16
16
  children: e
17
- }), /* @__PURE__ */ a(c.Portal, {
17
+ }), /* @__PURE__ */ i(c.Portal, {
18
18
  container: u,
19
- children: /* @__PURE__ */ o(c.Content, {
19
+ children: /* @__PURE__ */ a(c.Content, {
20
20
  className: `ui-tooltip ${l}`.trim(),
21
21
  side: r,
22
22
  sideOffset: 7,
23
23
  collisionPadding: 10,
24
- children: [n, /* @__PURE__ */ a(c.Arrow, {
24
+ children: [n, /* @__PURE__ */ i(c.Arrow, {
25
25
  className: "ui-floating-arrow",
26
26
  width: 10,
27
27
  height: 5
@@ -30,19 +30,19 @@ function l({ children: e, content: n, side: r = "top", delayDuration: i = 450, d
30
30
  })] })
31
31
  });
32
32
  }
33
- function u({ trigger: e, children: i, title: c, contentLabel: l, closeLabel: u = "关闭", side: d = "bottom", align: f = "start", open: p, defaultOpen: m, modal: h = !1, onOpenChange: g, contentClassName: _ = "" }) {
34
- let v = t(), y = `ui-popover-title-${r().replaceAll(":", "")}`;
35
- return /* @__PURE__ */ o(s.Root, {
33
+ function u({ trigger: e, children: r, title: c, contentLabel: l, closeLabel: u = "关闭", side: d = "bottom", align: f = "start", open: p, defaultOpen: m, modal: h = !1, onOpenChange: g, contentClassName: _ = "" }) {
34
+ let v = t(), y = `ui-popover-title-${n().replaceAll(":", "")}`;
35
+ return /* @__PURE__ */ a(s.Root, {
36
36
  open: p,
37
37
  defaultOpen: m,
38
38
  modal: h,
39
39
  onOpenChange: g,
40
- children: [/* @__PURE__ */ a(s.Trigger, {
40
+ children: [/* @__PURE__ */ i(s.Trigger, {
41
41
  asChild: !0,
42
42
  children: e
43
- }), /* @__PURE__ */ a(s.Portal, {
43
+ }), /* @__PURE__ */ i(s.Portal, {
44
44
  container: v,
45
- children: /* @__PURE__ */ o(s.Content, {
45
+ children: /* @__PURE__ */ a(s.Content, {
46
46
  className: `ui-popover ${_}`.trim(),
47
47
  side: d,
48
48
  align: f,
@@ -51,22 +51,22 @@ function u({ trigger: e, children: i, title: c, contentLabel: l, closeLabel: u =
51
51
  "aria-label": l,
52
52
  "aria-labelledby": c === void 0 ? void 0 : y,
53
53
  children: [
54
- c === void 0 ? null : /* @__PURE__ */ o("div", {
54
+ c === void 0 ? null : /* @__PURE__ */ a("div", {
55
55
  className: "ui-popover-heading",
56
- children: [/* @__PURE__ */ a("strong", {
56
+ children: [/* @__PURE__ */ i("strong", {
57
57
  id: y,
58
58
  children: c
59
- }), /* @__PURE__ */ a(s.Close, {
59
+ }), /* @__PURE__ */ i(s.Close, {
60
60
  className: "ui-floating-close",
61
61
  "aria-label": u,
62
- children: /* @__PURE__ */ a(n, { size: 16 })
62
+ children: /* @__PURE__ */ i(o, { size: 16 })
63
63
  })]
64
64
  }),
65
- /* @__PURE__ */ a("div", {
65
+ /* @__PURE__ */ i("div", {
66
66
  className: "ui-popover-body",
67
- children: i
67
+ children: r
68
68
  }),
69
- /* @__PURE__ */ a(s.Arrow, {
69
+ /* @__PURE__ */ i(s.Arrow, {
70
70
  className: "ui-floating-arrow",
71
71
  width: 12,
72
72
  height: 6
@@ -76,8 +76,8 @@ function u({ trigger: e, children: i, title: c, contentLabel: l, closeLabel: u =
76
76
  })]
77
77
  });
78
78
  }
79
- function d({ title: t, description: n, confirmLabel: r = "确认", cancelLabel: s = "取消", confirmVariant: c = "danger", onConfirm: l, onConfirmError: d, open: f, defaultOpen: p, onOpenChange: m, ...h }) {
80
- let [g, _] = i(p ?? !1), [v, y] = i(!1), b = f ?? g, x = (e) => {
79
+ function d({ title: t, description: n, confirmLabel: o = "确认", cancelLabel: s = "取消", confirmVariant: c = "danger", onConfirm: l, onConfirmError: d, open: f, defaultOpen: p, onOpenChange: m, ...h }) {
80
+ let [g, _] = r(p ?? !1), [v, y] = r(!1), b = f ?? g, x = (e) => {
81
81
  v || (_(e), m?.(e));
82
82
  };
83
83
  async function S() {
@@ -90,29 +90,29 @@ function d({ title: t, description: n, confirmLabel: r = "确认", cancelLabel:
90
90
  y(!1);
91
91
  }
92
92
  }
93
- return /* @__PURE__ */ o(u, {
93
+ return /* @__PURE__ */ a(u, {
94
94
  ...h,
95
95
  open: b,
96
96
  onOpenChange: x,
97
97
  title: t,
98
- children: [n === void 0 ? null : /* @__PURE__ */ a("div", {
98
+ children: [n === void 0 ? null : /* @__PURE__ */ i("div", {
99
99
  className: "ui-popconfirm-description",
100
100
  children: n
101
- }), /* @__PURE__ */ o("div", {
101
+ }), /* @__PURE__ */ a("div", {
102
102
  className: "ui-popconfirm-actions",
103
- children: [/* @__PURE__ */ a(e, {
103
+ children: [/* @__PURE__ */ i(e, {
104
104
  size: "compact",
105
105
  variant: "outline",
106
106
  disabled: v,
107
107
  onClick: () => x(!1),
108
108
  children: s
109
- }), /* @__PURE__ */ a(e, {
109
+ }), /* @__PURE__ */ i(e, {
110
110
  size: "compact",
111
111
  variant: c,
112
112
  busy: v,
113
113
  busyLabel: "处理中",
114
114
  onClick: S,
115
- children: r
115
+ children: o
116
116
  })]
117
117
  })]
118
118
  });