premium-react-loaders 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/dist/components/progress/ProgressBar.d.ts +2 -0
  2. package/dist/components/progress/ProgressBar.d.ts.map +1 -1
  3. package/dist/components/progress/ProgressCircle.d.ts +2 -1
  4. package/dist/components/progress/ProgressCircle.d.ts.map +1 -1
  5. package/dist/components/progress/ProgressRing.d.ts +2 -1
  6. package/dist/components/progress/ProgressRing.d.ts.map +1 -1
  7. package/dist/components/progress/ProgressSteps.d.ts +16 -0
  8. package/dist/components/progress/ProgressSteps.d.ts.map +1 -0
  9. package/dist/components/progress/index.d.ts +1 -0
  10. package/dist/components/progress/index.d.ts.map +1 -1
  11. package/dist/components/pulse/TypingIndicator.d.ts +16 -0
  12. package/dist/components/pulse/TypingIndicator.d.ts.map +1 -0
  13. package/dist/components/pulse/index.d.ts +1 -0
  14. package/dist/components/pulse/index.d.ts.map +1 -1
  15. package/dist/components/skeleton/SkeletonForm.d.ts +16 -0
  16. package/dist/components/skeleton/SkeletonForm.d.ts.map +1 -0
  17. package/dist/components/skeleton/SkeletonText.d.ts +1 -1
  18. package/dist/components/skeleton/SkeletonText.d.ts.map +1 -1
  19. package/dist/components/skeleton/index.d.ts +1 -0
  20. package/dist/components/skeleton/index.d.ts.map +1 -1
  21. package/dist/components/spinner/SpinnerDots.d.ts.map +1 -1
  22. package/dist/components/spinner/SpinnerPulse.d.ts +15 -0
  23. package/dist/components/spinner/SpinnerPulse.d.ts.map +1 -0
  24. package/dist/components/spinner/SpinnerRing.d.ts +1 -0
  25. package/dist/components/spinner/SpinnerRing.d.ts.map +1 -1
  26. package/dist/components/spinner/SpinnerWave.d.ts +15 -0
  27. package/dist/components/spinner/SpinnerWave.d.ts.map +1 -0
  28. package/dist/components/spinner/index.d.ts +2 -0
  29. package/dist/components/spinner/index.d.ts.map +1 -1
  30. package/dist/index.cjs +23 -13
  31. package/dist/index.cjs.map +1 -1
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.js +23 -13
  34. package/dist/index.js.map +1 -1
  35. package/dist/index13.cjs +54 -35
  36. package/dist/index13.cjs.map +1 -1
  37. package/dist/index13.js +56 -37
  38. package/dist/index13.js.map +1 -1
  39. package/dist/index14.cjs +23 -11
  40. package/dist/index14.cjs.map +1 -1
  41. package/dist/index14.js +23 -11
  42. package/dist/index14.js.map +1 -1
  43. package/dist/index15.cjs +10 -32
  44. package/dist/index15.cjs.map +1 -1
  45. package/dist/index15.js +10 -32
  46. package/dist/index15.js.map +1 -1
  47. package/dist/index16.cjs +41 -24
  48. package/dist/index16.cjs.map +1 -1
  49. package/dist/index16.js +42 -25
  50. package/dist/index16.js.map +1 -1
  51. package/dist/index17.cjs +24 -37
  52. package/dist/index17.cjs.map +1 -1
  53. package/dist/index17.js +24 -37
  54. package/dist/index17.js.map +1 -1
  55. package/dist/index18.cjs +48 -58
  56. package/dist/index18.cjs.map +1 -1
  57. package/dist/index18.js +49 -59
  58. package/dist/index18.js.map +1 -1
  59. package/dist/index19.cjs +41 -83
  60. package/dist/index19.cjs.map +1 -1
  61. package/dist/index19.js +42 -84
  62. package/dist/index19.js.map +1 -1
  63. package/dist/index20.cjs +54 -87
  64. package/dist/index20.cjs.map +1 -1
  65. package/dist/index20.js +55 -88
  66. package/dist/index20.js.map +1 -1
  67. package/dist/index21.cjs +73 -27
  68. package/dist/index21.cjs.map +1 -1
  69. package/dist/index21.js +76 -30
  70. package/dist/index21.js.map +1 -1
  71. package/dist/index22.cjs +98 -31
  72. package/dist/index22.cjs.map +1 -1
  73. package/dist/index22.js +100 -33
  74. package/dist/index22.js.map +1 -1
  75. package/dist/index23.cjs +104 -33
  76. package/dist/index23.cjs.map +1 -1
  77. package/dist/index23.js +107 -36
  78. package/dist/index23.js.map +1 -1
  79. package/dist/index24.cjs +108 -48
  80. package/dist/index24.cjs.map +1 -1
  81. package/dist/index24.js +110 -50
  82. package/dist/index24.js.map +1 -1
  83. package/dist/index25.cjs +55 -16
  84. package/dist/index25.cjs.map +1 -1
  85. package/dist/index25.js +54 -15
  86. package/dist/index25.js.map +1 -1
  87. package/dist/index26.cjs +62 -0
  88. package/dist/index26.cjs.map +1 -0
  89. package/dist/index26.js +62 -0
  90. package/dist/index26.js.map +1 -0
  91. package/dist/index27.cjs +64 -0
  92. package/dist/index27.cjs.map +1 -0
  93. package/dist/index27.js +64 -0
  94. package/dist/index27.js.map +1 -0
  95. package/dist/index28.cjs +61 -0
  96. package/dist/index28.cjs.map +1 -0
  97. package/dist/index28.js +61 -0
  98. package/dist/index28.js.map +1 -0
  99. package/dist/index29.cjs +71 -0
  100. package/dist/index29.cjs.map +1 -0
  101. package/dist/index29.js +71 -0
  102. package/dist/index29.js.map +1 -0
  103. package/dist/index3.cjs +1 -1
  104. package/dist/index3.js +1 -1
  105. package/dist/index30.cjs +18 -0
  106. package/dist/index30.cjs.map +1 -0
  107. package/dist/index30.js +18 -0
  108. package/dist/index30.js.map +1 -0
  109. package/dist/index4.cjs +63 -3
  110. package/dist/index4.cjs.map +1 -1
  111. package/dist/index4.js +64 -4
  112. package/dist/index4.js.map +1 -1
  113. package/dist/index6.cjs +2 -1
  114. package/dist/index6.cjs.map +1 -1
  115. package/dist/index6.js +2 -1
  116. package/dist/index6.js.map +1 -1
  117. package/dist/premium-react-loaders.css +32 -0
  118. package/dist/types/progress.d.ts +32 -1
  119. package/dist/types/progress.d.ts.map +1 -1
  120. package/dist/types/pulse.d.ts +13 -0
  121. package/dist/types/pulse.d.ts.map +1 -1
  122. package/dist/types/skeleton.d.ts +19 -0
  123. package/dist/types/skeleton.d.ts.map +1 -1
  124. package/dist/types/spinner.d.ts +18 -0
  125. package/dist/types/spinner.d.ts.map +1 -1
  126. package/dist/utils/colors.d.ts +14 -1
  127. package/dist/utils/colors.d.ts.map +1 -1
  128. package/package.json +1 -1
