premium-react-loaders 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/LICENSE +21 -0
- package/README.md +375 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/progress/ProgressBar.d.ts +15 -0
- package/dist/components/progress/ProgressBar.d.ts.map +1 -0
- package/dist/components/progress/ProgressCircle.d.ts +15 -0
- package/dist/components/progress/ProgressCircle.d.ts.map +1 -0
- package/dist/components/progress/ProgressRing.d.ts +15 -0
- package/dist/components/progress/ProgressRing.d.ts.map +1 -0
- package/dist/components/progress/index.d.ts +4 -0
- package/dist/components/progress/index.d.ts.map +1 -0
- package/dist/components/pulse/PulseBars.d.ts +14 -0
- package/dist/components/pulse/PulseBars.d.ts.map +1 -0
- package/dist/components/pulse/PulseDots.d.ts +14 -0
- package/dist/components/pulse/PulseDots.d.ts.map +1 -0
- package/dist/components/pulse/PulseWave.d.ts +14 -0
- package/dist/components/pulse/PulseWave.d.ts.map +1 -0
- package/dist/components/pulse/index.d.ts +4 -0
- package/dist/components/pulse/index.d.ts.map +1 -0
- package/dist/components/skeleton/Skeleton.d.ts +15 -0
- package/dist/components/skeleton/Skeleton.d.ts.map +1 -0
- package/dist/components/skeleton/SkeletonAvatar.d.ts +14 -0
- package/dist/components/skeleton/SkeletonAvatar.d.ts.map +1 -0
- package/dist/components/skeleton/SkeletonCard.d.ts +15 -0
- package/dist/components/skeleton/SkeletonCard.d.ts.map +1 -0
- package/dist/components/skeleton/SkeletonImage.d.ts +14 -0
- package/dist/components/skeleton/SkeletonImage.d.ts.map +1 -0
- package/dist/components/skeleton/SkeletonList.d.ts +14 -0
- package/dist/components/skeleton/SkeletonList.d.ts.map +1 -0
- package/dist/components/skeleton/SkeletonTable.d.ts +14 -0
- package/dist/components/skeleton/SkeletonTable.d.ts.map +1 -0
- package/dist/components/skeleton/SkeletonText.d.ts +14 -0
- package/dist/components/skeleton/SkeletonText.d.ts.map +1 -0
- package/dist/components/skeleton/index.d.ts +8 -0
- package/dist/components/skeleton/index.d.ts.map +1 -0
- package/dist/components/spinner/SpinnerBars.d.ts +14 -0
- package/dist/components/spinner/SpinnerBars.d.ts.map +1 -0
- package/dist/components/spinner/SpinnerCircle.d.ts +14 -0
- package/dist/components/spinner/SpinnerCircle.d.ts.map +1 -0
- package/dist/components/spinner/SpinnerDots.d.ts +14 -0
- package/dist/components/spinner/SpinnerDots.d.ts.map +1 -0
- package/dist/components/spinner/SpinnerGrid.d.ts +14 -0
- package/dist/components/spinner/SpinnerGrid.d.ts.map +1 -0
- package/dist/components/spinner/SpinnerRing.d.ts +14 -0
- package/dist/components/spinner/SpinnerRing.d.ts.map +1 -0
- package/dist/components/spinner/index.d.ts +6 -0
- package/dist/components/spinner/index.d.ts.map +1 -0
- package/dist/index.cjs +47 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/dist/index10.cjs +58 -0
- package/dist/index10.cjs.map +1 -0
- package/dist/index10.js +58 -0
- package/dist/index10.js.map +1 -0
- package/dist/index11.cjs +55 -0
- package/dist/index11.cjs.map +1 -0
- package/dist/index11.js +55 -0
- package/dist/index11.js.map +1 -0
- package/dist/index12.cjs +63 -0
- package/dist/index12.cjs.map +1 -0
- package/dist/index12.js +63 -0
- package/dist/index12.js.map +1 -0
- package/dist/index13.cjs +51 -0
- package/dist/index13.cjs.map +1 -0
- package/dist/index13.js +51 -0
- package/dist/index13.js.map +1 -0
- package/dist/index14.cjs +74 -0
- package/dist/index14.cjs.map +1 -0
- package/dist/index14.js +74 -0
- package/dist/index14.js.map +1 -0
- package/dist/index15.cjs +58 -0
- package/dist/index15.cjs.map +1 -0
- package/dist/index15.js +58 -0
- package/dist/index15.js.map +1 -0
- package/dist/index16.cjs +71 -0
- package/dist/index16.cjs.map +1 -0
- package/dist/index16.js +71 -0
- package/dist/index16.js.map +1 -0
- package/dist/index17.cjs +81 -0
- package/dist/index17.cjs.map +1 -0
- package/dist/index17.js +81 -0
- package/dist/index17.js.map +1 -0
- package/dist/index18.cjs +107 -0
- package/dist/index18.cjs.map +1 -0
- package/dist/index18.js +107 -0
- package/dist/index18.js.map +1 -0
- package/dist/index19.cjs +113 -0
- package/dist/index19.cjs.map +1 -0
- package/dist/index19.js +113 -0
- package/dist/index19.js.map +1 -0
- package/dist/index20.cjs +57 -0
- package/dist/index20.cjs.map +1 -0
- package/dist/index20.js +57 -0
- package/dist/index20.js.map +1 -0
- package/dist/index21.cjs +62 -0
- package/dist/index21.cjs.map +1 -0
- package/dist/index21.js +62 -0
- package/dist/index21.js.map +1 -0
- package/dist/index22.cjs +64 -0
- package/dist/index22.cjs.map +1 -0
- package/dist/index22.js +64 -0
- package/dist/index22.js.map +1 -0
- package/dist/index23.cjs +18 -0
- package/dist/index23.cjs.map +1 -0
- package/dist/index23.js +18 -0
- package/dist/index23.js.map +1 -0
- package/dist/index3.cjs +8 -0
- package/dist/index3.cjs.map +1 -0
- package/dist/index3.js +8 -0
- package/dist/index3.js.map +1 -0
- package/dist/index4.cjs +22 -0
- package/dist/index4.cjs.map +1 -0
- package/dist/index4.js +22 -0
- package/dist/index4.js.map +1 -0
- package/dist/index5.cjs +65 -0
- package/dist/index5.cjs.map +1 -0
- package/dist/index5.js +65 -0
- package/dist/index5.js.map +1 -0
- package/dist/index6.cjs +59 -0
- package/dist/index6.cjs.map +1 -0
- package/dist/index6.js +59 -0
- package/dist/index6.js.map +1 -0
- package/dist/index7.cjs +43 -0
- package/dist/index7.cjs.map +1 -0
- package/dist/index7.js +43 -0
- package/dist/index7.js.map +1 -0
- package/dist/index8.cjs +47 -0
- package/dist/index8.cjs.map +1 -0
- package/dist/index8.js +47 -0
- package/dist/index8.js.map +1 -0
- package/dist/index9.cjs +77 -0
- package/dist/index9.cjs.map +1 -0
- package/dist/index9.js +77 -0
- package/dist/index9.js.map +1 -0
- package/dist/premium-react-loaders.css +701 -0
- package/dist/types/common.d.ts +65 -0
- package/dist/types/common.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/progress.d.ts +25 -0
- package/dist/types/progress.d.ts.map +1 -0
- package/dist/types/pulse.d.ts +25 -0
- package/dist/types/pulse.d.ts.map +1 -0
- package/dist/types/skeleton.d.ts +71 -0
- package/dist/types/skeleton.d.ts.map +1 -0
- package/dist/types/spinner.d.ts +39 -0
- package/dist/types/spinner.d.ts.map +1 -0
- package/dist/utils/classNames.d.ts +14 -0
- package/dist/utils/classNames.d.ts.map +1 -0
- package/dist/utils/colors.d.ts +25 -0
- package/dist/utils/colors.d.ts.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/package.json +89 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Ishan Karunaratne
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
# Premium React Loaders
|
|
2
|
+
|
|
3
|
+
A comprehensive collection of **18 premium, production-ready loading components** for React applications. Built with TypeScript and Tailwind CSS for maximum flexibility and customization.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/premium-react-loaders)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
- **18 Premium Components** across 4 categories (Skeleton, Spinner, Progress, Pulse)
|
|
11
|
+
- **Full TypeScript Support** with exported type definitions
|
|
12
|
+
- **Tailwind CSS Integration** for easy customization
|
|
13
|
+
- **Tree-shakeable** - only bundle what you use
|
|
14
|
+
- **Accessible** - built with ARIA labels and best practices
|
|
15
|
+
- **Performant** - hardware-accelerated CSS animations (60fps)
|
|
16
|
+
- **Customizable** - multiple ways to style components
|
|
17
|
+
- **Zero Dependencies** (except peer dependencies)
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install premium-react-loaders
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Peer Dependencies
|
|
26
|
+
|
|
27
|
+
This library requires React and Tailwind CSS:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install react react-dom tailwindcss
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Setup
|
|
34
|
+
|
|
35
|
+
### 1. Import Styles
|
|
36
|
+
|
|
37
|
+
Import the styles in your main entry file (e.g., `main.tsx` or `App.tsx`):
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
import 'premium-react-loaders/styles';
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### 2. Configure Tailwind
|
|
44
|
+
|
|
45
|
+
Add the library to your `tailwind.config.js` content array:
|
|
46
|
+
|
|
47
|
+
```javascript
|
|
48
|
+
module.exports = {
|
|
49
|
+
content: [
|
|
50
|
+
'./src/**/*.{js,ts,jsx,tsx}',
|
|
51
|
+
'./node_modules/premium-react-loaders/dist/**/*.{js,ts,jsx,tsx}',
|
|
52
|
+
],
|
|
53
|
+
// ... rest of your config
|
|
54
|
+
};
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Quick Start
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
import {
|
|
61
|
+
Skeleton,
|
|
62
|
+
SkeletonCard,
|
|
63
|
+
SpinnerCircle,
|
|
64
|
+
ProgressBar,
|
|
65
|
+
PulseDots,
|
|
66
|
+
} from 'premium-react-loaders';
|
|
67
|
+
|
|
68
|
+
function App() {
|
|
69
|
+
return (
|
|
70
|
+
<div>
|
|
71
|
+
{/* Skeleton Loaders */}
|
|
72
|
+
<Skeleton width={200} height={20} />
|
|
73
|
+
<SkeletonCard hasAvatar lines={3} />
|
|
74
|
+
|
|
75
|
+
{/* Spinners */}
|
|
76
|
+
<SpinnerCircle size={40} color="#3b82f6" />
|
|
77
|
+
|
|
78
|
+
{/* Progress Bars */}
|
|
79
|
+
<ProgressBar value={75} showValue />
|
|
80
|
+
|
|
81
|
+
{/* Pulse Loaders */}
|
|
82
|
+
<PulseDots dotCount={3} />
|
|
83
|
+
</div>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Component Categories
|
|
89
|
+
|
|
90
|
+
### Skeleton Loaders (7 components)
|
|
91
|
+
|
|
92
|
+
Placeholder components that mimic content layout while loading:
|
|
93
|
+
|
|
94
|
+
- **Skeleton** - Base skeleton component with variants
|
|
95
|
+
- **SkeletonText** - Multi-line text placeholder
|
|
96
|
+
- **SkeletonAvatar** - Avatar placeholder (circle/square)
|
|
97
|
+
- **SkeletonImage** - Image placeholder with aspect ratio
|
|
98
|
+
- **SkeletonCard** - Card layout with avatar + text
|
|
99
|
+
- **SkeletonList** - List of skeleton items
|
|
100
|
+
- **SkeletonTable** - Table skeleton with rows/columns
|
|
101
|
+
|
|
102
|
+
### Spinner Loaders (5 components)
|
|
103
|
+
|
|
104
|
+
Rotating and animated spinners:
|
|
105
|
+
|
|
106
|
+
- **SpinnerCircle** - Basic rotating circle spinner
|
|
107
|
+
- **SpinnerRing** - Border-only ring spinner
|
|
108
|
+
- **SpinnerDots** - Multiple dots rotating around center
|
|
109
|
+
- **SpinnerBars** - Vertical bars with wave animation
|
|
110
|
+
- **SpinnerGrid** - Grid of fading squares
|
|
111
|
+
|
|
112
|
+
### Progress Loaders (3 components)
|
|
113
|
+
|
|
114
|
+
Progress indicators (determinate/indeterminate):
|
|
115
|
+
|
|
116
|
+
- **ProgressBar** - Linear horizontal progress bar
|
|
117
|
+
- **ProgressCircle** - Circular progress indicator
|
|
118
|
+
- **ProgressRing** - Ring progress with gradient option
|
|
119
|
+
|
|
120
|
+
### Pulse Loaders (3 components)
|
|
121
|
+
|
|
122
|
+
Bouncing, pulsing, wave animations:
|
|
123
|
+
|
|
124
|
+
- **PulseDots** - Bouncing dots in sequence
|
|
125
|
+
- **PulseWave** - Wave pattern bars
|
|
126
|
+
- **PulseBars** - Equalizer-style pulsing bars
|
|
127
|
+
|
|
128
|
+
## Usage Examples
|
|
129
|
+
|
|
130
|
+
### Skeleton Components
|
|
131
|
+
|
|
132
|
+
```tsx
|
|
133
|
+
import {
|
|
134
|
+
Skeleton,
|
|
135
|
+
SkeletonText,
|
|
136
|
+
SkeletonAvatar,
|
|
137
|
+
SkeletonCard,
|
|
138
|
+
} from 'premium-react-loaders';
|
|
139
|
+
|
|
140
|
+
// Basic skeleton
|
|
141
|
+
<Skeleton width={200} height={20} />
|
|
142
|
+
|
|
143
|
+
// Multi-line text
|
|
144
|
+
<SkeletonText lines={3} width="100%" />
|
|
145
|
+
|
|
146
|
+
// Avatar
|
|
147
|
+
<SkeletonAvatar size={48} shape="circle" />
|
|
148
|
+
|
|
149
|
+
// Card with avatar and text
|
|
150
|
+
<SkeletonCard hasAvatar lines={3} />
|
|
151
|
+
|
|
152
|
+
// Custom colors
|
|
153
|
+
<Skeleton
|
|
154
|
+
width={200}
|
|
155
|
+
height={20}
|
|
156
|
+
baseColor="#e0e0e0"
|
|
157
|
+
highlightColor="#f5f5f5"
|
|
158
|
+
/>
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Spinner Components
|
|
162
|
+
|
|
163
|
+
```tsx
|
|
164
|
+
import {
|
|
165
|
+
SpinnerCircle,
|
|
166
|
+
SpinnerRing,
|
|
167
|
+
SpinnerDots,
|
|
168
|
+
} from 'premium-react-loaders';
|
|
169
|
+
|
|
170
|
+
// Basic spinner
|
|
171
|
+
<SpinnerCircle size={40} color="#3b82f6" />
|
|
172
|
+
|
|
173
|
+
// Ring spinner
|
|
174
|
+
<SpinnerRing size={32} thickness={4} />
|
|
175
|
+
|
|
176
|
+
// Dots spinner
|
|
177
|
+
<SpinnerDots size={40} dotCount={8} />
|
|
178
|
+
|
|
179
|
+
// Speed control
|
|
180
|
+
<SpinnerCircle size={40} speed="fast" />
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Progress Components
|
|
184
|
+
|
|
185
|
+
```tsx
|
|
186
|
+
import {
|
|
187
|
+
ProgressBar,
|
|
188
|
+
ProgressCircle,
|
|
189
|
+
ProgressRing,
|
|
190
|
+
} from 'premium-react-loaders';
|
|
191
|
+
|
|
192
|
+
// Determinate progress
|
|
193
|
+
<ProgressBar value={75} showValue />
|
|
194
|
+
|
|
195
|
+
// Indeterminate progress
|
|
196
|
+
<ProgressBar indeterminate />
|
|
197
|
+
|
|
198
|
+
// Circular progress
|
|
199
|
+
<ProgressCircle value={60} showValue size={80} />
|
|
200
|
+
|
|
201
|
+
// Ring with gradient
|
|
202
|
+
<ProgressRing
|
|
203
|
+
value={80}
|
|
204
|
+
gradient
|
|
205
|
+
color="#3b82f6"
|
|
206
|
+
secondaryColor="#8b5cf6"
|
|
207
|
+
/>
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Pulse Components
|
|
211
|
+
|
|
212
|
+
```tsx
|
|
213
|
+
import { PulseDots, PulseWave, PulseBars } from 'premium-react-loaders';
|
|
214
|
+
|
|
215
|
+
// Bouncing dots
|
|
216
|
+
<PulseDots dotCount={3} color="#3b82f6" />
|
|
217
|
+
|
|
218
|
+
// Wave pattern
|
|
219
|
+
<PulseWave barCount={5} />
|
|
220
|
+
|
|
221
|
+
// Equalizer bars
|
|
222
|
+
<PulseBars barCount={4} speed="fast" />
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
## Customization
|
|
226
|
+
|
|
227
|
+
All components support multiple customization methods:
|
|
228
|
+
|
|
229
|
+
### 1. className Prop
|
|
230
|
+
|
|
231
|
+
Pass Tailwind utility classes:
|
|
232
|
+
|
|
233
|
+
```tsx
|
|
234
|
+
<SpinnerCircle size={40} className="my-4 mx-auto" />
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### 2. style Prop
|
|
238
|
+
|
|
239
|
+
Use inline CSS styles:
|
|
240
|
+
|
|
241
|
+
```tsx
|
|
242
|
+
<ProgressBar value={75} style={{ opacity: 0.8, margin: '20px 0' }} />
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### 3. Color Props
|
|
246
|
+
|
|
247
|
+
Direct color control:
|
|
248
|
+
|
|
249
|
+
```tsx
|
|
250
|
+
<SpinnerCircle color="#8b5cf6" secondaryColor="#e0e0e0" />
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### 4. CSS Variables
|
|
254
|
+
|
|
255
|
+
Override theme variables globally:
|
|
256
|
+
|
|
257
|
+
```css
|
|
258
|
+
:root {
|
|
259
|
+
--loader-primary: #3b82f6;
|
|
260
|
+
--loader-secondary: #8b5cf6;
|
|
261
|
+
--skeleton-base: #e0e0e0;
|
|
262
|
+
--skeleton-highlight: #f5f5f5;
|
|
263
|
+
}
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
## TypeScript
|
|
267
|
+
|
|
268
|
+
Full TypeScript support with exported types:
|
|
269
|
+
|
|
270
|
+
```typescript
|
|
271
|
+
import type {
|
|
272
|
+
SkeletonProps,
|
|
273
|
+
SpinnerCircleProps,
|
|
274
|
+
ProgressBarProps,
|
|
275
|
+
PulseDotsProps,
|
|
276
|
+
} from 'premium-react-loaders';
|
|
277
|
+
|
|
278
|
+
const MyComponent: React.FC = () => {
|
|
279
|
+
const skeletonProps: SkeletonProps = {
|
|
280
|
+
width: 200,
|
|
281
|
+
height: 20,
|
|
282
|
+
animate: true,
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
return <Skeleton {...skeletonProps} />;
|
|
286
|
+
};
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
## Common Props
|
|
290
|
+
|
|
291
|
+
All loader components share these common props:
|
|
292
|
+
|
|
293
|
+
| Prop | Type | Default | Description |
|
|
294
|
+
|------|------|---------|-------------|
|
|
295
|
+
| `size` | `number \| string` | varies | Size of the loader |
|
|
296
|
+
| `color` | `string` | `#3b82f6` | Primary color |
|
|
297
|
+
| `className` | `string` | - | Custom CSS class |
|
|
298
|
+
| `style` | `CSSProperties` | - | Inline styles |
|
|
299
|
+
| `visible` | `boolean` | `true` | Show/hide loader |
|
|
300
|
+
| `speed` | `'slow' \| 'normal' \| 'fast' \| number` | `'normal'` | Animation speed |
|
|
301
|
+
| `testId` | `string` | - | Test ID for testing |
|
|
302
|
+
| `ariaLabel` | `string` | - | Accessibility label |
|
|
303
|
+
|
|
304
|
+
## Component-Specific Props
|
|
305
|
+
|
|
306
|
+
### Skeleton Props
|
|
307
|
+
|
|
308
|
+
| Prop | Type | Default | Description |
|
|
309
|
+
|------|------|---------|-------------|
|
|
310
|
+
| `width` | `number \| string` | `100%` | Width of skeleton |
|
|
311
|
+
| `height` | `number \| string` | `1rem` | Height of skeleton |
|
|
312
|
+
| `variant` | `'text' \| 'circular' \| 'rectangular' \| 'rounded'` | `'text'` | Shape variant |
|
|
313
|
+
| `animate` | `boolean` | `true` | Enable shimmer animation |
|
|
314
|
+
| `baseColor` | `string` | `#e0e0e0` | Background color |
|
|
315
|
+
| `highlightColor` | `string` | `#f5f5f5` | Shimmer color |
|
|
316
|
+
|
|
317
|
+
### Progress Props
|
|
318
|
+
|
|
319
|
+
| Prop | Type | Default | Description |
|
|
320
|
+
|------|------|---------|-------------|
|
|
321
|
+
| `value` | `number` | `0` | Progress value (0-100) |
|
|
322
|
+
| `indeterminate` | `boolean` | `false` | Indeterminate mode |
|
|
323
|
+
| `showValue` | `boolean` | `false` | Show percentage text |
|
|
324
|
+
| `thickness` | `number \| string` | varies | Thickness of indicator |
|
|
325
|
+
|
|
326
|
+
## Performance
|
|
327
|
+
|
|
328
|
+
All components are optimized for performance:
|
|
329
|
+
|
|
330
|
+
- **CSS Animations** - No JavaScript animations, pure CSS
|
|
331
|
+
- **Hardware Acceleration** - Uses `transform` and `opacity` for 60fps
|
|
332
|
+
- **Tree-shakeable** - Only bundle components you import
|
|
333
|
+
- **Minimal Bundle Size** - Lightweight with no dependencies
|
|
334
|
+
|
|
335
|
+
## Browser Support
|
|
336
|
+
|
|
337
|
+
- Chrome (latest)
|
|
338
|
+
- Firefox (latest)
|
|
339
|
+
- Safari (latest)
|
|
340
|
+
- Edge (latest)
|
|
341
|
+
|
|
342
|
+
## Storybook
|
|
343
|
+
|
|
344
|
+
Explore all components interactively in Storybook:
|
|
345
|
+
|
|
346
|
+
```bash
|
|
347
|
+
npm run storybook
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
## Contributing
|
|
351
|
+
|
|
352
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
353
|
+
|
|
354
|
+
1. Fork the repository
|
|
355
|
+
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
|
|
356
|
+
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
|
|
357
|
+
4. Push to the branch (`git push origin feature/AmazingFeature`)
|
|
358
|
+
5. Open a Pull Request
|
|
359
|
+
|
|
360
|
+
## License
|
|
361
|
+
|
|
362
|
+
MIT © Ishan Karunaratne
|
|
363
|
+
|
|
364
|
+
## Acknowledgments
|
|
365
|
+
|
|
366
|
+
Built with:
|
|
367
|
+
- [React](https://react.dev/)
|
|
368
|
+
- [TypeScript](https://www.typescriptlang.org/)
|
|
369
|
+
- [Tailwind CSS](https://tailwindcss.com/)
|
|
370
|
+
- [Vite](https://vite.dev/)
|
|
371
|
+
- [Storybook](https://storybook.js.org/)
|
|
372
|
+
|
|
373
|
+
---
|
|
374
|
+
|
|
375
|
+
**Made with ❤️ by Ishan Karunaratne**
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ProgressBarProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* ProgressBar - Linear progress bar
|
|
4
|
+
*
|
|
5
|
+
* A horizontal progress bar that can be determinate (showing specific progress) or indeterminate (loading animation).
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <ProgressBar value={75} showValue />
|
|
10
|
+
* <ProgressBar indeterminate />
|
|
11
|
+
* <ProgressBar value={50} height={8} color="#8b5cf6" />
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare const ProgressBar: import('react').ForwardRefExoticComponent<ProgressBarProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
15
|
+
//# sourceMappingURL=ProgressBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../../../src/components/progress/ProgressBar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,6GAqEvB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ProgressCircleProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* ProgressCircle - SVG-based circular progress indicator
|
|
4
|
+
*
|
|
5
|
+
* A circular progress indicator that shows progress as a partial circle.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <ProgressCircle value={75} showValue />
|
|
10
|
+
* <ProgressCircle value={50} size={80} thickness={6} />
|
|
11
|
+
* <ProgressCircle indeterminate />
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare const ProgressCircle: import('react').ForwardRefExoticComponent<ProgressCircleProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
15
|
+
//# sourceMappingURL=ProgressCircle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgressCircle.d.ts","sourceRoot":"","sources":["../../../src/components/progress/ProgressCircle.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGlD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc,gHAyF1B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ProgressRingProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* ProgressRing - Ring-style progress with gradient option
|
|
4
|
+
*
|
|
5
|
+
* A circular progress ring with optional gradient colors.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <ProgressRing value={75} showValue />
|
|
10
|
+
* <ProgressRing value={60} gradient secondaryColor="#8b5cf6" />
|
|
11
|
+
* <ProgressRing indeterminate />
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare const ProgressRing: import('react').ForwardRefExoticComponent<ProgressRingProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
15
|
+
//# sourceMappingURL=ProgressRing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgressRing.d.ts","sourceRoot":"","sources":["../../../src/components/progress/ProgressRing.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGhD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,8GAmGxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/progress/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PulseBarsProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* PulseBars - Equalizer-style bars loader
|
|
4
|
+
*
|
|
5
|
+
* A loader with bars that pulse like an audio equalizer.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <PulseBars size={40} color="#3b82f6" />
|
|
10
|
+
* <PulseBars size={48} barCount={6} speed="fast" />
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export declare const PulseBars: import('react').ForwardRefExoticComponent<PulseBarsProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
14
|
+
//# sourceMappingURL=PulseBars.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PulseBars.d.ts","sourceRoot":"","sources":["../../../src/components/pulse/PulseBars.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,2GA4DrB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PulseDotsProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* PulseDots - Bouncing dots loader
|
|
4
|
+
*
|
|
5
|
+
* A loader with bouncing dots that scale and fade in a sequence.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <PulseDots size={40} color="#3b82f6" />
|
|
10
|
+
* <PulseDots size={32} dotCount={5} speed="fast" />
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export declare const PulseDots: import('react').ForwardRefExoticComponent<PulseDotsProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
14
|
+
//# sourceMappingURL=PulseDots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PulseDots.d.ts","sourceRoot":"","sources":["../../../src/components/pulse/PulseDots.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,2GAmDrB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PulseWaveProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* PulseWave - Wave pattern loader
|
|
4
|
+
*
|
|
5
|
+
* A loader with bars that animate in a wave pattern.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <PulseWave size={40} color="#3b82f6" />
|
|
10
|
+
* <PulseWave size={32} barCount={7} speed="slow" />
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export declare const PulseWave: import('react').ForwardRefExoticComponent<PulseWaveProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
14
|
+
//# sourceMappingURL=PulseWave.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PulseWave.d.ts","sourceRoot":"","sources":["../../../src/components/pulse/PulseWave.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,2GAyDrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/pulse/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SkeletonProps } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Skeleton - Base skeleton loader component
|
|
5
|
+
*
|
|
6
|
+
* A versatile skeleton loader that can be used standalone or as a building block for more complex loaders.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <Skeleton width={200} height={20} />
|
|
11
|
+
* <Skeleton variant="circular" width={40} height={40} />
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare const Skeleton: React.ForwardRefExoticComponent<SkeletonProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
//# sourceMappingURL=Skeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Skeleton.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton/Skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,sFA4DpB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SkeletonAvatarProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* SkeletonAvatar - Avatar skeleton loader
|
|
4
|
+
*
|
|
5
|
+
* A skeleton loader for avatar placeholders with circle or square shapes.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <SkeletonAvatar size={40} />
|
|
10
|
+
* <SkeletonAvatar size={64} shape="square" />
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export declare const SkeletonAvatar: import('react').ForwardRefExoticComponent<SkeletonAvatarProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
14
|
+
//# sourceMappingURL=SkeletonAvatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SkeletonAvatar.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton/SkeletonAvatar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAIlD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,gHAqC1B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SkeletonCardProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* SkeletonCard - Card skeleton loader
|
|
4
|
+
*
|
|
5
|
+
* A composite skeleton loader for card layouts with optional avatar, title, and description lines.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <SkeletonCard />
|
|
10
|
+
* <SkeletonCard hasAvatar={true} lines={3} />
|
|
11
|
+
* <SkeletonCard hasAvatar={false} titleWidth="60%" />
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare const SkeletonCard: import('react').ForwardRefExoticComponent<SkeletonCardProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
15
|
+
//# sourceMappingURL=SkeletonCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SkeletonCard.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton/SkeletonCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAKhD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,8GAiExB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SkeletonImageProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* SkeletonImage - Image skeleton loader
|
|
4
|
+
*
|
|
5
|
+
* A skeleton loader for image placeholders with optional aspect ratio.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <SkeletonImage width={300} height={200} />
|
|
10
|
+
* <SkeletonImage aspectRatio="16/9" width="100%" />
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export declare const SkeletonImage: import('react').ForwardRefExoticComponent<SkeletonImageProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
14
|
+
//# sourceMappingURL=SkeletonImage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SkeletonImage.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton/SkeletonImage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGjD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,+GAyCzB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SkeletonListProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* SkeletonList - List skeleton loader
|
|
4
|
+
*
|
|
5
|
+
* A skeleton loader for list items with customizable count, item height, and spacing.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <SkeletonList items={5} />
|
|
10
|
+
* <SkeletonList items={3} itemHeight={60} gap={12} />
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export declare const SkeletonList: import('react').ForwardRefExoticComponent<SkeletonListProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
14
|
+
//# sourceMappingURL=SkeletonList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SkeletonList.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton/SkeletonList.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAIhD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,8GAkDxB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SkeletonTableProps } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* SkeletonTable - Table skeleton loader
|
|
4
|
+
*
|
|
5
|
+
* A skeleton loader for table layouts with rows and columns.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <SkeletonTable rows={5} columns={4} />
|
|
10
|
+
* <SkeletonTable rows={3} columns={3} showHeader={true} />
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export declare const SkeletonTable: import('react').ForwardRefExoticComponent<SkeletonTableProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
14
|
+
//# sourceMappingURL=SkeletonTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SkeletonTable.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton/SkeletonTable.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAIjD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,+GAgEzB,CAAC"}
|