cos-design 3.7.8 → 3.7.9

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/index.js CHANGED
@@ -1448,7 +1448,7 @@ var Oe = {
1448
1448
  kicker: "cos-kicker-H-OGk",
1449
1449
  title: "cos-title-XTDn7",
1450
1450
  subtitle: "cos-subtitle-2YmXW"
1451
- }, ke = t(function({ frontTitle: e = "签到翻牌", frontSubtitle: t = "点击翻开今日奖励", backTitle: n = "恭喜获得", backSubtitle: r = "积分 +20", flipped: i, defaultFlipped: o = !1, onReveal: s, onFlipChange: l, disabled: f = !1 }, p) {
1451
+ }, ke = t(({ frontTitle: e = "签到翻牌", frontSubtitle: t = "点击翻开今日奖励", backTitle: n = "恭喜获得", backSubtitle: r = "积分 +20", flipped: i, defaultFlipped: o = !1, onReveal: s, onFlipChange: l, disabled: f = !1 }, p) => {
1452
1452
  let [m, h] = c(o), g = typeof i == "boolean", _ = g ? !!i : m, v = (e, t) => {
1453
1453
  g || h(e), l?.(e), e && t && s?.();
1454
1454
  };
@@ -1508,7 +1508,9 @@ var Oe = {
1508
1508
  })]
1509
1509
  })
1510
1510
  });
1511
- }), Ae = {
1511
+ });
1512
+ ke.displayName = "FlipCard";
1513
+ var Ae = {
1512
1514
  flipCounter: "cos-flipCounter-3LuI0",
1513
1515
  digit: "cos-digit-yJRPy",
1514
1516
  digitCard: "cos-digitCard-zZUzt",
@@ -2881,7 +2883,7 @@ var Oe = {
2881
2883
  let t = [...e?.length ? e : Dt];
2882
2884
  for (; t.length < 9;) t.push({ label: `奖品 ${t.length + 1}` });
2883
2885
  return t.slice(0, 9);
2884
- }, kt = t(function({ items: e, targetIndex: t, buttonText: i = "开始抽奖", onDrawEnd: o, disabled: l = !1 }, f) {
2886
+ }, kt = t(({ items: e = Dt, targetIndex: t, buttonText: i = "开始抽奖", onDrawEnd: o, disabled: l = !1 }, f) => {
2885
2887
  let p = Ot(e), [m, h] = c(null), [g, _] = c(null), [v, y] = c(!1), b = s([]), x = s(o), S = s(t);
2886
2888
  r(() => {
2887
2889
  x.current = o;
@@ -2943,7 +2945,9 @@ var Oe = {
2943
2945
  children: v ? "抽奖中…" : i
2944
2946
  })]
2945
2947
  });
2946
- }), At = {
2948
+ });
2949
+ kt.displayName = "NineGrid";
2950
+ var At = {
2947
2951
  orbitalChart: "cos-orbitalChart-XLORB",
2948
2952
  canvas: "cos-canvas-hGVud",
2949
2953
  legend: "cos-legend-Np9Mm",
@@ -1,26 +1,28 @@
1
1
  import { default as React } from 'react';
2
2
  export interface FlipCardHandle {
3
+ /** 翻到背面(揭示奖励) */
3
4
  flip: () => void;
5
+ /** 翻回正面 */
4
6
  reset: () => void;
5
7
  }
6
8
  export interface FlipCardProps {
7
- /** Front face title (e.g. Day 3) */
9
+ /** 正面标题 */
8
10
  frontTitle?: string;
9
- /** Front face subtitle */
11
+ /** 正面副标题 */
10
12
  frontSubtitle?: string;
11
- /** Back face reward title */
13
+ /** 背面奖励标题 */
12
14
  backTitle?: string;
13
- /** Back face detail */
15
+ /** 背面奖励说明 */
14
16
  backSubtitle?: string;
15
- /** Controlled flip; omit for uncontrolled */
17
+ /** 受控翻面状态;不传则非受控 */
16
18
  flipped?: boolean;
17
- /** Initial flip when uncontrolled */
19
+ /** 非受控时的初始翻面状态,默认 false */
18
20
  defaultFlipped?: boolean;
19
- /** Called after flip toggles to true (reveal) */
21
+ /** 翻到背面时回调 */
20
22
  onReveal?: () => void;
21
- /** Called on any flip change */
23
+ /** 翻面状态变化回调 */
22
24
  onFlipChange?: (flipped: boolean) => void;
23
- /** Disable clicking the card */
25
+ /** 禁用点击 */
24
26
  disabled?: boolean;
25
27
  }
26
28
  declare const FlipCard: React.ForwardRefExoticComponent<FlipCardProps & React.RefAttributes<FlipCardHandle>>;
@@ -1,24 +1,26 @@
1
1
  import { default as React } from 'react';
2
2
  export interface NineGridItem {
3
+ /** 奖品文案 */
3
4
  label: string;
4
- /** Optional emoji / short mark shown above the label */
5
+ /** 可选图标(emoji 等),显示在文案上方 */
5
6
  icon?: string;
6
7
  }
7
8
  export interface NineGridHandle {
8
- /** Start a draw. Optional override for server-drawn index. */
9
+ /** 开始抽奖;可传入目标索引覆盖 props.targetIndex */
9
10
  draw: (targetIndex?: number) => void;
11
+ /** 重置高亮与中奖态 */
10
12
  reset: () => void;
11
13
  }
12
14
  export interface NineGridProps {
13
- /** Exactly 9 prize cells (or will be padded/truncated to 9) */
15
+ /** 9 个奖品格子(不足补齐、超出截断) */
14
16
  items?: NineGridItem[];
15
- /** Next winning index 0–8 (server draw). Omit for random. */
17
+ /** 指定下一次抽中的索引 0–8(服务端开奖);不传则随机 */
16
18
  targetIndex?: number;
17
- /** Draw button label */
19
+ /** 抽奖按钮文案 */
18
20
  buttonText?: string;
19
- /** Called when the highlight settles on a cell */
21
+ /** 抽奖结束回调 */
20
22
  onDrawEnd?: (item: NineGridItem, index: number) => void;
21
- /** Disable interaction while drawing */
23
+ /** 禁用交互 */
22
24
  disabled?: boolean;
23
25
  }
24
26
  declare const NineGrid: React.ForwardRefExoticComponent<NineGridProps & React.RefAttributes<NineGridHandle>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cos-design",
3
- "version": "3.7.8",
3
+ "version": "3.7.9",
4
4
  "description": "React visual-effect components for marketing pages, campaigns, canvas backgrounds, and creative showcases",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",