premium-react-loaders 2.0.0 → 2.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 +262 -6
- package/dist/components/button/ButtonSpinner.d.ts +25 -0
- package/dist/components/button/ButtonSpinner.d.ts.map +1 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/pulse/TypingIndicator.d.ts.map +1 -1
- package/dist/components/status/ErrorIndicator.d.ts +32 -0
- package/dist/components/status/ErrorIndicator.d.ts.map +1 -0
- package/dist/components/status/SuccessCheckmark.d.ts +31 -0
- package/dist/components/status/SuccessCheckmark.d.ts.map +1 -0
- package/dist/components/status/index.d.ts +3 -0
- package/dist/components/status/index.d.ts.map +1 -0
- 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 +37 -26
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +37 -26
- package/dist/index10.cjs +20 -31
- package/dist/index10.js +20 -31
- package/dist/index11.cjs +47 -25
- package/dist/index11.js +47 -25
- package/dist/index12.cjs +30 -126
- package/dist/index12.js +31 -127
- package/dist/index13.cjs +30 -53
- package/dist/index13.js +30 -53
- package/dist/index14.cjs +127 -43
- package/dist/index14.js +128 -44
- package/dist/index15.cjs +58 -37
- package/dist/index15.js +59 -38
- package/dist/index16.cjs +24 -36
- package/dist/index16.js +24 -36
- package/dist/index17.cjs +19 -21
- package/dist/index17.js +19 -21
- package/dist/index18.cjs +25 -20
- package/dist/index18.js +25 -20
- package/dist/index19.cjs +22 -32
- package/dist/index19.js +22 -32
- package/dist/index20.cjs +26 -35
- package/dist/index20.js +28 -37
- package/dist/index21.cjs +40 -76
- package/dist/index21.js +42 -78
- package/dist/index22.cjs +53 -102
- package/dist/index22.js +54 -103
- package/dist/index23.cjs +46 -80
- package/dist/index23.js +47 -81
- package/dist/index24.cjs +105 -103
- package/dist/index24.js +107 -105
- package/dist/index25.cjs +108 -27
- package/dist/index25.js +111 -30
- package/dist/index26.cjs +104 -36
- package/dist/index26.js +106 -38
- package/dist/index27.cjs +22 -30
- package/dist/index27.js +23 -31
- package/dist/index28.cjs +30 -29
- package/dist/index28.js +31 -30
- package/dist/index29.cjs +49 -52
- package/dist/index29.js +50 -53
- package/dist/index30.cjs +74 -121
- package/dist/index30.js +75 -122
- package/dist/index31.cjs +82 -0
- package/dist/index31.js +82 -0
- package/dist/index32.cjs +149 -0
- package/dist/index32.js +149 -0
- package/dist/index33.cjs +100 -0
- package/dist/index33.js +100 -0
- package/dist/index34.cjs +117 -0
- package/dist/index34.js +117 -0
- package/dist/index35.cjs +125 -0
- package/dist/index35.js +125 -0
- package/dist/index5.cjs +11 -72
- package/dist/index5.js +12 -73
- package/dist/index6.cjs +86 -65
- package/dist/index6.js +87 -66
- package/dist/index7.cjs +40 -20
- package/dist/index7.js +40 -20
- package/dist/index8.cjs +34 -21
- package/dist/index8.js +34 -21
- package/dist/index9.cjs +21 -55
- package/dist/index9.js +22 -56
- package/dist/premium-react-loaders.css +178 -6
- package/dist/types/button.d.ts +31 -0
- package/dist/types/button.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/status.d.ts +34 -0
- package/dist/types/status.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3,35 +3,43 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
;/* empty css */
|
|
4
4
|
const classNames = require("./index3.cjs");
|
|
5
5
|
const colors = require("./index4.cjs");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
6
|
+
const ThemeContext = require("./index5.cjs");
|
|
7
|
+
const useLoader = require("./index6.cjs");
|
|
8
|
+
const Skeleton = require("./index7.cjs");
|
|
9
|
+
const SkeletonText = require("./index8.cjs");
|
|
10
|
+
const SkeletonAvatar = require("./index9.cjs");
|
|
11
|
+
const SkeletonImage = require("./index10.cjs");
|
|
12
|
+
const SkeletonCard = require("./index11.cjs");
|
|
13
|
+
const SkeletonList = require("./index12.cjs");
|
|
14
|
+
const SkeletonTable = require("./index13.cjs");
|
|
15
|
+
const SkeletonPage = require("./index14.cjs");
|
|
16
|
+
const SkeletonForm = require("./index15.cjs");
|
|
17
|
+
const SpinnerCircle = require("./index16.cjs");
|
|
18
|
+
const SpinnerRing = require("./index17.cjs");
|
|
19
|
+
const SpinnerDots = require("./index18.cjs");
|
|
20
|
+
const SpinnerBars = require("./index19.cjs");
|
|
21
|
+
const SpinnerGrid = require("./index20.cjs");
|
|
22
|
+
const SpinnerWave = require("./index21.cjs");
|
|
23
|
+
const SpinnerPulse = require("./index22.cjs");
|
|
24
|
+
const ProgressBar = require("./index23.cjs");
|
|
25
|
+
const ProgressCircle = require("./index24.cjs");
|
|
26
|
+
const ProgressRing = require("./index25.cjs");
|
|
27
|
+
const ProgressSteps = require("./index26.cjs");
|
|
28
|
+
const PulseDots = require("./index27.cjs");
|
|
29
|
+
const PulseWave = require("./index28.cjs");
|
|
30
|
+
const PulseBars = require("./index29.cjs");
|
|
31
|
+
const TypingIndicator = require("./index30.cjs");
|
|
32
|
+
const LoaderOverlay = require("./index31.cjs");
|
|
33
|
+
const ButtonSpinner = require("./index32.cjs");
|
|
34
|
+
const SuccessCheckmark = require("./index33.cjs");
|
|
35
|
+
const ErrorIndicator = require("./index34.cjs");
|
|
36
|
+
const version = "2.1.0";
|
|
32
37
|
exports.cn = classNames.cn;
|
|
33
38
|
exports.getAnimationDuration = colors.getAnimationDuration;
|
|
34
39
|
exports.normalizeSize = colors.normalizeSize;
|
|
40
|
+
exports.ThemeProvider = ThemeContext.ThemeProvider;
|
|
41
|
+
exports.useTheme = ThemeContext.useTheme;
|
|
42
|
+
exports.useLoader = useLoader.useLoader;
|
|
35
43
|
exports.Skeleton = Skeleton.Skeleton;
|
|
36
44
|
exports.SkeletonText = SkeletonText.SkeletonText;
|
|
37
45
|
exports.SkeletonAvatar = SkeletonAvatar.SkeletonAvatar;
|
|
@@ -57,4 +65,7 @@ exports.PulseWave = PulseWave.PulseWave;
|
|
|
57
65
|
exports.PulseBars = PulseBars.PulseBars;
|
|
58
66
|
exports.TypingIndicator = TypingIndicator.TypingIndicator;
|
|
59
67
|
exports.LoaderOverlay = LoaderOverlay.LoaderOverlay;
|
|
68
|
+
exports.ButtonSpinner = ButtonSpinner.ButtonSpinner;
|
|
69
|
+
exports.SuccessCheckmark = SuccessCheckmark.SuccessCheckmark;
|
|
70
|
+
exports.ErrorIndicator = ErrorIndicator.ErrorIndicator;
|
|
60
71
|
exports.version = version;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export * from './components';
|
|
2
2
|
export type * from './types';
|
|
3
|
+
export { ThemeProvider, useTheme } from './context';
|
|
4
|
+
export type { LoaderTheme, ThemeProviderProps } from './context';
|
|
5
|
+
export { useLoader } from './hooks';
|
|
6
|
+
export type { UseLoaderOptions, UseLoaderReturn } from './hooks';
|
|
3
7
|
export { cn } from './utils/classNames';
|
|
4
8
|
export { getAnimationDuration, normalizeSize } from './utils/colors';
|
|
5
|
-
export declare const version = "
|
|
9
|
+
export declare const version = "2.1.0";
|
|
6
10
|
//# sourceMappingURL=index.d.ts.map
|
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,33 +1,40 @@
|
|
|
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
|
+
import { ButtonSpinner } from "./index32.js";
|
|
32
|
+
import { SuccessCheckmark } from "./index33.js";
|
|
33
|
+
import { ErrorIndicator } from "./index34.js";
|
|
34
|
+
const version = "2.1.0";
|
|
30
35
|
export {
|
|
36
|
+
ButtonSpinner,
|
|
37
|
+
ErrorIndicator,
|
|
31
38
|
LoaderOverlay,
|
|
32
39
|
ProgressBar,
|
|
33
40
|
ProgressCircle,
|
|
@@ -52,9 +59,13 @@ export {
|
|
|
52
59
|
SpinnerPulse,
|
|
53
60
|
SpinnerRing,
|
|
54
61
|
SpinnerWave,
|
|
62
|
+
SuccessCheckmark,
|
|
63
|
+
ThemeProvider,
|
|
55
64
|
TypingIndicator,
|
|
56
65
|
cn,
|
|
57
66
|
getAnimationDuration,
|
|
58
67
|
normalizeSize,
|
|
68
|
+
useLoader,
|
|
69
|
+
useTheme,
|
|
59
70
|
version
|
|
60
71
|
};
|
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("./index35.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,37 +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.
|
|
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 "./index35.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,39 +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
|
};
|
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("./index35.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,40 +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.
|
|
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 "./index35.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,42 +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
|
};
|