react-loadly 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +529 -62
  2. package/dist/index.cjs.js +1 -1701
  3. package/dist/index.cjs.js.map +1 -1
  4. package/dist/index.d.ts +146 -55
  5. package/dist/index.esm.js +1 -1662
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/styles.css +1 -1
  8. package/dist/styles.css.map +1 -1
  9. package/dist/styles.js +1 -0
  10. package/dist/types/@types/index.d.ts +3 -1
  11. package/dist/types/@types/index.d.ts.map +1 -1
  12. package/dist/types/@types/interfaces/IBaseLoaderProps.d.ts +4 -0
  13. package/dist/types/@types/interfaces/IBaseLoaderProps.d.ts.map +1 -1
  14. package/dist/types/@types/interfaces/IShimmerLoaderProps.d.ts +20 -0
  15. package/dist/types/@types/interfaces/IShimmerLoaderProps.d.ts.map +1 -0
  16. package/dist/types/@types/interfaces/ISkeletonLoaderProps.d.ts +24 -0
  17. package/dist/types/@types/interfaces/ISkeletonLoaderProps.d.ts.map +1 -0
  18. package/dist/types/@types/interfaces/index.d.ts +14 -0
  19. package/dist/types/@types/interfaces/index.d.ts.map +1 -0
  20. package/dist/types/@types/types/index.d.ts +3 -3
  21. package/dist/types/@types/types/index.d.ts.map +1 -1
  22. package/dist/types/components/organisms/FallbackLoader.d.ts +1 -1
  23. package/dist/types/components/organisms/FallbackLoader.d.ts.map +1 -1
  24. package/dist/types/components/organisms/LogoSpinLoader.d.ts +1 -1
  25. package/dist/types/components/organisms/LogoSpinLoader.d.ts.map +1 -1
  26. package/dist/types/components/organisms/ShimmerLoader.d.ts +4 -0
  27. package/dist/types/components/organisms/ShimmerLoader.d.ts.map +1 -0
  28. package/dist/types/components/organisms/SkeletonLoader.d.ts +4 -0
  29. package/dist/types/components/organisms/SkeletonLoader.d.ts.map +1 -0
  30. package/dist/types/components/organisms/index.d.ts +3 -1
  31. package/dist/types/components/organisms/index.d.ts.map +1 -1
  32. package/dist/types/index.d.ts +2 -2
  33. package/dist/types/index.d.ts.map +1 -1
  34. package/dist/types/styles.d.ts +2 -0
  35. package/dist/types/styles.d.ts.map +1 -0
  36. package/dist/types/utils/animationUtils.d.ts +24 -1
  37. package/dist/types/utils/animationUtils.d.ts.map +1 -1
  38. package/dist/types/utils/index.d.ts +1 -1
  39. package/dist/types/utils/index.d.ts.map +1 -1
  40. package/package.json +41 -6
  41. package/dist/types/@types/interfaces/ILoaderTheme.d.ts +0 -20
  42. package/dist/types/@types/interfaces/ILoaderTheme.d.ts.map +0 -1
@@ -19,11 +19,34 @@ export declare function prefersReducedMotion(): boolean;
19
19
  /**
20
20
  * Get optimized animation settings based on user preferences
21
21
  * @param speed - The animation speed multiplier (default: 1)
22
+ * @param respectReducedMotion - Whether to respect reduced motion preference (default: true)
22
23
  * @returns Object with optimized animation settings
23
24
  */
24
- export declare function getOptimizedAnimationSettings(speed?: number): {
25
+ export declare function getOptimizedAnimationSettings(speed?: number, respectReducedMotion?: boolean): {
25
26
  duration: string;
26
27
  playState: string;
27
28
  iterationCount: string | number;
28
29
  };
30
+ /**
31
+ * Get animation direction CSS value
32
+ * @param direction - The animation direction
33
+ * @returns CSS direction value
34
+ */
35
+ export declare function getAnimationDirection(direction?: "normal" | "reverse" | "alternate" | "alternate-reverse"): string;
36
+ /**
37
+ * Get animation easing CSS value
38
+ * @param easing - The animation easing function
39
+ * @returns CSS easing value
40
+ */
41
+ export declare function getAnimationEasing(easing?: "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out" | "cubic-bezier"): string;
42
+ /**
43
+ * Create a complete animation string
44
+ * @param name - The animation name
45
+ * @param duration - The animation duration
46
+ * @param easing - The animation easing
47
+ * @param direction - The animation direction
48
+ * @param iterationCount - The iteration count
49
+ * @returns Complete animation string
50
+ */
51
+ export declare function createAnimationString(name: string, duration: string, easing?: string, direction?: string, iterationCount?: string | number): string;
29
52
  //# sourceMappingURL=animationUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"animationUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/animationUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,SAAI,GAAG,MAAM,CAGtE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAQ9C;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,SAAI;;;;EAiBtD"}
1
+ {"version":3,"file":"animationUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/animationUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,SAAI,GAAG,MAAM,CAGtE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAQ9C;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,SAAI,EAAE,oBAAoB,UAAO;;;;EAiBnF;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,GAAE,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,mBAA8B,GAAG,MAAM,CAE5H;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,GAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,aAAa,GAAG,cAAuB,GAAG,MAAM,CAEvI;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,MAAM,GAAE,MAAe,EACvB,SAAS,GAAE,MAAiB,EAC5B,cAAc,GAAE,MAAM,GAAG,MAAmB,GAC3C,MAAM,CAER"}
@@ -1,5 +1,5 @@
1
1
  export { generateCSSVariables, getSizeValue, mergeProps } from "./propUtils";
2
- export { createAnimationName, getAnimationDuration, getOptimizedAnimationSettings, prefersReducedMotion } from "./animationUtils";
2
+ export { createAnimationName, getAnimationDuration, getOptimizedAnimationSettings, prefersReducedMotion, getAnimationDirection, getAnimationEasing, createAnimationString, } from "./animationUtils";
3
3
  export { hexToRgb, rgba } from "./colorUtils";
4
4
  export { clamp } from "./mathUtils";
5
5
  export { generateId, sanitizeCSSValue } from "./domUtils";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG7E,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,6BAA6B,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAGlI,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAG9C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGpC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG7E,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,6BAA6B,EAC7B,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAG9C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGpC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "react-loadly",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
+ "type": "module",
4
5
  "description": "A professional React loaders package with high-performance, customizable loader components",
5
6
  "main": "dist/index.cjs.js",
6
7
  "module": "dist/index.esm.js",
@@ -14,17 +15,37 @@
14
15
  "require": "./dist/index.cjs.js",
15
16
  "types": "./dist/index.d.ts"
16
17
  },
