premium-react-loaders 2.1.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/README.md +142 -3
  2. package/dist/components/button/ButtonSpinner.d.ts +25 -0
  3. package/dist/components/button/ButtonSpinner.d.ts.map +1 -0
  4. package/dist/components/button/index.d.ts +2 -0
  5. package/dist/components/button/index.d.ts.map +1 -0
  6. package/dist/components/index.d.ts +3 -0
  7. package/dist/components/index.d.ts.map +1 -1
  8. package/dist/components/status/ErrorIndicator.d.ts +32 -0
  9. package/dist/components/status/ErrorIndicator.d.ts.map +1 -0
  10. package/dist/components/status/SuccessCheckmark.d.ts +31 -0
  11. package/dist/components/status/SuccessCheckmark.d.ts.map +1 -0
  12. package/dist/components/status/index.d.ts +3 -0
  13. package/dist/components/status/index.d.ts.map +1 -0
  14. package/dist/components/transition/LoaderTransition.d.ts +32 -0
  15. package/dist/components/transition/LoaderTransition.d.ts.map +1 -0
  16. package/dist/components/transition/index.d.ts +2 -0
  17. package/dist/components/transition/index.d.ts.map +1 -0
  18. package/dist/hooks/index.d.ts +3 -1
  19. package/dist/hooks/index.d.ts.map +1 -1
  20. package/dist/hooks/useEnhancedLoader.d.ts +62 -0
  21. package/dist/hooks/useEnhancedLoader.d.ts.map +1 -0
  22. package/dist/index.cjs +8 -0
  23. package/dist/index.js +8 -0
  24. package/dist/index10.cjs +1 -1
  25. package/dist/index10.js +1 -1
  26. package/dist/index11.cjs +1 -1
  27. package/dist/index11.js +1 -1
  28. package/dist/index12.cjs +1 -1
  29. package/dist/index12.js +1 -1
  30. package/dist/index13.cjs +1 -1
  31. package/dist/index13.js +1 -1
  32. package/dist/index14.cjs +1 -1
  33. package/dist/index14.js +1 -1
  34. package/dist/index15.cjs +1 -1
  35. package/dist/index15.js +1 -1
  36. package/dist/index16.cjs +1 -1
  37. package/dist/index16.js +1 -1
  38. package/dist/index17.cjs +1 -1
  39. package/dist/index17.js +1 -1
  40. package/dist/index18.cjs +1 -1
  41. package/dist/index18.js +1 -1
  42. package/dist/index19.cjs +1 -1
  43. package/dist/index19.js +1 -1
  44. package/dist/index20.cjs +1 -1
  45. package/dist/index20.js +1 -1
  46. package/dist/index21.cjs +1 -1
  47. package/dist/index21.js +1 -1
  48. package/dist/index22.cjs +1 -1
  49. package/dist/index22.js +1 -1
  50. package/dist/index23.cjs +1 -1
  51. package/dist/index23.js +1 -1
  52. package/dist/index24.cjs +1 -1
  53. package/dist/index24.js +1 -1
  54. package/dist/index25.cjs +1 -1
  55. package/dist/index25.js +1 -1
  56. package/dist/index26.cjs +1 -1
  57. package/dist/index26.js +1 -1
  58. package/dist/index27.cjs +1 -1
  59. package/dist/index27.js +1 -1
  60. package/dist/index28.cjs +1 -1
  61. package/dist/index28.js +1 -1
  62. package/dist/index29.cjs +1 -1
  63. package/dist/index29.js +1 -1
  64. package/dist/index30.cjs +1 -1
  65. package/dist/index30.js +1 -1
  66. package/dist/index31.cjs +1 -1
  67. package/dist/index31.js +1 -1
  68. package/dist/index32.cjs +143 -119
  69. package/dist/index32.js +144 -120
  70. package/dist/index33.cjs +100 -0
  71. package/dist/index33.js +100 -0
  72. package/dist/index34.cjs +117 -0
  73. package/dist/index34.js +117 -0
  74. package/dist/index35.cjs +167 -0
  75. package/dist/index35.js +167 -0
  76. package/dist/index36.cjs +125 -0
  77. package/dist/index36.js +125 -0
  78. package/dist/index7.cjs +1 -1
  79. package/dist/index7.js +1 -1
  80. package/dist/index8.cjs +1 -1
  81. package/dist/index8.js +1 -1
  82. package/dist/index9.cjs +1 -1
  83. package/dist/index9.js +1 -1
  84. package/dist/premium-react-loaders.css +215 -0
  85. package/dist/types/button.d.ts +31 -0
  86. package/dist/types/button.d.ts.map +1 -0
  87. package/dist/types/hooks.d.ts +95 -0
  88. package/dist/types/hooks.d.ts.map +1 -0
  89. package/dist/types/index.d.ts +4 -0
  90. package/dist/types/index.d.ts.map +1 -1
  91. package/dist/types/status.d.ts +34 -0
  92. package/dist/types/status.d.ts.map +1 -0
  93. package/dist/types/transition.d.ts +34 -0
  94. package/dist/types/transition.d.ts.map +1 -0
  95. 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 **25 premium, production-ready loading components** for React applications. Built with TypeScript and custom CSS for maximum flexibility and zero configuration.
