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":"index19.js","sources":["../src/components/progress/ProgressRing.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { ProgressRingProps } from '../../types';\nimport { cn, normalizeSize } from '../../utils';\n\n/**\n * ProgressRing - Ring-style progress with gradient option\n *\n * A circular progress ring with optional gradient colors.\n *\n * @example\n * ```tsx\n * <ProgressRing value={75} showValue />\n * <ProgressRing value={60} gradient secondaryColor=\"#8b5cf6\" />\n * <ProgressRing indeterminate />\n * ```\n */\nexport const ProgressRing = forwardRef<HTMLDivElement, ProgressRingProps>(\n (\n {\n value = 0,\n indeterminate = false,\n showValue = false,\n size = 60,\n thickness = 6,\n color = '#3b82f6',\n secondaryColor = '#e0e0e0',\n gradient = false,\n className,\n style,\n testId = 'progress-ring',\n visible = true,\n ariaLabel,\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const clampedValue = Math.min(100, Math.max(0, value));\n const sizeValue = typeof size === 'number' ? size : parseInt(String(size), 10);\n const thicknessValue = typeof thickness === 'number' ? thickness : parseInt(String(thickness), 10);\n const radius = (sizeValue - thicknessValue * 2) / 2;\n const circumference = 2 * Math.PI * radius;\n const strokeDashoffset = circumference - (clampedValue / 100) * circumference;\n const progressLabel = ariaLabel || `Loading ${clampedValue}%`;\n const gradientId = `progress-gradient-${Math.random().toString(36).substr(2, 9)}`;\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('inline-flex items-center justify-center relative', className)}\n style={{\n width: normalizeSize(size),\n height: normalizeSize(size),\n ...style,\n }}\n role=\"progressbar\"\n aria-label={progressLabel}\n aria-valuenow={indeterminate ? undefined : clampedValue}\n aria-valuemin={0}\n aria-valuemax={100}\n {...rest}\n >\n <svg\n className={cn(indeterminate && 'animate-spinner-rotate')}\n width={sizeValue}\n height={sizeValue}\n viewBox={`0 0 ${sizeValue} ${sizeValue}`}\n >\n {gradient && (\n <defs>\n <linearGradient id={gradientId} x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"100%\">\n <stop offset=\"0%\" stopColor={color} />\n <stop offset=\"100%\" stopColor={secondaryColor === '#e0e0e0' ? '#8b5cf6' : secondaryColor} />\n </linearGradient>\n </defs>\n )}\n {/* Background circle */}\n <circle\n cx={sizeValue / 2}\n cy={sizeValue / 2}\n r={radius}\n fill=\"none\"\n stroke={gradient ? '#e0e0e0' : secondaryColor}\n strokeWidth={thicknessValue}\n />\n {/* Progress circle */}\n <circle\n cx={sizeValue / 2}\n cy={sizeValue / 2}\n r={radius}\n fill=\"none\"\n stroke={gradient ? `url(#${gradientId})` : color}\n strokeWidth={thicknessValue}\n strokeLinecap=\"round\"\n strokeDasharray={circumference}\n strokeDashoffset={indeterminate ? circumference * 0.75 : strokeDashoffset}\n transform={`rotate(-90 ${sizeValue / 2} ${sizeValue / 2})`}\n style={{\n transition: indeterminate ? 'none' : 'stroke-dashoffset 0.3s ease-in-out',\n }}\n />\n </svg>\n {showValue && !indeterminate && (\n <span\n className=\"absolute text-sm font-semibold\"\n style={{ color }}\n >\n {clampedValue}%\n </span>\n )}\n </div>\n );\n }\n);\n\nProgressRing.displayName = 'ProgressRing';\n"],"names":[],"mappings":";;;;AAgBO,MAAM,eAAe;AAAA,EAC1B,CACE;AAAA,IACE,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,iBAAiB;AAAA,IACjB,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,UAAM,eAAe,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC;AACrD,UAAM,YAAY,OAAO,SAAS,WAAW,OAAO,SAAS,OAAO,IAAI,GAAG,EAAE;AAC7E,UAAM,iBAAiB,OAAO,cAAc,WAAW,YAAY,SAAS,OAAO,SAAS,GAAG,EAAE;AACjG,UAAM,UAAU,YAAY,iBAAiB,KAAK;AAClD,UAAM,gBAAgB,IAAI,KAAK,KAAK;AACpC,UAAM,mBAAmB,gBAAiB,eAAe,MAAO;AAChE,UAAM,gBAAgB,aAAa,WAAW,YAAY;AAC1D,UAAM,aAAa,qBAAqB,KAAK,OAAA,EAAS,SAAS,EAAE,EAAE,OAAO,GAAG,CAAC,CAAC;AAE/E,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAW,GAAG,oDAAoD,SAAS;AAAA,QAC3E,OAAO;AAAA,UACL,OAAO,cAAc,IAAI;AAAA,UACzB,QAAQ,cAAc,IAAI;AAAA,UAC1B,GAAG;AAAA,QAAA;AAAA,QAEL,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,iBAAe,gBAAgB,SAAY;AAAA,QAC3C,iBAAe;AAAA,QACf,iBAAe;AAAA,QACd,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAW,GAAG,iBAAiB,wBAAwB;AAAA,cACvD,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,SAAS,OAAO,SAAS,IAAI,SAAS;AAAA,cAErC,UAAA;AAAA,gBAAA,YACC,oBAAC,QAAA,EACC,UAAA,qBAAC,kBAAA,EAAe,IAAI,YAAY,IAAG,MAAK,IAAG,MAAK,IAAG,QAAO,IAAG,QAC3D,UAAA;AAAA,kBAAA,oBAAC,QAAA,EAAK,QAAO,MAAK,WAAW,OAAO;AAAA,kBACpC,oBAAC,UAAK,QAAO,QAAO,WAAW,mBAAmB,YAAY,YAAY,eAAA,CAAgB;AAAA,gBAAA,EAAA,CAC5F,EAAA,CACF;AAAA,gBAGF;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,IAAI,YAAY;AAAA,oBAChB,IAAI,YAAY;AAAA,oBAChB,GAAG;AAAA,oBACH,MAAK;AAAA,oBACL,QAAQ,WAAW,YAAY;AAAA,oBAC/B,aAAa;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAGf;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,IAAI,YAAY;AAAA,oBAChB,IAAI,YAAY;AAAA,oBAChB,GAAG;AAAA,oBACH,MAAK;AAAA,oBACL,QAAQ,WAAW,QAAQ,UAAU,MAAM;AAAA,oBAC3C,aAAa;AAAA,oBACb,eAAc;AAAA,oBACd,iBAAiB;AAAA,oBACjB,kBAAkB,gBAAgB,gBAAgB,OAAO;AAAA,oBACzD,WAAW,cAAc,YAAY,CAAC,IAAI,YAAY,CAAC;AAAA,oBACvD,OAAO;AAAA,sBACL,YAAY,gBAAgB,SAAS;AAAA,oBAAA;AAAA,kBACvC;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,UAAA;AAAA,UAED,aAAa,CAAC,iBACb;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,OAAO,EAAE,MAAA;AAAA,cAER,UAAA;AAAA,gBAAA;AAAA,gBAAa;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAChB;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,aAAa,cAAc;"}
|
package/dist/index20.cjs
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
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 colors = require("./index4.cjs");
|
|
6
|
+
const classNames = require("./index3.cjs");
|
|
7
|
+
const PulseDots = react.forwardRef(
|
|
8
|
+
({
|
|
9
|
+
size = 40,
|
|
10
|
+
color = "#3b82f6",
|
|
11
|
+
dotCount = 3,
|
|
12
|
+
dotSize = 10,
|
|
13
|
+
speed = "normal",
|
|
14
|
+
className,
|
|
15
|
+
style,
|
|
16
|
+
testId = "pulse-dots",
|
|
17
|
+
visible = true,
|
|
18
|
+
ariaLabel = "Loading...",
|
|
19
|
+
...rest
|
|
20
|
+
}, ref) => {
|
|
21
|
+
if (!visible) return null;
|
|
22
|
+
const animationDuration = colors.getAnimationDuration(speed);
|
|
23
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
ref,
|
|
27
|
+
"data-testid": testId,
|
|
28
|
+
className: classNames.cn("inline-flex items-center justify-center gap-2", className),
|
|
29
|
+
style: {
|
|
30
|
+
height: colors.normalizeSize(size),
|
|
31
|
+
...style
|
|
32
|
+
},
|
|
33
|
+
role: "status",
|
|
34
|
+
"aria-label": ariaLabel,
|
|
35
|
+
"aria-busy": "true",
|
|
36
|
+
...rest,
|
|
37
|
+
children: Array.from({ length: dotCount }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
className: "rounded-full",
|
|
41
|
+
style: {
|
|
42
|
+
width: colors.normalizeSize(dotSize),
|
|
43
|
+
height: colors.normalizeSize(dotSize),
|
|
44
|
+
backgroundColor: color,
|
|
45
|
+
animation: `pulse-bounce ${animationDuration} ease-in-out infinite`,
|
|
46
|
+
animationDelay: `${index * 0.15}s`
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
index
|
|
50
|
+
))
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
PulseDots.displayName = "PulseDots";
|
|
56
|
+
exports.PulseDots = PulseDots;
|
|
57
|
+
//# sourceMappingURL=index20.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index20.cjs","sources":["../src/components/pulse/PulseDots.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { PulseDotsProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration } from '../../utils';\n\n/**\n * PulseDots - Bouncing dots loader\n *\n * A loader with bouncing dots that scale and fade in a sequence.\n *\n * @example\n * ```tsx\n * <PulseDots size={40} color=\"#3b82f6\" />\n * <PulseDots size={32} dotCount={5} speed=\"fast\" />\n * ```\n */\nexport const PulseDots = forwardRef<HTMLDivElement, PulseDotsProps>(\n (\n {\n size = 40,\n color = '#3b82f6',\n dotCount = 3,\n dotSize = 10,\n speed = 'normal',\n className,\n style,\n testId = 'pulse-dots',\n visible = true,\n ariaLabel = 'Loading...',\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const animationDuration = getAnimationDuration(speed);\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('inline-flex items-center justify-center gap-2', className)}\n style={{\n height: normalizeSize(size),\n ...style,\n }}\n role=\"status\"\n aria-label={ariaLabel}\n aria-busy=\"true\"\n {...rest}\n >\n {Array.from({ length: dotCount }).map((_, index) => (\n <div\n key={index}\n className=\"rounded-full\"\n style={{\n width: normalizeSize(dotSize),\n height: normalizeSize(dotSize),\n backgroundColor: color,\n animation: `pulse-bounce ${animationDuration} ease-in-out infinite`,\n animationDelay: `${index * 0.15}s`,\n }}\n />\n ))}\n </div>\n );\n }\n);\n\nPulseDots.displayName = 'PulseDots';\n"],"names":["forwardRef","getAnimationDuration","jsx","cn","normalizeSize"],"mappings":";;;;;;AAeO,MAAM,YAAYA,MAAAA;AAAAA,EACvB,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,UAAU;AAAA,IACV,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,UAAM,oBAAoBC,OAAAA,qBAAqB,KAAK;AAEpD,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAWC,WAAAA,GAAG,iDAAiD,SAAS;AAAA,QACxE,OAAO;AAAA,UACL,QAAQC,OAAAA,cAAc,IAAI;AAAA,UAC1B,GAAG;AAAA,QAAA;AAAA,QAEL,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEH,UAAA,MAAM,KAAK,EAAE,QAAQ,UAAU,EAAE,IAAI,CAAC,GAAG,UACxCF,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YAEC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,OAAOE,OAAAA,cAAc,OAAO;AAAA,cAC5B,QAAQA,OAAAA,cAAc,OAAO;AAAA,cAC7B,iBAAiB;AAAA,cACjB,WAAW,gBAAgB,iBAAiB;AAAA,cAC5C,gBAAgB,GAAG,QAAQ,IAAI;AAAA,YAAA;AAAA,UACjC;AAAA,UARK;AAAA,QAAA,CAUR;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,UAAU,cAAc;;"}
|
package/dist/index20.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { normalizeSize, getAnimationDuration } from "./index4.js";
|
|
4
|
+
import { cn } from "./index3.js";
|
|
5
|
+
const PulseDots = forwardRef(
|
|
6
|
+
({
|
|
7
|
+
size = 40,
|
|
8
|
+
color = "#3b82f6",
|
|
9
|
+
dotCount = 3,
|
|
10
|
+
dotSize = 10,
|
|
11
|
+
speed = "normal",
|
|
12
|
+
className,
|
|
13
|
+
style,
|
|
14
|
+
testId = "pulse-dots",
|
|
15
|
+
visible = true,
|
|
16
|
+
ariaLabel = "Loading...",
|
|
17
|
+
...rest
|
|
18
|
+
}, ref) => {
|
|
19
|
+
if (!visible) return null;
|
|
20
|
+
const animationDuration = getAnimationDuration(speed);
|
|
21
|
+
return /* @__PURE__ */ jsx(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
ref,
|
|
25
|
+
"data-testid": testId,
|
|
26
|
+
className: cn("inline-flex items-center justify-center gap-2", className),
|
|
27
|
+
style: {
|
|
28
|
+
height: normalizeSize(size),
|
|
29
|
+
...style
|
|
30
|
+
},
|
|
31
|
+
role: "status",
|
|
32
|
+
"aria-label": ariaLabel,
|
|
33
|
+
"aria-busy": "true",
|
|
34
|
+
...rest,
|
|
35
|
+
children: Array.from({ length: dotCount }).map((_, index) => /* @__PURE__ */ jsx(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
className: "rounded-full",
|
|
39
|
+
style: {
|
|
40
|
+
width: normalizeSize(dotSize),
|
|
41
|
+
height: normalizeSize(dotSize),
|
|
42
|
+
backgroundColor: color,
|
|
43
|
+
animation: `pulse-bounce ${animationDuration} ease-in-out infinite`,
|
|
44
|
+
animationDelay: `${index * 0.15}s`
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
index
|
|
48
|
+
))
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
PulseDots.displayName = "PulseDots";
|
|
54
|
+
export {
|
|
55
|
+
PulseDots
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=index20.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index20.js","sources":["../src/components/pulse/PulseDots.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { PulseDotsProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration } from '../../utils';\n\n/**\n * PulseDots - Bouncing dots loader\n *\n * A loader with bouncing dots that scale and fade in a sequence.\n *\n * @example\n * ```tsx\n * <PulseDots size={40} color=\"#3b82f6\" />\n * <PulseDots size={32} dotCount={5} speed=\"fast\" />\n * ```\n */\nexport const PulseDots = forwardRef<HTMLDivElement, PulseDotsProps>(\n (\n {\n size = 40,\n color = '#3b82f6',\n dotCount = 3,\n dotSize = 10,\n speed = 'normal',\n className,\n style,\n testId = 'pulse-dots',\n visible = true,\n ariaLabel = 'Loading...',\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const animationDuration = getAnimationDuration(speed);\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('inline-flex items-center justify-center gap-2', className)}\n style={{\n height: normalizeSize(size),\n ...style,\n }}\n role=\"status\"\n aria-label={ariaLabel}\n aria-busy=\"true\"\n {...rest}\n >\n {Array.from({ length: dotCount }).map((_, index) => (\n <div\n key={index}\n className=\"rounded-full\"\n style={{\n width: normalizeSize(dotSize),\n height: normalizeSize(dotSize),\n backgroundColor: color,\n animation: `pulse-bounce ${animationDuration} ease-in-out infinite`,\n animationDelay: `${index * 0.15}s`,\n }}\n />\n ))}\n </div>\n );\n }\n);\n\nPulseDots.displayName = 'PulseDots';\n"],"names":[],"mappings":";;;;AAeO,MAAM,YAAY;AAAA,EACvB,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,UAAU;AAAA,IACV,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,UAAM,oBAAoB,qBAAqB,KAAK;AAEpD,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAW,GAAG,iDAAiD,SAAS;AAAA,QACxE,OAAO;AAAA,UACL,QAAQ,cAAc,IAAI;AAAA,UAC1B,GAAG;AAAA,QAAA;AAAA,QAEL,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEH,UAAA,MAAM,KAAK,EAAE,QAAQ,UAAU,EAAE,IAAI,CAAC,GAAG,UACxC;AAAA,UAAC;AAAA,UAAA;AAAA,YAEC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,OAAO,cAAc,OAAO;AAAA,cAC5B,QAAQ,cAAc,OAAO;AAAA,cAC7B,iBAAiB;AAAA,cACjB,WAAW,gBAAgB,iBAAiB;AAAA,cAC5C,gBAAgB,GAAG,QAAQ,IAAI;AAAA,YAAA;AAAA,UACjC;AAAA,UARK;AAAA,QAAA,CAUR;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,UAAU,cAAc;"}
|
package/dist/index21.cjs
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
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 colors = require("./index4.cjs");
|
|
6
|
+
const classNames = require("./index3.cjs");
|
|
7
|
+
const PulseWave = react.forwardRef(
|
|
8
|
+
({
|
|
9
|
+
size = 40,
|
|
10
|
+
color = "#3b82f6",
|
|
11
|
+
barCount = 5,
|
|
12
|
+
speed = "normal",
|
|
13
|
+
className,
|
|
14
|
+
style,
|
|
15
|
+
testId = "pulse-wave",
|
|
16
|
+
visible = true,
|
|
17
|
+
ariaLabel = "Loading...",
|
|
18
|
+
...rest
|
|
19
|
+
}, ref) => {
|
|
20
|
+
if (!visible) return null;
|
|
21
|
+
const sizeValue = typeof size === "number" ? size : parseInt(String(size), 10);
|
|
22
|
+
const barWidth = Math.floor(sizeValue / (barCount * 2.5));
|
|
23
|
+
const animationDuration = colors.getAnimationDuration(speed);
|
|
24
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
25
|
+
"div",
|
|
26
|
+
{
|
|
27
|
+
ref,
|
|
28
|
+
"data-testid": testId,
|
|
29
|
+
className: classNames.cn("inline-flex items-end justify-center gap-1", className),
|
|
30
|
+
style: {
|
|
31
|
+
height: colors.normalizeSize(size),
|
|
32
|
+
...style
|
|
33
|
+
},
|
|
34
|
+
role: "status",
|
|
35
|
+
"aria-label": ariaLabel,
|
|
36
|
+
"aria-busy": "true",
|
|
37
|
+
...rest,
|
|
38
|
+
children: Array.from({ length: barCount }).map((_, index) => {
|
|
39
|
+
const delay = index / barCount * 0.5;
|
|
40
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
className: "rounded-sm",
|
|
44
|
+
style: {
|
|
45
|
+
width: `${barWidth}px`,
|
|
46
|
+
height: "100%",
|
|
47
|
+
backgroundColor: color,
|
|
48
|
+
animation: `pulse-wave ${animationDuration} ease-in-out infinite`,
|
|
49
|
+
animationDelay: `${delay}s`,
|
|
50
|
+
transformOrigin: "bottom"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
index
|
|
54
|
+
);
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
PulseWave.displayName = "PulseWave";
|
|
61
|
+
exports.PulseWave = PulseWave;
|
|
62
|
+
//# sourceMappingURL=index21.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index21.cjs","sources":["../src/components/pulse/PulseWave.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { PulseWaveProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration } from '../../utils';\n\n/**\n * PulseWave - Wave pattern loader\n *\n * A loader with bars that animate in a wave pattern.\n *\n * @example\n * ```tsx\n * <PulseWave size={40} color=\"#3b82f6\" />\n * <PulseWave size={32} barCount={7} speed=\"slow\" />\n * ```\n */\nexport const PulseWave = forwardRef<HTMLDivElement, PulseWaveProps>(\n (\n {\n size = 40,\n color = '#3b82f6',\n barCount = 5,\n speed = 'normal',\n className,\n style,\n testId = 'pulse-wave',\n visible = true,\n ariaLabel = 'Loading...',\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const sizeValue = typeof size === 'number' ? size : parseInt(String(size), 10);\n const barWidth = Math.floor(sizeValue / (barCount * 2.5));\n const animationDuration = getAnimationDuration(speed);\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('inline-flex items-end justify-center gap-1', className)}\n style={{\n height: normalizeSize(size),\n ...style,\n }}\n role=\"status\"\n aria-label={ariaLabel}\n aria-busy=\"true\"\n {...rest}\n >\n {Array.from({ length: barCount }).map((_, index) => {\n const delay = (index / barCount) * 0.5;\n\n return (\n <div\n key={index}\n className=\"rounded-sm\"\n style={{\n width: `${barWidth}px`,\n height: '100%',\n backgroundColor: color,\n animation: `pulse-wave ${animationDuration} ease-in-out infinite`,\n animationDelay: `${delay}s`,\n transformOrigin: 'bottom',\n }}\n />\n );\n })}\n </div>\n );\n }\n);\n\nPulseWave.displayName = 'PulseWave';\n"],"names":["forwardRef","getAnimationDuration","jsx","cn","normalizeSize"],"mappings":";;;;;;AAeO,MAAM,YAAYA,MAAAA;AAAAA,EACvB,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,UAAM,YAAY,OAAO,SAAS,WAAW,OAAO,SAAS,OAAO,IAAI,GAAG,EAAE;AAC7E,UAAM,WAAW,KAAK,MAAM,aAAa,WAAW,IAAI;AACxD,UAAM,oBAAoBC,OAAAA,qBAAqB,KAAK;AAEpD,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAWC,WAAAA,GAAG,8CAA8C,SAAS;AAAA,QACrE,OAAO;AAAA,UACL,QAAQC,OAAAA,cAAc,IAAI;AAAA,UAC1B,GAAG;AAAA,QAAA;AAAA,QAEL,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEH,UAAA,MAAM,KAAK,EAAE,QAAQ,SAAA,CAAU,EAAE,IAAI,CAAC,GAAG,UAAU;AAClD,gBAAM,QAAS,QAAQ,WAAY;AAEnC,iBACEF,2BAAAA;AAAAA,YAAC;AAAA,YAAA;AAAA,cAEC,WAAU;AAAA,cACV,OAAO;AAAA,gBACL,OAAO,GAAG,QAAQ;AAAA,gBAClB,QAAQ;AAAA,gBACR,iBAAiB;AAAA,gBACjB,WAAW,cAAc,iBAAiB;AAAA,gBAC1C,gBAAgB,GAAG,KAAK;AAAA,gBACxB,iBAAiB;AAAA,cAAA;AAAA,YACnB;AAAA,YATK;AAAA,UAAA;AAAA,QAYX,CAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,UAAU,cAAc;;"}
|
package/dist/index21.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { normalizeSize, getAnimationDuration } from "./index4.js";
|
|
4
|
+
import { cn } from "./index3.js";
|
|
5
|
+
const PulseWave = forwardRef(
|
|
6
|
+
({
|
|
7
|
+
size = 40,
|
|
8
|
+
color = "#3b82f6",
|
|
9
|
+
barCount = 5,
|
|
10
|
+
speed = "normal",
|
|
11
|
+
className,
|
|
12
|
+
style,
|
|
13
|
+
testId = "pulse-wave",
|
|
14
|
+
visible = true,
|
|
15
|
+
ariaLabel = "Loading...",
|
|
16
|
+
...rest
|
|
17
|
+
}, ref) => {
|
|
18
|
+
if (!visible) return null;
|
|
19
|
+
const sizeValue = typeof size === "number" ? size : parseInt(String(size), 10);
|
|
20
|
+
const barWidth = Math.floor(sizeValue / (barCount * 2.5));
|
|
21
|
+
const animationDuration = getAnimationDuration(speed);
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
ref,
|
|
26
|
+
"data-testid": testId,
|
|
27
|
+
className: cn("inline-flex items-end justify-center gap-1", className),
|
|
28
|
+
style: {
|
|
29
|
+
height: normalizeSize(size),
|
|
30
|
+
...style
|
|
31
|
+
},
|
|
32
|
+
role: "status",
|
|
33
|
+
"aria-label": ariaLabel,
|
|
34
|
+
"aria-busy": "true",
|
|
35
|
+
...rest,
|
|
36
|
+
children: Array.from({ length: barCount }).map((_, index) => {
|
|
37
|
+
const delay = index / barCount * 0.5;
|
|
38
|
+
return /* @__PURE__ */ jsx(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
className: "rounded-sm",
|
|
42
|
+
style: {
|
|
43
|
+
width: `${barWidth}px`,
|
|
44
|
+
height: "100%",
|
|
45
|
+
backgroundColor: color,
|
|
46
|
+
animation: `pulse-wave ${animationDuration} ease-in-out infinite`,
|
|
47
|
+
animationDelay: `${delay}s`,
|
|
48
|
+
transformOrigin: "bottom"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
index
|
|
52
|
+
);
|
|
53
|
+
})
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
PulseWave.displayName = "PulseWave";
|
|
59
|
+
export {
|
|
60
|
+
PulseWave
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=index21.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index21.js","sources":["../src/components/pulse/PulseWave.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { PulseWaveProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration } from '../../utils';\n\n/**\n * PulseWave - Wave pattern loader\n *\n * A loader with bars that animate in a wave pattern.\n *\n * @example\n * ```tsx\n * <PulseWave size={40} color=\"#3b82f6\" />\n * <PulseWave size={32} barCount={7} speed=\"slow\" />\n * ```\n */\nexport const PulseWave = forwardRef<HTMLDivElement, PulseWaveProps>(\n (\n {\n size = 40,\n color = '#3b82f6',\n barCount = 5,\n speed = 'normal',\n className,\n style,\n testId = 'pulse-wave',\n visible = true,\n ariaLabel = 'Loading...',\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const sizeValue = typeof size === 'number' ? size : parseInt(String(size), 10);\n const barWidth = Math.floor(sizeValue / (barCount * 2.5));\n const animationDuration = getAnimationDuration(speed);\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('inline-flex items-end justify-center gap-1', className)}\n style={{\n height: normalizeSize(size),\n ...style,\n }}\n role=\"status\"\n aria-label={ariaLabel}\n aria-busy=\"true\"\n {...rest}\n >\n {Array.from({ length: barCount }).map((_, index) => {\n const delay = (index / barCount) * 0.5;\n\n return (\n <div\n key={index}\n className=\"rounded-sm\"\n style={{\n width: `${barWidth}px`,\n height: '100%',\n backgroundColor: color,\n animation: `pulse-wave ${animationDuration} ease-in-out infinite`,\n animationDelay: `${delay}s`,\n transformOrigin: 'bottom',\n }}\n />\n );\n })}\n </div>\n );\n }\n);\n\nPulseWave.displayName = 'PulseWave';\n"],"names":[],"mappings":";;;;AAeO,MAAM,YAAY;AAAA,EACvB,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,UAAM,YAAY,OAAO,SAAS,WAAW,OAAO,SAAS,OAAO,IAAI,GAAG,EAAE;AAC7E,UAAM,WAAW,KAAK,MAAM,aAAa,WAAW,IAAI;AACxD,UAAM,oBAAoB,qBAAqB,KAAK;AAEpD,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAW,GAAG,8CAA8C,SAAS;AAAA,QACrE,OAAO;AAAA,UACL,QAAQ,cAAc,IAAI;AAAA,UAC1B,GAAG;AAAA,QAAA;AAAA,QAEL,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEH,UAAA,MAAM,KAAK,EAAE,QAAQ,SAAA,CAAU,EAAE,IAAI,CAAC,GAAG,UAAU;AAClD,gBAAM,QAAS,QAAQ,WAAY;AAEnC,iBACE;AAAA,YAAC;AAAA,YAAA;AAAA,cAEC,WAAU;AAAA,cACV,OAAO;AAAA,gBACL,OAAO,GAAG,QAAQ;AAAA,gBAClB,QAAQ;AAAA,gBACR,iBAAiB;AAAA,gBACjB,WAAW,cAAc,iBAAiB;AAAA,gBAC1C,gBAAgB,GAAG,KAAK;AAAA,gBACxB,iBAAiB;AAAA,cAAA;AAAA,YACnB;AAAA,YATK;AAAA,UAAA;AAAA,QAYX,CAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,UAAU,cAAc;"}
|
package/dist/index22.cjs
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
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 colors = require("./index4.cjs");
|
|
6
|
+
const classNames = require("./index3.cjs");
|
|
7
|
+
const PulseBars = react.forwardRef(
|
|
8
|
+
({
|
|
9
|
+
size = 40,
|
|
10
|
+
color = "#3b82f6",
|
|
11
|
+
barCount = 4,
|
|
12
|
+
speed = "normal",
|
|
13
|
+
className,
|
|
14
|
+
style,
|
|
15
|
+
testId = "pulse-bars",
|
|
16
|
+
visible = true,
|
|
17
|
+
ariaLabel = "Loading...",
|
|
18
|
+
...rest
|
|
19
|
+
}, ref) => {
|
|
20
|
+
if (!visible) return null;
|
|
21
|
+
const sizeValue = typeof size === "number" ? size : parseInt(String(size), 10);
|
|
22
|
+
const barWidth = Math.floor(sizeValue / (barCount * 2));
|
|
23
|
+
const animationDuration = colors.getAnimationDuration(speed);
|
|
24
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
25
|
+
"div",
|
|
26
|
+
{
|
|
27
|
+
ref,
|
|
28
|
+
"data-testid": testId,
|
|
29
|
+
className: classNames.cn("inline-flex items-center justify-center gap-1", className),
|
|
30
|
+
style: {
|
|
31
|
+
height: colors.normalizeSize(size),
|
|
32
|
+
...style
|
|
33
|
+
},
|
|
34
|
+
role: "status",
|
|
35
|
+
"aria-label": ariaLabel,
|
|
36
|
+
"aria-busy": "true",
|
|
37
|
+
...rest,
|
|
38
|
+
children: Array.from({ length: barCount }).map((_, index) => {
|
|
39
|
+
const delays = [0, 0.2, 0.4, 0.1, 0.3, 0.5];
|
|
40
|
+
const delay = delays[index % delays.length];
|
|
41
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
className: "rounded-sm",
|
|
45
|
+
style: {
|
|
46
|
+
width: `${barWidth}px`,
|
|
47
|
+
minHeight: "30%",
|
|
48
|
+
height: "100%",
|
|
49
|
+
backgroundColor: color,
|
|
50
|
+
animation: `pulse-wave ${animationDuration} ease-in-out infinite`,
|
|
51
|
+
animationDelay: `${delay}s`,
|
|
52
|
+
transformOrigin: "center"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
index
|
|
56
|
+
);
|
|
57
|
+
})
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
PulseBars.displayName = "PulseBars";
|
|
63
|
+
exports.PulseBars = PulseBars;
|
|
64
|
+
//# sourceMappingURL=index22.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index22.cjs","sources":["../src/components/pulse/PulseBars.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { PulseBarsProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration } from '../../utils';\n\n/**\n * PulseBars - Equalizer-style bars loader\n *\n * A loader with bars that pulse like an audio equalizer.\n *\n * @example\n * ```tsx\n * <PulseBars size={40} color=\"#3b82f6\" />\n * <PulseBars size={48} barCount={6} speed=\"fast\" />\n * ```\n */\nexport const PulseBars = forwardRef<HTMLDivElement, PulseBarsProps>(\n (\n {\n size = 40,\n color = '#3b82f6',\n barCount = 4,\n speed = 'normal',\n className,\n style,\n testId = 'pulse-bars',\n visible = true,\n ariaLabel = 'Loading...',\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const sizeValue = typeof size === 'number' ? size : parseInt(String(size), 10);\n const barWidth = Math.floor(sizeValue / (barCount * 2));\n const animationDuration = getAnimationDuration(speed);\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('inline-flex items-center justify-center gap-1', className)}\n style={{\n height: normalizeSize(size),\n ...style,\n }}\n role=\"status\"\n aria-label={ariaLabel}\n aria-busy=\"true\"\n {...rest}\n >\n {Array.from({ length: barCount }).map((_, index) => {\n // Random-looking delays for equalizer effect\n const delays = [0, 0.2, 0.4, 0.1, 0.3, 0.5];\n const delay = delays[index % delays.length];\n\n return (\n <div\n key={index}\n className=\"rounded-sm\"\n style={{\n width: `${barWidth}px`,\n minHeight: '30%',\n height: '100%',\n backgroundColor: color,\n animation: `pulse-wave ${animationDuration} ease-in-out infinite`,\n animationDelay: `${delay}s`,\n transformOrigin: 'center',\n }}\n />\n );\n })}\n </div>\n );\n }\n);\n\nPulseBars.displayName = 'PulseBars';\n"],"names":["forwardRef","getAnimationDuration","jsx","cn","normalizeSize"],"mappings":";;;;;;AAeO,MAAM,YAAYA,MAAAA;AAAAA,EACvB,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,UAAM,YAAY,OAAO,SAAS,WAAW,OAAO,SAAS,OAAO,IAAI,GAAG,EAAE;AAC7E,UAAM,WAAW,KAAK,MAAM,aAAa,WAAW,EAAE;AACtD,UAAM,oBAAoBC,OAAAA,qBAAqB,KAAK;AAEpD,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAWC,WAAAA,GAAG,iDAAiD,SAAS;AAAA,QACxE,OAAO;AAAA,UACL,QAAQC,OAAAA,cAAc,IAAI;AAAA,UAC1B,GAAG;AAAA,QAAA;AAAA,QAEL,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEH,UAAA,MAAM,KAAK,EAAE,QAAQ,SAAA,CAAU,EAAE,IAAI,CAAC,GAAG,UAAU;AAElD,gBAAM,SAAS,CAAC,GAAG,KAAK,KAAK,KAAK,KAAK,GAAG;AAC1C,gBAAM,QAAQ,OAAO,QAAQ,OAAO,MAAM;AAE1C,iBACEF,2BAAAA;AAAAA,YAAC;AAAA,YAAA;AAAA,cAEC,WAAU;AAAA,cACV,OAAO;AAAA,gBACL,OAAO,GAAG,QAAQ;AAAA,gBAClB,WAAW;AAAA,gBACX,QAAQ;AAAA,gBACR,iBAAiB;AAAA,gBACjB,WAAW,cAAc,iBAAiB;AAAA,gBAC1C,gBAAgB,GAAG,KAAK;AAAA,gBACxB,iBAAiB;AAAA,cAAA;AAAA,YACnB;AAAA,YAVK;AAAA,UAAA;AAAA,QAaX,CAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,UAAU,cAAc;;"}
|
package/dist/index22.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { normalizeSize, getAnimationDuration } from "./index4.js";
|
|
4
|
+
import { cn } from "./index3.js";
|
|
5
|
+
const PulseBars = forwardRef(
|
|
6
|
+
({
|
|
7
|
+
size = 40,
|
|
8
|
+
color = "#3b82f6",
|
|
9
|
+
barCount = 4,
|
|
10
|
+
speed = "normal",
|
|
11
|
+
className,
|
|
12
|
+
style,
|
|
13
|
+
testId = "pulse-bars",
|
|
14
|
+
visible = true,
|
|
15
|
+
ariaLabel = "Loading...",
|
|
16
|
+
...rest
|
|
17
|
+
}, ref) => {
|
|
18
|
+
if (!visible) return null;
|
|
19
|
+
const sizeValue = typeof size === "number" ? size : parseInt(String(size), 10);
|
|
20
|
+
const barWidth = Math.floor(sizeValue / (barCount * 2));
|
|
21
|
+
const animationDuration = getAnimationDuration(speed);
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
ref,
|
|
26
|
+
"data-testid": testId,
|
|
27
|
+
className: cn("inline-flex items-center justify-center gap-1", className),
|
|
28
|
+
style: {
|
|
29
|
+
height: normalizeSize(size),
|
|
30
|
+
...style
|
|
31
|
+
},
|
|
32
|
+
role: "status",
|
|
33
|
+
"aria-label": ariaLabel,
|
|
34
|
+
"aria-busy": "true",
|
|
35
|
+
...rest,
|
|
36
|
+
children: Array.from({ length: barCount }).map((_, index) => {
|
|
37
|
+
const delays = [0, 0.2, 0.4, 0.1, 0.3, 0.5];
|
|
38
|
+
const delay = delays[index % delays.length];
|
|
39
|
+
return /* @__PURE__ */ jsx(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
className: "rounded-sm",
|
|
43
|
+
style: {
|
|
44
|
+
width: `${barWidth}px`,
|
|
45
|
+
minHeight: "30%",
|
|
46
|
+
height: "100%",
|
|
47
|
+
backgroundColor: color,
|
|
48
|
+
animation: `pulse-wave ${animationDuration} ease-in-out infinite`,
|
|
49
|
+
animationDelay: `${delay}s`,
|
|
50
|
+
transformOrigin: "center"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
index
|
|
54
|
+
);
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
PulseBars.displayName = "PulseBars";
|
|
61
|
+
export {
|
|
62
|
+
PulseBars
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=index22.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index22.js","sources":["../src/components/pulse/PulseBars.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { PulseBarsProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration } from '../../utils';\n\n/**\n * PulseBars - Equalizer-style bars loader\n *\n * A loader with bars that pulse like an audio equalizer.\n *\n * @example\n * ```tsx\n * <PulseBars size={40} color=\"#3b82f6\" />\n * <PulseBars size={48} barCount={6} speed=\"fast\" />\n * ```\n */\nexport const PulseBars = forwardRef<HTMLDivElement, PulseBarsProps>(\n (\n {\n size = 40,\n color = '#3b82f6',\n barCount = 4,\n speed = 'normal',\n className,\n style,\n testId = 'pulse-bars',\n visible = true,\n ariaLabel = 'Loading...',\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const sizeValue = typeof size === 'number' ? size : parseInt(String(size), 10);\n const barWidth = Math.floor(sizeValue / (barCount * 2));\n const animationDuration = getAnimationDuration(speed);\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('inline-flex items-center justify-center gap-1', className)}\n style={{\n height: normalizeSize(size),\n ...style,\n }}\n role=\"status\"\n aria-label={ariaLabel}\n aria-busy=\"true\"\n {...rest}\n >\n {Array.from({ length: barCount }).map((_, index) => {\n // Random-looking delays for equalizer effect\n const delays = [0, 0.2, 0.4, 0.1, 0.3, 0.5];\n const delay = delays[index % delays.length];\n\n return (\n <div\n key={index}\n className=\"rounded-sm\"\n style={{\n width: `${barWidth}px`,\n minHeight: '30%',\n height: '100%',\n backgroundColor: color,\n animation: `pulse-wave ${animationDuration} ease-in-out infinite`,\n animationDelay: `${delay}s`,\n transformOrigin: 'center',\n }}\n />\n );\n })}\n </div>\n );\n }\n);\n\nPulseBars.displayName = 'PulseBars';\n"],"names":[],"mappings":";;;;AAeO,MAAM,YAAY;AAAA,EACvB,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,UAAM,YAAY,OAAO,SAAS,WAAW,OAAO,SAAS,OAAO,IAAI,GAAG,EAAE;AAC7E,UAAM,WAAW,KAAK,MAAM,aAAa,WAAW,EAAE;AACtD,UAAM,oBAAoB,qBAAqB,KAAK;AAEpD,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAW,GAAG,iDAAiD,SAAS;AAAA,QACxE,OAAO;AAAA,UACL,QAAQ,cAAc,IAAI;AAAA,UAC1B,GAAG;AAAA,QAAA;AAAA,QAEL,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEH,UAAA,MAAM,KAAK,EAAE,QAAQ,SAAA,CAAU,EAAE,IAAI,CAAC,GAAG,UAAU;AAElD,gBAAM,SAAS,CAAC,GAAG,KAAK,KAAK,KAAK,KAAK,GAAG;AAC1C,gBAAM,QAAQ,OAAO,QAAQ,OAAO,MAAM;AAE1C,iBACE;AAAA,YAAC;AAAA,YAAA;AAAA,cAEC,WAAU;AAAA,cACV,OAAO;AAAA,gBACL,OAAO,GAAG,QAAQ;AAAA,gBAClB,WAAW;AAAA,gBACX,QAAQ;AAAA,gBACR,iBAAiB;AAAA,gBACjB,WAAW,cAAc,iBAAiB;AAAA,gBAC1C,gBAAgB,GAAG,KAAK;AAAA,gBACxB,iBAAiB;AAAA,cAAA;AAAA,YACnB;AAAA,YAVK;AAAA,UAAA;AAAA,QAaX,CAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,UAAU,cAAc;"}
|
package/dist/index23.cjs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
function r(e) {
|
|
4
|
+
var t, f, n = "";
|
|
5
|
+
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
6
|
+
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
7
|
+
var o = e.length;
|
|
8
|
+
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
9
|
+
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
10
|
+
return n;
|
|
11
|
+
}
|
|
12
|
+
function clsx() {
|
|
13
|
+
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
14
|
+
return n;
|
|
15
|
+
}
|
|
16
|
+
exports.clsx = clsx;
|
|
17
|
+
exports.default = clsx;
|
|
18
|
+
//# sourceMappingURL=index23.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index23.cjs","sources":["../node_modules/clsx/dist/clsx.mjs"],"sourcesContent":["function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;"],"names":[],"mappings":";;AAAA,SAAS,EAAE,GAAE;AAAC,MAAI,GAAE,GAAE,IAAE;AAAG,MAAG,YAAU,OAAO,KAAG,YAAU,OAAO,EAAE,MAAG;AAAA,WAAU,YAAU,OAAO,EAAE,KAAG,MAAM,QAAQ,CAAC,GAAE;AAAC,QAAI,IAAE,EAAE;AAAO,SAAI,IAAE,GAAE,IAAE,GAAE,IAAI,GAAE,CAAC,MAAI,IAAE,EAAE,EAAE,CAAC,CAAC,OAAK,MAAI,KAAG,MAAK,KAAG;AAAA,EAAE,MAAM,MAAI,KAAK,EAAE,GAAE,CAAC,MAAI,MAAI,KAAG,MAAK,KAAG;AAAG,SAAO;AAAC;AAAQ,SAAS,OAAM;AAAC,WAAQ,GAAE,GAAE,IAAE,GAAE,IAAE,IAAG,IAAE,UAAU,QAAO,IAAE,GAAE,IAAI,EAAC,IAAE,UAAU,CAAC,OAAK,IAAE,EAAE,CAAC,OAAK,MAAI,KAAG,MAAK,KAAG;AAAG,SAAO;AAAC;;;","x_google_ignoreList":[0]}
|
package/dist/index23.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function r(e) {
|
|
2
|
+
var t, f, n = "";
|
|
3
|
+
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
4
|
+
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
5
|
+
var o = e.length;
|
|
6
|
+
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
7
|
+
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
8
|
+
return n;
|
|
9
|
+
}
|
|
10
|
+
function clsx() {
|
|
11
|
+
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
12
|
+
return n;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
clsx,
|
|
16
|
+
clsx as default
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=index23.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index23.js","sources":["../node_modules/clsx/dist/clsx.mjs"],"sourcesContent":["function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;"],"names":[],"mappings":"AAAA,SAAS,EAAE,GAAE;AAAC,MAAI,GAAE,GAAE,IAAE;AAAG,MAAG,YAAU,OAAO,KAAG,YAAU,OAAO,EAAE,MAAG;AAAA,WAAU,YAAU,OAAO,EAAE,KAAG,MAAM,QAAQ,CAAC,GAAE;AAAC,QAAI,IAAE,EAAE;AAAO,SAAI,IAAE,GAAE,IAAE,GAAE,IAAI,GAAE,CAAC,MAAI,IAAE,EAAE,EAAE,CAAC,CAAC,OAAK,MAAI,KAAG,MAAK,KAAG;AAAA,EAAE,MAAM,MAAI,KAAK,EAAE,GAAE,CAAC,MAAI,MAAI,KAAG,MAAK,KAAG;AAAG,SAAO;AAAC;AAAQ,SAAS,OAAM;AAAC,WAAQ,GAAE,GAAE,IAAE,GAAE,IAAE,IAAG,IAAE,UAAU,QAAO,IAAE,GAAE,IAAI,EAAC,IAAE,UAAU,CAAC,OAAK,IAAE,EAAE,CAAC,OAAK,MAAI,KAAG,MAAK,KAAG;AAAG,SAAO;AAAC;","x_google_ignoreList":[0]}
|
package/dist/index3.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index3.cjs","sources":["../src/utils/classNames.ts"],"sourcesContent":["import { clsx, type ClassValue } from 'clsx';\n\n/**\n * Utility function to merge class names\n * Combines clsx for conditional classes\n *\n * @param inputs - Class names to merge\n * @returns Merged class name string\n *\n * @example\n * cn('base-class', condition && 'conditional-class', 'another-class')\n * // => 'base-class conditional-class another-class' (if condition is true)\n */\nexport function cn(...inputs: ClassValue[]) {\n return clsx(inputs);\n}\n"],"names":["clsx"],"mappings":";;;AAaO,SAAS,MAAM,QAAsB;AAC1C,SAAOA,KAAAA,KAAK,MAAM;AACpB;;"}
|
package/dist/index3.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index3.js","sources":["../src/utils/classNames.ts"],"sourcesContent":["import { clsx, type ClassValue } from 'clsx';\n\n/**\n * Utility function to merge class names\n * Combines clsx for conditional classes\n *\n * @param inputs - Class names to merge\n * @returns Merged class name string\n *\n * @example\n * cn('base-class', condition && 'conditional-class', 'another-class')\n * // => 'base-class conditional-class another-class' (if condition is true)\n */\nexport function cn(...inputs: ClassValue[]) {\n return clsx(inputs);\n}\n"],"names":[],"mappings":";AAaO,SAAS,MAAM,QAAsB;AAC1C,SAAO,KAAK,MAAM;AACpB;"}
|
package/dist/index4.cjs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
function getAnimationDuration(speed) {
|
|
4
|
+
if (typeof speed === "number") {
|
|
5
|
+
return `${speed}ms`;
|
|
6
|
+
}
|
|
7
|
+
const speedMap = {
|
|
8
|
+
slow: "2s",
|
|
9
|
+
normal: "1s",
|
|
10
|
+
fast: "0.5s"
|
|
11
|
+
};
|
|
12
|
+
return speedMap[speed];
|
|
13
|
+
}
|
|
14
|
+
function normalizeSize(size) {
|
|
15
|
+
if (typeof size === "number") {
|
|
16
|
+
return `${size}px`;
|
|
17
|
+
}
|
|
18
|
+
return size || "auto";
|
|
19
|
+
}
|
|
20
|
+
exports.getAnimationDuration = getAnimationDuration;
|
|
21
|
+
exports.normalizeSize = normalizeSize;
|
|
22
|
+
//# sourceMappingURL=index4.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index4.cjs","sources":["../src/utils/colors.ts"],"sourcesContent":["/**\n * Check if a color is a valid hex color\n */\nexport function isHexColor(color: string): boolean {\n return /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(color);\n}\n\n/**\n * Check if a color is a valid RGB/RGBA color\n */\nexport function isRgbColor(color: string): boolean {\n return /^rgba?\\([\\d\\s,./]+\\)$/.test(color);\n}\n\n/**\n * Convert hex color to RGB\n */\nexport function hexToRgb(hex: string): { r: number; g: number; b: number } | null {\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result\n ? {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16),\n }\n : null;\n}\n\n/**\n * Get animation duration in CSS format\n */\nexport function getAnimationDuration(speed: 'slow' | 'normal' | 'fast' | number): string {\n if (typeof speed === 'number') {\n return `${speed}ms`;\n }\n\n const speedMap = {\n slow: '2s',\n normal: '1s',\n fast: '0.5s',\n };\n\n return speedMap[speed];\n}\n\n/**\n * Normalize size value to CSS string\n */\nexport function normalizeSize(size?: number | string): string {\n if (typeof size === 'number') {\n return `${size}px`;\n }\n return size || 'auto';\n}\n"],"names":[],"mappings":";;AA+BO,SAAS,qBAAqB,OAAoD;AACvF,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO,GAAG,KAAK;AAAA,EACjB;AAEA,QAAM,WAAW;AAAA,IACf,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,MAAM;AAAA,EAAA;AAGR,SAAO,SAAS,KAAK;AACvB;AAKO,SAAS,cAAc,MAAgC;AAC5D,MAAI,OAAO,SAAS,UAAU;AAC5B,WAAO,GAAG,IAAI;AAAA,EAChB;AACA,SAAO,QAAQ;AACjB;;;"}
|
package/dist/index4.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
function getAnimationDuration(speed) {
|
|
2
|
+
if (typeof speed === "number") {
|
|
3
|
+
return `${speed}ms`;
|
|
4
|
+
}
|
|
5
|
+
const speedMap = {
|
|
6
|
+
slow: "2s",
|
|
7
|
+
normal: "1s",
|
|
8
|
+
fast: "0.5s"
|
|
9
|
+
};
|
|
10
|
+
return speedMap[speed];
|
|
11
|
+
}
|
|
12
|
+
function normalizeSize(size) {
|
|
13
|
+
if (typeof size === "number") {
|
|
14
|
+
return `${size}px`;
|
|
15
|
+
}
|
|
16
|
+
return size || "auto";
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
getAnimationDuration,
|
|
20
|
+
normalizeSize
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=index4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index4.js","sources":["../src/utils/colors.ts"],"sourcesContent":["/**\n * Check if a color is a valid hex color\n */\nexport function isHexColor(color: string): boolean {\n return /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(color);\n}\n\n/**\n * Check if a color is a valid RGB/RGBA color\n */\nexport function isRgbColor(color: string): boolean {\n return /^rgba?\\([\\d\\s,./]+\\)$/.test(color);\n}\n\n/**\n * Convert hex color to RGB\n */\nexport function hexToRgb(hex: string): { r: number; g: number; b: number } | null {\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result\n ? {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16),\n }\n : null;\n}\n\n/**\n * Get animation duration in CSS format\n */\nexport function getAnimationDuration(speed: 'slow' | 'normal' | 'fast' | number): string {\n if (typeof speed === 'number') {\n return `${speed}ms`;\n }\n\n const speedMap = {\n slow: '2s',\n normal: '1s',\n fast: '0.5s',\n };\n\n return speedMap[speed];\n}\n\n/**\n * Normalize size value to CSS string\n */\nexport function normalizeSize(size?: number | string): string {\n if (typeof size === 'number') {\n return `${size}px`;\n }\n return size || 'auto';\n}\n"],"names":[],"mappings":"AA+BO,SAAS,qBAAqB,OAAoD;AACvF,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO,GAAG,KAAK;AAAA,EACjB;AAEA,QAAM,WAAW;AAAA,IACf,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,MAAM;AAAA,EAAA;AAGR,SAAO,SAAS,KAAK;AACvB;AAKO,SAAS,cAAc,MAAgC;AAC5D,MAAI,OAAO,SAAS,UAAU;AAC5B,WAAO,GAAG,IAAI;AAAA,EAChB;AACA,SAAO,QAAQ;AACjB;"}
|
package/dist/index5.cjs
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
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 colors = require("./index4.cjs");
|
|
6
|
+
const classNames = require("./index3.cjs");
|
|
7
|
+
const Skeleton = react.forwardRef(
|
|
8
|
+
({
|
|
9
|
+
width = "100%",
|
|
10
|
+
height = "1rem",
|
|
11
|
+
borderRadius,
|
|
12
|
+
variant = "text",
|
|
13
|
+
animate = true,
|
|
14
|
+
baseColor = "#e0e0e0",
|
|
15
|
+
highlightColor = "#f5f5f5",
|
|
16
|
+
className,
|
|
17
|
+
style,
|
|
18
|
+
testId = "skeleton",
|
|
19
|
+
visible = true,
|
|
20
|
+
...rest
|
|
21
|
+
}, ref) => {
|
|
22
|
+
if (!visible) return null;
|
|
23
|
+
const getBorderRadius = () => {
|
|
24
|
+
if (borderRadius !== void 0) return colors.normalizeSize(borderRadius);
|
|
25
|
+
switch (variant) {
|
|
26
|
+
case "circular":
|
|
27
|
+
return "50%";
|
|
28
|
+
case "rounded":
|
|
29
|
+
return "0.5rem";
|
|
30
|
+
case "text":
|
|
31
|
+
return "0.25rem";
|
|
32
|
+
case "rectangular":
|
|
33
|
+
default:
|
|
34
|
+
return "0";
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
ref,
|
|
41
|
+
"data-testid": testId,
|
|
42
|
+
className: classNames.cn(
|
|
43
|
+
"skeleton",
|
|
44
|
+
animate && "skeleton-animate",
|
|
45
|
+
className
|
|
46
|
+
),
|
|
47
|
+
style: {
|
|
48
|
+
width: colors.normalizeSize(width),
|
|
49
|
+
height: colors.normalizeSize(height),
|
|
50
|
+
borderRadius: getBorderRadius(),
|
|
51
|
+
backgroundColor: baseColor,
|
|
52
|
+
"--skeleton-highlight-color": highlightColor,
|
|
53
|
+
...style
|
|
54
|
+
},
|
|
55
|
+
role: "status",
|
|
56
|
+
"aria-label": "Loading...",
|
|
57
|
+
"aria-busy": "true",
|
|
58
|
+
...rest
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
Skeleton.displayName = "Skeleton";
|
|
64
|
+
exports.Skeleton = Skeleton;
|
|
65
|
+
//# sourceMappingURL=index5.cjs.map
|