package/dist/index21.js CHANGED
@@ -1,57 +1,103 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
- import { normalizeSize, getAnimationDuration } from "./index4.js";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { forwardRef, useMemo } from "react";
3
+ import { normalizeSize, getAnimationDuration, getContrastColor } from "./index4.js";
4
4
  import { cn } from "./index3.js";
5
- const PulseDots = forwardRef(
5
+ const ProgressBar = forwardRef(
6
6
  ({
7
- size = 40,
7
+ value = 0,
8
+ indeterminate = false,
9
+ showValue = false,
10
+ height = "0.5rem",
8
11
  color = "#3b82f6",
9
- dotCount = 3,
10
- dotSize = 10,
12
+ secondaryColor = "#e0e0e0",
13
+ gradient = false,
14
+ buffer,
11
15
  speed = "normal",
12
16
  className,
13
17
  style,
14
- testId = "pulse-dots",
18
+ testId = "progress-bar",
15
19
  visible = true,
16
- ariaLabel = "Loading...",
20
+ ariaLabel,
17
21
  ...rest
18
22
  }, ref) => {
19
23
  if (!visible) return null;
24
+ const clampedValue = Math.min(100, Math.max(0, value));
25
+ const clampedBuffer = buffer !== void 0 ? Math.min(100, Math.max(0, buffer)) : void 0;
26
+ const progressLabel = ariaLabel || `Loading ${clampedValue}%`;
20
27
  const animationDuration = getAnimationDuration(speed);
21
- return /* @__PURE__ */ jsx(
28
+ const gradientId = useMemo(() => `progress-bar-gradient-${Math.random().toString(36).substr(2, 9)}`, []);
29
+ return /* @__PURE__ */ jsxs(
22
30
  "div",
23
31
  {
24
32
  ref,
25
33
  "data-testid": testId,
26
- className: cn("inline-flex items-center justify-center gap-2", className),
34
+ className: cn("relative w-full overflow-hidden rounded-full", className),
27
35
  style: {
28
- height: normalizeSize(size),
36
+ height: normalizeSize(height),
37
+ backgroundColor: secondaryColor,
29
38
  ...style
30
39
  },
31
- role: "status",
32
- "aria-label": ariaLabel,
33
- "aria-busy": "true",
40
+ role: "progressbar",
41
+ "aria-label": progressLabel,
42
+ "aria-valuenow": indeterminate ? void 0 : clampedValue,
43
+ "aria-valuemin": 0,
44
+ "aria-valuemax": 100,
34
45
  ...rest,
35
- children: Array.from({ length: dotCount }).map((_, index) => /* @__PURE__ */ jsx(
36
- "div",
37
- {
38
- className: "rounded-full",
39
- style: {
40
- width: normalizeSize(dotSize),
41
- height: normalizeSize(dotSize),
42
- backgroundColor: color,
43
- animation: `pulse-bounce ${animationDuration} ease-in-out infinite`,
44
- animationDelay: `${index * 0.15}s`
46
+ children: [
47
+ gradient && !indeterminate && /* @__PURE__ */ jsx("svg", { width: "0", height: "0", style: { position: "absolute" }, children: /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: gradientId, x1: "0%", y1: "0%", x2: "100%", y2: "0%", children: [
48
+ /* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: color }),
49
+ /* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: secondaryColor || "#8b5cf6" })
50
+ ] }) }) }),
51
+ clampedBuffer !== void 0 && !indeterminate && /* @__PURE__ */ jsx(
52
+ "div",
53
+ {
54
+ className: "absolute h-full rounded-full opacity-30",
55
+ style: {
56
+ width: `${clampedBuffer}%`,
57
+ backgroundColor: color
58
+ }
45
59
  }
46
- },
47
- index
48
- ))
60
+ ),
61
+ indeterminate ? /* @__PURE__ */ jsx(
62
+ "div",
63
+ {
64
+ className: "absolute h-full rounded-full",
65
+ style: {
66
+ backgroundColor: gradient ? `url(#${gradientId})` : color,
67
+ animation: `progress-indeterminate ${animationDuration} ease-in-out infinite`,
68
+ width: "40%"
69
+ }
70
+ }
71
+ ) : /* @__PURE__ */ jsx(
72
+ "div",
73
+ {
74
+ className: "h-full rounded-full transition-all duration-300 ease-in-out",
75
+ style: {
76
+ width: `${clampedValue}%`,
77
+ background: gradient ? `url(#${gradientId})` : color
78
+ }
79
+ }
80
+ ),
81
+ showValue && !indeterminate && /* @__PURE__ */ jsxs(
82
+ "span",
83
+ {
84
+ className: "absolute inset-0 flex items-center justify-center text-xs font-medium",
85
+ style: {
86
+ color: clampedValue > 50 ? getContrastColor(color) : secondaryColor === "#e0e0e0" ? "#000000" : getContrastColor(secondaryColor)
87
+ },
88
+ children: [
89
+ clampedValue,
90
+ "%"
91
+ ]
92
+ }
93
+ )
94
+ ]
49
95
  }
50
96
  );
51
97
  }
52
98
  );
53
- PulseDots.displayName = "PulseDots";
99
+ ProgressBar.displayName = "ProgressBar";
54
100
  export {
55
- PulseDots
101
+ ProgressBar
56
102
  };
57
103
  //# sourceMappingURL=index21.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index21.js","sources":["../src/components/pulse/PulseDots.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { PulseDotsProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration } from '../../utils';\n\n/**\n * PulseDots - Bouncing dots loader\n *\n * A loader with bouncing dots that scale and fade in a sequence.\n *\n * @example\n * ```tsx\n * <PulseDots size={40} color=\"#3b82f6\" />\n * <PulseDots size={32} dotCount={5} speed=\"fast\" />\n * ```\n */\nexport const PulseDots = forwardRef<HTMLDivElement, PulseDotsProps>(\n (\n {\n size = 40,\n color = '#3b82f6',\n dotCount = 3,\n dotSize = 10,\n speed = 'normal',\n className,\n style,\n testId = 'pulse-dots',\n visible = true,\n ariaLabel = 'Loading...',\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const animationDuration = getAnimationDuration(speed);\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('inline-flex items-center justify-center gap-2', className)}\n style={{\n height: normalizeSize(size),\n ...style,\n }}\n role=\"status\"\n aria-label={ariaLabel}\n aria-busy=\"true\"\n {...rest}\n >\n {Array.from({ length: dotCount }).map((_, index) => (\n <div\n key={index}\n className=\"rounded-full\"\n style={{\n width: normalizeSize(dotSize),\n height: normalizeSize(dotSize),\n backgroundColor: color,\n animation: `pulse-bounce ${animationDuration} ease-in-out infinite`,\n animationDelay: `${index * 0.15}s`,\n }}\n />\n ))}\n </div>\n );\n }\n);\n\nPulseDots.displayName = 'PulseDots';\n"],"names":[],"mappings":";;;;AAeO,MAAM,YAAY;AAAA,EACvB,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,UAAU;AAAA,IACV,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,UAAM,oBAAoB,qBAAqB,KAAK;AAEpD,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAW,GAAG,iDAAiD,SAAS;AAAA,QACxE,OAAO;AAAA,UACL,QAAQ,cAAc,IAAI;AAAA,UAC1B,GAAG;AAAA,QAAA;AAAA,QAEL,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEH,UAAA,MAAM,KAAK,EAAE,QAAQ,UAAU,EAAE,IAAI,CAAC,GAAG,UACxC;AAAA,UAAC;AAAA,UAAA;AAAA,YAEC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,OAAO,cAAc,OAAO;AAAA,cAC5B,QAAQ,cAAc,OAAO;AAAA,cAC7B,iBAAiB;AAAA,cACjB,WAAW,gBAAgB,iBAAiB;AAAA,cAC5C,gBAAgB,GAAG,QAAQ,IAAI;AAAA,YAAA;AAAA,UACjC;AAAA,UARK;AAAA,QAAA,CAUR;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,UAAU,cAAc;"}
1
+ {"version":3,"file":"index21.js","sources":["../src/components/progress/ProgressBar.tsx"],"sourcesContent":["import { forwardRef, useMemo } from 'react';\nimport { ProgressBarProps } from '../../types';\nimport { cn, normalizeSize, getContrastColor, getAnimationDuration } from '../../utils';\n\n/**\n * ProgressBar - Linear progress bar\n *\n * A horizontal progress bar that can be determinate (showing specific progress) or indeterminate (loading animation).\n *\n * @example\n * ```tsx\n * <ProgressBar value={75} showValue />\n * <ProgressBar indeterminate />\n * <ProgressBar value={50} height={8} color=\"#8b5cf6\" />\n * <ProgressBar value={50} buffer={75} /> // YouTube-style buffering\n * <ProgressBar value={60} gradient /> // Gradient progress\n * ```\n */\nexport const ProgressBar = forwardRef<HTMLDivElement, ProgressBarProps>(\n (\n {\n value = 0,\n indeterminate = false,\n showValue = false,\n height = '0.5rem',\n color = '#3b82f6',\n secondaryColor = '#e0e0e0',\n gradient = false,\n buffer,\n speed = 'normal',\n className,\n style,\n testId = 'progress-bar',\n visible = true,\n ariaLabel,\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const clampedValue = Math.min(100, Math.max(0, value));\n const clampedBuffer = buffer !== undefined ? Math.min(100, Math.max(0, buffer)) : undefined;\n const progressLabel = ariaLabel || `Loading ${clampedValue}%`;\n const animationDuration = getAnimationDuration(speed);\n\n // Generate gradient ID for SVG-based gradient\n const gradientId = useMemo(() => `progress-bar-gradient-${Math.random().toString(36).substr(2, 9)}`, []);\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('relative w-full overflow-hidden rounded-full', className)}\n style={{\n height: normalizeSize(height),\n backgroundColor: secondaryColor,\n ...style,\n }}\n role=\"progressbar\"\n aria-label={progressLabel}\n aria-valuenow={indeterminate ? undefined : clampedValue}\n aria-valuemin={0}\n aria-valuemax={100}\n {...rest}\n >\n {/* Gradient SVG definition */}\n {gradient && !indeterminate && (\n <svg width=\"0\" height=\"0\" style={{ position: 'absolute' }}>\n <defs>\n <linearGradient id={gradientId} x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\">\n <stop offset=\"0%\" stopColor={color} />\n <stop offset=\"100%\" stopColor={secondaryColor || '#8b5cf6'} />\n </linearGradient>\n </defs>\n </svg>\n )}\n\n {/* Buffer indicator (shows behind main progress) */}\n {clampedBuffer !== undefined && !indeterminate && (\n <div\n className=\"absolute h-full rounded-full opacity-30\"\n style={{\n width: `${clampedBuffer}%`,\n backgroundColor: color,\n }}\n />\n )}\n\n {indeterminate ? (\n <div\n className=\"absolute h-full rounded-full\"\n style={{\n backgroundColor: gradient ? `url(#${gradientId})` : color,\n animation: `progress-indeterminate ${animationDuration} ease-in-out infinite`,\n width: '40%',\n }}\n />\n ) : (\n <div\n className=\"h-full rounded-full transition-all duration-300 ease-in-out\"\n style={{\n width: `${clampedValue}%`,\n background: gradient ? `url(#${gradientId})` : color,\n }}\n />\n )}\n\n {showValue && !indeterminate && (\n <span\n className=\"absolute inset-0 flex items-center justify-center text-xs font-medium\"\n style={{\n color: clampedValue > 50 ? getContrastColor(color) : secondaryColor === '#e0e0e0' ? '#000000' : getContrastColor(secondaryColor)\n }}\n >\n {clampedValue}%\n </span>\n )}\n </div>\n );\n }\n);\n\nProgressBar.displayName = 'ProgressBar';\n"],"names":[],"mappings":";;;;AAkBO,MAAM,cAAc;AAAA,EACzB,CACE;AAAA,IACE,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,iBAAiB;AAAA,IACjB,WAAW;AAAA,IACX;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,UAAM,eAAe,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC;AACrD,UAAM,gBAAgB,WAAW,SAAY,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,MAAM,CAAC,IAAI;AAClF,UAAM,gBAAgB,aAAa,WAAW,YAAY;AAC1D,UAAM,oBAAoB,qBAAqB,KAAK;AAGpD,UAAM,aAAa,QAAQ,MAAM,yBAAyB,KAAK,SAAS,SAAS,EAAE,EAAE,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE;AAEvG,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAW,GAAG,gDAAg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AC;AAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,OAAO;AAAA,gBACL,OAAO,eAAe,KAAK,iBAAiB,KAAK,IAAI,mBAAmB,YAAY,YAAY,iBAAiB,cAAc;AAAA,cAAA;AAAA,cAGhI,UAAA;AAAA,gBAAA;AAAA,gBAAa;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAChB;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,YAAY,cAAc;"}
package/dist/index22.cjs CHANGED
@@ -4,59 +4,126 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const react = require("react");
5
5
  const colors = require("./index4.cjs");
6
6
  const classNames = require("./index3.cjs");
7
- const PulseWave = react.forwardRef(
7
+ const ProgressCircle = react.forwardRef(
8
8
  ({
9
- size = 40,
9
+ value = 0,
10
+ indeterminate = false,
11
+ showValue = false,
12
+ size = 60,
13
+ thickness = 4,
10
14
  color = "#3b82f6",
11
- barCount = 5,
15
+ secondaryColor = "#e0e0e0",
16
+ buffer,
12
17
  speed = "normal",
13
18
  className,
14
19
  style,
15
- testId = "pulse-wave",
20
+ testId = "progress-circle",
16
21
  visible = true,
17
- ariaLabel = "Loading...",
22
+ ariaLabel,
18
23
  ...rest
19
24
  }, ref) => {
20
25
  if (!visible) return null;
21
- const sizeValue = typeof size === "number" ? size : parseInt(String(size), 10);
22
- const barWidth = Math.floor(sizeValue / (barCount * 2.5));
26
+ const clampedValue = Math.min(100, Math.max(0, value));
27
+ const clampedBuffer = buffer !== void 0 ? Math.min(100, Math.max(0, buffer)) : void 0;
28
+ const sizeValue = colors.parseSizeToNumber(size, 60);
29
+ const thicknessValue = colors.parseSizeToNumber(thickness, 4);
30
+ const radius = (sizeValue - thicknessValue * 2) / 2;
31
+ const circumference = 2 * Math.PI * radius;
32
+ const strokeDashoffset = circumference - clampedValue / 100 * circumference;
33
+ const bufferDashoffset = clampedBuffer !== void 0 ? circumference - clampedBuffer / 100 * circumference : void 0;
34
+ const progressLabel = ariaLabel || `Loading ${clampedValue}%`;
23
35
  const animationDuration = colors.getAnimationDuration(speed);
24
- return /* @__PURE__ */ jsxRuntime.jsx(
36
+ return /* @__PURE__ */ jsxRuntime.jsxs(
25
37
  "div",
26
38
  {
27
39
  ref,
28
40
  "data-testid": testId,
29
- className: classNames.cn("inline-flex items-end justify-center gap-1", className),
41
+ className: classNames.cn("inline-flex items-center justify-center relative", className),
30
42
  style: {
43
+ width: colors.normalizeSize(size),
31
44
  height: colors.normalizeSize(size),
32
45
  ...style
33
46
  },
34
- role: "status",
35
- "aria-label": ariaLabel,
36
- "aria-busy": "true",
47
+ role: "progressbar",
48
+ "aria-label": progressLabel,
49
+ "aria-valuenow": indeterminate ? void 0 : clampedValue,
50
+ "aria-valuemin": 0,
51
+ "aria-valuemax": 100,
37
52
  ...rest,
38
- children: Array.from({ length: barCount }).map((_, index) => {
39
- const delay = index / barCount * 0.5;
40
- return /* @__PURE__ */ jsxRuntime.jsx(
41
- "div",
53
+ children: [
54
+ /* @__PURE__ */ jsxRuntime.jsxs(
55
+ "svg",
42
56
  {
43
- className: "rounded-sm",
44
- style: {
45
- width: `${barWidth}px`,
46
- height: "100%",
47
- backgroundColor: color,
48
- animation: `pulse-wave ${animationDuration} ease-in-out infinite`,
49
- animationDelay: `${delay}s`,
50
- transformOrigin: "bottom"
51
- }
52
- },
53
- index
54
- );
55
- })
57
+ className: classNames.cn(indeterminate && "animate-spinner-rotate"),
58
+ width: sizeValue,
59
+ height: sizeValue,
60
+ viewBox: `0 0 ${sizeValue} ${sizeValue}`,
61
+ style: indeterminate ? { animation: `spinner-rotate ${animationDuration} linear infinite` } : void 0,
62
+ children: [
63
+ /* @__PURE__ */ jsxRuntime.jsx(
64
+ "circle",
65
+ {
66
+ cx: sizeValue / 2,
67
+ cy: sizeValue / 2,
68
+ r: radius,
69
+ fill: "none",
70
+ stroke: secondaryColor,
71
+ strokeWidth: thicknessValue
72
+ }
73
+ ),
74
+ bufferDashoffset !== void 0 && !indeterminate && /* @__PURE__ */ jsxRuntime.jsx(
75
+ "circle",
76
+ {
77
+ cx: sizeValue / 2,
78
+ cy: sizeValue / 2,
79
+ r: radius,
80
+ fill: "none",
81
+ stroke: color,
82
+ strokeWidth: thicknessValue,
83
+ strokeLinecap: "round",
84
+ strokeDasharray: circumference,
85
+ strokeDashoffset: bufferDashoffset,
86
+ transform: `rotate(-90 ${sizeValue / 2} ${sizeValue / 2})`,
87
+ opacity: 0.3
88
+ }
89
+ ),
90
+ /* @__PURE__ */ jsxRuntime.jsx(
91
+ "circle",
92
+ {
93
+ cx: sizeValue / 2,
94
+ cy: sizeValue / 2,
95
+ r: radius,
96
+ fill: "none",
97
+ stroke: color,
98
+ strokeWidth: thicknessValue,
99
+ strokeLinecap: "round",
100
+ strokeDasharray: circumference,
101
+ strokeDashoffset: indeterminate ? circumference * 0.75 : strokeDashoffset,
102
+ transform: `rotate(-90 ${sizeValue / 2} ${sizeValue / 2})`,
103
+ style: {
104
+ transition: indeterminate ? "none" : "stroke-dashoffset 0.3s ease-in-out"
105
+ }
106
+ }
107
+ )
108
+ ]
109
+ }
110
+ ),
111
+ showValue && !indeterminate && /* @__PURE__ */ jsxRuntime.jsxs(
112
+ "span",
113
+ {
114
+ className: "absolute text-sm font-medium",
115
+ style: { color },
116
+ children: [
117
+ clampedValue,
118
+ "%"
119
+ ]
120
+ }
121
+ )
122
+ ]
56
123
  }
57
124
  );
58
125
  }
59
126
  );
60
- PulseWave.displayName = "PulseWave";
61
- exports.PulseWave = PulseWave;
127
+ ProgressCircle.displayName = "ProgressCircle";
128
+ exports.ProgressCircle = ProgressCircle;
62
129
  //# sourceMappingURL=index22.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index22.cjs","sources":["../src/components/pulse/PulseWave.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { PulseWaveProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration } from '../../utils';\n\n/**\n * PulseWave - Wave pattern loader\n *\n * A loader with bars that animate in a wave pattern.\n *\n * @example\n * ```tsx\n * <PulseWave size={40} color=\"#3b82f6\" />\n * <PulseWave size={32} barCount={7} speed=\"slow\" />\n * ```\n */\nexport const PulseWave = forwardRef<HTMLDivElement, PulseWaveProps>(\n (\n {\n size = 40,\n color = '#3b82f6',\n barCount = 5,\n speed = 'normal',\n className,\n style,\n testId = 'pulse-wave',\n visible = true,\n ariaLabel = 'Loading...',\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const sizeValue = typeof size === 'number' ? size : parseInt(String(size), 10);\n const barWidth = Math.floor(sizeValue / (barCount * 2.5));\n const animationDuration = getAnimationDuration(speed);\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('inline-flex items-end justify-center gap-1', className)}\n style={{\n height: normalizeSize(size),\n ...style,\n }}\n role=\"status\"\n aria-label={ariaLabel}\n aria-busy=\"true\"\n {...rest}\n >\n {Array.from({ length: barCount }).map((_, index) => {\n const delay = (index / barCount) * 0.5;\n\n return (\n <div\n key={index}\n className=\"rounded-sm\"\n style={{\n width: `${barWidth}px`,\n height: '100%',\n backgroundColor: color,\n animation: `pulse-wave ${animationDuration} ease-in-out infinite`,\n animationDelay: `${delay}s`,\n transformOrigin: 'bottom',\n }}\n />\n );\n })}\n </div>\n );\n }\n);\n\nPulseWave.displayName = 'PulseWave';\n"],"names":["forwardRef","getAnimationDuration","jsx","cn","normalizeSize"],"mappings":";;;;;;AAeO,MAAM,YAAYA,MAAAA;AAAAA,EACvB,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,UAAM,YAAY,OAAO,SAAS,WAAW,OAAO,SAAS,OAAO,IAAI,GAAG,EAAE;AAC7E,UAAM,WAAW,KAAK,MAAM,aAAa,WAAW,IAAI;AACxD,UAAM,oBAAoBC,OAAAA,qBAAqB,KAAK;AAEpD,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAWC,WAAAA,GAAG,8CAA8C,SAAS;AAAA,QACrE,OAAO;AAAA,UACL,QAAQC,OAAAA,cAAc,IAAI;AAAA,UAC1B,GAAG;AAAA,QAAA;AAAA,QAEL,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEH,UAAA,MAAM,KAAK,EAAE,QAAQ,SAAA,CAAU,EAAE,IAAI,CAAC,GAAG,UAAU;AAClD,gBAAM,QAAS,QAAQ,WAAY;AAEnC,iBACEF,2BAAAA;AAAAA,YAAC;AAAA,YAAA;AAAA,cAEC,WAAU;AAAA,cACV,OAAO;AAAA,gBACL,OAAO,GAAG,QAAQ;AAAA,gBAClB,QAAQ;AAAA,gBACR,iBAAiB;AAAA,gBACjB,WAAW,cAAc,iBAAiB;AAAA,gBAC1C,gBAAgB,GAAG,KAAK;AAAA,gBACxB,iBAAiB;AAAA,cAAA;AAAA,YACnB;AAAA,YATK;AAAA,UAAA;AAAA,QAYX,CAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,UAAU,cAAc;;"}
1
+ {"version":3,"file":"index22.cjs","sources":["../src/components/progress/ProgressCircle.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { ProgressCircleProps } from '../../types';\nimport { cn, normalizeSize, parseSizeToNumber, getAnimationDuration } from '../../utils';\n\n/**\n * ProgressCircle - SVG-based circular progress indicator\n *\n * A circular progress indicator that shows progress as a partial circle.\n *\n * @example\n * ```tsx\n * <ProgressCircle value={75} showValue />\n * <ProgressCircle value={50} size={80} thickness={6} />\n * <ProgressCircle indeterminate speed=\"fast\" />\n * <ProgressCircle value={50} buffer={75} />\n * ```\n */\nexport const ProgressCircle = forwardRef<HTMLDivElement, ProgressCircleProps>(\n (\n {\n value = 0,\n indeterminate = false,\n showValue = false,\n size = 60,\n thickness = 4,\n color = '#3b82f6',\n secondaryColor = '#e0e0e0',\n buffer,\n speed = 'normal',\n className,\n style,\n testId = 'progress-circle',\n visible = true,\n ariaLabel,\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const clampedValue = Math.min(100, Math.max(0, value));\n const clampedBuffer = buffer !== undefined ? Math.min(100, Math.max(0, buffer)) : undefined;\n const sizeValue = parseSizeToNumber(size, 60);\n const thicknessValue = parseSizeToNumber(thickness, 4);\n const radius = (sizeValue - thicknessValue * 2) / 2;\n const circumference = 2 * Math.PI * radius;\n const strokeDashoffset = circumference - (clampedValue / 100) * circumference;\n const bufferDashoffset = clampedBuffer !== undefined ? circumference - (clampedBuffer / 100) * circumference : undefined;\n const progressLabel = ariaLabel || `Loading ${clampedValue}%`;\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 relative', className)}\n style={{\n width: normalizeSize(size),\n height: normalizeSize(size),\n ...style,\n }}\n role=\"progressbar\"\n aria-label={progressLabel}\n aria-valuenow={indeterminate ? undefined : clampedValue}\n aria-valuemin={0}\n aria-valuemax={100}\n {...rest}\n >\n <svg\n className={cn(indeterminate && 'animate-spinner-rotate')}\n width={sizeValue}\n height={sizeValue}\n viewBox={`0 0 ${sizeValue} ${sizeValue}`}\n style={indeterminate ? { animation: `spinner-rotate ${animationDuration} linear infinite` } : undefined}\n >\n {/* Background circle */}\n <circle\n cx={sizeValue / 2}\n cy={sizeValue / 2}\n r={radius}\n fill=\"none\"\n stroke={secondaryColor}\n strokeWidth={thicknessValue}\n />\n {/* Buffer circle (behind progress) */}\n {bufferDashoffset !== undefined && !indeterminate && (\n <circle\n cx={sizeValue / 2}\n cy={sizeValue / 2}\n r={radius}\n fill=\"none\"\n stroke={color}\n strokeWidth={thicknessValue}\n strokeLinecap=\"round\"\n strokeDasharray={circumference}\n strokeDashoffset={bufferDashoffset}\n transform={`rotate(-90 ${sizeValue / 2} ${sizeValue / 2})`}\n opacity={0.3}\n />\n )}\n {/* Progress circle */}\n <circle\n cx={sizeValue / 2}\n cy={sizeValue / 2}\n r={radius}\n fill=\"none\"\n stroke={color}\n strokeWidth={thicknessValue}\n strokeLinecap=\"round\"\n strokeDasharray={circumference}\n strokeDashoffset={indeterminate ? circumference * 0.75 : strokeDashoffset}\n transform={`rotate(-90 ${sizeValue / 2} ${sizeValue / 2})`}\n style={{\n transition: indeterminate ? 'none' : 'stroke-dashoffset 0.3s ease-in-out',\n }}\n />\n </svg>\n {showValue && !indeterminate && (\n <span\n className=\"absolute text-sm font-medium\"\n style={{ color }}\n >\n {clampedValue}%\n </span>\n )}\n </div>\n );\n }\n);\n\nProgressCircle.displayName = 'ProgressCircle';\n"],"names":["forwardRef","parseSizeToNumber","getAnimationDuration","jsxs","cn","normalizeSize","jsx"],"mappings":";;;;;;AAiBO,MAAM,iBAAiBA,MAAAA;AAAAA,EAC5B,CACE;AAAA,IACE,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,iBAAiB;AAAA,IACjB;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,UAAM,eAAe,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC;AACrD,UAAM,gBAAgB,WAAW,SAAY,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,MAAM,CAAC,IAAI;AAClF,UAAM,YAAYC,OAAAA,kBAAkB,MAAM,EAAE;AAC5C,UAAM,iBAAiBA,OAAAA,kBAAkB,WAAW,CAAC;AACrD,UAAM,UAAU,YAAY,iBAAiB,KAAK;AAClD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AK;AAAA,oBACL,QAAQ;AAAA,oBACR,aAAa;AAAA,oBACb,eAAc;AAAA,oBACd,iBAAiB;AAAA,oBACjB,kBAAkB;AAAA,oBAClB,WAAW,cAAc,YAAY,CAAC,IAAI,YAAY,CAAC;AAAA,oBACvD,SAAS;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAIbA,2BAAAA;AAAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,IAAI,YAAY;AAAA,oBAChB,IAAI,YAAY;AAAA,oBAChB,GAAG;AAAA,oBACH,MAAK;AAAA,oBACL,QAAQ;AAAA,oBACR,aAAa;AAAA,oBACb,eAAc;AAAA,oBACd,iBAAiB;AAAA,oBACjB,kBAAkB,gBAAgB,gBAAgB,OAAO;AAAA,oBACzD,WAAW,cAAc,YAAY,CAAC,IAAI,YAAY,CAAC;AAAA,oBACvD,OAAO;AAAA,sBACL,YAAY,gBAAgB,SAAS;AAAA,oBAAA;AAAA,kBACvC;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,UAAA;AAAA,UAED,aAAa,CAAC,iBACbH,2BAAAA;AAAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,OAAO,EAAE,MAAA;AAAA,cAER,UAAA;AAAA,gBAAA;AAAA,gBAAa;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAChB;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,eAAe,cAAc;;"}
package/dist/index22.js CHANGED
@@ -1,62 +1,129 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { normalizeSize, getAnimationDuration } from "./index4.js";
3
+ import { normalizeSize, getAnimationDuration, parseSizeToNumber } from "./index4.js";
4
4
  import { cn } from "./index3.js";
5
- const PulseWave = forwardRef(
5
+ const ProgressCircle = forwardRef(
6
6
  ({
7
- size = 40,
7
+ value = 0,
8
+ indeterminate = false,
9
+ showValue = false,
10
+ size = 60,
11
+ thickness = 4,
8
12
  color = "#3b82f6",
9
- barCount = 5,
13
+ secondaryColor = "#e0e0e0",
14
+ buffer,
10
15
  speed = "normal",
11
16
  className,
12
17
  style,
13
- testId = "pulse-wave",
18
+ testId = "progress-circle",
14
19
  visible = true,
15
- ariaLabel = "Loading...",
20
+ ariaLabel,
16
21
  ...rest
17
22
  }, ref) => {
18
23
  if (!visible) return null;
19
- const sizeValue = typeof size === "number" ? size : parseInt(String(size), 10);
20
- const barWidth = Math.floor(sizeValue / (barCount * 2.5));
24
+ const clampedValue = Math.min(100, Math.max(0, value));
25
+ const clampedBuffer = buffer !== void 0 ? Math.min(100, Math.max(0, buffer)) : void 0;
26
+ const sizeValue = parseSizeToNumber(size, 60);
27
+ const thicknessValue = parseSizeToNumber(thickness, 4);
28
+ const radius = (sizeValue - thicknessValue * 2) / 2;
29
+ const circumference = 2 * Math.PI * radius;
30
+ const strokeDashoffset = circumference - clampedValue / 100 * circumference;
31
+ const bufferDashoffset = clampedBuffer !== void 0 ? circumference - clampedBuffer / 100 * circumference : void 0;
32
+ const progressLabel = ariaLabel || `Loading ${clampedValue}%`;
21
33
  const animationDuration = getAnimationDuration(speed);
22
- return /* @__PURE__ */ jsx(
34
+ return /* @__PURE__ */ jsxs(
23
35
  "div",
24
36
  {
25
37
  ref,
26
38
  "data-testid": testId,
27
- className: cn("inline-flex items-end justify-center gap-1", className),
39
+ className: cn("inline-flex items-center justify-center relative", className),
28
40
  style: {
41
+ width: normalizeSize(size),
29
42
  height: normalizeSize(size),
30
43
  ...style
31
44
  },
32
- role: "status",
33
- "aria-label": ariaLabel,
34
- "aria-busy": "true",
45
+ role: "progressbar",
46
+ "aria-label": progressLabel,
47
+ "aria-valuenow": indeterminate ? void 0 : clampedValue,
48
+ "aria-valuemin": 0,
49
+ "aria-valuemax": 100,
35
50
  ...rest,
36
- children: Array.from({ length: barCount }).map((_, index) => {
37
- const delay = index / barCount * 0.5;
38
- return /* @__PURE__ */ jsx(
39
- "div",
51
+ children: [
52
+ /* @__PURE__ */ jsxs(
53
+ "svg",
40
54
  {
41
- className: "rounded-sm",
42
- style: {
43
- width: `${barWidth}px`,
44
- height: "100%",
45
- backgroundColor: color,
46
- animation: `pulse-wave ${animationDuration} ease-in-out infinite`,
47
- animationDelay: `${delay}s`,
48
- transformOrigin: "bottom"
49
- }
50
- },
51
- index
52
- );
53
- })
55
+ className: cn(indeterminate && "animate-spinner-rotate"),
56
+ width: sizeValue,
57
+ height: sizeValue,
58
+ viewBox: `0 0 ${sizeValue} ${sizeValue}`,
59
+ style: indeterminate ? { animation: `spinner-rotate ${animationDuration} linear infinite` } : void 0,
60
+ children: [
61
+ /* @__PURE__ */ jsx(
62
+ "circle",
63
+ {
64
+ cx: sizeValue / 2,
65
+ cy: sizeValue / 2,
66
+ r: radius,
67
+ fill: "none",
68
+ stroke: secondaryColor,
69
+ strokeWidth: thicknessValue
70
+ }
71
+ ),
72
+ bufferDashoffset !== void 0 && !indeterminate && /* @__PURE__ */ jsx(
73
+ "circle",
74
+ {
75
+ cx: sizeValue / 2,
76
+ cy: sizeValue / 2,
77
+ r: radius,
78
+ fill: "none",
79
+ stroke: color,
80
+ strokeWidth: thicknessValue,
81
+ strokeLinecap: "round",
82
+ strokeDasharray: circumference,
83
+ strokeDashoffset: bufferDashoffset,
84
+ transform: `rotate(-90 ${sizeValue / 2} ${sizeValue / 2})`,
85
+ opacity: 0.3
86
+ }
87
+ ),
88
+ /* @__PURE__ */ jsx(
89
+ "circle",
90
+ {
91
+ cx: sizeValue / 2,
92
+ cy: sizeValue / 2,
93
+ r: radius,
94
+ fill: "none",
95
+ stroke: color,
96
+ strokeWidth: thicknessValue,
97
+ strokeLinecap: "round",
98
+ strokeDasharray: circumference,
99
+ strokeDashoffset: indeterminate ? circumference * 0.75 : strokeDashoffset,
100
+ transform: `rotate(-90 ${sizeValue / 2} ${sizeValue / 2})`,
101
+ style: {
102
+ transition: indeterminate ? "none" : "stroke-dashoffset 0.3s ease-in-out"
103
+ }
104
+ }
105
+ )
106
+ ]
107
+ }
108
+ ),
109
+ showValue && !indeterminate && /* @__PURE__ */ jsxs(
110
+ "span",
111
+ {
112
+ className: "absolute text-sm font-medium",
113
+ style: { color },
114
+ children: [
115
+ clampedValue,
116
+ "%"
117
+ ]
118
+ }
119
+ )
120
+ ]
54
121
  }
55
122
  );
56
123
  }
57
124
  );
58
- PulseWave.displayName = "PulseWave";
125
+ ProgressCircle.displayName = "ProgressCircle";
59
126
  export {
60
- PulseWave
127
+ ProgressCircle
61
128
  };
62
129
  //# sourceMappingURL=index22.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index22.js","sources":["../src/components/pulse/PulseWave.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { PulseWaveProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration } from '../../utils';\n\n/**\n * PulseWave - Wave pattern loader\n *\n * A loader with bars that animate in a wave pattern.\n *\n * @example\n * ```tsx\n * <PulseWave size={40} color=\"#3b82f6\" />\n * <PulseWave size={32} barCount={7} speed=\"slow\" />\n * ```\n */\nexport const PulseWave = forwardRef<HTMLDivElement, PulseWaveProps>(\n (\n {\n size = 40,\n color = '#3b82f6',\n barCount = 5,\n speed = 'normal',\n className,\n style,\n testId = 'pulse-wave',\n visible = true,\n ariaLabel = 'Loading...',\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const sizeValue = typeof size === 'number' ? size : parseInt(String(size), 10);\n const barWidth = Math.floor(sizeValue / (barCount * 2.5));\n const animationDuration = getAnimationDuration(speed);\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('inline-flex items-end justify-center gap-1', className)}\n style={{\n height: normalizeSize(size),\n ...style,\n }}\n role=\"status\"\n aria-label={ariaLabel}\n aria-busy=\"true\"\n {...rest}\n >\n {Array.from({ length: barCount }).map((_, index) => {\n const delay = (index / barCount) * 0.5;\n\n return (\n <div\n key={index}\n className=\"rounded-sm\"\n style={{\n width: `${barWidth}px`,\n height: '100%',\n backgroundColor: color,\n animation: `pulse-wave ${animationDuration} ease-in-out infinite`,\n animationDelay: `${delay}s`,\n transformOrigin: 'bottom',\n }}\n />\n );\n })}\n </div>\n );\n }\n);\n\nPulseWave.displayName = 'PulseWave';\n"],"names":[],"mappings":";;;;AAeO,MAAM,YAAY;AAAA,EACvB,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,UAAM,YAAY,OAAO,SAAS,WAAW,OAAO,SAAS,OAAO,IAAI,GAAG,EAAE;AAC7E,UAAM,WAAW,KAAK,MAAM,aAAa,WAAW,IAAI;AACxD,UAAM,oBAAoB,qBAAqB,KAAK;AAEpD,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAW,GAAG,8CAA8C,SAAS;AAAA,QACrE,OAAO;AAAA,UACL,QAAQ,cAAc,IAAI;AAAA,UAC1B,GAAG;AAAA,QAAA;AAAA,QAEL,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEH,UAAA,MAAM,KAAK,EAAE,QAAQ,SAAA,CAAU,EAAE,IAAI,CAAC,GAAG,UAAU;AAClD,gBAAM,QAAS,QAAQ,WAAY;AAEnC,iBACE;AAAA,YAAC;AAAA,YAAA;AAAA,cAEC,WAAU;AAAA,cACV,OAAO;AAAA,gBACL,OAAO,GAAG,QAAQ;AAAA,gBAClB,QAAQ;AAAA,gBACR,iBAAiB;AAAA,gBACjB,WAAW,cAAc,iBAAiB;AAAA,gBAC1C,gBAAgB,GAAG,KAAK;AAAA,gBACxB,iBAAiB;AAAA,cAAA;AAAA,YACnB;AAAA,YATK;AAAA,UAAA;AAAA,QAYX,CAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,UAAU,cAAc;"}
1
+ {"version":3,"file":"index22.js","sources":["../src/components/progress/ProgressCircle.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { ProgressCircleProps } from '../../types';\nimport { cn, normalizeSize, parseSizeToNumber, getAnimationDuration } from '../../utils';\n\n/**\n * ProgressCircle - SVG-based circular progress indicator\n *\n * A circular progress indicator that shows progress as a partial circle.\n *\n * @example\n * ```tsx\n * <ProgressCircle value={75} showValue />\n * <ProgressCircle value={50} size={80} thickness={6} />\n * <ProgressCircle indeterminate speed=\"fast\" />\n * <ProgressCircle value={50} buffer={75} />\n * ```\n */\nexport const ProgressCircle = forwardRef<HTMLDivElement, ProgressCircleProps>(\n (\n {\n value = 0,\n indeterminate = false,\n showValue = false,\n size = 60,\n thickness = 4,\n color = '#3b82f6',\n secondaryColor = '#e0e0e0',\n buffer,\n speed = 'normal',\n className,\n style,\n testId = 'progress-circle',\n visible = true,\n ariaLabel,\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const clampedValue = Math.min(100, Math.max(0, value));\n const clampedBuffer = buffer !== undefined ? Math.min(100, Math.max(0, buffer)) : undefined;\n const sizeValue = parseSizeToNumber(size, 60);\n const thicknessValue = parseSizeToNumber(thickness, 4);\n const radius = (sizeValue - thicknessValue * 2) / 2;\n const circumference = 2 * Math.PI * radius;\n const strokeDashoffset = circumference - (clampedValue / 100) * circumference;\n const bufferDashoffset = clampedBuffer !== undefined ? circumference - (clampedBuffer / 100) * circumference : undefined;\n const progressLabel = ariaLabel || `Loading ${clampedValue}%`;\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 relative', className)}\n style={{\n width: normalizeSize(size),\n height: normalizeSize(size),\n ...style,\n }}\n role=\"progressbar\"\n aria-label={progressLabel}\n aria-valuenow={indeterminate ? undefined : clampedValue}\n aria-valuemin={0}\n aria-valuemax={100}\n {...rest}\n >\n <svg\n className={cn(indeterminate && 'animate-spinner-rotate')}\n width={sizeValue}\n height={sizeValue}\n viewBox={`0 0 ${sizeValue} ${sizeValue}`}\n style={indeterminate ? { animation: `spinner-rotate ${animationDuration} linear infinite` } : undefined}\n >\n {/* Background circle */}\n <circle\n cx={sizeValue / 2}\n cy={sizeValue / 2}\n r={radius}\n fill=\"none\"\n stroke={secondaryColor}\n strokeWidth={thicknessValue}\n />\n {/* Buffer circle (behind progress) */}\n {bufferDashoffset !== undefined && !indeterminate && (\n <circle\n cx={sizeValue / 2}\n cy={sizeValue / 2}\n r={radius}\n fill=\"none\"\n stroke={color}\n strokeWidth={thicknessValue}\n strokeLinecap=\"round\"\n strokeDasharray={circumference}\n strokeDashoffset={bufferDashoffset}\n transform={`rotate(-90 ${sizeValue / 2} ${sizeValue / 2})`}\n opacity={0.3}\n />\n )}\n {/* Progress circle */}\n <circle\n cx={sizeValue / 2}\n cy={sizeValue / 2}\n r={radius}\n fill=\"none\"\n stroke={color}\n strokeWidth={thicknessValue}\n strokeLinecap=\"round\"\n strokeDasharray={circumference}\n strokeDashoffset={indeterminate ? circumference * 0.75 : strokeDashoffset}\n transform={`rotate(-90 ${sizeValue / 2} ${sizeValue / 2})`}\n style={{\n transition: indeterminate ? 'none' : 'stroke-dashoffset 0.3s ease-in-out',\n }}\n />\n </svg>\n {showValue && !indeterminate && (\n <span\n className=\"absolute text-sm font-medium\"\n style={{ color }}\n >\n {clampedValue}%\n </span>\n )}\n </div>\n );\n }\n);\n\nProgressCircle.displayName = 'ProgressCircle';\n"],"names":[],"mappings":";;;;AAiBO,MAAM,iBAAiB;AAAA,EAC5B,CACE;AAAA,IACE,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,iBAAiB;AAAA,IACjB;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,I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