premium-react-loaders 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/progress/ProgressBar.d.ts +2 -0
- package/dist/components/progress/ProgressBar.d.ts.map +1 -1
- package/dist/components/progress/ProgressCircle.d.ts +2 -1
- package/dist/components/progress/ProgressCircle.d.ts.map +1 -1
- package/dist/components/progress/ProgressRing.d.ts +2 -1
- package/dist/components/progress/ProgressRing.d.ts.map +1 -1
- package/dist/components/progress/ProgressSteps.d.ts +16 -0
- package/dist/components/progress/ProgressSteps.d.ts.map +1 -0
- package/dist/components/progress/index.d.ts +1 -0
- package/dist/components/progress/index.d.ts.map +1 -1
- package/dist/components/pulse/TypingIndicator.d.ts +16 -0
- package/dist/components/pulse/TypingIndicator.d.ts.map +1 -0
- package/dist/components/pulse/index.d.ts +1 -0
- package/dist/components/pulse/index.d.ts.map +1 -1
- package/dist/components/skeleton/SkeletonForm.d.ts +16 -0
- package/dist/components/skeleton/SkeletonForm.d.ts.map +1 -0
- package/dist/components/skeleton/SkeletonText.d.ts +1 -1
- package/dist/components/skeleton/SkeletonText.d.ts.map +1 -1
- package/dist/components/skeleton/index.d.ts +1 -0
- package/dist/components/skeleton/index.d.ts.map +1 -1
- package/dist/components/spinner/SpinnerDots.d.ts.map +1 -1
- package/dist/components/spinner/SpinnerPulse.d.ts +15 -0
- package/dist/components/spinner/SpinnerPulse.d.ts.map +1 -0
- package/dist/components/spinner/SpinnerRing.d.ts +1 -0
- package/dist/components/spinner/SpinnerRing.d.ts.map +1 -1
- package/dist/components/spinner/SpinnerWave.d.ts +15 -0
- package/dist/components/spinner/SpinnerWave.d.ts.map +1 -0
- package/dist/components/spinner/index.d.ts +2 -0
- package/dist/components/spinner/index.d.ts.map +1 -1
- package/dist/index.cjs +23 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +23 -13
- package/dist/index.js.map +1 -1
- package/dist/index13.cjs +54 -35
- package/dist/index13.cjs.map +1 -1
- package/dist/index13.js +56 -37
- package/dist/index13.js.map +1 -1
- package/dist/index14.cjs +23 -11
- package/dist/index14.cjs.map +1 -1
- package/dist/index14.js +23 -11
- package/dist/index14.js.map +1 -1
- package/dist/index15.cjs +10 -32
- package/dist/index15.cjs.map +1 -1
- package/dist/index15.js +10 -32
- package/dist/index15.js.map +1 -1
- package/dist/index16.cjs +41 -24
- package/dist/index16.cjs.map +1 -1
- package/dist/index16.js +42 -25
- package/dist/index16.js.map +1 -1
- package/dist/index17.cjs +24 -37
- package/dist/index17.cjs.map +1 -1
- package/dist/index17.js +24 -37
- package/dist/index17.js.map +1 -1
- package/dist/index18.cjs +48 -58
- package/dist/index18.cjs.map +1 -1
- package/dist/index18.js +49 -59
- package/dist/index18.js.map +1 -1
- package/dist/index19.cjs +41 -83
- package/dist/index19.cjs.map +1 -1
- package/dist/index19.js +42 -84
- package/dist/index19.js.map +1 -1
- package/dist/index20.cjs +54 -87
- package/dist/index20.cjs.map +1 -1
- package/dist/index20.js +55 -88
- package/dist/index20.js.map +1 -1
- package/dist/index21.cjs +73 -27
- package/dist/index21.cjs.map +1 -1
- package/dist/index21.js +76 -30
- package/dist/index21.js.map +1 -1
- package/dist/index22.cjs +98 -31
- package/dist/index22.cjs.map +1 -1
- package/dist/index22.js +100 -33
- package/dist/index22.js.map +1 -1
- package/dist/index23.cjs +104 -33
- package/dist/index23.cjs.map +1 -1
- package/dist/index23.js +107 -36
- package/dist/index23.js.map +1 -1
- package/dist/index24.cjs +108 -48
- package/dist/index24.cjs.map +1 -1
- package/dist/index24.js +110 -50
- package/dist/index24.js.map +1 -1
- package/dist/index25.cjs +55 -16
- package/dist/index25.cjs.map +1 -1
- package/dist/index25.js +54 -15
- package/dist/index25.js.map +1 -1
- package/dist/index26.cjs +62 -0
- package/dist/index26.cjs.map +1 -0
- package/dist/index26.js +62 -0
- package/dist/index26.js.map +1 -0
- package/dist/index27.cjs +64 -0
- package/dist/index27.cjs.map +1 -0
- package/dist/index27.js +64 -0
- package/dist/index27.js.map +1 -0
- package/dist/index28.cjs +61 -0
- package/dist/index28.cjs.map +1 -0
- package/dist/index28.js +61 -0
- package/dist/index28.js.map +1 -0
- package/dist/index29.cjs +71 -0
- package/dist/index29.cjs.map +1 -0
- package/dist/index29.js +71 -0
- package/dist/index29.js.map +1 -0
- package/dist/index3.cjs +1 -1
- package/dist/index3.js +1 -1
- package/dist/index30.cjs +18 -0
- package/dist/index30.cjs.map +1 -0
- package/dist/index30.js +18 -0
- package/dist/index30.js.map +1 -0
- package/dist/index4.cjs +63 -3
- package/dist/index4.cjs.map +1 -1
- package/dist/index4.js +64 -4
- package/dist/index4.js.map +1 -1
- package/dist/index6.cjs +2 -1
- package/dist/index6.cjs.map +1 -1
- package/dist/index6.js +2 -1
- package/dist/index6.js.map +1 -1
- package/dist/premium-react-loaders.css +32 -0
- package/dist/types/progress.d.ts +32 -1
- package/dist/types/progress.d.ts.map +1 -1
- package/dist/types/pulse.d.ts +13 -0
- package/dist/types/pulse.d.ts.map +1 -1
- package/dist/types/skeleton.d.ts +19 -0
- package/dist/types/skeleton.d.ts.map +1 -1
- package/dist/types/spinner.d.ts +18 -0
- package/dist/types/spinner.d.ts.map +1 -1
- package/dist/utils/colors.d.ts +14 -1
- package/dist/utils/colors.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index27.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { normalizeSize, getAnimationDuration, parseSizeToNumber } 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 = parseSizeToNumber(size, 40);
|
|
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=index27.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index27.js","sources":["../src/components/pulse/PulseBars.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { PulseBarsProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration, parseSizeToNumber } 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 = parseSizeToNumber(size, 40);\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,kBAAkB,MAAM,EAAE;AAC5C,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/index28.cjs
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
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 TypingIndicator = react.forwardRef(
|
|
8
|
+
({
|
|
9
|
+
size,
|
|
10
|
+
color = "#3b82f6",
|
|
11
|
+
dotCount = 3,
|
|
12
|
+
dotSize = 8,
|
|
13
|
+
gap = 4,
|
|
14
|
+
variant = "bounce",
|
|
15
|
+
speed = "normal",
|
|
16
|
+
className,
|
|
17
|
+
style,
|
|
18
|
+
testId = "typing-indicator",
|
|
19
|
+
visible = true,
|
|
20
|
+
ariaLabel = "Typing...",
|
|
21
|
+
...rest
|
|
22
|
+
}, ref) => {
|
|
23
|
+
if (!visible) return null;
|
|
24
|
+
const animationDuration = colors.getAnimationDuration(speed);
|
|
25
|
+
const gapValue = colors.normalizeSize(gap);
|
|
26
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
ref,
|
|
30
|
+
"data-testid": testId,
|
|
31
|
+
className: classNames.cn("inline-flex items-center", className),
|
|
32
|
+
style: {
|
|
33
|
+
gap: gapValue,
|
|
34
|
+
height: size ? colors.normalizeSize(size) : "auto",
|
|
35
|
+
...style
|
|
36
|
+
},
|
|
37
|
+
role: "status",
|
|
38
|
+
"aria-label": ariaLabel,
|
|
39
|
+
"aria-busy": "true",
|
|
40
|
+
...rest,
|
|
41
|
+
children: Array.from({ length: dotCount }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
className: "rounded-full",
|
|
45
|
+
style: {
|
|
46
|
+
width: colors.normalizeSize(dotSize),
|
|
47
|
+
height: colors.normalizeSize(dotSize),
|
|
48
|
+
backgroundColor: color,
|
|
49
|
+
animation: `typing-${variant} ${animationDuration} ease-in-out infinite`,
|
|
50
|
+
animationDelay: `${index * 0.2}s`
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
index
|
|
54
|
+
))
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
TypingIndicator.displayName = "TypingIndicator";
|
|
60
|
+
exports.TypingIndicator = TypingIndicator;
|
|
61
|
+
//# sourceMappingURL=index28.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index28.cjs","sources":["../src/components/pulse/TypingIndicator.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { TypingIndicatorProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration } from '../../utils';\n\n/**\n * TypingIndicator - Chat typing indicator\n *\n * A loader for messaging/chat applications showing typing activity.\n *\n * @example\n * ```tsx\n * <TypingIndicator />\n * <TypingIndicator variant=\"fade\" />\n * <TypingIndicator dotCount={5} color=\"#3b82f6\" />\n * <TypingIndicator dotSize={10} gap={6} />\n * ```\n */\nexport const TypingIndicator = forwardRef<HTMLDivElement, TypingIndicatorProps>(\n (\n {\n size,\n color = '#3b82f6',\n dotCount = 3,\n dotSize = 8,\n gap = 4,\n variant = 'bounce',\n speed = 'normal',\n className,\n style,\n testId = 'typing-indicator',\n visible = true,\n ariaLabel = 'Typing...',\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const animationDuration = getAnimationDuration(speed);\n const gapValue = normalizeSize(gap);\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('inline-flex items-center', className)}\n style={{\n gap: gapValue,\n height: size ? normalizeSize(size) : 'auto',\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: `typing-${variant} ${animationDuration} ease-in-out infinite`,\n animationDelay: `${index * 0.2}s`,\n }}\n />\n ))}\n </div>\n );\n }\n);\n\nTypingIndicator.displayName = 'TypingIndicator';\n"],"names":["forwardRef","getAnimationDuration","normalizeSize","jsx","cn"],"mappings":";;;;;;AAiBO,MAAM,kBAAkBA,MAAAA;AAAAA,EAC7B,CACE;AAAA,IACE;AAAA,IACA,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,UAAU;AAAA,IACV,MAAM;AAAA,IACN,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;AACpD,UAAM,WAAWC,OAAAA,cAAc,GAAG;AAElC,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAWC,WAAAA,GAAG,4BAA4B,SAAS;AAAA,QACnD,OAAO;AAAA,UACL,KAAK;AAAA,UACL,QAAQ,OAAOF,qBAAc,IAAI,IAAI;AAAA,UACrC,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,UACxCC,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YAEC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,OAAOD,OAAAA,cAAc,OAAO;AAAA,cAC5B,QAAQA,OAAAA,cAAc,OAAO;AAAA,cAC7B,iBAAiB;AAAA,cACjB,WAAW,UAAU,OAAO,IAAI,iBAAiB;AAAA,cACjD,gBAAgB,GAAG,QAAQ,GAAG;AAAA,YAAA;AAAA,UAChC;AAAA,UARK;AAAA,QAAA,CAUR;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,gBAAgB,cAAc;;"}
|
package/dist/index28.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
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 TypingIndicator = forwardRef(
|
|
6
|
+
({
|
|
7
|
+
size,
|
|
8
|
+
color = "#3b82f6",
|
|
9
|
+
dotCount = 3,
|
|
10
|
+
dotSize = 8,
|
|
11
|
+
gap = 4,
|
|
12
|
+
variant = "bounce",
|
|
13
|
+
speed = "normal",
|
|
14
|
+
className,
|
|
15
|
+
style,
|
|
16
|
+
testId = "typing-indicator",
|
|
17
|
+
visible = true,
|
|
18
|
+
ariaLabel = "Typing...",
|
|
19
|
+
...rest
|
|
20
|
+
}, ref) => {
|
|
21
|
+
if (!visible) return null;
|
|
22
|
+
const animationDuration = getAnimationDuration(speed);
|
|
23
|
+
const gapValue = normalizeSize(gap);
|
|
24
|
+
return /* @__PURE__ */ jsx(
|
|
25
|
+
"div",
|
|
26
|
+
{
|
|
27
|
+
ref,
|
|
28
|
+
"data-testid": testId,
|
|
29
|
+
className: cn("inline-flex items-center", className),
|
|
30
|
+
style: {
|
|
31
|
+
gap: gapValue,
|
|
32
|
+
height: size ? normalizeSize(size) : "auto",
|
|
33
|
+
...style
|
|
34
|
+
},
|
|
35
|
+
role: "status",
|
|
36
|
+
"aria-label": ariaLabel,
|
|
37
|
+
"aria-busy": "true",
|
|
38
|
+
...rest,
|
|
39
|
+
children: Array.from({ length: dotCount }).map((_, index) => /* @__PURE__ */ jsx(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
className: "rounded-full",
|
|
43
|
+
style: {
|
|
44
|
+
width: normalizeSize(dotSize),
|
|
45
|
+
height: normalizeSize(dotSize),
|
|
46
|
+
backgroundColor: color,
|
|
47
|
+
animation: `typing-${variant} ${animationDuration} ease-in-out infinite`,
|
|
48
|
+
animationDelay: `${index * 0.2}s`
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
index
|
|
52
|
+
))
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
TypingIndicator.displayName = "TypingIndicator";
|
|
58
|
+
export {
|
|
59
|
+
TypingIndicator
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=index28.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index28.js","sources":["../src/components/pulse/TypingIndicator.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { TypingIndicatorProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration } from '../../utils';\n\n/**\n * TypingIndicator - Chat typing indicator\n *\n * A loader for messaging/chat applications showing typing activity.\n *\n * @example\n * ```tsx\n * <TypingIndicator />\n * <TypingIndicator variant=\"fade\" />\n * <TypingIndicator dotCount={5} color=\"#3b82f6\" />\n * <TypingIndicator dotSize={10} gap={6} />\n * ```\n */\nexport const TypingIndicator = forwardRef<HTMLDivElement, TypingIndicatorProps>(\n (\n {\n size,\n color = '#3b82f6',\n dotCount = 3,\n dotSize = 8,\n gap = 4,\n variant = 'bounce',\n speed = 'normal',\n className,\n style,\n testId = 'typing-indicator',\n visible = true,\n ariaLabel = 'Typing...',\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const animationDuration = getAnimationDuration(speed);\n const gapValue = normalizeSize(gap);\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('inline-flex items-center', className)}\n style={{\n gap: gapValue,\n height: size ? normalizeSize(size) : 'auto',\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: `typing-${variant} ${animationDuration} ease-in-out infinite`,\n animationDelay: `${index * 0.2}s`,\n }}\n />\n ))}\n </div>\n );\n }\n);\n\nTypingIndicator.displayName = 'TypingIndicator';\n"],"names":[],"mappings":";;;;AAiBO,MAAM,kBAAkB;AAAA,EAC7B,CACE;AAAA,IACE;AAAA,IACA,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,UAAU;AAAA,IACV,MAAM;AAAA,IACN,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;AACpD,UAAM,WAAW,cAAc,GAAG;AAElC,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAW,GAAG,4BAA4B,SAAS;AAAA,QACnD,OAAO;AAAA,UACL,KAAK;AAAA,UACL,QAAQ,OAAO,cAAc,IAAI,IAAI;AAAA,UACrC,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,UAAU,OAAO,IAAI,iBAAiB;AAAA,cACjD,gBAAgB,GAAG,QAAQ,GAAG;AAAA,YAAA;AAAA,UAChC;AAAA,UARK;AAAA,QAAA,CAUR;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,gBAAgB,cAAc;"}
|
package/dist/index29.cjs
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
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 classNames = require("./index3.cjs");
|
|
6
|
+
const LoaderOverlay = react.forwardRef(
|
|
7
|
+
({
|
|
8
|
+
loading = false,
|
|
9
|
+
loader,
|
|
10
|
+
children,
|
|
11
|
+
position = "fixed",
|
|
12
|
+
backdropOpacity = 0.5,
|
|
13
|
+
backdropColor = "#000000",
|
|
14
|
+
blur = false,
|
|
15
|
+
className,
|
|
16
|
+
style,
|
|
17
|
+
testId = "loader-overlay",
|
|
18
|
+
ariaLabel = "Loading content...",
|
|
19
|
+
zIndex = 9999,
|
|
20
|
+
...rest
|
|
21
|
+
}, ref) => {
|
|
22
|
+
const backdropStyles = {
|
|
23
|
+
backgroundColor: backdropColor,
|
|
24
|
+
opacity: backdropOpacity,
|
|
25
|
+
backdropFilter: blur ? "blur(4px)" : void 0,
|
|
26
|
+
WebkitBackdropFilter: blur ? "blur(4px)" : void 0
|
|
27
|
+
};
|
|
28
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
ref,
|
|
32
|
+
"data-testid": testId,
|
|
33
|
+
className: classNames.cn("relative", className),
|
|
34
|
+
style,
|
|
35
|
+
...rest,
|
|
36
|
+
children: [
|
|
37
|
+
children,
|
|
38
|
+
loading && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
className: classNames.cn(
|
|
42
|
+
"inset-0 flex items-center justify-center",
|
|
43
|
+
position === "fixed" ? "fixed" : "absolute"
|
|
44
|
+
),
|
|
45
|
+
style: {
|
|
46
|
+
zIndex
|
|
47
|
+
},
|
|
48
|
+
role: "status",
|
|
49
|
+
"aria-label": ariaLabel,
|
|
50
|
+
"aria-busy": "true",
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
53
|
+
"div",
|
|
54
|
+
{
|
|
55
|
+
className: "absolute inset-0",
|
|
56
|
+
style: backdropStyles,
|
|
57
|
+
"aria-hidden": "true"
|
|
58
|
+
}
|
|
59
|
+
),
|
|
60
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative z-10", children: loader })
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
LoaderOverlay.displayName = "LoaderOverlay";
|
|
70
|
+
exports.LoaderOverlay = LoaderOverlay;
|
|
71
|
+
//# sourceMappingURL=index29.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index29.cjs","sources":["../src/components/overlay/LoaderOverlay.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { LoaderOverlayProps } from '../../types';\nimport { cn } from '../../utils';\n\n/**\n * LoaderOverlay - Overlay wrapper for displaying loaders over content\n *\n * A flexible overlay component that displays a loader over content during loading states.\n * Supports both full-screen and container-relative positioning.\n *\n * @example\n * ```tsx\n * // Full screen overlay\n * <LoaderOverlay loading={isLoading} loader={<SpinnerCircle />}>\n * <YourContent />\n * </LoaderOverlay>\n *\n * // Container overlay with custom backdrop\n * <LoaderOverlay\n * loading={isLoading}\n * loader={<SpinnerRing />}\n * position=\"absolute\"\n * backdropOpacity={0.7}\n * blur\n * >\n * <YourContent />\n * </LoaderOverlay>\n * ```\n */\nexport const LoaderOverlay = forwardRef<HTMLDivElement, LoaderOverlayProps>(\n (\n {\n loading = false,\n loader,\n children,\n position = 'fixed',\n backdropOpacity = 0.5,\n backdropColor = '#000000',\n blur = false,\n className,\n style,\n testId = 'loader-overlay',\n ariaLabel = 'Loading content...',\n zIndex = 9999,\n ...rest\n },\n ref\n ) => {\n const backdropStyles = {\n backgroundColor: backdropColor,\n opacity: backdropOpacity,\n backdropFilter: blur ? 'blur(4px)' : undefined,\n WebkitBackdropFilter: blur ? 'blur(4px)' : undefined,\n };\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('relative', className)}\n style={style}\n {...rest}\n >\n {children}\n\n {loading && (\n <div\n className={cn(\n 'inset-0 flex items-center justify-center',\n position === 'fixed' ? 'fixed' : 'absolute'\n )}\n style={{\n zIndex,\n }}\n role=\"status\"\n aria-label={ariaLabel}\n aria-busy=\"true\"\n >\n {/* Backdrop */}\n <div\n className=\"absolute inset-0\"\n style={backdropStyles}\n aria-hidden=\"true\"\n />\n\n {/* Loader */}\n <div className=\"relative z-10\">{loader}</div>\n </div>\n )}\n </div>\n );\n }\n);\n\nLoaderOverlay.displayName = 'LoaderOverlay';\n"],"names":["forwardRef","jsxs","cn","jsx"],"mappings":";;;;;AA6BO,MAAM,gBAAgBA,MAAAA;AAAAA,EAC3B,CACE;AAAA,IACE,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,IAChB,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,GAAG;AAAA,EAAA,GAEL,QACG;AACH,UAAM,iBAAiB;AAAA,MACrB,iBAAiB;AAAA,MACjB,SAAS;AAAA,MACT,gBAAgB,OAAO,cAAc;AAAA,MACrC,sBAAsB,OAAO,cAAc;AAAA,IAAA;AAG7C,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAWC,WAAAA,GAAG,YAAY,SAAS;AAAA,QACnC;AAAA,QACC,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA;AAAA,UAEA,WACCD,2BAAAA;AAAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAWC,WAAAA;AAAAA,gBACT;AAAA,gBACA,aAAa,UAAU,UAAU;AAAA,cAAA;AAAA,cAEnC,OAAO;AAAA,gBACL;AAAA,cAAA;AAAA,cAEF,MAAK;AAAA,cACL,cAAY;AAAA,cACZ,aAAU;AAAA,cAGV,UAAA;AAAA,gBAAAC,2BAAAA;AAAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,WAAU;AAAA,oBACV,OAAO;AAAA,oBACP,eAAY;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAIdA,2BAAAA,IAAC,OAAA,EAAI,WAAU,iBAAiB,UAAA,OAAA,CAAO;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACzC;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,cAAc,cAAc;;"}
|
package/dist/index29.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { cn } from "./index3.js";
|
|
4
|
+
const LoaderOverlay = forwardRef(
|
|
5
|
+
({
|
|
6
|
+
loading = false,
|
|
7
|
+
loader,
|
|
8
|
+
children,
|
|
9
|
+
position = "fixed",
|
|
10
|
+
backdropOpacity = 0.5,
|
|
11
|
+
backdropColor = "#000000",
|
|
12
|
+
blur = false,
|
|
13
|
+
className,
|
|
14
|
+
style,
|
|
15
|
+
testId = "loader-overlay",
|
|
16
|
+
ariaLabel = "Loading content...",
|
|
17
|
+
zIndex = 9999,
|
|
18
|
+
...rest
|
|
19
|
+
}, ref) => {
|
|
20
|
+
const backdropStyles = {
|
|
21
|
+
backgroundColor: backdropColor,
|
|
22
|
+
opacity: backdropOpacity,
|
|
23
|
+
backdropFilter: blur ? "blur(4px)" : void 0,
|
|
24
|
+
WebkitBackdropFilter: blur ? "blur(4px)" : void 0
|
|
25
|
+
};
|
|
26
|
+
return /* @__PURE__ */ jsxs(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
ref,
|
|
30
|
+
"data-testid": testId,
|
|
31
|
+
className: cn("relative", className),
|
|
32
|
+
style,
|
|
33
|
+
...rest,
|
|
34
|
+
children: [
|
|
35
|
+
children,
|
|
36
|
+
loading && /* @__PURE__ */ jsxs(
|
|
37
|
+
"div",
|
|
38
|
+
{
|
|
39
|
+
className: cn(
|
|
40
|
+
"inset-0 flex items-center justify-center",
|
|
41
|
+
position === "fixed" ? "fixed" : "absolute"
|
|
42
|
+
),
|
|
43
|
+
style: {
|
|
44
|
+
zIndex
|
|
45
|
+
},
|
|
46
|
+
role: "status",
|
|
47
|
+
"aria-label": ariaLabel,
|
|
48
|
+
"aria-busy": "true",
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ jsx(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
className: "absolute inset-0",
|
|
54
|
+
style: backdropStyles,
|
|
55
|
+
"aria-hidden": "true"
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
/* @__PURE__ */ jsx("div", { className: "relative z-10", children: loader })
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
LoaderOverlay.displayName = "LoaderOverlay";
|
|
68
|
+
export {
|
|
69
|
+
LoaderOverlay
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=index29.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index29.js","sources":["../src/components/overlay/LoaderOverlay.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { LoaderOverlayProps } from '../../types';\nimport { cn } from '../../utils';\n\n/**\n * LoaderOverlay - Overlay wrapper for displaying loaders over content\n *\n * A flexible overlay component that displays a loader over content during loading states.\n * Supports both full-screen and container-relative positioning.\n *\n * @example\n * ```tsx\n * // Full screen overlay\n * <LoaderOverlay loading={isLoading} loader={<SpinnerCircle />}>\n * <YourContent />\n * </LoaderOverlay>\n *\n * // Container overlay with custom backdrop\n * <LoaderOverlay\n * loading={isLoading}\n * loader={<SpinnerRing />}\n * position=\"absolute\"\n * backdropOpacity={0.7}\n * blur\n * >\n * <YourContent />\n * </LoaderOverlay>\n * ```\n */\nexport const LoaderOverlay = forwardRef<HTMLDivElement, LoaderOverlayProps>(\n (\n {\n loading = false,\n loader,\n children,\n position = 'fixed',\n backdropOpacity = 0.5,\n backdropColor = '#000000',\n blur = false,\n className,\n style,\n testId = 'loader-overlay',\n ariaLabel = 'Loading content...',\n zIndex = 9999,\n ...rest\n },\n ref\n ) => {\n const backdropStyles = {\n backgroundColor: backdropColor,\n opacity: backdropOpacity,\n backdropFilter: blur ? 'blur(4px)' : undefined,\n WebkitBackdropFilter: blur ? 'blur(4px)' : undefined,\n };\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('relative', className)}\n style={style}\n {...rest}\n >\n {children}\n\n {loading && (\n <div\n className={cn(\n 'inset-0 flex items-center justify-center',\n position === 'fixed' ? 'fixed' : 'absolute'\n )}\n style={{\n zIndex,\n }}\n role=\"status\"\n aria-label={ariaLabel}\n aria-busy=\"true\"\n >\n {/* Backdrop */}\n <div\n className=\"absolute inset-0\"\n style={backdropStyles}\n aria-hidden=\"true\"\n />\n\n {/* Loader */}\n <div className=\"relative z-10\">{loader}</div>\n </div>\n )}\n </div>\n );\n }\n);\n\nLoaderOverlay.displayName = 'LoaderOverlay';\n"],"names":[],"mappings":";;;AA6BO,MAAM,gBAAgB;AAAA,EAC3B,CACE;AAAA,IACE,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,IAChB,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,GAAG;AAAA,EAAA,GAEL,QACG;AACH,UAAM,iBAAiB;AAAA,MACrB,iBAAiB;AAAA,MACjB,SAAS;AAAA,MACT,gBAAgB,OAAO,cAAc;AAAA,MACrC,sBAAsB,OAAO,cAAc;AAAA,IAAA;AAG7C,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAW,GAAG,YAAY,SAAS;AAAA,QACnC;AAAA,QACC,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA;AAAA,UAEA,WACC;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAW;AAAA,gBACT;AAAA,gBACA,aAAa,UAAU,UAAU;AAAA,cAAA;AAAA,cAEnC,OAAO;AAAA,gBACL;AAAA,cAAA;AAAA,cAEF,MAAK;AAAA,cACL,cAAY;AAAA,cACZ,aAAU;AAAA,cAGV,UAAA;AAAA,gBAAA;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,WAAU;AAAA,oBACV,OAAO;AAAA,oBACP,eAAY;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAId,oBAAC,OAAA,EAAI,WAAU,iBAAiB,UAAA,OAAA,CAAO;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACzC;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,cAAc,cAAc;"}
|
package/dist/index3.cjs
CHANGED
package/dist/index3.js
CHANGED
package/dist/index30.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=index30.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index30.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/index30.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=index30.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index30.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/index4.cjs
CHANGED
|
@@ -1,15 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
function
|
|
3
|
+
function isHexColor(color) {
|
|
4
|
+
return /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(color);
|
|
5
|
+
}
|
|
6
|
+
function isRgbColor(color) {
|
|
7
|
+
return /^rgba?\([\d\s,./]+\)$/.test(color);
|
|
8
|
+
}
|
|
9
|
+
function hexToRgb(hex) {
|
|
10
|
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
11
|
+
return result ? {
|
|
12
|
+
r: parseInt(result[1], 16),
|
|
13
|
+
g: parseInt(result[2], 16),
|
|
14
|
+
b: parseInt(result[3], 16)
|
|
15
|
+
} : null;
|
|
16
|
+
}
|
|
17
|
+
function getAnimationDuration(speed = "normal") {
|
|
4
18
|
if (typeof speed === "number") {
|
|
5
|
-
|
|
19
|
+
const validSpeed = !isNaN(speed) && speed > 0 ? Math.max(50, Math.min(1e4, speed)) : 1e3;
|
|
20
|
+
return `${validSpeed}ms`;
|
|
6
21
|
}
|
|
7
22
|
const speedMap = {
|
|
8
23
|
slow: "2s",
|
|
9
24
|
normal: "1s",
|
|
10
25
|
fast: "0.5s"
|
|
11
26
|
};
|
|
12
|
-
return speedMap[speed];
|
|
27
|
+
return speedMap[speed] || speedMap.normal;
|
|
13
28
|
}
|
|
14
29
|
function normalizeSize(size) {
|
|
15
30
|
if (typeof size === "number") {
|
|
@@ -17,6 +32,51 @@ function normalizeSize(size) {
|
|
|
17
32
|
}
|
|
18
33
|
return size || "auto";
|
|
19
34
|
}
|
|
35
|
+
function parseSizeToNumber(size, fallback) {
|
|
36
|
+
if (typeof size === "number") {
|
|
37
|
+
return !isNaN(size) && size > 0 ? size : fallback;
|
|
38
|
+
}
|
|
39
|
+
if (typeof size === "string") {
|
|
40
|
+
const parsed = parseInt(size, 10);
|
|
41
|
+
return !isNaN(parsed) && parsed > 0 ? parsed : fallback;
|
|
42
|
+
}
|
|
43
|
+
return fallback;
|
|
44
|
+
}
|
|
45
|
+
function getColorLuminance(color) {
|
|
46
|
+
if (isHexColor(color)) {
|
|
47
|
+
const rgb = hexToRgb(color);
|
|
48
|
+
if (rgb) {
|
|
49
|
+
const { r, g, b } = rgb;
|
|
50
|
+
const [rs, gs, bs] = [r, g, b].map((c) => {
|
|
51
|
+
const val = c / 255;
|
|
52
|
+
return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);
|
|
53
|
+
});
|
|
54
|
+
return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (isRgbColor(color)) {
|
|
58
|
+
const match = color.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
|
|
59
|
+
if (match) {
|
|
60
|
+
const [, r, g, b] = match.map(Number);
|
|
61
|
+
const [rs, gs, bs] = [r, g, b].map((c) => {
|
|
62
|
+
const val = c / 255;
|
|
63
|
+
return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);
|
|
64
|
+
});
|
|
65
|
+
return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return 0.5;
|
|
69
|
+
}
|
|
70
|
+
function getContrastColor(backgroundColor) {
|
|
71
|
+
const luminance = getColorLuminance(backgroundColor);
|
|
72
|
+
return luminance < 0.5 ? "#ffffff" : "#000000";
|
|
73
|
+
}
|
|
20
74
|
exports.getAnimationDuration = getAnimationDuration;
|
|
75
|
+
exports.getColorLuminance = getColorLuminance;
|
|
76
|
+
exports.getContrastColor = getContrastColor;
|
|
77
|
+
exports.hexToRgb = hexToRgb;
|
|
78
|
+
exports.isHexColor = isHexColor;
|
|
79
|
+
exports.isRgbColor = isRgbColor;
|
|
21
80
|
exports.normalizeSize = normalizeSize;
|
|
81
|
+
exports.parseSizeToNumber = parseSizeToNumber;
|
|
22
82
|
//# sourceMappingURL=index4.cjs.map
|
package/dist/index4.cjs.map
CHANGED
|
@@ -1 +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 `${
|
|
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 = 'normal'): string {\n if (typeof speed === 'number') {\n // Validate number is valid and positive, clamp to reasonable range (50ms - 10000ms)\n const validSpeed = !isNaN(speed) && speed > 0 ? Math.max(50, Math.min(10000, speed)) : 1000;\n return `${validSpeed}ms`;\n }\n\n const speedMap = {\n slow: '2s',\n normal: '1s',\n fast: '0.5s',\n };\n\n return speedMap[speed] || speedMap.normal;\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\n/**\n * Safely parse size to number with fallback\n */\nexport function parseSizeToNumber(size: number | string | undefined, fallback: number): number {\n if (typeof size === 'number') {\n return !isNaN(size) && size > 0 ? size : fallback;\n }\n\n if (typeof size === 'string') {\n const parsed = parseInt(size, 10);\n return !isNaN(parsed) && parsed > 0 ? parsed : fallback;\n }\n\n return fallback;\n}\n\n/**\n * Calculate relative luminance of a color (0-1 scale)\n * Used for determining if text should be light or dark for contrast\n */\nexport function getColorLuminance(color: string): number {\n // Try to parse hex color\n if (isHexColor(color)) {\n const rgb = hexToRgb(color);\n if (rgb) {\n // Convert RGB to relative luminance using WCAG formula\n const { r, g, b } = rgb;\n const [rs, gs, bs] = [r, g, b].map((c) => {\n const val = c / 255;\n return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);\n });\n return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;\n }\n }\n\n // Try to parse RGB/RGBA color\n if (isRgbColor(color)) {\n const match = color.match(/rgba?\\((\\d+),\\s*(\\d+),\\s*(\\d+)/);\n if (match) {\n const [, r, g, b] = match.map(Number);\n const [rs, gs, bs] = [r, g, b].map((c) => {\n const val = c / 255;\n return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);\n });\n return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;\n }\n }\n\n // Default to 0.5 (medium luminance) if unable to parse\n return 0.5;\n}\n\n/**\n * Get contrast color (black or white) based on background luminance\n */\nexport function getContrastColor(backgroundColor: string): string {\n const luminance = getColorLuminance(backgroundColor);\n // WCAG standard: use white text on dark backgrounds (luminance < 0.5)\n return luminance < 0.5 ? '#ffffff' : '#000000';\n}\n"],"names":[],"mappings":";;AAGO,SAAS,WAAW,OAAwB;AACjD,SAAO,qCAAqC,KAAK,KAAK;AACxD;AAKO,SAAS,WAAW,OAAwB;AACjD,SAAO,wBAAwB,KAAK,KAAK;AAC3C;AAKO,SAAS,SAAS,KAAyD;AAChF,QAAM,SAAS,4CAA4C,KAAK,GAAG;AACnE,SAAO,SACH;AAAA,IACE,GAAG,SAAS,OAAO,CAAC,GAAG,EAAE;AAAA,IACzB,GAAG,SAAS,OAAO,CAAC,GAAG,EAAE;AAAA,IACzB,GAAG,SAAS,OAAO,CAAC,GAAG,EAAE;AAAA,EAAA,IAE3B;AACN;AAKO,SAAS,qBAAqB,QAA6C,UAAkB;AAClG,MAAI,OAAO,UAAU,UAAU;AAE7B,UAAM,aAAa,CAAC,MAAM,KAAK,KAAK,QAAQ,IAAI,KAAK,IAAI,IAAI,KAAK,IAAI,KAAO,KAAK,CAAC,IAAI;AACvF,WAAO,GAAG,UAAU;AAAA,EACtB;AAEA,QAAM,WAAW;AAAA,IACf,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,MAAM;AAAA,EAAA;AAGR,SAAO,SAAS,KAAK,KAAK,SAAS;AACrC;AAKO,SAAS,cAAc,MAAgC;AAC5D,MAAI,OAAO,SAAS,UAAU;AAC5B,WAAO,GAAG,IAAI;AAAA,EAChB;AACA,SAAO,QAAQ;AACjB;AAKO,SAAS,kBAAkB,MAAmC,UAA0B;AAC7F,MAAI,OAAO,SAAS,UAAU;AAC5B,WAAO,CAAC,MAAM,IAAI,KAAK,OAAO,IAAI,OAAO;AAAA,EAC3C;AAEA,MAAI,OAAO,SAAS,UAAU;AAC5B,UAAM,SAAS,SAAS,MAAM,EAAE;AAChC,WAAO,CAAC,MAAM,MAAM,KAAK,SAAS,IAAI,SAAS;AAAA,EACjD;AAEA,SAAO;AACT;AAMO,SAAS,kBAAkB,OAAuB;AAEvD,MAAI,WAAW,KAAK,GAAG;AACrB,UAAM,MAAM,SAAS,KAAK;AAC1B,QAAI,KAAK;AAEP,YAAM,EAAE,GAAG,GAAG,EAAA,IAAM;AACpB,YAAM,CAAC,IAAI,IAAI,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC,EAAE,IAAI,CAAC,MAAM;AACxC,cAAM,MAAM,IAAI;AAChB,eAAO,OAAO,UAAU,MAAM,QAAQ,KAAK,KAAK,MAAM,SAAS,OAAO,GAAG;AAAA,MAC3E,CAAC;AACD,aAAO,SAAS,KAAK,SAAS,KAAK,SAAS;AAAA,IAC9C;AAAA,EACF;AAGA,MAAI,WAAW,KAAK,GAAG;AACrB,UAAM,QAAQ,MAAM,MAAM,gCAAgC;AAC1D,QAAI,OAAO;AACT,YAAM,CAAA,EAAG,GAAG,GAAG,CAAC,IAAI,MAAM,IAAI,MAAM;AACpC,YAAM,CAAC,IAAI,IAAI,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC,EAAE,IAAI,CAAC,MAAM;AACxC,cAAM,MAAM,IAAI;AAChB,eAAO,OAAO,UAAU,MAAM,QAAQ,KAAK,KAAK,MAAM,SAAS,OAAO,GAAG;AAAA,MAC3E,CAAC;AACD,aAAO,SAAS,KAAK,SAAS,KAAK,SAAS;AAAA,IAC9C;AAAA,EACF;AAGA,SAAO;AACT;AAKO,SAAS,iBAAiB,iBAAiC;AAChE,QAAM,YAAY,kBAAkB,eAAe;AAEnD,SAAO,YAAY,MAAM,YAAY;AACvC;;;;;;;;;"}
|
package/dist/index4.js
CHANGED
|
@@ -1,13 +1,28 @@
|
|
|
1
|
-
function
|
|
1
|
+
function isHexColor(color) {
|
|
2
|
+
return /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(color);
|
|
3
|
+
}
|
|
4
|
+
function isRgbColor(color) {
|
|
5
|
+
return /^rgba?\([\d\s,./]+\)$/.test(color);
|
|
6
|
+
}
|
|
7
|
+
function hexToRgb(hex) {
|
|
8
|
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
9
|
+
return result ? {
|
|
10
|
+
r: parseInt(result[1], 16),
|
|
11
|
+
g: parseInt(result[2], 16),
|
|
12
|
+
b: parseInt(result[3], 16)
|
|
13
|
+
} : null;
|
|
14
|
+
}
|
|
15
|
+
function getAnimationDuration(speed = "normal") {
|
|
2
16
|
if (typeof speed === "number") {
|
|
3
|
-
|
|
17
|
+
const validSpeed = !isNaN(speed) && speed > 0 ? Math.max(50, Math.min(1e4, speed)) : 1e3;
|
|
18
|
+
return `${validSpeed}ms`;
|
|
4
19
|
}
|
|
5
20
|
const speedMap = {
|
|
6
21
|
slow: "2s",
|
|
7
22
|
normal: "1s",
|
|
8
23
|
fast: "0.5s"
|
|
9
24
|
};
|
|
10
|
-
return speedMap[speed];
|
|
25
|
+
return speedMap[speed] || speedMap.normal;
|
|
11
26
|
}
|
|
12
27
|
function normalizeSize(size) {
|
|
13
28
|
if (typeof size === "number") {
|
|
@@ -15,8 +30,53 @@ function normalizeSize(size) {
|
|
|
15
30
|
}
|
|
16
31
|
return size || "auto";
|
|
17
32
|
}
|
|
33
|
+
function parseSizeToNumber(size, fallback) {
|
|
34
|
+
if (typeof size === "number") {
|
|
35
|
+
return !isNaN(size) && size > 0 ? size : fallback;
|
|
36
|
+
}
|
|
37
|
+
if (typeof size === "string") {
|
|
38
|
+
const parsed = parseInt(size, 10);
|
|
39
|
+
return !isNaN(parsed) && parsed > 0 ? parsed : fallback;
|
|
40
|
+
}
|
|
41
|
+
return fallback;
|
|
42
|
+
}
|
|
43
|
+
function getColorLuminance(color) {
|
|
44
|
+
if (isHexColor(color)) {
|
|
45
|
+
const rgb = hexToRgb(color);
|
|
46
|
+
if (rgb) {
|
|
47
|
+
const { r, g, b } = rgb;
|
|
48
|
+
const [rs, gs, bs] = [r, g, b].map((c) => {
|
|
49
|
+
const val = c / 255;
|
|
50
|
+
return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);
|
|
51
|
+
});
|
|
52
|
+
return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (isRgbColor(color)) {
|
|
56
|
+
const match = color.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
|
|
57
|
+
if (match) {
|
|
58
|
+
const [, r, g, b] = match.map(Number);
|
|
59
|
+
const [rs, gs, bs] = [r, g, b].map((c) => {
|
|
60
|
+
const val = c / 255;
|
|
61
|
+
return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);
|
|
62
|
+
});
|
|
63
|
+
return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return 0.5;
|
|
67
|
+
}
|
|
68
|
+
function getContrastColor(backgroundColor) {
|
|
69
|
+
const luminance = getColorLuminance(backgroundColor);
|
|
70
|
+
return luminance < 0.5 ? "#ffffff" : "#000000";
|
|
71
|
+
}
|
|
18
72
|
export {
|
|
19
73
|
getAnimationDuration,
|
|
20
|
-
|
|
74
|
+
getColorLuminance,
|
|
75
|
+
getContrastColor,
|
|
76
|
+
hexToRgb,
|
|
77
|
+
isHexColor,
|
|
78
|
+
isRgbColor,
|
|
79
|
+
normalizeSize,
|
|
80
|
+
parseSizeToNumber
|
|
21
81
|
};
|
|
22
82
|
//# sourceMappingURL=index4.js.map
|
package/dist/index4.js.map
CHANGED
|
@@ -1 +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 `${
|
|
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 = 'normal'): string {\n if (typeof speed === 'number') {\n // Validate number is valid and positive, clamp to reasonable range (50ms - 10000ms)\n const validSpeed = !isNaN(speed) && speed > 0 ? Math.max(50, Math.min(10000, speed)) : 1000;\n return `${validSpeed}ms`;\n }\n\n const speedMap = {\n slow: '2s',\n normal: '1s',\n fast: '0.5s',\n };\n\n return speedMap[speed] || speedMap.normal;\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\n/**\n * Safely parse size to number with fallback\n */\nexport function parseSizeToNumber(size: number | string | undefined, fallback: number): number {\n if (typeof size === 'number') {\n return !isNaN(size) && size > 0 ? size : fallback;\n }\n\n if (typeof size === 'string') {\n const parsed = parseInt(size, 10);\n return !isNaN(parsed) && parsed > 0 ? parsed : fallback;\n }\n\n return fallback;\n}\n\n/**\n * Calculate relative luminance of a color (0-1 scale)\n * Used for determining if text should be light or dark for contrast\n */\nexport function getColorLuminance(color: string): number {\n // Try to parse hex color\n if (isHexColor(color)) {\n const rgb = hexToRgb(color);\n if (rgb) {\n // Convert RGB to relative luminance using WCAG formula\n const { r, g, b } = rgb;\n const [rs, gs, bs] = [r, g, b].map((c) => {\n const val = c / 255;\n return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);\n });\n return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;\n }\n }\n\n // Try to parse RGB/RGBA color\n if (isRgbColor(color)) {\n const match = color.match(/rgba?\\((\\d+),\\s*(\\d+),\\s*(\\d+)/);\n if (match) {\n const [, r, g, b] = match.map(Number);\n const [rs, gs, bs] = [r, g, b].map((c) => {\n const val = c / 255;\n return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);\n });\n return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;\n }\n }\n\n // Default to 0.5 (medium luminance) if unable to parse\n return 0.5;\n}\n\n/**\n * Get contrast color (black or white) based on background luminance\n */\nexport function getContrastColor(backgroundColor: string): string {\n const luminance = getColorLuminance(backgroundColor);\n // WCAG standard: use white text on dark backgrounds (luminance < 0.5)\n return luminance < 0.5 ? '#ffffff' : '#000000';\n}\n"],"names":[],"mappings":"AAGO,SAAS,WAAW,OAAwB;AACjD,SAAO,qCAAqC,KAAK,KAAK;AACxD;AAKO,SAAS,WAAW,OAAwB;AACjD,SAAO,wBAAwB,KAAK,KAAK;AAC3C;AAKO,SAAS,SAAS,KAAyD;AAChF,QAAM,SAAS,4CAA4C,KAAK,GAAG;AACnE,SAAO,SACH;AAAA,IACE,GAAG,SAAS,OAAO,CAAC,GAAG,EAAE;AAAA,IACzB,GAAG,SAAS,OAAO,CAAC,GAAG,EAAE;AAAA,IACzB,GAAG,SAAS,OAAO,CAAC,GAAG,EAAE;AAAA,EAAA,IAE3B;AACN;AAKO,SAAS,qBAAqB,QAA6C,UAAkB;AAClG,MAAI,OAAO,UAAU,UAAU;AAE7B,UAAM,aAAa,CAAC,MAAM,KAAK,KAAK,QAAQ,IAAI,KAAK,IAAI,IAAI,KAAK,IAAI,KAAO,KAAK,CAAC,IAAI;AACvF,WAAO,GAAG,UAAU;AAAA,EACtB;AAEA,QAAM,WAAW;AAAA,IACf,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,MAAM;AAAA,EAAA;AAGR,SAAO,SAAS,KAAK,KAAK,SAAS;AACrC;AAKO,SAAS,cAAc,MAAgC;AAC5D,MAAI,OAAO,SAAS,UAAU;AAC5B,WAAO,GAAG,IAAI;AAAA,EAChB;AACA,SAAO,QAAQ;AACjB;AAKO,SAAS,kBAAkB,MAAmC,UAA0B;AAC7F,MAAI,OAAO,SAAS,UAAU;AAC5B,WAAO,CAAC,MAAM,IAAI,KAAK,OAAO,IAAI,OAAO;AAAA,EAC3C;AAEA,MAAI,OAAO,SAAS,UAAU;AAC5B,UAAM,SAAS,SAAS,MAAM,EAAE;AAChC,WAAO,CAAC,MAAM,MAAM,KAAK,SAAS,IAAI,SAAS;AAAA,EACjD;AAEA,SAAO;AACT;AAMO,SAAS,kBAAkB,OAAuB;AAEvD,MAAI,WAAW,KAAK,GAAG;AACrB,UAAM,MAAM,SAAS,KAAK;AAC1B,QAAI,KAAK;AAEP,YAAM,EAAE,GAAG,GAAG,EAAA,IAAM;AACpB,YAAM,CAAC,IAAI,IAAI,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC,EAAE,IAAI,CAAC,MAAM;AACxC,cAAM,MAAM,IAAI;AAChB,eAAO,OAAO,UAAU,MAAM,QAAQ,KAAK,KAAK,MAAM,SAAS,OAAO,GAAG;AAAA,MAC3E,CAAC;AACD,aAAO,SAAS,KAAK,SAAS,KAAK,SAAS;AAAA,IAC9C;AAAA,EACF;AAGA,MAAI,WAAW,KAAK,GAAG;AACrB,UAAM,QAAQ,MAAM,MAAM,gCAAgC;AAC1D,QAAI,OAAO;AACT,YAAM,CAAA,EAAG,GAAG,GAAG,CAAC,IAAI,MAAM,IAAI,MAAM;AACpC,YAAM,CAAC,IAAI,IAAI,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC,EAAE,IAAI,CAAC,MAAM;AACxC,cAAM,MAAM,IAAI;AAChB,eAAO,OAAO,UAAU,MAAM,QAAQ,KAAK,KAAK,MAAM,SAAS,OAAO,GAAG;AAAA,MAC3E,CAAC;AACD,aAAO,SAAS,KAAK,SAAS,KAAK,SAAS;AAAA,IAC9C;AAAA,EACF;AAGA,SAAO;AACT;AAKO,SAAS,iBAAiB,iBAAiC;AAChE,QAAM,YAAY,kBAAkB,eAAe;AAEnD,SAAO,YAAY,MAAM,YAAY;AACvC;"}
|