premium-react-loaders 1.0.2 → 1.2.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/README.md +55 -6
- package/dist/components/progress/ProgressBar.d.ts.map +1 -1
- package/dist/components/progress/ProgressCircle.d.ts.map +1 -1
- package/dist/components/progress/ProgressRing.d.ts.map +1 -1
- package/dist/components/progress/ProgressSteps.d.ts +16 -0
- package/dist/components/progress/ProgressSteps.d.ts.map +1 -0
- package/dist/components/progress/index.d.ts +1 -0
- package/dist/components/progress/index.d.ts.map +1 -1
- package/dist/components/pulse/PulseBars.d.ts +2 -2
- package/dist/components/pulse/PulseBars.d.ts.map +1 -1
- package/dist/components/pulse/PulseDots.d.ts +2 -2
- package/dist/components/pulse/PulseDots.d.ts.map +1 -1
- package/dist/components/pulse/PulseWave.d.ts +2 -2
- package/dist/components/pulse/PulseWave.d.ts.map +1 -1
- package/dist/components/pulse/TypingIndicator.d.ts +16 -0
- package/dist/components/pulse/TypingIndicator.d.ts.map +1 -0
- package/dist/components/pulse/index.d.ts +1 -0
- package/dist/components/pulse/index.d.ts.map +1 -1
- package/dist/components/skeleton/SkeletonForm.d.ts +16 -0
- package/dist/components/skeleton/SkeletonForm.d.ts.map +1 -0
- package/dist/components/skeleton/index.d.ts +1 -0
- package/dist/components/skeleton/index.d.ts.map +1 -1
- package/dist/components/spinner/SpinnerBars.d.ts +2 -2
- package/dist/components/spinner/SpinnerBars.d.ts.map +1 -1
- package/dist/components/spinner/SpinnerCircle.d.ts +2 -1
- package/dist/components/spinner/SpinnerCircle.d.ts.map +1 -1
- package/dist/components/spinner/SpinnerDots.d.ts +2 -2
- package/dist/components/spinner/SpinnerDots.d.ts.map +1 -1
- package/dist/components/spinner/SpinnerGrid.d.ts +2 -2
- package/dist/components/spinner/SpinnerGrid.d.ts.map +1 -1
- package/dist/components/spinner/SpinnerPulse.d.ts +15 -0
- package/dist/components/spinner/SpinnerPulse.d.ts.map +1 -0
- package/dist/components/spinner/SpinnerRing.d.ts +3 -3
- package/dist/components/spinner/SpinnerRing.d.ts.map +1 -1
- package/dist/components/spinner/SpinnerWave.d.ts +15 -0
- package/dist/components/spinner/SpinnerWave.d.ts.map +1 -0
- package/dist/components/spinner/index.d.ts +2 -0
- package/dist/components/spinner/index.d.ts.map +1 -1
- package/dist/index.cjs +23 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +23 -13
- package/dist/index.js.map +1 -1
- package/dist/index13.cjs +54 -35
- package/dist/index13.cjs.map +1 -1
- package/dist/index13.js +56 -37
- package/dist/index13.js.map +1 -1
- package/dist/index14.cjs +29 -12
- package/dist/index14.cjs.map +1 -1
- package/dist/index14.js +30 -13
- package/dist/index14.js.map +1 -1
- package/dist/index15.cjs +19 -36
- package/dist/index15.cjs.map +1 -1
- package/dist/index15.js +19 -36
- package/dist/index15.js.map +1 -1
- package/dist/index16.cjs +47 -24
- package/dist/index16.cjs.map +1 -1
- package/dist/index16.js +48 -25
- package/dist/index16.js.map +1 -1
- package/dist/index17.cjs +29 -38
- package/dist/index17.cjs.map +1 -1
- package/dist/index17.js +29 -38
- package/dist/index17.js.map +1 -1
- package/dist/index18.cjs +52 -79
- package/dist/index18.cjs.map +1 -1
- package/dist/index18.js +54 -81
- package/dist/index18.js.map +1 -1
- package/dist/index19.cjs +45 -104
- package/dist/index19.cjs.map +1 -1
- package/dist/index19.js +46 -105
- package/dist/index19.js.map +1 -1
- package/dist/index20.cjs +58 -108
- package/dist/index20.cjs.map +1 -1
- package/dist/index20.js +60 -110
- package/dist/index20.js.map +1 -1
- package/dist/index21.cjs +79 -28
- package/dist/index21.cjs.map +1 -1
- package/dist/index21.js +82 -31
- package/dist/index21.js.map +1 -1
- package/dist/index22.cjs +106 -32
- package/dist/index22.cjs.map +1 -1
- package/dist/index22.js +108 -34
- package/dist/index22.js.map +1 -1
- package/dist/index23.cjs +112 -34
- package/dist/index23.cjs.map +1 -1
- package/dist/index23.js +115 -37
- package/dist/index23.js.map +1 -1
- package/dist/index24.cjs +108 -48
- package/dist/index24.cjs.map +1 -1
- package/dist/index24.js +110 -50
- package/dist/index24.js.map +1 -1
- package/dist/index25.cjs +59 -16
- package/dist/index25.cjs.map +1 -1
- package/dist/index25.js +58 -15
- package/dist/index25.js.map +1 -1
- package/dist/index26.cjs +66 -0
- package/dist/index26.cjs.map +1 -0
- package/dist/index26.js +66 -0
- package/dist/index26.js.map +1 -0
- package/dist/index27.cjs +69 -0
- package/dist/index27.cjs.map +1 -0
- package/dist/index27.js +69 -0
- package/dist/index27.js.map +1 -0
- package/dist/index28.cjs +65 -0
- package/dist/index28.cjs.map +1 -0
- package/dist/index28.js +65 -0
- package/dist/index28.js.map +1 -0
- package/dist/index29.cjs +71 -0
- package/dist/index29.cjs.map +1 -0
- package/dist/index29.js +71 -0
- package/dist/index29.js.map +1 -0
- package/dist/index3.cjs +1 -1
- package/dist/index3.js +1 -1
- package/dist/index30.cjs +18 -0
- package/dist/index30.cjs.map +1 -0
- package/dist/index30.js +18 -0
- package/dist/index30.js.map +1 -0
- package/dist/index31.cjs +42 -0
- package/dist/index31.cjs.map +1 -0
- package/dist/index31.js +42 -0
- package/dist/index31.js.map +1 -0
- package/dist/index4.cjs +10 -0
- package/dist/index4.cjs.map +1 -1
- package/dist/index4.js +10 -0
- package/dist/index4.js.map +1 -1
- package/dist/premium-react-loaders.css +299 -3
- package/dist/types/common.d.ts +14 -2
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/progress.d.ts +24 -1
- package/dist/types/progress.d.ts.map +1 -1
- package/dist/types/pulse.d.ts +13 -0
- package/dist/types/pulse.d.ts.map +1 -1
- package/dist/types/skeleton.d.ts +17 -0
- package/dist/types/skeleton.d.ts.map +1 -1
- package/dist/types/spinner.d.ts +18 -0
- package/dist/types/spinner.d.ts.map +1 -1
- package/dist/utils/colors.d.ts +2 -1
- package/dist/utils/colors.d.ts.map +1 -1
- package/dist/utils/hooks.d.ts +10 -0
- package/dist/utils/hooks.d.ts.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index23.js
CHANGED
|
@@ -1,64 +1,142 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
|
-
import {
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useMemo } from "react";
|
|
3
|
+
import { useReducedMotion, getEffectiveDuration } from "./index31.js";
|
|
4
|
+
import { normalizeSize, parseSizeToNumber } from "./index4.js";
|
|
4
5
|
import { cn } from "./index3.js";
|
|
5
|
-
const
|
|
6
|
+
const ProgressRing = forwardRef(
|
|
6
7
|
({
|
|
7
|
-
|
|
8
|
+
value = 0,
|
|
9
|
+
indeterminate = false,
|
|
10
|
+
showValue = false,
|
|
11
|
+
size = "lg",
|
|
12
|
+
thickness = 4,
|
|
8
13
|
color = "#3b82f6",
|
|
9
|
-
|
|
14
|
+
secondaryColor = "#e0e0e0",
|
|
15
|
+
gradient = false,
|
|
16
|
+
buffer,
|
|
10
17
|
speed = "normal",
|
|
18
|
+
reverse = false,
|
|
19
|
+
respectMotionPreference = true,
|
|
11
20
|
className,
|
|
12
21
|
style,
|
|
13
|
-
testId = "
|
|
22
|
+
testId = "progress-ring",
|
|
14
23
|
visible = true,
|
|
15
|
-
ariaLabel
|
|
24
|
+
ariaLabel,
|
|
16
25
|
...rest
|
|
17
26
|
}, ref) => {
|
|
18
27
|
if (!visible) return null;
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
|
|
28
|
+
const prefersReducedMotion = useReducedMotion();
|
|
29
|
+
const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
30
|
+
const clampedValue = Math.min(100, Math.max(0, value));
|
|
31
|
+
const clampedBuffer = buffer !== void 0 ? Math.min(100, Math.max(0, buffer)) : void 0;
|
|
32
|
+
const sizeValue = parseSizeToNumber(size, 56);
|
|
33
|
+
const thicknessValue = parseSizeToNumber(thickness, 4);
|
|
34
|
+
const radius = (sizeValue - thicknessValue * 2) / 2;
|
|
35
|
+
const circumference = 2 * Math.PI * radius;
|
|
36
|
+
const strokeDashoffset = circumference - clampedValue / 100 * circumference;
|
|
37
|
+
const bufferDashoffset = clampedBuffer !== void 0 ? circumference - clampedBuffer / 100 * circumference : void 0;
|
|
38
|
+
const progressLabel = ariaLabel || `Loading ${clampedValue}%`;
|
|
39
|
+
const gradientId = useMemo(() => `progress-gradient-${Math.random().toString(36).substr(2, 9)}`, []);
|
|
40
|
+
return /* @__PURE__ */ jsxs(
|
|
23
41
|
"div",
|
|
24
42
|
{
|
|
25
43
|
ref,
|
|
26
44
|
"data-testid": testId,
|
|
27
|
-
className: cn("inline-flex items-center justify-center
|
|
45
|
+
className: cn("inline-flex items-center justify-center relative", className),
|
|
28
46
|
style: {
|
|
47
|
+
width: normalizeSize(size),
|
|
29
48
|
height: normalizeSize(size),
|
|
30
49
|
...style
|
|
31
50
|
},
|
|
32
|
-
role: "
|
|
33
|
-
"aria-label":
|
|
34
|
-
"aria-
|
|
51
|
+
role: "progressbar",
|
|
52
|
+
"aria-label": progressLabel,
|
|
53
|
+
"aria-valuenow": indeterminate ? void 0 : clampedValue,
|
|
54
|
+
"aria-valuemin": 0,
|
|
55
|
+
"aria-valuemax": 100,
|
|
35
56
|
...rest,
|
|
36
|
-
children:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return /* @__PURE__ */ jsx(
|
|
40
|
-
"div",
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ jsxs(
|
|
59
|
+
"svg",
|
|
41
60
|
{
|
|
42
|
-
className: "
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
61
|
+
className: cn(indeterminate && "animate-spinner-rotate"),
|
|
62
|
+
width: sizeValue,
|
|
63
|
+
height: sizeValue,
|
|
64
|
+
viewBox: `0 0 ${sizeValue} ${sizeValue}`,
|
|
65
|
+
style: indeterminate ? {
|
|
66
|
+
animation: `spinner-rotate ${effectiveDuration} linear infinite`,
|
|
67
|
+
animationDirection: reverse ? "reverse" : "normal"
|
|
68
|
+
} : void 0,
|
|
69
|
+
children: [
|
|
70
|
+
gradient && /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: gradientId, x1: "0%", y1: "0%", x2: "100%", y2: "100%", children: [
|
|
71
|
+
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: color }),
|
|
72
|
+
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: secondaryColor === "#e0e0e0" ? "#8b5cf6" : secondaryColor })
|
|
73
|
+
] }) }),
|
|
74
|
+
/* @__PURE__ */ jsx(
|
|
75
|
+
"circle",
|
|
76
|
+
{
|
|
77
|
+
cx: sizeValue / 2,
|
|
78
|
+
cy: sizeValue / 2,
|
|
79
|
+
r: radius,
|
|
80
|
+
fill: "none",
|
|
81
|
+
stroke: gradient ? "#e0e0e0" : secondaryColor,
|
|
82
|
+
strokeWidth: thicknessValue
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
bufferDashoffset !== void 0 && !indeterminate && /* @__PURE__ */ jsx(
|
|
86
|
+
"circle",
|
|
87
|
+
{
|
|
88
|
+
cx: sizeValue / 2,
|
|
89
|
+
cy: sizeValue / 2,
|
|
90
|
+
r: radius,
|
|
91
|
+
fill: "none",
|
|
92
|
+
stroke: gradient ? `url(#${gradientId})` : color,
|
|
93
|
+
strokeWidth: thicknessValue,
|
|
94
|
+
strokeLinecap: "round",
|
|
95
|
+
strokeDasharray: circumference,
|
|
96
|
+
strokeDashoffset: bufferDashoffset,
|
|
97
|
+
transform: `rotate(-90 ${sizeValue / 2} ${sizeValue / 2})`,
|
|
98
|
+
opacity: 0.3
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
/* @__PURE__ */ jsx(
|
|
102
|
+
"circle",
|
|
103
|
+
{
|
|
104
|
+
cx: sizeValue / 2,
|
|
105
|
+
cy: sizeValue / 2,
|
|
106
|
+
r: radius,
|
|
107
|
+
fill: "none",
|
|
108
|
+
stroke: gradient ? `url(#${gradientId})` : color,
|
|
109
|
+
strokeWidth: thicknessValue,
|
|
110
|
+
strokeLinecap: "round",
|
|
111
|
+
strokeDasharray: circumference,
|
|
112
|
+
strokeDashoffset: indeterminate ? circumference * 0.75 : strokeDashoffset,
|
|
113
|
+
transform: `rotate(-90 ${sizeValue / 2} ${sizeValue / 2})`,
|
|
114
|
+
style: {
|
|
115
|
+
transition: indeterminate ? "none" : "stroke-dashoffset 0.3s ease-in-out"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
showValue && !indeterminate && /* @__PURE__ */ jsxs(
|
|
123
|
+
"span",
|
|
124
|
+
{
|
|
125
|
+
className: "absolute text-sm font-semibold",
|
|
126
|
+
style: { color },
|
|
127
|
+
children: [
|
|
128
|
+
clampedValue,
|
|
129
|
+
"%"
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
)
|
|
133
|
+
]
|
|
56
134
|
}
|
|
57
135
|
);
|
|
58
136
|
}
|
|
59
137
|
);
|
|
60
|
-
|
|
138
|
+
ProgressRing.displayName = "ProgressRing";
|
|
61
139
|
export {
|
|
62
|
-
|
|
140
|
+
ProgressRing
|
|
63
141
|
};
|
|
64
142
|
//# sourceMappingURL=index23.js.map
|
package/dist/index23.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index23.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index23.js","sources":["../src/components/progress/ProgressRing.tsx"],"sourcesContent":["import { forwardRef, useMemo } from 'react';\nimport { ProgressRingProps } from '../../types';\nimport { cn, normalizeSize, parseSizeToNumber, useReducedMotion, getEffectiveDuration } from '../../utils';\n\n/**\n * ProgressRing - Ring-style progress with gradient option\n *\n * A circular progress ring with optional gradient colors.\n *\n * @example\n * ```tsx\n * <ProgressRing value={75} showValue />\n * <ProgressRing value={60} gradient secondaryColor=\"#8b5cf6\" />\n * <ProgressRing indeterminate speed=\"fast\" />\n * <ProgressRing value={50} buffer={75} />\n * ```\n */\nexport const ProgressRing = forwardRef<HTMLDivElement, ProgressRingProps>(\n (\n {\n value = 0,\n indeterminate = false,\n showValue = false,\n size = 'lg',\n thickness = 4,\n color = '#3b82f6',\n secondaryColor = '#e0e0e0',\n gradient = false,\n buffer,\n speed = 'normal',\n reverse = false,\n respectMotionPreference = true,\n className,\n style,\n testId = 'progress-ring',\n visible = true,\n ariaLabel,\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const prefersReducedMotion = useReducedMotion();\n const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);\n\n const clampedValue = Math.min(100, Math.max(0, value));\n const clampedBuffer = buffer !== undefined ? Math.min(100, Math.max(0, buffer)) : undefined;\n const sizeValue = parseSizeToNumber(size, 56);\n const thicknessValue = parseSizeToNumber(thickness, 4);\n const radius = (sizeValue - thicknessValue * 2) / 2;\n const circumference = 2 * Math.PI * radius;\n const strokeDashoffset = circumference - (clampedValue / 100) * circumference;\n const bufferDashoffset = clampedBuffer !== undefined ? circumference - (clampedBuffer / 100) * circumference : undefined;\n const progressLabel = ariaLabel || `Loading ${clampedValue}%`;\n const gradientId = useMemo(() => `progress-gradient-${Math.random().toString(36).substr(2, 9)}`, []);\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('inline-flex items-center justify-center relative', className)}\n style={{\n width: normalizeSize(size),\n height: normalizeSize(size),\n ...style,\n }}\n role=\"progressbar\"\n aria-label={progressLabel}\n aria-valuenow={indeterminate ? undefined : clampedValue}\n aria-valuemin={0}\n aria-valuemax={100}\n {...rest}\n >\n <svg\n className={cn(indeterminate && 'animate-spinner-rotate')}\n width={sizeValue}\n height={sizeValue}\n viewBox={`0 0 ${sizeValue} ${sizeValue}`}\n style={indeterminate ? {\n animation: `spinner-rotate ${effectiveDuration} linear infinite`,\n animationDirection: reverse ? 'reverse' : 'normal',\n } : undefined}\n >\n {gradient && (\n <defs>\n <linearGradient id={gradientId} x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"100%\">\n <stop offset=\"0%\" stopColor={color} />\n <stop offset=\"100%\" stopColor={secondaryColor === '#e0e0e0' ? '#8b5cf6' : secondaryColor} />\n </linearGradient>\n </defs>\n )}\n {/* Background circle */}\n <circle\n cx={sizeValue / 2}\n cy={sizeValue / 2}\n r={radius}\n fill=\"none\"\n stroke={gradient ? '#e0e0e0' : secondaryColor}\n strokeWidth={thicknessValue}\n />\n {/* Buffer circle (behind progress) */}\n {bufferDashoffset !== undefined && !indeterminate && (\n <circle\n cx={sizeValue / 2}\n cy={sizeValue / 2}\n r={radius}\n fill=\"none\"\n stroke={gradient ? `url(#${gradientId})` : color}\n strokeWidth={thicknessValue}\n strokeLinecap=\"round\"\n strokeDasharray={circumference}\n strokeDashoffset={bufferDashoffset}\n transform={`rotate(-90 ${sizeValue / 2} ${sizeValue / 2})`}\n opacity={0.3}\n />\n )}\n {/* Progress circle */}\n <circle\n cx={sizeValue / 2}\n cy={sizeValue / 2}\n r={radius}\n fill=\"none\"\n stroke={gradient ? `url(#${gradientId})` : color}\n strokeWidth={thicknessValue}\n strokeLinecap=\"round\"\n strokeDasharray={circumference}\n strokeDashoffset={indeterminate ? circumference * 0.75 : strokeDashoffset}\n transform={`rotate(-90 ${sizeValue / 2} ${sizeValue / 2})`}\n style={{\n transition: indeterminate ? 'none' : 'stroke-dashoffset 0.3s ease-in-out',\n }}\n />\n </svg>\n {showValue && !indeterminate && (\n <span\n className=\"absolute text-sm font-semibold\"\n style={{ color }}\n >\n {clampedValue}%\n </span>\n )}\n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AAAA,oBACb,eAAc;AAAA,oBACd,iBAAiB;AAAA,oBACjB,kBAAkB;AAAA,oBAClB,WAAW,cAAc,YAAY,CAAC,IAAI,YAAY,CAAC;AAAA,oBACvD,SAAS;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAIb;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,IAAI,YAAY;AAAA,oBAChB,IAAI,YAAY;AAAA,oBAChB,GAAG;AAAA,oBACH,MAAK;AAAA,oBACL,QAAQ,WAAW,QAAQ,UAAU,MAAM;AAAA,oBAC3C,aAAa;AAAA,oBACb,eAAc;AAAA,oBACd,iBAAiB;AAAA,oBACjB,kBAAkB,gBAAgB,gBAAgB,OAAO;AAAA,oBACzD,WAAW,cAAc,YAAY,CAAC,IAAI,YAAY,CAAC;AAAA,oBACvD,OAAO;AAAA,sBACL,YAAY,gBAAgB,SAAS;AAAA,oBAAA;AAAA,kBACvC;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,UAAA;AAAA,UAED,aAAa,CAAC,iBACb;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,OAAO,EAAE,MAAA;AAAA,cAER,UAAA;AAAA,gBAAA;AAAA,gBAAa;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAChB;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,aAAa,cAAc;"}
|
package/dist/index24.cjs
CHANGED
|
@@ -3,69 +3,129 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
5
|
const classNames = require("./index3.cjs");
|
|
6
|
-
const
|
|
6
|
+
const ProgressSteps = react.forwardRef(
|
|
7
7
|
({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
steps,
|
|
9
|
+
currentStep,
|
|
10
|
+
labels,
|
|
11
|
+
showNumbers = true,
|
|
12
|
+
orientation = "horizontal",
|
|
13
|
+
connector = "line",
|
|
14
|
+
color = "#3b82f6",
|
|
15
|
+
completedColor,
|
|
16
|
+
activeColor,
|
|
17
|
+
inactiveColor = "#e0e0e0",
|
|
15
18
|
className,
|
|
16
19
|
style,
|
|
17
|
-
testId = "
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
testId = "progress-steps",
|
|
21
|
+
visible = true,
|
|
22
|
+
ariaLabel = "Progress steps",
|
|
20
23
|
...rest
|
|
21
24
|
}, ref) => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
if (!visible) return null;
|
|
26
|
+
const completed = completedColor || color;
|
|
27
|
+
const active = activeColor || color;
|
|
28
|
+
const getStepStatus = (index) => {
|
|
29
|
+
if (index < currentStep) return "completed";
|
|
30
|
+
if (index === currentStep) return "active";
|
|
31
|
+
return "inactive";
|
|
27
32
|
};
|
|
28
|
-
|
|
33
|
+
const getStepColor = (status) => {
|
|
34
|
+
if (status === "completed") return completed;
|
|
35
|
+
if (status === "active") return active;
|
|
36
|
+
return inactiveColor;
|
|
37
|
+
};
|
|
38
|
+
const getConnectorColor = (index) => {
|
|
39
|
+
return index < currentStep ? completed : inactiveColor;
|
|
40
|
+
};
|
|
41
|
+
const isHorizontal = orientation === "horizontal";
|
|
42
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
29
43
|
"div",
|
|
30
44
|
{
|
|
31
45
|
ref,
|
|
32
46
|
"data-testid": testId,
|
|
33
|
-
className: classNames.cn(
|
|
47
|
+
className: classNames.cn(
|
|
48
|
+
"flex",
|
|
49
|
+
isHorizontal ? "flex-row items-center w-full" : "flex-col items-start",
|
|
50
|
+
className
|
|
51
|
+
),
|
|
34
52
|
style,
|
|
53
|
+
role: "progressbar",
|
|
54
|
+
"aria-label": ariaLabel,
|
|
55
|
+
"aria-valuenow": currentStep,
|
|
56
|
+
"aria-valuemin": 0,
|
|
57
|
+
"aria-valuemax": steps - 1,
|
|
35
58
|
...rest,
|
|
36
|
-
children:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
role: "status",
|
|
49
|
-
"aria-label": ariaLabel,
|
|
50
|
-
"aria-busy": "true",
|
|
51
|
-
children: [
|
|
52
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
53
|
-
"div",
|
|
54
|
-
{
|
|
55
|
-
className: "absolute inset-0",
|
|
56
|
-
style: backdropStyles,
|
|
57
|
-
"aria-hidden": "true"
|
|
58
|
-
}
|
|
59
|
+
children: Array.from({ length: steps }).map((_, index) => {
|
|
60
|
+
const status = getStepStatus(index);
|
|
61
|
+
const stepColor = getStepColor(status);
|
|
62
|
+
const showConnector = index < steps - 1 && connector === "line";
|
|
63
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
|
|
64
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
className: classNames.cn(
|
|
68
|
+
"flex items-center",
|
|
69
|
+
isHorizontal ? "flex-col" : "flex-row gap-3"
|
|
59
70
|
),
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
className: "rounded-full flex items-center justify-center font-medium text-sm transition-colors",
|
|
76
|
+
style: {
|
|
77
|
+
width: "2rem",
|
|
78
|
+
height: "2rem",
|
|
79
|
+
backgroundColor: stepColor,
|
|
80
|
+
color: "#ffffff"
|
|
81
|
+
},
|
|
82
|
+
children: showNumbers && /* @__PURE__ */ jsxRuntime.jsx("span", { children: index + 1 })
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
(labels == null ? void 0 : labels[index]) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
86
|
+
"span",
|
|
87
|
+
{
|
|
88
|
+
className: classNames.cn(
|
|
89
|
+
"text-xs mt-1 transition-colors",
|
|
90
|
+
isHorizontal ? "text-center" : "text-left"
|
|
91
|
+
),
|
|
92
|
+
style: {
|
|
93
|
+
color: status === "inactive" ? "#9ca3af" : "#374151",
|
|
94
|
+
maxWidth: isHorizontal ? "80px" : "none"
|
|
95
|
+
},
|
|
96
|
+
children: labels[index]
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
showConnector && /* @__PURE__ */ jsxRuntime.jsx(
|
|
103
|
+
"div",
|
|
104
|
+
{
|
|
105
|
+
className: "transition-colors",
|
|
106
|
+
style: {
|
|
107
|
+
backgroundColor: getConnectorColor(index),
|
|
108
|
+
...isHorizontal ? {
|
|
109
|
+
height: "2px",
|
|
110
|
+
flex: 1,
|
|
111
|
+
marginLeft: "4px",
|
|
112
|
+
marginRight: "4px"
|
|
113
|
+
} : {
|
|
114
|
+
width: "2px",
|
|
115
|
+
height: "32px",
|
|
116
|
+
marginLeft: "15px",
|
|
117
|
+
marginTop: (labels == null ? void 0 : labels[index]) ? "4px" : "0",
|
|
118
|
+
marginBottom: "4px"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
] }, index);
|
|
124
|
+
})
|
|
65
125
|
}
|
|
66
126
|
);
|
|
67
127
|
}
|
|
68
128
|
);
|
|
69
|
-
|
|
70
|
-
exports.
|
|
129
|
+
ProgressSteps.displayName = "ProgressSteps";
|
|
130
|
+
exports.ProgressSteps = ProgressSteps;
|
|
71
131
|
//# sourceMappingURL=index24.cjs.map
|
package/dist/index24.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index24.cjs","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index24.cjs","sources":["../src/components/progress/ProgressSteps.tsx"],"sourcesContent":["import { forwardRef, Fragment } from 'react';\nimport { ProgressStepsProps } from '../../types';\nimport { cn } from '../../utils';\n\n/**\n * ProgressSteps - Multi-step progress indicator\n *\n * A step-by-step progress indicator for wizards, forms, and workflows.\n *\n * @example\n * ```tsx\n * <ProgressSteps steps={4} currentStep={1} />\n * <ProgressSteps steps={5} currentStep={2} labels={['Info', 'Review', 'Payment', 'Confirm', 'Done']} />\n * <ProgressSteps steps={3} currentStep={1} orientation=\"vertical\" />\n * <ProgressSteps steps={4} currentStep={2} connector=\"none\" />\n * ```\n */\nexport const ProgressSteps = forwardRef<HTMLDivElement, ProgressStepsProps>(\n (\n {\n steps,\n currentStep,\n labels,\n showNumbers = true,\n orientation = 'horizontal',\n connector = 'line',\n color = '#3b82f6',\n completedColor,\n activeColor,\n inactiveColor = '#e0e0e0',\n className,\n style,\n testId = 'progress-steps',\n visible = true,\n ariaLabel = 'Progress steps',\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const completed = completedColor || color;\n const active = activeColor || color;\n\n const getStepStatus = (index: number): 'completed' | 'active' | 'inactive' => {\n if (index < currentStep) return 'completed';\n if (index === currentStep) return 'active';\n return 'inactive';\n };\n\n const getStepColor = (status: 'completed' | 'active' | 'inactive'): string => {\n if (status === 'completed') return completed;\n if (status === 'active') return active;\n return inactiveColor;\n };\n\n const getConnectorColor = (index: number): string => {\n return index < currentStep ? completed : inactiveColor;\n };\n\n const isHorizontal = orientation === 'horizontal';\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn(\n 'flex',\n isHorizontal ? 'flex-row items-center w-full' : 'flex-col items-start',\n className\n )}\n style={style}\n role=\"progressbar\"\n aria-label={ariaLabel}\n aria-valuenow={currentStep}\n aria-valuemin={0}\n aria-valuemax={steps - 1}\n {...rest}\n >\n {Array.from({ length: steps }).map((_, index) => {\n const status = getStepStatus(index);\n const stepColor = getStepColor(status);\n const showConnector = index < steps - 1 && connector === 'line';\n\n return (\n <Fragment key={index}>\n {/* Step */}\n <div\n className={cn(\n 'flex items-center',\n isHorizontal ? 'flex-col' : 'flex-row gap-3'\n )}\n >\n {/* Step Circle */}\n <div\n className=\"rounded-full flex items-center justify-center font-medium text-sm transition-colors\"\n style={{\n width: '2rem',\n height: '2rem',\n backgroundColor: stepColor,\n color: '#ffffff',\n }}\n >\n {showNumbers && <span>{index + 1}</span>}\n </div>\n\n {/* Step Label */}\n {labels?.[index] && (\n <span\n className={cn(\n 'text-xs mt-1 transition-colors',\n isHorizontal ? 'text-center' : 'text-left'\n )}\n style={{\n color: status === 'inactive' ? '#9ca3af' : '#374151',\n maxWidth: isHorizontal ? '80px' : 'none',\n }}\n >\n {labels[index]}\n </span>\n )}\n </div>\n\n {/* Connector */}\n {showConnector && (\n <div\n className=\"transition-colors\"\n style={{\n backgroundColor: getConnectorColor(index),\n ...(isHorizontal\n ? {\n height: '2px',\n flex: 1,\n marginLeft: '4px',\n marginRight: '4px',\n }\n : {\n width: '2px',\n height: '32px',\n marginLeft: '15px',\n marginTop: labels?.[index] ? '4px' : '0',\n marginBottom: '4px',\n }),\n }}\n />\n )}\n </Fragment>\n );\n })}\n </div>\n );\n }\n);\n\nProgressSteps.displayName = 'ProgressSteps';\n"],"names":["forwardRef","jsx","cn","Fragment","jsxs"],"mappings":";;;;;AAiBO,MAAM,gBAAgBA,MAAAA;AAAAA,EAC3B,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd,cAAc;AAAA,IACd,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,UAAM,YAAY,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AAeA,+BAAC,QAAA,EAAM,UAAA,QAAQ,EAAA,CAAE;AAAA,oBAAA;AAAA,kBAAA;AAAA,mBAIlC,iCAAS,WACRA,2BAAAA;AAAAA,oBAAC;AAAA,oBAAA;AAAA,sBACC,WAAWC,WAAAA;AAAAA,wBACT;AAAA,wBACA,eAAe,gBAAgB;AAAA,sBAAA;AAAA,sBAEjC,OAAO;AAAA,wBACL,OAAO,WAAW,aAAa,YAAY;AAAA,wBAC3C,UAAU,eAAe,SAAS;AAAA,sBAAA;AAAA,sBAGnC,iBAAO,KAAK;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACf;AAAA,cAAA;AAAA,YAAA;AAAA,YAKH,iBACCD,2BAAAA;AAAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAU;AAAA,gBACV,OAAO;AAAA,kBACL,iBAAiB,kBAAkB,KAAK;AAAA,kBACxC,GAAI,eACA;AAAA,oBACE,QAAQ;AAAA,oBACR,MAAM;AAAA,oBACN,YAAY;AAAA,oBACZ,aAAa;AAAA,kBAAA,IAEf;AAAA,oBACE,OAAO;AAAA,oBACP,QAAQ;AAAA,oBACR,YAAY;AAAA,oBACZ,YAAW,iCAAS,UAAS,QAAQ;AAAA,oBACrC,cAAc;AAAA,kBAAA;AAAA,gBAChB;AAAA,cACN;AAAA,YAAA;AAAA,UACF,EAAA,GA3DW,KA6Df;AAAA,QAEJ,CAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,cAAc,cAAc;;"}
|
package/dist/index24.js
CHANGED
|
@@ -1,71 +1,131 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef } from "react";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, Fragment } from "react";
|
|
3
3
|
import { cn } from "./index3.js";
|
|
4
|
-
const
|
|
4
|
+
const ProgressSteps = forwardRef(
|
|
5
5
|
({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
steps,
|
|
7
|
+
currentStep,
|
|
8
|
+
labels,
|
|
9
|
+
showNumbers = true,
|
|
10
|
+
orientation = "horizontal",
|
|
11
|
+
connector = "line",
|
|
12
|
+
color = "#3b82f6",
|
|
13
|
+
completedColor,
|
|
14
|
+
activeColor,
|
|
15
|
+
inactiveColor = "#e0e0e0",
|
|
13
16
|
className,
|
|
14
17
|
style,
|
|
15
|
-
testId = "
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
testId = "progress-steps",
|
|
19
|
+
visible = true,
|
|
20
|
+
ariaLabel = "Progress steps",
|
|
18
21
|
...rest
|
|
19
22
|
}, ref) => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
if (!visible) return null;
|
|
24
|
+
const completed = completedColor || color;
|
|
25
|
+
const active = activeColor || color;
|
|
26
|
+
const getStepStatus = (index) => {
|
|
27
|
+
if (index < currentStep) return "completed";
|
|
28
|
+
if (index === currentStep) return "active";
|
|
29
|
+
return "inactive";
|
|
25
30
|
};
|
|
26
|
-
|
|
31
|
+
const getStepColor = (status) => {
|
|
32
|
+
if (status === "completed") return completed;
|
|
33
|
+
if (status === "active") return active;
|
|
34
|
+
return inactiveColor;
|
|
35
|
+
};
|
|
36
|
+
const getConnectorColor = (index) => {
|
|
37
|
+
return index < currentStep ? completed : inactiveColor;
|
|
38
|
+
};
|
|
39
|
+
const isHorizontal = orientation === "horizontal";
|
|
40
|
+
return /* @__PURE__ */ jsx(
|
|
27
41
|
"div",
|
|
28
42
|
{
|
|
29
43
|
ref,
|
|
30
44
|
"data-testid": testId,
|
|
31
|
-
className: cn(
|
|
45
|
+
className: cn(
|
|
46
|
+
"flex",
|
|
47
|
+
isHorizontal ? "flex-row items-center w-full" : "flex-col items-start",
|
|
48
|
+
className
|
|
49
|
+
),
|
|
32
50
|
style,
|
|
51
|
+
role: "progressbar",
|
|
52
|
+
"aria-label": ariaLabel,
|
|
53
|
+
"aria-valuenow": currentStep,
|
|
54
|
+
"aria-valuemin": 0,
|
|
55
|
+
"aria-valuemax": steps - 1,
|
|
33
56
|
...rest,
|
|
34
|
-
children:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
role: "status",
|
|
47
|
-
"aria-label": ariaLabel,
|
|
48
|
-
"aria-busy": "true",
|
|
49
|
-
children: [
|
|
50
|
-
/* @__PURE__ */ jsx(
|
|
51
|
-
"div",
|
|
52
|
-
{
|
|
53
|
-
className: "absolute inset-0",
|
|
54
|
-
style: backdropStyles,
|
|
55
|
-
"aria-hidden": "true"
|
|
56
|
-
}
|
|
57
|
+
children: Array.from({ length: steps }).map((_, index) => {
|
|
58
|
+
const status = getStepStatus(index);
|
|
59
|
+
const stepColor = getStepColor(status);
|
|
60
|
+
const showConnector = index < steps - 1 && connector === "line";
|
|
61
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
62
|
+
/* @__PURE__ */ jsxs(
|
|
63
|
+
"div",
|
|
64
|
+
{
|
|
65
|
+
className: cn(
|
|
66
|
+
"flex items-center",
|
|
67
|
+
isHorizontal ? "flex-col" : "flex-row gap-3"
|
|
57
68
|
),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ jsx(
|
|
71
|
+
"div",
|
|
72
|
+
{
|
|
73
|
+
className: "rounded-full flex items-center justify-center font-medium text-sm transition-colors",
|
|
74
|
+
style: {
|
|
75
|
+
width: "2rem",
|
|
76
|
+
height: "2rem",
|
|
77
|
+
backgroundColor: stepColor,
|
|
78
|
+
color: "#ffffff"
|
|
79
|
+
},
|
|
80
|
+
children: showNumbers && /* @__PURE__ */ jsx("span", { children: index + 1 })
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
(labels == null ? void 0 : labels[index]) && /* @__PURE__ */ jsx(
|
|
84
|
+
"span",
|
|
85
|
+
{
|
|
86
|
+
className: cn(
|
|
87
|
+
"text-xs mt-1 transition-colors",
|
|
88
|
+
isHorizontal ? "text-center" : "text-left"
|
|
89
|
+
),
|
|
90
|
+
style: {
|
|
91
|
+
color: status === "inactive" ? "#9ca3af" : "#374151",
|
|
92
|
+
maxWidth: isHorizontal ? "80px" : "none"
|
|
93
|
+
},
|
|
94
|
+
children: labels[index]
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
showConnector && /* @__PURE__ */ jsx(
|
|
101
|
+
"div",
|
|
102
|
+
{
|
|
103
|
+
className: "transition-colors",
|
|
104
|
+
style: {
|
|
105
|
+
backgroundColor: getConnectorColor(index),
|
|
106
|
+
...isHorizontal ? {
|
|
107
|
+
height: "2px",
|
|
108
|
+
flex: 1,
|
|
109
|
+
marginLeft: "4px",
|
|
110
|
+
marginRight: "4px"
|
|
111
|
+
} : {
|
|
112
|
+
width: "2px",
|
|
113
|
+
height: "32px",
|
|
114
|
+
marginLeft: "15px",
|
|
115
|
+
marginTop: (labels == null ? void 0 : labels[index]) ? "4px" : "0",
|
|
116
|
+
marginBottom: "4px"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
)
|
|
121
|
+
] }, index);
|
|
122
|
+
})
|
|
63
123
|
}
|
|
64
124
|
);
|
|
65
125
|
}
|
|
66
126
|
);
|
|
67
|
-
|
|
127
|
+
ProgressSteps.displayName = "ProgressSteps";
|
|
68
128
|
export {
|
|
69
|
-
|
|
129
|
+
ProgressSteps
|
|
70
130
|
};
|
|
71
131
|
//# sourceMappingURL=index24.js.map
|