@techzyapp/ui-library 1.0.12 → 1.0.14
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/dist/AdminRoot-DBKF9d3i.cjs +2 -0
- package/dist/AdminRoot-DBKF9d3i.cjs.map +1 -0
- package/dist/AdminRoot-DlP5Yq4L.js +50 -0
- package/dist/AdminRoot-DlP5Yq4L.js.map +1 -0
- package/dist/AuthGuard-CVklwDbj.js +7 -0
- package/dist/AuthGuard-CVklwDbj.js.map +1 -0
- package/dist/AuthGuard-kfOZviar.cjs +2 -0
- package/dist/AuthGuard-kfOZviar.cjs.map +1 -0
- package/dist/{Breadcrumbs-DvgctFLS.js → Breadcrumbs-6S4gCiJI.js} +2 -2
- package/dist/{Breadcrumbs-DvgctFLS.js.map → Breadcrumbs-6S4gCiJI.js.map} +1 -1
- package/dist/{Breadcrumbs-BnxhmyK5.cjs → Breadcrumbs-DMg5ER2H.cjs} +2 -2
- package/dist/{Breadcrumbs-BnxhmyK5.cjs.map → Breadcrumbs-DMg5ER2H.cjs.map} +1 -1
- package/dist/{PageNotFound-CmT-Wr9m.js → PageNotFound-HcL5rrHL.js} +2 -2
- package/dist/{PageNotFound-CmT-Wr9m.js.map → PageNotFound-HcL5rrHL.js.map} +1 -1
- package/dist/{PageNotFound-CxLUFoJa.cjs → PageNotFound-Lpw0M3TR.cjs} +2 -2
- package/dist/{PageNotFound-CxLUFoJa.cjs.map → PageNotFound-Lpw0M3TR.cjs.map} +1 -1
- package/dist/{RootLayout-CxMadTU1.cjs → RootLayout-1zRZNGGP.cjs} +2 -2
- package/dist/{RootLayout-CxMadTU1.cjs.map → RootLayout-1zRZNGGP.cjs.map} +1 -1
- package/dist/{RootLayout-CqQZ6h5c.js → RootLayout-CRZEk1E_.js} +3 -3
- package/dist/{RootLayout-CqQZ6h5c.js.map → RootLayout-CRZEk1E_.js.map} +1 -1
- package/dist/Sidebar-Bhx7mWAj.cjs +2 -0
- package/dist/Sidebar-Bhx7mWAj.cjs.map +1 -0
- package/dist/Sidebar-DPJIyW3Z.js +429 -0
- package/dist/Sidebar-DPJIyW3Z.js.map +1 -0
- package/dist/app/AdminRoot.d.cts +41 -0
- package/dist/app/AdminRoot.d.ts +41 -0
- package/dist/authLayoutRoute-B10sXioW.js +11 -0
- package/dist/authLayoutRoute-B10sXioW.js.map +1 -0
- package/dist/authLayoutRoute-BVQ4LhuU.cjs +2 -0
- package/dist/authLayoutRoute-BVQ4LhuU.cjs.map +1 -0
- package/dist/components/Breadcrumbs/index.cjs +1 -1
- package/dist/components/Breadcrumbs/index.js +1 -1
- package/dist/components/PageNotFound/index.cjs +1 -1
- package/dist/components/PageNotFound/index.js +1 -1
- package/dist/components/RootLayout/index.cjs +1 -1
- package/dist/components/RootLayout/index.js +1 -1
- package/dist/components/Sidebar/Sidebar.d.cts +7 -0
- package/dist/components/Sidebar/Sidebar.d.ts +7 -0
- package/dist/components/Sidebar/index.cjs +1 -1
- package/dist/components/Sidebar/index.js +1 -1
- package/dist/entries/app.cjs +2 -0
- package/dist/entries/app.cjs.map +1 -0
- package/dist/entries/app.d.cts +2 -0
- package/dist/entries/app.d.ts +2 -0
- package/dist/entries/app.js +5 -0
- package/dist/entries/app.js.map +1 -0
- package/dist/entries/auth.cjs +1 -1
- package/dist/entries/auth.js +4 -3
- package/dist/entries/auth.js.map +1 -1
- package/dist/entries/components.cjs +1 -1
- package/dist/entries/components.js +4 -4
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +165 -162
- package/dist/index.js.map +1 -1
- package/package.json +11 -1
- package/dist/Sidebar-CT_NUo_7.cjs +0 -2
- package/dist/Sidebar-CT_NUo_7.cjs.map +0 -1
- package/dist/Sidebar-Csd3iKbS.js +0 -424
- package/dist/Sidebar-Csd3iKbS.js.map +0 -1
- package/dist/authLayoutRoute-CkR9IANN.cjs +0 -2
- package/dist/authLayoutRoute-CkR9IANN.cjs.map +0 -1
- package/dist/authLayoutRoute-DEYvuYxM.js +0 -13
- package/dist/authLayoutRoute-DEYvuYxM.js.map +0 -1
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as r, Fragment as e } from "react/jsx-runtime";
|
|
2
|
-
import { Navigate as n, Outlet as f, redirect as m } from "@tanstack/react-router";
|
|
3
|
-
const s = ({ isAuthenticated: o, redirectTo: t = "/login", children: a }) => (typeof o == "function" ? o() : o) ? /* @__PURE__ */ r(e, { children: a }) : /* @__PURE__ */ r(n, { to: t }), g = ({ isAuthenticated: o, redirectTo: t = "/" }) => ({
|
|
4
|
-
beforeLoad: () => {
|
|
5
|
-
if (o()) throw m({ to: t });
|
|
6
|
-
},
|
|
7
|
-
component: f
|
|
8
|
-
});
|
|
9
|
-
export {
|
|
10
|
-
s as A,
|
|
11
|
-
g as a
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=authLayoutRoute-DEYvuYxM.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authLayoutRoute-DEYvuYxM.js","sources":["../src/auth/AuthGuard.tsx","../src/auth/authLayoutRoute.ts"],"sourcesContent":["import { Navigate, type LinkProps } from '@tanstack/react-router'\nimport type { ReactNode } from 'react'\n\nexport interface AuthGuardProps {\n /** Session check — a boolean, or a function that returns one (evaluated on render). */\n isAuthenticated: boolean | (() => boolean)\n /** Where to send an unauthenticated visitor. Defaults to `'/login'`. */\n redirectTo?: string\n /** The protected content, rendered only when authenticated. */\n children: ReactNode\n}\n\n/**\n * Component-level auth guard: renders `children` only when authenticated, otherwise redirects to\n * `redirectTo` via `<Navigate>`. Wrap the authenticated area (a page or a subtree) with it.\n *\n * Requires a `@tanstack/react-router` context (it renders `<Navigate>`), so use it inside a routed\n * tree. `redirectTo` is a plain string — the library can't know the app's typed route tree, so it's\n * cast loosely to the router's `to` type.\n *\n * @example\n * <AuthGuard isAuthenticated={session.isAuthenticated} redirectTo=\"/login\">\n * <Dashboard />\n * </AuthGuard>\n */\nexport const AuthGuard = ({ isAuthenticated, redirectTo = '/login', children }: AuthGuardProps) => {\n const ok = typeof isAuthenticated === 'function' ? isAuthenticated() : isAuthenticated\n return ok ? <>{children}</> : <Navigate to={redirectTo as LinkProps['to']} />\n}\n","import { Outlet, redirect, type LinkProps } from '@tanstack/react-router'\n\nexport interface AuthLayoutRouteOptions {\n /** Session check — returns whether the visitor is already signed in. */\n isAuthenticated: () => boolean\n /** Where to send an **already signed-in** visitor. Defaults to `'/'`. */\n redirectTo?: string\n}\n\n/**\n * Route options for the pathless `_auth` layout that groups the public auth pages (login,\n * forgot-password, reset-password, otp, …). In `beforeLoad` it bounces an already signed-in visitor to\n * `redirectTo`; otherwise it renders its children standalone (`component: Outlet`).\n *\n * Returns only the route **options** (`beforeLoad` + `component`) — not a whole route — because the\n * router plugin needs the literal path in the file. Compose it with `createFileRoute('/_auth')`.\n * `redirectTo` is a plain string, cast loosely to the router's `to` type (the library can't know the\n * app's typed route tree).\n *\n * @example\n * // routes/_auth.tsx\n * export const Route = createFileRoute('/_auth')(\n * authLayoutRoute({ isAuthenticated: session.isAuthenticated }),\n * )\n */\nexport const authLayoutRoute = ({ isAuthenticated, redirectTo = '/' }: AuthLayoutRouteOptions) => ({\n beforeLoad: () => {\n if (isAuthenticated()) throw redirect({ to: redirectTo as LinkProps['to'] })\n },\n component: Outlet,\n})\n"],"names":["AuthGuard","isAuthenticated","redirectTo","children","jsx","Fragment","Navigate","authLayoutRoute","redirect","Outlet"],"mappings":";;AAyBO,MAAMA,IAAY,CAAC,EAAE,iBAAAC,GAAiB,YAAAC,IAAa,UAAU,UAAAC,SACvD,OAAOF,KAAoB,aAAaA,MAAoBA,KAC3D,gBAAAG,EAAAC,GAAA,EAAG,UAAAF,EAAA,CAAS,IAAM,gBAAAC,EAACE,GAAA,EAAS,IAAIJ,EAAA,CAA+B,GCFhEK,IAAkB,CAAC,EAAE,iBAAAN,GAAiB,YAAAC,IAAa,WAAmC;AAAA,EACjG,YAAY,MAAM;AAChB,QAAID,IAAmB,OAAMO,EAAS,EAAE,IAAIN,GAA+B;AAAA,EAC7E;AAAA,EACA,WAAWO;AACb;"}
|