premium-react-loaders 1.0.0 → 1.0.1

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 (81) hide show
  1. package/README.md +49 -3
  2. package/dist/components/index.d.ts +1 -0
  3. package/dist/components/index.d.ts.map +1 -1
  4. package/dist/components/overlay/LoaderOverlay.d.ts +28 -0
  5. package/dist/components/overlay/LoaderOverlay.d.ts.map +1 -0
  6. package/dist/components/overlay/index.d.ts +2 -0
  7. package/dist/components/overlay/index.d.ts.map +1 -0
  8. package/dist/components/skeleton/SkeletonPage.d.ts +16 -0
  9. package/dist/components/skeleton/SkeletonPage.d.ts.map +1 -0
  10. package/dist/components/skeleton/index.d.ts +1 -0
  11. package/dist/components/skeleton/index.d.ts.map +1 -1
  12. package/dist/index.cjs +15 -11
  13. package/dist/index.cjs.map +1 -1
  14. package/dist/index.js +15 -11
  15. package/dist/index.js.map +1 -1
  16. package/dist/index12.cjs +126 -37
  17. package/dist/index12.cjs.map +1 -1
  18. package/dist/index12.js +127 -38
  19. package/dist/index12.js.map +1 -1
  20. package/dist/index13.cjs +23 -11
  21. package/dist/index13.cjs.map +1 -1
  22. package/dist/index13.js +23 -11
  23. package/dist/index13.js.map +1 -1
  24. package/dist/index14.cjs +9 -32
  25. package/dist/index14.cjs.map +1 -1
  26. package/dist/index14.js +9 -32
  27. package/dist/index14.js.map +1 -1
  28. package/dist/index15.cjs +40 -24
  29. package/dist/index15.cjs.map +1 -1
  30. package/dist/index15.js +40 -24
  31. package/dist/index15.js.map +1 -1
  32. package/dist/index16.cjs +23 -36
  33. package/dist/index16.cjs.map +1 -1
  34. package/dist/index16.js +23 -36
  35. package/dist/index16.js.map +1 -1
  36. package/dist/index17.cjs +48 -58
  37. package/dist/index17.cjs.map +1 -1
  38. package/dist/index17.js +49 -59
  39. package/dist/index17.js.map +1 -1
  40. package/dist/index18.cjs +27 -53
  41. package/dist/index18.cjs.map +1 -1
  42. package/dist/index18.js +27 -53
  43. package/dist/index18.js.map +1 -1
  44. package/dist/index19.cjs +8 -14
  45. package/dist/index19.cjs.map +1 -1
  46. package/dist/index19.js +8 -14
  47. package/dist/index19.js.map +1 -1
  48. package/dist/index20.cjs +84 -28
  49. package/dist/index20.cjs.map +1 -1
  50. package/dist/index20.js +86 -30
  51. package/dist/index20.js.map +1 -1
  52. package/dist/index21.cjs +21 -26
  53. package/dist/index21.cjs.map +1 -1
  54. package/dist/index21.js +21 -26
  55. package/dist/index21.js.map +1 -1
  56. package/dist/index22.cjs +9 -11
  57. package/dist/index22.cjs.map +1 -1
  58. package/dist/index22.js +9 -11
  59. package/dist/index22.js.map +1 -1
  60. package/dist/index23.cjs +62 -16
  61. package/dist/index23.cjs.map +1 -1
  62. package/dist/index23.js +61 -15
  63. package/dist/index23.js.map +1 -1
  64. package/dist/index24.cjs +71 -0
  65. package/dist/index24.cjs.map +1 -0
  66. package/dist/index24.js +71 -0
  67. package/dist/index24.js.map +1 -0
  68. package/dist/index25.cjs +18 -0
  69. package/dist/index25.cjs.map +1 -0
  70. package/dist/index25.js +18 -0
  71. package/dist/index25.js.map +1 -0
  72. package/dist/index3.cjs +1 -1
  73. package/dist/index3.js +1 -1
  74. package/dist/premium-react-loaders.css +98 -0
  75. package/dist/types/index.d.ts +1 -0
  76. package/dist/types/index.d.ts.map +1 -1
  77. package/dist/types/overlay.d.ts +24 -0
  78. package/dist/types/overlay.d.ts.map +1 -0
  79. package/dist/types/skeleton.d.ts +7 -0
  80. package/dist/types/skeleton.d.ts.map +1 -1
  81. package/package.json +7 -1