17
- "./styles.css": "./dist/styles.css"
18
+ "./styles.css": "./dist/styles.css",
19
+ "./components": {
20
+ "import": "./dist/index.esm.js",
21
+ "require": "./dist/index.cjs.js",
22
+ "types": "./dist/index.d.ts"
23
+ },
24
+ "./hooks": {
25
+ "import": "./dist/index.esm.js",
26
+ "require": "./dist/index.cjs.js",
27
+ "types": "./dist/index.d.ts"
28
+ },
29
+ "./utils": {
30
+ "import": "./dist/index.esm.js",
31
+ "require": "./dist/index.cjs.js",
32
+ "types": "./dist/index.d.ts"
33
+ },
34
+ "./types": {
35
+ "import": "./dist/index.esm.js",
36
+ "require": "./dist/index.cjs.js",
37
+ "types": "./dist/index.d.ts"
38
+ }
18
39
  },
19
- "sideEffects": [
20
- "*.css"
21
- ],
40
+ "sideEffects": false,
22
41
  "scripts": {
23
42
  "build:js": "rollup -c",
24
43
  "build:types": "tsc --emitDeclarationOnly",
25
44
  "build:watch": "rollup -c -w",
26
45
  "clean": "rimraf dist",
27
46
  "build": "npm run clean && npm run build:js && npm run build:types",
47
+ "build:analyze": "npm run build && npm run analyze",
48
+ "analyze": "rollup -c --config-option analyze=true",
28
49
  "test": "jest",
29
50
  "test:watch": "jest --watch",
30
51
  "test:coverage": "jest --coverage",
@@ -39,15 +60,27 @@
39
60
  "production": "pnpm i && pnpm lint:fix && pnpm build && pnpm pack"
40
61
  },
41
62
  "keywords": [
63
+ "react-loadly",
42
64
  "react",
43
65
  "loaders",
44
66
  "loading",
45
67
  "spinner",
46
- "animation",
47
68
  "typescript",
48
69
  "nextjs",
49
70
  "components",
50
71
  "ui",
72
+ "react loaders",
73
+ "react loader",
74
+ "react spinner",
75
+ "loading indicator",
76
+ "react loading component",
77
+ "spinner component",
78
+ "skeleton loader",
79
+ "typescript",
80
+ "nextjs",
81
+ "ui components",
82
+ "frontend",
83
+ "animation",
51
84
  "performance"
52
85
  ],
53
86
  "author": "Mostafa Mohamed",
@@ -87,6 +120,8 @@
87
120
  "rollup-plugin-dts": "^6.2.3",
88
121
  "rollup-plugin-postcss": "^4.0.2",
89
122
  "rollup-plugin-typescript-paths": "^1.5.0",
123
+ "rollup-plugin-terser": "^7.0.2",
124
+ "rollup-plugin-visualizer": "^5.9.2",
90
125
  "ts-jest": "^29.1.1",
91
126
  "tsconfig-paths": "^4.2.0",
92
127
  "tslib": "^2.6.2",
@@ -1,20 +0,0 @@
1
- export interface ILoaderTheme {
2
- name: string;
3
- colors: {
4
- primary: string;
5
- secondary: string;
6
- background: string;
7
- text: string;
8
- accent: string;
9
- };
10
- animation: {
11
- duration: string;
12
- easing: string;
13
- };
14
- typography: {
15
- fontFamily: string;
16
- fontSize: string;
17
- fontWeight: number;
18
- };
19
- }
20
- //# sourceMappingURL=ILoaderTheme.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ILoaderTheme.d.ts","sourceRoot":"","sources":["../../../../src/@types/interfaces/ILoaderTheme.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,SAAS,EAAE;QACT,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,UAAU,EAAE;QACV,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH"}