@cos-design/timeline-pulse 3.5.2 → 4.0.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.
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +54 -0
- package/dist/core/packages/shared/src/canvas-box.d.ts +18 -0
- package/dist/core/packages/shared/src/host-layout.d.ts +22 -0
- package/dist/core/packages/shared/src/index.d.ts +11 -0
- package/dist/core/packages/shared/src/math.d.ts +2 -0
- package/dist/core/packages/shared/src/photo.d.ts +15 -0
- package/dist/core/packages/shared/src/pointer.d.ts +14 -0
- package/dist/core/packages/shared/src/react/index.d.ts +30 -0
- package/dist/core/packages/shared/src/reduced-motion.d.ts +4 -0
- package/dist/core/packages/shared/src/size.d.ts +8 -0
- package/dist/{packages/shared/src/index.d.ts → core/packages/shared/src/visibility.d.ts} +0 -1
- package/dist/core/packages/timelinePulse/src/core.d.ts +1 -0
- package/dist/core/packages/timelinePulse/src/element.d.ts +1 -0
- package/dist/core/packages/timelinePulse/src/react.d.ts +3 -0
- package/dist/core/packages/timelinePulse/src/vue.d.ts +2 -0
- package/dist/core/src/components/timelinePulse/core/engine.d.ts +2 -0
- package/dist/core/src/components/timelinePulse/core/index.d.ts +2 -0
- package/dist/core/src/components/timelinePulse/core/types.d.ts +10 -0
- package/dist/core/src/components/timelinePulse/element/index.d.ts +13 -0
- package/dist/core/src/components/timelinePulse/index.d.ts +3 -0
- package/dist/core/src/components/timelinePulse/react/index.d.ts +4 -0
- package/dist/{src → core/src}/vite-env.d.ts +6 -0
- package/dist/element/element.css +1 -0
- package/dist/element/index.d.ts +1 -0
- package/dist/element/index.js +92 -0
- package/dist/element/packages/shared/src/canvas-box.d.ts +18 -0
- package/dist/element/packages/shared/src/host-layout.d.ts +22 -0
- package/dist/element/packages/shared/src/index.d.ts +11 -0
- package/dist/element/packages/shared/src/math.d.ts +2 -0
- package/dist/element/packages/shared/src/photo.d.ts +15 -0
- package/dist/element/packages/shared/src/pointer.d.ts +14 -0
- package/dist/element/packages/shared/src/react/index.d.ts +30 -0
- package/dist/element/packages/shared/src/reduced-motion.d.ts +4 -0
- package/dist/element/packages/shared/src/size.d.ts +8 -0
- package/dist/element/packages/shared/src/visibility.d.ts +2 -0
- package/dist/element/packages/timelinePulse/src/core.d.ts +1 -0
- package/dist/element/packages/timelinePulse/src/element.d.ts +1 -0
- package/dist/element/packages/timelinePulse/src/index.d.ts +3 -0
- package/dist/element/packages/timelinePulse/src/react.d.ts +3 -0
- package/dist/element/packages/timelinePulse/src/vue.d.ts +2 -0
- package/dist/element/src/components/timelinePulse/core/engine.d.ts +2 -0
- package/dist/element/src/components/timelinePulse/core/index.d.ts +2 -0
- package/dist/element/src/components/timelinePulse/core/types.d.ts +10 -0
- package/dist/element/src/components/timelinePulse/element/index.d.ts +13 -0
- package/dist/element/src/components/timelinePulse/index.d.ts +3 -0
- package/dist/element/src/components/timelinePulse/react/index.d.ts +4 -0
- package/dist/element/src/vite-env.d.ts +45 -0
- package/dist/react/index.cjs +1 -0
- package/dist/react/index.d.ts +3 -0
- package/dist/react/index.js +77 -0
- package/dist/react/packages/shared/src/canvas-box.d.ts +18 -0
- package/dist/react/packages/shared/src/host-layout.d.ts +22 -0
- package/dist/react/packages/shared/src/index.d.ts +11 -0
- package/dist/react/packages/shared/src/math.d.ts +2 -0
- package/dist/react/packages/shared/src/photo.d.ts +15 -0
- package/dist/react/packages/shared/src/pointer.d.ts +14 -0
- package/dist/react/packages/shared/src/react/index.d.ts +30 -0
- package/dist/react/packages/shared/src/reduced-motion.d.ts +4 -0
- package/dist/react/packages/shared/src/size.d.ts +8 -0
- package/dist/react/packages/shared/src/visibility.d.ts +2 -0
- package/dist/react/packages/timelinePulse/src/core.d.ts +1 -0
- package/dist/react/packages/timelinePulse/src/element.d.ts +1 -0
- package/dist/react/packages/timelinePulse/src/index.d.ts +3 -0
- package/dist/react/packages/timelinePulse/src/react.d.ts +3 -0
- package/dist/react/packages/timelinePulse/src/vue.d.ts +2 -0
- package/dist/react/react.css +1 -0
- package/dist/react/src/components/timelinePulse/core/engine.d.ts +2 -0
- package/dist/react/src/components/timelinePulse/core/index.d.ts +2 -0
- package/dist/react/src/components/timelinePulse/core/types.d.ts +10 -0
- package/dist/react/src/components/timelinePulse/element/index.d.ts +13 -0
- package/dist/react/src/components/timelinePulse/index.d.ts +3 -0
- package/dist/react/src/components/timelinePulse/react/index.d.ts +4 -0
- package/dist/react/src/vite-env.d.ts +45 -0
- package/dist/vue/index.d.ts +2 -0
- package/dist/vue/index.js +77 -0
- package/dist/vue/packages/shared/src/canvas-box.d.ts +18 -0
- package/dist/vue/packages/shared/src/host-layout.d.ts +22 -0
- package/dist/vue/packages/shared/src/index.d.ts +11 -0
- package/dist/vue/packages/shared/src/math.d.ts +2 -0
- package/dist/vue/packages/shared/src/photo.d.ts +15 -0
- package/dist/vue/packages/shared/src/pointer.d.ts +14 -0
- package/dist/vue/packages/shared/src/react/index.d.ts +30 -0
- package/dist/vue/packages/shared/src/reduced-motion.d.ts +4 -0
- package/dist/vue/packages/shared/src/size.d.ts +8 -0
- package/dist/vue/packages/shared/src/visibility.d.ts +2 -0
- package/dist/vue/packages/timelinePulse/src/core.d.ts +1 -0
- package/dist/vue/packages/timelinePulse/src/element.d.ts +1 -0
- package/dist/vue/packages/timelinePulse/src/index.d.ts +3 -0
- package/dist/vue/packages/timelinePulse/src/react.d.ts +3 -0
- package/dist/vue/packages/timelinePulse/src/vue.d.ts +2 -0
- package/dist/vue/src/components/timelinePulse/core/engine.d.ts +2 -0
- package/dist/vue/src/components/timelinePulse/core/index.d.ts +2 -0
- package/dist/vue/src/components/timelinePulse/core/types.d.ts +10 -0
- package/dist/vue/src/components/timelinePulse/element/index.d.ts +13 -0
- package/dist/vue/src/components/timelinePulse/index.d.ts +3 -0
- package/dist/vue/src/components/timelinePulse/react/index.d.ts +4 -0
- package/dist/vue/src/vite-env.d.ts +45 -0
- package/dist/vue/vue.css +1 -0
- package/package.json +43 -11
- package/dist/index.cjs +0 -1
- package/dist/index.css +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -52
- package/dist/src/components/timelinePulse/index.d.ts +0 -8
- /package/dist/{packages → core/packages}/timelinePulse/src/index.d.ts +0 -0
|
@@ -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
|
+
}
|
package/dist/vue/vue.css
ADDED
|
@@ -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
|
+
"version": "4.0.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": "
|
|
87
|
+
"@cos-design/shared": "4.0.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
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 };
|
|
File without changes
|