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
@@ -1 +1 @@
1
- {"version":3,"file":"index17.cjs","sources":["../src/components/progress/ProgressBar.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { ProgressBarProps } from '../../types';\nimport { cn, normalizeSize } from '../../utils';\n\n/**\n * ProgressBar - Linear progress bar\n *\n * A horizontal progress bar that can be determinate (showing specific progress) or indeterminate (loading animation).\n *\n * @example\n * ```tsx\n * <ProgressBar value={75} showValue />\n * <ProgressBar indeterminate />\n * <ProgressBar value={50} height={8} color=\"#8b5cf6\" />\n * ```\n */\nexport const ProgressBar = forwardRef<HTMLDivElement, ProgressBarProps>(\n (\n {\n value = 0,\n indeterminate = false,\n showValue = false,\n height = '0.5rem',\n color = '#3b82f6',\n secondaryColor = '#e0e0e0',\n className,\n style,\n testId = 'progress-bar',\n visible = true,\n ariaLabel,\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const clampedValue = Math.min(100, Math.max(0, value));\n const progressLabel = ariaLabel || `Loading ${clampedValue}%`;\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('relative w-full overflow-hidden rounded-full', className)}\n style={{\n height: normalizeSize(height),\n backgroundColor: secondaryColor,\n ...style,\n }}\n role=\"progressbar\"\n aria-label={progressLabel}\n aria-valuenow={indeterminate ? undefined : clampedValue}\n aria-valuemin={0}\n aria-valuemax={100}\n {...rest}\n >\n {indeterminate ? (\n <div\n className=\"absolute h-full rounded-full\"\n style={{\n backgroundColor: color,\n animation: 'progress-indeterminate 1.5s ease-in-out infinite',\n width: '40%',\n }}\n />\n ) : (\n <div\n className=\"h-full rounded-full transition-all duration-300 ease-in-out\"\n style={{\n width: `${clampedValue}%`,\n backgroundColor: color,\n }}\n />\n )}\n {showValue && !indeterminate && (\n <span\n className=\"absolute inset-0 flex items-center justify-center text-xs font-medium\"\n style={{ color: clampedValue > 50 ? 'white' : color }}\n >\n {clampedValue}%\n </span>\n )}\n </div>\n );\n }\n);\n\nProgressBar.displayName = 'ProgressBar';\n"],"names":["forwardRef","jsxs","cn","normalizeSize","jsx"],"mappings":";;;;;;AAgBO,MAAM,cAAcA,MAAAA;AAAAA,EACzB,CACE;AAAA,IACE,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,iBAAiB;AAAA,IACjB;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV;AA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"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,I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,cAAA;AAAA,YAWX,CAAC;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,YAAY,cAAc;;"}
package/dist/index17.js CHANGED
@@ -1,81 +1,71 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { normalizeSize } from "./index4.js";
4
3
  import { cn } from "./index3.js";
5
- const ProgressBar = forwardRef(
4
+ import { normalizeSize, getAnimationDuration } from "./index4.js";
5
+ const SpinnerGrid = forwardRef(
6
6
  ({
7
- value = 0,
8
- indeterminate = false,
9
- showValue = false,
10
- height = "0.5rem",
7
+ size = 40,
11
8
  color = "#3b82f6",
12
- secondaryColor = "#e0e0e0",
9
+ gridSize = 3,
10
+ speed = "normal",
13
11
  className,
14
12
  style,
15
- testId = "progress-bar",
13
+ testId = "spinner-grid",
16
14
  visible = true,
17
- ariaLabel,
15
+ ariaLabel = "Loading...",
18
16
  ...rest
19
17
  }, ref) => {
20
18
  if (!visible) return null;
21
- const clampedValue = Math.min(100, Math.max(0, value));
22
- const progressLabel = ariaLabel || `Loading ${clampedValue}%`;
23
- return /* @__PURE__ */ jsxs(
19
+ const sizeValue = typeof size === "number" ? size : parseInt(String(size), 10);
20
+ const cellSize = Math.floor(sizeValue / gridSize) - 2;
21
+ const animationDuration = getAnimationDuration(speed);
22
+ return /* @__PURE__ */ jsx(
24
23
  "div",
25
24
  {
26
25
  ref,
27
26
  "data-testid": testId,
28
- className: cn("relative w-full overflow-hidden rounded-full", className),
29
- style: {
30
- height: normalizeSize(height),
31
- backgroundColor: secondaryColor,
32
- ...style
33
- },
34
- role: "progressbar",
35
- "aria-label": progressLabel,
36
- "aria-valuenow": indeterminate ? void 0 : clampedValue,
37
- "aria-valuemin": 0,
38
- "aria-valuemax": 100,
27
+ className: cn("inline-flex items-center justify-center", className),
28
+ style,
29
+ role: "status",
30
+ "aria-label": ariaLabel,
31
+ "aria-busy": "true",
39
32
  ...rest,
40
- children: [
41
- indeterminate ? /* @__PURE__ */ jsx(
42
- "div",
43
- {
44
- className: "absolute h-full rounded-full",
45
- style: {
46
- backgroundColor: color,
47
- animation: "progress-indeterminate 1.5s ease-in-out infinite",
48
- width: "40%"
49
- }
50
- }
51
- ) : /* @__PURE__ */ jsx(
52
- "div",
53
- {
54
- className: "h-full rounded-full transition-all duration-300 ease-in-out",
55
- style: {
56
- width: `${clampedValue}%`,
57
- backgroundColor: color
58
- }
59
- }
60
- ),
61
- showValue && !indeterminate && /* @__PURE__ */ jsxs(
62
- "span",
63
- {
64
- className: "absolute inset-0 flex items-center justify-center text-xs font-medium",
65
- style: { color: clampedValue > 50 ? "white" : color },
66
- children: [
67
- clampedValue,
68
- "%"
69
- ]
70
- }
71
- )
72
- ]
33
+ children: /* @__PURE__ */ jsx(
34
+ "div",
35
+ {
36
+ className: "grid gap-0.5",
37
+ 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
+ )
73
63
  }
74
64
  );
75
65
  }
76
66
  );
77
- ProgressBar.displayName = "ProgressBar";
67
+ SpinnerGrid.displayName = "SpinnerGrid";
78
68
  export {
79
- ProgressBar
69
+ SpinnerGrid
80
70
  };
81
71
  //# sourceMappingURL=index17.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index17.js","sources":["../src/components/progress/ProgressBar.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { ProgressBarProps } from '../../types';\nimport { cn, normalizeSize } from '../../utils';\n\n/**\n * ProgressBar - Linear progress bar\n *\n * A horizontal progress bar that can be determinate (showing specific progress) or indeterminate (loading animation).\n *\n * @example\n * ```tsx\n * <ProgressBar value={75} showValue />\n * <ProgressBar indeterminate />\n * <ProgressBar value={50} height={8} color=\"#8b5cf6\" />\n * ```\n */\nexport const ProgressBar = forwardRef<HTMLDivElement, ProgressBarProps>(\n (\n {\n value = 0,\n indeterminate = false,\n showValue = false,\n height = '0.5rem',\n color = '#3b82f6',\n secondaryColor = '#e0e0e0',\n className,\n style,\n testId = 'progress-bar',\n visible = true,\n ariaLabel,\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const clampedValue = Math.min(100, Math.max(0, value));\n const progressLabel = ariaLabel || `Loading ${clampedValue}%`;\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('relative w-full overflow-hidden rounded-full', className)}\n style={{\n height: normalizeSize(height),\n backgroundColor: secondaryColor,\n ...style,\n }}\n role=\"progressbar\"\n aria-label={progressLabel}\n aria-valuenow={indeterminate ? undefined : clampedValue}\n aria-valuemin={0}\n aria-valuemax={100}\n {...rest}\n >\n {indeterminate ? (\n <div\n className=\"absolute h-full rounded-full\"\n style={{\n backgroundColor: color,\n animation: 'progress-indeterminate 1.5s ease-in-out infinite',\n width: '40%',\n }}\n />\n ) : (\n <div\n className=\"h-full rounded-full transition-all duration-300 ease-in-out\"\n style={{\n width: `${clampedValue}%`,\n backgroundColor: color,\n }}\n />\n )}\n {showValue && !indeterminate && (\n <span\n className=\"absolute inset-0 flex items-center justify-center text-xs font-medium\"\n style={{ color: clampedValue > 50 ? 'white' : color }}\n >\n {clampedValue}%\n </span>\n )}\n </div>\n );\n }\n);\n\nProgressBar.displayName = 'ProgressBar';\n"],"names":[],"mappings":";;;;AAgBO,MAAM,cAAc;AAAA,EACzB,CACE;AAAA,IACE,QAAQ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A,IAAA;AAAA,EAIR;AACF;AAEA,YAAY,cAAc;"}
1
+ {"version":3,"file":"index17.js","sources":["../src/components/spinner/SpinnerGrid.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerGridProps } from '../../types';\nimport { cn, normalizeSize, getAnimationDuration } from '../../utils';\n\n/**\n * SpinnerGrid - Grid of fading squares\n *\n * A spinner with a grid of squares that fade in and out in a pattern.\n *\n * @example\n * ```tsx\n * <SpinnerGrid size={40} color=\"#3b82f6\" />\n * <SpinnerGrid size={48} gridSize={4} />\n * ```\n */\nexport const SpinnerGrid = forwardRef<HTMLDivElement, SpinnerGridProps>(\n (\n {\n size = 40,\n color = '#3b82f6',\n gridSize = 3,\n speed = 'normal',\n className,\n style,\n testId = 'spinner-grid',\n visible = true,\n ariaLabel = 'Loading...',\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const sizeValue = typeof size === 'number' ? size : parseInt(String(size), 10);\n const cellSize = Math.floor(sizeValue / gridSize) - 2;\n const animationDuration = getAnimationDuration(speed);\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('inline-flex items-center justify-center', className)}\n style={style}\n role=\"status\"\n aria-label={ariaLabel}\n aria-busy=\"true\"\n {...rest}\n >\n <div\n className=\"grid gap-0.5\"\n style={{\n width: normalizeSize(size),\n height: normalizeSize(size),\n gridTemplateColumns: `repeat(${gridSize}, 1fr)`,\n }}\n >\n {Array.from({ length: gridSize * gridSize }).map((_, index) => {\n const row = Math.floor(index / gridSize);\n const col = index % gridSize;\n const delay = (row + col) * 0.1;\n\n return (\n <div\n key={index}\n className=\"rounded-sm\"\n style={{\n width: `${cellSize}px`,\n height: `${cellSize}px`,\n backgroundColor: color,\n animation: `fade-pulse ${animationDuration} ease-in-out infinite`,\n animationDelay: `${delay}s`,\n }}\n />\n );\n })}\n </div>\n </div>\n );\n }\n);\n\nSpinnerGrid.displayName = 'SpinnerGrid';\n"],"names":[],"mappings":";;;;AAeO,MAAM,cAAc;AAA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AA,YAWX,CAAC;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,YAAY,cAAc;"}
package/dist/index18.cjs CHANGED
@@ -4,39 +4,33 @@ 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 ProgressCircle = react.forwardRef(
7
+ const ProgressBar = react.forwardRef(
8
8
  ({
9
9
  value = 0,
10
10
  indeterminate = false,
11
11
  showValue = false,
12
- size = 60,
13
- thickness = 4,
12
+ height = "0.5rem",
14
13
  color = "#3b82f6",
15
14
  secondaryColor = "#e0e0e0",
16
15
  className,
17
16
  style,
18
- testId = "progress-circle",
17
+ testId = "progress-bar",
19
18
  visible = true,
20
19
  ariaLabel,
21
20
  ...rest
22
21
  }, ref) => {
23
22
  if (!visible) return null;
24
23
  const clampedValue = Math.min(100, Math.max(0, value));
25
- const sizeValue = typeof size === "number" ? size : parseInt(String(size), 10);
26
- const thicknessValue = typeof thickness === "number" ? thickness : parseInt(String(thickness), 10);
27
- const radius = (sizeValue - thicknessValue * 2) / 2;
28
- const circumference = 2 * Math.PI * radius;
29
- const strokeDashoffset = circumference - clampedValue / 100 * circumference;
30
24
  const progressLabel = ariaLabel || `Loading ${clampedValue}%`;
31
25
  return /* @__PURE__ */ jsxRuntime.jsxs(
32
26
  "div",
33
27
  {
34
28
  ref,
35
29
  "data-testid": testId,
36
- className: classNames.cn("inline-flex items-center justify-center relative", className),
30
+ className: classNames.cn("relative w-full overflow-hidden rounded-full", className),
37
31
  style: {
38
- width: colors.normalizeSize(size),
39
- height: colors.normalizeSize(size),
32
+ height: colors.normalizeSize(height),
33
+ backgroundColor: secondaryColor,
40
34
  ...style
41
35
  },
42
36
  role: "progressbar",
@@ -46,51 +40,31 @@ const ProgressCircle = react.forwardRef(
46
40
  "aria-valuemax": 100,
47
41
  ...rest,
48
42
  children: [
49
- /* @__PURE__ */ jsxRuntime.jsxs(
50
- "svg",
43
+ indeterminate ? /* @__PURE__ */ jsxRuntime.jsx(
44
+ "div",
51
45
  {
52
- className: classNames.cn(indeterminate && "animate-spinner-rotate"),
53
- width: sizeValue,
54
- height: sizeValue,
55
- viewBox: `0 0 ${sizeValue} ${sizeValue}`,
56
- children: [
57
- /* @__PURE__ */ jsxRuntime.jsx(
58
- "circle",
59
- {
60
- cx: sizeValue / 2,
61
- cy: sizeValue / 2,
62
- r: radius,
63
- fill: "none",
64
- stroke: secondaryColor,
65
- strokeWidth: thicknessValue
66
- }
67
- ),
68
- /* @__PURE__ */ jsxRuntime.jsx(
69
- "circle",
70
- {
71
- cx: sizeValue / 2,
72
- cy: sizeValue / 2,
73
- r: radius,
74
- fill: "none",
75
- stroke: color,
76
- strokeWidth: thicknessValue,
77
- strokeLinecap: "round",
78
- strokeDasharray: circumference,
79
- strokeDashoffset: indeterminate ? circumference * 0.75 : strokeDashoffset,
80
- transform: `rotate(-90 ${sizeValue / 2} ${sizeValue / 2})`,
81
- style: {
82
- transition: indeterminate ? "none" : "stroke-dashoffset 0.3s ease-in-out"
83
- }
84
- }
85
- )
86
- ]
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
+ }
87
61
  }
88
62
  ),
89
63
  showValue && !indeterminate && /* @__PURE__ */ jsxRuntime.jsxs(
90
64
  "span",
91
65
  {
92
- className: "absolute text-sm font-medium",
93
- style: { color },
66
+ className: "absolute inset-0 flex items-center justify-center text-xs font-medium",
67
+ style: { color: clampedValue > 50 ? "white" : color },
94
68
  children: [
95
69
  clampedValue,
96
70
  "%"
@@ -102,6 +76,6 @@ const ProgressCircle = react.forwardRef(
102
76
  );
103
77
  }
104
78
  );
105
- ProgressCircle.displayName = "ProgressCircle";
106
- exports.ProgressCircle = ProgressCircle;
79
+ ProgressBar.displayName = "ProgressBar";
80
+ exports.ProgressBar = ProgressBar;
107
81
  //# sourceMappingURL=index18.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index18.cjs","sources":["../src/components/progress/ProgressCircle.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { ProgressCircleProps } from '../../types';\nimport { cn, normalizeSize } 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 />\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 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 sizeValue = typeof size === 'number' ? size : parseInt(String(size), 10);\n const thicknessValue = typeof thickness === 'number' ? thickness : parseInt(String(thickness), 10);\n const radius = (sizeValue - thicknessValue * 2) / 2;\n const circumference = 2 * Math.PI * radius;\n const strokeDashoffset = circumference - (clampedValue / 100) * circumference;\n const progressLabel = ariaLabel || `Loading ${clampedValue}%`;\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 >\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 {/* 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","jsxs","cn","normalizeSize","jsx"],"mappings":";;;;;;AAgBO,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;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,YAAY,OAAO,SAAS,WAAW,OAAO,SAAS,OAAO,IAAI,GAAG,EAAE;AAC7E,UAAM,iBAAiB,OAAO,cAAc,WAAW,YAAY,SAAS,OAAO,SAAS,GAAG,EAAE;AACjG,UAAM,UAAU,YAAY,iBAAiB,KAAK;AAClD,UAAM,gB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AY,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;;"}
1
+ {"version":3,"file":"index18.cjs","sources":["../src/components/progress/ProgressBar.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { ProgressBarProps } from '../../types';\nimport { cn, normalizeSize } from '../../utils';\n\n/**\n * ProgressBar - Linear progress bar\n *\n * A horizontal progress bar that can be determinate (showing specific progress) or indeterminate (loading animation).\n *\n * @example\n * ```tsx\n * <ProgressBar value={75} showValue />\n * <ProgressBar indeterminate />\n * <ProgressBar value={50} height={8} color=\"#8b5cf6\" />\n * ```\n */\nexport const ProgressBar = forwardRef<HTMLDivElement, ProgressBarProps>(\n (\n {\n value = 0,\n indeterminate = false,\n showValue = false,\n height = '0.5rem',\n color = '#3b82f6',\n secondaryColor = '#e0e0e0',\n className,\n style,\n testId = 'progress-bar',\n visible = true,\n ariaLabel,\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const clampedValue = Math.min(100, Math.max(0, value));\n const progressLabel = ariaLabel || `Loading ${clampedValue}%`;\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('relative w-full overflow-hidden rounded-full', className)}\n style={{\n height: normalizeSize(height),\n backgroundColor: secondaryColor,\n ...style,\n }}\n role=\"progressbar\"\n aria-label={progressLabel}\n aria-valuenow={indeterminate ? undefined : clampedValue}\n aria-valuemin={0}\n aria-valuemax={100}\n {...rest}\n >\n {indeterminate ? (\n <div\n className=\"absolute h-full rounded-full\"\n style={{\n backgroundColor: color,\n animation: 'progress-indeterminate 1.5s ease-in-out infinite',\n width: '40%',\n }}\n />\n ) : (\n <div\n className=\"h-full rounded-full transition-all duration-300 ease-in-out\"\n style={{\n width: `${clampedValue}%`,\n backgroundColor: color,\n }}\n />\n )}\n {showValue && !indeterminate && (\n <span\n className=\"absolute inset-0 flex items-center justify-center text-xs font-medium\"\n style={{ color: clampedValue > 50 ? 'white' : color }}\n >\n {clampedValue}%\n </span>\n )}\n </div>\n );\n }\n);\n\nProgressBar.displayName = 'ProgressBar';\n"],"names":["forwardRef","jsxs","cn","normalizeSize","jsx"],"mappings":";;;;;;AAgBO,MAAM,cAAcA,MAAAA;AAAAA,EACzB,CACE;AAAA,IACE,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,iBAAiB;AAAA,IACjB;AAAA,IACA;AAAA,IACA,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,aAAa,WAAW,YAAY;AAE1D,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAWC,WAAAA,GAAG,gDAAgD,SAAS;AAAA,QACvE,OAAO;AAAA,UACL,QAAQC,OAAAA,cAAc,MAAM;AAAA,UAC5B,iBAAiB;AAAA,UACjB,GAAG;AAAA,QAAA;AAAA,QAEL,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,iBAAe,gBAAgB,SAAY;AAAA,QAC3C,iBAAe;AAAA,QACf,iBAAe;AAAA,QACd,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA,gBACCC,2BAAAA;AAAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,OAAO;AAAA,gBACL,iBAAiB;AAAA,gBACjB,WAAW;AAAA,gBACX,OAAO;AAAA,cAAA;AAAA,YACT;AAAA,UAAA,IAGFA,2BAAAA;AAAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,OAAO;AAAA,gBACL,OAAO,GAAG,YAAY;AAAA,gBACtB,iBAAiB;AAAA,cAAA;AAAA,YACnB;AAAA,UAAA;AAAA,UAGH,aAAa,CAAC,iBACbH,2BAAAA;AAAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,OAAO,EAAE,OAAO,eAAe,KAAK,UAAU,MAAA;AAAA,cAE7C,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/index18.js CHANGED
@@ -2,39 +2,33 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import { normalizeSize } from "./index4.js";
4
4
  import { cn } from "./index3.js";
5
- const ProgressCircle = forwardRef(
5
+ const ProgressBar = forwardRef(
6
6
  ({
7
7
  value = 0,
8
8
  indeterminate = false,
9
9
  showValue = false,
10
- size = 60,
11
- thickness = 4,
10
+ height = "0.5rem",
12
11
  color = "#3b82f6",
13
12
  secondaryColor = "#e0e0e0",
14
13
  className,
15
14
  style,
16
- testId = "progress-circle",
15
+ testId = "progress-bar",
17
16
  visible = true,
18
17
  ariaLabel,
19
18
  ...rest
20
19
  }, ref) => {
21
20
  if (!visible) return null;
22
21
  const clampedValue = Math.min(100, Math.max(0, value));
23
- const sizeValue = typeof size === "number" ? size : parseInt(String(size), 10);
24
- const thicknessValue = typeof thickness === "number" ? thickness : parseInt(String(thickness), 10);
25
- const radius = (sizeValue - thicknessValue * 2) / 2;
26
- const circumference = 2 * Math.PI * radius;
27
- const strokeDashoffset = circumference - clampedValue / 100 * circumference;
28
22
  const progressLabel = ariaLabel || `Loading ${clampedValue}%`;
29
23
  return /* @__PURE__ */ jsxs(
30
24
  "div",
31
25
  {
32
26
  ref,
33
27
  "data-testid": testId,
34
- className: cn("inline-flex items-center justify-center relative", className),
28
+ className: cn("relative w-full overflow-hidden rounded-full", className),
35
29
  style: {
36
- width: normalizeSize(size),
37
- height: normalizeSize(size),
30
+ height: normalizeSize(height),
31
+ backgroundColor: secondaryColor,
38
32
  ...style
39
33
  },
40
34
  role: "progressbar",
@@ -44,51 +38,31 @@ const ProgressCircle = forwardRef(
44
38
  "aria-valuemax": 100,
45
39
  ...rest,
46
40
  children: [
47
- /* @__PURE__ */ jsxs(
48
- "svg",
41
+ indeterminate ? /* @__PURE__ */ jsx(
42
+ "div",
49
43
  {
50
- className: cn(indeterminate && "animate-spinner-rotate"),
51
- width: sizeValue,
52
- height: sizeValue,
53
- viewBox: `0 0 ${sizeValue} ${sizeValue}`,
54
- children: [
55
- /* @__PURE__ */ jsx(
56
- "circle",
57
- {
58
- cx: sizeValue / 2,
59
- cy: sizeValue / 2,
60
- r: radius,
61
- fill: "none",
62
- stroke: secondaryColor,
63
- strokeWidth: thicknessValue
64
- }
65
- ),
66
- /* @__PURE__ */ jsx(
67
- "circle",
68
- {
69
- cx: sizeValue / 2,
70
- cy: sizeValue / 2,
71
- r: radius,
72
- fill: "none",
73
- stroke: color,
74
- strokeWidth: thicknessValue,
75
- strokeLinecap: "round",
76
- strokeDasharray: circumference,
77
- strokeDashoffset: indeterminate ? circumference * 0.75 : strokeDashoffset,
78
- transform: `rotate(-90 ${sizeValue / 2} ${sizeValue / 2})`,
79
- style: {
80
- transition: indeterminate ? "none" : "stroke-dashoffset 0.3s ease-in-out"
81
- }
82
- }
83
- )
84
- ]
44
+ className: "absolute h-full rounded-full",
45
+ style: {
46
+ backgroundColor: color,
47
+ animation: "progress-indeterminate 1.5s ease-in-out infinite",
48
+ width: "40%"
49
+ }
50
+ }
51
+ ) : /* @__PURE__ */ jsx(
52
+ "div",
53
+ {
54
+ className: "h-full rounded-full transition-all duration-300 ease-in-out",
55
+ style: {
56
+ width: `${clampedValue}%`,
57
+ backgroundColor: color
58
+ }
85
59
  }
86
60
  ),
87
61
  showValue && !indeterminate && /* @__PURE__ */ jsxs(
88
62
  "span",
89
63
  {
90
- className: "absolute text-sm font-medium",
91
- style: { color },
64
+ className: "absolute inset-0 flex items-center justify-center text-xs font-medium",
65
+ style: { color: clampedValue > 50 ? "white" : color },
92
66
  children: [
93
67
  clampedValue,
94
68
  "%"
@@ -100,8 +74,8 @@ const ProgressCircle = forwardRef(
100
74
  );
101
75
  }
102
76
  );
103
- ProgressCircle.displayName = "ProgressCircle";
77
+ ProgressBar.displayName = "ProgressBar";
104
78
  export {
105
- ProgressCircle
79
+ ProgressBar
106
80
  };
107
81
  //# sourceMappingURL=index18.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index18.js","sources":["../src/components/progress/ProgressCircle.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { ProgressCircleProps } from '../../types';\nimport { cn, normalizeSize } 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 />\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 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 sizeValue = typeof size === 'number' ? size : parseInt(String(size), 10);\n const thicknessValue = typeof thickness === 'number' ? thickness : parseInt(String(thickness), 10);\n const radius = (sizeValue - thicknessValue * 2) / 2;\n const circumference = 2 * Math.PI * radius;\n const strokeDashoffset = circumference - (clampedValue / 100) * circumference;\n const progressLabel = ariaLabel || `Loading ${clampedValue}%`;\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 >\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 {/* 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":";;;;AAgBO,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;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QACG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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,iBACb;AAAA,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;"}
1
+ {"version":3,"file":"index18.js","sources":["../src/components/progress/ProgressBar.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { ProgressBarProps } from '../../types';\nimport { cn, normalizeSize } from '../../utils';\n\n/**\n * ProgressBar - Linear progress bar\n *\n * A horizontal progress bar that can be determinate (showing specific progress) or indeterminate (loading animation).\n *\n * @example\n * ```tsx\n * <ProgressBar value={75} showValue />\n * <ProgressBar indeterminate />\n * <ProgressBar value={50} height={8} color=\"#8b5cf6\" />\n * ```\n */\nexport const ProgressBar = forwardRef<HTMLDivElement, ProgressBarProps>(\n (\n {\n value = 0,\n indeterminate = false,\n showValue = false,\n height = '0.5rem',\n color = '#3b82f6',\n secondaryColor = '#e0e0e0',\n className,\n style,\n testId = 'progress-bar',\n visible = true,\n ariaLabel,\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const clampedValue = Math.min(100, Math.max(0, value));\n const progressLabel = ariaLabel || `Loading ${clampedValue}%`;\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('relative w-full overflow-hidden rounded-full', className)}\n style={{\n height: normalizeSize(height),\n backgroundColor: secondaryColor,\n ...style,\n }}\n role=\"progressbar\"\n aria-label={progressLabel}\n aria-valuenow={indeterminate ? undefined : clampedValue}\n aria-valuemin={0}\n aria-valuemax={100}\n {...rest}\n >\n {indeterminate ? (\n <div\n className=\"absolute h-full rounded-full\"\n style={{\n backgroundColor: color,\n animation: 'progress-indeterminate 1.5s ease-in-out infinite',\n width: '40%',\n }}\n />\n ) : (\n <div\n className=\"h-full rounded-full transition-all duration-300 ease-in-out\"\n style={{\n width: `${clampedValue}%`,\n backgroundColor: color,\n }}\n />\n )}\n {showValue && !indeterminate && (\n <span\n className=\"absolute inset-0 flex items-center justify-center text-xs font-medium\"\n style={{ color: clampedValue > 50 ? 'white' : color }}\n >\n {clampedValue}%\n </span>\n )}\n </div>\n );\n }\n);\n\nProgressBar.displayName = 'ProgressBar';\n"],"names":[],"mappings":";;;;AAgBO,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;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,aAAa,WAAW,YAAY;AAE1D,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAW,GAAG,gDAAgD,SAAS;AAAA,QACvE,OAAO;AAAA,UACL,QAAQ,cAAc,MAAM;AAAA,UAC5B,iBAAiB;AAAA,UACjB,GAAG;AAAA,QAAA;AAAA,QAEL,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,iBAAe,gBAAgB,SAAY;AAAA,QAC3C,iBAAe;AAAA,QACf,iBAAe;AAAA,QACd,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA,gBACC;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,OAAO;AAAA,gBACL,iBAAiB;AAAA,gBACjB,WAAW;AAAA,gBACX,OAAO;AAAA,cAAA;AAAA,YACT;AAAA,UAAA,IAGF;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,OAAO;AAAA,gBACL,OAAO,GAAG,YAAY;AAAA,gBACtB,iBAAiB;AAAA,cAAA;AAAA,YACnB;AAAA,UAAA;AAAA,UAGH,aAAa,CAAC,iBACb;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,OAAO,EAAE,OAAO,eAAe,KAAK,UAAU,MAAA;AAAA,cAE7C,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/index19.cjs CHANGED
@@ -4,19 +4,18 @@ 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 ProgressRing = react.forwardRef(
7
+ const ProgressCircle = react.forwardRef(
8
8
  ({
9
9
  value = 0,
10
10
  indeterminate = false,
11
11
  showValue = false,
12
12
  size = 60,
13
- thickness = 6,
13
+ thickness = 4,
14
14
  color = "#3b82f6",
15
15
  secondaryColor = "#e0e0e0",
16
- gradient = false,
17
16
  className,
18
17
  style,
19
- testId = "progress-ring",
18
+ testId = "progress-circle",
20
19
  visible = true,
21
20
  ariaLabel,
22
21
  ...rest
@@ -29,7 +28,6 @@ const ProgressRing = react.forwardRef(
29
28
  const circumference = 2 * Math.PI * radius;
30
29
  const strokeDashoffset = circumference - clampedValue / 100 * circumference;
31
30
  const progressLabel = ariaLabel || `Loading ${clampedValue}%`;
32
- const gradientId = `progress-gradient-${Math.random().toString(36).substr(2, 9)}`;
33
31
  return /* @__PURE__ */ jsxRuntime.jsxs(
34
32
  "div",
35
33
  {
@@ -56,10 +54,6 @@ const ProgressRing = react.forwardRef(
56
54
  height: sizeValue,
57
55
  viewBox: `0 0 ${sizeValue} ${sizeValue}`,
58
56
  children: [
59
- gradient && /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: gradientId, x1: "0%", y1: "0%", x2: "100%", y2: "100%", children: [
60
- /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0%", stopColor: color }),
61
- /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "100%", stopColor: secondaryColor === "#e0e0e0" ? "#8b5cf6" : secondaryColor })
62
- ] }) }),
63
57
  /* @__PURE__ */ jsxRuntime.jsx(
64
58
  "circle",
65
59
  {
@@ -67,7 +61,7 @@ const ProgressRing = react.forwardRef(
67
61
  cy: sizeValue / 2,
68
62
  r: radius,
69
63
  fill: "none",
70
- stroke: gradient ? "#e0e0e0" : secondaryColor,
64
+ stroke: secondaryColor,
71
65
  strokeWidth: thicknessValue
72
66
  }
73
67
  ),
@@ -78,7 +72,7 @@ const ProgressRing = react.forwardRef(
78
72
  cy: sizeValue / 2,
79
73
  r: radius,
80
74
  fill: "none",
81
- stroke: gradient ? `url(#${gradientId})` : color,
75
+ stroke: color,
82
76
  strokeWidth: thicknessValue,
83
77
  strokeLinecap: "round",
84
78
  strokeDasharray: circumference,
@@ -95,7 +89,7 @@ const ProgressRing = react.forwardRef(
95
89
  showValue && !indeterminate && /* @__PURE__ */ jsxRuntime.jsxs(
96
90
  "span",
97
91
  {
98
- className: "absolute text-sm font-semibold",
92
+ className: "absolute text-sm font-medium",
99
93
  style: { color },
100
94
  children: [
101
95
  clampedValue,
@@ -108,6 +102,6 @@ const ProgressRing = react.forwardRef(
108
102
  );
109
103
  }
110
104
  );
111
- ProgressRing.displayName = "ProgressRing";
112
- exports.ProgressRing = ProgressRing;
105
+ ProgressCircle.displayName = "ProgressCircle";
106
+ exports.ProgressCircle = ProgressCircle;
113
107
  //# sourceMappingURL=index19.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index19.cjs","sources":["../src/components/progress/ProgressRing.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { ProgressRingProps } from '../../types';\nimport { cn, normalizeSize } from '../../utils';\n\n/**\n * ProgressRing - Ring-style progress with gradient option\n *\n * A circular progress ring with optional gradient colors.\n *\n * @example\n * ```tsx\n * <ProgressRing value={75} showValue />\n * <ProgressRing value={60} gradient secondaryColor=\"#8b5cf6\" />\n * <ProgressRing indeterminate />\n * ```\n */\nexport const ProgressRing = forwardRef<HTMLDivElement, ProgressRingProps>(\n (\n {\n value = 0,\n indeterminate = false,\n showValue = false,\n size = 60,\n thickness = 6,\n color = '#3b82f6',\n secondaryColor = '#e0e0e0',\n gradient = false,\n className,\n style,\n testId = 'progress-ring',\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 sizeValue = typeof size === 'number' ? size : parseInt(String(size), 10);\n const thicknessValue = typeof thickness === 'number' ? thickness : parseInt(String(thickness), 10);\n const radius = (sizeValue - thicknessValue * 2) / 2;\n const circumference = 2 * Math.PI * radius;\n const strokeDashoffset = circumference - (clampedValue / 100) * circumference;\n const progressLabel = ariaLabel || `Loading ${clampedValue}%`;\n const gradientId = `progress-gradient-${Math.random().toString(36).substr(2, 9)}`;\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 >\n {gradient && (\n <defs>\n <linearGradient id={gradientId} x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"100%\">\n <stop offset=\"0%\" stopColor={color} />\n <stop offset=\"100%\" stopColor={secondaryColor === '#e0e0e0' ? '#8b5cf6' : secondaryColor} />\n </linearGradient>\n </defs>\n )}\n {/* Background circle */}\n <circle\n cx={sizeValue / 2}\n cy={sizeValue / 2}\n r={radius}\n fill=\"none\"\n stroke={gradient ? '#e0e0e0' : secondaryColor}\n strokeWidth={thicknessValue}\n />\n {/* Progress circle */}\n <circle\n cx={sizeValue / 2}\n cy={sizeValue / 2}\n r={radius}\n fill=\"none\"\n stroke={gradient ? `url(#${gradientId})` : 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-semibold\"\n style={{ color }}\n >\n {clampedValue}%\n </span>\n )}\n </div>\n );\n }\n);\n\nProgressRing.displayName = 'ProgressRing';\n"],"names":["forwardRef","jsxs","cn","normalizeSize","jsx"],"mappings":";;;;;;AAgBO,MAAM,eAAeA,MAAAA;AAAAA,EAC1B,CACE;AAAA,IACE,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,iBAAiB;AAAA,IACjB,WAAW;AAAA,IACX;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,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C,UAAK,QAAO,QAAO,WAAW,mBAAmB,YAAY,YAAY,eAAA,CAAgB;AAAA,gBAAA,EAAA,CAC5F,EAAA,CACF;AAAA,gBAGFA,2BAAAA;AAAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,IAAI,YAAY;AAAA,oBAChB,IAAI,YAAY;AAAA,oBAChB,GAAG;AAAA,oBACH,MAAK;AAAA,oBACL,QAAQ,WAAW,YAAY;AAAA,oBAC/B,aAAa;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAGfA,2BAAAA;AAAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,IAAI,YAAY;AAAA,oBAChB,IAAI,YAAY;AAAA,oBAChB,GAAG;AAAA,oBACH,MAAK;AAAA,oBACL,QAAQ,WAAW,QAAQ,UAAU,MAAM;AAAA,oBAC3C,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,aAAa,cAAc;;"}
1
+ {"version":3,"file":"index19.cjs","sources":["../src/components/progress/ProgressCircle.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { ProgressCircleProps } from '../../types';\nimport { cn, normalizeSize } 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 />\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 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 sizeValue = typeof size === 'number' ? size : parseInt(String(size), 10);\n const thicknessValue = typeof thickness === 'number' ? thickness : parseInt(String(thickness), 10);\n const radius = (sizeValue - thicknessValue * 2) / 2;\n const circumference = 2 * Math.PI * radius;\n const strokeDashoffset = circumference - (clampedValue / 100) * circumference;\n const progressLabel = ariaLabel || `Loading ${clampedValue}%`;\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 >\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 {/* 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","jsxs","cn","normalizeSize","jsx"],"mappings":";;;;;;AAgBO,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;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,YAAY,OAAO,SAAS,WAAW,OAAO,SAAS,OAAO,IAAI,GAAG,EAAE;AAC7E,UAAM,iBAAiB,OAAO,cAAc,WAAW,YAAY,SAAS,OAAO,SAAS,GAAG,EAAE;AACjG,UAAM,UAAU,YAAY,iBAAiB,KAAK;AAClD,UAAM,gBAAgB,IAAI,KAAK,KAAK;AACpC,UAAM,mBAAmB,gBAAiB,eAAe,MAAO;AAChE,UAAM,gBAAgB,aAAa,WAAW,YAAY;AAE1D,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAWC,WAAAA,GAAG,oDAAoD,SAAS;AAAA,QAC3E,OAAO;AAAA,UACL,OAAOC,OAAAA,cAAc,IAAI;AAAA,UACzB,QAAQA,OAAAA,cAAc,IAAI;AAAA,UAC1B,GAAG;AAAA,QAAA;AAAA,QAEL,MAAK;AAAA,QACL,cA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