premium-react-loaders 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -6
- package/dist/components/progress/ProgressBar.d.ts.map +1 -1
- package/dist/components/progress/ProgressCircle.d.ts.map +1 -1
- package/dist/components/progress/ProgressRing.d.ts.map +1 -1
- package/dist/components/pulse/PulseBars.d.ts +2 -2
- package/dist/components/pulse/PulseBars.d.ts.map +1 -1
- package/dist/components/pulse/PulseDots.d.ts +2 -2
- package/dist/components/pulse/PulseDots.d.ts.map +1 -1
- package/dist/components/pulse/PulseWave.d.ts +2 -2
- package/dist/components/pulse/PulseWave.d.ts.map +1 -1
- package/dist/components/pulse/TypingIndicator.d.ts.map +1 -1
- package/dist/components/spinner/SpinnerBars.d.ts +2 -2
- package/dist/components/spinner/SpinnerBars.d.ts.map +1 -1
- package/dist/components/spinner/SpinnerCircle.d.ts +2 -1
- package/dist/components/spinner/SpinnerCircle.d.ts.map +1 -1
- package/dist/components/spinner/SpinnerDots.d.ts +2 -2
- package/dist/components/spinner/SpinnerDots.d.ts.map +1 -1
- package/dist/components/spinner/SpinnerGrid.d.ts +2 -2
- package/dist/components/spinner/SpinnerGrid.d.ts.map +1 -1
- package/dist/components/spinner/SpinnerPulse.d.ts +3 -3
- package/dist/components/spinner/SpinnerPulse.d.ts.map +1 -1
- package/dist/components/spinner/SpinnerRing.d.ts +3 -3
- package/dist/components/spinner/SpinnerRing.d.ts.map +1 -1
- package/dist/components/spinner/SpinnerWave.d.ts +3 -3
- package/dist/components/spinner/SpinnerWave.d.ts.map +1 -1
- package/dist/index14.cjs +9 -3
- package/dist/index14.cjs.map +1 -1
- package/dist/index14.js +9 -3
- package/dist/index14.js.map +1 -1
- package/dist/index15.cjs +8 -2
- package/dist/index15.cjs.map +1 -1
- package/dist/index15.js +9 -3
- package/dist/index15.js.map +1 -1
- package/dist/index16.cjs +8 -2
- package/dist/index16.cjs.map +1 -1
- package/dist/index16.js +9 -3
- package/dist/index16.js.map +1 -1
- package/dist/index17.cjs +8 -4
- package/dist/index17.cjs.map +1 -1
- package/dist/index17.js +9 -5
- package/dist/index17.js.map +1 -1
- package/dist/index18.cjs +9 -4
- package/dist/index18.cjs.map +1 -1
- package/dist/index18.js +10 -5
- package/dist/index18.js.map +1 -1
- package/dist/index19.cjs +9 -4
- package/dist/index19.cjs.map +1 -1
- package/dist/index19.js +10 -5
- package/dist/index19.js.map +1 -1
- package/dist/index20.cjs +9 -4
- package/dist/index20.cjs.map +1 -1
- package/dist/index20.js +10 -5
- package/dist/index20.js.map +1 -1
- package/dist/index21.cjs +7 -2
- package/dist/index21.cjs.map +1 -1
- package/dist/index21.js +8 -3
- package/dist/index21.js.map +1 -1
- package/dist/index22.cjs +11 -4
- package/dist/index22.cjs.map +1 -1
- package/dist/index22.js +12 -5
- package/dist/index22.js.map +1 -1
- package/dist/index23.cjs +11 -4
- package/dist/index23.cjs.map +1 -1
- package/dist/index23.js +12 -5
- package/dist/index23.js.map +1 -1
- package/dist/index25.cjs +8 -4
- package/dist/index25.cjs.map +1 -1
- package/dist/index25.js +9 -5
- package/dist/index25.js.map +1 -1
- package/dist/index26.cjs +8 -4
- package/dist/index26.cjs.map +1 -1
- package/dist/index26.js +9 -5
- package/dist/index26.js.map +1 -1
- package/dist/index27.cjs +9 -4
- package/dist/index27.cjs.map +1 -1
- package/dist/index27.js +10 -5
- package/dist/index27.js.map +1 -1
- package/dist/index28.cjs +7 -3
- package/dist/index28.cjs.map +1 -1
- package/dist/index28.js +8 -4
- package/dist/index28.js.map +1 -1
- package/dist/index31.cjs +42 -0
- package/dist/index31.cjs.map +1 -0
- package/dist/index31.js +42 -0
- package/dist/index31.js.map +1 -0
- package/dist/index4.cjs +10 -0
- package/dist/index4.cjs.map +1 -1
- package/dist/index4.js +10 -0
- package/dist/index4.js.map +1 -1
- package/dist/premium-react-loaders.css +270 -3
- package/dist/types/common.d.ts +14 -2
- package/dist/types/common.d.ts.map +1 -1
- package/dist/utils/colors.d.ts +2 -1
- package/dist/utils/colors.d.ts.map +1 -1
- package/dist/utils/hooks.d.ts +10 -0
- package/dist/utils/hooks.d.ts.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Premium React Loaders
|
|
2
2
|
|
|
3
|
-
A comprehensive collection of **
|
|
3
|
+
A comprehensive collection of **25 premium, production-ready loading components** for React applications. Built with TypeScript and Tailwind CSS for maximum flexibility and customization.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/premium-react-loaders)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
@@ -11,11 +11,14 @@ A comprehensive collection of **20 premium, production-ready loading components*
|
|
|
11
11
|
|
|
12
12
|
📚 **[Storybook Documentation](https://docs.premium-react-loaders.ishansasika.dev/)** - Detailed component documentation and examples
|
|
13
13
|
|
|
14
|
-
See all
|
|
14
|
+
See all 25 components in action with interactive examples and customization options.
|
|
15
15
|
|
|
16
16
|
## Features
|
|
17
17
|
|
|
18
|
-
- **
|
|
18
|
+
- **25 Premium Components** across 5 categories (Skeleton, Spinner, Progress, Pulse, Overlay)
|
|
19
|
+
- **Size Presets** - Easy sizing with `xs`, `sm`, `md`, `lg`, `xl` presets ✨ *New in v1.2.0*
|
|
20
|
+
- **Reduced Motion Support** - Respects `prefers-reduced-motion` for accessibility ✨ *New in v1.2.0*
|
|
21
|
+
- **Animation Direction Control** - Reverse animations with `reverse` prop ✨ *New in v1.2.0*
|
|
19
22
|
- **Full TypeScript Support** with exported type definitions
|
|
20
23
|
- **Tailwind CSS Integration** for easy customization
|
|
21
24
|
- **Tree-shakeable** - only bundle what you use
|
|
@@ -80,14 +83,16 @@ function App() {
|
|
|
80
83
|
<Skeleton width={200} height={20} />
|
|
81
84
|
<SkeletonCard hasAvatar lines={3} />
|
|
82
85
|
|
|
83
|
-
{/* Spinners */}
|
|
84
|
-
<SpinnerCircle size=
|
|
86
|
+
{/* Spinners with Size Presets (v1.2.0+) */}
|
|
87
|
+
<SpinnerCircle size="lg" color="#3b82f6" />
|
|
88
|
+
<SpinnerCircle size="md" reverse /> {/* Reverse animation */}
|
|
85
89
|
|
|
86
90
|
{/* Progress Bars */}
|
|
87
91
|
<ProgressBar value={75} showValue />
|
|
92
|
+
<ProgressBar indeterminate reverse /> {/* Reverse sweep */}
|
|
88
93
|
|
|
89
94
|
{/* Pulse Loaders */}
|
|
90
|
-
<PulseDots dotCount={3} />
|
|
95
|
+
<PulseDots size="sm" dotCount={3} />
|
|
91
96
|
</div>
|
|
92
97
|
);
|
|
93
98
|
}
|
|
@@ -268,6 +273,50 @@ import { LoaderOverlay, SkeletonPage, SpinnerCircle } from 'premium-react-loader
|
|
|
268
273
|
</LoaderOverlay>
|
|
269
274
|
```
|
|
270
275
|
|
|
276
|
+
### New in v1.2.0
|
|
277
|
+
|
|
278
|
+
**Size Presets** - Use semantic size names instead of pixel values:
|
|
279
|
+
|
|
280
|
+
```tsx
|
|
281
|
+
import { SpinnerCircle, ProgressBar, PulseDots } from 'premium-react-loaders';
|
|
282
|
+
|
|
283
|
+
// Size presets: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
284
|
+
<SpinnerCircle size="xs" /> {/* 16px */}
|
|
285
|
+
<SpinnerCircle size="sm" /> {/* 24px */}
|
|
286
|
+
<SpinnerCircle size="md" /> {/* 40px - default */}
|
|
287
|
+
<SpinnerCircle size="lg" /> {/* 56px */}
|
|
288
|
+
<SpinnerCircle size="xl" /> {/* 72px */}
|
|
289
|
+
|
|
290
|
+
// Still works with numbers and CSS strings
|
|
291
|
+
<SpinnerCircle size={50} />
|
|
292
|
+
<SpinnerCircle size="3rem" />
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
**Reduced Motion Support** - Automatically respects user accessibility preferences:
|
|
296
|
+
|
|
297
|
+
```tsx
|
|
298
|
+
// Respects prefers-reduced-motion by default
|
|
299
|
+
<SpinnerCircle size="md" />
|
|
300
|
+
|
|
301
|
+
// Disable reduced motion support if needed
|
|
302
|
+
<SpinnerCircle size="md" respectMotionPreference={false} />
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
**Animation Direction Control** - Reverse animations for creative effects:
|
|
306
|
+
|
|
307
|
+
```tsx
|
|
308
|
+
import { SpinnerCircle, ProgressBar, PulseDots } from 'premium-react-loaders';
|
|
309
|
+
|
|
310
|
+
// Reverse spinner rotation (counter-clockwise)
|
|
311
|
+
<SpinnerCircle size="lg" reverse />
|
|
312
|
+
|
|
313
|
+
// Reverse progress sweep direction
|
|
314
|
+
<ProgressBar indeterminate reverse />
|
|
315
|
+
|
|
316
|
+
// Reverse pulse/dot animation sequence
|
|
317
|
+
<PulseDots size="md" reverse />
|
|
318
|
+
```
|
|
319
|
+
|
|
271
320
|
## Customization
|
|
272
321
|
|
|
273
322
|
All components support multiple customization methods:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../../../src/components/progress/ProgressBar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../../../src/components/progress/ProgressBar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,WAAW,6GA4GvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressCircle.d.ts","sourceRoot":"","sources":["../../../src/components/progress/ProgressCircle.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGlD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"ProgressCircle.d.ts","sourceRoot":"","sources":["../../../src/components/progress/ProgressCircle.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGlD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc,gHAsH1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressRing.d.ts","sourceRoot":"","sources":["../../../src/components/progress/ProgressRing.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGhD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"ProgressRing.d.ts","sourceRoot":"","sources":["../../../src/components/progress/ProgressRing.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGhD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,YAAY,8GAgIxB,CAAC"}
|
|
@@ -6,8 +6,8 @@ import { PulseBarsProps } from '../../types';
|
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```tsx
|
|
9
|
-
* <PulseBars size=
|
|
10
|
-
* <PulseBars size=
|
|
9
|
+
* <PulseBars size="lg" color="#3b82f6" />
|
|
10
|
+
* <PulseBars size="md" barCount={6} speed="fast" reverse />
|
|
11
11
|
* ```
|
|
12
12
|
*/
|
|
13
13
|
export declare const PulseBars: import('react').ForwardRefExoticComponent<PulseBarsProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PulseBars.d.ts","sourceRoot":"","sources":["../../../src/components/pulse/PulseBars.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"PulseBars.d.ts","sourceRoot":"","sources":["../../../src/components/pulse/PulseBars.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,2GAiErB,CAAC"}
|
|
@@ -6,8 +6,8 @@ import { PulseDotsProps } from '../../types';
|
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```tsx
|
|
9
|
-
* <PulseDots size=
|
|
10
|
-
* <PulseDots size=
|
|
9
|
+
* <PulseDots size="lg" color="#3b82f6" />
|
|
10
|
+
* <PulseDots size="sm" dotCount={5} speed="fast" reverse />
|
|
11
11
|
* ```
|
|
12
12
|
*/
|
|
13
13
|
export declare const PulseDots: import('react').ForwardRefExoticComponent<PulseDotsProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PulseDots.d.ts","sourceRoot":"","sources":["../../../src/components/pulse/PulseDots.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"PulseDots.d.ts","sourceRoot":"","sources":["../../../src/components/pulse/PulseDots.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,2GAsDrB,CAAC"}
|
|
@@ -6,8 +6,8 @@ import { PulseWaveProps } from '../../types';
|
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```tsx
|
|
9
|
-
* <PulseWave size=
|
|
10
|
-
* <PulseWave size=
|
|
9
|
+
* <PulseWave size="lg" color="#3b82f6" />
|
|
10
|
+
* <PulseWave size="sm" barCount={7} speed="slow" reverse />
|
|
11
11
|
* ```
|
|
12
12
|
*/
|
|
13
13
|
export declare const PulseWave: import('react').ForwardRefExoticComponent<PulseWaveProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PulseWave.d.ts","sourceRoot":"","sources":["../../../src/components/pulse/PulseWave.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"PulseWave.d.ts","sourceRoot":"","sources":["../../../src/components/pulse/PulseWave.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,2GA6DrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypingIndicator.d.ts","sourceRoot":"","sources":["../../../src/components/pulse/TypingIndicator.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGnD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"TypingIndicator.d.ts","sourceRoot":"","sources":["../../../src/components/pulse/TypingIndicator.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGnD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,iHA0D3B,CAAC"}
|
|
@@ -6,8 +6,8 @@ import { SpinnerBarsProps } from '../../types';
|
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```tsx
|
|
9
|
-
* <SpinnerBars size=
|
|
10
|
-
* <SpinnerBars size=
|
|
9
|
+
* <SpinnerBars size="lg" color="#3b82f6" />
|
|
10
|
+
* <SpinnerBars size="sm" barCount={5} speed="fast" reverse />
|
|
11
11
|
* ```
|
|
12
12
|
*/
|
|
13
13
|
export declare const SpinnerBars: import('react').ForwardRefExoticComponent<SpinnerBarsProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpinnerBars.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/SpinnerBars.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"SpinnerBars.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/SpinnerBars.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,6GAwDvB,CAAC"}
|
|
@@ -7,7 +7,8 @@ import { SpinnerCircleProps } from '../../types';
|
|
|
7
7
|
* @example
|
|
8
8
|
* ```tsx
|
|
9
9
|
* <SpinnerCircle size={40} color="#3b82f6" />
|
|
10
|
-
* <SpinnerCircle size=
|
|
10
|
+
* <SpinnerCircle size="lg" thickness={3} speed="fast" />
|
|
11
|
+
* <SpinnerCircle size="md" reverse />
|
|
11
12
|
* ```
|
|
12
13
|
*/
|
|
13
14
|
export declare const SpinnerCircle: import('react').ForwardRefExoticComponent<SpinnerCircleProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpinnerCircle.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/SpinnerCircle.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGjD
|
|
1
|
+
{"version":3,"file":"SpinnerCircle.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/SpinnerCircle.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGjD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,+GA0DzB,CAAC"}
|
|
@@ -6,8 +6,8 @@ import { SpinnerDotsProps } from '../../types';
|
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```tsx
|
|
9
|
-
* <SpinnerDots size=
|
|
10
|
-
* <SpinnerDots size=
|
|
9
|
+
* <SpinnerDots size="lg" color="#3b82f6" />
|
|
10
|
+
* <SpinnerDots size="md" dotCount={8} dotSize={6} reverse />
|
|
11
11
|
* ```
|
|
12
12
|
*/
|
|
13
13
|
export declare const SpinnerDots: import('react').ForwardRefExoticComponent<SpinnerDotsProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpinnerDots.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/SpinnerDots.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"SpinnerDots.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/SpinnerDots.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,6GAyEvB,CAAC"}
|
|
@@ -6,8 +6,8 @@ import { SpinnerGridProps } from '../../types';
|
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```tsx
|
|
9
|
-
* <SpinnerGrid size=
|
|
10
|
-
* <SpinnerGrid size=
|
|
9
|
+
* <SpinnerGrid size="lg" color="#3b82f6" />
|
|
10
|
+
* <SpinnerGrid size="md" gridSize={4} reverse />
|
|
11
11
|
* ```
|
|
12
12
|
*/
|
|
13
13
|
export declare const SpinnerGrid: import('react').ForwardRefExoticComponent<SpinnerGridProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpinnerGrid.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/SpinnerGrid.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"SpinnerGrid.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/SpinnerGrid.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,6GAqEvB,CAAC"}
|
|
@@ -6,9 +6,9 @@ import { SpinnerPulseProps } from '../../types';
|
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```tsx
|
|
9
|
-
* <SpinnerPulse size=
|
|
10
|
-
* <SpinnerPulse size=
|
|
11
|
-
* <SpinnerPulse size=
|
|
9
|
+
* <SpinnerPulse size="lg" color="#3b82f6" />
|
|
10
|
+
* <SpinnerPulse size="xl" pulses={3} reverse />
|
|
11
|
+
* <SpinnerPulse size="md" maxScale={2.5} speed="slow" />
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
14
|
export declare const SpinnerPulse: import('react').ForwardRefExoticComponent<SpinnerPulseProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpinnerPulse.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/SpinnerPulse.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGhD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"SpinnerPulse.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/SpinnerPulse.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGhD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,8GA0ExB,CAAC"}
|
|
@@ -6,9 +6,9 @@ import { SpinnerRingProps } from '../../types';
|
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```tsx
|
|
9
|
-
* <SpinnerRing size=
|
|
10
|
-
* <SpinnerRing size=
|
|
11
|
-
* <SpinnerRing size=
|
|
9
|
+
* <SpinnerRing size="lg" color="#8b5cf6" />
|
|
10
|
+
* <SpinnerRing size="sm" thickness={3} speed="slow" />
|
|
11
|
+
* <SpinnerRing size="md" color="#3b82f6" secondaryColor="#e0e0e0" reverse />
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
14
|
export declare const SpinnerRing: import('react').ForwardRefExoticComponent<SpinnerRingProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpinnerRing.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/SpinnerRing.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"SpinnerRing.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/SpinnerRing.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,6GAiDvB,CAAC"}
|
|
@@ -6,9 +6,9 @@ import { SpinnerWaveProps } from '../../types';
|
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```tsx
|
|
9
|
-
* <SpinnerWave size=
|
|
10
|
-
* <SpinnerWave size=
|
|
11
|
-
* <SpinnerWave size=
|
|
9
|
+
* <SpinnerWave size="lg" color="#3b82f6" />
|
|
10
|
+
* <SpinnerWave size="xl" ripples={5} reverse />
|
|
11
|
+
* <SpinnerWave size="md" maxScale={2.5} speed="fast" />
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
14
|
export declare const SpinnerWave: import('react').ForwardRefExoticComponent<SpinnerWaveProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpinnerWave.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/SpinnerWave.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"SpinnerWave.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/SpinnerWave.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,6GA8DvB,CAAC"}
|
package/dist/index14.cjs
CHANGED
|
@@ -2,14 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
|
-
const
|
|
5
|
+
const hooks = require("./index31.cjs");
|
|
6
6
|
const classNames = require("./index3.cjs");
|
|
7
|
+
const colors = require("./index4.cjs");
|
|
7
8
|
const SpinnerCircle = react.forwardRef(
|
|
8
9
|
({
|
|
9
|
-
size =
|
|
10
|
+
size = "md",
|
|
10
11
|
color = "#3b82f6",
|
|
11
12
|
thickness = 4,
|
|
12
13
|
speed = "normal",
|
|
14
|
+
reverse = false,
|
|
15
|
+
respectMotionPreference = true,
|
|
13
16
|
className,
|
|
14
17
|
style,
|
|
15
18
|
testId = "spinner-circle",
|
|
@@ -18,6 +21,8 @@ const SpinnerCircle = react.forwardRef(
|
|
|
18
21
|
...rest
|
|
19
22
|
}, ref) => {
|
|
20
23
|
if (!visible) return null;
|
|
24
|
+
const prefersReducedMotion = hooks.useReducedMotion();
|
|
25
|
+
const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
21
26
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
22
27
|
"div",
|
|
23
28
|
{
|
|
@@ -36,7 +41,8 @@ const SpinnerCircle = react.forwardRef(
|
|
|
36
41
|
style: {
|
|
37
42
|
width: colors.normalizeSize(size),
|
|
38
43
|
height: colors.normalizeSize(size),
|
|
39
|
-
animationDuration:
|
|
44
|
+
animationDuration: effectiveDuration,
|
|
45
|
+
animationDirection: reverse ? "reverse" : "normal"
|
|
40
46
|
},
|
|
41
47
|
viewBox: "0 0 50 50",
|
|
42
48
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
package/dist/index14.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index14.cjs","sources":["../src/components/spinner/SpinnerCircle.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerCircleProps } from '../../types';\nimport { cn, normalizeSize,
|
|
1
|
+
{"version":3,"file":"index14.cjs","sources":["../src/components/spinner/SpinnerCircle.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerCircleProps } from '../../types';\nimport { cn, normalizeSize, useReducedMotion, getEffectiveDuration } from '../../utils';\n\n/**\n * SpinnerCircle - Basic rotating circle spinner\n *\n * A simple, elegant circular spinner with a partial arc that rotates continuously.\n *\n * @example\n * ```tsx\n * <SpinnerCircle size={40} color=\"#3b82f6\" />\n * <SpinnerCircle size=\"lg\" thickness={3} speed=\"fast\" />\n * <SpinnerCircle size=\"md\" reverse />\n * ```\n */\nexport const SpinnerCircle = forwardRef<HTMLDivElement, SpinnerCircleProps>(\n (\n {\n size = 'md',\n color = '#3b82f6',\n thickness = 4,\n speed = 'normal',\n reverse = false,\n respectMotionPreference = true,\n className,\n style,\n testId = 'spinner-circle',\n visible = true,\n ariaLabel = 'Loading...',\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const prefersReducedMotion = useReducedMotion();\n const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('inline-flex items-center justify-center', className)}\n style={style}\n role=\"status\"\n aria-label={ariaLabel}\n aria-busy=\"true\"\n {...rest}\n >\n <svg\n className=\"animate-spinner-rotate\"\n style={{\n width: normalizeSize(size),\n height: normalizeSize(size),\n animationDuration: effectiveDuration,\n animationDirection: reverse ? 'reverse' : 'normal',\n }}\n viewBox=\"0 0 50 50\"\n >\n <circle\n cx=\"25\"\n cy=\"25\"\n r={25 - thickness * 2}\n fill=\"none\"\n stroke={color}\n strokeWidth={thickness}\n strokeDasharray=\"80, 200\"\n strokeLinecap=\"round\"\n />\n </svg>\n </div>\n );\n }\n);\n\nSpinnerCircle.displayName = 'SpinnerCircle';\n"],"names":["forwardRef","useReducedMotion","getEffectiveDuration","jsx","cn","normalizeSize"],"mappings":";;;;;;;AAgBO,MAAM,gBAAgBA,MAAAA;AAAAA,EAC3B,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,0BAA0B;AAAA,IAC1B;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,UAAM,uBAAuBC,MAAAA,iBAAA;AAC7B,UAAM,oBAAoBC,MAAAA,qBAAqB,OAAO,yBAAyB,oBAAoB;AAEnG,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAWC,WAAAA,GAAG,2CAA2C,SAAS;AAAA,QAClE;AAAA,QACA,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEJ,UAAAD,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,OAAOE,OAAAA,cAAc,IAAI;AAAA,cACzB,QAAQA,OAAAA,cAAc,IAAI;AAAA,cAC1B,mBAAmB;AAAA,cACnB,oBAAoB,UAAU,YAAY;AAAA,YAAA;AAAA,YAE5C,SAAQ;AAAA,YAER,UAAAF,2BAAAA;AAAAA,cAAC;AAAA,cAAA;AAAA,gBACC,IAAG;AAAA,gBACH,IAAG;AAAA,gBACH,GAAG,KAAK,YAAY;AAAA,gBACpB,MAAK;AAAA,gBACL,QAAQ;AAAA,gBACR,aAAa;AAAA,gBACb,iBAAgB;AAAA,gBAChB,eAAc;AAAA,cAAA;AAAA,YAAA;AAAA,UAChB;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,cAAc,cAAc;;"}
|
package/dist/index14.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { useReducedMotion, getEffectiveDuration } from "./index31.js";
|
|
4
4
|
import { cn } from "./index3.js";
|
|
5
|
+
import { normalizeSize } from "./index4.js";
|
|
5
6
|
const SpinnerCircle = forwardRef(
|
|
6
7
|
({
|
|
7
|
-
size =
|
|
8
|
+
size = "md",
|
|
8
9
|
color = "#3b82f6",
|
|
9
10
|
thickness = 4,
|
|
10
11
|
speed = "normal",
|
|
12
|
+
reverse = false,
|
|
13
|
+
respectMotionPreference = true,
|
|
11
14
|
className,
|
|
12
15
|
style,
|
|
13
16
|
testId = "spinner-circle",
|
|
@@ -16,6 +19,8 @@ const SpinnerCircle = forwardRef(
|
|
|
16
19
|
...rest
|
|
17
20
|
}, ref) => {
|
|
18
21
|
if (!visible) return null;
|
|
22
|
+
const prefersReducedMotion = useReducedMotion();
|
|
23
|
+
const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
19
24
|
return /* @__PURE__ */ jsx(
|
|
20
25
|
"div",
|
|
21
26
|
{
|
|
@@ -34,7 +39,8 @@ const SpinnerCircle = forwardRef(
|
|
|
34
39
|
style: {
|
|
35
40
|
width: normalizeSize(size),
|
|
36
41
|
height: normalizeSize(size),
|
|
37
|
-
animationDuration:
|
|
42
|
+
animationDuration: effectiveDuration,
|
|
43
|
+
animationDirection: reverse ? "reverse" : "normal"
|
|
38
44
|
},
|
|
39
45
|
viewBox: "0 0 50 50",
|
|
40
46
|
children: /* @__PURE__ */ jsx(
|
package/dist/index14.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index14.js","sources":["../src/components/spinner/SpinnerCircle.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerCircleProps } from '../../types';\nimport { cn, normalizeSize,
|
|
1
|
+
{"version":3,"file":"index14.js","sources":["../src/components/spinner/SpinnerCircle.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerCircleProps } from '../../types';\nimport { cn, normalizeSize, useReducedMotion, getEffectiveDuration } from '../../utils';\n\n/**\n * SpinnerCircle - Basic rotating circle spinner\n *\n * A simple, elegant circular spinner with a partial arc that rotates continuously.\n *\n * @example\n * ```tsx\n * <SpinnerCircle size={40} color=\"#3b82f6\" />\n * <SpinnerCircle size=\"lg\" thickness={3} speed=\"fast\" />\n * <SpinnerCircle size=\"md\" reverse />\n * ```\n */\nexport const SpinnerCircle = forwardRef<HTMLDivElement, SpinnerCircleProps>(\n (\n {\n size = 'md',\n color = '#3b82f6',\n thickness = 4,\n speed = 'normal',\n reverse = false,\n respectMotionPreference = true,\n className,\n style,\n testId = 'spinner-circle',\n visible = true,\n ariaLabel = 'Loading...',\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const prefersReducedMotion = useReducedMotion();\n const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('inline-flex items-center justify-center', className)}\n style={style}\n role=\"status\"\n aria-label={ariaLabel}\n aria-busy=\"true\"\n {...rest}\n >\n <svg\n className=\"animate-spinner-rotate\"\n style={{\n width: normalizeSize(size),\n height: normalizeSize(size),\n animationDuration: effectiveDuration,\n animationDirection: reverse ? 'reverse' : 'normal',\n }}\n viewBox=\"0 0 50 50\"\n >\n <circle\n cx=\"25\"\n cy=\"25\"\n r={25 - thickness * 2}\n fill=\"none\"\n stroke={color}\n strokeWidth={thickness}\n strokeDasharray=\"80, 200\"\n strokeLinecap=\"round\"\n />\n </svg>\n </div>\n );\n }\n);\n\nSpinnerCircle.displayName = 'SpinnerCircle';\n"],"names":[],"mappings":";;;;;AAgBO,MAAM,gBAAgB;AAAA,EAC3B,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,0BAA0B;AAAA,IAC1B;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,UAAM,uBAAuB,iBAAA;AAC7B,UAAM,oBAAoB,qBAAqB,OAAO,yBAAyB,oBAAoB;AAEnG,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAW,GAAG,2CAA2C,SAAS;AAAA,QAClE;AAAA,QACA,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,OAAO,cAAc,IAAI;AAAA,cACzB,QAAQ,cAAc,IAAI;AAAA,cAC1B,mBAAmB;AAAA,cACnB,oBAAoB,UAAU,YAAY;AAAA,YAAA;AAAA,YAE5C,SAAQ;AAAA,YAER,UAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,IAAG;AAAA,gBACH,IAAG;AAAA,gBACH,GAAG,KAAK,YAAY;AAAA,gBACpB,MAAK;AAAA,gBACL,QAAQ;AAAA,gBACR,aAAa;AAAA,gBACb,iBAAgB;AAAA,gBAChB,eAAc;AAAA,cAAA;AAAA,YAAA;AAAA,UAChB;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,cAAc,cAAc;"}
|
package/dist/index15.cjs
CHANGED
|
@@ -2,15 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
|
+
const hooks = require("./index31.cjs");
|
|
5
6
|
const classNames = require("./index3.cjs");
|
|
6
7
|
const colors = require("./index4.cjs");
|
|
7
8
|
const SpinnerRing = react.forwardRef(
|
|
8
9
|
({
|
|
9
|
-
size =
|
|
10
|
+
size = "md",
|
|
10
11
|
color = "#3b82f6",
|
|
11
12
|
secondaryColor = "rgba(0, 0, 0, 0.1)",
|
|
12
13
|
thickness = 4,
|
|
13
14
|
speed = "normal",
|
|
15
|
+
reverse = false,
|
|
16
|
+
respectMotionPreference = true,
|
|
14
17
|
className,
|
|
15
18
|
style,
|
|
16
19
|
testId = "spinner-ring",
|
|
@@ -19,6 +22,8 @@ const SpinnerRing = react.forwardRef(
|
|
|
19
22
|
...rest
|
|
20
23
|
}, ref) => {
|
|
21
24
|
if (!visible) return null;
|
|
25
|
+
const prefersReducedMotion = hooks.useReducedMotion();
|
|
26
|
+
const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
22
27
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
23
28
|
"div",
|
|
24
29
|
{
|
|
@@ -39,7 +44,8 @@ const SpinnerRing = react.forwardRef(
|
|
|
39
44
|
height: colors.normalizeSize(size),
|
|
40
45
|
border: `${thickness}px solid ${secondaryColor}`,
|
|
41
46
|
borderTopColor: color,
|
|
42
|
-
animation: `spinner-rotate ${
|
|
47
|
+
animation: `spinner-rotate ${effectiveDuration} linear infinite`,
|
|
48
|
+
animationDirection: reverse ? "reverse" : "normal"
|
|
43
49
|
}
|
|
44
50
|
}
|
|
45
51
|
)
|
package/dist/index15.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index15.cjs","sources":["../src/components/spinner/SpinnerRing.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerRingProps } from '../../types';\nimport { cn, normalizeSize,
|
|
1
|
+
{"version":3,"file":"index15.cjs","sources":["../src/components/spinner/SpinnerRing.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerRingProps } from '../../types';\nimport { cn, normalizeSize, useReducedMotion, getEffectiveDuration } from '../../utils';\n\n/**\n * SpinnerRing - Border-only rotating spinner\n *\n * A ring-style spinner with a transparent center and colored border.\n *\n * @example\n * ```tsx\n * <SpinnerRing size=\"lg\" color=\"#8b5cf6\" />\n * <SpinnerRing size=\"sm\" thickness={3} speed=\"slow\" />\n * <SpinnerRing size=\"md\" color=\"#3b82f6\" secondaryColor=\"#e0e0e0\" reverse />\n * ```\n */\nexport const SpinnerRing = forwardRef<HTMLDivElement, SpinnerRingProps>(\n (\n {\n size = 'md',\n color = '#3b82f6',\n secondaryColor = 'rgba(0, 0, 0, 0.1)',\n thickness = 4,\n speed = 'normal',\n reverse = false,\n respectMotionPreference = true,\n className,\n style,\n testId = 'spinner-ring',\n visible = true,\n ariaLabel = 'Loading...',\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const prefersReducedMotion = useReducedMotion();\n const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('inline-flex items-center justify-center', className)}\n style={style}\n role=\"status\"\n aria-label={ariaLabel}\n aria-busy=\"true\"\n {...rest}\n >\n <div\n className=\"rounded-full\"\n style={{\n width: normalizeSize(size),\n height: normalizeSize(size),\n border: `${thickness}px solid ${secondaryColor}`,\n borderTopColor: color,\n animation: `spinner-rotate ${effectiveDuration} linear infinite`,\n animationDirection: reverse ? 'reverse' : 'normal',\n }}\n />\n </div>\n );\n }\n);\n\nSpinnerRing.displayName = 'SpinnerRing';\n"],"names":["forwardRef","useReducedMotion","getEffectiveDuration","jsx","cn","normalizeSize"],"mappings":";;;;;;;AAgBO,MAAM,cAAcA,MAAAA;AAAAA,EACzB,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,iBAAiB;AAAA,IACjB,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,0BAA0B;AAAA,IAC1B;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,UAAM,uBAAuBC,MAAAA,iBAAA;AAC7B,UAAM,oBAAoBC,MAAAA,qBAAqB,OAAO,yBAAyB,oBAAoB;AAEnG,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAWC,WAAAA,GAAG,2CAA2C,SAAS;AAAA,QAClE;AAAA,QACA,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEJ,UAAAD,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,OAAOE,OAAAA,cAAc,IAAI;AAAA,cACzB,QAAQA,OAAAA,cAAc,IAAI;AAAA,cAC1B,QAAQ,GAAG,SAAS,YAAY,cAAc;AAAA,cAC9C,gBAAgB;AAAA,cAChB,WAAW,kBAAkB,iBAAiB;AAAA,cAC9C,oBAAoB,UAAU,YAAY;AAAA,YAAA;AAAA,UAC5C;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,YAAY,cAAc;;"}
|
package/dist/index15.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
+
import { useReducedMotion, getEffectiveDuration } from "./index31.js";
|
|
3
4
|
import { cn } from "./index3.js";
|
|
4
|
-
import {
|
|
5
|
+
import { normalizeSize } from "./index4.js";
|
|
5
6
|
const SpinnerRing = forwardRef(
|
|
6
7
|
({
|
|
7
|
-
size =
|
|
8
|
+
size = "md",
|
|
8
9
|
color = "#3b82f6",
|
|
9
10
|
secondaryColor = "rgba(0, 0, 0, 0.1)",
|
|
10
11
|
thickness = 4,
|
|
11
12
|
speed = "normal",
|
|
13
|
+
reverse = false,
|
|
14
|
+
respectMotionPreference = true,
|
|
12
15
|
className,
|
|
13
16
|
style,
|
|
14
17
|
testId = "spinner-ring",
|
|
@@ -17,6 +20,8 @@ const SpinnerRing = forwardRef(
|
|
|
17
20
|
...rest
|
|
18
21
|
}, ref) => {
|
|
19
22
|
if (!visible) return null;
|
|
23
|
+
const prefersReducedMotion = useReducedMotion();
|
|
24
|
+
const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
20
25
|
return /* @__PURE__ */ jsx(
|
|
21
26
|
"div",
|
|
22
27
|
{
|
|
@@ -37,7 +42,8 @@ const SpinnerRing = forwardRef(
|
|
|
37
42
|
height: normalizeSize(size),
|
|
38
43
|
border: `${thickness}px solid ${secondaryColor}`,
|
|
39
44
|
borderTopColor: color,
|
|
40
|
-
animation: `spinner-rotate ${
|
|
45
|
+
animation: `spinner-rotate ${effectiveDuration} linear infinite`,
|
|
46
|
+
animationDirection: reverse ? "reverse" : "normal"
|
|
41
47
|
}
|
|
42
48
|
}
|
|
43
49
|
)
|
package/dist/index15.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index15.js","sources":["../src/components/spinner/SpinnerRing.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerRingProps } from '../../types';\nimport { cn, normalizeSize,
|
|
1
|
+
{"version":3,"file":"index15.js","sources":["../src/components/spinner/SpinnerRing.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerRingProps } from '../../types';\nimport { cn, normalizeSize, useReducedMotion, getEffectiveDuration } from '../../utils';\n\n/**\n * SpinnerRing - Border-only rotating spinner\n *\n * A ring-style spinner with a transparent center and colored border.\n *\n * @example\n * ```tsx\n * <SpinnerRing size=\"lg\" color=\"#8b5cf6\" />\n * <SpinnerRing size=\"sm\" thickness={3} speed=\"slow\" />\n * <SpinnerRing size=\"md\" color=\"#3b82f6\" secondaryColor=\"#e0e0e0\" reverse />\n * ```\n */\nexport const SpinnerRing = forwardRef<HTMLDivElement, SpinnerRingProps>(\n (\n {\n size = 'md',\n color = '#3b82f6',\n secondaryColor = 'rgba(0, 0, 0, 0.1)',\n thickness = 4,\n speed = 'normal',\n reverse = false,\n respectMotionPreference = true,\n className,\n style,\n testId = 'spinner-ring',\n visible = true,\n ariaLabel = 'Loading...',\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const prefersReducedMotion = useReducedMotion();\n const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('inline-flex items-center justify-center', className)}\n style={style}\n role=\"status\"\n aria-label={ariaLabel}\n aria-busy=\"true\"\n {...rest}\n >\n <div\n className=\"rounded-full\"\n style={{\n width: normalizeSize(size),\n height: normalizeSize(size),\n border: `${thickness}px solid ${secondaryColor}`,\n borderTopColor: color,\n animation: `spinner-rotate ${effectiveDuration} linear infinite`,\n animationDirection: reverse ? 'reverse' : 'normal',\n }}\n />\n </div>\n );\n }\n);\n\nSpinnerRing.displayName = 'SpinnerRing';\n"],"names":[],"mappings":";;;;;AAgBO,MAAM,cAAc;AAAA,EACzB,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,iBAAiB;AAAA,IACjB,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,0BAA0B;AAAA,IAC1B;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,UAAM,uBAAuB,iBAAA;AAC7B,UAAM,oBAAoB,qBAAqB,OAAO,yBAAyB,oBAAoB;AAEnG,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAW,GAAG,2CAA2C,SAAS;AAAA,QAClE;AAAA,QACA,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,OAAO,cAAc,IAAI;AAAA,cACzB,QAAQ,cAAc,IAAI;AAAA,cAC1B,QAAQ,GAAG,SAAS,YAAY,cAAc;AAAA,cAC9C,gBAAgB;AAAA,cAChB,WAAW,kBAAkB,iBAAiB;AAAA,cAC9C,oBAAoB,UAAU,YAAY;AAAA,YAAA;AAAA,UAC5C;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,YAAY,cAAc;"}
|
package/dist/index16.cjs
CHANGED
|
@@ -3,14 +3,17 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
5
|
const colors = require("./index4.cjs");
|
|
6
|
+
const hooks = require("./index31.cjs");
|
|
6
7
|
const classNames = require("./index3.cjs");
|
|
7
8
|
const SpinnerDots = react.forwardRef(
|
|
8
9
|
({
|
|
9
|
-
size =
|
|
10
|
+
size = "md",
|
|
10
11
|
color = "#3b82f6",
|
|
11
12
|
dotCount = 8,
|
|
12
13
|
dotSize = 4,
|
|
13
14
|
speed = "normal",
|
|
15
|
+
reverse = false,
|
|
16
|
+
respectMotionPreference = true,
|
|
14
17
|
className,
|
|
15
18
|
style,
|
|
16
19
|
testId = "spinner-dots",
|
|
@@ -19,6 +22,8 @@ const SpinnerDots = react.forwardRef(
|
|
|
19
22
|
...rest
|
|
20
23
|
}, ref) => {
|
|
21
24
|
if (!visible) return null;
|
|
25
|
+
const prefersReducedMotion = hooks.useReducedMotion();
|
|
26
|
+
const effectiveDuration = hooks.getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);
|
|
22
27
|
const sizeValue = colors.parseSizeToNumber(size, 40);
|
|
23
28
|
const dotSizeValue = colors.parseSizeToNumber(dotSize, 4);
|
|
24
29
|
const radius = (sizeValue - dotSizeValue) / 2;
|
|
@@ -40,7 +45,8 @@ const SpinnerDots = react.forwardRef(
|
|
|
40
45
|
style: {
|
|
41
46
|
width: colors.normalizeSize(size),
|
|
42
47
|
height: colors.normalizeSize(size),
|
|
43
|
-
animation: `spinner-rotate ${
|
|
48
|
+
animation: `spinner-rotate ${effectiveDuration} linear infinite`,
|
|
49
|
+
animationDirection: reverse ? "reverse" : "normal"
|
|
44
50
|
},
|
|
45
51
|
children: Array.from({ length: dotCount }).map((_, index) => {
|
|
46
52
|
const angle = 360 / dotCount * index;
|
package/dist/index16.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index16.cjs","sources":["../src/components/spinner/SpinnerDots.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerDotsProps } from '../../types';\nimport { cn, normalizeSize,
|
|
1
|
+
{"version":3,"file":"index16.cjs","sources":["../src/components/spinner/SpinnerDots.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { SpinnerDotsProps } from '../../types';\nimport { cn, normalizeSize, parseSizeToNumber, useReducedMotion, getEffectiveDuration } from '../../utils';\n\n/**\n * SpinnerDots - Multiple dots rotating around center\n *\n * A spinner with multiple dots arranged in a circle that rotates continuously.\n *\n * @example\n * ```tsx\n * <SpinnerDots size=\"lg\" color=\"#3b82f6\" />\n * <SpinnerDots size=\"md\" dotCount={8} dotSize={6} reverse />\n * ```\n */\nexport const SpinnerDots = forwardRef<HTMLDivElement, SpinnerDotsProps>(\n (\n {\n size = 'md',\n color = '#3b82f6',\n dotCount = 8,\n dotSize = 4,\n speed = 'normal',\n reverse = false,\n respectMotionPreference = true,\n className,\n style,\n testId = 'spinner-dots',\n visible = true,\n ariaLabel = 'Loading...',\n ...rest\n },\n ref\n ) => {\n if (!visible) return null;\n\n const prefersReducedMotion = useReducedMotion();\n const effectiveDuration = getEffectiveDuration(speed, respectMotionPreference, prefersReducedMotion);\n\n const sizeValue = parseSizeToNumber(size, 40);\n const dotSizeValue = parseSizeToNumber(dotSize, 4);\n const radius = (sizeValue - dotSizeValue) / 2;\n\n return (\n <div\n ref={ref}\n data-testid={testId}\n className={cn('inline-flex items-center justify-center', className)}\n style={style}\n role=\"status\"\n aria-label={ariaLabel}\n aria-busy=\"true\"\n {...rest}\n >\n <div\n className=\"relative\"\n style={{\n width: normalizeSize(size),\n height: normalizeSize(size),\n animation: `spinner-rotate ${effectiveDuration} linear infinite`,\n animationDirection: reverse ? 'reverse' : 'normal',\n }}\n >\n {Array.from({ length: dotCount }).map((_, index) => {\n const angle = (360 / dotCount) * index;\n const radian = (angle * Math.PI) / 180;\n const x = radius * Math.cos(radian) + radius;\n const y = radius * Math.sin(radian) + radius;\n\n return (\n <div\n key={index}\n className=\"absolute rounded-full\"\n style={{\n width: normalizeSize(dotSize),\n height: normalizeSize(dotSize),\n backgroundColor: color,\n left: `${x}px`,\n top: `${y}px`,\n opacity: 1 - (index / dotCount) * 0.7, // Fade effect\n }}\n />\n );\n })}\n </div>\n </div>\n );\n }\n);\n\nSpinnerDots.displayName = 'SpinnerDots';\n"],"names":["forwardRef","useReducedMotion","getEffectiveDuration","parseSizeToNumber","jsx","cn","normalizeSize"],"mappings":";;;;;;;AAeO,MAAM,cAAcA,MAAAA;AAAAA,EACzB,CACE;AAAA,IACE,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,0BAA0B;AAAA,IAC1B;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,GAAG;AAAA,EAAA,GAEL,QACG;AACH,QAAI,CAAC,QAAS,QAAO;AAErB,UAAM,uBAAuBC,MAAAA,iBAAA;AAC7B,UAAM,oBAAoBC,MAAAA,qBAAqB,OAAO,yBAAyB,oBAAoB;AAEnG,UAAM,YAAYC,OAAAA,kBAAkB,MAAM,EAAE;AAC5C,UAAM,eAAeA,OAAAA,kBAAkB,SAAS,CAAC;AACjD,UAAM,UAAU,YAAY,gBAAgB;AAE5C,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAa;AAAA,QACb,WAAWC,WAAAA,GAAG,2CAA2C,SAAS;AAAA,QAClE;AAAA,QACA,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,aAAU;AAAA,QACT,GAAG;AAAA,QAEJ,UAAAD,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,OAAO;AAAA,cACL,OAAOE,OAAAA,cAAc,IAAI;AAAA,cACzB,QAAQA,OAAAA,cAAc,IAAI;AAAA,cAC1B,WAAW,kBAAkB,iBAAiB;AAAA,cAC9C,oBAAoB,UAAU,YAAY;AAAA,YAAA;AAAA,YAG3C,UAAA,MAAM,KAAK,EAAE,QAAQ,SAAA,CAAU,EAAE,IAAI,CAAC,GAAG,UAAU;AAClD,oBAAM,QAAS,MAAM,WAAY;AACjC,oBAAM,SAAU,QAAQ,KAAK,KAAM;AACnC,oBAAM,IAAI,SAAS,KAAK,IAAI,MAAM,IAAI;AACtC,oBAAM,IAAI,SAAS,KAAK,IAAI,MAAM,IAAI;AAEtC,qBACEF,2BAAAA;AAAAA,gBAAC;AAAA,gBAAA;AAAA,kBAEC,WAAU;AAAA,kBACV,OAAO;AAAA,oBACL,OAAOE,OAAAA,cAAc,OAAO;AAAA,oBAC5B,QAAQA,OAAAA,cAAc,OAAO;AAAA,oBAC7B,iBAAiB;AAAA,oBACjB,MAAM,GAAG,CAAC;AAAA,oBACV,KAAK,GAAG,CAAC;AAAA,oBACT,SAAS,IAAK,QAAQ,WAAY;AAAA;AAAA,kBAAA;AAAA,gBACpC;AAAA,gBATK;AAAA,cAAA;AAAA,YAYX,CAAC;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,YAAY,cAAc;;"}
|