@gerege-systems/ui 0.14.0 → 0.14.1

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.
Files changed (77) hide show
  1. package/dist-lib/components/ui/Accordion.js +1 -1
  2. package/dist-lib/components/ui/Accordion.js.map +1 -1
  3. package/dist-lib/components/ui/Alert.js +1 -1
  4. package/dist-lib/components/ui/Alert.js.map +1 -1
  5. package/dist-lib/components/ui/Breadcrumbs.js +6 -6
  6. package/dist-lib/components/ui/Breadcrumbs.js.map +1 -1
  7. package/dist-lib/components/ui/Button.js +9 -8
  8. package/dist-lib/components/ui/Button.js.map +1 -1
  9. package/dist-lib/components/ui/Calendar.js +3 -3
  10. package/dist-lib/components/ui/Calendar.js.map +1 -1
  11. package/dist-lib/components/ui/Card.js +7 -7
  12. package/dist-lib/components/ui/Card.js.map +1 -1
  13. package/dist-lib/components/ui/Carousel.js +1 -1
  14. package/dist-lib/components/ui/Carousel.js.map +1 -1
  15. package/dist-lib/components/ui/Chart.js +1 -1
  16. package/dist-lib/components/ui/Chart.js.map +1 -1
  17. package/dist-lib/components/ui/Checkbox.js +1 -1
  18. package/dist-lib/components/ui/Checkbox.js.map +1 -1
  19. package/dist-lib/components/ui/Combobox.js +12 -12
  20. package/dist-lib/components/ui/Combobox.js.map +1 -1
  21. package/dist-lib/components/ui/CommandPalette.js +8 -8
  22. package/dist-lib/components/ui/CommandPalette.js.map +1 -1
  23. package/dist-lib/components/ui/ContextMenu.js +1 -1
  24. package/dist-lib/components/ui/ContextMenu.js.map +1 -1
  25. package/dist-lib/components/ui/DatePicker.js +2 -2
  26. package/dist-lib/components/ui/DatePicker.js.map +1 -1
  27. package/dist-lib/components/ui/Dialog.js +1 -1
  28. package/dist-lib/components/ui/Dialog.js.map +1 -1
  29. package/dist-lib/components/ui/Drawer.js +18 -18
  30. package/dist-lib/components/ui/Drawer.js.map +1 -1
  31. package/dist-lib/components/ui/DropdownMenu.js +1 -1
  32. package/dist-lib/components/ui/DropdownMenu.js.map +1 -1
  33. package/dist-lib/components/ui/FileUpload.js +1 -1
  34. package/dist-lib/components/ui/FileUpload.js.map +1 -1
  35. package/dist-lib/components/ui/IconButton.js +7 -7
  36. package/dist-lib/components/ui/IconButton.js.map +1 -1
  37. package/dist-lib/components/ui/Input.js +7 -7
  38. package/dist-lib/components/ui/Input.js.map +1 -1
  39. package/dist-lib/components/ui/MultiSelect.js +24 -24
  40. package/dist-lib/components/ui/MultiSelect.js.map +1 -1
  41. package/dist-lib/components/ui/Pagination.js +21 -21
  42. package/dist-lib/components/ui/Pagination.js.map +1 -1
  43. package/dist-lib/components/ui/Popover.js +4 -4
  44. package/dist-lib/components/ui/Popover.js.map +1 -1
  45. package/dist-lib/components/ui/RadioGroup.js +9 -9
  46. package/dist-lib/components/ui/RadioGroup.js.map +1 -1
  47. package/dist-lib/components/ui/ScrollArea.js +11 -11
  48. package/dist-lib/components/ui/ScrollArea.js.map +1 -1
  49. package/dist-lib/components/ui/Select.js +29 -29
  50. package/dist-lib/components/ui/Select.js.map +1 -1
  51. package/dist-lib/components/ui/Sheet.js +1 -1
  52. package/dist-lib/components/ui/Sheet.js.map +1 -1
  53. package/dist-lib/components/ui/Sidebar.js +64 -60
  54. package/dist-lib/components/ui/Sidebar.js.map +1 -1
  55. package/dist-lib/components/ui/Slider.js +1 -1
  56. package/dist-lib/components/ui/Slider.js.map +1 -1
  57. package/dist-lib/components/ui/Snackbar.js +28 -19
  58. package/dist-lib/components/ui/Snackbar.js.map +1 -1
  59. package/dist-lib/components/ui/Switch.js +7 -7
  60. package/dist-lib/components/ui/Switch.js.map +1 -1
  61. package/dist-lib/components/ui/Table.js +6 -6
  62. package/dist-lib/components/ui/Table.js.map +1 -1
  63. package/dist-lib/components/ui/Tabs.js +6 -6
  64. package/dist-lib/components/ui/Tabs.js.map +1 -1
  65. package/dist-lib/components/ui/TagInput.js +3 -3
  66. package/dist-lib/components/ui/TagInput.js.map +1 -1
  67. package/dist-lib/components/ui/Textarea.js +1 -1
  68. package/dist-lib/components/ui/Textarea.js.map +1 -1
  69. package/dist-lib/components/ui/Toast.js +8 -8
  70. package/dist-lib/components/ui/Toast.js.map +1 -1
  71. package/dist-lib/components/ui/TopNav.js +9 -9
  72. package/dist-lib/components/ui/TopNav.js.map +1 -1
  73. package/dist-lib/components/ui/Tree.js +2 -2
  74. package/dist-lib/components/ui/Tree.js.map +1 -1
  75. package/dist-lib/styles.css +1 -1
  76. package/dist-lib/theme.css +42 -28
  77. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Table.js","sources":["../../../src/components/ui/Table.tsx"],"sourcesContent":["'use client';\n\nimport {\n forwardRef,\n type CSSProperties,\n type HTMLAttributes,\n type ThHTMLAttributes,\n type TdHTMLAttributes,\n} from 'react';\nimport { ArrowDown, ArrowUp, ArrowUpDown } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { useStrings } from '@/hooks/use-strings';\n\n/* -----------------------------------------------------------------------------\n * Table primitives — minimal sugar over <table>. Pair with a sortable\n * header helper (`TableSortHeader`) when you need built-in sort visuals.\n * Empty + loading states are pure composition with the rest of the system.\n * --------------------------------------------------------------------------- */\n\nexport interface TableProps extends HTMLAttributes<HTMLTableElement> {\n /** Class for the scroll wrapper (border, radius, height). */\n containerClassName?: string;\n /**\n * Max height of the scroll wrapper. Required for the sticky header to\n * work — `<thead>` sticks to the nearest scroll container, so a wrapper\n * with no height cap never scrolls. e.g. `maxHeight=\"24rem\"`.\n */\n maxHeight?: CSSProperties['maxHeight'];\n /**\n * Accessible name of the scroll wrapper (it is a focusable `group` so\n * keyboard users can scroll wide / capped tables). Defaults to\n * `strings.table.scrollRegion`; pass the table's own title when you have one.\n */\n scrollLabel?: string;\n}\n\nexport const Table = forwardRef<HTMLTableElement, TableProps>(function Table(\n { className, containerClassName, maxHeight, scrollLabel, ...props },\n ref,\n) {\n const strings = useStrings();\n return (\n // Whether the wrapper actually overflows is not knowable statically, so it\n // is always a tab stop (WCAG 2.1.1 / axe scrollable-region-focusable).\n <div\n data-slot=\"table-container\"\n role=\"group\"\n aria-label={scrollLabel ?? strings.table.scrollRegion}\n tabIndex={0}\n className={cn(\n 'relative isolate w-full overflow-auto',\n 'focus-visible:ring-ring focus-visible:ring-offset-background outline-none focus-visible:ring-2 focus-visible:ring-offset-2',\n containerClassName,\n )}\n style={maxHeight !== undefined ? { maxHeight } : undefined}\n >\n <table\n data-slot=\"table\"\n ref={ref}\n className={cn('w-full caption-bottom border-collapse text-sm', className)}\n {...props}\n />\n </div>\n );\n});\nTable.displayName = 'Table';\n\nexport const TableHeader = forwardRef<\n HTMLTableSectionElement,\n HTMLAttributes<HTMLTableSectionElement>\n>(function TableHeader({ className, ...props }, ref) {\n return (\n <thead\n ref={ref}\n className={cn(\n 'bg-background-subtle text-foreground-muted sticky top-0 z-10',\n '[&_tr]:border-border [&_tr]:border-b',\n className,\n )}\n {...props}\n />\n );\n});\nTableHeader.displayName = 'TableHeader';\n\nexport const TableBody = forwardRef<\n HTMLTableSectionElement,\n HTMLAttributes<HTMLTableSectionElement>\n>(function TableBody({ className, ...props }, ref) {\n return <tbody ref={ref} className={cn('[&_tr:last-child]:border-0', className)} {...props} />;\n});\nTableBody.displayName = 'TableBody';\n\nexport const TableFooter = forwardRef<\n HTMLTableSectionElement,\n HTMLAttributes<HTMLTableSectionElement>\n>(function TableFooter({ className, ...props }, ref) {\n return (\n <tfoot\n ref={ref}\n className={cn('border-border bg-background-subtle border-t font-medium', className)}\n {...props}\n />\n );\n});\nTableFooter.displayName = 'TableFooter';\n\nexport const TableRow = forwardRef<\n HTMLTableRowElement,\n HTMLAttributes<HTMLTableRowElement> & {\n /**\n * Visual selected state (`data-state=\"selected\"`). `aria-selected` is only\n * valid on rows of an ARIA grid, so it is emitted only when the row\n * carries `role=\"row\"` (i.e. you opted into `role=\"grid\"` on the table).\n */\n selected?: boolean;\n }\n>(function TableRow({ className, selected, role, ...props }, ref) {\n return (\n <tr\n ref={ref}\n role={role}\n data-state={selected ? 'selected' : undefined}\n aria-selected={selected && role === 'row' ? true : undefined}\n className={cn(\n 'border-border border-b transition-colors duration-[var(--duration-fast)]',\n 'hover:bg-background-subtle',\n 'data-[state=selected]:bg-accent-soft data-[state=selected]:hover:bg-accent-soft',\n className,\n )}\n {...props}\n />\n );\n});\nTableRow.displayName = 'TableRow';\n\nexport type TableCellAlign = 'left' | 'center' | 'right';\n\nconst alignClass: Record<TableCellAlign, string> = {\n left: 'text-left',\n center: 'text-center',\n /* Numeric columns: right-aligned + tabular figures so digits line up. */\n right: 'text-right tabular',\n};\n\nexport interface TableHeadProps extends Omit<ThHTMLAttributes<HTMLTableCellElement>, 'align'> {\n /** Horizontal alignment; `right` also applies tabular figures. */\n align?: TableCellAlign;\n /**\n * Render the header label in small caps (`uppercase tracking-wide`).\n * Off by default — mixed case reads better for long / Cyrillic labels.\n * @default false\n */\n uppercase?: boolean;\n}\n\nexport const TableHead = forwardRef<HTMLTableCellElement, TableHeadProps>(function TableHead(\n { className, uppercase = false, align = 'left', ...props },\n ref,\n) {\n return (\n <th\n ref={ref}\n className={cn(\n 'text-foreground-subtle h-10 px-3 align-middle text-xs font-medium',\n alignClass[align],\n uppercase && 'tracking-wide uppercase',\n '[&:has([role=checkbox])]:w-10 [&:has([role=checkbox])]:pr-0',\n className,\n )}\n {...props}\n />\n );\n});\nTableHead.displayName = 'TableHead';\n\nexport interface TableCellProps extends Omit<TdHTMLAttributes<HTMLTableCellElement>, 'align'> {\n /** Horizontal alignment; `right` also applies tabular figures for numbers. */\n align?: TableCellAlign;\n}\n\nexport const TableCell = forwardRef<HTMLTableCellElement, TableCellProps>(function TableCell(\n { className, align = 'left', ...props },\n ref,\n) {\n return (\n <td\n ref={ref}\n className={cn('text-foreground px-3 py-3 align-middle', alignClass[align], className)}\n {...props}\n />\n );\n});\nTableCell.displayName = 'TableCell';\n\nexport const TableCaption = forwardRef<\n HTMLTableCaptionElement,\n HTMLAttributes<HTMLTableCaptionElement>\n>(function TableCaption({ className, ...props }, ref) {\n return (\n <caption\n ref={ref}\n className={cn('text-foreground-subtle mt-4 text-sm', className)}\n {...props}\n />\n );\n});\nTableCaption.displayName = 'TableCaption';\n\nexport interface TableSortHeaderProps extends TableHeadProps {\n /** Stable column key used in `currentSort.key`. */\n sortKey: string;\n /** Currently sorted column + direction (or null). */\n currentSort: { key: string; direction: 'asc' | 'desc' } | null;\n /** Called when the user clicks the header. */\n onSortChange: (key: string, direction: 'asc' | 'desc') => void;\n}\n\n/**\n * Sortable column header. Click toggles asc → desc → asc; the icon reflects\n * the current state.\n *\n * @example\n * <TableSortHeader sortKey=\"name\" currentSort={sort} onSortChange={onSort}>\n * Name\n * </TableSortHeader>\n *\n * @do Sort by one column at a time. Multi-sort hides state from users.\n * @dont Sort silently — the icon must change so users see what changed.\n */\nexport const TableSortHeader = forwardRef<HTMLTableCellElement, TableSortHeaderProps>(\n function TableSortHeader(\n { sortKey, currentSort, onSortChange, children, className, align = 'left', ...props },\n ref,\n ) {\n const active = currentSort?.key === sortKey;\n const direction = active ? currentSort?.direction : undefined;\n const handle = () => {\n onSortChange(sortKey, active && direction === 'asc' ? 'desc' : 'asc');\n };\n return (\n <TableHead\n ref={ref}\n align={align}\n className={cn('p-0', className)}\n // aria-sort only on the sorted column — 'none' everywhere else is noise.\n aria-sort={active ? (direction === 'asc' ? 'ascending' : 'descending') : undefined}\n {...props}\n >\n <button\n type=\"button\"\n onClick={handle}\n className={cn(\n 'inline-flex h-10 w-full items-center gap-1.5 px-3 outline-none',\n align === 'right' && 'flex-row-reverse',\n align === 'center' && 'justify-center',\n 'transition-colors duration-[var(--duration-fast)]',\n 'hover:text-foreground focus-visible:text-foreground',\n 'focus-visible:ring-ring focus-visible:ring-offset-background rounded-sm focus-visible:ring-2 focus-visible:ring-offset-2',\n active && 'text-foreground',\n )}\n >\n {children}\n {direction === 'asc' ? (\n <ArrowUp className=\"size-3.5\" aria-hidden />\n ) : direction === 'desc' ? (\n <ArrowDown className=\"size-3.5\" aria-hidden />\n ) : (\n <ArrowUpDown className=\"size-3.5 opacity-40\" aria-hidden />\n )}\n </button>\n </TableHead>\n );\n },\n);\nTableSortHeader.displayName = 'TableSortHeader';\n"],"names":["Table","forwardRef","className","containerClassName","maxHeight","scrollLabel","props","ref","strings","useStrings","jsx","cn","TableHeader","TableBody","TableFooter","TableRow","selected","role","alignClass","TableHead","uppercase","align","TableCell","TableCaption","TableSortHeader","sortKey","currentSort","onSortChange","children","active","direction","handle","jsxs","ArrowUp","ArrowDown","ArrowUpDown"],"mappings":";;;;;;AAoCO,MAAMA,IAAQC,EAAyC,SAC5D,EAAE,WAAAC,GAAW,oBAAAC,GAAoB,WAAAC,GAAW,aAAAC,GAAa,GAAGC,EAAA,GAC5DC,GACA;AACA,QAAMC,IAAUC,EAAA;AAChB;AAAA;AAAA;AAAA,IAGE,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,aAAU;AAAA,QACV,MAAK;AAAA,QACL,cAAYL,KAAeG,EAAQ,MAAM;AAAA,QACzC,UAAU;AAAA,QACV,WAAWG;AAAA,UACT;AAAA,UACA;AAAA,UACAR;AAAA,QAAA;AAAA,QAEF,OAAOC,MAAc,SAAY,EAAE,WAAAA,MAAc;AAAA,QAEjD,UAAA,gBAAAM;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,aAAU;AAAA,YACV,KAAAH;AAAA,YACA,WAAWI,EAAG,iDAAiDT,CAAS;AAAA,YACvE,GAAGI;AAAA,UAAA;AAAA,QAAA;AAAA,MACN;AAAA,IAAA;AAAA;AAGN,CAAC;AACDN,EAAM,cAAc;AAEb,MAAMY,IAAcX,EAGzB,SAAqB,EAAE,WAAAC,GAAW,GAAGI,EAAA,GAASC,GAAK;AACnD,SACE,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAH;AAAA,MACA,WAAWI;AAAA,QACT;AAAA,QACA;AAAA,QACAT;AAAA,MAAA;AAAA,MAED,GAAGI;AAAA,IAAA;AAAA,EAAA;A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UAAA,gBAAA0B;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,SAASD;AAAA,YACT,WAAWpB;AAAA,cACT;AAAA,cACAU,MAAU,WAAW;AAAA,cACrBA,MAAU,YAAY;AAAA,cACtB;AAAA,cACA;AAAA,cACA;AAAA,cACAQ,KAAU;AAAA,YAAA;AAAA,YAGX,UAAA;AAAA,cAAAD;AAAA,cACAE,MAAc,QACb,gBAAApB,EAACuB,GAAA,EAAQ,WAAU,YAAW,eAAW,GAAA,CAAC,IACxCH,MAAc,2BACfI,GAAA,EAAU,WAAU,YAAW,eAAW,GAAA,CAAC,sBAE3CC,GAAA,EAAY,WAAU,uBAAsB,eAAW,GAAA,CAAC;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAE7D;AAAA,IAAA;AAAA,EAGN;AACF;AACAX,EAAgB,cAAc;"}
1
+ {"version":3,"file":"Table.js","sources":["../../../src/components/ui/Table.tsx"],"sourcesContent":["'use client';\n\nimport {\n forwardRef,\n type CSSProperties,\n type HTMLAttributes,\n type ThHTMLAttributes,\n type TdHTMLAttributes,\n} from 'react';\nimport { ArrowDown, ArrowUp, ArrowUpDown } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { useStrings } from '@/hooks/use-strings';\n\n/* -----------------------------------------------------------------------------\n * Table primitives — minimal sugar over <table>. Pair with a sortable\n * header helper (`TableSortHeader`) when you need built-in sort visuals.\n * Empty + loading states are pure composition with the rest of the system.\n * --------------------------------------------------------------------------- */\n\nexport interface TableProps extends HTMLAttributes<HTMLTableElement> {\n /** Class for the scroll wrapper (border, radius, height). */\n containerClassName?: string;\n /**\n * Max height of the scroll wrapper. Required for the sticky header to\n * work — `<thead>` sticks to the nearest scroll container, so a wrapper\n * with no height cap never scrolls. e.g. `maxHeight=\"24rem\"`.\n */\n maxHeight?: CSSProperties['maxHeight'];\n /**\n * Accessible name of the scroll wrapper (it is a focusable `group` so\n * keyboard users can scroll wide / capped tables). Defaults to\n * `strings.table.scrollRegion`; pass the table's own title when you have one.\n */\n scrollLabel?: string;\n}\n\nexport const Table = forwardRef<HTMLTableElement, TableProps>(function Table(\n { className, containerClassName, maxHeight, scrollLabel, ...props },\n ref,\n) {\n const strings = useStrings();\n return (\n // Whether the wrapper actually overflows is not knowable statically, so it\n // is always a tab stop (WCAG 2.1.1 / axe scrollable-region-focusable).\n <div\n data-slot=\"table-container\"\n role=\"group\"\n aria-label={scrollLabel ?? strings.table.scrollRegion}\n tabIndex={0}\n className={cn(\n 'relative isolate w-full overflow-auto',\n 'focus-visible:ring-ring focus-visible:ring-offset-background outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2',\n containerClassName,\n )}\n style={maxHeight !== undefined ? { maxHeight } : undefined}\n >\n <table\n data-slot=\"table\"\n ref={ref}\n className={cn('w-full caption-bottom border-collapse text-sm', className)}\n {...props}\n />\n </div>\n );\n});\nTable.displayName = 'Table';\n\nexport const TableHeader = forwardRef<\n HTMLTableSectionElement,\n HTMLAttributes<HTMLTableSectionElement>\n>(function TableHeader({ className, ...props }, ref) {\n return (\n <thead\n ref={ref}\n className={cn(\n 'bg-background-subtle text-foreground-muted sticky top-0 z-10',\n '[&_tr]:border-border [&_tr]:border-b',\n className,\n )}\n {...props}\n />\n );\n});\nTableHeader.displayName = 'TableHeader';\n\nexport const TableBody = forwardRef<\n HTMLTableSectionElement,\n HTMLAttributes<HTMLTableSectionElement>\n>(function TableBody({ className, ...props }, ref) {\n return <tbody ref={ref} className={cn('[&_tr:last-child]:border-0', className)} {...props} />;\n});\nTableBody.displayName = 'TableBody';\n\nexport const TableFooter = forwardRef<\n HTMLTableSectionElement,\n HTMLAttributes<HTMLTableSectionElement>\n>(function TableFooter({ className, ...props }, ref) {\n return (\n <tfoot\n ref={ref}\n className={cn('border-border bg-background-subtle border-t font-medium', className)}\n {...props}\n />\n );\n});\nTableFooter.displayName = 'TableFooter';\n\nexport const TableRow = forwardRef<\n HTMLTableRowElement,\n HTMLAttributes<HTMLTableRowElement> & {\n /**\n * Visual selected state (`data-state=\"selected\"`). `aria-selected` is only\n * valid on rows of an ARIA grid, so it is emitted only when the row\n * carries `role=\"row\"` (i.e. you opted into `role=\"grid\"` on the table).\n */\n selected?: boolean;\n }\n>(function TableRow({ className, selected, role, ...props }, ref) {\n return (\n <tr\n ref={ref}\n role={role}\n data-state={selected ? 'selected' : undefined}\n aria-selected={selected && role === 'row' ? true : undefined}\n className={cn(\n 'border-border border-b transition-colors duration-[var(--duration-fast)]',\n 'hover:bg-background-subtle',\n 'data-[state=selected]:bg-accent-soft data-[state=selected]:hover:bg-accent-soft',\n className,\n )}\n {...props}\n />\n );\n});\nTableRow.displayName = 'TableRow';\n\nexport type TableCellAlign = 'left' | 'center' | 'right';\n\nconst alignClass: Record<TableCellAlign, string> = {\n left: 'text-left',\n center: 'text-center',\n /* Numeric columns: right-aligned + tabular figures so digits line up. */\n right: 'text-right tabular',\n};\n\nexport interface TableHeadProps extends Omit<ThHTMLAttributes<HTMLTableCellElement>, 'align'> {\n /** Horizontal alignment; `right` also applies tabular figures. */\n align?: TableCellAlign;\n /**\n * Render the header label in small caps (`uppercase tracking-wide`).\n * Off by default — mixed case reads better for long / Cyrillic labels.\n * @default false\n */\n uppercase?: boolean;\n}\n\nexport const TableHead = forwardRef<HTMLTableCellElement, TableHeadProps>(function TableHead(\n { className, uppercase = false, align = 'left', ...props },\n ref,\n) {\n return (\n <th\n ref={ref}\n className={cn(\n 'text-foreground-subtle h-10 px-3 align-middle text-xs font-medium',\n alignClass[align],\n uppercase && 'tracking-wide uppercase',\n '[&:has([role=checkbox])]:w-10 [&:has([role=checkbox])]:pr-0',\n className,\n )}\n {...props}\n />\n );\n});\nTableHead.displayName = 'TableHead';\n\nexport interface TableCellProps extends Omit<TdHTMLAttributes<HTMLTableCellElement>, 'align'> {\n /** Horizontal alignment; `right` also applies tabular figures for numbers. */\n align?: TableCellAlign;\n}\n\nexport const TableCell = forwardRef<HTMLTableCellElement, TableCellProps>(function TableCell(\n { className, align = 'left', ...props },\n ref,\n) {\n return (\n <td\n ref={ref}\n className={cn('text-foreground px-3 py-3 align-middle', alignClass[align], className)}\n {...props}\n />\n );\n});\nTableCell.displayName = 'TableCell';\n\nexport const TableCaption = forwardRef<\n HTMLTableCaptionElement,\n HTMLAttributes<HTMLTableCaptionElement>\n>(function TableCaption({ className, ...props }, ref) {\n return (\n <caption\n ref={ref}\n className={cn('text-foreground-subtle mt-4 text-sm', className)}\n {...props}\n />\n );\n});\nTableCaption.displayName = 'TableCaption';\n\nexport interface TableSortHeaderProps extends TableHeadProps {\n /** Stable column key used in `currentSort.key`. */\n sortKey: string;\n /** Currently sorted column + direction (or null). */\n currentSort: { key: string; direction: 'asc' | 'desc' } | null;\n /** Called when the user clicks the header. */\n onSortChange: (key: string, direction: 'asc' | 'desc') => void;\n}\n\n/**\n * Sortable column header. Click toggles asc → desc → asc; the icon reflects\n * the current state.\n *\n * @example\n * <TableSortHeader sortKey=\"name\" currentSort={sort} onSortChange={onSort}>\n * Name\n * </TableSortHeader>\n *\n * @do Sort by one column at a time. Multi-sort hides state from users.\n * @dont Sort silently — the icon must change so users see what changed.\n */\nexport const TableSortHeader = forwardRef<HTMLTableCellElement, TableSortHeaderProps>(\n function TableSortHeader(\n { sortKey, currentSort, onSortChange, children, className, align = 'left', ...props },\n ref,\n ) {\n const active = currentSort?.key === sortKey;\n const direction = active ? currentSort?.direction : undefined;\n const handle = () => {\n onSortChange(sortKey, active && direction === 'asc' ? 'desc' : 'asc');\n };\n return (\n <TableHead\n ref={ref}\n align={align}\n className={cn('p-0', className)}\n // aria-sort only on the sorted column — 'none' everywhere else is noise.\n aria-sort={active ? (direction === 'asc' ? 'ascending' : 'descending') : undefined}\n {...props}\n >\n <button\n type=\"button\"\n onClick={handle}\n className={cn(\n 'inline-flex h-10 w-full items-center gap-1.5 px-3 outline-hidden',\n align === 'right' && 'flex-row-reverse',\n align === 'center' && 'justify-center',\n 'transition-colors duration-[var(--duration-fast)]',\n 'hover:text-foreground focus-visible:text-foreground',\n 'focus-visible:ring-ring focus-visible:ring-offset-background rounded-sm focus-visible:ring-2 focus-visible:ring-offset-2',\n active && 'text-foreground',\n )}\n >\n {children}\n {direction === 'asc' ? (\n <ArrowUp className=\"size-3.5\" aria-hidden />\n ) : direction === 'desc' ? (\n <ArrowDown className=\"size-3.5\" aria-hidden />\n ) : (\n <ArrowUpDown className=\"size-3.5 opacity-40\" aria-hidden />\n )}\n </button>\n </TableHead>\n );\n },\n);\nTableSortHeader.displayName = 'TableSortHeader';\n"],"names":["Table","forwardRef","className","containerClassName","maxHeight","scrollLabel","props","ref","strings","useStrings","jsx","cn","TableHeader","TableBody","TableFooter","TableRow","selected","role","alignClass","TableHead","uppercase","align","TableCell","TableCaption","TableSortHeader","sortKey","currentSort","onSortChange","children","active","direction","handle","jsxs","ArrowUp","ArrowDown","ArrowUpDown"],"mappings":";;;;;;AAoCO,MAAMA,IAAQC,EAAyC,SAC5D,EAAE,WAAAC,GAAW,oBAAAC,GAAoB,WAAAC,GAAW,aAAAC,GAAa,GAAGC,EAAA,GAC5DC,GACA;AACA,QAAMC,IAAUC,EAAA;AAChB;AAAA;AAAA;AAAA,IAGE,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,aAAU;AAAA,QACV,MAAK;AAAA,QACL,cAAYL,KAAeG,EAAQ,MAAM;AAAA,QACzC,UAAU;AAAA,QACV,WAAWG;AAAA,UACT;AAAA,UACA;AAAA,UACAR;AAAA,QAAA;AAAA,QAEF,OAAOC,MAAc,SAAY,EAAE,WAAAA,MAAc;AAAA,QAEjD,UAAA,gBAAAM;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,aAAU;AAAA,YACV,KAAAH;AAAA,YACA,WAAWI,EAAG,iDAAiDT,CAAS;AAAA,YACvE,GAAGI;AAAA,UAAA;AAAA,QAAA;AAAA,MACN;AAAA,IAAA;AAAA;AAGN,CAAC;AACDN,EAAM,cAAc;AAEb,MAAMY,IAAcX,EAGzB,SAA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AAA,IACtE;AACA,WACE,gBAAApB;AAAA,MAACS;AAAA,MAAA;AAAA,QACC,KAAAZ;AAAA,QACA,OAAAc;AAAA,QACA,WAAWV,EAAG,OAAOT,CAAS;AAAA,QAE9B,aAAW2B,IAAUC,MAAc,QAAQ,cAAc,eAAgB;AAAA,QACxE,GAAGxB;AAAA,QAEJ,UAAA,gBAAA0B;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,SAASD;AAAA,YACT,WAAWpB;AAAA,cACT;AAAA,cACAU,MAAU,WAAW;AAAA,cACrBA,MAAU,YAAY;AAAA,cACtB;AAAA,cACA;AAAA,cACA;AAAA,cACAQ,KAAU;AAAA,YAAA;AAAA,YAGX,UAAA;AAAA,cAAAD;AAAA,cACAE,MAAc,QACb,gBAAApB,EAACuB,GAAA,EAAQ,WAAU,YAAW,eAAW,GAAA,CAAC,IACxCH,MAAc,2BACfI,GAAA,EAAU,WAAU,YAAW,eAAW,GAAA,CAAC,sBAE3CC,GAAA,EAAY,WAAU,uBAAsB,eAAW,GAAA,CAAC;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAE7D;AAAA,IAAA;AAAA,EAGN;AACF;AACAX,EAAgB,cAAc;"}
@@ -2,7 +2,7 @@
2
2
  import { jsx as i } from "react/jsx-runtime";
3
3
  import { forwardRef as s, useContext as v, createContext as c } from "react";
4
4
  import * as n from "@radix-ui/react-tabs";
5
- import { cn as o } from "../../lib/utils.js";
5
+ import { cn as d } from "../../lib/utils.js";
6
6
  import { cva as f } from "class-variance-authority";
7
7
  const N = n.Root, l = c("underline"), g = f("inline-flex items-center", {
8
8
  variants: {
@@ -25,7 +25,7 @@ const N = n.Root, l = c("underline"), g = f("inline-flex items-center", {
25
25
  "data-slot": "tabs-list",
26
26
  ref: u,
27
27
  "data-variant": a,
28
- className: o(g({ variant: a, size: e }), t),
28
+ className: d(g({ variant: a, size: e }), t),
29
29
  ...r
30
30
  }
31
31
  ) });
@@ -39,11 +39,11 @@ const m = s(function({ className: t, ...a }, e) {
39
39
  {
40
40
  ref: e,
41
41
  "data-variant": r,
42
- className: o(
42
+ className: d(
43
43
  "inline-flex items-center gap-2 font-medium whitespace-nowrap",
44
44
  // Icon + label tabs: a bare lucide icon is 24px; match Button/menu items.
45
45
  "[&_svg]:size-4 [&_svg]:shrink-0",
46
- "transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)] outline-none",
46
+ "outline-hidden transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]",
47
47
  "focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2",
48
48
  "disabled:pointer-events-none disabled:opacity-50",
49
49
  // Underline variant
@@ -75,8 +75,8 @@ const p = s(function({ className: t, ...a }, e) {
75
75
  n.Content,
76
76
  {
77
77
  ref: e,
78
- className: o(
79
- "mt-4 outline-none",
78
+ className: d(
79
+ "mt-4 outline-hidden",
80
80
  "focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2",
81
81
  t
82
82
  ),
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.js","sources":["../../../src/components/ui/Tabs.tsx"],"sourcesContent":["'use client';\n\nimport {\n createContext,\n forwardRef,\n useContext,\n type ComponentPropsWithoutRef,\n type ComponentRef,\n} from 'react';\nimport * as TabsPrimitive from '@radix-ui/react-tabs';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from '@/lib/cva';\n\n/* -----------------------------------------------------------------------------\n * Two visual variants — `underline` (refined-minimal default) and `pills`.\n * Variant is set on `TabsList`; trigger styles auto-derive via data-attr.\n * --------------------------------------------------------------------------- */\n\nexport const Tabs = TabsPrimitive.Root;\n\ntype TabsVariant = 'underline' | 'pills';\n/* Triggers read the list variant from context and stamp their own\n `data-variant`, so no ancestor selector can leak into nested Tabs. */\nconst TabsVariantContext = createContext<TabsVariant>('underline');\n\nconst list = cva('inline-flex items-center', {\n variants: {\n variant: {\n underline: 'gap-4 border-b border-border w-full',\n pills: 'gap-1 rounded-lg bg-background-muted p-1',\n },\n size: {\n sm: 'h-9 text-xs',\n md: 'h-10 text-sm',\n lg: 'h-11 text-sm',\n },\n },\n defaultVariants: { variant: 'underline', size: 'md' },\n});\n\nexport interface TabsListProps\n extends ComponentPropsWithoutRef<typeof TabsPrimitive.List>, VariantProps<typeof list> {}\n\nexport const TabsList = forwardRef<ComponentRef<typeof TabsPrimitive.List>, TabsListProps>(\n function TabsList({ className, variant = 'underline', size, ...props }, ref) {\n return (\n <TabsVariantContext.Provider value={variant ?? 'underline'}>\n <TabsPrimitive.List\n data-slot=\"tabs-list\"\n ref={ref}\n data-variant={variant}\n className={cn(list({ variant, size }), className)}\n {...props}\n />\n </TabsVariantContext.Provider>\n );\n },\n);\nTabsList.displayName = 'TabsList';\n\nexport const TabsTrigger = forwardRef<\n ComponentRef<typeof TabsPrimitive.Trigger>,\n ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(function TabsTrigger({ className, ...props }, ref) {\n const variant = useContext(TabsVariantContext);\n return (\n <TabsPrimitive.Trigger\n ref={ref}\n data-variant={variant}\n className={cn(\n 'inline-flex items-center gap-2 font-medium whitespace-nowrap',\n // Icon + label tabs: a bare lucide icon is 24px; match Button/menu items.\n '[&_svg]:size-4 [&_svg]:shrink-0',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)] outline-none',\n 'focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2',\n 'disabled:pointer-events-none disabled:opacity-50',\n // Underline variant\n 'data-[variant=underline]:relative data-[variant=underline]:h-full',\n 'data-[variant=underline]:text-foreground-muted data-[variant=underline]:px-1',\n 'data-[variant=underline]:hover:text-foreground',\n 'data-[variant=underline]:data-[state=active]:text-foreground',\n 'data-[variant=underline]:data-[state=active]:after:absolute',\n 'data-[variant=underline]:data-[state=active]:after:inset-x-0',\n 'data-[variant=underline]:data-[state=active]:after:-bottom-px',\n 'data-[variant=underline]:data-[state=active]:after:h-0.5',\n 'data-[variant=underline]:data-[state=active]:after:bg-accent',\n // Pills variant\n 'data-[variant=pills]:h-full data-[variant=pills]:rounded-md data-[variant=pills]:px-3',\n 'data-[variant=pills]:text-foreground-muted',\n 'data-[variant=pills]:hover:text-foreground',\n 'data-[variant=pills]:data-[state=active]:bg-card',\n 'data-[variant=pills]:data-[state=active]:text-foreground',\n 'data-[variant=pills]:data-[state=active]:shadow-xs',\n className,\n )}\n {...props}\n />\n );\n});\nTabsTrigger.displayName = 'TabsTrigger';\n\nexport const TabsContent = forwardRef<\n ComponentRef<typeof TabsPrimitive.Content>,\n ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(function TabsContent({ className, ...props }, ref) {\n return (\n <TabsPrimitive.Content\n ref={ref}\n className={cn(\n 'mt-4 outline-none',\n 'focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2',\n className,\n )}\n {...props}\n />\n );\n});\nTabsContent.displayName = 'TabsContent';\n\n/**\n * @example Underline (default)\n * <Tabs defaultValue=\"overview\">\n * <TabsList>\n * <TabsTrigger value=\"overview\">Overview</TabsTrigger>\n * <TabsTrigger value=\"activity\">Activity</TabsTrigger>\n * </TabsList>\n * <TabsContent value=\"overview\">…</TabsContent>\n * <TabsContent value=\"activity\">…</TabsContent>\n * </Tabs>\n *\n * @example Pills\n * <TabsList variant=\"pills\"><TabsTrigger value=\"all\">All</TabsTrigger>…</TabsList>\n *\n * @do Use `underline` at the top of a page or panel. Use `pills` inside a\n * card or for filter-style switches.\n * @dont Mix variants on the same screen — pick one and commit.\n */\n"],"names":["Tabs","TabsPrimitive","TabsVariantContext","createContext","list","cva","TabsList","forwardRef","className","variant","size","props","ref","jsx","cn","TabsTrigger","useContext","TabsContent"],"mappings":";;;;;;AAkBO,MAAMA,IAAOC,EAAc,MAK5BC,IAAqBC,EAA2B,WAAW,GAE3DC,IAAOC,EAAI,4BAA4B;AAAA,EAC3C,UAAU;AAAA,IACR,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qB,EAAE,WAAAC,GAAW,GAAGG,EAAA,GAASC,GAAK;AACnD,SACE,gBAAAC;AAAA,IAACZ,EAAc;AAAA,IAAd;AAAA,MACC,KAAAW;AAAA,MACA,WAAWE;AAAA,QACT;AAAA,QACA;AAAA,QACAN;AAAA,MAAA;AAAA,MAED,GAAGG;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;AACDM,EAAY,cAAc;"}
1
+ {"version":3,"file":"Tabs.js","sources":["../../../src/components/ui/Tabs.tsx"],"sourcesContent":["'use client';\n\nimport {\n createContext,\n forwardRef,\n useContext,\n type ComponentPropsWithoutRef,\n type ComponentRef,\n} from 'react';\nimport * as TabsPrimitive from '@radix-ui/react-tabs';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from '@/lib/cva';\n\n/* -----------------------------------------------------------------------------\n * Two visual variants — `underline` (refined-minimal default) and `pills`.\n * Variant is set on `TabsList`; trigger styles auto-derive via data-attr.\n * --------------------------------------------------------------------------- */\n\nexport const Tabs = TabsPrimitive.Root;\n\ntype TabsVariant = 'underline' | 'pills';\n/* Triggers read the list variant from context and stamp their own\n `data-variant`, so no ancestor selector can leak into nested Tabs. */\nconst TabsVariantContext = createContext<TabsVariant>('underline');\n\nconst list = cva('inline-flex items-center', {\n variants: {\n variant: {\n underline: 'gap-4 border-b border-border w-full',\n pills: 'gap-1 rounded-lg bg-background-muted p-1',\n },\n size: {\n sm: 'h-9 text-xs',\n md: 'h-10 text-sm',\n lg: 'h-11 text-sm',\n },\n },\n defaultVariants: { variant: 'underline', size: 'md' },\n});\n\nexport interface TabsListProps\n extends ComponentPropsWithoutRef<typeof TabsPrimitive.List>, VariantProps<typeof list> {}\n\nexport const TabsList = forwardRef<ComponentRef<typeof TabsPrimitive.List>, TabsListProps>(\n function TabsList({ className, variant = 'underline', size, ...props }, ref) {\n return (\n <TabsVariantContext.Provider value={variant ?? 'underline'}>\n <TabsPrimitive.List\n data-slot=\"tabs-list\"\n ref={ref}\n data-variant={variant}\n className={cn(list({ variant, size }), className)}\n {...props}\n />\n </TabsVariantContext.Provider>\n );\n },\n);\nTabsList.displayName = 'TabsList';\n\nexport const TabsTrigger = forwardRef<\n ComponentRef<typeof TabsPrimitive.Trigger>,\n ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(function TabsTrigger({ className, ...props }, ref) {\n const variant = useContext(TabsVariantContext);\n return (\n <TabsPrimitive.Trigger\n ref={ref}\n data-variant={variant}\n className={cn(\n 'inline-flex items-center gap-2 font-medium whitespace-nowrap',\n // Icon + label tabs: a bare lucide icon is 24px; match Button/menu items.\n '[&_svg]:size-4 [&_svg]:shrink-0',\n 'outline-hidden transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2',\n 'disabled:pointer-events-none disabled:opacity-50',\n // Underline variant\n 'data-[variant=underline]:relative data-[variant=underline]:h-full',\n 'data-[variant=underline]:text-foreground-muted data-[variant=underline]:px-1',\n 'data-[variant=underline]:hover:text-foreground',\n 'data-[variant=underline]:data-[state=active]:text-foreground',\n 'data-[variant=underline]:data-[state=active]:after:absolute',\n 'data-[variant=underline]:data-[state=active]:after:inset-x-0',\n 'data-[variant=underline]:data-[state=active]:after:-bottom-px',\n 'data-[variant=underline]:data-[state=active]:after:h-0.5',\n 'data-[variant=underline]:data-[state=active]:after:bg-accent',\n // Pills variant\n 'data-[variant=pills]:h-full data-[variant=pills]:rounded-md data-[variant=pills]:px-3',\n 'data-[variant=pills]:text-foreground-muted',\n 'data-[variant=pills]:hover:text-foreground',\n 'data-[variant=pills]:data-[state=active]:bg-card',\n 'data-[variant=pills]:data-[state=active]:text-foreground',\n 'data-[variant=pills]:data-[state=active]:shadow-xs',\n className,\n )}\n {...props}\n />\n );\n});\nTabsTrigger.displayName = 'TabsTrigger';\n\nexport const TabsContent = forwardRef<\n ComponentRef<typeof TabsPrimitive.Content>,\n ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(function TabsContent({ className, ...props }, ref) {\n return (\n <TabsPrimitive.Content\n ref={ref}\n className={cn(\n 'mt-4 outline-hidden',\n 'focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2',\n className,\n )}\n {...props}\n />\n );\n});\nTabsContent.displayName = 'TabsContent';\n\n/**\n * @example Underline (default)\n * <Tabs defaultValue=\"overview\">\n * <TabsList>\n * <TabsTrigger value=\"overview\">Overview</TabsTrigger>\n * <TabsTrigger value=\"activity\">Activity</TabsTrigger>\n * </TabsList>\n * <TabsContent value=\"overview\">…</TabsContent>\n * <TabsContent value=\"activity\">…</TabsContent>\n * </Tabs>\n *\n * @example Pills\n * <TabsList variant=\"pills\"><TabsTrigger value=\"all\">All</TabsTrigger>…</TabsList>\n *\n * @do Use `underline` at the top of a page or panel. Use `pills` inside a\n * card or for filter-style switches.\n * @dont Mix variants on the same screen — pick one and commit.\n */\n"],"names":["Tabs","TabsPrimitive","TabsVariantContext","createContext","list","cva","TabsList","forwardRef","className","variant","size","props","ref","jsx","cn","TabsTrigger","useContext","TabsContent"],"mappings":";;;;;;AAkBO,MAAMA,IAAOC,EAAc,MAK5BC,IAAqBC,EAA2B,WAAW,GAE3DC,IAAOC,EAAI,4BAA4B;AAAA,EAC3C,UAAU;AAAA,IACR,SAAS;AAAA,MACP,WAAW;AAAA,MACX,OAAO;AAAA,IAAA;AAAA,IAET,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA;AAAA,EACN;AAAA,EAEF,iBAAiB,EAAE,SAAS,aAAa,MAAM,KAAA;AACjD,CAAC,GAKYC,IAAWC;AAAA,EACtB,SAAkB,EAAE,WAAAC,GAAW,SAAAC,IAAU,aAAa,MAAAC,GAAM,GAAGC,EAAA,GAASC,GAAK;AAC3E,6BACGV,EAAmB,UAAnB,EAA4B,OAAOO,KAAW,aAC7C,UAAA,gBAAAI;AAAA,MAACZ,EAAc;AAAA,MAAd;AAAA,QACC,aAAU;AAAA,QACV,KAAAW;AAAA,QACA,gBAAcH;AAAA,QACd,WAAWK,EAAGV,EAAK,EAAE,SAAAK,GAAS,MAAAC,EAAA,CAAM,GAAGF,CAAS;AAAA,QAC/C,GAAGG;AAAA,MAAA;AAAA,IAAA,GAER;AAAA,EAEJ;AACF;AACAL,EAAS,cAAc;AAEhB,MAAMS,IAAcR,EAGzB,SAAqB,EAAE,WAAAC,GAAW,GAAGG,EAAA,GAASC,GAAK;AACnD,QAAMH,IAAUO,EAAWd,CAAkB;AAC7C,SACE,gBAAAW;AAAA,IAACZ,EAAc;AAAA,IAAd;AAAA,MACC,KAAAW;AAAA,MACA,gBAAcH;AAAA,MACd,WAAWK;AAAA,QACT;AAAA;AAAA,QAEA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,QAEA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,QAEA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACAN;AAAA,MAAA;AAAA,MAED,GAAGG;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;AACDI,EAAY,cAAc;AAEnB,MAAME,IAAcV,EAGzB,SAAqB,EAAE,WAAAC,GAAW,GAAGG,EAAA,GAASC,GAAK;AACnD,SACE,gBAAAC;AAAA,IAACZ,EAAc;AAAA,IAAd;AAAA,MACC,KAAAW;AAAA,MACA,WAAWE;AAAA,QACT;AAAA,QACA;AAAA,QACAN;AAAA,MAAA;AAAA,MAED,GAAGG;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;AACDM,EAAY,cAAc;"}
@@ -42,7 +42,6 @@ const P = q(function({
42
42
  a && /* @__PURE__ */ o(
43
43
  "label",
44
44
  {
45
- "data-slot": "tag-input",
46
45
  htmlFor: y,
47
46
  className: m("text-foreground text-sm font-medium", E && "sr-only"),
48
47
  children: a
@@ -51,6 +50,7 @@ const P = q(function({
51
50
  /* @__PURE__ */ f(
52
51
  "div",
53
52
  {
53
+ "data-slot": "tag-input",
54
54
  className: m(
55
55
  // Cap growth at ~3 chip rows and scroll inside — an unbounded field
56
56
  // pushes the surrounding layout around as tags are added.
@@ -72,7 +72,7 @@ const P = q(function({
72
72
  {
73
73
  type: "button",
74
74
  onClick: () => N(r),
75
- className: "text-foreground-muted hover:bg-background-subtle hover:text-foreground focus-visible:ring-ring focus-visible:ring-offset-background relative rounded-sm p-0.5 outline-none before:absolute before:-inset-1.5 before:content-[''] focus-visible:ring-2 focus-visible:ring-offset-1",
75
+ className: "text-foreground-muted hover:bg-background-subtle hover:text-foreground focus-visible:ring-ring focus-visible:ring-offset-background relative rounded-sm p-0.5 outline-hidden before:absolute before:-inset-1.5 before:content-[''] focus-visible:ring-2 focus-visible:ring-offset-1",
76
76
  "aria-label": L(h.tagInput.remove, { tag: e }),
77
77
  children: /* @__PURE__ */ o(G, { className: "size-3", "aria-hidden": !0 })
78
78
  }
@@ -96,7 +96,7 @@ const P = q(function({
96
96
  "aria-label": j ?? (a || b ? void 0 : x),
97
97
  "aria-invalid": u || void 0,
98
98
  "aria-describedby": R,
99
- className: "placeholder:text-foreground-subtle min-w-[8ch] flex-1 bg-transparent text-lg outline-none md:text-sm"
99
+ className: "placeholder:text-foreground-subtle min-w-[8ch] flex-1 bg-transparent text-lg outline-hidden md:text-sm"
100
100
  }
101
101
  )
102
102
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"TagInput.js","sources":["../../../src/components/ui/TagInput.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, useCallback, useState, type KeyboardEvent, type ReactNode } from 'react';\nimport { X } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { useStrings } from '@/hooks/use-strings';\nimport { formatString } from '@/lib/strings';\nimport { useFieldIds } from '@/hooks/use-field-ids';\n\nexport interface TagInputProps {\n /** Controlled list of tags. */\n value?: string[];\n /** Default tags when uncontrolled. */\n defaultValue?: string[];\n /** Called when the tag list changes. */\n onChange?: (tags: string[]) => void;\n /** Visible label rendered above the field. */\n label?: ReactNode;\n /** Visually conceal the label while keeping it for screen readers. */\n hideLabel?: boolean;\n /** Hint below the field. Hidden while `error` is set. */\n description?: ReactNode;\n /** Placeholder shown inside the inline input. */\n placeholder?: string;\n /** Maximum number of tags. */\n max?: number;\n /** Disable the editor. */\n disabled?: boolean;\n /**\n * Validation state. `true` only paints the danger border; a ReactNode also\n * renders the message below the field and wires `aria-describedby`.\n */\n error?: boolean | ReactNode;\n /** Treat these characters as separators (default: Enter + comma). */\n separators?: string[];\n /** Consumer-supplied id for the inline input. */\n id?: string;\n /** Extra ids to append to `aria-describedby`. */\n 'aria-describedby'?: string;\n 'aria-label'?: string;\n className?: string;\n}\n\n/**\n * Chip-based multi-value input. Press Enter or comma to add. Backspace on an\n * empty input removes the last tag.\n */\nexport const TagInput = forwardRef<HTMLDivElement, TagInputProps>(function TagInput(\n {\n value,\n defaultValue = [],\n onChange,\n label,\n hideLabel,\n description,\n placeholder: placeholderProp,\n max,\n disabled,\n error,\n separators = ['Enter', ','],\n id,\n 'aria-describedby': ariaDescribedby,\n 'aria-label': ariaLabel,\n className,\n },\n ref,\n) {\n const [internal, setInternal] = useState<string[]>(defaultValue);\n const [draft, setDraft] = useState('');\n const tags = value ?? internal;\n\n const strings = useStrings();\n const placeholder = placeholderProp ?? strings.tagInput.placeholder;\n const isError = Boolean(error);\n const hasErrorMessage = isError && error !== true;\n const { fieldId, helperId, errorId, describedBy } = useFieldIds(id, {\n hasHelper: Boolean(description),\n hasError: hasErrorMessage,\n extra: ariaDescribedby,\n });\n\n const update = useCallback(\n (next: string[]) => {\n if (value === undefined) setInternal(next);\n onChange?.(next);\n },\n [onChange, value],\n );\n\n const commit = (raw: string) => {\n const t = raw.trim();\n if (!t || tags.includes(t) || (max !== undefined && tags.length >= max)) return;\n update([...tags, t]);\n };\n\n const remove = (idx: number) => update(tags.filter((_, i) => i !== idx));\n\n const onKey = (e: KeyboardEvent<HTMLInputElement>) => {\n if (separators.includes(e.key)) {\n e.preventDefault();\n commit(draft);\n setDraft('');\n } else if (e.key === 'Backspace' && !draft && tags.length) {\n remove(tags.length - 1);\n }\n };\n\n return (\n <div ref={ref} className={cn('flex flex-col gap-1.5', className)}>\n {label && (\n <label\n data-slot=\"tag-input\"\n htmlFor={fieldId}\n className={cn('text-foreground text-sm font-medium', hideLabel && 'sr-only')}\n >\n {label}\n </label>\n )}\n <div\n className={cn(\n // Cap growth at ~3 chip rows and scroll inside — an unbounded field\n // pushes the surrounding layout around as tags are added.\n 'bg-card flex max-h-24 min-h-9 w-full flex-wrap items-center gap-1.5 overflow-y-auto rounded-md border px-2 py-1.5',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'focus-within:ring-offset-background focus-within:ring-2 focus-within:ring-offset-2',\n isError\n ? 'border-danger focus-within:border-danger focus-within:ring-danger'\n : 'border-border-input focus-within:border-accent focus-within:ring-ring',\n disabled && 'pointer-events-none opacity-50',\n )}\n >\n {tags.map((t, i) => (\n <span\n key={`${t}-${i}`}\n className=\"bg-background-muted inline-flex items-center gap-1 rounded-sm px-2 py-0.5 text-xs\"\n >\n {t}\n <button\n type=\"button\"\n onClick={() => remove(i)}\n // 16px glyph box + halo → ≥24px hit area (WCAG 2.5.8) without growing the chip.\n className=\"text-foreground-muted hover:bg-background-subtle hover:text-foreground focus-visible:ring-ring focus-visible:ring-offset-background relative rounded-sm p-0.5 outline-none before:absolute before:-inset-1.5 before:content-[''] focus-visible:ring-2 focus-visible:ring-offset-1\"\n aria-label={formatString(strings.tagInput.remove, { tag: t })}\n >\n <X className=\"size-3\" aria-hidden />\n </button>\n </span>\n ))}\n <input\n id={fieldId}\n value={draft}\n disabled={disabled}\n onChange={(e) => setDraft(e.target.value)}\n onKeyDown={onKey}\n onBlur={() => {\n if (draft) {\n commit(draft);\n setDraft('');\n }\n }}\n placeholder={tags.length === 0 ? placeholder : undefined}\n // Unlabelled field: fall back to the placeholder. A consumer `id`\n // implies an external <label htmlFor>.\n aria-label={ariaLabel ?? (label || id ? undefined : placeholder)}\n aria-invalid={isError || undefined}\n aria-describedby={describedBy}\n className=\"placeholder:text-foreground-subtle min-w-[8ch] flex-1 bg-transparent text-lg outline-none md:text-sm\"\n />\n </div>\n {hasErrorMessage ? (\n <p id={errorId} className=\"text-danger-text text-xs\">\n {error}\n </p>\n ) : description ? (\n <p id={helperId} className=\"text-foreground-subtle text-xs\">\n {description}\n </p>\n ) : null}\n </div>\n );\n});\nTagInput.displayName = 'TagInput';\n"],"names":["TagInput","forwardRef","value","defaultValue","onChange","label","hideLabel","description","placeholderProp","max","disabled","error","separators","id","ariaDescribedby","ariaLabel","className","ref","internal","setInternal","useState","draft","setDraft","tags","strings","useStrings","placeholder","isError","hasErrorMessage","fieldId","helperId","errorId","describedBy","useFieldIds","update","useCallback","next","commit","raw","t","remove","idx","_","i","onKey","cn","jsx","jsxs","formatString","X"],"mappings":";;;;;;;;AA+CO,MAAMA,IAAWC,EAA0C,SAChE;AAAA,EACE,OAAAC;AAAA,EACA,cAAAC,IAAe,CAAA;AAAA,EACf,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAaC;AAAA,EACb,KAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC,IAAa,CAAC,SAAS,GAAG;AAAA,EAC1B,IAAAC;AAAA,EACA,oBAAoBC;AAAA,EACpB,cAAcC;AAAA,EACd,WAAAC;AACF,GACAC,GACA;AACA,QAAM,CAACC,GAAUC,CAAW,IAAIC,EAAmBjB,CAAY,GACzD,CAACkB,GAAOC,CAAQ,IAAIF,EAAS,EAAE,GAC/BG,IAAOrB,KAASgB,GAEhBM,IAAUC,EAAA,GACVC,IAAclB,KAAmBgB,EAAQ,SAAS,aAClDG,IAAU,EAAQhB,GAClBiB,IAAkBD,KAAWhB,MAAU,IACvC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Ac;"}
1
+ {"version":3,"file":"TagInput.js","sources":["../../../src/components/ui/TagInput.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, useCallback, useState, type KeyboardEvent, type ReactNode } from 'react';\nimport { X } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { useStrings } from '@/hooks/use-strings';\nimport { formatString } from '@/lib/strings';\nimport { useFieldIds } from '@/hooks/use-field-ids';\n\nexport interface TagInputProps {\n /** Controlled list of tags. */\n value?: string[];\n /** Default tags when uncontrolled. */\n defaultValue?: string[];\n /** Called when the tag list changes. */\n onChange?: (tags: string[]) => void;\n /** Visible label rendered above the field. */\n label?: ReactNode;\n /** Visually conceal the label while keeping it for screen readers. */\n hideLabel?: boolean;\n /** Hint below the field. Hidden while `error` is set. */\n description?: ReactNode;\n /** Placeholder shown inside the inline input. */\n placeholder?: string;\n /** Maximum number of tags. */\n max?: number;\n /** Disable the editor. */\n disabled?: boolean;\n /**\n * Validation state. `true` only paints the danger border; a ReactNode also\n * renders the message below the field and wires `aria-describedby`.\n */\n error?: boolean | ReactNode;\n /** Treat these characters as separators (default: Enter + comma). */\n separators?: string[];\n /** Consumer-supplied id for the inline input. */\n id?: string;\n /** Extra ids to append to `aria-describedby`. */\n 'aria-describedby'?: string;\n 'aria-label'?: string;\n className?: string;\n}\n\n/**\n * Chip-based multi-value input. Press Enter or comma to add. Backspace on an\n * empty input removes the last tag.\n */\nexport const TagInput = forwardRef<HTMLDivElement, TagInputProps>(function TagInput(\n {\n value,\n defaultValue = [],\n onChange,\n label,\n hideLabel,\n description,\n placeholder: placeholderProp,\n max,\n disabled,\n error,\n separators = ['Enter', ','],\n id,\n 'aria-describedby': ariaDescribedby,\n 'aria-label': ariaLabel,\n className,\n },\n ref,\n) {\n const [internal, setInternal] = useState<string[]>(defaultValue);\n const [draft, setDraft] = useState('');\n const tags = value ?? internal;\n\n const strings = useStrings();\n const placeholder = placeholderProp ?? strings.tagInput.placeholder;\n const isError = Boolean(error);\n const hasErrorMessage = isError && error !== true;\n const { fieldId, helperId, errorId, describedBy } = useFieldIds(id, {\n hasHelper: Boolean(description),\n hasError: hasErrorMessage,\n extra: ariaDescribedby,\n });\n\n const update = useCallback(\n (next: string[]) => {\n if (value === undefined) setInternal(next);\n onChange?.(next);\n },\n [onChange, value],\n );\n\n const commit = (raw: string) => {\n const t = raw.trim();\n if (!t || tags.includes(t) || (max !== undefined && tags.length >= max)) return;\n update([...tags, t]);\n };\n\n const remove = (idx: number) => update(tags.filter((_, i) => i !== idx));\n\n const onKey = (e: KeyboardEvent<HTMLInputElement>) => {\n if (separators.includes(e.key)) {\n e.preventDefault();\n commit(draft);\n setDraft('');\n } else if (e.key === 'Backspace' && !draft && tags.length) {\n remove(tags.length - 1);\n }\n };\n\n return (\n <div ref={ref} className={cn('flex flex-col gap-1.5', className)}>\n {label && (\n <label\n htmlFor={fieldId}\n className={cn('text-foreground text-sm font-medium', hideLabel && 'sr-only')}\n >\n {label}\n </label>\n )}\n <div\n data-slot=\"tag-input\"\n className={cn(\n // Cap growth at ~3 chip rows and scroll inside — an unbounded field\n // pushes the surrounding layout around as tags are added.\n 'bg-card flex max-h-24 min-h-9 w-full flex-wrap items-center gap-1.5 overflow-y-auto rounded-md border px-2 py-1.5',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'focus-within:ring-offset-background focus-within:ring-2 focus-within:ring-offset-2',\n isError\n ? 'border-danger focus-within:border-danger focus-within:ring-danger'\n : 'border-border-input focus-within:border-accent focus-within:ring-ring',\n disabled && 'pointer-events-none opacity-50',\n )}\n >\n {tags.map((t, i) => (\n <span\n key={`${t}-${i}`}\n className=\"bg-background-muted inline-flex items-center gap-1 rounded-sm px-2 py-0.5 text-xs\"\n >\n {t}\n <button\n type=\"button\"\n onClick={() => remove(i)}\n // 16px glyph box + halo → ≥24px hit area (WCAG 2.5.8) without growing the chip.\n className=\"text-foreground-muted hover:bg-background-subtle hover:text-foreground focus-visible:ring-ring focus-visible:ring-offset-background relative rounded-sm p-0.5 outline-hidden before:absolute before:-inset-1.5 before:content-[''] focus-visible:ring-2 focus-visible:ring-offset-1\"\n aria-label={formatString(strings.tagInput.remove, { tag: t })}\n >\n <X className=\"size-3\" aria-hidden />\n </button>\n </span>\n ))}\n <input\n id={fieldId}\n value={draft}\n disabled={disabled}\n onChange={(e) => setDraft(e.target.value)}\n onKeyDown={onKey}\n onBlur={() => {\n if (draft) {\n commit(draft);\n setDraft('');\n }\n }}\n placeholder={tags.length === 0 ? placeholder : undefined}\n // Unlabelled field: fall back to the placeholder. A consumer `id`\n // implies an external <label htmlFor>.\n aria-label={ariaLabel ?? (label || id ? undefined : placeholder)}\n aria-invalid={isError || undefined}\n aria-describedby={describedBy}\n className=\"placeholder:text-foreground-subtle min-w-[8ch] flex-1 bg-transparent text-lg outline-hidden md:text-sm\"\n />\n </div>\n {hasErrorMessage ? (\n <p id={errorId} className=\"text-danger-text text-xs\">\n {error}\n </p>\n ) : description ? (\n <p id={helperId} className=\"text-foreground-subtle text-xs\">\n {description}\n </p>\n ) : null}\n </div>\n );\n});\nTagInput.displayName = 'TagInput';\n"],"names":["TagInput","forwardRef","value","defaultValue","onChange","label","hideLabel","description","placeholderProp","max","disabled","error","separators","id","ariaDescribedby","ariaLabel","className","ref","internal","setInternal","useState","draft","setDraft","tags","strings","useStrings","placeholder","isError","hasErrorMessage","fieldId","helperId","errorId","describedBy","useFieldIds","update","useCallback","next","commit","raw","t","remove","idx","_","i","onKey","cn","jsx","jsxs","formatString","X"],"mappings":";;;;;;;;AA+CO,MAAMA,IAAWC,EAA0C,SAChE;AAAA,EACE,OAAAC;AAAA,EACA,cAAAC,IAAe,CAAA;AAAA,EACf,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAaC;AAAA,EACb,KAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC,IAAa,CAAC,SAAS,GAAG;AAAA,EAC1B,IAAAC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gBAAcC,KAAW;AAAA,cACzB,oBAAkBK;AAAA,cAClB,WAAU;AAAA,YAAA;AAAA,UAAA;AAAA,QACZ;AAAA,MAAA;AAAA,IAAA;AAAA,IAEDJ,IACC,gBAAAkB,EAAC,KAAA,EAAE,IAAIf,GAAS,WAAU,4BACvB,UAAApB,EAAA,CACH,IACEJ,sBACD,KAAA,EAAE,IAAIuB,GAAU,WAAU,kCACxB,aACH,IACE;AAAA,EAAA,GACN;AAEJ,CAAC;AACD9B,EAAS,cAAc;"}
@@ -67,7 +67,7 @@ const G = $(function({
67
67
  "bg-card text-foreground rounded-md border px-3 py-2 text-lg md:text-sm",
68
68
  "placeholder:text-foreground-subtle",
69
69
  "transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]",
70
- "outline-none",
70
+ "outline-hidden",
71
71
  "focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2",
72
72
  "focus-visible:ring-offset-background",
73
73
  "disabled:cursor-not-allowed disabled:opacity-50",
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.js","sources":["../../../src/components/ui/Textarea.tsx"],"sourcesContent":["'use client';\n\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n type TextareaHTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { cn } from '@/lib/utils';\nimport { useFieldIds } from '@/hooks/use-field-ids';\n\nexport interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {\n /** Visible label above the field. */\n label?: ReactNode;\n /** Hint below the field. Hidden when `error` is set. */\n helperText?: ReactNode;\n /** Validation message. Sets `aria-invalid`. */\n error?: ReactNode;\n /** Grow vertically as content is added. */\n autoResize?: boolean;\n /** Minimum rows when `autoResize`. Defaults to 3. */\n minRows?: number;\n /** Maximum rows before scrolling when `autoResize`. Defaults to 12. */\n maxRows?: number;\n /** Visually hide the label while keeping it accessible. */\n hideLabel?: boolean;\n}\n\n/**\n * Multi-line text input. With `autoResize`, height tracks content from\n * `minRows` to `maxRows`. Without it, behaves like a native `<textarea>`.\n *\n * @example Comment box\n * <Textarea label=\"Note\" autoResize minRows={3} maxRows={10} />\n *\n * @example With error\n * <Textarea label=\"Description\"\n * error={errors.description?.message}\n * {...register('description')} />\n *\n * @do Default to `autoResize` for multi-line free-form input.\n * @dont Add `resize-none` without auto-resize — users will be stuck with a\n * 3-line box for long content.\n */\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea(\n {\n className,\n label,\n helperText,\n error,\n autoResize,\n minRows = 3,\n maxRows = 12,\n hideLabel,\n id,\n onChange,\n value,\n defaultValue,\n 'aria-describedby': ariaDescribedby,\n 'aria-invalid': ariaInvalid,\n ...props\n },\n ref,\n) {\n const isError = Boolean(error) || ariaInvalid === true || ariaInvalid === 'true';\n const { fieldId, helperId, errorId, describedBy } = useFieldIds(id, {\n hasHelper: Boolean(helperText),\n hasError: Boolean(error),\n extra: ariaDescribedby,\n });\n const innerRef = useRef<HTMLTextAreaElement | null>(null);\n\n // Stash a ref locally and forward to the consumer.\n const setRef = (node: HTMLTextAreaElement | null) => {\n innerRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as React.MutableRefObject<HTMLTextAreaElement | null>).current = node;\n };\n\n const recompute = useCallback(() => {\n const el = innerRef.current;\n if (!el || !autoResize) return;\n const cs = getComputedStyle(el);\n const lineHeight = parseFloat(cs.lineHeight) || 20;\n // scrollHeight includes padding but not borders; the element is border-box.\n const padding = (parseFloat(cs.paddingTop) || 0) + (parseFloat(cs.paddingBottom) || 0);\n const border = (parseFloat(cs.borderTopWidth) || 0) + (parseFloat(cs.borderBottomWidth) || 0);\n const minH = lineHeight * minRows + padding + border;\n const maxH = lineHeight * maxRows + padding + border;\n el.style.height = 'auto';\n const content = el.scrollHeight + border;\n el.style.height = `${Math.min(Math.max(content, minH), maxH)}px`;\n el.style.overflowY = content > maxH ? 'auto' : 'hidden';\n }, [autoResize, minRows, maxRows]);\n\n useEffect(() => {\n if (autoResize) recompute();\n }, [autoResize, recompute, value, defaultValue]);\n\n // Width changes re-wrap the text, so recompute on resize too.\n useEffect(() => {\n const el = innerRef.current;\n if (!autoResize || !el || typeof ResizeObserver === 'undefined') return;\n const ro = new ResizeObserver(() => recompute());\n ro.observe(el);\n return () => ro.disconnect();\n }, [autoResize, recompute]);\n\n return (\n <div data-slot=\"textarea-field\" className={cn('flex flex-col gap-1.5', className)}>\n {label && (\n <label\n htmlFor={fieldId}\n className={cn('text-foreground text-sm font-medium', hideLabel && 'sr-only')}\n >\n {label}\n </label>\n )}\n <textarea\n ref={setRef}\n id={fieldId}\n rows={minRows}\n value={value}\n defaultValue={defaultValue}\n onChange={(e) => {\n onChange?.(e);\n if (autoResize) recompute();\n }}\n aria-invalid={isError ? true : ariaInvalid}\n aria-describedby={describedBy}\n className={cn(\n 'bg-card text-foreground rounded-md border px-3 py-2 text-lg md:text-sm',\n 'placeholder:text-foreground-subtle',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'outline-none',\n 'focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2',\n 'focus-visible:ring-offset-background',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'border-border-input focus-visible:border-accent',\n 'aria-invalid:border-danger aria-invalid:focus-visible:border-danger aria-invalid:focus-visible:ring-danger',\n autoResize ? 'resize-none' : 'min-h-20 resize-y',\n )}\n {...props}\n />\n {error ? (\n <p id={errorId} className=\"text-danger-text text-xs\">\n {error}\n </p>\n ) : helperText ? (\n <p id={helperId} className=\"text-foreground-subtle text-xs\">\n {helperText}\n </p>\n ) : null}\n </div>\n );\n});\n\nTextarea.displayName = 'Textarea';\n"],"names":["Textarea","forwardRef","className","label","helperText","error","autoResize","minRows","maxRows","hideLabel","id","onChange","value","defaultValue","ariaDescribedby","ariaInvalid","props","ref","isError","fieldId","helperId","errorId","describedBy","useFieldIds","innerRef","useRef","setRef","node","recompute","useCallback","el","cs","lineHeight","padding","border","minH","maxH","content","useEffect","ro","jsxs","cn","jsx"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B,GAAGU;AAAA,MAAA;AAAA,IAAA;AAAA,IAELX,IACC,gBAAAqC,EAAC,KAAA,EAAE,IAAIrB,GAAS,WAAU,4BACvB,UAAAhB,EAAA,CACH,IACED,sBACD,KAAA,EAAE,IAAIgB,GAAU,WAAU,kCACxB,aACH,IACE;AAAA,EAAA,GACN;AAEJ,CAAC;AAEDpB,EAAS,cAAc;"}
1
+ {"version":3,"file":"Textarea.js","sources":["../../../src/components/ui/Textarea.tsx"],"sourcesContent":["'use client';\n\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n type TextareaHTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { cn } from '@/lib/utils';\nimport { useFieldIds } from '@/hooks/use-field-ids';\n\nexport interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {\n /** Visible label above the field. */\n label?: ReactNode;\n /** Hint below the field. Hidden when `error` is set. */\n helperText?: ReactNode;\n /** Validation message. Sets `aria-invalid`. */\n error?: ReactNode;\n /** Grow vertically as content is added. */\n autoResize?: boolean;\n /** Minimum rows when `autoResize`. Defaults to 3. */\n minRows?: number;\n /** Maximum rows before scrolling when `autoResize`. Defaults to 12. */\n maxRows?: number;\n /** Visually hide the label while keeping it accessible. */\n hideLabel?: boolean;\n}\n\n/**\n * Multi-line text input. With `autoResize`, height tracks content from\n * `minRows` to `maxRows`. Without it, behaves like a native `<textarea>`.\n *\n * @example Comment box\n * <Textarea label=\"Note\" autoResize minRows={3} maxRows={10} />\n *\n * @example With error\n * <Textarea label=\"Description\"\n * error={errors.description?.message}\n * {...register('description')} />\n *\n * @do Default to `autoResize` for multi-line free-form input.\n * @dont Add `resize-none` without auto-resize — users will be stuck with a\n * 3-line box for long content.\n */\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea(\n {\n className,\n label,\n helperText,\n error,\n autoResize,\n minRows = 3,\n maxRows = 12,\n hideLabel,\n id,\n onChange,\n value,\n defaultValue,\n 'aria-describedby': ariaDescribedby,\n 'aria-invalid': ariaInvalid,\n ...props\n },\n ref,\n) {\n const isError = Boolean(error) || ariaInvalid === true || ariaInvalid === 'true';\n const { fieldId, helperId, errorId, describedBy } = useFieldIds(id, {\n hasHelper: Boolean(helperText),\n hasError: Boolean(error),\n extra: ariaDescribedby,\n });\n const innerRef = useRef<HTMLTextAreaElement | null>(null);\n\n // Stash a ref locally and forward to the consumer.\n const setRef = (node: HTMLTextAreaElement | null) => {\n innerRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as React.MutableRefObject<HTMLTextAreaElement | null>).current = node;\n };\n\n const recompute = useCallback(() => {\n const el = innerRef.current;\n if (!el || !autoResize) return;\n const cs = getComputedStyle(el);\n const lineHeight = parseFloat(cs.lineHeight) || 20;\n // scrollHeight includes padding but not borders; the element is border-box.\n const padding = (parseFloat(cs.paddingTop) || 0) + (parseFloat(cs.paddingBottom) || 0);\n const border = (parseFloat(cs.borderTopWidth) || 0) + (parseFloat(cs.borderBottomWidth) || 0);\n const minH = lineHeight * minRows + padding + border;\n const maxH = lineHeight * maxRows + padding + border;\n el.style.height = 'auto';\n const content = el.scrollHeight + border;\n el.style.height = `${Math.min(Math.max(content, minH), maxH)}px`;\n el.style.overflowY = content > maxH ? 'auto' : 'hidden';\n }, [autoResize, minRows, maxRows]);\n\n useEffect(() => {\n if (autoResize) recompute();\n }, [autoResize, recompute, value, defaultValue]);\n\n // Width changes re-wrap the text, so recompute on resize too.\n useEffect(() => {\n const el = innerRef.current;\n if (!autoResize || !el || typeof ResizeObserver === 'undefined') return;\n const ro = new ResizeObserver(() => recompute());\n ro.observe(el);\n return () => ro.disconnect();\n }, [autoResize, recompute]);\n\n return (\n <div data-slot=\"textarea-field\" className={cn('flex flex-col gap-1.5', className)}>\n {label && (\n <label\n htmlFor={fieldId}\n className={cn('text-foreground text-sm font-medium', hideLabel && 'sr-only')}\n >\n {label}\n </label>\n )}\n <textarea\n ref={setRef}\n id={fieldId}\n rows={minRows}\n value={value}\n defaultValue={defaultValue}\n onChange={(e) => {\n onChange?.(e);\n if (autoResize) recompute();\n }}\n aria-invalid={isError ? true : ariaInvalid}\n aria-describedby={describedBy}\n className={cn(\n 'bg-card text-foreground rounded-md border px-3 py-2 text-lg md:text-sm',\n 'placeholder:text-foreground-subtle',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'outline-hidden',\n 'focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2',\n 'focus-visible:ring-offset-background',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'border-border-input focus-visible:border-accent',\n 'aria-invalid:border-danger aria-invalid:focus-visible:border-danger aria-invalid:focus-visible:ring-danger',\n autoResize ? 'resize-none' : 'min-h-20 resize-y',\n )}\n {...props}\n />\n {error ? (\n <p id={errorId} className=\"text-danger-text text-xs\">\n {error}\n </p>\n ) : helperText ? (\n <p id={helperId} className=\"text-foreground-subtle text-xs\">\n {helperText}\n </p>\n ) : null}\n </div>\n );\n});\n\nTextarea.displayName = 'Textarea';\n"],"names":["Textarea","forwardRef","className","label","helperText","error","autoResize","minRows","maxRows","hideLabel","id","onChange","value","defaultValue","ariaDescribedby","ariaInvalid","props","ref","isError","fieldId","helperId","errorId","describedBy","useFieldIds","innerRef","useRef","setRef","node","recompute","useCallback","el","cs","lineHeight","padding","border","minH","maxH","content","useEffect","ro","jsxs","cn","jsx"],"mappings":";;;;;AA8CO,MAAMA,IAAWC,EAA+C,SACrE;AAAA,EACE,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,SAAAC,IAAU;AAAA,EACV,WAAAC;AAAA,EACA,IAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,oBAAoBC;AAAA,EACpB,gBAAgBC;AAAA,EAChB,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAU,EAAQb,KAAUU,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,UAAMS,IAAK,IAAI,eAAe,MAAMX,GAAW;AAC/C,WAAAW,EAAG,QAAQT,CAAE,GACN,MAAMS,EAAG,WAAA;AAAA,EAClB,GAAG,CAACjC,GAAYsB,CAAS,CAAC,GAGxB,gBAAAY,EAAC,SAAI,aAAU,kBAAiB,WAAWC,EAAG,yBAAyBvC,CAAS,GAC7E,UAAA;AAAA,IAAAC,KACC,gBAAAuC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,SAASvB;AAAA,QACT,WAAWsB,EAAG,uCAAuChC,KAAa,SAAS;AAAA,QAE1E,UAAAN;AAAA,MAAA;AAAA,IAAA;AAAA,IAGL,gBAAAuC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAKhB;AAAA,QACL,IAAIP;AAAA,QACJ,MAAMZ;AAAA,QACN,OAAAK;AAAA,QACA,cAAAC;AAAA,QACA,UAAU,CAAC,MAAM;AACf,UAAAF,KAAA,QAAAA,EAAW,IACPL,KAAYsB,EAAA;AAAA,QAClB;AAAA,QACA,gBAAcV,IAAU,KAAOH;AAAA,QAC/B,oBAAkBO;AAAA,QAClB,WAAWmB;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACAnC,IAAa,gBAAgB;AAAA,QAAA;AAAA,QAE9B,GAAGU;AAAA,MAAA;AAAA,IAAA;AAAA,IAELX,IACC,gBAAAqC,EAAC,KAAA,EAAE,IAAIrB,GAAS,WAAU,4BACvB,UAAAhB,EAAA,CACH,IACED,sBACD,KAAA,EAAE,IAAIgB,GAAU,WAAU,kCACxB,aACH,IACE;AAAA,EAAA,GACN;AAEJ,CAAC;AAEDpB,EAAS,cAAc;"}
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsxs as f, jsx as s } from "react/jsx-runtime";
3
- import { forwardRef as l, useEffect as h } from "react";
3
+ import { forwardRef as l, useEffect as v } from "react";
4
4
  import * as n from "@radix-ui/react-toast";
5
5
  import { X as T, Info as w, XCircle as N, AlertTriangle as y, CheckCircle2 as C } from "../../icons/index.js";
6
6
  import { cn as c } from "../../lib/utils.js";
@@ -96,7 +96,7 @@ const b = l(function({ className: a, ...e }, o) {
96
96
  ref: o,
97
97
  className: c(
98
98
  "inline-flex h-8 shrink-0 items-center justify-center rounded-md border border-current bg-transparent px-3 text-sm font-medium",
99
- "transition-colors outline-none hover:bg-current/10",
99
+ "outline-hidden transition-colors hover:bg-current/10",
100
100
  "focus-visible:ring-ring focus-visible:ring-offset-card focus-visible:ring-2 focus-visible:ring-offset-2",
101
101
  a
102
102
  ),
@@ -105,7 +105,7 @@ const b = l(function({ className: a, ...e }, o) {
105
105
  );
106
106
  });
107
107
  b.displayName = "ToastAction";
108
- const v = l(function({ className: a, ...e }, o) {
108
+ const h = l(function({ className: a, ...e }, o) {
109
109
  const t = m();
110
110
  return /* @__PURE__ */ s(
111
111
  n.Close,
@@ -115,7 +115,7 @@ const v = l(function({ className: a, ...e }, o) {
115
115
  className: c(
116
116
  "text-foreground-subtle absolute top-2 right-2 inline-flex size-7 items-center justify-center rounded-md",
117
117
  "hover:text-foreground opacity-0 transition-opacity group-hover:opacity-100",
118
- "focus-visible:ring-ring focus-visible:ring-offset-card outline-none focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2",
118
+ "focus-visible:ring-ring focus-visible:ring-offset-card outline-hidden focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2",
119
119
  a
120
120
  ),
121
121
  "toast-close": "",
@@ -124,10 +124,10 @@ const v = l(function({ className: a, ...e }, o) {
124
124
  }
125
125
  );
126
126
  });
127
- v.displayName = "ToastClose";
127
+ h.displayName = "ToastClose";
128
128
  function D() {
129
129
  const { toasts: i, dismiss: a, remove: e } = k();
130
- h(() => {
130
+ v(() => {
131
131
  const t = i.filter((d) => !d.open);
132
132
  if (t.length === 0) return;
133
133
  const r = t.map((d) => window.setTimeout(() => e(d.id), 200));
@@ -148,7 +148,7 @@ function D() {
148
148
  t.title && /* @__PURE__ */ s(g, { children: t.title }),
149
149
  t.description && /* @__PURE__ */ s(x, { children: t.description }),
150
150
  t.action && /* @__PURE__ */ s(b, { altText: t.action.altText, onClick: t.action.onClick, className: "mt-1", children: t.action.label }),
151
- /* @__PURE__ */ s(v, {})
151
+ /* @__PURE__ */ s(h, {})
152
152
  ]
153
153
  },
154
154
  t.id
@@ -160,7 +160,7 @@ D.displayName = "Toaster";
160
160
  export {
161
161
  p as Toast,
162
162
  b as ToastAction,
163
- v as ToastClose,
163
+ h as ToastClose,
164
164
  x as ToastDescription,
165
165
  A as ToastProvider,
166
166
  g as ToastTitle,
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.js","sources":["../../../src/components/ui/Toast.tsx"],"sourcesContent":["'use client';\n\nimport {\n forwardRef,\n useEffect,\n type ComponentPropsWithoutRef,\n type ComponentRef,\n type ReactElement,\n} from 'react';\nimport * as ToastPrimitive from '@radix-ui/react-toast';\nimport { AlertTriangle, CheckCircle2, Info, X, XCircle } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { useStrings } from '@/hooks/use-strings';\nimport { cva, type VariantProps } from '@/lib/cva';\nimport { useToast } from '@/hooks/use-toast';\n\nexport const ToastProvider = ToastPrimitive.Provider;\n\nexport const ToastViewport = forwardRef<\n ComponentRef<typeof ToastPrimitive.Viewport>,\n ComponentPropsWithoutRef<typeof ToastPrimitive.Viewport>\n>(function ToastViewport({ className, label, ...props }, ref) {\n const strings = useStrings();\n return (\n <ToastPrimitive.Viewport\n data-slot=\"toast-viewport\"\n ref={ref}\n // Radix's default is \"Notifications ({hotkey})\" — route it through the\n // strings so the region landmark is localised like the rest.\n label={label ?? strings.toast.region}\n className={cn(\n 'fixed right-0 bottom-0 z-[var(--z-toast)] flex max-h-dvh w-full flex-col-reverse gap-2 p-6',\n // Respect notched/home-indicator insets (consumers set viewport-fit=cover).\n 'pr-[max(1.5rem,env(safe-area-inset-right))] pb-[max(1.5rem,env(safe-area-inset-bottom))] pl-[max(1.5rem,env(safe-area-inset-left))]',\n 'sm:top-4 sm:right-4 sm:bottom-auto sm:max-w-sm sm:flex-col',\n className,\n )}\n {...props}\n />\n );\n});\nToastViewport.displayName = 'ToastViewport';\n\nconst toast = cva(\n [\n 'group pointer-events-auto relative flex w-full items-start gap-3',\n 'overflow-hidden rounded-lg border p-4 pr-8 shadow-md',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-80 data-[state=open]:slide-in-from-right-full',\n 'data-[state=closed]:slide-out-to-right-full',\n 'data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)]',\n 'data-[swipe=cancel]:translate-x-0 data-[swipe=cancel]:transition-transform',\n 'data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)]',\n ],\n {\n variants: {\n variant: {\n default: 'border-border bg-card text-card-foreground',\n success: 'border-success-border-soft bg-success-soft text-success-text',\n warning: 'border-warning-border-soft bg-warning-soft text-warning-text',\n danger: 'border-danger-border-soft bg-danger-soft text-danger-text',\n info: 'border-info-border-soft bg-info-soft text-info-text',\n },\n },\n defaultVariants: { variant: 'default' },\n },\n);\n\nconst iconMap = {\n default: null,\n success: <CheckCircle2 className=\"text-success-text mt-0.5 size-5 shrink-0\" aria-hidden />,\n warning: <AlertTriangle className=\"text-warning-text mt-0.5 size-5 shrink-0\" aria-hidden />,\n danger: <XCircle className=\"text-danger-text mt-0.5 size-5 shrink-0\" aria-hidden />,\n info: <Info className=\"text-info-text mt-0.5 size-5 shrink-0\" aria-hidden />,\n} satisfies Record<'default' | 'success' | 'warning' | 'danger' | 'info', ReactElement | null>;\n\nexport interface ToastProps\n extends ComponentPropsWithoutRef<typeof ToastPrimitive.Root>, VariantProps<typeof toast> {}\n\nexport const Toast = forwardRef<ComponentRef<typeof ToastPrimitive.Root>, ToastProps>(\n function Toast({ className, variant = 'default', children, ...props }, ref) {\n return (\n <ToastPrimitive.Root\n ref={ref}\n data-slot=\"toast\"\n className={cn(toast({ variant }), className)}\n {...props}\n >\n {iconMap[variant ?? 'default']}\n <div className=\"flex-1 space-y-1\">{children}</div>\n </ToastPrimitive.Root>\n );\n },\n);\nToast.displayName = 'Toast';\n\nexport const ToastTitle = forwardRef<\n ComponentRef<typeof ToastPrimitive.Title>,\n ComponentPropsWithoutRef<typeof ToastPrimitive.Title>\n>(function ToastTitle({ className, ...props }, ref) {\n return (\n <ToastPrimitive.Title ref={ref} className={cn('text-sm font-medium', className)} {...props} />\n );\n});\nToastTitle.displayName = 'ToastTitle';\n\nexport const ToastDescription = forwardRef<\n ComponentRef<typeof ToastPrimitive.Description>,\n ComponentPropsWithoutRef<typeof ToastPrimitive.Description>\n>(function ToastDescription({ className, ...props }, ref) {\n return (\n <ToastPrimitive.Description\n ref={ref}\n className={cn('text-sm opacity-90', className)}\n {...props}\n />\n );\n});\nToastDescription.displayName = 'ToastDescription';\n\nexport const ToastAction = forwardRef<\n ComponentRef<typeof ToastPrimitive.Action>,\n ComponentPropsWithoutRef<typeof ToastPrimitive.Action>\n>(function ToastAction({ className, ...props }, ref) {\n return (\n <ToastPrimitive.Action\n ref={ref}\n className={cn(\n 'inline-flex h-8 shrink-0 items-center justify-center rounded-md border border-current bg-transparent px-3 text-sm font-medium',\n 'transition-colors outline-none hover:bg-current/10',\n 'focus-visible:ring-ring focus-visible:ring-offset-card focus-visible:ring-2 focus-visible:ring-offset-2',\n className,\n )}\n {...props}\n />\n );\n});\nToastAction.displayName = 'ToastAction';\n\nexport const ToastClose = forwardRef<\n ComponentRef<typeof ToastPrimitive.Close>,\n ComponentPropsWithoutRef<typeof ToastPrimitive.Close>\n>(function ToastClose({ className, ...props }, ref) {\n const strings = useStrings();\n return (\n <ToastPrimitive.Close\n ref={ref}\n aria-label={props['aria-label'] ?? strings.toast.close}\n className={cn(\n 'text-foreground-subtle absolute top-2 right-2 inline-flex size-7 items-center justify-center rounded-md',\n 'hover:text-foreground opacity-0 transition-opacity group-hover:opacity-100',\n 'focus-visible:ring-ring focus-visible:ring-offset-card outline-none focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2',\n className,\n )}\n toast-close=\"\"\n {...props}\n >\n <X className=\"size-4\" aria-hidden />\n </ToastPrimitive.Close>\n );\n});\nToastClose.displayName = 'ToastClose';\n\n/**\n * Drop-in host that connects the `useToast()` queue to the Radix primitives.\n * Mount it once near your app root — then `useToast().push({...})` (or the\n * standalone `toast()`) from anywhere renders here. Self-contained: it brings\n * its own ToastProvider + Viewport, so no other Toast wiring is needed.\n *\n * @example\n * function App() {\n * return (\n * <>\n * <Routes />\n * <Toaster />\n * </>\n * );\n * }\n */\nexport function Toaster() {\n const { toasts, dismiss, remove } = useToast();\n\n // Closing a toast sets open:false so Radix can play the slide-out; drop it\n // from the queue once that animation has had time to finish.\n useEffect(() => {\n const closing = toasts.filter((t) => !t.open);\n if (closing.length === 0) return;\n const timers = closing.map((t) => window.setTimeout(() => remove(t.id), 200));\n return () => timers.forEach((id) => window.clearTimeout(id));\n }, [toasts, remove]);\n\n const strings = useStrings();\n return (\n <ToastProvider label={strings.toast.region}>\n {toasts.map((t) => (\n <Toast\n key={t.id}\n variant={t.variant ?? 'default'}\n open={t.open}\n // Radix treats 0 as \"dismiss immediately\"; the queue's 0 means \"keep open\".\n duration={t.duration === 0 ? Infinity : t.duration}\n onOpenChange={(open) => {\n if (!open) dismiss(t.id);\n }}\n >\n {t.title && <ToastTitle>{t.title}</ToastTitle>}\n {t.description && <ToastDescription>{t.description}</ToastDescription>}\n {t.action && (\n <ToastAction altText={t.action.altText} onClick={t.action.onClick} className=\"mt-1\">\n {t.action.label}\n </ToastAction>\n )}\n <ToastClose />\n </Toast>\n ))}\n <ToastViewport />\n </ToastProvider>\n );\n}\nToaster.displayName = 'Toaster';\n\n/**\n * @example\n * <ToastProvider>\n * …app…\n * <Toast variant=\"success\">\n * <ToastTitle>Saved</ToastTitle>\n * <ToastDescription>Your changes are live.</ToastDescription>\n * <ToastAction altText=\"Undo\">Undo</ToastAction>\n * <ToastClose />\n * </Toast>\n * <ToastViewport />\n * </ToastProvider>\n *\n * @do Use the `useToast()` hook (in `src/hooks/use-toast.ts`) in app code —\n * the components here are the primitives the hook renders.\n * @dont Stack more than two toasts at a time. Newer toasts replace older ones.\n */\n"],"names":["ToastProvider","ToastPrimitive","ToastViewport","forwardRef","className","label","props","ref","strings","useStrings","jsx","cn","toast","cva","iconMap","CheckCircle2","AlertTriangle","XCircle","Info","Toast","variant","children","jsxs","ToastTitle","ToastDescription","ToastAction","ToastClose","X","Toaster","toasts","dismiss","remove","useToast","useEffect","closing","t","timers","id","open"],"mappings":";;;;;;;;;AAgBO,MAAMA,IAAgBC,EAAe,UAE/BC,IAAgBC,EAG3B,SAAuB,EAAE,WAAAC,GAAW,OAAAC,GAAO,GAAGC,EAAA,GAASC,GAAK;AAC5D,QAAMC,IAAUC,EAAA;AAChB,SACE,gBAAAC;AAAA,IAACT,EAAe;AAAA,IAAf;AAAA,MACC,aAAU;AAAA,MACV,KAAAM;AAAA,MAGA,OAAOF,KAASG,EAAQ,MAAM;AAAA,MAC9B,WAAWG;AAAA,QACT;AAAA;AAAA,QAEA;AAAA,QACA;AAAA,QACAP;AAAA,MAAA;AAAA,MAED,GAAGE;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;AACDJ,EAAc,cAAc;AAE5B,MAAMU,IAAQC;AAAA,EACZ;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAAA,EAEF;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,SAAS;AAAA,QACT,SAAS;AAAA,QACT,QAAQ;AAAA,QACR,MAAM;AAAA,MAAA;AAAA,IACR;AAAA,IAEF,iBAAiB,EAAE,SAAS,UAAA;AAAA,EAAU;AAE1C,GAEMC,IAAU;AAAA,EACd,SAAS;AAAA,EACT,SAAS,gBAAAJ,EA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C,EAAA;AAChB,SACE,gBAAAa,EAACtB,GAAA,EAAc,OAAOQ,EAAQ,MAAM,QACjC,UAAA;AAAA,IAAAqB,EAAO,IAAI,CAAC,MACX,gBAAAP;AAAA,MAACH;AAAA,MAAA;AAAA,QAEC,SAAS,EAAE,WAAW;AAAA,QACtB,MAAM,EAAE;AAAA,QAER,UAAU,EAAE,aAAa,IAAI,QAAW,EAAE;AAAA,QAC1C,cAAc,CAACmB,MAAS;AACtB,UAAKA,KAAMR,EAAQ,EAAE,EAAE;AAAA,QACzB;AAAA,QAEC,UAAA;AAAA,UAAA,EAAE,SAAS,gBAAApB,EAACa,GAAA,EAAY,UAAA,EAAE,OAAM;AAAA,UAChC,EAAE,eAAe,gBAAAb,EAACc,GAAA,EAAkB,YAAE,aAAY;AAAA,UAClD,EAAE,UACD,gBAAAd,EAACe,GAAA,EAAY,SAAS,EAAE,OAAO,SAAS,SAAS,EAAE,OAAO,SAAS,WAAU,QAC1E,UAAA,EAAE,OAAO,OACZ;AAAA,4BAEDC,GAAA,CAAA,CAAW;AAAA,QAAA;AAAA,MAAA;AAAA,MAhBP,EAAE;AAAA,IAAA,CAkBV;AAAA,sBACAxB,GAAA,CAAA,CAAc;AAAA,EAAA,GACjB;AAEJ;AACA0B,EAAQ,cAAc;"}
1
+ {"version":3,"file":"Toast.js","sources":["../../../src/components/ui/Toast.tsx"],"sourcesContent":["'use client';\n\nimport {\n forwardRef,\n useEffect,\n type ComponentPropsWithoutRef,\n type ComponentRef,\n type ReactElement,\n} from 'react';\nimport * as ToastPrimitive from '@radix-ui/react-toast';\nimport { AlertTriangle, CheckCircle2, Info, X, XCircle } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { useStrings } from '@/hooks/use-strings';\nimport { cva, type VariantProps } from '@/lib/cva';\nimport { useToast } from '@/hooks/use-toast';\n\nexport const ToastProvider = ToastPrimitive.Provider;\n\nexport const ToastViewport = forwardRef<\n ComponentRef<typeof ToastPrimitive.Viewport>,\n ComponentPropsWithoutRef<typeof ToastPrimitive.Viewport>\n>(function ToastViewport({ className, label, ...props }, ref) {\n const strings = useStrings();\n return (\n <ToastPrimitive.Viewport\n data-slot=\"toast-viewport\"\n ref={ref}\n // Radix's default is \"Notifications ({hotkey})\" — route it through the\n // strings so the region landmark is localised like the rest.\n label={label ?? strings.toast.region}\n className={cn(\n 'fixed right-0 bottom-0 z-[var(--z-toast)] flex max-h-dvh w-full flex-col-reverse gap-2 p-6',\n // Respect notched/home-indicator insets (consumers set viewport-fit=cover).\n 'pr-[max(1.5rem,env(safe-area-inset-right))] pb-[max(1.5rem,env(safe-area-inset-bottom))] pl-[max(1.5rem,env(safe-area-inset-left))]',\n 'sm:top-4 sm:right-4 sm:bottom-auto sm:max-w-sm sm:flex-col',\n className,\n )}\n {...props}\n />\n );\n});\nToastViewport.displayName = 'ToastViewport';\n\nconst toast = cva(\n [\n 'group pointer-events-auto relative flex w-full items-start gap-3',\n 'overflow-hidden rounded-lg border p-4 pr-8 shadow-md',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-80 data-[state=open]:slide-in-from-right-full',\n 'data-[state=closed]:slide-out-to-right-full',\n 'data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)]',\n 'data-[swipe=cancel]:translate-x-0 data-[swipe=cancel]:transition-transform',\n 'data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)]',\n ],\n {\n variants: {\n variant: {\n default: 'border-border bg-card text-card-foreground',\n success: 'border-success-border-soft bg-success-soft text-success-text',\n warning: 'border-warning-border-soft bg-warning-soft text-warning-text',\n danger: 'border-danger-border-soft bg-danger-soft text-danger-text',\n info: 'border-info-border-soft bg-info-soft text-info-text',\n },\n },\n defaultVariants: { variant: 'default' },\n },\n);\n\nconst iconMap = {\n default: null,\n success: <CheckCircle2 className=\"text-success-text mt-0.5 size-5 shrink-0\" aria-hidden />,\n warning: <AlertTriangle className=\"text-warning-text mt-0.5 size-5 shrink-0\" aria-hidden />,\n danger: <XCircle className=\"text-danger-text mt-0.5 size-5 shrink-0\" aria-hidden />,\n info: <Info className=\"text-info-text mt-0.5 size-5 shrink-0\" aria-hidden />,\n} satisfies Record<'default' | 'success' | 'warning' | 'danger' | 'info', ReactElement | null>;\n\nexport interface ToastProps\n extends ComponentPropsWithoutRef<typeof ToastPrimitive.Root>, VariantProps<typeof toast> {}\n\nexport const Toast = forwardRef<ComponentRef<typeof ToastPrimitive.Root>, ToastProps>(\n function Toast({ className, variant = 'default', children, ...props }, ref) {\n return (\n <ToastPrimitive.Root\n ref={ref}\n data-slot=\"toast\"\n className={cn(toast({ variant }), className)}\n {...props}\n >\n {iconMap[variant ?? 'default']}\n <div className=\"flex-1 space-y-1\">{children}</div>\n </ToastPrimitive.Root>\n );\n },\n);\nToast.displayName = 'Toast';\n\nexport const ToastTitle = forwardRef<\n ComponentRef<typeof ToastPrimitive.Title>,\n ComponentPropsWithoutRef<typeof ToastPrimitive.Title>\n>(function ToastTitle({ className, ...props }, ref) {\n return (\n <ToastPrimitive.Title ref={ref} className={cn('text-sm font-medium', className)} {...props} />\n );\n});\nToastTitle.displayName = 'ToastTitle';\n\nexport const ToastDescription = forwardRef<\n ComponentRef<typeof ToastPrimitive.Description>,\n ComponentPropsWithoutRef<typeof ToastPrimitive.Description>\n>(function ToastDescription({ className, ...props }, ref) {\n return (\n <ToastPrimitive.Description\n ref={ref}\n className={cn('text-sm opacity-90', className)}\n {...props}\n />\n );\n});\nToastDescription.displayName = 'ToastDescription';\n\nexport const ToastAction = forwardRef<\n ComponentRef<typeof ToastPrimitive.Action>,\n ComponentPropsWithoutRef<typeof ToastPrimitive.Action>\n>(function ToastAction({ className, ...props }, ref) {\n return (\n <ToastPrimitive.Action\n ref={ref}\n className={cn(\n 'inline-flex h-8 shrink-0 items-center justify-center rounded-md border border-current bg-transparent px-3 text-sm font-medium',\n 'outline-hidden transition-colors hover:bg-current/10',\n 'focus-visible:ring-ring focus-visible:ring-offset-card focus-visible:ring-2 focus-visible:ring-offset-2',\n className,\n )}\n {...props}\n />\n );\n});\nToastAction.displayName = 'ToastAction';\n\nexport const ToastClose = forwardRef<\n ComponentRef<typeof ToastPrimitive.Close>,\n ComponentPropsWithoutRef<typeof ToastPrimitive.Close>\n>(function ToastClose({ className, ...props }, ref) {\n const strings = useStrings();\n return (\n <ToastPrimitive.Close\n ref={ref}\n aria-label={props['aria-label'] ?? strings.toast.close}\n className={cn(\n 'text-foreground-subtle absolute top-2 right-2 inline-flex size-7 items-center justify-center rounded-md',\n 'hover:text-foreground opacity-0 transition-opacity group-hover:opacity-100',\n 'focus-visible:ring-ring focus-visible:ring-offset-card outline-hidden focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2',\n className,\n )}\n toast-close=\"\"\n {...props}\n >\n <X className=\"size-4\" aria-hidden />\n </ToastPrimitive.Close>\n );\n});\nToastClose.displayName = 'ToastClose';\n\n/**\n * Drop-in host that connects the `useToast()` queue to the Radix primitives.\n * Mount it once near your app root — then `useToast().push({...})` (or the\n * standalone `toast()`) from anywhere renders here. Self-contained: it brings\n * its own ToastProvider + Viewport, so no other Toast wiring is needed.\n *\n * @example\n * function App() {\n * return (\n * <>\n * <Routes />\n * <Toaster />\n * </>\n * );\n * }\n */\nexport function Toaster() {\n const { toasts, dismiss, remove } = useToast();\n\n // Closing a toast sets open:false so Radix can play the slide-out; drop it\n // from the queue once that animation has had time to finish.\n useEffect(() => {\n const closing = toasts.filter((t) => !t.open);\n if (closing.length === 0) return;\n const timers = closing.map((t) => window.setTimeout(() => remove(t.id), 200));\n return () => timers.forEach((id) => window.clearTimeout(id));\n }, [toasts, remove]);\n\n const strings = useStrings();\n return (\n <ToastProvider label={strings.toast.region}>\n {toasts.map((t) => (\n <Toast\n key={t.id}\n variant={t.variant ?? 'default'}\n open={t.open}\n // Radix treats 0 as \"dismiss immediately\"; the queue's 0 means \"keep open\".\n duration={t.duration === 0 ? Infinity : t.duration}\n onOpenChange={(open) => {\n if (!open) dismiss(t.id);\n }}\n >\n {t.title && <ToastTitle>{t.title}</ToastTitle>}\n {t.description && <ToastDescription>{t.description}</ToastDescription>}\n {t.action && (\n <ToastAction altText={t.action.altText} onClick={t.action.onClick} className=\"mt-1\">\n {t.action.label}\n </ToastAction>\n )}\n <ToastClose />\n </Toast>\n ))}\n <ToastViewport />\n </ToastProvider>\n );\n}\nToaster.displayName = 'Toaster';\n\n/**\n * @example\n * <ToastProvider>\n * …app…\n * <Toast variant=\"success\">\n * <ToastTitle>Saved</ToastTitle>\n * <ToastDescription>Your changes are live.</ToastDescription>\n * <ToastAction altText=\"Undo\">Undo</ToastAction>\n * <ToastClose />\n * </Toast>\n * <ToastViewport />\n * </ToastProvider>\n *\n * @do Use the `useToast()` hook (in `src/hooks/use-toast.ts`) in app code —\n * the components here are the primitives the hook renders.\n * @dont Stack more than two toasts at a time. Newer toasts replace older ones.\n */\n"],"names":["ToastProvider","ToastPrimitive","ToastViewport","forwardRef","className","label","props","ref","strings","useStrings","jsx","cn","toast","cva","iconMap","CheckCircle2","AlertTriangle","XCircle","Info","Toast","variant","children","jsxs","ToastTitle","ToastDescription","ToastAction","ToastClose","X","Toaster","toasts","dismiss","remove","useToast","useEffect","closing","t","timers","id","open"],"mappings":";;;;;;;;;AAgBO,MAAMA,IAAgBC,EAAe,UAE/BC,IAAgBC,EAG3B,SAAuB,EAAE,WAAAC,GAAW,OAAAC,GAAO,GAAGC,EAAA,GAASC,GAAK;AAC5D,QAAMC,IAAUC,EAAA;AAChB,SACE,gBAAAC;AAAA,IAACT,EAAe;AAAA,IAAf;AAAA,MACC,aAAU;AAAA,MACV,KAAAM;AAAA,MAGA,OAAOF,KAASG,EAAQ,MAAM;AAAA,MAC9B,WAAWG;AAAA,QACT;AAAA;AAAA,QAEA;AAAA,QACA;AAAA,QACAP;AAAA,MAAA;AAAA,MAED,GAAGE;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;AACDJ,EAAc,cAAc;AAE5B,MAAMU,IAAQC;AAAA,EACZ;A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";
2
+ import { jsxs as m, jsx as o } from "react/jsx-runtime";
3
3
  import { forwardRef as d } from "react";
4
4
  import { Slot as u } from "@radix-ui/react-slot";
5
5
  import { useStrings as g } from "../../hooks/use-strings.js";
6
6
  import { cn as f } from "../../lib/utils.js";
7
- const x = d(function({ logo: n, nav: e, search: r, actions: o, navLabel: t, className: a, ...s }, l) {
7
+ const x = d(function({ logo: n, nav: e, search: r, actions: i, navLabel: t, className: a, ...s }, l) {
8
8
  const p = g();
9
9
  return /* @__PURE__ */ m(
10
10
  "header",
@@ -27,7 +27,7 @@ const x = d(function({ logo: n, nav: e, search: r, actions: o, navLabel: t, clas
27
27
  children: [
28
28
  /* @__PURE__ */ m("div", { className: "flex min-w-0 items-center gap-6", children: [
29
29
  n,
30
- e && /* @__PURE__ */ i(
30
+ e && /* @__PURE__ */ o(
31
31
  "nav",
32
32
  {
33
33
  "aria-label": t ?? p.topNav.label,
@@ -36,26 +36,26 @@ const x = d(function({ logo: n, nav: e, search: r, actions: o, navLabel: t, clas
36
36
  }
37
37
  )
38
38
  ] }),
39
- r && /* @__PURE__ */ i("div", { className: "mx-auto w-full max-w-md flex-1 lg:flex-none", children: r }),
40
- o && /* @__PURE__ */ i("div", { className: "ml-auto flex shrink-0 items-center gap-2", children: o })
39
+ r && /* @__PURE__ */ o("div", { className: "mx-auto w-full max-w-md flex-1 lg:flex-none", children: r }),
40
+ i && /* @__PURE__ */ o("div", { className: "ml-auto flex shrink-0 items-center gap-2", children: i })
41
41
  ]
42
42
  }
43
43
  );
44
44
  });
45
45
  x.displayName = "TopNav";
46
- const v = d(function({ href: n, active: e, asChild: r, className: o, children: t, ...a }, s) {
47
- return /* @__PURE__ */ i(
46
+ const v = d(function({ href: n, active: e, asChild: r, className: i, children: t, ...a }, s) {
47
+ return /* @__PURE__ */ o(
48
48
  r ? u : "a",
49
49
  {
50
50
  ref: s,
51
51
  href: n,
52
52
  "aria-current": e ? "page" : void 0,
53
53
  className: f(
54
- "inline-flex h-9 items-center rounded-md px-3 text-sm font-medium outline-none",
54
+ "inline-flex h-9 items-center rounded-md px-3 text-sm font-medium outline-hidden",
55
55
  "transition-colors duration-[var(--duration-fast)]",
56
56
  e ? "text-foreground" : "text-foreground-muted hover:text-foreground",
57
57
  "focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2",
58
- o
58
+ i
59
59
  ),
60
60
  ...a,
61
61
  children: t
@@ -1 +1 @@
1
- {"version":3,"file":"TopNav.js","sources":["../../../src/components/ui/TopNav.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, type AnchorHTMLAttributes, type HTMLAttributes, type ReactNode } from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { useStrings } from '@/hooks/use-strings';\nimport { cn } from '@/lib/utils';\n\nexport interface TopNavProps extends HTMLAttributes<HTMLElement> {\n /** Logo / wordmark slot. Shown on the far left. */\n logo: ReactNode;\n /** Primary navigation links — typically a list of `<TopNavLink>`. */\n nav?: ReactNode;\n /** Search / command bar slot — fills the centre on wide screens. */\n search?: ReactNode;\n /** Right-aligned cluster — notifications, theme toggle, user menu. */\n actions?: ReactNode;\n /** Accessible name of the inner `<nav>` landmark. Default \"Primary\". */\n navLabel?: string;\n}\n\n/**\n * App-level top bar. Layout: `logo · nav · search · actions`. Search and nav\n * are optional.\n *\n * @example\n * <TopNav\n * logo={<Logo />}\n * nav={<><TopNavLink href=\"/\" active>Home</TopNavLink>…</>}\n * search={<Input type=\"search\" placeholder=\"Search…\" />}\n * actions={<><Bell /><Avatar /></>}\n * />\n *\n * @do Pick one primary nav style — links here or in the Sidebar, not both.\n * @dont Stack two rows of navigation in the TopNav. If you need tabs as well,\n * put them below the bar inside the page content.\n */\nexport const TopNav = forwardRef<HTMLElement, TopNavProps>(function TopNav(\n { logo, nav, search, actions, navLabel, className, ...props },\n ref,\n) {\n const strings = useStrings();\n return (\n <header\n data-slot=\"top-nav\"\n ref={ref}\n className={cn(\n 'sticky top-0 z-[var(--z-sticky)] flex h-14 w-full items-center gap-4',\n // Fixed three-column track from lg up: the centre slot keeps its\n // position however wide the logo slot grows, so navigating between\n // pages (breadcrumbs of different lengths) never shifts the search.\n // Below lg the bar stays flex — there is not enough room for three\n // tracks, and logo slots that vary in width (breadcrumbs) are hidden\n // at those widths anyway.\n search && 'lg:grid lg:grid-cols-[minmax(0,1fr)_minmax(0,28rem)_minmax(0,1fr)]',\n 'border-border bg-background border-b px-4',\n className,\n )}\n {...props}\n >\n <div className=\"flex min-w-0 items-center gap-6\">\n {logo}\n {nav && (\n <nav\n aria-label={navLabel ?? strings.topNav.label}\n className=\"hidden items-center gap-1 md:flex\"\n >\n {nav}\n </nav>\n )}\n </div>\n {search && <div className=\"mx-auto w-full max-w-md flex-1 lg:flex-none\">{search}</div>}\n {actions && <div className=\"ml-auto flex shrink-0 items-center gap-2\">{actions}</div>}\n </header>\n );\n});\nTopNav.displayName = 'TopNav';\n\nexport interface TopNavLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n href?: string;\n active?: boolean;\n /** Render the child (e.g. router `<Link>`) instead of an `<a>`. */\n asChild?: boolean;\n}\n\nexport const TopNavLink = forwardRef<HTMLAnchorElement, TopNavLinkProps>(function TopNavLink(\n { href, active, asChild, className, children, ...props },\n ref,\n) {\n const Comp = asChild ? Slot : 'a';\n return (\n <Comp\n ref={ref}\n href={href}\n aria-current={active ? 'page' : undefined}\n className={cn(\n 'inline-flex h-9 items-center rounded-md px-3 text-sm font-medium outline-none',\n 'transition-colors duration-[var(--duration-fast)]',\n active ? 'text-foreground' : 'text-foreground-muted hover:text-foreground',\n 'focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2',\n className,\n )}\n {...props}\n >\n {children}\n </Comp>\n );\n});\nTopNavLink.displayName = 'TopNavLink';\n"],"names":["TopNav","forwardRef","logo","nav","search","actions","navLabel","className","props","ref","strings","useStrings","jsxs","cn","jsx","TopNavLink","href","active","asChild","children","Slot"],"mappings":";;;;;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,MAED,GAAGC;AAAA,MAEH,UAAAW;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;AACDJ,EAAW,cAAc;"}
1
+ {"version":3,"file":"TopNav.js","sources":["../../../src/components/ui/TopNav.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, type AnchorHTMLAttributes, type HTMLAttributes, type ReactNode } from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { useStrings } from '@/hooks/use-strings';\nimport { cn } from '@/lib/utils';\n\nexport interface TopNavProps extends HTMLAttributes<HTMLElement> {\n /** Logo / wordmark slot. Shown on the far left. */\n logo: ReactNode;\n /** Primary navigation links — typically a list of `<TopNavLink>`. */\n nav?: ReactNode;\n /** Search / command bar slot — fills the centre on wide screens. */\n search?: ReactNode;\n /** Right-aligned cluster — notifications, theme toggle, user menu. */\n actions?: ReactNode;\n /** Accessible name of the inner `<nav>` landmark. Default \"Primary\". */\n navLabel?: string;\n}\n\n/**\n * App-level top bar. Layout: `logo · nav · search · actions`. Search and nav\n * are optional.\n *\n * @example\n * <TopNav\n * logo={<Logo />}\n * nav={<><TopNavLink href=\"/\" active>Home</TopNavLink>…</>}\n * search={<Input type=\"search\" placeholder=\"Search…\" />}\n * actions={<><Bell /><Avatar /></>}\n * />\n *\n * @do Pick one primary nav style — links here or in the Sidebar, not both.\n * @dont Stack two rows of navigation in the TopNav. If you need tabs as well,\n * put them below the bar inside the page content.\n */\nexport const TopNav = forwardRef<HTMLElement, TopNavProps>(function TopNav(\n { logo, nav, search, actions, navLabel, className, ...props },\n ref,\n) {\n const strings = useStrings();\n return (\n <header\n data-slot=\"top-nav\"\n ref={ref}\n className={cn(\n 'sticky top-0 z-[var(--z-sticky)] flex h-14 w-full items-center gap-4',\n // Fixed three-column track from lg up: the centre slot keeps its\n // position however wide the logo slot grows, so navigating between\n // pages (breadcrumbs of different lengths) never shifts the search.\n // Below lg the bar stays flex — there is not enough room for three\n // tracks, and logo slots that vary in width (breadcrumbs) are hidden\n // at those widths anyway.\n search && 'lg:grid lg:grid-cols-[minmax(0,1fr)_minmax(0,28rem)_minmax(0,1fr)]',\n 'border-border bg-background border-b px-4',\n className,\n )}\n {...props}\n >\n <div className=\"flex min-w-0 items-center gap-6\">\n {logo}\n {nav && (\n <nav\n aria-label={navLabel ?? strings.topNav.label}\n className=\"hidden items-center gap-1 md:flex\"\n >\n {nav}\n </nav>\n )}\n </div>\n {search && <div className=\"mx-auto w-full max-w-md flex-1 lg:flex-none\">{search}</div>}\n {actions && <div className=\"ml-auto flex shrink-0 items-center gap-2\">{actions}</div>}\n </header>\n );\n});\nTopNav.displayName = 'TopNav';\n\nexport interface TopNavLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n href?: string;\n active?: boolean;\n /** Render the child (e.g. router `<Link>`) instead of an `<a>`. */\n asChild?: boolean;\n}\n\nexport const TopNavLink = forwardRef<HTMLAnchorElement, TopNavLinkProps>(function TopNavLink(\n { href, active, asChild, className, children, ...props },\n ref,\n) {\n const Comp = asChild ? Slot : 'a';\n return (\n <Comp\n ref={ref}\n href={href}\n aria-current={active ? 'page' : undefined}\n className={cn(\n 'inline-flex h-9 items-center rounded-md px-3 text-sm font-medium outline-hidden',\n 'transition-colors duration-[var(--duration-fast)]',\n active ? 'text-foreground' : 'text-foreground-muted hover:text-foreground',\n 'focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2',\n className,\n )}\n {...props}\n >\n {children}\n </Comp>\n );\n});\nTopNavLink.displayName = 'TopNavLink';\n"],"names":["TopNav","forwardRef","logo","nav","search","actions","navLabel","className","props","ref","strings","useStrings","jsxs","cn","jsx","TopNavLink","href","active","asChild","children","Slot"],"mappings":";;;;;;AAoCO,MAAMA,IAASC,EAAqC,SACzD,EAAE,MAAAC,GAAM,KAAAC,GAAK,QAAAC,GAAQ,SAAAC,GAAS,UAAAC,GAAU,WAAAC,GAAW,GAAGC,EAAA,GACtDC,GACA;AACA,QAAMC,IAAUC,EAAA;AAChB,SACE,g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tree",
92
91
  ref: (i) => {
93
92
  i ? S.current.set(e.id, i) : S.current.delete(e.id);
94
93
  },
@@ -108,7 +107,7 @@ const ne = Z(function(I, M) {
108
107
  onClick: (i) => {
109
108
  i.stopPropagation(), y(e.id), L(e.id), s && v(e.id, !a);
110
109
  },
111
- className: "outline-none",
110
+ className: "outline-hidden",
112
111
  children: [
113
112
  /* @__PURE__ */ j(
114
113
  "div",
@@ -164,6 +163,7 @@ const ne = Z(function(I, M) {
164
163
  return /* @__PURE__ */ o(
165
164
  "ul",
166
165
  {
166
+ "data-slot": "tree",
167
167
  ref: M,
168
168
  role: "tree",
169
169
  "aria-label": B ?? (T ? void 0 : J.tree.label),