@unicom-cloud/ui 0.8.97 → 0.8.99

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 (72) hide show
  1. package/Badge.js +53 -7
  2. package/LiquidFill.js +59 -2
  3. package/Marquee.js +61 -0
  4. package/QrCode.js +13 -9
  5. package/Segmented.js +11 -0
  6. package/Space.js +14 -6
  7. package/Splitter.js +7 -0
  8. package/Tour.js +13 -9
  9. package/badge/index.js +177 -84
  10. package/collapse/Collapse.js +54 -48
  11. package/components/common/space/index.js +90 -106
  12. package/index.js +356 -353
  13. package/liquid-fill/index.js +255 -2
  14. package/marquee/index.js +282 -0
  15. package/menu/Item.js +17 -16
  16. package/package.json +1 -1
  17. package/qr-code/index.js +53 -36
  18. package/rate/index.js +8 -8
  19. package/segmented/index.js +217 -0
  20. package/space/index.js +28 -29
  21. package/splitter/index.js +117 -0
  22. package/style.css +1 -1
  23. package/tour/index.js +110 -88
  24. package/types/common/hooks/useMergeProps.d.ts +1 -1
  25. package/types/common/space/index.d.ts +6 -5
  26. package/types/common/space/interface.d.ts +29 -16
  27. package/types/pc/badge/index.d.ts +4 -4
  28. package/types/pc/badge/interface.d.ts +26 -0
  29. package/types/pc/collapse/interface.d.ts +4 -0
  30. package/types/pc/config-provider/interface.d.ts +12 -0
  31. package/types/pc/date-picker/RangePicker.d.ts +1 -1
  32. package/types/pc/index.d.ts +10 -4
  33. package/types/pc/liquid-fill/index.d.ts +114 -3
  34. package/types/pc/marquee/index.d.ts +61 -0
  35. package/types/pc/menu/context.d.ts +1 -1
  36. package/types/pc/qr-code/index.d.ts +1 -1
  37. package/types/pc/rate/index.d.ts +2 -2
  38. package/types/pc/segmented/index.d.ts +8 -0
  39. package/types/pc/segmented/interface.d.ts +88 -0
  40. package/types/pc/space/index.d.ts +3 -1
  41. package/types/pc/space/interface.d.ts +6 -10
  42. package/types/pc/splitter/index.d.ts +4 -0
  43. package/types/pc/splitter/interface.d.ts +70 -0
  44. package/types/pc/tour/index.d.ts +8 -3
  45. package/types/pc/utils/names.d.ts +18 -0
  46. package/typography/Ellipsis.js +1 -1
  47. package/utils/names.js +12 -0
  48. package/version/index.js +1 -1
  49. package/_virtual/_commonjsHelpers.js +0 -6
  50. package/_virtual/index.js +0 -7
  51. package/_virtual/index2.js +0 -4
  52. package/liquid-fill/LiquidFill.js +0 -189
  53. package/liquid-fill/LiquidFill2.js +0 -3
  54. package/space-/index.js +0 -93
  55. package/types/common/utils/color.d.ts +0 -1
  56. package/types/common/utils/computeScrollIntoView.d.ts +0 -1
  57. package/types/common/utils/index.d.ts +0 -45
  58. package/types/common/utils/math.d.ts +0 -1
  59. package/types/common/utils/reactTransitionGroup.d.ts +0 -1
  60. package/types/common/utils/tree.d.ts +0 -1
  61. package/types/common/utils/tween.d.ts +0 -1
  62. package/types/common/utils/uuid.d.ts +0 -1
  63. package/types/common/utils/validate.d.ts +0 -1
  64. package/types/pc/liquid-fill/LiquidFill.d.ts +0 -30
  65. package/types/pc/liquid-fill/LiquidFill2.d.ts +0 -1
  66. package/types/pc/liquid-fill/interface.d.ts +0 -0
  67. package/types/pc/space-/index.d.ts +0 -6
  68. package/types/pc/space-/interface.d.ts +0 -38
  69. /package/{space- → components/common/space}/toArray.js +0 -0
  70. /package/{liquid-fill → segmented}/interface.js +0 -0
  71. /package/{space- → splitter}/interface.js +0 -0
  72. /package/types/{pc/space- → common/space}/toArray.d.ts +0 -0
