premium-react-loaders 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/README.md +59 -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 +2 -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/index.cjs +6 -0
  15. package/dist/index.js +6 -0
  16. package/dist/index10.cjs +1 -1
  17. package/dist/index10.js +1 -1
  18. package/dist/index11.cjs +1 -1
  19. package/dist/index11.js +1 -1
  20. package/dist/index12.cjs +1 -1
  21. package/dist/index12.js +1 -1
  22. package/dist/index13.cjs +1 -1
  23. package/dist/index13.js +1 -1
  24. package/dist/index14.cjs +1 -1
  25. package/dist/index14.js +1 -1
  26. package/dist/index15.cjs +1 -1
  27. package/dist/index15.js +1 -1
  28. package/dist/index16.cjs +1 -1
  29. package/dist/index16.js +1 -1
  30. package/dist/index17.cjs +1 -1
  31. package/dist/index17.js +1 -1
  32. package/dist/index18.cjs +1 -1
  33. package/dist/index18.js +1 -1
  34. package/dist/index19.cjs +1 -1
  35. package/dist/index19.js +1 -1
  36. package/dist/index20.cjs +1 -1
  37. package/dist/index20.js +1 -1
  38. package/dist/index21.cjs +1 -1
  39. package/dist/index21.js +1 -1
  40. package/dist/index22.cjs +1 -1
  41. package/dist/index22.js +1 -1
  42. package/dist/index23.cjs +1 -1
  43. package/dist/index23.js +1 -1
  44. package/dist/index24.cjs +1 -1
  45. package/dist/index24.js +1 -1
  46. package/dist/index25.cjs +1 -1
  47. package/dist/index25.js +1 -1
  48. package/dist/index26.cjs +1 -1
  49. package/dist/index26.js +1 -1
  50. package/dist/index27.cjs +1 -1
  51. package/dist/index27.js +1 -1
  52. package/dist/index28.cjs +1 -1
  53. package/dist/index28.js +1 -1
  54. package/dist/index29.cjs +1 -1
  55. package/dist/index29.js +1 -1
  56. package/dist/index30.cjs +1 -1
  57. package/dist/index30.js +1 -1
  58. package/dist/index31.cjs +1 -1
  59. package/dist/index31.js +1 -1
  60. package/dist/index32.cjs +143 -119
  61. package/dist/index32.js +144 -120
  62. package/dist/index33.cjs +100 -0
  63. package/dist/index33.js +100 -0
  64. package/dist/index34.cjs +117 -0
  65. package/dist/index34.js +117 -0
  66. package/dist/index35.cjs +125 -0
  67. package/dist/index35.js +125 -0
  68. package/dist/index7.cjs +1 -1
  69. package/dist/index7.js +1 -1
  70. package/dist/index8.cjs +1 -1
  71. package/dist/index8.js +1 -1
  72. package/dist/index9.cjs +1 -1
  73. package/dist/index9.js +1 -1
  74. package/dist/premium-react-loaders.css +140 -0
  75. package/dist/types/button.d.ts +31 -0
  76. package/dist/types/button.d.ts.map +1 -0
  77. package/dist/types/index.d.ts +2 -0
  78. package/dist/types/index.d.ts.map +1 -1
  79. package/dist/types/status.d.ts +34 -0
  80. package/dist/types/status.d.ts.map +1 -0
  81. package/package.json +1 -1
package/dist/index8.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("./index35.cjs");
7
7
  const colors = require("./index4.cjs");
8
8
  const classNames = require("./index3.cjs");
