premium-react-loaders 3.0.0 → 3.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.
- package/README.md +45 -3
- package/dist/components/3d/CubeSpinner.d.ts +21 -0
- package/dist/components/3d/CubeSpinner.d.ts.map +1 -0
- package/dist/components/3d/FlipCard.d.ts +21 -0
- package/dist/components/3d/FlipCard.d.ts.map +1 -0
- package/dist/components/3d/Helix.d.ts +23 -0
- package/dist/components/3d/Helix.d.ts.map +1 -0
- package/dist/components/3d/PerspectiveRing.d.ts +21 -0
- package/dist/components/3d/PerspectiveRing.d.ts.map +1 -0
- package/dist/components/3d/PlaneRotate.d.ts +21 -0
- package/dist/components/3d/PlaneRotate.d.ts.map +1 -0
- package/dist/components/3d/index.d.ts +6 -0
- package/dist/components/3d/index.d.ts.map +1 -0
- package/dist/components/accessibility/LiveRegion.d.ts +34 -0
- package/dist/components/accessibility/LiveRegion.d.ts.map +1 -0
- package/dist/components/accessibility/index.d.ts +2 -0
- package/dist/components/accessibility/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/skeleton/DataTableSkeleton.d.ts +25 -0
- package/dist/components/skeleton/DataTableSkeleton.d.ts.map +1 -0
- package/dist/components/skeleton/SmartSkeleton.d.ts +23 -0
- package/dist/components/skeleton/SmartSkeleton.d.ts.map +1 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/skeleton/index.d.ts.map +1 -1
- package/dist/components/smart/FormFieldLoader.d.ts +22 -0
- package/dist/components/smart/FormFieldLoader.d.ts.map +1 -0
- package/dist/components/smart/index.d.ts +2 -0
- package/dist/components/smart/index.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useLoadingAnalytics.d.ts +101 -0
- package/dist/hooks/useLoadingAnalytics.d.ts.map +1 -0
- package/dist/hooks/useLoadingOrchestrator.d.ts +104 -0
- package/dist/hooks/useLoadingOrchestrator.d.ts.map +1 -0
- package/dist/hooks/useSmartLoader.d.ts +98 -0
- package/dist/hooks/useSmartLoader.d.ts.map +1 -0
- package/dist/index.cjs +49 -31
- package/dist/index.js +49 -31
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +1 -1
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +1 -1
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +1 -1
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +1 -1
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +1 -1
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +1 -1
- package/dist/index16.cjs +131 -66
- package/dist/index16.js +132 -67
- package/dist/index17.cjs +245 -30
- package/dist/index17.js +246 -31
- package/dist/index18.cjs +24 -36
- package/dist/index18.js +24 -36
- package/dist/index19.cjs +19 -21
- package/dist/index19.js +19 -21
- package/dist/index20.cjs +25 -20
- package/dist/index20.js +25 -20
- package/dist/index21.cjs +22 -32
- package/dist/index21.js +22 -32
- package/dist/index22.cjs +26 -35
- package/dist/index22.js +28 -37
- package/dist/index23.cjs +40 -76
- package/dist/index23.js +42 -78
- package/dist/index24.cjs +53 -102
- package/dist/index24.js +54 -103
- package/dist/index25.cjs +46 -80
- package/dist/index25.js +47 -81
- package/dist/index26.cjs +105 -103
- package/dist/index26.js +107 -105
- package/dist/index27.cjs +108 -27
- package/dist/index27.js +111 -30
- package/dist/index28.cjs +104 -36
- package/dist/index28.js +106 -38
- package/dist/index29.cjs +22 -30
- package/dist/index29.js +23 -31
- package/dist/index30.cjs +30 -32
- package/dist/index30.js +31 -33
- package/dist/index31.cjs +49 -52
- package/dist/index31.js +50 -53
- package/dist/index32.cjs +37 -108
- package/dist/index32.js +38 -109
- package/dist/index33.cjs +54 -72
- package/dist/index33.js +55 -73
- package/dist/index34.cjs +112 -80
- package/dist/index34.js +112 -80
- package/dist/index35.cjs +78 -145
- package/dist/index35.js +80 -147
- package/dist/index36.cjs +78 -57
- package/dist/index36.js +79 -58
- package/dist/index37.cjs +138 -84
- package/dist/index37.js +140 -86
- package/dist/index38.cjs +33 -106
- package/dist/index38.js +34 -107
- package/dist/index39.cjs +66 -50
- package/dist/index39.js +66 -50
- package/dist/index40.cjs +123 -44
- package/dist/index40.js +124 -45
- package/dist/index41.cjs +43 -85
- package/dist/index41.js +44 -86
- package/dist/index42.cjs +35 -27
- package/dist/index42.js +35 -27
- package/dist/index43.cjs +87 -58
- package/dist/index43.js +87 -58
- package/dist/index44.cjs +35 -88
- package/dist/index44.js +36 -89
- package/dist/index45.cjs +62 -58
- package/dist/index45.js +63 -59
- package/dist/index46.cjs +87 -110
- package/dist/index46.js +88 -111
- package/dist/index47.cjs +101 -120
- package/dist/index47.js +102 -121
- package/dist/index48.cjs +158 -0
- package/dist/index48.js +158 -0
- package/dist/index49.cjs +167 -0
- package/dist/index49.js +167 -0
- package/dist/index50.cjs +110 -0
- package/dist/index50.js +110 -0
- package/dist/index51.cjs +112 -0
- package/dist/index51.js +112 -0
- package/dist/index52.cjs +144 -0
- package/dist/index52.js +144 -0
- package/dist/index53.cjs +112 -0
- package/dist/index53.js +112 -0
- package/dist/index54.cjs +189 -0
- package/dist/index54.js +189 -0
- package/dist/index55.cjs +53 -0
- package/dist/index55.js +53 -0
- package/dist/index56.cjs +125 -0
- package/dist/index56.js +125 -0
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +1 -1
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +1 -1
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +1 -1
- package/dist/premium-react-loaders.css +140 -0
- package/dist/types/3d.d.ts +85 -0
- package/dist/types/3d.d.ts.map +1 -0
- package/dist/types/accessibility.d.ts +35 -0
- package/dist/types/accessibility.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/smart.d.ts +63 -0
- package/dist/types/smart.d.ts.map +1 -0
- package/dist/utils/accessibility.d.ts +67 -0
- package/dist/utils/accessibility.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 **50+ premium, production-ready loading components** for React applications. Built with TypeScript and custom CSS for maximum flexibility and zero configuration.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/premium-react-loaders)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
@@ -11,11 +11,15 @@ A comprehensive collection of **40 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 50+ components in action with interactive examples and customization options.
|
|
15
15
|
|
|
16
16
|
## Features
|
|
17
17
|
|
|
18
|
-
- **
|
|
18
|
+
- **50+ Premium Components** across 15 categories (Skeleton, Spinner, Progress, Pulse, Overlay, Button, Status, Transition, Shimmer, Orbit, Bounce, Infinity, Text, 3D, Smart)
|
|
19
|
+
- **6 Powerful Hooks** - useLoader, useEnhancedLoader, useLoadingOrchestrator, useLoadingAnalytics, useSmartLoader, useTheme ✨ *New in v3.1.0*
|
|
20
|
+
- **3D Loaders** - Immersive 3D animations with CSS transforms ✨ *New in v3.1.0*
|
|
21
|
+
- **Smart Components** - Context-aware skeletons and form field loaders ✨ *New in v3.1.0*
|
|
22
|
+
- **Accessibility First** - LiveRegion component and announcement system ✨ *New in v3.1.0*
|
|
19
23
|
- **Global Theming** - ThemeProvider for app-wide customization ✨ *New in v2.1.0*
|
|
20
24
|
- **Smart Loading UX** - useLoader hook with delay, minDuration, and autoHide ✨ *New in v2.1.0*
|
|
21
25
|
- **Enhanced CSS Variables** - Comprehensive theming with dark mode support ✨ *New in v2.1.0*
|
|
@@ -220,6 +224,44 @@ Animated loading text:
|
|
|
220
224
|
|
|
221
225
|
- **LoadingText** - Animated loading text with multiple animation styles (dots, fade, bounce, wave)
|
|
222
226
|
|
|
227
|
+
### 3D Components (5 components) ✨ *New in v3.1.0*
|
|
228
|
+
|
|
229
|
+
Immersive 3D loaders with perspective transforms:
|
|
230
|
+
|
|
231
|
+
- **CubeSpinner** - Rotating 3D cube with customizable faces and rotation axes (x, y, z, diagonal)
|
|
232
|
+
- **FlipCard** - 3D card flip animation with horizontal/vertical modes
|
|
233
|
+
- **PlaneRotate** - Multiple rotating planes in 3D space with synchronized/staggered modes
|
|
234
|
+
- **Helix** - DNA-like spiral animation with particles and optional connecting lines
|
|
235
|
+
- **PerspectiveRing** - 3D ring with tilt angle, shadow effects, and depth perception
|
|
236
|
+
|
|
237
|
+
### Smart Components (3 components) ✨ *New in v3.1.0*
|
|
238
|
+
|
|
239
|
+
Intelligent, context-aware loading placeholders:
|
|
240
|
+
|
|
241
|
+
- **SmartSkeleton** - Auto-detecting skeleton that analyzes content type (text, image, card, list, table, form)
|
|
242
|
+
- **FormFieldLoader** - Loading states for form inputs (text, select, checkbox, radio, textarea, file)
|
|
243
|
+
- **DataTableSkeleton** - Advanced table skeleton with headers, sorting, filtering, pagination, and selection
|
|
244
|
+
|
|
245
|
+
### Accessibility Components (1 component) ✨ *New in v3.1.0*
|
|
246
|
+
|
|
247
|
+
Screen reader support and ARIA announcements:
|
|
248
|
+
|
|
249
|
+
- **LiveRegion** - ARIA live region for screen reader announcements with configurable politeness levels
|
|
250
|
+
|
|
251
|
+
## Hooks
|
|
252
|
+
|
|
253
|
+
### Loading State Management
|
|
254
|
+
|
|
255
|
+
- **useLoader** - Basic loading state with delay, minDuration, and autoHide *(v2.1.0+)*
|
|
256
|
+
- **useEnhancedLoader** - Advanced loading with retry logic, success/error states, and history *(v2.3.0+)*
|
|
257
|
+
- **useLoadingOrchestrator** - Manage multiple loading tasks with dependencies ✨ *New in v3.1.0*
|
|
258
|
+
- **useLoadingAnalytics** - Track loading performance metrics and user experience ✨ *New in v3.1.0*
|
|
259
|
+
- **useSmartLoader** - Intelligent loader with connection detection and progress estimation ✨ *New in v3.1.0*
|
|
260
|
+
|
|
261
|
+
### Theming
|
|
262
|
+
|
|
263
|
+
- **useTheme** - Access global theme configuration *(v2.1.0+)*
|
|
264
|
+
|
|
223
265
|
## Usage Examples
|
|
224
266
|
|
|
225
267
|
### Skeleton Components
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CubeSpinnerProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* CubeSpinner - 3D rotating cube loader with perspective
|
|
4
|
+
*
|
|
5
|
+
* A visually striking 3D cube that rotates in space with customizable face colors,
|
|
6
|
+
* rotation axis, and optional wireframe edges.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <CubeSpinner size={60} />
|
|
11
|
+
* <CubeSpinner size="lg" rotationAxis="diagonal" />
|
|
12
|
+
* <CubeSpinner
|
|
13
|
+
* size={80}
|
|
14
|
+
* faceColors={['#ef4444', '#f59e0b', '#10b981', '#3b82f6', '#8b5cf6', '#ec4899']}
|
|
15
|
+
* showEdges
|
|
16
|
+
* edgeColor="#000000"
|
|
17
|
+
* />
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare const CubeSpinner: import('react').ForwardRefExoticComponent<CubeSpinnerProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
21
|
+
//# sourceMappingURL=CubeSpinner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeSpinner.d.ts","sourceRoot":"","sources":["../../../src/components/3d/CubeSpinner.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAS/C;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,WAAW,6GA0JvB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FlipCardProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* FlipCard - 3D card flip loader
|
|
4
|
+
*
|
|
5
|
+
* A card that flips between front and back faces in 3D space,
|
|
6
|
+
* with customizable colors and flip direction.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <FlipCard width={100} height={60} />
|
|
11
|
+
* <FlipCard
|
|
12
|
+
* width={120}
|
|
13
|
+
* height={80}
|
|
14
|
+
* direction="vertical"
|
|
15
|
+
* frontColor="#3b82f6"
|
|
16
|
+
* backColor="#8b5cf6"
|
|
17
|
+
* />
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare const FlipCard: import('react').ForwardRefExoticComponent<FlipCardProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
21
|
+
//# sourceMappingURL=FlipCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlipCard.d.ts","sourceRoot":"","sources":["../../../src/components/3d/FlipCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAS5C;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,QAAQ,0GAsGpB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HelixProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Helix - DNA-like spiral loader with 3D depth
|
|
4
|
+
*
|
|
5
|
+
* Creates a mesmerizing helix/spiral animation with particles rotating
|
|
6
|
+
* in a 3D spiral pattern, reminiscent of DNA structure.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <Helix size={80} />
|
|
11
|
+
* <Helix
|
|
12
|
+
* size={100}
|
|
13
|
+
* particleCount={16}
|
|
14
|
+
* radius={30}
|
|
15
|
+
* height={120}
|
|
16
|
+
* turns={2}
|
|
17
|
+
* direction="down"
|
|
18
|
+
* showLines
|
|
19
|
+
* />
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare const Helix: import('react').ForwardRefExoticComponent<HelixProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
23
|
+
//# sourceMappingURL=Helix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Helix.d.ts","sourceRoot":"","sources":["../../../src/components/3d/Helix.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAUzC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,KAAK,uGA4IjB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PerspectiveRingProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* PerspectiveRing - 3D ring with perspective and shadow
|
|
4
|
+
*
|
|
5
|
+
* A ring that appears to rotate in 3D space with adjustable tilt,
|
|
6
|
+
* creating depth perception with optional shadow effects.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <PerspectiveRing size={80} />
|
|
11
|
+
* <PerspectiveRing
|
|
12
|
+
* size={100}
|
|
13
|
+
* tilt={60}
|
|
14
|
+
* thickness={8}
|
|
15
|
+
* showShadow
|
|
16
|
+
* segments={12}
|
|
17
|
+
* />
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare const PerspectiveRing: import('react').ForwardRefExoticComponent<PerspectiveRingProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
21
|
+
//# sourceMappingURL=PerspectiveRing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PerspectiveRing.d.ts","sourceRoot":"","sources":["../../../src/components/3d/PerspectiveRing.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AASnD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,eAAe,iHA6G3B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PlaneRotateProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* PlaneRotate - Multiple rotating planes in 3D space
|
|
4
|
+
*
|
|
5
|
+
* Creates a mesmerizing effect with multiple semi-transparent planes
|
|
6
|
+
* rotating in 3D space with different timing patterns.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <PlaneRotate size={60} />
|
|
11
|
+
* <PlaneRotate
|
|
12
|
+
* size={80}
|
|
13
|
+
* planeCount={4}
|
|
14
|
+
* rotationType="staggered"
|
|
15
|
+
* spacing={8}
|
|
16
|
+
* opacity={0.7}
|
|
17
|
+
* />
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare const PlaneRotate: import('react').ForwardRefExoticComponent<PlaneRotateProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
21
|
+
//# sourceMappingURL=PlaneRotate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlaneRotate.d.ts","sourceRoot":"","sources":["../../../src/components/3d/PlaneRotate.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAS/C;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,WAAW,6GAkHvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/3d/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { LiveRegionProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* LiveRegion - Accessible announcements for screen readers
|
|
4
|
+
*
|
|
5
|
+
* An ARIA live region that announces messages to screen readers without
|
|
6
|
+
* disrupting the visual interface. Useful for loading state updates,
|
|
7
|
+
* progress announcements, and status changes.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* // Polite announcement (waits for user to finish current task)
|
|
12
|
+
* <LiveRegion
|
|
13
|
+
* message="Loading data..."
|
|
14
|
+
* politeness="polite"
|
|
15
|
+
* clearAfter={3000}
|
|
16
|
+
* />
|
|
17
|
+
*
|
|
18
|
+
* // Assertive announcement (interrupts immediately)
|
|
19
|
+
* <LiveRegion
|
|
20
|
+
* message="Error: Failed to load data"
|
|
21
|
+
* politeness="assertive"
|
|
22
|
+
* atomic
|
|
23
|
+
* />
|
|
24
|
+
*
|
|
25
|
+
* // Progress updates
|
|
26
|
+
* <LiveRegion
|
|
27
|
+
* message={`Loading ${progress}% complete`}
|
|
28
|
+
* politeness="polite"
|
|
29
|
+
* clearAfter={1000}
|
|
30
|
+
* />
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare const LiveRegion: import('react').ForwardRefExoticComponent<LiveRegionProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
34
|
+
//# sourceMappingURL=LiveRegion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveRegion.d.ts","sourceRoot":"","sources":["../../../src/components/accessibility/LiveRegion.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,UAAU,4GAwDtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/accessibility/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -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;AAG1B,cAAc,UAAU,CAAC;AAGzB,cAAc,UAAU,CAAC;AAGzB,cAAc,cAAc,CAAC;AAG7B,cAAc,WAAW,CAAC;AAG1B,cAAc,SAAS,CAAC;AAGxB,cAAc,UAAU,CAAC;AAGzB,cAAc,YAAY,CAAC;AAG3B,cAAc,QAAQ,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;AAG7B,cAAc,WAAW,CAAC;AAG1B,cAAc,SAAS,CAAC;AAGxB,cAAc,UAAU,CAAC;AAGzB,cAAc,YAAY,CAAC;AAG3B,cAAc,QAAQ,CAAC;AAGvB,cAAc,MAAM,CAAC;AAGrB,cAAc,SAAS,CAAC;AAGxB,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DataTableSkeletonProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* DataTableSkeleton - Advanced table skeleton with features
|
|
4
|
+
*
|
|
5
|
+
* Comprehensive table loading placeholder with support for headers, sorting,
|
|
6
|
+
* filtering, pagination, row selection, and action columns.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <DataTableSkeleton rows={5} columns={4} />
|
|
11
|
+
* <DataTableSkeleton
|
|
12
|
+
* rows={10}
|
|
13
|
+
* columns={6}
|
|
14
|
+
* showHeader
|
|
15
|
+
* showSortIndicators
|
|
16
|
+
* showFilters
|
|
17
|
+
* showPagination
|
|
18
|
+
* showSelection
|
|
19
|
+
* showActions
|
|
20
|
+
* striped
|
|
21
|
+
* />
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare const DataTableSkeleton: import('react').ForwardRefExoticComponent<DataTableSkeletonProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
25
|
+
//# sourceMappingURL=DataTableSkeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataTableSkeleton.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton/DataTableSkeleton.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAIrD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,iBAAiB,mHA4R7B,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SmartSkeletonProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* SmartSkeleton - Intelligent skeleton with auto-detection
|
|
4
|
+
*
|
|
5
|
+
* Automatically detects content layout and generates appropriate skeleton variant,
|
|
6
|
+
* or uses explicit content type for predictable rendering.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* // Explicit content type
|
|
11
|
+
* <SmartSkeleton contentType="card" />
|
|
12
|
+
* <SmartSkeleton contentType="table" itemCount={5} />
|
|
13
|
+
*
|
|
14
|
+
* // Auto-detection from reference element
|
|
15
|
+
* <SmartSkeleton
|
|
16
|
+
* contentType="auto"
|
|
17
|
+
* referenceElement={containerRef.current}
|
|
18
|
+
* detectionStrategy="mixed"
|
|
19
|
+
* />
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare const SmartSkeleton: import('react').ForwardRefExoticComponent<SmartSkeletonProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
23
|
+
//# sourceMappingURL=SmartSkeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SmartSkeleton.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton/SmartSkeleton.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAQjD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,aAAa,+GAkKzB,CAAC"}
|
|
@@ -7,4 +7,6 @@ export { SkeletonList } from './SkeletonList';
|
|
|
7
7
|
export { SkeletonTable } from './SkeletonTable';
|
|
8
8
|
export { SkeletonPage } from './SkeletonPage';
|
|
9
9
|
export { SkeletonForm } from './SkeletonForm';
|
|
10
|
+
export { SmartSkeleton } from './SmartSkeleton';
|
|
11
|
+
export { DataTableSkeleton } from './DataTableSkeleton';
|
|
10
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FormFieldLoaderProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* FormFieldLoader - Loading state for form inputs
|
|
4
|
+
*
|
|
5
|
+
* Specialized loader for form fields that maintains layout during loading,
|
|
6
|
+
* with support for various input types, labels, and validation messages.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <FormFieldLoader fieldType="text" showLabel showRequired />
|
|
11
|
+
* <FormFieldLoader
|
|
12
|
+
* fieldType="select"
|
|
13
|
+
* labelWidth={120}
|
|
14
|
+
* fieldWidth="100%"
|
|
15
|
+
* showLabel
|
|
16
|
+
* showValidation
|
|
17
|
+
* />
|
|
18
|
+
* <FormFieldLoader fieldType="textarea" fieldHeight={120} />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare const FormFieldLoader: import('react').ForwardRefExoticComponent<FormFieldLoaderProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
22
|
+
//# sourceMappingURL=FormFieldLoader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormFieldLoader.d.ts","sourceRoot":"","sources":["../../../src/components/smart/FormFieldLoader.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAInD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,eAAe,iHAyK3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/smart/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
export { useLoader } from './useLoader';
|
|
2
2
|
export { useEnhancedLoader } from './useEnhancedLoader';
|
|
3
|
+
export { useLoadingOrchestrator } from './useLoadingOrchestrator';
|
|
4
|
+
export { useLoadingAnalytics } from './useLoadingAnalytics';
|
|
5
|
+
export { useSmartLoader } from './useSmartLoader';
|
|
3
6
|
export type { UseLoaderOptions as BasicUseLoaderOptions, UseLoaderReturn as BasicUseLoaderReturn } from './useLoader';
|
|
4
7
|
export type { UseLoaderOptions, UseLoaderReturn, LoadingStatus, LoadingHistoryEntry, RetryConfig } from '../types/hooks';
|
|
8
|
+
export type { LoadingTask, LoadingTaskStatus, OrchestratorOptions, UseLoadingOrchestratorReturn, } from './useLoadingOrchestrator';
|
|
9
|
+
export type { LoadingSession, LoadingMetrics, AnalyticsOptions, UseLoadingAnalyticsReturn, } from './useLoadingAnalytics';
|
|
10
|
+
export type { ConnectionSpeed, SmartLoaderOptions, UseSmartLoaderReturn, } from './useSmartLoader';
|
|
5
11
|
//# 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,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,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;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,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;AACzH,YAAY,EACV,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,4BAA4B,GAC7B,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,eAAe,EACf,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
export interface LoadingSession {
|
|
2
|
+
/** Session start timestamp */
|
|
3
|
+
startTime: number;
|
|
4
|
+
/** Session end timestamp */
|
|
5
|
+
endTime?: number;
|
|
6
|
+
/** Duration in milliseconds */
|
|
7
|
+
duration?: number;
|
|
8
|
+
/** Whether the loading was successful */
|
|
9
|
+
success?: boolean;
|
|
10
|
+
/** Whether the user abandoned (navigated away) */
|
|
11
|
+
abandoned?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface LoadingMetrics {
|
|
14
|
+
/** Total number of loading sessions */
|
|
15
|
+
totalSessions: number;
|
|
16
|
+
/** Average loading duration in milliseconds */
|
|
17
|
+
averageDuration: number;
|
|
18
|
+
/** Longest loading time in milliseconds */
|
|
19
|
+
maxDuration: number;
|
|
20
|
+
/** Shortest loading time in milliseconds */
|
|
21
|
+
minDuration: number;
|
|
22
|
+
/** Success rate (0-1) */
|
|
23
|
+
successRate: number;
|
|
24
|
+
/** User abandonment rate (0-1) */
|
|
25
|
+
abandonmentRate: number;
|
|
26
|
+
/** All sessions data */
|
|
27
|
+
sessions: LoadingSession[];
|
|
28
|
+
}
|
|
29
|
+
export interface AnalyticsOptions {
|
|
30
|
+
/** Track user interactions during loading */
|
|
31
|
+
trackInteractions?: boolean;
|
|
32
|
+
/** Callback when metrics are updated */
|
|
33
|
+
onMetricsUpdate?: (metrics: LoadingMetrics) => void;
|
|
34
|
+
/** Local storage key for persisting metrics */
|
|
35
|
+
storageKey?: string;
|
|
36
|
+
/** Maximum number of sessions to store */
|
|
37
|
+
maxSessions?: number;
|
|
38
|
+
}
|
|
39
|
+
export interface UseLoadingAnalyticsReturn {
|
|
40
|
+
/** Current metrics */
|
|
41
|
+
metrics: LoadingMetrics;
|
|
42
|
+
/** Start tracking a loading session */
|
|
43
|
+
startTracking: () => void;
|
|
44
|
+
/** Stop tracking and mark as success or failure */
|
|
45
|
+
stopTracking: (success: boolean) => void;
|
|
46
|
+
/** Record user abandonment */
|
|
47
|
+
recordAbandonment: () => void;
|
|
48
|
+
/** Clear all metrics */
|
|
49
|
+
clearMetrics: () => void;
|
|
50
|
+
/** Export metrics as JSON */
|
|
51
|
+
exportMetrics: () => LoadingMetrics;
|
|
52
|
+
/** Whether currently tracking */
|
|
53
|
+
isTracking: boolean;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* useLoadingAnalytics - Track loading performance and user experience
|
|
57
|
+
*
|
|
58
|
+
* Monitors loading sessions, calculates performance metrics, and tracks user behavior
|
|
59
|
+
* like abandonment. Useful for optimizing loading UX and identifying bottlenecks.
|
|
60
|
+
*
|
|
61
|
+
* @param options - Configuration options
|
|
62
|
+
* @returns Metrics and tracking control functions
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```tsx
|
|
66
|
+
* function AnalyticsDemo() {
|
|
67
|
+
* const {
|
|
68
|
+
* metrics,
|
|
69
|
+
* startTracking,
|
|
70
|
+
* stopTracking,
|
|
71
|
+
* isTracking,
|
|
72
|
+
* } = useLoadingAnalytics({
|
|
73
|
+
* storageKey: 'my-app-loading-metrics',
|
|
74
|
+
* onMetricsUpdate: (metrics) => {
|
|
75
|
+
* console.log('Average load time:', metrics.averageDuration, 'ms');
|
|
76
|
+
* console.log('Success rate:', (metrics.successRate * 100).toFixed(1), '%');
|
|
77
|
+
* },
|
|
78
|
+
* });
|
|
79
|
+
*
|
|
80
|
+
* const loadData = async () => {
|
|
81
|
+
* startTracking();
|
|
82
|
+
* try {
|
|
83
|
+
* await fetchData();
|
|
84
|
+
* stopTracking(true);
|
|
85
|
+
* } catch (error) {
|
|
86
|
+
* stopTracking(false);
|
|
87
|
+
* }
|
|
88
|
+
* };
|
|
89
|
+
*
|
|
90
|
+
* return (
|
|
91
|
+
* <div>
|
|
92
|
+
* <p>Total sessions: {metrics.totalSessions}</p>
|
|
93
|
+
* <p>Avg duration: {metrics.averageDuration.toFixed(0)}ms</p>
|
|
94
|
+
* <p>Success rate: {(metrics.successRate * 100).toFixed(1)}%</p>
|
|
95
|
+
* </div>
|
|
96
|
+
* );
|
|
97
|
+
* }
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
export declare function useLoadingAnalytics(options?: AnalyticsOptions): UseLoadingAnalyticsReturn;
|
|
101
|
+
//# sourceMappingURL=useLoadingAnalytics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLoadingAnalytics.d.ts","sourceRoot":"","sources":["../../src/hooks/useLoadingAnalytics.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,cAAc;IAC7B,8BAA8B;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kDAAkD;IAClD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,uCAAuC;IACvC,aAAa,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,eAAe,EAAE,MAAM,CAAC;IACxB,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,yBAAyB;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,eAAe,EAAE,MAAM,CAAC;IACxB,wBAAwB;IACxB,QAAQ,EAAE,cAAc,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B,6CAA6C;IAC7C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,wCAAwC;IACxC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IACpD,+CAA+C;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,yBAAyB;IACxC,sBAAsB;IACtB,OAAO,EAAE,cAAc,CAAC;IACxB,uCAAuC;IACvC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,mDAAmD;IACnD,YAAY,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,8BAA8B;IAC9B,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,wBAAwB;IACxB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,6BAA6B;IAC7B,aAAa,EAAE,MAAM,cAAc,CAAC;IACpC,iCAAiC;IACjC,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,GAAE,gBAAqB,GAC7B,yBAAyB,CA0L3B"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export type LoadingTaskStatus = 'pending' | 'loading' | 'success' | 'error';
|
|
2
|
+
export interface LoadingTask {
|
|
3
|
+
/** Unique identifier for the task */
|
|
4
|
+
id: string;
|
|
5
|
+
/** Human-readable label */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Current status */
|
|
8
|
+
status: LoadingTaskStatus;
|
|
9
|
+
/** Task dependencies (IDs of tasks that must complete first) */
|
|
10
|
+
dependsOn?: string[];
|
|
11
|
+
/** Progress percentage (0-100) */
|
|
12
|
+
progress?: number;
|
|
13
|
+
/** Error object if task failed */
|
|
14
|
+
error?: Error;
|
|
15
|
+
}
|
|
16
|
+
export interface OrchestratorOptions {
|
|
17
|
+
/** Execution mode: parallel or sequential */
|
|
18
|
+
mode?: 'parallel' | 'sequential';
|
|
19
|
+
/** Stop all tasks on first error */
|
|
20
|
+
stopOnError?: boolean;
|
|
21
|
+
/** Callback when a task starts */
|
|
22
|
+
onTaskStart?: (taskId: string) => void;
|
|
23
|
+
/** Callback when a task completes successfully */
|
|
24
|
+
onTaskComplete?: (taskId: string) => void;
|
|
25
|
+
/** Callback when a task fails */
|
|
26
|
+
onTaskError?: (taskId: string, error: Error) => void;
|
|
27
|
+
/** Callback when all tasks complete */
|
|
28
|
+
onAllComplete?: () => void;
|
|
29
|
+
}
|
|
30
|
+
export interface UseLoadingOrchestratorReturn {
|
|
31
|
+
/** Current state of all tasks */
|
|
32
|
+
tasks: LoadingTask[];
|
|
33
|
+
/** Start a specific task */
|
|
34
|
+
startTask: (taskId: string) => Promise<void>;
|
|
35
|
+
/** Mark a task as complete */
|
|
36
|
+
completeTask: (taskId: string) => void;
|
|
37
|
+
/** Mark a task as failed */
|
|
38
|
+
failTask: (taskId: string, error: Error) => void;
|
|
39
|
+
/** Update progress for a task */
|
|
40
|
+
updateProgress: (taskId: string, progress: number) => void;
|
|
41
|
+
/** Reset all tasks to pending */
|
|
42
|
+
resetTasks: () => void;
|
|
43
|
+
/** Overall progress (0-100) */
|
|
44
|
+
overallProgress: number;
|
|
45
|
+
/** Whether all tasks are complete */
|
|
46
|
+
allComplete: boolean;
|
|
47
|
+
/** Whether any task has errors */
|
|
48
|
+
hasErrors: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* useLoadingOrchestrator - Manage multiple loading states with dependencies
|
|
52
|
+
*
|
|
53
|
+
* Coordinates multiple loading tasks with dependency management, progress tracking,
|
|
54
|
+
* and execution control (parallel or sequential).
|
|
55
|
+
*
|
|
56
|
+
* @param initialTasks - Array of loading tasks
|
|
57
|
+
* @param options - Configuration options
|
|
58
|
+
* @returns Task state and control functions
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```tsx
|
|
62
|
+
* function DataLoader() {
|
|
63
|
+
* const {
|
|
64
|
+
* tasks,
|
|
65
|
+
* startTask,
|
|
66
|
+
* completeTask,
|
|
67
|
+
* failTask,
|
|
68
|
+
* updateProgress,
|
|
69
|
+
* overallProgress,
|
|
70
|
+
* } = useLoadingOrchestrator(
|
|
71
|
+
* [
|
|
72
|
+
* { id: 'auth', label: 'Authenticating...', status: 'pending' },
|
|
73
|
+
* { id: 'data', label: 'Fetching data...', status: 'pending', dependsOn: ['auth'] },
|
|
74
|
+
* { id: 'render', label: 'Rendering...', status: 'pending', dependsOn: ['data'] },
|
|
75
|
+
* ],
|
|
76
|
+
* {
|
|
77
|
+
* mode: 'sequential',
|
|
78
|
+
* onAllComplete: () => console.log('All done!'),
|
|
79
|
+
* }
|
|
80
|
+
* );
|
|
81
|
+
*
|
|
82
|
+
* const loadAll = async () => {
|
|
83
|
+
* await startTask('auth');
|
|
84
|
+
* // ... perform auth
|
|
85
|
+
* completeTask('auth');
|
|
86
|
+
*
|
|
87
|
+
* await startTask('data');
|
|
88
|
+
* // ... fetch data
|
|
89
|
+
* completeTask('data');
|
|
90
|
+
* };
|
|
91
|
+
*
|
|
92
|
+
* return (
|
|
93
|
+
* <div>
|
|
94
|
+
* <ProgressBar value={overallProgress} />
|
|
95
|
+
* {tasks.map(task => (
|
|
96
|
+
* <div key={task.id}>{task.label}: {task.status}</div>
|
|
97
|
+
* ))}
|
|
98
|
+
* </div>
|
|
99
|
+
* );
|
|
100
|
+
* }
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
export declare function useLoadingOrchestrator(initialTasks: LoadingTask[], options?: OrchestratorOptions): UseLoadingOrchestratorReturn;
|
|
104
|
+
//# sourceMappingURL=useLoadingOrchestrator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLoadingOrchestrator.d.ts","sourceRoot":"","sources":["../../src/hooks/useLoadingOrchestrator.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAE5E,MAAM,WAAW,WAAW;IAC1B,qCAAqC;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kCAAkC;IAClC,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,6CAA6C;IAC7C,IAAI,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACjC,oCAAoC;IACpC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kCAAkC;IAClC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,kDAAkD;IAClD,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,iCAAiC;IACjC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACrD,uCAAuC;IACvC,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,4BAA4B;IAC3C,iCAAiC;IACjC,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,4BAA4B;IAC5B,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,8BAA8B;IAC9B,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,4BAA4B;IAC5B,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjD,iCAAiC;IACjC,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,iCAAiC;IACjC,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,+BAA+B;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,qCAAqC;IACrC,WAAW,EAAE,OAAO,CAAC;IACrB,kCAAkC;IAClC,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,WAAW,EAAE,EAC3B,OAAO,GAAE,mBAAwB,GAChC,4BAA4B,CA0J9B"}
|