@gntik-ai/ui 0.0.0-stage → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Field-neBukiNh.js +149 -0
- package/dist/Field-neBukiNh.js.map +1 -0
- package/dist/forms.d.ts +102 -0
- package/dist/forms.js +130 -0
- package/dist/forms.js.map +1 -0
- package/dist/index.d.ts +16987 -0
- package/dist/index.js +25356 -0
- package/dist/index.js.map +1 -0
- package/dist/theme-bootstrap.js +1 -0
- package/dist/theme-script-DReryl-n.d.ts +16 -0
- package/dist/theme-script.d.ts +3 -0
- package/dist/theme-script.js +13 -0
- package/dist/theme-script.js.map +1 -0
- package/package.json +82 -3
- package/src/styles.css +7 -0
- package/README.md +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["toDate","BaseAccordion","TONE_ICON","doc","BaseButton","doc","s","TONE_ICON","BaseAlertDialog","doc","doc","BaseAvatar","doc","doc","doc","defaultLabels","BaseDrawer","doc","doc","focusRing","Separator","doc","s","doc","s","doc","control","defaultLabels","doc","s","BaseCheckbox","BaseCheckboxGroup","doc","s","BaseCheckboxGroup","BaseRadioGroup","BaseCheckbox","BaseRadio","doc","doc","BaseCollapsible","doc","doc","BaseCombobox","s","BaseCombobox","doc","doc","s","Dialog","doc","s","BaseContextMenu","doc","doc","BaseTooltip","doc","doc","s","BasePopover","doc","pad","EMPTY","pad","Field","Field","doc","doc","s","BaseSelect","doc","BaseToggle","BaseToggleGroup","doc","doc","s","BaseDialog","doc","doc","s","BaseDrawer","doc","doc","doc","doc","s","BasePreviewCard","doc","doc","BaseInput","doc","DEFAULT_LABELS","s","DEFAULT_LABELS","s","doc","s","doc","doc","Field","doc","seq","unquote","doc","defaultLabels","BaseDialog","doc","defaultLabels","doc","s","doc","s","BaseMenu","doc","BaseMeter","doc","focus","Badge","Collapsible","BaseMenu","Collapsible","doc","MenuIcon","doc","BaseCombobox","doc","toDate","toDate","doc","doc","DEFAULT_LABELS","doc","focusRing","doc","s","doc","doc","s","operatorsFor","tokenize","compare","defaultLabels","operatorsFor","BaseCombobox","doc","BaseProgress","doc","pad","s","doc","BaseRadioGroup","BaseRadio","doc","doc","pad","doc","BaseScrollArea","doc","doc","doc","doc","BaseSeparator","doc","doc","BaseSlider","doc","doc","doc","doc","doc","doc","doc","BaseSwitch","doc","s","doc","BaseTabs","doc","doc","doc","doc","DEFAULT_LABELS","doc","doc","doc","BaseToast","doc","doc","Field","doc","s","BaseToolbar","doc","defaultLabels","BasePopover","doc","s","doc","doc","BaseMenu","doc","doc","NATIVELY_FOCUSABLE","doc","s","s","Combobox","doc","doc","doc","doc","doc","doc","doc","doc","MenuIcon","doc","doc","doc","doc","doc"],"sources":["../src/i18n/format.ts","../src/i18n/messages/en.ts","../src/i18n/messages/es.ts","../src/i18n/messages/index.ts","../src/i18n/I18nProvider.tsx","../src/density/density-context.ts","../src/density/DensityProvider.tsx","../src/theme/musematic-mark.ts","../src/theme/presets.tsx","../src/theme/ThemeProvider.tsx","../src/theme/Logo.tsx","../src/components/Accordion/accordion.variants.ts","../src/components/Accordion/Accordion.tsx","../src/components/Accordion/Accordion.doc.ts","../src/components/Alert/alert.variants.ts","../src/components/Alert/Alert.tsx","../src/components/Alert/Alert.doc.ts","../src/utils/rtl.ts","../src/components/Spinner/Spinner.tsx","../src/components/Button/button.variants.ts","../src/components/Button/Button.tsx","../src/components/Button/Button.doc.ts","../src/components/Dialog/dialog.variants.ts","../src/components/AlertDialog/alertDialog.variants.ts","../src/components/AlertDialog/AlertDialog.tsx","../src/components/AlertDialog/AlertDialog.doc.ts","../src/components/AspectRatio/aspect-ratio.variants.ts","../src/components/AspectRatio/AspectRatio.tsx","../src/components/AspectRatio/AspectRatio.doc.ts","../src/components/Avatar/avatar.variants.ts","../src/components/Avatar/Avatar.tsx","../src/components/Avatar/Avatar.doc.ts","../src/components/Badge/badge.variants.ts","../src/components/Badge/Badge.tsx","../src/components/Badge/Badge.doc.ts","../src/components/Blockquote/blockquote.variants.ts","../src/components/Blockquote/Blockquote.tsx","../src/components/Blockquote/Blockquote.doc.ts","../src/components/BottomSheet/bottom-sheet.variants.ts","../src/components/BottomSheet/BottomSheet.tsx","../src/components/BottomSheet/BottomSheet.doc.ts","../src/components/Link/link.variants.ts","../src/components/Link/Link.tsx","../src/components/Link/Link.doc.ts","../src/components/Breadcrumbs/breadcrumbs.variants.ts","../src/components/Breadcrumbs/Breadcrumbs.tsx","../src/components/Breadcrumbs/Breadcrumbs.doc.ts","../src/components/Calendar/calendar.variants.ts","../src/components/Calendar/calendar-utils.ts","../src/components/Calendar/Calendar.tsx","../src/components/Calendar/Calendar.doc.ts","../src/components/Card/card.variants.ts","../src/components/Card/Card.tsx","../src/components/Card/Card.doc.ts","../src/components/Carousel/carousel.variants.ts","../src/components/Carousel/Carousel.tsx","../src/components/Carousel/Carousel.doc.ts","../src/components/Checkbox/checkbox.variants.ts","../src/components/Checkbox/Checkbox.tsx","../src/components/Checkbox/Checkbox.doc.ts","../src/components/ChoiceCard/choice-card.variants.ts","../src/components/ChoiceCard/ClickableCard.tsx","../src/components/ChoiceCard/SelectableCard.tsx","../src/components/ChoiceCard/ChoiceCard.doc.ts","../src/components/CodeBlock/code-block.variants.ts","../src/components/CodeBlock/tokenize.ts","../src/components/CodeBlock/CodeBlock.tsx","../src/components/CodeBlock/Code.tsx","../src/components/CodeBlock/CodeBlock.doc.ts","../src/components/Collapsible/collapsible.variants.ts","../src/components/Collapsible/Collapsible.tsx","../src/components/Collapsible/Collapsible.doc.ts","../src/components/Spinner/Spinner.doc.ts","../src/components/Select/select.variants.ts","../src/components/Combobox/combobox.variants.ts","../src/components/Combobox/specialItems.ts","../src/components/Combobox/useAsyncOptions.ts","../src/components/Combobox/ComboboxRoot.tsx","../src/components/Combobox/Combobox.tsx","../src/components/Combobox/Combobox.doc.ts","../src/components/Kbd/kbd.variants.ts","../src/components/Kbd/Kbd.tsx","../src/components/Kbd/Kbd.doc.ts","../src/components/CommandPalette/command-palette.variants.ts","../src/components/CommandPalette/command-filter.ts","../src/components/CommandPalette/useCommandPaletteShortcut.ts","../src/components/CommandPalette/CommandPalette.tsx","../src/components/CommandPalette/CommandPalette.doc.ts","../src/components/Menu/menu.variants.ts","../src/components/ContextMenu/context-menu.variants.ts","../src/components/ContextMenu/ContextMenu.tsx","../src/components/ContextMenu/ContextMenu.doc.ts","../src/components/LiveAnnouncer/live-announcer.variants.ts","../src/components/LiveAnnouncer/LiveAnnouncer.tsx","../src/components/LiveAnnouncer/LiveAnnouncer.doc.ts","../src/components/Tooltip/tooltip.variants.ts","../src/components/Tooltip/Tooltip.tsx","../src/components/Tooltip/Tooltip.doc.ts","../src/components/CopyButton/clipboard.ts","../src/components/CopyButton/copy-button.variants.ts","../src/components/CopyButton/CopyButton.tsx","../src/components/CopyButton/CopyButton.doc.ts","../src/components/Popover/popover.variants.ts","../src/components/Popover/Popover.tsx","../src/components/Popover/Popover.doc.ts","../src/components/TimePicker/time-picker.variants.ts","../src/components/TimePicker/time-utils.ts","../src/components/TimePicker/TimePicker.tsx","../src/components/DatePicker/date-picker.variants.ts","../src/components/DatePicker/DateTrigger.tsx","../src/components/DatePicker/DatePicker.tsx","../src/components/DatePicker/date-range-presets.ts","../src/components/DatePicker/DateRangePicker.tsx","../src/components/DatePicker/DatePicker.doc.ts","../src/components/NumberInput/number-input.variants.ts","../src/components/NumberInput/NumberInput.tsx","../src/components/NumberInput/NumberInput.doc.ts","../src/components/Select/Select.tsx","../src/components/Select/Select.doc.ts","../src/components/ToggleGroup/toggle-group.variants.ts","../src/components/ToggleGroup/ToggleGroup.tsx","../src/components/ToggleGroup/ToggleGroup.doc.ts","../src/components/DateTimeRangePicker/date-time-range-picker.variants.ts","../src/components/DateTimeRangePicker/time-range.ts","../src/components/DateTimeRangePicker/DateTimeRangePicker.tsx","../src/components/DateTimeRangePicker/DateTimeRangePicker.doc.ts","../src/components/Dialog/Dialog.tsx","../src/components/Dialog/Dialog.doc.ts","../src/components/DiffViewer/diff.ts","../src/components/DiffViewer/diff-view.ts","../src/components/DiffViewer/diff-viewer.variants.ts","../src/components/DiffViewer/DiffViewer.tsx","../src/components/DiffViewer/DiffViewer.doc.ts","../src/components/Drawer/drawer.variants.ts","../src/components/Drawer/Drawer.tsx","../src/components/Drawer/Drawer.doc.ts","../src/components/EmptyState/emptyState.variants.ts","../src/components/EmptyState/EmptyState.tsx","../src/components/EmptyState/EmptyState.doc.ts","../src/components/Field/Field.doc.ts","../src/components/Stack/stack.variants.ts","../src/components/Grid/grid.variants.ts","../src/components/Grid/Grid.tsx","../src/components/Grid/Grid.doc.ts","../src/components/HoverCard/hover-card.variants.ts","../src/components/HoverCard/HoverCard.tsx","../src/components/HoverCard/HoverCard.doc.ts","../src/components/InfoTip/info-tip.variants.ts","../src/components/InfoTip/InfoTip.tsx","../src/components/InfoTip/InfoTip.doc.ts","../src/components/Input/input.variants.ts","../src/components/Input/Input.tsx","../src/components/Input/Input.doc.ts","../src/components/TreeList/tree-model.ts","../src/components/TreeList/tree-list.variants.ts","../src/components/TreeList/useTreeList.ts","../src/components/TreeList/TreeList.tsx","../src/components/JsonViewer/json-model.ts","../src/components/JsonViewer/json-viewer.variants.ts","../src/components/JsonViewer/JsonViewer.tsx","../src/components/JsonViewer/JsonViewer.doc.ts","../src/components/KanbanBoard/kanban-board.variants.ts","../src/components/KanbanBoard/useSortable.ts","../src/components/KanbanBoard/KanbanBoard.tsx","../src/components/KanbanBoard/KanbanBoard.doc.ts","../src/components/PasswordInput/password-strength.ts","../src/components/PasswordInput/password-input.variants.ts","../src/components/PasswordInput/PasswordInput.tsx","../src/components/PasswordInput/PasswordInput.doc.ts","../src/components/Textarea/textarea.variants.ts","../src/components/Textarea/Textarea.tsx","../src/components/Textarea/Textarea.doc.ts","../src/components/KeyValueEditor/key-value.ts","../src/components/KeyValueEditor/key-value-editor.variants.ts","../src/components/KeyValueEditor/KeyValueEditor.tsx","../src/components/KeyValueEditor/KeyValueEditor.doc.ts","../src/components/Lightbox/lightbox.variants.ts","../src/components/Lightbox/Lightbox.tsx","../src/components/Lightbox/Lightbox.doc.ts","../src/components/ListInput/list-input-parse.ts","../src/components/ListInput/list-input.variants.ts","../src/components/ListInput/ListInput.tsx","../src/components/ListInput/ListInput.doc.ts","../src/components/MegaMenu/mega-menu.variants.ts","../src/components/MegaMenu/MegaMenu.tsx","../src/components/MegaMenu/MegaMenu.doc.ts","../src/components/Menu/Menu.tsx","../src/components/Menu/MoreMenu.tsx","../src/components/Menu/Menu.doc.ts","../src/components/Meter/meter.variants.ts","../src/components/Meter/Meter.tsx","../src/components/Meter/Meter.doc.ts","../src/components/NavList/nav-context.ts","../src/components/NavList/nav-list.variants.ts","../src/components/NavList/NavListItem.tsx","../src/components/NavList/NavList.tsx","../src/components/NavList/NavList.doc.ts","../src/components/MobileNav/mobile-nav.variants.ts","../src/components/MobileNav/MobileNav.tsx","../src/components/MobileNav/MobileNav.doc.ts","../src/components/MultiSelect/multi-select.variants.ts","../src/components/MultiSelect/MultiSelect.tsx","../src/components/MultiSelect/MultiSelect.doc.ts","../src/components/NotificationsPopover/notifications-popover.variants.ts","../src/components/NotificationsPopover/relative-time.ts","../src/components/NotificationsPopover/NotificationsPopover.tsx","../src/components/NotificationsPopover/NotificationsPopover.doc.ts","../src/components/OtpInput/otp-input.variants.ts","../src/components/OtpInput/OtpInput.tsx","../src/components/OtpInput/OtpInput.doc.ts","../src/components/OverflowList/overflow-list.variants.ts","../src/components/OverflowList/useFitCount.ts","../src/components/OverflowList/OverflowList.tsx","../src/components/OverflowList/OverflowList.doc.ts","../src/components/Pagination/pageRange.ts","../src/components/Pagination/pagination.variants.ts","../src/components/Pagination/Pagination.tsx","../src/components/Pagination/Pagination.doc.ts","../src/components/CursorPagination/cursor-pagination.variants.ts","../src/components/CursorPagination/CursorPagination.tsx","../src/components/CursorPagination/CursorPagination.doc.ts","../src/components/PermissionMatrix/permission-matrix.variants.ts","../src/components/PermissionMatrix/PermissionMatrix.tsx","../src/components/PermissionMatrix/PermissionMatrix.doc.ts","../src/components/PowerSearch/power-search.variants.ts","../src/components/PowerSearch/PowerSearchChip.tsx","../src/components/PowerSearch/power-search-query.ts","../src/components/PowerSearch/PowerSearch.tsx","../src/components/PowerSearch/PowerSearch.doc.ts","../src/components/Progress/progress.variants.ts","../src/components/Progress/Progress.tsx","../src/components/Progress/Progress.doc.ts","../src/components/QueryBuilder/query.ts","../src/components/QueryBuilder/query-builder.variants.ts","../src/components/QueryBuilder/QueryValueEditor.tsx","../src/components/QueryBuilder/QueryBuilder.tsx","../src/components/QueryBuilder/QueryBuilder.doc.ts","../src/components/RadioGroup/radio-group.variants.ts","../src/components/RadioGroup/RadioGroup.tsx","../src/components/RadioGroup/RadioGroup.doc.ts","../src/components/Resizable/resizable-layout.ts","../src/components/Resizable/resizable.variants.ts","../src/components/Resizable/Resizable.tsx","../src/components/Resizable/Resizable.doc.ts","../src/components/ScheduleInput/cron.ts","../src/components/ScheduleInput/schedule-presets.ts","../src/components/ScheduleInput/schedule-input.variants.ts","../src/components/ScheduleInput/ScheduleInput.tsx","../src/components/ScheduleInput/ScheduleInput.doc.ts","../src/components/ScrollArea/scroll-area.variants.ts","../src/components/ScrollArea/ScrollArea.tsx","../src/components/ScrollArea/ScrollArea.doc.ts","../src/components/Timestamp/format.ts","../src/components/Timestamp/timestamp.variants.ts","../src/components/Timestamp/Timestamp.tsx","../src/components/Timestamp/Timestamp.doc.ts","../src/components/SecretField/secret-mask.ts","../src/components/SecretField/secret-field.variants.ts","../src/components/SecretField/SecretField.tsx","../src/components/SecretField/SecretField.doc.ts","../src/components/Section/section.variants.ts","../src/components/Section/Section.tsx","../src/components/Section/Section.doc.ts","../src/components/Separator/separator.variants.ts","../src/components/Separator/Separator.tsx","../src/components/Separator/Separator.doc.ts","../src/components/Skeleton/skeleton.variants.ts","../src/components/Skeleton/Skeleton.tsx","../src/components/Skeleton/Skeleton.doc.ts","../src/components/Slider/slider.variants.ts","../src/components/Slider/Slider.tsx","../src/components/Slider/Slider.doc.ts","../src/components/Sparkline/sparkline.variants.ts","../src/components/Sparkline/Sparkline.tsx","../src/components/Sparkline/Sparkline.doc.ts","../src/components/SplitButton/split-button.variants.ts","../src/components/SplitButton/SplitButton.tsx","../src/components/SplitButton/SplitButton.doc.ts","../src/components/Stack/Stack.tsx","../src/components/Stack/Stack.doc.ts","../src/components/StatusDot/status-dot.variants.ts","../src/components/StatusDot/StatusDot.tsx","../src/components/StatusDot/StatusDot.doc.ts","../src/components/StatusTag/statusTag.variants.ts","../src/components/StatusTag/StatusTag.tsx","../src/components/StatusTag/StatusTag.doc.ts","../src/components/Stepper/stepper.variants.ts","../src/components/Stepper/Stepper.tsx","../src/components/Stepper/Stepper.doc.ts","../src/components/Switch/switch.variants.ts","../src/components/Switch/Switch.tsx","../src/components/Switch/Switch.doc.ts","../src/components/Table/table.variants.ts","../src/components/Table/Table.tsx","../src/components/Table/Table.doc.ts","../src/components/Tabs/tabs.variants.ts","../src/components/Tabs/Tabs.tsx","../src/components/Tabs/Tabs.doc.ts","../src/components/Terminal/ansi.ts","../src/components/Terminal/buffer.ts","../src/components/Terminal/terminal.variants.ts","../src/components/Terminal/Terminal.tsx","../src/components/Terminal/Terminal.doc.ts","../src/components/Text/text.variants.ts","../src/components/Text/Text.tsx","../src/components/Text/Text.doc.ts","../src/components/ThemeSwitcher/theme-switcher.variants.ts","../src/components/ThemeSwitcher/ThemeSwitcher.tsx","../src/components/ThemeSwitcher/ThemeSwitcher.doc.ts","../src/components/Thumbnail/file-kind.ts","../src/components/Thumbnail/thumbnail.variants.ts","../src/components/Thumbnail/Thumbnail.tsx","../src/components/Thumbnail/Thumbnail.doc.ts","../src/components/TimePicker/TimePicker.doc.ts","../src/components/Timer/format.ts","../src/components/Timer/timer.variants.ts","../src/components/Timer/Timer.tsx","../src/components/Timer/Timer.doc.ts","../src/components/Toast/toast.variants.ts","../src/components/Toast/Toast.tsx","../src/components/Toast/Toast.doc.ts","../src/components/Token/token.variants.ts","../src/components/Token/Token.tsx","../src/components/Token/Token.doc.ts","../src/components/TokenInput/token-input.variants.ts","../src/components/TokenInput/TokenInputChip.tsx","../src/components/TokenInput/TokenInput.tsx","../src/components/TokenInput/TokenInput.doc.ts","../src/components/Toolbar/toolbar.variants.ts","../src/components/Toolbar/Toolbar.tsx","../src/components/Toolbar/Toolbar.doc.ts","../src/components/Tour/tour.variants.ts","../src/components/Tour/Tour.tsx","../src/components/Tour/Tour.doc.ts","../src/components/TransferList/transfer-list.variants.ts","../src/components/TransferList/TransferListPane.tsx","../src/components/TransferList/TransferList.tsx","../src/components/TransferList/TransferList.doc.ts","../src/components/TreeList/TreeList.doc.ts","../src/components/UserMenu/user-menu.variants.ts","../src/components/UserMenu/UserMenu.tsx","../src/components/UserMenu/UserMenu.doc.ts","../src/components/VirtualList/use-virtual-window.ts","../src/components/VirtualList/virtual-list.variants.ts","../src/components/VirtualList/VirtualList.tsx","../src/components/VirtualList/VirtualList.doc.ts","../src/components/VisuallyHidden/visually-hidden.variants.ts","../src/components/VisuallyHidden/VisuallyHidden.tsx","../src/components/VisuallyHidden/VisuallyHidden.doc.ts","../src/components/WorkspaceSwitcher/workspace-switcher.variants.ts","../src/components/WorkspaceSwitcher/parts.tsx","../src/components/WorkspaceSwitcher/WorkspaceSearch.tsx","../src/components/WorkspaceSwitcher/WorkspaceSwitcher.tsx","../src/components/WorkspaceSwitcher/WorkspaceSwitcher.doc.ts","../src/layouts/AuthLayout/auth-layout.variants.ts","../src/layouts/AuthLayout/AuthLayout.tsx","../src/layouts/AuthLayout/AuthLayout.doc.ts","../src/layouts/CanvasLayout/canvas-layout.variants.ts","../src/layouts/CanvasLayout/CanvasLayout.tsx","../src/layouts/CanvasLayout/CanvasLayout.doc.ts","../src/layouts/DocsLayout/docs-layout.variants.ts","../src/layouts/DocsLayout/Outline.tsx","../src/layouts/DocsLayout/DocsLayout.tsx","../src/layouts/DocsLayout/DocsLayout.doc.ts","../src/layouts/InspectorLayout/inspector-layout.variants.ts","../src/layouts/InspectorLayout/use-media-query.ts","../src/layouts/InspectorLayout/InspectorLayout.tsx","../src/layouts/InspectorLayout/InspectorLayout.doc.ts","../src/layouts/Page/page.variants.ts","../src/layouts/Page/Page.tsx","../src/layouts/Page/Page.doc.ts","../src/layouts/PrintLayout/print-layout.variants.ts","../src/layouts/PrintLayout/PrintLayout.tsx","../src/layouts/PrintLayout/PrintLayout.doc.ts","../src/layouts/SettingsLayout/settings-layout.variants.ts","../src/layouts/SettingsLayout/SettingsLayout.tsx","../src/layouts/SettingsLayout/SettingsLayout.doc.ts","../src/layouts/SidebarLayout/sidebar-layout.variants.ts","../src/layouts/SidebarLayout/use-persisted-collapse.ts","../src/layouts/SidebarLayout/SidebarLayout.tsx","../src/layouts/SidebarLayout/SidebarLayout.doc.ts","../src/layouts/SplitLayout/split-layout.variants.ts","../src/layouts/SplitLayout/SplitLayout.tsx","../src/layouts/SplitLayout/SplitLayout.doc.ts","../src/layouts/StackedLayout/stacked-layout.variants.ts","../src/layouts/StackedLayout/StackedLayout.tsx","../src/layouts/StackedLayout/StackedLayout.doc.ts","../src/layouts/StatusLayout/status-layout.variants.ts","../src/layouts/StatusLayout/StatusLayout.tsx","../src/layouts/StatusLayout/StatusLayout.doc.ts","../src/layouts/WizardLayout/WizardOverlayBody.tsx","../src/layouts/WizardLayout/wizard-layout.variants.ts","../src/layouts/WizardLayout/WizardLayout.tsx","../src/layouts/WizardLayout/WizardLayout.doc.ts"],"sourcesContent":["import type { MessageKey, Messages } from './messages/en';\n\n/** Values interpolated into a message: `{name}` placeholders and plural selectors. */\nexport type MessageVars = Record<string, string | number>;\n\n/** Scripts written right to left (language subtag). */\nconst RTL_LANGUAGES = new Set(['ar', 'arc', 'ckb', 'dv', 'fa', 'he', 'iw', 'ks', 'ku', 'ps', 'sd', 'ug', 'ur', 'yi']);\n\n/** `rtl` for Arabic, Hebrew, Persian, Urdu… (by language subtag or Intl text info), else `ltr`. */\nexport function localeDirection(locale: string): 'ltr' | 'rtl' {\n try {\n const loc = new Intl.Locale(locale) as Intl.Locale & {\n getTextInfo?: () => { direction?: string };\n textInfo?: { direction?: string };\n };\n const info = loc.getTextInfo?.() ?? loc.textInfo;\n if (info?.direction === 'rtl' || info?.direction === 'ltr') return info.direction;\n return RTL_LANGUAGES.has(loc.language) ? 'rtl' : 'ltr';\n } catch {\n return RTL_LANGUAGES.has(locale.split(/[-_]/)[0]?.toLowerCase() ?? '') ? 'rtl' : 'ltr';\n }\n}\n\n/** Index of the brace closing the one at `open` (nested braces allowed). */\nfunction matchBrace(text: string, open: number): number {\n let depth = 0;\n for (let i = open; i < text.length; i++) {\n if (text[i] === '{') depth++;\n else if (text[i] === '}' && --depth === 0) return i;\n }\n return -1;\n}\n\n/** `one {# item} other {# items}` → `{ one: '# item', other: '# items' }`. */\nfunction parseBranches(body: string): Record<string, string> {\n const branches: Record<string, string> = {};\n let i = 0;\n while (i < body.length) {\n const open = body.indexOf('{', i);\n if (open < 0) break;\n const name = body.slice(i, open).trim();\n const close = matchBrace(body, open);\n if (close < 0) break;\n branches[name] = body.slice(open + 1, close);\n i = close + 1;\n }\n return branches;\n}\n\n/** Fills `{name}` placeholders and `{count, plural, one {…} other {…}}` selectors. */\nexport function interpolate(template: string, vars: MessageVars | undefined, locale: string): string {\n if (!vars || !template.includes('{')) return template;\n let out = '';\n let i = 0;\n while (i < template.length) {\n const open = template.indexOf('{', i);\n if (open < 0) {\n out += template.slice(i);\n break;\n }\n out += template.slice(i, open);\n const close = matchBrace(template, open);\n if (close < 0) {\n out += template.slice(open);\n break;\n }\n const inner = template.slice(open + 1, close);\n const plural = /^\\s*(\\w+)\\s*,\\s*plural\\s*,(.*)$/s.exec(inner);\n if (plural) {\n const name = plural[1] ?? '';\n const n = Number(vars[name] ?? 0);\n const branches = parseBranches(plural[2] ?? '');\n const rule = new Intl.PluralRules(locale).select(n);\n const branch = branches[`=${n}`] ?? branches[rule] ?? branches.other ?? '';\n out += interpolate(branch.replaceAll('#', new Intl.NumberFormat(locale).format(n)), vars, locale);\n } else {\n const value = vars[inner.trim()];\n out += value === undefined ? `{${inner}}` : String(value);\n }\n i = close + 1;\n }\n return out;\n}\n\nexport type DateValue = Date | number | string;\nconst toDate = (value: DateValue) => (value instanceof Date ? value : new Date(value));\n\nconst RELATIVE_UNITS: [Intl.RelativeTimeFormatUnit, number][] = [\n ['year', 365 * 24 * 3600],\n ['month', 30 * 24 * 3600],\n ['week', 7 * 24 * 3600],\n ['day', 24 * 3600],\n ['hour', 3600],\n ['minute', 60],\n ['second', 1],\n];\n\n/** The translator and Intl formatters for one locale. */\nexport interface I18nFormatters {\n /** Translates a built-in key, filling placeholders. */\n t: (key: MessageKey, vars?: MessageVars) => string;\n formatNumber: (value: number, options?: Intl.NumberFormatOptions) => string;\n formatCurrency: (value: number, currency: string, options?: Intl.NumberFormatOptions) => string;\n formatDate: (value: DateValue, options?: Intl.DateTimeFormatOptions) => string;\n /**\n * Relative time. With a unit, formats `value` in it (\"in 3 days\"); with a date, picks the\n * largest fitting unit against `now` (\"5 minutes ago\").\n */\n formatRelativeTime: {\n (value: number, unit: Intl.RelativeTimeFormatUnit, options?: Intl.RelativeTimeFormatOptions): string;\n (value: Date, now?: Date | number, options?: Intl.RelativeTimeFormatOptions): string;\n };\n formatList: (items: readonly string[], options?: Intl.ListFormatOptions) => string;\n}\n\nexport function createFormatters(locale: string, messages: Messages): I18nFormatters {\n function formatRelativeTime(\n value: number,\n unit: Intl.RelativeTimeFormatUnit,\n options?: Intl.RelativeTimeFormatOptions,\n ): string;\n function formatRelativeTime(value: Date, now?: Date | number, options?: Intl.RelativeTimeFormatOptions): string;\n function formatRelativeTime(\n value: number | Date,\n unitOrNow?: Intl.RelativeTimeFormatUnit | Date | number,\n options: Intl.RelativeTimeFormatOptions = { numeric: 'auto' },\n ): string {\n const rtf = new Intl.RelativeTimeFormat(locale, options);\n if (typeof value === 'number' && typeof unitOrNow === 'string') return rtf.format(value, unitOrNow);\n const now =\n unitOrNow instanceof Date ? unitOrNow.getTime() : typeof unitOrNow === 'number' ? unitOrNow : Date.now();\n const seconds = Math.round((toDate(value).getTime() - now) / 1000);\n const [unit, size] = RELATIVE_UNITS.find(([, s]) => Math.abs(seconds) >= s) ?? ['second', 1];\n return rtf.format(Math.round(seconds / size), unit);\n }\n return {\n t: (key, vars) => interpolate(messages[key] ?? key, vars, locale),\n formatNumber: (value, options) => new Intl.NumberFormat(locale, options).format(value),\n formatCurrency: (value, currency, options) =>\n new Intl.NumberFormat(locale, { style: 'currency', currency, ...options }).format(value),\n formatDate: (value, options = { dateStyle: 'medium' }) =>\n new Intl.DateTimeFormat(locale, options).format(toDate(value)),\n formatRelativeTime,\n formatList: (items, options = { style: 'long', type: 'conjunction' }) =>\n new Intl.ListFormat(locale, options).format(items),\n };\n}\n","/**\n * Built-in English catalog: every string the kit renders on its own (labels, accessible names,\n * announcements). It is the source of the message keys; other catalogs must cover every key.\n *\n * Placeholders: `{name}`. Plurals (Intl.PluralRules): `{count, plural, one {# item} other {# items}}`.\n * Month and weekday names, numbers and dates come from Intl, not from this catalog.\n */\nexport const en = {\n // Generic actions and states\n 'common.close': 'Close',\n 'common.dismiss': 'Dismiss',\n 'common.copy': 'Copy',\n 'common.copied': 'Copied',\n 'common.copiedToClipboard': 'Copied to clipboard',\n 'common.copyFailed': 'Copy failed',\n 'common.clear': 'Clear',\n 'common.clearAll': 'Clear all',\n 'common.clearSelection': 'Clear selection',\n 'common.search': 'Search',\n 'common.searchPlaceholder': 'Search…',\n 'common.loading': 'Loading…',\n 'common.noResults': 'No results',\n 'common.noMatches': 'No matches.',\n 'common.selectPlaceholder': 'Select…',\n 'common.selectAll': 'Select all',\n 'common.deselectAll': 'Deselect all',\n 'common.showOptions': 'Show options',\n 'common.remove': 'Remove',\n 'common.removeItem': 'Remove {label}',\n 'common.removed': 'Removed {label}.',\n 'common.back': 'Back',\n 'common.next': 'Next',\n 'common.previous': 'Previous',\n 'common.finish': 'Finish',\n 'common.exit': 'Exit',\n 'common.cancel': 'Cancel',\n 'common.save': 'Save',\n 'common.send': 'Send',\n 'common.stop': 'Stop',\n 'common.retry': 'Retry',\n 'common.edit': 'Edit',\n 'common.delete': 'Delete',\n 'common.filter': 'Filter',\n 'common.sort': 'Sort',\n 'common.viewAll': 'View all',\n 'common.moreActions': 'More actions',\n 'common.openMenu': 'Open menu',\n 'common.more': '{count} more',\n 'common.moreInfo': 'More information about {label}',\n 'common.fieldInvalid': 'Field invalid',\n 'common.invalid': 'invalid: {error}',\n 'common.resize': 'Resize',\n 'common.progress': 'Progress',\n 'common.main': 'Main',\n 'common.settings': 'Settings',\n 'common.notifications': 'Notifications',\n 'common.unread': 'Unread:',\n 'common.results': '{count, plural, one {# result} other {# results}}',\n 'common.trend': 'Trend',\n // Skip links and landmarks\n 'skip.main': 'Skip to main content',\n 'skip.content': 'Skip to content',\n 'skip.canvas': 'Skip to canvas',\n 'skip.document': 'Skip to document',\n 'skip.signIn': 'Skip to sign-in form',\n 'skip.step': 'Skip to step',\n 'nav.navigation': 'Navigation',\n 'nav.openNavigation': 'Open navigation',\n 'nav.closeNavigation': 'Close navigation',\n 'nav.sidebar': 'Sidebar',\n 'nav.expandSidebar': 'Expand sidebar',\n 'nav.collapseSidebar': 'Collapse sidebar',\n 'nav.onThisPage': 'On this page',\n 'nav.pageActions': 'Page actions',\n // Breadcrumbs and pagination\n 'breadcrumbs.label': 'Breadcrumb',\n 'breadcrumbs.expand': '{count, plural, one {Show # more level} other {Show # more levels}}',\n 'pagination.label': 'Pagination',\n 'pagination.previous': 'Previous page',\n 'pagination.next': 'Next page',\n 'pagination.page': 'Page {page}',\n 'pagination.of': 'of',\n // Dates\n 'calendar.label': 'Calendar',\n 'calendar.previousMonth': 'Previous month',\n 'calendar.nextMonth': 'Next month',\n 'calendar.today': 'Today',\n 'datePicker.placeholder': 'Pick a date',\n 'datePicker.rangePlaceholder': 'Pick a date range',\n 'datePicker.choose': 'Choose date',\n 'datePicker.chooseRange': 'Choose date range',\n 'datePicker.presets': 'Presets',\n // Inputs\n 'numberInput.decrease': 'Decrease',\n 'numberInput.increase': 'Increase',\n 'otp.character': 'Character {index} of {total}',\n 'password.show': 'Show password',\n 'password.hide': 'Hide password',\n 'password.strength': 'Strength:',\n 'password.tooWeak': 'Too weak',\n 'password.weak': 'Weak',\n 'password.fair': 'Fair',\n 'password.good': 'Good',\n 'password.strong': 'Strong',\n 'multiSelect.moreSelected': 'more selected',\n 'tokenInput.entries': 'Entries',\n 'link.external': '(opens in a new tab)',\n // Overlays and menus\n 'toast.region': 'Notifications',\n 'toast.dismiss': 'Dismiss notification',\n 'theme.label': 'Theme',\n 'theme.light': 'Light',\n 'theme.dark': 'Dark',\n 'theme.highContrast': 'High contrast',\n 'theme.system': 'System',\n 'userMenu.label': 'Account menu for {name}',\n 'userMenu.signOut': 'Sign out',\n 'notifications.markAllRead': 'Mark all as read',\n 'notifications.empty': 'New notifications will show up here.',\n 'workspace.switch': 'Switch workspace',\n 'workspace.create': 'Create workspace',\n 'workspace.search': 'Find a workspace…',\n 'workspace.empty': 'No workspaces match.',\n 'commandPalette.label': 'Command palette',\n 'commandPalette.placeholder': 'Type a command or search…',\n 'commandPalette.recent': 'Recent',\n 'commandPalette.trigger': 'Search or run a command',\n 'commandPalette.navigate': 'navigate',\n 'commandPalette.run': 'run',\n 'commandPalette.close': 'close',\n 'theme.cycle': 'Theme: {current}. Switch to {next}',\n 'notifications.trigger': '{title}, {count} unread',\n 'notifications.new': '{count} new',\n 'notifications.emptyTitle': \"You're all caught up\",\n 'tokenInput.added': 'Added {items}.',\n 'tokenInput.limit': 'Limit of {max} reached.',\n 'avatar.more': 'more',\n // Data display\n 'statusTimeline.label': 'Status history',\n 'statusTimeline.empty': 'No status history',\n 'statusTimeline.showFewer': 'Show fewer',\n 'statusTimeline.showEarlier': 'Show {count} earlier {count, plural, one {event} other {events}}',\n 'statusTimeline.actor': 'by',\n 'stepper.step': 'Step {step} of {total}',\n 'stepper.complete': 'completed',\n 'stepper.current': 'current step',\n 'stepper.upcoming': 'not started',\n 'stepper.error': 'error',\n 'sparkline.noData': '{label}: no data',\n 'sparkline.single': '{label}: {value}',\n 'sparkline.summary':\n '{label}: {direction}{change} from {first} to {last} over {count} points (low {min}, high {max})',\n 'sparkline.up': 'trending up',\n 'sparkline.down': 'trending down',\n 'sparkline.flat': 'flat',\n 'table.scrollable': 'Scrollable table',\n 'codeBlock.code': 'Code',\n 'codeBlock.languageCode': '{language} code',\n 'codeBlock.wrap': 'Wrap lines',\n 'kbd.command': 'Command',\n 'kbd.option': 'Option',\n 'kbd.shift': 'Shift',\n 'kbd.control': 'Control',\n 'kbd.enter': 'Enter',\n 'kbd.backspace': 'Backspace',\n 'kbd.tab': 'Tab',\n 'kbd.escape': 'Escape',\n 'kbd.up': 'Up arrow',\n 'kbd.down': 'Down arrow',\n 'kbd.left': 'Left arrow',\n 'kbd.right': 'Right arrow',\n 'kbd.upDown': 'Up and down arrows',\n // Layouts\n 'settings.section': 'Settings section',\n 'wizard.exitTitle': 'Leave this setup?',\n 'wizard.exitDescription': 'Your progress on this step will be lost.',\n 'wizard.leave': 'Leave',\n 'wizard.progressSummary': '{label} summary',\n 'wizard.stepAnnouncement': 'Step {position} of {total}: {label}',\n 'wizard.finishing': 'Finishing…',\n 'wizard.title': 'Create resource',\n 'wizard.details': 'Details',\n 'wizard.review': 'Review',\n 'wizard.stay': 'Stay',\n 'canvas.palette': 'Palette',\n 'canvas.inspector': 'Inspector',\n 'canvas.console': 'Console',\n 'canvas.main': 'Canvas',\n 'canvas.smallScreen': 'Open on a larger screen to edit. The canvas is read-only here.',\n 'print.pageBreak': 'Page break',\n 'split.list': 'List',\n 'split.details': 'Details',\n 'inspector.pin': 'Pin panel',\n 'inspector.close': 'Close panel',\n 'inspector.toggle': 'Toggle panel',\n // Blocks: tables, filters, page chrome, scheduling, feedback, forms\n 'calendar.tomorrow': 'Tomorrow',\n 'calendar.previousWeek': 'Previous week',\n 'calendar.nextWeek': 'Next week',\n 'calendar.now': 'now',\n 'calendar.unavailable': '(unavailable)',\n 'calendar.availableTimes': 'Available times',\n 'calendar.agenda': 'Agenda',\n 'calendar.emptyTitle': 'Nothing scheduled',\n 'calendar.emptyDescription': 'There is no scheduled work in this period.',\n 'table.loadMore': 'Load more',\n 'table.loadingMore': 'Loading…',\n 'table.loadMoreGroup': 'Load more items',\n 'table.moreAvailable': 'More items available.',\n 'table.loadedSummary': '{count, plural, one {# item loaded} other {# items loaded}}',\n 'table.loadedAnnouncement': '{count, plural, one {# item added.} other {# items added.}}',\n 'table.rows': 'Rows',\n 'table.collectionNoun': '{count, plural, one {item} other {items}}',\n 'table.visibleCount': '{noun}:',\n 'table.truncatedNote':\n '{count, plural, one {Only the first {formattedCount} {noun} is shown; more exist.} other {Only the first {formattedCount} {noun} are shown; more exist.}}',\n 'table.rowsPerPage': 'Rows per page',\n 'table.pagination': '{noun} pagination',\n 'table.selectAllPage': 'Select all rows on this page',\n 'table.selectRow': 'Select {label}',\n 'table.selection': 'Selection',\n 'table.actions': 'Actions',\n 'table.rowActions': 'Actions for {label}',\n 'table.emptyDescription': 'Nothing matches the current filters.',\n 'table.columns': 'Columns',\n 'table.visibleColumns': 'Visible columns',\n 'table.density': 'Row density',\n 'table.comfortable': 'Comfortable rows',\n 'table.compact': 'Compact rows',\n 'table.editRow': 'Edit {label}',\n 'filters.label': 'Filters',\n 'filters.savedView': 'Saved view',\n 'filters.savedViews': 'Saved views',\n 'filters.add': 'Add filter',\n 'filters.active': 'Active filters',\n 'filters.remove': 'Remove filter {field}: {value}',\n 'loading.table': 'Loading table',\n 'loading.list': 'Loading list',\n 'loading.page': 'Loading page',\n 'bulk.label': 'Bulk actions',\n 'bulk.of': 'of {total}',\n 'bulk.selected': '{count, plural, other {selected}}',\n 'bulk.item': 'item',\n 'bulk.items': 'items',\n 'actionBar.unsaved': 'You have unsaved changes',\n 'actionBar.saved': 'All changes saved',\n 'actionBar.save': 'Save changes',\n 'actionBar.discard': 'Discard',\n 'actionBar.saving': 'Saving…',\n 'toolbar.label': 'Page toolbar',\n 'toolbar.view': 'View',\n 'globalSearch.label': 'Global search',\n 'globalSearch.placeholder': 'Search pages, records and actions…',\n 'globalSearch.pages': 'Pages',\n 'globalSearch.records': 'Records',\n 'globalSearch.actions': 'Actions',\n 'error.retry': 'Try again',\n 'error.retrying': 'Retrying…',\n 'error.retryingStatus': 'Retrying',\n 'error.requestId': 'Request ID',\n 'error.copyRequestId': 'Copy request ID',\n 'error.requestIdCopied': 'Request ID copied',\n 'error.details': 'Technical details',\n 'dateRange.label': 'Date range',\n 'dateRange.any': 'Any date',\n 'common.clearItem': 'Clear {label}',\n 'upload.label': 'Upload files',\n 'upload.files': 'Files',\n 'upload.failed': 'Upload failed',\n 'upload.typeRejected': 'File type not accepted',\n 'upload.tooLarge': 'Exceeds the {size} limit',\n 'upload.drop': 'Drag files here or',\n 'upload.uploading': 'Uploading {name}',\n 'upload.notUploaded': '{error} · not uploaded',\n 'upload.uploaded': '{size} · uploaded',\n 'upload.retry': 'Retry {name}',\n 'upload.browse': 'Browse files',\n 'upload.hint': '{types} · max {size} per file',\n 'upload.done': '{name} uploaded.',\n 'upload.error': '{name} failed to upload.',\n 'upload.added': '{count, plural, one {# file added.} other {# files added.}}',\n 'upload.rejected': '{count} rejected.',\n 'upload.removed': '{name} removed.',\n 'comments.label': 'Comments',\n 'comments.placeholder': 'Add a comment…',\n 'comments.submit': 'Comment',\n 'comments.write': 'Write a comment',\n 'calendar.events': '{count, plural, one {# event} other {# events}}',\n 'common.expandItem': 'Expand {label}',\n 'common.collapseItem': 'Collapse {label}',\n // Kanban board\n 'kanban.label': 'Board',\n 'kanban.roleDescription': 'draggable card',\n 'kanban.instructions':\n 'Press Space to pick up the card. Use the arrow keys to move it, Space or Enter to drop it, Escape to cancel.',\n 'kanban.pickedUp': 'Picked up {card}. Position {position} of {total} in {column}.',\n 'kanban.moved': '{card} moved to position {position} of {total} in {column}.',\n 'kanban.dropped': '{card} dropped at position {position} of {total} in {column}.',\n 'kanban.cancelled': 'Move cancelled. {card} returned to {column}.',\n 'kanban.empty': 'No cards',\n 'kanban.cards': '{count, plural, one {# card} other {# cards}}',\n // Chat\n 'chat.messageLabel': 'Message',\n 'chat.placeholder': 'Message the assistant…',\n 'chat.send': 'Send message',\n 'chat.stop': 'Stop generating',\n 'chat.attach': 'Attach files',\n 'chat.attachments': 'Attachments',\n 'chat.hintSend': 'to send',\n 'chat.hintNewLine': 'for a new line',\n 'chat.shiftEnter': 'Shift + Enter',\n 'chat.overLimit': 'characters, over the limit',\n 'chat.conversation': 'Conversation',\n 'chat.messages': 'Messages',\n 'chat.details': 'Details',\n 'chat.resizePanel': 'Resize {panel} panel',\n 'chat.scrollToBottom': 'Scroll to latest message',\n 'chat.suggestions': 'Suggested prompts',\n 'chat.sources': 'Sources',\n 'chat.source': 'Source {index}: {title}',\n 'chat.you': 'You',\n 'chat.assistant': 'Assistant',\n 'chat.system': 'System',\n 'chat.tool': 'Tool',\n 'chat.participant': 'Participant',\n 'chat.responding': '{author} is responding…',\n 'chat.actionsFor': 'Actions for {name} message',\n 'chat.copyMessage': 'Copy message',\n 'chat.copyCode': 'Copy code',\n 'chat.copiedCode': 'Copied code',\n 'chat.goodResponse': 'Good response',\n 'chat.badResponse': 'Bad response',\n 'chat.taskDone': 'Done',\n 'chat.taskNotDone': 'Not done',\n 'chat.image': 'Image: {alt}',\n 'chat.untitled': 'untitled',\n 'chat.openSource': 'Open source',\n 'toolCall.calling': 'Calling',\n 'toolCall.called': 'Called',\n 'toolCall.failed': 'Failed to call',\n 'toolCall.arguments': 'Arguments',\n 'toolCall.result': 'Result',\n 'toolCall.waiting': 'Waiting for the result…',\n 'chat.typing': '{author} is typing',\n 'chat.feedback': 'Response feedback',\n 'chat.feedbackTitle': 'What went wrong?',\n 'chat.feedbackReason': 'Reason',\n 'chat.feedbackComment': 'Comment (optional)',\n 'chat.feedbackPlaceholder': 'Tell us more…',\n 'chat.feedbackSubmit': 'Send feedback',\n 'chat.feedbackThanks': 'Thanks for your feedback',\n 'chat.feedbackCleared': 'Feedback removed',\n 'chat.reasonInaccurate': 'Inaccurate',\n 'chat.reasonUnhelpful': 'Not helpful',\n 'chat.reasonIncomplete': 'Incomplete',\n 'chat.reasonUnsafe': 'Harmful or unsafe',\n 'chat.reasonOther': 'Other',\n 'chat.regenerate': 'Regenerate',\n 'chat.uploading': 'Uploading {name}',\n 'chat.uploadFailed': 'Upload failed',\n 'chat.retryUpload': 'Retry uploading {name}',\n 'chat.dropFiles': 'Drop files to attach',\n 'chat.fileTooLarge': '{name} is larger than {max}',\n 'chat.fileTypeNotAllowed': '{name} is not an allowed file type',\n 'chat.tooManyFiles': 'You can attach up to {max} files',\n 'chat.model': 'Model',\n 'chat.selectModel': 'Select a model',\n 'chat.capabilityVision': 'Vision',\n 'chat.capabilityTools': 'Tools',\n 'chat.capabilityReasoning': 'Reasoning',\n 'chat.capabilityFiles': 'Files',\n 'chat.capabilityWeb': 'Web search',\n 'chat.capabilityAudio': 'Audio',\n 'chat.contextWindow': '{size} context',\n 'chat.unavailable': 'Unavailable',\n // Credential disclosure dialog\n 'credentialDisclosure.title': 'Credential secret',\n 'credentialDisclosure.description': 'Copy this value and store it securely.',\n 'credentialDisclosure.credentialId': 'Credential ID',\n 'credentialDisclosure.expiry': 'Expires',\n 'credentialDisclosure.secret': 'Secret',\n 'credentialDisclosure.show': 'Show secret',\n 'credentialDisclosure.hide': 'Hide secret',\n 'credentialDisclosure.copy': 'Copy secret',\n 'credentialDisclosure.copied': 'Copied',\n 'credentialDisclosure.success': 'Secret copied to clipboard',\n 'credentialDisclosure.failure': 'Copy failed. Select and copy the value manually.',\n 'credentialDisclosure.close': 'Close',\n 'credentialDisclosure.warningTitle': 'Save this new secret',\n 'credentialDisclosure.warningText': 'This value replaces the previous secret. Copy it now; it is shown only once.',\n // Batch A: CopyButton, SplitButton, SecretField, KeyValueEditor, DiffViewer\n 'splitButton.more': 'More options',\n 'secret.show': 'Show secret',\n 'secret.hide': 'Hide secret',\n 'secret.copy': 'Copy secret',\n 'secret.copied': 'Secret copied to clipboard',\n 'secret.hidden': 'Value hidden',\n 'secret.rotate': 'Rotate',\n 'secret.rotateTitle': 'Rotate this secret?',\n 'secret.rotateDescription':\n 'A new value is generated and the current one stops working. Anything still using it fails until it is updated.',\n 'secret.rotateConfirm': 'Rotate secret',\n 'secret.rotated': 'Secret rotated',\n 'secret.rotateFailed': 'Rotation failed',\n 'secret.created': 'Created',\n 'secret.lastUsed': 'Last used',\n 'secret.neverUsed': 'Never used',\n 'kv.key': 'Key',\n 'kv.value': 'Value',\n 'kv.keyRow': 'Key, row {row}',\n 'kv.valueRow': 'Value, row {row}',\n 'kv.secretRow': 'Secret value, row {row}',\n 'kv.removeRow': 'Remove row {row}',\n 'kv.rowRemoved': 'Row removed',\n 'kv.add': 'Add variable',\n 'kv.empty': 'No variables yet.',\n 'kv.paste': 'Paste .env',\n 'kv.pasteLabel': '.env contents',\n 'kv.pasteHint': 'One KEY=value per line. Lines starting with # are ignored; existing keys are updated.',\n 'kv.import': 'Add variables',\n 'kv.imported': '{count, plural, one {# variable imported} other {# variables imported}}',\n 'kv.copyEnv': 'Copy as .env',\n 'kv.errDuplicate': 'Duplicate key',\n 'kv.errPattern': 'Use letters, digits and underscores, not starting with a digit',\n 'kv.errKeyRequired': 'Key is required',\n 'kv.errValueRequired': 'Value is required',\n 'diff.label': 'Diff',\n 'diff.view': 'Diff view',\n 'diff.split': 'Split',\n 'diff.unified': 'Unified',\n 'diff.addedLine': 'Added line {line}:',\n 'diff.removedLine': 'Removed line {line}:',\n 'diff.additions': '{count, plural, one {# addition} other {# additions}}',\n 'diff.deletions': '{count, plural, one {# deletion} other {# deletions}}',\n 'diff.expand': '{count, plural, one {Expand # line} other {Expand # lines}}',\n 'diff.noChanges': 'No changes',\n 'diff.old': 'Old',\n 'diff.new': 'New',\n // Batch C: async combobox, terminal\n 'combobox.create': 'Create “{label}”',\n 'combobox.loadFailed': 'Couldn’t load options.',\n 'terminal.label': 'Terminal output',\n 'terminal.toolbar': 'Terminal actions',\n 'terminal.jumpToLatest': 'Jump to latest',\n 'terminal.newLines': '{count, plural, one {# new line} other {# new lines}}',\n 'terminal.wrap': 'Wrap lines',\n 'terminal.copyAll': 'Copy all',\n 'terminal.search': 'Search output',\n 'terminal.matches': '{current} of {total}',\n 'terminal.noMatches': 'No matches',\n 'terminal.nextMatch': 'Next match',\n 'terminal.previousMatch': 'Previous match',\n // TimePicker, DatePicker withTime, DateTimeRangePicker, PermissionMatrix, QueryBuilder, ScheduleInput (cron)\n 'timePicker.label': 'Time',\n 'timePicker.hours': 'Hours',\n 'timePicker.minutes': 'Minutes',\n 'timePicker.seconds': 'Seconds',\n 'timePicker.period': 'AM/PM',\n 'timePicker.empty': 'Empty',\n 'datePicker.time': 'Time',\n 'datePicker.done': 'Done',\n 'datePicker.dateTimePlaceholder': 'Pick a date and time',\n 'timeRange.placeholder': 'Pick a time range',\n 'timeRange.choose': 'Choose time range',\n 'timeRange.presets': 'Quick ranges',\n 'timeRange.lastMinutes': 'Last {count, plural, one {minute} other {# minutes}}',\n 'timeRange.lastHours': 'Last {count, plural, one {hour} other {# hours}}',\n 'timeRange.lastDays': 'Last {count, plural, one {day} other {# days}}',\n 'timeRange.custom': 'Custom range',\n 'timeRange.mode': 'Range type',\n 'timeRange.relative': 'Relative',\n 'timeRange.absolute': 'Absolute',\n 'timeRange.last': 'Last',\n 'timeRange.amount': 'Amount',\n 'timeRange.unit': 'Unit',\n 'timeRange.minutes': 'Minutes',\n 'timeRange.hours': 'Hours',\n 'timeRange.days': 'Days',\n 'timeRange.start': 'Start',\n 'timeRange.end': 'End',\n 'timeRange.startTime': 'Start time',\n 'timeRange.endTime': 'End time',\n 'timeRange.apply': 'Apply',\n 'timeRange.endBeforeStart': 'The end must be after the start.',\n 'timeRange.incomplete': 'Pick a start and an end.',\n 'permissionMatrix.label': 'Permissions',\n 'permissionMatrix.permission': 'Permission',\n 'permissionMatrix.allowed': 'Allowed',\n 'permissionMatrix.denied': 'Denied',\n 'permissionMatrix.inherited': 'Inherited',\n 'permissionMatrix.inheritedAs': 'Inherited ({state})',\n 'permissionMatrix.cell': '{permission}, {role}: {state}',\n 'permissionMatrix.readOnly': 'Read-only',\n 'permissionMatrix.readOnlyRole': '{role} permissions cannot be changed.',\n 'queryBuilder.label': 'Query',\n 'queryBuilder.group': 'Condition group',\n 'queryBuilder.combinator': 'Combine conditions with',\n 'queryBuilder.and': 'AND',\n 'queryBuilder.or': 'OR',\n 'queryBuilder.condition': 'Condition {index}',\n 'queryBuilder.field': 'Field',\n 'queryBuilder.operator': 'Operator',\n 'queryBuilder.value': 'Value',\n 'queryBuilder.valueFrom': 'From',\n 'queryBuilder.valueTo': 'To',\n 'queryBuilder.addCondition': 'Add condition',\n 'queryBuilder.addGroup': 'Add group',\n 'queryBuilder.removeCondition': 'Remove condition {index}',\n 'queryBuilder.removeGroup': 'Remove group',\n 'queryBuilder.empty': 'No conditions: every record matches.',\n 'queryBuilder.true': 'true',\n 'queryBuilder.false': 'false',\n 'queryBuilder.between': '{from} and {to}',\n 'queryBuilder.op.eq': 'is',\n 'queryBuilder.op.neq': 'is not',\n 'queryBuilder.op.contains': 'contains',\n 'queryBuilder.op.notContains': 'does not contain',\n 'queryBuilder.op.startsWith': 'starts with',\n 'queryBuilder.op.endsWith': 'ends with',\n 'queryBuilder.op.gt': 'greater than',\n 'queryBuilder.op.gte': 'at least',\n 'queryBuilder.op.lt': 'less than',\n 'queryBuilder.op.lte': 'at most',\n 'queryBuilder.op.between': 'is between',\n 'queryBuilder.op.in': 'is any of',\n 'queryBuilder.op.notIn': 'is none of',\n 'queryBuilder.op.before': 'is before',\n 'queryBuilder.op.after': 'is after',\n 'queryBuilder.op.isEmpty': 'is empty',\n 'queryBuilder.op.isNotEmpty': 'is not empty',\n 'queryBuilder.op.isTrue': 'is true',\n 'queryBuilder.op.isFalse': 'is false',\n 'scheduleInput.label': 'Schedule',\n 'scheduleInput.frequency': 'Frequency',\n 'scheduleInput.hourly': 'Hourly',\n 'scheduleInput.daily': 'Daily',\n 'scheduleInput.weekly': 'Weekly',\n 'scheduleInput.monthly': 'Monthly',\n 'scheduleInput.custom': 'Custom',\n 'scheduleInput.atMinute': 'At minute',\n 'scheduleInput.atTime': 'At',\n 'scheduleInput.onDays': 'On',\n 'scheduleInput.dayOfMonth': 'Day of month',\n 'scheduleInput.expression': 'Cron expression',\n 'scheduleInput.expressionHint': 'minute hour day-of-month month day-of-week',\n 'scheduleInput.nextRuns': 'Next runs ({timeZone})',\n 'scheduleInput.noRuns': 'No upcoming runs.',\n 'scheduleInput.localTime': 'local time',\n 'cron.error.empty': 'Enter a cron expression.',\n 'cron.error.fieldCount': 'Expected 5 fields (minute hour day month weekday), found {count}.',\n 'cron.error.invalid': 'Invalid {field} value “{value}”.',\n 'cron.error.range': '{field} value “{value}” is outside {min}–{max}.',\n 'cron.error.step': 'Invalid step “{value}” in {field}.',\n 'cron.error.macro': 'Unsupported macro “{value}”.',\n 'cron.field.minute': 'minute',\n 'cron.field.hour': 'hour',\n 'cron.field.dayOfMonth': 'day of month',\n 'cron.field.month': 'month',\n 'cron.field.dayOfWeek': 'day of week',\n 'cron.everyMinute': 'Every minute',\n 'cron.everyNMinutes': 'Every {count, plural, one {minute} other {# minutes}}',\n 'cron.everyHour': 'Every hour',\n 'cron.everyHourAt': 'Every hour at {count, plural, one {minute} other {minutes}} {minutes}',\n 'cron.everyNHours': 'Every {count, plural, one {hour} other {# hours}}',\n 'cron.everyNHoursAt': 'Every {count, plural, one {hour} other {# hours}} at minute {minute}',\n 'cron.minutesPast': 'At {count, plural, one {minute} other {minutes}} {minutes} past the hour',\n 'cron.at': 'At {times}',\n 'cron.dailyAt': 'Every day at {times}',\n 'cron.weekdaysAt': 'Every weekday at {times}',\n 'cron.weeklyAt': 'Every {days} at {times}',\n 'cron.monthlyAt': 'Monthly on {count, plural, one {day} other {days}} {days} at {times}',\n 'cron.betweenHours': 'between {start} and {end}',\n 'cron.duringHours': 'during {count, plural, one {hour} other {hours}} {hours}',\n 'cron.onWeekdays': 'on weekdays',\n 'cron.onDays': 'on {days}',\n 'cron.onDaysOfMonth': 'on {count, plural, one {day} other {days}} {days} of the month',\n 'cron.or': '{a} or {b}',\n 'cron.inMonths': 'in {months}',\n 'cron.join': '{base}, {part}',\n} as const;\n\n/** Every built-in message key. */\nexport type MessageKey = keyof typeof en;\n/** A complete catalog: one string per built-in key. */\nexport type Messages = Record<MessageKey, string>;\n","import type { Messages } from './en';\n\n/** Built-in Spanish catalog. */\nexport const es: Messages = {\n 'statusTimeline.label': 'Historial de estado',\n 'statusTimeline.empty': 'Sin historial de estado',\n 'statusTimeline.showFewer': 'Ver menos',\n 'statusTimeline.showEarlier': 'Ver {count} {count, plural, one {cambio anterior} other {cambios anteriores}}',\n 'statusTimeline.actor': 'por',\n 'common.close': 'Cerrar',\n 'common.dismiss': 'Descartar',\n 'common.copy': 'Copiar',\n 'common.copied': 'Copiado',\n 'common.copiedToClipboard': 'Copiado al portapapeles',\n 'common.copyFailed': 'No se pudo copiar',\n 'common.clear': 'Borrar',\n 'common.clearAll': 'Borrar todo',\n 'common.clearSelection': 'Borrar selección',\n 'common.search': 'Buscar',\n 'common.searchPlaceholder': 'Buscar…',\n 'common.loading': 'Cargando…',\n 'common.noResults': 'Sin resultados',\n 'common.noMatches': 'Sin coincidencias.',\n 'common.selectPlaceholder': 'Seleccionar…',\n 'common.selectAll': 'Seleccionar todo',\n 'common.deselectAll': 'Deseleccionar todo',\n 'common.showOptions': 'Mostrar opciones',\n 'common.remove': 'Quitar',\n 'common.removeItem': 'Quitar {label}',\n 'common.removed': 'Se quitó {label}.',\n 'common.back': 'Atrás',\n 'common.next': 'Siguiente',\n 'common.previous': 'Anterior',\n 'common.finish': 'Finalizar',\n 'common.exit': 'Salir',\n 'common.cancel': 'Cancelar',\n 'common.save': 'Guardar',\n 'common.send': 'Enviar',\n 'common.stop': 'Detener',\n 'common.retry': 'Reintentar',\n 'common.edit': 'Editar',\n 'common.delete': 'Eliminar',\n 'common.filter': 'Filtrar',\n 'common.sort': 'Ordenar',\n 'common.viewAll': 'Ver todo',\n 'common.moreActions': 'Más acciones',\n 'common.openMenu': 'Abrir menú',\n 'common.more': '{count} más',\n 'common.moreInfo': 'Más información sobre {label}',\n 'common.fieldInvalid': 'Campo no válido',\n 'common.invalid': 'no válido: {error}',\n 'common.resize': 'Redimensionar',\n 'common.progress': 'Progreso',\n 'common.main': 'Principal',\n 'common.settings': 'Configuración',\n 'common.notifications': 'Notificaciones',\n 'common.unread': 'No leída:',\n 'common.results': '{count, plural, one {# resultado} other {# resultados}}',\n 'common.trend': 'Tendencia',\n 'skip.main': 'Saltar al contenido principal',\n 'skip.content': 'Saltar al contenido',\n 'skip.canvas': 'Saltar al lienzo',\n 'skip.document': 'Saltar al documento',\n 'skip.signIn': 'Saltar al formulario de acceso',\n 'skip.step': 'Saltar al paso',\n 'nav.navigation': 'Navegación',\n 'nav.openNavigation': 'Abrir navegación',\n 'nav.closeNavigation': 'Cerrar navegación',\n 'nav.sidebar': 'Barra lateral',\n 'nav.expandSidebar': 'Expandir barra lateral',\n 'nav.collapseSidebar': 'Contraer barra lateral',\n 'nav.onThisPage': 'En esta página',\n 'nav.pageActions': 'Acciones de la página',\n 'breadcrumbs.label': 'Ruta de navegación',\n 'breadcrumbs.expand': '{count, plural, one {Mostrar # nivel más} other {Mostrar # niveles más}}',\n 'pagination.label': 'Paginación',\n 'pagination.previous': 'Página anterior',\n 'pagination.next': 'Página siguiente',\n 'pagination.page': 'Página {page}',\n 'pagination.of': 'de',\n 'calendar.label': 'Calendario',\n 'calendar.previousMonth': 'Mes anterior',\n 'calendar.nextMonth': 'Mes siguiente',\n 'calendar.today': 'Hoy',\n 'datePicker.placeholder': 'Elige una fecha',\n 'datePicker.rangePlaceholder': 'Elige un rango de fechas',\n 'datePicker.choose': 'Elegir fecha',\n 'datePicker.chooseRange': 'Elegir rango de fechas',\n 'datePicker.presets': 'Rangos predefinidos',\n 'numberInput.decrease': 'Disminuir',\n 'numberInput.increase': 'Aumentar',\n 'otp.character': 'Carácter {index} de {total}',\n 'password.show': 'Mostrar contraseña',\n 'password.hide': 'Ocultar contraseña',\n 'password.strength': 'Seguridad:',\n 'password.tooWeak': 'Muy débil',\n 'password.weak': 'Débil',\n 'password.fair': 'Aceptable',\n 'password.good': 'Buena',\n 'password.strong': 'Fuerte',\n 'multiSelect.moreSelected': 'más seleccionados',\n 'tokenInput.entries': 'Entradas',\n 'link.external': '(se abre en una pestaña nueva)',\n 'toast.region': 'Notificaciones',\n 'toast.dismiss': 'Descartar notificación',\n 'theme.label': 'Tema',\n 'theme.light': 'Claro',\n 'theme.dark': 'Oscuro',\n 'theme.highContrast': 'Alto contraste',\n 'theme.system': 'Sistema',\n 'userMenu.label': 'Menú de la cuenta de {name}',\n 'userMenu.signOut': 'Cerrar sesión',\n 'notifications.markAllRead': 'Marcar todas como leídas',\n 'notifications.empty': 'Las notificaciones nuevas aparecerán aquí.',\n 'workspace.switch': 'Cambiar de espacio de trabajo',\n 'workspace.create': 'Crear espacio de trabajo',\n 'workspace.search': 'Buscar un espacio de trabajo…',\n 'workspace.empty': 'Ningún espacio de trabajo coincide.',\n 'commandPalette.label': 'Paleta de comandos',\n 'commandPalette.placeholder': 'Escribe un comando o busca…',\n 'commandPalette.recent': 'Recientes',\n 'commandPalette.trigger': 'Busca o ejecuta un comando',\n 'commandPalette.navigate': 'navegar',\n 'commandPalette.run': 'ejecutar',\n 'commandPalette.close': 'cerrar',\n 'theme.cycle': 'Tema: {current}. Cambiar a {next}',\n 'notifications.trigger': '{title}, {count} sin leer',\n 'notifications.new': '{count, plural, one {# nueva} other {# nuevas}}',\n 'notifications.emptyTitle': 'Estás al día',\n 'tokenInput.added': 'Se añadió {items}.',\n 'tokenInput.limit': 'Se alcanzó el límite de {max}.',\n 'avatar.more': 'más',\n 'stepper.step': 'Paso {step} de {total}',\n 'stepper.complete': 'completado',\n 'stepper.current': 'paso actual',\n 'stepper.upcoming': 'sin empezar',\n 'stepper.error': 'error',\n 'sparkline.noData': '{label}: sin datos',\n 'sparkline.single': '{label}: {value}',\n 'sparkline.summary':\n '{label}: {direction}{change} de {first} a {last} en {count} puntos (mínimo {min}, máximo {max})',\n 'sparkline.up': 'al alza',\n 'sparkline.down': 'a la baja',\n 'sparkline.flat': 'estable',\n 'table.scrollable': 'Tabla desplazable',\n 'codeBlock.code': 'Código',\n 'codeBlock.languageCode': 'Código {language}',\n 'codeBlock.wrap': 'Ajustar líneas',\n 'kbd.command': 'Comando',\n 'kbd.option': 'Opción',\n 'kbd.shift': 'Mayúsculas',\n 'kbd.control': 'Control',\n 'kbd.enter': 'Intro',\n 'kbd.backspace': 'Retroceso',\n 'kbd.tab': 'Tabulador',\n 'kbd.escape': 'Escape',\n 'kbd.up': 'Flecha arriba',\n 'kbd.down': 'Flecha abajo',\n 'kbd.left': 'Flecha izquierda',\n 'kbd.right': 'Flecha derecha',\n 'kbd.upDown': 'Flechas arriba y abajo',\n 'settings.section': 'Sección de configuración',\n 'wizard.exitTitle': '¿Salir de esta configuración?',\n 'wizard.exitDescription': 'Se perderá tu progreso en este paso.',\n 'wizard.leave': 'Salir',\n 'wizard.progressSummary': 'Resumen de {label}',\n 'wizard.stepAnnouncement': 'Paso {position} de {total}: {label}',\n 'wizard.finishing': 'Finalizando…',\n 'wizard.title': 'Crear recurso',\n 'wizard.details': 'Detalles',\n 'wizard.review': 'Revisar',\n 'wizard.stay': 'Quedarme',\n 'canvas.palette': 'Paleta',\n 'canvas.inspector': 'Inspector',\n 'canvas.console': 'Consola',\n 'canvas.main': 'Lienzo',\n 'canvas.smallScreen': 'Ábrelo en una pantalla más grande para editar. Aquí el lienzo es de solo lectura.',\n 'print.pageBreak': 'Salto de página',\n 'split.list': 'Lista',\n 'split.details': 'Detalles',\n 'inspector.pin': 'Fijar panel',\n 'inspector.close': 'Cerrar panel',\n 'inspector.toggle': 'Mostrar u ocultar panel',\n 'calendar.tomorrow': 'Mañana',\n 'calendar.previousWeek': 'Semana anterior',\n 'calendar.nextWeek': 'Semana siguiente',\n 'calendar.now': 'ahora',\n 'calendar.unavailable': '(no disponible)',\n 'calendar.availableTimes': 'Horarios disponibles',\n 'calendar.agenda': 'Agenda',\n 'calendar.emptyTitle': 'Nada programado',\n 'calendar.emptyDescription': 'No hay trabajo programado en este periodo.',\n 'table.loadMore': 'Cargar más',\n 'table.loadingMore': 'Cargando…',\n 'table.loadMoreGroup': 'Cargar más elementos',\n 'table.moreAvailable': 'Hay más elementos disponibles.',\n 'table.loadedSummary': '{count, plural, one {# elemento cargado} other {# elementos cargados}}',\n 'table.loadedAnnouncement': '{count, plural, one {# elemento añadido.} other {# elementos añadidos.}}',\n 'table.rows': 'Filas',\n 'table.collectionNoun': '{count, plural, one {elemento} other {elementos}}',\n 'table.visibleCount': '{noun}:',\n 'table.truncatedNote':\n '{count, plural, one {Solo se muestra el primer {formattedCount} {noun}; hay más.} other {Solo se muestran los primeros {formattedCount} {noun}; hay más.}}',\n 'table.rowsPerPage': 'Filas por página',\n 'table.pagination': 'Paginación: {noun}',\n 'table.selectAllPage': 'Seleccionar todas las filas de esta página',\n 'table.selectRow': 'Seleccionar {label}',\n 'table.selection': 'Selección',\n 'table.actions': 'Acciones',\n 'table.rowActions': 'Acciones de {label}',\n 'table.emptyDescription': 'Nada coincide con los filtros actuales.',\n 'table.columns': 'Columnas',\n 'table.visibleColumns': 'Columnas visibles',\n 'table.density': 'Densidad de filas',\n 'table.comfortable': 'Filas holgadas',\n 'table.compact': 'Filas compactas',\n 'table.editRow': 'Editar {label}',\n 'filters.label': 'Filtros',\n 'filters.savedView': 'Vista guardada',\n 'filters.savedViews': 'Vistas guardadas',\n 'filters.add': 'Añadir filtro',\n 'filters.active': 'Filtros activos',\n 'filters.remove': 'Quitar filtro {field}: {value}',\n 'loading.table': 'Cargando tabla',\n 'loading.list': 'Cargando lista',\n 'loading.page': 'Cargando página',\n 'bulk.label': 'Acciones en lote',\n 'bulk.of': 'de {total}',\n 'bulk.selected': '{count, plural, one {seleccionado} other {seleccionados}}',\n 'bulk.item': 'elemento',\n 'bulk.items': 'elementos',\n 'actionBar.unsaved': 'Tienes cambios sin guardar',\n 'actionBar.saved': 'Todos los cambios guardados',\n 'actionBar.save': 'Guardar cambios',\n 'actionBar.discard': 'Descartar',\n 'actionBar.saving': 'Guardando…',\n 'toolbar.label': 'Barra de herramientas de la página',\n 'toolbar.view': 'Vista',\n 'globalSearch.label': 'Búsqueda global',\n 'globalSearch.placeholder': 'Busca páginas, registros y acciones…',\n 'globalSearch.pages': 'Páginas',\n 'globalSearch.records': 'Registros',\n 'globalSearch.actions': 'Acciones',\n 'error.retry': 'Reintentar',\n 'error.retrying': 'Reintentando…',\n 'error.retryingStatus': 'Reintentando',\n 'error.requestId': 'ID de la solicitud',\n 'error.copyRequestId': 'Copiar ID de la solicitud',\n 'error.requestIdCopied': 'ID de la solicitud copiado',\n 'error.details': 'Detalles técnicos',\n 'dateRange.label': 'Rango de fechas',\n 'dateRange.any': 'Cualquier fecha',\n 'common.clearItem': 'Borrar {label}',\n 'upload.label': 'Subir archivos',\n 'upload.files': 'Archivos',\n 'upload.failed': 'Error al subir',\n 'upload.typeRejected': 'Tipo de archivo no admitido',\n 'upload.tooLarge': 'Supera el límite de {size}',\n 'upload.drop': 'Arrastra archivos aquí o',\n 'upload.uploading': 'Subiendo {name}',\n 'upload.notUploaded': '{error} · sin subir',\n 'upload.uploaded': '{size} · subido',\n 'upload.retry': 'Reintentar {name}',\n 'upload.browse': 'Examinar archivos',\n 'upload.hint': '{types} · máx. {size} por archivo',\n 'upload.done': '{name} subido.',\n 'upload.error': 'No se pudo subir {name}.',\n 'upload.added': '{count, plural, one {# archivo añadido.} other {# archivos añadidos.}}',\n 'upload.rejected': '{count, plural, one {# rechazado.} other {# rechazados.}}',\n 'upload.removed': '{name} eliminado.',\n 'comments.label': 'Comentarios',\n 'comments.placeholder': 'Añade un comentario…',\n 'comments.submit': 'Comentar',\n 'comments.write': 'Escribe un comentario',\n 'calendar.events': '{count, plural, one {# evento} other {# eventos}}',\n 'common.expandItem': 'Expandir {label}',\n 'common.collapseItem': 'Contraer {label}',\n 'kanban.label': 'Tablero',\n 'kanban.roleDescription': 'tarjeta arrastrable',\n 'kanban.instructions':\n 'Pulsa Espacio para tomar la tarjeta. Usa las flechas para moverla, Espacio o Intro para soltarla y Escape para cancelar.',\n 'kanban.pickedUp': 'Has tomado {card}. Posición {position} de {total} en {column}.',\n 'kanban.moved': '{card} movida a la posición {position} de {total} en {column}.',\n 'kanban.dropped': '{card} soltada en la posición {position} de {total} en {column}.',\n 'kanban.cancelled': 'Movimiento cancelado. {card} vuelve a {column}.',\n 'kanban.empty': 'Sin tarjetas',\n 'kanban.cards': '{count, plural, one {# tarjeta} other {# tarjetas}}',\n 'chat.messageLabel': 'Mensaje',\n 'chat.placeholder': 'Escribe al asistente…',\n 'chat.send': 'Enviar mensaje',\n 'chat.stop': 'Detener la generación',\n 'chat.attach': 'Adjuntar archivos',\n 'chat.attachments': 'Adjuntos',\n 'chat.hintSend': 'para enviar',\n 'chat.hintNewLine': 'para una línea nueva',\n 'chat.shiftEnter': 'Mayús + Intro',\n 'chat.overLimit': 'caracteres, por encima del límite',\n 'chat.conversation': 'Conversación',\n 'chat.messages': 'Mensajes',\n 'chat.details': 'Detalles',\n 'chat.resizePanel': 'Redimensionar el panel de {panel}',\n 'chat.scrollToBottom': 'Ir al último mensaje',\n 'chat.suggestions': 'Sugerencias',\n 'chat.sources': 'Fuentes',\n 'chat.source': 'Fuente {index}: {title}',\n 'chat.you': 'Tú',\n 'chat.assistant': 'Asistente',\n 'chat.system': 'Sistema',\n 'chat.tool': 'Herramienta',\n 'chat.participant': 'Participante',\n 'chat.responding': '{author} está respondiendo…',\n 'chat.actionsFor': 'Acciones del mensaje de {name}',\n 'chat.copyMessage': 'Copiar mensaje',\n 'chat.copyCode': 'Copiar código',\n 'chat.copiedCode': 'Código copiado',\n 'chat.goodResponse': 'Buena respuesta',\n 'chat.badResponse': 'Mala respuesta',\n 'chat.taskDone': 'Hecho',\n 'chat.taskNotDone': 'Pendiente',\n 'chat.image': 'Imagen: {alt}',\n 'chat.untitled': 'sin título',\n 'chat.openSource': 'Abrir fuente',\n 'toolCall.calling': 'Llamando a',\n 'toolCall.called': 'Se llamó a',\n 'toolCall.failed': 'Falló la llamada a',\n 'toolCall.arguments': 'Argumentos',\n 'toolCall.result': 'Resultado',\n 'toolCall.waiting': 'Esperando el resultado…',\n 'chat.typing': '{author} está escribiendo',\n 'chat.feedback': 'Valoración de la respuesta',\n 'chat.feedbackTitle': '¿Qué ha fallado?',\n 'chat.feedbackReason': 'Motivo',\n 'chat.feedbackComment': 'Comentario (opcional)',\n 'chat.feedbackPlaceholder': 'Cuéntanos más…',\n 'chat.feedbackSubmit': 'Enviar valoración',\n 'chat.feedbackThanks': 'Gracias por tu valoración',\n 'chat.feedbackCleared': 'Valoración eliminada',\n 'chat.reasonInaccurate': 'Incorrecta',\n 'chat.reasonUnhelpful': 'No es útil',\n 'chat.reasonIncomplete': 'Incompleta',\n 'chat.reasonUnsafe': 'Dañina o insegura',\n 'chat.reasonOther': 'Otro',\n 'chat.regenerate': 'Regenerar',\n 'chat.uploading': 'Subiendo {name}',\n 'chat.uploadFailed': 'Error al subir',\n 'chat.retryUpload': 'Reintentar la subida de {name}',\n 'chat.dropFiles': 'Suelta archivos para adjuntarlos',\n 'chat.fileTooLarge': '{name} supera {max}',\n 'chat.fileTypeNotAllowed': '{name} no es un tipo de archivo permitido',\n 'chat.tooManyFiles': 'Puedes adjuntar hasta {max} archivos',\n 'chat.model': 'Modelo',\n 'chat.selectModel': 'Selecciona un modelo',\n 'chat.capabilityVision': 'Visión',\n 'chat.capabilityTools': 'Herramientas',\n 'chat.capabilityReasoning': 'Razonamiento',\n 'chat.capabilityFiles': 'Archivos',\n 'chat.capabilityWeb': 'Búsqueda web',\n 'chat.capabilityAudio': 'Audio',\n 'chat.contextWindow': 'Contexto de {size}',\n 'chat.unavailable': 'No disponible',\n // Credential disclosure dialog\n 'credentialDisclosure.title': 'Secreto de la credencial',\n 'credentialDisclosure.description': 'Copia este valor y guárdalo de forma segura.',\n 'credentialDisclosure.credentialId': 'ID de credencial',\n 'credentialDisclosure.expiry': 'Caduca',\n 'credentialDisclosure.secret': 'Secreto',\n 'credentialDisclosure.show': 'Mostrar secreto',\n 'credentialDisclosure.hide': 'Ocultar secreto',\n 'credentialDisclosure.copy': 'Copiar secreto',\n 'credentialDisclosure.copied': 'Copiado',\n 'credentialDisclosure.success': 'Secreto copiado al portapapeles',\n 'credentialDisclosure.failure': 'No se pudo copiar. Selecciona y copia el valor manualmente.',\n 'credentialDisclosure.close': 'Cerrar',\n 'credentialDisclosure.warningTitle': 'Guarda este nuevo secreto',\n 'credentialDisclosure.warningText':\n 'Este valor reemplaza el secreto anterior. Cópialo ahora; se muestra una sola vez.',\n // Batch A: CopyButton, SplitButton, SecretField, KeyValueEditor, DiffViewer\n 'splitButton.more': 'Más opciones',\n 'secret.show': 'Mostrar secreto',\n 'secret.hide': 'Ocultar secreto',\n 'secret.copy': 'Copiar secreto',\n 'secret.copied': 'Secreto copiado al portapapeles',\n 'secret.hidden': 'Valor oculto',\n 'secret.rotate': 'Rotar',\n 'secret.rotateTitle': '¿Rotar este secreto?',\n 'secret.rotateDescription':\n 'Se genera un valor nuevo y el actual deja de funcionar. Lo que aún lo use fallará hasta que se actualice.',\n 'secret.rotateConfirm': 'Rotar secreto',\n 'secret.rotated': 'Secreto rotado',\n 'secret.rotateFailed': 'No se pudo rotar',\n 'secret.created': 'Creado',\n 'secret.lastUsed': 'Último uso',\n 'secret.neverUsed': 'Nunca usado',\n 'kv.key': 'Clave',\n 'kv.value': 'Valor',\n 'kv.keyRow': 'Clave, fila {row}',\n 'kv.valueRow': 'Valor, fila {row}',\n 'kv.secretRow': 'Valor secreto, fila {row}',\n 'kv.removeRow': 'Quitar fila {row}',\n 'kv.rowRemoved': 'Fila quitada',\n 'kv.add': 'Añadir variable',\n 'kv.empty': 'Aún no hay variables.',\n 'kv.paste': 'Pegar .env',\n 'kv.pasteLabel': 'Contenido .env',\n 'kv.pasteHint':\n 'Una CLAVE=valor por línea. Las líneas que empiezan por # se ignoran; las claves existentes se actualizan.',\n 'kv.import': 'Añadir variables',\n 'kv.imported': '{count, plural, one {# variable importada} other {# variables importadas}}',\n 'kv.copyEnv': 'Copiar como .env',\n 'kv.errDuplicate': 'Clave duplicada',\n 'kv.errPattern': 'Usa letras, dígitos y guiones bajos, sin empezar por un dígito',\n 'kv.errKeyRequired': 'La clave es obligatoria',\n 'kv.errValueRequired': 'El valor es obligatorio',\n 'diff.label': 'Diferencias',\n 'diff.view': 'Vista de diferencias',\n 'diff.split': 'Dividida',\n 'diff.unified': 'Unificada',\n 'diff.addedLine': 'Línea añadida {line}:',\n 'diff.removedLine': 'Línea eliminada {line}:',\n 'diff.additions': '{count, plural, one {# adición} other {# adiciones}}',\n 'diff.deletions': '{count, plural, one {# eliminación} other {# eliminaciones}}',\n 'diff.expand': '{count, plural, one {Mostrar # línea} other {Mostrar # líneas}}',\n 'diff.noChanges': 'Sin cambios',\n 'diff.old': 'Anterior',\n 'diff.new': 'Nuevo',\n // Batch C: async combobox, terminal\n 'combobox.create': 'Crear «{label}»',\n 'combobox.loadFailed': 'No se pudieron cargar las opciones.',\n 'terminal.label': 'Salida de terminal',\n 'terminal.toolbar': 'Acciones de terminal',\n 'terminal.jumpToLatest': 'Ir a lo último',\n 'terminal.newLines': '{count, plural, one {# línea nueva} other {# líneas nuevas}}',\n 'terminal.wrap': 'Ajustar líneas',\n 'terminal.copyAll': 'Copiar todo',\n 'terminal.search': 'Buscar en la salida',\n 'terminal.matches': '{current} de {total}',\n 'terminal.noMatches': 'Sin coincidencias',\n 'terminal.nextMatch': 'Coincidencia siguiente',\n 'terminal.previousMatch': 'Coincidencia anterior',\n 'timePicker.label': 'Hora',\n 'timePicker.hours': 'Horas',\n 'timePicker.minutes': 'Minutos',\n 'timePicker.seconds': 'Segundos',\n 'timePicker.period': 'a. m./p. m.',\n 'timePicker.empty': 'Vacío',\n 'datePicker.time': 'Hora',\n 'datePicker.done': 'Listo',\n 'datePicker.dateTimePlaceholder': 'Elige fecha y hora',\n 'timeRange.placeholder': 'Elige un intervalo',\n 'timeRange.choose': 'Elegir intervalo de tiempo',\n 'timeRange.presets': 'Intervalos rápidos',\n 'timeRange.lastMinutes': '{count, plural, one {Último minuto} other {Últimos # minutos}}',\n 'timeRange.lastHours': '{count, plural, one {Última hora} other {Últimas # horas}}',\n 'timeRange.lastDays': '{count, plural, one {Último día} other {Últimos # días}}',\n 'timeRange.custom': 'Intervalo personalizado',\n 'timeRange.mode': 'Tipo de intervalo',\n 'timeRange.relative': 'Relativo',\n 'timeRange.absolute': 'Absoluto',\n 'timeRange.last': 'Últimos',\n 'timeRange.amount': 'Cantidad',\n 'timeRange.unit': 'Unidad',\n 'timeRange.minutes': 'Minutos',\n 'timeRange.hours': 'Horas',\n 'timeRange.days': 'Días',\n 'timeRange.start': 'Inicio',\n 'timeRange.end': 'Fin',\n 'timeRange.startTime': 'Hora de inicio',\n 'timeRange.endTime': 'Hora de fin',\n 'timeRange.apply': 'Aplicar',\n 'timeRange.endBeforeStart': 'El fin debe ser posterior al inicio.',\n 'timeRange.incomplete': 'Elige un inicio y un fin.',\n 'permissionMatrix.label': 'Permisos',\n 'permissionMatrix.permission': 'Permiso',\n 'permissionMatrix.allowed': 'Permitido',\n 'permissionMatrix.denied': 'Denegado',\n 'permissionMatrix.inherited': 'Heredado',\n 'permissionMatrix.inheritedAs': 'Heredado ({state})',\n 'permissionMatrix.cell': '{permission}, {role}: {state}',\n 'permissionMatrix.readOnly': 'Solo lectura',\n 'permissionMatrix.readOnlyRole': 'Los permisos de {role} no se pueden cambiar.',\n 'queryBuilder.label': 'Consulta',\n 'queryBuilder.group': 'Grupo de condiciones',\n 'queryBuilder.combinator': 'Combinar condiciones con',\n 'queryBuilder.and': 'Y',\n 'queryBuilder.or': 'O',\n 'queryBuilder.condition': 'Condición {index}',\n 'queryBuilder.field': 'Campo',\n 'queryBuilder.operator': 'Operador',\n 'queryBuilder.value': 'Valor',\n 'queryBuilder.valueFrom': 'Desde',\n 'queryBuilder.valueTo': 'Hasta',\n 'queryBuilder.addCondition': 'Añadir condición',\n 'queryBuilder.addGroup': 'Añadir grupo',\n 'queryBuilder.removeCondition': 'Quitar condición {index}',\n 'queryBuilder.removeGroup': 'Quitar grupo',\n 'queryBuilder.empty': 'Sin condiciones: coinciden todos los registros.',\n 'queryBuilder.true': 'verdadero',\n 'queryBuilder.false': 'falso',\n 'queryBuilder.between': '{from} y {to}',\n 'queryBuilder.op.eq': 'es',\n 'queryBuilder.op.neq': 'no es',\n 'queryBuilder.op.contains': 'contiene',\n 'queryBuilder.op.notContains': 'no contiene',\n 'queryBuilder.op.startsWith': 'empieza por',\n 'queryBuilder.op.endsWith': 'termina en',\n 'queryBuilder.op.gt': 'mayor que',\n 'queryBuilder.op.gte': 'al menos',\n 'queryBuilder.op.lt': 'menor que',\n 'queryBuilder.op.lte': 'como máximo',\n 'queryBuilder.op.between': 'está entre',\n 'queryBuilder.op.in': 'es alguno de',\n 'queryBuilder.op.notIn': 'no es ninguno de',\n 'queryBuilder.op.before': 'es anterior a',\n 'queryBuilder.op.after': 'es posterior a',\n 'queryBuilder.op.isEmpty': 'está vacío',\n 'queryBuilder.op.isNotEmpty': 'no está vacío',\n 'queryBuilder.op.isTrue': 'es verdadero',\n 'queryBuilder.op.isFalse': 'es falso',\n 'scheduleInput.label': 'Programación',\n 'scheduleInput.frequency': 'Frecuencia',\n 'scheduleInput.hourly': 'Cada hora',\n 'scheduleInput.daily': 'Diario',\n 'scheduleInput.weekly': 'Semanal',\n 'scheduleInput.monthly': 'Mensual',\n 'scheduleInput.custom': 'Personalizado',\n 'scheduleInput.atMinute': 'En el minuto',\n 'scheduleInput.atTime': 'A las',\n 'scheduleInput.onDays': 'Los días',\n 'scheduleInput.dayOfMonth': 'Día del mes',\n 'scheduleInput.expression': 'Expresión cron',\n 'scheduleInput.expressionHint': 'minuto hora día-del-mes mes día-de-la-semana',\n 'scheduleInput.nextRuns': 'Próximas ejecuciones ({timeZone})',\n 'scheduleInput.noRuns': 'Sin ejecuciones próximas.',\n 'scheduleInput.localTime': 'hora local',\n 'cron.error.empty': 'Escribe una expresión cron.',\n 'cron.error.fieldCount': 'Se esperaban 5 campos (minuto hora día mes día-semana); hay {count}.',\n 'cron.error.invalid': 'Valor de {field} no válido: «{value}».',\n 'cron.error.range': 'El valor de {field} «{value}» está fuera de {min}–{max}.',\n 'cron.error.step': 'Paso «{value}» no válido en {field}.',\n 'cron.error.macro': 'Macro «{value}» no admitida.',\n 'cron.field.minute': 'minuto',\n 'cron.field.hour': 'hora',\n 'cron.field.dayOfMonth': 'día del mes',\n 'cron.field.month': 'mes',\n 'cron.field.dayOfWeek': 'día de la semana',\n 'cron.everyMinute': 'Cada minuto',\n 'cron.everyNMinutes': 'Cada {count, plural, one {minuto} other {# minutos}}',\n 'cron.everyHour': 'Cada hora',\n 'cron.everyHourAt': 'Cada hora en {count, plural, one {el minuto} other {los minutos}} {minutes}',\n 'cron.everyNHours': 'Cada {count, plural, one {hora} other {# horas}}',\n 'cron.everyNHoursAt': 'Cada {count, plural, one {hora} other {# horas}} en el minuto {minute}',\n 'cron.minutesPast': 'En {count, plural, one {el minuto} other {los minutos}} {minutes} de cada hora',\n 'cron.at': 'A las {times}',\n 'cron.dailyAt': 'Todos los días a las {times}',\n 'cron.weekdaysAt': 'De lunes a viernes a las {times}',\n 'cron.weeklyAt': 'Cada {days} a las {times}',\n 'cron.monthlyAt': 'Cada mes, {count, plural, one {el día} other {los días}} {days}, a las {times}',\n 'cron.betweenHours': 'entre las {start} y las {end}',\n 'cron.duringHours': 'durante {count, plural, one {la hora} other {las horas}} {hours}',\n 'cron.onWeekdays': 'de lunes a viernes',\n 'cron.onDays': 'los {days}',\n 'cron.onDaysOfMonth': '{count, plural, one {el día} other {los días}} {days} del mes',\n 'cron.or': '{a} o {b}',\n 'cron.inMonths': 'en {months}',\n 'cron.join': '{base}, {part}',\n};\n","import { en, type Messages } from './en';\nimport { es } from './es';\n\n/** Built-in catalogs, by language subtag. */\nexport const catalogs = { en, es } satisfies Record<string, Messages>;\nexport type CatalogLocale = keyof typeof catalogs;\n","import { DirectionProvider } from '@base-ui/react/direction-provider';\nimport { createContext, useContext, useEffect, useMemo, type ReactNode } from 'react';\nimport { createFormatters, localeDirection, type I18nFormatters } from './format';\nimport { catalogs } from './messages';\nimport { en, type Messages } from './messages/en';\n\nexport type Direction = 'ltr' | 'rtl';\n\n/** What useI18n() returns: the translator, Intl formatters, the locale and the text direction. */\nexport interface I18n extends I18nFormatters {\n locale: string;\n dir: Direction;\n}\n\nexport interface I18nProviderProps {\n /** BCP 47 locale (\"es\", \"es-MX\", \"ar\"). Picks the built-in catalog by language; unknown → English. */\n locale: string;\n /** Overrides or additions on top of the built-in catalog (e.g. a full catalog for another language). */\n messages?: Partial<Messages>;\n /** Text direction; defaults to the locale's (rtl for Arabic, Hebrew, Persian, Urdu…). */\n dir?: Direction;\n /**\n * Where `dir` and `lang` are applied: `wrapper` (default) renders a `display: contents` div;\n * `document` sets them on `<html>` (also covers portalled overlays); `none` leaves it to you.\n */\n applyTo?: 'wrapper' | 'document' | 'none';\n children?: ReactNode;\n}\n\nconst I18nContext = createContext<I18n | null>(null);\nconst DEFAULT_I18N: I18n = { locale: 'en', dir: 'ltr', ...createFormatters('en', en) };\n\n/** The built-in catalog for a locale's language, falling back to English. */\nexport function builtInMessages(locale: string): Messages {\n const lang = locale.split(/[-_]/)[0]?.toLowerCase() ?? '';\n return (catalogs as Record<string, Messages | undefined>)[lang] ?? en;\n}\n\n/**\n * Locale, messages and direction for every kit component below it. Also sets Base UI's\n * direction, so arrow-key navigation (Tabs, Menu, Slider, Toolbar…) follows RTL.\n */\nexport function I18nProvider({ locale, messages, dir, applyTo = 'wrapper', children }: I18nProviderProps) {\n const direction = dir ?? localeDirection(locale);\n const value = useMemo<I18n>(() => {\n const merged: Messages = { ...builtInMessages(locale), ...messages };\n return { locale, dir: direction, ...createFormatters(locale, merged) };\n }, [locale, messages, direction]);\n\n useEffect(() => {\n if (applyTo !== 'document') return;\n const html = document.documentElement;\n const prev = { dir: html.getAttribute('dir'), lang: html.getAttribute('lang') };\n html.setAttribute('dir', direction);\n html.setAttribute('lang', locale);\n return () => {\n if (prev.dir === null) html.removeAttribute('dir');\n else html.setAttribute('dir', prev.dir);\n if (prev.lang === null) html.removeAttribute('lang');\n else html.setAttribute('lang', prev.lang);\n };\n }, [applyTo, direction, locale]);\n\n const content = <DirectionProvider direction={direction}>{children}</DirectionProvider>;\n return (\n <I18nContext.Provider value={value}>\n {applyTo === 'wrapper' ? (\n <div dir={direction} lang={locale} className=\"contents\">\n {content}\n </div>\n ) : (\n content\n )}\n </I18nContext.Provider>\n );\n}\n\n/** Translator, Intl formatters, locale and direction. Outside an I18nProvider: English, LTR. */\nexport function useI18n(): I18n {\n return useContext(I18nContext) ?? DEFAULT_I18N;\n}\n\n/** The provider's value, or null outside one (lets components keep runtime-locale defaults). */\nexport function useOptionalI18n(): I18n | null {\n return useContext(I18nContext);\n}\n\n/**\n * `dir` for portalled overlays: rendered outside the provider's wrapper, they carry the\n * direction themselves. Undefined outside a provider, so the document's direction applies.\n */\nexport function usePortalDir(): Direction | undefined {\n return useContext(I18nContext)?.dir;\n}\n","import { createContext, useContext } from 'react';\n\n/** Control density. `comfortable` is the default; `compact` suits data-heavy consoles. */\nexport type Density = 'compact' | 'comfortable';\n\nexport const DensityContext = createContext<Density | null>(null);\n\n/** The nearest DensityProvider's density, or `comfortable` outside any provider. */\nexport function useDensity(): Density {\n return useContext(DensityContext) ?? 'comfortable';\n}\n\n/** The nearest provider's density, or `undefined` outside any provider (for components with their own fallback). */\nexport function useDensityContext(): Density | undefined {\n return useContext(DensityContext) ?? undefined;\n}\n","import { useLayoutEffect, type ReactNode, type Ref } from 'react';\nimport { cn } from '../utils/cn';\nimport { DensityContext, type Density } from './density-context';\n\nexport interface DensityProviderProps {\n /** Density for the subtree: control heights, paddings, table rows. */\n density: Density;\n /**\n * Where the `data-density` attribute goes. `wrapper` (default) renders a `display: contents`\n * div around the children; `document` sets it on <html> (restored on unmount) and renders no element.\n */\n applyTo?: 'wrapper' | 'document';\n /** Classes for the wrapper div (`applyTo=\"wrapper\"` only). Replaces the default `contents` display when it sets one. */\n className?: string;\n ref?: Ref<HTMLDivElement>;\n children?: ReactNode;\n}\n\n/**\n * Sets `data-density` so the density variables from @gntik-ai/tokens (density.css) re-scope for\n * the subtree, and exposes the value through `useDensity()` for JS-side choices (icon sizes,\n * Table's default density). Components with an explicit `size` keep it; the rest follow density.\n *\n * Data-heavy consoles default to compact: wrap the screen (e.g. a ConsoleShell page) once,\n * `<DensityProvider density=\"compact\"><ConsoleShell>…</ConsoleShell></DensityProvider>`, or use\n * `applyTo=\"document\"` so portalled popups (menus, selects) are compact too.\n */\nexport function DensityProvider({ density, applyTo = 'wrapper', className, ref, children }: DensityProviderProps) {\n useLayoutEffect(() => {\n if (applyTo !== 'document') return undefined;\n const root = document.documentElement;\n const previous = root.getAttribute('data-density');\n root.setAttribute('data-density', density);\n return () => {\n if (previous == null) root.removeAttribute('data-density');\n else root.setAttribute('data-density', previous);\n };\n }, [applyTo, density]);\n\n return (\n <DensityContext value={density}>\n {applyTo === 'document' ? (\n children\n ) : (\n <div ref={ref} data-density={density} className={cn('contents', className)}>\n {children}\n </div>\n )}\n </DensityContext>\n );\n}\n","/** musematic mark artwork (logo artwork is the one place literal colours are allowed). */\nexport const MUSEMATIC_MARK_PATH =\n 'M252.45 62L256 61.04L260 62.84L301.33 88L301.41 141L294 146.26L260 166.28L188 207.56L186.51 209L187 210.37L316 282.34L332 290.19L332.89 161L338 156.62L375 134.68L380 133.8L423 158.51L425.52 161L426.18 169L425.94 327L425 351.92L273 441.24L259.03 449L256 449.5L251 448.26L215 427.9L208.5 423L208.93 371L217 364.81L323 303.3L325.27 301L324 299.76L180 219.93L179.03 232L179.48 348L178.03 353L136.02 377L132 377.96L86.44 352L85.54 351L84.94 333L85.52 161L90.26 157L114 142.76ZM253.38 75L255 74.28L259 75.85L282 89.31L283.28 91L280 93.49L133 179.21L131 179.51L129 178.5L103.88 164L104 162.57L115 155.76ZM288.37 102L290.25 102L290.29 134L288 136.48L273 145.37L174 202.69L172 202.39L150 189.98L144.57 186ZM375.87 148L378 147.11L381 147.86L405 161.54L407.1 163L407.01 164L380 179.22L374 176.82L353 165.5L350.56 163ZM343.63 174L346 174.42L366 185.59L373.51 191L373 313.81L351 302.36L345 298.89L343.62 297ZM96.44 175L98 174.32L108 179.54L125 189.52L126.75 192L126.76 352L126.71 360L126 361.22L102 348.23L96.35 344ZM411.61 175L413 174.2L414.35 175L413.92 344L410 347.18L325 397.29L262 433.37L261.32 432L261.33 402L262.58 400L375 333.92L384.62 327L384.98 192L388 188.71ZM138.4 198L140 197.49L158 207.55L167 213.03L168.24 216L168.25 344L165 347.26L139 361.79ZM337.79 308L366.5 324L366 325.45L353 333.28L256 390.29L226.93 374L230 370.98ZM219.89 385L221 384.24L223 385.12L249.52 401L249.7 432L249 433.65L219.89 417Z';\n","import type { ReactNode } from 'react';\nimport { MUSEMATIC_MARK_PATH } from './musematic-mark';\n\n/**\n * A brand preset is a product skin: name and logo only. Colours never change\n * between presets — every product renders the frozen tokens of @gntik-ai/tokens.\n */\nexport interface BrandPreset {\n id: string;\n /** Product name, used in the wordmark and as the logo's accessible name. */\n name: string;\n /** Renders the square mark at `size` px. */\n mark: (size: number) => ReactNode;\n}\n\n/** Neutral default: a token-coloured monogram, no product named. */\nexport const gntikPreset: BrandPreset = {\n id: 'gntik',\n name: 'gntik',\n mark: (size) => (\n <svg width={size} height={size} viewBox=\"0 0 64 64\" aria-hidden=\"true\" className=\"block shrink-0\">\n <rect width=\"64\" height=\"64\" rx=\"14\" className=\"fill-chrome\" />\n <path\n d=\"M41 24.5A11 11 0 1 0 43 32h-11\"\n fill=\"none\"\n strokeWidth=\"6\"\n strokeLinecap=\"round\"\n className=\"stroke-primary\"\n />\n </svg>\n ),\n};\n\nexport const musematicPreset: BrandPreset = {\n id: 'musematic',\n name: 'musematic',\n mark: (size) => (\n <svg width={size} height={size} viewBox=\"0 0 64 64\" aria-hidden=\"true\" className=\"block shrink-0\">\n <rect width=\"64\" height=\"64\" rx=\"14\" fill=\"#0C2017\" />\n <svg x=\"9\" y=\"9\" width=\"46\" height=\"46\" viewBox=\"0 0 512 512\">\n <path fill=\"#33CE73\" fillRule=\"evenodd\" d={MUSEMATIC_MARK_PATH} />\n </svg>\n </svg>\n ),\n};\n\n/**\n * Falcone — PLACEHOLDER until the product's logo artwork lands: a token-coloured \"F\" monogram.\n * Swap `mark` for the real artwork (as musematic does); the name and id stay.\n */\nexport const falconePreset: BrandPreset = {\n id: 'falcone',\n name: 'Falcone',\n mark: (size) => (\n <svg width={size} height={size} viewBox=\"0 0 64 64\" aria-hidden=\"true\" className=\"block shrink-0\">\n <rect width=\"64\" height=\"64\" rx=\"14\" className=\"fill-chrome\" />\n <path\n d=\"M24 46V18h18M24 32h13\"\n fill=\"none\"\n strokeWidth=\"6\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"stroke-primary\"\n />\n </svg>\n ),\n};\n\nexport const presets = { gntik: gntikPreset, musematic: musematicPreset, falcone: falconePreset } as const;\n","import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n useSyncExternalStore,\n type ReactNode,\n} from 'react';\nimport { gntikPreset, type BrandPreset } from './presets';\nimport type { ResolvedTheme, ThemeMode } from './theme-script';\n\nexport { themeScript, type ThemeMode, type ResolvedTheme } from './theme-script';\n\n/** Theme class per resolved mode. Light is the token default (:root), so it adds no class. */\nconst THEME_CLASS: Record<ResolvedTheme, string> = { dark: 'dark', light: '', high_contrast: 'high_contrast' };\nconst ALL_CLASSES = ['dark', 'high_contrast'];\nconst SYSTEM_QUERIES = ['(prefers-color-scheme: light)', '(prefers-contrast: more)'];\n\ninterface ThemeContextValue {\n mode: ThemeMode;\n resolved: ResolvedTheme;\n setMode: (mode: ThemeMode) => void;\n brand: BrandPreset;\n}\n\nconst ThemeContext = createContext<ThemeContextValue | null>(null);\n\nfunction systemTheme(): ResolvedTheme {\n if (typeof window === 'undefined' || !window.matchMedia) return 'dark';\n if (window.matchMedia('(prefers-contrast: more)').matches) return 'high_contrast';\n return window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';\n}\n\nfunction subscribeSystem(onChange: () => void) {\n if (typeof window === 'undefined' || !window.matchMedia) return () => {};\n const queries = SYSTEM_QUERIES.map((q) => window.matchMedia(q));\n queries.forEach((q) => q.addEventListener('change', onChange));\n return () => queries.forEach((q) => q.removeEventListener('change', onChange));\n}\n\nfunction readStored(key: string): ThemeMode | null {\n try {\n const v = localStorage.getItem(key);\n return v === 'dark' || v === 'light' || v === 'high_contrast' || v === 'system' ? v : null;\n } catch {\n return null;\n }\n}\n\n/** Same-tab writes (the `storage` event only fires in other tabs). */\nconst storeListeners = new Set<() => void>();\n\nfunction subscribeStored(onChange: () => void) {\n storeListeners.add(onChange);\n if (typeof window !== 'undefined') window.addEventListener('storage', onChange);\n return () => {\n storeListeners.delete(onChange);\n if (typeof window !== 'undefined') window.removeEventListener('storage', onChange);\n };\n}\n\nconst serverStored = () => null;\nconst serverSystem = (): ResolvedTheme => 'dark';\n\nexport interface ThemeProviderProps {\n children: ReactNode;\n /** Mode when nothing is stored. Dark is the kit default. */\n defaultMode?: ThemeMode;\n /**\n * Mode for the server render and hydration (e.g. read from a cookie); defaults to `defaultMode`.\n * The stored choice, if any, applies right after hydration.\n */\n initialMode?: ThemeMode;\n /** Brand preset (name + logo). Colours are the same for every preset. */\n brand?: BrandPreset;\n /** localStorage key; pass `null` to disable persistence. */\n storageKey?: string | null;\n /** Element that receives the theme class. Defaults to <html>. */\n target?: () => HTMLElement | null;\n}\n\n/**\n * Applies the theme class to <html> (dark · light · high_contrast, or follows the OS),\n * persists the choice and exposes the brand preset. SSR-safe: the server and hydration render\n * use `initialMode ?? defaultMode`; the stored mode and the OS preference are read through\n * useSyncExternalStore, so they apply right after hydration without a mismatch. To avoid a\n * flash on load, inline `themeScript()` in the document <head>.\n */\nexport function ThemeProvider({\n children,\n defaultMode = 'dark',\n initialMode,\n brand = gntikPreset,\n storageKey = 'gntik-theme',\n target = () => (typeof document === 'undefined' ? null : document.documentElement),\n}: ThemeProviderProps) {\n const [localMode, setLocalMode] = useState<ThemeMode>(initialMode ?? defaultMode);\n const getStored = useCallback(() => (storageKey ? readStored(storageKey) : null), [storageKey]);\n const stored = useSyncExternalStore(subscribeStored, getStored, serverStored);\n const system = useSyncExternalStore(subscribeSystem, systemTheme, serverSystem);\n const mode = stored ?? localMode;\n const resolved = mode === 'system' ? system : mode;\n\n useEffect(() => {\n const el = target();\n if (!el) return;\n el.classList.remove(...ALL_CLASSES);\n const cls = THEME_CLASS[resolved];\n if (cls) el.classList.add(cls);\n el.style.colorScheme = resolved === 'light' ? 'light' : 'dark';\n el.dataset.brand = brand.id;\n }, [resolved, brand.id, target]);\n\n const setMode = useCallback(\n (next: ThemeMode) => {\n setLocalMode(next);\n if (!storageKey) return;\n try {\n localStorage.setItem(storageKey, next);\n } catch {}\n storeListeners.forEach((l) => l());\n },\n [storageKey],\n );\n\n const value = useMemo(() => ({ mode, resolved, setMode, brand }), [mode, resolved, setMode, brand]);\n return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;\n}\n\n/** Current theme and brand. Outside a provider it reports the dark default and the gntik preset. */\nexport function useTheme(): ThemeContextValue {\n return useContext(ThemeContext) ?? { mode: 'dark', resolved: 'dark', setMode: () => {}, brand: gntikPreset };\n}\n","import type { HTMLAttributes } from 'react';\nimport { cn } from '../utils/cn';\nimport { useTheme } from './ThemeProvider';\nimport type { BrandPreset } from './presets';\n\nexport interface LogoProps extends HTMLAttributes<HTMLSpanElement> {\n /** Mark size in px. */\n size?: number;\n /** Show the product name next to the mark. */\n wordmark?: boolean;\n /** Override the preset from ThemeProvider. */\n brand?: BrandPreset;\n}\n\n/** The active brand's mark, optionally with its wordmark. */\nexport function Logo({ size = 28, wordmark = false, brand, className, ...props }: LogoProps) {\n const theme = useTheme();\n const active = brand ?? theme.brand;\n return (\n <span\n role=\"img\"\n aria-label={active.name}\n className={cn('inline-flex items-center gap-[7px]', className)}\n {...props}\n >\n {active.mark(size)}\n {wordmark && (\n <span\n aria-hidden=\"true\"\n className=\"font-sans font-bold tracking-[-0.02em] text-foreground\"\n style={{ fontSize: Math.round(size * 0.64) }}\n >\n {active.name}\n <span className=\"text-primary\">.</span>\n </span>\n )}\n </span>\n );\n}\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const accordionVariants = tv({\n slots: {\n root: 'flex w-full flex-col divide-y divide-border',\n item: 'data-disabled:opacity-60',\n header: 'm-0',\n trigger: [\n 'group flex w-full cursor-pointer items-center gap-3 py-3.5 text-start text-[13px] font-medium text-foreground transition-colors',\n 'hover:text-foreground/80 data-disabled:cursor-not-allowed',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring rounded-sm',\n ],\n chevron: [\n 'ms-auto shrink-0 text-muted-foreground transition-transform duration-200 motion-reduce:transition-none',\n 'group-data-panel-open:rotate-180',\n ],\n panel: [\n 'h-(--accordion-panel-height) overflow-hidden transition-[height] duration-200 ease-out motion-reduce:transition-none',\n 'data-starting-style:h-0 data-ending-style:h-0',\n ],\n content: 'pb-4 text-[13px] leading-relaxed text-muted-foreground text-pretty',\n },\n variants: {\n variant: {\n /** Dividers only; fills the parent. */\n flush: {},\n /** Inside a bordered card; rows get horizontal padding. */\n card: {\n root: 'overflow-hidden rounded-xl border border-border bg-card',\n trigger: 'px-4 hover:bg-secondary/40 focus-visible:-outline-offset-2 rounded-none',\n content: 'px-4',\n },\n },\n },\n defaultVariants: { variant: 'flush' },\n});\n\nexport type AccordionVariantProps = VariantProps<typeof accordionVariants>;\n","import { Accordion as BaseAccordion } from '@base-ui/react/accordion';\nimport { ChevronDown } from 'lucide-react';\nimport { createContext, useContext, type KeyboardEvent, type ReactNode, type Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { accordionVariants, type AccordionVariantProps } from './accordion.variants';\n\ntype AccordionVariant = NonNullable<AccordionVariantProps['variant']>;\nconst AccordionContext = createContext<AccordionVariant>('flush');\n\nconst ROOT_SELECTOR = '[data-slot=\"accordion\"]';\nconst TRIGGER_SELECTOR = '[data-slot=\"accordion-trigger\"]';\n\n/**\n * Moves focus between the triggers of one accordion (ArrowDown/ArrowUp wrap, Home/End jump).\n * Base UI 1.8 dropped roving focus for accordions, so the kit adds it back as plain focus moves:\n * every trigger stays in the Tab order.\n */\nfunction moveTriggerFocus(event: KeyboardEvent<HTMLElement>) {\n const root = event.currentTarget;\n const target = event.target as HTMLElement;\n if (!target.matches(TRIGGER_SELECTOR) || target.closest(ROOT_SELECTOR) !== root) return;\n const triggers = Array.from(root.querySelectorAll<HTMLElement>(TRIGGER_SELECTOR)).filter(\n (el) => el.closest(ROOT_SELECTOR) === root && !el.hasAttribute('disabled') && !el.hasAttribute('data-disabled'),\n );\n const index = triggers.indexOf(target);\n if (index === -1 || triggers.length === 0) return;\n let next: number | undefined;\n if (event.key === 'ArrowDown') next = (index + 1) % triggers.length;\n else if (event.key === 'ArrowUp') next = (index - 1 + triggers.length) % triggers.length;\n else if (event.key === 'Home') next = 0;\n else if (event.key === 'End') next = triggers.length - 1;\n if (next === undefined) return;\n event.preventDefault();\n triggers[next]?.focus();\n}\n\nexport interface AccordionProps<Value = string> extends Omit<BaseAccordion.Root.Props<Value>, 'className'> {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n /** `flush` (dividers only) or `card` (bordered surface). */\n variant?: AccordionVariant;\n}\n\n/**\n * A stack of collapsible sections. One open at a time by default; pass `multiple` to allow several.\n * Controlled with `value` + `onValueChange` (an array of item values), or uncontrolled with `defaultValue`.\n */\nexport function Accordion<Value = string>({\n variant = 'flush',\n className,\n onKeyDown,\n ...props\n}: AccordionProps<Value>) {\n return (\n <AccordionContext.Provider value={variant}>\n <BaseAccordion.Root<Value>\n data-slot=\"accordion\"\n className={cn(accordionVariants({ variant }).root(), className)}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (!event.defaultPrevented) moveTriggerFocus(event);\n }}\n {...props}\n />\n </AccordionContext.Provider>\n );\n}\n\nexport interface AccordionItemProps extends Omit<BaseAccordion.Item.Props, 'className'> {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n}\n\n/** One section. Give it a `value` to control it from the root. */\nexport function AccordionItem({ className, ...props }: AccordionItemProps) {\n const variant = useContext(AccordionContext);\n return <BaseAccordion.Item className={cn(accordionVariants({ variant }).item(), className)} {...props} />;\n}\n\nexport interface AccordionTriggerProps extends Omit<BaseAccordion.Trigger.Props, 'className'> {\n className?: string;\n ref?: Ref<HTMLButtonElement>;\n /** Heading level of the wrapping header element. */\n headingLevel?: 2 | 3 | 4 | 5 | 6;\n children?: ReactNode;\n}\n\n/** The section heading + toggle button. The chevron rotates when the panel is open. */\nexport function AccordionTrigger({ headingLevel = 3, className, children, ...props }: AccordionTriggerProps) {\n const variant = useContext(AccordionContext);\n const s = accordionVariants({ variant });\n const Heading = `h${headingLevel}` as const;\n return (\n <BaseAccordion.Header className={s.header()} render={<Heading />}>\n <BaseAccordion.Trigger data-slot=\"accordion-trigger\" className={cn(s.trigger(), className)} {...props}>\n {children}\n <ChevronDown size={16} className={s.chevron()} aria-hidden />\n </BaseAccordion.Trigger>\n </BaseAccordion.Header>\n );\n}\n\nexport interface AccordionPanelProps extends Omit<BaseAccordion.Panel.Props, 'className'> {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n children?: ReactNode;\n}\n\n/** The collapsible content. Height animates; reduced motion turns the animation off. */\nexport function AccordionPanel({ className, children, ...props }: AccordionPanelProps) {\n const variant = useContext(AccordionContext);\n const s = accordionVariants({ variant });\n return (\n <BaseAccordion.Panel className={s.panel()} {...props}>\n <div className={cn(s.content(), className)}>{children}</div>\n </BaseAccordion.Panel>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Accordion',\n group: 'Display',\n status: 'stable',\n description:\n 'A stack of collapsible sections separated by dividers, flush or inside a card. Single (default) or multiple open items; the chevron rotates and the height animates. Compound parts: Accordion, AccordionItem, AccordionTrigger, AccordionPanel.',\n primitive: '@base-ui/react/accordion',\n pattern: 'accordion',\n keyboard: [\n ['Enter / Space', 'Expands or collapses the focused section'],\n ['ArrowDown / ArrowUp', 'Moves focus to the next / previous trigger (wraps around)'],\n ['Home / End', 'Moves focus to the first / last trigger'],\n ['Tab', 'Moves focus through the triggers and any focusable content in open panels'],\n ],\n tokens: ['border', 'card', 'secondary', 'foreground', 'muted-foreground', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\n/**\n * Inline banner. Info has no contrast-safe text alias, so its title stays `text-foreground`\n * and only the icon carries the tone.\n */\nexport const alertVariants = tv({\n slots: {\n root: 'flex gap-3 rounded-lg border p-4',\n icon: 'mt-px shrink-0',\n content: 'min-w-0 flex-1',\n title: 'text-[13.5px] font-semibold tracking-tight',\n description: 'text-[13px] leading-6 text-foreground/80',\n actions: 'mt-3 flex flex-wrap items-center gap-x-5 gap-y-2',\n dismiss: [\n '-mt-0.5 -me-1 grid size-6 shrink-0 cursor-pointer place-items-center rounded-md transition-colors motion-reduce:transition-none hover:bg-foreground/10',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n },\n variants: {\n tone: {\n info: {\n root: 'border-info/25 bg-info/10',\n icon: 'text-info',\n title: 'text-foreground',\n dismiss: 'text-muted-foreground hover:text-foreground',\n },\n success: {\n root: 'border-success/25 bg-success/10',\n icon: 'text-success-text',\n title: 'text-success-text',\n dismiss: 'text-success-text',\n },\n warning: {\n root: 'border-warning/30 bg-warning/10',\n icon: 'text-warning-text',\n title: 'text-warning-text',\n dismiss: 'text-warning-text',\n },\n destructive: {\n root: 'border-destructive/30 bg-destructive/10',\n icon: 'text-destructive-text',\n title: 'text-destructive-text',\n dismiss: 'text-destructive-text',\n },\n },\n },\n defaultVariants: { tone: 'info' },\n});\n\nexport type AlertVariantProps = VariantProps<typeof alertVariants>;\nexport type AlertTone = NonNullable<AlertVariantProps['tone']>;\n","import { CircleAlert, CircleCheck, Info, TriangleAlert, X, type LucideIcon } from 'lucide-react';\nimport { useId, type HTMLAttributes, type ReactNode, type Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { alertVariants, type AlertTone, type AlertVariantProps } from './alert.variants';\n\nconst TONE_ICON: Record<AlertTone, LucideIcon> = {\n info: Info,\n success: CircleCheck,\n warning: TriangleAlert,\n destructive: CircleAlert,\n};\n\nexport interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'title'>, AlertVariantProps {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n title?: ReactNode;\n /** Body text; `children` is used when this is not set. */\n description?: ReactNode;\n /** Action row under the text (buttons or links). */\n actions?: ReactNode;\n /** Replaces the tone icon; `null` hides it. */\n icon?: LucideIcon | null;\n /** Renders a dismiss button; called on click, Enter or Space. */\n onDismiss?: () => void;\n /** Accessible name of the dismiss button. */\n dismissLabel?: string;\n children?: ReactNode;\n}\n\n/**\n * Inline banner. role=\"alert\" (assertive) for destructive, role=\"status\" (polite) otherwise;\n * override with `role`. Labelled by its title and described by its body.\n */\nexport function Alert({\n tone = 'info',\n title,\n description,\n actions,\n icon,\n onDismiss,\n dismissLabel: dismissLabelProp,\n className,\n children,\n role,\n ...props\n}: AlertProps) {\n const { t } = useI18n();\n const dismissLabel = dismissLabelProp ?? t('common.dismiss');\n const s = alertVariants({ tone });\n const id = useId();\n const Icon = icon === undefined ? TONE_ICON[tone] : icon;\n const body = description ?? children;\n return (\n <div\n role={role ?? (tone === 'destructive' ? 'alert' : 'status')}\n aria-labelledby={title != null ? `${id}-title` : undefined}\n aria-describedby={body != null ? `${id}-desc` : undefined}\n className={cn(s.root(), className)}\n {...props}\n >\n {Icon && <Icon size={18} strokeWidth={1.9} aria-hidden className={s.icon()} />}\n <div className={s.content()}>\n {title != null && (\n <div id={`${id}-title`} className={s.title()}>\n {title}\n </div>\n )}\n {body != null && (\n <div id={`${id}-desc`} className={cn(s.description(), title != null && 'mt-1')}>\n {body}\n </div>\n )}\n {actions != null && <div className={s.actions()}>{actions}</div>}\n </div>\n {onDismiss && (\n <button type=\"button\" aria-label={dismissLabel} onClick={onDismiss} className={s.dismiss()}>\n <X size={14} strokeWidth={2.4} aria-hidden />\n </button>\n )}\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Alert',\n group: 'Feedback',\n status: 'stable',\n description:\n 'Inline banner in four tones (info, success, warning, destructive) with title, description, an action row and an optional dismiss button. Destructive alerts use role=\"alert\"; the others role=\"status\".',\n pattern: 'alert / status',\n keyboard: [\n ['Tab', 'Moves focus to the actions and the dismiss button'],\n ['Enter', 'Activates the dismiss button'],\n ['Space', 'Activates the dismiss button'],\n ],\n tokens: [\n 'info',\n 'success',\n 'success-text',\n 'warning',\n 'warning-text',\n 'destructive',\n 'destructive-text',\n 'foreground',\n 'focus-ring',\n ],\n};\n","/** Mirrors a directional glyph (chevron, arrow) in right-to-left text. */\nexport const RTL_FLIP = 'rtl:-scale-x-100';\n\nconst DIRECTIONAL =\n /^(?:Chevrons?(?:Left|Right)|Arrow(?:Left|Right)\\w*|Move(?:Left|Right)|Panel(?:Left|Right)\\w*|Undo\\d?|Redo\\d?|Corner\\w+(?:Left|Right)|Indent\\w*|Outdent\\w*)$/;\n\n/**\n * True for lucide icons that point along the inline axis (ChevronLeft, ArrowRight,\n * PanelLeftClose…), which mirror under RTL. Detected from the icon's displayName.\n */\nexport function isDirectionalIcon(icon: unknown): boolean {\n const name = (icon as { displayName?: unknown } | null | undefined)?.displayName;\n return typeof name === 'string' && DIRECTIONAL.test(name);\n}\n\n/** `RTL_FLIP` for a directional icon, else undefined. */\nexport const rtlIconClass = (icon: unknown) => (isDirectionalIcon(icon) ? RTL_FLIP : undefined);\n","import type { SVGAttributes } from 'react';\nimport { cn } from '../../utils/cn';\n\nexport interface SpinnerProps extends SVGAttributes<SVGSVGElement> {\n size?: number;\n /** Accessible label. Without it the spinner is decorative (aria-hidden). */\n label?: string;\n}\n\n/** Indeterminate loading indicator; inherits currentColor. */\nexport function Spinner({ size = 16, label, className, ...props }: SpinnerProps) {\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n className={cn('block shrink-0 animate-spin motion-reduce:animate-[spin_1.6s_linear_infinite]', className)}\n role={label ? 'status' : undefined}\n aria-label={label}\n aria-hidden={label ? undefined : true}\n {...props}\n >\n <circle cx=\"12\" cy=\"12\" r=\"9\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.6\" strokeOpacity=\"0.25\" />\n <path d=\"M21 12a9 9 0 0 0-9-9\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.6\" strokeLinecap=\"round\" />\n </svg>\n );\n}\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const buttonVariants = tv({\n base: [\n 'inline-flex shrink-0 items-center justify-center font-semibold whitespace-nowrap transition-colors select-none',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n ],\n variants: {\n variant: {\n primary: 'bg-primary text-primary-foreground shadow-sm hover:bg-primary/90',\n secondary: 'border border-border bg-card text-foreground shadow-sm hover:bg-secondary/70',\n soft: 'bg-primary/14 text-primary-chip-text hover:bg-primary/20',\n ghost: 'text-muted-foreground hover:bg-secondary/70 hover:text-foreground',\n destructive: 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',\n },\n size: {\n /** Follows `data-density` (comfortable = md). */\n auto: 'h-control gap-1.5 px-control text-[13px] rounded-lg',\n sm: 'h-8 gap-1.5 px-3 text-[12.5px] rounded-md',\n md: 'h-9 gap-1.5 px-3.5 text-[13px] rounded-lg',\n lg: 'h-11 gap-2 px-5 text-[14.5px] rounded-lg',\n },\n iconOnly: { true: 'px-0' },\n },\n compoundVariants: [\n { iconOnly: true, size: 'auto', class: 'size-control' },\n { iconOnly: true, size: 'sm', class: 'size-8' },\n { iconOnly: true, size: 'md', class: 'size-9' },\n { iconOnly: true, size: 'lg', class: 'size-11' },\n ],\n defaultVariants: { variant: 'primary', size: 'auto', iconOnly: false },\n});\n\nexport type ButtonVariantProps = VariantProps<typeof buttonVariants>;\n\n/** Icon size (px) per button size. */\nexport const BUTTON_ICON_SIZE = { sm: 14, md: 15, lg: 17 } as const;\n\n/** Icon size for a button size, resolving `auto` through the density. */\nexport function buttonIconSize(size: 'auto' | 'sm' | 'md' | 'lg', density: 'compact' | 'comfortable'): number {\n return BUTTON_ICON_SIZE[size === 'auto' ? (density === 'compact' ? 'sm' : 'md') : size];\n}\n","import { Button as BaseButton } from '@base-ui/react/button';\nimport type { ComponentType, ReactNode, Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { rtlIconClass } from '../../utils/rtl';\nimport { Spinner } from '../Spinner/Spinner';\nimport { useDensity } from '../../density/density-context';\nimport { buttonIconSize, buttonVariants, type ButtonVariantProps } from './button.variants';\n\ntype IconComponent = ComponentType<{ size?: number; 'aria-hidden'?: boolean; className?: string }>;\n\nexport interface ButtonProps extends Omit<BaseButton.Props, 'className'>, ButtonVariantProps {\n className?: string;\n ref?: Ref<HTMLButtonElement>;\n /** Leading icon (a lucide icon component). Directional ones (ChevronLeft, ArrowRight…) mirror under RTL. */\n icon?: IconComponent;\n /** Trailing icon. */\n trailingIcon?: IconComponent;\n /** Shows a spinner, disables the button and sets aria-busy. */\n loading?: boolean;\n children?: ReactNode;\n}\n\n/** Primary action control. Renders a native <button> unless `render` swaps the element. */\nexport function Button({\n variant,\n size = 'auto',\n iconOnly,\n icon: LeadingIcon,\n trailingIcon: TrailingIcon,\n loading = false,\n disabled,\n className,\n children,\n type = 'button',\n ...props\n}: ButtonProps) {\n const px = buttonIconSize(size, useDensity());\n return (\n <BaseButton\n type={type}\n disabled={disabled || loading}\n focusableWhenDisabled={loading}\n aria-busy={loading || undefined}\n className={cn(buttonVariants({ variant, size, iconOnly }), className)}\n {...props}\n >\n {loading ? (\n <Spinner size={px} />\n ) : (\n LeadingIcon && <LeadingIcon size={px} aria-hidden className={rtlIconClass(LeadingIcon)} />\n )}\n {children}\n {!loading && TrailingIcon && <TrailingIcon size={px} aria-hidden className={rtlIconClass(TrailingIcon)} />}\n </BaseButton>\n );\n}\n\nexport interface IconButtonProps extends Omit<ButtonProps, 'icon' | 'trailingIcon' | 'children' | 'iconOnly'> {\n icon: IconComponent;\n /** Required accessible name (also used as the tooltip text by callers). */\n label: string;\n}\n\n/** Square, icon-only button. `label` becomes its accessible name. */\nexport function IconButton({\n icon: IconCmp,\n label,\n size = 'auto',\n variant = 'ghost',\n loading,\n className,\n ...props\n}: IconButtonProps) {\n const px = buttonIconSize(size, useDensity());\n return (\n <Button\n aria-label={label}\n size={size}\n variant={variant}\n iconOnly\n loading={loading}\n className={className}\n {...props}\n >\n {!loading && <IconCmp size={px} aria-hidden className={rtlIconClass(IconCmp)} />}\n </Button>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Button',\n group: 'Actions',\n status: 'stable',\n description:\n 'Triggers an action. Five variants (primary, secondary, soft, ghost, destructive), three sizes, icons and a loading state. IconButton is the square, icon-only form.',\n primitive: '@base-ui/react/button',\n pattern: 'button',\n keyboard: [\n ['Enter', 'Activates the button'],\n ['Space', 'Activates the button'],\n ['Tab', 'Moves focus; a loading button stays focusable'],\n ],\n tokens: ['primary', 'primary-foreground', 'card', 'border', 'secondary', 'destructive', 'primary-text', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const dialogVariants = tv({\n slots: {\n backdrop: [\n 'fixed inset-0 z-50 bg-background/75 backdrop-blur-[3px] transition-opacity duration-200',\n 'data-starting-style:opacity-0 data-ending-style:opacity-0',\n ],\n viewport: 'fixed inset-0 z-50 flex items-start justify-center overflow-y-auto p-5 sm:p-8',\n popup: [\n 'relative mt-[8vh] w-full rounded-xl border border-border bg-popover text-popover-foreground shadow-lg outline-none',\n 'transition-[opacity,translate,scale] duration-200 motion-reduce:transition-none',\n 'data-starting-style:translate-y-2 data-starting-style:scale-[0.97] data-starting-style:opacity-0',\n 'data-ending-style:translate-y-2 data-ending-style:scale-[0.97] data-ending-style:opacity-0',\n ],\n close: [\n 'absolute top-3.5 end-3.5 grid size-8 place-items-center rounded-lg text-muted-foreground transition-colors',\n 'hover:bg-secondary/60 hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n header: 'flex flex-col gap-1 border-b border-border px-5 py-4 pe-14',\n title: 'text-[15px] font-semibold tracking-tight text-foreground',\n description: 'text-[12.5px] leading-5 text-muted-foreground text-pretty',\n body: 'px-5 py-4',\n footer: 'flex justify-end gap-2.5 border-t border-border px-5 py-3.5',\n },\n variants: {\n size: {\n sm: { popup: 'max-w-[380px]' },\n md: { popup: 'max-w-[460px]' },\n lg: { popup: 'max-w-[560px]' },\n xl: { popup: 'max-w-[720px]' },\n },\n presentation: {\n fullscreen: {\n viewport: 'overflow-hidden p-0 sm:p-0',\n popup:\n 'mt-0 flex h-dvh max-w-none flex-col overflow-hidden rounded-none border-0 data-starting-style:translate-y-0 data-starting-style:scale-100 data-ending-style:translate-y-0 data-ending-style:scale-100',\n },\n responsive: {\n viewport: 'overflow-hidden p-0 sm:p-8',\n popup:\n 'mt-0 flex h-dvh flex-col overflow-hidden rounded-none border-0 sm:mt-[8vh] sm:h-[min(80dvh,48rem)] sm:rounded-xl sm:border',\n },\n },\n },\n defaultVariants: { size: 'md' },\n});\n\nexport type DialogVariantProps = VariantProps<typeof dialogVariants>;\n","import { tv, type VariantProps } from '../../utils/tv';\n\n/**\n * Alert dialog styles. The shell (backdrop, viewport, popup) reuses `dialogVariants`;\n * these slots cover the confirmation layout: tone icon, text column and actions.\n */\nexport const alertDialogVariants = tv({\n slots: {\n popup: 'p-5',\n header: 'flex gap-3.5',\n icon: 'grid size-10 shrink-0 place-items-center rounded-lg',\n text: 'min-w-0 flex-1 pt-0.5',\n title: 'text-[15px] font-semibold tracking-tight text-foreground',\n description: 'mt-1.5 text-[13px] leading-6 text-muted-foreground text-pretty',\n footer: 'mt-5 flex flex-wrap justify-end gap-2.5',\n },\n variants: {\n tone: {\n destructive: { icon: 'bg-destructive/12 text-destructive-chip-text' },\n warning: { icon: 'bg-warning/12 text-warning-chip-text' },\n info: { icon: 'bg-info/12 text-info' },\n },\n },\n defaultVariants: { tone: 'destructive' },\n});\n\nexport type AlertDialogVariantProps = VariantProps<typeof alertDialogVariants>;\n","import { AlertDialog as BaseAlertDialog } from '@base-ui/react/alert-dialog';\nimport { Info, TriangleAlert } from 'lucide-react';\nimport type { HTMLAttributes, ReactNode } from 'react';\nimport { usePortalDir } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { Button, type ButtonProps } from '../Button';\nimport { dialogVariants, type DialogVariantProps } from '../Dialog/dialog.variants';\nimport { alertDialogVariants, type AlertDialogVariantProps } from './alertDialog.variants';\n\ntype Tone = NonNullable<AlertDialogVariantProps['tone']>;\ntype IconComponent = NonNullable<ButtonProps['icon']>;\n\nconst s = alertDialogVariants();\nconst TONE_ICON: Record<Tone, IconComponent> = { destructive: TriangleAlert, warning: TriangleAlert, info: Info };\n\n/** Alert dialog state container (open, defaultOpen, onOpenChange). Renders no element. */\nexport const AlertDialog = BaseAlertDialog.Root;\n/** Opens the alert dialog. Use `render={<Button />}` to style it as a kit button. */\nexport const AlertDialogTrigger = BaseAlertDialog.Trigger;\n\nexport interface AlertDialogContentProps extends Omit<BaseAlertDialog.Popup.Props, 'className'> {\n className?: string;\n /** Popup width; confirmations default to `sm`. */\n size?: DialogVariantProps['size'];\n /** Portal container; defaults to document.body. */\n container?: BaseAlertDialog.Portal.Props['container'];\n children?: ReactNode;\n}\n\n/**\n * The confirmation surface (role `alertdialog`). Focus is trapped inside, Escape closes it and\n * focus returns to the trigger. Unlike Dialog, an outside press does not dismiss it.\n */\nexport function AlertDialogContent({ size = 'sm', className, container, children, ...props }: AlertDialogContentProps) {\n const dir = usePortalDir();\n const v = dialogVariants({ size });\n return (\n <BaseAlertDialog.Portal container={container}>\n <BaseAlertDialog.Backdrop className={v.backdrop()} />\n <BaseAlertDialog.Viewport dir={dir} className={v.viewport()}>\n <BaseAlertDialog.Popup className={cn(v.popup(), s.popup(), className)} {...props}>\n {children}\n </BaseAlertDialog.Popup>\n </BaseAlertDialog.Viewport>\n </BaseAlertDialog.Portal>\n );\n}\n\nexport interface AlertDialogHeaderProps extends HTMLAttributes<HTMLDivElement> {\n /** Colour of the icon tile. */\n tone?: Tone;\n /** Overrides the tone's default icon (a lucide icon component). Pass `null` to hide it. */\n icon?: IconComponent | null;\n}\n\n/** Icon tile + text column holding AlertDialogTitle and AlertDialogDescription. */\nexport function AlertDialogHeader({\n tone = 'destructive',\n icon,\n className,\n children,\n ...props\n}: AlertDialogHeaderProps) {\n const IconCmp = icon === undefined ? TONE_ICON[tone] : icon;\n return (\n <div className={cn(s.header(), className)} {...props}>\n {IconCmp && (\n <span className={alertDialogVariants({ tone }).icon()}>\n <IconCmp size={20} aria-hidden />\n </span>\n )}\n <div className={s.text()}>{children}</div>\n </div>\n );\n}\n\nexport function AlertDialogTitle({\n className,\n ...props\n}: Omit<BaseAlertDialog.Title.Props, 'className'> & { className?: string }) {\n return <BaseAlertDialog.Title className={cn(s.title(), className)} {...props} />;\n}\n\nexport function AlertDialogDescription({\n className,\n ...props\n}: Omit<BaseAlertDialog.Description.Props, 'className'> & { className?: string }) {\n return <BaseAlertDialog.Description className={cn(s.description(), className)} {...props} />;\n}\n\n/** Right-aligned action row: Cancel first, the confirming action last. */\nexport function AlertDialogFooter({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return <div className={cn(s.footer(), className)} {...props} />;\n}\n\nexport interface AlertDialogActionProps extends Omit<BaseAlertDialog.Close.Props, 'className' | 'render'> {\n className?: string;\n /** Button style; confirmations of irreversible actions use `destructive`. */\n variant?: ButtonProps['variant'];\n size?: ButtonProps['size'];\n /** Leading icon (a lucide icon component). */\n icon?: ButtonProps['icon'];\n}\n\n/** The confirming action: runs `onClick`, then closes the dialog. */\nexport function AlertDialogAction({\n variant = 'destructive',\n size,\n icon,\n className,\n ...props\n}: AlertDialogActionProps) {\n return (\n <BaseAlertDialog.Close\n render={<Button variant={variant} size={size} icon={icon} className={className} />}\n {...props}\n />\n );\n}\n\n/** The neutral way out. Closes the dialog without side effects. */\nexport function AlertDialogCancel({ variant = 'ghost', size, icon, className, ...props }: AlertDialogActionProps) {\n return (\n <BaseAlertDialog.Close\n render={<Button variant={variant} size={size} icon={icon} className={className} />}\n {...props}\n />\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'AlertDialog',\n group: 'Overlays',\n status: 'stable',\n description:\n 'Confirmation that interrupts the user and demands a decision: tone icon (destructive, warning, info), title, consequence and Cancel + confirm actions. An outside press does not dismiss it. Parts: AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogDescription, AlertDialogFooter, AlertDialogCancel, AlertDialogAction.',\n primitive: '@base-ui/react/alert-dialog',\n pattern: 'alertdialog',\n keyboard: [\n ['Enter / Space', 'On the trigger: opens the dialog and moves focus inside'],\n ['Tab / Shift+Tab', 'Cycles focus between the actions (focus is trapped)'],\n ['Escape', 'Closes the dialog and returns focus to the trigger'],\n ],\n tokens: [\n 'popover',\n 'popover-foreground',\n 'border',\n 'background',\n 'muted-foreground',\n 'destructive',\n 'destructive-text',\n 'warning',\n 'warning-text',\n 'info',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const aspectRatioVariants = tv({\n base: 'relative w-full overflow-hidden *:absolute *:inset-0 *:size-full [&>img]:object-cover [&>video]:object-cover',\n variants: {\n radius: {\n none: 'rounded-none',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n },\n surface: {\n true: 'border border-border bg-secondary',\n },\n },\n defaultVariants: { radius: 'lg', surface: false },\n});\n\nexport type AspectRatioVariantProps = VariantProps<typeof aspectRatioVariants>;\n","import { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cn } from '../../utils/cn';\nimport { aspectRatioVariants, type AspectRatioVariantProps } from './aspect-ratio.variants';\n\nexport interface AspectRatioProps extends Omit<useRender.ComponentProps<'div'>, 'className'> {\n className?: string;\n /** Width / height, e.g. `16 / 9` (default), `4 / 3`, `1`. */\n ratio?: number;\n /** Corner radius: none, md, lg (default) or xl. */\n radius?: AspectRatioVariantProps['radius'];\n /** Paints a bordered secondary placeholder behind the media (while it loads, or when empty). */\n surface?: boolean;\n}\n\n/** Fixed-ratio box for media: direct children (img, video, iframe, a placeholder) fill it. */\nexport function AspectRatio({\n ratio = 16 / 9,\n radius,\n surface,\n className,\n style,\n render,\n ref,\n ...props\n}: AspectRatioProps) {\n return useRender({\n defaultTagName: 'div',\n render,\n ref,\n props: mergeProps<'div'>(props, {\n className: cn(aspectRatioVariants({ radius, surface }), className),\n style: { aspectRatio: String(ratio), ...style },\n }),\n });\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'AspectRatio',\n group: 'Layout',\n status: 'stable',\n description:\n 'A box locked to a width / height ratio (16:9 by default) for images, video and embeds; direct children fill it (object-cover). Radius none–xl and an optional bordered placeholder surface.',\n primitive: '@base-ui/react/use-render',\n tokens: ['border', 'secondary', 'muted-foreground', 'radius-lg'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const avatarVariants = tv({\n slots: {\n wrapper: 'relative inline-flex shrink-0 align-middle',\n root: 'relative inline-flex size-full items-center justify-center overflow-hidden font-bold tracking-tight select-none',\n image: 'absolute inset-0 size-full object-cover data-[error]:invisible data-[loading]:invisible',\n fallback: 'absolute inset-0 grid place-items-center leading-none',\n status: 'absolute -end-0.5 -bottom-0.5 rounded-full ring-2 ring-card',\n overflow:\n 'relative inline-flex shrink-0 items-center justify-center rounded-full bg-secondary font-semibold text-muted-foreground ring-2 ring-card',\n },\n variants: {\n size: {\n xs: { wrapper: 'size-6', root: 'text-[10px]', status: 'size-2', overflow: 'size-6 text-[10px]' },\n sm: { wrapper: 'size-8', root: 'text-[11px]', status: 'size-2.5', overflow: 'size-8 text-[11px]' },\n md: { wrapper: 'size-10', root: 'text-[13px]', status: 'size-3', overflow: 'size-10 text-[13px]' },\n lg: { wrapper: 'size-12', root: 'text-[15px]', status: 'size-3.5', overflow: 'size-12 text-[15px]' },\n xl: { wrapper: 'size-16', root: 'text-[20px]', status: 'size-4', overflow: 'size-16 text-[20px]' },\n },\n shape: {\n round: { root: 'rounded-full' },\n rounded: {},\n },\n tone: {\n primary: { root: 'bg-primary text-primary-foreground' },\n accent: { root: 'bg-accent text-accent-foreground' },\n secondary: { root: 'bg-secondary text-secondary-foreground' },\n violet: { root: 'bg-category-violet/20 text-foreground' },\n cyan: { root: 'bg-category-cyan/18 text-foreground' },\n amber: { root: 'bg-category-amber/22 text-foreground' },\n rose: { root: 'bg-category-rose/18 text-foreground' },\n },\n status: {\n online: { status: 'bg-success' },\n idle: { status: 'bg-warning' },\n busy: { status: 'bg-destructive' },\n offline: { status: 'bg-muted-foreground' },\n },\n ring: { true: { root: 'ring-2 ring-card' } },\n },\n compoundVariants: [\n { shape: 'rounded', size: 'xs', class: { root: 'rounded-md' } },\n { shape: 'rounded', size: 'sm', class: { root: 'rounded-lg' } },\n { shape: 'rounded', size: 'md', class: { root: 'rounded-[10px]' } },\n { shape: 'rounded', size: 'lg', class: { root: 'rounded-xl' } },\n { shape: 'rounded', size: 'xl', class: { root: 'rounded-2xl' } },\n ],\n defaultVariants: { size: 'md', shape: 'round', tone: 'primary' },\n});\n\nexport type AvatarVariantProps = VariantProps<typeof avatarVariants>;\nexport type AvatarSize = NonNullable<AvatarVariantProps['size']>;\nexport type AvatarStatus = NonNullable<AvatarVariantProps['status']>;\n","import { Avatar as BaseAvatar } from '@base-ui/react/avatar';\nimport {\n Children,\n createContext,\n isValidElement,\n useContext,\n type HTMLAttributes,\n type ReactNode,\n type Ref,\n} from 'react';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { avatarVariants, type AvatarSize, type AvatarStatus, type AvatarVariantProps } from './avatar.variants';\n\nconst AvatarGroupContext = createContext<{ size?: AvatarSize; ring: boolean } | null>(null);\n\nconst STATUS_LABEL: Record<AvatarStatus, string> = { online: 'online', idle: 'idle', busy: 'busy', offline: 'offline' };\n\n/** First letters of the first two words, upper-cased (\"Maria Ruiz\" → \"MR\"). */\nexport function getInitials(name: string) {\n const parts = name.trim().split(/\\s+/).filter(Boolean);\n return parts\n .slice(0, 2)\n .map((p) => p.charAt(0).toUpperCase())\n .join('');\n}\n\nexport interface AvatarProps\n extends Omit<HTMLAttributes<HTMLSpanElement>, 'className'>, Omit<AvatarVariantProps, 'ring'> {\n className?: string;\n ref?: Ref<HTMLSpanElement>;\n /** Image URL. While it loads, or if it fails, the initials show instead. */\n src?: string;\n /** Person or entity name: the accessible name and the source of the initials. */\n name?: string;\n /** Overrides the initials derived from `name`. */\n initials?: string;\n /** Replaces the initials (e.g. an icon for a bot or service account). */\n fallback?: ReactNode;\n /** Presence dot in the corner; also announced in the accessible name. */\n status?: AvatarStatus;\n /** Overrides the announced status text (e.g. for localisation). */\n statusLabel?: string;\n}\n\n/**\n * Image avatar with an initials fallback, built on Base UI Avatar. Exposed as one image\n * (role=\"img\") named after `name` and its status; without a name it is decorative.\n */\nexport function Avatar({\n src,\n name,\n initials,\n fallback,\n size,\n shape,\n tone,\n status,\n statusLabel,\n className,\n ...props\n}: AvatarProps) {\n const group = useContext(AvatarGroupContext);\n const s = avatarVariants({ size: size ?? group?.size, shape, tone, status, ring: group?.ring });\n const statusText = status ? (statusLabel ?? STATUS_LABEL[status]) : undefined;\n const label = name ? (statusText ? `${name} (${statusText})` : name) : undefined;\n return (\n <span\n role={label ? 'img' : undefined}\n aria-label={label}\n aria-hidden={label ? undefined : true}\n className={cn(s.wrapper(), className)}\n {...props}\n >\n <BaseAvatar.Root className={s.root()}>\n <BaseAvatar.Fallback className={s.fallback()}>\n {fallback ?? initials ?? (name ? getInitials(name) : null)}\n </BaseAvatar.Fallback>\n {src && <BaseAvatar.Image src={src} alt=\"\" className={s.image()} />}\n </BaseAvatar.Root>\n {status && <span className={s.status()} data-status={status} />}\n </span>\n );\n}\n\nexport interface AvatarGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, 'className'> {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n /** Size applied to every child avatar and the overflow chip. */\n size?: AvatarSize;\n /** Max avatars shown; the rest collapse into a \"+N\" chip. */\n max?: number;\n /** Accessible name of the group (e.g. \"Project members\"). */\n label?: string;\n children?: ReactNode;\n}\n\n/** Overlapping stack of avatars with a \"+N more\" overflow chip. */\nexport function AvatarGroup({ size = 'md', max, label, className, children, ...props }: AvatarGroupProps) {\n const { t } = useI18n();\n const items = Children.toArray(children).filter(isValidElement);\n const shown = max !== undefined ? items.slice(0, max) : items;\n const extra = items.length - shown.length;\n const s = avatarVariants({ size });\n return (\n <AvatarGroupContext value={{ size, ring: true }}>\n <div role=\"group\" aria-label={label} className={cn('flex items-center -space-x-2.5', className)} {...props}>\n {shown}\n {extra > 0 && (\n <span className={s.overflow()}>\n +{extra}\n <span className=\"sr-only\"> {t('avatar.more')}</span>\n </span>\n )}\n </div>\n </AvatarGroupContext>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Avatar',\n group: 'Display',\n status: 'stable',\n description:\n 'Person or entity avatar: image with an initials (or icon) fallback, five sizes (xs–xl), round or rounded, tinted tones and an optional presence dot. AvatarGroup stacks avatars with a \"+N more\" overflow.',\n primitive: '@base-ui/react/avatar',\n pattern: 'img',\n tokens: [\n 'primary',\n 'primary-foreground',\n 'accent',\n 'secondary',\n 'category-violet',\n 'category-cyan',\n 'category-amber',\n 'category-rose',\n 'success',\n 'warning',\n 'destructive',\n 'card',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\n/**\n * Tone × variant matrix. Text on a tinted surface uses the contrast-safe `*-text` aliases;\n * info and the category tones have no text alias, so they pair `text-foreground` with a\n * coloured dot instead of colouring the text itself.\n */\nexport const badgeVariants = tv({\n slots: {\n root: 'inline-flex max-w-full shrink-0 items-center gap-1.5 font-semibold whitespace-nowrap select-none',\n dot: 'size-1.5 shrink-0 rounded-full',\n remove: [\n '-me-1 grid size-4 shrink-0 cursor-pointer place-items-center rounded text-current opacity-70 transition-colors motion-reduce:transition-none',\n 'hover:bg-foreground/10 hover:opacity-100',\n 'focus-visible:opacity-100 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus-ring',\n ],\n },\n variants: {\n tone: {\n neutral: { dot: 'bg-muted-foreground' },\n primary: { dot: 'bg-primary' },\n success: { dot: 'bg-success' },\n warning: { dot: 'bg-warning' },\n destructive: { dot: 'bg-destructive' },\n info: { dot: 'bg-info' },\n violet: { dot: 'bg-category-violet' },\n cyan: { dot: 'bg-category-cyan' },\n amber: { dot: 'bg-category-amber' },\n rose: { dot: 'bg-category-rose' },\n },\n variant: {\n soft: {},\n outline: { root: 'border bg-transparent' },\n solid: { dot: 'bg-current' },\n },\n size: {\n /** Follows `data-density` (comfortable = md). */\n auto: { root: 'h-chip px-2.5 font-mono text-[10.5px]' },\n sm: { root: 'h-5 px-2 font-mono text-[10px]' },\n md: { root: 'h-[22px] px-2.5 font-mono text-[10.5px]' },\n lg: { root: 'h-6 px-2.5 text-[11.5px]' },\n },\n shape: {\n rounded: { root: 'rounded-md' },\n pill: { root: 'rounded-full' },\n },\n },\n compoundVariants: [\n // soft\n { variant: 'soft', tone: 'neutral', class: { root: 'bg-muted-foreground/16 text-foreground' } },\n { variant: 'soft', tone: 'primary', class: { root: 'bg-primary/14 text-primary-chip-text' } },\n { variant: 'soft', tone: 'success', class: { root: 'bg-success/15 text-success-chip-text' } },\n { variant: 'soft', tone: 'warning', class: { root: 'bg-warning/16 text-warning-chip-text' } },\n { variant: 'soft', tone: 'destructive', class: { root: 'bg-destructive/15 text-destructive-chip-text' } },\n { variant: 'soft', tone: 'info', class: { root: 'bg-info/15 text-foreground' } },\n { variant: 'soft', tone: 'violet', class: { root: 'bg-category-violet/18 text-foreground' } },\n { variant: 'soft', tone: 'cyan', class: { root: 'bg-category-cyan/18 text-foreground' } },\n { variant: 'soft', tone: 'amber', class: { root: 'bg-category-amber/20 text-foreground' } },\n { variant: 'soft', tone: 'rose', class: { root: 'bg-category-rose/18 text-foreground' } },\n // outline\n { variant: 'outline', tone: 'neutral', class: { root: 'border-border text-muted-foreground' } },\n { variant: 'outline', tone: 'primary', class: { root: 'border-primary/45 text-primary-text' } },\n { variant: 'outline', tone: 'success', class: { root: 'border-success/45 text-success-text' } },\n { variant: 'outline', tone: 'warning', class: { root: 'border-warning/50 text-warning-text' } },\n { variant: 'outline', tone: 'destructive', class: { root: 'border-destructive/45 text-destructive-text' } },\n { variant: 'outline', tone: 'info', class: { root: 'border-info/45 text-foreground' } },\n { variant: 'outline', tone: 'violet', class: { root: 'border-category-violet/45 text-foreground' } },\n { variant: 'outline', tone: 'cyan', class: { root: 'border-category-cyan/45 text-foreground' } },\n { variant: 'outline', tone: 'amber', class: { root: 'border-category-amber/50 text-foreground' } },\n { variant: 'outline', tone: 'rose', class: { root: 'border-category-rose/45 text-foreground' } },\n // solid — tone fill with its paired foreground. Category tones have no paired\n // foreground that holds contrast in every theme, so solid = a stronger tint.\n { variant: 'solid', tone: 'neutral', class: { root: 'bg-foreground text-background' } },\n { variant: 'solid', tone: 'primary', class: { root: 'bg-primary text-primary-foreground' } },\n { variant: 'solid', tone: 'success', class: { root: 'bg-success text-primary-foreground' } },\n { variant: 'solid', tone: 'warning', class: { root: 'bg-warning text-primary-foreground' } },\n { variant: 'solid', tone: 'destructive', class: { root: 'bg-destructive text-destructive-foreground' } },\n { variant: 'solid', tone: 'info', class: { root: 'bg-info text-background' } },\n {\n variant: 'solid',\n tone: 'violet',\n class: { root: 'bg-category-violet/30 text-foreground', dot: 'bg-category-violet' },\n },\n { variant: 'solid', tone: 'cyan', class: { root: 'bg-category-cyan/30 text-foreground', dot: 'bg-category-cyan' } },\n {\n variant: 'solid',\n tone: 'amber',\n class: { root: 'bg-category-amber/32 text-foreground', dot: 'bg-category-amber' },\n },\n { variant: 'solid', tone: 'rose', class: { root: 'bg-category-rose/30 text-foreground', dot: 'bg-category-rose' } },\n ],\n defaultVariants: { tone: 'neutral', variant: 'soft', size: 'auto', shape: 'rounded' },\n});\n\nexport type BadgeVariantProps = VariantProps<typeof badgeVariants>;\nexport type BadgeTone = NonNullable<BadgeVariantProps['tone']>;\n","import { X } from 'lucide-react';\nimport type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { badgeVariants, type BadgeVariantProps } from './badge.variants';\n\nexport interface BadgeProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'className'>, BadgeVariantProps {\n className?: string;\n ref?: Ref<HTMLSpanElement>;\n /** Leading dot in the tone colour (inherits the text colour on `solid`). */\n dot?: boolean;\n /** Renders a remove button; called on click, Enter or Space. */\n onRemove?: () => void;\n /** Accessible name of the remove button. Defaults to \"Remove <label>\" for string children. */\n removeLabel?: string;\n children?: ReactNode;\n}\n\n/** Compact label for status, counts and categories. Optionally removable (tags). */\nexport function Badge({\n tone,\n variant,\n size,\n shape,\n dot = false,\n onRemove,\n removeLabel,\n className,\n children,\n ...props\n}: BadgeProps) {\n const { t } = useI18n();\n const s = badgeVariants({ tone, variant, size, shape });\n const label =\n removeLabel ?? (typeof children === 'string' ? t('common.removeItem', { label: children }) : t('common.remove'));\n return (\n <span className={cn(s.root(), onRemove && 'pe-1.5', className)} {...props}>\n {dot && <span aria-hidden className={s.dot()} />}\n {children}\n {onRemove && (\n <button type=\"button\" aria-label={label} onClick={onRemove} className={s.remove()}>\n <X size={11} strokeWidth={2.4} aria-hidden />\n </button>\n )}\n </span>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Badge',\n group: 'Display',\n status: 'stable',\n description:\n 'Compact label for status, counts and categories. Semantic tones (neutral, primary, success, warning, destructive, info) plus four category tones, in soft, outline or solid; optional dot and remove button for tags.',\n pattern: 'button (remove)',\n keyboard: [\n ['Tab', 'Moves focus to the remove button, when present'],\n ['Enter', 'Activates the remove button'],\n ['Space', 'Activates the remove button'],\n ],\n tokens: [\n 'primary',\n 'primary-text',\n 'success',\n 'success-text',\n 'warning',\n 'warning-text',\n 'destructive',\n 'destructive-text',\n 'info',\n 'category-violet',\n 'category-cyan',\n 'category-amber',\n 'category-rose',\n 'muted-foreground',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const blockquoteVariants = tv({\n slots: {\n root: 'm-0 min-w-0',\n quote: 'm-0 text-foreground text-pretty',\n mark: 'shrink-0 text-primary-text',\n caption: 'mt-3 flex min-w-0 items-center gap-2.5 text-[12.5px] text-muted-foreground',\n avatar: 'shrink-0',\n source: 'flex min-w-0 flex-col',\n name: 'truncate font-semibold text-foreground not-italic',\n detail: 'truncate',\n link: 'underline underline-offset-2 hover:text-foreground focus-visible:rounded-sm focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n },\n variants: {\n variant: {\n /** Inline-start rule, for quotes inside prose. */\n default: { root: 'border-s-2 border-primary/70 ps-4', quote: 'text-[14px] leading-6' },\n /** A card for testimonials and feedback. */\n card: { root: 'rounded-xl border border-border bg-card p-5 shadow-sm', quote: 'text-[14px] leading-6' },\n /** Large, centred pull quote for editorial pages. */\n pull: {\n root: 'mx-auto max-w-2xl text-center',\n quote: 'text-[19px] leading-8 font-medium tracking-tight',\n caption: 'justify-center',\n },\n },\n },\n defaultVariants: { variant: 'default' },\n});\n\nexport type BlockquoteVariantProps = VariantProps<typeof blockquoteVariants>;\n","import { Quote } from 'lucide-react';\nimport type { HTMLAttributes, ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { blockquoteVariants, type BlockquoteVariantProps } from './blockquote.variants';\n\nexport interface BlockquoteProps extends Omit<HTMLAttributes<HTMLElement>, 'className'>, BlockquoteVariantProps {\n className?: string;\n /** The quoted content. */\n children: ReactNode;\n /** Who said or wrote it (rendered in a `<cite>`). */\n source?: ReactNode;\n /** Role, company or publication shown after the source. */\n sourceDetail?: ReactNode;\n /** URL of the original; sets the blockquote `cite` attribute and links the source. */\n cite?: string;\n /** Leading media in the caption, e.g. an Avatar. */\n avatar?: ReactNode;\n /** Show a decorative quote mark (default on for the card and pull variants). */\n showMark?: boolean;\n}\n\n/**\n * Quoted content with its attribution: a `<figure>` holding the `<blockquote>` and a\n * `<figcaption>` whose `<cite>` names the source (linked when `cite` is a URL).\n */\nexport function Blockquote({\n variant = 'default',\n className,\n children,\n source,\n sourceDetail,\n cite,\n avatar,\n showMark,\n ...props\n}: BlockquoteProps) {\n const s = blockquoteVariants({ variant });\n const mark = showMark ?? variant !== 'default';\n const hasCaption = source != null || sourceDetail != null;\n return (\n <figure className={cn(s.root(), className)} {...props}>\n {mark && (\n <Quote\n size={variant === 'pull' ? 22 : 18}\n aria-hidden\n className={cn(s.mark(), variant === 'pull' ? 'mx-auto mb-3' : 'mb-2.5')}\n />\n )}\n <blockquote cite={cite} className={s.quote()}>\n {children}\n </blockquote>\n {hasCaption && (\n <figcaption className={s.caption()}>\n {avatar && <span className={s.avatar()}>{avatar}</span>}\n <span className={s.source()}>\n {source != null && (\n <cite className={s.name()}>\n {cite ? (\n <a href={cite} className={s.link()}>\n {source}\n </a>\n ) : (\n source\n )}\n </cite>\n )}\n {sourceDetail != null && <span className={s.detail()}>{sourceDetail}</span>}\n </span>\n </figcaption>\n )}\n </figure>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Blockquote',\n group: 'Display',\n status: 'beta',\n description:\n 'Quoted content with its citation: a figure with the blockquote and a figcaption whose cite names the source (linked when `cite` is a URL). Variants: an inline-start rule for prose, a card for testimonials, a centred pull quote.',\n pattern: 'figure + blockquote + figcaption/cite',\n keyboard: [['Tab', 'Moves to the source link when `cite` is set']],\n tokens: ['primary', 'primary-text', 'card', 'border', 'foreground', 'muted-foreground', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const bottomSheetVariants = tv({\n slots: {\n backdrop: [\n 'fixed inset-0 z-50 bg-background/70 backdrop-blur-[3px] transition-opacity duration-300 motion-reduce:transition-none',\n 'opacity-[calc(1-var(--drawer-swipe-progress,0))] data-swiping:duration-0',\n 'data-starting-style:opacity-0 data-ending-style:opacity-0',\n ],\n viewport: 'fixed inset-0 z-50 flex items-end justify-center',\n popup: [\n 'relative flex max-h-[calc(100dvh-1rem)] min-h-0 w-full max-w-2xl flex-col rounded-t-2xl border border-b-0 border-border bg-popover text-popover-foreground shadow-lg outline-none',\n '[transform:translateY(calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y,0px)))]',\n '[padding-bottom:max(0px,calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y,0px)))]',\n 'transition-transform duration-300 ease-out motion-reduce:transition-none data-swiping:duration-0 data-swiping:select-none',\n 'data-starting-style:[transform:translateY(100%)] data-ending-style:[transform:translateY(100%)]',\n ],\n handleArea: 'flex shrink-0 justify-center pt-2 pb-1 touch-none',\n handle: [\n 'group grid h-6 w-16 cursor-grab place-items-center rounded-full active:cursor-grabbing',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n handleBar:\n 'h-1 w-10 rounded-full bg-border transition-colors group-hover:bg-muted-foreground/60 motion-reduce:transition-none',\n header: 'flex shrink-0 flex-col gap-0.5 border-b border-border px-5 pt-1 pb-3 pe-14',\n title: 'text-[15px] font-semibold tracking-tight text-foreground',\n description: 'text-[12px] text-muted-foreground text-pretty',\n content: 'min-h-0 flex-1 overflow-y-auto overscroll-contain px-5 py-4 touch-auto',\n footer:\n 'flex shrink-0 items-center justify-end gap-2.5 border-t border-border px-5 py-3 pb-[calc(0.75rem+env(safe-area-inset-bottom,0px))]',\n close: [\n 'absolute end-3 top-3 grid size-8 place-items-center rounded-lg text-muted-foreground transition-colors',\n 'hover:bg-secondary/60 hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n },\n});\n\nexport type BottomSheetVariantProps = VariantProps<typeof bottomSheetVariants>;\n","import { Drawer as BaseDrawer } from '@base-ui/react/drawer';\nimport { X } from 'lucide-react';\nimport { createContext, useContext, useId, useState, type KeyboardEvent, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { bottomSheetVariants } from './bottom-sheet.variants';\n\nexport type BottomSheetSnapPoint = BaseDrawer.Root.SnapPoint;\n\nexport interface BottomSheetLabels {\n /** Accessible name of the drag handle. */\n handle: string;\n /** Keyboard hint read with the handle. */\n handleHint: string;\n close: string;\n /** Announced when the sheet settles on a snap point. */\n position: (index: number, total: number) => string;\n}\n\nconst defaultLabels: BottomSheetLabels = {\n handle: 'Resize sheet',\n handleHint: 'Arrow Up expands, Arrow Down collapses.',\n close: 'Close',\n position: (i, n) => (i === n - 1 ? 'Sheet expanded.' : `Sheet at height ${i + 1} of ${n}.`),\n};\n\ninterface SheetContextValue {\n snapPoints: BottomSheetSnapPoint[];\n snap: BottomSheetSnapPoint | null;\n setSnap: (next: BottomSheetSnapPoint) => void;\n labels: BottomSheetLabels;\n}\n\nconst SheetContext = createContext<SheetContextValue | null>(null);\n\nexport interface BottomSheetProps extends Omit<\n BaseDrawer.Root.Props,\n 'swipeDirection' | 'snapPoints' | 'snapPoint' | 'defaultSnapPoint' | 'onSnapPointChange'\n> {\n /**\n * Heights the sheet rests at, smallest first: 0–1 is a fraction of the viewport, larger\n * numbers are px, strings take px/rem. The last one should be the expanded height (1).\n */\n snapPoints?: BottomSheetSnapPoint[];\n snapPoint?: BottomSheetSnapPoint | null;\n /** Snap point used each time the sheet opens (default: the first). */\n defaultSnapPoint?: BottomSheetSnapPoint;\n onSnapPointChange?: (snapPoint: BottomSheetSnapPoint | null) => void;\n labels?: Partial<BottomSheetLabels>;\n}\n\n/**\n * Mobile sheet on Base UI Drawer: snaps between heights, drags (or swipes down to close)\n * from anywhere outside the scrollable content, and its handle is a keyboard control.\n */\nexport function BottomSheet({\n snapPoints = [0.5, 1],\n snapPoint,\n defaultSnapPoint,\n onSnapPointChange,\n onOpenChange,\n labels: labelsProp,\n children,\n ...props\n}: BottomSheetProps) {\n const initial = defaultSnapPoint ?? snapPoints[0] ?? 1;\n const [inner, setInner] = useState<BottomSheetSnapPoint | null>(initial);\n const snap = snapPoint !== undefined ? snapPoint : inner;\n const labels = { ...defaultLabels, ...labelsProp };\n const setSnap = (next: BottomSheetSnapPoint | null) => {\n setInner(next);\n onSnapPointChange?.(next);\n };\n return (\n <SheetContext.Provider value={{ snapPoints, snap, setSnap, labels }}>\n <BaseDrawer.Root\n swipeDirection=\"down\"\n snapPoints={snapPoints}\n snapPoint={snap}\n onSnapPointChange={(next) => setSnap(next)}\n onOpenChange={(open, details) => {\n if (open) setSnap(initial);\n onOpenChange?.(open, details);\n }}\n {...props}\n >\n {children}\n </BaseDrawer.Root>\n </SheetContext.Provider>\n );\n}\n\n/** Opens the sheet. Use `render={<Button />}` to style it as a kit button. */\nexport const BottomSheetTrigger = BaseDrawer.Trigger;\n/** Closes the sheet. Use `render={<Button variant=\"ghost\" />}` for footer actions. */\nexport const BottomSheetClose = BaseDrawer.Close;\n\nfunction SheetHandle() {\n const ctx = useContext(SheetContext);\n const hintId = useId();\n const s = bottomSheetVariants();\n if (!ctx) return null;\n const { snapPoints, snap, setSnap, labels } = ctx;\n const n = snapPoints.length;\n const at = Math.max(\n 0,\n snapPoints.findIndex((p) => p === snap),\n );\n const to = (i: number) => {\n const next = snapPoints[Math.min(Math.max(i, 0), n - 1)];\n if (next !== undefined && next !== snap) setSnap(next);\n };\n const onKeyDown = (e: KeyboardEvent<HTMLButtonElement>) => {\n const keys: Record<string, number> = {\n ArrowUp: at + 1,\n ArrowDown: at - 1,\n Home: 0,\n End: n - 1,\n PageUp: n - 1,\n PageDown: 0,\n };\n const target = keys[e.key];\n if (target === undefined) return;\n e.preventDefault();\n to(target);\n };\n return (\n <div className={s.handleArea()}>\n <button\n type=\"button\"\n className={s.handle()}\n aria-label={labels.handle}\n aria-describedby={hintId}\n onKeyDown={onKeyDown}\n onClick={() => to(at === n - 1 ? 0 : at + 1)}\n >\n <span aria-hidden className={s.handleBar()} />\n </button>\n <span id={hintId} hidden>\n {labels.handleHint}\n </span>\n <span role=\"status\" className=\"sr-only\">\n {labels.position(at, n)}\n </span>\n </div>\n );\n}\n\nexport interface BottomSheetContentProps extends Omit<BaseDrawer.Popup.Props, 'className' | 'title'> {\n className?: string;\n title?: ReactNode;\n description?: ReactNode;\n /** Fixed action bar under the scrollable content. */\n footer?: ReactNode;\n showClose?: boolean;\n container?: BaseDrawer.Portal.Props['container'];\n children?: ReactNode;\n}\n\n/**\n * The sheet: portal, backdrop, viewport and popup with the keyboard-accessible handle, an\n * optional header (title, description), scrollable content and a fixed footer.\n */\nexport function BottomSheetContent({\n className,\n title,\n description,\n footer,\n showClose = true,\n container,\n children,\n ...props\n}: BottomSheetContentProps) {\n const ctx = useContext(SheetContext);\n const s = bottomSheetVariants();\n return (\n <BaseDrawer.Portal container={container}>\n <BaseDrawer.Backdrop className={s.backdrop()} />\n <BaseDrawer.Viewport className={s.viewport()}>\n <BaseDrawer.Popup className={cn(s.popup(), className)} {...props}>\n <SheetHandle />\n {(title != null || description != null) && (\n <div className={s.header()}>\n {title != null && <BaseDrawer.Title className={s.title()}>{title}</BaseDrawer.Title>}\n {description != null && (\n <BaseDrawer.Description className={s.description()}>{description}</BaseDrawer.Description>\n )}\n </div>\n )}\n <BaseDrawer.Content className={s.content()}>{children}</BaseDrawer.Content>\n {footer != null && <div className={s.footer()}>{footer}</div>}\n {showClose && (\n <BaseDrawer.Close aria-label={ctx?.labels.close ?? defaultLabels.close} className={s.close()}>\n <X size={16} aria-hidden />\n </BaseDrawer.Close>\n )}\n </BaseDrawer.Popup>\n </BaseDrawer.Viewport>\n </BaseDrawer.Portal>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'BottomSheet',\n group: 'Overlays',\n status: 'beta',\n description:\n 'Mobile sheet that rests at snap points (a peek height and expanded by default): drag or swipe it between heights or down to close, or use the handle from the keyboard. Modal like a dialog: focus is trapped, Escape closes and focus returns to the trigger.',\n primitive: '@base-ui/react/drawer (snapPoints)',\n pattern: 'modal dialog with a resize handle button',\n keyboard: [\n ['Enter / Space (trigger)', 'Opens the sheet at its first snap point and moves focus inside'],\n ['ArrowUp / ArrowDown (handle)', 'Next taller / shorter snap point'],\n ['Home / End (handle)', 'Smallest / tallest snap point'],\n ['Enter / Space (handle)', 'Cycles through the snap points'],\n ['Tab / Shift+Tab', 'Moves focus within the sheet (trapped)'],\n ['Escape', 'Closes the sheet and returns focus to the trigger'],\n ],\n tokens: ['popover', 'popover-foreground', 'background', 'border', 'muted-foreground', 'secondary', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const linkVariants = tv({\n slots: {\n root: [\n 'cursor-pointer rounded-sm font-medium underline-offset-4 transition-colors',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n 'aria-disabled:pointer-events-none aria-disabled:opacity-50',\n ],\n externalIcon: 'ms-1 inline-block shrink-0 align-[-0.125em]',\n },\n variants: {\n tone: {\n primary: { root: 'text-primary-text' },\n muted: { root: 'text-muted-foreground hover:text-foreground' },\n inherit: { root: 'text-inherit' },\n },\n underline: {\n hover: { root: 'no-underline hover:underline' },\n always: { root: 'underline decoration-current/40 hover:decoration-current' },\n none: { root: 'no-underline' },\n },\n },\n // Inline links are underlined by default (WCAG 1.4.1: not by colour alone); standalone links opt out.\n defaultVariants: { tone: 'primary', underline: 'always' },\n});\n\nexport type LinkVariantProps = VariantProps<typeof linkVariants>;\n","import { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { ExternalLink } from 'lucide-react';\nimport {\n createContext,\n createElement,\n useContext,\n type ComponentType,\n type ComponentPropsWithRef,\n type ReactNode,\n} from 'react';\nimport { cn } from '../../utils/cn';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { linkVariants, type LinkVariantProps } from './link.variants';\n\n/** A router link component that accepts anchor props (at least `href`), e.g. an adapter around a router's Link. */\nexport type LinkComponent = ComponentType<ComponentPropsWithRef<'a'>>;\n\nconst LinkContext = createContext<LinkComponent | null>(null);\n\nexport interface LinkProviderProps {\n /** The app's router link. Internal `Link`s (and kit parts built on it) render through it. */\n component: LinkComponent;\n children?: ReactNode;\n}\n\n/**\n * Supplies the app's router link to every kit `Link`, so internal navigation stays client-side.\n *\n * ```tsx\n * const RouterLink = ({ href = '', ...props }) => <NextLink href={href} {...props} />;\n * <LinkProvider component={RouterLink}>…</LinkProvider>\n * ```\n */\nexport function LinkProvider({ component, children }: LinkProviderProps) {\n return <LinkContext.Provider value={component}>{children}</LinkContext.Provider>;\n}\n\n/** The router link supplied by the nearest LinkProvider, or null. */\nexport function useLinkComponent() {\n return useContext(LinkContext);\n}\n\nexport interface LinkProps extends Omit<useRender.ComponentProps<'a'>, 'className'>, LinkVariantProps {\n className?: string;\n /**\n * Opens in a new tab (`target=\"_blank\"`, `rel=\"noopener noreferrer\"`), adds the external icon and a\n * visually hidden hint, and bypasses the router link.\n */\n external?: boolean;\n /** Visually hidden text appended to external links. */\n externalLabel?: string;\n}\n\n/**\n * Styled anchor. Renders the LinkProvider's router link when one is set (unless `external`),\n * or any element passed through `render`.\n */\nexport function Link({\n tone,\n underline,\n external = false,\n externalLabel: externalLabelProp,\n className,\n render,\n ref,\n children,\n ...props\n}: LinkProps) {\n const { t } = useI18n();\n const externalLabel = externalLabelProp ?? t('link.external');\n const RouterLink = useContext(LinkContext);\n const s = linkVariants({ tone, underline });\n const resolvedRender = render ?? (RouterLink && !external ? createElement(RouterLink) : undefined);\n const ownProps: useRender.ElementProps<'a'> = {\n className: cn(s.root(), className),\n ...(external ? { target: '_blank', rel: 'noopener noreferrer' } : {}),\n children: (\n <>\n {children}\n {external && (\n <>\n <ExternalLink size={12} className={s.externalIcon()} aria-hidden />\n <span className=\"sr-only\"> {externalLabel}</span>\n </>\n )}\n </>\n ),\n };\n return useRender({\n defaultTagName: 'a',\n render: resolvedRender,\n ref,\n props: mergeProps<'a'>(props, ownProps),\n });\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Link',\n group: 'Navigation',\n status: 'stable',\n description:\n 'Styled anchor in brand green, underlined by default so inline links do not rely on colour (WCAG 1.4.1); standalone links (nav, cards, actions) pass underline=\"hover\" or \"none\". `external` adds the external icon, a hidden \"opens in a new tab\" hint and safe rel/target. LinkProvider supplies the app router link so internal links navigate client-side; `render` swaps the element per link.',\n primitive: '@base-ui/react/use-render',\n pattern: 'link',\n keyboard: [\n ['Enter', 'Follows the link'],\n ['Tab', 'Moves focus to and from the link'],\n ],\n tokens: ['primary-text', 'muted-foreground', 'foreground', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nconst focusRing = 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring';\n\nexport const breadcrumbsVariants = tv({\n slots: {\n root: 'min-w-0',\n list: 'flex flex-wrap items-center gap-2.5 text-[13px]',\n item: 'inline-flex min-w-0 items-center gap-2.5',\n link: [\n 'truncate rounded-sm text-muted-foreground no-underline transition-colors hover:text-foreground hover:no-underline',\n focusRing,\n ],\n iconLink: [\n 'grid size-7 place-items-center rounded-md text-muted-foreground transition-colors hover:bg-secondary/60 hover:text-foreground',\n focusRing,\n ],\n current: 'truncate font-semibold text-foreground',\n separator: 'inline-flex shrink-0 select-none text-muted-foreground/40',\n ellipsis: [\n 'grid h-7 cursor-pointer place-items-center rounded-md px-1.5 text-muted-foreground transition-colors hover:bg-secondary/60 hover:text-foreground',\n focusRing,\n ],\n },\n variants: {\n separator: {\n chevron: {},\n slash: {},\n },\n },\n defaultVariants: { separator: 'chevron' },\n});\n\nexport type BreadcrumbsVariantProps = VariantProps<typeof breadcrumbsVariants>;\n","import { ChevronRight, MoreHorizontal } from 'lucide-react';\nimport {\n Fragment,\n useEffect,\n useRef,\n useState,\n type ComponentType,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { RTL_FLIP } from '../../utils/rtl';\nimport { Link } from '../Link';\nimport { breadcrumbsVariants, type BreadcrumbsVariantProps } from './breadcrumbs.variants';\n\ntype IconComponent = ComponentType<{ size?: number; 'aria-hidden'?: boolean }>;\n\nexport interface BreadcrumbItem {\n /** Visible text (also the accessible name when `hideLabel` is set). */\n label: string;\n /** Destination. The last item usually has none; it is the current page. */\n href?: string;\n /** Leading icon; with `hideLabel` the item renders icon-only (e.g. Home). */\n icon?: IconComponent;\n /** Show only the icon; the label stays as screen-reader text. */\n hideLabel?: boolean;\n /** Custom element for the link (e.g. a router link); forwarded to Link's `render`. */\n render?: ReactElement;\n /** Monospaced label, for identifiers such as slugs. */\n mono?: boolean;\n}\n\nexport interface BreadcrumbsProps extends BreadcrumbsVariantProps {\n items: BreadcrumbItem[];\n className?: string;\n ref?: Ref<HTMLElement>;\n /** Accessible name of the nav landmark. */\n 'aria-label'?: string;\n /**\n * Collapse the middle items into an ellipsis button when there are more items than this.\n * Keeps the first item and the last `maxItems - 1`. The button expands the full trail in place.\n */\n maxItems?: number;\n /** Accessible name of the ellipsis button; receives the number of hidden items. */\n expandLabel?: (hidden: number) => string;\n}\n\nfunction Separator({ kind, className }: { kind: 'chevron' | 'slash'; className: string }) {\n return (\n <span className={className} aria-hidden>\n {kind === 'chevron' ? <ChevronRight size={14} className={RTL_FLIP} /> : '/'}\n </span>\n );\n}\n\n/**\n * Location trail. A `nav` landmark with an ordered list; the last item is the current page\n * (`aria-current=\"page\"`). Internal links go through the kit Link, so a LinkProvider applies.\n */\nexport function Breadcrumbs({\n items,\n separator = 'chevron',\n maxItems,\n expandLabel,\n className,\n ref,\n 'aria-label': ariaLabelProp,\n}: BreadcrumbsProps) {\n const { t } = useI18n();\n const ariaLabel = ariaLabelProp ?? t('breadcrumbs.label');\n const expandText = expandLabel ?? ((count: number) => t('breadcrumbs.expand', { count }));\n const s = breadcrumbsVariants({ separator });\n const [expanded, setExpanded] = useState(false);\n const firstRevealed = useRef<HTMLLIElement>(null);\n const shouldFocus = useRef(false);\n\n const collapse = !expanded && maxItems != null && maxItems >= 2 && items.length > maxItems;\n const tailCount = collapse ? maxItems - 1 : 0;\n const hiddenCount = collapse ? items.length - 1 - tailCount : 0;\n\n useEffect(() => {\n if (expanded && shouldFocus.current) {\n shouldFocus.current = false;\n firstRevealed.current?.querySelector<HTMLElement>('a')?.focus();\n }\n }, [expanded]);\n\n const renderItem = (item: BreadcrumbItem, index: number): ReactNode => {\n const isLast = index === items.length - 1;\n const Icon = item.icon;\n const label = item.hideLabel ? <span className=\"sr-only\">{item.label}</span> : item.label;\n const content = (\n <>\n {Icon && <Icon size={item.hideLabel ? 15 : 14} aria-hidden />}\n {item.mono ? <span className=\"font-mono\">{label}</span> : label}\n </>\n );\n if (isLast || item.href == null) {\n return (\n <span\n className={cn(\n item.hideLabel ? s.iconLink() : s.current(),\n !isLast && 'font-normal text-muted-foreground',\n Icon && !item.hideLabel && 'inline-flex items-center gap-1.5',\n )}\n aria-current={isLast ? 'page' : undefined}\n >\n {content}\n </span>\n );\n }\n return (\n <Link\n href={item.href}\n render={item.render}\n tone=\"muted\"\n underline=\"none\"\n className={cn(\n item.hideLabel ? s.iconLink() : s.link(),\n 'font-normal',\n Icon && !item.hideLabel && 'inline-flex items-center gap-1.5',\n )}\n >\n {content}\n </Link>\n );\n };\n\n const indexes = items.map((_, i) => i);\n const visible = collapse ? [0, ...indexes.slice(items.length - tailCount)] : indexes;\n\n return (\n <nav ref={ref} aria-label={ariaLabel} className={cn(s.root(), className)}>\n <ol className={s.list()}>\n {visible.map((index, position) => {\n const item = items[index];\n if (!item) return null;\n const showEllipsis = collapse && position === 1;\n return (\n <Fragment key={`${index}-${item.label}`}>\n {showEllipsis && (\n <li className={s.item()}>\n <button\n type=\"button\"\n className={s.ellipsis()}\n aria-label={expandText(hiddenCount)}\n onClick={() => {\n shouldFocus.current = true;\n setExpanded(true);\n }}\n >\n <MoreHorizontal size={16} aria-hidden />\n </button>\n <Separator kind={separator} className={s.separator()} />\n </li>\n )}\n <li className={s.item()} ref={expanded && index === 1 ? firstRevealed : undefined}>\n {renderItem(item, index)}\n {index < items.length - 1 && <Separator kind={separator} className={s.separator()} />}\n </li>\n </Fragment>\n );\n })}\n </ol>\n </nav>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Breadcrumbs',\n group: 'Navigation',\n status: 'stable',\n description:\n 'Location trail in a nav landmark: chevron or slash separators, an optional icon-only root, and the current page marked with aria-current. With `maxItems` the middle collapses into an ellipsis button that expands the full trail in place.',\n pattern: 'breadcrumb',\n keyboard: [\n ['Tab', 'Moves focus through the links and the ellipsis button; the current page is not a link'],\n ['Enter', 'Follows the focused link'],\n ['Enter / Space', 'On the ellipsis button: reveals the hidden levels and focuses the first one'],\n ],\n tokens: ['foreground', 'muted-foreground', 'secondary', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\n/**\n * Month grid in the brand style: 32px day cells, primary fill on the selection, an inset\n * primary ring on today, a primary/12 band across a range. Day state comes from data attributes.\n */\nexport const calendarVariants = tv({\n slots: {\n root: 'inline-flex w-fit flex-col gap-4 p-3 text-foreground sm:flex-row sm:gap-6',\n month: 'flex flex-col',\n header: 'mb-2 flex h-7 items-center justify-between gap-2',\n heading: 'flex-1 text-center text-[13px] font-semibold tracking-tight text-foreground',\n nav: [\n 'grid size-7 shrink-0 place-items-center rounded-md text-muted-foreground transition-colors motion-reduce:transition-none',\n 'hover:bg-secondary/70 hover:text-foreground',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n 'disabled:cursor-not-allowed disabled:text-muted-foreground/30 disabled:hover:bg-transparent',\n ],\n navSpacer: 'size-7 shrink-0',\n grid: 'w-[224px] border-collapse',\n weekday: 'h-7 p-0 text-center font-mono text-[10.5px] font-normal text-muted-foreground',\n weekdayAbbr: 'no-underline',\n cell: [\n 'h-8 p-0 text-center',\n 'data-in-range:bg-primary/12 data-range-start:rounded-s-md data-range-end:rounded-e-md',\n ],\n day: [\n 'mx-auto grid size-8 place-items-center rounded-md text-[12.5px] text-foreground tabular-nums outline-none select-none',\n 'transition-colors motion-reduce:transition-none hover:bg-secondary/70',\n 'focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus-ring',\n 'data-today:ring-1 data-today:ring-primary/60 data-today:ring-inset',\n 'data-in-range:hover:bg-primary/16',\n 'data-selected:bg-primary data-selected:font-semibold data-selected:text-primary-foreground data-selected:ring-0 data-selected:hover:bg-primary/90',\n 'aria-disabled:cursor-not-allowed aria-disabled:text-muted-foreground/30 aria-disabled:line-through aria-disabled:hover:bg-transparent',\n ],\n outside: 'mx-auto grid size-8 place-items-center text-[12.5px] text-muted-foreground/45 tabular-nums select-none',\n },\n});\n\nexport type CalendarVariantProps = VariantProps<typeof calendarVariants>;\n","/**\n * Date helpers for Calendar / DatePicker. Native Date + Intl only; every date is a local\n * calendar day (time stripped to 00:00).\n */\n\nexport type WeekDay = 0 | 1 | 2 | 3 | 4 | 5 | 6;\n\nexport interface DateRange {\n start: Date | null;\n end: Date | null;\n}\n\nexport const startOfDay = (d: Date) => new Date(d.getFullYear(), d.getMonth(), d.getDate());\nexport const startOfMonth = (d: Date) => new Date(d.getFullYear(), d.getMonth(), 1);\nexport const endOfMonth = (d: Date) => new Date(d.getFullYear(), d.getMonth() + 1, 0);\nexport const addDays = (d: Date, n: number) => new Date(d.getFullYear(), d.getMonth(), d.getDate() + n);\n\n/** Adds months, clamping the day to the target month's length (Jan 31 + 1 → Feb 28). */\nexport function addMonths(d: Date, n: number) {\n const target = new Date(d.getFullYear(), d.getMonth() + n, 1);\n const day = Math.min(d.getDate(), endOfMonth(target).getDate());\n return new Date(target.getFullYear(), target.getMonth(), day);\n}\n\nexport const isSameDay = (a: Date | null | undefined, b: Date | null | undefined) =>\n !!a && !!b && a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();\n\nexport const isSameMonth = (a: Date, b: Date) => a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth();\n\nexport const compareDay = (a: Date, b: Date) => startOfDay(a).getTime() - startOfDay(b).getTime();\n\n/** Months between two dates, ignoring days (Mar → May = 2). */\nexport const monthDiff = (a: Date, b: Date) => (b.getFullYear() - a.getFullYear()) * 12 + (b.getMonth() - a.getMonth());\n\nexport function clampDay(d: Date, min?: Date, max?: Date) {\n if (min && compareDay(d, min) < 0) return startOfDay(min);\n if (max && compareDay(d, max) > 0) return startOfDay(max);\n return d;\n}\n\n/** `YYYY-MM-DD` for the local day (stable keys, data attributes, form values). */\nexport function toISODate(d: Date) {\n const pad = (n: number) => String(n).padStart(2, '0');\n return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;\n}\n\nexport const startOfWeek = (d: Date, weekStartsOn: WeekDay) => addDays(d, -((d.getDay() - weekStartsOn + 7) % 7));\nexport const endOfWeek = (d: Date, weekStartsOn: WeekDay) => addDays(startOfWeek(d, weekStartsOn), 6);\n\n/** Six weeks (42 days) covering the month, starting on `weekStartsOn`. */\nexport function monthWeeks(month: Date, weekStartsOn: WeekDay): Date[][] {\n const first = startOfWeek(startOfMonth(month), weekStartsOn);\n return Array.from({ length: 6 }, (_, w) => Array.from({ length: 7 }, (_, i) => addDays(first, w * 7 + i)));\n}\n\n/** First day of the week for a locale (Intl week info when available, else Monday). */\nexport function localeWeekStart(locale?: string): WeekDay {\n try {\n const loc = new Intl.Locale(locale ?? new Intl.DateTimeFormat().resolvedOptions().locale) as Intl.Locale & {\n getWeekInfo?: () => { firstDay: number };\n weekInfo?: { firstDay: number };\n };\n const info = loc.getWeekInfo?.() ?? loc.weekInfo;\n if (info) return (info.firstDay % 7) as WeekDay;\n } catch {}\n return 1;\n}\n\n/** Weekday names starting on `weekStartsOn`: `[{ narrow: 'M', long: 'Monday' }, …]`. */\nexport function weekdayNames(locale: string | undefined, weekStartsOn: WeekDay) {\n const narrow = new Intl.DateTimeFormat(locale, { weekday: 'narrow' });\n const long = new Intl.DateTimeFormat(locale, { weekday: 'long' });\n // 2026-01-04 is a Sunday.\n return Array.from({ length: 7 }, (_, i) => {\n const d = new Date(2026, 0, 4 + ((weekStartsOn + i) % 7));\n return { narrow: narrow.format(d), long: long.format(d) };\n });\n}\n\nexport const formatMonth = (d: Date, locale?: string) =>\n new Intl.DateTimeFormat(locale, { month: 'long', year: 'numeric' }).format(d);\n\nexport const formatDayLabel = (d: Date, locale?: string) =>\n new Intl.DateTimeFormat(locale, { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }).format(d);\n\nexport const formatDate = (d: Date, locale?: string, options: Intl.DateTimeFormatOptions = { dateStyle: 'medium' }) =>\n new Intl.DateTimeFormat(locale, options).format(d);\n\n/** \"Mar 2 – 9, 2026\" via Intl.formatRange; an open range shows only its start. */\nexport function formatDateRange(\n range: DateRange,\n locale?: string,\n options: Intl.DateTimeFormatOptions = { dateStyle: 'medium' },\n) {\n const fmt = new Intl.DateTimeFormat(locale, options);\n if (!range.start) return '';\n if (!range.end) return `${fmt.format(range.start)} –`;\n return fmt.formatRange(range.start, range.end);\n}\n\n/** Orders a range so start <= end. */\nexport function normalizeRange(a: Date, b: Date): DateRange {\n return compareDay(a, b) <= 0 ? { start: a, end: b } : { start: b, end: a };\n}\n","import { ChevronLeft, ChevronRight } from 'lucide-react';\nimport { useEffect, useId, useRef, useState, type KeyboardEvent, type Ref } from 'react';\nimport { useI18n, useOptionalI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { RTL_FLIP } from '../../utils/rtl';\nimport { calendarVariants } from './calendar.variants';\nimport {\n addDays,\n addMonths,\n clampDay,\n compareDay,\n endOfWeek,\n formatDayLabel,\n formatMonth,\n isSameDay,\n isSameMonth,\n localeWeekStart,\n monthDiff,\n monthWeeks,\n normalizeRange,\n startOfDay,\n startOfMonth,\n startOfWeek,\n toISODate,\n weekdayNames,\n type DateRange,\n type WeekDay,\n} from './calendar-utils';\n\nconst s = calendarVariants();\n\ninterface CalendarCommonProps {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n /** BCP 47 locale for month/weekday names and day labels. Defaults to the I18nProvider's, else the runtime locale. */\n locale?: string;\n /** First column of the week (0 = Sunday). Defaults to the locale's week start. */\n weekStartsOn?: WeekDay;\n /** Earliest selectable day. */\n min?: Date;\n /** Latest selectable day. */\n max?: Date;\n /** Marks extra days as unavailable (weekends, blackout dates…). */\n isDateDisabled?: (date: Date) => boolean;\n /** Visible month (controlled). */\n month?: Date;\n /** Initially visible month. Defaults to the selection, else today. */\n defaultMonth?: Date;\n onMonthChange?: (month: Date) => void;\n /** Months shown side by side. */\n numberOfMonths?: 1 | 2;\n /** Show the leading/trailing days of adjacent months (non-interactive). */\n showOutsideDays?: boolean;\n /** \"Today\" for the marker and the initial focus. Defaults to the current date. */\n today?: Date;\n /** Accessible name of the calendar group. */\n 'aria-label'?: string;\n previousMonthLabel?: string;\n nextMonthLabel?: string;\n}\n\nexport interface CalendarSingleProps extends CalendarCommonProps {\n mode?: 'single';\n value?: Date | null;\n defaultValue?: Date | null;\n onValueChange?: (date: Date) => void;\n}\n\nexport interface CalendarRangeProps extends CalendarCommonProps {\n mode: 'range';\n value?: DateRange;\n defaultValue?: DateRange;\n /** Fires on each click: first with `{ start, end: null }`, then with the complete range. */\n onValueChange?: (range: DateRange) => void;\n}\n\nexport type CalendarProps = CalendarSingleProps | CalendarRangeProps;\n\nconst EMPTY_RANGE: DateRange = { start: null, end: null };\n\n/**\n * Month calendar (role=\"grid\") with single or range selection. Days are buttons with a roving\n * tabindex: arrows move by day/week, PageUp/PageDown by month (Shift: year), Home/End to the\n * week's edges, Enter/Space select. Labels come from Intl in the given locale.\n */\nexport function Calendar(props: CalendarProps) {\n const {\n className,\n ref,\n locale: localeProp,\n min,\n max,\n isDateDisabled,\n month: monthProp,\n defaultMonth,\n onMonthChange,\n numberOfMonths = 1,\n showOutsideDays = numberOfMonths === 1,\n today: todayProp,\n previousMonthLabel: previousMonthLabelProp,\n nextMonthLabel: nextMonthLabelProp,\n } = props;\n const { t } = useI18n();\n const providerLocale = useOptionalI18n()?.locale;\n // Inside an I18nProvider its locale applies; outside, the runtime locale.\n const locale = localeProp ?? providerLocale;\n const previousMonthLabel = previousMonthLabelProp ?? t('calendar.previousMonth');\n const nextMonthLabel = nextMonthLabelProp ?? t('calendar.nextMonth');\n const weekStartsOn = props.weekStartsOn ?? localeWeekStart(locale);\n const isRange = props.mode === 'range';\n const baseId = useId();\n\n const [today] = useState(() => startOfDay(todayProp ?? new Date()));\n const todayDate = todayProp ? startOfDay(todayProp) : today;\n\n const [innerSingle, setInnerSingle] = useState<Date | null>(() =>\n props.mode === 'range' ? null : (props.defaultValue ?? null),\n );\n const [innerRange, setInnerRange] = useState<DateRange>(() =>\n props.mode === 'range' ? (props.defaultValue ?? EMPTY_RANGE) : EMPTY_RANGE,\n );\n const single = props.mode === 'range' ? null : props.value !== undefined ? props.value : innerSingle;\n const range = props.mode === 'range' ? (props.value ?? innerRange) : EMPTY_RANGE;\n const anchor = (isRange ? range.start : single) ?? todayDate;\n\n const [innerMonth, setInnerMonth] = useState(() => startOfMonth(defaultMonth ?? anchor));\n const visibleMonth = monthProp ? startOfMonth(monthProp) : innerMonth;\n const months = Array.from({ length: numberOfMonths }, (_, i) => addMonths(visibleMonth, i));\n\n const [focused, setFocused] = useState(() => startOfDay(anchor));\n const [preview, setPreview] = useState<Date | null>(null);\n const rootRef = useRef<HTMLDivElement | null>(null);\n const focusPending = useRef(false);\n\n const isVisible = (d: Date) => {\n const diff = monthDiff(visibleMonth, d);\n return diff >= 0 && diff < numberOfMonths;\n };\n const isDisabled = (d: Date) =>\n (!!min && compareDay(d, min) < 0) || (!!max && compareDay(d, max) > 0) || !!isDateDisabled?.(d);\n\n // The one day in the tab order: the focused day if visible, else selection, today, or day 1.\n const tabbable =\n [focused, isRange ? range.start : single, todayDate].find((d): d is Date => !!d && isVisible(d)) ?? visibleMonth;\n\n useEffect(() => {\n if (!focusPending.current) return;\n focusPending.current = false;\n rootRef.current?.querySelector<HTMLButtonElement>(`[data-day=\"${toISODate(focused)}\"]`)?.focus();\n }, [focused, visibleMonth]);\n\n const setMonth = (m: Date) => {\n const next = startOfMonth(m);\n setInnerMonth(next);\n onMonthChange?.(next);\n };\n\n const moveFocus = (next: Date) => {\n const target = clampDay(next, min, max);\n focusPending.current = true;\n setFocused(target);\n if (isRange && range.start && !range.end) setPreview(target);\n const diff = monthDiff(visibleMonth, target);\n if (diff < 0) setMonth(target);\n else if (diff > numberOfMonths - 1) setMonth(addMonths(startOfMonth(target), -(numberOfMonths - 1)));\n };\n\n const select = (d: Date) => {\n if (isDisabled(d)) return;\n setFocused(d);\n if (props.mode === 'range') {\n const next = !range.start || range.end ? { start: d, end: null } : normalizeRange(range.start, d);\n setInnerRange(next);\n setPreview(null);\n props.onValueChange?.(next);\n } else {\n setInnerSingle(d);\n props.onValueChange?.(d);\n }\n };\n\n const onDayKeyDown = (e: KeyboardEvent<HTMLButtonElement>, d: Date) => {\n const rtl = getComputedStyle(e.currentTarget).direction === 'rtl' ? -1 : 1;\n const moves: Record<string, () => Date> = {\n ArrowLeft: () => addDays(d, -rtl),\n ArrowRight: () => addDays(d, rtl),\n ArrowUp: () => addDays(d, -7),\n ArrowDown: () => addDays(d, 7),\n PageUp: () => addMonths(d, e.shiftKey ? -12 : -1),\n PageDown: () => addMonths(d, e.shiftKey ? 12 : 1),\n Home: () => startOfWeek(d, weekStartsOn),\n End: () => endOfWeek(d, weekStartsOn),\n };\n const move = moves[e.key];\n if (!move) return;\n e.preventDefault();\n moveFocus(move());\n };\n\n const previewRange = isRange && range.start && !range.end && preview ? normalizeRange(range.start, preview) : null;\n const shownRange = range.start && range.end ? range : previewRange;\n const inRange = (d: Date) =>\n !!shownRange?.start &&\n !!shownRange.end &&\n compareDay(d, shownRange.start) >= 0 &&\n compareDay(d, shownRange.end) <= 0;\n\n const firstMonth = months[0] ?? visibleMonth;\n const lastMonth = months[months.length - 1] ?? visibleMonth;\n const prevDisabled = !!min && monthDiff(min, firstMonth) <= 0;\n const nextDisabled = !!max && monthDiff(lastMonth, max) <= 0;\n const weekdays = weekdayNames(locale, weekStartsOn);\n\n const setRefs = (node: HTMLDivElement | null) => {\n rootRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n };\n\n return (\n <div\n ref={setRefs}\n role=\"group\"\n aria-label={props['aria-label'] ?? t('calendar.label')}\n className={cn(s.root(), className)}\n >\n {months.map((m, mi) => {\n const headingId = `${baseId}-m${mi}`;\n return (\n <div key={toISODate(m)} className={s.month()}>\n <div className={s.header()}>\n {mi === 0 ? (\n <button\n type=\"button\"\n aria-label={previousMonthLabel}\n disabled={prevDisabled}\n className={s.nav()}\n onClick={() => setMonth(addMonths(visibleMonth, -1))}\n >\n <ChevronLeft size={16} aria-hidden className={RTL_FLIP} />\n </button>\n ) : (\n <span className={s.navSpacer()} />\n )}\n <h2 id={headingId} aria-live=\"polite\" className={s.heading()}>\n {formatMonth(m, locale)}\n </h2>\n {mi === months.length - 1 ? (\n <button\n type=\"button\"\n aria-label={nextMonthLabel}\n disabled={nextDisabled}\n className={s.nav()}\n onClick={() => setMonth(addMonths(visibleMonth, 1))}\n >\n <ChevronRight size={16} aria-hidden className={RTL_FLIP} />\n </button>\n ) : (\n <span className={s.navSpacer()} />\n )}\n </div>\n <table role=\"grid\" aria-labelledby={headingId} className={s.grid()}>\n <thead>\n <tr>\n {weekdays.map((w) => (\n <th key={w.long} scope=\"col\" className={s.weekday()}>\n <abbr title={w.long} className={s.weekdayAbbr()}>\n {w.narrow}\n </abbr>\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {monthWeeks(m, weekStartsOn).map((week) => (\n <tr key={toISODate(week[0] ?? m)}>\n {week.map((d) => {\n const key = toISODate(d);\n if (!isSameMonth(d, m)) {\n return (\n <td key={key} className={s.cell()}>\n {showOutsideDays && (\n <span aria-hidden className={s.outside()}>\n {d.getDate()}\n </span>\n )}\n </td>\n );\n }\n const disabled = isDisabled(d);\n const selected = isRange\n ? isSameDay(d, range.start) || isSameDay(d, range.end)\n : isSameDay(d, single);\n const within = isRange && inRange(d);\n const rangeStart = within && isSameDay(d, shownRange?.start);\n const rangeEnd = within && isSameDay(d, shownRange?.end);\n const today = isSameDay(d, todayDate);\n return (\n <td\n key={key}\n aria-selected={selected || within}\n data-in-range={within || undefined}\n data-range-start={rangeStart || undefined}\n data-range-end={rangeEnd || undefined}\n className={s.cell()}\n >\n <button\n type=\"button\"\n data-day={key}\n data-selected={selected || undefined}\n data-today={today || undefined}\n data-in-range={within || undefined}\n tabIndex={isSameDay(d, tabbable) ? 0 : -1}\n aria-label={formatDayLabel(d, locale)}\n aria-current={today ? 'date' : undefined}\n aria-disabled={disabled || undefined}\n className={s.day()}\n onClick={() => select(d)}\n onKeyDown={(e) => onDayKeyDown(e, d)}\n onFocus={() => setFocused(d)}\n onMouseEnter={isRange && range.start && !range.end ? () => setPreview(d) : undefined}\n >\n {d.getDate()}\n </button>\n </td>\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n })}\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Calendar',\n group: 'Forms',\n status: 'beta',\n description:\n 'Month grid for picking a day or a range: today marker, disabled dates, min/max bounds, locale-aware month and weekday names (Intl), configurable week start, one or two months side by side. No date library: native Date + Intl.',\n pattern: 'grid (date picker dialog calendar)',\n keyboard: [\n ['ArrowLeft / ArrowRight', 'Moves focus to the previous / next day'],\n ['ArrowUp / ArrowDown', 'Moves focus to the same day in the previous / next week'],\n ['PageUp / PageDown', 'Moves focus to the same day in the previous / next month (Shift: year)'],\n ['Home / End', 'Moves focus to the first / last day of the week'],\n ['Enter / Space', 'Selects the focused day (range: first press sets the start, second the end)'],\n ],\n tokens: ['foreground', 'muted-foreground', 'primary', 'primary-foreground', 'secondary', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const cardVariants = tv({\n slots: {\n root: 'overflow-hidden rounded-xl border border-border text-card-foreground',\n header: 'grid grid-cols-[1fr_auto] items-start gap-x-4 px-5 py-4',\n title: 'col-start-1 text-[15px] font-semibold tracking-tight text-foreground',\n description: 'col-start-1 mt-0.5 text-[13px] text-muted-foreground',\n action: 'col-start-2 row-span-2 row-start-1 shrink-0 self-start',\n body: 'px-5 py-4 text-[13px] leading-relaxed text-muted-foreground',\n footer: 'flex flex-wrap items-center justify-end gap-2 border-t border-border bg-secondary/40 px-5 py-3',\n },\n variants: {\n variant: {\n default: { root: 'bg-card shadow-sm' },\n well: { root: 'bg-secondary/50' },\n outline: { root: 'bg-transparent' },\n },\n divided: {\n true: { header: 'border-b border-border' },\n },\n },\n defaultVariants: { variant: 'default', divided: false },\n});\n\nexport type CardVariantProps = VariantProps<typeof cardVariants>;\n","import type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { cardVariants, type CardVariantProps } from './card.variants';\n\nconst s = cardVariants();\n\ntype DivProps = Omit<HTMLAttributes<HTMLDivElement>, 'className'> & { className?: string; ref?: Ref<HTMLDivElement> };\n\nexport interface CardProps extends DivProps {\n /** `default` (card + flat shadow), `well` (lower hierarchy, no shadow) or `outline`. */\n variant?: CardVariantProps['variant'];\n}\n\n/** Content surface: 1px border, token radius and a flat shadow. Compose with the Card* parts. */\nexport function Card({ variant, className, ...props }: CardProps) {\n return <div className={cn(cardVariants({ variant }).root(), className)} {...props} />;\n}\n\nexport interface CardHeaderProps extends DivProps {\n /** Draws a border between the header and the body. */\n divided?: boolean;\n}\n\n/** Title + description on the left, CardAction on the right. */\nexport function CardHeader({ divided, className, ...props }: CardHeaderProps) {\n return <div className={cn(cardVariants({ divided }).header(), className)} {...props} />;\n}\n\nexport interface CardTitleProps extends Omit<HTMLAttributes<HTMLHeadingElement>, 'className'> {\n className?: string;\n ref?: Ref<HTMLHeadingElement>;\n /** Heading level that fits the page outline. */\n as?: 'h2' | 'h3' | 'h4';\n}\n\nexport function CardTitle({ as: Heading = 'h3', className, ...props }: CardTitleProps) {\n return <Heading className={cn(s.title(), className)} {...props} />;\n}\n\nexport interface CardDescriptionProps extends Omit<HTMLAttributes<HTMLParagraphElement>, 'className'> {\n className?: string;\n ref?: Ref<HTMLParagraphElement>;\n}\n\nexport function CardDescription({ className, ...props }: CardDescriptionProps) {\n return <p className={cn(s.description(), className)} {...props} />;\n}\n\n/** Right-hand header slot (button, menu, status). */\nexport function CardAction({ className, ...props }: DivProps) {\n return <div className={cn(s.action(), className)} {...props} />;\n}\n\nexport function CardBody({ className, ...props }: DivProps) {\n return <div className={cn(s.body(), className)} {...props} />;\n}\n\n/** Action row on a subtle well, right-aligned. */\nexport function CardFooter({ className, ...props }: DivProps) {\n return <div className={cn(s.footer(), className)} {...props} />;\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Card',\n group: 'Layout',\n status: 'stable',\n description:\n 'The base content surface: border, token radius, generous padding and a flat shadow. Parts: Card, CardHeader (optionally divided), CardTitle, CardDescription, CardAction (header right slot), CardBody and CardFooter. Variants: default, well and outline.',\n tokens: ['card', 'card-foreground', 'border', 'secondary', 'muted-foreground', 'shadow-sm', 'radius-xl'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nconst control = [\n 'grid size-8 shrink-0 place-items-center rounded-lg border border-border bg-card text-foreground shadow-sm transition-colors motion-reduce:transition-none',\n 'hover:bg-secondary/70 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n 'disabled:pointer-events-none disabled:opacity-45',\n];\n\nexport const carouselVariants = tv({\n slots: {\n root: 'relative flex min-w-0 flex-col gap-3',\n header: 'flex min-w-0 items-center gap-2',\n title: 'min-w-0 flex-1 truncate text-[13px] font-semibold tracking-tight text-foreground',\n controls: 'ms-auto flex shrink-0 items-center gap-1.5',\n control,\n viewport: [\n 'flex min-w-0 snap-x snap-mandatory overflow-x-auto overscroll-x-contain scroll-smooth motion-reduce:scroll-auto',\n '[scrollbar-width:none] [&::-webkit-scrollbar]:hidden',\n 'rounded-lg focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n slide: 'min-w-0 shrink-0 snap-start',\n dots: 'flex items-center justify-center gap-1.5',\n dot: [\n 'h-1.5 w-1.5 rounded-full bg-border transition-[width,background-color] motion-reduce:transition-none',\n 'hover:bg-muted-foreground aria-[current=true]:w-4 aria-[current=true]:bg-primary',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n },\n variants: {\n perView: {\n 1: { slide: 'basis-full' },\n 2: { slide: 'basis-full sm:basis-[calc((100%-var(--carousel-gap))/2)]' },\n 3: {\n slide:\n 'basis-full sm:basis-[calc((100%-var(--carousel-gap))/2)] lg:basis-[calc((100%-2*var(--carousel-gap))/3)]',\n },\n auto: { slide: 'basis-auto' },\n },\n },\n defaultVariants: { perView: 1 },\n});\n\nexport type CarouselVariantProps = VariantProps<typeof carouselVariants>;\n","import { ChevronLeft, ChevronRight, Pause, Play } from 'lucide-react';\nimport {\n Children,\n useEffect,\n useId,\n useRef,\n useState,\n type CSSProperties,\n type KeyboardEvent,\n type ReactNode,\n} from 'react';\nimport { cn } from '../../utils/cn';\nimport { carouselVariants, type CarouselVariantProps } from './carousel.variants';\n\nexport interface CarouselLabels {\n previous: string;\n next: string;\n play: string;\n pause: string;\n /** Accessible name of each slide, e.g. \"2 of 5\". */\n slide: (index: number, total: number) => string;\n /** Accessible name of each picker dot. */\n goTo: (index: number, total: number) => string;\n /** Accessible name of the dot group. */\n pickers: string;\n}\n\nconst defaultLabels: CarouselLabels = {\n previous: 'Previous slide',\n next: 'Next slide',\n play: 'Start automatic slide show',\n pause: 'Stop automatic slide show',\n slide: (i, n) => `${i + 1} of ${n}`,\n goTo: (i) => `Go to slide ${i + 1}`,\n pickers: 'Choose slide',\n};\n\nexport interface CarouselProps extends CarouselVariantProps {\n /** Accessible name of the carousel (required by the pattern). */\n label: string;\n /** Visible heading next to the controls; defaults to none (the label stays accessible). */\n title?: ReactNode;\n /** One child per slide. */\n children: ReactNode;\n /** Gap between slides, in px. */\n gap?: number;\n /** Show picker dots under the strip. */\n showDots?: boolean;\n /** Controlled index of the first visible slide. */\n index?: number;\n defaultIndex?: number;\n onIndexChange?: (index: number) => void;\n /** Advance every N ms. Off by default; when on, a pause control is shown and reduced motion keeps it paused. */\n autoplay?: number | false;\n /** Wrap from the last slide to the first (always on while autoplaying). */\n loop?: boolean;\n labels?: Partial<CarouselLabels>;\n className?: string;\n}\n\nconst prefersReducedMotion = () =>\n typeof window !== 'undefined' && !!window.matchMedia?.('(prefers-reduced-motion: reduce)').matches;\n\n/**\n * Scroll-snap media strip (APG carousel pattern): a labelled region with\n * `aria-roledescription=\"carousel\"`, slides as labelled groups, previous/next buttons,\n * optional picker dots and arrow-key navigation on the focused strip. No autoplay by\n * default; with `autoplay` a pause control comes first and hover/focus pause rotation.\n */\nexport function Carousel({\n label,\n title,\n children,\n perView = 1,\n gap = 12,\n showDots = false,\n index,\n defaultIndex = 0,\n onIndexChange,\n autoplay = false,\n loop = false,\n labels: labelsProp,\n className,\n}: CarouselProps) {\n const labels = { ...defaultLabels, ...labelsProp };\n const slides = Children.toArray(children);\n const total = slides.length;\n const [inner, setInner] = useState(defaultIndex);\n const current = Math.min(Math.max(index ?? inner, 0), Math.max(total - 1, 0));\n const [playing, setPlaying] = useState(() => !!autoplay && !prefersReducedMotion());\n const [held, setHeld] = useState(false);\n const viewportRef = useRef<HTMLDivElement | null>(null);\n const scrollingTo = useRef<number | null>(null);\n const id = useId();\n const s = carouselVariants({ perView });\n const wraps = loop || !!autoplay;\n\n const scrollToSlide = (i: number) => {\n const el = viewportRef.current?.querySelector<HTMLElement>(`[data-slide-index=\"${i}\"]`);\n if (!el || !viewportRef.current) return;\n scrollingTo.current = i;\n const behavior: ScrollBehavior = prefersReducedMotion() ? 'auto' : 'smooth';\n const vp = viewportRef.current;\n const rtl = getComputedStyle(vp).direction === 'rtl';\n const delta = rtl\n ? el.getBoundingClientRect().right - vp.getBoundingClientRect().right\n : el.getBoundingClientRect().left - vp.getBoundingClientRect().left;\n vp.scrollBy?.({ left: delta, behavior });\n };\n\n const goTo = (i: number) => {\n const next = wraps ? (i + total) % total : Math.min(Math.max(i, 0), total - 1);\n if (next === current || total === 0) return;\n setInner(next);\n onIndexChange?.(next);\n scrollToSlide(next);\n };\n\n /** Keeps the index in sync when the user scrolls or swipes the strip. */\n const onScroll = () => {\n const vp = viewportRef.current;\n if (!vp) return;\n const rtl = getComputedStyle(vp).direction === 'rtl';\n const edge = rtl ? vp.getBoundingClientRect().right : vp.getBoundingClientRect().left;\n let best = current;\n let bestDist = Infinity;\n vp.querySelectorAll<HTMLElement>('[data-slide-index]').forEach((el) => {\n const r = el.getBoundingClientRect();\n const d = Math.abs((rtl ? r.right : r.left) - edge);\n if (d < bestDist) {\n bestDist = d;\n best = Number(el.dataset.slideIndex);\n }\n });\n if (scrollingTo.current !== null) {\n if (best === scrollingTo.current) scrollingTo.current = null;\n return;\n }\n if (best !== current) {\n setInner(best);\n onIndexChange?.(best);\n }\n };\n\n const onKeyDown = (e: KeyboardEvent<HTMLDivElement>) => {\n if (e.target !== e.currentTarget) return;\n const rtl = getComputedStyle(e.currentTarget).direction === 'rtl';\n const fwd = rtl ? 'ArrowLeft' : 'ArrowRight';\n const back = rtl ? 'ArrowRight' : 'ArrowLeft';\n let target: number | null = null;\n if (e.key === fwd) target = current + 1;\n else if (e.key === back) target = current - 1;\n else if (e.key === 'Home') target = 0;\n else if (e.key === 'End') target = total - 1;\n if (target === null) return;\n e.preventDefault();\n goTo(target);\n };\n\n const rotating = playing && !held && !!autoplay && total > 1;\n const advanceRef = useRef<() => void>(() => {});\n useEffect(() => {\n advanceRef.current = () => goTo(current + 1);\n });\n useEffect(() => {\n if (!rotating || !autoplay) return;\n const t = window.setInterval(() => advanceRef.current(), autoplay);\n return () => window.clearInterval(t);\n }, [rotating, autoplay]);\n\n const style = { '--carousel-gap': `${gap}px`, gap: `${gap}px` } as CSSProperties;\n const atStart = !wraps && current === 0;\n const atEnd = !wraps && current >= total - 1;\n\n return (\n <section\n aria-roledescription=\"carousel\"\n aria-label={label}\n className={cn(s.root(), className)}\n onMouseEnter={() => setHeld(true)}\n onMouseLeave={() => setHeld(false)}\n onFocus={() => setHeld(true)}\n onBlur={(e) => {\n if (!e.currentTarget.contains(e.relatedTarget as Node | null)) setHeld(false);\n }}\n >\n <div className={s.header()}>\n {autoplay !== false && (\n <button\n type=\"button\"\n className={s.control()}\n aria-label={playing ? labels.pause : labels.play}\n onClick={() => setPlaying((p) => !p)}\n >\n {playing ? <Pause size={14} aria-hidden /> : <Play size={14} aria-hidden />}\n </button>\n )}\n {title != null && <div className={s.title()}>{title}</div>}\n <div className={s.controls()}>\n <button\n type=\"button\"\n className={s.control()}\n aria-label={labels.previous}\n aria-controls={`${id}-viewport`}\n disabled={atStart}\n onClick={() => goTo(current - 1)}\n >\n <ChevronLeft size={15} aria-hidden className=\"rtl:-scale-x-100\" />\n </button>\n <button\n type=\"button\"\n className={s.control()}\n aria-label={labels.next}\n aria-controls={`${id}-viewport`}\n disabled={atEnd}\n onClick={() => goTo(current + 1)}\n >\n <ChevronRight size={15} aria-hidden className=\"rtl:-scale-x-100\" />\n </button>\n </div>\n </div>\n <div\n ref={viewportRef}\n id={`${id}-viewport`}\n tabIndex={0}\n aria-live={rotating ? 'off' : 'polite'}\n aria-label={label}\n role=\"group\"\n className={s.viewport()}\n style={style}\n onScroll={onScroll}\n onKeyDown={onKeyDown}\n >\n {slides.map((child, i) => (\n <div\n key={i}\n role=\"group\"\n aria-roledescription=\"slide\"\n aria-label={labels.slide(i, total)}\n aria-current={i === current || undefined}\n data-slide-index={i}\n className={s.slide()}\n >\n {child}\n </div>\n ))}\n </div>\n {showDots && total > 1 && (\n <div role=\"group\" aria-label={labels.pickers} className={s.dots()}>\n {slides.map((_, i) => (\n <button\n key={i}\n type=\"button\"\n className={s.dot()}\n aria-label={labels.goTo(i, total)}\n aria-current={i === current}\n aria-controls={`${id}-viewport`}\n onClick={() => goTo(i)}\n />\n ))}\n </div>\n )}\n </section>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Carousel',\n group: 'Display',\n status: 'beta',\n description:\n 'Scroll-snap media strip: one, two, three or auto-width slides per view, previous/next buttons, optional picker dots, arrow keys on the focused strip. No autoplay by default; `autoplay` adds a pause control, pauses on hover and focus, and starts paused under reduced motion.',\n pattern: 'APG carousel (region with aria-roledescription=\"carousel\", slides as labelled groups)',\n keyboard: [\n ['Tab', 'Moves through the controls, then the strip, then the slide content'],\n ['ArrowRight / ArrowLeft', 'On the focused strip: next / previous slide (mirrored in RTL)'],\n ['Home / End', 'On the focused strip: first / last slide'],\n ['Enter / Space', 'Activates previous, next, a picker dot or the pause control'],\n ],\n tokens: ['card', 'border', 'foreground', 'muted-foreground', 'primary', 'secondary', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const checkboxVariants = tv({\n slots: {\n root: [\n 'inline-flex size-[18px] shrink-0 cursor-pointer items-center justify-center rounded-[5px] border border-border bg-background text-primary-foreground',\n 'transition-colors motion-reduce:transition-none hover:border-muted-foreground/50',\n 'data-checked:border-primary data-checked:bg-primary data-indeterminate:border-primary data-indeterminate:bg-primary',\n 'data-invalid:border-destructive/70',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n 'data-disabled:cursor-not-allowed data-disabled:opacity-50',\n ],\n indicator: 'flex items-center justify-center data-unchecked:hidden',\n item: 'grid grid-cols-[auto_1fr] items-start gap-x-3 gap-y-0.5',\n label:\n 'col-span-2 grid cursor-pointer grid-cols-subgrid items-start has-[[data-disabled]]:cursor-not-allowed has-[[data-disabled]]:opacity-70',\n labelText: 'text-[13px] leading-5 font-medium text-foreground select-none',\n description: 'col-start-2 text-[12.5px] leading-5 text-muted-foreground text-pretty',\n group: 'flex flex-col',\n },\n variants: {\n variant: {\n plain: { group: 'gap-2.5' },\n list: {\n group:\n 'divide-y divide-border/60 overflow-hidden rounded-md border border-border bg-background/40 *:px-4 *:py-3.5',\n },\n },\n },\n defaultVariants: { variant: 'plain' },\n});\n\nexport type CheckboxVariantProps = VariantProps<typeof checkboxVariants>;\n","import { Checkbox as BaseCheckbox } from '@base-ui/react/checkbox';\nimport { CheckboxGroup as BaseCheckboxGroup } from '@base-ui/react/checkbox-group';\nimport { Check, Minus } from 'lucide-react';\nimport { useId, type ReactNode, type Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { checkboxVariants, type CheckboxVariantProps } from './checkbox.variants';\n\nconst s = checkboxVariants();\n\nexport interface CheckboxProps extends Omit<BaseCheckbox.Root.Props, 'className'> {\n className?: string;\n ref?: Ref<HTMLElement>;\n /** Visible label. Without it, pass `aria-label` or wrap in a Field. */\n label?: ReactNode;\n /** Helper line under the label, linked with aria-describedby. */\n description?: ReactNode;\n}\n\n/**\n * Two-state (or indeterminate) checkbox. Controlled with `checked` + `onCheckedChange`,\n * uncontrolled with `defaultChecked`. Inside a CheckboxGroup, identify it with `value`.\n */\nexport function Checkbox({ label, description, className, ...props }: CheckboxProps) {\n const descId = useId();\n const control = (\n <BaseCheckbox.Root\n className={cn(s.root(), label != null && 'mt-px', label == null && className)}\n aria-describedby={description != null ? descId : undefined}\n {...props}\n >\n <BaseCheckbox.Indicator\n className={s.indicator()}\n render={(indicatorProps, state) => (\n <span {...indicatorProps}>\n {state.indeterminate ? (\n <Minus size={13} strokeWidth={2.6} aria-hidden />\n ) : (\n <Check size={13} strokeWidth={2.6} aria-hidden />\n )}\n </span>\n )}\n />\n </BaseCheckbox.Root>\n );\n if (label == null) return control;\n return (\n <div className={cn(s.item(), className)}>\n <label className={s.label()}>\n {control}\n <span className={s.labelText()}>{label}</span>\n </label>\n {description != null && (\n <p id={descId} className={s.description()}>\n {description}\n </p>\n )}\n </div>\n );\n}\n\nexport interface CheckboxGroupProps extends Omit<BaseCheckboxGroup.Props, 'className'>, CheckboxVariantProps {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n}\n\n/**\n * Shared state for several checkboxes (`value` is the array of ticked `value`s). Name it with\n * `aria-labelledby`, or render it as a Fieldset: `<Fieldset render={<CheckboxGroup />}>`.\n * A `parent` checkbox plus `allValues` gives a \"select all\" with the indeterminate state.\n */\nexport function CheckboxGroup({ variant, className, ...props }: CheckboxGroupProps) {\n return <BaseCheckboxGroup className={cn(checkboxVariants({ variant }).group(), className)} {...props} />;\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Checkbox',\n group: 'Forms',\n status: 'stable',\n description:\n 'Checkbox with optional label and description, including the indeterminate state. CheckboxGroup shares state across several checkboxes (plain or bordered list layout) and supports a parent \"select all\" checkbox.',\n primitive: '@base-ui/react/checkbox, @base-ui/react/checkbox-group',\n pattern: 'checkbox (dual and mixed state)',\n keyboard: [\n ['Space', 'Toggles the focused checkbox; a parent checkbox ticks or clears the whole group'],\n ['Tab', 'Moves focus to the next checkbox (each checkbox is a tab stop)'],\n ],\n tokens: [\n 'background',\n 'border',\n 'primary',\n 'primary-foreground',\n 'foreground',\n 'muted-foreground',\n 'destructive',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nconst SURFACE = [\n 'relative flex items-start gap-3.5 rounded-md border border-border bg-background px-4 py-3.5 text-start transition-colors motion-reduce:transition-none',\n 'has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-focus-ring',\n];\n\n/** Shared text slots of both cards. */\nconst TEXT = {\n icon: 'grid size-9 shrink-0 place-items-center rounded-md bg-secondary text-muted-foreground [&_svg]:size-4.5',\n body: 'min-w-0 flex-1',\n title: 'block text-[13px] leading-5 font-semibold text-foreground',\n description: 'mt-0.5 block text-[12px] leading-5 text-muted-foreground text-pretty',\n meta: 'mt-2 flex flex-wrap items-center gap-2 text-[12px] text-muted-foreground',\n};\n\nexport const clickableCardVariants = tv({\n slots: {\n root: [\n ...SURFACE,\n 'hover:border-muted-foreground/40 hover:bg-secondary/30',\n 'data-disabled:opacity-60 data-disabled:hover:border-border data-disabled:hover:bg-background',\n ],\n ...TEXT,\n /** The link/button; its ::after covers the card so the whole surface is clickable. */\n action: [\n 'cursor-pointer text-start outline-none after:absolute after:inset-0 after:rounded-[inherit] after:content-[\"\"]',\n 'disabled:cursor-not-allowed aria-disabled:cursor-not-allowed',\n ],\n chevron:\n 'mt-0.5 size-4 shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none group-hover/card:translate-x-0.5 rtl:-scale-x-100 rtl:group-hover/card:-translate-x-0.5',\n },\n});\n\nexport const selectableCardVariants = tv({\n slots: {\n group: 'grid gap-3',\n root: [\n ...SURFACE,\n 'cursor-pointer hover:border-muted-foreground/40 has-[[data-checked]]:border-primary/60 has-[[data-checked]]:ring-2 has-[[data-checked]]:ring-primary/20',\n 'has-[[data-disabled]]:cursor-not-allowed has-[[data-disabled]]:opacity-60 has-[[data-disabled]]:hover:border-border',\n ],\n ...TEXT,\n control: [\n 'mt-0.5 inline-flex size-[18px] shrink-0 items-center justify-center border border-border bg-background outline-none',\n 'transition-colors motion-reduce:transition-none data-checked:border-primary data-checked:bg-primary',\n ],\n indicator: 'flex items-center justify-center text-primary-foreground data-unchecked:hidden',\n },\n variants: {\n type: {\n radio: { control: 'rounded-full', indicator: 'size-1.5 rounded-full bg-primary-foreground' },\n checkbox: { control: 'rounded-[5px]' },\n },\n columns: {\n 1: { group: 'grid-cols-1' },\n 2: { group: 'sm:grid-cols-2' },\n 3: { group: 'sm:grid-cols-3' },\n },\n },\n defaultVariants: { type: 'radio', columns: 1 },\n});\n\nexport type SelectableCardVariantProps = VariantProps<typeof selectableCardVariants>;\n","import { ChevronRight } from 'lucide-react';\nimport { useId, type HTMLAttributes, type MouseEventHandler, type ReactNode, type Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { clickableCardVariants } from './choice-card.variants';\n\nconst s = clickableCardVariants();\n\nexport interface ClickableCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'title' | 'onClick'> {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n /** The card's name — the text of its single link or button. */\n title: ReactNode;\n description?: ReactNode;\n /** Secondary line under the description (badges, counts, a timestamp). */\n meta?: ReactNode;\n /** Leading icon tile (pass a lucide icon with `aria-hidden`). */\n icon?: ReactNode;\n /** Renders the card as a link. */\n href?: string;\n /** Renders the card as a button (or runs alongside `href`). */\n onClick?: MouseEventHandler<HTMLElement>;\n /** Heading element around the title, to fit the page outline; defaults to none. */\n titleAs?: 'h2' | 'h3' | 'h4' | 'span';\n /** Trailing chevron hint. */\n chevron?: boolean;\n disabled?: boolean;\n}\n\n/**\n * A card whose whole surface is one link or button. The title holds the only focus target and\n * stretches over the card, so the accessible name stays short and the description is linked\n * with aria-describedby. Extra interactive content inside needs `relative z-10`.\n */\nexport function ClickableCard({\n title,\n description,\n meta,\n icon,\n href,\n onClick,\n titleAs: Title = 'span',\n chevron = true,\n disabled = false,\n className,\n children,\n ...props\n}: ClickableCardProps) {\n const descId = useId();\n const describedBy = description != null ? descId : undefined;\n const action =\n href != null && !disabled ? (\n <a href={href} onClick={onClick} aria-describedby={describedBy} className={cn(s.action(), s.title())}>\n {title}\n </a>\n ) : (\n <button\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n aria-describedby={describedBy}\n className={cn(s.action(), s.title())}\n >\n {title}\n </button>\n );\n return (\n <div data-disabled={disabled || undefined} className={cn('group/card', s.root(), className)} {...props}>\n {icon != null && <span className={s.icon()}>{icon}</span>}\n <div className={s.body()}>\n <Title className=\"block\">{action}</Title>\n {description != null && (\n <span id={descId} className={s.description()}>\n {description}\n </span>\n )}\n {meta != null && <div className={s.meta()}>{meta}</div>}\n {children}\n </div>\n {chevron && <ChevronRight aria-hidden className={s.chevron()} />}\n </div>\n );\n}\n","import { Checkbox as BaseCheckbox } from '@base-ui/react/checkbox';\nimport { CheckboxGroup as BaseCheckboxGroup } from '@base-ui/react/checkbox-group';\nimport { Radio as BaseRadio } from '@base-ui/react/radio';\nimport { RadioGroup as BaseRadioGroup } from '@base-ui/react/radio-group';\nimport { Check } from 'lucide-react';\nimport { createContext, useContext, useId, type AriaAttributes, type ReactNode, type Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { selectableCardVariants, type SelectableCardVariantProps } from './choice-card.variants';\n\ntype ChoiceType = 'radio' | 'checkbox';\nconst TypeContext = createContext<ChoiceType>('radio');\n\ninterface GroupCommon extends Pick<AriaAttributes, 'aria-label' | 'aria-labelledby' | 'aria-describedby'> {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n /** Grid columns from the `sm` breakpoint. */\n columns?: SelectableCardVariantProps['columns'];\n disabled?: boolean;\n id?: string;\n children?: ReactNode;\n}\n\nexport interface SelectableCardRadioGroupProps extends GroupCommon {\n /** Single choice (role radiogroup; arrows move and select). */\n type?: 'radio';\n /** Form field name. */\n name?: string;\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n}\n\nexport interface SelectableCardCheckboxGroupProps extends GroupCommon {\n /** Multiple choice (role group; Space toggles each card). */\n type: 'checkbox';\n value?: string[];\n defaultValue?: string[];\n onValueChange?: (value: string[]) => void;\n}\n\nexport type SelectableCardGroupProps = SelectableCardRadioGroupProps | SelectableCardCheckboxGroupProps;\n\n/**\n * Grid of SelectableCards with radio (default) or checkbox semantics, on Base UI RadioGroup /\n * CheckboxGroup. Name it with `aria-labelledby` (or `aria-label`).\n */\nexport function SelectableCardGroup(props: SelectableCardGroupProps) {\n const { columns, className, ...common } = props;\n const groupClass = cn(selectableCardVariants({ columns }).group(), className);\n const shared = {\n className: groupClass,\n ref: common.ref,\n id: common.id,\n disabled: common.disabled,\n 'aria-label': common['aria-label'],\n 'aria-labelledby': common['aria-labelledby'],\n 'aria-describedby': common['aria-describedby'],\n children: common.children,\n };\n if (props.type === 'checkbox') {\n const { value, defaultValue, onValueChange } = props;\n return (\n <TypeContext.Provider value=\"checkbox\">\n <BaseCheckboxGroup\n {...shared}\n value={value}\n defaultValue={defaultValue}\n onValueChange={(v) => onValueChange?.(v)}\n />\n </TypeContext.Provider>\n );\n }\n const { value, defaultValue, onValueChange, name } = props;\n return (\n <TypeContext.Provider value=\"radio\">\n <BaseRadioGroup<string>\n {...shared}\n name={name}\n value={value}\n defaultValue={defaultValue}\n onValueChange={(v) => onValueChange?.(v)}\n />\n </TypeContext.Provider>\n );\n}\n\nexport interface SelectableCardProps {\n /** Identifies the card inside its group. */\n value: string;\n /** The card's accessible name. */\n title: ReactNode;\n description?: ReactNode;\n /** Secondary content (price, badge, specs); announced as part of the description. */\n meta?: ReactNode;\n /** Leading icon tile. */\n icon?: ReactNode;\n disabled?: boolean;\n className?: string;\n}\n\n/** One option card: indicator, title, description and meta; the whole card toggles it. */\nexport function SelectableCard({ value, title, description, meta, icon, disabled, className }: SelectableCardProps) {\n const type = useContext(TypeContext);\n const s = selectableCardVariants({ type });\n const titleId = useId();\n const descId = useId();\n const metaId = useId();\n const describedBy = [description != null && descId, meta != null && metaId].filter(Boolean).join(' ') || undefined;\n const a11y = { 'aria-labelledby': titleId, 'aria-describedby': describedBy };\n const control =\n type === 'checkbox' ? (\n <BaseCheckbox.Root value={value} disabled={disabled} {...a11y} className={s.control()}>\n <BaseCheckbox.Indicator className={s.indicator()}>\n <Check size={13} strokeWidth={2.6} aria-hidden />\n </BaseCheckbox.Indicator>\n </BaseCheckbox.Root>\n ) : (\n <BaseRadio.Root<string> value={value} disabled={disabled} {...a11y} className={s.control()}>\n <BaseRadio.Indicator className={s.indicator()} />\n </BaseRadio.Root>\n );\n return (\n <label className={cn(s.root(), className)}>\n {icon != null && <span className={s.icon()}>{icon}</span>}\n <span className={s.body()}>\n <span id={titleId} className={s.title()}>\n {title}\n </span>\n {description != null && (\n <span id={descId} className={s.description()}>\n {description}\n </span>\n )}\n {meta != null && (\n <span id={metaId} className={s.meta()}>\n {meta}\n </span>\n )}\n </span>\n {control}\n </label>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'ChoiceCard',\n group: 'Forms',\n status: 'beta',\n description:\n 'Cards as controls. ClickableCard: the whole card is one link or button (a stretched title, so there is a single focus target with a short name) with icon, description, meta and a chevron. SelectableCard inside SelectableCardGroup: option cards with radio (single) or checkbox (multiple) semantics on Base UI RadioGroup / CheckboxGroup, with a check indicator, title, description, meta and disabled state.',\n primitive: '@base-ui/react/radio-group · @base-ui/react/checkbox-group',\n pattern: 'link / button · radiogroup · group of checkboxes',\n keyboard: [\n [\n 'Tab',\n 'ClickableCard: focuses its link or button. Group: enters the radio group once, on the selected card; visits each checkbox card',\n ],\n ['Enter', 'Activates a ClickableCard'],\n ['Arrow keys', 'Radio group: move to the next / previous card and select it'],\n ['Space', 'Checkbox group: toggles the focused card (radio: selects it)'],\n ],\n tokens: [\n 'background',\n 'border',\n 'secondary',\n 'foreground',\n 'muted-foreground',\n 'primary',\n 'primary-foreground',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\nimport type { TokenKind } from './tokenize';\n\nexport const codeBlockVariants = tv({\n slots: {\n root: 'overflow-hidden rounded-md border border-border bg-card text-start',\n header: 'flex h-9 items-center justify-between gap-2 border-b border-border/70 pe-1.5 ps-3',\n heading: 'flex min-w-0 items-center gap-2',\n filename: 'truncate font-mono text-[11.5px] text-foreground',\n language: 'shrink-0 font-mono text-[11px] tracking-wide text-muted-foreground uppercase',\n actions: 'flex shrink-0 items-center gap-0.5',\n button: [\n 'inline-flex h-7 cursor-pointer items-center gap-1.5 rounded-md px-2 font-mono text-[11px] text-muted-foreground transition-colors motion-reduce:transition-none',\n 'hover:bg-secondary hover:text-foreground aria-pressed:bg-secondary aria-pressed:text-foreground',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n copied: 'text-primary-text hover:text-primary-text',\n pre: [\n 'm-0 overflow-auto bg-background/40 py-3 font-mono text-[12.5px] leading-relaxed text-foreground',\n 'focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus-ring',\n ],\n code: 'grid font-mono',\n line: 'flex border-s-2 border-transparent pe-4 ps-3.5 data-highlighted:border-primary data-highlighted:bg-primary/10',\n lineNumber: 'me-4 inline-block shrink-0 text-end text-muted-foreground select-none',\n content: 'min-w-0 flex-1',\n },\n variants: {\n wrap: {\n true: { code: 'w-full', content: 'break-words whitespace-pre-wrap' },\n false: { code: 'w-max min-w-full', content: 'whitespace-pre' },\n },\n },\n defaultVariants: { wrap: false },\n});\n\n/** Token colours: only contrast-safe text tokens, so every theme keeps AA. */\nexport const tokenClass: Record<TokenKind, string> = {\n plain: '',\n keyword: 'text-primary-text',\n property: 'text-primary-text',\n string: 'text-warning-text',\n number: 'text-destructive-text',\n comment: 'text-muted-foreground italic',\n type: 'font-semibold text-foreground',\n function: 'font-medium text-foreground',\n punctuation: 'text-muted-foreground',\n muted: 'text-muted-foreground',\n};\n\nexport const codeVariants = tv({\n base: 'rounded-[5px] border border-border bg-secondary/60 px-1.5 py-0.5 font-mono text-[0.85em] text-foreground [overflow-wrap:anywhere]',\n});\n\nexport type CodeBlockVariantProps = VariantProps<typeof codeBlockVariants>;\n","/**\n * Minimal, dependency-free tokenizer for the default CodeBlock colouring. It is deliberately\n * small: good enough for docs snippets in ts/tsx/js/json/bash/css, not a full grammar.\n */\nexport type TokenKind =\n 'plain' | 'keyword' | 'string' | 'number' | 'comment' | 'type' | 'function' | 'property' | 'punctuation' | 'muted';\n\nexport interface CodeToken {\n kind: TokenKind;\n value: string;\n}\n\ntype Rule = [TokenKind, RegExp];\n\nconst JS_KEYWORDS =\n 'abstract|as|async|await|break|case|catch|class|const|continue|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|keyof|let|namespace|new|of|private|protected|public|readonly|return|satisfies|set|static|super|switch|this|throw|try|type|typeof|var|void|while|with|yield';\n\nconst STRINGS = /`(?:\\\\[\\s\\S]|[^\\\\`])*`?|\"(?:\\\\.|[^\"\\\\\\n])*\"?|'(?:\\\\.|[^'\\\\\\n])*'?/y;\n\nconst JS: Rule[] = [\n ['comment', /\\/\\/[^\\n]*|\\/\\*[\\s\\S]*?(?:\\*\\/|$)/y],\n ['string', STRINGS],\n ['keyword', new RegExp(`\\\\b(?:${JS_KEYWORDS})\\\\b`, 'y')],\n [\n 'number',\n /\\b(?:true|false|null|undefined|NaN|Infinity)\\b|\\b(?:0[xX][\\da-fA-F_]+|\\d[\\d_]*(?:\\.\\d+)?(?:[eE][+-]?\\d+)?n?)\\b/y,\n ],\n ['type', /\\b[A-Z][\\w$]*/y],\n ['function', /[a-zA-Z_$][\\w$]*(?=\\s*\\()/y],\n ['property', /(?<=\\s)[a-zA-Z_$][\\w$-]*(?==[{\"'])/y],\n ['plain', /[a-zA-Z_$][\\w$]*/y],\n ['punctuation', /[{}()[\\];,.<>/=+\\-*!?:&|%^~@]+/y],\n];\n\nconst JSON_RULES: Rule[] = [\n ['property', /\"(?:\\\\.|[^\"\\\\\\n])*\"(?=\\s*:)/y],\n ['string', /\"(?:\\\\.|[^\"\\\\\\n])*\"?/y],\n ['number', /\\b(?:true|false|null)\\b|-?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?/y],\n ['punctuation', /[{}[\\],:]/y],\n];\n\nconst BASH: Rule[] = [\n ['comment', /(?<![^\\s])#[^\\n]*/y],\n ['string', /\"(?:\\\\.|[^\"\\\\])*\"?|'[^']*'?/y],\n ['type', /\\$\\{[^}\\n]*\\}?|\\$[\\w@#?*!-]+/y],\n ['keyword', /\\b(?:if|then|else|elif|fi|for|while|until|do|done|case|esac|in|function|export|local|return|sudo)\\b/y],\n ['muted', /(?<![^\\s])--?[\\w-]+=?/y],\n ['function', /(?<=(?:^|[|;&(]|&&|\\|\\|)[ \\t]*)[A-Za-z_./][\\w./-]*/my],\n ['number', /\\b\\d+(?:\\.\\d+)*\\b/y],\n ['punctuation', /[|&;<>()=\\\\]+/y],\n];\n\nconst CSS: Rule[] = [\n ['comment', /\\/\\*[\\s\\S]*?(?:\\*\\/|$)/y],\n ['string', /\"(?:\\\\.|[^\"\\\\\\n])*\"?|'(?:\\\\.|[^'\\\\\\n])*'?/y],\n ['keyword', /@[\\w-]+|!important\\b/y],\n ['property', /--[\\w-]+|[a-z-]+(?=\\s*:[^:])/y],\n ['function', /[\\w-]+(?=\\()/y],\n ['number', /#[\\da-fA-F]{3,8}\\b|-?\\d*\\.?\\d+(?:px|rem|em|%|s|ms|vh|vw|deg|fr|ch)?/y],\n ['type', /[.#][\\w-]+|::?[\\w-]+/y],\n ['plain', /[\\w-]+/y],\n ['punctuation', /[{}()[\\];:,>+~*=]+/y],\n];\n\nconst LANGS: Record<string, Rule[]> = {\n ts: JS,\n tsx: JS,\n js: JS,\n jsx: JS,\n typescript: JS,\n javascript: JS,\n mjs: JS,\n cjs: JS,\n json: JSON_RULES,\n jsonc: JS,\n bash: BASH,\n sh: BASH,\n shell: BASH,\n zsh: BASH,\n console: BASH,\n css: CSS,\n};\n\n/** Whether the default tokenizer knows this language. */\nexport function isSupportedLanguage(lang: string | undefined): boolean {\n return lang != null && lang.toLowerCase() in LANGS;\n}\n\n/** Splits code into coloured tokens. Unknown languages return one plain token. */\nexport function tokenize(code: string, lang: string | undefined): CodeToken[] {\n const rules = lang ? LANGS[lang.toLowerCase()] : undefined;\n if (!rules) return [{ kind: 'plain', value: code }];\n const out: CodeToken[] = [];\n const push = (kind: TokenKind, value: string) => {\n const prev = out[out.length - 1];\n if (prev && prev.kind === kind) prev.value += value;\n else out.push({ kind, value });\n };\n let i = 0;\n outer: while (i < code.length) {\n for (const [kind, re] of rules) {\n re.lastIndex = i;\n const m = re.exec(code);\n if (m && m[0].length > 0) {\n push(kind, m[0]);\n i += m[0].length;\n continue outer;\n }\n }\n push('plain', code.charAt(i));\n i += 1;\n }\n return out;\n}\n\n/** Tokenizes and splits into lines (tokens that span lines, like block comments, are cut). */\nexport function tokenizeLines(code: string, lang: string | undefined): CodeToken[][] {\n const lines: CodeToken[][] = [[]];\n for (const token of tokenize(code, lang)) {\n const parts = token.value.split('\\n');\n parts.forEach((part, index) => {\n if (index > 0) lines.push([]);\n if (part) lines[lines.length - 1]?.push({ kind: token.kind, value: part });\n });\n }\n return lines;\n}\n","import { Check, Copy, WrapText } from 'lucide-react';\nimport { useEffect, useMemo, useState, type ReactNode, type Ref } from 'react';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { codeBlockVariants, tokenClass } from './code-block.variants';\nimport { tokenizeLines } from './tokenize';\n\ntype CopyStatus = 'idle' | 'copied' | 'failed';\n\nexport interface CodeBlockProps {\n /** The source to show and copy. A single trailing newline is ignored. */\n code: string;\n /** Language id (ts, tsx, js, json, bash, css… colour the default tokenizer knows). */\n language?: string;\n /** File name shown in the header (the language shows next to it). */\n filename?: string;\n /** Gutter with line numbers (not selectable, hidden from assistive tech). */\n showLineNumbers?: boolean;\n /** 1-based line numbers to emphasise. */\n highlightLines?: readonly number[];\n /** Initial soft-wrap state; the header toggle changes it. */\n defaultWrap?: boolean;\n /** Show the wrap toggle in the header. */\n wrapToggle?: boolean;\n /** Show the copy button. */\n copyable?: boolean;\n /** Max height of the code area (px or any CSS length); the rest scrolls. */\n maxHeight?: number | string;\n /**\n * Custom highlighter (e.g. Shiki). Called once per line with that line's text and the\n * language; return the coloured nodes. Without it a minimal token-coloured tokenizer runs.\n */\n highlight?: (code: string, language: string | undefined) => ReactNode;\n /** Accessible name of the scrollable code region. Defaults to the filename or \"{language} code\". */\n label?: string;\n className?: string;\n ref?: Ref<HTMLDivElement>;\n}\n\n/**\n * Read-only code panel: filename / language header, copy button with \"Copied\" feedback (and a\n * polite live announcement), optional line numbers, highlighted lines, soft-wrap toggle and a\n * max height. The code area is a focusable region so it scrolls from the keyboard.\n */\nexport function CodeBlock({\n code,\n language,\n filename,\n showLineNumbers = false,\n highlightLines,\n defaultWrap = false,\n wrapToggle = true,\n copyable = true,\n maxHeight,\n highlight,\n label,\n className,\n ref,\n}: CodeBlockProps) {\n const [wrap, setWrap] = useState(defaultWrap);\n const [status, setStatus] = useState<CopyStatus>('idle');\n const [copies, setCopies] = useState(0);\n const s = codeBlockVariants({ wrap });\n const source = code.endsWith('\\n') ? code.slice(0, -1) : code;\n\n const lines = useMemo<ReactNode[]>(() => {\n if (highlight) return source.split('\\n').map((line) => highlight(line, language));\n return tokenizeLines(source, language).map((tokens) =>\n tokens.map((t, i) =>\n tokenClass[t.kind] ? (\n <span key={i} className={tokenClass[t.kind]}>\n {t.value}\n </span>\n ) : (\n t.value\n ),\n ),\n );\n }, [source, language, highlight]);\n\n useEffect(() => {\n if (status === 'idle') return;\n const id = window.setTimeout(() => setStatus('idle'), 2000);\n return () => window.clearTimeout(id);\n }, [status, copies]);\n\n const copy = async () => {\n try {\n await navigator.clipboard.writeText(source);\n setStatus('copied');\n } catch {\n setStatus('failed');\n }\n setCopies((n) => n + 1);\n };\n\n const marked = new Set(highlightLines);\n const { t } = useI18n();\n const gutter = `${String(lines.length).length}ch`;\n const regionLabel = label ?? filename ?? (language ? t('codeBlock.languageCode', { language }) : t('codeBlock.code'));\n const announcement =\n status === 'copied' ? t('common.copiedToClipboard') : status === 'failed' ? t('common.copyFailed') : '';\n\n return (\n <div ref={ref} className={cn(s.root(), className)}>\n <div className={s.header()}>\n <div className={s.heading()}>\n {filename && <span className={s.filename()}>{filename}</span>}\n {language && <span className={s.language()}>{language}</span>}\n </div>\n <div className={s.actions()}>\n {wrapToggle && (\n <button\n type=\"button\"\n aria-label={t('codeBlock.wrap')}\n aria-pressed={wrap}\n onClick={() => setWrap((w) => !w)}\n className={s.button()}\n >\n <WrapText size={14} aria-hidden />\n </button>\n )}\n {copyable && (\n <button type=\"button\" onClick={copy} className={cn(s.button(), status === 'copied' && s.copied())}>\n {status === 'copied' ? <Check size={14} aria-hidden /> : <Copy size={14} aria-hidden />}\n {status === 'copied' ? t('common.copied') : t('common.copy')}\n </button>\n )}\n <span role=\"status\" className=\"sr-only\">\n {announcement}\n </span>\n </div>\n </div>\n <pre\n role=\"region\"\n aria-label={regionLabel}\n tabIndex={0}\n className={s.pre()}\n style={maxHeight != null ? { maxHeight } : undefined}\n data-language={language}\n >\n <code className={s.code()}>\n {lines.map((content, i) => (\n <span key={i} data-line={i + 1} data-highlighted={marked.has(i + 1) || undefined} className={s.line()}>\n {showLineNumbers && (\n <span aria-hidden className={s.lineNumber()} style={{ width: gutter }}>\n {i + 1}\n </span>\n )}\n <span className={s.content()}>\n {content === '' || (Array.isArray(content) && content.length === 0) ? ' ' : content}\n </span>\n </span>\n ))}\n </code>\n </pre>\n </div>\n );\n}\n","import type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { codeVariants } from './code-block.variants';\n\nexport interface CodeProps extends Omit<HTMLAttributes<HTMLElement>, 'className'> {\n className?: string;\n ref?: Ref<HTMLElement>;\n}\n\n/** Inline code inside running text: `<Code>pnpm add @gntik-ai/ui</Code>`. */\nexport function Code({ className, ...props }: CodeProps) {\n return <code className={cn(codeVariants(), className)} {...props} />;\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'CodeBlock',\n group: 'Display',\n status: 'beta',\n description:\n 'Read-only code panel with a filename / language header, a copy button (\"Copied\" feedback plus a polite live announcement), optional line numbers, highlighted lines, a soft-wrap toggle and a max height. Default colouring is a minimal tokenizer for ts/tsx/js/json/bash/css that only uses contrast-safe text tokens; pass `highlight` to plug in another highlighter. Code is the inline variant for running text.',\n pattern: 'button · region',\n keyboard: [\n ['Tab', 'Moves through the wrap toggle, the copy button and the scrollable code region'],\n ['Enter', 'Copies the code (on the copy button) or toggles wrapping (on the wrap toggle)'],\n ['Space', 'Same as Enter'],\n ['Arrow keys', 'Scroll the focused code region'],\n ],\n tokens: [\n 'card',\n 'background',\n 'border',\n 'secondary',\n 'foreground',\n 'muted-foreground',\n 'primary',\n 'primary-text',\n 'warning-text',\n 'destructive-text',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const collapsibleVariants = tv({\n slots: {\n root: 'flex flex-col',\n trigger: [\n 'group inline-flex cursor-pointer items-center gap-2 rounded-md text-[13px] font-medium text-foreground transition-colors',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n 'data-disabled:cursor-not-allowed data-disabled:opacity-50',\n ],\n chevron: [\n 'shrink-0 text-muted-foreground transition-transform duration-200 motion-reduce:transition-none',\n 'group-data-panel-open:rotate-180',\n ],\n panel: [\n 'h-(--collapsible-panel-height) overflow-hidden transition-[height] duration-200 ease-out motion-reduce:transition-none',\n 'data-starting-style:h-0 data-ending-style:h-0',\n ],\n content: 'pt-2 text-[13px] leading-relaxed text-muted-foreground text-pretty',\n },\n variants: {\n variant: {\n /** Compact inline toggle (\"Show advanced settings\"). */\n subtle: { trigger: 'h-8 -mx-2 px-2 hover:bg-secondary/60' },\n /** Full-width row with a divider, same family as Accordion. */\n row: {\n root: 'border-b border-border',\n trigger: 'w-full justify-between rounded-sm py-3.5 text-start hover:text-foreground/80',\n content: 'pt-0 pb-4',\n },\n },\n },\n defaultVariants: { variant: 'subtle' },\n});\n\nexport type CollapsibleVariantProps = VariantProps<typeof collapsibleVariants>;\n","import { Collapsible as BaseCollapsible } from '@base-ui/react/collapsible';\nimport { ChevronDown } from 'lucide-react';\nimport { createContext, useContext, type ReactNode, type Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { collapsibleVariants, type CollapsibleVariantProps } from './collapsible.variants';\n\ntype CollapsibleVariant = NonNullable<CollapsibleVariantProps['variant']>;\nconst CollapsibleContext = createContext<CollapsibleVariant>('subtle');\n\nexport interface CollapsibleProps extends Omit<BaseCollapsible.Root.Props, 'className'> {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n /** `subtle` (inline toggle) or `row` (full-width row with a divider, like an accordion item). */\n variant?: CollapsibleVariant;\n}\n\n/** A single show/hide section. Controlled with `open` + `onOpenChange`, or uncontrolled with `defaultOpen`. */\nexport function Collapsible({ variant = 'subtle', className, ...props }: CollapsibleProps) {\n return (\n <CollapsibleContext.Provider value={variant}>\n <BaseCollapsible.Root className={cn(collapsibleVariants({ variant }).root(), className)} {...props} />\n </CollapsibleContext.Provider>\n );\n}\n\nexport interface CollapsibleTriggerProps extends Omit<BaseCollapsible.Trigger.Props, 'className'> {\n className?: string;\n ref?: Ref<HTMLButtonElement>;\n /** Show the rotating chevron. */\n showChevron?: boolean;\n children?: ReactNode;\n}\n\n/** The toggle button (aria-expanded, aria-controls). */\nexport function CollapsibleTrigger({ showChevron = true, className, children, ...props }: CollapsibleTriggerProps) {\n const variant = useContext(CollapsibleContext);\n const s = collapsibleVariants({ variant });\n return (\n <BaseCollapsible.Trigger className={cn(s.trigger(), className)} {...props}>\n {children}\n {showChevron && <ChevronDown size={variant === 'row' ? 16 : 15} className={s.chevron()} aria-hidden />}\n </BaseCollapsible.Trigger>\n );\n}\n\nexport interface CollapsiblePanelProps extends Omit<BaseCollapsible.Panel.Props, 'className'> {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n children?: ReactNode;\n}\n\n/** The hidden content. Height animates; reduced motion turns the animation off. */\nexport function CollapsiblePanel({ className, children, ...props }: CollapsiblePanelProps) {\n const variant = useContext(CollapsibleContext);\n const s = collapsibleVariants({ variant });\n return (\n <BaseCollapsible.Panel className={s.panel()} {...props}>\n <div className={cn(s.content(), className)}>{children}</div>\n </BaseCollapsible.Panel>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Collapsible',\n group: 'Display',\n status: 'stable',\n description:\n 'A single show/hide section: an inline toggle (\"Advanced settings\") or a full-width row in the Accordion family. The chevron rotates and the height animates. Compound parts: Collapsible, CollapsibleTrigger, CollapsiblePanel.',\n primitive: '@base-ui/react/collapsible',\n pattern: 'disclosure',\n keyboard: [\n ['Enter / Space', 'Expands or collapses the panel'],\n ['Tab', 'Moves focus from the trigger into the open panel content'],\n ],\n tokens: ['border', 'secondary', 'foreground', 'muted-foreground', 'focus-ring'],\n};\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Spinner',\n group: 'Feedback',\n status: 'stable',\n description: 'Indeterminate loading indicator that inherits the current text colour.',\n pattern: 'status',\n tokens: ['currentColor'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\n/** Shared popup surface for Select and Combobox (portal → positioner → popup). */\nexport const listboxPopup = [\n 'max-h-[min(var(--available-height),18rem)] min-w-[var(--anchor-width)] origin-[var(--transform-origin)] overflow-y-auto',\n 'rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-lg outline-none',\n 'transition-[opacity,scale] duration-150 motion-reduce:transition-none',\n 'data-starting-style:scale-[0.98] data-starting-style:opacity-0 data-ending-style:scale-[0.98] data-ending-style:opacity-0',\n];\n\n/** Shared option row for Select and Combobox. */\nexport const listboxItem = [\n 'flex cursor-default items-center justify-between gap-2 rounded-[6px] px-2.5 py-1.5 text-[13px] text-foreground outline-none select-none',\n 'data-highlighted:bg-secondary/70 data-selected:bg-primary/12 data-selected:data-highlighted:bg-primary/16',\n 'data-disabled:cursor-not-allowed data-disabled:opacity-45',\n];\n\nexport const selectVariants = tv({\n slots: {\n label: 'mb-2 block text-[13px] font-medium text-foreground',\n trigger: [\n 'group flex w-full items-center justify-between gap-2 rounded-md border border-border bg-background text-foreground shadow-sm transition-colors select-none',\n 'hover:border-muted-foreground/40 data-popup-open:border-primary/60 data-popup-open:ring-2 data-popup-open:ring-ring/25',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n 'data-disabled:cursor-not-allowed data-disabled:opacity-50',\n ],\n value: 'flex min-w-0 items-center gap-2 truncate data-placeholder:text-muted-foreground',\n icon: 'flex shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none group-data-popup-open:rotate-180',\n positioner: 'z-50 outline-none',\n popup: listboxPopup,\n list: 'outline-none',\n item: listboxItem,\n itemText: 'flex min-w-0 items-center gap-2 truncate',\n indicator: 'flex shrink-0 text-primary-text',\n groupLabel: 'px-2.5 pt-2 pb-1 text-[11px] font-medium tracking-wide text-muted-foreground uppercase',\n separator: '-mx-1 my-1 h-px bg-border',\n status: 'flex items-center justify-center gap-2 px-2.5 py-2 text-[12.5px] text-muted-foreground',\n statusError: 'flex-wrap text-destructive-text',\n retry: [\n 'inline-flex items-center gap-1 rounded-sm px-1.5 py-0.5 text-[12px] font-medium text-foreground underline underline-offset-2 hover:bg-secondary',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n },\n variants: {\n size: {\n /** Follows `data-density` (comfortable = md). */\n auto: { trigger: 'h-control pe-2.5 ps-field text-[13px]' },\n sm: { trigger: 'h-8 pe-2 ps-2.5 text-[12.5px]' },\n md: { trigger: 'h-9 pe-2.5 ps-3 text-[13px]' },\n lg: { trigger: 'h-11 pe-3 ps-3.5 text-[14.5px] rounded-lg' },\n },\n },\n defaultVariants: { size: 'auto' },\n});\n\nexport type SelectVariantProps = VariantProps<typeof selectVariants>;\n","import { tv, type VariantProps } from '../../utils/tv';\nimport { listboxItem, listboxPopup } from '../Select/select.variants';\n\nconst field = [\n 'rounded-md border border-border bg-background text-foreground shadow-sm transition-colors',\n 'focus-within:border-primary/60 focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-focus-ring',\n 'has-[input[data-disabled]]:cursor-not-allowed has-[input[data-disabled]]:opacity-50',\n];\n\nexport const comboboxVariants = tv({\n slots: {\n label: 'mb-2 block text-[13px] font-medium text-foreground',\n inputGroup: [...field, 'flex items-center pe-1 ps-3'],\n searchIcon: 'shrink-0 text-muted-foreground',\n input: 'w-full min-w-0 bg-transparent pe-1 ps-2.5 text-foreground outline-none placeholder:text-muted-foreground',\n iconButton: [\n 'grid size-7 shrink-0 place-items-center rounded text-muted-foreground transition-colors hover:text-foreground',\n 'focus-visible:outline-2 focus-visible:outline-focus-ring',\n ],\n chevron: 'transition-transform motion-reduce:transition-none group-data-popup-open:rotate-180',\n chipsGroup: [...field, 'cursor-text px-2 py-1.5'],\n chips: 'flex w-full flex-wrap items-center gap-1.5',\n chip: [\n 'inline-flex h-6 items-center gap-1 rounded bg-primary/14 pe-1 ps-2 text-[12px] font-medium text-primary-chip-text outline-none',\n 'data-highlighted:bg-primary/24 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus-ring',\n ],\n chipRemove: 'grid size-4 place-items-center rounded transition-colors hover:bg-primary/20',\n chipsInput:\n 'h-6 min-w-20 flex-1 bg-transparent px-1 text-[13px] text-foreground outline-none placeholder:text-muted-foreground',\n positioner: 'z-50 outline-none',\n popup: listboxPopup,\n list: 'outline-none data-empty:hidden',\n item: listboxItem,\n itemContent: 'flex min-w-0 flex-1 items-center gap-2',\n indicator: 'flex shrink-0 text-primary-text',\n empty: 'px-2.5 py-3 text-center text-[12.5px] text-muted-foreground empty:hidden',\n status: 'flex items-center justify-center gap-2 px-2.5 py-2 text-[12.5px] text-muted-foreground empty:hidden',\n statusError: 'text-destructive-text',\n specialItem: 'font-medium',\n specialIcon: 'shrink-0 text-primary-text',\n },\n variants: {\n size: {\n /** Follows `data-density` (comfortable = md). */\n auto: { input: 'h-control text-[13px]' },\n sm: { input: 'h-8 text-[12.5px]' },\n md: { input: 'h-9 text-[13px]' },\n },\n },\n defaultVariants: { size: 'auto' },\n});\n\nexport type ComboboxVariantProps = VariantProps<typeof comboboxVariants>;\n","/**\n * Built-in rows the kit adds to a combobox list: \"Create “…”\" (creatable) and \"Retry\" (after a\n * failed async load). They are real options, so the keyboard reaches them like any other row,\n * but selecting one never becomes the value.\n */\nexport interface SpecialItem {\n readonly __gntikSpecial: 'create' | 'retry';\n /** The typed text: selecting the row leaves the input as it was. */\n readonly value: string;\n readonly label: string;\n}\n\nexport const createItem = (input: string): SpecialItem => ({ __gntikSpecial: 'create', value: input, label: input });\nexport const retryItem = (input: string): SpecialItem => ({ __gntikSpecial: 'retry', value: input, label: input });\n\nexport function isSpecialItem(item: unknown): item is SpecialItem {\n return !!item && typeof item === 'object' && '__gntikSpecial' in item;\n}\n\n/** `{ label }` → label, otherwise `String(item)` (Base UI's default for `{ value, label }` items). */\nexport function defaultItemLabel(item: unknown): string {\n if (item && typeof item === 'object' && 'label' in item) return String((item as { label: unknown }).label);\n return item == null ? '' : String(item);\n}\n\n/** `{ value }` → value, otherwise `String(item)`. */\nexport function defaultItemValue(item: unknown): string {\n if (item && typeof item === 'object' && 'value' in item) return String((item as { value: unknown }).value);\n return item == null ? '' : String(item);\n}\n\n/** Whether an option label already equals the typed text (case-insensitive). */\nexport function hasExactLabel<Item>(items: readonly Item[], input: string, toLabel: (item: Item) => string): boolean {\n const q = input.trim().toLocaleLowerCase();\n return items.some((item) => !isSpecialItem(item) && toLabel(item).trim().toLocaleLowerCase() === q);\n}\n","import { useCallback, useEffect, useRef, useState } from 'react';\n\n/**\n * Loads the options for a query. Receives an `AbortSignal` that fires when the request goes stale\n * (the query changed, the popup closed or the component unmounted): pass it to `fetch`.\n */\nexport type LoadOptions<Item> = (query: string, context: { signal: AbortSignal }) => Promise<readonly Item[]>;\n\nexport interface UseAsyncOptionsConfig<Item> {\n /** Wait this long (ms) after the last keystroke before loading. Default 250; an empty query loads at once. */\n debounceMs?: number;\n /** Load only while true (e.g. while the popup is open). Results are kept when it turns false. */\n enabled?: boolean;\n /** Called with every successful result (e.g. to remember the labels of loaded options). */\n onResult?: (items: readonly Item[], query: string) => void;\n}\n\nexport interface AsyncOptionsState<Item> {\n /** The latest loaded options (kept while a newer query loads). */\n items: readonly Item[];\n /** True from the moment the query changes until its result (or error) arrives. */\n loading: boolean;\n /** The last request's error, or `null`. */\n error: unknown;\n /** Runs the current query again (e.g. after an error). */\n reload: () => void;\n}\n\ninterface Loaded<Item> {\n query: string | null;\n items: readonly Item[];\n error: unknown;\n}\n\nconst isAbort = (e: unknown) => e instanceof DOMException && e.name === 'AbortError';\n\n/**\n * Debounced, abortable option loading shared by Combobox, MultiSelect and SimpleSelect.\n * Without `loadOptions` it is inert (`loading` false, no items).\n */\nexport function useAsyncOptions<Item>(\n loadOptions: LoadOptions<Item> | undefined,\n query: string,\n { debounceMs = 250, enabled = true, onResult }: UseAsyncOptionsConfig<Item> = {},\n): AsyncOptionsState<Item> {\n const [loaded, setLoaded] = useState<Loaded<Item>>({ query: null, items: [], error: null });\n const [reloadKey, setReloadKey] = useState(0);\n const loadRef = useRef(loadOptions);\n const onResultRef = useRef(onResult);\n useEffect(() => {\n loadRef.current = loadOptions;\n onResultRef.current = onResult;\n });\n\n const active = !!loadOptions && enabled;\n const stale = loaded.query !== query;\n\n useEffect(() => {\n const load = loadRef.current;\n if (!active || !load || !stale) return;\n const controller = new AbortController();\n const timer = window.setTimeout(\n () => {\n let request: Promise<readonly Item[]>;\n try {\n request = load(query, { signal: controller.signal });\n } catch (error) {\n request = Promise.reject(error);\n }\n request.then(\n (items) => {\n if (controller.signal.aborted) return;\n setLoaded({ query, items, error: null });\n onResultRef.current?.(items, query);\n },\n (error: unknown) => {\n if (controller.signal.aborted || isAbort(error)) return;\n setLoaded((prev) => ({ query, items: prev.items, error: error ?? new Error('Failed to load options') }));\n },\n );\n },\n query === '' ? 0 : debounceMs,\n );\n return () => {\n window.clearTimeout(timer);\n controller.abort();\n };\n }, [active, stale, query, debounceMs, reloadKey]);\n\n const reload = useCallback(() => {\n setLoaded((prev) => ({ ...prev, query: null, error: null }));\n setReloadKey((k) => k + 1);\n }, []);\n\n return {\n items: loaded.items,\n loading: active && stale,\n error: !stale ? loaded.error : null,\n reload,\n };\n}\n","import { Combobox as BaseCombobox } from '@base-ui/react/combobox';\nimport { createContext, useContext, useRef, useState, type ReactNode } from 'react';\nimport {\n createItem,\n defaultItemLabel,\n hasExactLabel,\n isSpecialItem,\n retryItem,\n type SpecialItem,\n} from './specialItems';\nimport { useAsyncOptions, type LoadOptions } from './useAsyncOptions';\n\nexport interface ComboboxAsyncProps<Value> {\n /**\n * Async options: called (debounced) with the typed query and an `AbortSignal` that fires when the\n * request goes stale. While it is set, the returned options are shown as-is (no client filter).\n */\n loadOptions?: LoadOptions<Value>;\n /** Debounce for `loadOptions`, in ms. Default 250. */\n debounceMs?: number;\n /**\n * Creatable: adds a \"Create “…”\" option while the typed text matches no option. Return the new\n * item (or a promise of it) to select it; return nothing to leave the selection as it is.\n */\n onCreate?: (input: string) => Value | void | Promise<Value | void>;\n /** Text of the create option. Default: \"Create “{input}”\". */\n createLabel?: (input: string) => ReactNode;\n /** Shown (and announced) while options load. Default: \"Loading…\". */\n loadingText?: ReactNode;\n /** Shown (and announced) when `loadOptions` rejects. Default: \"Couldn’t load options.\" */\n errorText?: ReactNode | ((error: unknown) => ReactNode);\n}\n\nexport type ComboboxProps<Value, Multiple extends boolean | undefined = false> = BaseCombobox.Root.Props<\n Value,\n Multiple\n> &\n ComboboxAsyncProps<Value>;\n\ninterface ComboboxEnhancement {\n loading: boolean;\n error: unknown;\n loadingText?: ReactNode;\n errorText?: ComboboxAsyncProps<unknown>['errorText'];\n createLabel?: (input: string) => ReactNode;\n specials: SpecialItem[];\n}\n\nconst EnhancementContext = createContext<ComboboxEnhancement | null>(null);\n\n/** Async / creatable state for ComboboxContent; `null` for a plain Combobox. */\nexport const useComboboxEnhancement = () => useContext(EnhancementContext);\n\n/**\n * Combobox state container: `items` (filtered by the input), `value` / `defaultValue` /\n * `onValueChange`, `multiple`. Items shaped `{ value, label }` need no extra config.\n * Add `loadOptions` for async options and `onCreate` for a \"Create “…”\" option.\n */\nexport function Combobox<Value, Multiple extends boolean | undefined = false>(props: ComboboxProps<Value, Multiple>) {\n const { loadOptions, debounceMs, onCreate, createLabel, loadingText, errorText, ...root } = props;\n const flat = root.items === undefined || (Array.isArray(root.items) && !root.items.some(isGroup));\n if ((!loadOptions && !onCreate) || !flat) return <BaseCombobox.Root {...root} />;\n return (\n <EnhancedCombobox\n root={root as BaseCombobox.Root.Props<unknown, Multiple>}\n loadOptions={loadOptions as LoadOptions<unknown> | undefined}\n debounceMs={debounceMs}\n onCreate={onCreate as ComboboxAsyncProps<unknown>['onCreate']}\n createLabel={createLabel}\n loadingText={loadingText}\n errorText={errorText}\n />\n );\n}\n\nfunction isGroup(item: unknown): boolean {\n return !!item && typeof item === 'object' && Array.isArray((item as { items?: unknown }).items);\n}\n\ntype ChangeDetails = BaseCombobox.Root.ChangeEventDetails;\n\nfunction EnhancedCombobox<Multiple extends boolean | undefined>({\n root,\n loadOptions,\n debounceMs,\n onCreate,\n createLabel,\n loadingText,\n errorText,\n}: ComboboxAsyncProps<unknown> & { root: BaseCombobox.Root.Props<unknown, Multiple> }) {\n const {\n items,\n value: valueProp,\n defaultValue,\n onValueChange,\n onInputValueChange,\n open: openProp,\n defaultOpen,\n onOpenChange,\n filter,\n itemToStringLabel,\n isItemEqualToValue,\n multiple,\n ...rest\n } = root;\n const core = BaseCombobox.useFilter();\n const [innerValue, setInnerValue] = useState<unknown>(defaultValue ?? (multiple ? [] : null));\n const value = valueProp !== undefined ? valueProp : innerValue;\n const [input, setInput] = useState(String(root.inputValue ?? root.defaultInputValue ?? ''));\n const [innerOpen, setInnerOpen] = useState(defaultOpen ?? false);\n const open = openProp ?? innerOpen;\n const keepOpen = useRef(false);\n\n const toLabel = (item: unknown) =>\n isSpecialItem(item) ? item.label : itemToStringLabel ? itemToStringLabel(item) : defaultItemLabel(item);\n const typed = input.trim();\n const selectedLabel = !multiple && value != null ? toLabel(value).trim() : null;\n // A single selection fills the input with its label: that is not a search.\n const query = selectedLabel !== null && selectedLabel === typed ? '' : typed;\n\n const remote = useAsyncOptions<unknown>(loadOptions, query, { debounceMs, enabled: open });\n const base: readonly unknown[] = loadOptions\n ? remote.error\n ? []\n : remote.items\n : ((items as readonly unknown[] | undefined) ?? []);\n const specials: SpecialItem[] = [];\n if (onCreate && query !== '' && !hasExactLabel(base, typed, toLabel)) specials.push(createItem(typed));\n if (loadOptions && remote.error && !remote.loading) specials.push(retryItem(input));\n const allItems = [...base, ...specials];\n\n const commit = (next: unknown, details: ChangeDetails) => {\n setInnerValue(next);\n (onValueChange as ((v: unknown, d: ChangeDetails) => void) | undefined)?.(next, details);\n };\n\n const create = async (text: string, kept: unknown[] | null, details: ChangeDetails) => {\n const created = await onCreate?.(text);\n if (created === undefined || created === null) return;\n commit(kept ? [...kept, created] : created, details);\n };\n\n const handleValueChange = (next: unknown, details: ChangeDetails) => {\n const list = multiple && Array.isArray(next) ? next : null;\n const special = list ? list.find(isSpecialItem) : isSpecialItem(next) ? next : undefined;\n if (!special) return commit(next, details);\n const kept = list ? list.filter((item) => !isSpecialItem(item)) : null;\n if (special.__gntikSpecial === 'retry') {\n keepOpen.current = true;\n remote.reload();\n return;\n }\n void create(special.value.trim(), kept, details);\n };\n\n const enhancement: ComboboxEnhancement = {\n loading: remote.loading,\n error: remote.error,\n loadingText,\n errorText,\n createLabel,\n specials,\n };\n\n return (\n <EnhancementContext.Provider value={enhancement}>\n <BaseCombobox.Root<unknown, Multiple>\n {...rest}\n multiple={multiple}\n items={allItems}\n value={value as never}\n onValueChange={handleValueChange as never}\n open={open}\n onOpenChange={(next, details) => {\n if (!next && keepOpen.current) {\n keepOpen.current = false;\n return;\n }\n setInnerOpen(next);\n onOpenChange?.(next, details);\n }}\n onInputValueChange={(next, details) => {\n setInput(next);\n onInputValueChange?.(next, details);\n }}\n itemToStringLabel={toLabel}\n isItemEqualToValue={(a: unknown, b: unknown) =>\n isSpecialItem(a) || isSpecialItem(b)\n ? a === b\n : isItemEqualToValue\n ? isItemEqualToValue(a, b)\n : Object.is(a, b)\n }\n filter={\n loadOptions\n ? null\n : (item: unknown, q: string, toString?: (item: unknown) => string) =>\n isSpecialItem(item) ||\n filter === null ||\n (filter ? filter(item, q, toString) : core.contains(item, q, toString))\n }\n />\n </EnhancementContext.Provider>\n );\n}\n","import { Combobox as BaseCombobox } from '@base-ui/react/combobox';\nimport { Check, ChevronDown, Plus, RotateCw, Search, X } from 'lucide-react';\nimport { useId, type ReactNode, type Ref } from 'react';\nimport { usePortalDir, useI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { Spinner } from '../Spinner';\nimport { comboboxVariants, type ComboboxVariantProps } from './combobox.variants';\nimport { useComboboxEnhancement } from './ComboboxRoot';\nimport { isSpecialItem, type SpecialItem } from './specialItems';\n\nexport { Combobox, type ComboboxProps, type ComboboxAsyncProps } from './ComboboxRoot';\n\nconst s = comboboxVariants();\n\n// Inputs also use aria-labelledby: while the popup is open Base UI aria-hides outside nodes\n// (including the <label>), and aria-labelledby still resolves through hidden elements.\ntype InputBaseProps = Omit<BaseCombobox.Input.Props, 'className' | 'size'> & {\n className?: string;\n ref?: Ref<HTMLInputElement>;\n /** Visible label rendered above the field and bound to the input. Without it, pass `aria-label`. */\n label?: ReactNode;\n};\n\nexport interface ComboboxInputProps extends InputBaseProps, ComboboxVariantProps {\n /** Show a clear button while a value is selected. */\n showClear?: boolean;\n clearLabel?: string;\n /** Accessible name of the chevron button. */\n triggerLabel?: string;\n}\n\n/** Single-select field: search icon, text input, optional clear, chevron trigger. */\nexport function ComboboxInput({\n size,\n label,\n className,\n showClear = false,\n clearLabel: clearLabelProp,\n triggerLabel: triggerLabelProp,\n id,\n ...props\n}: ComboboxInputProps) {\n const { t } = useI18n();\n const clearLabel = clearLabelProp ?? t('common.clearSelection');\n const triggerLabel = triggerLabelProp ?? t('common.showOptions');\n const autoId = useId();\n const inputId = id ?? autoId;\n const v = comboboxVariants({ size });\n return (\n <>\n {label && (\n <label id={`${inputId}-label`} htmlFor={inputId} className={s.label()}>\n {label}\n </label>\n )}\n <BaseCombobox.InputGroup className={cn(v.inputGroup(), className)}>\n <Search size={15} aria-hidden className={v.searchIcon()} />\n <BaseCombobox.Input\n id={inputId}\n aria-labelledby={label ? `${inputId}-label` : undefined}\n className={v.input()}\n {...props}\n />\n {showClear && (\n <BaseCombobox.Clear aria-label={clearLabel} className={v.iconButton()}>\n <X size={14} aria-hidden />\n </BaseCombobox.Clear>\n )}\n <BaseCombobox.Trigger aria-label={triggerLabel} className={cn('group', v.iconButton())}>\n <ChevronDown size={15} aria-hidden className={v.chevron()} />\n </BaseCombobox.Trigger>\n </BaseCombobox.InputGroup>\n </>\n );\n}\n\nexport interface ComboboxChipsInputProps<Item> extends InputBaseProps {\n /** Chip text for a selected item. Defaults to `item.label`, else `String(item)`. */\n getLabel?: (item: Item) => string;\n /** Accessible name of each chip's remove button. */\n removeLabel?: (label: string) => string;\n}\n\nfunction defaultLabel(item: unknown): string {\n if (item && typeof item === 'object' && 'label' in item) return String((item as { label: unknown }).label);\n return String(item);\n}\n\n/** Multi-select field: selected items as removable chips followed by the text input. Use with `<Combobox multiple>`. */\nexport function ComboboxChipsInput<Item = unknown>({\n label,\n className,\n placeholder,\n getLabel = defaultLabel,\n removeLabel: removeLabelProp,\n id,\n ...props\n}: ComboboxChipsInputProps<Item>) {\n const { t } = useI18n();\n const removeLabel = removeLabelProp ?? ((l: string) => t('common.removeItem', { label: l }));\n const autoId = useId();\n const inputId = id ?? autoId;\n return (\n <>\n {label && (\n <label id={`${inputId}-label`} htmlFor={inputId} className={s.label()}>\n {label}\n </label>\n )}\n <BaseCombobox.InputGroup className={cn(s.chipsGroup(), className)}>\n <BaseCombobox.Value>\n {(values: Item[]) => (\n <BaseCombobox.Chips className={s.chips()}>\n {values.map((item, i) => {\n const text = getLabel(item);\n return (\n <BaseCombobox.Chip key={`${text}-${i}`} className={s.chip()} aria-label={text}>\n {text}\n <BaseCombobox.ChipRemove aria-label={removeLabel(text)} className={s.chipRemove()}>\n <X size={11} strokeWidth={2.4} aria-hidden />\n </BaseCombobox.ChipRemove>\n </BaseCombobox.Chip>\n );\n })}\n <BaseCombobox.Input\n id={inputId}\n aria-labelledby={label ? `${inputId}-label` : undefined}\n placeholder={values.length ? undefined : placeholder}\n className={s.chipsInput()}\n {...props}\n />\n </BaseCombobox.Chips>\n )}\n </BaseCombobox.Value>\n </BaseCombobox.InputGroup>\n </>\n );\n}\n\nexport interface ComboboxContentProps extends Omit<BaseCombobox.Popup.Props, 'className' | 'children'> {\n className?: string;\n /** Shown (and announced) when no item matches the query. */\n emptyText?: ReactNode;\n side?: BaseCombobox.Positioner.Props['side'];\n align?: BaseCombobox.Positioner.Props['align'];\n sideOffset?: number;\n container?: BaseCombobox.Portal.Props['container'];\n /** List children: a render function `(item) => <ComboboxItem …/>`, or static items. */\n children?: BaseCombobox.List.Props['children'];\n}\n\n/** The popup: portal, positioner, popup surface, async status, empty state and listbox. */\nexport function ComboboxContent({\n className,\n emptyText: emptyTextProp,\n side = 'bottom',\n align = 'start',\n sideOffset = 6,\n container,\n children,\n ...props\n}: ComboboxContentProps) {\n const { t } = useI18n();\n const emptyText = emptyTextProp ?? t('common.noMatches');\n const dir = usePortalDir();\n const enh = useComboboxEnhancement();\n let list = children;\n if (enh && typeof children === 'function') {\n list = (item: unknown, index: number) =>\n isSpecialItem(item) ? (\n <ComboboxSpecialItem key={`${item.__gntikSpecial}:${item.value}`} item={item} />\n ) : (\n children(item, index)\n );\n } else if (enh) {\n list = (\n <>\n {children}\n {enh.specials.map((item) => (\n <ComboboxSpecialItem key={item.__gntikSpecial} item={item} />\n ))}\n </>\n );\n }\n const busy = !!enh && (enh.loading || !!enh.error);\n const errorText =\n typeof enh?.errorText === 'function' ? enh.errorText(enh.error) : (enh?.errorText ?? t('combobox.loadFailed'));\n return (\n <BaseCombobox.Portal container={container}>\n <BaseCombobox.Positioner dir={dir} className={s.positioner()} side={side} align={align} sideOffset={sideOffset}>\n <BaseCombobox.Popup className={cn(s.popup(), className)} {...props}>\n {enh && (\n <BaseCombobox.Status className={cn(s.status(), !!enh.error && !enh.loading && s.statusError())}>\n {enh.loading ? (\n <>\n <Spinner size={13} />\n {enh.loadingText ?? t('common.loading')}\n </>\n ) : enh.error ? (\n errorText\n ) : null}\n </BaseCombobox.Status>\n )}\n <BaseCombobox.Empty className={s.empty()}>{busy ? null : emptyText}</BaseCombobox.Empty>\n <BaseCombobox.List className={s.list()} aria-busy={enh?.loading || undefined}>\n {list}\n </BaseCombobox.List>\n </BaseCombobox.Popup>\n </BaseCombobox.Positioner>\n </BaseCombobox.Portal>\n );\n}\n\n/** The built-in \"Create “…”\" and \"Retry\" rows (internal; MultiSelect reuses it). */\nexport function ComboboxSpecialItem({\n item,\n createLabel,\n}: {\n item: SpecialItem;\n createLabel?: (input: string) => ReactNode;\n}) {\n const { t } = useI18n();\n const enh = useComboboxEnhancement();\n const label = createLabel ?? enh?.createLabel;\n const create = item.__gntikSpecial === 'create';\n return (\n <BaseCombobox.Item value={item} className={cn(s.item(), s.specialItem())}>\n <span className={s.itemContent()}>\n {create ? (\n <Plus size={14} aria-hidden className={s.specialIcon()} />\n ) : (\n <RotateCw size={14} aria-hidden className={s.specialIcon()} />\n )}\n <span className=\"truncate\">\n {create ? (label?.(item.value) ?? t('combobox.create', { label: item.value })) : t('common.retry')}\n </span>\n </span>\n </BaseCombobox.Item>\n );\n}\n\nexport interface ComboboxItemProps extends Omit<BaseCombobox.Item.Props, 'className'> {\n className?: string;\n}\n\n/** One option. Shows a check when selected. */\nexport function ComboboxItem({ className, children, ...props }: ComboboxItemProps) {\n return (\n <BaseCombobox.Item className={cn(s.item(), className)} {...props}>\n <span className={s.itemContent()}>{children}</span>\n <BaseCombobox.ItemIndicator className={s.indicator()}>\n <Check size={15} strokeWidth={2.4} aria-hidden />\n </BaseCombobox.ItemIndicator>\n </BaseCombobox.Item>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Combobox',\n group: 'Forms',\n status: 'stable',\n description:\n 'Searchable select: typing filters the list. Single select (ComboboxInput) or multi-select with removable chips (ComboboxChipsInput), an announced empty state, and rich rows via ComboboxItem children. Async options (`loadOptions(query, { signal })`: debounced, stale requests aborted, announced loading and error states with a Retry row) and creatable (`onCreate(input)` adds a “Create …” row).',\n primitive: '@base-ui/react/combobox',\n pattern: 'combobox (list autocomplete) + listbox',\n keyboard: [\n ['Type a character', 'Opens the popup and filters the options'],\n ['ArrowDown / ArrowUp', 'Opens the popup and moves the highlight between options'],\n ['Enter', 'Selects the highlighted option (adds a chip in multi-select)'],\n ['Escape', 'Closes the popup, keeping focus in the input'],\n ['Backspace', 'Multi-select, empty input: removes the last chip'],\n [\n 'Enter on “Create …” / “Retry”',\n 'Creates an item from the typed text (onCreate) / loads the options again after an error',\n ],\n ],\n tokens: [\n 'background',\n 'border',\n 'popover',\n 'popover-foreground',\n 'primary',\n 'primary-text',\n 'secondary',\n 'muted-foreground',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const kbdVariants = tv({\n slots: {\n key: 'inline-flex items-center justify-center rounded border border-border bg-card font-mono font-semibold leading-none text-muted-foreground',\n combo: 'inline-flex items-center gap-1 font-mono',\n plus: 'text-[10px] text-muted-foreground',\n },\n variants: {\n size: {\n sm: { key: 'h-4 min-w-4 px-1 text-[10px]' },\n md: { key: 'h-5 min-w-5 px-1.5 text-[10px]' },\n lg: { key: 'h-6 min-w-6 px-1.5 text-[11.5px]' },\n },\n },\n defaultVariants: { size: 'md' },\n});\n\nexport type KbdVariantProps = VariantProps<typeof kbdVariants>;\n\n/** Spoken names for symbol keys, read by screen readers instead of the glyph. */\nexport const KEY_NAMES: Record<string, string> = {\n '⌘': 'Command',\n '⌥': 'Option',\n '⇧': 'Shift',\n '⌃': 'Control',\n '↵': 'Enter',\n '⏎': 'Enter',\n '⌫': 'Backspace',\n '⇥': 'Tab',\n '⎋': 'Escape',\n '↑': 'Up arrow',\n '↓': 'Down arrow',\n '←': 'Left arrow',\n '→': 'Right arrow',\n '↑↓': 'Up and down arrows',\n};\n","import { Fragment, type HTMLAttributes, type ReactNode, type Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport type { MessageKey } from '../../i18n/messages/en';\nimport { kbdVariants, type KbdVariantProps } from './kbd.variants';\n\n/** Catalog keys for the spoken names of symbol keys (KEY_NAMES holds the English ones). */\nconst KEY_MESSAGES: Record<string, MessageKey> = {\n '⌘': 'kbd.command',\n '⌥': 'kbd.option',\n '⇧': 'kbd.shift',\n '⌃': 'kbd.control',\n '↵': 'kbd.enter',\n '⏎': 'kbd.enter',\n '⌫': 'kbd.backspace',\n '⇥': 'kbd.tab',\n '⎋': 'kbd.escape',\n '↑': 'kbd.up',\n '↓': 'kbd.down',\n '←': 'kbd.left',\n '→': 'kbd.right',\n '↑↓': 'kbd.upDown',\n};\n\nexport interface KbdProps extends Omit<HTMLAttributes<HTMLElement>, 'className'>, KbdVariantProps {\n className?: string;\n ref?: Ref<HTMLElement>;\n /** Spoken name for a symbol key. Defaults to a built-in name for ⌘ ⌥ ⇧ ⌃ ↵ ⌫ and arrows. */\n label?: string;\n children?: ReactNode;\n}\n\n/** One keyboard key. Symbol glyphs are hidden from screen readers and replaced by their name. */\nexport function Kbd({ size, label, className, children, ...props }: KbdProps) {\n const { t } = useI18n();\n const key = typeof children === 'string' ? KEY_MESSAGES[children] : undefined;\n const spoken = label ?? (key ? t(key) : undefined);\n return (\n <kbd className={cn(kbdVariants({ size }).key(), className)} {...props}>\n {spoken ? (\n <>\n <span aria-hidden>{children}</span>\n <span className=\"sr-only\">{spoken}</span>\n </>\n ) : (\n children\n )}\n </kbd>\n );\n}\n\nexport interface KbdComboProps extends Omit<HTMLAttributes<HTMLElement>, 'className'>, KbdVariantProps {\n className?: string;\n ref?: Ref<HTMLElement>;\n /** Keys pressed together, e.g. ['⌘', 'K']. */\n keys: string[];\n /** Visible joiner between keys (e.g. \"+\"); none by default, as on macOS. */\n separator?: ReactNode;\n}\n\n/** A key combination: nested <kbd> elements inside an outer <kbd>, per the HTML spec. */\nexport function KbdCombo({ keys, size, separator, className, ...props }: KbdComboProps) {\n const s = kbdVariants({ size });\n return (\n <kbd className={cn(s.combo(), className)} {...props}>\n {keys.map((k, i) => (\n <Fragment key={`${k}-${i}`}>\n {i > 0 && separator != null && (\n <span aria-hidden className={s.plus()}>\n {separator}\n </span>\n )}\n <Kbd size={size}>{k}</Kbd>\n </Fragment>\n ))}\n </kbd>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Kbd',\n group: 'Display',\n status: 'stable',\n description:\n 'Keyboard key chip (<kbd>) for shortcuts and hints, in three sizes. KbdCombo renders a key combination such as ⌘ K. Symbol keys are announced by name (Command, Shift, Enter…).',\n tokens: ['border', 'card', 'muted-foreground'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const commandPaletteVariants = tv({\n slots: {\n trigger: [\n 'inline-flex h-10 cursor-pointer items-center gap-2.5 rounded-lg border border-border bg-card pe-2.5 ps-3.5 text-muted-foreground transition-colors',\n 'hover:border-ring/50 hover:text-foreground motion-reduce:transition-none',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n triggerText: 'text-[13px]',\n backdrop: [\n 'fixed inset-0 z-50 bg-background/70 backdrop-blur-sm transition-opacity duration-150 motion-reduce:transition-none',\n 'data-starting-style:opacity-0 data-ending-style:opacity-0',\n ],\n viewport: 'fixed inset-0 z-50 flex items-start justify-center px-4 pt-[12vh] pb-4',\n popup: [\n 'flex max-h-[min(560px,80vh)] w-full max-w-[560px] flex-col overflow-hidden rounded-xl border border-border bg-popover text-popover-foreground shadow-lg outline-none',\n 'transition-[opacity,scale] duration-150 motion-reduce:transition-none',\n 'data-starting-style:scale-[0.98] data-starting-style:opacity-0 data-ending-style:scale-[0.98] data-ending-style:opacity-0',\n ],\n inputRow: 'flex h-[52px] shrink-0 items-center gap-2.5 border-b border-border px-4',\n inputIcon: 'shrink-0 text-muted-foreground',\n input:\n 'h-full min-w-0 flex-1 bg-transparent text-[14px] text-foreground outline-none placeholder:text-muted-foreground',\n results: 'min-h-0 flex-1 overflow-y-auto overscroll-contain py-2',\n list: 'outline-none',\n group: 'px-2 pb-1.5',\n groupLabel: 'px-2.5 pt-2 pb-1 font-mono text-[9.5px] tracking-[0.14em] text-muted-foreground uppercase select-none',\n item: [\n 'group flex min-h-9 w-full cursor-pointer items-center gap-3 rounded-lg px-2.5 py-1.5 text-start text-foreground outline-none select-none',\n 'data-highlighted:bg-accent data-highlighted:text-accent-foreground',\n 'data-disabled:cursor-not-allowed data-disabled:opacity-50',\n ],\n itemIcon: 'shrink-0 text-muted-foreground group-data-highlighted:text-primary-text',\n itemText: 'flex min-w-0 flex-1 flex-col',\n itemLabel: 'truncate text-[13px]',\n itemDescription: 'truncate text-[11.5px] text-muted-foreground',\n itemArrow: 'shrink-0 text-muted-foreground opacity-0 group-data-highlighted:opacity-100',\n empty: 'px-4 py-10 text-center text-[13px] text-muted-foreground empty:hidden',\n footer: 'flex h-9 shrink-0 items-center gap-4 border-t border-border px-4 text-muted-foreground',\n hint: 'flex items-center gap-1.5 text-[11px]',\n count: 'ms-auto font-mono text-[10.5px]',\n },\n variants: {\n mono: { true: { itemLabel: 'font-mono text-[12.5px]' } },\n },\n});\n\nexport type CommandPaletteVariantProps = VariantProps<typeof commandPaletteVariants>;\n","import type { ComponentType } from 'react';\n\nexport type CommandIcon = ComponentType<{ size?: number; 'aria-hidden'?: boolean; className?: string }>;\n\nexport interface CommandItem {\n /** Unique within the palette. */\n id: string;\n label: string;\n icon?: CommandIcon;\n /** Secondary line under the label. Also searched (with lower weight). */\n description?: string;\n /** Shortcut hint shown as keys, e.g. ['⌘', 'D'] or ['G', 'P']. Display only. */\n shortcut?: string[];\n /** Extra search terms (synonyms, ids). */\n keywords?: string[];\n /** Render the label in the mono face (identifiers, slugs). */\n mono?: boolean;\n disabled?: boolean;\n /** Runs when the item is chosen (click or Enter). The palette then closes. */\n onSelect?: () => void;\n}\n\nexport interface CommandGroup {\n /** Group heading. */\n label: string;\n items: CommandItem[];\n}\n\n/** One row in the rendered list (recent items get their own key so ids can repeat across groups). */\nexport interface CommandEntry {\n key: string;\n item: CommandItem;\n}\n\nexport interface CommandEntryGroup {\n value: string;\n items: CommandEntry[];\n}\n\nconst BOUNDARY = /[\\s\\-_./:]/;\n\n/** Scores one search token against a text: prefix > word start > substring > subsequence. -1 = no match. */\nfunction scoreToken(text: string, token: string): number {\n const t = text.toLowerCase();\n const idx = t.indexOf(token);\n if (idx === 0) return 100;\n if (idx > 0) return BOUNDARY.test(t.charAt(idx - 1)) ? 80 : 60;\n let from = 0;\n let last = -1;\n let gaps = 0;\n for (const ch of token) {\n const found = t.indexOf(ch, from);\n if (found === -1) return -1;\n if (last >= 0) gaps += found - last - 1;\n last = found;\n from = found + 1;\n }\n return Math.max(1, 40 - gaps * 2);\n}\n\n/**\n * Fuzzy-ish relevance of an item for a query: every whitespace-separated token must match the\n * label, a keyword or the description (weighted lower). Returns -1 when it does not match.\n */\nexport function scoreCommand(item: CommandItem, query: string): number {\n const tokens = query.trim().toLowerCase().split(/\\s+/).filter(Boolean);\n if (!tokens.length) return 0;\n let total = 0;\n for (const token of tokens) {\n const best = Math.max(\n scoreToken(item.label, token),\n ...(item.keywords ?? []).map((k) => scoreToken(k, token) * 0.9),\n item.description ? scoreToken(item.description, token) * 0.5 : -1,\n );\n if (best < 0) return -1;\n total += best;\n }\n return total;\n}\n\n/**\n * Builds the visible groups: with an empty query, recent items first then every group as given;\n * otherwise only matching items, best first within each group, and empty groups dropped.\n */\nexport function filterCommandGroups(\n groups: CommandGroup[],\n query: string,\n recent: CommandItem[] = [],\n recentLabel = 'Recent',\n): CommandEntryGroup[] {\n const toEntries = (items: CommandItem[], prefix = '') => items.map((item) => ({ key: prefix + item.id, item }));\n if (!query.trim()) {\n const all = groups.map((g) => ({ value: g.label, items: toEntries(g.items) }));\n return [...(recent.length ? [{ value: recentLabel, items: toEntries(recent, 'recent:') }] : []), ...all].filter(\n (g) => g.items.length,\n );\n }\n return groups\n .map((g) => ({\n value: g.label,\n items: g.items\n .map((item) => ({ item, score: scoreCommand(item, query) }))\n .filter((r) => r.score >= 0)\n .sort((a, b) => b.score - a.score)\n .map(({ item }) => ({ key: item.id, item })),\n }))\n .filter((g) => g.items.length);\n}\n","import { useEffect, useRef } from 'react';\n\nexport interface CommandPaletteShortcutOptions {\n /** Letter pressed with ⌘ (macOS) or Ctrl. */\n key?: string;\n enabled?: boolean;\n}\n\n/** Calls `onTrigger` on ⌘K / Ctrl+K anywhere in the document (and prevents the browser default). */\nexport function useCommandPaletteShortcut(\n onTrigger: () => void,\n { key = 'k', enabled = true }: CommandPaletteShortcutOptions = {},\n) {\n const handler = useRef(onTrigger);\n useEffect(() => {\n handler.current = onTrigger;\n });\n useEffect(() => {\n if (!enabled) return;\n const onKeyDown = (event: KeyboardEvent) => {\n if (\n (event.metaKey || event.ctrlKey) &&\n !event.altKey &&\n !event.shiftKey &&\n event.key.toLowerCase() === key.toLowerCase()\n ) {\n event.preventDefault();\n handler.current();\n }\n };\n document.addEventListener('keydown', onKeyDown);\n return () => document.removeEventListener('keydown', onKeyDown);\n }, [key, enabled]);\n}\n","import { Autocomplete } from '@base-ui/react/autocomplete';\nimport { Dialog } from '@base-ui/react/dialog';\nimport { ArrowRight, Search } from 'lucide-react';\nimport { useId, useState, type ReactNode } from 'react';\nimport { usePortalDir, useI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { RTL_FLIP } from '../../utils/rtl';\nimport { Kbd, KbdCombo } from '../Kbd';\nimport { commandPaletteVariants } from './command-palette.variants';\nimport {\n filterCommandGroups,\n type CommandEntry,\n type CommandEntryGroup,\n type CommandGroup,\n type CommandItem,\n} from './command-filter';\nimport { useCommandPaletteShortcut } from './useCommandPaletteShortcut';\n\nconst s = commandPaletteVariants();\n\nexport interface CommandPaletteProps {\n /** Command groups (e.g. Actions, Go to). Items are plain data with an `onSelect`. */\n groups: CommandGroup[];\n /** Shown as the first group while the query is empty. */\n recent?: CommandItem[];\n recentLabel?: string;\n /** Called with every chosen item, after its own `onSelect`. */\n onSelect?: (item: CommandItem) => void;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Registers ⌘K / Ctrl+K to toggle the palette. */\n shortcut?: boolean;\n /** Accessible name of the dialog. */\n label?: string;\n placeholder?: string;\n /** Empty-state text for a query with no matches. */\n emptyText?: (query: string) => ReactNode;\n /** Replaces the footer hints; `false` hides the footer. */\n footer?: ReactNode | false;\n className?: string;\n /** Usually a CommandPaletteTrigger. */\n children?: ReactNode;\n}\n\nfunction CommandRow({ entry, onRun }: { entry: CommandEntry; onRun: (item: CommandItem) => void }) {\n const { item } = entry;\n const v = commandPaletteVariants({ mono: item.mono });\n const IconCmp = item.icon;\n return (\n <Autocomplete.Item value={entry} disabled={item.disabled} onClick={() => onRun(item)} className={v.item()}>\n {IconCmp && <IconCmp size={16} aria-hidden className={v.itemIcon()} />}\n <span className={v.itemText()}>\n <span className={v.itemLabel()}>{item.label}</span>\n {item.description && <span className={v.itemDescription()}>{item.description}</span>}\n </span>\n {item.shortcut?.length ? (\n <KbdCombo size=\"sm\" keys={item.shortcut} />\n ) : (\n <ArrowRight size={14} aria-hidden className={cn(v.itemArrow(), RTL_FLIP)} />\n )}\n </Autocomplete.Item>\n );\n}\n\nfunction DefaultFooter({ count, id }: { count: number; id: string }) {\n const { t } = useI18n();\n return (\n <div className={s.footer()}>\n <span id={id} className={s.hint()}>\n <Kbd size=\"sm\">↑↓</Kbd>\n {t('commandPalette.navigate')}\n <span className=\"sr-only\">,</span>\n </span>\n <span className={s.hint()}>\n <Kbd size=\"sm\">↵</Kbd>\n {t('commandPalette.run')}\n </span>\n <span className={s.hint()}>\n <Kbd size=\"sm\">esc</Kbd>\n {t('commandPalette.close')}\n </span>\n <span className={s.count()} aria-live=\"polite\">\n {t('common.results', { count })}\n </span>\n </div>\n );\n}\n\n/**\n * ⌘K command palette: a modal dialog with a search input over grouped commands (icon, label,\n * description, shortcut). Typing filters with fuzzy-ish ranking, ArrowUp/Down move the highlight,\n * Enter runs the item and closes, Escape closes. Built on Base UI Dialog + inline Autocomplete.\n */\nexport function CommandPalette({\n groups,\n recent,\n recentLabel: recentLabelProp,\n onSelect,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n shortcut = true,\n label: labelProp,\n placeholder: placeholderProp,\n emptyText = (q) => (\n <>\n No results for “<span className=\"text-foreground\">{q}</span>”\n </>\n ),\n footer,\n className,\n children,\n}: CommandPaletteProps) {\n const { t } = useI18n();\n const recentLabel = recentLabelProp ?? t('commandPalette.recent');\n const label = labelProp ?? t('commandPalette.label');\n const placeholder = placeholderProp ?? t('commandPalette.placeholder');\n const dir = usePortalDir();\n const [openState, setOpenState] = useState(defaultOpen);\n const [query, setQuery] = useState('');\n const hintsId = useId();\n const open = openProp ?? openState;\n\n const setOpen = (next: boolean) => {\n if (next) setQuery('');\n setOpenState(next);\n onOpenChange?.(next);\n };\n useCommandPaletteShortcut(() => setOpen(!open), { enabled: shortcut });\n\n const visible: CommandEntryGroup[] = filterCommandGroups(groups, query, recent, recentLabel);\n const count = visible.reduce((n, g) => n + g.items.length, 0);\n\n const run = (item: CommandItem) => {\n if (item.disabled) return;\n setOpen(false);\n item.onSelect?.();\n onSelect?.(item);\n };\n\n return (\n <Dialog.Root open={open} onOpenChange={(next) => setOpen(next)}>\n {children}\n <Dialog.Portal>\n <Dialog.Backdrop className={s.backdrop()} />\n <Dialog.Viewport dir={dir} className={s.viewport()}>\n <Dialog.Popup aria-label={label} className={cn(s.popup(), className)}>\n <Autocomplete.Root\n open\n inline\n items={visible}\n filter={null}\n value={query}\n onValueChange={(v, details) => {\n if (details.reason === 'item-press') return;\n setQuery(v);\n }}\n itemToStringValue={(entry: CommandEntry) => entry.item.label}\n autoHighlight=\"always\"\n keepHighlight\n >\n <div className={s.inputRow()}>\n <Search size={17} aria-hidden className={s.inputIcon()} />\n <Autocomplete.Input\n aria-label={placeholder.replace(/…$/, '')}\n aria-describedby={footer === false ? undefined : hintsId}\n placeholder={placeholder}\n className={s.input()}\n />\n <Kbd size=\"sm\" label=\"Escape\">\n esc\n </Kbd>\n </div>\n <div className={s.results()}>\n <Autocomplete.Empty className={s.empty()}>\n {count === 0 && query.trim() ? emptyText(query.trim()) : null}\n </Autocomplete.Empty>\n <Autocomplete.List className={s.list()}>\n {(group: CommandEntryGroup) => (\n <Autocomplete.Group key={group.value} items={group.items} className={s.group()}>\n <Autocomplete.GroupLabel className={s.groupLabel()}>{group.value}</Autocomplete.GroupLabel>\n <Autocomplete.Collection>\n {(entry: CommandEntry) => <CommandRow key={entry.key} entry={entry} onRun={run} />}\n </Autocomplete.Collection>\n </Autocomplete.Group>\n )}\n </Autocomplete.List>\n </div>\n {footer === false ? null : (footer ?? <DefaultFooter count={count} id={hintsId} />)}\n </Autocomplete.Root>\n </Dialog.Popup>\n </Dialog.Viewport>\n </Dialog.Portal>\n </Dialog.Root>\n );\n}\n\nexport interface CommandPaletteTriggerProps extends Omit<Dialog.Trigger.Props, 'className'> {\n className?: string;\n /** Keys shown on the right. */\n keys?: string[];\n children?: ReactNode;\n}\n\n/** Search-style button that opens the palette; place it inside <CommandPalette>. */\nexport function CommandPaletteTrigger({\n className,\n keys = ['⌘', 'K'],\n children: childrenProp,\n ...props\n}: CommandPaletteTriggerProps) {\n const { t } = useI18n();\n const children = childrenProp ?? t('commandPalette.trigger');\n return (\n <Dialog.Trigger className={cn(s.trigger(), className)} {...props}>\n <Search size={16} aria-hidden />\n <span className={s.triggerText()}>{children}</span>\n <KbdCombo size=\"sm\" keys={keys} />\n </Dialog.Trigger>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'CommandPalette',\n group: 'Overlays',\n status: 'beta',\n description:\n '⌘K / Ctrl+K command palette: a modal dialog with a search input over grouped commands (icon, label, description, shortcut keys). Commands are data with an onSelect. Fuzzy-ish ranking (prefix, word start, substring, subsequence; keywords and descriptions count), recent items while the query is empty, an empty state and footer hints. useCommandPaletteShortcut() exposes the shortcut on its own.',\n primitive: '@base-ui/react/dialog + @base-ui/react/autocomplete (inline)',\n pattern: 'modal dialog with a combobox and listbox',\n keyboard: [\n ['⌘K / Ctrl+K', 'Opens the palette (and closes it when open)'],\n ['Typing', 'Filters and ranks the commands'],\n ['ArrowDown / ArrowUp', 'Moves the highlight between commands across groups'],\n ['Enter', 'Runs the highlighted command and closes the palette'],\n ['Escape', 'Closes the palette and returns focus'],\n ],\n tokens: [\n 'popover',\n 'popover-foreground',\n 'background',\n 'border',\n 'accent',\n 'accent-foreground',\n 'primary-text',\n 'muted-foreground',\n 'card',\n 'ring',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nconst itemBase = [\n 'relative flex h-item w-full cursor-default items-center gap-2.5 rounded-[7px] px-2.5 text-start text-[13px] outline-none select-none',\n 'text-foreground transition-colors data-highlighted:bg-secondary/70',\n 'data-disabled:pointer-events-none data-disabled:opacity-50',\n];\n\nexport const menuVariants = tv({\n slots: {\n positioner: 'z-50 outline-none',\n popup: [\n 'min-w-[208px] origin-[var(--transform-origin)] rounded-[10px] border border-border bg-popover p-1.5 text-popover-foreground shadow-md outline-none',\n 'max-h-[var(--available-height)] overflow-y-auto',\n 'transition-[opacity,scale] duration-100 motion-reduce:transition-none',\n 'data-starting-style:scale-95 data-starting-style:opacity-0 data-ending-style:scale-95 data-ending-style:opacity-0',\n 'data-instant:transition-none',\n ],\n item: itemBase,\n itemIcon: 'shrink-0 text-muted-foreground',\n itemLabel: 'min-w-0 flex-1 truncate',\n shortcut: 'ms-auto ps-3 font-mono text-[10.5px] tracking-wide text-muted-foreground',\n checkbox: [\n 'grid size-[18px] shrink-0 place-items-center rounded-[5px] border border-border text-primary-foreground transition-colors',\n 'group-data-checked:border-primary group-data-checked:bg-primary',\n ],\n radioIndicator: 'ms-auto shrink-0 text-primary-text',\n subTrigger: [...itemBase, 'data-popup-open:bg-secondary/70'],\n subChevron: 'ms-auto shrink-0 text-muted-foreground rtl:-scale-x-100',\n groupLabel: 'px-2.5 pt-2 pb-1 font-mono text-[10px] tracking-[0.12em] text-muted-foreground uppercase',\n separator: '-mx-1.5 my-1.5 h-px bg-border',\n },\n variants: {\n destructive: {\n true: {\n item: 'text-destructive-text data-highlighted:bg-destructive/10 data-highlighted:text-destructive-chip-text',\n itemIcon: 'text-destructive-text',\n },\n },\n },\n});\n\nexport type MenuVariantProps = VariantProps<typeof menuVariants>;\n","import { tv, type VariantProps } from '../../utils/tv';\nimport { menuVariants } from '../Menu/menu.variants';\n\nconst menu = menuVariants();\n\n/** Context menus reuse the Menu popup and item styles; only the trigger area is new. */\nexport const contextMenuVariants = tv({\n slots: {\n trigger: [\n 'rounded-lg select-none [-webkit-touch-callout:none]',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n 'data-popup-open:bg-secondary/40',\n ],\n positioner: menu.positioner(),\n popup: menu.popup(),\n },\n});\n\nexport type ContextMenuVariantProps = VariantProps<typeof contextMenuVariants>;\n","import { ContextMenu as BaseContextMenu } from '@base-ui/react/context-menu';\nimport type { KeyboardEvent, ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { contextMenuVariants } from './context-menu.variants';\n\nconst s = contextMenuVariants();\n\n/**\n * Context menu state container (open, defaultOpen, onOpenChange, disabled). Renders no element.\n * Items, groups, separators and submenus are the Menu parts (MenuItem, MenuCheckboxItem,\n * MenuRadioGroup, MenuSeparator, MenuSub…), so a context menu and a dropdown look identical.\n */\nexport const ContextMenu = BaseContextMenu.Root;\n\nexport interface ContextMenuTriggerProps extends Omit<BaseContextMenu.Trigger.Props, 'className'> {\n className?: string;\n /**\n * Accessible hint appended to the area's description so keyboard users know the menu exists.\n * Pass `null` to omit it.\n */\n hint?: string | null;\n}\n\nfunction isMenuKey(event: KeyboardEvent<HTMLDivElement>) {\n return event.key === 'ContextMenu' || (event.key === 'F10' && event.shiftKey);\n}\n\n/**\n * The area that opens the menu: right click, long press (touch) or, when focused,\n * Shift+F10 / the ContextMenu key. Focusable by default (`tabIndex={0}`).\n */\nexport function ContextMenuTrigger({\n className,\n tabIndex = 0,\n hint = 'Press Shift+F10 for actions',\n onKeyDown,\n children,\n ...props\n}: ContextMenuTriggerProps) {\n function handleKeyDown(event: KeyboardEvent<HTMLDivElement>) {\n onKeyDown?.(event as Parameters<NonNullable<typeof onKeyDown>>[0]);\n if (event.defaultPrevented || !isMenuKey(event)) return;\n // Browsers fire `contextmenu` for these keys inconsistently; open at the area's top-start corner.\n event.preventDefault();\n const el = event.currentTarget;\n const rect = el.getBoundingClientRect();\n const rtl = getComputedStyle(el).direction === 'rtl';\n el.dispatchEvent(\n new MouseEvent('contextmenu', {\n bubbles: true,\n cancelable: true,\n clientX: rtl ? rect.right - 8 : rect.left + 8,\n clientY: rect.top + 8,\n }),\n );\n }\n return (\n <BaseContextMenu.Trigger\n className={cn(s.trigger(), className)}\n tabIndex={tabIndex}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {children}\n {hint && <span className=\"sr-only\"> ({hint})</span>}\n </BaseContextMenu.Trigger>\n );\n}\n\nexport interface ContextMenuContentProps extends Omit<BaseContextMenu.Popup.Props, 'className'> {\n className?: string;\n /** Portal container; defaults to document.body. */\n container?: BaseContextMenu.Portal.Props['container'];\n children?: ReactNode;\n}\n\n/** The floating list (role `menu`) placed at the pointer; same look as MenuContent. */\nexport function ContextMenuContent({ className, container, children, ...props }: ContextMenuContentProps) {\n return (\n <BaseContextMenu.Portal container={container}>\n <BaseContextMenu.Positioner className={s.positioner()}>\n <BaseContextMenu.Popup className={cn(s.popup(), className)} {...props}>\n {children}\n </BaseContextMenu.Popup>\n </BaseContextMenu.Positioner>\n </BaseContextMenu.Portal>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'ContextMenu',\n group: 'Overlays',\n status: 'beta',\n description:\n 'Menu that opens at the pointer on right click or long press, and from the keyboard with Shift+F10 or the ContextMenu key on the focused area. Uses the Menu item parts (icons, shortcuts, destructive tone, checkbox/radio items, groups, submenus).',\n primitive: '@base-ui/react/context-menu',\n pattern: 'menu',\n keyboard: [\n ['Shift+F10 / ContextMenu', 'On the focused area: opens the menu'],\n ['ArrowDown / ArrowUp', 'Moves between items (wraps)'],\n ['Enter', 'Activates the highlighted item and closes the menu'],\n ['ArrowRight', 'Opens the submenu of a submenu trigger; ArrowLeft closes it'],\n ['Escape', 'Closes the menu'],\n ],\n tokens: [\n 'popover',\n 'popover-foreground',\n 'border',\n 'secondary',\n 'muted-foreground',\n 'destructive',\n 'destructive-text',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\n/** The announcer region is screen-reader only; it never takes space or colour. */\nexport const liveAnnouncerVariants = tv({\n base: 'sr-only',\n});\n\nexport type LiveAnnouncerVariantProps = VariantProps<typeof liveAnnouncerVariants>;\n","import { createContext, useCallback, useContext, useState, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { liveAnnouncerVariants } from './live-announcer.variants';\n\nexport type AnnouncePoliteness = 'polite' | 'assertive';\n/** Sends a message to the nearest LiveAnnouncer region. */\nexport type Announce = (message: string, politeness?: AnnouncePoliteness) => void;\n\nconst AnnounceContext = createContext<Announce | null>(null);\nconst noop: Announce = () => {};\n\nexport interface LiveAnnouncerProps {\n children?: ReactNode;\n /** Classes for the (screen-reader only) region. */\n className?: string;\n}\n\n/**\n * Screen-reader announcements for interactions that have no visible text change (drag and drop,\n * reorder, background saves). Renders polite and assertive `aria-live` regions and gives its\n * subtree `useAnnounce()`. Repeating the same message re-announces it.\n */\nexport function LiveAnnouncer({ children, className }: LiveAnnouncerProps) {\n const [polite, setPolite] = useState('');\n const [assertive, setAssertive] = useState('');\n const announce = useCallback<Announce>((message, politeness = 'polite') => {\n // A trailing no-break space makes an identical message a DOM change, so it is read again.\n const next = (prev: string) => (prev === message ? `${message}\\u00A0` : message);\n if (politeness === 'assertive') setAssertive(next);\n else setPolite(next);\n }, []);\n const region = cn(liveAnnouncerVariants(), className);\n return (\n <AnnounceContext.Provider value={announce}>\n {children}\n <div role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" className={region} data-live-announcer=\"polite\">\n {polite}\n </div>\n <div aria-live=\"assertive\" aria-atomic=\"true\" className={region} data-live-announcer=\"assertive\">\n {assertive}\n </div>\n </AnnounceContext.Provider>\n );\n}\n\n/**\n * The `announce(message, politeness?)` function of the nearest LiveAnnouncer. Outside one it is\n * a no-op, so components can call it unconditionally.\n */\nexport function useAnnounce(): Announce {\n return useContext(AnnounceContext) ?? noop;\n}\n\n/** True when a LiveAnnouncer is already above this component (so it need not render its own). */\nexport function useHasLiveAnnouncer(): boolean {\n return useContext(AnnounceContext) !== null;\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'LiveAnnouncer',\n group: 'Feedback',\n status: 'beta',\n description:\n 'Screen-reader announcements for changes with no visible text: a polite (role=\"status\") and an assertive aria-live region, plus `useAnnounce()` for any component below it. Used by KanbanBoard for pick-up / move / drop / cancel. Outside a LiveAnnouncer, `useAnnounce()` is a no-op.',\n pattern: 'aria-live region (status)',\n tokens: [],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const tooltipVariants = tv({\n slots: {\n positioner: 'z-50',\n popup: [\n 'relative origin-[var(--transform-origin)] transition-[opacity,scale] duration-150 motion-reduce:transition-none',\n 'data-starting-style:scale-95 data-starting-style:opacity-0 data-ending-style:scale-95 data-ending-style:opacity-0',\n 'data-instant:transition-none',\n ],\n arrow: [\n 'size-2 rotate-45 rounded-[1px]',\n 'data-[side=top]:-bottom-1 data-[side=bottom]:-top-1 data-[side=left]:-end-1 data-[side=right]:-start-1',\n ],\n kbd: 'ms-1.5 rounded bg-background/20 px-1 py-px font-mono text-[10px] tracking-wide text-background',\n },\n variants: {\n variant: {\n /** Short label: inverted solid chip. */\n solid: {\n popup:\n 'flex items-center rounded-md bg-foreground px-2.5 py-1.5 text-[12px] font-medium whitespace-nowrap text-background shadow-md',\n arrow: 'bg-foreground',\n },\n /** Multi-line content on the popover surface. */\n rich: {\n popup:\n 'w-64 rounded-lg border border-border bg-popover p-3 text-start text-[12.5px] leading-5 text-popover-foreground shadow-lg',\n arrow: [\n 'border-border bg-popover',\n 'data-[side=top]:border-e data-[side=top]:border-b data-[side=bottom]:border-t data-[side=bottom]:border-s',\n 'data-[side=left]:border-t data-[side=left]:border-e data-[side=right]:border-b data-[side=right]:border-s',\n ],\n },\n },\n },\n defaultVariants: { variant: 'solid' },\n});\n\nexport type TooltipVariantProps = VariantProps<typeof tooltipVariants>;\n","import { Tooltip as BaseTooltip } from '@base-ui/react/tooltip';\nimport type { ReactElement, ReactNode } from 'react';\nimport { usePortalDir } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { tooltipVariants, type TooltipVariantProps } from './tooltip.variants';\n\nexport interface TooltipProviderProps extends BaseTooltip.Provider.Props {\n /** Hover delay before a tooltip opens, in ms. */\n delay?: number;\n}\n\n/**\n * Shares the open delay between tooltips: once one is open, neighbours open instantly.\n * Wrap the app (or a toolbar) once.\n */\nexport function TooltipProvider({ delay = 300, ...props }: TooltipProviderProps) {\n return <BaseTooltip.Provider delay={delay} {...props} />;\n}\n\n/** Tooltip state container (open, defaultOpen, onOpenChange, disabled). Renders no element. */\nexport const Tooltip = BaseTooltip.Root;\n/** The element the tooltip describes. Use `render={<IconButton … />}` to keep the kit element. */\nexport const TooltipTrigger = BaseTooltip.Trigger;\n\nexport interface TooltipContentProps extends Omit<BaseTooltip.Popup.Props, 'className'>, TooltipVariantProps {\n className?: string;\n side?: BaseTooltip.Positioner.Props['side'];\n align?: BaseTooltip.Positioner.Props['align'];\n /** Gap between trigger and tooltip, in px. */\n sideOffset?: BaseTooltip.Positioner.Props['sideOffset'];\n /** Draw the arrow pointing at the trigger. */\n arrow?: boolean;\n /** Keyboard shortcut shown after the label (solid variant). */\n kbd?: string;\n /** Portal container; defaults to document.body. */\n container?: BaseTooltip.Portal.Props['container'];\n children?: ReactNode;\n}\n\n/** The floating hint. Opens on hover (after the delay) and on keyboard focus; Escape hides it. */\nexport function TooltipContent({\n variant,\n side = 'top',\n align = 'center',\n sideOffset = 8,\n arrow = true,\n kbd,\n className,\n container,\n children,\n ...props\n}: TooltipContentProps) {\n const dir = usePortalDir();\n const v = tooltipVariants({ variant });\n return (\n <BaseTooltip.Portal container={container}>\n <BaseTooltip.Positioner dir={dir} className={v.positioner()} side={side} align={align} sideOffset={sideOffset}>\n <BaseTooltip.Popup role=\"tooltip\" className={cn(v.popup(), className)} {...props}>\n {arrow && <BaseTooltip.Arrow className={v.arrow()} />}\n {children}\n {kbd && <kbd className={v.kbd()}>{kbd}</kbd>}\n </BaseTooltip.Popup>\n </BaseTooltip.Positioner>\n </BaseTooltip.Portal>\n );\n}\n\nexport interface SimpleTooltipProps extends Pick<\n TooltipContentProps,\n 'side' | 'align' | 'kbd' | 'variant' | 'arrow' | 'className'\n> {\n /** Tooltip text or content. */\n content: ReactNode;\n /** The trigger element (a single focusable element, e.g. an IconButton). */\n children: ReactElement;\n /** Hover delay for this trigger, in ms (overrides the provider). */\n delay?: number;\n disabled?: boolean;\n}\n\n/** One-liner: `<SimpleTooltip content=\"Search\" kbd=\"⌘K\"><IconButton … /></SimpleTooltip>`. */\nexport function SimpleTooltip({ content, children, delay, disabled, ...contentProps }: SimpleTooltipProps) {\n return (\n <BaseTooltip.Root disabled={disabled}>\n <BaseTooltip.Trigger delay={delay} render={children} />\n <TooltipContent {...contentProps}>{content}</TooltipContent>\n </BaseTooltip.Root>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Tooltip',\n group: 'Overlays',\n status: 'stable',\n description:\n 'Short visual hint that appears on hover or keyboard focus. Solid inverted chip for labels (optional shortcut), rich variant on the popover surface for a few lines. Parts: TooltipProvider, Tooltip, TooltipTrigger, TooltipContent, plus the SimpleTooltip shorthand. Never the only source of essential information.',\n primitive: '@base-ui/react/tooltip',\n pattern: 'tooltip',\n keyboard: [\n ['Tab', 'Focusing the trigger shows the tooltip; moving focus away hides it'],\n ['Escape', 'Hides the tooltip while focus stays on the trigger'],\n ],\n tokens: ['foreground', 'background', 'popover', 'popover-foreground', 'border'],\n};\n","/**\n * Writes text to the clipboard. Uses the async Clipboard API when it exists and falls back to\n * a hidden textarea + `document.execCommand('copy')` when the API is missing or refuses\n * (insecure context, old browsers, some embedded webviews). Rejects when both fail.\n */\nexport async function copyToClipboard(text: string): Promise<void> {\n const api = typeof navigator !== 'undefined' ? navigator.clipboard : undefined;\n if (api?.writeText) {\n try {\n await api.writeText(text);\n return;\n } catch (error) {\n if (legacyCopy(text)) return;\n throw error;\n }\n }\n if (!legacyCopy(text)) throw new Error('Clipboard unavailable');\n}\n\n/** The pre-Clipboard-API path. Restores focus and selection afterwards. */\nfunction legacyCopy(text: string): boolean {\n if (typeof document === 'undefined' || typeof document.execCommand !== 'function') return false;\n const active = document.activeElement as HTMLElement | null;\n const area = document.createElement('textarea');\n area.value = text;\n area.setAttribute('readonly', '');\n area.setAttribute('aria-hidden', 'true');\n area.tabIndex = -1;\n area.style.position = 'fixed';\n area.style.insetBlockStart = '0';\n area.style.opacity = '0';\n area.style.pointerEvents = 'none';\n document.body.appendChild(area);\n area.select();\n let ok: boolean;\n try {\n ok = document.execCommand('copy');\n } catch {\n ok = false;\n }\n area.remove();\n active?.focus?.();\n return ok;\n}\n","import { tv, type VariantProps } from '../../utils/tv';\n\n/** Status styling layered over the kit Button; the sr-only region carries the announcement. */\nexport const copyButtonVariants = tv({\n slots: {\n button: 'transition-colors motion-reduce:transition-none',\n status: 'sr-only',\n },\n variants: {\n state: {\n idle: {},\n copied: { button: 'text-primary-text hover:text-primary-text' },\n failed: { button: 'text-destructive-text hover:text-destructive-text' },\n },\n },\n defaultVariants: { state: 'idle' },\n});\n\nexport type CopyButtonVariantProps = VariantProps<typeof copyButtonVariants>;\n","import { Check, Copy, X } from 'lucide-react';\nimport { useEffect, useState, type Ref } from 'react';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { Button, IconButton, type ButtonProps } from '../Button';\nimport { useAnnounce, useHasLiveAnnouncer } from '../LiveAnnouncer';\nimport { SimpleTooltip } from '../Tooltip';\nimport { copyToClipboard } from './clipboard';\nimport { copyButtonVariants } from './copy-button.variants';\n\nexport type CopyStatus = 'idle' | 'copied' | 'failed';\n\nexport interface CopyButtonProps extends Omit<\n ButtonProps,\n 'value' | 'children' | 'icon' | 'trailingIcon' | 'onClick' | 'onCopy' | 'iconOnly'\n> {\n ref?: Ref<HTMLButtonElement>;\n /** Text to copy, or a getter (sync or async) called on click — e.g. to read a secret lazily. */\n value: string | (() => string | Promise<string>);\n /** `icon` (default): square icon button with a tooltip. `label`: icon + visible text. */\n display?: 'icon' | 'label';\n /** Name / visible text before copying. Defaults to \"Copy\". */\n label?: string;\n /** Name / visible text after a successful copy. Defaults to \"Copied\". */\n copiedLabel?: string;\n /** Polite announcement after a successful copy. Defaults to \"Copied to clipboard\". */\n announcement?: string;\n /** Name / visible text when copying fails. Defaults to \"Copy failed\". */\n failureLabel?: string;\n /** Failure announcement. Defaults to the failure label. */\n failureAnnouncement?: string;\n /** LiveAnnouncer failure priority. Defaults to assertive. */\n failurePoliteness?: 'polite' | 'assertive';\n /** Show a tooltip on the icon form (default true). */\n tooltip?: boolean;\n /** How long the success / failure state lasts, in ms (default 2000). */\n resetAfter?: number;\n onCopy?: (text: string) => void;\n onCopyError?: (error: unknown) => void;\n}\n\n/**\n * Copies a string (or the result of a getter) to the clipboard. Shows a check while \"Copied\",\n * announces the result politely (through a LiveAnnouncer above it, or its own status region),\n * and falls back to `execCommand('copy')` when the Clipboard API is unavailable.\n */\nexport function CopyButton({\n value,\n display = 'icon',\n label: labelProp,\n copiedLabel: copiedProp,\n announcement: announcementProp,\n failureLabel,\n failureAnnouncement,\n failurePoliteness = 'assertive',\n tooltip = true,\n resetAfter = 2000,\n onCopy,\n onCopyError,\n variant = 'ghost',\n size = 'auto',\n className,\n disabled,\n ...props\n}: CopyButtonProps) {\n const { t } = useI18n();\n const announce = useAnnounce();\n const hasAnnouncer = useHasLiveAnnouncer();\n const [status, setStatus] = useState<CopyStatus>('idle');\n const [attempt, setAttempt] = useState(0);\n const label = labelProp ?? t('common.copy');\n const copiedLabel = copiedProp ?? t('common.copied');\n const successText = announcementProp ?? t('common.copiedToClipboard');\n const failedText = failureLabel ?? t('common.copyFailed');\n const failureText = failureAnnouncement ?? failedText;\n\n useEffect(() => {\n if (status === 'idle') return;\n const id = window.setTimeout(() => setStatus('idle'), resetAfter);\n return () => window.clearTimeout(id);\n }, [status, attempt, resetAfter]);\n\n const copy = async () => {\n try {\n const text = typeof value === 'function' ? await value() : value;\n await copyToClipboard(text);\n setStatus('copied');\n if (hasAnnouncer) announce(successText);\n onCopy?.(text);\n } catch (error) {\n setStatus('failed');\n if (hasAnnouncer) announce(failureText, failurePoliteness);\n onCopyError?.(error);\n }\n setAttempt((n) => n + 1);\n };\n\n const s = copyButtonVariants({ state: status });\n const current = status === 'copied' ? copiedLabel : status === 'failed' ? failedText : label;\n const StateIcon = status === 'copied' ? Check : status === 'failed' ? X : Copy;\n const region = !hasAnnouncer && (\n <span role=\"status\" className={s.status()}>\n {status === 'copied' ? successText : status === 'failed' ? failureText : ''}\n </span>\n );\n\n if (display === 'label') {\n return (\n <>\n <Button\n {...props}\n variant={variant}\n size={size}\n disabled={disabled}\n icon={StateIcon}\n className={cn(s.button(), className)}\n onClick={copy}\n data-status={status}\n >\n {current}\n </Button>\n {region}\n </>\n );\n }\n\n const button = (\n <IconButton\n {...props}\n variant={variant}\n size={size}\n disabled={disabled}\n icon={StateIcon}\n label={current}\n className={cn(s.button(), className)}\n onClick={copy}\n data-status={status}\n />\n );\n return (\n <>\n {tooltip && !disabled ? <SimpleTooltip content={current}>{button}</SimpleTooltip> : button}\n {region}\n </>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'CopyButton',\n group: 'Actions',\n status: 'beta',\n description:\n 'Copies a string, or the result of a (possibly async) getter, to the clipboard. Icon form (with tooltip) or labelled form, a \"Copied\" success state that resets after 2 s, a polite announcement (through LiveAnnouncer when present) and a fallback to execCommand when the Clipboard API is missing. Optional failureLabel and failureAnnouncement override failure feedback; failurePoliteness changes the LiveAnnouncer failure priority (assertive by default). `copyToClipboard` is exported too.',\n primitive: '@base-ui/react/button',\n pattern: 'button + status',\n keyboard: [\n ['Enter', 'Copies the value and announces \"Copied to clipboard\"'],\n ['Space', 'Copies the value and announces \"Copied to clipboard\"'],\n ['Tab', 'Moves focus to and from the button'],\n ],\n tokens: ['muted-foreground', 'secondary', 'primary-text', 'destructive-text', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\n/** Arrow placement per side: a rotated square showing the two border edges that face out. */\nexport const POPOVER_ARROW_SIDES = [\n 'data-[side=bottom]:-top-[5px] data-[side=bottom]:border-t data-[side=bottom]:border-s',\n 'data-[side=top]:-bottom-[5px] data-[side=top]:border-e data-[side=top]:border-b',\n 'data-[side=left]:-end-[5px] data-[side=left]:border-t data-[side=left]:border-e',\n 'data-[side=right]:-start-[5px] data-[side=right]:border-b data-[side=right]:border-s',\n];\n\nexport const popoverVariants = tv({\n slots: {\n positioner: 'z-50 outline-none',\n popup: [\n 'relative origin-[var(--transform-origin)] rounded-[10px] border border-border bg-popover text-popover-foreground shadow-md outline-none',\n 'max-w-[calc(100vw-2rem)] transition-[opacity,scale] duration-150 motion-reduce:transition-none',\n 'data-starting-style:scale-95 data-starting-style:opacity-0 data-ending-style:scale-95 data-ending-style:opacity-0',\n ],\n arrow: ['size-2.5 rotate-45 rounded-[2px] border-border bg-popover', ...POPOVER_ARROW_SIDES],\n title: 'text-[13px] font-semibold tracking-tight text-foreground',\n description: 'mt-1 text-[12.5px] leading-5 text-muted-foreground text-pretty',\n close: [\n 'absolute top-2 end-2 grid size-7 place-items-center rounded-md text-muted-foreground transition-colors',\n 'hover:bg-secondary/60 hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n },\n variants: {\n padding: {\n none: { popup: 'p-0' },\n sm: { popup: 'p-1.5' },\n md: { popup: 'p-3.5' },\n },\n },\n defaultVariants: { padding: 'md' },\n});\n\nexport type PopoverVariantProps = VariantProps<typeof popoverVariants>;\n","import { Popover as BasePopover } from '@base-ui/react/popover';\nimport { X } from 'lucide-react';\nimport type { ReactNode } from 'react';\nimport { usePortalDir, useI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { popoverVariants, type PopoverVariantProps } from './popover.variants';\n\nconst s = popoverVariants();\n\n/** Popover state container (open, defaultOpen, onOpenChange, modal). Renders no element. */\nexport const Popover = BasePopover.Root;\n/** Toggles the popover. Use `render={<Button />}` to style it as a kit button. */\nexport const PopoverTrigger = BasePopover.Trigger;\n\nexport interface PopoverContentProps extends Omit<BasePopover.Popup.Props, 'className'>, PopoverVariantProps {\n className?: string;\n /** Side of the trigger to place the panel on. */\n side?: BasePopover.Positioner.Props['side'];\n /** Alignment along that side. */\n align?: BasePopover.Positioner.Props['align'];\n /** Gap between trigger and panel, in px. */\n sideOffset?: BasePopover.Positioner.Props['sideOffset'];\n alignOffset?: BasePopover.Positioner.Props['alignOffset'];\n /** Draw a small arrow pointing at the trigger. */\n arrow?: boolean;\n /** Portal container; defaults to document.body. */\n container?: BasePopover.Portal.Props['container'];\n children?: ReactNode;\n}\n\n/**\n * The floating panel: portal, positioner and popup (role `dialog`). Escape or an outside press\n * close it and focus returns to the trigger.\n */\nexport function PopoverContent({\n side = 'bottom',\n align = 'center',\n sideOffset = 8,\n alignOffset,\n arrow = false,\n padding,\n className,\n container,\n children,\n ...props\n}: PopoverContentProps) {\n const dir = usePortalDir();\n const v = popoverVariants({ padding });\n return (\n <BasePopover.Portal container={container}>\n <BasePopover.Positioner\n dir={dir}\n className={v.positioner()}\n side={side}\n align={align}\n sideOffset={sideOffset}\n alignOffset={alignOffset}\n >\n <BasePopover.Popup className={cn(v.popup(), className)} {...props}>\n {arrow && <BasePopover.Arrow className={v.arrow()} />}\n {children}\n </BasePopover.Popup>\n </BasePopover.Positioner>\n </BasePopover.Portal>\n );\n}\n\nexport function PopoverTitle({\n className,\n ...props\n}: Omit<BasePopover.Title.Props, 'className'> & { className?: string }) {\n return <BasePopover.Title className={cn(s.title(), className)} {...props} />;\n}\n\nexport function PopoverDescription({\n className,\n ...props\n}: Omit<BasePopover.Description.Props, 'className'> & { className?: string }) {\n return <BasePopover.Description className={cn(s.description(), className)} {...props} />;\n}\n\nexport interface PopoverCloseProps extends Omit<BasePopover.Close.Props, 'className'> {\n className?: string;\n /** Accessible name when rendered as the default icon button. */\n label?: string;\n}\n\n/**\n * Closes the popover. Without children it renders the top-right X icon button; with children\n * (or `render={<Button />}`) it is a plain close action.\n */\nexport function PopoverClose({ className, label: labelProp, children, ...props }: PopoverCloseProps) {\n const { t } = useI18n();\n const label = labelProp ?? t('common.close');\n if (children !== undefined || props.render) {\n return (\n <BasePopover.Close className={className} {...props}>\n {children}\n </BasePopover.Close>\n );\n }\n return (\n <BasePopover.Close aria-label={label} className={cn(s.close(), className)} {...props}>\n <X size={14} aria-hidden />\n </BasePopover.Close>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Popover',\n group: 'Overlays',\n status: 'stable',\n description:\n 'Non-modal floating panel anchored to a trigger, for short forms, details and filters. Optional arrow, four sides, three paddings. Parts: Popover, PopoverTrigger, PopoverContent, PopoverTitle, PopoverDescription, PopoverClose.',\n primitive: '@base-ui/react/popover',\n pattern: 'dialog (non-modal disclosure)',\n keyboard: [\n ['Enter / Space', 'On the trigger: toggles the popover and moves focus inside'],\n ['Tab', 'Moves through the popover content'],\n ['Escape', 'Closes the popover and returns focus to the trigger'],\n ],\n tokens: ['popover', 'popover-foreground', 'border', 'muted-foreground', 'secondary', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\n/**\n * The brand field (recessed wrapper that owns border and focus outline) holding spinbutton\n * segments. The focused segment gets a primary tint; empty segments show a muted placeholder.\n */\nexport const timePickerVariants = tv({\n slots: {\n root: [\n 'flex w-full min-w-0 items-center rounded-md border border-border bg-background text-foreground shadow-sm transition-colors motion-reduce:transition-none',\n 'focus-within:border-primary/60 has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-focus-ring',\n 'data-invalid:border-destructive/70',\n 'data-disabled:cursor-not-allowed data-disabled:bg-secondary/50 data-disabled:text-muted-foreground',\n ],\n icon: 'pointer-events-none shrink-0 text-muted-foreground',\n segments: 'flex min-w-0 items-center tabular-nums',\n segment: [\n 'rounded-[4px] px-0.5 text-center outline-none select-none caret-transparent',\n 'focus:bg-primary/14 focus:text-primary-chip-text',\n 'data-placeholder:text-muted-foreground aria-disabled:cursor-not-allowed',\n ],\n separator: 'px-px text-muted-foreground select-none',\n },\n variants: {\n size: {\n /** Follows `data-density` (comfortable = md). */\n auto: { root: 'h-control gap-tight px-field text-[13px]' },\n sm: { root: 'h-8 gap-2 px-2.5 text-[12px]' },\n md: { root: 'h-9 gap-2.5 px-3 text-[13px]' },\n },\n },\n defaultVariants: { size: 'auto' },\n});\n\nexport type TimePickerVariantProps = VariantProps<typeof timePickerVariants>;\n","/** A time of day, 24-hour clock. */\nexport interface TimeOfDay {\n hours: number;\n minutes: number;\n seconds: number;\n}\n\nconst pad = (n: number) => String(n).padStart(2, '0');\n\n/** `\"09:30\"` / `\"09:30:15\"` → parts, or `null` when the string is not a valid 24-hour time. */\nexport function parseTimeOfDay(value: string | null | undefined): TimeOfDay | null {\n if (!value) return null;\n const m = /^(\\d{1,2}):(\\d{2})(?::(\\d{2}))?$/.exec(value.trim());\n if (!m) return null;\n const hours = Number(m[1]);\n const minutes = Number(m[2]);\n const seconds = m[3] === undefined ? 0 : Number(m[3]);\n if (hours > 23 || minutes > 59 || seconds > 59) return null;\n return { hours, minutes, seconds };\n}\n\n/** Parts → `\"HH:mm\"`, or `\"HH:mm:ss\"` with `withSeconds`. */\nexport function formatTimeOfDay(parts: TimeOfDay, withSeconds = false): string {\n const base = `${pad(parts.hours)}:${pad(parts.minutes)}`;\n return withSeconds ? `${base}:${pad(parts.seconds)}` : base;\n}\n\n/** Seconds since midnight (for comparisons). */\nexport const timeToSeconds = (t: TimeOfDay) => t.hours * 3600 + t.minutes * 60 + t.seconds;\n\n/** Copies the time of day onto a date (local time). */\nexport function withTimeOfDay(date: Date, t: TimeOfDay): Date {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate(), t.hours, t.minutes, t.seconds);\n}\n\n/** The time of day of a date (local time). */\nexport const timeOfDay = (date: Date): TimeOfDay => ({\n hours: date.getHours(),\n minutes: date.getMinutes(),\n seconds: date.getSeconds(),\n});\n\n/** 12 or 24: the clock a locale uses by default (Intl). */\nexport function localeHourCycle(locale?: string): 12 | 24 {\n try {\n const cycle = new Intl.DateTimeFormat(locale, { hour: 'numeric' }).resolvedOptions().hourCycle;\n return cycle === 'h11' || cycle === 'h12' ? 12 : 24;\n } catch {\n return 24;\n }\n}\n\n/** The locale's AM / PM labels (Intl `dayPeriod`), falling back to \"AM\" / \"PM\". */\nexport function dayPeriodLabels(locale?: string): [am: string, pm: string] {\n const label = (hour: number, fallback: string) => {\n try {\n const parts = new Intl.DateTimeFormat(locale, { hour: 'numeric', hourCycle: 'h12' }).formatToParts(\n new Date(2000, 0, 1, hour),\n );\n return parts.find((p) => p.type === 'dayPeriod')?.value ?? fallback;\n } catch {\n return fallback;\n }\n };\n return [label(9, 'AM'), label(21, 'PM')];\n}\n","import { Field } from '@base-ui/react/field';\nimport { Clock } from 'lucide-react';\nimport { useRef, useState, type ComponentProps, type KeyboardEvent, type MouseEvent } from 'react';\nimport { useI18n, useOptionalI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { timePickerVariants, type TimePickerVariantProps } from './time-picker.variants';\nimport { dayPeriodLabels, formatTimeOfDay, localeHourCycle, parseTimeOfDay, timeToSeconds } from './time-utils';\n\nexport interface TimePickerProps extends TimePickerVariantProps {\n /** `\"HH:mm\"` (or `\"HH:mm:ss\"` with `withSeconds`), 24-hour clock; `null` while incomplete. */\n value?: string | null;\n defaultValue?: string | null;\n /** Fires with a complete time, or `null` when a segment is cleared. */\n onValueChange?: (value: string | null) => void;\n /** Adds a seconds segment. */\n withSeconds?: boolean;\n /** 12-hour (with an AM/PM segment) or 24-hour clock. Defaults to the locale's. */\n hourCycle?: 12 | 24;\n /** BCP 47 locale for the hour cycle and AM/PM labels. Defaults to the I18nProvider's. */\n locale?: string;\n /** Minute increment for the arrow keys (e.g. 15). Typed minutes are not snapped. */\n step?: number;\n /** Earliest valid time (`\"HH:mm\"`); earlier values are marked invalid. */\n min?: string;\n /** Latest valid time (`\"HH:mm\"`). */\n max?: string;\n /** Submitted as `HH:mm[:ss]` through a hidden input. */\n name?: string;\n id?: string;\n disabled?: boolean;\n readOnly?: boolean;\n invalid?: boolean;\n /** Show the leading clock icon. */\n icon?: boolean;\n className?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n}\n\ntype SegmentKey = 'hour' | 'minute' | 'second' | 'period';\n\ninterface Draft {\n /** 0–23. */\n hour: number | null;\n minute: number | null;\n second: number | null;\n /** AM/PM picked before the hour (12-hour clock). */\n pm: boolean | null;\n}\n\nconst EMPTY: Draft = { hour: null, minute: null, second: null, pm: null };\n\nfunction toDraft(value: string | null | undefined): Draft {\n const t = parseTimeOfDay(value);\n return t ? { hour: t.hours, minute: t.minutes, second: t.seconds, pm: t.hours >= 12 } : EMPTY;\n}\n\nfunction draftToValue(d: Draft, withSeconds: boolean): string | null {\n if (d.hour === null || d.minute === null || (withSeconds && d.second === null)) return null;\n return formatTimeOfDay({ hours: d.hour, minutes: d.minute, seconds: d.second ?? 0 }, withSeconds);\n}\n\nconst pad = (n: number) => String(n).padStart(2, '0');\n\n/**\n * Time field: hour, minute (optional second, AM/PM on a 12-hour clock) spinbutton segments.\n * Arrows spin the focused segment (minutes by `step`), digits type into it and auto-advance,\n * Backspace clears it, ArrowLeft/ArrowRight move between segments. Works inside Field.\n */\nexport function TimePicker({\n value,\n defaultValue,\n onValueChange,\n withSeconds = false,\n hourCycle: hourCycleProp,\n locale: localeProp,\n step = 1,\n min,\n max,\n name,\n id,\n disabled,\n readOnly,\n invalid,\n icon = true,\n size = 'auto',\n className,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n}: TimePickerProps) {\n const { t } = useI18n();\n const providerLocale = useOptionalI18n()?.locale;\n const locale = localeProp ?? providerLocale;\n const hourCycle = hourCycleProp ?? localeHourCycle(locale);\n const [amLabel, pmLabel] = dayPeriodLabels(locale);\n const controlled = value !== undefined;\n const [draft, setDraft] = useState<Draft>(() => toDraft(controlled ? value : defaultValue));\n const [synced, setSynced] = useState(value);\n // A new controlled value (not the echo of our own change) replaces the draft.\n if (controlled && value !== synced) {\n setSynced(value);\n setDraft(toDraft(value));\n }\n const buffer = useRef<{ key: SegmentKey; text: string } | null>(null);\n const segmentRefs = useRef<Array<HTMLDivElement | null>>([]);\n const s = timePickerVariants({ size });\n const minuteStep = Math.max(1, Math.floor(step));\n\n const keys: SegmentKey[] = [\n 'hour',\n 'minute',\n ...(withSeconds ? (['second'] as const) : []),\n ...(hourCycle === 12 ? (['period'] as const) : []),\n ];\n const current = draftToValue(draft, withSeconds);\n const parsed = parseTimeOfDay(current);\n const minT = parseTimeOfDay(min);\n const maxT = parseTimeOfDay(max);\n const outOfRange =\n !!parsed &&\n ((!!minT && timeToSeconds(parsed) < timeToSeconds(minT)) ||\n (!!maxT && timeToSeconds(parsed) > timeToSeconds(maxT)));\n\n const periodFlag = draft.hour !== null ? draft.hour >= 12 : draft.pm;\n const display = (key: SegmentKey): number | null => {\n if (key === 'hour') return draft.hour === null ? null : hourCycle === 12 ? draft.hour % 12 || 12 : draft.hour;\n if (key === 'minute') return draft.minute;\n if (key === 'second') return draft.second;\n return periodFlag === null ? null : periodFlag ? 1 : 0;\n };\n const range = (key: SegmentKey): [number, number] =>\n key === 'hour' ? (hourCycle === 12 ? [1, 12] : [0, 23]) : key === 'period' ? [0, 1] : [0, 59];\n\n const withSegment = (d: Draft, key: SegmentKey, n: number | null): Draft => {\n if (key === 'minute') return { ...d, minute: n };\n if (key === 'second') return { ...d, second: n };\n if (key === 'period') {\n const pm = n === null ? null : n === 1;\n return { ...d, pm, hour: d.hour === null || pm === null ? d.hour : (d.hour % 12) + (pm ? 12 : 0) };\n }\n if (n === null) return { ...d, hour: null, pm: periodFlag };\n if (hourCycle === 24) return { ...d, hour: n };\n return { ...d, hour: (n % 12) + (periodFlag ? 12 : 0) };\n };\n\n const commit = (next: Draft) => {\n setDraft(next);\n const v = draftToValue(next, withSeconds);\n if (v !== current) {\n if (controlled) setSynced(v);\n onValueChange?.(v);\n }\n };\n\n const focusSegment = (i: number) => {\n buffer.current = null;\n segmentRefs.current[Math.max(0, Math.min(keys.length - 1, i))]?.focus();\n };\n\n const spin = (key: SegmentKey, delta: number) => {\n const [lo, hi] = range(key);\n const cur = display(key);\n const stepSize = key === 'minute' ? minuteStep : 1;\n const top = Math.floor(hi / stepSize) * stepSize;\n let next: number;\n if (cur === null) next = delta > 0 ? lo : top;\n else if (stepSize > 1)\n next = delta > 0 ? (Math.floor(cur / stepSize) + 1) * stepSize : (Math.ceil(cur / stepSize) - 1) * stepSize;\n else next = cur + delta;\n if (next > hi) next = lo;\n if (next < lo) next = top;\n commit(withSegment(draft, key, next));\n };\n\n const typeDigit = (key: SegmentKey, index: number, digit: string) => {\n const [lo, hi] = range(key);\n let text = (buffer.current?.key === key ? buffer.current.text : '') + digit;\n let n = Number(text);\n if (n > hi) {\n text = digit;\n n = Number(digit);\n }\n if (n >= lo) commit(withSegment(draft, key, n));\n else if (text.length >= 2) commit(withSegment(draft, key, hi)); // \"00\" on a 12-hour clock → 12\n if (text.length >= 2 || n * 10 > hi) focusSegment(index + 1);\n else buffer.current = { key, text };\n };\n\n const onKeyDown = (key: SegmentKey, index: number) => (e: KeyboardEvent<HTMLDivElement>) => {\n if (disabled) return;\n const editable = !readOnly;\n let handled = true;\n if (e.key === 'ArrowLeft') focusSegment(index - 1);\n else if (e.key === 'ArrowRight') focusSegment(index + 1);\n else if (!editable) handled = false;\n else if (e.key === 'ArrowUp') spin(key, 1);\n else if (e.key === 'ArrowDown') spin(key, -1);\n else if (e.key === 'Home') commit(withSegment(draft, key, range(key)[0]));\n else if (e.key === 'End')\n commit(withSegment(draft, key, key === 'minute' ? Math.floor(59 / minuteStep) * minuteStep : range(key)[1]));\n else if (e.key === 'Backspace' || e.key === 'Delete') {\n buffer.current = null;\n commit(withSegment(draft, key, null));\n } else if (key !== 'period' && /^\\d$/.test(e.key)) typeDigit(key, index, e.key);\n else if (key === 'period' && e.key.length === 1) {\n const c = e.key.toLowerCase();\n if (c === 'a' || amLabel.toLowerCase().startsWith(c)) commit(withSegment(draft, key, 0));\n else if (c === 'p' || pmLabel.toLowerCase().startsWith(c)) commit(withSegment(draft, key, 1));\n else handled = false;\n } else if ((e.key === ':' || e.key === '.') && index < keys.length - 1) focusSegment(index + 1);\n else handled = false;\n if (handled) e.preventDefault();\n };\n\n const onRootMouseDown = (e: MouseEvent<HTMLDivElement>) => {\n if (disabled || (e.target as HTMLElement).getAttribute('role') === 'spinbutton') return;\n e.preventDefault();\n const empty = keys.findIndex((k) => display(k) === null);\n focusSegment(empty < 0 ? 0 : empty);\n };\n\n const label = (key: SegmentKey) =>\n t(\n key === 'hour'\n ? 'timePicker.hours'\n : key === 'minute'\n ? 'timePicker.minutes'\n : key === 'second'\n ? 'timePicker.seconds'\n : 'timePicker.period',\n );\n\n return (\n <>\n <Field.Control\n id={id}\n disabled={disabled}\n render={(controlProps) => {\n const p = controlProps as ComponentProps<'div'> & { disabled?: boolean };\n const isDisabled = disabled || p.disabled;\n return (\n <div\n role=\"group\"\n id={p.id}\n aria-label={ariaLabel ?? (ariaLabelledBy || p['aria-labelledby'] ? undefined : t('timePicker.label'))}\n aria-labelledby={ariaLabel ? undefined : (ariaLabelledBy ?? p['aria-labelledby'])}\n aria-describedby={ariaDescribedBy ?? p['aria-describedby']}\n data-invalid={invalid || outOfRange || undefined}\n data-disabled={isDisabled || undefined}\n onMouseDown={onRootMouseDown}\n onFocus={p.onFocus}\n onBlur={(e) => {\n buffer.current = null;\n p.onBlur?.(e);\n }}\n className={cn(s.root(), className)}\n >\n {icon && <Clock size={size === 'sm' ? 14 : 15} aria-hidden className={s.icon()} />}\n <div dir=\"ltr\" className={s.segments()}>\n {keys.map((key, i) => {\n const n = display(key);\n const [lo, hi] = range(key);\n const text = n === null ? '––' : key === 'period' ? (n ? pmLabel : amLabel) : pad(n);\n return (\n <span key={key} className=\"contents\">\n {i > 0 && key !== 'period' && (\n <span aria-hidden className={s.separator()}>\n :\n </span>\n )}\n {key === 'period' && <span aria-hidden className=\"w-1\" />}\n <div\n ref={(el) => {\n segmentRefs.current[i] = el;\n }}\n role=\"spinbutton\"\n tabIndex={isDisabled ? -1 : 0}\n aria-label={label(key)}\n aria-valuemin={lo}\n aria-valuemax={hi}\n aria-valuenow={n ?? undefined}\n aria-valuetext={n === null ? t('timePicker.empty') : text}\n aria-disabled={isDisabled || undefined}\n aria-readonly={readOnly || undefined}\n aria-invalid={invalid || outOfRange || undefined}\n data-placeholder={n === null || undefined}\n data-segment={key}\n onKeyDown={onKeyDown(key, i)}\n onFocus={() => {\n buffer.current = null;\n }}\n className={cn(s.segment(), key === 'period' ? 'min-w-[2.5ch]' : 'min-w-[2.2ch]')}\n >\n {text}\n </div>\n </span>\n );\n })}\n </div>\n </div>\n );\n }}\n />\n {name && <input type=\"hidden\" name={name} value={current ?? ''} />}\n </>\n );\n}\n","import { tv, type VariantProps } from '../../utils/tv';\n\n/**\n * The trigger is a read-only input styled as the brand field (calendar icon and chevron are\n * overlays inside its padding), so the whole field is the popover anchor.\n */\nexport const datePickerVariants = tv({\n slots: {\n root: 'relative flex w-full min-w-0 items-center',\n input: [\n 'w-full min-w-0 cursor-pointer truncate rounded-md border border-border bg-background text-start text-foreground caret-transparent shadow-sm outline-none',\n 'transition-colors motion-reduce:transition-none placeholder:text-muted-foreground hover:border-muted-foreground/40',\n 'focus-visible:border-primary/60 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n 'data-popup-open:border-primary/60 data-invalid:border-destructive/70 aria-invalid:border-destructive/70',\n 'disabled:cursor-not-allowed disabled:bg-secondary/50 disabled:text-muted-foreground disabled:hover:border-border',\n ],\n icon: 'pointer-events-none absolute shrink-0 text-muted-foreground',\n chevron: 'pointer-events-none absolute shrink-0 text-muted-foreground',\n panel: 'flex flex-col sm:flex-row',\n /** `withTime`: label, TimePicker and Done under the calendar. */\n timeRow: 'flex items-center gap-2 border-t border-border p-3',\n timeLabel: 'shrink-0 text-[12px] font-medium text-muted-foreground',\n presets:\n 'flex shrink-0 flex-row flex-wrap gap-1 border-b border-border p-2 sm:w-36 sm:flex-col sm:flex-nowrap sm:border-e sm:border-b-0',\n preset: [\n 'rounded-[6px] px-2.5 py-1.5 text-start text-[12.5px] text-foreground transition-colors motion-reduce:transition-none',\n 'hover:bg-secondary/70 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus-ring',\n 'aria-pressed:bg-primary/12 aria-pressed:font-medium aria-pressed:text-primary-chip-text',\n ],\n },\n variants: {\n size: {\n /** Follows `data-density` (comfortable = md). */\n auto: { input: 'h-control pe-9 ps-9 text-[13px]', icon: 'start-3', chevron: 'end-3' },\n sm: { input: 'h-8 pe-8 ps-8 text-[12px]', icon: 'start-2.5', chevron: 'end-2.5' },\n md: { input: 'h-9 pe-9 ps-9 text-[13px]', icon: 'start-3', chevron: 'end-3' },\n },\n },\n defaultVariants: { size: 'auto' },\n});\n\nexport type DatePickerVariantProps = VariantProps<typeof datePickerVariants>;\n","import { Field } from '@base-ui/react/field';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { CalendarDays, ChevronDown } from 'lucide-react';\nimport type { ComponentProps, Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { PopoverTrigger } from '../Popover';\nimport { datePickerVariants, type DatePickerVariantProps } from './date-picker.variants';\n\nexport interface DateTriggerProps extends DatePickerVariantProps {\n text: string;\n placeholder: string;\n id?: string;\n disabled?: boolean;\n invalid?: boolean;\n className?: string;\n 'aria-label'?: string;\n 'aria-describedby'?: string;\n}\n\n/**\n * Read-only input that opens the popover (combobox with a dialog popup). It is both the\n * Popover trigger and a Base UI Field control, so FieldLabel / FieldDescription wire to it.\n */\nexport function DateTrigger({\n text,\n placeholder,\n id,\n disabled,\n invalid,\n size = 'auto',\n className,\n ...aria\n}: DateTriggerProps) {\n const s = datePickerVariants({ size });\n const px = size === 'sm' ? 14 : 15;\n return (\n <div className={cn(s.root(), className)}>\n <CalendarDays size={px} aria-hidden className={s.icon()} />\n <PopoverTrigger\n nativeButton={false}\n disabled={disabled}\n render={(triggerProps) => {\n const { ref, ...rest } = triggerProps as ComponentProps<'input'>;\n return (\n <Field.Control\n ref={ref as Ref<HTMLInputElement>}\n id={id}\n disabled={disabled}\n render={(controlProps) => (\n <input\n {...mergeProps<'input'>(controlProps as ComponentProps<'input'>, rest, {\n role: 'combobox',\n readOnly: true,\n value: text,\n placeholder,\n autoComplete: 'off',\n 'aria-invalid': invalid || undefined,\n ...(aria['aria-label'] ? { 'aria-label': aria['aria-label'] } : {}),\n ...(aria['aria-describedby'] ? { 'aria-describedby': aria['aria-describedby'] } : {}),\n className: s.input(),\n })}\n />\n )}\n />\n );\n }}\n />\n <ChevronDown size={px} aria-hidden className={s.chevron()} />\n </div>\n );\n}\n","import { useId, useRef, useState } from 'react';\nimport { Calendar, type CalendarSingleProps } from '../Calendar/Calendar';\nimport { formatDate, toISODate } from '../Calendar/calendar-utils';\nimport { Button } from '../Button';\nimport { Popover, PopoverContent } from '../Popover';\nimport { TimePicker } from '../TimePicker/TimePicker';\nimport { formatTimeOfDay, timeOfDay, withTimeOfDay, parseTimeOfDay } from '../TimePicker/time-utils';\nimport { DateTrigger } from './DateTrigger';\nimport { useI18n, useOptionalI18n } from '../../i18n/I18nProvider';\nimport { datePickerVariants, type DatePickerVariantProps } from './date-picker.variants';\n\ntype CalendarPassThrough = Pick<\n CalendarSingleProps,\n 'locale' | 'weekStartsOn' | 'min' | 'max' | 'isDateDisabled' | 'today'\n>;\n\nexport interface DatePickerProps extends CalendarPassThrough, DatePickerVariantProps {\n value?: Date | null;\n defaultValue?: Date | null;\n onValueChange?: (date: Date | null) => void;\n /** Intl options for the field text. */\n formatOptions?: Intl.DateTimeFormatOptions;\n placeholder?: string;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Submitted as `YYYY-MM-DD` (with `withTime`: `YYYY-MM-DDTHH:mm`) through a hidden input. */\n name?: string;\n /**\n * Adds a TimePicker under the calendar: picking a day keeps the popup open (and the time),\n * Done or Escape closes it. The value carries the time; the field shows date and time.\n */\n withTime?: boolean;\n /** Clock of the time field (`withTime`). Defaults to the locale's. */\n hourCycle?: 12 | 24;\n /** Minute step of the time field's arrow keys (`withTime`). */\n timeStep?: number;\n /** Adds seconds to the time field (`withTime`). */\n withSeconds?: boolean;\n id?: string;\n disabled?: boolean;\n invalid?: boolean;\n className?: string;\n 'aria-label'?: string;\n 'aria-describedby'?: string;\n}\n\n/** Initial focus inside the popup: the calendar's tabbable day. */\nexport function focusCalendarDay(container: HTMLElement | null) {\n return container?.querySelector<HTMLElement>('button[data-day][tabindex=\"0\"]') ?? true;\n}\n\n/**\n * Date field: a read-only input with the formatted date that opens a Popover with a Calendar.\n * Enter/Space/click open it, focus lands on the selected day, picking a day (or Escape)\n * closes it and focus returns to the field.\n */\nexport function DatePicker({\n value,\n defaultValue,\n onValueChange,\n formatOptions,\n placeholder: placeholderProp,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n name,\n id,\n disabled,\n invalid,\n size,\n className,\n locale: localeProp,\n weekStartsOn,\n min,\n max,\n isDateDisabled,\n today,\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedBy,\n withTime = false,\n hourCycle,\n timeStep,\n withSeconds = false,\n}: DatePickerProps) {\n const { t } = useI18n();\n const providerLocale = useOptionalI18n()?.locale;\n const locale = localeProp ?? providerLocale;\n const placeholder = placeholderProp ?? t(withTime ? 'datePicker.dateTimePlaceholder' : 'datePicker.placeholder');\n const [inner, setInner] = useState<Date | null>(defaultValue ?? null);\n const [innerOpen, setInnerOpen] = useState(defaultOpen);\n const calendarRef = useRef<HTMLDivElement | null>(null);\n const timeLabelId = useId();\n const date = value !== undefined ? value : inner;\n const open = openProp ?? innerOpen;\n\n const setOpen = (next: boolean) => {\n setInnerOpen(next);\n onOpenChange?.(next);\n };\n\n const change = (d: Date | null) => {\n setInner(d);\n onValueChange?.(d);\n };\n const timeFormat: Intl.DateTimeFormatOptions = formatOptions ?? {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n ...(withSeconds ? { second: '2-digit' } : {}),\n ...(hourCycle ? { hourCycle: hourCycle === 12 ? 'h12' : 'h23' } : {}),\n };\n const text = date ? formatDate(date, locale, withTime ? timeFormat : formatOptions) : '';\n const hidden = date\n ? withTime\n ? `${toISODate(date)}T${formatTimeOfDay(timeOfDay(date), withSeconds)}`\n : toISODate(date)\n : '';\n const s = datePickerVariants({ size });\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <DateTrigger\n text={text}\n placeholder={placeholder}\n id={id}\n disabled={disabled}\n invalid={invalid}\n size={size}\n className={className}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedBy}\n />\n {name && <input type=\"hidden\" name={name} value={hidden} />}\n <PopoverContent\n aria-label={t('datePicker.choose')}\n align=\"start\"\n sideOffset={6}\n padding=\"none\"\n initialFocus={() => focusCalendarDay(calendarRef.current)}\n >\n <Calendar\n ref={calendarRef}\n aria-label={t('datePicker.choose')}\n value={date}\n onValueChange={(d) => {\n if (withTime) {\n change(withTimeOfDay(d, date ? timeOfDay(date) : { hours: 0, minutes: 0, seconds: 0 }));\n return;\n }\n change(d);\n setOpen(false);\n }}\n locale={locale}\n weekStartsOn={weekStartsOn}\n min={min}\n max={max}\n isDateDisabled={isDateDisabled}\n today={today}\n />\n {withTime && (\n <div className={s.timeRow()}>\n <span id={timeLabelId} className={s.timeLabel()}>\n {t('datePicker.time')}\n </span>\n <TimePicker\n aria-labelledby={timeLabelId}\n value={date ? formatTimeOfDay(timeOfDay(date), withSeconds) : null}\n onValueChange={(v) => {\n const tod = parseTimeOfDay(v);\n if (tod) change(withTimeOfDay(date ?? today ?? new Date(), tod));\n }}\n hourCycle={hourCycle}\n locale={locale}\n step={timeStep}\n withSeconds={withSeconds}\n size=\"sm\"\n className=\"w-auto flex-1\"\n />\n <Button size=\"sm\" onClick={() => setOpen(false)}>\n {t('datePicker.done')}\n </Button>\n </div>\n )}\n </PopoverContent>\n </Popover>\n );\n}\n","import {\n addDays,\n addMonths,\n endOfMonth,\n isSameDay,\n startOfDay,\n startOfMonth,\n type DateRange,\n} from '../Calendar/calendar-utils';\n\nexport interface DateRangePreset {\n id: string;\n label: string;\n /** Range relative to \"today\"; omit for the \"Custom\" entry, which hands focus to the calendar. */\n range?: (today: Date) => DateRange;\n}\n\n/** Today, Last 7 days, Last 30 days, This month (to date), Last month, Custom. */\nexport const DEFAULT_DATE_RANGE_PRESETS: DateRangePreset[] = [\n { id: 'today', label: 'Today', range: (t) => ({ start: startOfDay(t), end: startOfDay(t) }) },\n { id: 'last-7', label: 'Last 7 days', range: (t) => ({ start: addDays(t, -6), end: startOfDay(t) }) },\n { id: 'last-30', label: 'Last 30 days', range: (t) => ({ start: addDays(t, -29), end: startOfDay(t) }) },\n { id: 'this-month', label: 'This month', range: (t) => ({ start: startOfMonth(t), end: startOfDay(t) }) },\n {\n id: 'last-month',\n label: 'Last month',\n range: (t) => {\n const m = startOfMonth(addMonths(startOfMonth(t), -1));\n return { start: m, end: endOfMonth(m) };\n },\n },\n { id: 'custom', label: 'Custom' },\n];\n\n/** The preset whose range equals `value`, if any. */\nexport function matchPreset(presets: DateRangePreset[], value: DateRange, today: Date) {\n return presets.find((p) => {\n const r = p.range?.(today);\n return !!r && isSameDay(r.start, value.start) && isSameDay(r.end, value.end);\n });\n}\n","import { useRef, useState } from 'react';\nimport { cn } from '../../utils/cn';\nimport { Calendar, type CalendarRangeProps } from '../Calendar/Calendar';\nimport { formatDateRange, startOfDay, toISODate, type DateRange } from '../Calendar/calendar-utils';\nimport { Popover, PopoverContent } from '../Popover';\nimport { focusCalendarDay } from './DatePicker';\nimport { DateTrigger } from './DateTrigger';\nimport { DEFAULT_DATE_RANGE_PRESETS, matchPreset, type DateRangePreset } from './date-range-presets';\nimport { useI18n, useOptionalI18n } from '../../i18n/I18nProvider';\nimport { datePickerVariants, type DatePickerVariantProps } from './date-picker.variants';\n\ntype CalendarPassThrough = Pick<\n CalendarRangeProps,\n 'locale' | 'weekStartsOn' | 'min' | 'max' | 'isDateDisabled' | 'numberOfMonths'\n>;\n\nexport interface DateRangePickerProps extends CalendarPassThrough, DatePickerVariantProps {\n value?: DateRange;\n defaultValue?: DateRange;\n /** Fires with complete ranges only (both ends set). */\n onValueChange?: (range: DateRange) => void;\n /** Quick ranges shown beside the calendar; pass `[]` to hide them. */\n presets?: DateRangePreset[];\n /** \"Today\" for the presets and the marker. Defaults to the current date. */\n today?: Date;\n formatOptions?: Intl.DateTimeFormatOptions;\n placeholder?: string;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Submitted as `<name>-start` / `<name>-end` (`YYYY-MM-DD`). */\n name?: string;\n id?: string;\n disabled?: boolean;\n invalid?: boolean;\n className?: string;\n 'aria-label'?: string;\n 'aria-describedby'?: string;\n}\n\nconst EMPTY: DateRange = { start: null, end: null };\n\n/**\n * Date range field: the formatted range in a read-only input that opens presets (Today,\n * Last 7 days, Last 30 days, This month, Last month, Custom) next to a two-month range\n * Calendar. A preset or the second calendar click applies the range and closes the popup.\n */\nexport function DateRangePicker({\n value,\n defaultValue,\n onValueChange,\n presets = DEFAULT_DATE_RANGE_PRESETS,\n today: todayProp,\n formatOptions,\n placeholder: placeholderProp,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n name,\n id,\n disabled,\n invalid,\n size,\n className,\n locale: localeProp,\n weekStartsOn,\n min,\n max,\n isDateDisabled,\n numberOfMonths = 2,\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedBy,\n}: DateRangePickerProps) {\n const { t } = useI18n();\n const providerLocale = useOptionalI18n()?.locale;\n const locale = localeProp ?? providerLocale;\n const placeholder = placeholderProp ?? t('datePicker.rangePlaceholder');\n const [inner, setInner] = useState<DateRange>(defaultValue ?? EMPTY);\n const [innerOpen, setInnerOpen] = useState(defaultOpen);\n const [draft, setDraft] = useState<DateRange>(value ?? inner);\n const [customActive, setCustomActive] = useState(false);\n const [now] = useState(() => startOfDay(new Date()));\n const today = todayProp ? startOfDay(todayProp) : now;\n const calendarRef = useRef<HTMLDivElement | null>(null);\n const range = value ?? inner;\n const open = openProp ?? innerOpen;\n const s = datePickerVariants({ size });\n const active = customActive\n ? presets.find((p) => !p.range)\n : (matchPreset(presets, draft, today) ?? (draft.start ? presets.find((p) => !p.range) : undefined));\n\n const setOpen = (next: boolean) => {\n if (next) {\n setDraft(range);\n setCustomActive(false);\n }\n setInnerOpen(next);\n onOpenChange?.(next);\n };\n\n const apply = (next: DateRange) => {\n setInner(next);\n onValueChange?.(next);\n setOpen(false);\n };\n\n const pickPreset = (p: DateRangePreset) => {\n if (p.range) {\n apply(p.range(today));\n return;\n }\n setCustomActive(true);\n const day = focusCalendarDay(calendarRef.current);\n if (day !== true) day.focus();\n };\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <DateTrigger\n text={formatDateRange(range, locale, formatOptions)}\n placeholder={placeholder}\n id={id}\n disabled={disabled}\n invalid={invalid}\n size={size}\n className={className}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedBy}\n />\n {name && (\n <>\n <input type=\"hidden\" name={`${name}-start`} value={range.start ? toISODate(range.start) : ''} />\n <input type=\"hidden\" name={`${name}-end`} value={range.end ? toISODate(range.end) : ''} />\n </>\n )}\n <PopoverContent\n aria-label={t('datePicker.chooseRange')}\n align=\"start\"\n sideOffset={6}\n padding=\"none\"\n initialFocus={() => focusCalendarDay(calendarRef.current)}\n >\n <div className={s.panel()}>\n {presets.length > 0 && (\n <div role=\"group\" aria-label={t('datePicker.presets')} className={s.presets()}>\n {presets.map((p) => (\n <button\n key={p.id}\n type=\"button\"\n aria-pressed={active?.id === p.id}\n className={cn(s.preset())}\n onClick={() => pickPreset(p)}\n >\n {p.label}\n </button>\n ))}\n </div>\n )}\n <Calendar\n ref={calendarRef}\n mode=\"range\"\n aria-label={t('datePicker.chooseRange')}\n value={draft}\n onValueChange={(r) => {\n setDraft(r);\n setCustomActive(true);\n if (r.start && r.end) apply(r);\n }}\n numberOfMonths={numberOfMonths}\n defaultMonth={\n draft.end && numberOfMonths === 2\n ? new Date(draft.end.getFullYear(), draft.end.getMonth() - 1, 1)\n : undefined\n }\n locale={locale}\n weekStartsOn={weekStartsOn}\n min={min}\n max={max}\n isDateDisabled={isDateDisabled}\n today={today}\n />\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n\n/** Alias: the range field is also catalogued as DateRangeInput. */\nexport const DateRangeInput = DateRangePicker;\nexport type DateRangeInputProps = DateRangePickerProps;\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'DatePicker',\n group: 'Forms',\n status: 'beta',\n description:\n 'Date field: a read-only input with the Intl-formatted date that opens a Popover with a Calendar. DateRangePicker (alias DateRangeInput) adds presets — Today, Last 7 days, Last 30 days, This month, Last month, Custom — beside a two-month range calendar. Min/max, disabled dates, locale, sizes, invalid state; works inside Field. `withTime` adds a TimePicker under the calendar (date + time value, 12/24h, minute step), closed with Done.',\n primitive: '@base-ui/react/popover + Calendar (+ TimePicker with `withTime`)',\n pattern: 'combobox with a dialog popup (date picker dialog)',\n keyboard: [\n ['Enter / Space', 'On the field: opens the calendar with focus on the selected day (or today)'],\n ['Arrow keys / PageUp / PageDown / Home / End', 'Move through the calendar (see Calendar)'],\n ['Enter', 'In the calendar: picks the day (range: start, then end) and closes (`withTime`: stays open)'],\n ['Escape', 'Closes the popup and returns focus to the field'],\n ['Tab', '`withTime`: from the calendar to the time segments and Done (see TimePicker for their keys)'],\n ],\n tokens: [\n 'background',\n 'border',\n 'foreground',\n 'muted-foreground',\n 'popover',\n 'primary',\n 'primary-text',\n 'secondary',\n 'destructive',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\n/**\n * Number field in the Input look: one recessed wrapper (border + focus outline) holding the\n * − stepper, the value, an optional unit and the + stepper, split by hairline dividers.\n */\nexport const numberInputVariants = tv({\n slots: {\n root: 'flex min-w-0 flex-col gap-1.5',\n scrub:\n 'inline-flex w-fit cursor-ew-resize text-[12px] font-medium text-muted-foreground select-none hover:text-foreground',\n scrubCursor: 'text-foreground drop-shadow-sm',\n group: [\n 'flex w-full min-w-0 items-stretch overflow-hidden rounded-md border border-border bg-background text-foreground shadow-sm transition-colors motion-reduce:transition-none',\n 'has-[input:focus-visible]:border-primary/60 has-[input:focus-visible]:outline-2 has-[input:focus-visible]:outline-offset-2 has-[input:focus-visible]:outline-focus-ring',\n 'data-invalid:border-destructive/70',\n 'data-disabled:cursor-not-allowed data-disabled:bg-secondary/50 data-disabled:text-muted-foreground',\n 'data-readonly:bg-secondary/40',\n ],\n input: [\n 'h-full w-full min-w-0 bg-transparent text-foreground tabular-nums outline-none placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed disabled:text-muted-foreground read-only:text-muted-foreground',\n ],\n unit: 'flex shrink-0 items-center text-muted-foreground select-none',\n stepper: [\n 'grid shrink-0 place-items-center border-border text-muted-foreground transition-colors motion-reduce:transition-none',\n 'hover:bg-secondary/70 hover:text-foreground active:bg-secondary',\n 'focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus-ring',\n 'disabled:cursor-not-allowed disabled:text-muted-foreground/40 disabled:hover:bg-transparent',\n ],\n decrement: 'border-e',\n increment: 'border-s',\n },\n variants: {\n size: {\n /** Follows `data-density` (comfortable = md). */\n auto: {\n group: 'h-control text-[13px]',\n input: 'px-field text-[13px]',\n unit: 'pe-3 text-[12.5px]',\n stepper: 'w-control',\n },\n sm: { group: 'h-8 text-[12px]', input: 'px-2.5 text-[12px]', unit: 'pe-2.5 text-[12px]', stepper: 'w-8' },\n md: { group: 'h-9 text-[13px]', input: 'px-3 text-[13px]', unit: 'pe-3 text-[12.5px]', stepper: 'w-9' },\n },\n align: {\n start: { input: 'text-start' },\n center: { input: 'text-center' },\n end: { input: 'text-end' },\n },\n },\n defaultVariants: { size: 'auto', align: 'start' },\n});\n\nexport type NumberInputVariantProps = VariantProps<typeof numberInputVariants>;\n\n/** Stepper icon size (px) per size. */\nexport const NUMBER_INPUT_ICON_SIZE = { auto: 14, sm: 13, md: 14 } as const;\n","import { NumberField } from '@base-ui/react/number-field';\nimport { Minus, MoveHorizontal, Plus } from 'lucide-react';\nimport { useId, type KeyboardEvent, type ReactNode, type Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { NUMBER_INPUT_ICON_SIZE, numberInputVariants, type NumberInputVariantProps } from './number-input.variants';\n\nexport interface NumberInputProps\n extends Omit<NumberField.Root.Props, 'className' | 'render' | 'children' | 'style'>, NumberInputVariantProps {\n /** Classes for the outer column (scrub label + field). */\n className?: string;\n /** Classes for the native <input>. */\n inputClassName?: string;\n /** Ref to the visible <input>. */\n ref?: Ref<HTMLInputElement>;\n /** Unit shown after the value (\"GB\", \"req/s\", \"%\"). Decorative: put the unit in the label too. */\n unit?: ReactNode;\n /** Marks the value as invalid (sets aria-invalid). Inside a Field, `Field invalid` does this. */\n invalid?: boolean;\n /** Renders a label above the field that scrubs the value when dragged horizontally. */\n scrubLabel?: ReactNode;\n /** Hide the − / + buttons (arrow keys still step). */\n hideSteppers?: boolean;\n decrementLabel?: string;\n incrementLabel?: string;\n placeholder?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n}\n\n/** PageUp/PageDown step by `largeStep`: re-dispatched as Shift+ArrowUp/Down, which Base UI handles. */\nfunction onPageKey(event: KeyboardEvent<HTMLInputElement>) {\n if (event.key !== 'PageUp' && event.key !== 'PageDown') return;\n event.preventDefault();\n event.currentTarget.dispatchEvent(\n new window.KeyboardEvent('keydown', {\n key: event.key === 'PageUp' ? 'ArrowUp' : 'ArrowDown',\n shiftKey: true,\n bubbles: true,\n cancelable: true,\n }),\n );\n}\n\n/**\n * Numeric input on Base UI NumberField: − / + steppers, an optional unit suffix and scrub\n * label, min/max/step clamping and locale formatting (`format`). Works inside Field.\n */\nexport function NumberInput({\n size = 'auto',\n align,\n className,\n inputClassName,\n ref,\n unit,\n invalid,\n scrubLabel,\n hideSteppers = false,\n decrementLabel: decrementLabelProp,\n incrementLabel: incrementLabelProp,\n placeholder,\n id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n ...props\n}: NumberInputProps) {\n const { t } = useI18n();\n const decrementLabel = decrementLabelProp ?? t('numberInput.decrease');\n const incrementLabel = incrementLabelProp ?? t('numberInput.increase');\n const autoId = useId();\n const inputId = id ?? (scrubLabel != null ? autoId : undefined);\n const s = numberInputVariants({ size, align });\n const px = NUMBER_INPUT_ICON_SIZE[size];\n return (\n <NumberField.Root id={inputId} className={cn(s.root(), className)} {...props}>\n {scrubLabel != null && (\n <NumberField.ScrubArea className={s.scrub()}>\n <label htmlFor={inputId}>{scrubLabel}</label>\n <NumberField.ScrubAreaCursor className={s.scrubCursor()}>\n <MoveHorizontal size={16} aria-hidden />\n </NumberField.ScrubAreaCursor>\n </NumberField.ScrubArea>\n )}\n <NumberField.Group className={s.group()} data-invalid={invalid || undefined}>\n {!hideSteppers && (\n <NumberField.Decrement aria-label={decrementLabel} className={cn(s.stepper(), s.decrement())}>\n <Minus size={px} aria-hidden />\n </NumberField.Decrement>\n )}\n <NumberField.Input\n ref={ref}\n placeholder={placeholder}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n aria-invalid={invalid || undefined}\n onKeyDown={onPageKey}\n className={cn(s.input(), inputClassName)}\n />\n {unit != null && (\n <span aria-hidden className={s.unit()}>\n {unit}\n </span>\n )}\n {!hideSteppers && (\n <NumberField.Increment aria-label={incrementLabel} className={cn(s.stepper(), s.increment())}>\n <Plus size={px} aria-hidden />\n </NumberField.Increment>\n )}\n </NumberField.Group>\n </NumberField.Root>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'NumberInput',\n group: 'Forms',\n status: 'beta',\n description:\n 'Numeric input with − / + steppers, a unit suffix, min/max/step clamping, locale formatting and an optional scrub label (drag to change). Sizes sm and md like Input; invalid, disabled and read-only states; works inside Field.',\n primitive: '@base-ui/react/number-field',\n pattern: 'spinbutton-like textbox (number field)',\n keyboard: [\n ['ArrowUp / ArrowDown', 'Increments / decrements by step (Shift: largeStep, Alt: smallStep)'],\n ['PageUp / PageDown', 'Increments / decrements by largeStep'],\n ['Home / End', 'Sets the value to min / max (when defined)'],\n ['Click on label', 'Inside a Field, focuses the input'],\n ],\n tokens: [\n 'background',\n 'border',\n 'foreground',\n 'muted-foreground',\n 'primary',\n 'destructive',\n 'secondary',\n 'focus-ring',\n ],\n};\n","import { Select as BaseSelect } from '@base-ui/react/select';\nimport { useRender } from '@base-ui/react/use-render';\nimport { Check, ChevronDown, RotateCw } from 'lucide-react';\nimport {\n createContext,\n useCallback,\n useContext,\n useState,\n useSyncExternalStore,\n type ReactNode,\n type Ref,\n} from 'react';\nimport { usePortalDir, useI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { useAsyncOptions, type LoadOptions } from '../Combobox/useAsyncOptions';\nimport { Spinner } from '../Spinner';\nimport { selectVariants, type SelectVariantProps } from './select.variants';\n\nconst s = selectVariants();\n\nconst SelectTriggerContext = createContext<{\n trigger: HTMLButtonElement | null;\n setTrigger: (trigger: HTMLButtonElement | null) => void;\n} | null>(null);\n\n/** Select state container (value, defaultValue, onValueChange, items, multiple, open…). Renders no element. */\nexport function Select<Value, Multiple extends boolean | undefined = false>(\n props: BaseSelect.Root.Props<Value, Multiple>,\n) {\n const [trigger, setTrigger] = useState<HTMLButtonElement | null>(null);\n return (\n <SelectTriggerContext.Provider value={{ trigger, setTrigger }}>\n <BaseSelect.Root {...props} />\n </SelectTriggerContext.Provider>\n );\n}\n\n// Read the resolved trigger attribute, including labels supplied by Base UI Field.\n// Observe attribute changes so caller updates also reach an already open listbox.\nfunction useTriggerAttribute(trigger: HTMLButtonElement | null, attribute: string) {\n const subscribe = useCallback(\n (onChange: () => void) => {\n if (!trigger) return () => {};\n const observer = new MutationObserver(onChange);\n observer.observe(trigger, { attributes: true, attributeFilter: [attribute] });\n return () => observer.disconnect();\n },\n [trigger, attribute],\n );\n return useSyncExternalStore(\n subscribe,\n () => trigger?.getAttribute(attribute) ?? undefined,\n () => undefined,\n );\n}\n\n/** Visible label; automatically labels the trigger. */\nexport function SelectLabel({\n className,\n ...props\n}: Omit<BaseSelect.Label.Props, 'className'> & { className?: string }) {\n return <BaseSelect.Label className={cn(s.label(), className)} {...props} />;\n}\n\nexport interface SelectTriggerProps\n extends Omit<BaseSelect.Trigger.Props, 'className' | 'children'>, SelectVariantProps {\n className?: string;\n ref?: Ref<HTMLButtonElement>;\n /** Shown while nothing is selected. */\n placeholder?: ReactNode;\n /** Custom value rendering; defaults to the selected item's label (pass `items` to Select). */\n children?: BaseSelect.Value.Props['children'];\n}\n\n/** The button that shows the current value and a chevron, and opens the popup. */\nexport function SelectTrigger({ size, className, placeholder, children, ref, ...props }: SelectTriggerProps) {\n const v = selectVariants({ size });\n const context = useContext(SelectTriggerContext);\n return useRender({\n ref: [ref ?? null, context?.setTrigger ?? null],\n render: (\n <BaseSelect.Trigger className={cn(v.trigger(), className)} {...props}>\n <BaseSelect.Value className={v.value()} placeholder={placeholder}>\n {children}\n </BaseSelect.Value>\n <BaseSelect.Icon className={v.icon()}>\n <ChevronDown size={15} aria-hidden />\n </BaseSelect.Icon>\n </BaseSelect.Trigger>\n ),\n });\n}\n\nexport interface SelectContentProps extends Omit<BaseSelect.Popup.Props, 'className'> {\n className?: string;\n /** Overlap the trigger so the selected item lines up with the value (native-like). Default false. */\n alignItemWithTrigger?: boolean;\n side?: BaseSelect.Positioner.Props['side'];\n align?: BaseSelect.Positioner.Props['align'];\n sideOffset?: number;\n /** Portal container; defaults to document.body. */\n container?: BaseSelect.Portal.Props['container'];\n /** Rendered above the list, e.g. a loading or error message (SimpleSelect uses it for `loadOptions`). */\n status?: ReactNode;\n children?: ReactNode;\n}\n\n/** The popup: portal, positioner, popup surface and listbox. */\nexport function SelectContent({\n className,\n alignItemWithTrigger = false,\n side = 'bottom',\n align = 'start',\n sideOffset = 6,\n container,\n status,\n children,\n ...props\n}: SelectContentProps) {\n const dir = usePortalDir();\n const context = useContext(SelectTriggerContext);\n const labelledBy = useTriggerAttribute(context?.trigger ?? null, 'aria-labelledby');\n const ariaLabel = useTriggerAttribute(context?.trigger ?? null, 'aria-label');\n const explicitName = props['aria-label'] !== undefined || props['aria-labelledby'] !== undefined;\n return (\n <BaseSelect.Portal container={container}>\n <BaseSelect.Positioner\n dir={dir}\n className={s.positioner()}\n alignItemWithTrigger={alignItemWithTrigger}\n side={side}\n align={align}\n sideOffset={sideOffset}\n >\n <BaseSelect.Popup className={cn(s.popup(), className)} {...props}>\n {status}\n <BaseSelect.List\n className={s.list()}\n aria-labelledby={explicitName ? props['aria-labelledby'] : labelledBy}\n aria-label={explicitName ? props['aria-label'] : ariaLabel}\n >\n {children}\n </BaseSelect.List>\n </BaseSelect.Popup>\n </BaseSelect.Positioner>\n </BaseSelect.Portal>\n );\n}\n\nexport interface SelectItemProps extends Omit<BaseSelect.Item.Props, 'className'> {\n className?: string;\n}\n\n/** One option. Shows a check when selected. */\nexport function SelectItem({ className, children, ...props }: SelectItemProps) {\n return (\n <BaseSelect.Item className={cn(s.item(), className)} {...props}>\n <BaseSelect.ItemText className={s.itemText()}>{children}</BaseSelect.ItemText>\n <BaseSelect.ItemIndicator className={s.indicator()}>\n <Check size={15} strokeWidth={2.4} aria-hidden />\n </BaseSelect.ItemIndicator>\n </BaseSelect.Item>\n );\n}\n\nexport const SelectGroup = BaseSelect.Group;\n\nexport function SelectGroupLabel({\n className,\n ...props\n}: Omit<BaseSelect.GroupLabel.Props, 'className'> & { className?: string }) {\n return <BaseSelect.GroupLabel className={cn(s.groupLabel(), className)} {...props} />;\n}\n\nexport function SelectSeparator({\n className,\n ...props\n}: Omit<BaseSelect.Separator.Props, 'className'> & { className?: string }) {\n return <BaseSelect.Separator className={cn(s.separator(), className)} {...props} />;\n}\n\nexport interface SimpleSelectItem<V extends string = string> {\n value: V;\n label: string;\n disabled?: boolean;\n}\n\nexport interface SimpleSelectProps<V extends string = string>\n extends Omit<BaseSelect.Root.Props<V, false>, 'items' | 'multiple' | 'children'>, SelectVariantProps {\n /** The options. With `loadOptions`, the ones known up front (e.g. the selected value's label). */\n items?: ReadonlyArray<SimpleSelectItem<V>>;\n /**\n * Async options, loaded the first time the popup opens (`query` is always `''`; the signal\n * aborts if the popup closes or the select unmounts). After an error, reopening retries.\n */\n loadOptions?: LoadOptions<SimpleSelectItem<V>>;\n /** Shown (and announced) while `loadOptions` runs. Default: \"Loading…\". */\n loadingText?: ReactNode;\n /** Shown (and announced) when `loadOptions` rejects. Default: \"Couldn’t load options.\" */\n errorText?: ReactNode;\n /** Shown when there are no options. Default: \"No results\". */\n emptyText?: ReactNode;\n /** Visible label. Without it, pass `aria-label`. */\n label?: ReactNode;\n 'aria-label'?: string;\n placeholder?: ReactNode;\n /** Class for the trigger. */\n className?: string;\n /** Ref to the trigger button (e.g. so a form library can focus it). */\n triggerRef?: Ref<HTMLButtonElement>;\n}\n\n/** One-line select from a flat `{ value, label }` list, or from `loadOptions`. */\nexport function SimpleSelect<V extends string = string>({\n items: itemsProp,\n loadOptions,\n loadingText,\n errorText,\n emptyText,\n label,\n placeholder: placeholderProp,\n size,\n className,\n 'aria-label': ariaLabel,\n onOpenChange,\n triggerRef,\n ...props\n}: SimpleSelectProps<V>) {\n const { t } = useI18n();\n const placeholder = placeholderProp ?? t('common.selectPlaceholder');\n const [open, setOpen] = useState(props.defaultOpen ?? false);\n const remote = useAsyncOptions(loadOptions, '', { enabled: props.open ?? open, debounceMs: 0 });\n const known = itemsProp ?? [];\n const items = loadOptions\n ? [...known.filter((k) => !remote.items.some((r) => r.value === k.value)), ...remote.items]\n : known;\n const sv = selectVariants();\n\n let status: ReactNode = null;\n if (loadOptions && remote.loading) {\n status = (\n <div role=\"status\" className={sv.status()}>\n <Spinner size={13} />\n {loadingText ?? t('common.loading')}\n </div>\n );\n } else if (loadOptions && remote.error) {\n status = (\n <div className={cn(sv.status(), sv.statusError())}>\n <span role=\"alert\">{errorText ?? t('combobox.loadFailed')}</span>\n <button type=\"button\" className={sv.retry()} onClick={remote.reload}>\n <RotateCw size={12} aria-hidden />\n {t('common.retry')}\n </button>\n </div>\n );\n } else if (loadOptions && items.length === 0) {\n status = (\n <div role=\"status\" className={sv.status()}>\n {emptyText ?? t('common.noResults')}\n </div>\n );\n }\n\n return (\n <Select<V>\n items={items.map(({ value, label: l }) => ({ value, label: l }))}\n onOpenChange={(next, details) => {\n setOpen(next);\n if (next && remote.error) remote.reload();\n onOpenChange?.(next, details);\n }}\n {...props}\n >\n {label && <SelectLabel>{label}</SelectLabel>}\n <SelectTrigger\n ref={triggerRef}\n size={size}\n className={className}\n placeholder={placeholder}\n aria-label={ariaLabel}\n />\n <SelectContent status={status} aria-busy={(loadOptions && remote.loading) || undefined}>\n {items.map((item) => (\n <SelectItem key={item.value} value={item.value} disabled={item.disabled}>\n {item.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Select',\n group: 'Forms',\n status: 'stable',\n description:\n 'Pick one value from a short list in a popup. Compound parts (Select, SelectLabel, SelectTrigger, SelectContent, SelectItem, SelectGroup, SelectGroupLabel, SelectSeparator) plus a one-line SimpleSelect. Three trigger sizes; rich rows (avatar, status dot) via item children. SimpleSelect can load its options on first open (`loadOptions(query, { signal })`) with announced loading, empty and error states. Creatable lives in Combobox / MultiSelect (a select has no text input).',\n primitive: '@base-ui/react/select',\n pattern: 'select-only combobox + listbox',\n keyboard: [\n ['Enter / Space / ArrowDown', 'On the trigger: opens the popup'],\n ['ArrowDown / ArrowUp', 'Moves the highlight between options'],\n ['Enter', 'Selects the highlighted option and closes the popup'],\n ['Escape', 'Closes the popup and returns focus to the trigger'],\n ['Type a character', 'Typeahead: highlights the next option starting with it'],\n ['Escape, then Enter / ArrowDown', 'After a failed async load: closing and reopening the popup retries'],\n ],\n tokens: [\n 'background',\n 'border',\n 'popover',\n 'popover-foreground',\n 'primary',\n 'primary-text',\n 'secondary',\n 'muted-foreground',\n 'ring',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const toggleGroupVariants = tv({\n base: 'inline-flex data-[orientation=vertical]:flex-col data-disabled:opacity-50',\n variants: {\n variant: {\n /** Pill container; the pressed item lifts onto bg-secondary. */\n segmented: 'items-center gap-0.5 rounded-lg border border-border bg-card p-0.5 shadow-sm',\n /** Buttons sharing borders; rounding only on the container. */\n joined:\n 'overflow-hidden rounded-lg border border-border bg-card shadow-sm divide-x divide-border data-[orientation=vertical]:divide-x-0 data-[orientation=vertical]:divide-y',\n },\n },\n defaultVariants: { variant: 'segmented' },\n});\n\nexport const toggleVariants = tv({\n base: [\n 'inline-flex shrink-0 items-center justify-center gap-2 font-medium whitespace-nowrap text-muted-foreground transition-colors select-none',\n 'hover:text-foreground data-pressed:bg-secondary data-pressed:text-foreground',\n 'focus-visible:relative focus-visible:z-10 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n 'data-disabled:cursor-not-allowed data-disabled:opacity-50 data-disabled:hover:text-muted-foreground',\n ],\n variants: {\n variant: {\n /** Standalone pressed button. */\n standalone:\n 'rounded-lg border border-border bg-card shadow-sm hover:bg-secondary/50 data-pressed:border-primary/40',\n segmented: 'rounded-md data-pressed:shadow-sm',\n joined: 'hover:bg-secondary/50',\n },\n size: {\n /** Follows `data-density` (comfortable = md). */\n auto: 'h-control px-4 text-[13px]',\n sm: 'h-8 px-3 text-[12.5px]',\n md: 'h-9 px-4 text-[13px]',\n },\n iconOnly: { true: 'px-0' },\n },\n compoundVariants: [\n { variant: 'segmented', size: 'auto', class: 'h-control-sm px-control-sm text-[12.5px]' },\n { variant: 'segmented', size: 'md', class: 'h-8 px-3 text-[12.5px]' },\n { variant: 'segmented', size: 'sm', class: 'h-7 px-2.5 text-[12px]' },\n { iconOnly: true, size: 'auto', class: 'size-control px-0' },\n { iconOnly: true, size: 'sm', class: 'size-8 px-0' },\n { iconOnly: true, size: 'md', class: 'size-9 px-0' },\n { iconOnly: true, variant: 'segmented', size: 'auto', class: 'size-control-sm' },\n { iconOnly: true, variant: 'segmented', size: 'md', class: 'size-8' },\n { iconOnly: true, variant: 'segmented', size: 'sm', class: 'size-7' },\n ],\n defaultVariants: { variant: 'standalone', size: 'auto', iconOnly: false },\n});\n\nexport type ToggleGroupVariantProps = VariantProps<typeof toggleGroupVariants>;\nexport type ToggleVariantProps = VariantProps<typeof toggleVariants>;\n","import { Toggle as BaseToggle } from '@base-ui/react/toggle';\nimport { ToggleGroup as BaseToggleGroup } from '@base-ui/react/toggle-group';\nimport { createContext, useContext, type ReactNode, type Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport {\n toggleGroupVariants,\n toggleVariants,\n type ToggleGroupVariantProps,\n type ToggleVariantProps,\n} from './toggle-group.variants';\n\ntype GroupStyle = { variant: 'segmented' | 'joined'; size: 'auto' | 'sm' | 'md' };\nconst GroupStyleContext = createContext<GroupStyle | null>(null);\n\nexport interface ToggleProps extends Omit<BaseToggle.Props, 'className'>, Omit<ToggleVariantProps, 'variant'> {\n className?: string;\n ref?: Ref<HTMLButtonElement>;\n children?: ReactNode;\n}\n\n/**\n * Two-state (pressed) button. Standalone: `pressed` / `defaultPressed` / `onPressedChange`.\n * Inside a ToggleGroup: give it a `value`; it inherits the group's look. Icon-only toggles\n * need `aria-label` (set `iconOnly`).\n */\nexport function Toggle({ size, iconOnly, className, type = 'button', ...props }: ToggleProps) {\n const group = useContext(GroupStyleContext);\n return (\n <BaseToggle\n type={type}\n className={cn(\n toggleVariants({ variant: group?.variant ?? 'standalone', size: size ?? group?.size ?? 'auto', iconOnly }),\n className,\n )}\n {...props}\n />\n );\n}\n\nexport interface ToggleGroupProps extends Omit<BaseToggleGroup.Props<string>, 'className'>, ToggleGroupVariantProps {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n /** Item size, passed down to every Toggle. `auto` (default) follows the density. */\n size?: 'auto' | 'sm' | 'md';\n}\n\n/**\n * A set of Toggles with shared state: segmented control (`multiple={false}`, the default)\n * or multi-select toolbar (`multiple`). Arrow keys move focus; Space/Enter toggles.\n * Give it an `aria-label`.\n */\nexport function ToggleGroup({ variant = 'segmented', size = 'auto', className, ...props }: ToggleGroupProps) {\n return (\n <GroupStyleContext.Provider value={{ variant: variant ?? 'segmented', size }}>\n <BaseToggleGroup className={cn(toggleGroupVariants({ variant }), className)} {...props} />\n </GroupStyleContext.Provider>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'ToggleGroup',\n group: 'Actions',\n status: 'stable',\n description:\n 'Toggle is a two-state (pressed) button; ToggleGroup sets Toggles side by side with shared state: a segmented control (single) or a toolbar of independent options (multiple). Segmented and joined looks, two sizes, icon-only items.',\n primitive: '@base-ui/react/toggle-group',\n pattern: 'toolbar-style group of toggle buttons (aria-pressed)',\n keyboard: [\n ['ArrowRight / ArrowLeft', 'Moves focus to the next / previous item (wraps)'],\n ['Home / End', 'Moves focus to the first / last item'],\n ['Space / Enter', 'Toggles the focused item'],\n ['Tab', 'Moves focus into and out of the group (one tab stop)'],\n ],\n tokens: ['card', 'border', 'secondary', 'foreground', 'muted-foreground', 'primary', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\n/**\n * Popup layout beside the shared date-field trigger and preset list (datePickerVariants):\n * a mode switch, then either the \"Last N unit\" row or the range calendar with start/end times.\n */\nexport const dateTimeRangePickerVariants = tv({\n slots: {\n body: 'flex min-w-0 flex-col gap-3 p-3',\n relativeRow: 'flex flex-wrap items-center gap-2',\n label: 'text-[12px] font-medium text-muted-foreground',\n times: 'grid grid-cols-1 gap-3 sm:grid-cols-2',\n timeField: 'flex min-w-0 flex-col gap-1.5',\n error: 'text-[12px] font-medium text-destructive-text',\n footer: 'flex items-center justify-end gap-2',\n },\n});\n\nexport type DateTimeRangePickerVariantProps = VariantProps<typeof dateTimeRangePickerVariants>;\n","import type { MessageKey } from '../../i18n/messages/en';\nimport type { MessageVars } from '../../i18n/format';\n\nexport type RelativeTimeUnit = 'minute' | 'hour' | 'day';\n\n/** A serialisable time range: relative to \"now\" (\"last 15 minutes\") or between two instants. */\nexport type TimeRangeValue =\n { mode: 'relative'; amount: number; unit: RelativeTimeUnit } | { mode: 'absolute'; start: Date; end: Date };\n\nexport interface TimeRangePreset {\n id: string;\n amount: number;\n unit: RelativeTimeUnit;\n /** Defaults to the catalog's \"Last …\" label. */\n label?: string;\n}\n\n/** Last 15 minutes, 1 hour, 24 hours, 7 days, 30 days. */\nexport const DEFAULT_TIME_RANGE_PRESETS: TimeRangePreset[] = [\n { id: 'last-15m', amount: 15, unit: 'minute' },\n { id: 'last-1h', amount: 1, unit: 'hour' },\n { id: 'last-24h', amount: 24, unit: 'hour' },\n { id: 'last-7d', amount: 7, unit: 'day' },\n { id: 'last-30d', amount: 30, unit: 'day' },\n];\n\nconst UNIT_MS: Record<RelativeTimeUnit, number> = { minute: 60_000, hour: 3_600_000, day: 86_400_000 };\n\n/** The instants a range covers at `now` (relative ranges end at `now`). */\nexport function resolveTimeRange(value: TimeRangeValue, now: Date = new Date()): { start: Date; end: Date } {\n if (value.mode === 'absolute') return { start: value.start, end: value.end };\n return { start: new Date(now.getTime() - value.amount * UNIT_MS[value.unit]), end: now };\n}\n\nconst LAST_KEY: Record<RelativeTimeUnit, MessageKey> = {\n minute: 'timeRange.lastMinutes',\n hour: 'timeRange.lastHours',\n day: 'timeRange.lastDays',\n};\n\n/** \"Last 15 minutes\", \"Last hour\"… in the translator's language. */\nexport function relativeTimeRangeLabel(\n amount: number,\n unit: RelativeTimeUnit,\n t: (key: MessageKey, vars?: MessageVars) => string,\n) {\n return t(LAST_KEY[unit], { count: amount });\n}\n\n/** Validation of an absolute range: null when valid. */\nexport function timeRangeError(start: Date | null, end: Date | null): 'incomplete' | 'endBeforeStart' | null {\n if (!start || !end) return 'incomplete';\n return end.getTime() <= start.getTime() ? 'endBeforeStart' : null;\n}\n\n/** Same range? (relative: same amount and unit; absolute: same instants). */\nexport function isSameTimeRange(a: TimeRangeValue | null | undefined, b: TimeRangeValue | null | undefined): boolean {\n if (!a || !b || a.mode !== b.mode) return false;\n if (a.mode === 'relative' && b.mode === 'relative') return a.amount === b.amount && a.unit === b.unit;\n if (a.mode === 'absolute' && b.mode === 'absolute')\n return a.start.getTime() === b.start.getTime() && a.end.getTime() === b.end.getTime();\n return false;\n}\n","import { useId, useRef, useState } from 'react';\nimport { useI18n, useOptionalI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { Button } from '../Button';\nimport { Calendar } from '../Calendar/Calendar';\nimport { startOfDay, type DateRange, type WeekDay } from '../Calendar/calendar-utils';\nimport { focusCalendarDay } from '../DatePicker/DatePicker';\nimport { DateTrigger } from '../DatePicker/DateTrigger';\nimport { datePickerVariants, type DatePickerVariantProps } from '../DatePicker/date-picker.variants';\nimport { NumberInput } from '../NumberInput';\nimport { Popover, PopoverContent } from '../Popover';\nimport { SimpleSelect } from '../Select';\nimport { TimePicker } from '../TimePicker/TimePicker';\nimport { formatTimeOfDay, parseTimeOfDay, timeOfDay, withTimeOfDay } from '../TimePicker/time-utils';\nimport { Toggle, ToggleGroup } from '../ToggleGroup';\nimport { dateTimeRangePickerVariants } from './date-time-range-picker.variants';\nimport {\n DEFAULT_TIME_RANGE_PRESETS,\n isSameTimeRange,\n relativeTimeRangeLabel,\n resolveTimeRange,\n timeRangeError,\n type RelativeTimeUnit,\n type TimeRangePreset,\n type TimeRangeValue,\n} from './time-range';\n\nexport interface DateTimeRangePickerProps extends DatePickerVariantProps {\n value?: TimeRangeValue | null;\n defaultValue?: TimeRangeValue | null;\n /** Fires with a preset, an applied relative range or a valid absolute range. */\n onValueChange?: (value: TimeRangeValue) => void;\n /** Quick relative ranges; pass `[]` to hide them. */\n presets?: TimeRangePreset[];\n /** \"Now\" for relative ranges and the calendar. Defaults to the time the popup opens. */\n now?: Date;\n locale?: string;\n /** Clock of the time fields. Defaults to the locale's. */\n hourCycle?: 12 | 24;\n weekStartsOn?: WeekDay;\n /** Earliest selectable day (absolute mode). */\n min?: Date;\n /** Latest selectable day (absolute mode). */\n max?: Date;\n placeholder?: string;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Submits the resolved instants as ISO strings in `<name>-start` / `<name>-end`. */\n name?: string;\n id?: string;\n disabled?: boolean;\n invalid?: boolean;\n className?: string;\n 'aria-label'?: string;\n 'aria-describedby'?: string;\n}\n\ninterface Draft {\n mode: 'relative' | 'absolute';\n amount: number;\n unit: RelativeTimeUnit;\n days: DateRange;\n startTime: string;\n endTime: string;\n}\n\nfunction draftFrom(value: TimeRangeValue | null | undefined, now: Date): Draft {\n const rel = value?.mode === 'relative' ? value : { amount: 1, unit: 'hour' as const };\n const { start, end } = value ? resolveTimeRange(value, now) : { start: null, end: null };\n return {\n mode: value?.mode ?? 'relative',\n amount: rel.amount,\n unit: rel.unit,\n days: { start: start ? startOfDay(start) : null, end: end ? startOfDay(end) : null },\n startTime: formatTimeOfDay(start ? timeOfDay(start) : { hours: 0, minutes: 0, seconds: 0 }),\n endTime: formatTimeOfDay(end ? timeOfDay(end) : { hours: 23, minutes: 59, seconds: 0 }),\n };\n}\n\nconst at = (day: Date | null, time: string) => {\n const tod = parseTimeOfDay(time);\n return day && tod ? withTimeOfDay(day, tod) : null;\n};\n\n/**\n * Time range field for logs and metrics: quick relative presets (last 15 minutes … 30 days),\n * a relative \"Last N minutes/hours/days\" editor, and an absolute mode with a range Calendar\n * plus start and end TimePickers, validated so the end is after the start.\n */\nexport function DateTimeRangePicker({\n value,\n defaultValue = null,\n onValueChange,\n presets = DEFAULT_TIME_RANGE_PRESETS,\n now: nowProp,\n locale: localeProp,\n hourCycle,\n weekStartsOn,\n min,\n max,\n placeholder: placeholderProp,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n name,\n id,\n disabled,\n invalid,\n size,\n className,\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedBy,\n}: DateTimeRangePickerProps) {\n const { t } = useI18n();\n const providerLocale = useOptionalI18n()?.locale;\n const locale = localeProp ?? providerLocale;\n const uid = useId();\n const [inner, setInner] = useState<TimeRangeValue | null>(defaultValue);\n const range = value !== undefined ? value : inner;\n const [innerOpen, setInnerOpen] = useState(defaultOpen);\n const open = openProp ?? innerOpen;\n const [openedAt, setOpenedAt] = useState(() => new Date());\n const now = nowProp ?? openedAt;\n const [draft, setDraft] = useState<Draft>(() => draftFrom(range, now));\n const calendarRef = useRef<HTMLDivElement | null>(null);\n const presetsRef = useRef<HTMLDivElement | null>(null);\n const s = datePickerVariants({ size });\n const v = dateTimeRangePickerVariants();\n\n const unitLabel: Record<RelativeTimeUnit, string> = {\n minute: t('timeRange.minutes'),\n hour: t('timeRange.hours'),\n day: t('timeRange.days'),\n };\n const presetLabel = (p: TimeRangePreset) => p.label ?? relativeTimeRangeLabel(p.amount, p.unit, t);\n const activePreset =\n range?.mode === 'relative'\n ? presets.find((p) => isSameTimeRange(range, { mode: 'relative', amount: p.amount, unit: p.unit }))\n : undefined;\n\n const text = !range\n ? ''\n : range.mode === 'relative'\n ? activePreset\n ? presetLabel(activePreset)\n : relativeTimeRangeLabel(range.amount, range.unit, t)\n : new Intl.DateTimeFormat(locale, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n ...(hourCycle ? { hourCycle: hourCycle === 12 ? 'h12' : 'h23' } : {}),\n }).formatRange(range.start, range.end);\n const resolved = range ? resolveTimeRange(range, now) : null;\n\n const setOpen = (next: boolean) => {\n if (next) {\n const opened = new Date();\n setOpenedAt(opened);\n setDraft(draftFrom(range, nowProp ?? opened));\n }\n setInnerOpen(next);\n onOpenChange?.(next);\n };\n\n const apply = (next: TimeRangeValue) => {\n setInner(next);\n onValueChange?.(next);\n setOpen(false);\n };\n\n const startAt = at(draft.days.start, draft.startTime);\n const endAt = at(draft.days.end, draft.endTime);\n const error = timeRangeError(startAt, endAt);\n const showError = draft.mode === 'absolute' && !!draft.days.start && !!draft.days.end && error !== null;\n const errorId = `${uid}-error`;\n\n const goCustom = () => {\n setDraft((d) => ({ ...d, mode: 'absolute' }));\n requestAnimationFrame(() => {\n const day = focusCalendarDay(calendarRef.current);\n if (day !== true) day.focus();\n });\n };\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <DateTrigger\n text={text}\n placeholder={placeholderProp ?? t('timeRange.placeholder')}\n id={id}\n disabled={disabled}\n invalid={invalid}\n size={size}\n className={className}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedBy}\n />\n {name && (\n <>\n <input type=\"hidden\" name={`${name}-start`} value={resolved ? resolved.start.toISOString() : ''} />\n <input type=\"hidden\" name={`${name}-end`} value={resolved ? resolved.end.toISOString() : ''} />\n </>\n )}\n <PopoverContent\n aria-label={t('timeRange.choose')}\n align=\"start\"\n sideOffset={6}\n padding=\"none\"\n initialFocus={() =>\n presetsRef.current?.querySelector<HTMLElement>('[aria-pressed=\"true\"]') ??\n presetsRef.current?.querySelector<HTMLElement>('button') ??\n true\n }\n >\n <div className={s.panel()}>\n {presets.length > 0 && (\n <div ref={presetsRef} role=\"group\" aria-label={t('timeRange.presets')} className={s.presets()}>\n {presets.map((p) => (\n <button\n key={p.id}\n type=\"button\"\n aria-pressed={activePreset?.id === p.id}\n className={s.preset()}\n onClick={() => apply({ mode: 'relative', amount: p.amount, unit: p.unit })}\n >\n {presetLabel(p)}\n </button>\n ))}\n <button type=\"button\" aria-pressed={range?.mode === 'absolute'} className={s.preset()} onClick={goCustom}>\n {t('timeRange.custom')}\n </button>\n </div>\n )}\n <div className={v.body()}>\n <ToggleGroup\n aria-label={t('timeRange.mode')}\n size=\"sm\"\n value={[draft.mode]}\n onValueChange={(m) => {\n const mode = m[0];\n if (mode === 'relative' || mode === 'absolute') setDraft((d) => ({ ...d, mode }));\n }}\n className=\"w-fit\"\n >\n <Toggle value=\"relative\">{t('timeRange.relative')}</Toggle>\n <Toggle value=\"absolute\">{t('timeRange.absolute')}</Toggle>\n </ToggleGroup>\n\n {draft.mode === 'relative' ? (\n <div className={v.relativeRow()}>\n <span className={v.label()}>{t('timeRange.last')}</span>\n <NumberInput\n aria-label={t('timeRange.amount')}\n value={draft.amount}\n min={1}\n max={9999}\n size=\"sm\"\n onValueChange={(n) => n !== null && setDraft((d) => ({ ...d, amount: Math.max(1, Math.round(n)) }))}\n className=\"w-28\"\n />\n <SimpleSelect<RelativeTimeUnit>\n aria-label={t('timeRange.unit')}\n size=\"sm\"\n items={(['minute', 'hour', 'day'] as const).map((u) => ({ value: u, label: unitLabel[u] }))}\n value={draft.unit}\n onValueChange={(u) => u && setDraft((d) => ({ ...d, unit: u }))}\n className=\"w-32\"\n />\n </div>\n ) : (\n <>\n <Calendar\n ref={calendarRef}\n mode=\"range\"\n aria-label={t('timeRange.choose')}\n value={draft.days}\n onValueChange={(days) => setDraft((d) => ({ ...d, days }))}\n locale={locale}\n weekStartsOn={weekStartsOn}\n min={min}\n max={max}\n today={now}\n className=\"p-0\"\n />\n <div className={v.times()}>\n <div className={v.timeField()}>\n <span id={`${uid}-start`} className={v.label()}>\n {t('timeRange.startTime')}\n </span>\n <TimePicker\n aria-labelledby={`${uid}-start`}\n value={draft.startTime}\n onValueChange={(time) => time && setDraft((d) => ({ ...d, startTime: time }))}\n hourCycle={hourCycle}\n locale={locale}\n size=\"sm\"\n invalid={showError}\n />\n </div>\n <div className={v.timeField()}>\n <span id={`${uid}-end`} className={v.label()}>\n {t('timeRange.endTime')}\n </span>\n <TimePicker\n aria-labelledby={`${uid}-end`}\n aria-describedby={showError ? errorId : undefined}\n value={draft.endTime}\n onValueChange={(time) => time && setDraft((d) => ({ ...d, endTime: time }))}\n hourCycle={hourCycle}\n locale={locale}\n size=\"sm\"\n invalid={showError}\n />\n </div>\n </div>\n <div aria-live=\"polite\" className=\"contents\">\n {showError && (\n <p id={errorId} className={v.error()}>\n {t(error === 'endBeforeStart' ? 'timeRange.endBeforeStart' : 'timeRange.incomplete')}\n </p>\n )}\n </div>\n </>\n )}\n\n <div className={v.footer()}>\n <Button\n size=\"sm\"\n disabled={draft.mode === 'absolute' && error !== null}\n aria-describedby={showError ? errorId : undefined}\n onClick={() => {\n if (draft.mode === 'relative') apply({ mode: 'relative', amount: draft.amount, unit: draft.unit });\n else if (startAt && endAt && !error) apply({ mode: 'absolute', start: startAt, end: endAt });\n }}\n className={cn('min-w-20')}\n >\n {t('timeRange.apply')}\n </Button>\n </div>\n </div>\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'DateTimeRangePicker',\n group: 'Forms',\n status: 'beta',\n description:\n 'Time range field for logs and metrics: quick presets (last 15 minutes, 1 hour, 24 hours, 7 days, 30 days, custom), a relative \"Last N minutes/hours/days\" mode and an absolute mode with a range Calendar plus start and end TimePickers, validated so the end is after the start. The value is serialisable: `{ mode: \"relative\", amount, unit }` or `{ mode: \"absolute\", start, end }`; `resolveTimeRange` turns it into instants.',\n primitive: '@base-ui/react/popover + Calendar, TimePicker, NumberInput, Select, ToggleGroup',\n pattern: 'combobox with a dialog popup',\n keyboard: [\n ['Enter / Space', 'On the field: opens the popup with focus on the active preset'],\n ['Tab / Shift+Tab', 'Moves through presets, the mode switch, the editors and Apply'],\n [\n 'Enter / Space',\n 'On a preset: applies it and closes; on Custom range: switches to absolute mode and focuses the calendar',\n ],\n ['ArrowLeft / ArrowRight', 'In the mode switch: moves between Relative and Absolute'],\n [\n 'Arrow keys / PageUp / PageDown',\n 'In the calendar: move between days (see Calendar); in the time fields: spin (see TimePicker)',\n ],\n ['Escape', 'Closes the popup without applying and returns focus to the field'],\n ],\n tokens: [\n 'background',\n 'border',\n 'foreground',\n 'muted-foreground',\n 'popover',\n 'primary',\n 'primary-chip-text',\n 'secondary',\n 'destructive-text',\n 'focus-ring',\n ],\n};\n","import { Dialog as BaseDialog } from '@base-ui/react/dialog';\nimport { X } from 'lucide-react';\nimport type { HTMLAttributes, ReactNode } from 'react';\nimport { usePortalDir, useI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { dialogVariants, type DialogVariantProps } from './dialog.variants';\n\nconst s = dialogVariants();\n\n/** Dialog state container (open, defaultOpen, onOpenChange, modal). Renders no element. */\nexport const Dialog = BaseDialog.Root;\n/** Opens the dialog. Use `render={<Button />}` to style it as a kit button. */\nexport const DialogTrigger = BaseDialog.Trigger;\n/** Closes the dialog. Use `render={<Button variant=\"ghost\" />}` for footer actions. */\nexport const DialogClose = BaseDialog.Close;\n\nexport interface DialogContentProps extends Omit<BaseDialog.Popup.Props, 'className'>, DialogVariantProps {\n className?: string;\n /** Show the top-right close button. */\n showClose?: boolean;\n /** Accessible name of the close button. */\n closeLabel?: string;\n /** Portal container; defaults to document.body. */\n container?: BaseDialog.Portal.Props['container'];\n children?: ReactNode;\n}\n\n/**\n * The modal surface: portal, backdrop, scrollable viewport and popup. Focus is trapped\n * inside, Escape and an outside press close it, and focus returns to the trigger.\n */\nexport function DialogContent({\n size,\n presentation,\n className,\n showClose = true,\n closeLabel: closeLabelProp,\n container,\n children,\n ...props\n}: DialogContentProps) {\n const { t } = useI18n();\n const closeLabel = closeLabelProp ?? t('common.close');\n const dir = usePortalDir();\n const v = dialogVariants({ size, presentation });\n return (\n <BaseDialog.Portal container={container}>\n <BaseDialog.Backdrop className={v.backdrop()} />\n <BaseDialog.Viewport dir={dir} className={v.viewport()}>\n <BaseDialog.Popup className={cn(v.popup(), className)} {...props}>\n {children}\n {showClose && (\n <BaseDialog.Close aria-label={closeLabel} className={v.close()}>\n <X size={16} aria-hidden />\n </BaseDialog.Close>\n )}\n </BaseDialog.Popup>\n </BaseDialog.Viewport>\n </BaseDialog.Portal>\n );\n}\n\nexport function DialogHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return <div className={cn(s.header(), className)} {...props} />;\n}\n\nexport function DialogTitle({\n className,\n ...props\n}: Omit<BaseDialog.Title.Props, 'className'> & { className?: string }) {\n return <BaseDialog.Title className={cn(s.title(), className)} {...props} />;\n}\n\nexport function DialogDescription({\n className,\n ...props\n}: Omit<BaseDialog.Description.Props, 'className'> & { className?: string }) {\n return <BaseDialog.Description className={cn(s.description(), className)} {...props} />;\n}\n\nexport function DialogBody({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return <div className={cn(s.body(), className)} {...props} />;\n}\n\nexport function DialogFooter({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return <div className={cn(s.footer(), className)} {...props} />;\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Dialog',\n group: 'Overlays',\n status: 'stable',\n description:\n 'Modal window for focused tasks: forms, details, confirmations. Compound parts (Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogBody, DialogFooter, DialogClose) in four sizes.',\n primitive: '@base-ui/react/dialog',\n pattern: 'dialog (modal)',\n keyboard: [\n ['Enter / Space', 'On the trigger: opens the dialog and moves focus inside'],\n ['Tab / Shift+Tab', 'Cycles focus within the dialog (focus is trapped)'],\n ['Escape', 'Closes the dialog and returns focus to the trigger'],\n ],\n tokens: ['popover', 'popover-foreground', 'border', 'background', 'muted-foreground', 'focus-ring'],\n};\n","/**\n * Line and word diffs (Myers O(ND), no dependencies) plus the view model DiffViewer renders:\n * hunks with collapsed unchanged runs, and removed/added line pairs for split view and word\n * highlights.\n */\n\nexport type DiffLineType = 'unchanged' | 'added' | 'removed';\n\nexport interface DiffLine {\n type: DiffLineType;\n text: string;\n /** 1-based line number in the old text (unchanged and removed lines). */\n oldLine?: number;\n /** 1-based line number in the new text (unchanged and added lines). */\n newLine?: number;\n}\n\nexport interface DiffLinesOptions {\n /** Treat lines that differ only in whitespace as unchanged (the new text is shown). */\n ignoreWhitespace?: boolean;\n /** Compare case-insensitively. */\n ignoreCase?: boolean;\n}\n\ntype Edit = { op: '=' | '-' | '+'; a: number; b: number };\n\n/** Above this many trace cells, Myers gives up and reports the middle as replaced. */\nconst MAX_TRACE_CELLS = 20_000_000;\n\n/** Shortest edit script between two id sequences (Myers' greedy algorithm with backtracking). */\nfunction myers(a: Int32Array, b: Int32Array): Edit[] {\n let start = 0;\n let endA = a.length;\n let endB = b.length;\n while (start < endA && start < endB && a[start] === b[start]) start++;\n while (endA > start && endB > start && a[endA - 1] === b[endB - 1]) {\n endA--;\n endB--;\n }\n const head: Edit[] = [];\n for (let i = 0; i < start; i++) head.push({ op: '=', a: i, b: i });\n const tail: Edit[] = [];\n for (let i = 0; endA + i < a.length; i++) tail.push({ op: '=', a: endA + i, b: endB + i });\n\n const n = endA - start;\n const m = endB - start;\n const max = n + m;\n const off = max + 1;\n const middle: Edit[] = [];\n if (n === 0 || m === 0) {\n for (let i = 0; i < n; i++) middle.push({ op: '-', a: start + i, b: -1 });\n for (let j = 0; j < m; j++) middle.push({ op: '+', a: -1, b: start + j });\n return [...head, ...middle, ...tail];\n }\n\n const v = new Int32Array(2 * max + 2);\n const trace: Int32Array[] = [];\n let found = false;\n for (let d = 0; d <= max && !found; d++) {\n if ((d + 1) * v.length > MAX_TRACE_CELLS) break;\n trace.push(v.slice());\n for (let k = -d; k <= d; k += 2) {\n let x = k === -d || (k !== d && v[k - 1 + off]! < v[k + 1 + off]!) ? v[k + 1 + off]! : v[k - 1 + off]! + 1;\n let y = x - k;\n while (x < n && y < m && a[start + x] === b[start + y]) {\n x++;\n y++;\n }\n v[k + off] = x;\n if (x >= n && y >= m) {\n found = true;\n break;\n }\n }\n }\n\n if (!found) {\n for (let i = 0; i < n; i++) middle.push({ op: '-', a: start + i, b: -1 });\n for (let j = 0; j < m; j++) middle.push({ op: '+', a: -1, b: start + j });\n return [...head, ...middle, ...tail];\n }\n\n let x = n;\n let y = m;\n for (let d = trace.length - 1; d >= 0; d--) {\n const vd = trace[d]!;\n const k = x - y;\n const prevK = k === -d || (k !== d && vd[k - 1 + off]! < vd[k + 1 + off]!) ? k + 1 : k - 1;\n const prevX = vd[prevK + off]!;\n const prevY = prevX - prevK;\n while (x > prevX && y > prevY) {\n x--;\n y--;\n middle.push({ op: '=', a: start + x, b: start + y });\n }\n if (d > 0) {\n if (x === prevX) middle.push({ op: '+', a: -1, b: start + y - 1 });\n else middle.push({ op: '-', a: start + x - 1, b: -1 });\n }\n x = prevX;\n y = prevY;\n }\n middle.reverse();\n return [...head, ...middle, ...tail];\n}\n\n/** Maps each distinct (normalised) token to an integer so comparisons are cheap. */\nfunction toIds(lists: [string[], string[]], normalise: (s: string) => string): [Int32Array, Int32Array] {\n const ids = new Map<string, number>();\n const encode = (list: string[]) =>\n Int32Array.from(list, (item) => {\n const key = normalise(item);\n let id = ids.get(key);\n if (id === undefined) {\n id = ids.size;\n ids.set(key, id);\n }\n return id;\n });\n return [encode(lists[0]), encode(lists[1])];\n}\n\n/** Splits text into lines; a single trailing newline does not add an empty line. */\nexport function splitLines(text: string): string[] {\n if (!text) return [];\n const lines = text.split(/\\r?\\n/);\n if (lines[lines.length - 1] === '') lines.pop();\n return lines;\n}\n\n/**\n * Line diff of two texts. Within each changed block, removed lines come before added ones.\n * Pure: safe to call on the server or in a worker.\n */\nexport function diffLines(\n oldText: string,\n newText: string,\n { ignoreWhitespace = false, ignoreCase = false }: DiffLinesOptions = {},\n): DiffLine[] {\n const a = splitLines(oldText);\n const b = splitLines(newText);\n const normalise = (s: string) => {\n let out = ignoreWhitespace ? s.replace(/\\s+/g, ' ').trim() : s;\n if (ignoreCase) out = out.toLowerCase();\n return out;\n };\n const [ia, ib] = toIds([a, b], normalise);\n const out: DiffLine[] = [];\n let removed: DiffLine[] = [];\n let added: DiffLine[] = [];\n const flush = () => {\n out.push(...removed, ...added);\n removed = [];\n added = [];\n };\n for (const e of myers(ia, ib)) {\n if (e.op === '=') {\n flush();\n out.push({ type: 'unchanged', text: b[e.b]!, oldLine: e.a + 1, newLine: e.b + 1 });\n } else if (e.op === '-') removed.push({ type: 'removed', text: a[e.a]!, oldLine: e.a + 1 });\n else added.push({ type: 'added', text: b[e.b]!, newLine: e.b + 1 });\n }\n flush();\n return out;\n}\n\nexport interface WordSegment {\n text: string;\n changed: boolean;\n}\n\nconst WORD_RE = /\\s+|[\\p{L}\\p{N}_]+|[^\\s\\p{L}\\p{N}_]/gu;\n\n/** Word-level diff of two lines: the segments of each side, with changed runs marked. */\nexport function diffWords(oldLine: string, newLine: string): { old: WordSegment[]; new: WordSegment[] } {\n const a = oldLine.match(WORD_RE) ?? [];\n const b = newLine.match(WORD_RE) ?? [];\n const [ia, ib] = toIds([a, b], (s) => s);\n const left: WordSegment[] = [];\n const right: WordSegment[] = [];\n const push = (list: WordSegment[], text: string, changed: boolean) => {\n const last = list[list.length - 1];\n if (last && last.changed === changed) last.text += text;\n else list.push({ text, changed });\n };\n for (const e of myers(ia, ib)) {\n if (e.op === '=') {\n push(left, a[e.a]!, false);\n push(right, b[e.b]!, false);\n } else if (e.op === '-') push(left, a[e.a]!, true);\n else push(right, b[e.b]!, true);\n }\n return { old: left, new: right };\n}\n\n/** True when two lines share enough text for word highlights to help (≥ 40% unchanged). */\nexport function worthWordDiff(segments: { old: WordSegment[]; new: WordSegment[] }): boolean {\n const same = (list: WordSegment[]) => list.reduce((n, s) => n + (s.changed ? 0 : s.text.trim().length), 0);\n const total = (list: WordSegment[]) => list.reduce((n, s) => n + s.text.trim().length, 0);\n const shorter = Math.min(total(segments.old), total(segments.new));\n return shorter > 0 && Math.min(same(segments.old), same(segments.new)) / shorter >= 0.4;\n}\n\nfunction sortKeys(value: unknown): unknown {\n if (Array.isArray(value)) return value.map(sortKeys);\n if (value && typeof value === 'object' && Object.getPrototypeOf(value) === Object.prototype) {\n const out: Record<string, unknown> = {};\n for (const key of Object.keys(value).sort()) out[key] = sortKeys((value as Record<string, unknown>)[key]);\n return out;\n }\n return value;\n}\n\n/** Pretty-printed JSON (2 spaces) with object keys sorted, so key order never shows as a change. */\nexport function stableStringify(value: unknown): string {\n if (value === undefined) return '';\n return JSON.stringify(sortKeys(value), null, 2) ?? '';\n}\n\n/** Diff of two JSON values (or JSON strings), compared as stable pretty-printed text. */\nexport function diffJson(oldValue: unknown, newValue: unknown, options?: DiffLinesOptions): DiffLine[] {\n return diffLines(toJsonText(oldValue), toJsonText(newValue), options);\n}\n\n/** A value as stable JSON text; strings are parsed first and left as they are if not JSON. */\nexport function toJsonText(value: unknown): string {\n if (typeof value !== 'string') return stableStringify(value);\n try {\n return stableStringify(JSON.parse(value));\n } catch {\n return value;\n }\n}\n\n/** Counts of added and removed lines. */\nexport function diffStats(lines: readonly DiffLine[]): { added: number; removed: number } {\n let added = 0;\n let removed = 0;\n for (const line of lines) {\n if (line.type === 'added') added++;\n else if (line.type === 'removed') removed++;\n }\n return { added, removed };\n}\n","import { diffWords, worthWordDiff, type DiffLine, type WordSegment } from './diff';\n\n/** A line plus its word segments when it is paired with a counterpart. */\nexport interface ViewLine extends DiffLine {\n index: number;\n words?: WordSegment[];\n}\n\n/** One rendered row: a line pair (split), a single line (unified) or a collapsed run. */\nexport type ViewItem =\n | { kind: 'lines'; key: string; left?: ViewLine; right?: ViewLine; line?: ViewLine }\n | { kind: 'collapsed'; key: string; count: number };\n\n/** Adds word segments to removed/added lines paired by position within each changed block. */\nexport function pairLines(\n lines: readonly DiffLine[],\n wordDiff: boolean,\n): { lines: ViewLine[]; pairs: Map<number, number> } {\n const out: ViewLine[] = lines.map((line, index) => ({ ...line, index }));\n const pairs = new Map<number, number>();\n let i = 0;\n while (i < out.length) {\n if (out[i]!.type === 'unchanged') {\n i++;\n continue;\n }\n const removed: number[] = [];\n const added: number[] = [];\n while (i < out.length && out[i]!.type === 'removed') removed.push(i++);\n while (i < out.length && out[i]!.type === 'added') added.push(i++);\n for (let p = 0; p < Math.min(removed.length, added.length); p++) {\n const r = removed[p]!;\n const a = added[p]!;\n pairs.set(r, a);\n if (!wordDiff) continue;\n const segments = diffWords(out[r]!.text, out[a]!.text);\n if (!worthWordDiff(segments)) continue;\n out[r] = { ...out[r]!, words: segments.old };\n out[a] = { ...out[a]!, words: segments.new };\n }\n }\n return { lines: out, pairs };\n}\n\n/**\n * Ranges of unchanged lines to hide: runs longer than `context` lines on each side of a change\n * (only one side at the start or end of the file). Returns [start, end) index ranges.\n */\nexport function collapsibleRanges(lines: readonly DiffLine[], context: number, minHidden = 2): Array<[number, number]> {\n const ranges: Array<[number, number]> = [];\n if (!Number.isFinite(context)) return ranges;\n let i = 0;\n while (i < lines.length) {\n if (lines[i]!.type !== 'unchanged') {\n i++;\n continue;\n }\n const start = i;\n while (i < lines.length && lines[i]!.type === 'unchanged') i++;\n const from = start === 0 ? start : start + context;\n const to = i === lines.length ? i : i - context;\n if (to - from >= minHidden) ranges.push([from, to]);\n }\n return ranges;\n}\n\n/** Rows for the unified view. */\nexport function unifiedItems(lines: readonly ViewLine[], hidden: ReadonlyArray<[number, number]>): ViewItem[] {\n const items: ViewItem[] = [];\n let r = 0;\n for (let i = 0; i < lines.length; i++) {\n const range = hidden[r];\n if (range && i === range[0]) {\n items.push({ kind: 'collapsed', key: `c${range[0]}`, count: range[1] - range[0] });\n i = range[1] - 1;\n r++;\n continue;\n }\n items.push({ kind: 'lines', key: `l${i}`, line: lines[i]! });\n }\n return items;\n}\n\n/** Rows for the split view: unchanged lines on both sides, removed left and added right. */\nexport function splitItems(lines: readonly ViewLine[], hidden: ReadonlyArray<[number, number]>): ViewItem[] {\n const items: ViewItem[] = [];\n let r = 0;\n let i = 0;\n while (i < lines.length) {\n const range = hidden[r];\n if (range && i === range[0]) {\n items.push({ kind: 'collapsed', key: `c${range[0]}`, count: range[1] - range[0] });\n i = range[1];\n r++;\n continue;\n }\n const line = lines[i]!;\n if (line.type === 'unchanged') {\n items.push({ kind: 'lines', key: `l${i}`, left: line, right: line });\n i++;\n continue;\n }\n const removed: ViewLine[] = [];\n const added: ViewLine[] = [];\n while (i < lines.length && lines[i]!.type === 'removed') removed.push(lines[i++]!);\n while (i < lines.length && lines[i]!.type === 'added') added.push(lines[i++]!);\n for (let p = 0; p < Math.max(removed.length, added.length); p++) {\n const left = removed[p];\n const right = added[p];\n items.push({ kind: 'lines', key: `p${(left ?? right)!.index}`, left, right });\n }\n }\n return items;\n}\n","import { tv, type VariantProps } from '../../utils/tv';\n\n/** Line styling never relies on colour alone: every changed line also has a +/− marker and screen-reader text. */\nexport const diffViewerVariants = tv({\n slots: {\n root: 'flex min-w-0 flex-col overflow-hidden rounded-lg border border-border bg-card text-foreground',\n header: 'flex flex-wrap items-center gap-x-3 gap-y-2 border-b border-border px-3 py-2',\n labels: 'flex min-w-0 flex-1 items-center gap-2 font-mono text-[12px] text-muted-foreground',\n label: 'truncate text-foreground',\n arrow: 'shrink-0 rtl:-scale-x-100',\n stats: 'flex shrink-0 items-center gap-2 font-mono text-[12px] font-medium',\n statAdded: 'text-success-text',\n statRemoved: 'text-destructive-text',\n columns: 'grid grid-cols-2 border-b border-border font-mono text-[11.5px] text-muted-foreground',\n column: 'truncate px-3 py-1.5 first:border-e first:border-border',\n body: 'overflow-auto font-mono text-[12px] leading-5 outline-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus-ring',\n row: 'grid min-w-0',\n unifiedRow: 'grid-cols-[auto_auto_1.25rem_minmax(0,1fr)]',\n splitRow: 'grid-cols-2',\n half: 'grid min-w-0 grid-cols-[auto_1.25rem_minmax(0,1fr)] first:border-e first:border-border',\n number: 'px-2 text-end text-muted-foreground tabular-nums select-none',\n marker: 'text-center select-none',\n code: 'min-w-0 pe-3 break-words whitespace-pre-wrap',\n word: 'rounded-sm',\n empty: 'bg-secondary/40',\n collapsed: 'flex items-center border-y border-border bg-secondary/40 px-1 py-0.5',\n noChanges: 'px-3 py-2 font-sans text-[12.5px] text-muted-foreground',\n },\n variants: {\n type: {\n unchanged: {},\n added: {\n row: 'bg-success/10',\n half: 'bg-success/10',\n number: 'bg-success/15',\n marker: 'text-success-text',\n word: 'bg-success/30',\n },\n removed: {\n row: 'bg-destructive/10',\n half: 'bg-destructive/10',\n number: 'bg-destructive/15',\n marker: 'text-destructive-text',\n word: 'bg-destructive/30',\n },\n },\n },\n defaultVariants: { type: 'unchanged' },\n});\n\nexport type DiffViewerVariantProps = VariantProps<typeof diffViewerVariants>;\n","import { ArrowRight, ChevronsUpDown } from 'lucide-react';\nimport { useMemo, useRef, useState, type ReactNode, type Ref } from 'react';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { Button } from '../Button';\nimport { Toggle, ToggleGroup } from '../ToggleGroup';\nimport { diffLines, diffStats, toJsonText, type DiffLinesOptions } from './diff';\nimport { collapsibleRanges, pairLines, splitItems, unifiedItems, type ViewLine } from './diff-view';\nimport { diffViewerVariants } from './diff-viewer.variants';\n\nexport type DiffMode = 'split' | 'unified';\n\nexport interface DiffViewerProps extends DiffLinesOptions {\n /** The old text, or any JSON value when `format=\"json\"`. */\n oldValue: unknown;\n /** The new text, or any JSON value when `format=\"json\"`. */\n newValue: unknown;\n /** `json` pretty-prints both sides with sorted keys before diffing (strings are parsed). */\n format?: 'text' | 'json';\n /** Layout (controlled). */\n mode?: DiffMode;\n defaultMode?: DiffMode;\n onModeChange?: (mode: DiffMode) => void;\n /** Show the split / unified switch (default true). */\n showModeToggle?: boolean;\n /** File or version labels for each side, e.g. \"config.yaml · v3\". */\n oldLabel?: ReactNode;\n newLabel?: ReactNode;\n /** Unchanged lines kept around each change; longer runs collapse behind \"Expand N lines\". `Infinity` shows everything. Default 3. */\n context?: number;\n /** Highlight changed words inside paired lines (default true). */\n wordDiff?: boolean;\n showLineNumbers?: boolean;\n /** Max height of the scrolling body (any CSS length). */\n maxHeight?: number | string;\n /** Accessible name of the scrolling region. Defaults to \"Diff\". */\n 'aria-label'?: string;\n className?: string;\n ref?: Ref<HTMLDivElement>;\n}\n\n/**\n * Compares two texts (or JSON values) line by line, in split or unified layout. Changed lines\n * carry +/− markers and screen-reader text, not just a tint; paired lines get word-level\n * highlights; long unchanged runs collapse behind an \"Expand N lines\" button.\n */\nexport function DiffViewer({\n oldValue,\n newValue,\n format = 'text',\n mode: modeProp,\n defaultMode = 'unified',\n onModeChange,\n showModeToggle = true,\n oldLabel,\n newLabel,\n context = 3,\n wordDiff = true,\n showLineNumbers = true,\n ignoreWhitespace,\n ignoreCase,\n maxHeight,\n 'aria-label': ariaLabel,\n className,\n ref,\n}: DiffViewerProps) {\n const { t } = useI18n();\n const [innerMode, setInnerMode] = useState<DiffMode>(defaultMode);\n const [expanded, setExpanded] = useState<ReadonlySet<number>>(() => new Set());\n const bodyRef = useRef<HTMLDivElement>(null);\n const mode = modeProp ?? innerMode;\n const s = diffViewerVariants();\n\n const lines = useMemo(() => {\n const toText = (v: unknown) => (format === 'json' ? toJsonText(v) : typeof v === 'string' ? v : String(v ?? ''));\n return diffLines(toText(oldValue), toText(newValue), { ignoreWhitespace, ignoreCase });\n }, [oldValue, newValue, format, ignoreWhitespace, ignoreCase]);\n const view = useMemo(() => pairLines(lines, wordDiff).lines, [lines, wordDiff]);\n const stats = useMemo(() => diffStats(lines), [lines]);\n const hidden = useMemo(\n () => collapsibleRanges(lines, context).filter(([start]) => !expanded.has(start)),\n [lines, context, expanded],\n );\n const items = useMemo(\n () => (mode === 'split' ? splitItems(view, hidden) : unifiedItems(view, hidden)),\n [mode, view, hidden],\n );\n\n const digits = String(Math.max(1, ...lines.map((l) => Math.max(l.oldLine ?? 0, l.newLine ?? 0)))).length;\n const numberStyle = { minWidth: `calc(${digits}ch + 1rem)` };\n\n const setMode = (next: DiffMode) => {\n setInnerMode(next);\n onModeChange?.(next);\n };\n\n const expand = (start: number) => {\n setExpanded((prev) => new Set(prev).add(start));\n bodyRef.current?.focus();\n };\n\n const srPrefix = (line: ViewLine) =>\n line.type === 'added'\n ? t('diff.addedLine', { line: line.newLine ?? '' })\n : line.type === 'removed'\n ? t('diff.removedLine', { line: line.oldLine ?? '' })\n : '';\n\n const code = (line: ViewLine) => {\n const v = diffViewerVariants({ type: line.type });\n const prefix = srPrefix(line);\n return (\n <span className={s.code()}>\n {prefix && <span className=\"sr-only\">{prefix} </span>}\n {line.words\n ? line.words.map((w, i) =>\n w.changed ? (\n <span key={i} className={v.word()} data-changed=\"\">\n {w.text}\n </span>\n ) : (\n w.text\n ),\n )\n : line.text || ''}\n </span>\n );\n };\n\n const marker = (line: ViewLine) => (\n <span aria-hidden className={diffViewerVariants({ type: line.type }).marker()}>\n {line.type === 'added' ? '+' : line.type === 'removed' ? '−' : ' '}\n </span>\n );\n\n const number = (value: number | undefined, line: ViewLine) =>\n showLineNumbers ? (\n <span aria-hidden className={diffViewerVariants({ type: line.type }).number()} style={numberStyle}>\n {value ?? ''}\n </span>\n ) : (\n <span aria-hidden />\n );\n\n // The new side of an unchanged row repeats the old one, so screen readers skip it.\n const half = (line: ViewLine | undefined, side: 'old' | 'new') => {\n if (!line) return <div className={cn(s.half(), s.empty())} />;\n const type = line.type;\n return (\n <div\n className={diffViewerVariants({ type }).half()}\n data-type={type}\n aria-hidden={side === 'new' && type === 'unchanged' ? true : undefined}\n >\n {number(side === 'old' ? line.oldLine : line.newLine, line)}\n {marker(line)}\n {code(line)}\n </div>\n );\n };\n\n const hasChanges = stats.added + stats.removed > 0;\n const labels = oldLabel != null || newLabel != null;\n\n return (\n <div ref={ref} className={cn(s.root(), className)} data-mode={mode}>\n <div className={s.header()}>\n <div className={s.labels()}>\n {labels && mode === 'unified' && (\n <>\n <span className={s.label()}>\n <span className=\"sr-only\">{t('diff.old')}: </span>\n {oldLabel}\n </span>\n <ArrowRight size={13} aria-hidden className={s.arrow()} />\n <span className={s.label()}>\n <span className=\"sr-only\">{t('diff.new')}: </span>\n {newLabel}\n </span>\n </>\n )}\n </div>\n <div className={s.stats()}>\n <span className={s.statAdded()}>\n <span aria-hidden>+{stats.added}</span>\n <span className=\"sr-only\">{t('diff.additions', { count: stats.added })}</span>\n </span>\n <span className={s.statRemoved()}>\n <span aria-hidden>−{stats.removed}</span>\n <span className=\"sr-only\">{t('diff.deletions', { count: stats.removed })}</span>\n </span>\n </div>\n {showModeToggle && (\n <ToggleGroup\n aria-label={t('diff.view')}\n size=\"sm\"\n value={[mode]}\n onValueChange={(v) => v[0] && setMode(v[0] as DiffMode)}\n >\n <Toggle value=\"unified\">{t('diff.unified')}</Toggle>\n <Toggle value=\"split\">{t('diff.split')}</Toggle>\n </ToggleGroup>\n )}\n </div>\n {mode === 'split' && labels && (\n <div className={s.columns()}>\n <span className={s.column()}>\n <span className=\"sr-only\">{t('diff.old')}: </span>\n {oldLabel}\n </span>\n <span className={s.column()}>\n <span className=\"sr-only\">{t('diff.new')}: </span>\n {newLabel}\n </span>\n </div>\n )}\n <div\n ref={bodyRef}\n role=\"region\"\n aria-label={ariaLabel ?? t('diff.label')}\n tabIndex={0}\n className={s.body()}\n style={maxHeight != null ? { maxHeight } : undefined}\n >\n {!hasChanges && <p className={s.noChanges()}>{t('diff.noChanges')}</p>}\n {items.map((item) => {\n if (item.kind === 'collapsed') {\n const start = Number(item.key.slice(1));\n return (\n <div key={item.key} className={s.collapsed()}>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n icon={ChevronsUpDown}\n className=\"h-6 font-sans text-[12px]\"\n onClick={() => expand(start)}\n >\n {t('diff.expand', { count: item.count })}\n </Button>\n </div>\n );\n }\n if (item.line) {\n const line = item.line;\n return (\n <div\n key={item.key}\n className={cn(s.row(), s.unifiedRow(), diffViewerVariants({ type: line.type }).row())}\n data-type={line.type}\n >\n {number(line.oldLine, line)}\n {number(line.newLine, line)}\n {marker(line)}\n {code(line)}\n </div>\n );\n }\n const isUnchanged = item.left?.type === 'unchanged';\n return (\n <div key={item.key} className={cn(s.row(), s.splitRow())} data-type={isUnchanged ? 'unchanged' : 'changed'}>\n {half(item.left, 'old')}\n {half(item.right, 'new')}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'DiffViewer',\n group: 'Display',\n status: 'beta',\n description:\n 'Compares two texts, or two JSON values pretty-printed with sorted keys, line by line (Myers diff, no dependencies). Split or unified layout with a switch, line numbers, added/removed tints plus +/− markers and screen-reader text (never colour alone), word-level highlights inside paired lines, long unchanged runs collapsed behind \"Expand N lines\", +/− stats and optional file or version labels. The pure `diffLines`, `diffWords`, `diffJson` and `stableStringify` are exported.',\n primitive: '@base-ui/react/toggle-group',\n pattern: 'region + toggle group',\n keyboard: [\n ['Tab', 'Moves to the view switch, the scrollable diff region and each \"Expand N lines\" button'],\n ['ArrowLeft / ArrowRight', 'In the view switch: moves between Unified and Split'],\n ['Enter / Space', 'In the view switch: selects the layout'],\n ['Enter / Space', 'On \"Expand N lines\": reveals the hidden lines and focuses the diff region'],\n ['ArrowUp / ArrowDown', 'In the focused region: scrolls the diff'],\n ],\n tokens: [\n 'card',\n 'border',\n 'foreground',\n 'muted-foreground',\n 'secondary',\n 'success',\n 'success-text',\n 'destructive',\n 'destructive-text',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const drawerVariants = tv({\n slots: {\n backdrop: [\n 'fixed inset-0 z-50 bg-background/70 backdrop-blur-[3px] transition-opacity duration-300 motion-reduce:transition-none',\n 'opacity-[calc(1-var(--drawer-swipe-progress,0))] data-swiping:duration-0',\n 'data-starting-style:opacity-0 data-ending-style:opacity-0',\n ],\n viewport: 'fixed inset-0 z-50 flex',\n popup: [\n 'relative flex flex-col border-border bg-popover text-popover-foreground shadow-lg outline-none',\n 'transition-transform duration-300 ease-out motion-reduce:transition-none data-swiping:duration-0 data-swiping:select-none',\n ],\n content: 'flex min-h-0 flex-1 flex-col',\n handle: 'mx-auto mt-2.5 h-1 w-10 shrink-0 rounded-full bg-border',\n close: [\n 'absolute top-3.5 end-3.5 grid size-8 place-items-center rounded-lg text-muted-foreground transition-colors',\n 'hover:bg-secondary/60 hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n header: 'flex shrink-0 flex-col gap-0.5 border-b border-border px-5 py-4 pe-14',\n title: 'text-[15px] font-semibold tracking-tight text-foreground',\n description: 'text-[12px] text-muted-foreground text-pretty',\n body: 'min-h-0 flex-1 overflow-y-auto overscroll-contain px-5 py-5',\n footer: 'flex shrink-0 items-center justify-end gap-2.5 border-t border-border px-5 py-4',\n },\n variants: {\n side: {\n right: {\n viewport: 'items-stretch justify-end',\n popup: [\n 'h-full max-w-[88vw] border-s',\n '[transform:translateX(var(--drawer-swipe-movement-x,0px))]',\n 'data-starting-style:[transform:translateX(100%)] data-ending-style:[transform:translateX(100%)]',\n 'rtl:data-starting-style:[transform:translateX(-100%)] rtl:data-ending-style:[transform:translateX(-100%)]',\n ],\n },\n left: {\n viewport: 'items-stretch justify-start',\n popup: [\n 'h-full max-w-[88vw] border-e',\n '[transform:translateX(var(--drawer-swipe-movement-x,0px))]',\n 'data-starting-style:[transform:translateX(-100%)] data-ending-style:[transform:translateX(-100%)]',\n 'rtl:data-starting-style:[transform:translateX(100%)] rtl:data-ending-style:[transform:translateX(100%)]',\n ],\n },\n bottom: {\n viewport: 'items-end justify-center',\n popup: [\n 'w-full rounded-t-xl border-t',\n '[transform:translateY(var(--drawer-swipe-movement-y,0px))]',\n 'data-starting-style:[transform:translateY(100%)] data-ending-style:[transform:translateY(100%)]',\n ],\n },\n },\n size: { sm: {}, md: {}, lg: {} },\n },\n compoundVariants: [\n { side: ['left', 'right'], size: 'sm', class: { popup: 'w-[284px]' } },\n { side: ['left', 'right'], size: 'md', class: { popup: 'w-[404px]' } },\n { side: ['left', 'right'], size: 'lg', class: { popup: 'w-[560px]' } },\n { side: 'bottom', size: 'sm', class: { popup: 'max-h-[40vh]' } },\n { side: 'bottom', size: 'md', class: { popup: 'max-h-[60vh]' } },\n { side: 'bottom', size: 'lg', class: { popup: 'max-h-[88vh]' } },\n ],\n defaultVariants: { side: 'right', size: 'md' },\n});\n\nexport type DrawerVariantProps = VariantProps<typeof drawerVariants>;\n","import { Drawer as BaseDrawer } from '@base-ui/react/drawer';\nimport { X } from 'lucide-react';\nimport { createContext, useContext, type HTMLAttributes, type ReactNode } from 'react';\nimport { useI18n, usePortalDir } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { drawerVariants, type DrawerVariantProps } from './drawer.variants';\n\nexport type DrawerSide = NonNullable<DrawerVariantProps['side']>;\n\nconst s = drawerVariants();\ntype Swipe = BaseDrawer.Root.Props['swipeDirection'];\n// `left` / `right` are the inline start / end edges: in RTL they mirror (and so does the swipe).\nconst SWIPE: Record<'ltr' | 'rtl', Record<DrawerSide, Swipe>> = {\n ltr: { right: 'right', left: 'left', bottom: 'down' },\n rtl: { right: 'left', left: 'right', bottom: 'down' },\n};\nconst SideContext = createContext<DrawerSide>('right');\n\nexport interface DrawerProps extends Omit<BaseDrawer.Root.Props, 'swipeDirection'> {\n /**\n * Edge the panel slides in from; it is also the swipe-to-dismiss direction. `right` and `left`\n * are the inline end and start edges, so they mirror under RTL (I18nProvider `dir`).\n */\n side?: DrawerSide;\n}\n\n/** Drawer state container (open, defaultOpen, onOpenChange, modal). Renders no element. */\nexport function Drawer({ side = 'right', ...props }: DrawerProps) {\n const { dir } = useI18n();\n return (\n <SideContext.Provider value={side}>\n <BaseDrawer.Root swipeDirection={SWIPE[dir][side]} {...props} />\n </SideContext.Provider>\n );\n}\n\n/** Opens the drawer. Use `render={<Button />}` to style it as a kit button. */\nexport const DrawerTrigger = BaseDrawer.Trigger;\n/** Closes the drawer. Use `render={<Button variant=\"ghost\" />}` for footer actions. */\nexport const DrawerClose = BaseDrawer.Close;\n\nexport interface DrawerContentProps extends Omit<BaseDrawer.Popup.Props, 'className'> {\n className?: string;\n /** Panel width (left/right) or max height (bottom). */\n size?: DrawerVariantProps['size'];\n /** Show the top-right close button. */\n showClose?: boolean;\n /** Accessible name of the close button (default: the catalog's \"Close\"). */\n closeLabel?: string;\n /** Portal container; defaults to document.body. */\n container?: BaseDrawer.Portal.Props['container'];\n children?: ReactNode;\n}\n\n/**\n * The panel: portal, backdrop, viewport and popup sliding in from the Drawer's `side`.\n * Focus is trapped inside, Escape, an outside press or a swipe close it, and focus returns\n * to the trigger. Lay out the inside with DrawerHeader, DrawerBody and DrawerFooter.\n */\nexport function DrawerContent({\n size,\n className,\n showClose = true,\n closeLabel,\n container,\n children,\n ...props\n}: DrawerContentProps) {\n const dir = usePortalDir();\n const { t } = useI18n();\n const side = useContext(SideContext);\n const v = drawerVariants({ side, size });\n return (\n <BaseDrawer.Portal container={container}>\n <BaseDrawer.Backdrop className={v.backdrop()} />\n <BaseDrawer.Viewport dir={dir} className={v.viewport()}>\n <BaseDrawer.Popup className={cn(v.popup(), className)} {...props}>\n {side === 'bottom' && <div className={v.handle()} aria-hidden />}\n <BaseDrawer.Content className={v.content()}>{children}</BaseDrawer.Content>\n {showClose && (\n <BaseDrawer.Close aria-label={closeLabel ?? t('common.close')} className={v.close()}>\n <X size={16} aria-hidden />\n </BaseDrawer.Close>\n )}\n </BaseDrawer.Popup>\n </BaseDrawer.Viewport>\n </BaseDrawer.Portal>\n );\n}\n\n/** Fixed top bar: title, description and any leading media. */\nexport function DrawerHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return <div className={cn(s.header(), className)} {...props} />;\n}\n\nexport function DrawerTitle({\n className,\n ...props\n}: Omit<BaseDrawer.Title.Props, 'className'> & { className?: string }) {\n return <BaseDrawer.Title className={cn(s.title(), className)} {...props} />;\n}\n\nexport function DrawerDescription({\n className,\n ...props\n}: Omit<BaseDrawer.Description.Props, 'className'> & { className?: string }) {\n return <BaseDrawer.Description className={cn(s.description(), className)} {...props} />;\n}\n\n/** Scrollable middle section. */\nexport function DrawerBody({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return <div className={cn(s.body(), className)} {...props} />;\n}\n\n/** Fixed bottom bar for actions. */\nexport function DrawerFooter({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return <div className={cn(s.footer(), className)} {...props} />;\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Drawer',\n group: 'Overlays',\n status: 'stable',\n description:\n 'Panel that slides in from the right, left or bottom edge for details, edit forms and navigation. Fixed header and footer, scrollable body, swipe to dismiss. Under RTL (I18nProvider) `right` and `left` mirror to the inline end and start. Parts: Drawer, DrawerTrigger, DrawerContent, DrawerHeader, DrawerTitle, DrawerDescription, DrawerBody, DrawerFooter, DrawerClose.',\n primitive: '@base-ui/react/drawer',\n pattern: 'dialog (modal)',\n keyboard: [\n ['Enter / Space', 'On the trigger: opens the drawer and moves focus inside'],\n ['Tab / Shift+Tab', 'Cycles focus within the drawer (focus is trapped)'],\n ['Escape', 'Closes the drawer and returns focus to the trigger'],\n ],\n tokens: ['popover', 'popover-foreground', 'border', 'background', 'muted-foreground', 'secondary', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const emptyStateVariants = tv({\n slots: {\n root: 'mx-auto flex w-full flex-col items-center justify-center text-center',\n icon: 'grid place-items-center bg-secondary/70 text-muted-foreground ring-1 ring-border',\n title: 'font-semibold tracking-tight text-foreground',\n description: 'text-muted-foreground',\n actions: 'flex flex-wrap items-center justify-center gap-2',\n },\n variants: {\n size: {\n sm: {\n root: 'max-w-sm px-4 py-6',\n icon: 'size-10 rounded-xl',\n title: 'mt-3 text-[14px]',\n description: 'mt-1 text-[12.5px] leading-5',\n actions: 'mt-4',\n },\n md: {\n root: 'max-w-md px-6 py-10',\n icon: 'size-12 rounded-2xl',\n title: 'mt-4 text-[15px]',\n description: 'mt-1.5 text-[13px] leading-6',\n actions: 'mt-5',\n },\n lg: {\n root: 'max-w-lg px-6 py-16',\n icon: 'size-14 rounded-2xl',\n title: 'mt-5 text-[17px]',\n description: 'mt-2 text-[14px] leading-6',\n actions: 'mt-6',\n },\n },\n bordered: {\n true: { root: 'max-w-none rounded-lg border border-dashed border-border' },\n },\n },\n defaultVariants: { size: 'md', bordered: false },\n});\n\nexport type EmptyStateVariantProps = VariantProps<typeof emptyStateVariants>;\n\n/** Icon size (px) per empty-state size. */\nexport const EMPTY_STATE_ICON_SIZE = { sm: 18, md: 22, lg: 26 } as const;\n","import type { LucideIcon } from 'lucide-react';\nimport type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { EMPTY_STATE_ICON_SIZE, emptyStateVariants, type EmptyStateVariantProps } from './emptyState.variants';\n\nexport interface EmptyStateProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'title'>, EmptyStateVariantProps {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n /** Neutral icon in a soft halo (a lucide icon component). */\n icon?: LucideIcon;\n title: ReactNode;\n /** Heading level that fits the page outline. */\n titleAs?: 'h2' | 'h3' | 'h4';\n description?: ReactNode;\n /** Main call to action (e.g. a primary Button). */\n primaryAction?: ReactNode;\n /** Secondary action shown after the primary one. */\n secondaryAction?: ReactNode;\n /** Extra content under the actions (templates, links…). */\n children?: ReactNode;\n}\n\n/** Placeholder for a list, table or page with nothing to show yet: why, and what to do next. */\nexport function EmptyState({\n icon: Icon,\n title,\n titleAs: Heading = 'h3',\n description,\n primaryAction,\n secondaryAction,\n size,\n bordered,\n className,\n children,\n ...props\n}: EmptyStateProps) {\n const s = emptyStateVariants({ size, bordered });\n return (\n <div className={cn(s.root(), className)} {...props}>\n {Icon && (\n <div className={s.icon()}>\n <Icon size={EMPTY_STATE_ICON_SIZE[size ?? 'md']} aria-hidden />\n </div>\n )}\n <Heading className={cn(s.title(), !Icon && 'mt-0')}>{title}</Heading>\n {description != null && <p className={s.description()}>{description}</p>}\n {(primaryAction != null || secondaryAction != null) && (\n <div className={s.actions()}>\n {primaryAction}\n {secondaryAction}\n </div>\n )}\n {children}\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'EmptyState',\n group: 'Feedback',\n status: 'stable',\n description:\n 'Placeholder for an empty list, table or page: a neutral icon halo, a title, a short explanation and primary / secondary actions. Three sizes and an optional dashed border.',\n tokens: ['secondary', 'border', 'foreground', 'muted-foreground'],\n};\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Field',\n group: 'Forms',\n status: 'stable',\n description:\n 'Accessible form field scaffolding: Field, FieldLabel, FieldDescription, FieldError and FieldItem wire ids and aria-describedby for any kit control; Fieldset and FieldsetLegend group related fields under one name.',\n primitive: '@base-ui/react/field, @base-ui/react/fieldset',\n pattern: 'form field (label + description + error), fieldset/legend',\n keyboard: [\n ['Click on label', 'Moves focus to the field control'],\n ['Tab', 'Moves focus to the control; its description and error are announced via aria-describedby'],\n ],\n tokens: ['foreground', 'muted-foreground', 'destructive-text'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\n/** Spacing scale steps (Tailwind units of 0.25rem). */\nexport type SpaceScale = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n\n/** Static `gap-*` map so Tailwind sees every class. */\nexport const GAP_CLASSES: Record<SpaceScale, string> = {\n 0: 'gap-0',\n 1: 'gap-1',\n 2: 'gap-2',\n 3: 'gap-3',\n 4: 'gap-4',\n 5: 'gap-5',\n 6: 'gap-6',\n 7: 'gap-7',\n 8: 'gap-8',\n 9: 'gap-9',\n 10: 'gap-10',\n 11: 'gap-11',\n 12: 'gap-12',\n};\n\nexport const stackVariants = tv({\n base: 'flex min-w-0',\n variants: {\n direction: {\n row: 'flex-row',\n column: 'flex-col',\n 'row-reverse': 'flex-row-reverse',\n 'column-reverse': 'flex-col-reverse',\n },\n align: {\n start: 'items-start',\n center: 'items-center',\n end: 'items-end',\n stretch: 'items-stretch',\n baseline: 'items-baseline',\n },\n justify: {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly',\n },\n wrap: {\n true: 'flex-wrap',\n false: 'flex-nowrap',\n },\n inline: {\n true: 'inline-flex',\n },\n },\n defaultVariants: { direction: 'column', wrap: false },\n});\n\nexport const centerVariants = tv({\n base: 'flex items-center justify-center',\n variants: {\n inline: { true: 'inline-flex' },\n },\n});\n\nexport type StackVariantProps = VariantProps<typeof stackVariants>;\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport type GridBreakpoint = 'base' | 'sm' | 'md' | 'lg' | 'xl';\nexport type GridColumns = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n\n/** Static `grid-cols-*` per breakpoint so Tailwind sees every class. */\nexport const GRID_COLS: Record<GridBreakpoint, Record<GridColumns, string>> = {\n base: {\n 1: 'grid-cols-1',\n 2: 'grid-cols-2',\n 3: 'grid-cols-3',\n 4: 'grid-cols-4',\n 5: 'grid-cols-5',\n 6: 'grid-cols-6',\n 7: 'grid-cols-7',\n 8: 'grid-cols-8',\n 9: 'grid-cols-9',\n 10: 'grid-cols-10',\n 11: 'grid-cols-11',\n 12: 'grid-cols-12',\n },\n sm: {\n 1: 'sm:grid-cols-1',\n 2: 'sm:grid-cols-2',\n 3: 'sm:grid-cols-3',\n 4: 'sm:grid-cols-4',\n 5: 'sm:grid-cols-5',\n 6: 'sm:grid-cols-6',\n 7: 'sm:grid-cols-7',\n 8: 'sm:grid-cols-8',\n 9: 'sm:grid-cols-9',\n 10: 'sm:grid-cols-10',\n 11: 'sm:grid-cols-11',\n 12: 'sm:grid-cols-12',\n },\n md: {\n 1: 'md:grid-cols-1',\n 2: 'md:grid-cols-2',\n 3: 'md:grid-cols-3',\n 4: 'md:grid-cols-4',\n 5: 'md:grid-cols-5',\n 6: 'md:grid-cols-6',\n 7: 'md:grid-cols-7',\n 8: 'md:grid-cols-8',\n 9: 'md:grid-cols-9',\n 10: 'md:grid-cols-10',\n 11: 'md:grid-cols-11',\n 12: 'md:grid-cols-12',\n },\n lg: {\n 1: 'lg:grid-cols-1',\n 2: 'lg:grid-cols-2',\n 3: 'lg:grid-cols-3',\n 4: 'lg:grid-cols-4',\n 5: 'lg:grid-cols-5',\n 6: 'lg:grid-cols-6',\n 7: 'lg:grid-cols-7',\n 8: 'lg:grid-cols-8',\n 9: 'lg:grid-cols-9',\n 10: 'lg:grid-cols-10',\n 11: 'lg:grid-cols-11',\n 12: 'lg:grid-cols-12',\n },\n xl: {\n 1: 'xl:grid-cols-1',\n 2: 'xl:grid-cols-2',\n 3: 'xl:grid-cols-3',\n 4: 'xl:grid-cols-4',\n 5: 'xl:grid-cols-5',\n 6: 'xl:grid-cols-6',\n 7: 'xl:grid-cols-7',\n 8: 'xl:grid-cols-8',\n 9: 'xl:grid-cols-9',\n 10: 'xl:grid-cols-10',\n 11: 'xl:grid-cols-11',\n 12: 'xl:grid-cols-12',\n },\n};\n\n/** Static `col-span-*` per breakpoint. */\nexport const COL_SPAN: Record<GridBreakpoint, Record<GridColumns, string>> = {\n base: {\n 1: 'col-span-1',\n 2: 'col-span-2',\n 3: 'col-span-3',\n 4: 'col-span-4',\n 5: 'col-span-5',\n 6: 'col-span-6',\n 7: 'col-span-7',\n 8: 'col-span-8',\n 9: 'col-span-9',\n 10: 'col-span-10',\n 11: 'col-span-11',\n 12: 'col-span-12',\n },\n sm: {\n 1: 'sm:col-span-1',\n 2: 'sm:col-span-2',\n 3: 'sm:col-span-3',\n 4: 'sm:col-span-4',\n 5: 'sm:col-span-5',\n 6: 'sm:col-span-6',\n 7: 'sm:col-span-7',\n 8: 'sm:col-span-8',\n 9: 'sm:col-span-9',\n 10: 'sm:col-span-10',\n 11: 'sm:col-span-11',\n 12: 'sm:col-span-12',\n },\n md: {\n 1: 'md:col-span-1',\n 2: 'md:col-span-2',\n 3: 'md:col-span-3',\n 4: 'md:col-span-4',\n 5: 'md:col-span-5',\n 6: 'md:col-span-6',\n 7: 'md:col-span-7',\n 8: 'md:col-span-8',\n 9: 'md:col-span-9',\n 10: 'md:col-span-10',\n 11: 'md:col-span-11',\n 12: 'md:col-span-12',\n },\n lg: {\n 1: 'lg:col-span-1',\n 2: 'lg:col-span-2',\n 3: 'lg:col-span-3',\n 4: 'lg:col-span-4',\n 5: 'lg:col-span-5',\n 6: 'lg:col-span-6',\n 7: 'lg:col-span-7',\n 8: 'lg:col-span-8',\n 9: 'lg:col-span-9',\n 10: 'lg:col-span-10',\n 11: 'lg:col-span-11',\n 12: 'lg:col-span-12',\n },\n xl: {\n 1: 'xl:col-span-1',\n 2: 'xl:col-span-2',\n 3: 'xl:col-span-3',\n 4: 'xl:col-span-4',\n 5: 'xl:col-span-5',\n 6: 'xl:col-span-6',\n 7: 'xl:col-span-7',\n 8: 'xl:col-span-8',\n 9: 'xl:col-span-9',\n 10: 'xl:col-span-10',\n 11: 'xl:col-span-11',\n 12: 'xl:col-span-12',\n },\n};\n\nexport const COL_SPAN_FULL: Record<GridBreakpoint, string> = {\n base: 'col-span-full',\n sm: 'sm:col-span-full',\n md: 'md:col-span-full',\n lg: 'lg:col-span-full',\n xl: 'xl:col-span-full',\n};\n\nexport const gridVariants = tv({\n base: 'grid min-w-0',\n variants: {\n align: { start: 'items-start', center: 'items-center', end: 'items-end', stretch: 'items-stretch' },\n flow: { row: 'grid-flow-row', column: 'grid-flow-col', dense: 'grid-flow-row-dense' },\n },\n});\n\nexport type GridVariantProps = VariantProps<typeof gridVariants>;\n","import { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport type { CSSProperties } from 'react';\nimport { cn } from '../../utils/cn';\nimport { GAP_CLASSES, type SpaceScale } from '../Stack/stack.variants';\nimport type { LayoutElement } from '../Stack/Stack';\nimport {\n COL_SPAN,\n COL_SPAN_FULL,\n GRID_COLS,\n gridVariants,\n type GridBreakpoint,\n type GridColumns,\n type GridVariantProps,\n} from './grid.variants';\n\n/** A value per breakpoint (mobile-first: `base` applies below `sm`). */\nexport type Responsive<T> = T | Partial<Record<GridBreakpoint, T>>;\n\nconst BREAKPOINTS: GridBreakpoint[] = ['base', 'sm', 'md', 'lg', 'xl'];\n\nfunction responsiveClasses<T>(value: Responsive<T> | undefined, pick: (bp: GridBreakpoint, v: T) => string) {\n if (value == null) return [];\n if (typeof value !== 'object') return [pick('base', value)];\n const map = value as Partial<Record<GridBreakpoint, T>>;\n return BREAKPOINTS.flatMap((bp) => {\n const v = map[bp];\n return v == null ? [] : [pick(bp, v)];\n });\n}\n\nexport interface GridProps extends Omit<useRender.ComponentProps<'div'>, 'className'> {\n className?: string;\n as?: LayoutElement;\n /** Column count (1–12), or one per breakpoint: `{ base: 1, md: 2, xl: 4 }`. */\n cols?: Responsive<GridColumns>;\n /**\n * Auto-fill as many columns as fit, each at least this wide (`'14rem'`, or a number in px).\n * Overrides `cols`.\n */\n minChildWidth?: string | number;\n /** Gap on the spacing scale (0–12). */\n gap?: SpaceScale;\n /** Separate row gap (otherwise `gap` applies to both axes). */\n rowGap?: SpaceScale;\n align?: GridVariantProps['align'];\n flow?: GridVariantProps['flow'];\n}\n\nconst ROW_GAP: Record<SpaceScale, string> = {\n 0: 'gap-y-0',\n 1: 'gap-y-1',\n 2: 'gap-y-2',\n 3: 'gap-y-3',\n 4: 'gap-y-4',\n 5: 'gap-y-5',\n 6: 'gap-y-6',\n 7: 'gap-y-7',\n 8: 'gap-y-8',\n 9: 'gap-y-9',\n 10: 'gap-y-10',\n 11: 'gap-y-11',\n 12: 'gap-y-12',\n};\n\n/** CSS grid with a responsive column count or an auto-fill minimum child width. */\nexport function Grid({\n as = 'div',\n cols,\n minChildWidth,\n gap = 4,\n rowGap,\n align,\n flow,\n className,\n style,\n render,\n ref,\n ...props\n}: GridProps) {\n const autoFill: CSSProperties | undefined =\n minChildWidth != null\n ? {\n gridTemplateColumns: `repeat(auto-fill, minmax(min(${\n typeof minChildWidth === 'number' ? `${minChildWidth}px` : minChildWidth\n }, 100%), 1fr))`,\n }\n : undefined;\n return useRender({\n defaultTagName: as,\n render,\n ref,\n props: mergeProps<'div'>(props, {\n className: cn(\n gridVariants({ align, flow }),\n minChildWidth == null && responsiveClasses(cols, (bp, n) => GRID_COLS[bp][n]),\n GAP_CLASSES[gap],\n rowGap != null && ROW_GAP[rowGap],\n className,\n ),\n style: autoFill || style ? { ...autoFill, ...style } : undefined,\n }),\n });\n}\n\nexport interface GridItemProps extends Omit<useRender.ComponentProps<'div'>, 'className'> {\n className?: string;\n as?: LayoutElement;\n /** Columns to span (1–12 or `'full'`), or one per breakpoint. */\n span?: Responsive<GridColumns | 'full'>;\n}\n\n/** A grid cell that spans several columns. */\nexport function GridItem({ as = 'div', span, className, render, ref, ...props }: GridItemProps) {\n return useRender({\n defaultTagName: as,\n render,\n ref,\n props: mergeProps<'div'>(props, {\n className: cn(\n 'min-w-0',\n responsiveClasses(span, (bp, n) => (n === 'full' ? COL_SPAN_FULL[bp] : COL_SPAN[bp][n])),\n className,\n ),\n }),\n });\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Grid',\n group: 'Layout',\n status: 'stable',\n description:\n 'Responsive CSS grid. `cols` takes 1–12 or a per-breakpoint object ({ base, sm, md, lg, xl }) mapped to static classes; `minChildWidth` auto-fills as many columns as fit. GridItem spans columns (also responsive, or `full`). Gap on the spacing scale.',\n primitive: '@base-ui/react/use-render',\n tokens: [],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\nimport { POPOVER_ARROW_SIDES } from '../Popover/popover.variants';\n\nexport const hoverCardVariants = tv({\n slots: {\n trigger: [\n 'cursor-pointer rounded-sm font-medium text-foreground underline decoration-border decoration-1 underline-offset-4 transition-colors motion-reduce:transition-none',\n 'hover:decoration-foreground data-popup-open:decoration-foreground',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n positioner: 'z-50 outline-none',\n popup: [\n 'relative w-72 origin-[var(--transform-origin)] rounded-[10px] border border-border bg-popover p-4 text-popover-foreground shadow-md outline-none',\n 'max-w-[calc(100vw-2rem)] transition-[opacity,scale] duration-150 motion-reduce:transition-none',\n 'data-starting-style:scale-95 data-starting-style:opacity-0 data-ending-style:scale-95 data-ending-style:opacity-0',\n ],\n arrow: ['size-2.5 rotate-45 rounded-[2px] border-border bg-popover', ...POPOVER_ARROW_SIDES],\n },\n});\n\nexport type HoverCardVariantProps = VariantProps<typeof hoverCardVariants>;\n","import { PreviewCard as BasePreviewCard } from '@base-ui/react/preview-card';\nimport type { ReactNode } from 'react';\nimport { usePortalDir } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { hoverCardVariants } from './hover-card.variants';\n\nconst s = hoverCardVariants();\n\n/** Hover card state container (open, defaultOpen, onOpenChange). Renders no element. */\nexport const HoverCard = BasePreviewCard.Root;\n\nexport interface HoverCardTriggerProps extends Omit<BasePreviewCard.Trigger.Props, 'className'> {\n className?: string;\n}\n\n/**\n * The link that previews its destination. Opens on hover and on keyboard focus after `delay`\n * (default 500 ms); it stays a normal link, so Enter still navigates.\n */\nexport function HoverCardTrigger({ className, delay = 500, closeDelay = 250, ...props }: HoverCardTriggerProps) {\n return (\n <BasePreviewCard.Trigger delay={delay} closeDelay={closeDelay} className={cn(s.trigger(), className)} {...props} />\n );\n}\n\nexport interface HoverCardContentProps extends Omit<BasePreviewCard.Popup.Props, 'className'> {\n className?: string;\n side?: BasePreviewCard.Positioner.Props['side'];\n align?: BasePreviewCard.Positioner.Props['align'];\n /** Gap between trigger and card, in px. */\n sideOffset?: BasePreviewCard.Positioner.Props['sideOffset'];\n /** Draw an arrow pointing at the trigger. */\n arrow?: boolean;\n /** Portal container; defaults to document.body. */\n container?: BasePreviewCard.Portal.Props['container'];\n children?: ReactNode;\n}\n\n/**\n * The floating preview (a person, project or resource). Supplementary: everything in it must\n * also be reachable at the trigger's destination. Escape closes it.\n */\nexport function HoverCardContent({\n side = 'bottom',\n align = 'center',\n sideOffset = 8,\n arrow = false,\n className,\n container,\n children,\n ...props\n}: HoverCardContentProps) {\n const dir = usePortalDir();\n return (\n <BasePreviewCard.Portal container={container}>\n <BasePreviewCard.Positioner\n dir={dir}\n className={s.positioner()}\n side={side}\n align={align}\n sideOffset={sideOffset}\n >\n <BasePreviewCard.Popup className={cn(s.popup(), className)} {...props}>\n {arrow && <BasePreviewCard.Arrow className={s.arrow()} />}\n {children}\n </BasePreviewCard.Popup>\n </BasePreviewCard.Positioner>\n </BasePreviewCard.Portal>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'HoverCard',\n group: 'Overlays',\n status: 'beta',\n description:\n 'Rich preview of a link destination — a member, project or resource — shown on hover or keyboard focus after a short delay. Parts: HoverCard, HoverCardTrigger (a real link), HoverCardContent. The preview is supplementary: never put the only copy of an action or fact inside it.',\n primitive: '@base-ui/react/preview-card',\n pattern: 'link + non-modal preview',\n keyboard: [\n ['Tab', 'Focusing the link opens the preview after the delay'],\n ['Escape', 'Closes the preview; focus stays on the link'],\n ['Enter', 'Follows the link'],\n ],\n tokens: ['popover', 'popover-foreground', 'border', 'foreground', 'muted-foreground', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const infoTipVariants = tv({\n slots: {\n trigger: [\n 'inline-grid shrink-0 cursor-pointer place-items-center rounded-full align-middle text-muted-foreground transition-colors motion-reduce:transition-none',\n 'hover:text-foreground data-popup-open:text-foreground',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n content: 'w-64',\n body: 'text-[12.5px] leading-5 text-muted-foreground text-pretty',\n },\n variants: {\n size: {\n sm: { trigger: 'size-4' },\n md: { trigger: 'size-5' },\n },\n },\n defaultVariants: { size: 'sm' },\n});\n\nexport type InfoTipVariantProps = VariantProps<typeof infoTipVariants>;\n","import { Popover as BasePopover } from '@base-ui/react/popover';\nimport { Info } from 'lucide-react';\nimport type { ReactNode } from 'react';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { Popover, PopoverContent, PopoverTitle, PopoverTrigger, type PopoverContentProps } from '../Popover';\nimport { infoTipVariants, type InfoTipVariantProps } from './info-tip.variants';\n\nexport interface InfoTipProps extends InfoTipVariantProps {\n /** What the help is about; names the button \"More information about {label}\". */\n label: string;\n /** The help text (a sentence or two; links are fine). */\n children: ReactNode;\n /** Optional bold heading inside the panel (also names the dialog). */\n title?: ReactNode;\n /** Also open on hover (after `delay`), not only on click / Enter / Space. */\n openOnHover?: boolean;\n delay?: number;\n side?: PopoverContentProps['side'];\n align?: PopoverContentProps['align'];\n className?: string;\n contentClassName?: string;\n defaultOpen?: boolean;\n open?: boolean;\n onOpenChange?: BasePopover.Root.Props['onOpenChange'];\n}\n\n/**\n * Inline \"i\" help button next to a label or value. Click, Enter or Space opens a small\n * non-modal popover with the explanation; Escape or an outside press close it and focus\n * returns to the button.\n */\nexport function InfoTip({\n label,\n children,\n title,\n openOnHover = false,\n delay = 200,\n side = 'top',\n align = 'center',\n size,\n className,\n contentClassName,\n ...rootProps\n}: InfoTipProps) {\n const { t } = useI18n();\n const s = infoTipVariants({ size });\n return (\n <Popover {...rootProps}>\n <PopoverTrigger\n aria-label={t('common.moreInfo', { label })}\n openOnHover={openOnHover}\n delay={delay}\n className={cn(s.trigger(), className)}\n >\n <Info size={size === 'md' ? 16 : 14} aria-hidden />\n </PopoverTrigger>\n <PopoverContent\n side={side}\n align={align}\n arrow\n aria-label={title == null ? label : undefined}\n className={cn(s.content(), contentClassName)}\n >\n {title != null && <PopoverTitle className=\"mb-1\">{title}</PopoverTitle>}\n <div className={s.body()}>{children}</div>\n </PopoverContent>\n </Popover>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'InfoTip',\n group: 'Overlays',\n status: 'beta',\n description:\n 'Inline \"i\" help button that opens a small popover with an explanation, next to a form label, a stat or a table header. Named \"More information about {label}\"; works with click, keyboard and (optionally) hover, so the help is never hover-only.',\n primitive: '@base-ui/react/popover',\n pattern: 'disclosure (non-modal dialog)',\n keyboard: [\n ['Tab', 'Focuses the info button'],\n ['Enter', 'Opens the help popover (Space too)'],\n ['Escape', 'Closes the popover and returns focus to the button'],\n ],\n tokens: ['muted-foreground', 'foreground', 'popover', 'popover-foreground', 'border', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\n/**\n * The brand field: a recessed (bg-background) wrapper that owns the border and the focus\n * outline, so icons, addons and the bare input focus as one piece.\n */\nexport const inputVariants = tv({\n slots: {\n root: [\n 'flex w-full min-w-0 items-center rounded-md border border-border bg-background text-foreground shadow-sm transition-colors motion-reduce:transition-none',\n 'has-[input:focus-visible]:border-primary/60 has-[input:focus-visible]:outline-2 has-[input:focus-visible]:outline-offset-2 has-[input:focus-visible]:outline-focus-ring',\n 'data-invalid:border-destructive/70 has-[input[data-invalid]]:border-destructive/70 has-[input[aria-invalid=true]]:border-destructive/70',\n 'has-[input:disabled]:cursor-not-allowed has-[input:disabled]:bg-secondary/50 has-[input:disabled]:text-muted-foreground',\n 'has-[input:read-only]:bg-secondary/40',\n ],\n input: [\n 'h-full w-full min-w-0 bg-transparent text-foreground outline-none placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed disabled:text-muted-foreground read-only:text-muted-foreground',\n ],\n icon: 'pointer-events-none shrink-0 text-muted-foreground',\n addon: 'flex shrink-0 items-center text-muted-foreground select-none',\n },\n variants: {\n size: {\n /** Follows `data-density` (comfortable = md). */\n auto: { root: 'h-control gap-tight px-field text-[13px]', input: 'text-[13px]' },\n sm: { root: 'h-8 gap-2 px-2.5 text-[12px]', input: 'text-[12px]' },\n md: { root: 'h-9 gap-2.5 px-3 text-[13px]', input: 'text-[13px]' },\n },\n },\n defaultVariants: { size: 'auto' },\n});\n\nexport type InputVariantProps = VariantProps<typeof inputVariants>;\n\n/** Icon size (px) per input size. */\nexport const INPUT_ICON_SIZE = { auto: 15, sm: 14, md: 15 } as const;\n","import { Input as BaseInput } from '@base-ui/react/input';\nimport type { ComponentType, ReactNode, Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { inputVariants, INPUT_ICON_SIZE, type InputVariantProps } from './input.variants';\n\ntype IconComponent = ComponentType<{ size?: number; 'aria-hidden'?: boolean; className?: string }>;\n\nexport interface InputProps extends Omit<BaseInput.Props, 'className' | 'size'>, InputVariantProps {\n /** Classes for the outer wrapper (border, width, layout). */\n className?: string;\n /** Classes for the native <input>. */\n inputClassName?: string;\n ref?: Ref<HTMLInputElement>;\n /** Decorative icon before the text (a lucide icon component). */\n leadingIcon?: IconComponent;\n /** Decorative icon after the text. */\n trailingIcon?: IconComponent;\n /** Content before the input: a text prefix (\"https://\") or a compact control. */\n leadingAddon?: ReactNode;\n /** Content after the input: a unit (\"req/s\"), a keyboard hint or an icon button. */\n trailingAddon?: ReactNode;\n /** Marks the value as invalid (sets aria-invalid). Inside a Field, `Field invalid` does this. */\n invalid?: boolean;\n}\n\n/**\n * Single-line text input on Base UI Input (works with Field out of the box). The wrapper\n * carries the border, focus outline and invalid/disabled styling; icons and addons sit inside it.\n */\nexport function Input({\n size = 'auto',\n className,\n inputClassName,\n leadingIcon: LeadingIcon,\n trailingIcon: TrailingIcon,\n leadingAddon,\n trailingAddon,\n invalid,\n ...props\n}: InputProps) {\n const s = inputVariants({ size });\n const px = INPUT_ICON_SIZE[size];\n return (\n <div className={cn(s.root(), className)} data-invalid={invalid || undefined}>\n {LeadingIcon && <LeadingIcon size={px} aria-hidden className={s.icon()} />}\n {leadingAddon != null && <span className={s.addon()}>{leadingAddon}</span>}\n <BaseInput className={cn(s.input(), inputClassName)} aria-invalid={invalid || undefined} {...props} />\n {trailingAddon != null && <span className={s.addon()}>{trailingAddon}</span>}\n {TrailingIcon && <TrailingIcon size={px} aria-hidden className={s.icon()} />}\n </div>\n );\n}\n\n/** Keyboard-shortcut hint for a trailing addon, e.g. `<InputKbd>⌘K</InputKbd>`. */\nexport function InputKbd({ className, children }: { className?: string; children: ReactNode }) {\n return (\n <kbd\n className={cn(\n 'inline-flex h-[18px] items-center rounded border border-border bg-card px-1.5 font-mono text-[10px] font-medium text-muted-foreground',\n className,\n )}\n >\n {children}\n </kbd>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Input',\n group: 'Forms',\n status: 'stable',\n description:\n 'Single-line text input in two sizes (sm, md) with optional leading/trailing icons and addons (prefixes, units, keyboard hints, icon buttons). Invalid, disabled and read-only states; works inside Field.',\n primitive: '@base-ui/react/input',\n pattern: 'textbox',\n keyboard: [\n ['Tab', 'Moves focus into the input; trailing addon buttons follow in tab order'],\n ['Click on label', 'Inside a Field, focuses the input'],\n ],\n tokens: [\n 'background',\n 'border',\n 'foreground',\n 'muted-foreground',\n 'primary',\n 'destructive',\n 'secondary',\n 'focus-ring',\n ],\n};\n","import type { ComponentType, ReactNode } from 'react';\n\nexport type TreeIcon = ComponentType<{ size?: number; 'aria-hidden'?: boolean; className?: string }>;\n\nexport interface TreeNode {\n id: string;\n /** Plain-text label; also used by typeahead. */\n label: string;\n /** Rich row content shown instead of `label` (which stays the typeahead text). */\n content?: ReactNode;\n /** Secondary text at the inline end (count, size, status). */\n meta?: ReactNode;\n /** Leading icon. */\n icon?: TreeIcon;\n /** Icon while expanded (e.g. FolderOpen). */\n openIcon?: TreeIcon;\n children?: TreeNode[];\n /** Has children that `loadChildren` fetches on first expand. */\n hasChildren?: boolean;\n disabled?: boolean;\n}\n\nexport type ChildState = { status: 'loading' } | { status: 'error' } | { status: 'loaded'; nodes: TreeNode[] };\n\nexport interface VisibleNode {\n node: TreeNode;\n level: number;\n parentId: string | undefined;\n posinset: number;\n setsize: number;\n /** Has (or may lazily have) children. */\n branch: boolean;\n expanded: boolean;\n}\n\nexport function childrenOf(node: TreeNode, loaded: Record<string, ChildState>) {\n if (node.children) return node.children;\n const state = loaded[node.id];\n return state?.status === 'loaded' ? state.nodes : undefined;\n}\n\nexport function isBranch(node: TreeNode) {\n return (node.children?.length ?? 0) > 0 || node.hasChildren === true;\n}\n\n/** Depth-first list of the nodes a user can currently see (ancestors expanded). */\nexport function flattenVisible(nodes: TreeNode[], expanded: ReadonlySet<string>, loaded: Record<string, ChildState>) {\n const out: VisibleNode[] = [];\n const walk = (list: TreeNode[], level: number, parentId: string | undefined) => {\n list.forEach((node, i) => {\n const branch = isBranch(node);\n const open = branch && expanded.has(node.id);\n out.push({ node, level, parentId, posinset: i + 1, setsize: list.length, branch, expanded: open });\n const kids = open ? childrenOf(node, loaded) : undefined;\n if (kids) walk(kids, level + 1, node.id);\n });\n };\n walk(nodes, 1, undefined);\n return out;\n}\n\n/** Every enabled node id in the tree (loaded children included). */\nexport function allIds(nodes: TreeNode[], loaded: Record<string, ChildState>): string[] {\n return nodes.flatMap((n) => [...(n.disabled ? [] : [n.id]), ...allIds(childrenOf(n, loaded) ?? [], loaded)]);\n}\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const treeListVariants = tv({\n slots: {\n root: 'm-0 list-none p-0 text-[13px] outline-none',\n group: 'm-0 list-none p-0',\n item: [\n 'outline-none',\n '[&:focus-visible>[data-row]]:outline-2 [&:focus-visible>[data-row]]:-outline-offset-2 [&:focus-visible>[data-row]]:outline-focus-ring',\n ],\n row: [\n 'flex h-8 cursor-default items-center gap-1.5 rounded-md pe-2 text-foreground transition-colors select-none',\n 'hover:bg-secondary/70',\n ],\n chevron:\n 'grid size-4 shrink-0 place-items-center text-muted-foreground transition-transform duration-150 motion-reduce:transition-none rtl:-scale-x-100',\n icon: 'shrink-0 text-muted-foreground',\n label: 'min-w-0 flex-1 truncate text-start',\n meta: 'shrink-0 font-mono text-[11px] text-muted-foreground',\n check: 'grid size-4 shrink-0 place-items-center rounded-[4px] border border-border text-primary-foreground',\n status: 'flex h-8 items-center gap-2 pe-2 text-[12px] text-muted-foreground',\n },\n variants: {\n selected: {\n true: {\n row: 'bg-primary/14 text-primary-chip-text hover:bg-primary/18',\n icon: 'text-primary-chip-text',\n check: 'border-primary bg-primary',\n },\n },\n expanded: { true: { chevron: 'rotate-90 rtl:-rotate-90' } },\n disabled: { true: { row: 'pointer-events-none opacity-50' } },\n },\n});\n\nexport type TreeListVariantProps = VariantProps<typeof treeListVariants>;\n","import { useMemo, useRef, useState } from 'react';\nimport { allIds, flattenVisible, isBranch, type ChildState, type TreeNode } from './tree-model';\n\nexport type TreeSelectionMode = 'none' | 'single' | 'multiple';\n\nexport interface UseTreeListOptions {\n nodes: TreeNode[];\n expanded?: string[];\n defaultExpanded?: string[];\n onExpandedChange?: (ids: string[]) => void;\n selectionMode?: TreeSelectionMode;\n selected?: string[];\n defaultSelected?: string[];\n onSelectedChange?: (ids: string[]) => void;\n loadChildren?: (node: TreeNode) => Promise<TreeNode[]>;\n}\n\n/** State, async loading and selection for TreeList (controlled or uncontrolled). */\nexport function useTreeList({\n nodes,\n expanded: expandedProp,\n defaultExpanded = [],\n onExpandedChange,\n selectionMode = 'single',\n selected: selectedProp,\n defaultSelected = [],\n onSelectedChange,\n loadChildren,\n}: UseTreeListOptions) {\n const [expandedState, setExpandedState] = useState(defaultExpanded);\n const [selectedState, setSelectedState] = useState(defaultSelected);\n const [loaded, setLoaded] = useState<Record<string, ChildState>>({});\n const [activeId, setActiveId] = useState<string | undefined>(undefined);\n const pending = useRef(new Set<string>());\n\n const expandedIds = expandedProp ?? expandedState;\n const selectedIds = selectedProp ?? selectedState;\n const expanded = useMemo(() => new Set(expandedIds), [expandedIds]);\n const selected = useMemo(() => new Set(selectedIds), [selectedIds]);\n const visible = useMemo(() => flattenVisible(nodes, expanded, loaded), [nodes, expanded, loaded]);\n\n const setExpanded = (ids: string[]) => {\n if (expandedProp === undefined) setExpandedState(ids);\n onExpandedChange?.(ids);\n };\n const setSelected = (ids: string[]) => {\n if (selectedProp === undefined) setSelectedState(ids);\n onSelectedChange?.(ids);\n };\n\n const load = (node: TreeNode) => {\n if (!loadChildren || node.children || pending.current.has(node.id) || loaded[node.id]?.status === 'loaded') return;\n pending.current.add(node.id);\n setLoaded((m) => ({ ...m, [node.id]: { status: 'loading' } }));\n loadChildren(node)\n .then(\n (kids) => setLoaded((m) => ({ ...m, [node.id]: { status: 'loaded', nodes: kids } })),\n () => setLoaded((m) => ({ ...m, [node.id]: { status: 'error' } })),\n )\n .finally(() => pending.current.delete(node.id));\n };\n\n const setOpen = (node: TreeNode, open: boolean) => {\n if (!isBranch(node) || expanded.has(node.id) === open) return;\n if (open) load(node);\n setExpanded(open ? [...expandedIds, node.id] : expandedIds.filter((id) => id !== node.id));\n };\n\n const select = (node: TreeNode, mode: 'replace' | 'toggle' = 'replace') => {\n if (selectionMode === 'none' || node.disabled) return;\n if (selectionMode === 'single') return setSelected([node.id]);\n if (mode === 'toggle')\n setSelected(selected.has(node.id) ? selectedIds.filter((id) => id !== node.id) : [...selectedIds, node.id]);\n else setSelected([node.id]);\n };\n\n const selectAll = () => {\n if (selectionMode === 'multiple') setSelected(allIds(nodes, loaded));\n };\n\n /** Re-requests children after a failed load. */\n const retry = (node: TreeNode) => load(node);\n\n const focusId =\n activeId !== undefined && visible.some((v) => v.node.id === activeId)\n ? activeId\n : (visible.find((v) => selected.has(v.node.id))?.node.id ?? visible[0]?.node.id);\n\n return {\n visible,\n expanded,\n selected,\n loaded,\n focusId,\n setActiveId,\n setOpen,\n select,\n selectAll,\n retry,\n selectionMode,\n };\n}\n","import { Check, ChevronRight } from 'lucide-react';\nimport { useId, useRef, type HTMLAttributes, type KeyboardEvent, type MouseEvent, type Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { Spinner } from '../Spinner';\nimport { childrenOf, type TreeNode, type VisibleNode } from './tree-model';\nimport { treeListVariants } from './tree-list.variants';\nimport { useTreeList, type UseTreeListOptions } from './useTreeList';\n\nexport interface TreeListLabels {\n loading: string;\n error: string;\n retry: string;\n}\n\nconst DEFAULT_LABELS: TreeListLabels = { loading: 'Loading…', error: 'Could not load items.', retry: 'Retry' };\n\nexport interface TreeListProps\n extends UseTreeListOptions, Omit<HTMLAttributes<HTMLUListElement>, 'className' | 'children' | 'onSelect'> {\n className?: string;\n ref?: Ref<HTMLUListElement>;\n /** Called on Enter or double click of a node (e.g. open a file). */\n onAction?: (node: TreeNode) => void;\n /** Indent per level in px. */\n indent?: number;\n /** Built-in strings (English defaults). */\n labels?: Partial<TreeListLabels>;\n}\n\nconst s = treeListVariants();\n\n/**\n * Hierarchical list on the WAI-ARIA tree pattern: roving focus, arrow keys (Left/Right\n * collapse/expand), Home/End, typeahead, single or multiple selection and lazily loaded\n * children with a loading state. Label it with `aria-label` or `aria-labelledby`.\n */\nexport function TreeList({\n nodes,\n expanded,\n defaultExpanded,\n onExpandedChange,\n selectionMode,\n selected,\n defaultSelected,\n onSelectedChange,\n loadChildren,\n onAction,\n indent = 16,\n labels: labelsProp,\n className,\n onKeyDown,\n ...props\n}: TreeListProps) {\n const labels = { ...DEFAULT_LABELS, ...labelsProp };\n const tree = useTreeList({\n nodes,\n expanded,\n defaultExpanded,\n onExpandedChange,\n selectionMode,\n selected,\n defaultSelected,\n onSelectedChange,\n loadChildren,\n });\n const items = useRef(new Map<string, HTMLLIElement>());\n const typeahead = useRef({ text: '', at: 0 });\n const baseId = useId();\n const byId = new Map(tree.visible.map((v, i) => [v.node.id, { ...v, rowId: `${baseId}-${i}` }]));\n const multi = tree.selectionMode === 'multiple';\n\n const focus = (id: string | undefined) => {\n if (id === undefined) return;\n tree.setActiveId(id);\n items.current.get(id)?.focus();\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLUListElement>) => {\n onKeyDown?.(event);\n const id = (event.target as HTMLElement).closest<HTMLElement>('[role=\"treeitem\"]')?.dataset.id;\n const index = tree.visible.findIndex((v) => v.node.id === id);\n const current = tree.visible[index];\n if (event.defaultPrevented || !current) return;\n const { node } = current;\n const rtl = getComputedStyle(event.currentTarget).direction === 'rtl';\n const key =\n rtl && event.key === 'ArrowLeft' ? 'ArrowRight' : rtl && event.key === 'ArrowRight' ? 'ArrowLeft' : event.key;\n const move = (target: VisibleNode | undefined) => {\n event.preventDefault();\n focus(target?.node.id);\n };\n\n switch (key) {\n case 'ArrowDown':\n return move(tree.visible[index + 1]);\n case 'ArrowUp':\n return move(tree.visible[index - 1]);\n case 'Home':\n return move(tree.visible[0]);\n case 'End':\n return move(tree.visible.at(-1));\n case 'ArrowRight': {\n event.preventDefault();\n if (!current.branch || node.disabled) return;\n if (!current.expanded) return tree.setOpen(node, true);\n if (tree.loaded[node.id]?.status === 'error') return tree.retry(node);\n const first = tree.visible[index + 1];\n if (first?.parentId === node.id) focus(first.node.id);\n return;\n }\n case 'ArrowLeft':\n event.preventDefault();\n if (current.expanded) return tree.setOpen(node, false);\n return focus(current.parentId);\n case 'Enter':\n event.preventDefault();\n tree.select(node, multi ? 'toggle' : 'replace');\n if (onAction && !node.disabled) onAction(node);\n else if (tree.selectionMode === 'none') tree.setOpen(node, !current.expanded);\n return;\n case ' ':\n event.preventDefault();\n if (tree.selectionMode === 'none') return tree.setOpen(node, !current.expanded);\n return tree.select(node, multi ? 'toggle' : 'replace');\n }\n if (multi && key.toLowerCase() === 'a' && (event.ctrlKey || event.metaKey)) {\n event.preventDefault();\n return tree.selectAll();\n }\n if (key.length === 1 && /\\S/.test(key) && !event.ctrlKey && !event.metaKey && !event.altKey) {\n event.preventDefault();\n const t = typeahead.current;\n t.text = event.timeStamp - t.at > 500 ? key.toLowerCase() : t.text + key.toLowerCase();\n t.at = event.timeStamp;\n // Repeating one character cycles through matches; longer text refines from the current node.\n const repeat = [...t.text].every((c) => c === t.text[0]);\n const query = repeat ? t.text.charAt(0) : t.text;\n const start = index + (repeat ? 1 : 0);\n const order = [...tree.visible.slice(start), ...tree.visible.slice(0, start)];\n focus(order.find((v) => !v.node.disabled && v.node.label.toLowerCase().startsWith(query))?.node.id);\n }\n };\n\n const handleClick = (event: MouseEvent, v: VisibleNode) => {\n event.stopPropagation();\n if (v.node.disabled) return;\n focus(v.node.id);\n const onChevron = (event.target as HTMLElement).closest('[data-chevron]');\n if (onChevron || tree.selectionMode === 'none') return tree.setOpen(v.node, !v.expanded);\n tree.select(v.node, multi ? 'toggle' : 'replace');\n };\n\n const renderLevel = (list: TreeNode[]) =>\n list.map((node) => {\n const v = byId.get(node.id);\n if (!v) return null;\n const isSelected = tree.selected.has(node.id);\n const childState = tree.loaded[node.id];\n const kids = v.expanded ? childrenOf(node, tree.loaded) : undefined;\n const v2 = treeListVariants({ selected: isSelected, expanded: v.expanded, disabled: node.disabled });\n const Icon = (v.expanded && node.openIcon) || node.icon;\n const pad = { paddingInlineStart: `${(v.level - 1) * indent + 6}px` };\n return (\n <li\n key={node.id}\n ref={(el) => {\n if (el) items.current.set(node.id, el);\n else items.current.delete(node.id);\n }}\n role=\"treeitem\"\n aria-labelledby={v.rowId}\n data-id={node.id}\n aria-level={v.level}\n aria-posinset={v.posinset}\n aria-setsize={v.setsize}\n aria-expanded={v.branch ? v.expanded : undefined}\n aria-selected={tree.selectionMode === 'none' ? undefined : isSelected}\n aria-disabled={node.disabled || undefined}\n aria-busy={childState?.status === 'loading' || undefined}\n tabIndex={node.id === tree.focusId ? 0 : -1}\n onFocus={(e) => {\n if (e.target === e.currentTarget) tree.setActiveId(node.id);\n }}\n className={s.item()}\n >\n <div\n data-row\n id={v.rowId}\n className={v2.row()}\n style={pad}\n onClick={(e) => handleClick(e, v)}\n onDoubleClick={() => onAction && !node.disabled && onAction(node)}\n >\n <span data-chevron aria-hidden className={v2.chevron()}>\n {v.branch && <ChevronRight size={14} />}\n </span>\n {multi && (\n <span aria-hidden className={v2.check()}>\n {isSelected && <Check size={11} strokeWidth={3} />}\n </span>\n )}\n {Icon && <Icon size={15} aria-hidden className={v2.icon()} />}\n <span className={s.label()}>{node.content ?? node.label}</span>\n {node.meta != null && <span className={s.meta()}>{node.meta}</span>}\n </div>\n {v.expanded && (kids || childState) && (\n <ul role=\"group\" className={s.group()}>\n {kids && renderLevel(kids)}\n {!kids && childState?.status === 'loading' && (\n <li role=\"none\" className={s.status()} style={{ paddingInlineStart: `${v.level * indent + 6}px` }}>\n <Spinner size={13} /> {labels.loading}\n </li>\n )}\n {!kids && childState?.status === 'error' && (\n <li\n role=\"none\"\n className={cn(s.status(), 'text-destructive-text')}\n style={{ paddingInlineStart: `${v.level * indent + 6}px` }}\n >\n {labels.error}\n <button\n type=\"button\"\n tabIndex={-1}\n className=\"underline underline-offset-2\"\n onClick={(e) => {\n e.stopPropagation();\n tree.retry(node);\n }}\n >\n {labels.retry}\n </button>\n </li>\n )}\n </ul>\n )}\n </li>\n );\n });\n\n return (\n <ul\n role=\"tree\"\n aria-multiselectable={multi || undefined}\n className={cn(s.root(), className)}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {renderLevel(nodes)}\n </ul>\n );\n}\n","export type JsonValue = string | number | boolean | null | JsonValue[] | { [key: string]: JsonValue };\n\nexport type JsonType = 'string' | 'number' | 'boolean' | 'null' | 'object' | 'array';\n\n/** Measures strings as-is and other JSON values with two-space indentation. */\nexport function measureJsonDisplay(value: unknown, maxDisplayChars?: number) {\n if (maxDisplayChars === undefined || !Number.isInteger(maxDisplayChars) || maxDisplayChars < 1) return;\n const empty = value === null || value === undefined || value === '';\n if (empty) return { text: '', displayText: '', truncated: false, empty: true };\n const text = typeof value === 'string' ? value : (JSON.stringify(value, null, 2) ?? '');\n const truncated = text.length > maxDisplayChars;\n let cut = text.slice(0, maxDisplayChars);\n const last = cut.charCodeAt(cut.length - 1);\n if (last >= 0xd800 && last <= 0xdbff) cut = cut.slice(0, -1);\n return { text, displayText: truncated ? `${cut}…` : text, truncated, empty };\n}\n\nexport function jsonType(value: unknown): JsonType {\n if (value === null || value === undefined) return 'null';\n if (Array.isArray(value)) return 'array';\n const t = typeof value;\n return t === 'string' || t === 'number' || t === 'boolean' ? t : 'object';\n}\n\n/** Child entries of an object or array (`[]` for primitives). */\nexport function entries(value: unknown): Array<[key: string | number, value: unknown]> {\n if (Array.isArray(value)) return value.map((v, i) => [i, v]);\n if (value && typeof value === 'object') return Object.entries(value);\n return [];\n}\n\nconst IDENT = /^[A-Za-z_$][\\w$]*$/;\n\n/** Appends a key to a path: `users[0].name`, `meta[\"content-type\"]`. */\nexport function joinPath(parent: string, key: string | number) {\n if (typeof key === 'number') return `${parent}[${key}]`;\n if (IDENT.test(key)) return parent ? `${parent}.${key}` : key;\n return `${parent}[${JSON.stringify(key)}]`;\n}\n\n/** Paths of every container whose subtree contains a key or primitive value matching `query`. */\nexport function matchAncestors(data: unknown, query: string, maxDepth = Infinity) {\n const q = query.trim().toLowerCase();\n const out = new Set<string>();\n if (!q) return out;\n const walk = (value: unknown, path: string, depth: number, ancestors: string[]) => {\n for (const [k, v] of entries(value)) {\n const p = joinPath(path, k);\n const type = jsonType(v);\n const primitive = type !== 'object' && type !== 'array';\n if (String(k).toLowerCase().includes(q) || (primitive && String(v).toLowerCase().includes(q)))\n ancestors.forEach((a) => out.add(a));\n if (!primitive && depth < maxDepth) walk(v, p, depth + 1, [...ancestors, p]);\n }\n };\n walk(data, '', 1, []);\n return out;\n}\n\n/** Container paths up to (not including) `depth` levels, for the initial expansion. */\nexport function pathsToDepth(data: unknown, depth: number) {\n const out: string[] = [];\n const walk = (value: unknown, path: string, level: number) => {\n if (level > depth) return;\n for (const [k, v] of entries(value)) {\n const p = joinPath(path, k);\n const t = jsonType(v);\n if (t === 'object' || t === 'array') {\n if (level < depth) out.push(p);\n walk(v, p, level + 1);\n }\n }\n };\n walk(data, '', 0);\n return out;\n}\n","import { tv, type VariantProps } from '../../utils/tv';\n\n/** Value colours: contrast-safe text tokens only (same mapping as CodeBlock's JSON tokens). */\nexport const jsonTypeClass = {\n key: 'text-primary-text',\n string: 'text-warning-text',\n number: 'text-destructive-text',\n boolean: 'font-semibold text-foreground',\n null: 'italic text-muted-foreground',\n summary: 'text-muted-foreground',\n punctuation: 'text-muted-foreground',\n} as const;\n\nexport const jsonViewerVariants = tv({\n slots: {\n root: 'overflow-hidden rounded-md border border-border bg-card text-start',\n toolbar: 'flex min-h-10 items-center gap-2 border-b border-border bg-secondary/40 ps-3 pe-1.5',\n path: 'min-w-0 flex-1 truncate font-mono text-[11.5px] text-muted-foreground',\n pathValue: 'text-foreground',\n action: [\n 'inline-flex h-7 shrink-0 cursor-pointer items-center gap-1.5 rounded-md px-2 font-mono text-[11px] text-muted-foreground transition-colors motion-reduce:transition-none',\n 'hover:bg-secondary hover:text-foreground disabled:pointer-events-none disabled:opacity-50',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n body: 'overflow-auto p-1.5 font-mono text-[12.5px] focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus-ring',\n text: 'm-0 whitespace-pre-wrap break-words text-foreground',\n truncated: 'px-3 pt-2',\n emptyValue: 'px-1.5 py-2 text-muted-foreground',\n row: 'min-w-0 truncate whitespace-pre',\n mark: 'rounded-[3px] bg-warning/16 text-warning-chip-text',\n empty: 'px-3 py-6 text-center font-sans text-[12.5px] text-muted-foreground',\n },\n});\n\nexport type JsonViewerVariantProps = VariantProps<typeof jsonViewerVariants>;\n","import { Check, Copy } from 'lucide-react';\nimport { useEffect, useMemo, useState, type ReactNode, type Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { Badge } from '../Badge/Badge';\nimport { TreeList } from '../TreeList/TreeList';\nimport type { TreeNode } from '../TreeList/tree-model';\nimport { entries, joinPath, jsonType, matchAncestors, measureJsonDisplay, pathsToDepth } from './json-model';\nimport { jsonTypeClass, jsonViewerVariants } from './json-viewer.variants';\n\nexport interface JsonViewerLabels {\n copyPath: string;\n copyValue: string;\n copied: string;\n copyFailed: string;\n /** Toolbar hint before a node is selected. */\n selectHint: string;\n /** Visible indicator when the display cap is exceeded. */\n truncated: string;\n /** Explains that copying capped text copies the full value. */\n copyFullHint: string;\n /** Summary of an object / array. */\n keys: (n: number) => string;\n items: (n: number) => string;\n /** Name of the root when the path is empty. */\n root: string;\n}\n\nconst DEFAULT_LABELS: JsonViewerLabels = {\n copyPath: 'Copy path',\n copyValue: 'Copy value',\n copied: 'Copied to clipboard',\n copyFailed: 'Copy failed',\n selectHint: 'Select a node to copy its path or value',\n truncated: 'Truncated',\n copyFullHint: 'Copy value copies the full, untruncated value',\n keys: (n) => `${n} ${n === 1 ? 'key' : 'keys'}`,\n items: (n) => `${n} ${n === 1 ? 'item' : 'items'}`,\n root: '(root)',\n};\n\nexport interface JsonViewerProps {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n /** Any JSON-serialisable value. */\n data: unknown;\n /** Accessible name of the tree or capped text scroll region. */\n label?: string;\n /** Levels expanded on first render (default 1). */\n defaultExpandDepth?: number;\n /** Deeper containers render as a summary and do not expand. */\n maxDepth?: number;\n /** Highlights matching keys and values and expands their ancestors. No effect on capped text. */\n search?: string;\n /** Shows the path / copy toolbar (default true). */\n toolbar?: boolean;\n /** Max height of the scrollable body (px or CSS length). */\n maxHeight?: number | string;\n /** Display limit in UTF-16 code units. Only finite integers >= 1 enable capped mode. */\n maxDisplayChars?: number;\n /** Content for null, undefined or an empty string in capped mode (default a muted dash). */\n emptyContent?: ReactNode;\n /** Built-in strings (English defaults). */\n labels?: Partial<JsonViewerLabels>;\n}\n\nconst s = jsonViewerVariants();\n\nfunction highlight(text: string, query: string): ReactNode {\n const q = query.trim().toLowerCase();\n if (!q) return text;\n const out: ReactNode[] = [];\n let from = 0;\n let at = text.toLowerCase().indexOf(q);\n while (at !== -1) {\n if (at > from) out.push(text.slice(from, at));\n out.push(\n <mark key={at} className={s.mark()}>\n {text.slice(at, at + q.length)}\n </mark>,\n );\n from = at + q.length;\n at = text.toLowerCase().indexOf(q, from);\n }\n if (from < text.length) out.push(text.slice(from));\n return out;\n}\n\nfunction preview(value: unknown, labels: JsonViewerLabels, query: string): ReactNode {\n const type = jsonType(value);\n if (type === 'object' || type === 'array') {\n const n = entries(value).length;\n return (\n <span className={jsonTypeClass.summary}>\n {type === 'array' ? `[ ] ${labels.items(n)}` : `{ } ${labels.keys(n)}`}\n </span>\n );\n }\n const text = type === 'string' ? JSON.stringify(value) : String(value ?? null);\n return <span className={jsonTypeClass[type]}>{highlight(text, query)}</span>;\n}\n\n/**\n * Collapsible JSON inspector on TreeList (tree keyboard pattern): objects and arrays expand,\n * values are coloured by type with contrast-safe text tokens, `search` highlights and reveals\n * matches, and the toolbar copies the selected node's path or value.\n */\nexport function JsonViewer({\n data,\n label = 'JSON',\n defaultExpandDepth = 1,\n maxDepth = Infinity,\n search = '',\n toolbar = true,\n maxHeight,\n maxDisplayChars,\n emptyContent = <span className={s.emptyValue()}>—</span>,\n labels: labelsProp,\n className,\n ref,\n}: JsonViewerProps) {\n const labels = { ...DEFAULT_LABELS, ...labelsProp };\n const display = useMemo(() => measureJsonDisplay(data, maxDisplayChars), [data, maxDisplayChars]);\n const truncated = display?.truncated ?? false;\n const showTree = !truncated && !display?.empty;\n const [expanded, setExpanded] = useState(() =>\n showTree ? pathsToDepth(data, Math.min(defaultExpandDepth, maxDepth)) : [],\n );\n const [selected, setSelected] = useState<string[]>([]);\n const [status, setStatus] = useState<'idle' | 'copied' | 'failed'>('idle');\n const [revealed, setRevealed] = useState({ search: '', data: undefined as unknown });\n\n // Reveal matches when the query (or data) changes; the user can still collapse them afterwards.\n if (revealed.search !== search || revealed.data !== data) {\n setRevealed({ search, data });\n const extra = showTree ? [...matchAncestors(data, search, maxDepth)].filter((p) => !expanded.includes(p)) : [];\n if (extra.length) setExpanded([...expanded, ...extra]);\n }\n\n const values = new Map<string, unknown>([['', data]]);\n const build = (value: unknown, path: string, level: number): TreeNode[] =>\n entries(value).map(([key, v]) => {\n const id = joinPath(path, key);\n values.set(id, v);\n const type = jsonType(v);\n const keyText = String(key);\n return {\n id,\n label: keyText,\n content: (\n <span className={s.row()}>\n <span className={typeof key === 'number' ? jsonTypeClass.punctuation : jsonTypeClass.key}>\n {highlight(keyText, search)}\n </span>\n <span className={jsonTypeClass.punctuation}>: </span>\n {preview(v, labels, search)}\n </span>\n ),\n children: (type === 'object' || type === 'array') && level < maxDepth ? build(v, id, level + 1) : undefined,\n };\n });\n const rootType = jsonType(data);\n const nodes: TreeNode[] = !showTree\n ? []\n : rootType === 'object' || rootType === 'array'\n ? build(data, '', 1)\n : [{ id: '', label: labels.root, content: <span className={s.row()}>{preview(data, labels, search)}</span> }];\n\n useEffect(() => {\n if (status === 'idle') return;\n const id = window.setTimeout(() => setStatus('idle'), 2000);\n return () => window.clearTimeout(id);\n }, [status]);\n\n const current = selected[0];\n const copy = async (text: string) => {\n try {\n await navigator.clipboard.writeText(text);\n setStatus('copied');\n } catch {\n setStatus('failed');\n }\n };\n\n return (\n <div ref={ref} className={cn(s.root(), className)}>\n {toolbar && (\n <div className={s.toolbar()}>\n <span className={s.path()}>\n {truncated ? (\n labels.copyFullHint\n ) : current !== undefined ? (\n <span className={s.pathValue()}>{current || labels.root}</span>\n ) : (\n labels.selectHint\n )}\n </span>\n <button\n type=\"button\"\n disabled={!showTree || current === undefined}\n onClick={() => current !== undefined && copy(current)}\n className={s.action()}\n >\n <Copy size={13} aria-hidden />\n {labels.copyPath}\n </button>\n <button\n type=\"button\"\n disabled={!truncated && (!showTree || current === undefined)}\n onClick={() =>\n truncated && display\n ? copy(display.text)\n : current !== undefined && copy(JSON.stringify(values.get(current), null, 2) ?? 'null')\n }\n className={s.action()}\n >\n {status === 'copied' ? <Check size={13} aria-hidden /> : <Copy size={13} aria-hidden />}\n {labels.copyValue}\n </button>\n <span role=\"status\" className=\"sr-only\">\n {status === 'copied' ? labels.copied : status === 'failed' ? labels.copyFailed : ''}\n </span>\n </div>\n )}\n {truncated && (\n <div className={s.truncated()}>\n <Badge tone=\"warning\">{labels.truncated}</Badge>\n </div>\n )}\n <div\n className={s.body()}\n style={maxHeight !== undefined ? { maxHeight } : undefined}\n role={truncated ? 'region' : undefined}\n aria-label={truncated ? label : undefined}\n tabIndex={truncated ? 0 : undefined}\n >\n {display?.empty ? (\n emptyContent\n ) : truncated ? (\n <pre className={s.text()}>{display?.displayText}</pre>\n ) : (\n <TreeList\n aria-label={label}\n nodes={nodes}\n expanded={expanded}\n onExpandedChange={setExpanded}\n selected={selected}\n onSelectedChange={setSelected}\n indent={14}\n />\n )}\n </div>\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'JsonViewer',\n group: 'Display',\n status: 'beta',\n description:\n 'Collapsible JSON inspector built on TreeList: objects and arrays expand, values use contrast-safe type tokens, `search` highlights matches and expands their ancestors, `maxDepth` caps nesting, and a toolbar copies the selected node path or value. Optional `maxDisplayChars` (finite integer >= 1) measures UTF-16 units: strings as-is, other values as two-space JSON. Over-cap values become read-only text with an ellipsis (dropping a trailing high surrogate) and a warning Badge labelled by `labels.truncated`. Search has no effect in this fallback; Copy value copies the full measured text, as explained by `labels.copyFullHint`, and Copy path is disabled. `maxHeight` bounds the scrollable body. Only in capped mode, null, undefined and empty strings show `emptyContent` (default a muted dash). Leaving the cap unset preserves existing behavior. The cap limits rendering, not serialization cost.',\n pattern: 'tree view',\n keyboard: [\n ['Tab', 'Moves between toolbar buttons and the tree or named capped-text scroll region'],\n ['ArrowDown / ArrowUp', 'Next / previous visible key'],\n ['ArrowRight / ArrowLeft', 'Expands / collapses an object or array (or moves to child / parent)'],\n ['Home / End', 'First / last visible key'],\n ['Enter / Space', 'Selects the key (its path shows in the toolbar)'],\n ['Type a character', 'Moves to the next key starting with it'],\n ['Arrow keys / PageDown / PageUp', 'Scrolls the focused capped-text region using native browser scrolling'],\n ],\n tokens: [\n 'card',\n 'border',\n 'secondary',\n 'foreground',\n 'muted-foreground',\n 'primary-text',\n 'warning-text',\n 'destructive-text',\n 'warning',\n 'warning-chip-text',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\n/**\n * Kanban board: columns on a muted surface, cards as raised tiles. The drop target column and\n * the dragged card take the brand border; nothing animates under reduced motion.\n */\nexport const kanbanBoardVariants = tv({\n slots: {\n root: 'flex w-full items-start gap-3 overflow-x-auto pb-2',\n column: [\n 'flex w-72 shrink-0 flex-col rounded-xl border border-border bg-secondary/40',\n 'transition-colors duration-150 motion-reduce:transition-none',\n 'data-over:border-primary/60 data-over:bg-accent/40',\n ],\n header: 'flex items-center justify-between gap-2 px-3 pt-3 pb-2',\n heading: 'flex min-w-0 items-center gap-2 text-[13px] font-semibold text-foreground',\n title: 'truncate',\n count: 'rounded-full bg-secondary px-2 py-px font-mono text-[11px] font-medium tabular-nums text-muted-foreground',\n list: 'flex min-h-16 flex-col gap-2 px-2 pb-2',\n item: 'list-none',\n card: [\n 'block w-full cursor-grab select-none rounded-lg border border-border bg-card text-start text-foreground shadow-sm',\n 'transition-[box-shadow,border-color] duration-150 motion-reduce:transition-none',\n 'hover:border-primary/40',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n 'data-dragging:cursor-grabbing data-dragging:border-primary data-dragging:shadow-md',\n ],\n cardTitle: 'text-[13px] font-medium leading-5',\n cardDescription: 'mt-1 text-[12px] leading-5 text-muted-foreground',\n cardMeta: 'mt-2 flex flex-wrap items-center gap-2 font-mono text-[11px] text-muted-foreground',\n empty:\n 'list-none rounded-lg border border-dashed border-border px-3 py-4 text-center text-[12px] text-muted-foreground',\n },\n variants: {\n size: {\n auto: { card: 'px-control py-cell' },\n sm: { card: 'px-2.5 py-2' },\n md: { card: 'px-3.5 py-3' },\n },\n },\n defaultVariants: { size: 'auto' },\n});\n\nexport type KanbanBoardVariantProps = VariantProps<typeof kanbanBoardVariants>;\n","import {\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type KeyboardEvent,\n type PointerEvent as ReactPointerEvent,\n} from 'react';\nimport { useI18n } from '../../i18n/I18nProvider';\n\n/** A list of sortable items (a column, a lane, a single list). */\nexport interface SortableContainer {\n id: string;\n /** Item ids in order. */\n items: string[];\n}\n\n/** Where an item sits: container id and index (after removing the dragged item). */\nexport interface SortablePosition {\n containerId: string;\n index: number;\n}\n\n/** A completed move. `toIndex` is the index in the destination list once the item is removed from its origin. */\nexport interface SortableMove {\n itemId: string;\n fromContainerId: string;\n fromIndex: number;\n toContainerId: string;\n toIndex: number;\n}\n\nexport type SortableMode = 'keyboard' | 'pointer';\n\nexport interface SortableDrag {\n itemId: string;\n mode: SortableMode;\n origin: SortablePosition;\n over: SortablePosition;\n}\n\n/** Lifecycle events, e.g. to announce them through a LiveAnnouncer. */\nexport interface SortableEvents {\n onDragStart?: (drag: SortableDrag) => void;\n onDragOver?: (drag: SortableDrag) => void;\n /** Fired on drop, whether or not the position changed (`onMove` only fires on a change). */\n onDragEnd?: (drag: SortableDrag) => void;\n onDragCancel?: (drag: SortableDrag) => void;\n}\n\nexport interface UseSortableOptions extends SortableEvents {\n containers: SortableContainer[];\n /** Called once on drop when the item lands somewhere new. Apply it to your state (see `moveKanbanCard`). */\n onMove: (move: SortableMove) => void;\n disabled?: boolean;\n /** Pixels the pointer must travel before a drag starts (clicks below it stay clicks). Default 5. */\n activationDistance?: number;\n /** Touch press-and-hold delay in ms before a drag starts, so swipes still scroll. Default 250. */\n touchDelay?: number;\n}\n\nexport interface SortableItemProps {\n ref: (el: HTMLElement | null) => () => void;\n onKeyDown: (event: KeyboardEvent<HTMLElement>) => void;\n onPointerDown: (event: ReactPointerEvent<HTMLElement>) => void;\n 'aria-pressed': boolean;\n 'data-sortable-item': string;\n 'data-dragging'?: '';\n}\n\nexport interface SortableContainerProps {\n ref: (el: HTMLElement | null) => () => void;\n 'data-sortable-container': string;\n 'data-over'?: '';\n}\n\nexport interface UseSortableResult {\n /** The containers in preview order: render these (the dragged item already sits at its target). */\n containers: SortableContainer[];\n drag: SortableDrag | null;\n getItemProps: (itemId: string) => SortableItemProps;\n getContainerProps: (containerId: string) => SortableContainerProps;\n /** Cancels an in-progress drag (e.g. when the data changes underneath). */\n cancel: () => void;\n}\n\nfunction findPosition(containers: SortableContainer[], itemId: string): SortablePosition | null {\n for (const c of containers) {\n const index = c.items.indexOf(itemId);\n if (index >= 0) return { containerId: c.id, index };\n }\n return null;\n}\n\n/** Applies a drag to the containers: removes the item from its origin, inserts it at `over`. */\nexport function previewSortable(\n containers: SortableContainer[],\n drag: Pick<SortableDrag, 'itemId' | 'over'> | null,\n): SortableContainer[] {\n if (!drag) return containers;\n const without = containers.map((c) => ({ id: c.id, items: c.items.filter((id) => id !== drag.itemId) }));\n return without.map((c) => {\n if (c.id !== drag.over.containerId) return c;\n const items = [...c.items];\n items.splice(Math.min(Math.max(drag.over.index, 0), items.length), 0, drag.itemId);\n return { id: c.id, items };\n });\n}\n\nconst samePosition = (a: SortablePosition, b: SortablePosition) =>\n a.containerId === b.containerId && a.index === b.index;\n\n/**\n * Sortable lists with pointer and keyboard dragging, no dependencies. Space picks an item up,\n * arrows move it (↑↓ within a list, ←→ across lists, mirrored in RTL), Home/End jump to the\n * ends, Space or Enter drops, Escape (or Tab) cancels. Pointer drags start after a few pixels\n * (or a press-and-hold on touch). Controlled: the hook only previews; `onMove` commits.\n */\nexport function useSortable({\n containers,\n onMove,\n disabled = false,\n activationDistance = 5,\n touchDelay = 250,\n onDragStart,\n onDragOver,\n onDragEnd,\n onDragCancel,\n}: UseSortableOptions): UseSortableResult {\n const { dir } = useI18n();\n const [drag, setDrag] = useState<SortableDrag | null>(null);\n const itemEls = useRef(new Map<string, HTMLElement>());\n const containerEls = useRef(new Map<string, HTMLElement>());\n const preview = useMemo(() => previewSortable(containers, drag), [containers, drag]);\n\n // Latest values for window listeners and stable callbacks.\n const latest = useRef({ containers, preview, drag, onMove, onDragStart, onDragOver, onDragEnd, onDragCancel });\n useLayoutEffect(() => {\n latest.current = { containers, preview, drag, onMove, onDragStart, onDragOver, onDragEnd, onDragCancel };\n });\n\n const start = useCallback((itemId: string, mode: SortableMode) => {\n const origin = findPosition(latest.current.containers, itemId);\n if (!origin) return null;\n const next: SortableDrag = { itemId, mode, origin, over: origin };\n latest.current.drag = next;\n setDrag(next);\n latest.current.onDragStart?.(next);\n return next;\n }, []);\n\n const moveTo = useCallback((over: SortablePosition) => {\n const current = latest.current.drag;\n if (!current || samePosition(current.over, over)) return;\n const next = { ...current, over };\n latest.current.drag = next;\n setDrag(next);\n latest.current.onDragOver?.(next);\n }, []);\n\n const drop = useCallback(() => {\n const current = latest.current.drag;\n if (!current) return;\n latest.current.drag = null;\n setDrag(null);\n if (!samePosition(current.origin, current.over)) {\n latest.current.onMove({\n itemId: current.itemId,\n fromContainerId: current.origin.containerId,\n fromIndex: current.origin.index,\n toContainerId: current.over.containerId,\n toIndex: current.over.index,\n });\n }\n latest.current.onDragEnd?.(current);\n }, []);\n\n const cancel = useCallback(() => {\n const current = latest.current.drag;\n if (!current) return;\n latest.current.drag = null;\n setDrag(null);\n latest.current.onDragCancel?.(current);\n }, []);\n\n // Keep keyboard focus on the dragged item when it re-mounts in another list, and after a drop.\n const focusTarget = drag?.mode === 'keyboard' ? drag.itemId : null;\n const lastKeyboardItem = useRef<string | null>(null);\n useLayoutEffect(() => {\n const id = focusTarget ?? lastKeyboardItem.current;\n lastKeyboardItem.current = focusTarget;\n if (!id) return;\n const el = itemEls.current.get(id);\n if (el && document.activeElement !== el && (focusTarget || !el.contains(document.activeElement)))\n el.focus({ preventScroll: false });\n });\n\n /** Position under the pointer: container by x (nearest if outside all), index by item midpoints. */\n const hitTest = useCallback((x: number, y: number, itemId: string): SortablePosition | null => {\n let best: { id: string; dist: number } | null = null;\n for (const [id, el] of containerEls.current) {\n const r = el.getBoundingClientRect();\n const dist = x < r.left ? r.left - x : x > r.right ? x - r.right : 0;\n if (!best || dist < best.dist) best = { id, dist };\n }\n if (!best) return null;\n const list = latest.current.preview.find((c) => c.id === best.id);\n if (!list) return null;\n let index = 0;\n for (const id of list.items) {\n if (id === itemId) continue;\n const el = itemEls.current.get(id);\n if (!el) continue;\n const r = el.getBoundingClientRect();\n if (r.top + r.height / 2 < y) index++;\n }\n return { containerId: best.id, index };\n }, []);\n\n const pointerCleanup = useRef<(() => void) | null>(null);\n useEffect(() => () => pointerCleanup.current?.(), []);\n\n const onPointerDown = useCallback(\n (itemId: string, event: ReactPointerEvent<HTMLElement>) => {\n if (disabled || event.button !== 0 || !event.isPrimary || latest.current.drag) return;\n const target = event.target as HTMLElement;\n if (\n target !== event.currentTarget &&\n target.closest('a, button, input, select, textarea, [contenteditable=\"true\"]')\n )\n return;\n pointerCleanup.current?.();\n const startX = event.clientX;\n const startY = event.clientY;\n const pointerId = event.pointerId;\n const touch = event.pointerType === 'touch';\n let active = false;\n let timer = 0;\n const begin = () => {\n if (active) return;\n active = !!start(itemId, 'pointer');\n };\n if (touch) timer = window.setTimeout(begin, touchDelay);\n const move = (e: PointerEvent) => {\n if (e.pointerId !== pointerId) return;\n if (!active) {\n const far = Math.hypot(e.clientX - startX, e.clientY - startY) >= activationDistance;\n if (touch) {\n if (far) cleanup();\n return;\n }\n if (!far) return;\n begin();\n }\n const over = hitTest(e.clientX, e.clientY, itemId);\n if (over) moveTo(over);\n };\n const up = (e: PointerEvent) => {\n if (e.pointerId !== pointerId) return;\n if (active) {\n // Swallow the click that follows a drag.\n const swallow = (c: MouseEvent) => {\n c.stopPropagation();\n c.preventDefault();\n };\n window.addEventListener('click', swallow, { capture: true, once: true });\n window.setTimeout(() => window.removeEventListener('click', swallow, true), 0);\n drop();\n }\n cleanup();\n };\n const cancelPointer = () => {\n if (active) cancel();\n cleanup();\n };\n const key = (e: globalThis.KeyboardEvent) => {\n if (e.key === 'Escape' && active) {\n e.preventDefault();\n cancelPointer();\n }\n };\n const touchMove = (e: TouchEvent) => {\n if (active) e.preventDefault();\n };\n function cleanup() {\n window.clearTimeout(timer);\n window.removeEventListener('pointermove', move);\n window.removeEventListener('pointerup', up);\n window.removeEventListener('pointercancel', cancelPointer);\n window.removeEventListener('keydown', key, true);\n window.removeEventListener('touchmove', touchMove);\n pointerCleanup.current = null;\n }\n window.addEventListener('pointermove', move);\n window.addEventListener('pointerup', up);\n window.addEventListener('pointercancel', cancelPointer);\n window.addEventListener('keydown', key, true);\n window.addEventListener('touchmove', touchMove, { passive: false });\n pointerCleanup.current = cleanup;\n },\n [disabled, start, hitTest, moveTo, drop, cancel, activationDistance, touchDelay],\n );\n\n const onKeyDown = useCallback(\n (itemId: string, event: KeyboardEvent<HTMLElement>) => {\n if (disabled || event.target !== event.currentTarget) return;\n const current = latest.current.drag;\n if (!current) {\n if (event.key === ' ') {\n event.preventDefault();\n start(itemId, 'keyboard');\n }\n return;\n }\n if (current.itemId !== itemId || current.mode !== 'keyboard') return;\n const lists = latest.current.preview;\n const ci = lists.findIndex((c) => c.id === current.over.containerId);\n const lengthOf = (i: number) => lists[i]?.items.filter((id) => id !== itemId).length ?? 0;\n const across = (step: number) => {\n const ni = Math.min(Math.max(ci + step, 0), lists.length - 1);\n const next = lists[ni];\n if (next) moveTo({ containerId: next.id, index: Math.min(current.over.index, lengthOf(ni)) });\n };\n const rtl = dir === 'rtl';\n switch (event.key) {\n case ' ':\n case 'Enter':\n event.preventDefault();\n drop();\n return;\n case 'Escape':\n event.preventDefault();\n cancel();\n return;\n case 'Tab':\n cancel();\n return;\n case 'ArrowUp':\n event.preventDefault();\n moveTo({ ...current.over, index: Math.max(current.over.index - 1, 0) });\n return;\n case 'ArrowDown':\n event.preventDefault();\n moveTo({ ...current.over, index: Math.min(current.over.index + 1, lengthOf(ci)) });\n return;\n case 'ArrowLeft':\n event.preventDefault();\n across(rtl ? 1 : -1);\n return;\n case 'ArrowRight':\n event.preventDefault();\n across(rtl ? -1 : 1);\n return;\n case 'Home':\n event.preventDefault();\n moveTo({ ...current.over, index: 0 });\n return;\n case 'End':\n event.preventDefault();\n moveTo({ ...current.over, index: lengthOf(ci) });\n return;\n default:\n }\n },\n [disabled, dir, start, moveTo, drop, cancel],\n );\n\n const getItemProps = useCallback(\n (itemId: string): SortableItemProps => ({\n ref: (el) => {\n if (el) itemEls.current.set(itemId, el);\n return () => {\n if (el && itemEls.current.get(itemId) === el) itemEls.current.delete(itemId);\n };\n },\n onKeyDown: (e) => onKeyDown(itemId, e),\n onPointerDown: (e) => onPointerDown(itemId, e),\n 'aria-pressed': drag?.itemId === itemId,\n 'data-sortable-item': itemId,\n 'data-dragging': drag?.itemId === itemId ? '' : undefined,\n }),\n [drag, onKeyDown, onPointerDown],\n );\n\n const getContainerProps = useCallback(\n (containerId: string): SortableContainerProps => ({\n ref: (el) => {\n if (el) containerEls.current.set(containerId, el);\n return () => {\n if (el && containerEls.current.get(containerId) === el) containerEls.current.delete(containerId);\n };\n },\n 'data-sortable-container': containerId,\n 'data-over': drag && drag.over.containerId === containerId ? '' : undefined,\n }),\n [drag],\n );\n\n return { containers: preview, drag, getItemProps, getContainerProps, cancel };\n}\n","import { createElement, useId, useMemo, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { LiveAnnouncer, useAnnounce, useHasLiveAnnouncer } from '../LiveAnnouncer';\nimport { kanbanBoardVariants, type KanbanBoardVariantProps } from './kanban-board.variants';\nimport { useSortable, type SortableContainer, type SortableDrag } from './useSortable';\n\n/** The default card shape. Extend it with your own fields and pass `renderCard`. */\nexport interface KanbanCard {\n id: string;\n title: string;\n description?: string;\n /** Small line under the card (assignee, due date, labels…). Keep it non-interactive. */\n meta?: ReactNode;\n}\n\nexport interface KanbanColumn<T extends KanbanCard = KanbanCard> {\n id: string;\n title: string;\n cards: T[];\n}\n\n/** A committed move. `toIndex` is the index in the destination column once the card left its origin. */\nexport interface KanbanMove {\n cardId: string;\n fromColumnId: string;\n fromIndex: number;\n toColumnId: string;\n toIndex: number;\n}\n\nexport interface KanbanBoardProps<T extends KanbanCard = KanbanCard> extends KanbanBoardVariantProps {\n /** Controlled columns and cards. Apply `onMove` to them (see `moveKanbanCard`). */\n columns: KanbanColumn<T>[];\n /** Called on drop when a card lands somewhere new (pointer or keyboard). */\n onMove: (move: KanbanMove) => void;\n /** Card body. Default: title, description and meta. Must not contain interactive elements. */\n renderCard?: (card: T, state: { dragging: boolean }) => ReactNode;\n /** Plain-text name of a card for announcements. Default: `title`. */\n getCardLabel?: (card: T) => string;\n /** Click or Enter on a card (when not moving it), e.g. to open its details. */\n onCardOpen?: (card: T) => void;\n /** Accessible name of the board. Default \"Board\". */\n label?: string;\n /** Level of the column headings. Default 3. */\n headingLevel?: 2 | 3 | 4 | 5 | 6;\n /** Text in an empty column. Default \"No cards\". */\n emptyText?: ReactNode;\n disabled?: boolean;\n className?: string;\n}\n\n/** Applies a KanbanMove to the columns (immutably). Use it in your `onMove` handler. */\nexport function moveKanbanCard<T extends KanbanCard>(columns: KanbanColumn<T>[], move: KanbanMove): KanbanColumn<T>[] {\n const card = columns.find((c) => c.id === move.fromColumnId)?.cards.find((c) => c.id === move.cardId);\n if (!card) return columns;\n const without = columns.map((c) =>\n c.id === move.fromColumnId ? { ...c, cards: c.cards.filter((x) => x.id !== move.cardId) } : c,\n );\n return without.map((c) => {\n if (c.id !== move.toColumnId) return c;\n const cards = [...c.cards];\n cards.splice(Math.min(Math.max(move.toIndex, 0), cards.length), 0, card);\n return { ...c, cards };\n });\n}\n\nconst s = kanbanBoardVariants;\n\nfunction DefaultCard({ card, slots }: { card: KanbanCard; slots: ReturnType<typeof kanbanBoardVariants> }) {\n return (\n <>\n <span className={cn('block', slots.cardTitle())}>{card.title}</span>\n {card.description && <span className={cn('block', slots.cardDescription())}>{card.description}</span>}\n {card.meta != null && <span className={slots.cardMeta()}>{card.meta}</span>}\n </>\n );\n}\n\nfunction Board<T extends KanbanCard>({\n columns,\n onMove,\n renderCard,\n getCardLabel = (card) => card.title,\n onCardOpen,\n label,\n headingLevel = 3,\n emptyText,\n disabled = false,\n size,\n className,\n}: KanbanBoardProps<T>) {\n const { t } = useI18n();\n const announce = useAnnounce();\n const id = useId();\n const slots = s({ size });\n const containers = useMemo<SortableContainer[]>(\n () => columns.map((c) => ({ id: c.id, items: c.cards.map((card) => card.id) })),\n [columns],\n );\n const cardById = useMemo(\n () => new Map(columns.flatMap((c) => c.cards.map((card) => [card.id, card] as const))),\n [columns],\n );\n const columnById = useMemo(() => new Map(columns.map((c) => [c.id, c] as const)), [columns]);\n\n const describe = (drag: SortableDrag, key: 'kanban.pickedUp' | 'kanban.moved' | 'kanban.dropped') => {\n const card = cardById.get(drag.itemId);\n const column = columnById.get(drag.over.containerId);\n const others = column ? column.cards.filter((c) => c.id !== drag.itemId).length : 0;\n return t(key, {\n card: card ? getCardLabel(card) : drag.itemId,\n position: drag.over.index + 1,\n total: others + 1,\n column: column?.title ?? drag.over.containerId,\n });\n };\n\n const sortable = useSortable({\n containers,\n disabled,\n onMove: (m) =>\n onMove({\n cardId: m.itemId,\n fromColumnId: m.fromContainerId,\n fromIndex: m.fromIndex,\n toColumnId: m.toContainerId,\n toIndex: m.toIndex,\n }),\n onDragStart: (drag) => announce(describe(drag, 'kanban.pickedUp')),\n onDragOver: (drag) => announce(describe(drag, 'kanban.moved')),\n onDragEnd: (drag) => announce(describe(drag, 'kanban.dropped')),\n onDragCancel: (drag) => {\n const card = cardById.get(drag.itemId);\n announce(\n t('kanban.cancelled', {\n card: card ? getCardLabel(card) : drag.itemId,\n column: columnById.get(drag.origin.containerId)?.title ?? drag.origin.containerId,\n }),\n );\n },\n });\n\n const instructionsId = `${id}-instructions`;\n return (\n <div role=\"group\" aria-label={label ?? t('kanban.label')} className={cn(slots.root(), className)}>\n <p id={instructionsId} hidden>\n {t('kanban.instructions')}\n </p>\n {sortable.containers.map((list) => {\n const column = columnById.get(list.id);\n if (!column) return null;\n const headingId = `${id}-${list.id}`;\n const count = list.items.length;\n return (\n <section\n key={list.id}\n aria-labelledby={headingId}\n className={slots.column()}\n {...sortable.getContainerProps(list.id)}\n >\n <div className={slots.header()}>\n {createElement(\n `h${headingLevel}`,\n { id: headingId, className: slots.heading() },\n <span className={slots.title()}>{column.title}</span>,\n <span className={slots.count()}>\n <span aria-hidden>{count}</span>\n <span className=\"sr-only\">{`, ${t('kanban.cards', { count })}`}</span>\n </span>,\n )}\n </div>\n <ul className={slots.list()}>\n {list.items.map((cardId) => {\n const card = cardById.get(cardId);\n if (!card) return null;\n const itemProps = sortable.getItemProps(cardId);\n const dragging = sortable.drag?.itemId === cardId;\n return (\n <li key={cardId} className={slots.item()}>\n <div\n role=\"button\"\n tabIndex={disabled ? -1 : 0}\n aria-roledescription={t('kanban.roleDescription')}\n aria-describedby={instructionsId}\n aria-disabled={disabled || undefined}\n className={slots.card()}\n {...itemProps}\n onKeyDown={(e) => {\n if (e.key === 'Enter' && !sortable.drag && e.target === e.currentTarget) {\n e.preventDefault();\n onCardOpen?.(card);\n return;\n }\n itemProps.onKeyDown(e);\n }}\n onClick={() => onCardOpen?.(card)}\n >\n {renderCard ? renderCard(card, { dragging }) : <DefaultCard card={card} slots={slots} />}\n </div>\n </li>\n );\n })}\n {list.items.length === 0 && <li className={slots.empty()}>{emptyText ?? t('kanban.empty')}</li>}\n </ul>\n </section>\n );\n })}\n </div>\n );\n}\n\n/**\n * Kanban board: columns of cards you reorder within a column and move across columns, by\n * pointer drag or keyboard (Space picks up, arrows move, Space drops, Escape cancels). Each\n * step is announced through a LiveAnnouncer (its own, unless one is already above). Controlled:\n * render `columns`, apply `onMove`.\n */\nexport function KanbanBoard<T extends KanbanCard = KanbanCard>(props: KanbanBoardProps<T>) {\n const hasAnnouncer = useHasLiveAnnouncer();\n if (hasAnnouncer) return <Board {...props} />;\n return (\n <LiveAnnouncer>\n <Board {...props} />\n </LiveAnnouncer>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'KanbanBoard',\n group: 'Display',\n status: 'beta',\n description:\n 'Columns of cards you reorder within a column and move across columns by pointer drag or keyboard. Controlled (`columns` + `onMove`, with `moveKanbanCard` to apply a move); every pick-up, move, drop and cancel is announced through a LiveAnnouncer. Built on the dependency-free `useSortable` hook (pointer + keyboard, press-and-hold on touch). Cards lift with a border and shadow only; nothing animates under reduced motion. Density-aware card padding (`size: \"auto\"`).',\n pattern:\n 'Sortable lists (cards as buttons with aria-roledescription, aria-pressed while moving, aria-describedby instructions) + aria-live announcements',\n keyboard: [\n ['Tab', 'Moves between cards (column by column)'],\n ['Space', 'Picks up the focused card; on a picked-up card, drops it'],\n ['ArrowUp / ArrowDown', 'While moving: one position up / down in the column'],\n ['ArrowLeft / ArrowRight', 'While moving: to the previous / next column (mirrored in RTL)'],\n ['Home / End', 'While moving: to the top / bottom of the column'],\n ['Enter', 'While moving: drops the card; otherwise opens it (`onCardOpen`)'],\n ['Escape', 'While moving: cancels and returns the card to where it started'],\n ],\n tokens: ['secondary', 'card', 'border', 'primary', 'accent', 'foreground', 'muted-foreground', 'focus-ring'],\n};\n","export type PasswordStrength = 0 | 1 | 2 | 3 | 4;\n\nconst COMMON = new Set([\n 'password',\n 'password1',\n 'passw0rd',\n '123456',\n '12345678',\n '123456789',\n 'qwerty',\n 'qwerty123',\n 'letmein',\n 'welcome',\n 'admin',\n 'iloveyou',\n 'abc123',\n '111111',\n 'changeme',\n 'secret',\n]);\n\n/**\n * Small built-in heuristic (not zxcvbn): length (8+, 12+) and character variety\n * (2+ and 3+ of lower / upper / digit / symbol). Common or single-character passwords score 0.\n */\nexport function scorePassword(password: string): PasswordStrength {\n if (!password) return 0;\n if (COMMON.has(password.toLowerCase()) || /^(.)\\1*$/.test(password)) return 0;\n const classes = [/[a-z]/, /[A-Z]/, /\\d/, /[^A-Za-z0-9]/].filter((re) => re.test(password)).length;\n let score = 0;\n if (password.length >= 8) score++;\n if (password.length >= 12) score++;\n if (classes >= 2) score++;\n if (classes >= 3) score++;\n if (password.length < 6) score = Math.min(score, 1);\n return Math.min(score, 4) as PasswordStrength;\n}\n\nexport const DEFAULT_STRENGTH_LABELS: readonly [string, string, string, string, string] = [\n 'Too weak',\n 'Weak',\n 'Fair',\n 'Good',\n 'Strong',\n];\n","import { tv, type VariantProps } from '../../utils/tv';\n\n/** Segmented strength bar under the field: 4 segments filled by score, coloured by level. */\nexport const passwordInputVariants = tv({\n slots: {\n root: 'flex min-w-0 flex-col gap-2',\n toggle: 'size-7 shrink-0',\n meter: 'flex flex-col gap-1.5',\n segments: 'grid grid-cols-4 gap-1',\n segment: 'h-1 rounded-full bg-secondary transition-colors motion-reduce:transition-none',\n text: 'text-[12px] leading-4 text-muted-foreground',\n level: 'font-medium',\n },\n variants: {\n level: {\n 0: { level: 'text-destructive-text' },\n 1: { level: 'text-destructive-text' },\n 2: { level: 'text-warning-text' },\n 3: { level: 'text-success-text' },\n 4: { level: 'text-success-text' },\n },\n },\n});\n\n/** Fill class for a filled segment at each score. */\nexport const PASSWORD_SEGMENT_FILL = [\n 'bg-destructive',\n 'bg-destructive',\n 'bg-warning',\n 'bg-success',\n 'bg-success',\n] as const;\n\nexport type PasswordInputVariantProps = VariantProps<typeof passwordInputVariants>;\n","import { Eye, EyeOff } from 'lucide-react';\nimport { useId, useState } from 'react';\nimport { cn } from '../../utils/cn';\nimport { IconButton } from '../Button';\nimport { Input, type InputProps } from '../Input';\nimport { scorePassword, type PasswordStrength } from './password-strength';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { PASSWORD_SEGMENT_FILL, passwordInputVariants } from './password-input.variants';\n\nexport interface PasswordInputProps extends Omit<InputProps, 'type' | 'trailingAddon' | 'value' | 'defaultValue'> {\n value?: string;\n defaultValue?: string;\n /** Whether the password is shown as text (controlled). */\n visible?: boolean;\n defaultVisible?: boolean;\n onVisibleChange?: (visible: boolean) => void;\n /** Show the strength meter under the field. */\n showStrength?: boolean;\n /** Strength score 0–4 from your own checker; defaults to the built-in heuristic. */\n strength?: PasswordStrength;\n /** Five labels for scores 0–4. */\n strengthLabels?: readonly [string, string, string, string, string];\n /** Prefix of the announced strength text (\"Strength: Good\"). */\n strengthPrefix?: string;\n showLabel?: string;\n hideLabel?: string;\n /** Classes for the column that holds the field and the meter. */\n wrapperClassName?: string;\n}\n\n/**\n * Password field on Input with a reveal toggle (aria-pressed) and an optional segmented\n * strength meter whose text is linked to the input via aria-describedby.\n */\nexport function PasswordInput({\n value,\n defaultValue,\n onValueChange,\n visible: visibleProp,\n defaultVisible = false,\n onVisibleChange,\n showStrength = false,\n strength,\n strengthLabels: strengthLabelsProp,\n strengthPrefix: strengthPrefixProp,\n showLabel: showLabelProp,\n hideLabel: hideLabelProp,\n size = 'auto',\n wrapperClassName,\n className,\n disabled,\n 'aria-describedby': describedBy,\n ...props\n}: PasswordInputProps) {\n const { t } = useI18n();\n const strengthPrefix = strengthPrefixProp ?? t('password.strength');\n const showLabel = showLabelProp ?? t('password.show');\n const hideLabel = hideLabelProp ?? t('password.hide');\n const strengthLabels =\n strengthLabelsProp ??\n ([\n t('password.tooWeak'),\n t('password.weak'),\n t('password.fair'),\n t('password.good'),\n t('password.strong'),\n ] as const);\n const strengthId = useId();\n const [innerValue, setInnerValue] = useState(defaultValue ?? '');\n const [innerVisible, setInnerVisible] = useState(defaultVisible);\n const current = value ?? innerValue;\n const visible = visibleProp ?? innerVisible;\n const score = strength ?? scorePassword(current);\n const s = passwordInputVariants({ level: score });\n\n const toggle = () => {\n setInnerVisible(!visible);\n onVisibleChange?.(!visible);\n };\n\n const describedByIds = cn(describedBy, showStrength && current && strengthId);\n const input = (\n <Input\n {...props}\n {...(describedByIds ? { 'aria-describedby': describedByIds } : {})}\n size={size}\n disabled={disabled}\n className={cn('pe-1', className)}\n type={visible ? 'text' : 'password'}\n autoComplete={props.autoComplete ?? (showStrength ? 'new-password' : 'current-password')}\n value={value}\n defaultValue={value === undefined ? defaultValue : undefined}\n onValueChange={(v, details) => {\n setInnerValue(v);\n onValueChange?.(v, details);\n }}\n trailingAddon={\n <IconButton\n size=\"sm\"\n className={s.toggle()}\n icon={visible ? EyeOff : Eye}\n label={visible ? hideLabel : showLabel}\n aria-pressed={visible}\n disabled={disabled}\n onClick={toggle}\n />\n }\n />\n );\n\n if (!showStrength) return input;\n return (\n <div className={cn(s.root(), wrapperClassName)}>\n {input}\n <div className={s.meter()}>\n <div className={s.segments()} aria-hidden>\n {[1, 2, 3, 4].map((n) => (\n <span\n key={n}\n className={cn(s.segment(), current && n <= Math.max(score, 1) && PASSWORD_SEGMENT_FILL[score])}\n />\n ))}\n </div>\n <p id={strengthId} className={s.text()}>\n {current ? (\n <>\n {strengthPrefix} <span className={s.level()}>{strengthLabels[score]}</span>\n </>\n ) : (\n 'Use 12+ characters with a mix of letters, numbers and symbols.'\n )}\n </p>\n </div>\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'PasswordInput',\n group: 'Forms',\n status: 'beta',\n description:\n 'Password field on Input with a reveal toggle (aria-pressed) and an optional 4-segment strength meter. Strength comes from a small built-in heuristic or a `strength` prop (0–4); its text is linked to the input with aria-describedby. Works inside Field.',\n primitive: '@base-ui/react/input',\n pattern: 'textbox + toggle button',\n keyboard: [\n ['Tab', 'Moves from the input to the reveal toggle'],\n ['Enter / Space', 'On the toggle: shows or hides the password (aria-pressed)'],\n ],\n tokens: [\n 'background',\n 'border',\n 'foreground',\n 'muted-foreground',\n 'secondary',\n 'destructive',\n 'destructive-text',\n 'warning',\n 'warning-text',\n 'success',\n 'success-text',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const textareaVariants = tv({\n base: [\n 'block w-full min-w-0 rounded-md border border-border bg-background px-3 py-2 text-foreground shadow-sm',\n 'placeholder:text-muted-foreground transition-colors motion-reduce:transition-none',\n 'focus-visible:border-primary/60 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n 'data-invalid:border-destructive/70 aria-invalid:border-destructive/70',\n 'disabled:cursor-not-allowed disabled:bg-secondary/50 disabled:text-muted-foreground',\n 'read-only:bg-secondary/40',\n ],\n variants: {\n size: {\n sm: 'text-[12px] leading-5',\n md: 'text-[13px] leading-6',\n },\n resize: {\n none: 'resize-none',\n vertical: 'resize-y',\n },\n autosize: {\n true: 'field-sizing-content min-h-[88px] resize-none',\n false: '',\n },\n },\n defaultVariants: { size: 'md', resize: 'none', autosize: false },\n});\n\nexport type TextareaVariantProps = VariantProps<typeof textareaVariants>;\n","import { Field } from '@base-ui/react/field';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport type { ComponentProps, Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { textareaVariants, type TextareaVariantProps } from './textarea.variants';\n\ntype NativeTextareaProps = Omit<\n ComponentProps<'textarea'>,\n 'className' | 'ref' | 'value' | 'defaultValue' | 'onChange'\n>;\n\nexport interface TextareaProps extends NativeTextareaProps, TextareaVariantProps {\n className?: string;\n ref?: Ref<HTMLTextAreaElement>;\n value?: string;\n defaultValue?: string;\n onChange?: ComponentProps<'textarea'>['onChange'];\n /** Called with the new string value (mirrors Input's `onValueChange`). */\n onValueChange?: (value: string) => void;\n /** Marks the value as invalid (sets aria-invalid). Inside a Field, `Field invalid` does this. */\n invalid?: boolean;\n}\n\n/**\n * Multi-line text input. Renders a native <textarea> through Base UI Field.Control, so a\n * surrounding Field links its label, description and error and tracks dirty/touched state.\n * `autosize` grows the box with its content via CSS `field-sizing: content`.\n */\nexport function Textarea({\n size,\n resize,\n autosize,\n invalid,\n className,\n ref,\n id,\n name,\n disabled,\n value,\n defaultValue,\n onValueChange,\n rows = 4,\n ...rest\n}: TextareaProps) {\n return (\n <Field.Control\n ref={ref as Ref<HTMLElement> | undefined}\n id={id}\n name={name}\n disabled={disabled}\n value={value}\n defaultValue={defaultValue}\n onValueChange={onValueChange ? (v) => onValueChange(v) : undefined}\n render={(controlProps) => (\n <textarea\n {...mergeProps<'textarea'>(controlProps as ComponentProps<'textarea'>, rest, {\n rows: autosize ? undefined : rows,\n 'aria-invalid': invalid || undefined,\n className: cn(textareaVariants({ size, resize, autosize }), className),\n })}\n />\n )}\n />\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Textarea',\n group: 'Forms',\n status: 'stable',\n description:\n 'Multi-line text input in two sizes, with optional CSS autosize (field-sizing: content) and vertical resize. Renders through Base UI Field.Control, so it works inside Field.',\n primitive: '@base-ui/react/field (Field.Control)',\n pattern: 'textbox (multi-line)',\n keyboard: [\n ['Tab', 'Moves focus into and out of the textarea'],\n ['Enter', 'Inserts a new line (does not submit the form)'],\n ],\n tokens: [\n 'background',\n 'border',\n 'foreground',\n 'muted-foreground',\n 'primary',\n 'destructive',\n 'secondary',\n 'focus-ring',\n ],\n};\n","/** One row of a KeyValueEditor. `id` is stable across edits (React key, focus target). */\nexport interface KeyValueRow {\n id: string;\n key: string;\n value: string;\n /** Masked value (rendered as a password field with a reveal toggle). */\n secret?: boolean;\n}\n\nexport type KeyValueErrorCode = 'duplicate' | 'pattern' | 'keyRequired' | 'valueRequired';\nexport type KeyValueErrors = Record<string, { key?: KeyValueErrorCode; value?: KeyValueErrorCode }>;\n\n/** Environment-variable style keys: letters, digits and underscores, not starting with a digit. */\nexport const ENV_KEY_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;\n\nlet seq = 0;\n/** A new row with a unique id. */\nexport function createKeyValueRow(key = '', value = '', secret = false): KeyValueRow {\n seq += 1;\n return { id: `kv-${Date.now().toString(36)}-${seq}`, key, value, ...(secret ? { secret } : {}) };\n}\n\nexport interface ValidateKeyValueOptions {\n /** Pattern every key must match (default ENV_KEY_PATTERN). `null` accepts any key. */\n keyPattern?: RegExp | null;\n /** Rows with a key must also have a value. */\n requireValue?: boolean;\n /** Compare keys ignoring case when looking for duplicates (default false). */\n caseInsensitive?: boolean;\n}\n\n/**\n * Per-row errors, keyed by row id. Fully empty rows are ignored; the first row with a key wins\n * and later rows with the same key are marked `duplicate`.\n */\nexport function validateKeyValueRows(\n rows: readonly KeyValueRow[],\n { keyPattern = ENV_KEY_PATTERN, requireValue = false, caseInsensitive = false }: ValidateKeyValueOptions = {},\n): KeyValueErrors {\n const errors: KeyValueErrors = {};\n const seen = new Set<string>();\n for (const row of rows) {\n const key = row.key.trim();\n if (!key && !row.value) continue;\n const entry: KeyValueErrors[string] = {};\n if (!key) entry.key = 'keyRequired';\n else if (keyPattern && !keyPattern.test(key)) entry.key = 'pattern';\n else {\n const norm = caseInsensitive ? key.toLowerCase() : key;\n if (seen.has(norm)) entry.key = 'duplicate';\n seen.add(norm);\n }\n if (requireValue && key && !row.value) entry.value = 'valueRequired';\n if (entry.key || entry.value) errors[row.id] = entry;\n }\n return errors;\n}\n\nfunction unquote(raw: string): string {\n const quote = raw[0];\n if ((quote === '\"' || quote === \"'\") && raw.length >= 2) {\n let end = -1;\n for (let i = 1; i < raw.length; i++) {\n if (quote === '\"' && raw[i] === '\\\\') i++;\n else if (raw[i] === quote) {\n end = i;\n break;\n }\n }\n if (end > 0) {\n const inner = raw.slice(1, end);\n return quote === '\"'\n ? inner.replace(/\\\\([nrt\"\\\\])/g, (_, c: string) => ({ n: '\\n', r: '\\r', t: '\\t' })[c] ?? c)\n : inner;\n }\n }\n // Unquoted: an inline comment starts at \" #\".\n const hash = raw.search(/\\s#/);\n return (hash >= 0 ? raw.slice(0, hash) : raw).trim();\n}\n\n/**\n * Parses `.env` text: one `KEY=value` per line, optional `export ` prefix, single or double\n * quotes, `#` comments (full-line or after whitespace). Lines without `=` are skipped.\n */\nexport function parseEnv(text: string): Array<{ key: string; value: string }> {\n const out: Array<{ key: string; value: string }> = [];\n for (const rawLine of text.split(/\\r?\\n/)) {\n const line = rawLine.trim();\n if (!line || line.startsWith('#')) continue;\n const body = line.startsWith('export ') ? line.slice(7).trimStart() : line;\n const eq = body.indexOf('=');\n if (eq <= 0) continue;\n const key = body.slice(0, eq).trim();\n if (!key) continue;\n out.push({ key, value: unquote(body.slice(eq + 1).trim()) });\n }\n return out;\n}\n\n/** Serialises rows to `.env` text, quoting values with spaces, quotes, `#` or newlines. Rows without a key are skipped. */\nexport function serializeEnv(rows: ReadonlyArray<Pick<KeyValueRow, 'key' | 'value'>>): string {\n return rows\n .filter((row) => row.key.trim())\n .map(({ key, value }) => {\n const needsQuotes = /[\\s#\"'=\\\\]/.test(value);\n const v = needsQuotes\n ? `\"${value.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"').replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r').replace(/\\t/g, '\\\\t')}\"`\n : value;\n return `${key.trim()}=${v}`;\n })\n .join('\\n');\n}\n\n/**\n * Merges parsed pairs into rows: existing keys get the new value, new keys are appended, and\n * empty placeholder rows are dropped. Returns the rows and how many pairs were applied.\n */\nexport function mergeEnvRows(\n rows: readonly KeyValueRow[],\n pairs: ReadonlyArray<{ key: string; value: string }>,\n): KeyValueRow[] {\n const next = rows.filter((row) => row.key.trim() || row.value).map((row) => ({ ...row }));\n for (const { key, value } of pairs) {\n const existing = next.find((row) => row.key.trim() === key);\n if (existing) existing.value = value;\n else next.push(createKeyValueRow(key, value));\n }\n return next;\n}\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const keyValueEditorVariants = tv({\n slots: {\n root: 'flex min-w-0 flex-col gap-3',\n header:\n 'grid grid-cols-[minmax(0,2fr)_minmax(0,3fr)_auto] items-end gap-2 px-0.5 font-mono text-[10.5px] tracking-[0.1em] text-muted-foreground uppercase',\n headerSpacer: 'w-[4.25rem]',\n list: 'flex flex-col gap-2',\n row: 'grid grid-cols-[minmax(0,2fr)_minmax(0,3fr)_auto] items-start gap-2',\n cell: 'flex min-w-0 flex-col gap-1',\n keyInput: 'font-mono',\n valueInput: 'font-mono',\n rowActions: 'flex shrink-0 items-center gap-0.5 pt-0.5',\n error: 'text-[12px] leading-4 text-destructive-text',\n empty: 'rounded-md border border-dashed border-border px-3 py-4 text-center text-[12.5px] text-muted-foreground',\n footer: 'flex flex-wrap items-center gap-2',\n footerEnd: 'ms-auto flex items-center gap-2',\n paste: 'flex flex-col gap-2 rounded-lg border border-border bg-card p-3',\n pasteLabel: 'text-[12.5px] font-medium text-foreground',\n pasteHint: 'text-[12px] leading-4 text-muted-foreground',\n pasteActions: 'flex justify-end gap-2',\n status: 'sr-only',\n },\n variants: {\n size: {\n auto: { keyInput: 'text-[12.5px]', valueInput: 'text-[12.5px]' },\n sm: { keyInput: 'text-[12px]', valueInput: 'text-[12px]', rowActions: 'pt-0' },\n md: { keyInput: 'text-[12.5px]', valueInput: 'text-[12.5px]' },\n },\n },\n defaultVariants: { size: 'auto' },\n});\n\nexport type KeyValueEditorVariantProps = VariantProps<typeof keyValueEditorVariants>;\n","import { ClipboardPaste, Lock, LockOpen, Plus, Trash2 } from 'lucide-react';\nimport { useEffect, useId, useMemo, useRef, useState, type ClipboardEvent } from 'react';\nimport type { MessageKey } from '../../i18n';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { Button, IconButton } from '../Button';\nimport { CopyButton } from '../CopyButton';\nimport { Input } from '../Input';\nimport { LiveAnnouncer, useAnnounce, useHasLiveAnnouncer } from '../LiveAnnouncer';\nimport { PasswordInput } from '../PasswordInput';\nimport { Textarea } from '../Textarea';\nimport {\n createKeyValueRow,\n mergeEnvRows,\n parseEnv,\n serializeEnv,\n validateKeyValueRows,\n type KeyValueErrorCode,\n type KeyValueErrors,\n type KeyValueRow,\n type ValidateKeyValueOptions,\n} from './key-value';\nimport { keyValueEditorVariants } from './key-value-editor.variants';\n\nconst ERROR_KEY: Record<KeyValueErrorCode, MessageKey> = {\n duplicate: 'kv.errDuplicate',\n pattern: 'kv.errPattern',\n keyRequired: 'kv.errKeyRequired',\n valueRequired: 'kv.errValueRequired',\n};\n\nexport interface KeyValueEditorProps extends ValidateKeyValueOptions {\n /** Rows (controlled). */\n value?: KeyValueRow[];\n /** Initial rows (uncontrolled). */\n defaultValue?: KeyValueRow[];\n onChange?: (rows: KeyValueRow[]) => void;\n /** Called with whether every row is valid, and the per-row errors, whenever they change. */\n onValidityChange?: (valid: boolean, errors: KeyValueErrors) => void;\n /** Extra per-row error message (shown under the value), after the built-in checks. */\n validate?: (row: KeyValueRow, rows: readonly KeyValueRow[]) => string | undefined;\n /** Show the per-row \"secret\" toggle (default true). */\n allowSecrets?: boolean;\n /** Show \"Paste .env\" and accept multi-line paste in key fields (default true). */\n allowPaste?: boolean;\n /** Show \"Copy as .env\" (default true). */\n allowExport?: boolean;\n /** Maximum number of rows; Add and import stop there. */\n maxRows?: number;\n readOnly?: boolean;\n disabled?: boolean;\n size?: 'auto' | 'sm' | 'md';\n /** Names the editor (role=\"group\"). */\n 'aria-label'?: string;\n keyPlaceholder?: string;\n valuePlaceholder?: string;\n className?: string;\n}\n\n/**\n * Editable list of key/value rows (environment variables, headers, labels). Add and remove\n * rows (no reordering), per-row validation (required, key pattern, duplicates, custom), secret\n * rows with masked values, bulk paste of `.env` text and export as `.env`. Controlled or not.\n */\nexport function KeyValueEditor(props: KeyValueEditorProps) {\n // Without an announcer above, provide one so this field and its CopyButton share one status region.\n return useHasLiveAnnouncer() ? (\n <KeyValueEditorInner {...props} />\n ) : (\n <LiveAnnouncer>\n <KeyValueEditorInner {...props} />\n </LiveAnnouncer>\n );\n}\n\nfunction KeyValueEditorInner({\n value,\n defaultValue,\n onChange,\n onValidityChange,\n validate,\n keyPattern,\n requireValue,\n caseInsensitive,\n allowSecrets = true,\n allowPaste = true,\n allowExport = true,\n maxRows = Infinity,\n readOnly = false,\n disabled = false,\n size = 'auto',\n 'aria-label': ariaLabel,\n keyPlaceholder = 'KEY',\n valuePlaceholder,\n className,\n}: KeyValueEditorProps) {\n const { t } = useI18n();\n const announce = useAnnounce();\n const baseId = useId();\n const [inner, setInner] = useState<KeyValueRow[]>(() => defaultValue ?? [createKeyValueRow()]);\n const rows = value ?? inner;\n const [pasteOpen, setPasteOpen] = useState(false);\n const [pasteText, setPasteText] = useState('');\n const focusTarget = useRef<string | null>(null);\n const keyRefs = useRef(new Map<string, HTMLInputElement>());\n const addRef = useRef<HTMLButtonElement>(null);\n const pasteRef = useRef<HTMLButtonElement>(null);\n const s = keyValueEditorVariants({ size });\n const editable = !readOnly && !disabled;\n const atMax = rows.length >= maxRows;\n\n const errors = useMemo(\n () => validateKeyValueRows(rows, { keyPattern, requireValue, caseInsensitive }),\n [rows, keyPattern, requireValue, caseInsensitive],\n );\n const custom = useMemo(() => {\n const out: Record<string, string> = {};\n if (validate)\n for (const row of rows) {\n const message = validate(row, rows);\n if (message) out[row.id] = message;\n }\n return out;\n }, [rows, validate]);\n const valid = Object.keys(errors).length === 0 && Object.keys(custom).length === 0;\n const errorsKey = JSON.stringify([errors, custom]);\n const validityRef = useRef(onValidityChange);\n useEffect(() => {\n validityRef.current = onValidityChange;\n });\n useEffect(() => {\n validityRef.current?.(valid, errors);\n // errorsKey captures the content of `errors` so new-but-equal objects do not re-fire.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [valid, errorsKey]);\n\n // Focus requested by add / remove / paste lands once the new rows are rendered.\n useEffect(() => {\n const target = focusTarget.current;\n if (!target) return;\n focusTarget.current = null;\n if (target === '@add') addRef.current?.focus();\n else if (target === '@paste') pasteRef.current?.focus();\n else keyRefs.current.get(target)?.focus();\n });\n const setFocusTarget = (target: string) => {\n focusTarget.current = target;\n };\n\n const commit = (next: KeyValueRow[]) => {\n if (value === undefined) setInner(next);\n onChange?.(next);\n };\n const update = (id: string, patch: Partial<KeyValueRow>) =>\n commit(rows.map((row) => (row.id === id ? { ...row, ...patch } : row)));\n\n const add = () => {\n if (atMax) return;\n const row = createKeyValueRow();\n commit([...rows, row]);\n setFocusTarget(row.id);\n };\n\n const remove = (index: number) => {\n const next = rows.filter((_, i) => i !== index);\n commit(next);\n const neighbour = next[index] ?? next[index - 1];\n setFocusTarget(neighbour ? neighbour.id : '@add');\n announce(t('kv.rowRemoved'));\n };\n\n const importText = (text: string) => {\n const pairs = parseEnv(text);\n if (!pairs.length) return 0;\n const merged = mergeEnvRows(rows, pairs).slice(0, Math.max(maxRows, 0));\n commit(merged);\n announce(t('kv.imported', { count: pairs.length }));\n return pairs.length;\n };\n\n const onKeyPaste = (event: ClipboardEvent<HTMLInputElement>) => {\n if (!allowPaste) return;\n const text = event.clipboardData.getData('text');\n if (!/\\r?\\n/.test(text.trim()) || !text.includes('=')) return;\n event.preventDefault();\n importText(text);\n };\n\n const submitPaste = () => {\n if (importText(pasteText) > 0) {\n setPasteText('');\n setPasteOpen(false);\n setFocusTarget('@paste');\n }\n };\n\n const pasteId = `${baseId}-paste`;\n const pasteHintId = `${baseId}-paste-hint`;\n\n return (\n <div role=\"group\" aria-label={ariaLabel} className={cn(s.root(), className)}>\n {rows.length > 0 ? (\n <>\n <div className={s.header()} aria-hidden>\n <span>{t('kv.key')}</span>\n <span>{t('kv.value')}</span>\n <span className={s.headerSpacer()} />\n </div>\n <ul className={s.list()}>\n {rows.map((row, index) => {\n const n = index + 1;\n const err = errors[row.id];\n const keyErrId = `${baseId}-${row.id}-kerr`;\n const valErrId = `${baseId}-${row.id}-verr`;\n const valueMessage = err?.value ? t(ERROR_KEY[err.value]) : custom[row.id];\n const valueProps = {\n 'aria-label': row.secret ? t('kv.secretRow', { row: n }) : t('kv.valueRow', { row: n }),\n value: row.value,\n onValueChange: (v: string) => update(row.id, { value: v }),\n placeholder: valuePlaceholder,\n size,\n disabled,\n readOnly,\n invalid: Boolean(valueMessage),\n inputClassName: s.valueInput(),\n autoComplete: 'off',\n spellCheck: false,\n ...(valueMessage ? { 'aria-describedby': valErrId } : {}),\n } as const;\n return (\n <li key={row.id} className={s.row()} data-row={n}>\n <div className={s.cell()}>\n <Input\n ref={(el) => {\n if (el) keyRefs.current.set(row.id, el);\n else keyRefs.current.delete(row.id);\n }}\n aria-label={t('kv.keyRow', { row: n })}\n value={row.key}\n onValueChange={(v) => update(row.id, { key: v })}\n onPaste={onKeyPaste}\n placeholder={keyPlaceholder}\n size={size}\n disabled={disabled}\n readOnly={readOnly}\n invalid={Boolean(err?.key)}\n inputClassName={s.keyInput()}\n autoComplete=\"off\"\n spellCheck={false}\n {...(err?.key ? { 'aria-describedby': keyErrId } : {})}\n />\n {err?.key && (\n <p id={keyErrId} className={s.error()}>\n {t(ERROR_KEY[err.key])}\n </p>\n )}\n </div>\n <div className={s.cell()}>\n {row.secret ? <PasswordInput {...valueProps} /> : <Input {...valueProps} />}\n {valueMessage && (\n <p id={valErrId} className={s.error()}>\n {valueMessage}\n </p>\n )}\n </div>\n <div className={s.rowActions()}>\n {allowSecrets && (\n <IconButton\n size=\"sm\"\n icon={row.secret ? Lock : LockOpen}\n label={t('kv.secretRow', { row: n })}\n aria-pressed={Boolean(row.secret)}\n disabled={!editable}\n onClick={() => update(row.id, { secret: !row.secret })}\n />\n )}\n {editable && (\n <IconButton\n size=\"sm\"\n icon={Trash2}\n label={t('kv.removeRow', { row: n })}\n onClick={() => remove(index)}\n />\n )}\n </div>\n </li>\n );\n })}\n </ul>\n </>\n ) : (\n <p className={s.empty()}>{t('kv.empty')}</p>\n )}\n\n {pasteOpen && editable && (\n <div className={s.paste()}>\n <label htmlFor={pasteId} className={s.pasteLabel()}>\n {t('kv.pasteLabel')}\n </label>\n <Textarea\n id={pasteId}\n aria-describedby={pasteHintId}\n value={pasteText}\n onValueChange={setPasteText}\n rows={5}\n spellCheck={false}\n placeholder={'API_URL=https://api.example.com\\n# comment\\nLOG_LEVEL=info'}\n className=\"font-mono text-[12.5px]\"\n autoFocus\n />\n <p id={pasteHintId} className={s.pasteHint()}>\n {t('kv.pasteHint')}\n </p>\n <div className={s.pasteActions()}>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => {\n setPasteOpen(false);\n setFocusTarget('@paste');\n }}\n >\n {t('common.cancel')}\n </Button>\n <Button size=\"sm\" onClick={submitPaste} disabled={!pasteText.trim()}>\n {t('kv.import')}\n </Button>\n </div>\n </div>\n )}\n\n {(editable || allowExport) && (\n <div className={s.footer()}>\n {editable && (\n <Button ref={addRef} variant=\"secondary\" size=\"sm\" icon={Plus} onClick={add} disabled={atMax}>\n {t('kv.add')}\n </Button>\n )}\n {editable && allowPaste && (\n <Button\n ref={pasteRef}\n variant=\"ghost\"\n size=\"sm\"\n icon={ClipboardPaste}\n aria-expanded={pasteOpen}\n onClick={() => setPasteOpen((o) => !o)}\n >\n {t('kv.paste')}\n </Button>\n )}\n {allowExport && (\n <span className={s.footerEnd()}>\n <CopyButton\n display=\"label\"\n size=\"sm\"\n variant=\"ghost\"\n label={t('kv.copyEnv')}\n value={() => serializeEnv(rows)}\n disabled={!rows.some((r) => r.key.trim())}\n />\n </span>\n )}\n </div>\n )}\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'KeyValueEditor',\n group: 'Forms',\n status: 'beta',\n description:\n 'Editable list of key/value rows (environment variables, headers, labels): add and remove rows (no reordering), per-row validation (required key, key pattern, duplicate keys, optional required value and a custom `validate`), secret rows whose values are masked with a reveal toggle, bulk paste of `.env` text (comments ignored, existing keys updated) and \"Copy as .env\". Controlled (`value` + `onChange`) or uncontrolled. `parseEnv`, `serializeEnv`, `validateKeyValueRows` and `createKeyValueRow` are exported.',\n primitive: '@base-ui/react/input',\n pattern: 'group of textboxes + toggle buttons',\n keyboard: [\n ['Tab', 'Moves through each row: key, value, secret toggle, remove; then Add, Paste .env and Copy as .env'],\n ['Enter / Space', 'On Add variable: appends a row and focuses its key'],\n ['Enter / Space', 'On Remove: deletes the row, announces it and focuses the next row (or Add)'],\n ['Enter / Space', 'On the secret toggle: masks or unmasks the value (aria-pressed)'],\n ['Ctrl / ⌘ + V', 'In a key field, multi-line KEY=value text is imported as rows'],\n ],\n tokens: [\n 'background',\n 'border',\n 'card',\n 'foreground',\n 'muted-foreground',\n 'secondary',\n 'destructive',\n 'destructive-text',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nconst control = [\n 'grid size-9 shrink-0 place-items-center rounded-lg text-muted-foreground transition-colors motion-reduce:transition-none',\n 'hover:bg-secondary/70 hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n 'disabled:pointer-events-none disabled:opacity-40',\n];\n\nexport const lightboxVariants = tv({\n slots: {\n backdrop:\n 'fixed inset-0 z-50 bg-background/95 transition-opacity duration-200 motion-reduce:transition-none data-starting-style:opacity-0 data-ending-style:opacity-0',\n popup: [\n 'fixed inset-0 z-50 flex flex-col text-foreground outline-none',\n 'transition-opacity duration-200 motion-reduce:transition-none data-starting-style:opacity-0 data-ending-style:opacity-0',\n ],\n bar: 'flex shrink-0 items-center gap-1 border-b border-border/60 bg-chrome px-3 py-2',\n counter: 'me-auto font-mono text-[12px] text-muted-foreground tabular-nums',\n zoomValue: 'w-12 text-center font-mono text-[11.5px] text-muted-foreground tabular-nums',\n control,\n stageWrap: 'relative flex min-h-0 flex-1 items-stretch',\n stage: 'grid min-h-0 min-w-0 flex-1 place-items-center overflow-auto p-4 sm:px-16',\n media: 'w-auto max-w-full rounded-md object-contain shadow-md select-none',\n nav: [\n 'absolute top-1/2 z-10 grid size-10 -translate-y-1/2 place-items-center rounded-full border border-border bg-card text-foreground shadow-sm transition-colors',\n 'hover:bg-secondary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring disabled:pointer-events-none disabled:opacity-40',\n ],\n prev: 'start-3',\n next: 'end-3',\n caption: 'shrink-0 px-4 pt-1 pb-3 text-center text-[13px] text-muted-foreground text-pretty',\n thumbs: 'flex shrink-0 justify-center gap-2 overflow-x-auto border-t border-border/60 bg-chrome px-3 py-2.5',\n thumb: [\n 'relative size-14 shrink-0 overflow-hidden rounded-md border border-border opacity-60 transition-opacity motion-reduce:transition-none',\n 'hover:opacity-100 aria-[current=true]:border-primary aria-[current=true]:opacity-100',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n thumbImg: 'size-full object-cover',\n thumbBadge: 'absolute inset-0 grid place-items-center bg-background/40 text-foreground',\n },\n});\n\nexport type LightboxVariantProps = VariantProps<typeof lightboxVariants>;\n","import { Dialog as BaseDialog } from '@base-ui/react/dialog';\nimport { ChevronLeft, ChevronRight, Play, X, ZoomIn, ZoomOut } from 'lucide-react';\nimport { useEffect, useRef, useState, type KeyboardEvent, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { lightboxVariants } from './lightbox.variants';\n\nexport interface LightboxItem {\n src: string;\n /** Alternative text (images) or accessible name (videos). */\n alt: string;\n type?: 'image' | 'video';\n caption?: ReactNode;\n /** Thumbnail URL (defaults to `src` for images, `poster` for videos). */\n thumbnail?: string;\n poster?: string;\n /** WebVTT captions for videos. */\n captions?: string;\n}\n\nexport interface LightboxLabels {\n title: string;\n close: string;\n previous: string;\n next: string;\n zoomIn: string;\n zoomOut: string;\n thumbnails: string;\n counter: (index: number, total: number) => string;\n status: (index: number, total: number, alt: string) => string;\n thumbnail: (index: number, alt: string) => string;\n}\n\nconst defaultLabels: LightboxLabels = {\n title: 'Media viewer',\n close: 'Close viewer',\n previous: 'Previous',\n next: 'Next',\n zoomIn: 'Zoom in',\n zoomOut: 'Zoom out',\n thumbnails: 'Thumbnails',\n counter: (i, n) => `${i + 1} / ${n}`,\n status: (i, n, alt) => `${i + 1} of ${n}: ${alt}`,\n thumbnail: (i, alt) => `Show ${i + 1}: ${alt}`,\n};\n\nexport interface LightboxProps {\n items: LightboxItem[];\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n index?: number;\n defaultIndex?: number;\n onIndexChange?: (index: number) => void;\n /** Wrap from the last item to the first. */\n loop?: boolean;\n showThumbnails?: boolean;\n /** Largest zoom factor (steps of 0.5). */\n maxZoom?: number;\n labels?: Partial<LightboxLabels>;\n container?: BaseDialog.Portal.Props['container'];\n}\n\n/**\n * Full-screen image and video viewer on Base UI Dialog: previous / next, zoom with a scrollable\n * stage, captions and a thumbnail strip. Arrow keys move (mirrored in RTL), +/−/0 zoom, Escape\n * closes and focus returns to whatever opened it.\n */\nexport function Lightbox({\n items,\n open,\n defaultOpen = false,\n onOpenChange,\n index,\n defaultIndex = 0,\n onIndexChange,\n loop = false,\n showThumbnails = true,\n maxZoom = 4,\n labels: labelsProp,\n container,\n}: LightboxProps) {\n const labels = { ...defaultLabels, ...labelsProp };\n const [innerOpen, setInnerOpen] = useState(defaultOpen);\n const [innerIndex, setInnerIndex] = useState(defaultIndex);\n const [zoomState, setZoomState] = useState({ at: -1, zoom: 1 });\n const thumbsRef = useRef<HTMLDivElement | null>(null);\n const isOpen = open ?? innerOpen;\n const total = items.length;\n const current = Math.min(Math.max(index ?? innerIndex, 0), Math.max(total - 1, 0));\n const item = items[current];\n const zoom = zoomState.at === current ? zoomState.zoom : 1;\n const isVideo = item?.type === 'video';\n const s = lightboxVariants();\n\n const setOpen = (next: boolean) => {\n setInnerOpen(next);\n onOpenChange?.(next);\n };\n const go = (i: number) => {\n const next = loop ? (i + total) % total : Math.min(Math.max(i, 0), total - 1);\n if (next === current || total === 0) return;\n setInnerIndex(next);\n onIndexChange?.(next);\n };\n const setZoom = (z: number) => setZoomState({ at: current, zoom: Math.min(Math.max(z, 1), maxZoom) });\n\n useEffect(() => {\n if (!isOpen) return;\n thumbsRef.current?.querySelector('[aria-current=\"true\"]')?.scrollIntoView?.({ block: 'nearest', inline: 'center' });\n }, [isOpen, current]);\n\n const onKeyDown = (e: KeyboardEvent<HTMLDivElement>) => {\n if ((e.target as HTMLElement).tagName === 'VIDEO') return;\n const rtl = getComputedStyle(e.currentTarget).direction === 'rtl';\n const actions: Record<string, () => void> = {\n [rtl ? 'ArrowLeft' : 'ArrowRight']: () => go(current + 1),\n [rtl ? 'ArrowRight' : 'ArrowLeft']: () => go(current - 1),\n Home: () => go(0),\n End: () => go(total - 1),\n '+': () => setZoom(zoom + 0.5),\n '=': () => setZoom(zoom + 0.5),\n '-': () => setZoom(zoom - 0.5),\n '0': () => setZoom(1),\n };\n const action = actions[e.key];\n if (!action || e.altKey || e.ctrlKey || e.metaKey) return;\n if (isVideo && e.key.length === 1) return;\n e.preventDefault();\n action();\n };\n\n const atStart = !loop && current === 0;\n const atEnd = !loop && current >= total - 1;\n\n return (\n <BaseDialog.Root open={isOpen} onOpenChange={(next) => setOpen(next)}>\n <BaseDialog.Portal container={container}>\n <BaseDialog.Backdrop className={s.backdrop()} />\n <BaseDialog.Popup className={s.popup()} onKeyDown={onKeyDown}>\n <BaseDialog.Title className=\"sr-only\">{labels.title}</BaseDialog.Title>\n <div className={s.bar()}>\n <span className={s.counter()} aria-hidden>\n {labels.counter(current, total)}\n </span>\n {!isVideo && (\n <>\n <button\n type=\"button\"\n className={s.control()}\n aria-label={labels.zoomOut}\n disabled={zoom <= 1}\n onClick={() => setZoom(zoom - 0.5)}\n >\n <ZoomOut size={16} aria-hidden />\n </button>\n <span className={s.zoomValue()} aria-hidden>\n {Math.round(zoom * 100)}%\n </span>\n <button\n type=\"button\"\n className={s.control()}\n aria-label={labels.zoomIn}\n disabled={zoom >= maxZoom}\n onClick={() => setZoom(zoom + 0.5)}\n >\n <ZoomIn size={16} aria-hidden />\n </button>\n </>\n )}\n <BaseDialog.Close className={s.control()} aria-label={labels.close}>\n <X size={17} aria-hidden />\n </BaseDialog.Close>\n </div>\n <div className={s.stageWrap()}>\n {total > 1 && (\n <button\n type=\"button\"\n className={cn(s.nav(), s.prev())}\n aria-label={labels.previous}\n disabled={atStart}\n onClick={() => go(current - 1)}\n >\n <ChevronLeft size={18} aria-hidden className=\"rtl:-scale-x-100\" />\n </button>\n )}\n <figure className=\"m-0 flex min-h-0 min-w-0 flex-1 flex-col\">\n <div className={s.stage()} onDoubleClick={() => !isVideo && setZoom(zoom > 1 ? 1 : 2)}>\n {item &&\n (isVideo ? (\n <video\n key={item.src}\n src={item.src}\n poster={item.poster}\n controls\n aria-label={item.alt}\n className={s.media()}\n style={{ maxHeight: '100%' }}\n >\n {item.captions && <track kind=\"captions\" src={item.captions} default />}\n </video>\n ) : (\n <img\n key={item.src}\n src={item.src}\n alt={item.alt}\n draggable={false}\n className={s.media()}\n style={{\n height: zoom > 1 ? `${zoom * 100}%` : undefined,\n maxHeight: zoom > 1 ? 'none' : '100%',\n maxWidth: zoom > 1 ? 'none' : '100%',\n }}\n />\n ))}\n </div>\n {item?.caption != null && <figcaption className={s.caption()}>{item.caption}</figcaption>}\n </figure>\n {total > 1 && (\n <button\n type=\"button\"\n className={cn(s.nav(), s.next())}\n aria-label={labels.next}\n disabled={atEnd}\n onClick={() => go(current + 1)}\n >\n <ChevronRight size={18} aria-hidden className=\"rtl:-scale-x-100\" />\n </button>\n )}\n </div>\n {showThumbnails && total > 1 && (\n <div ref={thumbsRef} role=\"group\" aria-label={labels.thumbnails} className={s.thumbs()}>\n {items.map((it, i) => {\n const thumb = it.thumbnail ?? (it.type === 'video' ? it.poster : it.src);\n return (\n <button\n key={`${it.src}-${i}`}\n type=\"button\"\n className={s.thumb()}\n aria-label={labels.thumbnail(i, it.alt)}\n aria-current={i === current}\n onClick={() => go(i)}\n >\n {thumb && <img src={thumb} alt=\"\" className={s.thumbImg()} />}\n {it.type === 'video' && (\n <span className={s.thumbBadge()} aria-hidden>\n <Play size={14} />\n </span>\n )}\n </button>\n );\n })}\n </div>\n )}\n <span role=\"status\" className=\"sr-only\">\n {item ? labels.status(current, total, item.alt) : ''}\n </span>\n </BaseDialog.Popup>\n </BaseDialog.Portal>\n </BaseDialog.Root>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Lightbox',\n group: 'Overlays',\n status: 'beta',\n description:\n 'Full-screen image and video viewer: previous / next, zoom (buttons, keys or double click) with a scrollable stage, captions, a thumbnail strip and an announced position. Modal: focus is trapped, Escape closes and focus returns to the opener.',\n primitive: '@base-ui/react/dialog',\n pattern: 'modal dialog with a labelled thumbnail group',\n keyboard: [\n ['ArrowRight / ArrowLeft', 'Next / previous item (mirrored in RTL)'],\n ['Home / End', 'First / last item'],\n ['+ / -', 'Zoom in / out (images)'],\n ['0', 'Reset zoom'],\n ['Tab / Shift+Tab', 'Moves through zoom, close, previous / next and the thumbnails (trapped)'],\n ['Enter / Space on a thumbnail', 'Shows that item'],\n ['Escape', 'Closes the viewer and returns focus'],\n ],\n tokens: [\n 'background',\n 'chrome',\n 'card',\n 'border',\n 'foreground',\n 'muted-foreground',\n 'primary',\n 'secondary',\n 'focus-ring',\n ],\n};\n","export interface ListInputPair {\n key: string;\n value: string;\n}\n\nconst unquote = (v: string) => {\n const t = v.trim();\n if (t.length >= 2 && (t[0] === '\"' || t[0] === \"'\") && t[t.length - 1] === t[0]) return t.slice(1, -1);\n return t;\n};\n\n/**\n * Parses pasted `KEY=value` lines (dotenv style): blank lines and `#` comments are skipped, an\n * `export ` prefix is dropped, values are unquoted. Lines without the separator become keys.\n */\nexport function parseListInputPairs(text: string, separator = '='): ListInputPair[] {\n const pairs: ListInputPair[] = [];\n for (const raw of text.split(/\\r?\\n/)) {\n const line = raw.trim();\n if (!line || line.startsWith('#')) continue;\n const at = line.indexOf(separator);\n const key = (at === -1 ? line : line.slice(0, at)).replace(/^export\\s+/, '').trim();\n const value = at === -1 ? '' : unquote(line.slice(at + separator.length));\n if (key) pairs.push({ key, value });\n }\n return pairs;\n}\n\n/** Serialises rows back to `KEY=value` lines. */\nexport function formatListInputPairs(pairs: readonly ListInputPair[], separator = '='): string {\n return pairs.map((p) => `${p.key}${separator}${p.value}`).join('\\n');\n}\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const listInputVariants = tv({\n slots: {\n root: 'flex min-w-0 flex-col gap-2',\n head: 'grid grid-cols-[minmax(0,1fr)_minmax(0,1.4fr)_auto] gap-2 px-0.5 font-mono text-[10.5px] font-medium tracking-wider text-muted-foreground uppercase',\n list: 'flex flex-col gap-2',\n row: 'flex flex-col gap-1',\n fields: 'grid grid-cols-[minmax(0,1fr)_minmax(0,1.4fr)_auto] items-center gap-2',\n keyInput: 'font-mono',\n valueInput: 'font-mono',\n actions: 'flex items-center gap-0.5',\n error: 'ps-0.5 text-[11.5px] text-destructive-text',\n footer: 'flex items-center gap-2',\n hint: 'ms-auto text-[11.5px] text-muted-foreground',\n },\n});\n\nexport type ListInputVariantProps = VariantProps<typeof listInputVariants>;\n","import { ArrowDown, ArrowUp, Eye, EyeOff, Plus, Trash2 } from 'lucide-react';\nimport { useId, useLayoutEffect, useRef, useState, type ClipboardEvent, type KeyboardEvent } from 'react';\nimport { cn } from '../../utils/cn';\nimport { Button, IconButton } from '../Button';\nimport { Input } from '../Input';\nimport { parseListInputPairs, type ListInputPair } from './list-input-parse';\nimport { listInputVariants } from './list-input.variants';\n\nexport interface ListInputRow extends ListInputPair {\n /** Stable identity for keys and focus; create rows with `createListInputRow`. */\n id: string;\n}\n\nexport interface ListInputRowErrors {\n key?: string | null;\n value?: string | null;\n}\n\nexport interface ListInputLabels {\n key: string;\n value: string;\n add: string;\n remove: (n: number) => string;\n moveUp: (n: number) => string;\n moveDown: (n: number) => string;\n reveal: (n: number) => string;\n duplicate: string;\n added: (count: number) => string;\n removed: (n: number) => string;\n moved: (n: number) => string;\n limit: (max: number) => string;\n pasteHint: string;\n}\n\nconst defaultLabels: ListInputLabels = {\n key: 'Key',\n value: 'Value',\n add: 'Add row',\n remove: (n) => `Remove row ${n}`,\n moveUp: (n) => `Move row ${n} up`,\n moveDown: (n) => `Move row ${n} down`,\n reveal: (n) => `Show value ${n}`,\n duplicate: 'Duplicate key',\n added: (c) => (c === 1 ? 'Added a row.' : `Added ${c} rows.`),\n removed: (n) => `Removed row ${n}.`,\n moved: (n) => `Moved to position ${n}.`,\n limit: (m) => `Limit of ${m} rows reached.`,\n pasteHint: 'Paste KEY=value lines to add several rows.',\n};\n\nlet seq = 0;\n/** A row with a fresh id. */\nexport const createListInputRow = (key = '', value = ''): ListInputRow => ({ id: `row-${++seq}`, key, value });\n\nexport interface ListInputProps {\n value?: ListInputRow[];\n /** Initial rows; ids are added when missing. */\n defaultValue?: Array<ListInputPair & { id?: string }>;\n onValueChange?: (rows: ListInputRow[]) => void;\n /** Accessible name of the row list (e.g. \"Environment variables\"). */\n label: string;\n /** Per-row errors; return null when the row is valid. Empty rows are skipped. */\n validate?: (row: ListInputRow, index: number, rows: readonly ListInputRow[]) => ListInputRowErrors | null | undefined;\n /** Flag repeated keys (case-sensitive). */\n uniqueKeys?: boolean;\n /** Mask values (all rows, or the rows the function picks) with a per-row reveal toggle. */\n secret?: boolean | ((row: ListInputRow) => boolean);\n /** Show move up/down buttons (Alt+Arrow keys work either way). */\n reorderable?: boolean;\n maxRows?: number;\n /** Separator for pasted lines. */\n separator?: string;\n keyPlaceholder?: string;\n valuePlaceholder?: string;\n disabled?: boolean;\n labels?: Partial<ListInputLabels>;\n className?: string;\n}\n\ntype Field = 'key' | 'value';\n\n/**\n * Repeatable key/value rows (env vars, headers, labels): add, remove and reorder with buttons\n * or Alt+Arrow keys, Enter on the last value adds a row, pasted `KEY=value` lines bulk-add,\n * per-row validation (with duplicate-key detection) and optional masked values.\n */\nexport function ListInput({\n value,\n defaultValue,\n onValueChange,\n label,\n validate,\n uniqueKeys = true,\n secret = false,\n reorderable = true,\n maxRows,\n separator = '=',\n keyPlaceholder = 'KEY',\n valuePlaceholder = 'value',\n disabled,\n labels: labelsProp,\n className,\n}: ListInputProps) {\n const labels = { ...defaultLabels, ...labelsProp };\n const [inner, setInner] = useState<ListInputRow[]>(() => {\n const rows = (defaultValue ?? []).map((r) => ({\n ...createListInputRow(r.key, r.value),\n ...(r.id ? { id: r.id } : {}),\n }));\n return rows.length ? rows : [createListInputRow()];\n });\n const rows = value ?? inner;\n const [revealed, setRevealed] = useState<Record<string, boolean>>({});\n const [announcement, setAnnouncement] = useState('');\n const pendingFocus = useRef<{ id: string; field: Field | 'add' } | null>(null);\n const rootRef = useRef<HTMLDivElement | null>(null);\n const uid = useId();\n const s = listInputVariants();\n const full = maxRows != null && rows.length >= maxRows;\n\n useLayoutEffect(() => {\n const target = pendingFocus.current;\n if (!target) return;\n pendingFocus.current = null;\n const root = rootRef.current;\n const el =\n target.field === 'add'\n ? root?.querySelector<HTMLElement>('[data-list-input-add]')\n : root?.querySelector<HTMLElement>(`[data-row-id=\"${target.id}\"] [data-field=\"${target.field}\"]`);\n el?.focus();\n });\n\n const commit = (next: ListInputRow[], message?: string) => {\n setInner(next);\n onValueChange?.(next);\n if (message) setAnnouncement(message);\n };\n\n const keyCounts = new Map<string, number>();\n for (const r of rows) if (r.key) keyCounts.set(r.key, (keyCounts.get(r.key) ?? 0) + 1);\n const errorsFor = (row: ListInputRow, i: number): ListInputRowErrors => {\n if (!row.key && !row.value) return {};\n const custom = validate?.(row, i, rows) ?? {};\n const dup = uniqueKeys && row.key && (keyCounts.get(row.key) ?? 0) > 1 ? labels.duplicate : null;\n return { key: custom.key ?? dup, value: custom.value };\n };\n\n const update = (id: string, patch: Partial<ListInputPair>) =>\n commit(rows.map((r) => (r.id === id ? { ...r, ...patch } : r)));\n\n const add = (after?: number, pairs: ListInputPair[] = [{ key: '', value: '' }]) => {\n const room = maxRows == null ? pairs.length : Math.max(0, maxRows - rows.length);\n if (room === 0) {\n setAnnouncement(labels.limit(maxRows ?? 0));\n return;\n }\n const created = pairs.slice(0, room).map((p) => createListInputRow(p.key, p.value));\n const at = after == null ? rows.length : after + 1;\n commit(\n [...rows.slice(0, at), ...created, ...rows.slice(at)],\n labels.added(created.length) + (created.length < pairs.length ? ` ${labels.limit(maxRows ?? 0)}` : ''),\n );\n const first = created[0];\n if (first) pendingFocus.current = { id: first.id, field: pairs.length > 1 ? 'value' : 'key' };\n };\n\n const remove = (i: number) => {\n const next = rows.filter((_, j) => j !== i);\n const kept = next.length ? next : [createListInputRow()];\n commit(kept, labels.removed(i + 1));\n const focusRow = kept[Math.min(i, kept.length - 1)];\n pendingFocus.current = next.length && focusRow ? { id: focusRow.id, field: 'key' } : { id: '', field: 'add' };\n };\n\n const move = (i: number, delta: number, field: Field) => {\n const j = i + delta;\n const row = rows[i];\n const other = rows[j];\n if (!row || !other) return;\n const next = [...rows];\n next[i] = other;\n next[j] = row;\n commit(next, labels.moved(j + 1));\n pendingFocus.current = { id: row.id, field };\n };\n\n const onFieldKeyDown = (e: KeyboardEvent<HTMLInputElement>, i: number, field: Field) => {\n if (e.altKey && (e.key === 'ArrowUp' || e.key === 'ArrowDown')) {\n e.preventDefault();\n move(i, e.key === 'ArrowUp' ? -1 : 1, field);\n } else if (e.key === 'Enter' && field === 'value' && i === rows.length - 1) {\n e.preventDefault();\n add();\n } else if (e.key === 'Enter' && field === 'key') {\n e.preventDefault();\n e.currentTarget.closest('li')?.querySelector<HTMLElement>('[data-field=\"value\"]')?.focus();\n }\n };\n\n const onPaste = (e: ClipboardEvent<HTMLInputElement>, i: number) => {\n const text = e.clipboardData.getData('text');\n if (!text.includes('\\n') && !text.includes(separator)) return;\n const pairs = parseListInputPairs(text, separator);\n if (!pairs.length) return;\n e.preventDefault();\n const row = rows[i];\n if (row && !row.key && !row.value) {\n const [firstPair, ...rest] = pairs;\n const filled = rows.map((r, j) => (j === i && firstPair ? { ...r, ...firstPair } : r));\n const room = maxRows == null ? rest.length : Math.max(0, maxRows - filled.length);\n const created = rest.slice(0, room).map((p) => createListInputRow(p.key, p.value));\n commit([...filled.slice(0, i + 1), ...created, ...filled.slice(i + 1)], labels.added(created.length + 1));\n const last = created[created.length - 1];\n pendingFocus.current = { id: last ? last.id : row.id, field: 'value' };\n } else add(i, pairs);\n };\n\n return (\n <div ref={rootRef} className={cn(s.root(), className)}>\n <div aria-hidden className={s.head()}>\n <span>{labels.key}</span>\n <span>{labels.value}</span>\n <span />\n </div>\n <ul aria-label={label} className={s.list()}>\n {rows.map((row, i) => {\n const n = i + 1;\n const errs = errorsFor(row, i);\n const masked = (typeof secret === 'function' ? secret(row) : secret) && !revealed[row.id];\n const isSecret = typeof secret === 'function' ? secret(row) : secret;\n const keyErrId = `${uid}-${row.id}-kerr`;\n const valErrId = `${uid}-${row.id}-verr`;\n return (\n <li key={row.id} data-row-id={row.id} className={s.row()}>\n <div className={s.fields()}>\n <Input\n size=\"sm\"\n data-field=\"key\"\n aria-label={`${labels.key} ${n}`}\n placeholder={keyPlaceholder}\n value={row.key}\n disabled={disabled}\n invalid={!!errs.key}\n aria-describedby={errs.key ? keyErrId : undefined}\n autoComplete=\"off\"\n spellCheck={false}\n inputClassName={s.keyInput()}\n onValueChange={(v: string) => update(row.id, { key: v })}\n onKeyDown={(e: KeyboardEvent<HTMLInputElement>) => onFieldKeyDown(e, i, 'key')}\n onPaste={(e: ClipboardEvent<HTMLInputElement>) => onPaste(e, i)}\n />\n <Input\n size=\"sm\"\n data-field=\"value\"\n type={masked ? 'password' : 'text'}\n aria-label={`${labels.value} ${n}`}\n placeholder={valuePlaceholder}\n value={row.value}\n disabled={disabled}\n invalid={!!errs.value}\n aria-describedby={errs.value ? valErrId : undefined}\n autoComplete=\"off\"\n spellCheck={false}\n inputClassName={s.valueInput()}\n onValueChange={(v: string) => update(row.id, { value: v })}\n onKeyDown={(e: KeyboardEvent<HTMLInputElement>) => onFieldKeyDown(e, i, 'value')}\n trailingAddon={\n isSecret ? (\n <button\n type=\"button\"\n aria-label={labels.reveal(n)}\n aria-pressed={!masked}\n disabled={disabled}\n onClick={() => setRevealed((r) => ({ ...r, [row.id]: !r[row.id] }))}\n className=\"grid size-6 place-items-center rounded text-muted-foreground hover:text-foreground focus-visible:outline-2 focus-visible:outline-focus-ring\"\n >\n {masked ? <Eye size={13} aria-hidden /> : <EyeOff size={13} aria-hidden />}\n </button>\n ) : undefined\n }\n />\n <div className={s.actions()}>\n {reorderable && (\n <>\n <IconButton\n size=\"sm\"\n icon={ArrowUp}\n label={labels.moveUp(n)}\n disabled={disabled || i === 0}\n onClick={() => move(i, -1, 'key')}\n />\n <IconButton\n size=\"sm\"\n icon={ArrowDown}\n label={labels.moveDown(n)}\n disabled={disabled || i === rows.length - 1}\n onClick={() => move(i, 1, 'key')}\n />\n </>\n )}\n <IconButton\n size=\"sm\"\n icon={Trash2}\n label={labels.remove(n)}\n disabled={disabled}\n onClick={() => remove(i)}\n />\n </div>\n </div>\n {errs.key && (\n <p id={keyErrId} className={s.error()}>\n {errs.key}\n </p>\n )}\n {errs.value && (\n <p id={valErrId} className={s.error()}>\n {errs.value}\n </p>\n )}\n </li>\n );\n })}\n </ul>\n <div className={s.footer()}>\n <Button\n size=\"sm\"\n variant=\"secondary\"\n icon={Plus}\n data-list-input-add=\"\"\n disabled={disabled || full}\n onClick={() => add()}\n >\n {labels.add}\n </Button>\n <span className={s.hint()}>{full ? labels.limit(maxRows ?? 0) : labels.pasteHint}</span>\n </div>\n <span role=\"status\" className=\"sr-only\">\n {announcement}\n </span>\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'ListInput',\n group: 'Forms',\n status: 'beta',\n description:\n 'Repeatable key/value rows for environment variables, headers or labels: add, remove and reorder (buttons or Alt+Arrow), paste `KEY=value` lines to bulk-add, per-row validation with duplicate-key detection, optional masked values with a reveal toggle. Changes are announced.',\n pattern: 'list of labelled text field pairs',\n keyboard: [\n ['Tab', 'Moves through key, value, reveal, move and remove controls row by row'],\n ['Enter (key field)', 'Moves to the row value'],\n ['Enter (last value)', 'Adds a row and focuses its key'],\n ['Alt+ArrowUp / Alt+ArrowDown', 'Moves the row up / down, keeping focus in the same field'],\n ['Paste', 'Multi-line or KEY=value text is split into rows'],\n ['Enter / Space on a remove button', 'Removes the row and focuses the next one'],\n ],\n tokens: [\n 'background',\n 'border',\n 'foreground',\n 'muted-foreground',\n 'destructive',\n 'destructive-text',\n 'secondary',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const megaMenuVariants = tv({\n slots: {\n root: 'relative min-w-0',\n list: 'flex min-w-0 items-center gap-0.5 overflow-x-auto [scrollbar-width:none]',\n trigger: [\n 'group inline-flex h-9 shrink-0 items-center gap-1.5 rounded-lg px-3 text-[13px] font-medium text-muted-foreground transition-colors select-none',\n 'hover:bg-accent/45 hover:text-foreground data-popup-open:bg-accent/45 data-popup-open:text-foreground motion-reduce:transition-none',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n 'data-current:font-semibold data-current:text-foreground aria-[current=page]:bg-accent aria-[current=page]:font-semibold aria-[current=page]:text-accent-foreground',\n ],\n chevron: 'transition-transform duration-200 group-data-popup-open:rotate-180 motion-reduce:transition-none',\n positioner: [\n 'z-50 h-[var(--positioner-height)] w-[var(--positioner-width)] max-w-[var(--available-width)]',\n 'transition-[top,left,right,bottom] duration-300 ease-out data-instant:transition-none motion-reduce:transition-none',\n ],\n popup: [\n 'relative h-[var(--popup-height)] w-[var(--popup-width)] origin-[var(--transform-origin)] overflow-hidden rounded-xl border border-border bg-popover text-popover-foreground shadow-lg outline-none',\n 'transition-[opacity,scale,width,height] duration-300 ease-out motion-reduce:transition-none',\n 'data-starting-style:scale-[0.97] data-starting-style:opacity-0 data-ending-style:scale-[0.97] data-ending-style:opacity-0 data-ending-style:duration-150',\n ],\n viewport: 'relative h-full w-full overflow-hidden',\n content: [\n 'flex h-full w-[calc(100vw-2rem)] flex-col gap-4 p-4 sm:w-max sm:max-w-[min(56rem,calc(100vw-2rem))] sm:flex-row',\n 'transition-opacity duration-300 data-starting-style:opacity-0 data-ending-style:opacity-0 motion-reduce:transition-none',\n ],\n columns:\n 'grid min-w-0 flex-1 grid-cols-1 gap-x-4 gap-y-4 sm:grid-cols-[repeat(var(--mega-cols),minmax(13rem,1fr))]',\n section: 'flex min-w-0 flex-col gap-1',\n sectionTitle: 'px-2.5 pb-1 font-mono text-[10.5px] font-medium tracking-wider text-muted-foreground uppercase',\n links: 'flex flex-col gap-0.5',\n link: [\n 'flex min-w-0 items-start gap-3 rounded-lg px-2.5 py-2 text-start no-underline transition-colors motion-reduce:transition-none',\n 'hover:bg-secondary/60 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus-ring',\n 'data-active:bg-primary/10',\n ],\n linkIcon:\n 'mt-0.5 grid size-7 shrink-0 place-items-center rounded-md border border-border bg-card text-muted-foreground',\n linkText: 'flex min-w-0 flex-col',\n linkLabel: 'text-[13px] font-medium text-foreground',\n linkDescription: 'text-[12px] leading-[1.45] text-muted-foreground text-pretty',\n featured: 'flex shrink-0 flex-col sm:w-60',\n },\n});\n\nexport type MegaMenuVariantProps = VariantProps<typeof megaMenuVariants>;\n","import { NavigationMenu } from '@base-ui/react/navigation-menu';\nimport { ChevronDown } from 'lucide-react';\nimport { createElement, useId, type CSSProperties, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { useLinkComponent } from '../Link';\nimport type { NavIcon, NavItem } from '../NavList';\nimport { megaMenuVariants } from './mega-menu.variants';\n\nexport interface MegaMenuLink {\n label: string;\n href: string;\n description?: string;\n icon?: NavIcon;\n /** Marks the current page. Defaults to `href === currentHref`. */\n current?: boolean;\n}\n\nexport interface MegaMenuSection {\n /** Column heading; also names the column's list. */\n title?: string;\n links: MegaMenuLink[];\n}\n\nexport interface MegaMenuItem {\n id?: string;\n label: string;\n /** A plain top-level link (no panel). */\n href?: string;\n current?: boolean;\n /** Columns of the panel; an item with sections becomes a panel trigger. */\n sections?: MegaMenuSection[];\n /** Extra panel content beside the columns (a promo card, a changelog entry…). */\n featured?: ReactNode;\n}\n\nexport interface MegaMenuProps {\n items: MegaMenuItem[];\n /** Accessible name of the navigation landmark. */\n label?: string;\n currentHref?: string;\n /** Called when any link is activated. */\n onNavigate?: (link: MegaMenuLink | MegaMenuItem) => void;\n className?: string;\n}\n\nconst s = megaMenuVariants();\nconst isCurrent = (l: { href?: string; current?: boolean }, currentHref?: string) =>\n l.current ?? (!!l.href && l.href === currentHref);\n\n/** Flattens MegaMenu items into NavItems, e.g. to feed StackedLayout `links` / MobileNav on small screens. */\nexport function megaMenuNavItems(items: MegaMenuItem[]): NavItem[] {\n return items.map((it) => ({\n id: it.id,\n label: it.label,\n href: it.href,\n current: it.current,\n items: it.sections?.flatMap((sec) =>\n sec.links.map((l) => ({ label: l.label, href: l.href, icon: l.icon, current: l.current })),\n ),\n }));\n}\n\nfunction PanelLink({\n link,\n currentHref,\n onNavigate,\n}: {\n link: MegaMenuLink;\n currentHref?: string;\n onNavigate?: MegaMenuProps['onNavigate'];\n}) {\n const RouterLink = useLinkComponent();\n const current = isCurrent(link, currentHref);\n const IconCmp = link.icon;\n return (\n <NavigationMenu.Link\n href={link.href}\n active={current}\n closeOnClick\n aria-current={current ? 'page' : undefined}\n render={RouterLink ? (props) => createElement(RouterLink, props) : undefined}\n className={s.link()}\n onClick={() => onNavigate?.(link)}\n >\n {IconCmp && (\n <span className={s.linkIcon()} aria-hidden>\n <IconCmp size={15} aria-hidden />\n </span>\n )}\n <span className={s.linkText()}>\n <span className={s.linkLabel()}>{link.label}</span>\n {link.description && <span className={s.linkDescription()}>{link.description}</span>}\n </span>\n </NavigationMenu.Link>\n );\n}\n\nfunction Panel({\n item,\n currentHref,\n onNavigate,\n}: {\n item: MegaMenuItem;\n currentHref?: string;\n onNavigate?: MegaMenuProps['onNavigate'];\n}) {\n const id = useId();\n const sections = item.sections ?? [];\n const cols = { '--mega-cols': Math.min(sections.length, 3) } as CSSProperties;\n return (\n <NavigationMenu.Content className={s.content()}>\n <div className={s.columns()} style={cols}>\n {sections.map((sec, i) => (\n <div key={sec.title ?? i} className={s.section()}>\n {sec.title && (\n <p id={`${id}-${i}`} className={s.sectionTitle()}>\n {sec.title}\n </p>\n )}\n <ul className={s.links()} aria-labelledby={sec.title ? `${id}-${i}` : undefined}>\n {sec.links.map((link) => (\n <li key={link.href}>\n <PanelLink link={link} currentHref={currentHref} onNavigate={onNavigate} />\n </li>\n ))}\n </ul>\n </div>\n ))}\n </div>\n {item.featured != null && <div className={s.featured()}>{item.featured}</div>}\n </NavigationMenu.Content>\n );\n}\n\nfunction TopLink({\n item,\n currentHref,\n onNavigate,\n}: {\n item: MegaMenuItem;\n currentHref?: string;\n onNavigate?: MegaMenuProps['onNavigate'];\n}) {\n const RouterLink = useLinkComponent();\n const current = isCurrent(item, currentHref);\n return (\n <NavigationMenu.Link\n href={item.href}\n active={current}\n aria-current={current ? 'page' : undefined}\n render={RouterLink ? (props) => createElement(RouterLink, props) : undefined}\n className={s.trigger()}\n onClick={() => onNavigate?.(item)}\n >\n {item.label}\n </NavigationMenu.Link>\n );\n}\n\n/**\n * Top navigation with wide panels (Base UI Navigation Menu): items with `sections` open a panel\n * of link columns with descriptions (and optional featured content), plain items are links.\n * Router links come from LinkProvider; the trigger of the section holding the current page is\n * marked. Pair it with StackedLayout (as its sub-nav row) and `megaMenuNavItems` for MobileNav.\n */\nexport function MegaMenu({ items, label = 'Main', currentHref, onNavigate, className }: MegaMenuProps) {\n return (\n <NavigationMenu.Root aria-label={label} className={cn(s.root(), className)}>\n <NavigationMenu.List className={s.list()}>\n {items.map((item) => (\n <NavigationMenu.Item key={item.id ?? item.label} value={item.id ?? item.label}>\n {item.sections?.length ? (\n <>\n <NavigationMenu.Trigger\n className={s.trigger()}\n data-current={\n item.sections.some((sec) => sec.links.some((l) => isCurrent(l, currentHref))) || undefined\n }\n >\n {item.label}\n <NavigationMenu.Icon className={s.chevron()}>\n <ChevronDown size={14} aria-hidden />\n </NavigationMenu.Icon>\n </NavigationMenu.Trigger>\n <Panel item={item} currentHref={currentHref} onNavigate={onNavigate} />\n </>\n ) : (\n <TopLink item={item} currentHref={currentHref} onNavigate={onNavigate} />\n )}\n </NavigationMenu.Item>\n ))}\n </NavigationMenu.List>\n <NavigationMenu.Portal>\n <NavigationMenu.Positioner\n className={s.positioner()}\n sideOffset={8}\n align=\"start\"\n collisionPadding={16}\n collisionAvoidance={{ side: 'none' }}\n >\n <NavigationMenu.Popup className={s.popup()}>\n <NavigationMenu.Viewport className={s.viewport()} />\n </NavigationMenu.Popup>\n </NavigationMenu.Positioner>\n </NavigationMenu.Portal>\n </NavigationMenu.Root>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'MegaMenu',\n group: 'Navigation',\n status: 'beta',\n description:\n 'Top navigation with wide panels: items with sections open a panel of link columns with descriptions and optional featured content; plain items are links. Hover or click opens, the panel resizes between items, router links come from LinkProvider and the current page is marked. Use it as the StackedLayout sub-nav row; `megaMenuNavItems` feeds MobileNav.',\n primitive: '@base-ui/react/navigation-menu',\n pattern: 'disclosure navigation (nav landmark, triggers with aria-expanded)',\n keyboard: [\n ['Tab', 'Moves between top-level items, then into an open panel'],\n ['Enter / Space / ArrowDown', 'Opens the panel of the focused trigger'],\n ['ArrowRight / ArrowLeft', 'Moves between top-level items'],\n ['Escape', 'Closes the panel and returns focus to its trigger'],\n ],\n tokens: [\n 'popover',\n 'popover-foreground',\n 'border',\n 'accent',\n 'accent-foreground',\n 'secondary',\n 'primary',\n 'muted-foreground',\n 'focus-ring',\n ],\n};\n","import { Menu as BaseMenu } from '@base-ui/react/menu';\nimport { Check, ChevronRight } from 'lucide-react';\nimport type { ComponentType, ReactNode } from 'react';\nimport { usePortalDir } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { menuVariants } from './menu.variants';\n\ntype IconComponent = ComponentType<{ size?: number; 'aria-hidden'?: boolean; className?: string }>;\n\nconst s = menuVariants();\n\n/** Menu state container (open, defaultOpen, onOpenChange, modal). Renders no element. */\nexport const Menu = BaseMenu.Root;\n/** Opens the menu. Use `render={<Button />}` or `render={<IconButton … />}` to keep the kit look. */\nexport const MenuTrigger = BaseMenu.Trigger;\n/** Groups items; label it with MenuGroupLabel. */\nexport const MenuGroup = BaseMenu.Group;\n/** Single-choice group (value, defaultValue, onValueChange). */\nexport const MenuRadioGroup = BaseMenu.RadioGroup;\n/** Wraps a MenuSubTrigger and its MenuSubContent. */\nexport const MenuSub = BaseMenu.SubmenuRoot;\n\nexport interface MenuContentProps extends Omit<BaseMenu.Popup.Props, 'className'> {\n className?: string;\n side?: BaseMenu.Positioner.Props['side'];\n align?: BaseMenu.Positioner.Props['align'];\n /** Gap between trigger and menu, in px. */\n sideOffset?: BaseMenu.Positioner.Props['sideOffset'];\n alignOffset?: BaseMenu.Positioner.Props['alignOffset'];\n /** Portal container; defaults to document.body. */\n container?: BaseMenu.Portal.Props['container'];\n children?: ReactNode;\n}\n\n/** The floating list (role `menu`): portal, positioner and popup. */\nexport function MenuContent({\n side,\n align = 'start',\n sideOffset = 8,\n alignOffset,\n className,\n container,\n children,\n ...props\n}: MenuContentProps) {\n const dir = usePortalDir();\n return (\n <BaseMenu.Portal container={container}>\n <BaseMenu.Positioner\n dir={dir}\n className={s.positioner()}\n side={side}\n align={align}\n sideOffset={sideOffset}\n alignOffset={alignOffset}\n >\n <BaseMenu.Popup className={cn(s.popup(), className)} {...props}>\n {children}\n </BaseMenu.Popup>\n </BaseMenu.Positioner>\n </BaseMenu.Portal>\n );\n}\n\n/** Submenu popup; opens to the inline end of its MenuSubTrigger. */\nexport function MenuSubContent({ sideOffset = 6, alignOffset = -7, ...props }: MenuContentProps) {\n return <MenuContent sideOffset={sideOffset} alignOffset={alignOffset} {...props} />;\n}\n\nexport interface MenuItemProps extends Omit<BaseMenu.Item.Props, 'className'> {\n className?: string;\n /** Leading icon (a lucide icon component). */\n icon?: IconComponent;\n /** Shortcut hint shown on the right, e.g. \"⌘D\". Display only. */\n shortcut?: string;\n /** Danger styling for irreversible actions. */\n destructive?: boolean;\n}\n\n/** An action. Enter, Space or a click runs `onClick` and closes the menu. */\nexport function MenuItem({ icon: IconCmp, shortcut, destructive, className, children, ...props }: MenuItemProps) {\n const v = menuVariants({ destructive });\n return (\n <BaseMenu.Item className={cn(v.item(), className)} {...props}>\n {IconCmp && <IconCmp size={15} aria-hidden className={v.itemIcon()} />}\n <span className={v.itemLabel()}>{children}</span>\n {shortcut && (\n <span aria-hidden className={v.shortcut()}>\n {shortcut}\n </span>\n )}\n </BaseMenu.Item>\n );\n}\n\nexport interface MenuCheckboxItemProps extends Omit<BaseMenu.CheckboxItem.Props, 'className'> {\n className?: string;\n}\n\n/** Toggle item (role `menuitemcheckbox`). Stays open on select so several can be toggled. */\nexport function MenuCheckboxItem({ className, children, ...props }: MenuCheckboxItemProps) {\n return (\n <BaseMenu.CheckboxItem className={cn(s.item(), 'group', className)} {...props}>\n <span className={s.checkbox()} aria-hidden>\n <BaseMenu.CheckboxItemIndicator>\n <Check size={12} strokeWidth={2.6} aria-hidden />\n </BaseMenu.CheckboxItemIndicator>\n </span>\n <span className={s.itemLabel()}>{children}</span>\n </BaseMenu.CheckboxItem>\n );\n}\n\nexport interface MenuRadioItemProps extends Omit<BaseMenu.RadioItem.Props, 'className'> {\n className?: string;\n}\n\n/** Single-choice item (role `menuitemradio`) inside a MenuRadioGroup; a check marks the selection. */\nexport function MenuRadioItem({ className, children, closeOnClick = true, ...props }: MenuRadioItemProps) {\n return (\n <BaseMenu.RadioItem className={cn(s.item(), className)} closeOnClick={closeOnClick} {...props}>\n <span className={s.itemLabel()}>{children}</span>\n <BaseMenu.RadioItemIndicator className={s.radioIndicator()}>\n <Check size={15} aria-hidden />\n </BaseMenu.RadioItemIndicator>\n </BaseMenu.RadioItem>\n );\n}\n\nexport function MenuGroupLabel({\n className,\n ...props\n}: Omit<BaseMenu.GroupLabel.Props, 'className'> & { className?: string }) {\n return <BaseMenu.GroupLabel className={cn(s.groupLabel(), className)} {...props} />;\n}\n\nexport function MenuSeparator({\n className,\n ...props\n}: Omit<BaseMenu.Separator.Props, 'className'> & { className?: string }) {\n return <BaseMenu.Separator className={cn(s.separator(), className)} {...props} />;\n}\n\nexport interface MenuSubTriggerProps extends Omit<BaseMenu.SubmenuTrigger.Props, 'className'> {\n className?: string;\n icon?: IconComponent;\n}\n\n/** Item that opens a submenu (ArrowRight, Enter or hover). */\nexport function MenuSubTrigger({ icon: IconCmp, className, children, ...props }: MenuSubTriggerProps) {\n return (\n <BaseMenu.SubmenuTrigger className={cn(s.subTrigger(), className)} {...props}>\n {IconCmp && <IconCmp size={15} aria-hidden className={s.itemIcon()} />}\n <span className={s.itemLabel()}>{children}</span>\n <ChevronRight size={14} aria-hidden className={s.subChevron()} />\n </BaseMenu.SubmenuTrigger>\n );\n}\n","import { MoreHorizontal } from 'lucide-react';\nimport { IconButton, type ButtonProps } from '../Button';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { Menu, MenuContent, MenuItem, MenuSeparator, MenuTrigger, type MenuItemProps } from './Menu';\n\nexport interface MoreMenuAction {\n label: string;\n icon?: MenuItemProps['icon'];\n shortcut?: string;\n destructive?: boolean;\n disabled?: boolean;\n onSelect?: () => void;\n}\n\nexport interface MoreMenuProps {\n /** Actions in order; the string `'separator'` draws a divider. */\n items: Array<MoreMenuAction | 'separator'>;\n /** Accessible name of the trigger. */\n label?: string;\n /** Trigger style. */\n variant?: ButtonProps['variant'];\n size?: ButtonProps['size'];\n align?: 'start' | 'center' | 'end';\n className?: string;\n}\n\n/** Row-actions shorthand: an icon button with a \"more\" glyph that opens a menu built from `items`. */\nexport function MoreMenu({\n items,\n label: labelProp,\n variant = 'secondary',\n size = 'md',\n align = 'end',\n className,\n}: MoreMenuProps) {\n const { t } = useI18n();\n const label = labelProp ?? t('common.moreActions');\n return (\n <Menu>\n <MenuTrigger\n render={<IconButton icon={MoreHorizontal} label={label} variant={variant} size={size} className={className} />}\n />\n <MenuContent align={align}>\n {items.map((item, i) =>\n item === 'separator' ? (\n <MenuSeparator key={`sep-${i}`} />\n ) : (\n <MenuItem\n key={item.label}\n icon={item.icon}\n shortcut={item.shortcut}\n destructive={item.destructive}\n disabled={item.disabled}\n onClick={item.onSelect}\n >\n {item.label}\n </MenuItem>\n ),\n )}\n </MenuContent>\n </Menu>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Menu',\n group: 'Overlays',\n status: 'stable',\n description:\n 'Dropdown list of actions or options: items with icon, shortcut hint and destructive tone, checkbox and radio items, labelled groups, separators and submenus. MoreMenu is the row-actions shorthand (icon button + items array).',\n primitive: '@base-ui/react/menu',\n pattern: 'menu button',\n keyboard: [\n ['Enter / Space / ArrowDown', 'On the trigger: opens the menu and focuses the first item'],\n ['ArrowDown / ArrowUp', 'Moves between items (wraps)'],\n ['Enter', 'Activates the highlighted item'],\n ['ArrowRight', 'Opens the submenu of a submenu trigger; ArrowLeft closes it'],\n ['Escape', 'Closes the menu and returns focus to the trigger'],\n ],\n tokens: [\n 'popover',\n 'popover-foreground',\n 'border',\n 'secondary',\n 'muted-foreground',\n 'destructive',\n 'destructive-text',\n 'primary',\n 'primary-text',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\n/**\n * Usage meter. The level comes from the thresholds: green while healthy, amber near the cap,\n * red at or over it. The brand green never signals severity on its own.\n */\nexport const meterVariants = tv({\n slots: {\n root: 'grid w-full gap-1.5',\n header: 'flex items-baseline justify-between gap-3',\n label: 'text-[13px] font-medium text-foreground',\n value: 'font-mono text-[11.5px] font-semibold tabular-nums',\n track: 'relative w-full overflow-hidden rounded-full bg-secondary',\n indicator: 'block h-full rounded-full transition-[width] duration-400 ease-out motion-reduce:transition-none',\n note: 'font-mono text-[11px]',\n },\n variants: {\n level: {\n ok: { indicator: 'bg-primary', value: 'text-foreground', note: 'text-muted-foreground' },\n warning: { indicator: 'bg-warning', value: 'text-warning-text', note: 'text-warning-text' },\n critical: { indicator: 'bg-destructive', value: 'text-destructive-text', note: 'text-destructive-text' },\n },\n size: {\n sm: { track: 'h-1.5' },\n md: { track: 'h-2' },\n lg: { track: 'h-2.5' },\n },\n },\n defaultVariants: { level: 'ok', size: 'md' },\n});\n\nexport type MeterVariantProps = VariantProps<typeof meterVariants>;\nexport type MeterLevel = NonNullable<MeterVariantProps['level']>;\n\nexport interface MeterThresholds {\n /**\n * Percent of max at which the meter turns amber. Default 80 (at or above). With\n * `higherIsBetter`, the meter turns amber at or below it; default 50.\n */\n warning?: number;\n /**\n * Percent of max at which the meter turns red. Default 100 (at or above). With\n * `higherIsBetter`, the meter turns red at or below it; default 20.\n */\n destructive?: number;\n}\n\n/**\n * Maps a percentage of max to a level using the thresholds. By default high is bad (quotas);\n * pass `higherIsBetter` for scores, health or remaining budget, where low is bad.\n */\nexport function getMeterLevel(percent: number, thresholds: MeterThresholds = {}, higherIsBetter = false): MeterLevel {\n if (higherIsBetter) {\n const { warning = 50, destructive = 20 } = thresholds;\n if (percent <= destructive) return 'critical';\n if (percent <= warning) return 'warning';\n return 'ok';\n }\n const { warning = 80, destructive = 100 } = thresholds;\n if (percent >= destructive) return 'critical';\n if (percent >= warning) return 'warning';\n return 'ok';\n}\n","import { Meter as BaseMeter } from '@base-ui/react/meter';\nimport type { ReactNode, Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { getMeterLevel, meterVariants, type MeterThresholds, type MeterVariantProps } from './meter.variants';\n\nexport interface MeterProps\n extends Omit<BaseMeter.Root.Props, 'className' | 'children'>, Omit<MeterVariantProps, 'level'> {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n /** Visible label; also the accessible name. Without it, pass `aria-label`. */\n label?: ReactNode;\n /** Replaces the formatted value, e.g. \"8.2k / 10k requests\". Pair with `aria-valuetext`. */\n valueLabel?: ReactNode;\n /** Hides the value text. */\n hideValue?: boolean;\n /** Percent-of-max thresholds for the warning and destructive levels. */\n thresholds?: MeterThresholds;\n /**\n * Inverts the thresholds: low values are bad (scores, health, remaining budget). Default\n * false (high is bad, as for quotas). Defaults become warning ≤ 50 %, destructive ≤ 20 %.\n */\n higherIsBetter?: boolean;\n /** Helper line under the bar, coloured by level (e.g. \"Overage billed at $0.002 / request\"). */\n note?: ReactNode;\n}\n\n/**\n * Quota / usage meter (role=\"meter\") on Base UI Meter. Values over `max` are clamped for\n * assistive tech and the bar, but the level (and your `valueLabel`) reflect the overage.\n */\nexport function Meter({\n value,\n min = 0,\n max = 100,\n size,\n label,\n valueLabel,\n hideValue = false,\n thresholds,\n higherIsBetter = false,\n note,\n className,\n ...props\n}: MeterProps) {\n const range = max - min;\n const percent = range > 0 ? ((value - min) / range) * 100 : 0;\n const level = getMeterLevel(percent, thresholds, higherIsBetter);\n const s = meterVariants({ level, size });\n const clamped = Math.min(Math.max(value, min), max);\n return (\n <BaseMeter.Root\n value={clamped}\n min={min}\n max={max}\n data-level={level}\n className={cn(s.root(), className)}\n {...props}\n >\n {(label != null || !hideValue) && (\n <div className={s.header()}>\n {label != null ? <BaseMeter.Label className={s.label()}>{label}</BaseMeter.Label> : <span />}\n {!hideValue &&\n (valueLabel != null ? (\n <span className={s.value()}>{valueLabel}</span>\n ) : (\n <BaseMeter.Value className={s.value()} />\n ))}\n </div>\n )}\n <BaseMeter.Track className={s.track()}>\n <BaseMeter.Indicator className={s.indicator()} />\n </BaseMeter.Track>\n {note != null && <p className={s.note()}>{note}</p>}\n </BaseMeter.Root>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Meter',\n group: 'Feedback',\n status: 'stable',\n description:\n 'Usage meter for quotas and limits: label, value text, and a level set by thresholds (healthy → warning near the cap → destructive at or over it), with an optional note under the bar. `higherIsBetter` inverts the thresholds for scores and health (low = warning / destructive).',\n primitive: '@base-ui/react/meter',\n pattern: 'meter',\n tokens: [\n 'primary',\n 'warning',\n 'warning-text',\n 'destructive',\n 'destructive-text',\n 'secondary',\n 'foreground',\n 'muted-foreground',\n ],\n};\n","import { createContext, useContext, type ComponentType, type MouseEvent, type ReactNode } from 'react';\n\nexport type NavIcon = ComponentType<{ size?: number; 'aria-hidden'?: boolean; className?: string }>;\n\nexport interface NavItem {\n /** Stable key; defaults to `href`, then `label`. */\n id?: string;\n label: string;\n /** Destination. Rendered through the LinkProvider's router link when one is set. Without it the item is a button. */\n href?: string;\n icon?: NavIcon;\n /** Count or short tag on the right (a dot in the collapsed rail). */\n badge?: ReactNode;\n /** Marks the item as the current page. Defaults to `href === currentHref`. */\n current?: boolean;\n disabled?: boolean;\n /** Nested sub-items: the item becomes a collapsible section (a flyout menu in the rail). */\n items?: NavItem[];\n /** Initial expansion of a nested section; defaults to open when it contains the current page. */\n defaultOpen?: boolean;\n onClick?: (event: MouseEvent<HTMLElement>) => void;\n}\n\nexport interface NavGroup {\n id?: string;\n /** Group heading (mono, uppercase). Also names the group's list. */\n label?: string;\n items: NavItem[];\n /** Turns the heading into a toggle that folds the group. */\n collapsible?: boolean;\n defaultOpen?: boolean;\n}\n\nexport interface NavContextValue {\n collapsed: boolean;\n currentHref?: string;\n onNavigate?: (item: NavItem) => void;\n}\n\nexport const NavContext = createContext<NavContextValue>({ collapsed: false });\nexport const useNavListContext = () => useContext(NavContext);\n\nexport function isNavItemCurrent(item: NavItem, currentHref?: string): boolean {\n return item.current ?? (currentHref !== undefined && item.href !== undefined && item.href === currentHref);\n}\n\nexport function navItemContainsCurrent(item: NavItem, currentHref?: string): boolean {\n return (item.items ?? []).some(\n (child) => isNavItemCurrent(child, currentHref) || navItemContainsCurrent(child, currentHref),\n );\n}\n\nexport const navItemKey = (item: NavItem) => item.id ?? item.href ?? item.label;\n","import { tv, type VariantProps } from '../../utils/tv';\n\nconst focus = 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring';\n\nexport const navListVariants = tv({\n slots: {\n root: 'flex flex-col gap-4',\n group: 'flex flex-col gap-0.5',\n groupLabel: 'px-2.5 pt-1 pb-1 font-mono text-[9.5px] tracking-[0.14em] text-muted-foreground uppercase select-none',\n groupTrigger: [\n 'group mb-0.5 flex w-full cursor-pointer items-center justify-between rounded-md px-2.5 py-1 transition-colors select-none hover:bg-accent/40 motion-reduce:transition-none',\n focus,\n ],\n groupTriggerLabel:\n 'font-mono text-[9.5px] tracking-[0.14em] text-muted-foreground uppercase group-hover:text-foreground',\n groupChevron:\n 'shrink-0 text-muted-foreground transition-transform duration-200 group-data-panel-closed:-rotate-90 motion-reduce:transition-none',\n railDivider: 'mx-auto mb-1 h-px w-5 bg-border',\n list: 'm-0 flex list-none flex-col gap-0.5 p-0',\n panel: [\n 'h-(--collapsible-panel-height) overflow-hidden transition-[height] duration-200 ease-out motion-reduce:transition-none',\n 'data-starting-style:h-0 data-ending-style:h-0',\n ],\n item: [\n 'relative flex h-control cursor-pointer items-center rounded-lg text-[13px] no-underline transition-colors motion-reduce:transition-none',\n 'font-medium text-muted-foreground hover:bg-accent/45 hover:text-foreground',\n 'aria-[current=page]:bg-accent aria-[current=page]:font-semibold aria-[current=page]:text-accent-foreground',\n 'aria-disabled:pointer-events-none aria-disabled:opacity-50',\n focus,\n ],\n indicator: 'absolute top-1.5 bottom-1.5 start-0 w-[3px] rounded-e bg-primary',\n icon: 'shrink-0',\n label: 'min-w-0 flex-1 truncate text-start',\n badge:\n 'inline-flex h-[18px] shrink-0 items-center rounded-full bg-secondary px-1.5 font-mono text-[10.5px] text-muted-foreground',\n railBadge: 'absolute top-1.5 end-1.5 size-1.5 rounded-full bg-primary',\n parent: 'w-full font-semibold text-foreground',\n parentChevron:\n 'shrink-0 text-muted-foreground transition-transform duration-200 group-data-panel-closed:-rotate-90 motion-reduce:transition-none',\n subList: 'm-0 mt-0.5 ms-[18px] flex list-none flex-col gap-0.5 border-s border-border p-0 ps-3',\n subItem: [\n 'flex h-control-sm cursor-pointer items-center gap-2 rounded-md px-2.5 text-[12.5px] no-underline transition-colors motion-reduce:transition-none',\n 'font-medium text-muted-foreground hover:bg-accent/40 hover:text-foreground',\n 'aria-[current=page]:bg-accent aria-[current=page]:font-semibold aria-[current=page]:text-accent-foreground',\n focus,\n ],\n },\n variants: {\n collapsed: {\n true: { item: 'mx-auto w-control justify-center' },\n false: { item: 'w-full gap-2.5 px-2.5' },\n },\n current: {\n // On the selected row (bg-accent) the count reads in the row's own foreground.\n true: { badge: 'bg-accent-foreground/12 text-accent-foreground' },\n },\n },\n defaultVariants: { collapsed: false, current: false },\n});\n\nexport type NavListVariantProps = VariantProps<typeof navListVariants>;\n","import { Collapsible } from '@base-ui/react/collapsible';\nimport { Menu as BaseMenu } from '@base-ui/react/menu';\nimport { ChevronDown } from 'lucide-react';\nimport { createElement, type MouseEvent, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { useLinkComponent } from '../Link';\nimport { Menu, MenuContent, MenuGroup, MenuGroupLabel, MenuItem, MenuTrigger, menuVariants } from '../Menu';\nimport { SimpleTooltip } from '../Tooltip';\nimport { isNavItemCurrent, navItemContainsCurrent, navItemKey, useNavListContext, type NavItem } from './nav-context';\nimport { navListVariants } from './nav-list.variants';\n\nconst ICON_SIZE = { 0: 17, 1: 15 } as const;\n\n/** Accessible name in the rail, where the visible label and badge are hidden. */\nfunction railLabel(item: NavItem) {\n return typeof item.badge === 'string' || typeof item.badge === 'number'\n ? `${item.label} (${item.badge})`\n : item.label;\n}\n\nfunction Badge({ item, current }: { item: NavItem; current: boolean }) {\n const { collapsed } = useNavListContext();\n if (item.badge === undefined || item.badge === null || item.badge === false) return null;\n const s = navListVariants({ current });\n if (collapsed) return <span aria-hidden className={s.railBadge()} />;\n // The space keeps the label and count apart in the accessible name (\"Projects 12\").\n return (\n <>\n {' '}\n <span className={s.badge()}>{item.badge}</span>\n </>\n );\n}\n\nfunction NavLeaf({ item, depth }: { item: NavItem; depth: number }) {\n const RouterLink = useLinkComponent();\n const { collapsed, currentHref, onNavigate } = useNavListContext();\n const current = isNavItemCurrent(item, currentHref);\n const rail = collapsed && depth === 0;\n const s = navListVariants({ collapsed: rail, current });\n const IconCmp = item.icon;\n const content: ReactNode = (\n <>\n {current && depth === 0 && <span aria-hidden className={s.indicator()} />}\n {IconCmp && <IconCmp size={ICON_SIZE[depth === 0 ? 0 : 1]} aria-hidden className={s.icon()} />}\n {!rail && <span className={s.label()}>{item.label}</span>}\n <Badge item={item} current={current} />\n </>\n );\n const props = {\n className: depth === 0 ? s.item() : s.subItem(),\n 'aria-current': current ? ('page' as const) : undefined,\n 'aria-label': rail ? railLabel(item) : undefined,\n onClick: (event: MouseEvent<HTMLElement>) => {\n if (item.disabled) {\n event.preventDefault();\n return;\n }\n item.onClick?.(event);\n onNavigate?.(item);\n },\n };\n let element;\n if (item.href !== undefined) {\n const linkProps = {\n ...props,\n href: item.href,\n 'aria-disabled': item.disabled || undefined,\n tabIndex: item.disabled ? -1 : undefined,\n };\n element = createElement(RouterLink ?? 'a', linkProps, content);\n } else {\n element = (\n <button type=\"button\" disabled={item.disabled} {...props}>\n {content}\n </button>\n );\n }\n return rail ? (\n <SimpleTooltip content={item.label} side=\"inline-end\" arrow={false}>\n {element}\n </SimpleTooltip>\n ) : (\n element\n );\n}\n\n/** Expanded mode: a collapsible section whose sub-items sit on a vertical guide line. */\nfunction NavParent({ item, depth }: { item: NavItem; depth: number }) {\n const { currentHref } = useNavListContext();\n const s = navListVariants({ collapsed: false });\n const IconCmp = item.icon;\n return (\n <Collapsible.Root defaultOpen={item.defaultOpen ?? navItemContainsCurrent(item, currentHref)}>\n <Collapsible.Trigger className={cn('group', depth === 0 ? cn(s.item(), s.parent()) : s.subItem(), 'w-full')}>\n {IconCmp && (\n <IconCmp\n size={ICON_SIZE[depth === 0 ? 0 : 1]}\n aria-hidden\n className={cn(s.icon(), 'text-muted-foreground')}\n />\n )}\n <span className={s.label()}>{item.label}</span>\n <Badge item={item} current={false} />\n <ChevronDown size={14} aria-hidden className={s.parentChevron()} />\n </Collapsible.Trigger>\n <Collapsible.Panel className={s.panel()}>\n <ul className={s.subList()}>\n {(item.items ?? []).map((child) => (\n <NavListEntry key={navItemKey(child)} item={child} depth={depth + 1} />\n ))}\n </ul>\n </Collapsible.Panel>\n </Collapsible.Root>\n );\n}\n\n/** Rail mode: the parent's icon opens a flyout menu listing its sub-items. */\nfunction NavRailFlyout({ item }: { item: NavItem }) {\n const RouterLink = useLinkComponent();\n const { currentHref, onNavigate } = useNavListContext();\n const active = navItemContainsCurrent(item, currentHref);\n const s = navListVariants({ collapsed: true });\n const m = menuVariants();\n const IconCmp = item.icon;\n return (\n <Menu>\n <MenuTrigger aria-label={item.label} className={cn(s.item(), active && 'bg-accent text-accent-foreground')}>\n {active && <span aria-hidden className={s.indicator()} />}\n {IconCmp && <IconCmp size={ICON_SIZE[0]} aria-hidden className={s.icon()} />}\n </MenuTrigger>\n <MenuContent side=\"inline-end\" align=\"start\" sideOffset={10}>\n <MenuGroup>\n <MenuGroupLabel>{item.label}</MenuGroupLabel>\n {(item.items ?? []).map((child) => {\n const current = isNavItemCurrent(child, currentHref);\n const ChildIcon = child.icon;\n return child.href !== undefined ? (\n <BaseMenu.LinkItem\n key={navItemKey(child)}\n href={child.href}\n closeOnClick\n aria-current={current ? 'page' : undefined}\n render={RouterLink ? createElement(RouterLink) : undefined}\n className={cn(m.item(), 'no-underline', current && 'font-semibold text-primary-text')}\n onClick={(event) => {\n child.onClick?.(event);\n onNavigate?.(child);\n }}\n >\n {ChildIcon && <ChildIcon size={15} aria-hidden className={m.itemIcon()} />}\n <span className={m.itemLabel()}>{child.label}</span>\n </BaseMenu.LinkItem>\n ) : (\n <MenuItem\n key={navItemKey(child)}\n icon={ChildIcon}\n disabled={child.disabled}\n onClick={(event) => {\n child.onClick?.(event);\n onNavigate?.(child);\n }}\n >\n {child.label}\n </MenuItem>\n );\n })}\n </MenuGroup>\n </MenuContent>\n </Menu>\n );\n}\n\n/** One `<li>`: a leaf link/button, a collapsible parent, or (in the rail) a flyout parent. */\nexport function NavListEntry({ item, depth = 0 }: { item: NavItem; depth?: number }) {\n const { collapsed } = useNavListContext();\n let body: ReactNode;\n if (item.items?.length)\n body = collapsed && depth === 0 ? <NavRailFlyout item={item} /> : <NavParent item={item} depth={depth} />;\n else body = <NavLeaf item={item} depth={depth} />;\n return <li className=\"relative\">{body}</li>;\n}\n","import { Collapsible } from '@base-ui/react/collapsible';\nimport { ChevronDown } from 'lucide-react';\nimport { useId, type HTMLAttributes, type Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { NavContext, navItemKey, useNavListContext, type NavGroup, type NavItem } from './nav-context';\nimport { navListVariants } from './nav-list.variants';\n\nexport type { NavItem, NavGroup, NavIcon } from './nav-context';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { NavListEntry } from './NavListItem';\n\nexport interface NavListProps extends Omit<HTMLAttributes<HTMLElement>, 'className'> {\n className?: string;\n ref?: Ref<HTMLElement>;\n groups: NavGroup[];\n /** The current location; the item with this `href` gets aria-current=\"page\". */\n currentHref?: string;\n /** Icon rail: labels hide and become tooltips, group headings become dividers. */\n collapsed?: boolean;\n /** Accessible name of the <nav> landmark. */\n label?: string;\n /** Called after any item is activated (e.g. to close a mobile drawer). */\n onNavigate?: (item: NavItem) => void;\n}\n\nfunction NavGroupSection({ group }: { group: NavGroup }) {\n const { collapsed } = useNavListContext();\n const labelId = useId();\n const s = navListVariants();\n const list = (\n <ul\n className={s.list()}\n aria-labelledby={group.label && !collapsed ? labelId : undefined}\n aria-label={group.label && collapsed ? group.label : undefined}\n >\n {group.items.map((item) => (\n <NavListEntry key={navItemKey(item)} item={item} />\n ))}\n </ul>\n );\n\n if (collapsed) {\n return (\n <div className={s.group()}>\n {group.label && <div aria-hidden className={s.railDivider()} />}\n {list}\n </div>\n );\n }\n\n if (group.collapsible && group.label) {\n return (\n <Collapsible.Root defaultOpen={group.defaultOpen ?? true} className={s.group()}>\n <Collapsible.Trigger className={s.groupTrigger()}>\n <span id={labelId} className={s.groupTriggerLabel()}>\n {group.label}\n </span>\n <ChevronDown size={12} aria-hidden className={s.groupChevron()} />\n </Collapsible.Trigger>\n <Collapsible.Panel className={s.panel()}>{list}</Collapsible.Panel>\n </Collapsible.Root>\n );\n }\n\n return (\n <div className={s.group()}>\n {group.label && (\n <div id={labelId} className={s.groupLabel()}>\n {group.label}\n </div>\n )}\n {list}\n </div>\n );\n}\n\n/**\n * Sidebar navigation: labelled groups (optionally foldable) of items with icon, label, badge and\n * nested collapsible sub-items. The current page gets aria-current=\"page\". `collapsed` turns it\n * into an icon rail with tooltips. Links render through LinkProvider, so client routers work.\n */\nexport function NavList({\n groups,\n currentHref,\n collapsed = false,\n label: labelProp,\n onNavigate,\n className,\n ...props\n}: NavListProps) {\n const { t } = useI18n();\n const label = labelProp ?? t('common.main');\n const s = navListVariants();\n return (\n <NavContext.Provider value={{ collapsed, currentHref, onNavigate }}>\n <nav aria-label={label} data-collapsed={collapsed || undefined} className={cn(s.root(), className)} {...props}>\n {groups.map((group, i) => (\n <NavGroupSection key={group.id ?? group.label ?? i} group={group} />\n ))}\n </nav>\n </NavContext.Provider>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'NavList',\n group: 'Navigation',\n status: 'beta',\n description:\n 'Vertical navigation for sidebars and settings pages: labelled (optionally foldable) groups of items with icon, label and badge, nested collapsible sub-items, and aria-current=\"page\" on the active item with the brand accent bar. `collapsed` turns it into an icon rail with tooltips (nested sections open as flyout menus). Links render through LinkProvider, so client routers work.',\n primitive: '@base-ui/react/collapsible',\n pattern: 'navigation landmark with disclosure sections',\n keyboard: [\n ['Tab / Shift+Tab', 'Moves through items, group toggles and section toggles in order'],\n ['Enter', 'Follows the focused link (or runs the item button)'],\n ['Enter / Space', 'On a group heading or nested section: expands or collapses it'],\n ['Enter / Space (rail)', 'Opens a nested section as a flyout menu (arrow keys move, Escape closes)'],\n ],\n tokens: [\n 'chrome',\n 'accent',\n 'accent-foreground',\n 'primary',\n 'primary-text',\n 'secondary',\n 'border',\n 'muted-foreground',\n 'foreground',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const mobileNavVariants = tv({\n slots: {\n popup: 'bg-chrome',\n header: 'px-4',\n title: 'flex items-center gap-2',\n body: 'px-3 py-3',\n footer: 'justify-start px-3 py-3',\n },\n});\n\nexport type MobileNavVariantProps = VariantProps<typeof mobileNavVariants>;\n","import { Menu as MenuIcon } from 'lucide-react';\nimport { useState, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { IconButton } from '../Button';\nimport {\n Drawer,\n DrawerBody,\n DrawerContent,\n DrawerFooter,\n DrawerHeader,\n DrawerTitle,\n DrawerTrigger,\n type DrawerSide,\n} from '../Drawer';\nimport { NavList, type NavGroup, type NavItem } from '../NavList';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { mobileNavVariants } from './mobile-nav.variants';\n\nexport interface MobileNavProps {\n /** Classes for the trigger, e.g. `lg:hidden` to show it only on small screens. */\n className?: string;\n /** Classes for the sheet panel. */\n contentClassName?: string;\n groups: NavGroup[];\n currentHref?: string;\n /** Sheet heading (brand or workspace name). Also the dialog's accessible name. */\n title?: ReactNode;\n /** Accessible name of the sheet when `title` is not plain text, and of the nav landmark. */\n label?: string;\n /** Accessible name of the menu button. */\n triggerLabel?: string;\n /** Content under the navigation (e.g. a WorkspaceSwitcher or UserMenu). */\n footer?: ReactNode;\n side?: Extract<DrawerSide, 'left' | 'right'>;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Called when an item is activated; the sheet then closes. */\n onNavigate?: (item: NavItem) => void;\n}\n\n/**\n * Small-screen navigation: a menu icon button that opens a Drawer holding a NavList. The sheet\n * closes when an item is activated, on Escape, on an outside press or on swipe.\n */\nexport function MobileNav({\n className,\n contentClassName,\n groups,\n currentHref,\n title,\n label: labelProp,\n triggerLabel: triggerLabelProp,\n footer,\n side = 'left',\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n onNavigate,\n}: MobileNavProps) {\n const { t } = useI18n();\n const label = labelProp ?? t('nav.navigation');\n const triggerLabel = triggerLabelProp ?? t('nav.openNavigation');\n const [openState, setOpenState] = useState(defaultOpen);\n const open = openProp ?? openState;\n const setOpen = (next: boolean) => {\n setOpenState(next);\n onOpenChange?.(next);\n };\n const s = mobileNavVariants();\n return (\n <Drawer side={side} open={open} onOpenChange={(next) => setOpen(next)}>\n <DrawerTrigger render={<IconButton icon={MenuIcon} label={triggerLabel} className={className} />} />\n <DrawerContent size=\"sm\" className={cn(s.popup(), contentClassName)} closeLabel={t('nav.closeNavigation')}>\n <DrawerHeader className={s.header()}>\n <DrawerTitle className={s.title()}>{title ?? label}</DrawerTitle>\n </DrawerHeader>\n <DrawerBody className={s.body()}>\n <NavList\n groups={groups}\n currentHref={currentHref}\n label={label}\n onNavigate={(item) => {\n onNavigate?.(item);\n setOpen(false);\n }}\n />\n </DrawerBody>\n {footer && <DrawerFooter className={s.footer()}>{footer}</DrawerFooter>}\n </DrawerContent>\n </Drawer>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'MobileNav',\n group: 'Navigation',\n status: 'beta',\n description:\n 'Small-screen navigation: a menu icon button opens a Drawer sheet (chrome surface) with the NavList groups and an optional footer slot. Activating an item closes the sheet; focus is trapped while open and returns to the button.',\n primitive: '@base-ui/react/drawer',\n pattern: 'modal dialog containing a navigation landmark',\n keyboard: [\n ['Enter / Space', 'On the menu button: opens the sheet and moves focus inside'],\n ['Tab / Shift+Tab', 'Cycles through the sheet (focus is trapped)'],\n ['Enter', 'Follows the focused link and closes the sheet'],\n ['Escape', 'Closes the sheet and returns focus to the menu button'],\n ],\n tokens: ['chrome', 'popover', 'border', 'accent', 'accent-foreground', 'primary', 'muted-foreground', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\n/** Extra slots on top of the Combobox house styles (chips field, popup, rows). */\nexport const multiSelectVariants = tv({\n slots: {\n group: [\n 'flex w-full min-w-0 items-center gap-1 pe-1',\n 'data-invalid:border-destructive/70 has-[input[aria-invalid=true]]:border-destructive/70',\n ],\n more: 'inline-flex h-6 shrink-0 items-center rounded bg-secondary px-1.5 font-mono text-[11.5px] font-medium text-muted-foreground',\n selectAll: 'mb-1 rounded-b-none border-b border-border font-medium',\n description: 'block truncate text-[11.5px] text-muted-foreground',\n check: 'flex size-4 shrink-0 items-center justify-center text-primary-text',\n },\n variants: {\n size: {\n sm: { group: 'min-h-8 py-0.5 ps-1.5' },\n md: { group: 'min-h-9 py-1 ps-2' },\n },\n },\n defaultVariants: { size: 'md' },\n});\n\nexport type MultiSelectVariantProps = VariantProps<typeof multiSelectVariants>;\n","import { Combobox as BaseCombobox } from '@base-ui/react/combobox';\nimport { Check, ChevronDown, X } from 'lucide-react';\nimport { useId, useRef, useState, type ReactNode, type Ref } from 'react';\nimport { usePortalDir, useI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { ComboboxSpecialItem } from '../Combobox/Combobox';\nimport { comboboxVariants } from '../Combobox/combobox.variants';\nimport { createItem, hasExactLabel, isSpecialItem, retryItem, type SpecialItem } from '../Combobox/specialItems';\nimport { useAsyncOptions, type LoadOptions } from '../Combobox/useAsyncOptions';\nimport { Spinner } from '../Spinner';\nimport { multiSelectVariants, type MultiSelectVariantProps } from './multi-select.variants';\n\nconst cb = comboboxVariants();\n\nexport interface MultiSelectOption {\n value: string;\n label: string;\n /** Secondary line under the label. */\n description?: string;\n disabled?: boolean;\n}\n\nexport interface MultiSelectProps extends MultiSelectVariantProps {\n options: MultiSelectOption[];\n /** Selected option values (controlled). */\n value?: string[];\n defaultValue?: string[];\n onValueChange?: (values: string[]) => void;\n /** Visible label bound to the input. Inside a Field, use FieldLabel instead. */\n label?: ReactNode;\n placeholder?: string;\n /** Chips shown before collapsing the rest into \"+N\". */\n maxVisibleChips?: number;\n /** Adds a \"Select all\" row (while the search is empty). */\n showSelectAll?: boolean;\n selectAllLabel?: string;\n /** Label of the same row once every option is selected. */\n deselectAllLabel?: string;\n clearLabel?: string;\n triggerLabel?: string;\n emptyText?: ReactNode;\n removeLabel?: (label: string) => string;\n /** Custom row content. */\n renderOption?: (option: MultiSelectOption) => ReactNode;\n name?: string;\n id?: string;\n disabled?: boolean;\n invalid?: boolean;\n className?: string;\n ref?: Ref<HTMLInputElement>;\n 'aria-label'?: string;\n 'aria-describedby'?: string;\n /**\n * Async options, loaded (debounced) for the typed query with an `AbortSignal` for stale requests.\n * Loaded options replace `options` in the list; selected ones keep their labels. No \"Select all\".\n */\n loadOptions?: LoadOptions<MultiSelectOption>;\n /** Debounce for `loadOptions`, in ms. Default 250. */\n debounceMs?: number;\n /** Creatable: adds a \"Create “…”\" row; return the new option (or a promise of it) to select it. */\n onCreate?: (input: string) => MultiSelectOption | void | Promise<MultiSelectOption | void>;\n /** Text of the create row. Default: \"Create “{input}”\". */\n createLabel?: (input: string) => ReactNode;\n /** Shown while options load. Default: \"Loading…\". */\n loadingText?: ReactNode;\n /** Shown when `loadOptions` rejects. Default: \"Couldn’t load options.\" */\n errorText?: ReactNode;\n}\n\nconst SELECT_ALL: MultiSelectOption = { value: '\\u0000select-all', label: '' };\nconst matches = (o: MultiSelectOption, q: string) =>\n o === SELECT_ALL\n ? q.trim() === ''\n : `${o.label} ${o.description ?? ''}`.toLowerCase().includes(q.trim().toLowerCase());\n\n/**\n * Searchable multi-select on Base UI Combobox (multiple): selected options as removable chips\n * (extra ones collapse into \"+N\"), an optional \"Select all\" row and a clear button.\n */\nexport function MultiSelect({\n options,\n value,\n defaultValue,\n onValueChange,\n label,\n placeholder: placeholderProp,\n maxVisibleChips = 3,\n showSelectAll = true,\n selectAllLabel: selectAllLabelProp,\n deselectAllLabel: deselectAllLabelProp,\n clearLabel: clearLabelProp,\n triggerLabel: triggerLabelProp,\n emptyText: emptyTextProp,\n removeLabel = (l) => `Remove ${l}`,\n renderOption,\n name,\n id,\n disabled,\n invalid,\n size = 'md',\n className,\n ref,\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedBy,\n loadOptions,\n debounceMs,\n onCreate,\n createLabel,\n loadingText,\n errorText,\n}: MultiSelectProps) {\n const { t } = useI18n();\n const placeholder = placeholderProp ?? t('common.searchPlaceholder');\n const selectAllLabel = selectAllLabelProp ?? t('common.selectAll');\n const deselectAllLabel = deselectAllLabelProp ?? t('common.deselectAll');\n const clearLabel = clearLabelProp ?? t('common.clearAll');\n const triggerLabel = triggerLabelProp ?? t('common.showOptions');\n const emptyText = emptyTextProp ?? t('common.noMatches');\n const dir = usePortalDir();\n const autoId = useId();\n const inputId = id ?? (label ? autoId : undefined);\n const [inner, setInner] = useState<string[]>(defaultValue ?? []);\n const values = value ?? inner;\n // While the popup is open Base UI aria-hides outside nodes, <label> included; aria-labelledby\n // still resolves through hidden elements, so a Field label's id is mirrored onto the input.\n const [fieldLabelId, setFieldLabelId] = useState<string | undefined>();\n const inputRef = useRef<HTMLInputElement | null>(null);\n const setRefs = (node: HTMLInputElement | null) => {\n inputRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n };\n // Async / creatable: options seen in results or created keep resolving after the list changes.\n const [known, setKnown] = useState<MultiSelectOption[]>([]);\n const remember = (more: readonly MultiSelectOption[]) =>\n setKnown((prev) => [...prev.filter((p) => !more.some((m) => m.value === p.value)), ...more]);\n const [input, setInput] = useState('');\n const [open, setOpen] = useState(false);\n const query = input.trim();\n const remote = useAsyncOptions(loadOptions, query, { debounceMs, enabled: open, onResult: remember });\n const listed: MultiSelectOption[] = loadOptions ? (remote.error ? [] : [...remote.items]) : options;\n const pool = [...listed, ...known, ...options];\n const selected = values.map((v) => pool.find((o) => o.value === v)).filter((o): o is MultiSelectOption => !!o);\n const enabled = listed.filter((o) => !o.disabled);\n const allSelected = enabled.length > 0 && enabled.every((o) => values.includes(o.value));\n const specials: SpecialItem[] = [];\n if (onCreate && query !== '' && !hasExactLabel(listed, query, (o) => o.label)) specials.push(createItem(query));\n if (loadOptions && remote.error && !remote.loading) specials.push(retryItem(input));\n const items: Array<MultiSelectOption | SpecialItem> = [\n ...(showSelectAll && !loadOptions ? [SELECT_ALL] : []),\n ...listed,\n ...specials,\n ];\n const busy = !!loadOptions && (remote.loading || !!remote.error);\n const s = multiSelectVariants({ size });\n const v = comboboxVariants({ size });\n\n const commit = (next: string[]) => {\n setInner(next);\n onValueChange?.(next);\n };\n\n const create = async (text: string) => {\n const created = await onCreate?.(text);\n if (!created) return;\n remember([created]);\n commit([...values.filter((x) => x !== created.value), created.value]);\n };\n\n const handleChange = (next: Array<MultiSelectOption | SpecialItem>) => {\n const special = next.find(isSpecialItem);\n if (special) {\n if (special.__gntikSpecial === 'retry') remote.reload();\n else void create(special.value);\n return;\n }\n if (next.includes(SELECT_ALL)) {\n const enabledValues = enabled.map((o) => o.value);\n commit(\n allSelected\n ? values.filter((x) => !enabledValues.includes(x))\n : [...values, ...enabledValues.filter((x) => !values.includes(x))],\n );\n return;\n }\n commit(next.map((o) => o.value));\n };\n\n const visible = selected.slice(0, maxVisibleChips);\n const hidden = selected.length - visible.length;\n\n return (\n <BaseCombobox.Root\n items={items}\n multiple\n value={selected}\n onValueChange={handleChange}\n filter={(o: MultiSelectOption | SpecialItem, q: string) => isSpecialItem(o) || !!loadOptions || matches(o, q)}\n isItemEqualToValue={(a: MultiSelectOption | SpecialItem, b: MultiSelectOption | SpecialItem) =>\n isSpecialItem(a) || isSpecialItem(b) ? a === b : a.value === b.value\n }\n itemToStringLabel={(o: MultiSelectOption | SpecialItem) => o.label}\n itemToStringValue={(o: MultiSelectOption | SpecialItem) => o.value}\n name={name}\n disabled={disabled}\n onInputValueChange={setInput}\n onOpenChange={(next) => {\n setOpen(next);\n if (next && !label) setFieldLabelId(inputRef.current?.labels?.[0]?.id || undefined);\n }}\n >\n {label && (\n <label id={`${inputId}-label`} htmlFor={inputId} className={cb.label()}>\n {label}\n </label>\n )}\n <BaseCombobox.InputGroup\n className={cn(cb.chipsGroup(), s.group(), className)}\n data-invalid={invalid || undefined}\n >\n <BaseCombobox.Chips className={cb.chips()}>\n {visible.map((o) => (\n <BaseCombobox.Chip key={o.value} className={cb.chip()} aria-label={o.label}>\n {o.label}\n <BaseCombobox.ChipRemove aria-label={removeLabel(o.label)} className={cb.chipRemove()}>\n <X size={11} strokeWidth={2.4} aria-hidden />\n </BaseCombobox.ChipRemove>\n </BaseCombobox.Chip>\n ))}\n {hidden > 0 && (\n <span className={s.more()}>\n +{hidden}\n <span className=\"sr-only\"> {t('multiSelect.moreSelected')}</span>\n </span>\n )}\n <BaseCombobox.Input\n ref={setRefs}\n id={inputId}\n aria-labelledby={label ? `${inputId}-label` : ariaLabel ? undefined : fieldLabelId}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedBy}\n aria-invalid={invalid || undefined}\n placeholder={selected.length ? undefined : placeholder}\n className={cb.chipsInput()}\n />\n </BaseCombobox.Chips>\n {selected.length > 0 && (\n <BaseCombobox.Clear aria-label={clearLabel} className={v.iconButton()}>\n <X size={14} aria-hidden />\n </BaseCombobox.Clear>\n )}\n <BaseCombobox.Trigger aria-label={triggerLabel} className={cn('group', v.iconButton())}>\n <ChevronDown size={15} aria-hidden className={cb.chevron()} />\n </BaseCombobox.Trigger>\n </BaseCombobox.InputGroup>\n <BaseCombobox.Portal>\n <BaseCombobox.Positioner dir={dir} className={cb.positioner()} side=\"bottom\" align=\"start\" sideOffset={6}>\n <BaseCombobox.Popup className={cb.popup()}>\n {(loadOptions || onCreate) && (\n <BaseCombobox.Status className={cn(cb.status(), !!remote.error && !remote.loading && cb.statusError())}>\n {remote.loading ? (\n <>\n <Spinner size={13} />\n {loadingText ?? t('common.loading')}\n </>\n ) : remote.error ? (\n (errorText ?? t('combobox.loadFailed'))\n ) : null}\n </BaseCombobox.Status>\n )}\n <BaseCombobox.Empty className={cb.empty()}>{busy ? null : emptyText}</BaseCombobox.Empty>\n <BaseCombobox.List className={cb.list()} aria-busy={remote.loading || undefined}>\n {(o: MultiSelectOption | SpecialItem) =>\n isSpecialItem(o) ? (\n <ComboboxSpecialItem key={`${o.__gntikSpecial}:${o.value}`} item={o} createLabel={createLabel} />\n ) : o === SELECT_ALL ? (\n <BaseCombobox.Item key={o.value} value={o} className={cn(cb.item(), s.selectAll())}>\n <span className={cb.itemContent()}>{allSelected ? deselectAllLabel : selectAllLabel}</span>\n <span className={s.check()}>\n {allSelected && <Check size={15} strokeWidth={2.4} aria-hidden />}\n </span>\n </BaseCombobox.Item>\n ) : (\n <BaseCombobox.Item key={o.value} value={o} disabled={o.disabled} className={cb.item()}>\n <span className={cb.itemContent()}>\n {renderOption ? (\n renderOption(o)\n ) : (\n <span className=\"min-w-0\">\n <span className=\"block truncate\">{o.label}</span>\n {o.description && <span className={s.description()}>{o.description}</span>}\n </span>\n )}\n </span>\n <BaseCombobox.ItemIndicator className={cb.indicator()}>\n <Check size={15} strokeWidth={2.4} aria-hidden />\n </BaseCombobox.ItemIndicator>\n </BaseCombobox.Item>\n )\n }\n </BaseCombobox.List>\n </BaseCombobox.Popup>\n </BaseCombobox.Positioner>\n </BaseCombobox.Portal>\n </BaseCombobox.Root>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'MultiSelect',\n group: 'Forms',\n status: 'beta',\n description:\n 'Searchable multi-select: selected options as removable chips (extra ones collapse into \"+N\"), a \"Select all\" row, a clear button and rows with descriptions. Built on Base UI Combobox (multiple) with the Combobox house styles; works inside Field. Optional async options (`loadOptions`, debounced and abortable, with loading/error states) and creatable rows (`onCreate`).',\n primitive: '@base-ui/react/combobox',\n pattern: 'combobox (multi-select listbox)',\n keyboard: [\n ['Type a character', 'Opens the popup and filters the options'],\n ['ArrowDown / ArrowUp', 'Moves the highlight between options'],\n ['Enter', 'Toggles the highlighted option (on \"Select all\": selects or clears every option)'],\n ['Escape', 'Closes the popup, keeping focus in the input'],\n ['Backspace', 'On an empty input, removes the last chip'],\n [\n 'Enter on “Create …” / “Retry”',\n 'Creates and selects an option from the typed text / loads the options again after an error',\n ],\n ],\n tokens: [\n 'background',\n 'border',\n 'popover',\n 'popover-foreground',\n 'primary',\n 'primary-text',\n 'secondary',\n 'muted-foreground',\n 'destructive',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const notificationsPopoverVariants = tv({\n slots: {\n trigger: 'relative',\n count: [\n 'pointer-events-none absolute -top-1.5 -end-1.5 inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-full px-1',\n 'bg-destructive font-mono text-[10px] font-bold leading-none text-destructive-foreground ring-2 ring-chrome',\n ],\n popup: 'w-[340px] max-w-[calc(100vw-2rem)]',\n header: 'flex items-center gap-2 border-b border-border py-2 pe-2 ps-3.5',\n title: 'flex-1 text-[13px]',\n unreadPill:\n 'ms-1.5 rounded-full bg-primary/14 px-1.5 py-0.5 font-mono text-[10px] font-semibold text-primary-chip-text',\n list: 'm-0 max-h-[360px] list-none overflow-y-auto p-1.5',\n row: [\n 'flex w-full gap-2.5 rounded-[7px] px-2.5 py-2 text-start',\n 'focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-focus-ring',\n ],\n rowInteractive: 'cursor-pointer transition-colors hover:bg-secondary/60 motion-reduce:transition-none',\n dot: 'mt-1.5 size-[7px] shrink-0 rounded-full',\n body: 'min-w-0 flex-1',\n itemTitle: 'block text-[12.5px] leading-snug text-foreground',\n itemBody: 'mt-0.5 block text-[12px] leading-snug text-muted-foreground',\n time: 'mt-1 block font-mono text-[10px] text-muted-foreground',\n empty: 'flex flex-col items-center gap-2 px-6 py-9 text-center',\n emptyIcon: 'grid size-10 place-items-center rounded-xl bg-secondary text-muted-foreground',\n emptyTitle: 'text-[13px] font-semibold text-foreground',\n emptyText: 'text-[12px] text-muted-foreground',\n footer: 'border-t border-border p-1.5',\n },\n variants: {\n tone: {\n primary: { dot: 'bg-primary' },\n info: { dot: 'bg-info' },\n warning: { dot: 'bg-warning' },\n destructive: { dot: 'bg-destructive' },\n },\n read: {\n true: { dot: 'bg-transparent', itemTitle: 'text-muted-foreground' },\n false: { itemTitle: 'font-semibold' },\n },\n },\n defaultVariants: { tone: 'primary', read: false },\n});\n\nexport type NotificationsPopoverVariantProps = VariantProps<typeof notificationsPopoverVariants>;\n","/** Accepts a Date, epoch milliseconds or an ISO string. */\nexport type TimeInput = Date | number | string;\n\nexport function toDate(value: TimeInput): Date {\n return value instanceof Date ? value : new Date(value);\n}\n\n/**\n * Tiny short relative-time formatter (\"just now\", \"5m ago\", \"3h ago\", \"2d ago\", then a short date).\n * Local to this component; apps that need locale-aware output pass `formatTime`.\n */\nexport function formatRelativeShort(value: TimeInput, now: Date = new Date()): string {\n const date = toDate(value);\n const diff = Math.round((now.getTime() - date.getTime()) / 1000);\n if (Number.isNaN(diff)) return '';\n const abs = Math.abs(diff);\n const suffix = (n: number, unit: string) => (diff >= 0 ? `${n}${unit} ago` : `in ${n}${unit}`);\n if (abs < 45) return 'just now';\n if (abs < 3600) return suffix(Math.max(1, Math.round(abs / 60)), 'm');\n if (abs < 86400) return suffix(Math.round(abs / 3600), 'h');\n if (abs < 7 * 86400) return suffix(Math.round(abs / 86400), 'd');\n return date.toLocaleDateString('en', {\n month: 'short',\n day: 'numeric',\n ...(date.getFullYear() === now.getFullYear() ? {} : { year: 'numeric' }),\n });\n}\n","import { Bell, BellOff, CheckCheck } from 'lucide-react';\nimport type { ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { Button, buttonVariants } from '../Button';\nimport { Popover, PopoverContent, PopoverTitle, PopoverTrigger } from '../Popover';\nimport { notificationsPopoverVariants } from './notifications-popover.variants';\nimport { useI18n, useOptionalI18n } from '../../i18n/I18nProvider';\nimport { formatRelativeShort, toDate, type TimeInput } from './relative-time';\n\nexport interface NotificationItem {\n id: string;\n title: ReactNode;\n body?: ReactNode;\n /** When it happened (Date, epoch ms or ISO string); shown as relative time. */\n time: TimeInput;\n read?: boolean;\n /** Colour of the unread dot. */\n tone?: 'primary' | 'info' | 'warning' | 'destructive';\n}\n\nexport interface NotificationsPopoverProps {\n className?: string;\n notifications: NotificationItem[];\n /** Makes rows buttons; called with the notification (e.g. mark read + navigate). */\n onSelect?: (notification: NotificationItem) => void;\n /** Shows the \"Mark all as read\" action while something is unread. */\n onMarkAllRead?: () => void;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Panel heading and trigger name. */\n title?: string;\n markAllLabel?: string;\n emptyTitle?: ReactNode;\n emptyDescription?: ReactNode;\n /** Bottom slot, e.g. a \"View all\" link. */\n footer?: ReactNode;\n /** Reference time for relative timestamps (defaults to now). */\n now?: Date;\n formatTime?: (time: TimeInput, now: Date) => string;\n /** Trigger name including the unread count. */\n getTriggerLabel?: (unread: number) => string;\n}\n\n/**\n * Bell icon button with an unread badge that opens a popover list of notifications\n * (title, body, relative time), a mark-all-read action and an empty state.\n */\nexport function NotificationsPopover({\n className,\n notifications,\n onSelect,\n onMarkAllRead,\n open,\n defaultOpen,\n onOpenChange,\n title: titleProp,\n markAllLabel: markAllLabelProp,\n emptyTitle: emptyTitleProp,\n emptyDescription: emptyDescriptionProp,\n footer,\n now,\n formatTime: formatTimeProp,\n getTriggerLabel,\n}: NotificationsPopoverProps) {\n const { t } = useI18n();\n const title = titleProp ?? t('common.notifications');\n const markAllLabel = markAllLabelProp ?? t('notifications.markAllRead');\n const emptyDescription = emptyDescriptionProp ?? t('notifications.empty');\n const emptyTitle = emptyTitleProp ?? t('notifications.emptyTitle');\n const i18n = useOptionalI18n();\n // English keeps the compact \"5m ago\"; other provider locales get Intl's narrow relative time.\n const formatTime =\n formatTimeProp ??\n (i18n && !i18n.locale.toLowerCase().startsWith('en')\n ? (time: TimeInput, ref: Date) => i18n.formatRelativeTime(toDate(time), ref, { numeric: 'auto', style: 'narrow' })\n : formatRelativeShort);\n const s = notificationsPopoverVariants();\n const unread = notifications.filter((n) => !n.read).length;\n const triggerLabel = getTriggerLabel\n ? getTriggerLabel(unread)\n : unread\n ? t('notifications.trigger', { title, count: unread })\n : title;\n const reference = now ?? new Date();\n return (\n <Popover open={open} defaultOpen={defaultOpen} onOpenChange={onOpenChange}>\n <PopoverTrigger\n aria-label={triggerLabel}\n className={cn(buttonVariants({ variant: 'secondary', iconOnly: true }), s.trigger(), className)}\n >\n <Bell size={16} aria-hidden />\n {unread > 0 && (\n <span aria-hidden className={s.count()}>\n {unread > 9 ? '9+' : unread}\n </span>\n )}\n </PopoverTrigger>\n <PopoverContent align=\"end\" padding=\"none\" className={s.popup()}>\n <div className={s.header()}>\n <PopoverTitle className={s.title()}>\n {title}\n {unread > 0 && <span className={s.unreadPill()}>{t('notifications.new', { count: unread })}</span>}\n </PopoverTitle>\n {onMarkAllRead && unread > 0 && (\n <Button variant=\"ghost\" size=\"sm\" icon={CheckCheck} onClick={onMarkAllRead}>\n {markAllLabel}\n </Button>\n )}\n </div>\n {notifications.length === 0 ? (\n <div className={s.empty()}>\n <span className={s.emptyIcon()}>\n <BellOff size={18} aria-hidden />\n </span>\n <p className={s.emptyTitle()}>{emptyTitle}</p>\n <p className={s.emptyText()}>{emptyDescription}</p>\n </div>\n ) : (\n <ul className={s.list()} aria-label={title}>\n {notifications.map((n) => {\n const v = notificationsPopoverVariants({ tone: n.tone, read: Boolean(n.read) });\n const date = toDate(n.time);\n const inner = (\n <>\n <span aria-hidden className={v.dot()} />\n <span className={v.body()}>\n {!n.read && <span className=\"sr-only\">{t('common.unread')} </span>}\n <span className={v.itemTitle()}>{n.title}</span>\n {n.body && <span className={v.itemBody()}>{n.body}</span>}\n <time dateTime={Number.isNaN(date.getTime()) ? undefined : date.toISOString()} className={v.time()}>\n {formatTime(n.time, reference)}\n </time>\n </span>\n </>\n );\n return (\n <li key={n.id}>\n {onSelect ? (\n <button type=\"button\" className={cn(v.row(), v.rowInteractive())} onClick={() => onSelect(n)}>\n {inner}\n </button>\n ) : (\n <div className={v.row()}>{inner}</div>\n )}\n </li>\n );\n })}\n </ul>\n )}\n {footer && <div className={s.footer()}>{footer}</div>}\n </PopoverContent>\n </Popover>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'NotificationsPopover',\n group: 'Overlays',\n status: 'beta',\n description:\n 'Bell icon button with an unread-count badge that opens a popover of notifications: title, body, relative time and a tone dot for unread items, a mark-all-read action, an optional footer (View all) and an empty state.',\n primitive: '@base-ui/react/popover',\n pattern: 'disclosure (non-modal dialog)',\n keyboard: [\n ['Enter / Space', 'On the bell: opens the panel and moves focus into it'],\n ['Tab', 'Moves through mark-all-read, the notification rows and the footer'],\n ['Enter / Space', 'On a row: runs onSelect'],\n ['Escape', 'Closes the panel and returns focus to the bell'],\n ],\n tokens: [\n 'popover',\n 'border',\n 'destructive',\n 'destructive-foreground',\n 'chrome',\n 'primary',\n 'primary-text',\n 'info',\n 'warning',\n 'secondary',\n 'muted-foreground',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\n/** One recessed box per character, mono digits, primary border while focused, destructive when invalid. */\nexport const otpInputVariants = tv({\n slots: {\n root: 'group/otp flex w-fit items-center gap-2 data-disabled:cursor-not-allowed',\n slot: [\n 'm-0 rounded-md border border-border bg-background p-0 text-center font-mono font-medium text-foreground shadow-sm caret-primary uppercase',\n 'transition-colors motion-reduce:transition-none',\n 'focus-visible:border-primary/60 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring focus:outline-none',\n 'data-filled:border-muted-foreground/40',\n 'data-invalid:border-destructive/70 group-data-invalid/otp:border-destructive/70',\n 'disabled:cursor-not-allowed disabled:bg-secondary/50 disabled:text-muted-foreground',\n 'read-only:bg-secondary/40',\n ],\n separator: 'h-px w-2.5 shrink-0 rounded-full bg-muted-foreground/50',\n },\n variants: {\n size: {\n sm: { slot: 'h-9 w-8 text-[14px]' },\n md: { slot: 'h-11 w-10 text-[17px]' },\n },\n },\n defaultVariants: { size: 'md' },\n});\n\nexport type OtpInputVariantProps = VariantProps<typeof otpInputVariants>;\n","import { OTPField } from '@base-ui/react/otp-field';\nimport { Fragment, useId, type Ref } from 'react';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { otpInputVariants, type OtpInputVariantProps } from './otp-input.variants';\n\nexport interface OtpInputProps\n extends\n Omit<\n OTPField.Root.Props,\n 'className' | 'render' | 'children' | 'length' | 'validationType' | 'onValueComplete' | 'style'\n >,\n OtpInputVariantProps {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n /** Number of characters (4–8). */\n length?: 4 | 5 | 6 | 7 | 8;\n /** Accepted characters. Alphanumeric codes are upper-cased. */\n type?: 'numeric' | 'alphanumeric';\n /** Marks the code as invalid (sets aria-invalid on every slot). Inside a Field, `Field invalid` does this. */\n invalid?: boolean;\n /** Called once every slot is filled (typing or paste). */\n onComplete?: (value: string) => void;\n /** Draws a separator after every N slots (e.g. 3 → \"123–456\"). */\n groupSize?: number;\n /** Accessible name of each slot after the first, which takes the field label. */\n slotLabel?: (position: number, length: number) => string;\n}\n\nconst upper = (v: string) => v.toUpperCase();\n\n/**\n * One-time code input on Base UI OTPField: one box per character, typing auto-advances,\n * Backspace steps back, paste fills every slot, and `onComplete` fires when full. Label it\n * with a Field (the first slot takes the label) or `aria-label` (names the group).\n */\nexport function OtpInput({\n length = 6,\n type = 'numeric',\n size,\n invalid,\n onComplete,\n groupSize,\n slotLabel: slotLabelProp,\n className,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...props\n}: OtpInputProps) {\n const { t } = useI18n();\n const slotLabel = slotLabelProp ?? ((index: number, total: number) => t('otp.character', { index, total }));\n const s = otpInputVariants({ size });\n const hiddenLabelId = useId();\n // Base UI names the first slot from a <label>/Field.Label or aria-labelledby (never aria-label),\n // so an `aria-label` becomes a hidden labelling element shared by the group and the first slot.\n const labelledBy = ariaLabelledBy ?? (ariaLabel != null ? hiddenLabelId : undefined);\n const named = labelledBy != null;\n return (\n <>\n {ariaLabel != null && ariaLabelledBy == null && (\n <span id={hiddenLabelId} hidden>\n {ariaLabel}\n </span>\n )}\n <OTPField.Root\n length={length}\n validationType={type}\n normalizeValue={type === 'alphanumeric' ? upper : undefined}\n onValueComplete={onComplete ? (v) => onComplete(v) : undefined}\n aria-labelledby={labelledBy}\n data-invalid={invalid || undefined}\n className={cn(s.root(), className)}\n {...props}\n >\n {Array.from({ length }, (_, i) => (\n <Fragment key={i}>\n {i > 0 && groupSize && i % groupSize === 0 ? <OTPField.Separator className={s.separator()} /> : null}\n <OTPField.Input\n className={s.slot()}\n aria-invalid={invalid || undefined}\n aria-label={i === 0 ? undefined : slotLabel(i + 1, length)}\n aria-labelledby={i === 0 && named ? labelledBy : undefined}\n />\n </Fragment>\n ))}\n </OTPField.Root>\n </>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'OtpInput',\n group: 'Forms',\n status: 'beta',\n description:\n 'One-time / verification code input: 4–8 character boxes, numeric or alphanumeric, optional group separator. Typing auto-advances, paste fills every slot, onComplete fires when full; invalid and disabled states; works inside Field.',\n primitive: '@base-ui/react/otp-field',\n pattern: 'group of single-character textboxes',\n keyboard: [\n ['Type a character', 'Fills the slot and moves to the next one'],\n ['Backspace', 'Clears the slot, or the previous one when empty, and moves back'],\n ['ArrowLeft / ArrowRight', 'Moves between slots'],\n ['Paste (⌘V / Ctrl+V)', 'Fills the slots from the clipboard, dropping invalid characters'],\n ],\n tokens: [\n 'background',\n 'border',\n 'foreground',\n 'muted-foreground',\n 'primary',\n 'destructive',\n 'secondary',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const overflowListVariants = tv({\n slots: {\n root: 'relative min-w-0',\n list: 'm-0 flex list-none flex-nowrap items-center p-0',\n item: 'shrink-0',\n measure:\n 'invisible pointer-events-none absolute start-0 top-0 flex h-0 w-max flex-nowrap items-center overflow-hidden',\n trigger: [\n 'inline-flex shrink-0 items-center justify-center font-medium text-muted-foreground transition-colors select-none',\n 'hover:bg-secondary hover:text-foreground data-popup-open:bg-secondary data-popup-open:text-foreground',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n popup: 'max-h-72 w-60 overflow-y-auto p-1.5',\n popupTitle: 'px-2 pt-1 pb-1.5 font-mono text-[10px] tracking-[0.12em] text-muted-foreground uppercase',\n popupList: 'm-0 grid list-none gap-0.5 p-0',\n popupItem: 'flex min-h-8 items-center gap-2 rounded-md px-2 text-[13px] text-foreground',\n },\n variants: {\n variant: {\n chip: {\n list: 'gap-1.5',\n measure: 'gap-1.5',\n trigger: 'h-6 rounded-md border border-border bg-card px-2 text-[11.5px]',\n },\n avatar: {\n list: '-space-x-2.5',\n measure: '-space-x-2.5',\n trigger: 'relative size-8 rounded-full bg-secondary text-[11px] font-semibold ring-2 ring-card',\n },\n },\n },\n defaultVariants: { variant: 'chip' },\n});\n\nexport type OverflowListVariantProps = VariantProps<typeof overflowListVariants>;\n","import { useEffect, useState, type RefObject } from 'react';\n\n/**\n * How many leading items fit in `container`, measuring an off-screen copy in `measure` whose\n * last child is the \"+N\" trigger template. `undefined` until measured (or when disabled).\n */\nexport function useFitCount(\n enabled: boolean,\n container: RefObject<HTMLElement | null>,\n measure: RefObject<HTMLElement | null>,\n count: number,\n) {\n const [fit, setFit] = useState<number | undefined>(undefined);\n\n useEffect(() => {\n const box = container.current;\n const layer = measure.current;\n if (!enabled || !box || !layer || typeof ResizeObserver === 'undefined') return;\n\n const compute = () => {\n const kids = Array.from(layer.children) as HTMLElement[];\n const trigger = kids.pop();\n const available = box.clientWidth;\n const rects = kids.map((k) => k.getBoundingClientRect());\n const first = rects[0];\n const second = rects[1];\n const triggerWidth = trigger?.getBoundingClientRect().width ?? 0;\n if (!first) return setFit(0);\n const ltr = getComputedStyle(layer).direction !== 'rtl';\n const spacing = second ? (ltr ? second.left - first.right : first.left - second.right) : 0;\n const extent = (n: number) => {\n const last = rects[n - 1];\n if (!last) return 0;\n return ltr ? last.right - first.left : first.right - last.left;\n };\n let n = rects.length;\n if (extent(n) > available) {\n n = rects.length - 1;\n while (n > 0 && extent(n) + spacing + triggerWidth > available) n--;\n }\n setFit(n);\n };\n\n const observer = new ResizeObserver(compute);\n observer.observe(box);\n return () => observer.disconnect();\n }, [enabled, container, measure, count]);\n\n return enabled ? fit : undefined;\n}\n","import { useRef, type HTMLAttributes, type Key, type ReactNode, type Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { Popover, PopoverContent, PopoverTrigger } from '../Popover';\nimport { overflowListVariants, type OverflowListVariantProps } from './overflow-list.variants';\nimport { useFitCount } from './useFitCount';\n\nexport interface OverflowListLabels {\n /** Visible text of the chip trigger (\"+3 more\"); avatars show \"+3\" and use this as the name. */\n more: (count: number) => string;\n /** Accessible name and heading of the popover (\"3 more\"). */\n title: (count: number) => string;\n}\n\nconst DEFAULT_LABELS: OverflowListLabels = {\n more: (n) => `+${n} more`,\n title: (n) => `${n} more`,\n};\n\nexport interface OverflowListProps<T>\n extends Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'children'>, OverflowListVariantProps {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n items: readonly T[];\n /** Renders one visible item (a chip, an Avatar…). */\n renderItem: (item: T, index: number) => ReactNode;\n /** Renders a hidden item inside the popover; defaults to `renderItem`. */\n renderOverflowItem?: (item: T, index: number) => ReactNode;\n /** Stable key per item; defaults to the index. */\n getKey?: (item: T, index: number) => Key;\n /** Show at most this many items. */\n max?: number;\n /** Also fit to the available width (ResizeObserver); `max` still caps it. */\n responsive?: boolean;\n /** Accessible name of the list (e.g. \"Labels\"). */\n label?: string;\n /** Built-in strings (English defaults). */\n labels?: Partial<OverflowListLabels>;\n}\n\n/**\n * A row of items that stops at `max` (or at the available width with `responsive`) and ends\n * with a \"+N more\" button that opens a Popover listing the rest. Works for chips and avatars.\n */\nexport function OverflowList<T>({\n items,\n renderItem,\n renderOverflowItem,\n getKey = (_item, i) => i,\n max,\n responsive = false,\n label,\n labels: labelsProp,\n variant,\n className,\n ...props\n}: OverflowListProps<T>) {\n const labels = { ...DEFAULT_LABELS, ...labelsProp };\n const containerRef = useRef<HTMLDivElement>(null);\n const measureRef = useRef<HTMLDivElement>(null);\n const fit = useFitCount(responsive, containerRef, measureRef, items.length);\n const visibleCount = Math.max(0, Math.min(items.length, max ?? Infinity, fit ?? Infinity));\n const hidden = items.slice(visibleCount);\n const s = overflowListVariants({ variant });\n const triggerText = (n: number) => (variant === 'avatar' ? `+${n}` : labels.more(n));\n\n return (\n <div ref={containerRef} className={cn(s.root(), className)} {...props}>\n <ul aria-label={label} className={s.list()}>\n {items.slice(0, visibleCount).map((item, i) => (\n <li key={getKey(item, i)} className={s.item()}>\n {renderItem(item, i)}\n </li>\n ))}\n {hidden.length > 0 && (\n <li className={s.item()}>\n <Popover>\n <PopoverTrigger\n className={s.trigger()}\n aria-label={variant === 'avatar' ? labels.more(hidden.length) : undefined}\n >\n {triggerText(hidden.length)}\n </PopoverTrigger>\n <PopoverContent\n padding=\"none\"\n align=\"start\"\n aria-label={labels.title(hidden.length)}\n className={s.popup()}\n >\n <div aria-hidden className={s.popupTitle()}>\n {labels.title(hidden.length)}\n </div>\n <ul className={s.popupList()}>\n {hidden.map((item, j) => {\n const i = visibleCount + j;\n return (\n <li key={getKey(item, i)} className={s.popupItem()}>\n {(renderOverflowItem ?? renderItem)(item, i)}\n </li>\n );\n })}\n </ul>\n </PopoverContent>\n </Popover>\n </li>\n )}\n </ul>\n {responsive && (\n <div ref={measureRef} aria-hidden inert className={s.measure()}>\n {items.map((item, i) => (\n <div key={getKey(item, i)} className={s.item()}>\n {renderItem(item, i)}\n </div>\n ))}\n <span className={s.trigger()}>{triggerText(Math.max(1, items.length))}</span>\n </div>\n )}\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'OverflowList',\n group: 'Display',\n status: 'beta',\n description:\n 'Row of chips or avatars that renders items up to `max` (or to the available width with `responsive`, measured by ResizeObserver) and a \"+N more\" button that opens a Popover listing the rest.',\n primitive: '@base-ui/react/popover',\n pattern: 'list + disclosure popover',\n keyboard: [\n ['Tab', 'Moves to the \"+N more\" button (and any interactive items)'],\n ['Enter / Space', 'On the \"+N more\" button: opens the popover with the hidden items'],\n ['Escape', 'Closes the popover and returns focus to the button'],\n ],\n tokens: ['card', 'border', 'secondary', 'muted-foreground', 'foreground', 'popover', 'focus-ring'],\n};\n","export type PageRangeItem = number | 'ellipsis-start' | 'ellipsis-end';\n\n/**\n * Page list with ellipses: always the first and last page, `siblingCount` pages either side of the\n * current one, and an ellipsis only where it hides two or more pages. The length stays constant\n * (2 × siblingCount + 5) once pageCount exceeds it, so the control does not jump while paging.\n */\nexport function getPageRange(page: number, pageCount: number, siblingCount = 1): PageRangeItem[] {\n const count = Math.max(0, Math.floor(pageCount));\n const range = (from: number, to: number) => Array.from({ length: Math.max(0, to - from + 1) }, (_, i) => from + i);\n const slots = siblingCount * 2 + 5;\n if (count <= slots) return range(1, count);\n const current = Math.min(Math.max(1, page), count);\n const left = Math.max(current - siblingCount, 1);\n const right = Math.min(current + siblingCount, count);\n const showStart = left > 3;\n const showEnd = right < count - 2;\n const edge = 3 + siblingCount * 2;\n if (!showStart) return [...range(1, edge), 'ellipsis-end', count];\n if (!showEnd) return [1, 'ellipsis-start', ...range(count - edge + 1, count)];\n return [1, 'ellipsis-start', ...range(left, right), 'ellipsis-end', count];\n}\n","import { tv, type VariantProps } from '../../utils/tv';\n\nconst focusRing = 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring';\n\nexport const paginationVariants = tv({\n slots: {\n root: 'flex items-center',\n list: 'flex items-center gap-1.5',\n page: [\n 'grid cursor-pointer place-items-center rounded-lg font-medium tabular-nums transition-colors',\n 'text-muted-foreground hover:bg-secondary hover:text-foreground',\n 'aria-[current=page]:bg-primary aria-[current=page]:font-semibold aria-[current=page]:text-primary-foreground aria-[current=page]:hover:bg-primary/90',\n focusRing,\n ],\n arrow: [\n 'grid cursor-pointer place-items-center rounded-lg border border-border bg-card text-muted-foreground transition-colors',\n 'hover:border-ring/50 hover:text-foreground disabled:pointer-events-none disabled:opacity-40',\n focusRing,\n ],\n ellipsis: 'grid place-items-center text-muted-foreground/50',\n summary: 'text-[12.5px] text-muted-foreground tabular-nums',\n summaryValue: 'font-mono text-foreground',\n },\n variants: {\n size: {\n /** Follows `data-density` (comfortable = md). */\n auto: { page: 'size-control text-[13px]', arrow: 'size-control', ellipsis: 'size-control' },\n sm: { page: 'size-8 text-[12.5px]', arrow: 'size-8', ellipsis: 'size-8' },\n md: { page: 'size-9 text-[13px]', arrow: 'size-9', ellipsis: 'size-9' },\n },\n },\n defaultVariants: { size: 'auto' },\n});\n\nexport type PaginationVariantProps = VariantProps<typeof paginationVariants>;\n","import { ChevronLeft, ChevronRight, MoreHorizontal } from 'lucide-react';\nimport type { Ref } from 'react';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { RTL_FLIP } from '../../utils/rtl';\nimport { getPageRange } from './pageRange';\nimport { paginationVariants, type PaginationVariantProps } from './pagination.variants';\n\nexport interface PaginationLabels {\n /** Accessible name of the nav landmark. */\n nav?: string;\n previous?: string;\n next?: string;\n /** Accessible name of a page button. */\n page?: (page: number) => string;\n}\n\n/** Built-in labels from the I18nProvider catalog (English outside one); `labels` wins. */\nfunction useLabels(labels: PaginationLabels | undefined): Required<PaginationLabels> {\n const { t } = useI18n();\n return {\n nav: labels?.nav ?? t('pagination.label'),\n previous: labels?.previous ?? t('pagination.previous'),\n next: labels?.next ?? t('pagination.next'),\n page: labels?.page ?? ((page) => t('pagination.page', { page })),\n };\n}\n\ninterface ArrowsProps {\n page: number;\n pageCount: number;\n onPageChange: (page: number) => void;\n labels: Required<PaginationLabels>;\n className: string;\n iconSize: number;\n}\n\nfunction PrevButton({ page, onPageChange, labels, className, iconSize }: Omit<ArrowsProps, 'pageCount'>) {\n return (\n <button\n type=\"button\"\n className={className}\n aria-label={labels.previous}\n disabled={page <= 1}\n onClick={() => onPageChange(page - 1)}\n >\n <ChevronLeft size={iconSize} aria-hidden className={RTL_FLIP} />\n </button>\n );\n}\n\nfunction NextButton({ page, pageCount, onPageChange, labels, className, iconSize }: ArrowsProps) {\n return (\n <button\n type=\"button\"\n className={className}\n aria-label={labels.next}\n disabled={page >= pageCount}\n onClick={() => onPageChange(page + 1)}\n >\n <ChevronRight size={iconSize} aria-hidden className={RTL_FLIP} />\n </button>\n );\n}\n\nexport interface PaginationProps extends PaginationVariantProps {\n /** Current page, 1-based. */\n page: number;\n /** Total number of pages. */\n pageCount: number;\n /** Called with the requested page (already clamped to 1…pageCount). */\n onPageChange: (page: number) => void;\n /** Pages shown either side of the current one. */\n siblingCount?: number;\n labels?: PaginationLabels;\n className?: string;\n ref?: Ref<HTMLElement>;\n}\n\n/**\n * Numbered pagination: previous/next arrows, first and last page, the pages around the current\n * one and ellipses in between. Page-size agnostic: it only knows `page` and `pageCount`.\n */\nexport function Pagination({\n page,\n pageCount,\n onPageChange,\n siblingCount = 1,\n size,\n labels,\n className,\n ref,\n}: PaginationProps) {\n const s = paginationVariants({ size });\n const l = useLabels(labels);\n const go = (p: number) => {\n const next = Math.min(Math.max(1, p), Math.max(1, pageCount));\n if (next !== page) onPageChange(next);\n };\n const iconSize = size === 'sm' ? 15 : 16;\n return (\n <nav ref={ref} aria-label={l.nav} className={cn(s.root(), className)}>\n <ul className={s.list()}>\n <li>\n <PrevButton page={page} onPageChange={go} labels={l} className={s.arrow()} iconSize={iconSize} />\n </li>\n {getPageRange(page, pageCount, siblingCount).map((item) =>\n typeof item === 'number' ? (\n <li key={item}>\n <button\n type=\"button\"\n className={s.page()}\n aria-label={l.page(item)}\n aria-current={item === page ? 'page' : undefined}\n onClick={() => go(item)}\n >\n {item}\n </button>\n </li>\n ) : (\n <li key={item} aria-hidden className={s.ellipsis()}>\n <MoreHorizontal size={15} />\n </li>\n ),\n )}\n <li>\n <NextButton\n page={page}\n pageCount={pageCount}\n onPageChange={go}\n labels={l}\n className={s.arrow()}\n iconSize={iconSize}\n />\n </li>\n </ul>\n </nav>\n );\n}\n\nexport interface PaginationCompactProps extends PaginationVariantProps {\n /** Current page, 1-based. */\n page: number;\n /** Rows per page. */\n pageSize: number;\n /** Total number of rows. */\n total: number;\n onPageChange: (page: number) => void;\n /** Locale for number formatting; defaults to the I18nProvider's (English outside one). */\n locale?: string;\n /** Word between the range and the total (\"1–10 of 97\"); defaults to the catalog's. */\n ofLabel?: string;\n labels?: Pick<PaginationLabels, 'nav' | 'previous' | 'next'>;\n className?: string;\n ref?: Ref<HTMLElement>;\n}\n\n/** Compact pagination for table footers: \"1–10 of 97\" plus previous/next arrows. */\nexport function PaginationCompact({\n page,\n pageSize,\n total,\n onPageChange,\n locale,\n ofLabel,\n size,\n labels,\n className,\n ref,\n}: PaginationCompactProps) {\n const s = paginationVariants({ size });\n const l = useLabels(labels);\n const pageCount = Math.max(1, Math.ceil(total / Math.max(1, pageSize)));\n const from = total === 0 ? 0 : (page - 1) * pageSize + 1;\n const to = Math.min(page * pageSize, total);\n const i18n = useI18n();\n const fmt = (n: number) => n.toLocaleString(locale ?? i18n.locale);\n const go = (p: number) => onPageChange(Math.min(Math.max(1, p), pageCount));\n const iconSize = size === 'sm' ? 15 : 16;\n return (\n <nav ref={ref} aria-label={l.nav} className={cn(s.root(), 'gap-3', className)}>\n <p className={s.summary()} aria-live=\"polite\">\n <span className={s.summaryValue()}>\n {fmt(from)}–{fmt(to)}\n </span>{' '}\n {ofLabel ?? i18n.t('pagination.of')} <span className={s.summaryValue()}>{fmt(total)}</span>\n </p>\n <div className=\"flex items-center gap-1.5\">\n <PrevButton page={page} onPageChange={go} labels={l} className={s.arrow()} iconSize={iconSize} />\n <NextButton\n page={page}\n pageCount={pageCount}\n onPageChange={go}\n labels={l}\n className={s.arrow()}\n iconSize={iconSize}\n />\n </div>\n </nav>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Pagination',\n group: 'Navigation',\n status: 'stable',\n description:\n 'Moves through pages of results. Pagination is numbered (first, last, siblings of the current page and ellipses, constant width) and page-size agnostic: page, pageCount, onPageChange. PaginationCompact is the table-footer form: \"1–10 of 97\" with previous/next.',\n pattern: 'navigation landmark with aria-current',\n keyboard: [\n ['Tab / Shift+Tab', 'Moves through every enabled control (previous, each page, next)'],\n ['Enter / Space', 'Activates the focused control and changes page'],\n ],\n tokens: [\n 'primary',\n 'primary-foreground',\n 'card',\n 'border',\n 'ring',\n 'secondary',\n 'muted-foreground',\n 'foreground',\n 'focus-ring',\n ],\n};\n","import { tv } from '../../utils/tv';\n\nexport const cursorPaginationVariants = tv({\n slots: {\n root: 'flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n selectGroup: 'flex items-center gap-2.5',\n selectLabel: 'text-[12.5px] text-muted-foreground',\n select: 'w-[76px] font-mono',\n controls: 'flex flex-wrap items-center gap-3',\n status: 'text-[12.5px] text-muted-foreground tabular-nums',\n },\n});\n","import { Children, isValidElement, useCallback, useLayoutEffect, useRef, type ReactNode, type RefObject } from 'react';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { Button } from '../Button';\nimport { SimpleSelect } from '../Select';\nimport { cursorPaginationVariants } from './cursor-pagination.variants';\n\nconst s = cursorPaginationVariants();\n\nexport interface CursorPaginationLabels {\n previous?: string;\n next?: string;\n navLabel?: string;\n shownSummary?: (shownCount: number) => string;\n totalSummary?: (total: number) => string;\n rowsPerPage?: string;\n rowsPerPageLabel?: string;\n}\n\ninterface CursorPaginationBaseProps {\n hasPrevious: boolean;\n hasNext: boolean;\n onPrevious: () => void;\n onNext: () => void;\n loading?: boolean;\n busy?: boolean;\n /** Null keeps the summary visible while busy; omitted uses the catalog loading label. */\n loadingLabel?: string | null;\n unavailableBehaviour?: 'disabled' | 'hidden';\n previousLabel?: string;\n nextLabel?: string;\n ariaLabel?: string;\n labels?: CursorPaginationLabels;\n className?: string;\n}\n\n/** Supply a plain-text summary (including null) or the response count with both count labels. */\nexport type CursorPaginationProps = CursorPaginationBaseProps &\n (\n | { summary: ReactNode; shownCount?: number; total?: number | null }\n | {\n summary?: undefined;\n shownCount: number;\n total?: number | null;\n labels: CursorPaginationLabels & Required<Pick<CursorPaginationLabels, 'shownSummary' | 'totalSummary'>>;\n }\n ) &\n (\n | { pageSizeOptions?: undefined; pageSize?: number; onPageSizeChange?: (pageSize: number) => void }\n | {\n pageSizeOptions: readonly number[];\n pageSize: number;\n onPageSizeChange: (pageSize: number) => void;\n labels: CursorPaginationLabels & Required<Pick<CursorPaginationLabels, 'rowsPerPage' | 'rowsPerPageLabel'>>;\n }\n );\n\n/** Stateless navigation: the consumer owns all cursors and request state. */\nexport function CursorPagination({\n hasPrevious,\n hasNext,\n onPrevious,\n onNext,\n loading = false,\n busy = false,\n loadingLabel,\n unavailableBehaviour = 'disabled',\n summary,\n shownCount,\n total,\n pageSize,\n pageSizeOptions,\n onPageSizeChange,\n previousLabel,\n nextLabel,\n ariaLabel,\n labels,\n className,\n}: CursorPaginationProps) {\n const { t } = useI18n();\n const isBusy = loading || busy;\n const showPrevious = hasPrevious || unavailableBehaviour === 'disabled';\n const showNext = hasNext || unavailableBehaviour === 'disabled';\n const root = useRef<HTMLElement>(null);\n const removedFocusRef = useRef(false);\n const [previous, previousRef] = useControlRef(removedFocusRef);\n const [next, nextRef] = useControlRef(removedFocusRef);\n const [select, selectRef] = useControlRef(removedFocusRef);\n useLayoutEffect(() => {\n if (!removedFocusRef.current) return;\n removedFocusRef.current = false;\n (next.current ?? previous.current ?? select.current ?? root.current)?.focus();\n });\n const summaryText =\n summary !== undefined\n ? plainText(summary)\n : typeof total === 'number' && total > 0\n ? (labels?.totalSummary?.(total) ?? '')\n : (labels?.shownSummary?.(shownCount ?? 0) ?? '');\n const status = isBusy && loadingLabel !== null ? (loadingLabel ?? t('common.loading')) : summaryText;\n return (\n <nav\n ref={root}\n tabIndex={-1}\n aria-label={ariaLabel ?? labels?.navLabel ?? t('pagination.label')}\n className={cn(s.root(), className)}\n >\n {pageSizeOptions !== undefined && (\n <div className={s.selectGroup()}>\n <span className={s.selectLabel()} aria-hidden>\n {labels?.rowsPerPage}\n </span>\n <SimpleSelect\n triggerRef={selectRef}\n aria-label={labels?.rowsPerPageLabel}\n size=\"sm\"\n className={s.select()}\n value={String(pageSize)}\n onValueChange={(value) => {\n if (value !== null) onPageSizeChange?.(Number(value));\n }}\n items={pageSizeOptions.map((n) => ({ value: String(n), label: String(n) }))}\n />\n </div>\n )}\n <div className={s.controls()}>\n {showPrevious && (\n <Button\n ref={previousRef}\n variant=\"secondary\"\n size=\"sm\"\n disabled={!hasPrevious || isBusy}\n focusableWhenDisabled\n aria-busy={isBusy || undefined}\n onClick={() => onPrevious()}\n >\n {previousLabel ?? labels?.previous ?? t('pagination.previous')}\n </Button>\n )}\n <p role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" className={s.status()}>\n {status}\n </p>\n {showNext && (\n <Button\n ref={nextRef}\n variant=\"secondary\"\n size=\"sm\"\n disabled={!hasNext || isBusy}\n focusableWhenDisabled\n aria-busy={isBusy || undefined}\n onClick={() => onNext()}\n >\n {nextLabel ?? labels?.next ?? t('pagination.next')}\n </Button>\n )}\n </div>\n </nav>\n );\n}\n\n/** Ref detachment runs before removal, while the focused element still exists. */\nfunction useControlRef(removedFocusRef: RefObject<boolean>) {\n const current = useRef<HTMLButtonElement | null>(null);\n const ref = useCallback(\n (node: HTMLButtonElement | null) => {\n const control = current.current;\n const popupId = control?.getAttribute('aria-controls');\n const popup = popupId ? control?.ownerDocument.getElementById(popupId) : null;\n const active = control?.ownerDocument.activeElement;\n if (!node && (control?.contains(active ?? null) || popup?.contains(active ?? null))) {\n removedFocusRef.current = true;\n }\n current.current = node;\n },\n [removedFocusRef],\n );\n return [current, ref] as const;\n}\n\n/** Flatten plain text nodes to one text value, so a changed commit writes to the region once. */\nfunction plainText(node: ReactNode): string {\n return Children.toArray(node)\n .map((child) => {\n if (typeof child === 'string' || typeof child === 'number') return String(child);\n return isValidElement<{ children?: ReactNode }>(child) ? plainText(child.props.children) : '';\n })\n .join('');\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'CursorPagination',\n group: 'Navigation',\n status: 'beta',\n description:\n 'See the cursor-pager-footer block example for data-table paginated={false} with a consumer-owned token stack. Stateless Previous/Next navigation for consumer-owned cursor stacks, with no page numbers, ranges or invented totals. Supply a plain-text summary (null keeps it empty) or shownCount with required labels.shownSummary and labels.totalSummary; only a positive exact total uses totalSummary. A pageSizeOptions select requires pageSize, onPageSizeChange, labels.rowsPerPage and labels.rowsPerPageLabel. Flat previousLabel, nextLabel and ariaLabel override labels.previous, labels.next and labels.navLabel, then provider catalog defaults. loading and busy are aliases: rendered buttons stay focusable and aria-disabled with aria-busy, while the select stays enabled. loadingLabel defaults to the catalog; null keeps the summary during busy. One persistent polite status writes once per changed text; mount, empty text and unchanged commits do not announce. Removal of the focused control moves focus to Next, Previous, the select or the nav root, in that order, even while busy; focus elsewhere never moves.',\n primitive: '@base-ui/react/button + @base-ui/react/select (kit Button and SimpleSelect)',\n pattern: 'named navigation landmark with one persistent polite atomic status',\n keyboard: [\n ['Tab / Shift+Tab', 'Moves through the select (when present), Previous and Next, including aria-disabled buttons'],\n ['Enter / Space', 'Activates an available button once; busy and unavailable buttons do nothing; opens the select'],\n ['ArrowDown / ArrowUp', 'Opens the select and moves between page-size options'],\n ['Enter / Escape', 'Selects the highlighted page size or closes the select; focus returns to its trigger'],\n ],\n tokens: [\n 'card',\n 'border',\n 'foreground',\n 'muted-foreground',\n 'secondary',\n 'focus-ring',\n 'background',\n 'primary',\n 'ring',\n 'popover',\n 'popover-foreground',\n 'primary-text',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\n/**\n * Roles × permissions grid. Each cell is a chip-like button: allowed and denied use their tone\n * tint with the chip-text alias plus an icon and a word; inherited is a dashed, muted outline.\n */\nexport const permissionMatrixVariants = tv({\n slots: {\n root: 'w-full min-w-0 overflow-x-auto rounded-lg border border-border bg-card',\n table: 'w-full border-collapse text-[13px]',\n caption: 'px-3 pt-3 pb-1 text-start text-[13px] font-semibold text-foreground',\n corner:\n 'border-b border-border bg-secondary/40 px-3 py-2 text-start text-[12px] font-semibold text-muted-foreground',\n roleHead:\n 'border-b border-border bg-secondary/40 px-2 py-2 text-center text-[12px] font-semibold whitespace-nowrap text-foreground',\n roleInner: 'inline-flex items-center gap-1',\n roleIcon: 'shrink-0 text-muted-foreground',\n roleDescription: 'block text-[11px] font-normal text-muted-foreground',\n section:\n 'bg-card px-3 pt-4 pb-1.5 text-start font-mono text-[11px] font-semibold tracking-wide text-muted-foreground uppercase',\n rowHead: 'border-t border-border/60 px-3 py-2 text-start align-middle font-normal',\n permLabel: 'block text-[13px] font-medium text-foreground',\n permDescription: 'block text-[12px] text-muted-foreground',\n cell: 'border-t border-border/60 px-2 py-1.5 text-center align-middle',\n toggle: [\n 'inline-flex h-chip min-w-24 items-center justify-center gap-1 rounded-md px-2 text-[11.5px] font-medium whitespace-nowrap',\n 'transition-colors motion-reduce:transition-none',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n 'aria-disabled:cursor-not-allowed',\n ],\n },\n variants: {\n state: {\n allowed: { toggle: 'bg-success/15 text-success-chip-text hover:bg-success/22' },\n denied: { toggle: 'bg-destructive/15 text-destructive-chip-text hover:bg-destructive/22' },\n inherited: { toggle: 'border border-dashed border-border text-muted-foreground hover:bg-secondary/60' },\n },\n },\n});\n\nexport type PermissionMatrixVariantProps = VariantProps<typeof permissionMatrixVariants>;\n","import { Ban, Check, CornerDownRight, Lock } from 'lucide-react';\nimport { Fragment, useId, useRef, useState, type KeyboardEvent, type ReactNode } from 'react';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { SimpleTooltip } from '../Tooltip';\nimport { permissionMatrixVariants } from './permission-matrix.variants';\n\nexport type PermissionState = 'allowed' | 'denied' | 'inherited';\n/** `value[roleId][permissionId]`; a missing cell is `inherited`. */\nexport type PermissionMatrixValue = Record<string, Record<string, PermissionState>>;\n\nexport interface PermissionRole {\n id: string;\n label: string;\n description?: string;\n /** The column cannot be edited (e.g. the owner role). */\n readOnly?: boolean;\n /** Tooltip for the read-only column's cells. */\n readOnlyReason?: string;\n}\n\nexport interface PermissionItem {\n id: string;\n label: string;\n description?: string;\n}\n\nexport interface PermissionSection {\n id: string;\n label: string;\n permissions: PermissionItem[];\n}\n\nexport interface PermissionChange {\n roleId: string;\n permissionId: string;\n state: PermissionState;\n}\n\nexport interface PermissionMatrixProps {\n /** Columns. */\n roles: PermissionRole[];\n /** Row groups. */\n sections: PermissionSection[];\n value?: PermissionMatrixValue;\n defaultValue?: PermissionMatrixValue;\n onChange?: (value: PermissionMatrixValue, change: PermissionChange) => void;\n /** What an inherited cell currently resolves to (from a parent role, the org default…). */\n resolveInherited?: (roleId: string, permissionId: string) => 'allowed' | 'denied' | undefined;\n /** Include `inherited` in the cycle. Default true. */\n allowInherit?: boolean;\n /** A reason makes the cell read-only and shows it in a tooltip. */\n getDisabledReason?: (roleId: string, permissionId: string) => string | undefined;\n /** Visible caption (also names the grid). */\n caption?: ReactNode;\n 'aria-label'?: string;\n className?: string;\n}\n\nconst NEXT: Record<PermissionState, PermissionState> = { allowed: 'denied', denied: 'inherited', inherited: 'allowed' };\nconst ICONS = { allowed: Check, denied: Ban, inherited: CornerDownRight } as const;\n\n/**\n * Roles × permissions editor. Cells are tri-state (allowed / denied / inherited) and always show\n * an icon and a word. One tab stop: arrows move between cells, Enter/Space cycle the state,\n * A / D / I set it directly. Read-only columns and per-cell disabled reasons (tooltip) are\n * reachable but cannot change.\n */\nexport function PermissionMatrix({\n roles,\n sections,\n value,\n defaultValue,\n onChange,\n resolveInherited,\n allowInherit = true,\n getDisabledReason,\n caption,\n 'aria-label': ariaLabel,\n className,\n}: PermissionMatrixProps) {\n const { t, dir } = useI18n();\n const uid = useId();\n const [inner, setInner] = useState<PermissionMatrixValue>(defaultValue ?? {});\n const matrix = value ?? inner;\n const [focus, setFocus] = useState({ row: 0, col: 0 });\n const cellRefs = useRef(new Map<string, HTMLButtonElement>());\n const s = permissionMatrixVariants();\n const rows = sections.flatMap((sec) => sec.permissions);\n const lastRow = rows.length - 1;\n const lastCol = roles.length - 1;\n const active = { row: Math.min(focus.row, Math.max(0, lastRow)), col: Math.min(focus.col, Math.max(0, lastCol)) };\n\n const stateLabel = (state: PermissionState) => t(`permissionMatrix.${state}`);\n const stateOf = (roleId: string, permId: string): PermissionState => matrix[roleId]?.[permId] ?? 'inherited';\n const reasonOf = (role: PermissionRole, permId: string) =>\n role.readOnly\n ? (role.readOnlyReason ?? t('permissionMatrix.readOnlyRole', { role: role.label }))\n : getDisabledReason?.(role.id, permId);\n\n const set = (role: PermissionRole, perm: PermissionItem, state: PermissionState) => {\n if (reasonOf(role, perm.id) || stateOf(role.id, perm.id) === state) return;\n const next: PermissionMatrixValue = { ...matrix, [role.id]: { ...matrix[role.id], [perm.id]: state } };\n setInner(next);\n onChange?.(next, { roleId: role.id, permissionId: perm.id, state });\n };\n const cycle = (role: PermissionRole, perm: PermissionItem) => {\n const current = stateOf(role.id, perm.id);\n let next = NEXT[current];\n if (next === 'inherited' && !allowInherit) next = 'allowed';\n set(role, perm, next);\n };\n\n const moveTo = (row: number, col: number) => {\n const r = Math.max(0, Math.min(lastRow, row));\n const c = Math.max(0, Math.min(lastCol, col));\n setFocus({ row: r, col: c });\n cellRefs.current.get(`${r}:${c}`)?.focus();\n };\n\n const onKeyDown =\n (row: number, col: number, role: PermissionRole, perm: PermissionItem) => (e: KeyboardEvent<HTMLButtonElement>) => {\n const forward = dir === 'rtl' ? -1 : 1;\n const key = e.key;\n let handled = true;\n if (key === 'ArrowRight') moveTo(row, col + forward);\n else if (key === 'ArrowLeft') moveTo(row, col - forward);\n else if (key === 'ArrowDown') moveTo(row + 1, col);\n else if (key === 'ArrowUp') moveTo(row - 1, col);\n else if (key === 'Home') moveTo(e.ctrlKey || e.metaKey ? 0 : row, 0);\n else if (key === 'End') moveTo(e.ctrlKey || e.metaKey ? lastRow : row, lastCol);\n else if (key === 'PageDown') moveTo(lastRow, col);\n else if (key === 'PageUp') moveTo(0, col);\n else if (!e.ctrlKey && !e.metaKey && !e.altKey && (key === 'a' || key === 'A')) set(role, perm, 'allowed');\n else if (!e.ctrlKey && !e.metaKey && !e.altKey && (key === 'd' || key === 'D')) set(role, perm, 'denied');\n else if (!e.ctrlKey && !e.metaKey && !e.altKey && allowInherit && (key === 'i' || key === 'I'))\n set(role, perm, 'inherited');\n else handled = false;\n if (handled) e.preventDefault();\n };\n\n const offsets = sections.map((_, i) => sections.slice(0, i).reduce((n, sec) => n + sec.permissions.length, 0));\n return (\n <div className={cn(s.root(), className)}>\n <table\n role=\"grid\"\n aria-label={caption ? undefined : (ariaLabel ?? t('permissionMatrix.label'))}\n aria-labelledby={caption ? `${uid}-caption` : undefined}\n className={s.table()}\n >\n {caption && (\n <caption id={`${uid}-caption`} className={s.caption()}>\n {caption}\n </caption>\n )}\n <thead>\n <tr>\n <th scope=\"col\" className={s.corner()}>\n {t('permissionMatrix.permission')}\n </th>\n {roles.map((role) => (\n <th key={role.id} scope=\"col\" className={s.roleHead()}>\n <span className={s.roleInner()}>\n {role.readOnly && <Lock size={12} aria-hidden className={s.roleIcon()} />}\n {role.label}\n {role.readOnly && <span className=\"sr-only\"> ({t('permissionMatrix.readOnly')})</span>}\n </span>\n {role.description && <span className={s.roleDescription()}>{role.description}</span>}\n </th>\n ))}\n </tr>\n </thead>\n {sections.map((section, sectionIndex) => (\n <tbody key={section.id}>\n <tr>\n <th scope=\"colgroup\" colSpan={roles.length + 1} className={s.section()}>\n {section.label}\n </th>\n </tr>\n {section.permissions.map((perm, i) => {\n const row = (offsets[sectionIndex] ?? 0) + i;\n return (\n <tr key={perm.id}>\n <th scope=\"row\" className={s.rowHead()}>\n <span className={s.permLabel()}>{perm.label}</span>\n {perm.description && <span className={s.permDescription()}>{perm.description}</span>}\n </th>\n {roles.map((role, col) => {\n const state = stateOf(role.id, perm.id);\n const inheritedAs = state === 'inherited' ? resolveInherited?.(role.id, perm.id) : undefined;\n const label = inheritedAs\n ? t('permissionMatrix.inheritedAs', { state: stateLabel(inheritedAs) })\n : stateLabel(state);\n const Icon = ICONS[state];\n const reason = reasonOf(role, perm.id);\n const reasonId = `${uid}-r${row}-c${col}`;\n const button = (\n <button\n ref={(el) => {\n if (el) cellRefs.current.set(`${row}:${col}`, el);\n else cellRefs.current.delete(`${row}:${col}`);\n }}\n type=\"button\"\n tabIndex={row === active.row && col === active.col ? 0 : -1}\n aria-label={t('permissionMatrix.cell', {\n permission: perm.label,\n role: role.label,\n state: label,\n })}\n aria-disabled={reason ? true : undefined}\n aria-describedby={reason ? reasonId : undefined}\n data-state={state}\n onClick={() => {\n setFocus({ row, col });\n if (!reason) cycle(role, perm);\n }}\n onFocus={() => {\n if (row !== active.row || col !== active.col) setFocus({ row, col });\n }}\n onKeyDown={onKeyDown(row, col, role, perm)}\n className={s.toggle({ state })}\n >\n <Icon size={12} strokeWidth={2.4} aria-hidden />\n {label}\n </button>\n );\n return (\n <td key={role.id} className={s.cell()}>\n {reason ? (\n <Fragment>\n <SimpleTooltip content={reason}>{button}</SimpleTooltip>\n <span id={reasonId} className=\"sr-only\">\n {reason}\n </span>\n </Fragment>\n ) : (\n button\n )}\n </td>\n );\n })}\n </tr>\n );\n })}\n </tbody>\n ))}\n </table>\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'PermissionMatrix',\n group: 'Forms',\n status: 'beta',\n description:\n 'Roles (columns) × permissions (rows grouped in sections) editor. Cells are tri-state — allowed, denied, inherited — shown with an icon and a word, never colour alone; inherited cells are dashed and can say what they resolve to. Read-only columns (e.g. owner) and per-cell disabled reasons in a tooltip; controlled `value` + `onChange`; one tab stop with grid arrow-key navigation.',\n primitive: 'native table (role=\"grid\") + @base-ui/react/tooltip',\n pattern: 'data grid (roving tabindex)',\n keyboard: [\n ['Tab', 'Enters and leaves the grid (one tab stop, on the last focused cell)'],\n [\n 'ArrowLeft / ArrowRight / ArrowUp / ArrowDown',\n 'Moves between cells (left/right mirror in RTL); section headings are skipped',\n ],\n ['Home / End', 'First / last cell of the row'],\n ['Ctrl+Home / Ctrl+End', 'First / last cell of the grid'],\n ['PageUp / PageDown', 'First / last cell of the column'],\n ['Enter / Space', 'Cycles the cell: allowed → denied → inherited'],\n ['A / D / I', 'Sets the cell to allowed / denied / inherited'],\n ],\n tokens: [\n 'card',\n 'border',\n 'secondary',\n 'foreground',\n 'muted-foreground',\n 'success',\n 'success-chip-text',\n 'destructive',\n 'destructive-chip-text',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\nimport { listboxItem, listboxPopup } from '../Select/select.variants';\n\nexport const powerSearchVariants = tv({\n slots: {\n root: [\n 'flex w-full min-w-0 cursor-text flex-wrap items-center gap-1.5 rounded-md border border-border bg-background px-2 py-1.5 text-foreground shadow-sm transition-colors motion-reduce:transition-none',\n 'has-[input:focus-visible]:border-primary/60 has-[input:focus-visible]:outline-2 has-[input:focus-visible]:outline-offset-2 has-[input:focus-visible]:outline-focus-ring',\n 'data-disabled:cursor-not-allowed data-disabled:bg-secondary/50',\n ],\n icon: 'ms-1 shrink-0 text-muted-foreground',\n terms: 'contents',\n chip: [\n 'group/chip inline-flex h-6 max-w-full items-center rounded border border-transparent bg-primary/14 font-mono text-[11.5px] text-primary-chip-text',\n 'has-[button[data-chip-body]:focus-visible]:outline-2 has-[button[data-chip-body]:focus-visible]:outline-offset-1 has-[button[data-chip-body]:focus-visible]:outline-focus-ring',\n ],\n chipText: 'bg-secondary text-foreground',\n chipBody: 'flex h-full min-w-0 items-center gap-1 truncate ps-2 pe-1 outline-none',\n chipField: 'font-semibold',\n chipOp: 'opacity-75',\n chipRemove:\n 'me-0.5 grid size-4 shrink-0 place-items-center rounded transition-colors hover:bg-primary/20 motion-reduce:transition-none',\n draft:\n 'inline-flex h-6 items-center gap-1 rounded border border-dashed border-primary/50 px-1.5 font-mono text-[11.5px] text-primary-text',\n input:\n 'h-6 min-w-32 flex-1 bg-transparent px-1 text-[13px] text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed',\n clear: [\n 'ms-auto grid size-6 shrink-0 place-items-center rounded text-muted-foreground transition-colors hover:text-foreground',\n 'focus-visible:outline-2 focus-visible:outline-focus-ring',\n ],\n positioner: 'z-50 outline-none',\n popup: [...listboxPopup, 'min-w-64'],\n group: 'px-2.5 pt-1.5 pb-1 font-mono text-[10px] font-medium tracking-wider text-muted-foreground uppercase',\n item: listboxItem,\n itemMain: 'flex min-w-0 items-baseline gap-2',\n itemCode: 'shrink-0 font-mono text-[12px] text-foreground',\n itemHint: 'truncate text-[11.5px] text-muted-foreground',\n empty: 'px-2.5 py-2 text-[12px] text-muted-foreground empty:hidden',\n },\n});\n\nexport type PowerSearchVariantProps = VariantProps<typeof powerSearchVariants>;\n","import { X } from 'lucide-react';\nimport type { KeyboardEvent } from 'react';\nimport { cn } from '../../utils/cn';\nimport { powerSearchVariants } from './power-search.variants';\n\nconst s = powerSearchVariants();\n\nexport interface PowerSearchChipProps {\n /** Field label, operator symbol and value (filters) or just the text. */\n field?: string;\n operator?: string;\n value: string;\n /** Spoken form, e.g. \"Status is failed\". */\n description: string;\n removeLabel: string;\n editHint: string;\n index: number;\n disabled?: boolean;\n onKeyDown: (e: KeyboardEvent<HTMLButtonElement>) => void;\n onEdit: () => void;\n onRemove: () => void;\n}\n\n/** One committed term. The body is reachable with ArrowLeft from the input (roving), not Tab. */\nexport function PowerSearchChip({\n field,\n operator,\n value,\n description,\n removeLabel,\n editHint,\n index,\n disabled,\n onKeyDown,\n onEdit,\n onRemove,\n}: PowerSearchChipProps) {\n return (\n <span role=\"listitem\" className={cn(s.chip(), !field && s.chipText())}>\n <button\n type=\"button\"\n tabIndex={-1}\n data-chip-body=\"\"\n data-chip-index={index}\n disabled={disabled}\n aria-label={`${description}. ${editHint}`}\n className={s.chipBody()}\n onKeyDown={onKeyDown}\n onClick={onEdit}\n >\n {field && <span className={s.chipField()}>{field}</span>}\n {operator && <span className={s.chipOp()}>{operator}</span>}\n <span className=\"truncate\">{value}</span>\n </button>\n <button\n type=\"button\"\n tabIndex={-1}\n aria-label={removeLabel}\n disabled={disabled}\n className={s.chipRemove()}\n onClick={onRemove}\n >\n <X size={11} strokeWidth={2.4} aria-hidden />\n </button>\n </span>\n );\n}\n","/** Comparison operators a filter can use. `~` is \"contains\", `!~` \"does not contain\". */\nexport type PowerSearchOperator = '=' | '!=' | '>' | '>=' | '<' | '<=' | '~' | '!~';\nexport type PowerSearchFieldType = 'string' | 'number' | 'enum' | 'date';\n\nexport interface PowerSearchValueOption {\n value: string;\n label?: string;\n}\n\nexport interface PowerSearchField<K extends string = string> {\n key: K;\n /** Display name (defaults to the key). */\n label?: string;\n type?: PowerSearchFieldType;\n /** Allowed operators (default by type). */\n operators?: PowerSearchOperator[];\n /** Value suggestions; enum fields accept only these. */\n values?: Array<string | PowerSearchValueOption>;\n description?: string;\n}\n\nexport interface PowerSearchFilter<K extends string = string> {\n type: 'filter';\n field: K;\n operator: PowerSearchOperator;\n /** Numbers for number fields, strings otherwise. */\n value: string | number;\n}\n\nexport interface PowerSearchText {\n type: 'text';\n value: string;\n}\n\nexport type PowerSearchTerm<K extends string = string> = PowerSearchFilter<K> | PowerSearchText;\n\n/** The query AST: every term must match (AND). */\nexport interface PowerSearchQuery<K extends string = string> {\n type: 'and';\n terms: PowerSearchTerm<K>[];\n}\n\nexport const POWER_SEARCH_OPERATORS: PowerSearchOperator[] = ['=', '!=', '>', '>=', '<', '<=', '~', '!~'];\n\nexport const defaultOperatorLabels: Record<PowerSearchOperator, string> = {\n '=': 'is',\n '!=': 'is not',\n '>': 'greater than',\n '>=': 'at least',\n '<': 'less than',\n '<=': 'at most',\n '~': 'contains',\n '!~': 'does not contain',\n};\n\nconst BY_TYPE: Record<PowerSearchFieldType, PowerSearchOperator[]> = {\n string: ['=', '!=', '~', '!~'],\n enum: ['=', '!='],\n number: ['=', '!=', '>', '>=', '<', '<='],\n date: ['=', '>', '>=', '<', '<='],\n};\n\nexport const emptyPowerSearchQuery = <K extends string = string>(): PowerSearchQuery<K> => ({ type: 'and', terms: [] });\n\nexport function operatorsFor(field: PowerSearchField): PowerSearchOperator[] {\n return field.operators ?? BY_TYPE[field.type ?? 'string'];\n}\n\nexport function valueOptions(field: PowerSearchField): PowerSearchValueOption[] {\n return (field.values ?? []).map((v) => (typeof v === 'string' ? { value: v } : v));\n}\n\nexport function findField<K extends string>(\n fields: readonly PowerSearchField<K>[],\n name: string,\n): PowerSearchField<K> | undefined {\n const n = name.toLowerCase();\n return fields.find((f) => f.key.toLowerCase() === n) ?? fields.find((f) => f.label?.toLowerCase() === n);\n}\n\n/** Coerces a typed value for its field: numbers for number fields; null when invalid. */\nexport function coerceValue(field: PowerSearchField, raw: string): string | number | null {\n const v = raw.trim();\n if (!v) return null;\n if (field.type === 'number') {\n const n = Number(v);\n return Number.isFinite(n) ? n : null;\n }\n if (field.type === 'enum') {\n const hit = valueOptions(field).find(\n (o) => o.value.toLowerCase() === v.toLowerCase() || o.label?.toLowerCase() === v.toLowerCase(),\n );\n return hit ? hit.value : null;\n }\n return v;\n}\n\nconst quote = (v: string) => (/[\\s\"]/.test(v) || v === '' ? `\"${v.replace(/\"/g, '\\\\\"')}\"` : v);\n\n/** Serialises the AST: `status = failed region != eu \"free text\"`. */\nexport function formatPowerSearch(query: PowerSearchQuery): string {\n return query.terms\n .map((t) => (t.type === 'text' ? quote(t.value) : `${t.field} ${t.operator} ${quote(String(t.value))}`))\n .join(' ');\n}\n\n/** Splits on whitespace, keeping quoted runs together (quotes removed, \\\" unescaped). */\nfunction tokenize(input: string): string[] {\n const out: string[] = [];\n const re = /\"((?:[^\"\\\\]|\\\\.)*)\"|(\\S+)/g;\n let m: RegExpExecArray | null;\n while ((m = re.exec(input))) out.push(m[1] !== undefined ? m[1].replace(/\\\\\"/g, '\"') : (m[2] ?? ''));\n return out;\n}\n\nconst OP_RE = /^(!=|>=|<=|!~|=|>|<|~|:)$/;\nconst INLINE_RE = /^([\\w.-]+)(!=|>=|<=|!~|=|>|<|~|:)(.*)$/;\n\n/** Parses one `field<op>value` string (spaces optional, `:` means `=`), or null. */\nexport function parsePowerSearchFilter<K extends string>(\n text: string,\n fields: readonly PowerSearchField<K>[],\n): PowerSearchFilter<K> | null {\n const m = text.trim().match(/^([\\w.-]+)\\s*(!=|>=|<=|!~|=|>|<|~|:)\\s*(.+)$/);\n if (!m) return null;\n const field = findField(fields, m[1] ?? '');\n const op = (m[2] === ':' ? '=' : m[2]) as PowerSearchOperator;\n if (!field || !operatorsFor(field).includes(op)) return null;\n const value = coerceValue(field, tokenize(m[3] ?? '')[0] ?? '');\n return value === null ? null : { type: 'filter', field: field.key, operator: op, value };\n}\n\n/** Parses a whole query string into the AST; unknown fields and loose words become text terms. */\nexport function parsePowerSearch<K extends string>(\n input: string,\n fields: readonly PowerSearchField<K>[],\n): PowerSearchQuery<K> {\n const tokens = tokenize(input);\n const terms: PowerSearchTerm<K>[] = [];\n for (let i = 0; i < tokens.length; i++) {\n const tok = tokens[i] ?? '';\n const inline = tok.match(INLINE_RE);\n if (inline) {\n const rest = inline[3] ? inline[3] : quote(tokens[i + 1] ?? '');\n const f = parsePowerSearchFilter(`${inline[1]}${inline[2]}${rest}`, fields);\n if (f) {\n terms.push(f);\n if (!inline[3]) i++;\n continue;\n }\n }\n const op = tokens[i + 1];\n const val = tokens[i + 2];\n if (op && OP_RE.test(op) && val !== undefined) {\n const f = parsePowerSearchFilter(`${tok}${op}${quote(val)}`, fields);\n if (f) {\n terms.push(f);\n i += 2;\n continue;\n }\n }\n terms.push({ type: 'text', value: tok });\n }\n return { type: 'and', terms };\n}\n\nfunction compare(actual: unknown, op: PowerSearchOperator, expected: string | number): boolean {\n if (typeof expected === 'number') {\n const a = Number(actual);\n if (!Number.isFinite(a)) return false;\n return {\n '=': a === expected,\n '!=': a !== expected,\n '>': a > expected,\n '>=': a >= expected,\n '<': a < expected,\n '<=': a <= expected,\n '~': String(a).includes(String(expected)),\n '!~': !String(a).includes(String(expected)),\n }[op];\n }\n const a = String(actual ?? '').toLowerCase();\n const e = expected.toLowerCase();\n return {\n '=': a === e,\n '!=': a !== e,\n '>': a > e,\n '>=': a >= e,\n '<': a < e,\n '<=': a <= e,\n '~': a.includes(e),\n '!~': !a.includes(e),\n }[op];\n}\n\n/** Client-side matcher for the AST: filters compare `record[field]`, text terms search every value. */\nexport function matchPowerSearch<K extends string>(\n query: PowerSearchQuery<K>,\n record: Partial<Record<K, unknown>>,\n): boolean {\n return query.terms.every((t) => {\n if (t.type === 'text') {\n const needle = t.value.toLowerCase();\n return Object.values(record).some((v) =>\n String(v ?? '')\n .toLowerCase()\n .includes(needle),\n );\n }\n return compare(record[t.field], t.operator, t.value);\n });\n}\n","import { Combobox as BaseCombobox } from '@base-ui/react/combobox';\nimport { ListFilter, X } from 'lucide-react';\nimport { useId, useLayoutEffect, useRef, useState, type KeyboardEvent } from 'react';\nimport { cn } from '../../utils/cn';\nimport { PowerSearchChip } from './PowerSearchChip';\nimport {\n coerceValue,\n defaultOperatorLabels,\n emptyPowerSearchQuery,\n findField,\n formatPowerSearch,\n operatorsFor,\n valueOptions,\n type PowerSearchField,\n type PowerSearchFilter,\n type PowerSearchOperator,\n type PowerSearchQuery,\n type PowerSearchTerm,\n} from './power-search-query';\nimport { powerSearchVariants } from './power-search.variants';\n\nexport interface PowerSearchLabels {\n input: string;\n terms: string;\n clear: string;\n freeText: (text: string) => string;\n remove: (description: string) => string;\n editHint: string;\n added: (description: string) => string;\n removed: (description: string) => string;\n invalidValue: (field: string) => string;\n typeValue: string;\n}\n\nconst defaultLabels: PowerSearchLabels = {\n input: 'Search and filter',\n terms: 'Active filters',\n clear: 'Clear all filters',\n freeText: (t) => `Search for “${t}”`,\n remove: (d) => `Remove ${d}`,\n editHint: 'Enter to edit, Delete to remove',\n added: (d) => `Added ${d}.`,\n removed: (d) => `Removed ${d}.`,\n invalidValue: (f) => `Not a valid ${f} value.`,\n typeValue: 'Type a value and press Enter.',\n};\n\ninterface Suggestion {\n id: string;\n label: string;\n kind: 'field' | 'operator' | 'value' | 'text';\n key: string;\n code?: string;\n hint?: string;\n}\n\ninterface Draft<K extends string> {\n field?: K;\n operator?: PowerSearchOperator;\n}\n\nexport interface PowerSearchProps<K extends string = string> {\n fields: PowerSearchField<K>[];\n value?: PowerSearchQuery<K>;\n defaultValue?: PowerSearchQuery<K>;\n onValueChange?: (query: PowerSearchQuery<K>) => void;\n /** Enter on an empty input. */\n onSubmit?: (query: PowerSearchQuery<K>) => void;\n /** Allow free-text terms besides field filters. */\n allowFreeText?: boolean;\n placeholder?: string;\n /** Submitted as the formatted query string through a hidden input. */\n name?: string;\n disabled?: boolean;\n labels?: Partial<PowerSearchLabels>;\n operatorLabels?: Partial<Record<PowerSearchOperator, string>>;\n className?: string;\n 'aria-label'?: string;\n}\n\nconst TYPED = /^([\\w.-]+)\\s*(!=|>=|<=|!~|=|~|:|>|<)(.*)$/s;\n\n/**\n * Structured filter input: field → operator → value suggestions (Base UI Combobox), typed\n * shortcuts (`status=failed`, `cost>100`), free text, and keyboard editing of the committed\n * terms. Emits a typed query AST (`{ type: 'and', terms }`); see `matchPowerSearch`.\n */\nexport function PowerSearch<K extends string = string>({\n fields,\n value,\n defaultValue,\n onValueChange,\n onSubmit,\n allowFreeText = true,\n placeholder = 'Filter by field or search…',\n name,\n disabled,\n labels: labelsProp,\n operatorLabels: opLabelsProp,\n className,\n 'aria-label': ariaLabel,\n}: PowerSearchProps<K>) {\n const labels = { ...defaultLabels, ...labelsProp };\n const opLabels = { ...defaultOperatorLabels, ...opLabelsProp };\n const [inner, setInner] = useState<PowerSearchQuery<K>>(defaultValue ?? emptyPowerSearchQuery<K>());\n const query = value ?? inner;\n const [draft, setDraft] = useState<Draft<K>>({});\n const [input, setInput] = useState('');\n const [open, setOpen] = useState(false);\n const [announcement, setAnnouncement] = useState('');\n const inputRef = useRef<HTMLInputElement | null>(null);\n const rootRef = useRef<HTMLDivElement | null>(null);\n const focusChip = useRef<number | null>(null);\n const draftId = useId();\n const s = powerSearchVariants();\n\n const field = draft.field ? fields.find((f) => f.key === draft.field) : undefined;\n const stage = !field ? 'field' : !draft.operator ? 'operator' : 'value';\n const fieldLabel = (f?: PowerSearchField<K>) => f?.label ?? f?.key ?? '';\n const describe = (t: PowerSearchTerm<K>) => {\n if (t.type === 'text') return `“${t.value}”`;\n const f = fields.find((x) => x.key === t.field);\n const opt = f ? valueOptions(f).find((o) => o.value === t.value) : undefined;\n return `${fieldLabel(f) || t.field} ${opLabels[t.operator]} ${opt?.label ?? t.value}`;\n };\n\n useLayoutEffect(() => {\n if (focusChip.current === null) return;\n const i = focusChip.current;\n focusChip.current = null;\n const el = i < 0 ? inputRef.current : rootRef.current?.querySelector<HTMLElement>(`[data-chip-index=\"${i}\"]`);\n (el ?? inputRef.current)?.focus();\n });\n\n const setTerms = (terms: PowerSearchTerm<K>[], message: string) => {\n const next: PowerSearchQuery<K> = { type: 'and', terms };\n setInner(next);\n onValueChange?.(next);\n setAnnouncement(message);\n };\n\n const commitFilter = (f: PowerSearchField<K>, op: PowerSearchOperator, raw: string) => {\n const v = coerceValue(f, raw);\n if (v === null) {\n setAnnouncement(labels.invalidValue(fieldLabel(f)));\n return;\n }\n const term: PowerSearchFilter<K> = { type: 'filter', field: f.key, operator: op, value: v };\n setTerms([...query.terms, term], labels.added(describe(term)));\n setDraft({});\n setInput('');\n setOpen(false);\n };\n\n const commitText = (text: string) => {\n const t = text.trim();\n if (!t || !allowFreeText) return;\n setTerms([...query.terms, { type: 'text', value: t }], labels.added(`“${t}”`));\n setInput('');\n setOpen(false);\n };\n\n const removeTerm = (i: number, focusAfter: number) => {\n const t = query.terms[i];\n if (!t) return;\n setTerms(\n query.terms.filter((_, j) => j !== i),\n labels.removed(describe(t)),\n );\n focusChip.current = focusAfter;\n };\n\n const editTerm = (i: number) => {\n const t = query.terms[i];\n if (!t) return;\n setTerms(\n query.terms.filter((_, j) => j !== i),\n '',\n );\n if (t.type === 'text') {\n setDraft({});\n setInput(t.value);\n } else {\n setDraft({ field: t.field, operator: t.operator });\n setInput(String(t.value));\n }\n focusChip.current = -1;\n };\n\n /** Typed shortcuts: `status=` jumps to the value, an exact operator jumps past it. */\n const onInputChange = (v: string) => {\n if (stage === 'field') {\n const m = v.match(TYPED);\n const f = m ? findField(fields, m[1] ?? '') : undefined;\n const op = (m?.[2] === ':' ? '=' : m?.[2]) as PowerSearchOperator | undefined;\n const rest = m?.[3] ?? '';\n if (f && op && operatorsFor(f).includes(op) && !((op === '>' || op === '<') && rest === '')) {\n setDraft({ field: f.key, operator: op });\n setInput(rest.trimStart());\n setOpen(true);\n return;\n }\n } else if (stage === 'operator' && field) {\n const ops = operatorsFor(field);\n const typed = v.trim() === ':' ? '=' : v.trim();\n if (ops.includes(typed as PowerSearchOperator) && !ops.some((o) => o !== typed && o.startsWith(typed))) {\n setDraft({ ...draft, operator: typed as PowerSearchOperator });\n setInput('');\n return;\n }\n }\n setInput(v);\n if (!open) setOpen(true);\n };\n\n const q = input.trim().toLowerCase();\n let suggestions: Suggestion[] = [];\n if (stage === 'field') {\n suggestions = fields\n .filter((f) => !q || f.key.toLowerCase().includes(q) || f.label?.toLowerCase().includes(q))\n .map((f) => ({\n id: `field:${f.key}`,\n label: fieldLabel(f),\n kind: 'field' as const,\n key: f.key,\n hint: f.description,\n }));\n if (q && allowFreeText)\n suggestions.push({ id: `text:${q}`, label: labels.freeText(input.trim()), kind: 'text', key: input.trim() });\n } else if (stage === 'operator' && field) {\n suggestions = operatorsFor(field)\n .filter((o) => !q || o.startsWith(q) || opLabels[o].toLowerCase().includes(q))\n .map((o) => ({ id: `op:${o}`, label: opLabels[o], kind: 'operator' as const, key: o, code: o }));\n } else if (field) {\n suggestions = valueOptions(field)\n .filter((o) => !q || o.value.toLowerCase().includes(q) || o.label?.toLowerCase().includes(q))\n .map((o) => ({ id: `value:${o.value}`, label: o.label ?? o.value, kind: 'value' as const, key: o.value }));\n }\n\n const onSelect = (item: Suggestion | null) => {\n if (!item) return;\n if (item.kind === 'field') {\n setDraft({ field: item.key as K });\n setInput('');\n setOpen(true);\n } else if (item.kind === 'operator') {\n setDraft({ ...draft, operator: item.key as PowerSearchOperator });\n setInput('');\n setOpen(true);\n } else if (item.kind === 'value' && field && draft.operator) commitFilter(field, draft.operator, item.key);\n else if (item.kind === 'text') commitText(item.key);\n };\n\n const onKeyDown = (e: KeyboardEvent<HTMLInputElement> & { preventBaseUIHandler?: () => void }) => {\n const el = e.currentTarget;\n const atStart = el.selectionStart === 0 && el.selectionEnd === 0;\n const activeId = el.getAttribute('aria-activedescendant');\n const hasHighlight = open && !!activeId && !!document.getElementById(activeId);\n if (e.key === 'Enter' && !hasHighlight) {\n e.preventDefault();\n e.preventBaseUIHandler?.();\n if (stage === 'value' && field && draft.operator) {\n if (input.trim()) commitFilter(field, draft.operator, input);\n } else if (stage === 'field' && input.trim()) commitText(input);\n else if (stage === 'field' && !input.trim()) onSubmit?.(query);\n } else if (e.key === 'Backspace' && input === '') {\n e.preventDefault();\n if (draft.operator) setDraft({ field: draft.field });\n else if (draft.field) setDraft({});\n else if (query.terms.length) editTerm(query.terms.length - 1);\n } else if (e.key === 'ArrowLeft' && atStart && !draft.field && query.terms.length) {\n e.preventDefault();\n setOpen(false);\n rootRef.current?.querySelector<HTMLElement>(`[data-chip-index=\"${query.terms.length - 1}\"]`)?.focus();\n } else if (e.key === 'Escape' && !open && (draft.field || input)) {\n e.preventBaseUIHandler?.();\n setDraft({});\n setInput('');\n }\n };\n\n const onChipKeyDown = (i: number) => (e: KeyboardEvent<HTMLButtonElement>) => {\n const n = query.terms.length;\n const moves: Record<string, number> = {\n ArrowLeft: Math.max(i - 1, 0),\n ArrowRight: i + 1 >= n ? -1 : i + 1,\n Home: 0,\n End: -1,\n Escape: -1,\n };\n if (e.key in moves) {\n e.preventDefault();\n focusChip.current = moves[e.key] ?? -1;\n setAnnouncement((a) => a + ''.slice(0, 0));\n const el =\n focusChip.current < 0\n ? inputRef.current\n : rootRef.current?.querySelector<HTMLElement>(`[data-chip-index=\"${focusChip.current}\"]`);\n focusChip.current = null;\n el?.focus();\n } else if (e.key === 'Backspace' || e.key === 'Delete') {\n e.preventDefault();\n removeTerm(i, n - 1 <= 0 ? -1 : e.key === 'Backspace' ? Math.max(i - 1, 0) : i >= n - 1 ? -1 : i);\n }\n };\n\n const draftField = fieldLabel(field);\n return (\n <div\n ref={rootRef}\n className={cn(s.root(), className)}\n data-disabled={disabled || undefined}\n onMouseDown={(e) => {\n if (e.target === e.currentTarget) {\n e.preventDefault();\n inputRef.current?.focus();\n }\n }}\n >\n <ListFilter size={15} aria-hidden className={s.icon()} />\n {query.terms.length > 0 && (\n <span role=\"list\" aria-label={labels.terms} className={s.terms()}>\n {query.terms.map((t, i) => {\n const f = t.type === 'filter' ? fields.find((x) => x.key === t.field) : undefined;\n const opt = f && t.type === 'filter' ? valueOptions(f).find((o) => o.value === t.value) : undefined;\n const d = describe(t);\n return (\n <PowerSearchChip\n key={`${i}-${t.type === 'text' ? t.value : `${t.field}${t.operator}${t.value}`}`}\n index={i}\n field={t.type === 'filter' ? fieldLabel(f) || t.field : undefined}\n operator={t.type === 'filter' ? t.operator : undefined}\n value={t.type === 'filter' ? (opt?.label ?? String(t.value)) : t.value}\n description={d}\n removeLabel={labels.remove(d)}\n editHint={labels.editHint}\n disabled={disabled}\n onKeyDown={onChipKeyDown(i)}\n onEdit={() => editTerm(i)}\n onRemove={() => removeTerm(i, -1)}\n />\n );\n })}\n </span>\n )}\n {field && (\n <span className={s.draft()}>\n <span aria-hidden>{draftField}</span>\n {draft.operator && (\n <span aria-hidden className=\"opacity-75\">\n {draft.operator}\n </span>\n )}\n <span id={draftId} className=\"sr-only\">\n {`${draftField} ${draft.operator ? opLabels[draft.operator] : ''}`.trim()}\n </span>\n </span>\n )}\n <BaseCombobox.Root<Suggestion>\n items={suggestions}\n filter={null}\n value={null}\n onValueChange={(item) => onSelect(item as Suggestion | null)}\n inputValue={input}\n onInputValueChange={(v, details) => {\n // Only typing edits the text: Base UI also clears or fills it on focus and selection.\n if (details.reason === 'input-change') onInputChange(v);\n }}\n open={open && !disabled}\n onOpenChange={(next, details) => {\n if (!next && details.reason === 'item-press') return;\n setOpen(next);\n }}\n itemToStringLabel={(item) => (item as Suggestion).label}\n disabled={disabled}\n >\n <BaseCombobox.Input\n ref={inputRef}\n aria-label={ariaLabel ?? labels.input}\n aria-describedby={field ? draftId : undefined}\n placeholder={query.terms.length || field ? undefined : placeholder}\n className={s.input()}\n onKeyDown={onKeyDown}\n />\n <BaseCombobox.Portal>\n <BaseCombobox.Positioner\n className={s.positioner()}\n side=\"bottom\"\n align=\"start\"\n sideOffset={8}\n anchor={rootRef}\n >\n <BaseCombobox.Popup className={s.popup()}>\n <BaseCombobox.Empty className={s.empty()}>\n {stage === 'value' ? labels.typeValue : null}\n </BaseCombobox.Empty>\n <BaseCombobox.List className=\"outline-none data-empty:hidden\">\n {(item: Suggestion) => (\n <BaseCombobox.Item key={item.id} value={item} className={s.item()}>\n <span className={s.itemMain()}>\n {item.code && <span className={s.itemCode()}>{item.code}</span>}\n <span className=\"truncate\">{item.label}</span>\n {item.hint && <span className={s.itemHint()}>{item.hint}</span>}\n </span>\n </BaseCombobox.Item>\n )}\n </BaseCombobox.List>\n </BaseCombobox.Popup>\n </BaseCombobox.Positioner>\n </BaseCombobox.Portal>\n </BaseCombobox.Root>\n {query.terms.length > 0 && (\n <button\n type=\"button\"\n aria-label={labels.clear}\n className={s.clear()}\n disabled={disabled}\n onClick={() => {\n setTerms([], labels.clear + '.');\n inputRef.current?.focus();\n }}\n >\n <X size={14} aria-hidden />\n </button>\n )}\n <span role=\"status\" data-announcer=\"\" className=\"sr-only\">\n {announcement}\n </span>\n {name && <input type=\"hidden\" name={name} value={formatPowerSearch(query)} />}\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'PowerSearch',\n group: 'Forms',\n status: 'experimental',\n description:\n 'Structured filter input: pick a field, an operator and a value from suggestions (or type `status=failed`, `cost>100`), add free text, and edit committed terms from the keyboard. Emits a typed query AST (`{ type: \"and\", terms }`) with parse / format / match helpers; fields, operators and values are props.',\n primitive: '@base-ui/react/combobox',\n pattern: 'combobox + list of editable filter terms',\n keyboard: [\n ['ArrowDown / ArrowUp', 'Opens the suggestions and moves the highlight'],\n ['Enter', 'Picks the highlighted suggestion; otherwise commits the typed value or free text (empty input: submit)'],\n ['field=value / field:value', 'Typed shortcut: jumps straight to the value step'],\n ['Backspace (empty input)', 'Steps back: operator → field → edits the last term'],\n ['ArrowLeft (input start)', 'Moves focus to the last term'],\n ['ArrowLeft / ArrowRight / Home / End (on a term)', 'Moves between terms; past the last returns to the input'],\n ['Enter / Space (on a term)', 'Pulls the term back into the input to edit it'],\n ['Delete / Backspace (on a term)', 'Removes the term'],\n ['Escape', 'Closes the suggestions; again clears the term being built'],\n ],\n tokens: [\n 'background',\n 'border',\n 'foreground',\n 'muted-foreground',\n 'primary',\n 'primary-text',\n 'secondary',\n 'popover',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const progressVariants = tv({\n slots: {\n root: 'grid w-full gap-1.5',\n header: 'flex items-center justify-between gap-3',\n label: 'text-[12.5px] font-medium text-foreground',\n value: 'font-mono text-[11.5px] font-semibold tabular-nums',\n track: 'relative w-full overflow-hidden rounded-full bg-secondary',\n indicator: [\n 'block h-full rounded-full transition-[width] duration-400 ease-out motion-reduce:transition-none',\n 'data-[indeterminate]:w-2/5 data-[indeterminate]:animate-pulse motion-reduce:data-[indeterminate]:animate-none',\n ],\n },\n variants: {\n tone: {\n primary: { indicator: 'bg-primary', value: 'text-foreground' },\n success: { indicator: 'bg-success', value: 'text-success-text' },\n warning: { indicator: 'bg-warning', value: 'text-warning-text' },\n destructive: { indicator: 'bg-destructive', value: 'text-destructive-text' },\n },\n size: {\n sm: { track: 'h-1.5' },\n md: { track: 'h-2' },\n lg: { track: 'h-2.5' },\n },\n },\n defaultVariants: { tone: 'primary', size: 'md' },\n});\n\nexport type ProgressVariantProps = VariantProps<typeof progressVariants>;\n","import { Progress as BaseProgress } from '@base-ui/react/progress';\nimport type { ReactNode, Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { progressVariants, type ProgressVariantProps } from './progress.variants';\n\nexport interface ProgressProps extends Omit<BaseProgress.Root.Props, 'className' | 'children'>, ProgressVariantProps {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n /** Visible label; also the accessible name. Without it, pass `aria-label`. */\n label?: ReactNode;\n /** Shows the formatted value (e.g. \"72%\") opposite the label. */\n showValue?: boolean;\n}\n\n/**\n * Task progress bar (role=\"progressbar\") on Base UI Progress. `value={null}` makes it\n * indeterminate: a pulsing segment that holds still under reduced motion.\n */\nexport function Progress({ tone, size, label, showValue = false, className, ...props }: ProgressProps) {\n const s = progressVariants({ tone, size });\n const indeterminate = props.value == null;\n return (\n <BaseProgress.Root className={cn(s.root(), className)} {...props}>\n {(label != null || (showValue && !indeterminate)) && (\n <div className={s.header()}>\n {label != null ? <BaseProgress.Label className={s.label()}>{label}</BaseProgress.Label> : <span />}\n {showValue && !indeterminate && <BaseProgress.Value className={s.value()} />}\n </div>\n )}\n <BaseProgress.Track className={s.track()}>\n <BaseProgress.Indicator className={s.indicator()} />\n </BaseProgress.Track>\n </BaseProgress.Root>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Progress',\n group: 'Feedback',\n status: 'stable',\n description:\n 'Progress bar for a running task: optional label and formatted value, four tones (primary, success, warning, destructive), three heights, and an indeterminate state (value null) that stops pulsing under reduced motion.',\n primitive: '@base-ui/react/progress',\n pattern: 'progressbar',\n tokens: [\n 'primary',\n 'success',\n 'success-text',\n 'warning',\n 'warning-text',\n 'destructive',\n 'destructive-text',\n 'secondary',\n 'foreground',\n ],\n};\n","/**\n * QueryBuilder model: a serialisable tree of AND/OR groups and field conditions, plus pure\n * helpers to describe it (`queryToString`) and to test a record against it (`evaluateQuery`).\n */\nimport { interpolate } from '../../i18n/format';\nimport { catalogs } from '../../i18n/messages';\nimport { en, type MessageKey, type Messages } from '../../i18n/messages/en';\n\nexport type QueryFieldType = 'text' | 'number' | 'enum' | 'date' | 'boolean';\n\nexport type QueryOperator =\n | 'eq'\n | 'neq'\n | 'contains'\n | 'notContains'\n | 'startsWith'\n | 'endsWith'\n | 'gt'\n | 'gte'\n | 'lt'\n | 'lte'\n | 'between'\n | 'in'\n | 'notIn'\n | 'before'\n | 'after'\n | 'isEmpty'\n | 'isNotEmpty'\n | 'isTrue'\n | 'isFalse';\n\nexport interface QueryFieldOption {\n value: string;\n label: string;\n}\n\nexport interface QueryField {\n id: string;\n label: string;\n type: QueryFieldType;\n /** Choices of an `enum` field. */\n options?: QueryFieldOption[];\n /** Restricts the operators offered (defaults to every operator of the type). */\n operators?: QueryOperator[];\n}\n\n/**\n * A condition's value: text, number, boolean, an option list (`in` / `notIn`), a `[from, to]`\n * pair (`between`) or null. Dates are `YYYY-MM-DD` strings.\n */\nexport type QueryValue =\n string | number | boolean | string[] | [number | null, number | null] | [string, string] | null;\n\nexport interface QueryCondition {\n type: 'condition';\n id: string;\n /** A `QueryField.id`. */\n field: string;\n operator: QueryOperator;\n value?: QueryValue;\n}\n\nexport interface QueryGroup {\n type: 'group';\n id: string;\n combinator: 'and' | 'or';\n children: QueryNode[];\n}\n\nexport type QueryNode = QueryCondition | QueryGroup;\n\n/** Operators per field type, in menu order. */\nexport const QUERY_OPERATORS: Record<QueryFieldType, QueryOperator[]> = {\n text: ['eq', 'neq', 'contains', 'notContains', 'startsWith', 'endsWith', 'isEmpty', 'isNotEmpty'],\n number: ['eq', 'neq', 'gt', 'gte', 'lt', 'lte', 'between', 'isEmpty', 'isNotEmpty'],\n enum: ['eq', 'neq', 'in', 'notIn', 'isEmpty', 'isNotEmpty'],\n date: ['eq', 'before', 'after', 'between', 'isEmpty', 'isNotEmpty'],\n boolean: ['isTrue', 'isFalse'],\n};\n\nexport const operatorsFor = (field: QueryField | undefined): QueryOperator[] =>\n field ? (field.operators ?? QUERY_OPERATORS[field.type]) : [];\n\n/** How many values an operator takes: none, one, a `[from, to]` pair, or a list. */\nexport function operatorArity(op: QueryOperator): 'none' | 'one' | 'pair' | 'list' {\n if (op === 'isEmpty' || op === 'isNotEmpty' || op === 'isTrue' || op === 'isFalse') return 'none';\n if (op === 'between') return 'pair';\n if (op === 'in' || op === 'notIn') return 'list';\n return 'one';\n}\n\n/** A fresh node id (call it from event handlers, not during render). */\nexport const newQueryId = () => `q${Math.random().toString(36).slice(2, 10)}`;\n\nexport function createQueryGroup(combinator: 'and' | 'or' = 'and', children: QueryNode[] = []): QueryGroup {\n return { type: 'group', id: newQueryId(), combinator, children };\n}\n\nexport function createQueryCondition(field: QueryField | undefined): QueryCondition {\n return { type: 'condition', id: newQueryId(), field: field?.id ?? '', operator: operatorsFor(field)[0] ?? 'eq' };\n}\n\n/** True when a condition has the values its operator needs. */\nexport function isConditionComplete(c: QueryCondition): boolean {\n const arity = operatorArity(c.operator);\n if (!c.field) return false;\n if (arity === 'none') return true;\n const v = c.value;\n if (arity === 'pair')\n return Array.isArray(v) && v.length === 2 && v.every((x) => x !== '' && x !== null && x !== undefined);\n if (arity === 'list') return Array.isArray(v) && v.length > 0;\n return v !== undefined && v !== null && v !== '';\n}\n\n// ------------------------------------------------------------------ queryToString\n\nexport interface QueryToStringOptions {\n /** Field definitions: labels for fields and enum options. Without them, ids are shown. */\n fields?: QueryField[];\n /** Picks the built-in catalog for operator words (\"en\" default). */\n locale?: string;\n /** Translator (e.g. `useI18n().t`); overrides `locale`. */\n t?: (key: MessageKey, vars?: Record<string, string | number>) => string;\n}\n\n/**\n * Human-readable query: `Status is \"Active\" AND (Age greater than 30 OR Country is any of\n * \"Spain\", \"France\")`. Incomplete conditions and empty groups are left out.\n */\nexport function queryToString(tree: QueryNode, options: QueryToStringOptions = {}): string {\n const lang = (options.locale ?? 'en').split(/[-_]/)[0]?.toLowerCase() ?? 'en';\n const messages: Messages = (catalogs as Record<string, Messages | undefined>)[lang] ?? en;\n const t =\n options.t ??\n ((key: MessageKey, vars?: Record<string, string | number>) =>\n interpolate(messages[key] ?? en[key], vars, options.locale ?? 'en'));\n const fieldOf = (id: string) => options.fields?.find((f) => f.id === id);\n\n const literal = (field: QueryField | undefined, v: unknown): string => {\n if (typeof v === 'number') return String(v);\n if (typeof v === 'boolean') return t(v ? 'queryBuilder.true' : 'queryBuilder.false');\n const s = String(v);\n const label = field?.options?.find((o) => o.value === s)?.label ?? s;\n return field?.type === 'date' ? label : `\"${label}\"`;\n };\n\n const visit = (node: QueryNode, nested: boolean): string => {\n if (node.type === 'condition') {\n if (!isConditionComplete(node)) return '';\n const field = fieldOf(node.field);\n const head = `${field?.label ?? node.field} ${t(`queryBuilder.op.${node.operator}`)}`;\n const arity = operatorArity(node.operator);\n const v = node.value;\n if (arity === 'none') return head;\n if (arity === 'pair' && Array.isArray(v))\n return `${head} ${t('queryBuilder.between', { from: literal(field, v[0]), to: literal(field, v[1]) })}`;\n if (arity === 'list' && Array.isArray(v))\n return `${head} ${(v as unknown[]).map((x) => literal(field, x)).join(', ')}`;\n return `${head} ${literal(field, v)}`;\n }\n const parts = node.children.map((c) => visit(c, true)).filter(Boolean);\n const joined = parts.join(` ${t(node.combinator === 'and' ? 'queryBuilder.and' : 'queryBuilder.or')} `);\n return nested && parts.length > 1 ? `(${joined})` : joined;\n };\n return visit(tree, false);\n}\n\n// ------------------------------------------------------------------ evaluateQuery\n\nconst DAY = /^\\d{4}-\\d{2}-\\d{2}/;\nconst pad = (n: number) => String(n).padStart(2, '0');\n\n/** `YYYY-MM-DD` of a Date (local) or of a date/datetime string; null otherwise. */\nfunction dayKey(v: unknown): string | null {\n if (v instanceof Date)\n return Number.isNaN(v.getTime()) ? null : `${v.getFullYear()}-${pad(v.getMonth() + 1)}-${pad(v.getDate())}`;\n if (typeof v === 'string' && DAY.test(v)) return v.slice(0, 10);\n return null;\n}\n\nconst isEmptyValue = (v: unknown) => v === null || v === undefined || v === '' || (Array.isArray(v) && v.length === 0);\nconst norm = (v: unknown) => String(v ?? '').toLowerCase();\n\nfunction compare(a: unknown, b: unknown, type: QueryFieldType | undefined): number | null {\n if (type === 'date' || (type === undefined && dayKey(b) !== null && dayKey(a) !== null)) {\n const x = dayKey(a);\n const y = dayKey(b);\n return x === null || y === null ? null : x < y ? -1 : x > y ? 1 : 0;\n }\n const x = typeof a === 'number' ? a : Number(a);\n const y = typeof b === 'number' ? b : Number(b);\n if (a === null || a === undefined || a === '' || Number.isNaN(x) || Number.isNaN(y)) return null;\n return x - y;\n}\n\nfunction equals(a: unknown, b: unknown, type: QueryFieldType | undefined): boolean {\n if (Array.isArray(a)) return a.some((x) => equals(x, b, type));\n if (type === 'number' || typeof b === 'number') return compare(a, b, 'number') === 0;\n if (type === 'date') return compare(a, b, 'date') === 0;\n if (type === 'enum') return String(a) === String(b);\n return norm(a) === norm(b);\n}\n\nfunction test(c: QueryCondition, record: Record<string, unknown>, type: QueryFieldType | undefined): boolean {\n const v = record[c.field];\n const target = c.value;\n switch (c.operator) {\n case 'isEmpty':\n return isEmptyValue(v);\n case 'isNotEmpty':\n return !isEmptyValue(v);\n case 'isTrue':\n return v === true;\n case 'isFalse':\n return v === false;\n case 'eq':\n return equals(v, target, type);\n case 'neq':\n return !equals(v, target, type);\n case 'contains':\n return norm(v).includes(norm(target));\n case 'notContains':\n return !norm(v).includes(norm(target));\n case 'startsWith':\n return norm(v).startsWith(norm(target));\n case 'endsWith':\n return norm(v).endsWith(norm(target));\n case 'in':\n case 'notIn': {\n const list = Array.isArray(target) ? (target as unknown[]).map(String) : [];\n const hit = Array.isArray(v) ? v.some((x) => list.includes(String(x))) : list.includes(String(v));\n return c.operator === 'in' ? hit : !hit;\n }\n case 'between': {\n if (!Array.isArray(target)) return false;\n const lo = compare(v, target[0], type);\n const hi = compare(v, target[1], type);\n return lo !== null && hi !== null && lo >= 0 && hi <= 0;\n }\n default: {\n const d = compare(v, target, c.operator === 'before' || c.operator === 'after' ? 'date' : type);\n if (d === null) return false;\n if (c.operator === 'gt' || c.operator === 'after') return d > 0;\n if (c.operator === 'gte') return d >= 0;\n if (c.operator === 'lt' || c.operator === 'before') return d < 0;\n return d <= 0;\n }\n }\n}\n\nconst hasCompleteCondition = (node: QueryNode): boolean =>\n node.type === 'condition' ? isConditionComplete(node) : node.children.some(hasCompleteCondition);\n\n/**\n * Whether `record` matches the query. Text comparisons ignore case; dates compare by day\n * (`YYYY-MM-DD` strings or Date objects); array-valued record fields match `eq` / `in` when any\n * item does. Incomplete conditions are ignored, and an empty group matches everything.\n * Pass `fields` so values are compared by their declared type.\n */\nexport function evaluateQuery(tree: QueryNode, record: Record<string, unknown>, fields?: QueryField[]): boolean {\n if (tree.type === 'condition') {\n if (!isConditionComplete(tree)) return true;\n return test(tree, record, fields?.find((f) => f.id === tree.field)?.type);\n }\n const relevant = tree.children.filter(hasCompleteCondition);\n if (!relevant.length) return true;\n return tree.combinator === 'and'\n ? relevant.every((c) => evaluateQuery(c, record, fields))\n : relevant.some((c) => evaluateQuery(c, record, fields));\n}\n","import { tv, type VariantProps } from '../../utils/tv';\n\n/**\n * Nested groups as bordered cards (each level one step deeper in tone), a combinator switch per\n * group, and condition rows that wrap on narrow screens.\n */\nexport const queryBuilderVariants = tv({\n slots: {\n root: 'flex w-full min-w-0 flex-col gap-3',\n group: 'flex min-w-0 flex-col gap-2.5 rounded-lg border border-border p-3',\n groupHeader: 'flex flex-wrap items-center justify-between gap-2',\n list: 'flex min-w-0 flex-col gap-2',\n item: 'flex min-w-0 items-start gap-2',\n joiner: 'mt-2 w-9 shrink-0 text-center font-mono text-[10.5px] font-semibold text-muted-foreground',\n condition: 'flex min-w-0 flex-1 flex-wrap items-center gap-2',\n fieldSelect: 'w-40',\n operatorSelect: 'w-40',\n value: 'flex min-w-0 flex-1 flex-wrap items-center gap-2',\n valueControl: 'min-w-36 flex-1',\n empty: 'text-[12.5px] text-muted-foreground',\n footer: 'flex flex-wrap items-center gap-2',\n preview: 'rounded-md border border-border bg-secondary/40 px-3 py-2 font-mono text-[12px] text-foreground',\n },\n variants: {\n depth: {\n 0: { group: 'bg-card' },\n 1: { group: 'bg-secondary/30' },\n 2: { group: 'bg-secondary/50' },\n },\n },\n defaultVariants: { depth: 0 },\n});\n\nexport type QueryBuilderVariantProps = VariantProps<typeof queryBuilderVariants>;\n","import { useI18n } from '../../i18n/I18nProvider';\nimport { toISODate } from '../Calendar/calendar-utils';\nimport { DatePicker } from '../DatePicker';\nimport { Input } from '../Input';\nimport { MultiSelect } from '../MultiSelect';\nimport { NumberInput } from '../NumberInput';\nimport { SimpleSelect } from '../Select';\nimport { operatorArity, type QueryCondition, type QueryField, type QueryValue } from './query';\nimport { queryBuilderVariants } from './query-builder.variants';\n\nexport interface QueryValueEditorProps {\n condition: QueryCondition;\n field: QueryField | undefined;\n onChange: (value: QueryValue | undefined) => void;\n disabled?: boolean;\n locale?: string;\n}\n\nconst s = queryBuilderVariants();\n\nconst fromISO = (v: unknown): Date | null => {\n if (typeof v !== 'string') return null;\n const m = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(v);\n return m ? new Date(Number(m[1]), Number(m[2]) - 1, Number(m[3])) : null;\n};\nconst asNumber = (v: unknown): number | null => (typeof v === 'number' && !Number.isNaN(v) ? v : null);\n\n/** The value control for a condition: depends on the field type and the operator's arity. */\nexport function QueryValueEditor({ condition, field, onChange, disabled, locale }: QueryValueEditorProps) {\n const { t } = useI18n();\n const arity = operatorArity(condition.operator);\n if (!field || arity === 'none') return null;\n const v = condition.value;\n const pair = Array.isArray(v) && arity === 'pair' ? v : [null, null];\n\n if (field.type === 'enum') {\n const options = field.options ?? [];\n if (arity === 'list') {\n return (\n <MultiSelect\n aria-label={t('queryBuilder.value')}\n options={options}\n value={Array.isArray(v) ? (v as unknown[]).map(String) : []}\n onValueChange={(vals) => onChange(vals)}\n disabled={disabled}\n size=\"sm\"\n className={s.valueControl()}\n />\n );\n }\n return (\n <SimpleSelect\n aria-label={t('queryBuilder.value')}\n items={options}\n value={typeof v === 'string' ? v : null}\n onValueChange={(val) => onChange(val ?? undefined)}\n disabled={disabled}\n size=\"sm\"\n className={s.valueControl()}\n />\n );\n }\n\n if (field.type === 'number') {\n if (arity === 'pair') {\n const set = (i: 0 | 1, n: number | null) => {\n const next: [number | null, number | null] = [asNumber(pair[0]), asNumber(pair[1])];\n next[i] = n;\n onChange(next[0] === null && next[1] === null ? undefined : next);\n };\n return (\n <>\n <NumberInput\n aria-label={t('queryBuilder.valueFrom')}\n value={asNumber(pair[0])}\n onValueChange={(n) => set(0, n)}\n disabled={disabled}\n size=\"sm\"\n hideSteppers\n className=\"w-28\"\n />\n <NumberInput\n aria-label={t('queryBuilder.valueTo')}\n value={asNumber(pair[1])}\n onValueChange={(n) => set(1, n)}\n disabled={disabled}\n size=\"sm\"\n hideSteppers\n className=\"w-28\"\n />\n </>\n );\n }\n return (\n <NumberInput\n aria-label={t('queryBuilder.value')}\n value={asNumber(v)}\n onValueChange={(n) => onChange(n ?? undefined)}\n disabled={disabled}\n size=\"sm\"\n hideSteppers\n className=\"w-36\"\n />\n );\n }\n\n if (field.type === 'date') {\n if (arity === 'pair') {\n const set = (i: 0 | 1, d: Date | null) => {\n const next: [string, string] = [\n typeof pair[0] === 'string' ? pair[0] : '',\n typeof pair[1] === 'string' ? pair[1] : '',\n ];\n next[i] = d ? toISODate(d) : '';\n onChange(next[0] || next[1] ? next : undefined);\n };\n return (\n <>\n <DatePicker\n aria-label={t('queryBuilder.valueFrom')}\n value={fromISO(pair[0])}\n onValueChange={(d) => set(0, d)}\n locale={locale}\n disabled={disabled}\n size=\"sm\"\n className=\"w-44\"\n />\n <DatePicker\n aria-label={t('queryBuilder.valueTo')}\n value={fromISO(pair[1])}\n onValueChange={(d) => set(1, d)}\n locale={locale}\n disabled={disabled}\n size=\"sm\"\n className=\"w-44\"\n />\n </>\n );\n }\n return (\n <DatePicker\n aria-label={t('queryBuilder.value')}\n value={fromISO(v)}\n onValueChange={(d) => onChange(d ? toISODate(d) : undefined)}\n locale={locale}\n disabled={disabled}\n size=\"sm\"\n className=\"w-44\"\n />\n );\n }\n\n return (\n <Input\n aria-label={t('queryBuilder.value')}\n value={typeof v === 'string' ? v : v === undefined || v === null ? '' : String(v)}\n onChange={(e) => onChange(e.currentTarget.value === '' ? undefined : e.currentTarget.value)}\n disabled={disabled}\n size=\"sm\"\n className={s.valueControl()}\n />\n );\n}\n","import { FolderPlus, Plus, X } from 'lucide-react';\nimport { useEffect, useRef, useState } from 'react';\nimport { useI18n, useOptionalI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { Button, IconButton } from '../Button';\nimport { SimpleSelect } from '../Select';\nimport { Toggle, ToggleGroup } from '../ToggleGroup';\nimport {\n createQueryCondition,\n createQueryGroup,\n operatorArity,\n operatorsFor,\n queryToString,\n type QueryCondition,\n type QueryField,\n type QueryGroup,\n type QueryNode,\n type QueryOperator,\n type QueryValue,\n} from './query';\nimport { queryBuilderVariants } from './query-builder.variants';\nimport { QueryValueEditor } from './QueryValueEditor';\n\nexport interface QueryBuilderProps {\n /** Fields a condition can test. */\n fields: QueryField[];\n /** The query tree (controlled). The root is a group. */\n value?: QueryGroup;\n defaultValue?: QueryGroup;\n onChange?: (value: QueryGroup) => void;\n /** Group nesting limit, counting the root (1 = no sub-groups). */\n maxDepth?: number;\n /** Show the query as text under the builder (`queryToString`). */\n showPreview?: boolean;\n /** Locale for dates and the preview. Defaults to the I18nProvider's. */\n locale?: string;\n disabled?: boolean;\n className?: string;\n 'aria-label'?: string;\n}\n\nconst EMPTY_ROOT: QueryGroup = { type: 'group', id: 'root', combinator: 'and', children: [] };\n\nfunction mapNode(node: QueryNode, id: string, fn: (n: QueryNode) => QueryNode | null): QueryNode | null {\n if (node.id === id) return fn(node);\n if (node.type === 'condition') return node;\n const children = node.children.map((c) => mapNode(c, id, fn)).filter((c): c is QueryNode => c !== null);\n return { ...node, children };\n}\n\n/**\n * Visual query editor: nested AND/OR groups of field / operator / value conditions. Fields are\n * typed (text, number, enum, date, boolean) and each type offers its operators and value editor.\n * The value is a serialisable tree; `queryToString` and `evaluateQuery` read it.\n */\nexport function QueryBuilder({\n fields,\n value,\n defaultValue,\n onChange,\n maxDepth = 3,\n showPreview = false,\n locale: localeProp,\n disabled,\n className,\n 'aria-label': ariaLabel,\n}: QueryBuilderProps) {\n const { t } = useI18n();\n const providerLocale = useOptionalI18n()?.locale;\n const locale = localeProp ?? providerLocale;\n const [inner, setInner] = useState<QueryGroup>(defaultValue ?? EMPTY_ROOT);\n const tree = value ?? inner;\n const rootRef = useRef<HTMLDivElement | null>(null);\n const pendingFocus = useRef<string | null>(null);\n const s = queryBuilderVariants();\n\n useEffect(() => {\n if (!pendingFocus.current) return;\n const el = rootRef.current?.querySelector<HTMLElement>(pendingFocus.current);\n pendingFocus.current = null;\n el?.focus();\n });\n\n const commit = (next: QueryGroup) => {\n setInner(next);\n onChange?.(next);\n };\n const update = (id: string, fn: (n: QueryNode) => QueryNode | null) => {\n const next = mapNode(tree, id, fn);\n if (next && next.type === 'group') commit(next);\n };\n const patchCondition = (id: string, patch: Partial<QueryCondition>) =>\n update(id, (n) => (n.type === 'condition' ? { ...n, ...patch } : n));\n\n const addTo = (group: QueryGroup, node: QueryNode) => {\n pendingFocus.current =\n node.type === 'condition'\n ? `[data-query-node=\"${node.id}\"] [role=\"combobox\"]`\n : `[data-query-node=\"${node.id}\"] [data-query-part=\"add-condition\"]`;\n update(group.id, (n) => (n.type === 'group' ? { ...n, children: [...n.children, node] } : n));\n };\n const remove = (parent: QueryGroup, id: string) => {\n pendingFocus.current = `[data-query-node=\"${parent.id}\"] [data-query-part=\"add-condition\"]`;\n update(id, () => null);\n };\n\n const renderCondition = (c: QueryCondition, index: number, parent: QueryGroup) => {\n const field = fields.find((f) => f.id === c.field);\n const operators = operatorsFor(field);\n return (\n <div\n role=\"group\"\n aria-label={t('queryBuilder.condition', { index })}\n data-query-node={c.id}\n className={s.condition()}\n >\n <SimpleSelect\n aria-label={t('queryBuilder.field')}\n items={fields.map((f) => ({ value: f.id, label: f.label }))}\n value={c.field || null}\n onValueChange={(id) => {\n const nextField = fields.find((f) => f.id === id);\n if (nextField)\n patchCondition(c.id, {\n field: nextField.id,\n operator: operatorsFor(nextField)[0] ?? 'eq',\n value: undefined,\n });\n }}\n disabled={disabled}\n size=\"sm\"\n className={s.fieldSelect()}\n />\n <SimpleSelect<QueryOperator>\n aria-label={t('queryBuilder.operator')}\n items={operators.map((op) => ({ value: op, label: t(`queryBuilder.op.${op}`) }))}\n value={c.operator}\n onValueChange={(op) => {\n if (!op) return;\n const keep = operatorArity(op) === operatorArity(c.operator);\n patchCondition(c.id, { operator: op, value: keep ? c.value : undefined });\n }}\n disabled={disabled || !field}\n size=\"sm\"\n className={s.operatorSelect()}\n />\n <div className={s.value()}>\n <QueryValueEditor\n condition={c}\n field={field}\n onChange={(v: QueryValue | undefined) => patchCondition(c.id, { value: v })}\n disabled={disabled}\n locale={locale}\n />\n </div>\n <IconButton\n icon={X}\n label={t('queryBuilder.removeCondition', { index })}\n size=\"sm\"\n onClick={() => remove(parent, c.id)}\n disabled={disabled}\n />\n </div>\n );\n };\n\n const renderGroup = (group: QueryGroup, depth: number, parent: QueryGroup | null) => {\n const isRoot = parent === null;\n const joiner = t(group.combinator === 'and' ? 'queryBuilder.and' : 'queryBuilder.or');\n return (\n <div\n role=\"group\"\n aria-label={isRoot ? (ariaLabel ?? t('queryBuilder.label')) : t('queryBuilder.group')}\n data-query-node={group.id}\n className={queryBuilderVariants({ depth: Math.min(depth, 2) as 0 | 1 | 2 }).group()}\n >\n <div className={s.groupHeader()}>\n <ToggleGroup\n aria-label={t('queryBuilder.combinator')}\n size=\"sm\"\n value={[group.combinator]}\n onValueChange={(v) => {\n const combinator = v[0];\n if (combinator === 'and' || combinator === 'or')\n update(group.id, (n) => (n.type === 'group' ? { ...n, combinator } : n));\n }}\n disabled={disabled}\n >\n <Toggle value=\"and\">{t('queryBuilder.and')}</Toggle>\n <Toggle value=\"or\">{t('queryBuilder.or')}</Toggle>\n </ToggleGroup>\n {!isRoot && (\n <IconButton\n icon={X}\n label={t('queryBuilder.removeGroup')}\n size=\"sm\"\n onClick={() => remove(parent, group.id)}\n disabled={disabled}\n />\n )}\n </div>\n {group.children.length > 0 ? (\n <div className={s.list()}>\n {group.children.map((child, i) => (\n <div key={child.id} className={s.item()}>\n <span aria-hidden className={s.joiner()}>\n {i === 0 ? '' : joiner}\n </span>\n {child.type === 'condition'\n ? renderCondition(child, i + 1, group)\n : renderGroup(child, depth + 1, group)}\n </div>\n ))}\n </div>\n ) : (\n isRoot && <p className={s.empty()}>{t('queryBuilder.empty')}</p>\n )}\n <div className={s.footer()}>\n <Button\n variant=\"secondary\"\n size=\"sm\"\n icon={Plus}\n onClick={() => addTo(group, createQueryCondition(fields[0]))}\n disabled={disabled}\n data-query-part=\"add-condition\"\n >\n {t('queryBuilder.addCondition')}\n </Button>\n {depth + 1 < maxDepth && (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n icon={FolderPlus}\n onClick={() => addTo(group, createQueryGroup('and', [createQueryCondition(fields[0])]))}\n disabled={disabled}\n >\n {t('queryBuilder.addGroup')}\n </Button>\n )}\n </div>\n </div>\n );\n };\n\n const preview = showPreview ? queryToString(tree, { fields, t }) : '';\n return (\n <div ref={rootRef} className={cn(s.root(), className)}>\n {renderGroup(tree, 0, null)}\n {showPreview && preview && (\n <output aria-live=\"polite\" className={s.preview()}>\n {preview}\n </output>\n )}\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'QueryBuilder',\n group: 'Forms',\n status: 'beta',\n description:\n 'Visual filter editor: nested AND/OR groups of field / operator / value conditions. Typed fields (text, number, enum, date, boolean) offer their operators and value editor (Input, NumberInput, Select / MultiSelect, DatePicker, ranges for \"between\"); add and remove conditions and groups up to `maxDepth`. The value is a serialisable tree; `queryToString(tree)` makes it human-readable and `evaluateQuery(tree, record)` tests a record.',\n primitive: 'Select, MultiSelect, Input, NumberInput, DatePicker, ToggleGroup, Button',\n pattern: 'nested groups of form controls',\n keyboard: [\n [\n 'Tab / Shift+Tab',\n \"Moves through each condition's field, operator, value and remove button, then the group's buttons\",\n ],\n [\n 'Enter / Space',\n 'On Add condition / Add group: adds it and focuses its first field; on a remove button: removes it and focuses Add condition',\n ],\n ['ArrowLeft / ArrowRight', \"In a group's AND / OR switch: moves between the options (Enter / Space picks)\"],\n ['Enter / Space / ArrowDown', 'On a field, operator or enum value: opens its list (see Select)'],\n ],\n tokens: ['card', 'secondary', 'border', 'foreground', 'muted-foreground', 'primary', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const radioGroupVariants = tv({\n slots: {\n group: 'flex flex-col',\n radio: [\n 'inline-flex size-[18px] shrink-0 cursor-pointer items-center justify-center rounded-full border border-border bg-background',\n 'transition-colors motion-reduce:transition-none hover:border-muted-foreground/50',\n 'data-checked:border-primary data-checked:bg-primary data-invalid:border-destructive/70',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n 'data-disabled:cursor-not-allowed data-disabled:opacity-50',\n ],\n indicator: 'size-1.5 rounded-full bg-primary-foreground data-unchecked:hidden',\n item: 'grid grid-cols-[auto_1fr_auto] items-start gap-x-3 gap-y-0.5',\n label:\n 'col-span-2 grid cursor-pointer grid-cols-subgrid items-start has-[[data-disabled]]:cursor-not-allowed has-[[data-disabled]]:opacity-70',\n labelText: 'min-w-0 text-[13px] leading-5 font-medium text-foreground select-none',\n trailing: 'col-start-3 row-start-1 text-end text-[13px] leading-5 font-semibold text-foreground',\n description: 'col-start-2 col-end-4 text-[12.5px] leading-5 text-muted-foreground text-pretty',\n },\n variants: {\n variant: {\n plain: { group: 'gap-2.5' },\n list: {\n group: 'gap-0 divide-y divide-border/60 overflow-hidden rounded-md border border-border bg-background/40',\n item: 'px-4 py-3.5',\n },\n card: {\n group: 'gap-3',\n item: [\n 'rounded-md border border-border bg-background px-4 py-3.5 transition-colors motion-reduce:transition-none',\n 'hover:border-muted-foreground/40 has-[[data-checked]]:border-primary/60 has-[[data-checked]]:ring-2 has-[[data-checked]]:ring-primary/20',\n 'has-[[data-disabled]]:hover:border-border',\n ],\n labelText: 'font-semibold',\n description: 'text-[12px]',\n },\n },\n },\n defaultVariants: { variant: 'plain' },\n});\n\nexport type RadioGroupVariantProps = VariantProps<typeof radioGroupVariants>;\n","import { Radio as BaseRadio } from '@base-ui/react/radio';\nimport { RadioGroup as BaseRadioGroup } from '@base-ui/react/radio-group';\nimport { createContext, useContext, useId, type ReactNode, type Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { radioGroupVariants, type RadioGroupVariantProps } from './radio-group.variants';\n\ntype Variant = NonNullable<RadioGroupVariantProps['variant']>;\nconst VariantContext = createContext<Variant>('plain');\n\nexport interface RadioGroupProps<Value = string>\n extends Omit<BaseRadioGroup.Props<Value>, 'className'>, RadioGroupVariantProps {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n}\n\n/**\n * Single-choice group (role radiogroup). Arrow keys move and select; Tab enters the group\n * once, on the selected radio. Name it with `aria-labelledby`, or render it as a Fieldset:\n * `<Fieldset render={<RadioGroup />}>`. Variants: plain, list (bordered rows) and card.\n */\nexport function RadioGroup<Value = string>({ variant = 'plain', className, ...props }: RadioGroupProps<Value>) {\n return (\n <VariantContext.Provider value={variant}>\n <BaseRadioGroup<Value> className={cn(radioGroupVariants({ variant }).group(), className)} {...props} />\n </VariantContext.Provider>\n );\n}\n\nexport interface RadioProps<Value = string> extends Omit<BaseRadio.Root.Props<Value>, 'className'> {\n className?: string;\n ref?: Ref<HTMLElement>;\n /** Visible label. Without it, pass `aria-label`. */\n label?: ReactNode;\n /** Helper line under the label, linked with aria-describedby. */\n description?: ReactNode;\n /** Right-aligned content on the label row (e.g. a price in the card variant); announced as description. */\n trailing?: ReactNode;\n}\n\n/** One option of a RadioGroup. Identified by `value`. */\nexport function Radio<Value = string>({ label, description, trailing, className, ...props }: RadioProps<Value>) {\n const variant = useContext(VariantContext);\n const s = radioGroupVariants({ variant });\n const descId = useId();\n const trailingId = useId();\n const describedBy =\n [trailing != null && trailingId, description != null && descId].filter(Boolean).join(' ') || undefined;\n const control = (\n <BaseRadio.Root<Value>\n className={cn(s.radio(), label != null && 'mt-px', label == null && className)}\n aria-describedby={describedBy}\n {...props}\n >\n <BaseRadio.Indicator className={s.indicator()} />\n </BaseRadio.Root>\n );\n if (label == null) return control;\n return (\n <div className={cn(s.item(), className)}>\n <label className={s.label()}>\n {control}\n <span className={s.labelText()}>{label}</span>\n </label>\n {trailing != null && (\n <span id={trailingId} className={s.trailing()}>\n {trailing}\n </span>\n )}\n {description != null && (\n <p id={descId} className={s.description()}>\n {description}\n </p>\n )}\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'RadioGroup',\n group: 'Forms',\n status: 'stable',\n description:\n 'Single choice from a short list. RadioGroup + Radio with optional label, description and trailing content per option, in plain, list (bordered rows) and card variants.',\n primitive: '@base-ui/react/radio-group, @base-ui/react/radio',\n pattern: 'radio group',\n keyboard: [\n ['Tab', 'Enters the group once, on the selected radio (or the first one); Tab again leaves the group'],\n ['Arrow Down / Arrow Right', 'Moves to the next radio and selects it (wraps)'],\n ['Arrow Up / Arrow Left', 'Moves to the previous radio and selects it (wraps)'],\n ['Space', 'Selects the focused radio if it is not already selected'],\n ],\n tokens: [\n 'background',\n 'border',\n 'primary',\n 'primary-foreground',\n 'foreground',\n 'muted-foreground',\n 'destructive',\n 'focus-ring',\n ],\n};\n","/** Pure layout math and persistence for ResizablePanelGroup (sizes are % of the group). */\n\nexport interface PanelConstraints {\n id: string;\n defaultSize?: number;\n minSize: number;\n maxSize: number;\n collapsible: boolean;\n collapsedSize: number;\n}\n\nconst EPSILON = 0.01;\n\nexport const clamp = (v: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, v));\n\nexport function isCollapsed(size: number, panel: PanelConstraints) {\n return panel.collapsible && size <= panel.collapsedSize + EPSILON;\n}\n\n/** Default sizes: explicit `defaultSize`s first, the remainder shared by the panels without one. */\nexport function defaultSizes(panels: PanelConstraints[]): number[] {\n const fixed = panels.reduce((sum, p) => sum + (p.defaultSize ?? 0), 0);\n const free = panels.filter((p) => p.defaultSize == null).length;\n const share = free ? Math.max(0, 100 - fixed) / free : 0;\n const raw = panels.map((p) => clamp(p.defaultSize ?? share, p.minSize, p.maxSize));\n const sum = raw.reduce((a, b) => a + b, 0);\n return sum > 0 ? raw.map((s) => (s / sum) * 100) : raw;\n}\n\n/**\n * New size for panel A of the adjacent pair (A, B) when the handle between them is dragged\n * towards `target`. B absorbs the difference; min / max of both are respected, and a collapsible\n * panel snaps shut once dragged past half of its minimum.\n */\nexport function resolvePair(target: number, a: PanelConstraints, b: PanelConstraints, total: number): number {\n if (a.collapsible && target <= (a.collapsedSize + a.minSize) / 2 && total - a.collapsedSize <= b.maxSize) {\n return a.collapsedSize;\n }\n if (b.collapsible && total - target <= (b.collapsedSize + b.minSize) / 2 && total - b.collapsedSize <= a.maxSize) {\n return total - b.collapsedSize;\n }\n const lo = Math.max(a.minSize, total - b.maxSize);\n const hi = Math.min(a.maxSize, total - b.minSize);\n return lo <= hi ? clamp(target, lo, hi) : clamp(target, hi, lo);\n}\n\n/** Returns a copy of `sizes` with panel `i` set to `nextA` and panel `i + 1` taking the rest of the pair. */\nexport function setPair(sizes: number[], i: number, nextA: number): number[] {\n const a = sizes[i];\n const b = sizes[i + 1];\n if (a == null || b == null) return sizes;\n const next = sizes.slice();\n next[i] = nextA;\n next[i + 1] = a + b - nextA;\n return next;\n}\n\n/** Moves the handle after panel `i` so that panel `i` aims for `target` (%). */\nexport function movePair(sizes: number[], panels: PanelConstraints[], i: number, target: number): number[] {\n const a = panels[i];\n const b = panels[i + 1];\n const sa = sizes[i];\n const sb = sizes[i + 1];\n if (!a || !b || sa == null || sb == null) return sizes;\n return setPair(sizes, i, resolvePair(target, a, b, sa + sb));\n}\n\nconst storageKey = (id: string) => `gntik-ui:resizable:${id}`;\n\n/** Reads persisted sizes; returns null when missing, malformed or not matching the panel count. */\nexport function loadSizes(autoSaveId: string | undefined, count: number): number[] | null {\n if (!autoSaveId) return null;\n try {\n const raw = localStorage.getItem(storageKey(autoSaveId));\n if (!raw) return null;\n const parsed: unknown = JSON.parse(raw);\n if (!Array.isArray(parsed) || parsed.length !== count) return null;\n if (!parsed.every((n): n is number => typeof n === 'number' && Number.isFinite(n) && n >= 0)) return null;\n const sum = parsed.reduce((a, b) => a + b, 0);\n return Math.abs(sum - 100) < 1 ? parsed : null;\n } catch {\n return null;\n }\n}\n\nexport function saveSizes(autoSaveId: string | undefined, sizes: number[]) {\n if (!autoSaveId) return;\n try {\n localStorage.setItem(storageKey(autoSaveId), JSON.stringify(sizes.map((s) => Math.round(s * 100) / 100)));\n } catch {}\n}\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const resizableVariants = tv({\n slots: {\n group: 'flex size-full min-h-0 min-w-0 overflow-hidden',\n panel: 'min-h-0 min-w-0',\n handle: [\n 'relative z-10 flex shrink-0 touch-none items-center justify-center bg-border select-none',\n 'transition-colors duration-150 motion-reduce:transition-none',\n 'hover:bg-primary/60 data-dragging:bg-primary focus-visible:bg-primary',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n \"after:absolute after:content-['']\",\n 'data-disabled:pointer-events-none data-disabled:bg-border',\n ],\n grip: 'flex items-center justify-center rounded-sm border border-border bg-card text-muted-foreground shadow-sm',\n },\n variants: {\n direction: {\n horizontal: {\n group: 'flex-row',\n handle: 'w-px cursor-col-resize after:inset-y-0 after:-inset-x-1.5',\n grip: 'h-6 w-3.5',\n },\n vertical: {\n group: 'flex-col',\n handle: 'h-px cursor-row-resize after:inset-x-0 after:-inset-y-1.5',\n grip: 'h-3.5 w-6',\n },\n },\n },\n defaultVariants: { direction: 'horizontal' },\n});\n\nexport type ResizableVariantProps = VariantProps<typeof resizableVariants>;\n","import { GripHorizontal, GripVertical } from 'lucide-react';\nimport {\n Children,\n createContext,\n isValidElement,\n useContext,\n useId,\n useRef,\n useState,\n type HTMLAttributes,\n type KeyboardEvent,\n type PointerEvent,\n type ReactElement,\n type Ref,\n} from 'react';\nimport { cn } from '../../utils/cn';\nimport {\n defaultSizes,\n isCollapsed,\n loadSizes,\n movePair,\n saveSizes,\n setPair,\n clamp,\n type PanelConstraints,\n} from './resizable-layout';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { resizableVariants } from './resizable.variants';\n\ntype Direction = 'horizontal' | 'vertical';\n\ninterface GroupContextValue {\n direction: Direction;\n panels: PanelConstraints[];\n sizes: number[];\n restore: Record<string, number>;\n /** Applies new sizes; `persist` also writes them to localStorage (autoSaveId). */\n update: (sizes: number[], options?: { persist?: boolean; restore?: Record<string, number> }) => void;\n}\n\nconst GroupContext = createContext<GroupContextValue | null>(null);\n/** Index of the panel (for a panel) or of the panel before it (for a handle). */\nconst SlotContext = createContext<number>(-1);\n\nfunction useGroup(part: string) {\n const ctx = useContext(GroupContext);\n if (!ctx) throw new Error(`${part} must be a direct child of <ResizablePanelGroup>.`);\n return ctx;\n}\n\ntype DivProps = Omit<HTMLAttributes<HTMLDivElement>, 'className'> & { className?: string; ref?: Ref<HTMLDivElement> };\n\nexport interface ResizablePanelGroupProps extends DivProps {\n /** `horizontal` lays panels out side by side (vertical handles); `vertical` stacks them. */\n direction?: Direction;\n /** Remembers the layout in localStorage under this key (ignored when storage is unavailable). */\n autoSaveId?: string;\n /** Called with the new sizes (%) after every resize, collapse or restore. */\n onLayout?: (sizes: number[]) => void;\n}\n\ninterface GroupState {\n signature: string;\n sizes: number[];\n restore: Record<string, number>;\n}\n\n/**\n * Container of resizable panels. Children must be ResizablePanel and ResizeHandle elements\n * (direct children, alternating). Sizes are percentages of the group.\n */\nexport function ResizablePanelGroup({\n direction = 'horizontal',\n autoSaveId,\n onLayout,\n className,\n children,\n ...props\n}: ResizablePanelGroupProps) {\n const baseId = useId();\n const items = Children.toArray(children);\n const panels: PanelConstraints[] = [];\n const slots: number[] = [];\n for (const child of items) {\n if (isValidElement(child) && child.type === ResizablePanel) {\n const p = (child as ReactElement<ResizablePanelProps>).props;\n const minSize = p.minSize ?? 0;\n panels.push({\n id: p.id ?? `${baseId}-panel-${panels.length}`,\n defaultSize: p.defaultSize,\n minSize,\n maxSize: p.maxSize ?? 100,\n collapsible: p.collapsible ?? false,\n collapsedSize: Math.min(p.collapsedSize ?? 0, minSize),\n });\n }\n slots.push(panels.length - 1);\n }\n const signature = panels.map((p) => `${p.id}:${p.minSize}:${p.maxSize}`).join('|');\n const initial = (): GroupState => ({\n signature,\n sizes: loadSizes(autoSaveId, panels.length) ?? defaultSizes(panels),\n restore: {},\n });\n const [state, setState] = useState<GroupState>(initial);\n // Panels added / removed / re-constrained: fall back to the (persisted or) default layout.\n const current = state.signature === signature ? state : initial();\n\n const update: GroupContextValue['update'] = (sizes, options) => {\n setState({ signature, sizes, restore: options?.restore ?? current.restore });\n onLayout?.(sizes);\n if (options?.persist) saveSizes(autoSaveId, sizes);\n };\n\n const ctx: GroupContextValue = { direction, panels, sizes: current.sizes, restore: current.restore, update };\n const s = resizableVariants({ direction });\n return (\n <GroupContext.Provider value={ctx}>\n <div data-resizable-group=\"\" data-direction={direction} className={cn(s.group(), className)} {...props}>\n {items.map((child, i) => {\n const key = isValidElement(child) && child.key != null ? child.key : i;\n return (\n <SlotContext.Provider key={key} value={slots[i] ?? -1}>\n {child}\n </SlotContext.Provider>\n );\n })}\n </div>\n </GroupContext.Provider>\n );\n}\n\nexport interface ResizablePanelProps extends DivProps {\n /** Stable id (also referenced by the handle's aria-controls). */\n id?: string;\n /** Initial size in % (panels without one share the remainder). */\n defaultSize?: number;\n /** Minimum size in %. */\n minSize?: number;\n /** Maximum size in %. */\n maxSize?: number;\n /** Can shrink to `collapsedSize` (drag past half its minimum, or Enter on the handle). */\n collapsible?: boolean;\n /** Size in % when collapsed. Default 0 (the content becomes inert). */\n collapsedSize?: number;\n}\n\nconst PANEL_CONFIG_KEYS = ['id', 'defaultSize', 'minSize', 'maxSize', 'collapsible', 'collapsedSize'] as const;\n\n/** Strips the layout config (read by the group) from the props spread onto the panel element. */\nfunction domProps(props: Omit<ResizablePanelProps, 'className' | 'style'>): DivProps {\n const out: Partial<ResizablePanelProps> = { ...props };\n for (const key of PANEL_CONFIG_KEYS) delete out[key];\n return out;\n}\n\n/** One pane of a ResizablePanelGroup. */\nexport function ResizablePanel({ className, style, ...config }: ResizablePanelProps) {\n const props = domProps(config);\n const ctx = useGroup('ResizablePanel');\n const index = useContext(SlotContext);\n const panel = ctx.panels[index];\n const size = ctx.sizes[index] ?? 0;\n const collapsed = panel ? isCollapsed(size, panel) : false;\n return (\n <div\n id={panel?.id}\n data-resizable-panel=\"\"\n data-collapsed={collapsed ? '' : undefined}\n data-size={Math.round(size)}\n inert={collapsed && size <= 0.01 ? true : undefined}\n className={cn(resizableVariants().panel(), className)}\n style={{ flexGrow: size, flexShrink: 1, flexBasis: 0, overflow: 'hidden', ...style }}\n {...props}\n />\n );\n}\n\nexport interface ResizeHandleProps extends DivProps {\n /** Shows a small grip on the line. */\n withHandle?: boolean;\n /** Arrow-key step in %. Default 5. */\n step?: number;\n /** Not draggable nor focusable. */\n disabled?: boolean;\n}\n\nconst isRtl = (el: Element) => getComputedStyle(el).direction === 'rtl';\n\ninterface DragState {\n start: number;\n /** -1 when a horizontal group runs right to left (the first panel is on the right). */\n sign: number;\n px: number;\n sizes: number[];\n last: number[];\n}\n\n/**\n * The draggable divider between two panels: role=\"separator\" with aria-valuenow (size of the panel\n * before it). Pointer drag; arrows resize by `step`; Home / End jump to min / max; Enter collapses\n * or restores the adjacent collapsible panel.\n */\nexport function ResizeHandle({\n withHandle,\n step = 5,\n disabled,\n className,\n onKeyDown,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n onPointerCancel,\n 'aria-label': ariaLabelProp,\n ...props\n}: ResizeHandleProps) {\n const { t } = useI18n();\n const ariaLabel = ariaLabelProp ?? t('common.resize');\n const ctx = useGroup('ResizeHandle');\n const i = useContext(SlotContext);\n const dragRef = useRef<DragState | null>(null);\n const [dragging, setDragging] = useState(false);\n const { direction, panels, sizes, restore, update } = ctx;\n const a = panels[i];\n const b = panels[i + 1];\n const sizeA = sizes[i] ?? 0;\n const horizontal = direction === 'horizontal';\n const s = resizableVariants({ direction });\n\n function toggleCollapse() {\n if (!a || !b) return;\n const sizeB = sizes[i + 1] ?? 0;\n const total = sizeA + sizeB;\n const target = a.collapsible ? a : b.collapsible ? b : null;\n if (!target) return;\n const current = target === a ? sizeA : sizeB;\n let nextTarget: number;\n let nextRestore = restore;\n if (isCollapsed(current, target)) {\n const remembered = restore[target.id] ?? target.defaultSize ?? target.minSize;\n const other = target === a ? b : a;\n nextTarget = clamp(remembered, target.minSize, Math.min(target.maxSize, total - other.minSize));\n } else {\n nextTarget = target.collapsedSize;\n nextRestore = { ...restore, [target.id]: current };\n }\n const nextA = target === a ? nextTarget : total - nextTarget;\n update(setPair(sizes, i, nextA), { persist: true, restore: nextRestore });\n }\n\n function handleKeyDown(event: KeyboardEvent<HTMLDivElement>) {\n onKeyDown?.(event);\n if (event.defaultPrevented || disabled || !a || !b) return;\n const rtl = horizontal && isRtl(event.currentTarget);\n const dec = horizontal ? (rtl ? 'ArrowRight' : 'ArrowLeft') : 'ArrowUp';\n const inc = horizontal ? (rtl ? 'ArrowLeft' : 'ArrowRight') : 'ArrowDown';\n let next: number[] | null = null;\n if (event.key === dec) next = movePair(sizes, panels, i, sizeA - step);\n else if (event.key === inc) next = movePair(sizes, panels, i, sizeA + step);\n else if (event.key === 'Home') next = movePair(sizes, panels, i, a.minSize);\n else if (event.key === 'End') next = movePair(sizes, panels, i, a.maxSize);\n else if (event.key === 'Enter') {\n event.preventDefault();\n toggleCollapse();\n return;\n }\n if (!next) return;\n event.preventDefault();\n update(next, { persist: true });\n }\n\n function handlePointerDown(event: PointerEvent<HTMLDivElement>) {\n onPointerDown?.(event);\n if (event.defaultPrevented || disabled || event.button !== 0) return;\n const handle = event.currentTarget;\n const group = handle.parentElement;\n if (!group) return;\n event.preventDefault();\n handle.focus();\n try {\n handle.setPointerCapture(event.pointerId);\n } catch {}\n let px = 0;\n group.querySelectorAll<HTMLElement>(':scope > [data-resizable-panel]').forEach((el) => {\n const rect = el.getBoundingClientRect();\n px += horizontal ? rect.width : rect.height;\n });\n const sign = horizontal && isRtl(handle) ? -1 : 1;\n dragRef.current = { start: horizontal ? event.clientX : event.clientY, sign, px, sizes, last: sizes };\n setDragging(true);\n }\n\n function handlePointerMove(event: PointerEvent<HTMLDivElement>) {\n onPointerMove?.(event);\n const drag = dragRef.current;\n if (!drag || drag.px <= 0) return;\n const delta = (((horizontal ? event.clientX : event.clientY) - drag.start) / drag.px) * 100 * drag.sign;\n const next = movePair(drag.sizes, panels, i, (drag.sizes[i] ?? 0) + delta);\n drag.last = next;\n update(next);\n }\n\n function endDrag(event: PointerEvent<HTMLDivElement>) {\n const drag = dragRef.current;\n if (!drag) return;\n dragRef.current = null;\n setDragging(false);\n try {\n event.currentTarget.releasePointerCapture(event.pointerId);\n } catch {}\n if (drag.last !== drag.sizes) update(drag.last, { persist: true });\n }\n\n const min = a ? (a.collapsible ? a.collapsedSize : a.minSize) : 0;\n const max =\n a && b ? Math.min(a.maxSize, sizeA + (sizes[i + 1] ?? 0) - (b.collapsible ? b.collapsedSize : b.minSize)) : 100;\n const Grip = horizontal ? GripVertical : GripHorizontal;\n return (\n <div\n role=\"separator\"\n tabIndex={disabled ? undefined : 0}\n aria-label={ariaLabel}\n aria-orientation={horizontal ? 'vertical' : 'horizontal'}\n aria-controls={a?.id}\n aria-valuenow={Math.round(sizeA)}\n aria-valuemin={Math.round(min)}\n aria-valuemax={Math.round(max)}\n aria-disabled={disabled || undefined}\n data-resize-handle=\"\"\n data-dragging={dragging ? '' : undefined}\n data-disabled={disabled ? '' : undefined}\n className={cn(s.handle(), className)}\n onKeyDown={handleKeyDown}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={(e) => {\n onPointerUp?.(e);\n endDrag(e);\n }}\n onPointerCancel={(e) => {\n onPointerCancel?.(e);\n endDrag(e);\n }}\n {...props}\n >\n {withHandle && (\n <span className={s.grip()} aria-hidden>\n <Grip size={10} />\n </span>\n )}\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Resizable',\n group: 'Layout',\n status: 'stable',\n description:\n 'Split layouts with draggable dividers: ResizablePanelGroup (horizontal or vertical), ResizablePanel (default / min / max size in %, collapsible) and ResizeHandle (optional grip). Pointer drag and full keyboard support; the layout can be remembered in localStorage with `autoSaveId`. No extra dependencies.',\n pattern: 'window splitter',\n keyboard: [\n ['ArrowLeft / ArrowRight', 'Horizontal group: shrinks / grows the panel before the handle by `step` (default 5%)'],\n ['ArrowUp / ArrowDown', 'Vertical group: shrinks / grows the panel above the handle by `step`'],\n ['Home / End', 'Sets the panel before the handle to its minimum / maximum size'],\n ['Enter', 'Collapses the adjacent collapsible panel, or restores it to its previous size'],\n ],\n tokens: ['border', 'primary', 'card', 'muted-foreground', 'shadow-sm', 'focus-ring'],\n};\n","/**\n * 5-field cron (minute hour day-of-month month day-of-week): parse, describe, next runs.\n * Supports `*`, numbers, names (JAN–DEC, SUN–SAT), lists, ranges, steps (`*\\/15`, `1-5/2`,\n * `10/5`), `7` as Sunday and the macros @yearly @annually @monthly @weekly @daily @midnight\n * @hourly. Day matching follows Vixie cron: when both day fields are restricted, either matches.\n */\nimport { interpolate, type MessageVars } from '../../i18n/format';\nimport { catalogs } from '../../i18n/messages';\nimport { en, type MessageKey, type Messages } from '../../i18n/messages/en';\n\nexport type CronFieldName = 'minute' | 'hour' | 'dayOfMonth' | 'month' | 'dayOfWeek';\n\nexport interface CronField {\n /** Matching values, sorted (day of week: 0 = Sunday … 6). */\n values: number[];\n /** The field starts with `*` (unrestricted for Vixie day matching). */\n wildcard: boolean;\n /** `n` when the field is exactly `*\\/n`. */\n step?: number;\n /** The field as written. */\n source: string;\n}\n\nexport interface ParsedCron {\n /** The five fields joined by single spaces (macros expanded). */\n expression: string;\n minute: CronField;\n hour: CronField;\n dayOfMonth: CronField;\n month: CronField;\n dayOfWeek: CronField;\n}\n\nexport type CronErrorCode = 'empty' | 'fieldCount' | 'invalid' | 'range' | 'step' | 'macro';\n\nexport interface CronError {\n code: CronErrorCode;\n field?: CronFieldName;\n /** The offending token. */\n value?: string;\n /** Fields found (`fieldCount`). */\n count?: number;\n min?: number;\n max?: number;\n /** English message (translate with `cronErrorMessage`). */\n message: string;\n}\n\nexport type CronParseResult =\n { valid: true; cron: ParsedCron; error?: undefined } | { valid: false; error: CronError; cron?: undefined };\n\n/** A message translator, e.g. `useI18n().t`. */\nexport type CronTranslate = (key: MessageKey, vars?: MessageVars) => string;\n\nconst FIELDS: CronFieldName[] = ['minute', 'hour', 'dayOfMonth', 'month', 'dayOfWeek'];\nconst SPECS: Record<CronFieldName, { min: number; max: number; names?: string[] }> = {\n minute: { min: 0, max: 59 },\n hour: { min: 0, max: 23 },\n dayOfMonth: { min: 1, max: 31 },\n month: {\n min: 1,\n max: 12,\n names: ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'],\n },\n dayOfWeek: { min: 0, max: 7, names: ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'] },\n};\nconst MACROS: Record<string, string> = {\n '@yearly': '0 0 1 1 *',\n '@annually': '0 0 1 1 *',\n '@monthly': '0 0 1 * *',\n '@weekly': '0 0 * * 0',\n '@daily': '0 0 * * *',\n '@midnight': '0 0 * * *',\n '@hourly': '0 * * * *',\n};\n\nconst enT: CronTranslate = (key, vars) => interpolate(en[key], vars, 'en');\n\nfunction translatorFor(locale?: string): CronTranslate {\n const lang = (locale ?? 'en').split(/[-_]/)[0]?.toLowerCase() ?? 'en';\n const messages: Messages = (catalogs as Record<string, Messages | undefined>)[lang] ?? en;\n return (key, vars) => interpolate(messages[key] ?? en[key], vars, locale ?? 'en');\n}\n\n/** The message for a parse error, in the translator's language. */\nexport function cronErrorMessage(error: Omit<CronError, 'message'>, t: CronTranslate = enT): string {\n const field = error.field ? t(`cron.field.${error.field}`) : '';\n const vars = { field, value: error.value ?? '', count: error.count ?? 0, min: error.min ?? 0, max: error.max ?? 0 };\n return t(`cron.error.${error.code}`, vars);\n}\n\nclass CronParseError extends Error {\n constructor(readonly detail: Omit<CronError, 'message'>) {\n super(cronErrorMessage(detail));\n }\n}\n\nfunction parseValue(token: string, field: CronFieldName): number {\n const spec = SPECS[field];\n const named = spec.names?.indexOf(token.toUpperCase()) ?? -1;\n if (named >= 0) return named + (field === 'month' ? 1 : 0);\n if (!/^\\d+$/.test(token)) throw new CronParseError({ code: 'invalid', field, value: token });\n const n = Number(token);\n if (n < spec.min || n > spec.max)\n throw new CronParseError({\n code: 'range',\n field,\n value: token,\n min: spec.min,\n max: field === 'dayOfWeek' ? 7 : spec.max,\n });\n return n;\n}\n\nfunction parseField(source: string, field: CronFieldName): CronField {\n const spec = SPECS[field];\n const top = field === 'dayOfWeek' ? 6 : spec.max;\n const values = new Set<number>();\n for (const part of source.split(',')) {\n if (!part) throw new CronParseError({ code: 'invalid', field, value: source });\n const pieces = part.split('/');\n if (pieces.length > 2) throw new CronParseError({ code: 'step', field, value: part });\n const [rangePart = '', stepPart] = pieces;\n let step = 1;\n if (stepPart !== undefined) {\n if (!/^\\d+$/.test(stepPart) || Number(stepPart) === 0)\n throw new CronParseError({ code: 'step', field, value: part });\n step = Number(stepPart);\n }\n let lo: number;\n let hi: number;\n if (rangePart === '*') {\n lo = spec.min;\n hi = top;\n } else if (rangePart.includes('-')) {\n const [a = '', b = '', ...rest] = rangePart.split('-');\n if (rest.length) throw new CronParseError({ code: 'invalid', field, value: part });\n lo = parseValue(a, field);\n hi = parseValue(b, field);\n if (hi < lo) throw new CronParseError({ code: 'invalid', field, value: part });\n } else {\n lo = parseValue(rangePart, field);\n hi = stepPart !== undefined ? top : lo;\n }\n for (let v = lo; v <= hi; v += step) values.add(field === 'dayOfWeek' && v === 7 ? 0 : v);\n }\n const stepMatch = /^\\*\\/(\\d+)$/.exec(source);\n return {\n values: [...values].sort((a, b) => a - b),\n wildcard: source.startsWith('*'),\n step: stepMatch ? Number(stepMatch[1]) : undefined,\n source,\n };\n}\n\n/** Parses a 5-field cron expression (or a macro). Never throws. */\nexport function parseCron(expression: string): CronParseResult {\n const trimmed = expression.trim();\n const fail = (detail: Omit<CronError, 'message'>): CronParseResult => ({\n valid: false,\n error: { ...detail, message: cronErrorMessage(detail) },\n });\n if (!trimmed) return fail({ code: 'empty' });\n let text = trimmed;\n if (trimmed.startsWith('@')) {\n const macro = MACROS[trimmed.toLowerCase()];\n if (!macro) return fail({ code: 'macro', value: trimmed });\n text = macro;\n }\n const tokens = text.split(/\\s+/);\n if (tokens.length !== 5) return fail({ code: 'fieldCount', count: tokens.length });\n try {\n const parsed = Object.fromEntries(FIELDS.map((f, i) => [f, parseField(tokens[i] ?? '', f)])) as Record<\n CronFieldName,\n CronField\n >;\n return { valid: true, cron: { expression: tokens.join(' '), ...parsed } };\n } catch (e) {\n if (e instanceof CronParseError) return fail(e.detail);\n throw e;\n }\n}\n\n// ---------------------------------------------------------------- next runs\n\ninterface Wall {\n y: number;\n mo: number;\n d: number;\n h: number;\n mi: number;\n}\n\ninterface Zone {\n toWall: (ms: number) => Wall;\n /** The instant of a wall-clock minute, or null when it does not exist (DST gap). */\n toInstant: (w: Wall) => number | null;\n}\n\nconst localZone: Zone = {\n toWall: (ms) => {\n const d = new Date(ms);\n return { y: d.getFullYear(), mo: d.getMonth(), d: d.getDate(), h: d.getHours(), mi: d.getMinutes() };\n },\n toInstant: (w) => {\n const d = new Date(w.y, w.mo, w.d, w.h, w.mi);\n return d.getHours() === w.h && d.getMinutes() === w.mi ? d.getTime() : null;\n },\n};\n\nfunction tzZone(timeZone: string): Zone {\n const fmt = new Intl.DateTimeFormat('en-US', {\n timeZone,\n hourCycle: 'h23',\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n });\n const parts = (ms: number) => {\n const p: Record<string, number> = {};\n for (const part of fmt.formatToParts(new Date(ms))) if (part.type !== 'literal') p[part.type] = Number(part.value);\n return {\n y: p.year ?? 0,\n mo: (p.month ?? 1) - 1,\n d: p.day ?? 1,\n h: (p.hour ?? 0) % 24,\n mi: p.minute ?? 0,\n s: p.second ?? 0,\n };\n };\n const offset = (ms: number) => {\n const p = parts(ms);\n return Date.UTC(p.y, p.mo, p.d, p.h, p.mi, p.s) - (ms - (((ms % 1000) + 1000) % 1000));\n };\n const same = (ms: number, w: Wall) => {\n const p = parts(ms);\n return p.y === w.y && p.mo === w.mo && p.d === w.d && p.h === w.h && p.mi === w.mi;\n };\n return {\n toWall: (ms) => parts(ms),\n toInstant: (w) => {\n const guess = Date.UTC(w.y, w.mo, w.d, w.h, w.mi);\n const first = guess - offset(guess);\n if (same(first, w)) return first;\n const second = guess - offset(first);\n return same(second, w) ? second : null;\n },\n };\n}\n\nfunction dayMatches(c: ParsedCron, dom: Set<number>, dow: Set<number>, day: number, weekday: number) {\n const domOk = dom.has(day);\n const dowOk = dow.has(weekday);\n return !c.dayOfMonth.wildcard && !c.dayOfWeek.wildcard ? domOk || dowOk : domOk && dowOk;\n}\n\n/**\n * The next `count` run times strictly after `from`, evaluated on the wall clock of `timeZone`\n * (IANA name, e.g. \"Europe/Madrid\"; default: the runtime's local zone). Wall times skipped by\n * a DST change are skipped. Returns `[]` for an invalid expression; throws RangeError for an\n * unknown time zone. Searches up to 8 years ahead (so \"30 2 31 2 *\" yields nothing).\n */\nexport function nextRuns(cron: string | ParsedCron, from: Date, count: number, timeZone?: string): Date[] {\n const parsed = typeof cron === 'string' ? parseCron(cron) : ({ valid: true, cron } as const);\n if (!parsed.valid || count <= 0) return [];\n const c = parsed.cron;\n const zone = timeZone ? tzZone(timeZone) : localZone;\n const minutes = c.minute.values;\n const hours = new Set(c.hour.values);\n const months = new Set(c.month.values);\n const dom = new Set(c.dayOfMonth.values);\n const dow = new Set(c.dayOfWeek.values);\n const fromMs = from.getTime();\n const start = zone.toWall(fromMs);\n // Wall-clock times are walked as UTC milliseconds (no DST inside the walk).\n let t = Date.UTC(start.y, start.mo, start.d, start.h, start.mi) + 60_000;\n const limit = Date.UTC(start.y + 8, start.mo, start.d);\n const out: Date[] = [];\n let last = fromMs;\n while (out.length < count && t < limit) {\n const w = new Date(t);\n const y = w.getUTCFullYear();\n const mo = w.getUTCMonth();\n const d = w.getUTCDate();\n const h = w.getUTCHours();\n const mi = w.getUTCMinutes();\n if (!months.has(mo + 1)) {\n t = Date.UTC(y, mo + 1, 1);\n continue;\n }\n if (!dayMatches(c, dom, dow, d, w.getUTCDay())) {\n t = Date.UTC(y, mo, d + 1);\n continue;\n }\n if (!hours.has(h)) {\n t = Date.UTC(y, mo, d, h + 1);\n continue;\n }\n const nextMinute = minutes.find((m) => m >= mi);\n if (nextMinute === undefined) {\n t = Date.UTC(y, mo, d, h + 1);\n continue;\n }\n if (nextMinute !== mi) {\n t = Date.UTC(y, mo, d, h, nextMinute);\n continue;\n }\n const instant = zone.toInstant({ y, mo, d, h, mi });\n if (instant !== null && instant > last) {\n out.push(new Date(instant));\n last = instant;\n }\n t += 60_000;\n }\n return out;\n}\n\n// ---------------------------------------------------------------- description\n\nexport interface DescribeCronOptions {\n /** Locale for weekday/month names and lists; also picks the built-in catalog. Default \"en\". */\n locale?: string;\n /** Translator (e.g. `useI18n().t`); defaults to the built-in catalog of `locale`. */\n t?: CronTranslate;\n}\n\nconst pad = (n: number) => String(n).padStart(2, '0');\nconst isContiguous = (v: number[]) => v.length > 1 && v.every((n, i) => i === 0 || n === (v[i - 1] ?? 0) + 1);\n\n/**\n * Plain-language summary: \"Every weekday at 09:00\", \"Every 15 minutes, between 09:00 and\n * 17:59, on weekdays\", \"Monthly on day 1 at 00:00\". Returns \"\" for an invalid expression.\n */\nexport function describeCron(cron: string | ParsedCron, options: DescribeCronOptions = {}): string {\n const parsed = typeof cron === 'string' ? parseCron(cron) : ({ valid: true, cron } as const);\n if (!parsed.valid) return '';\n const c = parsed.cron;\n const locale = options.locale ?? 'en';\n const t = options.t ?? translatorFor(locale);\n const list = (items: string[]) => new Intl.ListFormat(locale, { style: 'long', type: 'conjunction' }).format(items);\n const weekdayName = (d: number) =>\n new Intl.DateTimeFormat(locale, { weekday: 'long', timeZone: 'UTC' }).format(new Date(Date.UTC(2023, 0, 1 + d)));\n const monthName = (m: number) =>\n new Intl.DateTimeFormat(locale, { month: 'long', timeZone: 'UTC' }).format(new Date(Date.UTC(2023, m - 1, 1)));\n\n const M = c.minute.values;\n const H = c.hour.values;\n const allMinutes = M.length === 60;\n const allHours = H.length === 24;\n const hourQualifier = () =>\n isContiguous(H)\n ? t('cron.betweenHours', { start: `${pad(H[0] ?? 0)}:00`, end: `${pad(H[H.length - 1] ?? 0)}:59` })\n : t('cron.duringHours', { count: H.length, hours: list(H.map(String)) });\n\n const qualifiers: string[] = [];\n let base: string;\n let times: string | null = null;\n if (allMinutes) {\n base = t('cron.everyMinute');\n if (!allHours) qualifiers.push(hourQualifier());\n } else if (c.minute.step && c.minute.step > 1) {\n base = t('cron.everyNMinutes', { count: c.minute.step });\n if (!allHours) qualifiers.push(hourQualifier());\n } else if (allHours) {\n base =\n M.length === 1 && M[0] === 0\n ? t('cron.everyHour')\n : t('cron.everyHourAt', { count: M.length, minutes: list(M.map(String)) });\n } else if (c.hour.step && c.hour.step > 1 && M.length === 1) {\n const minute = M[0] ?? 0;\n base =\n minute === 0\n ? t('cron.everyNHours', { count: c.hour.step })\n : t('cron.everyNHoursAt', { count: c.hour.step, minute });\n } else if (M.length * H.length <= 6) {\n times = list(H.flatMap((h) => M.map((m) => `${pad(h)}:${pad(m)}`)));\n base = t('cron.at', { times });\n } else {\n base = t('cron.minutesPast', { count: M.length, minutes: list(M.map(String)) });\n qualifiers.push(hourQualifier());\n }\n\n const domRestricted = c.dayOfMonth.values.length < 31;\n const dowRestricted = c.dayOfWeek.values.length < 7;\n const dowOrdered = [...c.dayOfWeek.values].sort((a, b) => (a || 7) - (b || 7));\n const weekdaysOnly = dowOrdered.join(',') === '1,2,3,4,5';\n const days = list(dowOrdered.map(weekdayName));\n const domList = list(c.dayOfMonth.values.map(String));\n const domQualifier = t('cron.onDaysOfMonth', { count: c.dayOfMonth.values.length, days: domList });\n const dowQualifier = weekdaysOnly ? t('cron.onWeekdays') : t('cron.onDays', { days });\n const bothDays = domRestricted && dowRestricted;\n const eitherDay = bothDays && !c.dayOfMonth.wildcard && !c.dayOfWeek.wildcard;\n\n if (times !== null && !bothDays) {\n if (dowRestricted) base = weekdaysOnly ? t('cron.weekdaysAt', { times }) : t('cron.weeklyAt', { days, times });\n else if (domRestricted) base = t('cron.monthlyAt', { count: c.dayOfMonth.values.length, days: domList, times });\n else base = t('cron.dailyAt', { times });\n } else if (bothDays) {\n qualifiers.push(\n eitherDay ? t('cron.or', { a: domQualifier, b: dowQualifier }) : `${domQualifier}, ${dowQualifier}`,\n );\n } else if (domRestricted) qualifiers.push(domQualifier);\n else if (dowRestricted) qualifiers.push(dowQualifier);\n\n if (c.month.values.length < 12) qualifiers.push(t('cron.inMonths', { months: list(c.month.values.map(monthName)) }));\n return qualifiers.reduce((acc, part) => t('cron.join', { base: acc, part }), base);\n}\n","import { parseCron } from './cron';\n\nexport type ScheduleFrequency = 'hourly' | 'daily' | 'weekly' | 'monthly' | 'custom';\n\n/** The preset editors' state, read from (and written back to) a cron expression. */\nexport interface ScheduleParts {\n frequency: ScheduleFrequency;\n minute: number;\n hour: number;\n /** Days of the week, 0 = Sunday. */\n weekdays: number[];\n dayOfMonth: number;\n}\n\nexport const DEFAULT_SCHEDULE_PARTS: ScheduleParts = {\n frequency: 'custom',\n minute: 0,\n hour: 9,\n weekdays: [1, 2, 3, 4, 5],\n dayOfMonth: 1,\n};\n\nconst NUM = /^\\d+$/;\n\n/** Which preset an expression fits (`custom` when none), with the preset fields filled in. */\nexport function scheduleFromCron(expression: string): ScheduleParts {\n const parsed = parseCron(expression);\n if (!parsed.valid || expression.trim().startsWith('@')) return DEFAULT_SCHEDULE_PARTS;\n const [m = '', h = '', dom = '', mon = '', dow = ''] = parsed.cron.expression.split(' ');\n const base = { ...DEFAULT_SCHEDULE_PARTS, minute: NUM.test(m) ? Number(m) : 0 };\n if (!NUM.test(m) || mon !== '*') return DEFAULT_SCHEDULE_PARTS;\n if (h === '*' && dom === '*' && dow === '*') return { ...base, frequency: 'hourly' };\n if (!NUM.test(h)) return DEFAULT_SCHEDULE_PARTS;\n const timed = { ...base, hour: Number(h) };\n if (dom === '*' && dow === '*') return { ...timed, frequency: 'daily' };\n if (dom === '*') return { ...timed, frequency: 'weekly', weekdays: parsed.cron.dayOfWeek.values };\n if (dow === '*' && NUM.test(dom)) return { ...timed, frequency: 'monthly', dayOfMonth: Number(dom) };\n return DEFAULT_SCHEDULE_PARTS;\n}\n\n/** `[1,2,3,4,5]` → `\"1-5\"`, `[1,3,5]` → `\"1,3,5\"` (runs of three or more become ranges). */\nexport function compressCronList(values: number[]): string {\n const sorted = [...new Set(values)].sort((a, b) => a - b);\n const parts: string[] = [];\n for (let i = 0; i < sorted.length;) {\n let j = i;\n while (j + 1 < sorted.length && sorted[j + 1] === (sorted[j] ?? 0) + 1) j++;\n if (j - i >= 2) parts.push(`${sorted[i]}-${sorted[j]}`);\n else for (let k = i; k <= j; k++) parts.push(String(sorted[k]));\n i = j + 1;\n }\n return parts.join(',');\n}\n\n/** The cron expression for a preset (`custom` returns `fallback`). */\nexport function cronFromSchedule(parts: ScheduleParts, fallback = ''): string {\n const { minute: m, hour: h } = parts;\n switch (parts.frequency) {\n case 'hourly':\n return `${m} * * * *`;\n case 'daily':\n return `${m} ${h} * * *`;\n case 'weekly':\n return `${m} ${h} * * ${compressCronList(parts.weekdays.length ? parts.weekdays : [1])}`;\n case 'monthly':\n return `${m} ${h} ${parts.dayOfMonth} * *`;\n default:\n return fallback;\n }\n}\n","import { tv, type VariantProps } from '../../utils/tv';\n\n/** Preset row, raw cron field, plain-language summary and the upcoming runs list. */\nexport const scheduleInputVariants = tv({\n slots: {\n root: 'flex w-full min-w-0 flex-col gap-4',\n editors: 'flex flex-wrap items-end gap-x-4 gap-y-3',\n editor: 'flex min-w-0 flex-col gap-1.5',\n editorLabel: 'text-[12px] font-medium text-muted-foreground',\n expression: 'font-mono',\n hint: 'font-mono text-[11px] text-muted-foreground',\n error: 'text-[12px] font-medium text-destructive-text',\n summary: 'flex items-start gap-2 text-[13px] font-medium text-foreground',\n summaryIcon: 'mt-0.5 shrink-0 text-muted-foreground',\n runs: 'flex flex-col gap-1.5 rounded-md border border-border bg-card p-3',\n runsHeading: 'text-[11.5px] font-medium text-muted-foreground',\n runsList: 'grid gap-1 font-mono text-[12px] text-foreground tabular-nums',\n empty: 'text-[12px] text-muted-foreground',\n },\n variants: {\n disabled: { true: { root: 'opacity-60' } },\n },\n});\n\nexport type ScheduleInputVariantProps = VariantProps<typeof scheduleInputVariants>;\n","import { CalendarClock } from 'lucide-react';\nimport { useId, useState } from 'react';\nimport { useI18n, useOptionalI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { localeWeekStart } from '../Calendar/calendar-utils';\nimport { Field, FieldLabel } from '../Field';\nimport { Input } from '../Input';\nimport { NumberInput } from '../NumberInput';\nimport { TimePicker } from '../TimePicker/TimePicker';\nimport { formatTimeOfDay, parseTimeOfDay } from '../TimePicker/time-utils';\nimport { Toggle, ToggleGroup } from '../ToggleGroup';\nimport { cronErrorMessage, describeCron, nextRuns, parseCron, type CronError } from './cron';\nimport { cronFromSchedule, scheduleFromCron, type ScheduleFrequency, type ScheduleParts } from './schedule-presets';\nimport { scheduleInputVariants } from './schedule-input.variants';\n\nexport interface ScheduleInputProps {\n /** Cron expression (controlled). */\n value?: string;\n defaultValue?: string;\n /** Fires on every edit, valid or not. */\n onValueChange?: (value: string, details: { valid: boolean; error?: CronError }) => void;\n /** IANA time zone for the upcoming runs (\"Europe/Madrid\"). Defaults to the runtime's. */\n timeZone?: string;\n /** Locale for names, lists and dates. Defaults to the I18nProvider's. */\n locale?: string;\n /** How many upcoming runs to list (0 hides the list). */\n previewCount?: number;\n /** Reference time for the upcoming runs. Defaults to the time of mount. */\n now?: Date;\n /** Preset tabs to offer, in order. */\n frequencies?: ScheduleFrequency[];\n /** Clock of the time fields. */\n hourCycle?: 12 | 24;\n /** Submits the expression through a hidden input. */\n name?: string;\n disabled?: boolean;\n className?: string;\n /** Accessible name of the whole editor. */\n 'aria-label'?: string;\n}\n\n/** Next runs, or none when the time zone is unknown. */\nfunction safeNextRuns(...args: Parameters<typeof nextRuns>): Date[] {\n try {\n return nextRuns(...args);\n } catch {\n return [];\n }\n}\n\nconst ALL_FREQUENCIES: ScheduleFrequency[] = ['hourly', 'daily', 'weekly', 'monthly', 'custom'];\nconst FREQUENCY_KEY = {\n hourly: 'scheduleInput.hourly',\n daily: 'scheduleInput.daily',\n weekly: 'scheduleInput.weekly',\n monthly: 'scheduleInput.monthly',\n custom: 'scheduleInput.custom',\n} as const;\n\n/**\n * Cron schedule editor: presets (hourly at minute, daily at, weekly on days at, monthly on day\n * at) that write a 5-field cron expression, a raw cron field for anything else, validation with\n * a message, a plain-language summary and the next runs in a time zone.\n */\nexport function ScheduleInput({\n value,\n defaultValue = '0 9 * * 1-5',\n onValueChange,\n timeZone,\n locale: localeProp,\n previewCount = 5,\n now: nowProp,\n frequencies = ALL_FREQUENCIES,\n hourCycle = 24,\n name,\n disabled,\n className,\n 'aria-label': ariaLabel,\n}: ScheduleInputProps) {\n const { t } = useI18n();\n const providerLocale = useOptionalI18n()?.locale;\n const locale = localeProp ?? providerLocale ?? 'en';\n const uid = useId();\n const [inner, setInner] = useState(defaultValue);\n const expression = value ?? inner;\n const [frequency, setFrequency] = useState<ScheduleFrequency>(() => scheduleFromCron(expression).frequency);\n const [seen, setSeen] = useState(expression);\n // An expression set from outside picks the preset that fits it.\n if (expression !== seen) {\n setSeen(expression);\n setFrequency(scheduleFromCron(expression).frequency);\n }\n const [mountedAt] = useState(() => new Date());\n const now = nowProp ?? mountedAt;\n const s = scheduleInputVariants({ disabled: !!disabled });\n\n const parsed = parseCron(expression);\n const parts: ScheduleParts = { ...scheduleFromCron(expression), frequency };\n const errorText = parsed.valid ? '' : cronErrorMessage(parsed.error, t);\n const summary = parsed.valid ? describeCron(parsed.cron, { locale, t }) : '';\n const runs = parsed.valid && previewCount > 0 ? safeNextRuns(parsed.cron, now, previewCount, timeZone) : [];\n const zoneLabel = timeZone ?? t('scheduleInput.localTime');\n\n const emit = (next: string) => {\n setInner(next);\n setSeen(next);\n const p = parseCron(next);\n onValueChange?.(next, p.valid ? { valid: true } : { valid: false, error: p.error });\n };\n const update = (patch: Partial<ScheduleParts>) => emit(cronFromSchedule({ ...parts, ...patch }, expression));\n\n const pickFrequency = (next: ScheduleFrequency) => {\n setFrequency(next);\n if (next !== 'custom') update({ frequency: next });\n };\n\n const weekStart = localeWeekStart(locale);\n const weekOrder = Array.from({ length: 7 }, (_, i) => (weekStart + i) % 7);\n const dayName = (d: number, style: 'short' | 'long') =>\n new Intl.DateTimeFormat(locale, { weekday: style, timeZone: 'UTC' }).format(new Date(Date.UTC(2023, 0, 1 + d)));\n const time = formatTimeOfDay({ hours: parts.hour, minutes: parts.minute, seconds: 0 });\n const onTime = (v: string | null) => {\n const tod = parseTimeOfDay(v);\n if (tod) update({ hour: tod.hours, minute: tod.minutes });\n };\n const runFormat: Intl.DateTimeFormatOptions = {\n weekday: 'short',\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n hourCycle: hourCycle === 12 ? 'h12' : 'h23',\n ...(timeZone ? { timeZone } : {}),\n };\n const runFormatter = new Intl.DateTimeFormat(locale, runFormat);\n const errorId = `${uid}-error`;\n const hintId = `${uid}-hint`;\n\n const timeField = (\n <Field className={s.editor()}>\n <FieldLabel className={s.editorLabel()}>{t('scheduleInput.atTime')}</FieldLabel>\n <TimePicker\n value={time}\n onValueChange={onTime}\n hourCycle={hourCycle}\n locale={locale}\n disabled={disabled}\n className=\"w-auto\"\n />\n </Field>\n );\n\n return (\n <div role=\"group\" aria-label={ariaLabel ?? t('scheduleInput.label')} className={cn(s.root(), className)}>\n <ToggleGroup\n aria-label={t('scheduleInput.frequency')}\n value={[frequency]}\n onValueChange={(v) => {\n const next = v[0] as ScheduleFrequency | undefined;\n if (next) pickFrequency(next);\n }}\n disabled={disabled}\n className=\"w-fit max-w-full flex-wrap\"\n >\n {frequencies.map((f) => (\n <Toggle key={f} value={f}>\n {t(FREQUENCY_KEY[f])}\n </Toggle>\n ))}\n </ToggleGroup>\n\n {frequency !== 'custom' && (\n <div className={s.editors()}>\n {frequency === 'hourly' && (\n <Field className={s.editor()}>\n <FieldLabel className={s.editorLabel()}>{t('scheduleInput.atMinute')}</FieldLabel>\n <NumberInput\n value={parts.minute}\n min={0}\n max={59}\n onValueChange={(v) => v !== null && update({ minute: v })}\n disabled={disabled}\n className=\"w-32\"\n />\n </Field>\n )}\n {frequency === 'weekly' && (\n <div className={s.editor()}>\n <span id={`${uid}-days`} className={s.editorLabel()}>\n {t('scheduleInput.onDays')}\n </span>\n <ToggleGroup\n multiple\n variant=\"joined\"\n size=\"sm\"\n aria-labelledby={`${uid}-days`}\n value={parts.weekdays.map(String)}\n onValueChange={(v) => v.length && update({ weekdays: v.map(Number) })}\n disabled={disabled}\n >\n {weekOrder.map((d) => (\n <Toggle key={d} value={String(d)} aria-label={dayName(d, 'long')} className=\"min-w-10 px-2\">\n {dayName(d, 'short')}\n </Toggle>\n ))}\n </ToggleGroup>\n </div>\n )}\n {frequency === 'monthly' && (\n <Field className={s.editor()}>\n <FieldLabel className={s.editorLabel()}>{t('scheduleInput.dayOfMonth')}</FieldLabel>\n <NumberInput\n value={parts.dayOfMonth}\n min={1}\n max={31}\n onValueChange={(v) => v !== null && update({ dayOfMonth: v })}\n disabled={disabled}\n className=\"w-32\"\n />\n </Field>\n )}\n {frequency !== 'hourly' && timeField}\n </div>\n )}\n\n <Field className={s.editor()} invalid={!parsed.valid}>\n <FieldLabel className={s.editorLabel()}>{t('scheduleInput.expression')}</FieldLabel>\n <Input\n value={expression}\n onChange={(e) => {\n const next = e.currentTarget.value;\n setFrequency(scheduleFromCron(next).frequency);\n emit(next);\n }}\n invalid={!parsed.valid}\n disabled={disabled}\n spellCheck={false}\n autoComplete=\"off\"\n aria-describedby={parsed.valid ? hintId : `${errorId} ${hintId}`}\n inputClassName={s.expression()}\n />\n <span id={hintId} className={s.hint()}>\n {t('scheduleInput.expressionHint')}\n </span>\n <div aria-live=\"polite\" className=\"contents\">\n {!parsed.valid && (\n <p id={errorId} className={s.error()}>\n {errorText}\n </p>\n )}\n </div>\n </Field>\n {name && <input type=\"hidden\" name={name} value={expression} />}\n\n {parsed.valid && (\n <p className={s.summary()} aria-live=\"polite\">\n <CalendarClock size={15} aria-hidden className={s.summaryIcon()} />\n <span>{summary}</span>\n </p>\n )}\n\n {parsed.valid && previewCount > 0 && (\n <div className={s.runs()}>\n <span id={`${uid}-runs`} className={s.runsHeading()}>\n {t('scheduleInput.nextRuns', { timeZone: zoneLabel })}\n </span>\n {runs.length ? (\n <ol aria-labelledby={`${uid}-runs`} className={s.runsList()}>\n {runs.map((r) => (\n <li key={r.getTime()}>\n <time dateTime={r.toISOString()}>{runFormatter.format(r)}</time>\n </li>\n ))}\n </ol>\n ) : (\n <p className={s.empty()}>{t('scheduleInput.noRuns')}</p>\n )}\n </div>\n )}\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'ScheduleInput',\n group: 'Forms',\n status: 'beta',\n description:\n 'Cron schedule editor: presets (hourly at minute, daily at, weekly on days at, monthly on day at) that write a 5-field cron expression, plus a raw cron field (*, lists, ranges, steps, names, macros) with validation and an error message, a plain-language summary (\"Every weekday at 09:00\") and the next runs in a time zone. Pure helpers: parseCron, describeCron, nextRuns.',\n primitive: '@base-ui/react/toggle-group + Field, Input, NumberInput, TimePicker',\n pattern: 'group of form controls (segmented control, textbox, spinbuttons)',\n keyboard: [\n ['Tab / Shift+Tab', 'Moves between the frequency tabs, the preset fields and the cron field'],\n ['ArrowLeft / ArrowRight', 'In the frequency or weekday group: moves between options'],\n ['Enter / Space', 'Picks the focused frequency, or toggles the focused weekday'],\n ['ArrowUp / ArrowDown', 'In the minute, day or time fields: steps the value'],\n ['Type in the cron field', 'Re-validates, updates the summary and the next runs, and selects the preset that fits'],\n ],\n tokens: [\n 'background',\n 'border',\n 'card',\n 'foreground',\n 'muted-foreground',\n 'primary',\n 'secondary',\n 'destructive-text',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const scrollAreaVariants = tv({\n slots: {\n root: 'relative min-h-0 overflow-hidden',\n viewport:\n 'size-full overscroll-contain rounded-[inherit] focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus-ring',\n content: '',\n scrollbar:\n 'pointer-events-none flex touch-none p-0.5 opacity-0 transition-opacity duration-150 select-none motion-reduce:transition-none data-hovering:pointer-events-auto data-hovering:opacity-100 data-scrolling:pointer-events-auto data-scrolling:opacity-100 data-scrolling:duration-0 data-[orientation=horizontal]:h-2.5 data-[orientation=horizontal]:flex-col data-[orientation=vertical]:w-2.5',\n thumb: 'flex-1 rounded-full bg-border hover:bg-muted-foreground/50 active:bg-muted-foreground/60',\n corner: 'bg-transparent',\n },\n variants: {\n bordered: {\n true: { root: 'rounded-lg border border-border bg-card' },\n },\n },\n defaultVariants: { bordered: false },\n});\n\nexport type ScrollAreaVariantProps = VariantProps<typeof scrollAreaVariants>;\n","import { ScrollArea as BaseScrollArea } from '@base-ui/react/scroll-area';\nimport type { ReactNode, Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { scrollAreaVariants } from './scroll-area.variants';\n\nexport interface ScrollAreaProps extends Omit<BaseScrollArea.Root.Props, 'className' | 'children'> {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n children?: ReactNode;\n /** Which scrollbars to draw. Default `vertical`. */\n orientation?: 'vertical' | 'horizontal' | 'both';\n /** Draws a bordered card surface around the area. */\n bordered?: boolean;\n /**\n * Accessible name of the scrollable region. When set (or `aria-labelledby`), the viewport becomes a\n * labelled `role=\"region\"`; it joins the Tab order whenever its content overflows.\n */\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n /** Class for the viewport (the scroll container). */\n viewportClassName?: string;\n /** Class for the content wrapper inside the viewport (padding goes here). */\n contentClassName?: string;\n viewportRef?: Ref<HTMLDivElement>;\n}\n\n/**\n * Native scroll container with thin, token-styled scrollbars that fade in on hover and while\n * scrolling. Overflowing viewports are focusable (Tab), so arrow keys / Page keys scroll natively.\n */\nexport function ScrollArea({\n orientation = 'vertical',\n bordered,\n className,\n viewportClassName,\n contentClassName,\n viewportRef,\n children,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...props\n}: ScrollAreaProps) {\n const s = scrollAreaVariants({ bordered });\n const labelled = ariaLabel != null || ariaLabelledBy != null;\n return (\n <BaseScrollArea.Root className={cn(s.root(), className)} {...props}>\n <BaseScrollArea.Viewport\n ref={viewportRef}\n className={cn(s.viewport(), viewportClassName)}\n {...(labelled ? { role: 'region', 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } : {})}\n >\n <BaseScrollArea.Content\n className={cn(s.content(), orientation !== 'vertical' && 'min-w-fit', contentClassName)}\n >\n {children}\n </BaseScrollArea.Content>\n </BaseScrollArea.Viewport>\n {orientation !== 'horizontal' && (\n <BaseScrollArea.Scrollbar orientation=\"vertical\" className={s.scrollbar()}>\n <BaseScrollArea.Thumb className={s.thumb()} />\n </BaseScrollArea.Scrollbar>\n )}\n {orientation !== 'vertical' && (\n <BaseScrollArea.Scrollbar orientation=\"horizontal\" className={s.scrollbar()}>\n <BaseScrollArea.Thumb className={s.thumb()} />\n </BaseScrollArea.Scrollbar>\n )}\n {orientation === 'both' && <BaseScrollArea.Corner className={s.corner()} />}\n </BaseScrollArea.Root>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'ScrollArea',\n group: 'Layout',\n status: 'stable',\n description:\n 'Native scroll container with thin token-styled scrollbars that fade in on hover and while scrolling. Vertical, horizontal or both; optional bordered surface. With an aria-label the viewport is a named region, and it joins the Tab order whenever it overflows.',\n primitive: '@base-ui/react/scroll-area',\n pattern: 'region',\n keyboard: [\n ['Tab', 'Focuses the scrollable viewport (only when its content overflows)'],\n ['ArrowUp / ArrowDown / PageUp / PageDown / Home / End', 'Scrolls the focused viewport natively'],\n ],\n tokens: ['border', 'muted-foreground', 'card', 'focus-ring'],\n};\n","export type DateInput = Date | string | number;\n\n/** Parses a Date, ISO string or epoch milliseconds; returns null when invalid. */\nexport function toDate(value: DateInput): Date | null {\n const date = value instanceof Date ? value : new Date(value);\n return Number.isNaN(date.getTime()) ? null : date;\n}\n\nconst UNITS: Array<[Intl.RelativeTimeFormatUnit, number]> = [\n ['year', 365 * 24 * 3600],\n ['month', 30 * 24 * 3600],\n ['week', 7 * 24 * 3600],\n ['day', 24 * 3600],\n ['hour', 3600],\n ['minute', 60],\n ['second', 1],\n];\n\n/** \"3 minutes ago\", \"in 2 days\", \"now\" — via Intl.RelativeTimeFormat. */\nexport function formatRelative(date: Date, now: number, locale?: string, style: Intl.RelativeTimeFormatStyle = 'long') {\n const seconds = Math.round((date.getTime() - now) / 1000);\n const rtf = new Intl.RelativeTimeFormat(locale, { numeric: 'auto', style });\n const abs = Math.abs(seconds);\n if (abs < 10) return rtf.format(0, 'second');\n for (const [unit, size] of UNITS) {\n if (abs >= size || unit === 'second') return rtf.format(Math.trunc(seconds / size), unit);\n }\n return rtf.format(seconds, 'second');\n}\n\n/** How often a relative label needs refreshing, from its distance to now. */\nexport function refreshInterval(date: Date, now: number) {\n const abs = Math.abs(date.getTime() - now);\n if (abs < 60_000) return 5_000;\n if (abs < 3_600_000) return 30_000;\n return 300_000;\n}\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const timestampVariants = tv({\n base: [\n 'rounded-sm whitespace-nowrap tabular-nums',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n variants: {\n tone: {\n default: 'text-foreground',\n muted: 'text-muted-foreground',\n },\n interactive: {\n true: 'cursor-default underline decoration-border decoration-dotted underline-offset-4',\n false: '',\n },\n },\n defaultVariants: { tone: 'muted', interactive: false },\n});\n\nexport type TimestampVariantProps = VariantProps<typeof timestampVariants>;\n","import { useEffect, useState, type HTMLAttributes, type Ref } from 'react';\nimport { useOptionalI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { SimpleTooltip } from '../Tooltip';\nimport { formatRelative, refreshInterval, toDate, type DateInput } from './format';\nimport { timestampVariants, type TimestampVariantProps } from './timestamp.variants';\n\nexport interface TimestampProps\n extends Omit<HTMLAttributes<HTMLTimeElement>, 'className' | 'children'>, Omit<TimestampVariantProps, 'interactive'> {\n className?: string;\n ref?: Ref<HTMLTimeElement>;\n /** The moment to show: a Date, an ISO string or epoch milliseconds. */\n value: DateInput;\n /** `relative` (\"3 minutes ago\", default) or `absolute` (Intl date/time). */\n format?: 'relative' | 'absolute';\n /** BCP 47 locale for Intl; defaults to the I18nProvider's, else the runtime locale. */\n locale?: string;\n /** Relative wording style. */\n relativeStyle?: Intl.RelativeTimeFormatStyle;\n /** Intl options for the absolute label. */\n dateOptions?: Intl.DateTimeFormatOptions;\n /** Intl options for the full date in the tooltip. */\n tooltipOptions?: Intl.DateTimeFormatOptions;\n /** Keep a relative label fresh (adaptive interval, cleaned up on unmount). */\n live?: boolean;\n /** Fixed refresh interval in ms (overrides the adaptive one). */\n updateInterval?: number;\n /** Show the full date in a tooltip on hover and keyboard focus (the label becomes focusable). */\n tooltip?: boolean;\n /** Shown when `value` cannot be parsed. */\n fallback?: string;\n /**\n * Reference time (epoch ms) for the first render, e.g. the server's request time, so the\n * server HTML and the hydration render match. A live label switches to the real clock right\n * after mount. Defaults to `Date.now()`.\n */\n now?: number;\n}\n\nconst ABSOLUTE: Intl.DateTimeFormatOptions = { dateStyle: 'medium', timeStyle: 'short' };\nconst FULL: Intl.DateTimeFormatOptions = { dateStyle: 'full', timeStyle: 'long' };\n\n/**\n * A date rendered in a `<time dateTime>` element, relative or absolute, with the full date in\n * a tooltip (and in the accessible text). Relative labels update themselves while mounted.\n */\nexport function Timestamp({\n value,\n format = 'relative',\n locale: localeProp,\n relativeStyle = 'long',\n dateOptions = ABSOLUTE,\n tooltipOptions = FULL,\n live = true,\n updateInterval,\n tooltip = true,\n fallback = '—',\n now: initialNow,\n tone,\n className,\n ...props\n}: TimestampProps) {\n const providerLocale = useOptionalI18n()?.locale;\n const locale = localeProp ?? providerLocale;\n const date = toDate(value);\n const [now, setNow] = useState(() => initialNow ?? Date.now());\n const time = date?.getTime();\n const isLive = live && format === 'relative' && time !== undefined;\n const interval = time !== undefined ? (updateInterval ?? refreshInterval(new Date(time), now)) : 0;\n\n // A server-provided reference time only seeds hydration; catch up with the clock once mounted.\n const seeded = initialNow !== undefined;\n useEffect(() => {\n if (!isLive || !seeded) return;\n const id = window.setTimeout(() => setNow(Date.now()), 0);\n return () => window.clearTimeout(id);\n }, [isLive, seeded]);\n\n useEffect(() => {\n if (!isLive) return;\n const id = window.setInterval(() => setNow(Date.now()), interval);\n return () => window.clearInterval(id);\n }, [isLive, interval]);\n\n if (!date) {\n return <span className={cn(timestampVariants({ tone }), className)}>{fallback}</span>;\n }\n\n const label =\n format === 'relative'\n ? formatRelative(date, now, locale, relativeStyle)\n : new Intl.DateTimeFormat(locale, dateOptions).format(date);\n const full = new Intl.DateTimeFormat(locale, tooltipOptions).format(date);\n const showTooltip = tooltip && full !== label;\n const element = (\n // Relative labels and locale/time-zone formatting can legitimately differ between server and client.\n <time\n suppressHydrationWarning\n dateTime={date.toISOString()}\n tabIndex={showTooltip ? 0 : undefined}\n className={cn(timestampVariants({ tone, interactive: showTooltip }), className)}\n {...props}\n >\n {label}\n {showTooltip && (\n <span suppressHydrationWarning className=\"sr-only\">\n {' '}\n ({full})\n </span>\n )}\n </time>\n );\n if (!showTooltip) return element;\n return (\n <SimpleTooltip content={full} variant=\"solid\">\n {element}\n </SimpleTooltip>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Timestamp',\n group: 'Display',\n status: 'beta',\n description:\n 'A date in a <time dateTime> element: relative (\"3 minutes ago\", Intl.RelativeTimeFormat) or absolute (Intl.DateTimeFormat), localised with `locale`. Accepts a Date, ISO string or epoch ms. Relative labels refresh on an adaptive interval that is cleared on unmount. The full date shows in a tooltip on hover or focus and is also part of the accessible text.',\n primitive: '@base-ui/react/tooltip',\n pattern: 'tooltip',\n keyboard: [\n ['Tab', 'Focuses the timestamp and shows the full date in a tooltip'],\n ['Escape', 'Hides the tooltip'],\n ],\n tokens: ['foreground', 'muted-foreground', 'border', 'focus-ring'],\n};\n","/** Character used to draw a masked secret. */\nexport const MASK_CHAR = '•';\n\nexport interface MaskOptions {\n /** Characters shown at the start (e.g. a key prefix like \"sk_live_\"). Default 0. */\n visiblePrefix?: number;\n /** Characters shown at the end (the last four, say). Default 0. */\n visibleSuffix?: number;\n /** Number of mask characters. Fixed by default so the mask does not reveal the length. */\n maskLength?: number;\n}\n\n/**\n * The masked form of a secret: optional visible prefix / suffix around a fixed run of `•`.\n * Prefix and suffix are only shown while they leave at least half of the value hidden.\n */\nexport function maskSecret(\n value: string,\n { visiblePrefix = 0, visibleSuffix = 0, maskLength = 16 }: MaskOptions = {},\n): string {\n if (!value) return '';\n const shown = visiblePrefix + visibleSuffix;\n const safe = shown > 0 && shown * 2 <= value.length;\n const head = safe ? value.slice(0, visiblePrefix) : '';\n const tail = safe && visibleSuffix > 0 ? value.slice(-visibleSuffix) : '';\n return `${head}${MASK_CHAR.repeat(Math.max(1, maskLength))}${tail}`;\n}\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const secretFieldVariants = tv({\n slots: {\n root: 'flex min-w-0 flex-col gap-1.5',\n row: 'flex min-w-0 items-center gap-2',\n field: 'min-w-0 flex-1 pe-1',\n input: 'font-mono tracking-wide',\n actions: 'flex shrink-0 items-center gap-0.5',\n toggle: 'size-7 shrink-0',\n meta: 'flex flex-wrap items-center gap-x-3 gap-y-0.5 text-[12px] leading-4 text-muted-foreground',\n metaItem: 'inline-flex items-center gap-1',\n status: 'sr-only',\n },\n variants: {\n size: {\n auto: { input: 'text-[12.5px]' },\n sm: { input: 'text-[12px]', toggle: 'size-6' },\n md: { input: 'text-[12.5px]' },\n },\n },\n defaultVariants: { size: 'auto' },\n});\n\nexport type SecretFieldVariantProps = VariantProps<typeof secretFieldVariants>;\n","import { Eye, EyeOff, RefreshCw } from 'lucide-react';\nimport { useId, useState, type Ref } from 'react';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n} from '../AlertDialog';\nimport { Button, IconButton } from '../Button';\nimport { CopyButton } from '../CopyButton';\nimport { Input, type InputProps } from '../Input';\nimport { LiveAnnouncer, useAnnounce, useHasLiveAnnouncer } from '../LiveAnnouncer';\nimport { Timestamp } from '../Timestamp';\nimport { maskSecret, type MaskOptions } from './secret-mask';\nimport { secretFieldVariants } from './secret-field.variants';\n\ntype DateInput = Date | number | string;\n\nexport interface SecretFieldProps\n extends\n Omit<InputProps, 'value' | 'defaultValue' | 'type' | 'readOnly' | 'trailingAddon' | 'title' | 'onValueChange'>,\n MaskOptions {\n ref?: Ref<HTMLInputElement>;\n /** The secret. While hidden and read-only it is not rendered into the DOM at all. */\n value: string;\n /** Allow editing (renders a password input). Read-only by default. */\n editable?: boolean;\n onValueChange?: (value: string) => void;\n /** Whether the value is shown (controlled). */\n revealed?: boolean;\n defaultRevealed?: boolean;\n onRevealedChange?: (revealed: boolean) => void;\n /** Show the copy button (default true). Copies the real value even while masked. */\n copyable?: boolean;\n /** Optional names for the reveal toggle and copy action, and its success announcement. */\n showLabel?: string;\n hideLabel?: string;\n copyLabel?: string;\n copiedAnnouncement?: string;\n /** Adds a Rotate action. Return a promise to show a loading state until it settles. */\n onRotate?: () => void | Promise<void>;\n /** Ask for confirmation before rotating (default true). */\n confirmRotate?: boolean;\n /** Overrides for the rotate button and its confirmation. */\n rotateLabel?: string;\n rotateTitle?: string;\n rotateDescription?: string;\n rotateConfirmLabel?: string;\n /** When the secret was created. */\n createdAt?: DateInput;\n /** When it was last used; `null` renders \"Never used\". */\n lastUsedAt?: DateInput | null;\n /** Classes for the outer column (`className` goes on the field). */\n wrapperClassName?: string;\n}\n\n/**\n * A secret value (API key, token, connection string): masked by default with a reveal toggle\n * (aria-pressed), a copy button that announces \"Copied\", an optional Rotate action behind a\n * confirmation, and optional created / last-used meta. Read-only unless `editable`. The secret\n * never goes into a title or tooltip, and while masked and read-only it is not in the DOM.\n */\nexport function SecretField(props: SecretFieldProps) {\n // Without an announcer above, provide one so this field and its CopyButton share one status region.\n return useHasLiveAnnouncer() ? (\n <SecretFieldInner {...props} />\n ) : (\n <LiveAnnouncer>\n <SecretFieldInner {...props} />\n </LiveAnnouncer>\n );\n}\n\nfunction SecretFieldInner({\n value,\n editable = false,\n onValueChange,\n revealed: revealedProp,\n defaultRevealed = false,\n onRevealedChange,\n copyable = true,\n showLabel,\n hideLabel,\n copyLabel,\n copiedAnnouncement,\n onRotate,\n confirmRotate = true,\n rotateLabel,\n rotateTitle,\n rotateDescription,\n rotateConfirmLabel,\n createdAt,\n lastUsedAt,\n visiblePrefix,\n visibleSuffix,\n maskLength,\n size = 'auto',\n disabled,\n className,\n inputClassName,\n wrapperClassName,\n 'aria-describedby': describedBy,\n ...props\n}: SecretFieldProps) {\n const { t } = useI18n();\n const announce = useAnnounce();\n const hiddenId = useId();\n const metaId = useId();\n const [innerRevealed, setInnerRevealed] = useState(defaultRevealed);\n const [rotating, setRotating] = useState(false);\n const revealed = revealedProp ?? innerRevealed;\n const s = secretFieldVariants({ size });\n const hasMeta = createdAt !== undefined || lastUsedAt !== undefined;\n\n const toggle = () => {\n setInnerRevealed(!revealed);\n onRevealedChange?.(!revealed);\n };\n\n const rotate = async () => {\n if (!onRotate) return;\n setRotating(true);\n try {\n await onRotate();\n announce(t('secret.rotated'));\n } catch {\n announce(t('secret.rotateFailed'), 'assertive');\n } finally {\n setRotating(false);\n }\n };\n\n const masked = !revealed;\n const shown = editable ? value : masked ? maskSecret(value, { visiblePrefix, visibleSuffix, maskLength }) : value;\n const describedByIds = cn(describedBy, masked && !editable && value && hiddenId, hasMeta && metaId) || undefined;\n const rotateText = rotateLabel ?? t('secret.rotate');\n\n return (\n <div className={cn(s.root(), wrapperClassName)}>\n <div className={s.row()}>\n <Input\n {...props}\n size={size}\n disabled={disabled}\n className={cn(s.field(), className)}\n inputClassName={cn(s.input(), inputClassName)}\n type={editable && masked ? 'password' : 'text'}\n readOnly={!editable}\n value={shown}\n onValueChange={editable ? (v) => onValueChange?.(v) : undefined}\n autoComplete=\"off\"\n spellCheck={false}\n data-masked={masked || undefined}\n aria-describedby={describedByIds}\n trailingAddon={\n <span className={s.actions()}>\n <IconButton\n size=\"sm\"\n className={s.toggle()}\n icon={revealed ? EyeOff : Eye}\n label={revealed ? (hideLabel ?? t('secret.hide')) : (showLabel ?? t('secret.show'))}\n aria-pressed={revealed}\n disabled={disabled}\n onClick={toggle}\n />\n {copyable && (\n <CopyButton\n size=\"sm\"\n className={s.toggle()}\n value={() => value}\n label={copyLabel ?? t('secret.copy')}\n announcement={copiedAnnouncement ?? t('secret.copied')}\n disabled={disabled || !value}\n />\n )}\n </span>\n }\n />\n {onRotate &&\n (confirmRotate ? (\n <AlertDialog>\n <AlertDialogTrigger\n disabled={disabled || rotating}\n render={\n <Button variant=\"secondary\" size={size} icon={RefreshCw} loading={rotating}>\n {rotateText}\n </Button>\n }\n />\n <AlertDialogContent>\n <AlertDialogHeader tone=\"warning\">\n <AlertDialogTitle>{rotateTitle ?? t('secret.rotateTitle')}</AlertDialogTitle>\n <AlertDialogDescription>{rotateDescription ?? t('secret.rotateDescription')}</AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>{t('common.cancel')}</AlertDialogCancel>\n <AlertDialogAction variant=\"primary\" icon={RefreshCw} onClick={rotate}>\n {rotateConfirmLabel ?? t('secret.rotateConfirm')}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n ) : (\n <Button\n variant=\"secondary\"\n size={size}\n icon={RefreshCw}\n loading={rotating}\n disabled={disabled}\n onClick={rotate}\n >\n {rotateText}\n </Button>\n ))}\n </div>\n {masked && !editable && value && (\n <span id={hiddenId} className=\"sr-only\">\n {t('secret.hidden')}\n </span>\n )}\n {hasMeta && (\n <p id={metaId} className={s.meta()}>\n {createdAt !== undefined && (\n <span className={s.metaItem()}>\n {t('secret.created')} <Timestamp value={createdAt} tooltip={false} />\n </span>\n )}\n {lastUsedAt !== undefined && (\n <span className={s.metaItem()}>\n {lastUsedAt === null ? (\n t('secret.neverUsed')\n ) : (\n <>\n {t('secret.lastUsed')} <Timestamp value={lastUsedAt} tooltip={false} />\n </>\n )}\n </span>\n )}\n </p>\n )}\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'SecretField',\n group: 'Forms',\n status: 'beta',\n description:\n 'A secret value (API key, token, connection string) on Input: masked by default (fixed-length mask, optional visible prefix/suffix), a reveal toggle (aria-pressed), a CopyButton that copies the real value and announces it, an optional Rotate action behind an AlertDialog confirmation, and optional created / last-used meta. Optional showLabel, hideLabel, copyLabel and copiedAnnouncement override i18n defaults. Read-only by default (`editable` turns it into a password field). While masked and read-only the secret is not in the DOM, and it is never put in a title or tooltip. `maskSecret` is exported too.',\n primitive: '@base-ui/react/input',\n pattern: 'read-only textbox + toggle button + button',\n keyboard: [\n ['Tab', 'Moves through the field, the reveal toggle, Copy and Rotate'],\n ['Enter / Space', 'On the reveal toggle: shows or hides the value (aria-pressed)'],\n ['Enter / Space', 'On Copy: copies the secret and announces \"Secret copied to clipboard\"'],\n ['Enter / Space', 'On Rotate: opens the confirmation (focus moves into it)'],\n ['Escape', 'Closes the confirmation without rotating; focus returns to Rotate'],\n ],\n tokens: [\n 'background',\n 'border',\n 'secondary',\n 'foreground',\n 'muted-foreground',\n 'primary-text',\n 'warning',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const sectionVariants = tv({\n slots: {\n root: 'min-w-0 text-foreground',\n header: 'grid grid-cols-[1fr_auto] items-start gap-x-4',\n title: 'col-start-1 text-[15px] font-semibold tracking-tight text-foreground',\n description: 'col-start-1 mt-0.5 text-[13px] leading-snug text-muted-foreground',\n actions: 'col-start-2 row-span-2 row-start-1 flex shrink-0 items-center gap-2 self-start',\n body: 'flex min-w-0 flex-col',\n },\n variants: {\n variant: {\n plain: {},\n card: { root: 'rounded-xl border border-border bg-card text-card-foreground shadow-sm' },\n muted: { root: 'rounded-xl border border-border bg-secondary/50' },\n },\n padding: {\n none: { root: 'p-0', header: 'mb-3', body: 'gap-4' },\n sm: { root: 'p-4', header: 'mb-3', body: 'gap-3' },\n md: { root: 'p-5', header: 'mb-4', body: 'gap-4' },\n lg: { root: 'p-6 sm:p-8', header: 'mb-5', body: 'gap-5' },\n },\n divided: {\n true: {\n header: 'border-b border-border',\n body: 'gap-0 divide-y divide-border *:py-4 *:first:pt-0 *:last:pb-0',\n },\n },\n },\n compoundVariants: [\n { divided: true, padding: 'none', class: { header: 'pb-3' } },\n { divided: true, padding: 'sm', class: { header: 'pb-3' } },\n { divided: true, padding: 'md', class: { header: 'pb-4' } },\n { divided: true, padding: 'lg', class: { header: 'pb-5' } },\n ],\n defaultVariants: { variant: 'plain', padding: 'none', divided: false },\n});\n\nexport type SectionVariantProps = VariantProps<typeof sectionVariants>;\n","import { useId, type HTMLAttributes, type ReactNode, type Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { sectionVariants, type SectionVariantProps } from './section.variants';\n\nexport interface SectionProps extends Omit<HTMLAttributes<HTMLElement>, 'className' | 'title'> {\n className?: string;\n ref?: Ref<HTMLElement>;\n /** `plain` (no surface), `card` (card surface + flat shadow) or `muted` (secondary well). */\n variant?: SectionVariantProps['variant'];\n /** Inner padding: none, sm, md or lg (lg grows on wider screens). */\n padding?: SectionVariantProps['padding'];\n /** Draws a rule under the header and between the children. */\n divided?: boolean;\n /** Header title; also names the section landmark (aria-labelledby). */\n title?: ReactNode;\n /** Supporting line under the title. */\n description?: ReactNode;\n /** Right-hand header slot (buttons, menu). */\n actions?: ReactNode;\n /** Heading level of the title that fits the page outline. */\n headingLevel?: 'h2' | 'h3' | 'h4';\n /** Class for the body wrapper around the children. */\n bodyClassName?: string;\n}\n\n/**\n * A painted content region (`<section>`): optional header (title, description, actions), padding and\n * dividers between its children.\n */\nexport function Section({\n variant,\n padding,\n divided,\n title,\n description,\n actions,\n headingLevel: Heading = 'h2',\n className,\n bodyClassName,\n children,\n ...props\n}: SectionProps) {\n const id = useId();\n const titleId = `${id}-title`;\n const descId = `${id}-desc`;\n const s = sectionVariants({ variant, padding, divided });\n const hasHeader = title != null || description != null || actions != null;\n return (\n <section\n aria-labelledby={title != null ? titleId : undefined}\n aria-describedby={description != null ? descId : undefined}\n className={cn(s.root(), className)}\n {...props}\n >\n {hasHeader && (\n <div className={s.header()}>\n {title != null && (\n <Heading id={titleId} className={s.title()}>\n {title}\n </Heading>\n )}\n {description != null && (\n <p id={descId} className={s.description()}>\n {description}\n </p>\n )}\n {actions != null && <div className={s.actions()}>{actions}</div>}\n </div>\n )}\n <div className={cn(s.body(), bodyClassName)}>{children}</div>\n </section>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Section',\n group: 'Layout',\n status: 'stable',\n description:\n 'A painted content region (<section>, named by its title). Variants plain / card / muted, padding none–lg, optional dividers between children, and a header slot with title, description and actions.',\n pattern: 'region',\n tokens: [\n 'card',\n 'card-foreground',\n 'secondary',\n 'border',\n 'foreground',\n 'muted-foreground',\n 'shadow-sm',\n 'radius-xl',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const separatorVariants = tv({\n slots: {\n line: 'shrink-0 border-0',\n labelled: 'flex w-full items-center gap-3',\n label: 'shrink-0',\n },\n variants: {\n orientation: {\n horizontal: { line: 'h-px w-full' },\n vertical: { line: 'w-px self-stretch' },\n },\n variant: {\n default: { line: 'bg-border' },\n subtle: { line: 'bg-border/50' },\n strong: { line: 'rounded-full bg-border' },\n },\n labelStyle: {\n plain: { label: 'text-[12.5px] text-muted-foreground' },\n kicker: { label: 'font-mono text-[10.5px] tracking-[0.14em] text-muted-foreground uppercase' },\n pill: {\n label:\n 'inline-flex h-[22px] items-center rounded-full bg-secondary px-2.5 font-mono text-[10.5px] font-semibold text-muted-foreground',\n },\n },\n },\n compoundVariants: [\n { orientation: 'horizontal', variant: 'strong', class: { line: 'h-0.5' } },\n { orientation: 'vertical', variant: 'strong', class: { line: 'w-0.5' } },\n ],\n defaultVariants: { orientation: 'horizontal', variant: 'default', labelStyle: 'plain' },\n});\n\nexport type SeparatorVariantProps = VariantProps<typeof separatorVariants>;\n","import { Separator as BaseSeparator } from '@base-ui/react/separator';\nimport type { ReactNode, Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { separatorVariants, type SeparatorVariantProps } from './separator.variants';\n\nexport interface SeparatorProps extends Omit<BaseSeparator.Props, 'className'>, SeparatorVariantProps {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n /** Text (or icon) set into a horizontal line, e.g. a date or section kicker. */\n label?: ReactNode;\n /** Where the label sits along the line. */\n labelPosition?: 'start' | 'center' | 'end';\n}\n\n/**\n * Thematic break between content (role=\"separator\"). Horizontal or vertical; a horizontal\n * separator can carry a label. Purely decorative dividers can pass `render={<div aria-hidden />}`.\n */\nexport function Separator({\n orientation = 'horizontal',\n variant,\n labelStyle,\n label,\n labelPosition = 'center',\n className,\n ...props\n}: SeparatorProps) {\n const s = separatorVariants({ orientation, variant, labelStyle });\n if (label == null || orientation === 'vertical') {\n return <BaseSeparator orientation={orientation} className={cn(s.line(), className)} {...props} />;\n }\n const line = s.line({ class: 'w-auto flex-1' });\n return (\n <div className={cn(s.labelled(), className)}>\n {labelPosition !== 'start' && <BaseSeparator orientation=\"horizontal\" className={line} {...props} />}\n <span className={s.label()}>{label}</span>\n {labelPosition !== 'end' &&\n (labelPosition === 'start' ? (\n <BaseSeparator orientation=\"horizontal\" className={line} {...props} />\n ) : (\n <span aria-hidden className={line} />\n ))}\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Separator',\n group: 'Layout',\n status: 'stable',\n description:\n 'Thin rule between content. Horizontal or vertical, default / subtle / strong weight, and an optional label (plain text, mono kicker or pill) placed at the start, centre or end of a horizontal line.',\n primitive: '@base-ui/react/separator',\n pattern: 'separator',\n tokens: ['border', 'secondary', 'muted-foreground'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const skeletonVariants = tv({\n slots: {\n block: 'animate-pulse bg-muted motion-reduce:animate-none',\n lines: 'grid gap-2',\n },\n variants: {\n shape: {\n block: { block: 'h-4 w-full rounded-md' },\n text: { block: 'h-3 w-full rounded-md' },\n circle: { block: 'size-10 shrink-0 rounded-full' },\n },\n },\n defaultVariants: { shape: 'block' },\n});\n\nexport type SkeletonVariantProps = VariantProps<typeof skeletonVariants>;\n","import type { HTMLAttributes, Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { skeletonVariants, type SkeletonVariantProps } from './skeleton.variants';\n\nexport interface SkeletonProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'children'>, SkeletonVariantProps {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n /** For `shape=\"text\"`: number of lines; the last one is shorter. */\n lines?: number;\n}\n\n/**\n * Loading placeholder. Always decorative (aria-hidden): announce loading on the container,\n * e.g. `<div role=\"status\" aria-label=\"Loading members\">`. The pulse stops under reduced motion.\n */\nexport function Skeleton({ shape, lines = 1, className, ...props }: SkeletonProps) {\n const s = skeletonVariants({ shape });\n if (shape === 'text' && lines > 1) {\n return (\n <div aria-hidden className={cn(s.lines(), className)} {...props}>\n {Array.from({ length: lines }, (_, i) => (\n <div key={i} className={cn(s.block(), i === lines - 1 && 'w-2/3')} />\n ))}\n </div>\n );\n }\n return <div aria-hidden className={cn(s.block(), className)} {...props} />;\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Skeleton',\n group: 'Feedback',\n status: 'stable',\n description:\n 'Loading placeholder in the shape of the content: block, text (one or more lines, the last shorter) or circle. Pulses gently and stops under prefers-reduced-motion. Decorative; announce loading on the container.',\n tokens: ['muted'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const sliderVariants = tv({\n slots: {\n root: 'flex w-full flex-col gap-2 data-disabled:opacity-50',\n header: 'flex items-baseline justify-between gap-3',\n label: 'text-[13px] font-medium text-foreground',\n value: 'font-mono text-[12px] text-muted-foreground tabular-nums',\n control: 'flex w-full touch-none items-center select-none data-disabled:cursor-not-allowed',\n track: 'relative w-full rounded-full bg-secondary select-none',\n indicator: 'rounded-full bg-primary select-none',\n thumb: [\n 'rounded-full border border-primary bg-background shadow-sm transition-[scale] select-none motion-reduce:transition-none',\n 'has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-focus-ring',\n 'data-dragging:scale-110 data-disabled:cursor-not-allowed',\n ],\n },\n variants: {\n size: {\n sm: { control: 'py-2', track: 'h-1', thumb: 'size-3.5' },\n md: { control: 'py-2.5', track: 'h-1.5', thumb: 'size-[18px]' },\n },\n },\n defaultVariants: { size: 'md' },\n});\n\nexport type SliderVariantProps = VariantProps<typeof sliderVariants>;\n","import { Slider as BaseSlider } from '@base-ui/react/slider';\nimport type { ReactNode, Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { sliderVariants, type SliderVariantProps } from './slider.variants';\n\nexport interface SliderProps extends Omit<BaseSlider.Root.Props, 'className' | 'children'>, SliderVariantProps {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n /** Visible label; labels every thumb. Without it, pass `aria-label` (single) or `thumbLabels`. */\n label?: ReactNode;\n /** Accessible name of a single thumb when there is no visible label. */\n 'aria-label'?: string;\n /** Per-thumb accessible names for range sliders, e.g. `['Minimum', 'Maximum']`. */\n thumbLabels?: string[];\n /** Show the formatted value next to the label. */\n showValue?: boolean;\n /** Custom value text; receives formatted strings and raw numbers. */\n formatValue?: (formatted: readonly string[], values: readonly number[]) => ReactNode;\n}\n\nfunction thumbCount(value: SliderProps['value'], defaultValue: SliderProps['defaultValue']) {\n const v = value ?? defaultValue;\n return Array.isArray(v) ? v.length : 1;\n}\n\n/**\n * Pick a number (or a range) on a track. Pass an array to `value` / `defaultValue` for a\n * range: one thumb per entry. Arrow keys step, Page Up/Down take `largeStep`, Home/End jump.\n */\nexport function Slider({\n size,\n label,\n 'aria-label': ariaLabel,\n thumbLabels,\n showValue = false,\n formatValue = (formatted) => formatted.join(' – '),\n className,\n value,\n defaultValue,\n ...props\n}: SliderProps) {\n const v = sliderVariants({ size });\n const count = thumbCount(value, defaultValue);\n return (\n <BaseSlider.Root className={cn(v.root(), className)} value={value} defaultValue={defaultValue} {...props}>\n {(label || showValue) && (\n <div className={v.header()}>\n {label && <BaseSlider.Label className={v.label()}>{label}</BaseSlider.Label>}\n {showValue && (\n <BaseSlider.Value className={cn(v.value(), !label && 'ms-auto')}>{formatValue}</BaseSlider.Value>\n )}\n </div>\n )}\n <BaseSlider.Control className={v.control()}>\n <BaseSlider.Track className={v.track()}>\n <BaseSlider.Indicator className={v.indicator()} />\n {Array.from({ length: count }, (_, i) => (\n <BaseSlider.Thumb\n key={i}\n index={i}\n aria-label={thumbLabels?.[i] ?? (count === 1 ? ariaLabel : undefined)}\n className={v.thumb()}\n />\n ))}\n </BaseSlider.Track>\n </BaseSlider.Control>\n </BaseSlider.Root>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Slider',\n group: 'Forms',\n status: 'stable',\n description:\n 'Pick a number or a range on a track. Single or range thumbs (one per value), optional visible label and live value readout, two sizes, works inside Field and Form.',\n primitive: '@base-ui/react/slider',\n pattern: 'slider (multi-thumb for ranges)',\n keyboard: [\n ['ArrowRight / ArrowUp', 'Increases the focused thumb by one step'],\n ['ArrowLeft / ArrowDown', 'Decreases the focused thumb by one step'],\n ['PageUp / PageDown', 'Increases / decreases by the large step'],\n ['Home / End', 'Moves the focused thumb to the minimum / maximum'],\n ['Tab', 'Moves focus between thumbs'],\n ],\n tokens: ['primary', 'secondary', 'background', 'foreground', 'muted-foreground', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const sparklineVariants = tv({\n slots: {\n root: 'inline-block shrink-0 overflow-visible align-middle',\n line: 'fill-none',\n area: '',\n bar: '',\n marker: 'stroke-card',\n extreme: 'fill-card',\n },\n variants: {\n tone: {\n primary: {\n line: 'stroke-primary',\n area: 'fill-primary/14',\n bar: 'fill-primary',\n marker: 'fill-primary',\n extreme: 'stroke-primary',\n },\n success: {\n line: 'stroke-success',\n area: 'fill-success/14',\n bar: 'fill-success',\n marker: 'fill-success',\n extreme: 'stroke-success',\n },\n warning: {\n line: 'stroke-warning',\n area: 'fill-warning/14',\n bar: 'fill-warning',\n marker: 'fill-warning',\n extreme: 'stroke-warning',\n },\n destructive: {\n line: 'stroke-destructive',\n area: 'fill-destructive/14',\n bar: 'fill-destructive',\n marker: 'fill-destructive',\n extreme: 'stroke-destructive',\n },\n info: {\n line: 'stroke-info',\n area: 'fill-info/14',\n bar: 'fill-info',\n marker: 'fill-info',\n extreme: 'stroke-info',\n },\n neutral: {\n line: 'stroke-muted-foreground',\n area: 'fill-muted-foreground/14',\n bar: 'fill-muted-foreground',\n marker: 'fill-muted-foreground',\n extreme: 'stroke-muted-foreground',\n },\n },\n },\n defaultVariants: { tone: 'primary' },\n});\n\nexport type SparklineVariantProps = VariantProps<typeof sparklineVariants>;\nexport type SparklineTone = NonNullable<SparklineVariantProps['tone']>;\n","import type { ReactNode, Ref, SVGAttributes } from 'react';\nimport { createFormatters, type I18nFormatters } from '../../i18n/format';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { en } from '../../i18n/messages/en';\nimport { cn } from '../../utils/cn';\nimport { sparklineVariants, type SparklineVariantProps } from './sparkline.variants';\n\nexport type SparklineMarker = 'min' | 'max' | 'last';\n\nexport interface SparklineProps\n extends Omit<SVGAttributes<SVGSVGElement>, 'className' | 'width' | 'height'>, SparklineVariantProps {\n className?: string;\n ref?: Ref<SVGSVGElement>;\n /** The series, oldest first. */\n data: readonly number[];\n /** `line` (default) or `bar`. */\n variant?: 'line' | 'bar';\n /** Fill the area under the line (line variant). */\n area?: boolean;\n /** Dots on the lowest, highest and/or last point. */\n markers?: readonly SparklineMarker[];\n width?: number;\n height?: number;\n strokeWidth?: number;\n /** What the series measures, used in the generated accessible name (\"Requests\"). */\n label?: string;\n /** Formats values in the generated accessible name. */\n formatValue?: (value: number) => string;\n}\n\nconst EN = createFormatters('en', en);\n\n/**\n * \"Requests: trending up 12% from 140 to 157 over 12 points (low 120, high 160)\". Pass the\n * `useI18n()` value as `i18n` for another language; English otherwise.\n */\nexport function describeTrend(\n data: readonly number[],\n label?: string,\n format?: (value: number) => string,\n i18n: Pick<I18nFormatters, 't' | 'formatNumber'> = EN,\n) {\n const { t } = i18n;\n const name = label ?? t('common.trend');\n const fmt = format ?? ((v: number) => i18n.formatNumber(v, { maximumFractionDigits: 2 }));\n const first = data[0];\n const last = data[data.length - 1];\n if (first === undefined || last === undefined) return t('sparkline.noData', { label: name });\n if (data.length === 1) return t('sparkline.single', { label: name, value: fmt(first) });\n const min = Math.min(...data);\n const max = Math.max(...data);\n const pct = first !== 0 ? Math.round(((last - first) / Math.abs(first)) * 100) : null;\n const direction = t(last > first ? 'sparkline.up' : last < first ? 'sparkline.down' : 'sparkline.flat');\n const change = pct !== null && last !== first ? ` ${i18n.formatNumber(Math.abs(pct))}%` : '';\n return t('sparkline.summary', {\n label: name,\n direction,\n change,\n first: fmt(first),\n last: fmt(last),\n count: data.length,\n min: fmt(min),\n max: fmt(max),\n });\n}\n\n/**\n * Inline SVG trend without axes or tooltip — the shape only. Pure SVG (no chart library),\n * coloured with token classes; exposed as role=\"img\" with a generated summary of the trend.\n */\nexport function Sparkline({\n data,\n variant = 'line',\n area = false,\n markers = [],\n tone,\n width = 120,\n height = 32,\n strokeWidth = 1.75,\n label,\n formatValue,\n className,\n ...props\n}: SparklineProps) {\n const i18n = useI18n();\n const s = sparklineVariants({ tone });\n const name = props['aria-label'] ?? describeTrend(data, label, formatValue, i18n);\n const n = data.length;\n const min = n ? Math.min(...data) : 0;\n const max = n ? Math.max(...data) : 0;\n const pad = markers.length ? 3 : strokeWidth / 2;\n const innerH = height - pad * 2;\n\n const svg = (children: ReactNode) => (\n <svg\n role=\"img\"\n viewBox={`0 0 ${width} ${height}`}\n width={width}\n height={height}\n className={cn(s.root(), className)}\n {...props}\n aria-label={name}\n >\n {children}\n </svg>\n );\n if (!n) return svg(null);\n\n if (variant === 'bar') {\n const lo = Math.min(0, min);\n const span = max - lo || 1;\n const slot = width / n;\n const gap = Math.min(2, slot * 0.25);\n return svg(\n data.map((v, i) => {\n const h = Math.max(1, ((v - lo) / span) * (height - 1));\n return (\n <rect\n key={i}\n className={s.bar()}\n x={i * slot + gap / 2}\n y={height - h}\n width={Math.max(1, slot - gap)}\n height={h}\n rx={1}\n />\n );\n }),\n );\n }\n\n const span = max - min;\n const x = (i: number) => (n === 1 ? width / 2 : pad + (i * (width - pad * 2)) / (n - 1));\n const y = (v: number) => (span === 0 ? height / 2 : pad + innerH - ((v - min) / span) * innerH);\n const points = data.map((v, i) => [x(i), y(v)] as const);\n const path = points.map(([px, py], i) => `${i ? 'L' : 'M'}${px.toFixed(2)} ${py.toFixed(2)}`).join(' ');\n const first = points[0];\n const lastPoint = points[points.length - 1];\n const areaPath =\n first && lastPoint ? `${path} L${lastPoint[0].toFixed(2)} ${height} L${first[0].toFixed(2)} ${height} Z` : '';\n const markerAt = (kind: SparklineMarker) => {\n const index = kind === 'last' ? n - 1 : data.indexOf(kind === 'min' ? min : max);\n const point = points[index];\n if (!point) return null;\n return (\n <circle\n key={kind}\n data-marker={kind}\n className={kind === 'last' ? s.marker() : s.extreme()}\n cx={point[0]}\n cy={point[1]}\n r={kind === 'last' ? 2.75 : 2.25}\n strokeWidth={kind === 'last' ? 1.5 : 1.25}\n />\n );\n };\n return svg(\n <>\n {area && <path className={s.area()} d={areaPath} />}\n <path className={s.line()} d={path} strokeWidth={strokeWidth} strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n {markers.filter((m, i) => markers.indexOf(m) === i).map(markerAt)}\n </>,\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Sparkline',\n group: 'Display',\n status: 'beta',\n description:\n 'Inline trend in pure SVG (no chart library): line or bars, optional area fill and min / max / last markers, fixed width and height. Coloured with token classes (stroke-primary, fill-primary/14…) so it follows the theme, and exposed as role=\"img\" with a generated summary (\"Requests: trending up 12% from 140 to 157…\").',\n pattern: 'img',\n tokens: ['primary', 'success', 'warning', 'destructive', 'info', 'muted-foreground', 'card'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\n/**\n * Two joined Buttons: the primary action keeps its start corners, the menu button its end\n * corners, and a token-coloured divider separates them for every Button variant.\n */\nexport const splitButtonVariants = tv({\n slots: {\n root: 'inline-flex shrink-0 items-stretch',\n action: 'rounded-e-none focus-visible:z-10',\n trigger: 'rounded-s-none focus-visible:z-10 data-popup-open:bg-secondary/70',\n chevron: 'transition-transform duration-150 motion-reduce:transition-none in-data-popup-open:rotate-180',\n },\n variants: {\n variant: {\n primary: { trigger: 'border-s border-primary-foreground/25 data-popup-open:bg-primary/90' },\n secondary: { trigger: '-ms-px' },\n soft: { trigger: 'border-s border-primary/25 data-popup-open:bg-primary/20' },\n ghost: { trigger: 'border-s border-border' },\n destructive: { trigger: 'border-s border-destructive-foreground/25 data-popup-open:bg-destructive/90' },\n },\n },\n defaultVariants: { variant: 'primary' },\n});\n\nexport type SplitButtonVariantProps = VariantProps<typeof splitButtonVariants>;\n","import { ChevronDown } from 'lucide-react';\nimport type { ComponentType, ReactNode, Ref } from 'react';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { Button, IconButton, type ButtonProps } from '../Button';\nimport { Menu, MenuContent, MenuItem, MenuSeparator, MenuTrigger, type MenuContentProps } from '../Menu';\nimport { splitButtonVariants } from './split-button.variants';\n\ntype IconComponent = ComponentType<{ size?: number; 'aria-hidden'?: boolean; className?: string }>;\n\n/** A secondary action in the menu. `separator: true` draws a divider before it. */\nexport interface SplitButtonAction {\n label: string;\n onSelect?: () => void;\n icon?: IconComponent;\n shortcut?: string;\n destructive?: boolean;\n disabled?: boolean;\n separator?: boolean;\n}\n\nexport interface SplitButtonProps extends Omit<ButtonProps, 'iconOnly' | 'ref'> {\n ref?: Ref<HTMLDivElement>;\n /** Secondary actions listed in the menu. */\n actions?: SplitButtonAction[];\n /** Custom menu items (MenuItem, MenuGroup…) instead of, or after, `actions`. */\n menu?: ReactNode;\n /** Accessible name of the menu button. Defaults to \"More options\". */\n menuLabel?: string;\n /** Disables only the menu button (the primary action follows `disabled`). */\n menuDisabled?: boolean;\n /** Menu placement (default: below, aligned to the end). */\n side?: MenuContentProps['side'];\n align?: MenuContentProps['align'];\n /** Controlled menu state. */\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Name of the wrapping group (optional). */\n 'aria-label'?: string;\n /** Classes for the primary Button (`className` goes on the group). */\n buttonClassName?: string;\n}\n\n/**\n * A primary action joined to a menu of related actions: two real buttons in a group. The\n * chevron button opens a kit Menu (aria-haspopup=\"menu\", aria-expanded) with arrow-key\n * navigation; variants and sizes match Button, `size: 'auto'` follows the density.\n */\nexport function SplitButton({\n actions = [],\n menu,\n menuLabel,\n menuDisabled,\n side,\n align = 'end',\n open,\n defaultOpen,\n onOpenChange,\n variant = 'primary',\n size = 'auto',\n disabled,\n loading,\n className,\n buttonClassName,\n children,\n ref,\n 'aria-label': groupLabel,\n ...buttonProps\n}: SplitButtonProps) {\n const { t } = useI18n();\n const s = splitButtonVariants({ variant: variant ?? 'primary' });\n return (\n <div ref={ref} role=\"group\" aria-label={groupLabel} className={cn(s.root(), className)} data-variant={variant}>\n <Button\n {...buttonProps}\n variant={variant}\n size={size}\n disabled={disabled}\n loading={loading}\n className={cn(s.action(), buttonClassName)}\n >\n {children}\n </Button>\n <Menu\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange ? (next) => onOpenChange(next) : undefined}\n >\n <MenuTrigger\n disabled={disabled || menuDisabled}\n render={\n <IconButton\n icon={ChevronDown}\n label={menuLabel ?? t('splitButton.more')}\n variant={variant}\n size={size}\n className={s.trigger()}\n />\n }\n />\n <MenuContent side={side} align={align}>\n {actions.map((action, i) => (\n <SplitButtonMenuItem key={`${action.label}-${i}`} action={action} first={i === 0} />\n ))}\n {menu}\n </MenuContent>\n </Menu>\n </div>\n );\n}\n\nfunction SplitButtonMenuItem({ action, first }: { action: SplitButtonAction; first: boolean }) {\n return (\n <>\n {action.separator && !first && <MenuSeparator />}\n <MenuItem\n icon={action.icon}\n shortcut={action.shortcut}\n destructive={action.destructive}\n disabled={action.disabled}\n onClick={action.onSelect}\n >\n {action.label}\n </MenuItem>\n </>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'SplitButton',\n group: 'Actions',\n status: 'beta',\n description:\n 'A primary action joined to a menu of secondary actions. Two real buttons in a role=\"group\": the action, and a chevron menu button (aria-haspopup=\"menu\", aria-expanded) that opens the kit Menu. Takes Button\\'s variants and sizes (`auto` follows the density), `actions` for a simple list or `menu` for custom MenuItems.',\n primitive: '@base-ui/react/menu',\n pattern: 'button + menu button',\n keyboard: [\n ['Tab', 'Moves from the primary action to the menu button'],\n ['Enter / Space', 'On the action: runs it. On the menu button: opens the menu with the first item highlighted'],\n ['ArrowDown', 'On the menu button: opens the menu'],\n ['ArrowDown / ArrowUp', 'Moves between menu items (wraps)'],\n ['Enter', 'In the menu: runs the highlighted action and closes the menu'],\n ['Escape', 'Closes the menu and returns focus to the menu button'],\n ],\n tokens: [\n 'primary',\n 'primary-foreground',\n 'card',\n 'border',\n 'secondary',\n 'destructive',\n 'destructive-foreground',\n 'popover',\n 'focus-ring',\n ],\n};\n","import { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cn } from '../../utils/cn';\nimport { GAP_CLASSES, centerVariants, stackVariants, type SpaceScale, type StackVariantProps } from './stack.variants';\n\n/** Block-level tags a layout primitive may render as (use `render` for anything else). */\nexport type LayoutElement =\n | 'div'\n | 'section'\n | 'article'\n | 'aside'\n | 'header'\n | 'footer'\n | 'main'\n | 'nav'\n | 'ul'\n | 'ol'\n | 'li'\n | 'form'\n | 'fieldset'\n | 'span'\n | 'dl';\n\nexport interface StackProps extends Omit<useRender.ComponentProps<'div'>, 'className'> {\n className?: string;\n /** Tag to render. `render` (Base UI) wins when both are set. */\n as?: LayoutElement;\n /** Main axis. Default `column`. */\n direction?: StackVariantProps['direction'];\n /** Space between children on the spacing scale (0–12 → `gap-0`…`gap-12`). */\n gap?: SpaceScale;\n /** Cross-axis alignment. */\n align?: StackVariantProps['align'];\n /** Main-axis distribution. */\n justify?: StackVariantProps['justify'];\n /** Lets children wrap onto new lines. */\n wrap?: boolean;\n /** Renders `inline-flex`. */\n inline?: boolean;\n}\n\n/** Flex layout primitive: one axis, a gap on the spacing scale, alignment and wrapping. */\nexport function Stack({\n as = 'div',\n direction,\n gap,\n align,\n justify,\n wrap,\n inline,\n className,\n render,\n ref,\n ...props\n}: StackProps) {\n return useRender({\n defaultTagName: as,\n render,\n ref,\n props: mergeProps<'div'>(props, {\n className: cn(\n stackVariants({ direction, align, justify, wrap, inline }),\n gap != null && GAP_CLASSES[gap],\n className,\n ),\n }),\n });\n}\n\nexport type HStackProps = Omit<StackProps, 'direction'> & { reverse?: boolean };\n\n/** Horizontal Stack; children are centred on the cross axis by default. */\nexport function HStack({ reverse, align = 'center', ...props }: HStackProps) {\n return <Stack direction={reverse ? 'row-reverse' : 'row'} align={align} {...props} />;\n}\n\nexport type VStackProps = Omit<StackProps, 'direction'> & { reverse?: boolean };\n\n/** Vertical Stack. */\nexport function VStack({ reverse, ...props }: VStackProps) {\n return <Stack direction={reverse ? 'column-reverse' : 'column'} {...props} />;\n}\n\nexport interface CenterProps extends Omit<useRender.ComponentProps<'div'>, 'className'> {\n className?: string;\n as?: LayoutElement;\n /** Renders `inline-flex` (e.g. to centre an icon in a fixed box). */\n inline?: boolean;\n}\n\n/** Centres its children on both axes. */\nexport function Center({ as = 'div', inline, className, render, ref, ...props }: CenterProps) {\n return useRender({\n defaultTagName: as,\n render,\n ref,\n props: mergeProps<'div'>(props, { className: cn(centerVariants({ inline }), className) }),\n });\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Stack',\n group: 'Layout',\n status: 'stable',\n description:\n 'Flex layout primitives: Stack (any direction), HStack, VStack and Center. Gap on the spacing scale (0–12), align, justify, wrap and inline; render as any block tag with `as`, or any element with `render`. Paints nothing.',\n primitive: '@base-ui/react/use-render',\n tokens: [],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const statusDotVariants = tv({\n slots: {\n root: 'inline-flex items-center gap-2 align-middle',\n dot: 'relative inline-flex shrink-0 rounded-full',\n ping: 'absolute inset-0 animate-ping rounded-full opacity-60 motion-reduce:hidden motion-reduce:animate-none',\n label: 'text-[12.5px] leading-5 font-medium text-foreground',\n },\n variants: {\n tone: {\n success: { dot: 'bg-success', ping: 'bg-success' },\n warning: { dot: 'bg-warning', ping: 'bg-warning' },\n destructive: { dot: 'bg-destructive', ping: 'bg-destructive' },\n info: { dot: 'bg-info', ping: 'bg-info' },\n neutral: { dot: 'bg-muted-foreground', ping: 'bg-muted-foreground' },\n primary: { dot: 'bg-primary', ping: 'bg-primary' },\n },\n size: {\n sm: { dot: 'size-1.5', label: 'text-[12px]' },\n md: { dot: 'size-2' },\n lg: { dot: 'size-2.5', label: 'text-[13px]' },\n },\n },\n defaultVariants: { tone: 'neutral', size: 'md' },\n});\n\nexport type StatusDotVariantProps = VariantProps<typeof statusDotVariants>;\nexport type StatusDotTone = NonNullable<StatusDotVariantProps['tone']>;\n","import type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { statusDotVariants, type StatusDotVariantProps } from './status-dot.variants';\n\nexport interface StatusDotProps\n extends Omit<HTMLAttributes<HTMLSpanElement>, 'className' | 'children'>, StatusDotVariantProps {\n className?: string;\n ref?: Ref<HTMLSpanElement>;\n /** Visible text next to the dot. Without it, pass `aria-label` (or keep the dot decorative). */\n label?: ReactNode;\n /** Soft ping animation for live / in-progress states. Off under prefers-reduced-motion. */\n pulse?: boolean;\n}\n\n/**\n * Small state indicator: a coloured dot with an optional label. Colour is never the only\n * signal — give it a `label` or an `aria-label` (then it is exposed as role=\"img\").\n */\nexport function StatusDot({ tone, size, label, pulse = false, className, ...props }: StatusDotProps) {\n const s = statusDotVariants({ tone, size });\n const named = label == null && props['aria-label'] != null;\n return (\n <span\n role={named ? 'img' : undefined}\n aria-hidden={label == null && !named ? true : undefined}\n data-tone={tone ?? 'neutral'}\n className={cn(s.root(), className)}\n {...props}\n >\n <span aria-hidden className={s.dot()}>\n {pulse && <span data-pulse className={s.ping()} />}\n </span>\n {label != null && <span className={s.label()}>{label}</span>}\n </span>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'StatusDot',\n group: 'Display',\n status: 'beta',\n description:\n 'State dot with an optional label and a soft pulse for live states (disabled under reduced motion). Tones: success, warning, destructive, info, neutral, primary — generic, with no product-specific states. Without a label it needs an aria-label (exposed as an image) so colour is never the only signal.',\n pattern: 'img (when unlabelled)',\n tokens: ['success', 'warning', 'destructive', 'info', 'muted-foreground', 'primary', 'foreground'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\nimport type { BadgeTone } from '../Badge/badge.variants';\n\n/** Layout on top of the Badge styles: optional uppercase kicker style. */\nexport const statusTagVariants = tv({\n base: 'tracking-wide',\n variants: {\n uppercase: { true: 'uppercase', false: '' },\n },\n defaultVariants: { uppercase: false },\n});\n\nexport type StatusTagVariantProps = VariantProps<typeof statusTagVariants>;\n\nexport interface StatusDefinition {\n /** Visible label. */\n label: string;\n /** Badge tone the state maps to. */\n tone: BadgeTone;\n}\n\n/** Generic lifecycle states. Extend or override per product with the `statuses` prop. */\nexport const DEFAULT_STATUSES: Record<string, StatusDefinition> = {\n running: { label: 'Running', tone: 'success' },\n succeeded: { label: 'Succeeded', tone: 'success' },\n queued: { label: 'Queued', tone: 'info' },\n pending: { label: 'Pending', tone: 'neutral' },\n paused: { label: 'Paused', tone: 'neutral' },\n draft: { label: 'Draft', tone: 'neutral' },\n degraded: { label: 'Degraded', tone: 'warning' },\n failed: { label: 'Failed', tone: 'destructive' },\n};\n","import type { Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { Badge, type BadgeProps } from '../Badge/Badge';\nimport {\n DEFAULT_STATUSES,\n statusTagVariants,\n type StatusDefinition,\n type StatusTagVariantProps,\n} from './statusTag.variants';\n\nexport interface StatusTagProps\n extends Omit<BadgeProps, 'tone' | 'dot' | 'onRemove' | 'removeLabel' | 'children'>, StatusTagVariantProps {\n ref?: Ref<HTMLSpanElement>;\n /** State key, looked up in `statuses` (then the generic defaults). */\n status: string;\n /** Extra or overriding state → { label, tone } entries. */\n statuses?: Record<string, StatusDefinition>;\n /** Overrides the mapped label. */\n label?: string;\n}\n\n/**\n * State pill with a dot. The state → tone mapping is a dictionary prop, merged over a small\n * set of generic states; unknown states fall back to a neutral tag showing the raw key.\n */\nexport function StatusTag({ status, statuses, label, uppercase, className, ...props }: StatusTagProps) {\n const def = statuses?.[status] ?? DEFAULT_STATUSES[status];\n const tone = def?.tone ?? 'neutral';\n return (\n <Badge tone={tone} dot data-status={status} className={cn(statusTagVariants({ uppercase }), className)} {...props}>\n {label ?? def?.label ?? status}\n </Badge>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'StatusTag',\n group: 'Display',\n status: 'stable',\n description:\n 'State pill with a dot (running, queued, paused, failed, draft…). The state → tone mapping is a prop-driven dictionary merged over generic defaults, so products add their own states without touching the component.',\n tokens: [\n 'success',\n 'success-text',\n 'info',\n 'warning',\n 'warning-text',\n 'destructive',\n 'destructive-text',\n 'muted-foreground',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const stepperVariants = tv({\n slots: {\n list: 'm-0 flex list-none p-0',\n item: 'relative flex',\n step: [\n 'group flex rounded-lg text-start outline-none',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n indicator:\n 'relative z-10 grid size-8 shrink-0 place-items-center rounded-full text-[12px] font-bold transition-colors motion-reduce:transition-none',\n text: 'flex min-w-0 flex-col',\n label: 'text-[12.5px] font-medium whitespace-nowrap',\n description: 'text-[11.5px] leading-snug text-muted-foreground',\n connector: 'overflow-hidden rounded-full bg-secondary',\n connectorFill: 'rounded-full bg-primary transition-[width,height] duration-300 motion-reduce:transition-none',\n compact: 'flex w-full flex-col gap-2',\n compactRow: 'flex items-baseline justify-between gap-3',\n compactCount: 'font-mono text-[11px] tracking-wide text-muted-foreground uppercase',\n compactLabel: 'text-[13px] font-semibold text-foreground',\n compactTrack: 'h-1 w-full overflow-hidden rounded-full bg-secondary',\n compactFill: 'h-full rounded-full bg-primary transition-[width] duration-300 motion-reduce:transition-none',\n },\n variants: {\n orientation: {\n horizontal: {\n list: 'w-full items-start',\n item: 'flex-1 items-start last:flex-none',\n step: 'flex-col items-center gap-2 px-1',\n text: 'items-center text-center',\n connector: 'mx-2 mt-[15px] h-0.5 flex-1',\n connectorFill: 'h-full',\n },\n vertical: {\n list: 'flex-col',\n item: 'flex-col',\n step: 'items-start gap-3 py-1 pe-2',\n text: 'pt-1.5',\n connector: 'my-1 ms-[15px] min-h-6 w-0.5',\n connectorFill: 'w-full',\n },\n },\n status: {\n complete: { indicator: 'bg-primary text-primary-foreground', label: 'text-foreground' },\n current: {\n indicator: 'bg-primary/14 text-primary-chip-text ring-2 ring-primary',\n label: 'font-semibold text-foreground',\n },\n upcoming: { indicator: 'bg-secondary text-muted-foreground ring-1 ring-border', label: 'text-muted-foreground' },\n error: { indicator: 'bg-destructive text-destructive-foreground', label: 'text-destructive-text' },\n },\n interactive: {\n true: {\n step: 'cursor-pointer',\n indicator: 'group-hover:bg-primary/85',\n label: 'group-hover:underline underline-offset-2',\n },\n },\n },\n defaultVariants: { orientation: 'horizontal', status: 'upcoming' },\n});\n\nexport type StepperVariantProps = VariantProps<typeof stepperVariants>;\n","import { AlertTriangle, Check } from 'lucide-react';\nimport type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport type { MessageKey } from '../../i18n/messages/en';\nimport { stepperVariants } from './stepper.variants';\n\nexport type StepStatus = 'complete' | 'current' | 'upcoming' | 'error';\n\nexport interface StepItem {\n /** Stable key; defaults to the index. */\n id?: string;\n label: ReactNode;\n description?: ReactNode;\n /** Explicit status. Without it, steps before `current` are complete and later ones upcoming. */\n status?: StepStatus;\n}\n\nexport interface StepperProps extends Omit<HTMLAttributes<HTMLElement>, 'className' | 'onChange'> {\n className?: string;\n ref?: Ref<HTMLElement>;\n steps: StepItem[];\n /** Zero-based index of the current step. */\n current?: number;\n orientation?: 'horizontal' | 'vertical';\n /** Makes completed steps buttons that call this with their index (go back to edit). */\n onStepClick?: (index: number) => void;\n /** Single-line \"Step 2 of 5\" summary with a thin progress bar instead of the full list. */\n compact?: boolean;\n /** Accessible name of the step list. */\n label?: string;\n /** Visually hidden status words appended to each step (for localisation). */\n statusText?: Partial<Record<StepStatus, string>>;\n /** Compact summary text. */\n formatCount?: (step: number, total: number) => string;\n}\n\nconst STATUS_KEYS = {\n complete: 'stepper.complete',\n current: 'stepper.current',\n upcoming: 'stepper.upcoming',\n error: 'stepper.error',\n} as const satisfies Record<StepStatus, MessageKey>;\n\n/** Resolves each step's status from `current` unless set explicitly. */\nexport function resolveStepStatus(steps: StepItem[], current: number): StepStatus[] {\n return steps.map((s, i) => s.status ?? (i < current ? 'complete' : i === current ? 'current' : 'upcoming'));\n}\n\n/**\n * Wizard progress: an ordered list of steps (complete · current · upcoming · error), horizontal\n * or vertical. The current step carries `aria-current=\"step\"`. With `onStepClick`, completed\n * steps become buttons; `compact` collapses it to \"Step 2 of 5\".\n */\nexport function Stepper({\n steps,\n current = 0,\n orientation = 'horizontal',\n onStepClick,\n compact = false,\n label: labelProp,\n statusText,\n formatCount: formatCountProp,\n className,\n ...props\n}: StepperProps) {\n const { t } = useI18n();\n const label = labelProp ?? t('common.progress');\n const statuses = resolveStepStatus(steps, current);\n const formatCount = formatCountProp ?? ((step: number, total: number) => t('stepper.step', { step, total }));\n const words: Record<StepStatus, string> = {\n complete: statusText?.complete ?? t(STATUS_KEYS.complete),\n current: statusText?.current ?? t(STATUS_KEYS.current),\n upcoming: statusText?.upcoming ?? t(STATUS_KEYS.upcoming),\n error: statusText?.error ?? t(STATUS_KEYS.error),\n };\n const total = steps.length;\n const base = stepperVariants({ orientation });\n\n if (compact) {\n const index = Math.min(Math.max(current, 0), Math.max(total - 1, 0));\n const step = steps[index];\n const pct = total ? ((index + 1) / total) * 100 : 0;\n return (\n <nav aria-label={label} className={cn(base.compact(), className)} {...props}>\n <div className={base.compactRow()} aria-current=\"step\">\n <span className={base.compactLabel()}>{step?.label}</span>\n <span className={base.compactCount()}>{formatCount(index + 1, total)}</span>\n </div>\n <div className={base.compactTrack()} aria-hidden>\n <div className={base.compactFill()} style={{ width: `${pct}%` }} />\n </div>\n </nav>\n );\n }\n\n return (\n <nav aria-label={label} className={className} {...props}>\n <ol className={base.list()}>\n {steps.map((step, i) => {\n const status = statuses[i] ?? 'upcoming';\n const clickable = Boolean(onStepClick) && status === 'complete';\n const v = stepperVariants({ orientation, status, interactive: clickable });\n const content = (\n <>\n <span className={v.indicator()} aria-hidden>\n {status === 'complete' ? (\n <Check size={16} strokeWidth={2.6} />\n ) : status === 'error' ? (\n <AlertTriangle size={15} />\n ) : (\n i + 1\n )}\n </span>\n <span className={v.text()}>\n <span className={v.label()}>\n {step.label}\n <span className=\"sr-only\">, {words[status]}</span>\n </span>\n {step.description && <span className={v.description()}>{step.description}</span>}\n </span>\n </>\n );\n const currentAttr = status === 'current' ? ('step' as const) : undefined;\n return (\n <li key={step.id ?? i} className={v.item()}>\n {clickable ? (\n <button type=\"button\" className={v.step()} aria-current={currentAttr} onClick={() => onStepClick?.(i)}>\n {content}\n </button>\n ) : (\n <div className={v.step()} aria-current={currentAttr}>\n {content}\n </div>\n )}\n {i < total - 1 && (\n <div className={v.connector()} aria-hidden>\n <div\n className={v.connectorFill()}\n style={\n orientation === 'horizontal'\n ? { width: status === 'complete' ? '100%' : '0%' }\n : { height: status === 'complete' ? '100%' : '0%' }\n }\n />\n </div>\n )}\n </li>\n );\n })}\n </ol>\n </nav>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Stepper',\n group: 'Navigation',\n status: 'beta',\n description:\n 'Wizard progress as an ordered list of steps (complete · current · upcoming · error), horizontal or vertical, with optional descriptions. Completed steps can be made clickable to go back; `compact` collapses it to \"Step 2 of 5\" with a thin bar. The current step carries aria-current=\"step\".',\n pattern: 'ordered list in a labelled navigation landmark',\n keyboard: [\n ['Tab', 'Moves between clickable (completed) steps; other steps are not focusable'],\n ['Enter / Space', 'Activates the focused completed step (onStepClick)'],\n ],\n tokens: [\n 'primary',\n 'primary-foreground',\n 'primary-text',\n 'secondary',\n 'border',\n 'destructive',\n 'destructive-foreground',\n 'destructive-text',\n 'muted-foreground',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const switchVariants = tv({\n slots: {\n root: [\n 'relative inline-flex shrink-0 cursor-pointer items-center rounded-full bg-secondary transition-colors',\n 'data-checked:bg-primary',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n 'data-disabled:cursor-not-allowed data-disabled:opacity-50',\n ],\n thumb:\n 'pointer-events-none ms-[2px] grid place-items-center rounded-full bg-background shadow-sm transition-transform motion-reduce:transition-none',\n label: 'inline-flex items-center gap-2.5 text-[13px] text-foreground',\n },\n variants: {\n size: {\n sm: {\n root: 'h-[18px] w-8',\n thumb: 'size-3.5 data-checked:translate-x-[14px] rtl:data-checked:-translate-x-[14px]',\n },\n md: {\n root: 'h-[22px] w-[40px]',\n thumb: 'size-[18px] data-checked:translate-x-[18px] rtl:data-checked:-translate-x-[18px]',\n },\n lg: {\n root: 'h-[26px] w-[46px]',\n thumb: 'size-[22px] data-checked:translate-x-[20px] rtl:data-checked:-translate-x-[20px]',\n },\n },\n },\n defaultVariants: { size: 'md' },\n});\n\nexport type SwitchVariantProps = VariantProps<typeof switchVariants>;\n","import { Switch as BaseSwitch } from '@base-ui/react/switch';\nimport type { ReactNode, Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { switchVariants, type SwitchVariantProps } from './switch.variants';\n\nexport interface SwitchProps extends Omit<BaseSwitch.Root.Props, 'className'>, SwitchVariantProps {\n className?: string;\n ref?: Ref<HTMLButtonElement>;\n /** Visible label. Without it, pass `aria-label` or wrap in a Field. */\n label?: ReactNode;\n /** Label placement relative to the track. */\n labelPosition?: 'start' | 'end';\n}\n\n/** On/off setting. Controlled with `checked` + `onCheckedChange`, or uncontrolled with `defaultChecked`. */\nexport function Switch({ size, label, labelPosition = 'end', className, ...props }: SwitchProps) {\n const s = switchVariants({ size });\n const control = (\n <BaseSwitch.Root className={cn(s.root(), !label && className)} {...props}>\n <BaseSwitch.Thumb className={s.thumb()} />\n </BaseSwitch.Root>\n );\n if (!label) return control;\n return (\n <label className={cn(s.label(), props.disabled && 'opacity-70', className)}>\n {labelPosition === 'start' && label}\n {control}\n {labelPosition === 'end' && label}\n </label>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Switch',\n group: 'Forms',\n status: 'stable',\n description:\n 'On/off setting that applies immediately. Three sizes, optional inline label, works inside Field and Form.',\n primitive: '@base-ui/react/switch',\n pattern: 'switch',\n keyboard: [\n ['Space', 'Toggles the switch'],\n ['Enter', 'Toggles the switch'],\n ['Tab', 'Moves focus to and from the switch'],\n ],\n tokens: ['primary', 'secondary', 'background', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\n/**\n * Semantic table. Borders live on the cells (border-separate) so a sticky header keeps its\n * bottom rule while the body scrolls underneath.\n */\nexport const tableVariants = tv({\n slots: {\n container:\n 'relative w-full overflow-auto focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n table: 'w-full border-separate border-spacing-0 text-start text-[13px] text-foreground',\n header: '',\n body: '[&>tr:last-child>td]:border-b-0',\n footer: 'font-medium [&>tr>td]:border-t [&>tr>td]:border-b-0 [&>tr>td]:border-border [&>tr>td]:bg-secondary/30',\n row: 'transition-colors motion-reduce:transition-none hover:bg-accent/30 data-[selected]:bg-primary/8 data-[selected]:hover:bg-primary/12',\n head: 'border-b border-border px-4 align-middle text-[11.5px] font-medium tracking-wide whitespace-nowrap text-muted-foreground uppercase',\n sortButton: [\n 'inline-flex cursor-pointer items-center gap-1 rounded-sm uppercase tracking-wide transition-colors motion-reduce:transition-none hover:text-foreground',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n cell: 'border-b border-border px-4 align-middle',\n caption: 'caption-bottom px-4 py-3 text-start text-[12px] text-muted-foreground',\n },\n variants: {\n density: {\n compact: { head: 'h-9', cell: 'py-2' },\n comfortable: { head: 'h-10', cell: 'py-3' },\n },\n sticky: {\n true: { head: 'sticky top-0 z-10 bg-card' },\n false: { head: 'bg-secondary/30' },\n },\n align: {\n left: { head: 'text-start', cell: 'text-start' },\n right: { head: 'text-end', cell: 'text-end tabular-nums', sortButton: 'flex-row-reverse' },\n center: { head: 'text-center', cell: 'text-center' },\n },\n active: {\n true: { sortButton: 'text-foreground' },\n },\n },\n defaultVariants: { density: 'comfortable', sticky: false, align: 'left' },\n});\n\nexport type TableVariantProps = VariantProps<typeof tableVariants>;\nexport type TableDensity = NonNullable<TableVariantProps['density']>;\nexport type SortDirection = 'ascending' | 'descending' | 'none';\n\n/** Next aria-sort value when a sortable header is activated: none → ascending ⇄ descending. */\nexport function nextSortDirection(current: SortDirection): Exclude<SortDirection, 'none'> {\n return current === 'ascending' ? 'descending' : 'ascending';\n}\n","import { ArrowDown, ArrowUp, ChevronsUpDown } from 'lucide-react';\nimport {\n createContext,\n useCallback,\n useContext,\n useState,\n type HTMLAttributes,\n type Ref,\n type TdHTMLAttributes,\n type ThHTMLAttributes,\n} from 'react';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { useDensity } from '../../density/density-context';\nimport { cn } from '../../utils/cn';\nimport { nextSortDirection, tableVariants, type SortDirection, type TableDensity } from './table.variants';\n\nconst TableContext = createContext<{ density: TableDensity; sticky: boolean }>({\n density: 'comfortable',\n sticky: false,\n});\nconst s = tableVariants();\n\nexport interface TableProps extends Omit<HTMLAttributes<HTMLTableElement>, 'className'> {\n className?: string;\n ref?: Ref<HTMLTableElement>;\n /** Row height: `compact` for dense data, `comfortable` for scanning. Defaults to the DensityProvider's density (comfortable outside one). */\n density?: TableDensity;\n /** Pins the header row while the container scrolls. Give the container a max height. */\n stickyHeader?: boolean;\n /** Classes for the scroll container (e.g. `max-h-80` with stickyHeader). */\n containerClassName?: string;\n /** Accessible name of the scroll container when it is focusable (it scrolls, or stickyHeader). */\n containerLabel?: string;\n}\n\n/** Semantic data table in a horizontally scrollable container. */\nexport function Table({\n density: densityProp,\n stickyHeader = false,\n containerClassName,\n containerLabel,\n className,\n ...props\n}: TableProps) {\n const { t } = useI18n();\n const contextDensity = useDensity();\n const density = densityProp ?? contextDensity;\n // A container that actually scrolls must be reachable from the keyboard (WCAG 2.1.1).\n const [overflows, setOverflows] = useState(false);\n const measure = useCallback((el: HTMLDivElement | null) => {\n if (!el || typeof ResizeObserver === 'undefined') return undefined;\n const check = () => setOverflows(el.scrollWidth > el.clientWidth + 1 || el.scrollHeight > el.clientHeight + 1);\n const ro = new ResizeObserver(check);\n ro.observe(el);\n if (el.firstElementChild) ro.observe(el.firstElementChild);\n return () => ro.disconnect();\n }, []);\n const focusable = stickyHeader || overflows;\n return (\n <TableContext value={{ density, sticky: stickyHeader }}>\n <div\n ref={measure}\n className={cn(s.container(), containerClassName)}\n tabIndex={focusable ? 0 : undefined}\n role={focusable ? 'region' : undefined}\n aria-label={focusable ? (containerLabel ?? t('table.scrollable')) : undefined}\n >\n <table data-density={density} className={cn(s.table(), className)} {...props} />\n </div>\n </TableContext>\n );\n}\n\ntype SectionProps = Omit<HTMLAttributes<HTMLTableSectionElement>, 'className'> & {\n className?: string;\n ref?: Ref<HTMLTableSectionElement>;\n};\n\nexport function TableHeader({ className, ...props }: SectionProps) {\n return <thead className={cn(s.header(), className)} {...props} />;\n}\n\nexport function TableBody({ className, ...props }: SectionProps) {\n return <tbody className={cn(s.body(), className)} {...props} />;\n}\n\nexport function TableFooter({ className, ...props }: SectionProps) {\n return <tfoot className={cn(s.footer(), className)} {...props} />;\n}\n\nexport interface TableRowProps extends Omit<HTMLAttributes<HTMLTableRowElement>, 'className'> {\n className?: string;\n ref?: Ref<HTMLTableRowElement>;\n /** Highlights the row (sets data-selected). Pair with a checkbox that carries the state. */\n selected?: boolean;\n}\n\nexport function TableRow({ selected, className, ...props }: TableRowProps) {\n return <tr data-selected={selected || undefined} className={cn(s.row(), className)} {...props} />;\n}\n\ntype Align = 'left' | 'right' | 'center';\n\nexport interface TableHeadProps extends Omit<ThHTMLAttributes<HTMLTableCellElement>, 'className'> {\n className?: string;\n ref?: Ref<HTMLTableCellElement>;\n align?: Align;\n /** Makes the header a sort button and sets aria-sort. */\n sortable?: boolean;\n /** Current sort of this column (controlled). */\n sortDirection?: SortDirection;\n /** Called with the next direction (none → ascending ⇄ descending) on click, Enter or Space. */\n onSortChange?: (direction: Exclude<SortDirection, 'none'>) => void;\n}\n\n/** Column header. With `sortable`, its content becomes a button and the cell exposes aria-sort. */\nexport function TableHead({\n align = 'left',\n sortable = false,\n sortDirection = 'none',\n onSortChange,\n scope = 'col',\n className,\n children,\n ...props\n}: TableHeadProps) {\n const { density, sticky } = useContext(TableContext);\n const v = tableVariants({ density, sticky, align, active: sortDirection !== 'none' });\n const SortIcon =\n sortDirection === 'ascending' ? ArrowUp : sortDirection === 'descending' ? ArrowDown : ChevronsUpDown;\n return (\n <th scope={scope} aria-sort={sortable ? sortDirection : undefined} className={cn(v.head(), className)} {...props}>\n {sortable ? (\n <button\n type=\"button\"\n className={v.sortButton()}\n onClick={() => onSortChange?.(nextSortDirection(sortDirection))}\n >\n {children}\n <SortIcon size={13} aria-hidden className={sortDirection === 'none' ? 'opacity-40' : undefined} />\n </button>\n ) : (\n children\n )}\n </th>\n );\n}\n\nexport interface TableCellProps extends Omit<TdHTMLAttributes<HTMLTableCellElement>, 'className' | 'align'> {\n className?: string;\n ref?: Ref<HTMLTableCellElement>;\n align?: Align;\n}\n\nexport function TableCell({ align = 'left', className, ...props }: TableCellProps) {\n const { density } = useContext(TableContext);\n return <td className={cn(tableVariants({ density, align }).cell(), className)} {...props} />;\n}\n\nexport interface TableCaptionProps extends Omit<HTMLAttributes<HTMLTableCaptionElement>, 'className'> {\n className?: string;\n ref?: Ref<HTMLTableCaptionElement>;\n /** Keeps the caption for screen readers only. */\n srOnly?: boolean;\n}\n\n/** Table name and summary, shown under the table (or screen-reader only). */\nexport function TableCaption({ srOnly = false, className, ...props }: TableCaptionProps) {\n return <caption className={cn(srOnly ? 'sr-only' : s.caption(), className)} {...props} />;\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Table',\n group: 'Display',\n status: 'stable',\n description:\n 'Styled semantic table parts: Table, TableHeader, TableBody, TableFooter, TableRow (selected state), TableHead (optional sort button with aria-sort), TableCell and TableCaption. Compact or comfortable density and an optional sticky header.',\n pattern: 'table (sortable columns)',\n keyboard: [\n ['Tab', 'Moves focus between sortable column headers and interactive cells'],\n ['Enter', 'On a sortable header: sorts ascending, then toggles ascending ⇄ descending (aria-sort)'],\n ['Space', 'On a sortable header: same as Enter'],\n ],\n tokens: ['border', 'card', 'secondary', 'accent', 'primary', 'foreground', 'muted-foreground', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const tabsVariants = tv({\n slots: {\n root: 'flex flex-col gap-4',\n list: 'relative',\n tab: [\n 'group relative z-[1] inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 font-medium whitespace-nowrap select-none',\n 'text-muted-foreground transition-colors hover:text-foreground data-active:text-foreground',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n 'data-disabled:pointer-events-none data-disabled:opacity-50',\n ],\n icon: 'shrink-0 transition-colors group-data-active:text-primary-text',\n count: [\n 'inline-flex h-[18px] items-center rounded-full px-1.5 font-mono text-[10.5px] leading-none transition-colors',\n 'bg-secondary text-muted-foreground group-data-active:bg-primary/14 group-data-active:text-primary-chip-text',\n ],\n indicator:\n 'absolute top-0 start-0 transition-[translate,width,height] duration-200 ease-out motion-reduce:transition-none',\n panel:\n 'text-[13px] text-foreground outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring rounded-sm',\n },\n variants: {\n variant: {\n underline: {\n list: 'flex items-center gap-6 border-b border-border',\n tab: 'h-tab -mb-px border-b-2 border-transparent text-[13px] rounded-t-sm',\n indicator: 'top-auto -bottom-px h-0.5 w-(--active-tab-width) translate-x-(--active-tab-left) bg-primary',\n },\n pills: {\n list: 'inline-flex items-center gap-1 rounded-lg border border-border bg-secondary/40 p-1',\n tab: 'h-control-sm rounded-md px-control text-[12.5px]',\n indicator:\n 'z-0 h-(--active-tab-height) w-(--active-tab-width) translate-x-(--active-tab-left) translate-y-(--active-tab-top) rounded-md bg-card shadow-sm',\n },\n },\n /** When false, the active tab is styled statically instead of by the sliding indicator. */\n indicator: { true: {}, false: {} },\n fullWidth: { true: { list: 'grid w-full auto-cols-fr grid-flow-col' }, false: {} },\n },\n compoundVariants: [\n { variant: 'underline', indicator: false, class: { tab: 'data-active:border-primary' } },\n { variant: 'pills', indicator: false, class: { tab: 'data-active:bg-card data-active:shadow-sm' } },\n { variant: 'pills', fullWidth: true, class: { tab: 'h-control' } },\n ],\n defaultVariants: { variant: 'underline', indicator: true, fullWidth: false },\n});\n\nexport type TabsVariantProps = VariantProps<typeof tabsVariants>;\n","import { Tabs as BaseTabs } from '@base-ui/react/tabs';\nimport { createContext, useContext, type ComponentType, type ReactNode, type Ref } from 'react';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { tabsVariants } from './tabs.variants';\n\ntype IconComponent = ComponentType<{ size?: number; className?: string; 'aria-hidden'?: boolean }>;\ntype TabsVariant = 'underline' | 'pills';\n\ninterface TabsContextValue {\n variant: TabsVariant;\n indicator: boolean;\n fullWidth: boolean;\n}\n\nconst TabsContext = createContext<TabsContextValue>({ variant: 'underline', indicator: true, fullWidth: false });\n\nexport interface TabsProps extends Omit<BaseTabs.Root.Props, 'className'> {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n /** Visual style: an underline bar (default) or pills inside a container. */\n variant?: TabsVariant;\n}\n\n/**\n * Tab set. Controlled with `value` + `onValueChange`, or uncontrolled with `defaultValue`.\n * Arrow keys move between tabs; Enter or Space activates (or pass `activateOnFocus` to TabsList).\n */\nexport function Tabs({ variant = 'underline', className, children, ...props }: TabsProps) {\n const ctx = useContext(TabsContext);\n return (\n <TabsContext.Provider value={{ ...ctx, variant }}>\n <BaseTabs.Root className={cn(tabsVariants({ variant }).root(), className)} {...props}>\n {children}\n </BaseTabs.Root>\n </TabsContext.Provider>\n );\n}\n\nexport interface TabsListProps extends Omit<BaseTabs.List.Props, 'className'> {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n /** Render the sliding TabsIndicator automatically. When false the active tab is styled statically. */\n indicator?: boolean;\n /** Stretch the tabs into equal columns that fill the width. */\n fullWidth?: boolean;\n /** Accessible name for the tab list (recommended when the page has several tab sets). */\n 'aria-label'?: string;\n}\n\n/** The row of tabs (role=\"tablist\"). */\nexport function TabsList({ indicator = true, fullWidth = false, className, children, ...props }: TabsListProps) {\n const { variant } = useContext(TabsContext);\n const s = tabsVariants({ variant, indicator, fullWidth });\n return (\n <TabsContext.Provider value={{ variant, indicator, fullWidth }}>\n <BaseTabs.List className={cn(s.list(), className)} {...props}>\n {children}\n {indicator && <TabsIndicator />}\n </BaseTabs.List>\n </TabsContext.Provider>\n );\n}\n\nexport interface TabsTabProps extends Omit<BaseTabs.Tab.Props, 'className'> {\n className?: string;\n ref?: Ref<HTMLButtonElement>;\n /** Leading icon (a lucide icon component); turns brand green when active. */\n icon?: IconComponent;\n /** Count badge shown after the label (numbers are formatted with thousands separators). */\n count?: number | string;\n children?: ReactNode;\n}\n\n/** A single tab (role=\"tab\"). `value` links it to the TabsPanel with the same value. */\nexport function TabsTab({ icon: IconCmp, count, className, children, ...props }: TabsTabProps) {\n const { variant, indicator, fullWidth } = useContext(TabsContext);\n const { locale } = useI18n();\n const s = tabsVariants({ variant, indicator, fullWidth });\n return (\n <BaseTabs.Tab className={cn(s.tab(), className)} {...props}>\n {IconCmp && <IconCmp size={variant === 'pills' ? 15 : 16} className={s.icon()} aria-hidden />}\n {children}\n {count != null && (\n <span className={s.count()}>{typeof count === 'number' ? count.toLocaleString(locale) : count}</span>\n )}\n </BaseTabs.Tab>\n );\n}\n\nexport interface TabsIndicatorProps extends Omit<BaseTabs.Indicator.Props, 'className'> {\n className?: string;\n}\n\n/** Sliding marker under (underline) or behind (pills) the active tab. TabsList renders one by default. */\nexport function TabsIndicator({ className, ...props }: TabsIndicatorProps) {\n const { variant } = useContext(TabsContext);\n return <BaseTabs.Indicator className={cn(tabsVariants({ variant }).indicator(), className)} {...props} />;\n}\n\nexport interface TabsPanelProps extends Omit<BaseTabs.Panel.Props, 'className'> {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n}\n\n/** Content for one tab (role=\"tabpanel\"), labelled by its tab. */\nexport function TabsPanel({ className, ...props }: TabsPanelProps) {\n return <BaseTabs.Panel className={cn(tabsVariants().panel(), className)} {...props} />;\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Tabs',\n group: 'Navigation',\n status: 'stable',\n description:\n 'Switches between views of the same block without leaving the page. Two variants (underline, pills), optional icons and count badges, a sliding indicator and a full-width layout. Compound parts: Tabs, TabsList, TabsTab, TabsIndicator, TabsPanel.',\n primitive: '@base-ui/react/tabs',\n pattern: 'tabs',\n keyboard: [\n ['ArrowRight / ArrowLeft', 'Moves focus to the next / previous tab (wraps around)'],\n ['Home / End', 'Moves focus to the first / last tab'],\n ['Enter / Space', 'Activates the focused tab and shows its panel'],\n ['Tab', 'Moves focus from the active tab into its panel'],\n ],\n tokens: ['primary', 'primary-text', 'border', 'secondary', 'card', 'muted-foreground', 'foreground', 'focus-ring'],\n};\n","/**\n * ANSI escape handling for Terminal: SGR (`ESC[…m`) styles become segments; every other escape\n * sequence (cursor moves, OSC titles / links, …) is dropped. Colours map to TOKEN classes only.\n */\n\nexport const ANSI_COLORS = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white'] as const;\nexport type AnsiBaseColor = (typeof ANSI_COLORS)[number];\n/** The 8 normal colours and their 8 bright variants (`brightRed`…). 256 / true colours snap to these. */\nexport type AnsiColor = AnsiBaseColor | `bright${Capitalize<AnsiBaseColor>}`;\n\nexport interface AnsiStyle {\n fg?: AnsiColor;\n bg?: AnsiColor;\n bold?: boolean;\n dim?: boolean;\n italic?: boolean;\n underline?: boolean;\n inverse?: boolean;\n strikethrough?: boolean;\n}\n\nexport interface AnsiSegment extends AnsiStyle {\n text: string;\n}\n\nconst ESC = 27;\nconst BEL = 7;\n\nconst bright = (c: AnsiBaseColor): AnsiColor => `bright${c[0]?.toUpperCase()}${c.slice(1)}` as AnsiColor;\nconst color = (index: number, isBright: boolean): AnsiColor | undefined => {\n const base = ANSI_COLORS[index];\n if (!base) return undefined;\n return isBright ? bright(base) : base;\n};\n\n/** RGB (0–255) → nearest of the 16 colours: each channel on/off, bright when any channel is high. */\nfunction snapRgb(r: number, g: number, b: number): AnsiColor | undefined {\n const index = (r >= 128 ? 1 : 0) | (g >= 128 ? 2 : 0) | (b >= 128 ? 4 : 0);\n const max = Math.max(r, g, b);\n if (index === 0) return max >= 64 ? 'brightBlack' : 'black';\n return color(index, max >= 200 && index !== 7 ? true : index === 7 && max >= 230);\n}\n\n/** xterm 256-colour index → one of the 16. */\nfunction snap256(n: number): AnsiColor | undefined {\n if (n < 8) return color(n, false);\n if (n < 16) return color(n - 8, true);\n if (n >= 232) {\n const level = 8 + (n - 232) * 10;\n return level < 64 ? 'black' : level < 160 ? 'brightBlack' : level < 230 ? 'white' : 'brightWhite';\n }\n const cube = n - 16;\n const steps = [0, 95, 135, 175, 215, 255];\n return snapRgb(steps[Math.floor(cube / 36) % 6] ?? 0, steps[Math.floor(cube / 6) % 6] ?? 0, steps[cube % 6] ?? 0);\n}\n\n/** Applies one SGR parameter list to a style (mutates `style`). */\nfunction applySgr(style: AnsiStyle, params: number[]) {\n if (params.length === 0) params = [0];\n for (let i = 0; i < params.length; i++) {\n const p = params[i] ?? 0;\n if (p === 0) {\n for (const key of Object.keys(style) as Array<keyof AnsiStyle>) delete style[key];\n } else if (p === 1) style.bold = true;\n else if (p === 2) style.dim = true;\n else if (p === 3) style.italic = true;\n else if (p === 4) style.underline = true;\n else if (p === 7) style.inverse = true;\n else if (p === 9) style.strikethrough = true;\n else if (p === 21 || p === 22) {\n delete style.bold;\n delete style.dim;\n } else if (p === 23) delete style.italic;\n else if (p === 24) delete style.underline;\n else if (p === 27) delete style.inverse;\n else if (p === 29) delete style.strikethrough;\n else if (p >= 30 && p <= 37) style.fg = color(p - 30, false);\n else if (p >= 90 && p <= 97) style.fg = color(p - 90, true);\n else if (p === 39) delete style.fg;\n else if (p >= 40 && p <= 47) style.bg = color(p - 40, false);\n else if (p >= 100 && p <= 107) style.bg = color(p - 100, true);\n else if (p === 49) delete style.bg;\n else if (p === 38 || p === 48) {\n const mode = params[i + 1];\n let value: AnsiColor | undefined;\n if (mode === 5) {\n value = snap256(params[i + 2] ?? 0);\n i += 2;\n } else if (mode === 2) {\n value = snapRgb(params[i + 2] ?? 0, params[i + 3] ?? 0, params[i + 4] ?? 0);\n i += 4;\n } else {\n i += 1;\n }\n if (p === 38) style.fg = value;\n else style.bg = value;\n }\n }\n}\n\nconst sameStyle = (a: AnsiStyle, b: AnsiStyle) =>\n a.fg === b.fg &&\n a.bg === b.bg &&\n !!a.bold === !!b.bold &&\n !!a.dim === !!b.dim &&\n !!a.italic === !!b.italic &&\n !!a.underline === !!b.underline &&\n !!a.inverse === !!b.inverse &&\n !!a.strikethrough === !!b.strikethrough;\n\nconst snapshot = (style: AnsiStyle): AnsiStyle => {\n const out: AnsiStyle = {};\n for (const [key, value] of Object.entries(style) as Array<[keyof AnsiStyle, AnsiStyle[keyof AnsiStyle]]>) {\n if (value !== undefined && value !== false) (out as Record<string, unknown>)[key] = value;\n }\n return out;\n};\n\n/**\n * Parses text with ANSI escapes into styled segments, starting from `initial` (the style carried\n * over from earlier output). Returns the segments and the style in effect at the end.\n */\nexport function parseAnsiState(text: string, initial: AnsiStyle = {}): { segments: AnsiSegment[]; style: AnsiStyle } {\n const segments: AnsiSegment[] = [];\n const style: AnsiStyle = { ...initial };\n let current = snapshot(style);\n let buffer = '';\n const flush = () => {\n if (!buffer) return;\n const last = segments[segments.length - 1];\n if (last && sameStyle(last, current)) last.text += buffer;\n else segments.push({ ...current, text: buffer });\n buffer = '';\n };\n let i = 0;\n while (i < text.length) {\n const code = text.charCodeAt(i);\n if (code === ESC) {\n const kind = text[i + 1];\n if (kind === '[') {\n let j = i + 2;\n while (j < text.length && !(text.charCodeAt(j) >= 0x40 && text.charCodeAt(j) <= 0x7e)) j++;\n if (text[j] === 'm') {\n const raw = text.slice(i + 2, j);\n const params = raw === '' ? [] : raw.split(/[;:]/).map((n) => (n === '' ? 0 : Number.parseInt(n, 10) || 0));\n flush();\n applySgr(style, params);\n current = snapshot(style);\n }\n i = j + 1;\n } else if (kind === ']') {\n let j = i + 2;\n while (j < text.length && text.charCodeAt(j) !== BEL && !(text.charCodeAt(j) === ESC && text[j + 1] === '\\\\'))\n j++;\n i = text.charCodeAt(j) === BEL ? j + 1 : j + 2;\n } else {\n i += 2;\n }\n continue;\n }\n // Drop other C0 controls except tab and newline.\n if (code < 32 && code !== 9 && code !== 10) {\n i++;\n continue;\n }\n buffer += text[i];\n i++;\n }\n flush();\n return { segments, style: snapshot(style) };\n}\n\n/** Parses text with ANSI SGR escapes into styled segments (other escapes are dropped). */\nexport function parseAnsi(text: string, initial?: AnsiStyle): AnsiSegment[] {\n return parseAnsiState(text, initial).segments;\n}\n\n/** The text without any escape sequence. */\nexport function stripAnsi(text: string): string {\n return parseAnsi(text)\n .map((s) => s.text)\n .join('');\n}\n\n/**\n * ANSI colour → token text class. Only contrast-safe tokens: blue and cyan both use `text-info`\n * (the category cyan is below AA on the light theme); bright variants reuse their base token.\n */\nexport const ANSI_TEXT_CLASS: Record<AnsiBaseColor, string> = {\n black: 'text-muted-foreground',\n red: 'text-destructive-text',\n green: 'text-success-text',\n yellow: 'text-warning-text',\n blue: 'text-info',\n magenta: 'text-category-violet',\n cyan: 'text-info',\n white: 'text-foreground',\n};\n\n/** ANSI background → token tint (text keeps its own token, so it stays readable). */\nexport const ANSI_BG_CLASS: Record<AnsiBaseColor, string> = {\n black: 'bg-muted',\n red: 'bg-destructive/15',\n green: 'bg-success/15',\n yellow: 'bg-warning/15',\n blue: 'bg-info/15',\n magenta: 'bg-category-violet/15',\n cyan: 'bg-category-cyan/15',\n white: 'bg-foreground/10',\n};\n\nconst baseOf = (c: AnsiColor): AnsiBaseColor =>\n (c.startsWith('bright') ? c.slice(6).toLowerCase() : c) as AnsiBaseColor;\n\n/** Token classes for a segment's style (empty string for plain text). Inverse uses foreground / background. */\nexport function ansiClassName(style: AnsiStyle): string {\n const classes: string[] = [];\n if (style.inverse) classes.push('bg-foreground text-background');\n else {\n if (style.fg) classes.push(ANSI_TEXT_CLASS[baseOf(style.fg)]);\n else if (style.dim) classes.push('text-muted-foreground');\n if (style.bg) classes.push(ANSI_BG_CLASS[baseOf(style.bg)]);\n }\n if (style.bold || style.fg?.startsWith('bright')) classes.push('font-semibold');\n if (style.italic) classes.push('italic');\n if (style.underline) classes.push('underline');\n if (style.strikethrough) classes.push('line-through');\n return classes.join(' ');\n}\n","/** One line of terminal output: raw text (ANSI escapes allowed) and an optional timestamp. */\nexport type TerminalLine = string | { text: string; timestamp?: Date | number | string };\n\nexport interface BufferLine {\n text: string;\n timestamp?: number;\n}\n\nexport interface TerminalBuffer {\n lines: BufferLine[];\n /** Absolute index of `lines[0]` (lines dropped by `maxLines` keep the numbering stable). */\n first: number;\n /** The last line has no trailing newline yet: the next chunk continues it. */\n open: boolean;\n}\n\nexport const EMPTY_BUFFER: TerminalBuffer = { lines: [], first: 0, open: false };\n\n/**\n * A carriage return rewrites the line (progress bars): keep what follows the last one. A trailing\n * `\\r` on an open line is kept (the rewrite may arrive in the next chunk); on a complete line it is CRLF.\n */\nfunction collapseCarriageReturns(text: string, complete: boolean): string {\n const t = complete && text.endsWith('\\r') ? text.slice(0, -1) : text;\n const end = t.endsWith('\\r') ? t.length - 1 : t.length;\n const at = end > 0 ? t.lastIndexOf('\\r', end - 1) : -1;\n return at < 0 ? t : t.slice(at + 1);\n}\n\nexport function toBufferLine(line: TerminalLine): BufferLine {\n if (typeof line === 'string') return { text: line };\n const ts = line.timestamp === undefined ? undefined : new Date(line.timestamp).getTime();\n return { text: line.text, timestamp: Number.isNaN(ts) ? undefined : ts };\n}\n\n/** Drops the oldest lines beyond `maxLines`. */\nexport function trimBuffer(buffer: TerminalBuffer, maxLines: number): TerminalBuffer {\n const extra = buffer.lines.length - Math.max(1, maxLines);\n if (extra <= 0) return buffer;\n return { ...buffer, lines: buffer.lines.slice(extra), first: buffer.first + extra };\n}\n\n/** Appends a streamed chunk: splits on newlines, continues an open last line, honours `\\r`. */\nexport function appendChunk(buffer: TerminalBuffer, chunk: string, maxLines: number, now = Date.now()): TerminalBuffer {\n if (chunk === '') return buffer;\n const lines = buffer.lines.slice();\n const parts = chunk.split('\\n');\n const tail = parts.pop() ?? '';\n let open = buffer.open;\n const add = (part: string, complete: boolean) => {\n const last = lines[lines.length - 1];\n if (open && last) lines[lines.length - 1] = { ...last, text: collapseCarriageReturns(last.text + part, complete) };\n else lines.push({ text: collapseCarriageReturns(part, complete), timestamp: now });\n };\n for (const part of parts) {\n add(part, true);\n open = false;\n }\n if (tail !== '') {\n add(tail, false);\n open = true;\n }\n return trimBuffer({ lines, first: buffer.first, open }, maxLines);\n}\n","import { tv, type VariantProps } from '../../utils/tv';\n\nconst focus = 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring';\n\nexport const terminalVariants = tv({\n slots: {\n root: 'flex h-80 min-h-0 flex-col overflow-hidden rounded-md border border-border bg-card text-start',\n header: 'flex min-h-9 flex-wrap items-center justify-between gap-2 border-b border-border/70 py-1 pe-1.5 ps-3',\n title: 'min-w-0 truncate font-mono text-[11.5px] text-foreground',\n actions: 'ms-auto flex shrink-0 items-center gap-0.5',\n search: [\n 'flex h-7 items-center gap-1.5 rounded-md border border-border bg-background pe-1 ps-2 text-muted-foreground',\n 'focus-within:border-primary/60 focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-focus-ring',\n ],\n searchInput:\n 'w-32 min-w-0 bg-transparent font-mono text-[11.5px] text-foreground outline-none placeholder:text-muted-foreground',\n matches: 'shrink-0 font-mono text-[10.5px] text-muted-foreground tabular-nums',\n button: [\n 'inline-flex h-7 min-w-7 cursor-pointer items-center justify-center gap-1.5 rounded-md px-1.5 font-mono text-[11px] text-muted-foreground transition-colors motion-reduce:transition-none',\n 'hover:bg-secondary hover:text-foreground aria-pressed:bg-secondary aria-pressed:text-foreground disabled:cursor-not-allowed disabled:opacity-50',\n focus,\n ],\n copied: 'text-primary-text hover:text-primary-text',\n body: 'relative min-h-0 flex-1',\n viewport: [\n 'h-full overflow-auto bg-background/40 py-2 font-mono text-[12px] leading-[1.6] text-foreground',\n 'focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus-ring',\n ],\n lines: 'grid',\n line: 'flex pe-3 ps-3 data-current:bg-primary/10',\n lineNumber: 'me-3 inline-block shrink-0 text-end text-muted-foreground tabular-nums select-none',\n timestamp: 'me-3 shrink-0 text-muted-foreground tabular-nums select-none',\n content: 'min-w-0 flex-1',\n mark: 'rounded-[2px] bg-warning/25 text-foreground data-current:bg-warning/50 data-current:outline-1 data-current:outline-warning',\n empty: 'px-3 py-2 font-mono text-[12px] text-muted-foreground',\n jump: [\n 'absolute bottom-3 start-1/2 inline-flex -translate-x-1/2 items-center gap-1.5 rounded-full border border-border bg-popover px-3 py-1 text-[12px] font-medium text-popover-foreground shadow-md',\n 'rtl:translate-x-1/2 transition-colors hover:bg-secondary motion-reduce:transition-none',\n focus,\n ],\n },\n variants: {\n wrap: {\n true: { lines: 'w-full', content: 'break-words whitespace-pre-wrap' },\n false: { lines: 'w-max min-w-full', content: 'whitespace-pre' },\n },\n },\n defaultVariants: { wrap: false },\n});\n\nexport type TerminalVariantProps = VariantProps<typeof terminalVariants>;\n","import { ArrowDown, Check, ChevronDown, ChevronUp, Copy, Search, WrapText } from 'lucide-react';\nimport {\n useEffect,\n useId,\n useImperativeHandle,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type KeyboardEvent,\n type ReactNode,\n type Ref,\n} from 'react';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { ansiClassName, parseAnsiState, type AnsiSegment, type AnsiStyle } from './ansi';\nimport {\n appendChunk,\n EMPTY_BUFFER,\n toBufferLine,\n trimBuffer,\n type BufferLine,\n type TerminalBuffer,\n type TerminalLine,\n} from './buffer';\nimport { terminalVariants } from './terminal.variants';\n\nexport type { TerminalLine } from './buffer';\n\n/** Imperative API (`ref`): stream output into an uncontrolled Terminal. */\nexport interface TerminalHandle {\n /** Appends raw output; a chunk without a trailing newline leaves the line open for the next one. */\n write: (chunk: string) => void;\n /** Appends one complete line. */\n writeln: (line?: string) => void;\n /** Removes every line. */\n clear: () => void;\n /** Scrolls to the newest line and resumes following the tail. */\n scrollToBottom: () => void;\n /** All output as plain text (escapes stripped). */\n getText: () => string;\n}\n\nexport interface TerminalProps {\n /** Controlled output (ANSI escapes allowed). Without it, stream through the `ref` handle. */\n lines?: readonly TerminalLine[];\n /** Initial output of an uncontrolled Terminal. */\n defaultLines?: readonly TerminalLine[];\n ref?: Ref<TerminalHandle>;\n /** Oldest lines beyond this are dropped (line numbers keep counting). Default 5000. */\n maxLines?: number;\n showLineNumbers?: boolean;\n /** Shows each line's time (lines written through the handle are stamped on arrival). */\n showTimestamps?: boolean;\n formatTimestamp?: (date: Date) => string;\n wrap?: boolean;\n defaultWrap?: boolean;\n onWrapChange?: (wrap: boolean) => void;\n /** Toolbar title, e.g. the command or job name. */\n title?: ReactNode;\n /** Accessible name of the log. Default: \"Terminal output\". */\n label?: string;\n /**\n * Announce new output to screen readers. Off by default (a busy log is noise); opt in with\n * `true` / `'polite'` for slow, meaningful output, `'assertive'` only for urgent streams.\n */\n live?: boolean | 'polite' | 'assertive';\n /** Show the toolbar (title, search, wrap, copy). Default true. */\n toolbar?: boolean;\n searchable?: boolean;\n copyable?: boolean;\n wrapToggle?: boolean;\n /** Shown while there is no output. */\n emptyText?: ReactNode;\n className?: string;\n}\n\ninterface Match {\n line: number;\n start: number;\n end: number;\n}\n\nconst BOTTOM_SLACK = 8;\n\n/** Parses every line, carrying the ANSI style across lines like a real terminal. */\nfunction parseLines(lines: readonly BufferLine[]) {\n let style: AnsiStyle = {};\n return lines.map((line) => {\n const result = parseAnsiState(line.text, style);\n style = result.style;\n return { segments: result.segments, plain: result.segments.map((seg) => seg.text).join('') };\n });\n}\n\n/** Segments of one line with the search matches cut out as `<mark>`s. */\nfunction renderSegments(\n segments: AnsiSegment[],\n matches: Match[],\n currentKey: string | null,\n markClass: string,\n lineIndex: number,\n) {\n if (!matches.length) {\n return segments.map((seg, i) => {\n const cls = ansiClassName(seg);\n return cls ? (\n <span key={i} className={cls}>\n {seg.text}\n </span>\n ) : (\n seg.text\n );\n });\n }\n const out: ReactNode[] = [];\n let offset = 0;\n segments.forEach((seg, i) => {\n const cls = ansiClassName(seg) || undefined;\n const segStart = offset;\n const segEnd = offset + seg.text.length;\n let cursor = segStart;\n for (const m of matches) {\n if (m.end <= cursor || m.start >= segEnd) continue;\n const from = Math.max(m.start, cursor);\n const to = Math.min(m.end, segEnd);\n if (from > cursor)\n out.push(\n <span key={`${i}-${cursor}`} className={cls}>\n {seg.text.slice(cursor - segStart, from - segStart)}\n </span>,\n );\n const key = `${lineIndex}:${m.start}`;\n out.push(\n <mark\n key={`${i}-m${from}`}\n className={cn(markClass, cls)}\n data-current={key === currentKey || undefined}\n data-match={key}\n >\n {seg.text.slice(from - segStart, to - segStart)}\n </mark>,\n );\n cursor = to;\n }\n if (cursor < segEnd)\n out.push(\n <span key={`${i}-${cursor}`} className={cls}>\n {seg.text.slice(cursor - segStart)}\n </span>,\n );\n offset = segEnd;\n });\n return out;\n}\n\n/**\n * Streamed command output: ANSI colours mapped to tokens, tail following with \"Jump to latest\",\n * optional line numbers / timestamps, wrap toggle, copy all, search highlight and a line cap.\n * The output is a `role=\"log\"` (aria-live off unless `live`).\n */\nexport function Terminal({\n lines: linesProp,\n defaultLines,\n ref,\n maxLines = 5000,\n showLineNumbers = false,\n showTimestamps = false,\n formatTimestamp,\n wrap: wrapProp,\n defaultWrap = false,\n onWrapChange,\n title,\n label,\n live = false,\n toolbar = true,\n searchable = true,\n copyable = true,\n wrapToggle = true,\n emptyText,\n className,\n}: TerminalProps) {\n const { t, locale } = useI18n();\n const [inner, setInner] = useState<TerminalBuffer>(() =>\n trimBuffer({ ...EMPTY_BUFFER, lines: (defaultLines ?? []).map(toBufferLine) }, maxLines),\n );\n const buffer = useMemo<TerminalBuffer>(\n () =>\n linesProp\n ? trimBuffer({ ...EMPTY_BUFFER, lines: linesProp.map(toBufferLine) }, maxLines)\n : trimBuffer(inner, maxLines),\n [linesProp, inner, maxLines],\n );\n const [innerWrap, setInnerWrap] = useState(defaultWrap);\n const wrap = wrapProp ?? innerWrap;\n const [following, setFollowing] = useState(true);\n const [seenTotal, setSeenTotal] = useState(0);\n const [query, setQuery] = useState('');\n const [current, setCurrent] = useState(0);\n const [copyStatus, setCopyStatus] = useState<'idle' | 'copied' | 'failed'>('idle');\n const viewportRef = useRef<HTMLDivElement>(null);\n const searchRef = useRef<HTMLInputElement>(null);\n const searchId = useId();\n const s = terminalVariants({ wrap });\n\n const total = buffer.first + buffer.lines.length;\n\n const parsed = useMemo(() => parseLines(buffer.lines), [buffer.lines]);\n\n const matches = useMemo<Match[]>(() => {\n const q = query.trim().toLocaleLowerCase(locale);\n if (!q) return [];\n const found: Match[] = [];\n parsed.forEach((line, index) => {\n const hay = line.plain.toLocaleLowerCase(locale);\n let at = hay.indexOf(q);\n while (at >= 0) {\n found.push({ line: index, start: at, end: at + q.length });\n at = hay.indexOf(q, at + q.length);\n }\n });\n return found;\n }, [parsed, query, locale]);\n const currentIndex = matches.length ? Math.min(current, matches.length - 1) : -1;\n const currentMatch = currentIndex >= 0 ? matches[currentIndex] : undefined;\n const currentKey = currentMatch ? `${currentMatch.line}:${currentMatch.start}` : null;\n\n const scrollToBottom = () => {\n const el = viewportRef.current;\n if (el) el.scrollTop = el.scrollHeight;\n setFollowing(true);\n };\n\n useImperativeHandle(\n ref,\n () => ({\n write: (chunk) => setInner((prev) => appendChunk(prev, chunk, maxLines)),\n writeln: (line = '') => setInner((prev) => appendChunk(prev, `${prev.open ? '\\n' : ''}${line}\\n`, maxLines)),\n clear: () => setInner(EMPTY_BUFFER),\n scrollToBottom,\n getText: () => parsed.map((line) => line.plain).join('\\n'),\n }),\n [maxLines, parsed],\n );\n\n // Follow the tail while the user has not scrolled up.\n useLayoutEffect(() => {\n if (!following || currentKey) return;\n const el = viewportRef.current;\n if (el) el.scrollTop = el.scrollHeight;\n }, [total, buffer.lines, following, currentKey]);\n\n // Bring the current search match into view.\n useEffect(() => {\n if (!currentKey) return;\n const mark = viewportRef.current?.querySelector(`[data-match=\"${currentKey}\"]`);\n if (mark && 'scrollIntoView' in mark && typeof mark.scrollIntoView === 'function')\n mark.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n }, [currentKey]);\n\n useEffect(() => {\n if (copyStatus === 'idle') return;\n const id = window.setTimeout(() => setCopyStatus('idle'), 2000);\n return () => window.clearTimeout(id);\n }, [copyStatus]);\n\n const onScroll = () => {\n const el = viewportRef.current;\n if (!el) return;\n const atBottom = el.scrollHeight - el.scrollTop - el.clientHeight <= BOTTOM_SLACK;\n if (atBottom !== following) {\n setFollowing(atBottom);\n if (!atBottom) setSeenTotal(total);\n }\n };\n\n const onViewportKeyDown = (e: KeyboardEvent<HTMLDivElement>) => {\n const el = viewportRef.current;\n if (!el) return;\n if (e.key === 'End' && !e.shiftKey) {\n e.preventDefault();\n scrollToBottom();\n } else if (e.key === 'Home' && !e.shiftKey) {\n e.preventDefault();\n el.scrollTop = 0;\n setFollowing(false);\n setSeenTotal(total);\n }\n };\n\n const onRootKeyDown = (e: KeyboardEvent<HTMLDivElement>) => {\n if (searchable && toolbar && (e.metaKey || e.ctrlKey) && e.key.toLowerCase() === 'f') {\n e.preventDefault();\n searchRef.current?.focus();\n searchRef.current?.select();\n }\n };\n\n const step = (delta: number) => {\n if (!matches.length) return;\n if (following) setSeenTotal(total);\n setFollowing(false);\n setCurrent((c) => (Math.min(c, matches.length - 1) + delta + matches.length) % matches.length);\n };\n\n const onSearchKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n step(e.shiftKey ? -1 : 1);\n } else if (e.key === 'Escape' && query) {\n e.preventDefault();\n e.stopPropagation();\n setQuery('');\n setCurrent(0);\n }\n };\n\n const copyAll = async () => {\n try {\n await navigator.clipboard.writeText(parsed.map((line) => line.plain).join('\\n'));\n setCopyStatus('copied');\n } catch {\n setCopyStatus('failed');\n }\n };\n\n const toggleWrap = () => {\n const next = !wrap;\n setInnerWrap(next);\n onWrapChange?.(next);\n };\n\n const unseen = following ? 0 : Math.max(0, total - seenTotal);\n const digits = String(Math.max(total, 1)).length;\n const timeFormat = useMemo(() => {\n if (formatTimestamp) return formatTimestamp;\n const fmt = new Intl.DateTimeFormat(locale, {\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n hour12: false,\n });\n return (d: Date) => fmt.format(d);\n }, [formatTimestamp, locale]);\n const ariaLive = live === true ? 'polite' : live || 'off';\n const announcement =\n copyStatus === 'copied' ? t('common.copiedToClipboard') : copyStatus === 'failed' ? t('common.copyFailed') : '';\n\n return (\n <div className={cn(s.root(), className)} onKeyDown={onRootKeyDown}>\n {toolbar && (\n <div className={s.header()}>\n {title && <span className={s.title()}>{title}</span>}\n <div className={s.actions()}>\n {searchable && (\n <div className={s.search()}>\n <Search size={12} aria-hidden className=\"shrink-0\" />\n <input\n ref={searchRef}\n id={searchId}\n type=\"search\"\n value={query}\n onChange={(e) => {\n setQuery(e.target.value);\n setCurrent(0);\n }}\n onKeyDown={onSearchKeyDown}\n aria-label={t('terminal.search')}\n placeholder={t('common.searchPlaceholder')}\n className={s.searchInput()}\n />\n {query.trim() && (\n <span className={s.matches()} aria-live=\"polite\">\n {matches.length\n ? t('terminal.matches', { current: currentIndex + 1, total: matches.length })\n : t('terminal.noMatches')}\n </span>\n )}\n <button\n type=\"button\"\n className={s.button()}\n aria-label={t('terminal.previousMatch')}\n disabled={!matches.length}\n onClick={() => step(-1)}\n >\n <ChevronUp size={13} aria-hidden />\n </button>\n <button\n type=\"button\"\n className={s.button()}\n aria-label={t('terminal.nextMatch')}\n disabled={!matches.length}\n onClick={() => step(1)}\n >\n <ChevronDown size={13} aria-hidden />\n </button>\n </div>\n )}\n {wrapToggle && (\n <button\n type=\"button\"\n className={s.button()}\n aria-label={t('terminal.wrap')}\n aria-pressed={wrap}\n onClick={toggleWrap}\n >\n <WrapText size={14} aria-hidden />\n </button>\n )}\n {copyable && (\n <button\n type=\"button\"\n className={cn(s.button(), copyStatus === 'copied' && s.copied())}\n aria-label={t('terminal.copyAll')}\n disabled={!buffer.lines.length}\n onClick={copyAll}\n >\n {copyStatus === 'copied' ? <Check size={14} aria-hidden /> : <Copy size={14} aria-hidden />}\n </button>\n )}\n </div>\n </div>\n )}\n <div className={s.body()}>\n <div\n ref={viewportRef}\n role=\"log\"\n aria-live={ariaLive}\n aria-label={label ?? t('terminal.label')}\n tabIndex={0}\n onScroll={onScroll}\n onKeyDown={onViewportKeyDown}\n className={s.viewport()}\n >\n {buffer.lines.length === 0 && emptyText ? <div className={s.empty()}>{emptyText}</div> : null}\n <div className={s.lines()}>\n {buffer.lines.map((line, index) => {\n const number = buffer.first + index + 1;\n const lineMatches = matches.length ? matches.filter((m) => m.line === index) : [];\n const segments = parsed[index]?.segments ?? [];\n return (\n <div key={number} className={s.line()} data-current={currentMatch?.line === index || undefined}>\n {showLineNumbers && (\n <span aria-hidden className={s.lineNumber()} style={{ minWidth: `${digits}ch` }}>\n {number}\n </span>\n )}\n {showTimestamps && line.timestamp !== undefined && (\n <time dateTime={new Date(line.timestamp).toISOString()} className={s.timestamp()}>\n {timeFormat(new Date(line.timestamp))}\n </time>\n )}\n <span className={s.content()}>\n {segments.length ? renderSegments(segments, lineMatches, currentKey, s.mark(), index) : ''}\n </span>\n </div>\n );\n })}\n </div>\n </div>\n {!following && (\n <button type=\"button\" className={s.jump()} onClick={scrollToBottom}>\n <ArrowDown size={13} aria-hidden />\n {t('terminal.jumpToLatest')}\n {unseen > 0 && <span className=\"text-muted-foreground\">· {t('terminal.newLines', { count: unseen })}</span>}\n </button>\n )}\n </div>\n <span role=\"status\" className=\"sr-only\">\n {announcement}\n </span>\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Terminal',\n group: 'Display',\n status: 'beta',\n description:\n 'Streamed command output (build, deploy, job logs). ANSI SGR colours map to contrast-safe tokens (`parseAnsi` is exported), `\\\\r` progress lines rewrite in place, and a line cap drops the oldest output. It follows the tail until the user scrolls up, then offers “Jump to latest” with the count of new lines. Optional line numbers and timestamps, a wrap toggle, copy all and search with highlighted matches. The output is a `role=\"log\"` with aria-live off unless `live` opts in. Stream through the `ref` handle (`write`, `writeln`, `clear`) or pass `lines`.',\n pattern: 'log · button · searchbox',\n keyboard: [\n ['Tab', 'Moves through the search box, match arrows, wrap toggle, copy button and the output log'],\n ['End', 'In the log: jumps to the newest line and resumes following the tail'],\n ['Home', 'In the log: jumps to the first line and stops following'],\n ['Arrow keys / Page Up / Page Down', 'Scroll the focused log'],\n ['Ctrl+F / ⌘F', 'Inside the terminal: focuses the search box'],\n ['Enter / Shift+Enter', 'In the search box: next / previous match (scrolled into view)'],\n ['Escape', 'In the search box: clears the search'],\n ],\n tokens: [\n 'card',\n 'background',\n 'border',\n 'popover',\n 'secondary',\n 'foreground',\n 'muted-foreground',\n 'destructive-text',\n 'success-text',\n 'warning-text',\n 'info',\n 'category-violet',\n 'warning',\n 'primary',\n 'primary-text',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const textVariants = tv({\n base: 'min-w-0',\n variants: {\n variant: {\n body: 'text-[0.9375rem] leading-relaxed',\n label: 'text-[13px] leading-tight font-medium',\n supporting: 'text-[13px] leading-snug',\n caption: 'text-[12px] leading-snug',\n code: 'rounded-sm bg-secondary px-1 py-0.5 font-mono text-[0.92em]',\n display: 'text-[2.875rem] leading-[1.04] font-bold tracking-tight',\n },\n tone: {\n default: 'text-foreground',\n muted: 'text-muted-foreground',\n primary: 'text-primary-text',\n success: 'text-success-text',\n warning: 'text-warning-text',\n destructive: 'text-destructive-text',\n inherit: 'text-inherit',\n },\n truncate: { true: 'truncate' },\n lineClamp: {\n 1: 'line-clamp-1',\n 2: 'line-clamp-2',\n 3: 'line-clamp-3',\n 4: 'line-clamp-4',\n 5: 'line-clamp-5',\n 6: 'line-clamp-6',\n },\n },\n defaultVariants: { variant: 'body' },\n});\n\nexport const headingVariants = tv({\n base: 'min-w-0 text-balance',\n variants: {\n size: {\n display: 'text-[2.875rem] leading-[1.04] font-bold tracking-tight',\n xl: 'text-[1.875rem] leading-tight font-bold tracking-tight',\n lg: 'text-[1.5rem] leading-snug font-bold tracking-tight',\n md: 'text-xl leading-snug font-semibold tracking-tight',\n sm: 'text-[17px] leading-snug font-semibold tracking-tight',\n xs: 'text-[15px] leading-snug font-semibold tracking-tight',\n '2xs': 'text-[13px] leading-snug font-semibold',\n },\n tone: {\n default: 'text-foreground',\n muted: 'text-muted-foreground',\n primary: 'text-primary-text',\n inherit: 'text-inherit',\n },\n truncate: { true: 'truncate' },\n lineClamp: {\n 1: 'line-clamp-1',\n 2: 'line-clamp-2',\n 3: 'line-clamp-3',\n },\n },\n defaultVariants: { tone: 'default' },\n});\n\nexport type TextVariantProps = VariantProps<typeof textVariants>;\nexport type HeadingVariantProps = VariantProps<typeof headingVariants>;\n","import { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cn } from '../../utils/cn';\nimport { headingVariants, textVariants } from './text.variants';\n\nexport type TextVariant = 'body' | 'label' | 'supporting' | 'caption' | 'code' | 'display';\nexport type TextTone = 'default' | 'muted' | 'primary' | 'success' | 'warning' | 'destructive' | 'inherit';\n\n/** Tone each variant uses when `tone` is not set. */\nconst DEFAULT_TONE: Record<TextVariant, TextTone> = {\n body: 'default',\n label: 'default',\n supporting: 'muted',\n caption: 'muted',\n code: 'default',\n display: 'default',\n};\n\nconst DEFAULT_TAG: Record<TextVariant, 'p' | 'span' | 'code'> = {\n body: 'p',\n label: 'span',\n supporting: 'p',\n caption: 'span',\n code: 'code',\n display: 'p',\n};\n\nexport interface TextProps extends Omit<useRender.ComponentProps<'p'>, 'className'> {\n className?: string;\n /** Type role. Default `body`. */\n variant?: TextVariant;\n /** Colour role; brand / status tones use the contrast-safe `*-text` aliases. Defaults per variant. */\n tone?: TextTone;\n /** Tag to render; defaults per variant (p, span or code). `render` wins when both are set. */\n as?: 'p' | 'span' | 'div' | 'code' | 'small' | 'strong' | 'em' | 'label' | 'dt' | 'dd' | 'li' | 'figcaption';\n /** Single line with an ellipsis. */\n truncate?: boolean;\n /** Clamp to N lines (1–6) with an ellipsis. */\n lineClamp?: 1 | 2 | 3 | 4 | 5 | 6;\n}\n\n/** Body copy and small type roles: body, label, supporting, caption, code and display. */\nexport function Text({ variant = 'body', tone, as, truncate, lineClamp, className, render, ref, ...props }: TextProps) {\n return useRender({\n defaultTagName: as ?? DEFAULT_TAG[variant],\n render,\n ref,\n props: mergeProps<'p'>(props, {\n className: cn(textVariants({ variant, tone: tone ?? DEFAULT_TONE[variant], truncate, lineClamp }), className),\n }),\n });\n}\n\nexport type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\nexport type HeadingSize = 'display' | 'xl' | 'lg' | 'md' | 'sm' | 'xs' | '2xs';\n\nconst LEVEL_SIZE: Record<HeadingLevel, HeadingSize> = { 1: 'xl', 2: 'lg', 3: 'md', 4: 'sm', 5: 'xs', 6: '2xs' };\n\nexport interface HeadingProps extends Omit<useRender.ComponentProps<'h2'>, 'className'> {\n className?: string;\n /** Semantic level (h1–h6) that fits the page outline. Default 2. */\n level?: HeadingLevel;\n /** Visual size, independent of the level. Defaults to the level's size. */\n size?: HeadingSize;\n tone?: 'default' | 'muted' | 'primary' | 'inherit';\n truncate?: boolean;\n lineClamp?: 1 | 2 | 3;\n}\n\n/** Section and page titles: the semantic level and the visual size are chosen separately. */\nexport function Heading({\n level = 2,\n size,\n tone,\n truncate,\n lineClamp,\n className,\n render,\n ref,\n ...props\n}: HeadingProps) {\n return useRender({\n defaultTagName: `h${level}`,\n render,\n ref,\n props: mergeProps<'h2'>(props, {\n className: cn(headingVariants({ size: size ?? LEVEL_SIZE[level], tone, truncate, lineClamp }), className),\n }),\n });\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Text',\n group: 'Display',\n status: 'stable',\n description:\n 'Type roles on the brand scale. Text: body, label, supporting, caption, code and display, with tones (default, muted, primary, success, warning, destructive — contrast-safe *-text aliases). Heading: semantic level 1–6 with an independent visual size. Both truncate or clamp to N lines and render any element via `as` / `render`.',\n primitive: '@base-ui/react/use-render',\n tokens: [\n 'foreground',\n 'muted-foreground',\n 'primary-text',\n 'success-text',\n 'warning-text',\n 'destructive-text',\n 'secondary',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const themeSwitcherVariants = tv({\n slots: {\n group: '',\n option: 'gap-1.5',\n optionIcon: 'shrink-0',\n cycle: '',\n },\n variants: {\n labels: {\n true: {},\n false: { option: 'px-0' },\n },\n },\n defaultVariants: { labels: true },\n});\n\nexport type ThemeSwitcherVariantProps = VariantProps<typeof themeSwitcherVariants>;\n","import { Contrast, Monitor, Moon, Sun } from 'lucide-react';\nimport type { ComponentType } from 'react';\nimport { useTheme, type ThemeMode } from '../../theme/ThemeProvider';\nimport { cn } from '../../utils/cn';\nimport { IconButton, type IconButtonProps } from '../Button';\nimport { Toggle, ToggleGroup } from '../ToggleGroup';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport type { MessageKey } from '../../i18n/messages/en';\nimport { themeSwitcherVariants } from './theme-switcher.variants';\n\ntype IconComponent = ComponentType<{ size?: number; 'aria-hidden'?: boolean; className?: string }>;\n\nexport interface ThemeOption {\n value: ThemeMode;\n label: string;\n icon: IconComponent;\n}\n\n/** The four theme modes, in display order. Labels are English defaults; pass `options` to localise. */\nexport const THEME_OPTIONS: ThemeOption[] = [\n { value: 'light', label: 'Light', icon: Sun },\n { value: 'dark', label: 'Dark', icon: Moon },\n { value: 'high_contrast', label: 'High contrast', icon: Contrast },\n { value: 'system', label: 'System', icon: Monitor },\n];\n\nconst THEME_KEYS: Record<ThemeMode, MessageKey> = {\n light: 'theme.light',\n dark: 'theme.dark',\n high_contrast: 'theme.highContrast',\n system: 'theme.system',\n};\n\n/** `options`, or the four built-in modes with labels from the I18nProvider catalog. */\nexport function useThemeOptions(options?: ThemeOption[]): ThemeOption[] {\n const { t } = useI18n();\n return options ?? THEME_OPTIONS.map((o) => ({ ...o, label: t(THEME_KEYS[o.value]) }));\n}\n\nexport interface ThemeSwitcherProps {\n className?: string;\n /** Modes offered (and their labels). Defaults to Light · Dark · High contrast · System. */\n options?: ThemeOption[];\n /** Show text labels next to the icons; when false each option is icon-only with an aria-label. */\n showLabels?: boolean;\n size?: 'sm' | 'md';\n /** Accessible name of the group. */\n label?: string;\n}\n\n/**\n * Segmented control (ToggleGroup) bound to `useTheme()`: arrow keys move between options,\n * Enter / Space selects. One option is always pressed.\n */\nexport function ThemeSwitcher({\n className,\n options: optionsProp,\n showLabels = true,\n size = 'sm',\n label: labelProp,\n}: ThemeSwitcherProps) {\n const { t } = useI18n();\n const label = labelProp ?? t('theme.label');\n const options = useThemeOptions(optionsProp);\n const { mode, setMode } = useTheme();\n const s = themeSwitcherVariants({ labels: showLabels });\n return (\n <ToggleGroup\n aria-label={label}\n size={size}\n value={[mode]}\n onValueChange={(v) => {\n const next = v[0] as ThemeMode | undefined;\n if (next) setMode(next);\n }}\n className={cn(s.group(), className)}\n >\n {options.map(({ value, label: text, icon: IconCmp }) => (\n <Toggle\n key={value}\n value={value}\n iconOnly={!showLabels}\n aria-label={showLabels ? undefined : text}\n className={s.option()}\n >\n <IconCmp size={14} aria-hidden className={s.optionIcon()} />\n {showLabels && text}\n </Toggle>\n ))}\n </ToggleGroup>\n );\n}\n\nexport interface ThemeCycleButtonProps extends Omit<IconButtonProps, 'icon' | 'label' | 'onClick'> {\n /** Modes to cycle through, in order. */\n options?: ThemeOption[];\n /** Builds the accessible name from the current and next option. */\n getLabel?: (current: ThemeOption, next: ThemeOption) => string;\n}\n\n/** Compact icon button for toolbars: shows the current mode's icon and cycles to the next on click. */\nexport function ThemeCycleButton({\n options: optionsProp,\n getLabel,\n variant = 'secondary',\n ...props\n}: ThemeCycleButtonProps) {\n const { t } = useI18n();\n const options = useThemeOptions(optionsProp);\n const label =\n getLabel ??\n ((current: ThemeOption, next: ThemeOption) => t('theme.cycle', { current: current.label, next: next.label }));\n const { mode, setMode } = useTheme();\n const index = Math.max(\n 0,\n options.findIndex((o) => o.value === mode),\n );\n const current = options[index] ?? THEME_OPTIONS[1]!;\n const next = options[(index + 1) % options.length] ?? current;\n return (\n <IconButton\n icon={current.icon}\n label={label(current, next)}\n variant={variant}\n onClick={() => setMode(next.value)}\n {...props}\n />\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'ThemeSwitcher',\n group: 'Theme',\n status: 'beta',\n description:\n 'Theme control bound to useTheme(): a segmented Light · Dark · High contrast · System control (labels or icon-only), and ThemeCycleButton, a compact icon button that cycles modes for toolbars.',\n primitive: '@base-ui/react/toggle-group',\n pattern: 'toggle button group',\n keyboard: [\n ['Tab', 'Moves focus into the group and out of it'],\n ['ArrowRight / ArrowLeft', 'Moves focus between options (wraps)'],\n ['Enter / Space', 'Selects the focused option and applies the theme'],\n ['Enter / Space (cycle button)', 'Switches to the next mode'],\n ],\n tokens: ['card', 'border', 'secondary', 'foreground', 'muted-foreground', 'focus-ring'],\n};\n","import {\n File,\n FileArchive,\n FileAudio,\n FileCode,\n FileImage,\n FileSpreadsheet,\n FileText,\n FileVideo,\n type LucideIcon,\n} from 'lucide-react';\n\nexport type FileKind = 'image' | 'video' | 'audio' | 'archive' | 'code' | 'spreadsheet' | 'document' | 'file';\n\nconst EXT: Record<string, FileKind> = {\n png: 'image',\n jpg: 'image',\n jpeg: 'image',\n gif: 'image',\n webp: 'image',\n svg: 'image',\n avif: 'image',\n mp4: 'video',\n mov: 'video',\n webm: 'video',\n mp3: 'audio',\n wav: 'audio',\n ogg: 'audio',\n flac: 'audio',\n zip: 'archive',\n gz: 'archive',\n tar: 'archive',\n tgz: 'archive',\n '7z': 'archive',\n rar: 'archive',\n js: 'code',\n ts: 'code',\n tsx: 'code',\n jsx: 'code',\n json: 'code',\n yaml: 'code',\n yml: 'code',\n py: 'code',\n sql: 'code',\n sh: 'code',\n csv: 'spreadsheet',\n xlsx: 'spreadsheet',\n xls: 'spreadsheet',\n parquet: 'spreadsheet',\n tsv: 'spreadsheet',\n pdf: 'document',\n doc: 'document',\n docx: 'document',\n md: 'document',\n txt: 'document',\n};\n\n/** Kind of a file from its MIME type, falling back to the extension of its name. */\nexport function fileKind(name: string, type?: string): FileKind {\n const major = type?.split('/')[0];\n if (major === 'image' || major === 'video' || major === 'audio') return major;\n const ext = name.includes('.') ? name.split('.').pop()?.toLowerCase() : undefined;\n return (ext && EXT[ext]) || 'file';\n}\n\n/** File extension shown as a tag (\"PDF\"), or undefined. */\nexport function fileExtension(name: string) {\n return name.includes('.') ? name.split('.').pop()?.toUpperCase() : undefined;\n}\n\nexport const FILE_ICON: Record<FileKind, LucideIcon> = {\n image: FileImage,\n video: FileVideo,\n audio: FileAudio,\n archive: FileArchive,\n code: FileCode,\n spreadsheet: FileSpreadsheet,\n document: FileText,\n file: File,\n};\n\n/** \"2.4 MB\" style size with binary multiples. */\nexport function formatBytes(bytes: number, locale?: string) {\n const units = ['B', 'KB', 'MB', 'GB', 'TB'];\n let value = bytes;\n let i = 0;\n while (value >= 1024 && i < units.length - 1) {\n value /= 1024;\n i++;\n }\n const digits = i === 0 || value >= 10 ? 0 : 1;\n return `${new Intl.NumberFormat(locale, { maximumFractionDigits: digits }).format(value)} ${units[i]}`;\n}\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const thumbnailVariants = tv({\n slots: {\n root: 'group relative m-0 flex w-36 flex-col overflow-hidden rounded-lg border bg-card shadow-sm',\n preview: 'relative grid aspect-[4/3] place-items-center overflow-hidden bg-secondary/60',\n image: 'size-full object-cover',\n icon: 'text-muted-foreground',\n ext: 'absolute start-2 bottom-2 rounded-[4px] bg-card px-1 font-mono text-[9.5px] font-semibold tracking-wide text-muted-foreground',\n shimmer: 'pointer-events-none absolute inset-0 animate-pulse bg-foreground/6 motion-reduce:animate-none',\n caption: 'grid gap-0.5 px-2.5 py-2 text-start',\n name: 'truncate text-[12.5px] font-medium text-foreground',\n meta: 'truncate font-mono text-[10.5px] text-muted-foreground',\n progress: 'absolute inset-x-0 bottom-0 h-1 bg-secondary',\n progressBar: 'block h-full bg-primary transition-[width] duration-200 motion-reduce:transition-none',\n remove: [\n 'absolute end-1.5 top-1.5 grid size-6 place-items-center rounded-md border border-border bg-card/90 text-muted-foreground shadow-sm transition-colors',\n 'hover:bg-secondary hover:text-foreground',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n retry:\n 'underline underline-offset-2 hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring rounded-sm',\n list: 'm-0 flex list-none flex-wrap gap-3 p-0',\n },\n variants: {\n status: {\n idle: { root: 'border-border' },\n uploading: { root: 'border-border' },\n done: { root: 'border-border' },\n error: {\n root: 'border-destructive/50',\n preview: 'bg-destructive/10',\n icon: 'text-destructive-text',\n meta: 'text-destructive-text',\n },\n },\n },\n defaultVariants: { status: 'idle' },\n});\n\nexport type ThumbnailVariantProps = VariantProps<typeof thumbnailVariants>;\n","import { AlertCircle, X } from 'lucide-react';\nimport { Children, isValidElement, useId, type HTMLAttributes, type ReactNode, type Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { FILE_ICON, fileExtension, fileKind, formatBytes } from './file-kind';\nimport { thumbnailVariants } from './thumbnail.variants';\n\nexport type ThumbnailStatus = 'idle' | 'uploading' | 'done' | 'error';\n\nexport interface ThumbnailLabels {\n /** Remove button name; receives the file name. */\n remove: (name: string) => string;\n /** Progress bar name; receives the file name. */\n uploading: (name: string) => string;\n /** Default error text when `error` is `true`. */\n error: string;\n /** Retry action text. */\n retry: string;\n}\n\nconst DEFAULT_LABELS: ThumbnailLabels = {\n remove: (name) => `Remove ${name}`,\n uploading: (name) => `Uploading ${name}`,\n error: 'Upload failed',\n retry: 'Retry',\n};\n\nexport interface ThumbnailProps extends Omit<HTMLAttributes<HTMLElement>, 'className' | 'children'> {\n className?: string;\n ref?: Ref<HTMLElement>;\n /** File name; the caption and the accessible name. */\n name: string;\n /** Size in bytes, shown as \"2.4 MB\". */\n size?: number;\n /** MIME type; picks the icon (falls back to the extension). */\n type?: string;\n /** Image preview URL. Without it the file-type icon shows. */\n src?: string;\n /** Custom preview (replaces image and icon). */\n preview?: ReactNode;\n /** Upload progress 0–100: shows the shimmer and a progress bar. `null` = indeterminate. */\n progress?: number | null;\n /** Error state; a string replaces the default message. */\n error?: boolean | string;\n /** Shows the remove button. */\n onRemove?: () => void;\n /** Shows a retry action in the error state. */\n onRetry?: () => void;\n /** BCP 47 locale for the size. */\n locale?: string;\n /** Built-in strings (English defaults). */\n labels?: Partial<ThumbnailLabels>;\n}\n\n/**\n * File or image preview tile (a `<figure>` captioned with name and size): image or file-type\n * icon, upload progress with a reduced-motion-safe shimmer, error state and a remove button.\n */\nexport function Thumbnail({\n name,\n size,\n type,\n src,\n preview,\n progress,\n error,\n onRemove,\n onRetry,\n locale,\n labels: labelsProp,\n className,\n ...props\n}: ThumbnailProps) {\n const labels = { ...DEFAULT_LABELS, ...labelsProp };\n const nameId = useId();\n const uploading = progress !== undefined && !error && (progress === null || progress < 100);\n const status: ThumbnailStatus = error ? 'error' : uploading ? 'uploading' : progress !== undefined ? 'done' : 'idle';\n const s = thumbnailVariants({ status });\n const kind = fileKind(name, type);\n const Icon = error ? AlertCircle : FILE_ICON[kind];\n const ext = fileExtension(name);\n const errorText = typeof error === 'string' ? error : labels.error;\n const pct = progress == null ? undefined : Math.max(0, Math.min(100, Math.round(progress)));\n\n return (\n <figure\n aria-labelledby={nameId}\n className={cn(s.root(), className)}\n data-status={status}\n aria-busy={uploading || undefined}\n {...props}\n >\n <div className={s.preview()}>\n {preview ??\n (src && !error ? (\n <img src={src} alt=\"\" className={s.image()} />\n ) : (\n <Icon size={26} strokeWidth={1.6} aria-hidden className={s.icon()} />\n ))}\n {!src && !preview && !error && ext && (\n <span aria-hidden className={s.ext()}>\n {ext}\n </span>\n )}\n {uploading && <span aria-hidden className={s.shimmer()} />}\n {uploading && (\n <div\n role=\"progressbar\"\n aria-label={labels.uploading(name)}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={pct}\n className={s.progress()}\n >\n <span\n className={cn(s.progressBar(), pct === undefined && 'w-2/5 animate-pulse motion-reduce:animate-none')}\n style={pct === undefined ? undefined : { width: `${pct}%` }}\n />\n </div>\n )}\n </div>\n <figcaption className={s.caption()}>\n <span id={nameId} className={s.name()} title={name}>\n {name}\n </span>\n <span className={s.meta()}>\n {error ? (\n <>\n {errorText}\n {onRetry && (\n <>\n {' · '}\n <button type=\"button\" onClick={onRetry} className={s.retry()}>\n {labels.retry}\n </button>\n </>\n )}\n </>\n ) : uploading && pct !== undefined ? (\n `${pct}%${size !== undefined ? ` · ${formatBytes(size, locale)}` : ''}`\n ) : size !== undefined ? (\n formatBytes(size, locale)\n ) : (\n (ext ?? '')\n )}\n </span>\n </figcaption>\n {onRemove && (\n <button type=\"button\" aria-label={labels.remove(name)} onClick={onRemove} className={s.remove()}>\n <X size={13} strokeWidth={2.2} aria-hidden />\n </button>\n )}\n </figure>\n );\n}\n\nexport interface ThumbnailListProps extends Omit<HTMLAttributes<HTMLUListElement>, 'className'> {\n className?: string;\n ref?: Ref<HTMLUListElement>;\n children?: ReactNode;\n}\n\n/** Wrapping list of thumbnails (each child becomes a list item). Label it with `aria-label`. */\nexport function ThumbnailList({ className, children, ...props }: ThumbnailListProps) {\n const s = thumbnailVariants();\n return (\n <ul className={cn(s.list(), className)} {...props}>\n {Children.toArray(children)\n .filter(isValidElement)\n .map((child) => (\n <li key={child.key}>{child}</li>\n ))}\n </ul>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Thumbnail',\n group: 'Display',\n status: 'beta',\n description:\n 'File or image preview tile: image or file-type icon with extension tag, name and size caption, upload progress (progressbar + shimmer that holds still under reduced motion), error state with retry, and a remove button. ThumbnailList lays tiles out as a wrapping list.',\n pattern: 'figure',\n keyboard: [\n ['Tab', 'Moves to the remove button (and retry, in the error state) of each tile'],\n ['Enter / Space', 'Activates remove or retry'],\n ],\n tokens: [\n 'card',\n 'border',\n 'secondary',\n 'muted-foreground',\n 'foreground',\n 'primary',\n 'destructive',\n 'destructive-text',\n 'focus-ring',\n ],\n};\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'TimePicker',\n group: 'Forms',\n status: 'beta',\n description:\n 'Accessible time field: hour and minute spinbutton segments, optional seconds, a 12-hour clock with AM/PM by locale or prop, minute step, min/max validation, controlled or uncontrolled (`\"HH:mm\"` strings). Digits type and auto-advance; arrows spin. Works inside Field; DatePicker `withTime` and DateTimeRangePicker reuse it.',\n primitive: '@base-ui/react/field (control) + spinbutton segments',\n pattern: 'group of spinbuttons (time field)',\n keyboard: [\n ['Tab / Shift+Tab', 'Moves between segments, then out of the field'],\n ['ArrowUp / ArrowDown', 'Increments / decrements the focused segment (minutes by `step`), wrapping around'],\n ['Home / End', 'Sets the segment to its minimum / maximum'],\n ['0–9', 'Types into the segment; moves to the next one when it is full'],\n ['A / P', 'On the AM/PM segment: picks AM or PM'],\n ['ArrowLeft / ArrowRight', 'Moves to the previous / next segment'],\n ['Backspace / Delete', 'Clears the segment (the value becomes null)'],\n ],\n tokens: [\n 'background',\n 'border',\n 'foreground',\n 'muted-foreground',\n 'primary',\n 'primary-chip-text',\n 'secondary',\n 'destructive',\n 'focus-ring',\n ],\n};\n","export type DateInput = Date | string | number;\n\n/** Epoch ms of a Date, ISO string or epoch number; `undefined` when it cannot be parsed. */\nexport function toMs(value: DateInput | undefined): number | undefined {\n if (value === undefined) return undefined;\n const ms = value instanceof Date ? value.getTime() : typeof value === 'number' ? value : Date.parse(value);\n return Number.isFinite(ms) ? ms : undefined;\n}\n\nexport interface DurationUnits {\n h: string;\n m: string;\n s: string;\n}\n\nfunction parts(ms: number) {\n const total = Math.max(0, Math.floor(ms / 1000));\n return { h: Math.floor(total / 3600), m: Math.floor((total % 3600) / 60), s: total % 60 };\n}\n\nconst pad = (n: number) => String(n).padStart(2, '0');\n\n/** \"1:02:05\" or \"2:14\" (minutes and seconds only under an hour). */\nexport function formatClock(ms: number) {\n const { h, m, s } = parts(ms);\n return h > 0 ? `${h}:${pad(m)}:${pad(s)}` : `${m}:${pad(s)}`;\n}\n\n/** \"1h 2m\", \"2m 14s\" or \"14s\": the two most significant units. */\nexport function formatCompact(ms: number, units: DurationUnits = { h: 'h', m: 'm', s: 's' }) {\n const { h, m, s } = parts(ms);\n if (h > 0) return `${h}${units.h} ${m}${units.m}`;\n if (m > 0) return `${m}${units.m} ${s}${units.s}`;\n return `${s}${units.s}`;\n}\n\n/** ISO 8601 duration for `<time dateTime>`, e.g. \"PT2M14S\". */\nexport function toIsoDuration(ms: number) {\n const { h, m, s } = parts(ms);\n return `PT${h ? `${h}H` : ''}${m ? `${m}M` : ''}${s || (!h && !m) ? `${s}S` : ''}`;\n}\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const timerVariants = tv({\n slots: {\n root: 'inline-flex items-center gap-1.5 font-mono tabular-nums text-foreground',\n dot: 'size-1.5 shrink-0 rounded-full',\n status: 'font-sans text-muted-foreground',\n },\n variants: {\n size: {\n sm: { root: 'text-[11.5px]', status: 'text-[11px]' },\n md: { root: 'text-[13px]', status: 'text-[12px]' },\n lg: { root: 'text-[20px] font-semibold tracking-tight', dot: 'size-2', status: 'text-[13px] font-normal' },\n },\n status: {\n running: { dot: 'animate-pulse bg-success motion-reduce:animate-none' },\n paused: { root: 'text-muted-foreground', dot: 'bg-warning' },\n stopped: { root: 'text-muted-foreground', dot: 'bg-muted-foreground' },\n },\n },\n defaultVariants: { size: 'md', status: 'running' },\n});\n\nexport type TimerVariantProps = VariantProps<typeof timerVariants>;\n","import { useEffect, useState, type HTMLAttributes, type Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { formatClock, formatCompact, toIsoDuration, toMs, type DateInput, type DurationUnits } from './format';\nimport { timerVariants, type TimerVariantProps } from './timer.variants';\n\nexport type TimerStatus = 'running' | 'paused' | 'stopped';\n\nexport interface TimerLabels {\n /** Status text shown (and announced) when paused. */\n paused: string;\n /** Status text shown (and announced) when stopped. */\n stopped: string;\n /** Unit suffixes of the compact format. */\n units: DurationUnits;\n}\n\nconst DEFAULT_LABELS: TimerLabels = { paused: 'Paused', stopped: 'Stopped', units: { h: 'h', m: 'm', s: 's' } };\n\nexport interface TimerProps\n extends Omit<HTMLAttributes<HTMLSpanElement>, 'className' | 'children'>, Pick<TimerVariantProps, 'size'> {\n className?: string;\n ref?: Ref<HTMLSpanElement>;\n /** When the current run started: a Date, an ISO string or epoch ms. */\n start: DateInput;\n /** Time already accumulated before `start` (ms), e.g. earlier runs of a paused-and-resumed task. */\n offset?: number;\n /** `running` ticks; `paused` and `stopped` freeze the value (at `end` when given). */\n status?: TimerStatus;\n /** When the timer was paused or stopped; makes the frozen value exact. */\n end?: DateInput;\n /** `clock` (\"1:02:05\", default) or `compact` (\"2m 14s\"). */\n format?: 'clock' | 'compact';\n /** Shows the status dot (and the paused/stopped text). */\n showStatus?: boolean;\n /**\n * Make changes audible: a polite live region that speaks the compact value every\n * `announceEvery` ms. Off by default (role=\"timer\" is silent).\n */\n announce?: boolean;\n /** Announcement interval in ms (default one minute). */\n announceEvery?: number;\n /** Reference time (epoch ms) for the first render, e.g. the server's, so hydration matches. */\n now?: number;\n /** Visible and announced strings (English defaults). */\n labels?: Partial<TimerLabels>;\n}\n\n/**\n * Elapsed time since `start`, live while running, in a `<time dateTime=\"PT…\">` element with\n * role=\"timer\". Paused and stopped states freeze the value and show a status dot.\n */\nexport function Timer({\n start,\n offset = 0,\n status = 'running',\n end,\n format = 'clock',\n showStatus = true,\n announce = false,\n announceEvery = 60_000,\n now: initialNow,\n labels: labelsProp,\n size,\n className,\n ...props\n}: TimerProps) {\n const labels = { ...DEFAULT_LABELS, ...labelsProp };\n const [now, setNow] = useState(() => initialNow ?? Date.now());\n const running = status === 'running';\n\n useEffect(() => {\n if (!running) return;\n const tick = () => setNow(Date.now());\n const first = window.setTimeout(tick, 0);\n const id = window.setInterval(tick, 1000);\n return () => {\n window.clearTimeout(first);\n window.clearInterval(id);\n };\n }, [running]);\n\n const startMs = toMs(start) ?? now;\n const until = (!running ? toMs(end) : undefined) ?? now;\n const elapsed = Math.max(0, offset + until - startMs);\n const text = format === 'compact' ? formatCompact(elapsed, labels.units) : formatClock(elapsed);\n const statusText = status === 'paused' ? labels.paused : status === 'stopped' ? labels.stopped : undefined;\n const spokenStep = Math.max(1000, announceEvery);\n const spoken = formatCompact(Math.floor(elapsed / spokenStep) * spokenStep, labels.units);\n const s = timerVariants({ size, status });\n\n return (\n <span\n role=\"timer\"\n aria-live={announce ? 'polite' : 'off'}\n aria-atomic\n className={cn(s.root(), className)}\n data-status={status}\n {...props}\n >\n {showStatus && <span aria-hidden className={s.dot()} />}\n <time dateTime={toIsoDuration(elapsed)} aria-hidden={announce || undefined}>\n {text}\n </time>\n {announce && <span className=\"sr-only\">{statusText ? `${spoken}, ${statusText}` : spoken}</span>}\n {showStatus && statusText && (\n <span className={s.status()} aria-hidden={announce || undefined}>\n {statusText}\n </span>\n )}\n </span>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Timer',\n group: 'Display',\n status: 'beta',\n description:\n 'Elapsed time since a start, live while running (\"1:02:05\" or compact \"2m 14s\"), with paused and stopped states. Renders role=\"timer\" around a <time dateTime=\"PT…\"> duration; silent by default, `announce` speaks it politely once a minute.',\n pattern: 'timer',\n keyboard: [['—', 'Not interactive; never takes focus']],\n tokens: ['foreground', 'muted-foreground', 'success', 'warning'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const toastVariants = tv({\n slots: {\n viewport: [\n 'fixed end-4 bottom-4 z-50 flex w-[320px] max-w-[calc(100vw-2rem)] flex-col-reverse gap-2.5 outline-none',\n 'focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-focus-ring',\n ],\n root: [\n 'w-full overflow-hidden rounded-xl border border-border bg-popover text-popover-foreground shadow-lg outline-none',\n '[transform:translateX(var(--toast-swipe-movement-x,0px))_translateY(var(--toast-swipe-movement-y,0px))]',\n 'transition-[opacity,translate,scale] duration-200 ease-out motion-reduce:transition-none',\n 'data-starting-style:translate-y-3 data-starting-style:scale-[0.97] data-starting-style:opacity-0',\n 'data-ending-style:translate-y-3 data-ending-style:scale-[0.97] data-ending-style:opacity-0',\n 'data-limited:hidden focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n content: 'flex gap-3 p-3.5',\n icon: 'mt-px grid size-7 shrink-0 place-items-center rounded-lg bg-foreground/5',\n text: 'min-w-0 flex-1',\n title: 'text-[13px] font-semibold tracking-tight text-foreground',\n description: 'mt-0.5 text-[12.5px] leading-5 text-muted-foreground text-pretty',\n actions: 'mt-2 flex flex-wrap items-center gap-x-4 gap-y-1',\n action: [\n 'rounded-sm text-[12px] font-semibold transition-opacity hover:opacity-70',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n dismissAction: [\n 'rounded-sm text-[12px] font-medium text-muted-foreground transition-colors hover:text-foreground',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n close: [\n '-mt-0.5 -me-1 grid size-6 shrink-0 place-items-center rounded-md text-muted-foreground transition-colors',\n 'hover:bg-foreground/10 hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n },\n variants: {\n tone: {\n neutral: { icon: 'text-foreground', action: 'text-foreground' },\n loading: { icon: 'text-muted-foreground', action: 'text-foreground' },\n success: { icon: 'text-success-text', action: 'text-success-text' },\n info: { icon: 'text-info', action: 'text-foreground' },\n warning: { icon: 'text-warning-text', action: 'text-warning-text' },\n destructive: { icon: 'text-destructive-text', action: 'text-destructive-text' },\n },\n },\n defaultVariants: { tone: 'neutral' },\n});\n\nexport type ToastVariantProps = VariantProps<typeof toastVariants>;\nexport type ToastTone = NonNullable<ToastVariantProps['tone']>;\n","import { Toast as BaseToast } from '@base-ui/react/toast';\nimport { CircleAlert, CircleCheck, Info, TriangleAlert, X, type LucideIcon } from 'lucide-react';\nimport { useMemo, type ReactNode } from 'react';\nimport { Spinner } from '../Spinner';\nimport { usePortalDir, useI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { toastVariants, type ToastTone } from './toast.variants';\n\nconst TONE_ICON: Record<ToastTone, LucideIcon | null> = {\n neutral: null,\n loading: null,\n success: CircleCheck,\n info: Info,\n warning: TriangleAlert,\n destructive: CircleAlert,\n};\nconst TONES = new Set<string>(Object.keys(TONE_ICON));\n/** Base UI's own promise types, mapped onto the kit tones. */\nconst TYPE_ALIASES: Record<string, ToastTone> = { error: 'destructive' };\nlet toastSeq = 0;\n\nexport interface ToastProviderProps extends BaseToast.Provider.Props {\n /** Default auto-dismiss time in ms; 0 keeps toasts until closed. */\n timeout?: number;\n /** Maximum visible toasts; older ones are hidden until the newer close. */\n limit?: number;\n}\n\n/** Holds the toast queue. Wrap the app once and render a `<Toaster />` inside it. */\nexport function ToastProvider({ timeout = 5000, limit = 4, ...props }: ToastProviderProps) {\n return <BaseToast.Provider timeout={timeout} limit={limit} {...props} />;\n}\n\nexport interface ToastOptions {\n /** Pass an existing id to update that toast in place. */\n id?: string;\n title?: ReactNode;\n description?: ReactNode;\n tone?: ToastTone;\n /** Auto-dismiss time in ms; 0 keeps it until closed. Defaults to the provider's timeout. */\n timeout?: number;\n /** `high` announces urgently (assertive). Use for errors that need attention. */\n priority?: 'low' | 'high';\n /** Primary inline action, e.g. Undo. Clicking it runs `onClick` and closes the toast. */\n action?: { label: string; onClick: () => void };\n /**\n * Secondary text button that closes the toast, e.g. \"Not now\". Runs `onClick` (if any) first.\n * Like `action`, it is reachable with F6 → Tab; auto-dismiss pauses while the stack is focused or hovered.\n */\n dismissAction?: { label: string; onClick?: () => void };\n onClose?: () => void;\n}\n\n/** One state of a promise toast: a title string, full options, or a function of the result / error. */\nexport type ToastPromiseState<Arg> = string | ToastOptions | ((arg: Arg) => string | ToastOptions);\n\nexport interface ToastPromiseOptions<Value> {\n /** Shown while pending (tone `loading`, never auto-dismissed). */\n loading: string | ToastOptions;\n /** Replaces the loading toast in place on success (tone `success` unless given). */\n success: ToastPromiseState<Value>;\n /** Replaces the loading toast in place on failure (tone `destructive`, announced assertively, unless given). */\n error: ToastPromiseState<unknown>;\n}\n\ninterface ToastData {\n dismissAction?: ToastOptions['dismissAction'];\n}\n\nfunction resolveState<Arg>(state: ToastPromiseState<Arg>, arg: Arg): ToastOptions {\n const value = typeof state === 'function' ? state(arg) : state;\n return typeof value === 'string' ? { title: value } : value;\n}\n\n/** Queue toasts from any component under ToastProvider: `const toast = useToast(); toast.add({ … })`. */\nexport function useToast() {\n const manager = BaseToast.useToastManager<ToastData>();\n const { add: baseAdd, close, update, toasts } = manager;\n return useMemo(() => {\n const toBase = (toastId: string, { tone = 'neutral', action, dismissAction, ...options }: ToastOptions) => {\n const base = {\n ...options,\n type: tone,\n data: { dismissAction },\n actionProps: action\n ? {\n children: action.label,\n onClick: () => {\n action.onClick();\n close(toastId);\n },\n }\n : undefined,\n };\n delete base.id; // the id is passed separately (and must never reach update())\n return base;\n };\n /** Shows a toast and returns its id. */\n const add = (options: ToastOptions) => {\n const toastId = options.id ?? `gntik-toast-${++toastSeq}`;\n return baseAdd({ ...toBase(toastId, options), id: toastId });\n };\n /**\n * One toast that follows a promise: `loading` while pending, then updated in place to\n * `success` or `error` (which also restart its auto-dismiss). Returns the promise's own result,\n * so a rejection still rejects: `toast.promise(save(), {…}).catch(() => {})`.\n */\n const promise = <Value,>(task: Promise<Value>, options: ToastPromiseOptions<Value>): Promise<Value> => {\n const id = add({ ...resolveState(options.loading, undefined), tone: 'loading', timeout: 0 });\n return task.then(\n (value) => {\n const next = resolveState(options.success, value);\n update(id, { ...toBase(id, { tone: 'success', ...next }), timeout: next.timeout });\n return value;\n },\n (error: unknown) => {\n const next = resolveState(options.error, error);\n update(id, { ...toBase(id, { tone: 'destructive', priority: 'high', ...next }), timeout: next.timeout });\n throw error;\n },\n );\n };\n return { toasts, close, update, promise, add };\n }, [toasts, baseAdd, close, update]);\n}\n\nexport interface ToasterProps {\n className?: string;\n /** Accessible name of each toast's close button. */\n closeLabel?: string;\n /** Portal container; defaults to document.body. */\n container?: BaseToast.Portal.Props['container'];\n}\n\n/**\n * The bottom-right stack (a `region` landmark named \"Notifications\"). F6 moves focus into it;\n * hovering or focusing it pauses auto-dismiss.\n */\nexport function Toaster({ className, closeLabel: closeLabelProp, container }: ToasterProps) {\n const { t } = useI18n();\n const closeLabel = closeLabelProp ?? t('toast.dismiss');\n const dir = usePortalDir();\n const { toasts } = BaseToast.useToastManager<ToastData>();\n const s = toastVariants();\n return (\n <BaseToast.Portal container={container}>\n <BaseToast.Viewport dir={dir} className={cn(s.viewport(), className)}>\n {toasts.map((t) => {\n const type = t.type ? (TYPE_ALIASES[t.type] ?? t.type) : 'neutral';\n const tone = TONES.has(type) ? (type as ToastTone) : 'neutral';\n const dismiss = t.data?.dismissAction;\n const v = toastVariants({ tone });\n const IconCmp = TONE_ICON[tone];\n return (\n <BaseToast.Root key={t.id} toast={t} className={v.root()}>\n <BaseToast.Content className={v.content()}>\n {(IconCmp || tone === 'loading') && (\n <span className={v.icon()}>\n {IconCmp ? <IconCmp size={16} aria-hidden /> : <Spinner size={15} />}\n </span>\n )}\n <div className={v.text()}>\n <BaseToast.Title className={v.title()} />\n <BaseToast.Description className={v.description()} />\n {(t.actionProps || dismiss) && (\n <div className={v.actions()}>\n {t.actionProps && <BaseToast.Action className={v.action()} />}\n {dismiss && (\n <BaseToast.Close className={v.dismissAction()} onClick={() => dismiss.onClick?.()}>\n {dismiss.label}\n </BaseToast.Close>\n )}\n </div>\n )}\n </div>\n <BaseToast.Close aria-label={closeLabel} className={v.close()}>\n <X size={13} strokeWidth={2.4} aria-hidden />\n </BaseToast.Close>\n </BaseToast.Content>\n </BaseToast.Root>\n );\n })}\n </BaseToast.Viewport>\n </BaseToast.Portal>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Toast',\n group: 'Feedback',\n status: 'stable',\n description:\n 'Short-lived notification stacked bottom-right. Five tones (neutral, success, info, warning, destructive) plus loading, title, description, a primary action and a dismiss action next to the close button; auto-dismiss pauses while the stack is hovered or focused. `toast.promise(task, { loading, success, error })` updates one toast in place (errors are announced assertively). Mount ToastProvider + Toaster once and queue with the useToast() hook.',\n primitive: '@base-ui/react/toast',\n pattern: 'region + live announcements (status)',\n keyboard: [\n ['F6', 'Moves focus into the notifications region (pauses auto-dismiss)'],\n ['Tab / Shift+Tab', 'Reaches each toast’s primary action, dismiss action and close button'],\n ['Enter / Space', 'On the close button or dismiss action: dismisses the toast (an action also runs its handler)'],\n ],\n tokens: [\n 'popover',\n 'popover-foreground',\n 'border',\n 'foreground',\n 'muted-foreground',\n 'success-text',\n 'info',\n 'warning-text',\n 'destructive-text',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const tokenVariants = tv({\n slots: {\n root: [\n 'inline-flex max-w-full shrink-0 items-center gap-1.5 rounded-md border align-middle whitespace-nowrap select-none',\n 'data-disabled:opacity-60',\n ],\n leading: 'inline-flex shrink-0 items-center [&_svg]:shrink-0',\n label: 'min-w-0 truncate font-medium',\n remove: [\n 'grid shrink-0 cursor-pointer place-items-center rounded text-muted-foreground transition-colors motion-reduce:transition-none',\n 'hover:bg-secondary hover:text-foreground',\n 'focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus-ring',\n 'disabled:cursor-not-allowed disabled:hover:bg-transparent disabled:hover:text-muted-foreground',\n ],\n },\n variants: {\n tone: {\n neutral: { root: 'border-border bg-background text-foreground', leading: 'text-muted-foreground' },\n primary: { root: 'border-primary/35 bg-primary/10 text-primary-chip-text', leading: 'text-primary-text' },\n success: { root: 'border-success/35 bg-success/10 text-success-chip-text', leading: 'text-success-text' },\n warning: { root: 'border-warning/40 bg-warning/12 text-warning-chip-text', leading: 'text-warning-text' },\n destructive: {\n root: 'border-destructive/35 bg-destructive/10 text-destructive-chip-text',\n leading: 'text-destructive-text',\n },\n },\n size: {\n /** Follows `data-density` (comfortable = md). */\n auto: { root: 'h-token ps-2.5 text-[12px]', remove: 'size-5', label: 'max-w-[160px]' },\n sm: { root: 'h-6 ps-2 text-[11.5px]', remove: 'size-4', label: 'max-w-[120px]' },\n md: { root: 'h-7 ps-2.5 text-[12px]', remove: 'size-5', label: 'max-w-[160px]' },\n },\n removable: {\n true: { root: 'pe-1' },\n false: {},\n },\n },\n compoundVariants: [\n { removable: false, size: 'auto', class: { root: 'pe-2.5' } },\n { removable: false, size: 'sm', class: { root: 'pe-2' } },\n { removable: false, size: 'md', class: { root: 'pe-2.5' } },\n ],\n defaultVariants: { tone: 'neutral', size: 'auto', removable: false },\n});\n\nexport type TokenVariantProps = VariantProps<typeof tokenVariants>;\nexport type TokenTone = NonNullable<TokenVariantProps['tone']>;\n","import { X } from 'lucide-react';\nimport type { HTMLAttributes, KeyboardEvent, ReactNode, Ref } from 'react';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { tokenVariants, type TokenVariantProps } from './token.variants';\n\nexport interface TokenProps\n extends\n Omit<HTMLAttributes<HTMLSpanElement>, 'className' | 'children' | 'prefix'>,\n Omit<TokenVariantProps, 'removable'> {\n className?: string;\n ref?: Ref<HTMLSpanElement>;\n /** The chip text (e.g. a filter value or a recipient). */\n label: ReactNode;\n /** Optional text before the label, muted (e.g. the filter key: \"Region:\"). */\n prefix?: ReactNode;\n /** Leading slot: an icon (`aria-hidden`) or a small Avatar. */\n icon?: ReactNode;\n /** Renders the remove button; called on click, Enter, Space, Backspace or Delete. */\n onRemove?: () => void;\n /** Accessible name of the remove button. Defaults to \"Remove {label}\" for string labels. */\n removeLabel?: string;\n disabled?: boolean;\n}\n\n/**\n * Removable chip used by filter bars and recipient inputs. The remove button is the only\n * focus target; Backspace or Delete on it also removes the chip.\n */\nexport function Token({\n label,\n prefix,\n icon,\n tone,\n size,\n onRemove,\n removeLabel,\n disabled = false,\n className,\n ...props\n}: TokenProps) {\n const { t } = useI18n();\n const s = tokenVariants({ tone, size, removable: onRemove != null });\n const name =\n removeLabel ??\n (typeof label === 'string' || typeof label === 'number' ? t('common.removeItem', { label }) : t('common.remove'));\n const onKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n if (disabled || !onRemove) return;\n if (event.key === 'Backspace' || event.key === 'Delete') {\n event.preventDefault();\n onRemove();\n }\n };\n return (\n <span data-disabled={disabled || undefined} className={cn(s.root(), className)} {...props}>\n {icon != null && <span className={s.leading()}>{icon}</span>}\n {prefix != null && <span className=\"shrink-0 text-muted-foreground\">{prefix}</span>}\n <span className={s.label()}>{label}</span>\n {onRemove && (\n <button\n type=\"button\"\n aria-label={name}\n disabled={disabled}\n onClick={onRemove}\n onKeyDown={onKeyDown}\n className={s.remove()}\n >\n <X size={size === 'sm' ? 11 : 12} strokeWidth={2.4} aria-hidden />\n </button>\n )}\n </span>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Token',\n group: 'Display',\n status: 'beta',\n description:\n 'Removable chip for active filters and recipient inputs: label with an optional muted prefix (\"Region:\"), a leading icon or avatar slot, tones (neutral, primary, success, warning, destructive), sizes sm and md, and an accessible \"Remove {label}\" button. Disabled tokens keep their label but cannot be removed.',\n pattern: 'button (remove)',\n keyboard: [\n ['Tab', 'Moves focus to the remove button'],\n ['Enter', 'Removes the token'],\n ['Space', 'Removes the token'],\n ['Backspace', 'Removes the token while its remove button is focused (also Delete)'],\n ],\n tokens: [\n 'border',\n 'background',\n 'foreground',\n 'muted-foreground',\n 'secondary',\n 'primary',\n 'primary-text',\n 'success-text',\n 'warning-text',\n 'destructive-text',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\n/** The Input wrapper look, wrapping: chips first, then the free-text input. */\nexport const tokenInputVariants = tv({\n slots: {\n root: [\n 'flex w-full min-w-0 cursor-text flex-wrap items-center gap-1.5 rounded-md border border-border bg-background text-foreground shadow-sm transition-colors motion-reduce:transition-none',\n 'has-[input:focus-visible]:border-primary/60 has-[input:focus-visible]:outline-2 has-[input:focus-visible]:outline-offset-2 has-[input:focus-visible]:outline-focus-ring',\n 'data-invalid:border-destructive/70 has-[input[data-invalid]]:border-destructive/70',\n 'data-disabled:cursor-not-allowed data-disabled:bg-secondary/50 has-[input:disabled]:cursor-not-allowed has-[input:disabled]:bg-secondary/50',\n ],\n list: 'contents',\n input:\n 'min-w-24 flex-1 bg-transparent text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed',\n counter: 'ms-auto shrink-0 pe-0.5 font-mono text-[11px] text-muted-foreground tabular-nums',\n chip: [\n 'inline-flex max-w-full items-center gap-1 rounded border border-transparent bg-primary/14 pe-1 ps-2 font-medium text-primary-chip-text',\n 'data-invalid:border-destructive/50 data-invalid:bg-destructive/12 data-invalid:text-destructive-chip-text',\n 'data-disabled:opacity-60',\n ],\n chipText: 'truncate',\n chipRemove: [\n 'grid size-4 shrink-0 place-items-center rounded transition-colors motion-reduce:transition-none hover:bg-primary/20',\n 'focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus-ring',\n 'group-data-invalid/chip:hover:bg-destructive/20 disabled:pointer-events-none',\n ],\n },\n variants: {\n size: {\n sm: { root: 'min-h-8 px-1.5 py-1', input: 'h-6 px-1 text-[12px]', chip: 'h-5.5 text-[11.5px]' },\n md: { root: 'min-h-9 px-2 py-1.5', input: 'h-6 px-1 text-[13px]', chip: 'h-6 text-[12px]' },\n },\n },\n defaultVariants: { size: 'md' },\n});\n\nexport type TokenInputVariantProps = VariantProps<typeof tokenInputVariants>;\n","import { CircleAlert, X } from 'lucide-react';\nimport type { ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { tokenInputVariants, type TokenInputVariantProps } from './token-input.variants';\n\nexport interface TokenInputChipProps extends TokenInputVariantProps {\n children: ReactNode;\n /** Validation message; marks the chip invalid and is read after its text. */\n error?: string | null;\n /** Shows the remove button when given. */\n onRemove?: () => void;\n removeLabel?: string;\n disabled?: boolean;\n className?: string;\n}\n\n/** A committed entry inside TokenInput: text, invalid state and a remove button. */\nexport function TokenInputChip({\n children,\n error,\n onRemove,\n removeLabel: removeLabelProp,\n disabled,\n size,\n className,\n}: TokenInputChipProps) {\n const { t } = useI18n();\n const removeLabel = removeLabelProp ?? t('common.remove');\n const s = tokenInputVariants({ size });\n return (\n <span\n role=\"listitem\"\n title={error ?? undefined}\n data-invalid={error ? '' : undefined}\n data-disabled={disabled ? '' : undefined}\n className={cn('group/chip', s.chip(), className)}\n >\n {error && <CircleAlert size={11} strokeWidth={2.4} aria-hidden className=\"shrink-0\" />}\n <span className={s.chipText()}>{children}</span>\n {error && <span className=\"sr-only\">, {t('common.invalid', { error })}</span>}\n {onRemove && (\n <button\n type=\"button\"\n aria-label={removeLabel}\n disabled={disabled}\n className={s.chipRemove()}\n onClick={onRemove}\n >\n <X size={11} strokeWidth={2.4} aria-hidden />\n </button>\n )}\n </span>\n );\n}\n","import { Field } from '@base-ui/react/field';\nimport { useId, useRef, useState, type ClipboardEvent, type KeyboardEvent, type MouseEvent, type Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { TokenInputChip } from './TokenInputChip';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { tokenInputVariants, type TokenInputVariantProps } from './token-input.variants';\n\nexport interface TokenInputProps extends TokenInputVariantProps {\n /** Committed entries (controlled). */\n value?: string[];\n defaultValue?: string[];\n onValueChange?: (tokens: string[]) => void;\n /** Returns an error message for an invalid entry; the chip is kept and marked invalid. */\n validate?: (token: string) => string | null | undefined;\n /** Maximum number of entries; further commits are ignored. */\n maxItems?: number;\n /** Characters that commit the current text (Enter and Tab always do). */\n separators?: string[];\n /** Keep exact duplicates (case-insensitive) instead of ignoring them. */\n allowDuplicates?: boolean;\n /** Normalises an entry before it is committed (default: trim). */\n transform?: (raw: string) => string;\n /** Commit the pending text when the input loses focus. */\n commitOnBlur?: boolean;\n placeholder?: string;\n /** Submitted as one comma-separated value through a hidden input. */\n name?: string;\n id?: string;\n disabled?: boolean;\n /** Marks the field invalid. Any invalid chip does this too. */\n invalid?: boolean;\n className?: string;\n inputClassName?: string;\n ref?: Ref<HTMLInputElement>;\n removeLabel?: (token: string) => string;\n /** Accessible name of the chip list. */\n listLabel?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n}\n\nconst escapeRe = (s: string) => s.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\nconst defaultTransform = (raw: string) => raw.trim();\n\n/**\n * Free-entry chips (emails, labels, hosts): Enter, Tab or a separator commits the text,\n * Backspace on an empty input removes the last chip, pasted lists are split, `validate`\n * marks bad entries. The text input is a Base UI Field control, so Field labels it.\n */\nexport function TokenInput({\n value,\n defaultValue,\n onValueChange,\n validate,\n maxItems,\n separators = [',', ';'],\n allowDuplicates = false,\n transform = defaultTransform,\n commitOnBlur = true,\n placeholder,\n name,\n id,\n disabled,\n invalid,\n size = 'md',\n className,\n inputClassName,\n ref,\n removeLabel: removeLabelProp,\n listLabel: listLabelProp,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n}: TokenInputProps) {\n const i18n = useI18n();\n const listLabel = listLabelProp ?? i18n.t('tokenInput.entries');\n const removeLabel = removeLabelProp ?? ((token: string) => i18n.t('common.removeItem', { label: token }));\n const [inner, setInner] = useState<string[]>(defaultValue ?? []);\n const [draft, setDraft] = useState('');\n const [announcement, setAnnouncement] = useState('');\n const inputRef = useRef<HTMLInputElement | null>(null);\n const statusId = useId();\n const tokens = value ?? inner;\n const errors = tokens.map((t) => validate?.(t) ?? null);\n const hasInvalid = !!invalid || errors.some(Boolean);\n const full = maxItems != null && tokens.length >= maxItems;\n const s = tokenInputVariants({ size });\n const splitRe = new RegExp(`[${separators.map(escapeRe).join('')}\\\\n\\\\t]+`);\n\n const update = (next: string[], message: string) => {\n setInner(next);\n onValueChange?.(next);\n setAnnouncement(message);\n };\n\n /** Commits raw entries; returns whether anything was consumed. */\n const commit = (raws: string[]) => {\n const next = [...tokens];\n const added: string[] = [];\n let limited = false;\n for (const raw of raws) {\n const t = transform(raw);\n if (!t) continue;\n if (!allowDuplicates && next.some((x) => x.toLowerCase() === t.toLowerCase())) continue;\n if (maxItems != null && next.length >= maxItems) {\n limited = true;\n break;\n }\n next.push(t);\n added.push(t);\n }\n setDraft('');\n if (added.length)\n update(\n next,\n [\n i18n.t('tokenInput.added', { items: added.join(', ') }),\n limited ? i18n.t('tokenInput.limit', { max: maxItems ?? 0 }) : '',\n ]\n .filter(Boolean)\n .join(' '),\n );\n else if (limited) setAnnouncement(i18n.t('tokenInput.limit', { max: maxItems ?? 0 }));\n };\n\n const remove = (index: number) => {\n const t = tokens[index];\n if (t === undefined) return;\n update(\n tokens.filter((_, i) => i !== index),\n i18n.t('common.removed', { label: t }),\n );\n inputRef.current?.focus();\n };\n\n const onKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n const hasText = draft.trim() !== '';\n if ((e.key === 'Enter' || e.key === 'Tab') && hasText && !e.shiftKey) {\n e.preventDefault();\n commit([draft]);\n } else if (separators.includes(e.key)) {\n e.preventDefault();\n if (hasText) commit([draft]);\n } else if (e.key === 'Backspace' && draft === '' && tokens.length > 0) {\n e.preventDefault();\n remove(tokens.length - 1);\n }\n };\n\n const onPaste = (e: ClipboardEvent<HTMLInputElement>) => {\n const text = e.clipboardData.getData('text');\n if (!splitRe.test(text)) return;\n e.preventDefault();\n commit((draft + text).split(splitRe));\n };\n\n const onRootMouseDown = (e: MouseEvent<HTMLDivElement>) => {\n if (e.target !== e.currentTarget) return;\n e.preventDefault();\n inputRef.current?.focus();\n };\n\n const setRefs = (node: HTMLInputElement | null) => {\n inputRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n };\n\n return (\n <div\n className={cn(s.root(), className)}\n data-invalid={hasInvalid || undefined}\n data-disabled={disabled || undefined}\n data-full={full || undefined}\n onMouseDown={onRootMouseDown}\n >\n {tokens.length > 0 && (\n <span role=\"list\" aria-label={listLabel} className={s.list()}>\n {tokens.map((t, i) => (\n <TokenInputChip\n key={`${t}-${i}`}\n size={size}\n error={errors[i]}\n disabled={disabled}\n removeLabel={removeLabel(t)}\n onRemove={() => remove(i)}\n >\n {t}\n </TokenInputChip>\n ))}\n </span>\n )}\n <Field.Control\n ref={setRefs}\n id={id}\n disabled={disabled}\n value={draft}\n onValueChange={(v) => setDraft(v)}\n onKeyDown={onKeyDown}\n onPaste={onPaste}\n onBlur={() => {\n if (commitOnBlur && draft.trim()) commit([draft]);\n }}\n placeholder={full ? undefined : placeholder}\n autoComplete=\"off\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={cn(ariaDescribedBy, statusId)}\n aria-invalid={hasInvalid || undefined}\n className={cn(s.input(), inputClassName)}\n />\n {maxItems != null && (\n <span aria-hidden className={s.counter()}>\n {tokens.length}/{maxItems}\n </span>\n )}\n <span id={statusId} className=\"sr-only\">\n {maxItems != null ? `${tokens.length} of ${maxItems} entries.` : ''}\n {errors.some(Boolean) ? ` ${errors.filter(Boolean).length} invalid.` : ''}\n </span>\n <span role=\"status\" className=\"sr-only\">\n {announcement}\n </span>\n {name && <input type=\"hidden\" name={name} value={tokens.join(',')} />}\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'TokenInput',\n group: 'Forms',\n status: 'beta',\n description:\n 'Free-entry chips for emails, labels or hosts: Enter, Tab or a separator commits, pasted lists are split, `validate` marks bad entries as invalid chips, `maxItems` caps the list. Additions and removals are announced; works inside Field.',\n primitive: '@base-ui/react/field (Field.Control)',\n pattern: 'textbox + list of removable entries',\n keyboard: [\n ['Enter / Tab', 'Commits the typed text as a chip (Tab only when there is text)'],\n [', / ;', 'Commits the typed text (configurable separators)'],\n ['Backspace', 'On an empty input, removes the last chip'],\n ['Paste', 'Splits the clipboard on separators and new lines into chips'],\n ['Tab to a chip button, Enter', 'Removes that chip'],\n ],\n tokens: [\n 'background',\n 'border',\n 'foreground',\n 'muted-foreground',\n 'primary',\n 'primary-text',\n 'destructive',\n 'destructive-text',\n 'secondary',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nconst focusRing = 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring';\n\nexport const toolbarVariants = tv({\n slots: {\n root: 'flex w-full min-w-0 items-center gap-2',\n group: 'flex items-center gap-1',\n lane: 'flex min-w-0 items-center gap-2',\n separator: 'mx-1 h-4 w-px shrink-0 bg-border',\n inputWrap: 'relative min-w-0 flex-1',\n inputIcon: 'pointer-events-none absolute top-1/2 start-2.5 -translate-y-1/2 text-muted-foreground',\n input: [\n 'h-control-sm w-full min-w-[150px] rounded-md border border-border bg-background px-2.5 text-[12.5px] text-foreground transition-colors',\n 'placeholder:text-muted-foreground hover:border-ring/50',\n focusRing,\n 'data-disabled:cursor-not-allowed data-disabled:opacity-50',\n ],\n link: [\n 'inline-flex h-control-sm items-center rounded-md px-1.5 text-[12.5px] font-medium text-primary-text underline-offset-4 hover:underline',\n focusRing,\n ],\n },\n variants: {\n variant: {\n /** Full-width action bar above a table or list. */\n bar: { root: 'border-b border-border bg-secondary/20 px-3 py-bar' },\n /** Self-contained floating group (e.g. formatting controls). */\n floating: { root: 'w-auto inline-flex rounded-lg border border-border bg-card p-1 shadow-sm gap-1' },\n /** No chrome; lays out items only. */\n plain: {},\n },\n lane: {\n start: { lane: 'me-auto' },\n center: { lane: 'mx-auto justify-center' },\n end: { lane: 'ms-auto justify-end' },\n },\n },\n defaultVariants: { variant: 'bar', lane: 'start' },\n});\n\nexport type ToolbarVariantProps = VariantProps<typeof toolbarVariants>;\n","import { Toolbar as BaseToolbar } from '@base-ui/react/toolbar';\nimport type { ComponentType, HTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { buttonVariants, BUTTON_ICON_SIZE } from '../Button/button.variants';\nimport { toolbarVariants, type ToolbarVariantProps } from './toolbar.variants';\n\ntype IconComponent = ComponentType<{ size?: number; className?: string; 'aria-hidden'?: boolean }>;\ntype ButtonVariant = 'primary' | 'secondary' | 'soft' | 'ghost' | 'destructive';\n\nconst s = toolbarVariants();\n\nexport interface ToolbarProps extends Omit<BaseToolbar.Root.Props, 'className'> {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n /** `bar` (table/list header), `floating` (bordered group) or `plain`. */\n variant?: ToolbarVariantProps['variant'];\n /** Accessible name; required when the page has more than one toolbar. */\n 'aria-label'?: string;\n}\n\n/**\n * A row of controls with one Tab stop: arrow keys move focus between items (roving tabindex),\n * Tab leaves the toolbar. Items can sit inside ToolbarStart / ToolbarCenter / ToolbarEnd lanes.\n */\nexport function Toolbar({ variant, className, ...props }: ToolbarProps) {\n return <BaseToolbar.Root className={cn(toolbarVariants({ variant }).root(), className)} {...props} />;\n}\n\ntype LaneProps = HTMLAttributes<HTMLDivElement> & { ref?: Ref<HTMLDivElement> };\n\n/** Left-aligned lane (search, filters). */\nexport function ToolbarStart({ className, ...props }: LaneProps) {\n return <div className={cn(toolbarVariants({ lane: 'start' }).lane(), className)} {...props} />;\n}\n/** Centered lane (titles, pagers). */\nexport function ToolbarCenter({ className, ...props }: LaneProps) {\n return <div className={cn(toolbarVariants({ lane: 'center' }).lane(), className)} {...props} />;\n}\n/** Right-aligned lane (primary action). */\nexport function ToolbarEnd({ className, ...props }: LaneProps) {\n return <div className={cn(toolbarVariants({ lane: 'end' }).lane(), className)} {...props} />;\n}\n\nexport interface ToolbarButtonProps extends Omit<BaseToolbar.Button.Props, 'className'> {\n className?: string;\n ref?: Ref<HTMLButtonElement>;\n /** Kit button variant. */\n variant?: ButtonVariant;\n /** Fixed button size. Omitted, the button is small and follows the density (h-control-sm). */\n size?: 'sm' | 'md';\n /** Leading icon. Without children the button is icon-only: pass `aria-label`. */\n icon?: IconComponent;\n children?: ReactNode;\n}\n\n/** A toolbar item styled as a kit Button (ghost, small by default). Stays focusable when disabled. */\nexport function ToolbarButton({\n variant = 'ghost',\n size,\n icon: IconCmp,\n className,\n children,\n ...props\n}: ToolbarButtonProps) {\n const iconOnly = children == null;\n // No size: the small button with density-driven height/padding (comfortable = sm exactly).\n const auto = size == null && (iconOnly ? 'size-control-sm' : 'h-control-sm px-control-sm');\n return (\n <BaseToolbar.Button\n className={cn(buttonVariants({ variant, size: size ?? 'sm', iconOnly }), auto, className)}\n {...props}\n >\n {IconCmp && <IconCmp size={BUTTON_ICON_SIZE[size ?? 'sm']} aria-hidden />}\n {children}\n </BaseToolbar.Button>\n );\n}\n\nexport interface ToolbarGroupProps extends Omit<BaseToolbar.Group.Props, 'className'> {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n}\n\n/** Groups related items; `disabled` disables all of them. */\nexport function ToolbarGroup({ className, ...props }: ToolbarGroupProps) {\n return <BaseToolbar.Group className={cn(s.group(), className)} {...props} />;\n}\n\nexport interface ToolbarSeparatorProps extends Omit<BaseToolbar.Separator.Props, 'className'> {\n className?: string;\n}\n\n/** Thin divider between groups (role=\"separator\", perpendicular to the toolbar). */\nexport function ToolbarSeparator({ className, ...props }: ToolbarSeparatorProps) {\n return <BaseToolbar.Separator className={cn(s.separator(), className)} {...props} />;\n}\n\nexport interface ToolbarLinkProps extends Omit<BaseToolbar.Link.Props, 'className'> {\n className?: string;\n ref?: Ref<HTMLAnchorElement>;\n}\n\n/** A link inside the toolbar, in brand green. */\nexport function ToolbarLink({ className, ...props }: ToolbarLinkProps) {\n return <BaseToolbar.Link className={cn(s.link(), className)} {...props} />;\n}\n\nexport interface ToolbarInputProps extends Omit<BaseToolbar.Input.Props, 'className'> {\n className?: string;\n ref?: Ref<HTMLInputElement>;\n /** Leading icon inside the field (e.g. Search). */\n icon?: IconComponent;\n /** Class for the wrapper that sizes the field. */\n wrapperClassName?: string;\n}\n\n/** A text field inside the toolbar. ArrowLeft/Right move the caret; at the edges they move to the next item. */\nexport function ToolbarInput({ icon: IconCmp, className, wrapperClassName, ...props }: ToolbarInputProps) {\n return (\n <div className={cn(s.inputWrap(), wrapperClassName)}>\n {IconCmp && <IconCmp size={14} className={s.inputIcon()} aria-hidden />}\n <BaseToolbar.Input className={cn(s.input(), IconCmp && 'ps-8', className)} {...props} />\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Toolbar',\n group: 'Actions',\n status: 'stable',\n description:\n 'Action bar above tables and lists: search, filters and actions with a single Tab stop and arrow-key navigation. Start / center / end lanes, groups, separators, links and inputs; buttons use the kit Button styles. Variants: bar, floating, plain.',\n primitive: '@base-ui/react/toolbar',\n pattern: 'toolbar',\n keyboard: [\n ['ArrowRight / ArrowLeft', 'Moves focus to the next / previous item (roving tabindex, wraps around)'],\n ['Tab / Shift+Tab', 'Moves focus out of the toolbar (one Tab stop)'],\n ['Enter / Space', 'Activates the focused button'],\n ],\n tokens: [\n 'border',\n 'secondary',\n 'card',\n 'background',\n 'primary',\n 'primary-text',\n 'muted-foreground',\n 'foreground',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\nimport { POPOVER_ARROW_SIDES } from '../Popover/popover.variants';\n\nexport const tourVariants = tv({\n slots: {\n positioner: 'z-50 outline-none',\n popup: [\n 'relative w-[min(22rem,calc(100vw-2rem))] origin-[var(--transform-origin)] rounded-xl border border-border bg-popover p-4 text-popover-foreground shadow-lg outline-none',\n 'transition-[opacity,scale] duration-150 motion-reduce:transition-none',\n 'data-starting-style:scale-95 data-starting-style:opacity-0 data-ending-style:scale-95 data-ending-style:opacity-0',\n ],\n arrow: ['size-2.5 rotate-45 rounded-[2px] border-border bg-popover', ...POPOVER_ARROW_SIDES],\n counter: 'font-mono text-[10.5px] font-medium tracking-wider text-primary-text uppercase',\n title: 'mt-1 pe-6 text-[14px] font-semibold tracking-tight text-foreground',\n description: 'mt-1.5 text-[12.5px] leading-5 text-muted-foreground text-pretty',\n footer: 'mt-4 flex items-center gap-2',\n skip: 'me-auto',\n close: [\n 'absolute end-2 top-2 grid size-7 place-items-center rounded-md text-muted-foreground transition-colors',\n 'hover:bg-secondary/60 hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n dots: 'flex items-center gap-1',\n dot: 'size-1.5 rounded-full bg-border data-current:bg-primary',\n highlight:\n 'pointer-events-none fixed z-40 rounded-lg outline-2 outline-offset-4 outline-focus-ring transition-[top,left,width,height] duration-200 motion-reduce:transition-none',\n },\n});\n\nexport type TourVariantProps = VariantProps<typeof tourVariants>;\n","import { Popover as BasePopover } from '@base-ui/react/popover';\nimport { X } from 'lucide-react';\nimport { useLayoutEffect, useRef, useState, type KeyboardEvent, type ReactNode, type RefObject } from 'react';\nimport { createPortal } from 'react-dom';\nimport { cn } from '../../utils/cn';\nimport { Button } from '../Button';\nimport { tourVariants } from './tour.variants';\n\nexport type TourTarget = string | RefObject<Element | null> | (() => Element | null);\n\nexport interface TourStep {\n /** CSS selector, ref or getter for the element the step points at. Missing targets centre the step. */\n target: TourTarget;\n title: ReactNode;\n content?: ReactNode;\n side?: BasePopover.Positioner.Props['side'];\n align?: BasePopover.Positioner.Props['align'];\n}\n\nexport interface TourLabels {\n back: string;\n next: string;\n finish: string;\n skip: string;\n close: string;\n counter: (step: number, total: number) => string;\n}\n\nconst defaultLabels: TourLabels = {\n back: 'Back',\n next: 'Next',\n finish: 'Finish',\n skip: 'Skip tour',\n close: 'End tour',\n counter: (i, n) => `Step ${i + 1} of ${n}`,\n};\n\nexport interface TourProps {\n steps: TourStep[];\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n step?: number;\n defaultStep?: number;\n onStepChange?: (step: number) => void;\n /** Called when the tour ends: `completed` is true after Finish, false after Skip / Escape. */\n onFinish?: (completed: boolean) => void;\n /** Outline the target with the focus ring while its step is shown. */\n highlight?: boolean;\n labels?: Partial<TourLabels>;\n className?: string;\n}\n\nfunction resolve(target: TourTarget | undefined): Element | null {\n if (!target || typeof document === 'undefined') return null;\n if (typeof target === 'string') return document.querySelector(target);\n if (typeof target === 'function') return target();\n return target.current;\n}\n\nconst centre = {\n getBoundingClientRect: () => {\n const x = window.innerWidth / 2;\n const y = window.innerHeight / 2;\n return { x, y, top: y, left: x, right: x, bottom: y, width: 0, height: 0, toJSON: () => ({}) } as DOMRect;\n },\n};\n\n/**\n * Onboarding steps anchored to elements: a non-modal popover (role dialog) positioned at each\n * step's target, with a step counter and Back / Next / Skip. Focus moves into the step and\n * returns where it was when the tour ends; Escape ends it; the target gets a focus-ring\n * outline (no overlay).\n */\nexport function Tour({\n steps,\n open,\n defaultOpen = false,\n onOpenChange,\n step,\n defaultStep = 0,\n onStepChange,\n onFinish,\n highlight = true,\n labels: labelsProp,\n className,\n}: TourProps) {\n const labels = { ...defaultLabels, ...labelsProp };\n const [innerOpen, setInnerOpen] = useState(defaultOpen);\n const [innerStep, setInnerStep] = useState(defaultStep);\n const isOpen = (open ?? innerOpen) && steps.length > 0;\n const index = Math.min(Math.max(step ?? innerStep, 0), Math.max(steps.length - 1, 0));\n const current = steps[index];\n const last = index === steps.length - 1;\n const primaryRef = useRef<HTMLButtonElement | null>(null);\n const ringRef = useRef<HTMLDivElement | null>(null);\n const s = tourVariants();\n\n const setOpen = (next: boolean) => {\n setInnerOpen(next);\n onOpenChange?.(next);\n };\n const goTo = (i: number) => {\n const next = Math.min(Math.max(i, 0), steps.length - 1);\n setInnerStep(next);\n onStepChange?.(next);\n };\n const end = (completed: boolean) => {\n setOpen(false);\n onFinish?.(completed);\n };\n\n // Scroll the target into view and keep the highlight ring on it.\n useLayoutEffect(() => {\n const ring = ringRef.current;\n const el = isOpen ? resolve(current?.target) : null;\n if (!el) return;\n const reduced = window.matchMedia?.('(prefers-reduced-motion: reduce)').matches;\n el.scrollIntoView?.({ block: 'center', inline: 'nearest', behavior: reduced ? 'auto' : 'smooth' });\n if (!ring) return;\n const place = () => {\n const r = el.getBoundingClientRect();\n Object.assign(ring.style, {\n top: `${r.top}px`,\n left: `${r.left}px`,\n width: `${r.width}px`,\n height: `${r.height}px`,\n });\n };\n place();\n window.addEventListener('scroll', place, true);\n window.addEventListener('resize', place);\n return () => {\n window.removeEventListener('scroll', place, true);\n window.removeEventListener('resize', place);\n };\n }, [isOpen, current?.target]);\n\n const onKeyDown = (e: KeyboardEvent<HTMLDivElement>) => {\n const tag = (e.target as HTMLElement).tagName;\n if (tag === 'INPUT' || tag === 'TEXTAREA') return;\n const rtl = getComputedStyle(e.currentTarget).direction === 'rtl';\n const fwd = rtl ? 'ArrowLeft' : 'ArrowRight';\n const back = rtl ? 'ArrowRight' : 'ArrowLeft';\n if (e.key === fwd && !last) goTo(index + 1);\n else if (e.key === back && index > 0) goTo(index - 1);\n else return;\n e.preventDefault();\n };\n\n const target = current?.target;\n return (\n <>\n <BasePopover.Root\n modal=\"trap-focus\"\n open={isOpen}\n onOpenChange={(next, details) => {\n if (next) return;\n if (details.reason === 'outside-press' || details.reason === 'focus-out') return;\n end(false);\n }}\n >\n <BasePopover.Portal>\n <BasePopover.Positioner\n className={s.positioner()}\n anchor={() => resolve(target) ?? centre}\n side={current?.side ?? 'bottom'}\n align={current?.align ?? 'center'}\n sideOffset={14}\n collisionPadding={12}\n >\n <BasePopover.Popup className={cn(s.popup(), className)} initialFocus={primaryRef} onKeyDown={onKeyDown}>\n <BasePopover.Arrow className={s.arrow()} />\n <p className={s.counter()}>{labels.counter(index, steps.length)}</p>\n <BasePopover.Title className={s.title()}>{current?.title}</BasePopover.Title>\n {current?.content != null && (\n <BasePopover.Description className={s.description()}>{current.content}</BasePopover.Description>\n )}\n <button type=\"button\" aria-label={labels.close} className={s.close()} onClick={() => end(false)}>\n <X size={14} aria-hidden />\n </button>\n <div className={s.footer()}>\n {!last && (\n <Button size=\"sm\" variant=\"ghost\" className={s.skip()} onClick={() => end(false)}>\n {labels.skip}\n </Button>\n )}\n {last && <span className={s.skip()} />}\n {index > 0 && (\n <Button size=\"sm\" variant=\"secondary\" onClick={() => goTo(index - 1)}>\n {labels.back}\n </Button>\n )}\n <Button ref={primaryRef} size=\"sm\" onClick={() => (last ? end(true) : goTo(index + 1))}>\n {last ? labels.finish : labels.next}\n </Button>\n </div>\n </BasePopover.Popup>\n </BasePopover.Positioner>\n </BasePopover.Portal>\n </BasePopover.Root>\n {isOpen &&\n highlight &&\n typeof document !== 'undefined' &&\n createPortal(<div ref={ringRef} aria-hidden data-tour-highlight=\"\" className={s.highlight()} />, document.body)}\n </>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Tour',\n group: 'Overlays',\n status: 'beta',\n description:\n 'Onboarding steps anchored to elements (selector, ref or getter): a non-modal popover with a step counter and Back / Next / Skip, positioned at each target and outlined with the focus ring (no overlay, no glow). Focus moves into the step and returns when the tour ends; missing targets centre the step.',\n primitive: '@base-ui/react/popover',\n pattern: 'non-modal dialog (popover) per step',\n keyboard: [\n ['Tab / Shift+Tab', 'Cycles through the close button, Skip, Back and Next (focus stays in the step)'],\n ['Enter / Space', 'Activates the focused button (Next moves focus to the next step)'],\n ['ArrowRight / ArrowLeft', 'Next / previous step (mirrored in RTL)'],\n ['Escape', 'Ends the tour and returns focus'],\n ],\n tokens: ['popover', 'popover-foreground', 'border', 'primary', 'primary-text', 'muted-foreground', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const transferListVariants = tv({\n slots: {\n root: 'grid min-w-0 grid-cols-1 items-stretch gap-3 sm:grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)]',\n pane: 'flex min-w-0 flex-col overflow-hidden rounded-xl border border-border bg-card shadow-sm',\n paneHead: 'flex items-center gap-2 border-b border-border px-3 py-2.5',\n paneTitle: 'min-w-0 flex-1 truncate text-[13px] font-semibold text-foreground',\n paneCount: 'shrink-0 font-mono text-[11px] text-muted-foreground tabular-nums',\n search: 'border-b border-border p-2',\n listbox: [\n 'min-h-0 flex-1 overflow-y-auto p-1 outline-none',\n 'focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus-ring',\n ],\n option: [\n 'flex cursor-default items-start gap-2.5 rounded-[6px] px-2 py-1.5 text-[13px] text-foreground select-none',\n 'hover:bg-secondary/50 data-active:bg-secondary/70 aria-selected:bg-primary/12 aria-selected:data-active:bg-primary/16',\n 'aria-disabled:cursor-not-allowed aria-disabled:opacity-45',\n ],\n check: [\n 'mt-0.5 grid size-4 shrink-0 place-items-center rounded-[4px] border border-border bg-background text-primary-foreground',\n 'group-aria-selected/option:border-primary group-aria-selected/option:bg-primary',\n ],\n optionText: 'flex min-w-0 flex-col',\n optionLabel: 'truncate',\n optionDescription: 'truncate text-[11.5px] text-muted-foreground',\n empty: 'grid place-items-center px-3 py-6 text-center text-[12.5px] text-muted-foreground',\n paneFoot: 'flex items-center gap-1 border-t border-border px-2 py-1.5',\n footHint: 'ms-1 min-w-0 flex-1 truncate text-[11.5px] text-muted-foreground',\n actions: 'flex flex-row items-center justify-center gap-1.5 sm:flex-col',\n },\n});\n\nexport type TransferListVariantProps = VariantProps<typeof transferListVariants>;\n","import { Check, Search } from 'lucide-react';\nimport { useEffect, useState, type KeyboardEvent, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { Input } from '../Input';\nimport { transferListVariants } from './transfer-list.variants';\n\nexport interface TransferListItem {\n value: string;\n label: string;\n description?: string;\n disabled?: boolean;\n}\n\nconst s = transferListVariants();\n\nexport interface TransferListPaneProps {\n id: string;\n title: ReactNode;\n items: TransferListItem[];\n checked: ReadonlySet<string>;\n onCheckedChange: (next: Set<string>) => void;\n /** Moves the given values to the other pane. */\n onTransfer: (values: string[]) => void;\n /** Selected pane only: moves the given values by one position. */\n onReorder?: (values: string[], delta: -1 | 1) => void;\n searchable: boolean;\n searchLabel: string;\n searchPlaceholder: string;\n emptyText: ReactNode;\n noMatchesText: ReactNode;\n countLabel: (checked: number, total: number) => string;\n footer?: ReactNode;\n height: number | string;\n}\n\n/** One side of a TransferList: title, search and a multi-select listbox (aria-activedescendant). */\nexport function TransferListPane({\n id,\n title,\n items,\n checked,\n onCheckedChange,\n onTransfer,\n onReorder,\n searchable,\n searchLabel,\n searchPlaceholder,\n emptyText,\n noMatchesText,\n countLabel,\n footer,\n height,\n}: TransferListPaneProps) {\n const [query, setQuery] = useState('');\n const [activeValue, setActiveValue] = useState<string | null>(null);\n const q = query.trim().toLowerCase();\n const visible = q ? items.filter((it) => `${it.label} ${it.description ?? ''}`.toLowerCase().includes(q)) : items;\n const activeIndex = Math.max(\n 0,\n visible.findIndex((it) => it.value === activeValue),\n );\n const active = visible[activeIndex];\n const titleId = `${id}-title`;\n const optionId = (i: number) => `${id}-opt-${i}`;\n\n useEffect(() => {\n document.getElementById(optionId(activeIndex))?.scrollIntoView?.({ block: 'nearest' });\n });\n\n const toggle = (value: string, on?: boolean) => {\n const it = items.find((x) => x.value === value);\n if (!it || it.disabled) return;\n const next = new Set(checked);\n if (on ?? !next.has(value)) next.add(value);\n else next.delete(value);\n onCheckedChange(next);\n };\n\n const targets = () =>\n checked.size\n ? items.filter((it) => checked.has(it.value)).map((it) => it.value)\n : active && !active.disabled\n ? [active.value]\n : [];\n\n const onKeyDown = (e: KeyboardEvent<HTMLDivElement>) => {\n const go = (i: number) => {\n const next = visible[Math.min(Math.max(i, 0), visible.length - 1)];\n if (!next) return;\n setActiveValue(next.value);\n if (e.shiftKey) toggle(next.value, true);\n };\n if (e.altKey && onReorder && (e.key === 'ArrowUp' || e.key === 'ArrowDown')) {\n e.preventDefault();\n const values = targets();\n if (values.length) onReorder(values, e.key === 'ArrowUp' ? -1 : 1);\n if (active) setActiveValue(active.value);\n return;\n }\n if (e.key === 'ArrowDown') go(activeIndex + 1);\n else if (e.key === 'ArrowUp') go(activeIndex - 1);\n else if (e.key === 'Home') go(0);\n else if (e.key === 'End') go(visible.length - 1);\n else if (e.key === ' ' && active) toggle(active.value);\n else if (e.key === 'Enter') {\n const values = targets();\n if (values.length) onTransfer(values);\n } else if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === 'a') {\n const all = visible.filter((it) => !it.disabled).map((it) => it.value);\n const allOn = all.every((v) => checked.has(v));\n onCheckedChange(allOn ? new Set([...checked].filter((v) => !all.includes(v))) : new Set([...checked, ...all]));\n } else return;\n e.preventDefault();\n };\n\n return (\n <section aria-labelledby={titleId} className={s.pane()}>\n <div className={s.paneHead()}>\n <h3 id={titleId} className={s.paneTitle()}>\n {title}\n </h3>\n <span className={s.paneCount()}>{countLabel(checked.size, items.length)}</span>\n </div>\n {searchable && (\n <div className={s.search()}>\n <Input\n size=\"sm\"\n type=\"search\"\n leadingIcon={Search}\n aria-label={searchLabel}\n placeholder={searchPlaceholder}\n value={query}\n onValueChange={(v: string) => setQuery(v)}\n />\n </div>\n )}\n <div\n role=\"listbox\"\n aria-multiselectable\n aria-labelledby={titleId}\n aria-activedescendant={active ? optionId(activeIndex) : undefined}\n tabIndex={0}\n className={s.listbox()}\n style={visible.length ? { height } : undefined}\n onKeyDown={onKeyDown}\n >\n {visible.map((it, i) => (\n <div\n key={it.value}\n id={optionId(i)}\n role=\"option\"\n aria-selected={checked.has(it.value)}\n aria-disabled={it.disabled || undefined}\n data-active={i === activeIndex || undefined}\n className={cn('group/option', s.option())}\n onClick={() => {\n setActiveValue(it.value);\n toggle(it.value);\n }}\n onDoubleClick={() => !it.disabled && onTransfer([it.value])}\n >\n <span aria-hidden className={s.check()}>\n {checked.has(it.value) && <Check size={11} strokeWidth={3} />}\n </span>\n <span className={s.optionText()}>\n <span className={s.optionLabel()}>{it.label}</span>\n {it.description && <span className={s.optionDescription()}>{it.description}</span>}\n </span>\n </div>\n ))}\n </div>\n {visible.length === 0 && (\n <div className={s.empty()} style={{ height }}>\n {items.length ? noMatchesText : emptyText}\n </div>\n )}\n {footer && <div className={s.paneFoot()}>{footer}</div>}\n </section>\n );\n}\n","import { ArrowDown, ArrowUp, ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight } from 'lucide-react';\nimport { useId, useState, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { IconButton } from '../Button';\nimport { TransferListPane, type TransferListItem } from './TransferListPane';\nimport { transferListVariants } from './transfer-list.variants';\n\nexport interface TransferListLabels {\n available: string;\n selected: string;\n searchAvailable: string;\n searchSelected: string;\n searchPlaceholder: string;\n add: string;\n addAll: string;\n remove: string;\n removeAll: string;\n moveUp: string;\n moveDown: string;\n actions: string;\n emptyAvailable: string;\n emptySelected: string;\n noMatches: string;\n reorderHint: string;\n count: (checked: number, total: number) => string;\n added: (n: number) => string;\n removed: (n: number) => string;\n moved: string;\n}\n\nconst defaultLabels: TransferListLabels = {\n available: 'Available',\n selected: 'Selected',\n searchAvailable: 'Search available',\n searchSelected: 'Search selected',\n searchPlaceholder: 'Filter…',\n add: 'Add checked',\n addAll: 'Add all',\n remove: 'Remove checked',\n removeAll: 'Remove all',\n moveUp: 'Move checked up',\n moveDown: 'Move checked down',\n actions: 'Transfer actions',\n emptyAvailable: 'Everything is selected.',\n emptySelected: 'Nothing selected yet.',\n noMatches: 'No matches.',\n reorderHint: 'Alt+↑/↓ reorders',\n count: (c, t) => (c ? `${c}/${t}` : String(t)),\n added: (n) => `Added ${n} ${n === 1 ? 'item' : 'items'}.`,\n removed: (n) => `Removed ${n} ${n === 1 ? 'item' : 'items'}.`,\n moved: 'Order changed.',\n};\n\nexport interface TransferListProps {\n items: TransferListItem[];\n /** Selected values, in order (controlled). */\n value?: string[];\n defaultValue?: string[];\n onValueChange?: (values: string[]) => void;\n /** Show a search field above each list. */\n searchable?: boolean;\n /** Allow reordering the selected list. */\n reorderable?: boolean;\n /** Height of each list (px or CSS length). */\n height?: number | string;\n titles?: { available?: ReactNode; selected?: ReactNode };\n labels?: Partial<TransferListLabels>;\n className?: string;\n}\n\n/**\n * Two lists, available and selected: check items (click, Space, Shift+Arrow, Ctrl+A), move\n * them across with the middle buttons, Enter or a double click, and reorder the selected list\n * (Alt+Arrow or the move buttons). Each list is a multi-select listbox with search.\n */\nexport function TransferList({\n items,\n value,\n defaultValue = [],\n onValueChange,\n searchable = true,\n reorderable = true,\n height = 240,\n titles,\n labels: labelsProp,\n className,\n}: TransferListProps) {\n const labels = { ...defaultLabels, ...labelsProp };\n const [inner, setInner] = useState<string[]>(defaultValue);\n const selectedValues = value ?? inner;\n const [checkedLeft, setCheckedLeft] = useState<Set<string>>(new Set());\n const [checkedRight, setCheckedRight] = useState<Set<string>>(new Set());\n const [announcement, setAnnouncement] = useState('');\n const id = useId();\n const s = transferListVariants();\n\n const byValue = new Map(items.map((it) => [it.value, it]));\n const selectedSet = new Set(selectedValues);\n const available = items.filter((it) => !selectedSet.has(it.value));\n const selected = selectedValues.map((v) => byValue.get(v)).filter((it): it is TransferListItem => !!it);\n\n const commit = (next: string[], message: string) => {\n setInner(next);\n onValueChange?.(next);\n setAnnouncement(message);\n };\n\n const add = (values: string[]) => {\n const movable = values.filter((v) => !byValue.get(v)?.disabled && !selectedSet.has(v));\n if (!movable.length) return;\n commit([...selectedValues, ...movable], labels.added(movable.length));\n setCheckedLeft(new Set([...checkedLeft].filter((v) => !movable.includes(v))));\n };\n\n const remove = (values: string[]) => {\n const movable = values.filter((v) => !byValue.get(v)?.disabled);\n if (!movable.length) return;\n commit(\n selectedValues.filter((v) => !movable.includes(v)),\n labels.removed(movable.length),\n );\n setCheckedRight(new Set([...checkedRight].filter((v) => !movable.includes(v))));\n };\n\n const reorder = (values: string[], delta: -1 | 1) => {\n const next = [...selectedValues];\n const set = new Set(values);\n const order = delta === -1 ? next.map((_, i) => i) : next.map((_, i) => next.length - 1 - i);\n let changed = false;\n for (const i of order) {\n const j = i + delta;\n const cur = next[i];\n const other = next[j];\n if (cur === undefined || other === undefined || !set.has(cur) || set.has(other)) continue;\n next[i] = other;\n next[j] = cur;\n changed = true;\n }\n if (changed) commit(next, labels.moved);\n };\n\n const checkedRightValues = selectedValues.filter((v) => checkedRight.has(v));\n\n return (\n <div className={cn(s.root(), className)}>\n <TransferListPane\n id={`${id}-available`}\n title={titles?.available ?? labels.available}\n items={available}\n checked={checkedLeft}\n onCheckedChange={setCheckedLeft}\n onTransfer={add}\n searchable={searchable}\n searchLabel={labels.searchAvailable}\n searchPlaceholder={labels.searchPlaceholder}\n emptyText={labels.emptyAvailable}\n noMatchesText={labels.noMatches}\n countLabel={labels.count}\n height={height}\n />\n <div role=\"group\" aria-label={labels.actions} className={s.actions()}>\n <IconButton\n size=\"sm\"\n variant=\"secondary\"\n icon={ChevronRight}\n label={labels.add}\n className=\"rtl:[&_svg]:-scale-x-100\"\n disabled={!checkedLeft.size}\n onClick={() => add([...checkedLeft])}\n />\n <IconButton\n size=\"sm\"\n variant=\"secondary\"\n icon={ChevronsRight}\n label={labels.addAll}\n className=\"rtl:[&_svg]:-scale-x-100\"\n disabled={!available.some((it) => !it.disabled)}\n onClick={() => add(available.map((it) => it.value))}\n />\n <IconButton\n size=\"sm\"\n variant=\"secondary\"\n icon={ChevronLeft}\n label={labels.remove}\n className=\"rtl:[&_svg]:-scale-x-100\"\n disabled={!checkedRight.size}\n onClick={() => remove([...checkedRight])}\n />\n <IconButton\n size=\"sm\"\n variant=\"secondary\"\n icon={ChevronsLeft}\n label={labels.removeAll}\n className=\"rtl:[&_svg]:-scale-x-100\"\n disabled={!selected.some((it) => !it.disabled)}\n onClick={() => remove(selected.map((it) => it.value))}\n />\n </div>\n <TransferListPane\n id={`${id}-selected`}\n title={titles?.selected ?? labels.selected}\n items={selected}\n checked={checkedRight}\n onCheckedChange={setCheckedRight}\n onTransfer={remove}\n onReorder={reorderable ? reorder : undefined}\n searchable={searchable}\n searchLabel={labels.searchSelected}\n searchPlaceholder={labels.searchPlaceholder}\n emptyText={labels.emptySelected}\n noMatchesText={labels.noMatches}\n countLabel={labels.count}\n height={height}\n footer={\n reorderable ? (\n <>\n <IconButton\n size=\"sm\"\n icon={ArrowUp}\n label={labels.moveUp}\n disabled={!checkedRightValues.length}\n onClick={() => reorder(checkedRightValues, -1)}\n />\n <IconButton\n size=\"sm\"\n icon={ArrowDown}\n label={labels.moveDown}\n disabled={!checkedRightValues.length}\n onClick={() => reorder(checkedRightValues, 1)}\n />\n <span className={s.footHint()}>{labels.reorderHint}</span>\n </>\n ) : undefined\n }\n />\n <span role=\"status\" className=\"sr-only\">\n {announcement}\n </span>\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'TransferList',\n group: 'Forms',\n status: 'beta',\n description:\n 'Two lists, available and selected, for picking and ordering a subset (columns, scopes, members): search each side, check several items, move them with the middle buttons, Enter or a double click, and reorder the selected side. Moves are announced.',\n pattern: 'two multi-select listboxes (aria-activedescendant) + action buttons',\n keyboard: [\n ['Tab', 'Moves between search fields, the two lists and the action buttons'],\n ['ArrowDown / ArrowUp, Home / End', 'Moves the active option in the focused list'],\n ['Space', 'Checks or unchecks the active option'],\n ['Shift+ArrowDown / Shift+ArrowUp', 'Moves and checks, extending the selection'],\n ['Ctrl/Cmd+A', 'Checks (or unchecks) every visible option'],\n ['Enter', 'Moves the checked options (or the active one) to the other list'],\n ['Alt+ArrowUp / Alt+ArrowDown', 'Selected list: moves the checked options (or the active one) up / down'],\n ],\n tokens: [\n 'card',\n 'border',\n 'background',\n 'foreground',\n 'muted-foreground',\n 'primary',\n 'primary-foreground',\n 'secondary',\n 'focus-ring',\n ],\n};\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'TreeList',\n group: 'Navigation',\n status: 'beta',\n description:\n 'Hierarchical list on the WAI-ARIA tree pattern (role tree / treeitem / group, aria-expanded, aria-level): roving focus, arrow keys, Home/End and typeahead, single or multiple selection, icons per node and children loaded on first expand with loading and error states.',\n pattern: 'tree view',\n keyboard: [\n ['Tab', 'Moves focus into the tree (selected or first node) and out of it'],\n ['ArrowDown / ArrowUp', 'Next / previous visible node'],\n ['ArrowRight', 'Closed node: expands it (loading children if needed). Open node: moves to its first child'],\n ['ArrowLeft', 'Open node: collapses it. Otherwise: moves to the parent'],\n ['Home / End', 'First / last visible node'],\n ['Enter', 'Selects the node and runs onAction'],\n ['Space', 'Selects the node (toggles in multiple mode)'],\n ['Ctrl/⌘ + A', 'Multiple mode: selects every node'],\n ['Type a character', 'Moves to the next node whose label starts with the typed text'],\n ],\n tokens: [\n 'foreground',\n 'muted-foreground',\n 'secondary',\n 'primary',\n 'primary-chip-text',\n 'primary-foreground',\n 'border',\n 'destructive-text',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const userMenuVariants = tv({\n slots: {\n trigger: [\n 'inline-flex shrink-0 cursor-pointer items-center gap-2 rounded-lg transition-colors outline-none',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n 'data-popup-open:ring-2 data-popup-open:ring-ring/40',\n ],\n triggerName: 'pe-1 text-[13px] font-semibold text-foreground',\n popup: 'w-60',\n header: 'flex items-center gap-2.5 px-2.5 py-2',\n headerText: 'min-w-0',\n name: 'truncate text-[13px] font-semibold text-foreground',\n email: 'truncate font-mono text-[10.5px] text-muted-foreground',\n },\n variants: {\n showName: {\n true: { trigger: 'h-9 pe-2 ps-0.5 hover:bg-secondary/60' },\n },\n },\n});\n\nexport type UserMenuVariantProps = VariantProps<typeof userMenuVariants>;\n","import { Menu as BaseMenu } from '@base-ui/react/menu';\nimport { LogOut, Palette } from 'lucide-react';\nimport { createElement, type ComponentType, type ReactNode } from 'react';\nimport { useTheme, type ThemeMode } from '../../theme/ThemeProvider';\nimport { cn } from '../../utils/cn';\nimport { Avatar, getInitials } from '../Avatar';\nimport { useLinkComponent } from '../Link';\nimport {\n Menu,\n MenuContent,\n MenuGroup,\n MenuItem,\n MenuRadioGroup,\n MenuRadioItem,\n MenuSeparator,\n MenuSub,\n MenuSubContent,\n MenuSubTrigger,\n MenuTrigger,\n menuVariants,\n} from '../Menu';\nimport { useThemeOptions, type ThemeOption } from '../ThemeSwitcher/ThemeSwitcher';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { userMenuVariants } from './user-menu.variants';\n\ntype IconComponent = ComponentType<{ size?: number; 'aria-hidden'?: boolean; className?: string }>;\n\nexport interface UserMenuUser {\n name: string;\n email?: string;\n /** Avatar image URL; initials show while it loads or if it fails. */\n avatarSrc?: string;\n}\n\nexport interface UserMenuAction {\n label: string;\n icon?: IconComponent;\n /** Renders a link (through LinkProvider) instead of a button item. */\n href?: string;\n shortcut?: string;\n destructive?: boolean;\n disabled?: boolean;\n onSelect?: () => void;\n}\n\nexport type UserMenuEntry = UserMenuAction | 'separator';\n\nexport interface UserMenuProps {\n className?: string;\n user: UserMenuUser;\n /** Items between the header and the theme / sign-out section (Profile, Settings…). */\n items?: UserMenuEntry[];\n /** Adds a Theme submenu (radio items bound to useTheme). */\n showTheme?: boolean;\n themeOptions?: ThemeOption[];\n themeLabel?: string;\n /** Adds a destructive \"Sign out\" item at the end. */\n onSignOut?: () => void;\n signOutLabel?: string;\n /** Show the user's name next to the avatar in the trigger. */\n showName?: boolean;\n /** Accessible name of the trigger. */\n triggerLabel?: string;\n /** Extra content at the end of the menu (before sign out). */\n children?: ReactNode;\n}\n\nfunction ActionItem({ action }: { action: UserMenuAction }) {\n const RouterLink = useLinkComponent();\n const m = menuVariants({ destructive: action.destructive });\n const IconCmp = action.icon;\n if (action.href !== undefined) {\n return (\n <BaseMenu.LinkItem\n href={action.href}\n closeOnClick\n render={RouterLink ? createElement(RouterLink) : undefined}\n className={cn(m.item(), 'no-underline')}\n onClick={action.onSelect}\n >\n {IconCmp && <IconCmp size={15} aria-hidden className={m.itemIcon()} />}\n <span className={m.itemLabel()}>{action.label}</span>\n {action.shortcut && (\n <span aria-hidden className={m.shortcut()}>\n {action.shortcut}\n </span>\n )}\n </BaseMenu.LinkItem>\n );\n }\n return (\n <MenuItem\n icon={IconCmp}\n shortcut={action.shortcut}\n destructive={action.destructive}\n disabled={action.disabled}\n onClick={action.onSelect}\n >\n {action.label}\n </MenuItem>\n );\n}\n\n/**\n * Account menu: avatar trigger opening a header (name, email), the given items, an optional\n * Theme submenu wired to useTheme(), and Sign out.\n */\nexport function UserMenu({\n className,\n user,\n items = [],\n showTheme = true,\n themeOptions: themeOptionsProp,\n themeLabel: themeLabelProp,\n onSignOut,\n signOutLabel: signOutLabelProp,\n showName = false,\n triggerLabel,\n children,\n}: UserMenuProps) {\n const { t } = useI18n();\n const themeLabel = themeLabelProp ?? t('theme.label');\n const signOutLabel = signOutLabelProp ?? t('userMenu.signOut');\n const themeOptions = useThemeOptions(themeOptionsProp);\n const { mode, setMode } = useTheme();\n const s = userMenuVariants({ showName });\n const hasEnd = showTheme || children || onSignOut;\n return (\n <Menu>\n <MenuTrigger\n aria-label={triggerLabel ?? t('userMenu.label', { name: user.name })}\n className={cn(s.trigger(), className)}\n >\n <Avatar src={user.avatarSrc} initials={getInitials(user.name)} size=\"sm\" shape=\"rounded\" />\n {showName && <span className={s.triggerName()}>{user.name}</span>}\n </MenuTrigger>\n <MenuContent align=\"end\" className={s.popup()}>\n <MenuGroup aria-label={user.name}>\n <div className={s.header()}>\n <Avatar src={user.avatarSrc} initials={getInitials(user.name)} size=\"sm\" shape=\"rounded\" tone=\"accent\" />\n <div className={s.headerText()}>\n <div className={s.name()}>{user.name}</div>\n {user.email && <div className={s.email()}>{user.email}</div>}\n </div>\n </div>\n </MenuGroup>\n {items.length > 0 && <MenuSeparator />}\n {items.map((entry, i) =>\n entry === 'separator' ? <MenuSeparator key={`sep-${i}`} /> : <ActionItem key={entry.label} action={entry} />,\n )}\n {hasEnd && <MenuSeparator />}\n {showTheme && (\n <MenuSub>\n <MenuSubTrigger icon={Palette}>{themeLabel}</MenuSubTrigger>\n <MenuSubContent className=\"min-w-[180px]\">\n <MenuRadioGroup value={mode} onValueChange={(v: ThemeMode) => setMode(v)}>\n {themeOptions.map((o) => (\n <MenuRadioItem key={o.value} value={o.value}>\n <span className=\"flex items-center gap-2.5\">\n <o.icon size={15} aria-hidden className=\"text-muted-foreground\" />\n {o.label}\n </span>\n </MenuRadioItem>\n ))}\n </MenuRadioGroup>\n </MenuSubContent>\n </MenuSub>\n )}\n {children}\n {onSignOut && (\n <MenuItem icon={LogOut} destructive onClick={onSignOut}>\n {signOutLabel}\n </MenuItem>\n )}\n </MenuContent>\n </Menu>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'UserMenu',\n group: 'Navigation',\n status: 'beta',\n description:\n 'Account menu for the topbar: avatar trigger (optionally with the name) opening a name/email header, data-driven items (buttons or router links), a Theme submenu bound to useTheme(), and a destructive Sign out.',\n primitive: '@base-ui/react/menu',\n pattern: 'menu button',\n keyboard: [\n ['Enter / Space / ArrowDown', 'On the avatar: opens the menu and focuses the first item'],\n ['ArrowDown / ArrowUp', 'Moves between items (wraps)'],\n ['ArrowRight / ArrowLeft', 'Opens / closes the Theme submenu'],\n ['Enter', 'Runs the highlighted item (or selects a theme) and closes the menu'],\n ['Escape', 'Closes the menu and returns focus to the avatar'],\n ],\n tokens: [\n 'popover',\n 'border',\n 'primary',\n 'primary-foreground',\n 'accent',\n 'accent-foreground',\n 'secondary',\n 'muted-foreground',\n 'destructive-text',\n 'focus-ring',\n ],\n};\n","import { useMemo } from 'react';\n\n/** Prefix offsets for `count` rows: `offsets[i]` is the top of row i, `offsets[count]` the total height. */\nexport function computeOffsets(count: number, sizeOf: (index: number) => number): number[] {\n const offsets = new Array<number>(count + 1);\n offsets[0] = 0;\n for (let i = 0; i < count; i++) offsets[i + 1] = (offsets[i] ?? 0) + sizeOf(i);\n return offsets;\n}\n\n/** Index of the row containing `y` (binary search over the offsets). */\nexport function rowAt(offsets: number[], y: number): number {\n let lo = 0;\n let hi = offsets.length - 2;\n while (lo < hi) {\n const mid = (lo + hi + 1) >> 1;\n if ((offsets[mid] ?? 0) <= y) lo = mid;\n else hi = mid - 1;\n }\n return Math.max(lo, 0);\n}\n\nexport interface VirtualWindow {\n offsets: number[];\n start: number;\n end: number;\n total: number;\n}\n\n/** The rendered window [start, end] for a scroll position, viewport height and overscan. */\nexport function useVirtualWindow(\n count: number,\n sizeOf: (index: number) => number,\n scrollTop: number,\n viewportHeight: number,\n overscan: number,\n): VirtualWindow {\n const offsets = useMemo(() => computeOffsets(count, sizeOf), [count, sizeOf]);\n if (count === 0) return { offsets, start: 0, end: -1, total: 0 };\n const first = rowAt(offsets, scrollTop);\n const last = rowAt(offsets, scrollTop + Math.max(viewportHeight, 1) - 1);\n return {\n offsets,\n start: Math.max(0, first - overscan),\n end: Math.min(count - 1, last + overscan),\n total: offsets[count] ?? 0,\n };\n}\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const virtualListVariants = tv({\n slots: {\n viewport:\n 'relative min-h-0 overflow-y-auto overscroll-contain rounded-lg border border-border bg-card outline-none',\n spacer: 'relative w-full',\n row: [\n 'absolute inset-x-0 top-0 flex items-center outline-none',\n 'focus-visible:z-10 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus-ring',\n ],\n option:\n 'cursor-default data-active:bg-secondary/60 aria-selected:bg-primary/12 aria-selected:data-active:bg-primary/16',\n empty: 'grid h-full place-items-center px-4 py-8 text-[12.5px] text-muted-foreground',\n },\n variants: {\n divided: { true: { row: 'border-b border-border/60' } },\n },\n defaultVariants: { divided: true },\n});\n\nexport type VirtualListVariantProps = VariantProps<typeof virtualListVariants>;\n","import {\n useCallback,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n useState,\n type CSSProperties,\n type KeyboardEvent,\n type Key,\n type ReactNode,\n type Ref,\n} from 'react';\nimport { cn } from '../../utils/cn';\nimport { useVirtualWindow } from './use-virtual-window';\nimport { virtualListVariants, type VirtualListVariantProps } from './virtual-list.variants';\n\nexport type VirtualListAlign = 'auto' | 'start' | 'center' | 'end';\n\nexport interface VirtualListHandle {\n /** Scrolls a row into view; with `focus` it also becomes the active (tabbable) row and takes focus. */\n scrollToIndex: (index: number, options?: { align?: VirtualListAlign; focus?: boolean }) => void;\n}\n\nexport interface VirtualListItemState {\n /** The row holds the roving tab stop. */\n active: boolean;\n /** Listbox only: the row is the selected option. */\n selected: boolean;\n}\n\nexport interface VirtualListProps<T> extends VirtualListVariantProps {\n items: readonly T[];\n renderItem: (item: T, index: number, state: VirtualListItemState) => ReactNode;\n /** Stable key per item (also the selection key in listbox mode). Defaults to the index. */\n getKey?: (item: T, index: number) => Key;\n /** Fixed row height in px. Omit it to measure rows, starting from `estimatedItemHeight`. */\n itemHeight?: number;\n estimatedItemHeight?: number;\n /** Viewport height (px or any CSS length). */\n height?: number | string;\n /** Rows rendered above and below the visible window. */\n overscan?: number;\n /** `list` for read-only rows, `listbox` for a single-select option list. */\n role?: 'list' | 'listbox';\n selectedKey?: Key | null;\n defaultSelectedKey?: Key | null;\n onSelectedKeyChange?: (key: Key, item: T, index: number) => void;\n /** Enter on a row (list mode), or after selecting (listbox mode). */\n onActivate?: (item: T, index: number) => void;\n /** Shown when there are no items. */\n emptyText?: ReactNode;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n className?: string;\n rowClassName?: string;\n ref?: Ref<VirtualListHandle>;\n}\n\n/**\n * Windowed list: renders only the rows in view (plus `overscan`), with fixed or measured row\n * heights. Rows use a roving tabindex (one tab stop, arrows/Page/Home/End move it, the\n * active row is kept mounted when scrolled away) and carry aria-setsize / aria-posinset.\n */\nexport function VirtualList<T>({\n items,\n renderItem,\n getKey = (_item, index) => index,\n itemHeight,\n estimatedItemHeight = 36,\n height = 320,\n overscan = 4,\n role = 'list',\n selectedKey,\n defaultSelectedKey = null,\n onSelectedKeyChange,\n onActivate,\n emptyText = 'No items.',\n divided,\n className,\n rowClassName,\n ref,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n}: VirtualListProps<T>) {\n const count = items.length;\n const [scrollTop, setScrollTop] = useState(0);\n const [viewportHeight, setViewportHeight] = useState(typeof height === 'number' ? height : 320);\n const [sizes, setSizes] = useState<Record<number, number>>({});\n const [activeState, setActive] = useState(0);\n const [innerSelected, setInnerSelected] = useState<Key | null>(defaultSelectedKey);\n const selected = selectedKey !== undefined ? selectedKey : innerSelected;\n const active = Math.min(activeState, Math.max(count - 1, 0));\n const viewportRef = useRef<HTMLDivElement | null>(null);\n const rowObserver = useRef<ResizeObserver | null>(null);\n const pendingFocus = useRef(false);\n const s = virtualListVariants({ divided });\n const isListbox = role === 'listbox';\n\n const sizeOf = useCallback(\n (i: number) => itemHeight ?? sizes[i] ?? estimatedItemHeight,\n [itemHeight, sizes, estimatedItemHeight],\n );\n const win = useVirtualWindow(count, sizeOf, scrollTop, viewportHeight, overscan);\n\n const scrollToIndex = (index: number, align: VirtualListAlign = 'auto') => {\n const vp = viewportRef.current;\n if (!vp || count === 0) return;\n const i = Math.min(Math.max(index, 0), count - 1);\n const top = win.offsets[i] ?? 0;\n const bottom = top + sizeOf(i);\n const h = vp.clientHeight || viewportHeight;\n let next = vp.scrollTop;\n if (align === 'start') next = top;\n else if (align === 'end') next = bottom - h;\n else if (align === 'center') next = top - (h - (bottom - top)) / 2;\n else if (top < vp.scrollTop) next = top;\n else if (bottom > vp.scrollTop + h) next = bottom - h;\n next = Math.max(0, Math.min(next, win.total - h));\n vp.scrollTop = next;\n setScrollTop(next);\n };\n\n const moveTo = (index: number, align: VirtualListAlign = 'auto') => {\n if (count === 0) return;\n const i = Math.min(Math.max(index, 0), count - 1);\n pendingFocus.current = true;\n setActive(i);\n scrollToIndex(i, align);\n };\n\n useImperativeHandle(ref, () => ({\n scrollToIndex: (index, options) =>\n options?.focus ? moveTo(index, options.align) : scrollToIndex(index, options?.align),\n }));\n\n useLayoutEffect(() => {\n if (!pendingFocus.current) return;\n pendingFocus.current = false;\n viewportRef.current?.querySelector<HTMLElement>(`[data-index=\"${active}\"]`)?.focus({ preventScroll: true });\n });\n\n const select = (index: number) => {\n const item = items[index];\n if (item === undefined) return;\n const key = getKey(item, index);\n setInnerSelected(key);\n onSelectedKeyChange?.(key, item, index);\n onActivate?.(item, index);\n };\n\n const onKeyDown = (e: KeyboardEvent<HTMLDivElement>) => {\n const row = e.target as HTMLElement;\n if (row.dataset.index === undefined || row.parentElement?.parentElement !== e.currentTarget) return;\n const from = Number(row.dataset.index);\n const page = Math.max(\n 1,\n Math.floor((e.currentTarget.clientHeight || viewportHeight) / (itemHeight ?? estimatedItemHeight)) - 1,\n );\n const keys: Record<string, () => void> = {\n ArrowDown: () => moveTo(from + 1),\n ArrowUp: () => moveTo(from - 1),\n PageDown: () => moveTo(from + page, 'start'),\n PageUp: () => moveTo(from - page, 'end'),\n Home: () => moveTo(0),\n End: () => moveTo(count - 1),\n };\n if (e.key === 'Enter' || (isListbox && e.key === ' ')) {\n e.preventDefault();\n if (isListbox) select(from);\n else if (items[from] !== undefined) onActivate?.(items[from] as T, from);\n return;\n }\n const action = keys[e.key];\n if (!action) return;\n e.preventDefault();\n action();\n };\n\n const setViewport = (node: HTMLDivElement | null) => {\n viewportRef.current = node;\n if (!node || typeof ResizeObserver === 'undefined') return;\n const ro = new ResizeObserver((entries) => {\n const h = entries[0]?.contentRect.height;\n if (h) setViewportHeight(h);\n });\n ro.observe(node);\n return () => ro.disconnect();\n };\n\n const measureRow = (node: HTMLElement | null) => {\n if (!node || itemHeight != null || typeof ResizeObserver === 'undefined') return;\n rowObserver.current ??= new ResizeObserver((entries) => {\n setSizes((prev) => {\n let next = prev;\n for (const entry of entries) {\n const i = Number((entry.target as HTMLElement).dataset.index);\n const h = Math.round((entry.target as HTMLElement).getBoundingClientRect().height);\n if (h > 0 && prev[i] !== h) next = { ...next, [i]: h };\n }\n return next;\n });\n });\n const ro = rowObserver.current;\n ro.observe(node);\n return () => ro.unobserve(node);\n };\n\n const indices: number[] = [];\n for (let i = win.start; i <= win.end; i++) indices.push(i);\n if (count > 0 && (active < win.start || active > win.end)) indices.push(active);\n\n return (\n <div\n ref={setViewport}\n className={cn(s.viewport(), className)}\n style={{ height }}\n onScroll={(e) => setScrollTop(e.currentTarget.scrollTop)}\n onKeyDown={onKeyDown}\n >\n {count === 0 ? (\n <div className={s.empty()} role=\"status\">\n {emptyText}\n </div>\n ) : (\n <div\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className={s.spacer()}\n style={{ height: win.total }}\n >\n {indices.map((i) => {\n const item = items[i] as T;\n const key = getKey(item, i);\n const isActive = i === active;\n const isSelected = isListbox && selected === key;\n const style: CSSProperties = { transform: `translateY(${win.offsets[i] ?? 0}px)`, height: itemHeight };\n return (\n <div\n key={key}\n ref={measureRow}\n role={isListbox ? 'option' : 'listitem'}\n data-index={i}\n data-active={isActive || undefined}\n tabIndex={isActive ? 0 : -1}\n aria-setsize={count}\n aria-posinset={i + 1}\n aria-selected={isListbox ? isSelected : undefined}\n className={cn(s.row(), isListbox && s.option(), rowClassName)}\n style={style}\n onFocus={() => setActive(i)}\n onClick={isListbox ? () => select(i) : undefined}\n >\n {renderItem(item, i, { active: isActive, selected: isSelected })}\n </div>\n );\n })}\n </div>\n )}\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'VirtualList',\n group: 'Display',\n status: 'beta',\n description:\n 'Windowed list for thousands of rows: only the visible rows plus `overscan` are mounted, with a fixed `itemHeight` or measured rows from an estimate. One roving tab stop, aria-setsize/posinset on every row, `scrollToIndex` through a ref, and a single-select `listbox` mode. No dependencies.',\n pattern: 'list / listbox with roving tabindex',\n keyboard: [\n ['Tab', 'Moves focus to the active row (one tab stop)'],\n ['ArrowDown / ArrowUp', 'Moves to the next / previous row, scrolling it into view'],\n ['PageDown / PageUp', 'Moves one viewport down / up'],\n ['Home / End', 'Moves to the first / last row'],\n ['Enter', 'Activates the row (selects it in listbox mode)'],\n ['Space', 'Listbox mode: selects the focused option'],\n ],\n tokens: ['card', 'border', 'secondary', 'primary', 'foreground', 'muted-foreground', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const visuallyHiddenVariants = tv({\n base: 'sr-only',\n variants: {\n focusable: {\n true: 'focus:not-sr-only focus-within:not-sr-only',\n },\n },\n defaultVariants: { focusable: false },\n});\n\nexport const skipLinkVariants = tv({\n base: [\n 'sr-only focus:not-sr-only focus:fixed focus:top-3 focus:start-3 focus:z-50',\n 'focus:inline-flex focus:items-center focus:rounded-md focus:border focus:border-border focus:bg-card focus:px-3 focus:py-2',\n 'focus:text-[13px] focus:font-medium focus:text-foreground focus:shadow-md',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n});\n\nexport type VisuallyHiddenVariantProps = VariantProps<typeof visuallyHiddenVariants>;\n","import { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport type { AnchorHTMLAttributes, MouseEvent, Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { skipLinkVariants, visuallyHiddenVariants } from './visually-hidden.variants';\n\nexport interface VisuallyHiddenProps extends Omit<useRender.ComponentProps<'span'>, 'className'> {\n className?: string;\n /** Becomes visible while it (or something inside it) has focus — for skip links and similar. */\n focusable?: boolean;\n}\n\n/** Content for screen readers only: hidden visually, kept in the accessibility tree. */\nexport function VisuallyHidden({ focusable, className, render, ref, ...props }: VisuallyHiddenProps) {\n return useRender({\n defaultTagName: 'span',\n render,\n ref,\n props: mergeProps<'span'>(props, { className: cn(visuallyHiddenVariants({ focusable }), className) }),\n });\n}\n\nconst NATIVELY_FOCUSABLE = 'a[href], button, input, select, textarea, summary, [tabindex]';\n\nexport interface SkipLinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'className' | 'href'> {\n className?: string;\n ref?: Ref<HTMLAnchorElement>;\n /** `id` of the element to jump to (usually `<main>`). */\n targetId: string;\n}\n\n/**\n * First focusable element on the page: hidden until Tab reaches it, then pinned top-left.\n * Activating it moves focus (not just scroll) to the target, which gets `tabindex=\"-1\"` if needed.\n */\nexport function SkipLink({ targetId, className, children: childrenProp, onClick, ...props }: SkipLinkProps) {\n const { t } = useI18n();\n const children = childrenProp ?? t('skip.main');\n function handleClick(event: MouseEvent<HTMLAnchorElement>) {\n onClick?.(event);\n if (event.defaultPrevented) return;\n const target = document.getElementById(targetId);\n if (!target) return;\n event.preventDefault();\n if (!target.matches(NATIVELY_FOCUSABLE)) target.setAttribute('tabindex', '-1');\n target.focus();\n target.scrollIntoView?.({ block: 'start' });\n try {\n history.replaceState(history.state, '', `#${targetId}`);\n } catch {}\n }\n return (\n <a href={`#${targetId}`} className={cn(skipLinkVariants(), className)} onClick={handleClick} {...props}>\n {children}\n </a>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'VisuallyHidden',\n group: 'Layout',\n status: 'stable',\n description:\n 'Screen-reader-only content (sr-only), with a `focusable` variant that appears while focused. SkipLink is the canonical use: the first Tab stop on a page, revealed on focus, that moves focus to the main content.',\n primitive: '@base-ui/react/use-render',\n pattern: 'skip link',\n keyboard: [\n ['Tab', 'Focuses the SkipLink and reveals it (first Tab stop on the page)'],\n ['Enter', 'Moves focus to the target (e.g. <main>), not just the scroll position'],\n ],\n tokens: ['card', 'border', 'foreground', 'shadow-md', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\nimport { listboxItem, listboxPopup } from '../Select/select.variants';\n\nexport const workspaceSwitcherVariants = tv({\n slots: {\n trigger: [\n 'group flex h-11 max-w-full cursor-pointer items-center gap-2.5 rounded-[10px] border border-border bg-card pe-2.5 ps-1.5 text-start transition-colors',\n 'hover:bg-secondary/50 data-popup-open:bg-secondary/50 motion-reduce:transition-none',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n triggerText: 'flex min-w-0 flex-col leading-tight',\n triggerName: 'truncate text-[13px] font-semibold text-foreground',\n triggerMeta: 'mt-px truncate font-mono text-[10px] text-muted-foreground',\n triggerChevron: 'ms-1 shrink-0 text-muted-foreground',\n popup: 'min-w-[252px]',\n option: 'h-11 px-2',\n optionBody: 'flex min-w-0 items-center gap-2.5',\n optionText: 'flex min-w-0 flex-col leading-tight',\n optionName: 'truncate text-[12.5px] font-medium text-foreground',\n optionMeta: 'truncate font-mono text-[9.5px] text-muted-foreground',\n // Searchable (combobox) popup\n searchPopup: [listboxPopup, 'w-[280px] p-0'],\n searchField: 'flex items-center gap-2 border-b border-border px-3',\n searchIcon: 'shrink-0 text-muted-foreground',\n searchInput:\n 'h-10 w-full min-w-0 bg-transparent text-[13px] text-foreground outline-none placeholder:text-muted-foreground',\n searchList: 'max-h-[300px] overflow-y-auto p-1.5 outline-none',\n searchItem: [listboxItem, 'h-11 px-2'],\n searchIndicator: 'ms-auto flex shrink-0 text-primary-text',\n searchEmpty: 'px-3 py-4 text-center text-[12.5px] text-muted-foreground empty:hidden',\n createIcon:\n 'grid size-[30px] shrink-0 place-items-center rounded-md border border-dashed border-border text-muted-foreground',\n },\n});\n\nexport type WorkspaceSwitcherVariantProps = VariantProps<typeof workspaceSwitcherVariants>;\n","import { ChevronsUpDown } from 'lucide-react';\nimport { Avatar, getInitials } from '../Avatar';\nimport { workspaceSwitcherVariants } from './workspace-switcher.variants';\n\nexport interface Workspace {\n id: string;\n name: string;\n /** Secondary line: plan, role, environment… */\n meta?: string;\n /** Logo image URL; initials show while it loads or if it fails. */\n logo?: string;\n}\n\nconst s = workspaceSwitcherVariants();\n\n/** Trigger name: the current workspace first (matches the visible text), then the action. */\nexport const triggerLabel = (current: Workspace | undefined, label: string) =>\n current ? `${current.name}, ${label}` : label;\n\nexport function WorkspaceLogo({ workspace, current }: { workspace: Workspace; current?: boolean }) {\n return (\n <Avatar\n src={workspace.logo}\n initials={getInitials(workspace.name)}\n size=\"sm\"\n shape=\"rounded\"\n tone={current ? 'primary' : 'accent'}\n className=\"size-[30px]\"\n />\n );\n}\n\nexport function WorkspaceOptionBody({ workspace, current }: { workspace: Workspace; current?: boolean }) {\n return (\n <span className={s.optionBody()}>\n <WorkspaceLogo workspace={workspace} current={current} />\n <span className={s.optionText()}>\n <span className={s.optionName()}>{workspace.name}</span>\n {workspace.meta && <span className={s.optionMeta()}>{workspace.meta}</span>}\n </span>\n </span>\n );\n}\n\n/** Trigger content: logo, name, meta and an up/down chevron. */\nexport function WorkspaceTriggerContent({ workspace }: { workspace?: Workspace }) {\n return (\n <>\n {workspace && <WorkspaceLogo workspace={workspace} current />}\n <span className={s.triggerText()}>\n <span className={s.triggerName()}>{workspace?.name ?? 'Select workspace'}</span>\n {workspace?.meta && <span className={s.triggerMeta()}>{workspace.meta}</span>}\n </span>\n <ChevronsUpDown size={14} aria-hidden className={s.triggerChevron()} />\n </>\n );\n}\n","import { Combobox } from '@base-ui/react/combobox';\nimport { Check, Plus, Search } from 'lucide-react';\nimport { useMemo } from 'react';\nimport { usePortalDir, useI18n } from '../../i18n/I18nProvider';\nimport { cn } from '../../utils/cn';\nimport { workspaceSwitcherVariants } from './workspace-switcher.variants';\nimport { triggerLabel, WorkspaceOptionBody, WorkspaceTriggerContent, type Workspace } from './parts';\nimport type { WorkspaceSwitcherProps } from './WorkspaceSwitcher';\n\nconst CREATE_ID = '__create-workspace__';\nconst s = workspaceSwitcherVariants();\n\ninterface WorkspaceSearchProps extends WorkspaceSwitcherProps {\n current?: Workspace;\n createLabel: string;\n label: string;\n}\n\n/** Searchable variant of WorkspaceSwitcher: a combobox with the input inside its popup. */\nexport function WorkspaceSearch({\n className,\n workspaces,\n current,\n onSelect,\n onCreate,\n createLabel,\n label,\n searchPlaceholder: searchPlaceholderProp,\n emptyText: emptyTextProp,\n}: WorkspaceSearchProps) {\n const { t } = useI18n();\n const searchPlaceholder = searchPlaceholderProp ?? t('workspace.search');\n const emptyText = emptyTextProp ?? t('workspace.empty');\n const dir = usePortalDir();\n const createEntry = useMemo<Workspace>(() => ({ id: CREATE_ID, name: createLabel }), [createLabel]);\n const items = useMemo(\n () => (onCreate ? [...workspaces, createEntry] : workspaces),\n [workspaces, onCreate, createEntry],\n );\n return (\n <Combobox.Root<Workspace>\n items={items}\n value={current ?? null}\n onValueChange={(next) => {\n if (!next) return;\n if (next.id === CREATE_ID) onCreate?.();\n else onSelect(next);\n }}\n itemToStringLabel={(w) => w.name}\n isItemEqualToValue={(a, b) => a.id === b.id}\n filter={(w, query) =>\n w.id === CREATE_ID || `${w.name} ${w.meta ?? ''}`.toLowerCase().includes(query.trim().toLowerCase())\n }\n autoHighlight\n >\n <Combobox.Trigger aria-label={triggerLabel(current, label)} className={cn(s.trigger(), className)}>\n <WorkspaceTriggerContent workspace={current} />\n </Combobox.Trigger>\n <Combobox.Portal>\n <Combobox.Positioner dir={dir} className=\"z-50 outline-none\" align=\"start\" sideOffset={8}>\n <Combobox.Popup className={s.searchPopup()} aria-label={label}>\n <div className={s.searchField()}>\n <Search size={15} aria-hidden className={s.searchIcon()} />\n <Combobox.Input\n aria-label={searchPlaceholder.replace(/…$/, '')}\n placeholder={searchPlaceholder}\n className={s.searchInput()}\n />\n </div>\n <Combobox.Empty className={s.searchEmpty()}>{emptyText}</Combobox.Empty>\n <Combobox.List className={s.searchList()}>\n {(w: Workspace) =>\n w.id === CREATE_ID ? (\n <Combobox.Item key={w.id} value={w} className={s.searchItem()}>\n <span className={s.optionBody()}>\n <span className={s.createIcon()}>\n <Plus size={15} aria-hidden />\n </span>\n <span className={s.optionName()}>{w.name}</span>\n </span>\n </Combobox.Item>\n ) : (\n <Combobox.Item key={w.id} value={w} className={s.searchItem()}>\n <WorkspaceOptionBody workspace={w} current={w.id === current?.id} />\n <Combobox.ItemIndicator className={s.searchIndicator()}>\n <Check size={15} aria-hidden />\n </Combobox.ItemIndicator>\n </Combobox.Item>\n )\n }\n </Combobox.List>\n </Combobox.Popup>\n </Combobox.Positioner>\n </Combobox.Portal>\n </Combobox.Root>\n );\n}\n","import { Plus } from 'lucide-react';\nimport type { ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport {\n Menu,\n MenuContent,\n MenuGroupLabel,\n MenuItem,\n MenuRadioGroup,\n MenuRadioItem,\n MenuSeparator,\n MenuTrigger,\n} from '../Menu';\nimport { workspaceSwitcherVariants } from './workspace-switcher.variants';\nimport { triggerLabel, WorkspaceOptionBody, WorkspaceTriggerContent, type Workspace } from './parts';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { WorkspaceSearch } from './WorkspaceSearch';\n\nexport type { Workspace } from './parts';\n\nexport interface WorkspaceSwitcherProps {\n className?: string;\n workspaces: Workspace[];\n currentId: string;\n /** Called with the chosen workspace. */\n onSelect: (workspace: Workspace) => void;\n /** Adds a \"Create workspace\" action at the end of the list. */\n onCreate?: () => void;\n createLabel?: string;\n /** Heading of the list (and the popup's accessible name). */\n label?: string;\n /** Adds a search field. Defaults to on when there are more than `searchThreshold` workspaces. */\n searchable?: boolean;\n searchThreshold?: number;\n searchPlaceholder?: string;\n emptyText?: ReactNode;\n}\n\nconst s = workspaceSwitcherVariants();\n\n/**\n * Two-line workspace picker for the topbar or sidebar header: logo, name and plan/role meta,\n * the current workspace checked, a search field when the list is long, and \"Create workspace\".\n * A menu for short lists; a searchable listbox (combobox) for long ones.\n */\nexport function WorkspaceSwitcher(props: WorkspaceSwitcherProps) {\n const {\n className,\n workspaces,\n currentId,\n onSelect,\n onCreate,\n createLabel: createLabelProp,\n label: labelProp,\n searchable,\n searchThreshold = 6,\n } = props;\n const { t } = useI18n();\n const createLabel = createLabelProp ?? t('workspace.create');\n const label = labelProp ?? t('workspace.switch');\n const current = workspaces.find((w) => w.id === currentId);\n if (searchable ?? workspaces.length > searchThreshold) {\n return <WorkspaceSearch {...props} current={current} createLabel={createLabel} label={label} />;\n }\n return (\n <Menu>\n <MenuTrigger aria-label={triggerLabel(current, label)} className={cn(s.trigger(), className)}>\n <WorkspaceTriggerContent workspace={current} />\n </MenuTrigger>\n <MenuContent className={s.popup()}>\n <MenuRadioGroup\n value={currentId}\n onValueChange={(id: string) => {\n const next = workspaces.find((w) => w.id === id);\n if (next) onSelect(next);\n }}\n >\n <MenuGroupLabel>{label}</MenuGroupLabel>\n {workspaces.map((w) => (\n <MenuRadioItem key={w.id} value={w.id} label={w.name} className={s.option()}>\n <WorkspaceOptionBody workspace={w} current={w.id === currentId} />\n </MenuRadioItem>\n ))}\n </MenuRadioGroup>\n {onCreate && (\n <>\n <MenuSeparator />\n <MenuItem icon={Plus} onClick={onCreate}>\n {createLabel}\n </MenuItem>\n </>\n )}\n </MenuContent>\n </Menu>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'WorkspaceSwitcher',\n group: 'Navigation',\n status: 'beta',\n description:\n 'Two-line workspace picker (logo, name, plan/role meta) for the topbar or sidebar header. Short lists open a menu with the current workspace checked; long lists (or `searchable`) open a combobox with a search field. An optional \"Create workspace\" action closes the list.',\n primitive: '@base-ui/react/menu · @base-ui/react/combobox',\n pattern: 'menu button (short lists) / select-only combobox with search (long lists)',\n keyboard: [\n ['Enter / Space / ArrowDown', 'On the trigger: opens the list'],\n ['ArrowDown / ArrowUp', 'Moves between workspaces and the create action'],\n ['Typing (searchable)', 'Filters workspaces by name or meta'],\n ['Enter', 'Switches to the highlighted workspace (or runs Create workspace) and closes'],\n ['Escape', 'Closes the list and returns focus to the trigger'],\n ],\n tokens: [\n 'card',\n 'border',\n 'secondary',\n 'popover',\n 'primary',\n 'primary-foreground',\n 'primary-text',\n 'accent',\n 'accent-foreground',\n 'muted-foreground',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const authLayoutVariants = tv({\n slots: {\n root: 'relative flex overflow-hidden font-sans text-foreground',\n skipLink: 'focus:absolute',\n main: 'flex min-w-0 flex-1 flex-col items-center overflow-y-auto p-7 outline-none sm:p-10',\n column: 'my-auto flex w-full flex-col',\n logo: 'mb-8 flex',\n surface: 'w-full',\n footer: 'mt-7 text-center text-[13px] text-muted-foreground',\n brand:\n 'relative hidden w-[46%] max-w-[640px] shrink-0 flex-col justify-between gap-10 overflow-y-auto border-e border-border/60 bg-chrome p-12 lg:order-first lg:flex',\n brandBody: 'max-w-[420px]',\n brandFooter: 'font-mono text-[11.5px] text-muted-foreground',\n },\n variants: {\n variant: {\n split: {\n root: 'bg-background',\n column: 'max-w-[392px]',\n logo: 'lg:hidden',\n },\n card: {\n root: 'bg-background',\n column: 'max-w-[420px] items-center',\n surface: 'rounded-xl border border-border bg-card p-8 text-card-foreground shadow-sm',\n logo: 'justify-center',\n },\n 'full-bleed': {\n root: 'bg-chrome',\n main: 'items-stretch',\n column: 'mx-auto max-w-[420px]',\n },\n },\n fullScreen: {\n true: { root: 'h-dvh' },\n false: { root: 'h-full min-h-full' },\n },\n },\n defaultVariants: { variant: 'split', fullScreen: false },\n});\n\nexport type AuthLayoutVariantProps = VariantProps<typeof authLayoutVariants>;\n","import type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { SkipLink } from '../../components/VisuallyHidden';\nimport { Logo } from '../../theme/Logo';\nimport { useTheme } from '../../theme/ThemeProvider';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { authLayoutVariants, type AuthLayoutVariantProps } from './auth-layout.variants';\n\nexport interface AuthLayoutProps extends Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'children'> {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n /** `split` (brand panel + form), `card` (centred card) or `full-bleed` (form on the chrome surface). */\n variant?: AuthLayoutVariantProps['variant'];\n /** The form: heading, fields, submit, alternative sign-in methods. */\n children?: ReactNode;\n /** Brand mark above the form (and in the split brand panel). Defaults to the active preset's Logo with wordmark. */\n logo?: ReactNode;\n /** Split variant: brand panel body (eyebrow, headline, feature list). */\n brand?: ReactNode;\n /** Split variant: line at the bottom of the brand panel (security note, status). */\n brandFooter?: ReactNode;\n /** Accessible name of the brand panel. Defaults to the brand preset's name. */\n brandLabel?: string;\n /** Below the form (switch to sign-up, terms, help). */\n footer?: ReactNode;\n mainId?: string;\n skipLinkLabel?: string;\n fullScreen?: boolean;\n}\n\n/**\n * Sign-in / sign-up shell. `split` pairs a brand panel (chrome surface, Logo from the theme's\n * brand preset) with the form and hides the panel below `lg`; `card` centres the form in a card;\n * `full-bleed` puts it straight on the chrome surface. The form comes first in the DOM, so it is\n * first in tab order (after the skip link) on every screen size.\n */\nexport function AuthLayout({\n variant = 'split',\n children,\n logo,\n brand,\n brandFooter,\n brandLabel,\n footer,\n mainId = 'main',\n skipLinkLabel: skipLinkLabelProp,\n fullScreen = false,\n className,\n ...props\n}: AuthLayoutProps) {\n const { t } = useI18n();\n const skipLinkLabel = skipLinkLabelProp ?? t('skip.signIn');\n const theme = useTheme();\n const s = authLayoutVariants({ variant, fullScreen });\n const mark = logo ?? <Logo size={28} wordmark />;\n return (\n <div className={cn(s.root(), className)} {...props}>\n <SkipLink targetId={mainId} className={s.skipLink()}>\n {skipLinkLabel}\n </SkipLink>\n <main id={mainId} tabIndex={-1} className={s.main()}>\n <div className={s.column()}>\n <div className={s.logo()}>{mark}</div>\n <div className={s.surface()}>{children}</div>\n {footer != null && <div className={s.footer()}>{footer}</div>}\n </div>\n </main>\n {variant === 'split' && (\n <aside aria-label={brandLabel ?? theme.brand.name} className={s.brand()}>\n {/* The small-screen logo already names the brand; this one is decorative. */}\n <div aria-hidden>{mark}</div>\n <div className={s.brandBody()}>{brand}</div>\n {brandFooter != null ? <div className={s.brandFooter()}>{brandFooter}</div> : <div />}\n </aside>\n )}\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'AuthLayout',\n group: 'Layout',\n status: 'beta',\n description:\n 'Sign-in, sign-up and reset shell in three variants: `split` (brand panel on the chrome surface + form; the panel hides below `lg` and the logo moves above the form), `card` (form centred in a card) and `full-bleed` (form straight on the chrome surface). The logo defaults to the ThemeProvider brand preset (Logo with wordmark). The form is first in the DOM, so it is first in tab order on every screen size. Fills its container; `fullScreen` switches to `h-dvh`.',\n pattern: 'landmarks (main, labelled brand aside) + skip link',\n keyboard: [\n ['Tab', 'Skip link first, then the form fields in order, then the footer links'],\n ['Enter on the skip link', 'Moves focus to the form region'],\n ],\n tokens: [\n 'background',\n 'chrome',\n 'card',\n 'card-foreground',\n 'border',\n 'muted-foreground',\n 'primary-text',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const canvasLayoutVariants = tv({\n slots: {\n root: 'relative flex flex-col overflow-hidden bg-background font-sans text-foreground',\n skipLink: 'focus:absolute',\n header: 'flex h-12 shrink-0 items-center gap-3 border-b border-border bg-chrome px-3',\n headerContent: 'flex min-w-0 flex-1 items-center gap-3',\n toggles: 'hidden shrink-0 items-center gap-1 lg:flex',\n body: 'flex min-h-0 flex-1',\n palette: 'hidden w-60 shrink-0 flex-col overflow-y-auto border-e border-border bg-card lg:flex',\n inspector: 'hidden w-72 shrink-0 flex-col overflow-y-auto border-s border-border bg-card lg:flex',\n panelTitle:\n 'flex h-10 shrink-0 items-center border-b border-border px-3 font-mono text-[10.5px] font-semibold tracking-[0.14em] text-muted-foreground uppercase',\n panelBody: 'flex-1 p-3',\n center: 'flex min-w-0 flex-1 flex-col',\n main: 'relative min-h-0 flex-1 overflow-hidden outline-none',\n notice: [\n 'absolute top-3 left-1/2 z-20 flex max-w-[calc(100%-1.5rem)] -translate-x-1/2 items-center gap-2 lg:hidden',\n 'rounded-md border border-border bg-card px-3 py-2 text-[12.5px] text-muted-foreground shadow-sm',\n ],\n toolbar: 'absolute top-3 left-1/2 z-10 hidden -translate-x-1/2 lg:block',\n console: 'flex shrink-0 flex-col border-t border-border bg-card',\n consoleBar: 'flex h-9 shrink-0 items-center gap-2 px-2',\n consoleToggle: [\n 'inline-flex h-7 items-center gap-1.5 rounded-md px-2 font-mono text-[10.5px] font-semibold tracking-[0.14em] text-muted-foreground uppercase',\n 'transition-colors hover:bg-secondary hover:text-foreground motion-reduce:transition-none',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n consoleChevron: 'transition-transform motion-reduce:transition-none',\n consoleActions: 'ms-auto flex items-center gap-1',\n consoleBody: 'h-40 overflow-y-auto border-t border-border font-mono text-[12px]',\n },\n variants: {\n fullScreen: {\n true: { root: 'h-dvh' },\n false: { root: 'h-full min-h-full' },\n },\n consoleOpen: {\n true: { consoleChevron: 'rotate-0' },\n false: { consoleChevron: '-rotate-90' },\n },\n },\n defaultVariants: { fullScreen: false, consoleOpen: true },\n});\n\nexport type CanvasLayoutVariantProps = VariantProps<typeof canvasLayoutVariants>;\n","import { ChevronDown, Monitor, PanelLeft, PanelRight } from 'lucide-react';\nimport { useId, useState, type HTMLAttributes, type ReactNode, type Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { IconButton } from '../../components/Button';\nimport { SkipLink } from '../../components/VisuallyHidden';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { canvasLayoutVariants } from './canvas-layout.variants';\n\n/** Controlled-or-uncontrolled boolean (open state of a panel). */\nfunction usePanelState(value: boolean | undefined, defaultValue: boolean, onChange?: (open: boolean) => void) {\n const [inner, setInner] = useState(defaultValue);\n const open = value ?? inner;\n const set = (next: boolean) => {\n if (value === undefined) setInner(next);\n onChange?.(next);\n };\n return [open, set] as const;\n}\n\nexport interface CanvasLayoutProps extends Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'children'> {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n /** The full-bleed canvas (a flow editor, a code editor, a map…). Rendered inside `<main>`. */\n children?: ReactNode;\n /** Top bar content (title, breadcrumb, run/save actions). The panel toggles sit on its right. */\n header?: ReactNode;\n /** Floating toolbar centred over the canvas (large screens). */\n toolbar?: ReactNode;\n /** Left palette (node/shape library). */\n palette?: ReactNode;\n paletteLabel?: string;\n paletteOpen?: boolean;\n defaultPaletteOpen?: boolean;\n onPaletteOpenChange?: (open: boolean) => void;\n /** Right inspector (properties of the selection). */\n inspector?: ReactNode;\n inspectorLabel?: string;\n inspectorOpen?: boolean;\n defaultInspectorOpen?: boolean;\n onInspectorOpenChange?: (open: boolean) => void;\n /** Bottom console (logs, problems, run output). Collapsible from its own bar. */\n console?: ReactNode;\n consoleLabel?: string;\n /** Extra controls on the right of the console bar (clear, filter…). */\n consoleActions?: ReactNode;\n consoleOpen?: boolean;\n defaultConsoleOpen?: boolean;\n onConsoleOpenChange?: (open: boolean) => void;\n /** Shown over the canvas below `lg`, where palette and inspector are hidden. Pass `null` to hide. */\n smallScreenNotice?: ReactNode;\n /**\n * Inside an app shell that already owns <main> and the skip link (SidebarLayout, StackedLayout):\n * render the content region as a plain <div> and drop this layout's skip link.\n */\n embedded?: boolean;\n /** `id` of the `<main>` landmark (skip-link target). */\n mainId?: string;\n /** Accessible name of the canvas region. */\n mainLabel?: string;\n skipLinkLabel?: string;\n /** Fill the viewport (`h-dvh`) instead of the container. */\n fullScreen?: boolean;\n}\n\n/**\n * Editor shell for a full-bleed canvas: top bar · left palette · canvas with a floating toolbar ·\n * right inspector · collapsible bottom console. Palette and inspector toggle from the top bar\n * (aria-expanded). Below `lg` the side panels hide and a read-only notice shows over the canvas.\n */\nexport function CanvasLayout({\n children,\n header,\n toolbar,\n palette,\n paletteLabel: paletteLabelProp,\n paletteOpen: paletteOpenProp,\n defaultPaletteOpen = true,\n onPaletteOpenChange,\n inspector,\n inspectorLabel: inspectorLabelProp,\n inspectorOpen: inspectorOpenProp,\n defaultInspectorOpen = true,\n onInspectorOpenChange,\n console: consoleContent,\n consoleLabel: consoleLabelProp,\n consoleActions,\n consoleOpen: consoleOpenProp,\n defaultConsoleOpen = true,\n onConsoleOpenChange,\n smallScreenNotice: smallScreenNoticeProp,\n embedded = false,\n mainId = 'main',\n mainLabel: mainLabelProp,\n skipLinkLabel: skipLinkLabelProp,\n fullScreen = false,\n className,\n ...props\n}: CanvasLayoutProps) {\n const { t } = useI18n();\n const paletteLabel = paletteLabelProp ?? t('canvas.palette');\n const inspectorLabel = inspectorLabelProp ?? t('canvas.inspector');\n const consoleLabel = consoleLabelProp ?? t('canvas.console');\n const smallScreenNotice = smallScreenNoticeProp ?? t('canvas.smallScreen');\n const mainLabel = mainLabelProp ?? t('canvas.main');\n const skipLinkLabel = skipLinkLabelProp ?? t('skip.canvas');\n const MainTag = embedded ? 'div' : 'main';\n const [paletteOpen, setPaletteOpen] = usePanelState(paletteOpenProp, defaultPaletteOpen, onPaletteOpenChange);\n const [inspectorOpen, setInspectorOpen] = usePanelState(\n inspectorOpenProp,\n defaultInspectorOpen,\n onInspectorOpenChange,\n );\n const [consoleOpen, setConsoleOpen] = usePanelState(consoleOpenProp, defaultConsoleOpen, onConsoleOpenChange);\n const uid = useId();\n const paletteId = `${uid}-palette`;\n const inspectorId = `${uid}-inspector`;\n const consoleBodyId = `${uid}-console`;\n const s = canvasLayoutVariants({ fullScreen, consoleOpen });\n\n return (\n <div className={cn(s.root(), className)} {...props}>\n {!embedded && (\n <SkipLink targetId={mainId} className={s.skipLink()}>\n {skipLinkLabel}\n </SkipLink>\n )}\n <header className={s.header()}>\n <div className={s.headerContent()}>{header}</div>\n {(palette != null || inspector != null) && (\n <div className={s.toggles()}>\n {palette != null && (\n <IconButton\n icon={PanelLeft}\n size=\"sm\"\n label={paletteLabel}\n aria-expanded={paletteOpen}\n aria-controls={paletteId}\n onClick={() => setPaletteOpen(!paletteOpen)}\n />\n )}\n {inspector != null && (\n <IconButton\n icon={PanelRight}\n size=\"sm\"\n label={inspectorLabel}\n aria-expanded={inspectorOpen}\n aria-controls={inspectorId}\n onClick={() => setInspectorOpen(!inspectorOpen)}\n />\n )}\n </div>\n )}\n </header>\n <div className={s.body()}>\n {palette != null && (\n <aside id={paletteId} aria-label={paletteLabel} hidden={!paletteOpen} className={s.palette()}>\n <div className={s.panelTitle()} aria-hidden>\n {paletteLabel}\n </div>\n <div className={s.panelBody()}>{palette}</div>\n </aside>\n )}\n <div className={s.center()}>\n <MainTag\n id={mainId}\n tabIndex={-1}\n role={embedded ? 'region' : undefined}\n aria-label={mainLabel}\n className={s.main()}\n >\n {smallScreenNotice != null && (\n <p className={s.notice()}>\n <Monitor size={14} aria-hidden className=\"shrink-0\" />\n {smallScreenNotice}\n </p>\n )}\n {toolbar != null && <div className={s.toolbar()}>{toolbar}</div>}\n {children}\n </MainTag>\n {consoleContent != null && (\n <section aria-label={consoleLabel} className={s.console()}>\n <div className={s.consoleBar()}>\n <button\n type=\"button\"\n className={s.consoleToggle()}\n aria-expanded={consoleOpen}\n aria-controls={consoleBodyId}\n onClick={() => setConsoleOpen(!consoleOpen)}\n >\n <ChevronDown size={14} aria-hidden className={s.consoleChevron()} />\n {consoleLabel}\n </button>\n {consoleActions != null && <div className={s.consoleActions()}>{consoleActions}</div>}\n </div>\n <div id={consoleBodyId} hidden={!consoleOpen} className={s.consoleBody()}>\n {consoleContent}\n </div>\n </section>\n )}\n </div>\n {inspector != null && (\n <aside id={inspectorId} aria-label={inspectorLabel} hidden={!inspectorOpen} className={s.inspector()}>\n <div className={s.panelTitle()} aria-hidden>\n {inspectorLabel}\n </div>\n <div className={s.panelBody()}>{inspector}</div>\n </aside>\n )}\n </div>\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'CanvasLayout',\n group: 'Layout',\n status: 'beta',\n description:\n 'Editor shell for a full-bleed canvas (flow editor, code editor, map): top bar · left palette · canvas with a floating toolbar · right inspector · collapsible bottom console. Palette and inspector toggle from the top bar; each panel is controllable (`paletteOpen`, `inspectorOpen`, `consoleOpen`). Below `lg` the side panels and toggles hide and a read-only notice (\"Open on a larger screen to edit\") shows over the canvas. Fills its container; `fullScreen` switches to `h-dvh`.',\n pattern: 'landmarks (header, main, two labelled asides, labelled console region) + disclosure buttons',\n keyboard: [\n [\n 'Tab',\n 'Skip link first, then the top bar, the panel toggles, the palette, the canvas, the console and the inspector',\n ],\n ['Enter / Space on a panel toggle', 'Shows or hides the palette or inspector (aria-expanded reflects the state)'],\n ['Enter / Space on the console bar', 'Collapses or expands the console (aria-expanded)'],\n ],\n tokens: ['background', 'foreground', 'chrome', 'card', 'border', 'secondary', 'muted-foreground', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const docsLayoutVariants = tv({\n slots: {\n root: 'relative flex flex-col overflow-hidden bg-background font-sans text-foreground',\n skipLink: 'focus:absolute',\n header: 'flex h-12 shrink-0 items-center gap-3 border-b border-border bg-chrome px-4',\n body: 'flex min-h-0 flex-1',\n nav: 'hidden w-60 shrink-0 overflow-y-auto border-e border-border px-3 py-6 lg:block',\n main: 'min-w-0 flex-1 overflow-y-auto outline-none',\n column: 'mx-auto w-full max-w-3xl px-4 py-8 sm:px-8',\n mobileToc: 'mb-6 rounded-lg border border-border bg-card px-3 lg:hidden',\n article: 'min-w-0',\n footer: 'mt-12 border-t border-border pt-6',\n toc: 'hidden w-56 shrink-0 overflow-y-auto py-8 pe-4 ps-2 lg:block',\n },\n variants: {\n fullScreen: {\n true: { root: 'h-dvh' },\n false: { root: 'h-full min-h-full' },\n },\n },\n defaultVariants: { fullScreen: false },\n});\n\nexport const outlineVariants = tv({\n slots: {\n root: 'flex flex-col gap-2',\n heading: 'px-2 font-mono text-[10.5px] font-semibold tracking-[0.14em] text-muted-foreground uppercase',\n list: 'm-0 flex list-none flex-col border-s border-border p-0',\n link: [\n '-ms-px block border-s-2 border-transparent py-1 pe-2 text-[12.5px] leading-snug text-muted-foreground',\n 'transition-colors hover:text-foreground motion-reduce:transition-none',\n 'aria-[current=location]:border-primary aria-[current=location]:font-medium aria-[current=location]:text-primary-text',\n 'rounded-e-sm focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n ],\n },\n variants: {\n level: {\n 2: { link: 'ps-3' },\n 3: { link: 'ps-6' },\n },\n },\n defaultVariants: { level: 2 },\n});\n\nexport type DocsLayoutVariantProps = VariantProps<typeof docsLayoutVariants>;\nexport type OutlineVariantProps = VariantProps<typeof outlineVariants>;\n","import {\n useEffect,\n useEffectEvent,\n useId,\n useState,\n type HTMLAttributes,\n type MouseEvent,\n type ReactNode,\n type Ref,\n type RefObject,\n} from 'react';\nimport { cn } from '../../utils/cn';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { outlineVariants } from './docs-layout.variants';\n\nexport interface OutlineItem {\n /** `id` of the heading in the article. */\n id: string;\n label: ReactNode;\n /** Heading depth: 2 (section) or 3 (sub-section, indented). */\n level?: 2 | 3;\n}\n\nexport interface OutlineProps extends Omit<HTMLAttributes<HTMLElement>, 'className' | 'children'> {\n className?: string;\n ref?: Ref<HTMLElement>;\n items: OutlineItem[];\n /** Heading and accessible name. */\n label?: string;\n /** Hide the visible heading (e.g. inside a Collapsible whose trigger already says it). */\n hideHeading?: boolean;\n /** Render as a `<nav>` landmark (default) or a plain `<div>` (when nested in another named region). */\n landmark?: boolean;\n /** Current section (controlled). Without it, scroll-spy tracks the heading in view. */\n activeId?: string;\n onActiveChange?: (id: string) => void;\n /** Scroll container the headings move in (the layout's main column). Defaults to the viewport. */\n scrollRootRef?: RefObject<Element | null>;\n /** Called after a link moved focus to its heading. */\n onNavigate?: (id: string) => void;\n}\n\nconst NATIVELY_FOCUSABLE = 'a[href], button, input, select, textarea, summary, [tabindex]';\n\n/**\n * Table of contents with scroll-spy: the link of the heading in view gets aria-current=\"location\".\n * Activating a link moves focus (not just scroll) to the heading. IntersectionObserver is optional:\n * without it (jsdom, old browsers) the active item only follows clicks.\n */\nexport function Outline({\n items,\n label: labelProp,\n hideHeading = false,\n landmark = true,\n activeId: activeProp,\n onActiveChange,\n scrollRootRef,\n onNavigate,\n className,\n ref,\n ...props\n}: OutlineProps) {\n const { t } = useI18n();\n const label = labelProp ?? t('nav.onThisPage');\n const [inner, setInner] = useState<string | undefined>(items[0]?.id);\n const active = activeProp ?? inner;\n const headingId = useId();\n const s = outlineVariants();\n const ids = items.map((i) => i.id).join('|');\n const spy = useEffectEvent((id: string) => {\n setInner(id);\n onActiveChange?.(id);\n });\n\n useEffect(() => {\n if (typeof IntersectionObserver === 'undefined') return;\n const targets = ids\n .split('|')\n .map((id) => document.getElementById(id))\n .filter((el): el is HTMLElement => el !== null);\n if (!targets.length) return;\n const visible = new Set<string>();\n const observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) visible.add(entry.target.id);\n else visible.delete(entry.target.id);\n }\n const first = targets.find((t) => visible.has(t.id));\n if (first) spy(first.id);\n },\n { root: scrollRootRef?.current ?? null, rootMargin: '0px 0px -65% 0px', threshold: 0 },\n );\n targets.forEach((t) => observer.observe(t));\n return () => observer.disconnect();\n }, [ids, scrollRootRef]);\n\n function go(event: MouseEvent<HTMLAnchorElement>, id: string) {\n const target = document.getElementById(id);\n if (!target) return;\n event.preventDefault();\n if (!target.matches(NATIVELY_FOCUSABLE)) target.setAttribute('tabindex', '-1');\n target.focus({ preventScroll: true });\n const reduce =\n typeof window.matchMedia === 'function' && window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n target.scrollIntoView?.({ block: 'start', behavior: reduce ? 'auto' : 'smooth' });\n setInner(id);\n onActiveChange?.(id);\n onNavigate?.(id);\n try {\n history.replaceState(history.state, '', `#${id}`);\n } catch {}\n }\n\n const list = (\n <ul className={s.list()}>\n {items.map((item) => (\n <li key={item.id}>\n <a\n href={`#${item.id}`}\n aria-current={item.id === active ? 'location' : undefined}\n className={outlineVariants({ level: item.level ?? 2 }).link()}\n onClick={(e) => go(e, item.id)}\n >\n {item.label}\n </a>\n </li>\n ))}\n </ul>\n );\n\n const heading = !hideHeading && (\n <p id={headingId} className={s.heading()}>\n {label}\n </p>\n );\n if (!landmark) {\n return (\n <div ref={ref as Ref<HTMLDivElement> | undefined} className={cn(s.root(), className)} {...props}>\n {heading}\n {list}\n </div>\n );\n }\n return (\n <nav\n ref={ref}\n aria-labelledby={hideHeading ? undefined : headingId}\n aria-label={hideHeading ? label : undefined}\n className={cn(s.root(), className)}\n {...props}\n >\n {heading}\n {list}\n </nav>\n );\n}\n","import { useRef, type HTMLAttributes, type ReactNode, type Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { Collapsible, CollapsiblePanel, CollapsibleTrigger } from '../../components/Collapsible';\nimport { SkipLink } from '../../components/VisuallyHidden';\nimport { docsLayoutVariants } from './docs-layout.variants';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { Outline, type OutlineItem } from './Outline';\n\nexport interface DocsLayoutProps extends Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'children'> {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n /** The article (headings with ids matching `toc`). */\n children?: ReactNode;\n /** Top bar (logo, search, version switcher, theme, MobileNav trigger). */\n header?: ReactNode;\n /** Left navigation — usually a NavList (it provides its own `<nav>` landmark). Hidden below `lg`. */\n nav?: ReactNode;\n /** Table of contents entries; renders the Outline (scroll-spy) on the right and a Collapsible copy below `lg`. */\n toc?: OutlineItem[];\n /** Heading / accessible name of the table of contents. */\n tocLabel?: string;\n /** Replaces the right column (when not using `toc`). */\n aside?: ReactNode;\n /**\n * Inside an app shell that already owns <main> and the skip link (SidebarLayout, StackedLayout):\n * render the content region as a plain <div> and drop this layout's skip link.\n */\n embedded?: boolean;\n /** After the article (previous / next links, feedback, last updated). */\n footer?: ReactNode;\n mainId?: string;\n skipLinkLabel?: string;\n fullScreen?: boolean;\n}\n\n/**\n * Documentation shell: top bar · left nav · article · right table of contents with scroll-spy\n * (Outline). The article column scrolls on its own and is the Outline's scroll root. Below `lg`\n * the nav hides and the table of contents moves into a Collapsible above the article.\n */\nexport function DocsLayout({\n children,\n header,\n nav,\n toc,\n tocLabel: tocLabelProp,\n aside,\n footer,\n embedded = false,\n mainId = 'main',\n skipLinkLabel: skipLinkLabelProp,\n fullScreen = false,\n className,\n ...props\n}: DocsLayoutProps) {\n const { t } = useI18n();\n const tocLabel = tocLabelProp ?? t('nav.onThisPage');\n const skipLinkLabel = skipLinkLabelProp ?? t('skip.content');\n const MainTag = embedded ? 'div' : 'main';\n const mainRef = useRef<HTMLDivElement>(null);\n const s = docsLayoutVariants({ fullScreen });\n const hasToc = toc != null && toc.length > 0;\n return (\n <div className={cn(s.root(), className)} {...props}>\n {!embedded && (\n <SkipLink targetId={mainId} className={s.skipLink()}>\n {skipLinkLabel}\n </SkipLink>\n )}\n {header != null && <header className={s.header()}>{header}</header>}\n <div className={s.body()}>\n {nav != null && <div className={s.nav()}>{nav}</div>}\n <MainTag ref={mainRef} id={mainId} tabIndex={-1} className={s.main()}>\n <div className={s.column()}>\n {hasToc && (\n <Collapsible variant=\"row\" className={s.mobileToc()}>\n <CollapsibleTrigger>{tocLabel}</CollapsibleTrigger>\n <CollapsiblePanel>\n <Outline items={toc} label={tocLabel} landmark={false} hideHeading scrollRootRef={mainRef} />\n </CollapsiblePanel>\n </Collapsible>\n )}\n <article className={s.article()}>{children}</article>\n {footer != null && <div className={s.footer()}>{footer}</div>}\n </div>\n </MainTag>\n {(hasToc || aside != null) && (\n <div className={s.toc()}>\n {aside ?? (hasToc && <Outline items={toc} label={tocLabel} scrollRootRef={mainRef} />)}\n </div>\n )}\n </div>\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'DocsLayout',\n group: 'Layout',\n status: 'beta',\n description:\n 'Documentation shell: top bar · left nav (a NavList) · article · right table of contents. The `Outline` sub-component is the table of contents: scroll-spy with IntersectionObserver (rooted in the article column, guarded where it is missing) marks the heading in view with aria-current=\"location\", and activating a link moves focus to the heading. Below `lg` the nav hides and the table of contents moves into a Collapsible above the article. Fills its container; `fullScreen` switches to `h-dvh`.',\n primitive: '@base-ui/react/collapsible (small-screen table of contents)',\n pattern: 'landmarks (header, nav, main, \"On this page\" nav) + disclosure',\n keyboard: [\n ['Tab', 'Skip link, top bar, left nav, the article, then the table of contents links'],\n ['Enter on a table of contents link', 'Scrolls to the heading and moves focus to it'],\n ['Enter / Space on \"On this page\"', 'Small screens: expands or collapses the table of contents'],\n ],\n tokens: [\n 'background',\n 'foreground',\n 'chrome',\n 'card',\n 'border',\n 'primary',\n 'primary-text',\n 'muted-foreground',\n 'focus-ring',\n ],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const inspectorLayoutVariants = tv({\n slots: {\n root: 'relative flex w-full min-w-0 overflow-hidden bg-background text-foreground',\n main: 'min-h-0 min-w-0 flex-1 overflow-y-auto',\n panel: 'flex h-full min-h-0 shrink-0 flex-col border-s border-border bg-card',\n panelHeader: 'flex h-12 shrink-0 items-center gap-1 border-b border-border/60 pe-2 ps-4',\n panelTitle: 'min-w-0 flex-1 truncate text-[13px] font-semibold text-foreground',\n panelBody: 'min-h-0 flex-1 overflow-y-auto p-4',\n drawerBody: 'p-4',\n },\n variants: {\n fullScreen: { true: { root: 'h-dvh' }, false: { root: 'h-full min-h-0' } },\n pinned: {\n true: { panel: '' },\n false: { panel: 'absolute inset-y-0 end-0 z-20 shadow-md' },\n },\n },\n defaultVariants: { fullScreen: false, pinned: true },\n});\n\nexport type InspectorLayoutVariantProps = VariantProps<typeof inspectorLayoutVariants>;\n","import { useSyncExternalStore } from 'react';\n\n/**\n * Subscribes to a media query. Without `matchMedia` (SSR, jsdom) it reports `fallback`.\n */\nexport function useMediaQuery(query: string, fallback = true): boolean {\n return useSyncExternalStore(\n (onChange) => {\n if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') return () => {};\n const mql = window.matchMedia(query);\n mql.addEventListener('change', onChange);\n return () => mql.removeEventListener('change', onChange);\n },\n () =>\n typeof window !== 'undefined' && typeof window.matchMedia === 'function'\n ? window.matchMedia(query).matches\n : fallback,\n () => fallback,\n );\n}\n","import { PanelRight, Pin, X } from 'lucide-react';\nimport { createContext, useContext, useId, useRef, useState, type KeyboardEvent, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { IconButton, type IconButtonProps } from '../../components/Button';\nimport { Drawer, DrawerBody, DrawerContent, DrawerHeader, DrawerTitle } from '../../components/Drawer';\nimport { inspectorLayoutVariants } from './inspector-layout.variants';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { useMediaQuery } from './use-media-query';\n\nexport interface InspectorLayoutContextValue {\n open: boolean;\n pinned: boolean;\n /** True on large screens (side panel); false when the panel is a bottom Drawer. */\n docked: boolean;\n panelId: string;\n setOpen: (open: boolean) => void;\n setPinned: (pinned: boolean) => void;\n}\n\nconst InspectorContext = createContext<InspectorLayoutContextValue | null>(null);\n\n/** Inspector state for anything rendered inside an InspectorLayout. */\nexport function useInspectorLayout(): InspectorLayoutContextValue {\n const ctx = useContext(InspectorContext);\n if (!ctx) throw new Error('useInspectorLayout must be used inside <InspectorLayout>.');\n return ctx;\n}\n\nexport interface InspectorLayoutProps {\n className?: string;\n /** Main area (canvas, table, editor…). Place an InspectorToggle in it. */\n children?: ReactNode;\n /** Panel content (properties, details, comments…). */\n panel: ReactNode;\n /** Panel heading; also the accessible name of its landmark. */\n panelTitle: string;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Pinned: the panel docks beside the main area. Unpinned: it overlays it and Escape closes it. */\n pinned?: boolean;\n defaultPinned?: boolean;\n onPinnedChange?: (pinned: boolean) => void;\n /** Panel width in px (large screens). */\n panelWidth?: number;\n pinLabel?: string;\n closeLabel?: string;\n /** Media query for the docked (side panel) mode; below it the panel is a bottom Drawer. */\n dockedQuery?: string;\n fullScreen?: boolean;\n}\n\n/**\n * Main area · pinnable right panel. Pinned, the panel docks beside the content; unpinned, it\n * overlays it and Escape closes it. Below lg the panel opens as a bottom Drawer.\n */\nexport function InspectorLayout({\n className,\n children,\n panel,\n panelTitle,\n open: openProp,\n defaultOpen = true,\n onOpenChange,\n pinned: pinnedProp,\n defaultPinned = true,\n onPinnedChange,\n panelWidth = 320,\n pinLabel: pinLabelProp,\n closeLabel: closeLabelProp,\n dockedQuery = '(min-width: 1024px)',\n fullScreen = false,\n}: InspectorLayoutProps) {\n const { t } = useI18n();\n const pinLabel = pinLabelProp ?? t('inspector.pin');\n const closeLabel = closeLabelProp ?? t('inspector.close');\n const panelId = useId();\n const titleId = useId();\n const rootRef = useRef<HTMLDivElement>(null);\n const panelRef = useRef<HTMLElement>(null);\n const docked = useMediaQuery(dockedQuery, true);\n const [openState, setOpenState] = useState(defaultOpen);\n const [pinnedState, setPinnedState] = useState(defaultPinned);\n const open = openProp ?? openState;\n const pinned = pinnedProp ?? pinnedState;\n const setOpen = (next: boolean) => {\n setOpenState(next);\n onOpenChange?.(next);\n };\n const setPinned = (next: boolean) => {\n setPinnedState(next);\n onPinnedChange?.(next);\n };\n const focusToggle = () => rootRef.current?.querySelector<HTMLElement>('[data-inspector-toggle]')?.focus();\n const close = () => {\n setOpen(false);\n focusToggle();\n };\n\n function handleKeyDown(event: KeyboardEvent<HTMLDivElement>) {\n if (event.key !== 'Escape' || event.defaultPrevented || !open || pinned || !docked) return;\n const target = event.target as Node;\n const fromPanel = panelRef.current?.contains(target);\n const fromToggle = target instanceof HTMLElement && target.closest('[data-inspector-toggle]');\n if (!fromPanel && !fromToggle) return;\n event.preventDefault();\n close();\n }\n\n const s = inspectorLayoutVariants({ fullScreen, pinned });\n const ctx: InspectorLayoutContextValue = { open, pinned, docked, panelId, setOpen, setPinned };\n\n return (\n <InspectorContext.Provider value={ctx}>\n <div\n ref={rootRef}\n className={cn(s.root(), className)}\n onKeyDown={handleKeyDown}\n data-inspector-open={open || undefined}\n >\n <div className={s.main()}>{children}</div>\n {docked && open && (\n <aside\n ref={panelRef}\n id={panelId}\n aria-labelledby={titleId}\n tabIndex={-1}\n data-pinned={pinned || undefined}\n className={s.panel()}\n style={{ width: panelWidth, maxWidth: '100%' }}\n >\n <div className={s.panelHeader()}>\n <h2 id={titleId} className={s.panelTitle()}>\n {panelTitle}\n </h2>\n <IconButton\n size=\"sm\"\n icon={Pin}\n label={pinLabel}\n aria-pressed={pinned}\n onClick={() => setPinned(!pinned)}\n />\n <IconButton size=\"sm\" icon={X} label={closeLabel} onClick={close} />\n </div>\n <div className={s.panelBody()}>{panel}</div>\n </aside>\n )}\n {!docked && (\n <Drawer side=\"bottom\" open={open} onOpenChange={(next) => setOpen(next)}>\n <DrawerContent size=\"md\" closeLabel={closeLabel} id={panelId}>\n <DrawerHeader>\n <DrawerTitle>{panelTitle}</DrawerTitle>\n </DrawerHeader>\n <DrawerBody className={s.drawerBody()}>{panel}</DrawerBody>\n </DrawerContent>\n </Drawer>\n )}\n </div>\n </InspectorContext.Provider>\n );\n}\n\nexport interface InspectorToggleProps extends Omit<IconButtonProps, 'icon' | 'label' | 'onClick'> {\n label?: string;\n icon?: IconButtonProps['icon'];\n}\n\n/** Opens / closes the inspector panel (aria-expanded, aria-controls). Place it in the main area. */\nexport function InspectorToggle({ label: labelProp, icon = PanelRight, className, ...props }: InspectorToggleProps) {\n const { t } = useI18n();\n const label = labelProp ?? t('inspector.toggle');\n const { open, pinned, docked, panelId, setOpen } = useInspectorLayout();\n return (\n <IconButton\n icon={icon}\n label={label}\n aria-expanded={open}\n aria-controls={open ? panelId : undefined}\n data-inspector-toggle=\"\"\n className={className}\n onClick={() => {\n const next = !open;\n setOpen(next);\n // An overlaying panel takes focus so Escape and Tab work from inside it.\n if (next && docked && !pinned) requestAnimationFrame(() => document.getElementById(panelId)?.focus());\n }}\n {...props}\n />\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'InspectorLayout',\n group: 'Layout',\n status: 'beta',\n description:\n 'Main area with a pinnable right panel (properties, details, comments). Pinned, the panel docks beside the content; unpinned, it overlays it (flat shadow) and Escape closes it. Open and pinned states are controllable; an InspectorToggle placed in the main area opens and closes it. Below lg the panel opens as a bottom Drawer. Fills its container.',\n primitive: '@base-ui/react/drawer (small screens)',\n pattern: 'disclosure (toggle → complementary panel) + toggle button (pin)',\n keyboard: [\n [\n 'Enter / Space',\n 'On the panel toggle: opens or closes the panel (aria-expanded); an overlaying panel takes focus',\n ],\n ['Enter / Space', 'On Pin panel: docks or un-docks the panel (aria-pressed)'],\n ['Escape', 'Closes the unpinned panel and returns focus to the toggle'],\n ['Escape', 'Small screens: closes the bottom drawer'],\n ],\n tokens: ['background', 'card', 'border', 'foreground', 'muted-foreground', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const pageVariants = tv({\n slots: {\n root: 'flex min-h-full w-full min-w-0 flex-col',\n inner: 'mx-auto flex w-full flex-1 flex-col gap-6 px-4 py-6 sm:px-6 lg:px-[26px]',\n header: 'flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between',\n titles: 'min-w-0',\n title: 'text-2xl font-bold tracking-tight text-foreground',\n description: 'mt-1 text-[13px] text-muted-foreground',\n actions: 'flex shrink-0 flex-wrap items-center gap-2.5',\n body: 'flex min-w-0 flex-1 flex-col gap-6',\n actionBar: 'sticky bottom-0 z-10 shrink-0 border-t border-border bg-card',\n actionBarInner: 'mx-auto flex w-full flex-wrap items-center justify-end gap-2.5 px-4 py-3 sm:px-6 lg:px-[26px]',\n },\n variants: {\n width: {\n narrow: { inner: 'max-w-[640px]', actionBarInner: 'max-w-[640px]' },\n default: { inner: 'max-w-[1120px]', actionBarInner: 'max-w-[1120px]' },\n wide: { inner: 'max-w-[1440px]', actionBarInner: 'max-w-[1440px]' },\n full: {},\n },\n },\n defaultVariants: { width: 'default' },\n});\n\nexport type PageVariantProps = VariantProps<typeof pageVariants>;\n","import type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { pageVariants, type PageVariantProps } from './page.variants';\n\nexport interface PageProps extends Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'title'> {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n /** Max content width: narrow 640 · default 1120 · wide 1440 · full. */\n width?: PageVariantProps['width'];\n /** Custom header (e.g. the blocks PageHeader). Replaces title / description / actions. */\n header?: ReactNode;\n /** Simple header: renders an <h1>. */\n title?: ReactNode;\n description?: ReactNode;\n /** Buttons on the right of the simple header. */\n actions?: ReactNode;\n /** Sticky bar at the bottom of the page (save / cancel, bulk actions). */\n actionBar?: ReactNode;\n /** Accessible name of the action bar region. */\n actionBarLabel?: string;\n children?: ReactNode;\n}\n\n/**\n * A page inside any shell (SidebarLayout, StackedLayout…): header · body · optional sticky action\n * bar, centered at one of four widths. It owns no <main>; the shell does.\n */\nexport function Page({\n width = 'default',\n header,\n title,\n description,\n actions,\n actionBar,\n actionBarLabel: actionBarLabelProp,\n className,\n children,\n ...props\n}: PageProps) {\n const { t } = useI18n();\n const actionBarLabel = actionBarLabelProp ?? t('nav.pageActions');\n const s = pageVariants({ width });\n const simpleHeader = title || description || actions;\n return (\n <div data-width={width} className={cn(s.root(), className)} {...props}>\n <div className={s.inner()}>\n {header ??\n (simpleHeader && (\n <div className={s.header()}>\n <div className={s.titles()}>\n {title && <h1 className={s.title()}>{title}</h1>}\n {description && <p className={s.description()}>{description}</p>}\n </div>\n {actions && <div className={s.actions()}>{actions}</div>}\n </div>\n ))}\n <div className={s.body()}>{children}</div>\n </div>\n {actionBar && (\n <div role=\"region\" aria-label={actionBarLabel} className={s.actionBar()}>\n <div className={s.actionBarInner()}>{actionBar}</div>\n </div>\n )}\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'Page',\n group: 'Layout',\n status: 'beta',\n description:\n 'The page inside any shell: a header (a custom slot such as the blocks PageHeader, or a simple h1 + description + actions), the body, and an optional sticky action bar (a labelled region) pinned to the bottom of the scroll container. Widths: narrow 640 · default 1120 · wide 1440 · full. It renders no <main>; the shell owns it.',\n pattern: 'document structure (h1 + region for the action bar)',\n keyboard: [['Tab', 'Follows the reading order: header actions, body, then the sticky action bar']],\n tokens: ['card', 'border', 'foreground', 'muted-foreground'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const printLayoutVariants = tv({\n slots: {\n root: [\n 'relative overflow-auto bg-secondary/40 px-4 py-8 font-sans text-foreground sm:px-8',\n 'print:h-auto print:min-h-0 print:overflow-visible print:bg-transparent print:p-0',\n ],\n skipLink: 'focus:absolute print:hidden',\n main: 'outline-none',\n sheet: [\n 'mx-auto flex flex-col border border-border bg-card text-card-foreground shadow-sm',\n 'print:m-0 print:w-auto print:min-h-0 print:max-w-none print:border-0 print:shadow-none',\n ],\n header: 'flex items-start justify-between gap-6 border-b border-border pb-6',\n content: 'flex-1 py-8 text-[13px] leading-relaxed',\n footer: 'border-t border-border pt-4 text-[11px] text-muted-foreground',\n pageBreak: ['relative my-10 border-t border-dashed border-border', 'break-after-page print:my-0 print:border-0'],\n pageBreakLabel:\n 'absolute -top-2 left-1/2 -translate-x-1/2 bg-card px-2 font-mono text-[10px] tracking-[0.14em] text-muted-foreground uppercase print:hidden',\n },\n variants: {\n size: {\n a4: { sheet: 'w-[210mm] max-w-full min-h-[297mm]' },\n letter: { sheet: 'w-[8.5in] max-w-full min-h-[11in]' },\n },\n margin: {\n narrow: { sheet: 'p-[12mm] print:p-0' },\n normal: { sheet: 'p-[20mm] print:p-0' },\n wide: { sheet: 'p-[28mm] print:p-0' },\n },\n fullScreen: {\n true: { root: 'h-dvh' },\n false: { root: 'h-full min-h-full' },\n },\n },\n defaultVariants: { size: 'a4', margin: 'normal', fullScreen: false },\n});\n\nexport type PrintLayoutVariantProps = VariantProps<typeof printLayoutVariants>;\n","import type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { SkipLink } from '../../components/VisuallyHidden';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { printLayoutVariants, type PrintLayoutVariantProps } from './print-layout.variants';\n\ntype PageSize = NonNullable<PrintLayoutVariantProps['size']>;\ntype PageMargin = NonNullable<PrintLayoutVariantProps['margin']>;\n\nconst PAGE_SIZE: Record<PageSize, string> = { a4: 'A4', letter: 'letter' };\nconst PAGE_MARGIN: Record<PageMargin, string> = { narrow: '12mm', normal: '20mm', wide: '28mm' };\n\nexport interface PrintLayoutProps extends Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'children'> {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n /** Paper size: A4 (210 × 297 mm) or US Letter (8.5 × 11 in). */\n size?: PageSize;\n /** Page margins (12 · 20 · 28 mm), on screen as padding and in print as the `@page` margin. */\n margin?: PageMargin;\n /** Document header: logo, sender, document number. */\n header?: ReactNode;\n /** Document footer: legal line, page note. */\n footer?: ReactNode;\n /** The document body. Use `PageBreak` between pages. */\n children?: ReactNode;\n /** Emit an `@page` rule with the size and margin (one PrintLayout per printed page set). */\n pageRule?: boolean;\n /** Accessible name of the document. */\n 'aria-label'?: string;\n mainId?: string;\n skipLinkLabel?: string;\n fullScreen?: boolean;\n}\n\n/**\n * Printable document frame (invoice, report, receipt). On screen it is a paper sheet (card surface,\n * border, flat shadow) at A4 or Letter size on a muted backdrop, in the current theme; in print\n * the chrome drops (no backdrop, border, shadow or outer padding) and `@page` sets size and margins.\n * Print with the light theme (ThemeProvider `defaultMode=\"light\"` or `setMode('light')`).\n */\nexport function PrintLayout({\n size = 'a4',\n margin = 'normal',\n header,\n footer,\n children,\n pageRule = true,\n 'aria-label': ariaLabel,\n mainId = 'main',\n skipLinkLabel: skipLinkLabelProp,\n fullScreen = false,\n className,\n ...props\n}: PrintLayoutProps) {\n const { t } = useI18n();\n const skipLinkLabel = skipLinkLabelProp ?? t('skip.document');\n const s = printLayoutVariants({ size, margin, fullScreen });\n return (\n <div className={cn(s.root(), className)} {...props}>\n {pageRule && <style>{`@page { size: ${PAGE_SIZE[size]}; margin: ${PAGE_MARGIN[margin]}; }`}</style>}\n <SkipLink targetId={mainId} className={s.skipLink()}>\n {skipLinkLabel}\n </SkipLink>\n <main id={mainId} tabIndex={-1} className={s.main()}>\n <article aria-label={ariaLabel} className={s.sheet()}>\n {header != null && <header className={s.header()}>{header}</header>}\n <div className={s.content()}>{children}</div>\n {footer != null && <footer className={s.footer()}>{footer}</footer>}\n </article>\n </main>\n </div>\n );\n}\n\nexport interface PageBreakProps extends Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'children'> {\n className?: string;\n /** On-screen marker text (hidden in print). Pass `null` to hide it. */\n label?: ReactNode;\n}\n\n/** Forces a new printed page; on screen it shows as a dashed divider. */\nexport function PageBreak({ className, label: labelProp, ...props }: PageBreakProps) {\n const { t } = useI18n();\n const label = labelProp ?? t('print.pageBreak');\n const s = printLayoutVariants();\n return (\n <div aria-hidden className={cn(s.pageBreak(), className)} {...props}>\n {label != null && <span className={s.pageBreakLabel()}>{label}</span>}\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'PrintLayout',\n group: 'Layout',\n status: 'beta',\n description:\n 'Printable document frame for invoices, reports and receipts: an A4 or Letter page (`size`) with margins (`margin`), header and footer slots and a `PageBreak` helper. On screen it is a paper sheet (bg-card / text-card-foreground, border, shadow-sm) on a muted backdrop in the current theme; `print:` variants drop the chrome (no backdrop, border, shadow or outer padding) and an `@page` rule sets paper size and margins (`pageRule`). The header and footer print once, at the top and end of the document. The consuming app should print with the light theme (ThemeProvider `defaultMode=\"light\"`, or `setMode(\\'light\\')` before `window.print()`); no print-only colours are defined.',\n pattern: 'landmark (main) + labelled article',\n keyboard: [['—', 'None: a static document (the skip link still moves focus to it)']],\n tokens: ['card', 'card-foreground', 'secondary', 'border', 'muted-foreground'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const settingsLayoutVariants = tv({\n slots: {\n root: 'relative flex flex-col overflow-hidden bg-background font-sans text-foreground lg:flex-row',\n skipLink: 'focus:absolute',\n sidebar:\n 'hidden w-60 shrink-0 flex-col gap-4 overflow-y-auto border-e border-border bg-background px-3 py-6 lg:flex',\n sidebarHeading: 'px-2.5 text-[13px] font-semibold tracking-tight text-foreground',\n compactNav: 'shrink-0 border-b border-border px-4 py-3 lg:hidden',\n main: 'flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto outline-none',\n content: 'mx-auto flex w-full flex-1 flex-col gap-8 px-4 py-6 sm:px-8 lg:py-8',\n header: 'flex flex-col gap-1 border-b border-border pb-5',\n title: 'text-[20px] font-semibold tracking-tight text-foreground',\n description: 'text-[13px] leading-relaxed text-muted-foreground',\n saveBar: [\n 'sticky bottom-0 z-10 mt-auto border-t border-border bg-card/95 shadow-sm',\n 'flex items-center justify-end gap-2 px-4 py-3 sm:px-8',\n ],\n },\n variants: {\n width: {\n narrow: { content: 'max-w-2xl' },\n default: { content: 'max-w-3xl' },\n wide: { content: 'max-w-5xl' },\n },\n fullScreen: {\n true: { root: 'h-dvh' },\n false: { root: 'h-full min-h-full' },\n },\n },\n defaultVariants: { width: 'default', fullScreen: false },\n});\n\nexport type SettingsLayoutVariantProps = VariantProps<typeof settingsLayoutVariants>;\n","import { useState, type HTMLAttributes, type ReactNode, type Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { NavList, type NavGroup, type NavItem } from '../../components/NavList';\nimport { navItemKey } from '../../components/NavList/nav-context';\nimport { SimpleSelect } from '../../components/Select';\nimport { SkipLink } from '../../components/VisuallyHidden';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { settingsLayoutVariants, type SettingsLayoutVariantProps } from './settings-layout.variants';\n\n/** Every selectable (leaf) item, depth-first. */\nfunction flattenLeaves(items: NavItem[]): NavItem[] {\n return items.flatMap((item) => (item.items?.length ? flattenLeaves(item.items) : [item]));\n}\n\nfunction markCurrent(items: NavItem[], value: string | undefined): NavItem[] {\n return items.map((item) =>\n item.items?.length\n ? { ...item, items: markCurrent(item.items, value) }\n : { ...item, current: item.current ?? navItemKey(item) === value },\n );\n}\n\nexport interface SettingsLayoutProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'className' | 'title' | 'defaultValue'\n> {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n /** Section navigation (NavList groups). Items are keyed by `id`, then `href`, then `label`. */\n groups: NavGroup[];\n /** Key of the current section (controlled). */\n value?: string;\n /** Initial section (uncontrolled). Defaults to the first item. */\n defaultValue?: string;\n /** Called when a section is chosen from the nav or the small-screen Select. Route here for `href` sections. */\n onValueChange?: (value: string, item: NavItem) => void;\n /** Heading above the section nav and accessible name of the nav. */\n navLabel?: string;\n /** Page title (an `<h1>`). */\n title?: ReactNode;\n description?: ReactNode;\n /** Replaces the default title block. */\n header?: ReactNode;\n /** Form sections of the current page. */\n children?: ReactNode;\n /** Sticky bar at the bottom of the content (Discard · Save changes). 'none' removes its wrapper. */\n saveBar?: ReactNode;\n /** Max width of the content column. */\n width?: SettingsLayoutVariantProps['width'];\n /**\n * Inside an app shell that already owns <main> and the skip link (SidebarLayout, StackedLayout):\n * render the content region as a plain <div> and drop this layout's skip link.\n */\n embedded?: boolean;\n /** Label of the small-screen section Select. */\n selectLabel?: string;\n mainId?: string;\n skipLinkLabel?: string;\n fullScreen?: boolean;\n}\n\n/**\n * Settings shell: section nav (NavList) on the left · content with form sections · sticky save bar.\n * Below `lg` the nav becomes a Select at the top of the page. The current section is\n * controllable (`value` / `onValueChange`).\n */\nexport function SettingsLayout({\n groups,\n value: valueProp,\n defaultValue,\n onValueChange,\n navLabel: navLabelProp,\n title,\n description,\n header,\n children,\n saveBar,\n width,\n selectLabel: selectLabelProp,\n embedded = false,\n mainId = 'main',\n skipLinkLabel: skipLinkLabelProp,\n fullScreen = false,\n className,\n ...props\n}: SettingsLayoutProps) {\n const { t } = useI18n();\n const navLabel = navLabelProp ?? t('common.settings');\n const selectLabel = selectLabelProp ?? t('settings.section');\n const skipLinkLabel = skipLinkLabelProp ?? t('skip.content');\n const MainTag = embedded ? 'div' : 'main';\n const leaves = groups.flatMap((g) => flattenLeaves(g.items));\n const firstKey = leaves[0] ? navItemKey(leaves[0]) : undefined;\n const [inner, setInner] = useState(defaultValue ?? firstKey);\n const value = valueProp ?? inner;\n const s = settingsLayoutVariants({ width, fullScreen });\n\n const select = (key: string, item: NavItem) => {\n if (valueProp === undefined) setInner(key);\n onValueChange?.(key, item);\n };\n const marked = groups.map((g) => ({ ...g, items: markCurrent(g.items, value) }));\n const options = leaves.filter((i) => !i.disabled).map((i) => ({ value: navItemKey(i), label: i.label }));\n\n return (\n <div className={cn(s.root(), className)} {...props}>\n {!embedded && (\n <SkipLink targetId={mainId} className={s.skipLink()}>\n {skipLinkLabel}\n </SkipLink>\n )}\n <div className={s.sidebar()}>\n <p className={s.sidebarHeading()} aria-hidden>\n {navLabel}\n </p>\n <NavList label={navLabel} groups={marked} onNavigate={(item) => select(navItemKey(item), item)} />\n </div>\n <div className={s.compactNav()}>\n <SimpleSelect\n aria-label={selectLabel}\n items={options}\n value={value ?? null}\n onValueChange={(key) => {\n const item = leaves.find((i) => navItemKey(i) === key);\n if (key != null && item) select(key, item);\n }}\n className=\"w-full\"\n />\n </div>\n <MainTag id={mainId} tabIndex={-1} className={s.main()}>\n <div className={s.content()}>\n {header ??\n (title != null && (\n <div className={s.header()}>\n <h1 className={s.title()}>{title}</h1>\n {description != null && <p className={s.description()}>{description}</p>}\n </div>\n ))}\n {children}\n </div>\n {saveBar != null && saveBar !== 'none' && <div className={s.saveBar()}>{saveBar}</div>}\n </MainTag>\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'SettingsLayout',\n group: 'Layout',\n status: 'beta',\n description:\n \"Settings shell: section nav (NavList groups) on the left · a content column with the page title and form sections · a sticky save bar slot (Discard · Save changes). Set saveBar='none' to remove the bar wrapper and its reserved space. Omitted or null slots render no wrapper; empty strings and fragments retain their empty wrapper. The current section is controllable with `value` / `onValueChange`; `href` items navigate as links and still report the change. Below `lg` the nav becomes a Select at the top of the page. Fills its container; `fullScreen` switches to `h-dvh`.\",\n primitive: '@base-ui/react/select (small screens)',\n pattern: 'landmarks (labelled nav, main) + select-only combobox on small screens',\n keyboard: [\n [\n 'Tab',\n \"Skip link, then the section nav items, then interactive content and the save bar; saveBar='none' has no bar focus stops\",\n ],\n ['Enter', 'Opens the focused section (aria-current=\"page\" moves to it)'],\n ['Enter / Space / ↓ on the section Select', 'Small screens: opens the list; arrows move, Enter picks a section'],\n ],\n tokens: ['background', 'foreground', 'card', 'border', 'muted-foreground', 'primary', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const sidebarLayoutVariants = tv({\n slots: {\n root: 'relative flex w-full min-w-0 overflow-hidden bg-background font-sans text-foreground',\n skip: 'focus:absolute',\n sidebar: [\n 'hidden shrink-0 flex-col overflow-hidden border-e border-border/60 bg-chrome lg:flex',\n 'transition-[width] duration-200 motion-reduce:transition-none',\n ],\n sidebarHeader: 'flex shrink-0 items-center px-3 pt-4 pb-3',\n sidebarBody: 'min-h-0 flex-1 overflow-x-hidden overflow-y-auto px-3 pt-1 pb-3',\n sidebarFooter: 'shrink-0 p-2.5',\n column: 'flex min-h-0 min-w-0 flex-1 flex-col',\n topbar: 'flex h-14 shrink-0 items-center gap-2 border-b border-border/60 bg-chrome px-3 lg:gap-3 lg:px-5',\n topbarContent: 'flex min-w-0 flex-1 items-center gap-2 lg:gap-3',\n menuButton: 'lg:hidden',\n collapseButton: 'hidden lg:inline-flex',\n main: 'min-h-0 flex-1 overflow-y-auto focus:outline-none',\n drawer: 'bg-chrome',\n drawerHeader: 'px-3',\n drawerBody: 'flex flex-col gap-3 px-3 py-3',\n },\n variants: {\n fullScreen: { true: { root: 'h-dvh' }, false: { root: 'h-full min-h-0' } },\n state: {\n expanded: { sidebar: 'w-[248px]' },\n rail: { sidebar: 'w-16', sidebarHeader: 'justify-center px-2', sidebarBody: 'px-2', sidebarFooter: 'px-2' },\n offcanvas: { sidebar: 'w-0 border-e-0' },\n },\n },\n defaultVariants: { fullScreen: false, state: 'expanded' },\n});\n\nexport type SidebarLayoutVariantProps = VariantProps<typeof sidebarLayoutVariants>;\n","import { useState } from 'react';\n\nfunction read(storageKey: string | undefined): boolean | undefined {\n if (!storageKey || typeof window === 'undefined') return undefined;\n try {\n const value = window.localStorage.getItem(storageKey);\n return value === null ? undefined : value === 'true';\n } catch {\n return undefined;\n }\n}\n\nfunction write(storageKey: string | undefined, value: boolean) {\n if (!storageKey || typeof window === 'undefined') return;\n try {\n window.localStorage.setItem(storageKey, String(value));\n } catch {}\n}\n\n/** Controlled / uncontrolled boolean whose uncontrolled value survives reloads under `storageKey`. */\nexport function usePersistedCollapse(\n controlled: boolean | undefined,\n defaultValue: boolean,\n storageKey: string | undefined,\n onChange: ((value: boolean) => void) | undefined,\n) {\n const [state, setState] = useState(() => read(storageKey) ?? defaultValue);\n const value = controlled ?? state;\n const set = (next: boolean) => {\n setState(next);\n write(storageKey, next);\n onChange?.(next);\n };\n return [value, set] as const;\n}\n","import { Menu as MenuIcon, PanelLeftClose, PanelLeftOpen } from 'lucide-react';\nimport { createContext, useContext, useId, useState, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { IconButton } from '../../components/Button';\nimport { Drawer, DrawerBody, DrawerContent, DrawerHeader, DrawerTitle, DrawerTrigger } from '../../components/Drawer';\nimport { SkipLink } from '../../components/VisuallyHidden';\nimport { sidebarLayoutVariants } from './sidebar-layout.variants';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { usePersistedCollapse } from './use-persisted-collapse';\n\n/** State handed to sidebar slots, so they can adapt (icon rail) or close the mobile drawer. */\nexport interface SidebarSlotState {\n /** The desktop sidebar is collapsed (icon rail or off-canvas). Always false inside the drawer. */\n collapsed: boolean;\n /** The slot is rendered inside the small-screen drawer. */\n inDrawer: boolean;\n /** Closes the small-screen drawer (no-op on the desktop sidebar). Call it after navigating. */\n closeDrawer: () => void;\n}\n\n/** A sidebar slot: plain content, or a function of the sidebar state. */\nexport type SidebarSlot = ReactNode | ((state: SidebarSlotState) => ReactNode);\n\nexport interface SidebarLayoutContextValue {\n collapsed: boolean;\n setCollapsed: (collapsed: boolean) => void;\n toggleCollapsed: () => void;\n drawerOpen: boolean;\n setDrawerOpen: (open: boolean) => void;\n}\n\nconst SidebarLayoutContext = createContext<SidebarLayoutContextValue | null>(null);\n\n/** Sidebar state for anything rendered inside a SidebarLayout (e.g. a custom collapse button). */\nexport function useSidebarLayout(): SidebarLayoutContextValue {\n const ctx = useContext(SidebarLayoutContext);\n if (!ctx) throw new Error('useSidebarLayout must be used inside <SidebarLayout>.');\n return ctx;\n}\n\nexport interface SidebarLayoutProps {\n className?: string;\n /** Sidebar body, usually a NavList (pass a function to get `collapsed` for the icon rail). */\n sidebar: SidebarSlot;\n /** Top of the sidebar: logo or workspace switcher. */\n sidebarHeader?: SidebarSlot;\n /** Bottom of the sidebar: usage, help, user. */\n sidebarFooter?: SidebarSlot;\n /** Topbar content after the menu / collapse buttons: breadcrumb, ⌘K, notifications, theme, user menu. */\n topbar?: ReactNode;\n /** Main content. */\n children?: ReactNode;\n /** What \"collapsed\" means on large screens: a 64px icon rail or a fully hidden sidebar. */\n collapseMode?: 'rail' | 'offcanvas';\n /** Shows the collapse toggle in the topbar (large screens). */\n collapsible?: boolean;\n collapsed?: boolean;\n defaultCollapsed?: boolean;\n onCollapsedChange?: (collapsed: boolean) => void;\n /** Persists the uncontrolled collapsed state in localStorage under this key. */\n storageKey?: string;\n /** Small-screen drawer state. */\n drawerOpen?: boolean;\n onDrawerOpenChange?: (open: boolean) => void;\n /** Accessible name of the sidebar landmark and of the small-screen drawer. */\n sidebarLabel?: string;\n /** `id` of <main>, target of the skip link. */\n mainId?: string;\n skipLinkLabel?: string;\n menuLabel?: string;\n collapseLabel?: string;\n expandLabel?: string;\n /** Fill the viewport (h-dvh) instead of the container. */\n fullScreen?: boolean;\n}\n\nfunction renderSlot(slot: SidebarSlot, state: SidebarSlotState) {\n return typeof slot === 'function' ? slot(state) : slot;\n}\n\n/**\n * Application shell: collapsible sidebar (expanded, icon rail or off-canvas) · topbar · main.\n * Below `lg` the sidebar moves into a left Drawer opened from the topbar menu button.\n * Fills its container (`fullScreen` for h-dvh) and never uses fixed positioning.\n */\nexport function SidebarLayout({\n className,\n sidebar,\n sidebarHeader,\n sidebarFooter,\n topbar,\n children,\n collapseMode = 'rail',\n collapsible = true,\n collapsed: collapsedProp,\n defaultCollapsed = false,\n onCollapsedChange,\n storageKey,\n drawerOpen: drawerOpenProp,\n onDrawerOpenChange,\n sidebarLabel: sidebarLabelProp,\n mainId = 'main',\n skipLinkLabel: skipLinkLabelProp,\n menuLabel: menuLabelProp,\n collapseLabel: collapseLabelProp,\n expandLabel: expandLabelProp,\n fullScreen = false,\n}: SidebarLayoutProps) {\n const { t } = useI18n();\n const sidebarLabel = sidebarLabelProp ?? t('nav.sidebar');\n const skipLinkLabel = skipLinkLabelProp ?? t('skip.main');\n const menuLabel = menuLabelProp ?? t('nav.openNavigation');\n const collapseLabel = collapseLabelProp ?? t('nav.collapseSidebar');\n const expandLabel = expandLabelProp ?? t('nav.expandSidebar');\n const sidebarId = useId();\n const [collapsed, setCollapsed] = usePersistedCollapse(\n collapsedProp,\n defaultCollapsed,\n storageKey,\n onCollapsedChange,\n );\n const [drawerState, setDrawerState] = useState(false);\n const drawerOpen = drawerOpenProp ?? drawerState;\n const setDrawerOpen = (open: boolean) => {\n setDrawerState(open);\n onDrawerOpenChange?.(open);\n };\n const isCollapsed = collapsible && collapsed;\n const state = isCollapsed ? collapseMode : 'expanded';\n const s = sidebarLayoutVariants({ fullScreen, state });\n const desktop: SidebarSlotState = { collapsed: isCollapsed, inDrawer: false, closeDrawer: () => {} };\n const mobile: SidebarSlotState = { collapsed: false, inDrawer: true, closeDrawer: () => setDrawerOpen(false) };\n const ctx: SidebarLayoutContextValue = {\n collapsed: isCollapsed,\n setCollapsed,\n toggleCollapsed: () => setCollapsed(!collapsed),\n drawerOpen,\n setDrawerOpen,\n };\n const hidden = state === 'offcanvas';\n\n return (\n <SidebarLayoutContext.Provider value={ctx}>\n <div className={cn(s.root(), className)} data-sidebar-state={state}>\n <SkipLink targetId={mainId} className={s.skip()}>\n {skipLinkLabel}\n </SkipLink>\n <aside\n id={sidebarId}\n aria-label={sidebarLabel}\n data-state={state}\n inert={hidden || undefined}\n className={s.sidebar()}\n >\n {sidebarHeader && <div className={s.sidebarHeader()}>{renderSlot(sidebarHeader, desktop)}</div>}\n <div className={s.sidebarBody()}>{renderSlot(sidebar, desktop)}</div>\n {sidebarFooter && <div className={s.sidebarFooter()}>{renderSlot(sidebarFooter, desktop)}</div>}\n </aside>\n <div className={s.column()}>\n <header className={s.topbar()}>\n <Drawer side=\"left\" open={drawerOpen} onOpenChange={(open) => setDrawerOpen(open)}>\n <DrawerTrigger render={<IconButton icon={MenuIcon} label={menuLabel} className={s.menuButton()} />} />\n <DrawerContent size=\"sm\" className={s.drawer()} closeLabel={t('nav.closeNavigation')}>\n <DrawerHeader className={s.drawerHeader()}>\n <DrawerTitle className={sidebarHeader ? 'sr-only' : undefined}>{sidebarLabel}</DrawerTitle>\n {sidebarHeader && renderSlot(sidebarHeader, mobile)}\n </DrawerHeader>\n <DrawerBody className={s.drawerBody()}>\n {renderSlot(sidebar, mobile)}\n {sidebarFooter && renderSlot(sidebarFooter, mobile)}\n </DrawerBody>\n </DrawerContent>\n </Drawer>\n {collapsible && (\n <IconButton\n icon={isCollapsed ? PanelLeftOpen : PanelLeftClose}\n label={isCollapsed ? expandLabel : collapseLabel}\n aria-expanded={!isCollapsed}\n aria-controls={sidebarId}\n className={s.collapseButton()}\n onClick={() => setCollapsed(!collapsed)}\n />\n )}\n <div className={s.topbarContent()}>{topbar}</div>\n </header>\n <main id={mainId} tabIndex={-1} className={s.main()}>\n {children}\n </main>\n </div>\n </div>\n </SidebarLayoutContext.Provider>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'SidebarLayout',\n group: 'Layout',\n status: 'beta',\n description:\n 'Application shell: a collapsible sidebar (expanded, 64px icon rail or off-canvas) with header, body and footer slots, a topbar (workspace switcher, breadcrumb, ⌘K, notifications, theme, user menu) and the main region. Below lg the sidebar moves into a left Drawer opened from the topbar menu button. The collapsed state is controllable and can persist in localStorage (storageKey). Fills its container; fullScreen switches to h-dvh.',\n primitive: '@base-ui/react/drawer',\n pattern: 'landmarks (complementary sidebar, banner topbar, main) + skip link + disclosure toggle',\n keyboard: [\n ['Tab (first stop)', 'Reveals the skip link; Enter moves focus to <main>'],\n ['Enter / Space', 'On the collapse toggle: collapses or expands the sidebar (aria-expanded reflects it)'],\n ['Enter / Space', 'On the menu button (small screens): opens the navigation drawer and moves focus inside'],\n ['Escape', 'Closes the navigation drawer and returns focus to the menu button'],\n ],\n tokens: ['chrome', 'background', 'foreground', 'border', 'card', 'primary', 'muted-foreground', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const splitLayoutVariants = tv({\n slots: {\n root: 'flex w-full min-w-0 overflow-hidden bg-background text-foreground',\n group: 'h-full',\n pane: 'flex h-full min-h-0 min-w-0 flex-col focus:outline-none',\n list: 'bg-card',\n detail: 'bg-background',\n paneHeader: 'flex h-12 shrink-0 items-center gap-2 border-b border-border/60 px-3',\n back: 'lg:hidden',\n paneBody: 'min-h-0 flex-1 overflow-y-auto',\n handle: 'max-lg:hidden',\n },\n variants: {\n fullScreen: { true: { root: 'h-dvh' }, false: { root: 'h-full min-h-0' } },\n showDetail: {\n true: { list: 'max-lg:hidden' },\n false: { detail: 'max-lg:hidden' },\n },\n },\n defaultVariants: { fullScreen: false, showDetail: false },\n});\n\nexport type SplitLayoutVariantProps = VariantProps<typeof splitLayoutVariants>;\n","import { ArrowLeft } from 'lucide-react';\nimport { useId, useRef, useState, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { Button } from '../../components/Button';\nimport { ResizablePanel, ResizablePanelGroup, ResizeHandle } from '../../components/Resizable';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { splitLayoutVariants } from './split-layout.variants';\n\nexport interface SplitLayoutProps {\n className?: string;\n /** The list pane (records, threads, files…). */\n list: ReactNode;\n /** The detail pane for the selected item. */\n detail: ReactNode;\n /** Header of the list pane (title, search, filters). */\n listHeader?: ReactNode;\n /** Header of the detail pane, after the Back button. */\n detailHeader?: ReactNode;\n /** Small screens: which pane is visible. Large screens always show both. */\n showDetail?: boolean;\n defaultShowDetail?: boolean;\n onShowDetailChange?: (showDetail: boolean) => void;\n /** Accessible names of the two regions. */\n listLabel?: string;\n detailLabel?: string;\n backLabel?: string;\n /** List pane size in % of the width (large screens). */\n defaultListSize?: number;\n minListSize?: number;\n maxListSize?: number;\n /** Remembers the pane sizes in localStorage. */\n autoSaveId?: string;\n fullScreen?: boolean;\n}\n\n/**\n * Master–detail layout: a resizable list pane beside a detail pane (ResizablePanelGroup). Below lg\n * only one pane shows: the list, or the detail with a Back button (`showDetail`, controllable).\n */\nexport function SplitLayout({\n className,\n list,\n detail,\n listHeader,\n detailHeader,\n showDetail: showDetailProp,\n defaultShowDetail = false,\n onShowDetailChange,\n listLabel: listLabelProp,\n detailLabel: detailLabelProp,\n backLabel: backLabelProp,\n defaultListSize = 35,\n minListSize = 20,\n maxListSize = 60,\n autoSaveId,\n fullScreen = false,\n}: SplitLayoutProps) {\n const { t } = useI18n();\n const listLabel = listLabelProp ?? t('split.list');\n const detailLabel = detailLabelProp ?? t('split.details');\n const backLabel = backLabelProp ?? t('common.back');\n const id = useId();\n const listRef = useRef<HTMLElement>(null);\n const [showDetailState, setShowDetailState] = useState(defaultShowDetail);\n const showDetail = showDetailProp ?? showDetailState;\n const s = splitLayoutVariants({ fullScreen, showDetail });\n\n function back() {\n setShowDetailState(false);\n onShowDetailChange?.(false);\n // The list pane becomes visible again: take focus there so keyboard users don't land on <body>.\n requestAnimationFrame(() => listRef.current?.focus());\n }\n\n return (\n <div className={cn(s.root(), className)} data-show-detail={showDetail || undefined}>\n <ResizablePanelGroup className={s.group()} autoSaveId={autoSaveId}>\n <ResizablePanel\n id={`${id}-list`}\n defaultSize={defaultListSize}\n minSize={minListSize}\n maxSize={maxListSize}\n className={s.list()}\n >\n <section ref={listRef} tabIndex={-1} aria-label={listLabel} className={s.pane()}>\n {listHeader && <div className={s.paneHeader()}>{listHeader}</div>}\n <div className={s.paneBody()}>{list}</div>\n </section>\n </ResizablePanel>\n <ResizeHandle aria-label={`Resize ${listLabel.toLowerCase()}`} className={s.handle()} />\n <ResizablePanel id={`${id}-detail`} className={s.detail()}>\n <section aria-label={detailLabel} className={s.pane()}>\n <div className={cn(s.paneHeader(), !detailHeader && 'lg:hidden')}>\n <Button variant=\"ghost\" size=\"sm\" icon={ArrowLeft} className={s.back()} onClick={back}>\n {backLabel}\n </Button>\n {detailHeader}\n </div>\n <div className={s.paneBody()}>{detail}</div>\n </section>\n </ResizablePanel>\n </ResizablePanelGroup>\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'SplitLayout',\n group: 'Layout',\n status: 'beta',\n description:\n 'Master–detail layout: a resizable list pane beside a detail pane, built on ResizablePanelGroup (sizes can persist with autoSaveId). Below lg only one pane shows: the list, or the detail with a Back button; `showDetail` is controllable so selecting an item can switch panes. Both panes are labelled regions. Fills its container.',\n primitive: 'Resizable (role=\"separator\")',\n pattern: 'window splitter + two labelled regions',\n keyboard: [\n ['Arrow Left / Right', 'On the resize handle: shrinks / grows the list pane (from Resizable)'],\n ['Home / End', 'On the resize handle: list pane to its minimum / maximum size'],\n ['Enter / Space', 'On Back (small screens): returns to the list and moves focus to it'],\n ],\n tokens: ['background', 'card', 'border', 'accent', 'muted-foreground', 'primary', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const stackedLayoutVariants = tv({\n slots: {\n root: 'relative flex w-full min-w-0 flex-col overflow-y-auto bg-background font-sans text-foreground',\n skip: 'focus:absolute',\n header: 'sticky top-0 z-20 shrink-0 border-b border-border/60 bg-chrome',\n bar: 'mx-auto flex h-[60px] w-full items-center gap-1 px-3 sm:px-4',\n brand: 'flex shrink-0 items-center px-1 lg:px-2',\n divider: 'mx-2 hidden h-6 w-px shrink-0 bg-border/70 lg:block',\n nav: 'hidden min-w-0 items-center gap-0.5 overflow-hidden lg:flex',\n navSlot: 'hidden min-w-0 items-center lg:flex',\n link: [\n 'inline-flex h-9 shrink-0 items-center gap-2 rounded-lg px-3 text-[13px] font-medium text-muted-foreground transition-colors',\n 'hover:bg-accent/45 hover:text-foreground motion-reduce:transition-none',\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring',\n 'aria-[current=page]:bg-accent aria-[current=page]:font-semibold aria-[current=page]:text-accent-foreground',\n ],\n actions: 'ms-auto flex shrink-0 items-center gap-2',\n mobile: 'lg:hidden',\n subnav: 'mx-auto w-full px-3 sm:px-4',\n pageHeader: 'shrink-0 border-b border-border/60 bg-card',\n pageHeaderInner: 'mx-auto w-full px-4 py-5 sm:px-6 lg:px-8',\n main: 'mx-auto w-full flex-1 px-4 py-6 focus:outline-none sm:px-6 lg:px-8',\n footer: 'shrink-0 border-t border-border/60',\n footerInner: 'mx-auto w-full px-4 py-4 text-[12px] text-muted-foreground sm:px-6 lg:px-8',\n },\n variants: {\n fullScreen: { true: { root: 'h-dvh' }, false: { root: 'h-full min-h-0' } },\n width: {\n narrow: { main: 'max-w-[640px]', pageHeaderInner: 'max-w-[640px]', footerInner: 'max-w-[640px]' },\n default: { main: 'max-w-[1120px]', pageHeaderInner: 'max-w-[1120px]', footerInner: 'max-w-[1120px]' },\n wide: { main: 'max-w-[1440px]', pageHeaderInner: 'max-w-[1440px]', footerInner: 'max-w-[1440px]' },\n full: {},\n },\n },\n defaultVariants: { fullScreen: false, width: 'default' },\n});\n\nexport type StackedLayoutVariantProps = VariantProps<typeof stackedLayoutVariants>;\n","import { createElement, type MouseEvent, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { useLinkComponent } from '../../components/Link';\nimport { MobileNav } from '../../components/MobileNav';\nimport { isNavItemCurrent, type NavItem } from '../../components/NavList';\nimport { SkipLink } from '../../components/VisuallyHidden';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { stackedLayoutVariants, type StackedLayoutVariantProps } from './stacked-layout.variants';\n\nexport interface StackedLayoutProps {\n className?: string;\n /** Logo or product name at the start of the navbar. */\n brand?: ReactNode;\n /** Primary links: a horizontal nav on large screens, a MobileNav drawer below lg. */\n links?: NavItem[];\n /** The current location; the link with this `href` gets aria-current=\"page\". */\n currentHref?: string;\n /** Called when a link is activated (desktop or drawer). */\n onNavigate?: (item: NavItem) => void;\n /**\n * Custom primary navigation for the navbar on large screens (e.g. a MegaMenu). Replaces the\n * desktop `links` row; `links` still feed the MobileNav drawer below lg (see `megaMenuNavItems`).\n */\n nav?: ReactNode;\n /** Right side of the navbar: ⌘K, notifications, user menu… */\n actions?: ReactNode;\n /** Optional second row under the navbar, e.g. a Tabs sub-nav. */\n subnav?: ReactNode;\n /** Band above the content (pair with the blocks PageHeader). */\n pageHeader?: ReactNode;\n children?: ReactNode;\n footer?: ReactNode;\n /** Max width of the centered content: narrow 640 · default 1120 · wide 1440 · full. */\n width?: StackedLayoutVariantProps['width'];\n /** Accessible name of the primary nav landmark (and of the mobile drawer). */\n navLabel?: string;\n /** Title of the mobile drawer. */\n mobileTitle?: ReactNode;\n /** Footer of the mobile drawer (e.g. a UserMenu). */\n mobileFooter?: ReactNode;\n mainId?: string;\n skipLinkLabel?: string;\n fullScreen?: boolean;\n}\n\nfunction DesktopLink({\n item,\n current,\n className,\n onNavigate,\n}: {\n item: NavItem;\n current: boolean;\n className: string;\n onNavigate?: (item: NavItem) => void;\n}) {\n const RouterLink = useLinkComponent();\n const IconCmp = item.icon;\n const props = {\n className,\n href: item.href,\n 'aria-current': current ? ('page' as const) : undefined,\n onClick: (event: MouseEvent<HTMLElement>) => {\n item.onClick?.(event);\n onNavigate?.(item);\n },\n };\n const content = (\n <>\n {IconCmp && <IconCmp size={16} aria-hidden />}\n {item.label}\n </>\n );\n if (!item.href)\n return (\n <button type=\"button\" {...props} disabled={item.disabled}>\n {content}\n </button>\n );\n return createElement(RouterLink ?? 'a', props, content);\n}\n\n/**\n * Top-navigation shell: navbar (brand · links or a custom `nav` · actions) · optional tab sub-nav · optional page\n * header band · centered content · footer. Below lg the links collapse into a MobileNav drawer.\n */\nexport function StackedLayout({\n className,\n brand,\n links = [],\n currentHref,\n onNavigate,\n nav,\n actions,\n subnav,\n pageHeader,\n children,\n footer,\n width = 'default',\n navLabel: navLabelProp,\n mobileTitle,\n mobileFooter,\n mainId = 'main',\n skipLinkLabel: skipLinkLabelProp,\n fullScreen = false,\n}: StackedLayoutProps) {\n const { t } = useI18n();\n const navLabel = navLabelProp ?? t('common.main');\n const skipLinkLabel = skipLinkLabelProp ?? t('skip.main');\n const s = stackedLayoutVariants({ fullScreen, width });\n return (\n <div className={cn(s.root(), className)}>\n <SkipLink targetId={mainId} className={s.skip()}>\n {skipLinkLabel}\n </SkipLink>\n <header className={s.header()}>\n <div className={s.bar()}>\n {links.length > 0 && (\n <MobileNav\n className={s.mobile()}\n groups={[{ items: links }]}\n currentHref={currentHref}\n title={mobileTitle}\n label={navLabel}\n footer={mobileFooter}\n onNavigate={onNavigate}\n />\n )}\n {brand && <div className={s.brand()}>{brand}</div>}\n {nav != null ? (\n <>\n <div aria-hidden className={s.divider()} />\n <div className={s.navSlot()}>{nav}</div>\n </>\n ) : (\n links.length > 0 && (\n <>\n <div aria-hidden className={s.divider()} />\n <nav aria-label={navLabel} className={s.nav()}>\n {links.map((item) => (\n <DesktopLink\n key={item.id ?? item.href ?? item.label}\n item={item}\n current={isNavItemCurrent(item, currentHref)}\n className={s.link()}\n onNavigate={onNavigate}\n />\n ))}\n </nav>\n </>\n )\n )}\n {actions && <div className={s.actions()}>{actions}</div>}\n </div>\n {subnav && <div className={s.subnav()}>{subnav}</div>}\n </header>\n {pageHeader && (\n <div className={s.pageHeader()}>\n <div className={s.pageHeaderInner()}>{pageHeader}</div>\n </div>\n )}\n <main id={mainId} tabIndex={-1} className={s.main()}>\n {children}\n </main>\n {footer && (\n <footer className={s.footer()}>\n <div className={s.footerInner()}>{footer}</div>\n </footer>\n )}\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'StackedLayout',\n group: 'Layout',\n status: 'beta',\n description:\n 'Top-navigation shell: a chrome navbar (brand · primary links or a custom `nav` slot such as a MegaMenu · actions), an optional tab sub-nav row, an optional page-header band and centered content (narrow 640 · default 1120 · wide 1440 · full) with an optional footer. Below lg the links collapse into a MobileNav drawer. Fills its container; fullScreen switches to h-dvh.',\n primitive: '@base-ui/react/drawer',\n pattern: 'landmarks (banner, navigation, main, contentinfo) + skip link',\n keyboard: [\n ['Tab (first stop)', 'Reveals the skip link; Enter moves focus to <main>'],\n ['Tab', 'Moves through the navbar links (the current one has aria-current=\"page\") and actions'],\n ['Enter (nav slot)', \"In the `nav` slot: follows the slot component's own contract (e.g. MegaMenu opens a panel)\"],\n ['Enter / Space', 'On the menu button (small screens): opens the navigation drawer'],\n ['Escape', 'Closes the navigation drawer and returns focus to the menu button'],\n ],\n tokens: ['chrome', 'background', 'card', 'accent', 'accent-foreground', 'border', 'muted-foreground', 'focus-ring'],\n};\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const statusLayoutVariants = tv({\n slots: {\n root: 'relative flex flex-col overflow-hidden bg-background font-sans text-foreground',\n skipLink: 'focus:absolute',\n header: 'flex h-14 shrink-0 items-center gap-3 px-5 sm:px-8',\n main: 'flex min-h-0 flex-1 flex-col items-center justify-center overflow-y-auto px-6 py-10 text-center outline-none',\n content: 'flex w-full max-w-md flex-col items-center',\n illustration: 'mb-6 flex justify-center text-muted-foreground',\n iconHalo: 'grid size-14 place-items-center rounded-full bg-secondary text-muted-foreground ring-1 ring-border',\n code: 'font-mono text-[12px] font-semibold tracking-[0.2em] uppercase',\n title: 'mt-3 text-[24px] font-semibold tracking-[-0.02em] text-balance text-foreground',\n heading: 'mt-3 w-full text-foreground',\n description: 'mt-2 text-[14px] leading-relaxed text-pretty text-muted-foreground',\n actions: 'mt-7 flex flex-wrap items-center justify-center gap-2.5',\n extra: 'mt-6 w-full',\n footer:\n 'flex shrink-0 flex-wrap items-center justify-center gap-x-4 gap-y-1 px-5 py-4 text-[12.5px] text-muted-foreground',\n },\n variants: {\n tone: {\n neutral: { code: 'text-muted-foreground' },\n primary: { code: 'text-primary-text', iconHalo: 'bg-primary/14 text-primary-chip-text ring-primary/30' },\n warning: { code: 'text-warning-text', iconHalo: 'bg-warning/14 text-warning-chip-text ring-warning/30' },\n destructive: {\n code: 'text-destructive-text',\n iconHalo: 'bg-destructive/14 text-destructive-chip-text ring-destructive/30',\n },\n },\n fullScreen: {\n true: { root: 'h-dvh' },\n false: { root: 'h-full min-h-full' },\n },\n },\n defaultVariants: { tone: 'neutral', fullScreen: false },\n});\n\nexport type StatusLayoutVariantProps = VariantProps<typeof statusLayoutVariants>;\n","import type { LucideIcon } from 'lucide-react';\nimport type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport { SkipLink } from '../../components/VisuallyHidden';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { statusLayoutVariants, type StatusLayoutVariantProps } from './status-layout.variants';\n\ninterface StatusLayoutBaseProps extends Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'title' | 'children'> {\n className?: string;\n ref?: Ref<HTMLDivElement>;\n /** Built-in h1 focus target. Adds tabIndex=-1 only when supplied; use the slot's own ref for a custom heading. */\n titleRef?: Ref<HTMLHeadingElement>;\n /** Short status above the title: \"404\", \"403 · Forbidden\", \"Maintenance\". */\n code?: ReactNode;\n description?: ReactNode;\n /** Neutral icon in a halo, when there is no illustration. */\n icon?: LucideIcon;\n /** Custom illustration (SVG, image). Decorative unless it carries its own alt text. */\n illustration?: ReactNode;\n /** The way forward (a primary Button). Comes first in tab order. */\n primaryAction?: ReactNode;\n /** Alternative (go back, contact support). */\n secondaryAction?: ReactNode;\n /** Extra content below the actions (search, request id, status list). */\n children?: ReactNode;\n /** Minimal top bar (usually just the Logo). */\n header?: ReactNode;\n /** Bottom line (status page, support, request id). */\n footer?: ReactNode;\n /** Colour of the code and icon halo. Brand green is for positive states only (e.g. \"Back online\"). */\n tone?: StatusLayoutVariantProps['tone'];\n mainId?: string;\n skipLinkLabel?: string;\n fullScreen?: boolean;\n}\n\nexport type StatusLayoutProps = StatusLayoutBaseProps &\n (\n | { /** The message, rendered as the page h1 when the slot is empty. */ title: ReactNode; heading?: null }\n | { /** Replaces the built-in title; supply exactly one h1. */ heading: NonNullable<ReactNode>; title?: never }\n );\n\n/**\n * Full-page status (404 · 403 · 500 · maintenance): a centred message with an illustration or\n * icon, a primary and a secondary action, and minimal chrome. The primary action comes first in\n * the DOM and in tab order.\n */\nexport function StatusLayout({\n code,\n title,\n heading,\n titleRef,\n description,\n icon: Icon,\n illustration,\n primaryAction,\n secondaryAction,\n children,\n header,\n footer,\n tone,\n mainId = 'main',\n skipLinkLabel: skipLinkLabelProp,\n fullScreen = false,\n className,\n ...props\n}: StatusLayoutProps) {\n const { t } = useI18n();\n const skipLinkLabel = skipLinkLabelProp ?? t('skip.content');\n const s = statusLayoutVariants({ tone, fullScreen });\n return (\n <div className={cn(s.root(), className)} {...props}>\n <SkipLink targetId={mainId} className={s.skipLink()}>\n {skipLinkLabel}\n </SkipLink>\n {header != null && <header className={s.header()}>{header}</header>}\n <main id={mainId} tabIndex={-1} className={s.main()}>\n <div className={s.content()}>\n {illustration != null ? (\n <div className={s.illustration()}>{illustration}</div>\n ) : (\n Icon && (\n <div className={s.illustration()}>\n <span className={s.iconHalo()}>\n <Icon size={26} aria-hidden />\n </span>\n </div>\n )\n )}\n {code != null && <p className={s.code()}>{code}</p>}\n {heading != null ? (\n <div className={s.heading()}>{heading}</div>\n ) : (\n <h1 ref={titleRef} tabIndex={titleRef != null ? -1 : undefined} className={s.title()}>\n {title}\n </h1>\n )}\n {description != null && <p className={s.description()}>{description}</p>}\n {(primaryAction != null || secondaryAction != null) && (\n <div className={s.actions()}>\n {primaryAction}\n {secondaryAction}\n </div>\n )}\n {children != null && <div className={s.extra()}>{children}</div>}\n </div>\n </main>\n {footer != null && <footer className={s.footer()}>{footer}</footer>}\n </div>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'StatusLayout',\n group: 'Layout',\n status: 'beta',\n description:\n 'Full-page status for 404, 403, 500 and maintenance: a centred message with a `heading` slot replacing `title` for exactly one page h1; `titleRef` on the built-in h1 enables focus() with tabIndex=-1 outside the Tab order. With no heading, `title` remains required and renders as today. Supply either title or a non-empty heading, never both; the slot must contain exactly one h1. The slot is full width within the centred column and uses the foreground token. For a PageHeader slot, set as=\"div\", breadcrumbs={null}, meta={[]}, tabs={null}, actions={[]}, status=\"\" and description={null} to disable demo fixtures; keep the description on StatusLayout so it appears once. Pass titleRef to PageHeader (or a ref and tabIndex=-1 to a generic h1) and call ref.current.focus() on route load when needed. Keep slot links and actions empty so the primary action stays first in main’s Tab order. Code stays above the heading, with description, illustration or icon halo, primary and secondary actions, optional Logo header and footer unchanged. `tone` colours the code and halo with severity tokens; brand green is only for positive states. Fills its container; `fullScreen` switches to `h-dvh`.',\n pattern: 'landmarks (header, main, footer) + skip link',\n keyboard: [\n ['Tab', 'Skip link, header links, then the primary action first and the secondary action next, then the footer'],\n [\n 'Programmatic focus',\n 'titleRef.current.focus() focuses the built-in h1; for a heading slot, use the heading node’s own ref (PageHeader titleRef). Neither h1 is a Tab stop',\n ],\n ],\n tokens: [\n 'background',\n 'foreground',\n 'secondary',\n 'border',\n 'muted-foreground',\n 'primary-text',\n 'warning-text',\n 'destructive-text',\n 'focus-ring',\n ],\n};\n","import { useEffect, useRef, useState, type ReactNode } from 'react';\n\n/** Mounted inside the dialog portal so focus runs after its body exists. */\nexport function WizardOverlayBody({\n id,\n current,\n announcement,\n className,\n children,\n}: {\n id: string;\n current: number;\n announcement: string;\n className: string;\n children: ReactNode;\n}) {\n const ref = useRef<HTMLDivElement>(null);\n const [live, setLive] = useState('');\n useEffect(() => {\n const body = ref.current;\n if (!body) return;\n const visible = (element: HTMLElement) => {\n for (let ancestor: HTMLElement | null = element; ancestor; ancestor = ancestor.parentElement) {\n const style = getComputedStyle(ancestor);\n if (ancestor.hidden || ancestor.inert || style.display === 'none' || style.visibility === 'hidden')\n return false;\n if (ancestor === body) break;\n }\n return element.getAttribute('aria-disabled') !== 'true';\n };\n const heading = [...body.querySelectorAll<HTMLElement>('h1, h2, h3, h4, h5, h6, [role=\"heading\"]')].find(visible);\n const control = [\n ...body.querySelectorAll<HTMLElement>(\n 'button:not(:disabled), input:not(:disabled):not([type=\"hidden\"]), select:not(:disabled), textarea:not(:disabled), a[href], [tabindex=\"0\"]',\n ),\n ].find(visible);\n const target = heading ?? control ?? body;\n if (heading && !heading.hasAttribute('tabindex')) heading.tabIndex = -1;\n target.focus();\n // Announce after the focus event, outside the focused element's subtree.\n const frame = requestAnimationFrame(() => setLive(announcement));\n return () => cancelAnimationFrame(frame);\n }, [current, announcement]);\n return (\n <>\n <div id={id} ref={ref} tabIndex={-1} className={className}>\n {children}\n </div>\n {announcement && (\n <div role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" className=\"sr-only\">\n {live}\n </div>\n )}\n </>\n );\n}\n","import { tv, type VariantProps } from '../../utils/tv';\n\nexport const wizardLayoutVariants = tv({\n slots: {\n root: 'relative flex flex-col overflow-hidden bg-background font-sans text-foreground',\n skipLink: 'focus:absolute',\n header: 'shrink-0 border-b border-border bg-background',\n headerRow: 'flex h-12 items-center gap-3 px-4 sm:px-6',\n title: 'min-w-0 flex-1 truncate text-[13.5px] font-semibold tracking-tight',\n steps: 'mx-auto w-full px-4 pt-1 pb-4 sm:px-6',\n stepsFull: 'hidden lg:block',\n stepsCompact: 'lg:hidden',\n main: 'min-h-0 flex-1 overflow-y-auto outline-none',\n body: 'mx-auto w-full px-4 py-8 sm:px-6',\n footer: 'shrink-0 border-t border-border bg-card',\n footerRow: 'mx-auto flex w-full items-center gap-2 px-4 py-3 sm:px-6',\n footerAside: 'me-auto min-w-0 truncate text-[12.5px] text-muted-foreground',\n },\n variants: {\n width: {\n narrow: { steps: 'max-w-2xl', body: 'max-w-2xl', footerRow: 'max-w-2xl' },\n default: { steps: 'max-w-3xl', body: 'max-w-3xl', footerRow: 'max-w-3xl' },\n wide: { steps: 'max-w-5xl', body: 'max-w-5xl', footerRow: 'max-w-5xl' },\n },\n fullScreen: {\n true: { root: 'h-dvh' },\n false: { root: 'h-full min-h-full' },\n },\n },\n defaultVariants: { width: 'default', fullScreen: false },\n});\n\nexport type WizardLayoutVariantProps = VariantProps<typeof wizardLayoutVariants>;\n","import { Check, ChevronLeft, ChevronRight, X } from 'lucide-react';\nimport {\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n type Ref,\n type RefObject,\n} from 'react';\nimport { cn } from '../../utils/cn';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from '../../components/AlertDialog';\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from '../../components/Dialog';\nimport { Button } from '../../components/Button';\nimport { Stepper, type StepItem, type StepperProps } from '../../components/Stepper';\nimport { SkipLink } from '../../components/VisuallyHidden';\nimport { useI18n } from '../../i18n/I18nProvider';\nimport { WizardOverlayBody } from './WizardOverlayBody';\nimport { wizardLayoutVariants, type WizardLayoutVariantProps } from './wizard-layout.variants';\n\nexport interface WizardLayoutProps extends Omit<HTMLAttributes<HTMLDivElement>, 'className' | 'title' | 'children'> {\n /** Page by default; overlay keeps the parent page mounted. */\n mode?: 'page' | 'overlay';\n /** Overlay-only; defaults to fullscreen. Dialog fills the viewport below sm. */\n size?: 'fullscreen' | 'dialog';\n /** Controlled visibility in overlay mode. Closing does not reset current. */\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n description?: ReactNode;\n /** Defaults to the element focused before opening. */\n returnFocusRef?: RefObject<HTMLElement | null>;\n /** Outside presses are ignored by default in overlay mode. */\n closeOnInteractOutside?: boolean;\n cancelLabel?: string;\n stepsSummaryLabel?: string;\n /** Label is the active step label; position is one-based. */\n stepAnnouncement?: (step: { position: number; total: number; label: ReactNode }) => string;\n className?: string;\n ref?: Ref<HTMLDivElement>;\n steps: StepItem[];\n /** Completed steps remain display-only when false. Defaults to true. */\n stepsInteractive?: boolean;\n stepStatusText?: StepperProps['statusText'];\n formatStepCount?: StepperProps['formatCount'];\n /** Zero-based index of the current step. */\n current: number;\n /** Called by Back, Next and by clicking a completed step. */\n onStepChange?: (index: number) => void;\n /** Called by the primary button on the last step. */\n onFinish?: () => void;\n /** Called after the exit is confirmed (or directly when `confirmExit` is false). */\n onExit?: () => void;\n /** Name of the flow, in the top bar (e.g. \"New project\"). */\n title?: ReactNode;\n /** Mark before the title (a Logo). */\n logo?: ReactNode;\n /** The current step's content. */\n children?: ReactNode;\n /** Left side of the footer (e.g. \"Draft saved\"). */\n footerStart?: ReactNode;\n /** Replaces the whole default footer (Back / Next). */\n footer?: ReactNode;\n backLabel?: string;\n /** Locks Back without removing it from the tab order. */\n backDisabled?: boolean;\n nextLabel?: string;\n finishLabel?: string;\n nextDisabled?: boolean;\n nextLoading?: boolean;\n finishPending?: boolean;\n pendingLabel?: string;\n exitLabel?: string;\n /** Ask before leaving (AlertDialog). */\n confirmExit?: boolean;\n exitTitle?: ReactNode;\n exitDescription?: ReactNode;\n exitConfirmLabel?: string;\n exitCancelLabel?: string;\n /** Accessible name of the Stepper. */\n stepsLabel?: string;\n /** Max width of the step column. */\n width?: WizardLayoutVariantProps['width'];\n mainId?: string;\n skipLinkLabel?: string;\n fullScreen?: boolean;\n}\n\n/**\n * Focus-mode shell for multi-step flows: no sidebar · top bar with title and Exit · Stepper ·\n * step body · Back/Next footer. Exit (or Escape anywhere in the layout) asks for confirmation in\n * an AlertDialog. Below `lg` the Stepper collapses to \"Step 2 of 5\".\n */\nexport function WizardLayout({\n mode = 'page',\n size = 'fullscreen',\n open = false,\n onOpenChange,\n description,\n returnFocusRef,\n closeOnInteractOutside = false,\n cancelLabel: cancelLabelProp,\n stepsSummaryLabel: stepsSummaryLabelProp,\n stepAnnouncement,\n steps,\n stepsInteractive = true,\n stepStatusText,\n formatStepCount,\n current,\n onStepChange,\n onFinish,\n onExit,\n title,\n logo,\n children,\n footerStart,\n footer,\n backLabel: backLabelProp,\n backDisabled = false,\n nextLabel: nextLabelProp,\n finishLabel: finishLabelProp,\n nextDisabled = false,\n nextLoading = false,\n finishPending = false,\n pendingLabel: pendingLabelProp,\n exitLabel: exitLabelProp,\n confirmExit = true,\n exitTitle: exitTitleProp,\n exitDescription: exitDescriptionProp,\n exitConfirmLabel: exitConfirmLabelProp,\n exitCancelLabel: exitCancelLabelProp,\n stepsLabel: stepsLabelProp,\n width,\n mainId = 'main',\n skipLinkLabel: skipLinkLabelProp,\n fullScreen = false,\n className,\n onKeyDown,\n ...props\n}: WizardLayoutProps) {\n const { t } = useI18n();\n const id = useId();\n const overlay = mode === 'overlay';\n const bodyId = overlay ? `${id}-step` : mainId;\n const previousFocus = useRef<HTMLElement | null>(null);\n useLayoutEffect(() => {\n if (overlay && open && document.activeElement instanceof HTMLElement)\n previousFocus.current = document.activeElement;\n }, [overlay, open]);\n const activeStep = { position: current + 1, total: steps.length, label: steps[current]?.label ?? '' };\n const announcement =\n stepAnnouncement?.(activeStep) ??\n t('wizard.stepAnnouncement', {\n ...activeStep,\n label: typeof activeStep.label === 'string' ? activeStep.label : '',\n });\n const cancelLabel = cancelLabelProp ?? t('common.cancel');\n const backLabel = backLabelProp ?? t('common.back');\n const nextLabel = nextLabelProp ?? t('common.next');\n const pendingLabel = pendingLabelProp ?? t('wizard.finishing');\n const finishLabel = finishLabelProp ?? t('common.finish');\n const exitLabel = exitLabelProp ?? t('common.exit');\n const exitTitle = exitTitleProp ?? t('wizard.exitTitle');\n const exitDescription = exitDescriptionProp ?? t('wizard.exitDescription');\n const exitConfirmLabel = exitConfirmLabelProp ?? t('wizard.leave');\n const exitCancelLabel = exitCancelLabelProp ?? t('wizard.stay');\n const stepsLabel = stepsLabelProp ?? t('common.progress');\n const stepsSummaryLabel = stepsSummaryLabelProp ?? t('wizard.progressSummary', { label: stepsLabel });\n const skipLinkLabel = skipLinkLabelProp ?? t('skip.step');\n const [exitOpen, setExitOpen] = useState(false);\n const s = wizardLayoutVariants({ width, fullScreen: overlay ? false : fullScreen });\n const last = current >= steps.length - 1;\n\n const exit = () => {\n if (overlay) onOpenChange?.(false);\n onExit?.();\n };\n const requestExit = () => {\n if (confirmExit) setExitOpen(true);\n else exit();\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n // Only keys pressed inside the layout's own DOM: portalled popups (Select, Menu, this dialog) handle their own Escape.\n if (event.key !== 'Escape' || event.defaultPrevented || exitOpen) return;\n if (!(event.target instanceof Node) || !event.currentTarget.contains(event.target)) return;\n event.preventDefault();\n requestExit();\n };\n\n const content = (\n <div className={cn(s.root(), className)} onKeyDown={overlay ? onKeyDown : handleKeyDown} {...props}>\n {!overlay && (\n <SkipLink targetId={bodyId} className={s.skipLink()}>\n {skipLinkLabel}\n </SkipLink>\n )}\n <header className={s.header()}>\n <div className={s.headerRow()}>\n {logo}\n {overlay ? (\n <DialogTitle className={s.title()}>{title}</DialogTitle>\n ) : (\n <div className={s.title()}>{title}</div>\n )}\n <Button variant=\"ghost\" size=\"sm\" icon={X} onClick={requestExit}>\n {exitLabel}\n </Button>\n </div>\n <div className={s.steps()}>\n <Stepper\n className={s.stepsFull()}\n label={stepsLabel}\n steps={steps}\n current={current}\n onStepClick={stepsInteractive ? onStepChange : undefined}\n statusText={stepStatusText}\n formatCount={formatStepCount}\n />\n <Stepper\n className={s.stepsCompact()}\n label={stepsSummaryLabel}\n steps={steps}\n current={current}\n statusText={stepStatusText}\n formatCount={formatStepCount}\n compact\n />\n </div>\n </header>\n {overlay && description && <DialogDescription className=\"sr-only\">{description}</DialogDescription>}\n {overlay ? (\n <WizardOverlayBody id={bodyId} current={current} announcement={announcement} className={s.main()}>\n <div className={s.body()}>{children}</div>\n </WizardOverlayBody>\n ) : (\n <main id={bodyId} tabIndex={-1} className={s.main()}>\n <div className={s.body()}>{children}</div>\n </main>\n )}\n {footer ?? (\n <footer className={s.footer()}>\n <div className={s.footerRow()}>\n <div className={s.footerAside()}>{footerStart}</div>\n <Button\n variant=\"secondary\"\n icon={ChevronLeft}\n disabled={backDisabled || (!overlay && current <= 0)}\n focusableWhenDisabled={backDisabled}\n onClick={() => {\n if (backDisabled) return;\n if (overlay && current === 0) requestExit();\n else onStepChange?.(current - 1);\n }}\n >\n {overlay && current === 0 ? cancelLabel : backLabel}\n </Button>\n <Button\n trailingIcon={last ? Check : ChevronRight}\n disabled={nextDisabled || (overlay && last && finishPending)}\n loading={nextLoading || (overlay && last && finishPending)}\n onClick={() => {\n if (nextDisabled || nextLoading || (overlay && last && finishPending)) return;\n if (last) onFinish?.();\n else onStepChange?.(current + 1);\n }}\n >\n {overlay && last && (finishPending || nextLoading) ? pendingLabel : last ? finishLabel : nextLabel}\n </Button>\n </div>\n </footer>\n )}\n {confirmExit && (\n <AlertDialog open={exitOpen} onOpenChange={setExitOpen}>\n <AlertDialogContent>\n <AlertDialogHeader tone=\"warning\">\n <AlertDialogTitle>{exitTitle}</AlertDialogTitle>\n <AlertDialogDescription>{exitDescription}</AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>{exitCancelLabel}</AlertDialogCancel>\n <AlertDialogAction onClick={exit}>{exitConfirmLabel}</AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n )}\n </div>\n );\n if (!overlay) return content;\n return (\n <Dialog\n open={open}\n disablePointerDismissal={!closeOnInteractOutside}\n onOpenChange={(nextOpen, details) => {\n if (nextOpen) onOpenChange?.(true);\n else {\n details.cancel();\n if (!exitOpen) requestExit();\n }\n }}\n >\n <DialogContent\n aria-modal=\"true\"\n showClose={false}\n size=\"xl\"\n presentation={size === 'fullscreen' ? 'fullscreen' : 'responsive'}\n finalFocus={() => returnFocusRef?.current ?? previousFocus.current ?? true}\n >\n {content}\n </DialogContent>\n </Dialog>\n );\n}\n","import type { ComponentDoc } from '../../doc';\n\nexport const doc: ComponentDoc = {\n name: 'WizardLayout',\n group: 'Layout',\n status: 'beta',\n description:\n 'Focus-mode shell: title and Exit, Stepper, step body, Back / Next and Finish. mode=\"page\" is the unchanged default (container height, or fullScreen for h-dvh). mode=\"overlay\" is a controlled Base UI modal: open/onOpenChange keep the parent page mounted without navigation; size defaults to \"fullscreen\" at every viewport, while \"dialog\" reuses Dialog xl sizing and fills mobile viewports. Use page for a dedicated flow, fullscreen for a focused in-page flow, or the dialog-wizard block (default \"dialog\") for a compact create flow. Closing never resets the consumer-controlled current step or data. Exit, Escape and Cancel on step zero use confirmExit (default true). Outside presses are ignored unless closeOnInteractOutside is true, then use the same exit confirmation. returnFocusRef overrides focus return to the opener. Each step focuses its heading, first control or body, then announces via a separate polite live region. Supply stepAnnouncement({position,total,label}) from your i18n (required for rich step labels); positions are one-based. All action labels, stepsSummaryLabel and pendingLabel are overridable with i18n fallbacks. finishPending or nextLoading disables Finish and shows pendingLabel in overlay mode. stepsInteractive defaults to true; false omits onStepClick so completed steps are display-only. stepStatusText and formatStepCount pass through to both Stepper variants for localized status words and position text. backDisabled locks Back using aria-disabled while keeping it focusable, including on step zero; it cannot activate Cancel. This does not affect Exit. Below lg, Stepper uses its compact summary. An empty stepAnnouncement suppresses the overlay live region so a composition can announce through its nearest LiveAnnouncer instead; heading focus is preserved.',\n primitive: '@base-ui/react/dialog + @base-ui/react/alert-dialog (exit confirmation)',\n pattern: 'page landmarks or modal dialog with labelled step nav + nested alertdialog',\n keyboard: [\n ['Tab', 'Skip link, Exit, completed steps, the step body, then Back and Next'],\n ['Enter / Space on Back / Next', 'Moves to the previous / next step (Finish on the last one)'],\n ['Escape', 'Opens the exit confirmation (keys inside portalled popups are ignored)'],\n ['Enter on Exit', 'Opens the exit confirmation; Leave confirms, Stay or Escape closes it'],\n ['Tab / Enter on the Stepper', 'Moves between completed steps; Enter goes back to one'],\n ['Tab / Shift+Tab in overlay', 'Wraps inside the modal; closing returns focus to returnFocusRef or the opener'],\n [\n 'Next / Back in overlay',\n 'Moves focus to the new step heading or first control, then politely announces the step',\n ],\n ],\n tokens: ['background', 'foreground', 'card', 'border', 'primary', 'muted-foreground', 'focus-ring'],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM,gCAAgB,IAAI,IAAI;CAAC;CAAM;CAAO;CAAO;CAAM;CAAM;CAAM;CAAM;CAAM;CAAM;CAAM;CAAM;CAAM;CAAM;AAAI,CAAC;;AAGpH,SAAgB,gBAAgB,QAA+B;CAC7D,IAAI;EACF,MAAM,MAAM,IAAI,KAAK,OAAO,MAAM;EAIlC,MAAM,OAAO,IAAI,cAAc,KAAK,IAAI;EACxC,IAAI,MAAM,cAAc,SAAS,MAAM,cAAc,OAAO,OAAO,KAAK;EACxE,OAAO,cAAc,IAAI,IAAI,QAAQ,IAAI,QAAQ;CACnD,QAAQ;EACN,OAAO,cAAc,IAAI,OAAO,MAAM,MAAM,CAAC,CAAC,EAAE,EAAE,YAAY,KAAK,EAAE,IAAI,QAAQ;CACnF;AACF;;AAGA,SAAS,WAAW,MAAc,MAAsB;CACtD,IAAI,QAAQ;CACZ,KAAK,IAAI,IAAI,MAAM,IAAI,KAAK,QAAQ,KAClC,IAAI,KAAK,OAAO,KAAK;MAChB,IAAI,KAAK,OAAO,OAAO,EAAE,UAAU,GAAG,OAAO;CAEpD,OAAO;AACT;;AAGA,SAAS,cAAc,MAAsC;CAC3D,MAAM,WAAmC,CAAC;CAC1C,IAAI,IAAI;CACR,OAAO,IAAI,KAAK,QAAQ;EACtB,MAAM,OAAO,KAAK,QAAQ,KAAK,CAAC;EAChC,IAAI,OAAO,GAAG;EACd,MAAM,OAAO,KAAK,MAAM,GAAG,IAAI,CAAC,CAAC,KAAK;EACtC,MAAM,Q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