@lzzjokerzzl/react-ui-components 1.4.7 → 1.4.9
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 +34 -126
- package/dist/index.cjs +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +0 -75
- package/dist/index.js +3178 -3324
- package/dist/index.js.map +1 -1
- package/dist/react-ui-components.css +1 -1
- package/package.json +2 -11
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @lzzjokerzzl/react-ui-components
|
|
2
2
|
|
|
3
|
-
A comprehensive React UI component library with animations, built with TypeScript and Tailwind CSS.
|
|
3
|
+
A comprehensive React UI component library with animations, built with TypeScript and Tailwind CSS. Compatible with React and Next.js.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
@@ -12,6 +12,7 @@ A comprehensive React UI component library with animations, built with TypeScrip
|
|
|
12
12
|
- ♿ **Accessible**: ARIA compliant components
|
|
13
13
|
- 🎭 **Customizable**: Flexible styling with variants
|
|
14
14
|
- 🚀 **Performance**: Optimized for production
|
|
15
|
+
- ⚛️ **Framework Compatible**: Works with React and Next.js
|
|
15
16
|
|
|
16
17
|
## Installation
|
|
17
18
|
|
|
@@ -66,18 +67,12 @@ function App() {
|
|
|
66
67
|
|
|
67
68
|
### Layout & Navigation
|
|
68
69
|
|
|
69
|
-
- **Breadcrumb** - Navigation breadcrumbs
|
|
70
|
+
- **Breadcrumb** - Navigation breadcrumbs
|
|
70
71
|
- **Modal** - Overlay dialogs and popups
|
|
71
72
|
- **Navbar** - Navigation bars and headers
|
|
72
|
-
- **Sidebar** - Collapsible sidebar navigation
|
|
73
|
+
- **Sidebar** - Collapsible sidebar navigation
|
|
73
74
|
- **Table** - Data tables with sorting and pagination
|
|
74
75
|
|
|
75
|
-
### Router Components
|
|
76
|
-
|
|
77
|
-
- **LibraryLink** - Enhanced Link component with active state management
|
|
78
|
-
- **Navigation** - Navigation components with React Router integration
|
|
79
|
-
- **useLibraryNavigation** - Hook for programmatic navigation
|
|
80
|
-
|
|
81
76
|
### Animation Components
|
|
82
77
|
|
|
83
78
|
- **AnimatedContainer** - Fade, slide, scale, bounce, flip, stagger, morphing, and parallax containers
|
|
@@ -162,23 +157,7 @@ function Example() {
|
|
|
162
157
|
}
|
|
163
158
|
```
|
|
164
159
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
The library includes router components that integrate seamlessly with React Router while maintaining backward compatibility.
|
|
168
|
-
|
|
169
|
-
### Setup
|
|
170
|
-
|
|
171
|
-
For router functionality, install React Router as a peer dependency:
|
|
172
|
-
|
|
173
|
-
```bash
|
|
174
|
-
npm install react-router
|
|
175
|
-
# or
|
|
176
|
-
yarn add react-router
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
### Navigation Components
|
|
180
|
-
|
|
181
|
-
#### Breadcrumb with Router Support
|
|
160
|
+
### Breadcrumb Navigation
|
|
182
161
|
|
|
183
162
|
```tsx
|
|
184
163
|
import { Breadcrumb, BreadcrumbItem } from '@lzzjokerzzl/react-ui-components';
|
|
@@ -186,19 +165,20 @@ import { Breadcrumb, BreadcrumbItem } from '@lzzjokerzzl/react-ui-components';
|
|
|
186
165
|
function Navigation() {
|
|
187
166
|
return (
|
|
188
167
|
<Breadcrumb>
|
|
189
|
-
<BreadcrumbItem
|
|
190
|
-
<BreadcrumbItem
|
|
168
|
+
<BreadcrumbItem href="/">Home</BreadcrumbItem>
|
|
169
|
+
<BreadcrumbItem href="/products">Products</BreadcrumbItem>
|
|
191
170
|
<BreadcrumbItem isCurrent>Laptop</BreadcrumbItem>
|
|
192
171
|
</Breadcrumb>
|
|
193
172
|
);
|
|
194
173
|
}
|
|
195
174
|
```
|
|
196
175
|
|
|
197
|
-
|
|
176
|
+
### Sidebar Navigation
|
|
198
177
|
|
|
199
178
|
```tsx
|
|
200
179
|
import {
|
|
201
180
|
Sidebar,
|
|
181
|
+
SidebarProvider,
|
|
202
182
|
SidebarHeader,
|
|
203
183
|
SidebarContent,
|
|
204
184
|
SidebarItem,
|
|
@@ -207,105 +187,35 @@ import {
|
|
|
207
187
|
|
|
208
188
|
function AppSidebar() {
|
|
209
189
|
return (
|
|
210
|
-
<
|
|
211
|
-
<
|
|
212
|
-
<
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
<
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
<
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
190
|
+
<SidebarProvider>
|
|
191
|
+
<Sidebar>
|
|
192
|
+
<SidebarHeader>
|
|
193
|
+
<h2>My App</h2>
|
|
194
|
+
</SidebarHeader>
|
|
195
|
+
|
|
196
|
+
<SidebarContent>
|
|
197
|
+
<SidebarItem href="/dashboard" icon={<DashboardIcon />}>
|
|
198
|
+
Dashboard
|
|
199
|
+
</SidebarItem>
|
|
200
|
+
<SidebarItem href="/profile" icon={<ProfileIcon />}>
|
|
201
|
+
Profile
|
|
202
|
+
</SidebarItem>
|
|
203
|
+
<SidebarItem href="/settings" icon={<SettingsIcon />}>
|
|
204
|
+
Settings
|
|
205
|
+
</SidebarItem>
|
|
206
|
+
</SidebarContent>
|
|
207
|
+
|
|
208
|
+
<SidebarFooter>
|
|
209
|
+
<SidebarItem href="/logout" icon={<LogoutIcon />}>
|
|
210
|
+
Logout
|
|
211
|
+
</SidebarItem>
|
|
212
|
+
</SidebarFooter>
|
|
213
|
+
</Sidebar>
|
|
214
|
+
</SidebarProvider>
|
|
233
215
|
);
|
|
234
216
|
}
|
|
235
217
|
```
|
|
236
218
|
|
|
237
|
-
#### LibraryLink Component
|
|
238
|
-
|
|
239
|
-
```tsx
|
|
240
|
-
import { LibraryLink } from '@lzzjokerzzl/react-ui-components';
|
|
241
|
-
|
|
242
|
-
function CustomNavigation() {
|
|
243
|
-
return (
|
|
244
|
-
<nav>
|
|
245
|
-
<LibraryLink
|
|
246
|
-
to="/dashboard"
|
|
247
|
-
activeClassName="text-blue-500 font-bold"
|
|
248
|
-
exact
|
|
249
|
-
>
|
|
250
|
-
Dashboard
|
|
251
|
-
</LibraryLink>
|
|
252
|
-
|
|
253
|
-
<LibraryLink
|
|
254
|
-
to="/profile"
|
|
255
|
-
activeClassName="text-blue-500 font-bold"
|
|
256
|
-
>
|
|
257
|
-
Profile
|
|
258
|
-
</LibraryLink>
|
|
259
|
-
</nav>
|
|
260
|
-
);
|
|
261
|
-
}
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
#### Programmatic Navigation
|
|
265
|
-
|
|
266
|
-
```tsx
|
|
267
|
-
import { useLibraryNavigation } from '@lzzjokerzzl/react-ui-components';
|
|
268
|
-
|
|
269
|
-
function MyComponent() {
|
|
270
|
-
const { navigate, goBack, goForward } = useLibraryNavigation();
|
|
271
|
-
|
|
272
|
-
const handleSaveAndRedirect = async () => {
|
|
273
|
-
await saveData();
|
|
274
|
-
navigate('/success', { replace: true });
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
return (
|
|
278
|
-
<div>
|
|
279
|
-
<button onClick={() => navigate('/profile')}>
|
|
280
|
-
Go to Profile
|
|
281
|
-
</button>
|
|
282
|
-
<button onClick={goBack}>
|
|
283
|
-
Go Back
|
|
284
|
-
</button>
|
|
285
|
-
<button onClick={handleSaveAndRedirect}>
|
|
286
|
-
Save and Continue
|
|
287
|
-
</button>
|
|
288
|
-
</div>
|
|
289
|
-
);
|
|
290
|
-
}
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
### Backward Compatibility
|
|
294
|
-
|
|
295
|
-
All navigation components support both old (`href`) and new (`to`) props:
|
|
296
|
-
|
|
297
|
-
```tsx
|
|
298
|
-
// Old way (still supported)
|
|
299
|
-
<BreadcrumbItem href="/home">Home</BreadcrumbItem>
|
|
300
|
-
<SidebarItem href="/dashboard">Dashboard</SidebarItem>
|
|
301
|
-
|
|
302
|
-
// New way (recommended for React Router integration)
|
|
303
|
-
<BreadcrumbItem to="/home">Home</BreadcrumbItem>
|
|
304
|
-
<SidebarItem to="/dashboard">Dashboard</SidebarItem>
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
When both props are provided, `to` takes precedence, allowing for gradual migration.
|
|
308
|
-
|
|
309
219
|
## Styling
|
|
310
220
|
|
|
311
221
|
This library uses Tailwind CSS for styling. Make sure you have Tailwind CSS configured in your project, or import the included styles:
|
|
@@ -323,7 +233,6 @@ import type {
|
|
|
323
233
|
ButtonProps,
|
|
324
234
|
ModalProps,
|
|
325
235
|
AnimatedContainerConfig,
|
|
326
|
-
TextAnimationPreset,
|
|
327
236
|
} from "@lzzjokerzzl/react-ui-components";
|
|
328
237
|
```
|
|
329
238
|
|
|
@@ -331,7 +240,6 @@ import type {
|
|
|
331
240
|
|
|
332
241
|
- React >= 18.0.0
|
|
333
242
|
- React DOM >= 18.0.0
|
|
334
|
-
- React Router >= 6.0.0 (optional, for router components)
|
|
335
243
|
|
|
336
244
|
## License
|
|
337
245
|
|