@cos-design/timeline-pulse 3.5.3 → 4.1.0

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 (110) hide show
  1. package/dist/core/index.d.ts +1 -0
  2. package/dist/core/index.js +54 -0
  3. package/dist/core/packages/shared/src/canvas-box.d.ts +18 -0
  4. package/dist/core/packages/shared/src/element-options.d.ts +19 -0
  5. package/dist/core/packages/shared/src/host-layout.d.ts +22 -0
  6. package/dist/core/packages/shared/src/index.d.ts +13 -0
  7. package/dist/core/packages/shared/src/math.d.ts +2 -0
  8. package/dist/core/packages/shared/src/photo.d.ts +15 -0
  9. package/dist/core/packages/shared/src/pointer.d.ts +14 -0
  10. package/dist/core/packages/shared/src/react/index.d.ts +30 -0
  11. package/dist/core/packages/shared/src/reduced-motion.d.ts +4 -0
  12. package/dist/core/packages/shared/src/size.d.ts +8 -0
  13. package/dist/{packages/shared/src/index.d.ts → core/packages/shared/src/visibility.d.ts} +0 -1
  14. package/dist/core/packages/timelinePulse/src/core.d.ts +1 -0
  15. package/dist/core/packages/timelinePulse/src/element.d.ts +1 -0
  16. package/dist/core/packages/timelinePulse/src/react.d.ts +3 -0
  17. package/dist/core/packages/timelinePulse/src/vue.d.ts +2 -0
  18. package/dist/core/src/components/timelinePulse/core/engine.d.ts +2 -0
  19. package/dist/core/src/components/timelinePulse/core/index.d.ts +2 -0
  20. package/dist/core/src/components/timelinePulse/core/types.d.ts +10 -0
  21. package/dist/core/src/components/timelinePulse/element/index.d.ts +13 -0
  22. package/dist/core/src/components/timelinePulse/index.d.ts +3 -0
  23. package/dist/core/src/components/timelinePulse/react/index.d.ts +4 -0
  24. package/dist/{src → core/src}/vite-env.d.ts +6 -0
  25. package/dist/element/element.css +1 -0
  26. package/dist/element/index.d.ts +1 -0
  27. package/dist/element/index.js +88 -0
  28. package/dist/element/packages/shared/src/canvas-box.d.ts +18 -0
  29. package/dist/element/packages/shared/src/element-options.d.ts +19 -0
  30. package/dist/element/packages/shared/src/host-layout.d.ts +22 -0
  31. package/dist/element/packages/shared/src/index.d.ts +13 -0
  32. package/dist/element/packages/shared/src/math.d.ts +2 -0
  33. package/dist/element/packages/shared/src/photo.d.ts +15 -0
  34. package/dist/element/packages/shared/src/pointer.d.ts +14 -0
  35. package/dist/element/packages/shared/src/react/index.d.ts +30 -0
  36. package/dist/element/packages/shared/src/reduced-motion.d.ts +4 -0
  37. package/dist/element/packages/shared/src/size.d.ts +8 -0
  38. package/dist/element/packages/shared/src/visibility.d.ts +2 -0
  39. package/dist/element/packages/timelinePulse/src/core.d.ts +1 -0
  40. package/dist/element/packages/timelinePulse/src/element.d.ts +1 -0
  41. package/dist/element/packages/timelinePulse/src/index.d.ts +3 -0
  42. package/dist/element/packages/timelinePulse/src/react.d.ts +3 -0
  43. package/dist/element/packages/timelinePulse/src/vue.d.ts +2 -0
  44. package/dist/element/src/components/timelinePulse/core/engine.d.ts +2 -0
  45. package/dist/element/src/components/timelinePulse/core/index.d.ts +2 -0
  46. package/dist/element/src/components/timelinePulse/core/types.d.ts +10 -0
  47. package/dist/element/src/components/timelinePulse/element/index.d.ts +13 -0
  48. package/dist/element/src/components/timelinePulse/index.d.ts +3 -0
  49. package/dist/element/src/components/timelinePulse/react/index.d.ts +4 -0
  50. package/dist/element/src/vite-env.d.ts +45 -0
  51. package/dist/react/index.cjs +1 -0
  52. package/dist/react/index.d.ts +3 -0
  53. package/dist/react/index.js +77 -0
  54. package/dist/react/packages/shared/src/canvas-box.d.ts +18 -0
  55. package/dist/react/packages/shared/src/element-options.d.ts +19 -0
  56. package/dist/react/packages/shared/src/host-layout.d.ts +22 -0
  57. package/dist/react/packages/shared/src/index.d.ts +13 -0
  58. package/dist/react/packages/shared/src/math.d.ts +2 -0
  59. package/dist/react/packages/shared/src/photo.d.ts +15 -0
  60. package/dist/react/packages/shared/src/pointer.d.ts +14 -0
  61. package/dist/react/packages/shared/src/react/index.d.ts +30 -0
  62. package/dist/react/packages/shared/src/reduced-motion.d.ts +4 -0
  63. package/dist/react/packages/shared/src/size.d.ts +8 -0
  64. package/dist/react/packages/shared/src/visibility.d.ts +2 -0
  65. package/dist/react/packages/timelinePulse/src/core.d.ts +1 -0
  66. package/dist/react/packages/timelinePulse/src/element.d.ts +1 -0
  67. package/dist/react/packages/timelinePulse/src/index.d.ts +3 -0
  68. package/dist/react/packages/timelinePulse/src/react.d.ts +3 -0
  69. package/dist/react/packages/timelinePulse/src/vue.d.ts +2 -0
  70. package/dist/react/react.css +1 -0
  71. package/dist/react/src/components/timelinePulse/core/engine.d.ts +2 -0
  72. package/dist/react/src/components/timelinePulse/core/index.d.ts +2 -0
  73. package/dist/react/src/components/timelinePulse/core/types.d.ts +10 -0
  74. package/dist/react/src/components/timelinePulse/element/index.d.ts +13 -0
  75. package/dist/react/src/components/timelinePulse/index.d.ts +3 -0
  76. package/dist/react/src/components/timelinePulse/react/index.d.ts +4 -0
  77. package/dist/react/src/vite-env.d.ts +45 -0
  78. package/dist/vue/index.d.ts +2 -0
  79. package/dist/vue/index.js +77 -0
  80. package/dist/vue/packages/shared/src/canvas-box.d.ts +18 -0
  81. package/dist/vue/packages/shared/src/element-options.d.ts +19 -0
  82. package/dist/vue/packages/shared/src/host-layout.d.ts +22 -0
  83. package/dist/vue/packages/shared/src/index.d.ts +13 -0
  84. package/dist/vue/packages/shared/src/math.d.ts +2 -0
  85. package/dist/vue/packages/shared/src/photo.d.ts +15 -0
  86. package/dist/vue/packages/shared/src/pointer.d.ts +14 -0
  87. package/dist/vue/packages/shared/src/react/index.d.ts +30 -0
  88. package/dist/vue/packages/shared/src/reduced-motion.d.ts +4 -0
  89. package/dist/vue/packages/shared/src/size.d.ts +8 -0
  90. package/dist/vue/packages/shared/src/visibility.d.ts +2 -0
  91. package/dist/vue/packages/timelinePulse/src/core.d.ts +1 -0
  92. package/dist/vue/packages/timelinePulse/src/element.d.ts +1 -0
  93. package/dist/vue/packages/timelinePulse/src/index.d.ts +3 -0
  94. package/dist/vue/packages/timelinePulse/src/react.d.ts +3 -0
  95. package/dist/vue/packages/timelinePulse/src/vue.d.ts +2 -0
  96. package/dist/vue/src/components/timelinePulse/core/engine.d.ts +2 -0
  97. package/dist/vue/src/components/timelinePulse/core/index.d.ts +2 -0
  98. package/dist/vue/src/components/timelinePulse/core/types.d.ts +10 -0
  99. package/dist/vue/src/components/timelinePulse/element/index.d.ts +13 -0
  100. package/dist/vue/src/components/timelinePulse/index.d.ts +3 -0
  101. package/dist/vue/src/components/timelinePulse/react/index.d.ts +4 -0
  102. package/dist/vue/src/vite-env.d.ts +45 -0
  103. package/dist/vue/vue.css +1 -0
  104. package/package.json +44 -12
  105. package/dist/index.cjs +0 -1
  106. package/dist/index.css +0 -1
  107. package/dist/index.d.ts +0 -3
  108. package/dist/index.js +0 -52
  109. package/dist/src/components/timelinePulse/index.d.ts +0 -8
  110. /package/dist/{packages → core/packages}/timelinePulse/src/index.d.ts +0 -0