@@ -1,4 +1,115 @@
1
- import { LiquidFillProps } from './interface';
2
- import LiquidFill from './LiquidFill';
3
- export type { LiquidFillProps };
1
+ import React, { type CSSProperties } from 'react';
2
+ /**
3
+ * 颜色配置类型,支持纯色和渐变色
4
+ */
5
+ type ColorType = string | {
6
+ /** 渐变起始颜色 */
7
+ from: string;
8
+ /** 渐变结束颜色 */
9
+ to: string;
10
+ /**
11
+ * 渐变方向
12
+ * @default 'vertical' 垂直渐变
13
+ */
14
+ direction?: 'horizontal' | 'vertical';
15
+ };
16
+ /**
17
+ * 水球填充组件的属性接口
18
+ */
19
+ export interface LiquidFillProps {
20
+ /** 自定义容器样式 */
21
+ style?: CSSProperties;
22
+ /** 自定义类名 */
23
+ className?: string | string[];
24
+ /**
25
+ * 当前填充比例 (0-1)
26
+ * @default 0.5
27
+ */
28
+ value: number;
29
+ /**
30
+ * 组件尺寸 (像素)
31
+ * @default 200
32
+ */
33
+ size?: number;
34
+ /**
35
+ * 字体大小
36
+ * @default size * 0.15
37
+ */
38
+ fontSize?: number | string;
39
+ /**
40
+ * 波浪颜色,支持纯色或渐变色
41
+ * @default 'rgb(var(--pqb-blue-6))'
42
+ */
43
+ waveColor?: ColorType;
44
+ /**
45
+ * 背景颜色,支持纯色或渐变色
46
+ * @default 'var(--pqb-color-neutral-1)'
47
+ */
48
+ backgroundColor?: ColorType;
49
+ /**
50
+ * 文字颜色
51
+ * @default 'var(--pqb-color-neutral-8)'
52
+ */
53
+ textColor?: string;
54
+ /**
55
+ * 是否显示百分比
56
+ * @default true
57
+ */
58
+ showPercent?: boolean;
59
+ /**
60
+ * 动画持续时间(毫秒)
61
+ * @default 2000
62
+ */
63
+ duration?: number;
64
+ /**
65
+ * 波浪数量
66
+ * @default 3
67
+ */
68
+ waveCount?: number;
69
+ /**
70
+ * 波浪振幅
71
+ * @default 10
72
+ */
73
+ waveAmplitude?: number;
74
+ /**
75
+ * 内层边框颜色
76
+ * @default 'var(--pqb-color-neutral-4)'
77
+ */
78
+ borderColor?: string;
79
+ /**
80
+ * 内层边框宽度
81
+ * @default 2
82
+ */
83
+ borderWidth?: number;
84
+ /**
85
+ * 外层边框颜色(默认使用内层边框颜色但透明度30%)
86
+ */
87
+ outerBorderColor?: string;
88
+ /**
89
+ * 外层边框宽度
90
+ * @default 0(不显示)
91
+ */
92
+ outerBorderWidth?: number;
93
+ /**
94
+ * 内外层边框间距
95
+ * @default 2
96
+ */
97
+ borderGap?: number;
98
+ /**
99
+ * 百分比显示的小数位数
100
+ * @default 0(整数)
101
+ */
102
+ decimalPlaces?: number;
103
+ /**
104
+ * 百分号相对于数字的缩放比例
105
+ * @default 0.5
106
+ */
107
+ percentFontScale?: number;
108
+ /**
109
+ * 波浪速度变化系数(值越大速度差异越大)
110
+ * @default 0.5
111
+ */
112
+ waveSpeedVariation?: number;
113
+ }
114
+ declare const LiquidFill: React.FC<LiquidFillProps>;
4
115
  export default LiquidFill;
@@ -0,0 +1,61 @@
1
+ import React, { type CSSProperties, type ReactNode } from 'react';
2
+ export interface MarqueeProps {
3
+ /**
4
+ * 运动内容(支持文本或React节点)
5
+ * @example
6
+ * <Marquee>这是运动内容</Marquee>
7
+ */
8
+ children?: ReactNode;
9
+ /**
10
+ * 运动速度(像素/秒)
11
+ * @default 50
12
+ * @range 1-200
13
+ */
14
+ speed?: number;
15
+ /**
16
+ * 运动方向
17
+ * @default 'left'
18
+ * @enum ['left', 'right', 'up', 'down']
19
+ */
20
+ direction?: 'left' | 'right' | 'up' | 'down';
21
+ /**
22
+ * 鼠标悬停时是否暂停
23
+ * @default false
24
+ */
25
+ pauseOnHover?: boolean;
26
+ /**
27
+ * 是否显示边缘渐变遮罩
28
+ * @default true
29
+ */
30
+ gradient?: boolean;
31
+ /**
32
+ * 循环次数(0表示无限循环)
33
+ * @default 0
34
+ * @example
35
+ * <Marquee loop={3}>循环3次</Marquee>
36
+ */
37
+ loop?: number;
38
+ /**
39
+ * 循环完成回调(仅在loop>0时触发)
40
+ */
41
+ onComplete?: () => void;
42
+ /**
43
+ * 自定义类名
44
+ */
45
+ className?: string;
46
+ /**
47
+ * 自定义样式
48
+ */
49
+ style?: CSSProperties;
50
+ /**
51
+ * 渐变遮罩尺寸(像素)
52
+ * @default 50
53
+ */
54
+ gradientSize?: number;
55
+ }
56
+ /**
57
+ * 跑马灯组件
58
+ * 实现所有方向完美无缝循环运动
59
+ */
60
+ declare const Marquee: React.FC<MarqueeProps>;
61
+ export default Marquee;
@@ -5,7 +5,7 @@ export type HotkeyInfo = {
5
5
  type: 'sibling' | 'generation' | 'enter';
6
6
  };
