premium-react-loaders 1.0.2 → 1.2.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 (143) hide show
  1. package/README.md +55 -6
  2. package/dist/components/progress/ProgressBar.d.ts.map +1 -1
  3. package/dist/components/progress/ProgressCircle.d.ts.map +1 -1
  4. package/dist/components/progress/ProgressRing.d.ts.map +1 -1
  5. package/dist/components/progress/ProgressSteps.d.ts +16 -0
  6. package/dist/components/progress/ProgressSteps.d.ts.map +1 -0
  7. package/dist/components/progress/index.d.ts +1 -0
  8. package/dist/components/progress/index.d.ts.map +1 -1
  9. package/dist/components/pulse/PulseBars.d.ts +2 -2
  10. package/dist/components/pulse/PulseBars.d.ts.map +1 -1
  11. package/dist/components/pulse/PulseDots.d.ts +2 -2
  12. package/dist/components/pulse/PulseDots.d.ts.map +1 -1
  13. package/dist/components/pulse/PulseWave.d.ts +2 -2
  14. package/dist/components/pulse/PulseWave.d.ts.map +1 -1
  15. package/dist/components/pulse/TypingIndicator.d.ts +16 -0
  16. package/dist/components/pulse/TypingIndicator.d.ts.map +1 -0
  17. package/dist/components/pulse/index.d.ts +1 -0
  18. package/dist/components/pulse/index.d.ts.map +1 -1
  19. package/dist/components/skeleton/SkeletonForm.d.ts +16 -0
  20. package/dist/components/skeleton/SkeletonForm.d.ts.map +1 -0
  21. package/dist/components/skeleton/index.d.ts +1 -0
  22. package/dist/components/skeleton/index.d.ts.map +1 -1
  23. package/dist/components/spinner/SpinnerBars.d.ts +2 -2
  24. package/dist/components/spinner/SpinnerBars.d.ts.map +1 -1
  25. package/dist/components/spinner/SpinnerCircle.d.ts +2 -1
  26. package/dist/components/spinner/SpinnerCircle.d.ts.map +1 -1
  27. package/dist/components/spinner/SpinnerDots.d.ts +2 -2
  28. package/dist/components/spinner/SpinnerDots.d.ts.map +1 -1
  29. package/dist/components/spinner/SpinnerGrid.d.ts +2 -2
  30. package/dist/components/spinner/SpinnerGrid.d.ts.map +1 -1
  31. package/dist/components/spinner/SpinnerPulse.d.ts +15 -0
  32. package/dist/components/spinner/SpinnerPulse.d.ts.map +1 -0
  33. package/dist/components/spinner/SpinnerRing.d.ts +3 -3
  34. package/dist/components/spinner/SpinnerRing.d.ts.map +1 -1
  35. package/dist/components/spinner/SpinnerWave.d.ts +15 -0
  36. package/dist/components/spinner/SpinnerWave.d.ts.map +1 -0
  37. package/dist/components/spinner/index.d.ts +2 -0
  38. package/dist/components/spinner/index.d.ts.map +1 -1
  39. package/dist/index.cjs +23 -13
  40. package/dist/index.cjs.map +1 -1
  41. package/dist/index.d.ts +1 -1
  42. package/dist/index.js +23 -13
  43. package/dist/index.js.map +1 -1
  44. package/dist/index13.cjs +54 -35
  45. package/dist/index13.cjs.map +1 -1
  46. package/dist/index13.js +56 -37
  47. package/dist/index13.js.map +1 -1
  48. package/dist/index14.cjs +29 -12
  49. package/dist/index14.cjs.map +1 -1
  50. package/dist/index14.js +30 -13
  51. package/dist/index14.js.map +1 -1
  52. package/dist/index15.cjs +19 -36
  53. package/dist/index15.cjs.map +1 -1
  54. package/dist/index15.js +19 -36
  55. package/dist/index15.js.map +1 -1
  56. package/dist/index16.cjs +47 -24
  57. package/dist/index16.cjs.map +1 -1
  58. package/dist/index16.js +48 -25
  59. package/dist/index16.js.map +1 -1
  60. package/dist/index17.cjs +29 -38
  61. package/dist/index17.cjs.map +1 -1
  62. package/dist/index17.js +29 -38
  63. package/dist/index17.js.map +1 -1
  64. package/dist/index18.cjs +52 -79
  65. package/dist/index18.cjs.map +1 -1
  66. package/dist/index18.js +54 -81
  67. package/dist/index18.js.map +1 -1
  68. package/dist/index19.cjs +45 -104
  69. package/dist/index19.cjs.map +1 -1
  70. package/dist/index19.js +46 -105
  71. package/dist/index19.js.map +1 -1
  72. package/dist/index20.cjs +58 -108
  73. package/dist/index20.cjs.map +1 -1
  74. package/dist/index20.js +60 -110
  75. package/dist/index20.js.map +1 -1
  76. package/dist/index21.cjs +79 -28
  77. package/dist/index21.cjs.map +1 -1
  78. package/dist/index21.js +82 -31
  79. package/dist/index21.js.map +1 -1
  80. package/dist/index22.cjs +106 -32
  81. package/dist/index22.cjs.map +1 -1
  82. package/dist/index22.js +108 -34
  83. package/dist/index22.js.map +1 -1
  84. package/dist/index23.cjs +112 -34
  85. package/dist/index23.cjs.map +1 -1
  86. package/dist/index23.js +115 -37
  87. package/dist/index23.js.map +1 -1
  88. package/dist/index24.cjs +108 -48
  89. package/dist/index24.cjs.map +1 -1
  90. package/dist/index24.js +110 -50
  91. package/dist/index24.js.map +1 -1
  92. package/dist/index25.cjs +59 -16
  93. package/dist/index25.cjs.map +1 -1
  94. package/dist/index25.js +58 -15
  95. package/dist/index25.js.map +1 -1
  96. package/dist/index26.cjs +66 -0
  97. package/dist/index26.cjs.map +1 -0
  98. package/dist/index26.js +66 -0
  99. package/dist/index26.js.map +1 -0
  100. package/dist/index27.cjs +69 -0
  101. package/dist/index27.cjs.map +1 -0
  102. package/dist/index27.js +69 -0
  103. package/dist/index27.js.map +1 -0
  104. package/dist/index28.cjs +65 -0
  105. package/dist/index28.cjs.map +1 -0
  106. package/dist/index28.js +65 -0
  107. package/dist/index28.js.map +1 -0
  108. package/dist/index29.cjs +71 -0
  109. package/dist/index29.cjs.map +1 -0
  110. package/dist/index29.js +71 -0
  111. package/dist/index29.js.map +1 -0
  112. package/dist/index3.cjs +1 -1
  113. package/dist/index3.js +1 -1
  114. package/dist/index30.cjs +18 -0
  115. package/dist/index30.cjs.map +1 -0
  116. package/dist/index30.js +18 -0
  117. package/dist/index30.js.map +1 -0
  118. package/dist/index31.cjs +42 -0
  119. package/dist/index31.cjs.map +1 -0
  120. package/dist/index31.js +42 -0
  121. package/dist/index31.js.map +1 -0
  122. package/dist/index4.cjs +10 -0
  123. package/dist/index4.cjs.map +1 -1
  124. package/dist/index4.js +10 -0
  125. package/dist/index4.js.map +1 -1
  126. package/dist/premium-react-loaders.css +299 -3
  127. package/dist/types/common.d.ts +14 -2
  128. package/dist/types/common.d.ts.map +1 -1
  129. package/dist/types/progress.d.ts +24 -1
  130. package/dist/types/progress.d.ts.map +1 -1
  131. package/dist/types/pulse.d.ts +13 -0
  132. package/dist/types/pulse.d.ts.map +1 -1
  133. package/dist/types/skeleton.d.ts +17 -0
  134. package/dist/types/skeleton.d.ts.map +1 -1
  135. package/dist/types/spinner.d.ts +18 -0
  136. package/dist/types/spinner.d.ts.map +1 -1
  137. package/dist/utils/colors.d.ts +2 -1
  138. package/dist/utils/colors.d.ts.map +1 -1
  139. package/dist/utils/hooks.d.ts +10 -0
  140. package/dist/utils/hooks.d.ts.map +1 -0
  141. package/dist/utils/index.d.ts +1 -0
  142. package/dist/utils/index.d.ts.map +1 -1
  143. package/package.json +1 -1
