premium-react-loaders 1.0.2 → 1.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.
- 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/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/SpinnerPulse.d.ts +15 -0
- package/dist/components/spinner/SpinnerPulse.d.ts.map +1 -0
- 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 +23 -12
- package/dist/index14.cjs.map +1 -1
- package/dist/index14.js +23 -12
- package/dist/index14.js.map +1 -1
- package/dist/index15.cjs +11 -34
- package/dist/index15.cjs.map +1 -1
- package/dist/index15.js +11 -34
- package/dist/index15.js.map +1 -1
- package/dist/index16.cjs +40 -23
- package/dist/index16.cjs.map +1 -1
- package/dist/index16.js +41 -24
- package/dist/index16.js.map +1 -1
- package/dist/index17.cjs +23 -36
- package/dist/index17.cjs.map +1 -1
- package/dist/index17.js +23 -36
- package/dist/index17.js.map +1 -1
- package/dist/index18.cjs +46 -78
- package/dist/index18.cjs.map +1 -1
- package/dist/index18.js +48 -80
- package/dist/index18.js.map +1 -1
- package/dist/index19.cjs +39 -103
- package/dist/index19.cjs.map +1 -1
- package/dist/index19.js +40 -104
- package/dist/index19.js.map +1 -1
- package/dist/index20.cjs +52 -107
- package/dist/index20.cjs.map +1 -1
- package/dist/index20.js +54 -109
- package/dist/index20.js.map +1 -1
- package/dist/index21.cjs +73 -27
- package/dist/index21.cjs.map +1 -1
- package/dist/index21.js +76 -30
- package/dist/index21.js.map +1 -1
- package/dist/index22.cjs +98 -31
- package/dist/index22.cjs.map +1 -1
- package/dist/index22.js +99 -32
- package/dist/index22.js.map +1 -1
- package/dist/index23.cjs +104 -33
- package/dist/index23.cjs.map +1 -1
- package/dist/index23.js +106 -35
- 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 +55 -16
- package/dist/index25.cjs.map +1 -1
- package/dist/index25.js +54 -15
- package/dist/index25.js.map +1 -1
- package/dist/index26.cjs +62 -0
- package/dist/index26.cjs.map +1 -0
- package/dist/index26.js +62 -0
- package/dist/index26.js.map +1 -0
- package/dist/index27.cjs +64 -0
- package/dist/index27.cjs.map +1 -0
- package/dist/index27.js +64 -0
- package/dist/index27.js.map +1 -0
- package/dist/index28.cjs +61 -0
- package/dist/index28.cjs.map +1 -0
- package/dist/index28.js +61 -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/premium-react-loaders.css +29 -0
- 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/package.json +1 -1
package/dist/index14.cjs
CHANGED
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
|
-
const classNames = require("./index3.cjs");
|
|
6
5
|
const colors = require("./index4.cjs");
|
|
7
|
-
const
|
|
6
|
+
const classNames = require("./index3.cjs");
|
|
7
|
+
const SpinnerCircle = react.forwardRef(
|
|
8
8
|
({
|
|
9
9
|
size = 40,
|
|
10
10
|
color = "#3b82f6",
|
|
11
|
-
secondaryColor = "rgba(0, 0, 0, 0.1)",
|
|
12
11
|
thickness = 4,
|
|
13
12
|
speed = "normal",
|
|
14
13
|
className,
|
|
15
14
|
style,
|
|
16
|
-
testId = "spinner-
|
|
15
|
+
testId = "spinner-circle",
|
|
17
16
|
visible = true,
|
|
18
17
|
ariaLabel = "Loading...",
|
|
19
18
|
...rest
|
|
@@ -31,22 +30,34 @@ const SpinnerRing = react.forwardRef(
|
|
|
31
30
|
"aria-busy": "true",
|
|
32
31
|
...rest,
|
|
33
32
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
34
|
-
"
|
|
33
|
+
"svg",
|
|
35
34
|
{
|
|
36
|
-
className: "
|
|
35
|
+
className: "animate-spinner-rotate",
|
|
37
36
|
style: {
|
|
38
37
|
width: colors.normalizeSize(size),
|
|
39
38
|
height: colors.normalizeSize(size),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
animationDuration: colors.getAnimationDuration(speed)
|
|
40
|
+
},
|
|
41
|
+
viewBox: "0 0 50 50",
|
|
42
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
43
|
+
"circle",
|
|
44
|
+
{
|
|
45
|
+
cx: "25",
|
|
46
|
+
cy: "25",
|
|
47
|
+
r: 25 - thickness * 2,
|
|
48
|
+
fill: "none",
|
|
49
|
+
stroke: color,
|
|
50
|
+
strokeWidth: thickness,
|
|
51
|
+
strokeDasharray: "80, 200",
|
|
52
|
+
strokeLinecap: "round"
|
|
53
|
+
}
|
|
54
|
+
)
|
|
44
55
|
}
|
|
45
56
|
)
|
|
46
57
|
}
|
|
47
58
|
);
|
|
48
59
|
}
|
|
49
60
|
);
|
|
50
|
-
|
|
51
|
-
exports.
|
|
61
|
+
SpinnerCircle.displayName = "SpinnerCircle";
|
|
62
|
+
exports.SpinnerCircle = SpinnerCircle;
|
|
52
63
|
//# sourceMappingURL=index14.cjs.map
|
package/dist/index14.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index14.cjs","sources":["../src/components/spinner/
|
|
1
|
+
{"version":3,"file":"index14.cjs","sources":["../src/components/spinner/SpinnerCircle.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerCircleProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration } from '../../utils';\n\n/**\n * SpinnerCircle - Basic rotating circle spinner\n *\n * A simple, elegant circular spinner with a partial arc that rotates continuously.\n *\n * @example\n * ```tsx\n * <SpinnerCircle size={40} color=\"#3b82f6\" />\n * <SpinnerCircle size={24} thickness={3} speed=\"fast\" />\n * ```\n */\nexport const SpinnerCircle = forwardRef<HTMLDivElement, SpinnerCircleProps>(\n (\n {\n size = 40,\n color = '#3b82f6',\n thickness = 4,\n speed = 'normal',\n className,\n style,\n testId = 'spinner-circle',\n visible = true,\n ariaLabel = 'Loading...',\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\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 <svg\n className=\"animate-spinner-rotate\"\n style={{\n width: normalizeSize(size),\n height: normalizeSize(size),\n animationDuration: getAnimationDuration(speed),\n }}\n viewBox=\"0 0 50 50\"\n >\n <circle\n cx=\"25\"\n cy=\"25\"\n r={25 - thickness * 2}\n fill=\"none\"\n stroke={color}\n strokeWidth={thickness}\n strokeDasharray=\"80, 200\"\n strokeLinecap=\"round\"\n />\n </svg>\n </div>\n );\n }\n);\n\nSpinnerCircle.displayName = 'SpinnerCircle';\n"],"names":["forwardRef","jsx","cn","normalizeSize","getAnimationDuration"],"mappings":";;;;;;AAeO,MAAM,gBAAgBA,MAAAA;AAAAA,EAC3B,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAWC,WAAAA,GAAG,2CAA2C,SAAS;AAAA,QAClE;AAAA,QACA,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEJ,UAAAD,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,OAAOE,OAAAA,cAAc,IAAI;AAAA,cACzB,QAAQA,OAAAA,cAAc,IAAI;AAAA,cAC1B,mBAAmBC,OAAAA,qBAAqB,KAAK;AAAA,YAAA;AAAA,YAE/C,SAAQ;AAAA,YAER,UAAAH,2BAAAA;AAAAA,cAAC;AAAA,cAAA;AAAA,gBACC,IAAG;AAAA,gBACH,IAAG;AAAA,gBACH,GAAG,KAAK,YAAY;AAAA,gBACpB,MAAK;AAAA,gBACL,QAAQ;AAAA,gBACR,aAAa;AAAA,gBACb,iBAAgB;AAAA,gBAChB,eAAc;AAAA,cAAA;AAAA,YAAA;AAAA,UAChB;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,cAAc,cAAc;;"}
|
package/dist/index14.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { cn } from "./index3.js";
|
|
4
3
|
import { getAnimationDuration, normalizeSize } from "./index4.js";
|
|
5
|
-
|
|
4
|
+
import { cn } from "./index3.js";
|
|
5
|
+
const SpinnerCircle = forwardRef(
|
|
6
6
|
({
|
|
7
7
|
size = 40,
|
|
8
8
|
color = "#3b82f6",
|
|
9
|
-
secondaryColor = "rgba(0, 0, 0, 0.1)",
|
|
10
9
|
thickness = 4,
|
|
11
10
|
speed = "normal",
|
|
12
11
|
className,
|
|
13
12
|
style,
|
|
14
|
-
testId = "spinner-
|
|
13
|
+
testId = "spinner-circle",
|
|
15
14
|
visible = true,
|
|
16
15
|
ariaLabel = "Loading...",
|
|
17
16
|
...rest
|
|
@@ -29,24 +28,36 @@ const SpinnerRing = forwardRef(
|
|
|
29
28
|
"aria-busy": "true",
|
|
30
29
|
...rest,
|
|
31
30
|
children: /* @__PURE__ */ jsx(
|
|
32
|
-
"
|
|
31
|
+
"svg",
|
|
33
32
|
{
|
|
34
|
-
className: "
|
|
33
|
+
className: "animate-spinner-rotate",
|
|
35
34
|
style: {
|
|
36
35
|
width: normalizeSize(size),
|
|
37
36
|
height: normalizeSize(size),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
animationDuration: getAnimationDuration(speed)
|
|
38
|
+
},
|
|
39
|
+
viewBox: "0 0 50 50",
|
|
40
|
+
children: /* @__PURE__ */ jsx(
|
|
41
|
+
"circle",
|
|
42
|
+
{
|
|
43
|
+
cx: "25",
|
|
44
|
+
cy: "25",
|
|
45
|
+
r: 25 - thickness * 2,
|
|
46
|
+
fill: "none",
|
|
47
|
+
stroke: color,
|
|
48
|
+
strokeWidth: thickness,
|
|
49
|
+
strokeDasharray: "80, 200",
|
|
50
|
+
strokeLinecap: "round"
|
|
51
|
+
}
|
|
52
|
+
)
|
|
42
53
|
}
|
|
43
54
|
)
|
|
44
55
|
}
|
|
45
56
|
);
|
|
46
57
|
}
|
|
47
58
|
);
|
|
48
|
-
|
|
59
|
+
SpinnerCircle.displayName = "SpinnerCircle";
|
|
49
60
|
export {
|
|
50
|
-
|
|
61
|
+
SpinnerCircle
|
|
51
62
|
};
|
|
52
63
|
//# sourceMappingURL=index14.js.map
|
package/dist/index14.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index14.js","sources":["../src/components/spinner/
|
|
1
|
+
{"version":3,"file":"index14.js","sources":["../src/components/spinner/SpinnerCircle.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerCircleProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration } from '../../utils';\n\n/**\n * SpinnerCircle - Basic rotating circle spinner\n *\n * A simple, elegant circular spinner with a partial arc that rotates continuously.\n *\n * @example\n * ```tsx\n * <SpinnerCircle size={40} color=\"#3b82f6\" />\n * <SpinnerCircle size={24} thickness={3} speed=\"fast\" />\n * ```\n */\nexport const SpinnerCircle = forwardRef<HTMLDivElement, SpinnerCircleProps>(\n (\n {\n size = 40,\n color = '#3b82f6',\n thickness = 4,\n speed = 'normal',\n className,\n style,\n testId = 'spinner-circle',\n visible = true,\n ariaLabel = 'Loading...',\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\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 <svg\n className=\"animate-spinner-rotate\"\n style={{\n width: normalizeSize(size),\n height: normalizeSize(size),\n animationDuration: getAnimationDuration(speed),\n }}\n viewBox=\"0 0 50 50\"\n >\n <circle\n cx=\"25\"\n cy=\"25\"\n r={25 - thickness * 2}\n fill=\"none\"\n stroke={color}\n strokeWidth={thickness}\n strokeDasharray=\"80, 200\"\n strokeLinecap=\"round\"\n />\n </svg>\n </div>\n );\n }\n);\n\nSpinnerCircle.displayName = 'SpinnerCircle';\n"],"names":[],"mappings":";;;;AAeO,MAAM,gBAAgB;AAAA,EAC3B,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAW,GAAG,2CAA2C,SAAS;AAAA,QAClE;AAAA,QACA,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,OAAO,cAAc,IAAI;AAAA,cACzB,QAAQ,cAAc,IAAI;AAAA,cAC1B,mBAAmB,qBAAqB,KAAK;AAAA,YAAA;AAAA,YAE/C,SAAQ;AAAA,YAER,UAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,IAAG;AAAA,gBACH,IAAG;AAAA,gBACH,GAAG,KAAK,YAAY;AAAA,gBACpB,MAAK;AAAA,gBACL,QAAQ;AAAA,gBACR,aAAa;AAAA,gBACb,iBAAgB;AAAA,gBAChB,eAAc;AAAA,cAAA;AAAA,YAAA;AAAA,UAChB;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,cAAc,cAAc;"}
|
package/dist/index15.cjs
CHANGED
|
@@ -2,26 +2,23 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
|
-
const colors = require("./index4.cjs");
|
|
6
5
|
const classNames = require("./index3.cjs");
|
|
7
|
-
const
|
|
6
|
+
const colors = require("./index4.cjs");
|
|
7
|
+
const SpinnerRing = react.forwardRef(
|
|
8
8
|
({
|
|
9
9
|
size = 40,
|
|
10
10
|
color = "#3b82f6",
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
secondaryColor = "rgba(0, 0, 0, 0.1)",
|
|
12
|
+
thickness = 4,
|
|
13
13
|
speed = "normal",
|
|
14
14
|
className,
|
|
15
15
|
style,
|
|
16
|
-
testId = "spinner-
|
|
16
|
+
testId = "spinner-ring",
|
|
17
17
|
visible = true,
|
|
18
18
|
ariaLabel = "Loading...",
|
|
19
19
|
...rest
|
|
20
20
|
}, ref) => {
|
|
21
21
|
if (!visible) return null;
|
|
22
|
-
const sizeValue = colors.parseSizeToNumber(size, 40);
|
|
23
|
-
const dotSizeValue = colors.parseSizeToNumber(dotSize, 4);
|
|
24
|
-
const radius = (sizeValue - dotSizeValue) / 2;
|
|
25
22
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
26
23
|
"div",
|
|
27
24
|
{
|
|
@@ -36,40 +33,20 @@ const SpinnerDots = react.forwardRef(
|
|
|
36
33
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37
34
|
"div",
|
|
38
35
|
{
|
|
39
|
-
className: "
|
|
36
|
+
className: "rounded-full",
|
|
40
37
|
style: {
|
|
41
38
|
width: colors.normalizeSize(size),
|
|
42
39
|
height: colors.normalizeSize(size),
|
|
40
|
+
border: `${thickness}px solid ${secondaryColor}`,
|
|
41
|
+
borderTopColor: color,
|
|
43
42
|
animation: `spinner-rotate ${colors.getAnimationDuration(speed)} linear infinite`
|
|
44
|
-
}
|
|
45
|
-
children: Array.from({ length: dotCount }).map((_, index) => {
|
|
46
|
-
const angle = 360 / dotCount * index;
|
|
47
|
-
const radian = angle * Math.PI / 180;
|
|
48
|
-
const x = radius * Math.cos(radian) + radius;
|
|
49
|
-
const y = radius * Math.sin(radian) + radius;
|
|
50
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
51
|
-
"div",
|
|
52
|
-
{
|
|
53
|
-
className: "absolute rounded-full",
|
|
54
|
-
style: {
|
|
55
|
-
width: colors.normalizeSize(dotSize),
|
|
56
|
-
height: colors.normalizeSize(dotSize),
|
|
57
|
-
backgroundColor: color,
|
|
58
|
-
left: `${x}px`,
|
|
59
|
-
top: `${y}px`,
|
|
60
|
-
opacity: 1 - index / dotCount * 0.7
|
|
61
|
-
// Fade effect
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
index
|
|
65
|
-
);
|
|
66
|
-
})
|
|
43
|
+
}
|
|
67
44
|
}
|
|
68
45
|
)
|
|
69
46
|
}
|
|
70
47
|
);
|
|
71
48
|
}
|
|
72
49
|
);
|
|
73
|
-
|
|
74
|
-
exports.
|
|
50
|
+
SpinnerRing.displayName = "SpinnerRing";
|
|
51
|
+
exports.SpinnerRing = SpinnerRing;
|
|
75
52
|
//# sourceMappingURL=index15.cjs.map
|
package/dist/index15.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index15.cjs","sources":["../src/components/spinner/
|
|
1
|
+
{"version":3,"file":"index15.cjs","sources":["../src/components/spinner/SpinnerRing.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerRingProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration } from '../../utils';\n\n/**\n * SpinnerRing - Border-only rotating spinner\n *\n * A ring-style spinner with a transparent center and colored border.\n *\n * @example\n * ```tsx\n * <SpinnerRing size={40} color=\"#8b5cf6\" />\n * <SpinnerRing size={32} thickness={3} speed=\"slow\" />\n * <SpinnerRing size={40} color=\"#3b82f6\" secondaryColor=\"#e0e0e0\" />\n * ```\n */\nexport const SpinnerRing = forwardRef<HTMLDivElement, SpinnerRingProps>(\n (\n {\n size = 40,\n color = '#3b82f6',\n secondaryColor = 'rgba(0, 0, 0, 0.1)',\n thickness = 4,\n speed = 'normal',\n className,\n style,\n testId = 'spinner-ring',\n visible = true,\n ariaLabel = 'Loading...',\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\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=\"rounded-full\"\n style={{\n width: normalizeSize(size),\n height: normalizeSize(size),\n border: `${thickness}px solid ${secondaryColor}`,\n borderTopColor: color,\n animation: `spinner-rotate ${getAnimationDuration(speed)} linear infinite`,\n }}\n />\n </div>\n );\n }\n);\n\nSpinnerRing.displayName = 'SpinnerRing';\n"],"names":["forwardRef","jsx","cn","normalizeSize","getAnimationDuration"],"mappings":";;;;;;AAgBO,MAAM,cAAcA,MAAAA;AAAAA,EACzB,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,iBAAiB;AAAA,IACjB,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAWC,WAAAA,GAAG,2CAA2C,SAAS;AAAA,QAClE;AAAA,QACA,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEJ,UAAAD,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,OAAOE,OAAAA,cAAc,IAAI;AAAA,cACzB,QAAQA,OAAAA,cAAc,IAAI;AAAA,cAC1B,QAAQ,GAAG,SAAS,YAAY,cAAc;AAAA,cAC9C,gBAAgB;AAAA,cAChB,WAAW,kBAAkBC,4BAAqB,KAAK,CAAC;AAAA,YAAA;AAAA,UAC1D;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,YAAY,cAAc;;"}
|
package/dist/index15.js
CHANGED
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { getAnimationDuration, normalizeSize, parseSizeToNumber } from "./index4.js";
|
|
4
3
|
import { cn } from "./index3.js";
|
|
5
|
-
|
|
4
|
+
import { getAnimationDuration, normalizeSize } from "./index4.js";
|
|
5
|
+
const SpinnerRing = forwardRef(
|
|
6
6
|
({
|
|
7
7
|
size = 40,
|
|
8
8
|
color = "#3b82f6",
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
secondaryColor = "rgba(0, 0, 0, 0.1)",
|
|
10
|
+
thickness = 4,
|
|
11
11
|
speed = "normal",
|
|
12
12
|
className,
|
|
13
13
|
style,
|
|
14
|
-
testId = "spinner-
|
|
14
|
+
testId = "spinner-ring",
|
|
15
15
|
visible = true,
|
|
16
16
|
ariaLabel = "Loading...",
|
|
17
17
|
...rest
|
|
18
18
|
}, ref) => {
|
|
19
19
|
if (!visible) return null;
|
|
20
|
-
const sizeValue = parseSizeToNumber(size, 40);
|
|
21
|
-
const dotSizeValue = parseSizeToNumber(dotSize, 4);
|
|
22
|
-
const radius = (sizeValue - dotSizeValue) / 2;
|
|
23
20
|
return /* @__PURE__ */ jsx(
|
|
24
21
|
"div",
|
|
25
22
|
{
|
|
@@ -34,42 +31,22 @@ const SpinnerDots = forwardRef(
|
|
|
34
31
|
children: /* @__PURE__ */ jsx(
|
|
35
32
|
"div",
|
|
36
33
|
{
|
|
37
|
-
className: "
|
|
34
|
+
className: "rounded-full",
|
|
38
35
|
style: {
|
|
39
36
|
width: normalizeSize(size),
|
|
40
37
|
height: normalizeSize(size),
|
|
38
|
+
border: `${thickness}px solid ${secondaryColor}`,
|
|
39
|
+
borderTopColor: color,
|
|
41
40
|
animation: `spinner-rotate ${getAnimationDuration(speed)} linear infinite`
|
|
42
|
-
}
|
|
43
|
-
children: Array.from({ length: dotCount }).map((_, index) => {
|
|
44
|
-
const angle = 360 / dotCount * index;
|
|
45
|
-
const radian = angle * Math.PI / 180;
|
|
46
|
-
const x = radius * Math.cos(radian) + radius;
|
|
47
|
-
const y = radius * Math.sin(radian) + radius;
|
|
48
|
-
return /* @__PURE__ */ jsx(
|
|
49
|
-
"div",
|
|
50
|
-
{
|
|
51
|
-
className: "absolute rounded-full",
|
|
52
|
-
style: {
|
|
53
|
-
width: normalizeSize(dotSize),
|
|
54
|
-
height: normalizeSize(dotSize),
|
|
55
|
-
backgroundColor: color,
|
|
56
|
-
left: `${x}px`,
|
|
57
|
-
top: `${y}px`,
|
|
58
|
-
opacity: 1 - index / dotCount * 0.7
|
|
59
|
-
// Fade effect
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
index
|
|
63
|
-
);
|
|
64
|
-
})
|
|
41
|
+
}
|
|
65
42
|
}
|
|
66
43
|
)
|
|
67
44
|
}
|
|
68
45
|
);
|
|
69
46
|
}
|
|
70
47
|
);
|
|
71
|
-
|
|
48
|
+
SpinnerRing.displayName = "SpinnerRing";
|
|
72
49
|
export {
|
|
73
|
-
|
|
50
|
+
SpinnerRing
|
|
74
51
|
};
|
|
75
52
|
//# sourceMappingURL=index15.js.map
|
package/dist/index15.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index15.js","sources":["../src/components/spinner/
|
|
1
|
+
{"version":3,"file":"index15.js","sources":["../src/components/spinner/SpinnerRing.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerRingProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration } from '../../utils';\n\n/**\n * SpinnerRing - Border-only rotating spinner\n *\n * A ring-style spinner with a transparent center and colored border.\n *\n * @example\n * ```tsx\n * <SpinnerRing size={40} color=\"#8b5cf6\" />\n * <SpinnerRing size={32} thickness={3} speed=\"slow\" />\n * <SpinnerRing size={40} color=\"#3b82f6\" secondaryColor=\"#e0e0e0\" />\n * ```\n */\nexport const SpinnerRing = forwardRef<HTMLDivElement, SpinnerRingProps>(\n (\n {\n size = 40,\n color = '#3b82f6',\n secondaryColor = 'rgba(0, 0, 0, 0.1)',\n thickness = 4,\n speed = 'normal',\n className,\n style,\n testId = 'spinner-ring',\n visible = true,\n ariaLabel = 'Loading...',\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\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=\"rounded-full\"\n style={{\n width: normalizeSize(size),\n height: normalizeSize(size),\n border: `${thickness}px solid ${secondaryColor}`,\n borderTopColor: color,\n animation: `spinner-rotate ${getAnimationDuration(speed)} linear infinite`,\n }}\n />\n </div>\n );\n }\n);\n\nSpinnerRing.displayName = 'SpinnerRing';\n"],"names":[],"mappings":";;;;AAgBO,MAAM,cAAc;AAAA,EACzB,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,iBAAiB;AAAA,IACjB,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAW,GAAG,2CAA2C,SAAS;AAAA,QAClE;AAAA,QACA,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,OAAO,cAAc,IAAI;AAAA,cACzB,QAAQ,cAAc,IAAI;AAAA,cAC1B,QAAQ,GAAG,SAAS,YAAY,cAAc;AAAA,cAC9C,gBAAgB;AAAA,cAChB,WAAW,kBAAkB,qBAAqB,KAAK,CAAC;AAAA,YAAA;AAAA,UAC1D;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,YAAY,cAAc;"}
|
package/dist/index16.cjs
CHANGED
|
@@ -4,55 +4,72 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const react = require("react");
|
|
5
5
|
const colors = require("./index4.cjs");
|
|
6
6
|
const classNames = require("./index3.cjs");
|
|
7
|
-
const
|
|
7
|
+
const SpinnerDots = react.forwardRef(
|
|
8
8
|
({
|
|
9
9
|
size = 40,
|
|
10
10
|
color = "#3b82f6",
|
|
11
|
-
|
|
11
|
+
dotCount = 8,
|
|
12
|
+
dotSize = 4,
|
|
12
13
|
speed = "normal",
|
|
13
14
|
className,
|
|
14
15
|
style,
|
|
15
|
-
testId = "spinner-
|
|
16
|
+
testId = "spinner-dots",
|
|
16
17
|
visible = true,
|
|
17
18
|
ariaLabel = "Loading...",
|
|
18
19
|
...rest
|
|
19
20
|
}, ref) => {
|
|
20
21
|
if (!visible) return null;
|
|
21
22
|
const sizeValue = colors.parseSizeToNumber(size, 40);
|
|
22
|
-
const
|
|
23
|
-
const
|
|
23
|
+
const dotSizeValue = colors.parseSizeToNumber(dotSize, 4);
|
|
24
|
+
const radius = (sizeValue - dotSizeValue) / 2;
|
|
24
25
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
25
26
|
"div",
|
|
26
27
|
{
|
|
27
28
|
ref,
|
|
28
29
|
"data-testid": testId,
|
|
29
|
-
className: classNames.cn("inline-flex items-center justify-center
|
|
30
|
-
style
|
|
31
|
-
height: colors.normalizeSize(size),
|
|
32
|
-
...style
|
|
33
|
-
},
|
|
30
|
+
className: classNames.cn("inline-flex items-center justify-center", className),
|
|
31
|
+
style,
|
|
34
32
|
role: "status",
|
|
35
33
|
"aria-label": ariaLabel,
|
|
36
34
|
"aria-busy": "true",
|
|
37
35
|
...rest,
|
|
38
|
-
children:
|
|
36
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
39
37
|
"div",
|
|
40
38
|
{
|
|
41
|
-
className: "
|
|
39
|
+
className: "relative",
|
|
42
40
|
style: {
|
|
43
|
-
width:
|
|
44
|
-
height:
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
41
|
+
width: colors.normalizeSize(size),
|
|
42
|
+
height: colors.normalizeSize(size),
|
|
43
|
+
animation: `spinner-rotate ${colors.getAnimationDuration(speed)} linear infinite`
|
|
44
|
+
},
|
|
45
|
+
children: Array.from({ length: dotCount }).map((_, index) => {
|
|
46
|
+
const angle = 360 / dotCount * index;
|
|
47
|
+
const radian = angle * Math.PI / 180;
|
|
48
|
+
const x = radius * Math.cos(radian) + radius;
|
|
49
|
+
const y = radius * Math.sin(radian) + radius;
|
|
50
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
className: "absolute rounded-full",
|
|
54
|
+
style: {
|
|
55
|
+
width: colors.normalizeSize(dotSize),
|
|
56
|
+
height: colors.normalizeSize(dotSize),
|
|
57
|
+
backgroundColor: color,
|
|
58
|
+
left: `${x}px`,
|
|
59
|
+
top: `${y}px`,
|
|
60
|
+
opacity: 1 - index / dotCount * 0.7
|
|
61
|
+
// Fade effect
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
index
|
|
65
|
+
);
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
)
|
|
52
69
|
}
|
|
53
70
|
);
|
|
54
71
|
}
|
|
55
72
|
);
|
|
56
|
-
|
|
57
|
-
exports.
|
|
73
|
+
SpinnerDots.displayName = "SpinnerDots";
|
|
74
|
+
exports.SpinnerDots = SpinnerDots;
|
|
58
75
|
//# sourceMappingURL=index16.cjs.map
|
package/dist/index16.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index16.cjs","sources":["../src/components/spinner/
|
|
1
|
+
{"version":3,"file":"index16.cjs","sources":["../src/components/spinner/SpinnerDots.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerDotsProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration, parseSizeToNumber } from '../../utils';\n\n/**\n * SpinnerDots - Multiple dots rotating around center\n *\n * A spinner with multiple dots arranged in a circle that rotates continuously.\n *\n * @example\n * ```tsx\n * <SpinnerDots size={40} color=\"#3b82f6\" />\n * <SpinnerDots size={48} dotCount={8} dotSize={6} />\n * ```\n */\nexport const SpinnerDots = forwardRef<HTMLDivElement, SpinnerDotsProps>(\n (\n {\n size = 40,\n color = '#3b82f6',\n dotCount = 8,\n dotSize = 4,\n speed = 'normal',\n className,\n style,\n testId = 'spinner-dots',\n visible = true,\n ariaLabel = 'Loading...',\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const sizeValue = parseSizeToNumber(size, 40);\n const dotSizeValue = parseSizeToNumber(dotSize, 4);\n const radius = (sizeValue - dotSizeValue) / 2;\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: normalizeSize(size),\n height: normalizeSize(size),\n animation: `spinner-rotate ${getAnimationDuration(speed)} linear infinite`,\n }}\n >\n {Array.from({ length: dotCount }).map((_, index) => {\n const angle = (360 / dotCount) * index;\n const radian = (angle * Math.PI) / 180;\n const x = radius * Math.cos(radian) + radius;\n const y = radius * Math.sin(radian) + radius;\n\n return (\n <div\n key={index}\n className=\"absolute rounded-full\"\n style={{\n width: normalizeSize(dotSize),\n height: normalizeSize(dotSize),\n backgroundColor: color,\n left: `${x}px`,\n top: `${y}px`,\n opacity: 1 - (index / dotCount) * 0.7, // Fade effect\n }}\n />\n );\n })}\n </div>\n </div>\n );\n }\n);\n\nSpinnerDots.displayName = 'SpinnerDots';\n"],"names":["forwardRef","parseSizeToNumber","jsx","cn","normalizeSize","getAnimationDuration"],"mappings":";;;;;;AAeO,MAAM,cAAcA,MAAAA;AAAAA,EACzB,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,UAAU;AAAA,IACV,QAAQ;AAAA,IACR;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,YAAYC,OAAAA,kBAAkB,MAAM,EAAE;AAC5C,UAAM,eAAeA,OAAAA,kBAAkB,SAAS,CAAC;AACjD,UAAM,UAAU,YAAY,gBAAgB;AAE5C,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAWC,WAAAA,GAAG,2CAA2C,SAAS;AAAA,QAClE;AAAA,QACA,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEJ,UAAAD,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,OAAOE,OAAAA,cAAc,IAAI;AAAA,cACzB,QAAQA,OAAAA,cAAc,IAAI;AAAA,cAC1B,WAAW,kBAAkBC,4BAAqB,KAAK,CAAC;AAAA,YAAA;AAAA,YAGzD,UAAA,MAAM,KAAK,EAAE,QAAQ,SAAA,CAAU,EAAE,IAAI,CAAC,GAAG,UAAU;AAClD,oBAAM,QAAS,MAAM,WAAY;AACjC,oBAAM,SAAU,QAAQ,KAAK,KAAM;AACnC,oBAAM,IAAI,SAAS,KAAK,IAAI,MAAM,IAAI;AACtC,oBAAM,IAAI,SAAS,KAAK,IAAI,MAAM,IAAI;AAEtC,qBACEH,2BAAAA;AAAAA,gBAAC;AAAA,gBAAA;AAAA,kBAEC,WAAU;AAAA,kBACV,OAAO;AAAA,oBACL,OAAOE,OAAAA,cAAc,OAAO;AAAA,oBAC5B,QAAQA,OAAAA,cAAc,OAAO;AAAA,oBAC7B,iBAAiB;AAAA,oBACjB,MAAM,GAAG,CAAC;AAAA,oBACV,KAAK,GAAG,CAAC;AAAA,oBACT,SAAS,IAAK,QAAQ,WAAY;AAAA;AAAA,kBAAA;AAAA,gBACpC;AAAA,gBATK;AAAA,cAAA;AAAA,YAYX,CAAC;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,YAAY,cAAc;;"}
|
package/dist/index16.js
CHANGED
|
@@ -1,58 +1,75 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { getAnimationDuration, normalizeSize, parseSizeToNumber } from "./index4.js";
|
|
4
4
|
import { cn } from "./index3.js";
|
|
5
|
-
const
|
|
5
|
+
const SpinnerDots = forwardRef(
|
|
6
6
|
({
|
|
7
7
|
size = 40,
|
|
8
8
|
color = "#3b82f6",
|
|
9
|
-
|
|
9
|
+
dotCount = 8,
|
|
10
|
+
dotSize = 4,
|
|
10
11
|
speed = "normal",
|
|
11
12
|
className,
|
|
12
13
|
style,
|
|
13
|
-
testId = "spinner-
|
|
14
|
+
testId = "spinner-dots",
|
|
14
15
|
visible = true,
|
|
15
16
|
ariaLabel = "Loading...",
|
|
16
17
|
...rest
|
|
17
18
|
}, ref) => {
|
|
18
19
|
if (!visible) return null;
|
|
19
20
|
const sizeValue = parseSizeToNumber(size, 40);
|
|
20
|
-
const
|
|
21
|
-
const
|
|
21
|
+
const dotSizeValue = parseSizeToNumber(dotSize, 4);
|
|
22
|
+
const radius = (sizeValue - dotSizeValue) / 2;
|
|
22
23
|
return /* @__PURE__ */ jsx(
|
|
23
24
|
"div",
|
|
24
25
|
{
|
|
25
26
|
ref,
|
|
26
27
|
"data-testid": testId,
|
|
27
|
-
className: cn("inline-flex items-center justify-center
|
|
28
|
-
style
|
|
29
|
-
height: normalizeSize(size),
|
|
30
|
-
...style
|
|
31
|
-
},
|
|
28
|
+
className: cn("inline-flex items-center justify-center", className),
|
|
29
|
+
style,
|
|
32
30
|
role: "status",
|
|
33
31
|
"aria-label": ariaLabel,
|
|
34
32
|
"aria-busy": "true",
|
|
35
33
|
...rest,
|
|
36
|
-
children:
|
|
34
|
+
children: /* @__PURE__ */ jsx(
|
|
37
35
|
"div",
|
|
38
36
|
{
|
|
39
|
-
className: "
|
|
37
|
+
className: "relative",
|
|
40
38
|
style: {
|
|
41
|
-
width:
|
|
42
|
-
height:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
39
|
+
width: normalizeSize(size),
|
|
40
|
+
height: normalizeSize(size),
|
|
41
|
+
animation: `spinner-rotate ${getAnimationDuration(speed)} linear infinite`
|
|
42
|
+
},
|
|
43
|
+
children: Array.from({ length: dotCount }).map((_, index) => {
|
|
44
|
+
const angle = 360 / dotCount * index;
|
|
45
|
+
const radian = angle * Math.PI / 180;
|
|
46
|
+
const x = radius * Math.cos(radian) + radius;
|
|
47
|
+
const y = radius * Math.sin(radian) + radius;
|
|
48
|
+
return /* @__PURE__ */ jsx(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
className: "absolute rounded-full",
|
|
52
|
+
style: {
|
|
53
|
+
width: normalizeSize(dotSize),
|
|
54
|
+
height: normalizeSize(dotSize),
|
|
55
|
+
backgroundColor: color,
|
|
56
|
+
left: `${x}px`,
|
|
57
|
+
top: `${y}px`,
|
|
58
|
+
opacity: 1 - index / dotCount * 0.7
|
|
59
|
+
// Fade effect
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
index
|
|
63
|
+
);
|
|
64
|
+
})
|
|
65
|
+
}
|
|
66
|
+
)
|
|
50
67
|
}
|
|
51
68
|
);
|
|
52
69
|
}
|
|
53
70
|
);
|
|
54
|
-
|
|
71
|
+
SpinnerDots.displayName = "SpinnerDots";
|
|
55
72
|
export {
|
|
56
|
-
|
|
73
|
+
SpinnerDots
|
|
57
74
|
};
|
|
58
75
|
//# sourceMappingURL=index16.js.map
|
package/dist/index16.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index16.js","sources":["../src/components/spinner/
|
|
1
|
+
{"version":3,"file":"index16.js","sources":["../src/components/spinner/SpinnerDots.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerDotsProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration, parseSizeToNumber } from '../../utils';\n\n/**\n * SpinnerDots - Multiple dots rotating around center\n *\n * A spinner with multiple dots arranged in a circle that rotates continuously.\n *\n * @example\n * ```tsx\n * <SpinnerDots size={40} color=\"#3b82f6\" />\n * <SpinnerDots size={48} dotCount={8} dotSize={6} />\n * ```\n */\nexport const SpinnerDots = forwardRef<HTMLDivElement, SpinnerDotsProps>(\n (\n {\n size = 40,\n color = '#3b82f6',\n dotCount = 8,\n dotSize = 4,\n speed = 'normal',\n className,\n style,\n testId = 'spinner-dots',\n visible = true,\n ariaLabel = 'Loading...',\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const sizeValue = parseSizeToNumber(size, 40);\n const dotSizeValue = parseSizeToNumber(dotSize, 4);\n const radius = (sizeValue - dotSizeValue) / 2;\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: normalizeSize(size),\n height: normalizeSize(size),\n animation: `spinner-rotate ${getAnimationDuration(speed)} linear infinite`,\n }}\n >\n {Array.from({ length: dotCount }).map((_, index) => {\n const angle = (360 / dotCount) * index;\n const radian = (angle * Math.PI) / 180;\n const x = radius * Math.cos(radian) + radius;\n const y = radius * Math.sin(radian) + radius;\n\n return (\n <div\n key={index}\n className=\"absolute rounded-full\"\n style={{\n width: normalizeSize(dotSize),\n height: normalizeSize(dotSize),\n backgroundColor: color,\n left: `${x}px`,\n top: `${y}px`,\n opacity: 1 - (index / dotCount) * 0.7, // Fade effect\n }}\n />\n );\n })}\n </div>\n </div>\n );\n }\n);\n\nSpinnerDots.displayName = 'SpinnerDots';\n"],"names":[],"mappings":";;;;AAeO,MAAM,cAAc;AAAA,EACzB,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,UAAU;AAAA,IACV,QAAQ;AAAA,IACR;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,kBAAkB,MAAM,EAAE;AAC5C,UAAM,eAAe,kBAAkB,SAAS,CAAC;AACjD,UAAM,UAAU,YAAY,gBAAgB;AAE5C,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAW,GAAG,2CAA2C,SAAS;AAAA,QAClE;AAAA,QACA,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,OAAO,cAAc,IAAI;AAAA,cACzB,QAAQ,cAAc,IAAI;AAAA,cAC1B,WAAW,kBAAkB,qBAAqB,KAAK,CAAC;AAAA,YAAA;AAAA,YAGzD,UAAA,MAAM,KAAK,EAAE,QAAQ,SAAA,CAAU,EAAE,IAAI,CAAC,GAAG,UAAU;AAClD,oBAAM,QAAS,MAAM,WAAY;AACjC,oBAAM,SAAU,QAAQ,KAAK,KAAM;AACnC,oBAAM,IAAI,SAAS,KAAK,IAAI,MAAM,IAAI;AACtC,oBAAM,IAAI,SAAS,KAAK,IAAI,MAAM,IAAI;AAEtC,qBACE;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBAEC,WAAU;AAAA,kBACV,OAAO;AAAA,oBACL,OAAO,cAAc,OAAO;AAAA,oBAC5B,QAAQ,cAAc,OAAO;AAAA,oBAC7B,iBAAiB;AAAA,oBACjB,MAAM,GAAG,CAAC;AAAA,oBACV,KAAK,GAAG,CAAC;AAAA,oBACT,SAAS,IAAK,QAAQ,WAAY;AAAA;AAAA,kBAAA;AAAA,gBACpC;AAAA,gBATK;AAAA,cAAA;AAAA,YAYX,CAAC;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,YAAY,cAAc;"}
|