9
9
  const SkeletonText = react.forwardRef(
package/dist/index8.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 "./index35.js";
5
5
  import { normalizeSize } from "./index4.js";
6
6
  import { cn } from "./index3.js";
7
7
  const SkeletonText = forwardRef(
package/dist/index9.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("./index35.cjs");
7
7
  const colors = require("./index4.cjs");
8
8
  const SkeletonAvatar = react.forwardRef(
9
9
  ({
package/dist/index9.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 "./index35.js";
5
5
  import { normalizeSize } from "./index4.js";
6
6
  const SkeletonAvatar = forwardRef(
7
7
  ({
@@ -325,6 +325,114 @@
325
325
  opacity: 1;
326
326
  }
327
327
  }
328
+ /* Button loader animations */
329
+ @keyframes button-dot-pulse {
330
+ 0%,
331
+ 80%,
332
+ 100% {
333
+ transform: scale(0.8);
334
+ opacity: 0.5;
335
+ }
336
+ 40% {
337
+ transform: scale(1);
338
+ opacity: 1;
339
+ }
340
+ }
341
+ @keyframes button-bar-pulse {
342
+ 0%,
343
+ 40%,
344
+ 100% {
345
+ transform: scaleY(0.4);
346
+ opacity: 0.6;
347
+ }
348
+ 20% {
349
+ transform: scaleY(1);
350
+ opacity: 1;
351
+ }
352
+ }
353
+ /* Success checkmark animations */
354
+ @keyframes success-scale {
355
+ 0% {
356
+ transform: scale(0);
357
+ }
358
+ 50% {
359
+ transform: scale(1.1);
360
+ }
361
+ 100% {
362
+ transform: scale(1);
363
+ }
364
+ }
365
+ @keyframes success-circle {
366
+ 0% {
367
+ stroke-dasharray: 0, 150;
368
+ stroke-dashoffset: 0;
369
+ }
370
+ 100% {
371
+ stroke-dasharray: 150, 150;
372
+ stroke-dashoffset: 0;
373
+ }
374
+ }
375
+ @keyframes success-check {
376
+ 0% {
377
+ stroke-dasharray: 0, 50;
378
+ stroke-dashoffset: 0;
379
+ }
380
+ 100% {
381
+ stroke-dasharray: 50, 50;
382
+ stroke-dashoffset: 0;
383
+ }
384
+ }
385
+ /* Error indicator animations */
386
+ @keyframes error-shake {
387
+ 0%,
388
+ 100% {
389
+ transform: translateX(0) scale(1);
390
+ }
391
+ 10%,
392
+ 30%,
393
+ 50%,
394
+ 70%,
395
+ 90% {
396
+ transform: translateX(-4px) scale(1);
397
+ }
398
+ 20%,
399
+ 40%,
400
+ 60%,
401
+ 80% {
402
+ transform: translateX(4px) scale(1);
403
+ }
404
+ }
405
+ @keyframes error-scale {
406
+ 0% {
407
+ transform: scale(0);
408
+ }
409
+ 50% {
410
+ transform: scale(1.1);
411
+ }
412
+ 100% {
413
+ transform: scale(1);
414
+ }
415
+ }
416
+ @keyframes error-circle {
417
+ 0% {
418
+ stroke-dasharray: 0, 150;
419
+ stroke-dashoffset: 0;
420
+ }
421
+ 100% {
422
+ stroke-dasharray: 150, 150;
423
+ stroke-dashoffset: 0;
424
+ }
425
+ }
426
+ @keyframes error-x {
427
+ 0% {
428
+ stroke-dasharray: 0, 50;
429
+ stroke-dashoffset: 0;
430
+ }
431
+ 100% {
432
+ stroke-dasharray: 50, 50;
433
+ stroke-dashoffset: 0;
434
+ }
435
+ }
328
436
  /* Animation utility classes */
329
437
  .animate-skeleton {
330
438
  animation: skeleton-shimmer var(--animation-duration-normal, 1.5s) infinite;
@@ -332,6 +440,9 @@
332
440
  .animate-spinner {
333
441
  animation: spinner-rotate var(--animation-duration-normal, 1s) linear infinite;
334
442
  }
443
+ .animate-spinner-rotate {
444
+ animation: spinner-rotate var(--animation-duration-normal, 1s) linear infinite;
445
+ }
335
446
  .animate-pulse-scale {
336
447
  animation: pulse-scale var(--animation-duration-normal, 1.5s) ease-in-out infinite;
337
448
  }
@@ -341,6 +452,35 @@
341
452
  .animate-progress {
342
453
  animation: progress-indeterminate var(--animation-duration-normal, 1.5s) ease-in-out infinite;
343
454
  }
455
+ /* Button loader animations */
456
+ .animate-button-dot-pulse {
457
+ animation: button-dot-pulse var(--animation-duration-normal, 1.2s) ease-in-out infinite;
458
+ }
459
+ .animate-button-bar-pulse {
460
+ animation: button-bar-pulse var(--animation-duration-normal, 1s) ease-in-out infinite;
461
+ }
462
+ /* Success/Error animations */
463
+ .animate-success-scale {
464
+ animation: success-scale var(--animation-duration-normal, 500ms) ease-out forwards;
465
+ }
466
+ .animate-success-circle {
467
+ animation: success-circle var(--animation-duration-normal, 500ms) ease-out forwards;
468
+ }
469
+ .animate-success-check {
470
+ animation: success-check var(--animation-duration-normal, 500ms) ease-out forwards;
471
+ }
472
+ .animate-error-shake {
473
+ animation: error-shake var(--animation-duration-normal, 500ms) ease-out forwards;
474
+ }
475
+ .animate-error-scale {
476
+ animation: error-scale var(--animation-duration-normal, 500ms) ease-out forwards;
477
+ }
478
+ .animate-error-circle {
479
+ animation: error-circle var(--animation-duration-normal, 500ms) ease-out forwards;
480
+ }
481
+ .animate-error-x {
482
+ animation: error-x var(--animation-duration-normal, 500ms) ease-out forwards;
483
+ }
344
484
  /* Speed variants */
345
485
  .animate-slow {
346
486
  animation-duration: var(--animation-duration-slow, 2s);
@@ -0,0 +1,31 @@
1
+ import { BaseLoaderProps } from './common';
2
+ /**
3
+ * Position of the spinner relative to button content
4
+ */
5
+ export type SpinnerPosition = 'left' | 'right' | 'center';
6
+ /**
7
+ * Variant of the button spinner
8
+ */
9
+ export type ButtonSpinnerVariant = 'circle' | 'dots' | 'bars';
10
+ /**
11
+ * ButtonSpinner component props
12
+ */
13
+ export interface ButtonSpinnerProps extends BaseLoaderProps {
14
+ /** Position of spinner relative to content (left, right, center) */
15
+ position?: SpinnerPosition;
16
+ /** Visual variant of the spinner */
17
+ variant?: ButtonSpinnerVariant;
18
+ /** Thickness of the spinner (for circle variant) */
19
+ thickness?: number;
20
+ /** Number of dots (for dots variant) */
21
+ dotCount?: number;
22
+ /** Number of bars (for bars variant) */
23
+ barCount?: number;
24
+ /** Content to display alongside the spinner (usually button text) */
25
+ children?: React.ReactNode;
26
+ /** Whether to show content when loading (if false, only spinner shows) */
27
+ showContent?: boolean;
28
+ /** Gap between spinner and content */
29
+ gap?: number | string;
30
+ }
31
+ //# sourceMappingURL=button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/types/button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,eAAe;IACzD,oEAAoE;IACpE,QAAQ,CAAC,EAAE,eAAe,CAAC;IAE3B,oCAAoC;IACpC,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAE/B,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,0EAA0E;IAC1E,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,sCAAsC;IACtC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB"}
@@ -4,4 +4,6 @@ export * from './spinner';
4
4
  export * from './progress';
5
5
  export * from './pulse';
6
6
  export * from './overlay';
7
+ export * from './button';
8
+ export * from './status';
7
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC;AAGzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC;AAGzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { BaseLoaderProps } from './common';
2
+ /**
3
+ * SuccessCheckmark component props
4
+ */
5
+ export interface SuccessCheckmarkProps extends Omit<BaseLoaderProps, 'speed' | 'reverse' | 'respectMotionPreference'> {
6
+ /** Stroke width of the checkmark */
7
+ strokeWidth?: number;
8
+ /** Duration of the checkmark animation in milliseconds */
9
+ duration?: number;
10
+ /** Whether to show a circle background */
11
+ showCircle?: boolean;
12
+ /** Circle background color */
13
+ circleColor?: string;
14
+ /** Whether to fill the circle */
15
+ fillCircle?: boolean;
16
+ }
17
+ /**
18
+ * ErrorIndicator component props
19
+ */
20
+ export interface ErrorIndicatorProps extends Omit<BaseLoaderProps, 'speed' | 'reverse' | 'respectMotionPreference'> {
21
+ /** Stroke width of the X mark */
22
+ strokeWidth?: number;
23
+ /** Duration of the X mark animation in milliseconds */
24
+ duration?: number;
25
+ /** Whether to show a circle background */
26
+ showCircle?: boolean;
27
+ /** Circle background color */
28
+ circleColor?: string;
29
+ /** Whether to fill the circle */
30
+ fillCircle?: boolean;
31
+ /** Whether to shake/bounce on appearance */
32
+ shake?: boolean;
33
+ }
34
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/types/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,SAAS,GAAG,yBAAyB,CAAC;IACnH,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,0CAA0C;IAC1C,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,8BAA8B;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,iCAAiC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,SAAS,GAAG,yBAAyB,CAAC;IACjH,iCAAiC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,0CAA0C;IAC1C,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,8BAA8B;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,iCAAiC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "premium-react-loaders",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Premium, production-ready loading components for React with TypeScript",
5
5
  "author": "Ishan Karunaratne",
6
6
  "license": "MIT",