@sia.soul/sia-react-ui 0.1.166 → 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-T2F6X3LA.js → chunk-5CGJVE4C.js} +26 -22
  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-Cnt8r6pj.d.cts → core-C7Was4Vc.d.cts} +6 -9
  14. package/dist/{core-Dy8NWJ1b.d.ts → core-D7C32Rdq.d.ts} +6 -9
  15. package/dist/core.cjs +83 -61
  16. package/dist/core.css +3135 -5340
  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 +6625 -6197
  24. package/dist/index.css +8733 -8560
  25. package/dist/index.d.cts +126 -110
  26. package/dist/index.d.ts +126 -110
  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
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  Icon,
6
6
  Modal
7
- } from "./chunk-G5EJJFUI.js";
7
+ } from "./chunk-FSO46WEJ.js";
8
8
  import {
9
9
  Button
10
10
  } from "./chunk-PAWEP65C.js";
@@ -586,7 +586,7 @@ function Segmented({ options, value, defaultValue, variant = "default", shape =
586
586
  }
587
587
 
588
588
  // src/components/Dropdown.tsx
589
- import { cloneElement, isValidElement, useEffect as useEffect2, useLayoutEffect as useLayoutEffect4, useRef as useRef4, useState as useState2 } from "react";
589
+ import { cloneElement, forwardRef as forwardRef2, isValidElement, useEffect as useEffect2, useLayoutEffect as useLayoutEffect4, useRef as useRef4, useState as useState2 } from "react";
590
590
  import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
591
591
  var placementMap = {
592
592
  bottomLeft: "bottom-start",
@@ -594,7 +594,7 @@ var placementMap = {
594
594
  topLeft: "top-start",
595
595
  topRight: "top-end"
596
596
  };
597
- function DropdownInternal({
597
+ var DropdownInternal = forwardRef2(function DropdownInternal2({
598
598
  popupAnchorRef,
599
599
  menu,
600
600
  children,
@@ -619,8 +619,13 @@ function DropdownInternal({
619
619
  onContextMenu,
620
620
  onKeyDown,
621
621
  ...props
622
- }) {
622
+ }, forwardedRef) {
623
623
  const rootRef = useRef4(null);
624
+ function setRootRef(node) {
625
+ rootRef.current = node;
626
+ if (typeof forwardedRef === "function") forwardedRef(node);
627
+ else if (forwardedRef) forwardedRef.current = node;
628
+ }
624
629
  const contextAnchorRef = useRef4(null);
625
630
  const popupRef = useRef4(null);
626
631
  const menuListRef = useRef4(null);
@@ -772,7 +777,7 @@ function DropdownInternal({
772
777
  return /* @__PURE__ */ jsxs2(
773
778
  "span",
774
779
  {
775
- ref: rootRef,
780
+ ref: setRootRef,
776
781
  className: `sia-dropdown${visible ? " is-open" : ""}${disabled ? " is-disabled" : ""} ${className}`.trim(),
777
782
  "aria-expanded": visible,
778
783
  "aria-haspopup": "menu",
@@ -828,11 +833,11 @@ function DropdownInternal({
828
833
  ]
829
834
  }
830
835
  );
831
- }
832
- function DropdownRoot(props) {
833
- return /* @__PURE__ */ jsx4(DropdownInternal, { ...props });
834
- }
835
- function DropdownButton({
836
+ });
837
+ var DropdownRoot = forwardRef2(function Dropdown(props, forwardedRef) {
838
+ return /* @__PURE__ */ jsx4(DropdownInternal, { ref: forwardedRef, ...props });
839
+ });
840
+ var DropdownButton = forwardRef2(function DropdownButton2({
836
841
  children,
837
842
  className = "",
838
843
  buttonProps,
@@ -842,9 +847,14 @@ function DropdownButton({
842
847
  dropdownDisabled,
843
848
  trigger = ["click"],
844
849
  ...dropdownProps
845
- }) {
850
+ }, forwardedRef) {
846
851
  const groupRef = useRef4(null);
847
- return /* @__PURE__ */ jsxs2("span", { ref: groupRef, className: `sia-dropdown-button ${className}`.trim(), children: [
852
+ function setGroupRef(node) {
853
+ groupRef.current = node;
854
+ if (typeof forwardedRef === "function") forwardedRef(node);
855
+ else if (forwardedRef) forwardedRef.current = node;
856
+ }
857
+ return /* @__PURE__ */ jsxs2("span", { ref: setGroupRef, className: `sia-dropdown-button ${className}`.trim(), children: [
848
858
  /* @__PURE__ */ jsx4(Button, { ...buttonProps, disabled: disabled || buttonDisabled, onClick, children }),
849
859
  /* @__PURE__ */ jsx4(DropdownInternal, { ...dropdownProps, popupAnchorRef: groupRef, disabled: disabled || dropdownDisabled, trigger, showTriggerIcon: false, children: /* @__PURE__ */ jsx4(
850
860
  Button,
@@ -857,16 +867,16 @@ function DropdownButton({
857
867
  }
858
868
  ) })
859
869
  ] });
860
- }
861
- var Dropdown = Object.assign(DropdownRoot, {
870
+ });
871
+ var Dropdown2 = Object.assign(DropdownRoot, {
862
872
  /** 组合主操作按钮与下拉菜单的按钮组件。 */
863
873
  Button: DropdownButton
864
874
  });
865
875
 
866
876
  // src/components/Input.tsx
867
- import { forwardRef as forwardRef2, useId as useId2, useRef as useRef5, useState as useState3 } from "react";
877
+ import { forwardRef as forwardRef3, useId as useId2, useRef as useRef5, useState as useState3 } from "react";
868
878
  import { Fragment as Fragment3, jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
869
- var Input = forwardRef2(function Input2({
879
+ var Input = forwardRef3(function Input2({
870
880
  label,
871
881
  hint,
872
882
  status = "default",
@@ -1032,6 +1042,6 @@ export {
1032
1042
  Menu,
1033
1043
  Steps,
1034
1044
  Segmented,
1035
- Dropdown,
1045
+ Dropdown2 as Dropdown,
1036
1046
  Input
1037
1047
  };
@@ -134,7 +134,7 @@ interface CardProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
134
134
  bodyStyle?: CSSProperties;
135
135
  }
136
136
  /** 卡片组件。 */
137
- declare function Card({ bordered, title, description, extra, selectable, interactionCursor, selected, showSelectedIndicator, defaultSelected, disabled, onSelectedChange, onAction, hoverActions, accent, accentColor, collapsible, collapsed, defaultCollapsed, onCollapsedChange, bodyHeight, fill, bodyClassName, bodyStyle, className, style, children, onClick, onKeyDown, ...props }: CardProps): react.JSX.Element;
137
+ declare const Card: react.ForwardRefExoticComponent<CardProps & react.RefAttributes<HTMLElement>>;
138
138
 
139
139
  declare const iconPaths: {
140
140
  package: react.JSX.Element;
@@ -859,7 +859,7 @@ interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
859
859
  onTabContextMenuClick?: (info: TabsContextMenuClickInfo) => void;
860
860
  }
861
861
  /** 选项卡组件;默认仅挂载首次激活的面板,切走后隐藏并保留,显式设置 destroyInactiveTabPane=true 可在切走后卸载。横向空间不足时,剩余标签收起到末尾的更多菜单,支持悬停或点击展开。设置确定高度或由父级弹性布局分配高度时,内容面板占满导航之外的剩余空间;未限定高度时按内容自然撑开。 */
862
- declare function Tabs({ items, activeKey, defaultActiveKey, onChange, onAfterChange, deferContent, type, indicatorMotion, indicatorPosition, size, tabPosition, orientation, centered, tabBarTitle, tabBarExtraContent, contentGap, destroyInactiveTabPane, closable, onEdit, tabContextMenu, onTabContextMenuClick, className, ...props }: TabsProps): react.JSX.Element;
862
+ declare const Tabs: react.ForwardRefExoticComponent<TabsProps & react.RefAttributes<HTMLDivElement>>;
863
863
 
864
864
  /** 打开下拉菜单的触发方式。 */
865
865
  type DropdownTrigger = "click" | "hover" | "contextMenu";
@@ -944,8 +944,6 @@ interface DropdownProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children"
944
944
  source: DropdownOpenSource;
945
945
  }) => void;
946
946
  }
947
- /** 普通下拉菜单使用自身触发器定位,不对外暴露组合按钮的内部锚点。 */
948
- declare function DropdownRoot(props: DropdownProps): react.JSX.Element;
949
947
  /** 组合下拉按钮的属性配置;菜单相对于整组按钮定位,主操作和箭头触发保持独立。 */
950
948
  interface DropdownButtonProps extends Omit<DropdownProps, "children" | "className"> {
951
949
  /**
@@ -969,11 +967,10 @@ interface DropdownButtonProps extends Omit<DropdownProps, "children" | "classNam
969
967
  /** 点击时触发,参数为当前点击事件或项目上下文。 */
970
968
  onClick?: ButtonProps["onClick"];
971
969
  }
972
- declare function DropdownButton({ children, className, buttonProps, onClick, disabled, buttonDisabled, dropdownDisabled, trigger, ...dropdownProps }: DropdownButtonProps): react.JSX.Element;
973
970
  /** 下拉菜单组件;面板以 260ms 缩放淡入并轻微回弹,关闭为 140ms 无回弹缩小淡出;退出完成后释放定位锚点,系统减少动态效果时直接完成。 */
974
- declare const Dropdown: typeof DropdownRoot & {
971
+ declare const Dropdown: react.ForwardRefExoticComponent<DropdownProps & react.RefAttributes<HTMLSpanElement>> & {
975
972
  /** 组合主操作按钮与下拉菜单的按钮组件。 */
976
- Button: typeof DropdownButton;
973
+ Button: react.ForwardRefExoticComponent<DropdownButtonProps & react.RefAttributes<HTMLSpanElement>>;
977
974
  };
978
975
 
979
976
  /** 气泡十二个方向;start/end 为对应边的起点/终点对齐,同时支持 topLeft、leftTop 等驼峰别名。 */
@@ -2285,7 +2282,7 @@ interface BreadcrumbProps extends HTMLAttributes<HTMLElement> {
2285
2282
  itemRender?: (item: BreadcrumbItem, index: number, items: readonly BreadcrumbItem[]) => ReactNode;
2286
2283
  }
2287
2284
  /** 面包屑组件。 */
2288
- declare function Breadcrumb({ items, separator, itemRender, className, ...props }: BreadcrumbProps): react.JSX.Element;
2285
+ declare const Breadcrumb: react.ForwardRefExoticComponent<BreadcrumbProps & react.RefAttributes<HTMLElement>>;
2289
2286
 
2290
2287
  /** 排版的类型标识。 */
2291
2288
  type TypographyType = "secondary" | "success" | "warning" | "danger";
@@ -2466,7 +2463,7 @@ interface ResultProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
2466
2463
  children?: ReactNode;
2467
2464
  }
2468
2465
  /** 用于导入、提交等操作完成后的结果展示,支持自定义图标、详情和操作。 */
2469
- declare function Result({ status, title, subTitle, icon, extra, children, className, ...props }: ResultProps): react.JSX.Element;
2466
+ declare const Result: react.ForwardRefExoticComponent<ResultProps & react.RefAttributes<HTMLDivElement>>;
2470
2467
 
2471
2468
  /** 浮动滚动条接入组件的属性配置。 */
2472
2469
  interface FloatingScrollbarProviderProps {
@@ -134,7 +134,7 @@ interface CardProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
134
134
  bodyStyle?: CSSProperties;
135
135
  }
136
136
  /** 卡片组件。 */
137
- declare function Card({ bordered, title, description, extra, selectable, interactionCursor, selected, showSelectedIndicator, defaultSelected, disabled, onSelectedChange, onAction, hoverActions, accent, accentColor, collapsible, collapsed, defaultCollapsed, onCollapsedChange, bodyHeight, fill, bodyClassName, bodyStyle, className, style, children, onClick, onKeyDown, ...props }: CardProps): react.JSX.Element;
137
+ declare const Card: react.ForwardRefExoticComponent<CardProps & react.RefAttributes<HTMLElement>>;
138
138
 
139
139
  declare const iconPaths: {
140
140
  package: react.JSX.Element;
@@ -859,7 +859,7 @@ interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
859
859
  onTabContextMenuClick?: (info: TabsContextMenuClickInfo) => void;
860
860
  }
861
861
  /** 选项卡组件;默认仅挂载首次激活的面板,切走后隐藏并保留,显式设置 destroyInactiveTabPane=true 可在切走后卸载。横向空间不足时,剩余标签收起到末尾的更多菜单,支持悬停或点击展开。设置确定高度或由父级弹性布局分配高度时,内容面板占满导航之外的剩余空间;未限定高度时按内容自然撑开。 */
862
- declare function Tabs({ items, activeKey, defaultActiveKey, onChange, onAfterChange, deferContent, type, indicatorMotion, indicatorPosition, size, tabPosition, orientation, centered, tabBarTitle, tabBarExtraContent, contentGap, destroyInactiveTabPane, closable, onEdit, tabContextMenu, onTabContextMenuClick, className, ...props }: TabsProps): react.JSX.Element;
862
+ declare const Tabs: react.ForwardRefExoticComponent<TabsProps & react.RefAttributes<HTMLDivElement>>;
863
863
 
864
864
  /** 打开下拉菜单的触发方式。 */
865
865
  type DropdownTrigger = "click" | "hover" | "contextMenu";
@@ -944,8 +944,6 @@ interface DropdownProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children"
944
944
  source: DropdownOpenSource;
945
945
  }) => void;
946
946
  }
947
- /** 普通下拉菜单使用自身触发器定位,不对外暴露组合按钮的内部锚点。 */
948
- declare function DropdownRoot(props: DropdownProps): react.JSX.Element;
949
947
  /** 组合下拉按钮的属性配置;菜单相对于整组按钮定位,主操作和箭头触发保持独立。 */
950
948
  interface DropdownButtonProps extends Omit<DropdownProps, "children" | "className"> {
951
949
  /**
@@ -969,11 +967,10 @@ interface DropdownButtonProps extends Omit<DropdownProps, "children" | "classNam
969
967
  /** 点击时触发,参数为当前点击事件或项目上下文。 */
970
968
  onClick?: ButtonProps["onClick"];
971
969
  }
972
- declare function DropdownButton({ children, className, buttonProps, onClick, disabled, buttonDisabled, dropdownDisabled, trigger, ...dropdownProps }: DropdownButtonProps): react.JSX.Element;
973
970
  /** 下拉菜单组件;面板以 260ms 缩放淡入并轻微回弹,关闭为 140ms 无回弹缩小淡出;退出完成后释放定位锚点,系统减少动态效果时直接完成。 */
974
- declare const Dropdown: typeof DropdownRoot & {
971
+ declare const Dropdown: react.ForwardRefExoticComponent<DropdownProps & react.RefAttributes<HTMLSpanElement>> & {
975
972
  /** 组合主操作按钮与下拉菜单的按钮组件。 */
976
- Button: typeof DropdownButton;
973
+ Button: react.ForwardRefExoticComponent<DropdownButtonProps & react.RefAttributes<HTMLSpanElement>>;
977
974
  };
978
975
 
979
976
  /** 气泡十二个方向;start/end 为对应边的起点/终点对齐,同时支持 topLeft、leftTop 等驼峰别名。 */
@@ -2285,7 +2282,7 @@ interface BreadcrumbProps extends HTMLAttributes<HTMLElement> {
2285
2282
  itemRender?: (item: BreadcrumbItem, index: number, items: readonly BreadcrumbItem[]) => ReactNode;
2286
2283
  }
2287
2284
  /** 面包屑组件。 */
2288
- declare function Breadcrumb({ items, separator, itemRender, className, ...props }: BreadcrumbProps): react.JSX.Element;
2285
+ declare const Breadcrumb: react.ForwardRefExoticComponent<BreadcrumbProps & react.RefAttributes<HTMLElement>>;
2289
2286
 
2290
2287
  /** 排版的类型标识。 */
2291
2288
  type TypographyType = "secondary" | "success" | "warning" | "danger";
@@ -2466,7 +2463,7 @@ interface ResultProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
2466
2463
  children?: ReactNode;
2467
2464
  }
2468
2465
  /** 用于导入、提交等操作完成后的结果展示,支持自定义图标、详情和操作。 */
2469
- declare function Result({ status, title, subTitle, icon, extra, children, className, ...props }: ResultProps): react.JSX.Element;
2466
+ declare const Result: react.ForwardRefExoticComponent<ResultProps & react.RefAttributes<HTMLDivElement>>;
2470
2467
 
2471
2468
  /** 浮动滚动条接入组件的属性配置。 */
2472
2469
  interface FloatingScrollbarProviderProps {
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,7 +3323,7 @@ function Card({
3312
3323
  ]
3313
3324
  }
3314
3325
  );
3315
- }
3326
+ });
3316
3327
 
3317
3328
  // src/components/Tag.tsx
3318
3329
  var import_react16 = require("react");
@@ -3377,7 +3388,7 @@ function Tag({
3377
3388
  var import_react17 = require("react");
3378
3389
  var import_jsx_runtime15 = require("react/jsx-runtime");
3379
3390
  var import_react18 = require("react");
3380
- function Tabs({
3391
+ var Tabs = (0, import_react17.forwardRef)(function Tabs2({
3381
3392
  items,
3382
3393
  activeKey,
3383
3394
  defaultActiveKey,
@@ -3401,7 +3412,7 @@ function Tabs({
3401
3412
  onTabContextMenuClick,
3402
3413
  className = "",
3403
3414
  ...props
3404
- }) {
3415
+ }, forwardedRef) {
3405
3416
  const firstEnabledKey = items.find((item) => !item.disabled)?.key ?? "";
3406
3417
  const [internalActiveKey, setInternalActiveKey] = (0, import_react17.useState)(defaultActiveKey ?? firstEnabledKey);
3407
3418
  const currentKey = activeKey ?? internalActiveKey;
@@ -3580,6 +3591,7 @@ function Tabs({
3580
3591
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
3581
3592
  "div",
3582
3593
  {
3594
+ ref: forwardedRef,
3583
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(),
3584
3596
  ...withTitleTooltip(props),
3585
3597
  children: [
@@ -3627,7 +3639,7 @@ function Tabs({
3627
3639
  ) : null);
3628
3640
  if (!contextMenuItems?.length) return tabNode;
3629
3641
  return /* @__PURE__ */ (0, import_react18.createElement)(
3630
- Dropdown,
3642
+ Dropdown2,
3631
3643
  {
3632
3644
  ...entryProps,
3633
3645
  key: item.key,
@@ -3645,7 +3657,7 @@ function Tabs({
3645
3657
  );
3646
3658
  }),
3647
3659
  resolvedOrientation === "horizontal" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
3648
- Dropdown,
3660
+ Dropdown2,
3649
3661
  {
3650
3662
  className: "sia-tabs__more",
3651
3663
  "data-tab-hidden": !hiddenItems.length,
@@ -3686,7 +3698,7 @@ function Tabs({
3686
3698
  ]
3687
3699
  }
3688
3700
  );
3689
- }
3701
+ });
3690
3702
 
3691
3703
  // src/components/Feedback.tsx
3692
3704
  var import_react23 = require("react");
@@ -3891,19 +3903,27 @@ function useOverlayLifecycle(open, panelRef, onRequestClose, keyboard = true, au
3891
3903
  closeRef.current();
3892
3904
  return;
3893
3905
  }
3894
- if (event.key !== "Tab" || !panelRef.current) return;
3895
- const focusable = focusableElements(panelRef.current);
3906
+ const panel = panelRef.current;
3907
+ if (event.key !== "Tab" || !panel) return;
3908
+ const focusable = focusableElements(panel);
3896
3909
  if (focusable.length === 0) {
3897
3910
  event.preventDefault();
3898
- panelRef.current.focus();
3911
+ panel.focus();
3899
3912
  return;
3900
3913
  }
3901
3914
  const first = focusable[0];
3902
3915
  const last = focusable.at(-1);
3903
- 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) {
3904
3924
  event.preventDefault();
3905
3925
  last.focus();
3906
- } else if (!event.shiftKey && document.activeElement === last) {
3926
+ } else if (!event.shiftKey && active === last) {
3907
3927
  event.preventDefault();
3908
3928
  first.focus();
3909
3929
  }
@@ -3918,7 +3938,7 @@ function useOverlayLifecycle(open, panelRef, onRequestClose, keyboard = true, au
3918
3938
  unlockBody();
3919
3939
  previouslyFocused?.focus({ preventScroll: true });
3920
3940
  };
3921
- }, [keyboard, open, panelRef, autoFocusInput]);
3941
+ }, [keyboard, open, panelRef]);
3922
3942
  (0, import_react21.useEffect)(() => {
3923
3943
  if (!open) return;
3924
3944
  const timer = window.setTimeout(() => {
@@ -6482,9 +6502,10 @@ var Upload = Object.assign(UploadRoot, {
6482
6502
  });
6483
6503
 
6484
6504
  // src/components/Breadcrumb.tsx
6505
+ var import_react34 = require("react");
6485
6506
  var import_jsx_runtime30 = require("react/jsx-runtime");
6486
- function Breadcrumb({ items, separator = "/", itemRender, className = "", ...props }) {
6487
- 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) => {
6488
6509
  const current = index === items.length - 1;
6489
6510
  const content = /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
6490
6511
  item.icon ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "sia-breadcrumb__icon", "aria-hidden": "true", children: item.icon }) : null,
@@ -6495,15 +6516,15 @@ function Breadcrumb({ items, separator = "/", itemRender, className = "", ...pro
6495
6516
  return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("li", { className: `sia-breadcrumb__item${current ? " is-current" : ""}${item.disabled ? " is-disabled" : ""}`, children: [
6496
6517
  /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { className: "sia-breadcrumb__entry", "aria-current": current ? "page" : void 0, children: [
6497
6518
  label,
6498
- 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
6499
6520
  ] }),
6500
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
6501
6522
  ] }, item.key ?? index);
6502
6523
  }) }) });
6503
- }
6524
+ });
6504
6525
 
6505
6526
  // src/components/Typography.tsx
6506
- var import_react34 = require("react");
6527
+ var import_react35 = require("react");
6507
6528
  var import_jsx_runtime31 = require("react/jsx-runtime");
6508
6529
  function TypographyContent({
6509
6530
  as: Tag2 = "span",
@@ -6523,26 +6544,26 @@ function TypographyContent({
6523
6544
  className = "",
6524
6545
  ...props
6525
6546
  }) {
6526
- const contentRef = (0, import_react34.useRef)(null);
6527
- const editRef = (0, import_react34.useRef)(null);
6528
- const timer = (0, import_react34.useRef)();
6529
- const [localText, setLocalText] = (0, import_react34.useState)();
6530
- const [draft, setDraft] = (0, import_react34.useState)("");
6531
- const [editing, setEditing] = (0, import_react34.useState)(false);
6532
- const [copied, setCopied] = (0, import_react34.useState)(false);
6533
- const [copyError, setCopyError] = (0, import_react34.useState)(false);
6534
- const [expanded, setExpanded] = (0, import_react34.useState)(false);
6535
- const [overflow, setOverflow] = (0, import_react34.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);
6536
6557
  const editConfig = typeof editable === "object" ? editable : void 0;
6537
6558
  const content = editConfig?.text ?? localText ?? children;
6538
6559
  const requestedRows = typeof ellipsis === "object" ? ellipsis.rows ?? 1 : 1;
6539
6560
  const rows = Number.isFinite(requestedRows) ? Math.max(1, Math.floor(requestedRows)) : 1;
6540
6561
  const expandable = typeof ellipsis === "object" && ellipsis.expandable;
6541
- (0, import_react34.useEffect)(() => {
6562
+ (0, import_react35.useEffect)(() => {
6542
6563
  setLocalText(void 0);
6543
6564
  }, [children]);
6544
- (0, import_react34.useEffect)(() => () => clearTimeout(timer.current), []);
6545
- (0, import_react34.useLayoutEffect)(() => {
6565
+ (0, import_react35.useEffect)(() => () => clearTimeout(timer.current), []);
6566
+ (0, import_react35.useLayoutEffect)(() => {
6546
6567
  const element = contentRef.current;
6547
6568
  if (!element || !ellipsis || !expandable || editing || expanded) return;
6548
6569
  const measure = () => setOverflow(element.scrollHeight > element.clientHeight + 1 || element.scrollWidth > element.clientWidth + 1);
@@ -6660,10 +6681,10 @@ var Typography = Object.assign(TypographyRoot, {
6660
6681
  });
6661
6682
 
6662
6683
  // src/components/FloatButton.tsx
6663
- var import_react35 = require("react");
6684
+ var import_react36 = require("react");
6664
6685
  var import_jsx_runtime32 = require("react/jsx-runtime");
6665
- var GroupShape = (0, import_react35.createContext)(void 0);
6666
- var FloatButtonRoot = (0, import_react35.forwardRef)(function FloatButton({
6686
+ var GroupShape = (0, import_react36.createContext)(void 0);
6687
+ var FloatButtonRoot = (0, import_react36.forwardRef)(function FloatButton({
6667
6688
  icon,
6668
6689
  description,
6669
6690
  tooltip,
@@ -6676,7 +6697,7 @@ var FloatButtonRoot = (0, import_react35.forwardRef)(function FloatButton({
6676
6697
  children,
6677
6698
  ...props
6678
6699
  }, ref) {
6679
- const groupShape = (0, import_react35.useContext)(GroupShape);
6700
+ const groupShape = (0, import_react36.useContext)(GroupShape);
6680
6701
  const label = props["aria-label"] ?? (typeof tooltip === "string" ? tooltip : typeof description === "string" ? description : "\u60AC\u6D6E\u64CD\u4F5C");
6681
6702
  const button = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
6682
6703
  "button",
@@ -6714,12 +6735,12 @@ function FloatButtonGroup({
6714
6735
  ...props
6715
6736
  }) {
6716
6737
  const [visible, setVisible] = useControllableState({ value: open, defaultValue: defaultOpen, onChange: onOpenChange });
6717
- const rootRef = (0, import_react35.useRef)(null);
6718
- const triggerRef = (0, import_react35.useRef)(null);
6719
- const listRef = (0, import_react35.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);
6720
6741
  const motion = useOverlayMotion(!trigger || visible, listRef, "popup", placement, true, void 0, !!trigger);
6721
- const id = (0, import_react35.useId)();
6722
- (0, import_react35.useEffect)(() => {
6742
+ const id = (0, import_react36.useId)();
6743
+ (0, import_react36.useEffect)(() => {
6723
6744
  if (!trigger || !visible) return;
6724
6745
  const close = (event) => {
6725
6746
  if (!rootRef.current?.contains(event.target)) setVisible(false);
@@ -6773,10 +6794,10 @@ function FloatButtonGroup({
6773
6794
  ) });
6774
6795
  }
6775
6796
  function FloatButtonBackTop({ target, visibilityHeight = 400, behavior = "smooth", onClick, icon, tooltip = "\u8FD4\u56DE\u9876\u90E8", ...props }) {
6776
- const [visible, setVisible] = (0, import_react35.useState)(false);
6777
- const buttonRef = (0, import_react35.useRef)(null);
6797
+ const [visible, setVisible] = (0, import_react36.useState)(false);
6798
+ const buttonRef = (0, import_react36.useRef)(null);
6778
6799
  const motion = useOverlayMotion(visible, buttonRef, "fade");
6779
- (0, import_react35.useEffect)(() => {
6800
+ (0, import_react36.useEffect)(() => {
6780
6801
  const element = target ? target() : window;
6781
6802
  if (!element) return;
6782
6803
  const update = () => setVisible((element === window ? window.scrollY : element.scrollTop) >= visibilityHeight);
@@ -6800,6 +6821,7 @@ var FloatButton2 = Object.assign(FloatButtonRoot, {
6800
6821
  });
6801
6822
 
6802
6823
  // src/components/Result.tsx
6824
+ var import_react37 = require("react");
6803
6825
  var import_jsx_runtime33 = require("react/jsx-runtime");
6804
6826
  var icons = {
6805
6827
  success: "circle-check",
@@ -6807,17 +6829,17 @@ var icons = {
6807
6829
  info: "info",
6808
6830
  warning: "warning"
6809
6831
  };
6810
- 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) {
6811
6833
  const resultIcon = icon === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Icon, { name: icons[status], size: 72, variant: "filled" }) : icon;
6812
6834
  const present = (value) => value !== void 0 && value !== null && value !== false;
6813
- 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: [
6814
6836
  present(resultIcon) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "sia-result__icon", "aria-hidden": "true", children: resultIcon }),
6815
6837
  present(title) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "sia-result__title", children: title }),
6816
6838
  present(subTitle) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "sia-result__subtitle", children: subTitle }),
6817
6839
  present(children) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "sia-result__content", children }),
6818
6840
  present(extra) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "sia-result__extra", children: extra })
6819
6841
  ] });
6820
- }
6842
+ });
6821
6843
 
6822
6844
  // src/core.ts
6823
6845
  initializeDefaultScrollbars();