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.
Files changed (128) hide show
  1. package/dist/components/progress/ProgressBar.d.ts +2 -0
  2. package/dist/components/progress/ProgressBar.d.ts.map +1 -1
  3. package/dist/components/progress/ProgressCircle.d.ts +2 -1
  4. package/dist/components/progress/ProgressCircle.d.ts.map +1 -1
  5. package/dist/components/progress/ProgressRing.d.ts +2 -1
  6. package/dist/components/progress/ProgressRing.d.ts.map +1 -1
  7. package/dist/components/progress/ProgressSteps.d.ts +16 -0
  8. package/dist/components/progress/ProgressSteps.d.ts.map +1 -0
  9. package/dist/components/progress/index.d.ts +1 -0
  10. package/dist/components/progress/index.d.ts.map +1 -1
  11. package/dist/components/pulse/TypingIndicator.d.ts +16 -0
  12. package/dist/components/pulse/TypingIndicator.d.ts.map +1 -0
  13. package/dist/components/pulse/index.d.ts +1 -0
  14. package/dist/components/pulse/index.d.ts.map +1 -1
  15. package/dist/components/skeleton/SkeletonForm.d.ts +16 -0
  16. package/dist/components/skeleton/SkeletonForm.d.ts.map +1 -0
  17. package/dist/components/skeleton/SkeletonText.d.ts +1 -1
  18. package/dist/components/skeleton/SkeletonText.d.ts.map +1 -1
  19. package/dist/components/skeleton/index.d.ts +1 -0
  20. package/dist/components/skeleton/index.d.ts.map +1 -1
  21. package/dist/components/spinner/SpinnerDots.d.ts.map +1 -1
  22. package/dist/components/spinner/SpinnerPulse.d.ts +15 -0
  23. package/dist/components/spinner/SpinnerPulse.d.ts.map +1 -0
  24. package/dist/components/spinner/SpinnerRing.d.ts +1 -0
  25. package/dist/components/spinner/SpinnerRing.d.ts.map +1 -1
  26. package/dist/components/spinner/SpinnerWave.d.ts +15 -0
  27. package/dist/components/spinner/SpinnerWave.d.ts.map +1 -0
  28. package/dist/components/spinner/index.d.ts +2 -0
  29. package/dist/components/spinner/index.d.ts.map +1 -1
  30. package/dist/index.cjs +23 -13
  31. package/dist/index.cjs.map +1 -1
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.js +23 -13
  34. package/dist/index.js.map +1 -1
  35. package/dist/index13.cjs +54 -35
  36. package/dist/index13.cjs.map +1 -1
  37. package/dist/index13.js +56 -37
  38. package/dist/index13.js.map +1 -1
  39. package/dist/index14.cjs +23 -11
  40. package/dist/index14.cjs.map +1 -1
  41. package/dist/index14.js +23 -11
  42. package/dist/index14.js.map +1 -1
  43. package/dist/index15.cjs +10 -32
  44. package/dist/index15.cjs.map +1 -1
  45. package/dist/index15.js +10 -32
  46. package/dist/index15.js.map +1 -1
  47. package/dist/index16.cjs +41 -24
  48. package/dist/index16.cjs.map +1 -1
  49. package/dist/index16.js +42 -25
  50. package/dist/index16.js.map +1 -1
  51. package/dist/index17.cjs +24 -37
  52. package/dist/index17.cjs.map +1 -1
  53. package/dist/index17.js +24 -37
  54. package/dist/index17.js.map +1 -1
  55. package/dist/index18.cjs +48 -58
  56. package/dist/index18.cjs.map +1 -1
  57. package/dist/index18.js +49 -59
  58. package/dist/index18.js.map +1 -1
  59. package/dist/index19.cjs +41 -83
  60. package/dist/index19.cjs.map +1 -1
  61. package/dist/index19.js +42 -84
  62. package/dist/index19.js.map +1 -1
  63. package/dist/index20.cjs +54 -87
  64. package/dist/index20.cjs.map +1 -1
  65. package/dist/index20.js +55 -88
  66. package/dist/index20.js.map +1 -1
  67. package/dist/index21.cjs +73 -27
  68. package/dist/index21.cjs.map +1 -1
  69. package/dist/index21.js +76 -30
  70. package/dist/index21.js.map +1 -1
  71. package/dist/index22.cjs +98 -31
  72. package/dist/index22.cjs.map +1 -1
  73. package/dist/index22.js +100 -33
  74. package/dist/index22.js.map +1 -1
  75. package/dist/index23.cjs +104 -33
  76. package/dist/index23.cjs.map +1 -1
  77. package/dist/index23.js +107 -36
  78. package/dist/index23.js.map +1 -1
  79. package/dist/index24.cjs +108 -48
  80. package/dist/index24.cjs.map +1 -1
  81. package/dist/index24.js +110 -50
  82. package/dist/index24.js.map +1 -1
  83. package/dist/index25.cjs +55 -16
  84. package/dist/index25.cjs.map +1 -1
  85. package/dist/index25.js +54 -15
  86. package/dist/index25.js.map +1 -1
  87. package/dist/index26.cjs +62 -0
  88. package/dist/index26.cjs.map +1 -0
  89. package/dist/index26.js +62 -0
  90. package/dist/index26.js.map +1 -0
  91. package/dist/index27.cjs +64 -0
  92. package/dist/index27.cjs.map +1 -0
  93. package/dist/index27.js +64 -0
  94. package/dist/index27.js.map +1 -0
  95. package/dist/index28.cjs +61 -0
  96. package/dist/index28.cjs.map +1 -0
  97. package/dist/index28.js +61 -0
  98. package/dist/index28.js.map +1 -0
  99. package/dist/index29.cjs +71 -0
  100. package/dist/index29.cjs.map +1 -0
  101. package/dist/index29.js +71 -0
  102. package/dist/index29.js.map +1 -0
  103. package/dist/index3.cjs +1 -1
  104. package/dist/index3.js +1 -1
  105. package/dist/index30.cjs +18 -0
  106. package/dist/index30.cjs.map +1 -0
  107. package/dist/index30.js +18 -0
  108. package/dist/index30.js.map +1 -0
  109. package/dist/index4.cjs +63 -3
  110. package/dist/index4.cjs.map +1 -1
  111. package/dist/index4.js +64 -4
  112. package/dist/index4.js.map +1 -1
  113. package/dist/index6.cjs +2 -1
  114. package/dist/index6.cjs.map +1 -1
  115. package/dist/index6.js +2 -1
  116. package/dist/index6.js.map +1 -1
  117. package/dist/premium-react-loaders.css +32 -0
  118. package/dist/types/progress.d.ts +32 -1
  119. package/dist/types/progress.d.ts.map +1 -1
  120. package/dist/types/pulse.d.ts +13 -0
  121. package/dist/types/pulse.d.ts.map +1 -1
  122. package/dist/types/skeleton.d.ts +19 -0
  123. package/dist/types/skeleton.d.ts.map +1 -1
  124. package/dist/types/spinner.d.ts +18 -0
  125. package/dist/types/spinner.d.ts.map +1 -1
  126. package/dist/utils/colors.d.ts +14 -1
  127. package/dist/utils/colors.d.ts.map +1 -1
  128. package/package.json +1 -1
