premium-react-loaders 1.3.0 → 2.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/README.md +264 -30
- package/dist/components/pulse/TypingIndicator.d.ts.map +1 -1
- package/dist/context/ThemeContext.d.ts +84 -0
- package/dist/context/ThemeContext.d.ts.map +1 -0
- package/dist/context/index.d.ts +3 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/useLoader.d.ts +56 -0
- package/dist/hooks/useLoader.d.ts.map +1 -0
- package/dist/index.cjs +31 -27
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +31 -27
- package/dist/index10.cjs +20 -32
- package/dist/index10.js +20 -32
- package/dist/index11.cjs +47 -26
- package/dist/index11.js +47 -26
- package/dist/index12.cjs +30 -127
- package/dist/index12.js +31 -128
- package/dist/index13.cjs +30 -54
- package/dist/index13.js +30 -54
- package/dist/index14.cjs +127 -44
- package/dist/index14.js +128 -45
- package/dist/index15.cjs +58 -38
- package/dist/index15.js +59 -39
- package/dist/index16.cjs +24 -37
- package/dist/index16.js +24 -37
- package/dist/index17.cjs +19 -22
- package/dist/index17.js +19 -22
- package/dist/index18.cjs +25 -21
- package/dist/index18.js +25 -21
- package/dist/index19.cjs +22 -33
- package/dist/index19.js +22 -33
- package/dist/index20.cjs +26 -36
- package/dist/index20.js +28 -38
- package/dist/index21.cjs +40 -77
- package/dist/index21.js +42 -79
- package/dist/index22.cjs +53 -103
- package/dist/index22.js +54 -104
- package/dist/index23.cjs +46 -81
- package/dist/index23.js +47 -82
- package/dist/index24.cjs +105 -104
- package/dist/index24.js +107 -106
- package/dist/index25.cjs +108 -28
- package/dist/index25.js +111 -31
- package/dist/index26.cjs +104 -37
- package/dist/index26.js +106 -39
- package/dist/index27.cjs +22 -31
- package/dist/index27.js +23 -32
- package/dist/index28.cjs +30 -30
- package/dist/index28.js +31 -31
- package/dist/index29.cjs +49 -53
- package/dist/index29.js +50 -54
- package/dist/index3.cjs +11 -3
- package/dist/index3.js +11 -3
- package/dist/index30.cjs +77 -17
- package/dist/index30.js +76 -16
- package/dist/index31.cjs +77 -121
- package/dist/index31.js +78 -122
- package/dist/index32.cjs +125 -0
- package/dist/index32.js +125 -0
- package/dist/index4.cjs +0 -1
- package/dist/index4.js +0 -1
- package/dist/index5.cjs +11 -73
- package/dist/index5.js +12 -74
- package/dist/index6.cjs +86 -66
- package/dist/index6.js +87 -67
- package/dist/index7.cjs +40 -21
- package/dist/index7.js +40 -21
- package/dist/index8.cjs +34 -22
- package/dist/index8.js +34 -22
- package/dist/index9.cjs +21 -56
- package/dist/index9.js +22 -57
- package/dist/premium-react-loaders.css +250 -1073
- package/dist/utils/classNames.d.ts +3 -2
- package/dist/utils/classNames.d.ts.map +1 -1
- package/package.json +5 -8
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index10.cjs.map +0 -1
- package/dist/index10.js.map +0 -1
- package/dist/index11.cjs.map +0 -1
- package/dist/index11.js.map +0 -1
- package/dist/index12.cjs.map +0 -1
- package/dist/index12.js.map +0 -1
- package/dist/index13.cjs.map +0 -1
- package/dist/index13.js.map +0 -1
- package/dist/index14.cjs.map +0 -1
- package/dist/index14.js.map +0 -1
- package/dist/index15.cjs.map +0 -1
- package/dist/index15.js.map +0 -1
- package/dist/index16.cjs.map +0 -1
- package/dist/index16.js.map +0 -1
- package/dist/index17.cjs.map +0 -1
- package/dist/index17.js.map +0 -1
- package/dist/index18.cjs.map +0 -1
- package/dist/index18.js.map +0 -1
- package/dist/index19.cjs.map +0 -1
- package/dist/index19.js.map +0 -1
- package/dist/index20.cjs.map +0 -1
- package/dist/index20.js.map +0 -1
- package/dist/index21.cjs.map +0 -1
- package/dist/index21.js.map +0 -1
- package/dist/index22.cjs.map +0 -1
- package/dist/index22.js.map +0 -1
- package/dist/index23.cjs.map +0 -1
- package/dist/index23.js.map +0 -1
- package/dist/index24.cjs.map +0 -1
- package/dist/index24.js.map +0 -1
- package/dist/index25.cjs.map +0 -1
- package/dist/index25.js.map +0 -1
- package/dist/index26.cjs.map +0 -1
- package/dist/index26.js.map +0 -1
- package/dist/index27.cjs.map +0 -1
- package/dist/index27.js.map +0 -1
- package/dist/index28.cjs.map +0 -1
- package/dist/index28.js.map +0 -1
- package/dist/index29.cjs.map +0 -1
- package/dist/index29.js.map +0 -1
- package/dist/index3.cjs.map +0 -1
- package/dist/index3.js.map +0 -1
- package/dist/index30.cjs.map +0 -1
- package/dist/index30.js.map +0 -1
- package/dist/index31.cjs.map +0 -1
- package/dist/index31.js.map +0 -1
- package/dist/index4.cjs.map +0 -1
- package/dist/index4.js.map +0 -1
- package/dist/index5.cjs.map +0 -1
- package/dist/index5.js.map +0 -1
- package/dist/index6.cjs.map +0 -1
- package/dist/index6.js.map +0 -1
- package/dist/index7.cjs.map +0 -1
- package/dist/index7.js.map +0 -1
- package/dist/index8.cjs.map +0 -1
- package/dist/index8.js.map +0 -1
- package/dist/index9.cjs.map +0 -1
- package/dist/index9.js.map +0 -1
package/dist/index14.js
CHANGED
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { Skeleton } from "./index7.js";
|
|
4
|
+
import { SkeletonText } from "./index8.js";
|
|
5
|
+
import { SkeletonAvatar } from "./index9.js";
|
|
6
|
+
import { useLoaderVisibility } from "./index32.js";
|
|
4
7
|
import { cn } from "./index3.js";
|
|
5
|
-
|
|
6
|
-
const SpinnerCircle = forwardRef(
|
|
8
|
+
const SkeletonPage = forwardRef(
|
|
7
9
|
({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
reverse = false,
|
|
13
|
-
respectMotionPreference = true,
|
|
10
|
+
variant = "default",
|
|
11
|
+
animate = true,
|
|
12
|
+
baseColor = "#e0e0e0",
|
|
13
|
+
highlightColor = "#f5f5f5",
|
|
14
14
|
delay = 0,
|
|
15
15
|
minDuration = 0,
|
|
16
16
|
transition,
|
|
17
17
|
className,
|
|
18
18
|
style,
|
|
19
|
-
testId = "
|
|
19
|
+
testId = "skeleton-page",
|
|
20
20
|
visible = true,
|
|
21
|
-
ariaLabel = "Loading...",
|
|
22
21
|
...rest
|
|
23
22
|
}, ref) => {
|
|
24
|
-
const prefersReducedMotion = useReducedMotion();
|
|
25
|
-
const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
26
23
|
const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(
|
|
27
24
|
visible,
|
|
28
25
|
delay,
|
|
@@ -30,53 +27,139 @@ const SpinnerCircle = forwardRef(
|
|
|
30
27
|
transition
|
|
31
28
|
);
|
|
32
29
|
if (!shouldRender) return null;
|
|
30
|
+
const commonProps = {
|
|
31
|
+
animate,
|
|
32
|
+
baseColor,
|
|
33
|
+
highlightColor
|
|
34
|
+
};
|
|
35
|
+
const renderDefault = () => /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
36
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between border-b pb-4", children: [
|
|
37
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 200, height: 32, ...commonProps }),
|
|
38
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
|
|
39
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 100, height: 36, borderRadius: 6, ...commonProps }),
|
|
40
|
+
/* @__PURE__ */ jsx(SkeletonAvatar, { size: 40, ...commonProps })
|
|
41
|
+
] })
|
|
42
|
+
] }),
|
|
43
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
44
|
+
/* @__PURE__ */ jsx(SkeletonText, { lines: 3, ...commonProps }),
|
|
45
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-3 gap-4", children: [
|
|
46
|
+
/* @__PURE__ */ jsx(Skeleton, { height: 120, borderRadius: 8, ...commonProps }),
|
|
47
|
+
/* @__PURE__ */ jsx(Skeleton, { height: 120, borderRadius: 8, ...commonProps }),
|
|
48
|
+
/* @__PURE__ */ jsx(Skeleton, { height: 120, borderRadius: 8, ...commonProps })
|
|
49
|
+
] }),
|
|
50
|
+
/* @__PURE__ */ jsx(SkeletonText, { lines: 5, ...commonProps })
|
|
51
|
+
] })
|
|
52
|
+
] });
|
|
53
|
+
const renderDashboard = () => /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
54
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
55
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
56
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 180, height: 28, ...commonProps }),
|
|
57
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 120, height: 36, borderRadius: 6, ...commonProps })
|
|
58
|
+
] }),
|
|
59
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-4 gap-4", children: [...Array(4)].map((_, i) => /* @__PURE__ */ jsxs("div", { className: "p-4 border rounded-lg space-y-2", children: [
|
|
60
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 100, height: 16, ...commonProps }),
|
|
61
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 80, height: 32, ...commonProps }),
|
|
62
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 60, height: 12, ...commonProps })
|
|
63
|
+
] }, i)) })
|
|
64
|
+
] }),
|
|
65
|
+
/* @__PURE__ */ jsx(Skeleton, { height: 300, borderRadius: 8, ...commonProps }),
|
|
66
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
67
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-4", children: [
|
|
68
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 150, height: 20, ...commonProps }),
|
|
69
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 150, height: 20, ...commonProps }),
|
|
70
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 150, height: 20, ...commonProps })
|
|
71
|
+
] }),
|
|
72
|
+
[...Array(5)].map((_, i) => /* @__PURE__ */ jsxs("div", { className: "flex gap-4", children: [
|
|
73
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 150, height: 16, ...commonProps }),
|
|
74
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 150, height: 16, ...commonProps }),
|
|
75
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 150, height: 16, ...commonProps })
|
|
76
|
+
] }, i))
|
|
77
|
+
] })
|
|
78
|
+
] });
|
|
79
|
+
const renderArticle = () => /* @__PURE__ */ jsxs("div", { className: "max-w-3xl mx-auto space-y-6", children: [
|
|
80
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
81
|
+
/* @__PURE__ */ jsx(Skeleton, { width: "80%", height: 40, ...commonProps }),
|
|
82
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
83
|
+
/* @__PURE__ */ jsx(SkeletonAvatar, { size: 48, ...commonProps }),
|
|
84
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2 flex-1", children: [
|
|
85
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 120, height: 16, ...commonProps }),
|
|
86
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 180, height: 14, ...commonProps })
|
|
87
|
+
] })
|
|
88
|
+
] })
|
|
89
|
+
] }),
|
|
90
|
+
/* @__PURE__ */ jsx(Skeleton, { height: 400, borderRadius: 8, ...commonProps }),
|
|
91
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
92
|
+
/* @__PURE__ */ jsx(SkeletonText, { lines: 4, ...commonProps }),
|
|
93
|
+
/* @__PURE__ */ jsx(Skeleton, { height: 200, borderRadius: 8, ...commonProps }),
|
|
94
|
+
/* @__PURE__ */ jsx(SkeletonText, { lines: 6, ...commonProps }),
|
|
95
|
+
/* @__PURE__ */ jsx(Skeleton, { height: 250, borderRadius: 8, ...commonProps }),
|
|
96
|
+
/* @__PURE__ */ jsx(SkeletonText, { lines: 4, ...commonProps })
|
|
97
|
+
] })
|
|
98
|
+
] });
|
|
99
|
+
const renderProfile = () => /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
100
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-6 border-b pb-6", children: [
|
|
101
|
+
/* @__PURE__ */ jsx(SkeletonAvatar, { size: 120, ...commonProps }),
|
|
102
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-3", children: [
|
|
103
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 200, height: 32, ...commonProps }),
|
|
104
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 150, height: 20, ...commonProps }),
|
|
105
|
+
/* @__PURE__ */ jsx(SkeletonText, { lines: 2, ...commonProps }),
|
|
106
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-3", children: [
|
|
107
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 100, height: 36, borderRadius: 6, ...commonProps }),
|
|
108
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 100, height: 36, borderRadius: 6, ...commonProps })
|
|
109
|
+
] })
|
|
110
|
+
] })
|
|
111
|
+
] }),
|
|
112
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-3 gap-6", children: [
|
|
113
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-4", children: /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
114
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 100, height: 20, ...commonProps }),
|
|
115
|
+
[...Array(4)].map((_, i) => /* @__PURE__ */ jsx(Skeleton, { height: 16, ...commonProps }, i))
|
|
116
|
+
] }) }),
|
|
117
|
+
/* @__PURE__ */ jsx("div", { className: "col-span-2 space-y-4", children: [...Array(3)].map((_, i) => /* @__PURE__ */ jsxs("div", { className: "p-4 border rounded-lg space-y-3", children: [
|
|
118
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
119
|
+
/* @__PURE__ */ jsx(SkeletonAvatar, { size: 40, ...commonProps }),
|
|
120
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-2", children: [
|
|
121
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 150, height: 16, ...commonProps }),
|
|
122
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 100, height: 12, ...commonProps })
|
|
123
|
+
] })
|
|
124
|
+
] }),
|
|
125
|
+
/* @__PURE__ */ jsx(SkeletonText, { lines: 2, ...commonProps }),
|
|
126
|
+
/* @__PURE__ */ jsx(Skeleton, { height: 200, borderRadius: 6, ...commonProps })
|
|
127
|
+
] }, i)) })
|
|
128
|
+
] })
|
|
129
|
+
] });
|
|
130
|
+
const renderContent = () => {
|
|
131
|
+
switch (variant) {
|
|
132
|
+
case "dashboard":
|
|
133
|
+
return renderDashboard();
|
|
134
|
+
case "article":
|
|
135
|
+
return renderArticle();
|
|
136
|
+
case "profile":
|
|
137
|
+
return renderProfile();
|
|
138
|
+
default:
|
|
139
|
+
return renderDefault();
|
|
140
|
+
}
|
|
141
|
+
};
|
|
33
142
|
return /* @__PURE__ */ jsx(
|
|
34
143
|
"div",
|
|
35
144
|
{
|
|
36
145
|
ref,
|
|
37
146
|
"data-testid": testId,
|
|
38
|
-
className: cn("
|
|
147
|
+
className: cn("w-full p-6", className),
|
|
39
148
|
style: {
|
|
40
149
|
...style,
|
|
41
150
|
opacity,
|
|
42
151
|
transition: transitionStyle
|
|
43
152
|
},
|
|
44
153
|
role: "status",
|
|
45
|
-
"aria-label":
|
|
154
|
+
"aria-label": "Loading page...",
|
|
46
155
|
"aria-busy": "true",
|
|
47
156
|
...rest,
|
|
48
|
-
children:
|
|
49
|
-
"svg",
|
|
50
|
-
{
|
|
51
|
-
className: "animate-spinner-rotate",
|
|
52
|
-
style: {
|
|
53
|
-
width: normalizeSize(size),
|
|
54
|
-
height: normalizeSize(size),
|
|
55
|
-
animationDuration: effectiveDuration,
|
|
56
|
-
animationDirection: reverse ? "reverse" : "normal"
|
|
57
|
-
},
|
|
58
|
-
viewBox: "0 0 50 50",
|
|
59
|
-
children: /* @__PURE__ */ jsx(
|
|
60
|
-
"circle",
|
|
61
|
-
{
|
|
62
|
-
cx: "25",
|
|
63
|
-
cy: "25",
|
|
64
|
-
r: 25 - thickness * 2,
|
|
65
|
-
fill: "none",
|
|
66
|
-
stroke: color,
|
|
67
|
-
strokeWidth: thickness,
|
|
68
|
-
strokeDasharray: "80, 200",
|
|
69
|
-
strokeLinecap: "round"
|
|
70
|
-
}
|
|
71
|
-
)
|
|
72
|
-
}
|
|
73
|
-
)
|
|
157
|
+
children: renderContent()
|
|
74
158
|
}
|
|
75
159
|
);
|
|
76
160
|
}
|
|
77
161
|
);
|
|
78
|
-
|
|
162
|
+
SkeletonPage.displayName = "SkeletonPage";
|
|
79
163
|
export {
|
|
80
|
-
|
|
164
|
+
SkeletonPage
|
|
81
165
|
};
|
|
82
|
-
//# sourceMappingURL=index14.js.map
|
package/dist/index15.cjs
CHANGED
|
@@ -2,30 +2,30 @@
|
|
|
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
|
|
6
|
-
const
|
|
5
|
+
const Skeleton = require("./index7.cjs");
|
|
6
|
+
const hooks = require("./index32.cjs");
|
|
7
7
|
const colors = require("./index4.cjs");
|
|
8
|
-
const
|
|
8
|
+
const classNames = require("./index3.cjs");
|
|
9
|
+
const SkeletonForm = react.forwardRef(
|
|
9
10
|
({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
fields = 3,
|
|
12
|
+
showLabels = true,
|
|
13
|
+
showButton = true,
|
|
14
|
+
gap = 16,
|
|
15
|
+
buttonWidth = "120px",
|
|
16
|
+
buttonPosition = "left",
|
|
17
|
+
animate = true,
|
|
18
|
+
baseColor,
|
|
19
|
+
highlightColor,
|
|
17
20
|
delay = 0,
|
|
18
21
|
minDuration = 0,
|
|
19
22
|
transition,
|
|
20
23
|
className,
|
|
21
24
|
style,
|
|
22
|
-
testId = "
|
|
25
|
+
testId = "skeleton-form",
|
|
23
26
|
visible = true,
|
|
24
|
-
ariaLabel = "Loading...",
|
|
25
27
|
...rest
|
|
26
28
|
}, ref) => {
|
|
27
|
-
const prefersReducedMotion = hooks.useReducedMotion();
|
|
28
|
-
const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
29
29
|
const { shouldRender, opacity, transitionStyle } = hooks.useLoaderVisibility(
|
|
30
30
|
visible,
|
|
31
31
|
delay,
|
|
@@ -33,39 +33,59 @@ const SpinnerRing = react.forwardRef(
|
|
|
33
33
|
transition
|
|
34
34
|
);
|
|
35
35
|
if (!shouldRender) return null;
|
|
36
|
-
|
|
36
|
+
const gapValue = colors.normalizeSize(gap);
|
|
37
|
+
const buttonAlign = buttonPosition === "left" ? "justify-start" : buttonPosition === "right" ? "justify-end" : "justify-center";
|
|
38
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
37
39
|
"div",
|
|
38
40
|
{
|
|
39
41
|
ref,
|
|
40
42
|
"data-testid": testId,
|
|
41
|
-
className: classNames.cn("
|
|
42
|
-
style: {
|
|
43
|
-
...style,
|
|
44
|
-
opacity,
|
|
45
|
-
transition: transitionStyle
|
|
46
|
-
},
|
|
43
|
+
className: classNames.cn("w-full", className),
|
|
44
|
+
style: { ...style, display: "flex", flexDirection: "column", gap: gapValue, opacity, transition: transitionStyle },
|
|
47
45
|
role: "status",
|
|
48
|
-
"aria-label":
|
|
46
|
+
"aria-label": "Loading form...",
|
|
49
47
|
"aria-busy": "true",
|
|
50
48
|
...rest,
|
|
51
|
-
children:
|
|
52
|
-
"div",
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
49
|
+
children: [
|
|
50
|
+
Array.from({ length: fields }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
51
|
+
showLabels && /* @__PURE__ */ jsxRuntime.jsx(
|
|
52
|
+
Skeleton.Skeleton,
|
|
53
|
+
{
|
|
54
|
+
width: "30%",
|
|
55
|
+
height: "0.875rem",
|
|
56
|
+
variant: "text",
|
|
57
|
+
animate,
|
|
58
|
+
baseColor,
|
|
59
|
+
highlightColor
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
63
|
+
Skeleton.Skeleton,
|
|
64
|
+
{
|
|
65
|
+
width: "100%",
|
|
66
|
+
height: "2.5rem",
|
|
67
|
+
variant: "rectangular",
|
|
68
|
+
animate,
|
|
69
|
+
baseColor,
|
|
70
|
+
highlightColor
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
] }, index)),
|
|
74
|
+
showButton && /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames.cn("flex", buttonAlign), style: { marginTop: "8px" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
75
|
+
Skeleton.Skeleton,
|
|
76
|
+
{
|
|
77
|
+
width: buttonWidth,
|
|
78
|
+
height: "2.5rem",
|
|
79
|
+
variant: "rounded",
|
|
80
|
+
animate,
|
|
81
|
+
baseColor,
|
|
82
|
+
highlightColor
|
|
62
83
|
}
|
|
63
|
-
}
|
|
64
|
-
|
|
84
|
+
) })
|
|
85
|
+
]
|
|
65
86
|
}
|
|
66
87
|
);
|
|
67
88
|
}
|
|
68
89
|
);
|
|
69
|
-
|
|
70
|
-
exports.
|
|
71
|
-
//# sourceMappingURL=index15.cjs.map
|
|
90
|
+
SkeletonForm.displayName = "SkeletonForm";
|
|
91
|
+
exports.SkeletonForm = SkeletonForm;
|
package/dist/index15.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Skeleton } from "./index7.js";
|
|
4
|
+
import { useLoaderVisibility } from "./index32.js";
|
|
5
5
|
import { normalizeSize } from "./index4.js";
|
|
6
|
-
|
|
6
|
+
import { cn } from "./index3.js";
|
|
7
|
+
const SkeletonForm = forwardRef(
|
|
7
8
|
({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
fields = 3,
|
|
10
|
+
showLabels = true,
|
|
11
|
+
showButton = true,
|
|
12
|
+
gap = 16,
|
|
13
|
+
buttonWidth = "120px",
|
|
14
|
+
buttonPosition = "left",
|
|
15
|
+
animate = true,
|
|
16
|
+
baseColor,
|
|
17
|
+
highlightColor,
|
|
15
18
|
delay = 0,
|
|
16
19
|
minDuration = 0,
|
|
17
20
|
transition,
|
|
18
21
|
className,
|
|
19
22
|
style,
|
|
20
|
-
testId = "
|
|
23
|
+
testId = "skeleton-form",
|
|
21
24
|
visible = true,
|
|
22
|
-
ariaLabel = "Loading...",
|
|
23
25
|
...rest
|
|
24
26
|
}, ref) => {
|
|
25
|
-
const prefersReducedMotion = useReducedMotion();
|
|
26
|
-
const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
27
27
|
const { shouldRender, opacity, transitionStyle } = useLoaderVisibility(
|
|
28
28
|
visible,
|
|
29
29
|
delay,
|
|
@@ -31,41 +31,61 @@ const SpinnerRing = forwardRef(
|
|
|
31
31
|
transition
|
|
32
32
|
);
|
|
33
33
|
if (!shouldRender) return null;
|
|
34
|
-
|
|
34
|
+
const gapValue = normalizeSize(gap);
|
|
35
|
+
const buttonAlign = buttonPosition === "left" ? "justify-start" : buttonPosition === "right" ? "justify-end" : "justify-center";
|
|
36
|
+
return /* @__PURE__ */ jsxs(
|
|
35
37
|
"div",
|
|
36
38
|
{
|
|
37
39
|
ref,
|
|
38
40
|
"data-testid": testId,
|
|
39
|
-
className: cn("
|
|
40
|
-
style: {
|
|
41
|
-
...style,
|
|
42
|
-
opacity,
|
|
43
|
-
transition: transitionStyle
|
|
44
|
-
},
|
|
41
|
+
className: cn("w-full", className),
|
|
42
|
+
style: { ...style, display: "flex", flexDirection: "column", gap: gapValue, opacity, transition: transitionStyle },
|
|
45
43
|
role: "status",
|
|
46
|
-
"aria-label":
|
|
44
|
+
"aria-label": "Loading form...",
|
|
47
45
|
"aria-busy": "true",
|
|
48
46
|
...rest,
|
|
49
|
-
children:
|
|
50
|
-
"div",
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
47
|
+
children: [
|
|
48
|
+
Array.from({ length: fields }).map((_, index) => /* @__PURE__ */ jsxs("div", { className: "w-full", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
49
|
+
showLabels && /* @__PURE__ */ jsx(
|
|
50
|
+
Skeleton,
|
|
51
|
+
{
|
|
52
|
+
width: "30%",
|
|
53
|
+
height: "0.875rem",
|
|
54
|
+
variant: "text",
|
|
55
|
+
animate,
|
|
56
|
+
baseColor,
|
|
57
|
+
highlightColor
|
|
58
|
+
}
|
|
59
|
+
),
|
|
60
|
+
/* @__PURE__ */ jsx(
|
|
61
|
+
Skeleton,
|
|
62
|
+
{
|
|
63
|
+
width: "100%",
|
|
64
|
+
height: "2.5rem",
|
|
65
|
+
variant: "rectangular",
|
|
66
|
+
animate,
|
|
67
|
+
baseColor,
|
|
68
|
+
highlightColor
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
] }, index)),
|
|
72
|
+
showButton && /* @__PURE__ */ jsx("div", { className: cn("flex", buttonAlign), style: { marginTop: "8px" }, children: /* @__PURE__ */ jsx(
|
|
73
|
+
Skeleton,
|
|
74
|
+
{
|
|
75
|
+
width: buttonWidth,
|
|
76
|
+
height: "2.5rem",
|
|
77
|
+
variant: "rounded",
|
|
78
|
+
animate,
|
|
79
|
+
baseColor,
|
|
80
|
+
highlightColor
|
|
60
81
|
}
|
|
61
|
-
}
|
|
62
|
-
|
|
82
|
+
) })
|
|
83
|
+
]
|
|
63
84
|
}
|
|
64
85
|
);
|
|
65
86
|
}
|
|
66
87
|
);
|
|
67
|
-
|
|
88
|
+
SkeletonForm.displayName = "SkeletonForm";
|
|
68
89
|
export {
|
|
69
|
-
|
|
90
|
+
SkeletonForm
|
|
70
91
|
};
|
|
71
|
-
//# sourceMappingURL=index15.js.map
|
package/dist/index16.cjs
CHANGED
|
@@ -2,15 +2,14 @@
|
|
|
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
|
|
6
|
-
const hooks = require("./index31.cjs");
|
|
5
|
+
const hooks = require("./index32.cjs");
|
|
7
6
|
const classNames = require("./index3.cjs");
|
|
8
|
-
const
|
|
7
|
+
const colors = require("./index4.cjs");
|
|
8
|
+
const SpinnerCircle = react.forwardRef(
|
|
9
9
|
({
|
|
10
10
|
size = "md",
|
|
11
11
|
color = "#3b82f6",
|
|
12
|
-
|
|
13
|
-
dotSize = 4,
|
|
12
|
+
thickness = 4,
|
|
14
13
|
speed = "normal",
|
|
15
14
|
reverse = false,
|
|
16
15
|
respectMotionPreference = true,
|
|
@@ -19,7 +18,7 @@ const SpinnerDots = react.forwardRef(
|
|
|
19
18
|
transition,
|
|
20
19
|
className,
|
|
21
20
|
style,
|
|
22
|
-
testId = "spinner-
|
|
21
|
+
testId = "spinner-circle",
|
|
23
22
|
visible = true,
|
|
24
23
|
ariaLabel = "Loading...",
|
|
25
24
|
...rest
|
|
@@ -33,9 +32,6 @@ const SpinnerDots = react.forwardRef(
|
|
|
33
32
|
transition
|
|
34
33
|
);
|
|
35
34
|
if (!shouldRender) return null;
|
|
36
|
-
const sizeValue = colors.parseSizeToNumber(size, 40);
|
|
37
|
-
const dotSizeValue = colors.parseSizeToNumber(dotSize, 4);
|
|
38
|
-
const radius = (sizeValue - dotSizeValue) / 2;
|
|
39
35
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
40
36
|
"div",
|
|
41
37
|
{
|
|
@@ -52,43 +48,34 @@ const SpinnerDots = react.forwardRef(
|
|
|
52
48
|
"aria-busy": "true",
|
|
53
49
|
...rest,
|
|
54
50
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
55
|
-
"
|
|
51
|
+
"svg",
|
|
56
52
|
{
|
|
57
|
-
className: "
|
|
53
|
+
className: "animate-spinner-rotate",
|
|
58
54
|
style: {
|
|
59
55
|
width: colors.normalizeSize(size),
|
|
60
56
|
height: colors.normalizeSize(size),
|
|
61
|
-
|
|
57
|
+
animationDuration: effectiveDuration,
|
|
62
58
|
animationDirection: reverse ? "reverse" : "normal"
|
|
63
59
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
top: `${y}px`,
|
|
79
|
-
opacity: 1 - index / dotCount * 0.7
|
|
80
|
-
// Fade effect
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
index
|
|
84
|
-
);
|
|
85
|
-
})
|
|
60
|
+
viewBox: "0 0 50 50",
|
|
61
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
62
|
+
"circle",
|
|
63
|
+
{
|
|
64
|
+
cx: "25",
|
|
65
|
+
cy: "25",
|
|
66
|
+
r: 25 - thickness * 2,
|
|
67
|
+
fill: "none",
|
|
68
|
+
stroke: color,
|
|
69
|
+
strokeWidth: thickness,
|
|
70
|
+
strokeDasharray: "80, 200",
|
|
71
|
+
strokeLinecap: "round"
|
|
72
|
+
}
|
|
73
|
+
)
|
|
86
74
|
}
|
|
87
75
|
)
|
|
88
76
|
}
|
|
89
77
|
);
|
|
90
78
|
}
|
|
91
79
|
);
|
|
92
|
-
|
|
93
|
-
exports.
|
|
94
|
-
//# sourceMappingURL=index16.cjs.map
|
|
80
|
+
SpinnerCircle.displayName = "SpinnerCircle";
|
|
81
|
+
exports.SpinnerCircle = SpinnerCircle;
|