izen-react-starter 2.2.8 → 2.2.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 CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  A modern React component library built with Vite, TypeScript, and best practices.
4
4
 
5
+ ## Changelog
6
+
7
+ - 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
+
5
9
  ## Features
6
10
 
7
11
  - 🎨 **UI Components**: Pre-built, customizable components (Button, Card, etc.)
@@ -54,24 +58,29 @@ The library includes Tailwind CSS with pre-configured theme variables for:
54
58
 
55
59
  ### App Provider (All-in-one)
56
60
 
57
- Wrap your application with `AppProvider` to get all providers in one go:
61
+ Wrap your application with `BrowserRouter` at the root. `AppProvider` no longer creates a router internally so you control the router setup in your app entry point:
58
62
 
59
63
  ```tsx
64
+ import { BrowserRouter } from 'react-router-dom';
60
65
  import { AppProvider } from 'izen-react-starter';
61
66
  import { AppRouter } from './routes';
62
67
 
63
68
  function App() {
64
69
  return (
65
- <AppProvider
66
- defaultTheme="light"
67
- showReactQueryDevtools={true}
68
- >
69
- <AppRouter />
70
- </AppProvider>
70
+ <BrowserRouter>
71
+ <AppProvider
72
+ defaultTheme="light"
73
+ showReactQueryDevtools={true}
74
+ >
75
+ <AppRouter />
76
+ </AppProvider>
77
+ </BrowserRouter>
71
78
  );
72
79
  }
73
80
  ```
74
81
 
82
+ > Recent change: `BrowserRouter` was removed from inside `AppProvider`. Always wrap `AppProvider` (or any components using `react-router-dom` hooks/components) in your own router at the application root.
83
+
75
84
  ### Authentication
76
85
 
77
86
  ```tsx
@@ -106,6 +115,23 @@ function ProfilePage() {
106
115
  }
107
116
  ```
108
117
 
118
+ #### Typing `useAuth`
119
+
120
+ `useAuth` is generic. Bring your own user shape for full IntelliSense:
121
+
122
+ ```tsx
123
+ import { useAuth } from 'izen-react-starter';
124
+
125
+ type MyUser = {
126
+ id: string;
127
+ name: string;
128
+ role: 'admin' | 'user';
129
+ };
130
+
131
+ const { user, setAuthData } = useAuth<MyUser>();
132
+ setAuthData({ id: '1', name: 'Ada', role: 'admin' }, { access_token: 'jwt' });
133
+ ```
134
+
109
135
  ### Protected Routes
110
136
 
111
137
  ```tsx
@@ -127,6 +153,8 @@ function AppRouter() {
127
153
  }
128
154
  ```
129
155
 
156
+ > Make sure these routes are rendered inside your app-level router (e.g., `BrowserRouter`) that wraps `AppProvider`, so `RequiredAuth` and router hooks have a valid router context.
157
+
130
158
  ### App Router Hook (Simplified Routing)
131
159
 
132
160
  The `useAppRouter` hook simplifies route configuration by automatically handling:
@@ -1,7 +1,7 @@
1
1
  var ws = Object.defineProperty;
2
2
  var xs = (e, t, n) => t in e ? ws(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var Re = (e, t, n) => xs(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { b as $e, d as B, o as xt, e as H, c as L, a as v, P as zo, m as ye, S as K, t as P, i as k, f as U, h as F, j as $s, k as sr, u as Ce, l as V, s as Vn, n as jn, p as ft, q as T, r as Cs, v as cn, w as qe, x as Ss, y as _t, z as Kt, A as ks, B as Es, C as Cn, F as Ds, D as Hr, E as Nt, $ as Ko, G as Ms, H as As, I as W, J as Gr, K as Ts, L as Fs, M as ar, N as Is, O as Os, Q as Kn, R as Ls, T as Ps, U as ie, V as qs, W as _s } from "./index-BqTfpBWD.js";
4
+ import { b as $e, d as B, o as xt, e as H, c as L, a as v, P as zo, m as ye, S as K, t as P, i as k, f as U, h as F, j as $s, k as sr, u as Ce, l as V, s as Vn, n as jn, p as ft, q as T, r as Cs, v as cn, w as qe, x as Ss, y as _t, z as Kt, A as ks, B as Es, C as Cn, F as Ds, D as Hr, E as Nt, $ as Ko, G as Ms, H as As, I as W, J as Gr, K as Ts, L as Fs, M as ar, N as Is, O as Os, Q as Kn, R as Ls, T as Ps, U as ie, V as qs, W as _s } from "./index-H7dqNIPn.js";
5
5
  var Rs = (e) => e != null, zs = (e) => e.filter(Rs);
6
6
  function Ks(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 "./MIMHJGAX-QHfr44HB.js";
2
- import { g as d, c as f, a as e } from "./index-BqTfpBWD.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./MIMHJGAX-BnaLI46N.js";
2
+ import { g as d, c as f, a as e } from "./index-H7dqNIPn.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = c({
5
5
  prefix: "TanstackQueryDevtools"
@@ -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 "./MIMHJGAX-QHfr44HB.js";
2
- import { g as h, c as v, a as e } from "./index-BqTfpBWD.js";
1
+ import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./MIMHJGAX-BnaLI46N.js";
2
+ import { g as h, c as v, a as e } from "./index-H7dqNIPn.js";
3
3
  var C = (r) => {
4
4
  const [t, o] = s({
5
5
  prefix: "TanstackQueryDevtools"