izen-react-starter 2.5.6 → 2.5.8
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 +67 -0
- package/dist/{2SSKDMRQ-BZ0L1Ejz.js → 2SSKDMRQ-DX65y15m.js} +2 -2
- package/dist/{AP7HFJJL-qzOuapxb.js → AP7HFJJL-BIGKw1Hk.js} +1 -1
- package/dist/{WDYDFRGG-DeiLlShW.js → WDYDFRGG-DyKe9_mw.js} +2 -2
- package/dist/{index-D2ZQoJ_A.js → index-Df-O5vd7.js} +6231 -6207
- package/dist/izen-react-starter.css +1 -1
- package/dist/react-starter.js +1 -1
- package/dist/react-starter.umd.cjs +126 -126
- package/dist/src/components/navigation/AppSidebar.d.ts +15 -8
- package/dist/src/components/navigation/AppSidebar.d.ts.map +1 -1
- package/dist/src/services/apiService.d.ts +2 -18
- package/dist/src/services/apiService.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,6 +4,7 @@ A modern React component library built with Vite, TypeScript, and best practices
|
|
|
4
4
|
|
|
5
5
|
## Changelog
|
|
6
6
|
|
|
7
|
+
- 2026-01-12: Added `DashboardLayout` component with integrated `AppSidebar`, header, and overlay support. Sidebar now supports `collapsible: 'icon'` for desktop toggle and `'offcanvas'` for mobile sheet behavior. Updated `ApiService` interface to include `setTokenGetter` method for token management.
|
|
7
8
|
- 2026-01-02: `BrowserRouter` removed from inside `AppProvider`. Consumers must wrap `AppProvider` (and any `react-router-dom` usage) in their own router at the app root.
|
|
8
9
|
|
|
9
10
|
## Features
|
|
@@ -257,6 +258,72 @@ function ThemeToggle() {
|
|
|
257
258
|
}
|
|
258
259
|
```
|
|
259
260
|
|
|
261
|
+
### Dashboard Layout with Sidebar
|
|
262
|
+
|
|
263
|
+
Use `DashboardLayout` with `AppSidebar` to create a complete dashboard structure with sidebar navigation, header, and content area. The sidebar is responsive and includes built-in toggle functionality.
|
|
264
|
+
|
|
265
|
+
```tsx
|
|
266
|
+
import { DashboardLayout, AppSidebar } from 'izen-react-starter';
|
|
267
|
+
import { LayoutDashboardIcon, UsersIcon, SettingsIcon } from 'lucide-react';
|
|
268
|
+
import { pageTitles } from '@/lib/constants/URLS';
|
|
269
|
+
import { useAuth } from 'izen-react-starter';
|
|
270
|
+
|
|
271
|
+
export default function DashboardLay({ children }: { children: React.ReactNode }) {
|
|
272
|
+
const { user } = useAuth();
|
|
273
|
+
|
|
274
|
+
const sidebarProps = {
|
|
275
|
+
navMain: [
|
|
276
|
+
{ title: 'Dashboard', url: '/dashboard', icon: LayoutDashboardIcon },
|
|
277
|
+
{ title: 'Users', url: '/dashboard/users', icon: UsersIcon },
|
|
278
|
+
],
|
|
279
|
+
navSecondary: [
|
|
280
|
+
{ title: 'Settings', url: '/dashboard/preferences', icon: SettingsIcon },
|
|
281
|
+
],
|
|
282
|
+
user: user ? {
|
|
283
|
+
name: user.name,
|
|
284
|
+
email: user.email,
|
|
285
|
+
avatar: user.avatar,
|
|
286
|
+
} : undefined,
|
|
287
|
+
onLogout: () => {
|
|
288
|
+
// Handle logout
|
|
289
|
+
window.location.href = '/login';
|
|
290
|
+
},
|
|
291
|
+
logoText: 'My App',
|
|
292
|
+
logoHref: '/dashboard',
|
|
293
|
+
pageTitles,
|
|
294
|
+
collapsible: 'icon', // Enable sidebar collapse on desktop
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
const headerProps = {
|
|
298
|
+
pageTitles,
|
|
299
|
+
defaultTitle: 'Dashboard',
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
return (
|
|
303
|
+
<DashboardLayout
|
|
304
|
+
sidebarProps={sidebarProps}
|
|
305
|
+
headerProps={headerProps}
|
|
306
|
+
defaultOpen={true}
|
|
307
|
+
>
|
|
308
|
+
{children}
|
|
309
|
+
</DashboardLayout>
|
|
310
|
+
);
|
|
311
|
+
}
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
**Key Features:**
|
|
315
|
+
- **Sidebar Navigation**: Supports `navMain` (primary nav) and `navSecondary` (secondary nav like Settings)
|
|
316
|
+
- **User Profile**: Optional user section at the bottom with logout
|
|
317
|
+
- **Responsive**: Collapses to icon-only on desktop (with toggle), becomes a sheet on mobile
|
|
318
|
+
- **Page Titles**: Auto-displays page title in header based on route
|
|
319
|
+
- **Overlay Integration**: Built-in overlay/modal support via `useOverlay` hook
|
|
320
|
+
- **Collapsible Modes**: Set `collapsible` to `'icon'` (desktop collapse), `'offcanvas'` (mobile sheet), or `'none'` (always visible)
|
|
321
|
+
|
|
322
|
+
> **Note**: Make sure to import the library CSS in your app entry:
|
|
323
|
+
> ```tsx
|
|
324
|
+
> import 'izen-react-starter/dist/style.css';
|
|
325
|
+
> ```
|
|
326
|
+
|
|
260
327
|
### Form Layout (RHF + Axios)
|
|
261
328
|
|
|
262
329
|
Use `FormLayout` to wire react-hook-form + zod validation with built-in Axios auth, RBAC visibility checks, toasts, and submit helpers.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./AP7HFJJL-
|
|
2
|
-
import { g as h, c as v, a as e } from "./index-
|
|
1
|
+
import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./AP7HFJJL-BIGKw1Hk.js";
|
|
2
|
+
import { g as h, c as v, a as e } from "./index-Df-O5vd7.js";
|
|
3
3
|
var C = (r) => {
|
|
4
4
|
const [t, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var xs = Object.defineProperty;
|
|
2
2
|
var $s = (e, t, n) => t in e ? xs(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var Re = (e, t, n) => $s(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { b as $e, d as B, o as ft, e as H, c as P, a as m, P as No, m as ve, S as K, t as _, i as k, f as U, h as F, j as Cs, k as ur, u as Ce, l as V, s as Qn, n as Yn, p as gt, q as T, r as Ss, v as Ut, w as _t, x as qe, y as ks, z as Rt, A as Bt, B as Es, C as Ds, D as En, F as As, E as Ht, $ as Ho, G as Ms, H as Ts, I as W, J as Vr, K as Fs, L as Is, M as cr, N as Os, O as Ls, Q as Hn, R as Ps, T as qs, U as ie, V as _s, W as Rs } from "./index-
|
|
4
|
+
import { b as $e, d as B, o as ft, e as H, c as P, a as m, P as No, m as ve, S as K, t as _, i as k, f as U, h as F, j as Cs, k as ur, u as Ce, l as V, s as Qn, n as Yn, p as gt, q as T, r as Ss, v as Ut, w as _t, x as qe, y as ks, z as Rt, A as Bt, B as Es, C as Ds, D as En, F as As, E as Ht, $ as Ho, G as Ms, H as Ts, I as W, J as Vr, K as Fs, L as Is, M as cr, N as Os, O as Ls, Q as Hn, R as Ps, T as qs, U as ie, V as _s, W as Rs } from "./index-Df-O5vd7.js";
|
|
5
5
|
var zs = (e) => e != null, Ks = (e) => e.filter(zs);
|
|
6
6
|
function Bs(e) {
|
|
7
7
|
return (...t) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c, T as l, P as m, a as u, D as v, Q as i } from "./AP7HFJJL-
|
|
2
|
-
import { g as d, c as f, a as e } from "./index-
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./AP7HFJJL-BIGKw1Hk.js";
|
|
2
|
+
import { g as d, c as f, a as e } from "./index-Df-O5vd7.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|