@sia.soul/sia-react-ui 0.1.165 → 0.1.167

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 (40) hide show
  1. package/dist/chart.cjs +4553 -4513
  2. package/dist/chart.d.cts +1850 -1843
  3. package/dist/chart.d.ts +1850 -1843
  4. package/dist/chart.js +1 -1
  5. package/dist/chunk-2FZI7TP6.js +0 -0
  6. package/dist/{chunk-WR5YBY2A.js → chunk-5CGJVE4C.js} +57 -43
  7. package/dist/{chunk-2EC653G5.js → chunk-5KTQXNGL.js} +2 -2
  8. package/dist/{chunk-NHGCGOF2.js → chunk-A7TLMWMM.js} +4754 -4714
  9. package/dist/{chunk-G5EJJFUI.js → chunk-FSO46WEJ.js} +14 -6
  10. package/dist/{chunk-SX4LLT3H.js → chunk-KDNOLFDJ.js} +2 -2
  11. package/dist/{chunk-DKQ5UCN6.js → chunk-S6FA6NN3.js} +519 -220
  12. package/dist/{chunk-23FQ5ARA.js → chunk-XS7AVCHO.js} +27 -17
  13. package/dist/{core-r-smfiNN.d.cts → core-C7Was4Vc.d.cts} +11 -12
  14. package/dist/{core-XtqUDbbD.d.ts → core-D7C32Rdq.d.ts} +11 -12
  15. package/dist/core.cjs +267 -235
  16. package/dist/core.css +3125 -5327
  17. package/dist/core.d.cts +1 -1
  18. package/dist/core.d.ts +1 -1
  19. package/dist/core.js +4 -4
  20. package/dist/game.cjs +14 -6
  21. package/dist/game.css +1666 -3147
  22. package/dist/game.js +1 -1
  23. package/dist/index.cjs +6498 -6060
  24. package/dist/index.css +8721 -8545
  25. package/dist/index.d.cts +127 -111
  26. package/dist/index.d.ts +127 -111
  27. package/dist/index.js +817 -749
  28. package/dist/markdown-editor.css +461 -0
  29. package/dist/markdown-editor.js +2 -1
  30. package/dist/rich-text-editor.cjs +38 -20
  31. package/dist/rich-text-editor.css +461 -0
  32. package/dist/rich-text-editor.js +4 -3
  33. package/dist/{select-date-range-E1N5-oXv.d.ts → select-date-range-AOleKBXc.d.ts} +6 -9
  34. package/dist/{select-date-range-BnlISSPV.d.cts → select-date-range-BtTkMElI.d.cts} +6 -9
  35. package/dist/select-date-range.cjs +529 -222
  36. package/dist/select-date-range.d.cts +1 -1
  37. package/dist/select-date-range.d.ts +1 -1
  38. package/dist/select-date-range.js +4 -4
  39. package/package.json +5 -1
  40. /package/dist/{chunk-V4I32DPL.js → chunk-GKWSCL5Q.js} +0 -0
package/dist/core.cjs CHANGED
@@ -2864,7 +2864,7 @@ var placementMap = {
2864
2864
  topLeft: "top-start",
2865
2865
  topRight: "top-end"
2866
2866
  };
2867
- function DropdownInternal({
2867
+ var DropdownInternal = (0, import_react13.forwardRef)(function DropdownInternal2({
2868
2868
  popupAnchorRef,
2869
2869
  menu,
2870
2870
  children,
@@ -2889,8 +2889,13 @@ function DropdownInternal({
2889
2889
  onContextMenu,
2890
2890
  onKeyDown,
2891
2891
  ...props
2892
- }) {
2892
+ }, forwardedRef) {
2893
2893
  const rootRef = (0, import_react13.useRef)(null);
2894
+ function setRootRef(node) {
2895
+ rootRef.current = node;
2896
+ if (typeof forwardedRef === "function") forwardedRef(node);
2897
+ else if (forwardedRef) forwardedRef.current = node;
2898
+ }
2894
2899
  const contextAnchorRef = (0, import_react13.useRef)(null);
2895
2900
  const popupRef = (0, import_react13.useRef)(null);
2896
2901
  const menuListRef = (0, import_react13.useRef)(null);
@@ -3042,7 +3047,7 @@ function DropdownInternal({
3042
3047
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3043
3048
  "span",
3044
3049
  {
3045
- ref: rootRef,
3050
+ ref: setRootRef,
3046
3051
  className: `sia-dropdown${visible ? " is-open" : ""}${disabled ? " is-disabled" : ""} ${className}`.trim(),
3047
3052
  "aria-expanded": visible,
3048
3053
  "aria-haspopup": "menu",
@@ -3098,11 +3103,11 @@ function DropdownInternal({
3098
3103
  ]
3099
3104
  }
3100
3105
  );
3101
- }
3102
- function DropdownRoot(props) {
3103
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DropdownInternal, { ...props });
3104
- }
3105
- function DropdownButton({
3106
+ });
3107
+ var DropdownRoot = (0, import_react13.forwardRef)(function Dropdown(props, forwardedRef) {
3108
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DropdownInternal, { ref: forwardedRef, ...props });
3109
+ });
3110
+ var DropdownButton = (0, import_react13.forwardRef)(function DropdownButton2({
3106
3111
  children,
3107
3112
  className = "",
3108
3113
  buttonProps,
@@ -3112,9 +3117,14 @@ function DropdownButton({
3112
3117
  dropdownDisabled,
3113
3118
  trigger = ["click"],
3114
3119
  ...dropdownProps
3115
- }) {
3120
+ }, forwardedRef) {
3116
3121
  const groupRef = (0, import_react13.useRef)(null);
3117
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { ref: groupRef, className: `sia-dropdown-button ${className}`.trim(), children: [
3122
+ function setGroupRef(node) {
3123
+ groupRef.current = node;
3124
+ if (typeof forwardedRef === "function") forwardedRef(node);
3125
+ else if (forwardedRef) forwardedRef.current = node;
3126
+ }
3127
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { ref: setGroupRef, className: `sia-dropdown-button ${className}`.trim(), children: [
3118
3128
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { ...buttonProps, disabled: disabled || buttonDisabled, onClick, children }),
3119
3129
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DropdownInternal, { ...dropdownProps, popupAnchorRef: groupRef, disabled: disabled || dropdownDisabled, trigger, showTriggerIcon: false, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3120
3130
  Button,
@@ -3127,8 +3137,8 @@ function DropdownButton({
3127
3137
  }
3128
3138
  ) })
3129
3139
  ] });
3130
- }
3131
- var Dropdown = Object.assign(DropdownRoot, {
3140
+ });
3141
+ var Dropdown2 = Object.assign(DropdownRoot, {
3132
3142
  /** 组合主操作按钮与下拉菜单的按钮组件。 */
3133
3143
  Button: DropdownButton
3134
3144
  });
@@ -3195,9 +3205,9 @@ function Toolbar({ items, onAction, disabled = false, size = "small", variant =
3195
3205
  visibleItems.map((item, index) => {
3196
3206
  const buttonProps = { size, variant, icon: item.icon, disabled: blocked(item), loading: item.loading, danger: item.danger };
3197
3207
  const menu = { items: menuItems(item.children ?? []), onClick: ({ key }) => invoke(key) };
3198
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { "data-sia-toolbar-item": true, className: `sia-toolbar__item${index >= visibleCount ? " sia-toolbar__item--hidden" : ""}`, "aria-hidden": index >= visibleCount || void 0, children: item.children?.length ? item.split ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Dropdown.Button, { trigger: ["hover"], menu, disabled: blocked(item), buttonProps, onClick: () => invoke(item.key), children: item.label }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Dropdown, { trigger: ["hover"], menu, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button, { ...buttonProps, children: item.label }) }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button, { ...buttonProps, onClick: () => invoke(item.key), children: item.label }) }, item.key);
3208
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { "data-sia-toolbar-item": true, className: `sia-toolbar__item${index >= visibleCount ? " sia-toolbar__item--hidden" : ""}`, "aria-hidden": index >= visibleCount || void 0, children: item.children?.length ? item.split ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Dropdown2.Button, { trigger: ["hover"], menu, disabled: blocked(item), buttonProps, onClick: () => invoke(item.key), children: item.label }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Dropdown2, { trigger: ["hover"], menu, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button, { ...buttonProps, children: item.label }) }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button, { ...buttonProps, onClick: () => invoke(item.key), children: item.label }) }, item.key);
3199
3209
  }),
3200
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { "data-sia-toolbar-more": true, className: `sia-toolbar__item${overflow.length ? "" : " sia-toolbar__item--hidden"}`, "aria-hidden": !overflow.length || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Dropdown, { trigger: ["hover"], menu: { items: menuItems(overflow), onClick: ({ key }) => invoke(key) }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button, { size, variant, disabled, "aria-label": overflowLabel, title: overflowLabel, icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon, { name: "more-horizontal", size: 16 }) }) }) })
3210
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { "data-sia-toolbar-more": true, className: `sia-toolbar__item${overflow.length ? "" : " sia-toolbar__item--hidden"}`, "aria-hidden": !overflow.length || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Dropdown2, { trigger: ["hover"], menu: { items: menuItems(overflow), onClick: ({ key }) => invoke(key) }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button, { size, variant, disabled, "aria-label": overflowLabel, title: overflowLabel, icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon, { name: "more-horizontal", size: 16 }) }) }) })
3201
3211
  ] });
3202
3212
  }
3203
3213
 
