react-loadly 1.0.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 +220 -0
- package/dist/index.d.ts +507 -0
- package/dist/index.esm.js +1371 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +1409 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +2 -0
- package/dist/styles.css.map +1 -0
- package/dist/types/@types/index.d.ts +15 -0
- package/dist/types/@types/index.d.ts.map +1 -0
- package/dist/types/@types/interfaces/IBaseLoaderProps.d.ts +30 -0
- package/dist/types/@types/interfaces/IBaseLoaderProps.d.ts.map +1 -0
- package/dist/types/@types/interfaces/IFallbackLoaderProps.d.ts +14 -0
- package/dist/types/@types/interfaces/IFallbackLoaderProps.d.ts.map +1 -0
- package/dist/types/@types/interfaces/IFluidLoaderProps.d.ts +8 -0
- package/dist/types/@types/interfaces/IFluidLoaderProps.d.ts.map +1 -0
- package/dist/types/@types/interfaces/IGeometricLoaderProps.d.ts +8 -0
- package/dist/types/@types/interfaces/IGeometricLoaderProps.d.ts.map +1 -0
- package/dist/types/@types/interfaces/ILoaderCSSVariables.d.ts +11 -0
- package/dist/types/@types/interfaces/ILoaderCSSVariables.d.ts.map +1 -0
- package/dist/types/@types/interfaces/ILoaderState.d.ts +7 -0
- package/dist/types/@types/interfaces/ILoaderState.d.ts.map +1 -0
- package/dist/types/@types/interfaces/ILoaderTheme.d.ts +20 -0
- package/dist/types/@types/interfaces/ILoaderTheme.d.ts.map +1 -0
- package/dist/types/@types/interfaces/ILogoLoaderProps.d.ts +12 -0
- package/dist/types/@types/interfaces/ILogoLoaderProps.d.ts.map +1 -0
- package/dist/types/@types/interfaces/ITextLoaderProps.d.ts +12 -0
- package/dist/types/@types/interfaces/ITextLoaderProps.d.ts.map +1 -0
- package/dist/types/@types/interfaces/IUseLoaderStateOptions.d.ts +9 -0
- package/dist/types/@types/interfaces/IUseLoaderStateOptions.d.ts.map +1 -0
- package/dist/types/@types/interfaces/IUseLoaderStateReturn.d.ts +10 -0
- package/dist/types/@types/interfaces/IUseLoaderStateReturn.d.ts.map +1 -0
- package/dist/types/@types/types/AnimationDirectionType.d.ts +2 -0
- package/dist/types/@types/types/AnimationDirectionType.d.ts.map +1 -0
- package/dist/types/@types/types/AnimationEasingType.d.ts +2 -0
- package/dist/types/@types/types/AnimationEasingType.d.ts.map +1 -0
- package/dist/types/@types/types/AnimationFillModeType.d.ts +2 -0
- package/dist/types/@types/types/AnimationFillModeType.d.ts.map +1 -0
- package/dist/types/@types/types/index.d.ts +4 -0
- package/dist/types/@types/types/index.d.ts.map +1 -0
- package/dist/types/components/atoms/Circle.d.ts +15 -0
- package/dist/types/components/atoms/Circle.d.ts.map +1 -0
- package/dist/types/components/atoms/Dot.d.ts +15 -0
- package/dist/types/components/atoms/Dot.d.ts.map +1 -0
- package/dist/types/components/atoms/Line.d.ts +29 -0
- package/dist/types/components/atoms/Line.d.ts.map +1 -0
- package/dist/types/components/atoms/Rectangle.d.ts +30 -0
- package/dist/types/components/atoms/Rectangle.d.ts.map +1 -0
- package/dist/types/components/atoms/index.d.ts +9 -0
- package/dist/types/components/atoms/index.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +4 -0
- package/dist/types/components/index.d.ts.map +1 -0
- package/dist/types/components/molecules/DotCluster.d.ts +26 -0
- package/dist/types/components/molecules/DotCluster.d.ts.map +1 -0
- package/dist/types/components/molecules/LineGroup.d.ts +30 -0
- package/dist/types/components/molecules/LineGroup.d.ts.map +1 -0
- package/dist/types/components/molecules/ShapeGroup.d.ts +30 -0
- package/dist/types/components/molecules/ShapeGroup.d.ts.map +1 -0
- package/dist/types/components/molecules/index.d.ts +7 -0
- package/dist/types/components/molecules/index.d.ts.map +1 -0
- package/dist/types/components/organisms/BarsLoader.d.ts +4 -0
- package/dist/types/components/organisms/BarsLoader.d.ts.map +1 -0
- package/dist/types/components/organisms/BlobLoader.d.ts +4 -0
- package/dist/types/components/organisms/BlobLoader.d.ts.map +1 -0
- package/dist/types/components/organisms/BounceLoader.d.ts +4 -0
- package/dist/types/components/organisms/BounceLoader.d.ts.map +1 -0
- package/dist/types/components/organisms/DotsLoader.d.ts +4 -0
- package/dist/types/components/organisms/DotsLoader.d.ts.map +1 -0
- package/dist/types/components/organisms/FallbackLoader.d.ts +4 -0
- package/dist/types/components/organisms/FallbackLoader.d.ts.map +1 -0
- package/dist/types/components/organisms/FlowLoader.d.ts +4 -0
- package/dist/types/components/organisms/FlowLoader.d.ts.map +1 -0
- package/dist/types/components/organisms/GridLoader.d.ts +4 -0
- package/dist/types/components/organisms/GridLoader.d.ts.map +1 -0
- package/dist/types/components/organisms/LiquidLoader.d.ts +4 -0
- package/dist/types/components/organisms/LiquidLoader.d.ts.map +1 -0
- package/dist/types/components/organisms/LogoSpinLoader.d.ts +4 -0
- package/dist/types/components/organisms/LogoSpinLoader.d.ts.map +1 -0
- package/dist/types/components/organisms/PulseLoader.d.ts +4 -0
- package/dist/types/components/organisms/PulseLoader.d.ts.map +1 -0
- package/dist/types/components/organisms/RingLoader.d.ts +4 -0
- package/dist/types/components/organisms/RingLoader.d.ts.map +1 -0
- package/dist/types/components/organisms/RotateLoader.d.ts +4 -0
- package/dist/types/components/organisms/RotateLoader.d.ts.map +1 -0
- package/dist/types/components/organisms/SpinLoader.d.ts +4 -0
- package/dist/types/components/organisms/SpinLoader.d.ts.map +1 -0
- package/dist/types/components/organisms/TypingLoader.d.ts +4 -0
- package/dist/types/components/organisms/TypingLoader.d.ts.map +1 -0
- package/dist/types/components/organisms/WaveLoader.d.ts +4 -0
- package/dist/types/components/organisms/WaveLoader.d.ts.map +1 -0
- package/dist/types/components/organisms/index.d.ts +17 -0
- package/dist/types/components/organisms/index.d.ts.map +1 -0
- package/dist/types/hooks/index.d.ts +5 -0
- package/dist/types/hooks/index.d.ts.map +1 -0
- package/dist/types/hooks/useAsyncLoader.d.ts +15 -0
- package/dist/types/hooks/useAsyncLoader.d.ts.map +1 -0
- package/dist/types/hooks/useLoaderState.d.ts +10 -0
- package/dist/types/hooks/useLoaderState.d.ts.map +1 -0
- package/dist/types/hooks/useMultipleLoaderStates.d.ts +11 -0
- package/dist/types/hooks/useMultipleLoaderStates.d.ts.map +1 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/setupTests.d.ts +2 -0
- package/dist/types/setupTests.d.ts.map +1 -0
- package/dist/types/utils/animationUtils.d.ts +29 -0
- package/dist/types/utils/animationUtils.d.ts.map +1 -0
- package/dist/types/utils/colorUtils.d.ts +18 -0
- package/dist/types/utils/colorUtils.d.ts.map +1 -0
- package/dist/types/utils/domUtils.d.ts +13 -0
- package/dist/types/utils/domUtils.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +6 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/mathUtils.d.ts +9 -0
- package/dist/types/utils/mathUtils.d.ts.map +1 -0
- package/dist/types/utils/propUtils.d.ts +22 -0
- package/dist/types/utils/propUtils.d.ts.map +1 -0
- package/package.json +112 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,507 @@
|
|
|
1
|
+
import { CSSProperties, FC } from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { IFallbackLoaderProps } from '@types';
|
|
4
|
+
|
|
5
|
+
interface DotProps {
|
|
6
|
+
size?: number | string;
|
|
7
|
+
color?: string;
|
|
8
|
+
opacity?: number;
|
|
9
|
+
className?: string;
|
|
10
|
+
style?: CSSProperties;
|
|
11
|
+
animation?: string;
|
|
12
|
+
animationDuration?: string;
|
|
13
|
+
animationDelay?: string;
|
|
14
|
+
glowIntensity?: number;
|
|
15
|
+
"data-testid"?: string;
|
|
16
|
+
}
|
|
17
|
+
declare const Dot: React.FC<DotProps>;
|
|
18
|
+
|
|
19
|
+
interface LineProps {
|
|
20
|
+
/** Width of the line */
|
|
21
|
+
width?: number | string;
|
|
22
|
+
/** Height/thickness of the line */
|
|
23
|
+
height?: number | string;
|
|
24
|
+
/** Color of the line */
|
|
25
|
+
color?: string;
|
|
26
|
+
/** Opacity */
|
|
27
|
+
opacity?: number;
|
|
28
|
+
/** Border radius for rounded lines */
|
|
29
|
+
borderRadius?: number | string;
|
|
30
|
+
/** Custom CSS class */
|
|
31
|
+
className?: string;
|
|
32
|
+
/** Custom styles */
|
|
33
|
+
style?: CSSProperties;
|
|
34
|
+
/** Animation name if any */
|
|
35
|
+
animation?: string;
|
|
36
|
+
/** Animation duration */
|
|
37
|
+
animationDuration?: string;
|
|
38
|
+
/** Animation delay */
|
|
39
|
+
animationDelay?: string;
|
|
40
|
+
/** Orientation of the line */
|
|
41
|
+
orientation?: "horizontal" | "vertical";
|
|
42
|
+
/** Data test id */
|
|
43
|
+
"data-testid"?: string;
|
|
44
|
+
}
|
|
45
|
+
declare const Line: React.FC<LineProps>;
|
|
46
|
+
|
|
47
|
+
interface RectangleProps {
|
|
48
|
+
/** Width of the rectangle */
|
|
49
|
+
width?: number | string;
|
|
50
|
+
/** Height of the rectangle */
|
|
51
|
+
height?: number | string;
|
|
52
|
+
/** Fill color */
|
|
53
|
+
color?: string;
|
|
54
|
+
/** Border color */
|
|
55
|
+
borderColor?: string;
|
|
56
|
+
/** Border width */
|
|
57
|
+
borderWidth?: number | string;
|
|
58
|
+
/** Border radius */
|
|
59
|
+
borderRadius?: number | string;
|
|
60
|
+
/** Opacity */
|
|
61
|
+
opacity?: number;
|
|
62
|
+
/** Custom CSS class */
|
|
63
|
+
className?: string;
|
|
64
|
+
/** Custom styles */
|
|
65
|
+
style?: React.CSSProperties;
|
|
66
|
+
/** Animation name if any */
|
|
67
|
+
animation?: string;
|
|
68
|
+
/** Animation duration */
|
|
69
|
+
animationDuration?: string;
|
|
70
|
+
/** Animation delay */
|
|
71
|
+
animationDelay?: string;
|
|
72
|
+
/** Data test id */
|
|
73
|
+
"data-testid"?: string;
|
|
74
|
+
}
|
|
75
|
+
declare const Rectangle: React.FC<RectangleProps>;
|
|
76
|
+
|
|
77
|
+
interface CircleProps {
|
|
78
|
+
size?: number | string;
|
|
79
|
+
color?: string;
|
|
80
|
+
borderColor?: string;
|
|
81
|
+
borderWidth?: number | string;
|
|
82
|
+
opacity?: number;
|
|
83
|
+
className?: string;
|
|
84
|
+
style?: React.CSSProperties;
|
|
85
|
+
animation?: string;
|
|
86
|
+
animationDuration?: string;
|
|
87
|
+
animationDelay?: string;
|
|
88
|
+
"data-testid"?: string;
|
|
89
|
+
}
|
|
90
|
+
declare const Circle: ({ size, color, borderColor, borderWidth, opacity, className, style, animation, animationDuration, animationDelay, "data-testid": dataTestId, ...props }: CircleProps) => react_jsx_runtime.JSX.Element;
|
|
91
|
+
|
|
92
|
+
interface DotClusterProps {
|
|
93
|
+
/** Number of dots in the cluster */
|
|
94
|
+
count?: number;
|
|
95
|
+
/** Size of each dot */
|
|
96
|
+
dotSize?: number | string;
|
|
97
|
+
/** Color of the dots */
|
|
98
|
+
color?: string;
|
|
99
|
+
/** Secondary color for alternating dots */
|
|
100
|
+
secondaryColor?: string;
|
|
101
|
+
/** Spacing between dots */
|
|
102
|
+
spacing?: number | string;
|
|
103
|
+
/** Animation speed multiplier */
|
|
104
|
+
speed?: number;
|
|
105
|
+
/** Cluster arrangement */
|
|
106
|
+
arrangement?: "linear" | "circular" | "grid";
|
|
107
|
+
/** Custom CSS class */
|
|
108
|
+
className?: string;
|
|
109
|
+
/** Custom styles */
|
|
110
|
+
style?: React.CSSProperties;
|
|
111
|
+
/** Animation type */
|
|
112
|
+
animationType?: "wave" | "pulse" | "fade" | "bounce";
|
|
113
|
+
/** Data test id */
|
|
114
|
+
"data-testid"?: string;
|
|
115
|
+
}
|
|
116
|
+
declare const DotCluster: React.FC<DotClusterProps>;
|
|
117
|
+
|
|
118
|
+
interface LineGroupProps {
|
|
119
|
+
/** Number of lines in the group */
|
|
120
|
+
count?: number;
|
|
121
|
+
/** Width of each line */
|
|
122
|
+
lineWidth?: number | string;
|
|
123
|
+
/** Height/thickness of each line */
|
|
124
|
+
lineHeight?: number | string;
|
|
125
|
+
/** Color of the lines */
|
|
126
|
+
color?: string;
|
|
127
|
+
/** Secondary color for alternating lines */
|
|
128
|
+
secondaryColor?: string;
|
|
129
|
+
/** Spacing between lines */
|
|
130
|
+
spacing?: number | string;
|
|
131
|
+
/** Animation speed multiplier */
|
|
132
|
+
speed?: number;
|
|
133
|
+
/** Group arrangement */
|
|
134
|
+
arrangement?: "parallel" | "radial" | "staggered";
|
|
135
|
+
/** Orientation of lines */
|
|
136
|
+
orientation?: "horizontal" | "vertical";
|
|
137
|
+
/** Custom CSS class */
|
|
138
|
+
className?: string;
|
|
139
|
+
/** Custom styles */
|
|
140
|
+
style?: React.CSSProperties;
|
|
141
|
+
/** Animation type */
|
|
142
|
+
animationType?: "wave" | "pulse" | "scale" | "rotate";
|
|
143
|
+
/** Data test id */
|
|
144
|
+
"data-testid"?: string;
|
|
145
|
+
}
|
|
146
|
+
declare const LineGroup: React.FC<LineGroupProps>;
|
|
147
|
+
|
|
148
|
+
interface ShapeGroupProps {
|
|
149
|
+
/** Number of shapes in the group */
|
|
150
|
+
count?: number;
|
|
151
|
+
/** Size of each shape */
|
|
152
|
+
shapeSize?: number | string;
|
|
153
|
+
/** Color of the shapes */
|
|
154
|
+
color?: string;
|
|
155
|
+
/** Secondary color for alternating shapes */
|
|
156
|
+
secondaryColor?: string;
|
|
157
|
+
/** Spacing between shapes */
|
|
158
|
+
spacing?: number | string;
|
|
159
|
+
/** Animation speed multiplier */
|
|
160
|
+
speed?: number;
|
|
161
|
+
/** Group arrangement */
|
|
162
|
+
arrangement?: "linear" | "circular" | "spiral";
|
|
163
|
+
/** Shape types to use */
|
|
164
|
+
shapeTypes?: ("circle" | "rectangle")[];
|
|
165
|
+
/** Custom CSS class */
|
|
166
|
+
className?: string;
|
|
167
|
+
/** Custom styles */
|
|
168
|
+
style?: React.CSSProperties;
|
|
169
|
+
/** Animation type */
|
|
170
|
+
animationType?: "pulse" | "rotate" | "scale" | "bounce";
|
|
171
|
+
/** Border width for outlined shapes */
|
|
172
|
+
borderWidth?: number;
|
|
173
|
+
/** Data test id */
|
|
174
|
+
"data-testid"?: string;
|
|
175
|
+
}
|
|
176
|
+
declare const ShapeGroup: React.FC<ShapeGroupProps>;
|
|
177
|
+
|
|
178
|
+
interface IBaseLoaderProps$1 {
|
|
179
|
+
/** Custom CSS class name */
|
|
180
|
+
className?: string;
|
|
181
|
+
/** Custom inline styles */
|
|
182
|
+
style?: CSSProperties;
|
|
183
|
+
/** Size of the loader (can be overridden by width/height) */
|
|
184
|
+
size?: number | string;
|
|
185
|
+
/** Width of the loader */
|
|
186
|
+
width?: number | string;
|
|
187
|
+
/** Height of the loader */
|
|
188
|
+
height?: number | string;
|
|
189
|
+
/** Primary color of the loader */
|
|
190
|
+
color?: string;
|
|
191
|
+
/** Secondary color for multi-color loaders */
|
|
192
|
+
secondaryColor?: string;
|
|
193
|
+
/** Animation speed multiplier (1 = normal, 2 = double speed, 0.5 = half speed) */
|
|
194
|
+
speed?: number;
|
|
195
|
+
/** Whether the loader is currently loading */
|
|
196
|
+
loading?: boolean;
|
|
197
|
+
/** Accessibility label for screen readers */
|
|
198
|
+
"aria-label"?: string;
|
|
199
|
+
/** Whether to show loading text */
|
|
200
|
+
showText?: boolean;
|
|
201
|
+
/** Custom loading text */
|
|
202
|
+
loadingText?: string;
|
|
203
|
+
|
|
204
|
+
/** Data test id for testing */
|
|
205
|
+
"data-testid"?: string;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
interface IFluidLoaderProps extends IBaseLoaderProps$1 {
|
|
209
|
+
/** Fluidity/viscosity of the animation */
|
|
210
|
+
fluidity?: number;
|
|
211
|
+
/** Wave amplitude for wave-based loaders */
|
|
212
|
+
amplitude?: number;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
interface IGeometricLoaderProps$1 extends IBaseLoaderProps$1 {
|
|
216
|
+
/** Number of elements in geometric patterns */
|
|
217
|
+
count?: number;
|
|
218
|
+
/** Border width for outlined shapes */
|
|
219
|
+
borderWidth?: number;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
interface ILoaderCSSVariables$1 {
|
|
223
|
+
"--loader-color"?: string;
|
|
224
|
+
"--loader-secondary-color"?: string;
|
|
225
|
+
"--loader-size"?: string;
|
|
226
|
+
"--loader-speed"?: string;
|
|
227
|
+
"--loader-background"?: string;
|
|
228
|
+
"--loader-text-color"?: string;
|
|
229
|
+
"--loader-border-width"?: string;
|
|
230
|
+
"--loader-glow-intensity"?: string;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
interface ILogoLoaderProps extends IBaseLoaderProps$1 {
|
|
234
|
+
/** Logo source (image URL or SVG) */
|
|
235
|
+
src?: string;
|
|
236
|
+
/** Logo alt text */
|
|
237
|
+
alt?: string;
|
|
238
|
+
/** Animation type for logo */
|
|
239
|
+
animationType?: "spin" | "pulse" | "glow" | "bounce" | "flip";
|
|
240
|
+
/** Glow intensity (0-1) */
|
|
241
|
+
glowIntensity?: number;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
interface ITextLoaderProps extends IBaseLoaderProps$1 {
|
|
245
|
+
/** Text to animate */
|
|
246
|
+
text?: string;
|
|
247
|
+
/** Font family for text loaders */
|
|
248
|
+
fontFamily?: string;
|
|
249
|
+
/** Font weight */
|
|
250
|
+
fontWeight?: number | string;
|
|
251
|
+
/** Character animation delay */
|
|
252
|
+
charDelay?: number;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
declare const BlobLoader: FC<IFluidLoaderProps>;
|
|
256
|
+
|
|
257
|
+
declare const FallbackLoader: FC<IFallbackLoaderProps>;
|
|
258
|
+
|
|
259
|
+
declare const FlowLoader: FC<IFluidLoaderProps>;
|
|
260
|
+
|
|
261
|
+
declare const GridLoader: FC<IGeometricLoaderProps$1>;
|
|
262
|
+
|
|
263
|
+
declare const LiquidLoader: FC<IFluidLoaderProps>;
|
|
264
|
+
|
|
265
|
+
declare const LogoSpinLoader: FC<ILogoLoaderProps>;
|
|
266
|
+
|
|
267
|
+
declare const PulseLoader: FC<IGeometricLoaderProps$1>;
|
|
268
|
+
|
|
269
|
+
declare const SpinLoader: FC<IGeometricLoaderProps$1>;
|
|
270
|
+
|
|
271
|
+
declare const TypingLoader: FC<ITextLoaderProps>;
|
|
272
|
+
|
|
273
|
+
declare const WaveLoader: FC<IGeometricLoaderProps$1>;
|
|
274
|
+
|
|
275
|
+
declare const BarsLoader: FC<IGeometricLoaderProps$1>;
|
|
276
|
+
|
|
277
|
+
declare const BounceLoader: FC<IGeometricLoaderProps$1>;
|
|
278
|
+
|
|
279
|
+
declare const DotsLoader: FC<IGeometricLoaderProps$1>;
|
|
280
|
+
|
|
281
|
+
interface IBaseLoaderProps {
|
|
282
|
+
/** Custom CSS class name */
|
|
283
|
+
className?: string;
|
|
284
|
+
/** Custom inline styles */
|
|
285
|
+
style?: CSSProperties;
|
|
286
|
+
/** Size of the loader (can be overridden by width/height) */
|
|
287
|
+
size?: number | string;
|
|
288
|
+
/** Width of the loader */
|
|
289
|
+
width?: number | string;
|
|
290
|
+
/** Height of the loader */
|
|
291
|
+
height?: number | string;
|
|
292
|
+
/** Primary color of the loader */
|
|
293
|
+
color?: string;
|
|
294
|
+
/** Secondary color for multi-color loaders */
|
|
295
|
+
secondaryColor?: string;
|
|
296
|
+
/** Animation speed multiplier (1 = normal, 2 = double speed, 0.5 = half speed) */
|
|
297
|
+
speed?: number;
|
|
298
|
+
/** Whether the loader is currently loading */
|
|
299
|
+
loading?: boolean;
|
|
300
|
+
/** Accessibility label for screen readers */
|
|
301
|
+
"aria-label"?: string;
|
|
302
|
+
/** Whether to show loading text */
|
|
303
|
+
showText?: boolean;
|
|
304
|
+
/** Custom loading text */
|
|
305
|
+
loadingText?: string;
|
|
306
|
+
/** Data test id for testing */
|
|
307
|
+
"data-testid"?: string;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
interface IGeometricLoaderProps extends IBaseLoaderProps {
|
|
311
|
+
/** Number of elements in geometric patterns */
|
|
312
|
+
count?: number;
|
|
313
|
+
/** Border width for outlined shapes */
|
|
314
|
+
borderWidth?: number;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
interface ILoaderCSSVariables {
|
|
318
|
+
"--loader-color"?: string;
|
|
319
|
+
"--loader-secondary-color"?: string;
|
|
320
|
+
"--loader-size"?: string;
|
|
321
|
+
"--loader-speed"?: string;
|
|
322
|
+
"--loader-background"?: string;
|
|
323
|
+
"--loader-text-color"?: string;
|
|
324
|
+
"--loader-border-width"?: string;
|
|
325
|
+
"--loader-glow-intensity"?: string;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
interface ILoaderState {
|
|
329
|
+
isLoading: boolean;
|
|
330
|
+
progress?: number;
|
|
331
|
+
error?: string | null;
|
|
332
|
+
retryCount?: number;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
interface IUseLoaderStateOptions {
|
|
336
|
+
initialLoading?: boolean;
|
|
337
|
+
timeout?: number;
|
|
338
|
+
maxRetries?: number;
|
|
339
|
+
onLoadingChange?: (isLoading: boolean) => void;
|
|
340
|
+
onError?: (error: string) => void;
|
|
341
|
+
onProgress?: (progress: number) => void;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
interface IUseLoaderStateReturn {
|
|
345
|
+
state: ILoaderState;
|
|
346
|
+
setLoading: (loading: boolean) => void;
|
|
347
|
+
setProgress: (progress: number) => void;
|
|
348
|
+
setError: (error: string | null) => void;
|
|
349
|
+
retry: () => void;
|
|
350
|
+
reset: () => void;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
interface ILoaderTheme {
|
|
354
|
+
name: string;
|
|
355
|
+
colors: {
|
|
356
|
+
primary: string;
|
|
357
|
+
secondary: string;
|
|
358
|
+
background: string;
|
|
359
|
+
text: string;
|
|
360
|
+
accent: string;
|
|
361
|
+
};
|
|
362
|
+
animation: {
|
|
363
|
+
duration: string;
|
|
364
|
+
easing: string;
|
|
365
|
+
};
|
|
366
|
+
typography: {
|
|
367
|
+
fontFamily: string;
|
|
368
|
+
fontSize: string;
|
|
369
|
+
fontWeight: number;
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
type AnimationDirectionType = "normal" | "reverse" | "alternate" | "alternate-reverse";
|
|
374
|
+
|
|
375
|
+
type AnimationEasingType = "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out" | "cubic-bezier(number, number, number, number)";
|
|
376
|
+
|
|
377
|
+
type AnimationFillModeType = "none" | "forwards" | "backwards" | "both";
|
|
378
|
+
|
|
379
|
+
declare const RingLoader: FC<IGeometricLoaderProps>;
|
|
380
|
+
|
|
381
|
+
declare const RotateLoader: FC<IGeometricLoaderProps$1>;
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* Custom React hook for managing loader state with advanced features
|
|
385
|
+
* Provides centralized loading state management with timeout, retry, and progress tracking
|
|
386
|
+
*
|
|
387
|
+
* @param options - Configuration options for the loader state
|
|
388
|
+
* @returns Object containing state and methods to control the loader
|
|
389
|
+
*/
|
|
390
|
+
declare const useLoaderState: (options?: IUseLoaderStateOptions) => IUseLoaderStateReturn;
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Hook for managing multiple loader states with shared options
|
|
394
|
+
* Useful when you need to control multiple loaders with the same configuration
|
|
395
|
+
*
|
|
396
|
+
* @param keys - Array of string keys representing each loader state
|
|
397
|
+
* @param options - Shared configuration options for all loader states
|
|
398
|
+
* @returns Record mapping each key to its corresponding loader state methods
|
|
399
|
+
*/
|
|
400
|
+
declare const useMultipleLoaderStates: (keys: string[], options?: IUseLoaderStateOptions) => Record<string, IUseLoaderStateReturn>;
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Hook for tracking async operations with automatic loading state management
|
|
404
|
+
* Automatically handles loading states during async operations and provides error handling
|
|
405
|
+
*
|
|
406
|
+
* @param asyncFn - Async function to execute and track
|
|
407
|
+
* @param dependencies - Dependency array to trigger re-execution (similar to useEffect)
|
|
408
|
+
* @param options - Configuration options for the loader state
|
|
409
|
+
* @returns Object containing loader state, data result, and execution method
|
|
410
|
+
*/
|
|
411
|
+
declare const useAsyncLoader: <T>(asyncFn: () => Promise<T>, dependencies?: React.DependencyList, options?: IUseLoaderStateOptions) => IUseLoaderStateReturn & {
|
|
412
|
+
data: T | null;
|
|
413
|
+
execute: () => Promise<T | null>;
|
|
414
|
+
};
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Merges default props with user props, handling undefined values gracefully
|
|
418
|
+
* @param defaultProps - The default props to merge
|
|
419
|
+
* @param userProps - The user provided props
|
|
420
|
+
* @returns Merged props object
|
|
421
|
+
*/
|
|
422
|
+
declare function mergeProps<T extends object, U extends object>(defaultProps: T, userProps: U): T & U;
|
|
423
|
+
/**
|
|
424
|
+
* Converts size prop to CSS value
|
|
425
|
+
* @param size - The size value (number or string)
|
|
426
|
+
* @param fallback - The fallback value if size is undefined
|
|
427
|
+
* @returns CSS size value as string
|
|
428
|
+
*/
|
|
429
|
+
declare function getSizeValue(size: number | string | undefined, fallback?: string): string;
|
|
430
|
+
/**
|
|
431
|
+
* Generates CSS custom properties object from loader variables
|
|
432
|
+
* @param variables - The loader CSS variables object
|
|
433
|
+
* @returns React CSS properties object
|
|
434
|
+
*/
|
|
435
|
+
declare function generateCSSVariables(variables: ILoaderCSSVariables$1): React.CSSProperties;
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* Calculates animation duration based on speed multiplier
|
|
439
|
+
* @param baseMs - The base duration in milliseconds
|
|
440
|
+
* @param speed - The speed multiplier (default: 1)
|
|
441
|
+
* @returns Formatted duration string
|
|
442
|
+
*/
|
|
443
|
+
declare function getAnimationDuration(baseMs: number, speed?: number): string;
|
|
444
|
+
/**
|
|
445
|
+
* Creates a CSS animation name with prefix
|
|
446
|
+
* @param name - The base name for the animation
|
|
447
|
+
* @returns Prefixed animation name
|
|
448
|
+
*/
|
|
449
|
+
declare function createAnimationName(name: string): string;
|
|
450
|
+
/**
|
|
451
|
+
* Check if reduced motion is preferred
|
|
452
|
+
* @returns Boolean indicating if reduced motion is preferred
|
|
453
|
+
*/
|
|
454
|
+
declare function prefersReducedMotion(): boolean;
|
|
455
|
+
/**
|
|
456
|
+
* Get optimized animation settings based on user preferences
|
|
457
|
+
* @param speed - The animation speed multiplier (default: 1)
|
|
458
|
+
* @returns Object with optimized animation settings
|
|
459
|
+
*/
|
|
460
|
+
declare function getOptimizedAnimationSettings(speed?: number): {
|
|
461
|
+
duration: string;
|
|
462
|
+
playState: string;
|
|
463
|
+
iterationCount: string | number;
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* Converts hex color to RGB values
|
|
468
|
+
* @param hex - The hex color string
|
|
469
|
+
* @returns Object with r, g, b values or null if invalid
|
|
470
|
+
*/
|
|
471
|
+
declare function hexToRgb(hex: string): {
|
|
472
|
+
r: number;
|
|
473
|
+
g: number;
|
|
474
|
+
b: number;
|
|
475
|
+
} | null;
|
|
476
|
+
/**
|
|
477
|
+
* Generates rgba color with opacity
|
|
478
|
+
* @param color - The hex color string
|
|
479
|
+
* @param opacity - The opacity value (0-1)
|
|
480
|
+
* @returns RGBA color string
|
|
481
|
+
*/
|
|
482
|
+
declare function rgba(color: string, opacity: number): string;
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Clamps a value between min and max
|
|
486
|
+
* @param value - The value to clamp
|
|
487
|
+
* @param min - The minimum value
|
|
488
|
+
* @param max - The maximum value
|
|
489
|
+
* @returns The clamped value
|
|
490
|
+
*/
|
|
491
|
+
declare function clamp(value: number, min: number, max: number): number;
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* Generates unique IDs for accessibility
|
|
495
|
+
* @param prefix - The prefix for the ID (default: "loader")
|
|
496
|
+
* @returns A unique ID string
|
|
497
|
+
*/
|
|
498
|
+
declare function generateId(prefix?: string): string;
|
|
499
|
+
/**
|
|
500
|
+
* Validates and sanitizes CSS values
|
|
501
|
+
* @param value - The CSS value to sanitize
|
|
502
|
+
* @returns Sanitized CSS value or undefined
|
|
503
|
+
*/
|
|
504
|
+
declare function sanitizeCSSValue(value: string | number | undefined): string | undefined;
|
|
505
|
+
|
|
506
|
+
export { BarsLoader, BlobLoader, BounceLoader, Circle, Dot, DotCluster, DotsLoader, FallbackLoader, FlowLoader, GridLoader, Line, LineGroup, LiquidLoader, LogoSpinLoader, PulseLoader, Rectangle, RingLoader, RotateLoader, ShapeGroup, SpinLoader, TypingLoader, WaveLoader, clamp, createAnimationName, generateCSSVariables, generateId, getAnimationDuration, getOptimizedAnimationSettings, getSizeValue, hexToRgb, mergeProps, prefersReducedMotion, rgba, sanitizeCSSValue, useAsyncLoader, useLoaderState, useMultipleLoaderStates };
|
|
507
|
+
export type { AnimationDirectionType, AnimationEasingType, AnimationFillModeType, CircleProps, DotClusterProps, DotProps, IBaseLoaderProps, ILoaderCSSVariables, ILoaderTheme, LineGroupProps, LineProps, RectangleProps, ShapeGroupProps };
|