premium-react-loaders 1.0.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/LICENSE +21 -0
- package/README.md +375 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/progress/ProgressBar.d.ts +15 -0
- package/dist/components/progress/ProgressBar.d.ts.map +1 -0
- package/dist/components/progress/ProgressCircle.d.ts +15 -0
- package/dist/components/progress/ProgressCircle.d.ts.map +1 -0
- package/dist/components/progress/ProgressRing.d.ts +15 -0
- package/dist/components/progress/ProgressRing.d.ts.map +1 -0
- package/dist/components/progress/index.d.ts +4 -0
- package/dist/components/progress/index.d.ts.map +1 -0
- package/dist/components/pulse/PulseBars.d.ts +14 -0
- package/dist/components/pulse/PulseBars.d.ts.map +1 -0
- package/dist/components/pulse/PulseDots.d.ts +14 -0
- package/dist/components/pulse/PulseDots.d.ts.map +1 -0
- package/dist/components/pulse/PulseWave.d.ts +14 -0
- package/dist/components/pulse/PulseWave.d.ts.map +1 -0
- package/dist/components/pulse/index.d.ts +4 -0
- package/dist/components/pulse/index.d.ts.map +1 -0
- package/dist/components/skeleton/Skeleton.d.ts +15 -0
- package/dist/components/skeleton/Skeleton.d.ts.map +1 -0
- package/dist/components/skeleton/SkeletonAvatar.d.ts +14 -0
- package/dist/components/skeleton/SkeletonAvatar.d.ts.map +1 -0
- package/dist/components/skeleton/SkeletonCard.d.ts +15 -0
- package/dist/components/skeleton/SkeletonCard.d.ts.map +1 -0
- package/dist/components/skeleton/SkeletonImage.d.ts +14 -0
- package/dist/components/skeleton/SkeletonImage.d.ts.map +1 -0
- package/dist/components/skeleton/SkeletonList.d.ts +14 -0
- package/dist/components/skeleton/SkeletonList.d.ts.map +1 -0
- package/dist/components/skeleton/SkeletonTable.d.ts +14 -0
- package/dist/components/skeleton/SkeletonTable.d.ts.map +1 -0
- package/dist/components/skeleton/SkeletonText.d.ts +14 -0
- package/dist/components/skeleton/SkeletonText.d.ts.map +1 -0
- package/dist/components/skeleton/index.d.ts +8 -0
- package/dist/components/skeleton/index.d.ts.map +1 -0
- package/dist/components/spinner/SpinnerBars.d.ts +14 -0
- package/dist/components/spinner/SpinnerBars.d.ts.map +1 -0
- package/dist/components/spinner/SpinnerCircle.d.ts +14 -0
- package/dist/components/spinner/SpinnerCircle.d.ts.map +1 -0
- package/dist/components/spinner/SpinnerDots.d.ts +14 -0
- package/dist/components/spinner/SpinnerDots.d.ts.map +1 -0
- package/dist/components/spinner/SpinnerGrid.d.ts +14 -0
- package/dist/components/spinner/SpinnerGrid.d.ts.map +1 -0
- package/dist/components/spinner/SpinnerRing.d.ts +14 -0
- package/dist/components/spinner/SpinnerRing.d.ts.map +1 -0
- package/dist/components/spinner/index.d.ts +6 -0
- package/dist/components/spinner/index.d.ts.map +1 -0
- package/dist/index.cjs +47 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/dist/index10.cjs +58 -0
- package/dist/index10.cjs.map +1 -0
- package/dist/index10.js +58 -0
- package/dist/index10.js.map +1 -0
- package/dist/index11.cjs +55 -0
- package/dist/index11.cjs.map +1 -0
- package/dist/index11.js +55 -0
- package/dist/index11.js.map +1 -0
- package/dist/index12.cjs +63 -0
- package/dist/index12.cjs.map +1 -0
- package/dist/index12.js +63 -0
- package/dist/index12.js.map +1 -0
- package/dist/index13.cjs +51 -0
- package/dist/index13.cjs.map +1 -0
- package/dist/index13.js +51 -0
- package/dist/index13.js.map +1 -0
- package/dist/index14.cjs +74 -0
- package/dist/index14.cjs.map +1 -0
- package/dist/index14.js +74 -0
- package/dist/index14.js.map +1 -0
- package/dist/index15.cjs +58 -0
- package/dist/index15.cjs.map +1 -0
- package/dist/index15.js +58 -0
- package/dist/index15.js.map +1 -0
- package/dist/index16.cjs +71 -0
- package/dist/index16.cjs.map +1 -0
- package/dist/index16.js +71 -0
- package/dist/index16.js.map +1 -0
- package/dist/index17.cjs +81 -0
- package/dist/index17.cjs.map +1 -0
- package/dist/index17.js +81 -0
- package/dist/index17.js.map +1 -0
- package/dist/index18.cjs +107 -0
- package/dist/index18.cjs.map +1 -0
- package/dist/index18.js +107 -0
- package/dist/index18.js.map +1 -0
- package/dist/index19.cjs +113 -0
- package/dist/index19.cjs.map +1 -0
- package/dist/index19.js +113 -0
- package/dist/index19.js.map +1 -0
- package/dist/index20.cjs +57 -0
- package/dist/index20.cjs.map +1 -0
- package/dist/index20.js +57 -0
- package/dist/index20.js.map +1 -0
- package/dist/index21.cjs +62 -0
- package/dist/index21.cjs.map +1 -0
- package/dist/index21.js +62 -0
- package/dist/index21.js.map +1 -0
- package/dist/index22.cjs +64 -0
- package/dist/index22.cjs.map +1 -0
- package/dist/index22.js +64 -0
- package/dist/index22.js.map +1 -0
- package/dist/index23.cjs +18 -0
- package/dist/index23.cjs.map +1 -0
- package/dist/index23.js +18 -0
- package/dist/index23.js.map +1 -0
- package/dist/index3.cjs +8 -0
- package/dist/index3.cjs.map +1 -0
- package/dist/index3.js +8 -0
- package/dist/index3.js.map +1 -0
- package/dist/index4.cjs +22 -0
- package/dist/index4.cjs.map +1 -0
- package/dist/index4.js +22 -0
- package/dist/index4.js.map +1 -0
- package/dist/index5.cjs +65 -0
- package/dist/index5.cjs.map +1 -0
- package/dist/index5.js +65 -0
- package/dist/index5.js.map +1 -0
- package/dist/index6.cjs +59 -0
- package/dist/index6.cjs.map +1 -0
- package/dist/index6.js +59 -0
- package/dist/index6.js.map +1 -0
- package/dist/index7.cjs +43 -0
- package/dist/index7.cjs.map +1 -0
- package/dist/index7.js +43 -0
- package/dist/index7.js.map +1 -0
- package/dist/index8.cjs +47 -0
- package/dist/index8.cjs.map +1 -0
- package/dist/index8.js +47 -0
- package/dist/index8.js.map +1 -0
- package/dist/index9.cjs +77 -0
- package/dist/index9.cjs.map +1 -0
- package/dist/index9.js +77 -0
- package/dist/index9.js.map +1 -0
- package/dist/premium-react-loaders.css +701 -0
- package/dist/types/common.d.ts +65 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/progress.d.ts +25 -0
- package/dist/types/progress.d.ts.map +1 -0
- package/dist/types/pulse.d.ts +25 -0
- package/dist/types/pulse.d.ts.map +1 -0
- package/dist/types/skeleton.d.ts +71 -0
- package/dist/types/skeleton.d.ts.map +1 -0
- package/dist/types/spinner.d.ts +39 -0
- package/dist/types/spinner.d.ts.map +1 -0
- package/dist/utils/classNames.d.ts +14 -0
- package/dist/utils/classNames.d.ts.map +1 -0
- package/dist/utils/colors.d.ts +25 -0
- package/dist/utils/colors.d.ts.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/package.json +89 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index5.cjs","sources":["../src/components/skeleton/Skeleton.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { SkeletonProps } from '../../types';\nimport { cn, normalizeSize } from '../../utils';\n\n/**\n * Skeleton - Base skeleton loader component\n *\n * A versatile skeleton loader that can be used standalone or as a building block for more complex loaders.\n *\n * @example\n * ```tsx\n * <Skeleton width={200} height={20} />\n * <Skeleton variant=\"circular\" width={40} height={40} />\n * ```\n */\nexport const Skeleton = forwardRef<HTMLDivElement, SkeletonProps>(\n (\n {\n width = '100%',\n height = '1rem',\n borderRadius,\n variant = 'text',\n animate = true,\n baseColor = '#e0e0e0',\n highlightColor = '#f5f5f5',\n className,\n style,\n testId = 'skeleton',\n visible = true,\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const getBorderRadius = () => {\n if (borderRadius !== undefined) return normalizeSize(borderRadius);\n\n switch (variant) {\n case 'circular':\n return '50%';\n case 'rounded':\n return '0.5rem';\n case 'text':\n return '0.25rem';\n case 'rectangular':\n default:\n return '0';\n }\n };\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn(\n 'skeleton',\n animate && 'skeleton-animate',\n className\n )}\n style={{\n width: normalizeSize(width),\n height: normalizeSize(height),\n borderRadius: getBorderRadius(),\n backgroundColor: baseColor,\n '--skeleton-highlight-color': highlightColor,\n ...style,\n } as React.CSSProperties}\n role=\"status\"\n aria-label=\"Loading...\"\n aria-busy=\"true\"\n {...rest}\n />\n );\n }\n);\n\nSkeleton.displayName = 'Skeleton';\n"],"names":["forwardRef","normalizeSize","jsx","cn"],"mappings":";;;;;;AAeO,MAAM,WAAWA,MAAAA;AAAAA,EACtB,CACE;AAAA,IACE,QAAQ;AAAA,IACR,SAAS;AAAA,IACT;AAAA,IACA,UAAU;AAAA,IACV,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,iBAAiB;AAAA,IACjB;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,UAAM,kBAAkB,MAAM;AAC5B,UAAI,iBAAiB,OAAW,QAAOC,OAAAA,cAAc,YAAY;AAEjE,cAAQ,SAAA;AAAA,QACN,KAAK;AACH,iBAAO;AAAA,QACT,KAAK;AACH,iBAAO;AAAA,QACT,KAAK;AACH,iBAAO;AAAA,QACT,KAAK;AAAA,QACL;AACE,iBAAO;AAAA,MAAA;AAAA,IAEb;AAEA,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAWC,WAAAA;AAAAA,UACT;AAAA,UACA,WAAW;AAAA,UACX;AAAA,QAAA;AAAA,QAEF,OAAO;AAAA,UACL,OAAOF,OAAAA,cAAc,KAAK;AAAA,UAC1B,QAAQA,OAAAA,cAAc,MAAM;AAAA,UAC5B,cAAc,gBAAA;AAAA,UACd,iBAAiB;AAAA,UACjB,8BAA8B;AAAA,UAC9B,GAAG;AAAA,QAAA;AAAA,QAEL,MAAK;AAAA,QACL,cAAW;AAAA,QACX,aAAU;AAAA,QACT,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEA,SAAS,cAAc;;"}
|
package/dist/index5.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { normalizeSize } from "./index4.js";
|
|
4
|
+
import { cn } from "./index3.js";
|
|
5
|
+
const Skeleton = forwardRef(
|
|
6
|
+
({
|
|
7
|
+
width = "100%",
|
|
8
|
+
height = "1rem",
|
|
9
|
+
borderRadius,
|
|
10
|
+
variant = "text",
|
|
11
|
+
animate = true,
|
|
12
|
+
baseColor = "#e0e0e0",
|
|
13
|
+
highlightColor = "#f5f5f5",
|
|
14
|
+
className,
|
|
15
|
+
style,
|
|
16
|
+
testId = "skeleton",
|
|
17
|
+
visible = true,
|
|
18
|
+
...rest
|
|
19
|
+
}, ref) => {
|
|
20
|
+
if (!visible) return null;
|
|
21
|
+
const getBorderRadius = () => {
|
|
22
|
+
if (borderRadius !== void 0) return normalizeSize(borderRadius);
|
|
23
|
+
switch (variant) {
|
|
24
|
+
case "circular":
|
|
25
|
+
return "50%";
|
|
26
|
+
case "rounded":
|
|
27
|
+
return "0.5rem";
|
|
28
|
+
case "text":
|
|
29
|
+
return "0.25rem";
|
|
30
|
+
case "rectangular":
|
|
31
|
+
default:
|
|
32
|
+
return "0";
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
return /* @__PURE__ */ jsx(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
ref,
|
|
39
|
+
"data-testid": testId,
|
|
40
|
+
className: cn(
|
|
41
|
+
"skeleton",
|
|
42
|
+
animate && "skeleton-animate",
|
|
43
|
+
className
|
|
44
|
+
),
|
|
45
|
+
style: {
|
|
46
|
+
width: normalizeSize(width),
|
|
47
|
+
height: normalizeSize(height),
|
|
48
|
+
borderRadius: getBorderRadius(),
|
|
49
|
+
backgroundColor: baseColor,
|
|
50
|
+
"--skeleton-highlight-color": highlightColor,
|
|
51
|
+
...style
|
|
52
|
+
},
|
|
53
|
+
role: "status",
|
|
54
|
+
"aria-label": "Loading...",
|
|
55
|
+
"aria-busy": "true",
|
|
56
|
+
...rest
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
Skeleton.displayName = "Skeleton";
|
|
62
|
+
export {
|
|
63
|
+
Skeleton
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=index5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index5.js","sources":["../src/components/skeleton/Skeleton.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { SkeletonProps } from '../../types';\nimport { cn, normalizeSize } from '../../utils';\n\n/**\n * Skeleton - Base skeleton loader component\n *\n * A versatile skeleton loader that can be used standalone or as a building block for more complex loaders.\n *\n * @example\n * ```tsx\n * <Skeleton width={200} height={20} />\n * <Skeleton variant=\"circular\" width={40} height={40} />\n * ```\n */\nexport const Skeleton = forwardRef<HTMLDivElement, SkeletonProps>(\n (\n {\n width = '100%',\n height = '1rem',\n borderRadius,\n variant = 'text',\n animate = true,\n baseColor = '#e0e0e0',\n highlightColor = '#f5f5f5',\n className,\n style,\n testId = 'skeleton',\n visible = true,\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const getBorderRadius = () => {\n if (borderRadius !== undefined) return normalizeSize(borderRadius);\n\n switch (variant) {\n case 'circular':\n return '50%';\n case 'rounded':\n return '0.5rem';\n case 'text':\n return '0.25rem';\n case 'rectangular':\n default:\n return '0';\n }\n };\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn(\n 'skeleton',\n animate && 'skeleton-animate',\n className\n )}\n style={{\n width: normalizeSize(width),\n height: normalizeSize(height),\n borderRadius: getBorderRadius(),\n backgroundColor: baseColor,\n '--skeleton-highlight-color': highlightColor,\n ...style,\n } as React.CSSProperties}\n role=\"status\"\n aria-label=\"Loading...\"\n aria-busy=\"true\"\n {...rest}\n />\n );\n }\n);\n\nSkeleton.displayName = 'Skeleton';\n"],"names":[],"mappings":";;;;AAeO,MAAM,WAAW;AAAA,EACtB,CACE;AAAA,IACE,QAAQ;AAAA,IACR,SAAS;AAAA,IACT;AAAA,IACA,UAAU;AAAA,IACV,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,iBAAiB;AAAA,IACjB;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,UAAM,kBAAkB,MAAM;AAC5B,UAAI,iBAAiB,OAAW,QAAO,cAAc,YAAY;AAEjE,cAAQ,SAAA;AAAA,QACN,KAAK;AACH,iBAAO;AAAA,QACT,KAAK;AACH,iBAAO;AAAA,QACT,KAAK;AACH,iBAAO;AAAA,QACT,KAAK;AAAA,QACL;AACE,iBAAO;AAAA,MAAA;AAAA,IAEb;AAEA,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAW;AAAA,UACT;AAAA,UACA,WAAW;AAAA,UACX;AAAA,QAAA;AAAA,QAEF,OAAO;AAAA,UACL,OAAO,cAAc,KAAK;AAAA,UAC1B,QAAQ,cAAc,MAAM;AAAA,UAC5B,cAAc,gBAAA;AAAA,UACd,iBAAiB;AAAA,UACjB,8BAA8B;AAAA,UAC9B,GAAG;AAAA,QAAA;AAAA,QAEL,MAAK;AAAA,QACL,cAAW;AAAA,QACX,aAAU;AAAA,QACT,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEA,SAAS,cAAc;"}
|
package/dist/index6.cjs
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const react = require("react");
|
|
5
|
+
const Skeleton = require("./index5.cjs");
|
|
6
|
+
const colors = require("./index4.cjs");
|
|
7
|
+
const classNames = require("./index3.cjs");
|
|
8
|
+
const SkeletonText = react.forwardRef(
|
|
9
|
+
({
|
|
10
|
+
lines = 3,
|
|
11
|
+
width = "100%",
|
|
12
|
+
height = "1rem",
|
|
13
|
+
gap = "0.5rem",
|
|
14
|
+
animate = true,
|
|
15
|
+
baseColor,
|
|
16
|
+
highlightColor,
|
|
17
|
+
className,
|
|
18
|
+
style,
|
|
19
|
+
testId = "skeleton-text",
|
|
20
|
+
visible = true,
|
|
21
|
+
...rest
|
|
22
|
+
}, ref) => {
|
|
23
|
+
if (!visible) return null;
|
|
24
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
25
|
+
"div",
|
|
26
|
+
{
|
|
27
|
+
ref,
|
|
28
|
+
"data-testid": testId,
|
|
29
|
+
className: classNames.cn("flex flex-col", className),
|
|
30
|
+
style: {
|
|
31
|
+
gap: colors.normalizeSize(gap),
|
|
32
|
+
...style
|
|
33
|
+
},
|
|
34
|
+
role: "status",
|
|
35
|
+
"aria-label": "Loading text...",
|
|
36
|
+
"aria-busy": "true",
|
|
37
|
+
...rest,
|
|
38
|
+
children: Array.from({ length: lines }).map((_, index) => {
|
|
39
|
+
const lineWidth = index === lines - 1 ? "80%" : width;
|
|
40
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
41
|
+
Skeleton.Skeleton,
|
|
42
|
+
{
|
|
43
|
+
width: lineWidth,
|
|
44
|
+
height,
|
|
45
|
+
animate,
|
|
46
|
+
baseColor,
|
|
47
|
+
highlightColor,
|
|
48
|
+
variant: "text"
|
|
49
|
+
},
|
|
50
|
+
index
|
|
51
|
+
);
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
SkeletonText.displayName = "SkeletonText";
|
|
58
|
+
exports.SkeletonText = SkeletonText;
|
|
59
|
+
//# sourceMappingURL=index6.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index6.cjs","sources":["../src/components/skeleton/SkeletonText.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SkeletonTextProps } from '../../types';\nimport { cn, normalizeSize } from '../../utils';\nimport { Skeleton } from './Skeleton';\n\n/**\n * SkeletonText - Multi-line text skeleton loader\n *\n * Renders multiple skeleton lines to mimic text content while loading.\n *\n * @example\n * ```tsx\n * <SkeletonText lines={3} />\n * <SkeletonText lines={5} gap={8} />\n * ```\n */\nexport const SkeletonText = forwardRef<HTMLDivElement, SkeletonTextProps>(\n (\n {\n lines = 3,\n width = '100%',\n height = '1rem',\n gap = '0.5rem',\n animate = true,\n baseColor,\n highlightColor,\n className,\n style,\n testId = 'skeleton-text',\n visible = true,\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('flex flex-col', className)}\n style={{\n gap: normalizeSize(gap),\n ...style,\n }}\n role=\"status\"\n aria-label=\"Loading text...\"\n aria-busy=\"true\"\n {...rest}\n >\n {Array.from({ length: lines }).map((_, index) => {\n // Last line is typically shorter (80% width)\n const lineWidth = index === lines - 1 ? '80%' : width;\n\n return (\n <Skeleton\n key={index}\n width={lineWidth}\n height={height}\n animate={animate}\n baseColor={baseColor}\n highlightColor={highlightColor}\n variant=\"text\"\n />\n );\n })}\n </div>\n );\n }\n);\n\nSkeletonText.displayName = 'SkeletonText';\n"],"names":["forwardRef","jsx","cn","normalizeSize","Skeleton"],"mappings":";;;;;;;AAgBO,MAAM,eAAeA,MAAAA;AAAAA,EAC1B,CACE;AAAA,IACE,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,MAAM;AAAA,IACN,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,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAWC,WAAAA,GAAG,iBAAiB,SAAS;AAAA,QACxC,OAAO;AAAA,UACL,KAAKC,OAAAA,cAAc,GAAG;AAAA,UACtB,GAAG;AAAA,QAAA;AAAA,QAEL,MAAK;AAAA,QACL,cAAW;AAAA,QACX,aAAU;AAAA,QACT,GAAG;AAAA,QAEH,UAAA,MAAM,KAAK,EAAE,QAAQ,MAAA,CAAO,EAAE,IAAI,CAAC,GAAG,UAAU;AAE/C,gBAAM,YAAY,UAAU,QAAQ,IAAI,QAAQ;AAEhD,iBACEF,2BAAAA;AAAAA,YAACG,SAAAA;AAAAA,YAAA;AAAA,cAEC,OAAO;AAAA,cACP;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA,SAAQ;AAAA,YAAA;AAAA,YANH;AAAA,UAAA;AAAA,QASX,CAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,aAAa,cAAc;;"}
|
package/dist/index6.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { Skeleton } from "./index5.js";
|
|
4
|
+
import { normalizeSize } from "./index4.js";
|
|
5
|
+
import { cn } from "./index3.js";
|
|
6
|
+
const SkeletonText = forwardRef(
|
|
7
|
+
({
|
|
8
|
+
lines = 3,
|
|
9
|
+
width = "100%",
|
|
10
|
+
height = "1rem",
|
|
11
|
+
gap = "0.5rem",
|
|
12
|
+
animate = true,
|
|
13
|
+
baseColor,
|
|
14
|
+
highlightColor,
|
|
15
|
+
className,
|
|
16
|
+
style,
|
|
17
|
+
testId = "skeleton-text",
|
|
18
|
+
visible = true,
|
|
19
|
+
...rest
|
|
20
|
+
}, ref) => {
|
|
21
|
+
if (!visible) return null;
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
ref,
|
|
26
|
+
"data-testid": testId,
|
|
27
|
+
className: cn("flex flex-col", className),
|
|
28
|
+
style: {
|
|
29
|
+
gap: normalizeSize(gap),
|
|
30
|
+
...style
|
|
31
|
+
},
|
|
32
|
+
role: "status",
|
|
33
|
+
"aria-label": "Loading text...",
|
|
34
|
+
"aria-busy": "true",
|
|
35
|
+
...rest,
|
|
36
|
+
children: Array.from({ length: lines }).map((_, index) => {
|
|
37
|
+
const lineWidth = index === lines - 1 ? "80%" : width;
|
|
38
|
+
return /* @__PURE__ */ jsx(
|
|
39
|
+
Skeleton,
|
|
40
|
+
{
|
|
41
|
+
width: lineWidth,
|
|
42
|
+
height,
|
|
43
|
+
animate,
|
|
44
|
+
baseColor,
|
|
45
|
+
highlightColor,
|
|
46
|
+
variant: "text"
|
|
47
|
+
},
|
|
48
|
+
index
|
|
49
|
+
);
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
SkeletonText.displayName = "SkeletonText";
|
|
56
|
+
export {
|
|
57
|
+
SkeletonText
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=index6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index6.js","sources":["../src/components/skeleton/SkeletonText.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SkeletonTextProps } from '../../types';\nimport { cn, normalizeSize } from '../../utils';\nimport { Skeleton } from './Skeleton';\n\n/**\n * SkeletonText - Multi-line text skeleton loader\n *\n * Renders multiple skeleton lines to mimic text content while loading.\n *\n * @example\n * ```tsx\n * <SkeletonText lines={3} />\n * <SkeletonText lines={5} gap={8} />\n * ```\n */\nexport const SkeletonText = forwardRef<HTMLDivElement, SkeletonTextProps>(\n (\n {\n lines = 3,\n width = '100%',\n height = '1rem',\n gap = '0.5rem',\n animate = true,\n baseColor,\n highlightColor,\n className,\n style,\n testId = 'skeleton-text',\n visible = true,\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('flex flex-col', className)}\n style={{\n gap: normalizeSize(gap),\n ...style,\n }}\n role=\"status\"\n aria-label=\"Loading text...\"\n aria-busy=\"true\"\n {...rest}\n >\n {Array.from({ length: lines }).map((_, index) => {\n // Last line is typically shorter (80% width)\n const lineWidth = index === lines - 1 ? '80%' : width;\n\n return (\n <Skeleton\n key={index}\n width={lineWidth}\n height={height}\n animate={animate}\n baseColor={baseColor}\n highlightColor={highlightColor}\n variant=\"text\"\n />\n );\n })}\n </div>\n );\n }\n);\n\nSkeletonText.displayName = 'SkeletonText';\n"],"names":[],"mappings":";;;;;AAgBO,MAAM,eAAe;AAAA,EAC1B,CACE;AAAA,IACE,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,MAAM;AAAA,IACN,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,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAW,GAAG,iBAAiB,SAAS;AAAA,QACxC,OAAO;AAAA,UACL,KAAK,cAAc,GAAG;AAAA,UACtB,GAAG;AAAA,QAAA;AAAA,QAEL,MAAK;AAAA,QACL,cAAW;AAAA,QACX,aAAU;AAAA,QACT,GAAG;AAAA,QAEH,UAAA,MAAM,KAAK,EAAE,QAAQ,MAAA,CAAO,EAAE,IAAI,CAAC,GAAG,UAAU;AAE/C,gBAAM,YAAY,UAAU,QAAQ,IAAI,QAAQ;AAEhD,iBACE;AAAA,YAAC;AAAA,YAAA;AAAA,cAEC,OAAO;AAAA,cACP;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA,SAAQ;AAAA,YAAA;AAAA,YANH;AAAA,UAAA;AAAA,QASX,CAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,aAAa,cAAc;"}
|
package/dist/index7.cjs
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const react = require("react");
|
|
5
|
+
const Skeleton = require("./index5.cjs");
|
|
6
|
+
const colors = require("./index4.cjs");
|
|
7
|
+
const SkeletonAvatar = react.forwardRef(
|
|
8
|
+
({
|
|
9
|
+
size = 40,
|
|
10
|
+
shape = "circle",
|
|
11
|
+
animate = true,
|
|
12
|
+
baseColor,
|
|
13
|
+
highlightColor,
|
|
14
|
+
className,
|
|
15
|
+
style,
|
|
16
|
+
testId = "skeleton-avatar",
|
|
17
|
+
visible = true,
|
|
18
|
+
...rest
|
|
19
|
+
}, ref) => {
|
|
20
|
+
if (!visible) return null;
|
|
21
|
+
const sizeValue = colors.normalizeSize(size);
|
|
22
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
23
|
+
Skeleton.Skeleton,
|
|
24
|
+
{
|
|
25
|
+
ref,
|
|
26
|
+
"data-testid": testId,
|
|
27
|
+
width: sizeValue,
|
|
28
|
+
height: sizeValue,
|
|
29
|
+
variant: shape === "circle" ? "circular" : "rounded",
|
|
30
|
+
animate,
|
|
31
|
+
baseColor,
|
|
32
|
+
highlightColor,
|
|
33
|
+
className,
|
|
34
|
+
style,
|
|
35
|
+
"aria-label": "Loading avatar...",
|
|
36
|
+
...rest
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
SkeletonAvatar.displayName = "SkeletonAvatar";
|
|
42
|
+
exports.SkeletonAvatar = SkeletonAvatar;
|
|
43
|
+
//# sourceMappingURL=index7.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index7.cjs","sources":["../src/components/skeleton/SkeletonAvatar.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SkeletonAvatarProps } from '../../types';\nimport { normalizeSize } from '../../utils';\nimport { Skeleton } from './Skeleton';\n\n/**\n * SkeletonAvatar - Avatar skeleton loader\n *\n * A skeleton loader for avatar placeholders with circle or square shapes.\n *\n * @example\n * ```tsx\n * <SkeletonAvatar size={40} />\n * <SkeletonAvatar size={64} shape=\"square\" />\n * ```\n */\nexport const SkeletonAvatar = forwardRef<HTMLDivElement, SkeletonAvatarProps>(\n (\n {\n size = 40,\n shape = 'circle',\n animate = true,\n baseColor,\n highlightColor,\n className,\n style,\n testId = 'skeleton-avatar',\n visible = true,\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const sizeValue = normalizeSize(size);\n\n return (\n <Skeleton\n ref={ref}\n data-testid={testId}\n width={sizeValue}\n height={sizeValue}\n variant={shape === 'circle' ? 'circular' : 'rounded'}\n animate={animate}\n baseColor={baseColor}\n highlightColor={highlightColor}\n className={className}\n style={style}\n aria-label=\"Loading avatar...\"\n {...rest}\n />\n );\n }\n);\n\nSkeletonAvatar.displayName = 'SkeletonAvatar';\n"],"names":["forwardRef","normalizeSize","jsx","Skeleton"],"mappings":";;;;;;AAgBO,MAAM,iBAAiBA,MAAAA;AAAAA,EAC5B,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,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,YAAYC,OAAAA,cAAc,IAAI;AAEpC,WACEC,2BAAAA;AAAAA,MAACC,SAAAA;AAAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,SAAS,UAAU,WAAW,aAAa;AAAA,QAC3C;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,cAAW;AAAA,QACV,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEA,eAAe,cAAc;;"}
|
package/dist/index7.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { Skeleton } from "./index5.js";
|
|
4
|
+
import { normalizeSize } from "./index4.js";
|
|
5
|
+
const SkeletonAvatar = forwardRef(
|
|
6
|
+
({
|
|
7
|
+
size = 40,
|
|
8
|
+
shape = "circle",
|
|
9
|
+
animate = true,
|
|
10
|
+
baseColor,
|
|
11
|
+
highlightColor,
|
|
12
|
+
className,
|
|
13
|
+
style,
|
|
14
|
+
testId = "skeleton-avatar",
|
|
15
|
+
visible = true,
|
|
16
|
+
...rest
|
|
17
|
+
}, ref) => {
|
|
18
|
+
if (!visible) return null;
|
|
19
|
+
const sizeValue = normalizeSize(size);
|
|
20
|
+
return /* @__PURE__ */ jsx(
|
|
21
|
+
Skeleton,
|
|
22
|
+
{
|
|
23
|
+
ref,
|
|
24
|
+
"data-testid": testId,
|
|
25
|
+
width: sizeValue,
|
|
26
|
+
height: sizeValue,
|
|
27
|
+
variant: shape === "circle" ? "circular" : "rounded",
|
|
28
|
+
animate,
|
|
29
|
+
baseColor,
|
|
30
|
+
highlightColor,
|
|
31
|
+
className,
|
|
32
|
+
style,
|
|
33
|
+
"aria-label": "Loading avatar...",
|
|
34
|
+
...rest
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
SkeletonAvatar.displayName = "SkeletonAvatar";
|
|
40
|
+
export {
|
|
41
|
+
SkeletonAvatar
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=index7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index7.js","sources":["../src/components/skeleton/SkeletonAvatar.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SkeletonAvatarProps } from '../../types';\nimport { normalizeSize } from '../../utils';\nimport { Skeleton } from './Skeleton';\n\n/**\n * SkeletonAvatar - Avatar skeleton loader\n *\n * A skeleton loader for avatar placeholders with circle or square shapes.\n *\n * @example\n * ```tsx\n * <SkeletonAvatar size={40} />\n * <SkeletonAvatar size={64} shape=\"square\" />\n * ```\n */\nexport const SkeletonAvatar = forwardRef<HTMLDivElement, SkeletonAvatarProps>(\n (\n {\n size = 40,\n shape = 'circle',\n animate = true,\n baseColor,\n highlightColor,\n className,\n style,\n testId = 'skeleton-avatar',\n visible = true,\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const sizeValue = normalizeSize(size);\n\n return (\n <Skeleton\n ref={ref}\n data-testid={testId}\n width={sizeValue}\n height={sizeValue}\n variant={shape === 'circle' ? 'circular' : 'rounded'}\n animate={animate}\n baseColor={baseColor}\n highlightColor={highlightColor}\n className={className}\n style={style}\n aria-label=\"Loading avatar...\"\n {...rest}\n />\n );\n }\n);\n\nSkeletonAvatar.displayName = 'SkeletonAvatar';\n"],"names":[],"mappings":";;;;AAgBO,MAAM,iBAAiB;AAAA,EAC5B,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,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,YAAY,cAAc,IAAI;AAEpC,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,SAAS,UAAU,WAAW,aAAa;AAAA,QAC3C;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,cAAW;AAAA,QACV,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEA,eAAe,cAAc;"}
|
package/dist/index8.cjs
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const react = require("react");
|
|
5
|
+
const Skeleton = require("./index5.cjs");
|
|
6
|
+
const SkeletonImage = react.forwardRef(
|
|
7
|
+
({
|
|
8
|
+
width = "100%",
|
|
9
|
+
height = "200px",
|
|
10
|
+
aspectRatio,
|
|
11
|
+
animate = true,
|
|
12
|
+
baseColor,
|
|
13
|
+
highlightColor,
|
|
14
|
+
borderRadius = "0.5rem",
|
|
15
|
+
className,
|
|
16
|
+
style,
|
|
17
|
+
testId = "skeleton-image",
|
|
18
|
+
visible = true,
|
|
19
|
+
...rest
|
|
20
|
+
}, ref) => {
|
|
21
|
+
if (!visible) return null;
|
|
22
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
23
|
+
Skeleton.Skeleton,
|
|
24
|
+
{
|
|
25
|
+
ref,
|
|
26
|
+
"data-testid": testId,
|
|
27
|
+
width,
|
|
28
|
+
height: aspectRatio ? "auto" : height,
|
|
29
|
+
variant: "rounded",
|
|
30
|
+
borderRadius,
|
|
31
|
+
animate,
|
|
32
|
+
baseColor,
|
|
33
|
+
highlightColor,
|
|
34
|
+
className,
|
|
35
|
+
style: {
|
|
36
|
+
aspectRatio: aspectRatio || void 0,
|
|
37
|
+
...style
|
|
38
|
+
},
|
|
39
|
+
"aria-label": "Loading image...",
|
|
40
|
+
...rest
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
SkeletonImage.displayName = "SkeletonImage";
|
|
46
|
+
exports.SkeletonImage = SkeletonImage;
|
|
47
|
+
//# sourceMappingURL=index8.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index8.cjs","sources":["../src/components/skeleton/SkeletonImage.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SkeletonImageProps } from '../../types';\nimport { Skeleton } from './Skeleton';\n\n/**\n * SkeletonImage - Image skeleton loader\n *\n * A skeleton loader for image placeholders with optional aspect ratio.\n *\n * @example\n * ```tsx\n * <SkeletonImage width={300} height={200} />\n * <SkeletonImage aspectRatio=\"16/9\" width=\"100%\" />\n * ```\n */\nexport const SkeletonImage = forwardRef<HTMLDivElement, SkeletonImageProps>(\n (\n {\n width = '100%',\n height = '200px',\n aspectRatio,\n animate = true,\n baseColor,\n highlightColor,\n borderRadius = '0.5rem',\n className,\n style,\n testId = 'skeleton-image',\n visible = true,\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n return (\n <Skeleton\n ref={ref}\n data-testid={testId}\n width={width}\n height={aspectRatio ? 'auto' : height}\n variant=\"rounded\"\n borderRadius={borderRadius}\n animate={animate}\n baseColor={baseColor}\n highlightColor={highlightColor}\n className={className}\n style={{\n aspectRatio: aspectRatio || undefined,\n ...style,\n }}\n aria-label=\"Loading image...\"\n {...rest}\n />\n );\n }\n);\n\nSkeletonImage.displayName = 'SkeletonImage';\n"],"names":["forwardRef","jsx","Skeleton"],"mappings":";;;;;AAeO,MAAM,gBAAgBA,MAAAA;AAAAA,EAC3B,CACE;AAAA,IACE,QAAQ;AAAA,IACR,SAAS;AAAA,IACT;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,WACEC,2BAAAA;AAAAA,MAACC,SAAAA;AAAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb;AAAA,QACA,QAAQ,cAAc,SAAS;AAAA,QAC/B,SAAQ;AAAA,QACR;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,OAAO;AAAA,UACL,aAAa,eAAe;AAAA,UAC5B,GAAG;AAAA,QAAA;AAAA,QAEL,cAAW;AAAA,QACV,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEA,cAAc,cAAc;;"}
|
package/dist/index8.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { Skeleton } from "./index5.js";
|
|
4
|
+
const SkeletonImage = forwardRef(
|
|
5
|
+
({
|
|
6
|
+
width = "100%",
|
|
7
|
+
height = "200px",
|
|
8
|
+
aspectRatio,
|
|
9
|
+
animate = true,
|
|
10
|
+
baseColor,
|
|
11
|
+
highlightColor,
|
|
12
|
+
borderRadius = "0.5rem",
|
|
13
|
+
className,
|
|
14
|
+
style,
|
|
15
|
+
testId = "skeleton-image",
|
|
16
|
+
visible = true,
|
|
17
|
+
...rest
|
|
18
|
+
}, ref) => {
|
|
19
|
+
if (!visible) return null;
|
|
20
|
+
return /* @__PURE__ */ jsx(
|
|
21
|
+
Skeleton,
|
|
22
|
+
{
|
|
23
|
+
ref,
|
|
24
|
+
"data-testid": testId,
|
|
25
|
+
width,
|
|
26
|
+
height: aspectRatio ? "auto" : height,
|
|
27
|
+
variant: "rounded",
|
|
28
|
+
borderRadius,
|
|
29
|
+
animate,
|
|
30
|
+
baseColor,
|
|
31
|
+
highlightColor,
|
|
32
|
+
className,
|
|
33
|
+
style: {
|
|
34
|
+
aspectRatio: aspectRatio || void 0,
|
|
35
|
+
...style
|
|
36
|
+
},
|
|
37
|
+
"aria-label": "Loading image...",
|
|
38
|
+
...rest
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
SkeletonImage.displayName = "SkeletonImage";
|
|
44
|
+
export {
|
|
45
|
+
SkeletonImage
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=index8.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index8.js","sources":["../src/components/skeleton/SkeletonImage.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SkeletonImageProps } from '../../types';\nimport { Skeleton } from './Skeleton';\n\n/**\n * SkeletonImage - Image skeleton loader\n *\n * A skeleton loader for image placeholders with optional aspect ratio.\n *\n * @example\n * ```tsx\n * <SkeletonImage width={300} height={200} />\n * <SkeletonImage aspectRatio=\"16/9\" width=\"100%\" />\n * ```\n */\nexport const SkeletonImage = forwardRef<HTMLDivElement, SkeletonImageProps>(\n (\n {\n width = '100%',\n height = '200px',\n aspectRatio,\n animate = true,\n baseColor,\n highlightColor,\n borderRadius = '0.5rem',\n className,\n style,\n testId = 'skeleton-image',\n visible = true,\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n return (\n <Skeleton\n ref={ref}\n data-testid={testId}\n width={width}\n height={aspectRatio ? 'auto' : height}\n variant=\"rounded\"\n borderRadius={borderRadius}\n animate={animate}\n baseColor={baseColor}\n highlightColor={highlightColor}\n className={className}\n style={{\n aspectRatio: aspectRatio || undefined,\n ...style,\n }}\n aria-label=\"Loading image...\"\n {...rest}\n />\n );\n }\n);\n\nSkeletonImage.displayName = 'SkeletonImage';\n"],"names":[],"mappings":";;;AAeO,MAAM,gBAAgB;AAAA,EAC3B,CACE;AAAA,IACE,QAAQ;AAAA,IACR,SAAS;AAAA,IACT;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb;AAAA,QACA,QAAQ,cAAc,SAAS;AAAA,QAC/B,SAAQ;AAAA,QACR;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,OAAO;AAAA,UACL,aAAa,eAAe;AAAA,UAC5B,GAAG;AAAA,QAAA;AAAA,QAEL,cAAW;AAAA,QACV,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEA,cAAc,cAAc;"}
|
package/dist/index9.cjs
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const react = require("react");
|
|
5
|
+
const Skeleton = require("./index5.cjs");
|
|
6
|
+
const SkeletonAvatar = require("./index7.cjs");
|
|
7
|
+
const classNames = require("./index3.cjs");
|
|
8
|
+
const SkeletonCard = react.forwardRef(
|
|
9
|
+
({
|
|
10
|
+
hasAvatar = true,
|
|
11
|
+
titleWidth = "60%",
|
|
12
|
+
lines = 2,
|
|
13
|
+
avatarSize = 40,
|
|
14
|
+
animate = true,
|
|
15
|
+
baseColor,
|
|
16
|
+
highlightColor,
|
|
17
|
+
className,
|
|
18
|
+
style,
|
|
19
|
+
testId = "skeleton-card",
|
|
20
|
+
visible = true,
|
|
21
|
+
...rest
|
|
22
|
+
}, ref) => {
|
|
23
|
+
if (!visible) return null;
|
|
24
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
25
|
+
"div",
|
|
26
|
+
{
|
|
27
|
+
ref,
|
|
28
|
+
"data-testid": testId,
|
|
29
|
+
className: classNames.cn("flex gap-3", className),
|
|
30
|
+
style,
|
|
31
|
+
role: "status",
|
|
32
|
+
"aria-label": "Loading card...",
|
|
33
|
+
"aria-busy": "true",
|
|
34
|
+
...rest,
|
|
35
|
+
children: [
|
|
36
|
+
hasAvatar && /* @__PURE__ */ jsxRuntime.jsx(
|
|
37
|
+
SkeletonAvatar.SkeletonAvatar,
|
|
38
|
+
{
|
|
39
|
+
size: avatarSize,
|
|
40
|
+
animate,
|
|
41
|
+
baseColor,
|
|
42
|
+
highlightColor
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 space-y-2", children: [
|
|
46
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
47
|
+
Skeleton.Skeleton,
|
|
48
|
+
{
|
|
49
|
+
width: titleWidth,
|
|
50
|
+
height: "1.25rem",
|
|
51
|
+
variant: "text",
|
|
52
|
+
animate,
|
|
53
|
+
baseColor,
|
|
54
|
+
highlightColor
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
Array.from({ length: lines }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
58
|
+
Skeleton.Skeleton,
|
|
59
|
+
{
|
|
60
|
+
width: index === lines - 1 ? "70%" : "100%",
|
|
61
|
+
height: "1rem",
|
|
62
|
+
variant: "text",
|
|
63
|
+
animate,
|
|
64
|
+
baseColor,
|
|
65
|
+
highlightColor
|
|
66
|
+
},
|
|
67
|
+
index
|
|
68
|
+
))
|
|
69
|
+
] })
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
SkeletonCard.displayName = "SkeletonCard";
|
|
76
|
+
exports.SkeletonCard = SkeletonCard;
|
|
77
|
+
//# sourceMappingURL=index9.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index9.cjs","sources":["../src/components/skeleton/SkeletonCard.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SkeletonCardProps } from '../../types';\nimport { cn } from '../../utils';\nimport { Skeleton } from './Skeleton';\nimport { SkeletonAvatar } from './SkeletonAvatar';\n\n/**\n * SkeletonCard - Card skeleton loader\n *\n * A composite skeleton loader for card layouts with optional avatar, title, and description lines.\n *\n * @example\n * ```tsx\n * <SkeletonCard />\n * <SkeletonCard hasAvatar={true} lines={3} />\n * <SkeletonCard hasAvatar={false} titleWidth=\"60%\" />\n * ```\n */\nexport const SkeletonCard = forwardRef<HTMLDivElement, SkeletonCardProps>(\n (\n {\n hasAvatar = true,\n titleWidth = '60%',\n lines = 2,\n avatarSize = 40,\n animate = true,\n baseColor,\n highlightColor,\n className,\n style,\n testId = 'skeleton-card',\n visible = true,\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('flex gap-3', className)}\n style={style}\n role=\"status\"\n aria-label=\"Loading card...\"\n aria-busy=\"true\"\n {...rest}\n >\n {hasAvatar && (\n <SkeletonAvatar\n size={avatarSize}\n animate={animate}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n )}\n <div className=\"flex-1 space-y-2\">\n {/* Title */}\n <Skeleton\n width={titleWidth}\n height=\"1.25rem\"\n variant=\"text\"\n animate={animate}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n {/* Description lines */}\n {Array.from({ length: lines }).map((_, index) => (\n <Skeleton\n key={index}\n width={index === lines - 1 ? '70%' : '100%'}\n height=\"1rem\"\n variant=\"text\"\n animate={animate}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n ))}\n </div>\n </div>\n );\n }\n);\n\nSkeletonCard.displayName = 'SkeletonCard';\n"],"names":["forwardRef","jsxs","cn","jsx","SkeletonAvatar","Skeleton"],"mappings":";;;;;;;AAkBO,MAAM,eAAeA,MAAAA;AAAAA,EAC1B,CACE;AAAA,IACE,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,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,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAWC,WAAAA,GAAG,cAAc,SAAS;AAAA,QACrC;AAAA,QACA,MAAK;AAAA,QACL,cAAW;AAAA,QACX,aAAU;AAAA,QACT,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA,aACCC,2BAAAA;AAAAA,YAACC,eAAAA;AAAAA,YAAA;AAAA,cACC,MAAM;AAAA,cACN;AAAA,cACA;AAAA,cACA;AAAA,YAAA;AAAA,UAAA;AAAA,UAGJH,2BAAAA,KAAC,OAAA,EAAI,WAAU,oBAEb,UAAA;AAAA,YAAAE,2BAAAA;AAAAA,cAACE,SAAAA;AAAAA,cAAA;AAAA,gBACC,OAAO;AAAA,gBACP,QAAO;AAAA,gBACP,SAAQ;AAAA,gBACR;AAAA,gBACA;AAAA,gBACA;AAAA,cAAA;AAAA,YAAA;AAAA,YAGD,MAAM,KAAK,EAAE,QAAQ,MAAA,CAAO,EAAE,IAAI,CAAC,GAAG,UACrCF,2BAAAA;AAAAA,cAACE,SAAAA;AAAAA,cAAA;AAAA,gBAEC,OAAO,UAAU,QAAQ,IAAI,QAAQ;AAAA,gBACrC,QAAO;AAAA,gBACP,SAAQ;AAAA,gBACR;AAAA,gBACA;AAAA,gBACA;AAAA,cAAA;AAAA,cANK;AAAA,YAAA,CAQR;AAAA,UAAA,EAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,aAAa,cAAc;;"}
|
package/dist/index9.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { Skeleton } from "./index5.js";
|
|
4
|
+
import { SkeletonAvatar } from "./index7.js";
|
|
5
|
+
import { cn } from "./index3.js";
|
|
6
|
+
const SkeletonCard = forwardRef(
|
|
7
|
+
({
|
|
8
|
+
hasAvatar = true,
|
|
9
|
+
titleWidth = "60%",
|
|
10
|
+
lines = 2,
|
|
11
|
+
avatarSize = 40,
|
|
12
|
+
animate = true,
|
|
13
|
+
baseColor,
|
|
14
|
+
highlightColor,
|
|
15
|
+
className,
|
|
16
|
+
style,
|
|
17
|
+
testId = "skeleton-card",
|
|
18
|
+
visible = true,
|
|
19
|
+
...rest
|
|
20
|
+
}, ref) => {
|
|
21
|
+
if (!visible) return null;
|
|
22
|
+
return /* @__PURE__ */ jsxs(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
ref,
|
|
26
|
+
"data-testid": testId,
|
|
27
|
+
className: cn("flex gap-3", className),
|
|
28
|
+
style,
|
|
29
|
+
role: "status",
|
|
30
|
+
"aria-label": "Loading card...",
|
|
31
|
+
"aria-busy": "true",
|
|
32
|
+
...rest,
|
|
33
|
+
children: [
|
|
34
|
+
hasAvatar && /* @__PURE__ */ jsx(
|
|
35
|
+
SkeletonAvatar,
|
|
36
|
+
{
|
|
37
|
+
size: avatarSize,
|
|
38
|
+
animate,
|
|
39
|
+
baseColor,
|
|
40
|
+
highlightColor
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-2", children: [
|
|
44
|
+
/* @__PURE__ */ jsx(
|
|
45
|
+
Skeleton,
|
|
46
|
+
{
|
|
47
|
+
width: titleWidth,
|
|
48
|
+
height: "1.25rem",
|
|
49
|
+
variant: "text",
|
|
50
|
+
animate,
|
|
51
|
+
baseColor,
|
|
52
|
+
highlightColor
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
Array.from({ length: lines }).map((_, index) => /* @__PURE__ */ jsx(
|
|
56
|
+
Skeleton,
|
|
57
|
+
{
|
|
58
|
+
width: index === lines - 1 ? "70%" : "100%",
|
|
59
|
+
height: "1rem",
|
|
60
|
+
variant: "text",
|
|
61
|
+
animate,
|
|
62
|
+
baseColor,
|
|
63
|
+
highlightColor
|
|
64
|
+
},
|
|
65
|
+
index
|
|
66
|
+
))
|
|
67
|
+
] })
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
SkeletonCard.displayName = "SkeletonCard";
|
|
74
|
+
export {
|
|
75
|
+
SkeletonCard
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=index9.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index9.js","sources":["../src/components/skeleton/SkeletonCard.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SkeletonCardProps } from '../../types';\nimport { cn } from '../../utils';\nimport { Skeleton } from './Skeleton';\nimport { SkeletonAvatar } from './SkeletonAvatar';\n\n/**\n * SkeletonCard - Card skeleton loader\n *\n * A composite skeleton loader for card layouts with optional avatar, title, and description lines.\n *\n * @example\n * ```tsx\n * <SkeletonCard />\n * <SkeletonCard hasAvatar={true} lines={3} />\n * <SkeletonCard hasAvatar={false} titleWidth=\"60%\" />\n * ```\n */\nexport const SkeletonCard = forwardRef<HTMLDivElement, SkeletonCardProps>(\n (\n {\n hasAvatar = true,\n titleWidth = '60%',\n lines = 2,\n avatarSize = 40,\n animate = true,\n baseColor,\n highlightColor,\n className,\n style,\n testId = 'skeleton-card',\n visible = true,\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('flex gap-3', className)}\n style={style}\n role=\"status\"\n aria-label=\"Loading card...\"\n aria-busy=\"true\"\n {...rest}\n >\n {hasAvatar && (\n <SkeletonAvatar\n size={avatarSize}\n animate={animate}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n )}\n <div className=\"flex-1 space-y-2\">\n {/* Title */}\n <Skeleton\n width={titleWidth}\n height=\"1.25rem\"\n variant=\"text\"\n animate={animate}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n {/* Description lines */}\n {Array.from({ length: lines }).map((_, index) => (\n <Skeleton\n key={index}\n width={index === lines - 1 ? '70%' : '100%'}\n height=\"1rem\"\n variant=\"text\"\n animate={animate}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n ))}\n </div>\n </div>\n );\n }\n);\n\nSkeletonCard.displayName = 'SkeletonCard';\n"],"names":[],"mappings":";;;;;AAkBO,MAAM,eAAe;AAAA,EAC1B,CACE;AAAA,IACE,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,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,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAW,GAAG,cAAc,SAAS;AAAA,QACrC;AAAA,QACA,MAAK;AAAA,QACL,cAAW;AAAA,QACX,aAAU;AAAA,QACT,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA,aACC;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAM;AAAA,cACN;AAAA,cACA;AAAA,cACA;AAAA,YAAA;AAAA,UAAA;AAAA,UAGJ,qBAAC,OAAA,EAAI,WAAU,oBAEb,UAAA;AAAA,YAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,OAAO;AAAA,gBACP,QAAO;AAAA,gBACP,SAAQ;AAAA,gBACR;AAAA,gBACA;AAAA,gBACA;AAAA,cAAA;AAAA,YAAA;AAAA,YAGD,MAAM,KAAK,EAAE,QAAQ,MAAA,CAAO,EAAE,IAAI,CAAC,GAAG,UACrC;AAAA,cAAC;AAAA,cAAA;AAAA,gBAEC,OAAO,UAAU,QAAQ,IAAI,QAAQ;AAAA,gBACrC,QAAO;AAAA,gBACP,SAAQ;AAAA,gBACR;AAAA,gBACA;AAAA,gBACA;AAAA,cAAA;AAAA,cANK;AAAA,YAAA,CAQR;AAAA,UAAA,EAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,aAAa,cAAc;"}
|