@ai-matrx/design-system 0.61.2 → 0.61.3

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/controls/index.ts","../src/controls/controls.tsx","../src/button.tsx","../src/cn.ts","../src/dropdown-menu.tsx","../src/motion.ts","../src/icons.tsx","../src/portal-container.tsx","../src/menu-scroll-edges.tsx","../src/use-scroll-fade.ts","../src/submenu-focus.ts","../src/select.tsx","../src/field-surface.ts","../src/controls/surfaces.tsx","../src/alert-dialog.tsx","../src/floating-layer.tsx","../src/confirm-dialog.tsx","../src/skeleton.tsx"],"sourcesContent":["/**\n * `@ai-matrx/design-system/controls` — THE controls (owner-settled one-control\n * system). Read FEATURE.md § THE ONE CONTROL. Styles ship in `styles.css`\n * (`controls.css`, locked in `@layer matrx-tap-lock`).\n */\nexport {\n Badge,\n Button,\n ControlRow,\n ControlScope,\n Field,\n SearchField,\n SegmentedControl,\n Select,\n Switch,\n Tabs,\n Textarea,\n} from \"./controls\";\nexport type {\n BadgeProps,\n BadgeTone,\n ButtonProps,\n ControlRowProps,\n ControlVariant,\n FieldProps,\n SegmentedControlProps,\n SegmentOption,\n SelectOption,\n SelectProps,\n SwitchProps,\n TabsProps,\n} from \"./controls\";\nexport {\n ConfirmDelete,\n DangerZone,\n DeleteButton,\n EmptyState,\n PromoBanner,\n RegionSkeleton,\n RowGroup,\n SettingRow,\n} from \"./surfaces\";\nexport type {\n ConfirmDeleteProps,\n DeleteButtonProps,\n EmptyStateProps,\n PromoBannerProps,\n PromoTone,\n RegionSkeletonProps,\n RowGroupProps,\n SettingRowProps,\n} from \"./surfaces\";\n","\"use client\";\n\n/**\n * THE ONE CONTROL — the settled control family (owner, 2026-10-02/03).\n *\n * Every control here is the same object: 28px visible height, capsule, 13px/500\n * label, 16px glyph inset 6px, text inset 10px, and HALF A GAP (3px) of its own\n * on each side so containers add no gap. There is NO size prop: agents get no\n * choice. Geometry and colour live in `controls.css`, locked inside\n * `@layer matrx-tap-lock` (`!important` in the host's first layer), so a call\n * site's `className` can place a control (width, flex, grid, position) but can\n * never restyle it. The rare big control is a different component behind a\n * `// ui-exception:` comment, never a prop.\n *\n * Built on the package's own internals — Radix Slot / Switch / DropdownMenu, the\n * cursor law's `swallowClick`, `SelectChevron`, the package icons — so nothing\n * here is a second implementation of a behaviour the package already owns.\n */\n\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\";\nimport { Slot, Slottable } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\n\nimport { swallowClick } from \"../button\";\nimport { cn } from \"../cn\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuTrigger,\n} from \"../dropdown-menu\";\nimport { MagnifyingGlassIcon } from \"../icons\";\nimport { SelectChevron } from \"../select\";\n\n/* ------------------------------------------------------------------ */\n/* Layout: the row and the scope */\n/* ------------------------------------------------------------------ */\n\nexport interface ControlRowProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Keep the controls on one line (a row's trailing actions). */\n nowrap?: boolean;\n}\n\n/** A row of controls. It adds no gap: each control carries its own half-gap. */\nexport const ControlRow = React.forwardRef<HTMLDivElement, ControlRowProps>(\n ({ className, nowrap, ...props }, ref) => (\n <div\n ref={ref}\n data-matrx-control-row=\"\"\n data-nowrap={nowrap ? \"\" : undefined}\n className={cn(\"matrx-control-row\", className)}\n {...props}\n />\n ),\n);\nControlRow.displayName = \"ControlRow\";\n\n/**\n * Until the tap tokens move to 28/34 app-wide (the rollout), a tap button\n * inside a ControlScope matches the controls beside it: a 28px pill in a 34px\n * box. Wrap a page (or a region) that mixes tap buttons and controls.\n */\nexport const ControlScope = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n (props, ref) => <div ref={ref} data-matrx-controls=\"\" {...props} />,\n);\nControlScope.displayName = \"ControlScope\";\n\n/* ------------------------------------------------------------------ */\n/* Button */\n/* ------------------------------------------------------------------ */\n\nexport type ControlVariant = \"primary\" | \"quiet\" | \"outline\" | \"danger\";\n\ninterface ButtonBase extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"children\"> {\n /** Tone, never size. Default `outline`. */\n variant?: ControlVariant;\n /** Leading 16px glyph. */\n icon?: React.ReactNode;\n /** Trailing 16px glyph (a menu chevron, an external-link mark). */\n iconEnd?: React.ReactNode;\n /** Render the one child element (a link) with the button's skin. */\n asChild?: boolean;\n}\ninterface LabelledButton extends ButtonBase {\n children: React.ReactNode;\n}\ninterface IconOnlyButton extends ButtonBase {\n children?: undefined;\n /** An icon-only button must say what it does. */\n \"aria-label\": string;\n}\nexport type ButtonProps = LabelledButton | IconOnlyButton;\n\nfunction glyphSlot(icon: unknown, iconEnd: unknown, label: unknown): string | undefined {\n if (!label && (icon || iconEnd)) return \"only\";\n if (icon && iconEnd) return \"both\";\n if (icon) return \"start\";\n if (iconEnd) return \"end\";\n return undefined;\n}\n\n/**\n * THE button: primary / quiet / outline / danger, one 28px geometry; text,\n * icon + text, or icon-only (a 28px circle). `asChild` puts the skin on a link.\n */\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant = \"outline\", icon, iconEnd, asChild = false, children, onClick, type, ...props }, ref) => {\n const Component = asChild ? Slot : \"button\";\n const ariaDisabled = props[\"aria-disabled\"];\n const disabledChild = asChild && Boolean(props.disabled);\n const inert = disabledChild || ariaDisabled === true || ariaDisabled === \"true\";\n // asChild: the child element carries the label, so the glyph slot reads\n // the child's own children.\n const label = asChild && React.isValidElement<{ children?: React.ReactNode }>(children)\n ? children.props.children\n : children;\n return (\n <Component\n ref={ref}\n type={asChild ? undefined : (type ?? \"button\")}\n data-matrx-control=\"button\"\n data-variant={variant}\n data-glyph={glyphSlot(icon, iconEnd, label)}\n className={cn(\"matrx-control matrx-control-button matrx-glyph-trim\", className)}\n {...props}\n aria-disabled={disabledChild ? true : ariaDisabled}\n tabIndex={disabledChild ? -1 : props.tabIndex}\n onClick={inert ? swallowClick : onClick}\n >\n {icon}\n <Slottable>{children}</Slottable>\n {iconEnd}\n </Component>\n );\n },\n);\nButton.displayName = \"Button\";\n\n/* ------------------------------------------------------------------ */\n/* Field (input capsule) and SearchField */\n/* ------------------------------------------------------------------ */\n\nexport interface FieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, \"size\"> {\n /** Leading 16px glyph. */\n icon?: React.ReactNode;\n}\n\n/** The input capsule. `className`/`style` place the capsule (width, flex). */\nexport const Field = React.forwardRef<HTMLInputElement, FieldProps>(\n ({ className, style, icon, ...props }, ref) => (\n <label\n data-matrx-control=\"field\"\n data-glyph={icon ? \"start\" : undefined}\n className={cn(\"matrx-control matrx-control-field\", className)}\n style={style}\n >\n {icon}\n <input ref={ref} {...props} />\n </label>\n ),\n);\nField.displayName = \"Field\";\n\n/** The search capsule: a Field with the magnifier, `type=\"search\"`. */\nexport const SearchField = React.forwardRef<HTMLInputElement, Omit<FieldProps, \"icon\">>(\n ({ placeholder = \"Search\", ...props }, ref) => (\n <Field\n ref={ref}\n type=\"search\"\n icon={<MagnifyingGlassIcon aria-hidden=\"true\" />}\n placeholder={placeholder}\n aria-label={props[\"aria-label\"] ?? placeholder}\n {...props}\n />\n ),\n);\nSearchField.displayName = \"SearchField\";\n\n/* ------------------------------------------------------------------ */\n/* Select — a capsule trigger over a radio menu */\n/* ------------------------------------------------------------------ */\n\nexport interface SelectOption<T extends string = string> {\n value: T;\n label: string;\n /** 11px trailing text in the menu (a count, a shortcut). */\n meta?: string;\n}\n\nexport interface SelectProps<T extends string = string> {\n value: T;\n options: readonly SelectOption<T>[];\n onValueChange: (value: T) => void;\n \"aria-label\": string;\n /** Leading 16px glyph on the trigger. */\n icon?: React.ReactNode;\n align?: \"start\" | \"end\";\n disabled?: boolean;\n /** Placement only (width, flex). */\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport function Select<T extends string = string>({\n value,\n options,\n onValueChange,\n icon,\n align = \"start\",\n disabled,\n className,\n style,\n \"aria-label\": ariaLabel,\n}: SelectProps<T>) {\n const current = options.find((o) => o.value === value);\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild disabled={disabled}>\n <button\n type=\"button\"\n data-matrx-control=\"select\"\n data-glyph={icon ? \"start\" : undefined}\n className={cn(\"matrx-control matrx-control-select\", className)}\n style={style}\n aria-label={ariaLabel}\n >\n <span className=\"matrx-control-select-value\">\n {icon}\n <span>{current?.label ?? value}</span>\n </span>\n <SelectChevron />\n </button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align={align} className=\"max-h-80 min-w-[10rem] overflow-y-auto\">\n <DropdownMenuRadioGroup value={value} onValueChange={(v) => onValueChange(v as T)}>\n {options.map((o) => (\n <DropdownMenuRadioItem key={o.value} value={o.value} className=\"text-[0.8125rem]\">\n <span className=\"flex-1 truncate\">{o.label}</span>\n {o.meta ? <span className=\"ml-3 text-[0.6875rem] text-muted-foreground\">{o.meta}</span> : null}\n </DropdownMenuRadioItem>\n ))}\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* SegmentedControl and Tabs */\n/* ------------------------------------------------------------------ */\n\nexport interface SegmentOption<T extends string = string> {\n value: T;\n label: React.ReactNode;\n /** An 11px count after the label. */\n count?: number | null;\n ariaLabel?: string;\n disabled?: boolean;\n}\n\nexport interface SegmentedControlProps<T extends string = string> {\n value: T;\n onValueChange: (value: T) => void;\n data: readonly SegmentOption<T>[];\n \"aria-label\": string;\n /** Placement only. */\n className?: string;\n style?: React.CSSProperties;\n}\n\nfunction SegmentItems<T extends string>({\n data,\n value,\n onValueChange,\n role,\n}: {\n data: readonly SegmentOption<T>[];\n value: T;\n onValueChange: (value: T) => void;\n role: \"tab\" | undefined;\n}) {\n return (\n <>\n {data.map((o) => {\n const on = o.value === value;\n return (\n <button\n key={o.value}\n type=\"button\"\n role={role}\n aria-selected={role ? on : undefined}\n aria-pressed={role ? undefined : on}\n aria-label={o.ariaLabel}\n disabled={o.disabled}\n data-state={on ? \"on\" : \"off\"}\n className=\"matrx-control-segment\"\n onClick={() => onValueChange(o.value)}\n >\n {o.label}\n {o.count != null ? <span className=\"matrx-control-count\">{o.count}</span> : null}\n </button>\n );\n })}\n </>\n );\n}\n\n/** The capsule toggle group: a muted track, the selected thumb inset 2px. */\nexport function SegmentedControl<T extends string = string>({\n value,\n onValueChange,\n data,\n className,\n style,\n \"aria-label\": ariaLabel,\n}: SegmentedControlProps<T>) {\n return (\n <div\n role=\"group\"\n aria-label={ariaLabel}\n data-matrx-control=\"segmented\"\n className={cn(\"matrx-control matrx-control-segmented\", className)}\n style={style}\n >\n <SegmentItems data={data} value={value} onValueChange={onValueChange} role={undefined} />\n </div>\n );\n}\n\nexport interface TabsProps<T extends string = string> extends SegmentedControlProps<T> {\n /** `underline` for page sections (default); `capsule` for filters. */\n variant?: \"underline\" | \"capsule\";\n}\n\n/** Tabs: underline for page sections, capsule for filters. */\nexport function Tabs<T extends string = string>({\n variant = \"underline\",\n value,\n onValueChange,\n data,\n className,\n style,\n \"aria-label\": ariaLabel,\n}: TabsProps<T>) {\n if (variant === \"capsule\") {\n return (\n <div\n role=\"tablist\"\n aria-label={ariaLabel}\n data-matrx-control=\"tabs\"\n className={cn(\"matrx-control matrx-control-segmented\", className)}\n style={style}\n >\n <SegmentItems data={data} value={value} onValueChange={onValueChange} role=\"tab\" />\n </div>\n );\n }\n return (\n <div\n role=\"tablist\"\n aria-label={ariaLabel}\n data-matrx-control=\"tabs\"\n className={cn(\"matrx-control-tabs\", className)}\n style={style}\n >\n {data.map((o) => (\n <button\n key={o.value}\n type=\"button\"\n role=\"tab\"\n aria-selected={o.value === value}\n aria-label={o.ariaLabel}\n disabled={o.disabled}\n className=\"matrx-control-tab\"\n onClick={() => onValueChange(o.value)}\n >\n {o.label}\n {o.count != null ? <span className=\"matrx-control-count\">{o.count}</span> : null}\n </button>\n ))}\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Badge */\n/* ------------------------------------------------------------------ */\n\nexport type BadgeTone = \"neutral\" | \"primary\" | \"success\" | \"warning\" | \"destructive\" | \"info\";\n\nexport interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** A status tint from the role tokens. Default `neutral` (plain outline). */\n tone?: BadgeTone;\n}\n\n/** Outline, 18px, 11px text, clamped to one line (≤20rem) — never a sentence. */\nexport function Badge({ tone = \"neutral\", className, children, ...props }: BadgeProps) {\n return (\n <span\n data-matrx-control=\"badge\"\n data-tone={tone}\n className={cn(\"matrx-control-badge\", className)}\n title={typeof children === \"string\" ? children : undefined}\n {...props}\n >\n <span>{children}</span>\n </span>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Switch and Textarea */\n/* ------------------------------------------------------------------ */\n\nexport type SwitchProps = Omit<React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>, \"children\">;\n\n/** A 20px track in the 28px control box, so it lines up with every control. */\nexport const Switch = React.forwardRef<React.ComponentRef<typeof SwitchPrimitives.Root>, SwitchProps>(\n ({ className, ...props }, ref) => (\n <SwitchPrimitives.Root\n ref={ref}\n data-matrx-control=\"switch\"\n className={cn(\"matrx-control matrx-control-switch\", className)}\n {...props}\n >\n <span className=\"matrx-control-switch-track\">\n <SwitchPrimitives.Thumb className=\"matrx-control-switch-thumb\" />\n </span>\n </SwitchPrimitives.Root>\n ),\n);\nSwitch.displayName = \"Switch\";\n\n/** The field skin, multi-line (8px radius — a capsule cannot hold paragraphs). */\nexport const Textarea = React.forwardRef<HTMLTextAreaElement, React.TextareaHTMLAttributes<HTMLTextAreaElement>>(\n ({ className, ...props }, ref) => (\n <textarea ref={ref} data-matrx-control=\"textarea\" className={cn(\"matrx-control-textarea\", className)} {...props} />\n ),\n);\nTextarea.displayName = \"Textarea\";\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 \"matrx-glyph-trim 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 */\nexport function 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 * DropdownMenu — Radix dropdown with two behaviours the stock body lacks.\n *\n * 1. THE ROOT RENDERS UNCONDITIONALLY — no hydration mount gate. A wrapper in\n * matrx-frontend once deferred rendering until after hydration on a false\n * premise (Radix ids come from React's SSR-stable `useId`), which deleted\n * the always-visible trigger — buttons, `…` menus — from SSR and the first\n * client paint.\n *\n * 2. A LONG MENU SCROLLS INSTEAD OF GROWING OFF-SCREEN. Content and SubContent\n * cap at `--radix-dropdown-menu-content-available-height` — the space Radix\n * actually measured between the trigger and the viewport edge — and scroll\n * past it. Without the cap a menu longer than the viewport puts its last\n * items where no pointer can reach them, and on a short window that can be\n * the only exit from the surface.\n *\n * Portalling goes through the package's `usePortalContainer` seam, so a menu\n * opened inside a Dialog mounts INSIDE the dialog (staying in the scroll\n * shard, where its wheel events work) instead of at `document.body`. An\n * explicit `container` prop still wins.\n *\n * Icons are the package's inlined SVGs (C19) — no icon-library dependency.\n */\n\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { MOTION_POPPER } from \"./motion\";\nimport { CheckIcon, DotFilledIcon, RadixChevronRightIcon } from \"./icons\";\nimport { usePortalContainer } from \"./portal-container\";\nimport { useMenuScrollEdges } from \"./menu-scroll-edges\";\nimport { useSubmenuSurvivesParentPanelFocus } from \"./submenu-focus\";\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst MENU_SURFACE_CLASS =\n \"z-[10001] min-w-[8rem] max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto overflow-x-hidden overscroll-contain rounded-md border bg-popover p-1 text-popover-foreground\";\n\n\n// gap-2: an item's icon never touches its label (page-pass 2026-09-27, admin pass — every menu).\nconst MENU_ITEM_CLASS =\n \"relative flex select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:opacity-50\";\n\nconst MENU_INDICATOR_ITEM_CLASS =\n \"relative flex select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:opacity-50\";\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n data-slot=\"dropdown-menu-sub-trigger\"\n className={cn(\n \"flex select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <RadixChevronRightIcon className=\"ml-auto h-4 w-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\n/**\n * A SUBMENU OPENS BESIDE ITS PARENT, NEVER ON TOP OF IT (merged-grid review 2, C1: \"nested\n * submenus overlap the parent menu\"). The submenu was drawn INSIDE the parent's surface, and that\n * surface's entry animation leaves a `transform` on it — which makes the parent the containing\n * block of the submenu's `position: fixed`. Radix measured the submenu's place in viewport\n * coordinates and the browser applied them from the parent's corner, so it landed over the parent\n * (and was clipped by the parent's scroll box). Portalled like every other surface, through the\n * same container seam, it sits beside its trigger as Radix placed it.\n */\nconst DropdownMenuSubContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent> & { container?: HTMLElement | null }\n>(({ className, container, sideOffset = 2, alignOffset = -4, collisionPadding = 8, onFocusOutside, children, ...props }, ref) => {\n const portalContainer = usePortalContainer(container);\n // A flipped submenu survives the pointer leaving its trigger (see submenu-focus.ts).\n const keep = useSubmenuSurvivesParentPanelFocus(ref, onFocusOutside);\n const edges = useMenuScrollEdges(keep.ref);\n return (\n <DropdownMenuPrimitive.Portal container={portalContainer}>\n <DropdownMenuPrimitive.SubContent\n ref={edges.ref}\n onFocusOutside={keep.onFocusOutside}\n data-slot=\"dropdown-menu-sub-content\"\n sideOffset={sideOffset}\n alignOffset={alignOffset}\n collisionPadding={collisionPadding}\n className={cn(MENU_SURFACE_CLASS, edges.surfaceClassName, \"shadow-lg\", MOTION_POPPER, className)}\n {...props}\n >\n {edges.wrap(children)}\n </DropdownMenuPrimitive.SubContent>\n </DropdownMenuPrimitive.Portal>\n );\n});\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\nexport interface DropdownMenuContentProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content> {\n /** Explicit portal target; wins over the injected container. */\n container?: HTMLElement | null;\n}\n\nconst DropdownMenuContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Content>,\n DropdownMenuContentProps\n>(({ className, sideOffset = 4, container, children, ...props }, ref) => {\n const portalContainer = usePortalContainer(container);\n const edges = useMenuScrollEdges(ref);\n return (\n <DropdownMenuPrimitive.Portal container={portalContainer}>\n <DropdownMenuPrimitive.Content\n ref={edges.ref}\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n MENU_SURFACE_CLASS,\n edges.surfaceClassName,\n \"shadow-md\",\n MOTION_POPPER,\n className,\n )}\n {...props}\n >\n {edges.wrap(children)}\n </DropdownMenuPrimitive.Content>\n </DropdownMenuPrimitive.Portal>\n );\n});\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n data-slot=\"dropdown-menu-item\"\n className={cn(MENU_ITEM_CLASS, inset && \"pl-8\", className)}\n {...props}\n />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(MENU_INDICATOR_ITEM_CLASS, className)}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(MENU_INDICATOR_ITEM_CLASS, className)}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <DotFilledIcon className=\"h-4 w-4 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n data-slot=\"dropdown-menu-label\"\n className={cn(\"px-2 py-1.5 text-sm font-semibold\", inset && \"pl-8\", className)}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\"ml-auto text-xs tracking-widest opacity-60\", className)}\n {...props}\n />\n);\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\";\n\nexport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n};\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","/**\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 `trash-2` — delete tier 1, the quiet trash glyph (controls `DeleteButton`). */\nexport function Trash2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"M3 6h18\" />\n <path d=\"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6\" />\n <path d=\"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2\" />\n <line x1=\"10\" x2=\"10\" y1=\"11\" y2=\"17\" />\n <line x1=\"14\" x2=\"14\" y1=\"11\" y2=\"17\" />\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","\"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","\"use client\";\n\n/**\n * A MENU THAT HIDES ITEMS SAYS SO (Arman, 2026-10-02: \"A menu that hides\n * options needs to use best in class UI to show there is more\").\n *\n * Every menu surface already caps at Radix's measured available height and\n * scrolls. What it lacked was any sign that it scrolls: the note editor's\n * right-click menu in Split mode hid Chat and AI Actions below the fold and a\n * reader concluded they did not exist. Champion: macOS menus (an arrow strip\n * at the hidden edge that scrolls while hovered) plus the Linear/Radix edge\n * fade.\n *\n * Each edge that actually hides items gets a soft fade and a chevron strip;\n * an edge that is scrolled to its end gets neither, and a menu that fits gets\n * nothing at all. Measurement is `useScrollFade` (the package's one \"is there\n * more\" meter) — but drawn as OVERLAY elements, not its `mask-image` class:\n * a mask clips everything outside the border box, which would erase the\n * menu's own shadow.\n *\n * The overlays are zero-height `position: sticky` rows inside the surface, so\n * the surface stays the scroller: Radix's keyboard focus still scrolls the\n * focused item into view natively, and `scroll-padding-block` (styles.css)\n * keeps it clear of the fade. Pointer hover on a chevron glides toward the\n * hidden items; a press (touch included) moves one page.\n */\n\nimport * as React from \"react\";\n\nimport { RadixChevronDownIcon, RadixChevronUpIcon } from \"./icons\";\nimport { useScrollFade } from \"./use-scroll-fade\";\n\n/** px per millisecond while a chevron is hovered (~ macOS menu arrow speed). */\nconst HOVER_SPEED = 0.6;\n/** A press keeps this much of the previous page in view, so the reader keeps their place. */\nconst PAGE_OVERLAP = 48;\n\ntype Side = \"top\" | \"bottom\";\n\nfunction composeRefs<T>(...refs: Array<React.Ref<T> | undefined>) {\n return (node: T | null) => {\n for (const ref of refs) {\n if (typeof ref === \"function\") ref(node);\n else if (ref) (ref as React.MutableRefObject<T | null>).current = node;\n }\n };\n}\n\nfunction MenuScrollEdge({ side, scroller }: { side: Side; scroller: React.RefObject<HTMLElement | null> }) {\n const frame = React.useRef<number | null>(null);\n const dir = side === \"top\" ? -1 : 1;\n\n const stop = React.useCallback(() => {\n if (frame.current !== null) cancelAnimationFrame(frame.current);\n frame.current = null;\n }, []);\n\n const glide = React.useCallback(() => {\n stop();\n let last = performance.now();\n const step = (now: number) => {\n const el = scroller.current;\n if (!el) return stop();\n el.scrollTop += dir * HOVER_SPEED * (now - last);\n last = now;\n frame.current = requestAnimationFrame(step);\n };\n frame.current = requestAnimationFrame(step);\n }, [dir, scroller, stop]);\n\n // The edge unmounts the moment its end is reached; the glide stops with it.\n React.useEffect(() => stop, [stop]);\n\n return (\n <div aria-hidden data-menu-scroll-edge={side} className=\"matrx-menu-scroll-edge\">\n <div className=\"matrx-menu-scroll-fade\">\n <div\n data-menu-scroll-button=\"\"\n className=\"matrx-menu-scroll-button\"\n onPointerEnter={(e) => {\n if (e.pointerType !== \"touch\") glide();\n }}\n onPointerLeave={stop}\n onPointerDown={(e) => {\n // Never steal focus from the item the keyboard is on.\n e.preventDefault();\n const el = scroller.current;\n if (!el) return;\n el.scrollTop += dir * Math.max(el.clientHeight - PAGE_OVERLAP, PAGE_OVERLAP);\n }}\n >\n {side === \"top\" ? <RadixChevronUpIcon /> : <RadixChevronDownIcon />}\n </div>\n </div>\n </div>\n );\n}\n\n/**\n * Wire a menu surface: spread `ref` onto the Radix Content/SubContent and wrap\n * its children with `wrap`. Forwarded refs are composed, never replaced.\n */\nexport function useMenuScrollEdges<T extends HTMLElement>(...forwarded: Array<React.Ref<T> | undefined>) {\n const fade = useScrollFade();\n const scroller = React.useRef<HTMLElement | null>(null);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const ref = React.useCallback(composeRefs<T>(scroller as React.Ref<T>, fade.ref as React.Ref<T>, ...forwarded), [\n fade.ref,\n ...forwarded,\n ]);\n const wrap = (children: React.ReactNode) => (\n <>\n {fade.state.top ? <MenuScrollEdge side=\"top\" scroller={scroller} /> : null}\n {children}\n {fade.state.bottom ? <MenuScrollEdge side=\"bottom\" scroller={scroller} /> : null}\n </>\n );\n return { ref, wrap, surfaceClassName: \"matrx-menu-surface\" };\n}\n","\"use client\";\n\n// useScrollFade — ported verbatim from matrx-frontend\n// `components/official/scroll-fade/useScrollFade.ts` (S21).\n//\n// \"There is more below\" — told to the eye, not to nobody.\n//\n// A scroll container that simply hard-clips its last row reads as FINISHED.\n// The user never scrolls, because nothing suggested there was anything to\n// scroll to. A soft fade at the overflowing edge is the standard cue, and it\n// must appear ONLY on the edges that actually overflow — a permanent fade on a\n// non-scrolling list just makes the last item look broken.\n//\n// Attach `ref` to the scrolling element and spread `fadeProps`. Styling is\n// host-owned CSS (the `.matrx-scroll-fade` class in the host's globals.css),\n// keyed off the data attributes.\n//\n// The ref is a CALLBACK ref, not a useRef object, on purpose: these containers\n// are usually mounted conditionally (a popover body, a lazily-resolved menu),\n// so an effect that reads `ref.current` on mount finds null and — with no\n// dependency that ever changes — never runs again. The fade then silently\n// never appears, which is exactly the failure this hook exists to prevent.\n//\n// TWO RULES THE CALLBACK MUST OBEY (both learned the hard way — breaking\n// either one produced \"Maximum update depth exceeded\" on a page of 13 menus):\n// 1. NEVER setState synchronously inside the callback. Radix composes our\n// ref with its own via useComposedRefs, whose identity changes every render,\n// so the ref detaches+reattaches on every commit. A synchronous setState\n// there re-renders, which re-attaches, which sets state again — forever.\n// Measurement is always deferred to rAF.\n// 2. NEVER setState on detach (node === null). A detach/attach pair would\n// otherwise flip the fade off and on and drive the same loop.\n\nimport { useCallback, useEffect, useRef, useState } from \"react\";\n\nexport interface ScrollFadeState {\n top: boolean;\n bottom: boolean;\n}\n\nexport interface UseScrollFadeResult {\n ref: (node: HTMLElement | null) => void;\n fadeProps: {\n \"data-fade-top\": \"\" | undefined;\n \"data-fade-bottom\": \"\" | undefined;\n className: string;\n };\n state: ScrollFadeState;\n}\n\n/** Slack below which we treat the edge as reached (sub-pixel scroll math). */\nconst EPSILON = 2;\n\nexport function useScrollFade(): UseScrollFadeResult {\n const [state, setState] = useState<ScrollFadeState>({\n top: false,\n bottom: false,\n });\n const nodeRef = useRef<HTMLElement | null>(null);\n const cleanupRef = useRef<(() => void) | null>(null);\n\n const measure = useCallback(() => {\n const el = nodeRef.current;\n if (!el) return;\n const overflowing = el.scrollHeight - el.clientHeight > EPSILON;\n const next: ScrollFadeState = {\n top: overflowing && el.scrollTop > EPSILON,\n bottom:\n overflowing &&\n el.scrollTop + el.clientHeight < el.scrollHeight - EPSILON,\n };\n setState((prev) =>\n prev.top === next.top && prev.bottom === next.bottom ? prev : next,\n );\n }, []);\n\n const ref = useCallback(\n (node: HTMLElement | null) => {\n cleanupRef.current?.();\n cleanupRef.current = null;\n nodeRef.current = node;\n // Rule 2: no state change on detach.\n if (!node) return;\n\n node.addEventListener(\"scroll\", measure, { passive: true });\n // Content can arrive after mount (lazy menu configs, async lists) and the\n // box can be resized by the viewport, so watch both.\n // Every menu surface now carries this hook, so it must also run where\n // ResizeObserver does not exist (jsdom suites in every consumer); scroll\n // and mutation still measure there.\n const ro = typeof ResizeObserver === \"undefined\" ? null : new ResizeObserver(measure);\n ro?.observe(node);\n const mo = new MutationObserver(measure);\n mo.observe(node, { childList: true, subtree: true });\n\n cleanupRef.current = () => {\n node.removeEventListener(\"scroll\", measure);\n ro?.disconnect();\n mo.disconnect();\n };\n\n // Rule 1: deferred, never synchronous. Radix also animates the panel in,\n // so its final height is not known on the frame it mounts anyway.\n requestAnimationFrame(measure);\n },\n [measure],\n );\n\n useEffect(() => () => cleanupRef.current?.(), []);\n\n return {\n ref,\n state,\n fadeProps: {\n \"data-fade-top\": state.top ? \"\" : undefined,\n \"data-fade-bottom\": state.bottom ? \"\" : undefined,\n className: \"matrx-scroll-fade\",\n },\n };\n}\n","import * as React from \"react\";\n\n/**\n * A SUBMENU NEVER CLOSES BECAUSE ITS PARENT PANEL TOOK FOCUS (blind run PB-04, /notes,\n * 2026-10-02: at a 1024 px viewport AI Actions ▸ Text Operations ▸ Text Tools closed the whole\n * menu; works at 1600 px).\n *\n * Radix keeps a submenu open while the pointer leaves its trigger only when the pointer's last\n * horizontal move inside the parent panel points at the side the submenu is drawn on. A narrow\n * viewport FLIPS the submenu to the left; a pointer that last moved right (or jumped) and heads\n * for it is \"not moving to the submenu\", so Radix focuses the parent PANEL itself, the submenu\n * reads that as focus outside and closes under the pointer, and the click meant for it lands on\n * the page and closes the whole menu. Focus on the parent panel (role=\"menu\", the panel holding\n * this submenu's trigger) only means \"the pointer left a row without entering another one\" — it\n * never closes a submenu, on either side. Focus on another ROW still closes it, as before.\n *\n * Returns the composed ref and the `onFocusOutside` handler a SubContent wrapper spreads.\n */\nexport function useSubmenuSurvivesParentPanelFocus<T extends HTMLElement, E extends Event>(\n forwardedRef: React.ForwardedRef<T>,\n onFocusOutside: ((event: E) => void) | undefined,\n): { ref: (node: T | null) => void; onFocusOutside: (event: E) => void } {\n const content = React.useRef<T | null>(null);\n const ref = React.useCallback(\n (node: T | null) => {\n content.current = node;\n if (typeof forwardedRef === \"function\") forwardedRef(node);\n else if (forwardedRef) forwardedRef.current = node;\n },\n [forwardedRef],\n );\n const handle = (event: E) => {\n onFocusOutside?.(event);\n if (event.defaultPrevented) return;\n const to = event.target;\n const id = content.current?.id;\n if (!(to instanceof Element) || !id || to.getAttribute(\"role\") !== \"menu\") return;\n const holdsTrigger = Array.from(to.querySelectorAll(\"[aria-controls]\")).some((el) => el.getAttribute(\"aria-controls\") === id);\n if (holdsTrigger) event.preventDefault();\n };\n return { ref, onFocusOutside: handle };\n}\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 * 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\";\n\n/**\n * The settled surfaces that hold the one control (owner, 2026-10-02/03):\n * one surface level, ~36px hairline rows, 8px radius; the empty state; the\n * region-shaped skeleton; the three delete tiers; the one-feature promo banner.\n * Skins are locked in `controls.css` like the controls themselves.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { ConfirmDialog } from \"../confirm-dialog\";\nimport { Trash2Icon } from \"../icons\";\nimport { Skeleton } from \"../skeleton\";\nimport { Button, ControlRow } from \"./controls\";\n\n/* ------------------------------------------------------------------ */\n/* Row groups */\n/* ------------------------------------------------------------------ */\n\nexport interface RowGroupProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n /** 11px uppercase heading above the group. */\n title?: React.ReactNode;\n /** The danger-zone skin (delete tier 3). */\n danger?: boolean;\n}\n\n/** A bordered group of hairline rows — the one surface for grouped content. */\nexport function RowGroup({ title, danger, className, children, ...props }: RowGroupProps) {\n return (\n <section\n data-matrx-row-group=\"\"\n data-danger={danger ? \"\" : undefined}\n className={cn(\"matrx-control-group\", className)}\n {...props}\n >\n {title ? <h2 className=\"matrx-control-group-title\">{title}</h2> : null}\n <div className=\"matrx-control-group-body\">{children}</div>\n </section>\n );\n}\n\nexport interface SettingRowProps {\n label: React.ReactNode;\n /** One 12px line under the label. */\n line?: React.ReactNode;\n /** Ties the label to the control it describes. */\n htmlFor?: string;\n /** The row's controls, right-aligned on one line. */\n children?: React.ReactNode;\n className?: string;\n}\n\n/** One ~36px row: 13px label, optional 12px line, controls on the right. */\nexport function SettingRow({ label, line, htmlFor, children, className }: SettingRowProps) {\n return (\n <div data-matrx-setting-row=\"\" className={cn(\"matrx-control-setting-row\", className)}>\n <div className=\"matrx-control-setting-text\">\n {htmlFor ? (\n <label htmlFor={htmlFor} className=\"matrx-control-setting-label\">\n {label}\n </label>\n ) : (\n <div className=\"matrx-control-setting-label\">{label}</div>\n )}\n {line ? <div className=\"matrx-control-setting-line\">{line}</div> : null}\n </div>\n {children ? (\n <ControlRow nowrap data-matrx-row-actions=\"\">\n {children}\n </ControlRow>\n ) : null}\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Empty state */\n/* ------------------------------------------------------------------ */\n\nexport interface EmptyStateProps {\n /** A 20px glyph inside the tinted disc. */\n icon: React.ReactNode;\n /** 13px title. */\n title: React.ReactNode;\n /** One 12px line. */\n line?: React.ReactNode;\n /** The one 28px action (a controls `Button`). */\n action?: React.ReactNode;\n className?: string;\n}\n\n/** Tinted icon disc + 13px title + one line + one 28px button. */\nexport function EmptyState({ icon, title, line, action, className }: EmptyStateProps) {\n return (\n <div data-matrx-empty-state=\"\" className={cn(\"matrx-control-empty\", className)}>\n <div className=\"matrx-control-empty-disc\" aria-hidden=\"true\">\n {icon}\n </div>\n <div>\n <div className=\"matrx-control-empty-title\">{title}</div>\n {line ? <div className=\"matrx-control-empty-line\">{line}</div> : null}\n </div>\n {action ? <ControlRow className=\"justify-center\">{action}</ControlRow> : null}\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Region skeleton */\n/* ------------------------------------------------------------------ */\n\nexport interface RegionSkeletonProps {\n /** The region's shape: hairline rows, a form's label+field pairs, or cards. */\n shape?: \"rows\" | \"form\" | \"cards\";\n /** How many rows / fields / cards. */\n count?: number;\n /** Rows: a second (meta) line under each title. */\n twoLine?: boolean;\n className?: string;\n \"aria-label\"?: string;\n}\n\n/**\n * A skeleton shaped like the region it stands in for — never one block for a\n * page, never a spinner in the middle. A spinner belongs only inside a busy\n * control.\n */\nexport function RegionSkeleton({\n shape = \"rows\",\n count = shape === \"cards\" ? 3 : shape === \"form\" ? 4 : 8,\n twoLine = false,\n className,\n \"aria-label\": ariaLabel = \"Loading\",\n}: RegionSkeletonProps) {\n const items = Array.from({ length: count }, (_, i) => i);\n if (shape === \"form\") {\n return (\n <div aria-busy=\"true\" aria-label={ariaLabel} className={cn(\"flex flex-col gap-3\", className)}>\n {items.map((i) => (\n <div key={i} className=\"flex flex-col gap-1.5\">\n <Skeleton className=\"h-3 w-24\" />\n <Skeleton className=\"h-7 rounded-full\" />\n </div>\n ))}\n </div>\n );\n }\n if (shape === \"cards\") {\n return (\n <div aria-busy=\"true\" aria-label={ariaLabel} className={cn(\"grid gap-2 sm:grid-cols-3\", className)}>\n {items.map((i) => (\n <div key={i} className=\"flex items-center gap-3 rounded-lg border border-border p-3\">\n <Skeleton className=\"size-8 rounded-full\" />\n <div className=\"flex flex-1 flex-col gap-1.5\">\n <Skeleton className=\"h-3.5 w-2/3\" />\n <Skeleton className=\"h-2.5 w-1/2\" />\n </div>\n </div>\n ))}\n </div>\n );\n }\n return (\n <div aria-busy=\"true\" aria-label={ariaLabel} className={cn(\"divide-y divide-border\", className)}>\n {items.map((i) => (\n <div key={i} className=\"flex min-h-9 items-center gap-3 px-3 py-1.5\">\n <Skeleton className=\"size-4 rounded-full\" />\n <div className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <Skeleton className=\"h-3.5\" style={{ width: `${30 + ((i * 17) % 35)}%` }} />\n {twoLine ? <Skeleton className=\"h-2.5 w-1/4\" /> : null}\n </div>\n <Skeleton className=\"hidden h-[1.125rem] w-16 rounded-md sm:block\" />\n <Skeleton className=\"size-5 rounded-full\" />\n </div>\n ))}\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* The three delete tiers */\n/* ------------------------------------------------------------------ */\n\nexport interface DeleteButtonProps\n extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"children\" | \"aria-label\"> {\n /** What it deletes, e.g. \"Delete reference\". */\n \"aria-label\": string;\n}\n\n/** Tier 1 — the quiet trash glyph: muted until hover, destructive on hover. */\nexport const DeleteButton = React.forwardRef<HTMLButtonElement, DeleteButtonProps>((props, ref) => (\n <Button ref={ref} variant=\"quiet\" icon={<Trash2Icon />} data-delete=\"\" title={props[\"aria-label\"]} {...props} />\n));\nDeleteButton.displayName = \"DeleteButton\";\n\nexport interface ConfirmDeleteProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n /** \"Delete this project?\" */\n title: React.ReactNode;\n /** REQUIRED: name the cost — what is lost, what goes with it. Never \"Are you sure?\". */\n cost: React.ReactNode;\n /** The confirm button names the act, e.g. \"Delete project\". */\n confirmLabel: string;\n onConfirm: () => void | Promise<void>;\n busy?: boolean;\n}\n\n/** Tier 2 — a confirm that names the cost. */\nexport function ConfirmDelete({ open, onOpenChange, title, cost, confirmLabel, onConfirm, busy }: ConfirmDeleteProps) {\n return (\n <ConfirmDialog\n open={open}\n onOpenChange={onOpenChange}\n title={title}\n description={cost}\n confirmLabel={confirmLabel}\n variant=\"destructive\"\n busy={busy}\n onConfirm={onConfirm}\n />\n );\n}\n\n/** Tier 3 — the danger zone: a red-ruled group of rows at the end of settings. */\nexport function DangerZone({\n title = \"Danger zone\",\n children,\n className,\n}: {\n title?: React.ReactNode;\n children: React.ReactNode;\n className?: string;\n}) {\n return (\n <RowGroup title={title} danger className={className}>\n {children}\n </RowGroup>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Promo banner */\n/* ------------------------------------------------------------------ */\n\nexport type PromoTone = \"primary\" | \"success\" | \"warning\" | \"info\";\n\nexport interface PromoBannerProps {\n /** A 16px glyph inside the tinted disc. */\n icon: React.ReactNode;\n /** 11px label before the title, e.g. \"Next challenge\". Never a pill. */\n eyebrow?: React.ReactNode;\n /** One line, 13px. */\n title: React.ReactNode;\n /** One line, 12px, ≤60 characters. Omit rather than pad. */\n line?: React.ReactNode;\n /** Outline badges — the evidence behind the promo. */\n chips?: React.ReactNode;\n /** The one action: a controls `Button` (or a link wearing it). */\n action?: React.ReactNode;\n tone?: PromoTone;\n className?: string;\n /** Accessible name of the region. Defaults to \"Featured\". */\n \"aria-label\"?: string;\n}\n\n/**\n * A page-top variant that promotes ONE feature in one bordered row (~56px):\n * [disc] EYEBROW · Title / one line … [chips] [Action]. On a phone the chips\n * wrap under the text and the action stretches full width.\n */\nexport function PromoBanner({\n icon,\n eyebrow,\n title,\n line,\n chips,\n action,\n tone = \"primary\",\n className,\n \"aria-label\": ariaLabel,\n}: PromoBannerProps) {\n return (\n <section\n aria-label={ariaLabel ?? (typeof eyebrow === \"string\" ? eyebrow : \"Featured\")}\n data-matrx-promo=\"\"\n data-tone={tone}\n className={cn(\"matrx-control-promo\", className)}\n >\n <span className=\"matrx-control-promo-disc\" aria-hidden=\"true\">\n {icon}\n </span>\n <div className=\"matrx-control-promo-text\">\n <div className=\"matrx-control-promo-head\">\n {eyebrow ? <span className=\"matrx-control-promo-eyebrow\">{eyebrow}</span> : null}\n {eyebrow ? (\n <span className=\"matrx-control-promo-eyebrow\" aria-hidden=\"true\">\n ·\n </span>\n ) : null}\n <span className=\"matrx-control-promo-title\">{title}</span>\n </div>\n {line ? <div className=\"matrx-control-promo-line\">{line}</div> : null}\n </div>\n {chips ? <div className=\"matrx-control-promo-chips\">{chips}</div> : null}\n {action ? (\n <ControlRow nowrap className=\"matrx-control-promo-action\">\n {action}\n </ControlRow>\n ) : null}\n </section>\n );\n}\n","\"use client\";\n\n/**\n * AlertDialog — the confirm/destroy surface (78 host import sites).\n *\n * Ported from matrx-frontend `components/ui/alert-dialog.tsx`, which was the\n * only variant in the fleet that had been hardened. Its rulings, kept verbatim:\n *\n * 1. THE ROOT RENDERS UNCONDITIONALLY — no hydration mount gate. The gate a\n * wrapper once carried (\"Radix ids differ between SSR and client\") was\n * false, and it deleted always-visible Triggers (delete buttons, mostly)\n * from SSR and the first client paint.\n *\n * 2. AN UNDESCRIBED ALERT DIALOG STILL DESCRIBES ITSELF. A confirm dialog with\n * no `AlertDialogDescription` gets a screen-reader-only one rather than a\n * console warning — the surface where a blind user is about to destroy\n * something is the wrong place to ship an accessibility gap.\n *\n * ADDED HERE, from the same doctrine `Dialog` already carries and this\n * component demonstrably needed:\n *\n * 3. IT IS CLAMPED TO THE VIEWPORT AND SCROLLS INSIDE ITSELF\n * (`max-h-[85dvh] overflow-y-auto`). The host copy was NOT — an alert\n * dialog whose body listed what is about to be deleted pushed Cancel and\n * Continue below the fold on a short viewport, and the only way out was a\n * backdrop click. On an ALERT dialog Radix does not dismiss on backdrop\n * click, so the surface was a genuine dead end. Recorded in CHANGELOG as a\n * real defect fixed in the port, not \"preserved\".\n *\n * 4. THE ACTIONS ARE 44px TALL ON COARSE POINTERS. `AlertDialogAction` and\n * `AlertDialogCancel` inherit the package Button's own target rules through\n * `buttonVariants`; the footer keeps them safe-area padded on mobile.\n *\n * 5. THE STICKY FOOTER NEVER PAINTS OVER THE BODY (0.11.3). Ruling 3's footer\n * bled over the card's bottom padding with a negative block margin, and\n * `position: sticky` clamps a box to its containing block — so the footer\n * was dragged UP by `--dialog-pad` against the card's `gap-4`, covering the\n * last 8px of the consequence copy at every length, unreachable because the\n * card did not scroll. The bleed is now the card's RESERVATION\n * (`.matrx-dialog-card` hands its bottom padding to the footer), which\n * sticky has nothing to clamp. See `sticky-footer-geometry.test.tsx`.\n *\n * SEAM INVERSION. The host resolved its portal target through\n * `usePopoutContainer` (its window-panel popout body); here that is the\n * package's `PortalContainerProvider`, with an explicit `container` prop still\n * winning.\n */\n\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\";\nimport { treeContainsComponent } from \"@ai-matrx/kit/react-tree\";\nimport * as React from \"react\";\n\nimport { buttonVariants } from \"./button\";\nimport { cn } from \"./cn\";\nimport { useModalLayer } from \"./floating-layer\";\nimport { CENTERED_DIALOG, MOTION_DIALOG, MOTION_OVERLAY } from \"./motion\";\nimport { usePortalContainer } from \"./portal-container\";\n\nconst AlertDialog = AlertDialogPrimitive.Root;\n\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\n\n/**\n * Portal-seam-aware AlertDialogPortal. Explicit `container` wins; with none,\n * the injected container; with neither, Radix's `document.body`.\n */\nconst AlertDialogPortal = ({\n container,\n ...props\n}: Omit<\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Portal>,\n \"container\"\n> & {\n /** `undefined` → use the injected container; `null` → force document.body. */\n container?: HTMLElement | null | undefined;\n}) => {\n const resolved = usePortalContainer(container);\n return (\n <AlertDialogPrimitive.Portal container={resolved ?? null} {...props} />\n );\n};\nAlertDialogPortal.displayName = \"AlertDialogPortal\";\n\nconst AlertDialogOverlay = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Overlay\n ref={ref}\n data-slot=\"alert-dialog-overlay\"\n className={cn(\n \"fixed inset-0 z-[10000] bg-[var(--matrx-overlay-scrim)]\",\n MOTION_OVERLAY,\n className,\n )}\n {...props}\n />\n));\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;\n\n/**\n * Unstyled, non-portalling Content for custom layouts. AlertDialog is always\n * modal, so `aria-modal` is stated rather than derived.\n */\nconst AlertDialogContentPrimitive = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>\n>((props, ref) => {\n // Always blocking: floating layers opened from it stack above its scrim.\n useModalLayer(true);\n return <AlertDialogPrimitive.Content {...props} ref={ref} aria-modal=\"true\" />;\n});\nAlertDialogContentPrimitive.displayName = \"AlertDialogContentPrimitive\";\n\nconst AlertDialogDescription = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Description\n ref={ref}\n data-slot=\"alert-dialog-description\"\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nAlertDialogDescription.displayName =\n AlertDialogPrimitive.Description.displayName;\n\nexport interface AlertDialogContentProps\n extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.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\nconst AlertDialogContent = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Content>,\n AlertDialogContentProps\n>(({ className, children, container, animated = true, ...props }, ref) => {\n const hasDescription =\n treeContainsComponent(children, AlertDialogDescription) ||\n treeContainsComponent(children, AlertDialogPrimitive.Description);\n return (\n <AlertDialogPortal container={container}>\n <AlertDialogOverlay />\n <AlertDialogContentPrimitive\n ref={ref}\n data-slot=\"alert-dialog-content\"\n className={cn(\n `matrx-dialog-card fixed left-[50%] top-[50%] z-[10000] grid min-w-0 w-full max-w-lg ${CENTERED_DIALOG} gap-4 border bg-background p-6 shadow-lg`,\n // Ruling 3 — never taller than the viewport, always scrollable, and\n // the footer stays reachable via --dialog-pad like Dialog's.\n // Ruling 5 (0.11.3) — `matrx-dialog-card` hands the bottom padding to\n // a sticky footer when there is one, so the footer's box matches the\n // space the grid gave it and sticky never clamps it up over the\n // consequence copy.\n \"max-h-[85dvh] overflow-y-auto overscroll-contain [--dialog-pad:1.5rem] overflow-x-clip [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full\",\n \"sm:rounded-lg\",\n animated && MOTION_DIALOG,\n className,\n )}\n {...props}\n >\n {hasDescription ? null : (\n <AlertDialogPrimitive.Description className=\"sr-only\">\n Please confirm the action described in this dialog.\n </AlertDialogPrimitive.Description>\n )}\n {children}\n </AlertDialogContentPrimitive>\n </AlertDialogPortal>\n );\n});\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;\n\nconst AlertDialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n data-slot=\"alert-dialog-header\"\n className={cn(\"flex flex-col space-y-2 text-center sm:text-left\", className)}\n {...props}\n />\n);\nAlertDialogHeader.displayName = \"AlertDialogHeader\";\n\nconst AlertDialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n data-slot=\"alert-dialog-footer\"\n className={cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n // Ruling 3/4 — sticky to the card edges so a scrolled body never shows\n // through under the actions, and safe-area padded on a phone.\n //\n // 🚨 THERE IS NO `mb-[…]` HERE, AND THERE MUST NEVER BE ONE AGAIN\n // (0.11.3, feedback bf8fb00b). The bleed over the card's bottom padding\n // used to be a NEGATIVE BLOCK MARGIN, which makes this box taller than\n // the grid area the card allocates it — and `position: sticky` CLAMPS a\n // box to its containing block, so the browser yanked the footer UP by\n // `--dialog-pad` against the card's `gap-4` and painted 8px of opaque\n // footer over the last line of the consequence, at every length. The\n // card now RESERVES this footer's block size instead (`matrx-dialog-card`\n // in styles.css hands over its `padding-bottom`), so the bleed costs no\n // margin at all. Guard: `sticky-footer-geometry.test.tsx`.\n //\n // These stay UTILITIES rather than a shipped rule so a caller's\n // `className` still wins through tailwind-merge — a shipped rule would\n // have to be unlayered to survive Tailwind preflight (§ THE PREFLIGHT\n // RULE in styles.css) and would then override every caller's padding.\n \"sticky bottom-0 z-10 bg-background pt-3\",\n \"mx-[calc(var(--dialog-pad,0px)*-1)] px-[var(--dialog-pad,0px)] pb-[var(--dialog-pad,0px)]\",\n className,\n )}\n {...props}\n />\n);\nAlertDialogFooter.displayName = \"AlertDialogFooter\";\n\nconst AlertDialogTitle = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Title\n ref={ref}\n data-slot=\"alert-dialog-title\"\n className={cn(\"text-lg font-semibold\", className)}\n {...props}\n />\n));\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;\n\nconst AlertDialogAction = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Action>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Action\n ref={ref}\n data-slot=\"alert-dialog-action\"\n className={cn(buttonVariants(), className)}\n {...props}\n />\n));\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;\n\nconst AlertDialogCancel = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Cancel>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Cancel\n ref={ref}\n data-slot=\"alert-dialog-cancel\"\n className={cn(\n buttonVariants({ variant: \"outline\" }),\n \"mt-2 sm:mt-0\",\n className,\n )}\n {...props}\n />\n));\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;\n\nexport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogContentPrimitive,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogOverlay,\n AlertDialogPortal,\n AlertDialogTitle,\n AlertDialogTrigger,\n};\n","\"use client\";\n\n/**\n * FLOATING LAYERS OPENED FROM INSIDE A MODAL — one contract, every surface.\n *\n * A blocking surface (a `modal` Dialog, AlertDialog, Sheet, Drawer,\n * BottomSheet, CommandDialog — and every Dialog on a phone) paints a scrim at\n * the modal tier, `MODAL_LAYER_Z`. Radix children of that surface (Popover,\n * Select, menus) are safe: they portal into it or after it at the same z, and\n * Radix counts a press inside them as inside. A floating layer that is NOT a\n * Radix child — a host window manager's window, the associations picker\n * window, anything `createPortal`ed to `<body>` at its own z — was not: it\n * painted UNDER the scrim (a window manager lives near z-1000), so the click\n * that picked an option landed on the scrim and closed the modal (Source\n * screen side sheet + association picker, 2026-09-26). Behind the scrim it\n * would also have lost focus to the modal's trap and had presses inside it\n * counted as outside-clicks.\n *\n * The contract, in three parts:\n *\n * 1. Every modal content registers while it is open (`useModalLayer`), and\n * treats a press or focus inside any `[data-matrx-floating-layer]` as\n * inside (`keepFloatingLayersInside`).\n * 2. A floating layer reads `useFloatingLayerZIndex(ownZ)`: while a modal is\n * open it is lifted to the modal tier. Equal z, so DOM order decides — a\n * layer opened AFTER the modal (portal appended later) paints above its\n * scrim; a window that was already open stays underneath, as it should.\n * While lifted, several floating layers order by when they opened, not by\n * their own manager's focus order; that returns when the modal closes.\n * 3. A floating layer's root is wrapped in `<FloatingLayer>`: it carries the\n * marker attribute, re-asserts `pointer-events: auto` (a modal sets `none`\n * on `<body>`), and mounts a non-trapping focus scope, which pauses the\n * modal's focus trap while the layer is open so its inputs take focus.\n *\n * 4. Popper content (a Popover, a combobox) a floating layer opens is portaled\n * to <body>; while a floating layer is open it counts as part of it, and\n * wheel/touchmove inside either stops at <body> so the modal's scroll lock\n * never cancels it.\n *\n * Guard: `floating-layer.test.tsx` — a window-manager-style layer opened from\n * each blocking surface must stack above the scrim, keep the modal open when\n * it or a popover it opened is pressed, scroll, keep focus in its own input,\n * and hand focus back to its opener when it closes.\n */\n\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\n\n/** The modal tier: every blocking scrim and its content sit here. */\nexport const MODAL_LAYER_Z = 10000;\n\n/** Marker attribute on the root of a floating layer. */\nexport const FLOATING_LAYER_ATTR = \"data-matrx-floating-layer\";\n\n// ── the open-modal registry ─────────────────────────────────────────────────\n// Shared identity across independently bundled public entrypoints, like the\n// dialog contexts: two copies of this module must see one count.\ninterface ModalLayerRegistry {\n count: number;\n listeners: Set<() => void>;\n}\nconst REGISTRY_SLOT = Symbol.for(\"ai-matrx.design-system.modal-layer-registry\");\nconst registryHost = globalThis as typeof globalThis & {\n [REGISTRY_SLOT]?: ModalLayerRegistry;\n};\nconst registry: ModalLayerRegistry = (registryHost[REGISTRY_SLOT] ??= {\n count: 0,\n listeners: new Set(),\n});\n\nfunction emit(): void {\n for (const listener of registry.listeners) listener();\n}\n\n// A modal's scroll lock (react-remove-scroll) cancels wheel and touchmove on\n// `document` for anything outside the modal's own content — including a\n// floating layer opened from it, whose list then never scrolls. While a modal\n// is open, a scroll gesture inside a floating layer stops at <body>: React's\n// own portal listener on <body> still sees it (stopPropagation never stops\n// listeners on the same node), the lock on `document` never does.\nconst SCROLL_EVENTS = [\"wheel\", \"touchmove\"] as const;\nfunction stopAtBody(event: Event): void {\n if (isInsideFloatingLayer(event.target)) event.stopPropagation();\n}\nfunction setScrollPassthrough(on: boolean): void {\n if (typeof document === \"undefined\" || !document.body) return;\n for (const type of SCROLL_EVENTS) {\n if (on) document.body.addEventListener(type, stopAtBody, { passive: true });\n else document.body.removeEventListener(type, stopAtBody);\n }\n}\n\n/** Register one open modal layer; returns its release. */\nexport function registerModalLayer(): () => void {\n registry.count += 1;\n if (registry.count === 1) setScrollPassthrough(true);\n emit();\n let released = false;\n return () => {\n if (released) return;\n released = true;\n registry.count = Math.max(0, registry.count - 1);\n if (registry.count === 0) setScrollPassthrough(false);\n emit();\n };\n}\n\n/** True while at least one blocking surface is open. */\nexport function isModalLayerOpen(): boolean {\n return registry.count > 0;\n}\n\nfunction subscribe(listener: () => void): () => void {\n registry.listeners.add(listener);\n return () => registry.listeners.delete(listener);\n}\n\n/** Reactive `isModalLayerOpen()`. */\nexport function useModalLayerOpen(): boolean {\n return React.useSyncExternalStore(subscribe, isModalLayerOpen, () => false);\n}\n\n/**\n * Called by every modal content while it is mounted. `active` is false for a\n * content whose root is not modal (a windowed dialog, a `modal={false}` sheet).\n */\nexport function useModalLayer(active: boolean): void {\n React.useLayoutEffect(() => (active ? registerModalLayer() : undefined), [active]);\n}\n\n// ── the outside-click guard ─────────────────────────────────────────────────\n\nconst POPPER_WRAPPER = \"[data-radix-popper-content-wrapper]\";\n\n/**\n * True when `target` is inside a floating layer — or inside popper content (a\n * Popover, a combobox list) while a floating layer is open. Popper content a\n * window opens is portaled to <body>, outside the window's own element and\n * outside the modal's React tree; popper content the MODAL opens is portaled\n * into the modal and never reaches this check.\n */\nexport function isInsideFloatingLayer(target: EventTarget | null | undefined): boolean {\n if (!(target instanceof Element)) return false;\n if (target.closest(`[${FLOATING_LAYER_ATTR}]`)) return true;\n return (\n target.closest(POPPER_WRAPPER) !== null &&\n target.ownerDocument.querySelector(`[${FLOATING_LAYER_ATTR}]`) !== null\n );\n}\n\n/**\n * Wrap a Radix `onInteractOutside` so a press or focus inside a floating layer\n * never dismisses the modal. The caller's handler still runs first.\n */\nexport function keepFloatingLayersInside<\n E extends { target: EventTarget | null; preventDefault: () => void },\n>(handler?: (event: E) => void): (event: E) => void {\n return (event) => {\n handler?.(event);\n if (isInsideFloatingLayer(event.target)) event.preventDefault();\n };\n}\n\n// ── the floating layer's side ───────────────────────────────────────────────\n\n/** Pure form of `useFloatingLayerZIndex`, for callers outside React. */\nexport function floatingLayerZIndex(ownZ: number, modalOpen: boolean): number {\n return modalOpen ? Math.max(ownZ, MODAL_LAYER_Z) : ownZ;\n}\n\n/** The z-index a floating layer should paint at, given its own. */\nexport function useFloatingLayerZIndex(ownZ: number): number {\n return floatingLayerZIndex(ownZ, useModalLayerOpen());\n}\n\nconst preventAutoFocus = (event: Event) => event.preventDefault();\n\n/**\n * Wrap the root element of a floating layer (exactly one element child).\n * Marks it, keeps it pressable under a modal's `pointer-events: none` body,\n * and pauses the modal's focus trap while it is mounted. It never takes focus\n * on open. On close, if focus was lost with it while a modal is still open,\n * focus returns to the control that opened it — otherwise the next Tab would\n * land behind the modal.\n */\nexport const FloatingLayer = React.forwardRef<\n HTMLElement,\n { children: React.ReactElement }\n>(({ children }, ref) => {\n const [opener] = React.useState<Element | null>(() =>\n typeof document === \"undefined\" ? null : document.activeElement,\n );\n const returnFocus = (event: Event) => {\n event.preventDefault();\n const active = document.activeElement;\n const lost = !active || active === document.body || !active.isConnected;\n if (lost && isModalLayerOpen() && opener instanceof HTMLElement && opener.isConnected) {\n opener.focus({ preventScroll: true });\n }\n };\n return (\n <FocusScope\n asChild\n trapped={false}\n loop={false}\n onMountAutoFocus={preventAutoFocus}\n onUnmountAutoFocus={returnFocus}\n >\n <Slot\n ref={ref}\n {...{ [FLOATING_LAYER_ATTR]: \"\" }}\n style={{ pointerEvents: \"auto\" }}\n >\n {children}\n </Slot>\n </FocusScope>\n );\n});\nFloatingLayer.displayName = \"FloatingLayer\";\n","\"use client\";\n\n/**\n * ConfirmDialog — the `window.confirm` replacement, declarative half.\n *\n * WHY IT LIVES HERE AND NOT IN `@ai-matrx/kit` (census row 19i, decided by the\n * package-graph ruling of 2026-09-07, on the row-20a Tooltip precedent).\n *\n * kit shipped this dialog with its own inlined AlertDialog, its own inlined\n * button class strings, a hardcoded 80%-opaque black scrim, and\n * `data-[state=open]:animate-in … zoom-in-95 … slide-in-from-top-[48%]` —\n * host-plugin utilities `tailwindcss-animate`/`tw-animate-css` supply and a\n * package cannot ship. kit ships NO stylesheet at all, so in three of the four\n * consumers the most consequential surface in the app (the one standing\n * between a user and a destroyed thing) appeared with no animation, no error,\n * and a scrim that ignored the theme. kit could not import the fix:\n * `@ai-matrx/design-system` depends on `@ai-matrx/kit`, so importing back is a\n * cycle; giving kit its own sheet would invent a second required-CSS contract\n * no consumer performs (the C26 silent host contract, one layer down).\n *\n * The resolution is the one row 20a already proved: the surface moves to the\n * package that owns the surface. This file is built on THIS package's\n * `AlertDialog` — so it inherits, for free and forever:\n *\n * - the package motion layer (`matrx-motion-overlay` / `matrx-motion-dialog`),\n * whose rules ship in `styles.css` and are proven present in the tarball;\n * - `--matrx-overlay-scrim`, a token that answers to the host's theme,\n * instead of an opaque black literal;\n * - AlertDialog ruling 3 — clamped to `max-h-[85dvh]`, scrolling inside\n * itself, with a sticky footer. **This is what makes the consequence-first\n * copy law survivable**: a confirmation that names everything it is about\n * to destroy can be long, and in kit's copy a long one pushed Cancel and\n * Continue below the fold of a short viewport with no backdrop dismissal —\n * a dead end on a destructive action;\n * - `buttonVariants` as the ONE source of button appearance, including the\n * 44px coarse-pointer target;\n * - `PortalContainerProvider`, so a dialog opened inside a popped-out window\n * panel renders in THAT window's document.\n *\n * kit keeps `./confirm-opener` — the pure, React-free imperative `confirm()`\n * and its `globalThis`-slotted host registry — and re-exports nothing of this.\n * Consumers mount `<ConfirmDialogHost />` from here and call `confirm()` from\n * there. See `confirm-host.tsx` for the join.\n *\n * BEHAVIOR IS THE KIT PORT, VERBATIM. Every prop, default and interaction is\n * unchanged; only the chrome underneath it is the package's.\n *\n * Pattern: hold the pending target in state, render `<ConfirmDialog />` once at\n * the bottom of the component, and open it by setting the target. When busy\n * state is meaningful (a network delete that should hold the dialog open with a\n * spinner), use THIS component inline; the imperative `confirm()` closes\n * immediately on click.\n */\n\nimport * as React from \"react\";\n\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from \"./alert-dialog\";\nimport { buttonVariants } from \"./button\";\nimport { cn } from \"./cn\";\nimport { Loader2Icon } from \"./icons\";\nimport { MOTION_SPIN } from \"./motion\";\n\nexport interface ConfirmDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n title: React.ReactNode;\n /**\n * THE CONSEQUENCE. Per the platform's destructive-and-expensive-actions law,\n * a confirmation must name what is lost, what is duplicated, and/or what it\n * costs — \"Are you sure?\" is not a confirmation. This renders as the dialog's\n * accessible description, so a screen-reader user is told the consequence\n * too, and it is never clamped or truncated.\n */\n description?: React.ReactNode | undefined;\n /**\n * Rich body rendered between the header and the footer. Use it for\n * supplementary or interactive content that is not part of the dialog's\n * accessible consequence description.\n */\n content?: React.ReactNode | undefined;\n /** Extra classes for the dialog content (e.g. a wider max-w for diffs). */\n contentClassName?: string | undefined;\n confirmLabel?: string | undefined;\n /**\n * `null` hides the cancel button entirely — for acknowledge-only dialogs\n * where there is nothing to cancel. Anything else labels it.\n */\n cancelLabel?: string | null | undefined;\n variant?: \"default\" | \"destructive\" | undefined;\n busy?: boolean | undefined;\n /**\n * Blocks confirming without pretending work is in flight. For a dialog whose\n * `content` asks the user something the action cannot proceed without — the\n * choice is missing, not loading — `busy` would show a misleading spinner.\n */\n confirmDisabled?: boolean | undefined;\n /**\n * The question is not answerable yet — Confirm is ABSENT, not disabled (a\n * control is absent or honest, never dead). The body carries its own loading\n * state; Cancel stays. Set by `ConfirmDialogHost` while `ConfirmOptions.ready`\n * is pending (0.54.0).\n */\n confirmHeld?: boolean | undefined;\n /**\n * Explicit portal target. Default (undefined): the container injected by\n * `PortalContainerProvider`, else `document.body`. Hosts with retargeting\n * needs (a popped-out browser window whose dialog must render in THAT\n * window's document) may still pass the element directly.\n */\n portalContainer?: HTMLElement | null | undefined;\n onConfirm: () => void | Promise<void>;\n}\n\n/**\n * Drop-in replacement for `window.confirm`. Use this anywhere you would\n * otherwise reach for a browser-level confirm dialog.\n */\nexport function ConfirmDialog({\n open,\n onOpenChange,\n title,\n description,\n content,\n contentClassName,\n confirmLabel = \"Confirm\",\n cancelLabel = \"Cancel\",\n variant = \"default\",\n busy = false,\n confirmDisabled = false,\n confirmHeld = false,\n portalContainer,\n onConfirm,\n}: ConfirmDialogProps) {\n return (\n <AlertDialog open={open} onOpenChange={onOpenChange}>\n <AlertDialogContent\n className={contentClassName}\n {...(portalContainer === undefined ? {} : { container: portalContainer })}\n >\n <AlertDialogHeader>\n <AlertDialogTitle>{title}</AlertDialogTitle>\n {description ? (\n <AlertDialogDescription asChild>\n <div>{description}</div>\n </AlertDialogDescription>\n ) : null}\n </AlertDialogHeader>\n {content ?? null}\n <AlertDialogFooter>\n {cancelLabel === null ? null : (\n <AlertDialogCancel className=\"max-lg:min-h-11\" disabled={busy}>\n {cancelLabel}\n </AlertDialogCancel>\n )}\n {confirmHeld ? null : (\n <AlertDialogAction\n disabled={busy || confirmDisabled}\n onClick={(event) => {\n event.preventDefault();\n void onConfirm();\n }}\n className={cn(\n \"max-lg:min-h-11\",\n // One source of button appearance: the destructive look comes\n // from `buttonVariants`, not a second hand-written copy of it.\n // tailwind-merge makes it WIN over the default variant classes.\n variant === \"destructive\" &&\n buttonVariants({ variant: \"destructive\" }),\n )}\n >\n {busy ? (\n <Loader2Icon className={cn(\"mr-2 h-4 w-4\", MOTION_SPIN)} />\n ) : null}\n {confirmLabel}\n </AlertDialogAction>\n )}\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n );\n}\n","/**\n * Skeleton — the \"content is coming\" placeholder.\n *\n * Ported from matrx-frontend `components/ui/skeleton.tsx`; no seams, pure\n * markup over semantic tokens. ONE change from the original (0.10.0): the\n * breathing loop is `.matrx-pulse`, a package-owned keyframe, not Tailwind's\n * `animate-pulse`. A Skeleton that does not pulse is indistinguishable from an\n * empty grey box — it stops saying \"loading\" and starts saying \"nothing here\"\n * — so the motion is part of the component's meaning and ships with it (see\n * `styles.css` § THE MOTION LAYER).\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { MOTION_PULSE } from \"./motion\";\n\nexport interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Package-owned pulse. Default `true`. Pass `false` for a static\n * placeholder — a print/PDF render, or a screenshot fixture where the\n * animation makes the output non-deterministic. `prefers-reduced-motion`\n * already SLOWS the pulse rather than stopping it (a still skeleton would\n * lose the information), so this is not the accessibility switch.\n */\n animated?: boolean;\n}\n\nexport function Skeleton({ className, animated = true, ...props }: SkeletonProps) {\n return (\n <div\n data-slot=\"skeleton\"\n className={cn(\n \"rounded-md bg-primary/10\",\n animated && MOTION_PULSE,\n className,\n )}\n {...props}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,gBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACmBA,uBAAkC;AAClC,IAAAC,qBAAgC;AAChC,IAAAC,SAAuB;;;ACnBvB,wBAAqB;AACrB,sCAAuC;AACvC,YAAuB;;;ACJvB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAA8B;AAClD,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;AD0IM;AAvIC,IAAM,qBAAiB;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,MAQ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rD;AAAA,UACC,OAAO,8CAAC,SAAI,WAAU,4BAA4B,gBAAK,IAAS;AAAA,WACnE;AAAA,QACC,QAAQ,8CAAC,SAAI,WAAU,6BAA6B,iBAAM,IAAS;AAAA,QACnE,SACC,8CAAC,cAAW,QAAM,MAAC,WAAU,8BAC1B,kBACH,IACE;AAAA;AAAA;AAAA,EACN;AAEJ;","names":["Button","import_react_slot","React","React","import_jsx_runtime","React","import_jsx_runtime","React","import_jsx_runtime","React","import_jsx_runtime","import_class_variance_authority","React","import_jsx_runtime","import_jsx_runtime","Button","React","React","import_react_slot","React","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","Button"]}
1
+ {"version":3,"sources":["../src/controls/index.ts","../src/controls/controls.tsx","../src/button.tsx","../src/cn.ts","../src/dropdown-menu.tsx","../src/motion.ts","../src/icons.tsx","../src/portal-container.tsx","../src/menu-scroll-edges.tsx","../src/use-scroll-fade.ts","../src/submenu-focus.ts","../src/select.tsx","../src/field-surface.ts","../src/controls/surfaces.tsx","../src/alert-dialog.tsx","../src/floating-layer.tsx","../src/confirm-dialog.tsx","../src/skeleton.tsx"],"sourcesContent":["/**\n * `@ai-matrx/design-system/controls` — THE controls (owner-settled one-control\n * system). Read FEATURE.md § THE ONE CONTROL. Styles ship in `styles.css`\n * (`controls.css`, locked in `@layer matrx-tap-lock`).\n */\nexport {\n Badge,\n Button,\n ControlRow,\n ControlScope,\n Field,\n SearchField,\n SegmentedControl,\n Select,\n SplitButton,\n Switch,\n Tabs,\n Textarea,\n} from \"./controls\";\nexport type {\n BadgeProps,\n BadgeTone,\n ButtonProps,\n ControlRowProps,\n ControlVariant,\n FieldProps,\n SegmentedControlProps,\n SegmentOption,\n SelectOption,\n SelectProps,\n SwitchProps,\n TabsProps,\n} from \"./controls\";\nexport {\n ConfirmDelete,\n DangerZone,\n DeleteButton,\n EmptyState,\n PromoBanner,\n RegionSkeleton,\n RowGroup,\n SettingRow,\n} from \"./surfaces\";\nexport type {\n ConfirmDeleteProps,\n DeleteButtonProps,\n EmptyStateProps,\n PromoBannerProps,\n PromoTone,\n RegionSkeletonProps,\n RowGroupProps,\n SettingRowProps,\n} from \"./surfaces\";\n","\"use client\";\n\n/**\n * THE ONE CONTROL — the settled control family (owner, 2026-10-02/03).\n *\n * Every control here is the same object: 28px visible height, capsule, 13px/500\n * label, 16px glyph inset 6px, text inset 10px, and HALF A GAP (3px) of its own\n * on each side so containers add no gap. There is NO size prop: agents get no\n * choice. Geometry and colour live in `controls.css`, locked inside\n * `@layer matrx-tap-lock` (`!important` in the host's first layer), so a call\n * site's `className` can place a control (width, flex, grid, position) but can\n * never restyle it. The rare big control is a different component behind a\n * `// ui-exception:` comment, never a prop.\n *\n * Built on the package's own internals — Radix Slot / Switch / DropdownMenu, the\n * cursor law's `swallowClick`, `SelectChevron`, the package icons — so nothing\n * here is a second implementation of a behaviour the package already owns.\n */\n\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\";\nimport { Slot, Slottable } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\n\nimport { swallowClick } from \"../button\";\nimport { cn } from \"../cn\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuTrigger,\n} from \"../dropdown-menu\";\nimport { MagnifyingGlassIcon } from \"../icons\";\nimport { SelectChevron } from \"../select\";\n\n/* ------------------------------------------------------------------ */\n/* Layout: the row and the scope */\n/* ------------------------------------------------------------------ */\n\nexport interface ControlRowProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Keep the controls on one line (a row's trailing actions). */\n nowrap?: boolean;\n}\n\n/** A row of controls. It adds no gap: each control carries its own half-gap. */\nexport const ControlRow = React.forwardRef<HTMLDivElement, ControlRowProps>(\n ({ className, nowrap, ...props }, ref) => (\n <div\n ref={ref}\n data-matrx-control-row=\"\"\n data-nowrap={nowrap ? \"\" : undefined}\n className={cn(\"matrx-control-row\", className)}\n {...props}\n />\n ),\n);\nControlRow.displayName = \"ControlRow\";\n\n/**\n * Until the tap tokens move to 28/34 app-wide (the rollout), a tap button\n * inside a ControlScope matches the controls beside it: a 28px pill in a 34px\n * box. Wrap a page (or a region) that mixes tap buttons and controls.\n */\nexport const ControlScope = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n (props, ref) => <div ref={ref} data-matrx-controls=\"\" {...props} />,\n);\nControlScope.displayName = \"ControlScope\";\n\n/* ------------------------------------------------------------------ */\n/* Button */\n/* ------------------------------------------------------------------ */\n\nexport type ControlVariant = \"primary\" | \"quiet\" | \"outline\" | \"danger\";\n\ninterface ButtonBase extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"children\"> {\n /** Tone, never size. Default `outline`. */\n variant?: ControlVariant;\n /** Leading 16px glyph. */\n icon?: React.ReactNode;\n /** Trailing 16px glyph (a menu chevron, an external-link mark). */\n iconEnd?: React.ReactNode;\n /** Render the one child element (a link) with the button's skin. */\n asChild?: boolean;\n}\ninterface LabelledButton extends ButtonBase {\n children: React.ReactNode;\n}\ninterface IconOnlyButton extends ButtonBase {\n children?: undefined;\n /** An icon-only button must say what it does. */\n \"aria-label\": string;\n}\nexport type ButtonProps = LabelledButton | IconOnlyButton;\n\nfunction glyphSlot(icon: unknown, iconEnd: unknown, label: unknown): string | undefined {\n if (!label && (icon || iconEnd)) return \"only\";\n if (icon && iconEnd) return \"both\";\n if (icon) return \"start\";\n if (iconEnd) return \"end\";\n return undefined;\n}\n\n/**\n * THE button: primary / quiet / outline / danger, one 28px geometry; text,\n * icon + text, or icon-only (a 28px circle). `asChild` puts the skin on a link.\n */\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant = \"outline\", icon, iconEnd, asChild = false, children, onClick, type, ...props }, ref) => {\n const Component = asChild ? Slot : \"button\";\n const ariaDisabled = props[\"aria-disabled\"];\n const disabledChild = asChild && Boolean(props.disabled);\n const inert = disabledChild || ariaDisabled === true || ariaDisabled === \"true\";\n // asChild: the child element carries the label, so the glyph slot reads\n // the child's own children.\n const label = asChild && React.isValidElement<{ children?: React.ReactNode }>(children)\n ? children.props.children\n : children;\n return (\n <Component\n ref={ref}\n type={asChild ? undefined : (type ?? \"button\")}\n data-matrx-control=\"button\"\n data-variant={variant}\n data-glyph={glyphSlot(icon, iconEnd, label)}\n className={cn(\"matrx-control matrx-control-button matrx-glyph-trim\", className)}\n {...props}\n aria-disabled={disabledChild ? true : ariaDisabled}\n tabIndex={disabledChild ? -1 : props.tabIndex}\n onClick={inert ? swallowClick : onClick}\n >\n {icon}\n <Slottable>{children}</Slottable>\n {iconEnd}\n </Component>\n );\n },\n);\nButton.displayName = \"Button\";\n\n/** A split button: two Buttons joined — the act, and its menu of variants. */\nexport const SplitButton = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} role=\"group\" data-matrx-control=\"split\" className={cn(\"matrx-control-split\", className)} {...props} />\n ),\n);\nSplitButton.displayName = \"SplitButton\";\n\n/* ------------------------------------------------------------------ */\n/* Field (input capsule) and SearchField */\n/* ------------------------------------------------------------------ */\n\nexport interface FieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, \"size\"> {\n /** Leading 16px glyph. */\n icon?: React.ReactNode;\n /** Trailing content inside the capsule — a clear button, a unit. */\n end?: React.ReactNode;\n}\n\n/** The input capsule. `className`/`style` place the capsule (width, flex). */\nexport const Field = React.forwardRef<HTMLInputElement, FieldProps>(\n ({ className, style, icon, end, ...props }, ref) => (\n <label\n data-matrx-control=\"field\"\n data-glyph={icon ? \"start\" : undefined}\n className={cn(\"matrx-control matrx-control-field\", className)}\n style={style}\n >\n {icon}\n <input ref={ref} {...props} />\n {end}\n </label>\n ),\n);\nField.displayName = \"Field\";\n\n/** The search capsule: a Field with the magnifier, `type=\"search\"`. */\nexport const SearchField = React.forwardRef<HTMLInputElement, Omit<FieldProps, \"icon\">>(\n ({ placeholder = \"Search\", ...props }, ref) => (\n <Field\n ref={ref}\n type=\"search\"\n icon={<MagnifyingGlassIcon aria-hidden=\"true\" />}\n placeholder={placeholder}\n aria-label={props[\"aria-label\"] ?? placeholder}\n {...props}\n />\n ),\n);\nSearchField.displayName = \"SearchField\";\n\n/* ------------------------------------------------------------------ */\n/* Select — a capsule trigger over a radio menu */\n/* ------------------------------------------------------------------ */\n\nexport interface SelectOption<T extends string = string> {\n value: T;\n label: string;\n /** 11px trailing text in the menu (a count, a shortcut). */\n meta?: string;\n}\n\nexport interface SelectProps<T extends string = string> {\n value: T;\n options: readonly SelectOption<T>[];\n onValueChange: (value: T) => void;\n \"aria-label\": string;\n /** Leading 16px glyph on the trigger. */\n icon?: React.ReactNode;\n align?: \"start\" | \"end\";\n disabled?: boolean;\n /** Placement only (width, flex). */\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport function Select<T extends string = string>({\n value,\n options,\n onValueChange,\n icon,\n align = \"start\",\n disabled,\n className,\n style,\n \"aria-label\": ariaLabel,\n}: SelectProps<T>) {\n const current = options.find((o) => o.value === value);\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild disabled={disabled}>\n <button\n type=\"button\"\n data-matrx-control=\"select\"\n data-glyph={icon ? \"start\" : undefined}\n className={cn(\"matrx-control matrx-control-select\", className)}\n style={style}\n aria-label={ariaLabel}\n >\n <span className=\"matrx-control-select-value\">\n {icon}\n <span>{current?.label ?? value}</span>\n </span>\n <SelectChevron />\n </button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align={align} className=\"max-h-80 min-w-[10rem] overflow-y-auto\">\n <DropdownMenuRadioGroup value={value} onValueChange={(v) => onValueChange(v as T)}>\n {options.map((o) => (\n <DropdownMenuRadioItem key={o.value} value={o.value} className=\"text-[0.8125rem]\">\n <span className=\"flex-1 truncate\">{o.label}</span>\n {o.meta ? <span className=\"ml-3 text-[0.6875rem] text-muted-foreground\">{o.meta}</span> : null}\n </DropdownMenuRadioItem>\n ))}\n </DropdownMenuRadioGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* SegmentedControl and Tabs */\n/* ------------------------------------------------------------------ */\n\nexport interface SegmentOption<T extends string = string> {\n value: T;\n label: React.ReactNode;\n /** An 11px count after the label. */\n count?: number | null;\n ariaLabel?: string;\n /** Hover text (an icon-only segment's name). */\n title?: string;\n disabled?: boolean;\n}\n\nexport interface SegmentedControlProps<T extends string = string> {\n value: T;\n onValueChange: (value: T) => void;\n data: readonly SegmentOption<T>[];\n \"aria-label\": string;\n /** Placement only. */\n className?: string;\n style?: React.CSSProperties;\n}\n\nfunction SegmentItems<T extends string>({\n data,\n value,\n onValueChange,\n role,\n}: {\n data: readonly SegmentOption<T>[];\n value: T;\n onValueChange: (value: T) => void;\n role: \"tab\" | undefined;\n}) {\n return (\n <>\n {data.map((o) => {\n const on = o.value === value;\n return (\n <button\n key={o.value}\n type=\"button\"\n role={role}\n aria-selected={role ? on : undefined}\n aria-pressed={role ? undefined : on}\n aria-label={o.ariaLabel}\n title={o.title}\n disabled={o.disabled}\n data-state={on ? \"on\" : \"off\"}\n className=\"matrx-control-segment\"\n onClick={() => onValueChange(o.value)}\n >\n {o.label}\n {o.count != null ? <span className=\"matrx-control-count\">{o.count}</span> : null}\n </button>\n );\n })}\n </>\n );\n}\n\n/** The capsule toggle group: a muted track, the selected thumb inset 2px. */\nexport function SegmentedControl<T extends string = string>({\n value,\n onValueChange,\n data,\n className,\n style,\n \"aria-label\": ariaLabel,\n}: SegmentedControlProps<T>) {\n return (\n <div\n role=\"group\"\n aria-label={ariaLabel}\n data-matrx-control=\"segmented\"\n className={cn(\"matrx-control matrx-control-segmented\", className)}\n style={style}\n >\n <SegmentItems data={data} value={value} onValueChange={onValueChange} role={undefined} />\n </div>\n );\n}\n\nexport interface TabsProps<T extends string = string> extends SegmentedControlProps<T> {\n /** `underline` for page sections (default); `capsule` for filters. */\n variant?: \"underline\" | \"capsule\";\n /** Underline tabs draw their own hairline (default). Pass `false` when the row the tabs\n * sit in already draws it — the selected underline then lands on that row's rule. */\n rule?: boolean;\n}\n\n/** Tabs: underline for page sections, capsule for filters. */\nexport function Tabs<T extends string = string>({\n variant = \"underline\",\n rule = true,\n value,\n onValueChange,\n data,\n className,\n style,\n \"aria-label\": ariaLabel,\n}: TabsProps<T>) {\n if (variant === \"capsule\") {\n return (\n <div\n role=\"tablist\"\n aria-label={ariaLabel}\n data-matrx-control=\"tabs\"\n className={cn(\"matrx-control matrx-control-segmented\", className)}\n style={style}\n >\n <SegmentItems data={data} value={value} onValueChange={onValueChange} role=\"tab\" />\n </div>\n );\n }\n return (\n <div\n role=\"tablist\"\n aria-label={ariaLabel}\n data-matrx-control=\"tabs\"\n data-rule={rule ? undefined : \"none\"}\n className={cn(\"matrx-control-tabs\", className)}\n style={style}\n >\n {data.map((o) => (\n <button\n key={o.value}\n type=\"button\"\n role=\"tab\"\n aria-selected={o.value === value}\n aria-label={o.ariaLabel}\n disabled={o.disabled}\n className=\"matrx-control-tab\"\n onClick={() => onValueChange(o.value)}\n >\n {o.label}\n {o.count != null ? <span className=\"matrx-control-count\">{o.count}</span> : null}\n </button>\n ))}\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Badge */\n/* ------------------------------------------------------------------ */\n\nexport type BadgeTone = \"neutral\" | \"primary\" | \"success\" | \"warning\" | \"destructive\" | \"info\";\n\nexport interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** A status tint from the role tokens. Default `neutral` (plain outline). */\n tone?: BadgeTone;\n}\n\n/** Outline, 18px, 11px text, clamped to one line (≤20rem) — never a sentence. */\nexport function Badge({ tone = \"neutral\", className, children, ...props }: BadgeProps) {\n return (\n <span\n data-matrx-control=\"badge\"\n data-tone={tone}\n className={cn(\"matrx-control-badge\", className)}\n title={typeof children === \"string\" ? children : undefined}\n {...props}\n >\n <span>{children}</span>\n </span>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Switch and Textarea */\n/* ------------------------------------------------------------------ */\n\nexport type SwitchProps = Omit<React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>, \"children\">;\n\n/** A 20px track in the 28px control box, so it lines up with every control. */\nexport const Switch = React.forwardRef<React.ComponentRef<typeof SwitchPrimitives.Root>, SwitchProps>(\n ({ className, ...props }, ref) => (\n <SwitchPrimitives.Root\n ref={ref}\n data-matrx-control=\"switch\"\n className={cn(\"matrx-control matrx-control-switch\", className)}\n {...props}\n >\n <span className=\"matrx-control-switch-track\">\n <SwitchPrimitives.Thumb className=\"matrx-control-switch-thumb\" />\n </span>\n </SwitchPrimitives.Root>\n ),\n);\nSwitch.displayName = \"Switch\";\n\n/** The field skin, multi-line (8px radius — a capsule cannot hold paragraphs). */\nexport const Textarea = React.forwardRef<HTMLTextAreaElement, React.TextareaHTMLAttributes<HTMLTextAreaElement>>(\n ({ className, ...props }, ref) => (\n <textarea ref={ref} data-matrx-control=\"textarea\" className={cn(\"matrx-control-textarea\", className)} {...props} />\n ),\n);\nTextarea.displayName = \"Textarea\";\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 \"matrx-glyph-trim 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 */\nexport function 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 * DropdownMenu — Radix dropdown with two behaviours the stock body lacks.\n *\n * 1. THE ROOT RENDERS UNCONDITIONALLY — no hydration mount gate. A wrapper in\n * matrx-frontend once deferred rendering until after hydration on a false\n * premise (Radix ids come from React's SSR-stable `useId`), which deleted\n * the always-visible trigger — buttons, `…` menus — from SSR and the first\n * client paint.\n *\n * 2. A LONG MENU SCROLLS INSTEAD OF GROWING OFF-SCREEN. Content and SubContent\n * cap at `--radix-dropdown-menu-content-available-height` — the space Radix\n * actually measured between the trigger and the viewport edge — and scroll\n * past it. Without the cap a menu longer than the viewport puts its last\n * items where no pointer can reach them, and on a short window that can be\n * the only exit from the surface.\n *\n * Portalling goes through the package's `usePortalContainer` seam, so a menu\n * opened inside a Dialog mounts INSIDE the dialog (staying in the scroll\n * shard, where its wheel events work) instead of at `document.body`. An\n * explicit `container` prop still wins.\n *\n * Icons are the package's inlined SVGs (C19) — no icon-library dependency.\n */\n\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { MOTION_POPPER } from \"./motion\";\nimport { CheckIcon, DotFilledIcon, RadixChevronRightIcon } from \"./icons\";\nimport { usePortalContainer } from \"./portal-container\";\nimport { useMenuScrollEdges } from \"./menu-scroll-edges\";\nimport { useSubmenuSurvivesParentPanelFocus } from \"./submenu-focus\";\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst MENU_SURFACE_CLASS =\n \"z-[10001] min-w-[8rem] max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto overflow-x-hidden overscroll-contain rounded-md border bg-popover p-1 text-popover-foreground\";\n\n\n// gap-2: an item's icon never touches its label (page-pass 2026-09-27, admin pass — every menu).\nconst MENU_ITEM_CLASS =\n \"relative flex select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:opacity-50\";\n\nconst MENU_INDICATOR_ITEM_CLASS =\n \"relative flex select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:opacity-50\";\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n data-slot=\"dropdown-menu-sub-trigger\"\n className={cn(\n \"flex select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <RadixChevronRightIcon className=\"ml-auto h-4 w-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\n/**\n * A SUBMENU OPENS BESIDE ITS PARENT, NEVER ON TOP OF IT (merged-grid review 2, C1: \"nested\n * submenus overlap the parent menu\"). The submenu was drawn INSIDE the parent's surface, and that\n * surface's entry animation leaves a `transform` on it — which makes the parent the containing\n * block of the submenu's `position: fixed`. Radix measured the submenu's place in viewport\n * coordinates and the browser applied them from the parent's corner, so it landed over the parent\n * (and was clipped by the parent's scroll box). Portalled like every other surface, through the\n * same container seam, it sits beside its trigger as Radix placed it.\n */\nconst DropdownMenuSubContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent> & { container?: HTMLElement | null }\n>(({ className, container, sideOffset = 2, alignOffset = -4, collisionPadding = 8, onFocusOutside, children, ...props }, ref) => {\n const portalContainer = usePortalContainer(container);\n // A flipped submenu survives the pointer leaving its trigger (see submenu-focus.ts).\n const keep = useSubmenuSurvivesParentPanelFocus(ref, onFocusOutside);\n const edges = useMenuScrollEdges(keep.ref);\n return (\n <DropdownMenuPrimitive.Portal container={portalContainer}>\n <DropdownMenuPrimitive.SubContent\n ref={edges.ref}\n onFocusOutside={keep.onFocusOutside}\n data-slot=\"dropdown-menu-sub-content\"\n sideOffset={sideOffset}\n alignOffset={alignOffset}\n collisionPadding={collisionPadding}\n className={cn(MENU_SURFACE_CLASS, edges.surfaceClassName, \"shadow-lg\", MOTION_POPPER, className)}\n {...props}\n >\n {edges.wrap(children)}\n </DropdownMenuPrimitive.SubContent>\n </DropdownMenuPrimitive.Portal>\n );\n});\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\nexport interface DropdownMenuContentProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content> {\n /** Explicit portal target; wins over the injected container. */\n container?: HTMLElement | null;\n}\n\nconst DropdownMenuContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Content>,\n DropdownMenuContentProps\n>(({ className, sideOffset = 4, container, children, ...props }, ref) => {\n const portalContainer = usePortalContainer(container);\n const edges = useMenuScrollEdges(ref);\n return (\n <DropdownMenuPrimitive.Portal container={portalContainer}>\n <DropdownMenuPrimitive.Content\n ref={edges.ref}\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n MENU_SURFACE_CLASS,\n edges.surfaceClassName,\n \"shadow-md\",\n MOTION_POPPER,\n className,\n )}\n {...props}\n >\n {edges.wrap(children)}\n </DropdownMenuPrimitive.Content>\n </DropdownMenuPrimitive.Portal>\n );\n});\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n data-slot=\"dropdown-menu-item\"\n className={cn(MENU_ITEM_CLASS, inset && \"pl-8\", className)}\n {...props}\n />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(MENU_INDICATOR_ITEM_CLASS, className)}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(MENU_INDICATOR_ITEM_CLASS, className)}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <DotFilledIcon className=\"h-4 w-4 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n data-slot=\"dropdown-menu-label\"\n className={cn(\"px-2 py-1.5 text-sm font-semibold\", inset && \"pl-8\", className)}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\"ml-auto text-xs tracking-widest opacity-60\", className)}\n {...props}\n />\n);\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\";\n\nexport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n};\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","/**\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 `trash-2` — delete tier 1, the quiet trash glyph (controls `DeleteButton`). */\nexport function Trash2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(props)}>\n <path d=\"M3 6h18\" />\n <path d=\"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6\" />\n <path d=\"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2\" />\n <line x1=\"10\" x2=\"10\" y1=\"11\" y2=\"17\" />\n <line x1=\"14\" x2=\"14\" y1=\"11\" y2=\"17\" />\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","\"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","\"use client\";\n\n/**\n * A MENU THAT HIDES ITEMS SAYS SO (Arman, 2026-10-02: \"A menu that hides\n * options needs to use best in class UI to show there is more\").\n *\n * Every menu surface already caps at Radix's measured available height and\n * scrolls. What it lacked was any sign that it scrolls: the note editor's\n * right-click menu in Split mode hid Chat and AI Actions below the fold and a\n * reader concluded they did not exist. Champion: macOS menus (an arrow strip\n * at the hidden edge that scrolls while hovered) plus the Linear/Radix edge\n * fade.\n *\n * Each edge that actually hides items gets a soft fade and a chevron strip;\n * an edge that is scrolled to its end gets neither, and a menu that fits gets\n * nothing at all. Measurement is `useScrollFade` (the package's one \"is there\n * more\" meter) — but drawn as OVERLAY elements, not its `mask-image` class:\n * a mask clips everything outside the border box, which would erase the\n * menu's own shadow.\n *\n * The overlays are zero-height `position: sticky` rows inside the surface, so\n * the surface stays the scroller: Radix's keyboard focus still scrolls the\n * focused item into view natively, and `scroll-padding-block` (styles.css)\n * keeps it clear of the fade. Pointer hover on a chevron glides toward the\n * hidden items; a press (touch included) moves one page.\n */\n\nimport * as React from \"react\";\n\nimport { RadixChevronDownIcon, RadixChevronUpIcon } from \"./icons\";\nimport { useScrollFade } from \"./use-scroll-fade\";\n\n/** px per millisecond while a chevron is hovered (~ macOS menu arrow speed). */\nconst HOVER_SPEED = 0.6;\n/** A press keeps this much of the previous page in view, so the reader keeps their place. */\nconst PAGE_OVERLAP = 48;\n\ntype Side = \"top\" | \"bottom\";\n\nfunction composeRefs<T>(...refs: Array<React.Ref<T> | undefined>) {\n return (node: T | null) => {\n for (const ref of refs) {\n if (typeof ref === \"function\") ref(node);\n else if (ref) (ref as React.MutableRefObject<T | null>).current = node;\n }\n };\n}\n\nfunction MenuScrollEdge({ side, scroller }: { side: Side; scroller: React.RefObject<HTMLElement | null> }) {\n const frame = React.useRef<number | null>(null);\n const dir = side === \"top\" ? -1 : 1;\n\n const stop = React.useCallback(() => {\n if (frame.current !== null) cancelAnimationFrame(frame.current);\n frame.current = null;\n }, []);\n\n const glide = React.useCallback(() => {\n stop();\n let last = performance.now();\n const step = (now: number) => {\n const el = scroller.current;\n if (!el) return stop();\n el.scrollTop += dir * HOVER_SPEED * (now - last);\n last = now;\n frame.current = requestAnimationFrame(step);\n };\n frame.current = requestAnimationFrame(step);\n }, [dir, scroller, stop]);\n\n // The edge unmounts the moment its end is reached; the glide stops with it.\n React.useEffect(() => stop, [stop]);\n\n return (\n <div aria-hidden data-menu-scroll-edge={side} className=\"matrx-menu-scroll-edge\">\n <div className=\"matrx-menu-scroll-fade\">\n <div\n data-menu-scroll-button=\"\"\n className=\"matrx-menu-scroll-button\"\n onPointerEnter={(e) => {\n if (e.pointerType !== \"touch\") glide();\n }}\n onPointerLeave={stop}\n onPointerDown={(e) => {\n // Never steal focus from the item the keyboard is on.\n e.preventDefault();\n const el = scroller.current;\n if (!el) return;\n el.scrollTop += dir * Math.max(el.clientHeight - PAGE_OVERLAP, PAGE_OVERLAP);\n }}\n >\n {side === \"top\" ? <RadixChevronUpIcon /> : <RadixChevronDownIcon />}\n </div>\n </div>\n </div>\n );\n}\n\n/**\n * Wire a menu surface: spread `ref` onto the Radix Content/SubContent and wrap\n * its children with `wrap`. Forwarded refs are composed, never replaced.\n */\nexport function useMenuScrollEdges<T extends HTMLElement>(...forwarded: Array<React.Ref<T> | undefined>) {\n const fade = useScrollFade();\n const scroller = React.useRef<HTMLElement | null>(null);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const ref = React.useCallback(composeRefs<T>(scroller as React.Ref<T>, fade.ref as React.Ref<T>, ...forwarded), [\n fade.ref,\n ...forwarded,\n ]);\n const wrap = (children: React.ReactNode) => (\n <>\n {fade.state.top ? <MenuScrollEdge side=\"top\" scroller={scroller} /> : null}\n {children}\n {fade.state.bottom ? <MenuScrollEdge side=\"bottom\" scroller={scroller} /> : null}\n </>\n );\n return { ref, wrap, surfaceClassName: \"matrx-menu-surface\" };\n}\n","\"use client\";\n\n// useScrollFade — ported verbatim from matrx-frontend\n// `components/official/scroll-fade/useScrollFade.ts` (S21).\n//\n// \"There is more below\" — told to the eye, not to nobody.\n//\n// A scroll container that simply hard-clips its last row reads as FINISHED.\n// The user never scrolls, because nothing suggested there was anything to\n// scroll to. A soft fade at the overflowing edge is the standard cue, and it\n// must appear ONLY on the edges that actually overflow — a permanent fade on a\n// non-scrolling list just makes the last item look broken.\n//\n// Attach `ref` to the scrolling element and spread `fadeProps`. Styling is\n// host-owned CSS (the `.matrx-scroll-fade` class in the host's globals.css),\n// keyed off the data attributes.\n//\n// The ref is a CALLBACK ref, not a useRef object, on purpose: these containers\n// are usually mounted conditionally (a popover body, a lazily-resolved menu),\n// so an effect that reads `ref.current` on mount finds null and — with no\n// dependency that ever changes — never runs again. The fade then silently\n// never appears, which is exactly the failure this hook exists to prevent.\n//\n// TWO RULES THE CALLBACK MUST OBEY (both learned the hard way — breaking\n// either one produced \"Maximum update depth exceeded\" on a page of 13 menus):\n// 1. NEVER setState synchronously inside the callback. Radix composes our\n// ref with its own via useComposedRefs, whose identity changes every render,\n// so the ref detaches+reattaches on every commit. A synchronous setState\n// there re-renders, which re-attaches, which sets state again — forever.\n// Measurement is always deferred to rAF.\n// 2. NEVER setState on detach (node === null). A detach/attach pair would\n// otherwise flip the fade off and on and drive the same loop.\n\nimport { useCallback, useEffect, useRef, useState } from \"react\";\n\nexport interface ScrollFadeState {\n top: boolean;\n bottom: boolean;\n}\n\nexport interface UseScrollFadeResult {\n ref: (node: HTMLElement | null) => void;\n fadeProps: {\n \"data-fade-top\": \"\" | undefined;\n \"data-fade-bottom\": \"\" | undefined;\n className: string;\n };\n state: ScrollFadeState;\n}\n\n/** Slack below which we treat the edge as reached (sub-pixel scroll math). */\nconst EPSILON = 2;\n\nexport function useScrollFade(): UseScrollFadeResult {\n const [state, setState] = useState<ScrollFadeState>({\n top: false,\n bottom: false,\n });\n const nodeRef = useRef<HTMLElement | null>(null);\n const cleanupRef = useRef<(() => void) | null>(null);\n\n const measure = useCallback(() => {\n const el = nodeRef.current;\n if (!el) return;\n const overflowing = el.scrollHeight - el.clientHeight > EPSILON;\n const next: ScrollFadeState = {\n top: overflowing && el.scrollTop > EPSILON,\n bottom:\n overflowing &&\n el.scrollTop + el.clientHeight < el.scrollHeight - EPSILON,\n };\n setState((prev) =>\n prev.top === next.top && prev.bottom === next.bottom ? prev : next,\n );\n }, []);\n\n const ref = useCallback(\n (node: HTMLElement | null) => {\n cleanupRef.current?.();\n cleanupRef.current = null;\n nodeRef.current = node;\n // Rule 2: no state change on detach.\n if (!node) return;\n\n node.addEventListener(\"scroll\", measure, { passive: true });\n // Content can arrive after mount (lazy menu configs, async lists) and the\n // box can be resized by the viewport, so watch both.\n // Every menu surface now carries this hook, so it must also run where\n // ResizeObserver does not exist (jsdom suites in every consumer); scroll\n // and mutation still measure there.\n const ro = typeof ResizeObserver === \"undefined\" ? null : new ResizeObserver(measure);\n ro?.observe(node);\n const mo = new MutationObserver(measure);\n mo.observe(node, { childList: true, subtree: true });\n\n cleanupRef.current = () => {\n node.removeEventListener(\"scroll\", measure);\n ro?.disconnect();\n mo.disconnect();\n };\n\n // Rule 1: deferred, never synchronous. Radix also animates the panel in,\n // so its final height is not known on the frame it mounts anyway.\n requestAnimationFrame(measure);\n },\n [measure],\n );\n\n useEffect(() => () => cleanupRef.current?.(), []);\n\n return {\n ref,\n state,\n fadeProps: {\n \"data-fade-top\": state.top ? \"\" : undefined,\n \"data-fade-bottom\": state.bottom ? \"\" : undefined,\n className: \"matrx-scroll-fade\",\n },\n };\n}\n","import * as React from \"react\";\n\n/**\n * A SUBMENU NEVER CLOSES BECAUSE ITS PARENT PANEL TOOK FOCUS (blind run PB-04, /notes,\n * 2026-10-02: at a 1024 px viewport AI Actions ▸ Text Operations ▸ Text Tools closed the whole\n * menu; works at 1600 px).\n *\n * Radix keeps a submenu open while the pointer leaves its trigger only when the pointer's last\n * horizontal move inside the parent panel points at the side the submenu is drawn on. A narrow\n * viewport FLIPS the submenu to the left; a pointer that last moved right (or jumped) and heads\n * for it is \"not moving to the submenu\", so Radix focuses the parent PANEL itself, the submenu\n * reads that as focus outside and closes under the pointer, and the click meant for it lands on\n * the page and closes the whole menu. Focus on the parent panel (role=\"menu\", the panel holding\n * this submenu's trigger) only means \"the pointer left a row without entering another one\" — it\n * never closes a submenu, on either side. Focus on another ROW still closes it, as before.\n *\n * Returns the composed ref and the `onFocusOutside` handler a SubContent wrapper spreads.\n */\nexport function useSubmenuSurvivesParentPanelFocus<T extends HTMLElement, E extends Event>(\n forwardedRef: React.ForwardedRef<T>,\n onFocusOutside: ((event: E) => void) | undefined,\n): { ref: (node: T | null) => void; onFocusOutside: (event: E) => void } {\n const content = React.useRef<T | null>(null);\n const ref = React.useCallback(\n (node: T | null) => {\n content.current = node;\n if (typeof forwardedRef === \"function\") forwardedRef(node);\n else if (forwardedRef) forwardedRef.current = node;\n },\n [forwardedRef],\n );\n const handle = (event: E) => {\n onFocusOutside?.(event);\n if (event.defaultPrevented) return;\n const to = event.target;\n const id = content.current?.id;\n if (!(to instanceof Element) || !id || to.getAttribute(\"role\") !== \"menu\") return;\n const holdsTrigger = Array.from(to.querySelectorAll(\"[aria-controls]\")).some((el) => el.getAttribute(\"aria-controls\") === id);\n if (holdsTrigger) event.preventDefault();\n };\n return { ref, onFocusOutside: handle };\n}\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 * 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\";\n\n/**\n * The settled surfaces that hold the one control (owner, 2026-10-02/03):\n * one surface level, ~36px hairline rows, 8px radius; the empty state; the\n * region-shaped skeleton; the three delete tiers; the one-feature promo banner.\n * Skins are locked in `controls.css` like the controls themselves.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { ConfirmDialog } from \"../confirm-dialog\";\nimport { Trash2Icon } from \"../icons\";\nimport { Skeleton } from \"../skeleton\";\nimport { Button, ControlRow } from \"./controls\";\n\n/* ------------------------------------------------------------------ */\n/* Row groups */\n/* ------------------------------------------------------------------ */\n\nexport interface RowGroupProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n /** 11px uppercase heading above the group. */\n title?: React.ReactNode;\n /** The danger-zone skin (delete tier 3). */\n danger?: boolean;\n}\n\n/** A bordered group of hairline rows — the one surface for grouped content. */\nexport function RowGroup({ title, danger, className, children, ...props }: RowGroupProps) {\n return (\n <section\n data-matrx-row-group=\"\"\n data-danger={danger ? \"\" : undefined}\n className={cn(\"matrx-control-group\", className)}\n {...props}\n >\n {title ? <h2 className=\"matrx-control-group-title\">{title}</h2> : null}\n <div className=\"matrx-control-group-body\">{children}</div>\n </section>\n );\n}\n\nexport interface SettingRowProps {\n label: React.ReactNode;\n /** One 12px line under the label. */\n line?: React.ReactNode;\n /** Ties the label to the control it describes. */\n htmlFor?: string;\n /** The row's controls, right-aligned on one line. */\n children?: React.ReactNode;\n className?: string;\n}\n\n/** One ~36px row: 13px label, optional 12px line, controls on the right. */\nexport function SettingRow({ label, line, htmlFor, children, className }: SettingRowProps) {\n return (\n <div data-matrx-setting-row=\"\" className={cn(\"matrx-control-setting-row\", className)}>\n <div className=\"matrx-control-setting-text\">\n {htmlFor ? (\n <label htmlFor={htmlFor} className=\"matrx-control-setting-label\">\n {label}\n </label>\n ) : (\n <div className=\"matrx-control-setting-label\">{label}</div>\n )}\n {line ? <div className=\"matrx-control-setting-line\">{line}</div> : null}\n </div>\n {children ? (\n <ControlRow nowrap data-matrx-row-actions=\"\">\n {children}\n </ControlRow>\n ) : null}\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Empty state */\n/* ------------------------------------------------------------------ */\n\nexport interface EmptyStateProps {\n /** A 20px glyph inside the tinted disc. */\n icon: React.ReactNode;\n /** 13px title. */\n title: React.ReactNode;\n /** One 12px line. */\n line?: React.ReactNode;\n /** The one 28px action (a controls `Button`). */\n action?: React.ReactNode;\n className?: string;\n}\n\n/** Tinted icon disc + 13px title + one line + one 28px button. */\nexport function EmptyState({ icon, title, line, action, className }: EmptyStateProps) {\n return (\n <div data-matrx-empty-state=\"\" className={cn(\"matrx-control-empty\", className)}>\n <div className=\"matrx-control-empty-disc\" aria-hidden=\"true\">\n {icon}\n </div>\n <div>\n <div className=\"matrx-control-empty-title\">{title}</div>\n {line ? <div className=\"matrx-control-empty-line\">{line}</div> : null}\n </div>\n {action ? <ControlRow className=\"justify-center\">{action}</ControlRow> : null}\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Region skeleton */\n/* ------------------------------------------------------------------ */\n\nexport interface RegionSkeletonProps {\n /** The region's shape: hairline rows, a form's label+field pairs, or cards. */\n shape?: \"rows\" | \"form\" | \"cards\";\n /** How many rows / fields / cards. */\n count?: number;\n /** Rows: a second (meta) line under each title. */\n twoLine?: boolean;\n className?: string;\n \"aria-label\"?: string;\n}\n\n/**\n * A skeleton shaped like the region it stands in for — never one block for a\n * page, never a spinner in the middle. A spinner belongs only inside a busy\n * control.\n */\nexport function RegionSkeleton({\n shape = \"rows\",\n count = shape === \"cards\" ? 3 : shape === \"form\" ? 4 : 8,\n twoLine = false,\n className,\n \"aria-label\": ariaLabel = \"Loading\",\n}: RegionSkeletonProps) {\n const items = Array.from({ length: count }, (_, i) => i);\n if (shape === \"form\") {\n return (\n <div aria-busy=\"true\" aria-label={ariaLabel} className={cn(\"flex flex-col gap-3\", className)}>\n {items.map((i) => (\n <div key={i} className=\"flex flex-col gap-1.5\">\n <Skeleton className=\"h-3 w-24\" />\n <Skeleton className=\"h-7 rounded-full\" />\n </div>\n ))}\n </div>\n );\n }\n if (shape === \"cards\") {\n return (\n <div aria-busy=\"true\" aria-label={ariaLabel} className={cn(\"grid gap-2 sm:grid-cols-3\", className)}>\n {items.map((i) => (\n <div key={i} className=\"flex items-center gap-3 rounded-lg border border-border p-3\">\n <Skeleton className=\"size-8 rounded-full\" />\n <div className=\"flex flex-1 flex-col gap-1.5\">\n <Skeleton className=\"h-3.5 w-2/3\" />\n <Skeleton className=\"h-2.5 w-1/2\" />\n </div>\n </div>\n ))}\n </div>\n );\n }\n return (\n <div aria-busy=\"true\" aria-label={ariaLabel} className={cn(\"divide-y divide-border\", className)}>\n {items.map((i) => (\n <div key={i} className=\"flex min-h-9 items-center gap-3 px-3 py-1.5\">\n <Skeleton className=\"size-4 rounded-full\" />\n <div className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <Skeleton className=\"h-3.5\" style={{ width: `${30 + ((i * 17) % 35)}%` }} />\n {twoLine ? <Skeleton className=\"h-2.5 w-1/4\" /> : null}\n </div>\n <Skeleton className=\"hidden h-[1.125rem] w-16 rounded-md sm:block\" />\n <Skeleton className=\"size-5 rounded-full\" />\n </div>\n ))}\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* The three delete tiers */\n/* ------------------------------------------------------------------ */\n\nexport interface DeleteButtonProps\n extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"children\" | \"aria-label\"> {\n /** What it deletes, e.g. \"Delete reference\". */\n \"aria-label\": string;\n}\n\n/** Tier 1 — the quiet trash glyph: muted until hover, destructive on hover. */\nexport const DeleteButton = React.forwardRef<HTMLButtonElement, DeleteButtonProps>((props, ref) => (\n <Button ref={ref} variant=\"quiet\" icon={<Trash2Icon />} data-delete=\"\" title={props[\"aria-label\"]} {...props} />\n));\nDeleteButton.displayName = \"DeleteButton\";\n\nexport interface ConfirmDeleteProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n /** \"Delete this project?\" */\n title: React.ReactNode;\n /** REQUIRED: name the cost — what is lost, what goes with it. Never \"Are you sure?\". */\n cost: React.ReactNode;\n /** The confirm button names the act, e.g. \"Delete project\". */\n confirmLabel: string;\n onConfirm: () => void | Promise<void>;\n busy?: boolean;\n}\n\n/** Tier 2 — a confirm that names the cost. */\nexport function ConfirmDelete({ open, onOpenChange, title, cost, confirmLabel, onConfirm, busy }: ConfirmDeleteProps) {\n return (\n <ConfirmDialog\n open={open}\n onOpenChange={onOpenChange}\n title={title}\n description={cost}\n confirmLabel={confirmLabel}\n variant=\"destructive\"\n busy={busy}\n onConfirm={onConfirm}\n />\n );\n}\n\n/** Tier 3 — the danger zone: a red-ruled group of rows at the end of settings. */\nexport function DangerZone({\n title = \"Danger zone\",\n children,\n className,\n}: {\n title?: React.ReactNode;\n children: React.ReactNode;\n className?: string;\n}) {\n return (\n <RowGroup title={title} danger className={className}>\n {children}\n </RowGroup>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Promo banner */\n/* ------------------------------------------------------------------ */\n\nexport type PromoTone = \"primary\" | \"success\" | \"warning\" | \"info\";\n\nexport interface PromoBannerProps {\n /** A 16px glyph inside the tinted disc. */\n icon: React.ReactNode;\n /** 11px label before the title, e.g. \"Next challenge\". Never a pill. */\n eyebrow?: React.ReactNode;\n /** One line, 13px. */\n title: React.ReactNode;\n /** One line, 12px, ≤60 characters. Omit rather than pad. */\n line?: React.ReactNode;\n /** Outline badges — the evidence behind the promo. */\n chips?: React.ReactNode;\n /** The one action: a controls `Button` (or a link wearing it). */\n action?: React.ReactNode;\n tone?: PromoTone;\n className?: string;\n /** Accessible name of the region. Defaults to \"Featured\". */\n \"aria-label\"?: string;\n}\n\n/**\n * A page-top variant that promotes ONE feature in one bordered row (~56px):\n * [disc] EYEBROW · Title / one line … [chips] [Action]. On a phone the chips\n * wrap under the text and the action stretches full width.\n */\nexport function PromoBanner({\n icon,\n eyebrow,\n title,\n line,\n chips,\n action,\n tone = \"primary\",\n className,\n \"aria-label\": ariaLabel,\n}: PromoBannerProps) {\n return (\n <section\n aria-label={ariaLabel ?? (typeof eyebrow === \"string\" ? eyebrow : \"Featured\")}\n data-matrx-promo=\"\"\n data-tone={tone}\n className={cn(\"matrx-control-promo\", className)}\n >\n <span className=\"matrx-control-promo-disc\" aria-hidden=\"true\">\n {icon}\n </span>\n <div className=\"matrx-control-promo-text\">\n <div className=\"matrx-control-promo-head\">\n {eyebrow ? <span className=\"matrx-control-promo-eyebrow\">{eyebrow}</span> : null}\n {eyebrow ? (\n <span className=\"matrx-control-promo-eyebrow\" aria-hidden=\"true\">\n ·\n </span>\n ) : null}\n <span className=\"matrx-control-promo-title\">{title}</span>\n </div>\n {line ? <div className=\"matrx-control-promo-line\">{line}</div> : null}\n </div>\n {chips ? <div className=\"matrx-control-promo-chips\">{chips}</div> : null}\n {action ? (\n <ControlRow nowrap className=\"matrx-control-promo-action\">\n {action}\n </ControlRow>\n ) : null}\n </section>\n );\n}\n","\"use client\";\n\n/**\n * AlertDialog — the confirm/destroy surface (78 host import sites).\n *\n * Ported from matrx-frontend `components/ui/alert-dialog.tsx`, which was the\n * only variant in the fleet that had been hardened. Its rulings, kept verbatim:\n *\n * 1. THE ROOT RENDERS UNCONDITIONALLY — no hydration mount gate. The gate a\n * wrapper once carried (\"Radix ids differ between SSR and client\") was\n * false, and it deleted always-visible Triggers (delete buttons, mostly)\n * from SSR and the first client paint.\n *\n * 2. AN UNDESCRIBED ALERT DIALOG STILL DESCRIBES ITSELF. A confirm dialog with\n * no `AlertDialogDescription` gets a screen-reader-only one rather than a\n * console warning — the surface where a blind user is about to destroy\n * something is the wrong place to ship an accessibility gap.\n *\n * ADDED HERE, from the same doctrine `Dialog` already carries and this\n * component demonstrably needed:\n *\n * 3. IT IS CLAMPED TO THE VIEWPORT AND SCROLLS INSIDE ITSELF\n * (`max-h-[85dvh] overflow-y-auto`). The host copy was NOT — an alert\n * dialog whose body listed what is about to be deleted pushed Cancel and\n * Continue below the fold on a short viewport, and the only way out was a\n * backdrop click. On an ALERT dialog Radix does not dismiss on backdrop\n * click, so the surface was a genuine dead end. Recorded in CHANGELOG as a\n * real defect fixed in the port, not \"preserved\".\n *\n * 4. THE ACTIONS ARE 44px TALL ON COARSE POINTERS. `AlertDialogAction` and\n * `AlertDialogCancel` inherit the package Button's own target rules through\n * `buttonVariants`; the footer keeps them safe-area padded on mobile.\n *\n * 5. THE STICKY FOOTER NEVER PAINTS OVER THE BODY (0.11.3). Ruling 3's footer\n * bled over the card's bottom padding with a negative block margin, and\n * `position: sticky` clamps a box to its containing block — so the footer\n * was dragged UP by `--dialog-pad` against the card's `gap-4`, covering the\n * last 8px of the consequence copy at every length, unreachable because the\n * card did not scroll. The bleed is now the card's RESERVATION\n * (`.matrx-dialog-card` hands its bottom padding to the footer), which\n * sticky has nothing to clamp. See `sticky-footer-geometry.test.tsx`.\n *\n * SEAM INVERSION. The host resolved its portal target through\n * `usePopoutContainer` (its window-panel popout body); here that is the\n * package's `PortalContainerProvider`, with an explicit `container` prop still\n * winning.\n */\n\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\";\nimport { treeContainsComponent } from \"@ai-matrx/kit/react-tree\";\nimport * as React from \"react\";\n\nimport { buttonVariants } from \"./button\";\nimport { cn } from \"./cn\";\nimport { useModalLayer } from \"./floating-layer\";\nimport { CENTERED_DIALOG, MOTION_DIALOG, MOTION_OVERLAY } from \"./motion\";\nimport { usePortalContainer } from \"./portal-container\";\n\nconst AlertDialog = AlertDialogPrimitive.Root;\n\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\n\n/**\n * Portal-seam-aware AlertDialogPortal. Explicit `container` wins; with none,\n * the injected container; with neither, Radix's `document.body`.\n */\nconst AlertDialogPortal = ({\n container,\n ...props\n}: Omit<\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Portal>,\n \"container\"\n> & {\n /** `undefined` → use the injected container; `null` → force document.body. */\n container?: HTMLElement | null | undefined;\n}) => {\n const resolved = usePortalContainer(container);\n return (\n <AlertDialogPrimitive.Portal container={resolved ?? null} {...props} />\n );\n};\nAlertDialogPortal.displayName = \"AlertDialogPortal\";\n\nconst AlertDialogOverlay = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Overlay\n ref={ref}\n data-slot=\"alert-dialog-overlay\"\n className={cn(\n \"fixed inset-0 z-[10000] bg-[var(--matrx-overlay-scrim)]\",\n MOTION_OVERLAY,\n className,\n )}\n {...props}\n />\n));\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;\n\n/**\n * Unstyled, non-portalling Content for custom layouts. AlertDialog is always\n * modal, so `aria-modal` is stated rather than derived.\n */\nconst AlertDialogContentPrimitive = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>\n>((props, ref) => {\n // Always blocking: floating layers opened from it stack above its scrim.\n useModalLayer(true);\n return <AlertDialogPrimitive.Content {...props} ref={ref} aria-modal=\"true\" />;\n});\nAlertDialogContentPrimitive.displayName = \"AlertDialogContentPrimitive\";\n\nconst AlertDialogDescription = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Description\n ref={ref}\n data-slot=\"alert-dialog-description\"\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nAlertDialogDescription.displayName =\n AlertDialogPrimitive.Description.displayName;\n\nexport interface AlertDialogContentProps\n extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.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\nconst AlertDialogContent = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Content>,\n AlertDialogContentProps\n>(({ className, children, container, animated = true, ...props }, ref) => {\n const hasDescription =\n treeContainsComponent(children, AlertDialogDescription) ||\n treeContainsComponent(children, AlertDialogPrimitive.Description);\n return (\n <AlertDialogPortal container={container}>\n <AlertDialogOverlay />\n <AlertDialogContentPrimitive\n ref={ref}\n data-slot=\"alert-dialog-content\"\n className={cn(\n `matrx-dialog-card fixed left-[50%] top-[50%] z-[10000] grid min-w-0 w-full max-w-lg ${CENTERED_DIALOG} gap-4 border bg-background p-6 shadow-lg`,\n // Ruling 3 — never taller than the viewport, always scrollable, and\n // the footer stays reachable via --dialog-pad like Dialog's.\n // Ruling 5 (0.11.3) — `matrx-dialog-card` hands the bottom padding to\n // a sticky footer when there is one, so the footer's box matches the\n // space the grid gave it and sticky never clamps it up over the\n // consequence copy.\n \"max-h-[85dvh] overflow-y-auto overscroll-contain [--dialog-pad:1.5rem] overflow-x-clip [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full\",\n \"sm:rounded-lg\",\n animated && MOTION_DIALOG,\n className,\n )}\n {...props}\n >\n {hasDescription ? null : (\n <AlertDialogPrimitive.Description className=\"sr-only\">\n Please confirm the action described in this dialog.\n </AlertDialogPrimitive.Description>\n )}\n {children}\n </AlertDialogContentPrimitive>\n </AlertDialogPortal>\n );\n});\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;\n\nconst AlertDialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n data-slot=\"alert-dialog-header\"\n className={cn(\"flex flex-col space-y-2 text-center sm:text-left\", className)}\n {...props}\n />\n);\nAlertDialogHeader.displayName = \"AlertDialogHeader\";\n\nconst AlertDialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n data-slot=\"alert-dialog-footer\"\n className={cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n // Ruling 3/4 — sticky to the card edges so a scrolled body never shows\n // through under the actions, and safe-area padded on a phone.\n //\n // 🚨 THERE IS NO `mb-[…]` HERE, AND THERE MUST NEVER BE ONE AGAIN\n // (0.11.3, feedback bf8fb00b). The bleed over the card's bottom padding\n // used to be a NEGATIVE BLOCK MARGIN, which makes this box taller than\n // the grid area the card allocates it — and `position: sticky` CLAMPS a\n // box to its containing block, so the browser yanked the footer UP by\n // `--dialog-pad` against the card's `gap-4` and painted 8px of opaque\n // footer over the last line of the consequence, at every length. The\n // card now RESERVES this footer's block size instead (`matrx-dialog-card`\n // in styles.css hands over its `padding-bottom`), so the bleed costs no\n // margin at all. Guard: `sticky-footer-geometry.test.tsx`.\n //\n // These stay UTILITIES rather than a shipped rule so a caller's\n // `className` still wins through tailwind-merge — a shipped rule would\n // have to be unlayered to survive Tailwind preflight (§ THE PREFLIGHT\n // RULE in styles.css) and would then override every caller's padding.\n \"sticky bottom-0 z-10 bg-background pt-3\",\n \"mx-[calc(var(--dialog-pad,0px)*-1)] px-[var(--dialog-pad,0px)] pb-[var(--dialog-pad,0px)]\",\n className,\n )}\n {...props}\n />\n);\nAlertDialogFooter.displayName = \"AlertDialogFooter\";\n\nconst AlertDialogTitle = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Title\n ref={ref}\n data-slot=\"alert-dialog-title\"\n className={cn(\"text-lg font-semibold\", className)}\n {...props}\n />\n));\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;\n\nconst AlertDialogAction = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Action>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Action\n ref={ref}\n data-slot=\"alert-dialog-action\"\n className={cn(buttonVariants(), className)}\n {...props}\n />\n));\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;\n\nconst AlertDialogCancel = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Cancel>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Cancel\n ref={ref}\n data-slot=\"alert-dialog-cancel\"\n className={cn(\n buttonVariants({ variant: \"outline\" }),\n \"mt-2 sm:mt-0\",\n className,\n )}\n {...props}\n />\n));\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;\n\nexport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogContentPrimitive,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogOverlay,\n AlertDialogPortal,\n AlertDialogTitle,\n AlertDialogTrigger,\n};\n","\"use client\";\n\n/**\n * FLOATING LAYERS OPENED FROM INSIDE A MODAL — one contract, every surface.\n *\n * A blocking surface (a `modal` Dialog, AlertDialog, Sheet, Drawer,\n * BottomSheet, CommandDialog — and every Dialog on a phone) paints a scrim at\n * the modal tier, `MODAL_LAYER_Z`. Radix children of that surface (Popover,\n * Select, menus) are safe: they portal into it or after it at the same z, and\n * Radix counts a press inside them as inside. A floating layer that is NOT a\n * Radix child — a host window manager's window, the associations picker\n * window, anything `createPortal`ed to `<body>` at its own z — was not: it\n * painted UNDER the scrim (a window manager lives near z-1000), so the click\n * that picked an option landed on the scrim and closed the modal (Source\n * screen side sheet + association picker, 2026-09-26). Behind the scrim it\n * would also have lost focus to the modal's trap and had presses inside it\n * counted as outside-clicks.\n *\n * The contract, in three parts:\n *\n * 1. Every modal content registers while it is open (`useModalLayer`), and\n * treats a press or focus inside any `[data-matrx-floating-layer]` as\n * inside (`keepFloatingLayersInside`).\n * 2. A floating layer reads `useFloatingLayerZIndex(ownZ)`: while a modal is\n * open it is lifted to the modal tier. Equal z, so DOM order decides — a\n * layer opened AFTER the modal (portal appended later) paints above its\n * scrim; a window that was already open stays underneath, as it should.\n * While lifted, several floating layers order by when they opened, not by\n * their own manager's focus order; that returns when the modal closes.\n * 3. A floating layer's root is wrapped in `<FloatingLayer>`: it carries the\n * marker attribute, re-asserts `pointer-events: auto` (a modal sets `none`\n * on `<body>`), and mounts a non-trapping focus scope, which pauses the\n * modal's focus trap while the layer is open so its inputs take focus.\n *\n * 4. Popper content (a Popover, a combobox) a floating layer opens is portaled\n * to <body>; while a floating layer is open it counts as part of it, and\n * wheel/touchmove inside either stops at <body> so the modal's scroll lock\n * never cancels it.\n *\n * Guard: `floating-layer.test.tsx` — a window-manager-style layer opened from\n * each blocking surface must stack above the scrim, keep the modal open when\n * it or a popover it opened is pressed, scroll, keep focus in its own input,\n * and hand focus back to its opener when it closes.\n */\n\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\n\n/** The modal tier: every blocking scrim and its content sit here. */\nexport const MODAL_LAYER_Z = 10000;\n\n/** Marker attribute on the root of a floating layer. */\nexport const FLOATING_LAYER_ATTR = \"data-matrx-floating-layer\";\n\n// ── the open-modal registry ─────────────────────────────────────────────────\n// Shared identity across independently bundled public entrypoints, like the\n// dialog contexts: two copies of this module must see one count.\ninterface ModalLayerRegistry {\n count: number;\n listeners: Set<() => void>;\n}\nconst REGISTRY_SLOT = Symbol.for(\"ai-matrx.design-system.modal-layer-registry\");\nconst registryHost = globalThis as typeof globalThis & {\n [REGISTRY_SLOT]?: ModalLayerRegistry;\n};\nconst registry: ModalLayerRegistry = (registryHost[REGISTRY_SLOT] ??= {\n count: 0,\n listeners: new Set(),\n});\n\nfunction emit(): void {\n for (const listener of registry.listeners) listener();\n}\n\n// A modal's scroll lock (react-remove-scroll) cancels wheel and touchmove on\n// `document` for anything outside the modal's own content — including a\n// floating layer opened from it, whose list then never scrolls. While a modal\n// is open, a scroll gesture inside a floating layer stops at <body>: React's\n// own portal listener on <body> still sees it (stopPropagation never stops\n// listeners on the same node), the lock on `document` never does.\nconst SCROLL_EVENTS = [\"wheel\", \"touchmove\"] as const;\nfunction stopAtBody(event: Event): void {\n if (isInsideFloatingLayer(event.target)) event.stopPropagation();\n}\nfunction setScrollPassthrough(on: boolean): void {\n if (typeof document === \"undefined\" || !document.body) return;\n for (const type of SCROLL_EVENTS) {\n if (on) document.body.addEventListener(type, stopAtBody, { passive: true });\n else document.body.removeEventListener(type, stopAtBody);\n }\n}\n\n/** Register one open modal layer; returns its release. */\nexport function registerModalLayer(): () => void {\n registry.count += 1;\n if (registry.count === 1) setScrollPassthrough(true);\n emit();\n let released = false;\n return () => {\n if (released) return;\n released = true;\n registry.count = Math.max(0, registry.count - 1);\n if (registry.count === 0) setScrollPassthrough(false);\n emit();\n };\n}\n\n/** True while at least one blocking surface is open. */\nexport function isModalLayerOpen(): boolean {\n return registry.count > 0;\n}\n\nfunction subscribe(listener: () => void): () => void {\n registry.listeners.add(listener);\n return () => registry.listeners.delete(listener);\n}\n\n/** Reactive `isModalLayerOpen()`. */\nexport function useModalLayerOpen(): boolean {\n return React.useSyncExternalStore(subscribe, isModalLayerOpen, () => false);\n}\n\n/**\n * Called by every modal content while it is mounted. `active` is false for a\n * content whose root is not modal (a windowed dialog, a `modal={false}` sheet).\n */\nexport function useModalLayer(active: boolean): void {\n React.useLayoutEffect(() => (active ? registerModalLayer() : undefined), [active]);\n}\n\n// ── the outside-click guard ─────────────────────────────────────────────────\n\nconst POPPER_WRAPPER = \"[data-radix-popper-content-wrapper]\";\n\n/**\n * True when `target` is inside a floating layer — or inside popper content (a\n * Popover, a combobox list) while a floating layer is open. Popper content a\n * window opens is portaled to <body>, outside the window's own element and\n * outside the modal's React tree; popper content the MODAL opens is portaled\n * into the modal and never reaches this check.\n */\nexport function isInsideFloatingLayer(target: EventTarget | null | undefined): boolean {\n if (!(target instanceof Element)) return false;\n if (target.closest(`[${FLOATING_LAYER_ATTR}]`)) return true;\n return (\n target.closest(POPPER_WRAPPER) !== null &&\n target.ownerDocument.querySelector(`[${FLOATING_LAYER_ATTR}]`) !== null\n );\n}\n\n/**\n * Wrap a Radix `onInteractOutside` so a press or focus inside a floating layer\n * never dismisses the modal. The caller's handler still runs first.\n */\nexport function keepFloatingLayersInside<\n E extends { target: EventTarget | null; preventDefault: () => void },\n>(handler?: (event: E) => void): (event: E) => void {\n return (event) => {\n handler?.(event);\n if (isInsideFloatingLayer(event.target)) event.preventDefault();\n };\n}\n\n// ── the floating layer's side ───────────────────────────────────────────────\n\n/** Pure form of `useFloatingLayerZIndex`, for callers outside React. */\nexport function floatingLayerZIndex(ownZ: number, modalOpen: boolean): number {\n return modalOpen ? Math.max(ownZ, MODAL_LAYER_Z) : ownZ;\n}\n\n/** The z-index a floating layer should paint at, given its own. */\nexport function useFloatingLayerZIndex(ownZ: number): number {\n return floatingLayerZIndex(ownZ, useModalLayerOpen());\n}\n\nconst preventAutoFocus = (event: Event) => event.preventDefault();\n\n/**\n * Wrap the root element of a floating layer (exactly one element child).\n * Marks it, keeps it pressable under a modal's `pointer-events: none` body,\n * and pauses the modal's focus trap while it is mounted. It never takes focus\n * on open. On close, if focus was lost with it while a modal is still open,\n * focus returns to the control that opened it — otherwise the next Tab would\n * land behind the modal.\n */\nexport const FloatingLayer = React.forwardRef<\n HTMLElement,\n { children: React.ReactElement }\n>(({ children }, ref) => {\n const [opener] = React.useState<Element | null>(() =>\n typeof document === \"undefined\" ? null : document.activeElement,\n );\n const returnFocus = (event: Event) => {\n event.preventDefault();\n const active = document.activeElement;\n const lost = !active || active === document.body || !active.isConnected;\n if (lost && isModalLayerOpen() && opener instanceof HTMLElement && opener.isConnected) {\n opener.focus({ preventScroll: true });\n }\n };\n return (\n <FocusScope\n asChild\n trapped={false}\n loop={false}\n onMountAutoFocus={preventAutoFocus}\n onUnmountAutoFocus={returnFocus}\n >\n <Slot\n ref={ref}\n {...{ [FLOATING_LAYER_ATTR]: \"\" }}\n style={{ pointerEvents: \"auto\" }}\n >\n {children}\n </Slot>\n </FocusScope>\n );\n});\nFloatingLayer.displayName = \"FloatingLayer\";\n","\"use client\";\n\n/**\n * ConfirmDialog — the `window.confirm` replacement, declarative half.\n *\n * WHY IT LIVES HERE AND NOT IN `@ai-matrx/kit` (census row 19i, decided by the\n * package-graph ruling of 2026-09-07, on the row-20a Tooltip precedent).\n *\n * kit shipped this dialog with its own inlined AlertDialog, its own inlined\n * button class strings, a hardcoded 80%-opaque black scrim, and\n * `data-[state=open]:animate-in … zoom-in-95 … slide-in-from-top-[48%]` —\n * host-plugin utilities `tailwindcss-animate`/`tw-animate-css` supply and a\n * package cannot ship. kit ships NO stylesheet at all, so in three of the four\n * consumers the most consequential surface in the app (the one standing\n * between a user and a destroyed thing) appeared with no animation, no error,\n * and a scrim that ignored the theme. kit could not import the fix:\n * `@ai-matrx/design-system` depends on `@ai-matrx/kit`, so importing back is a\n * cycle; giving kit its own sheet would invent a second required-CSS contract\n * no consumer performs (the C26 silent host contract, one layer down).\n *\n * The resolution is the one row 20a already proved: the surface moves to the\n * package that owns the surface. This file is built on THIS package's\n * `AlertDialog` — so it inherits, for free and forever:\n *\n * - the package motion layer (`matrx-motion-overlay` / `matrx-motion-dialog`),\n * whose rules ship in `styles.css` and are proven present in the tarball;\n * - `--matrx-overlay-scrim`, a token that answers to the host's theme,\n * instead of an opaque black literal;\n * - AlertDialog ruling 3 — clamped to `max-h-[85dvh]`, scrolling inside\n * itself, with a sticky footer. **This is what makes the consequence-first\n * copy law survivable**: a confirmation that names everything it is about\n * to destroy can be long, and in kit's copy a long one pushed Cancel and\n * Continue below the fold of a short viewport with no backdrop dismissal —\n * a dead end on a destructive action;\n * - `buttonVariants` as the ONE source of button appearance, including the\n * 44px coarse-pointer target;\n * - `PortalContainerProvider`, so a dialog opened inside a popped-out window\n * panel renders in THAT window's document.\n *\n * kit keeps `./confirm-opener` — the pure, React-free imperative `confirm()`\n * and its `globalThis`-slotted host registry — and re-exports nothing of this.\n * Consumers mount `<ConfirmDialogHost />` from here and call `confirm()` from\n * there. See `confirm-host.tsx` for the join.\n *\n * BEHAVIOR IS THE KIT PORT, VERBATIM. Every prop, default and interaction is\n * unchanged; only the chrome underneath it is the package's.\n *\n * Pattern: hold the pending target in state, render `<ConfirmDialog />` once at\n * the bottom of the component, and open it by setting the target. When busy\n * state is meaningful (a network delete that should hold the dialog open with a\n * spinner), use THIS component inline; the imperative `confirm()` closes\n * immediately on click.\n */\n\nimport * as React from \"react\";\n\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from \"./alert-dialog\";\nimport { buttonVariants } from \"./button\";\nimport { cn } from \"./cn\";\nimport { Loader2Icon } from \"./icons\";\nimport { MOTION_SPIN } from \"./motion\";\n\nexport interface ConfirmDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n title: React.ReactNode;\n /**\n * THE CONSEQUENCE. Per the platform's destructive-and-expensive-actions law,\n * a confirmation must name what is lost, what is duplicated, and/or what it\n * costs — \"Are you sure?\" is not a confirmation. This renders as the dialog's\n * accessible description, so a screen-reader user is told the consequence\n * too, and it is never clamped or truncated.\n */\n description?: React.ReactNode | undefined;\n /**\n * Rich body rendered between the header and the footer. Use it for\n * supplementary or interactive content that is not part of the dialog's\n * accessible consequence description.\n */\n content?: React.ReactNode | undefined;\n /** Extra classes for the dialog content (e.g. a wider max-w for diffs). */\n contentClassName?: string | undefined;\n confirmLabel?: string | undefined;\n /**\n * `null` hides the cancel button entirely — for acknowledge-only dialogs\n * where there is nothing to cancel. Anything else labels it.\n */\n cancelLabel?: string | null | undefined;\n variant?: \"default\" | \"destructive\" | undefined;\n busy?: boolean | undefined;\n /**\n * Blocks confirming without pretending work is in flight. For a dialog whose\n * `content` asks the user something the action cannot proceed without — the\n * choice is missing, not loading — `busy` would show a misleading spinner.\n */\n confirmDisabled?: boolean | undefined;\n /**\n * The question is not answerable yet — Confirm is ABSENT, not disabled (a\n * control is absent or honest, never dead). The body carries its own loading\n * state; Cancel stays. Set by `ConfirmDialogHost` while `ConfirmOptions.ready`\n * is pending (0.54.0).\n */\n confirmHeld?: boolean | undefined;\n /**\n * Explicit portal target. Default (undefined): the container injected by\n * `PortalContainerProvider`, else `document.body`. Hosts with retargeting\n * needs (a popped-out browser window whose dialog must render in THAT\n * window's document) may still pass the element directly.\n */\n portalContainer?: HTMLElement | null | undefined;\n onConfirm: () => void | Promise<void>;\n}\n\n/**\n * Drop-in replacement for `window.confirm`. Use this anywhere you would\n * otherwise reach for a browser-level confirm dialog.\n */\nexport function ConfirmDialog({\n open,\n onOpenChange,\n title,\n description,\n content,\n contentClassName,\n confirmLabel = \"Confirm\",\n cancelLabel = \"Cancel\",\n variant = \"default\",\n busy = false,\n confirmDisabled = false,\n confirmHeld = false,\n portalContainer,\n onConfirm,\n}: ConfirmDialogProps) {\n return (\n <AlertDialog open={open} onOpenChange={onOpenChange}>\n <AlertDialogContent\n className={contentClassName}\n {...(portalContainer === undefined ? {} : { container: portalContainer })}\n >\n <AlertDialogHeader>\n <AlertDialogTitle>{title}</AlertDialogTitle>\n {description ? (\n <AlertDialogDescription asChild>\n <div>{description}</div>\n </AlertDialogDescription>\n ) : null}\n </AlertDialogHeader>\n {content ?? null}\n <AlertDialogFooter>\n {cancelLabel === null ? null : (\n <AlertDialogCancel className=\"max-lg:min-h-11\" disabled={busy}>\n {cancelLabel}\n </AlertDialogCancel>\n )}\n {confirmHeld ? null : (\n <AlertDialogAction\n disabled={busy || confirmDisabled}\n onClick={(event) => {\n event.preventDefault();\n void onConfirm();\n }}\n className={cn(\n \"max-lg:min-h-11\",\n // One source of button appearance: the destructive look comes\n // from `buttonVariants`, not a second hand-written copy of it.\n // tailwind-merge makes it WIN over the default variant classes.\n variant === \"destructive\" &&\n buttonVariants({ variant: \"destructive\" }),\n )}\n >\n {busy ? (\n <Loader2Icon className={cn(\"mr-2 h-4 w-4\", MOTION_SPIN)} />\n ) : null}\n {confirmLabel}\n </AlertDialogAction>\n )}\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n );\n}\n","/**\n * Skeleton — the \"content is coming\" placeholder.\n *\n * Ported from matrx-frontend `components/ui/skeleton.tsx`; no seams, pure\n * markup over semantic tokens. ONE change from the original (0.10.0): the\n * breathing loop is `.matrx-pulse`, a package-owned keyframe, not Tailwind's\n * `animate-pulse`. A Skeleton that does not pulse is indistinguishable from an\n * empty grey box — it stops saying \"loading\" and starts saying \"nothing here\"\n * — so the motion is part of the component's meaning and ships with it (see\n * `styles.css` § THE MOTION LAYER).\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { MOTION_PULSE } from \"./motion\";\n\nexport interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Package-owned pulse. Default `true`. Pass `false` for a static\n * placeholder — a print/PDF render, or a screenshot fixture where the\n * animation makes the output non-deterministic. `prefers-reduced-motion`\n * already SLOWS the pulse rather than stopping it (a still skeleton would\n * lose the information), so this is not the accessibility switch.\n */\n animated?: boolean;\n}\n\nexport function Skeleton({ className, animated = true, ...props }: SkeletonProps) {\n return (\n <div\n data-slot=\"skeleton\"\n className={cn(\n \"rounded-md bg-primary/10\",\n animated && MOTION_PULSE,\n className,\n )}\n {...props}\n />\n );\n}\n"],"mappings":";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;AAAA;AAAA;AAAA,EACN;AAEJ;","names":["Button","import_react_slot","React","React","import_jsx_runtime","React","import_jsx_runtime","React","import_jsx_runtime","React","import_jsx_runtime","import_class_variance_authority","React","import_jsx_runtime","import_jsx_runtime","Button","React","React","import_react_slot","React","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","Button"]}