premium-react-loaders 1.0.0 → 1.0.2
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 +49 -3
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/overlay/LoaderOverlay.d.ts +28 -0
- package/dist/components/overlay/LoaderOverlay.d.ts.map +1 -0
- package/dist/components/overlay/index.d.ts +2 -0
- package/dist/components/overlay/index.d.ts.map +1 -0
- package/dist/components/progress/ProgressBar.d.ts +2 -0
- package/dist/components/progress/ProgressBar.d.ts.map +1 -1
- package/dist/components/progress/ProgressCircle.d.ts +2 -1
- package/dist/components/progress/ProgressCircle.d.ts.map +1 -1
- package/dist/components/progress/ProgressRing.d.ts +2 -1
- package/dist/components/progress/ProgressRing.d.ts.map +1 -1
- package/dist/components/skeleton/SkeletonPage.d.ts +16 -0
- package/dist/components/skeleton/SkeletonPage.d.ts.map +1 -0
- package/dist/components/skeleton/SkeletonText.d.ts +1 -1
- package/dist/components/skeleton/SkeletonText.d.ts.map +1 -1
- package/dist/components/skeleton/index.d.ts +1 -0
- package/dist/components/skeleton/index.d.ts.map +1 -1
- package/dist/components/spinner/SpinnerDots.d.ts.map +1 -1
- package/dist/components/spinner/SpinnerRing.d.ts +1 -0
- package/dist/components/spinner/SpinnerRing.d.ts.map +1 -1
- package/dist/index.cjs +16 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -12
- package/dist/index.js.map +1 -1
- package/dist/index12.cjs +126 -37
- package/dist/index12.cjs.map +1 -1
- package/dist/index12.js +127 -38
- package/dist/index12.js.map +1 -1
- package/dist/index13.cjs +23 -11
- package/dist/index13.cjs.map +1 -1
- package/dist/index13.js +23 -11
- package/dist/index13.js.map +1 -1
- package/dist/index14.cjs +10 -32
- package/dist/index14.cjs.map +1 -1
- package/dist/index14.js +10 -32
- package/dist/index14.js.map +1 -1
- package/dist/index15.cjs +41 -24
- package/dist/index15.cjs.map +1 -1
- package/dist/index15.js +42 -25
- package/dist/index15.js.map +1 -1
- package/dist/index16.cjs +24 -37
- package/dist/index16.cjs.map +1 -1
- package/dist/index16.js +24 -37
- package/dist/index16.js.map +1 -1
- package/dist/index17.cjs +48 -58
- package/dist/index17.cjs.map +1 -1
- package/dist/index17.js +49 -59
- package/dist/index17.js.map +1 -1
- package/dist/index18.cjs +49 -53
- package/dist/index18.cjs.map +1 -1
- package/dist/index18.js +51 -55
- package/dist/index18.js.map +1 -1
- package/dist/index19.cjs +32 -16
- package/dist/index19.cjs.map +1 -1
- package/dist/index19.js +33 -17
- package/dist/index19.js.map +1 -1
- package/dist/index20.cjs +104 -26
- package/dist/index20.cjs.map +1 -1
- package/dist/index20.js +107 -29
- package/dist/index20.js.map +1 -1
- package/dist/index21.cjs +21 -26
- package/dist/index21.cjs.map +1 -1
- package/dist/index21.js +21 -26
- package/dist/index21.js.map +1 -1
- package/dist/index22.cjs +10 -12
- package/dist/index22.cjs.map +1 -1
- package/dist/index22.js +11 -13
- package/dist/index22.js.map +1 -1
- package/dist/index23.cjs +62 -16
- package/dist/index23.cjs.map +1 -1
- package/dist/index23.js +61 -15
- package/dist/index23.js.map +1 -1
- package/dist/index24.cjs +71 -0
- package/dist/index24.cjs.map +1 -0
- package/dist/index24.js +71 -0
- package/dist/index24.js.map +1 -0
- package/dist/index25.cjs +18 -0
- package/dist/index25.cjs.map +1 -0
- package/dist/index25.js +18 -0
- package/dist/index25.js.map +1 -0
- package/dist/index3.cjs +1 -1
- package/dist/index3.js +1 -1
- package/dist/index4.cjs +63 -3
- package/dist/index4.cjs.map +1 -1
- package/dist/index4.js +64 -4
- package/dist/index4.js.map +1 -1
- package/dist/index6.cjs +2 -1
- package/dist/index6.cjs.map +1 -1
- package/dist/index6.js +2 -1
- package/dist/index6.js.map +1 -1
- package/dist/premium-react-loaders.css +101 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/overlay.d.ts +24 -0
- package/dist/types/overlay.d.ts.map +1 -0
- package/dist/types/progress.d.ts +8 -0
- package/dist/types/progress.d.ts.map +1 -1
- package/dist/types/skeleton.d.ts +9 -0
- package/dist/types/skeleton.d.ts.map +1 -1
- package/dist/utils/colors.d.ts +14 -1
- package/dist/utils/colors.d.ts.map +1 -1
- package/package.json +7 -1
package/dist/index15.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
|
-
const sizeValue =
|
|
22
|
-
const
|
|
23
|
-
const
|
|
22
|
+
const sizeValue = colors.parseSizeToNumber(size, 40);
|
|
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=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/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/index15.js
CHANGED
|
@@ -1,58 +1,75 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { normalizeSize,
|
|
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
|
-
const sizeValue =
|
|
20
|
-
const
|
|
21
|
-
const
|
|
20
|
+
const sizeValue = parseSizeToNumber(size, 40);
|
|
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=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/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;"}
|
package/dist/index16.cjs
CHANGED
|
@@ -2,70 +2,57 @@
|
|
|
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 SpinnerBars = react.forwardRef(
|
|
8
8
|
({
|
|
9
9
|
size = 40,
|
|
10
10
|
color = "#3b82f6",
|
|
11
|
-
|
|
11
|
+
barCount = 5,
|
|
12
12
|
speed = "normal",
|
|
13
13
|
className,
|
|
14
14
|
style,
|
|
15
|
-
testId = "spinner-
|
|
15
|
+
testId = "spinner-bars",
|
|
16
16
|
visible = true,
|
|
17
17
|
ariaLabel = "Loading...",
|
|
18
18
|
...rest
|
|
19
19
|
}, ref) => {
|
|
20
20
|
if (!visible) return null;
|
|
21
|
-
const sizeValue =
|
|
22
|
-
const
|
|
21
|
+
const sizeValue = colors.parseSizeToNumber(size, 40);
|
|
22
|
+
const barWidth = Math.floor(sizeValue / (barCount * 2));
|
|
23
23
|
const animationDuration = colors.getAnimationDuration(speed);
|
|
24
24
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
25
25
|
"div",
|
|
26
26
|
{
|
|
27
27
|
ref,
|
|
28
28
|
"data-testid": testId,
|
|
29
|
-
className: classNames.cn("inline-flex items-center justify-center", className),
|
|
30
|
-
style
|
|
29
|
+
className: classNames.cn("inline-flex items-center justify-center gap-1", className),
|
|
30
|
+
style: {
|
|
31
|
+
height: colors.normalizeSize(size),
|
|
32
|
+
...style
|
|
33
|
+
},
|
|
31
34
|
role: "status",
|
|
32
35
|
"aria-label": ariaLabel,
|
|
33
36
|
"aria-busy": "true",
|
|
34
37
|
...rest,
|
|
35
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
38
|
+
children: Array.from({ length: barCount }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
36
39
|
"div",
|
|
37
40
|
{
|
|
38
|
-
className: "
|
|
41
|
+
className: "rounded-sm",
|
|
39
42
|
style: {
|
|
40
|
-
width:
|
|
41
|
-
height:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"div",
|
|
50
|
-
{
|
|
51
|
-
className: "rounded-sm",
|
|
52
|
-
style: {
|
|
53
|
-
width: `${cellSize}px`,
|
|
54
|
-
height: `${cellSize}px`,
|
|
55
|
-
backgroundColor: color,
|
|
56
|
-
animation: `fade-pulse ${animationDuration} ease-in-out infinite`,
|
|
57
|
-
animationDelay: `${delay}s`
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
index
|
|
61
|
-
);
|
|
62
|
-
})
|
|
63
|
-
}
|
|
64
|
-
)
|
|
43
|
+
width: `${barWidth}px`,
|
|
44
|
+
height: "100%",
|
|
45
|
+
backgroundColor: color,
|
|
46
|
+
animation: `pulse-wave ${animationDuration} ease-in-out infinite`,
|
|
47
|
+
animationDelay: `${index * 0.1}s`
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
index
|
|
51
|
+
))
|
|
65
52
|
}
|
|
66
53
|
);
|
|
67
54
|
}
|
|
68
55
|
);
|
|
69
|
-
|
|
70
|
-
exports.
|
|
56
|
+
SpinnerBars.displayName = "SpinnerBars";
|
|
57
|
+
exports.SpinnerBars = SpinnerBars;
|
|
71
58
|
//# 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/SpinnerBars.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerBarsProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration, parseSizeToNumber } from '../../utils';\n\n/**\n * SpinnerBars - Vertical bars with wave animation\n *\n * A spinner with vertical bars that animate in a wave pattern.\n *\n * @example\n * ```tsx\n * <SpinnerBars size={40} color=\"#3b82f6\" />\n * <SpinnerBars size={32} barCount={5} speed=\"fast\" />\n * ```\n */\nexport const SpinnerBars = forwardRef<HTMLDivElement, SpinnerBarsProps>(\n (\n {\n size = 40,\n color = '#3b82f6',\n barCount = 5,\n speed = 'normal',\n className,\n style,\n testId = 'spinner-bars',\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 barWidth = Math.floor(sizeValue / (barCount * 2));\n const animationDuration = getAnimationDuration(speed);\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('inline-flex items-center justify-center gap-1', className)}\n style={{\n height: normalizeSize(size),\n ...style,\n }}\n role=\"status\"\n aria-label={ariaLabel}\n aria-busy=\"true\"\n {...rest}\n >\n {Array.from({ length: barCount }).map((_, index) => (\n <div\n key={index}\n className=\"rounded-sm\"\n style={{\n width: `${barWidth}px`,\n height: '100%',\n backgroundColor: color,\n animation: `pulse-wave ${animationDuration} ease-in-out infinite`,\n animationDelay: `${index * 0.1}s`,\n }}\n />\n ))}\n </div>\n );\n }\n);\n\nSpinnerBars.displayName = 'SpinnerBars';\n"],"names":["forwardRef","parseSizeToNumber","getAnimationDuration","jsx","cn","normalizeSize"],"mappings":";;;;;;AAeO,MAAM,cAAcA,MAAAA;AAAAA,EACzB,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,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,WAAW,KAAK,MAAM,aAAa,WAAW,EAAE;AACtD,UAAM,oBAAoBC,OAAAA,qBAAqB,KAAK;AAEpD,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAWC,WAAAA,GAAG,iDAAiD,SAAS;AAAA,QACxE,OAAO;AAAA,UACL,QAAQC,OAAAA,cAAc,IAAI;AAAA,UAC1B,GAAG;AAAA,QAAA;AAAA,QAEL,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEH,UAAA,MAAM,KAAK,EAAE,QAAQ,UAAU,EAAE,IAAI,CAAC,GAAG,UACxCF,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YAEC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,OAAO,GAAG,QAAQ;AAAA,cAClB,QAAQ;AAAA,cACR,iBAAiB;AAAA,cACjB,WAAW,cAAc,iBAAiB;AAAA,cAC1C,gBAAgB,GAAG,QAAQ,GAAG;AAAA,YAAA;AAAA,UAChC;AAAA,UARK;AAAA,QAAA,CAUR;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,YAAY,cAAc;;"}
|
package/dist/index16.js
CHANGED
|
@@ -1,71 +1,58 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
+
import { normalizeSize, getAnimationDuration, parseSizeToNumber } from "./index4.js";
|
|
3
4
|
import { cn } from "./index3.js";
|
|
4
|
-
|
|
5
|
-
const SpinnerGrid = forwardRef(
|
|
5
|
+
const SpinnerBars = forwardRef(
|
|
6
6
|
({
|
|
7
7
|
size = 40,
|
|
8
8
|
color = "#3b82f6",
|
|
9
|
-
|
|
9
|
+
barCount = 5,
|
|
10
10
|
speed = "normal",
|
|
11
11
|
className,
|
|
12
12
|
style,
|
|
13
|
-
testId = "spinner-
|
|
13
|
+
testId = "spinner-bars",
|
|
14
14
|
visible = true,
|
|
15
15
|
ariaLabel = "Loading...",
|
|
16
16
|
...rest
|
|
17
17
|
}, ref) => {
|
|
18
18
|
if (!visible) return null;
|
|
19
|
-
const sizeValue =
|
|
20
|
-
const
|
|
19
|
+
const sizeValue = parseSizeToNumber(size, 40);
|
|
20
|
+
const barWidth = Math.floor(sizeValue / (barCount * 2));
|
|
21
21
|
const animationDuration = getAnimationDuration(speed);
|
|
22
22
|
return /* @__PURE__ */ jsx(
|
|
23
23
|
"div",
|
|
24
24
|
{
|
|
25
25
|
ref,
|
|
26
26
|
"data-testid": testId,
|
|
27
|
-
className: cn("inline-flex items-center justify-center", className),
|
|
28
|
-
style
|
|
27
|
+
className: cn("inline-flex items-center justify-center gap-1", className),
|
|
28
|
+
style: {
|
|
29
|
+
height: normalizeSize(size),
|
|
30
|
+
...style
|
|
31
|
+
},
|
|
29
32
|
role: "status",
|
|
30
33
|
"aria-label": ariaLabel,
|
|
31
34
|
"aria-busy": "true",
|
|
32
35
|
...rest,
|
|
33
|
-
children: /* @__PURE__ */ jsx(
|
|
36
|
+
children: Array.from({ length: barCount }).map((_, index) => /* @__PURE__ */ jsx(
|
|
34
37
|
"div",
|
|
35
38
|
{
|
|
36
|
-
className: "
|
|
39
|
+
className: "rounded-sm",
|
|
37
40
|
style: {
|
|
38
|
-
width:
|
|
39
|
-
height:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"div",
|
|
48
|
-
{
|
|
49
|
-
className: "rounded-sm",
|
|
50
|
-
style: {
|
|
51
|
-
width: `${cellSize}px`,
|
|
52
|
-
height: `${cellSize}px`,
|
|
53
|
-
backgroundColor: color,
|
|
54
|
-
animation: `fade-pulse ${animationDuration} ease-in-out infinite`,
|
|
55
|
-
animationDelay: `${delay}s`
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
index
|
|
59
|
-
);
|
|
60
|
-
})
|
|
61
|
-
}
|
|
62
|
-
)
|
|
41
|
+
width: `${barWidth}px`,
|
|
42
|
+
height: "100%",
|
|
43
|
+
backgroundColor: color,
|
|
44
|
+
animation: `pulse-wave ${animationDuration} ease-in-out infinite`,
|
|
45
|
+
animationDelay: `${index * 0.1}s`
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
index
|
|
49
|
+
))
|
|
63
50
|
}
|
|
64
51
|
);
|
|
65
52
|
}
|
|
66
53
|
);
|
|
67
|
-
|
|
54
|
+
SpinnerBars.displayName = "SpinnerBars";
|
|
68
55
|
export {
|
|
69
|
-
|
|
56
|
+
SpinnerBars
|
|
70
57
|
};
|
|
71
58
|
//# 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/SpinnerBars.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerBarsProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration, parseSizeToNumber } from '../../utils';\n\n/**\n * SpinnerBars - Vertical bars with wave animation\n *\n * A spinner with vertical bars that animate in a wave pattern.\n *\n * @example\n * ```tsx\n * <SpinnerBars size={40} color=\"#3b82f6\" />\n * <SpinnerBars size={32} barCount={5} speed=\"fast\" />\n * ```\n */\nexport const SpinnerBars = forwardRef<HTMLDivElement, SpinnerBarsProps>(\n (\n {\n size = 40,\n color = '#3b82f6',\n barCount = 5,\n speed = 'normal',\n className,\n style,\n testId = 'spinner-bars',\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 barWidth = Math.floor(sizeValue / (barCount * 2));\n const animationDuration = getAnimationDuration(speed);\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('inline-flex items-center justify-center gap-1', className)}\n style={{\n height: normalizeSize(size),\n ...style,\n }}\n role=\"status\"\n aria-label={ariaLabel}\n aria-busy=\"true\"\n {...rest}\n >\n {Array.from({ length: barCount }).map((_, index) => (\n <div\n key={index}\n className=\"rounded-sm\"\n style={{\n width: `${barWidth}px`,\n height: '100%',\n backgroundColor: color,\n animation: `pulse-wave ${animationDuration} ease-in-out infinite`,\n animationDelay: `${index * 0.1}s`,\n }}\n />\n ))}\n </div>\n );\n }\n);\n\nSpinnerBars.displayName = 'SpinnerBars';\n"],"names":[],"mappings":";;;;AAeO,MAAM,cAAc;AAAA,EACzB,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,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,WAAW,KAAK,MAAM,aAAa,WAAW,EAAE;AACtD,UAAM,oBAAoB,qBAAqB,KAAK;AAEpD,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAW,GAAG,iDAAiD,SAAS;AAAA,QACxE,OAAO;AAAA,UACL,QAAQ,cAAc,IAAI;AAAA,UAC1B,GAAG;AAAA,QAAA;AAAA,QAEL,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEH,UAAA,MAAM,KAAK,EAAE,QAAQ,UAAU,EAAE,IAAI,CAAC,GAAG,UACxC;AAAA,UAAC;AAAA,UAAA;AAAA,YAEC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,OAAO,GAAG,QAAQ;AAAA,cAClB,QAAQ;AAAA,cACR,iBAAiB;AAAA,cACjB,WAAW,cAAc,iBAAiB;AAAA,cAC1C,gBAAgB,GAAG,QAAQ,GAAG;AAAA,YAAA;AAAA,UAChC;AAAA,UARK;AAAA,QAAA,CAUR;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,YAAY,cAAc;"}
|
package/dist/index17.cjs
CHANGED
|
@@ -2,80 +2,70 @@
|
|
|
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 SpinnerGrid = react.forwardRef(
|
|
8
8
|
({
|
|
9
|
-
|
|
10
|
-
indeterminate = false,
|
|
11
|
-
showValue = false,
|
|
12
|
-
height = "0.5rem",
|
|
9
|
+
size = 40,
|
|
13
10
|
color = "#3b82f6",
|
|
14
|
-
|
|
11
|
+
gridSize = 3,
|
|
12
|
+
speed = "normal",
|
|
15
13
|
className,
|
|
16
14
|
style,
|
|
17
|
-
testId = "
|
|
15
|
+
testId = "spinner-grid",
|
|
18
16
|
visible = true,
|
|
19
|
-
ariaLabel,
|
|
17
|
+
ariaLabel = "Loading...",
|
|
20
18
|
...rest
|
|
21
19
|
}, ref) => {
|
|
22
20
|
if (!visible) return null;
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
|
|
21
|
+
const sizeValue = colors.parseSizeToNumber(size, 40);
|
|
22
|
+
const cellSize = Math.floor(sizeValue / gridSize) - 2;
|
|
23
|
+
const animationDuration = colors.getAnimationDuration(speed);
|
|
24
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
26
25
|
"div",
|
|
27
26
|
{
|
|
28
27
|
ref,
|
|
29
28
|
"data-testid": testId,
|
|
30
|
-
className: classNames.cn("
|
|
31
|
-
style
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
role: "progressbar",
|
|
37
|
-
"aria-label": progressLabel,
|
|
38
|
-
"aria-valuenow": indeterminate ? void 0 : clampedValue,
|
|
39
|
-
"aria-valuemin": 0,
|
|
40
|
-
"aria-valuemax": 100,
|
|
29
|
+
className: classNames.cn("inline-flex items-center justify-center", className),
|
|
30
|
+
style,
|
|
31
|
+
role: "status",
|
|
32
|
+
"aria-label": ariaLabel,
|
|
33
|
+
"aria-busy": "true",
|
|
41
34
|
...rest,
|
|
42
|
-
children:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
)
|
|
74
|
-
]
|
|
35
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
className: "grid gap-0.5",
|
|
39
|
+
style: {
|
|
40
|
+
width: colors.normalizeSize(size),
|
|
41
|
+
height: colors.normalizeSize(size),
|
|
42
|
+
gridTemplateColumns: `repeat(${gridSize}, 1fr)`
|
|
43
|
+
},
|
|
44
|
+
children: Array.from({ length: gridSize * gridSize }).map((_, index) => {
|
|
45
|
+
const row = Math.floor(index / gridSize);
|
|
46
|
+
const col = index % gridSize;
|
|
47
|
+
const delay = (row + col) * 0.1;
|
|
48
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
className: "rounded-sm",
|
|
52
|
+
style: {
|
|
53
|
+
width: `${cellSize}px`,
|
|
54
|
+
height: `${cellSize}px`,
|
|
55
|
+
backgroundColor: color,
|
|
56
|
+
animation: `fade-pulse ${animationDuration} ease-in-out infinite`,
|
|
57
|
+
animationDelay: `${delay}s`
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
index
|
|
61
|
+
);
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
)
|
|
75
65
|
}
|
|
76
66
|
);
|
|
77
67
|
}
|
|
78
68
|
);
|
|
79
|
-
|
|
80
|
-
exports.
|
|
69
|
+
SpinnerGrid.displayName = "SpinnerGrid";
|
|
70
|
+
exports.SpinnerGrid = SpinnerGrid;
|
|
81
71
|
//# sourceMappingURL=index17.cjs.map
|