package/dist/index15.js CHANGED
@@ -1,25 +1,27 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { getAnimationDuration, normalizeSize, parseSizeToNumber } from "./index4.js";
3
+ import { useReducedMotion, getEffectiveDuration } from "./index31.js";
4
4
  import { cn } from "./index3.js";
5
- const SpinnerDots = forwardRef(
5
+ import { normalizeSize } from "./index4.js";
6
+ const SpinnerRing = forwardRef(
6
7
  ({
7
- size = 40,
8
+ size = "md",
8
9
  color = "#3b82f6",
9
- dotCount = 8,
10
- dotSize = 4,
10
+ secondaryColor = "rgba(0, 0, 0, 0.1)",
11
+ thickness = 4,
11
12
  speed = "normal",
13
+ reverse = false,
14
+ respectMotionPreference = true,
12
15
  className,
13
16
  style,
14
- testId = "spinner-dots",
17
+ testId = "spinner-ring",
15
18
  visible = true,
16
19
  ariaLabel = "Loading...",
17
20
  ...rest
18
21
  }, ref) => {
19
22
  if (!visible) return null;
20
- const sizeValue = parseSizeToNumber(size, 40);
21
- const dotSizeValue = parseSizeToNumber(dotSize, 4);
22
- const radius = (sizeValue - dotSizeValue) / 2;
23
+ const prefersReducedMotion = useReducedMotion();
24
+ const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
23
25
  return /* @__PURE__ */ jsx(
24
26
  "div",
25
27
  {
@@ -34,42 +36,23 @@ const SpinnerDots = forwardRef(
34
36
  children: /* @__PURE__ */ jsx(
35
37
  "div",
36
38
  {
37
- className: "relative",
39
+ className: "rounded-full",
38
40
  style: {
39
41
  width: normalizeSize(size),
40
42
  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
- })
43
+ border: `${thickness}px solid ${secondaryColor}`,
44
+ borderTopColor: color,
45
+ animation: `spinner-rotate ${effectiveDuration} linear infinite`,
46
+ animationDirection: reverse ? "reverse" : "normal"
47
+ }
65
48
  }
66
49
  )
67
50
  }
68
51
  );
69
52
  }
70
53
  );