package/dist/index16.js CHANGED
@@ -1,58 +1,75 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { normalizeSize, getAnimationDuration } from "./index4.js";
3
+ import { getAnimationDuration, normalizeSize, parseSizeToNumber } from "./index4.js";
4
4
  import { cn } from "./index3.js";
5
- const SpinnerBars = forwardRef(
5
+ const SpinnerDots = forwardRef(
6
6
  ({
7
7
  size = 40,
8
8
  color = "#3b82f6",
9
- barCount = 5,
9
+ dotCount = 8,
10
+ dotSize = 4,
10
11
  speed = "normal",
11
12
  className,
12
13
  style,
13
- testId = "spinner-bars",
14
+ testId = "spinner-dots",
14
15
  visible = true,
15
16
  ariaLabel = "Loading...",
16
17
  ...rest
17
18
  }, ref) => {
18
19
  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);
20
+ const sizeValue = parseSizeToNumber(size, 40);
21
+ const dotSizeValue = parseSizeToNumber(dotSize, 4);
22
+ const radius = (sizeValue - dotSizeValue) / 2;
22
23
  return /* @__PURE__ */ jsx(
23
24
  "div",
24
25
  {
25
26
  ref,
26
27
  "data-testid": testId,
27
- className: cn("inline-flex items-center justify-center gap-1", className),
28
- style: {
29
- height: normalizeSize(size),
30
- ...style
31
- },
28
+ className: cn("inline-flex items-center justify-center", className),
29
+ style,
32
30
  role: "status",
33
31
  "aria-label": ariaLabel,
34
32
  "aria-busy": "true",
35
33
  ...rest,
36
- children: Array.from({ length: barCount }).map((_, index) => /* @__PURE__ */ jsx(
34
+ children: /* @__PURE__ */ jsx(
37
35
  "div",
38
36
  {
39
- className: "rounded-sm",
37
+ className: "relative",
40
38
  style: {
41
- width: `${barWidth}px`,
42
- height: "100%",
43
- backgroundColor: color,
44
- animation: `pulse-wave ${animationDuration} ease-in-out infinite`,
45
- animationDelay: `${index * 0.1}s`
46
- }
47
- },
48
- index
49
- ))
39
+ width: normalizeSize(size),
40
+ height: normalizeSize(size),
41
+ animation: `spinner-rotate ${getAnimationDuration(speed)} linear infinite`
42
+ },
43
+ children: Array.from({ length: dotCount }).map((_, index) => {
44
+ const angle = 360 / dotCount * index;
45
+ const radian = angle * Math.PI / 180;
46
+ const x = radius * Math.cos(radian) + radius;
47
+ const y = radius * Math.sin(radian) + radius;
48
+ return /* @__PURE__ */ jsx(
49
+ "div",
50
+ {
51
+ className: "absolute rounded-full",
52
+ style: {
53
+ width: normalizeSize(dotSize),
54
+ height: normalizeSize(dotSize),
55
+ backgroundColor: color,
56
+ left: `${x}px`,
57
+ top: `${y}px`,
58
+ opacity: 1 - index / dotCount * 0.7
59
+ // Fade effect
60
+ }
61
+ },
62
+ index
63
+ );
64
+ })
65
+ }
66
+ )
50
67
  }
51
68
  );
