@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
@@ -1,34 +1,34 @@
1
1
  import { Button as e } from "./Button.js";
2
2
  import { OverlayContainerContext as t } from "./OverlayContainer.js";
3
- import { X as n } from "lucide-react";
4
- import { Children as r, Fragment as i, isValidElement as a, useCallback as o, useEffect as s, useRef as c, useState as l } from "react";
5
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
3
+ import { Children as n, Fragment as r, isValidElement as i, useCallback as a, useEffect as o, useRef as s, useState as c } from "react";
4
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
5
+ import { X as d } from "lucide-react";
6
6
  import * as f from "@radix-ui/react-dialog";
7
7
  //#region src/ModalShell.tsx
8
- function p({ backdropClassName: e = "", panelClassName: n = "", titleId: r, eyebrow: i, title: a, description: p, closeLabel: _, onClose: b, closeDisabled: x = !1, showCloseButton: S = !0, closeIconSize: C = 20, closeOnBackdrop: w = !1, rootRef: T, closeOnEscape: E = !0, initialFocus: D, returnFocus: O, role: k = "dialog", describedBy: A, children: j, footer: M, contentClassName: N = "", contentProps: P, footerClassName: F = "" }) {
9
- let I = c(null), [L, R] = l(null), z = c(typeof document > "u" ? null : document.activeElement), B = o((e) => {
8
+ function p({ backdropClassName: e = "", panelClassName: n = "", titleId: r, eyebrow: i, title: d, description: p, closeLabel: _, onClose: b, closeDisabled: x = !1, showCloseButton: S = !0, closeIconSize: C = 20, closeOnBackdrop: w = !1, rootRef: T, closeOnEscape: E = !0, initialFocus: D, returnFocus: O, role: k = "dialog", describedBy: A, children: j, footer: M, contentClassName: N = "", contentProps: P, footerClassName: F = "" }) {
9
+ let I = s(null), [L, R] = c(null), z = s(typeof document > "u" ? null : document.activeElement), B = a((e) => {
10
10
  I.current = e, v(T, e);
11
- }, [T]), V = c(!1), { ref: H, ...U } = P ?? {};
11
+ }, [T]), V = s(!1), { ref: H, ...U } = P ?? {};
12
12
  function W() {
13
13
  return [...document.querySelectorAll("[role='dialog'][aria-modal='true'],[role='alertdialog'][aria-modal='true']")].at(-1) === I.current;
14
14
  }
15
15
  function G() {
16
16
  !x && W() && b();
17
17
  }
18
- s(() => {
18
+ o(() => {
19
19
  h() && M === void 0 && !V.current && m(j) && (V.current = !0, console.warn("[business-ui] ModalShell 的直接 <footer> child 会位于可滚动正文区。固定底栏请改用 footer 属性,并用 footerClassName 定制样式;组件不会自动搬运 children。"));
20
20
  }, [j, M]);
21
21
  function K(e) {
22
22
  w && e.target === e.currentTarget && G(), e.target.closest("button,a[href],input,select,textarea,[tabindex]") || e.preventDefault();
23
23
  }
24
- return /* @__PURE__ */ u(f.Root, {
24
+ return /* @__PURE__ */ l(f.Root, {
25
25
  open: !0,
26
26
  onOpenChange: (e) => {
27
27
  e || G();
28
28
  },
29
- children: /* @__PURE__ */ u(f.Overlay, {
29
+ children: /* @__PURE__ */ l(f.Overlay, {
30
30
  asChild: !0,
31
- children: /* @__PURE__ */ u(f.Content, {
31
+ children: /* @__PURE__ */ l(f.Content, {
32
32
  asChild: !0,
33
33
  onEscapeKeyDown: (e) => {
34
34
  (x || !E || I.current?.querySelector("[data-ui-aria-overlay]")) && e.preventDefault();
@@ -44,7 +44,7 @@ function p({ backdropClassName: e = "", panelClassName: n = "", titleId: r, eyeb
44
44
  e?.isConnected && e.focus();
45
45
  }
46
46
  },
47
- children: /* @__PURE__ */ u("div", {
47
+ children: /* @__PURE__ */ l("div", {
48
48
  ref: B,
49
49
  "data-ui-focus-managed": "radix",
50
50
  className: `ui-modal-backdrop ${e}`.trim(),
@@ -54,51 +54,51 @@ function p({ backdropClassName: e = "", panelClassName: n = "", titleId: r, eyeb
54
54
  "aria-describedby": A ?? (p === void 0 ? void 0 : `${r}-description`),
55
55
  onMouseDown: K,
56
56
  tabIndex: -1,
57
- children: /* @__PURE__ */ d(t.Provider, {
57
+ children: /* @__PURE__ */ u(t.Provider, {
58
58
  value: L,
59
- children: [/* @__PURE__ */ d("section", {
59
+ children: [/* @__PURE__ */ u("section", {
60
60
  className: `ui-modal ${n}`.trim(),
61
61
  children: [
62
- /* @__PURE__ */ d("header", {
62
+ /* @__PURE__ */ u("header", {
63
63
  className: "ui-modal-header",
64
- children: [/* @__PURE__ */ d("div", { children: [
65
- i === void 0 ? null : /* @__PURE__ */ u("span", {
64
+ children: [/* @__PURE__ */ u("div", { children: [
65
+ i === void 0 ? null : /* @__PURE__ */ l("span", {
66
66
  className: "ui-modal-eyebrow",
67
67
  children: i
68
68
  }),
69
- /* @__PURE__ */ u(f.Title, {
69
+ /* @__PURE__ */ l(f.Title, {
70
70
  asChild: !0,
71
- children: /* @__PURE__ */ u("h2", {
71
+ children: /* @__PURE__ */ l("h2", {
72
72
  id: r,
73
- children: a
73
+ children: d
74
74
  })
75
75
  }),
76
- p === void 0 ? null : /* @__PURE__ */ u(f.Description, {
76
+ p === void 0 ? null : /* @__PURE__ */ l(f.Description, {
77
77
  asChild: !0,
78
- children: /* @__PURE__ */ u("p", {
78
+ children: /* @__PURE__ */ l("p", {
79
79
  id: `${r}-description`,
80
80
  children: p
81
81
  })
82
82
  })
83
- ] }), S && /* @__PURE__ */ u(g, {
83
+ ] }), S && /* @__PURE__ */ l(g, {
84
84
  label: _,
85
85
  disabled: x,
86
86
  size: C,
87
87
  onClose: G
88
88
  })]
89
89
  }),
90
- /* @__PURE__ */ u("div", {
90
+ /* @__PURE__ */ l("div", {
91
91
  ...U,
92
92
  ref: H,
93
93
  className: `ui-modal-content ${N}`.trim(),
94
94
  children: j
95
95
  }),
96
- M === void 0 ? null : /* @__PURE__ */ u("footer", {
96
+ M === void 0 ? null : /* @__PURE__ */ l("footer", {
97
97
  className: `ui-modal-footer ${F}`.trim(),
98
98
  children: M
99
99
  })
100
100
  ]
101
- }), /* @__PURE__ */ u("div", {
101
+ }), /* @__PURE__ */ l("div", {
102
102
  ref: R,
103
103
  className: "ui-overlay-container"
104
104
  })]
@@ -109,21 +109,21 @@ function p({ backdropClassName: e = "", panelClassName: n = "", titleId: r, eyeb
109
109
  });
110
110
  }
111
111
  function m(e) {
112
- return r.toArray(e).some((e) => a(e) ? e.type === "footer" || e.type === i && m(e.props.children) : !1);
112
+ return n.toArray(e).some((e) => i(e) ? e.type === "footer" || e.type === r && m(e.props.children) : !1);
113
113
  }
114
114
  function h() {
115
115
  return typeof process < "u" && process.env.NODE_ENV !== "production";
116
116
  }
117
- function g({ label: t, disabled: r, size: i, onClose: a }) {
118
- return /* @__PURE__ */ u(e, {
117
+ function g({ label: t, disabled: n, size: r, onClose: i }) {
118
+ return /* @__PURE__ */ l(e, {
119
119
  className: "ui-modal-close",
120
120
  variant: "ghost",
121
121
  iconOnly: !0,
122
122
  "aria-label": t,
123
- onClick: a,
124
- disabled: r,
125
- children: /* @__PURE__ */ u(n, {
126
- size: i,
123
+ onClick: i,
124
+ disabled: n,
125
+ children: /* @__PURE__ */ l(d, {
126
+ size: r,
127
127
  "aria-hidden": "true"
128
128
  })
129
129
  });
@@ -1,45 +1,45 @@
1
1
  import { useOverlayContainer as e } from "./OverlayContainer.js";
2
- import { Check as t, ChevronDown as n, LoaderCircle as r } from "lucide-react";
3
- import { useMemo as i, useState as a } from "react";
4
- import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
5
- import { Button as l, ComboBox as u, ComboBoxValue as d, Input as ee, Label as f, ListBox as te, ListBoxItem as ne, Popover as p, Tag as m, TagGroup as h, TagList as g, Text as _ } from "react-aria-components";
6
- import { ListLayout as v, Virtualizer as y } from "react-aria-components/Virtualizer";
2
+ import { useMemo as t, useState as ee } from "react";
3
+ import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
4
+ import { Check as a, ChevronDown as o, LoaderCircle as s } from "lucide-react";
5
+ import { Button as c, ComboBox as l, ComboBoxValue as te, Input as ne, Label as re, ListBox as u, ListBoxItem as d, Popover as f, Tag as p, TagGroup as m, TagList as h, Text as g } from "react-aria-components";
6
+ import { ListLayout as ie, Virtualizer as _ } from "react-aria-components/Virtualizer";
7
7
  //#region src/MultiSelect.tsx
8
- var b = [], x = [], re = {
8
+ var v = [], y = [], b = {
9
9
  rowSize: 48,
10
10
  gap: 2,
11
11
  padding: 4
12
12
  };
13
- function S({ values: S, defaultValues: C = x, onValuesChange: ie, name: w, selectedItems: T = b, items: E, disabled: D, clearLabel: O = "清空选择", selectionLabel: k = "已选项", maxSelected: A, inputValue: j, defaultInputValue: M, onInputChange: N, required: P, label: F, placeholder: I = "搜索或选择", helpText: L, error: R, loading: z, emptyText: B = "没有匹配项", inputRef: V, inputProps: H, placement: U = "bottom start", portalContainer: W, virtualized: G = E.length > 100, className: K = "" }) {
14
- let [q, J] = a(C), Y = S ?? q, ae = e(W), X = i(() => {
13
+ function x({ values: x, defaultValues: S = y, onValuesChange: C, name: w, selectedItems: T = v, items: E, disabled: D, clearLabel: O = "清空选择", selectionLabel: k = "已选项", maxSelected: A, inputValue: j, defaultInputValue: M, onInputChange: N, required: P, label: F, placeholder: I = "搜索或选择", helpText: L, error: R, loading: z, emptyText: B = "没有匹配项", inputRef: V, inputProps: H, placement: U = "bottom start", portalContainer: W, virtualized: G = E.length > 100, className: K = "" }) {
14
+ let [q, J] = ee(S), Y = x ?? q, ae = e(W), X = t(() => {
15
15
  let e = /* @__PURE__ */ new Map();
16
16
  for (let t of T) e.set(t.id, t);
17
17
  for (let t of E) e.set(t.id, t);
18
18
  return e;
19
- }, [T, E]), Z = i(() => [...Y], [Y]), oe = i(() => new Set(Y), [Y]), se = i(() => Z.map((e) => X.get(e) ?? {
19
+ }, [T, E]), Z = t(() => [...Y], [Y]), oe = t(() => new Set(Y), [Y]), se = t(() => Z.map((e) => X.get(e) ?? {
20
20
  id: e,
21
21
  label: e
22
- }), [Z, X]), ce = i(() => [...E], [E]), le = A !== void 0 && Y.length >= A;
22
+ }), [Z, X]), ce = t(() => [...E], [E]), le = A !== void 0 && Y.length >= A;
23
23
  function Q(e) {
24
- D || A !== void 0 && e.length > A && e.length > Y.length || (S === void 0 && J(e), ie?.(e));
24
+ D || A !== void 0 && e.length > A && e.length > Y.length || (x === void 0 && J(e), C?.(e));
25
25
  }
26
- let $ = /* @__PURE__ */ s(te, {
26
+ let $ = /* @__PURE__ */ r(u, {
27
27
  items: ce,
28
28
  className: "ui-combobox-list",
29
29
  layout: G ? "grid" : "stack",
30
- renderEmptyState: () => /* @__PURE__ */ s("div", {
30
+ renderEmptyState: () => /* @__PURE__ */ r("div", {
31
31
  className: "ui-combobox-empty",
32
32
  children: z ? "正在加载…" : B
33
33
  }),
34
- children: (e) => /* @__PURE__ */ s(ne, {
34
+ children: (e) => /* @__PURE__ */ r(d, {
35
35
  id: e.id,
36
36
  textValue: e.label,
37
37
  isDisabled: e.disabled || le && !oe.has(e.id),
38
38
  className: "ui-combobox-item",
39
- children: ({ isSelected: n }) => /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ c("span", { children: [/* @__PURE__ */ s("strong", { children: e.label }), e.description && /* @__PURE__ */ s("small", { children: e.description })] }), n && /* @__PURE__ */ s(t, { size: 15 })] })
39
+ children: ({ isSelected: t }) => /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ i("span", { children: [/* @__PURE__ */ r("strong", { children: e.label }), e.description && /* @__PURE__ */ r("small", { children: e.description })] }), t && /* @__PURE__ */ r(a, { size: 15 })] })
40
40
  })
41
41
  });
42
- return /* @__PURE__ */ c(u, {
42
+ return /* @__PURE__ */ i(l, {
43
43
  selectionMode: "multiple",
44
44
  value: Z,
45
45
  onChange: (e) => Q(e.map(String)),
@@ -54,47 +54,47 @@ function S({ values: S, defaultValues: C = x, onValuesChange: ie, name: w, selec
54
54
  "aria-label": F === void 0 ? H?.["aria-label"] : void 0,
55
55
  className: `ui-combobox ui-multi-select ${K}`.trim(),
56
56
  children: [
57
- F !== void 0 && /* @__PURE__ */ c(f, {
57
+ F !== void 0 && /* @__PURE__ */ i(re, {
58
58
  className: "ui-form-label",
59
- children: [F, P && /* @__PURE__ */ s("span", {
59
+ children: [F, P && /* @__PURE__ */ r("span", {
60
60
  className: "ui-form-required",
61
61
  "aria-hidden": "true",
62
62
  children: "*"
63
63
  })]
64
64
  }),
65
- /* @__PURE__ */ c("div", {
65
+ /* @__PURE__ */ i("div", {
66
66
  className: "ui-combobox-control",
67
- children: [/* @__PURE__ */ s(ee, {
67
+ children: [/* @__PURE__ */ r(ne, {
68
68
  ...H,
69
69
  ref: V,
70
70
  className: "ui-input",
71
71
  placeholder: I
72
- }), /* @__PURE__ */ s(l, {
72
+ }), /* @__PURE__ */ r(c, {
73
73
  className: "ui-combobox-trigger",
74
74
  "aria-label": "展开选项",
75
- children: s(z ? r : n, { size: 16 })
75
+ children: r(z ? s : o, { size: 16 })
76
76
  })]
77
77
  }),
78
- /* @__PURE__ */ s(d, { children: () => Y.length > 0 ? /* @__PURE__ */ c("div", {
78
+ /* @__PURE__ */ r(te, { children: () => Y.length > 0 ? /* @__PURE__ */ i("div", {
79
79
  className: "ui-multi-selection",
80
- children: [/* @__PURE__ */ s(h, {
80
+ children: [/* @__PURE__ */ r(m, {
81
81
  "aria-label": k,
82
82
  onRemove: (e) => Q(Y.filter((t) => !e.has(t))),
83
- disabledKeys: D ? Z : x,
84
- children: /* @__PURE__ */ s(g, {
83
+ disabledKeys: D ? Z : y,
84
+ children: /* @__PURE__ */ r(h, {
85
85
  items: se,
86
- children: (e) => /* @__PURE__ */ c(m, {
86
+ children: (e) => /* @__PURE__ */ i(p, {
87
87
  id: e.id,
88
88
  textValue: e.label,
89
89
  className: "ui-selection-tag",
90
- children: [e.label, /* @__PURE__ */ s(l, {
90
+ children: [e.label, /* @__PURE__ */ r(c, {
91
91
  slot: "remove",
92
92
  "aria-label": `移除 ${e.label}`,
93
93
  children: "×"
94
94
  })]
95
95
  })
96
96
  })
97
- }), /* @__PURE__ */ s("button", {
97
+ }), /* @__PURE__ */ r("button", {
98
98
  type: "button",
99
99
  disabled: D,
100
100
  className: "ui-selection-clear",
@@ -102,31 +102,31 @@ function S({ values: S, defaultValues: C = x, onValuesChange: ie, name: w, selec
102
102
  children: O
103
103
  })]
104
104
  }) : null }),
105
- L !== void 0 && /* @__PURE__ */ s(_, {
105
+ L !== void 0 && /* @__PURE__ */ r(g, {
106
106
  slot: "description",
107
107
  className: "ui-form-help",
108
108
  children: L
109
109
  }),
110
- R && /* @__PURE__ */ s(_, {
110
+ R && /* @__PURE__ */ r(g, {
111
111
  slot: "errorMessage",
112
112
  className: "ui-form-error",
113
113
  children: R
114
114
  }),
115
- w && Y.map((e) => /* @__PURE__ */ s("input", {
115
+ w && Y.map((e) => /* @__PURE__ */ r("input", {
116
116
  type: "hidden",
117
117
  name: w,
118
118
  value: e,
119
119
  disabled: D
120
120
  }, e)),
121
- /* @__PURE__ */ s(p, {
121
+ /* @__PURE__ */ r(f, {
122
122
  className: "ui-combobox-popover",
123
123
  "data-ui-aria-overlay": "",
124
124
  maxHeight: 320,
125
125
  placement: U,
126
126
  UNSTABLE_portalContainer: ae,
127
- children: G ? /* @__PURE__ */ s(y, {
128
- layout: v,
129
- layoutOptions: re,
127
+ children: G ? /* @__PURE__ */ r(_, {
128
+ layout: ie,
129
+ layoutOptions: b,
130
130
  children: $
131
131
  }) : $
132
132
  })
@@ -134,4 +134,4 @@ function S({ values: S, defaultValues: C = x, onValuesChange: ie, name: w, selec
134
134
  });
135
135
  }
136
136
  //#endregion
137
- export { S as MultiSelect };
137
+ export { x as MultiSelect };
@@ -1,5 +1,5 @@
1
- import { ChevronLeft as e, ChevronRight as t } from "lucide-react";
2
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
+ import { ChevronLeft as n, ChevronRight as r } from "lucide-react";
3
3
  //#region src/Pagination.tsx
4
4
  function i({ totalItems: i, page: c, pageSize: l, onPageChange: u, onPageSizeChange: d, itemLabel: f = "条记录", pageSizeOptions: p = [
5
5
  10,
@@ -7,11 +7,11 @@ function i({ totalItems: i, page: c, pageSize: l, onPageChange: u, onPageSizeCha
7
7
  50
8
8
  ], compact: m = !1 }) {
9
9
  let h = a(i, l), g = o(c, i, l), _ = i ? (g - 1) * l + 1 : 0, v = Math.min(g * l, i);
10
- return /* @__PURE__ */ r("nav", {
10
+ return /* @__PURE__ */ t("nav", {
11
11
  className: `ui-pagination${m ? " compact" : ""}`,
12
12
  "aria-label": "列表分页",
13
13
  children: [
14
- /* @__PURE__ */ r("span", {
14
+ /* @__PURE__ */ t("span", {
15
15
  className: "ui-pagination-summary",
16
16
  children: [
17
17
  "共 ",
@@ -24,35 +24,35 @@ function i({ totalItems: i, page: c, pageSize: l, onPageChange: u, onPageSizeCha
24
24
  v
25
25
  ]
26
26
  }),
27
- /* @__PURE__ */ r("div", {
27
+ /* @__PURE__ */ t("div", {
28
28
  className: "ui-pagination-pages",
29
29
  children: [
30
- /* @__PURE__ */ n("button", {
30
+ /* @__PURE__ */ e("button", {
31
31
  type: "button",
32
32
  "aria-label": "上一页",
33
33
  disabled: g <= 1,
34
34
  onClick: () => u(g - 1),
35
- children: /* @__PURE__ */ n(e, { size: 15 })
35
+ children: /* @__PURE__ */ e(n, { size: 15 })
36
36
  }),
37
- !m && s(g, h).map((e, t) => e === "ellipsis" ? /* @__PURE__ */ n("i", {
37
+ !m && s(g, h).map((t, n) => t === "ellipsis" ? /* @__PURE__ */ e("i", {
38
38
  className: "ui-page-ellipsis",
39
39
  children: "…"
40
- }, `ellipsis-${t}`) : /* @__PURE__ */ n("button", {
40
+ }, `ellipsis-${n}`) : /* @__PURE__ */ e("button", {
41
41
  type: "button",
42
- className: `ui-page-number${e === g ? " active" : ""}`,
43
- "aria-current": e === g ? "page" : void 0,
44
- "aria-label": `第 ${e} 页`,
45
- onClick: () => u(e),
46
- children: e
47
- }, e)),
48
- m && /* @__PURE__ */ r("span", { children: [
42
+ className: `ui-page-number${t === g ? " active" : ""}`,
43
+ "aria-current": t === g ? "page" : void 0,
44
+ "aria-label": `第 ${t} 页`,
45
+ onClick: () => u(t),
46
+ children: t
47
+ }, t)),
48
+ m && /* @__PURE__ */ t("span", { children: [
49
49
  "第 ",
50
50
  g,
51
51
  " / ",
52
52
  h,
53
53
  " 页"
54
54
  ] }),
55
- !m && /* @__PURE__ */ r("span", {
55
+ !m && /* @__PURE__ */ t("span", {
56
56
  className: "ui-pagination-auto-compact",
57
57
  children: [
58
58
  "第 ",
@@ -62,29 +62,29 @@ function i({ totalItems: i, page: c, pageSize: l, onPageChange: u, onPageSizeCha
62
62
  " 页"
63
63
  ]
64
64
  }),
65
- /* @__PURE__ */ n("button", {
65
+ /* @__PURE__ */ e("button", {
66
66
  type: "button",
67
67
  "aria-label": "下一页",
68
68
  disabled: g >= h,
69
69
  onClick: () => u(g + 1),
70
- children: /* @__PURE__ */ n(t, { size: 15 })
70
+ children: /* @__PURE__ */ e(r, { size: 15 })
71
71
  })
72
72
  ]
73
73
  }),
74
- d && /* @__PURE__ */ r("label", {
74
+ d && /* @__PURE__ */ t("label", {
75
75
  className: "ui-pagination-size",
76
76
  children: [
77
- /* @__PURE__ */ n("span", { children: "每页" }),
78
- /* @__PURE__ */ n("select", {
77
+ /* @__PURE__ */ e("span", { children: "每页" }),
78
+ /* @__PURE__ */ e("select", {
79
79
  "aria-label": "每页显示数量",
80
80
  value: l,
81
81
  onChange: (e) => d(Number(e.target.value)),
82
- children: p.map((e) => /* @__PURE__ */ n("option", {
83
- value: e,
84
- children: e
85
- }, e))
82
+ children: p.map((t) => /* @__PURE__ */ e("option", {
83
+ value: t,
84
+ children: t
85
+ }, t))
86
86
  }),
87
- /* @__PURE__ */ n("span", { children: "条" })
87
+ /* @__PURE__ */ e("span", { children: "条" })
88
88
  ]
89
89
  })
90
90
  ]
@@ -1,28 +1,28 @@
1
1
  import { Button as e } from "./Button.js";
2
- import { AlertCircle as t, LoaderCircle as n, RefreshCw as r } from "lucide-react";
3
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
2
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ import { AlertCircle as r, LoaderCircle as i, RefreshCw as a } from "lucide-react";
4
4
  //#region src/RecoverableAsyncState.tsx
5
5
  function o(o) {
6
6
  let s = o.phase === "error";
7
- return /* @__PURE__ */ a("div", {
7
+ return /* @__PURE__ */ n("div", {
8
8
  className: `ui-async-state${o.compact ? " compact" : ""}`,
9
9
  role: s ? "alert" : "status",
10
10
  "aria-live": s ? "assertive" : "polite",
11
11
  children: [
12
- s ? /* @__PURE__ */ i(t, {
12
+ s ? /* @__PURE__ */ t(r, {
13
13
  "aria-hidden": "true",
14
14
  size: 18
15
- }) : /* @__PURE__ */ i(n, {
15
+ }) : /* @__PURE__ */ t(i, {
16
16
  "aria-hidden": "true",
17
17
  className: "spin",
18
18
  size: 18
19
19
  }),
20
- /* @__PURE__ */ a("span", { children: [/* @__PURE__ */ i("strong", { children: s ? o.errorTitle : o.loadingTitle }), o.detail && /* @__PURE__ */ i("small", { children: o.detail })] }),
21
- s && o.onRetry && /* @__PURE__ */ a(e, {
20
+ /* @__PURE__ */ n("span", { children: [/* @__PURE__ */ t("strong", { children: s ? o.errorTitle : o.loadingTitle }), o.detail && /* @__PURE__ */ t("small", { children: o.detail })] }),
21
+ s && o.onRetry && /* @__PURE__ */ n(e, {
22
22
  variant: "outline",
23
23
  size: "compact",
24
24
  onClick: o.onRetry,
25
- children: [/* @__PURE__ */ i(r, {
25
+ children: [/* @__PURE__ */ t(a, {
26
26
  "aria-hidden": "true",
27
27
  size: 15
28
28
  }), o.retryLabel ?? "重新加载"]
package/dist/Select.js CHANGED
@@ -1,60 +1,60 @@
1
1
  import { useOverlayContainer as e } from "./OverlayContainer.js";
2
2
  import { FormField as t } from "./FormField.js";
3
- import { Check as n, ChevronDown as r, ChevronUp as i } from "lucide-react";
4
- import { useId as a } from "react";
5
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
3
+ import { useId as n } from "react";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ import { Check as a, ChevronDown as o, ChevronUp as s } from "lucide-react";
6
6
  import * as c from "@radix-ui/react-select";
7
7
  //#region src/Select.tsx
8
8
  function l({ value: l, defaultValue: f, onValueChange: p, options: m, label: h, placeholder: g = "请选择", helpText: _, error: v, required: y, disabled: b, name: x, id: S, className: C = "", triggerRef: w, triggerProps: T, portalContainer: E, placement: D }) {
9
- let O = a(), k = S ?? O, A = e(E), j = /* @__PURE__ */ s(c.Root, {
9
+ let O = n(), k = S ?? O, A = e(E), j = /* @__PURE__ */ i(c.Root, {
10
10
  value: l,
11
11
  defaultValue: f,
12
12
  onValueChange: p,
13
13
  disabled: b,
14
14
  name: x,
15
15
  required: y,
16
- children: [/* @__PURE__ */ s(c.Trigger, {
16
+ children: [/* @__PURE__ */ i(c.Trigger, {
17
17
  ...T,
18
18
  ref: w,
19
19
  id: k,
20
20
  className: `ui-select-trigger ${C}`.trim(),
21
21
  "aria-invalid": v ? !0 : T?.["aria-invalid"],
22
22
  "aria-describedby": d(T?.["aria-describedby"], u(k, _, v)),
23
- children: [/* @__PURE__ */ o(c.Value, { placeholder: g }), /* @__PURE__ */ o(c.Icon, { children: /* @__PURE__ */ o(r, { size: 16 }) })]
24
- }), /* @__PURE__ */ o(c.Portal, {
23
+ children: [/* @__PURE__ */ r(c.Value, { placeholder: g }), /* @__PURE__ */ r(c.Icon, { children: /* @__PURE__ */ r(o, { size: 16 }) })]
24
+ }), /* @__PURE__ */ r(c.Portal, {
25
25
  container: A,
26
- children: /* @__PURE__ */ s(c.Content, {
26
+ children: /* @__PURE__ */ i(c.Content, {
27
27
  className: "ui-select-content",
28
28
  position: "popper",
29
29
  sideOffset: 6,
30
30
  collisionPadding: 10,
31
31
  ...D,
32
32
  children: [
33
- /* @__PURE__ */ o(c.ScrollUpButton, {
33
+ /* @__PURE__ */ r(c.ScrollUpButton, {
34
34
  className: "ui-select-scroll",
35
- children: /* @__PURE__ */ o(i, { size: 16 })
35
+ children: /* @__PURE__ */ r(s, { size: 16 })
36
36
  }),
37
- /* @__PURE__ */ o(c.Viewport, {
37
+ /* @__PURE__ */ r(c.Viewport, {
38
38
  className: "ui-select-viewport",
39
- children: m.map((e) => /* @__PURE__ */ s(c.Item, {
39
+ children: m.map((e) => /* @__PURE__ */ i(c.Item, {
40
40
  value: e.value,
41
41
  disabled: e.disabled,
42
42
  className: "ui-select-item",
43
- children: [/* @__PURE__ */ o(c.ItemText, { children: e.label }), /* @__PURE__ */ o(c.ItemIndicator, {
43
+ children: [/* @__PURE__ */ r(c.ItemText, { children: e.label }), /* @__PURE__ */ r(c.ItemIndicator, {
44
44
  className: "ui-select-indicator",
45
- children: /* @__PURE__ */ o(n, { size: 15 })
45
+ children: /* @__PURE__ */ r(a, { size: 15 })
46
46
  })]
47
47
  }, e.value))
48
48
  }),
49
- /* @__PURE__ */ o(c.ScrollDownButton, {
49
+ /* @__PURE__ */ r(c.ScrollDownButton, {
50
50
  className: "ui-select-scroll",
51
- children: /* @__PURE__ */ o(r, { size: 16 })
51
+ children: /* @__PURE__ */ r(o, { size: 16 })
52
52
  })
53
53
  ]
54
54
  })
55
55
  })]
56
56
  });
57
- return h === void 0 && _ === void 0 && !v ? j : /* @__PURE__ */ o(t, {
57
+ return h === void 0 && _ === void 0 && !v ? j : /* @__PURE__ */ r(t, {
58
58
  controlId: k,
59
59
  label: h,
60
60
  required: y,
@@ -1,32 +1,32 @@
1
1
  import { activeSortableTransfer as e, beginSortableTransfer as t, consumeSortableTransfer as n, endSortableTransfer as r, hasUniqueSortableTarget as i, registerSortableTarget as a, routeSortableTarget as o, useSortableTransferScope as s } from "./sortable-transfer-scope.js";
2
- import { GripVertical as c } from "lucide-react";
3
- import { useEffect as l, useLayoutEffect as u, useMemo as d, useRef as f } from "react";
4
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
2
+ import { useEffect as c, useLayoutEffect as l, useMemo as u, useRef as d } from "react";
3
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
4
+ import { GripVertical as m } from "lucide-react";
5
5
  import { Button as h, GridList as g, GridListItem as _, useDragAndDrop as v } from "react-aria-components";
6
6
  //#region src/SortableList.tsx
7
7
  function y(s) {
8
- let y = f(/* @__PURE__ */ new Set()), x = f({ mime: `application/x-ui-sortable-${Math.random().toString(36).slice(2)}` }).current, S = s.transferScope?.mime ?? x.mime, C = f(s);
9
- C.current = s, l(() => () => {
8
+ let y = d(/* @__PURE__ */ new Set()), x = d({ mime: `application/x-ui-sortable-${Math.random().toString(36).slice(2)}` }).current, S = s.transferScope?.mime ?? x.mime, C = d(s);
9
+ C.current = s, c(() => () => {
10
10
  r(s.transferScope, x);
11
- }, [s.transferScope, x]), l(() => {
11
+ }, [s.transferScope, x]), c(() => {
12
12
  s.disabled && (y.current.clear(), r(s.transferScope, x));
13
13
  }, [
14
14
  s.disabled,
15
15
  s.transferScope,
16
16
  x
17
17
  ]);
18
- let w = d(() => s.items.map((e, t) => ({
18
+ let w = u(() => s.items.map((e, t) => ({
19
19
  item: e,
20
20
  index: t,
21
21
  key: s.getKey(e)
22
- })), [s.items, s.getKey]), T = d(() => {
22
+ })), [s.items, s.getKey]), T = u(() => {
23
23
  let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
24
24
  for (let n of w) e.has(n.key) && t.add(n.key), e.set(n.key, n);
25
25
  return {
26
26
  index: e,
27
27
  duplicates: t
28
28
  };
29
- }, [w]), E = f(T);
29
+ }, [w]), E = d(T);
30
30
  E.current = T;
31
31
  function D(e) {
32
32
  let t = [...e].map((e) => E.current.duplicates.has(e) ? void 0 : E.current.index.get(e));
@@ -64,8 +64,8 @@ function y(s) {
64
64
  external: a
65
65
  };
66
66
  }
67
- let M = f(N);
68
- M.current = N, u(() => a(s.transferScope, x, {
67
+ let M = d(N);
68
+ M.current = N, l(() => a(s.transferScope, x, {
69
69
  accepts: (e) => E.current.index.has(e),
70
70
  commit: (e, t) => M.current(e, t)
71
71
  }), [s.transferScope, x]);
@@ -109,38 +109,38 @@ function y(s) {
109
109
  onInsert: s.transferScope && s.onDropBetweenItems ? (e) => N(e.target.key, e.target.dropPosition) : void 0,
110
110
  onItemDrop: s.transferScope && s.onDropOnItem ? (e) => N(e.target.key, "on") : void 0
111
111
  });
112
- return /* @__PURE__ */ p(g, {
112
+ return /* @__PURE__ */ f(g, {
113
113
  "aria-label": s["aria-label"],
114
114
  items: w,
115
- renderEmptyState: s.renderEmptyState ?? (() => /* @__PURE__ */ p("span", {
115
+ renderEmptyState: s.renderEmptyState ?? (() => /* @__PURE__ */ f("span", {
116
116
  className: "ui-sortable-empty",
117
117
  children: s.onDropOnList && !s.disabled ? "拖动项目到此处" : "暂无项目"
118
118
  })),
119
119
  selectionMode: "none",
120
120
  dragAndDropHooks: F,
121
121
  className: ["ui-sortable-list", s.className].filter(Boolean).join(" "),
122
- children: ({ item: e, index: t, key: n }) => /* @__PURE__ */ m(_, {
122
+ children: ({ item: e, index: t, key: n }) => /* @__PURE__ */ p(_, {
123
123
  id: n,
124
124
  textValue: s.getTextValue(e, t),
125
125
  className: "ui-sortable-item",
126
126
  children: [
127
- !s.disabled && /* @__PURE__ */ p("span", {
127
+ !s.disabled && /* @__PURE__ */ f("span", {
128
128
  className: "ui-sortable-placeholder",
129
129
  "aria-hidden": "true",
130
130
  children: s.draggingLabel ?? "原位置保留,松开后移动"
131
131
  }),
132
- /* @__PURE__ */ p(h, {
132
+ /* @__PURE__ */ f(h, {
133
133
  slot: "drag",
134
134
  className: "ui-sortable-handle",
135
135
  isDisabled: s.disabled,
136
136
  style: s.disabled ? { display: "none" } : void 0,
137
137
  "aria-label": s.dragLabel?.(e, t) ?? `拖动第 ${t + 1} 项排序`,
138
- children: /* @__PURE__ */ p(c, {
138
+ children: /* @__PURE__ */ f(m, {
139
139
  "aria-hidden": "true",
140
140
  size: 18
141
141
  })
142
142
  }),
143
- /* @__PURE__ */ p("div", {
143
+ /* @__PURE__ */ f("div", {
144
144
  className: "ui-sortable-content",
145
145
  style: s.disabled ? { gridColumn: "1 / -1" } : void 0,
146
146
  children: s.renderItem(e, t)