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/index13.cjs
CHANGED
|
@@ -2,62 +2,81 @@
|
|
|
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 Skeleton = require("./index5.cjs");
|
|
5
6
|
const colors = require("./index4.cjs");
|
|
6
7
|
const classNames = require("./index3.cjs");
|
|
7
|
-
const
|
|
8
|
+
const SkeletonForm = react.forwardRef(
|
|
8
9
|
({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
fields = 3,
|
|
11
|
+
showLabels = true,
|
|
12
|
+
showButton = true,
|
|
13
|
+
gap = 16,
|
|
14
|
+
buttonWidth = "120px",
|
|
15
|
+
buttonPosition = "left",
|
|
16
|
+
animate = true,
|
|
17
|
+
baseColor,
|
|
18
|
+
highlightColor,
|
|
13
19
|
className,
|
|
14
20
|
style,
|
|
15
|
-
testId = "
|
|
21
|
+
testId = "skeleton-form",
|
|
16
22
|
visible = true,
|
|
17
|
-
ariaLabel = "Loading...",
|
|
18
23
|
...rest
|
|
19
24
|
}, ref) => {
|
|
20
25
|
if (!visible) return null;
|
|
21
|
-
|
|
26
|
+
const gapValue = colors.normalizeSize(gap);
|
|
27
|
+
const buttonAlign = buttonPosition === "left" ? "justify-start" : buttonPosition === "right" ? "justify-end" : "justify-center";
|
|
28
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
22
29
|
"div",
|
|
23
30
|
{
|
|
24
31
|
ref,
|
|
25
32
|
"data-testid": testId,
|
|
26
|
-
className: classNames.cn("
|
|
27
|
-
style,
|
|
33
|
+
className: classNames.cn("w-full", className),
|
|
34
|
+
style: { ...style, display: "flex", flexDirection: "column", gap: gapValue },
|
|
28
35
|
role: "status",
|
|
29
|
-
"aria-label":
|
|
36
|
+
"aria-label": "Loading form...",
|
|
30
37
|
"aria-busy": "true",
|
|
31
38
|
...rest,
|
|
32
|
-
children:
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
style: {
|
|
37
|
-
width: colors.normalizeSize(size),
|
|
38
|
-
height: colors.normalizeSize(size),
|
|
39
|
-
animationDuration: colors.getAnimationDuration(speed)
|
|
40
|
-
},
|
|
41
|
-
viewBox: "0 0 50 50",
|
|
42
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
43
|
-
"circle",
|
|
39
|
+
children: [
|
|
40
|
+
Array.from({ length: fields }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
41
|
+
showLabels && /* @__PURE__ */ jsxRuntime.jsx(
|
|
42
|
+
Skeleton.Skeleton,
|
|
44
43
|
{
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
width: "30%",
|
|
45
|
+
height: "0.875rem",
|
|
46
|
+
variant: "text",
|
|
47
|
+
animate,
|
|
48
|
+
baseColor,
|
|
49
|
+
highlightColor
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
53
|
+
Skeleton.Skeleton,
|
|
54
|
+
{
|
|
55
|
+
width: "100%",
|
|
56
|
+
height: "2.5rem",
|
|
57
|
+
variant: "rectangular",
|
|
58
|
+
animate,
|
|
59
|
+
baseColor,
|
|
60
|
+
highlightColor
|
|
53
61
|
}
|
|
54
62
|
)
|
|
55
|
-
}
|
|
56
|
-
|
|
63
|
+
] }, index)),
|
|
64
|
+
showButton && /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames.cn("flex", buttonAlign), style: { marginTop: "8px" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
65
|
+
Skeleton.Skeleton,
|
|
66
|
+
{
|
|
67
|
+
width: buttonWidth,
|
|
68
|
+
height: "2.5rem",
|
|
69
|
+
variant: "rounded",
|
|
70
|
+
animate,
|
|
71
|
+
baseColor,
|
|
72
|
+
highlightColor
|
|
73
|
+
}
|
|
74
|
+
) })
|
|
75
|
+
]
|
|
57
76
|
}
|
|
58
77
|
);
|
|
59
78
|
}
|
|
60
79
|
);
|
|
61
|
-
|
|
62
|
-
exports.
|
|
80
|
+
SkeletonForm.displayName = "SkeletonForm";
|
|
81
|
+
exports.SkeletonForm = SkeletonForm;
|
|
63
82
|
//# sourceMappingURL=index13.cjs.map
|
package/dist/index13.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index13.cjs","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index13.cjs","sources":["../src/components/skeleton/SkeletonForm.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SkeletonFormProps } from '../../types';\nimport { cn, normalizeSize } from '../../utils';\nimport { Skeleton } from './Skeleton';\n\n/**\n * SkeletonForm - Form loading skeleton\n *\n * A skeleton loader for form layouts with configurable fields, labels, and submit button.\n *\n * @example\n * ```tsx\n * <SkeletonForm />\n * <SkeletonForm fields={5} showLabels={true} />\n * <SkeletonForm fields={3} showButton={false} />\n * <SkeletonForm fields={4} buttonPosition=\"right\" />\n * ```\n */\nexport const SkeletonForm = forwardRef<HTMLDivElement, SkeletonFormProps>(\n (\n {\n fields = 3,\n showLabels = true,\n showButton = true,\n gap = 16,\n buttonWidth = '120px',\n buttonPosition = 'left',\n animate = true,\n baseColor,\n highlightColor,\n className,\n style,\n testId = 'skeleton-form',\n visible = true,\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const gapValue = normalizeSize(gap);\n const buttonAlign =\n buttonPosition === 'left'\n ? 'justify-start'\n : buttonPosition === 'right'\n ? 'justify-end'\n : 'justify-center';\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('w-full', className)}\n style={{ ...style, display: 'flex', flexDirection: 'column', gap: gapValue }}\n role=\"status\"\n aria-label=\"Loading form...\"\n aria-busy=\"true\"\n {...rest}\n >\n {/* Form Fields */}\n {Array.from({ length: fields }).map((_, index) => (\n <div key={index} className=\"w-full\" style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>\n {/* Field Label */}\n {showLabels && (\n <Skeleton\n width=\"30%\"\n height=\"0.875rem\"\n variant=\"text\"\n animate={animate}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n )}\n {/* Field Input */}\n <Skeleton\n width=\"100%\"\n height=\"2.5rem\"\n variant=\"rectangular\"\n animate={animate}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n </div>\n ))}\n\n {/* Submit Button */}\n {showButton && (\n <div className={cn('flex', buttonAlign)} style={{ marginTop: '8px' }}>\n <Skeleton\n width={buttonWidth}\n height=\"2.5rem\"\n variant=\"rounded\"\n animate={animate}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n </div>\n )}\n </div>\n );\n }\n);\n\nSkeletonForm.displayName = 'SkeletonForm';\n"],"names":["forwardRef","normalizeSize","jsxs","cn","jsx","Skeleton"],"mappings":";;;;;;;AAkBO,MAAM,eAAeA,MAAAA;AAAAA,EAC1B,CACE;AAAA,IACE,SAAS;AAAA,IACT,aAAa;AAAA,IACb,aAAa;AAAA,IACb,MAAM;AAAA,IACN,cAAc;AAAA,IACd,iBAAiB;AAAA,IACjB,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,UAAM,WAAWC,OAAAA,cAAc,GAAG;AAClC,UAAM,cACJ,mBAAmB,SACf,kBACA,mBAAmB,UACnB,gBACA;AAEN,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAWC,WAAAA,GAAG,UAAU,SAAS;AAAA,QACjC,OAAO,EAAE,GAAG,OAAO,SAAS,QAAQ,eAAe,UAAU,KAAK,SAAA;AAAA,QAClE,MAAK;AAAA,QACL,cAAW;AAAA,QACX,aAAU;AAAA,QACT,GAAG;AAAA,QAGH,UAAA;AAAA,UAAA,MAAM,KAAK,EAAE,QAAQ,OAAA,CAAQ,EAAE,IAAI,CAAC,GAAG,UACtCD,2BAAAA,KAAC,SAAgB,WAAU,UAAS,OAAO,EAAE,SAAS,QAAQ,eAAe,UAAU,KAAK,MAAA,GAEzF,UAAA;AAAA,YAAA,cACCE,2BAAAA;AAAAA,cAACC,SAAAA;AAAAA,cAAA;AAAA,gBACC,OAAM;AAAA,gBACN,QAAO;AAAA,gBACP,SAAQ;AAAA,gBACR;AAAA,gBACA;AAAA,gBACA;AAAA,cAAA;AAAA,YAAA;AAAA,YAIJD,2BAAAA;AAAAA,cAACC,SAAAA;AAAAA,cAAA;AAAA,gBACC,OAAM;AAAA,gBACN,QAAO;AAAA,gBACP,SAAQ;AAAA,gBACR;AAAA,gBACA;AAAA,gBACA;AAAA,cAAA;AAAA,YAAA;AAAA,UACF,EAAA,GApBQ,KAqBV,CACD;AAAA,UAGA,cACCD,2BAAAA,IAAC,OAAA,EAAI,WAAWD,WAAAA,GAAG,QAAQ,WAAW,GAAG,OAAO,EAAE,WAAW,MAAA,GAC3D,UAAAC,2BAAAA;AAAAA,YAACC,SAAAA;AAAAA,YAAA;AAAA,cACC,OAAO;AAAA,cACP,QAAO;AAAA,cACP,SAAQ;AAAA,cACR;AAAA,cACA;AAAA,cACA;AAAA,YAAA;AAAA,UAAA,EACF,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,aAAa,cAAc;;"}
|
package/dist/index13.js
CHANGED
|
@@ -1,63 +1,82 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { Skeleton } from "./index5.js";
|
|
4
|
+
import { normalizeSize } from "./index4.js";
|
|
4
5
|
import { cn } from "./index3.js";
|
|
5
|
-
const
|
|
6
|
+
const SkeletonForm = forwardRef(
|
|
6
7
|
({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
fields = 3,
|
|
9
|
+
showLabels = true,
|
|
10
|
+
showButton = true,
|
|
11
|
+
gap = 16,
|
|
12
|
+
buttonWidth = "120px",
|
|
13
|
+
buttonPosition = "left",
|
|
14
|
+
animate = true,
|
|
15
|
+
baseColor,
|
|
16
|
+
highlightColor,
|
|
11
17
|
className,
|
|
12
18
|
style,
|
|
13
|
-
testId = "
|
|
19
|
+
testId = "skeleton-form",
|
|
14
20
|
visible = true,
|
|
15
|
-
ariaLabel = "Loading...",
|
|
16
21
|
...rest
|
|
17
22
|
}, ref) => {
|
|
18
23
|
if (!visible) return null;
|
|
19
|
-
|
|
24
|
+
const gapValue = normalizeSize(gap);
|
|
25
|
+
const buttonAlign = buttonPosition === "left" ? "justify-start" : buttonPosition === "right" ? "justify-end" : "justify-center";
|
|
26
|
+
return /* @__PURE__ */ jsxs(
|
|
20
27
|
"div",
|
|
21
28
|
{
|
|
22
29
|
ref,
|
|
23
30
|
"data-testid": testId,
|
|
24
|
-
className: cn("
|
|
25
|
-
style,
|
|
31
|
+
className: cn("w-full", className),
|
|
32
|
+
style: { ...style, display: "flex", flexDirection: "column", gap: gapValue },
|
|
26
33
|
role: "status",
|
|
27
|
-
"aria-label":
|
|
34
|
+
"aria-label": "Loading form...",
|
|
28
35
|
"aria-busy": "true",
|
|
29
36
|
...rest,
|
|
30
|
-
children:
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
style: {
|
|
35
|
-
width: normalizeSize(size),
|
|
36
|
-
height: normalizeSize(size),
|
|
37
|
-
animationDuration: getAnimationDuration(speed)
|
|
38
|
-
},
|
|
39
|
-
viewBox: "0 0 50 50",
|
|
40
|
-
children: /* @__PURE__ */ jsx(
|
|
41
|
-
"circle",
|
|
37
|
+
children: [
|
|
38
|
+
Array.from({ length: fields }).map((_, index) => /* @__PURE__ */ jsxs("div", { className: "w-full", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
39
|
+
showLabels && /* @__PURE__ */ jsx(
|
|
40
|
+
Skeleton,
|
|
42
41
|
{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
width: "30%",
|
|
43
|
+
height: "0.875rem",
|
|
44
|
+
variant: "text",
|
|
45
|
+
animate,
|
|
46
|
+
baseColor,
|
|
47
|
+
highlightColor
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
/* @__PURE__ */ jsx(
|
|
51
|
+
Skeleton,
|
|
52
|
+
{
|
|
53
|
+
width: "100%",
|
|
54
|
+
height: "2.5rem",
|
|
55
|
+
variant: "rectangular",
|
|
56
|
+
animate,
|
|
57
|
+
baseColor,
|
|
58
|
+
highlightColor
|
|
51
59
|
}
|
|
52
60
|
)
|
|
53
|
-
}
|
|
54
|
-
|
|
61
|
+
] }, index)),
|
|
62
|
+
showButton && /* @__PURE__ */ jsx("div", { className: cn("flex", buttonAlign), style: { marginTop: "8px" }, children: /* @__PURE__ */ jsx(
|
|
63
|
+
Skeleton,
|
|
64
|
+
{
|
|
65
|
+
width: buttonWidth,
|
|
66
|
+
height: "2.5rem",
|
|
67
|
+
variant: "rounded",
|
|
68
|
+
animate,
|
|
69
|
+
baseColor,
|
|
70
|
+
highlightColor
|
|
71
|
+
}
|
|
72
|
+
) })
|
|
73
|
+
]
|
|
55
74
|
}
|
|
56
75
|
);
|
|
57
76
|
}
|
|
58
77
|
);
|
|
59
|
-
|
|
78
|
+
SkeletonForm.displayName = "SkeletonForm";
|
|
60
79
|
export {
|
|
61
|
-
|
|
80
|
+
SkeletonForm
|
|
62
81
|
};
|
|
63
82
|
//# sourceMappingURL=index13.js.map
|
package/dist/index13.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index13.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index13.js","sources":["../src/components/skeleton/SkeletonForm.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SkeletonFormProps } from '../../types';\nimport { cn, normalizeSize } from '../../utils';\nimport { Skeleton } from './Skeleton';\n\n/**\n * SkeletonForm - Form loading skeleton\n *\n * A skeleton loader for form layouts with configurable fields, labels, and submit button.\n *\n * @example\n * ```tsx\n * <SkeletonForm />\n * <SkeletonForm fields={5} showLabels={true} />\n * <SkeletonForm fields={3} showButton={false} />\n * <SkeletonForm fields={4} buttonPosition=\"right\" />\n * ```\n */\nexport const SkeletonForm = forwardRef<HTMLDivElement, SkeletonFormProps>(\n (\n {\n fields = 3,\n showLabels = true,\n showButton = true,\n gap = 16,\n buttonWidth = '120px',\n buttonPosition = 'left',\n animate = true,\n baseColor,\n highlightColor,\n className,\n style,\n testId = 'skeleton-form',\n visible = true,\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const gapValue = normalizeSize(gap);\n const buttonAlign =\n buttonPosition === 'left'\n ? 'justify-start'\n : buttonPosition === 'right'\n ? 'justify-end'\n : 'justify-center';\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('w-full', className)}\n style={{ ...style, display: 'flex', flexDirection: 'column', gap: gapValue }}\n role=\"status\"\n aria-label=\"Loading form...\"\n aria-busy=\"true\"\n {...rest}\n >\n {/* Form Fields */}\n {Array.from({ length: fields }).map((_, index) => (\n <div key={index} className=\"w-full\" style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>\n {/* Field Label */}\n {showLabels && (\n <Skeleton\n width=\"30%\"\n height=\"0.875rem\"\n variant=\"text\"\n animate={animate}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n )}\n {/* Field Input */}\n <Skeleton\n width=\"100%\"\n height=\"2.5rem\"\n variant=\"rectangular\"\n animate={animate}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n </div>\n ))}\n\n {/* Submit Button */}\n {showButton && (\n <div className={cn('flex', buttonAlign)} style={{ marginTop: '8px' }}>\n <Skeleton\n width={buttonWidth}\n height=\"2.5rem\"\n variant=\"rounded\"\n animate={animate}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n </div>\n )}\n </div>\n );\n }\n);\n\nSkeletonForm.displayName = 'SkeletonForm';\n"],"names":[],"mappings":";;;;;AAkBO,MAAM,eAAe;AAAA,EAC1B,CACE;AAAA,IACE,SAAS;AAAA,IACT,aAAa;AAAA,IACb,aAAa;AAAA,IACb,MAAM;AAAA,IACN,cAAc;AAAA,IACd,iBAAiB;AAAA,IACjB,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,UAAM,WAAW,cAAc,GAAG;AAClC,UAAM,cACJ,mBAAmB,SACf,kBACA,mBAAmB,UACnB,gBACA;AAEN,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAW,GAAG,UAAU,SAAS;AAAA,QACjC,OAAO,EAAE,GAAG,OAAO,SAAS,QAAQ,eAAe,UAAU,KAAK,SAAA;AAAA,QAClE,MAAK;AAAA,QACL,cAAW;AAAA,QACX,aAAU;AAAA,QACT,GAAG;AAAA,QAGH,UAAA;AAAA,UAAA,MAAM,KAAK,EAAE,QAAQ,OAAA,CAAQ,EAAE,IAAI,CAAC,GAAG,UACtC,qBAAC,SAAgB,WAAU,UAAS,OAAO,EAAE,SAAS,QAAQ,eAAe,UAAU,KAAK,MAAA,GAEzF,UAAA;AAAA,YAAA,cACC;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,OAAM;AAAA,gBACN,QAAO;AAAA,gBACP,SAAQ;AAAA,gBACR;AAAA,gBACA;AAAA,gBACA;AAAA,cAAA;AAAA,YAAA;AAAA,YAIJ;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,OAAM;AAAA,gBACN,QAAO;AAAA,gBACP,SAAQ;AAAA,gBACR;AAAA,gBACA;AAAA,gBACA;AAAA,cAAA;AAAA,YAAA;AAAA,UACF,EAAA,GApBQ,KAqBV,CACD;AAAA,UAGA,cACC,oBAAC,OAAA,EAAI,WAAW,GAAG,QAAQ,WAAW,GAAG,OAAO,EAAE,WAAW,MAAA,GAC3D,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,OAAO;AAAA,cACP,QAAO;AAAA,cACP,SAAQ;AAAA,cACR;AAAA,cACA;AAAA,cACA;AAAA,YAAA;AAAA,UAAA,EACF,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,aAAa,cAAc;"}
|
package/dist/index14.cjs
CHANGED
|
@@ -2,23 +2,27 @@
|
|
|
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 hooks = require("./index31.cjs");
|
|
5
6
|
const classNames = require("./index3.cjs");
|
|
6
7
|
const colors = require("./index4.cjs");
|
|
7
|
-
const
|
|
8
|
+
const SpinnerCircle = react.forwardRef(
|
|
8
9
|
({
|
|
9
|
-
size =
|
|
10
|
+
size = "md",
|
|
10
11
|
color = "#3b82f6",
|
|
11
|
-
secondaryColor = "rgba(0, 0, 0, 0.1)",
|
|
12
12
|
thickness = 4,
|
|
13
13
|
speed = "normal",
|
|
14
|
+
reverse = false,
|
|
15
|
+
respectMotionPreference = true,
|
|
14
16
|
className,
|
|
15
17
|
style,
|
|
16
|
-
testId = "spinner-
|
|
18
|
+
testId = "spinner-circle",
|
|
17
19
|
visible = true,
|
|
18
20
|
ariaLabel = "Loading...",
|
|
19
21
|
...rest
|
|
20
22
|
}, ref) => {
|
|
21
23
|
if (!visible) return null;
|
|
24
|
+
const prefersReducedMotion = hooks.useReducedMotion();
|
|
25
|
+
const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
22
26
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
23
27
|
"div",
|
|
24
28
|
{
|
|
@@ -31,22 +35,35 @@ const SpinnerRing = react.forwardRef(
|
|
|
31
35
|
"aria-busy": "true",
|
|
32
36
|
...rest,
|
|
33
37
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
34
|
-
"
|
|
38
|
+
"svg",
|
|
35
39
|
{
|
|
36
|
-
className: "
|
|
40
|
+
className: "animate-spinner-rotate",
|
|
37
41
|
style: {
|
|
38
42
|
width: colors.normalizeSize(size),
|
|
39
43
|
height: colors.normalizeSize(size),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
animationDuration: effectiveDuration,
|
|
45
|
+
animationDirection: reverse ? "reverse" : "normal"
|
|
46
|
+
},
|
|
47
|
+
viewBox: "0 0 50 50",
|
|
48
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
49
|
+
"circle",
|
|
50
|
+
{
|
|
51
|
+
cx: "25",
|
|
52
|
+
cy: "25",
|
|
53
|
+
r: 25 - thickness * 2,
|
|
54
|
+
fill: "none",
|
|
55
|
+
stroke: color,
|
|
56
|
+
strokeWidth: thickness,
|
|
57
|
+
strokeDasharray: "80, 200",
|
|
58
|
+
strokeLinecap: "round"
|
|
59
|
+
}
|
|
60
|
+
)
|
|
44
61
|
}
|
|
45
62
|
)
|
|
46
63
|
}
|
|
47
64
|
);
|
|
48
65
|
}
|
|
49
66
|
);
|
|
50
|
-
|
|
51
|
-
exports.
|
|
67
|
+
SpinnerCircle.displayName = "SpinnerCircle";
|
|
68
|
+
exports.SpinnerCircle = SpinnerCircle;
|
|
52
69
|
//# 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, useReducedMotion, getEffectiveDuration } 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=\"lg\" thickness={3} speed=\"fast\" />\n * <SpinnerCircle size=\"md\" reverse />\n * ```\n */\nexport const SpinnerCircle = forwardRef<HTMLDivElement, SpinnerCircleProps>(\n (\n {\n size = 'md',\n color = '#3b82f6',\n thickness = 4,\n speed = 'normal',\n reverse = false,\n respectMotionPreference = true,\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 const prefersReducedMotion = useReducedMotion();\n const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);\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: effectiveDuration,\n animationDirection: reverse ? 'reverse' : 'normal',\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","useReducedMotion","getEffectiveDuration","jsx","cn","normalizeSize"],"mappings":";;;;;;;AAgBO,MAAM,gBAAgBA,MAAAA;AAAAA,EAC3B,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,0BAA0B;AAAA,IAC1B;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,uBAAuBC,MAAAA,iBAAA;AAC7B,UAAM,oBAAoBC,MAAAA,qBAAqB,OAAO,yBAAyB,oBAAoB;AAEnG,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,mBAAmB;AAAA,cACnB,oBAAoB,UAAU,YAAY;AAAA,YAAA;AAAA,YAE5C,SAAQ;AAAA,YAER,UAAAF,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,22 +1,26 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
+
import { useReducedMotion, getEffectiveDuration } from "./index31.js";
|
|
3
4
|
import { cn } from "./index3.js";
|
|
4
|
-
import {
|
|
5
|
-
const
|
|
5
|
+
import { normalizeSize } from "./index4.js";
|
|
6
|
+
const SpinnerCircle = forwardRef(
|
|
6
7
|
({
|
|
7
|
-
size =
|
|
8
|
+
size = "md",
|
|
8
9
|
color = "#3b82f6",
|
|
9
|
-
secondaryColor = "rgba(0, 0, 0, 0.1)",
|
|
10
10
|
thickness = 4,
|
|
11
11
|
speed = "normal",
|
|
12
|
+
reverse = false,
|
|
13
|
+
respectMotionPreference = true,
|
|
12
14
|
className,
|
|
13
15
|
style,
|
|
14
|
-
testId = "spinner-
|
|
16
|
+
testId = "spinner-circle",
|
|
15
17
|
visible = true,
|
|
16
18
|
ariaLabel = "Loading...",
|
|
17
19
|
...rest
|
|
18
20
|
}, ref) => {
|
|
19
21
|
if (!visible) return null;
|
|
22
|
+
const prefersReducedMotion = useReducedMotion();
|
|
23
|
+
const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
20
24
|
return /* @__PURE__ */ jsx(
|
|
21
25
|
"div",
|
|
22
26
|
{
|
|
@@ -29,24 +33,37 @@ const SpinnerRing = forwardRef(
|
|
|
29
33
|
"aria-busy": "true",
|
|
30
34
|
...rest,
|
|
31
35
|
children: /* @__PURE__ */ jsx(
|
|
32
|
-
"
|
|
36
|
+
"svg",
|
|
33
37
|
{
|
|
34
|
-
className: "
|
|
38
|
+
className: "animate-spinner-rotate",
|
|
35
39
|
style: {
|
|
36
40
|
width: normalizeSize(size),
|
|
37
41
|
height: normalizeSize(size),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
animationDuration: effectiveDuration,
|
|
43
|
+
animationDirection: reverse ? "reverse" : "normal"
|
|
44
|
+
},
|
|
45
|
+
viewBox: "0 0 50 50",
|
|
46
|
+
children: /* @__PURE__ */ jsx(
|
|
47
|
+
"circle",
|
|
48
|
+
{
|
|
49
|
+
cx: "25",
|
|
50
|
+
cy: "25",
|
|
51
|
+
r: 25 - thickness * 2,
|
|
52
|
+
fill: "none",
|
|
53
|
+
stroke: color,
|
|
54
|
+
strokeWidth: thickness,
|
|
55
|
+
strokeDasharray: "80, 200",
|
|
56
|
+
strokeLinecap: "round"
|
|
57
|
+
}
|
|
58
|
+
)
|
|
42
59
|
}
|
|
43
60
|
)
|
|
44
61
|
}
|
|
45
62
|
);
|
|
46
63
|
}
|
|
47
64
|
);
|
|
48
|
-
|
|
65
|
+
SpinnerCircle.displayName = "SpinnerCircle";
|
|
49
66
|
export {
|
|
50
|
-
|
|
67
|
+
SpinnerCircle
|
|
51
68
|
};
|
|
52
69
|
//# 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, useReducedMotion, getEffectiveDuration } 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=\"lg\" thickness={3} speed=\"fast\" />\n * <SpinnerCircle size=\"md\" reverse />\n * ```\n */\nexport const SpinnerCircle = forwardRef<HTMLDivElement, SpinnerCircleProps>(\n (\n {\n size = 'md',\n color = '#3b82f6',\n thickness = 4,\n speed = 'normal',\n reverse = false,\n respectMotionPreference = true,\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 const prefersReducedMotion = useReducedMotion();\n const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);\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: effectiveDuration,\n animationDirection: reverse ? 'reverse' : 'normal',\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":";;;;;AAgBO,MAAM,gBAAgB;AAAA,EAC3B,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,0BAA0B;AAAA,IAC1B;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,uBAAuB,iBAAA;AAC7B,UAAM,oBAAoB,qBAAqB,OAAO,yBAAyB,oBAAoB;AAEnG,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;AAAA,cACnB,oBAAoB,UAAU,YAAY;AAAA,YAAA;AAAA,YAE5C,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,28 @@
|
|
|
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
|
|
5
|
+
const hooks = require("./index31.cjs");
|
|
6
6
|
const classNames = require("./index3.cjs");
|
|
7
|
-
const
|
|
7
|
+
const colors = require("./index4.cjs");
|
|
8
|
+
const SpinnerRing = react.forwardRef(
|
|
8
9
|
({
|
|
9
|
-
size =
|
|
10
|
+
size = "md",
|
|
10
11
|
color = "#3b82f6",
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
secondaryColor = "rgba(0, 0, 0, 0.1)",
|
|
13
|
+
thickness = 4,
|
|
13
14
|
speed = "normal",
|
|
15
|
+
reverse = false,
|
|
16
|
+
respectMotionPreference = true,
|
|
14
17
|
className,
|
|
15
18
|
style,
|
|
16
|
-
testId = "spinner-
|
|
19
|
+
testId = "spinner-ring",
|
|
17
20
|
visible = true,
|
|
18
21
|
ariaLabel = "Loading...",
|
|
19
22
|
...rest
|
|
20
23
|
}, ref) => {
|
|
21
24
|
if (!visible) return null;
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const radius = (sizeValue - dotSizeValue) / 2;
|
|
25
|
+
const prefersReducedMotion = hooks.useReducedMotion();
|
|
26
|
+
const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
25
27
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
26
28
|
"div",
|
|
27
29
|
{
|
|
@@ -36,40 +38,21 @@ const SpinnerDots = react.forwardRef(
|
|
|
36
38
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37
39
|
"div",
|
|
38
40
|
{
|
|
39
|
-
className: "
|
|
41
|
+
className: "rounded-full",
|
|
40
42
|
style: {
|
|
41
43
|
width: colors.normalizeSize(size),
|
|
42
44
|
height: colors.normalizeSize(size),
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
})
|
|
45
|
+
border: `${thickness}px solid ${secondaryColor}`,
|
|
46
|
+
borderTopColor: color,
|
|
47
|
+
animation: `spinner-rotate ${effectiveDuration} linear infinite`,
|
|
48
|
+
animationDirection: reverse ? "reverse" : "normal"
|
|
49
|
+
}
|
|
67
50
|
}
|
|
68
51
|
)
|
|
69
52
|
}
|
|
70
53
|
);
|
|
71
54
|
}
|
|
72
55
|
);
|
|
73
|
-
|
|
74
|
-
exports.
|
|
56
|
+
SpinnerRing.displayName = "SpinnerRing";
|
|
57
|
+
exports.SpinnerRing = SpinnerRing;
|
|
75
58
|
//# 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, useReducedMotion, getEffectiveDuration } 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=\"lg\" color=\"#8b5cf6\" />\n * <SpinnerRing size=\"sm\" thickness={3} speed=\"slow\" />\n * <SpinnerRing size=\"md\" color=\"#3b82f6\" secondaryColor=\"#e0e0e0\" reverse />\n * ```\n */\nexport const SpinnerRing = forwardRef<HTMLDivElement, SpinnerRingProps>(\n (\n {\n size = 'md',\n color = '#3b82f6',\n secondaryColor = 'rgba(0, 0, 0, 0.1)',\n thickness = 4,\n speed = 'normal',\n reverse = false,\n respectMotionPreference = true,\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 const prefersReducedMotion = useReducedMotion();\n const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);\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 ${effectiveDuration} linear infinite`,\n animationDirection: reverse ? 'reverse' : 'normal',\n }}\n />\n </div>\n );\n }\n);\n\nSpinnerRing.displayName = 'SpinnerRing';\n"],"names":["forwardRef","useReducedMotion","getEffectiveDuration","jsx","cn","normalizeSize"],"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,UAAU;AAAA,IACV,0BAA0B;AAAA,IAC1B;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,uBAAuBC,MAAAA,iBAAA;AAC7B,UAAM,oBAAoBC,MAAAA,qBAAqB,OAAO,yBAAyB,oBAAoB;AAEnG,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,kBAAkB,iBAAiB;AAAA,cAC9C,oBAAoB,UAAU,YAAY;AAAA,YAAA;AAAA,UAC5C;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,YAAY,cAAc;;"}
|