52
69
  }
53
70
  );
54
- SpinnerBars.displayName = "SpinnerBars";
71
+ SpinnerDots.displayName = "SpinnerDots";
55
72
  export {
56
- SpinnerBars
73
+ SpinnerDots
57
74
  };
58
75
  //# sourceMappingURL=index16.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index16.js","sources":["../src/components/spinner/SpinnerBars.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerBarsProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration } from '../../utils';\n\n/**\n * SpinnerBars - Vertical bars with wave animation\n *\n * A spinner with vertical bars that animate in a wave pattern.\n *\n * @example\n * ```tsx\n * <SpinnerBars size={40} color=\"#3b82f6\" />\n * <SpinnerBars size={32} barCount={5} speed=\"fast\" />\n * ```\n */\nexport const SpinnerBars = forwardRef<HTMLDivElement, SpinnerBarsProps>(\n (\n {\n size = 40,\n color = '#3b82f6',\n barCount = 5,\n speed = 'normal',\n className,\n style,\n testId = 'spinner-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 <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: `${index * 0.1}s`,\n }}\n />\n ))}\n </div>\n );\n }\n);\n\nSpinnerBars.displayName = 'SpinnerBars';\n"],"names":[],"mappings":";;;;AAeO,MAAM,cAAc;AAAA,EACzB,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,UAAU,EAAE,IAAI,CAAC,GAAG,UACxC;AAAA,UAAC;AAAA,UAAA;AAAA,YAEC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,OAAO,GAAG,QAAQ;AAAA,cAClB,QAAQ;AAAA,cACR,iBAAiB;AAAA,cACjB,WAAW,cAAc,iBAAiB;AAAA,cAC1C,gBAAgB,GAAG,QAAQ,GAAG;AAAA,YAAA;AAAA,UAChC;AAAA,UARK;AAAA,QAAA,CAUR;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,YAAY,cAAc;"}
1
+ {"version":3,"file":"index16.js","sources":["../src/components/spinner/SpinnerDots.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerDotsProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration, parseSizeToNumber } from '../../utils';\n\n/**\n * SpinnerDots - Multiple dots rotating around center\n *\n * A spinner with multiple dots arranged in a circle that rotates continuously.\n *\n * @example\n * ```tsx\n * <SpinnerDots size={40} color=\"#3b82f6\" />\n * <SpinnerDots size={48} dotCount={8} dotSize={6} />\n * ```\n */\nexport const SpinnerDots = forwardRef<HTMLDivElement, SpinnerDotsProps>(\n (\n {\n size = 40,\n color = '#3b82f6',\n dotCount = 8,\n dotSize = 4,\n speed = 'normal',\n className,\n style,\n testId = 'spinner-dots',\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 dotSizeValue = parseSizeToNumber(dotSize, 4);\n const radius = (sizeValue - dotSizeValue) / 2;\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('inline-flex items-center justify-center', className)}\n style={style}\n role=\"status\"\n aria-label={ariaLabel}\n aria-busy=\"true\"\n {...rest}\n >\n <div\n className=\"relative\"\n style={{\n width: normalizeSize(size),\n height: normalizeSize(size),\n animation: `spinner-rotate ${getAnimationDuration(speed)} linear infinite`,\n }}\n >\n {Array.from({ length: dotCount }).map((_, index) => {\n const angle = (360 / dotCount) * index;\n const radian = (angle * Math.PI) / 180;\n const x = radius * Math.cos(radian) + radius;\n const y = radius * Math.sin(radian) + radius;\n\n return (\n <div\n key={index}\n className=\"absolute rounded-full\"\n style={{\n width: normalizeSize(dotSize),\n height: normalizeSize(dotSize),\n backgroundColor: color,\n left: `${x}px`,\n top: `${y}px`,\n opacity: 1 - (index / dotCount) * 0.7, // Fade effect\n }}\n />\n );\n })}\n </div>\n </div>\n );\n }\n);\n\nSpinnerDots.displayName = 'SpinnerDots';\n"],"names":[],"mappings":";;;;AAeO,MAAM,cAAc;AAAA,EACzB,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,YAAY,kBAAkB,MAAM,EAAE;AAC5C,UAAM,eAAe,kBAAkB,SAAS,CAAC;AACjD,UAAM,UAAU,YAAY,gBAAgB;AAE5C,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAW,GAAG,2CAA2C,SAAS;AAAA,QAClE;AAAA,QACA,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,OAAO,cAAc,IAAI;AAAA,cACzB,QAAQ,cAAc,IAAI;AAAA,cAC1B,WAAW,kBAAkB,qBAAqB,KAAK,CAAC;AAAA,YAAA;AAAA,YAGzD,UAAA,MAAM,KAAK,EAAE,QAAQ,SAAA,CAAU,EAAE,IAAI,CAAC,GAAG,UAAU;AAClD,oBAAM,QAAS,MAAM,WAAY;AACjC,oBAAM,SAAU,QAAQ,KAAK,KAAM;AACnC,oBAAM,IAAI,SAAS,KAAK,IAAI,MAAM,IAAI;AACtC,oBAAM,IAAI,SAAS,KAAK,IAAI,MAAM,IAAI;AAEtC,qBACE;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBAEC,WAAU;AAAA,kBACV,OAAO;AAAA,oBACL,OAAO,cAAc,OAAO;AAAA,oBAC5B,QAAQ,cAAc,OAAO;AAAA,oBAC7B,iBAAiB;AAAA,oBACjB,MAAM,GAAG,CAAC;AAAA,oBACV,KAAK,GAAG,CAAC;AAAA,oBACT,SAAS,IAAK,QAAQ,WAAY;AAAA;AAAA,kBAAA;AAAA,gBACpC;AAAA,gBATK;AAAA,cAAA;AAAA,YAYX,CAAC;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,YAAY,cAAc;"}
package/dist/index17.cjs CHANGED
@@ -2,70 +2,57 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const react = require("react");
5
- const classNames = require("./index3.cjs");
6
5
  const colors = require("./index4.cjs");
