@sereno-ds/ui 0.36.3 → 0.36.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -12
- package/dist/_internal/Field.d.ts +1 -1
- package/dist/_internal/Field.js +2 -2
- package/dist/_internal/Field.js.map +1 -1
- package/dist/_internal/mask.d.ts +1 -1
- package/dist/_internal/mask.js.map +1 -1
- package/dist/core/Avatar.d.ts +1 -1
- package/dist/core/Avatar.js.map +1 -1
- package/dist/core/Badge.js +1 -1
- package/dist/core/Badge.js.map +1 -1
- package/dist/core/Brand.d.ts +2 -2
- package/dist/core/Brand.js.map +1 -1
- package/dist/core/Button.d.ts +1 -1
- package/dist/core/Button.js.map +1 -1
- package/dist/core/Card.js +1 -1
- package/dist/core/Card.js.map +1 -1
- package/dist/core/IconButton.d.ts +2 -2
- package/dist/core/IconButton.js.map +1 -1
- package/dist/core/Menu.d.ts +5 -5
- package/dist/core/Menu.js.map +1 -1
- package/dist/core/Table.d.ts +7 -7
- package/dist/core/Table.js +1 -1
- package/dist/core/Table.js.map +1 -1
- package/dist/core/Typography.d.ts +3 -3
- package/dist/core/Typography.js +1 -1
- package/dist/core/Typography.js.map +1 -1
- package/dist/feedback/Alert.d.ts +2 -2
- package/dist/feedback/Alert.js.map +1 -1
- package/dist/feedback/Dialog.d.ts +5 -5
- package/dist/feedback/Dialog.js.map +1 -1
- package/dist/feedback/Skeleton.d.ts +1 -1
- package/dist/feedback/Skeleton.js.map +1 -1
- package/dist/feedback/Toast.d.ts +1 -1
- package/dist/feedback/Toast.js.map +1 -1
- package/dist/feedback/ToastProvider.d.ts +3 -3
- package/dist/feedback/ToastProvider.js +1 -1
- package/dist/feedback/ToastProvider.js.map +1 -1
- package/dist/forms/AvatarUpload.d.ts +5 -5
- package/dist/forms/AvatarUpload.js +2 -2
- package/dist/forms/AvatarUpload.js.map +1 -1
- package/dist/forms/Checkbox.d.ts +3 -3
- package/dist/forms/Checkbox.js +1 -1
- package/dist/forms/Checkbox.js.map +1 -1
- package/dist/forms/DatePicker.d.ts +9 -9
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DatePicker.js.map +1 -1
- package/dist/forms/DateTimePicker.d.ts +14 -14
- package/dist/forms/DateTimePicker.js +2 -2
- package/dist/forms/DateTimePicker.js.map +1 -1
- package/dist/forms/FileUpload.d.ts +4 -4
- package/dist/forms/FileUpload.js.map +1 -1
- package/dist/forms/Input.d.ts +1 -1
- package/dist/forms/Input.js +1 -1
- package/dist/forms/Input.js.map +1 -1
- package/dist/forms/Radio.d.ts +5 -5
- package/dist/forms/Radio.js.map +1 -1
- package/dist/forms/SearchInput.d.ts +2 -2
- package/dist/forms/SearchInput.js.map +1 -1
- package/dist/forms/Select.d.ts +9 -9
- package/dist/forms/Select.js.map +1 -1
- package/dist/forms/Switch.d.ts +3 -3
- package/dist/forms/Switch.js.map +1 -1
- package/dist/forms/Textarea.d.ts +1 -1
- package/dist/forms/Textarea.js.map +1 -1
- package/dist/forms/_internal/CalendarGrid.d.ts +6 -6
- package/dist/forms/_internal/CalendarGrid.js +1 -1
- package/dist/forms/_internal/CalendarGrid.js.map +1 -1
- package/dist/forms/_internal/fieldBoxStyle.d.ts +2 -2
- package/dist/forms/_internal/fieldBoxStyle.js +2 -2
- package/dist/forms/_internal/fieldBoxStyle.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/navigation/BottomNav.d.ts +1 -1
- package/dist/navigation/BottomNav.js +1 -1
- package/dist/navigation/BottomNav.js.map +1 -1
- package/dist/navigation/SidebarNav.d.ts +9 -9
- package/dist/navigation/SidebarNav.js +1 -1
- package/dist/navigation/SidebarNav.js.map +1 -1
- package/dist/navigation/Stepper.d.ts +5 -5
- package/dist/navigation/Stepper.js.map +1 -1
- package/dist/navigation/Tabs.d.ts +2 -2
- package/dist/navigation/Tabs.js +11 -11
- package/dist/navigation/Tabs.js.map +1 -1
- package/dist/navigation/TopBar.d.ts +3 -3
- package/dist/navigation/TopBar.js.map +1 -1
- package/dist/styles.css +23 -23
- package/dist/theme/ThemeProvider.d.ts +1 -1
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/forms/_internal/CalendarGrid.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { ChevronDown, ChevronLeft, ChevronRight } from 'lucide-react';\nimport { sx } from '../../_internal/style';\nimport { IconButton } from '../../core/IconButton';\n\n/**\n * The month calendar body — header (‹ / › month nav + a month/year jump\n * popover) and the day grid with roving-tabindex keyboard navigation\n * (SS-228). Shared by `DateTimePicker` (rendered inline, with an optional\n * time-slot list under it) and `DatePicker` (rendered inside its own\n * trigger+popover shell) — extracted so neither has to duplicate the\n * keyboard-grid math (SS-243). See `DateTimePicker`'s own doc comment for\n * the full behavior description; this component owns exactly the same\n * state and logic it always has, just without the outer card chrome or\n * the time-slot section, neither of which any of this depends on.\n */\nexport interface CalendarGridProps {\n year?: number;\n month?: number;\n selectedDate?: number;\n unavailable?: number[];\n onSelectDate?: (day: number) => void;\n onMonthChange?: (year: number, month: number) => void;\n renderDay?: (day: number) => React.ReactNode;\n /**\n * Day cells are perfect squares (`aspect-ratio`) instead of a fixed pixel\n * height — `DatePicker` (SS-243) opts into this since its popover can be\n * narrower than `DateTimePicker`'s own card, where a fixed height was\n * already tuned and shipped. Ignored when `renderDay` is set — that case\n * always needs the extra fixed height for its own content.\n */\n squareCells?: boolean;\n /**\n * Drop wholly-blank trailing rows instead of always padding to 6 (SS-243)\n * — `DateTimePicker` needs the fixed 6 rows so its *always-visible* card\n * never jumps height as you navigate months; `DatePicker`'s popover opens\n * and closes anyway, so a variable height per month reads better than a\n * dead empty row (e.g. a 30-day month starting on Sunday only needs 5).\n */\n trimEmptyRows?: boolean;\n /**\n * The product itself (Sereno's real booking app) always renders pt-BR —\n * this only exists so the docs showcase can demo an English-speaking\n * consumer without forking the component. Default stays `'pt-BR'`.\n */\n locale?: 'pt-BR' | 'en';\n}\n\nconst I18N = {\n 'pt-BR': {\n dow: ['D', 'S', 'T', 'Q', 'Q', 'S', 'S'],\n months: ['janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro'],\n monthsShort: ['jan', 'fev', 'mar', 'abr', 'mai', 'jun', 'jul', 'ago', 'set', 'out', 'nov', 'dez'],\n prevMonth: 'Mês anterior',\n nextMonth: 'Próximo mês',\n prevYear: 'Ano anterior',\n prevYears: 'Anos anteriores',\n nextYear: 'Próximo ano',\n nextYears: 'Próximos anos',\n pickerLabel: 'Escolher mês e ano',\n },\n en: {\n dow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],\n months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n prevMonth: 'Previous month',\n nextMonth: 'Next month',\n prevYear: 'Previous year',\n prevYears: 'Previous years',\n nextYear: 'Next year',\n nextYears: 'Next years',\n pickerLabel: 'Choose month and year',\n },\n} as const;\n\nfunction daysIn(y: number, m: number): number {\n return new Date(y, m + 1, 0).getDate();\n}\n\nexport function CalendarGrid({\n year,\n month,\n selectedDate,\n unavailable = [],\n onSelectDate,\n onMonthChange,\n renderDay,\n squareCells = false,\n trimEmptyRows = false,\n locale = 'pt-BR',\n}: CalendarGridProps) {\n const t = I18N[locale];\n const now = React.useMemo(() => new Date(), []);\n // One integer for the visible month — `year*12 + month`. Keeps ‹ / › arithmetic\n // (and rapid clicks) correct across year boundaries with no Date() juggling.\n // `year` / `month` are the *initial* view; the component then owns it. A\n // consumer that needs to reset the view (DatePicker, on reopen) remounts\n // this component instead — see its own comment.\n const initialIndex = (year ?? now.getFullYear()) * 12 + (month ?? now.getMonth());\n const [viewIndex, setViewIndex] = React.useState(initialIndex);\n const viewYear = Math.floor(viewIndex / 12);\n const viewMonth = viewIndex % 12;\n // `selectedDate` is only a day number, so remember which month that pick was\n // made in — the highlight shows only there, never on the same day of another\n // month you navigate to.\n const [selectionIndex, setSelectionIndex] = React.useState(initialIndex);\n const [open, setOpen] = React.useState(false);\n const [picker, setPicker] = React.useState<'month' | 'year'>('month');\n const [yearBase, setYearBase] = React.useState(() => (year ?? now.getFullYear()) - 5);\n\n const rootRef = React.useRef<HTMLDivElement>(null);\n const titleRef = React.useRef<HTMLButtonElement>(null);\n const popRef = React.useRef<HTMLDivElement>(null);\n const gridRef = React.useRef<HTMLDivElement>(null);\n\n // Roving tabindex for the day grid: only one cell is ever in the Tab\n // order (below), so Tab enters/leaves the whole grid in one stop instead\n // of one per day. `activeDay` is the day-of-month that cell represents —\n // clamped to the visible month's length at render (below), since it\n // persists across a month change (‹ / › or an arrow-key crossing) where\n // the same day number may no longer exist (e.g. the 31st, into February).\n const [activeDay, setActiveDay] = React.useState(() => {\n if (selectedDate) return selectedDate;\n const todayIndex = now.getFullYear() * 12 + now.getMonth();\n return todayIndex === initialIndex ? now.getDate() : 1;\n });\n // Set right before a keyboard move changes activeDay/viewIndex; consumed\n // by the layout effect below to focus the new cell once it's in the DOM —\n // never on an unrelated render (a prop change, a re-render from the\n // parent) or the initial mount.\n const shouldFocusDayRef = React.useRef(false);\n\n // Notify on navigation — never on mount, always with the settled value.\n const onMonthChangeRef = React.useRef(onMonthChange);\n React.useEffect(() => {\n onMonthChangeRef.current = onMonthChange;\n });\n const didMount = React.useRef(false);\n React.useEffect(() => {\n if (!didMount.current) {\n didMount.current = true;\n return;\n }\n onMonthChangeRef.current?.(Math.floor(viewIndex / 12), viewIndex % 12);\n }, [viewIndex]);\n\n // close on outside pointer; move focus into the popover on open\n React.useEffect(() => {\n if (!open) return;\n const onDown = (e: PointerEvent) => {\n if (rootRef.current && !rootRef.current.contains(e.target as Node)) {\n setOpen(false);\n setPicker('month');\n }\n };\n document.addEventListener('pointerdown', onDown, true);\n const id = requestAnimationFrame(() => popRef.current?.focus());\n return () => {\n document.removeEventListener('pointerdown', onDown, true);\n cancelAnimationFrame(id);\n };\n }, [open]);\n\n const closePopover = React.useCallback(() => {\n setOpen(false);\n setPicker('month');\n titleRef.current?.focus();\n }, []);\n const toggleOpen = React.useCallback(() => {\n setOpen((v) => {\n if (v) setPicker('month');\n return !v;\n });\n }, []);\n\n const first = new Date(viewYear, viewMonth, 1).getDay();\n const total = daysIn(viewYear, viewMonth);\n // Always 6 rows (42 cells) so the calendar's height never shifts between\n // months — trailing blanks pad it out and carry the cell height too.\n const cells: (number | null)[] = [...Array(first).fill(null), ...Array.from({ length: total }, (_, i) => i + 1)];\n while (cells.length < 42) cells.push(null);\n if (trimEmptyRows) {\n while (cells.length > 7 && cells.slice(-7).every((c) => c === null)) cells.length -= 7;\n }\n // A plain day cell is a perfect square via aspect-ratio when `squareCells`\n // is set — its height then tracks the grid's actual column width (SS-243:\n // DatePicker's popover can be narrower than DateTimePicker's own card)\n // instead of a fixed guess that only looks square at one particular width.\n // `renderDay` needs literal extra height for its own content underneath\n // the day number regardless, so that case always keeps a fixed height.\n const cellSizing: React.CSSProperties = renderDay ? { height: 48 } : squareCells ? { aspectRatio: '1' } : { height: 38 };\n const years = Array.from({ length: 12 }, (_, i) => yearBase + i);\n const rovingDay = Math.min(Math.max(1, activeDay), total);\n\n // Arrow keys move the roving cursor by real calendar days — crossing into\n // the adjacent month's grid when they overflow the visible one, rather\n // than stopping dead at the edge. Home/End stay within the current week\n // row; PageUp/PageDown step the month (reusing the same ‹ / › state\n // change, so onMonthChange fires identically either way).\n const onGridKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n let delta = 0;\n switch (e.key) {\n case 'ArrowRight':\n delta = 1;\n break;\n case 'ArrowLeft':\n delta = -1;\n break;\n case 'ArrowDown':\n delta = 7;\n break;\n case 'ArrowUp':\n delta = -7;\n break;\n case 'Home': {\n e.preventDefault();\n const row = Math.floor((first + rovingDay - 1) / 7);\n shouldFocusDayRef.current = true;\n setActiveDay(Math.max(1, row * 7 - first + 1));\n return;\n }\n case 'End': {\n e.preventDefault();\n const row = Math.floor((first + rovingDay - 1) / 7);\n shouldFocusDayRef.current = true;\n setActiveDay(Math.min(total, row * 7 + 7 - first));\n return;\n }\n case 'PageUp':\n e.preventDefault();\n shouldFocusDayRef.current = true;\n setViewIndex((i) => i - 1);\n return;\n case 'PageDown':\n e.preventDefault();\n shouldFocusDayRef.current = true;\n setViewIndex((i) => i + 1);\n return;\n default:\n return;\n }\n e.preventDefault();\n const next = new Date(viewYear, viewMonth, rovingDay + delta);\n const nextViewIndex = next.getFullYear() * 12 + next.getMonth();\n shouldFocusDayRef.current = true;\n if (nextViewIndex !== viewIndex) setViewIndex(nextViewIndex);\n setActiveDay(next.getDate());\n };\n\n // Runs after the grid above (keyed on viewIndex, so a month change remounts\n // it) has committed the DOM for the new activeDay/viewIndex — only then\n // does the target cell actually exist to focus.\n React.useLayoutEffect(() => {\n if (!shouldFocusDayRef.current) return;\n shouldFocusDayRef.current = false;\n gridRef.current?.querySelector<HTMLButtonElement>(`[data-day=\"${rovingDay}\"]`)?.focus();\n }, [viewIndex, rovingDay]);\n\n return (\n <div ref={rootRef}>\n <div\n style={sx({\n position: 'relative',\n display: 'grid',\n gridTemplateColumns: 'auto 1fr auto',\n alignItems: 'center',\n gap: 'var(--space-1)',\n marginBottom: 'var(--space-3)',\n })}\n >\n <IconButton label={t.prevMonth} size=\"sm\" onClick={() => setViewIndex((i) => i - 1)}>\n <ChevronLeft size={18} strokeWidth={1.75} />\n </IconButton>\n\n <button\n ref={titleRef}\n type=\"button\"\n className=\"sereno-dtp-title\"\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n onClick={toggleOpen}\n style={sx({\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 4,\n margin: '0 auto',\n padding: '4px 8px',\n border: 'none',\n borderRadius: 'var(--radius-sm)',\n background: 'transparent',\n cursor: 'pointer',\n fontFamily: 'var(--font-display)',\n fontSize: 'var(--text-base)',\n fontWeight: 'var(--weight-bold)',\n color: 'var(--text-primary)',\n textTransform: 'capitalize',\n })}\n >\n {t.months[viewMonth]} {viewYear}\n <ChevronDown size={15} strokeWidth={2} style={{ opacity: 0.6 }} />\n </button>\n\n <IconButton label={t.nextMonth} size=\"sm\" onClick={() => setViewIndex((i) => i + 1)}>\n <ChevronRight size={18} strokeWidth={1.75} />\n </IconButton>\n\n {open && (\n <div\n ref={popRef}\n role=\"dialog\"\n aria-label={t.pickerLabel}\n tabIndex={-1}\n onKeyDown={(e) => {\n if (e.key === 'Escape') {\n e.stopPropagation();\n closePopover();\n }\n }}\n className=\"sereno-dtp-pop\"\n style={sx({\n position: 'absolute',\n top: 'calc(100% + 6px)',\n left: '50%',\n transform: 'translateX(-50%)',\n zIndex: 20,\n width: 248,\n maxWidth: 'calc(100vw - 24px)',\n background: 'var(--bg-surface)',\n border: 'var(--border-width-hairline) solid var(--border-default)',\n borderRadius: 'var(--radius-md)',\n boxShadow: 'var(--shadow-lg)',\n padding: 'var(--space-3)',\n outline: 'none',\n })}\n >\n <div\n style={sx({\n display: 'grid',\n gridTemplateColumns: 'auto 1fr auto',\n alignItems: 'center',\n marginBottom: 'var(--space-2)',\n })}\n >\n <IconButton\n label={picker === 'month' ? t.prevYear : t.prevYears}\n size=\"sm\"\n onClick={() => (picker === 'month' ? setViewIndex((i) => i - 12) : setYearBase((b) => b - 12))}\n >\n <ChevronLeft size={18} strokeWidth={1.75} />\n </IconButton>\n\n {picker === 'month' ? (\n <button\n type=\"button\"\n className=\"sereno-dtp-title\"\n onClick={() => {\n setYearBase(viewYear - 5);\n setPicker('year');\n }}\n style={sx({\n margin: '0 auto',\n padding: '4px 8px',\n border: 'none',\n borderRadius: 'var(--radius-sm)',\n background: 'transparent',\n cursor: 'pointer',\n fontFamily: 'var(--font-display)',\n fontSize: 'var(--text-sm)',\n fontWeight: 'var(--weight-bold)',\n color: 'var(--text-primary)',\n })}\n >\n {viewYear}\n </button>\n ) : (\n <span\n style={sx({\n textAlign: 'center',\n fontFamily: 'var(--font-body)',\n fontSize: 'var(--text-sm)',\n fontWeight: 'var(--weight-semibold)',\n color: 'var(--text-secondary)',\n })}\n >\n {years[0]}–{years[11]}\n </span>\n )}\n\n <IconButton\n label={picker === 'month' ? t.nextYear : t.nextYears}\n size=\"sm\"\n onClick={() => (picker === 'month' ? setViewIndex((i) => i + 12) : setYearBase((b) => b + 12))}\n >\n <ChevronRight size={18} strokeWidth={1.75} />\n </IconButton>\n </div>\n\n <div className=\"sereno-dtp-grid\" style={sx({ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 'var(--space-1)' })}>\n {picker === 'month'\n ? t.monthsShort.map((mo, i) => (\n <button\n key={mo}\n type=\"button\"\n data-current={i === viewMonth || undefined}\n aria-current={i === viewMonth ? 'true' : undefined}\n onClick={() => {\n setViewIndex(viewYear * 12 + i);\n closePopover();\n }}\n >\n {mo}\n </button>\n ))\n : years.map((y) => (\n <button\n key={y}\n type=\"button\"\n data-current={y === viewYear || undefined}\n aria-current={y === viewYear ? 'true' : undefined}\n onClick={() => {\n setViewIndex(y * 12 + viewMonth);\n setPicker('month');\n }}\n >\n {y}\n </button>\n ))}\n </div>\n </div>\n )}\n </div>\n\n <div style={sx({ display: 'grid', gridTemplateColumns: 'repeat(7,1fr)', gap: 'var(--space-1)', marginBottom: 'var(--space-1)' })}>\n {t.dow.map((d, i) => (\n <span\n key={i}\n style={sx({\n textAlign: 'center',\n fontFamily: 'var(--font-body)',\n fontSize: 'var(--text-2xs)',\n fontWeight: 'var(--weight-semibold)',\n color: 'var(--text-muted)',\n letterSpacing: 'var(--tracking-caps)',\n })}\n >\n {d}\n </span>\n ))}\n </div>\n {/* keyed on the month so cells remount cleanly — no bg transition when a\n slot morphs from one day to another on navigation. */}\n <div\n key={viewIndex}\n ref={gridRef}\n onKeyDown={onGridKeyDown}\n className=\"sereno-dtp-days\"\n style={sx({ display: 'grid', gridTemplateColumns: 'repeat(7,1fr)', gap: 'var(--space-1)' })}\n >\n {cells.map((d, i) => {\n // Blank cells still take the row height so the 6-row grid can't collapse.\n if (d === null) return <span key={i} aria-hidden style={cellSizing} />;\n const off = unavailable.includes(d);\n const sel = selectedDate === d && viewIndex === selectionIndex;\n const extra = renderDay?.(d);\n return (\n <button\n key={i}\n type=\"button\"\n data-day={d}\n // Not the native `disabled` — an unavailable day stays a real,\n // focusable stop on the roving cursor (aria-disabled only) so\n // arrow-key navigation can still land on it and the user can\n // tell it exists, matching the WAI-ARIA date-grid pattern. A\n // truly `disabled` button can't receive focus at all, which\n // would make the roving tabindex below silently break.\n aria-disabled={off || undefined}\n tabIndex={d === rovingDay ? 0 : -1}\n aria-pressed={sel}\n onClick={() => {\n if (off) return;\n setSelectionIndex(viewIndex);\n // Keep the roving cursor in sync with a mouse pick too — a\n // click already moves real DOM focus onto this button\n // natively, so without this the *next* arrow press would\n // jump from wherever the keyboard cursor was left instead\n // of from the day the user can see is focused/selected.\n setActiveDay(d);\n onSelectDate?.(d);\n }}\n style={sx({\n ...cellSizing,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 1,\n borderRadius: 'var(--radius-sm)',\n border: 'none',\n padding: 0,\n cursor: off ? 'not-allowed' : 'pointer',\n background: sel ? 'var(--interactive-primary)' : 'transparent',\n color: sel ? 'var(--interactive-primary-fg)' : off ? 'var(--text-disabled)' : 'var(--text-primary)',\n fontFamily: 'var(--font-body)',\n fontSize: 'var(--text-sm)',\n fontWeight: sel ? 'var(--weight-bold)' : 'var(--weight-medium)',\n textDecoration: off ? 'line-through' : 'none',\n transition: 'var(--transition-control)',\n // Not inline outline:none — that would always beat the\n // .sereno-dtp-days:focus-visible rule below no matter what\n // it says (inline style always outranks a class selector).\n // Suppressed as a class rule instead, same specificity as\n // the :focus-visible override that re-enables it.\n })}\n >\n <span>{d}</span>\n {renderDay ? <span style={sx({ display: 'flex', minHeight: 12, lineHe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ACtB,UAAU,MAAM,YAAY,IAAI;AAAA,cAChC,gBAAc;AAAA,cACd,SAAS,MAAM;AACb,oBAAI,IAAK;AACT,kCAAkB,SAAS;AAM3B,6BAAa,CAAC;AACd,+BAAe,CAAC;AAAA,cAClB;AAAA,cACA,OAAO,GAAG;AAAA,gBACR,GAAG;AAAA,gBACH,SAAS;AAAA,gBACT,eAAe;AAAA,gBACf,YAAY;AAAA,gBACZ,gBAAgB;AAAA,gBAChB,KAAK;AAAA,gBACL,cAAc;AAAA,gBACd,QAAQ;AAAA,gBACR,SAAS;AAAA,gBACT,QAAQ,MAAM,gBAAgB;AAAA,gBAC9B,YAAY,MAAM,+BAA+B;AAAA,gBACjD,OAAO,MAAM,kCAAkC,MAAM,yBAAyB;AAAA,gBAC9E,YAAY;AAAA,gBACZ,UAAU;AAAA,gBACV,YAAY,MAAM,uBAAuB;AAAA,gBACzC,gBAAgB,MAAM,iBAAiB;AAAA,gBACvC,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAMd,CAAC;AAAA,cAED;AAAA,oCAAC,UAAM,aAAE;AAAA,gBACR,YAAY,oBAAC,UAAK,OAAO,GAAG,EAAE,SAAS,QAAQ,WAAW,IAAI,YAAY,EAAE,CAAC,GAAI,iBAAM,IAAU;AAAA;AAAA;AAAA,YAjD7F;AAAA,UAkDP;AAAA,QAEJ,CAAC;AAAA;AAAA,MAlEI;AAAA,IAmEP;AAAA,KACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/forms/_internal/CalendarGrid.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { ChevronDown, ChevronLeft, ChevronRight } from 'lucide-react';\nimport { sx } from '../../_internal/style';\nimport { IconButton } from '../../core/IconButton';\n\n/**\n * The month calendar body - header (‹ / › month nav + a month/year jump\n * popover) and the day grid with roving-tabindex keyboard navigation\n * (SS-228). Shared by `DateTimePicker` (rendered inline, with an optional\n * time-slot list under it) and `DatePicker` (rendered inside its own\n * trigger+popover shell) - extracted so neither has to duplicate the\n * keyboard-grid math (SS-243). See `DateTimePicker`'s own doc comment for\n * the full behavior description; this component owns exactly the same\n * state and logic it always has, just without the outer card chrome or\n * the time-slot section, neither of which any of this depends on.\n */\nexport interface CalendarGridProps {\n year?: number;\n month?: number;\n selectedDate?: number;\n unavailable?: number[];\n onSelectDate?: (day: number) => void;\n onMonthChange?: (year: number, month: number) => void;\n renderDay?: (day: number) => React.ReactNode;\n /**\n * Day cells are perfect squares (`aspect-ratio`) instead of a fixed pixel\n * height - `DatePicker` (SS-243) opts into this since its popover can be\n * narrower than `DateTimePicker`'s own card, where a fixed height was\n * already tuned and shipped. Ignored when `renderDay` is set - that case\n * always needs the extra fixed height for its own content.\n */\n squareCells?: boolean;\n /**\n * Drop wholly-blank trailing rows instead of always padding to 6 (SS-243)\n * `DateTimePicker` needs the fixed 6 rows so its *always-visible* card\n * never jumps height as you navigate months; `DatePicker`'s popover opens\n * and closes anyway, so a variable height per month reads better than a\n * dead empty row (e.g. a 30-day month starting on Sunday only needs 5).\n */\n trimEmptyRows?: boolean;\n /**\n * The product itself (Sereno's real booking app) always renders pt-BR -\n * this only exists so the docs showcase can demo an English-speaking\n * consumer without forking the component. Default stays `'pt-BR'`.\n */\n locale?: 'pt-BR' | 'en';\n}\n\nconst I18N = {\n 'pt-BR': {\n dow: ['D', 'S', 'T', 'Q', 'Q', 'S', 'S'],\n months: ['janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro'],\n monthsShort: ['jan', 'fev', 'mar', 'abr', 'mai', 'jun', 'jul', 'ago', 'set', 'out', 'nov', 'dez'],\n prevMonth: 'Mês anterior',\n nextMonth: 'Próximo mês',\n prevYear: 'Ano anterior',\n prevYears: 'Anos anteriores',\n nextYear: 'Próximo ano',\n nextYears: 'Próximos anos',\n pickerLabel: 'Escolher mês e ano',\n },\n en: {\n dow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],\n months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n prevMonth: 'Previous month',\n nextMonth: 'Next month',\n prevYear: 'Previous year',\n prevYears: 'Previous years',\n nextYear: 'Next year',\n nextYears: 'Next years',\n pickerLabel: 'Choose month and year',\n },\n} as const;\n\nfunction daysIn(y: number, m: number): number {\n return new Date(y, m + 1, 0).getDate();\n}\n\nexport function CalendarGrid({\n year,\n month,\n selectedDate,\n unavailable = [],\n onSelectDate,\n onMonthChange,\n renderDay,\n squareCells = false,\n trimEmptyRows = false,\n locale = 'pt-BR',\n}: CalendarGridProps) {\n const t = I18N[locale];\n const now = React.useMemo(() => new Date(), []);\n // One integer for the visible month - `year*12 + month`. Keeps ‹ / › arithmetic\n // (and rapid clicks) correct across year boundaries with no Date() juggling.\n // `year` / `month` are the *initial* view; the component then owns it. A\n // consumer that needs to reset the view (DatePicker, on reopen) remounts\n // this component instead - see its own comment.\n const initialIndex = (year ?? now.getFullYear()) * 12 + (month ?? now.getMonth());\n const [viewIndex, setViewIndex] = React.useState(initialIndex);\n const viewYear = Math.floor(viewIndex / 12);\n const viewMonth = viewIndex % 12;\n // `selectedDate` is only a day number, so remember which month that pick was\n // made in - the highlight shows only there, never on the same day of another\n // month you navigate to.\n const [selectionIndex, setSelectionIndex] = React.useState(initialIndex);\n const [open, setOpen] = React.useState(false);\n const [picker, setPicker] = React.useState<'month' | 'year'>('month');\n const [yearBase, setYearBase] = React.useState(() => (year ?? now.getFullYear()) - 5);\n\n const rootRef = React.useRef<HTMLDivElement>(null);\n const titleRef = React.useRef<HTMLButtonElement>(null);\n const popRef = React.useRef<HTMLDivElement>(null);\n const gridRef = React.useRef<HTMLDivElement>(null);\n\n // Roving tabindex for the day grid: only one cell is ever in the Tab\n // order (below), so Tab enters/leaves the whole grid in one stop instead\n // of one per day. `activeDay` is the day-of-month that cell represents -\n // clamped to the visible month's length at render (below), since it\n // persists across a month change (‹ / › or an arrow-key crossing) where\n // the same day number may no longer exist (e.g. the 31st, into February).\n const [activeDay, setActiveDay] = React.useState(() => {\n if (selectedDate) return selectedDate;\n const todayIndex = now.getFullYear() * 12 + now.getMonth();\n return todayIndex === initialIndex ? now.getDate() : 1;\n });\n // Set right before a keyboard move changes activeDay/viewIndex; consumed\n // by the layout effect below to focus the new cell once it's in the DOM -\n // never on an unrelated render (a prop change, a re-render from the\n // parent) or the initial mount.\n const shouldFocusDayRef = React.useRef(false);\n\n // Notify on navigation - never on mount, always with the settled value.\n const onMonthChangeRef = React.useRef(onMonthChange);\n React.useEffect(() => {\n onMonthChangeRef.current = onMonthChange;\n });\n const didMount = React.useRef(false);\n React.useEffect(() => {\n if (!didMount.current) {\n didMount.current = true;\n return;\n }\n onMonthChangeRef.current?.(Math.floor(viewIndex / 12), viewIndex % 12);\n }, [viewIndex]);\n\n // close on outside pointer; move focus into the popover on open\n React.useEffect(() => {\n if (!open) return;\n const onDown = (e: PointerEvent) => {\n if (rootRef.current && !rootRef.current.contains(e.target as Node)) {\n setOpen(false);\n setPicker('month');\n }\n };\n document.addEventListener('pointerdown', onDown, true);\n const id = requestAnimationFrame(() => popRef.current?.focus());\n return () => {\n document.removeEventListener('pointerdown', onDown, true);\n cancelAnimationFrame(id);\n };\n }, [open]);\n\n const closePopover = React.useCallback(() => {\n setOpen(false);\n setPicker('month');\n titleRef.current?.focus();\n }, []);\n const toggleOpen = React.useCallback(() => {\n setOpen((v) => {\n if (v) setPicker('month');\n return !v;\n });\n }, []);\n\n const first = new Date(viewYear, viewMonth, 1).getDay();\n const total = daysIn(viewYear, viewMonth);\n // Always 6 rows (42 cells) so the calendar's height never shifts between\n // months - trailing blanks pad it out and carry the cell height too.\n const cells: (number | null)[] = [...Array(first).fill(null), ...Array.from({ length: total }, (_, i) => i + 1)];\n while (cells.length < 42) cells.push(null);\n if (trimEmptyRows) {\n while (cells.length > 7 && cells.slice(-7).every((c) => c === null)) cells.length -= 7;\n }\n // A plain day cell is a perfect square via aspect-ratio when `squareCells`\n // is set - its height then tracks the grid's actual column width (SS-243:\n // DatePicker's popover can be narrower than DateTimePicker's own card)\n // instead of a fixed guess that only looks square at one particular width.\n // `renderDay` needs literal extra height for its own content underneath\n // the day number regardless, so that case always keeps a fixed height.\n const cellSizing: React.CSSProperties = renderDay ? { height: 48 } : squareCells ? { aspectRatio: '1' } : { height: 38 };\n const years = Array.from({ length: 12 }, (_, i) => yearBase + i);\n const rovingDay = Math.min(Math.max(1, activeDay), total);\n\n // Arrow keys move the roving cursor by real calendar days - crossing into\n // the adjacent month's grid when they overflow the visible one, rather\n // than stopping dead at the edge. Home/End stay within the current week\n // row; PageUp/PageDown step the month (reusing the same ‹ / › state\n // change, so onMonthChange fires identically either way).\n const onGridKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n let delta = 0;\n switch (e.key) {\n case 'ArrowRight':\n delta = 1;\n break;\n case 'ArrowLeft':\n delta = -1;\n break;\n case 'ArrowDown':\n delta = 7;\n break;\n case 'ArrowUp':\n delta = -7;\n break;\n case 'Home': {\n e.preventDefault();\n const row = Math.floor((first + rovingDay - 1) / 7);\n shouldFocusDayRef.current = true;\n setActiveDay(Math.max(1, row * 7 - first + 1));\n return;\n }\n case 'End': {\n e.preventDefault();\n const row = Math.floor((first + rovingDay - 1) / 7);\n shouldFocusDayRef.current = true;\n setActiveDay(Math.min(total, row * 7 + 7 - first));\n return;\n }\n case 'PageUp':\n e.preventDefault();\n shouldFocusDayRef.current = true;\n setViewIndex((i) => i - 1);\n return;\n case 'PageDown':\n e.preventDefault();\n shouldFocusDayRef.current = true;\n setViewIndex((i) => i + 1);\n return;\n default:\n return;\n }\n e.preventDefault();\n const next = new Date(viewYear, viewMonth, rovingDay + delta);\n const nextViewIndex = next.getFullYear() * 12 + next.getMonth();\n shouldFocusDayRef.current = true;\n if (nextViewIndex !== viewIndex) setViewIndex(nextViewIndex);\n setActiveDay(next.getDate());\n };\n\n // Runs after the grid above (keyed on viewIndex, so a month change remounts\n // it) has committed the DOM for the new activeDay/viewIndex - only then\n // does the target cell actually exist to focus.\n React.useLayoutEffect(() => {\n if (!shouldFocusDayRef.current) return;\n shouldFocusDayRef.current = false;\n gridRef.current?.querySelector<HTMLButtonElement>(`[data-day=\"${rovingDay}\"]`)?.focus();\n }, [viewIndex, rovingDay]);\n\n return (\n <div ref={rootRef}>\n <div\n style={sx({\n position: 'relative',\n display: 'grid',\n gridTemplateColumns: 'auto 1fr auto',\n alignItems: 'center',\n gap: 'var(--space-1)',\n marginBottom: 'var(--space-3)',\n })}\n >\n <IconButton label={t.prevMonth} size=\"sm\" onClick={() => setViewIndex((i) => i - 1)}>\n <ChevronLeft size={18} strokeWidth={1.75} />\n </IconButton>\n\n <button\n ref={titleRef}\n type=\"button\"\n className=\"sereno-dtp-title\"\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n onClick={toggleOpen}\n style={sx({\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 4,\n margin: '0 auto',\n padding: '4px 8px',\n border: 'none',\n borderRadius: 'var(--radius-sm)',\n background: 'transparent',\n cursor: 'pointer',\n fontFamily: 'var(--font-display)',\n fontSize: 'var(--text-base)',\n fontWeight: 'var(--weight-bold)',\n color: 'var(--text-primary)',\n textTransform: 'capitalize',\n })}\n >\n {t.months[viewMonth]} {viewYear}\n <ChevronDown size={15} strokeWidth={2} style={{ opacity: 0.6 }} />\n </button>\n\n <IconButton label={t.nextMonth} size=\"sm\" onClick={() => setViewIndex((i) => i + 1)}>\n <ChevronRight size={18} strokeWidth={1.75} />\n </IconButton>\n\n {open && (\n <div\n ref={popRef}\n role=\"dialog\"\n aria-label={t.pickerLabel}\n tabIndex={-1}\n onKeyDown={(e) => {\n if (e.key === 'Escape') {\n e.stopPropagation();\n closePopover();\n }\n }}\n className=\"sereno-dtp-pop\"\n style={sx({\n position: 'absolute',\n top: 'calc(100% + 6px)',\n left: '50%',\n transform: 'translateX(-50%)',\n zIndex: 20,\n width: 248,\n maxWidth: 'calc(100vw - 24px)',\n background: 'var(--bg-surface)',\n border: 'var(--border-width-hairline) solid var(--border-default)',\n borderRadius: 'var(--radius-md)',\n boxShadow: 'var(--shadow-lg)',\n padding: 'var(--space-3)',\n outline: 'none',\n })}\n >\n <div\n style={sx({\n display: 'grid',\n gridTemplateColumns: 'auto 1fr auto',\n alignItems: 'center',\n marginBottom: 'var(--space-2)',\n })}\n >\n <IconButton\n label={picker === 'month' ? t.prevYear : t.prevYears}\n size=\"sm\"\n onClick={() => (picker === 'month' ? setViewIndex((i) => i - 12) : setYearBase((b) => b - 12))}\n >\n <ChevronLeft size={18} strokeWidth={1.75} />\n </IconButton>\n\n {picker === 'month' ? (\n <button\n type=\"button\"\n className=\"sereno-dtp-title\"\n onClick={() => {\n setYearBase(viewYear - 5);\n setPicker('year');\n }}\n style={sx({\n margin: '0 auto',\n padding: '4px 8px',\n border: 'none',\n borderRadius: 'var(--radius-sm)',\n background: 'transparent',\n cursor: 'pointer',\n fontFamily: 'var(--font-display)',\n fontSize: 'var(--text-sm)',\n fontWeight: 'var(--weight-bold)',\n color: 'var(--text-primary)',\n })}\n >\n {viewYear}\n </button>\n ) : (\n <span\n style={sx({\n textAlign: 'center',\n fontFamily: 'var(--font-body)',\n fontSize: 'var(--text-sm)',\n fontWeight: 'var(--weight-semibold)',\n color: 'var(--text-secondary)',\n })}\n >\n {years[0]}–{years[11]}\n </span>\n )}\n\n <IconButton\n label={picker === 'month' ? t.nextYear : t.nextYears}\n size=\"sm\"\n onClick={() => (picker === 'month' ? setViewIndex((i) => i + 12) : setYearBase((b) => b + 12))}\n >\n <ChevronRight size={18} strokeWidth={1.75} />\n </IconButton>\n </div>\n\n <div className=\"sereno-dtp-grid\" style={sx({ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 'var(--space-1)' })}>\n {picker === 'month'\n ? t.monthsShort.map((mo, i) => (\n <button\n key={mo}\n type=\"button\"\n data-current={i === viewMonth || undefined}\n aria-current={i === viewMonth ? 'true' : undefined}\n onClick={() => {\n setViewIndex(viewYear * 12 + i);\n closePopover();\n }}\n >\n {mo}\n </button>\n ))\n : years.map((y) => (\n <button\n key={y}\n type=\"button\"\n data-current={y === viewYear || undefined}\n aria-current={y === viewYear ? 'true' : undefined}\n onClick={() => {\n setViewIndex(y * 12 + viewMonth);\n setPicker('month');\n }}\n >\n {y}\n </button>\n ))}\n </div>\n </div>\n )}\n </div>\n\n <div style={sx({ display: 'grid', gridTemplateColumns: 'repeat(7,1fr)', gap: 'var(--space-1)', marginBottom: 'var(--space-1)' })}>\n {t.dow.map((d, i) => (\n <span\n key={i}\n style={sx({\n textAlign: 'center',\n fontFamily: 'var(--font-body)',\n fontSize: 'var(--text-2xs)',\n fontWeight: 'var(--weight-semibold)',\n color: 'var(--text-muted)',\n letterSpacing: 'var(--tracking-caps)',\n })}\n >\n {d}\n </span>\n ))}\n </div>\n {/* keyed on the month so cells remount cleanly - no bg transition when a\n slot morphs from one day to another on navigation. */}\n <div\n key={viewIndex}\n ref={gridRef}\n onKeyDown={onGridKeyDown}\n className=\"sereno-dtp-days\"\n style={sx({ display: 'grid', gridTemplateColumns: 'repeat(7,1fr)', gap: 'var(--space-1)' })}\n >\n {cells.map((d, i) => {\n // Blank cells still take the row height so the 6-row grid can't collapse.\n if (d === null) return <span key={i} aria-hidden style={cellSizing} />;\n const off = unavailable.includes(d);\n const sel = selectedDate === d && viewIndex === selectionIndex;\n const extra = renderDay?.(d);\n return (\n <button\n key={i}\n type=\"button\"\n data-day={d}\n // Not the native `disabled` - an unavailable day stays a real,\n // focusable stop on the roving cursor (aria-disabled only) so\n // arrow-key navigation can still land on it and the user can\n // tell it exists, matching the WAI-ARIA date-grid pattern. A\n // truly `disabled` button can't receive focus at all, which\n // would make the roving tabindex below silently break.\n aria-disabled={off || undefined}\n tabIndex={d === rovingDay ? 0 : -1}\n aria-pressed={sel}\n onClick={() => {\n if (off) return;\n setSelectionIndex(viewIndex);\n // Keep the roving cursor in sync with a mouse pick too - a\n // click already moves real DOM focus onto this button\n // natively, so without this the *next* arrow press would\n // jump from wherever the keyboard cursor was left instead\n // of from the day the user can see is focused/selected.\n setActiveDay(d);\n onSelectDate?.(d);\n }}\n style={sx({\n ...cellSizing,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 1,\n borderRadius: 'var(--radius-sm)',\n border: 'none',\n padding: 0,\n cursor: off ? 'not-allowed' : 'pointer',\n background: sel ? 'var(--interactive-primary)' : 'transparent',\n color: sel ? 'var(--interactive-primary-fg)' : off ? 'var(--text-disabled)' : 'var(--text-primary)',\n fontFamily: 'var(--font-body)',\n fontSize: 'var(--text-sm)',\n fontWeight: sel ? 'var(--weight-bold)' : 'var(--weight-medium)',\n textDecoration: off ? 'line-through' : 'none',\n transition: 'var(--transition-control)',\n // Not inline outline:none - that would always beat the\n // .sereno-dtp-days:focus-visible rule below no matter what\n // it says (inline style always outranks a class selector).\n // Suppressed as a class rule instead, same specificity as\n // the :focus-visible override that re-enables it.\n })}\n >\n <span>{d}</span>\n {renderDay ? <span style={sx({ display: 'flex', minHeight: 12, lineHeight: 1 })}>{extra}</span> : null}\n </button>\n );\n })}\n </div>\n </div>\n );\n}\n"],"mappings":";AAiRU,cAGF,YAHE;AA/QV,YAAY,WAAW;AACvB,SAAS,aAAa,aAAa,oBAAoB;AACvD,SAAS,UAAU;AACnB,SAAS,kBAAkB;AA6C3B,MAAM,OAAO;AAAA,EACX,SAAS;AAAA,IACP,KAAK,CAAC,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,GAAG;AAAA,IACvC,QAAQ,CAAC,WAAW,aAAa,YAAS,SAAS,QAAQ,SAAS,SAAS,UAAU,YAAY,WAAW,YAAY,UAAU;AAAA,IACpI,aAAa,CAAC,OAAO,OAAO,OAAO,OAAO,OAAO,OAAO,OAAO,OAAO,OAAO,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M,yBAAyB;AAAA,gBAC9E,YAAY;AAAA,gBACZ,UAAU;AAAA,gBACV,YAAY,MAAM,uBAAuB;AAAA,gBACzC,gBAAgB,MAAM,iBAAiB;AAAA,gBACvC,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAMd,CAAC;AAAA,cAED;AAAA,oCAAC,UAAM,aAAE;AAAA,gBACR,YAAY,oBAAC,UAAK,OAAO,GAAG,EAAE,SAAS,QAAQ,WAAW,IAAI,YAAY,EAAE,CAAC,GAAI,iBAAM,IAAU;AAAA;AAAA;AAAA,YAjD7F;AAAA,UAkDP;AAAA,QAEJ,CAAC;AAAA;AAAA,MAlEI;AAAA,IAmEP;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -4,9 +4,9 @@ type FieldBoxSize = 'sm' | 'md' | 'lg';
|
|
|
4
4
|
declare const CONTROL_HEIGHT: Record<FieldBoxSize, string>;
|
|
5
5
|
/**
|
|
6
6
|
* The bordered field-box chrome shared by any control whose trigger looks
|
|
7
|
-
* like a text field but opens something else on click
|
|
7
|
+
* like a text field but opens something else on click - `Select`'s
|
|
8
8
|
* `<button role="combobox">`, `DatePicker`'s calendar trigger (SS-243).
|
|
9
|
-
* Not for `Input`/`Textarea` themselves
|
|
9
|
+
* Not for `Input`/`Textarea` themselves - those style their own `<input>`/
|
|
10
10
|
* `<textarea>` directly, with no separate "trigger vs. panel" split.
|
|
11
11
|
*/
|
|
12
12
|
declare function fieldBoxStyle(size: FieldBoxSize, error: boolean, open: boolean, disabled: boolean): CSSProperties;
|
|
@@ -12,8 +12,8 @@ function fieldBoxStyle(size, error, open, disabled) {
|
|
|
12
12
|
gap: "var(--space-2)",
|
|
13
13
|
width: "100%",
|
|
14
14
|
height: CONTROL_HEIGHT[size],
|
|
15
|
-
// Longhand (not the `padding` shorthand) so callers can override one side
|
|
16
|
-
//
|
|
15
|
+
// Longhand (not the `padding` shorthand) so callers can override one side,
|
|
16
|
+
// e.g. NativeSelect's right pad - without React leaving the others blank.
|
|
17
17
|
paddingTop: 0,
|
|
18
18
|
paddingRight: "var(--space-3)",
|
|
19
19
|
paddingBottom: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/forms/_internal/fieldBoxStyle.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport { sx } from '../../_internal/style';\n\nexport type FieldBoxSize = 'sm' | 'md' | 'lg';\n\nexport const CONTROL_HEIGHT: Record<FieldBoxSize, string> = {\n sm: 'var(--control-height-sm)',\n md: 'var(--control-height-md)',\n lg: 'var(--control-height-lg)',\n};\n\n/**\n * The bordered field-box chrome shared by any control whose trigger looks\n * like a text field but opens something else on click
|
|
1
|
+
{"version":3,"sources":["../../../src/forms/_internal/fieldBoxStyle.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport { sx } from '../../_internal/style';\n\nexport type FieldBoxSize = 'sm' | 'md' | 'lg';\n\nexport const CONTROL_HEIGHT: Record<FieldBoxSize, string> = {\n sm: 'var(--control-height-sm)',\n md: 'var(--control-height-md)',\n lg: 'var(--control-height-lg)',\n};\n\n/**\n * The bordered field-box chrome shared by any control whose trigger looks\n * like a text field but opens something else on click - `Select`'s\n * `<button role=\"combobox\">`, `DatePicker`'s calendar trigger (SS-243).\n * Not for `Input`/`Textarea` themselves - those style their own `<input>`/\n * `<textarea>` directly, with no separate \"trigger vs. panel\" split.\n */\nexport function fieldBoxStyle(size: FieldBoxSize, error: boolean, open: boolean, disabled: boolean): CSSProperties {\n const active = open && !error;\n return sx({\n display: 'flex',\n alignItems: 'center',\n gap: 'var(--space-2)',\n width: '100%',\n height: CONTROL_HEIGHT[size],\n // Longhand (not the `padding` shorthand) so callers can override one side,\n // e.g. NativeSelect's right pad - without React leaving the others blank.\n paddingTop: 0,\n paddingRight: 'var(--space-3)',\n paddingBottom: 0,\n paddingLeft: 'var(--space-3)',\n borderRadius: 'var(--radius-control)',\n background: disabled ? 'var(--interactive-disabled-bg)' : 'var(--bg-surface)',\n border: 'var(--border-width-hairline) solid ' + (error ? 'var(--interactive-error)' : open ? 'var(--border-focus)' : 'var(--border-default)'),\n boxShadow: active ? 'var(--focus-ring)' : 'none',\n fontFamily: 'var(--font-body)',\n fontSize: size === 'sm' ? 'var(--text-sm)' : 'var(--text-base)',\n color: disabled ? 'var(--text-disabled)' : 'var(--text-primary)',\n cursor: disabled ? 'not-allowed' : 'pointer',\n transition: 'var(--transition-control)',\n textAlign: 'left',\n });\n}\n"],"mappings":"AACA,SAAS,UAAU;AAIZ,MAAM,iBAA+C;AAAA,EAC1D,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AASO,SAAS,cAAc,MAAoB,OAAgB,MAAe,UAAkC;AACjH,QAAM,SAAS,QAAQ,CAAC;AACxB,SAAO,GAAG;AAAA,IACR,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,KAAK;AAAA,IACL,OAAO;AAAA,IACP,QAAQ,eAAe,IAAI;AAAA;AAAA;AAAA,IAG3B,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,eAAe;AAAA,IACf,aAAa;AAAA,IACb,cAAc;AAAA,IACd,YAAY,WAAW,mCAAmC;AAAA,IAC1D,QAAQ,yCAAyC,QAAQ,6BAA6B,OAAO,wBAAwB;AAAA,IACrH,WAAW,SAAS,sBAAsB;AAAA,IAC1C,YAAY;AAAA,IACZ,UAAU,SAAS,OAAO,mBAAmB;AAAA,IAC7C,OAAO,WAAW,yBAAyB;AAAA,IAC3C,QAAQ,WAAW,gBAAgB;AAAA,IACnC,YAAY;AAAA,IACZ,WAAW;AAAA,EACb,CAAC;AACH;","names":[]}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Sereno Design System
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Sereno Design System - public component surface. See the /design-system\n// showcase for the live catalog, or the barrel smoke test for the full list.\n// Icons are passed in as props (lucide-react), never imported here; theming is\n// 100% CSS custom properties.\n\n// core\nexport { Typography, type TypographyProps, type TypographyVariant, type TypographyColor } from './core/Typography';\nexport { Button, type ButtonProps } from './core/Button';\nexport { IconButton, type IconButtonProps } from './core/IconButton';\nexport { Badge, type BadgeProps } from './core/Badge';\nexport { Card, type CardProps } from './core/Card';\nexport { Avatar, type AvatarProps } from './core/Avatar';\nexport { Brand, type BrandProps } from './core/Brand';\nexport { Menu, type MenuProps, type MenuItem, type MenuEntry, type MenuSeparator, type MenuHeading } from './core/Menu';\nexport {\n Table,\n type TableProps,\n type TableRowProps,\n type HeaderCellProps,\n type CellProps,\n type TableSort,\n type SortDirection,\n} from './core/Table';\n\n// forms\nexport { Input, type InputProps } from './forms/Input';\nexport { Textarea, type TextareaProps } from './forms/Textarea';\nexport { Select, type SelectProps, type SelectOption } from './forms/Select';\nexport { Checkbox, type CheckboxProps } from './forms/Checkbox';\nexport { Radio, type RadioProps } from './forms/Radio';\nexport { Switch, type SwitchProps } from './forms/Switch';\nexport { DateTimePicker, type DateTimePickerProps, type TimeSlot } from './forms/DateTimePicker';\nexport { DatePicker, type DatePickerProps, type DatePickerHandle } from './forms/DatePicker';\nexport { FileUpload, type FileUploadProps } from './forms/FileUpload';\nexport { AvatarUpload, type AvatarUploadProps } from './forms/AvatarUpload';\nexport { SearchInput, type SearchInputProps } from './forms/SearchInput';\n\n// navigation\nexport { TopBar, type TopBarProps, type TopBarLeadingProps, type TopBarTitleProps, type TopBarActionsProps } from './navigation/TopBar';\nexport { Tabs, type TabsProps, type TabsListProps, type TabsTabProps, type TabsPanelProps } from './navigation/Tabs';\nexport { BottomNav, type BottomNavProps, type BottomNavItemProps } from './navigation/BottomNav';\nexport {\n SidebarNav,\n type SidebarNavProps,\n type SidebarNavSectionProps,\n type SidebarNavItemProps,\n type SidebarNavSubItemProps,\n} from './navigation/SidebarNav';\nexport { Stepper, type StepperProps, type StepperStepProps } from './navigation/Stepper';\nexport { Pagination, type PaginationProps, type PaginationLabels } from './navigation/Pagination';\n\n// feedback\nexport { Alert, type AlertProps } from './feedback/Alert';\nexport { Toast, type ToastProps } from './feedback/Toast';\nexport {\n ToastProvider,\n useToast,\n type ToastProviderProps,\n type ToastOptions,\n type ToastApi,\n type ToastContextValue,\n type ToastPosition,\n} from './feedback/ToastProvider';\nexport { Dialog, type DialogProps, type DialogHeaderProps, type DialogBodyProps, type DialogFooterProps } from './feedback/Dialog';\nexport { Skeleton, type SkeletonProps } from './feedback/Skeleton';\nexport { EmptyState, type EmptyStateProps } from './feedback/EmptyState';\n\n// theme - the `data-theme` provider (next-themes) + the light/dark toggle\nexport { ThemeProvider } from './theme/ThemeProvider';\nexport { ThemeToggle } from './theme/ThemeToggle';\n"],"mappings":"AAMA,SAAS,kBAAsF;AAC/F,SAAS,cAAgC;AACzC,SAAS,kBAAwC;AACjD,SAAS,aAA8B;AACvC,SAAS,YAA4B;AACrC,SAAS,cAAgC;AACzC,SAAS,aAA8B;AACvC,SAAS,YAAiG;AAC1G;AAAA,EACE;AAAA,OAOK;AAGP,SAAS,aAA8B;AACvC,SAAS,gBAAoC;AAC7C,SAAS,cAAmD;AAC5D,SAAS,gBAAoC;AAC7C,SAAS,aAA8B;AACvC,SAAS,cAAgC;AACzC,SAAS,sBAA+D;AACxE,SAAS,kBAA+D;AACxE,SAAS,kBAAwC;AACjD,SAAS,oBAA4C;AACrD,SAAS,mBAA0C;AAGnD,SAAS,cAAyG;AAClH,SAAS,YAAwF;AACjG,SAAS,iBAA+D;AACxE;AAAA,EACE;AAAA,OAKK;AACP,SAAS,eAAyD;AAClE,SAAS,kBAA+D;AAGxE,SAAS,aAA8B;AACvC,SAAS,aAA8B;AACvC;AAAA,EACE;AAAA,EACA;AAAA,OAMK;AACP,SAAS,cAAsG;AAC/G,SAAS,gBAAoC;AAC7C,SAAS,kBAAwC;AAGjD,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;","names":[]}
|
|
@@ -47,7 +47,7 @@ function Item({ value, label, icon, badge }) {
|
|
|
47
47
|
border: "none",
|
|
48
48
|
background: "transparent",
|
|
49
49
|
cursor: "pointer",
|
|
50
|
-
// Not inline outline:none
|
|
50
|
+
// Not inline outline:none - see .sereno-bottom-nav-item in styles.css.
|
|
51
51
|
position: "relative",
|
|
52
52
|
color: active ? "var(--text-brand)" : "var(--text-muted)",
|
|
53
53
|
transition: "var(--transition-control)"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/navigation/BottomNav.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { sx } from '../_internal/style';\n\n/**\n * Mobile primary navigation
|
|
1
|
+
{"version":3,"sources":["../../src/navigation/BottomNav.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { sx } from '../_internal/style';\n\n/**\n * Mobile primary navigation - a **compound component**. 3 to 5 destinations,\n * 64px tall, translucent blurred surface.\n *\n * ```tsx\n * <BottomNav value={tab} onChange={setTab}>\n * <BottomNav.Item value=\"agenda\" label=\"Calendar\" icon={<Calendar size={22} />} />\n * <BottomNav.Item value=\"clients\" label=\"Clients\" icon={<Users size={22} />} badge />\n * </BottomNav>\n * ```\n */\nexport interface BottomNavProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> {\n value?: string;\n onChange?: (value: string) => void;\n children: React.ReactNode;\n}\n\nexport interface BottomNavItemProps {\n value: string;\n label: string;\n icon?: React.ReactNode;\n badge?: boolean;\n}\n\ninterface BottomNavContextValue {\n value?: string;\n onChange?: (value: string) => void;\n}\n\nconst BottomNavContext = React.createContext<BottomNavContextValue | null>(null);\n\nfunction useBottomNavContext(component: string): BottomNavContextValue {\n const ctx = React.useContext(BottomNavContext);\n if (!ctx) throw new Error(`<BottomNav.${component}> must be rendered inside <BottomNav>.`);\n return ctx;\n}\n\nfunction BottomNavRoot({ value, onChange, children, style, ...rest }: BottomNavProps) {\n const ctx: BottomNavContextValue = { value, onChange };\n return (\n <BottomNavContext.Provider value={ctx}>\n <nav\n {...rest}\n style={sx({\n display: 'flex',\n alignItems: 'stretch',\n height: 'var(--bottom-nav-height)',\n background: 'color-mix(in srgb,var(--bg-surface) 88%,transparent)',\n backdropFilter: 'blur(12px)',\n borderTop: 'var(--border-width-hairline) solid var(--border-default)',\n ...style,\n })}\n >\n {children}\n </nav>\n </BottomNavContext.Provider>\n );\n}\n\nfunction Item({ value, label, icon, badge }: BottomNavItemProps) {\n const { value: activeValue, onChange } = useBottomNavContext('Item');\n const active = activeValue === value;\n return (\n <button\n type=\"button\"\n aria-current={active ? 'page' : undefined}\n onClick={() => onChange?.(value)}\n className=\"sereno-bottom-nav-item\"\n style={sx({\n flex: 1,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 4,\n border: 'none',\n background: 'transparent',\n cursor: 'pointer',\n // Not inline outline:none - see .sereno-bottom-nav-item in styles.css.\n position: 'relative',\n color: active ? 'var(--text-brand)' : 'var(--text-muted)',\n transition: 'var(--transition-control)',\n })}\n >\n <span style={sx({ display: 'flex', position: 'relative' })}>\n {icon}\n {badge && (\n <span\n style={sx({ position: 'absolute', top: -3, right: -5, minWidth: 8, height: 8, borderRadius: '999px', background: 'var(--interactive-accent)' })}\n />\n )}\n </span>\n <span\n style={sx({\n fontFamily: 'var(--font-body)',\n fontSize: 'var(--text-2xs)',\n fontWeight: active ? 'var(--weight-semibold)' : 'var(--weight-medium)',\n letterSpacing: 'var(--tracking-snug)',\n })}\n >\n {label}\n </span>\n </button>\n );\n}\n\nexport const BottomNav = Object.assign(BottomNavRoot, { Item });\n"],"mappings":";AA8CM,cA2CA,YA3CA;AA5CN,YAAY,WAAW;AACvB,SAAS,UAAU;AA+BnB,MAAM,mBAAmB,MAAM,cAA4C,IAAI;AAE/E,SAAS,oBAAoB,WAA0C;AACrE,QAAM,MAAM,MAAM,WAAW,gBAAgB;AAC7C,MAAI,CAAC,IAAK,OAAM,IAAI,MAAM,cAAc,SAAS,wCAAwC;AACzF,SAAO;AACT;AAEA,SAAS,cAAc,E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;AAAA,YACC,OAAO,GAAG;AAAA,cACR,YAAY;AAAA,cACZ,UAAU;AAAA,cACV,YAAY,SAAS,2BAA2B;AAAA,cAChD,eAAe;AAAA,YACjB,CAAC;AAAA,YAEA;AAAA;AAAA,QACH;AAAA;AAAA;AAAA,EACF;AAEJ;AAEO,MAAM,YAAY,OAAO,OAAO,eAAe,EAAE,KAAK,CAAC;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Desktop primary navigation
|
|
4
|
+
* Desktop primary navigation - a **compound component**, the counterpart to
|
|
5
5
|
* `BottomNav`. Grouped sections with dividers, an optional second level per
|
|
6
6
|
* item, and a collapse toggle that drops it to a 72px icon rail.
|
|
7
7
|
*
|
|
@@ -17,7 +17,7 @@ import * as React from 'react';
|
|
|
17
17
|
* </SidebarNav>
|
|
18
18
|
* ```
|
|
19
19
|
*
|
|
20
|
-
* `Item` is not a destination once it has `SubItem` children
|
|
20
|
+
* `Item` is not a destination once it has `SubItem` children - it toggles
|
|
21
21
|
* them instead (an inline accordion when expanded, a hover flyout on the
|
|
22
22
|
* collapsed rail).
|
|
23
23
|
*/
|
|
@@ -41,7 +41,7 @@ interface SidebarNavProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onCha
|
|
|
41
41
|
/** Component used to render items that carry `href` (e.g. Next's `Link`). Defaults to `'a'`. */
|
|
42
42
|
linkComponent?: React.ElementType;
|
|
43
43
|
/**
|
|
44
|
-
* Disables every `Item` / `SubItem` at once
|
|
44
|
+
* Disables every `Item` / `SubItem` at once - a gated area, an account that
|
|
45
45
|
* isn't active yet. An item can still opt back in with its own
|
|
46
46
|
* `disabled={false}` (e.g. a "Help" link that must stay reachable). Only the
|
|
47
47
|
* destinations are affected: the collapse toggle, `header` and `footer` stay
|
|
@@ -51,25 +51,25 @@ interface SidebarNavProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onCha
|
|
|
51
51
|
children: React.ReactNode;
|
|
52
52
|
}
|
|
53
53
|
interface SidebarNavSectionProps {
|
|
54
|
-
/** Small uppercase heading above the block. Omit for an unlabelled group
|
|
54
|
+
/** Small uppercase heading above the block. Omit for an unlabelled group - the divider still shows. */
|
|
55
55
|
label?: string;
|
|
56
56
|
children: React.ReactNode;
|
|
57
57
|
}
|
|
58
58
|
interface SidebarNavItemProps {
|
|
59
59
|
value: string;
|
|
60
60
|
label: string;
|
|
61
|
-
/** A Lucide icon passed as a node
|
|
61
|
+
/** A Lucide icon passed as a node - sized by the caller. */
|
|
62
62
|
icon?: React.ReactNode;
|
|
63
63
|
count?: number;
|
|
64
64
|
/** Render this leaf as a real link (routing, new-tab, SSR-active) via `linkComponent`. Ignored while `disabled`. */
|
|
65
65
|
href?: string;
|
|
66
66
|
/**
|
|
67
|
-
* Not selectable
|
|
67
|
+
* Not selectable - e.g. a feature locked behind a higher plan. Inherits the
|
|
68
68
|
* root's `disabled` when unset; an explicit `false` opts back in under a
|
|
69
69
|
* disabled root.
|
|
70
70
|
*
|
|
71
71
|
* `aria-disabled` (not the native attribute), so the row is still in the
|
|
72
|
-
* accessibility tree and a screen reader finds it
|
|
72
|
+
* accessibility tree and a screen reader finds it - but it leaves the Tab
|
|
73
73
|
* order (a locked area shouldn't cost a dead tab stop per item), a click
|
|
74
74
|
* never fires `onChange`, `href` never navigates (it renders as a `<button>`,
|
|
75
75
|
* never a link), and a parent `Item` doesn't toggle its accordion or open its
|
|
@@ -77,7 +77,7 @@ interface SidebarNavItemProps {
|
|
|
77
77
|
* `aria-current` and the active look, just muted.
|
|
78
78
|
*/
|
|
79
79
|
disabled?: boolean;
|
|
80
|
-
/** `SidebarNav.SubItem`s
|
|
80
|
+
/** `SidebarNav.SubItem`s - a second level. Present ⇒ this item is not a destination itself, it toggles them. */
|
|
81
81
|
children?: React.ReactNode;
|
|
82
82
|
}
|
|
83
83
|
interface SidebarNavSubItemProps {
|
|
@@ -86,7 +86,7 @@ interface SidebarNavSubItemProps {
|
|
|
86
86
|
count?: number;
|
|
87
87
|
/** Not selectable. Inherits from its parent `Item` (which inherits the root); an explicit value wins. Same contract as `SidebarNav.Item`'s `disabled`. */
|
|
88
88
|
disabled?: boolean;
|
|
89
|
-
/** Set by the parent `Item` when rendering this into the collapsed rail's flyout popover
|
|
89
|
+
/** Set by the parent `Item` when rendering this into the collapsed rail's flyout popover - not for consumers to pass. */
|
|
90
90
|
compact?: boolean;
|
|
91
91
|
}
|
|
92
92
|
declare function SidebarNavRoot({ value, onChange, collapsed: collapsedProp, defaultCollapsed, onCollapsedChange, collapsible, header, footer, labels, linkComponent, disabled, children, style, ...rest }: SidebarNavProps): React.JSX.Element;
|
|
@@ -366,7 +366,7 @@ function Item({ value, label, icon, count, href, disabled: disabledProp, childre
|
|
|
366
366
|
if (railFlyout) closeFlyoutSoon();
|
|
367
367
|
else hideTip();
|
|
368
368
|
},
|
|
369
|
-
// Keyboard parity with hover
|
|
369
|
+
// Keyboard parity with hover - on the rail a Tab stop is otherwise just an unlabelled icon.
|
|
370
370
|
onFocus: (e) => {
|
|
371
371
|
st.handlers.onFocus?.(e);
|
|
372
372
|
if (isKeyboardFocus(e.currentTarget)) showLabelTip(e.currentTarget, labelRef.current, label, showTip);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/navigation/SidebarNav.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { ChevronDown, ChevronLeft } from 'lucide-react';\nimport { sx } from '../_internal/style';\nimport { useInteract } from '../core/Button';\n\n/**\n * Desktop primary navigation — a **compound component**, the counterpart to\n * `BottomNav`. Grouped sections with dividers, an optional second level per\n * item, and a collapse toggle that drops it to a 72px icon rail.\n *\n * ```tsx\n * <SidebarNav value={view} onChange={setView} header={<Wordmark />}>\n * <SidebarNav.Section label=\"Workspace\">\n * <SidebarNav.Item value=\"agenda\" label=\"Calendar\" icon={<Calendar size={18} />} />\n * <SidebarNav.Item value=\"finance\" label=\"Finance\" icon={<Wallet size={18} />}>\n * <SidebarNav.SubItem value=\"finance:incoming\" label=\"Incoming\" />\n * <SidebarNav.SubItem value=\"finance:payouts\" label=\"Payouts\" count={3} />\n * </SidebarNav.Item>\n * </SidebarNav.Section>\n * </SidebarNav>\n * ```\n *\n * `Item` is not a destination once it has `SubItem` children — it toggles\n * them instead (an inline accordion when expanded, a hover flyout on the\n * collapsed rail).\n */\nexport interface SidebarNavProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> {\n value?: string;\n onChange?: (value: string) => void;\n /** Controlled collapse (icon-only rail). */\n collapsed?: boolean;\n defaultCollapsed?: boolean;\n onCollapsedChange?: (collapsed: boolean) => void;\n /** Show the collapse toggle in the footer. */\n collapsible?: boolean;\n /** Brand / logo slot at the top. */\n header?: React.ReactNode;\n /** Persistent slot pinned to the bottom (user card, plan nudge). Hidden while collapsed. */\n footer?: React.ReactNode;\n labels?: { expand?: string; collapse?: string };\n /** Component used to render items that carry `href` (e.g. Next's `Link`). Defaults to `'a'`. */\n linkComponent?: React.ElementType;\n /**\n * Disables every `Item` / `SubItem` at once — a gated area, an account that\n * isn't active yet. An item can still opt back in with its own\n * `disabled={false}` (e.g. a \"Help\" link that must stay reachable). Only the\n * destinations are affected: the collapse toggle, `header` and `footer` stay\n * live, since they aren't navigation.\n */\n disabled?: boolean;\n children: React.ReactNode;\n}\n\nexport interface SidebarNavSectionProps {\n /** Small uppercase heading above the block. Omit for an unlabelled group — the divider still shows. */\n label?: string;\n children: React.ReactNode;\n}\n\nexport interface SidebarNavItemProps {\n value: string;\n label: string;\n /** A Lucide icon passed as a node — sized by the caller. */\n icon?: React.ReactNode;\n count?: number;\n /** Render this leaf as a real link (routing, new-tab, SSR-active) via `linkComponent`. Ignored while `disabled`. */\n href?: string;\n /**\n * Not selectable — e.g. a feature locked behind a higher plan. Inherits the\n * root's `disabled` when unset; an explicit `false` opts back in under a\n * disabled root.\n *\n * `aria-disabled` (not the native attribute), so the row is still in the\n * accessibility tree and a screen reader finds it — but it leaves the Tab\n * order (a locked area shouldn't cost a dead tab stop per item), a click\n * never fires `onChange`, `href` never navigates (it renders as a `<button>`,\n * never a link), and a parent `Item` doesn't toggle its accordion or open its\n * rail flyout. It can still be the current page: `value` pointing at it keeps\n * `aria-current` and the active look, just muted.\n */\n disabled?: boolean;\n /** `SidebarNav.SubItem`s — a second level. Present ⇒ this item is not a destination itself, it toggles them. */\n children?: React.ReactNode;\n}\n\nexport interface SidebarNavSubItemProps {\n value: string;\n label: string;\n count?: number;\n /** Not selectable. Inherits from its parent `Item` (which inherits the root); an explicit value wins. Same contract as `SidebarNav.Item`'s `disabled`. */\n disabled?: boolean;\n /** Set by the parent `Item` when rendering this into the collapsed rail's flyout popover — not for consumers to pass. */\n compact?: boolean;\n}\n\ninterface SidebarNavContextValue {\n value?: string;\n /** The root's `disabled` — what an `Item` falls back to when it doesn't set its own. */\n disabled: boolean;\n /** Closes any open flyout, then calls the root's `onChange`. What `Item` / `SubItem` call on click. */\n select: (value: string) => void;\n collapsed: boolean;\n linkComponent?: React.ElementType;\n /** Which item's collapsed-rail flyout is open, if any — single, cross-item (opening one closes another). */\n flyoutValue: string | null;\n openFlyout: (value: string) => void;\n closeFlyoutSoon: () => void;\n closeFlyoutNow: () => void;\n showTip: (label: string, rect: DOMRect) => void;\n hideTip: () => void;\n}\n\nconst EXPANDED = 248;\nconst COLLAPSED = 72;\n\nconst groupHead = sx({\n fontFamily: 'var(--font-body)',\n fontSize: 'var(--text-2xs)',\n fontWeight: 'var(--weight-bold)',\n letterSpacing: '0.09em',\n textTransform: 'uppercase',\n color: 'var(--text-disabled)',\n // No top padding: the section's own top gap is the section break; this hugs its items.\n padding: '0 var(--space-3) var(--space-2)',\n});\n\nconst countPill = (active: boolean, disabled = false) =>\n sx({\n marginLeft: 'auto',\n flex: '0 0 auto',\n fontSize: 'var(--text-2xs)',\n fontWeight: 'var(--weight-bold)',\n lineHeight: 1,\n padding: '2px 6px',\n borderRadius: '999px',\n // A bordered chip so it stays legible over the row's hover / active fill.\n background: 'var(--bg-surface)',\n color: disabled ? 'var(--text-disabled)' : active ? 'var(--text-brand)' : 'var(--text-muted)',\n boxShadow: 'inset 0 0 0 1px ' + (disabled ? 'var(--border-subtle)' : active ? 'var(--border-brand)' : 'var(--border-default)'),\n });\n\nconst SidebarNavContext = React.createContext<SidebarNavContextValue | null>(null);\n\n/** An `Item`'s effective `disabled`, handed to its `SubItem`s so they inherit from their parent (which itself inherited the root's). */\nconst ParentDisabledContext = React.createContext<boolean | undefined>(undefined);\n\nfunction useSidebarNavContext(component: string): SidebarNavContextValue {\n const ctx = React.useContext(SidebarNavContext);\n if (!ctx) throw new Error(`<SidebarNav.${component}> must be rendered inside <SidebarNav>.`);\n return ctx;\n}\n\n/** The `value`s of a node's `SidebarNav.SubItem` children — used for \"does this branch hold the active leaf\". */\nfunction childValuesOf(children: React.ReactNode): string[] {\n const out: string[] = [];\n React.Children.forEach(children, (child) => {\n if (React.isValidElement<{ value?: unknown }>(child) && typeof child.props.value === 'string') out.push(child.props.value);\n });\n return out;\n}\n\n/**\n * Shows `label` as a tooltip beside `row`. On the icon-only rail every label is\n * hidden (`labelEl` is null), so it always shows; expanded, only when the\n * ellipsis is actually cutting the text off — a short label gets no redundant tooltip.\n */\nfunction showLabelTip(row: HTMLElement, labelEl: HTMLElement | null, label: string, showTip: SidebarNavContextValue['showTip']) {\n if (labelEl && labelEl.scrollWidth <= labelEl.clientWidth) return;\n showTip(label, row.getBoundingClientRect());\n}\n\n/** Keyboard focus only — a mouse click focuses the row too, but the pointer is already showing (or has dismissed) the tip. */\nfunction isKeyboardFocus(el: HTMLElement): boolean {\n try {\n return el.matches(':focus-visible');\n } catch {\n return false;\n }\n}\n\nfunction SidebarNavRoot({\n value,\n onChange,\n collapsed: collapsedProp,\n defaultCollapsed = false,\n onCollapsedChange,\n collapsible = true,\n header,\n footer,\n labels,\n linkComponent,\n disabled = false,\n children,\n style,\n ...rest\n}: SidebarNavProps) {\n const [internalCollapsed, setInternalCollapsed] = React.useState(defaultCollapsed);\n const collapsed = collapsedProp ?? internalCollapsed;\n const setCollapsed = (c: boolean) => {\n if (collapsedProp === undefined) setInternalCollapsed(c);\n onCollapsedChange?.(c);\n };\n\n // Custom hover tooltip for the collapsed rail — portalled so the rail's own\n // overflow clipping can't hide it.\n const [mounted, setMounted] = React.useState(false);\n // eslint-disable-next-line react-hooks/set-state-in-effect -- portal target is client-only\n React.useEffect(() => setMounted(true), []);\n const [tip, setTip] = React.useState<{ label: string; top: number; left: number } | null>(null);\n React.useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect -- drop a stale tip when the rail expands\n if (!collapsed) setTip(null);\n }, [collapsed]);\n const showTip = (label: string, r: DOMRect) => setTip({ label, top: r.top + r.height / 2, left: r.right + 10 });\n const hideTip = () => setTip(null);\n\n // Single cross-item flyout for the collapsed rail (only one open at a time).\n const [flyoutValue, setFlyoutValue] = React.useState<string | null>(null);\n const flyoutTimer = React.useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const openFlyout = (v: string) => {\n clearTimeout(flyoutTimer.current);\n setFlyoutValue(v);\n };\n const closeFlyoutSoon = () => {\n clearTimeout(flyoutTimer.current);\n flyoutTimer.current = setTimeout(() => setFlyoutValue(null), 140);\n };\n const closeFlyoutNow = () => {\n clearTimeout(flyoutTimer.current);\n setFlyoutValue(null);\n };\n React.useEffect(() => () => clearTimeout(flyoutTimer.current), []);\n React.useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect -- drop a stale flyout when the rail expands\n if (!collapsed) setFlyoutValue(null);\n }, [collapsed]);\n\n const select = (v: string) => {\n closeFlyoutNow();\n onChange?.(v);\n };\n\n const ctx: SidebarNavContextValue = { value, disabled, select, collapsed, linkComponent, flyoutValue, openFlyout, closeFlyoutSoon, closeFlyoutNow, showTip, hideTip };\n\n // The collapse control straddles the sidebar's right edge, level with the logo.\n const toggleLabel = collapsed ? labels?.expand ?? 'Expand' : labels?.collapse ?? 'Collapse';\n const toggleBtn = collapsible ? (\n <button\n type=\"button\"\n className=\"sereno-sidenav-btn sereno-sidenav-toggle\"\n aria-label={toggleLabel}\n aria-pressed={collapsed}\n title={toggleLabel}\n onClick={() => setCollapsed(!collapsed)}\n style={sx({\n position: 'absolute',\n top: 'calc(var(--sidenav-header-h, 56px) / 2)',\n right: -13,\n transform: 'translateY(-50%)',\n zIndex: 5,\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 26,\n height: 26,\n borderRadius: '999px',\n border: 'var(--border-width-hairline) solid var(--border-default)',\n background: 'var(--bg-surface)',\n color: 'var(--text-secondary)',\n boxShadow: 'var(--shadow-sm)',\n cursor: 'pointer',\n transition: 'var(--transition-control)',\n })}\n >\n <ChevronLeft\n size={15}\n strokeWidth={2}\n style={{ transition: 'transform var(--duration-normal) var(--ease-out)', transform: collapsed ? 'rotate(180deg)' : 'none' }}\n />\n </button>\n ) : null;\n\n return (\n <SidebarNavContext.Provider value={ctx}>\n <nav\n {...rest}\n className={['sereno-sidenav-root', rest.className].filter(Boolean).join(' ')}\n data-collapsed={collapsed ? '' : undefined}\n style={sx({\n position: 'relative',\n display: 'flex',\n flexDirection: 'column',\n flex: '0 0 auto',\n width: collapsed ? COLLAPSED : EXPANDED,\n height: '100%',\n background: 'var(--bg-surface)',\n borderRight: 'var(--border-width-hairline) solid var(--border-default)',\n transition: 'width var(--duration-normal) var(--ease-out)',\n ...style,\n })}\n >\n {toggleBtn}\n\n {header !== undefined && (\n <div\n style={sx({\n flex: '0 0 auto',\n display: 'flex',\n alignItems: 'center',\n justifyContent: collapsed ? 'center' : 'flex-start',\n height: 'var(--sidenav-header-h, 56px)',\n padding: collapsed ? '0' : '0 var(--space-4)',\n })}\n >\n <div style={sx({ minWidth: 0, overflow: 'hidden', display: 'flex', alignItems: 'center' })}>{header}</div>\n </div>\n )}\n\n <div\n className=\"sereno-sidenav\"\n style={sx({\n flex: 1,\n overflowY: 'auto',\n overflowX: 'hidden',\n padding: 'var(--space-2) var(--space-3)',\n display: 'flex',\n flexDirection: 'column',\n })}\n >\n {children}\n </div>\n\n {footer && !collapsed && (\n <div\n style={sx({\n borderTop: 'var(--border-width-hairline) solid var(--border-subtle)',\n padding: 'var(--space-3)',\n display: 'flex',\n flexDirection: 'column',\n gap: 'var(--space-2)',\n })}\n >\n {footer}\n </div>\n )}\n\n {mounted &&\n tip &&\n createPortal(\n <div\n role=\"tooltip\"\n style={sx({\n position: 'fixed',\n top: tip.top,\n left: tip.left,\n transform: 'translateY(-50%)',\n padding: '5px 9px',\n borderRadius: 'var(--radius-sm)',\n background: 'var(--bg-inverse)',\n color: 'var(--text-inverse)',\n fontFamily: 'var(--font-body)',\n fontSize: 'var(--text-xs)',\n fontWeight: 'var(--weight-medium)',\n lineHeight: 1,\n whiteSpace: 'nowrap',\n boxShadow: 'var(--shadow-md)',\n pointerEvents: 'none',\n zIndex: 1000,\n animation: 'sereno-fade-in var(--duration-fast) var(--ease-out)',\n })}\n >\n <span\n aria-hidden\n style={sx({\n position: 'absolute',\n left: -3,\n top: '50%',\n width: 6,\n height: 6,\n background: 'var(--bg-inverse)',\n transform: 'translateY(-50%) rotate(45deg)',\n borderRadius: 1,\n })}\n />\n {tip.label}\n </div>,\n document.body,\n )}\n </nav>\n </SidebarNavContext.Provider>\n );\n}\n\nfunction Section({ label, children }: SidebarNavSectionProps) {\n const { collapsed } = useSidebarNavContext('Section');\n return (\n <div className=\"sereno-sidenav-section\" style={sx({ display: 'flex', flexDirection: 'column', gap: 2 })}>\n {label && !collapsed && <span style={groupHead}>{label}</span>}\n {children}\n </div>\n );\n}\n\nfunction Item({ value, label, icon, count, href, disabled: disabledProp, children }: SidebarNavItemProps) {\n const {\n value: activeValue,\n disabled: rootDisabled,\n select,\n collapsed,\n linkComponent,\n flyoutValue,\n openFlyout,\n closeFlyoutSoon,\n closeFlyoutNow,\n showTip,\n hideTip,\n } = useSidebarNavContext('Item');\n // Its own `disabled` wins — including an explicit `false` under a disabled root.\n const disabled = disabledProp ?? rootDisabled;\n const st = useInteract(disabled);\n const btnRef = React.useRef<HTMLButtonElement>(null);\n const labelRef = React.useRef<HTMLSpanElement>(null);\n const hasChildren = React.Children.count(children) > 0;\n const childVals = hasChildren ? childValuesOf(children) : [];\n // Still the current page while disabled (a locked area can be showing you where you are) — just muted.\n const selfActive = activeValue === value && !hasChildren;\n const childActive = hasChildren && childVals.includes(activeValue ?? '');\n const highlight = selfActive || (collapsed && childActive);\n // A disabled parent has nothing to open: no rail flyout (it falls back to the plain label tooltip).\n const railFlyout = collapsed && hasChildren && !disabled;\n // A disabled item is never a real link — `href` must not navigate.\n const asLink = !hasChildren && !!href && !!linkComponent && !disabled;\n const Link = linkComponent ?? 'a';\n\n // Expanded: an inline accordion, local per-item and seeded open once (on\n // mount) for the branch holding the active child — that seed still applies\n // while disabled, so the \"you are here\" branch stays visible (it just can't\n // be toggled). Collapsed: a hover flyout instead — that one is cross-item\n // (only one open at a time), so it lives in the root's flyoutValue, not\n // here, and a disabled parent never opens it.\n const [localOpen, setLocalOpen] = React.useState(() => childActive);\n const open = collapsed ? !disabled && flyoutValue === value : localOpen;\n\n const onToggle = () => {\n if (collapsed) {\n if (flyoutValue === value) closeFlyoutNow();\n else openFlyout(value);\n } else {\n setLocalOpen((o) => !o);\n }\n };\n\n const rowStyle = sx({\n position: 'relative',\n display: 'flex',\n alignItems: 'center',\n gap: 'var(--space-3)',\n width: '100%',\n height: 40,\n padding: collapsed ? 0 : '0 var(--space-3)',\n justifyContent: collapsed ? 'center' : 'flex-start',\n border: 'none',\n borderRadius: 'var(--radius-control)',\n cursor: disabled ? 'not-allowed' : 'pointer',\n textAlign: 'left',\n textDecoration: 'none',\n fontFamily: 'var(--font-body)',\n fontSize: 'var(--text-base)',\n fontWeight: highlight || childActive ? 'var(--weight-semibold)' : 'var(--weight-medium)',\n background: highlight ? 'var(--bg-brand-soft)' : open || st.hover ? 'var(--interactive-ghost-hover)' : 'transparent',\n color: disabled ? 'var(--text-disabled)' : highlight || childActive ? 'var(--text-brand)' : 'var(--text-secondary)',\n transition: 'var(--transition-control)',\n });\n\n const inner = (\n <>\n {icon && (\n <span style={sx({ flex: '0 0 auto', display: 'inline-flex', width: 20, height: 20, alignItems: 'center', justifyContent: 'center' })}>{icon}</span>\n )}\n {collapsed && !disabled && (count !== undefined || childActive) && (\n <span\n aria-hidden\n style={sx({\n position: 'absolute',\n top: 7,\n right: 12,\n width: 6,\n height: 6,\n borderRadius: '999px',\n background: 'var(--interactive-accent)',\n })}\n />\n )}\n {!collapsed && (\n <>\n <span ref={labelRef} style={sx({ flex: 1, minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' })}>\n {label}\n </span>\n {count !== undefined && <span style={countPill(highlight, disabled)}>{count}</span>}\n {hasChildren && (\n <ChevronDown\n size={16}\n strokeWidth={2}\n style={{ flex: '0 0 auto', transition: 'transform var(--duration-fast) var(--ease-standard)', transform: open ? 'rotate(180deg)' : 'none' }}\n />\n )}\n </>\n )}\n </>\n );\n\n const hoverHandlers = {\n ...st.handlers,\n onMouseEnter: (e: React.MouseEvent<HTMLElement>) => {\n st.handlers.onMouseEnter?.(e);\n if (railFlyout) openFlyout(value);\n else showLabelTip(e.currentTarget, labelRef.current, label, showTip);\n },\n onMouseLeave: (e: React.MouseEvent<HTMLElement>) => {\n st.handlers.onMouseLeave?.(e);\n if (railFlyout) closeFlyoutSoon();\n else hideTip();\n },\n // Keyboard parity with hover — on the rail a Tab stop is otherwise just an unlabelled icon.\n onFocus: (e: React.FocusEvent<HTMLElement>) => {\n st.handlers.onFocus?.(e);\n if (isKeyboardFocus(e.currentTarget)) showLabelTip(e.currentTarget, labelRef.current, label, showTip);\n },\n onBlur: (e: React.FocusEvent<HTMLElement>) => {\n st.handlers.onBlur?.(e);\n hideTip();\n },\n // Dismissible without moving the pointer or focus (WCAG 1.4.13).\n onKeyDown: (e: React.KeyboardEvent<HTMLElement>) => {\n if (e.key === 'Escape') hideTip();\n },\n };\n\n // The flyout popover reuses the same SubItem elements, just 2px shorter to\n // read as a compact menu rather than the accordion's own row height.\n const compactChildren = React.Children.map(children, (child) =>\n React.isValidElement<SidebarNavSubItemProps>(child) ? React.cloneElement(child, { compact: true }) : child,\n );\n\n return (\n <div style={sx({ display: 'flex', flexDirection: 'column' })}>\n {asLink ? (\n <Link\n href={href}\n className=\"sereno-sidenav-btn\"\n aria-label={collapsed ? label : undefined}\n aria-current={selfActive ? 'page' : undefined}\n onClick={() => {\n hideTip();\n select(value);\n }}\n {...hoverHandlers}\n style={rowStyle}\n >\n {inner}\n </Link>\n ) : (\n <button\n ref={btnRef}\n type=\"button\"\n className=\"sereno-sidenav-btn\"\n aria-label={collapsed ? label : undefined}\n aria-current={selfActive ? 'page' : undefined}\n aria-disabled={disabled || undefined}\n tabIndex={disabled ? -1 : undefined}\n aria-haspopup={hasChildren ? 'menu' : undefined}\n aria-expanded={hasChildren ? open : undefined}\n onClick={() => {\n if (disabled) return;\n hideTip();\n if (hasChildren) onToggle();\n else select(value);\n }}\n {...hoverHandlers}\n style={rowStyle}\n >\n {inner}\n </button>\n )}\n\n {/* Expanded: inline accordion. */}\n {hasChildren && !collapsed && open && (\n <div\n style={sx({\n display: 'flex',\n flexDirection: 'column',\n gap: 2,\n margin: '2px 0 2px 19px',\n paddingLeft: 'var(--space-3)',\n borderLeft: 'var(--border-width-hairline) solid var(--border-default)',\n })}\n >\n <ParentDisabledContext.Provider value={disabled}>{children}</ParentDisabledContext.Provider>\n </div>\n )}\n\n {/* Collapsed rail: hover flyout. */}\n {railFlyout && open && (\n <SubmenuPopover anchorRef={btnRef} label={label} icon={icon} onClose={closeFlyoutNow} onMouseEnter={() => openFlyout(value)} onMouseLeave={closeFlyoutSoon}>\n <ParentDisabledContext.Provider value={disabled}>{compactChildren}</ParentDisabledContext.Provider>\n </SubmenuPopover>\n )}\n </div>\n );\n}\n\nfunction SubItem({ value, label, count, disabled: disabledProp, compact = false }: SidebarNavSubItemProps) {\n const { value: activeValue, disabled: rootDisabled, select, showTip, hideTip } = useSidebarNavContext('SubItem');\n const parentDisabled = React.useContext(ParentDisabledContext);\n const labelRef = React.useRef<HTMLSpanElement>(null);\n // Its own `disabled` wins, then its parent Item's (already resolved against the root), then the root's.\n const disabled = disabledProp ?? parentDisabled ?? rootDisabled;\n const active = activeValue === value;\n const st = useInteract(disabled);\n return (\n <button\n type=\"button\"\n className=\"sereno-sidenav-btn\"\n aria-current={active ? 'page' : undefined}\n aria-disabled={disabled || undefined}\n tabIndex={disabled ? -1 : undefined}\n onClick={() => {\n hideTip();\n if (!disabled) select(value);\n }}\n {...st.handlers}\n onMouseEnter={(e) => {\n st.handlers.onMouseEnter?.(e);\n showLabelTip(e.currentTarget, labelRef.current, label, showTip);\n }}\n onMouseLeave={(e) => {\n st.handlers.onMouseLeave?.(e);\n hideTip();\n }}\n onFocus={(e) => {\n st.handlers.onFocus?.(e);\n if (isKeyboardFocus(e.currentTarget)) showLabelTip(e.currentTarget, labelRef.current, label, showTip);\n }}\n onBlur={(e) => {\n st.handlers.onBlur?.(e);\n hideTip();\n }}\n onKeyDown={(e) => {\n if (e.key === 'Escape') hideTip();\n }}\n style={sx({\n display: 'flex',\n alignItems: 'center',\n gap: 'var(--space-2)',\n width: '100%',\n height: compact ? 32 : 34,\n padding: '0 var(--space-2)',\n border: 'none',\n borderRadius: 'var(--radius-sm)',\n cursor: disabled ? 'not-allowed' : 'pointer',\n textAlign: 'left',\n fontFamily: 'var(--font-body)',\n fontSize: 'var(--text-sm)',\n fontWeight: active ? 'var(--weight-semibold)' : 'var(--weight-medium)',\n background: active ? 'var(--bg-brand-soft)' : st.hover ? 'var(--interactive-ghost-hover)' : 'transparent',\n color: disabled ? 'var(--text-disabled)' : active ? 'var(--text-brand)' : 'var(--text-secondary)',\n transition: 'var(--transition-control)',\n })}\n >\n <span ref={labelRef} style={sx({ flex: 1, minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' })}>\n {label}\n </span>\n {count !== undefined && <span style={countPill(active, disabled)}>{count}</span>}\n </button>\n );\n}\n\nfunction SubmenuPopover({\n anchorRef,\n label,\n icon,\n children,\n onClose,\n onMouseEnter,\n onMouseLeave,\n}: {\n anchorRef: React.RefObject<HTMLButtonElement | null>;\n label: string;\n icon?: React.ReactNode;\n children: React.ReactNode;\n onClose: () => void;\n onMouseEnter?: () => void;\n onMouseLeave?: () => void;\n}) {\n const ref = React.useRef<HTMLDivElement>(null);\n const [pos, setPos] = React.useState<{ top: number; left: number; caret: number | null } | null>(null);\n\n React.useLayoutEffect(() => {\n const el = ref.current;\n const anchor = anchorRef.current;\n if (!el || !anchor) return;\n const a = anchor.getBoundingClientRect();\n const p = el.getBoundingClientRect();\n let left = a.right + 10;\n let onRight = true;\n if (left + p.width > window.innerWidth - 8) {\n left = Math.max(8, a.left - p.width - 10);\n onRight = false;\n }\n let top = a.top - 4;\n if (top + p.height > window.innerHeight - 8) top = Math.max(8, window.innerHeight - 8 - p.height);\n const caret = onRight ? a.top + a.height / 2 - top : null;\n setPos({ top, left, caret });\n }, [anchorRef]);\n\n React.useEffect(() => {\n const onDown = (e: MouseEvent) => {\n const t = e.target as Node;\n if (!ref.current?.contains(t) && !anchorRef.current?.contains(t)) onClose();\n };\n const onKey = (e: KeyboardEvent) => e.key === 'Escape' && onClose();\n document.addEventListener('mousedown', onDown);\n document.addEventListener('keydown', onKey);\n window.addEventListener('scroll', onClose, true);\n window.addEventListener('resize', onClose);\n return () => {\n document.removeEventListener('mousedown', onDown);\n document.removeEventListener('keydown', onKey);\n window.removeEventListener('scroll', onClose, true);\n window.removeEventListener('resize', onClose);\n };\n }, [anchorRef, onClose]);\n\n return createPortal(\n <div\n ref={ref}\n role=\"menu\"\n aria-label={label}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n style={sx({\n position: 'fixed',\n top: pos ? pos.top : -9999,\n left: pos ? pos.left : -9999,\n minWidth: 196,\n maxWidth: 264,\n padding: 5,\n background: 'var(--bg-surface)',\n borderRadius: 'var(--radius-md)',\n boxShadow: '0 0 0 1px var(--border-default), var(--shadow-lg)',\n zIndex: 1000,\n animation: 'sereno-flyout-in var(--duration-fast) var(--ease-out)',\n })}\n >\n {pos?.caret != null && (\n <span\n aria-hidden\n style={sx({\n position: 'absolute',\n left: -4,\n top: pos.caret,\n width: 8,\n height: 8,\n background: 'var(--bg-surface)',\n borderLeft: 'var(--border-width-hairline) solid var(--border-default)',\n borderBottom: 'var(--border-width-hairline) solid var(--border-default)',\n transform: 'translateY(-50%) rotate(45deg)',\n borderBottomLeftRadius: 2,\n })}\n />\n )}\n\n <div\n style={sx({\n display: 'flex',\n alignItems: 'center',\n gap: 'var(--space-2)',\n padding: '5px 8px 8px',\n marginBottom: 4,\n borderBottom: 'var(--border-width-hairline) solid var(--border-subtle)',\n fontFamily: 'var(--font-body)',\n fontSize: 'var(--text-sm)',\n fontWeight: 'var(--weight-semibold)',\n color: 'var(--text-primary)',\n })}\n >\n {icon && (\n <span\n style={sx({ flex: '0 0 auto', display: 'inline-flex', width: 16, height: 16, alignItems: 'center', justifyContent: 'center', color: 'var(--text-muted)' })}\n >\n {icon}\n </span>\n )}\n <span style={sx({ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' })}>{label}</span>\n </div>\n\n <div style={sx({ display: 'flex', flexDirection: 'column', gap: 1 })}>{children}</div>\n </div>,\n document.body,\n );\n}\n\nexport const SidebarNav = Object.assign(SidebarNavRoot, { Section, Item, SubItem });\n"],"mappings":";AAqRM,SA4NE,UA5NF,KA2EM,YA3EN;AAnRN,YAAY,WAAW;AACvB,SAAS,oBAAoB;AAC7B,SAAS,aAAa,mBAAmB;AACzC,SAAS,UAAU;AACnB,SAAS,mBAAmB;AA6G5B,MAAM,WAAW;AACjB,MAAM,YAAY;AAElB,MAAM,YAAY,GAAG;AAAA,EACnB,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,eAAe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a,OAAO,OAAO,gBAAgB,EAAE,SAAS,MAAM,QAAQ,CAAC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/navigation/SidebarNav.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { ChevronDown, ChevronLeft } from 'lucide-react';\nimport { sx } from '../_internal/style';\nimport { useInteract } from '../core/Button';\n\n/**\n * Desktop primary navigation - a **compound component**, the counterpart to\n * `BottomNav`. Grouped sections with dividers, an optional second level per\n * item, and a collapse toggle that drops it to a 72px icon rail.\n *\n * ```tsx\n * <SidebarNav value={view} onChange={setView} header={<Wordmark />}>\n * <SidebarNav.Section label=\"Workspace\">\n * <SidebarNav.Item value=\"agenda\" label=\"Calendar\" icon={<Calendar size={18} />} />\n * <SidebarNav.Item value=\"finance\" label=\"Finance\" icon={<Wallet size={18} />}>\n * <SidebarNav.SubItem value=\"finance:incoming\" label=\"Incoming\" />\n * <SidebarNav.SubItem value=\"finance:payouts\" label=\"Payouts\" count={3} />\n * </SidebarNav.Item>\n * </SidebarNav.Section>\n * </SidebarNav>\n * ```\n *\n * `Item` is not a destination once it has `SubItem` children - it toggles\n * them instead (an inline accordion when expanded, a hover flyout on the\n * collapsed rail).\n */\nexport interface SidebarNavProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> {\n value?: string;\n onChange?: (value: string) => void;\n /** Controlled collapse (icon-only rail). */\n collapsed?: boolean;\n defaultCollapsed?: boolean;\n onCollapsedChange?: (collapsed: boolean) => void;\n /** Show the collapse toggle in the footer. */\n collapsible?: boolean;\n /** Brand / logo slot at the top. */\n header?: React.ReactNode;\n /** Persistent slot pinned to the bottom (user card, plan nudge). Hidden while collapsed. */\n footer?: React.ReactNode;\n labels?: { expand?: string; collapse?: string };\n /** Component used to render items that carry `href` (e.g. Next's `Link`). Defaults to `'a'`. */\n linkComponent?: React.ElementType;\n /**\n * Disables every `Item` / `SubItem` at once - a gated area, an account that\n * isn't active yet. An item can still opt back in with its own\n * `disabled={false}` (e.g. a \"Help\" link that must stay reachable). Only the\n * destinations are affected: the collapse toggle, `header` and `footer` stay\n * live, since they aren't navigation.\n */\n disabled?: boolean;\n children: React.ReactNode;\n}\n\nexport interface SidebarNavSectionProps {\n /** Small uppercase heading above the block. Omit for an unlabelled group - the divider still shows. */\n label?: string;\n children: React.ReactNode;\n}\n\nexport interface SidebarNavItemProps {\n value: string;\n label: string;\n /** A Lucide icon passed as a node - sized by the caller. */\n icon?: React.ReactNode;\n count?: number;\n /** Render this leaf as a real link (routing, new-tab, SSR-active) via `linkComponent`. Ignored while `disabled`. */\n href?: string;\n /**\n * Not selectable - e.g. a feature locked behind a higher plan. Inherits the\n * root's `disabled` when unset; an explicit `false` opts back in under a\n * disabled root.\n *\n * `aria-disabled` (not the native attribute), so the row is still in the\n * accessibility tree and a screen reader finds it - but it leaves the Tab\n * order (a locked area shouldn't cost a dead tab stop per item), a click\n * never fires `onChange`, `href` never navigates (it renders as a `<button>`,\n * never a link), and a parent `Item` doesn't toggle its accordion or open its\n * rail flyout. It can still be the current page: `value` pointing at it keeps\n * `aria-current` and the active look, just muted.\n */\n disabled?: boolean;\n /** `SidebarNav.SubItem`s - a second level. Present ⇒ this item is not a destination itself, it toggles them. */\n children?: React.ReactNode;\n}\n\nexport interface SidebarNavSubItemProps {\n value: string;\n label: string;\n count?: number;\n /** Not selectable. Inherits from its parent `Item` (which inherits the root); an explicit value wins. Same contract as `SidebarNav.Item`'s `disabled`. */\n disabled?: boolean;\n /** Set by the parent `Item` when rendering this into the collapsed rail's flyout popover - not for consumers to pass. */\n compact?: boolean;\n}\n\ninterface SidebarNavContextValue {\n value?: string;\n /** The root's `disabled` - what an `Item` falls back to when it doesn't set its own. */\n disabled: boolean;\n /** Closes any open flyout, then calls the root's `onChange`. What `Item` / `SubItem` call on click. */\n select: (value: string) => void;\n collapsed: boolean;\n linkComponent?: React.ElementType;\n /** Which item's collapsed-rail flyout is open, if any - single, cross-item (opening one closes another). */\n flyoutValue: string | null;\n openFlyout: (value: string) => void;\n closeFlyoutSoon: () => void;\n closeFlyoutNow: () => void;\n showTip: (label: string, rect: DOMRect) => void;\n hideTip: () => void;\n}\n\nconst EXPANDED = 248;\nconst COLLAPSED = 72;\n\nconst groupHead = sx({\n fontFamily: 'var(--font-body)',\n fontSize: 'var(--text-2xs)',\n fontWeight: 'var(--weight-bold)',\n letterSpacing: '0.09em',\n textTransform: 'uppercase',\n color: 'var(--text-disabled)',\n // No top padding: the section's own top gap is the section break; this hugs its items.\n padding: '0 var(--space-3) var(--space-2)',\n});\n\nconst countPill = (active: boolean, disabled = false) =>\n sx({\n marginLeft: 'auto',\n flex: '0 0 auto',\n fontSize: 'var(--text-2xs)',\n fontWeight: 'var(--weight-bold)',\n lineHeight: 1,\n padding: '2px 6px',\n borderRadius: '999px',\n // A bordered chip so it stays legible over the row's hover / active fill.\n background: 'var(--bg-surface)',\n color: disabled ? 'var(--text-disabled)' : active ? 'var(--text-brand)' : 'var(--text-muted)',\n boxShadow: 'inset 0 0 0 1px ' + (disabled ? 'var(--border-subtle)' : active ? 'var(--border-brand)' : 'var(--border-default)'),\n });\n\nconst SidebarNavContext = React.createContext<SidebarNavContextValue | null>(null);\n\n/** An `Item`'s effective `disabled`, handed to its `SubItem`s so they inherit from their parent (which itself inherited the root's). */\nconst ParentDisabledContext = React.createContext<boolean | undefined>(undefined);\n\nfunction useSidebarNavContext(component: string): SidebarNavContextValue {\n const ctx = React.useContext(SidebarNavContext);\n if (!ctx) throw new Error(`<SidebarNav.${component}> must be rendered inside <SidebarNav>.`);\n return ctx;\n}\n\n/** The `value`s of a node's `SidebarNav.SubItem` children - used for \"does this branch hold the active leaf\". */\nfunction childValuesOf(children: React.ReactNode): string[] {\n const out: string[] = [];\n React.Children.forEach(children, (child) => {\n if (React.isValidElement<{ value?: unknown }>(child) && typeof child.props.value === 'string') out.push(child.props.value);\n });\n return out;\n}\n\n/**\n * Shows `label` as a tooltip beside `row`. On the icon-only rail every label is\n * hidden (`labelEl` is null), so it always shows; expanded, only when the\n * ellipsis is actually cutting the text off - a short label gets no redundant tooltip.\n */\nfunction showLabelTip(row: HTMLElement, labelEl: HTMLElement | null, label: string, showTip: SidebarNavContextValue['showTip']) {\n if (labelEl && labelEl.scrollWidth <= labelEl.clientWidth) return;\n showTip(label, row.getBoundingClientRect());\n}\n\n/** Keyboard focus only - a mouse click focuses the row too, but the pointer is already showing (or has dismissed) the tip. */\nfunction isKeyboardFocus(el: HTMLElement): boolean {\n try {\n return el.matches(':focus-visible');\n } catch {\n return false;\n }\n}\n\nfunction SidebarNavRoot({\n value,\n onChange,\n collapsed: collapsedProp,\n defaultCollapsed = false,\n onCollapsedChange,\n collapsible = true,\n header,\n footer,\n labels,\n linkComponent,\n disabled = false,\n children,\n style,\n ...rest\n}: SidebarNavProps) {\n const [internalCollapsed, setInternalCollapsed] = React.useState(defaultCollapsed);\n const collapsed = collapsedProp ?? internalCollapsed;\n const setCollapsed = (c: boolean) => {\n if (collapsedProp === undefined) setInternalCollapsed(c);\n onCollapsedChange?.(c);\n };\n\n // Custom hover tooltip for the collapsed rail - portalled so the rail's own\n // overflow clipping can't hide it.\n const [mounted, setMounted] = React.useState(false);\n // eslint-disable-next-line react-hooks/set-state-in-effect -- portal target is client-only\n React.useEffect(() => setMounted(true), []);\n const [tip, setTip] = React.useState<{ label: string; top: number; left: number } | null>(null);\n React.useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect -- drop a stale tip when the rail expands\n if (!collapsed) setTip(null);\n }, [collapsed]);\n const showTip = (label: string, r: DOMRect) => setTip({ label, top: r.top + r.height / 2, left: r.right + 10 });\n const hideTip = () => setTip(null);\n\n // Single cross-item flyout for the collapsed rail (only one open at a time).\n const [flyoutValue, setFlyoutValue] = React.useState<string | null>(null);\n const flyoutTimer = React.useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const openFlyout = (v: string) => {\n clearTimeout(flyoutTimer.current);\n setFlyoutValue(v);\n };\n const closeFlyoutSoon = () => {\n clearTimeout(flyoutTimer.current);\n flyoutTimer.current = setTimeout(() => setFlyoutValue(null), 140);\n };\n const closeFlyoutNow = () => {\n clearTimeout(flyoutTimer.current);\n setFlyoutValue(null);\n };\n React.useEffect(() => () => clearTimeout(flyoutTimer.current), []);\n React.useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect -- drop a stale flyout when the rail expands\n if (!collapsed) setFlyoutValue(null);\n }, [collapsed]);\n\n const select = (v: string) => {\n closeFlyoutNow();\n onChange?.(v);\n };\n\n const ctx: SidebarNavContextValue = { value, disabled, select, collapsed, linkComponent, flyoutValue, openFlyout, closeFlyoutSoon, closeFlyoutNow, showTip, hideTip };\n\n // The collapse control straddles the sidebar's right edge, level with the logo.\n const toggleLabel = collapsed ? labels?.expand ?? 'Expand' : labels?.collapse ?? 'Collapse';\n const toggleBtn = collapsible ? (\n <button\n type=\"button\"\n className=\"sereno-sidenav-btn sereno-sidenav-toggle\"\n aria-label={toggleLabel}\n aria-pressed={collapsed}\n title={toggleLabel}\n onClick={() => setCollapsed(!collapsed)}\n style={sx({\n position: 'absolute',\n top: 'calc(var(--sidenav-header-h, 56px) / 2)',\n right: -13,\n transform: 'translateY(-50%)',\n zIndex: 5,\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 26,\n height: 26,\n borderRadius: '999px',\n border: 'var(--border-width-hairline) solid var(--border-default)',\n background: 'var(--bg-surface)',\n color: 'var(--text-secondary)',\n boxShadow: 'var(--shadow-sm)',\n cursor: 'pointer',\n transition: 'var(--transition-control)',\n })}\n >\n <ChevronLeft\n size={15}\n strokeWidth={2}\n style={{ transition: 'transform var(--duration-normal) var(--ease-out)', transform: collapsed ? 'rotate(180deg)' : 'none' }}\n />\n </button>\n ) : null;\n\n return (\n <SidebarNavContext.Provider value={ctx}>\n <nav\n {...rest}\n className={['sereno-sidenav-root', rest.className].filter(Boolean).join(' ')}\n data-collapsed={collapsed ? '' : undefined}\n style={sx({\n position: 'relative',\n display: 'flex',\n flexDirection: 'column',\n flex: '0 0 auto',\n width: collapsed ? COLLAPSED : EXPANDED,\n height: '100%',\n background: 'var(--bg-surface)',\n borderRight: 'var(--border-width-hairline) solid var(--border-default)',\n transition: 'width var(--duration-normal) var(--ease-out)',\n ...style,\n })}\n >\n {toggleBtn}\n\n {header !== undefined && (\n <div\n style={sx({\n flex: '0 0 auto',\n display: 'flex',\n alignItems: 'center',\n justifyContent: collapsed ? 'center' : 'flex-start',\n height: 'var(--sidenav-header-h, 56px)',\n padding: collapsed ? '0' : '0 var(--space-4)',\n })}\n >\n <div style={sx({ minWidth: 0, overflow: 'hidden', display: 'flex', alignItems: 'center' })}>{header}</div>\n </div>\n )}\n\n <div\n className=\"sereno-sidenav\"\n style={sx({\n flex: 1,\n overflowY: 'auto',\n overflowX: 'hidden',\n padding: 'var(--space-2) var(--space-3)',\n display: 'flex',\n flexDirection: 'column',\n })}\n >\n {children}\n </div>\n\n {footer && !collapsed && (\n <div\n style={sx({\n borderTop: 'var(--border-width-hairline) solid var(--border-subtle)',\n padding: 'var(--space-3)',\n display: 'flex',\n flexDirection: 'column',\n gap: 'var(--space-2)',\n })}\n >\n {footer}\n </div>\n )}\n\n {mounted &&\n tip &&\n createPortal(\n <div\n role=\"tooltip\"\n style={sx({\n position: 'fixed',\n top: tip.top,\n left: tip.left,\n transform: 'translateY(-50%)',\n padding: '5px 9px',\n borderRadius: 'var(--radius-sm)',\n background: 'var(--bg-inverse)',\n color: 'var(--text-inverse)',\n fontFamily: 'var(--font-body)',\n fontSize: 'var(--text-xs)',\n fontWeight: 'var(--weight-medium)',\n lineHeight: 1,\n whiteSpace: 'nowrap',\n boxShadow: 'var(--shadow-md)',\n pointerEvents: 'none',\n zIndex: 1000,\n animation: 'sereno-fade-in var(--duration-fast) var(--ease-out)',\n })}\n >\n <span\n aria-hidden\n style={sx({\n position: 'absolute',\n left: -3,\n top: '50%',\n width: 6,\n height: 6,\n background: 'var(--bg-inverse)',\n transform: 'translateY(-50%) rotate(45deg)',\n borderRadius: 1,\n })}\n />\n {tip.label}\n </div>,\n document.body,\n )}\n </nav>\n </SidebarNavContext.Provider>\n );\n}\n\nfunction Section({ label, children }: SidebarNavSectionProps) {\n const { collapsed } = useSidebarNavContext('Section');\n return (\n <div className=\"sereno-sidenav-section\" style={sx({ display: 'flex', flexDirection: 'column', gap: 2 })}>\n {label && !collapsed && <span style={groupHead}>{label}</span>}\n {children}\n </div>\n );\n}\n\nfunction Item({ value, label, icon, count, href, disabled: disabledProp, children }: SidebarNavItemProps) {\n const {\n value: activeValue,\n disabled: rootDisabled,\n select,\n collapsed,\n linkComponent,\n flyoutValue,\n openFlyout,\n closeFlyoutSoon,\n closeFlyoutNow,\n showTip,\n hideTip,\n } = useSidebarNavContext('Item');\n // Its own `disabled` wins - including an explicit `false` under a disabled root.\n const disabled = disabledProp ?? rootDisabled;\n const st = useInteract(disabled);\n const btnRef = React.useRef<HTMLButtonElement>(null);\n const labelRef = React.useRef<HTMLSpanElement>(null);\n const hasChildren = React.Children.count(children) > 0;\n const childVals = hasChildren ? childValuesOf(children) : [];\n // Still the current page while disabled (a locked area can be showing you where you are) - just muted.\n const selfActive = activeValue === value && !hasChildren;\n const childActive = hasChildren && childVals.includes(activeValue ?? '');\n const highlight = selfActive || (collapsed && childActive);\n // A disabled parent has nothing to open: no rail flyout (it falls back to the plain label tooltip).\n const railFlyout = collapsed && hasChildren && !disabled;\n // A disabled item is never a real link - `href` must not navigate.\n const asLink = !hasChildren && !!href && !!linkComponent && !disabled;\n const Link = linkComponent ?? 'a';\n\n // Expanded: an inline accordion, local per-item and seeded open once (on\n // mount) for the branch holding the active child - that seed still applies\n // while disabled, so the \"you are here\" branch stays visible (it just can't\n // be toggled). Collapsed: a hover flyout instead - that one is cross-item\n // (only one open at a time), so it lives in the root's flyoutValue, not\n // here, and a disabled parent never opens it.\n const [localOpen, setLocalOpen] = React.useState(() => childActive);\n const open = collapsed ? !disabled && flyoutValue === value : localOpen;\n\n const onToggle = () => {\n if (collapsed) {\n if (flyoutValue === value) closeFlyoutNow();\n else openFlyout(value);\n } else {\n setLocalOpen((o) => !o);\n }\n };\n\n const rowStyle = sx({\n position: 'relative',\n display: 'flex',\n alignItems: 'center',\n gap: 'var(--space-3)',\n width: '100%',\n height: 40,\n padding: collapsed ? 0 : '0 var(--space-3)',\n justifyContent: collapsed ? 'center' : 'flex-start',\n border: 'none',\n borderRadius: 'var(--radius-control)',\n cursor: disabled ? 'not-allowed' : 'pointer',\n textAlign: 'left',\n textDecoration: 'none',\n fontFamily: 'var(--font-body)',\n fontSize: 'var(--text-base)',\n fontWeight: highlight || childActive ? 'var(--weight-semibold)' : 'var(--weight-medium)',\n background: highlight ? 'var(--bg-brand-soft)' : open || st.hover ? 'var(--interactive-ghost-hover)' : 'transparent',\n color: disabled ? 'var(--text-disabled)' : highlight || childActive ? 'var(--text-brand)' : 'var(--text-secondary)',\n transition: 'var(--transition-control)',\n });\n\n const inner = (\n <>\n {icon && (\n <span style={sx({ flex: '0 0 auto', display: 'inline-flex', width: 20, height: 20, alignItems: 'center', justifyContent: 'center' })}>{icon}</span>\n )}\n {collapsed && !disabled && (count !== undefined || childActive) && (\n <span\n aria-hidden\n style={sx({\n position: 'absolute',\n top: 7,\n right: 12,\n width: 6,\n height: 6,\n borderRadius: '999px',\n background: 'var(--interactive-accent)',\n })}\n />\n )}\n {!collapsed && (\n <>\n <span ref={labelRef} style={sx({ flex: 1, minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' })}>\n {label}\n </span>\n {count !== undefined && <span style={countPill(highlight, disabled)}>{count}</span>}\n {hasChildren && (\n <ChevronDown\n size={16}\n strokeWidth={2}\n style={{ flex: '0 0 auto', transition: 'transform var(--duration-fast) var(--ease-standard)', transform: open ? 'rotate(180deg)' : 'none' }}\n />\n )}\n </>\n )}\n </>\n );\n\n const hoverHandlers = {\n ...st.handlers,\n onMouseEnter: (e: React.MouseEvent<HTMLElement>) => {\n st.handlers.onMouseEnter?.(e);\n if (railFlyout) openFlyout(value);\n else showLabelTip(e.currentTarget, labelRef.current, label, showTip);\n },\n onMouseLeave: (e: React.MouseEvent<HTMLElement>) => {\n st.handlers.onMouseLeave?.(e);\n if (railFlyout) closeFlyoutSoon();\n else hideTip();\n },\n // Keyboard parity with hover - on the rail a Tab stop is otherwise just an unlabelled icon.\n onFocus: (e: React.FocusEvent<HTMLElement>) => {\n st.handlers.onFocus?.(e);\n if (isKeyboardFocus(e.currentTarget)) showLabelTip(e.currentTarget, labelRef.current, label, showTip);\n },\n onBlur: (e: React.FocusEvent<HTMLElement>) => {\n st.handlers.onBlur?.(e);\n hideTip();\n },\n // Dismissible without moving the pointer or focus (WCAG 1.4.13).\n onKeyDown: (e: React.KeyboardEvent<HTMLElement>) => {\n if (e.key === 'Escape') hideTip();\n },\n };\n\n // The flyout popover reuses the same SubItem elements, just 2px shorter to\n // read as a compact menu rather than the accordion's own row height.\n const compactChildren = React.Children.map(children, (child) =>\n React.isValidElement<SidebarNavSubItemProps>(child) ? React.cloneElement(child, { compact: true }) : child,\n );\n\n return (\n <div style={sx({ display: 'flex', flexDirection: 'column' })}>\n {asLink ? (\n <Link\n href={href}\n className=\"sereno-sidenav-btn\"\n aria-label={collapsed ? label : undefined}\n aria-current={selfActive ? 'page' : undefined}\n onClick={() => {\n hideTip();\n select(value);\n }}\n {...hoverHandlers}\n style={rowStyle}\n >\n {inner}\n </Link>\n ) : (\n <button\n ref={btnRef}\n type=\"button\"\n className=\"sereno-sidenav-btn\"\n aria-label={collapsed ? label : undefined}\n aria-current={selfActive ? 'page' : undefined}\n aria-disabled={disabled || undefined}\n tabIndex={disabled ? -1 : undefined}\n aria-haspopup={hasChildren ? 'menu' : undefined}\n aria-expanded={hasChildren ? open : undefined}\n onClick={() => {\n if (disabled) return;\n hideTip();\n if (hasChildren) onToggle();\n else select(value);\n }}\n {...hoverHandlers}\n style={rowStyle}\n >\n {inner}\n </button>\n )}\n\n {/* Expanded: inline accordion. */}\n {hasChildren && !collapsed && open && (\n <div\n style={sx({\n display: 'flex',\n flexDirection: 'column',\n gap: 2,\n margin: '2px 0 2px 19px',\n paddingLeft: 'var(--space-3)',\n borderLeft: 'var(--border-width-hairline) solid var(--border-default)',\n })}\n >\n <ParentDisabledContext.Provider value={disabled}>{children}</ParentDisabledContext.Provider>\n </div>\n )}\n\n {/* Collapsed rail: hover flyout. */}\n {railFlyout && open && (\n <SubmenuPopover anchorRef={btnRef} label={label} icon={icon} onClose={closeFlyoutNow} onMouseEnter={() => openFlyout(value)} onMouseLeave={closeFlyoutSoon}>\n <ParentDisabledContext.Provider value={disabled}>{compactChildren}</ParentDisabledContext.Provider>\n </SubmenuPopover>\n )}\n </div>\n );\n}\n\nfunction SubItem({ value, label, count, disabled: disabledProp, compact = false }: SidebarNavSubItemProps) {\n const { value: activeValue, disabled: rootDisabled, select, showTip, hideTip } = useSidebarNavContext('SubItem');\n const parentDisabled = React.useContext(ParentDisabledContext);\n const labelRef = React.useRef<HTMLSpanElement>(null);\n // Its own `disabled` wins, then its parent Item's (already resolved against the root), then the root's.\n const disabled = disabledProp ?? parentDisabled ?? rootDisabled;\n const active = activeValue === value;\n const st = useInteract(disabled);\n return (\n <button\n type=\"button\"\n className=\"sereno-sidenav-btn\"\n aria-current={active ? 'page' : undefined}\n aria-disabled={disabled || undefined}\n tabIndex={disabled ? -1 : undefined}\n onClick={() => {\n hideTip();\n if (!disabled) select(value);\n }}\n {...st.handlers}\n onMouseEnter={(e) => {\n st.handlers.onMouseEnter?.(e);\n showLabelTip(e.currentTarget, labelRef.current, label, showTip);\n }}\n onMouseLeave={(e) => {\n st.handlers.onMouseLeave?.(e);\n hideTip();\n }}\n onFocus={(e) => {\n st.handlers.onFocus?.(e);\n if (isKeyboardFocus(e.currentTarget)) showLabelTip(e.currentTarget, labelRef.current, label, showTip);\n }}\n onBlur={(e) => {\n st.handlers.onBlur?.(e);\n hideTip();\n }}\n onKeyDown={(e) => {\n if (e.key === 'Escape') hideTip();\n }}\n style={sx({\n display: 'flex',\n alignItems: 'center',\n gap: 'var(--space-2)',\n width: '100%',\n height: compact ? 32 : 34,\n padding: '0 var(--space-2)',\n border: 'none',\n borderRadius: 'var(--radius-sm)',\n cursor: disabled ? 'not-allowed' : 'pointer',\n textAlign: 'left',\n fontFamily: 'var(--font-body)',\n fontSize: 'var(--text-sm)',\n fontWeight: active ? 'var(--weight-semibold)' : 'var(--weight-medium)',\n background: active ? 'var(--bg-brand-soft)' : st.hover ? 'var(--interactive-ghost-hover)' : 'transparent',\n color: disabled ? 'var(--text-disabled)' : active ? 'var(--text-brand)' : 'var(--text-secondary)',\n transition: 'var(--transition-control)',\n })}\n >\n <span ref={labelRef} style={sx({ flex: 1, minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' })}>\n {label}\n </span>\n {count !== undefined && <span style={countPill(active, disabled)}>{count}</span>}\n </button>\n );\n}\n\nfunction SubmenuPopover({\n anchorRef,\n label,\n icon,\n children,\n onClose,\n onMouseEnter,\n onMouseLeave,\n}: {\n anchorRef: React.RefObject<HTMLButtonElement | null>;\n label: string;\n icon?: React.ReactNode;\n children: React.ReactNode;\n onClose: () => void;\n onMouseEnter?: () => void;\n onMouseLeave?: () => void;\n}) {\n const ref = React.useRef<HTMLDivElement>(null);\n const [pos, setPos] = React.useState<{ top: number; left: number; caret: number | null } | null>(null);\n\n React.useLayoutEffect(() => {\n const el = ref.current;\n const anchor = anchorRef.current;\n if (!el || !anchor) return;\n const a = anchor.getBoundingClientRect();\n const p = el.getBoundingClientRect();\n let left = a.right + 10;\n let onRight = true;\n if (left + p.width > window.innerWidth - 8) {\n left = Math.max(8, a.left - p.width - 10);\n onRight = false;\n }\n let top = a.top - 4;\n if (top + p.height > window.innerHeight - 8) top = Math.max(8, window.innerHeight - 8 - p.height);\n const caret = onRight ? a.top + a.height / 2 - top : null;\n setPos({ top, left, caret });\n }, [anchorRef]);\n\n React.useEffect(() => {\n const onDown = (e: MouseEvent) => {\n const t = e.target as Node;\n if (!ref.current?.contains(t) && !anchorRef.current?.contains(t)) onClose();\n };\n const onKey = (e: KeyboardEvent) => e.key === 'Escape' && onClose();\n document.addEventListener('mousedown', onDown);\n document.addEventListener('keydown', onKey);\n window.addEventListener('scroll', onClose, true);\n window.addEventListener('resize', onClose);\n return () => {\n document.removeEventListener('mousedown', onDown);\n document.removeEventListener('keydown', onKey);\n window.removeEventListener('scroll', onClose, true);\n window.removeEventListener('resize', onClose);\n };\n }, [anchorRef, onClose]);\n\n return createPortal(\n <div\n ref={ref}\n role=\"menu\"\n aria-label={label}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n style={sx({\n position: 'fixed',\n top: pos ? pos.top : -9999,\n left: pos ? pos.left : -9999,\n minWidth: 196,\n maxWidth: 264,\n padding: 5,\n background: 'var(--bg-surface)',\n borderRadius: 'var(--radius-md)',\n boxShadow: '0 0 0 1px var(--border-default), var(--shadow-lg)',\n zIndex: 1000,\n animation: 'sereno-flyout-in var(--duration-fast) var(--ease-out)',\n })}\n >\n {pos?.caret != null && (\n <span\n aria-hidden\n style={sx({\n position: 'absolute',\n left: -4,\n top: pos.caret,\n width: 8,\n height: 8,\n background: 'var(--bg-surface)',\n borderLeft: 'var(--border-width-hairline) solid var(--border-default)',\n borderBottom: 'var(--border-width-hairline) solid var(--border-default)',\n transform: 'translateY(-50%) rotate(45deg)',\n borderBottomLeftRadius: 2,\n })}\n />\n )}\n\n <div\n style={sx({\n display: 'flex',\n alignItems: 'center',\n gap: 'var(--space-2)',\n padding: '5px 8px 8px',\n marginBottom: 4,\n borderBottom: 'var(--border-width-hairline) solid var(--border-subtle)',\n fontFamily: 'var(--font-body)',\n fontSize: 'var(--text-sm)',\n fontWeight: 'var(--weight-semibold)',\n color: 'var(--text-primary)',\n })}\n >\n {icon && (\n <span\n style={sx({ flex: '0 0 auto', display: 'inline-flex', width: 16, height: 16, alignItems: 'center', justifyContent: 'center', color: 'var(--text-muted)' })}\n >\n {icon}\n </span>\n )}\n <span style={sx({ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' })}>{label}</span>\n </div>\n\n <div style={sx({ display: 'flex', flexDirection: 'column', gap: 1 })}>{children}</div>\n </div>,\n document.body,\n );\n}\n\nexport const SidebarNav = Object.assign(SidebarNavRoot, { Section, Item, SubItem });\n"],"mappings":";AAqRM,SA4NE,UA5NF,KA2EM,YA3EN;AAnRN,YAAY,WAAW;AACvB,SAAS,oBAAoB;AAC7B,SAAS,aAAa,mBAAmB;AACzC,SAAS,UAAU;AACnB,SAAS,mBAAmB;AA6G5B,MAAM,WAAW;AACjB,MAAM,YAAY;AAElB,MAAM,YAAY,GAAG;AAAA,EACnB,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,eAAe;AAAA,EACf,OAAO;AAAA;AAAA,EAEP,SAAS;AACX,CAAC;AAED,MAAM,YAAY,CAAC,QAAiB,WAAW,UAC7C,GAAG;AAAA,EACD,YAAY;AAAA,EACZ,MAAM;AAAA,EACN,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,cAAc;AAAA;AAAA,EAEd,YAAY;AAAA,EACZ,OAAO,WAAW,yBAAyB,SAAS,sBAAsB;AAAA,EAC1E,WAAW,sBAAsB,WAAW,yBAAyB,SAAS,wBAAwB;AACxG,CAAC;AAEH,MAAM,oBAAoB,MAAM,cAA6C,IAAI;AAGjF,MAAM,wBAAwB,MAAM,cAAmC,MAAS;AAEhF,SAAS,qBAAqB,WAA2C;AACvE,QAAM,MAAM,MAAM,WAAW,iBAAiB;AAC9C,MAAI,CAAC,IAAK,OAAM,IAAI,MAAM,eAAe,SAAS,yCAAyC;AAC3F,SAAO;AACT;AAGA,SAAS,cAAc,UAAqC;AAC1D,QAAM,MAAgB,CAAC;AACvB,QAAM,SAAS,QAAQ,UAAU,CAAC,UAAU;AAC1C,QAAI,MAAM,eAAo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