7
7
  export type ResetHotkeyInfo = (activeKey?: string) => void;
8
- declare const MenuContext: import("react").Context<Pick<MenuProps, "theme" | "mode" | "collapse" | "icons" | "triggerProps" | "inDropdown" | "tooltipProps" | "levelIndent" | "selectedKeys" | "openKeys" | "autoScrollIntoView" | "scrollConfig"> & {
8
+ declare const MenuContext: import("react").Context<Pick<MenuProps, "theme" | "collapse" | "mode" | "icons" | "triggerProps" | "inDropdown" | "tooltipProps" | "levelIndent" | "selectedKeys" | "openKeys" | "autoScrollIntoView" | "scrollConfig"> & {
9
9
  id?: string;
10
10
  prefixCls?: string;
11
11
  onClickMenuItem?: (key: string, e: any) => void;
@@ -21,7 +21,7 @@ export interface QRCodeProps {
21
21
  src: string;
22
22
  height: number;
23
23
  width: number;
24
- excavate?: boolean;
24
+ excavate: boolean;
25
25
  x?: number;
26
26
  y?: number;
27
27
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { RateProps } from './interface';
3
- declare const RateComponent: React.ForwardRefExoticComponent<RateProps & React.RefAttributes<unknown>>;
4
- export default RateComponent;
3
+ declare const Rate: React.ForwardRefExoticComponent<RateProps & React.RefAttributes<unknown>>;
4
+ export default Rate;
5
5
  export type { RateProps };
@@ -0,0 +1,8 @@
1
+ import type { SegmentedProps } from './interface';
2
+ /**
3
+ * Segmented 分段控制器组件
4
+ *
5
+ * 支持多种样式变体、方向、尺寸和交互模式
6
+ */
7
+ declare const Segmented: import("react").ForwardRefExoticComponent<SegmentedProps & import("react").RefAttributes<HTMLDivElement>>;
8
+ export default Segmented;
@@ -0,0 +1,88 @@
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ /**
3
+ * 分段控制器选项类型
4
+ */
5
+ export interface SegmentedOption {
6
+ /** 选项值 */
7
+ value: string;
8
+ /** 显示文本,不设置则只显示图标 */
9
+ label?: ReactNode;
10
+ /** 是否禁用 */
11
+ disabled?: boolean;
12
+ /** 图标元素 */
13
+ icon?: ReactNode;
14
+ /** 自定义渲染函数 */
15
+ render?: (option: SegmentedOption, isActive: boolean) => ReactNode;
16
+ }
17
+ /**
18
+ * @title Segmented 分段控制器
19
+ */
20
+ export interface SegmentedProps {
21
+ /** 自定义样式 */
22
+ style?: CSSProperties;
23
+ /** 自定义类名 */
24
+ className?: string | string[];
25
+ /**
26
+ * 分段控制器选项
27
+ * @description 可以是字符串数组或 SegmentedOption 对象数组
28
+ */
29
+ options: (SegmentedOption | string)[];
30
+ /**
31
+ * 默认选中的值
32
+ * @description 非受控模式下使用
33
+ */
34
+ defaultValue?: string;
35
+ /**
36
+ * 当前选中的值
37
+ * @description 受控模式下使用
38
+ */
39
+ value?: string;
40
+ /**
41
+ * 变化时的回调函数
42
+ * @param value - 当前选中的值
43
+ */
44
+ onChange?: (value: string) => void;
45
+ /**
46
+ * 尺寸
47
+ * @defaultValue 'medium'
48
+ */
49
+ size?: 'small' | 'medium' | 'large';
50
+ /**
51
+ * 样式类型
52
+ * @defaultValue 'default'
53
+ * @enumDescription
54
+ * - default: 默认样式
55
+ * - pill: 胶囊样式 (圆形)
56
+ */
57
+ mode?: 'default' | 'pill';
58
+ /**
59
+ * 是否禁用整个组件
60
+ * @defaultValue false
61
+ */
62
+ disabled?: boolean;
63
+ /**
64
+ * 是否撑满容器宽度
65
+ * @defaultValue false
66
+ */
67
+ block?: boolean;
68
+ /**
69
+ * 布局方向
70
+ * @defaultValue 'horizontal'
71
+ */
72
+ direction?: 'horizontal' | 'vertical';
73
+ /**
74
+ * 是否显示选中指示器
75
+ * @defaultValue true
76
+ */
77
+ showIndicator?: boolean;
78
+ /**
79
+ * 动画持续时间(毫秒)
80
+ * @defaultValue 300
81
+ */
82
+ animationDuration?: number;
83
+ /**
84
+ * 为内部的 input 元素设置相同的 name 属性
85
+ * @description 用于表单提交和键盘导航
86
+ */
87
+ name?: string;
88
+ }
@@ -1,5 +1,7 @@
1
1
  import { SpaceVertical as SpaceVerticalCommon } from '../../common/space';
2
2
  import { SpaceProps } from './interface';
3
- declare const Space: import("react").ForwardRefExoticComponent<SpaceProps & import("react").RefAttributes<HTMLDivElement>>;
3
+ declare const Space: React.ForwardRefExoticComponent<SpaceProps & React.RefAttributes<unknown>> & {
4
+ Vertical: typeof SpaceVerticalCommon;
5
+ };
4
6
  export { SpaceVerticalCommon as SpaceVertical };
5
7
  export default Space;
@@ -1,20 +1,16 @@
1
1
  import { CSSProperties } from 'react';
2
- import { SpaceGap, SpaceProps as SpaceProps_ } from '../../common/space/interface';
2
+ import { SpaceProps as CommonSpaceProps, SpaceGap } from '../../common/space/interface';
3
3
  export type { SpaceGap };
4
4
  /**
5
5
  * @title Space
6
6
  */
7
- export interface SpaceProps extends SpaceProps_ {
8
- style?: CSSProperties;
7
+ export interface SpaceProps extends CommonSpaceProps {
9
8
  /**
10
- * @zh 间距。(已弃用,请用 gap 属性)
11
- * @defaultValue small
12
- * @deprecated
9
+ * 自定义类名
13
10
  */
14
- size?: SpaceGap | SpaceGap[];
11
+ className?: string;
15
12
  /**
16
- * @zh 交叉轴方向对齐方式。(已弃用,请用 alignItems 属性)
17
- * @deprecated
13
+ * 自定义样式
18
14
  */
19
- align?: 'start' | 'end' | 'center' | 'baseline';
15
+ style?: CSSProperties;
20
16
  }
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { SplitterProps } from './interface';
3
+ export declare const Splitter: React.FC<SplitterProps>;
4
+ export default Splitter;
@@ -0,0 +1,70 @@
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ /**
3
+ * @title Splitter 分隔面板
4
+ */
5
+ export interface SplitterProps {
6
+ /**
7
+ * 分割方向
8
+ * @default 'horizontal'
9
+ */
10
+ direction?: 'horizontal' | 'vertical';
11
+ /**
12
+ * 初始分割比例 (0~1)
13
+ * @default 0.5
14
+ */
15
+ initialSize?: number;
16
+ /**
17
+ * 第一个面板最小尺寸
18
+ * @default '10%'
19
+ */
20
+ minSize?: number | string;
21
+ /**
22
+ * 第一个面板最大尺寸
23
+ * @default '90%'
24
+ */
25
+ maxSize?: number | string;
26
+ /**
27
+ * 分隔条尺寸(像素)
28
+ * @default 8
29
+ */
30
+ gutterSize?: number;
31
+ /**
32
+ * 分隔条样式
33
+ */
34
+ gutterStyle?: CSSProperties;
35
+ /**
36
+ * 是否禁用拖拽
37
+ * @default false
38
+ */
39
+ disabled?: boolean;
40
+ /**
41
+ * 拖拽开始回调
42
+ */
43
+ onDragStart?: () => void;
44
+ /**
45
+ * 拖拽结束回调
46
+ * @param newSize - 新分割比例 (0~1)
47
+ */
48
+ onDragEnd?: (newSize: number) => void;
49
+ /**
50
+ * 拖拽中回调
51
+ * @param newSize - 当前分割比例 (0~1)
52
+ */
53
+ onDrag?: (newSize: number) => void;
54
+ /**
55
+ * 第一个面板内容
56
+ */
57
+ firstPane: ReactNode;
58
+ /**
59
+ * 第二个面板内容
60
+ */
61
+ secondPane: ReactNode;
62
+ /**
63
+ * 容器样式
64
+ */
65
+ style?: CSSProperties;
66
+ /**
67
+ * 容器类名
68
+ */
69
+ className?: string;
70
+ }
@@ -1,6 +1,7 @@
1
+ import { CSSProperties } from 'react';
1
2
  type Placement = 'top' | 'bottom' | 'left' | 'right';
2
3
  type TourType = 'default' | 'primary';
3
- interface TourStep {
4
+ export interface TourStep {
4
5
  /** 目标元素 (选择器字符串或DOM元素) */
5
6
  target: string | HTMLElement;
6
7
  /** 标题内容 */
@@ -10,7 +11,11 @@ interface TourStep {
10
11
  /** 初始弹出位置 (会自动调整) */
11
12
  placement?: Placement;
12
13
  }
13
- interface TourProps {
14
+ export interface TourProps {
15
+ /** 自定义样式 */
16
+ style?: CSSProperties;
17
+ /** 自定义类名 */
18
+ className?: string | string[];
14
19
  /** 引导步骤数组 */
15
20
  steps: TourStep[];
16
21
  /** 是否显示引导 */
@@ -38,5 +43,5 @@ interface TourProps {
38
43
  /** 步骤改变回调 */
39
44
  onStepChange?: (current: number) => void;
40
45
  }
41
- declare function Tour(props: TourProps): React.ReactElement;
46
+ declare function Tour(baseProps: TourProps): React.ReactElement | null;
42
47
  export default Tour;
@@ -837,4 +837,22 @@ export namespace COMPONENT_NAMES {
837
837
  let en_139: string;
838
838
  export { en_139 as en };
839
839
  }
840
+ namespace Marquee {
841
+ let zh_140: string;
842
+ export { zh_140 as zh };
843
+ let en_140: string;
844
+ export { en_140 as en };
845
+ }
846
+ namespace Segmented {
847
+ let zh_141: string;
848
+ export { zh_141 as zh };
849
+ let en_141: string;
850
+ export { en_141 as en };
851
+ }
852
+ namespace Splitter {
853
+ let zh_142: string;
854
+ export { zh_142 as zh };
855
+ let en_142: string;
856
+ export { en_142 as en };
857
+ }
840
858
  }
@@ -113,11 +113,11 @@ import "../radio/Group.js";
113
113
  import "../rate/index.js";
114
114
  import "../resize-box/index.js";
115
115
  import "../result/index.js";
116
+ import "../segmented/index.js";
116
117
  import "../select/Select.js";
117
118
  import "../skeleton/index.js";
118
119
  import "../slider/index.js";
119
120
  import "../space/index.js";
120
- import "../space-/index.js";
121
121
  import "../speech-synthesis/index.js";
122
122
  import "../spin/index.js";
123
123
  import "../statistic/index.js";
package/utils/names.js CHANGED
@@ -558,6 +558,18 @@ const e = {
558
558
  LiquidFill: {
559
559
  zh: "水球图",
560
560
  en: "LiquidFill"
561
+ },
562
+ Marquee: {
563
+ zh: "跑马灯",
564
+ en: "Marquee"
565
+ },
566
+ Segmented: {
567
+ zh: "分段控制器",
568
+ en: "Segmented"
569
+ },
570
+ Splitter: {
571
+ zh: "分隔面板",
572
+ en: "Splitter"
561
573
  }
562
574
  };
563
575
  export {
package/version/index.js CHANGED
@@ -1,4 +1,4 @@
1
- const I = "2025-06-26 18:17:56", t = "1750933076778", E = "2.66.0";
1
+ const I = "2025-06-30 15:08:45", t = "1751267325326", E = "2.66.0";
2
2
  export {
3
3
  E as VERSION,
4
4
  I as VERSION_BUILD_DATE,
@@ -1,6 +0,0 @@
1
- function e(t) {
2
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
3
- }
4
- export {
5
- e as getDefaultExportFromCjs
6
- };
package/_virtual/index.js DELETED
@@ -1,7 +0,0 @@
1
- import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
- import { __require as o } from "../node_modules/prop-types/index.js";
3
- var p = /* @__PURE__ */ o();
4
- const s = /* @__PURE__ */ r(p);
5
- export {
6
- s as default
7
- };
@@ -1,4 +0,0 @@
1
- var p = { exports: {} };
2
- export {
3
- p as __module
4
- };