package/dist/index15.cjs CHANGED
@@ -2,57 +2,73 @@
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 SpinnerBars = react.forwardRef(
6
+ const colors = require("./index4.cjs");
7
+ const SpinnerDots = react.forwardRef(
8
8
  ({
9
9
  size = 40,
10
10
  color = "#3b82f6",
11
- barCount = 5,
11
+ dotCount = 8,
12
+ dotSize = 4,
12
13
  speed = "normal",
13
14
  className,
14
15
  style,
15
- testId = "spinner-bars",
16
+ testId = "spinner-dots",
16
17
  visible = true,
17
18
  ariaLabel = "Loading...",
18
19
  ...rest
19
20
  }, ref) => {
20
21
  if (!visible) return null;
21
22
  const sizeValue = typeof size === "number" ? size : parseInt(String(size), 10);
22
- const barWidth = Math.floor(sizeValue / (barCount * 2));
23
- const animationDuration = colors.getAnimationDuration(speed);
23
+ const radius = (sizeValue - dotSize) / 2;
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 gap-1", className),
30
- style: {
31
- height: colors.normalizeSize(size),
32
- ...style
33
- },
29
+ className: classNames.cn("inline-flex items-center justify-center", className),
30
+ style,
34
31
  role: "status",
35
32
  "aria-label": ariaLabel,
36
33
  "aria-busy": "true",
37
34
  ...rest,
38
- children: Array.from({ length: barCount }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
35
+ children: /* @__PURE__ */ jsxRuntime.jsx(
39
36
  "div",
40
37
  {
41
- className: "rounded-sm",
38
+ className: "relative",
42
39
  style: {
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
- ))
40
+ width: colors.normalizeSize(size),
41
+ height: colors.normalizeSize(size),
42
+ animation: `spinner-rotate ${colors.getAnimationDuration(speed)} linear infinite`
43
+ },
44
+ children: Array.from({ length: dotCount }).map((_, index) => {
45
+ const angle = 360 / dotCount * index;
46
+ const radian = angle * Math.PI / 180;
47
+ const x = radius * Math.cos(radian) + radius;
48
+ const y = radius * Math.sin(radian) + radius;
49
+ return /* @__PURE__ */ jsxRuntime.jsx(
50
+ "div",
51
+ {
52
+ className: "absolute rounded-full",
53
+ style: {
54
+ width: colors.normalizeSize(dotSize),
55
+ height: colors.normalizeSize(dotSize),
56
+ backgroundColor: color,
57
+ left: `${x}px`,
58
+ top: `${y}px`,
59
+ opacity: 1 - index / dotCount * 0.7
60
+ // Fade effect
61
+ }
62
+ },
63
+ index
64
+ );
65
+ })
66
+ }
67
+ )
52
68
  }
53
69
  );
54
70
  }
55
71
  );
56
- SpinnerBars.displayName = "SpinnerBars";
57
- exports.SpinnerBars = SpinnerBars;
72
+ SpinnerDots.displayName = "SpinnerDots";
73
+ exports.SpinnerDots = SpinnerDots;
58
74
  //# sourceMappingURL=index15.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index15.cjs","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":["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;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,UAAM,YAAY,OAAO,SAAS,WAAW,OAAO,SAAS,OAAO,IAAI,GAAG,EAAE;AAC7E,UAAM,WAAW,KAAK,MAAM,aAAa,WAAW,EAAE;AACtD,UAAM,oBAAoBC,OAAAA,qBAAqB,KAAK;AAEpD,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAWC,WAAAA,GAAG,iDAAiD,SAAS;AAAA,QACxE,OAAO;AAAA,UACL,QAAQC,OAAAA,cAAc,IAAI;AAAA,UAC1B,GAAG;AAAA,QAAA;AAAA,QAEL,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEH,UAAA,MAAM,KAAK,EAAE,QAAQ,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;;"}
