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/index20.js
CHANGED
|
@@ -1,135 +1,85 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef
|
|
3
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { useReducedMotion, getEffectiveDuration } from "./index31.js";
|
|
4
4
|
import { cn } from "./index3.js";
|
|
5
|
-
|
|
5
|
+
import { normalizeSize } from "./index4.js";
|
|
6
|
+
const SpinnerPulse = forwardRef(
|
|
6
7
|
({
|
|
7
|
-
|
|
8
|
-
indeterminate = false,
|
|
9
|
-
showValue = false,
|
|
10
|
-
size = 60,
|
|
11
|
-
thickness = 4,
|
|
8
|
+
size = "md",
|
|
12
9
|
color = "#3b82f6",
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
buffer,
|
|
10
|
+
pulses = 2,
|
|
11
|
+
maxScale = 1.8,
|
|
16
12
|
speed = "normal",
|
|
13
|
+
reverse = false,
|
|
14
|
+
respectMotionPreference = true,
|
|
17
15
|
className,
|
|
18
16
|
style,
|
|
19
|
-
testId = "
|
|
17
|
+
testId = "spinner-pulse",
|
|
20
18
|
visible = true,
|
|
21
|
-
ariaLabel,
|
|
19
|
+
ariaLabel = "Loading...",
|
|
22
20
|
...rest
|
|
23
21
|
}, ref) => {
|
|
24
22
|
if (!visible) return null;
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const sizeValue =
|
|
28
|
-
|
|
29
|
-
const radius = (sizeValue - thicknessValue * 2) / 2;
|
|
30
|
-
const circumference = 2 * Math.PI * radius;
|
|
31
|
-
const strokeDashoffset = circumference - clampedValue / 100 * circumference;
|
|
32
|
-
const bufferDashoffset = clampedBuffer !== void 0 ? circumference - clampedBuffer / 100 * circumference : void 0;
|
|
33
|
-
const progressLabel = ariaLabel || `Loading ${clampedValue}%`;
|
|
34
|
-
const animationDuration = getAnimationDuration(speed);
|
|
35
|
-
const gradientId = useMemo(() => `progress-gradient-${Math.random().toString(36).substr(2, 9)}`, []);
|
|
36
|
-
return /* @__PURE__ */ jsxs(
|
|
23
|
+
const prefersReducedMotion = useReducedMotion();
|
|
24
|
+
const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
25
|
+
const sizeValue = normalizeSize(size);
|
|
26
|
+
return /* @__PURE__ */ jsx(
|
|
37
27
|
"div",
|
|
38
28
|
{
|
|
39
29
|
ref,
|
|
40
30
|
"data-testid": testId,
|
|
41
|
-
className: cn("inline-flex items-center justify-center
|
|
42
|
-
style
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
role: "progressbar",
|
|
48
|
-
"aria-label": progressLabel,
|
|
49
|
-
"aria-valuenow": indeterminate ? void 0 : clampedValue,
|
|
50
|
-
"aria-valuemin": 0,
|
|
51
|
-
"aria-valuemax": 100,
|
|
31
|
+
className: cn("inline-flex items-center justify-center", className),
|
|
32
|
+
style,
|
|
33
|
+
role: "status",
|
|
34
|
+
"aria-label": ariaLabel,
|
|
35
|
+
"aria-busy": "true",
|
|
52
36
|
...rest,
|
|
53
|
-
children:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
37
|
+
children: /* @__PURE__ */ jsxs(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
className: "relative",
|
|
41
|
+
style: {
|
|
58
42
|
width: sizeValue,
|
|
59
|
-
height: sizeValue
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
fill: "none",
|
|
74
|
-
stroke: gradient ? "#e0e0e0" : secondaryColor,
|
|
75
|
-
strokeWidth: thicknessValue
|
|
43
|
+
height: sizeValue
|
|
44
|
+
},
|
|
45
|
+
children: [
|
|
46
|
+
Array.from({ length: pulses }).map((_, index) => /* @__PURE__ */ jsx(
|
|
47
|
+
"div",
|
|
48
|
+
{
|
|
49
|
+
className: "absolute inset-0 rounded-full",
|
|
50
|
+
style: {
|
|
51
|
+
backgroundColor: color,
|
|
52
|
+
animation: `heartbeat-pulse ${effectiveDuration} ease-out infinite`,
|
|
53
|
+
animationDelay: reverse ? `${(pulses - index - 1) * 0.3}s` : `${index * 0.3}s`,
|
|
54
|
+
animationDirection: reverse ? "reverse" : "normal",
|
|
55
|
+
// @ts-ignore - CSS variable for animation
|
|
56
|
+
"--max-scale": maxScale
|
|
76
57
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
transform: `rotate(-90 ${sizeValue / 2} ${sizeValue / 2})`,
|
|
91
|
-
opacity: 0.3
|
|
58
|
+
},
|
|
59
|
+
index
|
|
60
|
+
)),
|
|
61
|
+
/* @__PURE__ */ jsx(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
className: "absolute rounded-full",
|
|
65
|
+
style: {
|
|
66
|
+
backgroundColor: color,
|
|
67
|
+
width: "50%",
|
|
68
|
+
height: "50%",
|
|
69
|
+
top: "25%",
|
|
70
|
+
left: "25%"
|
|
92
71
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
cy: sizeValue / 2,
|
|
99
|
-
r: radius,
|
|
100
|
-
fill: "none",
|
|
101
|
-
stroke: gradient ? `url(#${gradientId})` : color,
|
|
102
|
-
strokeWidth: thicknessValue,
|
|
103
|
-
strokeLinecap: "round",
|
|
104
|
-
strokeDasharray: circumference,
|
|
105
|
-
strokeDashoffset: indeterminate ? circumference * 0.75 : strokeDashoffset,
|
|
106
|
-
transform: `rotate(-90 ${sizeValue / 2} ${sizeValue / 2})`,
|
|
107
|
-
style: {
|
|
108
|
-
transition: indeterminate ? "none" : "stroke-dashoffset 0.3s ease-in-out"
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
)
|
|
112
|
-
]
|
|
113
|
-
}
|
|
114
|
-
),
|
|
115
|
-
showValue && !indeterminate && /* @__PURE__ */ jsxs(
|
|
116
|
-
"span",
|
|
117
|
-
{
|
|
118
|
-
className: "absolute text-sm font-semibold",
|
|
119
|
-
style: { color },
|
|
120
|
-
children: [
|
|
121
|
-
clampedValue,
|
|
122
|
-
"%"
|
|
123
|
-
]
|
|
124
|
-
}
|
|
125
|
-
)
|
|
126
|
-
]
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
)
|
|
127
77
|
}
|
|
128
78
|
);
|
|
129
79
|
}
|
|
130
80
|
);
|
|
131
|
-
|
|
81
|
+
SpinnerPulse.displayName = "SpinnerPulse";
|
|
132
82
|
export {
|
|
133
|
-
|
|
83
|
+
SpinnerPulse
|
|
134
84
|
};
|
|
135
85
|
//# sourceMappingURL=index20.js.map
|
package/dist/index20.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index20.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index20.js","sources":["../src/components/spinner/SpinnerPulse.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerPulseProps } from '../../types';\nimport { cn, normalizeSize, useReducedMotion, getEffectiveDuration } from '../../utils';\n\n/**\n * SpinnerPulse - Heartbeat pulse spinner\n *\n * A spinner with pulsing circles that scale and fade, creating a heartbeat effect.\n *\n * @example\n * ```tsx\n * <SpinnerPulse size=\"lg\" color=\"#3b82f6\" />\n * <SpinnerPulse size=\"xl\" pulses={3} reverse />\n * <SpinnerPulse size=\"md\" maxScale={2.5} speed=\"slow\" />\n * ```\n */\nexport const SpinnerPulse = forwardRef<HTMLDivElement, SpinnerPulseProps>(\n (\n {\n size = 'md',\n color = '#3b82f6',\n pulses = 2,\n maxScale = 1.8,\n speed = 'normal',\n reverse = false,\n respectMotionPreference = true,\n className,\n style,\n testId = 'spinner-pulse',\n visible = true,\n ariaLabel = 'Loading...',\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const prefersReducedMotion = useReducedMotion();\n const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);\n const sizeValue = normalizeSize(size);\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('inline-flex items-center justify-center', className)}\n style={style}\n role=\"status\"\n aria-label={ariaLabel}\n aria-busy=\"true\"\n {...rest}\n >\n <div\n className=\"relative\"\n style={{\n width: sizeValue,\n height: sizeValue,\n }}\n >\n {/* Pulsing circles */}\n {Array.from({ length: pulses }).map((_, index) => (\n <div\n key={index}\n className=\"absolute inset-0 rounded-full\"\n style={{\n backgroundColor: color,\n animation: `heartbeat-pulse ${effectiveDuration} ease-out infinite`,\n animationDelay: reverse ? `${(pulses - index - 1) * 0.3}s` : `${index * 0.3}s`,\n animationDirection: reverse ? 'reverse' : 'normal',\n // @ts-ignore - CSS variable for animation\n '--max-scale': maxScale,\n }}\n />\n ))}\n\n {/* Static center circle */}\n <div\n className=\"absolute rounded-full\"\n style={{\n backgroundColor: color,\n width: '50%',\n height: '50%',\n top: '25%',\n left: '25%',\n }}\n />\n </div>\n </div>\n );\n }\n);\n\nSpinnerPulse.displayName = 'SpinnerPulse';\n"],"names":[],"mappings":";;;;;AAgBO,MAAM,eAAe;AAAA,EAC1B,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,0BAA0B;AAAA,IAC1B;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,I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.cjs
CHANGED
|
@@ -3,55 +3,106 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
5
|
const colors = require("./index4.cjs");
|
|
6
|
+
const hooks = require("./index31.cjs");
|
|
6
7
|
const classNames = require("./index3.cjs");
|
|
7
|
-
const
|
|
8
|
+
const ProgressBar = react.forwardRef(
|
|
8
9
|
({
|
|
9
|
-
|
|
10
|
+
value = 0,
|
|
11
|
+
indeterminate = false,
|
|
12
|
+
showValue = false,
|
|
13
|
+
height = "0.5rem",
|
|
10
14
|
color = "#3b82f6",
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
secondaryColor = "#e0e0e0",
|
|
16
|
+
gradient = false,
|
|
17
|
+
buffer,
|
|
13
18
|
speed = "normal",
|
|
19
|
+
reverse = false,
|
|
20
|
+
respectMotionPreference = true,
|
|
14
21
|
className,
|
|
15
22
|
style,
|
|
16
|
-
testId = "
|
|
23
|
+
testId = "progress-bar",
|
|
17
24
|
visible = true,
|
|
18
|
-
ariaLabel
|
|
25
|
+
ariaLabel,
|
|
19
26
|
...rest
|
|
20
27
|
}, ref) => {
|
|
21
28
|
if (!visible) return null;
|
|
22
|
-
const
|
|
23
|
-
|
|
29
|
+
const prefersReducedMotion = hooks.useReducedMotion();
|
|
30
|
+
const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
31
|
+
const clampedValue = Math.min(100, Math.max(0, value));
|
|
32
|
+
const clampedBuffer = buffer !== void 0 ? Math.min(100, Math.max(0, buffer)) : void 0;
|
|
33
|
+
const progressLabel = ariaLabel || `Loading ${clampedValue}%`;
|
|
34
|
+
const gradientId = react.useMemo(() => `progress-bar-gradient-${Math.random().toString(36).substr(2, 9)}`, []);
|
|
35
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
24
36
|
"div",
|
|
25
37
|
{
|
|
26
38
|
ref,
|
|
27
39
|
"data-testid": testId,
|
|
28
|
-
className: classNames.cn("
|
|
40
|
+
className: classNames.cn("relative w-full overflow-hidden rounded-full", className),
|
|
29
41
|
style: {
|
|
30
|
-
height: colors.normalizeSize(
|
|
42
|
+
height: colors.normalizeSize(height),
|
|
43
|
+
backgroundColor: secondaryColor,
|
|
31
44
|
...style
|
|
32
45
|
},
|
|
33
|
-
role: "
|
|
34
|
-
"aria-label":
|
|
35
|
-
"aria-
|
|
46
|
+
role: "progressbar",
|
|
47
|
+
"aria-label": progressLabel,
|
|
48
|
+
"aria-valuenow": indeterminate ? void 0 : clampedValue,
|
|
49
|
+
"aria-valuemin": 0,
|
|
50
|
+
"aria-valuemax": 100,
|
|
36
51
|
...rest,
|
|
37
|
-
children:
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
52
|
+
children: [
|
|
53
|
+
gradient && !indeterminate && /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "0", height: "0", style: { position: "absolute" }, children: /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: gradientId, x1: "0%", y1: "0%", x2: "100%", y2: "0%", children: [
|
|
54
|
+
/* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0%", stopColor: color }),
|
|
55
|
+
/* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "100%", stopColor: secondaryColor || "#8b5cf6" })
|
|
56
|
+
] }) }) }),
|
|
57
|
+
clampedBuffer !== void 0 && !indeterminate && /* @__PURE__ */ jsxRuntime.jsx(
|
|
58
|
+
"div",
|
|
59
|
+
{
|
|
60
|
+
className: "absolute h-full rounded-full opacity-30",
|
|
61
|
+
style: {
|
|
62
|
+
width: `${clampedBuffer}%`,
|
|
63
|
+
backgroundColor: color
|
|
64
|
+
}
|
|
47
65
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
66
|
+
),
|
|
67
|
+
indeterminate ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
68
|
+
"div",
|
|
69
|
+
{
|
|
70
|
+
className: "absolute h-full rounded-full",
|
|
71
|
+
style: {
|
|
72
|
+
backgroundColor: gradient ? `url(#${gradientId})` : color,
|
|
73
|
+
animation: `progress-indeterminate ${effectiveDuration} ease-in-out infinite`,
|
|
74
|
+
animationDirection: reverse ? "reverse" : "normal",
|
|
75
|
+
width: "40%"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
79
|
+
"div",
|
|
80
|
+
{
|
|
81
|
+
className: "h-full rounded-full transition-all duration-300 ease-in-out",
|
|
82
|
+
style: {
|
|
83
|
+
width: `${clampedValue}%`,
|
|
84
|
+
background: gradient ? `url(#${gradientId})` : color
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
showValue && !indeterminate && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
89
|
+
"span",
|
|
90
|
+
{
|
|
91
|
+
className: "absolute inset-0 flex items-center justify-center text-xs font-medium",
|
|
92
|
+
style: {
|
|
93
|
+
color: clampedValue > 50 ? colors.getContrastColor(color) : secondaryColor === "#e0e0e0" ? "#000000" : colors.getContrastColor(secondaryColor)
|
|
94
|
+
},
|
|
95
|
+
children: [
|
|
96
|
+
clampedValue,
|
|
97
|
+
"%"
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
]
|
|
51
102
|
}
|
|
52
103
|
);
|
|
53
104
|
}
|
|
54
105
|
);
|
|
55
|
-
|
|
56
|
-
exports.
|
|
106
|
+
ProgressBar.displayName = "ProgressBar";
|
|
107
|
+
exports.ProgressBar = ProgressBar;
|
|
57
108
|
//# sourceMappingURL=index21.cjs.map
|
package/dist/index21.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index21.cjs","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index21.cjs","sources":["../src/components/progress/ProgressBar.tsx"],"sourcesContent":["import { forwardRef, useMemo } from 'react';\nimport { ProgressBarProps } from '../../types';\nimport { cn, normalizeSize, getContrastColor, useReducedMotion, getEffectiveDuration } from '../../utils';\n\n/**\n * ProgressBar - Linear progress bar\n *\n * A horizontal progress bar that can be determinate (showing specific progress) or indeterminate (loading animation).\n *\n * @example\n * ```tsx\n * <ProgressBar value={75} showValue />\n * <ProgressBar indeterminate />\n * <ProgressBar value={50} height={8} color=\"#8b5cf6\" />\n * <ProgressBar value={50} buffer={75} /> // YouTube-style buffering\n * <ProgressBar value={60} gradient /> // Gradient progress\n * ```\n */\nexport const ProgressBar = forwardRef<HTMLDivElement, ProgressBarProps>(\n (\n {\n value = 0,\n indeterminate = false,\n showValue = false,\n height = '0.5rem',\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-bar',\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 progressLabel = ariaLabel || `Loading ${clampedValue}%`;\n\n // Generate gradient ID for SVG-based gradient\n const gradientId = useMemo(() => `progress-bar-gradient-${Math.random().toString(36).substr(2, 9)}`, []);\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('relative w-full overflow-hidden rounded-full', className)}\n style={{\n height: normalizeSize(height),\n backgroundColor: secondaryColor,\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 {/* Gradient SVG definition */}\n {gradient && !indeterminate && (\n <svg width=\"0\" height=\"0\" style={{ position: 'absolute' }}>\n <defs>\n <linearGradient id={gradientId} x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\">\n <stop offset=\"0%\" stopColor={color} />\n <stop offset=\"100%\" stopColor={secondaryColor || '#8b5cf6'} />\n </linearGradient>\n </defs>\n </svg>\n )}\n\n {/* Buffer indicator (shows behind main progress) */}\n {clampedBuffer !== undefined && !indeterminate && (\n <div\n className=\"absolute h-full rounded-full opacity-30\"\n style={{\n width: `${clampedBuffer}%`,\n backgroundColor: color,\n }}\n />\n )}\n\n {indeterminate ? (\n <div\n className=\"absolute h-full rounded-full\"\n style={{\n backgroundColor: gradient ? `url(#${gradientId})` : color,\n animation: `progress-indeterminate ${effectiveDuration} ease-in-out infinite`,\n animationDirection: reverse ? 'reverse' : 'normal',\n width: '40%',\n }}\n />\n ) : (\n <div\n className=\"h-full rounded-full transition-all duration-300 ease-in-out\"\n style={{\n width: `${clampedValue}%`,\n background: gradient ? `url(#${gradientId})` : color,\n }}\n />\n )}\n\n {showValue && !indeterminate && (\n <span\n className=\"absolute inset-0 flex items-center justify-center text-xs font-medium\"\n style={{\n color: clampedValue > 50 ? getContrastColor(color) : secondaryColor === '#e0e0e0' ? '#000000' : getContrastColor(secondaryColor)\n }}\n >\n {clampedValue}%\n </span>\n )}\n </div>\n );\n }\n);\n\nProgressBar.displayName = 'ProgressBar';\n"],"names":["forwardRef","useReducedMotion","getEffectiveDuration","useMemo","jsxs","cn","normalizeSize","jsx","getContrastColor"],"mappings":";;;;;;;AAkBO,MAAM,cAAcA,MAAAA;AAAAA,EACzB,CACE;AAAA,IACE,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,iBAAiB;AAAA,IACjB,WAAW;AAAA,IACX;AAAA,IACA,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,0BAA0B;AAAA,IAC1B;A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WAAW,kBAAkB,UAAA,CAAW;AAAA,UAAA,EAAA,CAC9D,GACF,GACF;AAAA,UAID,kBAAkB,UAAa,CAAC,iBAC/BA,2BAAAA;AAAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,OAAO;AAAA,gBACL,OAAO,GAAG,aAAa;AAAA,gBACvB,iBAAiB;AAAA,cAAA;AAAA,YACnB;AAAA,UAAA;AAAA,UAIH,gBACCA,2BAAAA;AAAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,OAAO;AAAA,gBACL,iBAAiB,WAAW,QAAQ,UAAU,MAAM;AAAA,gBACpD,WAAW,0BAA0B,iBAAiB;AAAA,gBACtD,oBAAoB,UAAU,YAAY;AAAA,gBAC1C,OAAO;AAAA,cAAA;AAAA,YACT;AAAA,UAAA,IAGFA,2BAAAA;AAAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,OAAO;AAAA,gBACL,OAAO,GAAG,YAAY;AAAA,gBACtB,YAAY,WAAW,QAAQ,UAAU,MAAM;AAAA,cAAA;AAAA,YACjD;AAAA,UAAA;AAAA,UAIH,aAAa,CAAC,iBACbH,2BAAAA;AAAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,OAAO;AAAA,gBACL,OAAO,eAAe,KAAKI,wBAAiB,KAAK,IAAI,mBAAmB,YAAY,YAAYA,OAAAA,iBAAiB,cAAc;AAAA,cAAA;AAAA,cAGhI,UAAA;AAAA,gBAAA;AAAA,gBAAa;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAChB;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,YAAY,cAAc;;"}
|
package/dist/index21.js
CHANGED
|
@@ -1,57 +1,108 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
|
-
import { normalizeSize,
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useMemo } from "react";
|
|
3
|
+
import { normalizeSize, getContrastColor } from "./index4.js";
|
|
4
|
+
import { useReducedMotion, getEffectiveDuration } from "./index31.js";
|
|
4
5
|
import { cn } from "./index3.js";
|
|
5
|
-
const
|
|
6
|
+
const ProgressBar = forwardRef(
|
|
6
7
|
({
|
|
7
|
-
|
|
8
|
+
value = 0,
|
|
9
|
+
indeterminate = false,
|
|
10
|
+
showValue = false,
|
|
11
|
+
height = "0.5rem",
|
|
8
12
|
color = "#3b82f6",
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
secondaryColor = "#e0e0e0",
|
|
14
|
+
gradient = false,
|
|
15
|
+
buffer,
|
|
11
16
|
speed = "normal",
|
|
17
|
+
reverse = false,
|
|
18
|
+
respectMotionPreference = true,
|
|
12
19
|
className,
|
|
13
20
|
style,
|
|
14
|
-
testId = "
|
|
21
|
+
testId = "progress-bar",
|
|
15
22
|
visible = true,
|
|
16
|
-
ariaLabel
|
|
23
|
+
ariaLabel,
|
|
17
24
|
...rest
|
|
18
25
|
}, ref) => {
|
|
19
26
|
if (!visible) return null;
|
|
20
|
-
const
|
|
21
|
-
|
|
27
|
+
const prefersReducedMotion = useReducedMotion();
|
|
28
|
+
const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
29
|
+
const clampedValue = Math.min(100, Math.max(0, value));
|
|
30
|
+
const clampedBuffer = buffer !== void 0 ? Math.min(100, Math.max(0, buffer)) : void 0;
|
|
31
|
+
const progressLabel = ariaLabel || `Loading ${clampedValue}%`;
|
|
32
|
+
const gradientId = useMemo(() => `progress-bar-gradient-${Math.random().toString(36).substr(2, 9)}`, []);
|
|
33
|
+
return /* @__PURE__ */ jsxs(
|
|
22
34
|
"div",
|
|
23
35
|
{
|
|
24
36
|
ref,
|
|
25
37
|
"data-testid": testId,
|
|
26
|
-
className: cn("
|
|
38
|
+
className: cn("relative w-full overflow-hidden rounded-full", className),
|
|
27
39
|
style: {
|
|
28
|
-
height: normalizeSize(
|
|
40
|
+
height: normalizeSize(height),
|
|
41
|
+
backgroundColor: secondaryColor,
|
|
29
42
|
...style
|
|
30
43
|
},
|
|
31
|
-
role: "
|
|
32
|
-
"aria-label":
|
|
33
|
-
"aria-
|
|
44
|
+
role: "progressbar",
|
|
45
|
+
"aria-label": progressLabel,
|
|
46
|
+
"aria-valuenow": indeterminate ? void 0 : clampedValue,
|
|
47
|
+
"aria-valuemin": 0,
|
|
48
|
+
"aria-valuemax": 100,
|
|
34
49
|
...rest,
|
|
35
|
-
children:
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
50
|
+
children: [
|
|
51
|
+
gradient && !indeterminate && /* @__PURE__ */ jsx("svg", { width: "0", height: "0", style: { position: "absolute" }, children: /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: gradientId, x1: "0%", y1: "0%", x2: "100%", y2: "0%", children: [
|
|
52
|
+
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: color }),
|
|
53
|
+
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: secondaryColor || "#8b5cf6" })
|
|
54
|
+
] }) }) }),
|
|
55
|
+
clampedBuffer !== void 0 && !indeterminate && /* @__PURE__ */ jsx(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
className: "absolute h-full rounded-full opacity-30",
|
|
59
|
+
style: {
|
|
60
|
+
width: `${clampedBuffer}%`,
|
|
61
|
+
backgroundColor: color
|
|
62
|
+
}
|
|
45
63
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
64
|
+
),
|
|
65
|
+
indeterminate ? /* @__PURE__ */ jsx(
|
|
66
|
+
"div",
|
|
67
|
+
{
|
|
68
|
+
className: "absolute h-full rounded-full",
|
|
69
|
+
style: {
|
|
70
|
+
backgroundColor: gradient ? `url(#${gradientId})` : color,
|
|
71
|
+
animation: `progress-indeterminate ${effectiveDuration} ease-in-out infinite`,
|
|
72
|
+
animationDirection: reverse ? "reverse" : "normal",
|
|
73
|
+
width: "40%"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
) : /* @__PURE__ */ jsx(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
className: "h-full rounded-full transition-all duration-300 ease-in-out",
|
|
80
|
+
style: {
|
|
81
|
+
width: `${clampedValue}%`,
|
|
82
|
+
background: gradient ? `url(#${gradientId})` : color
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
showValue && !indeterminate && /* @__PURE__ */ jsxs(
|
|
87
|
+
"span",
|
|
88
|
+
{
|
|
89
|
+
className: "absolute inset-0 flex items-center justify-center text-xs font-medium",
|
|
90
|
+
style: {
|
|
91
|
+
color: clampedValue > 50 ? getContrastColor(color) : secondaryColor === "#e0e0e0" ? "#000000" : getContrastColor(secondaryColor)
|
|
92
|
+
},
|
|
93
|
+
children: [
|
|
94
|
+
clampedValue,
|
|
95
|
+
"%"
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
]
|
|
49
100
|
}
|
|
50
101
|
);
|
|
51
102
|
}
|
|
52
103
|
);
|
|
53
|
-
|
|
104
|
+
ProgressBar.displayName = "ProgressBar";
|
|
54
105
|
export {
|
|
55
|
-
|
|
106
|
+
ProgressBar
|
|
56
107
|
};
|
|
57
108
|
//# sourceMappingURL=index21.js.map
|
package/dist/index21.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index21.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index21.js","sources":["../src/components/progress/ProgressBar.tsx"],"sourcesContent":["import { forwardRef, useMemo } from 'react';\nimport { ProgressBarProps } from '../../types';\nimport { cn, normalizeSize, getContrastColor, useReducedMotion, getEffectiveDuration } from '../../utils';\n\n/**\n * ProgressBar - Linear progress bar\n *\n * A horizontal progress bar that can be determinate (showing specific progress) or indeterminate (loading animation).\n *\n * @example\n * ```tsx\n * <ProgressBar value={75} showValue />\n * <ProgressBar indeterminate />\n * <ProgressBar value={50} height={8} color=\"#8b5cf6\" />\n * <ProgressBar value={50} buffer={75} /> // YouTube-style buffering\n * <ProgressBar value={60} gradient /> // Gradient progress\n * ```\n */\nexport const ProgressBar = forwardRef<HTMLDivElement, ProgressBarProps>(\n (\n {\n value = 0,\n indeterminate = false,\n showValue = false,\n height = '0.5rem',\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-bar',\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 progressLabel = ariaLabel || `Loading ${clampedValue}%`;\n\n // Generate gradient ID for SVG-based gradient\n const gradientId = useMemo(() => `progress-bar-gradient-${Math.random().toString(36).substr(2, 9)}`, []);\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('relative w-full overflow-hidden rounded-full', className)}\n style={{\n height: normalizeSize(height),\n backgroundColor: secondaryColor,\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 {/* Gradient SVG definition */}\n {gradient && !indeterminate && (\n <svg width=\"0\" height=\"0\" style={{ position: 'absolute' }}>\n <defs>\n <linearGradient id={gradientId} x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\">\n <stop offset=\"0%\" stopColor={color} />\n <stop offset=\"100%\" stopColor={secondaryColor || '#8b5cf6'} />\n </linearGradient>\n </defs>\n </svg>\n )}\n\n {/* Buffer indicator (shows behind main progress) */}\n {clampedBuffer !== undefined && !indeterminate && (\n <div\n className=\"absolute h-full rounded-full opacity-30\"\n style={{\n width: `${clampedBuffer}%`,\n backgroundColor: color,\n }}\n />\n )}\n\n {indeterminate ? (\n <div\n className=\"absolute h-full rounded-full\"\n style={{\n backgroundColor: gradient ? `url(#${gradientId})` : color,\n animation: `progress-indeterminate ${effectiveDuration} ease-in-out infinite`,\n animationDirection: reverse ? 'reverse' : 'normal',\n width: '40%',\n }}\n />\n ) : (\n <div\n className=\"h-full rounded-full transition-all duration-300 ease-in-out\"\n style={{\n width: `${clampedValue}%`,\n background: gradient ? `url(#${gradientId})` : color,\n }}\n />\n )}\n\n {showValue && !indeterminate && (\n <span\n className=\"absolute inset-0 flex items-center justify-center text-xs font-medium\"\n style={{\n color: clampedValue > 50 ? getContrastColor(color) : secondaryColor === '#e0e0e0' ? '#000000' : getContrastColor(secondaryColor)\n }}\n >\n {clampedValue}%\n </span>\n )}\n </div>\n );\n }\n);\n\nProgressBar.displayName = 'ProgressBar';\n"],"names":[],"mappings":";;;;;AAkBO,MAAM,cAAc;AAAA,EACzB,CACE;AAAA,IACE,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,iBAAiB;AAAA,IACjB,WAAW;AAAA,IACX;AAAA,IACA,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,0BAA0B;AAAA,IAC1B;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,UAAM,uBAAuB,iBAAA;AAC7B,UAAM,oBAAoB,qBAAqB,OAAO,yBAAyB,oBAAoB;AAEnG,UAAM,eAAe,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC;AACrD,UAAM,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