71
- SpinnerDots.displayName = "SpinnerDots";
54
+ SpinnerRing.displayName = "SpinnerRing";
72
55
  export {
73
- SpinnerDots
56
+ SpinnerRing
74
57
  };
75
58
  //# sourceMappingURL=index15.js.map
@@ -1 +1 @@
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, 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,k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port { SpinnerRingProps } from '../../types';\nimport { cn, normalizeSize, useReducedMotion, getEffectiveDuration } from '../../utils';\n\n/**\n * SpinnerRing - Border-only rotating spinner\n *\n * A ring-style spinner with a transparent center and colored border.\n *\n * @example\n * ```tsx\n * <SpinnerRing size=\"lg\" color=\"#8b5cf6\" />\n * <SpinnerRing size=\"sm\" thickness={3} speed=\"slow\" />\n * <SpinnerRing size=\"md\" color=\"#3b82f6\" secondaryColor=\"#e0e0e0\" reverse />\n * ```\n */\nexport const SpinnerRing = forwardRef<HTMLDivElement, SpinnerRingProps>(\n (\n {\n size = 'md',\n color = '#3b82f6',\n secondaryColor = 'rgba(0, 0, 0, 0.1)',\n thickness = 4,\n speed = 'normal',\n reverse = false,\n respectMotionPreference = true,\n className,\n style,\n testId = 'spinner-ring',\n visible = true,\n ariaLabel = 'Loading...',\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const prefersReducedMotion = useReducedMotion();\n const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);\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=\"rounded-full\"\n style={{\n width: normalizeSize(size),\n height: normalizeSize(size),\n border: `${thickness}px solid ${secondaryColor}`,\n borderTopColor: color,\n animation: `spinner-rotate ${effectiveDuration} linear infinite`,\n animationDirection: reverse ? 'reverse' : 'normal',\n }}\n />\n </div>\n );\n }\n);\n\nSpinnerRing.displayName = 'SpinnerRing';\n"],"names":[],"mappings":";;;;;AAgBO,MAAM,cAAc;AAAA,EACzB,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,iBAAiB;AAAA,IACjB,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,0BAA0B;AAAA,IAC1B;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,uBAAuB,iBAAA;AAC7B,UAAM,oBAAoB,qBAAqB,OAAO,yBAAyB,oBAAoB;AAEnG,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,QAAQ,GAAG,SAAS,YAAY,cAAc;AAAA,cAC9C,gBAAgB;AAAA,cAChB,WAAW,kBAAkB,iBAAiB;AAAA,cAC9C,oBAAoB,UAAU,YAAY;AAAA,YAAA;AAAA,UAC5C;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,YAAY,cAAc;"}
package/dist/index16.cjs CHANGED
@@ -3,56 +3,79 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const react = require("react");
5
5
  const colors = require("./index4.cjs");
