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/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,oBAAoB,CAAC;AAG5B,cAAc,cAAc,CAAC;AAG7B,mBAAmB,SAAS,CAAC;AAG7B,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGrE,eAAO,MAAM,OAAO,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,oBAAoB,CAAC;AAG5B,cAAc,cAAc,CAAC;AAG7B,mBAAmB,SAAS,CAAC;AAG7B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACpD,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAGjE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAGjE,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGrE,eAAO,MAAM,OAAO,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
/* empty css */
|
|
2
2
|
import { cn } from "./index3.js";
|
|
3
3
|
import { getAnimationDuration, normalizeSize } from "./index4.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
|
|
4
|
+
import { ThemeProvider, useTheme } from "./index5.js";
|
|
5
|
+
import { useLoader } from "./index6.js";
|
|
6
|
+
import { Skeleton } from "./index7.js";
|
|
7
|
+
import { SkeletonText } from "./index8.js";
|
|
8
|
+
import { SkeletonAvatar } from "./index9.js";
|
|
9
|
+
import { SkeletonImage } from "./index10.js";
|
|
10
|
+
import { SkeletonCard } from "./index11.js";
|
|
11
|
+
import { SkeletonList } from "./index12.js";
|
|
12
|
+
import { SkeletonTable } from "./index13.js";
|
|
13
|
+
import { SkeletonPage } from "./index14.js";
|
|
14
|
+
import { SkeletonForm } from "./index15.js";
|
|
15
|
+
import { SpinnerCircle } from "./index16.js";
|
|
16
|
+
import { SpinnerRing } from "./index17.js";
|
|
17
|
+
import { SpinnerDots } from "./index18.js";
|
|
18
|
+
import { SpinnerBars } from "./index19.js";
|
|
19
|
+
import { SpinnerGrid } from "./index20.js";
|
|
20
|
+
import { SpinnerWave } from "./index21.js";
|
|
21
|
+
import { SpinnerPulse } from "./index22.js";
|
|
22
|
+
import { ProgressBar } from "./index23.js";
|
|
23
|
+
import { ProgressCircle } from "./index24.js";
|
|
24
|
+
import { ProgressRing } from "./index25.js";
|
|
25
|
+
import { ProgressSteps } from "./index26.js";
|
|
26
|
+
import { PulseDots } from "./index27.js";
|
|
27
|
+
import { PulseWave } from "./index28.js";
|
|
28
|
+
import { PulseBars } from "./index29.js";
|
|
29
|
+
import { TypingIndicator } from "./index30.js";
|
|
30
|
+
import { LoaderOverlay } from "./index31.js";
|
|
31
|
+
const version = "2.1.0";
|
|
30
32
|
export {
|
|
31
33
|
LoaderOverlay,
|
|
32
34
|
ProgressBar,
|
|
@@ -52,10 +54,12 @@ export {
|
|
|
52
54
|
SpinnerPulse,
|
|
53
55
|
SpinnerRing,
|
|
54
56
|
SpinnerWave,
|
|
57
|
+
ThemeProvider,
|
|
55
58
|
TypingIndicator,
|
|
56
59
|
cn,
|
|
57
60
|
getAnimationDuration,
|
|
58
61
|
normalizeSize,
|
|
62
|
+
useLoader,
|
|
63
|
+
useTheme,
|
|
59
64
|
version
|
|
60
65
|
};
|
|
61
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index10.cjs
CHANGED
|
@@ -2,16 +2,13 @@
|
|
|
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("./
|
|
6
|
-
const hooks = require("./
|
|
7
|
-
const
|
|
8
|
-
const classNames = require("./index3.cjs");
|
|
9
|
-
const SkeletonList = react.forwardRef(
|
|
5
|
+
const Skeleton = require("./index7.cjs");
|
|
6
|
+
const hooks = require("./index32.cjs");
|
|
7
|
+
const SkeletonImage = react.forwardRef(
|
|
10
8
|
({
|
|
11
|
-
items = 3,
|
|
12
|
-
itemHeight = "3rem",
|
|
13
|
-
gap = "0.75rem",
|
|
14
9
|
width = "100%",
|
|
10
|
+
height = "200px",
|
|
11
|
+
aspectRatio,
|
|
15
12
|
animate = true,
|
|
16
13
|
baseColor,
|
|
17
14
|
highlightColor,
|
|
@@ -21,7 +18,7 @@ const SkeletonList = react.forwardRef(
|
|
|
21
18
|
transition,
|
|
22
19
|
className,
|
|
23
20
|
style,
|
|
24
|
-
testId = "skeleton-
|
|
21
|
+
testId = "skeleton-image",
|
|
25
22
|
visible = true,
|
|
26
23
|
...rest
|
|
27
24
|
}, ref) => {
|
|
@@ -33,38 +30,29 @@ const SkeletonList = react.forwardRef(
|
|
|
33
30
|
);
|
|
34
31
|
if (!shouldRender) return null;
|
|
35
32
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
36
|
-
|
|
33
|
+
Skeleton.Skeleton,
|
|
37
34
|
{
|
|
38
35
|
ref,
|
|
39
36
|
"data-testid": testId,
|
|
40
|
-
|
|
37
|
+
width,
|
|
38
|
+
height: aspectRatio ? "auto" : height,
|
|
39
|
+
variant: "rounded",
|
|
40
|
+
borderRadius,
|
|
41
|
+
animate,
|
|
42
|
+
baseColor,
|
|
43
|
+
highlightColor,
|
|
44
|
+
className,
|
|
41
45
|
style: {
|
|
42
|
-
|
|
46
|
+
aspectRatio: aspectRatio || void 0,
|
|
43
47
|
...style,
|
|
44
48
|
opacity,
|
|
45
49
|
transition: transitionStyle
|
|
46
50
|
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"aria-busy": "true",
|
|
50
|
-
...rest,
|
|
51
|
-
children: Array.from({ length: items }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
52
|
-
Skeleton.Skeleton,
|
|
53
|
-
{
|
|
54
|
-
width,
|
|
55
|
-
height: itemHeight,
|
|
56
|
-
variant: "rounded",
|
|
57
|
-
borderRadius,
|
|
58
|
-
animate,
|
|
59
|
-
baseColor,
|
|
60
|
-
highlightColor
|
|
61
|
-
},
|
|
62
|
-
index
|
|
63
|
-
))
|
|
51
|
+
"aria-label": "Loading image...",
|
|
52
|
+
...rest
|
|
64
53
|
}
|
|
65
54
|
);
|
|
66
55
|
}
|
|
67
56
|
);
|
|
68
|
-
|
|
69
|
-
exports.
|
|
70
|
-
//# sourceMappingURL=index10.cjs.map
|
|
57
|
+
SkeletonImage.displayName = "SkeletonImage";
|
|
58
|
+
exports.SkeletonImage = SkeletonImage;
|
package/dist/index10.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { Skeleton } from "./
|
|
4
|
-
import { useLoaderVisibility } from "./
|
|
5
|
-
|
|
6
|
-
import { cn } from "./index3.js";
|
|
7
|
-
const SkeletonList = forwardRef(
|
|
3
|
+
import { Skeleton } from "./index7.js";
|
|
4
|
+
import { useLoaderVisibility } from "./index32.js";
|
|
5
|
+
const SkeletonImage = forwardRef(
|
|
8
6
|
({
|
|
9
|
-
items = 3,
|
|
10
|
-
itemHeight = "3rem",
|
|
11
|
-
gap = "0.75rem",
|
|
12
7
|
width = "100%",
|
|
8
|
+
height = "200px",
|
|
9
|
+
aspectRatio,
|
|
13
10
|
animate = true,
|
|
14
11
|
baseColor,
|
|
15
12
|
highlightColor,
|
|
@@ -19,7 +16,7 @@ const SkeletonList = forwardRef(
|
|
|
19
16
|
transition,
|
|
20
17
|
className,
|
|
21
18
|
style,
|
|
22
|
-
testId = "skeleton-
|
|
19
|
+
testId = "skeleton-image",
|
|
23
20
|
visible = true,
|
|
24
21
|
...rest
|
|
25
22
|
}, ref) => {
|
|
@@ -31,40 +28,31 @@ const SkeletonList = forwardRef(
|
|
|
31
28
|
);
|
|
32
29
|
if (!shouldRender) return null;
|
|
33
30
|
return /* @__PURE__ */ jsx(
|
|
34
|
-
|
|
31
|
+
Skeleton,
|
|
35
32
|
{
|
|
36
33
|
ref,
|
|
37
34
|
"data-testid": testId,
|
|
38
|
-
|
|
35
|
+
width,
|
|
36
|
+
height: aspectRatio ? "auto" : height,
|
|
37
|
+
variant: "rounded",
|
|
38
|
+
borderRadius,
|
|
39
|
+
animate,
|
|
40
|
+
baseColor,
|
|
41
|
+
highlightColor,
|
|
42
|
+
className,
|
|
39
43
|
style: {
|
|
40
|
-
|
|
44
|
+
aspectRatio: aspectRatio || void 0,
|
|
41
45
|
...style,
|
|
42
46
|
opacity,
|
|
43
47
|
transition: transitionStyle
|
|
44
48
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"aria-busy": "true",
|
|
48
|
-
...rest,
|
|
49
|
-
children: Array.from({ length: items }).map((_, index) => /* @__PURE__ */ jsx(
|
|
50
|
-
Skeleton,
|
|
51
|
-
{
|
|
52
|
-
width,
|
|
53
|
-
height: itemHeight,
|
|
54
|
-
variant: "rounded",
|
|
55
|
-
borderRadius,
|
|
56
|
-
animate,
|
|
57
|
-
baseColor,
|
|
58
|
-
highlightColor
|
|
59
|
-
},
|
|
60
|
-
index
|
|
61
|
-
))
|
|
49
|
+
"aria-label": "Loading image...",
|
|
50
|
+
...rest
|
|
62
51
|
}
|
|
63
52
|
);
|
|
64
53
|
}
|
|
65
54
|
);
|
|
66
|
-
|
|
55
|
+
SkeletonImage.displayName = "SkeletonImage";
|
|
67
56
|
export {
|
|
68
|
-
|
|
57
|
+
SkeletonImage
|
|
69
58
|
};
|
|
70
|
-
//# sourceMappingURL=index10.js.map
|
package/dist/index11.cjs
CHANGED
|
@@ -2,14 +2,16 @@
|
|
|
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("./
|
|
6
|
-
const
|
|
5
|
+
const Skeleton = require("./index7.cjs");
|
|
6
|
+
const SkeletonAvatar = require("./index9.cjs");
|
|
7
|
+
const hooks = require("./index32.cjs");
|
|
7
8
|
const classNames = require("./index3.cjs");
|
|
8
|
-
const
|
|
9
|
+
const SkeletonCard = react.forwardRef(
|
|
9
10
|
({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
hasAvatar = true,
|
|
12
|
+
titleWidth = "60%",
|
|
13
|
+
lines = 2,
|
|
14
|
+
avatarSize = 40,
|
|
13
15
|
animate = true,
|
|
14
16
|
baseColor,
|
|
15
17
|
highlightColor,
|
|
@@ -18,7 +20,7 @@ const SkeletonTable = react.forwardRef(
|
|
|
18
20
|
transition,
|
|
19
21
|
className,
|
|
20
22
|
style,
|
|
21
|
-
testId = "skeleton-
|
|
23
|
+
testId = "skeleton-card",
|
|
22
24
|
visible = true,
|
|
23
25
|
...rest
|
|
24
26
|
}, ref) => {
|
|
@@ -29,41 +31,60 @@ const SkeletonTable = react.forwardRef(
|
|
|
29
31
|
transition
|
|
30
32
|
);
|
|
31
33
|
if (!shouldRender) return null;
|
|
32
|
-
const renderRow = (isHeader = false) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-4", style: { gridTemplateColumns: `repeat(${columns}, 1fr)` }, children: Array.from({ length: columns }).map((_, colIndex) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
33
|
-
Skeleton.Skeleton,
|
|
34
|
-
{
|
|
35
|
-
width: "100%",
|
|
36
|
-
height: isHeader ? "1.5rem" : "1.25rem",
|
|
37
|
-
variant: "text",
|
|
38
|
-
animate,
|
|
39
|
-
baseColor,
|
|
40
|
-
highlightColor
|
|
41
|
-
},
|
|
42
|
-
colIndex
|
|
43
|
-
)) });
|
|
44
34
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
45
35
|
"div",
|
|
46
36
|
{
|
|
47
37
|
ref,
|
|
48
38
|
"data-testid": testId,
|
|
49
|
-
className: classNames.cn("flex
|
|
39
|
+
className: classNames.cn("flex gap-3", className),
|
|
50
40
|
style: {
|
|
51
41
|
...style,
|
|
52
42
|
opacity,
|
|
53
43
|
transition: transitionStyle
|
|
54
44
|
},
|
|
55
45
|
role: "status",
|
|
56
|
-
"aria-label": "Loading
|
|
46
|
+
"aria-label": "Loading card...",
|
|
57
47
|
"aria-busy": "true",
|
|
58
48
|
...rest,
|
|
59
49
|
children: [
|
|
60
|
-
|
|
61
|
-
|
|
50
|
+
hasAvatar && /* @__PURE__ */ jsxRuntime.jsx(
|
|
51
|
+
SkeletonAvatar.SkeletonAvatar,
|
|
52
|
+
{
|
|
53
|
+
size: avatarSize,
|
|
54
|
+
animate,
|
|
55
|
+
baseColor,
|
|
56
|
+
highlightColor
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 space-y-2", children: [
|
|
60
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
61
|
+
Skeleton.Skeleton,
|
|
62
|
+
{
|
|
63
|
+
width: titleWidth,
|
|
64
|
+
height: "1.25rem",
|
|
65
|
+
variant: "text",
|
|
66
|
+
animate,
|
|
67
|
+
baseColor,
|
|
68
|
+
highlightColor
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
Array.from({ length: lines }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
72
|
+
Skeleton.Skeleton,
|
|
73
|
+
{
|
|
74
|
+
width: index === lines - 1 ? "70%" : "100%",
|
|
75
|
+
height: "1rem",
|
|
76
|
+
variant: "text",
|
|
77
|
+
animate,
|
|
78
|
+
baseColor,
|
|
79
|
+
highlightColor
|
|
80
|
+
},
|
|
81
|
+
index
|
|
82
|
+
))
|
|
83
|
+
] })
|
|
62
84
|
]
|
|
63
85
|
}
|
|
64
86
|
);
|
|
65
87
|
}
|
|
66
88
|
);
|
|
67
|
-
|
|
68
|
-
exports.
|
|
69
|
-
//# sourceMappingURL=index11.cjs.map
|
|
89
|
+
SkeletonCard.displayName = "SkeletonCard";
|
|
90
|
+
exports.SkeletonCard = SkeletonCard;
|
package/dist/index11.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { Skeleton } from "./
|
|
4
|
-
import {
|
|
3
|
+
import { Skeleton } from "./index7.js";
|
|
4
|
+
import { SkeletonAvatar } from "./index9.js";
|
|
5
|
+
import { useLoaderVisibility } from "./index32.js";
|
|
5
6
|
import { cn } from "./index3.js";
|
|
6
|
-
const
|
|
7
|
+
const SkeletonCard = forwardRef(
|
|
7
8
|
({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
hasAvatar = true,
|
|
10
|
+
titleWidth = "60%",
|
|
11
|
+
lines = 2,
|
|
12
|
+
avatarSize = 40,
|
|
11
13
|
animate = true,
|
|
12
14
|
baseColor,
|
|
13
15
|
highlightColor,
|
|
@@ -16,7 +18,7 @@ const SkeletonTable = forwardRef(
|
|
|
16
18
|
transition,
|
|
17
19
|
className,
|
|
18
20
|
style,
|
|
19
|
-
testId = "skeleton-
|
|
21
|
+
testId = "skeleton-card",
|
|
20
22
|
visible = true,
|
|
21
23
|
...rest
|
|
22
24
|
}, ref) => {
|
|
@@ -27,43 +29,62 @@ const SkeletonTable = forwardRef(
|
|
|
27
29
|
transition
|
|
28
30
|
);
|
|
29
31
|
if (!shouldRender) return null;
|
|
30
|
-
const renderRow = (isHeader = false) => /* @__PURE__ */ jsx("div", { className: "grid gap-4", style: { gridTemplateColumns: `repeat(${columns}, 1fr)` }, children: Array.from({ length: columns }).map((_, colIndex) => /* @__PURE__ */ jsx(
|
|
31
|
-
Skeleton,
|
|
32
|
-
{
|
|
33
|
-
width: "100%",
|
|
34
|
-
height: isHeader ? "1.5rem" : "1.25rem",
|
|
35
|
-
variant: "text",
|
|
36
|
-
animate,
|
|
37
|
-
baseColor,
|
|
38
|
-
highlightColor
|
|
39
|
-
},
|
|
40
|
-
colIndex
|
|
41
|
-
)) });
|
|
42
32
|
return /* @__PURE__ */ jsxs(
|
|
43
33
|
"div",
|
|
44
34
|
{
|
|
45
35
|
ref,
|
|
46
36
|
"data-testid": testId,
|
|
47
|
-
className: cn("flex
|
|
37
|
+
className: cn("flex gap-3", className),
|
|
48
38
|
style: {
|
|
49
39
|
...style,
|
|
50
40
|
opacity,
|
|
51
41
|
transition: transitionStyle
|
|
52
42
|
},
|
|
53
43
|
role: "status",
|
|
54
|
-
"aria-label": "Loading
|
|
44
|
+
"aria-label": "Loading card...",
|
|
55
45
|
"aria-busy": "true",
|
|
56
46
|
...rest,
|
|
57
47
|
children: [
|
|
58
|
-
|
|
59
|
-
|
|
48
|
+
hasAvatar && /* @__PURE__ */ jsx(
|
|
49
|
+
SkeletonAvatar,
|
|
50
|
+
{
|
|
51
|
+
size: avatarSize,
|
|
52
|
+
animate,
|
|
53
|
+
baseColor,
|
|
54
|
+
highlightColor
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-2", children: [
|
|
58
|
+
/* @__PURE__ */ jsx(
|
|
59
|
+
Skeleton,
|
|
60
|
+
{
|
|
61
|
+
width: titleWidth,
|
|
62
|
+
height: "1.25rem",
|
|
63
|
+
variant: "text",
|
|
64
|
+
animate,
|
|
65
|
+
baseColor,
|
|
66
|
+
highlightColor
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
Array.from({ length: lines }).map((_, index) => /* @__PURE__ */ jsx(
|
|
70
|
+
Skeleton,
|
|
71
|
+
{
|
|
72
|
+
width: index === lines - 1 ? "70%" : "100%",
|
|
73
|
+
height: "1rem",
|
|
74
|
+
variant: "text",
|
|
75
|
+
animate,
|
|
76
|
+
baseColor,
|
|
77
|
+
highlightColor
|
|
78
|
+
},
|
|
79
|
+
index
|
|
80
|
+
))
|
|
81
|
+
] })
|
|
60
82
|
]
|
|
61
83
|
}
|
|
62
84
|
);
|
|
63
85
|
}
|
|
64
86
|
);
|
|
65
|
-
|
|
87
|
+
SkeletonCard.displayName = "SkeletonCard";
|
|
66
88
|
export {
|
|
67
|
-
|
|
89
|
+
SkeletonCard
|
|
68
90
|
};
|
|
69
|
-
//# sourceMappingURL=index11.js.map
|
package/dist/index12.cjs
CHANGED
|
@@ -2,23 +2,26 @@
|
|
|
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("./
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const hooks = require("./index31.cjs");
|
|
5
|
+
const Skeleton = require("./index7.cjs");
|
|
6
|
+
const hooks = require("./index32.cjs");
|
|
7
|
+
const colors = require("./index4.cjs");
|
|
9
8
|
const classNames = require("./index3.cjs");
|
|
10
|
-
const
|
|
9
|
+
const SkeletonList = react.forwardRef(
|
|
11
10
|
({
|
|
12
|
-
|
|
11
|
+
items = 3,
|
|
12
|
+
itemHeight = "3rem",
|
|
13
|
+
gap = "0.75rem",
|
|
14
|
+
width = "100%",
|
|
13
15
|
animate = true,
|
|
14
|
-
baseColor
|
|
15
|
-
highlightColor
|
|
16
|
+
baseColor,
|
|
17
|
+
highlightColor,
|
|
18
|
+
borderRadius = "0.5rem",
|
|
16
19
|
delay = 0,
|
|
17
20
|
minDuration = 0,
|
|
18
21
|
transition,
|
|
19
22
|
className,
|
|
20
23
|
style,
|
|
21
|
-
testId = "skeleton-
|
|
24
|
+
testId = "skeleton-list",
|
|
22
25
|
visible = true,
|
|
23
26
|
...rest
|
|
24
27
|
}, ref) => {
|
|
@@ -29,138 +32,38 @@ const SkeletonPage = react.forwardRef(
|
|
|
29
32
|
transition
|
|
30
33
|
);
|
|
31
34
|
if (!shouldRender) return null;
|
|
32
|
-
const commonProps = {
|
|
33
|
-
animate,
|
|
34
|
-
baseColor,
|
|
35
|
-
highlightColor
|
|
36
|
-
};
|
|
37
|
-
const renderDefault = () => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
38
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between border-b pb-4", children: [
|
|
39
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { width: 200, height: 32, ...commonProps }),
|
|
40
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4", children: [
|
|
41
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { width: 100, height: 36, borderRadius: 6, ...commonProps }),
|
|
42
|
-
/* @__PURE__ */ jsxRuntime.jsx(SkeletonAvatar.SkeletonAvatar, { size: 40, ...commonProps })
|
|
43
|
-
] })
|
|
44
|
-
] }),
|
|
45
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
46
|
-
/* @__PURE__ */ jsxRuntime.jsx(SkeletonText.SkeletonText, { lines: 3, ...commonProps }),
|
|
47
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-3 gap-4", children: [
|
|
48
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { height: 120, borderRadius: 8, ...commonProps }),
|
|
49
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { height: 120, borderRadius: 8, ...commonProps }),
|
|
50
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { height: 120, borderRadius: 8, ...commonProps })
|
|
51
|
-
] }),
|
|
52
|
-
/* @__PURE__ */ jsxRuntime.jsx(SkeletonText.SkeletonText, { lines: 5, ...commonProps })
|
|
53
|
-
] })
|
|
54
|
-
] });
|
|
55
|
-
const renderDashboard = () => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
56
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
57
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
58
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { width: 180, height: 28, ...commonProps }),
|
|
59
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { width: 120, height: 36, borderRadius: 6, ...commonProps })
|
|
60
|
-
] }),
|
|
61
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-4 gap-4", children: [...Array(4)].map((_, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 border rounded-lg space-y-2", children: [
|
|
62
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { width: 100, height: 16, ...commonProps }),
|
|
63
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { width: 80, height: 32, ...commonProps }),
|
|
64
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { width: 60, height: 12, ...commonProps })
|
|
65
|
-
] }, i)) })
|
|
66
|
-
] }),
|
|
67
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { height: 300, borderRadius: 8, ...commonProps }),
|
|
68
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
|
|
69
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-4", children: [
|
|
70
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { width: 150, height: 20, ...commonProps }),
|
|
71
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { width: 150, height: 20, ...commonProps }),
|
|
72
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { width: 150, height: 20, ...commonProps })
|
|
73
|
-
] }),
|
|
74
|
-
[...Array(5)].map((_, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-4", children: [
|
|
75
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { width: 150, height: 16, ...commonProps }),
|
|
76
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { width: 150, height: 16, ...commonProps }),
|
|
77
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { width: 150, height: 16, ...commonProps })
|
|
78
|
-
] }, i))
|
|
79
|
-
] })
|
|
80
|
-
] });
|
|
81
|
-
const renderArticle = () => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-w-3xl mx-auto space-y-6", children: [
|
|
82
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
83
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { width: "80%", height: 40, ...commonProps }),
|
|
84
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
85
|
-
/* @__PURE__ */ jsxRuntime.jsx(SkeletonAvatar.SkeletonAvatar, { size: 48, ...commonProps }),
|
|
86
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2 flex-1", children: [
|
|
87
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { width: 120, height: 16, ...commonProps }),
|
|
88
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { width: 180, height: 14, ...commonProps })
|
|
89
|
-
] })
|
|
90
|
-
] })
|
|
91
|
-
] }),
|
|
92
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { height: 400, borderRadius: 8, ...commonProps }),
|
|
93
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
94
|
-
/* @__PURE__ */ jsxRuntime.jsx(SkeletonText.SkeletonText, { lines: 4, ...commonProps }),
|
|
95
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { height: 200, borderRadius: 8, ...commonProps }),
|
|
96
|
-
/* @__PURE__ */ jsxRuntime.jsx(SkeletonText.SkeletonText, { lines: 6, ...commonProps }),
|
|
97
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { height: 250, borderRadius: 8, ...commonProps }),
|
|
98
|
-
/* @__PURE__ */ jsxRuntime.jsx(SkeletonText.SkeletonText, { lines: 4, ...commonProps })
|
|
99
|
-
] })
|
|
100
|
-
] });
|
|
101
|
-
const renderProfile = () => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
102
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-6 border-b pb-6", children: [
|
|
103
|
-
/* @__PURE__ */ jsxRuntime.jsx(SkeletonAvatar.SkeletonAvatar, { size: 120, ...commonProps }),
|
|
104
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 space-y-3", children: [
|
|
105
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { width: 200, height: 32, ...commonProps }),
|
|
106
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { width: 150, height: 20, ...commonProps }),
|
|
107
|
-
/* @__PURE__ */ jsxRuntime.jsx(SkeletonText.SkeletonText, { lines: 2, ...commonProps }),
|
|
108
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-3", children: [
|
|
109
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { width: 100, height: 36, borderRadius: 6, ...commonProps }),
|
|
110
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { width: 100, height: 36, borderRadius: 6, ...commonProps })
|
|
111
|
-
] })
|
|
112
|
-
] })
|
|
113
|
-
] }),
|
|
114
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-3 gap-6", children: [
|
|
115
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
116
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { width: 100, height: 20, ...commonProps }),
|
|
117
|
-
[...Array(4)].map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { height: 16, ...commonProps }, i))
|
|
118
|
-
] }) }),
|
|
119
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-2 space-y-4", children: [...Array(3)].map((_, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 border rounded-lg space-y-3", children: [
|
|
120
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
121
|
-
/* @__PURE__ */ jsxRuntime.jsx(SkeletonAvatar.SkeletonAvatar, { size: 40, ...commonProps }),
|
|
122
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 space-y-2", children: [
|
|
123
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { width: 150, height: 16, ...commonProps }),
|
|
124
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { width: 100, height: 12, ...commonProps })
|
|
125
|
-
] })
|
|
126
|
-
] }),
|
|
127
|
-
/* @__PURE__ */ jsxRuntime.jsx(SkeletonText.SkeletonText, { lines: 2, ...commonProps }),
|
|
128
|
-
/* @__PURE__ */ jsxRuntime.jsx(Skeleton.Skeleton, { height: 200, borderRadius: 6, ...commonProps })
|
|
129
|
-
] }, i)) })
|
|
130
|
-
] })
|
|
131
|
-
] });
|
|
132
|
-
const renderContent = () => {
|
|
133
|
-
switch (variant) {
|
|
134
|
-
case "dashboard":
|
|
135
|
-
return renderDashboard();
|
|
136
|
-
case "article":
|
|
137
|
-
return renderArticle();
|
|
138
|
-
case "profile":
|
|
139
|
-
return renderProfile();
|
|
140
|
-
default:
|
|
141
|
-
return renderDefault();
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
35
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
145
36
|
"div",
|
|
146
37
|
{
|
|
147
38
|
ref,
|
|
148
39
|
"data-testid": testId,
|
|
149
|
-
className: classNames.cn("
|
|
40
|
+
className: classNames.cn("flex flex-col", className),
|
|
150
41
|
style: {
|
|
42
|
+
gap: colors.normalizeSize(gap),
|
|
151
43
|
...style,
|
|
152
44
|
opacity,
|
|
153
45
|
transition: transitionStyle
|
|
154
46
|
},
|
|
155
47
|
role: "status",
|
|
156
|
-
"aria-label": "Loading
|
|
48
|
+
"aria-label": "Loading list...",
|
|
157
49
|
"aria-busy": "true",
|
|
158
50
|
...rest,
|
|
159
|
-
children:
|
|
51
|
+
children: Array.from({ length: items }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
52
|
+
Skeleton.Skeleton,
|
|
53
|
+
{
|
|
54
|
+
width,
|
|
55
|
+
height: itemHeight,
|
|
56
|
+
variant: "rounded",
|
|
57
|
+
borderRadius,
|
|
58
|
+
animate,
|
|
59
|
+
baseColor,
|
|
60
|
+
highlightColor
|
|
61
|
+
},
|
|
62
|
+
index
|
|
63
|
+
))
|
|
160
64
|
}
|
|
161
65
|
);
|
|
162
66
|
}
|
|
163
67
|
);
|
|
164
|
-
|
|
165
|
-
exports.
|
|
166
|
-
//# sourceMappingURL=index12.cjs.map
|
|
68
|
+
SkeletonList.displayName = "SkeletonList";
|
|
69
|
+
exports.SkeletonList = SkeletonList;
|