7
- const SpinnerGrid = react.forwardRef(
6
+ const classNames = require("./index3.cjs");
7
+ const SpinnerBars = react.forwardRef(
8
8
  ({
9
9
  size = 40,
10
10
  color = "#3b82f6",
11
- gridSize = 3,
11
+ barCount = 5,
12
12
  speed = "normal",
13
13
  className,
14
14
  style,
15
- testId = "spinner-grid",
15
+ testId = "spinner-bars",
16
16
  visible = true,
17
17
  ariaLabel = "Loading...",
18
18
  ...rest
19
19
  }, ref) => {
20
20
  if (!visible) return null;
21
- const sizeValue = typeof size === "number" ? size : parseInt(String(size), 10);
22
- const cellSize = Math.floor(sizeValue / gridSize) - 2;
21
+ const sizeValue = colors.parseSizeToNumber(size, 40);
22
+ const barWidth = Math.floor(sizeValue / (barCount * 2));
23
23
  const animationDuration = colors.getAnimationDuration(speed);
24
24
  return /* @__PURE__ */ jsxRuntime.jsx(
25
25
  "div",
26
26
  {
27
27
  ref,
28
28
  "data-testid": testId,
29
- className: classNames.cn("inline-flex items-center justify-center", className),
30
- style,
29
+ className: classNames.cn("inline-flex items-center justify-center gap-1", className),
30
+ style: {
31
+ height: colors.normalizeSize(size),
32
+ ...style
33
+ },
31
34
  role: "status",
32
35
  "aria-label": ariaLabel,
33
36
  "aria-busy": "true",
34
37
  ...rest,
35
- children: /* @__PURE__ */ jsxRuntime.jsx(
38
+ children: Array.from({ length: barCount }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
36
39
  "div",
37
40
  {
38
- className: "grid gap-0.5",
41
+ className: "rounded-sm",
39
42
  style: {
40
- width: colors.normalizeSize(size),
41
- height: colors.normalizeSize(size),
42
- gridTemplateColumns: `repeat(${gridSize}, 1fr)`
43
- },
44
- children: Array.from({ length: gridSize * gridSize }).map((_, index) => {
45
- const row = Math.floor(index / gridSize);
46
- const col = index % gridSize;
47
- const delay = (row + col) * 0.1;
48
- return /* @__PURE__ */ jsxRuntime.jsx(
49
- "div",
50
- {
51
- className: "rounded-sm",
52
- style: {
53
- width: `${cellSize}px`,
54
- height: `${cellSize}px`,
55
- backgroundColor: color,
56
- animation: `fade-pulse ${animationDuration} ease-in-out infinite`,
57
- animationDelay: `${delay}s`
58
- }
59
- },
60
- index
61
- );
62
- })
63
- }
64
- )
43
+ width: `${barWidth}px`,
44
+ height: "100%",
45
+ backgroundColor: color,
46
+ animation: `pulse-wave ${animationDuration} ease-in-out infinite`,
47
+ animationDelay: `${index * 0.1}s`
48
+ }
49
+ },
50
+ index
51
+ ))
65
52
  }
66
53
  );
67
54
  }
68
55
  );
