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.
- package/CHANGELOG.md +9 -0
- package/README.md +39 -14
- package/dist/index.cjs +3 -3
- package/dist/index.css +1 -1
- package/dist/index.js +1685 -1187
- package/dist/src/components/burnAway/index.d.ts +2 -0
- package/dist/src/components/confetti/index.d.ts +2 -0
- package/dist/src/components/countdown/index.d.ts +13 -0
- package/dist/src/components/cursorTrail/index.d.ts +2 -0
- package/dist/src/components/diceRoll/index.d.ts +6 -0
- package/dist/src/components/fireworks/index.d.ts +2 -0
- package/dist/src/components/gameOfLife/index.d.ts +8 -0
- package/dist/src/components/index.d.ts +2 -0
- package/dist/src/components/networkGraph/index.d.ts +2 -0
- package/dist/src/components/particleNetwork/index.d.ts +2 -0
- package/dist/src/components/photoAlbum/index.d.ts +5 -0
- package/dist/src/components/photoAlbum/types.d.ts +57 -0
- package/dist/src/components/progressChest/index.d.ts +2 -0
- package/dist/src/components/redPacketRain/index.d.ts +6 -0
- package/dist/src/components/sandFall/index.d.ts +4 -0
- package/dist/src/components/scratchCard/index.d.ts +2 -0
- package/dist/src/components/slotMachine/index.d.ts +8 -0
- package/dist/src/components/smokeFog/index.d.ts +2 -0
- package/dist/src/components/springMass/index.d.ts +2 -0
- package/dist/src/components/turntable/index.d.ts +4 -0
- package/dist/src/components/weatherBackground/types.d.ts +4 -0
- package/package.json +11 -3
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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';
|
|
@@ -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
|
+
}
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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.
|
|
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
|
-
"
|
|
37
|
-
"
|
|
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": {
|