6
+ const hooks = require("./index31.cjs");
6
7
  const classNames = require("./index3.cjs");
7
- const SpinnerBars = react.forwardRef(
8
+ const SpinnerDots = react.forwardRef(
8
9
  ({
9
- size = 40,
10
+ size = "md",
10
11
  color = "#3b82f6",
11
- barCount = 5,
12
+ dotCount = 8,
13
+ dotSize = 4,
12
14
  speed = "normal",
15
+ reverse = false,
16
+ respectMotionPreference = true,
13
17
  className,
14
18
  style,
15
- testId = "spinner-bars",
19
+ testId = "spinner-dots",
16
20
  visible = true,
17
21
  ariaLabel = "Loading...",
18
22
  ...rest
19
23
  }, ref) => {
20
24
  if (!visible) return null;
25
+ const prefersReducedMotion = hooks.useReducedMotion();
26
+ const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
21
27
  const sizeValue = colors.parseSizeToNumber(size, 40);
22
- const barWidth = Math.floor(sizeValue / (barCount * 2));
23
- const animationDuration = colors.getAnimationDuration(speed);
28
+ const dotSizeValue = colors.parseSizeToNumber(dotSize, 4);
29
+ const radius = (sizeValue - dotSizeValue) / 2;
24
30
  return /* @__PURE__ */ jsxRuntime.jsx(
25
31
  "div",
26
32
  {
27
33
  ref,
28
34
  "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
- },
35
+ className: classNames.cn("inline-flex items-center justify-center", className),
36
+ style,
34
37
  role: "status",
35
38
  "aria-label": ariaLabel,
36
39
  "aria-busy": "true",
37
40
  ...rest,
38
- children: Array.from({ length: barCount }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
41
+ children: /* @__PURE__ */ jsxRuntime.jsx(
39
42
  "div",
40
43
  {
41
- className: "rounded-sm",
44
+ className: "relative",
42
45
  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
- ))
46
+ width: colors.normalizeSize(size),
47
+ height: colors.normalizeSize(size),
48
+ animation: `spinner-rotate ${effectiveDuration} linear infinite`,
49
+ animationDirection: reverse ? "reverse" : "normal"
50
+ },
51
+ children: Array.from({ length: dotCount }).map((_, index) => {
52
+ const angle = 360 / dotCount * index;
53
+ const radian = angle * Math.PI / 180;
54
+ const x = radius * Math.cos(radian) + radius;
55
+ const y = radius * Math.sin(radian) + radius;
56
+ return /* @__PURE__ */ jsxRuntime.jsx(
57
+ "div",
58
+ {
59
+ className: "absolute rounded-full",
60
+ style: {
61
+ width: colors.normalizeSize(dotSize),
62
+ height: colors.normalizeSize(dotSize),
63
+ backgroundColor: color,
64
+ left: `${x}px`,
65
+ top: `${y}px`,
66
+ opacity: 1 - index / dotCount * 0.7
67
+ // Fade effect
68
+ }
69
+ },
70
+ index
71
+ );
72
+ })
73
+ }
74
+ )
52
75
  }
53
76
  );