69
- SpinnerGrid.displayName = "SpinnerGrid";
70
- exports.SpinnerGrid = SpinnerGrid;
56
+ SpinnerBars.displayName = "SpinnerBars";
57
+ exports.SpinnerBars = SpinnerBars;
71
58
  //# sourceMappingURL=index17.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index17.cjs","sources":["../src/components/spinner/SpinnerGrid.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerGridProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration } from '../../utils';\n\n/**\n * SpinnerGrid - Grid of fading squares\n *\n * A spinner with a grid of squares that fade in and out in a pattern.\n *\n * @example\n * ```tsx\n * <SpinnerGrid size={40} color=\"#3b82f6\" />\n * <SpinnerGrid size={48} gridSize={4} />\n * ```\n */\nexport const SpinnerGrid = forwardRef<HTMLDivElement, SpinnerGridProps>(\n (\n {\n size = 40,\n color = '#3b82f6',\n gridSize = 3,\n speed = 'normal',\n className,\n style,\n testId = 'spinner-grid',\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 cellSize = Math.floor(sizeValue / gridSize) - 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', className)}\n style={style}\n role=\"status\"\n aria-label={ariaLabel}\n aria-busy=\"true\"\n {...rest}\n >\n <div\n className=\"grid gap-0.5\"\n style={{\n width: normalizeSize(size),\n height: normalizeSize(size),\n gridTemplateColumns: `repeat(${gridSize}, 1fr)`,\n }}\n >\n {Array.from({ length: gridSize * gridSize }).map((_, index) => {\n const row = Math.floor(index / gridSize);\n const col = index % gridSize;\n const delay = (row + col) * 0.1;\n\n return (\n <div\n key={index}\n className=\"rounded-sm\"\n style={{\n width: `${cellSize}px`,\n height: `${cellSize}px`,\n backgroundColor: color,\n animation: `fade-pulse ${animationDuration} ease-in-out infinite`,\n animationDelay: `${delay}s`,\n }}\n />\n );\n })}\n </div>\n </div>\n );\n }\n);\n\nSpinnerGrid.displayName = 'SpinnerGrid';\n"],"names":["forwardRef","getAnimationDuration","jsx","cn","normalizeSize"],"mappings":";;;;;;AAeO,MAAM,cAAcA,MAAAA;AAAAA,EACzB,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;A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version":3,"file":"index17.cjs","sources":["../src/components/spinner/SpinnerBars.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerBarsProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration, parseSizeToNumber } from '../../utils';\n\n/**\n * SpinnerBars - Vertical bars with wave animation\n *\n * A spinner with vertical bars that animate in a wave pattern.\n *\n * @example\n * ```tsx\n * <SpinnerBars size={40} color=\"#3b82f6\" />\n * <SpinnerBars size={32} barCount={5} speed=\"fast\" />\n * ```\n */\nexport const SpinnerBars = forwardRef<HTMLDivElement, SpinnerBarsProps>(\n (\n {\n size = 40,\n color = '#3b82f6',\n barCount = 5,\n speed = 'normal',\n className,\n style,\n testId = 'spinner-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 <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: `${index * 0.1}s`,\n }}\n />\n ))}\n </div>\n );\n }\n);\n\nSpinnerBars.displayName = 'SpinnerBars';\n"],"names":["forwardRef","parseSizeToNumber","getAnimationDuration","jsx","cn","normalizeSize"],"mappings":";;;;;;AAeO,MAAM,cAAcA,MAAAA;AAAAA,EACzB,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,YAAYC,OAAAA,kBAAkB,MAAM,EAAE;AAC5C,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,UAAU,EAAE,IAAI,CAAC,GAAG,UACxCF,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YAEC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,OAAO,GAAG,QAAQ;AAAA,cAClB,QAAQ;AAAA,cACR,iBAAiB;AAAA,cACjB,WAAW,cAAc,iBAAiB;AAAA,cAC1C,gBAAgB,GAAG,QAAQ,GAAG;AAAA,YAAA;AAAA,UAChC;AAAA,UARK;AAAA,QAAA,CAUR;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,YAAY,cAAc;;"}
package/dist/index17.js CHANGED
@@ -1,71 +1,58 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
+ import { normalizeSize, getAnimationDuration, parseSizeToNumber } from "./index4.js";
3
4
  import { cn } from "./index3.js";
4
- import { normalizeSize, getAnimationDuration } from "./index4.js";
5
- const SpinnerGrid = forwardRef(
5
+ const SpinnerBars = forwardRef(
6
6
  ({
7
7
  size = 40,
8
8
  color = "#3b82f6",
9
- gridSize = 3,
9
+ barCount = 5,
10
10
  speed = "normal",
11
11
  className,
12
12
  style,
13
- testId = "spinner-grid",
13
+ testId = "spinner-bars",
14
14
  visible = true,
15
15
  ariaLabel = "Loading...",
16
16
  ...rest
17
17
  }, ref) => {
18
18
  if (!visible) return null;
19
- const sizeValue = typeof size === "number" ? size : parseInt(String(size), 10);
20
- const cellSize = Math.floor(sizeValue / gridSize) - 2;
19
+ const sizeValue = parseSizeToNumber(size, 40);
20
+ const barWidth = Math.floor(sizeValue / (barCount * 2));
21
21
  const animationDuration = getAnimationDuration(speed);
22
22
  return /* @__PURE__ */ jsx(
23
23
  "div",
24
24
  {
25
25
  ref,
26
26
  "data-testid": testId,
27
- className: cn("inline-flex items-center justify-center", className),
28
- style,
27
+ className: cn("inline-flex items-center justify-center gap-1", className),
28
+ style: {
29
+ height: normalizeSize(size),
30
+ ...style
31
+ },
29
32
  role: "status",
30
33
  "aria-label": ariaLabel,
31
34
  "aria-busy": "true",
32
35
  ...rest,
33
- children: /* @__PURE__ */ jsx(
36
+ children: Array.from({ length: barCount }).map((_, index) => /* @__PURE__ */ jsx(
34
37
  "div",
35
38
  {
36
- className: "grid gap-0.5",
39
+ className: "rounded-sm",
37
40
  style: {
38
- width: normalizeSize(size),
39
- height: normalizeSize(size),
40
- gridTemplateColumns: `repeat(${gridSize}, 1fr)`
41
- },
42
- children: Array.from({ length: gridSize * gridSize }).map((_, index) => {
43
- const row = Math.floor(index / gridSize);
44
- const col = index % gridSize;
45
- const delay = (row + col) * 0.1;
46
- return /* @__PURE__ */ jsx(
47
- "div",
48
- {
49
- className: "rounded-sm",
50
- style: {
51
- width: `${cellSize}px`,
52
- height: `${cellSize}px`,
53
- backgroundColor: color,
54
- animation: `fade-pulse ${animationDuration} ease-in-out infinite`,
55
- animationDelay: `${delay}s`
56
- }
57
- },
58
- index
59
- );
60
- })
61
- }
62
- )
41
+ width: `${barWidth}px`,
42
+ height: "100%",
43
+ backgroundColor: color,
44
+ animation: `pulse-wave ${animationDuration} ease-in-out infinite`,
45
+ animationDelay: `${index * 0.1}s`
46
+ }
47
+ },
48
+ index
49
+ ))
63
50
  }
64
51
  );
65
52
  }
