@techzyapp/ui-library 1.0.16 → 1.0.17
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-DUjVN8lu.cjs → AdminRoot-D866Bc0e.cjs} +2 -2
- package/dist/{AdminRoot-DUjVN8lu.cjs.map → AdminRoot-D866Bc0e.cjs.map} +1 -1
- package/dist/{AdminRoot-CyBIrszf.js → AdminRoot-uVDhWjN8.js} +2 -2
- package/dist/{AdminRoot-CyBIrszf.js.map → AdminRoot-uVDhWjN8.js.map} +1 -1
- package/dist/{Breadcrumbs-DsKwFBH5.js → Breadcrumbs-C1crufqj.js} +2 -2
- package/dist/{Breadcrumbs-DsKwFBH5.js.map → Breadcrumbs-C1crufqj.js.map} +1 -1
- package/dist/{Breadcrumbs-jVOE_Pg8.cjs → Breadcrumbs-s90MO0PD.cjs} +2 -2
- package/dist/{Breadcrumbs-jVOE_Pg8.cjs.map → Breadcrumbs-s90MO0PD.cjs.map} +1 -1
- package/dist/{PageNotFound-BxABP8Nj.cjs → PageNotFound-D3ZjMKYD.cjs} +2 -2
- package/dist/{PageNotFound-BxABP8Nj.cjs.map → PageNotFound-D3ZjMKYD.cjs.map} +1 -1
- package/dist/{PageNotFound-CvWgniQM.js → PageNotFound-DVh_Tyqf.js} +2 -2
- package/dist/{PageNotFound-CvWgniQM.js.map → PageNotFound-DVh_Tyqf.js.map} +1 -1
- package/dist/{RootLayout-ILyExULV.js → RootLayout-BEOofnxb.js} +3 -3
- package/dist/{RootLayout-ILyExULV.js.map → RootLayout-BEOofnxb.js.map} +1 -1
- package/dist/{RootLayout-C4suUXSJ.cjs → RootLayout-DGYOCwOK.cjs} +2 -2
- package/dist/{RootLayout-C4suUXSJ.cjs.map → RootLayout-DGYOCwOK.cjs.map} +1 -1
- package/dist/Sidebar-BYqUTa8D.cjs +2 -0
- package/dist/Sidebar-BYqUTa8D.cjs.map +1 -0
- package/dist/{Sidebar-DTqvtqAI.js → Sidebar-D2RZH5m5.js} +69 -62
- package/dist/Sidebar-D2RZH5m5.js.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 +11 -6
- package/dist/components/Sidebar/Sidebar.d.ts +11 -6
- package/dist/components/Sidebar/index.cjs +1 -1
- package/dist/components/Sidebar/index.js +1 -1
- package/dist/entries/app.cjs +1 -1
- package/dist/entries/app.js +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.js +5 -5
- package/package.json +1 -1
- package/dist/Sidebar-DQov7G-T.cjs +0 -2
- package/dist/Sidebar-DQov7G-T.cjs.map +0 -1
- package/dist/Sidebar-DTqvtqAI.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RootLayout-C4suUXSJ.cjs","sources":["../src/components/RootLayout/SettingsDrawer.tsx","../src/components/RootLayout/RootLayout.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { DEFAULT_FONT_FAMILY, useT, useTheme } from '../../theme'\nimport { Col } from '../Flex'\nimport { Divider } from '../Divider'\nimport { Modal } from '../Modal'\nimport { ChoiceCardGroup } from '../ChoiceCard'\nimport { Select } from '../Select'\nimport { SwatchPicker } from '../SwatchPicker'\nimport { Typography } from '../Typography'\n\n// Accent choices offered alongside the provider's default (which leads each list) — 15 per mode, so\n// each theme shows 16 total. Tuned PER MODE (deeper tones for light, brighter for dark) and paired by\n// hue (red → violet + a neutral) so a color keeps its identity across themes.\nconst ALT_SWATCHES: Record<'light' | 'dark', string[]> = {\n light: [\n '#dc2626', // red\n '#ea580c', // orange\n '#d97706', // amber\n '#ca8a04', // yellow\n '#65a30d', // lime\n '#16a34a', // green\n '#059669', // emerald\n '#0891b2', // cyan\n '#0284c7', // sky\n '#2563eb', // blue\n '#4f46e5', // indigo\n '#7c3aed', // violet\n '#c026d3', // fuchsia\n '#db2777', // pink\n '#475569', // slate\n ],\n dark: [\n '#f87171', // red\n '#fb923c', // orange\n '#fbbf24', // amber\n '#facc15', // yellow\n '#a3e635', // lime\n '#4ade80', // green\n '#34d399', // emerald\n '#22d3ee', // cyan\n '#38bdf8', // sky\n '#60a5fa', // blue\n '#818cf8', // indigo\n '#a78bfa', // violet\n '#e879f9', // fuchsia\n '#f472b6', // pink\n '#94a3b8', // slate\n ],\n}\n\nexport interface SettingsDrawerProps {\n /** Whether the drawer is open. */\n open: boolean\n /** Close handler. */\n onClose: () => void\n /** Show the light/dark **Theme** section (gated by the shell's `header.theme`, the same flag as the header toggle). */\n showTheme?: boolean\n}\n\n/**\n * The header user-menu **Settings** drawer (a right-side `Modal`), top to bottom: a **Theme** section — an\n * exclusive `ChoiceCardGroup` (**Light** / **Dark** cards) driving `useTheme().setMode`, shown only when\n * **`showTheme`** (the shell's `header.theme`, so the header toggle + this section appear/disappear\n * together); **Accent Color** — **two `SwatchPicker`s** (Light + Dark) so both accents are chosen\n * independently, each with a per-mode set (deeper tones for light, brighter for dark), calling\n * `setAccentColor(color, mode)` and persisting it — each list leads with the provider's default for that\n * mode (`defaultAccentColors[mode]`), selected when there's no override (picking it clears the override).\n * When `showTheme` is off the panel is locked to one mode, so **only the active mode's accent picker**\n * shows (the other is pointless without a theme switch);\n * a **Font** section (a searchable `Select` — Inter preset + type any Google Font — driving\n * `setFontFamily`); and a **Header** section (an exclusive `ChoiceCardGroup` **Scrollable** / **Fixed**\n * driving `setHeaderSticky`). Internal to the admin shell — not a public export.\n */\nexport function SettingsDrawer({ open, onClose, showTheme = true }: SettingsDrawerProps) {\n const {\n mode,\n setMode,\n accentColors,\n defaultAccentColors,\n setAccentColor,\n headerSticky,\n setHeaderSticky,\n fontFamily,\n setFontFamily,\n } = useTheme()\n const t = useT()\n\n // One searchable Select doubles as a \"type any Google Font\" field. Base = Inter (the only preset) +\n // the active font (so a custom pick stays visible/selectable). While searching, the typed query is\n // offered as its own option — picking it applies + loads that family. Base is always kept in the\n // list (never filtered out) so `value` always resolves in the trigger, even mid-search.\n const [fontQuery, setFontQuery] = useState('')\n const q = fontQuery.trim()\n const base =\n fontFamily !== DEFAULT_FONT_FAMILY ? [DEFAULT_FONT_FAMILY, fontFamily] : [DEFAULT_FONT_FAMILY]\n const showTyped = q.length > 0 && !base.some((f) => f.toLowerCase() === q.toLowerCase())\n const fontOptions = (showTyped ? [q, ...base] : base).map((f) => ({\n value: f,\n label: f === DEFAULT_FONT_FAMILY ? t('settings.fontDefault', { font: f }) : f,\n }))\n\n const picker = (mode: 'light' | 'dark', label: string) => {\n const def = defaultAccentColors[mode]\n // the provider's default (per mode) leads the list; then the mode's alts (minus any collision)\n const colors = [def, ...ALT_SWATCHES[mode].filter((c) => c.toLowerCase() !== def.toLowerCase())]\n return (\n <SwatchPicker\n label={label}\n colors={colors}\n // with no override, this mode's default swatch reads as selected\n value={accentColors[mode] ?? def}\n // the default swatch clears this mode's override; the rest set it\n onChange={(color) =>\n setAccentColor(color.toLowerCase() === def.toLowerCase() ? null : color, mode)\n }\n labels={{ [def]: t('settings.accentDefault', { color: def }) }}\n aria-label={String(label)}\n />\n )\n }\n\n return (\n <Modal\n open={open}\n onClose={onClose}\n placement=\"right\"\n size=\"sm\"\n title={t('settings.label')}\n icon=\"Setting5\"\n >\n {showTheme && (\n <>\n <Typography variant=\"subtitle\" as=\"h3\">\n {t('settings.themeTitle')}\n </Typography>\n <Typography\n variant=\"bodySmall\"\n color=\"muted\"\n as=\"p\"\n style={{ marginTop: 'var(--tz-space-xxs)' }}\n >\n {t('settings.themeDesc')}\n </Typography>\n <ChoiceCardGroup\n exclusive\n color=\"accent\"\n minCardWidth={130}\n value={mode}\n onChange={(v) => {\n if (typeof v === 'string') setMode(v as 'light' | 'dark')\n }}\n options={[\n {\n value: 'light',\n label: t('settings.light'),\n description: t('settings.lightDesc'),\n icon: 'Sun',\n },\n {\n value: 'dark',\n label: t('settings.dark'),\n description: t('settings.darkDesc'),\n icon: 'Moon',\n },\n ]}\n aria-label={t('settings.themeTitle')}\n style={{ marginTop: 'var(--tz-space-sm)' }}\n />\n\n <Divider style={{ margin: 'var(--tz-space-md) 0' }} />\n </>\n )}\n\n <Typography variant=\"subtitle\" as=\"h3\">\n {t('settings.accentTitle')}\n </Typography>\n <Typography\n variant=\"bodySmall\"\n color=\"muted\"\n as=\"p\"\n style={{ marginTop: 'var(--tz-space-xxs)' }}\n >\n {t('settings.accentDesc')}\n </Typography>\n <Col gap=\"md\" style={{ marginTop: 'var(--tz-space-sm)' }}>\n {showTheme ? (\n <>\n {picker('light', t('settings.lightTheme'))}\n {picker('dark', t('settings.darkTheme'))}\n </>\n ) : (\n // theme switching is off → the panel stays in one mode, so only that mode's accent matters\n picker(mode, mode === 'light' ? t('settings.lightTheme') : t('settings.darkTheme'))\n )}\n </Col>\n\n <Divider style={{ margin: 'var(--tz-space-md) 0' }} />\n\n <Typography variant=\"subtitle\" as=\"h3\">\n {t('settings.fontTitle')}\n </Typography>\n <Typography\n variant=\"bodySmall\"\n color=\"muted\"\n as=\"p\"\n style={{ marginTop: 'var(--tz-space-xxs)' }}\n >\n {t('settings.fontDesc')}\n </Typography>\n <Select\n label={t('settings.fontFamily')}\n searchable\n searchPlaceholder={t('settings.fontSearch')}\n value={fontFamily}\n options={fontOptions}\n onSearchChange={setFontQuery}\n onChange={(v) => {\n setFontFamily(v)\n setFontQuery('')\n }}\n aria-label={t('settings.fontFamily')}\n style={{ marginTop: 'var(--tz-space-sm)' }}\n />\n\n <Divider style={{ margin: 'var(--tz-space-md) 0' }} />\n\n <Typography variant=\"subtitle\" as=\"h3\">\n {t('settings.headerTitle')}\n </Typography>\n <Typography\n variant=\"bodySmall\"\n color=\"muted\"\n as=\"p\"\n style={{ marginTop: 'var(--tz-space-xxs)' }}\n >\n {t('settings.headerDesc')}\n </Typography>\n <ChoiceCardGroup\n exclusive\n color=\"accent\"\n minCardWidth={130}\n value={headerSticky ? 'fixed' : 'static'}\n // exclusive (radio) → always a string; set sticky from the picked card\n onChange={(v) => {\n if (typeof v === 'string') setHeaderSticky(v === 'fixed')\n }}\n options={[\n {\n value: 'static',\n label: t('settings.scrollable'),\n description: t('settings.scrollableDesc'),\n },\n { value: 'fixed', label: t('settings.fixed'), description: t('settings.fixedDesc') },\n ]}\n aria-label={t('settings.headerTitle')}\n style={{ marginTop: 'var(--tz-space-sm)' }}\n />\n </Modal>\n )\n}\n","import { useEffect, useState, type ReactNode } from 'react'\nimport { useRouterState } from '@tanstack/react-router'\nimport { clsx } from 'clsx'\nimport { useMediaQuery } from '../../hooks/useMediaQuery'\nimport { useLockBodyScroll } from '../../hooks/useLockBodyScroll'\nimport {\n useHeaderConfig,\n useLanguage,\n useT,\n useTheme,\n type HeaderConfig,\n type HeaderUser,\n} from '../../theme'\nimport { Avatar } from '../Avatar'\nimport { Col, Row } from '../Flex'\nimport { Divider } from '../Divider'\nimport { Dropdown } from '../Dropdown'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { ListItem } from '../List'\nimport { FullscreenToggle } from '../FullscreenToggle'\nimport { ThemeToggle } from '../ThemeToggle'\nimport { Typography } from '../Typography'\nimport { Breadcrumbs } from '../Breadcrumbs'\nimport { Toaster, type ToasterProps } from '../Toast'\nimport { NavSearch, Sidebar, usePageTitle } from '../Sidebar/Sidebar'\nimport { Flag } from '../Flag'\nimport { SettingsDrawer } from './SettingsDrawer'\nimport styles from './RootLayout.module.css'\n\n/**\n * The shell header config + its user shape now live in the theme layer (so `config.header` can carry\n * them app-wide). These aliases keep the historical `RootLayout*` names importable.\n */\nexport type RootLayoutUser = HeaderUser\nexport type RootLayoutHeader = HeaderConfig\n\nexport interface RootLayoutProps {\n /** Brand logo at the top of the sidebar card — pass an `<img>`, an `<Icon>`, or any node. */\n logo?: ReactNode\n /** Optional content pinned to the **bottom of the sidebar** (e.g. a promo / \"Need help?\" card). */\n sidebarFooter?: ReactNode\n /**\n * Header config for **this** shell — merged **over** the app-wide `config.header` (the prop wins).\n * Fields: the built-in `theme` / `search` / `settings` / `languages` toggles (default `true`),\n * `fullscreen` (default `false`), `breadcrumbs` (default `true`), `pageTitle` (default `true`), and the\n * account (`onLogout` / `user`).\n */\n header?: RootLayoutHeader\n /**\n * The built-in toast viewport, mounted for you so `toast.*()` works app-wide with no extra setup.\n * Defaults to `true` (a `<Toaster>` with its defaults). Pass `ToasterProps` to configure it\n * (`{ position, duration }`), or `false` to opt out — e.g. when you mount your own `<Toaster>`.\n */\n toaster?: boolean | ToasterProps\n /** Routed content — the consumer passes `<Outlet />`. */\n children: ReactNode\n}\n\n/**\n * The admin-panel shell — a **floating** layout: the whole app sits on a soft `--tz-color-background`\n * canvas, with a rounded, elevated `--tz-color-surface` **sidebar card** (`logo` + auto-generated `Sidebar` + an optional\n * `sidebarFooter`) beside the header + content. Set it as the root route's component and pass\n * `<Outlet />` as `children`; the `Sidebar` builds itself from the routes' `staticData`. The header\n * holds an optional `ThemeToggle` (on by default), a **Settings** button (opens a right-side drawer to\n * pick + persist the `accent` color), plus an account `Avatar` whose menu has a **Sign out** item when\n * `header.onLogout` is given. The content area stacks\n * **`Breadcrumbs` → the page title (the active route's `staticData.name`) → `children`**; pages wrap\n * their own body in `PageLayout`. Set `header.pageTitle = false` to drop the auto `h2` when pages\n * carry their own heading inside their `PageLayout` header. On a 404 the auto title + breadcrumbs are\n * suppressed automatically (a partial route match would otherwise show a stale section), regardless of\n * the `header.pageTitle` / `header.breadcrumbs` props. A `<Toaster>` is **mounted by default** so\n * `toast.*()` works app-wide with no extra setup (configure via `toaster`, or `toaster={false}` to opt\n * out). Styling is token-based, so it follows the active `ConfigProvider` mode. Requires\n * `@tanstack/react-router` (peer).\n */\nexport function RootLayout({\n logo,\n sidebarFooter,\n header,\n toaster = true,\n children,\n}: RootLayoutProps) {\n const title = usePageTitle()\n // header sticky/static — the user's persisted choice (seeded from config.header.sticky)\n const { headerSticky } = useTheme()\n const { language, setLanguage, languages } = useLanguage()\n const t = useT()\n // app-wide header config (config.header) as the base; this shell's `header` prop wins over it\n const configHeader = useHeaderConfig()\n const h: HeaderConfig = { ...configHeader, ...header }\n const showTheme = h.theme ?? true\n const showFullscreen = h.fullscreen ?? false\n const showSettings = h.settings ?? true\n const showSearch = h.search ?? true\n const showLanguages = h.languages ?? true\n const showBreadcrumbs = h.breadcrumbs ?? true\n const toasterProps = typeof toaster === 'object' ? toaster : undefined\n const showPageTitle = h.pageTitle ?? true\n const onLogout = h.onLogout\n const user = h.user\n // below 1280px the sidebar auto-collapses (and auto-expands again above it); a manual toggle holds\n // until the next breakpoint cross. `useMediaQuery` is correct on the first client render, so no flash.\n const isNarrow = useMediaQuery('md') // ≤ 1279.98px — the shared `md` breakpoint\n const [collapsed, setCollapsed] = useState(isNarrow)\n useEffect(() => {\n setCollapsed(isNarrow)\n }, [isNarrow])\n // while the sidebar overlays the content (narrow + open), lock page scroll so scrolling inside the\n // drawer doesn't scroll the content behind it\n useLockBodyScroll(isNarrow && !collapsed)\n // navigating from the overlay drawer (a nav link or a search suggestion — both change the route) auto-\n // closes it, so you land on the page instead of the still-open sidebar; desktop navigation is untouched\n const pathname = useRouterState({ select: (s) => s.location.pathname })\n useEffect(() => {\n if (isNarrow) setCollapsed(true)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [pathname])\n // on a 404 the URL often partially matches a named layout route (e.g. `/core/xxx` still resolves\n // \"Core\" as the active section), so the auto page title + breadcrumbs would show a stale, wrong trail.\n // suppress both when the router is in a notFound state — automatic, no opt-out needed. `statusCode ===\n // 404` is the primary signal; a `notFound` match status is the fallback.\n const isNotFound = useRouterState({\n select: (s) => s.statusCode === 404 || s.matches.some((m) => m.status === 'notFound'),\n })\n const [settingsOpen, setSettingsOpen] = useState(false)\n\n return (\n <div className={clsx(styles.shell, collapsed && styles.shellCollapsed)}>\n <aside className={styles.sidebar}>\n {/* fixed-width inner: the outer <aside> animates its width to 0 (and clips via overflow),\n while this keeps the sidebar's real width so the content never reflows mid-collapse */}\n <div className={styles.sidebarInner}>\n {logo ? (\n <div className={styles.brand}>\n {logo}\n {/* in-drawer close — only shown when the sidebar overlays (narrow), where the header\n toggle is behind the backdrop; closes the drawer */}\n <IconButton\n variant=\"filled\"\n size=\"sm\"\n className={styles.sidebarClose}\n aria-label={t('common.close')}\n onClick={() => setCollapsed(true)}\n >\n <Icon name=\"Close\" />\n </IconButton>\n </div>\n ) : null}\n {/* the search lives in the header on desktop; below 576px (full-width drawer) it moves here,\n between the logo and the menu (CSS toggles which instance shows) */}\n {showSearch ? (\n <div className={styles.sidebarSearch}>\n <NavSearch />\n </div>\n ) : null}\n <div className={styles.navScroll}>\n <Sidebar />\n </div>\n {sidebarFooter ? <div className={styles.sidebarFooter}>{sidebarFooter}</div> : null}\n </div>\n </aside>\n {/* dim backdrop behind the overlay sidebar — a sibling of the sidebar (same stacking context, so the\n sidebar reliably sits above it, unlike a body-portaled Overlay). Only shown/interactive below\n 1280px while open (CSS); clicking it closes the drawer. On desktop the sidebar is a grid column. */}\n <div className={styles.backdrop} onClick={() => setCollapsed(true)} aria-hidden=\"true\" />\n <div className={styles.main}>\n <header className={clsx(styles.topbar, headerSticky && styles.topbarSticky)}>\n <div className={styles.headerStart}>\n <IconButton\n aria-label={collapsed ? 'Show sidebar' : 'Hide sidebar'}\n aria-expanded={!collapsed}\n variant=\"filled\"\n size=\"sm\"\n onClick={() => setCollapsed((c) => !c)}\n >\n <Icon name=\"Menu\" />\n </IconButton>\n {showSearch ? (\n <div className={styles.headerSearch}>\n <NavSearch />\n </div>\n ) : null}\n </div>\n <div className={styles.headerEnd}>\n {showFullscreen ? <FullscreenToggle variant=\"filled\" size=\"sm\" /> : null}\n {showTheme ? <ThemeToggle variant=\"filled\" size=\"sm\" /> : null}\n {showLanguages && languages.length > 1 ? (\n <Dropdown\n placement=\"bottom-end\"\n trigger={\n <IconButton variant=\"filled\" size=\"sm\" aria-label={t('language.label')}>\n <Icon name=\"Global\" />\n </IconButton>\n }\n >\n {languages.map((l) => (\n <ListItem\n key={l.code}\n clickable\n selected={l.code === language}\n onClick={() => setLanguage(l.code)}\n icon={<Flag code={l.code} />}\n >\n {l.label ?? l.code}\n </ListItem>\n ))}\n </Dropdown>\n ) : null}\n {showSettings ? (\n <IconButton\n aria-label={t('settings.label')}\n variant=\"text\"\n size=\"sm\"\n className={styles.settings}\n onClick={() => setSettingsOpen(true)}\n >\n <Icon name=\"Setting5\" />\n </IconButton>\n ) : null}\n {onLogout ? (\n <Dropdown\n placement=\"bottom-end\"\n trigger={\n <button type=\"button\" className={styles.account} aria-label={t('account.label')}>\n <Avatar size=\"md\" name={user?.name} src={user?.avatar} color=\"primary\" />\n </button>\n }\n >\n {user ? (\n <>\n <Row gap={8} align=\"center\" padding=\"var(--tz-space-xxs) var(--tz-space-sm)\">\n <Avatar size=\"sm\" name={user.name} src={user.avatar} color=\"primary\" />\n <Col gap={2}>\n {user.name ? (\n <Typography variant=\"bodySmall\">{user.name}</Typography>\n ) : null}\n {user.email ? (\n <Typography variant=\"caption\" color=\"muted\">\n {user.email}\n </Typography>\n ) : null}\n </Col>\n </Row>\n <Divider />\n </>\n ) : null}\n <ListItem icon={<Icon name=\"Logout2\" color=\"error\" />} clickable onClick={onLogout}>\n {t('userCard.signOut')}\n </ListItem>\n </Dropdown>\n ) : null}\n </div>\n </header>\n <main className={styles.content}>\n {showBreadcrumbs && !isNotFound ? <Breadcrumbs /> : null}\n {showPageTitle && !isNotFound && title ? (\n <Typography variant=\"h2\" className={styles.pageTitle}>\n {title}\n </Typography>\n ) : null}\n {children}\n </main>\n </div>\n {toaster !== false && <Toaster {...toasterProps} />}\n {showSettings ? (\n <SettingsDrawer\n open={settingsOpen}\n onClose={() => setSettingsOpen(false)}\n showTheme={showTheme}\n />\n ) : null}\n </div>\n )\n}\n"],"names":["ALT_SWATCHES","SettingsDrawer","open","onClose","showTheme","mode","setMode","accentColors","defaultAccentColors","setAccentColor","headerSticky","setHeaderSticky","fontFamily","setFontFamily","useTheme","t","useT","fontQuery","setFontQuery","useState","q","base","DEFAULT_FONT_FAMILY","fontOptions","f","picker","label","def","colors","c","jsx","SwatchPicker","color","jsxs","Modal","Fragment","Typography","ChoiceCardGroup","v","Divider","Col","Select","RootLayout","logo","sidebarFooter","header","toaster","children","title","usePageTitle","language","setLanguage","languages","useLanguage","h","useHeaderConfig","showFullscreen","showSettings","showSearch","showLanguages","showBreadcrumbs","toasterProps","showPageTitle","onLogout","user","isNarrow","useMediaQuery","collapsed","setCollapsed","useEffect","useLockBodyScroll","pathname","useRouterState","s","isNotFound","m","settingsOpen","setSettingsOpen","clsx","styles","IconButton","Icon","NavSearch","Sidebar","FullscreenToggle","ThemeToggle","Dropdown","l","ListItem","Flag","Avatar","Row","Breadcrumbs","Toaster"],"mappings":"k6BAaMA,GAAmD,CACvD,MAAO,CACL,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,SAAA,EAEF,KAAM,CACJ,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,SAAA,CAEJ,EAyBO,SAASC,GAAe,CAAE,KAAAC,EAAM,QAAAC,EAAS,UAAAC,EAAY,IAA6B,CACvF,KAAM,CACJ,KAAAC,EACA,QAAAC,EACA,aAAAC,EACA,oBAAAC,EACA,eAAAC,EACA,aAAAC,EACA,gBAAAC,EACA,WAAAC,EACA,cAAAC,CAAA,EACEC,WAAA,EACEC,EAAIC,EAAAA,KAAA,EAMJ,CAACC,EAAWC,CAAY,EAAIC,EAAAA,SAAS,EAAE,EACvCC,EAAIH,EAAU,KAAA,EACdI,EACJT,IAAeU,EAAAA,oBAAsB,CAACA,EAAAA,oBAAqBV,CAAU,EAAI,CAACU,qBAAmB,EAEzFC,GADYH,EAAE,OAAS,GAAK,CAACC,EAA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sources":["../src/components/RootLayout/SettingsDrawer.tsx","../src/components/RootLayout/RootLayout.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { DEFAULT_FONT_FAMILY, useT, useTheme } from '../../theme'\nimport { Col } from '../Flex'\nimport { Divider } from '../Divider'\nimport { Modal } from '../Modal'\nimport { ChoiceCardGroup } from '../ChoiceCard'\nimport { Select } from '../Select'\nimport { SwatchPicker } from '../SwatchPicker'\nimport { Typography } from '../Typography'\n\n// Accent choices offered alongside the provider's default (which leads each list) — 15 per mode, so\n// each theme shows 16 total. Tuned PER MODE (deeper tones for light, brighter for dark) and paired by\n// hue (red → violet + a neutral) so a color keeps its identity across themes.\nconst ALT_SWATCHES: Record<'light' | 'dark', string[]> = {\n light: [\n '#dc2626', // red\n '#ea580c', // orange\n '#d97706', // amber\n '#ca8a04', // yellow\n '#65a30d', // lime\n '#16a34a', // green\n '#059669', // emerald\n '#0891b2', // cyan\n '#0284c7', // sky\n '#2563eb', // blue\n '#4f46e5', // indigo\n '#7c3aed', // violet\n '#c026d3', // fuchsia\n '#db2777', // pink\n '#475569', // slate\n ],\n dark: [\n '#f87171', // red\n '#fb923c', // orange\n '#fbbf24', // amber\n '#facc15', // yellow\n '#a3e635', // lime\n '#4ade80', // green\n '#34d399', // emerald\n '#22d3ee', // cyan\n '#38bdf8', // sky\n '#60a5fa', // blue\n '#818cf8', // indigo\n '#a78bfa', // violet\n '#e879f9', // fuchsia\n '#f472b6', // pink\n '#94a3b8', // slate\n ],\n}\n\nexport interface SettingsDrawerProps {\n /** Whether the drawer is open. */\n open: boolean\n /** Close handler. */\n onClose: () => void\n /** Show the light/dark **Theme** section (gated by the shell's `header.theme`, the same flag as the header toggle). */\n showTheme?: boolean\n}\n\n/**\n * The header user-menu **Settings** drawer (a right-side `Modal`), top to bottom: a **Theme** section — an\n * exclusive `ChoiceCardGroup` (**Light** / **Dark** cards) driving `useTheme().setMode`, shown only when\n * **`showTheme`** (the shell's `header.theme`, so the header toggle + this section appear/disappear\n * together); **Accent Color** — **two `SwatchPicker`s** (Light + Dark) so both accents are chosen\n * independently, each with a per-mode set (deeper tones for light, brighter for dark), calling\n * `setAccentColor(color, mode)` and persisting it — each list leads with the provider's default for that\n * mode (`defaultAccentColors[mode]`), selected when there's no override (picking it clears the override).\n * When `showTheme` is off the panel is locked to one mode, so **only the active mode's accent picker**\n * shows (the other is pointless without a theme switch);\n * a **Font** section (a searchable `Select` — Inter preset + type any Google Font — driving\n * `setFontFamily`); and a **Header** section (an exclusive `ChoiceCardGroup` **Scrollable** / **Fixed**\n * driving `setHeaderSticky`). Internal to the admin shell — not a public export.\n */\nexport function SettingsDrawer({ open, onClose, showTheme = true }: SettingsDrawerProps) {\n const {\n mode,\n setMode,\n accentColors,\n defaultAccentColors,\n setAccentColor,\n headerSticky,\n setHeaderSticky,\n fontFamily,\n setFontFamily,\n } = useTheme()\n const t = useT()\n\n // One searchable Select doubles as a \"type any Google Font\" field. Base = Inter (the only preset) +\n // the active font (so a custom pick stays visible/selectable). While searching, the typed query is\n // offered as its own option — picking it applies + loads that family. Base is always kept in the\n // list (never filtered out) so `value` always resolves in the trigger, even mid-search.\n const [fontQuery, setFontQuery] = useState('')\n const q = fontQuery.trim()\n const base =\n fontFamily !== DEFAULT_FONT_FAMILY ? [DEFAULT_FONT_FAMILY, fontFamily] : [DEFAULT_FONT_FAMILY]\n const showTyped = q.length > 0 && !base.some((f) => f.toLowerCase() === q.toLowerCase())\n const fontOptions = (showTyped ? [q, ...base] : base).map((f) => ({\n value: f,\n label: f === DEFAULT_FONT_FAMILY ? t('settings.fontDefault', { font: f }) : f,\n }))\n\n const picker = (mode: 'light' | 'dark', label: string) => {\n const def = defaultAccentColors[mode]\n // the provider's default (per mode) leads the list; then the mode's alts (minus any collision)\n const colors = [def, ...ALT_SWATCHES[mode].filter((c) => c.toLowerCase() !== def.toLowerCase())]\n return (\n <SwatchPicker\n label={label}\n colors={colors}\n // with no override, this mode's default swatch reads as selected\n value={accentColors[mode] ?? def}\n // the default swatch clears this mode's override; the rest set it\n onChange={(color) =>\n setAccentColor(color.toLowerCase() === def.toLowerCase() ? null : color, mode)\n }\n labels={{ [def]: t('settings.accentDefault', { color: def }) }}\n aria-label={String(label)}\n />\n )\n }\n\n return (\n <Modal\n open={open}\n onClose={onClose}\n placement=\"right\"\n size=\"sm\"\n title={t('settings.label')}\n icon=\"Setting5\"\n >\n {showTheme && (\n <>\n <Typography variant=\"subtitle\" as=\"h3\">\n {t('settings.themeTitle')}\n </Typography>\n <Typography\n variant=\"bodySmall\"\n color=\"muted\"\n as=\"p\"\n style={{ marginTop: 'var(--tz-space-xxs)' }}\n >\n {t('settings.themeDesc')}\n </Typography>\n <ChoiceCardGroup\n exclusive\n color=\"accent\"\n minCardWidth={130}\n value={mode}\n onChange={(v) => {\n if (typeof v === 'string') setMode(v as 'light' | 'dark')\n }}\n options={[\n {\n value: 'light',\n label: t('settings.light'),\n description: t('settings.lightDesc'),\n icon: 'Sun',\n },\n {\n value: 'dark',\n label: t('settings.dark'),\n description: t('settings.darkDesc'),\n icon: 'Moon',\n },\n ]}\n aria-label={t('settings.themeTitle')}\n style={{ marginTop: 'var(--tz-space-sm)' }}\n />\n\n <Divider style={{ margin: 'var(--tz-space-md) 0' }} />\n </>\n )}\n\n <Typography variant=\"subtitle\" as=\"h3\">\n {t('settings.accentTitle')}\n </Typography>\n <Typography\n variant=\"bodySmall\"\n color=\"muted\"\n as=\"p\"\n style={{ marginTop: 'var(--tz-space-xxs)' }}\n >\n {t('settings.accentDesc')}\n </Typography>\n <Col gap=\"md\" style={{ marginTop: 'var(--tz-space-sm)' }}>\n {showTheme ? (\n <>\n {picker('light', t('settings.lightTheme'))}\n {picker('dark', t('settings.darkTheme'))}\n </>\n ) : (\n // theme switching is off → the panel stays in one mode, so only that mode's accent matters\n picker(mode, mode === 'light' ? t('settings.lightTheme') : t('settings.darkTheme'))\n )}\n </Col>\n\n <Divider style={{ margin: 'var(--tz-space-md) 0' }} />\n\n <Typography variant=\"subtitle\" as=\"h3\">\n {t('settings.fontTitle')}\n </Typography>\n <Typography\n variant=\"bodySmall\"\n color=\"muted\"\n as=\"p\"\n style={{ marginTop: 'var(--tz-space-xxs)' }}\n >\n {t('settings.fontDesc')}\n </Typography>\n <Select\n label={t('settings.fontFamily')}\n searchable\n searchPlaceholder={t('settings.fontSearch')}\n value={fontFamily}\n options={fontOptions}\n onSearchChange={setFontQuery}\n onChange={(v) => {\n setFontFamily(v)\n setFontQuery('')\n }}\n aria-label={t('settings.fontFamily')}\n style={{ marginTop: 'var(--tz-space-sm)' }}\n />\n\n <Divider style={{ margin: 'var(--tz-space-md) 0' }} />\n\n <Typography variant=\"subtitle\" as=\"h3\">\n {t('settings.headerTitle')}\n </Typography>\n <Typography\n variant=\"bodySmall\"\n color=\"muted\"\n as=\"p\"\n style={{ marginTop: 'var(--tz-space-xxs)' }}\n >\n {t('settings.headerDesc')}\n </Typography>\n <ChoiceCardGroup\n exclusive\n color=\"accent\"\n minCardWidth={130}\n value={headerSticky ? 'fixed' : 'static'}\n // exclusive (radio) → always a string; set sticky from the picked card\n onChange={(v) => {\n if (typeof v === 'string') setHeaderSticky(v === 'fixed')\n }}\n options={[\n {\n value: 'static',\n label: t('settings.scrollable'),\n description: t('settings.scrollableDesc'),\n },\n { value: 'fixed', label: t('settings.fixed'), description: t('settings.fixedDesc') },\n ]}\n aria-label={t('settings.headerTitle')}\n style={{ marginTop: 'var(--tz-space-sm)' }}\n />\n </Modal>\n )\n}\n","import { useEffect, useState, type ReactNode } from 'react'\nimport { useRouterState } from '@tanstack/react-router'\nimport { clsx } from 'clsx'\nimport { useMediaQuery } from '../../hooks/useMediaQuery'\nimport { useLockBodyScroll } from '../../hooks/useLockBodyScroll'\nimport {\n useHeaderConfig,\n useLanguage,\n useT,\n useTheme,\n type HeaderConfig,\n type HeaderUser,\n} from '../../theme'\nimport { Avatar } from '../Avatar'\nimport { Col, Row } from '../Flex'\nimport { Divider } from '../Divider'\nimport { Dropdown } from '../Dropdown'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { ListItem } from '../List'\nimport { FullscreenToggle } from '../FullscreenToggle'\nimport { ThemeToggle } from '../ThemeToggle'\nimport { Typography } from '../Typography'\nimport { Breadcrumbs } from '../Breadcrumbs'\nimport { Toaster, type ToasterProps } from '../Toast'\nimport { NavSearch, Sidebar, usePageTitle } from '../Sidebar/Sidebar'\nimport { Flag } from '../Flag'\nimport { SettingsDrawer } from './SettingsDrawer'\nimport styles from './RootLayout.module.css'\n\n/**\n * The shell header config + its user shape now live in the theme layer (so `config.header` can carry\n * them app-wide). These aliases keep the historical `RootLayout*` names importable.\n */\nexport type RootLayoutUser = HeaderUser\nexport type RootLayoutHeader = HeaderConfig\n\nexport interface RootLayoutProps {\n /** Brand logo at the top of the sidebar card — pass an `<img>`, an `<Icon>`, or any node. */\n logo?: ReactNode\n /** Optional content pinned to the **bottom of the sidebar** (e.g. a promo / \"Need help?\" card). */\n sidebarFooter?: ReactNode\n /**\n * Header config for **this** shell — merged **over** the app-wide `config.header` (the prop wins).\n * Fields: the built-in `theme` / `search` / `settings` / `languages` toggles (default `true`),\n * `fullscreen` (default `false`), `breadcrumbs` (default `true`), `pageTitle` (default `true`), and the\n * account (`onLogout` / `user`).\n */\n header?: RootLayoutHeader\n /**\n * The built-in toast viewport, mounted for you so `toast.*()` works app-wide with no extra setup.\n * Defaults to `true` (a `<Toaster>` with its defaults). Pass `ToasterProps` to configure it\n * (`{ position, duration }`), or `false` to opt out — e.g. when you mount your own `<Toaster>`.\n */\n toaster?: boolean | ToasterProps\n /** Routed content — the consumer passes `<Outlet />`. */\n children: ReactNode\n}\n\n/**\n * The admin-panel shell — a **floating** layout: the whole app sits on a soft `--tz-color-background`\n * canvas, with a rounded, elevated `--tz-color-surface` **sidebar card** (`logo` + auto-generated `Sidebar` + an optional\n * `sidebarFooter`) beside the header + content. Set it as the root route's component and pass\n * `<Outlet />` as `children`; the `Sidebar` builds itself from the routes' `staticData`. The header\n * holds an optional `ThemeToggle` (on by default), a **Settings** button (opens a right-side drawer to\n * pick + persist the `accent` color), plus an account `Avatar` whose menu has a **Sign out** item when\n * `header.onLogout` is given. The content area stacks\n * **`Breadcrumbs` → the page title (the active route's `staticData.name`) → `children`**; pages wrap\n * their own body in `PageLayout`. Set `header.pageTitle = false` to drop the auto `h2` when pages\n * carry their own heading inside their `PageLayout` header. On a 404 the auto title + breadcrumbs are\n * suppressed automatically (a partial route match would otherwise show a stale section), regardless of\n * the `header.pageTitle` / `header.breadcrumbs` props. A `<Toaster>` is **mounted by default** so\n * `toast.*()` works app-wide with no extra setup (configure via `toaster`, or `toaster={false}` to opt\n * out). Styling is token-based, so it follows the active `ConfigProvider` mode. Requires\n * `@tanstack/react-router` (peer).\n */\nexport function RootLayout({\n logo,\n sidebarFooter,\n header,\n toaster = true,\n children,\n}: RootLayoutProps) {\n const title = usePageTitle()\n // header sticky/static — the user's persisted choice (seeded from config.header.sticky)\n const { headerSticky } = useTheme()\n const { language, setLanguage, languages } = useLanguage()\n const t = useT()\n // app-wide header config (config.header) as the base; this shell's `header` prop wins over it\n const configHeader = useHeaderConfig()\n const h: HeaderConfig = { ...configHeader, ...header }\n const showTheme = h.theme ?? true\n const showFullscreen = h.fullscreen ?? false\n const showSettings = h.settings ?? true\n const showSearch = h.search ?? true\n const showLanguages = h.languages ?? true\n const showBreadcrumbs = h.breadcrumbs ?? true\n const toasterProps = typeof toaster === 'object' ? toaster : undefined\n const showPageTitle = h.pageTitle ?? true\n const onLogout = h.onLogout\n const user = h.user\n // below 1280px the sidebar auto-collapses (and auto-expands again above it); a manual toggle holds\n // until the next breakpoint cross. `useMediaQuery` is correct on the first client render, so no flash.\n const isNarrow = useMediaQuery('md') // ≤ 1279.98px — the shared `md` breakpoint\n const [collapsed, setCollapsed] = useState(isNarrow)\n useEffect(() => {\n setCollapsed(isNarrow)\n }, [isNarrow])\n // while the sidebar overlays the content (narrow + open), lock page scroll so scrolling inside the\n // drawer doesn't scroll the content behind it\n useLockBodyScroll(isNarrow && !collapsed)\n // navigating from the overlay drawer (a nav link or a search suggestion — both change the route) auto-\n // closes it, so you land on the page instead of the still-open sidebar; desktop navigation is untouched\n const pathname = useRouterState({ select: (s) => s.location.pathname })\n useEffect(() => {\n if (isNarrow) setCollapsed(true)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [pathname])\n // on a 404 the URL often partially matches a named layout route (e.g. `/core/xxx` still resolves\n // \"Core\" as the active section), so the auto page title + breadcrumbs would show a stale, wrong trail.\n // suppress both when the router is in a notFound state — automatic, no opt-out needed. `statusCode ===\n // 404` is the primary signal; a `notFound` match status is the fallback.\n const isNotFound = useRouterState({\n select: (s) => s.statusCode === 404 || s.matches.some((m) => m.status === 'notFound'),\n })\n const [settingsOpen, setSettingsOpen] = useState(false)\n\n return (\n <div className={clsx(styles.shell, collapsed && styles.shellCollapsed)}>\n <aside className={styles.sidebar}>\n {/* fixed-width inner: the outer <aside> animates its width to 0 (and clips via overflow),\n while this keeps the sidebar's real width so the content never reflows mid-collapse */}\n <div className={styles.sidebarInner}>\n {logo ? (\n <div className={styles.brand}>\n {logo}\n {/* in-drawer close — only shown when the sidebar overlays (narrow), where the header\n toggle is behind the backdrop; closes the drawer */}\n <IconButton\n variant=\"filled\"\n size=\"sm\"\n className={styles.sidebarClose}\n aria-label={t('common.close')}\n onClick={() => setCollapsed(true)}\n >\n <Icon name=\"Close\" />\n </IconButton>\n </div>\n ) : null}\n {/* the search lives in the header on desktop; below 576px (full-width drawer) it moves here,\n between the logo and the menu (CSS toggles which instance shows) */}\n {showSearch ? (\n <div className={styles.sidebarSearch}>\n <NavSearch />\n </div>\n ) : null}\n <div className={styles.navScroll}>\n <Sidebar />\n </div>\n {sidebarFooter ? <div className={styles.sidebarFooter}>{sidebarFooter}</div> : null}\n </div>\n </aside>\n {/* dim backdrop behind the overlay sidebar — a sibling of the sidebar (same stacking context, so the\n sidebar reliably sits above it, unlike a body-portaled Overlay). Only shown/interactive below\n 1280px while open (CSS); clicking it closes the drawer. On desktop the sidebar is a grid column. */}\n <div className={styles.backdrop} onClick={() => setCollapsed(true)} aria-hidden=\"true\" />\n <div className={styles.main}>\n <header className={clsx(styles.topbar, headerSticky && styles.topbarSticky)}>\n <div className={styles.headerStart}>\n <IconButton\n aria-label={collapsed ? 'Show sidebar' : 'Hide sidebar'}\n aria-expanded={!collapsed}\n variant=\"filled\"\n size=\"sm\"\n onClick={() => setCollapsed((c) => !c)}\n >\n <Icon name=\"Menu\" />\n </IconButton>\n {showSearch ? (\n <div className={styles.headerSearch}>\n <NavSearch />\n </div>\n ) : null}\n </div>\n <div className={styles.headerEnd}>\n {showFullscreen ? <FullscreenToggle variant=\"filled\" size=\"sm\" /> : null}\n {showTheme ? <ThemeToggle variant=\"filled\" size=\"sm\" /> : null}\n {showLanguages && languages.length > 1 ? (\n <Dropdown\n placement=\"bottom-end\"\n trigger={\n <IconButton variant=\"filled\" size=\"sm\" aria-label={t('language.label')}>\n <Icon name=\"Global\" />\n </IconButton>\n }\n >\n {languages.map((l) => (\n <ListItem\n key={l.code}\n clickable\n selected={l.code === language}\n onClick={() => setLanguage(l.code)}\n icon={<Flag code={l.code} />}\n >\n {l.label ?? l.code}\n </ListItem>\n ))}\n </Dropdown>\n ) : null}\n {showSettings ? (\n <IconButton\n aria-label={t('settings.label')}\n variant=\"text\"\n size=\"sm\"\n className={styles.settings}\n onClick={() => setSettingsOpen(true)}\n >\n <Icon name=\"Setting5\" />\n </IconButton>\n ) : null}\n {onLogout ? (\n <Dropdown\n placement=\"bottom-end\"\n trigger={\n <button type=\"button\" className={styles.account} aria-label={t('account.label')}>\n <Avatar size=\"md\" name={user?.name} src={user?.avatar} color=\"primary\" />\n </button>\n }\n >\n {user ? (\n <>\n <Row gap={8} align=\"center\" padding=\"var(--tz-space-xxs) var(--tz-space-sm)\">\n <Avatar size=\"sm\" name={user.name} src={user.avatar} color=\"primary\" />\n <Col gap={2}>\n {user.name ? (\n <Typography variant=\"bodySmall\">{user.name}</Typography>\n ) : null}\n {user.email ? (\n <Typography variant=\"caption\" color=\"muted\">\n {user.email}\n </Typography>\n ) : null}\n </Col>\n </Row>\n <Divider />\n </>\n ) : null}\n <ListItem icon={<Icon name=\"Logout2\" color=\"error\" />} clickable onClick={onLogout}>\n {t('userCard.signOut')}\n </ListItem>\n </Dropdown>\n ) : null}\n </div>\n </header>\n <main className={styles.content}>\n {showBreadcrumbs && !isNotFound ? <Breadcrumbs /> : null}\n {showPageTitle && !isNotFound && title ? (\n <Typography variant=\"h2\" className={styles.pageTitle}>\n {title}\n </Typography>\n ) : null}\n {children}\n </main>\n </div>\n {toaster !== false && <Toaster {...toasterProps} />}\n {showSettings ? (\n <SettingsDrawer\n open={settingsOpen}\n onClose={() => setSettingsOpen(false)}\n showTheme={showTheme}\n />\n ) : null}\n </div>\n )\n}\n"],"names":["ALT_SWATCHES","SettingsDrawer","open","onClose","showTheme","mode","setMode","accentColors","defaultAccentColors","setAccentColor","headerSticky","setHeaderSticky","fontFamily","setFontFamily","useTheme","t","useT","fontQuery","setFontQuery","useState","q","base","DEFAULT_FONT_FAMILY","fontOptions","f","picker","label","def","colors","c","jsx","SwatchPicker","color","jsxs","Modal","Fragment","Typography","ChoiceCardGroup","v","Divider","Col","Select","RootLayout","logo","sidebarFooter","header","toaster","children","title","usePageTitle","language","setLanguage","languages","useLanguage","h","useHeaderConfig","showFullscreen","showSettings","showSearch","showLanguages","showBreadcrumbs","toasterProps","showPageTitle","onLogout","user","isNarrow","useMediaQuery","collapsed","setCollapsed","useEffect","useLockBodyScroll","pathname","useRouterState","s","isNotFound","m","settingsOpen","setSettingsOpen","clsx","styles","IconButton","Icon","NavSearch","Sidebar","FullscreenToggle","ThemeToggle","Dropdown","l","ListItem","Flag","Avatar","Row","Breadcrumbs","Toaster"],"mappings":"k6BAaMA,GAAmD,CACvD,MAAO,CACL,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,SAAA,EAEF,KAA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OAAA,CAAK,UAAW8C,EAAO,QACrB,SAAA,CAAAnB,GAAmB,CAACc,EAAa5C,EAAAA,IAAC8D,EAAAA,YAAA,CAAA,CAAY,EAAK,KACnD9B,GAAiB,CAACY,GAAc1B,EAC/BlB,EAAAA,IAACM,EAAAA,WAAA,CAAW,QAAQ,KAAK,UAAW2C,EAAO,UACxC,SAAA/B,CAAA,CACH,EACE,KACHD,CAAA,CAAA,CACH,CAAA,EACF,EACCD,IAAY,IAAShB,EAAAA,IAAC+D,EAAAA,QAAA,CAAS,GAAGhC,CAAA,CAAc,EAChDJ,EACC3B,EAAAA,IAAC7B,GAAA,CACC,KAAM2E,EACN,QAAS,IAAMC,EAAgB,EAAK,EACpC,UAAAzE,CAAA,CAAA,EAEA,IAAA,EACN,CAEJ"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const i=require("react/jsx-runtime"),b=require("react"),v=require("@tanstack/react-router"),F=require("clsx"),y=require("./Icon-CXTl_QAP.cjs"),L=require("./List-ChXO0Hz-.cjs"),C=require("./ListItem-DWQorRxG.cjs"),q=require("./TextField-fmt7aacg.cjs"),w=require("./access-DPUHbE-S.cjs"),A=require("./ConfigProvider-BHNx-NHV.cjs"),O="_nav_a1zzi_4",K="_module_a1zzi_17",V="_search_a1zzi_25",Y="_searchPanel_a1zzi_31",U="_moduleLabel_a1zzi_46",W="_leaves_a1zzi_61",H="_navBadge_a1zzi_66",G="_navDot_a1zzi_78",Q="_leafDot_a1zzi_86",X="_collapsible_a1zzi_95",J="_collapsibleClosed_a1zzi_100",Z="_collapsibleInner_a1zzi_103",ee="_chevron_a1zzi_109",te="_chevronButton_a1zzi_119",m={nav:O,module:K,search:V,searchPanel:Y,moduleLabel:U,leaves:W,navBadge:H,navDot:G,leafDot:Q,collapsible:X,collapsibleClosed:J,collapsibleInner:Z,chevron:ee,chevronButton:te},P=C.ListItem,oe=e=>e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" "),R=e=>e.replace(/^\/+|\/+$/g,""),T=e=>e.length>1&&e.endsWith("/")?e.slice(0,-1):e,z=(e,n)=>e.order-n.order||e.label.localeCompare(n.label);function M(e){const n=[];for(const s of e){const c=s.staticData,a=R(s.fullPath);!(c!=null&&c.name)||!a||n.push({path:a,name:c.name,sd:c})}const o=new Map(n.map(s=>[s.path,s])),t=n.map(s=>s.path),l=s=>t.some(c=>{var a;return c!==s&&c.startsWith(`${s}/`)&&!((a=o.get(c))!=null&&a.sd.hidden)}),u=new Set(e.map(s=>s.fullPath)),p=s=>u.has(`/${s}/`),h=(s,c)=>{const a=o.get(s);return{label:(a==null?void 0:a.name)??oe(c),icon:a==null?void 0:a.sd.icon,badge:a==null?void 0:a.sd.badge,dot:a==null?void 0:a.sd.dot,order:(a==null?void 0:a.sd.order)??Number.POSITIVE_INFINITY}},g=new Map,f=s=>{let c=g.get(s);if(!c){const a=h(s,s);c={label:a.label,icon:a.icon,order:a.order,groups:new Map},g.set(s,c)}return c},x=[];for(const{path:s,name:c,sd:a}of n){const N=s.split("/");if(N.length<=2&&l(s)||a.hidden)continue;if(N.length===1){x.push({label:c,to:`/${s}`,icon:a.icon,badge:a.badge,dot:a.dot,order:a.order??Number.POSITIVE_INFINITY});continue}const r=f(N[0]);if(N.length===2)r.groups.set(s,{label:c,icon:a.icon,to:`/${s}`,badge:a.badge,dot:a.dot,order:a.order??Number.POSITIVE_INFINITY,leaves:[],isContainer:!1});else{const d=N.slice(0,2).join("/");let _=r.groups.get(d);if(!_){const I=h(d,N[1]);_={label:I.label,icon:I.icon,badge:I.badge,dot:I.dot,order:I.order,to:p(d)?`/${d}`:void 0,leaves:[],isContainer:!0},r.groups.set(d,_)}_.leaves.push({label:c,to:`/${s}`,icon:a.icon,badge:a.badge,dot:a.dot,order:a.order??Number.POSITIVE_INFINITY})}}return{links:x.sort(z).map(s=>({label:s.label,to:s.to,icon:s.icon,badge:s.badge,dot:s.dot})),modules:[...g.values()].sort(z).map(s=>({module:s.label,icon:s.icon,groups:[...s.groups.values()].sort(z).map(c=>({label:c.label,icon:c.icon,to:c.to,badge:c.badge,dot:c.dot,children:c.isContainer?c.leaves.sort(z).map(a=>({label:a.label,to:a.to,icon:a.icon,badge:a.badge,dot:a.dot})):void 0}))}))}}function k(){const e=v.useRouter(),n=w.useAccessKeys();return b.useMemo(()=>M(Object.values(e.looseRoutesById).map(o=>{var t;return{fullPath:o.fullPath,staticData:(t=o.options)==null?void 0:t.staticData}}).filter(o=>{var t;return w.hasAccess((t=o.staticData)==null?void 0:t.roles)})),[e,n])}function S(e){var n;if(e.links[0])return e.links[0].to;for(const o of e.modules)for(const t of o.groups){if(t.to)return t.to;const l=(n=t.children)==null?void 0:n[0];if(l)return l.to}}function ne(){return S(k())}function se(e){var o;const n=new Map;for(const t of e){const l=(o=t.staticData)==null?void 0:o.name;if(!l)continue;const u=T(t.fullPath);n.has(u)||n.set(u,l)}return n}function B(e,n){const o=[];let t="";for(const l of R(e).split("/").filter(Boolean)){t+=`/${l}`;const u=n.get(t);u&&o.push({name:u,to:t})}return o}function E(){const e=v.useRouter();return b.useMemo(()=>se(Object.values(e.looseRoutesById).map(n=>{var o;return{fullPath:n.fullPath,staticData:(o=n.options)==null?void 0:o.staticData}})),[e])}function ae(e,n){if(e!=null)return typeof e=="function"?e(n):e}function $(){var n;const e=v.useRouterState({select:o=>o.matches});for(let o=e.length-1;o>=0;o--){const t=ae((n=e[o].staticData)==null?void 0:n.title,e[o].params??{});if(t)return t}}function le(){const e=$(),n=E(),o=v.useRouterState({select:l=>l.location.pathname});if(e!=null)return e;const t=B(o,n);return t.length>0?t[t.length-1].name:void 0}function ce(e){const n=new Set;for(const o of e.links)n.add(o.to);for(const o of e.modules)for(const t of o.groups){t.to&&n.add(t.to);for(const l of t.children??[])n.add(l.to)}return n}function re(e,n){const{leafPath:o,leafTitle:t,navigable:l}=n,u=e.map(({name:p,to:h})=>({label:p,to:h!==o&&l.has(h)?h:void 0}));return t&&(e.length>0&&e[e.length-1].to===o?u[u.length-1]={label:t}:u.push({label:t})),u}function ie(){const e=k(),n=E(),o=v.useRouterState({select:p=>p.location.pathname}),t=$(),l=S(e),u=re(B(o,n),{leafPath:T(o),leafTitle:t,navigable:ce(e)});return{homeTo:l,items:u}}function ue(){const e=ne();return e?i.jsx(v.Navigate,{to:e}):null}function de(){const{links:e,modules:n}=k(),o=v.useRouterState({select:t=>t.location.pathname});return i.jsxs("nav",{className:m.nav,children:[e.length>0?i.jsx(L.List,{children:e.map(t=>i.jsx(P,{as:v.Link,to:t.to,icon:t.icon,selected:D(o,t.to),clickable:!0,trailing:j(t.badge,t.dot),children:t.label},t.to))}):null,n.map(t=>i.jsxs("div",{className:m.module,children:[i.jsx("div",{className:m.moduleLabel,children:t.module}),i.jsx(L.List,{children:t.groups.map(l=>i.jsx(ge,{group:l,pathname:o},l.label))})]},t.module))]})}function fe(e){const n=[];for(const o of e.links)n.push({label:o.label,to:o.to});for(const o of e.modules)for(const t of o.groups){t.to&&n.push({label:t.label,to:t.to,context:o.module});for(const l of t.children??[])n.push({label:l.label,to:l.to,context:`${o.module} · ${t.label}`})}return n}const he=8;function me(){const e=A.useT(),n=k(),o=v.useNavigate(),t=b.useMemo(()=>fe(n),[n]),[l,u]=b.useState(""),[p,h]=b.useState(!1),[g,f]=b.useState(0),x=b.useRef(null),s=b.useMemo(()=>{const r=l.trim().toLowerCase();return r?t.filter(d=>{var _;return d.label.toLowerCase().includes(r)||(((_=d.context)==null?void 0:_.toLowerCase().includes(r))??!1)}).slice(0,he):[]},[t,l]),c=p&&s.length>0;b.useEffect(()=>f(0),[l]),b.useEffect(()=>{f(r=>r>s.length-1?Math.max(0,s.length-1):r)},[s.length]),b.useEffect(()=>{if(!p)return;const r=d=>{x.current&&!x.current.contains(d.target)&&h(!1)};return document.addEventListener("pointerdown",r),()=>document.removeEventListener("pointerdown",r)},[p]);const a=r=>{o({to:r}),u(""),h(!1)},N=r=>{if(c)if(r.key==="ArrowDown")r.preventDefault(),f(d=>(d+1)%s.length);else if(r.key==="ArrowUp")r.preventDefault(),f(d=>(d-1+s.length)%s.length);else if(r.key==="Enter"){r.preventDefault();const d=s[g];d&&a(d.to)}else r.key==="Escape"&&h(!1)};return i.jsxs("div",{ref:x,className:m.search,role:"combobox","aria-expanded":c,"aria-haspopup":"listbox",children:[i.jsx(q.TextField,{value:l,onChange:r=>{u(r.target.value),h(!0)},onFocus:()=>h(!0),onKeyDown:N,adornment:i.jsx(y.Icon,{name:"SearchNormal"}),placeholder:e("sidebar.searchPages"),"aria-label":e("sidebar.searchPages"),autoComplete:"off"}),c?i.jsx("div",{className:m.searchPanel,children:i.jsx(L.List,{role:"listbox",children:s.map((r,d)=>i.jsx(C.ListItem,{description:r.context,clickable:!0,selected:d===g,onMouseDown:_=>_.preventDefault(),onMouseEnter:()=>f(d),onClick:()=>a(r.to),children:r.label},r.to))})}):null]})}function D(e,n){const o=T(e),t=T(n);return t==="/"?o==="/":o===t||o.startsWith(t+"/")}function be(e,n){var o;return e.to&&D(n,e.to)?!0:((o=e.children)==null?void 0:o.some(t=>D(n,t.to)))??!1}function pe(e){return e?i.jsx("span",{className:m.navBadge,children:e}):null}function ve(e){return e?i.jsx("span",{className:m.navDot,style:{background:`var(--tz-color-${e})`}}):null}function j(e,n,o){if(!(e==null&&n==null&&o==null))return i.jsxs(i.Fragment,{children:[pe(e),ve(n),o]})}function ge({group:e,pathname:n}){var h,g;const o=be(e,n),t=!!((h=e.children)!=null&&h.length),[l,u]=b.useState(o);if(b.useEffect(()=>{o&&u(!0)},[o]),!t&&e.to)return i.jsx(P,{as:v.Link,to:e.to,icon:e.icon,selected:o,clickable:!0,trailing:j(e.badge,e.dot),children:e.label});const p=i.jsx(y.Icon,{name:"ArrowDown4",size:"sm",className:m.chevron,"data-open":l?"true":"false"});return i.jsxs(i.Fragment,{children:[t&&e.to?i.jsx(P,{as:v.Link,to:e.to,icon:e.icon,selected:o,clickable:!0,onClick:()=>u(!0),trailing:j(e.badge,e.dot,i.jsx("button",{type:"button",className:m.chevronButton,"aria-label":`${l?"Collapse":"Expand"} ${e.label}`,"aria-expanded":l,onClick:f=>{f.preventDefault(),f.stopPropagation(),u(x=>!x)},children:p})),children:e.label}):i.jsx(C.ListItem,{icon:e.icon,selected:o,clickable:!0,"aria-expanded":l,onClick:()=>u(f=>!f),trailing:j(e.badge,e.dot,p),children:e.label}),t?i.jsx("div",{className:F.clsx(m.collapsible,!l&&m.collapsibleClosed),children:i.jsx("div",{className:m.collapsibleInner,children:i.jsx(L.List,{className:m.leaves,children:(g=e.children)==null?void 0:g.map(f=>i.jsx(P,{as:v.Link,to:f.to,icon:i.jsx("span",{className:m.leafDot}),selected:D(n,f.to),size:"md",clickable:!0,trailing:j(f.badge,f.dot),children:f.label},f.to))})})}):null]})}exports.FirstRouteRedirect=ue;exports.NavSearch=me;exports.Sidebar=de;exports.buildNavTree=M;exports.firstNavTo=S;exports.useBreadcrumbs=ie;exports.usePageTitle=le;
|
|
2
|
+
//# sourceMappingURL=Sidebar-BYqUTa8D.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sidebar-BYqUTa8D.cjs","sources":["../src/components/Sidebar/Sidebar.tsx"],"sourcesContent":["import {\n useEffect,\n useMemo,\n useRef,\n useState,\n type ChangeEvent,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n} from 'react'\nimport {\n Link,\n Navigate,\n useNavigate,\n useRouter,\n useRouterState,\n type LinkProps,\n type StaticDataRouteOption,\n} from '@tanstack/react-router'\nimport { clsx } from 'clsx'\nimport { Icon } from '../Icon'\nimport { List, ListItem, type ListItemProps } from '../List'\nimport { TextField } from '../TextField'\nimport { useT, type ThemeColor } from '../../theme'\nimport type { IconName } from '../../icons/names'\nimport { hasAccess, useAccessKeys } from '../../helpers/access'\nimport styles from './Sidebar.module.css'\n\n// `ListItem` rendered as a TanStack `Link` — it forwards unrecognized props (like `to`) to the\n// element, so this typed alias lets us pass `to` while keeping `ListItem`'s look + behavior.\nconst NavLink = ListItem as unknown as (props: ListItemProps & { to: string }) => ReactNode\n\nexport type { IconName }\n\n// Typed `staticData` for consumers — every route describes its own menu entry.\ndeclare module '@tanstack/react-router' {\n interface StaticDataRouteOption {\n /** Menu label. A route with no `name` never appears in the menu. */\n name?: string\n /**\n * Explicit page-title / breadcrumb label for **this** route, taking priority over the path-prefix\n * `name` resolution. Read from the current (leaf) matched route, so it works on **dynamic** routes\n * (e.g. `/core/list/$id`) too. Either a static string, or a **function of the route `params`** —\n * called with the matched route's params so a detail page can title itself from the URL, e.g.\n * `title: ({ id }) => \\`Order #${id}\\``. Does **not** affect the sidebar (which reads only `name`).\n */\n title?: string | ((params: Record<string, string>) => ReactNode)\n /** Optional menu icon (the library's `IconName` union). */\n icon?: IconName\n /** Sort order within the parent (ascending); falls back to alphabetical. */\n order?: number\n /** Routed but hidden from the menu. */\n hidden?: boolean\n /** Allowed accessKeys (OR — user needs any one). Omitted/empty = public. */\n roles?: string[]\n /** Small text label (e.g. `\"New\"`) shown as a pill on the menu row. */\n badge?: string\n /** Theme color of a small dot indicator on the menu row (e.g. `\"error\"`). */\n dot?: ThemeColor\n }\n}\n\nexport interface NavLeaf {\n label: string\n to: string\n icon?: IconName\n badge?: string\n dot?: ThemeColor\n}\nexport interface NavGroup {\n label: string\n icon?: IconName\n to?: string\n badge?: string\n dot?: ThemeColor\n children?: NavLeaf[]\n}\nexport interface NavModule {\n module: string\n icon?: IconName\n groups: NavGroup[]\n}\n\nconst prettify = (seg: string) =>\n seg\n .split('-')\n .map((w) => w.charAt(0).toUpperCase() + w.slice(1))\n .join(' ')\nconst trimSlashes = (p: string) => p.replace(/^\\/+|\\/+$/g, '')\n/** Normalize a pathname for comparison — drop a single trailing slash (but keep the root `/`). */\nconst normalizePath = (p: string) => (p.length > 1 && p.endsWith('/') ? p.slice(0, -1) : p)\nconst byOrderThenLabel = (\n a: { order: number; label: string },\n b: { order: number; label: string },\n) => a.order - b.order || a.label.localeCompare(b.label)\n\ninterface LeafAcc {\n label: string\n to: string\n icon?: IconName\n badge?: string\n dot?: ThemeColor\n order: number\n}\ninterface GroupAcc {\n label: string\n icon?: IconName\n to?: string\n badge?: string\n dot?: ThemeColor\n order: number\n leaves: LeafAcc[]\n isContainer: boolean\n}\ninterface ModuleAcc {\n label: string\n icon?: IconName\n order: number\n groups: Map<string, GroupAcc>\n}\n\n/** A single route, reduced to what the menu needs. */\nexport interface NavRoute {\n fullPath: string\n staticData?: StaticDataRouteOption\n}\n\n/**\n * Pure menu builder — derives the 3-level nav tree (module → group → page) from a flat route list.\n * Kept router-free so it's unit-testable; `useNavTree` feeds it the live routes.\n */\nexport function buildNavTree(routes: NavRoute[]): { links: NavLeaf[]; modules: NavModule[] } {\n const entries: Array<{ path: string; name: string; sd: StaticDataRouteOption }> = []\n for (const route of routes) {\n const sd = route.staticData\n const path = trimSlashes(route.fullPath)\n if (!sd?.name || !path) continue\n entries.push({ path, name: sd.name, sd })\n }\n\n const metaByPath = new Map(entries.map((e) => [e.path, e]))\n const paths = entries.map((e) => e.path)\n // A path is a \"container\" only when it has a **non-hidden** descendant — a hidden child must not turn\n // its parent into a container (which would drop the parent's own row and, if every child is hidden,\n // make the whole parent vanish from the menu).\n const isContainer = (p: string) =>\n paths.some((o) => o !== p && o.startsWith(`${p}/`) && !metaByPath.get(o)?.sd.hidden)\n const rawFullPaths = new Set(routes.map((r) => r.fullPath))\n const groupHasOwnPage = (groupKey: string) => rawFullPaths.has(`/${groupKey}/`)\n\n const chrome = (key: string, seg: string) => {\n const e = metaByPath.get(key)\n return {\n label: e?.name ?? prettify(seg),\n icon: e?.sd.icon,\n badge: e?.sd.badge,\n dot: e?.sd.dot,\n order: e?.sd.order ?? Number.POSITIVE_INFINITY,\n }\n }\n\n const modules = new Map<string, ModuleAcc>()\n const getModule = (seg: string) => {\n let mod = modules.get(seg)\n if (!mod) {\n const c = chrome(seg, seg)\n mod = { label: c.label, icon: c.icon, order: c.order, groups: new Map() }\n modules.set(seg, mod)\n }\n return mod\n }\n\n const topLinks: LeafAcc[] = []\n for (const { path, name, sd } of entries) {\n const segs = path.split('/')\n // The menu is 3 levels deep by design (module → group → page). A path only counts as a\n // \"container\" (holds children instead of being its own row) at the module/group levels; a\n // depth-3+ route is always a leaf, so a named page with even-deeper children isn't dropped.\n // Routes deeper than 3 segments still appear — flattened as leaves under their depth-2 group\n // (their `to` stays correct) — the nav just can't nest beyond level 3.\n if ((segs.length <= 2 && isContainer(path)) || sd.hidden) continue\n if (segs.length === 1) {\n topLinks.push({\n label: name,\n to: `/${path}`,\n icon: sd.icon,\n badge: sd.badge,\n dot: sd.dot,\n order: sd.order ?? Number.POSITIVE_INFINITY,\n })\n continue\n }\n const mod = getModule(segs[0])\n if (segs.length === 2) {\n mod.groups.set(path, {\n label: name,\n icon: sd.icon,\n to: `/${path}`,\n badge: sd.badge,\n dot: sd.dot,\n order: sd.order ?? Number.POSITIVE_INFINITY,\n leaves: [],\n isContainer: false,\n })\n } else {\n const groupKey = segs.slice(0, 2).join('/')\n let group = mod.groups.get(groupKey)\n if (!group) {\n const c = chrome(groupKey, segs[1])\n group = {\n label: c.label,\n icon: c.icon,\n badge: c.badge,\n dot: c.dot,\n order: c.order,\n to: groupHasOwnPage(groupKey) ? `/${groupKey}` : undefined,\n leaves: [],\n isContainer: true,\n }\n mod.groups.set(groupKey, group)\n }\n group.leaves.push({\n label: name,\n to: `/${path}`,\n icon: sd.icon,\n badge: sd.badge,\n dot: sd.dot,\n order: sd.order ?? Number.POSITIVE_INFINITY,\n })\n }\n }\n\n return {\n links: topLinks\n .sort(byOrderThenLabel)\n .map((l) => ({ label: l.label, to: l.to, icon: l.icon, badge: l.badge, dot: l.dot })),\n modules: [...modules.values()].sort(byOrderThenLabel).map(\n (mod): NavModule => ({\n module: mod.label,\n icon: mod.icon,\n groups: [...mod.groups.values()].sort(byOrderThenLabel).map(\n (g): NavGroup => ({\n label: g.label,\n icon: g.icon,\n to: g.to,\n badge: g.badge,\n dot: g.dot,\n children: g.isContainer\n ? g.leaves.sort(byOrderThenLabel).map((l) => ({\n label: l.label,\n to: l.to,\n icon: l.icon,\n badge: l.badge,\n dot: l.dot,\n }))\n : undefined,\n }),\n ),\n }),\n ),\n }\n}\n\nfunction useNavTree(): { links: NavLeaf[]; modules: NavModule[] } {\n const router = useRouter()\n const accessKeys = useAccessKeys() // re-render the menu when the user's roles change (login/logout)\n return useMemo(\n () =>\n buildNavTree(\n Object.values(router.looseRoutesById)\n .map((route) => ({\n fullPath: route.fullPath,\n staticData: route.options?.staticData,\n }))\n // Drop pages the current user can't access — empty groups/modules then vanish on their own.\n .filter((route) => hasAccess(route.staticData?.roles)),\n ),\n [router, accessKeys],\n )\n}\n\n/** The first menu destination (top link, else first group/leaf) — used by `FirstRouteRedirect`. */\nexport function firstNavTo(tree: { links: NavLeaf[]; modules: NavModule[] }): string | undefined {\n if (tree.links[0]) return tree.links[0].to\n for (const mod of tree.modules)\n for (const group of mod.groups) {\n if (group.to) return group.to\n const firstChild = group.children?.[0]\n if (firstChild) return firstChild.to\n }\n return undefined\n}\n\nfunction useFirstNavTo() {\n return firstNavTo(useNavTree())\n}\n\n/**\n * A `normalized fullPath → staticData.name` map from **all** routes (index routes included), the same\n * route source the `Sidebar` walks. The key drops a single trailing slash (`/core/list/` → `/core/list`),\n * so a list's **index route** (which carries the name) resolves under the plain path too. A named route\n * never loses its slot to an unnamed one. Pure + router-free, so it's unit-testable.\n */\nexport function buildNameMap(routes: NavRoute[]): Map<string, string> {\n const map = new Map<string, string>()\n for (const route of routes) {\n const name = route.staticData?.name\n if (!name) continue\n const key = normalizePath(route.fullPath)\n if (!map.has(key)) map.set(key, name)\n }\n return map\n}\n\n/**\n * Resolve a pathname's name crumbs from its **cumulative path prefixes** (not the matched-route chain),\n * so a dynamic/detail leaf (e.g. `/core/list/$id`) inherits its named ancestors. Each prefix is looked\n * up in `nameMap` (trailing slashes already normalized on both sides); a prefix with no name is simply\n * **skipped** — it never breaks the chain. Returns the recognized crumbs in order, each with its `to`.\n */\nexport function resolvePathNames(\n pathname: string,\n nameMap: Map<string, string>,\n): Array<{ name: string; to: string }> {\n const out: Array<{ name: string; to: string }> = []\n let prefix = ''\n for (const seg of trimSlashes(pathname).split('/').filter(Boolean)) {\n prefix += `/${seg}` // accumulates `/core`, `/core/list`, … — never trailing-slashed\n const name = nameMap.get(prefix)\n if (name) out.push({ name, to: prefix })\n }\n return out\n}\n\nfunction useNameMap(): Map<string, string> {\n const router = useRouter()\n return useMemo(\n () =>\n buildNameMap(\n Object.values(router.looseRoutesById).map((route) => ({\n fullPath: route.fullPath,\n staticData: route.options?.staticData,\n })),\n ),\n [router],\n )\n}\n\n/** Resolve a `staticData.title` value: a function is called with the route `params`, a string is used\n * as-is, and nullish yields `undefined`. Pure, so it's unit-testable. */\nexport function resolveTitle(\n title: string | ((params: Record<string, string>) => ReactNode) | undefined,\n params: Record<string, string>,\n): ReactNode | undefined {\n if (title == null) return undefined\n return typeof title === 'function' ? title(params) : title\n}\n\n/**\n * The deepest matched route's explicit `staticData.title`, resolved from the live match chain. A string\n * is used as-is; a function is called with that matched route's `params` (so a dynamic detail route can\n * build its label from the URL, e.g. `({ id }) => \\`Order #${id}\\``).\n */\nfunction useLeafTitle(): ReactNode | undefined {\n const matches = useRouterState({ select: (s) => s.matches })\n for (let i = matches.length - 1; i >= 0; i--) {\n const resolved = resolveTitle(\n matches[i].staticData?.title,\n (matches[i].params ?? {}) as Record<string, string>,\n )\n if (resolved) return resolved\n }\n return undefined\n}\n\n/**\n * The current page's title. Priority: the leaf matched route's explicit **`staticData.title`** (works on\n * dynamic routes, read from the match chain), else the **last** recognized name along the current\n * pathname's cumulative prefixes (see `resolvePathNames`), so a dynamic detail route inherits its parent\n * list's name instead of falling back to the nearest named ancestor. Used by `RootLayout` to label the\n * header automatically.\n */\nexport function usePageTitle(): ReactNode | undefined {\n const leafTitle = useLeafTitle()\n const nameMap = useNameMap()\n const pathname = useRouterState({ select: (s) => s.location.pathname })\n if (leafTitle != null) return leafTitle\n const names = resolvePathNames(pathname, nameMap)\n return names.length > 0 ? names[names.length - 1].name : undefined\n}\n\n/** One breadcrumb. `to` is set only when the crumb points at a real, navigable menu page. */\nexport interface Breadcrumb {\n label: ReactNode\n to?: string\n}\n\n/** Every `to` that the menu actually navigates to (top links, group pages, leaves). */\nfunction navigablePaths(tree: { links: NavLeaf[]; modules: NavModule[] }): Set<string> {\n const set = new Set<string>()\n for (const link of tree.links) set.add(link.to)\n for (const mod of tree.modules)\n for (const group of mod.groups) {\n if (group.to) set.add(group.to)\n for (const leaf of group.children ?? []) set.add(leaf.to)\n }\n return set\n}\n\n/**\n * Assemble the breadcrumb items from the resolved prefix names. A crumb links when it maps to a real\n * navigable page **and is not the current page itself** (`to === leafPath` — you're already there, so it\n * stays plain text); this is the key difference from a blanket \"last crumb is never a link\" — an\n * **ancestor** crumb (e.g. the parent list while you're on its detail child) keeps its link. `leafTitle`\n * (the leaf route's `staticData.title`) overrides the current page's label when the leaf is itself a\n * named prefix, otherwise it's appended as the trailing current-page crumb. Pure, so it's unit-testable.\n */\nexport function buildBreadcrumbItems(\n resolved: Array<{ name: string; to: string }>,\n opts: { leafPath: string; leafTitle?: ReactNode; navigable: Set<string> },\n): Breadcrumb[] {\n const { leafPath, leafTitle, navigable } = opts\n const items: Breadcrumb[] = resolved.map(({ name, to }) => ({\n label: name,\n to: to !== leafPath && navigable.has(to) ? to : undefined,\n }))\n if (leafTitle) {\n if (resolved.length > 0 && resolved[resolved.length - 1].to === leafPath) {\n // the leaf is itself a named prefix (the current page) — the title overrides its label\n items[items.length - 1] = { label: leafTitle }\n } else {\n // a dynamic / deeper leaf with no prefix name — the title is the trailing current-page crumb\n items.push({ label: leafTitle })\n }\n }\n return items\n}\n\n/**\n * Breadcrumb trail for the current route, derived from the current pathname's **cumulative prefixes**\n * (via `resolvePathNames`) rather than the matched-route chain — so a dynamic/detail route (e.g.\n * `/core/list/$id`) still shows its named ancestors (Core › List) instead of collapsing to the nearest\n * named one. The leaf matched route's explicit **`staticData.title`** takes priority for the current-page\n * crumb: it overrides the leaf's own label when the leaf is a named prefix, else it's appended as the\n * trailing current-page crumb (so a titled dynamic detail reads Core › List › <title>). `homeTo` is the\n * first allowed menu page (same target as `FirstRouteRedirect`). A crumb links only when it maps to a\n * real navigable page **and isn't the current page** — so an ancestor crumb (the parent list while you're\n * on its detail child) stays a link, while the page you're already on is plain text.\n */\nexport function useBreadcrumbs(): { homeTo?: string; items: Breadcrumb[] } {\n const tree = useNavTree()\n const nameMap = useNameMap()\n const pathname = useRouterState({ select: (s) => s.location.pathname })\n const leafTitle = useLeafTitle()\n const homeTo = firstNavTo(tree)\n const items = buildBreadcrumbItems(resolvePathNames(pathname, nameMap), {\n leafPath: normalizePath(pathname),\n leafTitle,\n navigable: navigablePaths(tree),\n })\n return { homeTo, items }\n}\n\n/** Drop-in component for the `/` route: forwards to whatever sits FIRST in the menu. */\nexport function FirstRouteRedirect() {\n const to = useFirstNavTo()\n return to ? <Navigate to={to as LinkProps['to']} /> : null\n}\n\n/** Auto-generated navigation, derived from the routes' `staticData`. Rendered inside `RootLayout`. */\nexport function Sidebar() {\n const { links, modules } = useNavTree()\n const pathname = useRouterState({ select: (s) => s.location.pathname })\n\n return (\n <nav className={styles.nav}>\n {links.length > 0 ? (\n <List>\n {links.map((link) => (\n <NavLink\n key={link.to}\n as={Link}\n to={link.to}\n icon={link.icon}\n selected={isActivePath(pathname, link.to)}\n clickable\n trailing={navTrailing(link.badge, link.dot)}\n >\n {link.label}\n </NavLink>\n ))}\n </List>\n ) : null}\n {modules.map((mod) => (\n <div className={styles.module} key={mod.module}>\n <div className={styles.moduleLabel}>{mod.module}</div>\n <List>\n {mod.groups.map((group) => (\n <NavGroupItem key={group.label} group={group} pathname={pathname} />\n ))}\n </List>\n </div>\n ))}\n </nav>\n )\n}\n\n/** A single searchable destination — a nav page flattened out of the tree, with a breadcrumb context. */\ninterface NavPage {\n label: string\n to: string\n /** Where it lives — e.g. `\"Components · Forms\"` — shown as the muted second line. */\n context?: string\n}\n\n/** Flatten the nav tree into every navigable page (top links + group pages + leaves). */\nfunction flattenPages(tree: { links: NavLeaf[]; modules: NavModule[] }): NavPage[] {\n const pages: NavPage[] = []\n for (const link of tree.links) pages.push({ label: link.label, to: link.to })\n for (const mod of tree.modules)\n for (const group of mod.groups) {\n if (group.to) pages.push({ label: group.label, to: group.to, context: mod.module })\n for (const leaf of group.children ?? [])\n pages.push({\n label: leaf.label,\n to: leaf.to,\n context: `${mod.module} · ${group.label}`,\n })\n }\n return pages\n}\n\nconst MAX_SEARCH_RESULTS = 8\n\n/**\n * Header search over the sidebar's pages — type to filter the nav (by page name or its section) and\n * pick a suggestion to jump there. Data comes from the same `useNavTree` the sidebar uses (so it\n * respects RBAC). Keyboard: Up/Down move, Enter opens, Escape closes. Rendered by `RootLayout`'s header.\n */\nexport function NavSearch() {\n const t = useT()\n const tree = useNavTree()\n const navigate = useNavigate()\n const pages = useMemo(() => flattenPages(tree), [tree])\n\n const [query, setQuery] = useState('')\n const [open, setOpen] = useState(false)\n const [active, setActive] = useState(0)\n const rootRef = useRef<HTMLDivElement | null>(null)\n\n const results = useMemo(() => {\n const q = query.trim().toLowerCase()\n if (!q) return []\n return pages\n .filter(\n (p) => p.label.toLowerCase().includes(q) || (p.context?.toLowerCase().includes(q) ?? false),\n )\n .slice(0, MAX_SEARCH_RESULTS)\n }, [pages, query])\n\n const showList = open && results.length > 0\n\n // reset the highlighted row whenever the query changes\n useEffect(() => setActive(0), [query])\n\n // clamp the highlight if the result set shrinks without a query change (e.g. RBAC pages update)\n useEffect(() => {\n setActive((a) => (a > results.length - 1 ? Math.max(0, results.length - 1) : a))\n }, [results.length])\n\n // close the suggestions on an outside pointerdown\n useEffect(() => {\n if (!open) return\n const onDown = (event: PointerEvent) => {\n if (rootRef.current && !rootRef.current.contains(event.target as Node)) setOpen(false)\n }\n document.addEventListener('pointerdown', onDown)\n return () => document.removeEventListener('pointerdown', onDown)\n }, [open])\n\n const go = (to: string) => {\n navigate({ to: to as LinkProps['to'] })\n setQuery('')\n setOpen(false)\n }\n\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (!showList) return\n if (event.key === 'ArrowDown') {\n event.preventDefault()\n setActive((i) => (i + 1) % results.length)\n } else if (event.key === 'ArrowUp') {\n event.preventDefault()\n setActive((i) => (i - 1 + results.length) % results.length)\n } else if (event.key === 'Enter') {\n event.preventDefault()\n const hit = results[active]\n if (hit) go(hit.to)\n } else if (event.key === 'Escape') {\n setOpen(false)\n }\n }\n\n return (\n <div\n ref={rootRef}\n className={styles.search}\n role=\"combobox\"\n aria-expanded={showList}\n aria-haspopup=\"listbox\"\n >\n <TextField\n value={query}\n onChange={(event: ChangeEvent<HTMLInputElement>) => {\n setQuery(event.target.value)\n setOpen(true)\n }}\n onFocus={() => setOpen(true)}\n onKeyDown={onKeyDown}\n adornment={<Icon name=\"SearchNormal\" />}\n placeholder={t('sidebar.searchPages')}\n aria-label={t('sidebar.searchPages')}\n autoComplete=\"off\"\n />\n {showList ? (\n <div className={styles.searchPanel}>\n <List role=\"listbox\">\n {results.map((page, i) => (\n <ListItem\n key={page.to}\n description={page.context}\n clickable\n selected={i === active}\n // keep the input focused through the click so blur doesn't close the list first\n onMouseDown={(event: MouseEvent) => event.preventDefault()}\n onMouseEnter={() => setActive(i)}\n onClick={() => go(page.to)}\n >\n {page.label}\n </ListItem>\n ))}\n </List>\n </div>\n ) : null}\n </div>\n )\n}\n\n/**\n * Is `to` the active nav target for `currentPath`? True on an **exact** match or when `currentPath` is a\n * **descendant** of `to` (so a parent row highlights for its child routes, e.g. `/core/page` stays active\n * on `/core/page/edit`). Trailing slashes are normalized on both sides (`/x/` === `/x`). The root `/`\n * matches **only exactly** — otherwise every route would count as its descendant.\n */\nexport function isActivePath(currentPath: string, to: string): boolean {\n const a = normalizePath(currentPath)\n const b = normalizePath(to)\n if (b === '/') return a === '/'\n return a === b || a.startsWith(b + '/')\n}\n\nfunction groupIsActive(group: NavGroup, pathname: string): boolean {\n if (group.to && isActivePath(pathname, group.to)) return true\n return group.children?.some((leaf) => isActivePath(pathname, leaf.to)) ?? false\n}\n\n/** A small \"New\"-style pill rendered on a menu row from `staticData.badge`. */\nfunction navBadge(text?: string) {\n return text ? <span className={styles.navBadge}>{text}</span> : null\n}\n\n/** A small colored dot indicator on a menu row from `staticData.dot`. */\nfunction navDot(color?: ThemeColor) {\n return color ? (\n <span className={styles.navDot} style={{ background: `var(--tz-color-${color})` }} />\n ) : null\n}\n\n/** The menu row's trailing slot: dot + badge + an optional chevron (omitted entirely when empty). */\nfunction navTrailing(badge?: string, dot?: ThemeColor, chevron?: ReactNode): ReactNode {\n if (badge == null && dot == null && chevron == null) return undefined\n return (\n <>\n {navBadge(badge)}\n {navDot(dot)}\n {chevron}\n </>\n )\n}\n\nfunction NavGroupItem({ group, pathname }: { group: NavGroup; pathname: string }) {\n const active = groupIsActive(group, pathname)\n const hasChildren = !!group.children?.length\n const [open, setOpen] = useState(active)\n\n // re-open when navigation makes this group active via a path the mount-time seed missed\n // (NavSearch, Breadcrumbs, back/forward) — collapsing an active group hides the current page\n useEffect(() => {\n if (active) setOpen(true)\n }, [active])\n\n // a plain level-2 page (no children) — just a link row\n if (!hasChildren && group.to) {\n return (\n <NavLink\n as={Link}\n to={group.to}\n icon={group.icon}\n selected={active}\n clickable\n trailing={navTrailing(group.badge, group.dot)}\n >\n {group.label}\n </NavLink>\n )\n }\n\n const chevron = (\n <Icon\n name=\"ArrowDown4\"\n size=\"sm\"\n className={styles.chevron}\n data-open={open ? 'true' : 'false'}\n />\n )\n\n return (\n <>\n {hasChildren && group.to ? (\n // \"Case B\": the row navigates (and expands); a separate chevron only toggles.\n <NavLink\n as={Link}\n to={group.to}\n icon={group.icon}\n selected={active}\n clickable\n onClick={() => setOpen(true)}\n trailing={navTrailing(\n group.badge,\n group.dot,\n <button\n type=\"button\"\n className={styles.chevronButton}\n aria-label={`${open ? 'Collapse' : 'Expand'} ${group.label}`}\n aria-expanded={open}\n onClick={(event: MouseEvent) => {\n event.preventDefault()\n event.stopPropagation()\n setOpen((o) => !o)\n }}\n >\n {chevron}\n </button>,\n )}\n >\n {group.label}\n </NavLink>\n ) : (\n // a pure container — the whole row toggles its children\n <ListItem\n icon={group.icon}\n selected={active}\n clickable\n aria-expanded={open}\n onClick={() => setOpen((o) => !o)}\n trailing={navTrailing(group.badge, group.dot, chevron)}\n >\n {group.label}\n </ListItem>\n )}\n {hasChildren ? (\n // smooth collapse, same grid-template-rows technique as Card\n <div className={clsx(styles.collapsible, !open && styles.collapsibleClosed)}>\n <div className={styles.collapsibleInner}>\n <List className={styles.leaves}>\n {group.children?.map((leaf) => (\n <NavLink\n key={leaf.to}\n as={Link}\n to={leaf.to}\n icon={<span className={styles.leafDot} />}\n selected={isActivePath(pathname, leaf.to)}\n size=\"md\"\n clickable\n trailing={navTrailing(leaf.badge, leaf.dot)}\n >\n {leaf.label}\n </NavLink>\n ))}\n </List>\n </div>\n </div>\n ) : null}\n </>\n )\n}\n"],"names":["NavLink","ListItem","prettify","seg","w","trimSlashes","p","normalizePath","byOrderThenLabel","a","b","buildNavTree","routes","entries","route","sd","path","metaByPath","e","paths","isContainer","o","_a","rawFullPaths","r","groupHasOwnPage","groupKey","chrome","key","modules","getModule","mod","c","topLinks","name","segs","group","l","g","useNavTree","router","useRouter","accessKeys","useAccessKeys","useMemo","hasAccess","firstNavTo","tree","firstChild","useFirstNavTo","buildNameMap","map","resolvePathNames","pathname","nameMap","out","prefix","useNameMap","resolveTitle","title","params","useLeafTitle","matches","useRouterState","s","i","resolved","usePageTitle","leafTitle","names","navigablePaths","set","link","leaf","buildBreadcrumbItems","opts","leafPath","navigable","items","to","useBreadcrumbs","homeTo","FirstRouteRedirect","jsx","Navigate","Sidebar","links","jsxs","styles","List","Link","isActivePath","navTrailing","NavGroupItem","flattenPages","pages","MAX_SEARCH_RESULTS","NavSearch","t","useT","navigate","useNavigate","query","setQuery","useState","open","setOpen","active","setActive","rootRef","useRef","results","q","showList","useEffect","onDown","event","go","onKeyDown","hit","TextField","Icon","page","currentPath","groupIsActive","navBadge","text","navDot","color","badge","dot","chevron","Fragment","hasChildren","clsx","_b"],"mappings":"61BA8BMA,EAAUC,EAAAA,SAqDVC,GAAYC,GAChBA,EACG,MAAM,GAAG,EACT,IAAKC,GAAMA,EAAE,OAAO,CAAC,EAAE,cAAgBA,EAAE,MAAM,CAAC,CAAC,EACjD,KAAK,GAAG,EACPC,EAAeC,GAAcA,EAAE,QAAQ,aAAc,EAAE,EAEvDC,EAAiBD,GAAeA,EAAE,OAAS,GAAKA,EAAE,SAAS,GAAG,EAAIA,EAAE,MAAM,EAAG,EAAE,EAAIA,EACnFE,EAAmB,CACvBC,EACAC,IACGD,EAAE,MAAQC,EAAE,OAASD,EAAE,MAAM,cAAcC,EAAE,KAAK,EAqChD,SAASC,EAAaC,EAAgE,CAC3F,MAAMC,EAA4E,CAAA,EAClF,UAAWC,KAASF,EAAQ,CAC1B,MAAMG,EAAKD,EAAM,WACXE,EAAOX,EAAYS,EAAM,QAAQ,EACnC,EAACC,GAAA,MAAAA,EAAI,OAAQ,CAACC,GAClBH,EAAQ,KAAK,CAAE,KAAAG,EAAM,KAAMD,EAAG,KAAM,GAAAA,EAAI,CAC1C,CAEA,MAAME,EAAa,IAAI,IAAIJ,EAAQ,IAAKK,GAAM,CAACA,EAAE,KAAMA,CAAC,CAAC,CAAC,EACpDC,EAAQN,EAAQ,IAAKK,GAAMA,EAAE,IAAI,EAIjCE,EAAed,GACnBa,EAAM,KAAME,GAAA,OAAM,OAAAA,IAAMf,GAAKe,EAAE,WAAW,GAAGf,CAAC,GAAG,GAAK,GAACgB,EAAAL,EAAW,IAAII,CAAC,IAAhB,MAAAC,EAAmB,GAAG,QAAM,EAC/EC,EAAe,IAAI,IAAIX,EAAO,IAAKY,GAAMA,EAAE,QAAQ,CAAC,EACpDC,EAAmBC,GAAqBH,EAAa,IAAI,IAAIG,CAAQ,GAAG,EAExEC,EAAS,CAACC,EAAazB,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