@ai-matrx/design-system 0.60.1 → 0.60.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +47 -0
- package/dist/data-table/index.cjs +16 -10
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.js +16 -10
- package/dist/data-table/index.js.map +1 -1
- package/dist/data-table/pagination.cjs +16 -10
- package/dist/data-table/pagination.cjs.map +1 -1
- package/dist/data-table/pagination.js +16 -10
- package/dist/data-table/pagination.js.map +1 -1
- package/dist/desktop-lint.mjs +218 -0
- package/dist/desktop.cjs +3565 -0
- package/dist/desktop.cjs.map +1 -0
- package/dist/desktop.css +234 -0
- package/dist/desktop.d.cts +484 -0
- package/dist/desktop.d.ts +484 -0
- package/dist/desktop.js +3533 -0
- package/dist/desktop.js.map +1 -0
- package/dist/index.d.cts +14 -876
- package/dist/index.d.ts +14 -876
- package/dist/organization-picker-mLqIcesx.d.cts +875 -0
- package/dist/organization-picker-mLqIcesx.d.ts +875 -0
- package/package.json +13 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/data-table/pagination.tsx","../../src/button.tsx","../../src/cn.ts","../../src/tooltip.tsx","../../src/motion.ts","../../src/portal-container.tsx","../../src/title-tooltips.ts","../../src/data-table/icons.tsx","../../src/select.tsx","../../src/icons.tsx","../../src/field-surface.ts","../../src/data-table/host.tsx"],"sourcesContent":["\"use client\";\nimport { formatCount } from \"@ai-matrx/kit/format\";\nimport { Button, type ButtonProps } from \"../button\";\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from \"../tooltip\";\nimport {\n ChevronsLeft,\n ChevronLeft,\n ChevronsRight,\n ChevronRight,\n} from \"./icons\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"../select\";\nimport { cn } from \"../cn\";\nimport { useMatrxDataTableHost, type TableToolbarActionProps } from \"./host\";\nimport type { ComponentType } from \"react\";\n\nexport interface GenericTablePaginationProps {\n totalItems: number;\n /** Offset source whose exact total is unavailable; never invent a last page. */\n unknownTotal?: { pageRowCount: number; hasNextPage: boolean };\n isFetching?: boolean;\n itemsPerPage: number;\n currentPage: number;\n onPageChange: (page: number) => void;\n onItemsPerPageChange: (items: number) => void;\n pageSizeOptions?: number[];\n className?: string;\n showItemsPerPageSelect?: boolean;\n showPageInfo?: boolean;\n showPageControls?: boolean;\n maxPagesToShow?: number;\n containerClassName?: string;\n selectContainerClassName?: string;\n infoContainerClassName?: string;\n controlsContainerClassName?: string;\n pageButtonClassName?: string;\n pageActiveButtonClassName?: string;\n navButtonClassName?: string;\n /** Value emitted for the optional All choice. Defaults to the current total. */\n allValue?: number;\n /** Honest label for the optional all-rows choice. */\n allOptionLabel?: string;\n showAllOption?: boolean;\n layoutType?: \"grid\" | \"flex\";\n labelFormat?: (start: number, end: number, total: number) => string;\n compact?: boolean;\n hideEntriesInfo?: boolean;\n /** Keeps progressive local pagination in one stable footer, including at\n * exhaustion. Counts describe rendered rows, not a numbered page. */\n progressive?: { loadedCount?: number; shownCount: number; hasMore: boolean; onShowMore: () => void };\n /** The table's read has not produced a count: \"failed\" (the read failed with no\n * rows on screen) draws \"—\" labelled \"Row count unavailable\"; \"loading\" draws no\n * count. Never \"0 rows\" — zero is an answer only after a read that succeeded.\n * Rows kept over a failed refresh are counted normally (stale-while-error). */\n countUnavailable?: \"failed\" | \"loading\";\n}\n\nfunction PageNavigationControl({\n label,\n disabledHint,\n visibilityClassName = \"inline-flex\",\n disabled,\n className,\n ...props\n}: ButtonProps & {\n label: string;\n disabledHint: string;\n visibilityClassName?: string;\n}) {\n const button = (\n <Button\n {...props}\n disabled={disabled}\n aria-label={label}\n className={cn(visibilityClassName, className, \"[&_svg]:size-5\")}\n />\n );\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n {disabled ? (\n <span\n className={cn(visibilityClassName, \"rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring\")}\n tabIndex={0}\n aria-label={`${label} — ${disabledHint.toLowerCase()}`}\n >\n {button}\n </span>\n ) : button}\n </TooltipTrigger>\n <TooltipContent>{disabled ? disabledHint : label}</TooltipContent>\n </Tooltip>\n );\n}\n\nfunction PaginationAction({\n HostAction,\n compact = false,\n active = false,\n disabledHint,\n visibilityClassName = \"inline-flex\",\n fallbackClassName,\n ...props\n}: TableToolbarActionProps & {\n HostAction: ComponentType<TableToolbarActionProps> | undefined;\n compact?: boolean;\n active?: boolean;\n disabledHint: string;\n visibilityClassName?: string;\n fallbackClassName?: string;\n}) {\n if (HostAction) {\n return (\n <span data-matrx-table-icon-action className={visibilityClassName}>\n <HostAction\n {...props}\n active={active}\n tooltip={props.disabled ? disabledHint : (props.tooltip ?? props.ariaLabel)}\n />\n </span>\n );\n }\n return (\n <PageNavigationControl\n variant=\"outline\"\n size=\"icon\"\n visibilityClassName={visibilityClassName}\n label={props.ariaLabel}\n disabledHint={disabledHint}\n disabled={props.disabled}\n onClick={props.onClick}\n className={cn(\n PAGINATION_ACTION_CLASS,\n compact && \"h-8 w-8 min-h-8 min-w-8\",\n active && PAGINATION_ACTIVE_CLASS,\n fallbackClassName,\n )}\n aria-current={active ? \"page\" : undefined}\n data-matrx-table-icon-action\n >\n {props.children}\n </PageNavigationControl>\n );\n}\n\n// Table footers use an actual 44px control shape. A pseudo-element inset into a\n// smaller visual box let the select text and chevron escape its border.\nconst PAGINATION_ACTION_CLASS = \"h-11 w-11 min-h-11 min-w-11 rounded-md border border-border bg-card p-0 text-sm shadow-none hover:bg-accent disabled:opacity-40 [&_svg]:size-5\";\nconst PAGINATION_ACTIVE_CLASS = \"border-primary bg-primary text-primary-foreground hover:bg-primary/90\";\n\nexport default function GenericTablePagination({\n totalItems,\n unknownTotal,\n isFetching = false,\n itemsPerPage,\n currentPage,\n onPageChange,\n onItemsPerPageChange,\n pageSizeOptions = [5, 10, 25, 50, 100],\n className = \"\",\n showItemsPerPageSelect = true,\n showPageInfo = true,\n showPageControls = true,\n maxPagesToShow = 5,\n containerClassName = \"\",\n selectContainerClassName = \"\",\n infoContainerClassName = \"\",\n controlsContainerClassName = \"\",\n pageButtonClassName = \"\",\n pageActiveButtonClassName = \"\",\n navButtonClassName = \"\",\n allValue = totalItems,\n allOptionLabel = \"All\",\n showAllOption = true,\n layoutType = \"grid\",\n labelFormat,\n compact = false,\n hideEntriesInfo = false,\n progressive,\n countUnavailable,\n}: GenericTablePaginationProps) {\n const host = useMatrxDataTableHost();\n const positivePageSizes = pageSizeOptions.filter((size) => size > 0);\n const availablePageSizes =\n itemsPerPage > 0 && !positivePageSizes.includes(itemsPerPage)\n ? [...positivePageSizes, itemsPerPage].sort((a, b) => a - b)\n : positivePageSizes;\n const pageSizeChoices = [...new Set(availablePageSizes)];\n const hasDistinctAllChoice =\n showAllOption && !unknownTotal && !pageSizeChoices.includes(allValue);\n if (hasDistinctAllChoice) pageSizeChoices.push(allValue);\n const pageSizeIsFixed = pageSizeChoices.length <= 1;\n const effectiveItemsPerPage =\n itemsPerPage === 0 ? Math.max(totalItems, 1) : Math.max(itemsPerPage, 1);\n\n const totalPages = Math.max(1, Math.ceil(totalItems / effectiveItemsPerPage));\n\n const getPageNumbers = (limit = maxPagesToShow) => {\n let startPage = Math.max(1, currentPage - Math.floor(limit / 2));\n const endPage = Math.min(totalPages, startPage + limit - 1);\n startPage = Math.max(1, endPage - limit + 1);\n return Array.from(\n { length: endPage - startPage + 1 },\n (_, i) => startPage + i,\n );\n };\n\n const isFirstPageDisabled = isFetching || currentPage <= 1;\n const isLastPageDisabled = isFetching || (unknownTotal ? !unknownTotal.hasNextPage : currentPage >= totalPages);\n const startItem = totalItems === 0 ? 0 : progressive ? 1 : (currentPage - 1) * effectiveItemsPerPage + 1;\n const endItem = Math.min(progressive?.shownCount ?? currentPage * effectiveItemsPerPage, totalItems);\n\n const defaultLabelFormat = (start: number, end: number, total: number) => {\n if (total === 0 && !unknownTotal) return \"0 rows\";\n if (unknownTotal) return `${formatCount(unknownTotal.pageRowCount)} on page ${formatCount(currentPage)}`;\n if (progressive) return progressive.loadedCount !== undefined && progressive.loadedCount !== total\n ? `${end} shown / ${total} matching · ${progressive.loadedCount} loaded`\n : `${end} shown / ${total} loaded`;\n return compact\n ? `${start}-${end} of ${total}`\n : `Showing ${start} to ${end} of ${total} entries`;\n };\n\n const formatLabel = labelFormat || defaultLabelFormat;\n\n const containerClass = cn(\n \"w-full items-center\",\n !compact && \"border-t border-border\",\n layoutType === \"grid\"\n ? progressive\n ? \"grid grid-cols-[auto_minmax(0,1fr)_auto]\"\n : \"grid grid-cols-[auto_minmax(0,1fr)_auto]\"\n : \"flex flex-nowrap justify-between\",\n compact\n ? \"box-border min-h-8 gap-0 px-0 py-0\"\n : \"gap-1 px-2 py-1 sm:gap-4 sm:px-3\",\n className,\n containerClassName,\n );\n\n return (\n <TooltipProvider>\n <div data-matrx-table-footer className={containerClass}>\n {/* Items Per Page Select */}\n {showItemsPerPageSelect && (\n <div\n className={cn(\n \"flex min-w-0 justify-start\",\n !compact && \"sm:p-1\",\n selectContainerClassName,\n )}\n >\n <Select\n disabled={isFetching || pageSizeIsFixed}\n value={itemsPerPage.toString()}\n onValueChange={(value) => onItemsPerPageChange(parseInt(value))}\n >\n <SelectTrigger\n aria-label={progressive ? \"Visible row limit\" : \"Rows per page\"}\n className={cn(\n \"focus:ring-0\",\n compact\n ? \"h-8 min-h-8 min-w-20 rounded-md border border-border bg-card px-2 text-sm hover:bg-accent [&_svg]:size-4\"\n : \"h-8 w-[3.75rem] text-xs sm:w-36 sm:text-sm\",\n )}\n >\n <SelectValue placeholder={itemsPerPage.toString()} />\n </SelectTrigger>\n <SelectContent>\n {pageSizeChoices.map((size) => (\n <SelectItem key={size} value={size.toString()}>\n {size === allValue && hasDistinctAllChoice\n ? allOptionLabel\n : size}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n )}\n\n <div\n className={cn(\"flex min-w-0 justify-center\", infoContainerClassName)}\n >\n {/* Page Info - only show if not hidden But always show the div. */}\n {showPageInfo && !hideEntriesInfo && countUnavailable === \"failed\" ? (\n <span\n role=\"img\"\n aria-label=\"Row count unavailable\"\n title=\"Row count unavailable\"\n className=\"truncate text-sm tabular-nums text-muted-foreground\"\n >\n <span aria-hidden=\"true\">—</span>\n </span>\n ) : showPageInfo && !hideEntriesInfo && !countUnavailable && (\n <>\n <span className=\"truncate text-xs tabular-nums text-muted-foreground sm:hidden\">\n {labelFormat ? formatLabel(startItem, endItem, totalItems) : unknownTotal ? defaultLabelFormat(startItem, endItem, totalItems) : totalItems === 0 ? \"0 rows\" : progressive ? `${endItem}/${totalItems} ${progressive.loadedCount !== undefined && progressive.loadedCount !== totalItems ? \"matching\" : \"loaded\"}` : `${startItem}–${endItem} of ${totalItems}`}\n </span>\n <span\n className={`hidden whitespace-nowrap ${\n compact ? \"text-sm\" : \"text-sm\"\n } min-w-0 truncate text-muted-foreground sm:inline`}\n >\n {formatLabel(startItem, endItem, totalItems)}\n </span>\n </>\n )}\n </div>\n\n {/* Keep the footer's control position stable even when no further page exists. */}\n {progressive ? (progressive.hasMore ? (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button type=\"button\" variant=\"ghost\" size=\"sm\" aria-label=\"Show more rows\"\n className=\"h-8 min-h-8 shrink-0 justify-self-end px-2 text-xs\"\n onClick={progressive.onShowMore}>Show more</Button>\n </TooltipTrigger>\n <TooltipContent>Show more already-loaded rows</TooltipContent>\n </Tooltip>\n ) : null) : showPageControls && (\n <div\n className={cn(\n // ONE ROW ON A PHONE (page-pass 2026-09-27, /education/flashcards at 375px: the\n // pager wrapped onto a second row): prev · \"1–25 of 80\" · next; page numbers\n // and first/last from sm up.\n \"flex min-w-0 items-center justify-end\",\n compact ? \"gap-0\" : \"gap-0.5 sm:gap-1\",\n controlsContainerClassName,\n )}\n >\n <PaginationAction\n HostAction={host.ToolbarAction}\n compact={compact}\n ariaLabel=\"First page\"\n disabledHint={isFetching ? \"Loading source page\" : \"Already on the first page\"}\n visibilityClassName=\"hidden sm:inline-flex\"\n fallbackClassName={navButtonClassName}\n onClick={() => onPageChange(1)}\n disabled={isFirstPageDisabled}\n >\n <ChevronsLeft className=\"h-5 w-5\" />\n </PaginationAction>\n\n <PaginationAction\n HostAction={host.ToolbarAction}\n compact={compact}\n ariaLabel=\"Previous page\"\n disabledHint={isFetching ? \"Loading source page\" : \"Already on the first page\"}\n fallbackClassName={navButtonClassName}\n onClick={() => onPageChange(currentPage - 1)}\n disabled={isFirstPageDisabled}\n >\n <ChevronLeft className=\"h-5 w-5\" />\n </PaginationAction>\n\n {!unknownTotal && getPageNumbers(3).map((page) => (\n <PaginationAction\n key={`mobile-${page}`}\n HostAction={host.ToolbarAction}\n compact={compact}\n ariaLabel={`Page ${page}`}\n active={currentPage === page}\n disabledHint={isFetching ? \"Loading source page\" : `Already on page ${page}`}\n visibilityClassName=\"hidden\"\n fallbackClassName={page === currentPage ? pageActiveButtonClassName : pageButtonClassName}\n onClick={() => onPageChange(page)}\n disabled={isFetching || totalPages <= 1}\n >\n <span>{page}</span>\n </PaginationAction>\n ))}\n\n {!unknownTotal && getPageNumbers().map((page) => (\n <PaginationAction\n key={`desktop-${page}`}\n HostAction={host.ToolbarAction}\n compact={compact}\n ariaLabel={`Page ${page}`}\n active={currentPage === page}\n disabledHint={isFetching ? \"Loading source page\" : `Already on page ${page}`}\n visibilityClassName=\"hidden sm:inline-flex\"\n fallbackClassName={currentPage === page ? pageActiveButtonClassName : pageButtonClassName}\n onClick={() => onPageChange(page)}\n disabled={isFetching || totalPages <= 1}\n >\n <span>{page}</span>\n </PaginationAction>\n ))}\n\n <PaginationAction\n HostAction={host.ToolbarAction}\n compact={compact}\n ariaLabel=\"Next page\"\n disabledHint={isFetching ? \"Loading source page\" : \"Already on the last page\"}\n fallbackClassName={navButtonClassName}\n onClick={() => onPageChange(currentPage + 1)}\n disabled={isLastPageDisabled}\n >\n <ChevronRight className=\"h-5 w-5\" />\n </PaginationAction>\n\n {!unknownTotal && (\n <PaginationAction\n HostAction={host.ToolbarAction}\n compact={compact}\n ariaLabel=\"Last page\"\n disabledHint={isFetching ? \"Loading source page\" : \"Already on the last page\"}\n visibilityClassName=\"hidden sm:inline-flex\"\n fallbackClassName={navButtonClassName}\n onClick={() => onPageChange(totalPages)}\n disabled={isLastPageDisabled}\n >\n <ChevronsRight className=\"h-5 w-5\" />\n </PaginationAction>\n )}\n </div>\n )}\n </div>\n </TooltipProvider>\n );\n}\n","\"use client\";\n\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nexport const buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:opacity-50 active:scale-[0.98] [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90\",\n /**\n * An explicit spelling of `default`, identical by construction. It is\n * not decoration: matrx-frontend's `ButtonMine` fork carried it, ~17\n * call sites say `variant=\"primary\"`, and the alternative to keeping\n * the word was a host shim translating a prop — the massage C22 bans.\n */\n primary: \"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90\",\n /** The affirmative twin of `destructive` — confirm, approve, publish. */\n success:\n \"bg-success text-success-foreground shadow-sm hover:bg-success/90\",\n outline:\n \"border border-border bg-card shadow-sm hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n subtle:\n \"border border-transparent bg-muted/50 text-foreground hover:border-border hover:bg-muted\",\n },\n /**\n * ONE size scale, xs → 3xl, plus the two icon boxes. The top and bottom\n * of the scale came in from matrx-frontend's `ButtonMine` fork (2026-09-07):\n * a dense toolbar needs `xs`, and a marketing/hero call to action needs\n * `xl`+. A host that has to reach outside this scale forks the button,\n * which is exactly how `ButtonMine` was born.\n */\n size: {\n xs: \"h-6 rounded-md px-1 text-xs\",\n sm: \"h-8 rounded-md px-3 text-xs\",\n default: \"h-9 px-4 py-2\",\n /** An explicit spelling of `default` (the fork's middle rung). */\n md: \"h-9 px-4 py-2\",\n lg: \"h-10 rounded-md px-6\",\n xl: \"h-12 px-8 py-3 text-base\",\n \"2xl\": \"h-14 px-10 py-3 text-base\",\n \"3xl\": \"h-16 px-12 py-3 text-base\",\n icon: \"h-9 w-9\",\n \"icon-sm\": \"h-7 w-7\",\n /** A circular icon box — an avatar-shaped control, not a square one. */\n roundIcon: \"h-8 w-8 rounded-full p-0\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\n/**\n * THE TOUCH FLOOR (2026-09-17).\n *\n * Every rung of the size scale below `xl` is shorter than the 44px platform\n * touch target: `xs` 24, `icon-sm` 28, `sm` 32, `roundIcon` 32, `default`/`md`\n * 36, `icon` 36, `lg` 40. Measured live at 390x844 on `/masterwork/<id>`, ALL\n * SEVEN design-system Buttons in the viewport were under the floor (four at\n * 32px, two at 28px).\n *\n * The floor is raised in CSS, under `@media (pointer: coarse)` ONLY, so DESKTOP\n * DENSITY IS UNTOUCHED — a narrow desktop window is not a finger, which is why\n * this rule deliberately does NOT carry the `(max-width: 1023px)` half that the\n * dialog-footer floor in `styles.css` uses.\n *\n * WHY EVERY SUB-44 RUNG AND NOT JUST `sm`: a floor applied to one rung inverts\n * the scale. Lift `sm` (32) alone and it renders TALLER on a phone than\n * `default` (36) and `lg` (40) — the scale would stop being a scale. A floor is\n * only coherent applied to everything beneath it.\n *\n * The mechanism is `min-height`/`min-width`, not an invisible 44px hit ring\n * over a 32px pill. A ring is the tap-target package's pattern and it is right\n * THERE (isolated glass buttons), but on a toolbar of adjacent `sm` buttons\n * separated by an 8px gap the rings overlap in the gap and one button silently\n * eats taps aimed at its neighbour — unacceptable where a neighbour is\n * destructive. `lib/entity-list`'s own phone contract (`h-11 min-w-11`) already\n * chose growth for the same reason; this is that choice made once, in the\n * primitive, instead of per surface.\n *\n * `min-width` is raised only on the SQUARE rungs (`icon`, `icon-sm`,\n * `roundIcon`) — a text button is already wider than 44px, and forcing a floor\n * on it would stretch short labels.\n *\n * Opt out on a control that is genuinely not a finger target with\n * `data-touch-exempt` (same escape hatch the footer floor honours), and say why\n * at the call site.\n */\nconst TOUCH_FLOOR_SIZES = new Set([\n \"xs\",\n \"sm\",\n \"default\",\n \"md\",\n \"lg\",\n \"icon\",\n \"icon-sm\",\n \"roundIcon\",\n]);\nconst SQUARE_SIZES = new Set([\"icon\", \"icon-sm\", \"roundIcon\"]);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\n/**\n * THE CURSOR LAW (common-docs/policies/cursor-law.md): a disabled control says\n * so with `not-allowed`, which the package's base layer sets on `:disabled`\n * and `[aria-disabled=\"true\"]`. `pointer-events: none` is never the mechanism\n * — it swallows the cursor. A native `<button disabled>` already fires no\n * click; the two shapes that WOULD fire one are handled here, once:\n * - `asChild` + `disabled` (a Link wearing button styles): marked\n * `aria-disabled`, taken out of the tab order, and its click is swallowed;\n * - `aria-disabled=\"true\"` on an enabled button: its click is swallowed.\n */\nfunction swallowClick(event: React.MouseEvent<HTMLButtonElement>): void {\n event.preventDefault();\n event.stopPropagation();\n}\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, onClick, ...props }, ref) => {\n const Component = asChild ? Slot : \"button\";\n const resolvedSize = size ?? \"default\";\n const disabledChild = asChild && Boolean(props.disabled);\n const ariaDisabled = props[\"aria-disabled\"];\n const inert =\n disabledChild || ariaDisabled === true || ariaDisabled === \"true\";\n return (\n <Component\n className={cn(buttonVariants({ variant, size, className }))}\n data-matrx-button=\"\"\n data-tap-floor={TOUCH_FLOOR_SIZES.has(resolvedSize) ? \"\" : undefined}\n data-tap-floor-square={\n SQUARE_SIZES.has(resolvedSize) ? \"\" : undefined\n }\n ref={ref}\n {...props}\n aria-disabled={disabledChild ? true : ariaDisabled}\n tabIndex={disabledChild ? -1 : props.tabIndex}\n onClick={inert ? swallowClick : onClick}\n />\n );\n },\n);\nButton.displayName = \"Button\";\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","\"use client\";\n\n/**\n * Tooltip — the ONE tooltip in the fleet.\n *\n * THE COLLAPSE (0.6.0). Two implementations existed: matrx-frontend's\n * `components/ui/tooltip.tsx` (182 import sites) and `@ai-matrx/tap-target`'s\n * `src/tooltip.tsx` — the latter an explicit inlined PORT of the former,\n * carrying a header that said so. tap-target shipped it only because its ~60\n * tap buttons need a tooltip and no shared package owned one; four repos then\n * adopted `TooltipProvider` from tap-target. That made tap-target — a\n * button-geometry package — the accidental owner of a design-system primitive,\n * with a second copy living in the biggest host.\n *\n * A tooltip is a design-system surface, so it lives here. tap-target now takes\n * `@ai-matrx/design-system` as an ordinary sibling dependency and imports this\n * file; its own copy is deleted, and its re-export removed. The DAG already\n * ordered design-system before tap-target, so no cycle is introduced.\n *\n * BEHAVIOUR is matrx-frontend's, verbatim, including the ruling both copies\n * carried in prose:\n *\n * 1. THE ROOT RENDERS UNCONDITIONALLY — no hydration mount gate. The gate the\n * host wrapper once carried (\"Radix generates dynamic aria-controls ids that\n * differ between SSR and client\") was false: Radix ids come from React's\n * SSR-stable `useId`. It was actively harmful — a Trigger wraps\n * ALWAYS-VISIBLE content, so `return null` deleted that subtree from SSR and\n * the first client paint.\n *\n * 2. THE SURFACE IS TOKEN-DRIVEN, NOT BRANDED. Popover tokens, not\n * `bg-primary`: rich tooltip content using `text-muted-foreground` was\n * illegible on a brand-coloured background in one theme or the other.\n * Since 2026-09-28 the `.matrx-tooltip` class re-scopes those tokens to a dark,\n * high-contrast chip in both themes (styles.css, THE TOOLTIP SURFACE): the\n * neutral white surface it wore before was indistinguishable from the\n * browser's own `title` box.\n *\n * 3. EVERY `title` IS THIS TOOLTIP. The provider installs the title takeover\n * (`title-tooltips.ts`), so a hand-written `title=` anywhere in the\n * document shows this surface, never the browser's.\n *\n * SEAM INVERSION. The host resolved nested portal targets through\n * `useNestedPortalContainer` (an app hook wired to its dialog + window-panel\n * systems); tap-target's port dropped that seam entirely and always portalled\n * to `document.body` — which is why a tooltip inside a popped-out panel landed\n * in the wrong window. Here it is the package's `PortalContainerProvider`\n * seam: an explicit `container` prop wins, then the injected container, then\n * `document.body`. Both prior behaviours are reachable; neither is forked.\n */\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { MOTION_POPPER } from \"./motion\";\nimport { usePortalContainer } from \"./portal-container\";\nimport { acquireTitleTooltips, TOOLTIP_TRIGGER_ATTR } from \"./title-tooltips\";\n\nexport interface TooltipProviderProps\n extends React.ComponentProps<typeof TooltipPrimitive.Provider> {\n /**\n * THE TITLE TAKEOVER (2026-09-28) — while any provider is mounted, every native\n * `title` attribute in the document shows as this tooltip instead of the\n * browser's (see `title-tooltips.ts`). On by default, because a rule every\n * author must remember is a rule that is broken; pass `false` only for a\n * surface that must keep the browser's own box. One provider opting out does\n * not turn it off while another one is mounted.\n */\n titleTooltips?: boolean;\n}\n\n/**\n * Mount once near the app root. Every tooltip in the tree shares its\n * `delayDuration` / `skipDelayDuration` timing, and the root provider takes\n * over native `title` attributes (see `titleTooltips`).\n */\nfunction TooltipProvider({ titleTooltips = true, ...props }: TooltipProviderProps) {\n React.useEffect(() => {\n if (!titleTooltips) return;\n return acquireTitleTooltips();\n }, [titleTooltips]);\n return <TooltipPrimitive.Provider {...props} />;\n}\n\nconst Tooltip = TooltipPrimitive.Root;\n\n/**\n * Stamps `data-matrx-tooltip-trigger` so the title takeover never draws a\n * second tooltip over a control that already has this one — it still lifts a\n * `title` on the same control, so the browser's box never doubles it either.\n */\nconst TooltipTrigger = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Trigger>\n>((props, ref) => (\n <TooltipPrimitive.Trigger ref={ref} {...{ [TOOLTIP_TRIGGER_ATTR]: \"\" }} {...props} />\n));\nTooltipTrigger.displayName = TooltipPrimitive.Trigger.displayName;\n\nexport interface TooltipContentProps\n extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> {\n /**\n * Explicit portal target; wins over the injected `PortalContainerProvider`\n * value. Pass `null` to force `document.body`.\n */\n container?: HTMLElement | null;\n /**\n * Package-owned open/close motion. Default `true`. Pass `false` for a\n * surface that must appear instantly. It is NOT the reduced-motion switch;\n * `styles.css` already honours `prefers-reduced-motion`.\n */\n animated?: boolean;\n}\n\nconst TooltipContent = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Content>,\n TooltipContentProps\n>(({ className, sideOffset = 4, container, animated = true, ...props }, ref) => {\n const resolved = usePortalContainer(container);\n return (\n <TooltipPrimitive.Portal container={resolved ?? null}>\n <TooltipPrimitive.Content\n ref={ref}\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n \"matrx-tooltip z-[10001] overflow-hidden rounded-md border border-border bg-popover px-2.5 py-1 text-xs font-medium text-popover-foreground\",\n animated && MOTION_POPPER,\n className,\n )}\n {...props}\n />\n </TooltipPrimitive.Portal>\n );\n});\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nexport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };\nexport { acquireTitleTooltips, NATIVE_TITLE_OPT_OUT_ATTR } from \"./title-tooltips\";\n","/**\n * THE MOTION CONTRACT (0.10.0) — the class names every animated surface in\n * this package puts on the DOM, in ONE place.\n *\n * Why a module and not ten inline strings: the sweep that produced this file\n * found the same defect ten times over, and it was invisible each time\n * because each primitive spelled its animation out by hand. Ten hand-written\n * copies of `data-[state=open]:animate-in data-[state=closed]:animate-out\n * data-[state=closed]:fade-out-0 …` meant ten chances to reach for a utility\n * nothing in the package defines — which is exactly what happened. A single\n * exported constant per motion SHAPE means the next primitive cannot invent\n * an eleventh spelling, and `styles.test.ts` can prove every one of them\n * resolves to a rule in the shipped stylesheet.\n *\n * Every rule these name lives in `styles.css` under the package's own\n * keyframes. NONE of them is a Tailwind utility, and none requires a host\n * plugin — see that file's header for the measurement that made this\n * necessary.\n */\n\n/** Modal scrims: Dialog, AlertDialog, Sheet, CommandDialog. Fade only. */\nexport const MOTION_OVERLAY = \"matrx-motion-overlay\";\n\n/** The centred dialog card. Fades and scales; centring is not its business. */\nexport const MOTION_DIALOG = \"matrx-motion-dialog\";\n\n/**\n * THE CENTRING OF A CENTRED DIALOG CARD — package-owned, in the `translate`\n * property, and NEVER a Tailwind `translate-x-[-50%] translate-y-[-50%]` pair.\n *\n * Those utilities do not compile to the same thing in every host: Tailwind v3\n * writes them into `transform`, Tailwind v4 writes them into the independent\n * `translate` property, which COMPOSES with `transform` instead of being\n * replaced by it. 0.10.0's keyframes restated the centring inside `transform`,\n * which was harmless on v3 and doubled the centring on v4 — the card flew in\n * from off the top-left of the viewport for the animation's whole duration and\n * snapped into place at the end (fixed in 0.10.1).\n *\n * Owning it here means one spelling that reads the same on both, and it frees\n * `transform` so the keyframes carry ONLY the delta. Put this on every centred\n * surface UNCONDITIONALLY — it is geometry, so unlike {@link MOTION_DIALOG} it\n * must survive `animated={false}`. Its rule ships in `styles.css`.\n */\nexport const CENTERED_DIALOG = \"matrx-dialog-centered\";\n\n/**\n * The resting gap between a `popper`-positioned surface and its trigger, for\n * the primitives that want one (today: `Select`). Same law and same reason as\n * {@link CENTERED_DIALOG} — a position an animated surface holds AT REST is\n * the `translate` property's job, never a Tailwind translate utility, because\n * those land in `transform` on a v3 host and in `translate` on a v4 one while\n * the keyframes animate `transform` either way. Sizes from\n * `--matrx-popper-offset`; keys off Radix's `data-side`.\n */\nexport const POPPER_OFFSET = \"matrx-popper-offset\";\n\n/** The mobile Dialog / CommandDialog bottom sheet. Slides up and fades. */\nexport const MOTION_BOTTOM_SHEET = \"matrx-motion-bottom-sheet\";\n\n/**\n * Radix-popper surfaces: Popover, DropdownMenu, ContextMenu, HoverCard,\n * Select, Tooltip. Reads `--radix-popper-transform-origin` so the surface\n * grows out of its trigger, and `data-side` so it travels from it.\n */\nexport const MOTION_POPPER = \"matrx-motion-popper\";\n\n/** Edge sheets, one class per `sheetVariants` side. */\nexport const MOTION_SHEET = {\n top: \"matrx-motion-sheet-top\",\n bottom: \"matrx-motion-sheet-bottom\",\n left: \"matrx-motion-sheet-left\",\n right: \"matrx-motion-sheet-right\",\n center: \"matrx-motion-sheet-center\",\n} as const;\n\n/** Skeleton's breathing loop. */\nexport const MOTION_PULSE = \"matrx-pulse\";\n\n/** The spinner loop, for every inline busy indicator in the package. */\nexport const MOTION_SPIN = \"matrx-spin\";\n\n/**\n * Every motion class the package ships, for the guards. If a rule for one of\n * these is missing from `styles.css`, a component animates in no consumer and\n * says nothing about it — the C26 failure this list exists to make loud.\n */\nexport const ALL_MOTION_CLASSES = [\n MOTION_OVERLAY,\n MOTION_DIALOG,\n MOTION_BOTTOM_SHEET,\n MOTION_POPPER,\n ...Object.values(MOTION_SHEET),\n MOTION_PULSE,\n MOTION_SPIN,\n] as const;\n\n/**\n * The host-plugin utilities this package is forbidden to emit. They are\n * supplied by `tailwindcss-animate` / `tw-animate-css`, which is a HOST CSS\n * entry concern a package cannot declare a dependency on: three of the four\n * AI Matrx consumers never loaded it, so every surface wearing these appeared\n * with no animation and no error. `styles.test.ts` fails the build if one\n * comes back.\n */\nexport const FORBIDDEN_HOST_MOTION_UTILITIES = [\n \"animate-in\",\n \"animate-out\",\n \"fade-in\",\n \"fade-out\",\n \"zoom-in\",\n \"zoom-out\",\n \"slide-in-from\",\n \"slide-out-to\",\n \"animate-accordion\",\n \"animate-slide-down\",\n \"animate-slide-up\",\n \"animate-pulse\",\n \"animate-spin\",\n] as const;\n","\"use client\";\n\n/**\n * Injected portal-container seam.\n *\n * The matrx-frontend original resolved nested portal targets through\n * `useNestedPortalContainer` (explicit prop > dialog content > popout body >\n * document.body) — a host-shaped hook wired to that app's dialog and\n * window-panel systems. The package inverts the seam: hosts provide the\n * resolved container through `PortalContainerProvider`; an explicit\n * `container` prop on a component still wins, and with neither the portal\n * falls through to `document.body` (Radix default). Priority semantics are\n * unchanged from the original.\n */\n\nimport * as React from \"react\";\n\n// Shared identity across independently bundled public entrypoints/loaders.\nconst CONTEXT_SLOT = Symbol.for(\"ai-matrx.design-system.portal-container-context\");\nconst contextRegistry = globalThis as typeof globalThis & { [CONTEXT_SLOT]?: React.Context<HTMLElement | null | undefined> };\nconst PortalContainerContext = contextRegistry[CONTEXT_SLOT] ??= React.createContext<HTMLElement | null | undefined>(undefined);\n\nexport interface PortalContainerProviderProps {\n /** Where nested Radix portals (Popover, etc.) should mount. `null`/`undefined` → document.body. */\n container: HTMLElement | null | undefined;\n children: React.ReactNode;\n}\n\nexport function PortalContainerProvider({\n container,\n children,\n}: PortalContainerProviderProps) {\n return (\n <PortalContainerContext.Provider value={container ?? undefined}>\n {children}\n </PortalContainerContext.Provider>\n );\n}\n\n/**\n * Resolve a portal target: explicit prop (including an explicit `null`,\n * meaning \"the default body\") beats the injected container.\n */\nexport function usePortalContainer(\n explicit?: HTMLElement | null,\n): HTMLElement | undefined {\n const injected = React.useContext(PortalContainerContext);\n\n if (explicit !== undefined) {\n return explicit ?? undefined;\n }\n\n return injected ?? undefined;\n}\n","/**\n * THE TITLE TAKEOVER — every native `title` attribute in the document shows\n * as THE fleet tooltip instead of the browser's.\n *\n * Why this exists. A `title=` is the one tooltip nobody has to import, so it\n * is what every hand-written control reaches for: ~50 of them on an ordinary\n * matrx-frontend page (2026-09-28), next to the Radix tooltips on the tap\n * buttons. The browser draws those as a slow, unstyled system box, and a page\n * that mixes the two reads as having \"lost all of its tooltips\" (Arman,\n * 2026-09-28). Asking every author — human or agent — to wrap every control in\n * `<Tooltip>` is a rule that is broken the day it is written. So the\n * `TooltipProvider` every host already mounts at its root installs this layer,\n * and a `title` is simply a tooltip from then on. Nothing to remember.\n *\n * How it works. On hover (mouse or pen) or keyboard focus (`:focus-visible`)\n * of an element that carries a `title`, the attribute is lifted onto\n * `data-matrx-title` for exactly as long as the pointer or focus stays — so\n * the browser has nothing to show — and one shared, script-placed element\n * wearing `.matrx-tooltip` shows the text instead. When the pointer or focus\n * leaves, the `title` is put back, so assistive technology and every\n * `[title]` selector read the element exactly as authored the rest of the\n * time. Touch never shows it (a `title` has no touch affordance either).\n *\n * What it does not draw: a tooltip that only repeats text already readable in\n * full inside the element (it still draws when that text is hidden or\n * truncated).\n *\n * What it leaves alone:\n * - an element that is already a Radix tooltip trigger\n * (`[data-matrx-tooltip-trigger]`, stamped by `TooltipTrigger`): its\n * `title` is still lifted — two tooltips on one control was the other\n * half of the mess — but only the Radix one shows;\n * - anything inside `[data-native-title]` (the explicit opt-out);\n * - SVG `<title>` children, which are elements, not attributes.\n *\n * Placement. Above the element, centred, flipped below when there is no room,\n * clamped into the viewport. `data-title-side=\"right\" | \"left\" | \"bottom\" |\n * \"top\"` on the element or any ancestor states a preferred side — a vertical\n * rail sets `right` once on its container.\n *\n * Installed at most once per document, reference-counted across every\n * mounted provider, and removed when the last one unmounts.\n */\n\nexport const TITLE_TOOLTIP_ATTR = \"data-matrx-title\";\nexport const TOOLTIP_TRIGGER_ATTR = \"data-matrx-tooltip-trigger\";\nexport const NATIVE_TITLE_OPT_OUT_ATTR = \"data-native-title\";\n\ntype Side = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nconst OPEN_DELAY_MS = 350;\n/** Moving from one titled control to the next inside this window is instant. */\nconst SKIP_DELAY_MS = 500;\nconst GAP_PX = 6;\nconst EDGE_PX = 8;\n\nconst SURFACE_CLASS =\n \"matrx-tooltip matrx-title-tooltip matrx-motion-popper z-[10001] rounded-md border border-border bg-popover px-2.5 py-1 text-xs font-medium text-popover-foreground\";\n\ninterface Installation {\n count: number;\n uninstall: () => void;\n}\n\n/**\n * Keyed on the document itself through a registered symbol, never a module\n * WeakMap: tsup bundles this module into more than one entry (`index`,\n * `tap-target`), and two module copies each holding their own map would\n * install twice — two listeners, two surfaces.\n */\nconst INSTALLATION_KEY = Symbol.for(\"@ai-matrx/design-system/title-tooltips\");\ntype DocumentWithInstallation = Document & { [INSTALLATION_KEY]?: Installation };\nconst installations = {\n get: (doc: Document) => (doc as DocumentWithInstallation)[INSTALLATION_KEY],\n set: (doc: Document, value: Installation) => {\n (doc as DocumentWithInstallation)[INSTALLATION_KEY] = value;\n },\n delete: (doc: Document) => {\n delete (doc as DocumentWithInstallation)[INSTALLATION_KEY];\n },\n};\n\n/** Install the takeover on `doc`. Returns the release function. */\nexport function acquireTitleTooltips(doc: Document | undefined = typeof document === \"undefined\" ? undefined : document): () => void {\n if (!doc) return () => {};\n const existing = installations.get(doc);\n if (existing) {\n existing.count += 1;\n } else {\n installations.set(doc, { count: 1, uninstall: install(doc) });\n }\n let released = false;\n return () => {\n if (released) return;\n released = true;\n const current = installations.get(doc);\n if (!current) return;\n current.count -= 1;\n if (current.count <= 0) {\n current.uninstall();\n installations.delete(doc);\n }\n };\n}\n\nfunction install(doc: Document): () => void {\n const win = doc.defaultView;\n let active: HTMLElement | null = null;\n let surface: HTMLDivElement | null = null;\n let openTimer: ReturnType<typeof setTimeout> | undefined;\n let lastClosedAt = 0;\n\n const HTMLElementCtor = win?.HTMLElement;\n\n const titledAncestor = (node: EventTarget | null): HTMLElement | null => {\n if (!HTMLElementCtor || !(node instanceof win!.Node)) return null;\n const start = node instanceof HTMLElementCtor ? node : (node as Node).parentElement;\n if (!start) return null;\n const el = start.closest<HTMLElement>(`[title], [${TITLE_TOOLTIP_ATTR}]`);\n if (!el || !(el instanceof HTMLElementCtor)) return null;\n if (el.closest(`[${NATIVE_TITLE_OPT_OUT_ATTR}]`)) return null;\n return el;\n };\n\n const textOf = (el: HTMLElement) => (el.getAttribute(TITLE_TOOLTIP_ATTR) ?? el.getAttribute(\"title\") ?? \"\").trim();\n\n const lift = (el: HTMLElement) => {\n const title = el.getAttribute(\"title\");\n if (title === null) return;\n el.setAttribute(TITLE_TOOLTIP_ATTR, title);\n el.removeAttribute(\"title\");\n };\n\n const restore = (el: HTMLElement) => {\n const held = el.getAttribute(TITLE_TOOLTIP_ATTR);\n if (held === null) return;\n // An author who changed or removed the title while it was lifted wins:\n // only put ours back when nothing re-set it in the meantime.\n if (!el.hasAttribute(\"title\")) el.setAttribute(\"title\", held);\n el.removeAttribute(TITLE_TOOLTIP_ATTR);\n };\n\n const ensureSurface = () => {\n if (surface && surface.isConnected) return surface;\n surface = doc.createElement(\"div\");\n surface.setAttribute(\"role\", \"tooltip\");\n surface.setAttribute(\"data-slot\", \"title-tooltip\");\n surface.className = SURFACE_CLASS;\n surface.style.visibility = \"hidden\";\n doc.body.appendChild(surface);\n return surface;\n };\n\n const preferredSide = (el: HTMLElement): Side => {\n const hint = el.closest(\"[data-title-side]\")?.getAttribute(\"data-title-side\");\n return hint === \"bottom\" || hint === \"left\" || hint === \"right\" ? hint : \"top\";\n };\n\n const place = (el: HTMLElement, node: HTMLDivElement) => {\n const vw = win?.innerWidth ?? 0;\n const vh = win?.innerHeight ?? 0;\n const anchor = el.getBoundingClientRect();\n const box = node.getBoundingClientRect();\n const fits: Record<Side, boolean> = {\n top: anchor.top - GAP_PX - box.height >= EDGE_PX,\n bottom: anchor.bottom + GAP_PX + box.height <= vh - EDGE_PX,\n left: anchor.left - GAP_PX - box.width >= EDGE_PX,\n right: anchor.right + GAP_PX + box.width <= vw - EDGE_PX,\n };\n const opposite: Record<Side, Side> = { top: \"bottom\", bottom: \"top\", left: \"right\", right: \"left\" };\n const wanted = preferredSide(el);\n const side: Side = fits[wanted] ? wanted : fits[opposite[wanted]] ? opposite[wanted] : wanted;\n\n let x: number;\n let y: number;\n if (side === \"top\" || side === \"bottom\") {\n x = anchor.left + anchor.width / 2 - box.width / 2;\n y = side === \"top\" ? anchor.top - GAP_PX - box.height : anchor.bottom + GAP_PX;\n } else {\n y = anchor.top + anchor.height / 2 - box.height / 2;\n x = side === \"left\" ? anchor.left - GAP_PX - box.width : anchor.right + GAP_PX;\n }\n x = Math.min(Math.max(x, EDGE_PX), Math.max(EDGE_PX, vw - EDGE_PX - box.width));\n y = Math.min(Math.max(y, EDGE_PX), Math.max(EDGE_PX, vh - EDGE_PX - box.height));\n node.style.transform = `translate(${Math.round(x)}px, ${Math.round(y)}px)`;\n node.setAttribute(\"data-side\", side);\n };\n\n const isShown = (node: HTMLElement, root: HTMLElement) => {\n const rect = node.getBoundingClientRect();\n if (rect.width <= 0 || rect.height <= 0) return false;\n for (let cur: HTMLElement | null = node; cur; cur = cur === root ? null : cur.parentElement) {\n const cs = win?.getComputedStyle(cur);\n if (!cs) return false;\n if (cs.display === \"none\" || cs.visibility === \"hidden\" || Number(cs.opacity) === 0) return false;\n }\n return true;\n };\n\n /**\n * A tooltip that repeats text the person can already read in full is noise\n * (an expanded sidebar row, a \"Save\" button titled \"Save\"). It still shows\n * when that text is hidden (a collapsed rail's label) or cut off\n * (truncated) — the two cases a title exists for.\n */\n const repeatsVisibleText = (el: HTMLElement, text: string) => {\n const norm = (t: string) => t.replace(/\\s+/g, \" \").trim().toLowerCase();\n const want = norm(text);\n if (!want || !win) return false;\n const walker = doc.createTreeWalker(el, win.NodeFilter.SHOW_TEXT);\n for (let node = walker.nextNode(); node; node = walker.nextNode()) {\n if (norm(node.textContent ?? \"\") !== want) continue;\n const host = node.parentElement;\n if (!host || !isShown(host, el)) continue;\n if (host.scrollWidth > host.clientWidth + 1) continue;\n return true;\n }\n return false;\n };\n\n const show = (el: HTMLElement, instant: boolean) => {\n if (active !== el) return;\n // A Radix tooltip trigger shows its own tooltip — never a second one.\n if (el.closest(`[${TOOLTIP_TRIGGER_ATTR}]`)) return;\n const text = textOf(el);\n if (!text || !el.isConnected) return;\n if (repeatsVisibleText(el, text)) return;\n const node = ensureSurface();\n node.textContent = text;\n node.style.visibility = \"hidden\";\n node.setAttribute(\"data-state\", instant ? \"instant-open\" : \"delayed-open\");\n place(el, node);\n node.style.visibility = \"visible\";\n if (el.id) node.id = `${el.id}-title-tooltip`;\n };\n\n const hide = () => {\n if (openTimer !== undefined) clearTimeout(openTimer);\n openTimer = undefined;\n if (surface && surface.style.visibility === \"visible\") lastClosedAt = Date.now();\n if (surface) {\n surface.style.visibility = \"hidden\";\n surface.removeAttribute(\"data-state\");\n }\n };\n\n const activate = (el: HTMLElement) => {\n if (active === el) return;\n deactivate();\n active = el;\n lift(el);\n const instant = Date.now() - lastClosedAt < SKIP_DELAY_MS;\n if (instant) show(el, true);\n else openTimer = setTimeout(() => show(el, false), OPEN_DELAY_MS);\n };\n\n const deactivate = () => {\n hide();\n if (active) restore(active);\n active = null;\n };\n\n const onPointerOver = (e: PointerEvent) => {\n if (e.pointerType === \"touch\") return;\n const el = titledAncestor(e.target);\n if (el) activate(el);\n else if (active) deactivate();\n };\n\n const onPointerOut = (e: PointerEvent) => {\n if (!active) return;\n const next = e.relatedTarget;\n if (next instanceof win!.Node && active.contains(next)) return;\n deactivate();\n };\n\n const onFocusIn = (e: FocusEvent) => {\n const el = titledAncestor(e.target);\n if (!el) return;\n let visible = true;\n try {\n visible = (e.target as Element).matches(\":focus-visible\");\n } catch {\n visible = true;\n }\n if (visible) activate(el);\n };\n\n const onFocusOut = (e: FocusEvent) => {\n if (!active) return;\n const next = e.relatedTarget;\n if (next instanceof win!.Node && active.contains(next)) return;\n deactivate();\n };\n\n const onDismiss = () => deactivate();\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") deactivate();\n };\n\n doc.addEventListener(\"pointerover\", onPointerOver, true);\n doc.addEventListener(\"pointerout\", onPointerOut, true);\n doc.addEventListener(\"focusin\", onFocusIn, true);\n doc.addEventListener(\"focusout\", onFocusOut, true);\n doc.addEventListener(\"pointerdown\", onDismiss, true);\n doc.addEventListener(\"keydown\", onKeyDown, true);\n doc.addEventListener(\"scroll\", onDismiss, true);\n win?.addEventListener(\"blur\", onDismiss);\n\n return () => {\n deactivate();\n doc.removeEventListener(\"pointerover\", onPointerOver, true);\n doc.removeEventListener(\"pointerout\", onPointerOut, true);\n doc.removeEventListener(\"focusin\", onFocusIn, true);\n doc.removeEventListener(\"focusout\", onFocusOut, true);\n doc.removeEventListener(\"pointerdown\", onDismiss, true);\n doc.removeEventListener(\"keydown\", onKeyDown, true);\n doc.removeEventListener(\"scroll\", onDismiss, true);\n win?.removeEventListener(\"blur\", onDismiss);\n surface?.remove();\n surface = null;\n };\n}\n","import type { SVGProps } from \"react\";\n\ntype IconProps = SVGProps<SVGSVGElement>;\nfunction Icon({ children, ...props }: IconProps) {\n return <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\" {...props}>{children}</svg>;\n}\nconst path = <path d=\"M4 12h16M12 4v16\" />;\nexport const ChevronLeft = (p: IconProps) => <Icon {...p}><path d=\"m15 18-6-6 6-6\" /></Icon>;\nexport const ChevronRight = (p: IconProps) => <Icon {...p}><path d=\"m9 18 6-6-6-6\" /></Icon>;\nexport const ChevronDown = (p: IconProps) => <Icon {...p}><path d=\"m6 9 6 6 6-6\" /></Icon>;\nexport const ArrowDown = (p: IconProps) => <Icon {...p}><path d=\"M12 4v16m-6-6 6 6 6-6\" /></Icon>;\nexport const ArrowUp = (p: IconProps) => <Icon {...p}><path d=\"M12 20V4m-6 6 6-6 6 6\" /></Icon>;\nexport const ArrowUpDown = (p: IconProps) => <Icon {...p}><path d=\"M12 4v16m-4-12 4-4 4 4m-8 8 4 4 4-4\" /></Icon>;\nexport const Check = (p: IconProps) => <Icon {...p}><path d=\"m5 12 4 4L19 6\" /></Icon>;\nexport const X = (p: IconProps) => <Icon {...p}><path d=\"M6 6l12 12M18 6 6 18\" /></Icon>;\nexport const Search = (p: IconProps) => <Icon {...p}><circle cx=\"11\" cy=\"11\" r=\"6\" /><path d=\"m16 16 4 4\" /></Icon>;\nexport const Plus = (p: IconProps) => <Icon {...p}>{path}</Icon>;\nexport const Minus = (p: IconProps) => <Icon {...p}><path d=\"M4 12h16\" /></Icon>;\n/** lucide `star` — compact saved-item marker. */\nexport const Star = (p: IconProps) => <Icon {...p}><path d=\"m12 2 3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z\" /></Icon>;\n/** lucide `pin` — compact saved-item marker. */\nexport const Pin = (p: IconProps) => <Icon {...p}><path d=\"M12 17v5M9 3h6l1 7 3 3v2H5v-2l3-3 1-7z\" /></Icon>;\nexport const Eraser = (p: IconProps) => <Icon {...p}><path d=\"m16 3 5 5-11 11H5l-3-3L13 5l3-2Z M8 10l6 6 M10 19h12\" /></Icon>;\nexport const GripVertical = (p: IconProps) => <Icon {...p}><circle cx=\"9\" cy=\"6\" r=\"1\" /><circle cx=\"15\" cy=\"6\" r=\"1\" /><circle cx=\"9\" cy=\"12\" r=\"1\" /><circle cx=\"15\" cy=\"12\" r=\"1\" /><circle cx=\"9\" cy=\"18\" r=\"1\" /><circle cx=\"15\" cy=\"18\" r=\"1\" /></Icon>;\n/** lucide `sliders-horizontal` — used for the table column manager. */\nexport const SlidersHorizontal = (p: IconProps) => <Icon {...p}>\n <path d=\"M21 4h-7M10 4H3M21 12h-9M8 12H3M21 20h-5M12 20H3M14 2v4M8 10v4M16 18v4\" />\n</Icon>;\nexport const Trash2 = (p: IconProps) => <Icon {...p}><path d=\"M4 7h16M10 11v6M14 11v6M9 7l1-2h4l1 2M6 7l1 13h10l1-13\" /></Icon>;\n/**\n * Spinner-only incomplete arc. Never a resting glyph — at rest this reads as a\n * broken half-circle. Pair it with `animate-spin` / `matrx-spin` only while\n * work is actually running. Refresh controls use `RefreshControlIcon`.\n */\nexport const Loader2 = (p: IconProps) => <Icon {...p}><path d=\"M20 12a8 8 0 1 1-2.3-5.7\" /></Icon>;\n/** lucide `refresh-cw` — the resting refresh arrows. */\nexport const RefreshCw = (p: IconProps) => (\n <Icon {...p}>\n <path d=\"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\" />\n <path d=\"M21 3v5h-5\" />\n <path d=\"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\" />\n <path d=\"M8 16H3v5\" />\n </Icon>\n);\n/** Refresh affordance: arrows at rest, spinner only while busy. */\nexport function RefreshControlIcon({\n spinning = false,\n className,\n ...props\n}: IconProps & { spinning?: boolean }) {\n if (spinning) {\n return (\n <Loader2\n className={[className, \"animate-spin\"].filter(Boolean).join(\" \")}\n {...props}\n />\n );\n }\n return <RefreshCw className={className} {...props} />;\n}\nexport const Save = (p: IconProps) => <Icon {...p}><path d=\"M5 3h12l2 2v16H5zM8 3v6h8V3M8 21v-7h8v7\" /></Icon>;\nexport const Pencil = (p: IconProps) => <Icon {...p}><path d=\"m4 20 4-1 11-11-3-3L5 16l-1 4z\" /></Icon>;\nexport const Eye = (p: IconProps) => <Icon {...p}><path d=\"M2 12s3-6 10-6 10 6 10 6-3 6-10 6S2 12 2 12z\" /><circle cx=\"12\" cy=\"12\" r=\"2\" /></Icon>;\nexport const PanelRight = (p: IconProps) => <Icon {...p}><rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\" /><path d=\"M15 4v16\" /></Icon>;\nexport const PanelRightOpen = PanelRight;\nexport const WholeWord = (p: IconProps) => <Icon {...p}><path d=\"M4 6l3 12 3-8 3 8 3-12M17 15h4\" /></Icon>;\nexport const ExternalLink = (p: IconProps) => <Icon {...p}><path d=\"M14 4h6v6M20 4l-9 9M19 13v6H5V5h6\" /></Icon>;\nexport const Copy = (p: IconProps) => <Icon {...p}><rect x=\"9\" y=\"9\" width=\"11\" height=\"11\" rx=\"2\" /><path d=\"M15 9V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h3\" /></Icon>;\nexport const Lightbulb = (p: IconProps) => <Icon {...p}><path d=\"M9 18h6M10 22h4M8 14a6 6 0 1 1 8 0c-1 1-1 2-1 3H9c0-1 0-2-1-3z\" /></Icon>;\nexport const TriangleAlert = (p: IconProps) => <Icon {...p}><path d=\"M12 3 2 21h20L12 3zM12 10v5M12 18h.01\" /></Icon>;\nexport const ShieldOff = (p: IconProps) => <Icon {...p}><path d=\"m3 3 18 18M12 3l7 3v5c0 4-3 7-7 9-4-2-7-5-7-9V6l4-2\" /></Icon>;\nexport const ListFilter = SlidersHorizontal;\nexport const ListX = X;\n\nexport const ChevronsLeft = (p: IconProps) => <Icon {...p}><path d=\"m11 18-6-6 6-6m8 12-6-6 6-6\" /></Icon>;\nexport const ChevronsRight = (p: IconProps) => <Icon {...p}><path d=\"m5 18 6-6-6-6m8 12 6-6-6-6\" /></Icon>;\n","\"use client\";\n\n/**\n * Select — ported verbatim from matrx-frontend `components/ui/select.tsx`.\n *\n * Seam inversions:\n * - The host's `useNestedPortalContainer` (dialog/popout aware) becomes the\n * injected `PortalContainerProvider` seam (`portal-container.tsx`); the\n * explicit `container` prop keeps top priority, exactly as before.\n * - `ChevronDownIcon` / `ChevronUpIcon` / `CheckIcon` come from the package's\n * inlined SVGs (C19), not @radix-ui/react-icons — same glyphs, same\n * viewBoxes. (The origin also imported `CaretSortIcon` without ever using\n * it; the dead import is not carried along.)\n *\n * THE ROOT RENDERS UNCONDITIONALLY — no mount gate. This wrapper used to defer\n * rendering until after hydration (\"Radix generates dynamic aria-controls ids\n * that differ between SSR and client\"), and that justification was false:\n * Radix ids come from React's SSR-stable `useId` (verified against\n * @radix-ui/react-select 2.3.1 / react-id 1.1.2). The gate was actively\n * harmful — it deleted the ALWAYS-VISIBLE select trigger (a form control)\n * from SSR and the first client paint.\n */\n\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { MOTION_POPPER, POPPER_OFFSET } from \"./motion\";\nimport {\n CheckIcon,\n RadixChevronDownIcon,\n RadixChevronUpIcon,\n} from \"./icons\";\nimport { usePortalContainer } from \"./portal-container\";\nimport { FIELD_SURFACE_CLASS } from \"./field-surface\";\n\nexport const Select = SelectPrimitive.Root;\n\nexport const SelectGroup = SelectPrimitive.Group;\n\nexport const SelectValue = SelectPrimitive.Value;\n\nexport const selectTriggerVariants = cva(\n `flex w-full items-center justify-between gap-2 whitespace-nowrap rounded-md ${FIELD_SURFACE_CLASS} text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground transition-colors hover:bg-accent hover:border-accent-foreground/20 focus:outline-none focus:ring-1 focus:ring-primary/30 focus:border-primary/40 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:min-w-0 [&>span]:line-clamp-1`,\n {\n variants: {\n size: {\n sm: \"h-7 px-2 py-1 text-xs\",\n default: \"h-9 px-3 py-1\",\n lg: \"h-10 px-3 py-2\",\n },\n },\n defaultVariants: {\n size: \"default\",\n },\n },\n);\n\n/**\n * THE ONE DROPDOWN CHEVRON (page-pass 2026-09-27, /crm/<id>). Pickers drew three\n * different trigger glyphs side by side — a down chevron, an up-down pair, and\n * a larger up-down — so one form read as three kinds of control. Every dropdown\n * trigger (Select, CreatablePicker, every host combobox) draws THIS.\n */\nexport function SelectChevron({ className, size = \"default\" }: { className?: string; size?: \"sm\" | \"default\" }) {\n return (\n <RadixChevronDownIcon\n aria-hidden=\"true\"\n data-select-chevron=\"\"\n className={cn(size === \"sm\" ? \"h-3.5 w-3.5\" : \"h-4 w-4\", \"shrink-0 opacity-50\", className)}\n />\n );\n}\n\nexport interface SelectTriggerProps\n extends\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>,\n VariantProps<typeof selectTriggerVariants> {\n hideArrow?: boolean;\n}\n\nexport const SelectTrigger = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Trigger>,\n SelectTriggerProps\n>(({ className, children, hideArrow = false, size, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(selectTriggerVariants({ size, className }))}\n {...props}\n >\n {children}\n {!hideArrow && (\n <SelectPrimitive.Icon asChild>\n <SelectChevron size={size === \"sm\" ? \"sm\" : \"default\"} />\n </SelectPrimitive.Icon>\n )}\n </SelectPrimitive.Trigger>\n));\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nexport const SelectScrollUpButton = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className,\n )}\n {...props}\n >\n <RadixChevronUpIcon />\n </SelectPrimitive.ScrollUpButton>\n));\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\nexport const SelectScrollDownButton = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className,\n )}\n {...props}\n >\n <RadixChevronDownIcon />\n </SelectPrimitive.ScrollDownButton>\n));\nSelectScrollDownButton.displayName =\n SelectPrimitive.ScrollDownButton.displayName;\n\nexport interface SelectContentProps\n extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> {\n /** Explicit portal target; wins over the injected container. */\n container?: HTMLElement | null;\n /**\n * Package-owned open/close motion. Default `true`. Pass `false` for a\n * surface that must appear instantly. It is NOT the reduced-motion switch;\n * `styles.css` already honours `prefers-reduced-motion`.\n */\n animated?: boolean;\n}\n\nexport const SelectContent = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Content>,\n SelectContentProps\n>(\n (\n {\n className,\n children,\n position = \"popper\",\n container,\n animated = true,\n ...props\n },\n ref,\n ) => {\n const portalContainer = usePortalContainer(container);\n return (\n <SelectPrimitive.Portal container={portalContainer}>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n \"relative z-[10001] max-h-96 min-w-[8rem] max-w-[calc(100vw-2rem)] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md\",\n animated && MOTION_POPPER,\n // The resting gap from the trigger. It is the `translate` property\n // (POPPER_OFFSET), never Tailwind translate utilities: those compose\n // with `transform` on a v4 host and are REPLACED by it on a v3 one,\n // so on v3 the animation ate the gap and the surface snapped 4px at\n // the end. Same law as the centred dialog card — see motion.ts.\n position === \"popper\" && POPPER_OFFSET,\n className,\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n \"max-w-full overflow-y-auto p-0.5\",\n position === \"popper\" &&\n \"w-full min-w-[var(--radix-select-trigger-width)] max-h-[var(--radix-select-content-available-height)]\",\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n});\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nexport const SelectLabel = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn(\"px-2 py-1.5 text-sm font-semibold\", className)}\n {...props}\n />\n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\nexport const SelectItem = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> & {\n /**\n * Secondary line shown under the label IN THE LIST ONLY. Rendered outside\n * Radix `ItemText` on purpose: everything inside `ItemText` is what the\n * closed trigger displays, so a description passed as `children` gets\n * squeezed into the fixed-height trigger and clipped. This prop keeps the\n * trigger to the one-line label while the open list shows both lines.\n */\n description?: React.ReactNode;\n }\n>(({ className, children, description, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex w-full min-w-0 select-none rounded-sm py-1 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:opacity-50\",\n description ? \"flex-col items-start gap-0.5 py-1.5\" : \"items-center\",\n className,\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex h-3.5 w-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"h-4 w-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <span className=\"min-w-0 whitespace-normal break-words [overflow-wrap:anywhere]\">\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </span>\n {description ? (\n <span className=\"block min-w-0 break-words text-xs leading-snug text-muted-foreground [overflow-wrap:anywhere]\">\n {description}\n </span>\n ) : null}\n </SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\nexport const SelectSeparator = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n","/**\n * Internal inlined SVG icons (policy C19: no icon-library dependency, ever).\n *\n * Each icon is copied from the exact glyph the ported originals rendered:\n * lucide-react's Loader2 / ChevronLeft / ChevronRight / MoreHorizontal and\n * @radix-ui/react-icons' Cross2Icon. Same viewBoxes, same paths, same default\n * stroke geometry — a host swapping the import sees pixel-identical output.\n *\n * Not exported from the package entry; components consume them directly.\n */\n\nimport * as React from \"react\";\n\ntype IconProps = React.SVGAttributes<SVGSVGElement>;\n\nfunction lucideProps(props: IconProps): React.SVGAttributes<SVGSVGElement> {\n return {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n \"aria-hidden\": true,\n ...props,\n };\n}\n\n/**\n * lucide `loader-2` — the spinner glyph. Callers add `matrx-spin`.\n * Never a resting icon: at rest this incomplete arc reads as a broken\n * half-circle. Refresh controls use arrows, then swap to this only while busy.\n */\nexport function Loader2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"M21 12a9 9 0 1 1-6.219-8.56\" />\n </svg>\n );\n}\n\n/** lucide `chevron-left`. */\nexport function ChevronLeftIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n );\n}\n\n/** lucide `chevron-right`. */\nexport function ChevronRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n );\n}\n\n/** lucide `chevron-down` — the disclosure's open glyph. */\nexport function ChevronDownIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n );\n}\n\n/** lucide `archive` — the archived-rows glyph (ArchivedDisclosure). */\nexport function ArchiveIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <rect width=\"20\" height=\"5\" x=\"2\" y=\"3\" rx=\"1\" />\n <path d=\"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8\" />\n <path d=\"M10 12h4\" />\n </svg>\n );\n}\n\n/** lucide `more-horizontal` — the kebab/ellipsis glyph. */\nexport function MoreHorizontalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <circle cx=\"12\" cy=\"12\" r=\"1\" />\n <circle cx=\"19\" cy=\"12\" r=\"1\" />\n <circle cx=\"5\" cy=\"12\" r=\"1\" />\n </svg>\n );\n}\n\n/** lucide `check` — the selected-row tick (CreatablePicker). */\nexport function LucideCheckIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n );\n}\n\n/** lucide `chevrons-up-down` — the combobox trigger glyph. */\nexport function ChevronsUpDownIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"m7 15 5 5 5-5\" />\n <path d=\"m7 9 5-5 5 5\" />\n </svg>\n );\n}\n\n/** lucide `external-link` — the manage-in-new-tab glyph. */\nexport function ExternalLinkIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"M15 3h6v6\" />\n <path d=\"M10 14 21 3\" />\n <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" />\n </svg>\n );\n}\n\n/** lucide `lock` — the platform-governed vocabulary glyph. */\nexport function LockIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <rect width=\"18\" height=\"11\" x=\"3\" y=\"11\" rx=\"2\" ry=\"2\" />\n <path d=\"M7 11V7a5 5 0 0 1 10 0v4\" />\n </svg>\n );\n}\n\n/** lucide `pencil` — the edit glyph (the table card's Edit action). */\nexport function PencilIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z\" />\n <path d=\"m15 5 4 4\" />\n </svg>\n );\n}\n\n/** lucide `plus` — the create/add glyph. */\nexport function PlusIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"M5 12h14\" />\n <path d=\"M12 5v14\" />\n </svg>\n );\n}\n\n/** lucide `x` — the dialog close glyph (host dialog module used lucide X). */\nexport function XIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n );\n}\n\n/**\n * @radix-ui/react-icons components default to width/height 15 — the bare\n * `<ChevronUpIcon />` renders in Select's scroll buttons rely on it.\n */\nfunction radixProps(props: IconProps): React.SVGAttributes<SVGSVGElement> {\n return {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 15 15\",\n width: 15,\n height: 15,\n fill: \"none\",\n \"aria-hidden\": true,\n ...props,\n };\n}\n\n/** @radix-ui/react-icons `MagnifyingGlassIcon` — the command search glyph. */\nexport function MagnifyingGlassIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** @radix-ui/react-icons `CheckIcon` — the select item indicator glyph. */\nexport function CheckIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/**\n * @radix-ui/react-icons `DividerHorizontalIcon` — the INDETERMINATE checkbox\n * glyph. Radix renders the indicator for both `true` and `\"indeterminate\"`, so\n * a half-selected \"select all\" that shows a full check states something false;\n * the two states get different glyphs on purpose.\n */\nexport function DividerHorizontalIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M2 7.5C2 7.22386 2.22386 7 2.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H2.5C2.22386 8 2 7.77614 2 7.5Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** @radix-ui/react-icons `DotFilledIcon` — the menu radio-item indicator. */\nexport function DotFilledIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z\"\n fill=\"currentColor\"\n />\n </svg>\n );\n}\n\n/** @radix-ui/react-icons `ChevronRightIcon` — the submenu-trigger glyph. */\nexport function RadixChevronRightIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** @radix-ui/react-icons `ChevronDownIcon` — the select trigger/scroll glyph. */\nexport function RadixChevronDownIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** @radix-ui/react-icons `ChevronUpIcon` — the select scroll-up glyph. */\nexport function RadixChevronUpIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** @radix-ui/react-icons `Cross2Icon` — the dialog/sheet close glyph. */\nexport function Cross2Icon(props: IconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 15 15\"\n fill=\"none\"\n aria-hidden\n {...props}\n >\n <path\n d=\"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/**\n * @radix-ui/react-icons `DragHandleDots2Icon` — the grip on `ResizableHandle`.\n * Inlined per C19: this package depends on no icon library.\n */\nexport function DragHandleDots2Icon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M4.5 2.5C5.05228 2.5 5.5 2.05228 5.5 1.5C5.5 0.947715 5.05228 0.5 4.5 0.5C3.94772 0.5 3.5 0.947715 3.5 1.5C3.5 2.05228 3.94772 2.5 4.5 2.5ZM4.5 6.5C5.05228 6.5 5.5 6.05229 5.5 5.5C5.5 4.94771 5.05228 4.5 4.5 4.5C3.94772 4.5 3.5 4.94771 3.5 5.5C3.5 6.05229 3.94772 6.5 4.5 6.5ZM5.5 9.5C5.5 10.0523 5.05228 10.5 4.5 10.5C3.94772 10.5 3.5 10.0523 3.5 9.5C3.5 8.94771 3.94772 8.5 4.5 8.5C5.05228 8.5 5.5 8.94771 5.5 9.5ZM4.5 14.5C5.05228 14.5 5.5 14.0523 5.5 13.5C5.5 12.9477 5.05228 12.5 4.5 12.5C3.94772 12.5 3.5 12.9477 3.5 13.5C3.5 14.0523 3.94772 14.5 4.5 14.5ZM11.5 1.5C11.5 2.05228 11.0523 2.5 10.5 2.5C9.94771 2.5 9.5 2.05228 9.5 1.5C9.5 0.947715 9.94771 0.5 10.5 0.5C11.0523 0.5 11.5 0.947715 11.5 1.5ZM10.5 6.5C11.0523 6.5 11.5 6.05229 11.5 5.5C11.5 4.94771 11.0523 4.5 10.5 4.5C9.94771 4.5 9.5 4.94771 9.5 5.5C9.5 6.05229 9.94771 6.5 10.5 6.5ZM11.5 9.5C11.5 10.0523 11.0523 10.5 10.5 10.5C9.94771 10.5 9.5 10.0523 9.5 9.5C9.5 8.94771 9.94771 8.5 10.5 8.5C11.0523 8.5 11.5 8.94771 11.5 9.5ZM10.5 14.5C11.0523 14.5 11.5 14.0523 11.5 13.5C11.5 12.9477 11.0523 12.5 10.5 12.5C9.94771 12.5 9.5 12.9477 9.5 13.5C9.5 14.0523 9.94771 14.5 10.5 14.5Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** lucide `star` — the default-organization badge (OrganizationPicker). */\nexport function StarIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z\" />\n </svg>\n );\n}\n\n/** lucide `building-2` — the organization glyph (OrganizationPicker trigger). */\nexport function Building2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z\" />\n <path d=\"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2\" />\n <path d=\"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2\" />\n <path d=\"M10 6h4\" />\n <path d=\"M10 10h4\" />\n <path d=\"M10 14h4\" />\n <path d=\"M10 18h4\" />\n </svg>\n );\n}\n\n/** lucide `panel-left` — the sidebar toggle glyph. */\nexport function PanelLeftIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M9 3v18\" />\n </svg>\n );\n}\n\n/** lucide `ellipsis-vertical` — a panel's \"more\" menu. */\nexport function MoreVerticalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <circle cx=\"12\" cy=\"12\" r=\"1\" />\n <circle cx=\"12\" cy=\"5\" r=\"1\" />\n <circle cx=\"12\" cy=\"19\" r=\"1\" />\n </svg>\n );\n}\n\n/** lucide `maximize-2` — expand a panel. */\nexport function Maximize2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"M15 3h6v6\" />\n <path d=\"m21 3-7 7\" />\n <path d=\"m3 21 7-7\" />\n <path d=\"M9 21H3v-6\" />\n </svg>\n );\n}\n\n/** lucide `minimize-2` — restore an expanded panel. */\nexport function Minimize2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"m14 10 7-7\" />\n <path d=\"M20 10h-6V4\" />\n <path d=\"m3 21 7-7\" />\n <path d=\"M4 14h6v6\" />\n </svg>\n );\n}\n\n/** lucide `arrow-left`. */\nexport function ArrowLeftIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"m12 19-7-7 7-7\" />\n <path d=\"M19 12H5\" />\n </svg>\n );\n}\n\n/** lucide `arrow-right`. */\nexport function ArrowRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"M5 12h14\" />\n <path d=\"m12 5 7 7-7 7\" />\n </svg>\n );\n}\n\n/** lucide `rotate-cw` — reload. */\nexport function RotateCwIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8\" />\n <path d=\"M21 3v5h-5\" />\n </svg>\n );\n}\n\n/** lucide `globe` — a web page with no favicon. */\nexport function GlobeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20\" />\n <path d=\"M2 12h20\" />\n </svg>\n );\n}\n","/**\n * THE ONE FIELD SURFACE (page-pass shared fix, 2026-09-27).\n *\n * Every control a person types into or picks from — Input, BasicInput,\n * Textarea, the Select trigger, and the host's ProInput / ProTextarea — sits on\n * this fill and this border. They used to disagree: Input and the elevated\n * Textarea filled with `bg-background` (the grey page colour in light mode),\n * BasicInput and the control Textarea were `bg-transparent` (grey on a grey\n * page), while the Select trigger filled with `bg-card` (white). On one form\n * the text fields therefore looked disabled beside white Selects\n * (/hr/settings/employer, the message-template editor) — a screen that lies\n * about what it will let you do.\n *\n * The surface is the Select's: the card fill and the regular border. A caller\n * that genuinely wants no fill (an inline cell editor) still passes\n * `bg-transparent`, which wins through `cn`.\n */\nexport const FIELD_SURFACE_CLASS = \"border border-border bg-card\";\n","\"use client\";\nimport { createContext, useContext, type Context, type ComponentType, type ReactNode, type MouseEventHandler } from \"react\";\nimport type { CopyControlProps } from \"./copy-types\";\nimport type { MatrxColumnDef, MatrxDataTableDensity, MatrxDataTableRecordControls, TableSavedViewsProps } from \"./types\";\nimport type {\n MatrxTableMenuIconName,\n MatrxTableMenuItem,\n MatrxTableMenuPayload,\n MatrxTableMenuSectionsResolver,\n MatrxTableMenuTarget,\n} from \"./menu-targets\";\n\nexport type {\n MatrxTableMenuIconName,\n MatrxTableMenuItem,\n MatrxTableMenuSection,\n MatrxTableMenuSectionsResolver,\n} from \"./menu-targets\";\n\nexport type {\n AgentPayloadInput,\n AiCustomSource,\n AiVariant,\n CopyControlProps,\n CopyExportConfig,\n} from \"./copy-types\";\n\nexport interface TableLinkProps { href: string; children: ReactNode; className?: string; onClick?: MouseEventHandler<HTMLAnchorElement>; }\n/**\n * Host-owned toolbar affordance. The table package keeps operation state and\n * labels; an application can supply its canonical icon-button primitive\n * without making the shared package depend on an application UI package.\n */\nexport interface TableToolbarActionProps { ariaLabel: string; tooltip?: string | undefined; disabled?: boolean | undefined; busy?: boolean | undefined; /** Indicates a selected mutually-exclusive action such as the current page. */ active?: boolean | undefined; onClick: () => void; children: ReactNode; }\nexport interface TableSidePanelProps { title: string; titleNode?: ReactNode; description?: ReactNode; onClose: () => void; /** Increments on every open request, including a repeat open of the row already shown — a host whose panel can sit in the background (a tab) brings it forward when this changes. */ openRequest?: number; defaultWidth?: number; headerActions?: ReactNode; children: ReactNode; }\nexport interface TableWindowPanelProps { id: string; title: string; onClose: () => void; width?: number; height?: number; minWidth?: number; minHeight?: number; actionsRight?: ReactNode; bodyClassName?: string; sidebarDefaultSize?: number; sidebarMinSize?: number; sidebar?: ReactNode; children: ReactNode; }\nexport interface TableEntityRefProps { token: string; id: string; href?: string; children: ReactNode; className?: string; }\nexport interface TablePeekProps { kind: string; id: string; href?: string; onClose: () => void; }\nexport interface TableDoors {\n href?: string;\n peekKind?: string;\n canPeek?: boolean;\n /**\n * THE RECORD'S OWN MENU (lane DRILL-PARITY-LAST): what its kind offers wherever a table names it —\n * a person's admin destinations, an organization's pages — as neutral items the table draws in a\n * row's menu and on a right-click. Absent = the record has only its open and preview doors.\n */\n menu?: MatrxTableMenuItem[];\n}\n/**\n * The host's door onto the table's right-click levels.\n *\n * A canonical table registers ONE resolver per instance. The host's own menu\n * reads which of the four levels was clicked (`readMenuTarget`) and asks for\n * that level's descriptor — the package never interprets what comes back, and\n * the host never reaches into the table for the row or the range.\n */\nexport interface TableRowContextRegistry { register(tableId: string, resolve: (target: MatrxTableMenuTarget) => unknown): () => void; }\nexport interface TableContextMenuBoundaryProps {\n label: string;\n children: ReactNode;\n /**\n * The consumer's own sections, asked per right-click. Present only when the\n * table's consumer declared `contextMenu.sections`; the host reads the level\n * off the clicked element (`readMenuTarget`), calls this, and draws what comes\n * back in its own menu. Absent, the boundary behaves exactly as before.\n */\n sections?: MatrxTableMenuSectionsResolver | undefined;\n}\n/**\n * The host's view of a failed read with NO rows to show (RC-B12 round 13):\n * its error display (with the host's actions — matrx-frontend's Alchemy Menu)\n * and a retry. Without a host port the table draws a package `ErrorBox`.\n */\nexport interface TableReadFailureProps { error: unknown; what: string; onRetry?: (() => void) | undefined; }\n/**\n * The host's notice above rows kept from an earlier read when the latest read\n * failed: the rows may be out of date. Without a host port the table draws a\n * package `ErrorBox` in warning colours.\n */\nexport interface TableStaleNoticeProps { error: unknown; what: string; onRetry?: (() => void) | undefined; }\n/** The host's glyph for a menu icon name. A host without one draws labels only. */\nexport interface TableMenuIconProps { name: MatrxTableMenuIconName; className?: string | undefined; }\n/** The host's custom-field columns for a registry token over the given organizations (lane 7 W5). */\nexport interface TableCustomFieldColumns<T> { columns: MatrxColumnDef<T>[]; }\nexport interface MatrxDataTableHost { /** A HOOK, bound once by the host: the custom-field columns of `token` (null = none) for `organizationIds`. */ useCustomFieldColumns?: <T>(token: string | null, organizationIds: readonly string[]) => TableCustomFieldColumns<T> | null; JsonViewer?: ComponentType<{ data: object | string }>; Link?: ComponentType<TableLinkProps>; CopyControls?: ComponentType<CopyControlProps>; ToolbarAction?: ComponentType<TableToolbarActionProps>; SidePanelSurface?: ComponentType<TableSidePanelProps>; WindowPanel?: ComponentType<TableWindowPanelProps>; EntityRef?: ComponentType<TableEntityRefProps>; resolveEntityDoors?: (token: string, id: string, href?: string | null) => TableDoors | null; ResourcePeek?: ComponentType<TablePeekProps>; SavedViews?: ComponentType<TableSavedViewsProps>; rowContextRegistry?: TableRowContextRegistry; createDefaultMenuContext?: (payload: MatrxTableMenuPayload) => unknown; ContextMenuBoundary?: ComponentType<TableContextMenuBoundaryProps>; MenuIcon?: ComponentType<TableMenuIconProps>; /** A failed read with no rows (RC-B12 r13). */ ReadFailure?: ComponentType<TableReadFailureProps>; /** A failed refresh over kept rows (RC-B12 r13). */ StaleNotice?: ComponentType<TableStaleNoticeProps>; /** Host default; a table's explicit density takes precedence. */ defaultDensity?: MatrxDataTableDensity; notify?: { success(message: string): void; error(message: string): void }; }\n// Public entrypoints are independently bundled in ESM and CJS. The context\n// identity must survive those bundle boundaries; values stay provider-scoped.\nconst HOST_SLOT = Symbol.for(\"ai-matrx.design-system.table-host-context\");\nconst hostRegistry = globalThis as typeof globalThis & { [HOST_SLOT]?: Context<MatrxDataTableHost> };\nconst HostContext = hostRegistry[HOST_SLOT] ??= createContext<MatrxDataTableHost>({});\nexport function MatrxDataTableProvider({ value, children }: { value: MatrxDataTableHost; children: ReactNode }) { return <HostContext.Provider value={value}>{children}</HostContext.Provider>; }\nexport function useMatrxDataTableHost(): MatrxDataTableHost { return useContext(HostContext); }\n\nexport interface MatrxTableRowAlchemy {\n copy: CopyControlProps;\n controls?: MatrxDataTableRecordControls;\n placement: \"inline\" | \"menu\";\n ready: boolean;\n activate(): void;\n /** Mount Alchemy's canonical palette in the host row menu. */\n mountMenu(target: HTMLElement | null, onClose?: () => void, restoreFocus?: () => void): void;\n prepare(restoreFocus?: () => void): Promise<void>;\n}\n\nconst ROW_ALCHEMY_SLOT = Symbol.for(\"ai-matrx.design-system.table-row-alchemy-context\");\nconst rowAlchemyRegistry = globalThis as typeof globalThis & { [ROW_ALCHEMY_SLOT]?: Context<MatrxTableRowAlchemy | null> };\nconst RowAlchemyContext = rowAlchemyRegistry[ROW_ALCHEMY_SLOT] ??= createContext<MatrxTableRowAlchemy | null>(null);\n\nexport function MatrxTableRowAlchemyScope({ value, children }: { value: MatrxTableRowAlchemy; children: ReactNode }) { return <RowAlchemyContext.Provider value={value}>{children}</RowAlchemyContext.Provider>; }\n\nexport function useMatrxTableRowAlchemy(): MatrxTableRowAlchemy | null { return useContext(RowAlchemyContext); }\n\nconst ROW_CONTROLS_SLOT = Symbol.for(\"ai-matrx.design-system.table-row-controls-context\");\nconst rowControlsRegistry = globalThis as typeof globalThis & { [ROW_CONTROLS_SLOT]?: Context<MatrxDataTableRecordControls | null> };\nconst RowControlsContext = rowControlsRegistry[ROW_CONTROLS_SLOT] ??= createContext<MatrxDataTableRecordControls | null>(null);\nexport function MatrxTableRowControlsScope({ value, children }: { value: MatrxDataTableRecordControls; children: ReactNode }) { return <RowControlsContext.Provider value={value}>{children}</RowControlsContext.Provider>; }\nexport function useMatrxTableRowControls(): MatrxDataTableRecordControls | null { return useContext(RowControlsContext); }\n"],"mappings":";;;;AACA,SAAS,mBAAmB;;;ACC5B,SAAS,YAAY;AACrB,SAAS,WAA8B;AACvC,YAAY,WAAW;;;ACJvB,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAA8B;AAClD,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;AD0IM;AAvIC,IAAM,iBAAiB;AAAA,EAC5B;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAOT,SAAS;AAAA,QACT,aACE;AAAA;AAAA,QAEF,SACE;AAAA,QACF,SACE;AAAA,QACF,WACE;AAAA,QACF,OAAO;AAAA,QACP,MAAM;AAAA,QACN,QACE;AAAA,MACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAQA,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,SAAS;AAAA;AAAA,QAET,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,OAAO;AAAA,QACP,OAAO;AAAA,QACP,MAAM;AAAA,QACN,WAAW;AAAA;AAAA,QAEX,WAAW;AAAA,MACb;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAsCA,IAAM,oBAAoB,oBAAI,IAAI;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AACD,IAAM,eAAe,oBAAI,IAAI,CAAC,QAAQ,WAAW,WAAW,CAAC;AAkB7D,SAAS,aAAa,OAAkD;AACtE,QAAM,eAAe;AACrB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AAA,cACV,cAAc,aAAa,wBAAwB;AAAA,cACnD,qBAAoB;AAAA,cACpB,mBAAmB;AAAA,cACnB,SAAS,MAAM,aAAa,UAAU;AAAA,cACtC,UAAU;AAAA,cAEV,0BAAAA,KAAC,iBAAc,WAAU,WAAU;AAAA;AAAA,UACrC;AAAA;AAAA;AAAA,IAEF;AAAA,KAEJ,GACA;AAEJ;","names":["React","React","jsx","jsx","jsx","jsx","jsx","cva","React","jsx","jsxs","jsx","jsx","jsx","jsxs","cva","jsx","jsxs","createContext","useContext","jsx","useContext","createContext","createContext","jsx","jsxs"]}
|
|
1
|
+
{"version":3,"sources":["../../src/data-table/pagination.tsx","../../src/button.tsx","../../src/cn.ts","../../src/tooltip.tsx","../../src/motion.ts","../../src/portal-container.tsx","../../src/title-tooltips.ts","../../src/data-table/icons.tsx","../../src/select.tsx","../../src/icons.tsx","../../src/field-surface.ts","../../src/data-table/host.tsx"],"sourcesContent":["\"use client\";\nimport { formatCount } from \"@ai-matrx/kit/format\";\nimport { Button, type ButtonProps } from \"../button\";\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from \"../tooltip\";\nimport {\n ChevronsLeft,\n ChevronLeft,\n ChevronsRight,\n ChevronRight,\n} from \"./icons\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"../select\";\nimport { cn } from \"../cn\";\nimport { useMatrxDataTableHost, type TableToolbarActionProps } from \"./host\";\nimport type { ComponentType } from \"react\";\n\nexport interface GenericTablePaginationProps {\n totalItems: number;\n /** Offset source whose exact total is unavailable; never invent a last page. */\n unknownTotal?: { pageRowCount: number; hasNextPage: boolean };\n isFetching?: boolean;\n itemsPerPage: number;\n currentPage: number;\n onPageChange: (page: number) => void;\n onItemsPerPageChange: (items: number) => void;\n pageSizeOptions?: number[];\n className?: string;\n showItemsPerPageSelect?: boolean;\n showPageInfo?: boolean;\n showPageControls?: boolean;\n maxPagesToShow?: number;\n containerClassName?: string;\n selectContainerClassName?: string;\n infoContainerClassName?: string;\n controlsContainerClassName?: string;\n pageButtonClassName?: string;\n pageActiveButtonClassName?: string;\n navButtonClassName?: string;\n /** Value emitted for the optional All choice. Defaults to the current total. */\n allValue?: number;\n /** Honest label for the optional all-rows choice. */\n allOptionLabel?: string;\n showAllOption?: boolean;\n layoutType?: \"grid\" | \"flex\";\n labelFormat?: (start: number, end: number, total: number) => string;\n compact?: boolean;\n hideEntriesInfo?: boolean;\n /** Keeps progressive local pagination in one stable footer, including at\n * exhaustion. Counts describe rendered rows, not a numbered page. */\n progressive?: { loadedCount?: number; shownCount: number; hasMore: boolean; onShowMore: () => void };\n /** The table's read has not produced a count: \"failed\" (the read failed with no\n * rows on screen) draws \"—\" labelled \"Row count unavailable\"; \"loading\" draws no\n * count. Never \"0 rows\" — zero is an answer only after a read that succeeded.\n * Rows kept over a failed refresh are counted normally (stale-while-error). */\n countUnavailable?: \"failed\" | \"loading\";\n}\n\nfunction PageNavigationControl({\n label,\n disabledHint,\n visibilityClassName = \"inline-flex\",\n disabled,\n className,\n ...props\n}: ButtonProps & {\n label: string;\n disabledHint: string;\n visibilityClassName?: string;\n}) {\n const button = (\n <Button\n {...props}\n disabled={disabled}\n aria-label={label}\n className={cn(visibilityClassName, className, \"[&_svg]:size-5\")}\n />\n );\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n {disabled ? (\n <span\n className={cn(visibilityClassName, \"rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring\")}\n tabIndex={0}\n aria-label={`${label} — ${disabledHint.toLowerCase()}`}\n >\n {button}\n </span>\n ) : button}\n </TooltipTrigger>\n <TooltipContent>{disabled ? disabledHint : label}</TooltipContent>\n </Tooltip>\n );\n}\n\nfunction PaginationAction({\n HostAction,\n compact = false,\n active = false,\n disabledHint,\n visibilityClassName = \"inline-flex\",\n fallbackClassName,\n ...props\n}: TableToolbarActionProps & {\n HostAction: ComponentType<TableToolbarActionProps> | undefined;\n compact?: boolean;\n active?: boolean;\n disabledHint: string;\n visibilityClassName?: string;\n fallbackClassName?: string;\n}) {\n if (HostAction) {\n return (\n <span data-matrx-table-icon-action className={visibilityClassName}>\n <HostAction\n {...props}\n active={active}\n tooltip={props.disabled ? disabledHint : (props.tooltip ?? props.ariaLabel)}\n />\n </span>\n );\n }\n return (\n <PageNavigationControl\n variant=\"outline\"\n size=\"icon\"\n visibilityClassName={visibilityClassName}\n label={props.ariaLabel}\n disabledHint={disabledHint}\n disabled={props.disabled}\n onClick={props.onClick}\n className={cn(\n PAGINATION_ACTION_CLASS,\n compact && \"h-8 w-8 min-h-8 min-w-8\",\n active && PAGINATION_ACTIVE_CLASS,\n fallbackClassName,\n )}\n aria-current={active ? \"page\" : undefined}\n data-matrx-table-icon-action\n >\n {props.children}\n </PageNavigationControl>\n );\n}\n\n// Table footers use an actual 44px control shape. A pseudo-element inset into a\n// smaller visual box let the select text and chevron escape its border.\nconst PAGINATION_ACTION_CLASS = \"h-11 w-11 min-h-11 min-w-11 rounded-md border border-border bg-card p-0 text-sm shadow-none hover:bg-accent disabled:opacity-40 [&_svg]:size-5\";\nconst PAGINATION_ACTIVE_CLASS = \"border-primary bg-primary text-primary-foreground hover:bg-primary/90\";\n\nexport default function GenericTablePagination({\n totalItems,\n unknownTotal,\n isFetching = false,\n itemsPerPage,\n currentPage,\n onPageChange,\n onItemsPerPageChange,\n pageSizeOptions = [5, 10, 25, 50, 100],\n className = \"\",\n showItemsPerPageSelect = true,\n showPageInfo = true,\n showPageControls = true,\n maxPagesToShow = 5,\n containerClassName = \"\",\n selectContainerClassName = \"\",\n infoContainerClassName = \"\",\n controlsContainerClassName = \"\",\n pageButtonClassName = \"\",\n pageActiveButtonClassName = \"\",\n navButtonClassName = \"\",\n allValue = totalItems,\n allOptionLabel = \"All\",\n showAllOption = true,\n layoutType = \"grid\",\n labelFormat,\n compact = false,\n hideEntriesInfo = false,\n progressive,\n countUnavailable,\n}: GenericTablePaginationProps) {\n const host = useMatrxDataTableHost();\n const positivePageSizes = pageSizeOptions.filter((size) => size > 0);\n const availablePageSizes =\n itemsPerPage > 0 && !positivePageSizes.includes(itemsPerPage)\n ? [...positivePageSizes, itemsPerPage].sort((a, b) => a - b)\n : positivePageSizes;\n const pageSizeChoices = [...new Set(availablePageSizes)];\n const hasDistinctAllChoice =\n showAllOption && !unknownTotal && !pageSizeChoices.includes(allValue);\n if (hasDistinctAllChoice) pageSizeChoices.push(allValue);\n const pageSizeIsFixed = pageSizeChoices.length <= 1;\n const effectiveItemsPerPage =\n itemsPerPage === 0 ? Math.max(totalItems, 1) : Math.max(itemsPerPage, 1);\n\n const totalPages = Math.max(1, Math.ceil(totalItems / effectiveItemsPerPage));\n\n const getPageNumbers = (limit = maxPagesToShow) => {\n let startPage = Math.max(1, currentPage - Math.floor(limit / 2));\n const endPage = Math.min(totalPages, startPage + limit - 1);\n startPage = Math.max(1, endPage - limit + 1);\n return Array.from(\n { length: endPage - startPage + 1 },\n (_, i) => startPage + i,\n );\n };\n\n const isFirstPageDisabled = isFetching || currentPage <= 1;\n const isLastPageDisabled = isFetching || (unknownTotal ? !unknownTotal.hasNextPage : currentPage >= totalPages);\n const startItem = totalItems === 0 ? 0 : progressive ? 1 : (currentPage - 1) * effectiveItemsPerPage + 1;\n const endItem = Math.min(progressive?.shownCount ?? currentPage * effectiveItemsPerPage, totalItems);\n\n const defaultLabelFormat = (start: number, end: number, total: number) => {\n if (total === 0 && !unknownTotal) return \"0 rows\";\n if (unknownTotal) return `${formatCount(unknownTotal.pageRowCount)} on page ${formatCount(currentPage)}`;\n if (progressive) return progressive.loadedCount !== undefined && progressive.loadedCount !== total\n ? `${end} shown / ${total} matching · ${progressive.loadedCount} loaded`\n : `${end} shown / ${total} loaded`;\n return compact\n ? `${start}-${end} of ${total}`\n : `Showing ${start} to ${end} of ${total} entries`;\n };\n\n const formatLabel = labelFormat || defaultLabelFormat;\n\n const containerClass = cn(\n \"w-full items-center\",\n !compact && \"border-t border-border\",\n layoutType === \"grid\"\n ? progressive\n ? \"grid grid-cols-[auto_minmax(0,1fr)_auto]\"\n : \"grid grid-cols-[auto_minmax(0,1fr)_auto]\"\n : \"flex flex-nowrap justify-between\",\n compact\n ? \"box-border min-h-8 gap-0 px-0 py-0\"\n : \"gap-1 px-2 py-1 sm:gap-4 sm:px-3\",\n className,\n containerClassName,\n );\n\n return (\n <TooltipProvider>\n <div data-matrx-table-footer className={containerClass}>\n {/* Items Per Page Select */}\n {showItemsPerPageSelect && (\n <div\n className={cn(\n \"flex min-w-0 justify-start\",\n !compact && \"sm:p-1\",\n selectContainerClassName,\n )}\n >\n <Select\n disabled={isFetching || pageSizeIsFixed}\n value={itemsPerPage.toString()}\n onValueChange={(value) => onItemsPerPageChange(parseInt(value))}\n >\n <SelectTrigger\n aria-label={progressive ? \"Visible row limit\" : \"Rows per page\"}\n className={cn(\n \"focus:ring-0\",\n compact\n ? \"h-8 min-h-8 min-w-20 rounded-md border border-border bg-card px-2 text-sm hover:bg-accent [&_svg]:size-4\"\n : \"h-8 w-[3.75rem] text-xs sm:w-36 sm:text-sm\",\n )}\n >\n <SelectValue placeholder={itemsPerPage.toString()} />\n </SelectTrigger>\n <SelectContent>\n {pageSizeChoices.map((size) => (\n <SelectItem key={size} value={size.toString()}>\n {size === allValue && hasDistinctAllChoice\n ? allOptionLabel\n : size}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n )}\n\n <div\n className={cn(\"flex min-w-0 justify-center\", infoContainerClassName)}\n >\n {/* Page Info - only show if not hidden But always show the div. */}\n {showPageInfo && !hideEntriesInfo && countUnavailable === \"failed\" ? (\n <span\n role=\"img\"\n aria-label=\"Row count unavailable\"\n title=\"Row count unavailable\"\n className=\"truncate text-sm tabular-nums text-muted-foreground\"\n >\n <span aria-hidden=\"true\">—</span>\n </span>\n ) : showPageInfo && !hideEntriesInfo && !countUnavailable && (\n <>\n <span className=\"truncate text-xs tabular-nums text-muted-foreground sm:hidden\">\n {labelFormat ? formatLabel(startItem, endItem, totalItems) : unknownTotal ? defaultLabelFormat(startItem, endItem, totalItems) : totalItems === 0 ? \"0 rows\" : progressive ? `${endItem}/${totalItems} ${progressive.loadedCount !== undefined && progressive.loadedCount !== totalItems ? \"matching\" : \"loaded\"}` : `${startItem}–${endItem} of ${totalItems}`}\n </span>\n <span\n className={`hidden whitespace-nowrap ${\n compact ? \"text-sm\" : \"text-sm\"\n } min-w-0 truncate text-muted-foreground sm:inline`}\n >\n {formatLabel(startItem, endItem, totalItems)}\n </span>\n </>\n )}\n </div>\n\n {/* Keep the footer's control position stable even when no further page exists. */}\n {progressive ? (progressive.hasMore ? (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button type=\"button\" variant=\"ghost\" size=\"sm\" aria-label=\"Show more rows\"\n className=\"h-8 min-h-8 shrink-0 justify-self-end px-2 text-xs\"\n onClick={progressive.onShowMore}>Show more</Button>\n </TooltipTrigger>\n <TooltipContent>Show more already-loaded rows</TooltipContent>\n </Tooltip>\n ) : null) : showPageControls && (\n <div\n className={cn(\n // ONE ROW ON A PHONE (page-pass 2026-09-27, /education/flashcards at 375px: the\n // pager wrapped onto a second row): prev · \"1–25 of 80\" · next; page numbers\n // and first/last from sm up.\n \"flex min-w-0 items-center justify-end\",\n compact ? \"gap-0\" : \"gap-0.5 sm:gap-1\",\n controlsContainerClassName,\n )}\n >\n <PaginationAction\n HostAction={host.ToolbarAction}\n compact={compact}\n ariaLabel=\"First page\"\n disabledHint={isFetching ? \"Loading source page\" : \"Already on the first page\"}\n visibilityClassName=\"hidden sm:inline-flex\"\n fallbackClassName={navButtonClassName}\n onClick={() => onPageChange(1)}\n disabled={isFirstPageDisabled}\n >\n <ChevronsLeft className=\"h-5 w-5\" />\n </PaginationAction>\n\n <PaginationAction\n HostAction={host.ToolbarAction}\n compact={compact}\n ariaLabel=\"Previous page\"\n disabledHint={isFetching ? \"Loading source page\" : \"Already on the first page\"}\n fallbackClassName={navButtonClassName}\n onClick={() => onPageChange(currentPage - 1)}\n disabled={isFirstPageDisabled}\n >\n <ChevronLeft className=\"h-5 w-5\" />\n </PaginationAction>\n\n {(unknownTotal ? [currentPage] : getPageNumbers(3)).map((page) => (\n <PaginationAction\n key={`mobile-${page}`}\n HostAction={host.ToolbarAction}\n compact={compact}\n ariaLabel={`Page ${page}`}\n active={currentPage === page}\n disabledHint={isFetching ? \"Loading source page\" : `Already on page ${page}`}\n visibilityClassName=\"hidden\"\n fallbackClassName={page === currentPage ? pageActiveButtonClassName : pageButtonClassName}\n onClick={() => { if (!unknownTotal) onPageChange(page); }}\n disabled={Boolean(unknownTotal) || isFetching || totalPages <= 1}\n >\n <span>{page}</span>\n </PaginationAction>\n ))}\n\n {(unknownTotal ? [currentPage] : getPageNumbers()).map((page) => (\n <PaginationAction\n key={`desktop-${page}`}\n HostAction={host.ToolbarAction}\n compact={compact}\n ariaLabel={`Page ${page}`}\n active={currentPage === page}\n disabledHint={isFetching ? \"Loading source page\" : `Already on page ${page}`}\n visibilityClassName=\"hidden sm:inline-flex\"\n fallbackClassName={currentPage === page ? pageActiveButtonClassName : pageButtonClassName}\n onClick={() => { if (!unknownTotal) onPageChange(page); }}\n disabled={Boolean(unknownTotal) || isFetching || totalPages <= 1}\n >\n <span>{page}</span>\n </PaginationAction>\n ))}\n\n <PaginationAction\n HostAction={host.ToolbarAction}\n compact={compact}\n ariaLabel=\"Next page\"\n disabledHint={isFetching ? \"Loading source page\" : \"Already on the last page\"}\n fallbackClassName={navButtonClassName}\n onClick={() => onPageChange(currentPage + 1)}\n disabled={isLastPageDisabled}\n >\n <ChevronRight className=\"h-5 w-5\" />\n </PaginationAction>\n\n <PaginationAction\n HostAction={host.ToolbarAction}\n compact={compact}\n ariaLabel=\"Last page\"\n disabledHint={unknownTotal ? \"Last page is unknown\" : isFetching ? \"Loading source page\" : \"Already on the last page\"}\n visibilityClassName=\"hidden sm:inline-flex\"\n fallbackClassName={navButtonClassName}\n onClick={() => { if (!unknownTotal) onPageChange(totalPages); }}\n disabled={Boolean(unknownTotal) || isLastPageDisabled}\n >\n <ChevronsRight className=\"h-5 w-5\" />\n </PaginationAction>\n </div>\n )}\n </div>\n </TooltipProvider>\n );\n}\n","\"use client\";\n\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nexport const buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:opacity-50 active:scale-[0.98] [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90\",\n /**\n * An explicit spelling of `default`, identical by construction. It is\n * not decoration: matrx-frontend's `ButtonMine` fork carried it, ~17\n * call sites say `variant=\"primary\"`, and the alternative to keeping\n * the word was a host shim translating a prop — the massage C22 bans.\n */\n primary: \"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90\",\n /** The affirmative twin of `destructive` — confirm, approve, publish. */\n success:\n \"bg-success text-success-foreground shadow-sm hover:bg-success/90\",\n outline:\n \"border border-border bg-card shadow-sm hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n subtle:\n \"border border-transparent bg-muted/50 text-foreground hover:border-border hover:bg-muted\",\n },\n /**\n * ONE size scale, xs → 3xl, plus the two icon boxes. The top and bottom\n * of the scale came in from matrx-frontend's `ButtonMine` fork (2026-09-07):\n * a dense toolbar needs `xs`, and a marketing/hero call to action needs\n * `xl`+. A host that has to reach outside this scale forks the button,\n * which is exactly how `ButtonMine` was born.\n */\n size: {\n xs: \"h-6 rounded-md px-1 text-xs\",\n sm: \"h-8 rounded-md px-3 text-xs\",\n default: \"h-9 px-4 py-2\",\n /** An explicit spelling of `default` (the fork's middle rung). */\n md: \"h-9 px-4 py-2\",\n lg: \"h-10 rounded-md px-6\",\n xl: \"h-12 px-8 py-3 text-base\",\n \"2xl\": \"h-14 px-10 py-3 text-base\",\n \"3xl\": \"h-16 px-12 py-3 text-base\",\n icon: \"h-9 w-9\",\n \"icon-sm\": \"h-7 w-7\",\n /** A circular icon box — an avatar-shaped control, not a square one. */\n roundIcon: \"h-8 w-8 rounded-full p-0\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\n/**\n * THE TOUCH FLOOR (2026-09-17).\n *\n * Every rung of the size scale below `xl` is shorter than the 44px platform\n * touch target: `xs` 24, `icon-sm` 28, `sm` 32, `roundIcon` 32, `default`/`md`\n * 36, `icon` 36, `lg` 40. Measured live at 390x844 on `/masterwork/<id>`, ALL\n * SEVEN design-system Buttons in the viewport were under the floor (four at\n * 32px, two at 28px).\n *\n * The floor is raised in CSS, under `@media (pointer: coarse)` ONLY, so DESKTOP\n * DENSITY IS UNTOUCHED — a narrow desktop window is not a finger, which is why\n * this rule deliberately does NOT carry the `(max-width: 1023px)` half that the\n * dialog-footer floor in `styles.css` uses.\n *\n * WHY EVERY SUB-44 RUNG AND NOT JUST `sm`: a floor applied to one rung inverts\n * the scale. Lift `sm` (32) alone and it renders TALLER on a phone than\n * `default` (36) and `lg` (40) — the scale would stop being a scale. A floor is\n * only coherent applied to everything beneath it.\n *\n * The mechanism is `min-height`/`min-width`, not an invisible 44px hit ring\n * over a 32px pill. A ring is the tap-target package's pattern and it is right\n * THERE (isolated glass buttons), but on a toolbar of adjacent `sm` buttons\n * separated by an 8px gap the rings overlap in the gap and one button silently\n * eats taps aimed at its neighbour — unacceptable where a neighbour is\n * destructive. `lib/entity-list`'s own phone contract (`h-11 min-w-11`) already\n * chose growth for the same reason; this is that choice made once, in the\n * primitive, instead of per surface.\n *\n * `min-width` is raised only on the SQUARE rungs (`icon`, `icon-sm`,\n * `roundIcon`) — a text button is already wider than 44px, and forcing a floor\n * on it would stretch short labels.\n *\n * Opt out on a control that is genuinely not a finger target with\n * `data-touch-exempt` (same escape hatch the footer floor honours), and say why\n * at the call site.\n */\nconst TOUCH_FLOOR_SIZES = new Set([\n \"xs\",\n \"sm\",\n \"default\",\n \"md\",\n \"lg\",\n \"icon\",\n \"icon-sm\",\n \"roundIcon\",\n]);\nconst SQUARE_SIZES = new Set([\"icon\", \"icon-sm\", \"roundIcon\"]);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\n/**\n * THE CURSOR LAW (common-docs/policies/cursor-law.md): a disabled control says\n * so with `not-allowed`, which the package's base layer sets on `:disabled`\n * and `[aria-disabled=\"true\"]`. `pointer-events: none` is never the mechanism\n * — it swallows the cursor. A native `<button disabled>` already fires no\n * click; the two shapes that WOULD fire one are handled here, once:\n * - `asChild` + `disabled` (a Link wearing button styles): marked\n * `aria-disabled`, taken out of the tab order, and its click is swallowed;\n * - `aria-disabled=\"true\"` on an enabled button: its click is swallowed.\n */\nfunction swallowClick(event: React.MouseEvent<HTMLButtonElement>): void {\n event.preventDefault();\n event.stopPropagation();\n}\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, onClick, ...props }, ref) => {\n const Component = asChild ? Slot : \"button\";\n const resolvedSize = size ?? \"default\";\n const disabledChild = asChild && Boolean(props.disabled);\n const ariaDisabled = props[\"aria-disabled\"];\n const inert =\n disabledChild || ariaDisabled === true || ariaDisabled === \"true\";\n return (\n <Component\n className={cn(buttonVariants({ variant, size, className }))}\n data-matrx-button=\"\"\n data-tap-floor={TOUCH_FLOOR_SIZES.has(resolvedSize) ? \"\" : undefined}\n data-tap-floor-square={\n SQUARE_SIZES.has(resolvedSize) ? \"\" : undefined\n }\n ref={ref}\n {...props}\n aria-disabled={disabledChild ? true : ariaDisabled}\n tabIndex={disabledChild ? -1 : props.tabIndex}\n onClick={inert ? swallowClick : onClick}\n />\n );\n },\n);\nButton.displayName = \"Button\";\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","\"use client\";\n\n/**\n * Tooltip — the ONE tooltip in the fleet.\n *\n * THE COLLAPSE (0.6.0). Two implementations existed: matrx-frontend's\n * `components/ui/tooltip.tsx` (182 import sites) and `@ai-matrx/tap-target`'s\n * `src/tooltip.tsx` — the latter an explicit inlined PORT of the former,\n * carrying a header that said so. tap-target shipped it only because its ~60\n * tap buttons need a tooltip and no shared package owned one; four repos then\n * adopted `TooltipProvider` from tap-target. That made tap-target — a\n * button-geometry package — the accidental owner of a design-system primitive,\n * with a second copy living in the biggest host.\n *\n * A tooltip is a design-system surface, so it lives here. tap-target now takes\n * `@ai-matrx/design-system` as an ordinary sibling dependency and imports this\n * file; its own copy is deleted, and its re-export removed. The DAG already\n * ordered design-system before tap-target, so no cycle is introduced.\n *\n * BEHAVIOUR is matrx-frontend's, verbatim, including the ruling both copies\n * carried in prose:\n *\n * 1. THE ROOT RENDERS UNCONDITIONALLY — no hydration mount gate. The gate the\n * host wrapper once carried (\"Radix generates dynamic aria-controls ids that\n * differ between SSR and client\") was false: Radix ids come from React's\n * SSR-stable `useId`. It was actively harmful — a Trigger wraps\n * ALWAYS-VISIBLE content, so `return null` deleted that subtree from SSR and\n * the first client paint.\n *\n * 2. THE SURFACE IS TOKEN-DRIVEN, NOT BRANDED. Popover tokens, not\n * `bg-primary`: rich tooltip content using `text-muted-foreground` was\n * illegible on a brand-coloured background in one theme or the other.\n * Since 2026-09-28 the `.matrx-tooltip` class re-scopes those tokens to a dark,\n * high-contrast chip in both themes (styles.css, THE TOOLTIP SURFACE): the\n * neutral white surface it wore before was indistinguishable from the\n * browser's own `title` box.\n *\n * 3. EVERY `title` IS THIS TOOLTIP. The provider installs the title takeover\n * (`title-tooltips.ts`), so a hand-written `title=` anywhere in the\n * document shows this surface, never the browser's.\n *\n * SEAM INVERSION. The host resolved nested portal targets through\n * `useNestedPortalContainer` (an app hook wired to its dialog + window-panel\n * systems); tap-target's port dropped that seam entirely and always portalled\n * to `document.body` — which is why a tooltip inside a popped-out panel landed\n * in the wrong window. Here it is the package's `PortalContainerProvider`\n * seam: an explicit `container` prop wins, then the injected container, then\n * `document.body`. Both prior behaviours are reachable; neither is forked.\n */\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { MOTION_POPPER } from \"./motion\";\nimport { usePortalContainer } from \"./portal-container\";\nimport { acquireTitleTooltips, TOOLTIP_TRIGGER_ATTR } from \"./title-tooltips\";\n\nexport interface TooltipProviderProps\n extends React.ComponentProps<typeof TooltipPrimitive.Provider> {\n /**\n * THE TITLE TAKEOVER (2026-09-28) — while any provider is mounted, every native\n * `title` attribute in the document shows as this tooltip instead of the\n * browser's (see `title-tooltips.ts`). On by default, because a rule every\n * author must remember is a rule that is broken; pass `false` only for a\n * surface that must keep the browser's own box. One provider opting out does\n * not turn it off while another one is mounted.\n */\n titleTooltips?: boolean;\n}\n\n/**\n * Mount once near the app root. Every tooltip in the tree shares its\n * `delayDuration` / `skipDelayDuration` timing, and the root provider takes\n * over native `title` attributes (see `titleTooltips`).\n */\nfunction TooltipProvider({ titleTooltips = true, ...props }: TooltipProviderProps) {\n React.useEffect(() => {\n if (!titleTooltips) return;\n return acquireTitleTooltips();\n }, [titleTooltips]);\n return <TooltipPrimitive.Provider {...props} />;\n}\n\nconst Tooltip = TooltipPrimitive.Root;\n\n/**\n * Stamps `data-matrx-tooltip-trigger` so the title takeover never draws a\n * second tooltip over a control that already has this one — it still lifts a\n * `title` on the same control, so the browser's box never doubles it either.\n */\nconst TooltipTrigger = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Trigger>\n>((props, ref) => (\n <TooltipPrimitive.Trigger ref={ref} {...{ [TOOLTIP_TRIGGER_ATTR]: \"\" }} {...props} />\n));\nTooltipTrigger.displayName = TooltipPrimitive.Trigger.displayName;\n\nexport interface TooltipContentProps\n extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> {\n /**\n * Explicit portal target; wins over the injected `PortalContainerProvider`\n * value. Pass `null` to force `document.body`.\n */\n container?: HTMLElement | null;\n /**\n * Package-owned open/close motion. Default `true`. Pass `false` for a\n * surface that must appear instantly. It is NOT the reduced-motion switch;\n * `styles.css` already honours `prefers-reduced-motion`.\n */\n animated?: boolean;\n}\n\nconst TooltipContent = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Content>,\n TooltipContentProps\n>(({ className, sideOffset = 4, container, animated = true, ...props }, ref) => {\n const resolved = usePortalContainer(container);\n return (\n <TooltipPrimitive.Portal container={resolved ?? null}>\n <TooltipPrimitive.Content\n ref={ref}\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n \"matrx-tooltip z-[10001] overflow-hidden rounded-md border border-border bg-popover px-2.5 py-1 text-xs font-medium text-popover-foreground\",\n animated && MOTION_POPPER,\n className,\n )}\n {...props}\n />\n </TooltipPrimitive.Portal>\n );\n});\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nexport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };\nexport { acquireTitleTooltips, NATIVE_TITLE_OPT_OUT_ATTR } from \"./title-tooltips\";\n","/**\n * THE MOTION CONTRACT (0.10.0) — the class names every animated surface in\n * this package puts on the DOM, in ONE place.\n *\n * Why a module and not ten inline strings: the sweep that produced this file\n * found the same defect ten times over, and it was invisible each time\n * because each primitive spelled its animation out by hand. Ten hand-written\n * copies of `data-[state=open]:animate-in data-[state=closed]:animate-out\n * data-[state=closed]:fade-out-0 …` meant ten chances to reach for a utility\n * nothing in the package defines — which is exactly what happened. A single\n * exported constant per motion SHAPE means the next primitive cannot invent\n * an eleventh spelling, and `styles.test.ts` can prove every one of them\n * resolves to a rule in the shipped stylesheet.\n *\n * Every rule these name lives in `styles.css` under the package's own\n * keyframes. NONE of them is a Tailwind utility, and none requires a host\n * plugin — see that file's header for the measurement that made this\n * necessary.\n */\n\n/** Modal scrims: Dialog, AlertDialog, Sheet, CommandDialog. Fade only. */\nexport const MOTION_OVERLAY = \"matrx-motion-overlay\";\n\n/** The centred dialog card. Fades and scales; centring is not its business. */\nexport const MOTION_DIALOG = \"matrx-motion-dialog\";\n\n/**\n * THE CENTRING OF A CENTRED DIALOG CARD — package-owned, in the `translate`\n * property, and NEVER a Tailwind `translate-x-[-50%] translate-y-[-50%]` pair.\n *\n * Those utilities do not compile to the same thing in every host: Tailwind v3\n * writes them into `transform`, Tailwind v4 writes them into the independent\n * `translate` property, which COMPOSES with `transform` instead of being\n * replaced by it. 0.10.0's keyframes restated the centring inside `transform`,\n * which was harmless on v3 and doubled the centring on v4 — the card flew in\n * from off the top-left of the viewport for the animation's whole duration and\n * snapped into place at the end (fixed in 0.10.1).\n *\n * Owning it here means one spelling that reads the same on both, and it frees\n * `transform` so the keyframes carry ONLY the delta. Put this on every centred\n * surface UNCONDITIONALLY — it is geometry, so unlike {@link MOTION_DIALOG} it\n * must survive `animated={false}`. Its rule ships in `styles.css`.\n */\nexport const CENTERED_DIALOG = \"matrx-dialog-centered\";\n\n/**\n * The resting gap between a `popper`-positioned surface and its trigger, for\n * the primitives that want one (today: `Select`). Same law and same reason as\n * {@link CENTERED_DIALOG} — a position an animated surface holds AT REST is\n * the `translate` property's job, never a Tailwind translate utility, because\n * those land in `transform` on a v3 host and in `translate` on a v4 one while\n * the keyframes animate `transform` either way. Sizes from\n * `--matrx-popper-offset`; keys off Radix's `data-side`.\n */\nexport const POPPER_OFFSET = \"matrx-popper-offset\";\n\n/** The mobile Dialog / CommandDialog bottom sheet. Slides up and fades. */\nexport const MOTION_BOTTOM_SHEET = \"matrx-motion-bottom-sheet\";\n\n/**\n * Radix-popper surfaces: Popover, DropdownMenu, ContextMenu, HoverCard,\n * Select, Tooltip. Reads `--radix-popper-transform-origin` so the surface\n * grows out of its trigger, and `data-side` so it travels from it.\n */\nexport const MOTION_POPPER = \"matrx-motion-popper\";\n\n/** Edge sheets, one class per `sheetVariants` side. */\nexport const MOTION_SHEET = {\n top: \"matrx-motion-sheet-top\",\n bottom: \"matrx-motion-sheet-bottom\",\n left: \"matrx-motion-sheet-left\",\n right: \"matrx-motion-sheet-right\",\n center: \"matrx-motion-sheet-center\",\n} as const;\n\n/** Skeleton's breathing loop. */\nexport const MOTION_PULSE = \"matrx-pulse\";\n\n/** The spinner loop, for every inline busy indicator in the package. */\nexport const MOTION_SPIN = \"matrx-spin\";\n\n/**\n * Every motion class the package ships, for the guards. If a rule for one of\n * these is missing from `styles.css`, a component animates in no consumer and\n * says nothing about it — the C26 failure this list exists to make loud.\n */\nexport const ALL_MOTION_CLASSES = [\n MOTION_OVERLAY,\n MOTION_DIALOG,\n MOTION_BOTTOM_SHEET,\n MOTION_POPPER,\n ...Object.values(MOTION_SHEET),\n MOTION_PULSE,\n MOTION_SPIN,\n] as const;\n\n/**\n * The host-plugin utilities this package is forbidden to emit. They are\n * supplied by `tailwindcss-animate` / `tw-animate-css`, which is a HOST CSS\n * entry concern a package cannot declare a dependency on: three of the four\n * AI Matrx consumers never loaded it, so every surface wearing these appeared\n * with no animation and no error. `styles.test.ts` fails the build if one\n * comes back.\n */\nexport const FORBIDDEN_HOST_MOTION_UTILITIES = [\n \"animate-in\",\n \"animate-out\",\n \"fade-in\",\n \"fade-out\",\n \"zoom-in\",\n \"zoom-out\",\n \"slide-in-from\",\n \"slide-out-to\",\n \"animate-accordion\",\n \"animate-slide-down\",\n \"animate-slide-up\",\n \"animate-pulse\",\n \"animate-spin\",\n] as const;\n","\"use client\";\n\n/**\n * Injected portal-container seam.\n *\n * The matrx-frontend original resolved nested portal targets through\n * `useNestedPortalContainer` (explicit prop > dialog content > popout body >\n * document.body) — a host-shaped hook wired to that app's dialog and\n * window-panel systems. The package inverts the seam: hosts provide the\n * resolved container through `PortalContainerProvider`; an explicit\n * `container` prop on a component still wins, and with neither the portal\n * falls through to `document.body` (Radix default). Priority semantics are\n * unchanged from the original.\n */\n\nimport * as React from \"react\";\n\n// Shared identity across independently bundled public entrypoints/loaders.\nconst CONTEXT_SLOT = Symbol.for(\"ai-matrx.design-system.portal-container-context\");\nconst contextRegistry = globalThis as typeof globalThis & { [CONTEXT_SLOT]?: React.Context<HTMLElement | null | undefined> };\nconst PortalContainerContext = contextRegistry[CONTEXT_SLOT] ??= React.createContext<HTMLElement | null | undefined>(undefined);\n\nexport interface PortalContainerProviderProps {\n /** Where nested Radix portals (Popover, etc.) should mount. `null`/`undefined` → document.body. */\n container: HTMLElement | null | undefined;\n children: React.ReactNode;\n}\n\nexport function PortalContainerProvider({\n container,\n children,\n}: PortalContainerProviderProps) {\n return (\n <PortalContainerContext.Provider value={container ?? undefined}>\n {children}\n </PortalContainerContext.Provider>\n );\n}\n\n/**\n * Resolve a portal target: explicit prop (including an explicit `null`,\n * meaning \"the default body\") beats the injected container.\n */\nexport function usePortalContainer(\n explicit?: HTMLElement | null,\n): HTMLElement | undefined {\n const injected = React.useContext(PortalContainerContext);\n\n if (explicit !== undefined) {\n return explicit ?? undefined;\n }\n\n return injected ?? undefined;\n}\n","/**\n * THE TITLE TAKEOVER — every native `title` attribute in the document shows\n * as THE fleet tooltip instead of the browser's.\n *\n * Why this exists. A `title=` is the one tooltip nobody has to import, so it\n * is what every hand-written control reaches for: ~50 of them on an ordinary\n * matrx-frontend page (2026-09-28), next to the Radix tooltips on the tap\n * buttons. The browser draws those as a slow, unstyled system box, and a page\n * that mixes the two reads as having \"lost all of its tooltips\" (Arman,\n * 2026-09-28). Asking every author — human or agent — to wrap every control in\n * `<Tooltip>` is a rule that is broken the day it is written. So the\n * `TooltipProvider` every host already mounts at its root installs this layer,\n * and a `title` is simply a tooltip from then on. Nothing to remember.\n *\n * How it works. On hover (mouse or pen) or keyboard focus (`:focus-visible`)\n * of an element that carries a `title`, the attribute is lifted onto\n * `data-matrx-title` for exactly as long as the pointer or focus stays — so\n * the browser has nothing to show — and one shared, script-placed element\n * wearing `.matrx-tooltip` shows the text instead. When the pointer or focus\n * leaves, the `title` is put back, so assistive technology and every\n * `[title]` selector read the element exactly as authored the rest of the\n * time. Touch never shows it (a `title` has no touch affordance either).\n *\n * What it does not draw: a tooltip that only repeats text already readable in\n * full inside the element (it still draws when that text is hidden or\n * truncated).\n *\n * What it leaves alone:\n * - an element that is already a Radix tooltip trigger\n * (`[data-matrx-tooltip-trigger]`, stamped by `TooltipTrigger`): its\n * `title` is still lifted — two tooltips on one control was the other\n * half of the mess — but only the Radix one shows;\n * - anything inside `[data-native-title]` (the explicit opt-out);\n * - SVG `<title>` children, which are elements, not attributes.\n *\n * Placement. Above the element, centred, flipped below when there is no room,\n * clamped into the viewport. `data-title-side=\"right\" | \"left\" | \"bottom\" |\n * \"top\"` on the element or any ancestor states a preferred side — a vertical\n * rail sets `right` once on its container.\n *\n * Installed at most once per document, reference-counted across every\n * mounted provider, and removed when the last one unmounts.\n */\n\nexport const TITLE_TOOLTIP_ATTR = \"data-matrx-title\";\nexport const TOOLTIP_TRIGGER_ATTR = \"data-matrx-tooltip-trigger\";\nexport const NATIVE_TITLE_OPT_OUT_ATTR = \"data-native-title\";\n\ntype Side = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nconst OPEN_DELAY_MS = 350;\n/** Moving from one titled control to the next inside this window is instant. */\nconst SKIP_DELAY_MS = 500;\nconst GAP_PX = 6;\nconst EDGE_PX = 8;\n\nconst SURFACE_CLASS =\n \"matrx-tooltip matrx-title-tooltip matrx-motion-popper z-[10001] rounded-md border border-border bg-popover px-2.5 py-1 text-xs font-medium text-popover-foreground\";\n\ninterface Installation {\n count: number;\n uninstall: () => void;\n}\n\n/**\n * Keyed on the document itself through a registered symbol, never a module\n * WeakMap: tsup bundles this module into more than one entry (`index`,\n * `tap-target`), and two module copies each holding their own map would\n * install twice — two listeners, two surfaces.\n */\nconst INSTALLATION_KEY = Symbol.for(\"@ai-matrx/design-system/title-tooltips\");\ntype DocumentWithInstallation = Document & { [INSTALLATION_KEY]?: Installation };\nconst installations = {\n get: (doc: Document) => (doc as DocumentWithInstallation)[INSTALLATION_KEY],\n set: (doc: Document, value: Installation) => {\n (doc as DocumentWithInstallation)[INSTALLATION_KEY] = value;\n },\n delete: (doc: Document) => {\n delete (doc as DocumentWithInstallation)[INSTALLATION_KEY];\n },\n};\n\n/** Install the takeover on `doc`. Returns the release function. */\nexport function acquireTitleTooltips(doc: Document | undefined = typeof document === \"undefined\" ? undefined : document): () => void {\n if (!doc) return () => {};\n const existing = installations.get(doc);\n if (existing) {\n existing.count += 1;\n } else {\n installations.set(doc, { count: 1, uninstall: install(doc) });\n }\n let released = false;\n return () => {\n if (released) return;\n released = true;\n const current = installations.get(doc);\n if (!current) return;\n current.count -= 1;\n if (current.count <= 0) {\n current.uninstall();\n installations.delete(doc);\n }\n };\n}\n\nfunction install(doc: Document): () => void {\n const win = doc.defaultView;\n let active: HTMLElement | null = null;\n let surface: HTMLDivElement | null = null;\n let openTimer: ReturnType<typeof setTimeout> | undefined;\n let lastClosedAt = 0;\n\n const HTMLElementCtor = win?.HTMLElement;\n\n const titledAncestor = (node: EventTarget | null): HTMLElement | null => {\n if (!HTMLElementCtor || !(node instanceof win!.Node)) return null;\n const start = node instanceof HTMLElementCtor ? node : (node as Node).parentElement;\n if (!start) return null;\n const el = start.closest<HTMLElement>(`[title], [${TITLE_TOOLTIP_ATTR}]`);\n if (!el || !(el instanceof HTMLElementCtor)) return null;\n if (el.closest(`[${NATIVE_TITLE_OPT_OUT_ATTR}]`)) return null;\n return el;\n };\n\n const textOf = (el: HTMLElement) => (el.getAttribute(TITLE_TOOLTIP_ATTR) ?? el.getAttribute(\"title\") ?? \"\").trim();\n\n const lift = (el: HTMLElement) => {\n const title = el.getAttribute(\"title\");\n if (title === null) return;\n el.setAttribute(TITLE_TOOLTIP_ATTR, title);\n el.removeAttribute(\"title\");\n };\n\n const restore = (el: HTMLElement) => {\n const held = el.getAttribute(TITLE_TOOLTIP_ATTR);\n if (held === null) return;\n // An author who changed or removed the title while it was lifted wins:\n // only put ours back when nothing re-set it in the meantime.\n if (!el.hasAttribute(\"title\")) el.setAttribute(\"title\", held);\n el.removeAttribute(TITLE_TOOLTIP_ATTR);\n };\n\n const ensureSurface = () => {\n if (surface && surface.isConnected) return surface;\n surface = doc.createElement(\"div\");\n surface.setAttribute(\"role\", \"tooltip\");\n surface.setAttribute(\"data-slot\", \"title-tooltip\");\n surface.className = SURFACE_CLASS;\n surface.style.visibility = \"hidden\";\n doc.body.appendChild(surface);\n return surface;\n };\n\n const preferredSide = (el: HTMLElement): Side => {\n const hint = el.closest(\"[data-title-side]\")?.getAttribute(\"data-title-side\");\n return hint === \"bottom\" || hint === \"left\" || hint === \"right\" ? hint : \"top\";\n };\n\n const place = (el: HTMLElement, node: HTMLDivElement) => {\n const vw = win?.innerWidth ?? 0;\n const vh = win?.innerHeight ?? 0;\n const anchor = el.getBoundingClientRect();\n const box = node.getBoundingClientRect();\n const fits: Record<Side, boolean> = {\n top: anchor.top - GAP_PX - box.height >= EDGE_PX,\n bottom: anchor.bottom + GAP_PX + box.height <= vh - EDGE_PX,\n left: anchor.left - GAP_PX - box.width >= EDGE_PX,\n right: anchor.right + GAP_PX + box.width <= vw - EDGE_PX,\n };\n const opposite: Record<Side, Side> = { top: \"bottom\", bottom: \"top\", left: \"right\", right: \"left\" };\n const wanted = preferredSide(el);\n const side: Side = fits[wanted] ? wanted : fits[opposite[wanted]] ? opposite[wanted] : wanted;\n\n let x: number;\n let y: number;\n if (side === \"top\" || side === \"bottom\") {\n x = anchor.left + anchor.width / 2 - box.width / 2;\n y = side === \"top\" ? anchor.top - GAP_PX - box.height : anchor.bottom + GAP_PX;\n } else {\n y = anchor.top + anchor.height / 2 - box.height / 2;\n x = side === \"left\" ? anchor.left - GAP_PX - box.width : anchor.right + GAP_PX;\n }\n x = Math.min(Math.max(x, EDGE_PX), Math.max(EDGE_PX, vw - EDGE_PX - box.width));\n y = Math.min(Math.max(y, EDGE_PX), Math.max(EDGE_PX, vh - EDGE_PX - box.height));\n node.style.transform = `translate(${Math.round(x)}px, ${Math.round(y)}px)`;\n node.setAttribute(\"data-side\", side);\n };\n\n const isShown = (node: HTMLElement, root: HTMLElement) => {\n const rect = node.getBoundingClientRect();\n if (rect.width <= 0 || rect.height <= 0) return false;\n for (let cur: HTMLElement | null = node; cur; cur = cur === root ? null : cur.parentElement) {\n const cs = win?.getComputedStyle(cur);\n if (!cs) return false;\n if (cs.display === \"none\" || cs.visibility === \"hidden\" || Number(cs.opacity) === 0) return false;\n }\n return true;\n };\n\n /**\n * A tooltip that repeats text the person can already read in full is noise\n * (an expanded sidebar row, a \"Save\" button titled \"Save\"). It still shows\n * when that text is hidden (a collapsed rail's label) or cut off\n * (truncated) — the two cases a title exists for.\n */\n const repeatsVisibleText = (el: HTMLElement, text: string) => {\n const norm = (t: string) => t.replace(/\\s+/g, \" \").trim().toLowerCase();\n const want = norm(text);\n if (!want || !win) return false;\n const walker = doc.createTreeWalker(el, win.NodeFilter.SHOW_TEXT);\n for (let node = walker.nextNode(); node; node = walker.nextNode()) {\n if (norm(node.textContent ?? \"\") !== want) continue;\n const host = node.parentElement;\n if (!host || !isShown(host, el)) continue;\n if (host.scrollWidth > host.clientWidth + 1) continue;\n return true;\n }\n return false;\n };\n\n const show = (el: HTMLElement, instant: boolean) => {\n if (active !== el) return;\n // A Radix tooltip trigger shows its own tooltip — never a second one.\n if (el.closest(`[${TOOLTIP_TRIGGER_ATTR}]`)) return;\n const text = textOf(el);\n if (!text || !el.isConnected) return;\n if (repeatsVisibleText(el, text)) return;\n const node = ensureSurface();\n node.textContent = text;\n node.style.visibility = \"hidden\";\n node.setAttribute(\"data-state\", instant ? \"instant-open\" : \"delayed-open\");\n place(el, node);\n node.style.visibility = \"visible\";\n if (el.id) node.id = `${el.id}-title-tooltip`;\n };\n\n const hide = () => {\n if (openTimer !== undefined) clearTimeout(openTimer);\n openTimer = undefined;\n if (surface && surface.style.visibility === \"visible\") lastClosedAt = Date.now();\n if (surface) {\n surface.style.visibility = \"hidden\";\n surface.removeAttribute(\"data-state\");\n }\n };\n\n const activate = (el: HTMLElement) => {\n if (active === el) return;\n deactivate();\n active = el;\n lift(el);\n const instant = Date.now() - lastClosedAt < SKIP_DELAY_MS;\n if (instant) show(el, true);\n else openTimer = setTimeout(() => show(el, false), OPEN_DELAY_MS);\n };\n\n const deactivate = () => {\n hide();\n if (active) restore(active);\n active = null;\n };\n\n const onPointerOver = (e: PointerEvent) => {\n if (e.pointerType === \"touch\") return;\n const el = titledAncestor(e.target);\n if (el) activate(el);\n else if (active) deactivate();\n };\n\n const onPointerOut = (e: PointerEvent) => {\n if (!active) return;\n const next = e.relatedTarget;\n if (next instanceof win!.Node && active.contains(next)) return;\n deactivate();\n };\n\n const onFocusIn = (e: FocusEvent) => {\n const el = titledAncestor(e.target);\n if (!el) return;\n let visible = true;\n try {\n visible = (e.target as Element).matches(\":focus-visible\");\n } catch {\n visible = true;\n }\n if (visible) activate(el);\n };\n\n const onFocusOut = (e: FocusEvent) => {\n if (!active) return;\n const next = e.relatedTarget;\n if (next instanceof win!.Node && active.contains(next)) return;\n deactivate();\n };\n\n const onDismiss = () => deactivate();\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") deactivate();\n };\n\n doc.addEventListener(\"pointerover\", onPointerOver, true);\n doc.addEventListener(\"pointerout\", onPointerOut, true);\n doc.addEventListener(\"focusin\", onFocusIn, true);\n doc.addEventListener(\"focusout\", onFocusOut, true);\n doc.addEventListener(\"pointerdown\", onDismiss, true);\n doc.addEventListener(\"keydown\", onKeyDown, true);\n doc.addEventListener(\"scroll\", onDismiss, true);\n win?.addEventListener(\"blur\", onDismiss);\n\n return () => {\n deactivate();\n doc.removeEventListener(\"pointerover\", onPointerOver, true);\n doc.removeEventListener(\"pointerout\", onPointerOut, true);\n doc.removeEventListener(\"focusin\", onFocusIn, true);\n doc.removeEventListener(\"focusout\", onFocusOut, true);\n doc.removeEventListener(\"pointerdown\", onDismiss, true);\n doc.removeEventListener(\"keydown\", onKeyDown, true);\n doc.removeEventListener(\"scroll\", onDismiss, true);\n win?.removeEventListener(\"blur\", onDismiss);\n surface?.remove();\n surface = null;\n };\n}\n","import type { SVGProps } from \"react\";\n\ntype IconProps = SVGProps<SVGSVGElement>;\nfunction Icon({ children, ...props }: IconProps) {\n return <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\" {...props}>{children}</svg>;\n}\nconst path = <path d=\"M4 12h16M12 4v16\" />;\nexport const ChevronLeft = (p: IconProps) => <Icon {...p}><path d=\"m15 18-6-6 6-6\" /></Icon>;\nexport const ChevronRight = (p: IconProps) => <Icon {...p}><path d=\"m9 18 6-6-6-6\" /></Icon>;\nexport const ChevronDown = (p: IconProps) => <Icon {...p}><path d=\"m6 9 6 6 6-6\" /></Icon>;\nexport const ArrowDown = (p: IconProps) => <Icon {...p}><path d=\"M12 4v16m-6-6 6 6 6-6\" /></Icon>;\nexport const ArrowUp = (p: IconProps) => <Icon {...p}><path d=\"M12 20V4m-6 6 6-6 6 6\" /></Icon>;\nexport const ArrowUpDown = (p: IconProps) => <Icon {...p}><path d=\"M12 4v16m-4-12 4-4 4 4m-8 8 4 4 4-4\" /></Icon>;\nexport const Check = (p: IconProps) => <Icon {...p}><path d=\"m5 12 4 4L19 6\" /></Icon>;\nexport const X = (p: IconProps) => <Icon {...p}><path d=\"M6 6l12 12M18 6 6 18\" /></Icon>;\nexport const Search = (p: IconProps) => <Icon {...p}><circle cx=\"11\" cy=\"11\" r=\"6\" /><path d=\"m16 16 4 4\" /></Icon>;\nexport const Plus = (p: IconProps) => <Icon {...p}>{path}</Icon>;\nexport const Minus = (p: IconProps) => <Icon {...p}><path d=\"M4 12h16\" /></Icon>;\n/** lucide `star` — compact saved-item marker. */\nexport const Star = (p: IconProps) => <Icon {...p}><path d=\"m12 2 3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z\" /></Icon>;\n/** lucide `pin` — compact saved-item marker. */\nexport const Pin = (p: IconProps) => <Icon {...p}><path d=\"M12 17v5M9 3h6l1 7 3 3v2H5v-2l3-3 1-7z\" /></Icon>;\nexport const Eraser = (p: IconProps) => <Icon {...p}><path d=\"m16 3 5 5-11 11H5l-3-3L13 5l3-2Z M8 10l6 6 M10 19h12\" /></Icon>;\nexport const GripVertical = (p: IconProps) => <Icon {...p}><circle cx=\"9\" cy=\"6\" r=\"1\" /><circle cx=\"15\" cy=\"6\" r=\"1\" /><circle cx=\"9\" cy=\"12\" r=\"1\" /><circle cx=\"15\" cy=\"12\" r=\"1\" /><circle cx=\"9\" cy=\"18\" r=\"1\" /><circle cx=\"15\" cy=\"18\" r=\"1\" /></Icon>;\n/** lucide `sliders-horizontal` — used for the table column manager. */\nexport const SlidersHorizontal = (p: IconProps) => <Icon {...p}>\n <path d=\"M21 4h-7M10 4H3M21 12h-9M8 12H3M21 20h-5M12 20H3M14 2v4M8 10v4M16 18v4\" />\n</Icon>;\nexport const Trash2 = (p: IconProps) => <Icon {...p}><path d=\"M4 7h16M10 11v6M14 11v6M9 7l1-2h4l1 2M6 7l1 13h10l1-13\" /></Icon>;\n/**\n * Spinner-only incomplete arc. Never a resting glyph — at rest this reads as a\n * broken half-circle. Pair it with `animate-spin` / `matrx-spin` only while\n * work is actually running. Refresh controls use `RefreshControlIcon`.\n */\nexport const Loader2 = (p: IconProps) => <Icon {...p}><path d=\"M20 12a8 8 0 1 1-2.3-5.7\" /></Icon>;\n/** lucide `refresh-cw` — the resting refresh arrows. */\nexport const RefreshCw = (p: IconProps) => (\n <Icon {...p}>\n <path d=\"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\" />\n <path d=\"M21 3v5h-5\" />\n <path d=\"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\" />\n <path d=\"M8 16H3v5\" />\n </Icon>\n);\n/** Refresh affordance: arrows at rest, spinner only while busy. */\nexport function RefreshControlIcon({\n spinning = false,\n className,\n ...props\n}: IconProps & { spinning?: boolean }) {\n if (spinning) {\n return (\n <Loader2\n className={[className, \"animate-spin\"].filter(Boolean).join(\" \")}\n {...props}\n />\n );\n }\n return <RefreshCw className={className} {...props} />;\n}\nexport const Save = (p: IconProps) => <Icon {...p}><path d=\"M5 3h12l2 2v16H5zM8 3v6h8V3M8 21v-7h8v7\" /></Icon>;\nexport const Pencil = (p: IconProps) => <Icon {...p}><path d=\"m4 20 4-1 11-11-3-3L5 16l-1 4z\" /></Icon>;\nexport const Eye = (p: IconProps) => <Icon {...p}><path d=\"M2 12s3-6 10-6 10 6 10 6-3 6-10 6S2 12 2 12z\" /><circle cx=\"12\" cy=\"12\" r=\"2\" /></Icon>;\nexport const PanelRight = (p: IconProps) => <Icon {...p}><rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\" /><path d=\"M15 4v16\" /></Icon>;\nexport const PanelRightOpen = PanelRight;\nexport const WholeWord = (p: IconProps) => <Icon {...p}><path d=\"M4 6l3 12 3-8 3 8 3-12M17 15h4\" /></Icon>;\nexport const ExternalLink = (p: IconProps) => <Icon {...p}><path d=\"M14 4h6v6M20 4l-9 9M19 13v6H5V5h6\" /></Icon>;\nexport const Copy = (p: IconProps) => <Icon {...p}><rect x=\"9\" y=\"9\" width=\"11\" height=\"11\" rx=\"2\" /><path d=\"M15 9V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h3\" /></Icon>;\nexport const Lightbulb = (p: IconProps) => <Icon {...p}><path d=\"M9 18h6M10 22h4M8 14a6 6 0 1 1 8 0c-1 1-1 2-1 3H9c0-1 0-2-1-3z\" /></Icon>;\nexport const TriangleAlert = (p: IconProps) => <Icon {...p}><path d=\"M12 3 2 21h20L12 3zM12 10v5M12 18h.01\" /></Icon>;\nexport const ShieldOff = (p: IconProps) => <Icon {...p}><path d=\"m3 3 18 18M12 3l7 3v5c0 4-3 7-7 9-4-2-7-5-7-9V6l4-2\" /></Icon>;\nexport const ListFilter = SlidersHorizontal;\nexport const ListX = X;\n\nexport const ChevronsLeft = (p: IconProps) => <Icon {...p}><path d=\"m11 18-6-6 6-6m8 12-6-6 6-6\" /></Icon>;\nexport const ChevronsRight = (p: IconProps) => <Icon {...p}><path d=\"m5 18 6-6-6-6m8 12 6-6-6-6\" /></Icon>;\n","\"use client\";\n\n/**\n * Select — ported verbatim from matrx-frontend `components/ui/select.tsx`.\n *\n * Seam inversions:\n * - The host's `useNestedPortalContainer` (dialog/popout aware) becomes the\n * injected `PortalContainerProvider` seam (`portal-container.tsx`); the\n * explicit `container` prop keeps top priority, exactly as before.\n * - `ChevronDownIcon` / `ChevronUpIcon` / `CheckIcon` come from the package's\n * inlined SVGs (C19), not @radix-ui/react-icons — same glyphs, same\n * viewBoxes. (The origin also imported `CaretSortIcon` without ever using\n * it; the dead import is not carried along.)\n *\n * THE ROOT RENDERS UNCONDITIONALLY — no mount gate. This wrapper used to defer\n * rendering until after hydration (\"Radix generates dynamic aria-controls ids\n * that differ between SSR and client\"), and that justification was false:\n * Radix ids come from React's SSR-stable `useId` (verified against\n * @radix-ui/react-select 2.3.1 / react-id 1.1.2). The gate was actively\n * harmful — it deleted the ALWAYS-VISIBLE select trigger (a form control)\n * from SSR and the first client paint.\n */\n\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { MOTION_POPPER, POPPER_OFFSET } from \"./motion\";\nimport {\n CheckIcon,\n RadixChevronDownIcon,\n RadixChevronUpIcon,\n} from \"./icons\";\nimport { usePortalContainer } from \"./portal-container\";\nimport { FIELD_SURFACE_CLASS } from \"./field-surface\";\n\nexport const Select = SelectPrimitive.Root;\n\nexport const SelectGroup = SelectPrimitive.Group;\n\nexport const SelectValue = SelectPrimitive.Value;\n\nexport const selectTriggerVariants = cva(\n `flex w-full items-center justify-between gap-2 whitespace-nowrap rounded-md ${FIELD_SURFACE_CLASS} text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground transition-colors hover:bg-accent hover:border-accent-foreground/20 focus:outline-none focus:ring-1 focus:ring-primary/30 focus:border-primary/40 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:min-w-0 [&>span]:line-clamp-1`,\n {\n variants: {\n size: {\n sm: \"h-7 px-2 py-1 text-xs\",\n default: \"h-9 px-3 py-1\",\n lg: \"h-10 px-3 py-2\",\n },\n },\n defaultVariants: {\n size: \"default\",\n },\n },\n);\n\n/**\n * THE ONE DROPDOWN CHEVRON (page-pass 2026-09-27, /crm/<id>). Pickers drew three\n * different trigger glyphs side by side — a down chevron, an up-down pair, and\n * a larger up-down — so one form read as three kinds of control. Every dropdown\n * trigger (Select, CreatablePicker, every host combobox) draws THIS.\n */\nexport function SelectChevron({ className, size = \"default\" }: { className?: string; size?: \"sm\" | \"default\" }) {\n return (\n <RadixChevronDownIcon\n aria-hidden=\"true\"\n data-select-chevron=\"\"\n className={cn(size === \"sm\" ? \"h-3.5 w-3.5\" : \"h-4 w-4\", \"shrink-0 opacity-50\", className)}\n />\n );\n}\n\nexport interface SelectTriggerProps\n extends\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>,\n VariantProps<typeof selectTriggerVariants> {\n hideArrow?: boolean;\n}\n\nexport const SelectTrigger = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Trigger>,\n SelectTriggerProps\n>(({ className, children, hideArrow = false, size, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(selectTriggerVariants({ size, className }))}\n {...props}\n >\n {children}\n {!hideArrow && (\n <SelectPrimitive.Icon asChild>\n <SelectChevron size={size === \"sm\" ? \"sm\" : \"default\"} />\n </SelectPrimitive.Icon>\n )}\n </SelectPrimitive.Trigger>\n));\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nexport const SelectScrollUpButton = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className,\n )}\n {...props}\n >\n <RadixChevronUpIcon />\n </SelectPrimitive.ScrollUpButton>\n));\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\nexport const SelectScrollDownButton = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className,\n )}\n {...props}\n >\n <RadixChevronDownIcon />\n </SelectPrimitive.ScrollDownButton>\n));\nSelectScrollDownButton.displayName =\n SelectPrimitive.ScrollDownButton.displayName;\n\nexport interface SelectContentProps\n extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> {\n /** Explicit portal target; wins over the injected container. */\n container?: HTMLElement | null;\n /**\n * Package-owned open/close motion. Default `true`. Pass `false` for a\n * surface that must appear instantly. It is NOT the reduced-motion switch;\n * `styles.css` already honours `prefers-reduced-motion`.\n */\n animated?: boolean;\n}\n\nexport const SelectContent = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Content>,\n SelectContentProps\n>(\n (\n {\n className,\n children,\n position = \"popper\",\n container,\n animated = true,\n ...props\n },\n ref,\n ) => {\n const portalContainer = usePortalContainer(container);\n return (\n <SelectPrimitive.Portal container={portalContainer}>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n \"relative z-[10001] max-h-96 min-w-[8rem] max-w-[calc(100vw-2rem)] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md\",\n animated && MOTION_POPPER,\n // The resting gap from the trigger. It is the `translate` property\n // (POPPER_OFFSET), never Tailwind translate utilities: those compose\n // with `transform` on a v4 host and are REPLACED by it on a v3 one,\n // so on v3 the animation ate the gap and the surface snapped 4px at\n // the end. Same law as the centred dialog card — see motion.ts.\n position === \"popper\" && POPPER_OFFSET,\n className,\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n \"max-w-full overflow-y-auto p-0.5\",\n position === \"popper\" &&\n \"w-full min-w-[var(--radix-select-trigger-width)] max-h-[var(--radix-select-content-available-height)]\",\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n});\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nexport const SelectLabel = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn(\"px-2 py-1.5 text-sm font-semibold\", className)}\n {...props}\n />\n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\nexport const SelectItem = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> & {\n /**\n * Secondary line shown under the label IN THE LIST ONLY. Rendered outside\n * Radix `ItemText` on purpose: everything inside `ItemText` is what the\n * closed trigger displays, so a description passed as `children` gets\n * squeezed into the fixed-height trigger and clipped. This prop keeps the\n * trigger to the one-line label while the open list shows both lines.\n */\n description?: React.ReactNode;\n }\n>(({ className, children, description, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex w-full min-w-0 select-none rounded-sm py-1 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:opacity-50\",\n description ? \"flex-col items-start gap-0.5 py-1.5\" : \"items-center\",\n className,\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex h-3.5 w-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"h-4 w-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <span className=\"min-w-0 whitespace-normal break-words [overflow-wrap:anywhere]\">\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </span>\n {description ? (\n <span className=\"block min-w-0 break-words text-xs leading-snug text-muted-foreground [overflow-wrap:anywhere]\">\n {description}\n </span>\n ) : null}\n </SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\nexport const SelectSeparator = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n","/**\n * Internal inlined SVG icons (policy C19: no icon-library dependency, ever).\n *\n * Each icon is copied from the exact glyph the ported originals rendered:\n * lucide-react's Loader2 / ChevronLeft / ChevronRight / MoreHorizontal and\n * @radix-ui/react-icons' Cross2Icon. Same viewBoxes, same paths, same default\n * stroke geometry — a host swapping the import sees pixel-identical output.\n *\n * Not exported from the package entry; components consume them directly.\n */\n\nimport * as React from \"react\";\n\ntype IconProps = React.SVGAttributes<SVGSVGElement>;\n\nfunction lucideProps(props: IconProps): React.SVGAttributes<SVGSVGElement> {\n return {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n \"aria-hidden\": true,\n ...props,\n };\n}\n\n/**\n * lucide `loader-2` — the spinner glyph. Callers add `matrx-spin`.\n * Never a resting icon: at rest this incomplete arc reads as a broken\n * half-circle. Refresh controls use arrows, then swap to this only while busy.\n */\nexport function Loader2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"M21 12a9 9 0 1 1-6.219-8.56\" />\n </svg>\n );\n}\n\n/** lucide `chevron-left`. */\nexport function ChevronLeftIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n );\n}\n\n/** lucide `chevron-right`. */\nexport function ChevronRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n );\n}\n\n/** lucide `chevron-down` — the disclosure's open glyph. */\nexport function ChevronDownIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n );\n}\n\n/** lucide `archive` — the archived-rows glyph (ArchivedDisclosure). */\nexport function ArchiveIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <rect width=\"20\" height=\"5\" x=\"2\" y=\"3\" rx=\"1\" />\n <path d=\"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8\" />\n <path d=\"M10 12h4\" />\n </svg>\n );\n}\n\n/** lucide `more-horizontal` — the kebab/ellipsis glyph. */\nexport function MoreHorizontalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <circle cx=\"12\" cy=\"12\" r=\"1\" />\n <circle cx=\"19\" cy=\"12\" r=\"1\" />\n <circle cx=\"5\" cy=\"12\" r=\"1\" />\n </svg>\n );\n}\n\n/** lucide `check` — the selected-row tick (CreatablePicker). */\nexport function LucideCheckIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n );\n}\n\n/** lucide `chevrons-up-down` — the combobox trigger glyph. */\nexport function ChevronsUpDownIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"m7 15 5 5 5-5\" />\n <path d=\"m7 9 5-5 5 5\" />\n </svg>\n );\n}\n\n/** lucide `external-link` — the manage-in-new-tab glyph. */\nexport function ExternalLinkIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"M15 3h6v6\" />\n <path d=\"M10 14 21 3\" />\n <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" />\n </svg>\n );\n}\n\n/** lucide `lock` — the platform-governed vocabulary glyph. */\nexport function LockIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <rect width=\"18\" height=\"11\" x=\"3\" y=\"11\" rx=\"2\" ry=\"2\" />\n <path d=\"M7 11V7a5 5 0 0 1 10 0v4\" />\n </svg>\n );\n}\n\n/** lucide `pencil` — the edit glyph (the table card's Edit action). */\nexport function PencilIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z\" />\n <path d=\"m15 5 4 4\" />\n </svg>\n );\n}\n\n/** lucide `plus` — the create/add glyph. */\nexport function PlusIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"M5 12h14\" />\n <path d=\"M12 5v14\" />\n </svg>\n );\n}\n\n/** lucide `x` — the dialog close glyph (host dialog module used lucide X). */\nexport function XIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n );\n}\n\n/**\n * @radix-ui/react-icons components default to width/height 15 — the bare\n * `<ChevronUpIcon />` renders in Select's scroll buttons rely on it.\n */\nfunction radixProps(props: IconProps): React.SVGAttributes<SVGSVGElement> {\n return {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 15 15\",\n width: 15,\n height: 15,\n fill: \"none\",\n \"aria-hidden\": true,\n ...props,\n };\n}\n\n/** @radix-ui/react-icons `MagnifyingGlassIcon` — the command search glyph. */\nexport function MagnifyingGlassIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** @radix-ui/react-icons `CheckIcon` — the select item indicator glyph. */\nexport function CheckIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/**\n * @radix-ui/react-icons `DividerHorizontalIcon` — the INDETERMINATE checkbox\n * glyph. Radix renders the indicator for both `true` and `\"indeterminate\"`, so\n * a half-selected \"select all\" that shows a full check states something false;\n * the two states get different glyphs on purpose.\n */\nexport function DividerHorizontalIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M2 7.5C2 7.22386 2.22386 7 2.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H2.5C2.22386 8 2 7.77614 2 7.5Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** @radix-ui/react-icons `DotFilledIcon` — the menu radio-item indicator. */\nexport function DotFilledIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z\"\n fill=\"currentColor\"\n />\n </svg>\n );\n}\n\n/** @radix-ui/react-icons `ChevronRightIcon` — the submenu-trigger glyph. */\nexport function RadixChevronRightIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** @radix-ui/react-icons `ChevronDownIcon` — the select trigger/scroll glyph. */\nexport function RadixChevronDownIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** @radix-ui/react-icons `ChevronUpIcon` — the select scroll-up glyph. */\nexport function RadixChevronUpIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** @radix-ui/react-icons `Cross2Icon` — the dialog/sheet close glyph. */\nexport function Cross2Icon(props: IconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 15 15\"\n fill=\"none\"\n aria-hidden\n {...props}\n >\n <path\n d=\"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/**\n * @radix-ui/react-icons `DragHandleDots2Icon` — the grip on `ResizableHandle`.\n * Inlined per C19: this package depends on no icon library.\n */\nexport function DragHandleDots2Icon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M4.5 2.5C5.05228 2.5 5.5 2.05228 5.5 1.5C5.5 0.947715 5.05228 0.5 4.5 0.5C3.94772 0.5 3.5 0.947715 3.5 1.5C3.5 2.05228 3.94772 2.5 4.5 2.5ZM4.5 6.5C5.05228 6.5 5.5 6.05229 5.5 5.5C5.5 4.94771 5.05228 4.5 4.5 4.5C3.94772 4.5 3.5 4.94771 3.5 5.5C3.5 6.05229 3.94772 6.5 4.5 6.5ZM5.5 9.5C5.5 10.0523 5.05228 10.5 4.5 10.5C3.94772 10.5 3.5 10.0523 3.5 9.5C3.5 8.94771 3.94772 8.5 4.5 8.5C5.05228 8.5 5.5 8.94771 5.5 9.5ZM4.5 14.5C5.05228 14.5 5.5 14.0523 5.5 13.5C5.5 12.9477 5.05228 12.5 4.5 12.5C3.94772 12.5 3.5 12.9477 3.5 13.5C3.5 14.0523 3.94772 14.5 4.5 14.5ZM11.5 1.5C11.5 2.05228 11.0523 2.5 10.5 2.5C9.94771 2.5 9.5 2.05228 9.5 1.5C9.5 0.947715 9.94771 0.5 10.5 0.5C11.0523 0.5 11.5 0.947715 11.5 1.5ZM10.5 6.5C11.0523 6.5 11.5 6.05229 11.5 5.5C11.5 4.94771 11.0523 4.5 10.5 4.5C9.94771 4.5 9.5 4.94771 9.5 5.5C9.5 6.05229 9.94771 6.5 10.5 6.5ZM11.5 9.5C11.5 10.0523 11.0523 10.5 10.5 10.5C9.94771 10.5 9.5 10.0523 9.5 9.5C9.5 8.94771 9.94771 8.5 10.5 8.5C11.0523 8.5 11.5 8.94771 11.5 9.5ZM10.5 14.5C11.0523 14.5 11.5 14.0523 11.5 13.5C11.5 12.9477 11.0523 12.5 10.5 12.5C9.94771 12.5 9.5 12.9477 9.5 13.5C9.5 14.0523 9.94771 14.5 10.5 14.5Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** lucide `star` — the default-organization badge (OrganizationPicker). */\nexport function StarIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z\" />\n </svg>\n );\n}\n\n/** lucide `building-2` — the organization glyph (OrganizationPicker trigger). */\nexport function Building2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z\" />\n <path d=\"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2\" />\n <path d=\"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2\" />\n <path d=\"M10 6h4\" />\n <path d=\"M10 10h4\" />\n <path d=\"M10 14h4\" />\n <path d=\"M10 18h4\" />\n </svg>\n );\n}\n\n/** lucide `panel-left` — the sidebar toggle glyph. */\nexport function PanelLeftIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M9 3v18\" />\n </svg>\n );\n}\n\n/** lucide `ellipsis-vertical` — a panel's \"more\" menu. */\nexport function MoreVerticalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <circle cx=\"12\" cy=\"12\" r=\"1\" />\n <circle cx=\"12\" cy=\"5\" r=\"1\" />\n <circle cx=\"12\" cy=\"19\" r=\"1\" />\n </svg>\n );\n}\n\n/** lucide `maximize-2` — expand a panel. */\nexport function Maximize2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"M15 3h6v6\" />\n <path d=\"m21 3-7 7\" />\n <path d=\"m3 21 7-7\" />\n <path d=\"M9 21H3v-6\" />\n </svg>\n );\n}\n\n/** lucide `minimize-2` — restore an expanded panel. */\nexport function Minimize2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"m14 10 7-7\" />\n <path d=\"M20 10h-6V4\" />\n <path d=\"m3 21 7-7\" />\n <path d=\"M4 14h6v6\" />\n </svg>\n );\n}\n\n/** lucide `arrow-left`. */\nexport function ArrowLeftIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"m12 19-7-7 7-7\" />\n <path d=\"M19 12H5\" />\n </svg>\n );\n}\n\n/** lucide `arrow-right`. */\nexport function ArrowRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"M5 12h14\" />\n <path d=\"m12 5 7 7-7 7\" />\n </svg>\n );\n}\n\n/** lucide `rotate-cw` — reload. */\nexport function RotateCwIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8\" />\n <path d=\"M21 3v5h-5\" />\n </svg>\n );\n}\n\n/** lucide `globe` — a web page with no favicon. */\nexport function GlobeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20\" />\n <path d=\"M2 12h20\" />\n </svg>\n );\n}\n","/**\n * THE ONE FIELD SURFACE (page-pass shared fix, 2026-09-27).\n *\n * Every control a person types into or picks from — Input, BasicInput,\n * Textarea, the Select trigger, and the host's ProInput / ProTextarea — sits on\n * this fill and this border. They used to disagree: Input and the elevated\n * Textarea filled with `bg-background` (the grey page colour in light mode),\n * BasicInput and the control Textarea were `bg-transparent` (grey on a grey\n * page), while the Select trigger filled with `bg-card` (white). On one form\n * the text fields therefore looked disabled beside white Selects\n * (/hr/settings/employer, the message-template editor) — a screen that lies\n * about what it will let you do.\n *\n * The surface is the Select's: the card fill and the regular border. A caller\n * that genuinely wants no fill (an inline cell editor) still passes\n * `bg-transparent`, which wins through `cn`.\n */\nexport const FIELD_SURFACE_CLASS = \"border border-border bg-card\";\n","\"use client\";\nimport { createContext, useContext, type Context, type ComponentType, type ReactNode, type MouseEventHandler } from \"react\";\nimport type { CopyControlProps } from \"./copy-types\";\nimport type { MatrxColumnDef, MatrxDataTableDensity, MatrxDataTableRecordControls, TableSavedViewsProps } from \"./types\";\nimport type {\n MatrxTableMenuIconName,\n MatrxTableMenuItem,\n MatrxTableMenuPayload,\n MatrxTableMenuSectionsResolver,\n MatrxTableMenuTarget,\n} from \"./menu-targets\";\n\nexport type {\n MatrxTableMenuIconName,\n MatrxTableMenuItem,\n MatrxTableMenuSection,\n MatrxTableMenuSectionsResolver,\n} from \"./menu-targets\";\n\nexport type {\n AgentPayloadInput,\n AiCustomSource,\n AiVariant,\n CopyControlProps,\n CopyExportConfig,\n} from \"./copy-types\";\n\nexport interface TableLinkProps { href: string; children: ReactNode; className?: string; onClick?: MouseEventHandler<HTMLAnchorElement>; }\n/**\n * Host-owned toolbar affordance. The table package keeps operation state and\n * labels; an application can supply its canonical icon-button primitive\n * without making the shared package depend on an application UI package.\n */\nexport interface TableToolbarActionProps { ariaLabel: string; tooltip?: string | undefined; disabled?: boolean | undefined; busy?: boolean | undefined; /** Indicates a selected mutually-exclusive action such as the current page. */ active?: boolean | undefined; onClick: () => void; children: ReactNode; }\nexport interface TableSidePanelProps { title: string; titleNode?: ReactNode; description?: ReactNode; onClose: () => void; /** Increments on every open request, including a repeat open of the row already shown — a host whose panel can sit in the background (a tab) brings it forward when this changes. */ openRequest?: number; defaultWidth?: number; headerActions?: ReactNode; children: ReactNode; }\nexport interface TableWindowPanelProps { id: string; title: string; onClose: () => void; width?: number; height?: number; minWidth?: number; minHeight?: number; actionsRight?: ReactNode; bodyClassName?: string; sidebarDefaultSize?: number; sidebarMinSize?: number; sidebar?: ReactNode; children: ReactNode; }\nexport interface TableEntityRefProps { token: string; id: string; href?: string; children: ReactNode; className?: string; }\nexport interface TablePeekProps { kind: string; id: string; href?: string; onClose: () => void; }\nexport interface TableDoors {\n href?: string;\n peekKind?: string;\n canPeek?: boolean;\n /**\n * THE RECORD'S OWN MENU (lane DRILL-PARITY-LAST): what its kind offers wherever a table names it —\n * a person's admin destinations, an organization's pages — as neutral items the table draws in a\n * row's menu and on a right-click. Absent = the record has only its open and preview doors.\n */\n menu?: MatrxTableMenuItem[];\n}\n/**\n * The host's door onto the table's right-click levels.\n *\n * A canonical table registers ONE resolver per instance. The host's own menu\n * reads which of the four levels was clicked (`readMenuTarget`) and asks for\n * that level's descriptor — the package never interprets what comes back, and\n * the host never reaches into the table for the row or the range.\n */\nexport interface TableRowContextRegistry { register(tableId: string, resolve: (target: MatrxTableMenuTarget) => unknown): () => void; }\nexport interface TableContextMenuBoundaryProps {\n label: string;\n children: ReactNode;\n /**\n * The consumer's own sections, asked per right-click. Present only when the\n * table's consumer declared `contextMenu.sections`; the host reads the level\n * off the clicked element (`readMenuTarget`), calls this, and draws what comes\n * back in its own menu. Absent, the boundary behaves exactly as before.\n */\n sections?: MatrxTableMenuSectionsResolver | undefined;\n}\n/**\n * The host's view of a failed read with NO rows to show (RC-B12 round 13):\n * its error display (with the host's actions — matrx-frontend's Alchemy Menu)\n * and a retry. Without a host port the table draws a package `ErrorBox`.\n */\nexport interface TableReadFailureProps { error: unknown; what: string; onRetry?: (() => void) | undefined; }\n/**\n * The host's notice above rows kept from an earlier read when the latest read\n * failed: the rows may be out of date. Without a host port the table draws a\n * package `ErrorBox` in warning colours.\n */\nexport interface TableStaleNoticeProps { error: unknown; what: string; onRetry?: (() => void) | undefined; }\n/** The host's glyph for a menu icon name. A host without one draws labels only. */\nexport interface TableMenuIconProps { name: MatrxTableMenuIconName; className?: string | undefined; }\n/** The host's custom-field columns for a registry token over the given organizations (lane 7 W5). */\nexport interface TableCustomFieldColumns<T> { columns: MatrxColumnDef<T>[]; }\nexport interface MatrxDataTableHost { /** A HOOK, bound once by the host: the custom-field columns of `token` (null = none) for `organizationIds`. */ useCustomFieldColumns?: <T>(token: string | null, organizationIds: readonly string[]) => TableCustomFieldColumns<T> | null; JsonViewer?: ComponentType<{ data: object | string }>; Link?: ComponentType<TableLinkProps>; CopyControls?: ComponentType<CopyControlProps>; ToolbarAction?: ComponentType<TableToolbarActionProps>; SidePanelSurface?: ComponentType<TableSidePanelProps>; WindowPanel?: ComponentType<TableWindowPanelProps>; EntityRef?: ComponentType<TableEntityRefProps>; resolveEntityDoors?: (token: string, id: string, href?: string | null) => TableDoors | null; ResourcePeek?: ComponentType<TablePeekProps>; SavedViews?: ComponentType<TableSavedViewsProps>; rowContextRegistry?: TableRowContextRegistry; createDefaultMenuContext?: (payload: MatrxTableMenuPayload) => unknown; ContextMenuBoundary?: ComponentType<TableContextMenuBoundaryProps>; MenuIcon?: ComponentType<TableMenuIconProps>; /** A failed read with no rows (RC-B12 r13). */ ReadFailure?: ComponentType<TableReadFailureProps>; /** A failed refresh over kept rows (RC-B12 r13). */ StaleNotice?: ComponentType<TableStaleNoticeProps>; /** Host default; a table's explicit density takes precedence. */ defaultDensity?: MatrxDataTableDensity; notify?: { success(message: string): void; error(message: string): void }; }\n// Public entrypoints are independently bundled in ESM and CJS. The context\n// identity must survive those bundle boundaries; values stay provider-scoped.\nconst HOST_SLOT = Symbol.for(\"ai-matrx.design-system.table-host-context\");\nconst hostRegistry = globalThis as typeof globalThis & { [HOST_SLOT]?: Context<MatrxDataTableHost> };\nconst HostContext = hostRegistry[HOST_SLOT] ??= createContext<MatrxDataTableHost>({});\nexport function MatrxDataTableProvider({ value, children }: { value: MatrxDataTableHost; children: ReactNode }) { return <HostContext.Provider value={value}>{children}</HostContext.Provider>; }\nexport function useMatrxDataTableHost(): MatrxDataTableHost { return useContext(HostContext); }\n\nexport interface MatrxTableRowAlchemy {\n copy: CopyControlProps;\n controls?: MatrxDataTableRecordControls;\n placement: \"inline\" | \"menu\";\n ready: boolean;\n activate(): void;\n /** Mount Alchemy's canonical palette in the host row menu. */\n mountMenu(target: HTMLElement | null, onClose?: () => void, restoreFocus?: () => void): void;\n prepare(restoreFocus?: () => void): Promise<void>;\n}\n\nconst ROW_ALCHEMY_SLOT = Symbol.for(\"ai-matrx.design-system.table-row-alchemy-context\");\nconst rowAlchemyRegistry = globalThis as typeof globalThis & { [ROW_ALCHEMY_SLOT]?: Context<MatrxTableRowAlchemy | null> };\nconst RowAlchemyContext = rowAlchemyRegistry[ROW_ALCHEMY_SLOT] ??= createContext<MatrxTableRowAlchemy | null>(null);\n\nexport function MatrxTableRowAlchemyScope({ value, children }: { value: MatrxTableRowAlchemy; children: ReactNode }) { return <RowAlchemyContext.Provider value={value}>{children}</RowAlchemyContext.Provider>; }\n\nexport function useMatrxTableRowAlchemy(): MatrxTableRowAlchemy | null { return useContext(RowAlchemyContext); }\n\nconst ROW_CONTROLS_SLOT = Symbol.for(\"ai-matrx.design-system.table-row-controls-context\");\nconst rowControlsRegistry = globalThis as typeof globalThis & { [ROW_CONTROLS_SLOT]?: Context<MatrxDataTableRecordControls | null> };\nconst RowControlsContext = rowControlsRegistry[ROW_CONTROLS_SLOT] ??= createContext<MatrxDataTableRecordControls | null>(null);\nexport function MatrxTableRowControlsScope({ value, children }: { value: MatrxDataTableRecordControls; children: ReactNode }) { return <RowControlsContext.Provider value={value}>{children}</RowControlsContext.Provider>; }\nexport function useMatrxTableRowControls(): MatrxDataTableRecordControls | null { return useContext(RowControlsContext); }\n"],"mappings":";;;;AACA,SAAS,mBAAmB;;;ACC5B,SAAS,YAAY;AACrB,SAAS,WAA8B;AACv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AmB;AAAA,cACnB,SAAS,MAAM;AAAE,oBAAI,CAAC,aAAc,cAAa,UAAU;AAAA,cAAG;AAAA,cAC9D,UAAU,QAAQ,YAAY,KAAK;AAAA,cAEnC,0BAAAA,KAAC,iBAAc,WAAU,WAAU;AAAA;AAAA,UACrC;AAAA;AAAA;AAAA,IACF;AAAA,KAEJ,GACA;AAEJ;","names":["React","React","jsx","jsx","jsx","jsx","jsx","cva","React","jsx","jsxs","jsx","jsx","jsx","jsxs","cva","jsx","jsxs","createContext","useContext","jsx","useContext","createContext","createContext","jsx","jsxs"]}
|