1
+ {"version":3,"file":"index15.cjs","sources":["../src/components/spinner/SpinnerDots.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerDotsProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration } 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 = typeof size === 'number' ? size : parseInt(String(size), 10);\n const radius = (sizeValue - dotSize) / 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":["forwardRef","jsx","cn","normalizeSize","getAnimationDuration"],"mappings":";;;;;;AAeO,MAAM,cAAcA,MAAAA;AAAAA,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,OAAO,SAAS,WAAW,OAAO,SAAS,OAAO,IAAI,GAAG,EAAE;AAC7E,UAAM,UAAU,YAAY,WAAW;AAEvC,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAWC,WAAAA,GAAG,2CAA2C,SAAS;AAAA,QAClE;AAAA,QACA,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEJ,UAAAD,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,OAAOE,OAAAA,cAAc,IAAI;AAAA,cACzB,QAAQA,OAAAA,cAAc,IAAI;AAAA,cAC1B,WAAW,kBAAkBC,4BAAqB,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,qBACEH,2BAAAA;AAAAA,gBAAC;AAAA,gBAAA;AAAA,kBAEC,WAAU;AAAA,kBACV,OAAO;AAAA,oBACL,OAAOE,OAAAA,cAAc,OAAO;AAAA,oBAC5B,QAAQA,OAAAA,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/index15.js CHANGED
@@ -1,58 +1,74 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { normalizeSize, getAnimationDuration } from "./index4.js";
4
3
  import { cn } from "./index3.js";
5
- const SpinnerBars = forwardRef(
4
+ import { getAnimationDuration, normalizeSize } from "./index4.js";
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
20
  const sizeValue = typeof size === "number" ? size : parseInt(String(size), 10);
20
- const barWidth = Math.floor(sizeValue / (barCount * 2));
21
- const animationDuration = getAnimationDuration(speed);
21
+ const radius = (sizeValue - dotSize) / 2;
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 gap-1", className),
28
- style: {
29
- height: normalizeSize(size),
30
- ...style
31
- },
27
+ className: cn("inline-flex items-center justify-center", className),
28
+ style,
32
29
  role: "status",
33
30
  "aria-label": ariaLabel,
34
31
  "aria-busy": "true",
35
32
  ...rest,
36
- children: Array.from({ length: barCount }).map((_, index) => /* @__PURE__ */ jsx(
33
+ children: /* @__PURE__ */ jsx(
37
34
  "div",
38
35
  {
39
- className: "rounded-sm",
36
+ className: "relative",
40
37
  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
- ))
38
+ width: normalizeSize(size),
39
+ height: normalizeSize(size),
40
+ animation: `spinner-rotate ${getAnimationDuration(speed)} linear infinite`
41
+ },
42
+ children: Array.from({ length: dotCount }).map((_, index) => {
43
+ const angle = 360 / dotCount * index;
44
+ const radian = angle * Math.PI / 180;
45
+ const x = radius * Math.cos(radian) + radius;
46
+ const y = radius * Math.sin(radian) + radius;
47
+ return /* @__PURE__ */ jsx(
48
+ "div",
49
+ {
50
+ className: "absolute rounded-full",
51
+ style: {
52
+ width: normalizeSize(dotSize),
53
+ height: normalizeSize(dotSize),
54
+ backgroundColor: color,
55
+ left: `${x}px`,
56
+ top: `${y}px`,
57
+ opacity: 1 - index / dotCount * 0.7
58
+ // Fade effect
59
+ }
60
+ },
61
+ index
62
+ );
63
+ })
64
+ }
65
+ )
50
66
  }
51
67
  );
52
68
  }
53
69
  );
54
- SpinnerBars.displayName = "SpinnerBars";
70
+ SpinnerDots.displayName = "SpinnerDots";
55
71
  export {
56
- SpinnerBars
72
+ SpinnerDots
57
73
  };
58
74
  //# sourceMappingURL=index15.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index15.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":"index15.js","sources":["../src/components/spinner/SpinnerDots.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerDotsProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration } 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 = typeof size === 'number' ? size : parseInt(String(size), 10);\n const radius = (sizeValue - dotSize) / 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,OAAO,SAAS,WAAW,OAAO,SAAS,OAAO,IAAI,GAAG,EAAE;AAC7E,UAAM,UAAU,YAAY,WAAW;AAEvC,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/index16.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
21
  const sizeValue = typeof size === "number" ? size : parseInt(String(size), 10);
22
- const cellSize = Math.floor(sizeValue / gridSize) - 2;
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=index16.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index16.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;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,oBAAoBC,OAAAA,qBAAqB,KAAK;AAEpD,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAWC,WAAAA,GAAG,2CAA2C,SAAS;AAAA,QAClE;AAAA,QACA,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEJ,UAAAD,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,OAAOE,OAAAA,cAAc,IAAI;AAAA,cACzB,QAAQA,OAAAA,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,qBACEF,2BAAAA;AAAAA,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":"index16.cjs","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":["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;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,UAAM,YAAY,OAAO,SAAS,WAAW,OAAO,SAAS,OAAO,IAAI,GAAG,EAAE;AAC7E,UAAM,WAAW,KAAK,MAAM,aAAa,WAAW,EAAE;AACtD,UAAM,oBAAoBC,OAAAA,qBAAqB,KAAK;AAEpD,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAWC,WAAAA,GAAG,iDAAiD,SAAS;AAAA,QACxE,OAAO;AAAA,UACL,QAAQC,OAAAA,cAAc,IAAI;AAAA,UAC1B,GAAG;AAAA,QAAA;AAAA,QAEL,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEH,UAAA,MAAM,KAAK,EAAE,QAAQ,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/index16.js CHANGED
@@ -1,71 +1,58 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { cn } from "./index3.js";
4
3
  import { normalizeSize, getAnimationDuration } from "./index4.js";
5
- const SpinnerGrid = forwardRef(
4
+ import { cn } from "./index3.js";
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
19
  const sizeValue = typeof size === "number" ? size : parseInt(String(size), 10);
20
- const cellSize = Math.floor(sizeValue / gridSize) - 2;
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=index16.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index16.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":"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;"}
package/dist/index17.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 = typeof size === "number" ? size : parseInt(String(size), 10);
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=index17.cjs.map