54
77
  }
55
78
  );
56
- SpinnerBars.displayName = "SpinnerBars";
57
- exports.SpinnerBars = SpinnerBars;
79
+ SpinnerDots.displayName = "SpinnerDots";
80
+ exports.SpinnerDots = SpinnerDots;
58
81
  //# sourceMappingURL=index16.cjs.map
@@ -1 +1 @@
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, 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;;"}
1
+ {"version":3,"file":"index16.cjs","sources":["../src/components/spinner/SpinnerDots.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerDotsProps } from '../../types';\nimport { cn, normalizeSize, parseSizeToNumber, useReducedMotion, getEffectiveDuration } 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=\"lg\" color=\"#3b82f6\" />\n * <SpinnerDots size=\"md\" dotCount={8} dotSize={6} reverse />\n * ```\n */\nexport const SpinnerDots = forwardRef<HTMLDivElement, SpinnerDotsProps>(\n (\n {\n size = 'md',\n color = '#3b82f6',\n dotCount = 8,\n dotSize = 4,\n speed = 'normal',\n reverse = false,\n respectMotionPreference = true,\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 prefersReducedMotion = useReducedMotion();\n const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);\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 ${effectiveDuration} linear infinite`,\n animationDirection: reverse ? 'reverse' : 'normal',\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","useReducedMotion","getEffectiveDuration","parseSizeToNumber","jsx","cn","normalizeSize"],"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,UAAU;AAAA,IACV,0BAA0B;AAAA,IAC1B;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,uBAAuBC,MAAAA,iBAAA;AAC7B,UAAM,oBAAoBC,MAAAA,qBAAqB,OAAO,yBAAyB,oBAAoB;AAEnG,UAAM,YAAYC,OAAAA,kBAAkB,MAAM,EAAE;AAC5C,UAAM,eAAeA,OAAAA,kBAAkB,SAAS,CAAC;AACjD,UAAM,UAAU,YAAY,gBAAgB;AAE5C,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,kBAAkB,iBAAiB;AAAA,cAC9C,oBAAoB,UAAU,YAAY;AAAA,YAAA;AAAA,YAG3C,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,qBACEF,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/index16.js CHANGED
@@ -1,58 +1,81 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { normalizeSize, getAnimationDuration, parseSizeToNumber } from "./index4.js";
3
+ import { normalizeSize, parseSizeToNumber } from "./index4.js";
4
+ import { useReducedMotion, getEffectiveDuration } from "./index31.js";
4
5
  import { cn } from "./index3.js";
5
- const SpinnerBars = forwardRef(
6
+ const SpinnerDots = forwardRef(
6
7
  ({
7
- size = 40,
8
+ size = "md",
8
9
  color = "#3b82f6",
9
- barCount = 5,
10
+ dotCount = 8,
11
+ dotSize = 4,
10
12
  speed = "normal",
13
+ reverse = false,
14
+ respectMotionPreference = true,
11
15
  className,
12
16
  style,
13
- testId = "spinner-bars",
17
+ testId = "spinner-dots",
14
18
  visible = true,
15
19
  ariaLabel = "Loading...",
16
20
  ...rest
17
21
  }, ref) => {
18
22
  if (!visible) return null;
23
+ const prefersReducedMotion = useReducedMotion();
24
+ const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
19
25
  const sizeValue = parseSizeToNumber(size, 40);
20
- const barWidth = Math.floor(sizeValue / (barCount * 2));
21
- const animationDuration = getAnimationDuration(speed);
26
+ const dotSizeValue = parseSizeToNumber(dotSize, 4);
27
+ const radius = (sizeValue - dotSizeValue) / 2;
22
28
  return /* @__PURE__ */ jsx(
23
29
  "div",
24
30
  {
25
31
  ref,
26
32
  "data-testid": testId,
27
- className: cn("inline-flex items-center justify-center gap-1", className),
28
- style: {
29
- height: normalizeSize(size),
30
- ...style
31
- },
33
+ className: cn("inline-flex items-center justify-center", className),
34
+ style,
32
35
  role: "status",
33
36
  "aria-label": ariaLabel,
34
37
  "aria-busy": "true",
35
38
  ...rest,
36
- children: Array.from({ length: barCount }).map((_, index) => /* @__PURE__ */ jsx(
39
+ children: /* @__PURE__ */ jsx(
37
40
  "div",
38
41
  {
39
- className: "rounded-sm",
42
+ className: "relative",
40
43
  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
- ))
44
+ width: normalizeSize(size),
45
+ height: normalizeSize(size),
46
+ animation: `spinner-rotate ${effectiveDuration} linear infinite`,
47
+ animationDirection: reverse ? "reverse" : "normal"
48
+ },
49
+ children: Array.from({ length: dotCount }).map((_, index) => {
50
+ const angle = 360 / dotCount * index;
51
+ const radian = angle * Math.PI / 180;
52
+ const x = radius * Math.cos(radian) + radius;
53
+ const y = radius * Math.sin(radian) + radius;
54
+ return /* @__PURE__ */ jsx(
55
+ "div",
56
+ {
57
+ className: "absolute rounded-full",
58
+ style: {
59
+ width: normalizeSize(dotSize),
60
+ height: normalizeSize(dotSize),
61
+ backgroundColor: color,
62
+ left: `${x}px`,
63
+ top: `${y}px`,
64
+ opacity: 1 - index / dotCount * 0.7
65
+ // Fade effect
66
+ }
67
+ },
68
+ index
69
+ );
70
+ })
71
+ }
72
+ )
50
73
  }
51
74
  );
52
75
  }
53
76
  );
54
- SpinnerBars.displayName = "SpinnerBars";
77
+ SpinnerDots.displayName = "SpinnerDots";
55
78
  export {
56
- SpinnerBars
79
+ SpinnerDots
57
80
  };
58
81
  //# 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, 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;"}
1
+ {"version":3,"file":"index16.js","sources":["../src/components/spinner/SpinnerDots.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerDotsProps } from '../../types';\nimport { cn, normalizeSize, parseSizeToNumber, useReducedMotion, getEffectiveDuration } 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=\"lg\" color=\"#3b82f6\" />\n * <SpinnerDots size=\"md\" dotCount={8} dotSize={6} reverse />\n * ```\n */\nexport const SpinnerDots = forwardRef<HTMLDivElement, SpinnerDotsProps>(\n (\n {\n size = 'md',\n color = '#3b82f6',\n dotCount = 8,\n dotSize = 4,\n speed = 'normal',\n reverse = false,\n respectMotionPreference = true,\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 prefersReducedMotion = useReducedMotion();\n const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);\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 ${effectiveDuration} linear infinite`,\n animationDirection: reverse ? 'reverse' : 'normal',\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';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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,61 @@
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");
5
+ const hooks = require("./index31.cjs");
6
6
  const colors = require("./index4.cjs");
7
- const SpinnerGrid = react.forwardRef(
7
+ const classNames = require("./index3.cjs");
8
+ const SpinnerBars = react.forwardRef(
8
9
  ({
9
- size = 40,
10
+ size = "md",
10
11
  color = "#3b82f6",
11
- gridSize = 3,
12
+ barCount = 5,
12
13
  speed = "normal",
14
+ reverse = false,
15
+ respectMotionPreference = true,
13
16
  className,
14
17
  style,
15
- testId = "spinner-grid",
18
+ testId = "spinner-bars",
16
19
  visible = true,
17
20
  ariaLabel = "Loading...",
18
21
  ...rest
19
22
  }, ref) => {
20
23
  if (!visible) return null;
24
+ const prefersReducedMotion = hooks.useReducedMotion();
25
+ const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
21
26
  const sizeValue = colors.parseSizeToNumber(size, 40);
22
- const cellSize = Math.floor(sizeValue / gridSize) - 2;
23
- const animationDuration = colors.getAnimationDuration(speed);
27
+ const barWidth = Math.floor(sizeValue / (barCount * 2));
24
28
  return /* @__PURE__ */ jsxRuntime.jsx(
25
29
  "div",
26
30
  {
27
31
  ref,
28
32
  "data-testid": testId,
29
- className: classNames.cn("inline-flex items-center justify-center", className),
30
- style,
33
+ className: classNames.cn("inline-flex items-center justify-center gap-1", className),
34
+ style: {
35
+ height: colors.normalizeSize(size),
36
+ ...style
37
+ },
31
38
  role: "status",
32
39
  "aria-label": ariaLabel,
33
40
  "aria-busy": "true",
34
41
  ...rest,
35
- children: /* @__PURE__ */ jsxRuntime.jsx(
42
+ children: Array.from({ length: barCount }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
36
43
  "div",
37
44
  {
38
- className: "grid gap-0.5",
45
+ className: "rounded-sm",
39
46
  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
- )
47
+ width: `${barWidth}px`,
48
+ height: "100%",
49
+ backgroundColor: color,
50
+ animation: `pulse-wave ${effectiveDuration} ease-in-out infinite`,
51
+ animationDelay: reverse ? `${(barCount - index - 1) * 0.1}s` : `${index * 0.1}s`
52
+ }
53
+ },
54
+ index
55
+ ))
65
56
  }
66
57
  );
67
58
  }
68
59
  );
69
- SpinnerGrid.displayName = "SpinnerGrid";
70
- exports.SpinnerGrid = SpinnerGrid;
60
+ SpinnerBars.displayName = "SpinnerBars";
61
+ exports.SpinnerBars = SpinnerBars;
71
62
  //# 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, 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,EACzB,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,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;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,YAAY,cAAc;;"}
1
+ {"version":3,"file":"index17.cjs","sources":["../src/components/spinner/SpinnerBars.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerBarsProps } from '../../types';\nimport { cn, normalizeSize, parseSizeToNumber, useReducedMotion, getEffectiveDuration } 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=\"lg\" color=\"#3b82f6\" />\n * <SpinnerBars size=\"sm\" barCount={5} speed=\"fast\" reverse />\n * ```\n */\nexport const SpinnerBars = forwardRef<HTMLDivElement, SpinnerBarsProps>(\n (\n {\n size = 'md',\n color = '#3b82f6',\n barCount = 5,\n speed = 'normal',\n reverse = false,\n respectMotionPreference = true,\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 prefersReducedMotion = useReducedMotion();\n const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);\n\n const sizeValue = parseSizeToNumber(size, 40);\n const barWidth = Math.floor(sizeValue / (barCount * 2));\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 ${effectiveDuration} ease-in-out infinite`,\n animationDelay: reverse ? `${(barCount - index - 1) * 0.1}s` : `${index * 0.1}s`,\n }}\n />\n ))}\n </div>\n );\n }\n);\n\nSpinnerBars.displayName = 'SpinnerBars';\n"],"names":["forwardRef","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;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,YAAY,cAAc;;"}
package/dist/index17.js CHANGED
@@ -1,71 +1,62 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
+ import { useReducedMotion, getEffectiveDuration } from "./index31.js";
4
+ import { normalizeSize, parseSizeToNumber } from "./index4.js";
3
5
  import { cn } from "./index3.js";
4
- import { normalizeSize, getAnimationDuration, parseSizeToNumber } from "./index4.js";
5
- const SpinnerGrid = forwardRef(
6
+ const SpinnerBars = forwardRef(
6
7
  ({
7
- size = 40,
8
+ size = "md",
8
9
  color = "#3b82f6",
9
- gridSize = 3,
10
+ barCount = 5,
10
11
  speed = "normal",
12
+ reverse = false,
13
+ respectMotionPreference = true,
11
14
  className,
12
15
  style,
13
- testId = "spinner-grid",
16
+ testId = "spinner-bars",
14
17
  visible = true,
15
18
  ariaLabel = "Loading...",
16
19
  ...rest
17
20
  }, ref) => {
18
21
  if (!visible) return null;
22
+ const prefersReducedMotion = useReducedMotion();
23
+ const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
19
24
  const sizeValue = parseSizeToNumber(size, 40);
20
- const cellSize = Math.floor(sizeValue / gridSize) - 2;
21
- const animationDuration = getAnimationDuration(speed);
25
+ const barWidth = Math.floor(sizeValue / (barCount * 2));
22
26
  return /* @__PURE__ */ jsx(
23
27
  "div",
24
28
  {
25
29
  ref,
26
30
  "data-testid": testId,
27
- className: cn("inline-flex items-center justify-center", className),
28
- style,
31
+ className: cn("inline-flex items-center justify-center gap-1", className),
32
+ style: {
33
+ height: normalizeSize(size),
34
+ ...style
35
+ },
29
36
  role: "status",
30
37
  "aria-label": ariaLabel,
31
38
  "aria-busy": "true",
32
39
  ...rest,
33
- children: /* @__PURE__ */ jsx(
40
+ children: Array.from({ length: barCount }).map((_, index) => /* @__PURE__ */ jsx(
34
41
  "div",
35
42
  {
36
- className: "grid gap-0.5",
43
+ className: "rounded-sm",
37
44
  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
- )
45
+ width: `${barWidth}px`,
46
+ height: "100%",
47
+ backgroundColor: color,
48
+ animation: `pulse-wave ${effectiveDuration} ease-in-out infinite`,
49
+ animationDelay: reverse ? `${(barCount - index - 1) * 0.1}s` : `${index * 0.1}s`
50
+ }
51
+ },
52
+ index
53
+ ))
63
54
  }
64
55
  );
65
56
  }
66
57
  );
67
- SpinnerGrid.displayName = "SpinnerGrid";
58
+ SpinnerBars.displayName = "SpinnerBars";
68
59
  export {
69
- SpinnerGrid
60
+ SpinnerBars
70
61
  };
71
62
  //# 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, 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":[],"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,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, parseSizeToNumber, useReducedMotion, getEffectiveDuration } 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=\"lg\" color=\"#3b82f6\" />\n * <SpinnerBars size=\"sm\" barCount={5} speed=\"fast\" reverse />\n * ```\n */\nexport const SpinnerBars = forwardRef<HTMLDivElement, SpinnerBarsProps>(\n (\n {\n size = 'md',\n color = '#3b82f6',\n barCount = 5,\n speed = 'normal',\n reverse = false,\n respectMotionPreference = true,\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 prefersReducedMotion = useReducedMotion();\n const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);\n\n const sizeValue = parseSizeToNumber(size, 40);\n const barWidth = Math.floor(sizeValue / (barCount * 2));\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 ${effectiveDuration} ease-in-out infinite`,\n animationDelay: reverse ? `${(barCount - index - 1) * 0.1}s` : `${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,UAAU;AAAA,IACV,0BAA0B;AAAA,IAC1B;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,uBAAuB,iBAAA;AAC7B,UAAM,oBAAoB,qBAAqB,OAAO,yBAAyB,oBAAoB;AAEnG,UAAM,YAAY,kBAAkB,MAAM,EAAE;AAC5C,UAAM,WAAW,KAAK,MAAM,aAAa,WAAW,EAAE;AAEtD,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb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