@@ -0,0 +1,30 @@
1
+ import { CSSProperties, RefObject } from 'react';
2
+ import { ElementSize } from '../size';
3
+ export type { CanvasBoxSize, CanvasBoxSizeInput } from '../canvas-box';
4
+ export { resolveCanvasBoxSize } from '../canvas-box';
5
+ export interface UseElementSizeOptions {
6
+ /** 为 false 时不观察 */
7
+ enabled?: boolean;
8
+ }
9
+ /** 观察元素尺寸(clientWidth / clientHeight) */
10
+ export declare const useElementSize: <T extends Element>(ref: RefObject<T | null>, options?: UseElementSizeOptions) => ElementSize;
11
+ export interface UseCanvasBoxOptions {
12
+ /** 为 true 时铺满父容器(父级需有明确高度) */
13
+ fill?: boolean;
14
+ width?: number;
15
+ height?: number;
16
+ defaultWidth: number;
17
+ defaultHeight: number;
18
+ }
19
+ export interface UseCanvasBoxResult {
20
+ hostRef: RefObject<HTMLDivElement | null>;
21
+ width: number;
22
+ height: number;
23
+ /** 挂到宿主容器的样式(fill 时为 100%×100%) */
24
+ hostStyle: CSSProperties;
25
+ fill: boolean;
26
+ /** 是否处于 fill 模式且尚未量到有效尺寸 */
27
+ pending: boolean;
28
+ }
29
+ /** 画布/效果宿主尺寸:fill 时跟随父容器,否则用显式宽高或默认值 */
30
+ export declare const useCanvasBox: ({ fill, width: widthProp, height: heightProp, defaultWidth, defaultHeight, }: UseCanvasBoxOptions) => UseCanvasBoxResult;
@@ -0,0 +1,4 @@
1
+ /** 当前是否偏好减少动效 */
2
+ export declare const prefersReducedMotion: () => boolean;
3
+ /** 监听 prefers-reduced-motion 变化;返回取消订阅函数 */
4
+ export declare const bindPrefersReducedMotion: (onChange: (reduced: boolean) => void) => () => void;
@@ -0,0 +1,8 @@
1
+ export interface ElementSize {
2
+ width: number;
3
+ height: number;
4
+ }
5
+ /** 观察元素内容尺寸;返回取消订阅函数 */
6
+ export declare const observeElementSize: (element: Element, onChange: (size: ElementSize) => void, options?: {
7
+ box?: ResizeObserverBoxOptions;
8
+ }) => () => void;
@@ -0,0 +1,2 @@
1
+ /** 注册 visibilitychange,页面隐藏时暂停动画循环 */
2
+ export declare const bindVisibilityPause: (onChange: (paused: boolean) => void) => () => void;
@@ -0,0 +1 @@
1
+ export * from '../../../src/components/timelinePulse/core';
@@ -0,0 +1 @@
1
+ export * from '../../../src/components/timelinePulse/element';
@@ -0,0 +1,3 @@
1
+ export { default } from '../../../src/components/timelinePulse';
2
+ export { default as TimelinePulse } from '../../../src/components/timelinePulse';
3
+ export type * from '../../../src/components/timelinePulse';
@@ -0,0 +1,3 @@
1
+ export { default } from '../../../src/components/timelinePulse/react';
2
+ export { default as TimelinePulse } from '../../../src/components/timelinePulse/react';
3
+ export type * from '../../../src/components/timelinePulse/core/types';
@@ -0,0 +1,2 @@
1
+ export { default as TimelinePulse } from '../../../src/components/timelinePulse/vue/TimelinePulse.vue';
2
+ export type * from '../../../src/components/timelinePulse/core/types';
@@ -0,0 +1,2 @@
1
+ import { TimelinePulseController, TimelinePulseOptions } from './types';
2
+ export declare function createTimelinePulse(container: HTMLElement, initial?: TimelinePulseOptions): TimelinePulseController;
@@ -0,0 +1,2 @@
1
+ export { createTimelinePulse } from './engine';
2
+ export type { TimelinePulseController, TimelinePulseOptions, TimelinePulseProps } from './types';
@@ -0,0 +1,10 @@
1
+ export interface TimelinePulseOptions {
2
+ steps?: string[];
3
+ current?: number;
4
+ color?: string;
5
+ }
6
+ export interface TimelinePulseController {
7
+ update(o: Partial<TimelinePulseOptions>): void;
8
+ destroy(): void;
9
+ }
10
+ export type TimelinePulseProps = TimelinePulseOptions;
@@ -0,0 +1,13 @@
1
+ import { TimelinePulseOptions } from '../core';
2
+ declare const TAG = "cos-timeline-pulse";
3
+ declare class CosTimelinePulseElement extends HTMLElement {
4
+ private ctrl;
5
+ _steps?: TimelinePulseOptions['steps'];
6
+ get steps(): TimelinePulseOptions['steps'] | undefined;
7
+ set steps(value: TimelinePulseOptions['steps']);
8
+ static get observedAttributes(): string[];
9
+ connectedCallback(): void;
10
+ disconnectedCallback(): void;
11
+ attributeChangedCallback(): void;
12
+ }
13
+ export { CosTimelinePulseElement, TAG };
@@ -0,0 +1,3 @@
1
+ export { default } from './react';
2
+ export { default as TimelinePulse } from './react';
3
+ export type * from './core/types';
@@ -0,0 +1,4 @@
1
+ import { TimelinePulseOptions } from '../core';
2
+ export type { TimelinePulseOptions } from '../core/types';
3
+ declare const TimelinePulse: import('react').ForwardRefExoticComponent<TimelinePulseOptions & import('react').RefAttributes<unknown>>;
4
+ export default TimelinePulse;
@@ -0,0 +1,45 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ declare module '*.vue' {
4
+ import type { DefineComponent } from 'vue';
5
+ const component: DefineComponent<object, object, unknown>;
6
+ export default component;
7
+ }
8
+
9
+ declare module '*.module.less' {
10
+ const classes: { readonly [key: string]: string };
11
+ export default classes;
12
+ }
13
+
14
+ declare module '*.less' {
15
+ const classes: { readonly [key: string]: string };
16
+ export default classes;
17
+ }
18
+
19
+ declare module '*.png' {
20
+ const src: string;
21
+ export default src;
22
+ }
23
+
24
+ declare module '*.jpg' {
25
+ const src: string;
26
+ export default src;
27
+ }
28
+
29
+ declare module '*.mp4' {
30
+ const src: string;
31
+ export default src;
32
+ }
33
+
34
+ declare module '*.mp3' {
35
+ const src: string;
36
+ export default src;
37
+ }
38
+
39
+ declare module '*.svg' {
40
+ import type { FC, SVGProps } from 'react';
41
+
42
+ export const ReactComponent: FC<SVGProps<SVGSVGElement>>;
43
+ const src: string;
44
+ export default src;
45
+ }
@@ -0,0 +1 @@
1
+ .cos-timelinePulse-host,cos-timeline-pulse{justify-content:center;width:100%;display:flex}.cos-timeline-pulse{--dot-size:14px;--line-inset:calc(100% / var(--step-count,4) / 2);box-sizing:border-box;width:min(100%,560px);min-width:280px;margin-inline:auto;padding:24px 16px}.cos-timeline-pulse__axis{position:relative}.cos-timeline-pulse__track,.cos-timeline-pulse__progress{top:calc(var(--dot-size) / 2);left:var(--line-inset);pointer-events:none;border-radius:2px;height:3px;position:absolute;transform:translateY(-50%)}.cos-timeline-pulse__track{right:var(--line-inset);background:#94a3b833}.cos-timeline-pulse__progress{width:calc((100% - 2 * var(--line-inset)) * var(--progress-ratio,0));background:var(--pulse-color,#22d3ee);transition:width .4s}.cos-timeline-pulse__steps{z-index:1;justify-content:space-between;margin:0;padding:0;list-style:none;display:flex;position:relative}.cos-timeline-pulse__step{flex-direction:column;flex:1;align-items:center;gap:10px;min-width:0;display:flex}.cos-timeline-pulse__dot{box-sizing:border-box;width:var(--dot-size);height:var(--dot-size);background:#1e293b;border:2px solid #475569;border-radius:50%;transition:background .3s,border-color .3s,box-shadow .3s}.cos-timeline-pulse__step[data-state=done] .cos-timeline-pulse__dot{background:var(--pulse-color,#22d3ee);border-color:var(--pulse-color,#22d3ee);box-shadow:0 0 8px color-mix(in srgb, var(--pulse-color,#22d3ee) 50%, transparent)}.cos-timeline-pulse__step[data-state=current] .cos-timeline-pulse__dot{background:var(--pulse-color,#22d3ee);border-color:var(--pulse-color,#22d3ee);animation:1.5s ease-in-out infinite pulse}.cos-timeline-pulse__name{color:#94a3b8;text-align:center;white-space:nowrap;text-overflow:ellipsis;max-width:72px;font-size:12px;overflow:hidden}.cos-timeline-pulse__step[data-state=current] .cos-timeline-pulse__name,.cos-timeline-pulse__step[data-state=done] .cos-timeline-pulse__name{color:#e2e8f0}@keyframes pulse{0%,to{box-shadow:0 0 0 0 color-mix(in srgb, var(--pulse-color,#22d3ee) 50%, transparent)}50%{box-shadow:0 0 0 6px #0000}}
package/package.json CHANGED
@@ -1,20 +1,38 @@
1
1
  {
2
2
  "name": "@cos-design/timeline-pulse",
3
- "version": "3.5.3",
3
+ "version": "4.1.0",
4
4
  "description": "TimelinePulse component from cos-design",
5
5
  "type": "module",
6
- "main": "./dist/index.cjs",
7
- "module": "./dist/index.js",
8
- "types": "./dist/index.d.ts",
6
+ "main": "./dist/react/index.cjs",
7
+ "module": "./dist/react/index.js",
8
+ "types": "./dist/react/index.d.ts",
9
9
  "exports": {
10
10
  ".": {
11
11
  "import": {
12
- "types": "./dist/index.d.ts",
13
- "default": "./dist/index.js"
12
+ "types": "./dist/react/index.d.ts",
13
+ "default": "./dist/react/index.js"
14
14
  },
15
15
  "require": {
16
- "types": "./dist/index.d.ts",
17
- "default": "./dist/index.cjs"
16
+ "types": "./dist/react/index.d.ts",
17
+ "default": "./dist/react/index.cjs"
18
+ }
19
+ },
20
+ "./vue": {
21
+ "import": {
22
+ "types": "./dist/vue/index.d.ts",
23
+ "default": "./dist/vue/index.js"
24
+ }
25
+ },
26
+ "./core": {
27
+ "import": {
28
+ "types": "./dist/core/index.d.ts",
29
+ "default": "./dist/core/index.js"
30
+ }
31
+ },
32
+ "./element": {
33
+ "import": {
34
+ "types": "./dist/element/index.d.ts",
35
+ "default": "./dist/element/index.js"
18
36
  }
19
37
  }
20
38
  },
@@ -24,11 +42,13 @@
24
42
  ],
25
43
  "sideEffects": [
26
44
  "**/*.css",
27
- "**/*.less"
45
+ "**/*.less",
46
+ "./dist/element/index.js"
28
47
  ],
29
48
  "keywords": [
30
49
  "cos-design",
31
50
  "react",
51
+ "vue",
32
52
  "timelinePulse",
33
53
  "TimelinePulse"
34
54
  ],
@@ -45,13 +65,25 @@
45
65
  "license": "MIT",
46
66
  "peerDependencies": {
47
67
  "react": ">=18.0.0",
48
- "react-dom": ">=18.0.0"
68
+ "react-dom": ">=18.0.0",
69
+ "vue": ">=3.4.0"
49
70
  },
50
71
  "publishConfig": {
51
72
  "access": "public",
52
73
  "registry": "https://registry.npmjs.org"
53
74
  },
75
+ "peerDependenciesMeta": {
76
+ "react": {
77
+ "optional": true
78
+ },
79
+ "react-dom": {
80
+ "optional": true
81
+ },
82
+ "vue": {
83
+ "optional": true
84
+ }
85
+ },
54
86
  "dependencies": {
55
- "@cos-design/shared": "3.5.3"
87
+ "@cos-design/shared": "4.1.0"
56
88
  }
57
- }
89
+ }
package/dist/index.cjs DELETED
@@ -1 +0,0 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require("react");require('./index.css');let e=require("@cos-design/shared"),t=require("react/jsx-runtime");var n={timelinePulse:`cos-timelinePulse-kcBM6`,axis:`cos-axis-9DWis`,track:`cos-track-jG-HV`,progress:`cos-progress-gf7v1`,steps:`cos-steps-Z-40O`,step:`cos-step-UO2Ux`,dot:`cos-dot-HJEVy`,pulse:`cos-pulse-N6FD1`,name:`cos-name-7zefJ`},r=({steps:r=[`Start`,`Process`,`Review`,`Done`],current:i=0,color:a=`#22d3ee`})=>{let o=(0,e.clamp)(i,0,Math.max(0,r.length-1)),s=r.length>1?o/(r.length-1):0;return(0,t.jsx)(`div`,{className:n.timelinePulse,style:{"--pulse-color":a,"--step-count":r.length,"--progress-ratio":s},children:(0,t.jsxs)(`div`,{className:n.axis,children:[(0,t.jsx)(`div`,{className:n.track}),(0,t.jsx)(`div`,{className:n.progress}),(0,t.jsx)(`ul`,{className:n.steps,children:r.map((e,r)=>{let i=r<o?`done`:r===o?`current`:`pending`;return(0,t.jsxs)(`li`,{className:n.step,"data-state":i,children:[(0,t.jsx)(`span`,{className:n.dot}),(0,t.jsx)(`span`,{className:n.name,children:e})]},e+r)})})]})})};exports.TimelinePulse=r,exports.default=r;
package/dist/index.css DELETED
@@ -1 +0,0 @@
1
- .cos-timelinePulse-kcBM6{--dot-size:14px;--line-inset:calc(100% / var(--step-count,4) / 2);min-width:280px;padding:24px 16px}.cos-axis-9DWis{position:relative}.cos-track-jG-HV,.cos-progress-gf7v1{top:calc(var(--dot-size) / 2);left:var(--line-inset);pointer-events:none;border-radius:2px;height:3px;position:absolute;transform:translateY(-50%)}.cos-track-jG-HV{right:var(--line-inset);background:#94a3b833}.cos-progress-gf7v1{width:calc((100% - 2 * var(--line-inset)) * var(--progress-ratio,0));background:var(--pulse-color,#22d3ee);transition:width .4s}.cos-steps-Z-40O{z-index:1;justify-content:space-between;margin:0;padding:0;list-style:none;display:flex;position:relative}.cos-step-UO2Ux{flex-direction:column;flex:1;align-items:center;gap:10px;min-width:0;display:flex}.cos-dot-HJEVy{box-sizing:border-box;width:var(--dot-size);height:var(--dot-size);background:#1e293b;border:2px solid #475569;border-radius:50%;transition:background .3s,border-color .3s,box-shadow .3s}.cos-step-UO2Ux[data-state=done] .cos-dot-HJEVy{background:var(--pulse-color,#22d3ee);border-color:var(--pulse-color,#22d3ee);box-shadow:0 0 8px color-mix(in srgb, var(--pulse-color,#22d3ee) 50%, transparent)}.cos-step-UO2Ux[data-state=current] .cos-dot-HJEVy{background:var(--pulse-color,#22d3ee);border-color:var(--pulse-color,#22d3ee);animation:1.5s ease-in-out infinite cos-pulse-N6FD1}.cos-name-7zefJ{color:#94a3b8;text-align:center;white-space:nowrap;text-overflow:ellipsis;max-width:72px;font-size:12px;overflow:hidden}.cos-step-UO2Ux[data-state=current] .cos-name-7zefJ,.cos-step-UO2Ux[data-state=done] .cos-name-7zefJ{color:#e2e8f0}@keyframes cos-pulse-N6FD1{0%,to{box-shadow:0 0 0 0 color-mix(in srgb, var(--pulse-color,#22d3ee) 50%, transparent)}50%{box-shadow:0 0 0 6px #0000}}
package/dist/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export { default } from './src/components/timelinePulse/index';
2
- export { default as TimelinePulse } from './src/components/timelinePulse/index';
3
- export type * from './src/components/timelinePulse/index';
package/dist/index.js DELETED
@@ -1,52 +0,0 @@
1
- import "react";
2
- import { clamp as e } from "@cos-design/shared";
3
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
4
- import './index.css';var r = {
5
- timelinePulse: "cos-timelinePulse-kcBM6",
6
- axis: "cos-axis-9DWis",
7
- track: "cos-track-jG-HV",
8
- progress: "cos-progress-gf7v1",
9
- steps: "cos-steps-Z-40O",
10
- step: "cos-step-UO2Ux",
11
- dot: "cos-dot-HJEVy",
12
- pulse: "cos-pulse-N6FD1",
13
- name: "cos-name-7zefJ"
14
- }, i = ({ steps: i = [
15
- "Start",
16
- "Process",
17
- "Review",
18
- "Done"
19
- ], current: a = 0, color: o = "#22d3ee" }) => {
20
- let s = e(a, 0, Math.max(0, i.length - 1)), c = i.length > 1 ? s / (i.length - 1) : 0;
21
- return /* @__PURE__ */ t("div", {
22
- className: r.timelinePulse,
23
- style: {
24
- "--pulse-color": o,
25
- "--step-count": i.length,
26
- "--progress-ratio": c
27
- },
28
- children: /* @__PURE__ */ n("div", {
29
- className: r.axis,
30
- children: [
31
- /* @__PURE__ */ t("div", { className: r.track }),
32
- /* @__PURE__ */ t("div", { className: r.progress }),
33
- /* @__PURE__ */ t("ul", {
34
- className: r.steps,
35
- children: i.map((e, i) => {
36
- let a = i < s ? "done" : i === s ? "current" : "pending";
37
- return /* @__PURE__ */ n("li", {
38
- className: r.step,
39
- "data-state": a,
40
- children: [/* @__PURE__ */ t("span", { className: r.dot }), /* @__PURE__ */ t("span", {
41
- className: r.name,
42
- children: e
43
- })]
44
- }, e + i);
45
- })
46
- })
47
- ]
48
- })
49
- });
50
- };
51
- //#endregion
52
- export { i as TimelinePulse, i as default };
@@ -1,8 +0,0 @@
1
- import { default as React } from 'react';
2
- export interface TimelinePulseProps {
3
- steps?: string[];
4
- current?: number;
5
- color?: string;
6
- }
7
- declare const TimelinePulse: React.FC<TimelinePulseProps>;
8
- export default TimelinePulse;