@@ -3213,7 +3223,7 @@ function Skeleton({ rows = 6, columns = 2, rowHeight = 30, gap = 16, className =
3213
3223
  // src/components/Card.tsx
3214
3224
  var import_react15 = require("react");
3215
3225
  var import_jsx_runtime13 = require("react/jsx-runtime");
3216
- function Card({
3226
+ var Card = (0, import_react15.forwardRef)(function Card2({
3217
3227
  bordered = true,
3218
3228
  title,
3219
3229
  description,
@@ -3243,7 +3253,7 @@ function Card({
3243
3253
  onClick,
3244
3254
  onKeyDown,
3245
3255
  ...props
3246
- }) {
3256
+ }, forwardedRef) {
3247
3257
  const [internalCollapsed, setInternalCollapsed] = (0, import_react15.useState)(defaultCollapsed);
3248
3258
  const [internalSelected, setInternalSelected] = (0, import_react15.useState)(defaultSelected);
3249
3259
  const isSelected = selected ?? internalSelected;
@@ -3270,6 +3280,7 @@ function Card({
3270
3280
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
3271
3281
  "section",
3272
3282
  {
3283
+ ref: forwardedRef,
3273
3284
  className: `sia-card${fill ? " sia-card--fill" : ""}${fill && bodyHeight !== void 0 ? " sia-card--body-height" : ""}${!bordered ? " sia-card--borderless" : ""}${isCollapsed ? " sia-card--collapsed" : ""}${selectable ? " sia-card--selectable" : ""}${actionable ? " sia-card--actionable" : ""}${selectable && isSelected ? " sia-card--selected" : ""}${hoverActions ? " sia-card--hover-actions" : ""} ${className}`.trim(),
3274
3285
  style: mergedStyle,
3275
3286
  "data-sia-interaction-cursor": interactionCursor,
@@ -3312,10 +3323,18 @@ function Card({
3312
3323
  ]
3313
3324
  }
3314
3325
  );
3315
- }
3326
+ });
3316
3327
 
3317
3328
  // src/components/Tag.tsx
3329
+ var import_react16 = require("react");
3318
3330
  var import_jsx_runtime14 = require("react/jsx-runtime");
3331
+ function hasTagContent(content) {
3332
+ return import_react16.Children.toArray(content).some((node) => {
3333
+ if (typeof node === "string") return node.trim().length > 0;
3334
+ if ((0, import_react16.isValidElement)(node) && node.type === import_react16.Fragment) return hasTagContent(node.props.children);
3335
+ return true;
3336
+ });
3337
+ }
3319
3338
  function Tag({
3320
3339
  size: sizeProp,
3321
3340
  color,
@@ -3333,6 +3352,8 @@ function Tag({
3333
3352
  ...props
3334
3353
  }) {
3335
3354
  const size = useControlSize(sizeProp ?? (compact ? "small" : void 0));
3355
+ const hasIcon = hasTagContent(icon);
3356
+ if (!hasTagContent(children) && !hasIcon) return null;
3336
3357
  const customColor = color?.trim() ? variant === "outlined" ? { borderColor: color, color, backgroundColor: "transparent" } : variant === "filled" ? { backgroundColor: color, color: "#fff", borderColor: "transparent" } : { color, backgroundColor: `color-mix(in srgb, ${color} 10%, transparent)`, borderColor: `color-mix(in srgb, ${color} 35%, transparent)` } : void 0;
3337
3358
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
3338
3359
  "span",
@@ -3342,7 +3363,7 @@ function Tag({
3342
3363
  style: customColor ? { ...customColor, ...style } : style,
3343
3364
  ...withTitleTooltip(props),
3344
3365
  children: [
3345
- icon ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "sia-tag__icon", children: icon }) : null,
3366
+ hasIcon ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "sia-tag__icon", children: icon }) : null,
3346
3367
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children }),
3347
3368
  closable ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3348
3369
  "button",
@@ -3364,10 +3385,10 @@ function Tag({
3364
3385
  }
3365
3386
 
3366
3387
  // src/components/Tabs.tsx
3367
- var import_react16 = require("react");
3368
- var import_jsx_runtime15 = require("react/jsx-runtime");
3369
3388
  var import_react17 = require("react");
3370
- function Tabs({
3389
+ var import_jsx_runtime15 = require("react/jsx-runtime");
3390
+ var import_react18 = require("react");
3391
+ var Tabs = (0, import_react17.forwardRef)(function Tabs2({
3371
3392
  items,
3372
3393
  activeKey,
3373
3394
  defaultActiveKey,
@@ -3391,27 +3412,27 @@ function Tabs({
3391
3412
  onTabContextMenuClick,
3392
3413
  className = "",
3393
3414
  ...props
3394
- }) {
3415
+ }, forwardedRef) {
3395
3416
  const firstEnabledKey = items.find((item) => !item.disabled)?.key ?? "";
3396
- const [internalActiveKey, setInternalActiveKey] = (0, import_react16.useState)(defaultActiveKey ?? firstEnabledKey);
3417
+ const [internalActiveKey, setInternalActiveKey] = (0, import_react17.useState)(defaultActiveKey ?? firstEnabledKey);
3397
3418
  const currentKey = activeKey ?? internalActiveKey;
3398
3419
  const selectedKey = items.some((item) => item.key === currentKey && !item.disabled) ? currentKey : firstEnabledKey;
3399
- const baseId = (0, import_react16.useId)().replace(/:/g, "");
3400
- const enabledItems = (0, import_react16.useMemo)(() => items.filter((item) => !item.disabled), [items]);
3420
+ const baseId = (0, import_react17.useId)().replace(/:/g, "");
3421
+ const enabledItems = (0, import_react17.useMemo)(() => items.filter((item) => !item.disabled), [items]);
3401
3422
  const resolvedPosition = tabPosition ?? (orientation === "vertical" ? "left" : "top");
3402
3423
  const resolvedOrientation = resolvedPosition === "left" || resolvedPosition === "right" ? "vertical" : "horizontal";
3403
3424
  const defaultIndicatorPosition = { top: "bottom", bottom: "top", left: "right", right: "left" }[resolvedPosition];
3404
3425
  const resolvedIndicatorPosition = indicatorPosition && (resolvedOrientation === "vertical" ? ["left", "right"] : ["top", "bottom"]).includes(indicatorPosition) ? indicatorPosition : defaultIndicatorPosition;
3405
3426
  const sliding = ["capsule", "line", "underline", "rounded", "tech", "tech-line"].includes(type);
3406
- const listRef = (0, import_react16.useRef)(null);
3407
- const indicatorRef = (0, import_react16.useRef)(null);
3408
- const indicatorTargetRef = (0, import_react16.useRef)();
3409
- const moreRef = (0, import_react16.useRef)(null);
3410
- const [overflow, setOverflow] = (0, import_react16.useState)({ count: items.length, width: 0 });
3411
- const [moreOpen, setMoreOpen] = (0, import_react16.useState)(false);
3427
+ const listRef = (0, import_react17.useRef)(null);
3428
+ const indicatorRef = (0, import_react17.useRef)(null);
3429
+ const indicatorTargetRef = (0, import_react17.useRef)();
3430
+ const moreRef = (0, import_react17.useRef)(null);
3431
+ const [overflow, setOverflow] = (0, import_react17.useState)({ count: items.length, width: 0 });
3432
+ const [moreOpen, setMoreOpen] = (0, import_react17.useState)(false);
3412
3433
  const visibleCount = resolvedOrientation === "horizontal" ? overflow.count : items.length;
3413
3434
  const hiddenItems = items.slice(visibleCount);
3414
- (0, import_react16.useLayoutEffect)(() => {
3435
+ (0, import_react17.useLayoutEffect)(() => {
3415
3436
  const list = listRef.current;
3416
3437
  if (!list || resolvedOrientation !== "horizontal") return;
3417
3438
  const entries = Array.from(list.children).filter((node) => node instanceof HTMLElement && node.hasAttribute("data-tab-entry"));
@@ -3442,14 +3463,14 @@ function Tabs({
3442
3463
  entries.forEach((entry) => observer.observe(entry));
3443
3464
  return () => observer.disconnect();
3444
3465
  }, [items, type, size, closable, resolvedOrientation, tabBarTitle, tabBarExtraContent]);
3445
- const [settledContentKey, setSettledContentKey] = (0, import_react16.useState)(selectedKey);
3446
- const [visitedKeys, setVisitedKeys] = (0, import_react16.useState)(() => /* @__PURE__ */ new Set([selectedKey]));
3447
- const settledKeyRef = (0, import_react16.useRef)(selectedKey);
3448
- const afterChangeRef = (0, import_react16.useRef)(onAfterChange);
3449
- (0, import_react16.useLayoutEffect)(() => {
3466
+ const [settledContentKey, setSettledContentKey] = (0, import_react17.useState)(selectedKey);
3467
+ const [visitedKeys, setVisitedKeys] = (0, import_react17.useState)(() => /* @__PURE__ */ new Set([selectedKey]));
3468
+ const settledKeyRef = (0, import_react17.useRef)(selectedKey);
3469
+ const afterChangeRef = (0, import_react17.useRef)(onAfterChange);
3470
+ (0, import_react17.useLayoutEffect)(() => {
3450
3471
  afterChangeRef.current = onAfterChange;
3451
3472
  }, [onAfterChange]);
3452
- (0, import_react16.useLayoutEffect)(() => {
3473
+ (0, import_react17.useLayoutEffect)(() => {
3453
3474
  if (!sliding) return;
3454
3475
  const list = listRef.current;
3455
3476
  const indicator = indicatorRef.current;
@@ -3511,7 +3532,7 @@ function Tabs({
3511
3532
  motionPreference.removeEventListener("change", stopMotion);
3512
3533
  };
3513
3534
  }, [sliding, type, selectedKey, items, size, resolvedPosition, centered, closable, visibleCount, indicatorMotion]);
3514
- (0, import_react16.useEffect)(() => {
3535
+ (0, import_react17.useEffect)(() => {
3515
3536
  let cancelled = false;
3516
3537
  let frame = 0;
3517
3538
  frame = requestAnimationFrame(() => {
@@ -3537,7 +3558,7 @@ function Tabs({
3537
3558
  };
3538
3559
  }, [selectedKey, type, deferContent, indicatorMotion]);
3539
3560
  const contentKey = deferContent && items.some((item) => item.key === settledContentKey) ? settledContentKey : selectedKey;
3540
- (0, import_react16.useLayoutEffect)(() => {
3561
+ (0, import_react17.useLayoutEffect)(() => {
3541
3562
  if (deferContent && contentKey !== settledContentKey) setSettledContentKey(contentKey);
3542
3563
  setVisitedKeys((previous) => {
3543
3564
  const next = new Set(items.filter((item) => item.key === contentKey || !destroyInactiveTabPane && previous.has(item.key)).map((item) => item.key));
@@ -3570,6 +3591,7 @@ function Tabs({
3570
3591
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
3571
3592
  "div",
3572
3593
  {
3594
+ ref: forwardedRef,
3573
3595
  className: `sia-tabs sia-tabs--${type}${type === "underline" ? " sia-tabs--line" : ""} sia-tabs--${size} sia-tabs--${resolvedOrientation} sia-tabs--${resolvedPosition}${centered ? " sia-tabs--centered" : ""} ${className}`.trim(),
3574
3596
  ...withTitleTooltip(props),
3575
3597
  children: [
@@ -3585,7 +3607,7 @@ function Tabs({
3585
3607
  const canClose = item.closable ?? closable;
3586
3608
  const contextMenuItems = typeof tabContextMenu === "function" ? tabContextMenu(item) : tabContextMenu;
3587
3609
  const entryProps = { "data-tab-entry": "", "data-tab-hidden": index >= visibleCount, "aria-hidden": index >= visibleCount || void 0 };
3588
- const tabNode = /* @__PURE__ */ (0, import_react17.createElement)("span", { ...!contextMenuItems?.length ? entryProps : {}, className: `sia-tabs__tab-wrap${canClose ? " is-closable" : ""}`, key: item.key }, /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
3610
+ const tabNode = /* @__PURE__ */ (0, import_react18.createElement)("span", { ...!contextMenuItems?.length ? entryProps : {}, className: `sia-tabs__tab-wrap${canClose ? " is-closable" : ""}`, key: item.key }, /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
3589
3611
  "button",
3590
3612
  {
3591
3613
  id: `${baseId}-tab-${item.key}`,
@@ -3616,8 +3638,8 @@ function Tabs({
3616
3638
  }
3617
3639
  ) : null);
3618
3640
  if (!contextMenuItems?.length) return tabNode;
3619
- return /* @__PURE__ */ (0, import_react17.createElement)(
3620
- Dropdown,
3641
+ return /* @__PURE__ */ (0, import_react18.createElement)(
3642
+ Dropdown2,
3621
3643
  {
3622
3644
  ...entryProps,
3623
3645
  key: item.key,
@@ -3635,7 +3657,7 @@ function Tabs({
3635
3657
  );
3636
3658
  }),
3637
3659
  resolvedOrientation === "horizontal" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
3638
- Dropdown,
3660
+ Dropdown2,
3639
3661
  {
3640
3662
  className: "sia-tabs__more",
3641
3663
  "data-tab-hidden": !hiddenItems.length,
@@ -3676,23 +3698,23 @@ function Tabs({
3676
3698
  ]
3677
3699
  }
3678
3700
  );
3679
- }
3701
+ });
3680
3702
 
3681
3703
  // src/components/Feedback.tsx
3682
- var import_react22 = require("react");
3704
+ var import_react23 = require("react");
3683
3705
  var import_react_dom4 = require("react-dom");
3684
3706
  var import_client2 = require("react-dom/client");
3685
3707
 
3686
3708
  // src/components/FloatingDisplay.tsx
3687
- var import_react21 = require("react");
3709
+ var import_react22 = require("react");
3688
3710
  var import_react_dom3 = require("react-dom");
3689
3711
 
3690
3712
  // src/components/usePressFeedback.ts
3691
- var import_react18 = require("react");
3713
+ var import_react19 = require("react");
3692
3714
  function usePressFeedback() {
3693
- const running = (0, import_react18.useRef)();
3694
- const cleanup2 = (0, import_react18.useRef)();
3695
- (0, import_react18.useEffect)(() => () => cleanup2.current?.(), []);
3715
+ const running = (0, import_react19.useRef)();
3716
+ const cleanup2 = (0, import_react19.useRef)();
3717
+ (0, import_react19.useEffect)(() => () => cleanup2.current?.(), []);
3696
3718
  return (node, compact = true) => {
3697
3719
  if (!node?.animate) return;
3698
3720
  const media = window.matchMedia("(prefers-reduced-motion: reduce)");
@@ -3724,20 +3746,20 @@ function usePressFeedback() {
3724
3746
  }
3725
3747
 
3726
3748
  // src/components/Checkbox.tsx
3727
- var import_react19 = require("react");
3749
+ var import_react20 = require("react");
3728
3750
  var import_jsx_runtime16 = require("react/jsx-runtime");
3729
- var CheckboxGroupContext = (0, import_react19.createContext)(null);
3730
- var CheckboxRoot = (0, import_react19.forwardRef)(function Checkbox({ value, size: sizeProp, shape: shapeProp, indeterminate = false, children, disabled, checked, defaultChecked, className = "", onChange, ...props }, forwardedRef) {
3751
+ var CheckboxGroupContext = (0, import_react20.createContext)(null);
3752
+ var CheckboxRoot = (0, import_react20.forwardRef)(function Checkbox({ value, size: sizeProp, shape: shapeProp, indeterminate = false, children, disabled, checked, defaultChecked, className = "", onChange, ...props }, forwardedRef) {
3731
3753
  const size = useControlSize(sizeProp);
3732
- const group = (0, import_react19.useContext)(CheckboxGroupContext);
3754
+ const group = (0, import_react20.useContext)(CheckboxGroupContext);
3733
3755
  const shape = shapeProp ?? group?.shape ?? "square";
3734
- const localRef = (0, import_react19.useRef)(null);
3735
- const controlRef = (0, import_react19.useRef)(null);
3756
+ const localRef = (0, import_react20.useRef)(null);
3757
+ const controlRef = (0, import_react20.useRef)(null);
3736
3758
  const press = usePressFeedback();
3737
- const fallbackId = (0, import_react19.useId)();
3759
+ const fallbackId = (0, import_react20.useId)();
3738
3760
  const grouped = group !== null && value !== void 0;
3739
3761
  const currentChecked = grouped ? group.values.includes(value) : checked;
3740
- (0, import_react19.useEffect)(() => {
3762
+ (0, import_react20.useEffect)(() => {
3741
3763
  if (localRef.current) localRef.current.indeterminate = indeterminate;
3742
3764
  }, [indeterminate]);
3743
3765
  function setRef(node) {
@@ -3795,7 +3817,7 @@ function CheckboxGroup({
3795
3817
  gap: gap === void 0 ? void 0 : typeof gap === "number" ? Math.max(0, gap) : `${Math.max(0, gap[0])}px ${Math.max(0, gap[1])}px`
3796
3818
  };
3797
3819
  const [values, setValues] = useControllableState({ value, defaultValue, onChange });
3798
- const context = (0, import_react19.useMemo)(() => ({
3820
+ const context = (0, import_react20.useMemo)(() => ({
3799
3821
  shape,
3800
3822
  values,
3801
3823
  disabled,
@@ -3819,7 +3841,7 @@ var Checkbox2 = Object.assign(CheckboxRoot, {
3819
3841
  });
3820
3842
 
3821
3843
  // src/components/Overlay.tsx
3822
- var import_react20 = require("react");
3844
+ var import_react21 = require("react");
3823
3845
  var import_react_dom2 = require("react-dom");
3824
3846
  var bodyLockCount = 0;
3825
3847
  var previousBodyOverflow = "";
@@ -3863,10 +3885,10 @@ function firstModalInput(panel) {
3863
3885
  return [...candidates ?? []].find((element) => (element.tabIndex >= 0 || element.isContentEditable && !element.hasAttribute("tabindex")) && !element.matches(":disabled, [readonly], [aria-readonly='true']") && !element.closest('[hidden], [inert], [aria-hidden="true"], [aria-disabled="true"]') && element.getClientRects().length > 0 && getComputedStyle(element).visibility === "visible");
3864
3886
  }
3865
3887
  function useOverlayLifecycle(open, panelRef, onRequestClose, keyboard = true, autoFocusInput = false, contentReady = true) {
3866
- const overlayIdRef = (0, import_react20.useRef)(/* @__PURE__ */ Symbol("sia-overlay"));
3867
- const closeRef = (0, import_react20.useRef)(onRequestClose);
3888
+ const overlayIdRef = (0, import_react21.useRef)(/* @__PURE__ */ Symbol("sia-overlay"));
3889
+ const closeRef = (0, import_react21.useRef)(onRequestClose);
3868
3890
  closeRef.current = onRequestClose;
3869
- (0, import_react20.useEffect)(() => {
3891
+ (0, import_react21.useEffect)(() => {
3870
3892
  if (!open || typeof document === "undefined") return void 0;
3871
3893
  const overlayId = overlayIdRef.current;
3872
3894
  const previouslyFocused = document.activeElement instanceof HTMLElement ? document.activeElement : null;
@@ -3881,19 +3903,27 @@ function useOverlayLifecycle(open, panelRef, onRequestClose, keyboard = true, au
3881
3903
  closeRef.current();
3882
3904
  return;
3883
3905
  }
3884
- if (event.key !== "Tab" || !panelRef.current) return;
3885
- const focusable = focusableElements(panelRef.current);
3906
+ const panel = panelRef.current;
3907
+ if (event.key !== "Tab" || !panel) return;
3908
+ const focusable = focusableElements(panel);
3886
3909
  if (focusable.length === 0) {
3887
3910
  event.preventDefault();
3888
- panelRef.current.focus();
3911
+ panel.focus();
3889
3912
  return;
3890
3913
  }
3891
3914
  const first = focusable[0];
3892
3915
  const last = focusable.at(-1);
3893
- if (event.shiftKey && document.activeElement === first) {
3916
+ const active = document.activeElement;
3917
+ const insidePanel = active instanceof Node && panel.contains(active);
3918
+ if (!insidePanel || active === panel) {
3919
+ event.preventDefault();
3920
+ (event.shiftKey ? last : first).focus();
3921
+ return;
3922
+ }
3923
+ if (event.shiftKey && active === first) {
3894
3924
  event.preventDefault();
3895
3925
  last.focus();
3896
- } else if (!event.shiftKey && document.activeElement === last) {
3926
+ } else if (!event.shiftKey && active === last) {
3897
3927
  event.preventDefault();
3898
3928
  first.focus();
3899
3929
  }
@@ -3908,8 +3938,8 @@ function useOverlayLifecycle(open, panelRef, onRequestClose, keyboard = true, au
3908
3938
  unlockBody();
3909
3939
  previouslyFocused?.focus({ preventScroll: true });
3910
3940
  };
3911
- }, [keyboard, open, panelRef, autoFocusInput]);
3912
- (0, import_react20.useEffect)(() => {
3941
+ }, [keyboard, open, panelRef]);
3942
+ (0, import_react21.useEffect)(() => {
3913
3943
  if (!open) return;
3914
3944
  const timer = window.setTimeout(() => {
3915
3945
  const panel = panelRef.current;
@@ -4013,25 +4043,25 @@ function Floating({
4013
4043
  role = "tooltip",
4014
4044
  onOpenChange
4015
4045
  }) {
4016
- const rootRef = (0, import_react21.useRef)(null);
4017
- const triggerElementRef = (0, import_react21.useRef)(null);
4018
- const overlayRef = (0, import_react21.useRef)(null);
4019
- const enterTimer = (0, import_react21.useRef)();
4020
- const leaveTimer = (0, import_react21.useRef)();
4021
- const contentId = (0, import_react21.useId)();
4046
+ const rootRef = (0, import_react22.useRef)(null);
4047
+ const triggerElementRef = (0, import_react22.useRef)(null);
4048
+ const overlayRef = (0, import_react22.useRef)(null);
4049
+ const enterTimer = (0, import_react22.useRef)();
4050
+ const leaveTimer = (0, import_react22.useRef)();
4051
+ const contentId = (0, import_react22.useId)();
4022
4052
  const triggers = Array.isArray(trigger) ? trigger : [trigger];
4023
4053
  const hasContent = content !== null && content !== void 0 && typeof content !== "boolean" && !(typeof content === "string" && content.trim() === "");
4024
4054
  const [visible, setVisible] = useControllableState({ value: open, defaultValue: defaultOpen, onChange: onOpenChange });
4025
- const [position, setPosition] = (0, import_react21.useState)();
4055
+ const [position, setPosition] = (0, import_react22.useState)();
4026
4056
  const motion = useOverlayMotion(!!visible && hasContent, overlayRef, "tooltip", "bottom", !!position, void 0, !overlayClassName.includes("sia-form-item__error-popover"));
4027
- const [portalContainer, setPortalContainer] = (0, import_react21.useState)(null);
4028
- (0, import_react21.useLayoutEffect)(() => {
4057
+ const [portalContainer, setPortalContainer] = (0, import_react22.useState)(null);
4058
+ (0, import_react22.useLayoutEffect)(() => {
4029
4059
  if (!motion.present) return;
4030
4060
  setPortalContainer(rootRef.current?.closest(".sia-modal-root, .sia-drawer-root") ?? document.body);
4031
4061
  });
4032
- const setVisibleRef = (0, import_react21.useRef)(setVisible);
4062
+ const setVisibleRef = (0, import_react22.useRef)(setVisible);
4033
4063
  setVisibleRef.current = setVisible;
4034
- const closeSelfRef = (0, import_react21.useRef)();
4064
+ const closeSelfRef = (0, import_react22.useRef)();
4035
4065
  if (!closeSelfRef.current) closeSelfRef.current = () => setVisibleRef.current(false);
4036
4066
  const exclusiveTooltip = role === "tooltip" && triggers.includes("hover");
4037
4067
  function openNow() {
@@ -4060,7 +4090,7 @@ function Floating({
4060
4090
  if (delay <= 0) closeNow();
4061
4091
  else leaveTimer.current = window.setTimeout(closeNow, delay * 1e3);
4062
4092
  }
4063
- (0, import_react21.useEffect)(() => {
4093
+ (0, import_react22.useEffect)(() => {
4064
4094
  if (!visible || !triggers.includes("click")) return;
4065
4095
  const close = (event) => {
4066
4096
  const target = event.target;
@@ -4069,7 +4099,7 @@ function Floating({
4069
4099
  document.addEventListener("pointerdown", close);
4070
4100
  return () => document.removeEventListener("pointerdown", close);
4071
4101
  }, [triggers.join("|"), visible]);
4072
- (0, import_react21.useLayoutEffect)(() => {
4102
+ (0, import_react22.useLayoutEffect)(() => {
4073
4103
  if (!motion.present) {
4074
4104
  setPosition(void 0);
4075
4105
  return;
@@ -4119,11 +4149,11 @@ function Floating({
4119
4149
  unsubscribeLayers();
4120
4150
  };
4121
4151
  }, [children, content, placement, motion.present, portalContainer, autoAdjustOverflow, typeof arrow === "object" && arrow.pointAtCenter]);
4122
- (0, import_react21.useEffect)(() => () => {
4152
+ (0, import_react22.useEffect)(() => () => {
4123
4153
  clearTimers();
4124
4154
  if (activeTooltipClose === closeSelfRef.current) activeTooltipClose = void 0;
4125
4155
  }, []);
4126
- const child = (0, import_react21.cloneElement)(children, {
4156
+ const child = (0, import_react22.cloneElement)(children, {
4127
4157
  ...triggers.includes("hover") ? { onMouseEnter: (event) => {
4128
4158
  triggerElementRef.current = event.currentTarget;
4129
4159
  children.props.onMouseEnter?.(event);
@@ -4235,7 +4265,7 @@ function Progress({
4235
4265
  }
4236
4266
 
4237
4267
  // src/components/DataDisplay.tsx
4238
- var import_react23 = require("react");
4268
+ var import_react24 = require("react");
4239
4269
  var import_react_dom5 = require("react-dom");
4240
4270
  var import_jsx_runtime19 = require("react/jsx-runtime");
4241
4271
  function BadgeRibbon({ text, color, placement = "end", className = "", children, ...props }) {
@@ -4266,8 +4296,8 @@ function CollapsePanel({
4266
4296
  destroyInactivePanel = false,
4267
4297
  children
4268
4298
  }) {
4269
- const [keepChildren, setKeepChildren] = (0, import_react23.useState)(open || forceRender || !destroyInactivePanel);
4270
- (0, import_react23.useEffect)(() => {
4299
+ const [keepChildren, setKeepChildren] = (0, import_react24.useState)(open || forceRender || !destroyInactivePanel);
4300
+ (0, import_react24.useEffect)(() => {
4271
4301
  if (open || forceRender || !destroyInactivePanel) {
4272
4302
  setKeepChildren(true);
4273
4303
  return void 0;
@@ -4281,7 +4311,7 @@ function CollapsePanel({
4281
4311
  function Collapse({ items, activeKey, defaultActiveKey = [], accordion = false, bordered = true, ghost = false, destroyInactivePanel = false, expandIconPosition = "start", onChange, className = "", ...props }) {
4282
4312
  const normalize = (key) => Array.isArray(key) ? [...key] : key === void 0 ? [] : [key];
4283
4313
  const controlled = activeKey !== void 0;
4284
- const [internal, setInternal] = (0, import_react23.useState)(normalize(defaultActiveKey));
4314
+ const [internal, setInternal] = (0, import_react24.useState)(normalize(defaultActiveKey));
4285
4315
  const openKeys = controlled ? normalize(activeKey) : internal;
4286
4316
  function toggle(item) {
4287
4317
  if (item.disabled || item.collapsible === "disabled") return;
@@ -4311,22 +4341,22 @@ function Collapse({ items, activeKey, defaultActiveKey = [], accordion = false,
4311
4341
  }) });
4312
4342
  }
4313
4343
  function ImagePreview({ open, src, originalSrc, alt = "", onOpenChange, current = 0, count = 1, onCurrentChange }) {
4314
- const previewRef = (0, import_react23.useRef)(null);
4344
+ const previewRef = (0, import_react24.useRef)(null);
4315
4345
  const motion = useOverlayMotion(open, previewRef, "fade");
4316
- const stageRef = (0, import_react23.useRef)(null);
4317
- const [natural, setNatural] = (0, import_react23.useState)({ src: "", width: 0, height: 0 });
4318
- const [area, setArea] = (0, import_react23.useState)({ width: 0, height: 0 });
4319
- const [zoom, setZoom] = (0, import_react23.useState)(1);
4320
- const [rotation, setRotation] = (0, import_react23.useState)(0);
4321
- const [flip, setFlip] = (0, import_react23.useState)({ x: 1, y: 1 });
4322
- const [pan, setPan] = (0, import_react23.useState)({ x: 0, y: 0 });
4323
- const [failed, setFailed] = (0, import_react23.useState)(false);
4324
- const [original, setOriginal] = (0, import_react23.useState)("preview");
4346
+ const stageRef = (0, import_react24.useRef)(null);
4347
+ const [natural, setNatural] = (0, import_react24.useState)({ src: "", width: 0, height: 0 });
4348
+ const [area, setArea] = (0, import_react24.useState)({ width: 0, height: 0 });
4349
+ const [zoom, setZoom] = (0, import_react24.useState)(1);
4350
+ const [rotation, setRotation] = (0, import_react24.useState)(0);
4351
+ const [flip, setFlip] = (0, import_react24.useState)({ x: 1, y: 1 });
4352
+ const [pan, setPan] = (0, import_react24.useState)({ x: 0, y: 0 });
4353
+ const [failed, setFailed] = (0, import_react24.useState)(false);
4354
+ const [original, setOriginal] = (0, import_react24.useState)("preview");
4325
4355
  const displaySrc = original === "loaded" && originalSrc ? originalSrc : src;
4326
- (0, import_react23.useEffect)(() => {
4356
+ (0, import_react24.useEffect)(() => {
4327
4357
  if (open) setOriginal("preview");
4328
4358
  }, [open, src, originalSrc]);
4329
- (0, import_react23.useEffect)(() => {
4359
+ (0, import_react24.useEffect)(() => {
4330
4360
  if (!open || original !== "loading" || !originalSrc) return;
4331
4361
  let active = true;
4332
4362
  const image = new window.Image();
@@ -4343,7 +4373,7 @@ function ImagePreview({ open, src, originalSrc, alt = "", onOpenChange, current
4343
4373
  image.onerror = null;
4344
4374
  };
4345
4375
  }, [open, original, originalSrc, src]);
4346
- const drag = (0, import_react23.useRef)();
4376
+ const drag = (0, import_react24.useRef)();
4347
4377
  useOverlayLifecycle(motion.present, previewRef, () => {
4348
4378
  if (open) onOpenChange(false);
4349
4379
  });
@@ -4354,13 +4384,13 @@ function ImagePreview({ open, src, originalSrc, alt = "", onOpenChange, current
4354
4384
  setPan({ x: 0, y: 0 });
4355
4385
  drag.current = void 0;
4356
4386
  };
4357
- (0, import_react23.useEffect)(() => {
4387
+ (0, import_react24.useEffect)(() => {
4358
4388
  if (open) {
4359
4389
  reset();
4360
4390
  setFailed(false);
4361
4391
  }
4362
4392
  }, [open, displaySrc]);
4363
- (0, import_react23.useEffect)(() => {
4393
+ (0, import_react24.useEffect)(() => {
4364
4394
  if (!open || !onCurrentChange || count < 2) return;
4365
4395
  const handleKey = (event) => {
4366
4396
  if (event.key !== "ArrowLeft" && event.key !== "ArrowRight") return;
@@ -4372,7 +4402,7 @@ function ImagePreview({ open, src, originalSrc, alt = "", onOpenChange, current
4372
4402
  document.addEventListener("keydown", handleKey, true);
4373
4403
  return () => document.removeEventListener("keydown", handleKey, true);
4374
4404
  }, [open, current, count, onCurrentChange]);
4375
- (0, import_react23.useEffect)(() => {
4405
+ (0, import_react24.useEffect)(() => {
4376
4406
  const stage = stageRef.current;
4377
4407
  if (!open || !stage) return;
4378
4408
  const measure = () => {
@@ -4388,7 +4418,7 @@ function ImagePreview({ open, src, originalSrc, alt = "", onOpenChange, current
4388
4418
  const sideways = Math.abs(rotation % 180) === 90;
4389
4419
  const fit = ready ? Math.min(1, area.width / (sideways ? natural.height : natural.width), area.height / (sideways ? natural.width : natural.height)) : 0;
4390
4420
  const changeZoom = (factor) => setZoom((value) => Math.max(0.25, Math.min(8, value * factor)));
4391
- (0, import_react23.useEffect)(() => {
4421
+ (0, import_react24.useEffect)(() => {
4392
4422
  const stage = stageRef.current;
4393
4423
  if (!open || !stage) return;
4394
4424
  const wheel = (event) => {
@@ -4468,7 +4498,7 @@ function ImagePreview({ open, src, originalSrc, alt = "", onOpenChange, current
4468
4498
  ] })
4469
4499
  ] }), document.body);
4470
4500
  }
4471
- var ImageGroupContext = (0, import_react23.createContext)(null);
4501
+ var ImageGroupContext = (0, import_react24.createContext)(null);
4472
4502
 
4473
4503
  // src/components/FloatingPlaceholder.tsx
4474
4504
  var import_jsx_runtime20 = require("react/jsx-runtime");
@@ -4482,7 +4512,7 @@ function useFloatingPlaceholder({ mode, placeholder, filled, active = false }) {
4482
4512
  }
4483
4513
 
4484
4514
  // src/components/Select.tsx
4485
- var import_react30 = require("react");
4515
+ var import_react31 = require("react");
4486
4516
 
4487
4517
  // src/components/OverlayContentSkeleton.tsx
4488
4518
  var import_jsx_runtime21 = require("react/jsx-runtime");
@@ -4533,11 +4563,11 @@ function OverlayContentSkeleton({ layout }) {
4533
4563
  }
4534
4564
 
4535
4565
  // src/components/useOverlayExitPlaceholder.ts
4536
- var import_react24 = require("react");
4566
+ var import_react25 = require("react");
4537
4567
  function useOverlayExitPlaceholder(open, present, panelRef, bodyRef, captureContent) {
4538
- const layout = (0, import_react24.useRef)();
4539
- const dimensions = (0, import_react24.useRef)({ panelHeight: 0, bodyHeight: 0 });
4540
- (0, import_react24.useLayoutEffect)(() => {
4568
+ const layout = (0, import_react25.useRef)();
4569
+ const dimensions = (0, import_react25.useRef)({ panelHeight: 0, bodyHeight: 0 });
4570
+ (0, import_react25.useLayoutEffect)(() => {
4541
4571
  if (!open || !present) {
4542
4572
  if (present && bodyRef.current) bodyRef.current.scrollTop = bodyRef.current.scrollLeft = 0;
4543
4573
  return;
@@ -4590,7 +4620,7 @@ function useOverlayExitPlaceholder(open, present, panelRef, bodyRef, captureCont
4590
4620
  }
4591
4621
 
4592
4622
  // src/components/Modal.tsx
4593
- var import_react25 = require("react");
4623
+ var import_react26 = require("react");
4594
4624
  var import_client3 = require("react-dom/client");
4595
4625
  var import_jsx_runtime22 = require("react/jsx-runtime");
4596
4626
  var modalHandles = /* @__PURE__ */ new Set();
@@ -4601,7 +4631,7 @@ var typeIcons = {
4601
4631
  error: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Icon, { name: "circle-close", size: 23, variant: "filled" }),
4602
4632
  confirm: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Icon, { name: "question", size: 23, variant: "filled" })
4603
4633
  };
4604
- var ModalRoot = (0, import_react25.forwardRef)(function Modal({
4634
+ var ModalRoot = (0, import_react26.forwardRef)(function Modal({
4605
4635
  open,
4606
4636
  deferContent = false,
4607
4637
  loadingFallback,
@@ -4634,15 +4664,15 @@ var ModalRoot = (0, import_react25.forwardRef)(function Modal({
4634
4664
  style,
4635
4665
  ...props
4636
4666
  }, forwardedRef) {
4637
- const localRef = (0, import_react25.useRef)(null);
4638
- const bodyRef = (0, import_react25.useRef)(null);
4639
- const titleId = (0, import_react25.useId)();
4640
- const [submitting, setSubmitting] = (0, import_react25.useState)(false);
4667
+ const localRef = (0, import_react26.useRef)(null);
4668
+ const bodyRef = (0, import_react26.useRef)(null);
4669
+ const titleId = (0, import_react26.useId)();
4670
+ const [submitting, setSubmitting] = (0, import_react26.useState)(false);
4641
4671
  const motion = useOverlayMotion(open, localRef, "modal", "bottom", true, afterOpenChange);
4642
4672
  const { present: rendered, closing } = motion;
4643
4673
  const bodyReady = !closing && (!deferContent || motion.settled);
4644
4674
  const exitPlaceholder = useOverlayExitPlaceholder(open, rendered, localRef, bodyRef, bodyReady && loadingFallback === void 0);
4645
- const submitLock = (0, import_react25.useRef)(false);
4675
+ const submitLock = (0, import_react26.useRef)(false);
4646
4676
  function setRef(node) {
4647
4677
  localRef.current = node;
4648
4678
  if (typeof forwardedRef === "function") forwardedRef(node);
@@ -4755,7 +4785,7 @@ function openModal(config) {
4755
4785
  render();
4756
4786
  }
4757
4787
  function ModalInstance() {
4758
- (0, import_react25.useEffect)(() => {
4788
+ (0, import_react26.useEffect)(() => {
4759
4789
  mounted = true;
4760
4790
  if (!currentOpen) render();
4761
4791
  }, []);
@@ -4816,12 +4846,12 @@ var Modal2 = Object.assign(ModalRoot, {
4816
4846
  });
4817
4847
 
4818
4848
  // src/components/Input.tsx
4819
- var import_react27 = require("react");
4849
+ var import_react28 = require("react");
4820
4850
 
4821
4851
  // src/components/TextArea.tsx
4822
- var import_react26 = require("react");
4852
+ var import_react27 = require("react");
4823
4853
  var import_jsx_runtime23 = require("react/jsx-runtime");
4824
- var TextArea = (0, import_react26.forwardRef)(function TextArea2({
4854
+ var TextArea = (0, import_react27.forwardRef)(function TextArea2({
4825
4855
  label,
4826
4856
  hint,
4827
4857
  status = "default",
@@ -4839,9 +4869,9 @@ var TextArea = (0, import_react26.forwardRef)(function TextArea2({
4839
4869
  ...props
4840
4870
  }, ref) {
4841
4871
  const size = useControlSize(sizeProp);
4842
- const fallbackId = (0, import_react26.useId)();
4872
+ const fallbackId = (0, import_react27.useId)();
4843
4873
  const textAreaId = id ?? fallbackId;
4844
- const [uncontrolledValue, setUncontrolledValue] = (0, import_react26.useState)(() => defaultValue === void 0 ? "" : String(defaultValue));
4874
+ const [uncontrolledValue, setUncontrolledValue] = (0, import_react27.useState)(() => defaultValue === void 0 ? "" : String(defaultValue));
4845
4875
  const currentText = value !== void 0 ? String(value) : uncontrolledValue;
4846
4876
  const floating = useFloatingPlaceholder({ mode: placeholderMode, placeholder, filled: currentText.length > 0 });
4847
4877
  const hintId = `${textAreaId}-hint`;
@@ -4884,7 +4914,7 @@ var TextArea = (0, import_react26.forwardRef)(function TextArea2({
4884
4914
 
4885
4915
  // src/components/Input.tsx
4886
4916
  var import_jsx_runtime24 = require("react/jsx-runtime");
4887
- var Input = (0, import_react27.forwardRef)(function Input2({
4917
+ var Input = (0, import_react28.forwardRef)(function Input2({
4888
4918
  label,
4889
4919
  hint,
4890
4920
  status = "default",
@@ -4907,14 +4937,14 @@ var Input = (0, import_react27.forwardRef)(function Input2({
4907
4937
  ...props
4908
4938
  }, forwardedRef) {
4909
4939
  const size = useControlSize(sizeProp);
4910
- const fallbackId = (0, import_react27.useId)();
4940
+ const fallbackId = (0, import_react28.useId)();
4911
4941
  const inputId = id ?? fallbackId;
4912
- const localRef = (0, import_react27.useRef)(null);
4913
- const [uncontrolledValue, setUncontrolledValue] = (0, import_react27.useState)(() => defaultValue === void 0 ? "" : String(defaultValue));
4942
+ const localRef = (0, import_react28.useRef)(null);
4943
+ const [uncontrolledValue, setUncontrolledValue] = (0, import_react28.useState)(() => defaultValue === void 0 ? "" : String(defaultValue));
4914
4944
  const currentText = value !== void 0 ? String(value) : uncontrolledValue;
4915
4945
  const hasValue = currentText.length > 0;
4916
- const [expanded, setExpanded] = (0, import_react27.useState)(false);
4917
- const [expandedDraft, setExpandedDraft] = (0, import_react27.useState)("");
4946
+ const [expanded, setExpanded] = (0, import_react28.useState)(false);
4947
+ const [expandedDraft, setExpandedDraft] = (0, import_react28.useState)("");
4918
4948
  const floatingPlaceholder = usePlaceholderMode(placeholderMode) === "floating" && Boolean(placeholder);
4919
4949
  const hintId = `${inputId}-hint`;
4920
4950
  const describedBy = [props["aria-describedby"], hint ? hintId : null].filter(Boolean).join(" ") || void 0;
@@ -5047,7 +5077,7 @@ var Input = (0, import_react27.forwardRef)(function Input2({
5047
5077
  });
5048
5078
 
5049
5079
  // src/components/SelectionPanel.tsx
5050
- var import_react28 = require("react");
5080
+ var import_react29 = require("react");
5051
5081
 
5052
5082
  // src/components/selectionValues.ts
5053
5083
  function normalizeSelectionValues(values, options) {
@@ -5078,27 +5108,27 @@ function SelectionPanel({
5078
5108
  autoFocusSearch = false,
5079
5109
  groupCheckable = false
5080
5110
  }) {
5081
- const value = (0, import_react28.useMemo)(() => normalizeSelectionValues(rawValue, options), [rawValue, options]);
5082
- const [localSearch, setLocalSearch] = (0, import_react28.useState)("");
5111
+ const value = (0, import_react29.useMemo)(() => normalizeSelectionValues(rawValue, options), [rawValue, options]);
5112
+ const [localSearch, setLocalSearch] = (0, import_react29.useState)("");
5083
5113
  const search = searchValue ?? localSearch;
5084
- const [scrollTop, setScrollTop] = (0, import_react28.useState)(0);
5085
- const [active, setActive] = (0, import_react28.useState)();
5086
- const [keyboardActive, setKeyboardActive] = (0, import_react28.useState)(false);
5087
- const [deselectedHover, setDeselectedHover] = (0, import_react28.useState)();
5088
- const listRef = (0, import_react28.useRef)(null);
5089
- const id = (0, import_react28.useId)();
5090
- const selected = (0, import_react28.useMemo)(() => new Set(value), [value]);
5114
+ const [scrollTop, setScrollTop] = (0, import_react29.useState)(0);
5115
+ const [active, setActive] = (0, import_react29.useState)();
5116
+ const [keyboardActive, setKeyboardActive] = (0, import_react29.useState)(false);
5117
+ const [deselectedHover, setDeselectedHover] = (0, import_react29.useState)();
5118
+ const listRef = (0, import_react29.useRef)(null);
5119
+ const id = (0, import_react29.useId)();
5120
+ const selected = (0, import_react29.useMemo)(() => new Set(value), [value]);
5091
5121
  const count = Math.max(1, Math.floor(columns));
5092
- const allOptions = (0, import_react28.useMemo)(() => {
5122
+ const allOptions = (0, import_react29.useMemo)(() => {
5093
5123
  if (!includeUnknownValues) return [...options];
5094
5124
  const known = new Set(options.filter((option) => option.optionType !== "divider").map((option) => option.value));
5095
5125
  return [...value.filter((item) => !known.has(item)).map((item) => ({ value: item, label: String(item), group: "\u81EA\u5B9A\u4E49\u503C" })), ...options];
5096
5126
  }, [options, value, includeUnknownValues]);
5097
- const filtered = (0, import_react28.useMemo)(
5127
+ const filtered = (0, import_react29.useMemo)(
5098
5128
  () => allOptions.filter((option) => (!selectedOnly || selected.has(option.value)) && (!search || option.optionType !== "divider" && [option.label, option.value].some((text) => String(text ?? "").toLowerCase().includes(search.toLowerCase())))),
5099
5129
  [allOptions, selectedOnly, selected, search]
5100
5130
  );
5101
- const rows = (0, import_react28.useMemo)(() => {
5131
+ const rows = (0, import_react29.useMemo)(() => {
5102
5132
  const groups = /* @__PURE__ */ new Map();
5103
5133
  filtered.forEach((option) => {
5104
5134
  const items = groups.get(option.group) ?? [];
@@ -5124,7 +5154,7 @@ function SelectionPanel({
5124
5154
  const virtual = filtered.length > 100;
5125
5155
  const renderedRows = virtual ? rows.filter((row) => row.top + row.height >= scrollTop - 100 && row.top <= scrollTop + maxHeight + 100) : rows;
5126
5156
  const enabled = filtered.filter((option) => !option.disabled && option.optionType !== "divider");
5127
- (0, import_react28.useEffect)(() => {
5157
+ (0, import_react29.useEffect)(() => {
5128
5158
  setScrollTop(0);
5129
5159
  if (listRef.current) listRef.current.scrollTop = 0;
5130
5160
  setActive(void 0);
@@ -5291,14 +5321,14 @@ function SelectionPanel({
5291
5321
  }
5292
5322
 
5293
5323
  // src/components/OverflowTags.tsx
5294
- var import_react29 = require("react");
5324
+ var import_react30 = require("react");
5295
5325
  var import_jsx_runtime26 = require("react/jsx-runtime");
5296
5326
  function OverflowTags({ items, maxCount: maxCount2, expandToFit = false, className = "", tagClassName, restClassName = "" }) {
5297
- const rootRef = (0, import_react29.useRef)(null);
5298
- const measureRef = (0, import_react29.useRef)(null);
5327
+ const rootRef = (0, import_react30.useRef)(null);
5328
+ const measureRef = (0, import_react30.useRef)(null);
5299
5329
  const limit = Math.min(items.length, Math.max(0, Math.floor(maxCount2) || 0));
5300
- const [layout, setLayout] = (0, import_react29.useState)({ count: 0, minimumWidths: [] });
5301
- (0, import_react29.useLayoutEffect)(() => {
5330
+ const [layout, setLayout] = (0, import_react30.useState)({ count: 0, minimumWidths: [] });
5331
+ (0, import_react30.useLayoutEffect)(() => {
5302
5332
  const root = rootRef.current;
5303
5333
  const measure = measureRef.current;
5304
5334
  if (!root || !measure) return;
@@ -5355,7 +5385,7 @@ function defaultFilterOption(query, option) {
5355
5385
  const keyword = query.toLowerCase();
5356
5386
  return [option.label, option.value].some((value) => String(value).toLowerCase().includes(keyword));
5357
5387
  }
5358
- var Select = (0, import_react30.forwardRef)(function Select2({
5388
+ var Select = (0, import_react31.forwardRef)(function Select2({
5359
5389
  options,
5360
5390
  mode = "single",
5361
5391
  popupMode: popupModeProp,
@@ -5394,27 +5424,27 @@ var Select = (0, import_react30.forwardRef)(function Select2({
5394
5424
  }, forwardedRef) {
5395
5425
  const showSearch = showSearchProp ?? options.length > 15;
5396
5426
  const size = useControlSize(sizeProp);
5397
- const fallbackId = (0, import_react30.useId)();
5427
+ const fallbackId = (0, import_react31.useId)();
5398
5428
  const selectId = id ?? fallbackId;
5399
5429
  const listboxId = `${selectId}-listbox`;
5400
- const rootRef = (0, import_react30.useRef)(null);
5401
- const popupRef = (0, import_react30.useRef)(null);
5402
- const searchRef = (0, import_react30.useRef)(null);
5403
- const listRef = (0, import_react30.useRef)(null);
5404
- const [open, setOpen] = (0, import_react30.useState)(false);
5430
+ const rootRef = (0, import_react31.useRef)(null);
5431
+ const popupRef = (0, import_react31.useRef)(null);
5432
+ const searchRef = (0, import_react31.useRef)(null);
5433
+ const listRef = (0, import_react31.useRef)(null);
5434
+ const [open, setOpen] = (0, import_react31.useState)(false);
5405
5435
  const automaticMode = popupModeProp ?? (options.length > modalThreshold ? "modal" : "dropdown");
5406
- const [openedMode, setOpenedMode] = (0, import_react30.useState)(automaticMode);
5436
+ const [openedMode, setOpenedMode] = (0, import_react31.useState)(automaticMode);
5407
5437
  const popupMode = open ? openedMode : automaticMode;
5408
- const [modalValues, setModalValues] = (0, import_react30.useState)([]);
5409
- const [modalSubmitting, setModalSubmitting] = (0, import_react30.useState)(false);
5410
- const modalSubmitLock = (0, import_react30.useRef)(false);
5411
- const [selectedOnly, setSelectedOnly] = (0, import_react30.useState)(false);
5412
- const [query, setQuery] = (0, import_react30.useState)("");
5413
- const [activeIndex, setActiveIndex] = (0, import_react30.useState)(-1);
5414
- const [scrollTop, setScrollTop] = (0, import_react30.useState)(0);
5415
- const [dropdownFontSize, setDropdownFontSize] = (0, import_react30.useState)();
5416
- const pendingSelectedScroll = (0, import_react30.useRef)(false);
5417
- const deferredQuery = (0, import_react30.useDeferredValue)(query.trim());
5438
+ const [modalValues, setModalValues] = (0, import_react31.useState)([]);
5439
+ const [modalSubmitting, setModalSubmitting] = (0, import_react31.useState)(false);
5440
+ const modalSubmitLock = (0, import_react31.useRef)(false);
5441
+ const [selectedOnly, setSelectedOnly] = (0, import_react31.useState)(false);
5442
+ const [query, setQuery] = (0, import_react31.useState)("");
5443
+ const [activeIndex, setActiveIndex] = (0, import_react31.useState)(-1);
5444
+ const [scrollTop, setScrollTop] = (0, import_react31.useState)(0);
5445
+ const [dropdownFontSize, setDropdownFontSize] = (0, import_react31.useState)();
5446
+ const pendingSelectedScroll = (0, import_react31.useRef)(false);
5447
+ const deferredQuery = (0, import_react31.useDeferredValue)(query.trim());
5418
5448
  const initialValue = defaultValue === void 0 ? mode === "multiple" ? [] : null : defaultValue;
5419
5449
  const [currentValue, setCurrentValue] = useControllableState({
5420
5450
  value,
@@ -5429,20 +5459,20 @@ var Select = (0, import_react30.forwardRef)(function Select2({
5429
5459
  }
5430
5460
  }
5431
5461
  });
5432
- const selectedValues = (0, import_react30.useMemo)(() => {
5462
+ const selectedValues = (0, import_react31.useMemo)(() => {
5433
5463
  if (currentValue == null || currentValue === "" && !options.some((option) => option.value === "")) return [];
5434
5464
  if (mode === "multiple") return Array.isArray(currentValue) ? currentValue : currentValue === null ? [] : [currentValue];
5435
5465
  return Array.isArray(currentValue) ? currentValue.slice(0, 1) : currentValue === null ? [] : [currentValue];
5436
5466
  }, [currentValue, mode, options]);
5437
- const selectedValueSet = (0, import_react30.useMemo)(() => new Set(selectedValues), [selectedValues]);
5438
- const availableOptions = (0, import_react30.useMemo)(() => {
5467
+ const selectedValueSet = (0, import_react31.useMemo)(() => new Set(selectedValues), [selectedValues]);
5468
+ const availableOptions = (0, import_react31.useMemo)(() => {
5439
5469
  if (!allowInput) return options;
5440
5470
  const optionValueSet = new Set(options.map((option) => option.value));
5441
5471
  const selectedCustomOptions = selectedValues.filter((selectedValue) => !optionValueSet.has(selectedValue)).map((selectedValue) => ({ label: String(selectedValue), value: selectedValue }));
5442
5472
  return selectedCustomOptions.length ? [...selectedCustomOptions, ...options] : options;
5443
5473
  }, [allowInput, options, selectedValues]);
5444
- const selectedOptions = (0, import_react30.useMemo)(() => selectedValues.map((selectedValue) => availableOptions.find((option) => option.value === selectedValue)).filter((option) => option !== void 0), [availableOptions, selectedValues]);
5445
- const filteredOptions = (0, import_react30.useMemo)(() => deferredQuery ? availableOptions.filter((option) => filterOption(deferredQuery, option)) : availableOptions, [availableOptions, deferredQuery, filterOption]);
5474
+ const selectedOptions = (0, import_react31.useMemo)(() => selectedValues.map((selectedValue) => availableOptions.find((option) => option.value === selectedValue)).filter((option) => option !== void 0), [availableOptions, selectedValues]);
5475
+ const filteredOptions = (0, import_react31.useMemo)(() => deferredQuery ? availableOptions.filter((option) => filterOption(deferredQuery, option)) : availableOptions, [availableOptions, deferredQuery, filterOption]);
5446
5476
  const inputValue = query.trim();
5447
5477
  const exactInputOption = inputValue ? availableOptions.find((option) => String(option.value).toLowerCase() === inputValue.toLowerCase() || typeof option.label === "string" && option.label.toLowerCase() === inputValue.toLowerCase()) : void 0;
5448
5478
  const canSubmitInput = allowInput && Boolean(inputValue) && !exactInputOption;
@@ -5456,7 +5486,7 @@ var Select = (0, import_react30.forwardRef)(function Select2({
5456
5486
  const renderedOptions = virtualEnabled ? filteredOptions.slice(virtualStart, virtualEnd) : filteredOptions;
5457
5487
  const enabledFilteredOptions = filteredOptions.filter((option) => !option.disabled);
5458
5488
  const allFilteredSelected = enabledFilteredOptions.length > 0 && enabledFilteredOptions.every((option) => selectedValueSet.has(option.value));
5459
- (0, import_react30.useEffect)(() => {
5489
+ (0, import_react31.useEffect)(() => {
5460
5490
  if (!open || popupMode === "modal") return void 0;
5461
5491
  function closeFromOutside(event) {
5462
5492
  const target = event.target;
@@ -5465,15 +5495,15 @@ var Select = (0, import_react30.forwardRef)(function Select2({
5465
5495
  document.addEventListener("mousedown", closeFromOutside);
5466
5496
  return () => document.removeEventListener("mousedown", closeFromOutside);
5467
5497
  }, [open, popupMode]);
5468
- (0, import_react30.useEffect)(() => {
5498
+ (0, import_react31.useEffect)(() => {
5469
5499
  if (!open || popupMode !== "dropdown" || !(showSearch || allowInput)) return;
5470
5500
  const frame = requestAnimationFrame(() => searchRef.current?.focus({ preventScroll: true }));
5471
5501
  return () => cancelAnimationFrame(frame);
5472
5502
  }, [allowInput, open, popupMode, showSearch]);
5473
- (0, import_react30.useEffect)(() => {
5503
+ (0, import_react31.useEffect)(() => {
5474
5504
  if (disabled || loading) closeDropdown();
5475
5505
  }, [disabled, loading]);
5476
- (0, import_react30.useEffect)(() => {
5506
+ (0, import_react31.useEffect)(() => {
5477
5507
  if (!open || popupMode !== "dropdown" || !pendingSelectedScroll.current || query) return;
5478
5508
  const index = filteredOptions.findIndex((option) => selectedValueSet.has(option.value));
5479
5509
  if (index < 0) return;
@@ -5488,7 +5518,7 @@ var Select = (0, import_react30.forwardRef)(function Select2({
5488
5518
  });
5489
5519
  return () => cancelAnimationFrame(frame);
5490
5520
  }, [open, popupMode, filteredOptions, selectedValueSet, virtualEnabled, optionHeight, query]);
5491
- (0, import_react30.useLayoutEffect)(() => {
5521
+ (0, import_react31.useLayoutEffect)(() => {
5492
5522
  if (!open || popupMode !== "dropdown") return;
5493
5523
  const trigger = rootRef.current?.querySelector(".sia-select__trigger");
5494
5524
  if (trigger) setDropdownFontSize(getComputedStyle(trigger).fontSize);
@@ -5837,7 +5867,7 @@ var Select = (0, import_react30.forwardRef)(function Select2({
5837
5867
  });
5838
5868
 
5839
5869
  // src/components/Upload.tsx
5840
- var import_react32 = require("react");
5870
+ var import_react33 = require("react");
5841
5871
 
5842
5872
  // src/components/uploadFiles.ts
5843
5873
  function acceptsUploadFile(file, accept) {
@@ -5968,7 +5998,7 @@ function isUploadImage(file, accept) {
5968
5998
  }
5969
5999
 
5970
6000
  // src/components/Message.tsx
5971
- var import_react31 = require("react");
6001
+ var import_react32 = require("react");
5972
6002
  var import_client4 = require("react-dom/client");
5973
6003
  var import_jsx_runtime28 = require("react/jsx-runtime");
5974
6004
  var messageSeed = 0;
@@ -5996,13 +6026,13 @@ function ensureMessageRoot() {
5996
6026
  return true;
5997
6027
  }
5998
6028
  function MessageView({ item }) {
5999
- const ref = (0, import_react31.useRef)(null);
6029
+ const ref = (0, import_react32.useRef)(null);
6000
6030
  const motion = useOverlayMotion(!item.closing, ref, "toast", "bottom", true, (open) => {
6001
6031
  if (open) return;
6002
6032
  messageItems = messageItems.filter((candidate) => candidate.key !== item.key || !candidate.closing);
6003
6033
  renderMessages();
6004
6034
  });
6005
- (0, import_react31.useEffect)(() => {
6035
+ (0, import_react32.useEffect)(() => {
6006
6036
  if (motion.present || !item.closing) return;
6007
6037
  messageItems = messageItems.filter((candidate) => candidate.key !== item.key || !candidate.closing);
6008
6038
  renderMessages();
@@ -6094,8 +6124,8 @@ var message = {
6094
6124
  var import_jsx_runtime29 = require("react/jsx-runtime");
6095
6125
  var LIST_IGNORE = /* @__PURE__ */ Symbol("SIA_UPLOAD_LIST_IGNORE");
6096
6126
  function useThumbnail(file, accept) {
6097
- const [local, setLocal] = (0, import_react32.useState)();
6098
- (0, import_react32.useEffect)(() => {
6127
+ const [local, setLocal] = (0, import_react33.useState)();
6128
+ (0, import_react33.useEffect)(() => {
6099
6129
  if (!file?.thumbUrl && file?.originFileObj instanceof Blob && file.originFileObj.type.startsWith("image/")) {
6100
6130
  const url = URL.createObjectURL(file.originFileObj);
6101
6131
  setLocal(url);
@@ -6107,9 +6137,9 @@ function useThumbnail(file, accept) {
6107
6137
  }
6108
6138
  function UploadItem({ file, files, props, actions }) {
6109
6139
  const source = useThumbnail(file, props.accept);
6110
- const [failed, setFailed] = (0, import_react32.useState)(false);
6111
- const [downloading, setDownloading] = (0, import_react32.useState)(false);
6112
- const downloadingRef = (0, import_react32.useRef)(false);
6140
+ const [failed, setFailed] = (0, import_react33.useState)(false);
6141
+ const [downloading, setDownloading] = (0, import_react33.useState)(false);
6142
+ const downloadingRef = (0, import_react33.useRef)(false);
6113
6143
  const canPreview = !!(source || file.url || file.originFileObj || props.onPreview);
6114
6144
  const canDownload = !!(file.url || file.originFileObj || props.downloadRequest);
6115
6145
  async function download() {
@@ -6125,7 +6155,7 @@ function UploadItem({ file, files, props, actions }) {
6125
6155
  setDownloading(false);
6126
6156
  }
6127
6157
  }
6128
- (0, import_react32.useEffect)(() => setFailed(false), [source]);
6158
+ (0, import_react33.useEffect)(() => setFailed(false), [source]);
6129
6159
  const node = /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: `sia-upload__item sia-upload__item--${file.status ?? "ready"}`, children: [
6130
6160
  props.listType !== "text" ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Button, { variant: "text", className: "sia-upload__thumbnail", "aria-label": `\u9884\u89C8\u7F29\u7565\u56FE ${file.name}`, onClick: actions.preview, disabled: !canPreview, children: source && !failed ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("img", { src: source, alt: file.name, onError: () => setFailed(true) }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, { name: file.type?.startsWith("image/") ? "image" : "file", size: 28 }) }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "sia-upload__file-icon", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, { name: file.status === "done" ? "circle-check" : "file", size: 24 }) }),
6131
6161
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "sia-upload__name", ...withTitleTooltip({ title: file.relativePath || file.name }), children: file.url ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("a", { href: file.url, target: "_blank", rel: "noreferrer", children: file.name }) : file.name }),
@@ -6147,7 +6177,7 @@ function UploadItem({ file, files, props, actions }) {
6147
6177
  ] });
6148
6178
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_jsx_runtime29.Fragment, { children: props.itemRender ? props.itemRender(node, file, files, actions) : node });
6149
6179
  }
6150
- var UploadRoot = (0, import_react32.forwardRef)(function UploadRoot2({
6180
+ var UploadRoot = (0, import_react33.forwardRef)(function UploadRoot2({
6151
6181
  accept,
6152
6182
  acceptMode = "validate",
6153
6183
  multiple = false,
@@ -6187,19 +6217,19 @@ var UploadRoot = (0, import_react32.forwardRef)(function UploadRoot2({
6187
6217
  const cardWidth = cardDimension(typeof cardSize === "number" ? cardSize : cardSize?.width);
6188
6218
  const cardHeight = cardDimension(typeof cardSize === "number" ? cardSize : cardSize?.height);
6189
6219
  const compactCard = listType === "picture-card" && (cardWidth < 88 || cardHeight < 88);
6190
- const inputRef = (0, import_react32.useRef)(null);
6191
- const [internalFiles, setInternalFiles] = (0, import_react32.useState)(defaultFileList);
6220
+ const inputRef = (0, import_react33.useRef)(null);
6221
+ const [internalFiles, setInternalFiles] = (0, import_react33.useState)(defaultFileList);
6192
6222
  const files = fileList ?? internalFiles;
6193
- const filesRef = (0, import_react32.useRef)(files);
6223
+ const filesRef = (0, import_react33.useRef)(files);
6194
6224
  filesRef.current = files;
6195
- const tasks = (0, import_react32.useRef)(/* @__PURE__ */ new Map());
6196
- const mounted = (0, import_react32.useRef)(true);
6197
- const [dragging, setDragging] = (0, import_react32.useState)(false);
6198
- const [preview, setPreview] = (0, import_react32.useState)();
6225
+ const tasks = (0, import_react33.useRef)(/* @__PURE__ */ new Map());
6226
+ const mounted = (0, import_react33.useRef)(true);
6227
+ const [dragging, setDragging] = (0, import_react33.useState)(false);
6228
+ const [preview, setPreview] = (0, import_react33.useState)();
6199
6229
  const previewSource = useThumbnail(preview, accept);
6200
6230
  const limit = maxCount2 === void 0 || !Number.isFinite(maxCount2) ? Infinity : Math.max(0, Math.floor(maxCount2));
6201
6231
  const full = files.length >= limit;
6202
- const current = (0, import_react32.useRef)({ disabled, directory, recursive });
6232
+ const current = (0, import_react33.useRef)({ disabled, directory, recursive });
6203
6233
  current.current = { disabled, directory, recursive };
6204
6234
  function cancel(uid) {
6205
6235
  const task = tasks.current.get(uid);
@@ -6211,14 +6241,14 @@ var UploadRoot = (0, import_react32.forwardRef)(function UploadRoot2({
6211
6241
  }
6212
6242
  task?.finish();
6213
6243
  }
6214
- (0, import_react32.useEffect)(() => {
6244
+ (0, import_react33.useEffect)(() => {
6215
6245
  mounted.current = true;
6216
6246
  return () => {
6217
6247
  mounted.current = false;
6218
6248
  [...tasks.current.keys()].forEach(cancel);
6219
6249
  };
6220
6250
  }, []);
6221
- (0, import_react32.useEffect)(() => {
6251
+ (0, import_react33.useEffect)(() => {
6222
6252
  for (const uid of tasks.current.keys()) if (!files.some((file) => file.uid === uid)) cancel(uid);
6223
6253
  if (preview && !files.some((file) => file.uid === preview.uid)) setPreview(void 0);
6224
6254
  }, [files, preview]);
@@ -6324,7 +6354,7 @@ var UploadRoot = (0, import_react32.forwardRef)(function UploadRoot2({
6324
6354
  } catch {
6325
6355
  }
6326
6356
  }
6327
- (0, import_react32.useImperativeHandle)(ref, () => ({
6357
+ (0, import_react33.useImperativeHandle)(ref, () => ({
6328
6358
  upload: async (uid) => {
6329
6359
  await Promise.all(filesRef.current.filter((file) => (!uid || file.uid === uid) && file.status !== "done").map(start));
6330
6360
  },
@@ -6452,7 +6482,7 @@ var UploadRoot = (0, import_react32.forwardRef)(function UploadRoot2({
6452
6482
  }
6453
6483
  );
6454
6484
  });
6455
- var UploadDragger = (0, import_react32.forwardRef)(function UploadDragger2({ hint = "\u652F\u6301\u5355\u4E2A\u6216\u6279\u91CF\u4E0A\u4F20", children, className = "", ...props }, ref) {
6485
+ var UploadDragger = (0, import_react33.forwardRef)(function UploadDragger2({ hint = "\u652F\u6301\u5355\u4E2A\u6216\u6279\u91CF\u4E0A\u4F20", children, className = "", ...props }, ref) {
6456
6486
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(UploadRoot, { ...props, ref, className: `sia-upload-dragger ${className}`.trim(), children: children ?? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "sia-upload-dragger__content", children: [
6457
6487
  /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, { name: "upload", size: 32 }),
6458
6488
  /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("strong", { children: [
@@ -6472,9 +6502,10 @@ var Upload = Object.assign(UploadRoot, {
6472
6502
  });
6473
6503
 
6474
6504
  // src/components/Breadcrumb.tsx
6505
+ var import_react34 = require("react");
6475
6506
  var import_jsx_runtime30 = require("react/jsx-runtime");
6476
- function Breadcrumb({ items, separator = "/", itemRender, className = "", ...props }) {
6477
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("nav", { "aria-label": "\u9762\u5305\u5C51\u5BFC\u822A", ...withTitleTooltip(props), className: `sia-breadcrumb ${className}`.trim(), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("ol", { className: "sia-breadcrumb__list", children: items.map((item, index) => {
6507
+ var Breadcrumb = (0, import_react34.forwardRef)(function Breadcrumb2({ items, separator = "/", itemRender, className = "", ...props }, forwardedRef) {
6508
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("nav", { ref: forwardedRef, "aria-label": "\u9762\u5305\u5C51\u5BFC\u822A", ...withTitleTooltip(props), className: `sia-breadcrumb ${className}`.trim(), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("ol", { className: "sia-breadcrumb__list", children: items.map((item, index) => {
6478
6509
  const current = index === items.length - 1;
6479
6510
  const content = /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
6480
6511
  item.icon ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "sia-breadcrumb__icon", "aria-hidden": "true", children: item.icon }) : null,
@@ -6485,15 +6516,15 @@ function Breadcrumb({ items, separator = "/", itemRender, className = "", ...pro
6485
6516
  return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("li", { className: `sia-breadcrumb__item${current ? " is-current" : ""}${item.disabled ? " is-disabled" : ""}`, children: [
6486
6517
  /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { className: "sia-breadcrumb__entry", "aria-current": current ? "page" : void 0, children: [
6487
6518
  label,
6488
- item.menu?.items.length ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Dropdown, { menu: item.menu, trigger: ["click"], disabled: item.disabled, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Button, { className: "sia-breadcrumb__menu-trigger", variant: "text", size: "small", disabled: item.disabled, "aria-label": `\u5C55\u5F00${typeof item.title === "string" ? item.title : "\u5C42\u7EA7"}\u83DC\u5355`, icon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Icon, { name: "chevron-down", size: 12 }) }) }) : null
6519
+ item.menu?.items.length ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Dropdown2, { menu: item.menu, trigger: ["click"], disabled: item.disabled, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Button, { className: "sia-breadcrumb__menu-trigger", variant: "text", size: "small", disabled: item.disabled, "aria-label": `\u5C55\u5F00${typeof item.title === "string" ? item.title : "\u5C42\u7EA7"}\u83DC\u5355`, icon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Icon, { name: "chevron-down", size: 12 }) }) }) : null
6489
6520
  ] }),
6490
6521
  !current ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "sia-breadcrumb__separator", "aria-hidden": "true", children: item.separator === void 0 ? separator : item.separator }) : null
6491
6522
  ] }, item.key ?? index);
6492
6523
  }) }) });
6493
- }
6524
+ });
6494
6525
 
6495
6526
  // src/components/Typography.tsx
6496
- var import_react33 = require("react");
6527
+ var import_react35 = require("react");
6497
6528
  var import_jsx_runtime31 = require("react/jsx-runtime");
6498
6529
  function TypographyContent({
6499
6530
  as: Tag2 = "span",
@@ -6513,26 +6544,26 @@ function TypographyContent({
6513
6544
  className = "",
6514
6545
  ...props
6515
6546
  }) {
6516
- const contentRef = (0, import_react33.useRef)(null);
6517
- const editRef = (0, import_react33.useRef)(null);
6518
- const timer = (0, import_react33.useRef)();
6519
- const [localText, setLocalText] = (0, import_react33.useState)();
6520
- const [draft, setDraft] = (0, import_react33.useState)("");
6521
- const [editing, setEditing] = (0, import_react33.useState)(false);
6522
- const [copied, setCopied] = (0, import_react33.useState)(false);
6523
- const [copyError, setCopyError] = (0, import_react33.useState)(false);
6524
- const [expanded, setExpanded] = (0, import_react33.useState)(false);
6525
- const [overflow, setOverflow] = (0, import_react33.useState)(false);
6547
+ const contentRef = (0, import_react35.useRef)(null);
6548
+ const editRef = (0, import_react35.useRef)(null);
6549
+ const timer = (0, import_react35.useRef)();
6550
+ const [localText, setLocalText] = (0, import_react35.useState)();
6551
+ const [draft, setDraft] = (0, import_react35.useState)("");
6552
+ const [editing, setEditing] = (0, import_react35.useState)(false);
6553
+ const [copied, setCopied] = (0, import_react35.useState)(false);
6554
+ const [copyError, setCopyError] = (0, import_react35.useState)(false);
6555
+ const [expanded, setExpanded] = (0, import_react35.useState)(false);
6556
+ const [overflow, setOverflow] = (0, import_react35.useState)(false);
6526
6557
  const editConfig = typeof editable === "object" ? editable : void 0;
6527
6558
  const content = editConfig?.text ?? localText ?? children;
6528
6559
  const requestedRows = typeof ellipsis === "object" ? ellipsis.rows ?? 1 : 1;
6529
6560
  const rows = Number.isFinite(requestedRows) ? Math.max(1, Math.floor(requestedRows)) : 1;
6530
6561
  const expandable = typeof ellipsis === "object" && ellipsis.expandable;
6531
- (0, import_react33.useEffect)(() => {
6562
+ (0, import_react35.useEffect)(() => {
6532
6563
  setLocalText(void 0);
6533
6564
  }, [children]);
6534
- (0, import_react33.useEffect)(() => () => clearTimeout(timer.current), []);
6535
- (0, import_react33.useLayoutEffect)(() => {
6565
+ (0, import_react35.useEffect)(() => () => clearTimeout(timer.current), []);
6566
+ (0, import_react35.useLayoutEffect)(() => {
6536
6567
  const element = contentRef.current;
6537
6568
  if (!element || !ellipsis || !expandable || editing || expanded) return;
6538
6569
  const measure = () => setOverflow(element.scrollHeight > element.clientHeight + 1 || element.scrollWidth > element.clientWidth + 1);
@@ -6650,10 +6681,10 @@ var Typography = Object.assign(TypographyRoot, {
6650
6681
  });
6651
6682
 
6652
6683
  // src/components/FloatButton.tsx
6653
- var import_react34 = require("react");
6684
+ var import_react36 = require("react");
6654
6685
  var import_jsx_runtime32 = require("react/jsx-runtime");
6655
- var GroupShape = (0, import_react34.createContext)(void 0);
6656
- var FloatButtonRoot = (0, import_react34.forwardRef)(function FloatButton({
6686
+ var GroupShape = (0, import_react36.createContext)(void 0);
6687
+ var FloatButtonRoot = (0, import_react36.forwardRef)(function FloatButton({
6657
6688
  icon,
6658
6689
  description,
6659
6690
  tooltip,
@@ -6666,7 +6697,7 @@ var FloatButtonRoot = (0, import_react34.forwardRef)(function FloatButton({
6666
6697
  children,
6667
6698
  ...props
6668
6699
  }, ref) {
6669
- const groupShape = (0, import_react34.useContext)(GroupShape);
6700
+ const groupShape = (0, import_react36.useContext)(GroupShape);
6670
6701
  const label = props["aria-label"] ?? (typeof tooltip === "string" ? tooltip : typeof description === "string" ? description : "\u60AC\u6D6E\u64CD\u4F5C");
6671
6702
  const button = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
6672
6703
  "button",
@@ -6704,12 +6735,12 @@ function FloatButtonGroup({
6704
6735
  ...props
6705
6736
  }) {
6706
6737
  const [visible, setVisible] = useControllableState({ value: open, defaultValue: defaultOpen, onChange: onOpenChange });
6707
- const rootRef = (0, import_react34.useRef)(null);
6708
- const triggerRef = (0, import_react34.useRef)(null);
6709
- const listRef = (0, import_react34.useRef)(null);
6738
+ const rootRef = (0, import_react36.useRef)(null);
6739
+ const triggerRef = (0, import_react36.useRef)(null);
6740
+ const listRef = (0, import_react36.useRef)(null);
6710
6741
  const motion = useOverlayMotion(!trigger || visible, listRef, "popup", placement, true, void 0, !!trigger);
6711
- const id = (0, import_react34.useId)();
6712
- (0, import_react34.useEffect)(() => {
6742
+ const id = (0, import_react36.useId)();
6743
+ (0, import_react36.useEffect)(() => {
6713
6744
  if (!trigger || !visible) return;
6714
6745
  const close = (event) => {
6715
6746
  if (!rootRef.current?.contains(event.target)) setVisible(false);
@@ -6763,10 +6794,10 @@ function FloatButtonGroup({
6763
6794
  ) });
6764
6795
  }
6765
6796
  function FloatButtonBackTop({ target, visibilityHeight = 400, behavior = "smooth", onClick, icon, tooltip = "\u8FD4\u56DE\u9876\u90E8", ...props }) {
6766
- const [visible, setVisible] = (0, import_react34.useState)(false);
6767
- const buttonRef = (0, import_react34.useRef)(null);
6797
+ const [visible, setVisible] = (0, import_react36.useState)(false);
6798
+ const buttonRef = (0, import_react36.useRef)(null);
6768
6799
  const motion = useOverlayMotion(visible, buttonRef, "fade");
6769
- (0, import_react34.useEffect)(() => {
6800
+ (0, import_react36.useEffect)(() => {
6770
6801
  const element = target ? target() : window;
6771
6802
  if (!element) return;
6772
6803
  const update = () => setVisible((element === window ? window.scrollY : element.scrollTop) >= visibilityHeight);
@@ -6790,6 +6821,7 @@ var FloatButton2 = Object.assign(FloatButtonRoot, {
6790
6821
  });
6791
6822
 
6792
6823
  // src/components/Result.tsx
6824
+ var import_react37 = require("react");
6793
6825
  var import_jsx_runtime33 = require("react/jsx-runtime");
6794
6826
  var icons = {
6795
6827
  success: "circle-check",
@@ -6797,17 +6829,17 @@ var icons = {
6797
6829
  info: "info",
6798
6830
  warning: "warning"
6799
6831
  };
6800
- function Result({ status = "info", title, subTitle, icon, extra, children, className = "", ...props }) {
6832
+ var Result = (0, import_react37.forwardRef)(function Result2({ status = "info", title, subTitle, icon, extra, children, className = "", ...props }, forwardedRef) {
6801
6833
  const resultIcon = icon === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Icon, { name: icons[status], size: 72, variant: "filled" }) : icon;
6802
6834
  const present = (value) => value !== void 0 && value !== null && value !== false;
6803
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { ...props, className: `sia-result sia-result--${status} ${className}`.trim(), children: [
6835
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { ref: forwardedRef, ...props, className: `sia-result sia-result--${status} ${className}`.trim(), children: [
6804
6836
  present(resultIcon) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "sia-result__icon", "aria-hidden": "true", children: resultIcon }),
6805
6837
  present(title) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "sia-result__title", children: title }),
6806
6838
  present(subTitle) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "sia-result__subtitle", children: subTitle }),
6807
6839
  present(children) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "sia-result__content", children }),
6808
6840
  present(extra) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "sia-result__extra", children: extra })
6809
6841
  ] });
6810
- }
6842
+ });
6811
6843
 
6812
6844
  // src/core.ts
6813
6845
  initializeDefaultScrollbars();