66
53
  );
67
- SpinnerGrid.displayName = "SpinnerGrid";
54
+ SpinnerBars.displayName = "SpinnerBars";
68
55
  export {
69
- SpinnerGrid
56
+ SpinnerBars
70
57
  };
71
58
  //# sourceMappingURL=index17.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index17.js","sources":["../src/components/spinner/SpinnerGrid.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerGridProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration } from '../../utils';\n\n/**\n * SpinnerGrid - Grid of fading squares\n *\n * A spinner with a grid of squares that fade in and out in a pattern.\n *\n * @example\n * ```tsx\n * <SpinnerGrid size={40} color=\"#3b82f6\" />\n * <SpinnerGrid size={48} gridSize={4} />\n * ```\n */\nexport const SpinnerGrid = forwardRef<HTMLDivElement, SpinnerGridProps>(\n (\n {\n size = 40,\n color = '#3b82f6',\n gridSize = 3,\n speed = 'normal',\n className,\n style,\n testId = 'spinner-grid',\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 cellSize = Math.floor(sizeValue / gridSize) - 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', className)}\n style={style}\n role=\"status\"\n aria-label={ariaLabel}\n aria-busy=\"true\"\n {...rest}\n >\n <div\n className=\"grid gap-0.5\"\n style={{\n width: normalizeSize(size),\n height: normalizeSize(size),\n gridTemplateColumns: `repeat(${gridSize}, 1fr)`,\n }}\n >\n {Array.from({ length: gridSize * gridSize }).map((_, index) => {\n const row = Math.floor(index / gridSize);\n const col = index % gridSize;\n const delay = (row + col) * 0.1;\n\n return (\n <div\n key={index}\n className=\"rounded-sm\"\n style={{\n width: `${cellSize}px`,\n height: `${cellSize}px`,\n backgroundColor: color,\n animation: `fade-pulse ${animationDuration} ease-in-out infinite`,\n animationDelay: `${delay}s`,\n }}\n />\n );\n })}\n </div>\n </div>\n );\n }\n);\n\nSpinnerGrid.displayName = 'SpinnerGrid';\n"],"names":[],"mappings":";;;;AAeO,MAAM,cAAc;AAAA,EACzB,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,YAAY,QAAQ,IAAI;AACpD,UAAM,oBAAoB,qBAAqB,KAAK;AAEpD,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAW,GAAG,2CAA2C,SAAS;AAAA,QAClE;AAAA,QACA,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,OAAO,cAAc,IAAI;AAAA,cACzB,QAAQ,cAAc,IAAI;AAAA,cAC1B,qBAAqB,UAAU,QAAQ;AAAA,YAAA;AAAA,YAGxC,UAAA,MAAM,KAAK,EAAE,QAAQ,WAAW,SAAA,CAAU,EAAE,IAAI,CAAC,GAAG,UAAU;AAC7D,oBAAM,MAAM,KAAK,MAAM,QAAQ,QAAQ;AACvC,oBAAM,MAAM,QAAQ;AACpB,oBAAM,SAAS,MAAM,OAAO;AAE5B,qBACE;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBAEC,WAAU;AAAA,kBACV,OAAO;AAAA,oBACL,OAAO,GAAG,QAAQ;AAAA,oBAClB,QAAQ,GAAG,QAAQ;AAAA,oBACnB,iBAAiB;AAAA,oBACjB,WAAW,cAAc,iBAAiB;AAAA,oBAC1C,gBAAgB,GAAG,KAAK;AAAA,kBAAA;AAAA,gBAC1B;AAAA,gBARK;AAAA,cAAA;AAAA,YAWX,CAAC;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,YAAY,cAAc;"}
