@sia.soul/sia-react-ui 0.1.159 → 0.1.162
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Select-DIdEbGwf.d.cts → Select-Dxevc0f6.d.cts} +1 -1
- package/dist/{Select-BCVUoK0I.d.ts → Select-tsENCXQI.d.ts} +1 -1
- package/dist/chart.cjs +9 -9
- package/dist/chart.js +5 -5
- package/dist/{chunk-6PIZGTNT.js → chunk-33WX54AU.js} +5 -5
- package/dist/{chunk-PU2V3VB5.js → chunk-4B7ATL6J.js} +1 -1
- package/dist/{chunk-XXFYFLZA.js → chunk-5WZR2RHA.js} +2 -2
- package/dist/{chunk-YO5OJQEH.js → chunk-CRA7VNOA.js} +1 -1
- package/dist/{chunk-ZIH5VLPT.js → chunk-KA3M4TE4.js} +2 -2
- package/dist/{chunk-6SSZVJO4.js → chunk-M4IASLGB.js} +3 -3
- package/dist/{chunk-UGCKRFZN.js → chunk-MXK6TKMO.js} +5 -5
- package/dist/{chunk-CDMCXNRK.js → chunk-Q3LEK2TL.js} +599 -270
- package/dist/{chunk-NRLIOMXY.js → chunk-UL54A2YN.js} +2 -2
- package/dist/{chunk-4CFFAKIJ.js → chunk-UPXL2QLJ.js} +6 -6
- package/dist/{chunk-SRWUDTCS.js → chunk-WMZYYPIW.js} +9 -9
- package/dist/{chunk-PJCO6PPW.js → chunk-ZNPNZD6O.js} +30 -15
- package/dist/{core-sU1bV7QH.d.ts → core-XtqUDbbD.d.ts} +5 -5
- package/dist/{core-B26pkBp_.d.cts → core-r-smfiNN.d.cts} +5 -5
- package/dist/core.cjs +27 -13
- package/dist/core.css +170 -22
- package/dist/core.d.cts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/core.js +8 -8
- package/dist/game.cjs +9 -9
- package/dist/game.js +3 -3
- package/dist/index.cjs +664 -320
- package/dist/index.css +170 -22
- package/dist/index.d.cts +13 -8
- package/dist/index.d.ts +13 -8
- package/dist/index.js +60 -59
- package/dist/markdown-editor.cjs +9 -9
- package/dist/markdown-editor.js +3 -3
- package/dist/rich-text-editor.cjs +40 -13
- package/dist/rich-text-editor.js +7 -7
- package/dist/{select-date-range-DYrA87Tl.d.ts → select-date-range-CIXBuoef.d.ts} +8 -9
- package/dist/{select-date-range-CIwE5nFu.d.cts → select-date-range-Cbh37zmU.d.cts} +8 -9
- package/dist/select-date-range.cjs +598 -269
- package/dist/select-date-range.d.cts +2 -2
- package/dist/select-date-range.d.ts +2 -2
- package/dist/select-date-range.js +8 -8
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useFloatingPlaceholder
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CRA7VNOA.js";
|
|
4
4
|
import {
|
|
5
5
|
useControlSize,
|
|
6
6
|
withTitleTooltip
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WMZYYPIW.js";
|
|
8
8
|
|
|
9
9
|
// src/components/TextArea.tsx
|
|
10
10
|
import { forwardRef, useId, useState } from "react";
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Popover,
|
|
3
3
|
Tooltip
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MXK6TKMO.js";
|
|
5
5
|
import {
|
|
6
6
|
Dropdown
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ZNPNZD6O.js";
|
|
8
8
|
import {
|
|
9
9
|
TextArea
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-UL54A2YN.js";
|
|
11
11
|
import {
|
|
12
12
|
Icon,
|
|
13
13
|
useOverlayLifecycle
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-KA3M4TE4.js";
|
|
15
15
|
import {
|
|
16
16
|
Button
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-4B7ATL6J.js";
|
|
18
18
|
import {
|
|
19
19
|
useControlSize,
|
|
20
20
|
useControllableState,
|
|
21
21
|
useOverlayMotion,
|
|
22
22
|
withTitleTooltip
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-WMZYYPIW.js";
|
|
24
24
|
|
|
25
25
|
// src/components/Toolbar.tsx
|
|
26
26
|
import { useLayoutEffect, useRef, useState } from "react";
|
|
@@ -510,8 +510,8 @@ import { useEffect as useEffect3, useLayoutEffect, useRef, useState } from "reac
|
|
|
510
510
|
// src/components/popupFluidMotion.ts
|
|
511
511
|
var popupEnterDuration = 260;
|
|
512
512
|
var popupExitDuration = 140;
|
|
513
|
-
var popupInitialScale = 0.
|
|
514
|
-
var popupTravelOffset =
|
|
513
|
+
var popupInitialScale = 0.93;
|
|
514
|
+
var popupTravelOffset = 4;
|
|
515
515
|
function popupFluidFrames(placement, open = true) {
|
|
516
516
|
const side = placement.split("-")[0];
|
|
517
517
|
const axis = side === "left" || side === "right" ? "X" : "Y";
|
|
@@ -520,8 +520,8 @@ function popupFluidFrames(placement, open = true) {
|
|
|
520
520
|
const visible = { opacity: 1, transform: "none" };
|
|
521
521
|
return open ? [
|
|
522
522
|
{ ...hidden, offset: 0 },
|
|
523
|
-
{ opacity: 1, transform: "scale(1.
|
|
524
|
-
{ opacity: 1, transform: "scale(.
|
|
523
|
+
{ opacity: 1, transform: "scale(1.05, 1.04)", offset: 0.68 },
|
|
524
|
+
{ opacity: 1, transform: "scale(.977, .985)", offset: 0.86 },
|
|
525
525
|
{ ...visible, offset: 1 }
|
|
526
526
|
] : [{ ...visible, offset: 0 }, { ...hidden, offset: 1 }];
|
|
527
527
|
}
|
|
@@ -541,16 +541,16 @@ function motionFrames(kind, placement) {
|
|
|
541
541
|
const outside = `translate${axis}(${sign * 100}%)`;
|
|
542
542
|
return [
|
|
543
543
|
{ transform: outside, offset: 0 },
|
|
544
|
-
{ transform: `translate${axis}(0) scale${axis}(1.
|
|
545
|
-
{ transform: `translate${axis}(0) scale${axis}(.
|
|
544
|
+
{ transform: `translate${axis}(0) scale${axis}(1.03)`, offset: 0.68 },
|
|
545
|
+
{ transform: `translate${axis}(0) scale${axis}(.988)`, offset: 0.86 },
|
|
546
546
|
{ transform: "none", offset: 1 }
|
|
547
547
|
];
|
|
548
548
|
}
|
|
549
549
|
const modal = kind === "modal";
|
|
550
550
|
return [
|
|
551
|
-
{ opacity: 0, transform: `translateY(${modal ?
|
|
552
|
-
{ opacity: 1, transform: modal ? "scale(1.
|
|
553
|
-
{ opacity: 1, transform: modal ? "scale(.
|
|
551
|
+
{ opacity: 0, transform: `translateY(${modal ? 14 : -4}px) scale(${modal ? 0.95 : 0.93})`, offset: 0 },
|
|
552
|
+
{ opacity: 1, transform: modal ? "scale(1.035, 1.02)" : "scale(1.05, 1.04)", offset: 0.68 },
|
|
553
|
+
{ opacity: 1, transform: modal ? "scale(.984, .992)" : "scale(.977, .985)", offset: 0.86 },
|
|
554
554
|
{ opacity: 1, transform: "none", offset: 1 }
|
|
555
555
|
];
|
|
556
556
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TextArea
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UL54A2YN.js";
|
|
4
4
|
import {
|
|
5
5
|
Icon,
|
|
6
6
|
Modal
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-KA3M4TE4.js";
|
|
8
8
|
import {
|
|
9
9
|
Button
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-4B7ATL6J.js";
|
|
11
11
|
import {
|
|
12
|
+
FloatingScrollbarProvider,
|
|
12
13
|
PopupPortal,
|
|
13
14
|
hasFloatingScrollbarInteraction,
|
|
14
15
|
resolveFloatingScrollbarTarget,
|
|
@@ -16,10 +17,10 @@ import {
|
|
|
16
17
|
useControllableState,
|
|
17
18
|
usePlaceholderMode,
|
|
18
19
|
withTitleTooltip
|
|
19
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-WMZYYPIW.js";
|
|
20
21
|
|
|
21
22
|
// src/components/Navigation.tsx
|
|
22
|
-
import { useEffect, useId, useLayoutEffect as useLayoutEffect3, useMemo, useRef as useRef3, useState } from "react";
|
|
23
|
+
import { useEffect, useId, useLayoutEffect as useLayoutEffect3, useMemo, useRef as useRef3, useState, forwardRef } from "react";
|
|
23
24
|
|
|
24
25
|
// src/components/MenuSelectionMotion.tsx
|
|
25
26
|
import { useLayoutEffect, useRef } from "react";
|
|
@@ -385,7 +386,7 @@ function MenuLevel({
|
|
|
385
386
|
return /* @__PURE__ */ jsx3(MenuEntry, { item, level, parents, props, reserveIcon }, item.key);
|
|
386
387
|
}) });
|
|
387
388
|
}
|
|
388
|
-
function
|
|
389
|
+
function MenuInner({
|
|
389
390
|
items,
|
|
390
391
|
mode = "vertical",
|
|
391
392
|
gridColumns = 2,
|
|
@@ -408,9 +409,14 @@ function Menu({
|
|
|
408
409
|
className = "",
|
|
409
410
|
style,
|
|
410
411
|
...rest
|
|
411
|
-
}) {
|
|
412
|
+
}, ref) {
|
|
412
413
|
const menuId = useId();
|
|
413
414
|
const rootRef = useRef3(null);
|
|
415
|
+
const setRootRef = (node) => {
|
|
416
|
+
rootRef.current = node;
|
|
417
|
+
if (typeof ref === "function") ref(node);
|
|
418
|
+
else if (ref) ref.current = node;
|
|
419
|
+
};
|
|
414
420
|
const [selected, setSelected] = useControllableState({ value: selectedKeys, defaultValue: defaultSelectedKeys });
|
|
415
421
|
const [open, setOpen] = useControllableState({ value: openKeys, defaultValue: defaultOpenKeys, onChange: (next) => onOpenChange?.([...next]) });
|
|
416
422
|
const pendingOpenRef = useRef3(open);
|
|
@@ -529,11 +535,12 @@ function Menu({
|
|
|
529
535
|
}
|
|
530
536
|
}
|
|
531
537
|
const gridStyle = mode === "grid" ? { "--sia-menu-grid-columns": gridColumns === "auto" ? "repeat(auto-fill, minmax(88px, 1fr))" : `repeat(${Number.isFinite(gridColumns) ? Math.max(1, Math.floor(Number(gridColumns))) : 2}, minmax(0, 1fr))` } : {};
|
|
532
|
-
return /* @__PURE__ */ jsxs("ul", { ref:
|
|
538
|
+
return /* @__PURE__ */ jsxs("ul", { ref: setRootRef, className: `sia-menu sia-menu-motion-surface sia-menu--${mode} sia-menu--${theme}${inlineCollapsed ? " sia-menu--collapsed" : ""} ${className}`.trim(), role: "menu", ...withTitleTooltip(rest), onKeyDown: handleMenuKeyDown, style: { ...gridStyle, ...style }, "data-sia-menu-owner": menuId, children: [
|
|
533
539
|
/* @__PURE__ */ jsx3(MenuLevel, { items, level: 0, parents: [], props: { interactionCursor, menuId, mode, theme, multiple, selectable, inlineCollapsed, inlineIndent, triggerSubMenuAction, selected, open, select, toggle } }),
|
|
534
540
|
/* @__PURE__ */ jsx3(MenuSelectionMotion, { rootRef, enabled: !multiple })
|
|
535
541
|
] });
|
|
536
542
|
}
|
|
543
|
+
var Menu = forwardRef(MenuInner);
|
|
537
544
|
function Steps({ items, current = 0, initial = 0, direction = "horizontal", labelPlacement = "vertical", type = "default", size = "default", status = "process", progressDot = false, onChange, className = "", ...props }) {
|
|
538
545
|
return /* @__PURE__ */ jsx3("div", { className: `sia-steps sia-steps--${direction} sia-steps--${type} sia-steps--${size} sia-steps--label-${labelPlacement} ${className}`.trim(), ...withTitleTooltip(props), children: items.map((item, rawIndex) => {
|
|
539
546
|
const index = rawIndex + initial;
|
|
@@ -580,7 +587,7 @@ function Segmented({ options, value, defaultValue, variant = "default", shape =
|
|
|
580
587
|
|
|
581
588
|
// src/components/Dropdown.tsx
|
|
582
589
|
import { cloneElement, isValidElement, useEffect as useEffect2, useLayoutEffect as useLayoutEffect4, useRef as useRef4, useState as useState2 } from "react";
|
|
583
|
-
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
590
|
+
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
584
591
|
var placementMap = {
|
|
585
592
|
bottomLeft: "bottom-start",
|
|
586
593
|
bottomRight: "bottom-end",
|
|
@@ -616,6 +623,7 @@ function DropdownInternal({
|
|
|
616
623
|
const rootRef = useRef4(null);
|
|
617
624
|
const contextAnchorRef = useRef4(null);
|
|
618
625
|
const popupRef = useRef4(null);
|
|
626
|
+
const menuListRef = useRef4(null);
|
|
619
627
|
const openTimerRef = useRef4(void 0);
|
|
620
628
|
const closeTimerRef = useRef4(void 0);
|
|
621
629
|
const [internalOpen, setInternalOpen] = useState2(defaultOpen);
|
|
@@ -742,6 +750,7 @@ function DropdownInternal({
|
|
|
742
750
|
const menuNode = /* @__PURE__ */ jsx4(
|
|
743
751
|
Menu,
|
|
744
752
|
{
|
|
753
|
+
ref: menuListRef,
|
|
745
754
|
mode: "vertical",
|
|
746
755
|
theme: menu.theme,
|
|
747
756
|
items: menu.items,
|
|
@@ -806,7 +815,13 @@ function DropdownInternal({
|
|
|
806
815
|
if (!disabled && triggerSet.has("hover")) scheduleClose();
|
|
807
816
|
},
|
|
808
817
|
onClick: (event) => event.stopPropagation(),
|
|
809
|
-
children: popupRender ? popupRender(
|
|
818
|
+
children: popupRender ? popupRender(/* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
819
|
+
/* @__PURE__ */ jsx4(FloatingScrollbarProvider, { targetRef: menuListRef }),
|
|
820
|
+
menuNode
|
|
821
|
+
] })) : /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
822
|
+
/* @__PURE__ */ jsx4(FloatingScrollbarProvider, { targetRef: menuListRef }),
|
|
823
|
+
menuNode
|
|
824
|
+
] })
|
|
810
825
|
},
|
|
811
826
|
contextPoint ? `context-${contextPoint.x}-${contextPoint.y}` : "trigger"
|
|
812
827
|
)
|
|
@@ -849,9 +864,9 @@ var Dropdown = Object.assign(DropdownRoot, {
|
|
|
849
864
|
});
|
|
850
865
|
|
|
851
866
|
// src/components/Input.tsx
|
|
852
|
-
import { forwardRef, useId as useId2, useRef as useRef5, useState as useState3 } from "react";
|
|
853
|
-
import { Fragment as
|
|
854
|
-
var Input =
|
|
867
|
+
import { forwardRef as forwardRef2, useId as useId2, useRef as useRef5, useState as useState3 } from "react";
|
|
868
|
+
import { Fragment as Fragment3, jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
869
|
+
var Input = forwardRef2(function Input2({
|
|
855
870
|
label,
|
|
856
871
|
hint,
|
|
857
872
|
status = "default",
|
|
@@ -999,11 +1014,11 @@ var Input = forwardRef(function Input2({
|
|
|
999
1014
|
)
|
|
1000
1015
|
}
|
|
1001
1016
|
) : null;
|
|
1002
|
-
if (!label && !hint) return /* @__PURE__ */ jsxs3(
|
|
1017
|
+
if (!label && !hint) return /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
1003
1018
|
/* @__PURE__ */ jsx5("span", { className: `sia-field ${className}`.trim(), children: control }),
|
|
1004
1019
|
editor
|
|
1005
1020
|
] });
|
|
1006
|
-
return /* @__PURE__ */ jsxs3(
|
|
1021
|
+
return /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
1007
1022
|
/* @__PURE__ */ jsxs3("span", { className: `sia-field ${className}`.trim(), children: [
|
|
1008
1023
|
label ? /* @__PURE__ */ jsx5("label", { className: "sia-field__label", htmlFor: inputId, children: label }) : null,
|
|
1009
1024
|
control,
|
|
@@ -2,7 +2,7 @@ import * as react from 'react';
|
|
|
2
2
|
import { ReactNode, HTMLAttributes, CSSProperties, MouseEvent, ReactElement, ImgHTMLAttributes, InputHTMLAttributes, MouseEventHandler, AnchorHTMLAttributes, ButtonHTMLAttributes, RefObject } from 'react';
|
|
3
3
|
import { B as ButtonProps, b as Button } from './Button-B59TIes7.js';
|
|
4
4
|
import { C as ControlSize, a as ControlStatus, I as InputPlaceholderMode } from './shared-Bx4B28Wh.js';
|
|
5
|
-
import './Select-
|
|
5
|
+
import './Select-tsENCXQI.js';
|
|
6
6
|
|
|
7
7
|
/** 单个工具栏操作及其下拉菜单。 */
|
|
8
8
|
interface ToolbarItem {
|
|
@@ -629,8 +629,8 @@ interface MenuProps extends Omit<HTMLAttributes<HTMLUListElement>, "onClick" | "
|
|
|
629
629
|
/** 子菜单交互改变展开状态时触发,参数为完整的展开键集合;弹出模式切换兄弟目录时同时移除旧分支及后代。受控时应将该集合写回 openKeys。 */
|
|
630
630
|
onOpenChange?: (keys: string[]) => void;
|
|
631
631
|
}
|
|
632
|
-
/**
|
|
633
|
-
declare
|
|
632
|
+
/** 菜单组件;ref 转发到根列表,供弹层容器接入局部浮动滚动条等能力。 */
|
|
633
|
+
declare const Menu: react.ForwardRefExoticComponent<MenuProps & react.RefAttributes<HTMLUListElement>>;
|
|
634
634
|
/** Step的状态类型。 */
|
|
635
635
|
type StepStatus = "wait" | "process" | "finish" | "error";
|
|
636
636
|
/** Step的项目定义。 */
|
|
@@ -968,7 +968,7 @@ interface DropdownButtonProps extends Omit<DropdownProps, "children" | "classNam
|
|
|
968
968
|
onClick?: ButtonProps["onClick"];
|
|
969
969
|
}
|
|
970
970
|
declare function DropdownButton({ children, className, buttonProps, onClick, disabled, buttonDisabled, dropdownDisabled, trigger, ...dropdownProps }: DropdownButtonProps): react.JSX.Element;
|
|
971
|
-
/** 下拉菜单组件;面板以 260ms
|
|
971
|
+
/** 下拉菜单组件;面板以 260ms 缩放淡入并轻微回弹,关闭为 140ms 无回弹缩小淡出;退出完成后释放定位锚点,系统减少动态效果时直接完成。 */
|
|
972
972
|
declare const Dropdown: typeof DropdownRoot & {
|
|
973
973
|
/** 组合主操作按钮与下拉菜单的按钮组件。 */
|
|
974
974
|
Button: typeof DropdownButton;
|
|
@@ -2411,7 +2411,7 @@ interface FloatButtonGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "on
|
|
|
2411
2411
|
* @defaultValue "top"
|
|
2412
2412
|
*/
|
|
2413
2413
|
placement?: "top" | "bottom" | "left" | "right";
|
|
2414
|
-
/** 是否打开;传入后由外部控制显示状态。菜单展开 260ms
|
|
2414
|
+
/** 是否打开;传入后由外部控制显示状态。菜单展开 260ms,以缩放淡入、轻微弹大回收后归位表现柔和弹性;收起 140ms,无回弹缩小淡出,保留原有面板外观;结束后卸载,减少动态效果时直接切换。 */
|
|
2415
2415
|
open?: boolean;
|
|
2416
2416
|
/**
|
|
2417
2417
|
* 非受控模式下的初始打开状态。
|
|
@@ -2,7 +2,7 @@ import * as react from 'react';
|
|
|
2
2
|
import { ReactNode, HTMLAttributes, CSSProperties, MouseEvent, ReactElement, ImgHTMLAttributes, InputHTMLAttributes, MouseEventHandler, AnchorHTMLAttributes, ButtonHTMLAttributes, RefObject } from 'react';
|
|
3
3
|
import { B as ButtonProps, b as Button } from './Button-xLR4Yt57.cjs';
|
|
4
4
|
import { C as ControlSize, a as ControlStatus, I as InputPlaceholderMode } from './shared-Bx4B28Wh.cjs';
|
|
5
|
-
import './Select-
|
|
5
|
+
import './Select-Dxevc0f6.cjs';
|
|
6
6
|
|
|
7
7
|
/** 单个工具栏操作及其下拉菜单。 */
|
|
8
8
|
interface ToolbarItem {
|
|
@@ -629,8 +629,8 @@ interface MenuProps extends Omit<HTMLAttributes<HTMLUListElement>, "onClick" | "
|
|
|
629
629
|
/** 子菜单交互改变展开状态时触发,参数为完整的展开键集合;弹出模式切换兄弟目录时同时移除旧分支及后代。受控时应将该集合写回 openKeys。 */
|
|
630
630
|
onOpenChange?: (keys: string[]) => void;
|
|
631
631
|
}
|
|
632
|
-
/**
|
|
633
|
-
declare
|
|
632
|
+
/** 菜单组件;ref 转发到根列表,供弹层容器接入局部浮动滚动条等能力。 */
|
|
633
|
+
declare const Menu: react.ForwardRefExoticComponent<MenuProps & react.RefAttributes<HTMLUListElement>>;
|
|
634
634
|
/** Step的状态类型。 */
|
|
635
635
|
type StepStatus = "wait" | "process" | "finish" | "error";
|
|
636
636
|
/** Step的项目定义。 */
|
|
@@ -968,7 +968,7 @@ interface DropdownButtonProps extends Omit<DropdownProps, "children" | "classNam
|
|
|
968
968
|
onClick?: ButtonProps["onClick"];
|
|
969
969
|
}
|
|
970
970
|
declare function DropdownButton({ children, className, buttonProps, onClick, disabled, buttonDisabled, dropdownDisabled, trigger, ...dropdownProps }: DropdownButtonProps): react.JSX.Element;
|
|
971
|
-
/** 下拉菜单组件;面板以 260ms
|
|
971
|
+
/** 下拉菜单组件;面板以 260ms 缩放淡入并轻微回弹,关闭为 140ms 无回弹缩小淡出;退出完成后释放定位锚点,系统减少动态效果时直接完成。 */
|
|
972
972
|
declare const Dropdown: typeof DropdownRoot & {
|
|
973
973
|
/** 组合主操作按钮与下拉菜单的按钮组件。 */
|
|
974
974
|
Button: typeof DropdownButton;
|
|
@@ -2411,7 +2411,7 @@ interface FloatButtonGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "on
|
|
|
2411
2411
|
* @defaultValue "top"
|
|
2412
2412
|
*/
|
|
2413
2413
|
placement?: "top" | "bottom" | "left" | "right";
|
|
2414
|
-
/** 是否打开;传入后由外部控制显示状态。菜单展开 260ms
|
|
2414
|
+
/** 是否打开;传入后由外部控制显示状态。菜单展开 260ms,以缩放淡入、轻微弹大回收后归位表现柔和弹性;收起 140ms,无回弹缩小淡出,保留原有面板外观;结束后卸载,减少动态效果时直接切换。 */
|
|
2415
2415
|
open?: boolean;
|
|
2416
2416
|
/**
|
|
2417
2417
|
* 非受控模式下的初始打开状态。
|
package/dist/core.cjs
CHANGED
|
@@ -562,8 +562,8 @@ var import_react3 = require("react");
|
|
|
562
562
|
// src/components/popupFluidMotion.ts
|
|
563
563
|
var popupEnterDuration = 260;
|
|
564
564
|
var popupExitDuration = 140;
|
|
565
|
-
var popupInitialScale = 0.
|
|
566
|
-
var popupTravelOffset =
|
|
565
|
+
var popupInitialScale = 0.93;
|
|
566
|
+
var popupTravelOffset = 4;
|
|
567
567
|
function popupFluidFrames(placement, open = true) {
|
|
568
568
|
const side = placement.split("-")[0];
|
|
569
569
|
const axis = side === "left" || side === "right" ? "X" : "Y";
|
|
@@ -572,8 +572,8 @@ function popupFluidFrames(placement, open = true) {
|
|
|
572
572
|
const visible = { opacity: 1, transform: "none" };
|
|
573
573
|
return open ? [
|
|
574
574
|
{ ...hidden, offset: 0 },
|
|
575
|
-
{ opacity: 1, transform: "scale(1.
|
|
576
|
-
{ opacity: 1, transform: "scale(.
|
|
575
|
+
{ opacity: 1, transform: "scale(1.05, 1.04)", offset: 0.68 },
|
|
576
|
+
{ opacity: 1, transform: "scale(.977, .985)", offset: 0.86 },
|
|
577
577
|
{ ...visible, offset: 1 }
|
|
578
578
|
] : [{ ...visible, offset: 0 }, { ...hidden, offset: 1 }];
|
|
579
579
|
}
|
|
@@ -593,16 +593,16 @@ function motionFrames(kind, placement) {
|
|
|
593
593
|
const outside = `translate${axis}(${sign * 100}%)`;
|
|
594
594
|
return [
|
|
595
595
|
{ transform: outside, offset: 0 },
|
|
596
|
-
{ transform: `translate${axis}(0) scale${axis}(1.
|
|
597
|
-
{ transform: `translate${axis}(0) scale${axis}(.
|
|
596
|
+
{ transform: `translate${axis}(0) scale${axis}(1.03)`, offset: 0.68 },
|
|
597
|
+
{ transform: `translate${axis}(0) scale${axis}(.988)`, offset: 0.86 },
|
|
598
598
|
{ transform: "none", offset: 1 }
|
|
599
599
|
];
|
|
600
600
|
}
|
|
601
601
|
const modal = kind === "modal";
|
|
602
602
|
return [
|
|
603
|
-
{ opacity: 0, transform: `translateY(${modal ?
|
|
604
|
-
{ opacity: 1, transform: modal ? "scale(1.
|
|
605
|
-
{ opacity: 1, transform: modal ? "scale(.
|
|
603
|
+
{ opacity: 0, transform: `translateY(${modal ? 14 : -4}px) scale(${modal ? 0.95 : 0.93})`, offset: 0 },
|
|
604
|
+
{ opacity: 1, transform: modal ? "scale(1.035, 1.02)" : "scale(1.05, 1.04)", offset: 0.68 },
|
|
605
|
+
{ opacity: 1, transform: modal ? "scale(.984, .992)" : "scale(.977, .985)", offset: 0.86 },
|
|
606
606
|
{ opacity: 1, transform: "none", offset: 1 }
|
|
607
607
|
];
|
|
608
608
|
}
|
|
@@ -2679,7 +2679,7 @@ function MenuLevel({
|
|
|
2679
2679
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(MenuEntry, { item, level, parents, props, reserveIcon }, item.key);
|
|
2680
2680
|
}) });
|
|
2681
2681
|
}
|
|
2682
|
-
function
|
|
2682
|
+
function MenuInner({
|
|
2683
2683
|
items,
|
|
2684
2684
|
mode = "vertical",
|
|
2685
2685
|
gridColumns = 2,
|
|
@@ -2702,9 +2702,14 @@ function Menu({
|
|
|
2702
2702
|
className = "",
|
|
2703
2703
|
style,
|
|
2704
2704
|
...rest
|
|
2705
|
-
}) {
|
|
2705
|
+
}, ref) {
|
|
2706
2706
|
const menuId = (0, import_react11.useId)();
|
|
2707
2707
|
const rootRef = (0, import_react11.useRef)(null);
|
|
2708
|
+
const setRootRef = (node) => {
|
|
2709
|
+
rootRef.current = node;
|
|
2710
|
+
if (typeof ref === "function") ref(node);
|
|
2711
|
+
else if (ref) ref.current = node;
|
|
2712
|
+
};
|
|
2708
2713
|
const [selected, setSelected] = useControllableState({ value: selectedKeys, defaultValue: defaultSelectedKeys });
|
|
2709
2714
|
const [open, setOpen] = useControllableState({ value: openKeys, defaultValue: defaultOpenKeys, onChange: (next) => onOpenChange?.([...next]) });
|
|
2710
2715
|
const pendingOpenRef = (0, import_react11.useRef)(open);
|
|
@@ -2823,11 +2828,12 @@ function Menu({
|
|
|
2823
2828
|
}
|
|
2824
2829
|
}
|
|
2825
2830
|
const gridStyle = mode === "grid" ? { "--sia-menu-grid-columns": gridColumns === "auto" ? "repeat(auto-fill, minmax(88px, 1fr))" : `repeat(${Number.isFinite(gridColumns) ? Math.max(1, Math.floor(Number(gridColumns))) : 2}, minmax(0, 1fr))` } : {};
|
|
2826
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("ul", { ref:
|
|
2831
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("ul", { ref: setRootRef, className: `sia-menu sia-menu-motion-surface sia-menu--${mode} sia-menu--${theme}${inlineCollapsed ? " sia-menu--collapsed" : ""} ${className}`.trim(), role: "menu", ...withTitleTooltip(rest), onKeyDown: handleMenuKeyDown, style: { ...gridStyle, ...style }, "data-sia-menu-owner": menuId, children: [
|
|
2827
2832
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(MenuLevel, { items, level: 0, parents: [], props: { interactionCursor, menuId, mode, theme, multiple, selectable, inlineCollapsed, inlineIndent, triggerSubMenuAction, selected, open, select, toggle } }),
|
|
2828
2833
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(MenuSelectionMotion, { rootRef, enabled: !multiple })
|
|
2829
2834
|
] });
|
|
2830
2835
|
}
|
|
2836
|
+
var Menu = (0, import_react11.forwardRef)(MenuInner);
|
|
2831
2837
|
function Segmented({ options, value, defaultValue, variant = "default", shape = "capsule", size: sizeProp, block = false, vertical = false, disabled = false, onChange, className = "", onKeyDown, ...props }) {
|
|
2832
2838
|
const size = useControlSize(sizeProp);
|
|
2833
2839
|
const rootRef = (0, import_react11.useRef)(null);
|
|
@@ -2887,6 +2893,7 @@ function DropdownInternal({
|
|
|
2887
2893
|
const rootRef = (0, import_react13.useRef)(null);
|
|
2888
2894
|
const contextAnchorRef = (0, import_react13.useRef)(null);
|
|
2889
2895
|
const popupRef = (0, import_react13.useRef)(null);
|
|
2896
|
+
const menuListRef = (0, import_react13.useRef)(null);
|
|
2890
2897
|
const openTimerRef = (0, import_react13.useRef)(void 0);
|
|
2891
2898
|
const closeTimerRef = (0, import_react13.useRef)(void 0);
|
|
2892
2899
|
const [internalOpen, setInternalOpen] = (0, import_react13.useState)(defaultOpen);
|
|
@@ -3013,6 +3020,7 @@ function DropdownInternal({
|
|
|
3013
3020
|
const menuNode = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3014
3021
|
Menu,
|
|
3015
3022
|
{
|
|
3023
|
+
ref: menuListRef,
|
|
3016
3024
|
mode: "vertical",
|
|
3017
3025
|
theme: menu.theme,
|
|
3018
3026
|
items: menu.items,
|
|
@@ -3077,7 +3085,13 @@ function DropdownInternal({
|
|
|
3077
3085
|
if (!disabled && triggerSet.has("hover")) scheduleClose();
|
|
3078
3086
|
},
|
|
3079
3087
|
onClick: (event) => event.stopPropagation(),
|
|
3080
|
-
children: popupRender ? popupRender(
|
|
3088
|
+
children: popupRender ? popupRender(/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
3089
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FloatingScrollbarProvider, { targetRef: menuListRef }),
|
|
3090
|
+
menuNode
|
|
3091
|
+
] })) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
3092
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FloatingScrollbarProvider, { targetRef: menuListRef }),
|
|
3093
|
+
menuNode
|
|
3094
|
+
] })
|
|
3081
3095
|
},
|
|
3082
3096
|
contextPoint ? `context-${contextPoint.x}-${contextPoint.y}` : "trigger"
|
|
3083
3097
|
)
|