3
+ A comprehensive collection of **28 premium, production-ready loading components** for React applications. Built with TypeScript and custom CSS for maximum flexibility and zero configuration.
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/premium-react-loaders.svg)](https://www.npmjs.com/package/premium-react-loaders)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
@@ -11,11 +11,11 @@ A comprehensive collection of **25 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 25 components in action with interactive examples and customization options.
14
+ See all 28 components in action with interactive examples and customization options.
15
15
 
16
16
  ## Features
17
17
 
18
- - **25 Premium Components** across 5 categories (Skeleton, Spinner, Progress, Pulse, Overlay)
18
+ - **28 Premium Components** across 7 categories (Skeleton, Spinner, Progress, Pulse, Overlay, Button, Status)
19
19
  - **Global Theming** - ThemeProvider for app-wide customization ✨ *New in v2.1.0*
20
20
  - **Smart Loading UX** - useLoader hook with delay, minDuration, and autoHide ✨ *New in v2.1.0*
21
21
  - **Enhanced CSS Variables** - Comprehensive theming with dark mode support ✨ *New in v2.1.0*
@@ -165,6 +165,19 @@ Wrapper component for displaying loaders over content:
165
165
 
166
166
  - **LoaderOverlay** - Displays any loader over content with backdrop (full-screen or container-relative)
167
167
 
168
+ ### Button Components (1 component) ✨ *New in v2.2.0*
169
+
170
+ Specialized loaders for button loading states:
171
+
172
+ - **ButtonSpinner** - Compact spinner optimized for buttons with multiple variants (circle, dots, bars) and positioning options
173
+
174
+ ### Status Components (2 components) ✨ *New in v2.2.0*
175
+
176
+ Animated indicators for success and error states:
177
+
178
+ - **SuccessCheckmark** - Animated checkmark with optional circle background
179
+ - **ErrorIndicator** - Animated X mark with optional shake effect and circle background
180
+
168
181
  ## Usage Examples
169
182
 
170
183
  ### Skeleton Components
@@ -337,6 +350,132 @@ import { SpinnerCircle, ProgressBar, PulseDots } from 'premium-react-loaders';
337
350
  <PulseDots size="md" reverse />
338
351
  ```
339
352
 
353
+ ### New in v2.3.0
354
+
355
+ **LoaderTransition** - Smooth transitions between loading and loaded states:
356
+
357
+ ```tsx
358
+ import { LoaderTransition, Skeleton } from 'premium-react-loaders';
359
+
360
+ // Eliminate jarring content switches
361
+ <LoaderTransition
362
+ loading={isLoading}
363
+ loadingContent={<Skeleton width={300} height={100} />}
364
+ transitionType="fade"
365
+ duration={300}
366
+ delay={200}
367
+ minDuration={600}
368
+ >
369
+ <YourActualContent />
370
+ </LoaderTransition>
371
+
372
+ // Different transition types
373
+ <LoaderTransition loading={isLoading} loadingContent={<Spinner />} transitionType="slide-up">
374
+ <Content />
375
+ </LoaderTransition>
376
+
377
+ <LoaderTransition loading={isLoading} loadingContent={<Skeleton />} transitionType="scale" timing="spring">
378
+ <Content />
379
+ </LoaderTransition>
380
+ ```
381
+
382
+ **useEnhancedLoader** - Supercharged loading state management:
383
+
384
+ ```tsx
385
+ import { useEnhancedLoader } from 'premium-react-loaders';
386
+
387
+ function MyComponent() {
388
+ const {
389
+ status, // 'idle' | 'loading' | 'success' | 'error'
390
+ error, // Error object if failed
391
+ retryAttempt, // Current retry attempt number
392
+ history, // Loading history with timestamps
393
+ startLoading,
394
+ stopLoading,
395
+ setError,
396
+ retry,
397
+ reset,
398
+ } = useEnhancedLoader({
399
+ delay: 200,
400
+ minDuration: 600,
401
+ retry: {
402
+ maxRetries: 3,
403
+ initialDelay: 1000,
404
+ backoffMultiplier: 2,
405
+ },
406
+ debounce: 300, // Debounce loading starts
407
+ onSuccess: () => console.log('Success!'),
408
+ onError: (err) => console.error(err),
409
+ });
410
+
411
+ const fetchData = async () => {
412
+ startLoading();
413
+ try {
414
+ const data = await api.fetch();
415
+ stopLoading();
416
+ } catch (err) {
417
+ setError(err);
418
+ }
419
+ };
420
+
421
+ return (
422
+ <div>
423
+ {status === 'loading' && <SpinnerCircle visible={isVisible} />}
424
+ {status === 'success' && <SuccessCheckmark visible />}
425
+ {status === 'error' && (
426
+ <>
427
+ <ErrorIndicator visible />
428
+ <button onClick={retry}>Retry ({retryAttempt}/3)</button>
429
+ </>
430
+ )}
431
+ </div>
432
+ );
433
+ }
434
+ ```
435
+
436
+ ### New in v2.2.0
437
+
438
+ **Button Loaders** - Specialized spinners for button states:
439
+
440
+ ```tsx
441
+ import { ButtonSpinner } from 'premium-react-loaders';
442
+
443
+ // Inside a button
444
+ <button style={{ padding: '10px 20px', backgroundColor: '#3b82f6', color: 'white' }}>
445
+ <ButtonSpinner variant="circle" size={16} color="white">
446
+ Submit Form
447
+ </ButtonSpinner>
448
+ </button>
449
+
450
+ // Different variants
451
+ <ButtonSpinner variant="dots" position="right">Next</ButtonSpinner>
452
+ <ButtonSpinner variant="bars" showContent={false}>Loading</ButtonSpinner>
453
+ ```
454
+
455
+ **Status Indicators** - Show success and error states with smooth animations:
456
+
457
+ ```tsx
458
+ import { SuccessCheckmark, ErrorIndicator } from 'premium-react-loaders';
459
+
460
+ // Success state
461
+ <SuccessCheckmark
462
+ visible={isSuccess}
463
+ showCircle
464
+ fillCircle
465
+ size={64}
466
+ color="#10b981"
467
+ />
468
+
469
+ // Error state with shake
470
+ <ErrorIndicator
471
+ visible={hasError}
472
+ showCircle
473
+ shake
474
+ size={64}
475
+ color="#ef4444"
476
+ />
477
+ ```
478
+
340
479
  ### New in v2.1.0
341
480
 
342
481
  **Global Theming** - Customize all loaders from one place:
@@ -0,0 +1,25 @@
1
+ import { ButtonSpinnerProps } from '../../types';
2
+ /**
3
+ * ButtonSpinner - Spinner designed for button loading states
4
+ *
5
+ * A compact spinner component optimized for use inside buttons, with options for
6
+ * positioning relative to button content and different visual variants.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * // Simple button with spinner
11
+ * <ButtonSpinner visible={isLoading}>Submit</ButtonSpinner>
12
+ *
13
+ * // Spinner on the left
14
+ * <ButtonSpinner visible={isLoading} position="left" variant="dots">
15
+ * Loading...
16
+ * </ButtonSpinner>
17
+ *
18
+ * // Hide content when loading
19
+ * <ButtonSpinner visible={isLoading} showContent={false}>
20
+ * Click Me
21
+ * </ButtonSpinner>
22
+ * ```
23
+ */
24
+ export declare const ButtonSpinner: import('react').ForwardRefExoticComponent<ButtonSpinnerProps & import('react').RefAttributes<HTMLDivElement>>;
25
+ //# sourceMappingURL=ButtonSpinner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonSpinner.d.ts","sourceRoot":"","sources":["../../../src/components/button/ButtonSpinner.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AASjD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,aAAa,+GA8IzB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { ButtonSpinner } from './ButtonSpinner';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
@@ -3,4 +3,7 @@ export * from './spinner';
3
3
  export * from './progress';
4
4
  export * from './pulse';
5
5
  export * from './overlay';
6
+ export * from './button';
7
+ export * from './status';
8
+ export * from './transition';
6
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,cAAc,YAAY,CAAC;AAG3B,cAAc,WAAW,CAAC;AAG1B,cAAc,YAAY,CAAC;AAG3B,cAAc,SAAS,CAAC;AAGxB,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,cAAc,YAAY,CAAC;AAG3B,cAAc,WAAW,CAAC;AAG1B,cAAc,YAAY,CAAC;AAG3B,cAAc,SAAS,CAAC;AAGxB,cAAc,WAAW,CAAC;AAG1B,cAAc,UAAU,CAAC;AAGzB,cAAc,UAAU,CAAC;AAGzB,cAAc,cAAc,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { ErrorIndicatorProps } from '../../types';
2
+ /**
3
+ * ErrorIndicator - Animated error indicator with X mark
4
+ *
5
+ * Displays an animated X mark that draws itself, perfect for showing
6
+ * failed operations, validation errors, or error states.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * // Simple error indicator
11
+ * <ErrorIndicator visible={hasError} />
12
+ *
13
+ * // With circle background and shake animation
14
+ * <ErrorIndicator
15
+ * visible={hasError}
16
+ * showCircle
17
+ * circleColor="#ef4444"
18
+ * fillCircle
19
+ * shake
20
+ * />
21
+ *
22
+ * // Custom size and color
23
+ * <ErrorIndicator
24
+ * visible={hasError}
25
+ * size={64}
26
+ * color="#dc2626"
27
+ * duration={600}
28
+ * />
29
+ * ```
30
+ */
31
+ export declare const ErrorIndicator: import('react').ForwardRefExoticComponent<ErrorIndicatorProps & import('react').RefAttributes<HTMLDivElement>>;
32
+ //# sourceMappingURL=ErrorIndicator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorIndicator.d.ts","sourceRoot":"","sources":["../../../src/components/status/ErrorIndicator.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGlD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,cAAc,gHAkG1B,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { SuccessCheckmarkProps } from '../../types';
2
+ /**
3
+ * SuccessCheckmark - Animated checkmark for successful operations
4
+ *
5
+ * Displays an animated checkmark that draws itself, perfect for showing
6
+ * successful completion of actions like form submissions, file uploads, etc.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * // Simple checkmark
11
+ * <SuccessCheckmark visible={isSuccess} />
12
+ *
13
+ * // With circle background
14
+ * <SuccessCheckmark
15
+ * visible={isSuccess}
16
+ * showCircle
17
+ * circleColor="#10b981"
18
+ * fillCircle
19
+ * />
20
+ *
21
+ * // Custom size and color
22
+ * <SuccessCheckmark
23
+ * visible={isSuccess}
24
+ * size={64}
25
+ * color="#22c55e"
26
+ * duration={600}
27
+ * />
28
+ * ```
29
+ */
30
+ export declare const SuccessCheckmark: import('react').ForwardRefExoticComponent<SuccessCheckmarkProps & import('react').RefAttributes<HTMLDivElement>>;
31
+ //# sourceMappingURL=SuccessCheckmark.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SuccessCheckmark.d.ts","sourceRoot":"","sources":["../../../src/components/status/SuccessCheckmark.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAGpD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,gBAAgB,kHAwF5B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { SuccessCheckmark } from './SuccessCheckmark';
2
+ export { ErrorIndicator } from './ErrorIndicator';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/status/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { LoaderTransitionProps } from '../../types';
2
+ /**
3
+ * LoaderTransition - Smooth transitions between loading and loaded states
4
+ *
5
+ * Provides seamless transitions between loading content (skeleton, spinner) and actual content,
6
+ * preventing jarring content switches and improving perceived performance.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * // Fade transition from skeleton to content
11
+ * <LoaderTransition
12
+ * loading={isLoading}
13
+ * loadingContent={<Skeleton width="100%" height={200} />}
14
+ * transitionType="fade"
15
+ * duration={300}
16
+ * >
17
+ * <YourActualContent />
18
+ * </LoaderTransition>
19
+ *
20
+ * // Slide up transition
21
+ * <LoaderTransition
22
+ * loading={isLoading}
23
+ * loadingContent={<SpinnerCircle size={48} />}
24
+ * transitionType="slide-up"
25
+ * timing="spring"
26
+ * >
27
+ * <YourContent />
28
+ * </LoaderTransition>
29
+ * ```
30
+ */
31
+ export declare const LoaderTransition: import('react').ForwardRefExoticComponent<LoaderTransitionProps & import('react').RefAttributes<HTMLDivElement>>;
32
+ //# sourceMappingURL=LoaderTransition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LoaderTransition.d.ts","sourceRoot":"","sources":["../../../src/components/transition/LoaderTransition.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAGpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,gBAAgB,kHAsL5B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { LoaderTransition } from './LoaderTransition';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/transition/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -1,3 +1,5 @@
1
1
  export { useLoader } from './useLoader';
2
- export type { UseLoaderOptions, UseLoaderReturn } from './useLoader';
2
+ export { useEnhancedLoader } from './useEnhancedLoader';
3
+ export type { UseLoaderOptions as BasicUseLoaderOptions, UseLoaderReturn as BasicUseLoaderReturn } from './useLoader';
4
+ export type { UseLoaderOptions, UseLoaderReturn, LoadingStatus, LoadingHistoryEntry, RetryConfig } from '../types/hooks';
3
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,YAAY,EAAE,gBAAgB,IAAI,qBAAqB,EAAE,eAAe,IAAI,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACtH,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,62 @@
1
+ import { UseLoaderOptions, UseLoaderReturn } from '../types/hooks';
2
+ /**
3
+ * useEnhancedLoader - Advanced loading state management with retry, success/error states, and history
4
+ *
5
+ * An enhanced version of useLoader with additional features:
6
+ * - Retry logic with exponential backoff
7
+ * - Success and error state management
8
+ * - Loading history tracking
9
+ * - Debounce and throttle support
10
+ * - Lifecycle callbacks
11
+ *
12
+ * @param options - Configuration options
13
+ * @returns Enhanced loading state and control functions
14
+ *
15
+ * @example
16
+ * ```tsx
17
+ * function MyComponent() {
18
+ * const {
19
+ * loading,
20
+ * status,
21
+ * error,
22
+ * startLoading,
23
+ * stopLoading,
24
+ * setError,
25
+ * retry,
26
+ * history
27
+ * } = useEnhancedLoader({
28
+ * delay: 200,
29
+ * minDuration: 600,
30
+ * retry: {
31
+ * maxRetries: 3,
32
+ * initialDelay: 1000,
33
+ * backoffMultiplier: 2,
34
+ * },
35
+ * successDuration: 2000,
36
+ * onSuccess: () => console.log('Success!'),
37
+ * onError: (err) => console.error('Error:', err),
38
+ * });
39
+ *
40
+ * const fetchData = async () => {
41
+ * startLoading();
42
+ * try {
43
+ * await api.fetchData();
44
+ * stopLoading();
45
+ * } catch (err) {
46
+ * setError(err as Error);
47
+ * }
48
+ * };
49
+ *
50
+ * return (
51
+ * <div>
52
+ * {status === 'loading' && <SpinnerCircle visible={true} />}
53
+ * {status === 'success' && <SuccessCheckmark visible={true} />}
54
+ * {status === 'error' && <ErrorIndicator visible={true} />}
55
+ * {error && <button onClick={retry}>Retry</button>}
56
+ * </div>
57
+ * );
58
+ * }
59
+ * ```
60
+ */
61
+ export declare function useEnhancedLoader(options?: UseLoaderOptions): UseLoaderReturn;
62
+ //# sourceMappingURL=useEnhancedLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useEnhancedLoader.d.ts","sourceRoot":"","sources":["../../src/hooks/useEnhancedLoader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAsC,MAAM,gBAAgB,CAAC;AAE5G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,gBAAqB,GAAG,eAAe,CAkUjF"}
package/dist/index.cjs CHANGED
@@ -30,6 +30,10 @@ const PulseWave = require("./index28.cjs");
30
30
  const PulseBars = require("./index29.cjs");
31
31
  const TypingIndicator = require("./index30.cjs");
32
32
  const LoaderOverlay = require("./index31.cjs");
33
+ const ButtonSpinner = require("./index32.cjs");
34
+ const SuccessCheckmark = require("./index33.cjs");
35
+ const ErrorIndicator = require("./index34.cjs");
36
+ const LoaderTransition = require("./index35.cjs");
33
37
  const version = "2.1.0";
34
38
  exports.cn = classNames.cn;
35
39
  exports.getAnimationDuration = colors.getAnimationDuration;
@@ -62,4 +66,8 @@ exports.PulseWave = PulseWave.PulseWave;
62
66
  exports.PulseBars = PulseBars.PulseBars;
63
67
  exports.TypingIndicator = TypingIndicator.TypingIndicator;
64
68
  exports.LoaderOverlay = LoaderOverlay.LoaderOverlay;
69
+ exports.ButtonSpinner = ButtonSpinner.ButtonSpinner;
70
+ exports.SuccessCheckmark = SuccessCheckmark.SuccessCheckmark;
71
+ exports.ErrorIndicator = ErrorIndicator.ErrorIndicator;
72
+ exports.LoaderTransition = LoaderTransition.LoaderTransition;
65
73
  exports.version = version;
package/dist/index.js CHANGED
@@ -28,9 +28,16 @@ import { PulseWave } from "./index28.js";
28
28
  import { PulseBars } from "./index29.js";
29
29
  import { TypingIndicator } from "./index30.js";
30
30
  import { LoaderOverlay } from "./index31.js";
31
+ import { ButtonSpinner } from "./index32.js";
32
+ import { SuccessCheckmark } from "./index33.js";
33
+ import { ErrorIndicator } from "./index34.js";
34
+ import { LoaderTransition } from "./index35.js";
31
35
  const version = "2.1.0";
32
36
  export {
37
+ ButtonSpinner,
38
+ ErrorIndicator,
33
39
  LoaderOverlay,
40
+ LoaderTransition,
34
41
  ProgressBar,
35
42
  ProgressCircle,
36
43
  ProgressRing,
@@ -54,6 +61,7 @@ export {
54
61
  SpinnerPulse,
55
62
  SpinnerRing,
56
63
  SpinnerWave,
64
+ SuccessCheckmark,
57
65
  ThemeProvider,
58
66
  TypingIndicator,
59
67
  cn,
package/dist/index10.cjs CHANGED
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const react = require("react");
5
5
  const Skeleton = require("./index7.cjs");
6
- const hooks = require("./index32.cjs");
6
+ const hooks = require("./index36.cjs");
7
7
  const SkeletonImage = react.forwardRef(
8
8
  ({
9
9
  width = "100%",
package/dist/index10.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import { Skeleton } from "./index7.js";
4
- import { useLoaderVisibility } from "./index32.js";
4
+ import { useLoaderVisibility } from "./index36.js";
5
5
  const SkeletonImage = forwardRef(
6
6
  ({
7
7
  width = "100%",
package/dist/index11.cjs CHANGED
@@ -4,7 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const react = require("react");
5
5
  const Skeleton = require("./index7.cjs");
6
6
  const SkeletonAvatar = require("./index9.cjs");
7
- const hooks = require("./index32.cjs");
7
+ const hooks = require("./index36.cjs");
8
8
  const classNames = require("./index3.cjs");
9
9
  const SkeletonCard = react.forwardRef(
10
10
  ({
package/dist/index11.js CHANGED
@@ -2,7 +2,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import { Skeleton } from "./index7.js";
4
4
  import { SkeletonAvatar } from "./index9.js";
5
- import { useLoaderVisibility } from "./index32.js";
5
+ import { useLoaderVisibility } from "./index36.js";
6
6
  import { cn } from "./index3.js";
7
7
  const SkeletonCard = forwardRef(
8
8
  ({
package/dist/index12.cjs CHANGED
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const react = require("react");
5
5
  const Skeleton = require("./index7.cjs");
6
- const hooks = require("./index32.cjs");
6
+ const hooks = require("./index36.cjs");
7
7
  const colors = require("./index4.cjs");
8
8
  const classNames = require("./index3.cjs");
9
9
  const SkeletonList = react.forwardRef(
package/dist/index12.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import { Skeleton } from "./index7.js";
4
- import { useLoaderVisibility } from "./index32.js";
4
+ import { useLoaderVisibility } from "./index36.js";
5
5
  import { normalizeSize } from "./index4.js";
6
6
  import { cn } from "./index3.js";
7
7
  const SkeletonList = forwardRef(
package/dist/index13.cjs CHANGED
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const react = require("react");
5
5
  const Skeleton = require("./index7.cjs");
6
- const hooks = require("./index32.cjs");
6
+ const hooks = require("./index36.cjs");
7
7
  const classNames = require("./index3.cjs");
8
8
  const SkeletonTable = react.forwardRef(
9
9
  ({
package/dist/index13.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import { Skeleton } from "./index7.js";
4
- import { useLoaderVisibility } from "./index32.js";
4
+ import { useLoaderVisibility } from "./index36.js";
5
5
  import { cn } from "./index3.js";
6
6
  const SkeletonTable = forwardRef(
7
7
  ({
package/dist/index14.cjs CHANGED
@@ -5,7 +5,7 @@ const react = require("react");
5
5
  const Skeleton = require("./index7.cjs");
6
6
  const SkeletonText = require("./index8.cjs");
7
7
  const SkeletonAvatar = require("./index9.cjs");
8
- const hooks = require("./index32.cjs");
8
+ const hooks = require("./index36.cjs");
9
9
  const classNames = require("./index3.cjs");
10
10
  const SkeletonPage = react.forwardRef(
11
11
  ({
package/dist/index14.js CHANGED
@@ -3,7 +3,7 @@ import { forwardRef } from "react";
3
3
  import { Skeleton } from "./index7.js";
4
4
  import { SkeletonText } from "./index8.js";
5
5
  import { SkeletonAvatar } from "./index9.js";
6
- import { useLoaderVisibility } from "./index32.js";
6
+ import { useLoaderVisibility } from "./index36.js";
7
7
  import { cn } from "./index3.js";
8
8
  const SkeletonPage = forwardRef(
9
9
  ({
package/dist/index15.cjs CHANGED
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const react = require("react");
5
5
  const Skeleton = require("./index7.cjs");
6
- const hooks = require("./index32.cjs");
6
+ const hooks = require("./index36.cjs");
7
7
  const colors = require("./index4.cjs");
8
8
  const classNames = require("./index3.cjs");
9
9
  const SkeletonForm = react.forwardRef(
package/dist/index15.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import { Skeleton } from "./index7.js";
4
- import { useLoaderVisibility } from "./index32.js";
4
+ import { useLoaderVisibility } from "./index36.js";
5
5
  import { normalizeSize } from "./index4.js";
6
6
  import { cn } from "./index3.js";
7
7
  const SkeletonForm = forwardRef(
package/dist/index16.cjs CHANGED
@@ -2,7 +2,7 @@
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("./index32.cjs");
5
+ const hooks = require("./index36.cjs");
6
6
  const classNames = require("./index3.cjs");
7
7
  const colors = require("./index4.cjs");
8
8
  const SpinnerCircle = react.forwardRef(
package/dist/index16.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index32.js";
3
+ import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index36.js";
4
4
  import { cn } from "./index3.js";
5
5
  import { normalizeSize } from "./index4.js";
6
6
  const SpinnerCircle = forwardRef(
package/dist/index17.cjs CHANGED
@@ -2,7 +2,7 @@
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("./index32.cjs");
5
+ const hooks = require("./index36.cjs");
6
6
  const classNames = require("./index3.cjs");
7
7
  const colors = require("./index4.cjs");
8
8
  const SpinnerRing = react.forwardRef(
package/dist/index17.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index32.js";
3
+ import { useReducedMotion, useLoaderVisibility, getEffectiveDuration } from "./index36.js";
4
4
  import { cn } from "./index3.js";
5
5
  import { normalizeSize } from "./index4.js";
6
6
  const SpinnerRing = forwardRef(
package/dist/index18.cjs CHANGED
@@ -3,7 +3,7 @@ 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("./index32.cjs");
6
+ const hooks = require("./index36.cjs");
7
7
  const classNames = require("./index3.cjs");
8
8
  const SpinnerDots = react.forwardRef(
9
9
  ({