1
+ {"version":3,"file":"index17.js","sources":["../src/components/spinner/SpinnerBars.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerBarsProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration, parseSizeToNumber } from '../../utils';\n\n/**\n * SpinnerBars - Vertical bars with wave animation\n *\n * A spinner with vertical bars that animate in a wave pattern.\n *\n * @example\n * ```tsx\n * <SpinnerBars size={40} color=\"#3b82f6\" />\n * <SpinnerBars size={32} barCount={5} speed=\"fast\" />\n * ```\n */\nexport const SpinnerBars = forwardRef<HTMLDivElement, SpinnerBarsProps>(\n (\n {\n size = 40,\n color = '#3b82f6',\n barCount = 5,\n speed = 'normal',\n className,\n style,\n testId = 'spinner-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 <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: `${index * 0.1}s`,\n }}\n />\n ))}\n </div>\n );\n }\n);\n\nSpinnerBars.displayName = 'SpinnerBars';\n"],"names":[],"mappings":";;;;AAeO,MAAM,cAAc;AAAA,EACzB,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,UAAU,EAAE,IAAI,CAAC,GAAG,UACxC;AAAA,UAAC;AAAA,UAAA;AAAA,YAEC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,OAAO,GAAG,QAAQ;AAAA,cAClB,QAAQ;AAAA,cACR,iBAAiB;AAAA,cACjB,WAAW,cAAc,iBAAiB;AAAA,cAC1C,gBAAgB,GAAG,QAAQ,GAAG;AAAA,YAAA;AAAA,UAChC;AAAA,UARK;AAAA,QAAA,CAUR;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,YAAY,cAAc;"}
package/dist/index18.cjs CHANGED
@@ -2,80 +2,70 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const react = require("react");
5
- const colors = require("./index4.cjs");
6
5
  const classNames = require("./index3.cjs");
