izen-react-starter 1.1.3 → 1.1.4
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 +43 -25
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# izen-react-starter
|
|
2
2
|
|
|
3
3
|
A modern React component library built with Vite, TypeScript, and best practices.
|
|
4
4
|
|
|
@@ -22,20 +22,25 @@ A modern React component library built with Vite, TypeScript, and best practices
|
|
|
22
22
|
## Installation
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
npm install react-starter
|
|
25
|
+
npm install izen-react-starter
|
|
26
26
|
# or
|
|
27
|
-
yarn add react-starter
|
|
27
|
+
yarn add izen-react-starter
|
|
28
28
|
# or
|
|
29
|
-
pnpm add react-starter
|
|
29
|
+
pnpm add izen-react-starter
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
+
> **Note**: This library has a peer dependency of React ^18.2.0. If you're using React 19, you may need to install with `--legacy-peer-deps` flag:
|
|
33
|
+
> ```bash
|
|
34
|
+
> npm install izen-react-starter --legacy-peer-deps
|
|
35
|
+
> ```
|
|
36
|
+
|
|
32
37
|
### Import Styles
|
|
33
38
|
|
|
34
39
|
Don't forget to import the CSS file in your app entry point:
|
|
35
40
|
|
|
36
41
|
```tsx
|
|
37
42
|
// In your main.tsx or App.tsx
|
|
38
|
-
import 'react-starter/style.css';
|
|
43
|
+
import 'izen-react-starter/style.css';
|
|
39
44
|
```
|
|
40
45
|
|
|
41
46
|
The library includes Tailwind CSS with pre-configured theme variables for:
|
|
@@ -51,7 +56,7 @@ The library includes Tailwind CSS with pre-configured theme variables for:
|
|
|
51
56
|
Wrap your application with `AppProvider` to get all providers in one go:
|
|
52
57
|
|
|
53
58
|
```tsx
|
|
54
|
-
import { AppProvider } from 'react-starter';
|
|
59
|
+
import { AppProvider } from 'izen-react-starter';
|
|
55
60
|
import { AppRouter } from './routes';
|
|
56
61
|
|
|
57
62
|
function App() {
|
|
@@ -69,7 +74,7 @@ function App() {
|
|
|
69
74
|
### Authentication
|
|
70
75
|
|
|
71
76
|
```tsx
|
|
72
|
-
import { AuthProvider, useAuth } from 'react-starter';
|
|
77
|
+
import { AuthProvider, useAuth } from 'izen-react-starter';
|
|
73
78
|
|
|
74
79
|
function LoginPage() {
|
|
75
80
|
const { setAuthData } = useAuth();
|
|
@@ -103,7 +108,7 @@ function ProfilePage() {
|
|
|
103
108
|
### Protected Routes
|
|
104
109
|
|
|
105
110
|
```tsx
|
|
106
|
-
import { RequiredAuth } from 'react-starter';
|
|
111
|
+
import { RequiredAuth } from 'izen-react-starter';
|
|
107
112
|
import { Routes, Route } from 'react-router-dom';
|
|
108
113
|
|
|
109
114
|
function AppRouter() {
|
|
@@ -124,7 +129,7 @@ function AppRouter() {
|
|
|
124
129
|
### Router Hooks
|
|
125
130
|
|
|
126
131
|
```tsx
|
|
127
|
-
import { useRouter, usePathname } from 'react-starter';
|
|
132
|
+
import { useRouter, usePathname } from 'izen-react-starter';
|
|
128
133
|
|
|
129
134
|
function MyComponent() {
|
|
130
135
|
const router = useRouter();
|
|
@@ -147,7 +152,7 @@ function MyComponent() {
|
|
|
147
152
|
### Theme Provider
|
|
148
153
|
|
|
149
154
|
```tsx
|
|
150
|
-
import { ThemeProvider, useTheme } from 'react-starter';
|
|
155
|
+
import { ThemeProvider, useTheme } from 'izen-react-starter';
|
|
151
156
|
|
|
152
157
|
function ThemeToggle() {
|
|
153
158
|
const { theme, setTheme } = useTheme();
|
|
@@ -163,7 +168,7 @@ function ThemeToggle() {
|
|
|
163
168
|
### Modal and Overlay
|
|
164
169
|
|
|
165
170
|
```tsx
|
|
166
|
-
import { ModalProvider, useModal, OverlayProvider, useOverlay } from 'react-starter';
|
|
171
|
+
import { ModalProvider, useModal, OverlayProvider, useOverlay } from 'izen-react-starter';
|
|
167
172
|
|
|
168
173
|
function MyComponent() {
|
|
169
174
|
const { isOpen, setIsOpen } = useModal();
|
|
@@ -181,15 +186,26 @@ function MyComponent() {
|
|
|
181
186
|
### Components
|
|
182
187
|
|
|
183
188
|
```tsx
|
|
184
|
-
import { Button, Card } from 'react-starter';
|
|
189
|
+
import { Button, Card } from 'izen-react-starter';
|
|
185
190
|
|
|
186
191
|
function MyApp() {
|
|
187
192
|
return (
|
|
188
|
-
<Card
|
|
193
|
+
<Card
|
|
194
|
+
title="Hello World"
|
|
195
|
+
elevation="medium"
|
|
196
|
+
style={{ marginBottom: '2rem' }}
|
|
197
|
+
className="custom-card"
|
|
198
|
+
>
|
|
189
199
|
<p>Card content goes here</p>
|
|
190
|
-
<Button variant="primary" onClick={() => alert('Clicked!')}>
|
|
200
|
+
<Button variant="primary" size="medium" onClick={() => alert('Clicked!')}>
|
|
191
201
|
Click Me
|
|
192
202
|
</Button>
|
|
203
|
+
<Button variant="secondary" size="small">
|
|
204
|
+
Small Button
|
|
205
|
+
</Button>
|
|
206
|
+
<Button variant="outline" loading>
|
|
207
|
+
Loading...
|
|
208
|
+
</Button>
|
|
193
209
|
</Card>
|
|
194
210
|
);
|
|
195
211
|
}
|
|
@@ -198,7 +214,7 @@ function MyApp() {
|
|
|
198
214
|
### Layout Context
|
|
199
215
|
|
|
200
216
|
```tsx
|
|
201
|
-
import { LayoutProvider, useLayout } from 'react-starter';
|
|
217
|
+
import { LayoutProvider, useLayout } from 'izen-react-starter';
|
|
202
218
|
|
|
203
219
|
function App() {
|
|
204
220
|
return (
|
|
@@ -227,7 +243,7 @@ function MyComponent() {
|
|
|
227
243
|
### API Service
|
|
228
244
|
|
|
229
245
|
```tsx
|
|
230
|
-
import { apiService } from 'react-starter';
|
|
246
|
+
import { apiService } from 'izen-react-starter';
|
|
231
247
|
|
|
232
248
|
// Configure base URL
|
|
233
249
|
apiService.setBaseURL('https://api.example.com');
|
|
@@ -267,7 +283,7 @@ import {
|
|
|
267
283
|
withAccessControl,
|
|
268
284
|
Action,
|
|
269
285
|
Resource
|
|
270
|
-
} from 'react-starter';
|
|
286
|
+
} from 'izen-react-starter';
|
|
271
287
|
|
|
272
288
|
// Using the hook
|
|
273
289
|
function AdminPanel() {
|
|
@@ -307,7 +323,7 @@ const ProtectedComponent = withAccessControl(MyComponent);
|
|
|
307
323
|
### Utility Functions
|
|
308
324
|
|
|
309
325
|
```tsx
|
|
310
|
-
import { cn, debounce, throttle, capitalize, formatDate } from 'react-starter';
|
|
326
|
+
import { cn, debounce, throttle, capitalize, formatDate } from 'izen-react-starter';
|
|
311
327
|
|
|
312
328
|
// Combine classnames with Tailwind merge
|
|
313
329
|
const className = cn('bg-blue-500', 'text-white', 'hover:bg-blue-600');
|
|
@@ -332,7 +348,7 @@ const formatted = formatDate(new Date(), 'yyyy-MM-dd');
|
|
|
332
348
|
### Custom Hooks
|
|
333
349
|
|
|
334
350
|
```tsx
|
|
335
|
-
import { useIsMobile } from 'react-starter';
|
|
351
|
+
import { useIsMobile } from 'izen-react-starter';
|
|
336
352
|
|
|
337
353
|
function ResponsiveComponent() {
|
|
338
354
|
const isMobile = useIsMobile();
|
|
@@ -348,7 +364,7 @@ function ResponsiveComponent() {
|
|
|
348
364
|
### Cache Management
|
|
349
365
|
|
|
350
366
|
```tsx
|
|
351
|
-
import { handleEditCache, handleSingleEditCache } from 'react-starter';
|
|
367
|
+
import { handleEditCache, handleSingleEditCache } from 'izen-react-starter';
|
|
352
368
|
|
|
353
369
|
// Update cache after editing an item
|
|
354
370
|
handleEditCache({
|
|
@@ -522,11 +538,13 @@ Props:
|
|
|
522
538
|
### Card Component
|
|
523
539
|
|
|
524
540
|
Props:
|
|
525
|
-
- `title`: string (optional)
|
|
526
|
-
- `children`: ReactNode (required)
|
|
527
|
-
- `footer`: ReactNode (optional)
|
|
528
|
-
- `elevation`: 'none' | 'low' | 'medium' | 'high' (default: 'medium')
|
|
529
|
-
- `className`: string (optional)
|
|
541
|
+
- `title`: string (optional) - Card header title
|
|
542
|
+
- `children`: ReactNode (required) - Card body content
|
|
543
|
+
- `footer`: ReactNode (optional) - Card footer content
|
|
544
|
+
- `elevation`: 'none' | 'low' | 'medium' | 'high' (default: 'medium') - Shadow depth
|
|
545
|
+
- `className`: string (optional) - Additional CSS classes
|
|
546
|
+
- `style`: CSSProperties (optional) - Inline styles
|
|
547
|
+
- All standard HTML div attributes (onClick, onMouseEnter, etc.)
|
|
530
548
|
|
|
531
549
|
### Layout Context
|
|
532
550
|
|
package/package.json
CHANGED