cos-design 3.7.0 → 3.7.1

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.
@@ -6,6 +6,8 @@ export interface BurnAwayProps {
6
6
  fontSize?: number;
7
7
  /** 燃烧完成回调 */
8
8
  onComplete?: () => void;
9
+ /** 燃烧完成提示 */
10
+ completedText?: string;
9
11
  }
10
12
  declare const BurnAway: React.FC<BurnAwayProps>;
11
13
  export default BurnAway;
@@ -6,6 +6,8 @@ export interface ConfettiProps {
6
6
  auto?: boolean;
7
7
  /** 每次喷射粒子数,默认 120 */
8
8
  particleCount?: number;
9
+ /** 画布操作提示 */
10
+ hint?: string;
9
11
  }
10
12
  export interface ConfettiHandle {
11
13
  /** 手动触发彩纸喷射 */
@@ -8,6 +8,19 @@ export interface CountdownProps {
8
8
  showLabels?: boolean;
9
9
  /** 主色 */
10
10
  color?: string;
11
+ /** 单位标签,可用于国际化 */
12
+ labels?: Partial<Record<keyof Omit<TimeLeft, 'total'>, string>>;
13
+ /** 目标时间无效时的提示 */
14
+ invalidText?: string;
15
+ /** 倒计时结束提示 */
16
+ endedText?: string;
17
+ }
18
+ interface TimeLeft {
19
+ days: number;
20
+ hours: number;
21
+ minutes: number;
22
+ seconds: number;
23
+ total: number;
11
24
  }
12
25
  declare const Countdown: React.FC<CountdownProps>;
13
26
  export default Countdown;
@@ -6,6 +6,8 @@ export interface CursorTrailProps {
6
6
  length?: number;
7
7
  width?: number;
8
8
  height?: number;
9
+ /** 操作提示 */
10
+ hint?: string;
9
11
  }
10
12
  declare const CursorTrail: React.FC<CursorTrailProps>;
11
13
  export default CursorTrail;
@@ -4,6 +4,12 @@ export interface DiceRollProps {
4
4
  onRoll?: (value: number) => void;
5
5
  /** 骰子面数,默认 6 */
6
6
  sides?: 6;
7
+ /** 掷骰按钮文案 */
8
+ rollText?: string;
9
+ /** 掷骰进行中的文案 */
10
+ rollingText?: string;
11
+ /** 点数结果前缀 */
12
+ resultPrefix?: string;
7
13
  }
8
14
  declare const DiceRoll: React.FC<DiceRollProps>;
9
15
  export default DiceRoll;
@@ -4,6 +4,8 @@ export interface FireworksProps {
4
4
  height?: number;
5
5
  /** 是否自动燃放,默认 true */
6
6
  auto?: boolean;
7
+ /** 画布操作提示 */
8
+ hint?: string;
7
9
  }
8
10
  export interface FireworksHandle {
9
11
  /** 手动燃放烟花,可指定 x 坐标 */
@@ -12,6 +12,14 @@ export interface GameOfLifeProps {
12
12
  aliveColor?: string;
13
13
  /** 网格线颜色 */
14
14
  gridColor?: string;
15
+ /** 控制栏文案 */
16
+ labels?: Partial<{
17
+ generation: string;
18
+ alive: string;
19
+ pause: string;
20
+ play: string;
21
+ randomize: string;
22
+ }>;
15
23
  }
16
24
  declare const GameOfLife: React.FC<GameOfLifeProps>;
17
25
  export default GameOfLife;
@@ -77,6 +77,8 @@ export type { NeonTextProps } from './neonText';
77
77
  export { default as OrbitalChart } from './orbitalChart';
78
78
  export type { OrbitalChartItem, OrbitalChartProps } from './orbitalChart';
79
79
  export { default as ParticleNetwork } from './particleNetwork';
80
+ export { default as PhotoAlbum } from './photoAlbum';
81
+ export type { PhotoAlbumItem, PhotoAlbumLabels, PhotoAlbumProps } from './photoAlbum';
80
82
  export { default as PlasmaBall } from './plasmaBall';
81
83
  export type { PlasmaBallProps } from './plasmaBall';
82
84
  export { default as SmokeFog } from './smokeFog';
@@ -19,6 +19,8 @@ export interface NetworkGraphProps {
19
19
  linkColor?: string;
20
20
  /** 节点半径 */
21
21
  nodeRadius?: number;
22
+ /** 未悬停节点时的操作提示 */
23
+ hint?: string;
22
24
  }
23
25
  declare const NetworkGraph: React.FC<NetworkGraphProps>;
24
26
  export default NetworkGraph;
@@ -10,6 +10,8 @@ export interface ParticleNetworkProps {
10
10
  repelRadius?: number;
11
11
  /** 粒子颜色 */
12
12
  color?: string;
13
+ /** 操作提示 */
14
+ hint?: string;
13
15
  }
14
16
  declare const ParticleNetwork: React.FC<ParticleNetworkProps>;
15
17
  export default ParticleNetwork;
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+ import { PhotoAlbumProps } from './types';
3
+ declare const PhotoAlbum: React.FC<PhotoAlbumProps>;
4
+ export type { PhotoAlbumItem, PhotoAlbumLabels, PhotoAlbumProps } from './types';
5
+ export default PhotoAlbum;
@@ -0,0 +1,57 @@
1
+ import { CSSProperties } from 'react';
2
+ export interface PhotoAlbumItem {
3
+ /** 图片地址 */
4
+ src: string;
5
+ /** 图片替代文本 */
6
+ alt?: string;
7
+ /** 照片标题 */
8
+ title?: string;
9
+ /** 照片说明 */
10
+ description?: string;
11
+ }
12
+ export interface PhotoAlbumLabels {
13
+ /** 上一页按钮标签 */
14
+ previous?: string;
15
+ /** 下一页按钮标签 */
16
+ next?: string;
17
+ /** 空相册提示 */
18
+ empty?: string;
19
+ /** 首页飞页主标题 */
20
+ flyleafTitle?: string;
21
+ /** 首页飞页副标题 */
22
+ flyleafSubtitle?: string;
23
+ /** 尾页飞页主标题 */
24
+ flyleafEndTitle?: string;
25
+ /** 尾页飞页副标题 */
26
+ flyleafEndSubtitle?: string;
27
+ }
28
+ export interface PhotoAlbumProps {
29
+ /** 相册照片列表 */
30
+ photos: PhotoAlbumItem[];
31
+ /** 相册宽度 */
32
+ width?: number | string;
33
+ /** 相册高度 */
34
+ height?: number | string;
35
+ /** 初始右页照片索引(摊开为左 index-1 / 右 index;每次翻页翻过一叶两面) */
36
+ initialIndex?: number;
37
+ /** 单次翻页动画时长(毫秒) */
38
+ pageTurnDuration?: number;
39
+ /** 照片填充方式 */
40
+ objectFit?: CSSProperties['objectFit'];
41
+ /** 是否显示页码 */
42
+ showPageNumber?: boolean;
43
+ /** 相纸颜色 */
44
+ pageColor?: string;
45
+ /** 封皮颜色 */
46
+ coverColor?: string;
47
+ /** 相册无障碍名称 */
48
+ ariaLabel?: string;
49
+ /** 内置文案 */
50
+ labels?: PhotoAlbumLabels;
51
+ /** 当前照片变化回调 */
52
+ onPageChange?: (index: number, photo: PhotoAlbumItem) => void;
53
+ /** 自定义类名 */
54
+ className?: string;
55
+ /** 自定义样式 */
56
+ style?: CSSProperties;
57
+ }
@@ -6,6 +6,8 @@ export interface ProgressChestProps {
6
6
  onOpen?: () => void;
7
7
  /** 标签文字 */
8
8
  label?: string;
9
+ /** 宝箱开启后的标签文字 */
10
+ openedLabel?: string;
9
11
  }
10
12
  declare const ProgressChest: React.FC<ProgressChestProps>;
11
13
  export default ProgressChest;
@@ -4,6 +4,12 @@ export interface RedPacketRainProps {
4
4
  duration?: number;
5
5
  /** 抢到红包回调 */
6
6
  onGrab?: (amount: number) => void;
7
+ /** 已抢金额标签 */
8
+ grabbedLabel?: string;
9
+ /** 红包雨结束提示 */
10
+ endedText?: string;
11
+ /** 操作提示 */
12
+ hint?: string;
7
13
  }
8
14
  declare const RedPacketRain: React.FC<RedPacketRainProps>;
9
15
  export default RedPacketRain;
@@ -8,6 +8,10 @@ export interface SandFallProps {
8
8
  colors?: string[];
9
9
  /** 每帧生成粒子数 */
10
10
  spawnRate?: number;
11
+ /** 操作提示 */
12
+ hint?: string;
13
+ /** 清空按钮文案 */
14
+ clearText?: string;
11
15
  }
12
16
  declare const SandFall: React.FC<SandFallProps>;
13
17
  export default SandFall;
@@ -4,6 +4,8 @@ export interface ScratchCardProps {
4
4
  coverColor?: string;
5
5
  /** 奖品文字 */
6
6
  prize?: string;
7
+ /** 涂层上的提示文案 */
8
+ coverText?: string;
7
9
  /** 刮开完成回调 */
8
10
  onReveal?: () => void;
9
11
  width?: number;
@@ -4,6 +4,14 @@ export interface SlotMachineProps {
4
4
  symbols?: string[];
5
5
  /** 旋转结束回调 */
6
6
  onSpinEnd?: (results: string[]) => void;
7
+ /** 开始按钮文案 */
8
+ startText?: string;
9
+ /** 旋转中的按钮文案 */
10
+ spinningText?: string;
11
+ /** 中奖提示 */
12
+ jackpotText?: string;
13
+ /** 普通结果前缀 */
14
+ resultPrefix?: string;
7
15
  }
8
16
  declare const SlotMachine: React.FC<SlotMachineProps>;
9
17
  export default SlotMachine;
@@ -16,6 +16,8 @@ export interface SmokeFogProps {
16
16
  disperseRadius?: number;
17
17
  /** 是否响应点击/触摸驱散,默认 true */
18
18
  interactive?: boolean;
19
+ /** 画布无障碍标签 */
20
+ ariaLabel?: string;
19
21
  }
20
22
  declare const SmokeFog: React.FC<SmokeFogProps>;
21
23
  export default SmokeFog;
@@ -12,6 +12,8 @@ export interface SpringMassProps {
12
12
  damping?: number;
13
13
  /** 主色 */
14
14
  color?: string;
15
+ /** 操作提示 */
16
+ hint?: string;
15
17
  }
16
18
  declare const SpringMass: React.FC<SpringMassProps>;
17
19
  export default SpringMass;
@@ -14,6 +14,10 @@ export interface TurntableProps {
14
14
  spinRounds?: number;
15
15
  /** 抽奖按钮文案 */
16
16
  buttonText?: string;
17
+ /** 抽奖进行中的按钮文案 */
18
+ spinningText?: string;
19
+ /** 中奖结果前缀 */
20
+ resultPrefix?: string;
17
21
  /** 旋转结束回调 */
18
22
  onSpinEnd?: (prize: TurntablePrize, index: number) => void;
19
23
  }
@@ -51,6 +51,10 @@ export interface WeatherBackgroundProps {
51
51
  onLiveWeather?: (weather: WeatherType) => void;
52
52
  /** 外部受控 loading:在当前画面上叠加加载遮罩(live 模式定位/请求期间会自动显示,无需传入) */
53
53
  loading?: boolean;
54
+ /** 画布无障碍标签;不传时使用默认中文描述 */
55
+ ariaLabel?: string;
56
+ /** 加载状态文案 */
57
+ loadingText?: string;
54
58
  }
55
59
  export interface WeatherConfig {
56
60
  sky: [string, string];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cos-design",
3
- "version": "3.7.0",
3
+ "version": "3.7.1",
4
4
  "description": "A React component library built with Vite",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -33,8 +33,16 @@
33
33
  "cos-design",
34
34
  "react",
35
35
  "component-library",
36
- "vite",
37
- "typescript"
36
+ "visual-effects",
37
+ "canvas",
38
+ "animation",
39
+ "fireworks",
40
+ "scratch-card",
41
+ "lottery",
42
+ "marketing-page",
43
+ "landing-page",
44
+ "typescript",
45
+ "vite"
38
46
  ],
39
47
  "homepage": "https://jiaxiantao.github.io/cos-design/",
40
48
  "bugs": {