7
- const ProgressBar = react.forwardRef(
6
+ const colors = require("./index4.cjs");
7
+ const SpinnerGrid = react.forwardRef(
8
8
  ({
9
- value = 0,
10
- indeterminate = false,
11
- showValue = false,
12
- height = "0.5rem",
9
+ size = 40,
13
10
  color = "#3b82f6",
14
- secondaryColor = "#e0e0e0",
11
+ gridSize = 3,
12
+ speed = "normal",
15
13
  className,
16
14
  style,
17
- testId = "progress-bar",
15
+ testId = "spinner-grid",
18
16
  visible = true,
19
- ariaLabel,
17
+ ariaLabel = "Loading...",
20
18
  ...rest
21
19
  }, ref) => {
22
20
  if (!visible) return null;
23
- const clampedValue = Math.min(100, Math.max(0, value));
24
- const progressLabel = ariaLabel || `Loading ${clampedValue}%`;
25
- return /* @__PURE__ */ jsxRuntime.jsxs(
21
+ const sizeValue = colors.parseSizeToNumber(size, 40);
22
+ const cellSize = Math.floor(sizeValue / gridSize) - 2;
23
+ const animationDuration = colors.getAnimationDuration(speed);
24
+ return /* @__PURE__ */ jsxRuntime.jsx(
26
25
  "div",
27
26
  {
28
27
  ref,
29
28
  "data-testid": testId,
30
- className: classNames.cn("relative w-full overflow-hidden rounded-full", className),
31
- style: {
32
- height: colors.normalizeSize(height),
33
- backgroundColor: secondaryColor,
34
- ...style
35
- },
36
- role: "progressbar",
37
- "aria-label": progressLabel,
38
- "aria-valuenow": indeterminate ? void 0 : clampedValue,
39
- "aria-valuemin": 0,
40
- "aria-valuemax": 100,
29
+ className: classNames.cn("inline-flex items-center justify-center", className),
30
+ style,
31
+ role: "status",
32
+ "aria-label": ariaLabel,
33
+ "aria-busy": "true",
41
34
  ...rest,
42
- children: [
43
- indeterminate ? /* @__PURE__ */ jsxRuntime.jsx(
44
- "div",
45
- {
46
- className: "absolute h-full rounded-full",
47
- style: {
48
- backgroundColor: color,
49
- animation: "progress-indeterminate 1.5s ease-in-out infinite",
50
- width: "40%"
51
- }
52
- }
53
- ) : /* @__PURE__ */ jsxRuntime.jsx(
54
- "div",
55
- {
56
- className: "h-full rounded-full transition-all duration-300 ease-in-out",
57
- style: {
58
- width: `${clampedValue}%`,
59
- backgroundColor: color
60
- }
61
- }
62
- ),
63
- showValue && !indeterminate && /* @__PURE__ */ jsxRuntime.jsxs(
64
- "span",
65
- {
66
- className: "absolute inset-0 flex items-center justify-center text-xs font-medium",
67
- style: { color: clampedValue > 50 ? "white" : color },
68
- children: [
69
- clampedValue,
70
- "%"
71
- ]
72
- }
73
- )
74
- ]
35
+ children: /* @__PURE__ */ jsxRuntime.jsx(
36
+ "div",
37
+ {
38
+ className: "grid gap-0.5",
39
+ style: {
40
+ width: colors.normalizeSize(size),
41
+ height: colors.normalizeSize(size),
42
+ gridTemplateColumns: `repeat(${gridSize}, 1fr)`
43
+ },
44
+ children: Array.from({ length: gridSize * gridSize }).map((_, index) => {
45
+ const row = Math.floor(index / gridSize);
46
+ const col = index % gridSize;
47
+ const delay = (row + col) * 0.1;
48
+ return /* @__PURE__ */ jsxRuntime.jsx(
49
+ "div",
50
+ {
51
+ className: "rounded-sm",
52
+ style: {
53
+ width: `${cellSize}px`,
54
+ height: `${cellSize}px`,
55
+ backgroundColor: color,
56
+ animation: `fade-pulse ${animationDuration} ease-in-out infinite`,
57
+ animationDelay: `${delay}s`
58
+ }
59
+ },
60
+ index
61
+ );
62
+ })
63
+ }
64
+ )
75
65
  }
76
66
  );
77
67
  }
78
68
  );
79
- ProgressBar.displayName = "ProgressBar";
80
- exports.ProgressBar = ProgressBar;
69
+ SpinnerGrid.displayName = "SpinnerGrid";
70
+ exports.SpinnerGrid = SpinnerGrid;
81
71
  //# sourceMappingURL=index18.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index18.cjs","sources":["../src/components/progress/ProgressBar.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { ProgressBarProps } from '../../types';\nimport { cn, normalizeSize } from '../../utils';\n\n/**\n * ProgressBar - Linear progress bar\n *\n * A horizontal progress bar that can be determinate (showing specific progress) or indeterminate (loading animation).\n *\n * @example\n * ```tsx\n * <ProgressBar value={75} showValue />\n * <ProgressBar indeterminate />\n * <ProgressBar value={50} height={8} color=\"#8b5cf6\" />\n * ```\n */\nexport const ProgressBar = forwardRef<HTMLDivElement, ProgressBarProps>(\n (\n {\n value = 0,\n indeterminate = false,\n showValue = false,\n height = '0.5rem',\n color = '#3b82f6',\n secondaryColor = '#e0e0e0',\n className,\n style,\n testId = 'progress-bar',\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 progressLabel = ariaLabel || `Loading ${clampedValue}%`;\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('relative w-full overflow-hidden rounded-full', className)}\n style={{\n height: normalizeSize(height),\n backgroundColor: secondaryColor,\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 {indeterminate ? (\n <div\n className=\"absolute h-full rounded-full\"\n style={{\n backgroundColor: color,\n animation: 'progress-indeterminate 1.5s ease-in-out infinite',\n width: '40%',\n }}\n />\n ) : (\n <div\n className=\"h-full rounded-full transition-all duration-300 ease-in-out\"\n style={{\n width: `${clampedValue}%`,\n backgroundColor: color,\n }}\n />\n )}\n {showValue && !indeterminate && (\n <span\n className=\"absolute inset-0 flex items-center justify-center text-xs font-medium\"\n style={{ color: clampedValue > 50 ? 'white' : color }}\n >\n {clampedValue}%\n </span>\n )}\n </div>\n );\n }\n);\n\nProgressBar.displayName = 'ProgressBar';\n"],"names":["forwardRef","jsxs","cn","normalizeSize","jsx"],"mappings":";;;;;;AAgBO,MAAM,cAAcA,MAAAA;AAAAA,EACzB,CACE;AAAA,IACE,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,iBAAiB;AAAA,IACjB;AAAA,IACA;AAAA,IACA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cjs","sources":["../src/components/spinner/SpinnerGrid.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerGridProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration, parseSizeToNumber } from '../../utils';\n\n/**\n * SpinnerGrid - Grid of fading squares\n *\n * A spinner with a grid of squares that fade in and out in a pattern.\n *\n * @example\n * ```tsx\n * <SpinnerGrid size={40} color=\"#3b82f6\" />\n * <SpinnerGrid size={48} gridSize={4} />\n * ```\n */\nexport const SpinnerGrid = forwardRef<HTMLDivElement, SpinnerGridProps>(\n (\n {\n size = 40,\n color = '#3b82f6',\n gridSize = 3,\n speed = 'normal',\n className,\n style,\n testId = 'spinner-grid',\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 cellSize = Math.floor(sizeValue / gridSize) - 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', className)}\n style={style}\n role=\"status\"\n aria-label={ariaLabel}\n aria-busy=\"true\"\n {...rest}\n >\n <div\n className=\"grid gap-0.5\"\n style={{\n width: normalizeSize(size),\n height: normalizeSize(size),\n gridTemplateColumns: `repeat(${gridSize}, 1fr)`,\n }}\n >\n {Array.from({ length: gridSize * gridSize }).map((_, index) => {\n const row = Math.floor(index / gridSize);\n const col = index % gridSize;\n const delay = (row + col) * 0.1;\n\n return (\n <div\n key={index}\n className=\"rounded-sm\"\n style={{\n width: `${cellSize}px`,\n height: `${cellSize}px`,\n backgroundColor: color,\n animation: `fade-pulse ${animationDuration} ease-in-out infinite`,\n animationDelay: `${delay}s`,\n }}\n />\n );\n })}\n </div>\n </div>\n );\n }\n);\n\nSpinnerGrid.displayName = 'SpinnerGrid';\n"],"names":["forwardRef","parseSizeToNumber","getAnimationDuration","jsx","cn","normalizeSize"],"mappings":";;;;;;AAeO,MAAM,cAAcA,MAAAA;AAAAA,EACz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