@ai-matrx/design-system 0.86.358 → 0.86.360

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/CHANGELOG.md +23 -1
  2. package/dist/carousel.cjs +2 -1
  3. package/dist/carousel.cjs.map +1 -1
  4. package/dist/carousel.js +4 -4
  5. package/dist/{chunk-OUQT72UL.js → chunk-C5HYUXR2.js} +2 -2
  6. package/dist/{chunk-K3XWUACX.js → chunk-FF524V6P.js} +2 -2
  7. package/dist/{chunk-TEMAM5ET.js → chunk-HISATFYI.js} +2 -2
  8. package/dist/{chunk-WVEDW5VO.js → chunk-LU75R6YX.js} +3 -2
  9. package/dist/chunk-LU75R6YX.js.map +1 -0
  10. package/dist/{chunk-K5ZQROWN.js → chunk-QK7GPIEA.js} +3 -3
  11. package/dist/{chunk-KSCSH7AO.js → chunk-TSETPQWU.js} +2 -2
  12. package/dist/{chunk-NFJ63LIH.js → chunk-UCEKAKHP.js} +2 -2
  13. package/dist/{chunk-T3FKFPCW.js → chunk-WHERV3VC.js} +2 -2
  14. package/dist/{chunk-QTPW44IJ.js → chunk-WOA6WHV2.js} +2 -2
  15. package/dist/{chunk-P56Y43RL.js → chunk-ZU2ZODDD.js} +4 -4
  16. package/dist/clipboard-fallback-dialog.cjs +2 -1
  17. package/dist/clipboard-fallback-dialog.cjs.map +1 -1
  18. package/dist/clipboard-fallback-dialog.js +1 -1
  19. package/dist/controls.cjs +2 -1
  20. package/dist/controls.cjs.map +1 -1
  21. package/dist/controls.css +18 -1
  22. package/dist/controls.d.cts +5 -0
  23. package/dist/controls.d.ts +5 -0
  24. package/dist/controls.js +4 -4
  25. package/dist/data-table/data-row-inspector.cjs +2 -1
  26. package/dist/data-table/data-row-inspector.cjs.map +1 -1
  27. package/dist/data-table/data-row-inspector.js +4 -4
  28. package/dist/data-table/data-row-window.cjs +2 -1
  29. package/dist/data-table/data-row-window.cjs.map +1 -1
  30. package/dist/data-table/data-row-window.js +5 -5
  31. package/dist/data-table/index.cjs +2 -1
  32. package/dist/data-table/index.cjs.map +1 -1
  33. package/dist/data-table/index.js +7 -7
  34. package/dist/data-table/pagination.cjs +2 -1
  35. package/dist/data-table/pagination.cjs.map +1 -1
  36. package/dist/data-table/pagination.js +2 -2
  37. package/dist/data-table/uuid-cell.cjs +2 -1
  38. package/dist/data-table/uuid-cell.cjs.map +1 -1
  39. package/dist/data-table/uuid-cell.js +2 -2
  40. package/dist/desktop.cjs +3 -2
  41. package/dist/desktop.cjs.map +1 -1
  42. package/dist/desktop.d.cts +1 -1
  43. package/dist/desktop.d.ts +1 -1
  44. package/dist/desktop.js +4 -4
  45. package/dist/desktop.js.map +1 -1
  46. package/dist/index.cjs +2 -1
  47. package/dist/index.cjs.map +1 -1
  48. package/dist/index.d.cts +9 -9
  49. package/dist/index.d.ts +9 -9
  50. package/dist/index.js +6 -6
  51. package/dist/item.cjs +2 -1
  52. package/dist/item.cjs.map +1 -1
  53. package/dist/item.js +2 -2
  54. package/dist/lite-table.cjs +2 -1
  55. package/dist/lite-table.cjs.map +1 -1
  56. package/dist/lite-table.js +1 -1
  57. package/dist/look-desktop.css +7 -0
  58. package/dist/record-list.cjs +2 -1
  59. package/dist/record-list.cjs.map +1 -1
  60. package/dist/record-list.js +2 -2
  61. package/dist/settings.cjs +2 -1
  62. package/dist/settings.cjs.map +1 -1
  63. package/dist/settings.js +2 -2
  64. package/dist/swipe-deck.cjs +11 -2
  65. package/dist/swipe-deck.cjs.map +1 -1
  66. package/dist/swipe-deck.js +11 -2
  67. package/dist/swipe-deck.js.map +1 -1
  68. package/dist/writing-field.cjs +7 -1
  69. package/dist/writing-field.cjs.map +1 -1
  70. package/dist/writing-field.d.cts +4 -0
  71. package/dist/writing-field.d.ts +4 -0
  72. package/dist/writing-field.js +7 -2
  73. package/dist/writing-field.js.map +1 -1
  74. package/package.json +2 -2
  75. package/dist/chunk-WVEDW5VO.js.map +0 -1
  76. /package/dist/{chunk-OUQT72UL.js.map → chunk-C5HYUXR2.js.map} +0 -0
  77. /package/dist/{chunk-K3XWUACX.js.map → chunk-FF524V6P.js.map} +0 -0
  78. /package/dist/{chunk-TEMAM5ET.js.map → chunk-HISATFYI.js.map} +0 -0
  79. /package/dist/{chunk-K5ZQROWN.js.map → chunk-QK7GPIEA.js.map} +0 -0
  80. /package/dist/{chunk-KSCSH7AO.js.map → chunk-TSETPQWU.js.map} +0 -0
  81. /package/dist/{chunk-NFJ63LIH.js.map → chunk-UCEKAKHP.js.map} +0 -0
  82. /package/dist/{chunk-T3FKFPCW.js.map → chunk-WHERV3VC.js.map} +0 -0
  83. /package/dist/{chunk-QTPW44IJ.js.map → chunk-WOA6WHV2.js.map} +0 -0
  84. /package/dist/{chunk-P56Y43RL.js.map → chunk-ZU2ZODDD.js.map} +0 -0
@@ -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/solid-surface.ts","../src/icons.tsx","../src/portal-container.tsx","../src/menu-scroll-edges.tsx","../src/use-scroll-fade.ts","../src/submenu-focus.ts","../src/submenu-side.tsx","../src/focus-return.ts","../src/select.tsx","../src/field-surface.ts","../src/controls/icon-only.ts","../src/textarea.tsx","../src/controls/window-controls.tsx","../src/controls/decision-control.tsx","../src/controls/date-field.tsx","../src/bottom-sheet.tsx","../src/drawer.tsx","../src/floating-layer.tsx","../src/title-tooltips.ts","../src/radix-dialog-modal-context.tsx","../src/popover.tsx","../src/use-is-mobile.ts","../src/controls/date-parse.ts","../src/controls/doors.tsx","../src/controls/surfaces.tsx","../src/alert-dialog.tsx","../src/confirm-dialog.tsx","../src/skeleton.tsx","../src/controls/number-stepper.tsx","../src/slider.tsx","../src/controls/stage-steps.tsx","../src/controls/checklist.tsx","../src/controls/clamped-number-input.tsx","../src/controls/light-switch-toggle.tsx","../src/controls/option-combobox.tsx","../src/command.tsx","../src/close-slot.tsx","../src/controls/aspect-ratio-options.ts","../src/controls/aspect-ratio-select.tsx","../src/controls/configuration-fields.tsx","../src/table.tsx","../src/controls/value-summary.ts","../src/indicator-strip.tsx","../src/controls/middle-truncate.tsx","../src/controls/callout-banner.tsx","../src/controls/gated-action-button.tsx","../src/controls/search-input.tsx","../src/controls/collapsible-text.tsx","../src/tooltip.tsx","../src/controls/info-hint.tsx","../src/controls/status-badge.tsx","../src/controls/structured-section-card.tsx","../src/controls/icon-dropdown-menu.tsx","../src/error-box.tsx","../src/desktop/errors.ts","../src/error-sentence.ts","../src/label.tsx","../src/controls/field.tsx","../src/controls/help-icon.tsx","../src/controls/text-array-input.tsx","../src/host-link.tsx","../src/stand-in-notice.ts","../src/tap-target/link.ts","../src/read-state/untrusted-count.tsx","../src/controls/kpi-tile.tsx","../src/controls/action-feedback-button.tsx","../src/controls/citation-chip.tsx","../src/controls/tool-rail.tsx","../src/controls/page-range-input.tsx","../src/controls/page-ranges.ts","../src/controls/opacity-slider.tsx","../src/controls/color-swatch-row.tsx","../src/controls/anchored-toolbar.tsx","../src/controls/icon-select.tsx","../src/controls/advanced-collapsible.tsx","../src/collapsible.tsx","../src/dialog.tsx","../src/look.tsx","../src/layer-front.ts","../src/window-drag.ts","../src/drag-cursor.ts","../src/icon-button.tsx","../src/controls/empty-state-card.tsx","../src/controls/hue-cards.tsx"],"sourcesContent":["\"use client\";\n\n/**\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 CHIP_TONES,\n Chip,\n ChipSet,\n CONTROLS_COLLAPSE_BELOW_REM,\n CONTROLS_CONTAINER_CLASS,\n CONTROLS_CONTAINER_NAME,\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 GlyphTone,\n ChipHue,\n ChipProps,\n ChipSetProps,\n ChipTone,\n ControlRowProps,\n ControlVariant,\n ControlWidth,\n FieldProps,\n SegmentedControlProps,\n SegmentOption,\n SelectOption,\n SelectProps,\n SwitchProps,\n TabsProps,\n TextareaProps,\n} from \"./controls\";\n// THE window chrome: a floating window's traffic lights and title-bar icon actions at macOS geometry (2026-10-23).\nexport { WindowChromeButton, WindowLight, WindowLights } from \"./window-controls\";\nexport type { WindowChromeButtonProps, WindowLightKind, WindowLightProps, WindowLightsProps } from \"./window-controls\";\n// THE row decision: [Yes] [No] [Other] + the Other picker ending in \"Skip for now\" (Arman, 2026-10-14).\nexport { DecisionControl } from \"./decision-control\";\nexport type { DecisionAnswer, DecisionControlProps, WayOutItem } from \"./decision-control\";\n// THE date control: typed entry + calendar popover (sheet on a phone), ISO in and out.\nexport { DateField, DateTimeField, TimeField } from \"./date-field\";\nexport type { DateFieldMode, DateFieldProps } from \"./date-field\";\nexport { formatDay, formatTime, parseTypedDate, parseTypedTime } from \"./date-parse\";\n// The compound doors: the same controls behind the Radix compound / bare-<input> APIs.\nexport { Input, SelectTrigger, TabsList, TabsTrigger } from \"./doors\";\nexport type { InputProps, SelectTriggerProps, TabsListProps, TabsVariant } from \"./doors\";\nexport {\n ConfirmDelete,\n DangerZone,\n DeleteButton,\n DisclosureHeader,\n EmptyState,\n PromoBanner,\n RegionSkeleton,\n RowGroup,\n SettingRow,\n Tile,\n} from \"./surfaces\";\nexport type {\n ConfirmDeleteProps,\n DeleteButtonProps,\n DisclosureHeaderProps,\n DisclosureHeaderVariant,\n EmptyStateProps,\n PromoBannerProps,\n PromoTone,\n RegionSkeletonProps,\n RowGroupProps,\n SettingRowProps,\n TileLayout,\n TileProps,\n} from \"./surfaces\";\n\n// Moved from matrx-frontend (chat host slots get real package defaults, 2026-10-08).\nexport { NumberStepper, type NumberStepperProps } from \"./number-stepper\";\n// The shared range control, also used by OpacitySlider; keep drag and keyboard semantics.\nexport { Slider, type SliderProps } from \"../slider\";\nexport { StageSteps, stageStates, type StageStep, type StageState, type StageStepsProps } from \"./stage-steps\";\nexport {\n Checklist,\n ChecklistItem,\n ChecklistMark,\n ChecklistMeter,\n type ChecklistItemProps,\n type ChecklistMeterProps,\n type ChecklistProps,\n type ChecklistState,\n} from \"./checklist\";\nexport { ClampedNumberInput, clampDraft, shownDraft, type ClampedNumberInputProps } from \"./clamped-number-input\";\nexport { LightSwitchToggle, type LightSwitchToggleProps } from \"./light-switch-toggle\";\nexport { OptionCombobox, type OptionComboboxGroup, type OptionComboboxProps } from \"./option-combobox\";\nexport { AspectRatioSelect, AspectRatioGlyph, type AspectRatioSelectProps } from \"./aspect-ratio-select\";\nexport {\n parseRatio,\n isAspectRatioOptionSet,\n ratioShapeName,\n humanizeRatioWord,\n groupRatioOptions,\n type ParsedRatio,\n type RatioGroups,\n} from \"./aspect-ratio-options\";\nexport {\n CONFIGURATION_CHOICE_SIZE,\n FieldHelp,\n StatusToken,\n PropertyRow,\n MissingTag,\n type PropertyRowProps,\n ConfigurationValueList,\n ConfigurationTable,\n ConfigurationTableRow,\n type ConfigurationColumn,\n} from \"./configuration-fields\";\n// THE one-line summary of collected data for a closed PropertyRow (value-summary.ts).\nexport { valueSummary, isCollectedValue } from \"./value-summary\";\n// THE yes/no icon strip for a table cell: every flag always drawn, muted when off (indicator-strip.tsx).\nexport { IndicatorStrip, indicatorText } from \"../indicator-strip\";\nexport type { IndicatorItem, IndicatorStripProps, IndicatorTone } from \"../indicator-strip\";\n\n// Moved from matrx-frontend components/official (2026-10-22): the pure and light units.\nexport { MiddleTruncate, splitForMiddleTruncate } from \"./middle-truncate\";\nexport { CalloutBanner, type CalloutTone } from \"./callout-banner\";\nexport { GatedActionButton, firstBlockingReason, type BlockingCheck, type GatedActionButtonProps } from \"./gated-action-button\";\nexport { SearchInput, type SearchInputProps } from \"./search-input\";\nexport { CollapsibleText, CollapsibleTextGroupControls } from \"./collapsible-text\";\nexport { InfoHint, type InfoHintProps } from \"./info-hint\";\nexport { StatusBadge, STATUS_TONES, type StatusBadgeProps, type StatusBadgeSize, type StatusTone } from \"./status-badge\";\nexport { StructuredSectionCard, type StructuredSectionCardProps, type StructuredSectionCardTitleTone } from \"./structured-section-card\";\nexport { IconDropdownMenu, type IconDropdownMenuProps, type IconDropdownOption } from \"./icon-dropdown-menu\";\nexport { LabeledField, type LabeledFieldProps } from \"./field\";\nexport { HelpIcon, type HelpIconProps } from \"./help-icon\";\nexport { TextArrayInput, cleanUrl, type TextArrayInputProps } from \"./text-array-input\";\nexport { KpiGrid, KpiTile, type KpiTileProps, type KpiTone, type KpiTrend } from \"./kpi-tile\";\nexport { ActionFeedbackButton, type ActionFeedbackButtonProps } from \"./action-feedback-button\";\nexport { CitationChip, CitationPopoverBody, type CitationChipProps, type CitationPopoverBodyProps } from \"./citation-chip\";\n\n// Acrobat-style workspace controls (PDF-PLAN U5): rail, page ranges, opacity, swatches, anchored toolbar.\nexport { ToolRail, type ToolRailItem, type ToolRailProps } from \"./tool-rail\";\nexport { PageRangeInput, type PageRangeInputProps } from \"./page-range-input\";\nexport {\n formatPageRanges,\n parsePageRanges,\n spansOf,\n type PageRangeIssue,\n type PageRangeIssueKind,\n type ParsedPageRanges,\n} from \"./page-ranges\";\nexport { OpacitySlider, type OpacitySliderProps } from \"./opacity-slider\";\nexport { ColorSwatchRow, type ColorSwatch, type ColorSwatchRowProps } from \"./color-swatch-row\";\nexport { AnchoredToolbar, type AnchorRect, type AnchoredToolbarProps } from \"./anchored-toolbar\";\n// Wave 3 (2026-10-22): moved from matrx-frontend components/official.\nexport { IconSelect, type IconSelectItem, type IconSelectProps } from \"./icon-select\";\nexport { AdvancedCollapsible, type AdvancedCollapsibleProps } from \"./advanced-collapsible\";\nexport { EmptyStateCard, type EmptyStateCardProps } from \"./empty-state-card\";\nexport {\n HUE_TONE,\n HueCard,\n HueGrid,\n HueList,\n HueRow,\n IosWidget,\n TileCard,\n TileCardGrid,\n type CardColor,\n type CardSize,\n type HueCardProps,\n type HueGridProps,\n type HueListProps,\n type HueRowProps,\n type IosWidgetProps,\n type TileCardGridProps,\n type TileCardProps,\n} from \"./hue-cards\";\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 color 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 behavior 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 DropdownMenuLabel,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"../dropdown-menu\";\nimport { MagnifyingGlassIcon, PlusIcon } from \"../icons\";\nimport { SelectChevron } from \"../select\";\nimport { isIconOnly } from \"./icon-only\";\nimport { boxStyle, useAutoGrow, useMergedTextareaRef } from \"../textarea\";\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 * THE CONTAINER a collapsing control measures (`Button collapse=\"container\"`).\n * A host declares it on the box whose WIDTH decides — a list pane, a panel,\n * never the viewport: beside a chat panel a 1024px screen holds a 540px list.\n * `className={CONTROLS_CONTAINER_CLASS}`, or add the name to the box's own\n * `container-name` when it already names a container (`list matrx-controls`).\n */\nexport const CONTROLS_CONTAINER_NAME = \"matrx-controls\";\nexport const CONTROLS_CONTAINER_CLASS = \"matrx-controls-container\";\n/** Below this container width a `collapse=\"container\"` button is its icon alone (48rem). */\nexport const CONTROLS_COLLAPSE_BELOW_REM = 48;\n\n/* ------------------------------------------------------------------ */\n/* Button */\n/* ------------------------------------------------------------------ */\n\n/**\n * Tone, never size. `success` is the solid confirm-a-good-outcome fill (approve,\n * publish, mark done); `link` is a text action at the control's height — no\n * fill, no border, primary ink, underline on hover (an inline \"View all\").\n */\nexport type ControlVariant = \"primary\" | \"quiet\" | \"outline\" | \"danger\" | \"success\" | \"link\" | \"meta\";\n\n/**\n * THE NAMED CONTROL WIDTHS (0.68.22) — a button, field or select trigger that should not fill\n * its row takes one of these instead of a pasted `w-40`. Derived from the call sites:\n * `xs` 6rem (a unit, a short enum), `sm` 8rem, `md` 10rem (a date, a status), `lg` 14rem (a\n * name, an account), `xl` 20rem (a search, a URL). Never wider than its container.\n */\nexport type ControlWidth = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n\ninterface ButtonBase extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"children\"> {\n /** Tone, never size. Default `outline`. */\n variant?: ControlVariant;\n /** A status tint from the role tokens (the Badge's), for a button that\n * reports a state — a drift door, an alert count. Default: none. */\n tone?: BadgeTone;\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 /**\n * `\"container\"`: below 48rem of the nearest `matrx-controls` container\n * (CONTROLS_CONTAINER_NAME) the button is its leading `icon` alone — a 28px\n * circle; the label stays its accessible name and its tooltip. Needs `icon`;\n * without one it never collapses. Outside such a container it never does.\n */\n collapse?: \"container\";\n /**\n * A TOGGLE (a choice in a set, a mode, a tab-like switch): `true` is on —\n * the accent fill and full ink; `false` is off — no fill, quiet ink. Sets\n * `aria-pressed`. Omit for an ordinary action.\n */\n pressed?: boolean;\n /**\n * A count or a dot on the button's top-right corner, for something waiting\n * behind it (items added, unread). A number draws the count (99+ above 99;\n * 0 draws nothing); `true` draws an 8px dot. On a button with a text label\n * the count sits in the row after the label instead (never over it). Name it in `aria-label` too —\n * the mark is decoration.\n */\n badge?: number | boolean;\n /**\n * The glyph's own status ink, for a glyph whose COLOR carries meaning (the\n * green check after a copy, an amber debug bug) while the button stays\n * quiet. Tints only the icon(s), never the fill. Default: none.\n */\n glyphTone?: GlyphTone;\n /**\n * A removing act (clear, remove, disconnect): muted until hover,\n * destructive on hover — the delete tier-1 skin on any glyph or label.\n * Quiet variant only.\n */\n removes?: boolean;\n /**\n * MIXED CONTENT (0.68.12): a short muted fact after the label — a count, a\n * size, a shortcut, a \"3 of 12\" — in the 12px secondary ink. The button\n * stays 28px; the fact is part of the button, never a second element styled\n * beside it. Never a sentence.\n */\n meta?: React.ReactNode;\n /** A named width instead of the label's own (see `ControlWidth`). */\n width?: ControlWidth;\n /**\n * THE INVITING-PAGE CALL TO ACTION (0.68.22): a 44px capsule with a 16px/600 label and a\n * 24px inset — the size a marketing hero, a module landing or a kit's front door asks for.\n * Inviting pages are never densified; functional pages never use it. A `primary` hero\n * carries a soft primary glow.\n */\n hero?: boolean;\n}\n/** The status inks a glyph may carry (the role tokens). */\nexport type GlyphTone = \"success\" | \"warning\" | \"destructive\" | \"info\" | \"primary\";\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 / success / link, 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\", tone, icon, iconEnd, asChild = false, collapse, pressed, badge, glyphTone, removes, meta, width, hero, children, onClick, type, ...props }, ref) => {\n const Component = asChild ? Slot : \"button\";\n const badgeText =\n typeof badge === \"number\" ? (badge > 0 ? (badge > 99 ? \"99+\" : String(badge)) : null) : badge ? \"\" : null;\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 const collapses = collapse === \"container\" && Boolean(icon) && Boolean(label);\n return (\n <Component\n ref={ref}\n type={asChild ? undefined : (type ?? \"button\")}\n data-matrx-control=\"button\"\n data-variant={variant}\n data-tone={tone && tone !== \"neutral\" ? tone : undefined}\n data-glyph={glyphSlot(icon, iconEnd, label)}\n data-collapse={collapses ? \"container\" : undefined}\n data-pressed={pressed === undefined ? undefined : pressed ? \"true\" : \"false\"}\n aria-pressed={pressed}\n data-badge={badgeText === null ? undefined : badgeText === \"\" ? \"dot\" : \"count\"}\n // A labeled button carries its count IN the row after the label: the\n // corner count sat over the label's last letter (\"HR 28\" on /tasks).\n data-badge-place={badgeText && label ? \"inline\" : undefined}\n data-glyph-tone={glyphTone}\n data-delete={removes ? \"\" : undefined}\n data-width={width}\n data-hero={hero ? \"\" : undefined}\n className={cn(\"matrx-control matrx-control-button matrx-glyph-trim\", className)}\n // A collapsed button still says what it does on hover.\n title={collapses && typeof label === \"string\" && props.title === undefined ? label : undefined}\n {...props}\n aria-disabled={disabledChild ? true : ariaDisabled}\n tabIndex={disabledChild ? -1 : props.tabIndex}\n onClick={inert ? swallowClick : onClick}\n >\n {icon}\n <Slottable>\n {/* A text label NEVER spills past its button (owner, 2026-10-05: a\n long chat title ran under the mode switch beside it). It sits in\n its own box so a capped button ellipsizes instead of overflowing. */}\n {!asChild && (typeof children === \"string\" || typeof children === \"number\") ? (\n <span className=\"matrx-control-button-label\">{children}</span>\n ) : (\n children\n )}\n </Slottable>\n {meta === undefined || meta === null || meta === false ? null : (\n <span className=\"matrx-control-button-meta\">{meta}</span>\n )}\n {iconEnd}\n {badgeText === null ? null : (\n <span className=\"matrx-control-button-badge\" aria-hidden=\"true\">\n {badgeText}\n </span>\n )}\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 /** A named width instead of filling the row (see `ControlWidth`). */\n width?: ControlWidth;\n /**\n * THE INVITING-PAGE INPUT: a 56px capsule with an 18px value and a 24px inset — the big,\n * friendly field a welcome / onboarding front door asks for (pairs with Button `hero`).\n * Inviting pages only; functional pages never use it.\n */\n hero?: boolean;\n /**\n * THE LEADING SEARCH: a 48px filled capsule — no frame, the muted fill, a 16px value, a 20px\n * glyph — that turns the card color with a soft lift on focus. The one search a home page leads\n * with (a file home's search, as on Google Docs / Drive). One per page; never in a form or toolbar.\n */\n filled?: boolean;\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, width, hero, filled, ...props }, ref) => (\n <label\n data-matrx-control=\"field\"\n data-glyph={icon ? \"start\" : undefined}\n data-width={width}\n data-hero={hero ? \"\" : undefined}\n data-filled={filled ? \"\" : 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 /** Muted text right after the label, menu and trigger alike: what tells two same-named options apart (a short id, an owner). */\n hint?: string;\n /** A section heading: the menu shows it (foreground weight) above the first option of each consecutive run. */\n group?: string;\n /** Shown but not choosable (an unavailable tool, a sentinel the URL set). */\n disabled?: boolean;\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 /**\n * `field` (default): the capsule a form row uses. `inline`: the value as text with a small chevron,\n * no capsule — for a choice that sits inside a dense row or a toolbar sentence (\"Full ⌄\"), where a\n * row of capsules reads as clutter (Arman, 2026-10-14).\n */\n variant?: \"field\" | \"inline\";\n /**\n * A search row at the top of the menu once there are at least this many options (a long list of\n * organizations). It matches label, hint and group. Omitted: never.\n */\n searchAt?: number;\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 variant = \"field\",\n searchAt,\n}: SelectProps<T>) {\n const current = options.find((o) => o.value === value);\n const [query, setQuery] = React.useState(\"\");\n const searchable = searchAt !== undefined && options.length >= searchAt;\n const q = searchable ? query.trim().toLowerCase() : \"\";\n const shown = q ? options.filter((o) => [o.label, o.hint, o.group].some((t) => t?.toLowerCase().includes(q))) : options;\n return (\n <DropdownMenu onOpenChange={(open) => !open && setQuery(\"\")}>\n <DropdownMenuTrigger asChild disabled={disabled}>\n <button\n type=\"button\"\n data-matrx-control=\"select\"\n data-variant={variant === \"inline\" ? \"inline\" : undefined}\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 {current?.hint ? <span className=\"text-muted-foreground\" data-select-hint=\"\">{current.hint}</span> : null}\n </span>\n <SelectChevron />\n </button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align={align} className=\"max-h-80 w-max min-w-[max(10rem,var(--radix-dropdown-menu-trigger-width))] max-w-[min(24rem,var(--radix-dropdown-menu-content-available-width))] overflow-y-auto\">\n {searchable ? (\n <div className=\"sticky top-0 z-10 bg-popover p-1\" data-select-search=\"\">\n <SearchField\n className=\"w-full\"\n value={query}\n autoFocus\n aria-label={`Search ${ariaLabel}`}\n onChange={(e) => setQuery(e.target.value)}\n // The menu's type-ahead never takes the letters; arrows and Escape still drive the menu.\n onKeyDown={(e) => {\n if (e.key !== \"ArrowDown\" && e.key !== \"ArrowUp\" && e.key !== \"Escape\" && e.key !== \"Tab\") e.stopPropagation();\n }}\n />\n </div>\n ) : null}\n {searchable && shown.length === 0 ? <div className=\"px-2 py-1.5 text-[0.8125rem] text-muted-foreground\" role=\"status\">No match</div> : null}\n <DropdownMenuRadioGroup value={value} onValueChange={(v) => onValueChange(v as T)}>\n {shown.map((o, i) => (\n <React.Fragment key={o.value}>\n {o.group && o.group !== shown[i - 1]?.group ? (\n <>\n {i > 0 ? <DropdownMenuSeparator /> : null}\n <DropdownMenuLabel>{o.group}</DropdownMenuLabel>\n </>\n ) : null}\n <DropdownMenuRadioItem value={o.value} disabled={o.disabled === true} className=\"text-[0.8125rem]\">\n {/* The label truncates; the hint never does (it is what tells two same-named options apart). */}\n <span className=\"flex min-w-0 flex-1 items-baseline\">\n <span className=\"min-w-0 truncate\">{o.label}</span>\n {o.hint ? <span className=\"ml-1.5 shrink-0 text-muted-foreground\" data-select-hint=\"\">{o.hint}</span> : null}\n </span>\n {o.meta ? <span className=\"ml-3 text-[0.6875rem] text-muted-foreground\">{o.meta}</span> : null}\n </DropdownMenuRadioItem>\n </React.Fragment>\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 /** The selected segment; `null` = none is selected (an optional choice). */\n value: T | null;\n onValueChange: (value: T) => void;\n data: readonly SegmentOption<T>[];\n \"aria-label\": string;\n /** The segments share the row's whole width equally (a full-width choice: levels, modes). */\n fill?: boolean;\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 | null;\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 data-icon-only={o.count == null && isIconOnly(o.label) ? \"\" : undefined}\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 fill,\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 data-fill={fill ? \"\" : undefined}\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 /** Underline tabs inside a framed panel (a card, a bordered box): the labels start at the\n * panel's 12px content inset while the hairline still runs edge to edge. Page-level tabs\n * stay flush with the page gutter (default). Arman, 2026-10-21. */\n inset?: 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 inset = false,\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 data-inset={inset ? \"\" : undefined}\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 /** A 12px glyph before the label, 4px gap, in the badge's own tone color. */\n icon?: React.ReactNode;\n}\n\n/** Outline, 18px, 11px text, clamped to one line (≤20rem) — never a sentence. */\nexport function Badge({ tone = \"neutral\", icon, 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 {icon ? (\n <span className=\"matrx-control-badge-icon\" aria-hidden=\"true\">\n {icon}\n </span>\n ) : null}\n <span>{children}</span>\n </span>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Chip and ChipSet */\n/* ------------------------------------------------------------------ */\n\n/**\n * The status tones (the Badge's) plus a FIXED set of categorical hues, each a\n * token pair in `controls.css` (`--matrx-chip-<hue>`, stepped for dark). A\n * feature maps its kinds onto these through ONE table of its own\n * (`kind → ChipTone`) — never a class string.\n */\nexport type ChipHue =\n | \"sky\"\n | \"blue\"\n | \"indigo\"\n | \"violet\"\n | \"fuchsia\"\n | \"rose\"\n | \"orange\"\n | \"amber\"\n | \"lime\"\n | \"emerald\"\n | \"teal\"\n | \"cyan\"\n | \"slate\";\nexport type ChipTone = BadgeTone | ChipHue;\n\n/** Every tone a chip accepts, in a fixed order (tests, pickers, demos). */\nexport const CHIP_TONES: readonly ChipTone[] = [\n \"neutral\",\n \"primary\",\n \"success\",\n \"warning\",\n \"destructive\",\n \"info\",\n \"sky\",\n \"blue\",\n \"indigo\",\n \"violet\",\n \"fuchsia\",\n \"rose\",\n \"orange\",\n \"amber\",\n \"lime\",\n \"emerald\",\n \"teal\",\n \"cyan\",\n \"slate\",\n] as const;\n\nexport interface ChipProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, \"children\"> {\n /** The one line of text. Truncates; the full text is the tooltip. */\n label: string;\n /** `item` (default): an existing thing, tinted. `add`: a suggestion to make\n * one — dashed, quiet, with the package's own leading `+`. */\n variant?: \"item\" | \"add\";\n /** A named tone, never a class. Default `neutral`. Ignored by `add`. */\n tone?: ChipTone;\n /** Leading glyph (drawn 14px, optically trimmed). */\n icon?: React.ReactNode;\n /** Put the chip's skin on the one child element (a link or a button); the\n * child carries no children of its own — the chip draws glyph + label. */\n asChild?: boolean;\n /**\n * A FILTER chip (a toggle in a set of choices): `true` is on — tinted in its\n * `tone` (default `primary`); `false` is off — untinted outline, quiet ink.\n * Sets `aria-pressed`. Use with `asChild` on a `<button>`. Omit for a tag.\n */\n pressed?: boolean;\n children?: React.ReactElement;\n}\n\n/**\n * THE chip: a tag that names a thing (a format, a kind, a status, a source).\n * ONE 24px height, one 6px radius, one 12px/500 label, 14px glyph, matched\n * insets, single line with an ellipsis and a tooltip, and the controls' 3px\n * half-gap of its own so a `ChipSet` adds none. Geometry and tint are locked\n * in `controls.css`; a call site may place it, never restyle it.\n */\nexport const Chip = React.forwardRef<HTMLSpanElement, ChipProps>(\n ({ label, variant = \"item\", tone, icon, asChild = false, pressed, children, className, title, ...props }, ref) => {\n const Component = asChild ? Slot : \"span\";\n const glyph = variant === \"add\" ? <PlusIcon className=\"lucide lucide-plus\" /> : icon;\n const toggle = pressed !== undefined && variant === \"item\";\n const resolvedTone = tone ?? (toggle ? \"primary\" : \"neutral\");\n return (\n <Component\n ref={ref}\n data-matrx-control=\"chip\"\n data-variant={variant}\n data-tone={variant === \"add\" ? undefined : resolvedTone}\n data-pressed={toggle ? String(pressed) : undefined}\n aria-pressed={toggle ? pressed : undefined}\n data-glyph={glyph ? (variant === \"add\" && icon ? \"both\" : \"start\") : undefined}\n className={cn(\"matrx-control-chip matrx-glyph-trim\", className)}\n title={title ?? label}\n {...props}\n >\n {glyph}\n {variant === \"add\" ? icon : null}\n {asChild ? <Slottable>{children}</Slottable> : null}\n <span className=\"matrx-control-chip-label\">{label}</span>\n </Component>\n );\n },\n);\nChip.displayName = \"Chip\";\n\nexport interface ChipSetProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * `flow` (default): chips sit at their own width and wrap.\n * `grid`: every chip is the same width (auto-filled columns of at least\n * 7.5rem), labels truncate — for a SET of siblings (a kit's formats).\n */\n layout?: \"flow\" | \"grid\";\n}\n\n/** A set of chips: same height, one baseline, the chips space themselves. */\nexport const ChipSet = React.forwardRef<HTMLDivElement, ChipSetProps>(\n ({ layout = \"flow\", className, ...props }, ref) => (\n <div\n ref={ref}\n data-matrx-control=\"chip-set\"\n data-layout={layout}\n className={cn(\"matrx-control-chip-set\", className)}\n {...props}\n />\n ),\n);\nChipSet.displayName = \"ChipSet\";\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\nexport interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {\n /** The roomy writing surface used by inviting prompt boxes. */\n hero?: boolean;\n /** Join a pinned status row below this field from the small breakpoint upward. */\n joinedBottom?: boolean;\n /** `field` (default): the field skin. `bare`: the surrounding surface draws the frame (a\n * composer) — no border, no fill, no inset, no focus ring of its own. */\n variant?: \"field\" | \"bare\";\n /** Monospace text — code, JSON, keys. */\n mono?: boolean;\n /** Grow with the content (stopping at `maxHeight`, then scroll). */\n autoGrow?: boolean;\n /** Minimum height in px (a writing area that must start tall). `rows` also sizes it. */\n minHeight?: number;\n /** Maximum height in px; past it the field scrolls. */\n maxHeight?: number;\n /** Space occupied by an overlaid control cluster, so editable text stays clear of it. */\n reservedInlineEnd?: number;\n /** Space occupied by an overlaid row of controls at the bottom of the writing area. */\n reservedBlockEnd?: number;\n}\n\n/**\n * The field skin, multi-line (8px radius — a capsule cannot hold paragraphs). Height is the\n * textarea's own business — `rows`, `minHeight`/`maxHeight`, `autoGrow`, `resize` — never a class.\n */\nexport const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, style, variant = \"field\", mono, hero, joinedBottom, autoGrow, minHeight, maxHeight, reservedInlineEnd, reservedBlockEnd, ...props }, forwarded) => {\n const { ref, callback } = useMergedTextareaRef(forwarded);\n useAutoGrow(ref, props.value, autoGrow, minHeight, maxHeight);\n return (\n <textarea\n ref={callback}\n data-matrx-control=\"textarea\"\n data-variant={variant === \"bare\" ? \"bare\" : undefined}\n data-mono={mono ? \"\" : undefined}\n data-hero={hero ? \"\" : undefined}\n data-joined-bottom={joinedBottom ? \"\" : undefined}\n className={cn(\"matrx-control-textarea\", className)}\n style={{ ...boxStyle(minHeight, maxHeight), ...style,\n ...(reservedInlineEnd === undefined ? {} : { \"--matrx-textarea-reserved-inline-end\": `${Math.max(0, reservedInlineEnd)}px` }),\n ...(reservedBlockEnd === undefined ? {} : { \"--matrx-textarea-reserved-block-end\": `${Math.max(0, reservedBlockEnd)}px` }),\n } as React.CSSProperties}\n {...props}\n />\n );\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-danger-fill text-danger-fill-foreground shadow-sm hover:bg-danger-fill/90\",\n /** The affirmative twin of `destructive` — confirm, approve, publish. */\n success:\n \"bg-success-fill text-success-fill-foreground shadow-sm hover:bg-success-fill/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-ink 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 honors), 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 behaviors 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 { SOLID_SURFACE_CLASS, type PopoverSurface } from \"./solid-surface\";\nimport { RadixCheckIcon, DotFilledIcon, RadixChevronRightIcon } from \"./icons\";\nimport { usePortalContainer } from \"./portal-container\";\nimport { useMenuScrollEdges } from \"./menu-scroll-edges\";\nimport { useSubmenuSurvivesParentPanelFocus } from \"./submenu-focus\";\nimport { useNestedSubmenuPlacement } from \"./submenu-side\";\nimport { keepMovedFocus } from \"./focus-return\";\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\n// The cap is exactly the room Radix measured. What floats at the bottom (the host publishes\n// --matrx-floating-clearance) is kept clear as COLLISION PADDING (see readBottomClearance), never subtracted\n// here: subtracting it crushed any menu opened from inside or just above that floating chrome — the attention\n// dock's snooze menu (the dock is itself bottom chrome, ~240 px) opened as a 0 px sliver.\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]:text-disabled-foreground\";\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]:text-disabled-foreground\";\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> & {\n container?: HTMLElement | null;\n /** `\"solid\"` = opaque surface (see PopoverContent `surface`). */\n surface?: PopoverSurface;\n }\n>(({ className, container, surface = \"default\", sideOffset = 2, alignOffset = -4, collisionPadding, onFocusOutside, children, ...props }, ref) => {\n const portalContainer = usePortalContainer(container);\n const [bottomClearance] = React.useState(sharedBottomClearance);\n const padding = menuCollisionPadding(collisionPadding ?? 8, 0, bottomClearance);\n // A nested submenu opens on its parent's side (see submenu-side.tsx).\n const nested = useNestedSubmenuPlacement(ref, padding);\n // A flipped submenu survives the pointer leaving its trigger (see submenu-focus.ts).\n const keep = useSubmenuSurvivesParentPanelFocus(nested.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 data-surface={surface === \"solid\" ? \"solid\" : undefined}\n sideOffset={sideOffset}\n alignOffset={alignOffset}\n {...(nested.padding === undefined ? {} : { collisionPadding: nested.padding })}\n className={cn(MENU_SURFACE_CLASS, edges.surfaceClassName, \"shadow-lg\", surface === \"solid\" && SOLID_SURFACE_CLASS, MOTION_POPPER, className)}\n {...props}\n >\n {nested.wrap(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 /** `\"solid\"` = opaque surface (see PopoverContent `surface`). */\n surface?: PopoverSurface;\n}\n\n/**\n * The px a menu keeps clear of the TOP edge: what the host publishes as `--matrx-floating-top-clearance`\n * (a page's sticky header row, on top of the app header) or, absent that, the app header\n * (`--shell-header-h`). Radix positions against the raw viewport, so without it a menu opened from the first\n * row under a sticky header flips up and its first items sit underneath it. Read once, when the menu opens.\n * Hosts without either variable lose nothing (0px = Radix's own default).\n */\nexport function readTopClearance(): number {\n return readClearance(TOP_CLEARANCE);\n}\n\n/**\n * The px a menu keeps clear of the BOTTOM edge: what the host publishes as `--matrx-floating-clearance`\n * (the assists pill, the attention dock, any `data-matrx-floating-bottom` chrome). As collision padding,\n * Radix FLIPS a menu upward when the room left below that chrome is too small, and its available height\n * already excludes it — so the last item never ends under the pill, and a menu opened from INSIDE that\n * chrome opens upward at full height instead of collapsing. Read once, when the menu opens.\n */\nexport function readBottomClearance(): number {\n return readClearance(BOTTOM_CLEARANCE);\n}\n\ntype MenuCollisionPadding = number | Partial<Record<\"top\" | \"right\" | \"bottom\" | \"left\", number>>;\n\n/** Pure: the caller's collision padding (or `fallback` on sides it leaves unset), with the host's top and bottom\n * clearance as a floor — a caller's own padding never puts a menu under the app header or the assists pill. */\nexport function menuCollisionPadding(\n caller: MenuCollisionPadding | undefined,\n top: number,\n bottom: number,\n fallback = 0,\n): Record<\"top\" | \"right\" | \"bottom\" | \"left\", number> {\n const side = (key: \"top\" | \"right\" | \"bottom\" | \"left\") =>\n typeof caller === \"number\" ? caller : (caller?.[key] ?? fallback);\n return { top: Math.max(side(\"top\"), top), right: side(\"right\"), bottom: Math.max(side(\"bottom\"), bottom), left: side(\"left\") };\n}\n\n/**\n * ONE MEASUREMENT PER BURST. A list mounts a menu per row, and each menu reads both clearances when it\n * mounts; every read appends a probe and forces a layout. Admin's /files/trash (432 rows) spent 1.46 s in\n * these reads before the list could draw (2026-10-24). Reads within CLEARANCE_REUSE_MS of a measurement\n * share it: the variables only change with the page's chrome (a header row, the assists pill).\n */\nconst CLEARANCE_REUSE_MS = 500;\nconst clearanceCache = new Map<string, { px: number; at: number }>();\nconst clock = (): number => (typeof performance !== \"undefined\" ? performance.now() : Date.now());\n\nfunction readClearance(height: string, shared = false): number {\n if (typeof document === \"undefined\") return 0;\n const now = clock();\n const held = shared ? clearanceCache.get(height) : undefined;\n if (held && now - held.at < CLEARANCE_REUSE_MS) return held.px;\n const px = measureClearance(height);\n clearanceCache.set(height, { px, at: now });\n return px;\n}\n\n/** The mount-time reads every menu content makes: shared across the menus that mount in one burst. */\nconst TOP_CLEARANCE = \"var(--matrx-floating-top-clearance, var(--shell-header-h, 0px))\";\nconst BOTTOM_CLEARANCE = \"var(--matrx-floating-clearance, 0px)\";\nconst sharedTopClearance = (): number => readClearance(TOP_CLEARANCE, true);\nconst sharedBottomClearance = (): number => readClearance(BOTTOM_CLEARANCE, true);\n\nfunction measureClearance(height: string): number {\n const probe = document.createElement(\"div\");\n probe.style.cssText = `position:fixed;top:0;left:0;width:0;visibility:hidden;pointer-events:none;height:${height}`;\n document.body.appendChild(probe);\n const px = probe.getBoundingClientRect().height;\n probe.remove();\n return Number.isFinite(px) ? Math.ceil(px) : 0;\n}\n\nconst DropdownMenuContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Content>,\n DropdownMenuContentProps\n>(({ className, sideOffset = 4, container, surface = \"default\", children, onCloseAutoFocus, collisionPadding, ...props }, ref) => {\n const portalContainer = usePortalContainer(container);\n const [topClearance] = React.useState(sharedTopClearance);\n const [bottomClearance] = React.useState(sharedBottomClearance);\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 data-surface={surface === \"solid\" ? \"solid\" : undefined}\n sideOffset={sideOffset}\n collisionPadding={menuCollisionPadding(collisionPadding, topClearance, bottomClearance)}\n className={cn(\n MENU_SURFACE_CLASS,\n edges.surfaceClassName,\n \"shadow-md\",\n surface === \"solid\" && SOLID_SURFACE_CLASS,\n MOTION_POPPER,\n className,\n )}\n {...props}\n onCloseAutoFocus={keepMovedFocus(onCloseAutoFocus)}\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 /** `danger`: a destructive item (Delete, Remove) — destructive text and icon, destructive soft\n * fill on hover / focus. Default: the ordinary item. */\n tone?: \"danger\";\n /** `sm`: 13px text on the 28px control row height, for dense frames. Default: the menu's 14px. */\n size?: \"sm\";\n }\n>(({ className, inset, tone, size, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n data-slot=\"dropdown-menu-item\"\n data-tone={tone}\n data-size={size}\n className={cn(MENU_ITEM_CLASS, size === \"sm\" && \"h-7 py-0 text-[13px]\", 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 <RadixCheckIcon 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(\"type-label px-2 pb-1 pt-2 font-medium text-foreground\", 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 text-muted-foreground\", 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 centered dialog card. Fades and scales; centering is not its business. */\nexport const MOTION_DIALOG = \"matrx-motion-dialog\";\n\n/**\n * THE CENTERING OF A CENTERED 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 centering inside `transform`,\n * which was harmless on v3 and doubled the centering 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 centered\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/** A waiting box's crossing band of light (Skeleton `motion=\"shimmer\"`). Reduced motion: a slow breathe, no travel. */\nexport const MOTION_SHIMMER = \"matrx-shimmer\";\n\n/** The spinner loop, for every inline busy indicator in the package. */\nexport const MOTION_SPIN = \"matrx-spin\";\n\n/**\n * FirstUseHint's beacon: a soft ring that pulses three times around the anchor, on\n * `box-shadow` only, so nothing moves. A still ring under reduced motion.\n */\nexport const MOTION_HINT_BEACON = \"matrx-motion-hint-beacon\";\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_SHIMMER,\n MOTION_SPIN,\n MOTION_HINT_BEACON,\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/**\n * THE PANEL MOTION as a Tailwind class string (moved from matrx-frontend\n * `lib/motion/panel-motion.ts`): every panel, sidebar, dock, drawer and sheet\n * slides its size/position on the host's `--matrx-motion-duration-panel` /\n * `--matrx-motion-ease-panel` (tokens.css ships the standard). Pair it with the\n * transition property you animate (`transition-transform`, …).\n */\nexport const PANEL_MOTION_CLASS =\n \"duration-(--matrx-motion-duration-panel) ease-(--matrx-motion-ease-panel) motion-reduce:transition-none\";\nexport const PANEL_MOTION_DURATION_VAR = \"var(--matrx-motion-duration-panel)\";\nexport const PANEL_MOTION_EASE_VAR = \"var(--matrx-motion-ease-panel)\";\n","/**\n * The opaque surface option shared by every floating menu surface\n * (`PopoverContent`, `DropdownMenuContent`, `DropdownMenuSubContent`).\n * `data-surface=\"solid\"` is also styled in `styles.css`, so the fill holds even\n * where a host utility layer tints the default surface.\n */\nexport type PopoverSurface = \"default\" | \"solid\";\n\nexport const SOLID_SURFACE_CLASS =\n \"bg-[hsl(var(--popover)/1)] [backdrop-filter:none] [-webkit-backdrop-filter:none]\";\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\nexport type IconProps = React.SVGAttributes<SVGSVGElement>;\n\n/**\n * Every lucide glyph carries `lucide-<name>`, the class lucide-react itself renders: THE OPTICAL\n * GLYPH TRIM (tap-target.css) reads the glyph's real air from it, and a caller's own class follows it.\n */\nfunction lucideProps(name: string, { className, ...props }: IconProps): React.SVGAttributes<SVGSVGElement> {\n return {\n className: className ? `lucide-${name} ${className}` : `lucide-${name}`,\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(\"loader-circle\", 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(\"chevron-left\", 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(\"chevron-right\", 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(\"chevron-down\", props)}>\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n );\n}\n\n/** lucide `trash-2` (moved from @ai-matrx/agents). */\nexport function Trash2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"trash-2\", props)}>\n <path d=\"M10 11v6\" />\n <path d=\"M14 11v6\" />\n <path d=\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\" />\n <path d=\"M3 6h18\" />\n <path d=\"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\" />\n </svg>\n );\n}\n\n/** lucide `archive` — the archived-rows glyph (ArchivedDisclosure). */\nexport function ArchiveIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"archive\", 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(\"ellipsis\", 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 CheckIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"check\", 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(\"chevrons-up-down\", 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(\"external-link\", 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(\"lock\", 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(\"pencil\", 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 `message-square` — a row's comments (records-ui SectionCard). */\nexport function MessageSquareIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"message-square\", props)}>\n <path d=\"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z\" />\n </svg>\n );\n}\n\n/** lucide `sticky-note` — a row's usage note (records-ui SectionCard). */\nexport function StickyNoteIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sticky-note\", props)}>\n <path d=\"M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z\" />\n <path d=\"M15 3v4a2 2 0 0 0 2 2h4\" />\n </svg>\n );\n}\n\n/** lucide `minus` — the decrease glyph (NumberStepper). */\nexport function MinusIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"minus\", props)}>\n <path d=\"M5 12h14\" />\n </svg>\n );\n}\n\n/** lucide `plus` — the create/add glyph. */\nexport function PlusIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"plus\", props)}>\n <path d=\"M5 12h14\" />\n <path d=\"M12 5v14\" />\n </svg>\n );\n}\n\n/** lucide `search` — the magnifier (the `@ai-matrx/design-system/icons` section). */\nexport function SearchIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"search\", props)}>\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"m21 21-4.3-4.3\" />\n </svg>\n );\n}\n\n/** lucide `list-filter` — a table's filter button (Mail's and Finder's filter). */\nexport function ListFilterIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"list-filter\", props)}>\n <path d=\"M3 6h18\" />\n <path d=\"M7 12h10\" />\n <path d=\"M10 18h4\" />\n </svg>\n );\n}\n\n/** lucide `pin` — pinned state (the `@ai-matrx/design-system/icons` section). */\nexport function PinIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"pin\", props)}>\n <path d=\"M12 17v5\" />\n <path d=\"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z\" />\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(\"x\", 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 RadixCheckIcon(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 saved-organization badge (OrganizationPicker). */\nexport function StarIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"star\", 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(\"building-2\", 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(\"panel-left\", 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(\"ellipsis-vertical\", 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(\"maximize-2\", 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(\"minimize-2\", 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(\"arrow-left\", 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(\"arrow-right\", props)}>\n <path d=\"M5 12h14\" />\n <path d=\"m12 5 7 7-7 7\" />\n </svg>\n );\n}\n\n/** lucide `arrow-up` — the swipe deck's up edge. */\nexport function ArrowUpIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-up\", props)}>\n <path d=\"m5 12 7-7 7 7\" />\n <path d=\"M12 19V5\" />\n </svg>\n );\n}\n\n/** lucide `arrow-down` — the swipe deck's down edge. */\nexport function ArrowDownIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-down\", props)}>\n <path d=\"M12 5v14\" />\n <path d=\"m19 12-7 7-7-7\" />\n </svg>\n );\n}\n\n/** lucide `undo-2` — take back the last change. */\nexport function Undo2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"undo-2\", props)}>\n <path d=\"M9 14 4 9l5-5\" />\n <path d=\"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11\" />\n </svg>\n );\n}\n\n/** lucide `eraser` — forget a marked part. */\nexport function EraserIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"eraser\", props)}>\n <path d=\"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21\" />\n <path d=\"M22 21H7\" />\n <path d=\"m5 11 9 9\" />\n </svg>\n );\n}\n\n/** lucide `rotate-cw` — reload. */\nexport function RotateCwIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"rotate-cw\", 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(\"globe\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20\" />\n <path d=\"M2 12h20\" />\n </svg>\n );\n}\n\n/** lucide `calendar` — the date field's glyph. */\nexport function CalendarIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"calendar\", props)}>\n <path d=\"M8 2v4\" />\n <path d=\"M16 2v4\" />\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"4\" rx=\"2\" />\n <path d=\"M3 10h18\" />\n </svg>\n );\n}\n\n/** lucide `clock` — the time field's glyph. */\nexport function ClockIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"clock\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <polyline points=\"12 6 12 12 16 14\" />\n </svg>\n );\n}\n\n/** lucide `refresh-cw` — retry / reload. */\nexport function RefreshCwIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"refresh-cw\", props)}>\n <path d=\"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\" />\n <path d=\"M21 3v5h-5\" />\n <path d=\"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\" />\n <path d=\"M8 16H3v5\" />\n </svg>\n );\n}\n\n/** lucide `triangle-alert` (alias `AlertTriangle`) — an error or warning. */\nexport function AlertTriangleIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"triangle-alert\", props)}>\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n </svg>\n );\n}\n\n/** lucide `circle-check` — a passing state. */\nexport function CircleCheckIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"circle-check\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"m16 9-5.5 5.5L8 12\" />\n </svg>\n );\n}\n\n/** lucide `circle-question-mark` (alias `CircleHelp`) — field help. */\nexport function CircleHelpIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"circle-question-mark\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n );\n}\n\n/** lucide `circle-x` — a failing state. */\nexport function CircleXIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"circle-x\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"m15 9-6 6\" />\n <path d=\"m9 9 6 6\" />\n </svg>\n );\n}\n\n/** lucide `info` — a row label's help glyph (controls `PropertyRow`). */\nexport function InfoIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"info\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4\" />\n <path d=\"M12 8h.01\" />\n </svg>\n );\n}\n\n/** lucide `circle-dot` — the \"Get help from Matrx AI\" button glyph (controls `HelpIcon`). */\nexport function CircleDotIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"circle-dot\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <circle cx=\"12\" cy=\"12\" r=\"1\" />\n </svg>\n );\n}\n\n/** lucide `copy` — the Peek's token chip (copy the exact token). */\nexport function CopyIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"copy\", props)}>\n <rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n <path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" />\n </svg>\n );\n}\n\n/** lucide `upload` (moved from @ai-matrx/media). */\nexport function UploadIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"upload\", props)}>\n <path d=\"M12 3v12\" />\n <path d=\"m17 8-5-5-5 5\" />\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n </svg>\n );\n}\n\n/** lucide `circle-alert` — an error or attention state. */\nexport function CircleAlertIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"circle-alert\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <line x1=\"12\" x2=\"12\" y1=\"8\" y2=\"12\" />\n <line x1=\"12\" x2=\"12.01\" y1=\"16\" y2=\"16\" />\n </svg>\n );\n}\n\n/** lucide `panel-right` — a side pane toggle. */\nexport function PanelRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"panel-right\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M15 3v18\" />\n </svg>\n );\n}\n\n/** lucide `bell` — notifications. */\nexport function BellIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"bell\", props)}>\n <path d=\"M10.268 21a2 2 0 0 0 3.464 0\" />\n <path d=\"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326\" />\n </svg>\n );\n}\n\n/** lucide `eye-off` — hidden. */\nexport function EyeOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"eye-off\", props)}>\n <path d=\"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\" />\n <path d=\"M14.084 14.158a3 3 0 0 1-4.242-4.242\" />\n <path d=\"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\" />\n <path d=\"m2 2 20 20\" />\n </svg>\n );\n}\n\n/** lucide `app-window` — open as a window. */\nexport function AppWindowIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"app-window\", props)}>\n <rect x=\"2\" y=\"4\" width=\"20\" height=\"16\" rx=\"2\" />\n <path d=\"M10 4v4\" />\n <path d=\"M2 8h20\" />\n <path d=\"M6 4v4\" />\n </svg>\n );\n}\n\n/** lucide `video` — a video call or clip. */\nexport function VideoIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"video\", props)}>\n <path d=\"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5\" />\n <rect x=\"2\" y=\"6\" width=\"14\" height=\"12\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `phone` — a voice call. */\nexport function PhoneIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"phone\", props)}>\n <path d=\"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384\" />\n </svg>\n );\n}\n\n/** lucide `sparkles` — AI. */\nexport function SparklesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sparkles\", props)}>\n <path d=\"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z\" />\n <path d=\"M20 2v4\" />\n <path d=\"M22 4h-4\" />\n <circle cx=\"4\" cy=\"20\" r=\"2\" />\n </svg>\n );\n}\n\n/** lucide `panels-top-left` — a layout. */\nexport function PanelsTopLeftIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"panels-top-left\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M3 9h18\" />\n <path d=\"M9 21V9\" />\n </svg>\n );\n}\n\n/** lucide `download`. */\nexport function DownloadIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"download\", props)}>\n <path d=\"M12 15V3\" />\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n <path d=\"m7 10 5 5 5-5\" />\n </svg>\n );\n}\n\n/** lucide `settings`. */\nexport function SettingsIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"settings\", props)}>\n <path d=\"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n );\n}\n\n/** lucide `users`. */\nexport function UsersIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"users\", props)}>\n <path d=\"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\" />\n <path d=\"M16 3.128a4 4 0 0 1 0 7.744\" />\n <path d=\"M22 21v-2a4 4 0 0 0-3-3.87\" />\n <circle cx=\"9\" cy=\"7\" r=\"4\" />\n </svg>\n );\n}\n\n/** lucide `grip-vertical` — a drag handle. */\nexport function GripVerticalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"grip-vertical\", props)}>\n <circle cx=\"9\" cy=\"12\" r=\"1\" />\n <circle cx=\"9\" cy=\"5\" r=\"1\" />\n <circle cx=\"9\" cy=\"19\" r=\"1\" />\n <circle cx=\"15\" cy=\"12\" r=\"1\" />\n <circle cx=\"15\" cy=\"5\" r=\"1\" />\n <circle cx=\"15\" cy=\"19\" r=\"1\" />\n </svg>\n );\n}\n\n/** lucide `history`. */\nexport function HistoryIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"history\", props)}>\n <path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\" />\n <path d=\"M3 3v5h5\" />\n <path d=\"M12 7v5l4 2\" />\n </svg>\n );\n}\n\n/** lucide `workflow`. */\nexport function WorkflowIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"workflow\", props)}>\n <rect width=\"8\" height=\"8\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M7 11v4a2 2 0 0 0 2 2h4\" />\n <rect width=\"8\" height=\"8\" x=\"13\" y=\"13\" rx=\"2\" />\n </svg>\n );\n}\n\n// ---- Glyphs consolidated from the packages above the design system (one glyph home). ----\n\n/** lucide `activities` (moved from @ai-matrx/meet). */\nexport function ActivitiesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"activities\", props)}>\n <path d=\"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z\" />\n <rect x=\"3\" y=\"14\" width=\"7\" height=\"7\" rx=\"1\" />\n <circle cx=\"17.5\" cy=\"17.5\" r=\"3.5\" />\n </svg>\n );\n}\n\n/** lucide `arrow-down-to-line` (moved from @ai-matrx/agents). */\nexport function ArrowDownToLineIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-down-to-line\", props)}>\n <path d=\"M12 17V3\" />\n <path d=\"m6 11 6 6 6-6\" />\n <path d=\"M19 21H5\" />\n </svg>\n );\n}\n\n/** lucide `arrow-left-right` (moved from @ai-matrx/diff). */\nexport function ArrowLeftRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-left-right\", props)}>\n <path d=\"M8 3 4 7l4 4\" />\n <path d=\"M4 7h16\" />\n <path d=\"m16 21 4-4-4-4\" />\n <path d=\"M20 17H4\" />\n </svg>\n );\n}\n\n/** lucide `arrow-left-to-line` (moved from @ai-matrx/summon). */\nexport function ArrowLeftToLineIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-left-to-line\", props)}>\n <path d=\"M3 19V5\" />\n <path d=\"m13 6-6 6 6 6\" />\n <path d=\"M7 12h14\" />\n </svg>\n );\n}\n\n/** lucide `atom` (moved from @ai-matrx/agents). */\nexport function AtomIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"atom\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"1\" />\n <path d=\"M20.2 20.2c2.04-2.03.02-7.36-4.5-11.9-4.54-4.52-9.87-6.54-11.9-4.5-2.04 2.03-.02 7.36 4.5 11.9 4.54 4.52 9.87 6.54 11.9 4.5Z\" />\n <path d=\"M15.7 15.7c4.52-4.54 6.54-9.87 4.5-11.9-2.03-2.04-7.36-.02-11.9 4.5-4.52 4.54-6.54 9.87-4.5 11.9 2.03 2.04 7.36.02 11.9-4.5Z\" />\n </svg>\n );\n}\n\n/** lucide `audio-lines` (moved from @ai-matrx/content-ir). */\nexport function AudioLinesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"audio-lines\", props)}>\n <path d=\"M2 10v3\" />\n <path d=\"M6 6v11\" />\n <path d=\"M10 3v18\" />\n <path d=\"M14 8v7\" />\n <path d=\"M18 5v13\" />\n <path d=\"M22 10v3\" />\n </svg>\n );\n}\n\n/** lucide `boxes` (moved from @ai-matrx/associations). */\nexport function BoxesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"boxes\", props)}>\n <path d=\"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z\" />\n <path d=\"m7 16.5-4.74-2.85\" />\n <path d=\"m7 16.5 5-3\" />\n <path d=\"M7 16.5v5.17\" />\n <path d=\"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z\" />\n <path d=\"m17 16.5-5-3\" />\n <path d=\"m17 16.5 4.74-2.85\" />\n <path d=\"M17 16.5v5.17\" />\n <path d=\"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z\" />\n <path d=\"M12 8 7.26 5.15\" />\n <path d=\"m12 8 4.74-2.85\" />\n <path d=\"M12 13.5V8\" />\n </svg>\n );\n}\n\n/** lucide `braces` (moved from @ai-matrx/media). */\nexport function BracesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"braces\", props)}>\n <path d=\"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1\" />\n <path d=\"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1\" />\n </svg>\n );\n}\n\n/** lucide `breakout` (moved from @ai-matrx/meet). */\nexport function BreakoutIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"breakout\", props)}>\n <rect width=\"7\" height=\"18\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"14\" rx=\"1\" />\n </svg>\n );\n}\n\n/** lucide `camera` (moved from @ai-matrx/meet). */\nexport function CameraIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"camera\", props)}>\n <path d=\"m23 7-7 5 7 5V7Z\" />\n <rect x=\"1\" y=\"5\" width=\"15\" height=\"14\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `camera-off` (moved from @ai-matrx/meet). */\nexport function CameraOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"camera-off\", props)}>\n <path d=\"M2 2l20 20\" />\n <path d=\"M10.66 5H14a2 2 0 0 1 2 2v3.34l1 1L23 7v10\" />\n <path d=\"M16 16a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h2\" />\n </svg>\n );\n}\n\n/** lucide `captions` (moved from @ai-matrx/meet). */\nexport function CaptionsIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"captions\", props)}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <path d=\"M10 10.5a2 2 0 1 0 0 3M16 10.5a2 2 0 1 0 0 3\" />\n </svg>\n );\n}\n\n/** lucide `chat-bubble` (moved from @ai-matrx/coding-sessions). */\nexport function ChatBubbleIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chat-bubble\", props)}>\n <path d=\"M20 12.5a7.5 7.5 0 0 1-10.9 6.7L4 20.5l1.3-4.6A7.5 7.5 0 1 1 20 12.5z\" />\n </svg>\n );\n}\n\n/** lucide `chat` (moved from @ai-matrx/meet). */\nexport function ChatIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chat\", props)}>\n <path d=\"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z\" />\n </svg>\n );\n}\n\n/** lucide `check-circle-2` (moved from @ai-matrx/media). */\nexport function CheckCircle2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"check-circle-2\", props)}>\n <path d=\"M21.801 10A10 10 0 1 1 17 3.335\" />\n <path d=\"m9 11 3 3L22 4\" />\n </svg>\n );\n}\n\n/** lucide `chevron-up` (moved from @ai-matrx/meet). */\nexport function ChevronUpIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevron-up\", props)}>\n <path d=\"m6 15 6-6 6 6\" />\n </svg>\n );\n}\n\n/** lucide `chevrons-down-up` (moved from @ai-matrx/diff). */\nexport function ChevronsDownUpIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevrons-down-up\", props)}>\n <path d=\"m7 20 5-5 5 5\" />\n <path d=\"m7 4 5 5 5-5\" />\n </svg>\n );\n}\n\n/** lucide `clock-3` (moved from @ai-matrx/diff). */\nexport function Clock3Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"clock-3\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 6v6h4\" />\n </svg>\n );\n}\n\n/** lucide `code-2` (moved from @ai-matrx/office). */\nexport function Code2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"code-2\", props)}>\n <path d=\"m18 16 4-4-4-4\" />\n <path d=\"m6 8-4 4 4 4\" />\n <path d=\"m14.5 4-5 16\" />\n </svg>\n );\n}\n\n/** lucide `code` (moved from @ai-matrx/media). */\nexport function CodeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"code\", props)}>\n <path d=\"m16 18 6-6-6-6\" />\n <path d=\"m8 6-6 6 6 6\" />\n </svg>\n );\n}\n\n/** lucide `columns-2` (moved from @ai-matrx/diff). */\nexport function Columns2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"columns-2\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M12 3v18\" />\n </svg>\n );\n}\n\n/** lucide `corner-down-right` (moved from @ai-matrx/associations). */\nexport function CornerDownRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"corner-down-right\", props)}>\n <polyline points=\"15 10 20 15 15 20\" />\n <path d=\"M4 4v7a4 4 0 0 0 4 4h12\" />\n </svg>\n );\n}\n\n/** lucide `database` (moved from @ai-matrx/media). */\nexport function DatabaseIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"database\", props)}>\n <ellipse cx=\"12\" cy=\"5\" rx=\"9\" ry=\"3\" />\n <path d=\"M3 5V19A9 3 0 0 0 21 19V5\" />\n <path d=\"M3 12A9 3 0 0 0 21 12\" />\n </svg>\n );\n}\n\n/** lucide `dock` (moved from @ai-matrx/canvas). */\nexport function DockIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"dock\", props)}>\n <path d=\"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6\" />\n <path d=\"M21 3 12 12\" />\n <path d=\"M12 6v6h6\" />\n </svg>\n );\n}\n\n/** lucide `expand` (moved from @ai-matrx/detail). */\nexport function ExpandIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"expand\", props)}>\n <path d=\"m15 15 6 6\" />\n <path d=\"m15 9 6-6\" />\n <path d=\"M21 16v5h-5\" />\n <path d=\"M21 8V3h-5\" />\n <path d=\"M3 16v5h5\" />\n <path d=\"m3 21 6-6\" />\n <path d=\"M3 8V3h5\" />\n <path d=\"M9 9 3 3\" />\n </svg>\n );\n}\n\n/** lucide `eye` (moved from @ai-matrx/agents). */\nexport function EyeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"eye\", props)}>\n <path d=\"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n );\n}\n\n/** lucide `file-archive` (moved from @ai-matrx/content-ir). */\nexport function FileArchiveIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-archive\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M10 6h1\" />\n <path d=\"M10 10h1\" />\n <circle cx=\"10\" cy=\"16\" r=\"2\" />\n <path d=\"M10 2v12\" />\n </svg>\n );\n}\n\n/** lucide `file-audio` (moved from @ai-matrx/media). */\nexport function FileAudioIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-audio\", props)}>\n <path d=\"M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0\" />\n </svg>\n );\n}\n\n/** lucide `file-code` (moved from @ai-matrx/media). */\nexport function FileCodeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-code\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M10 12.5 8 15l2 2.5\" />\n <path d=\"m14 12.5 2 2.5-2 2.5\" />\n </svg>\n );\n}\n\n/** lucide `file-json` (moved from @ai-matrx/media). */\nexport function FileJsonIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-json\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1\" />\n <path d=\"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1\" />\n </svg>\n );\n}\n\n/** lucide `file` (moved from @ai-matrx/media). */\nexport function FilePageIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n </svg>\n );\n}\n\n/** lucide `file-plus` (moved from @ai-matrx/content-ir). */\nexport function FilePlusIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-plus\", props)}>\n <path d=\"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4\" />\n <path d=\"M14 2v4a2 2 0 0 0 2 2h4\" />\n <path d=\"M3 15h6\" />\n <path d=\"M6 12v6\" />\n </svg>\n );\n}\n\n/** lucide `file-spreadsheet` (moved from @ai-matrx/media). */\nexport function FileSpreadsheetIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-spreadsheet\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M8 13h2\" />\n <path d=\"M14 13h2\" />\n <path d=\"M8 17h2\" />\n <path d=\"M14 17h2\" />\n </svg>\n );\n}\n\n/** lucide `file-text` (moved from @ai-matrx/media). */\nexport function FileTextIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-text\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M10 9H8\" />\n <path d=\"M16 13H8\" />\n <path d=\"M16 17H8\" />\n </svg>\n );\n}\n\n/** lucide `file-type` (moved from @ai-matrx/media). */\nexport function FileTypeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-type\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M11 18h2\" />\n <path d=\"M12 12v6\" />\n <path d=\"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5\" />\n </svg>\n );\n}\n\n/** lucide `file-video` (moved from @ai-matrx/media). */\nexport function FileVideoIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-video\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z\" />\n </svg>\n );\n}\n\n/** lucide `film` (moved from @ai-matrx/content-ir). */\nexport function FilmIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"film\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M7 3v18\" />\n <path d=\"M3 7.5h4\" />\n <path d=\"M3 12h18\" />\n <path d=\"M3 16.5h4\" />\n <path d=\"M17 3v18\" />\n <path d=\"M17 7.5h4\" />\n <path d=\"M17 16.5h4\" />\n </svg>\n );\n}\n\n/** lucide `flag` (moved from @ai-matrx/meet). */\nexport function FlagIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"flag\", props)}>\n <path d=\"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z\" />\n <line x1=\"4\" x2=\"4\" y1=\"22\" y2=\"15\" />\n </svg>\n );\n}\n\n/** lucide `flip-horizontal-2` (moved from @ai-matrx/capture). */\nexport function FlipHorizontal2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"flip-horizontal-2\", props)}>\n <path d=\"m3 7 5 5-5 5V7\" />\n <path d=\"m21 7-5 5 5 5V7\" />\n <path d=\"M12 20v2\" />\n <path d=\"M12 14v2\" />\n <path d=\"M12 8v2\" />\n <path d=\"M12 2v2\" />\n </svg>\n );\n}\n\n/** lucide `fold-vertical` (moved from @ai-matrx/diff). */\nexport function FoldVerticalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"fold-vertical\", props)}>\n <path d=\"M12 22v-6\" />\n <path d=\"M12 8V2\" />\n <path d=\"M4 12H2\" />\n <path d=\"M10 12H8\" />\n <path d=\"M16 12h-2\" />\n <path d=\"M22 12h-2\" />\n <path d=\"m15 19-3-3-3 3\" />\n <path d=\"m15 5-3 3-3-3\" />\n </svg>\n );\n}\n\n/** lucide `folder` (moved from @ai-matrx/media). */\nexport function FolderIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"folder\", props)}>\n <path d=\"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z\" />\n </svg>\n );\n}\n\n/** lucide `folder-open` (moved from @ai-matrx/media). */\nexport function FolderOpenIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"folder-open\", props)}>\n <path d=\"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2\" />\n </svg>\n );\n}\n\n/** lucide `git-merge` (moved from @ai-matrx/diff). */\nexport function GitMergeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"git-merge\", props)}>\n <circle cx=\"18\" cy=\"18\" r=\"3\" />\n <circle cx=\"6\" cy=\"6\" r=\"3\" />\n <path d=\"M6 21V9a9 9 0 0 0 9 9\" />\n </svg>\n );\n}\n\n/** lucide `graduation-cap` (moved from @ai-matrx/office). */\nexport function GraduationCapIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"graduation-cap\", props)}>\n <path d=\"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z\" />\n <path d=\"M22 10v6\" />\n <path d=\"M6 12.5V16a6 3 0 0 0 12 0v-3.5\" />\n </svg>\n );\n}\n\n/** lucide `grid-3x-3` (moved from @ai-matrx/capture). */\nexport function Grid3x3Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"grid-3x-3\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M3 9h18\" />\n <path d=\"M3 15h18\" />\n <path d=\"M9 3v18\" />\n <path d=\"M15 3v18\" />\n </svg>\n );\n}\n\n/** lucide `grip` (moved from @ai-matrx/capture). */\nexport function GripIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"grip\", props)}>\n <circle cx=\"12\" cy=\"5\" r=\"1\" />\n <circle cx=\"19\" cy=\"5\" r=\"1\" />\n <circle cx=\"5\" cy=\"5\" r=\"1\" />\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 <circle cx=\"12\" cy=\"19\" r=\"1\" />\n <circle cx=\"19\" cy=\"19\" r=\"1\" />\n <circle cx=\"5\" cy=\"19\" r=\"1\" />\n </svg>\n );\n}\n\n/** lucide `grip-resize` (moved from @ai-matrx/associations). */\nexport function GripResizeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"grip-resize\", props)}>\n <path d=\"M21 15 15 21\" />\n <path d=\"M21 20 20 21\" />\n </svg>\n );\n}\n\n/** lucide `hammer` (moved from @ai-matrx/agents). */\nexport function HammerIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"hammer\", props)}>\n <path d=\"m15 12-8.5 8.5c-.83.83-2.17.83-3 0 0 0 0 0 0 0a2.12 2.12 0 0 1 0-3L12 9\" />\n <path d=\"M17.64 15 22 10.64\" />\n <path d=\"m20.91 11.7-1.25-1.25c-.6-.6-.93-1.4-.93-2.25v-.86L16.01 4.6a5.56 5.56 0 0 0-3.94-1.64H9l.92.82A6.18 6.18 0 0 1 12 8.4v1.56l2 2h2.47l2.26 1.91\" />\n </svg>\n );\n}\n\n/** lucide `hand` (moved from @ai-matrx/meet). */\nexport function HandIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"hand\", props)}>\n <path d=\"M18 11V6a2 2 0 0 0-4 0v5\" />\n <path d=\"M14 10V4a2 2 0 0 0-4 0v7\" />\n <path d=\"M10 10.5V6a2 2 0 0 0-4 0v8\" />\n <path d=\"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2a8 8 0 0 1-8-8v-1a2 2 0 1 1 4 0\" />\n </svg>\n );\n}\n\n/** lucide `handoff` (moved from @ai-matrx/coding-sessions). */\nexport function HandoffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"handoff\", props)}>\n <path d=\"M5 12h12M13 7l5 5-5 5\" />\n <path d=\"M5 5v14\" />\n </svg>\n );\n}\n\n/** lucide `hash` (moved from @ai-matrx/diff). */\nexport function HashIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"hash\", props)}>\n <path d=\"M4 9h16\" />\n <path d=\"M4 15h16\" />\n <path d=\"M10 3 8 21\" />\n <path d=\"M16 3l-2 18\" />\n </svg>\n );\n}\n\n/** lucide `highlighter` (moved from @ai-matrx/diff). */\nexport function HighlighterIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"highlighter\", props)}>\n <path d=\"m9 11-6 6v3h9l3-3\" />\n <path d=\"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4\" />\n </svg>\n );\n}\n\n/** lucide `image` (moved from @ai-matrx/media). */\nexport function ImageIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"image\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" ry=\"2\" />\n <circle cx=\"9\" cy=\"9\" r=\"2\" />\n <path d=\"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21\" />\n </svg>\n );\n}\n\n/** lucide `image-off` (moved from @ai-matrx/media). */\nexport function ImageOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"image-off\", props)}>\n <line x1=\"2\" x2=\"22\" y1=\"2\" y2=\"22\" />\n <path d=\"M10.41 10.41a2 2 0 1 1-2.83-2.83\" />\n <line x1=\"13.5\" x2=\"6\" y1=\"13.5\" y2=\"21\" />\n <line x1=\"18\" x2=\"21\" y1=\"12\" y2=\"15\" />\n <path d=\"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59\" />\n <path d=\"M21 15V5a2 2 0 0 0-2-2H9\" />\n </svg>\n );\n}\n\n/** lucide `images` (moved from @ai-matrx/capture). */\nexport function ImagesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"images\", props)}>\n <path d=\"m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16\" />\n <path d=\"M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2\" />\n <circle cx=\"13\" cy=\"7\" r=\"1\" fill=\"currentColor\" />\n <rect x=\"8\" y=\"2\" width=\"14\" height=\"14\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `keyboard` (moved from @ai-matrx/meet). */\nexport function KeyboardIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"keyboard\", props)}>\n <path d=\"M10 8h.01M12 12h.01M14 8h.01M16 12h.01M18 8h.01M6 8h.01M7 16h10M8 12h.01\" />\n <rect width=\"20\" height=\"16\" x=\"2\" y=\"4\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `languages` (moved from @ai-matrx/agents). */\nexport function LanguagesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"languages\", props)}>\n <path d=\"m5 8 6 6\" />\n <path d=\"m4 14 6-6 2-3\" />\n <path d=\"M2 5h12\" />\n <path d=\"M7 2h1\" />\n <path d=\"m22 22-5-10-5 10\" />\n <path d=\"M14 18h6\" />\n </svg>\n );\n}\n\n/** lucide `layers` (moved from @ai-matrx/agents). */\nexport function LayersIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"layers\", props)}>\n <path d=\"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z\" />\n <path d=\"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12\" />\n <path d=\"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17\" />\n </svg>\n );\n}\n\n/** lucide `layout-grid` (moved from @ai-matrx/canvas). */\nexport function LayoutGridIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"layout-grid\", props)}>\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"14\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"14\" rx=\"1\" />\n </svg>\n );\n}\n\n/** lucide `link-2` (moved from @ai-matrx/media). */\nexport function Link2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"link-2\", props)}>\n <path d=\"M9 17H7A5 5 0 0 1 7 7h2\" />\n <path d=\"M15 7h2a5 5 0 1 1 0 10h-2\" />\n <line x1=\"8\" x2=\"16\" y1=\"12\" y2=\"12\" />\n </svg>\n );\n}\n\n/** lucide `list-checks` (moved from @ai-matrx/diff). */\nexport function ListChecksIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"list-checks\", props)}>\n <path d=\"m3 17 2 2 4-4\" />\n <path d=\"m3 7 2 2 4-4\" />\n <path d=\"M13 6h8\" />\n <path d=\"M13 12h8\" />\n <path d=\"M13 18h8\" />\n </svg>\n );\n}\n\n/** lucide `list` (moved from @ai-matrx/diff). */\nexport function ListIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"list\", props)}>\n <path d=\"M3 12h.01\" />\n <path d=\"M3 18h.01\" />\n <path d=\"M3 6h.01\" />\n <path d=\"M8 12h13\" />\n <path d=\"M8 18h13\" />\n <path d=\"M8 6h13\" />\n </svg>\n );\n}\n\n/** lucide `maximize` (moved from @ai-matrx/content-ir). */\nexport function MaximizeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"maximize\", props)}>\n <polyline points=\"15 3 21 3 21 9\" />\n <polyline points=\"9 21 3 21 3 15\" />\n <line x1=\"21\" x2=\"14\" y1=\"3\" y2=\"10\" />\n <line x1=\"3\" x2=\"10\" y1=\"21\" y2=\"14\" />\n </svg>\n );\n}\n\n/** lucide `megaphone` (moved from @ai-matrx/office). */\nexport function MegaphoneIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"megaphone\", props)}>\n <path d=\"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z\" />\n <path d=\"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14\" />\n <path d=\"M8 6v8\" />\n </svg>\n );\n}\n\n/** lucide `message-square-warning` (moved from @ai-matrx/office). */\nexport function MessageSquareWarningIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"message-square-warning\", props)}>\n <path d=\"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z\" />\n <path d=\"M12 15h.01\" />\n <path d=\"M12 7v4\" />\n </svg>\n );\n}\n\n/** lucide `mic` (moved from @ai-matrx/meet). */\nexport function MicIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"mic\", props)}>\n <path d=\"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z\" />\n <path d=\"M19 10v2a7 7 0 0 1-14 0v-2\" />\n <path d=\"M12 19v3\" />\n </svg>\n );\n}\n\n/** lucide `mic-off` (moved from @ai-matrx/meet). */\nexport function MicOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"mic-off\", props)}>\n <path d=\"M2 2l20 20\" />\n <path d=\"M9 9v3a3 3 0 0 0 5.12 2.12\" />\n <path d=\"M15 9.34V5a3 3 0 0 0-5.94-.6\" />\n <path d=\"M19 10v2a7 7 0 0 1-.11 1.23M5 10v2a7 7 0 0 0 11 5.66\" />\n <path d=\"M12 19v3\" />\n </svg>\n );\n}\n\n/** lucide `monitor` (moved from @ai-matrx/coding-sessions). */\nexport function MonitorIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"monitor\", props)}>\n <rect x=\"3\" y=\"4.5\" width=\"18\" height=\"12\" rx=\"2\" />\n <path d=\"M8.5 20h7M12 16.5V20\" />\n </svg>\n );\n}\n\n/** lucide `moon` (moved from @ai-matrx/coding-sessions). */\nexport function MoonIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"moon\", props)}>\n <path d=\"M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5z\" />\n </svg>\n );\n}\n\n/** lucide `music` (moved from @ai-matrx/media). */\nexport function MusicIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"music\", props)}>\n <path d=\"M9 18V5l12-2v13\" />\n <circle cx=\"6\" cy=\"18\" r=\"3\" />\n <circle cx=\"18\" cy=\"16\" r=\"3\" />\n </svg>\n );\n}\n\n/** lucide `notes` (moved from @ai-matrx/meet). */\nexport function NotesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"notes\", props)}>\n <path d=\"M4 20l1-4L16.5 4.5a2.1 2.1 0 0 1 3 3L8 19l-4 1Z\" />\n <path d=\"M14 7l3 3\" />\n </svg>\n );\n}\n\n/** lucide `package-box` (moved from @ai-matrx/media). */\nexport function PackageBoxIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"package-box\", props)}>\n <path d=\"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z\" />\n <path d=\"M12 22V12\" />\n <polyline points=\"3.29 7 12 12 20.71 7\" />\n <path d=\"m7.5 4.27 9 5.15\" />\n </svg>\n );\n}\n\n/** lucide `page` (moved from @ai-matrx/canvas). */\nexport function PageIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"page\", props)}>\n <rect x=\"4\" y=\"4\" width=\"16\" height=\"16\" rx=\"2\" />\n <path d=\"M8 9h8\" />\n <path d=\"M8 13h8\" />\n <path d=\"M8 17h5\" />\n </svg>\n );\n}\n\n/** lucide `panel-left-close` (moved from @ai-matrx/summon). */\nexport function PanelLeftCloseIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"panel-left-close\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M9 3v18\" />\n <path d=\"m16 15-3-3 3-3\" />\n </svg>\n );\n}\n\n/** lucide `pause` (moved from @ai-matrx/media). */\nexport function PauseIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"pause\", props)}>\n <rect x=\"14\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n <rect x=\"5\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n </svg>\n );\n}\n\n/** lucide `pen-tool` (moved from @ai-matrx/media). */\nexport function PenToolIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"pen-tool\", props)}>\n <path d=\"M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z\" />\n <path d=\"m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18\" />\n <path d=\"m2.3 2.3 7.286 7.286\" />\n <circle cx=\"11\" cy=\"11\" r=\"2\" />\n </svg>\n );\n}\n\n/** lucide `people` (moved from @ai-matrx/meet). */\nexport function PeopleIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"people\", props)}>\n <path d=\"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\" />\n <circle cx=\"9\" cy=\"7\" r=\"4\" />\n <path d=\"M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75\" />\n </svg>\n );\n}\n\n/** lucide `phone-off` (moved from @ai-matrx/meet). */\nexport function PhoneOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"phone-off\", props)}>\n <path d=\"M12 9c-1.6 0-3.15.25-4.6.72v3.1c0 .39-.23.74-.56.9-.98.49-1.87 1.12-2.66 1.85-.18.18-.43.28-.7.28-.28 0-.53-.11-.71-.29L.29 13.08a.99.99 0 0 1-.29-.7c0-.28.11-.53.29-.71C3.34 8.78 7.46 7 12 7s8.66 1.78 11.71 4.67c.18.18.29.43.29.71 0 .28-.11.53-.29.71l-2.48 2.48c-.18.18-.43.29-.71.29-.27 0-.52-.11-.7-.28a11.27 11.27 0 0 0-2.67-1.85.996.996 0 0 1-.56-.9v-3.1C15.15 9.25 13.6 9 12 9Z\" fill=\"currentColor\" stroke=\"none\" />\n </svg>\n );\n}\n\n/** lucide `play` (moved from @ai-matrx/media). */\nexport function PlayIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"play\", props)}>\n <path d=\"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z\" />\n </svg>\n );\n}\n\n/** lucide `poll` (moved from @ai-matrx/meet). */\nexport function PollIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"poll\", props)}>\n <line x1=\"18\" x2=\"18\" y1=\"20\" y2=\"10\" />\n <line x1=\"12\" x2=\"12\" y1=\"20\" y2=\"4\" />\n <line x1=\"6\" x2=\"6\" y1=\"20\" y2=\"14\" />\n </svg>\n );\n}\n\n/** lucide `proportions` (moved from @ai-matrx/capture). */\nexport function ProportionsIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"proportions\", props)}>\n <rect width=\"20\" height=\"16\" x=\"2\" y=\"4\" rx=\"2\" />\n <path d=\"M12 9v11\" />\n <path d=\"M2 9h13a2 2 0 0 1 2 2v9\" />\n </svg>\n );\n}\n\n/** lucide `puzzle` (moved from @ai-matrx/office). */\nexport function PuzzleIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"puzzle\", props)}>\n <path d=\"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z\" />\n </svg>\n );\n}\n\n/** lucide `question` (moved from @ai-matrx/meet). */\nexport function QuestionIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"question\", props)}>\n <path d=\"M7.9 20A9 9 0 1 0 4 16.1L2 22Z\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n );\n}\n\n/** lucide `record` (moved from @ai-matrx/meet). */\nexport function RecordIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"record\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"8\" fill=\"currentColor\" stroke=\"none\" />\n </svg>\n );\n}\n\n/** lucide `rectangle-vertical` (moved from @ai-matrx/summon). */\nexport function RectangleVerticalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"rectangle-vertical\", props)}>\n <rect width=\"12\" height=\"20\" x=\"6\" y=\"2\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `restore` (moved from @ai-matrx/associations). */\nexport function RestoreIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"restore\", props)}>\n <path d=\"M4 14h6v6\" />\n <path d=\"M20 10h-6V4\" />\n <path d=\"M14 10l7-7\" />\n <path d=\"M3 21l7-7\" />\n </svg>\n );\n}\n\n/** lucide `rotate-ccw` (moved from @ai-matrx/capture). */\nexport function RotateCcwIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"rotate-ccw\", props)}>\n <path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\" />\n <path d=\"M3 3v5h5\" />\n </svg>\n );\n}\n\n/** lucide `rows-3` (moved from @ai-matrx/diff). */\nexport function Rows3Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"rows-3\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M21 9H3\" />\n <path d=\"M21 15H3\" />\n </svg>\n );\n}\n\n/** lucide `save` (moved from @ai-matrx/summon). */\nexport function SaveIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"save\", props)}>\n <path d=\"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z\" />\n <path d=\"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7\" />\n <path d=\"M7 3v4a1 1 0 0 0 1 1h7\" />\n </svg>\n );\n}\n\n/** lucide `scale` (moved from @ai-matrx/agents). */\nexport function ScaleIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"scale\", props)}>\n <path d=\"M12 3v18\" />\n <path d=\"m19 8 3 8a5 5 0 0 1-6 0zV7\" />\n <path d=\"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1\" />\n <path d=\"m5 8 3 8a5 5 0 0 1-6 0zV7\" />\n <path d=\"M7 21h10\" />\n </svg>\n );\n}\n\n/** lucide `screen-share` (moved from @ai-matrx/meet). */\nexport function ScreenShareIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"screen-share\", props)}>\n <rect x=\"2\" y=\"3\" width=\"20\" height=\"14\" rx=\"2\" />\n <path d=\"M8 21h8M12 17v4\" />\n <path d=\"M12 13V8m0 0-2.5 2.5M12 8l2.5 2.5\" />\n </svg>\n );\n}\n\n/** lucide `server` (moved from @ai-matrx/agents). */\nexport function ServerIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"server\", props)}>\n <rect width=\"20\" height=\"8\" x=\"2\" y=\"2\" rx=\"2\" ry=\"2\" />\n <rect width=\"20\" height=\"8\" x=\"2\" y=\"14\" rx=\"2\" ry=\"2\" />\n <line x1=\"6\" x2=\"6.01\" y1=\"6\" y2=\"6\" />\n <line x1=\"6\" x2=\"6.01\" y1=\"18\" y2=\"18\" />\n </svg>\n );\n}\n\n/** lucide `settings-2` (moved from @ai-matrx/media). */\nexport function Settings2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"settings-2\", props)}>\n <path d=\"M20 7h-9\" />\n <path d=\"M14 17H5\" />\n <circle cx=\"17\" cy=\"17\" r=\"3\" />\n <circle cx=\"7\" cy=\"7\" r=\"3\" />\n </svg>\n );\n}\n\n/** lucide `share-2` (moved from @ai-matrx/media). */\nexport function Share2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"share-2\", props)}>\n <circle cx=\"18\" cy=\"5\" r=\"3\" />\n <circle cx=\"6\" cy=\"12\" r=\"3\" />\n <circle cx=\"18\" cy=\"19\" r=\"3\" />\n <line x1=\"8.59\" x2=\"15.42\" y1=\"13.51\" y2=\"17.49\" />\n <line x1=\"15.41\" x2=\"8.59\" y1=\"6.51\" y2=\"10.49\" />\n </svg>\n );\n}\n\n/** lucide `shield-alert` (moved from @ai-matrx/detail). */\nexport function ShieldAlertIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"shield-alert\", props)}>\n <path d=\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\" />\n <path d=\"M12 8v4\" />\n <path d=\"M12 16h.01\" />\n </svg>\n );\n}\n\n/** lucide `shield-check` (moved from @ai-matrx/detail). */\nexport function ShieldCheckIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"shield-check\", props)}>\n <path d=\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\" />\n <path d=\"m9 12 2 2 4-4\" />\n </svg>\n );\n}\n\n/** lucide `badge-check` — the verified mark. */\nexport function BadgeCheckIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"badge-check\", props)}>\n <path d=\"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z\" />\n <path d=\"m9 12 2 2 4-4\" />\n </svg>\n );\n}\n\n/** lucide `shield` (moved from @ai-matrx/agents). */\nexport function ShieldIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"shield\", props)}>\n <path d=\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\" />\n </svg>\n );\n}\n\n/** lucide `sidebar` (moved from @ai-matrx/coding-sessions). */\nexport function SidebarIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sidebar\", props)}>\n <rect x=\"3.5\" y=\"4.5\" width=\"17\" height=\"15\" rx=\"2.5\" />\n <path d=\"M9.5 4.5v15\" />\n </svg>\n );\n}\n\n/** lucide `sliders-horizontal` (moved from @ai-matrx/agents). */\nexport function SlidersHorizontalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sliders-horizontal\", props)}>\n <path d=\"M10 5H3\" />\n <path d=\"M12 19H3\" />\n <path d=\"M14 3v4\" />\n <path d=\"M16 17v4\" />\n <path d=\"M21 12h-9\" />\n <path d=\"M21 19h-5\" />\n <path d=\"M21 5h-7\" />\n <path d=\"M8 10v4\" />\n <path d=\"M8 12H3\" />\n </svg>\n );\n}\n\n/** lucide `smile` (moved from @ai-matrx/meet). */\nexport function SmileIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"smile\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M8 14s1.5 2 4 2 4-2 4-2\" />\n <line x1=\"9\" x2=\"9.01\" y1=\"9\" y2=\"9\" />\n <line x1=\"15\" x2=\"15.01\" y1=\"9\" y2=\"9\" />\n </svg>\n );\n}\n\n/** lucide `speaker` (moved from @ai-matrx/meet). */\nexport function SpeakerIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"speaker\", props)}>\n <path d=\"M11 5 6 9H2v6h4l5 4V5Z\" />\n <path d=\"M15.54 8.46a5 5 0 0 1 0 7.07\" />\n <path d=\"M19.07 4.93a10 10 0 0 1 0 14.14\" />\n </svg>\n );\n}\n\n/** lucide `split-down` (moved from @ai-matrx/canvas). */\nexport function SplitDownIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"split-down\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M3 12h18\" />\n </svg>\n );\n}\n\n/** lucide `spotlight` (moved from @ai-matrx/meet). */\nexport function SpotlightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"spotlight\", props)}>\n <path d=\"M12 2 15 8.5 22 9.3 17 14 18.2 21 12 17.6 5.8 21 7 14 2 9.3 9 8.5Z\" />\n </svg>\n );\n}\n\n/** lucide `stop` (moved from @ai-matrx/coding-sessions). */\nexport function StopIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"stop\", props)}>\n <rect x=\"6\" y=\"6\" width=\"12\" height=\"12\" rx=\"2\" fill=\"currentColor\" stroke=\"none\" />\n </svg>\n );\n}\n\n/** lucide `subtitles` (moved from @ai-matrx/media). */\nexport function SubtitlesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"subtitles\", props)}>\n <rect width=\"18\" height=\"14\" x=\"3\" y=\"5\" rx=\"2\" ry=\"2\" />\n <path d=\"M7 15h4M15 15h2M7 11h2M13 11h4\" />\n </svg>\n );\n}\n\n/** lucide `sun` (moved from @ai-matrx/coding-sessions). */\nexport function SunIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sun\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d=\"M12 2.5v2M12 19.5v2M4.2 4.2l1.4 1.4M18.4 18.4l1.4 1.4M2.5 12h2M19.5 12h2M4.2 19.8l1.4-1.4M18.4 5.6l1.4-1.4\" />\n </svg>\n );\n}\n\n/** lucide `sun-medium` (moved from @ai-matrx/capture). */\nexport function SunMediumIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sun-medium\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d=\"M12 3v1\" />\n <path d=\"M12 20v1\" />\n <path d=\"M3 12h1\" />\n <path d=\"M20 12h1\" />\n <path d=\"m18.364 5.636-.707.707\" />\n <path d=\"m6.343 17.657-.707.707\" />\n <path d=\"m5.636 5.636.707.707\" />\n <path d=\"m17.657 17.657.707.707\" />\n </svg>\n );\n}\n\n/** lucide `tag` (moved from @ai-matrx/associations). */\nexport function TagIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"tag\", props)}>\n <path d=\"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z\" />\n <circle cx=\"7.5\" cy=\"7.5\" r=\".5\" fill=\"currentColor\" />\n </svg>\n );\n}\n\n/** lucide `timer` (moved from @ai-matrx/capture). */\nexport function TimerIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"timer\", props)}>\n <line x1=\"10\" x2=\"14\" y1=\"2\" y2=\"2\" />\n <line x1=\"12\" x2=\"15\" y1=\"14\" y2=\"11\" />\n <circle cx=\"12\" cy=\"14\" r=\"8\" />\n </svg>\n );\n}\n\n/** lucide `type` (moved from @ai-matrx/agents). */\nexport function TypeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"type\", props)}>\n <path d=\"M12 4v16\" />\n <path d=\"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2\" />\n <path d=\"M9 20h6\" />\n </svg>\n );\n}\n\n/** lucide `unfold-vertical` (moved from @ai-matrx/diff). */\nexport function UnfoldVerticalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"unfold-vertical\", props)}>\n <path d=\"M12 22v-6\" />\n <path d=\"M12 8V2\" />\n <path d=\"M4 12H2\" />\n <path d=\"M10 12H8\" />\n <path d=\"M16 12h-2\" />\n <path d=\"M22 12h-2\" />\n <path d=\"m15 19-3 3-3-3\" />\n <path d=\"m15 5-3-3-3 3\" />\n </svg>\n );\n}\n\n/** lucide `unlink` (moved from @ai-matrx/agents). */\nexport function UnlinkIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"unlink\", props)}>\n <path d=\"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71\" />\n <path d=\"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71\" />\n <line x1=\"8\" x2=\"8\" y1=\"2\" y2=\"5\" />\n <line x1=\"2\" x2=\"5\" y1=\"8\" y2=\"8\" />\n <line x1=\"16\" x2=\"16\" y1=\"19\" y2=\"22\" />\n <line x1=\"19\" x2=\"22\" y1=\"16\" y2=\"16\" />\n </svg>\n );\n}\n\n/** lucide `upvote` (moved from @ai-matrx/meet). */\nexport function UpvoteIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"upvote\", props)}>\n <path d=\"M9 18v-6H5l7-7 7 7h-4v6H9z\" />\n </svg>\n );\n}\n\n/** lucide `variable` (moved from @ai-matrx/agents). */\nexport function VariableIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"variable\", props)}>\n <path d=\"M8 21s-4-3-4-9 4-9 4-9\" />\n <path d=\"M16 3s4 3 4 9-4 9-4 9\" />\n <line x1=\"15\" x2=\"9\" y1=\"9\" y2=\"15\" />\n <line x1=\"9\" x2=\"15\" y1=\"9\" y2=\"15\" />\n </svg>\n );\n}\n\n/** lucide `video-off` (moved from @ai-matrx/media). */\nexport function VideoOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"video-off\", props)}>\n <path d=\"M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196\" />\n <path d=\"M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2\" />\n <path d=\"m2 2 20 20\" />\n </svg>\n );\n}\n\n/** lucide `volume-x` (moved from @ai-matrx/media). */\nexport function VolumeXIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"volume-x\", props)}>\n <path d=\"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\" />\n <line x1=\"22\" x2=\"16\" y1=\"9\" y2=\"15\" />\n <line x1=\"16\" x2=\"22\" y1=\"9\" y2=\"15\" />\n </svg>\n );\n}\n\n/** lucide `webhook` (moved from @ai-matrx/agents). */\nexport function WebhookIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"webhook\", props)}>\n <path d=\"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2\" />\n <path d=\"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06\" />\n <path d=\"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8\" />\n </svg>\n );\n}\n\n/** lucide `whiteboard` (moved from @ai-matrx/meet). */\nexport function WhiteboardIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"whiteboard\", props)}>\n <path d=\"M2 3h20\" />\n <path d=\"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3\" />\n <path d=\"m7 21 5-5 5 5\" />\n </svg>\n );\n}\n\n/** lucide `wifi-low` (moved from @ai-matrx/meet). */\nexport function WifiLowIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"wifi-low\", props)}>\n <path d=\"M12 20h.01\" />\n <path d=\"M8.5 16.5a5 5 0 0 1 7 0\" />\n </svg>\n );\n}\n\n/** lucide `wrap-text` (moved from @ai-matrx/diff). */\nexport function WrapTextIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"wrap-text\", props)}>\n <path d=\"M3 6h18\" />\n <path d=\"M3 12h15a3 3 0 1 1 0 6h-4\" />\n <path d=\"m16 16-2 2 2 2\" />\n <path d=\"M3 18h7\" />\n </svg>\n );\n}\n\n/** lucide `wrench` (moved from @ai-matrx/agents). */\nexport function WrenchIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"wrench\", props)}>\n <path d=\"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z\" />\n </svg>\n );\n}\n\n/** lucide `youtube` (moved from @ai-matrx/agents). */\nexport function YoutubeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"youtube\", props)}>\n <path d=\"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17\" />\n <path d=\"m10 15 5-3-5-3z\" />\n </svg>\n );\n}\n\n/** lucide `zap` (moved from @ai-matrx/capture). */\nexport function ZapIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"zap\", props)}>\n <path d=\"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z\" />\n </svg>\n );\n}\n\n/** lucide `zap-off` (moved from @ai-matrx/capture). */\nexport function ZapOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"zap-off\", props)}>\n <path d=\"M10.513 4.856 13.12 2.17a.5.5 0 0 1 .86.46l-1.377 4.317\" />\n <path d=\"M15.656 10H20a1 1 0 0 1 .78 1.63l-1.72 1.773\" />\n <path d=\"M16.273 16.273 10.88 21.83a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14H4a1 1 0 0 1-.78-1.63l4.507-4.643\" />\n <path d=\"m2 2 20 20\" />\n </svg>\n );\n}\n\n/** lucide `log-in` — the sign-in action of the auth gate. */\nexport function LogInIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"log-in\", props)}>\n <path d=\"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4\" />\n <polyline points=\"10 17 15 12 10 7\" />\n <line x1=\"15\" x2=\"3\" y1=\"12\" y2=\"12\" />\n </svg>\n );\n}\n\n/** lucide `gem` — the create-account action of the auth gate. */\nexport function GemIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"gem\", props)}>\n <path d=\"M6 3h12l4 6-10 13L2 9Z\" />\n <path d=\"M11 3 8 9l4 13 4-13-3-6\" />\n <path d=\"M2 9h20\" />\n </svg>\n );\n}\n\n/** lucide `key`. */\nexport function KeyIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"key\", props)}>\n <path d=\"m2 21 9.6-9.6\" />\n <path d=\"m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19\" />\n <circle cx=\"15.5\" cy=\"7.5\" r=\"5.5\" />\n </svg>\n );\n}\n\n/** lucide `credit-card`. */\nexport function CreditCardIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"credit-card\", props)}>\n <rect width=\"20\" height=\"14\" x=\"2\" y=\"5\" rx=\"2\" />\n <line x1=\"2\" x2=\"22\" y1=\"10\" y2=\"10\" />\n <path d=\"M6 14h2\" />\n </svg>\n );\n}\n\n/** lucide `user-round`. */\nexport function UserRoundIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"user-round\", props)}>\n <circle cx=\"12\" cy=\"8\" r=\"5\" />\n <path d=\"M20 21a8 8 0 0 0-16 0\" />\n </svg>\n );\n}\n\n/** lucide `user`. */\nexport function UserIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"user\", props)}>\n <path d=\"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\" />\n <circle cx=\"12\" cy=\"7\" r=\"4\" />\n </svg>\n );\n}\n\n/** lucide `terminal`. */\nexport function TerminalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"terminal\", props)}>\n <path d=\"M12 19h8\" />\n <path d=\"m4 17 6-6-6-6\" />\n </svg>\n );\n}\n\n/** lucide `trash`. */\nexport function TrashIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"trash\", props)}>\n <path d=\"M10 11v6\" />\n <path d=\"M14 11v6\" />\n <path d=\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\" />\n <path d=\"M3 6h18\" />\n <path d=\"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\" />\n </svg>\n );\n}\n\n/** lucide `building`. */\nexport function BuildingIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"building\", props)}>\n <path d=\"M12 10h.01\" />\n <path d=\"M12 14h.01\" />\n <path d=\"M12 6h.01\" />\n <path d=\"M16 10h.01\" />\n <path d=\"M16 14h.01\" />\n <path d=\"M16 6h.01\" />\n <path d=\"M8 10h.01\" />\n <path d=\"M8 14h.01\" />\n <path d=\"M8 6h.01\" />\n <path d=\"M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3\" />\n <rect x=\"4\" y=\"2\" width=\"16\" height=\"20\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `plug`. */\nexport function PlugIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"plug\", props)}>\n <path d=\"M12 22v-5\" />\n <path d=\"M15 8V2\" />\n <path d=\"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z\" />\n <path d=\"M9 8V2\" />\n </svg>\n );\n}\n\n/** lucide `share`. */\nexport function ShareIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"share\", props)}>\n <path d=\"M12 2v13\" />\n <path d=\"m16 6-4-4-4 4\" />\n <path d=\"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8\" />\n </svg>\n );\n}\n\n/** lucide `arrow-up-down`. */\nexport function ArrowUpDownIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-up-down\", props)}>\n <path d=\"m21 16-4 4-4-4\" />\n <path d=\"M17 20V4\" />\n <path d=\"m3 8 4-4 4 4\" />\n <path d=\"M7 4v16\" />\n </svg>\n );\n}\n\n/** lucide `move`. */\nexport function MoveIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"move\", props)}>\n <path d=\"M12 2v20\" />\n <path d=\"m15 19-3 3-3-3\" />\n <path d=\"m19 9 3 3-3 3\" />\n <path d=\"M2 12h20\" />\n <path d=\"m5 9-3 3 3 3\" />\n <path d=\"m9 5 3-3 3 3\" />\n </svg>\n );\n}\n\n/** lucide `qr-code`. */\nexport function QrCodeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"qr-code\", props)}>\n <rect width=\"5\" height=\"5\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"5\" height=\"5\" x=\"16\" y=\"3\" rx=\"1\" />\n <rect width=\"5\" height=\"5\" x=\"3\" y=\"16\" rx=\"1\" />\n <path d=\"M21 16h-3a2 2 0 0 0-2 2v3\" />\n <path d=\"M21 21v.01\" />\n <path d=\"M12 7v3a2 2 0 0 1-2 2H7\" />\n <path d=\"M3 12h.01\" />\n <path d=\"M12 3h.01\" />\n <path d=\"M12 16v.01\" />\n <path d=\"M16 12h1\" />\n <path d=\"M21 12v.01\" />\n <path d=\"M12 21v-1\" />\n </svg>\n );\n}\n\n/** lucide `power`. */\nexport function PowerIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"power\", props)}>\n <path d=\"M12 2v10\" />\n <path d=\"M18.4 6.6a9 9 0 1 1-12.77.04\" />\n </svg>\n );\n}\n\n/** lucide `sliders-vertical`. */\nexport function SlidersVerticalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sliders-vertical\", props)}>\n <path d=\"M10 8h4\" />\n <path d=\"M12 21v-9\" />\n <path d=\"M12 8V3\" />\n <path d=\"M17 16h4\" />\n <path d=\"M19 12V3\" />\n <path d=\"M19 21v-5\" />\n <path d=\"M3 14h4\" />\n <path d=\"M5 10V3\" />\n <path d=\"M5 21v-7\" />\n </svg>\n );\n}\n\n/** lucide `fingerprint-pattern`. */\nexport function FingerprintPatternIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"fingerprint-pattern\", props)}>\n <path d=\"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4\" />\n <path d=\"M14 13.12c0 2.38 0 6.38-1 8.88\" />\n <path d=\"M17.29 21.02c.12-.6.43-2.3.5-3.02\" />\n <path d=\"M2 12a10 10 0 0 1 18-6\" />\n <path d=\"M2 16h.01\" />\n <path d=\"M21.8 16c.2-2 .131-5.354 0-6\" />\n <path d=\"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2\" />\n <path d=\"M8.65 22c.21-.66.45-1.32.57-2\" />\n <path d=\"M9 6.8a6 6 0 0 1 9 5.2v2\" />\n </svg>\n );\n}\n\n/** lucide `send`. */\nexport function SendIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"send\", props)}>\n <path d=\"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z\" />\n <path d=\"m21.854 2.147-10.94 10.939\" />\n </svg>\n );\n}\n\n/** lucide `paperclip`. */\nexport function PaperclipIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"paperclip\", props)}>\n <path d=\"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551\" />\n </svg>\n );\n}\n\n/** lucide `check-check`. */\nexport function CheckCheckIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"check-check\", props)}>\n <path d=\"M18 6 7 17l-5-5\" />\n <path d=\"m22 10-7.5 7.5L13 16\" />\n </svg>\n );\n}\n\n/** lucide `reply`. */\nexport function ReplyIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"reply\", props)}>\n <path d=\"M20 18v-2a4 4 0 0 0-4-4H4\" />\n <path d=\"m9 17-5-5 5-5\" />\n </svg>\n );\n}\n\n/** lucide `link`. */\nexport function LinkIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"link\", props)}>\n <path d=\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\" />\n <path d=\"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\" />\n </svg>\n );\n}\n\n/** lucide `bot`. */\nexport function BotIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"bot\", props)}>\n <path d=\"M12 8V4H8\" />\n <rect width=\"16\" height=\"12\" x=\"4\" y=\"8\" rx=\"2\" />\n <path d=\"M2 14h2\" />\n <path d=\"M20 14h2\" />\n <path d=\"M15 13v2\" />\n <path d=\"M9 13v2\" />\n </svg>\n );\n}\n\n/** lucide `bell-off`. */\nexport function BellOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"bell-off\", props)}>\n <path d=\"M10.268 21a2 2 0 0 0 3.464 0\" />\n <path d=\"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742\" />\n <path d=\"m2 2 20 20\" />\n <path d=\"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05\" />\n </svg>\n );\n}\n\n/** lucide `mail`. */\nexport function MailIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"mail\", props)}>\n <path d=\"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7\" />\n <rect x=\"2\" y=\"4\" width=\"20\" height=\"16\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `mail-open`. */\nexport function MailOpenIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"mail-open\", props)}>\n <path d=\"M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z\" />\n <path d=\"m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10\" />\n </svg>\n );\n}\n\n/** lucide `folder-input`. */\nexport function FolderInputIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"folder-input\", props)}>\n <path d=\"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1\" />\n <path d=\"M2 13h10\" />\n <path d=\"m9 16 3-3-3-3\" />\n </svg>\n );\n}\n\n/** lucide `star-off`. */\nexport function StarOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"star-off\", props)}>\n <path d=\"m10.344 4.688 1.181-2.393a.53.53 0 0 1 .95 0l2.31 4.679a2.12 2.12 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.237 3.152\" />\n <path d=\"m17.945 17.945.43 2.505a.53.53 0 0 1-.771.56l-4.618-2.428a2.12 2.12 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.12 2.12 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a8 8 0 0 0 .4-.099\" />\n <path d=\"m2 2 20 20\" />\n </svg>\n );\n}\n\n/** lucide `columns-3`. */\nexport function Columns3Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"columns-3\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M9 3v18\" />\n <path d=\"M15 3v18\" />\n </svg>\n );\n}\n\n/** lucide `blocks`. */\nexport function BlocksIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"blocks\", props)}>\n <path d=\"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2\" />\n <rect x=\"14\" y=\"2\" width=\"8\" height=\"8\" rx=\"1\" />\n </svg>\n );\n}\n\n/** lucide `calendar-clock`. */\nexport function CalendarClockIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"calendar-clock\", props)}>\n <path d=\"M16 14v2.2l1.6 1\" />\n <path d=\"M16 2v3\" />\n <path d=\"M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338\" />\n <path d=\"M3 9h5.859\" />\n <path d=\"M8 2v3\" />\n <circle cx=\"16\" cy=\"16\" r=\"6\" />\n </svg>\n );\n}\n\n/** lucide `door-open`. */\nexport function DoorOpenIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"door-open\", props)}>\n <path d=\"M10 21H2\" />\n <path d=\"M10 3H7a2 2 0 00-2 2v16\" />\n <path d=\"M14 12h.01\" />\n <path d=\"M19 21V5a2 2 0 00-1.675-1.974l-6.163-1.013A1 1 0 0010 3v18a1 1 0 001.124.992z\" />\n <path d=\"M22 21h-3\" />\n </svg>\n );\n}\n\n/** lucide `inbox`. */\nexport function InboxIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"inbox\", props)}>\n <polyline points=\"22 12 16 12 14 15 10 15 8 12 2 12\" />\n <path d=\"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z\" />\n </svg>\n );\n}\n\n/** lucide `layout-dashboard`. */\nexport function LayoutDashboardIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"layout-dashboard\", props)}>\n <rect width=\"7\" height=\"9\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"5\" x=\"14\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"9\" x=\"14\" y=\"12\" rx=\"1\" />\n <rect width=\"7\" height=\"5\" x=\"3\" y=\"16\" rx=\"1\" />\n </svg>\n );\n}\n\n/** lucide `archive-restore`. */\nexport function ArchiveRestoreIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"archive-restore\", props)}>\n <rect width=\"20\" height=\"5\" x=\"2\" y=\"3\" rx=\"1\" />\n <path d=\"M4 8v11a2 2 0 0 0 2 2h2\" />\n <path d=\"M20 8v11a2 2 0 0 1-2 2h-2\" />\n <path d=\"m9 15 3-3 3 3\" />\n <path d=\"M12 12v9\" />\n </svg>\n );\n}\n\n/** lucide `split`. */\nexport function SplitIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"split\", props)}>\n <path d=\"M16 3h5v5\" />\n <path d=\"M8 3H3v5\" />\n <path d=\"M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3\" />\n <path d=\"m15 9 6-6\" />\n </svg>\n );\n}\n\n/** lucide `arrow-up-from-line`. */\nexport function ArrowUpFromLineIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-up-from-line\", props)}>\n <path d=\"m18 9-6-6-6 6\" />\n <path d=\"M12 3v14\" />\n <path d=\"M5 21h14\" />\n </svg>\n );\n}\n\n/** lucide `lock-open`. */\nexport function LockOpenIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"lock-open\", props)}>\n <rect width=\"18\" height=\"11\" x=\"3\" y=\"11\" rx=\"2\" ry=\"2\" />\n <path d=\"M7 11V7a5 5 0 0 1 9.9-1\" />\n </svg>\n );\n}\n\n/** lucide `printer`. */\nexport function PrinterIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"printer\", props)}>\n <path d=\"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2\" />\n <path d=\"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6\" />\n <rect x=\"6\" y=\"14\" width=\"12\" height=\"8\" rx=\"1\" />\n </svg>\n );\n}\n\n/** lucide `rocket`. */\nexport function RocketIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"rocket\", props)}>\n <path d=\"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5\" />\n <path d=\"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09\" />\n <path d=\"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z\" />\n <path d=\"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05\" />\n </svg>\n );\n}\n\n/** lucide `message-circle`. */\nexport function MessageCircleIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"message-circle\", props)}>\n <path d=\"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719\" />\n </svg>\n );\n}\n\n/** lucide `copy-plus`. */\nexport function CopyPlusIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"copy-plus\", props)}>\n <line x1=\"15\" x2=\"15\" y1=\"12\" y2=\"18\" />\n <line x1=\"12\" x2=\"18\" y1=\"15\" y2=\"15\" />\n <rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n <path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" />\n </svg>\n );\n}\n\n/** lucide `map-pin`. */\nexport function MapPinIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"map-pin\", props)}>\n <path d=\"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0\" />\n <circle cx=\"12\" cy=\"10\" r=\"3\" />\n </svg>\n );\n}\n\n/** lucide `at-sign`. */\nexport function AtSignIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"at-sign\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d=\"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8\" />\n </svg>\n );\n}\n\n/** lucide `link-2-off`. */\nexport function Link2OffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"link-2-off\", props)}>\n <path d=\"M9 17H7A5 5 0 0 1 7 7\" />\n <path d=\"M15 7h2a5 5 0 0 1 4 8\" />\n <line x1=\"8\" x2=\"12\" y1=\"12\" y2=\"12\" />\n <line x1=\"2\" x2=\"22\" y1=\"2\" y2=\"22\" />\n </svg>\n );\n}\n\n/** lucide `whole-word`. */\nexport function WholeWordIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"whole-word\", props)}>\n <circle cx=\"7\" cy=\"12\" r=\"3\" />\n <path d=\"M10 9v6\" />\n <circle cx=\"17\" cy=\"12\" r=\"3\" />\n <path d=\"M14 7v8\" />\n <path d=\"M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1\" />\n </svg>\n );\n}\n\n/** lucide `lightbulb`. */\nexport function LightbulbIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"lightbulb\", props)}>\n <path d=\"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5\" />\n <path d=\"M9 18h6\" />\n <path d=\"M10 22h4\" />\n </svg>\n );\n}\n\n/** lucide `shield-off`. */\nexport function ShieldOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"shield-off\", props)}>\n <path d=\"m2 2 20 20\" />\n <path d=\"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71\" />\n <path d=\"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264\" />\n </svg>\n );\n}\n\n/** lucide `chevrons-left`. */\nexport function ChevronsLeftIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevrons-left\", props)}>\n <path d=\"m11 17-5-5 5-5\" />\n <path d=\"m18 17-5-5 5-5\" />\n </svg>\n );\n}\n\n/** lucide `chevrons-right`. */\nexport function ChevronsRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevrons-right\", props)}>\n <path d=\"m6 17 5-5-5-5\" />\n <path d=\"m13 17 5-5-5-5\" />\n </svg>\n );\n}\n\n/** lucide `users-round`. */\nexport function UsersRoundIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"users-round\", props)}>\n <path d=\"M18 21a8 8 0 0 0-16 0\" />\n <circle cx=\"10\" cy=\"8\" r=\"5\" />\n <path d=\"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3\" />\n </svg>\n );\n}\n\n/** lucide `landmark`. */\nexport function LandmarkIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"landmark\", props)}>\n <path d=\"M10 18v-7\" />\n <path d=\"M11.119 2.205a2 2 0 0 1 1.762 0l7.84 3.846A.5.5 0 0 1 20.5 7h-17a.5.5 0 0 1-.22-.949z\" />\n <path d=\"M14 18v-7\" />\n <path d=\"M18 18v-7\" />\n <path d=\"M3 22h18\" />\n <path d=\"M6 18v-7\" />\n </svg>\n );\n}\n\n/** lucide `factory`. */\nexport function FactoryIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"factory\", props)}>\n <path d=\"M12 16h.01\" />\n <path d=\"M16 16h.01\" />\n <path d=\"M3 19a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a.5.5 0 0 0-.769-.422l-4.462 2.844A.5.5 0 0 1 15 10.5v-2a.5.5 0 0 0-.769-.422L9.77 10.922A.5.5 0 0 1 9 10.5V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2z\" />\n <path d=\"M8 16h.01\" />\n </svg>\n );\n}\n\n/** lucide `chevrons-down` — CollapsibleText's \"expand all\". */\nexport function ChevronsDownIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevrons-down\", props)}>\n <path d=\"m7 6 5 5 5-5\" />\n <path d=\"m7 13 5 5 5-5\" />\n </svg>\n );\n}\n\n/** lucide `chevrons-up` — CollapsibleText's \"collapse all\". */\nexport function ChevronsUpIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevrons-up\", props)}>\n <path d=\"m17 11-5-5-5 5\" />\n <path d=\"m17 18-5-5-5 5\" />\n </svg>\n );\n}\n\n/** lucide `arrow-up-right` — CitationChip's \"open source\". */\nexport function ArrowUpRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-up-right\", props)}>\n <path d=\"M7 7h10v10\" />\n <path d=\"M7 17 17 7\" />\n </svg>\n );\n}\n\n/** lucide `quote` — CitationChip's excerpt blockquote. */\nexport function QuoteIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"quote\", props)}>\n <path d=\"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z\" />\n <path d=\"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z\" />\n </svg>\n );\n}\n\n/** lucide `panel-top-open` — the floating dock's phone menu button (opens the list). */\nexport function PanelTopOpenIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"panel-top-open\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M3 9h18\" />\n <path d=\"m15 14-3 3-3-3\" />\n </svg>\n );\n}\n\n/** lucide `panel-top-close` — the floating dock's phone menu button (closes the list). */\nexport function PanelTopCloseIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"panel-top-close\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M3 9h18\" />\n <path d=\"m9 16 3-3 3 3\" />\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\nimport * as React from \"react\";\n\n/**\n * A NESTED SUBMENU OPENS ON ITS PARENT'S SIDE (0.62.4).\n *\n * Radix draws every submenu on the right (left in RTL) and flips only when THAT side lacks room.\n * Measured at a 1600 px viewport: main menu x 1194–1482, first submenu flipped left to 909–1197,\n * second submenu — with 118 px to spare on the right of its trigger — drawn at 1194–1482, exactly\n * over the main menu. The second level must follow the first: when the parent resolved to the\n * non-default side, the default side is closed to the child with collision padding, so Radix's own\n * flip sends it the same way as its parent. When the parent's side has no room either, Radix's\n * best-fit still decides — it flips only when that side has no room.\n *\n * `side` is not overridable on a Radix SubContent (it is spread after the caller's props); the\n * collision padding is the supported lever.\n */\nexport type SubmenuCollisionPadding = number | Partial<Record<\"top\" | \"right\" | \"bottom\" | \"left\", number>>;\n\nexport const SubmenuParentContext = React.createContext<React.MutableRefObject<HTMLElement | null> | null>(null);\n\nfunction normalise(base: SubmenuCollisionPadding | undefined, fallback: number) {\n if (typeof base === \"number\") return { top: base, right: base, bottom: base, left: base };\n return { top: base?.top ?? fallback, right: base?.right ?? fallback, bottom: base?.bottom ?? fallback, left: base?.left ?? fallback };\n}\n\n/** Pure: the collision padding a nested submenu takes, given the parent submenu's element. */\nexport function nestedSubmenuCollisionPadding(\n parent: HTMLElement | null,\n base?: SubmenuCollisionPadding,\n viewportWidth?: number,\n): SubmenuCollisionPadding | undefined {\n if (!parent) return base;\n const side = parent.getAttribute(\"data-side\");\n if (side !== \"left\" && side !== \"right\") return base;\n const view = parent.ownerDocument.defaultView;\n const rtl = view?.getComputedStyle(parent).direction === \"rtl\";\n const preferred = rtl ? \"left\" : \"right\";\n if (side === preferred) return base; // the parent took the default side; the child follows it\n const padding = normalise(base, 0);\n const rect = parent.getBoundingClientRect();\n if (preferred === \"right\") {\n const vw = viewportWidth ?? parent.ownerDocument.documentElement.clientWidth ?? view?.innerWidth ?? 0;\n if (!vw) return base;\n padding.right = Math.max(padding.right, vw - rect.left);\n } else {\n padding.left = Math.max(padding.left, rect.right);\n }\n return padding;\n}\n\n/** For a SubContent wrapper: the collision padding to pass, a ref to compose onto the content,\n * and a wrapper that tells THIS submenu's own children where their parent is. */\nexport function useNestedSubmenuPlacement(\n forwardedRef: React.ForwardedRef<HTMLDivElement>,\n collisionPadding: SubmenuCollisionPadding | undefined,\n) {\n const parent = React.useContext(SubmenuParentContext);\n const own = React.useRef<HTMLElement | null>(null);\n const ref = React.useCallback(\n (node: HTMLDivElement | null) => {\n own.current = node;\n if (typeof forwardedRef === \"function\") forwardedRef(node);\n else if (forwardedRef) forwardedRef.current = node;\n },\n [forwardedRef],\n );\n const padding = nestedSubmenuCollisionPadding(parent?.current ?? null, collisionPadding);\n const wrap = (children: React.ReactNode) => (\n <SubmenuParentContext.Provider value={own}>{children}</SubmenuParentContext.Provider>\n );\n return { ref, padding, wrap };\n}\n","/**\n * THE FOCUS-RETURN GUARD — a closing menu, popover, select or dialog never takes focus back from a\n * field the person has already moved into.\n *\n * Radix returns focus to the trigger when its content UNMOUNTS (FocusScope: a `setTimeout(0)` after the\n * exit animation, unconditionally). On a busy page that is hundreds of milliseconds after the person\n * picked an option — long enough for them to click the next field and start typing. The return then\n * lands mid-word: focus jumps to the trigger and every key after it is lost (\"https://drive…\" saved as\n * \"https:\", Applet social planner, 2026-10-08).\n *\n * `keepMovedFocus(handler)` composes a content's `onCloseAutoFocus`: when focus already sits on a live\n * element outside the closing content (not the page body), the return is canceled; otherwise Radix\n * returns focus to the trigger exactly as before (keyboard users closing with Escape keep their place).\n */\n/** True when focus has already moved to something the person chose, outside `container`. */\nexport function focusMovedElsewhere(container: EventTarget | null, doc: Document | undefined = typeof document === \"undefined\" ? undefined : document): boolean {\n if (!doc) return false;\n const active = doc.activeElement;\n if (!active || active === doc.body || active === doc.documentElement) return false;\n if (!active.isConnected) return false;\n if (container && typeof (container as Node).contains === \"function\" && (container as Node).contains(active)) return false;\n return true;\n}\n\n/** Compose a content's `onCloseAutoFocus` with THE FOCUS-RETURN GUARD (the caller's handler runs first). */\nexport function keepMovedFocus(handler?: (event: Event) => void): (event: Event) => void {\n return (event: Event) => {\n handler?.(event);\n if (event.defaultPrevented) return;\n const container = (event.currentTarget ?? event.target) as EventTarget | null;\n if (focusMovedElsewhere(container, (container as Node | null)?.ownerDocument ?? undefined)) event.preventDefault();\n };\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 { RadixCheckIcon, RadixChevronDownIcon, RadixChevronUpIcon } from \"./icons\";\nimport { usePortalContainer } from \"./portal-container\";\nimport { FIELD_SURFACE_CLASS } from \"./field-surface\";\nimport { keepMovedFocus } from \"./focus-return\";\n\nexport const Select = SelectPrimitive.Root;\n\nexport const SelectGroup = SelectPrimitive.Group;\n\nexport const SelectValue = SelectPrimitive.Value;\n\nexport const selectTriggerVariants = cva(\n `matrx-glyph-trim 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-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15 data-[state=open]:border-primary disabled:cursor-not-allowed disabled:bg-muted disabled:text-disabled-foreground [&>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 | undefined; size?: \"sm\" | \"default\" | undefined }) {\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 honors `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 onCloseAutoFocus,\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 centered dialog card — see motion.ts.\n position === \"popper\" && POPPER_OFFSET,\n className,\n )}\n position={position}\n {...props}\n onCloseAutoFocus={keepMovedFocus(onCloseAutoFocus)}\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(\"type-label px-2 pb-1 pt-2 text-muted-foreground\", 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 * What the option means, as its HOVER text — never a second line on desktop\n * (Arman, 2026-10-14: no \"novels\" in menus). Where nothing can hover (a phone,\n * a mouse-less tablet) it is the option's muted second line in the open list\n * (`data-touch-hint`, menu-look.css). The trigger shows only the label.\n */\n description?: string;\n /** Short trailing text in the menu only (a count, a size, why it cannot be chosen); the trigger never shows it. */\n meta?: React.ReactNode;\n }\n>(({ className, children, description, meta, title, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n title={title ?? description}\n className={cn(\n \"relative flex w-full min-w-0 select-none items-center rounded-sm py-1 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:text-disabled-foreground\",\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 <RadixCheckIcon 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 {/* Outside ItemText: the closed trigger shows the label alone. */}\n {description ? (\n <span data-touch-hint=\"\" className=\"hidden text-xs leading-snug text-muted-foreground [@media(hover:none)]:block\">\n {description}\n </span>\n ) : null}\n </span>\n {meta ? (\n <span data-slot=\"select-item-meta\" className=\"ml-3 min-w-0 shrink text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {meta}\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 gray page color in light mode),\n * BasicInput and the control Textarea were `bg-transparent` (gray on a gray\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","import * as React from \"react\";\n\n/** True when a node holds visible text anywhere in its React tree. */\nfunction hasText(node: React.ReactNode): boolean {\n if (typeof node === \"string\") return node.trim().length > 0;\n if (typeof node === \"number\" || typeof node === \"bigint\") return true;\n if (Array.isArray(node)) return node.some(hasText);\n if (React.isValidElement<{ children?: React.ReactNode }>(node)) return hasText(node.props.children);\n return false;\n}\n\n/**\n * A segment whose children are a glyph and no text — the square segment. Decided here, not in\n * CSS: `:has(> svg:only-child)` ignores text nodes, so an icon + name tab matched as well.\n */\nexport function isIconOnly(children: React.ReactNode): boolean {\n return React.Children.toArray(children).some((c) => React.isValidElement(c)) && !hasText(children);\n}\n","\"use client\";\n\n/**\n * Textarea — the multi-line twin of the Input family, same three shapes:\n * `Textarea` (elevated), `BasicTextarea` (plain control), and\n * `TextareaWithPrefix`.\n *\n * WHAT THE FORKS PROVED. Three hosts shipped a bare `<textarea>` with a\n * min-height and nothing else; matrx-frontend shipped auto-grow, min/max\n * height clamping, and a stretch-detection pass. That last one is the reason\n * this file is worth having: a `<textarea>` is a REPLACED element, so\n * `className=\"h-full\"` on it does nothing useful unless its parent is also\n * told to stretch — which is why every host that wanted a filling textarea\n * ended up wrapping it by hand at the call site, differently each time.\n * `getStretchClasses` reads the caller's own fill intent out of the className\n * and builds the wrapper for them.\n *\n * COLOR IS TOKENS (C26). The ported original pinned its body text to literal\n * black/white, its placeholder and focus ring to raw palette steps, and its\n * dark elevation to a custom property no host defined — so that shadow\n * computed to nothing. All four now resolve from the semantic vocabulary.\n *\n * AND `shadow-textarea` NOW EXISTS. The original's resting elevation class was\n * `shadow-textarea`, and NO host defined `--shadow-textarea` or generated that\n * utility — 125 call sites asked for an elevation they never got. The package\n * ships the token (defaulting to the Input family's `--shadow-input`, which is\n * plainly what the twin class meant) and the rule, so the class finally does\n * what it says. A host that wants the flat look sets `--shadow-textarea: none`.\n *\n * The clipboard/motion variants matrx-frontend layers on top (CopyTextarea,\n * FancyTextarea) stay host-owned under the C8 split-out law: they drag in\n * `motion/react`, and plain-textarea consumers must not pay for it.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { FIELD_SURFACE_CLASS } from \"./field-surface\";\n\nexport interface TextareaProps\n extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {\n /** Grow to fit content as the user types (and stop growing at `maxHeight`). */\n autoGrow?: boolean;\n /** Minimum height in px. */\n minHeight?: number;\n /** Maximum height in px; past it the field scrolls instead of growing. */\n maxHeight?: number;\n /** Classes for the wrapper this component adds when one is needed. */\n wrapperClassName?: string;\n}\n\nconst FILL_HEIGHT_REGEX = /(?:^|\\s)(h-full|h-dvh|flex-1|grow)(?:\\s|$)/;\nconst FILL_WIDTH_REGEX = /(?:^|\\s)(w-full|w-screen)(?:\\s|$)/;\n\n/**\n * A `<textarea>` cannot fill a box on its own — the box has to be told too.\n * Read the caller's fill intent out of its own className and mirror it onto\n * the wrapper, so `className=\"h-full\"` means what the caller thought it meant.\n */\nfunction getStretchClasses(className?: string): string | undefined {\n if (!className) return undefined;\n const fills: string[] = [];\n if (FILL_HEIGHT_REGEX.test(className)) fills.push(\"h-full min-h-0\");\n if (FILL_WIDTH_REGEX.test(className)) fills.push(\"w-full\");\n return fills.length ? fills.join(\" \") : undefined;\n}\n\nconst TEXTAREA_ELEVATED_CLASS =\n `flex h-auto w-full rounded-md ${FIELD_SURFACE_CLASS} px-3 py-2 text-sm text-foreground shadow-textarea transition duration-400 placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15 disabled:cursor-not-allowed disabled:opacity-50`;\n\nconst TEXTAREA_CONTROL_CLASS =\n `flex w-full rounded-md ${FIELD_SURFACE_CLASS} px-3 py-2 text-sm text-foreground shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15 disabled:cursor-not-allowed disabled:opacity-50`;\n\nexport function useAutoGrow(\n ref: React.RefObject<HTMLTextAreaElement | null>,\n value: React.TextareaHTMLAttributes<HTMLTextAreaElement>[\"value\"],\n autoGrow = false,\n minHeight?: number,\n maxHeight?: number,\n): void {\n React.useEffect(() => {\n if (!autoGrow || !ref.current) return;\n\n const textarea = ref.current;\n textarea.style.height = \"auto\";\n\n let newHeight = textarea.scrollHeight;\n if (minHeight) newHeight = Math.max(newHeight, minHeight);\n\n if (maxHeight && newHeight >= maxHeight) {\n textarea.style.height = `${maxHeight}px`;\n textarea.style.overflowY = \"auto\";\n } else {\n textarea.style.height = `${newHeight}px`;\n textarea.style.overflowY = \"hidden\";\n }\n }, [value, autoGrow, minHeight, maxHeight, ref]);\n}\n\n/** Merge a forwarded ref with the internal one auto-grow needs to measure. */\nexport function useMergedTextareaRef(\n forwarded: React.ForwardedRef<HTMLTextAreaElement>,\n): {\n ref: React.RefObject<HTMLTextAreaElement | null>;\n callback: (node: HTMLTextAreaElement | null) => void;\n} {\n const internal = React.useRef<HTMLTextAreaElement | null>(null);\n const callback = React.useCallback(\n (node: HTMLTextAreaElement | null) => {\n internal.current = node;\n if (typeof forwarded === \"function\") forwarded(node);\n else if (forwarded) forwarded.current = node;\n },\n [forwarded],\n );\n return { ref: internal, callback };\n}\n\nexport function boxStyle(\n minHeight?: number,\n maxHeight?: number,\n): React.CSSProperties | undefined {\n if (minHeight === undefined && maxHeight === undefined) return undefined;\n return {\n minHeight: minHeight ? `${minHeight}px` : undefined,\n maxHeight: maxHeight ? `${maxHeight}px` : undefined,\n };\n}\n\n/** The elevated textarea — the Input family's `Input`, in multi-line form. */\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n (\n { className, autoGrow, minHeight, maxHeight, wrapperClassName, ...props },\n forwarded,\n ) => {\n const { ref, callback } = useMergedTextareaRef(forwarded);\n const stretchClasses = getStretchClasses(className);\n const needsWrapper = Boolean(wrapperClassName || stretchClasses);\n\n useAutoGrow(ref, props.value, autoGrow, minHeight, maxHeight);\n\n const textarea = (\n <textarea\n ref={callback}\n data-slot=\"textarea\"\n className={cn(\n TEXTAREA_ELEVATED_CLASS,\n autoGrow && \"resize-none\",\n stretchClasses,\n className,\n )}\n style={boxStyle(minHeight, maxHeight)}\n {...props}\n />\n );\n\n if (!needsWrapper) return textarea;\n\n return <div className={cn(stretchClasses, wrapperClassName)}>{textarea}</div>;\n },\n);\nTextarea.displayName = \"Textarea\";\n\n/**\n * The plain control — a bordered, transparent field with a 60px floor. This is\n * what matrx-extend, aidream/apps/dashboard and workflow-studio each called\n * `Textarea`; the floor is theirs and it is the sensible default (a one-line\n * box for multi-line content invites a scrollbar on the first Enter).\n */\nconst BasicTextarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, autoGrow, minHeight, maxHeight, ...props }, forwarded) => {\n const { ref, callback } = useMergedTextareaRef(forwarded);\n\n useAutoGrow(ref, props.value, autoGrow, minHeight, maxHeight);\n\n return (\n <textarea\n ref={callback}\n data-slot=\"textarea\"\n className={cn(\n TEXTAREA_CONTROL_CLASS,\n \"h-auto min-h-[60px]\",\n autoGrow && \"resize-none\",\n className,\n )}\n style={boxStyle(minHeight, maxHeight)}\n {...props}\n />\n );\n },\n);\nBasicTextarea.displayName = \"BasicTextarea\";\n\nexport interface TextareaWithPrefixProps extends Omit<TextareaProps, \"prefix\"> {\n /** Leading adornment, absolutely placed at the field's top-left. */\n prefix?: React.ReactNode;\n}\n\nconst TextareaWithPrefix = React.forwardRef<\n HTMLTextAreaElement,\n TextareaWithPrefixProps\n>(\n (\n {\n prefix,\n className,\n wrapperClassName,\n autoGrow,\n minHeight,\n maxHeight,\n ...props\n },\n forwarded,\n ) => {\n const { ref, callback } = useMergedTextareaRef(forwarded);\n\n useAutoGrow(ref, props.value, autoGrow, minHeight, maxHeight);\n\n return (\n <div\n className={cn(\"relative\", getStretchClasses(className), wrapperClassName)}\n >\n {prefix ? (\n <div className=\"pointer-events-none absolute left-3 top-3 z-10 text-muted-foreground\">\n {prefix}\n </div>\n ) : null}\n <textarea\n ref={callback}\n data-slot=\"textarea\"\n className={cn(\n TEXTAREA_CONTROL_CLASS,\n \"resize-y\",\n prefix && \"pl-10\",\n autoGrow && \"resize-none\",\n className,\n )}\n style={boxStyle(minHeight, maxHeight)}\n {...props}\n />\n </div>\n );\n },\n);\nTextareaWithPrefix.displayName = \"TextareaWithPrefix\";\n\nexport { BasicTextarea, Textarea, TextareaWithPrefix };\n","\"use client\";\n\n/**\n * THE WINDOW CHROME CONTROLS (2026-10-23) — the title bar of a floating window (summon's\n * WindowPanel) drawn at macOS's own geometry, never the 28px control:\n *\n * WindowLights the traffic-light group: 12px dots 8px apart; hovering (or focusing) the\n * group reveals every light's 8px glyph, as macOS does. `inactive` greys the\n * lights of a window that is not in front until the pointer reaches them.\n * `touch` is the phone header's lights: 24px dots, 10px glyphs always shown.\n * WindowLight one light: `kind` close / minimize / maximize picks its color and glyph;\n * `restores` swaps in the restore glyph (a minimized window's yellow, a\n * maximized window's green). Disabled is a grey dot with no glyph.\n * WindowChromeButton a title-bar icon action (the sidebar toggle, pop out): a 20px square with\n * a 14px glyph, quiet until hovered.\n *\n * Geometry and color live in `controls.css` (THE WINDOW CHROME), locked in\n * `@layer matrx-tap-lock` like every control, so `className` places them and never restyles them.\n * Colors are the `--matrx-window-light-*` tokens in `tokens.css` (both themes). The contract is\n * pinned by `window-controls-geometry.test.tsx`: moving a light back onto the 28px Button fails it.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { Maximize2Icon, Minimize2Icon, MinusIcon, XIcon } from \"../icons\";\n\nexport type WindowLightKind = \"close\" | \"minimize\" | \"maximize\";\n\nexport interface WindowLightsProps extends React.HTMLAttributes<HTMLDivElement> {\n /** The window is not the one in front: the lights are grey until the pointer reaches them. */\n inactive?: boolean;\n /** The phone header's lights: 24px dots with their glyphs always shown (no hover on touch). */\n touch?: boolean;\n}\n\n/** The traffic-light group. Its hover (or keyboard focus) reveals every light's glyph. */\nexport const WindowLights = React.forwardRef<HTMLDivElement, WindowLightsProps>(\n ({ className, inactive, touch, role = \"group\", \"aria-label\": ariaLabel = \"Window controls\", ...props }, ref) => (\n <div\n ref={ref}\n role={role}\n aria-label={ariaLabel}\n data-matrx-window-lights=\"\"\n data-inactive={inactive ? \"\" : undefined}\n data-touch={touch ? \"\" : undefined}\n className={cn(\"matrx-window-lights\", className)}\n {...props}\n />\n ),\n);\nWindowLights.displayName = \"WindowLights\";\n\nexport interface WindowLightProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"children\"> {\n /** Which light: close (red), minimize (yellow), maximize (green). */\n kind: WindowLightKind;\n /** The light undoes its window's state (restore a minimized or maximized window): the restore glyph. */\n restores?: boolean;\n /** A light must say what it does. */\n \"aria-label\": string;\n}\n\nfunction lightGlyph(kind: WindowLightKind, restores: boolean): React.ReactNode {\n if (kind === \"close\") return <XIcon aria-hidden=\"true\" />;\n if (kind === \"minimize\") return restores ? <Maximize2Icon aria-hidden=\"true\" /> : <MinusIcon aria-hidden=\"true\" />;\n return restores ? <Minimize2Icon aria-hidden=\"true\" /> : <Maximize2Icon aria-hidden=\"true\" />;\n}\n\n/** One traffic light. Place it inside `WindowLights`. */\nexport const WindowLight = React.forwardRef<HTMLButtonElement, WindowLightProps>(\n ({ className, kind, restores = false, type, ...props }, ref) => (\n <button\n ref={ref}\n type={type ?? \"button\"}\n data-matrx-window-light={kind}\n data-restores={restores ? \"\" : undefined}\n className={cn(\"matrx-window-light\", className)}\n {...props}\n >\n {lightGlyph(kind, restores)}\n </button>\n ),\n);\nWindowLight.displayName = \"WindowLight\";\n\nexport interface WindowChromeButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"children\"> {\n /** The 14px glyph. */\n icon: React.ReactNode;\n /** A title-bar action must say what it does (also its tooltip unless `title` is given). */\n \"aria-label\": string;\n}\n\n/** A title-bar icon action (sidebar toggle, pop out): 20px, quiet until hovered. */\nexport const WindowChromeButton = React.forwardRef<HTMLButtonElement, WindowChromeButtonProps>(\n ({ className, icon, type, title, ...props }, ref) => (\n <button\n ref={ref}\n type={type ?? \"button\"}\n data-matrx-window-chrome-button=\"\"\n className={cn(\"matrx-window-chrome-button\", className)}\n title={title ?? props[\"aria-label\"]}\n {...props}\n >\n {icon}\n </button>\n ),\n);\nWindowChromeButton.displayName = \"WindowChromeButton\";\n","\"use client\";\n\n/**\n * DecisionControl — THE row decision: [Yes] [No] [Other] + the answer's value chip.\n *\n * EVERY DECISION OFFERS A WAY OUT (Arman, 2026-10-14): a row that only offers\n * \"Preferred / Alias / Not us\" forces a person to decide something they cannot,\n * and they freeze. So every decision is exactly three clear buttons in one row —\n * Yes, No, Other — the same words in the same place on every row, for a person\n * or a business and for any kind of data (the section header asks the question:\n * \"Is this yours?\", \"Is this your name?\"). Other's menu holds the smart,\n * context-specific answers first (Tagline, Former name, grouped relationships…)\n * and ALWAYS ends with the generic exit \"Skip for now\", which leaves the item\n * undecided — neither kept nor rejected.\n *\n * NO EMPTY BOX, EVER (Arman, 2026-10-14: \"There is a border remaining … no\n * professional app does that\"). Champion: Linear's issue properties (the issue\n * view sidebar and the row property chips) — a property with no value draws\n * nothing; the menu opens FROM the control that asked for it; a chosen value is\n * a compact chip, and clicking the chip reopens the same menu. So:\n * · no answer, No, or a plain Yes: nothing is drawn beside the buttons (the\n * column's width is reserved invisibly on desktop, so rows never jump);\n * · Other: its menu opens anchored to the Other button; closing it without a\n * pick is no answer again; Other pressed while answered clears (onClear);\n * · Yes with `yesKinds` (\"Main name\" / \"Also known as\", \"Primary site\" /\n * \"Also ours\"): the host sets the default kind and it shows as a chip — the\n * primary kind in the strong primary style; click the chip to change it;\n * · a way-out answer or a skip shows as a neutral chip; click to change it.\n *\n * Layout: one line on desktop; below `sm` the three buttons share the row\n * equally and the chip appears under them only once there is a value.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n} from \"../dropdown-menu\";\nimport { RadixCheckIcon } from \"../icons\";\nimport { Button, Chip } from \"./controls\";\n\nexport type DecisionAnswer = \"yes\" | \"no\" | \"other\";\n\nexport interface WayOutItem {\n value: string;\n label: string;\n /** 11px trailing text (a shortcut, \"We think\"). */\n meta?: string;\n /** A submenu (one level). Prefer `group` headings: a flat picker reads faster. */\n items?: WayOutItem[];\n /** A heading above this item, starting a group inside its menu. */\n group?: string;\n}\n\nexport interface DecisionControlProps {\n /** The answer: Yes, No, or Other (a way-out answer or a skip). Null = undecided. */\n value: DecisionAnswer | null;\n /** Yes or No pressed. Pressing the chosen one again is the host's to clear (EVERY BUTTON TOGGLES). */\n onChange: (value: \"yes\" | \"no\") => void;\n /** Context-specific way-out answers: Other's menu's first entries. */\n wayOut?: WayOutItem[];\n onWayOut?: (value: string) => void;\n /** The chosen way-out answer (a leaf value): the chip shows its label. */\n wayOutValue?: string | null;\n /** The kinds of yes (\"Main name\", \"Also known as\"): with Yes on, the chip shows the kind and changes it. */\n yesKinds?: WayOutItem[];\n /** The current kind of yes (one of `yesKinds`' values). */\n yesKind?: string | null;\n onYesKind?: (value: string) => void;\n /** Other pressed while on: the row goes back to no answer (EVERY BUTTON TOGGLES, Arman 2026-10-14). */\n onClear?: () => void;\n /** THE generic exit, always Other's last entry. Required: no decision without a way out. */\n onSkip: () => void;\n /** The item is skipped (undecided on purpose). */\n skipped?: boolean;\n /** Other's last entry. Default \"Skip for now\". */\n skipLabel?: string;\n /** The chip once skipped. Default \"Skipped for now\". */\n skippedLabel?: string;\n /** Button words; defaults Yes / No / Other. Keep the defaults unless a surface's question needs others. */\n labels?: Partial<Record<DecisionAnswer, string>>;\n /** Keyboard shortcuts shown as each button's muted meta (\"Y\"). */\n shortcuts?: Partial<Record<DecisionAnswer, string>>;\n /** \"We think\": the suggested answer glows (a ring) — it is never chosen for the person. */\n suggested?: DecisionAnswer | null;\n /** The chip's text when Yes is on with kinds but the host set none. Default \"Choose…\". */\n pickerPlaceholder?: string;\n disabled?: boolean;\n /**\n * \"row\" (default): the 28px everyday geometry for lists of decisions. \"stage\": a focus stage that shows ONE\n * decision at a time (Smart Add's validation page) — the buttons take the 44px inviting geometry (Button `hero`)\n * and the row keeps one line on every width. Arman's rule: flagship screens get an elevated stage.\n */\n size?: \"row\" | \"stage\";\n className?: string;\n \"aria-label\"?: string;\n}\n\nfunction find(items: WayOutItem[] | undefined, value: string | null | undefined): WayOutItem | null {\n if (!items || !value) return null;\n for (const i of items) {\n if (i.value === value) return i;\n const inner = find(i.items, value);\n if (inner) return inner;\n }\n return null;\n}\n\nfunction WayOutEntries({ items, chosen, onPick }: { items: WayOutItem[]; chosen: string | null | undefined; onPick: (value: string) => void }) {\n return (\n <>\n {items.map((item, index) => (\n <React.Fragment key={item.value}>\n {item.group ? (\n <>\n {index > 0 ? <DropdownMenuSeparator /> : null}\n {/* A heading as DropdownMenuLabel ships it (the style guide: never restyled). */}\n <DropdownMenuLabel data-way-out-group=\"\">{item.group}</DropdownMenuLabel>\n </>\n ) : null}\n {item.items?.length ? (\n <DropdownMenuSub>\n <DropdownMenuSubTrigger data-way-out={item.value} className=\"text-foreground\">\n <span className=\"flex-1\">{item.label}</span>\n {find(item.items, chosen) ? <RadixCheckIcon className=\"mr-1 size-3.5\" aria-hidden=\"true\" /> : null}\n </DropdownMenuSubTrigger>\n <DropdownMenuSubContent>\n <WayOutEntries items={item.items} chosen={chosen} onPick={onPick} />\n </DropdownMenuSubContent>\n </DropdownMenuSub>\n ) : (\n <DropdownMenuItem data-way-out={item.value} className=\"text-foreground\" onSelect={() => onPick(item.value)}>\n <span className=\"flex-1\">{item.label}</span>\n {item.meta ? <span className=\"text-[11px] text-muted-foreground\">{item.meta}</span> : null}\n {chosen === item.value ? <RadixCheckIcon className=\"size-3.5\" aria-hidden=\"true\" /> : null}\n </DropdownMenuItem>\n )}\n </React.Fragment>\n ))}\n </>\n );\n}\n\nconst ring = \"rounded-full ring-2 ring-primary ring-offset-1 ring-offset-background\";\n\n/** [Yes] [No] [Other] + the value chip (nothing drawn without a value; Other's menu opens from Other). */\nexport function DecisionControl({\n value,\n onChange,\n wayOut,\n onWayOut,\n wayOutValue,\n yesKinds,\n yesKind,\n onYesKind,\n onClear,\n onSkip,\n skipped,\n skipLabel = \"Skip for now\",\n skippedLabel = \"Skipped for now\",\n labels,\n shortcuts,\n suggested,\n pickerPlaceholder = \"Choose…\",\n disabled,\n size = \"row\",\n className,\n \"aria-label\": ariaLabel,\n}: DecisionControlProps) {\n // Other's menu is open from the Other button (Other is on while it is open, before anything is picked).\n const [otherOpen, setOtherOpen] = React.useState(false);\n const [chipOpen, setChipOpen] = React.useState(false);\n const otherOn = value === \"other\" || otherOpen;\n const word = (a: DecisionAnswer) => labels?.[a] ?? (a === \"yes\" ? \"Yes\" : a === \"no\" ? \"No\" : \"Other\");\n const yesMode = value === \"yes\" && Boolean(yesKinds?.length);\n const otherMode = value === \"other\";\n const chosen = yesMode ? find(yesKinds, yesKind) : otherMode ? find(wayOut, wayOutValue) : null;\n // The chip exists only with something to say: a kind of yes, a way-out answer, or a skip.\n const chipLabel = yesMode ? (chosen?.label ?? pickerPlaceholder) : otherMode ? (chosen?.label ?? (skipped ? skippedLabel : null)) : null;\n const primary = yesMode && yesKinds?.[0]?.value === yesKind;\n\n const wayOutMenu = (\n <>\n {wayOut?.length ? (\n <>\n <WayOutEntries items={wayOut} chosen={wayOutValue} onPick={(v) => onWayOut?.(v)} />\n <DropdownMenuSeparator />\n </>\n ) : null}\n <DropdownMenuItem data-way-out=\"skip\" className=\"text-foreground\" onSelect={onSkip}>\n <span className=\"flex-1\">{skipLabel}</span>\n {skipped ? <RadixCheckIcon className=\"size-3.5\" aria-hidden=\"true\" /> : null}\n </DropdownMenuItem>\n </>\n );\n\n const stage = size === \"stage\";\n const button = (a: \"yes\" | \"no\") => (\n <span data-decision-slot={a} data-suggested={suggested === a ? \"\" : undefined} className={cn(\"inline-flex max-sm:flex-1\", suggested === a && ring)}>\n <Button\n variant={value === a ? (a === \"no\" ? \"danger\" : \"primary\") : \"outline\"}\n aria-pressed={value === a}\n meta={shortcuts?.[a]}\n disabled={disabled}\n hero={stage}\n data-decision-option={a}\n className=\"max-sm:w-full\"\n onClick={() => onChange(a)}\n >\n {word(a)}\n </Button>\n </span>\n );\n return (\n <div\n role=\"group\"\n aria-label={ariaLabel ?? \"Answer\"}\n data-matrx-control=\"decision\"\n data-decision={value ?? (otherOpen ? \"other\" : \"open\")}\n data-decision-size={size}\n className={cn(\"flex shrink-0 flex-wrap items-center gap-1 max-sm:w-full sm:flex-nowrap\", stage && \"gap-2\", className)}\n >\n {button(\"yes\")}\n {button(\"no\")}\n {/* Other is the menu's own trigger, so the menu opens from it. Answered, pressing it again clears. */}\n <DropdownMenu\n open={otherOpen}\n onOpenChange={(next) => {\n if (next && value === \"other\") {\n onClear?.();\n return;\n }\n setOtherOpen(next);\n }}\n >\n <span data-decision-slot=\"other\" data-suggested={suggested === \"other\" ? \"\" : undefined} className={cn(\"inline-flex max-sm:flex-1\", suggested === \"other\" && ring)}>\n <DropdownMenuTrigger asChild disabled={disabled}>\n <Button\n variant={otherOn ? \"primary\" : \"outline\"}\n aria-pressed={otherOn}\n meta={shortcuts?.other}\n disabled={disabled}\n hero={stage}\n data-decision-option=\"other\"\n className=\"max-sm:w-full\"\n >\n {word(\"other\")}\n </Button>\n </DropdownMenuTrigger>\n </span>\n <DropdownMenuContent align=\"start\" className=\"min-w-48\">\n {wayOutMenu}\n </DropdownMenuContent>\n </DropdownMenu>\n {/* The value column: its width is reserved on desktop so rows stay aligned, but nothing is drawn\n until there is a value. On mobile it takes its own line under the buttons, only with a value. */}\n <div className={cn(\"flex min-w-0 items-center sm:w-40\", chipLabel === null && \"max-sm:hidden\", \"max-sm:w-full\")} data-decision-picker-slot=\"\">\n {chipLabel === null ? null : (\n <DropdownMenu open={chipOpen} onOpenChange={setChipOpen}>\n <DropdownMenuTrigger asChild disabled={disabled}>\n <Chip\n asChild\n label={chipLabel}\n tone={yesMode ? \"primary\" : \"neutral\"}\n data-decision-picker=\"\"\n data-picker-primary={primary ? \"\" : undefined}\n aria-label={`${yesMode ? word(\"yes\") : word(\"other\")}: ${chipLabel}`}\n >\n <button type=\"button\" disabled={disabled} />\n </Chip>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\" className=\"min-w-48\">\n {yesMode ? <WayOutEntries items={yesKinds ?? []} chosen={yesKind} onPick={(v) => onYesKind?.(v)} /> : wayOutMenu}\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n </div>\n </div>\n );\n}\n","\"use client\";\n\n/**\n * DateField / DateTimeField / TimeField — THE date control of the one-control\n * family (lane G16, 2026-10-07). The field capsule (28px, locked in\n * `controls.css`) with typed entry, a calendar (desktop popover, phone bottom\n * sheet), Clear, and full keyboard access. Bar: Linear's and Stripe's date\n * fields — type the day the way you say it, or pick it, never a browser mask.\n *\n * value / onValueChange ISO in and out: `yyyy-mm-dd`, `HH:mm`,\n * `yyyy-mm-ddTHH:mm`; `null` is empty.\n * emptyLabel the caller's empty word (\"Pick a date\",\n * \"Unchanged\") — the placeholder, never a mask.\n * locale display + typed order; the browser's by default.\n *\n * Keyboard: type and press Enter (or leave the field) to commit; Escape\n * reverts; Alt+ArrowDown / ArrowDown opens the calendar; in the calendar the\n * arrows move a day / week, Home / End the week, PageUp / PageDown a month\n * (Shift: a year), Enter picks, Escape closes. Text the field cannot read\n * stays visible and the capsule turns destructive (`aria-invalid`) — nothing\n * is silently dropped.\n */\n\nimport { parseDateOnly, toDateOnly } from \"@ai-matrx/kit/dates\";\nimport * as React from \"react\";\n\nimport { BottomSheet } from \"../bottom-sheet\";\nimport { cn } from \"../cn\";\nimport { CalendarIcon, ChevronLeftIcon, ChevronRightIcon, ClockIcon, XIcon } from \"../icons\";\nimport { Popover, PopoverAnchor, PopoverContent } from \"../popover\";\nimport { useIsMobile } from \"../use-is-mobile\";\nimport type { ControlWidth } from \"./controls\";\nimport {\n type DateFieldMode,\n TIME_SLOTS,\n formatDay,\n formatTime,\n monthGrid,\n parseTypedDate,\n parseTypedTime,\n splitValue,\n weekStart,\n} from \"./date-parse\";\n\nexport type { DateFieldMode } from \"./date-parse\";\n\nexport interface DateFieldProps {\n /** ISO: `yyyy-mm-dd` (date), `yyyy-mm-ddTHH:mm` (datetime), `HH:mm` (time); `null`/\"\" is empty. */\n value: string | null | undefined;\n onValueChange: (value: string | null) => void;\n /** `date` (default), `datetime` (a day and a time in one capsule), `time`. */\n mode?: DateFieldMode | undefined;\n /** The empty word, shown as the placeholder: \"Pick a date\", \"Unchanged\". */\n emptyLabel?: string | undefined;\n /** BCP-47 tag for display and typed order; the browser's when omitted. */\n locale?: string | undefined;\n /** Show the clear (x) button when there is a value. Default `true`. */\n clearable?: boolean | undefined;\n disabled?: boolean | undefined;\n /** The day input's id, for a `<label htmlFor>`. */\n id?: string | undefined;\n \"aria-label\"?: string | undefined;\n /** A named width instead of filling the row. */\n width?: ControlWidth | undefined;\n /** Placement only (width, flex, grid). */\n className?: string | undefined;\n style?: React.CSSProperties | undefined;\n}\n\nconst sameDay = (a: Date, b: Date) =>\n a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();\n\nexport const DateField = React.forwardRef<HTMLDivElement, DateFieldProps>(\n (\n {\n value,\n onValueChange,\n mode = \"date\",\n emptyLabel,\n locale,\n clearable = true,\n disabled,\n id,\n \"aria-label\": ariaLabel,\n width,\n className,\n style,\n },\n ref,\n ) => {\n const isMobile = useIsMobile();\n const { day, time } = splitValue(value, mode);\n const hasDay = mode !== \"time\";\n const hasTime = mode !== \"date\";\n const empty = hasDay ? !day : !time;\n const word = emptyLabel ?? (mode === \"time\" ? \"Pick a time\" : \"Pick a date\");\n\n const dayText = day ? formatDay(day, locale) : \"\";\n const timeText = time ? formatTime(time, locale) : \"\";\n const [dayDraft, setDayDraft] = React.useState<string | null>(null);\n const [timeDraft, setTimeDraft] = React.useState<string | null>(null);\n const [dayInvalid, setDayInvalid] = React.useState(false);\n const [timeInvalid, setTimeInvalid] = React.useState(false);\n const [open, setOpen] = React.useState(false);\n const dayRef = React.useRef<HTMLInputElement>(null);\n const timeRef = React.useRef<HTMLInputElement>(null);\n\n // Escape on a draft reverts it — and only that. A dialog's Escape listener sits in the\n // document's capture phase, ahead of the input; the window's capture phase runs first, so a\n // draft is reverted there and the dialog (with the rest of the person's form) stays open.\n const hasDraft = dayDraft !== null || timeDraft !== null;\n React.useEffect(() => {\n if (!hasDraft) return;\n const onKey = (e: KeyboardEvent) => {\n if (e.key !== \"Escape\") return;\n const active = document.activeElement;\n if (active === dayRef.current && dayDraft !== null) {\n setDayDraft(null);\n setDayInvalid(false);\n } else if (active === timeRef.current && timeDraft !== null) {\n setTimeDraft(null);\n setTimeInvalid(false);\n } else {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n };\n window.addEventListener(\"keydown\", onKey, true);\n return () => window.removeEventListener(\"keydown\", onKey, true);\n }, [hasDraft, dayDraft, timeDraft]);\n\n const emit = (nextDay: string, nextTime: string) => {\n if (mode === \"time\") return onValueChange(nextTime || null);\n if (mode === \"date\") return onValueChange(nextDay || null);\n if (!nextDay && !nextTime) return onValueChange(null);\n onValueChange(`${nextDay || toDateOnly(new Date())}T${nextTime || \"00:00\"}`);\n };\n\n const commitDay = (text: string) => {\n const t = text.trim();\n if (!t) {\n setDayDraft(null);\n setDayInvalid(false);\n if (day) emit(\"\", mode === \"datetime\" ? \"\" : time);\n return true;\n }\n const parsed = parseTypedDate(t, locale);\n if (!parsed) {\n setDayInvalid(true);\n return false;\n }\n setDayDraft(null);\n setDayInvalid(false);\n if (parsed !== day) emit(parsed, time);\n return true;\n };\n\n const commitTime = (text: string) => {\n const t = text.trim();\n if (!t) {\n setTimeDraft(null);\n setTimeInvalid(false);\n if (time) emit(mode === \"time\" ? \"\" : day, \"\");\n return true;\n }\n const parsed = parseTypedTime(t);\n if (!parsed) {\n setTimeInvalid(true);\n return false;\n }\n setTimeDraft(null);\n setTimeInvalid(false);\n if (parsed !== time) emit(day, parsed);\n return true;\n };\n\n const pickDay = (iso: string) => {\n setDayDraft(null);\n setDayInvalid(false);\n setOpen(false);\n emit(iso, time);\n // Return to typing: a datetime moves on to its time.\n requestAnimationFrame(() => (mode === \"datetime\" ? timeRef : dayRef).current?.focus());\n };\n const pickTime = (hhmm: string) => {\n setTimeDraft(null);\n setTimeInvalid(false);\n setOpen(false);\n emit(day, hhmm);\n requestAnimationFrame(() => timeRef.current?.focus());\n };\n const clear = () => {\n setDayDraft(null);\n setTimeDraft(null);\n setDayInvalid(false);\n setTimeInvalid(false);\n setOpen(false);\n onValueChange(null);\n (hasDay ? dayRef : timeRef).current?.focus();\n };\n\n const inputKeys =\n (kind: \"day\" | \"time\") =>\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === \"Enter\") {\n e.preventDefault();\n if (kind === \"day\") commitDay(e.currentTarget.value);\n else commitTime(e.currentTarget.value);\n } else if (e.key === \"ArrowDown\" && (e.altKey || !e.currentTarget.value)) {\n e.preventDefault();\n if (kind === \"day\" ? commitDay(e.currentTarget.value) : commitTime(e.currentTarget.value)) setOpen(true);\n }\n };\n\n const panelKind: \"day\" | \"time\" = hasDay ? \"day\" : \"time\";\n const panel =\n panelKind === \"day\" ? (\n <CalendarGrid\n value={day}\n locale={locale}\n onPick={pickDay}\n onClose={() => setOpen(false)}\n footer={\n <>\n <button type=\"button\" className=\"matrx-date-panel-action\" onClick={() => pickDay(toDateOnly(new Date()))}>\n Today\n </button>\n {!empty && clearable ? (\n <button type=\"button\" className=\"matrx-date-panel-action\" onClick={clear}>\n Clear\n </button>\n ) : null}\n </>\n }\n />\n ) : (\n <TimeList value={time} locale={locale} onPick={pickTime} onClose={() => setOpen(false)} />\n );\n\n const glyph = (\n <button\n type=\"button\"\n tabIndex={-1}\n disabled={disabled}\n aria-label={hasDay ? \"Open calendar\" : \"Open times\"}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n data-matrx-date-trigger=\"\"\n onClick={() => setOpen((o) => !o)}\n >\n {hasDay ? <CalendarIcon /> : <ClockIcon />}\n </button>\n );\n\n const capsule = (\n <div\n ref={ref}\n role=\"group\"\n aria-label={ariaLabel ?? word}\n data-matrx-control=\"date-field\"\n data-mode={mode}\n data-glyph=\"start\"\n data-width={width}\n data-empty={empty ? \"\" : undefined}\n aria-disabled={disabled || undefined}\n className={cn(\"matrx-control matrx-control-field matrx-control-date\", className)}\n style={style}\n onMouseDown={(e) => {\n // A press on the capsule's padding types into it, like a text field.\n if (e.target === e.currentTarget) {\n e.preventDefault();\n (hasDay ? dayRef : timeRef).current?.focus();\n }\n }}\n >\n {glyph}\n {hasDay ? (\n <input\n ref={dayRef}\n id={id}\n type=\"text\"\n inputMode=\"text\"\n autoComplete=\"off\"\n spellCheck={false}\n disabled={disabled}\n value={dayDraft ?? dayText}\n placeholder={word}\n aria-label={ariaLabel ?? (mode === \"datetime\" ? \"Date\" : word)}\n aria-invalid={dayInvalid || undefined}\n onChange={(e) => {\n setDayDraft(e.target.value);\n setDayInvalid(false);\n }}\n onFocus={(e) => e.currentTarget.select()}\n onBlur={(e) => {\n if (dayDraft !== null) commitDay(e.target.value);\n }}\n onKeyDown={inputKeys(\"day\")}\n />\n ) : null}\n {hasTime ? (\n <input\n ref={timeRef}\n id={hasDay ? (id ? `${id}-time` : undefined) : id}\n type=\"text\"\n inputMode=\"text\"\n autoComplete=\"off\"\n spellCheck={false}\n disabled={disabled}\n value={timeDraft ?? timeText}\n placeholder={hasDay ? (day ? \"Time\" : \"\") : word}\n aria-label={hasDay ? \"Time\" : (ariaLabel ?? word)}\n aria-invalid={timeInvalid || undefined}\n data-matrx-date-part={hasDay ? \"time\" : undefined}\n onChange={(e) => {\n setTimeDraft(e.target.value);\n setTimeInvalid(false);\n }}\n onFocus={(e) => e.currentTarget.select()}\n onBlur={(e) => {\n if (timeDraft !== null) commitTime(e.target.value);\n }}\n onKeyDown={inputKeys(\"time\")}\n />\n ) : null}\n {clearable && !empty && !disabled ? (\n <button type=\"button\" aria-label=\"Clear\" data-matrx-date-clear=\"\" onClick={clear}>\n <XIcon />\n </button>\n ) : null}\n </div>\n );\n\n if (isMobile) {\n return (\n <>\n {capsule}\n <BottomSheet open={open} onOpenChange={setOpen} title={hasDay ? \"Pick a date\" : \"Pick a time\"} surface=\"solid\">\n <div className=\"matrx-date-sheet\">{panel}</div>\n </BottomSheet>\n </>\n );\n }\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverAnchor asChild>{capsule}</PopoverAnchor>\n <PopoverContent\n /* sizing: content — the calendar decides its own width */\n sizing=\"content\"\n padding=\"none\"\n align=\"start\"\n className=\"matrx-date-popover\"\n onOpenAutoFocus={(e) => e.preventDefault()}\n // The glyph toggles: a press on it is not an outside press (or it would close, then reopen).\n onInteractOutside={(e) => {\n const target = e.target as Element | null;\n if (target?.closest?.(\"[data-matrx-date-trigger]\")) e.preventDefault();\n }}\n >\n {panel}\n </PopoverContent>\n </Popover>\n );\n },\n);\nDateField.displayName = \"DateField\";\n\n/** A day and a time in one capsule: `yyyy-mm-ddTHH:mm`. */\nexport const DateTimeField = React.forwardRef<HTMLDivElement, Omit<DateFieldProps, \"mode\">>((props, ref) => (\n <DateField ref={ref} {...props} mode=\"datetime\" />\n));\nDateTimeField.displayName = \"DateTimeField\";\n\n/** A time of day: `HH:mm`. */\nexport const TimeField = React.forwardRef<HTMLDivElement, Omit<DateFieldProps, \"mode\">>((props, ref) => (\n <DateField ref={ref} {...props} mode=\"time\" />\n));\nTimeField.displayName = \"TimeField\";\n\n/* ------------------------------------------------------------------ */\n/* The calendar — a WAI-ARIA date grid with a roving focus */\n/* ------------------------------------------------------------------ */\n\nfunction CalendarGrid({\n value,\n locale,\n onPick,\n onClose,\n footer,\n}: {\n value: string;\n locale?: string | undefined;\n onPick: (iso: string) => void;\n onClose: () => void;\n footer?: React.ReactNode | undefined;\n}) {\n const selected = parseDateOnly(value);\n const today = new Date();\n const [focus, setFocus] = React.useState<Date>(() => selected ?? today);\n const gridRef = React.useRef<HTMLDivElement>(null);\n const firstDay = weekStart(locale);\n const days = monthGrid(focus.getFullYear(), focus.getMonth(), firstDay);\n const weekdayFmt = new Intl.DateTimeFormat(locale, { weekday: \"short\" });\n const weekdayLong = new Intl.DateTimeFormat(locale, { weekday: \"long\" });\n const monthFmt = new Intl.DateTimeFormat(locale, { month: \"long\", year: \"numeric\" });\n const dayLabel = new Intl.DateTimeFormat(locale, { weekday: \"long\", month: \"long\", day: \"numeric\", year: \"numeric\" });\n\n React.useEffect(() => {\n gridRef.current?.querySelector<HTMLButtonElement>('[tabindex=\"0\"]')?.focus();\n }, [focus]);\n\n const move = (days: number, months = 0) =>\n setFocus((f) => {\n if (months) {\n const target = new Date(f.getFullYear(), f.getMonth() + months, 1);\n const last = new Date(target.getFullYear(), target.getMonth() + 1, 0).getDate();\n return new Date(target.getFullYear(), target.getMonth(), Math.min(f.getDate(), last));\n }\n return new Date(f.getFullYear(), f.getMonth(), f.getDate() + days);\n });\n\n const onKeyDown = (e: React.KeyboardEvent) => {\n const col = (focus.getDay() - firstDay + 7) % 7;\n const keys: Record<string, () => void> = {\n ArrowLeft: () => move(-1),\n ArrowRight: () => move(1),\n ArrowUp: () => move(-7),\n ArrowDown: () => move(7),\n Home: () => move(-col),\n End: () => move(6 - col),\n PageUp: () => move(0, e.shiftKey ? -12 : -1),\n PageDown: () => move(0, e.shiftKey ? 12 : 1),\n Enter: () => onPick(toDateOnly(focus)),\n \" \": () => onPick(toDateOnly(focus)),\n Escape: onClose,\n };\n const run = keys[e.key];\n if (run) {\n e.preventDefault();\n e.stopPropagation();\n run();\n }\n };\n\n const headers = days.slice(0, 7);\n return (\n <div className=\"matrx-date-panel\" data-matrx-date-panel=\"calendar\">\n <div className=\"matrx-date-panel-head\">\n <button type=\"button\" className=\"matrx-date-panel-nav\" aria-label=\"Previous month\" onClick={() => move(0, -1)}>\n <ChevronLeftIcon />\n </button>\n <span className=\"matrx-date-panel-title\" aria-live=\"polite\">\n {monthFmt.format(focus)}\n </span>\n <button type=\"button\" className=\"matrx-date-panel-nav\" aria-label=\"Next month\" onClick={() => move(0, 1)}>\n <ChevronRightIcon />\n </button>\n </div>\n <div ref={gridRef} role=\"grid\" aria-label={monthFmt.format(focus)} className=\"matrx-date-grid\" onKeyDown={onKeyDown}>\n <div role=\"row\" className=\"matrx-date-row\">\n {headers.map((d) => (\n <span key={d.getDay()} role=\"columnheader\" aria-label={weekdayLong.format(d)} className=\"matrx-date-weekday\">\n {weekdayFmt.format(d).slice(0, 2)}\n </span>\n ))}\n </div>\n {[0, 1, 2, 3, 4, 5].map((w) => (\n <div key={w} role=\"row\" className=\"matrx-date-row\">\n {days.slice(w * 7, w * 7 + 7).map((d) => {\n const isSelected = selected ? sameDay(d, selected) : false;\n const isFocus = sameDay(d, focus);\n return (\n <span key={d.toISOString()} role=\"gridcell\" aria-selected={isSelected}>\n <button\n type=\"button\"\n tabIndex={isFocus ? 0 : -1}\n className=\"matrx-date-day\"\n data-outside={d.getMonth() !== focus.getMonth() ? \"\" : undefined}\n data-today={sameDay(d, today) ? \"\" : undefined}\n data-selected={isSelected ? \"\" : undefined}\n aria-label={dayLabel.format(d)}\n aria-current={sameDay(d, today) ? \"date\" : undefined}\n onClick={() => onPick(toDateOnly(d))}\n onFocus={() => {\n if (!isFocus) setFocus(d);\n }}\n >\n {d.getDate()}\n </button>\n </span>\n );\n })}\n </div>\n ))}\n </div>\n {footer ? <div className=\"matrx-date-panel-foot\">{footer}</div> : null}\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* The time list — half-hour slots, arrow keys, the value in view */\n/* ------------------------------------------------------------------ */\n\nfunction TimeList({\n value,\n locale,\n onPick,\n onClose,\n}: {\n value: string;\n locale?: string | undefined;\n onPick: (hhmm: string) => void;\n onClose: () => void;\n}) {\n const listRef = React.useRef<HTMLDivElement>(null);\n const start = value ? TIME_SLOTS.findIndex((s) => s >= value) : TIME_SLOTS.indexOf(\"09:00\");\n const [active, setActive] = React.useState(start < 0 ? TIME_SLOTS.length - 1 : start);\n\n React.useEffect(() => {\n const el = listRef.current?.querySelector<HTMLButtonElement>(`[data-index=\"${active}\"]`);\n el?.focus();\n el?.scrollIntoView?.({ block: \"nearest\" });\n }, [active]);\n\n const onKeyDown = (e: React.KeyboardEvent) => {\n const keys: Record<string, () => void> = {\n ArrowDown: () => setActive((a) => Math.min(TIME_SLOTS.length - 1, a + 1)),\n ArrowUp: () => setActive((a) => Math.max(0, a - 1)),\n Home: () => setActive(0),\n End: () => setActive(TIME_SLOTS.length - 1),\n Escape: onClose,\n };\n const run = keys[e.key];\n if (run) {\n e.preventDefault();\n e.stopPropagation();\n run();\n }\n };\n\n return (\n <div ref={listRef} role=\"listbox\" aria-label=\"Times\" className=\"matrx-date-panel matrx-time-list\" onKeyDown={onKeyDown}>\n {TIME_SLOTS.map((slot, i) => (\n <button\n key={slot}\n type=\"button\"\n role=\"option\"\n aria-selected={slot === value}\n tabIndex={i === active ? 0 : -1}\n data-index={i}\n data-selected={slot === value ? \"\" : undefined}\n className=\"matrx-time-slot\"\n onClick={() => onPick(slot)}\n >\n {formatTime(slot, locale)}\n </button>\n ))}\n </div>\n );\n}\n","\"use client\";\n\n/**\n * BottomSheet — the canonical mobile sheet. Ported verbatim from\n * matrx-frontend `components/official/bottom-sheet/BottomSheet.tsx` (S19).\n *\n * `vaul` is a sanctioned real dependency here, the same way\n * @radix-ui/react-alert-dialog is for @ai-matrx/kit `/confirm`: the drag-to-\n * dismiss drawer physics IS the component — there is no BottomSheet without\n * it, and reimplementing gesture/velocity handling would be a vendored twin\n * of a maintained library rather than of our own code. Rationale recorded in\n * FEATURE.md.\n *\n * Seam inversions:\n * - The vaul wrappers (root + unstyled content primitive) were inlined here\n * privately in 0.5.0 because no shared Drawer existed. Since 0.6.0 the\n * package OWNS `./drawer`, so this file composes `Drawer` and\n * `DrawerContentPrimitive` from it: one vaul wrapper in the package, not\n * two. BottomSheet keeps its own geometry (that IS its product).\n * - `ChevronLeft` is the package's inlined SVG (C19).\n *\n * Host-owned CSS contracts (documented, not shipped): the glass tokens\n * `--matrx-glass-bg` / `--matrx-glass-border-color`, the utility classes\n * `matrx-glass-thin-border` and `pb-safe`, and semantic color tokens.\n */\n\nimport { VisuallyHidden } from \"@radix-ui/react-visually-hidden\";\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\n\nimport { cn } from \"./cn\";\nimport { usePortalContainer } from \"./portal-container\";\nimport { Drawer as DrawerRoot, DrawerContentPrimitive } from \"./drawer\";\nimport { ChevronLeftIcon } from \"./icons\";\n\n\nexport interface BottomSheetProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n title?: string;\n /**\n * `adaptive` (default) — the sheet sizes to its content, up to\n * 90dvh (no minimum). Correct for a single short list.\n *\n * `full` — ONE fixed height (92dvh) that never changes as content changes.\n * Use it for any sheet whose body varies (multi-level navigation, tabs,\n * search results): an adaptive sheet there resizes under the user's thumb\n * on every keystroke and every drill-in, which reads as the panel jumping.\n */\n size?: \"adaptive\" | \"full\";\n /** Visual treatment for the panel. Solid is intended for dense, long-lived surfaces. */\n surface?: \"glass\" | \"solid\";\n /** Merged onto the sheet panel. */\n contentClassName?: string;\n children: React.ReactNode;\n}\n\nexport function BottomSheet({\n open,\n onOpenChange,\n title = \"Bottom Sheet\",\n size = \"adaptive\",\n surface = \"glass\",\n contentClassName,\n children,\n}: BottomSheetProps) {\n // The injected portal seam (portal-container.tsx), as every other layer: a sheet opened inside a\n // look=\"mac\" table mounts in its Mac layer, one opened in a popped-out window in that window.\n const container = usePortalContainer();\n return (\n <DrawerRoot open={open} onOpenChange={onOpenChange}>\n <DrawerPrimitive.Portal container={container}>\n {/* Identical output to the host's DrawerOverlay wrapper: its base\n classes merged with the caller classes, inline background wins. */}\n {/* The dialog layer (z-[10000], see dialog.tsx), never below it: a\n sheet opened from inside a dialog or modal (the phone's ⋯ menu in\n a compact chat modal) otherwise opens BEHIND that dialog's scrim.\n Equal z, so the later-opened layer paints on top. */}\n <DrawerPrimitive.Overlay\n className={cn(\"fixed inset-0 z-[10000] bg-[var(--matrx-overlay-scrim)]\", \"fixed inset-0 z-[10000]\")}\n style={{ background: \"var(--matrx-overlay-scrim-drawer)\" }}\n />\n <DrawerContentPrimitive\n className={cn(\n \"fixed inset-x-0 bottom-0 z-[10000] mt-24 flex flex-col rounded-t-2xl overflow-hidden\",\n // Adaptive sizes to its content, up to 90dvh — never a 60dvh floor that\n // left a two-action sheet mostly empty (hosts overrode it with min-h-0).\n size === \"full\" ? \"h-[92dvh]\" : \"max-h-[90dvh]\",\n surface === \"solid\" &&\n \"border border-b-0 border-border bg-background shadow-2xl\",\n contentClassName,\n )}\n style={\n surface === \"glass\"\n ? {\n background: \"var(--matrx-glass-bg)\",\n backdropFilter: \"blur(20px) saturate(180%)\",\n WebkitBackdropFilter: \"blur(20px) saturate(180%)\",\n border: \"1px solid var(--matrx-glass-border-color)\",\n borderBottom: \"none\",\n }\n : undefined\n }\n >\n <VisuallyHidden>\n <DrawerPrimitive.Title>{title}</DrawerPrimitive.Title>\n <DrawerPrimitive.Description>\n Bottom sheet panel.\n </DrawerPrimitive.Description>\n </VisuallyHidden>\n <div className=\"mx-auto mt-3 mb-1 h-1.5 w-10 rounded-full bg-muted-foreground/30 flex-shrink-0\" />\n {children}\n </DrawerContentPrimitive>\n </DrawerPrimitive.Portal>\n </DrawerRoot>\n );\n}\n\nexport interface BottomSheetHeaderProps {\n title: string;\n showBack?: boolean;\n onBack?: () => void;\n trailing?: React.ReactNode;\n}\n\nexport function BottomSheetHeader({\n title,\n showBack = false,\n onBack,\n trailing,\n}: BottomSheetHeaderProps) {\n return (\n <div className=\"flex items-center px-2 pt-1 pb-2 flex-shrink-0 min-h-[44px]\">\n <div className=\"min-w-[44px] flex items-center justify-start\">\n <button\n type=\"button\"\n aria-label=\"Back\"\n onClick={onBack}\n className={cn(\n \"h-8 w-8 rounded-full matrx-glass-thin-border flex items-center justify-center transition-all active:scale-95\",\n showBack ? \"opacity-100\" : \"opacity-0 pointer-events-none\",\n )}\n aria-hidden={!showBack}\n tabIndex={showBack ? 0 : -1}\n >\n <ChevronLeftIcon className=\"h-4 w-4 text-foreground\" />\n </button>\n </div>\n <span className=\"text-[17px] font-semibold flex-1 text-center truncate\">\n {title}\n </span>\n <div className=\"min-w-[44px] flex items-center justify-end\">\n {trailing}\n </div>\n </div>\n );\n}\n\nexport interface BottomSheetBodyProps {\n children: React.ReactNode;\n className?: string;\n}\n\nexport function BottomSheetBody({ children, className }: BottomSheetBodyProps) {\n return (\n <div\n className={cn(\n // min-h-0 is load-bearing: without it a flex child's min-height:auto\n // floors it at content height and the body grows instead of scrolling.\n \"min-h-0 flex-1 overflow-y-auto overscroll-contain pb-safe\",\n className,\n )}\n >\n {children}\n </div>\n );\n}\n\nexport interface BottomSheetFooterProps {\n children: React.ReactNode;\n className?: string;\n}\n\nexport function BottomSheetFooter({\n children,\n className,\n}: BottomSheetFooterProps) {\n return (\n <div\n data-slot=\"bottom-sheet-footer\"\n className={cn(\n \"flex-shrink-0 px-4 py-3 pb-safe border-t border-[var(--matrx-sheet-divider)]\",\n className,\n )}\n >\n {children}\n </div>\n );\n}\n","\"use client\";\n\n/**\n * Drawer — the vaul drawer family, and the package's iOS-mobile-first surface.\n *\n * WHY IT IS HERE. matrx-frontend's `components/ui/drawer.tsx` had 121 import\n * sites, and that host's own doctrine is \"Drawer, not Dialog, on mobile\" — so\n * the drawer is the surface most of this platform's mobile UX lands on. It was\n * also the LAST place still holding a copy of `RadixDialogModalProvider`, the\n * context this package already owned: a host copy of a React CONTEXT is the\n * quiet twin, because `useContext` matches by object identity, so the host\n * Drawer's provider and the package Sheet's consumer were two different\n * contexts that merely looked alike. Shipping the Drawer here closes that.\n *\n * `BottomSheet` (this package) previously inlined its own private vaul\n * wrappers because no Drawer existed to share; it now composes these, so there\n * is one vaul wrapper in the package rather than two.\n *\n * THE MOBILE-FIRST RULES THIS COMPONENT OWNS (so no host re-derives them):\n *\n * 1. `dvh`, NEVER `vh`. iOS Safari's `vh` is the tallest-possible viewport, so\n * a `vh`-capped drawer hides its own footer behind the browser chrome. The\n * cap is `max-h-[90dvh]`, and `size=\"full\"` is `h-dvh`.\n * 2. THE SAFE AREA IS PADDING, NOT A GUESS. Content bottom padding is\n * `pb-safe` (`env(safe-area-inset-bottom)`; shipped in `styles.css`), so the\n * home indicator never sits on top of the last control.\n * 3. THE GRAB HANDLE IS A 44px TARGET. The visible pill is 4px tall; it lives\n * inside a `min-h-11` (44px) grab area, the Apple HIG minimum. The old host\n * copy shipped the pill alone, so the affordance was three times smaller\n * than the gesture it advertises.\n * 4. THE BODY SCROLLS, THE FOOTER DOES NOT. `DrawerBody` is the\n * `flex-1 min-h-0 overflow-y-auto overscroll-contain` shard;\n * `DrawerFooter` is `mt-auto` and safe-area padded, so the primary action\n * is reachable however long the body is.\n * 5. A FIELD UNDER 16px ZOOMS iOS IN AND NEVER BACK OUT — the drawer's own\n * text scale therefore never goes below `text-base` on coarse pointers;\n * the floor itself is a host CSS concern, restated in `styles.css`.\n *\n * `direction` is forwarded to vaul and drives the content geometry, so a side\n * or top drawer is a prop rather than a fork.\n */\n\nimport { treeContainsComponent } from \"@ai-matrx/kit/react-tree\";\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\n\nimport { cn } from \"./cn\";\nimport { keepFloatingLayersInside, useModalLayer } from \"./floating-layer\";\nimport { RadixDialogModalProvider } from \"./radix-dialog-modal-context\";\n\nexport type DrawerDirection = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nconst DrawerDirectionContext = React.createContext<DrawerDirection>(\"bottom\");\n\n/** The direction of the nearest Drawer root. */\nexport const useDrawerDirection = (): DrawerDirection =>\n React.useContext(DrawerDirectionContext);\n\n/**\n * `vaul`'s Root props are a DISCRIMINATED UNION (the snap-point branch adds\n * `fadeFromIndex`), so this type intersects the union rather than `Omit`-ing\n * from it — flattening the union collapses the discriminant and makes every\n * snap-point drawer a type error.\n *\n * Vaul does not forward `modal={false}` to its underlying Radix root, so a\n * \"non-modal\" drawer would claim ARIA semantics it does not have; the type\n * refuses the value rather than shipping the lie.\n */\nexport type DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root> & {\n modal?: true;\n direction?: DrawerDirection;\n};\n\nconst Drawer = ({\n children,\n shouldScaleBackground = true,\n onOpenChange,\n ...props\n}: DrawerProps) => {\n const direction: DrawerDirection = props.direction ?? \"bottom\";\n const handleOpenChange = (open: boolean) => {\n if (\n open &&\n typeof document !== \"undefined\" &&\n document.activeElement instanceof HTMLElement\n ) {\n // Vaul applies aria-hidden to the application tree synchronously, before\n // Radix transfers focus into the portalled dialog. Release the trigger\n // first so a focused descendant is never hidden from assistive tech.\n document.activeElement.blur();\n }\n onOpenChange?.(open);\n };\n return (\n <RadixDialogModalProvider modal>\n <DrawerDirectionContext.Provider value={direction}>\n <DrawerPrimitive.Root\n modal\n shouldScaleBackground={shouldScaleBackground}\n {...props}\n onOpenChange={handleOpenChange}\n direction={direction}\n >\n {children}\n </DrawerPrimitive.Root>\n </DrawerDirectionContext.Provider>\n </RadixDialogModalProvider>\n );\n};\nDrawer.displayName = \"Drawer\";\n\nconst DrawerTrigger = DrawerPrimitive.Trigger;\nconst DrawerPortal = DrawerPrimitive.Portal;\nconst DrawerClose = DrawerPrimitive.Close;\n\nconst DrawerOverlay = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Overlay\n ref={ref}\n data-slot=\"drawer-overlay\"\n className={cn(\n \"fixed inset-0 z-[10000] bg-[var(--matrx-overlay-scrim)]\",\n className,\n )}\n {...props}\n />\n));\nDrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;\n\nconst DrawerDescription = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Description\n ref={ref}\n data-slot=\"drawer-description\"\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n/**\n * Unstyled, non-portalling Content for custom Drawer layouts. It derives\n * explicit modal semantics while vaul retains focus/background behavior.\n */\nconst DrawerContentPrimitive = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>\n>(({ onInteractOutside, ...props }, ref) => {\n // A drawer is always modal: floating layers opened from it stack above its\n // scrim, and a press inside one is not an outside press (floating-layer.tsx).\n useModalLayer(true);\n return (\n <DrawerPrimitive.Content\n // NO SLIDE-IN (styles.css, `[data-matrx-entrance=\"none\"]`). Measured on\n // a 375x812 phone (PB-08, 2026-10-01): for ~250 ms after open the spot\n // where a row settles was still the SCRIM, so a tap there was an outside\n // press and closed the sheet; for the next ~150 ms it was a DIFFERENT\n // row. The sheet is therefore at rest from its first frame; the scrim\n // still fades and the exit still slides. Same class as the composer\n // menu's popper entrance (matrx-frontend 286ef577fb).\n data-matrx-entrance=\"none\"\n {...props}\n ref={ref}\n aria-modal=\"true\"\n onInteractOutside={keepFloatingLayersInside(onInteractOutside)}\n />\n );\n});\nDrawerContentPrimitive.displayName = \"DrawerContentPrimitive\";\n\n/**\n * `adaptive` (default) sizes to content up to 90dvh — right for one short\n * list. `full` is ONE fixed height that never changes as content changes: use\n * it for any drawer whose body varies (tabs, search results, multi-level\n * navigation), because an adaptive drawer there resizes under the user's thumb\n * on every keystroke, which reads as the panel jumping.\n */\nexport type DrawerSize = \"adaptive\" | \"full\";\n\nconst DIRECTION_CLASSES: Record<DrawerDirection, string> = {\n bottom:\n \"inset-x-0 bottom-0 mt-24 flex-col rounded-t-[10px] border-t pb-safe\",\n top: \"inset-x-0 top-0 mb-24 flex-col rounded-b-[10px] border-b pt-safe\",\n left: \"inset-y-0 left-0 mr-24 flex-row rounded-r-[10px] border-r\",\n right: \"inset-y-0 right-0 ml-24 flex-row rounded-l-[10px] border-l\",\n};\n\nconst SIZE_CLASSES: Record<DrawerDirection, Record<DrawerSize, string>> = {\n bottom: { adaptive: \"h-auto max-h-[90dvh]\", full: \"h-[92dvh]\" },\n top: { adaptive: \"h-auto max-h-[90dvh]\", full: \"h-[92dvh]\" },\n left: { adaptive: \"w-auto max-w-[92vw]\", full: \"h-dvh w-[92vw] max-w-sm\" },\n right: { adaptive: \"w-auto max-w-[92vw]\", full: \"h-dvh w-[92vw] max-w-sm\" },\n};\n\nexport interface DrawerContentProps\n extends React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content> {\n /** Height/width posture. Default `adaptive`. */\n size?: DrawerSize;\n /** Render the drag-handle pill. Default: only for `top`/`bottom` drawers. */\n showHandle?: boolean;\n}\n\nconst DrawerContent = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Content>,\n DrawerContentProps\n>(({ className, children, size = \"adaptive\", showHandle, ...props }, ref) => {\n const direction = useDrawerDirection();\n const hasDescription =\n treeContainsComponent(children, DrawerDescription) ||\n treeContainsComponent(children, DrawerPrimitive.Description);\n const withHandle =\n showHandle ?? (direction === \"bottom\" || direction === \"top\");\n\n return (\n <DrawerPortal>\n <DrawerOverlay />\n <DrawerContentPrimitive\n ref={ref}\n data-slot=\"drawer-content\"\n data-direction={direction}\n className={cn(\n \"fixed z-[10000] flex min-w-0 border bg-background\",\n DIRECTION_CLASSES[direction],\n SIZE_CLASSES[direction][size],\n className,\n )}\n {...(hasDescription ? {} : { \"aria-describedby\": undefined })}\n {...props}\n >\n {withHandle ? (\n // Rule 3: the pill is 4px; the TARGET is 44px.\n <div\n aria-hidden\n data-slot=\"drawer-handle\"\n className={cn(\n \"flex min-h-11 w-full shrink-0 cursor-grab items-center justify-center active:cursor-grabbing\",\n direction === \"top\" && \"order-last\",\n )}\n >\n <div className=\"h-1 w-[100px] rounded-full bg-muted\" />\n </div>\n ) : null}\n {children}\n </DrawerContentPrimitive>\n </DrawerPortal>\n );\n});\nDrawerContent.displayName = \"DrawerContent\";\n\nconst DrawerHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n \"grid shrink-0 gap-1.5 p-4 text-center sm:text-left\",\n className,\n )}\n {...props}\n />\n);\nDrawerHeader.displayName = \"DrawerHeader\";\n\n/**\n * The scroll shard. `flex-1 min-h-0` is the pair that actually bounds a scroll\n * area inside a flex column — `flex-1` alone leaves `min-height: auto`, and the\n * body grows past the drawer instead of scrolling inside it.\n */\nconst DrawerBody = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n data-slot=\"drawer-body\"\n className={cn(\"min-h-0 flex-1 overflow-y-auto overscroll-contain px-4\", className)}\n {...props}\n />\n);\nDrawerBody.displayName = \"DrawerBody\";\n\nconst DrawerFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n data-slot=\"drawer-footer\"\n className={cn(\"mt-auto flex shrink-0 flex-col gap-2 p-4 pb-safe\", className)}\n {...props}\n />\n);\nDrawerFooter.displayName = \"DrawerFooter\";\n\nconst DrawerTitle = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n data-slot=\"drawer-title\"\n className={cn(\n \"text-lg font-semibold leading-none tracking-tight\",\n className,\n )}\n {...props}\n />\n));\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\nexport {\n Drawer,\n DrawerBody,\n DrawerClose,\n DrawerContent,\n DrawerContentPrimitive,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerOverlay,\n DrawerPortal,\n DrawerTitle,\n DrawerTrigger,\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/** THE tooltip layer (defined beside the tooltips, `title-tooltips.ts`). */\nexport { TOOLTIP_LAYER_Z } from \"./title-tooltips\";\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\n// ── THE Escape stack ────────────────────────────────────────────────────────\n// One Escape owner for every floating window (summon's WindowPanel and\n// LiteWindow, the PeekWindow here): the TOPMOST open layer gets the key, and\n// only it — two windows never close on one press, and a window under another\n// never closes first. A layer joins on open (top), `raise()`s when it comes to\n// the front (a focused window), and leaves on close. Its handler decides\n// whether it closes (a menu or dialog it does not own may hold the key) and\n// calls `preventDefault()` when it does; a layer that declines still keeps the\n// key from the layers under it. One window listener, shared across bundled\n// copies of this module through a global slot (like the modal registry).\ninterface EscapeLayerEntry {\n readonly key: symbol;\n handle: (event: KeyboardEvent) => void;\n}\ninterface EscapeStack {\n layers: EscapeLayerEntry[];\n listening: boolean;\n}\nconst ESCAPE_SLOT = Symbol.for(\"ai-matrx.design-system.escape-stack\");\nconst escapeHost = globalThis as typeof globalThis & { [ESCAPE_SLOT]?: EscapeStack };\nconst escapeStack = (): EscapeStack => (escapeHost[ESCAPE_SLOT] ??= { layers: [], listening: false });\n\nfunction onEscapeKeydown(event: KeyboardEvent): void {\n if (event.key !== \"Escape\" || event.defaultPrevented) return;\n const { layers } = escapeStack();\n layers[layers.length - 1]?.handle(event);\n}\n\nexport interface EscapeLayerHandle {\n /** Move this layer to the top (it came to the front). */\n raise(): void;\n /** Leave the stack (closed). */\n release(): void;\n}\n\n/** Join the Escape stack at the top. The handler runs only while this layer is topmost. */\nexport function pushEscapeLayer(handle: (event: KeyboardEvent) => void): EscapeLayerHandle {\n const stack = escapeStack();\n if (!stack.listening && typeof window !== \"undefined\") {\n window.addEventListener(\"keydown\", onEscapeKeydown);\n stack.listening = true;\n }\n const entry: EscapeLayerEntry = { key: Symbol(\"escape-layer\"), handle };\n stack.layers.push(entry);\n const drop = () => {\n const at = stack.layers.indexOf(entry);\n if (at !== -1) stack.layers.splice(at, 1);\n };\n return {\n raise() {\n drop();\n stack.layers.push(entry);\n },\n release: drop,\n };\n}\n\n/** How many layers hold the Escape stack (tests and diagnostics). */\nexport function escapeLayerDepth(): number {\n return escapeStack().layers.length;\n}\n\n/**\n * Hold a place in the Escape stack while `active`. The latest `onEscape` runs\n * (never a stale closure). `raiseKey`: when it changes the layer moves to the\n * top (pass a window manager's z-index). Returns a stable `raise()` for a\n * layer that tracks \"front\" itself (a pointerdown on the window).\n */\nexport function useEscapeLayer(active: boolean, onEscape: (event: KeyboardEvent) => void, raiseKey?: unknown): () => void {\n const latest = React.useRef(onEscape);\n latest.current = onEscape;\n const handleRef = React.useRef<EscapeLayerHandle | null>(null);\n React.useEffect(() => {\n if (!active) return undefined;\n const handle = pushEscapeLayer((event) => latest.current(event));\n handleRef.current = handle;\n return () => {\n handle.release();\n handleRef.current = null;\n };\n }, [active]);\n const first = React.useRef(true);\n React.useEffect(() => {\n if (first.current) {\n first.current = false;\n return;\n }\n handleRef.current?.raise();\n }, [raiseKey]);\n return React.useCallback(() => handleRef.current?.raise(), []);\n}\n","/**\n * THE TITLE TAKEOVER — every native `title` attribute in the document shows\n * as THE fleet tooltip instead of the browser's.\n *\n * Why this exists. A `title=` is the one tooltip nobody has to import, so it\n * is what every hand-written control reaches for: ~50 of them on an ordinary\n * matrx-frontend page (2026-09-28), next to the Radix tooltips on the tap\n * buttons. The browser draws those as a slow, unstyled system box, and a page\n * that mixes the two reads as having \"lost all of its tooltips\" (Arman,\n * 2026-09-28). Asking every author — human or agent — to wrap every control in\n * `<Tooltip>` is a rule that is broken the day it is written. So the\n * `TooltipProvider` every host already mounts at its root installs this layer,\n * and a `title` is simply a tooltip from then on. Nothing to remember.\n *\n * How it works. On hover (mouse or pen) or keyboard focus (`:focus-visible`)\n * of an element that carries a `title`, the attribute is lifted onto\n * `data-matrx-title` for exactly as long as the pointer or focus stays — so\n * the browser has nothing to show — and one shared, script-placed element\n * wearing `.matrx-tooltip` shows the text instead. When the pointer or focus\n * leaves, the `title` is put back, so assistive technology and every\n * `[title]` selector read the element exactly as authored the rest of the\n * time. Touch never shows it (a `title` has no touch affordance either).\n *\n * What it does not draw: a tooltip that only repeats text already readable in\n * full inside the element (it still draws when that text is hidden or\n * truncated).\n *\n * What it leaves alone:\n * - an element that is already a Radix tooltip trigger\n * (`[data-matrx-tooltip-trigger]`, stamped by `TooltipTrigger`): its\n * `title` is still lifted — two tooltips on one control was the other\n * half of the mess — but only the Radix one shows;\n * - anything inside `[data-native-title]` (the explicit opt-out);\n * - SVG `<title>` children, which are elements, not attributes.\n *\n * Placement. `tooltipSide` (THE SMART SIDE, below): beside a control in a\n * vertical stack, else the host's side; flipped when there is no room,\n * clamped into the viewport. `data-title-side=\"right\" | \"left\" | \"bottom\" |\n * \"top\"` on the element or any ancestor states a preferred side — a vertical\n * rail sets `right` once on its container.\n *\n * Installed at most once per document, reference-counted across every\n * mounted provider, and removed when the last one unmounts.\n */\n\n/**\n * THE SMART SIDE (Arman, 2026-10-15: tooltips \"don't show up intelligently\"). A tooltip never\n * covers the control next to its own. Where the control's neighbours stand decides the side:\n * - an explicit side (a prop, or `data-title-side` on the control or an ancestor below <html>) wins;\n * - an icon-sized control in a vertical stack (an icon column, a tool palette) has its neighbours\n * above and below, so it opens beside the control: right, or left when the control is in the\n * window's right half (an inspector column). A wide row in a list keeps the host's side: its\n * tooltip is the row's own text in full, and beside it would sit over the page next to the list;\n * - anywhere else (a toolbar, a row of buttons, a lone control) it opens on the host's default\n * side (`data-title-side` on <html>: macOS desktop hosts say \"bottom\"; the web's is \"top\").\n * Either way it flips to the other side when there is no room, and stays inside the window.\n */\nexport function tooltipSide(el: Element | null, fallback?: Side): Side {\n if (!el) return fallback ?? \"top\";\n const doc = el.ownerDocument;\n const hinted = el.closest(\"[data-title-side]\");\n const hint = hinted?.getAttribute(\"data-title-side\");\n const isSide = (v: string | null | undefined): v is Side => v === \"top\" || v === \"bottom\" || v === \"left\" || v === \"right\";\n if (hinted && hinted !== doc.documentElement && isSide(hint)) return hint;\n const base: Side = fallback ?? (isSide(hint) ? hint : \"top\");\n const box = el.getBoundingClientRect();\n if (box.width <= ICON_CONTROL_MAX_PX && stackDirection(el) === \"vertical\") {\n const vw = doc.defaultView?.innerWidth ?? 0;\n return vw > 0 && box.left + box.width / 2 > vw / 2 ? \"left\" : \"right\";\n }\n return base;\n}\n\n/** The widest control that counts as an icon (a navigator item, a palette tool). */\nconst ICON_CONTROL_MAX_PX = 64;\n\n/** How the control's nearest group of siblings is laid out, from where they actually are on screen. */\nfunction stackDirection(el: Element): \"vertical\" | \"horizontal\" | null {\n let node: Element | null = el;\n for (let depth = 0; node && depth < 4; depth++, node = node.parentElement) {\n const parent: Element | null = node.parentElement;\n if (!parent) return null;\n const me = node.getBoundingClientRect();\n if (me.width === 0 && me.height === 0) return null;\n let vertical = 0;\n let horizontal = 0;\n for (const sib of Array.from(parent.children)) {\n if (sib === node) continue;\n const r = sib.getBoundingClientRect();\n if (r.width === 0 || r.height === 0) continue;\n const overlapX = Math.min(me.right, r.right) - Math.max(me.left, r.left);\n const overlapY = Math.min(me.bottom, r.bottom) - Math.max(me.top, r.top);\n if (overlapX > 0.5 * Math.min(me.width, r.width) && overlapY <= 0) vertical++;\n else if (overlapY > 0.5 * Math.min(me.height, r.height) && overlapX <= 0) horizontal++;\n }\n if (vertical > 0 && horizontal === 0) return \"vertical\";\n if (horizontal > 0) return \"horizontal\";\n }\n return null;\n}\n\nexport const TITLE_TOOLTIP_ATTR = \"data-matrx-title\";\nexport const TOOLTIP_TRIGGER_ATTR = \"data-matrx-tooltip-trigger\";\nexport const NATIVE_TITLE_OPT_OUT_ATTR = \"data-native-title\";\n\nexport type Side = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nconst OPEN_DELAY_MS = 350;\n/** Moving from one titled control to the next inside this window is instant. */\nconst SKIP_DELAY_MS = 500;\n/**\n * THE HOVER BRIDGE. Leaving the control does not close the tooltip at once: the pointer has this\n * long to reach the tooltip itself (Arman, 2026-10-14: a tooltip must stay long enough to put the\n * mouse on it and copy its text). Entering the tooltip holds it open.\n */\n/**\n * THE TOOLTIP LAYER — above every other layer, always (Arman, 2026-10-14: a tooltip \"coming up\n * behind the content\"). Menus and popovers share the modal tier (equal z, DOM order decides), so a\n * tooltip on that tier lost to any menu opened after it. A tooltip is transient and never takes a\n * press, so nothing ever needs to sit above it.\n */\nexport const TOOLTIP_LAYER_Z = 2_147_483_000;\n\nexport const TOOLTIP_CLOSE_DELAY_MS = 300;\nconst GAP_PX = 6;\nconst EDGE_PX = 8;\n/** How far every tooltip stays from the window's edge (both implementations). */\nexport const TOOLTIP_EDGE_PX = EDGE_PX;\n/**\n * A tooltip is a short hint, never a paragraph (Apple HIG: a tooltip is a few words): text past\n * this budget is cut at a word boundary with an ellipsis. Long detail belongs in a sheet or a\n * Copy details action, not on hover.\n */\nexport const TOOLTIP_TEXT_BUDGET = 140;\n\nexport function clipTooltipText(text: string, budget: number = TOOLTIP_TEXT_BUDGET): string {\n const flat = text.replace(/\\s+/g, \" \").trim();\n if (flat.length <= budget) return flat;\n const cut = flat.slice(0, budget - 1);\n const space = cut.lastIndexOf(\" \");\n return `${(space > budget * 0.6 ? cut.slice(0, space) : cut).replace(/[\\s,.;:–—-]+$/, \"\")}…`;\n}\n\nconst SURFACE_CLASS =\n \"matrx-tooltip matrx-title-tooltip matrx-motion-popper max-w-xs select-text rounded-md border border-border bg-popover px-2.5 py-1 text-xs font-medium text-popover-foreground\";\n\ninterface Installation {\n count: number;\n uninstall: () => void;\n}\n\n/**\n * Keyed on the document itself through a registered symbol, never a module\n * WeakMap: tsup bundles this module into more than one entry (`index`,\n * `tap-target`), and two module copies each holding their own map would\n * install twice — two listeners, two surfaces.\n */\nconst INSTALLATION_KEY = Symbol.for(\"@ai-matrx/design-system/title-tooltips\");\ntype DocumentWithInstallation = Document & { [INSTALLATION_KEY]?: Installation };\nconst installations = {\n get: (doc: Document) => (doc as DocumentWithInstallation)[INSTALLATION_KEY],\n set: (doc: Document, value: Installation) => {\n (doc as DocumentWithInstallation)[INSTALLATION_KEY] = value;\n },\n delete: (doc: Document) => {\n delete (doc as DocumentWithInstallation)[INSTALLATION_KEY];\n },\n};\n\n/** Install the takeover on `doc`. Returns the release function. */\nexport function acquireTitleTooltips(doc: Document | undefined = typeof document === \"undefined\" ? undefined : document): () => void {\n if (!doc) return () => {};\n const existing = installations.get(doc);\n if (existing) {\n existing.count += 1;\n } else {\n installations.set(doc, { count: 1, uninstall: install(doc) });\n }\n let released = false;\n return () => {\n if (released) return;\n released = true;\n const current = installations.get(doc);\n if (!current) return;\n current.count -= 1;\n if (current.count <= 0) {\n current.uninstall();\n installations.delete(doc);\n }\n };\n}\n\nfunction install(doc: Document): () => void {\n const win = doc.defaultView;\n let active: HTMLElement | null = null;\n let surface: HTMLDivElement | null = null;\n let openTimer: ReturnType<typeof setTimeout> | undefined;\n let closeTimer: ReturnType<typeof setTimeout> | undefined;\n let lastClosedAt = 0;\n /** A press began on the tooltip (selecting its text): it must not close until release. */\n let holding = false;\n\n const HTMLElementCtor = win?.HTMLElement;\n\n const titledAncestor = (node: EventTarget | null): HTMLElement | null => {\n if (!HTMLElementCtor || !(node instanceof win!.Node)) return null;\n const start = node instanceof HTMLElementCtor ? node : (node as Node).parentElement;\n if (!start) return null;\n const el = start.closest<HTMLElement>(`[title], [${TITLE_TOOLTIP_ATTR}]`);\n if (!el || !(el instanceof HTMLElementCtor)) return null;\n if (el.closest(`[${NATIVE_TITLE_OPT_OUT_ATTR}]`)) return null;\n return el;\n };\n\n const textOf = (el: HTMLElement) => clipTooltipText(el.getAttribute(TITLE_TOOLTIP_ATTR) ?? el.getAttribute(\"title\") ?? \"\");\n\n const lift = (el: HTMLElement) => {\n const title = el.getAttribute(\"title\");\n if (title === null) return;\n el.setAttribute(TITLE_TOOLTIP_ATTR, title);\n el.removeAttribute(\"title\");\n };\n\n const restore = (el: HTMLElement) => {\n const held = el.getAttribute(TITLE_TOOLTIP_ATTR);\n if (held === null) return;\n // An author who changed or removed the title while it was lifted wins:\n // only put ours back when nothing re-set it in the meantime.\n if (!el.hasAttribute(\"title\")) el.setAttribute(\"title\", held);\n el.removeAttribute(TITLE_TOOLTIP_ATTR);\n };\n\n const ensureSurface = () => {\n if (surface && surface.isConnected) return surface;\n surface = doc.createElement(\"div\");\n surface.setAttribute(\"role\", \"tooltip\");\n surface.setAttribute(\"data-slot\", \"title-tooltip\");\n surface.className = SURFACE_CLASS;\n surface.style.position = \"fixed\";\n surface.style.zIndex = String(TOOLTIP_LAYER_Z);\n surface.style.visibility = \"hidden\";\n doc.body.appendChild(surface);\n return surface;\n };\n\n /**\n * THE PART OF `el` A PERSON CAN SEE: its box clipped by every ancestor that clips (scrolls or hides\n * overflow) and by the window. A truncated cell in a sideways-scrolling table is far wider than its\n * visible part; anchored to the whole box the tooltip landed at the window's edge (2026-10-14).\n */\n const visibleRect = (el: HTMLElement, vw: number, vh: number) => {\n const box = el.getBoundingClientRect();\n let left = box.left;\n let top = box.top;\n let right = box.right;\n let bottom = box.bottom;\n for (let node = el.parentElement; node && node !== doc.body && node !== doc.documentElement; node = node.parentElement) {\n const cs = win?.getComputedStyle(node);\n if (!cs) break;\n const clipsX = cs.overflowX !== \"visible\" || cs.overflow === \"hidden\";\n const clipsY = cs.overflowY !== \"visible\" || cs.overflow === \"hidden\";\n if (!clipsX && !clipsY) continue;\n const clip = node.getBoundingClientRect();\n if (clipsX) { left = Math.max(left, clip.left); right = Math.min(right, clip.right); }\n if (clipsY) { top = Math.max(top, clip.top); bottom = Math.min(bottom, clip.bottom); }\n }\n left = Math.max(left, 0);\n top = Math.max(top, 0);\n right = Math.min(right, vw || right);\n bottom = Math.min(bottom, vh || bottom);\n // Nothing of it is visible (scrolled away under the pointer is impossible, but a test DOM can say so): the box itself.\n if (right <= left || bottom <= top) return box;\n return { left, top, right, bottom, width: right - left, height: bottom - top };\n };\n\n const preferredSide = (el: HTMLElement): Side => tooltipSide(el);\n\n const place = (el: HTMLElement, node: HTMLDivElement) => {\n // The VISIBLE viewport, not the window: inside a clipped host (the kind\n // sandbox frame is window-wide but shown only at its column) the visual\n // viewport is what the reader sees, so a tooltip never lands past it.\n const vw = win?.visualViewport?.width ?? win?.innerWidth ?? 0;\n const vh = win?.visualViewport?.height ?? win?.innerHeight ?? 0;\n const anchor = visibleRect(el, vw, vh);\n const box = node.getBoundingClientRect();\n const fits: Record<Side, boolean> = {\n top: anchor.top - GAP_PX - box.height >= EDGE_PX,\n bottom: anchor.bottom + GAP_PX + box.height <= vh - EDGE_PX,\n left: anchor.left - GAP_PX - box.width >= EDGE_PX,\n right: anchor.right + GAP_PX + box.width <= vw - EDGE_PX,\n };\n const opposite: Record<Side, Side> = { top: \"bottom\", bottom: \"top\", left: \"right\", right: \"left\" };\n const wanted = preferredSide(el);\n const side: Side = fits[wanted] ? wanted : fits[opposite[wanted]] ? opposite[wanted] : wanted;\n\n let x: number;\n let y: number;\n if (side === \"top\" || side === \"bottom\") {\n x = anchor.left + anchor.width / 2 - box.width / 2;\n y = side === \"top\" ? anchor.top - GAP_PX - box.height : anchor.bottom + GAP_PX;\n } else {\n y = anchor.top + anchor.height / 2 - box.height / 2;\n x = side === \"left\" ? anchor.left - GAP_PX - box.width : anchor.right + GAP_PX;\n }\n x = Math.min(Math.max(x, EDGE_PX), Math.max(EDGE_PX, vw - EDGE_PX - box.width));\n y = Math.min(Math.max(y, EDGE_PX), Math.max(EDGE_PX, vh - EDGE_PX - box.height));\n // Placed with `left`/`top`, NEVER `transform`: the open animation\n // (`.matrx-motion-popper`) animates `transform`, and a running animation\n // overrides an inline transform — the chip sat at the page's top-left\n // corner for the whole animation, then jumped to its control (2026-10-08).\n node.style.left = `${Math.round(x)}px`;\n node.style.top = `${Math.round(y)}px`;\n node.setAttribute(\"data-side\", side);\n };\n\n const isShown = (node: HTMLElement, root: HTMLElement) => {\n const rect = node.getBoundingClientRect();\n if (rect.width <= 0 || rect.height <= 0) return false;\n for (let cur: HTMLElement | null = node; cur; cur = cur === root ? null : cur.parentElement) {\n const cs = win?.getComputedStyle(cur);\n if (!cs) return false;\n if (cs.display === \"none\" || cs.visibility === \"hidden\" || Number(cs.opacity) === 0) return false;\n }\n return true;\n };\n\n /**\n * A tooltip that repeats text the person can already read in full is noise\n * (an expanded sidebar row, a \"Save\" button titled \"Save\"). It still shows\n * when that text is hidden (a collapsed rail's label) or cut off\n * (truncated) — the two cases a title exists for.\n */\n const isClipped = (host: HTMLElement, root: HTMLElement) => {\n for (let node: HTMLElement | null = host; node; node = node.parentElement) {\n if (node.scrollWidth > node.clientWidth + 1 && node.clientWidth > 0) return true;\n if (node.scrollHeight > node.clientHeight + 1 && node.clientHeight > 0) return true;\n if (node === root) break;\n }\n return false;\n };\n\n const repeatsVisibleText = (el: HTMLElement, text: string) => {\n const norm = (t: string) => t.replace(/\\s+/g, \" \").trim().toLowerCase();\n const want = norm(text);\n if (!want || !win) return false;\n const walker = doc.createTreeWalker(el, win.NodeFilter.SHOW_TEXT);\n for (let node = walker.nextNode(); node; node = walker.nextNode()) {\n if (norm(node.textContent ?? \"\") !== want) continue;\n const host = node.parentElement;\n if (!host || !isShown(host, el)) continue;\n // Cut off is measured on the BOX that clips: an inline host (a span inside a truncating\n // cell) has no box width of its own, so every ancestor up to the titled element is asked.\n if (isClipped(host, el)) continue;\n return true;\n }\n return false;\n };\n\n const show = (el: HTMLElement, instant: boolean) => {\n if (active !== el) return;\n // A Radix tooltip trigger shows its own tooltip — never a second one.\n if (el.closest(`[${TOOLTIP_TRIGGER_ATTR}]`)) return;\n const text = textOf(el);\n if (!text || !el.isConnected) return;\n if (repeatsVisibleText(el, text)) return;\n const node = ensureSurface();\n node.textContent = text;\n node.style.visibility = \"hidden\";\n // Measure and place BEFORE the open state starts the animation: measured\n // mid-animation the box reads at its 0.95 entry scale and lands off-centre.\n node.removeAttribute(\"data-state\");\n // The surface is ONE shared fixed element that keeps the `left` of its last\n // placement. Measured there, a longer text wraps against the room that is\n // left of the OLD spot, reads one line too tall, and lands a line too high\n // once it moves (the sandbox tooltip spec caught a 16px extra gap). Rewind\n // to the origin so the box is measured at its natural, unwrapped size.\n node.style.left = \"0px\";\n node.style.top = \"0px\";\n place(el, node);\n node.setAttribute(\"data-state\", instant ? \"instant-open\" : \"delayed-open\");\n node.style.visibility = \"visible\";\n if (el.id) node.id = `${el.id}-title-tooltip`;\n };\n\n const hide = () => {\n if (openTimer !== undefined) clearTimeout(openTimer);\n openTimer = undefined;\n cancelClose();\n holding = false;\n if (surface && surface.style.visibility === \"visible\") lastClosedAt = Date.now();\n if (surface) {\n surface.style.visibility = \"hidden\";\n surface.removeAttribute(\"data-state\");\n }\n };\n\n const cancelClose = () => {\n if (closeTimer !== undefined) clearTimeout(closeTimer);\n closeTimer = undefined;\n };\n\n const inSurface = (node: EventTarget | null) =>\n !!surface && !!win && node instanceof win.Node && surface.contains(node);\n\n const hasSelectionInSurface = () => {\n const sel = win?.getSelection();\n return !!sel && !sel.isCollapsed && !!surface && !!sel.anchorNode && surface.contains(sel.anchorNode);\n };\n\n /** Close after the bridge delay unless the pointer reached the tooltip or text in it is selected. */\n const scheduleClose = () => {\n cancelClose();\n // Nothing is showing yet (the open delay has not run, or the text was not worth drawing): there is\n // nothing to bridge to, so leaving simply cancels.\n if (!surface || surface.style.visibility !== \"visible\") {\n deactivate();\n return;\n }\n closeTimer = setTimeout(() => {\n closeTimer = undefined;\n if (holding || hasSelectionInSurface()) return;\n deactivate();\n }, TOOLTIP_CLOSE_DELAY_MS);\n };\n\n const activate = (el: HTMLElement) => {\n cancelClose();\n if (active === el) return;\n deactivate();\n active = el;\n lift(el);\n const instant = Date.now() - lastClosedAt < SKIP_DELAY_MS;\n if (instant) show(el, true);\n else openTimer = setTimeout(() => show(el, false), OPEN_DELAY_MS);\n };\n\n const deactivate = () => {\n hide();\n if (active) restore(active);\n active = null;\n };\n\n // A touch has no hover: the tap that focuses a button must not open its tooltip, and a tooltip\n // that is open when a finger lands closes. The compat mouse events and the focus a tap leaves\n // behind used to pin \"Copy chart source\" over the chart title on a phone (review 5, G13).\n let lastTouchAt = Number.NEGATIVE_INFINITY;\n const TOUCH_FOCUS_WINDOW_MS = 1000;\n const onPointerOver = (e: PointerEvent) => {\n if (e.pointerType === \"touch\") {\n lastTouchAt = Date.now();\n if (active) deactivate();\n return;\n }\n if (inSurface(e.target)) {\n cancelClose();\n return;\n }\n if (holding || hasSelectionInSurface()) {\n // Text is being selected in the tooltip: another control passing under the pointer must not replace it.\n return;\n }\n const el = titledAncestor(e.target);\n if (el) activate(el);\n else if (active && closeTimer === undefined) scheduleClose();\n };\n\n const onPointerOut = (e: PointerEvent) => {\n if (!active) return;\n const next = e.relatedTarget;\n if (next instanceof win!.Node && (active.contains(next) || inSurface(next))) return;\n if (inSurface(e.target)) {\n if (holding) return;\n scheduleClose();\n return;\n }\n scheduleClose();\n };\n\n const onPointerDown = (e: PointerEvent) => {\n if (e.pointerType === \"touch\") lastTouchAt = Date.now();\n if (inSurface(e.target)) {\n // Selecting the tooltip's text: keep it open until the press ends.\n holding = true;\n cancelClose();\n return;\n }\n deactivate();\n };\n\n const onPointerUp = () => {\n if (!holding) return;\n holding = false;\n if (!hasSelectionInSurface()) scheduleClose();\n };\n\n const onFocusIn = (e: FocusEvent) => {\n if (Date.now() - lastTouchAt < TOUCH_FOCUS_WINDOW_MS) return;\n const el = titledAncestor(e.target);\n if (!el) return;\n let visible = true;\n try {\n visible = (e.target as Element).matches(\":focus-visible\");\n } catch {\n visible = true;\n }\n if (visible) activate(el);\n };\n\n const onFocusOut = (e: FocusEvent) => {\n if (!active) return;\n const next = e.relatedTarget;\n if (next instanceof win!.Node && active.contains(next)) return;\n deactivate();\n };\n\n const onDismiss = (e?: Event) => {\n if (e && inSurface(e.target)) return;\n deactivate();\n };\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") deactivate();\n };\n\n doc.addEventListener(\"pointerover\", onPointerOver, true);\n doc.addEventListener(\"pointerout\", onPointerOut, true);\n doc.addEventListener(\"focusin\", onFocusIn, true);\n doc.addEventListener(\"focusout\", onFocusOut, true);\n doc.addEventListener(\"pointerdown\", onPointerDown, true);\n doc.addEventListener(\"pointerup\", onPointerUp, true);\n doc.addEventListener(\"keydown\", onKeyDown, true);\n doc.addEventListener(\"scroll\", onDismiss, true);\n win?.addEventListener(\"blur\", onDismiss);\n\n return () => {\n deactivate();\n doc.removeEventListener(\"pointerover\", onPointerOver, true);\n doc.removeEventListener(\"pointerout\", onPointerOut, true);\n doc.removeEventListener(\"focusin\", onFocusIn, true);\n doc.removeEventListener(\"focusout\", onFocusOut, true);\n doc.removeEventListener(\"pointerdown\", onPointerDown, true);\n doc.removeEventListener(\"pointerup\", onPointerUp, true);\n doc.removeEventListener(\"keydown\", onKeyDown, true);\n doc.removeEventListener(\"scroll\", onDismiss, true);\n win?.removeEventListener(\"blur\", onDismiss);\n surface?.remove();\n surface = null;\n };\n}\n","\"use client\";\n\n/**\n * Ported verbatim from matrx-frontend `components/ui/radix-dialog-modal-context.tsx`.\n * Shared by the Sheet and BottomSheet families (and available to hosts that\n * compose their own Radix Dialog-derived wrappers around these primitives).\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.dialog-modal-context\");\nconst contextRegistry = globalThis as typeof globalThis & { [CONTEXT_SLOT]?: React.Context<boolean> };\nconst RadixDialogModalContext = contextRegistry[CONTEXT_SLOT] ??= React.createContext<boolean>(true);\n\nexport interface RadixDialogModalProviderProps {\n children: React.ReactNode;\n modal: boolean;\n}\n\n/**\n * Keeps our Radix-based content wrappers aligned with the owning Root's\n * modality so ARIA semantics cannot drift from focus/pointer behavior.\n */\nexport function RadixDialogModalProvider({\n children,\n modal,\n}: RadixDialogModalProviderProps) {\n return (\n <RadixDialogModalContext.Provider value={modal}>\n {children}\n </RadixDialogModalContext.Provider>\n );\n}\n\n/** Returns whether the nearest Radix Dialog-derived root is modal. */\nexport function useRadixDialogModal(): boolean {\n return React.useContext(RadixDialogModalContext);\n}\n","\"use client\";\n\n/**\n * Popover — ported verbatim from matrx-frontend `components/ui/popover.tsx`.\n *\n * Seam inversion: the host's `useNestedPortalContainer` (dialog/popout aware)\n * becomes the injected `PortalContainerProvider` seam (`portal-container.tsx`);\n * the explicit `container` prop keeps top priority, exactly as before.\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-popover 1.1.17 / react-id 1.1.2). The gate was actively\n * harmful — the Trigger wraps ALWAYS-VISIBLE content, so `return null`\n * deleted it from SSR and the first client paint.\n */\n\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { MOTION_POPPER } from \"./motion\";\nimport { SOLID_SURFACE_CLASS, type PopoverSurface } from \"./solid-surface\";\nimport { usePortalContainer } from \"./portal-container\";\nimport { keepMovedFocus } from \"./focus-return\";\n\nexport const Popover = PopoverPrimitive.Root;\n\nexport const PopoverTrigger = PopoverPrimitive.Trigger;\n\nexport const PopoverAnchor = PopoverPrimitive.Anchor;\n\nexport interface PopoverContentProps\n extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.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 — a picker re-anchoring while the user\n * types, a measurement pass. It is NOT the reduced-motion switch;\n * `styles.css` already honors `prefers-reduced-motion`.\n */\n animated?: boolean;\n /**\n * HOW WIDE THE POPOVER IS ALLOWED TO BE, and it is the SYSTEM that decides — never a\n * surface pasting its own `w-64` over the default (lane FIX-14, 2026-09-22).\n *\n * `\"fixed\"` (default) is the historical `w-72`: right for a menu of short, known\n * labels, where a ragged edge would look broken.\n *\n * `\"content\"` is for a popover whose whole job is to SHOW SOMETHING THE SYSTEM DID\n * NOT CHOOSE — a person's name, a record's title, a row the user is about to\n * create. The relation picker offered\n *\n * Create “Marisol Okonkwo — 418 Calle Pu\n *\n * inside a 16rem box, cut mid-word, on the one control that exists to show the name\n * being created. A fixed width cannot be right for content of unknown length, so\n * this one grows to its content between an honest floor and an honest ceiling:\n *\n * · at least the trigger's own width, and at least 20rem — the width Airtable's and\n * Notion's link-record pickers settle on, and wide enough that an ordinary\n * \"name — street, town\" fits on one line;\n * · at most 28rem, and never wider than the viewport less a 1rem gutter each side,\n * so it still fits a 375px phone with nothing running off the screen. The floor is\n * clamped by the same gutter, so on a very narrow screen the ceiling still wins.\n *\n * Beyond that ceiling the CONTENT truncates with an ellipsis and carries a `title`.\n * Growing, then ellipsis — never a mid-word cut.\n *\n * BOTH modes keep the phone gutter (2026-09-26): the box is never wider than the\n * viewport less 1rem each side, and Radix keeps it `collisionPadding` (16px) off every\n * screen edge. Measured at 375px before this: `w-72`/`w-80` callers landed flush on\n * the right edge (55→375) because collision padding was 0.\n */\n sizing?: \"fixed\" | \"content\";\n /**\n * The surface fill. `\"default\"` is the theme's popover surface (a host may render it\n * translucent / glass). `\"solid\"` is the OPAQUE surface — the popover token at full\n * alpha, no backdrop blur — for a menu that must read as paper over a cover image or a\n * busy page (a Notion-style ••• menu). Same option on `DropdownMenuContent`.\n */\n surface?: PopoverSurface;\n /**\n * A NAMED fixed width (0.68.22), for a `sizing=\"fixed\"` popover whose content needs more or\n * less room than the default `md` (18rem) — never a pasted `w-[260px]`. Every width keeps the\n * phone gutter (never wider than the viewport less 1rem each side). Derived from the call\n * sites: `xs` 12rem (a short menu), `sm` 15rem (a ••• menu), `md` 18rem (default),\n * `lg` 20rem (a small form), `xl` 26rem (a picker grid), `2xl` 34rem (a gallery).\n * Ignored when `sizing=\"content\"`.\n */\n width?: PopoverWidth;\n /**\n * The inner padding, named (0.68.22): `none` (the content draws its own — a command list, a\n * picker), `xs` 4px (a menu of rows), `sm` 8px, `md` 12px, `default` 16px.\n */\n padding?: PopoverPadding;\n}\n\nexport type PopoverWidth = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\nexport type PopoverPadding = \"none\" | \"xs\" | \"sm\" | \"md\" | \"default\";\n\n/** Literal class per width so a host's Tailwind scan of the package finds every one. */\nexport const POPOVER_WIDTH_CLASS: Record<PopoverWidth, string> = {\n xs: \"w-48\",\n sm: \"w-60\",\n md: \"w-72\",\n lg: \"w-80\",\n xl: \"w-[26rem]\",\n \"2xl\": \"w-[34rem]\",\n};\nexport const POPOVER_PADDING_CLASS: Record<PopoverPadding, string> = {\n none: \"p-0\",\n xs: \"p-1\",\n sm: \"p-2\",\n md: \"p-3\",\n default: \"p-4\",\n};\n\nexport const PopoverContent = React.forwardRef<\n React.ComponentRef<typeof PopoverPrimitive.Content>,\n PopoverContentProps\n>(\n (\n {\n className,\n align = \"center\",\n sideOffset = 4,\n container,\n animated = true,\n sizing = \"fixed\",\n surface = \"default\",\n width = \"md\",\n padding = \"default\",\n collisionPadding = 16,\n onCloseAutoFocus,\n ...props\n },\n ref,\n ) => {\n const portalContainer = usePortalContainer(container);\n return (\n <PopoverPrimitive.Portal container={portalContainer}>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n data-surface={surface === \"solid\" ? \"solid\" : undefined}\n data-width={sizing === \"content\" ? undefined : width}\n data-padding={padding}\n className={cn(\n // Cap to the viewport space Radix measured and scroll — a popover taller\n // than the screen must never trap the user with unreachable content.\n // z must EQUAL the dialog layer (z-[10000]), never exceed it: with equal\n // z, DOM portal order decides, so a dialog opened FROM a popover stacks\n // above it, and a popover opened from a dialog still stacks above the\n // dialog. z-[10001] buried dialogs behind fullscreen popovers.\n \"z-[10000] max-h-[var(--radix-popover-content-available-height)] overflow-y-auto overscroll-contain rounded-md border bg-popover text-popover-foreground shadow-md outline-none\",\n POPOVER_PADDING_CLASS[padding],\n sizing === \"content\"\n ? \"w-auto min-w-[min(max(var(--radix-popover-trigger-width),20rem),calc(100vw-2rem))] max-w-[min(28rem,calc(100vw-2rem))]\"\n : cn(POPOVER_WIDTH_CLASS[width], \"max-w-[calc(100vw-2rem)]\"),\n surface === \"solid\" && SOLID_SURFACE_CLASS,\n animated && MOTION_POPPER,\n className,\n )}\n {...props}\n onCloseAutoFocus={keepMovedFocus(onCloseAutoFocus)}\n />\n </PopoverPrimitive.Portal>\n );\n },\n);\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n","/**\n * useIsMobile — the ONE breakpoint hook the package's responsive primitives\n * read (CommandDialog and Dialog both auto-render as a bottom sheet below it).\n *\n * The body lives in `@ai-matrx/kit/media-query` (chat-package independence\n * P12, 2026-10-01): the app's `hooks/use-mobile` and this package each carried\n * their own copy, and two breakpoint hooks is exactly the duplication this\n * package exists to end. Kit's reads through `useSyncExternalStore` — `false`\n * on the server and during hydration, so the desktop geometry hydrates — and\n * never throws where `matchMedia` is absent.\n */\nexport { MOBILE_BREAKPOINT, useIsMobile } from \"@ai-matrx/kit/media-query\";\n","/**\n * The date field's words — locale-aware display and typed-entry parsing, pure.\n *\n * Values are ISO, always: a day is `yyyy-mm-dd`, a time is `HH:mm` (24h), a\n * date-and-time is `yyyy-mm-ddTHH:mm` (local, no zone — the shape\n * `<input type=\"datetime-local\">` and kit's `datetimeLocalValue` speak). What a\n * person SEES and TYPES is their locale's: `Oct 7, 2026` / `7 Oct 2026`,\n * `3:30 PM` / `15:30`. Typed entry accepts the locale's numeric order\n * (10/7/2026 in en-US, 7/10/2026 in en-GB), ISO, month names (the locale's and\n * English), digit runs (10072026), and today / tomorrow / yesterday.\n */\n\nimport { isValidDateOnly, parseDateOnly, toDateOnly } from \"@ai-matrx/kit/dates\";\n\nexport type DateFieldMode = \"date\" | \"datetime\" | \"time\";\n\nconst pad = (n: number) => String(n).padStart(2, \"0\");\n\n/** The day / month / year order the locale writes numeric dates in. */\nexport function dateOrder(locale?: string): Array<\"day\" | \"month\" | \"year\"> {\n const parts = new Intl.DateTimeFormat(locale, { year: \"numeric\", month: \"2-digit\", day: \"2-digit\" })\n .formatToParts(new Date(2026, 9, 7));\n const order = parts\n .map((p) => p.type)\n .filter((t): t is \"day\" | \"month\" | \"year\" => t === \"day\" || t === \"month\" || t === \"year\");\n return order.length === 3 ? order : [\"month\", \"day\", \"year\"];\n}\n\n/** 0 = Sunday … 6 = Saturday: the first column of the locale's week. */\nexport function weekStart(locale?: string): number {\n try {\n const loc = new Intl.Locale(locale ?? new Intl.DateTimeFormat().resolvedOptions().locale) as Intl.Locale & {\n getWeekInfo?: () => { firstDay: number };\n weekInfo?: { firstDay: number };\n };\n const first = loc.getWeekInfo?.().firstDay ?? loc.weekInfo?.firstDay;\n if (typeof first === \"number\") return first % 7; // Intl: 1 = Monday … 7 = Sunday\n } catch {\n // An unknown locale tag falls through to the region default below.\n }\n return 0;\n}\n\nfunction monthNames(locale?: string): Map<string, number> {\n const names = new Map<string, number>();\n const add = (fmtLocale: string | undefined) => {\n for (const style of [\"long\", \"short\"] as const) {\n const fmt = new Intl.DateTimeFormat(fmtLocale, { month: style });\n for (let m = 0; m < 12; m++) {\n const name = fmt.format(new Date(2026, m, 1)).toLowerCase().replace(/\\./g, \"\");\n if (name && !names.has(name)) names.set(name, m);\n }\n }\n };\n add(locale);\n add(\"en-US\");\n return names;\n}\n\nfunction expandYear(y: number, raw: string): number {\n if (raw.length > 2) return y;\n const now = new Date().getFullYear();\n const century = Math.floor(now / 100) * 100;\n const candidate = century + y;\n return candidate > now + 20 ? candidate - 100 : candidate;\n}\n\nfunction build(y: number, m: number, d: number): string | null {\n if (!Number.isFinite(y) || !Number.isFinite(m) || !Number.isFinite(d)) return null;\n const iso = `${String(y).padStart(4, \"0\")}-${pad(m)}-${pad(d)}`;\n return isValidDateOnly(iso) ? iso : null;\n}\n\n/** Typed text → `yyyy-mm-dd`, or `null` when it is not a day this field can name. */\nexport function parseTypedDate(text: string, locale?: string, now: Date = new Date()): string | null {\n const raw = text.trim().toLowerCase().replace(/,/g, \" \").replace(/\\s+/g, \" \");\n if (!raw) return null;\n\n const relative: Record<string, number> = { today: 0, tod: 0, tomorrow: 1, tom: 1, yesterday: -1 };\n if (raw in relative) {\n const d = new Date(now.getFullYear(), now.getMonth(), now.getDate() + relative[raw]!);\n return toDateOnly(d);\n }\n\n const iso = /^(\\d{4})[-/.](\\d{1,2})[-/.](\\d{1,2})$/.exec(raw);\n if (iso) return build(Number(iso[1]), Number(iso[2]), Number(iso[3]));\n\n const order = dateOrder(locale);\n\n // Month names: \"oct 7 2026\", \"7 october\", \"october 7\".\n if (/[a-zÀ-￿]/.test(raw)) {\n const names = monthNames(locale);\n const tokens = raw.replace(/\\./g, \"\").split(/[\\s/\\-]+/).filter(Boolean);\n let month: number | undefined;\n const nums: string[] = [];\n for (const t of tokens) {\n if (/^\\d+(st|nd|rd|th)?$/.test(t)) {\n nums.push(t.replace(/\\D/g, \"\"));\n continue;\n }\n const exact = names.get(t);\n const prefix =\n exact ?? (t.length >= 3 ? [...names].find(([name]) => name.startsWith(t))?.[1] : undefined);\n if (prefix === undefined || month !== undefined) return null;\n month = prefix;\n }\n if (month === undefined || nums.length === 0 || nums.length > 2) return null;\n const day = Number(nums[0]);\n const year = nums[1] ? expandYear(Number(nums[1]), nums[1]) : now.getFullYear();\n return build(year, month + 1, day);\n }\n\n // Numbers in the locale's order: separators, or one digit run.\n let pieces = raw.split(/[\\s/.\\-]+/).filter(Boolean);\n if (pieces.length === 1 && /^\\d+$/.test(raw)) {\n const yearFirst = order[0] === \"year\";\n if (raw.length === 8) {\n pieces = yearFirst ? [raw.slice(0, 4), raw.slice(4, 6), raw.slice(6)] : [raw.slice(0, 2), raw.slice(2, 4), raw.slice(4)];\n } else if (raw.length === 6) {\n pieces = [raw.slice(0, 2), raw.slice(2, 4), raw.slice(4)];\n } else {\n return null;\n }\n }\n if (!pieces.every((p) => /^\\d+$/.test(p))) return null;\n if (pieces.length === 2) {\n const dm = order.filter((o) => o !== \"year\");\n const v: Record<string, number> = {};\n dm.forEach((k, i) => (v[k] = Number(pieces[i])));\n return build(now.getFullYear(), v.month!, v.day!);\n }\n if (pieces.length !== 3) return null;\n // A four-digit first piece is a year whatever the locale says.\n const effective = pieces[0]!.length === 4 ? ([\"year\", \"month\", \"day\"] as const) : order;\n const v: Record<string, number> = {};\n effective.forEach((k, i) => {\n const p = pieces[i]!;\n v[k] = k === \"year\" ? expandYear(Number(p), p) : Number(p);\n });\n return build(v.year!, v.month!, v.day!);\n}\n\n/** Typed text → `HH:mm` (24h), or `null`. Accepts 3pm, 3:30 pm, 15:30, 1530, noon, midnight. */\nexport function parseTypedTime(text: string): string | null {\n const raw = text.trim().toLowerCase().replace(/\\s+/g, \"\").replace(/\\./g, \"\");\n if (!raw) return null;\n if (raw === \"noon\") return \"12:00\";\n if (raw === \"midnight\") return \"00:00\";\n const m = /^(\\d{1,2})(?::?(\\d{2}))?(am|pm|a|p)?$/.exec(raw);\n if (!m) return null;\n let h = Number(m[1]);\n const min = m[2] ? Number(m[2]) : 0;\n const mer = m[3]?.[0];\n if (min > 59) return null;\n if (mer) {\n if (h < 1 || h > 12) return null;\n if (mer === \"a\") h = h === 12 ? 0 : h;\n else h = h === 12 ? 12 : h + 12;\n } else if (h > 23) {\n return null;\n }\n return `${pad(h)}:${pad(min)}`;\n}\n\n/** `yyyy-mm-dd` → the locale's medium day (`Oct 7, 2026`). */\nexport function formatDay(iso: string, locale?: string): string {\n const d = parseDateOnly(iso);\n if (!d) return iso;\n return new Intl.DateTimeFormat(locale, { month: \"short\", day: \"numeric\", year: \"numeric\" }).format(d);\n}\n\n/** `HH:mm` → the locale's short time (`3:30 PM` / `15:30`). */\nexport function formatTime(hhmm: string, locale?: string): string {\n const m = /^(\\d{2}):(\\d{2})$/.exec(hhmm);\n if (!m) return hhmm;\n return new Intl.DateTimeFormat(locale, { hour: \"numeric\", minute: \"2-digit\" }).format(\n new Date(2026, 0, 1, Number(m[1]), Number(m[2])),\n );\n}\n\n/** Split an ISO value into its day and time halves for a mode. */\nexport function splitValue(value: string | null | undefined, mode: DateFieldMode): { day: string; time: string } {\n const v = (value ?? \"\").trim();\n if (!v) return { day: \"\", time: \"\" };\n if (mode === \"time\") {\n const t = /(\\d{2}:\\d{2})/.exec(v);\n return { day: \"\", time: t ? t[1]! : \"\" };\n }\n const day = /^(\\d{4}-\\d{2}-\\d{2})/.exec(v)?.[1] ?? \"\";\n const time = mode === \"datetime\" ? (/[T ](\\d{2}:\\d{2})/.exec(v)?.[1] ?? \"\") : \"\";\n return { day, time };\n}\n\n/** The 42 days (six weeks) a month grid shows, starting on the locale's first weekday. */\nexport function monthGrid(year: number, month: number, firstDay: number): Date[] {\n const first = new Date(year, month, 1);\n const offset = (first.getDay() - firstDay + 7) % 7;\n return Array.from({ length: 42 }, (_, i) => new Date(year, month, 1 - offset + i));\n}\n\n/** Half-hour slots for the time list, `HH:mm`. */\nexport const TIME_SLOTS: readonly string[] = Array.from({ length: 48 }, (_, i) => `${pad(Math.floor(i / 2))}:${i % 2 ? \"30\" : \"00\"}`);\n","\"use client\";\n\n/**\n * THE COMPOUND DOORS — the one control behind the APIs a host already speaks.\n *\n * `Field`, `Select`, `Tabs` (controls.tsx) are the options-array controls. Hundreds of host call\n * sites speak the compound Radix APIs instead (`<SelectTrigger><SelectValue/></SelectTrigger>`,\n * `<TabsList><TabsTrigger/></TabsList>`, a bare `<Input/>` with its own ref and props). These are\n * THE SAME controls for those APIs: the same classes, the same locked geometry and color in\n * `@layer matrx-tap-lock` (controls.css), no size. They live here, under `/controls`, so the\n * package-root primitives (`SelectTrigger`, `TabsList`, `Input`) keep their legacy look for every\n * host that has not adopted the controls.\n *\n * Fill: a compound field or select trigger FILLS its container by default (minus its half-gaps),\n * because the API it replaces did (`w-full`); a call site's width class still places it.\n */\n\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\";\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { isIconOnly } from \"./icon-only\";\nimport { SelectChevron } from \"../select\";\nimport type { ControlWidth } from \"./controls\";\n\n/* ------------------------------------------------------------------ */\n/* Input — the field capsule on the <input> itself */\n/* ------------------------------------------------------------------ */\n\nexport interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {\n /** `field` (default): the capsule. `bare`: the surrounding surface draws the frame (an inline\n * editor, a composite control) — no border, no fill, no inset, no focus ring of its own. */\n variant?: \"field\" | \"bare\";\n /** Monospace text — code, ids, keys, JSON. */\n mono?: boolean;\n /** Reserve room for a 16px glyph the host overlays at the start / end (a search icon, a clear\n * button). Prefer `Field`'s own `icon` / `end` slots for new code. */\n adornment?: \"start\" | \"end\" | \"both\";\n /** Where the value sits: `start` (default), `center` (a stepper's count), `end` (an amount). */\n align?: \"start\" | \"center\" | \"end\";\n /** Tabular figures, end-aligned unless `align` says otherwise — quantities, money, limits. */\n numeric?: boolean;\n /** A value's provenance, on the frame: `inherited` (dashed — empty, a default applies) or\n * `changed` (primary — edited, not yet saved). An error is `aria-invalid`, never a mark. */\n mark?: \"inherited\" | \"changed\";\n /** A named width instead of filling the row (see `ControlWidth`). */\n width?: ControlWidth;\n}\n\n/**\n * The input capsule for the bare-`<input>` API: every prop, the ref and `className` (placement)\n * land on the `<input>`. Use `Field` when you want the glyph slots.\n */\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, variant = \"field\", mono, adornment, align, numeric, mark, width, ...props }, ref) => (\n <input\n ref={ref}\n data-matrx-control=\"input\"\n data-width={width}\n data-variant={variant === \"bare\" ? \"bare\" : undefined}\n data-mono={mono ? \"\" : undefined}\n data-adornment={adornment}\n data-align={align ?? (numeric ? \"end\" : undefined)}\n data-numeric={numeric ? \"\" : undefined}\n data-mark={mark}\n className={cn(\"matrx-control matrx-control-field matrx-control-input\", className)}\n {...props}\n />\n ),\n);\nInput.displayName = \"Input\";\n\n/* ------------------------------------------------------------------ */\n/* SelectTrigger — the select capsule on Radix Select's trigger */\n/* ------------------------------------------------------------------ */\n\nexport interface SelectTriggerProps extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> {\n /** No chevron (a trigger that is its value alone). */\n hideArrow?: boolean;\n /** `field` (default): the capsule. `bare`: the surrounding surface draws the frame. */\n variant?: \"field\" | \"bare\";\n /** A named width instead of filling the row (see `ControlWidth`). */\n width?: ControlWidth;\n}\n\n/**\n * THE select trigger for the compound Radix API (`Select` root, `SelectValue`, `SelectContent`,\n * `SelectItem` stay the package root's). 28px capsule, 13px value, 16px glyphs, one chevron.\n */\nexport const SelectTrigger = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Trigger>,\n SelectTriggerProps\n>(({ className, children, hideArrow = false, variant = \"field\", width, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n data-matrx-control=\"select\"\n data-width={width}\n data-compound=\"\"\n data-variant={variant === \"bare\" ? \"bare\" : undefined}\n className={cn(\"matrx-control matrx-control-select\", className)}\n {...props}\n >\n {children}\n {!hideArrow && (\n <SelectPrimitive.Icon asChild>\n <SelectChevron />\n </SelectPrimitive.Icon>\n )}\n </SelectPrimitive.Trigger>\n));\nSelectTrigger.displayName = \"SelectTrigger\";\n\n/* ------------------------------------------------------------------ */\n/* TabsList / TabsTrigger — the controls' tabs on Radix Tabs */\n/* ------------------------------------------------------------------ */\n\nexport type TabsVariant = \"underline\" | \"capsule\";\nconst TabsVariantContext = React.createContext<TabsVariant>(\"capsule\");\n\nexport interface TabsListProps extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.List> {\n /** `capsule` (default): a muted track, the active tab a raised thumb — filters, view switches.\n * `underline`: page sections, the active tab underlined on a hairline. */\n variant?: TabsVariant;\n /** The tabs share the row's whole width equally. */\n fill?: boolean;\n /** Underline only: draw the hairline (default). `false` when the row already draws it. */\n rule?: boolean;\n /** More tabs than fit: `scroll` (one row that scrolls sideways, no scrollbar drawn) or `wrap`\n * (further rows). Default: neither — the row is as wide as its tabs. */\n overflow?: \"scroll\" | \"wrap\";\n}\n\n/** The tab row for the compound Radix API (`Tabs` root and `TabsContent` stay the root's). */\nexport const TabsList = React.forwardRef<React.ComponentRef<typeof TabsPrimitive.List>, TabsListProps>(\n ({ className, variant = \"capsule\", fill, rule = true, overflow, ...props }, ref) => (\n <TabsVariantContext.Provider value={variant}>\n <TabsPrimitive.List\n ref={ref}\n data-matrx-control=\"tabs\"\n data-variant={variant}\n data-fill={fill ? \"\" : undefined}\n data-rule={variant === \"underline\" && !rule ? \"none\" : undefined}\n data-overflow={overflow}\n className={cn(variant === \"capsule\" ? \"matrx-control matrx-control-segmented\" : \"matrx-control-tabs\", className)}\n {...props}\n />\n </TabsVariantContext.Provider>\n ),\n);\nTabsList.displayName = \"TabsList\";\n\n/** One tab. Its skin follows the `TabsList` it sits in. */\nexport const TabsTrigger = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, ...props }, ref) => {\n const variant = React.useContext(TabsVariantContext);\n return (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(variant === \"capsule\" ? \"matrx-control-segment\" : \"matrx-control-tab\", className)}\n data-icon-only={variant === \"capsule\" && isIconOnly(props.children) ? \"\" : undefined}\n {...props}\n />\n );\n});\nTabsTrigger.displayName = \"TabsTrigger\";\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 { Slot } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\n\nimport { swallowClick } from \"../button\";\nimport { cn } from \"../cn\";\nimport { ConfirmDialog } from \"../confirm-dialog\";\nimport { ChevronRightIcon, Trash2Icon } from \"../icons\";\nimport { Skeleton } from \"../skeleton\";\nimport { Button, ControlRow, type ChipTone, type GlyphTone } 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/* Tile — the pressable row / tile (a choice, a destination) */\n/* ------------------------------------------------------------------ */\n\nexport type TileLayout = \"row\" | \"stack\" | \"adaptive\" | \"icon\";\n\nexport interface TileProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"title\"> {\n /** `row` (default): glyph, then a 13px title over a 12px line, start-aligned, full width — a\n * choice in a list, a quick action. `stack`: glyph on top, title and line under it — a grid\n * tile. `adaptive`: `stack` from the `sm` breakpoint (640px) up, a compact `row` below it — a\n * grid of option cards that becomes a list on a phone. `icon`: the launcher tile of an icon\n * grid (a \"Can make\" grid, a sidebar's pinned apps, a copy palette) — the glyph centered over\n * an 11px label centered under it, up to two lines, no frame, a pick is a soft tint, `end`\n * is a badge on the top corner, `line` is hidden. All are taller than a control: they carry\n * text, so they never take the 28px lock. */\n layout?: TileLayout;\n /** `outline` (default): the bordered card skin. `quiet`: no frame until hover — a row in a\n * menu-like list. */\n variant?: \"outline\" | \"quiet\";\n /** Leading 16px glyph (an avatar or image works too). */\n icon?: React.ReactNode;\n /** The 13px title. */\n title: React.ReactNode;\n /** The title wraps over several lines (up to 6) instead of one line with an ellipsis: a quiz\n * answer, a step, a sentence-long choice. Off by default — a short title is one line. */\n wrapTitle?: boolean;\n /** One 12px secondary line (clamped to two lines; one with `oneLine`). */\n line?: React.ReactNode;\n /** The `line` stays ONE line with an ellipsis, so every row of a master list keeps one height. */\n oneLine?: boolean;\n /** Trailing content in a row (a chevron, a count, a shortcut). */\n end?: React.ReactNode;\n /** A choice: `true` tints it and sets `aria-pressed`; `false` sets `aria-pressed=\"false\"`. A link tile (`asChild`) never sets `aria-pressed`: the caller sets `aria-current`. */\n selected?: boolean;\n /** How `selected` looks. `outline` (default): primary frame and tint. `fill`: a soft neutral fill,\n * no outline, ink unchanged — a sidebar's active row. `primary`: the solid primary fill with\n * every ink (title, line, glyph, end) on primary — the open item of a master list. */\n selectedStyle?: \"outline\" | \"fill\" | \"primary\";\n /** The hover / focus tooltip (the native `title` attribute: `title` is the visible label). */\n tooltip?: string;\n /** Nesting depth under a parent row: each level moves the row's start past one glyph and its\n * gap, so an icon-less child's title starts where its parent's title does. */\n level?: 1 | 2 | 3;\n /** Size to the content and never shrink or truncate the title — a code, a short value. */\n fit?: boolean;\n /** Keep room at the row's end for a control laid OVER it (a row's More button): `control`\n * reserves one control's width plus its gap, so the title never runs under it. */\n endInset?: \"control\";\n /** A dashed border: the \"add another\" tile (an empty slot to fill), never a choice. */\n dashed?: boolean;\n /** hoverStyle=\"fill\": the pointer's soft neutral fill (the desktop look's secondary fill) instead of the accent. */\n hoverStyle?: \"fill\";\n /** A destructive row (Remove, Delete): destructive title and glyph, destructive hover tint. */\n danger?: boolean;\n /**\n * A choice that is ALREADY USED elsewhere (an option already placed, a field already mapped): a\n * faint shade and quieter ink, still fully pressable — a hint for the eye, never a disabled state.\n */\n dimmed?: boolean;\n /** The glyph's own status ink when its color carries meaning (Button's `glyphTone`). */\n glyphTone?: GlyphTone;\n /** The inviting choice card for a front door: roomy padding, a 40px icon square, a 14px title. */\n hero?: boolean;\n /** Tint card, edge and icon square from one `ChipTone` (the `Chip` hue tokens). */\n tone?: ChipTone;\n /** Tint ONLY the icon, as a 28px colored square, on a neutral card: a grid of actions where each\n * job keeps its own hue (quick actions) without every card turning into a colored card. */\n iconTone?: ChipTone;\n /** A 28px navigation / filter row for sidebars and dense lists: `min-height` is the control size,\n * padding 4px 8px, gap 8px, 13px title. The `line` is HIDDEN when dense (one line, always).\n * `variant=\"quiet\"` + `dense` is a clean nav row: transparent until hover / selected. */\n dense?: boolean;\n /** Render the one child element (a link) with the tile's skin; its children are ignored —\n * the tile draws `icon`/`title`/`line`/`end`. */\n asChild?: boolean;\n}\n\n/**\n * THE pressable row / tile: two named layouts, two skins, no size. `className` places it\n * (width, grid cell); its height follows its text.\n */\nexport const Tile = React.forwardRef<HTMLButtonElement, TileProps>(\n (\n { layout = \"row\", variant = \"outline\", icon, title, wrapTitle, line, end, selected, selectedStyle, tooltip, level, fit, endInset, oneLine, dashed, hoverStyle, danger, dimmed, glyphTone, hero, tone, iconTone, dense, asChild = false, className, children, onClick, type, ...props },\n ref,\n ) => {\n const Component = asChild ? Slot : \"button\";\n const ariaDisabled = props[\"aria-disabled\"];\n const inert = ariaDisabled === true || ariaDisabled === \"true\";\n const body = (\n <>\n {icon ? (\n <span className=\"matrx-tile-icon\" data-tone={iconTone && iconTone !== \"neutral\" ? iconTone : undefined}>\n {icon}\n </span>\n ) : null}\n <span className=\"matrx-tile-text\">\n <span className=\"matrx-tile-title\">{title}</span>\n {line ? <span className=\"matrx-tile-line\">{line}</span> : null}\n </span>\n {end ? <span className=\"matrx-tile-end\">{end}</span> : null}\n </>\n );\n return (\n <Component\n ref={ref}\n type={asChild ? undefined : (type ?? \"button\")}\n data-matrx-tile=\"\"\n data-layout={layout}\n data-variant={variant}\n data-selected={selected ? \"\" : undefined}\n data-selected-style={selected && (selectedStyle === \"fill\" || selectedStyle === \"primary\") ? selectedStyle : undefined}\n data-level={level}\n data-fit={fit ? \"\" : undefined}\n data-one-line={oneLine ? \"\" : undefined}\n data-end-inset={endInset}\n data-dashed={dashed ? \"\" : undefined}\n data-hover-style={hoverStyle}\n title={tooltip}\n data-danger={danger ? \"\" : undefined}\n data-dimmed={dimmed ? \"\" : undefined}\n data-wrap-title={wrapTitle ? \"\" : undefined}\n data-glyph-tone={glyphTone}\n data-hero={hero ? \"\" : undefined}\n data-dense={dense ? \"\" : undefined}\n data-tone={tone}\n aria-pressed={asChild || selected === undefined ? undefined : selected}\n className={cn(\"matrx-tile\", className)}\n {...props}\n onClick={inert ? swallowClick : onClick}\n >\n {asChild && React.isValidElement(children) ? (\n React.cloneElement(children as React.ReactElement<{ children?: React.ReactNode }>, undefined, body)\n ) : (\n body\n )}\n </Component>\n );\n },\n);\nTile.displayName = \"Tile\";\n\n/* ------------------------------------------------------------------ */\n/* Section disclosure header */\n/* ------------------------------------------------------------------ */\n\nexport type DisclosureHeaderVariant = \"row\" | \"label\";\n\nexport interface DisclosureHeaderProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"title\"> {\n /** Whether the section under the header is showing. Sets `aria-expanded`. */\n open: boolean;\n /** `row` (default): a 13px/500 title — a collapsible section, a group of results, a \"details\"\n * fold. `label`: the 11px uppercase muted label that heads a sidebar or menu group. */\n variant?: DisclosureHeaderVariant;\n /** Optional 16px glyph after the chevron (row variant). */\n icon?: React.ReactNode;\n /** Colors ONLY the icon: a status tone uses its `-ink` token, a hue its `--matrx-chip-<hue>-ink`.\n * A section that carries a color (violet Organization, amber Projects) keeps it here. */\n glyphTone?: GlyphTone | ChipTone;\n /** The section's name. */\n title: React.ReactNode;\n /** A short muted fact after the title: a count, a size, \"3 of 12\". Never a sentence. */\n meta?: React.ReactNode;\n /** Trailing content pinned to the end (a status glyph, a count badge). Non-interactive — a\n * control beside the header sits outside it, never inside the button. */\n end?: React.ReactNode;\n /** One 12px secondary line under the title (row variant) — what the section holds. */\n line?: React.ReactNode;\n /** Where the turning chevron sits. `start` (default) leads the row; `end` trails it, for a\n * sidebar section whose label keeps the column's left edge. */\n chevron?: \"start\" | \"end\";\n}\n\n/**\n * THE section-disclosure header: a chevron that turns, a title, an optional count and trailing\n * status — one full-width pressable row that opens and closes the section below it. Every\n * \"click the heading to fold\" row is this, never a raw button with a hand-drawn chevron.\n */\nexport const DisclosureHeader = React.forwardRef<HTMLButtonElement, DisclosureHeaderProps>(\n ({ open, variant = \"row\", icon, glyphTone, title, meta, end, line, chevron = \"start\", className, type, ...props }, ref) => (\n <button\n ref={ref}\n type={type ?? \"button\"}\n aria-expanded={open}\n data-matrx-disclosure=\"\"\n data-variant={variant}\n data-open={open ? \"\" : undefined}\n data-chevron={chevron}\n className={cn(\"matrx-disclosure\", className)}\n {...props}\n >\n {chevron === \"start\" ? (\n <span className=\"matrx-disclosure-chevron\" aria-hidden=\"true\">\n <ChevronRightIcon />\n </span>\n ) : null}\n {icon ? (\n <span className=\"matrx-disclosure-icon\" data-glyph-tone={glyphTone}>\n {icon}\n </span>\n ) : null}\n {line ? (\n <span className=\"matrx-disclosure-text\">\n <span className=\"matrx-disclosure-title\">{title}</span>\n <span className=\"matrx-disclosure-line\">{line}</span>\n </span>\n ) : (\n <span className=\"matrx-disclosure-title\">{title}</span>\n )}\n {meta === undefined || meta === null || meta === false ? null : (\n <span className=\"matrx-disclosure-meta\">{meta}</span>\n )}\n {end ? <span className=\"matrx-disclosure-end\">{end}</span> : null}\n {chevron === \"end\" ? (\n <span className=\"matrx-disclosure-chevron\" data-end=\"\" aria-hidden=\"true\">\n <ChevronRightIcon />\n </span>\n ) : null}\n </button>\n ),\n);\nDisclosureHeader.displayName = \"DisclosureHeader\";\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 /**\n * Let the title wrap onto as many lines as it needs, for a sentence that must be read whole (a question with its\n * answer buttons beside it). Default false: one line, truncated.\n */\n wrap?: boolean;\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 wrap = false,\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 data-wrap={wrap ? \"\" : undefined}\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\";\nimport { keepMovedFocus } from \"./focus-return\";\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>(({ onCloseAutoFocus, ...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\" onCloseAutoFocus={keepMovedFocus(onCloseAutoFocus)} />;\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 honors `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 gap-2 sm:flex-row sm:justify-end sm:gap-0 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 * 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","\"use client\";\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 gray 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, MOTION_SHIMMER } 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 * How it says \"coming\": `pulse` (default, the whole box breathes) or `shimmer` — a soft band of light\n * crossing the box, for a picture still being made (a logo, a page screenshot). Reduced motion: the\n * shimmer stops traveling and breathes slowly.\n */\n motion?: \"pulse\" | \"shimmer\";\n /**\n * THE NAMED SHAPES (0.68.22) — a placeholder says what is coming, never a pasted `h-6 w-48`.\n * Derived from the call sites:\n * · `line` — a line of body text (14px, rounded);\n * · `title` — a heading (24px);\n * · `control` — a 28px capsule, where a button, field or select will be;\n * · `row` — a 36px list row;\n * · `block` — a region (a card, a chart, a panel); its height is `height`;\n * · `circle` — an avatar or a glyph disc (2.5rem round; `height` sizes it too).\n * Omit for the legacy free box.\n */\n shape?: SkeletonShape;\n /** A `block` / `circle`'s height: `sm` 3rem, `md` 5rem, `lg` 10rem, `xl` 16rem, `fill` the parent. */\n height?: SkeletonHeight;\n /** How much of the row it takes: `full` (default), a fraction, or a fixed `sm` 8rem / `md` 12rem / `lg` 16rem. */\n width?: SkeletonWidth;\n}\n\nexport type SkeletonShape = \"line\" | \"title\" | \"control\" | \"row\" | \"block\" | \"circle\";\nexport type SkeletonHeight = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"fill\";\nexport type SkeletonWidth = \"full\" | \"3/4\" | \"2/3\" | \"1/2\" | \"1/3\" | \"sm\" | \"md\" | \"lg\";\n\n/** Literal classes so a host's Tailwind scan of the package finds every one. */\nconst SHAPE_CLASS: Record<SkeletonShape, string> = {\n line: \"h-3.5 rounded\",\n title: \"h-6 rounded-md\",\n control: \"h-7 rounded-full\",\n row: \"h-9 rounded-md\",\n block: \"rounded-lg\",\n circle: \"aspect-square rounded-full\",\n};\nconst HEIGHT_CLASS: Record<SkeletonHeight, string> = {\n sm: \"h-12\",\n md: \"h-20\",\n lg: \"h-40\",\n xl: \"h-64\",\n fill: \"h-full\",\n};\nconst CIRCLE_SIZE_CLASS: Record<SkeletonHeight, string> = {\n sm: \"size-8\",\n md: \"size-10\",\n lg: \"size-16\",\n xl: \"size-24\",\n fill: \"h-full\",\n};\nconst WIDTH_CLASS: Record<SkeletonWidth, string> = {\n full: \"w-full\",\n \"3/4\": \"w-3/4\",\n \"2/3\": \"w-2/3\",\n \"1/2\": \"w-1/2\",\n \"1/3\": \"w-1/3\",\n sm: \"w-32 max-w-full\",\n md: \"w-48 max-w-full\",\n lg: \"w-64 max-w-full\",\n};\n\nexport function Skeleton({ className, animated = true, motion = \"pulse\", shape, height, width, ...props }: SkeletonProps) {\n const sized = shape === \"circle\"\n ? CIRCLE_SIZE_CLASS[height ?? \"md\"]\n : cn(\n shape && SHAPE_CLASS[shape],\n shape === \"block\" && HEIGHT_CLASS[height ?? \"md\"],\n shape && WIDTH_CLASS[width ?? \"full\"],\n );\n return (\n <div\n data-slot=\"skeleton\"\n data-shape={shape}\n data-motion={animated ? motion : undefined}\n className={cn(\n \"rounded-md bg-primary/10\",\n shape === \"circle\" && SHAPE_CLASS.circle,\n sized,\n animated && (motion === \"shimmer\" ? MOTION_SHIMMER : MOTION_PULSE),\n className,\n )}\n {...props}\n />\n );\n}\n","\"use client\";\n\n/**\n * NumberStepper — moved from matrx-frontend (chat host slot; the package default now).\n *\n * A compact number input with − / + stepper buttons on either side.\n * The input auto-sizes to its content in `ch` units so it always fits\n * exactly — no fixed width needed, works for 1 digit or 10 000+.\n *\n * Features:\n * - Auto-sizing input: width tracks the current draft string length in `ch`\n * - No browser-native spinner arrows (uses type=\"text\" + inputMode=\"numeric\")\n * - Validates only on blur or Enter — never interrupts mid-type editing\n * - Clearing the field is allowed; the committed value falls back to `fallback`\n * - Arrow-key stepping (↑ / ↓) works while the input is focused\n * - Buttons use onMouseDown + preventDefault so focus stays in the input\n * - Fully theme-aware: uses bg-background / text-foreground / border-input tokens\n * - THE ONE CONTROL's height by default (`--matrx-control-size`, 28px) and\n * its 13px label, so it lines up with Button / Select / Switch beside it;\n * a dense host may still pass a smaller height; width is automatic\n *\n * Props:\n * value – controlled numeric value\n * onChange – called with the new committed value\n * min – optional minimum (clamped on commit)\n * max – optional maximum (clamped on commit)\n * fallback – value to use when the field is empty or non-numeric (default 0)\n * step – amount to increment / decrement per button click (default 1)\n * minChars – minimum visible character width of the input area (default 2)\n * className – applied to the outer wrapper\n */\n\nimport { useState, useEffect } from \"react\";\nimport { cn } from \"../cn\";\nimport { MinusIcon, PlusIcon } from \"../icons\";\n\nexport interface NumberStepperProps {\n value: number;\n onChange: (v: number) => void;\n min?: number;\n max?: number;\n fallback?: number;\n step?: number;\n minChars?: number;\n className?: string;\n}\n\nexport function NumberStepper({\n value,\n onChange,\n min,\n max,\n fallback = 0,\n step = 1,\n minChars = 2,\n className,\n}: NumberStepperProps) {\n const [draft, setDraft] = useState(String(value));\n\n useEffect(() => {\n setDraft(String(value));\n }, [value]);\n\n const commit = (override?: number) => {\n const parsed = override !== undefined ? override : parseInt(draft, 10);\n let next = isNaN(parsed) ? fallback : parsed;\n if (min !== undefined) next = Math.max(min, next);\n if (max !== undefined) next = Math.min(max, next);\n setDraft(String(next));\n if (next !== value) onChange(next);\n };\n\n const nudge = (delta: number) => {\n const current = parseInt(draft, 10);\n const base = isNaN(current) ? (fallback ?? 0) : current;\n commit(base + delta);\n };\n\n const btnCls =\n \"flex items-center justify-center border border-input bg-background \" +\n \"text-muted-foreground hover:text-foreground hover:bg-muted \" +\n \"transition-colors select-none shrink-0 \" +\n \"h-full aspect-square leading-none\";\n\n return (\n <div\n className={cn(\n \"flex h-[var(--matrx-control-size,1.75rem)] items-stretch rounded-md overflow-hidden shrink-0\",\n className,\n )}\n >\n <button\n type=\"button\"\n onMouseDown={(e) => {\n e.preventDefault();\n nudge(-step);\n }}\n className={cn(btnCls, \"rounded-l-md border-r-0\")}\n tabIndex={-1}\n aria-label=\"Decrease\"\n >\n <MinusIcon width={12} height={12} strokeWidth={2.25} />\n </button>\n\n <input\n type=\"text\"\n inputMode=\"numeric\"\n value={draft}\n onChange={(e) => setDraft(e.target.value)}\n onBlur={() => commit()}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") {\n e.preventDefault();\n commit();\n }\n if (e.key === \"ArrowUp\") {\n e.preventDefault();\n nudge(step);\n }\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n nudge(-step);\n }\n }}\n style={{ width: `${Math.max(minChars, draft.length) + 3}ch` }}\n className={cn(\n \"border-y border-input bg-background text-foreground\",\n \"px-1.5 font-mono text-[length:var(--matrx-control-label,0.8125rem)] text-center outline-none\",\n \"focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring\",\n \"disabled:cursor-not-allowed disabled:opacity-50\",\n )}\n />\n\n <button\n type=\"button\"\n onMouseDown={(e) => {\n e.preventDefault();\n nudge(step);\n }}\n className={cn(btnCls, \"rounded-r-md border-l-0\")}\n tabIndex={-1}\n aria-label=\"Increase\"\n >\n <PlusIcon width={12} height={12} strokeWidth={2.25} />\n </button>\n </div>\n );\n}\n\n","\"use client\";\n\n/**\n * Slider — the range control (46 host import sites).\n *\n * Ported from matrx-frontend `components/ui/slider.tsx`. Two things the host\n * copy could not do, both fixed here rather than in a fork:\n *\n * 1. A 16px THUMB IS NOT A TOUCH TARGET. The stock thumb is `h-4 w-4`, well\n * under the 44px Apple HIG minimum, so a slider that worked with a mouse\n * was a coin-flip with a thumb. The visible thumb keeps its size (`size`\n * controls it), and an invisible `::after` pseudo-target expands the hit\n * area to 44px on coarse pointers without changing the layout — the same\n * trick `ResizableHandle` uses for mouse tolerance.\n *\n * 2. DENSITY IS A PROP, NOT A FORK (C18). `size=\"sm|md|lg\"` picks the track\n * height and thumb diameter together, so a dense admin panel and a\n * touch-first settings screen use ONE component.\n *\n * Multi-thumb ranges work: a `Thumb` is rendered per value, which is what\n * Radix requires and what the host copy (a single hardcoded Thumb) got wrong\n * for any `value` array longer than one.\n */\n\nimport * as SliderPrimitive from \"@radix-ui/react-slider\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nexport type SliderSize = \"sm\" | \"md\" | \"lg\";\n\nconst TRACK_CLASSES: Record<SliderSize, string> = {\n sm: \"h-1\",\n md: \"h-1.5\",\n lg: \"h-2.5\",\n};\n\nconst THUMB_CLASSES: Record<SliderSize, string> = {\n sm: \"h-3.5 w-3.5\",\n md: \"h-4 w-4\",\n lg: \"h-5 w-5\",\n};\n\nexport interface SliderProps\n extends React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root> {\n /** Track + thumb scale. Default `md`. */\n size?: SliderSize;\n}\n\nconst Slider = React.forwardRef<\n React.ComponentRef<typeof SliderPrimitive.Root>,\n SliderProps\n>(({ className, size = \"md\", ...props }, ref) => {\n // One Thumb per value — controlled `value` wins, then `defaultValue`, then\n // the single-thumb default. Radix renders nothing sensible if the count is\n // wrong, which is how the host copy silently dropped a range's upper thumb.\n const thumbCount = Math.max(\n 1,\n (props.value ?? props.defaultValue ?? [0]).length,\n );\n\n return (\n <SliderPrimitive.Root\n ref={ref}\n data-slot=\"slider\"\n className={cn(\n \"relative flex w-full touch-none select-none items-center data-[disabled]:opacity-50\",\n \"data-[orientation=vertical]:h-full data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col\",\n className,\n )}\n {...props}\n >\n <SliderPrimitive.Track\n data-slot=\"slider-track\"\n className={cn(\n \"relative w-full grow overflow-hidden rounded-full bg-primary/20\",\n TRACK_CLASSES[size],\n \"data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5\",\n )}\n >\n <SliderPrimitive.Range\n data-slot=\"slider-range\"\n className=\"absolute h-full bg-primary data-[orientation=vertical]:w-full\"\n />\n </SliderPrimitive.Track>\n {Array.from({ length: thumbCount }, (_, index) => (\n <SliderPrimitive.Thumb\n key={index}\n data-slot=\"slider-thumb\"\n // The thumb is the focusable slider: it carries the control's name (a label on the root alone leaves it unnamed).\n {...(props[\"aria-label\"] ? { \"aria-label\": props[\"aria-label\"] } : {})}\n {...(props[\"aria-valuetext\"] !== undefined ? { \"aria-valuetext\": props[\"aria-valuetext\"] } : {})}\n className={cn(\n \"relative block cursor-grab rounded-full border border-primary/50 bg-background shadow transition-colors active:cursor-grabbing\",\n \"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n // Ruling 1 — invisible 44px target, coarse pointers only, so a\n // dense desktop row keeps its exact hit behavior.\n \"after:absolute after:left-1/2 after:top-1/2 after:-translate-x-1/2 after:-translate-y-1/2 after:content-['']\",\n \"pointer-coarse:after:h-11 pointer-coarse:after:w-11\",\n THUMB_CLASSES[size],\n )}\n />\n ))}\n </SliderPrimitive.Root>\n );\n});\nSlider.displayName = SliderPrimitive.Root.displayName;\n\nexport { Slider };\n","\"use client\";\n\n/**\n * StageSteps — where a person is on a short path (\"Get a result → Make it an agent → Test & improve\").\n * One quiet row at control height (28px): a numbered mark per step, its label, a hairline between.\n * Steps before `current` are done (check), `current` is the filled primary mark with foreground text\n * (`aria-current=\"step\"`), later steps are muted. It only reports where you are — never a button row,\n * so it adds no choice to a header.\n *\n * `labels=\"current\"` keeps every mark but shows only the current step's label (a narrow header);\n * every hidden label stays the step's tooltip and accessible name. `labels=\"auto\"` shows every label\n * on wide screens and only the current one on a phone. Styles: controls.css `.matrx-stage-steps`.\n * Pinned by `stage-steps.test.tsx`.\n *\n * A long path (`maxVisible`) keeps the first and last steps and a window around the current one;\n * each run of hidden steps folds into one \"+N\" mark (its tooltip names them). The row never grows\n * past its container: labels truncate before anything spills.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { RadixCheckIcon } from \"../icons\";\n\nexport interface StageStep {\n id: string;\n label: string;\n}\n\nexport type StageState = \"done\" | \"current\" | \"upcoming\";\n\nexport interface StageStepsProps extends Omit<React.HTMLAttributes<HTMLOListElement>, \"children\"> {\n steps: readonly StageStep[];\n /** Index of the step the person is on; earlier steps read as done. Clamped to the list. */\n current: number;\n \"aria-label\": string;\n /**\n * \"all\" (default) shows every label; \"current\" only the current one (narrow headers); \"auto\"\n * every label on wide screens, only the current one under 640px.\n */\n labels?: \"all\" | \"current\" | \"auto\";\n /** At most this many marks (min 5); longer paths fold hidden runs into \"+N\". Default: all. */\n maxVisible?: number;\n}\n\nexport type StageSlot = { kind: \"step\"; index: number } | { kind: \"more\"; from: number; to: number };\n\n/**\n * Which marks a path of `count` steps draws with at most `maxVisible` marks: the first and last\n * step, a window around the current one, and one \"+N\" slot per hidden run. Pure (tested).\n */\nexport function stageSlots(count: number, current: number, maxVisible?: number): StageSlot[] {\n const all: StageSlot[] = Array.from({ length: count }, (_, index) => ({ kind: \"step\", index }));\n if (!maxVisible || count <= Math.max(5, maxVisible)) return all;\n const max = Math.max(5, Math.trunc(maxVisible));\n const at = Math.max(0, Math.min(count - 1, Math.trunc(current)));\n const size = max - 4; // first + last + up to two \"+N\" slots\n const start = Math.max(1, Math.min(count - 1 - size, at - Math.floor((size - 1) / 2)));\n const end = start + size - 1;\n const out: StageSlot[] = [{ kind: \"step\", index: 0 }];\n if (start > 1) out.push({ kind: \"more\", from: 1, to: start - 1 });\n for (let index = start; index <= end; index++) out.push({ kind: \"step\", index });\n if (end < count - 2) out.push({ kind: \"more\", from: end + 1, to: count - 2 });\n out.push({ kind: \"step\", index: count - 1 });\n return out;\n}\n\n/** The state each step draws in. Pure, so the rule is tested without a DOM. */\nexport function stageStates(count: number, current: number): StageState[] {\n const at = Math.max(0, Math.min(count - 1, Math.trunc(current)));\n return Array.from({ length: count }, (_, i) => (i < at ? \"done\" : i === at ? \"current\" : \"upcoming\"));\n}\n\nexport function StageSteps({ steps, current, labels = \"all\", maxVisible, className, ...props }: StageStepsProps) {\n const states = stageStates(steps.length, current);\n const slots = stageSlots(steps.length, current, maxVisible);\n return (\n <ol data-matrx-control=\"stage-steps\" data-labels={labels} className={cn(\"matrx-stage-steps\", className)} {...props}>\n {slots.map((slot, n) => {\n if (slot.kind === \"more\") {\n const hidden = steps.slice(slot.from, slot.to + 1);\n const state = states[slot.from];\n const names = hidden.map((step) => step.label).join(\", \");\n return (\n <li\n key={`more-${slot.from}`}\n data-stage=\"more\"\n data-state={state}\n title={names}\n aria-label={`${hidden.length} more steps: ${names}`}\n className=\"matrx-stage-steps-item\"\n >\n {n > 0 ? <span className=\"matrx-stage-steps-sep\" aria-hidden=\"true\" /> : null}\n <span className=\"matrx-stage-steps-more\" aria-hidden=\"true\">+{hidden.length}</span>\n </li>\n );\n }\n const i = slot.index;\n const step = steps[i]!;\n const state = states[i];\n return (\n <li\n key={step.id}\n data-stage={step.id}\n data-state={state}\n aria-current={state === \"current\" ? \"step\" : undefined}\n title={step.label}\n className=\"matrx-stage-steps-item\"\n >\n {n > 0 ? <span className=\"matrx-stage-steps-sep\" aria-hidden=\"true\" /> : null}\n <span className=\"matrx-stage-steps-mark\" aria-hidden=\"true\">\n {state === \"done\" ? <RadixCheckIcon /> : i + 1}\n </span>\n <span className=\"matrx-stage-steps-label\">\n {step.label}\n {state === \"done\" ? <span className=\"matrx-sr-only\"> (done)</span> : null}\n </span>\n </li>\n );\n })}\n </ol>\n );\n}\n","\"use client\";\n\n/**\n * Checklist — conditions a person works through, each with a status mark, and a meter over them.\n *\n * `ChecklistItem` is one condition: a 16px mark (done = filled success disc with a check, open =\n * a warning ring, unknown = a dashed muted ring), a 13px title, one 12px line (one line, full text\n * in its tooltip) and an optional end slot for the ONE action that fixes it. Under 640px the end\n * slot drops under the text, on the text's left edge. `ChecklistMeter` heads a group: its name,\n * \"N of M\" and one segment per condition, met segments in success. A status word goes in `end`\n * (a `Badge`). Neither draws a frame: they sit inside the caller's card.\n *\n * First caller: the brand page's research readiness (2026-10-23). Pinned by `checklist.test.tsx`.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { CheckIcon } from \"../icons\";\n\nexport type ChecklistState = \"done\" | \"open\" | \"unknown\";\n\nconst STATE_WORD: Record<ChecklistState, string> = {\n done: \"Met\",\n open: \"Missing\",\n unknown: \"Not measured\",\n};\n\nexport function ChecklistMark({ state, className }: { state: ChecklistState; className?: string }) {\n return (\n <span\n data-matrx-checklist-mark=\"\"\n data-state={state}\n role=\"img\"\n aria-label={STATE_WORD[state]}\n className={cn(\n \"grid size-4 shrink-0 place-items-center rounded-full\",\n state === \"done\" && \"bg-success text-success-foreground\",\n state === \"open\" && \"border-2 border-warning\",\n state === \"unknown\" && \"border-2 border-dashed border-muted-foreground\",\n className,\n )}\n >\n {state === \"done\" ? <CheckIcon className=\"size-3\" strokeWidth={3} /> : null}\n </span>\n );\n}\n\nexport interface ChecklistProps extends React.HTMLAttributes<HTMLUListElement> {\n \"aria-label\"?: string;\n}\n\n/** The list around `ChecklistItem`s: no frame, no gap of its own beyond the rows. */\nexport function Checklist({ className, children, ...props }: ChecklistProps) {\n return (\n <ul data-matrx-checklist=\"\" className={cn(\"grid min-w-0\", className)} {...props}>\n {children}\n </ul>\n );\n}\n\nexport interface ChecklistItemProps extends Omit<React.LiHTMLAttributes<HTMLLIElement>, \"title\"> {\n state: ChecklistState;\n /** The condition, in a few words. */\n title: React.ReactNode;\n /** One line under the title: what was measured, or what is missing. Its full text is the tooltip. */\n line?: string | null;\n /** The one action that fixes this condition (a `Button`). */\n end?: React.ReactNode;\n}\n\nexport function ChecklistItem({ state, title, line, end, className, ...props }: ChecklistItemProps) {\n return (\n <li\n data-matrx-checklist-item=\"\"\n data-state={state}\n className={cn(\n \"grid min-w-0 grid-cols-[auto_minmax(0,1fr)] items-start gap-x-2 py-1.5 sm:grid-cols-[auto_minmax(0,1fr)_auto]\",\n className,\n )}\n {...props}\n >\n <ChecklistMark state={state} className=\"mt-0.5\" />\n <div className=\"min-w-0\">\n <div className=\"type-title truncate text-foreground\">{title}</div>\n {line ? (\n <div className=\"type-secondary truncate text-muted-foreground\" title={line}>\n {line}\n </div>\n ) : null}\n </div>\n {end ? (\n <div className=\"col-start-2 mt-1.5 flex justify-start sm:col-start-3 sm:row-start-1 sm:mt-0 sm:justify-end sm:self-center\">\n {end}\n </div>\n ) : null}\n </li>\n );\n}\n\nexport interface ChecklistMeterProps {\n /** The group's name (\"What others say\"). */\n label: React.ReactNode;\n met: number;\n total: number;\n /** A status word after the count (a `Badge`). */\n end?: React.ReactNode;\n className?: string;\n}\n\n/** A group's head: name, \"N of M\" and one segment per condition. */\nexport function ChecklistMeter({ label, met, total, end, className }: ChecklistMeterProps) {\n const done = Math.max(0, Math.min(total, met));\n return (\n <div data-matrx-checklist-meter=\"\" className={cn(\"grid min-w-0 gap-1.5\", className)}>\n <div className=\"flex min-w-0 items-center gap-2\">\n <span className=\"type-title min-w-0 truncate text-foreground\">{label}</span>\n <span className=\"type-meta shrink-0 tabular-nums text-muted-foreground\">\n {done} of {total}\n </span>\n {end ? <span className=\"ml-auto flex shrink-0 items-center\">{end}</span> : null}\n </div>\n <div\n role=\"meter\"\n aria-valuemin={0}\n aria-valuemax={total}\n aria-valuenow={done}\n aria-label={`${done} of ${total} met`}\n className=\"flex gap-1\"\n >\n {Array.from({ length: total }, (_, i) => (\n <span\n key={i}\n data-filled={i < done ? \"\" : undefined}\n className={cn(\"h-1.5 flex-1 rounded-full\", i < done ? \"bg-success\" : \"bg-border\")}\n />\n ))}\n </div>\n </div>\n );\n}\n","\"use client\";\n\n// The ONE integer field (moved from matrx-frontend components/official, 2026-10-08; before that\n// features/marketing/components/shared,\n// 2026-10-01). A number field bound straight to a number state paints \"04\":\n// clearing it parses to 0, the next keystroke makes the DOM value \"04\", and\n// React leaves it because \"04\" == 4 (verify-6 #3, flashcards \"Number of\n// cards\"). This keeps a text draft while typing and clamps on blur or Enter,\n// so the field can go empty and never shows a leading zero.\n\nimport { useEffect, useState } from \"react\";\nimport { Input } from \"./doors\";\n\nexport type ClampedNumberInputProps = {\n id?: string;\n value: number;\n min: number;\n /** Omit while the ceiling is still being read. */\n max?: number | null;\n /** Fractional values (ratios, prices). Integers by default. */\n decimal?: boolean;\n /** HTML step; defaults to 1 for integers and \"any\" for decimals. */\n step?: number | \"any\";\n disabled?: boolean;\n className?: string;\n \"aria-label\"?: string;\n \"data-testid\"?: string;\n title?: string;\n onChange: (value: number) => void;\n /**\n * The number the field shows right now when it is a value it would keep as typed, else null\n * (empty, or out of range until blur clamps it). A label that repeats the count (\"Make 5\n * cards\") reads this, so it never names a number the field does not show (verify-7 #3).\n */\n onDraftChange?: (shown: number | null) => void;\n};\n\n/** The number a draft shows when it is exactly a value the field would keep, else null. */\nexport function shownDraft(raw: string, min: number, max?: number | null, decimal = false): number | null {\n const next = clampDraft(raw, min, max, decimal);\n if (next === null) return null;\n return String(next) === raw.replace(/^0+(?=\\d)/, \"\") ? next : null;\n}\n\n/** The committed value for a typed draft, or null to restore the last value. */\nexport function clampDraft(\n raw: string,\n min: number,\n max?: number | null,\n decimal = false,\n): number | null {\n const parsed = decimal ? Number.parseFloat(raw) : Number.parseInt(raw, 10);\n if (Number.isNaN(parsed)) return null;\n const floored = Math.max(min, parsed);\n return max === undefined || max === null ? floored : Math.min(max, floored);\n}\n\n/**\n * Controlled integer input that lets the field go empty while typing. An\n * in-range number commits as it is typed; clamp / restore of anything else\n * happens on blur or Enter — never mid-keystroke.\n */\nexport function ClampedNumberInput({\n id,\n value,\n min,\n max,\n decimal = false,\n step,\n disabled,\n className,\n \"aria-label\": ariaLabel,\n \"data-testid\": testId,\n title,\n onChange,\n onDraftChange,\n}: ClampedNumberInputProps) {\n const [draft, setDraftState] = useState(String(value));\n // Reported in the same event as the keystroke, so a label repeating the count is never one\n // render behind the field.\n const setDraft = (raw: string) => {\n setDraftState(raw);\n onDraftChange?.(shownDraft(raw, min, max, decimal));\n };\n\n useEffect(() => {\n setDraftState(String(value));\n onDraftChange?.(shownDraft(String(value), min, max, decimal));\n }, [value, min, max, decimal, onDraftChange]);\n\n const commit = (raw: string) => {\n const next = clampDraft(raw, min, max, decimal);\n if (next === null) {\n setDraft(String(value));\n return;\n }\n setDraft(String(next));\n if (next !== value) onChange(next);\n };\n\n return (\n <Input\n id={id}\n type=\"number\"\n inputMode={decimal ? \"decimal\" : \"numeric\"}\n step={step ?? (decimal ? \"any\" : 1)}\n min={min}\n max={max ?? undefined}\n disabled={disabled}\n aria-label={ariaLabel}\n data-testid={testId}\n title={title}\n className={className}\n value={draft}\n onChange={(event) => {\n const raw = event.target.value;\n setDraft(raw);\n // An in-range value is the value now (a \"Make 10 cards\" button must\n // not lag the field until blur); anything else waits for blur.\n const next = shownDraft(raw, min, max, decimal);\n if (next !== null && next !== value) onChange(next);\n }}\n onBlur={(event) => commit(event.target.value)}\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n event.currentTarget.blur();\n }\n }}\n />\n );\n}\n","\"use client\";\n// LightSwitchToggle — moved from matrx-frontend components/matrx (chat host slot; the package default now).\n\nimport { useState, forwardRef } from \"react\";\nimport { cn } from \"../cn\";\n\nconst defaultSizes = {\n width: \"w-48\",\n height: \"h-16\",\n} as const;\n\nexport interface LightSwitchToggleProps {\n variant?: \"rounded\" | \"geometric\" | string;\n defaultValue?: boolean;\n value?: boolean;\n onChange?: (value: boolean) => void;\n width?: string;\n height?: string;\n labels?: {\n on: string;\n off: string;\n };\n disabled?: boolean;\n className?: string;\n}\n\nconst LightSwitchToggle = forwardRef<HTMLDivElement, LightSwitchToggleProps>(\n (\n {\n variant,\n defaultValue = false,\n value,\n onChange,\n width,\n height,\n labels = { on: \"ON\", off: \"OFF\" },\n disabled = false,\n className,\n }: LightSwitchToggleProps,\n ref,\n ) => {\n const [internalState, setInternalState] = useState(defaultValue);\n const validVariant = variant === \"geometric\" ? \"geometric\" : \"rounded\";\n\n const isOn = value !== undefined ? value : internalState;\n\n const handleToggle = (newState: boolean) => {\n if (disabled) return;\n if (value === undefined) {\n setInternalState(newState);\n }\n onChange?.(newState);\n };\n\n const containerClasses = cn(\n \"relative flex bg-muted shadow-inner overflow-hidden\",\n width || defaultSizes.width,\n height || defaultSizes.height,\n validVariant === \"rounded\" && \"rounded-full\",\n disabled && \"opacity-50 cursor-not-allowed\",\n className,\n );\n\n const buttonBaseClasses =\n \"relative w-1/2 h-full transition-all duration-300\";\n const activeButtonClasses =\n \"bg-primary transform -translate-y-px shadow-[inset_0_1px_3px_rgba(0,0,0,0.2)]\";\n const inactiveButtonClasses = \"bg-muted/60 transform -translate-y-1.5\";\n\n const renderOption = (\n isActive: boolean,\n label: string,\n side: \"left\" | \"right\",\n onClick: () => void,\n ) => (\n <button\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n aria-pressed={isActive}\n className={cn(\n buttonBaseClasses,\n isActive ? activeButtonClasses : inactiveButtonClasses,\n )}\n >\n <div\n className={cn(\n \"absolute inset-0\",\n side === \"left\"\n ? \"border-r border-border\"\n : \"border-l border-border\",\n validVariant === \"rounded\" &&\n (side === \"left\" ? \"rounded-l-full\" : \"rounded-r-full\"),\n isActive\n ? \"bg-gradient-to-br from-primary/90 via-primary to-primary/90\"\n : \"bg-gradient-to-br from-muted/70 via-muted/50 to-muted/70 dark:from-muted/40 dark:via-muted/30 dark:to-muted/40\",\n )}\n />\n <span\n className={cn(\n \"relative z-20 font-semibold text-xs truncate px-1 transition-colors\",\n isActive ? \"text-primary-foreground\" : \"text-muted-foreground\",\n )}\n >\n {label}\n </span>\n </button>\n );\n\n return (\n <div className=\"flex items-center justify-center\">\n <div ref={ref} className={containerClasses}>\n <div className=\"absolute left-1/2 top-0 bottom-0 w-[2px] bg-border transform -translate-x-1/2 z-10\" />\n {renderOption(!isOn, labels.off, \"left\", () => handleToggle(false))}\n {renderOption(isOn, labels.on, \"right\", () => handleToggle(true))}\n </div>\n </div>\n );\n },\n);\n\nLightSwitchToggle.displayName = \"LightSwitchToggle\";\n\nexport { LightSwitchToggle };\n","\"use client\";\n\n/**\n * OptionCombobox — a single-select over a string option list, searchable.\n *\n * The house choice rule (features/agents/utils/choice-rule.ts): pills for up to\n * four short options, a plain select up to twelve, and THIS above twelve — a\n * list that long is scanned by typing, never by scrolling a pill wall. Groups\n * are optional; a group marked `collapsed` shows behind a \"More\" row until the\n * person opens it, searches, or its option is the current value.\n *\n * Two trigger looks: `field` (bordered, matches SelectTrigger) and `inline`\n * (borderless, for dense settings rows).\n */\n\nimport { useState, type ReactNode } from \"react\";\nimport { CheckIcon, ChevronRightIcon as ChevronRight } from \"../icons\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../popover\";\nimport { SelectChevron } from \"../select\";\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from \"../command\";\nimport { cn } from \"../cn\";\n\nexport interface OptionComboboxGroup {\n heading?: string;\n options: string[];\n /** Hidden behind a \"More\" row until opened (or searched, or selected). */\n collapsed?: boolean;\n}\n\nexport interface OptionComboboxProps {\n value: string;\n onChange: (value: string) => void;\n /** Flat list — or pass `groups`. */\n options?: readonly string[] | undefined;\n groups?: OptionComboboxGroup[] | undefined;\n /** Display text for an option (defaults to the option itself). */\n getLabel?: ((option: string) => string) | undefined;\n /** Secondary text shown muted after the label. */\n getHint?: ((option: string) => string | null | undefined) | undefined;\n /** Leading visual for an option (e.g. a ratio shape). */\n renderIcon?: ((option: string) => ReactNode) | undefined;\n placeholder?: string | undefined;\n searchPlaceholder?: string | undefined;\n /** Hide the search box (short grouped lists). */\n searchable?: boolean | undefined;\n variant?: \"field\" | \"inline\" | undefined;\n compact?: boolean | undefined;\n disabled?: boolean | undefined;\n id?: string | undefined;\n ariaLabel?: string | undefined;\n className?: string | undefined;\n}\n\nexport function OptionCombobox({\n value,\n onChange,\n options,\n groups: groupsProp,\n getLabel = (o) => o,\n getHint,\n renderIcon,\n placeholder = \"Choose…\",\n searchPlaceholder = \"Search…\",\n searchable = true,\n variant = \"field\",\n compact = false,\n disabled = false,\n id,\n ariaLabel,\n className,\n}: OptionComboboxProps) {\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState(\"\");\n const [showMore, setShowMore] = useState(false);\n\n const groups: OptionComboboxGroup[] = groupsProp ?? [\n { options: [...(options ?? [])] },\n ];\n const q = query.trim().toLowerCase();\n const matches = (o: string) =>\n !q ||\n o.toLowerCase().includes(q) ||\n getLabel(o).toLowerCase().includes(q) ||\n (getHint?.(o) ?? \"\").toLowerCase().includes(q);\n\n const hasValue = value !== \"\";\n const hint = hasValue ? getHint?.(value) : null;\n\n const pick = (o: string) => {\n onChange(o);\n setOpen(false);\n setQuery(\"\");\n };\n\n return (\n <Popover\n open={open}\n onOpenChange={(next) => {\n setOpen(next);\n if (!next) {\n setQuery(\"\");\n setShowMore(false);\n }\n }}\n >\n <PopoverTrigger asChild disabled={disabled}>\n <button\n id={id}\n type=\"button\"\n role=\"combobox\"\n aria-expanded={open}\n aria-label={ariaLabel}\n className={cn(\n \"flex w-full min-w-0 items-center gap-2 text-left transition-colors\",\n \"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\",\n \"disabled:cursor-not-allowed disabled:opacity-50\",\n variant === \"field\"\n ? cn(\n // The one field surface (design-system FIELD_SURFACE_CLASS) — never gray beside a Select.\n \"rounded-md border border-border bg-card px-3 shadow-xs hover:bg-accent/40\",\n compact ? \"h-8 text-xs\" : \"h-9 text-sm\",\n )\n : \"h-7 rounded px-1 text-xs font-medium text-muted-foreground hover:text-foreground\",\n className,\n )}\n >\n {hasValue && renderIcon?.(value)}\n <span\n className={cn(\n \"min-w-0 flex-1 truncate\",\n !hasValue && \"text-muted-foreground\",\n )}\n >\n {hasValue ? getLabel(value) : placeholder}\n {hint && (\n <span className=\"ml-1.5 text-muted-foreground\">{hint}</span>\n )}\n </span>\n <SelectChevron size=\"sm\" className={variant === \"inline\" ? \"h-3 w-3\" : undefined} />\n </button>\n </PopoverTrigger>\n <PopoverContent\n sizing=\"content\"\n align=\"start\"\n className=\"p-0\"\n >\n <Command shouldFilter={false}>\n {searchable && (\n <CommandInput\n placeholder={searchPlaceholder}\n value={query}\n onValueChange={setQuery}\n />\n )}\n <CommandList className=\"max-h-72\">\n <CommandEmpty>No match for “{query}”.</CommandEmpty>\n {groups.map((group, gi) => {\n const visible = group.options.filter(matches);\n if (visible.length === 0) return null;\n const folded =\n group.collapsed &&\n !showMore &&\n !q &&\n !group.options.includes(value);\n if (folded) {\n return (\n <CommandGroup key={`g-${gi}`}>\n <CommandItem\n value={`__more_${gi}`}\n onSelect={() => setShowMore(true)}\n className=\"text-muted-foreground\"\n >\n <ChevronRight className=\"h-3.5 w-3.5\" />\n {group.heading ?? \"More\"}\n <span className=\"ml-auto type-secondary tabular-nums\">\n {group.options.length}\n </span>\n </CommandItem>\n </CommandGroup>\n );\n }\n return (\n <CommandGroup key={`g-${gi}`} heading={group.heading}>\n {visible.map((o) => {\n const selected = o === value;\n const h = getHint?.(o);\n return (\n <CommandItem\n key={o}\n value={o}\n onSelect={() => pick(o)}\n className=\"gap-2\"\n >\n {renderIcon?.(o)}\n <span className=\"min-w-0 flex-1 truncate\">\n {getLabel(o)}\n {h && (\n <span className=\"ml-1.5 text-muted-foreground\">\n {h}\n </span>\n )}\n </span>\n <CheckIcon\n className={cn(\n \"h-3.5 w-3.5 shrink-0\",\n selected ? \"opacity-100\" : \"opacity-0\",\n )}\n />\n </CommandItem>\n );\n })}\n </CommandGroup>\n );\n })}\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n );\n}\n","\"use client\";\n\n/**\n * Command — ported verbatim from matrx-frontend `components/ui/command.tsx`.\n *\n * `cmdk` is a SANCTIONED REAL DEPENDENCY (the vaul ↔ BottomSheet precedent):\n * the filtering/scoring/keyboard engine IS the component's product — there is\n * no Command palette without it, and reimplementing type-ahead ranking plus\n * roving keyboard selection would twin a maintained library rather than our\n * own code. See FEATURE.md.\n *\n * Seam inversions:\n * - `MagnifyingGlassIcon` comes from the package's inlined SVGs (C19), not\n * @radix-ui/react-icons.\n * - `CommandDialog` composed the host dialog module (`Dialog`, `DialogContent`,\n * `DialogTitle`). Those pieces are inlined privately below with identical\n * behavior — modal context, overlay, desktop card / mobile bottom-sheet\n * geometry, close control, portal — except the host's popout-aware\n * `DialogPortal` becomes the package's `PortalContainerProvider` seam\n * (plus an explicit `container` prop, which keeps top priority).\n * - The host's `useIsMobile` (a plain matchMedia breakpoint hook, not\n * host-shaped) became the package's own `./use-is-mobile`, with the same\n * 768px breakpoint. It started life inlined here; `Dialog` needed the same\n * answer, so it moved to a module both read rather than being copied.\n */\n\nimport type { DialogProps } from \"@radix-ui/react-dialog\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { keepFloatingLayersInside, useModalLayer } from \"./floating-layer\";\nimport {\n CENTERED_DIALOG,\n MOTION_BOTTOM_SHEET,\n MOTION_DIALOG,\n MOTION_OVERLAY,\n} from \"./motion\";\nimport { CloseControl, CloseRow, CloseSlotProvider, SearchRowCloseSlotProvider, useCloseSlot, useSearchRowCloseSlotClaim } from \"./close-slot\";\nimport { MagnifyingGlassIcon } from \"./icons\";\nimport { usePortalContainer } from \"./portal-container\";\nimport {\n RadixDialogModalProvider,\n useRadixDialogModal,\n} from \"./radix-dialog-modal-context\";\nimport { useIsMobile } from \"./use-is-mobile\";\n\nexport const Command = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground\",\n className,\n )}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\n/* ------------------------------------------------------------------ */\n/* Private dialog internals for CommandDialog (host dialog module, */\n/* behavior-identical, portal seam inverted). */\n/* ------------------------------------------------------------------ */\n\nconst DIALOG_DESKTOP_CLASSES =\n `fixed left-[50%] top-[50%] z-[10000] grid min-w-0 w-full max-w-lg ${CENTERED_DIALOG} gap-4 overflow-x-clip border bg-background p-6 shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full sm:rounded-lg`;\n\nconst DIALOG_MOBILE_SHEET_CLASSES =\n \"fixed inset-x-0 bottom-0 left-0 right-0 top-auto z-[10000] flex min-w-0 flex-col w-full max-w-full max-h-[90dvh] translate-x-0 translate-y-0 gap-4 overflow-x-clip border-t bg-background p-4 pb-safe shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full rounded-t-2xl rounded-b-none overflow-y-auto overscroll-contain\";\n\n// Re-asserted LAST so the sheet geometry always wins over any caller className.\nconst DIALOG_MOBILE_SHEET_OVERRIDE =\n \"inset-x-0 bottom-0 left-0 right-0 top-auto translate-x-0 translate-y-0 w-full max-w-full max-h-[90dvh] rounded-b-none rounded-t-2xl overflow-y-auto\";\n\nconst CommandDialogContent = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n container?: HTMLElement | null;\n }\n>(({ className, children, container, onInteractOutside, ...props }, ref) => {\n const isMobile = useIsMobile();\n const isModal = useRadixDialogModal();\n useModalLayer(isModal);\n const portalContainer = usePortalContainer(container);\n // The × is the last item of the search row (close-slot.tsx); a palette with\n // no CommandInput gets a close row of its own.\n const closeSlot = useCloseSlot(true);\n return (\n <DialogPrimitive.Portal container={portalContainer}>\n {isModal ? (\n <DialogPrimitive.Overlay\n className={cn(\n \"fixed inset-0 z-[10000] bg-[var(--matrx-overlay-scrim-soft)]\",\n MOTION_OVERLAY,\n )}\n />\n ) : null}\n <DialogPrimitive.Content\n ref={ref}\n aria-modal={isModal || undefined}\n aria-describedby={undefined}\n className={cn(\n isMobile ? DIALOG_MOBILE_SHEET_CLASSES : DIALOG_DESKTOP_CLASSES,\n isMobile ? MOTION_BOTTOM_SHEET : MOTION_DIALOG,\n className,\n isMobile && DIALOG_MOBILE_SHEET_OVERRIDE,\n !isModal && \"z-[900]\",\n )}\n {...props}\n onInteractOutside={keepFloatingLayersInside(onInteractOutside)}\n >\n {closeSlot.slot && !closeSlot.claimed ? <CloseRow className=\"px-4 pt-4\" /> : null}\n {/* A header inside a palette never reaches past it to an outer Dialog's slot. */}\n <CloseSlotProvider value={null}>\n <SearchRowCloseSlotProvider value={closeSlot.slot}>{children}</SearchRowCloseSlotProvider>\n </CloseSlotProvider>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n );\n});\nCommandDialogContent.displayName = \"CommandDialogContent\";\n\nexport interface CommandDialogProps extends DialogProps {\n /** Explicit portal target for the dialog; beats the injected seam. */\n container?: HTMLElement | null;\n}\n\nexport const CommandDialog = ({\n children,\n container,\n ...props\n}: CommandDialogProps) => {\n const modal = props.modal ?? true;\n return (\n <RadixDialogModalProvider modal={modal}>\n <DialogPrimitive.Root {...props} modal={modal}>\n <CommandDialogContent\n className=\"overflow-hidden p-0\"\n {...(container !== undefined ? { container } : {})}\n >\n <DialogPrimitive.Title className=\"sr-only\"></DialogPrimitive.Title>\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </CommandDialogContent>\n </DialogPrimitive.Root>\n </RadixDialogModalProvider>\n );\n};\n\nexport const CommandInput = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\n>(({ className, ...props }, ref) => {\n // Inside a CommandDialog the search row owns the × (never a combobox's input in a Dialog).\n const ownsClose = useSearchRowCloseSlotClaim();\n return (\n <div className=\"flex items-center gap-2 border-b px-3\" cmdk-input-wrapper=\"\">\n <MagnifyingGlassIcon className=\"h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"flex h-10 w-full min-w-0 rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:text-disabled-foreground\",\n className,\n )}\n {...props}\n />\n {ownsClose ? <CloseControl className=\"-mr-1\" /> : null}\n </div>\n );\n});\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\n/**\n * The × for a CommandDialog whose search row is the caller's own (chips, a raw\n * input): put `<CommandRowClose />` last in that row and it claims the palette's\n * slot like `CommandInput` does — never an empty close row above the search.\n * Outside a CommandDialog it draws nothing.\n */\nexport function CommandRowClose({ className }: { className?: string }): React.ReactElement | null {\n const owns = useSearchRowCloseSlotClaim();\n return owns ? <CloseControl className={cn(\"-mr-1\", className)} /> : null;\n}\n\nexport const CommandList = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\"max-h-[300px] overflow-y-auto overflow-x-hidden\", className)}\n {...props}\n />\n));\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nexport const CommandEmpty = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty\n ref={ref}\n className=\"py-6 text-center text-sm\"\n {...props}\n />\n));\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nexport const CommandGroup = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground\",\n className,\n )}\n {...props}\n />\n));\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nexport const CommandSeparator = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 h-px bg-border\", className)}\n {...props}\n />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nexport const CommandItem = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:text-disabled-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n className,\n )}\n {...props}\n />\n));\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nexport const CommandShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n \"ml-auto text-xs tracking-widest text-muted-foreground\",\n className,\n )}\n {...props}\n />\n );\n};\nCommandShortcut.displayName = \"CommandShortcut\";\n","\"use client\";\n\n/**\n * THE CLOSE CONTROL LIVES IN A ROW, NEVER IN A CORNER.\n *\n * The stock shadcn dialog pins its × with `absolute right-4 top-4`: a\n * coordinate guess about how tall the content's first row will be. Every\n * content whose first row is a different height got an × floating off its\n * row — the command palette's sat 12px below its 48px search row, on the\n * divider, with the query running underneath it (Arman, 2026-10-20: \"each\n * time they use this component, we end up with a very oddly placed x\").\n * Agents re-typed that snippet from memory faster than it could be fixed.\n *\n * So the × is a flex item of the row it belongs to, centered by layout:\n *\n * - `CommandInput` inside a `CommandDialog` draws it at the end of the\n * search row.\n * - `DialogHeader` / `SheetHeader` draw it at the end of the header row and\n * CLAIM it, so the content does not draw a second one; with two headers the\n * first one mounted draws it.\n * - Content with no visible header gets a close row of its own at the top,\n * in flow — it takes space, it never covers anything.\n *\n * Guard: `close-in-flow.test.tsx` — no `*.Close` in this package or its\n * consumers carries `absolute`/`fixed`, and each surface puts the × inside\n * its row.\n */\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { XIcon } from \"./icons\";\n\n/** 44px on touch, 32px from `lg`; a flex item, never positioned. */\nconst CLOSE_CONTROL_CLASSES =\n \"flex h-11 w-11 shrink-0 items-center justify-center rounded-sm text-muted-foreground ring-offset-background transition-colors hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none lg:h-8 lg:w-8\";\n\nexport function CloseControl({ className }: { className?: string }): React.ReactElement {\n return (\n <DialogPrimitive.Close data-slot=\"dialog-close\" aria-label=\"Close\" className={cn(CLOSE_CONTROL_CLASSES, className)}>\n <XIcon className=\"h-4 w-4\" aria-hidden=\"true\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n );\n}\n\ninterface CloseSlot {\n /** A row takes the × into itself; returns the release. The FIRST live claimant owns it. */\n claim(id: string): () => void;\n /** The id that draws the ×, or null while nobody claims it. */\n owner: string | null;\n}\n\n/** Dialog and Sheet: claimed by their header. */\nconst CloseSlotContext = React.createContext<CloseSlot | null>(null);\n/**\n * CommandDialog: claimed by its search row only. A separate context so a\n * CommandInput in a combobox (Popover > Command) opened INSIDE a Dialog never\n * takes the dialog's × — context crosses portals, and that × closes the dialog.\n */\nconst SearchRowCloseSlotContext = React.createContext<CloseSlot | null>(null);\n\n/**\n * For a content surface: returns the provider value and whether a row has\n * claimed the ×. Unclaimed (no header, or only an `sr-only`/`hidden` one) the\n * content draws `<CloseRow />` first, in flow. Claims land in a layout effect,\n * so the fallback never paints when a row takes it.\n */\nexport function useCloseSlot(enabled: boolean): { slot: CloseSlot | null; claimed: boolean } {\n const [claims, setClaims] = React.useState<string[]>([]);\n const owner = claims[0] ?? null;\n const claim = React.useCallback((id: string) => {\n setClaims((list) => [...list, id]);\n return () => setClaims((list) => list.filter((c) => c !== id));\n }, []);\n const slot = React.useMemo<CloseSlot | null>(() => (enabled ? { claim, owner } : null), [enabled, claim, owner]);\n return { slot, claimed: owner !== null };\n}\n\nexport const CloseSlotProvider = CloseSlotContext.Provider;\nexport const SearchRowCloseSlotProvider = SearchRowCloseSlotContext.Provider;\n\nfunction useClaim(context: React.Context<CloseSlot | null>, declined: boolean): boolean {\n const slot = React.useContext(context);\n const id = React.useId();\n const claim = slot?.claim;\n const wants = claim !== undefined && !declined;\n // Depends on the stable `claim`, never on `owner`, so a change of owner never re-claims.\n React.useLayoutEffect(() => (wants && claim ? claim(id) : undefined), [wants, claim, id]);\n return wants && slot?.owner === id;\n}\n\n/** For a header row: claims the Dialog/Sheet slot; true when this row draws the ×. */\nexport function useCloseSlotClaim(declined = false): boolean {\n return useClaim(CloseSlotContext, declined);\n}\n\n/** For CommandInput: claims only a CommandDialog's slot; true when this row draws the ×. */\nexport function useSearchRowCloseSlotClaim(): boolean {\n return useClaim(SearchRowCloseSlotContext, false);\n}\n\n/** The fallback: a row of its own at the top of the content. */\nexport function CloseRow({ className }: { className?: string }): React.ReactElement {\n return (\n <div data-slot=\"close-row\" className={cn(\"flex justify-end\", className)}>\n <CloseControl />\n </div>\n );\n}\n\n/** Classes that lay out a header's CHILDREN; they move to the header's body. */\nconst BODY_LAYOUT = /^!?(?:[a-z0-9]+:)*(?:flex|grid|flex-(?:row|col)(?:-reverse)?|grid-(?:cols|rows|flow)-\\S+|place-\\S+|items-\\S+|justify-\\S+|content-\\S+|gap(?:-[xy])?-\\S+|space-[xy]-\\S+|text-(?:left|center|right|start|end)|flex-wrap|flex-nowrap)$/;\n/**\n * Right padding a header carried to clear the old corner ×; with the × in the\n * row it would only push the × inward, so it is dropped.\n */\nconst OLD_CLOSE_RESERVE = /^pr-(?:8|9|10|11|12|14|16)$/;\n\nfunction splitHeaderClasses(className: string | undefined): { row: string; body: string } {\n const row: string[] = [];\n const body: string[] = [];\n for (const c of (className ?? \"\").split(/\\s+/)) {\n if (!c || OLD_CLOSE_RESERVE.test(c)) continue;\n (BODY_LAYOUT.test(c) ? body : row).push(c);\n }\n return { row: row.join(\" \"), body: body.join(\" \") };\n}\n\n/**\n * A header's element. With a close slot it is a row — the caller's children\n * in a body column, the × after them; the caller's padding, border and\n * background stay on the row, the caller's child layout (`flex-row`,\n * `space-y-*`, `text-left`…) moves to the body. Without one (no ×, or the\n * header is `sr-only`) it renders exactly as `baseClassName` + `className`.\n */\nexport function HeaderWithClose({\n slotName,\n baseClassName,\n closeOffsetClassName,\n className,\n children,\n ...props\n}: React.HTMLAttributes<HTMLDivElement> & {\n slotName: string;\n baseClassName: string;\n /** Pulls the × up so its center sits on the title's first line (the title's line height is the header's to know). */\n closeOffsetClassName: string;\n}): React.ReactElement {\n // A header nobody sees declines the ×; the content's own close row draws it.\n const owns = useCloseSlotClaim(/(?:^|\\s)(?:sr-only|hidden)(?:\\s|$)/.test(className ?? \"\"));\n if (!owns) {\n return (\n <div data-slot={slotName} className={cn(baseClassName, className)} {...props}>\n {children}\n </div>\n );\n }\n const { row, body } = splitHeaderClasses(className);\n // A header laid out as a row centers the × on that row; a stacked one, on the title's first line.\n const rowish = /(?:^|\\s)(?:[a-z0-9]+:)*flex-row(?:\\s|$)/.test(body);\n return (\n <div data-slot={slotName} data-has-close=\"\" className={cn(\"flex gap-2\", rowish ? \"items-center\" : \"items-start\", row)} {...props}>\n <div data-slot={`${slotName}-body`} className={cn(\"min-w-0 flex-1\", baseClassName, body)}>\n {children}\n </div>\n <CloseControl className={cn(\"-mr-2\", !rowish && closeOffsetClassName)} />\n </div>\n );\n}\n","import { humanizeIdentifier } from \"@ai-matrx/kit/text-case\";\n/**\n * Aspect-ratio option sets — recognizing them and ordering them for a picker.\n *\n * Model catalogs expose aspect ratio as a plain string enum (\"1:1\", \"16:9\",\n * \"9:19.5\", Runway's pixel pairs \"1280:720\", plus words like \"auto\" or\n * \"match_input_image\"). Any option list that is mostly ratios renders through\n * `AspectRatioSelect` — wherever it came from — so the rule lives on the data,\n * not on one control key.\n */\n\nexport interface ParsedRatio {\n w: number;\n h: number;\n}\n\nconst RATIO_RE = /^\\s*(\\d+(?:\\.\\d+)?)\\s*[:x×/]\\s*(\\d+(?:\\.\\d+)?)\\s*$/i;\n\nexport function parseRatio(value: string): ParsedRatio | null {\n const m = RATIO_RE.exec(value);\n if (!m) return null;\n const w = Number(m[1]);\n const h = Number(m[2]);\n if (!(w > 0 && h > 0)) return null;\n return { w, h };\n}\n\n/** True when at least two options and every option but the words is a ratio. */\nexport function isAspectRatioOptionSet(options: readonly string[]): boolean {\n const ratios = options.filter((o) => parseRatio(o) !== null).length;\n return ratios >= 2 && ratios >= options.length - 2;\n}\n\n/** The ratios people reach for, in the order they reach for them. */\nconst COMMON_ORDER = [\n \"1:1\",\n \"16:9\",\n \"9:16\",\n \"4:3\",\n \"3:4\",\n \"3:2\",\n \"2:3\",\n \"4:5\",\n \"5:4\",\n \"21:9\",\n];\n\nfunction reduced(r: ParsedRatio): string {\n const scale = 1000;\n let a = Math.round(r.w * scale);\n let b = Math.round(r.h * scale);\n const gcd = (x: number, y: number): number => (y === 0 ? x : gcd(y, x % y));\n const g = gcd(a, b);\n a /= g;\n b /= g;\n return `${a}:${b}`;\n}\n\n/** \"Square\", \"Landscape\", … — a plain word for the shape. */\nexport function ratioShapeName(value: string): string | null {\n const r = parseRatio(value);\n if (!r) return null;\n const k = r.w / r.h;\n if (Math.abs(k - 1) < 0.02) return \"Square\";\n if (k >= 2.2) return \"Ultrawide\";\n if (k <= 1 / 2.2) return \"Tall\";\n if (k > 1.6) return \"Widescreen\";\n if (k < 1 / 1.6) return \"Story\";\n return k > 1 ? \"Landscape\" : \"Portrait\";\n}\n\n/** Words that are not ratios (\"auto\", \"match_input_image\") read as words. */\nexport function humanizeRatioWord(value: string): string {\n return humanizeIdentifier(value) || value;\n}\n\nexport interface RatioGroups {\n /** Non-ratio words first (Auto, Match input image). */\n words: string[];\n common: string[];\n more: string[];\n}\n\n/** Split options into words, common ratios (fixed order) and the rest (by shape). */\nexport function groupRatioOptions(options: readonly string[]): RatioGroups {\n const words: string[] = [];\n const ratioOpts: string[] = [];\n for (const o of options) (parseRatio(o) ? ratioOpts : words).push(o);\n\n const byReduced = new Map<string, string>();\n for (const o of ratioOpts) {\n const key = reduced(parseRatio(o)!);\n if (!byReduced.has(key)) byReduced.set(key, o);\n }\n const common: string[] = [];\n for (const c of COMMON_ORDER) {\n const hit = byReduced.get(reduced(parseRatio(c)!));\n if (hit) common.push(hit);\n }\n const commonSet = new Set(common);\n const more = ratioOpts\n .filter((o) => !commonSet.has(o))\n .sort((a, b) => {\n const ra = parseRatio(a)!;\n const rb = parseRatio(b)!;\n return rb.w / rb.h - ra.w / ra.h;\n });\n // A short list has no \"More\": everything is common.\n if (ratioOpts.length <= 6) {\n return { words, common: [...common, ...more], more: [] };\n }\n return { words, common, more };\n}\n","\"use client\";\n\n/**\n * AspectRatioSelect — the aspect-ratio picker every surface uses.\n *\n * A compact select where each ratio carries a small shape preview and a plain\n * name (Square, Widescreen, Story…); common ratios first, the rest behind\n * \"More ratios\"; words such as \"auto\" read as words. Champion: the ratio menus\n * in Midjourney's web app and Figma's frame presets — a shape you can see beats\n * a number you must picture.\n */\n\nimport { OptionCombobox } from \"./option-combobox\";\nimport { cn } from \"../cn\";\nimport {\n groupRatioOptions,\n humanizeRatioWord,\n parseRatio,\n ratioShapeName,\n} from \"./aspect-ratio-options\";\n\n/** A ratio drawn as a rectangle inside a 14px box. */\nexport function AspectRatioGlyph({\n value,\n className,\n}: {\n value: string;\n className?: string;\n}) {\n const r = parseRatio(value);\n const box = 14;\n if (!r) {\n return (\n <span\n aria-hidden\n className={cn(\n \"inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center\",\n className,\n )}\n >\n <span className=\"h-2.5 w-2.5 rounded-[2px] border border-dashed border-current opacity-60\" />\n </span>\n );\n }\n const k = r.w / r.h;\n const w = k >= 1 ? box : Math.max(3, box * k);\n const h = k >= 1 ? Math.max(3, box / k) : box;\n return (\n <span\n aria-hidden\n className={cn(\n \"inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center\",\n className,\n )}\n >\n <span\n className=\"rounded-[2px] border-[1.5px] border-current opacity-80\"\n style={{ width: w, height: h }}\n />\n </span>\n );\n}\n\nexport interface AspectRatioSelectProps {\n value: string;\n onChange: (value: string) => void;\n options: readonly string[];\n variant?: \"field\" | \"inline\";\n compact?: boolean;\n disabled?: boolean;\n id?: string;\n ariaLabel?: string;\n placeholder?: string;\n}\n\nexport function AspectRatioSelect({\n value,\n onChange,\n options,\n variant = \"field\",\n compact,\n disabled,\n id,\n ariaLabel = \"Aspect ratio\",\n placeholder = \"Choose a ratio\",\n}: AspectRatioSelectProps) {\n const { words, common, more } = groupRatioOptions(options);\n const groups = [\n ...(words.length ? [{ options: words }] : []),\n { options: common },\n ...(more.length\n ? [{ heading: \"More ratios\", options: more, collapsed: true }]\n : []),\n ];\n return (\n <OptionCombobox\n value={value}\n onChange={onChange}\n groups={groups}\n getLabel={(o) => (parseRatio(o) ? o : humanizeRatioWord(o))}\n getHint={(o) => ratioShapeName(o)}\n renderIcon={(o) => (\n <AspectRatioGlyph value={o} className=\"text-muted-foreground\" />\n )}\n searchable={options.length > 12}\n searchPlaceholder=\"Search ratios…\"\n placeholder={placeholder}\n variant={variant}\n compact={compact}\n disabled={disabled}\n id={id}\n ariaLabel={ariaLabel}\n />\n );\n}\n","\"use client\";\n\n// Moved from matrx-frontend components/official/ConfigurationFields (chat host slots, 2026-10-08).\n\nimport { useEffect, useId, useRef, useState, type ReactNode } from \"react\";\nimport {\n AlertTriangleIcon as TriangleAlert,\n CircleCheckIcon as CircleCheck,\n CircleHelpIcon as CircleHelp,\n CircleXIcon as CircleX,\n XIcon as X,\n InfoIcon,\n ChevronDownIcon as ChevronDown,\n ChevronRightIcon as ChevronRight,\n} from \"../icons\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"../popover\";\nimport { cn } from \"../cn\";\nimport {\n Table,\n TableHeader,\n TableBody,\n TableHead,\n TableRow,\n TableCell,\n} from \"../table\";\n\nimport { Button } from \"./controls\";\nimport { valueSummary } from \"./value-summary\";\n/** Source-selector dimensions shared by configuration choices and pickers. */\nexport const CONFIGURATION_CHOICE_SIZE =\n \"h-[34px] min-h-[34px] rounded-lg px-2.5 text-[11.5px] font-medium\";\n\nconst FIELD_HELP_OPEN = \"matrx:field-help-open\";\n\n/** Field-attached help, reachable by pointer, keyboard and touch. */\nexport function FieldHelp({\n label,\n children,\n triggerIcon,\n triggerLabel,\n unavailable = false,\n}: {\n label: string;\n children: ReactNode;\n triggerIcon?: ReactNode;\n triggerLabel?: string;\n unavailable?: boolean;\n}) {\n const [open, setOpen] = useState(false);\n const id = useId();\n const dismissed = useRef(false);\n const trigger = useRef<HTMLButtonElement>(null);\n const content = useRef<HTMLDivElement>(null);\n const closeTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const hovered = useRef(false);\n const keyboardFocus = useRef(false);\n const pointerFocus = useRef(false);\n const cancelClose = () => {\n if (closeTimer.current) clearTimeout(closeTimer.current);\n closeTimer.current = null;\n };\n const changeOpen = (next: boolean) => {\n cancelClose();\n dismissed.current = !next;\n // A close notification coordinates independent local popovers without a\n // second store of their open state. Opening one dismisses its siblings.\n if (next)\n document.dispatchEvent(new CustomEvent(FIELD_HELP_OPEN, { detail: id }));\n setOpen(next);\n };\n const scheduleClose = () => {\n cancelClose();\n closeTimer.current = setTimeout(() => {\n if (!hovered.current && !keyboardFocus.current) changeOpen(false);\n }, 200);\n };\n const leaveFocus = (next: EventTarget | null) => {\n if (\n next instanceof Node &&\n (trigger.current?.contains(next) || content.current?.contains(next))\n )\n return;\n keyboardFocus.current = false;\n pointerFocus.current = false;\n dismissed.current = false;\n scheduleClose();\n };\n useEffect(() => {\n const closeSibling = (event: Event) => {\n if ((event as CustomEvent<string>).detail === id) return;\n if (closeTimer.current) clearTimeout(closeTimer.current);\n dismissed.current = true;\n setOpen(false);\n };\n document.addEventListener(FIELD_HELP_OPEN, closeSibling);\n return () => {\n document.removeEventListener(FIELD_HELP_OPEN, closeSibling);\n if (closeTimer.current) clearTimeout(closeTimer.current);\n };\n }, [id]);\n return (\n <Popover open={open} onOpenChange={changeOpen}>\n <PopoverTrigger asChild>\n <button\n ref={trigger}\n type=\"button\"\n aria-label={triggerLabel ?? `Help: ${label}`}\n aria-disabled={unavailable || undefined}\n className=\"inline-flex size-7 shrink-0 items-center justify-center rounded-md text-foreground hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n onPointerEnter={(event) => {\n if (event.pointerType === \"mouse\") {\n hovered.current = true;\n changeOpen(true);\n }\n }}\n onPointerLeave={() => {\n hovered.current = false;\n scheduleClose();\n }}\n onPointerDown={() => {\n pointerFocus.current = true;\n keyboardFocus.current = false;\n }}\n onKeyDownCapture={(event) => {\n if (event.key === \"Tab\") pointerFocus.current = false;\n }}\n onFocus={() => {\n if (!dismissed.current) {\n keyboardFocus.current = !pointerFocus.current;\n changeOpen(true);\n }\n }}\n onBlur={(event) => leaveFocus(event.relatedTarget)}\n onClick={(event) => {\n event.preventDefault();\n changeOpen(true);\n }}\n >\n {triggerIcon ?? (\n <CircleHelp className=\"size-3.5\" aria-hidden=\"true\" />\n )}\n </button>\n </PopoverTrigger>\n <PopoverContent\n ref={content}\n align=\"start\"\n onPointerEnter={() => {\n hovered.current = true;\n cancelClose();\n }}\n onPointerLeave={() => {\n hovered.current = false;\n scheduleClose();\n }}\n onPointerDownCapture={() => {\n pointerFocus.current = true;\n }}\n onKeyDownCapture={(event) => {\n if (event.key === \"Tab\") pointerFocus.current = false;\n }}\n onFocusCapture={() => {\n keyboardFocus.current = !pointerFocus.current;\n cancelClose();\n }}\n onBlurCapture={(event) => leaveFocus(event.relatedTarget)}\n onCloseAutoFocus={(event) => event.preventDefault()}\n onEscapeKeyDown={() => {\n changeOpen(false);\n trigger.current?.focus({ preventScroll: true });\n }}\n className={cn(\n \"matrx-config-help\",\n \"w-80 max-w-[calc(100vw-2rem)] space-y-2 type-body\",\n )}\n onOpenAutoFocus={(event) => event.preventDefault()}\n >\n <div className=\"flex items-center justify-between gap-3\">\n <span className=\"font-medium\">{label}</span>\n <Button variant=\"quiet\" icon={<X />} aria-label={`Close help: ${label}`} onClick={() => changeOpen(false)} className=\"shrink-0\" />\n </div>\n <div className=\"whitespace-pre-wrap break-words text-foreground\">\n {children}\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n\nconst STATUS = {\n neutral: {\n label: \"Not evaluated\",\n Icon: null,\n color: \"text-foreground\",\n },\n ok: { label: \"Passed\", Icon: CircleCheck, color: \"text-success\" },\n caution: { label: \"Attention\", Icon: TriangleAlert, color: \"text-warning\" },\n error: { label: \"Failed\", Icon: CircleX, color: \"text-destructive\" },\n unknown: {\n label: \"Unknown\",\n Icon: CircleHelp,\n color: \"text-foreground\",\n },\n} as const;\n\n/** Status always has text. Only meaningful severity icons accompany it. */\nexport function StatusToken({\n status,\n label,\n}: {\n status: keyof typeof STATUS;\n label?: string;\n}) {\n const { Icon, color, label: defaultLabel } = STATUS[status];\n return (\n <span\n className={cn(\n \"matrx-config-status\",\n \"inline-flex max-w-full items-center gap-1.5 type-secondary\",\n color,\n )}\n >\n {Icon ? <Icon className=\"size-3.5 shrink-0\" aria-hidden=\"true\" /> : null}\n <span className=\"break-words\">{label ?? defaultLabel}</span>\n </span>\n );\n}\n\nexport interface PropertyRowProps {\n /** The label — gray, medium weight, 11px (one step below the value). */\n label: string;\n /** The value — full black, regular weight, 14px, no box. Empty (`null`/`undefined`/`\"\"`) shows the missing tag. */\n value?: ReactNode;\n /** Alias for `value` when the value is markup. */\n children?: ReactNode;\n /** Help text — never between label and value: a string is a tooltip on a small info icon by the label; markup opens a help popover. */\n help?: ReactNode;\n /** Right-edge meta, always gray: field code name, size, copy button. */\n meta?: ReactNode;\n /** Missing value: `true` → \"Not provided\" tag; a string names the tag (\"Not set\", \"Unknown\"). Never gray italics. */\n missing?: boolean | string;\n /** Monospace — ONLY for code / raw data (ids, paths, hashes), never for names or plain strings. */\n mono?: boolean;\n /** Collected data (array / object): closed, the row shows its one-line summary (\"17 items · BBB, Facebook…\"). */\n data?: unknown;\n /** Full content shown when the row is expanded; its presence draws the expand arrow in the left margin column. */\n expanded?: ReactNode;\n defaultOpen?: boolean;\n /** Reserve the arrow's margin column with no arrow, so non-expandable rows line up with expandable siblings. */\n gutter?: boolean;\n /** `stacked` (default): label over value on ONE left edge. `inline`: fixed label column beside the value (the default when `source`/`state` is set). */\n layout?: \"stacked\" | \"inline\";\n /** Inline layout only — value attribution. */\n source?: ReactNode;\n /** Inline layout only — value state. */\n state?: ReactNode;\n className?: string;\n \"data-testid\"?: string;\n}\n\n/** The missing-value status tag: small, outlined, never gray italics. */\nexport function MissingTag({ children = \"Not provided\" }: { children?: ReactNode }) {\n return (\n <span\n data-matrx-missing=\"\"\n className=\"inline-flex items-center rounded border border-border px-1.5 type-meta font-medium text-muted-foreground\"\n >\n {children}\n </span>\n );\n}\n\nfunction RowHelp({ label, help }: { label: string; help: ReactNode }) {\n if (typeof help === \"string\" || typeof help === \"number\") {\n return (\n <span\n title={String(help)}\n aria-label={String(help)}\n data-matrx-row-help=\"\"\n className=\"inline-flex shrink-0 cursor-help text-muted-foreground hover:text-foreground\"\n >\n <InfoIcon className=\"size-3\" aria-hidden=\"true\" />\n </span>\n );\n }\n return (\n <FieldHelp label={label} triggerIcon={<InfoIcon className=\"size-3\" aria-hidden=\"true\" />}>\n {help}\n </FieldHelp>\n );\n}\n\nfunction isBlank(v: ReactNode): boolean {\n return v === null || v === undefined || v === false || v === \"\";\n}\n\n/**\n * THE label-with-its-value row (Arman-approved rules, 2026-10-13; the Apple settings / Stripe / Linear pattern):\n * 1. label gray (muted) + medium, 11px; help is a tooltip on an info icon by the label, never between label and value;\n * 2. value full black, regular, 14px (`type-value`), no fill or box;\n * 3. monospace only for code / raw data (`mono`);\n * 4. label and value share ONE left edge; the expand arrow lives in its own margin column;\n * 5. missing value = a small \"Not provided\" tag;\n * 6. collected data closed = a one-line summary (`data`), never raw JSON cut mid-word;\n * 7. right-edge meta stays gray.\n */\nexport function PropertyRow({\n label,\n value,\n children,\n help,\n meta,\n missing,\n mono = false,\n data,\n expanded,\n defaultOpen = false,\n gutter = false,\n layout: layoutProp,\n source,\n state,\n className,\n \"data-testid\": testId,\n}: PropertyRowProps) {\n const [open, setOpen] = useState(defaultOpen);\n // A caller that attributes its value (source/state) keeps the inline sheet it was written for.\n const layout = layoutProp ?? (source != null || state != null ? \"inline\" : \"stacked\");\n const content: ReactNode =\n value !== undefined ? value : children !== undefined ? children : data !== undefined && data !== null ? valueSummary(data) : undefined;\n const isMissing = missing ? true : isBlank(content) && (data === undefined || data === null);\n const missingText = typeof missing === \"string\" ? missing : \"Not provided\";\n const expandable = expanded != null && !isMissing;\n const valueClass = cn(\"min-w-0 type-value leading-5 [overflow-wrap:anywhere]\", mono && \"font-mono\");\n const focusRing = \"rounded-sm outline-none focus-visible:ring-2 focus-visible:ring-ring\";\n\n if (layout === \"inline\") {\n return (\n <div\n data-matrx-property-row=\"inline\"\n data-testid={testId}\n className={cn(\n \"flex min-w-0 flex-col gap-1 border-b border-border/60 py-2 last:border-b-0 sm:flex-row sm:items-center sm:gap-4\",\n className,\n )}\n >\n <div className=\"flex min-w-0 shrink-0 items-center gap-1.5 type-label leading-4 sm:w-44\">\n <span className=\"break-words\">{label}</span>\n {help != null ? <RowHelp label={label} help={help} /> : null}\n </div>\n <div className=\"flex min-w-0 flex-1 flex-wrap items-center gap-x-6 gap-y-1\">\n <div className={cn(\"flex-1\", valueClass)}>{isMissing ? <MissingTag>{missingText}</MissingTag> : content}</div>\n {source != null || state != null ? (\n <div className=\"flex flex-wrap items-center gap-x-4 gap-y-1 type-secondary text-foreground\">\n {source != null ? (\n <span>\n <span className=\"font-medium\">Source:</span> {source}\n </span>\n ) : null}\n {state != null ? (\n <span>\n <span className=\"font-medium\">State:</span> {state}\n </span>\n ) : null}\n </div>\n ) : null}\n {meta != null ? (\n <div className=\"flex shrink-0 items-center gap-1.5 type-meta text-muted-foreground\">{meta}</div>\n ) : null}\n </div>\n </div>\n );\n }\n\n const margin = expandable || gutter;\n return (\n <div\n data-matrx-property-row=\"stacked\"\n data-testid={testId}\n className={cn(\n \"grid gap-x-1 border-b border-border/60 py-2 last:border-b-0\",\n margin ? \"grid-cols-[1rem_minmax(0,1fr)]\" : \"grid-cols-[minmax(0,1fr)]\",\n className,\n )}\n >\n {margin ? (\n <div className=\"flex h-4 items-center\">\n {expandable ? (\n <button\n type=\"button\"\n onClick={() => setOpen((o) => !o)}\n aria-expanded={open}\n aria-label={open ? `Collapse ${label}` : `Expand ${label}`}\n className={cn(\"inline-flex text-muted-foreground hover:text-foreground\", focusRing)}\n >\n {open ? <ChevronDown className=\"size-3.5\" aria-hidden=\"true\" /> : <ChevronRight className=\"size-3.5\" aria-hidden=\"true\" />}\n </button>\n ) : null}\n </div>\n ) : null}\n <div className=\"flex h-4 min-w-0 items-center gap-1.5\">\n <span className=\"truncate type-label leading-4\">{label}</span>\n {help != null ? <RowHelp label={label} help={help} /> : null}\n {meta != null ? (\n <div className=\"ml-auto flex min-w-0 shrink-0 items-center gap-1.5 type-meta text-muted-foreground\">{meta}</div>\n ) : null}\n </div>\n <div\n className={cn(\n \"mt-0.5 min-w-0\",\n margin && \"col-start-2\",\n // A \"Not provided\" row is exactly as tall as a text row: the value line is a fixed 20px.\n isMissing ? \"flex h-5 items-center\" : expandable && open ? \"mt-1\" : \"flex min-h-5 items-center\",\n )}\n >\n {isMissing ? (\n <MissingTag>{missingText}</MissingTag>\n ) : expandable && open ? (\n expanded\n ) : expandable ? (\n <button\n type=\"button\"\n onClick={() => setOpen(true)}\n className={cn(\"block max-w-full truncate text-left\", valueClass, focusRing)}\n >\n {content}\n </button>\n ) : (\n <div className={valueClass}>{content}</div>\n )}\n </div>\n </div>\n );\n}\n\nexport interface ConfigurationColumn {\n key: string;\n label: string;\n help?: ReactNode;\n}\n\n/** Rich configuration values get a full-width reading surface below their label. */\nexport function ConfigurationValueList({\n label,\n entries,\n}: {\n label: string;\n entries: readonly { key: string; label: string; value: ReactNode }[];\n}) {\n return (\n <dl aria-label={label} className=\"min-w-0 divide-y divide-border rounded-lg border border-border bg-card type-body text-foreground\">\n {entries.map((entry) => (\n <div key={entry.key} className=\"min-w-0 p-3\">\n <dt className=\"mb-2 break-words font-semibold\">{entry.label}</dt>\n <dd className=\"min-w-0 [overflow-wrap:anywhere]\">{entry.value}</dd>\n </div>\n ))}\n </dl>\n );\n}\n\n/** Repeated configuration data: table on desktop, labeled records on phones. */\nexport function ConfigurationTable({\n label,\n columns,\n children,\n}: {\n label: string;\n columns: readonly ConfigurationColumn[];\n children: ReactNode;\n}) {\n return (\n <div className=\"min-w-0 rounded-lg border border-border bg-card\">\n <Table\n size=\"sm\"\n wrap={false}\n aria-label={label}\n className={cn(\"matrx-config-table\", \"type-body text-foreground\")}\n >\n <TableHeader className={\"matrx-config-head\"}>\n <TableRow className=\"bg-accent/40 hover:bg-accent/40\">\n {columns.map((column) => (\n <TableHead\n key={column.key}\n scope=\"col\"\n className=\"whitespace-normal align-middle font-semibold text-foreground\"\n >\n <span className={\"matrx-config-heading\"}>\n {column.label}\n {column.help ? (\n <FieldHelp label={column.label}>{column.help}</FieldHelp>\n ) : null}\n </span>\n </TableHead>\n ))}\n </TableRow>\n </TableHeader>\n <TableBody className={\"matrx-config-body\"}>{children}</TableBody>\n </Table>\n </div>\n );\n}\n\nexport function ConfigurationTableRow({\n columns,\n cells,\n}: {\n columns: readonly ConfigurationColumn[];\n cells: Record<string, ReactNode>;\n}) {\n return (\n <TableRow\n className={cn(\"matrx-config-row\", \"border-b border-border last:border-b-0\")}\n >\n {columns.map((column) => (\n <TableCell\n key={column.key}\n className={cn(\"matrx-config-cell\", \"min-w-0 whitespace-normal align-middle\")}\n >\n <span\n className={cn(\n \"matrx-config-mobile-label\",\n \"mb-1 items-center gap-1 font-semibold\",\n )}\n >\n {column.label}:\n {column.help ? (\n <FieldHelp label={column.label}>{column.help}</FieldHelp>\n ) : null}\n </span>\n <div className={\"matrx-config-cell-content\"}>\n {cells[column.key] ?? \"Not specified\"}\n </div>\n </TableCell>\n ))}\n </TableRow>\n );\n}\n","\"use client\";\n\n/**\n * Table — the semantic table shell. No data logic, no sorting, no virtualiser:\n * those belong to the host's data-table layer, which composes these elements.\n *\n * The two forks disagreed on exactly three things, all of them now props:\n *\n * 1. matrx-frontend wrapped `<table>` in `relative w-full overflow-auto` so a\n * wide table scrolls inside itself instead of pushing the page sideways;\n * dashboard emitted a bare `<table>`. The wrapper is the correct default —\n * a table that widens its page is a layout bug on every narrow viewport —\n * so it stays on, with `wrap={false}` for a host that already owns a\n * scroll container (double scrollers are their own defect).\n * 2. dashboard's header was `sticky top-0 z-10 bg-background`. That is a real\n * capability, not a style opinion, so it is `sticky` on `TableHeader` —\n * opt-in, because a sticky header inside an unbounded page sticks to\n * nothing and only costs a stacking context.\n * 3. Cell density: `p-2` vs `p-3`. Declared once on `<Table size>` and read\n * from context by every cell, so a table cannot mix densities.\n *\n * Color is tokens only.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nexport type TableSize = \"sm\" | \"md\";\n\nconst TABLE_SIZES: Record<TableSize, { head: string; cell: string }> = {\n sm: { head: \"px-2\", cell: \"p-2\" },\n md: { head: \"px-3\", cell: \"p-3\" },\n};\n\nconst TableSizeContext = React.createContext<TableSize>(\"md\");\n\n/** The density the nearest enclosing `<Table>` declared. `md` outside one. */\nexport function useTableSize(): TableSize {\n return React.useContext(TableSizeContext);\n}\n\nexport interface TableProps extends React.HTMLAttributes<HTMLTableElement> {\n /** Cell density for this table. Default `md` (`p-3`); `sm` is `p-2`. */\n size?: TableSize;\n /**\n * Wrap the table in its own horizontal scroll container. Default `true`.\n * Pass `false` only when an ancestor already scrolls this table.\n */\n wrap?: boolean;\n /** Classes for the scroll wrapper (ignored when `wrap` is false). */\n wrapperClassName?: string;\n}\n\nconst Table = React.forwardRef<HTMLTableElement, TableProps>(\n ({ className, size = \"md\", wrap = true, wrapperClassName, ...props }, ref) => {\n const table = (\n <table\n ref={ref}\n data-slot=\"table\"\n data-size={size}\n className={cn(\"w-full caption-bottom text-sm\", className)}\n {...props}\n />\n );\n\n return (\n <TableSizeContext.Provider value={size}>\n {wrap ? (\n <div\n data-slot=\"table-wrapper\"\n className={cn(\"relative w-full overflow-auto\", wrapperClassName)}\n >\n {table}\n </div>\n ) : (\n table\n )}\n </TableSizeContext.Provider>\n );\n },\n);\nTable.displayName = \"Table\";\n\nexport interface TableHeaderProps\n extends React.HTMLAttributes<HTMLTableSectionElement> {\n /**\n * Pin the header to the top of the nearest scroll container. Opt-in: it\n * needs a bounded scroll ancestor to stick to, and it opens a stacking\n * context whether or not it sticks.\n */\n sticky?: boolean;\n}\n\nconst TableHeader = React.forwardRef<\n HTMLTableSectionElement,\n TableHeaderProps\n>(({ className, sticky = false, ...props }, ref) => (\n <thead\n ref={ref}\n data-slot=\"table-header\"\n className={cn(\n \"[&_tr]:border-b\",\n sticky && \"sticky top-0 z-10 bg-background\",\n className,\n )}\n {...props}\n />\n));\nTableHeader.displayName = \"TableHeader\";\n\nconst TableBody = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tbody\n ref={ref}\n data-slot=\"table-body\"\n className={cn(\"[&_tr:last-child]:border-0\", className)}\n {...props}\n />\n));\nTableBody.displayName = \"TableBody\";\n\nconst TableFooter = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tfoot\n ref={ref}\n data-slot=\"table-footer\"\n className={cn(\n \"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0\",\n className,\n )}\n {...props}\n />\n));\nTableFooter.displayName = \"TableFooter\";\n\nconst TableRow = React.forwardRef<\n HTMLTableRowElement,\n React.HTMLAttributes<HTMLTableRowElement>\n>(({ className, ...props }, ref) => (\n <tr\n ref={ref}\n data-slot=\"table-row\"\n className={cn(\n \"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted\",\n className,\n )}\n {...props}\n />\n));\nTableRow.displayName = \"TableRow\";\n\nconst TableHead = React.forwardRef<\n HTMLTableCellElement,\n React.ThHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => {\n const size = useTableSize();\n return (\n <th\n ref={ref}\n data-slot=\"table-head\"\n className={cn(\n \"h-10 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n TABLE_SIZES[size].head,\n className,\n )}\n {...props}\n />\n );\n});\nTableHead.displayName = \"TableHead\";\n\nconst TableCell = React.forwardRef<\n HTMLTableCellElement,\n React.TdHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => {\n const size = useTableSize();\n return (\n <td\n ref={ref}\n data-slot=\"table-cell\"\n className={cn(\n \"align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n TABLE_SIZES[size].cell,\n className,\n )}\n {...props}\n />\n );\n});\nTableCell.displayName = \"TableCell\";\n\nconst TableCaption = React.forwardRef<\n HTMLTableCaptionElement,\n React.HTMLAttributes<HTMLTableCaptionElement>\n>(({ className, ...props }, ref) => (\n <caption\n ref={ref}\n data-slot=\"table-caption\"\n className={cn(\"mt-4 text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nTableCaption.displayName = \"TableCaption\";\n\nexport {\n Table,\n TableBody,\n TableCaption,\n TableCell,\n TableFooter,\n TableHead,\n TableHeader,\n TableRow,\n};\n","/**\n * THE one-line summary of collected data (arrays / objects) for a closed `PropertyRow`:\n * \"17 items · BBB, Facebook, LinkedIn…\" — never raw JSON cut off mid-word.\n * Moved from matrx-frontend features/provision-window/data.ts (2026-10-13).\n */\n\nconst NAME_KEYS = [\"label\", \"name\", \"title\", \"platform\", \"field\", \"url\"] as const;\n\nfunction isEmpty(v: unknown): boolean {\n return v === null || v === undefined || v === \"\" || (Array.isArray(v) && v.length === 0);\n}\n\nexport function valueSummary(value: unknown): string {\n if (value === null || value === undefined) return \"\";\n if (typeof value !== \"object\") return String(value);\n if (Array.isArray(value)) {\n const names: string[] = [];\n for (const item of value) {\n if (item && typeof item === \"object\" && !Array.isArray(item)) {\n const rec = item as Record<string, unknown>;\n const key = NAME_KEYS.find((k) => typeof rec[k] === \"string\");\n const name = key ? String(rec[key]).trim() : \"\";\n if (name && !names.includes(name)) names.push(name);\n } else if ((typeof item === \"string\" || typeof item === \"number\") && !names.includes(String(item))) {\n names.push(String(item));\n }\n if (names.length >= 4) break;\n }\n const head = `${value.length} ${value.length === 1 ? \"item\" : \"items\"}`;\n if (names.length === 0) return head;\n return `${head} · ${names.slice(0, 3).join(\", \")}${names.length > 3 ? \"…\" : \"\"}`;\n }\n const entries = Object.entries(value as Record<string, unknown>);\n if (entries.length === 0) return \"Empty\";\n const filled = entries.filter(([, v]) => !isEmpty(v));\n if (filled.length === 0) return `${entries.map(([k]) => k).join(\", \")} — all empty`;\n const shown = filled\n .slice(0, 3)\n .map(([k, v]) => `${k}: ${typeof v === \"object\" ? (Array.isArray(v) ? `${v.length} items` : \"…\") : String(v)}`)\n .join(\" · \");\n return filled.length > 3 ? `${shown} · +${filled.length - 3} more` : shown;\n}\n\n/** True for values a `PropertyRow` should summarize instead of print (arrays and plain objects). */\nexport function isCollectedValue(value: unknown): boolean {\n return value !== null && typeof value === \"object\" && !isReactElementLike(value);\n}\n\nfunction isReactElementLike(value: object): boolean {\n return \"$$typeof\" in value;\n}\n","\"use client\";\n\n/**\n * IndicatorStrip — a fixed row of small yes/no icons for a table cell\n * (owner, 2026-10-08: \"create an icon for each option and have it gray if it's\n * not true and color if it is. Show them all at all times so the UI doesn't\n * shift their position in any rows. Add a tooltip that says what they are.\n * Small icons with a small amount of separation.\").\n *\n * The contract, pinned by `indicator-strip.test.tsx`:\n * - EVERY item renders in every row, in the order given — off is a muted\n * glyph, never a gap — so a column of strips lines up icon over icon;\n * - 14px glyphs, 4px apart, one line, never wraps, never shrinks;\n * - an on item takes its tone from semantic tokens (`danger` → destructive,\n * `warning`, `info`, `success`); `soft` is the same tone at reduced ink, for a\n * hint rather than a verdict;\n * - every icon names itself: `aria-label` and `title` (\"Premium model: yes —\n * Uses gpt-5\"), and every `title` is the fleet tooltip (title-tooltips.ts).\n *\n * The caller passes the glyph (any lucide-style component) so the package\n * stays icon-library free and a board keeps its domain icons.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nexport type IndicatorTone = \"danger\" | \"warning\" | \"info\" | \"success\" | \"neutral\";\n\nexport interface IndicatorItem {\n /** Stable key, also `data-indicator`. */\n id: string;\n /** The glyph: any component that takes `className` (lucide icons do). */\n icon: React.ComponentType<{ className?: string; \"aria-hidden\"?: boolean | \"true\" | \"false\" }>;\n /** What the icon means, as a short name (\"Premium model\"). */\n label: string;\n /** True draws the tone; false draws the muted glyph. */\n on: boolean;\n /** Ink when on. Default `warning`. */\n tone?: IndicatorTone;\n /** The tone at reduced ink: a hint, not a verdict. */\n soft?: boolean;\n /** Shown after the label when on (≤ ~100 chars: the tooltip budget is 140). */\n detail?: string;\n}\n\nexport interface IndicatorStripProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, \"children\"> {\n items: readonly IndicatorItem[];\n}\n\nconst TONE: Record<IndicatorTone, string> = {\n danger: \"text-destructive\",\n warning: \"text-warning\",\n info: \"text-info\",\n success: \"text-success\",\n neutral: \"text-foreground\",\n};\n\nexport function indicatorText(item: IndicatorItem): string {\n if (!item.on) return `${item.label}: no`;\n return item.detail ? `${item.label}: yes — ${item.detail}` : `${item.label}: yes`;\n}\n\nexport function IndicatorStrip({ items, className, ...props }: IndicatorStripProps) {\n return (\n <span\n data-slot=\"indicator-strip\"\n role=\"list\"\n className={cn(\"inline-flex shrink-0 flex-nowrap items-center gap-1 whitespace-nowrap align-middle\", className)}\n {...props}\n >\n {items.map((item) => {\n const Icon = item.icon;\n const text = indicatorText(item);\n return (\n <span\n key={item.id}\n role=\"listitem\"\n aria-label={text}\n title={text}\n data-indicator={item.id}\n data-on={item.on ? \"true\" : \"false\"}\n className={cn(\n \"inline-flex size-3.5 shrink-0 items-center justify-center\",\n item.on ? TONE[item.tone ?? \"warning\"] : \"text-muted-foreground opacity-30\",\n item.on && item.soft && \"opacity-55\",\n )}\n >\n <Icon className=\"size-3.5\" aria-hidden />\n </span>\n );\n })}\n </span>\n );\n}\n","// MiddleTruncate (moved from matrx-frontend components/official, 2026-10-22)\n//\n// ONE-LINE TEXT THAT KEEPS BOTH ENDS. CSS ellipsis eats the END of a name, so\n// four scopes named \"LCP Test Repositories lcp-2026-…\" all read the same (the\n// phone Context sheet, page-pass /notes 2026-09-28). This keeps the tail — the\n// part that tells siblings apart — and lets only the middle give way:\n// \"LCP Test Rep…lcp-0917-b\". Pure CSS at render (no measuring, no layout\n// shift): the head truncates, the tail never shrinks. A name that fits shows\n// whole. The full text is the title and, once, the screen-reader text.\n\nimport * as React from \"react\";\nimport { cn } from \"../cn\";\n\n/** Characters kept at the end (at most half the text). */\nconst DEFAULT_TAIL = 10;\n\nexport function splitForMiddleTruncate(text: string, tail = DEFAULT_TAIL): { head: string; end: string } {\n const keep = Math.min(tail, Math.floor(text.length / 2));\n if (keep <= 0) return { head: text, end: \"\" };\n return { head: text.slice(0, text.length - keep), end: text.slice(text.length - keep) };\n}\n\nexport function MiddleTruncate({\n text,\n tail = DEFAULT_TAIL,\n className,\n}: {\n text: string;\n /** Characters kept at the end. Default 10. */\n tail?: number;\n className?: string;\n}): React.ReactElement {\n const { head, end } = splitForMiddleTruncate(text, tail);\n return (\n <span className={cn(\"flex min-w-0 items-baseline\", className)} title={text}>\n <span className=\"sr-only\">{text}</span>\n <span aria-hidden className=\"min-w-0 truncate whitespace-pre\">\n {head}\n </span>\n {end ? (\n <span aria-hidden className=\"shrink-0 whitespace-pre\">\n {end}\n </span>\n ) : null}\n </span>\n );\n}\n","/**\n * CalloutBanner — a compact, dismissible inline callout in a semantic tone.\n * Reusable across the app (first consumer: the agents-page drift banner). No\n * such primitive existed; this is the canonical one — extend it, don't fork.\n */\n\n\"use client\";\n\nimport type * as React from \"react\";\nimport { XIcon } from \"../icons\";\nimport { cn } from \"../cn\";\n\nimport { Button } from \"./controls\";\nexport type CalloutTone = \"destructive\" | \"warning\" | \"info\" | \"success\";\n\nconst TONE: Record<CalloutTone, { container: string; icon: string }> = {\n destructive: { container: \"border-destructive/30 bg-destructive/10\", icon: \"text-destructive\" },\n warning: { container: \"border-warning/30 bg-warning/10\", icon: \"text-warning\" },\n info: { container: \"border-primary/30 bg-primary/10\", icon: \"text-primary\" },\n success: { container: \"border-success/30 bg-success/10\", icon: \"text-success\" },\n};\n\ninterface CalloutBannerProps {\n tone: CalloutTone;\n icon?: React.ComponentType<{ className?: string; \"aria-hidden\"?: boolean }>;\n title: React.ReactNode;\n description?: React.ReactNode;\n /** Action buttons / chips rendered on the trailing edge. */\n actions?: React.ReactNode;\n onDismiss?: () => void;\n dismissing?: boolean;\n className?: string;\n}\n\nexport function CalloutBanner({\n tone,\n icon: Icon,\n title,\n description,\n actions,\n onDismiss,\n dismissing,\n className,\n}: CalloutBannerProps) {\n const t = TONE[tone];\n return (\n <div\n className={cn(\n \"flex flex-col gap-2 rounded-lg border px-3 py-2.5 sm:flex-row sm:items-center\",\n t.container,\n className,\n )}\n role=\"status\"\n >\n <div className=\"flex min-w-0 flex-1 items-start gap-2\">\n {Icon && <Icon className={cn(\"mt-0.5 h-4 w-4 shrink-0\", t.icon)} aria-hidden />}\n <div className=\"min-w-0\">\n <p className=\"type-title text-foreground\">{title}</p>\n {description && (\n <p className=\"mt-0.5 type-secondary text-muted-foreground\">{description}</p>\n )}\n </div>\n </div>\n <div className=\"flex shrink-0 items-center gap-1.5 sm:ml-2\">\n {actions}\n {onDismiss && (\n <Button variant=\"quiet\" icon={<XIcon />} aria-label=\"Dismiss\" onClick={onDismiss} disabled={dismissing} />\n )}\n </div>\n </div>\n );\n}\n","/**\n * GatedActionButton — a primary action that is never dead.\n *\n * ## The wall this closes (2026-09-15, `teach-recent-practitioner` W2)\n *\n * A non-technical Expert reached the payoff moment of the whole product — the\n * \"Build the Masterwork\" button — and it was **silently disabled**. No red\n * text, no tooltip, no validation message, no console error. Clicking it did\n * nothing, twice, by ref and by coordinate. The reason was one empty required\n * field whose placeholder read like a real value, so the screen told the user\n * everything was filled in and then refused to move.\n *\n * That is a LAW 4 violation — *nothing fails silently; a screen is absent or\n * honest, never dead, disabled-looking, or wearing a false state.* A disabled\n * button that says nothing is a screen telling a lie.\n *\n * ## The contract\n *\n * A gated action takes a `reason`, not a boolean. When a reason is present the\n * button is disabled AND the reason is rendered beside it, in plain words a\n * non-technical person can act on (\"Name your Masterwork to build it\"), wired\n * to the button by `aria-describedby` so a screen reader gets it too. When\n * there is no reason, the button is a normal `<Button>` and renders no chrome.\n *\n * **`disabled` for a reason that is not a blocker is still allowed** — a\n * button already running its own action (`disabled={running}` with the label\n * \"Building…\") is honest about itself, so it needs no sentence. Use `reason`\n * for every state where the user must DO something first.\n *\n * ## Usage\n *\n * ```tsx\n * <GatedActionButton\n * reason={firstBlockingReason([\n * { when: !name.trim(), reason: \"Name your Masterwork to build it\" },\n * { when: approved === 0, reason: \"Approve at least one rule to build it\" },\n * ])}\n * disabled={running}\n * onClick={build}\n * >\n * Build the Masterwork\n * </GatedActionButton>\n * ```\n *\n * `firstBlockingReason` returns the FIRST unmet check, so order the list the\n * way you want the user to fix things: one sentence at a time, never a wall of\n * validation errors.\n *\n * @official-component\n */\n\n\"use client\";\n\nimport * as React from \"react\";\n\nimport { Button, type ButtonProps } from \"../button\";\nimport { cn } from \"../cn\";\n\n/** One reason an action cannot fire yet, and the condition that makes it true. */\nexport interface BlockingCheck {\n /** True when this check is currently blocking the action. */\n when: boolean;\n /**\n * What the user must do, in plain words, phrased as an instruction — not a\n * validation complaint. \"Name your Masterwork to build it\", never\n * \"name is required\".\n */\n reason: string;\n}\n\n/**\n * The first blocking reason in the list, or `null` when nothing blocks.\n *\n * Order the checks in the order you want the user to fix them. Returning ONE\n * reason is deliberate: a non-technical person acts on a single next step, not\n * on a list of everything wrong at once.\n */\nexport function firstBlockingReason(\n checks: ReadonlyArray<BlockingCheck | null | undefined | false>,\n): string | null {\n for (const check of checks) {\n if (check && check.when) return check.reason;\n }\n return null;\n}\n\nexport interface GatedActionButtonProps extends ButtonProps {\n /**\n * Why this action cannot fire yet. When set, the button is disabled and this\n * sentence is rendered next to it. `null`/`undefined` means nothing blocks.\n */\n reason?: string | null;\n /** Layout escape hatch for the wrapper that holds the reason and the button. */\n wrapperClassName?: string;\n /** Layout escape hatch for the reason text itself (e.g. `max-w-[16rem]`). */\n reasonClassName?: string;\n}\n\n/**\n * @see {@link GatedActionButtonProps} for the full prop contract.\n */\nexport function GatedActionButton({\n reason,\n wrapperClassName,\n reasonClassName,\n disabled,\n title,\n children,\n ...buttonProps\n}: GatedActionButtonProps) {\n const reactId = React.useId();\n const blocked = Boolean(reason && reason.trim());\n const reasonId = `gated-action-reason-${reactId}`;\n\n return (\n <span\n className={cn(\n \"inline-flex min-w-0 flex-wrap items-center justify-end gap-2\",\n wrapperClassName,\n )}\n >\n {blocked ? (\n <span\n id={reasonId}\n role=\"status\"\n data-slot=\"gated-action-reason\"\n // NOT `text-destructive`. This sentence is an instruction for\n // something the user has not done YET — on a form's first paint it\n // is the normal state, not a failure. Red said \"you did something\n // wrong\" to a first-timer who had not yet typed a character\n // (jobs-bar-2026-09-16, item 6). The contract above is explicit:\n // \"phrased as an instruction — not a validation complaint.\"\n className={cn(\n \"min-w-0 type-secondary font-medium text-muted-foreground\",\n reasonClassName,\n )}\n >\n {reason}\n </span>\n ) : null}\n <Button\n {...buttonProps}\n disabled={disabled || blocked}\n title={blocked ? (reason ?? undefined) : title}\n aria-describedby={blocked ? reasonId : buttonProps[\"aria-describedby\"]}\n >\n {children}\n </Button>\n </span>\n );\n}\n\nGatedActionButton.displayName = \"GatedActionButton\";\n","\"use client\";\n\nimport React, { useEffect, useRef, useState } from \"react\";\nimport { Loader2Icon, SearchIcon, XIcon } from \"../icons\";\nimport { cn } from \"../cn\";\nimport { Input } from \"./doors\";\nimport { Button } from \"./controls\";\n\nexport interface SearchInputProps {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n onSearch?: (value: string) => void;\n placeholder?: string;\n loading?: boolean;\n debounceTime?: number;\n showClearButton?: boolean;\n showSubmitButton?: boolean;\n autoFocus?: boolean;\n disabled?: boolean;\n className?: string;\n inputClassName?: string;\n buttonClassName?: string;\n \"aria-label\"?: string;\n}\n\nexport function SearchInput({\n value,\n defaultValue = \"\",\n onValueChange,\n onSearch,\n placeholder = \"Search...\",\n loading = false,\n debounceTime = 300,\n showClearButton = true,\n showSubmitButton = false,\n autoFocus = false,\n disabled = false,\n className,\n inputClassName,\n buttonClassName,\n \"aria-label\": ariaLabel = \"Search\",\n}: SearchInputProps) {\n const [internalValue, setInternalValue] = useState(defaultValue);\n const inputRef = useRef<HTMLInputElement>(null);\n const isControlled = value !== undefined;\n const currentValue = isControlled ? value : internalValue;\n const searchValue = currentValue.trim();\n const didMountRef = useRef(false);\n const onSearchRef = useRef(onSearch);\n\n useEffect(() => {\n if (!autoFocus) return;\n inputRef.current?.focus();\n }, [autoFocus]);\n\n useEffect(() => {\n onSearchRef.current = onSearch;\n }, [onSearch]);\n\n useEffect(() => {\n if (!onSearchRef.current) return undefined;\n if (!didMountRef.current) {\n didMountRef.current = true;\n return undefined;\n }\n const timer = window.setTimeout(() => {\n onSearchRef.current?.(currentValue);\n }, debounceTime);\n return () => window.clearTimeout(timer);\n }, [currentValue, debounceTime]);\n\n const setNextValue = (nextValue: string) => {\n if (!isControlled) setInternalValue(nextValue);\n onValueChange?.(nextValue);\n };\n\n const handleSubmit = (event: React.FormEvent) => {\n event.preventDefault();\n onSearch?.(currentValue);\n };\n\n const handleClear = () => {\n setNextValue(\"\");\n onSearch?.(\"\");\n inputRef.current?.focus();\n };\n\n return (\n <form\n onSubmit={handleSubmit}\n className={cn(\"flex min-w-0 items-center gap-2\", className)}\n >\n <div className=\"relative min-w-0 flex-1\">\n <SearchIcon\n className=\"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground\"\n aria-hidden\n />\n <Input\n ref={inputRef}\n type=\"search\"\n value={currentValue}\n onChange={(event) => setNextValue(event.target.value)}\n placeholder={placeholder}\n disabled={disabled}\n aria-label={ariaLabel}\n className={inputClassName} adornment={showClearButton && searchValue ? \"both\" : \"start\"}\n />\n {showClearButton && searchValue ? (\n <button\n type=\"button\"\n onClick={handleClear}\n disabled={disabled}\n aria-label=\"Clear search\"\n className=\"absolute right-2 top-1/2 flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:pointer-events-none disabled:text-disabled-foreground\"\n >\n <XIcon className=\"h-3.5 w-3.5\" />\n </button>\n ) : null}\n </div>\n {showSubmitButton ? (\n <Button\n icon={loading ? (\n <Loader2Icon className=\"animate-spin\" />\n ) : (\n <SearchIcon />\n )}\n variant=\"primary\"\n type=\"submit\"\n disabled={disabled || loading}\n aria-label=\"Submit search\"\n className={buttonClassName}\n />\n ) : null}\n </form>\n );\n}\n\nexport default SearchInput;\n","/**\n * CollapsibleText — measured multiline text with a compact preview and fade.\n *\n * Use for user-authored text that can become long inside dense lists, timelines,\n * and cards. The caller owns expansion state so individual toggles and\n * expand-all/collapse-all controls stay in sync.\n *\n * @official-component\n */\n\n\"use client\";\n\nimport { useLayoutEffect, useRef, useState, type ReactNode } from \"react\";\nimport { ChevronDownIcon, ChevronUpIcon, ChevronsDownIcon, ChevronsUpIcon } from \"../icons\";\nimport { Button } from \"./controls\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"../tooltip\";\nimport { cn } from \"../cn\";\n\ninterface CollapsibleTextProps {\n children: ReactNode;\n expanded: boolean;\n onExpandedChange: (expanded: boolean) => void;\n collapsedLines?: number;\n className?: string;\n expandLabel?: string;\n collapseLabel?: string;\n /**\n * Show the label as visible text on the toggle (\"Show more\" / \"Show less\"),\n * as comment threads do (Linear, Notion). Default: icon-only, labeled for\n * assistive tech.\n */\n showLabel?: boolean;\n}\n\nexport function CollapsibleText({\n children,\n expanded,\n onExpandedChange,\n collapsedLines = 4,\n className,\n expandLabel = \"Expand text\",\n collapseLabel = \"Collapse text\",\n showLabel = false,\n}: CollapsibleTextProps) {\n const contentRef = useRef<HTMLDivElement>(null);\n const [collapsedHeight, setCollapsedHeight] = useState(0);\n const [isOverflowing, setIsOverflowing] = useState(false);\n\n useLayoutEffect(() => {\n const node = contentRef.current;\n if (!node) return undefined;\n\n const measure = () => {\n const styles = window.getComputedStyle(node);\n const parsedLineHeight = Number.parseFloat(styles.lineHeight);\n const parsedFontSize = Number.parseFloat(styles.fontSize);\n const lineHeight = Number.isFinite(parsedLineHeight)\n ? parsedLineHeight\n : parsedFontSize * 1.4;\n const nextCollapsedHeight = Math.ceil(lineHeight * collapsedLines);\n setCollapsedHeight(nextCollapsedHeight);\n setIsOverflowing(node.scrollHeight > nextCollapsedHeight + 1);\n };\n\n measure();\n if (typeof ResizeObserver === \"undefined\") return undefined;\n const observer = new ResizeObserver(measure);\n observer.observe(node);\n return () => observer.disconnect();\n }, [children, collapsedLines]);\n\n const isCollapsed = isOverflowing && !expanded;\n\n if (showLabel) {\n return (\n <div className=\"relative min-w-0\">\n <div\n ref={contentRef}\n className={cn(\n \"overflow-hidden whitespace-pre-wrap break-words\",\n isCollapsed &&\n \"[mask-image:linear-gradient(to_bottom,black_55%,transparent_100%)] [-webkit-mask-image:linear-gradient(to_bottom,black_55%,transparent_100%)]\",\n className,\n )}\n style={isCollapsed && collapsedHeight > 0 ? { maxHeight: `${collapsedHeight}px` } : undefined}\n >\n {children}\n </div>\n {isOverflowing ? (\n <button\n type=\"button\"\n aria-expanded={!isCollapsed}\n onClick={(event) => {\n event.stopPropagation();\n onExpandedChange(isCollapsed);\n }}\n className=\"mt-0.5 inline-flex min-h-6 items-center gap-0.5 rounded text-xs font-medium text-primary hover:underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring\"\n >\n {isCollapsed ? <ChevronDownIcon className=\"h-3.5 w-3.5\" aria-hidden /> : <ChevronUpIcon className=\"h-3.5 w-3.5\" aria-hidden />}\n {isCollapsed ? expandLabel : collapseLabel}\n </button>\n ) : null}\n </div>\n );\n }\n\n return (\n <div className=\"relative min-w-0\">\n <div\n ref={contentRef}\n className={cn(\n \"overflow-hidden whitespace-pre-wrap break-words transition-[max-height] duration-300 ease-out\",\n isCollapsed &&\n \"[mask-image:linear-gradient(to_bottom,black_55%,transparent_100%)] [-webkit-mask-image:linear-gradient(to_bottom,black_55%,transparent_100%)]\",\n className,\n )}\n style={\n isCollapsed && collapsedHeight > 0\n ? { maxHeight: `${collapsedHeight}px` }\n : undefined\n }\n >\n {children}\n </div>\n\n {isCollapsed ? (\n <div className=\"pointer-events-none absolute inset-x-0 bottom-0 flex justify-center\">\n <Button\n icon={<ChevronDownIcon />}\n type=\"button\"\n variant=\"outline\"\n aria-label={expandLabel}\n aria-expanded={false}\n onClick={(event) => {\n event.stopPropagation();\n onExpandedChange(true);\n }}\n className=\"pointer-events-auto\"\n />\n </div>\n ) : isOverflowing ? (\n <div className=\"flex justify-center pt-0.5\">\n <Button\n icon={<ChevronUpIcon />}\n type=\"button\"\n variant=\"quiet\"\n aria-label={collapseLabel}\n aria-expanded\n onClick={(event) => {\n event.stopPropagation();\n onExpandedChange(false);\n }}\n />\n </div>\n ) : null}\n </div>\n );\n}\n\ninterface CollapsibleTextGroupControlsProps {\n onExpandAll: () => void;\n onCollapseAll: () => void;\n allExpanded: boolean;\n anyExpanded: boolean;\n disabled?: boolean;\n}\n\nexport function CollapsibleTextGroupControls({\n onExpandAll,\n onCollapseAll,\n allExpanded,\n anyExpanded,\n disabled = false,\n}: CollapsibleTextGroupControlsProps) {\n return (\n <div className=\"flex items-center gap-0.5\">\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n icon={<ChevronsDownIcon className=\"!size-[18px] lg:!size-3.5\" />}\n type=\"button\"\n variant=\"quiet\"\n aria-label=\"Expand all\"\n onClick={onExpandAll}\n disabled={disabled || allExpanded}\n />\n </TooltipTrigger>\n <TooltipContent side=\"top\">Expand all</TooltipContent>\n </Tooltip>\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n icon={<ChevronsUpIcon className=\"!size-[18px] lg:!size-3.5\" />}\n type=\"button\"\n variant=\"quiet\"\n aria-label=\"Collapse all\"\n onClick={onCollapseAll}\n disabled={disabled || !anyExpanded}\n />\n </TooltipTrigger>\n <TooltipContent side=\"top\">Collapse all</TooltipContent>\n </Tooltip>\n </div>\n );\n}\n","\"use client\";\n\n/**\n * Tooltip — the ONE tooltip in the fleet.\n *\n * THE COLLAPSE (0.6.0). Two implementations existed: matrx-frontend's\n * `components/ui/tooltip.tsx` (182 import sites) and `@ai-matrx/tap-target`'s\n * `src/tooltip.tsx` — the latter an explicit inlined PORT of the former,\n * carrying a header that said so. tap-target shipped it only because its ~60\n * tap buttons need a tooltip and no shared package owned one; four repos then\n * adopted `TooltipProvider` from tap-target. That made tap-target — a\n * button-geometry package — the accidental owner of a design-system primitive,\n * with a second copy living in the biggest host.\n *\n * A tooltip is a design-system surface, so it lives here. tap-target now takes\n * `@ai-matrx/design-system` as an ordinary sibling dependency and imports this\n * file; its own copy is deleted, and its re-export removed. The DAG already\n * ordered design-system before tap-target, so no cycle is introduced.\n *\n * BEHAVIOR is matrx-frontend's, verbatim, including the ruling both copies\n * carried in prose:\n *\n * 1. THE ROOT RENDERS UNCONDITIONALLY — no hydration mount gate. The gate the\n * host wrapper once carried (\"Radix generates dynamic aria-controls ids that\n * differ between SSR and client\") was false: Radix ids come from React's\n * SSR-stable `useId`. It was actively harmful — a Trigger wraps\n * ALWAYS-VISIBLE content, so `return null` deleted that subtree from SSR and\n * the first client paint.\n *\n * 2. THE SURFACE IS TOKEN-DRIVEN, NOT BRANDED. Popover tokens, not\n * `bg-primary`: rich tooltip content using `text-muted-foreground` was\n * illegible on a brand-colored background in one theme or the other.\n * Since 2026-09-28 the `.matrx-tooltip` class re-scopes those tokens to a dark,\n * high-contrast chip in both themes (styles.css, THE TOOLTIP SURFACE): the\n * neutral white surface it wore before was indistinguishable from the\n * browser's own `title` box.\n *\n * 3. EVERY `title` IS THIS TOOLTIP. The provider installs the title takeover\n * (`title-tooltips.ts`), so a hand-written `title=` anywhere in the\n * document shows this surface, never the browser's.\n *\n * SEAM INVERSION. The host resolved nested portal targets through\n * `useNestedPortalContainer` (an app hook wired to its dialog + window-panel\n * systems); tap-target's port dropped that seam entirely and always portalled\n * to `document.body` — which is why a tooltip inside a popped-out panel landed\n * in the wrong window. Here it is the package's `PortalContainerProvider`\n * seam: an explicit `container` prop wins, then the injected container, then\n * `document.body`. Both prior behaviors are reachable; neither is forked.\n */\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { MOTION_POPPER } from \"./motion\";\nimport { usePortalContainer } from \"./portal-container\";\nimport { acquireTitleTooltips, clipTooltipText, tooltipSide, TOOLTIP_EDGE_PX, TOOLTIP_LAYER_Z, TOOLTIP_TRIGGER_ATTR, type Side } from \"./title-tooltips\";\n\nexport interface TooltipProviderProps\n extends React.ComponentProps<typeof TooltipPrimitive.Provider> {\n /**\n * THE TITLE TAKEOVER (2026-09-28) — while any provider is mounted, every native\n * `title` attribute in the document shows as this tooltip instead of the\n * browser's (see `title-tooltips.ts`). On by default, because a rule every\n * author must remember is a rule that is broken; pass `false` only for a\n * surface that must keep the browser's own box. One provider opting out does\n * not turn it off while another one is mounted.\n */\n titleTooltips?: boolean;\n}\n\n/**\n * Mount once near the app root. Every tooltip in the tree shares its\n * `delayDuration` / `skipDelayDuration` timing, and the root provider takes\n * over native `title` attributes (see `titleTooltips`). The fleet default keeps\n * tooltip content hoverable and selectable. A native mirrored Desktop shell may\n * explicitly opt in to `disableHoverableContent` so its overlay view yields the\n * pointer back to the host; ordinary application tooltips must leave it unset.\n */\nfunction TooltipProvider({ titleTooltips = true, disableHoverableContent = false, ...props }: TooltipProviderProps) {\n React.useEffect(() => {\n if (!titleTooltips) return;\n return acquireTitleTooltips();\n }, [titleTooltips]);\n return <TooltipPrimitive.Provider {...props} disableHoverableContent={disableHoverableContent} />;\n}\n\n/**\n * The tooltip root inherits its provider's hoverability policy: the ordinary\n * provider defaults to hoverable, selectable content (Arman, 2026-10-14), while\n * a native mirrored Desktop shell may opt in at its provider so the overlay view\n * yields pointer control to its host. An explicit root prop still wins.\n */\n/** The tooltip's trigger and whether it is open, so its content takes THE SMART SIDE\n * (title-tooltips.ts) from where the trigger stands at the moment it opens. */\ninterface TriggerState {\n ref: React.MutableRefObject<HTMLElement | null>;\n open: boolean;\n}\nconst TriggerContext = React.createContext<TriggerState | null>(null);\n\nconst Tooltip = ({ onOpenChange, ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>) => {\n const ref = React.useRef<HTMLElement | null>(null);\n const [open, setOpen] = React.useState(Boolean(props.open ?? props.defaultOpen));\n const shown = props.open ?? open;\n const value = React.useMemo(() => ({ ref, open: shown }), [shown]);\n return (\n <TriggerContext.Provider value={value}>\n <TooltipPrimitive.Root\n {...props}\n onOpenChange={(next) => {\n setOpen(next);\n onOpenChange?.(next);\n }}\n />\n </TriggerContext.Provider>\n );\n};\nTooltip.displayName = \"Tooltip\";\n\n/**\n * Stamps `data-matrx-tooltip-trigger` so the title takeover never draws a\n * second tooltip over a control that already has this one — it still lifts a\n * `title` on the same control, so the browser's box never doubles it either.\n */\nconst TooltipTrigger = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Trigger>\n>((props, ref) => {\n const trigger = React.useContext(TriggerContext);\n const setRef = React.useCallback(\n (node: HTMLButtonElement | null) => {\n if (trigger) trigger.ref.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n },\n [trigger, ref],\n );\n return <TooltipPrimitive.Trigger ref={setRef} {...{ [TOOLTIP_TRIGGER_ATTR]: \"\" }} {...props} />;\n});\nTooltipTrigger.displayName = TooltipPrimitive.Trigger.displayName;\n\nexport interface TooltipContentProps\n extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> {\n /**\n * Explicit portal target; wins over the injected `PortalContainerProvider`\n * value. Pass `null` to force `document.body`.\n */\n container?: HTMLElement | null;\n /**\n * Package-owned open/close motion. Default `true`. Pass `false` for a\n * surface that must appear instantly. It is NOT the reduced-motion switch;\n * `styles.css` already honors `prefers-reduced-motion`.\n */\n animated?: boolean;\n /**\n * The side when the control is not in a vertical stack and no side is given (the host's default:\n * a macOS desktop host says \"bottom\"). Omit for the document's `data-title-side`, else \"top\".\n */\n fallbackSide?: Side;\n}\n\nconst TooltipContent = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Content>,\n TooltipContentProps\n>(({ className, side, fallbackSide, sideOffset = 4, collisionPadding = TOOLTIP_EDGE_PX, container, animated = true, children, style, ...props }, ref) => {\n const resolved = usePortalContainer(container);\n const trigger = React.useContext(TriggerContext);\n // THE SMART SIDE: an explicit side wins; otherwise where the trigger's neighbours stand decides.\n const placed = side ?? (trigger?.open ? tooltipSide(trigger.ref.current, fallbackSide) : (fallbackSide ?? \"top\"));\n return (\n <TooltipPrimitive.Portal container={resolved ?? null}>\n <TooltipPrimitive.Content\n ref={ref}\n data-slot=\"tooltip-content\"\n side={placed}\n sideOffset={sideOffset}\n // Flip and stay inside the window: Radix flips to the opposite side when the preferred one\n // does not fit, and shifts along the edge; the padding keeps it off the window's border.\n avoidCollisions\n collisionPadding={collisionPadding}\n className={cn(\n \"matrx-tooltip max-w-xs select-text overflow-hidden whitespace-normal break-words rounded-md border border-border bg-popover px-2.5 py-1 text-xs font-medium text-popover-foreground\",\n animated && MOTION_POPPER,\n className,\n )}\n // THE tooltip layer: above every menu, popover and modal (Radix copies it onto its wrapper).\n style={{ zIndex: TOOLTIP_LAYER_Z, ...style }}\n {...props}\n >\n {typeof children === \"string\" ? clipTooltipText(children) : children}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n});\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nexport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };\nexport { acquireTitleTooltips, clipTooltipText, NATIVE_TITLE_OPT_OUT_ATTR, TOOLTIP_TEXT_BUDGET } from \"./title-tooltips\";\n","// InfoHint (moved from matrx-frontend components/official, 2026-10-22)\n//\n// THE DEFINITION HINT — a small info icon beside a label that reveals one\n// sentence defining it. Use it wherever a label needs a definition\n// (`common-docs/policies/interface-text-is-layout.md`: definitions live behind\n// an info icon, never in visible prose). Model: Stripe dashboard metric labels.\n//\n// Reachable three ways, which a native `title=` is not:\n// - mouse: hover opens the tooltip;\n// - keyboard: the icon is a real button, so Tab focus opens the tooltip and\n// Escape closes it;\n// - touch (`pointer: coarse` or a phone-width viewport): tap toggles a small\n// popover; outside tap or Escape closes it.\n//\n// Safe inside a link or clickable row (KpiTile with `href`): the trigger and\n// the portaled content both stop propagation and prevent the default, so\n// opening a definition never navigates.\n//\n// The icon's hit area is ≥ 24px (44px on a coarse pointer) via an absolutely positioned pseudo-element,\n// so the glyph sits inline without changing the surrounding line height.\n// Text budget: one sentence, ≤ 140 characters.\n\n\"use client\";\n\nimport { InfoIcon } from \"../icons\";\nimport { useState, useSyncExternalStore, type SyntheticEvent } from \"react\";\n\nimport { Popover, PopoverContent, PopoverTrigger } from \"../popover\";\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from \"../tooltip\";\nimport { useIsMobile } from \"../use-is-mobile\";\nimport { cn } from \"../cn\";\n\nconst COARSE_POINTER_QUERY = \"(pointer: coarse)\";\n\nfunction subscribeCoarse(onChange: () => void) {\n const mq = window.matchMedia(COARSE_POINTER_QUERY);\n mq.addEventListener(\"change\", onChange);\n return () => mq.removeEventListener(\"change\", onChange);\n}\n\nfunction useCoarsePointer() {\n return useSyncExternalStore(\n subscribeCoarse,\n () => window.matchMedia(COARSE_POINTER_QUERY).matches,\n () => false,\n );\n}\n\n/** Keep a hint's clicks from reaching a parent link, row, or card. */\nfunction isolate(e: SyntheticEvent) {\n e.stopPropagation();\n e.preventDefault();\n}\n\nexport interface InfoHintProps {\n /** The definition: one sentence, ≤ 140 characters. */\n text: string;\n /** Accessible name of the icon button. */\n label?: string;\n className?: string;\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n}\n\nconst TRIGGER_CLASS =\n \"relative inline-flex h-3.5 w-3.5 shrink-0 cursor-help items-center justify-center rounded-sm align-[-0.125em] text-muted-foreground transition-colors hover:text-foreground focus-visible:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring before:absolute before:-inset-[5px] before:content-[''] [@media(pointer:coarse)]:before:-inset-[15px]\";\n\nconst CONTENT_CLASS =\n \"max-w-[16rem] text-xs font-normal normal-case leading-snug tracking-normal\";\n\nexport function InfoHint({ text, label = \"More info\", className, side = \"top\" }: InfoHintProps) {\n const coarse = useCoarsePointer();\n const isMobile = useIsMobile();\n const [open, setOpen] = useState(false);\n\n const glyph = <InfoIcon aria-hidden className=\"h-3.5 w-3.5\" strokeWidth={2} />;\n\n if (coarse || isMobile) {\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n aria-label={label}\n className={cn(TRIGGER_CLASS, className)}\n onClick={(e) => {\n isolate(e);\n setOpen((v) => !v);\n }}\n onPointerDown={(e) => e.stopPropagation()}\n >\n {glyph}\n </button>\n </PopoverTrigger>\n <PopoverContent /* sizing: fixed — a fixed-measure panel on purpose; its rows truncate inside the box */\n side={side}\n sideOffset={6}\n className={cn(\"w-auto px-3 py-2 text-popover-foreground\", CONTENT_CLASS)}\n onClick={isolate}\n onPointerDown={(e) => e.stopPropagation()}\n onOpenAutoFocus={(e) => e.preventDefault()}\n >\n {text}\n </PopoverContent>\n </Popover>\n );\n }\n\n return (\n // Brings its own provider: an official component works wherever it is imported (a\n // test, a portal, a page without the app shell) — 2026-09-30, final-switch tests.\n <TooltipProvider delayDuration={200}>\n <Tooltip open={open} onOpenChange={setOpen}>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n aria-label={label}\n className={cn(TRIGGER_CLASS, className)}\n // A click opens it too (hover is not the only way in).\n onClick={(e) => {\n isolate(e);\n setOpen(true);\n }}\n // Inside a table header (or any parent that has its own tooltip or drag handle), the\n // parent must not see the pointer: its tooltip would open and close this one, and a\n // press would start a column drag. Found 2026-10-11 on MatrxDataTable headers.\n onPointerMove={(e) => e.stopPropagation()}\n onPointerDown={(e) => e.stopPropagation()}\n onFocus={(e) => e.stopPropagation()}\n >\n {glyph}\n </button>\n </TooltipTrigger>\n <TooltipContent side={side} className={CONTENT_CLASS} onClick={isolate}>\n {text}\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n );\n}\n\nexport default InfoHint;\n","\"use client\";\n\n// THE canonical lifecycle-status badge (moved from matrx-frontend components/official/status-badge,\n// wave 2, 2026-10-22): one tinted, icon-led pill for \"what state is this record in\" (draft / active /\n// disabled / archived and their cousins on other entities). The tone is a NAME (`success`, `warning`,\n// `danger`, `neutral`, `info`) resolved through the role tokens — the same tints the Badge and the\n// Chip use — never a color class at a call site. The icon carries the meaning for color-blind\n// readers, and the label is always a word, never a dot alone.\n//\n// Entity modules own their status VOCABULARY (which statuses exist, what each means, which tone it\n// wears); this primitive owns only the LOOK, so every entity's status reads the same everywhere.\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\n\nexport type StatusTone = \"success\" | \"warning\" | \"danger\" | \"neutral\" | \"info\";\nexport type StatusBadgeSize = \"sm\" | \"md\" | \"lg\";\n\n/** Every status tone, in a fixed order (tests, pickers, demos). */\nexport const STATUS_TONES: readonly StatusTone[] = [\"success\", \"warning\", \"danger\", \"neutral\", \"info\"] as const;\n\nconst TONE_CLASS: Record<StatusTone, string> = {\n success: \"border-success/40 bg-success/15 text-success-ink\",\n warning: \"border-warning/50 bg-warning/20 text-warning-ink\",\n danger: \"border-destructive/40 bg-destructive/15 text-destructive-ink\",\n neutral: \"border-border bg-muted text-foreground\",\n info: \"border-info/40 bg-info/15 text-info-ink\",\n};\n\nconst SIZE_CLASS: Record<StatusBadgeSize, { root: string; icon: string }> = {\n sm: { root: \"gap-1 px-1.5 py-0.5 text-[11px]\", icon: \"h-3 w-3\" },\n md: { root: \"gap-1.5 px-2 py-0.5 text-xs\", icon: \"h-3.5 w-3.5\" },\n lg: { root: \"gap-1.5 px-2.5 py-1 text-sm\", icon: \"h-4 w-4\" },\n};\n\nexport interface StatusBadgeProps {\n label: string;\n tone: StatusTone;\n /** Any glyph component (a design-system glyph, a Lucide icon); it receives `className`. */\n icon?: React.ComponentType<{ className?: string; \"aria-hidden\"?: boolean }>;\n size?: StatusBadgeSize;\n /** One sentence saying what the status means — the hover text. */\n title?: string;\n /**\n * A glyph drawn INSIDE the capsule after the label — the chevron of a status that opens a menu.\n * One capsule, never a pill wrapped in another rounded box.\n */\n trailing?: React.ReactNode;\n className?: string;\n}\n\nexport function StatusBadge({ label, tone, icon: Icon, size = \"md\", title, trailing, className }: StatusBadgeProps) {\n const s = SIZE_CLASS[size];\n return (\n <span\n role=\"status\"\n aria-label={title ? `${label}: ${title}` : label}\n title={title}\n data-status-tone={tone}\n className={cn(\n // matrx-glyph-trim: the icon's and chevron's own air is removed on both sides, so the INK\n // sits the same distance from either edge.\n \"matrx-glyph-trim inline-flex shrink-0 items-center whitespace-nowrap rounded-full border font-semibold leading-none\",\n TONE_CLASS[tone],\n s.root,\n className,\n )}\n >\n {Icon ? <Icon aria-hidden className={cn(\"shrink-0\", s.icon)} /> : null}\n {label}\n {trailing}\n </span>\n );\n}\n","\"use client\";\n\n// A titled section card: a header (title, description, actions), a body, and an optional three-column\n// footer. Moved from matrx-frontend components/official/StructuredSectionCard (wave 2, 2026-10-22).\n// The header and title used hard-coded gray / rose; they are now the role tokens, with the title's\n// ink a NAMED option (`titleTone`) instead of a pasted color: `primary` (default) or `foreground`.\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\n\nexport type StructuredSectionCardTitleTone = \"primary\" | \"foreground\";\n\nconst TITLE_TONE: Record<StructuredSectionCardTitleTone, string> = {\n primary: \"text-primary-ink\",\n foreground: \"text-foreground\",\n};\n\nexport interface StructuredSectionCardProps {\n title: string;\n description?: string;\n children: React.ReactNode;\n headerActions?: React.ReactNode[];\n footerLeft?: React.ReactNode;\n footerCenter?: React.ReactNode;\n footerRight?: React.ReactNode;\n /** The title's ink, by name. Default `primary`. */\n titleTone?: StructuredSectionCardTitleTone;\n className?: string;\n}\n\nexport function StructuredSectionCard({\n title,\n description,\n children,\n headerActions = [],\n footerLeft,\n footerCenter,\n footerRight,\n titleTone = \"primary\",\n className,\n}: StructuredSectionCardProps) {\n const hasFooter = footerLeft || footerCenter || footerRight;\n return (\n <div\n data-slot=\"structured-section-card\"\n className={cn(\"overflow-hidden rounded-xl border-border bg-textured shadow-sm\", className)}\n >\n <div className=\"flex items-center justify-between border-b border-border bg-muted px-4 py-3\">\n <div className=\"min-w-0\">\n <h3 className={cn(\"font-medium\", TITLE_TONE[titleTone])}>{title}</h3>\n {description && <p className=\"type-body text-muted-foreground\">{description}</p>}\n </div>\n {headerActions.length > 0 && (\n <div className=\"ml-4 flex shrink-0 items-center space-x-2\">\n {headerActions.map((action, index) => (\n <React.Fragment key={index}>{action}</React.Fragment>\n ))}\n </div>\n )}\n </div>\n\n <div className=\"p-4\">{children}</div>\n\n {hasFooter && (\n <div className=\"flex flex-wrap items-center border-t border-border px-4 py-3\">\n <div className=\"flex min-w-[33%] flex-1 justify-start space-x-2 sm:min-w-0\">{footerLeft}</div>\n <div className=\"mt-2 flex min-w-[33%] flex-1 justify-center space-x-2 sm:mt-0 sm:min-w-0\">{footerCenter}</div>\n <div className=\"mt-2 flex min-w-[33%] flex-1 justify-end space-x-2 sm:mt-0 sm:min-w-0\">{footerRight}</div>\n </div>\n )}\n </div>\n );\n}\n","\"use client\";\n\n// An icon-led selection menu: the trigger shows the SELECTED option's glyph and a chevron; the menu\n// lists every option with its glyph, the selected one tinted and checked. For sort controls, view\n// modes, filters. Moved from matrx-frontend components/official/IconDropdownMenu (wave 2,\n// 2026-10-22); the selected state was a hard-coded blue and is now the primary role tokens.\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { CheckIcon, ChevronDownIcon } from \"../icons\";\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from \"../dropdown-menu\";\nimport { Button } from \"./controls\";\n\ntype GlyphComponent = React.ComponentType<{ className?: string }>;\n\nexport interface IconDropdownOption<T = string> {\n value: T;\n label: string;\n /** Any glyph component (a design-system glyph, a Lucide icon); it receives `className`. */\n icon: GlyphComponent;\n}\n\nexport interface IconDropdownMenuProps<T = string> {\n options: IconDropdownOption<T>[];\n value: T;\n onValueChange: (value: T) => void;\n /** Dropdown alignment. Default `end`. */\n align?: \"start\" | \"center\" | \"end\";\n /** Places the trigger (margin, position), never restyles it. */\n className?: string;\n /** Width class of the menu. Default `w-48`. */\n menuWidth?: string;\n}\n\nexport function IconDropdownMenu<T extends string = string>({\n options,\n value,\n onValueChange,\n align = \"end\",\n className,\n menuWidth = \"w-48\",\n}: IconDropdownMenuProps<T>) {\n const selected = options.find((opt) => opt.value === value) ?? options[0];\n const SelectedIcon = selected?.icon;\n if (!SelectedIcon) {\n console.warn(\"IconDropdownMenu: no option to show — pass at least one option.\");\n return null;\n }\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n icon={<SelectedIcon />}\n iconEnd={<ChevronDownIcon />}\n variant=\"outline\"\n aria-label={selected.label}\n {...(className ? { className } : {})}\n />\n </DropdownMenuTrigger>\n <DropdownMenuContent align={align} className={cn(\"rounded-2xl p-1\", menuWidth)}>\n {options.map((option) => {\n const isSelected = option.value === value;\n const OptionIcon = option.icon;\n return (\n <DropdownMenuItem\n key={String(option.value)}\n onClick={() => onValueChange(option.value)}\n data-selected={isSelected ? \"\" : undefined}\n className={cn(\n \"flex cursor-pointer items-center gap-3 rounded-lg px-3 py-2.5 transition-colors\",\n isSelected && \"bg-primary/10\",\n )}\n >\n <OptionIcon className={cn(\"h-4 w-4 shrink-0\", isSelected ? \"text-primary-ink\" : \"text-muted-foreground\")} />\n <span className={cn(\"type-body flex-1 leading-tight\", isSelected ? \"font-medium text-primary-ink\" : \"text-foreground\")}>\n {option.label}\n </span>\n {isSelected && <CheckIcon className=\"h-4 w-4 shrink-0 text-primary-ink\" />}\n </DropdownMenuItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n","/**\n * ErrorBox — THE one way a package draws an error on screen, and the seam a\n * host uses to put its own actions on every one of them.\n *\n * Every error sentence this package (and every sibling package that depends\n * on it) shows is an `ErrorBox`. The box is a plain `role=\"alert\"` element —\n * its tag and classes are the caller's, so nothing about the look changes — and\n * after its children it renders whatever the host's `ErrorActionsProvider`\n * returns for that error. With no provider it renders nothing extra.\n *\n * Why a slot and not a menu: the package cannot know the host's AI copy, bug\n * report, or support flow (Matrx fills it with its Alchemy copy-for-AI menu at\n * the app root). The package supplies the error's facts — the sentence, the\n * raw error, the operation, the records — and the host decides the actions.\n *\n * Guard: `error-box.census.test.ts` fails when a package file renders\n * `role=\"alert\"` for an error without going through `ErrorBox` (or, for the\n * `Alert` family, `ErrorActions`).\n */\nimport * as React from \"react\";\nimport { peopleErrorSentence } from \"./error-sentence\";\n\nexport interface ErrorActionsRecord {\n type: string;\n id: string;\n label?: string;\n}\n\n/** The facts a package knows about an error it is showing. All optional. */\nexport interface ErrorActionsInput {\n /** The sentence shown. Omit when the words are only in the rendered box. */\n message?: string | undefined;\n title?: string | undefined;\n /** The raw error (code/status/stack stay available to the host). */\n error?: unknown | undefined;\n /** What was being attempted (\"Load saved views\"). */\n operation?: string | undefined;\n records?: readonly ErrorActionsRecord[] | undefined;\n /** The person's input that did not land. */\n unsavedInput?: unknown | undefined;\n /** The package + component that drew it (\"design-system/SavedViewsControl\"). */\n origin?: string | undefined;\n /** Extra structured facts for the AI payload (never shown). */\n details?: Record<string, unknown> | undefined;\n code?: string | number | undefined;\n status?: number | undefined;\n /** The tables / RPCs the failed call used — pins its captured request as the cause. */\n calls?: readonly string[] | undefined;\n /** Where it was drawn: an `ErrorNotice` card/line (\"inline\") or a package alert box (\"alert\", the default). */\n source?: \"inline\" | \"alert\" | undefined;\n}\n\nexport type ErrorActionsRenderer = (input: ErrorActionsInput) => React.ReactNode;\n\n/**\n * ONE context for every copy of this module. tsup builds each entry point\n * (`.`, `./data-table`, …) without code splitting, so this file is inlined into\n * several bundles; a plain `createContext` would give each bundle its own\n * context and the host's provider (imported from `.`) would never reach an\n * error drawn by the data table. The registry key makes them one.\n */\nconst CONTEXT_KEY = Symbol.for(\"@ai-matrx/design-system/error-actions\");\ntype ContextRegistry = Record<symbol, React.Context<ErrorActionsRenderer | null> | undefined>;\nconst registry = globalThis as unknown as ContextRegistry;\nconst ErrorActionsContext: React.Context<ErrorActionsRenderer | null> =\n registry[CONTEXT_KEY] ??\n (registry[CONTEXT_KEY] = React.createContext<ErrorActionsRenderer | null>(null));\n\n/** Mount once at the host's app root; every ErrorBox below renders `render(...)`. */\nexport function ErrorActionsProvider({\n render,\n children,\n}: {\n render: ErrorActionsRenderer;\n children: React.ReactNode;\n}) {\n return (\n <ErrorActionsContext.Provider value={render}>{children}</ErrorActionsContext.Provider>\n );\n}\n\n/**\n * The host's content menu around an error card (`ErrorNotice`): the corner ⋯\n * button and the right-click boundary that show the host's content actions\n * over the error's sentence. Read-only — nothing here may change a record.\n * Without a provider the card draws neither (the actions slot still renders).\n */\nexport interface ErrorCardMenus {\n /** The corner ⋯ button over `{ title, text }`. */\n Button: React.ComponentType<{ title: string; text: string; className?: string }>;\n /** Wraps the whole card so right-click opens the same menu. */\n Boundary: React.ComponentType<{ title: string; text: string; children: React.ReactNode }>;\n}\n\nconst MENUS_KEY = Symbol.for(\"@ai-matrx/design-system/error-card-menus\");\ntype MenusRegistry = Record<symbol, React.Context<ErrorCardMenus | null> | undefined>;\nconst menusRegistry = globalThis as unknown as MenusRegistry;\nconst ErrorCardMenusContext: React.Context<ErrorCardMenus | null> =\n menusRegistry[MENUS_KEY] ??\n (menusRegistry[MENUS_KEY] = React.createContext<ErrorCardMenus | null>(null));\n\n/** Mount once at the host's app root beside `ErrorActionsProvider`. */\nexport function ErrorCardMenusProvider({\n menus,\n children,\n}: {\n menus: ErrorCardMenus;\n children: React.ReactNode;\n}) {\n return <ErrorCardMenusContext.Provider value={menus}>{children}</ErrorCardMenusContext.Provider>;\n}\n\nexport function useErrorCardMenus(): ErrorCardMenus | null {\n return React.useContext(ErrorCardMenusContext);\n}\n\nexport function useErrorActions(): ErrorActionsRenderer | null {\n return React.useContext(ErrorActionsContext);\n}\n\n/**\n * The host's actions for one error, placed wherever the caller puts this\n * element. Renders nothing without a provider. Use inside a box you do not\n * render yourself (the `Alert` family); everything else uses `ErrorBox`.\n */\nexport function ErrorActions(props: ErrorActionsInput) {\n const render = useErrorActions();\n if (!render) return null;\n return <>{render(props)}</>;\n}\n\ntype ErrorBoxTag = \"p\" | \"div\" | \"span\" | \"section\" | \"li\";\n\nexport interface ErrorBoxProps\n extends Omit<React.HTMLAttributes<HTMLElement>, \"role\" | \"title\">,\n ErrorActionsInput {\n /** The element drawn — the caller's existing tag, so layout never shifts. */\n as?: ErrorBoxTag;\n}\n\n/** A plain-string body goes through the one funnel (error-sentence.ts); rich children are the caller's. */\nfunction sayable(body: React.ReactNode, error: unknown): React.ReactNode {\n if (typeof body === \"string\") return peopleErrorSentence(error, body);\n if (Array.isArray(body)) return body.map((b) => (typeof b === \"string\" && b.trim() ? peopleErrorSentence(error, b) : b));\n return body;\n}\n\nexport const ErrorBox = React.forwardRef<HTMLElement, ErrorBoxProps>(function ErrorBox(\n {\n as = \"p\",\n message,\n title,\n error,\n operation,\n records,\n unsavedInput,\n origin,\n children,\n ...rest\n },\n ref,\n) {\n // A component type, never a bare ElementType: an app compiling this source may carry global JSX\n // elements (react-three-fiber) that make a bare ElementType's props `never` (2026-10-22).\n const Tag = as as unknown as React.ComponentType<React.HTMLAttributes<HTMLElement> & { ref?: React.Ref<HTMLElement> }>;\n const facts: ErrorActionsInput = {\n ...(message !== undefined ? { message } : {}),\n ...(title !== undefined ? { title } : {}),\n ...(error !== undefined ? { error } : {}),\n ...(operation !== undefined ? { operation } : {}),\n ...(records !== undefined ? { records } : {}),\n ...(unsavedInput !== undefined ? { unsavedInput } : {}),\n ...(origin !== undefined ? { origin } : {}),\n };\n return (\n <Tag ref={ref} role=\"alert\" data-error-box=\"\" {...rest}>\n {sayable(children ?? message, error)}\n <ErrorActions {...facts} />\n </Tag>\n );\n});\n","/**\n * THE error-wording layer. A failure is shown as a cause the person can act on (\"A program it\n * needs isn't installed\"), never as the raw text a process threw (\"spawn uv ENOENT\"). The raw text\n * is kept, whole, as `detail` — the banner offers it behind Copy details and a tooltip, for a bug\n * report or an agent. One table, so every screen and every service says the same thing.\n */\n\nexport interface DescribedError {\n /** One plain sentence: what went wrong and, where it helps, what to do. */\n cause: string;\n /** The raw text, unedited (empty when it would only repeat `cause`). */\n detail: string;\n /** A short machine code when one was recognized (\"ENOENT\", \"TIMEOUT\"). */\n code?: string;\n}\n\ninterface Rule {\n code: string;\n test: RegExp;\n cause: string;\n}\n\n/** Ordered: the first rule whose pattern matches the raw text wins. */\nconst RULES: ReadonlyArray<Rule> = [\n { code: \"ENOENT\", test: /\\b(spawn\\s+\\S+\\s+)?ENOENT\\b|command not found|no such file or directory/i, cause: \"A program or file it needs isn't on this computer. Install it or update Matrx, then try again.\" },\n { code: \"EACCES\", test: /\\bEACCES\\b|\\bEPERM\\b|permission denied|operation not permitted|not authori[sz]ed by the user/i, cause: \"Matrx isn't allowed to do that. Grant access in System Settings › Privacy & Security, then try again.\" },\n { code: \"EADDRINUSE\", test: /\\bEADDRINUSE\\b|address already in use|port .* (is )?(already )?in use/i, cause: \"Another program is already using that port. Stop it, or choose another port.\" },\n { code: \"ECONNREFUSED\", test: /\\bECONNREFUSED\\b|connection refused/i, cause: \"The service isn't answering. It may have stopped; start it again.\" },\n { code: \"OFFLINE\", test: /\\bENOTFOUND\\b|\\bEAI_AGAIN\\b|\\bENETUNREACH\\b|getaddrinfo|network (is )?unreachable|failed to fetch|offline/i, cause: \"Can't reach the internet. Check the connection and try again.\" },\n { code: \"TIMEOUT\", test: /\\bETIMEDOUT\\b|timed? ?out|\\bTIMEOUT\\b|deadline exceeded/i, cause: \"It took too long to answer. Try again in a moment.\" },\n { code: \"ENOSPC\", test: /\\bENOSPC\\b|no space left/i, cause: \"The disk is full. Free some space, then try again.\" },\n { code: \"ENOMEM\", test: /\\bENOMEM\\b|out of memory|cannot allocate memory/i, cause: \"The computer ran out of memory. Close something and try again.\" },\n { code: \"UNAUTHORIZED\", test: /\\b401\\b|unauthori[sz]ed|invalid (api )?key|not signed in|jwt expired|session expired/i, cause: \"You're signed out, or the key was refused. Sign in again.\" },\n { code: \"FORBIDDEN\", test: /\\b403\\b|forbidden/i, cause: \"This account isn't allowed to do that.\" },\n { code: \"NOT_FOUND\", test: /\\b404\\b|not found/i, cause: \"It isn't there any more. Refresh and try again.\" },\n { code: \"RATE_LIMIT\", test: /\\b429\\b|rate.?limit|too many requests/i, cause: \"Too many requests just now. Wait a moment and try again.\" },\n { code: \"SERVER\", test: /\\b5\\d\\d\\b|internal server error|bad gateway|service unavailable/i, cause: \"The server had a problem. Try again in a moment.\" },\n { code: \"EXITED\", test: /exited with code|process exited|crashed|SIGKILL|SIGSEGV|SIGTERM/i, cause: \"The service stopped unexpectedly. Start it again; Copy details if it keeps happening.\" },\n];\n\nconst RAW = /\\b[A-Z]{2,}[A-Z_]*\\b|[\\\\/][\\w.-]+[\\\\/]|\\bat \\S+ \\(|\\{|\\}|errno|stack|undefined|null|\\bspawn\\b/;\n\nfunction rawText(error: unknown): string {\n if (error instanceof Error) return error.message || error.name;\n if (typeof error === \"string\") return error;\n if (error && typeof error === \"object\" && \"message\" in error && typeof (error as { message: unknown }).message === \"string\") {\n return (error as { message: string }).message;\n }\n return \"\";\n}\n\n/**\n * Turn any thrown or returned error into words a person can act on. Already-humane text (a full\n * sentence the app wrote itself, with no codes, paths or stack) passes through unchanged.\n */\nexport function describeError(error: unknown, fallback = \"Something went wrong. Try again.\"): DescribedError {\n const detail = rawText(error).trim();\n if (!detail) return { cause: fallback, detail: \"\" };\n for (const rule of RULES) {\n if (rule.test.test(detail)) return { cause: rule.cause, detail, code: rule.code };\n }\n if (!RAW.test(detail) && detail.length <= 160) return { cause: detail, detail: \"\" };\n return { cause: fallback, detail };\n}\n","/**\n * THE SENTENCE A PERSON READS FOR AN ERROR — the one funnel every error surface draws through\n * (ErrorNotice, ErrorBox, the desktop Banner). Raw error text never reaches the screen: no\n * \"TypeError: Failed to fetch\", no `sidebar_conversations:` RPC prefix, no stack frame or file\n * path (Arman, 2026-10-24: notices are small and plain). The raw error still travels to the\n * Alchemy Menu / AI payload through the `error` prop; only the screen gets the sentence.\n *\n * The wording table is desktop/errors.ts `describeError` (one table for every screen); this file\n * adds what decides WHEN a sentence must go through it, narrow enough that an app's own sentence\n * (\"PDF too large\") passes untouched.\n */\nimport { describeError } from \"./desktop/errors\";\n\n/**\n * The sentence an error carries: its own message (string, Error, or any\n * object with a `message`). Empty when it has none.\n */\nexport function errorSentenceOf(error: unknown): string {\n if (error == null || error === true || error === false) return \"\";\n if (typeof error === \"string\") return error;\n if (typeof error !== \"object\") return String(error);\n const message = (error as { message?: unknown }).message;\n return typeof message === \"string\" ? message : \"\";\n}\n\n/**\n * What a person reads when the store cancelled a call at its statement timeout\n * (SQLSTATE 57014). Postgres' own \"canceling statement due to statement\n * timeout\" is about the database, not the person; the cancelled call rolled\n * back, so nothing was written (lane AT-SLOW, 2026-10-19). The same sentence\n * @ai-matrx/records' `TIMED_OUT_MESSAGE` gives.\n */\nexport const TIMED_OUT_SENTENCE = \"That took too long. Nothing was lost; try again.\";\n\n/** What a person reads when an error says nothing a person can use. */\nexport const FALLBACK_ERROR_SENTENCE = \"Something went wrong. Try again.\";\n\n/**\n * A notice CARD's words (the web toast, Matrx 2's floating card): a card is ~22 rem at most and its\n * action shares the row, so a line is a few words (notice-stack.ts NOTICE_TEXT_BUDGET). The same\n * causes as the sentences above, said short enough to fit at the smallest window, never cut by \"…\".\n */\nexport const CARD_ERROR_LINE = {\n OFFLINE: \"No connection\",\n TIMEOUT: \"Took too long. Nothing was lost.\",\n UNAUTHORIZED: \"Signed out. Sign in again.\",\n FORBIDDEN: \"Not allowed for this account\",\n NOT_FOUND: \"Not found. Refresh and retry.\",\n RATE_LIMIT: \"Too many requests. Wait a moment.\",\n SERVER: \"Server problem. Try again soon.\",\n FALLBACK: \"Something went wrong\",\n} as const;\n\n/** True when an error, its code, or its sentence is the store's statement timeout. */\nexport function isTimedOutError(error: unknown, message?: string | null, code?: string | number): boolean {\n if (code === \"57014\" || code === \"timed_out\") return true;\n if (error && typeof error === \"object\") {\n const o = error as { code?: unknown; sqlstate?: unknown };\n if (o.code === \"57014\" || o.code === \"timed_out\" || o.sqlstate === \"57014\") return true;\n }\n const text = `${message ?? \"\"} ${errorSentenceOf(error)}`;\n return /canceling statement due to statement timeout/i.test(text);\n}\n\n/** True when the call failed because the device is offline or the network never answered. */\nexport function isOfflineError(error: unknown, message?: string | null): boolean {\n if (typeof navigator !== \"undefined\" && navigator.onLine === false) return true;\n return offlineText(`${message ?? \"\"} ${errorSentenceOf(error)}`);\n}\n\nfunction offlineText(text: string): boolean {\n const t = text.trim();\n return t !== \"\" && (describeError(t).code === \"OFFLINE\" || /networkerror|network request failed|load failed/i.test(t));\n}\n\n/** describeError's causes that hold on every host (its process codes — ENOENT, EACCES, ports — are\n * the desktop's words for a local program and would mislead on a database refusal). */\nconst ANY_HOST_CODES = new Set([\"OFFLINE\", \"TIMEOUT\", \"UNAUTHORIZED\", \"FORBIDDEN\", \"NOT_FOUND\", \"RATE_LIMIT\", \"SERVER\"]);\n\n/** A leading machine label: `sidebar_conversations: …`, `chat.rpc_name: …`, `[chat-sidebar] …`. */\nconst MACHINE_PREFIX = /^\\s*(?:\\[[\\w./-]+\\]\\s*|[a-z][\\w]*(?:[._][\\w]+)+:\\s+)/;\n/** Text no person should read: JS error class names, stack frames, source paths. */\nconst RAW_TEXT =\n /\\b(?:Type|Reference|Syntax|Range|Internal|Eval|URI)Error\\b|\\bat\\s+[\\w$.<>]+\\s*\\(|\\.(?:[cm]?[jt]sx?|py):\\d+|(?:^|[\\s(])(?:\\/[\\w.@-]+){2,}|\\bundefined is not\\b|\\bcannot read propert(?:y|ies)\\b|\\bis not a function\\b|\\bunexpected token\\b/i;\n\n/** True when a sentence carries raw error text or a code path (what the guard refuses on screen). */\nexport function isRawErrorText(text: string): boolean {\n return MACHINE_PREFIX.test(text) || RAW_TEXT.test(text);\n}\n\n/**\n * `card: true` = the short CARD_ERROR_LINE words for a notice card. Otherwise:\n * the sentence for the screen: the timeout sentence for a statement timeout; a caller's plain\n * sentence as is; a machine label stripped from the front; anything raw or offline worded by\n * `describeError` (its table, else `fallback`).\n */\nexport function peopleErrorSentence(\n error: unknown,\n message?: string | null,\n options: { code?: string | number | undefined; fallback?: string | undefined; card?: boolean | undefined } = {},\n): string {\n const card = options.card === true;\n if (isTimedOutError(error, message, options.code)) return card ? CARD_ERROR_LINE.TIMEOUT : TIMED_OUT_SENTENCE;\n const fallback = options.fallback ?? (card ? CARD_ERROR_LINE.FALLBACK : FALLBACK_ERROR_SENTENCE);\n const raw = message?.trim() || errorSentenceOf(error).trim();\n if (!raw) return fallback;\n let text = raw;\n for (let i = 0; i < 3 && MACHINE_PREFIX.test(text); i++) text = text.replace(MACHINE_PREFIX, \"\").trim();\n if (!text) return fallback;\n if (offlineText(text) || RAW_TEXT.test(text) || text !== raw) {\n const said = describeError(text, fallback);\n if (!said.code || !ANY_HOST_CODES.has(said.code)) return fallback;\n return card ? CARD_ERROR_LINE[said.code as keyof typeof CARD_ERROR_LINE] : said.cause;\n }\n return text;\n}\n","\"use client\";\n\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nexport const Label = React.forwardRef<\n React.ComponentRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(\n \"text-sm font-medium leading-none text-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-70\",\n className,\n )}\n {...props}\n />\n));\nLabel.displayName = LabelPrimitive.Root.displayName;\n","/**\n * Field — the canonical above-label wrapper for any form input.\n *\n * Wraps **any** input (ProTextarea, shadcn Input, Select, custom controls) with\n * a consistent, accessible label/description/error/counter layout. Composition\n * over prop bloat: instead of every input growing label/help/error props, the\n * input stays focused on its job and `Field` owns the surrounding chrome.\n *\n * ## Layout (fixed, by design)\n *\n * ```\n * Label *required (optional) [?] ← help icon, hover for tooltip\n * Description text. Markdown-style hints, format rules.\n * ┌────────────────────────────┐\n * │ <child input> │\n * └────────────────────────────┘\n * ⚠ error message count / max ← right-aligned, color-tiered\n * ```\n *\n * The order is fixed and not configurable. This is intentional: every Field in\n * the app should look identical so users can scan forms without re-learning.\n *\n * ## Required props\n *\n * - `label` — visible text. Always required (a Field without a label is just a div).\n * - `htmlFor` — must match the child input's `id`. This wires the label to the\n * input for screen readers and click-to-focus. Pass the same id to the input.\n *\n * ## Usage\n *\n * Simple labeled input:\n *\n * ```tsx\n * <Field label=\"Title\" htmlFor=\"title\" required>\n * <ProTextarea\n * id=\"title\"\n * value={title}\n * onChange={(e) => setTitle(e.target.value)}\n * />\n * </Field>\n * ```\n *\n * Full feature set:\n *\n * ```tsx\n * <Field\n * label=\"Bio\"\n * htmlFor=\"bio\"\n * required\n * help=\"Markdown supported. Visible on your public profile.\"\n * description=\"Tell visitors who you are.\"\n * error={errors.bio}\n * count={bio.length}\n * maxCount={500}\n * >\n * <ProTextarea id=\"bio\" value={bio} onChange={…} />\n * </Field>\n * ```\n *\n * ## When to use what\n *\n * - **Above-label form (most cases)** → `<Field>` (this component)\n * - **Dense form, label inside the input border** → `<ProTextarea floatingLabel=\"…\" />`\n * - **No label at all (search, comments, filters)** → bare `<ProTextarea>` with `placeholder`\n *\n * ## Constraints (intentional)\n *\n * - The label, description, error, and counter render in a fixed visual order.\n * - No `labelClassName` / `descriptionClassName` / `errorClassName` props.\n * These are styled to a single house standard. If you need a different look,\n * you're outside the official component's scope — build a one-off, don't fork.\n * - `required` and `optional` are mutually exclusive. If both are passed,\n * `required` wins.\n * - The character counter is always **soft** (warns and colors but doesn't\n * block typing). For hard DB-bound limits, also pass `maxLength` to the\n * input itself.\n *\n * @official-component\n */\n\n\"use client\";\n\n// Named LabeledField in the package because `Field` here is already the input capsule (controls.tsx).\n// Moved from matrx-frontend components/official/Field (wave 2, 2026-10-22).\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { CircleAlertIcon, CircleHelpIcon } from \"../icons\";\nimport { ErrorActions } from \"../error-box\";\nimport { Label } from \"../label\";\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from \"../tooltip\";\nimport { InfoHint } from \"./info-hint\";\n\nexport interface LabeledFieldProps {\n /** Visible label text. Always required. */\n label: React.ReactNode;\n /**\n * Must match the child input's `id`. Wires the label for screen readers and\n * click-to-focus. Required — there is no \"no a11y\" mode.\n */\n htmlFor: string;\n /** Marks the field as required. Renders a red asterisk. Wins over `optional`. */\n required?: boolean;\n /**\n * Marks the field as optional. Renders a small gray \"(optional)\" tag.\n * Use sparingly — it's only worth showing when most fields nearby are required.\n */\n optional?: boolean;\n /**\n * Help for the label — one sentence, ≤ 140 chars. A string renders through\n * `InfoHint` (hover, keyboard and tap); a ReactNode keeps a hover tooltip.\n */\n help?: React.ReactNode;\n /**\n * Static helper text rendered between the label and the input. Hidden when\n * an `error` is present so the error takes the spotlight.\n */\n description?: React.ReactNode;\n /**\n * Validation error. When set, the label turns destructive and the error\n * replaces the description. Pair with `aria-invalid` on the child input.\n */\n error?: React.ReactNode;\n /**\n * Current character/word count. Pass `value.length` (or your own metric).\n * Renders bottom-right of the field.\n */\n count?: number;\n /**\n * Soft limit. Counter turns warning at >90%, destructive past 100%.\n * **Does not block typing.** For hard limits, also set `maxLength` on the input.\n */\n maxCount?: number;\n /**\n * 🚨 **THE EMPTY-LOOKS-EMPTY RULE (2026-09-15).** The child input's current\n * value. Pass it on every `required` field.\n *\n * A required field that is EMPTY must LOOK empty. On 2026-09-15 a\n * non-technical Expert could not build their Masterwork because the name\n * field's placeholder (\"Headless Headhunter Resume Review Masterwork\") was\n * indistinguishable from a typed value: the screen said filled, the field\n * was empty, and the primary action sat silently disabled\n * (`teach-recent-practitioner` W2). A placeholder is a suggestion, never an\n * answer, and the screen must say which one it is showing.\n *\n * When `required` is set and this value is blank, `Field` dashes the input's\n * border, fades and italicises its placeholder, and says so underneath — so\n * no placeholder, however value-shaped, can pass for a filled field. The\n * sentence shows only while the control actually shows placeholder text\n * (`:placeholder-shown`): under a box with no example, or a select, it would\n * be false (2026-09-27, /hr/settings/employer).\n *\n * Leave it `undefined` on fields you do not track; the honesty chrome then\n * never renders (it cannot know). `\"\"` means empty and IS tracked.\n */\n value?: string | null;\n /** Outer wrapper className. The only styling escape hatch — used for layout (e.g. `flex-1`). */\n className?: string;\n /** The input. Must have `id={htmlFor}` for the label to work correctly. */\n children: React.ReactNode;\n}\n\n/**\n * @see {@link LabeledFieldProps} for the full prop contract.\n */\nexport function LabeledField({\n label,\n htmlFor,\n required,\n optional,\n help,\n description,\n error,\n count,\n maxCount,\n value,\n className,\n children,\n}: LabeledFieldProps) {\n /**\n * Tracked AND required AND blank. `undefined` is \"not tracked\" — only an\n * explicitly passed value can be judged empty.\n */\n const requiredEmpty =\n Boolean(required) && value !== undefined && !String(value ?? \"\").trim();\n const hasCounter = typeof count === \"number\";\n const overLimit = hasCounter && maxCount != null && count! > maxCount;\n const nearLimit =\n hasCounter &&\n maxCount != null &&\n count! > maxCount * 0.9 &&\n !overLimit;\n\n return (\n <div data-field-root=\"\" className={cn(\"group/field space-y-1.5\", className)}>\n <div className=\"flex items-center gap-1.5\">\n <Label\n htmlFor={htmlFor}\n className={cn(\n \"text-sm font-medium text-foreground\",\n error && \"text-destructive\",\n )}\n >\n {label}\n {required && (\n <span className=\"text-destructive ml-1\" aria-hidden>\n *\n </span>\n )}\n {!required && optional && (\n <span className=\"text-muted-foreground ml-1.5 type-secondary font-normal\">\n (optional)\n </span>\n )}\n </Label>\n {/* A text hint goes through InfoHint so it opens on tap and keyboard too; rich help keeps the hover tooltip. */}\n {typeof help === \"string\" && help && (\n <InfoHint text={help} label={typeof label === \"string\" ? `About ${label}` : \"Help\"} />\n )}\n {help && typeof help !== \"string\" && (\n <TooltipProvider delayDuration={150}>\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n aria-label=\"Help\"\n className=\"inline-flex items-center justify-center h-4 w-4 rounded-full text-muted-foreground hover:text-foreground transition-colors\"\n >\n <CircleHelpIcon className=\"h-3.5 w-3.5\" />\n </button>\n </TooltipTrigger>\n <TooltipContent side=\"top\" className=\"max-w-xs type-secondary\">\n {help}\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n )}\n </div>\n\n {description && !error && (\n <p className=\"type-secondary text-muted-foreground\">{description}</p>\n )}\n\n {/*\n THE EMPTY-LOOKS-EMPTY RULE. Styled on a wrapper with descendant\n selectors rather than by cloning the child, so it holds for EVERY\n input a Field can wrap — shadcn Input, ProTextarea, a bespoke control —\n without the child having to opt in or even know.\n */}\n <div\n data-slot=\"field-control\"\n data-required-empty={requiredEmpty ? \"true\" : undefined}\n className={cn(\n requiredEmpty &&\n \"[&_input]:border-dashed [&_textarea]:border-dashed [&_input]:border-muted-foreground/50 [&_textarea]:border-muted-foreground/50 [&_input]:placeholder:italic [&_textarea]:placeholder:italic [&_input]:placeholder:text-disabled-foreground [&_textarea]:placeholder:text-disabled-foreground\",\n )}\n >\n {children}\n </div>\n\n {(error || hasCounter || requiredEmpty) && (\n <div\n className={cn(\n \"flex items-start justify-between gap-2 min-h-[1rem]\",\n // The notice alone is only true while the control is SHOWING an\n // example (a visible placeholder). An empty box with no example text,\n // or a select, has nothing to be mistaken for an answer — so the row\n // stays hidden until `:placeholder-shown` matches inside this field.\n !error && !hasCounter && \"hidden [[data-field-root]:has(:placeholder-shown)_&]:flex\",\n )}\n >\n {error ? (\n <p className=\"type-secondary text-destructive flex items-center gap-1\">\n <CircleAlertIcon className=\"h-3 w-3 flex-shrink-0\" />\n <span>{error}</span>\n {/* The host's error actions (Copy, Copy for AI, fix request): the slot every package error uses.\n The raw `error` goes through untouched so the host formats a non-string one itself. */}\n <ErrorActions\n {...(typeof error === \"string\" ? { message: error } : {})}\n error={error}\n origin=\"design-system/LabeledField\"\n />\n </p>\n ) : requiredEmpty ? (\n <p\n data-slot=\"field-empty-notice\"\n className=\"hidden type-secondary text-muted-foreground items-center gap-1 [[data-field-root]:has(:placeholder-shown)_&]:flex\"\n >\n <CircleAlertIcon className=\"h-3 w-3 flex-shrink-0\" />\n <span>Empty — the gray text is an example, not your answer.</span>\n </p>\n ) : (\n <span />\n )}\n {hasCounter && (\n <span\n className={cn(\n \"type-secondary tabular-nums text-muted-foreground ml-auto\",\n nearLimit && \"text-warning\",\n overLimit && \"text-destructive font-medium\",\n )}\n >\n {maxCount != null ? `${count} / ${maxCount}` : `${count}`}\n </span>\n )}\n </div>\n )}\n </div>\n );\n}\n\n\n","\"use client\";\n\n// A small info glyph that opens a hover card: title, text or content, a copy button, a \"Required\"\n// pill and an optional \"Get help from Matrx AI\" action. Moved from matrx-frontend\n// components/official/HelpIcon (wave 2, 2026-10-22). Copy goes through kit's one clipboard door\n// (a failure opens the clipboard fallback dialog); the blue / amber hard-codes are the info and\n// warning role tokens now. New usages of a label's one-sentence definition belong in `InfoHint`\n// (reachable by mouse, keyboard and touch); this icon opens on mouse hover only.\n\nimport { copyText } from \"@ai-matrx/kit/clipboard\";\nimport { openClipboardFallback } from \"@ai-matrx/kit/clipboard-fallback-opener\";\nimport { toast } from \"@ai-matrx/kit/notify\";\nimport * as React from \"react\";\nimport { createPortal } from \"react-dom\";\n\nimport { CheckIcon, CircleDotIcon, CircleHelpIcon, CopyIcon, InfoIcon } from \"../icons\";\nimport { Button } from \"./controls\";\n\nconst { useState, useLayoutEffect, useRef } = React;\n\nexport interface HelpIconProps {\n text?: string;\n content?: React.ReactNode;\n className?: string;\n title?: string;\n required?: boolean;\n onAiAssistance?: () => void;\n}\n\nexport function HelpIcon({ \n text, \n content, \n className = \"\", \n title = \"\", \n required = false,\n onAiAssistance\n}: HelpIconProps) {\n const [copied, setCopied] = useState(false);\n const [isVisible, setIsVisible] = useState(false);\n const [position, setPosition] = useState({ top: 0, left: 0 });\n const iconRef = useRef<HTMLDivElement>(null);\n const tooltipRef = useRef<HTMLDivElement>(null);\n const hideTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const showTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n \n const handleCopy = async (e: React.MouseEvent) => {\n e.stopPropagation();\n if (text) {\n // The success notice goes through kit's one toast (the host's, once registered); a failure opens the fallback dialog instead of a second notice.\n if (!(await copyText(text, { successMessage: \"Copied to clipboard\", notify: (message, kind) => { if (kind === \"success\") toast.success(message); } }))) {\n // A copy that did not land says so: the fallback dialog shows the text to copy by hand.\n void openClipboardFallback(text);\n return;\n }\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n }\n };\n\n const handleAiClick = (e: React.MouseEvent) => {\n e.stopPropagation();\n if (onAiAssistance) {\n onAiAssistance();\n }\n };\n \n const updatePosition = () => {\n if (iconRef.current && tooltipRef.current) {\n const rect = iconRef.current.getBoundingClientRect();\n const tooltipRect = tooltipRef.current.getBoundingClientRect();\n const viewportWidth = window.innerWidth;\n \n let left = rect.left + (rect.width / 2) - (tooltipRect.width / 2);\n let top = rect.top - tooltipRect.height - 8;\n \n // Adjust if tooltip would go off-screen\n if (left < 10) left = 10;\n if (left + tooltipRect.width > viewportWidth - 10) {\n left = viewportWidth - tooltipRect.width - 10;\n }\n \n // If tooltip would go above viewport, position below icon\n if (top < 10) {\n top = rect.bottom + 8;\n }\n \n setPosition({ top, left });\n }\n };\n \n const showTooltip = () => {\n if (hideTimeoutRef.current) {\n clearTimeout(hideTimeoutRef.current);\n hideTimeoutRef.current = null;\n }\n \n if (!isVisible && !showTimeoutRef.current) {\n showTimeoutRef.current = setTimeout(() => {\n setIsVisible(true);\n showTimeoutRef.current = null;\n }, 200);\n }\n };\n \n const hideTooltip = () => {\n if (showTimeoutRef.current) {\n clearTimeout(showTimeoutRef.current);\n showTimeoutRef.current = null;\n }\n \n hideTimeoutRef.current = setTimeout(() => {\n setIsVisible(false);\n }, 150);\n };\n \n const cancelHideTooltip = () => {\n if (hideTimeoutRef.current) {\n clearTimeout(hideTimeoutRef.current);\n hideTimeoutRef.current = null;\n }\n };\n \n // A LAYOUT effect: the card is measured and placed before the browser paints it. As a plain\n // effect it painted at the window's top-left corner first, then jumped to the icon (2026-10-08).\n useLayoutEffect(() => {\n if (isVisible) {\n updatePosition();\n window.addEventListener('scroll', updatePosition);\n window.addEventListener('resize', updatePosition);\n }\n \n return () => {\n window.removeEventListener('scroll', updatePosition);\n window.removeEventListener('resize', updatePosition);\n if (hideTimeoutRef.current) {\n clearTimeout(hideTimeoutRef.current);\n }\n if (showTimeoutRef.current) {\n clearTimeout(showTimeoutRef.current);\n }\n };\n }, [isVisible]);\n \n // Format text to handle both literal newlines and \\n escape sequences\n const formatTextWithLineBreaks = (text: string) => {\n const processedText = text.replace(/\\\\n/g, '\\n');\n return processedText.split('\\n').map((line, index) => (\n <React.Fragment key={index}>\n {index > 0 && <br />}\n {line}\n </React.Fragment>\n ));\n };\n \n // The nothing-to-show guard sits BELOW every hook. Above them it made all 8\n // hook calls conditional (react-hooks/rules-of-hooks) — a HelpIcon whose\n // `text` arrives asynchronously would crash with \"rendered more hooks than\n // during the previous render\".\n if (!text && !content) return null;\n\n return (\n <div \n className={`inline-block relative cursor-help ${className}`}\n ref={iconRef}\n onMouseEnter={showTooltip}\n onMouseLeave={hideTooltip}\n >\n <InfoIcon className=\"h-4 w-4 text-muted-foreground transition-colors duration-200\" />\n \n {isVisible && typeof document !== 'undefined' && createPortal(\n <div \n ref={tooltipRef}\n className=\"fixed max-w-sm bg-textured border-border rounded-lg shadow-xl z-[9999] animate-in fade-in-0 zoom-in-95 duration-100\"\n style={{ \n top: `${position.top}px`, \n left: `${position.left}px`,\n pointerEvents: 'auto' \n }}\n onMouseEnter={cancelHideTooltip}\n onMouseLeave={hideTooltip}\n >\n <div className=\"p-3\">\n {/* Header row with icon and title */}\n <div className=\"flex items-center gap-2 mb-2\">\n <CircleHelpIcon className=\"h-4 w-4 flex-shrink-0 text-info-ink\" />\n {title && (\n <h3 className=\"text-foreground type-title\">\n {title}\n </h3>\n )}\n {text && (\n <Button\n variant=\"quiet\"\n className=\"ml-auto\"\n icon={copied ? <CheckIcon /> : <CopyIcon />}\n aria-label=\"Copy to clipboard\"\n onClick={handleCopy}\n />\n )}\n </div>\n \n {/* Content */}\n <div className=\"type-body text-foreground leading-relaxed\">\n {content ? content : (text && formatTextWithLineBreaks(text))}\n </div>\n \n {/* Required field pill */}\n {required && (\n <div className=\"mt-3 inline-flex items-center gap-1.5 px-2.5 py-1 bg-warning/15 text-warning-ink type-secondary font-medium rounded-full\">\n <div className=\"w-1.5 h-1.5 bg-warning-ink rounded-full\"></div>\n Required Field\n </div>\n )}\n \n {/* AI Assistance button */}\n {onAiAssistance && (\n <Button variant=\"primary\" icon={<CircleDotIcon />} className=\"mt-3 w-full\" onClick={handleAiClick}>\n Get Help From Matrx AI\n </Button>\n )}\n </div>\n \n {/* Tooltip arrow */}\n <div className=\"absolute -bottom-1.5 left-1/2 -translate-x-1/2 w-3 h-3 bg-textured border-r border-b border-border rotate-45\"></div>\n </div>,\n document.body\n )}\n </div>\n );\n}\n","\"use client\";\n\n// A list of short texts typed one by one (Enter or comma adds): the field on top, the chips under it,\n// each chip with its own remove button, and a copy-all button in the field. Moved from matrx-frontend\n// components/official/TextArrayInput (wave 2, 2026-10-22), with its two private helpers: copy goes\n// through kit's one clipboard door (a failure opens the clipboard fallback dialog) and `cleanUrl`\n// (strip tracking parameters, keep p / q / id) lives here next to its only caller.\n\nimport { copyText } from \"@ai-matrx/kit/clipboard\";\nimport { toast } from \"@ai-matrx/kit/notify\";\nimport { openClipboardFallback } from \"@ai-matrx/kit/clipboard-fallback-opener\";\nimport * as React from \"react\";\n\nimport { CheckIcon, CopyIcon, XIcon } from \"../icons\";\nimport { Button } from \"./controls\";\nimport { Input } from \"./doors\";\n\n/** A URL without its tracking parameters (keeps `p`, `q`, `id`); anything that is not a URL comes back unchanged. */\nexport function cleanUrl(url: string): string {\n try {\n const parsed = new URL(url);\n const kept = new URLSearchParams();\n for (const [key, value] of new URLSearchParams(parsed.search)) {\n if ([\"p\", \"q\", \"id\"].includes(key)) kept.set(key, value);\n }\n parsed.search = kept.toString();\n return parsed.toString();\n } catch {\n return url;\n }\n}\n\nexport interface TextArrayInputProps {\n value?: string[];\n onChange?: (value: string[]) => void;\n placeholder?: string;\n className?: string;\n /** Classes of each chip (its fill and ink). Default: the primary fill. */\n chipClassName?: string;\n /** Drop repeats. Default true. */\n uniqueFilter?: boolean;\n /** Show the copy-all button when there are values. Default true. */\n showCopyIcon?: boolean;\n /** Strip tracking parameters from each added item. */\n shouldCleanUrl?: boolean;\n /** Override sequential focus for copy/remove controls in dense composite fields. */\n auxiliaryControlsTabIndex?: number;\n}\n\nexport function TextArrayInput({\n value: externalValue,\n onChange,\n placeholder = \"Add items (press Enter)\",\n className = \"\",\n chipClassName = \"bg-primary text-primary-foreground\",\n uniqueFilter = true,\n showCopyIcon = true,\n shouldCleanUrl = false,\n auxiliaryControlsTabIndex,\n}: TextArrayInputProps) {\n const [internalValue, setInternalValue] = React.useState<string[]>([]);\n const [inputValue, setInputValue] = React.useState(\"\");\n const [copied, setCopied] = React.useState(false);\n\n const value = externalValue || internalValue;\n const tabIndexProp = auxiliaryControlsTabIndex === undefined ? {} : { tabIndex: auxiliaryControlsTabIndex };\n\n const handleCopy = async () => {\n const text = value.join(\", \");\n // Success is told through kit's one toast; a failure opens the fallback dialog (no second notice).\n if (!(await copyText(text, { successMessage: \"Copied\", notify: (message, kind) => { if (kind === \"success\") toast.success(message); } }))) {\n void openClipboardFallback(text);\n return;\n }\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n };\n\n const handleChange = (newItems: string[]) => {\n const processed = uniqueFilter ? [...new Set(newItems)] : newItems;\n if (onChange) onChange(processed);\n else setInternalValue(processed);\n };\n\n const handleSubmit = (e: React.SyntheticEvent) => {\n e.preventDefault();\n if (!inputValue.trim()) return;\n const added = inputValue\n .split(\",\")\n .map((item) => {\n const trimmed = item.trim();\n return shouldCleanUrl && trimmed ? cleanUrl(trimmed) : trimmed;\n })\n .filter((item) => item.length > 0);\n handleChange([...value, ...added]);\n setInputValue(\"\");\n };\n\n return (\n <div className={`space-y-3 ${className}`}>\n <form onSubmit={handleSubmit} className=\"relative w-full\">\n <Input\n adornment=\"end\"\n type=\"text\"\n value={inputValue}\n onChange={(e) => setInputValue(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") handleSubmit(e);\n }}\n placeholder={placeholder}\n className=\"w-full\"\n />\n {showCopyIcon && value.length > 0 && (\n <Button\n {...tabIndexProp}\n variant=\"quiet\"\n icon={copied ? <CheckIcon /> : <CopyIcon />}\n {...(copied ? { glyphTone: \"success\" as const } : {})}\n aria-label=\"Copy values\"\n onClick={handleCopy}\n className=\"absolute right-2 top-1/2 -translate-y-1/2\"\n />\n )}\n </form>\n\n <div className=\"flex flex-wrap gap-2\">\n {value.length === 0 ? (\n <span className=\"type-body inline-flex items-center rounded-full bg-muted px-3 py-1 text-muted-foreground\">None Added</span>\n ) : (\n value.map((item, index) => (\n <span\n key={`${item}-${index}`}\n className={`inline-flex cursor-default items-center gap-1 rounded-full px-3 py-1 text-sm transition-all duration-200 ${chipClassName}`}\n >\n {item}\n <button\n {...tabIndexProp}\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n handleChange(value.filter((_, i) => i !== index));\n }}\n className=\"cursor-pointer rounded-full p-0.5 transition-colors duration-200 hover:bg-primary-foreground/20\"\n aria-label={`Remove ${item}`}\n >\n <XIcon className=\"h-3.5 w-3.5\" />\n </button>\n </span>\n ))\n )}\n </div>\n </div>\n );\n}\n","\"use client\";\n\n/**\n * HostLink — the link the design-system's own components draw for an internal destination (a KPI\n * tile that opens its records, a dock tab, a card that opens a page).\n *\n * It is NOT a new seam: it resolves the tap-target link component the host registered once with\n * `setTapTargetLinkComponent` (`tap-target/link.ts`, the same slot the tap buttons and the settings\n * blocks use). A host that routes through its own link door (cross-deployment aware, prefetch rules)\n * registers THAT door there, and every component here inherits it.\n *\n * Nothing registered: a plain `<a>` (a working link, a full page load) that says so — one console\n * notice and `data-link-host=\"unconfigured\"` on what it draws.\n */\n\nimport * as React from \"react\";\n\nimport { announceStandIn, UNCONFIGURED } from \"./stand-in-notice\";\nimport { getTapTargetLinkComponent } from \"./tap-target/link\";\n\nexport interface HostLinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"href\"> {\n href: string;\n prefetch?: boolean | null;\n}\n\nexport const HostLink = React.forwardRef<HTMLAnchorElement, HostLinkProps>(function HostLink(\n { href, prefetch, ...rest },\n ref,\n) {\n const Registered = getTapTargetLinkComponent() as unknown as React.ComponentType<\n HostLinkProps & { ref?: React.Ref<HTMLAnchorElement> }\n > | null;\n if (Registered) {\n return <Registered ref={ref} href={href} {...(prefetch === undefined ? {} : { prefetch })} {...rest} />;\n }\n announceStandIn(\n \"link-host\",\n \"HostLink drew a plain <a>: register the app's link component once with setTapTargetLinkComponent() from @ai-matrx/design-system/tap-target.\",\n );\n return <a ref={ref} href={href} data-link-host={UNCONFIGURED} {...rest} />;\n});\n","/**\n * A STAND-IN ANNOUNCES ITSELF (law 4). Where a design-system component has a working default for a\n * part the host is meant to supply (the writing box, the sandbox panel, how a scope is drawn), the\n * default says so: ONE console notice per stand-in naming what to pass, and a `data-*=\"unconfigured\"`\n * attribute on what it draws. The pattern is records-ui's `data-entity-ref-host=\"unconfigured\"` and\n * settings' `data-settings-host=\"unconfigured\"`.\n */\nconst announced = new Set<string>();\n\n/** Warn once per `key`, in words naming the field the host should pass. */\nexport function announceStandIn(key: string, message: string): void {\n if (announced.has(key)) return;\n announced.add(key);\n console.warn(`[design-system] ${message}`);\n}\n\n/** Test seam: forget every notice that was printed. */\nexport function _resetStandInNotices(): void {\n announced.clear();\n}\n\n/** The value every stand-in's data attribute carries. */\nexport const UNCONFIGURED = \"unconfigured\" as const;\n","import type { ComponentType, ReactNode, Ref } from \"react\";\n\n/**\n * The injectable link seam — the package's replacement for the original\n * hard `next/link` import.\n *\n * Internal hrefs (anything NOT matching `http(s):`, `mailto:`, `tel:`) render\n * through the link component resolved here; external hrefs always render a\n * plain `<a target=\"_blank\" rel=\"noopener noreferrer\">`, exactly like the\n * original. When nothing is registered and no per-instance `linkComponent`\n * prop is given, internal hrefs fall back to a plain `<a>` (no prefetch, no\n * client-side routing — still a working link).\n */\nexport interface TapTargetLinkProps {\n href: string;\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\" | undefined;\n rel?: string | undefined;\n /** Router prefetch hint (next/link semantics). Plain `<a>` fallback ignores it. */\n prefetch?: boolean | null | undefined;\n \"aria-label\"?: string | undefined;\n /** Tooltip text drawn through `title` (the provider's title takeover). */\n title?: string | undefined;\n className?: string | undefined;\n children?: ReactNode;\n /** The trigger's ref (the development guard measures the rendered link).\n * next/link forwards it to its `<a>`. */\n ref?: Ref<HTMLAnchorElement> | undefined;\n}\n\nexport type TapTargetLinkComponent = ComponentType<TapTargetLinkProps>;\n\n/**\n * The registered component lives in a `Symbol.for` slot on `globalThis` — NOT\n * in module state — so it survives the module graph being instantiated more\n * than once: the `.` and `./buttons` dist bundles each inline the primitives\n * (tsup `splitting: false`), and a consumer may even mix `import` and\n * `require`. One registration must reach every copy.\n */\nconst LINK_SLOT = Symbol.for(\"@ai-matrx/tap-target:link-component\");\n\ntype GlobalWithLinkSlot = typeof globalThis & {\n [LINK_SLOT]?: TapTargetLinkComponent | null;\n};\n\n/**\n * Register the app's link component once at startup (e.g. `next/link`):\n *\n * ```tsx\n * import Link from \"next/link\";\n * import { setTapTargetLinkComponent } from \"@ai-matrx/tap-target\";\n * setTapTargetLinkComponent(Link);\n * ```\n *\n * Pass `null` to unregister (plain `<a>` fallback resumes).\n */\nexport function setTapTargetLinkComponent(\n component: TapTargetLinkComponent | null,\n): void {\n (globalThis as GlobalWithLinkSlot)[LINK_SLOT] = component;\n}\n\n/** The currently registered link component, or `null` when none is set. */\nexport function getTapTargetLinkComponent(): TapTargetLinkComponent | null {\n return (globalThis as GlobalWithLinkSlot)[LINK_SLOT] ?? null;\n}\n","/**\n * UntrustedCount — a number that refuses to be reported when the read that\n * produced it failed.\n *\n * THE DEAD END this kills: every count on a surface is derived from the rows\n * currently in state (`rows.length`, `rows.filter(…).length`). When a fetch\n * fails and the rows are cleared — which is the correct thing to do, since\n * stale rows under a fresh banner are their own defect — every one of those\n * counters silently becomes `0`. A console then reports \"Total 0 · Failed 0\"\n * in confident bold type, which is not \"we couldn't read this\": it is a\n * positive claim about the database that nobody is entitled to make. Zero is\n * the single most dangerous default a failed read can produce, because it is\n * indistinguishable from good news.\n *\n * `StaleDataNotice` is the banner half of the same rule and this is the inline\n * half — a surface that shows the notice and still prints `0` beside it is\n * contradicting itself, and the number wins because it looks like data.\n *\n * Renders the value when the read succeeded, an em dash when it failed, and a\n * quiet ellipsis while it is still in flight. It carries the screen-reader\n * explanation itself so a caller cannot forget it: an em dash is mute to a\n * screen reader, so without the label the failure is invisible to exactly the\n * users least able to infer it from context.\n *\n * Tell it the read's outcome ONE of two ways:\n * - `read={{ status, error }}` — the same `ReadOutcome` a table's `read=`\n * takes (structurally the design-system `MatrxDataTableRead`);\n * - `trustworthy={!loadFailed}` — when all you hold is the failure flag.\n *\n * Styling is entirely the caller's — this owns the VALUE, never the chrome, so\n * it drops unchanged into a stat card, a pill badge, or a sentence. The shared\n * count primitives (KpiTile, MetricCell, ResearchFilterBar) take the same\n * `read=` and resolve it with `countReadState` below, so every stat tile on the\n * platform says \"—\" the same way.\n */\n\nimport type { ReadOutcome } from \"./read-gate\";\n\n/** The read outcome a count primitive is told: a `ReadOutcome` (or a `MatrxDataTableRead`). */\nexport type CountRead = Pick<ReadOutcome, \"status\" | \"error\" | \"hasData\">;\n\n/** What a count may honestly show for its read: the number, a failure dash, or a loading mark. */\nexport type CountReadState = \"ready\" | \"loading\" | \"failed\";\n\n/**\n * Fold a count's read input into what it may show.\n * - First load (nothing known yet): \"loading\" → \"…\".\n * - A read that failed with nothing known: \"failed\" → \"—\".\n * - STALE-WHILE-ERROR (RC-B12 r13 ruling): once a read has produced a value\n * (`read.hasData`), a refetch in flight or a failed refresh keeps showing the\n * last known value (\"ready\") — the surface's stale notice says it may be out\n * of date; `countIsStale` lets a count mark itself. No flicker to \"…\" or \"—\".\n * With neither input the number is shown (nothing was said about a read).\n */\nexport function countReadState(input: {\n read?: CountRead | null | undefined;\n trustworthy?: boolean | undefined;\n}): CountReadState {\n const { read, trustworthy } = input;\n if (trustworthy === false) return \"failed\";\n if (read) {\n const failed = read.status === \"error\" || (read.error != null && read.error !== false && read.error !== \"\");\n if (read.hasData) return \"ready\";\n if (failed) return \"failed\";\n if (read.status === \"loading\") return \"loading\";\n }\n return \"ready\";\n}\n\n/** A last-known value shown over a failed refresh (see `countReadState`). */\nexport function countIsStale(read: CountRead | null | undefined): boolean {\n if (!read?.hasData) return false;\n return read.status === \"error\" || (read.error != null && read.error !== false && read.error !== \"\");\n}\n\n/** The screen-reader sentence for a count that could not be read. */\nexport function unavailableCountLabel(label: string): string {\n return `${label} unavailable — could not be read`;\n}\n\ntype UntrustedCountRead =\n | {\n /**\n * Whether the read behind this number succeeded. Pass `!loadFailed` — the\n * same flag that drives the surface's `StaleDataNotice`, so the banner and\n * the number can never disagree.\n */\n trustworthy: boolean;\n read?: never;\n }\n | {\n /** The read behind this number — `{ status, error }` (a table's `read=` value fits). */\n read: CountRead;\n trustworthy?: never;\n };\n\nexport type UntrustedCountProps = UntrustedCountRead & {\n /** The derived count (or its formatted text). Never rendered unless the read succeeded. */\n value: number | string;\n /**\n * What this counts, as the user reads it on screen (\"Total\", \"Unresolved\").\n * Becomes \"<label> unavailable\" for screen readers when the read failed.\n */\n label: string;\n className?: string;\n};\n\nexport function UntrustedCount({\n value,\n trustworthy,\n read,\n label,\n className,\n}: UntrustedCountProps) {\n const state = countReadState({ read, trustworthy });\n if (state === \"ready\") {\n if (countIsStale(read)) {\n return (\n <span\n className={className}\n aria-label={`${label} ${value} — last known value, couldn't refresh`}\n title=\"Couldn't refresh — last known value\"\n >\n {value}\n </span>\n );\n }\n return <span className={className}>{value}</span>;\n }\n if (state === \"loading\") {\n return (\n <span className={className} aria-busy=\"true\" aria-label={`${label} loading`}>\n …\n </span>\n );\n }\n return (\n <span\n className={className}\n aria-label={unavailableCountLabel(label)}\n title=\"Couldn't be read\"\n >\n —\n </span>\n );\n}\n","// design-system controls/kpi-tile.tsx (moved from matrx-frontend components/official/kpi, wave 2, 2026-10-22;\n// tone colors are the role tokens, the drill-in link is the registered tap-target link via HostLink)\n//\n// THE KPI TILE — one number, its label, an optional one-line hint, and an\n// optional drill-in. The shared primitive for KPI pages (Spend's TotalsStrip\n// tile is the model it was lifted from). A tile with `href` is a link: every\n// number that names a set of records opens that set.\n//\n// A number that could not be measured is never shown as 0: pass\n// `value={null}` and the tile renders \"—\" with the hint saying why. A number\n// read from the database takes that read's outcome — `read={{ status, error }}`\n// (a table's `read=` value fits): a failed read renders \"—\" with an\n// \"unavailable\" label for screen readers, an in-flight read renders loading.\n//\n// `title` is the number's one-sentence definition. It renders through\n// `InfoHint` from the design system — an info icon right after the label that\n// opens on hover, keyboard focus, and tap — never as a native `title=` on the\n// tile, which phones and keyboard users can't reach.\n//\n// `trend` draws a small history line beside the number (oldest first). Pass it\n// only when real history exists — never a flat stand-in; `period` names the\n// span (\"28 days\") for screen readers and the hover label.\n\n\"use client\";\n\nimport type { ReactNode } from \"react\";\n\nimport { cn } from \"../cn\";\nimport { HostLink } from \"../host-link\";\nimport { countReadState, unavailableCountLabel, type CountRead } from \"../read-state/untrusted-count\";\nimport { InfoHint } from \"./info-hint\";\n\nexport type KpiTone = \"neutral\" | \"good\" | \"warn\" | \"bad\";\n\nconst TONE_VALUE: Record<KpiTone, string> = {\n neutral: \"text-foreground\",\n good: \"text-success-ink\",\n warn: \"text-warning-ink\",\n bad: \"text-destructive-ink\",\n};\n\nconst TONE_DOT: Record<KpiTone, string | null> = {\n neutral: null,\n good: \"bg-success\",\n warn: \"bg-warning\",\n bad: \"bg-destructive\",\n};\n\nexport interface KpiTileProps {\n label: string;\n /** `null` = not measured; renders \"—\", never 0. */\n value: ReactNode | null;\n hint?: ReactNode;\n tone?: KpiTone;\n /** Drill-in destination. The whole tile becomes the link. */\n href?: string;\n /** Definition — what the number counts, in one sentence (≤ 140 chars). Renders as an InfoHint after the label. */\n title?: string;\n loading?: boolean;\n /** The read behind `value`. Failed → \"—\" (never 0); loading → the loading bar. */\n read?: CountRead | null;\n /** Real history behind the number, oldest first (≥ 2 points), and the span it covers. */\n trend?: KpiTrend | null;\n className?: string;\n}\n\nexport interface KpiTrend {\n values: readonly number[];\n /** The span the line covers (\"28 days\", \"12 weeks\"). */\n period: string;\n /** What the line counts when it is not the tile's number (\"Posts per week\"). */\n label?: string;\n}\n\nconst SPARK_W = 64;\nconst SPARK_H = 20;\n\n/** The tile's history line: a filled area under the line (none when flat), scaled from its low point. */\nfunction KpiSparkline({ trend, label }: { trend: KpiTrend; label: string }) {\n const n = trend.values.length;\n if (n < 2) return null;\n const min = Math.min(...trend.values);\n const max = Math.max(...trend.values);\n // A floor of 10% of the peak: a change of 11 on 3,700 stays a near-flat line, never a cliff.\n const range = Math.max(max - min, Math.abs(max) * 0.1) || 1;\n // A level line sits at mid-height: drawn on the floor it would read as zero.\n const y = (v: number) => (max === min ? SPARK_H / 2 : SPARK_H - 2 - ((v - min) / range) * (SPARK_H - 4));\n const pts = trend.values\n .map((v, i) => `${((i / (n - 1)) * SPARK_W).toFixed(1)},${y(v).toFixed(1)}`)\n .join(\" \");\n return (\n <svg\n viewBox={`0 0 ${SPARK_W} ${SPARK_H}`}\n preserveAspectRatio=\"none\"\n role=\"img\"\n aria-label={`${trend.label ?? label}, last ${trend.period}`}\n className=\"h-5 w-16 shrink-0 text-primary\"\n >\n <title>{`${trend.label ?? label}, last ${trend.period}`}</title>\n {/* A flat series is a line only: an area under it would read as a filled bar, not \"no change\". */}\n {max === min ? null : <polygon points={`0,${SPARK_H} ${pts} ${SPARK_W},${SPARK_H}`} fill=\"currentColor\" fillOpacity={0.15} />}\n <polyline points={pts} fill=\"none\" stroke=\"currentColor\" strokeWidth={1.5} strokeLinejoin=\"round\" vectorEffect=\"non-scaling-stroke\" />\n </svg>\n );\n}\n\nexport function KpiTile({\n label,\n value,\n hint,\n tone = \"neutral\",\n href,\n title,\n loading: loadingProp = false,\n read,\n trend,\n className,\n}: KpiTileProps) {\n const readState = countReadState({ read });\n const loading = loadingProp || readState === \"loading\";\n const failed = readState === \"failed\";\n const shown = failed ? null : value;\n const dot = TONE_DOT[tone];\n const body = (\n <>\n {/* A label wraps to a second line rather than being cut (\"NO DEFAULT\n MANDA…\" on a phone, punch list 2026-09-26) — a KPI whose name is\n unreadable is a number without a meaning. */}\n <div className=\"flex min-w-0 items-start gap-1.5 type-meta font-medium uppercase tracking-wide text-muted-foreground\">\n {dot ? (\n <span aria-hidden className={cn(\"mt-1 inline-block h-2 w-2 shrink-0 rounded-sm\", dot)} />\n ) : null}\n <span className=\"line-clamp-2 break-words\">\n {label}\n {title ? (\n <>\n {\" \"}\n <InfoHint text={title} label={`What ${label} means`} />\n </>\n ) : null}\n </span>\n </div>\n {loading ? (\n <div className=\"my-0.5 h-6 w-12 animate-pulse rounded bg-muted\" aria-hidden />\n ) : (\n <div className=\"flex min-w-0 items-end justify-between gap-2\">\n <div\n className={cn(\n \"truncate text-lg font-semibold leading-tight tabular-nums\",\n shown === null ? \"text-muted-foreground\" : TONE_VALUE[tone],\n )}\n aria-label={failed ? unavailableCountLabel(label) : undefined}\n title={failed ? \"Couldn't be read\" : undefined}\n >\n {shown === null ? \"—\" : shown}\n </div>\n {trend && shown !== null ? <KpiSparkline trend={trend} label={label} /> : null}\n </div>\n )}\n {hint ? (\n <div className=\"truncate type-meta text-muted-foreground\">{hint}</div>\n ) : null}\n </>\n );\n\n const shell = cn(\n \"flex min-w-0 flex-col gap-0.5 rounded-md border border-border bg-card px-3 py-2\",\n className,\n );\n\n if (href && !loading && shown !== null) {\n return (\n <HostLink\n href={href}\n data-look-surface=\"card\"\n className={cn(\n shell,\n \"transition-colors hover:border-primary/50 hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n )}\n >\n {body}\n </HostLink>\n );\n }\n return (\n <div className={shell} data-look-surface=\"card\" aria-busy={loading || undefined}>\n {body}\n </div>\n );\n}\n\n/** The standard responsive tile row. */\nexport function KpiGrid({\n children,\n className,\n}: {\n children: ReactNode;\n className?: string;\n}) {\n return (\n <div\n className={cn(\n \"grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-6\",\n className,\n )}\n >\n {children}\n </div>\n );\n}\n","\"use client\";\n\n// A button whose action is confirmed ON the button: after the click its glyph turns into a check\n// (and its tooltip says so) for a moment, then goes back. Moved from matrx-frontend\n// components/official/ActionFeedbackButton onto THE control (wave 2, 2026-10-22), so it has the\n// controls' one geometry — no size, no color of its own. A glyph whose color carries meaning says so\n// with `glyphTone`; `className` places it, never restyles it.\n\nimport * as React from \"react\";\n\nimport { CheckCircle2Icon } from \"../icons\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"../tooltip\";\nimport { Button, type ButtonProps } from \"./controls\";\n\nexport interface ActionFeedbackButtonProps\n extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"children\" | \"onClick\"> {\n /** The glyph, as an element (it keeps its own className). */\n icon: React.ReactNode;\n /** Required: an icon-only button says what it does. */\n tooltip: string;\n onClick: () => void;\n /** Tone, never size. Default `quiet`. */\n variant?: ButtonProps[\"variant\"];\n /** The glyph's own status ink while it is NOT confirming. */\n glyphTone?: ButtonProps[\"glyphTone\"];\n /** Shown during the confirmation. Default: the package's check-circle. */\n successIcon?: React.ReactNode;\n successTooltip?: string;\n /** Milliseconds the confirmation stays. Default 2000. */\n feedbackDuration?: number;\n /** Tooltip while disabled, when it differs from `tooltip`. */\n disabledTooltip?: string;\n}\n\nexport function ActionFeedbackButton({\n icon,\n tooltip,\n onClick,\n variant = \"quiet\",\n glyphTone,\n successIcon,\n successTooltip = \"Success!\",\n feedbackDuration = 2000,\n disabledTooltip,\n disabled = false,\n ...props\n}: ActionFeedbackButtonProps) {\n const [showSuccess, setShowSuccess] = React.useState(false);\n const timer = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n React.useEffect(() => () => {\n if (timer.current) clearTimeout(timer.current);\n }, []);\n\n const handleClick = () => {\n onClick();\n setShowSuccess(true);\n if (timer.current) clearTimeout(timer.current);\n timer.current = setTimeout(() => setShowSuccess(false), feedbackDuration);\n };\n\n const text = showSuccess ? successTooltip : disabled && disabledTooltip ? disabledTooltip : tooltip;\n const button = (\n <Button\n variant={variant}\n icon={showSuccess ? (successIcon ?? <CheckCircle2Icon />) : icon}\n {...(showSuccess ? { glyphTone: \"success\" as const } : glyphTone ? { glyphTone } : {})}\n {...props}\n aria-label={text}\n // A confirming button ignores a second click; a disabled one wears the native state.\n disabled={disabled || showSuccess}\n onClick={handleClick}\n />\n );\n return (\n <Tooltip>\n <TooltipTrigger asChild>{disabled ? <span className=\"inline-flex\">{button}</span> : button}</TooltipTrigger>\n <TooltipContent side=\"bottom\" sideOffset={5} className=\"z-[9999]\">\n {text}\n </TooltipContent>\n </Tooltip>\n );\n}\n","\"use client\";\n\n/**\n * CitationChip — THE shared presentational citation-chip primitive.\n *\n * One tappable source chip + its excerpt popover (number badge / icon /\n * title / locator / verbatim quote / open action). Every citation chip UI\n * renders through this:\n * - chat Sources footer (features/agents/components/messages-display/\n * citations/MessageSourcesRow.tsx — MessageCitationSource),\n * - education trust chips (features/education/trust/components/\n * SourceCitations.tsx — TrustEnvelope SourceCitation),\n * - the popover body alone backs the inline superscript marker\n * (components/mardown-display/chat-markdown/citations/\n * CitationMarkerInline.tsx).\n *\n * BOUNDARY: deliberately pure-presentational and citation-shape-agnostic —\n * it knows NOTHING of MessageCitationSource, TrustEnvelope, or openers.\n * Consumers map their citation shape to these props and pass `onOpen`\n * pre-wired to their canonical opener (useOpenCitationSource /\n * openCitationSource). That keeps chat free of TrustEnvelope coupling and\n * education free of the chat execution-system — the ONE chip stays shared.\n *\n * Styling knobs (chipClassName / clampExcerpt / chipSuffix / number) exist\n * so each consumer keeps its established visual language; `cn` uses\n * tailwind-merge, so a consumer's max-w/gap override wins over the base.\n */\n\nimport { useState } from \"react\";\nimport type * as React from \"react\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"../popover\";\nimport { cn } from \"../cn\";\nimport { ArrowUpRightIcon, QuoteIcon } from \"../icons\";\n\nexport interface CitationPopoverBodyProps {\n /** Icon representing the source (FileText for documents, Globe for web…). */\n icon: React.ComponentType<{ className?: string; \"aria-hidden\"?: boolean }>;\n /** Source title / domain / fallback label. */\n label: string;\n /** Secondary locator line under the title (e.g. \"Page 3 · example.com\"). */\n locator?: string | null;\n /** Verbatim cited excerpt, rendered as a blockquote. */\n excerpt?: string | null;\n /** Clamp the excerpt to 6 lines (long chat quotes). Default false. */\n clampExcerpt?: boolean;\n /** Open-the-real-source action; the button renders only when provided. */\n onOpen?: (() => void) | undefined;\n /** Label for the open action (e.g. \"Open source\", \"Open web source\"). */\n openLabel?: string;\n}\n\n/**\n * The popover interior: icon + title + locator, excerpt blockquote, open\n * action. Exported so non-chip triggers (the inline superscript marker)\n * share the identical body.\n */\nexport function CitationPopoverBody({\n icon: Icon,\n label,\n locator,\n excerpt,\n clampExcerpt = false,\n onOpen,\n openLabel = \"Open source\",\n}: CitationPopoverBodyProps) {\n return (\n <div className=\"flex flex-col gap-2\">\n <div className=\"flex items-start gap-2\">\n <Icon\n className=\"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground\"\n aria-hidden\n />\n <div className=\"min-w-0\">\n <p className=\"truncate type-title text-foreground\">\n {label}\n </p>\n {locator && (\n <p className=\"type-secondary text-muted-foreground\">{locator}</p>\n )}\n </div>\n </div>\n {excerpt && (\n <blockquote className=\"flex gap-2 rounded-md bg-muted/60 p-2 type-secondary italic text-muted-foreground\">\n <QuoteIcon className=\"h-3 w-3 shrink-0\" aria-hidden />\n <span className={cn(\"not-italic\", clampExcerpt && \"line-clamp-6\")}>\n {excerpt}\n </span>\n </blockquote>\n )}\n {onOpen && (\n <button\n type=\"button\"\n onClick={onOpen}\n className=\"inline-flex items-center gap-1 self-start text-xs font-medium text-primary hover:underline\"\n >\n <ArrowUpRightIcon className=\"h-3 w-3\" aria-hidden />\n {openLabel}\n </button>\n )}\n </div>\n );\n}\n\nexport interface CitationChipProps extends CitationPopoverBodyProps {\n /** 1-based display number badge on the chip. Omit for unnumbered chips. */\n number?: number;\n /** Trailing inline suffix on the chip (e.g. \"p.7\"). */\n chipSuffix?: string | null;\n /** Native `title` attribute for the chip button. */\n chipTitle?: string;\n /** Appended to the chip button's classes (tailwind-merge: overrides win). */\n chipClassName?: string;\n}\n\nexport function CitationChip({\n number,\n chipSuffix,\n chipTitle,\n chipClassName,\n ...body\n}: CitationChipProps) {\n const { icon: Icon, label } = body;\n // Opening the source closes the excerpt — it never floats over the viewer\n // it just opened (verify-4 #33/#34).\n const [open, setOpen] = useState(false);\n const onOpen = body.onOpen\n ? () => {\n setOpen(false);\n body.onOpen?.();\n }\n : undefined;\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n title={chipTitle}\n className={cn(\n \"inline-flex max-w-[16rem] items-center gap-1 rounded-md border border-border bg-muted/50 px-1.5 py-0.5 text-xs text-foreground transition-colors hover:bg-accent\",\n chipClassName,\n )}\n >\n {number != null && (\n <span className=\"inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full bg-muted px-1 text-[0.65rem] font-medium leading-none text-muted-foreground\">\n {number}\n </span>\n )}\n <Icon className=\"h-3 w-3 shrink-0 text-muted-foreground\" aria-hidden />\n <span className=\"truncate\">{label}</span>\n {chipSuffix && (\n <span className=\"shrink-0 text-muted-foreground\">{chipSuffix}</span>\n )}\n </button>\n </PopoverTrigger>\n <PopoverContent sizing=\"content\" align=\"start\" className=\"p-3\">\n <CitationPopoverBody {...body} onOpen={onOpen} />\n </PopoverContent>\n </Popover>\n );\n}\n\nexport default CitationChip;\n","\"use client\";\n\n/**\n * ToolRail — the vertical tool rail of a canvas workspace (Acrobat, Figma): one icon-only control\n * per tool, one tool active, groups split by a hairline. `orientation=\"horizontal\"` makes the same\n * control a tool strip.\n *\n * `role=\"toolbar\"` with ONE tab stop (roving): Tab enters on the active tool (or the first\n * enabled one), the arrow keys of the rail's axis move focus (wrapping, skipping disabled tools),\n * Home/End jump, Enter/Space choose. Choosing the active tool again clears it when\n * `allowDeselect`. Every tool is named by its tooltip and `aria-label` (with its shortcut hint),\n * the active tool is `aria-pressed`. The rail has a fixed 28px control per tool, so activating or\n * hovering never moves anything.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"../tooltip\";\nimport { Button } from \"./controls\";\n\nexport interface ToolRailItem {\n id: string;\n label: string;\n icon: React.ComponentType<{ className?: string }>;\n /** Shown after the label in the tooltip (\"V\", \"Ctrl+Z\"). */\n shortcut?: string;\n disabled?: boolean;\n}\n\nexport interface ToolRailProps {\n /** Groups of tools; a hairline sits between groups. */\n groups: ReadonlyArray<ReadonlyArray<ToolRailItem>>;\n /** The active tool's id, or null for none. */\n value: string | null;\n onValueChange: (id: string | null, item: ToolRailItem) => void;\n orientation?: \"vertical\" | \"horizontal\";\n /** Choosing the active tool again sets `null` (a tool you can put down). Default false. */\n allowDeselect?: boolean;\n className?: string;\n \"aria-label\": string;\n}\n\nexport function ToolRail({\n groups,\n value,\n onValueChange,\n orientation = \"vertical\",\n allowDeselect = false,\n className,\n \"aria-label\": ariaLabel,\n}: ToolRailProps) {\n const flat = React.useMemo(() => groups.flat(), [groups]);\n const refs = React.useRef(new Map<string, HTMLButtonElement>());\n const enabled = flat.filter((t) => !t.disabled);\n const activeEnabled = enabled.find((t) => t.id === value);\n const [focusId, setFocusId] = React.useState<string | null>(null);\n const stopId = (focusId && enabled.some((t) => t.id === focusId) ? focusId : null) ?? activeEnabled?.id ?? enabled[0]?.id;\n const vertical = orientation === \"vertical\";\n\n const focusAt = (id: string | undefined) => {\n if (!id) return;\n setFocusId(id);\n refs.current.get(id)?.focus();\n };\n const onKeyDown = (e: React.KeyboardEvent, id: string) => {\n const at = enabled.findIndex((t) => t.id === id);\n const next = vertical ? \"ArrowDown\" : \"ArrowRight\";\n const prev = vertical ? \"ArrowUp\" : \"ArrowLeft\";\n if (e.key === next) { e.preventDefault(); focusAt(enabled[(at + 1) % enabled.length]?.id); }\n else if (e.key === prev) { e.preventDefault(); focusAt(enabled[(at - 1 + enabled.length) % enabled.length]?.id); }\n else if (e.key === \"Home\") { e.preventDefault(); focusAt(enabled[0]?.id); }\n else if (e.key === \"End\") { e.preventDefault(); focusAt(enabled[enabled.length - 1]?.id); }\n };\n\n return (\n <div\n role=\"toolbar\"\n aria-label={ariaLabel}\n aria-orientation={orientation}\n data-matrx-tool-rail=\"\"\n data-orientation={orientation}\n className={cn(\"flex w-fit shrink-0 items-center gap-1\", vertical ? \"flex-col\" : \"flex-row\", className)}\n >\n {groups.map((group, gi) => (\n <React.Fragment key={gi}>\n {gi > 0 ? (\n <div\n role=\"separator\"\n aria-orientation={vertical ? \"horizontal\" : \"vertical\"}\n className={cn(\"shrink-0 bg-border\", vertical ? \"my-0.5 h-px w-5\" : \"mx-0.5 h-5 w-px\")}\n />\n ) : null}\n {group.map((tool) => {\n const on = tool.id === value;\n const Icon = tool.icon;\n const name = tool.shortcut ? `${tool.label} (${tool.shortcut})` : tool.label;\n return (\n <Tooltip key={tool.id}>\n <TooltipTrigger asChild>\n <Button\n ref={(el: HTMLButtonElement | null) => {\n if (el) refs.current.set(tool.id, el);\n else refs.current.delete(tool.id);\n }}\n variant={on ? \"primary\" : \"quiet\"}\n icon={<Icon />}\n aria-label={name}\n pressed={on}\n disabled={tool.disabled}\n tabIndex={tool.id === stopId ? 0 : -1}\n data-tool-id={tool.id}\n onFocus={() => setFocusId(tool.id)}\n onKeyDown={(e) => onKeyDown(e, tool.id)}\n onClick={() => onValueChange(on && allowDeselect ? null : tool.id, tool)}\n />\n </TooltipTrigger>\n <TooltipContent side={vertical ? \"right\" : \"bottom\"} sideOffset={6}>\n {name}\n </TooltipContent>\n </Tooltip>\n );\n })}\n </React.Fragment>\n ))}\n </div>\n );\n}\n","\"use client\";\n\n/**\n * PageRangeInput — \"1-3, 5, 8-\" in one field, with the parse reported underneath.\n *\n * Validation offers, never blocks: the text is always the caller's to keep. `onChange` reports\n * the text AND its parse (`pages`, `issues`); an issue shows as one hint line and sets\n * `aria-invalid`, but nothing is refused. The hint line is always reserved (one line of height),\n * so showing a hint, a count or an error never shifts the layout. Grammar: `page-ranges.ts`.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { Input } from \"./doors\";\nimport { type ParsedPageRanges, formatPageRanges, parsePageRanges } from \"./page-ranges\";\n\nexport interface PageRangeInputProps {\n /** The typed text (controlled). */\n value: string;\n onChange: (text: string, parsed: ParsedPageRanges) => void;\n /** Pages in the document; ranges are checked against it and \"8-\" runs to it. */\n pageCount: number;\n \"aria-label\"?: string;\n id?: string;\n placeholder?: string;\n disabled?: boolean;\n className?: string;\n /** Pressed Enter on a range that parsed clean. */\n onSubmit?: (parsed: ParsedPageRanges) => void;\n}\n\nexport function PageRangeInput({\n value,\n onChange,\n pageCount,\n placeholder = \"e.g. 1-3, 5, 8-\",\n disabled,\n className,\n onSubmit,\n id,\n \"aria-label\": ariaLabel = \"Page range\",\n}: PageRangeInputProps) {\n const autoId = React.useId();\n const hintId = `${id ?? autoId}-hint`;\n const parsed = React.useMemo(() => parsePageRanges(value, pageCount), [value, pageCount]);\n const first = parsed.issues[0];\n const hint = parsed.empty\n ? `${pageCount} page${pageCount === 1 ? \"\" : \"s\"}`\n : first\n ? first.hint\n : `${parsed.pages.length} page${parsed.pages.length === 1 ? \"\" : \"s\"}: ${formatPageRanges(parsed.pages)}`;\n return (\n <div className={cn(\"flex min-w-0 flex-col gap-1\", className)} data-matrx-page-range-input=\"\">\n <Input\n id={id}\n value={value}\n disabled={disabled}\n placeholder={placeholder}\n aria-label={ariaLabel}\n aria-invalid={first ? true : undefined}\n aria-describedby={hintId}\n autoComplete=\"off\"\n spellCheck={false}\n inputMode=\"text\"\n onChange={(e) => onChange(e.target.value, parsePageRanges(e.target.value, pageCount))}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" && parsed.valid) onSubmit?.(parsed);\n }}\n />\n <p\n id={hintId}\n role={first ? \"alert\" : \"status\"}\n data-state={first ? \"issue\" : parsed.empty ? \"idle\" : \"ok\"}\n className={cn(\"min-h-4 truncate text-xs leading-4\", first ? \"text-destructive\" : \"text-muted-foreground\")}\n >\n {hint}\n </p>\n </div>\n );\n}\n","/**\n * Page ranges — \"1-3, 5, 8-\" in, the pages out. Pure; the one parser behind `PageRangeInput`\n * and every PDF tool that takes a range (Split, Extract, Delete, Rotate, Print).\n *\n * Grammar (spaces anywhere are ignored): a token is `N`, `A-B`, `A-` (to the last page) or\n * `-B` (from the first). Tokens are separated by `,` or `;`. `end` and `last` mean the last\n * page. VALIDATION OFFERS, NEVER BLOCKS: a bad token is reported in `issues` with a hint and\n * skipped, the good tokens still count, and a reversed range (`5-3`) is read as `3-5` with a\n * note. Page numbers are 1-based.\n */\n\nexport type PageRangeIssueKind = \"syntax\" | \"out-of-range\" | \"reversed\" | \"zero\";\n\nexport interface PageRangeIssue {\n /** The token as typed (trimmed). */\n token: string;\n kind: PageRangeIssueKind;\n /** A sentence that says what to do, ready to show. */\n hint: string;\n}\n\nexport interface ParsedPageRanges {\n /** Every selected page, ascending, no repeats. */\n pages: number[];\n /** The same pages as ascending, non-touching [from, to] spans. */\n spans: Array<[number, number]>;\n issues: PageRangeIssue[];\n /** True when the text named at least one page and raised no issue. */\n valid: boolean;\n /** True when the text is empty (nothing typed yet — not an error). */\n empty: boolean;\n}\n\nconst WORD_END = /^(end|last)$/i;\n\nfunction num(part: string, pageCount: number): number | null {\n const p = part.trim();\n if (WORD_END.test(p)) return pageCount;\n if (!/^\\d+$/.test(p)) return null;\n return Number.parseInt(p, 10);\n}\n\nexport function spansOf(pages: readonly number[]): Array<[number, number]> {\n const out: Array<[number, number]> = [];\n for (const p of pages) {\n const last = out[out.length - 1];\n if (last && p === last[1] + 1) last[1] = p;\n else out.push([p, p]);\n }\n return out;\n}\n\n/** Parse `text` against a document of `pageCount` pages. */\nexport function parsePageRanges(text: string, pageCount: number): ParsedPageRanges {\n const issues: PageRangeIssue[] = [];\n const picked = new Set<number>();\n const trimmed = text.trim();\n if (trimmed === \"\") return { pages: [], spans: [], issues, valid: false, empty: true };\n const count = Math.max(0, Math.trunc(pageCount));\n\n for (const raw of trimmed.split(/[,;]/)) {\n const token = raw.trim();\n if (token === \"\") continue;\n const dash = token.indexOf(\"-\");\n let from: number | null;\n let to: number | null;\n if (dash === -1) {\n from = to = num(token, count);\n } else {\n const a = token.slice(0, dash);\n const b = token.slice(dash + 1);\n from = a.trim() === \"\" ? 1 : num(a, count);\n to = b.trim() === \"\" ? count : num(b, count);\n if (a.trim() === \"\" && b.trim() === \"\") from = to = null;\n }\n if (from === null || to === null) {\n issues.push({ token, kind: \"syntax\", hint: `“${token}” is not a page or range. Use numbers like 1-3, 5, 8-.` });\n continue;\n }\n if (from === 0 || to === 0) {\n issues.push({ token, kind: \"zero\", hint: `Pages start at 1; “${token}” was skipped.` });\n continue;\n }\n if (from > to) {\n issues.push({ token, kind: \"reversed\", hint: `“${token}” runs backwards; read as ${to}-${from}.` });\n [from, to] = [to, from];\n }\n if (from > count) {\n issues.push({ token, kind: \"out-of-range\", hint: `This file has ${count} page${count === 1 ? \"\" : \"s\"}; “${token}” was skipped.` });\n continue;\n }\n if (to > count) {\n issues.push({ token, kind: \"out-of-range\", hint: `This file has ${count} page${count === 1 ? \"\" : \"s\"}; “${token}” was cut to ${from}-${count}.` });\n to = count;\n }\n for (let p = from; p <= to; p++) picked.add(p);\n }\n const pages = [...picked].sort((x, y) => x - y);\n return { pages, spans: spansOf(pages), issues, valid: pages.length > 0 && issues.length === 0, empty: false };\n}\n\n/** The shortest text that parses back to `pages` (\"1-3, 5, 8-12\"). An open end is not written. */\nexport function formatPageRanges(pages: readonly number[]): string {\n const sorted = [...new Set(pages.filter((p) => Number.isInteger(p) && p > 0))].sort((a, b) => a - b);\n return spansOf(sorted)\n .map(([a, b]) => (a === b ? String(a) : b === a + 1 ? `${a}, ${b}` : `${a}-${b}`))\n .join(\", \");\n}\n","\"use client\";\n\n/**\n * OpacitySlider — a 0..1 opacity as a slider plus a percent field, one value, two ways to set it.\n * The value is a fraction (0-1) in and out; the field shows whole percent and commits on\n * blur/Enter (a text draft while typing, so it can be emptied without painting \"0\"). Arrow keys on\n * the slider step 1% (Shift: 10%). The percent field has a fixed width, so a change never shifts\n * the row.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { Slider } from \"../slider\";\nimport { Input } from \"./doors\";\n\nexport interface OpacitySliderProps {\n /** 0-1. */\n value: number;\n onChange: (value: number) => void;\n min?: number;\n max?: number;\n disabled?: boolean;\n className?: string;\n \"aria-label\"?: string;\n}\n\nconst clamp = (n: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, n));\nconst toPercent = (v: number) => Math.round(v * 100);\n\nexport function OpacitySlider({\n value,\n onChange,\n min = 0,\n max = 1,\n disabled,\n className,\n \"aria-label\": ariaLabel = \"Opacity\",\n}: OpacitySliderProps) {\n const [draft, setDraft] = React.useState<string | null>(null);\n const percent = toPercent(clamp(value, min, max));\n const commit = () => {\n if (draft !== null && draft.trim() !== \"\" && Number.isFinite(Number(draft))) {\n onChange(clamp(Math.round(Number(draft)) / 100, min, max));\n }\n setDraft(null);\n };\n return (\n <div className={cn(\"flex min-w-0 items-center gap-2\", className)} data-matrx-opacity-slider=\"\">\n <Slider\n className=\"min-w-0 flex-1\"\n aria-label={ariaLabel}\n {...(disabled !== undefined ? { disabled } : {})}\n min={toPercent(min)}\n max={toPercent(max)}\n step={1}\n value={[percent]}\n onValueChange={([v]) => onChange(clamp((v ?? 0) / 100, min, max))}\n />\n {/* The percent field fits its 4rem slot: a field's 8rem floor (controls.css \"A field never\n collapses\") is lowered here through its own knob, or the field spilled over the next control. */}\n <div className=\"flex w-16 shrink-0 items-center gap-1\" style={{ [\"--matrx-control-field-min\" as string]: \"0px\" }}>\n <Input\n numeric\n inputMode=\"numeric\"\n size={3}\n className=\"w-full\"\n aria-label={`${ariaLabel} percent`}\n disabled={disabled}\n value={draft ?? String(percent)}\n onFocus={(e) => e.currentTarget.select()}\n onChange={(e) => setDraft(e.target.value.replace(/[^\\d]/g, \"\").slice(0, 3))}\n onBlur={commit}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") commit();\n if (e.key === \"Escape\") setDraft(null);\n }}\n />\n <span aria-hidden className=\"text-xs text-muted-foreground\">%</span>\n </div>\n </div>\n );\n}\n","\"use client\";\n\n/**\n * ColorSwatchRow — a row of color swatches, one chosen (a highlight color, a pen, a stamp).\n * `role=\"radiogroup\"` with a roving tab stop: Tab enters on the chosen swatch, Left/Right (and\n * Up/Down) move and choose, Home/End jump. The chosen swatch shows a ring plus a check, so it\n * never reads by color alone, and the ring is drawn inside the swatch's own box (no layout\n * shift). The swatch color itself is data the caller passes (an annotation palette), the only\n * place a literal color appears; everything around it is a token.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { RadixCheckIcon } from \"../icons\";\n\nexport interface ColorSwatch {\n /** Any CSS color. */\n value: string;\n /** The swatch's spoken name (\"Yellow\"). */\n label: string;\n}\n\nexport interface ColorSwatchRowProps {\n colors: readonly ColorSwatch[];\n /** The chosen color's `value` (compared case-insensitively); none chosen when it matches nothing. */\n value: string | null | undefined;\n onChange: (value: string, swatch: ColorSwatch) => void;\n disabled?: boolean;\n className?: string;\n \"aria-label\"?: string;\n}\n\nexport function ColorSwatchRow({\n colors,\n value,\n onChange,\n disabled,\n className,\n \"aria-label\": ariaLabel = \"Color\",\n}: ColorSwatchRowProps) {\n const refs = React.useRef<Array<HTMLButtonElement | null>>([]);\n const chosen = colors.findIndex((c) => c.value.toLowerCase() === (value ?? \"\").toLowerCase());\n const stop = chosen >= 0 ? chosen : 0;\n const move = (to: number) => {\n const i = (to + colors.length) % colors.length;\n const c = colors[i];\n if (!c) return;\n refs.current[i]?.focus();\n onChange(c.value, c);\n };\n return (\n <div\n role=\"radiogroup\"\n aria-label={ariaLabel}\n aria-disabled={disabled || undefined}\n className={cn(\"flex flex-wrap items-center gap-1\", className)}\n data-matrx-color-swatch-row=\"\"\n >\n {colors.map((c, i) => {\n const on = i === chosen;\n return (\n <button\n key={`${c.value}-${i}`}\n ref={(el) => {\n refs.current[i] = el;\n }}\n type=\"button\"\n role=\"radio\"\n aria-checked={on}\n aria-label={c.label}\n title={c.label}\n disabled={disabled}\n tabIndex={i === stop ? 0 : -1}\n data-state={on ? \"checked\" : \"unchecked\"}\n onClick={() => onChange(c.value, c)}\n onKeyDown={(e) => {\n const k = e.key;\n if (k === \"ArrowRight\" || k === \"ArrowDown\") { e.preventDefault(); move(i + 1); }\n else if (k === \"ArrowLeft\" || k === \"ArrowUp\") { e.preventDefault(); move(i - 1); }\n else if (k === \"Home\") { e.preventDefault(); move(0); }\n else if (k === \"End\") { e.preventDefault(); move(colors.length - 1); }\n }}\n className={cn(\n \"relative inline-flex size-6 shrink-0 items-center justify-center rounded-full border border-border outline-none\",\n \"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background\",\n \"disabled:cursor-not-allowed disabled:border-dashed\",\n on && \"ring-2 ring-foreground ring-offset-1 ring-offset-background\",\n )}\n style={{ backgroundColor: c.value }}\n >\n {on ? <RadixCheckIcon className=\"size-3 mix-blend-difference text-white\" /> : null}\n </button>\n );\n })}\n </div>\n );\n}\n","\"use client\";\n\n/**\n * AnchoredToolbar — a floating toolbar anchored to a rectangle (a text selection, a picked\n * region, a selected annotation). It is a Popover whose anchor is the rect, so it is portaled and\n * positioned fixed: it never takes space in the page and never moves it. It sits above the rect\n * and flips below it (and slides along the edge) when there is no room; a rect scrolled out of the\n * viewport is left to the host to close (`onOpenChange`). Focus stays where it was (a selection\n * must not be lost by showing its toolbar); Escape and an outside press call `onOpenChange(false)`.\n *\n * `rect` is in viewport coordinates (`getBoundingClientRect()` / `Range.getBoundingClientRect()`).\n * Put an `OverflowToolbar` (or any row of controls) in `children`.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { Popover, PopoverAnchor, PopoverContent } from \"../popover\";\n\nexport interface AnchorRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport interface AnchoredToolbarProps {\n open: boolean;\n onOpenChange?: (open: boolean) => void;\n /** The selection rect, viewport coordinates. Null closes the toolbar. */\n rect: AnchorRect | DOMRectReadOnly | null;\n /** Preferred side; it flips when it does not fit. Default \"top\". */\n side?: \"top\" | \"bottom\";\n align?: \"start\" | \"center\" | \"end\";\n /** Gap between the rect and the toolbar, px. Default 8. */\n offset?: number;\n className?: string;\n \"aria-label\": string;\n children: React.ReactNode;\n}\n\n/** A virtual element for the popper: the rect, re-read on every position pass. */\nfunction virtualFor(rect: AnchorRect) {\n return {\n getBoundingClientRect: () =>\n ({\n x: rect.x, y: rect.y, left: rect.x, top: rect.y,\n width: rect.width, height: rect.height,\n right: rect.x + rect.width, bottom: rect.y + rect.height,\n toJSON: () => ({}),\n }) as DOMRect,\n };\n}\n\nexport function AnchoredToolbar({\n open,\n onOpenChange,\n rect,\n side = \"top\",\n align = \"center\",\n offset = 8,\n className,\n \"aria-label\": ariaLabel,\n children,\n}: AnchoredToolbarProps) {\n // A fresh virtual element whenever the rect's numbers change: Radix re-measures on a new anchor.\n const x = rect?.x ?? 0, y = rect?.y ?? 0, w = rect?.width ?? 0, h = rect?.height ?? 0;\n const virtualRef = React.useMemo(\n () => ({ current: virtualFor({ x, y, width: w, height: h }) }),\n [x, y, w, h],\n );\n const visible = open && rect !== null;\n return (\n <Popover open={visible} {...(onOpenChange ? { onOpenChange } : {})}>\n <PopoverAnchor virtualRef={virtualRef} />\n <PopoverContent\n role=\"toolbar\"\n aria-label={ariaLabel}\n data-matrx-anchored-toolbar=\"\"\n side={side}\n align={align}\n sideOffset={offset}\n padding=\"xs\"\n animated={false}\n className={cn(\"w-auto min-w-0 max-w-[calc(100vw-1rem)] overflow-visible\", className)}\n collisionPadding={8}\n avoidCollisions\n onOpenAutoFocus={(e) => e.preventDefault()}\n onCloseAutoFocus={(e) => e.preventDefault()}\n >\n {children}\n </PopoverContent>\n </Popover>\n );\n}\n","\"use client\";\n\n/**\n * IconSelect — an icon-only select: a 28px circle that opens either a plain select or (searchable) a\n * popover list with a filter box. Moved from matrx-frontend `components/official/IconSelect`\n * (wave 3, 2026-10-22).\n *\n * Navigation items MUST set `href`: Cmd/Ctrl/Shift/Alt or middle click then opens it in a new tab\n * through kit's one outbound door instead of choosing the item.\n *\n * The trigger forwards its ref and spreads the rest on purpose: `PopoverTrigger asChild` (Radix Slot)\n * clones its onClick / aria-expanded / data-state / ref onto it. Without both, the popover can never\n * open (found 2026-09-23); `icon-select.test.tsx` pins it.\n */\n\nimport * as React from \"react\";\n\nimport { openOutbound } from \"@ai-matrx/kit/outbound\";\n\nimport { cn } from \"../cn\";\nimport { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from \"../command\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../popover\";\nimport { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger } from \"../select\";\nimport { Button } from \"./controls\";\n\nexport interface IconSelectItem {\n id: string;\n label: string;\n icon?: React.ReactNode;\n value: string;\n /** Set on navigation items: a modified or middle click opens this URL in a new tab instead of choosing. */\n href?: string;\n}\n\nexport interface IconSelectProps {\n items: IconSelectItem[];\n icon?: React.ReactNode;\n value?: string;\n onValueChange?: (value: string) => void;\n disabled?: boolean;\n /** A searchable popover list instead of a plain select. */\n searchable?: boolean;\n searchPlaceholder?: string;\n /** Accessible name for the icon-only trigger (required in spirit: the trigger has no text). */\n ariaLabel?: string;\n /** The trigger's size: `default` 28px; `touch` 40px on a phone and 32px from `sm` up. */\n size?: \"default\" | \"touch\";\n /** Where the trigger sits (margin, flex); never how it looks. */\n className?: string;\n}\n\ninterface ClickLike {\n metaKey?: boolean;\n ctrlKey?: boolean;\n shiftKey?: boolean;\n altKey?: boolean;\n button?: number;\n}\n\n/** A click that asks for a new tab: a modifier, or the middle button. */\nfunction wantsNewTab(e: ClickLike): boolean {\n return Boolean(e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button === 1);\n}\n\nconst TRIGGER_SIZE = {\n default: \"\",\n touch: \"!h-10 !w-10 sm:!h-8 sm:!w-8\",\n} as const;\n\nconst TRIGGER_FACE = \"h-7 w-7 justify-center border-none bg-muted px-0 focus:outline-none focus:ring-0\";\n\nconst IconSelectTrigger = React.forwardRef<\n HTMLButtonElement,\n Pick<IconSelectProps, \"icon\" | \"disabled\" | \"ariaLabel\" | \"size\"> & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"children\">\n>(function IconSelectTrigger({ icon, disabled, ariaLabel, size = \"default\", className, ...rest }, ref) {\n return (\n <Button\n ref={ref}\n variant=\"quiet\"\n disabled={disabled}\n icon={icon}\n className={cn(TRIGGER_SIZE[size], className)}\n {...rest}\n aria-label={ariaLabel ?? rest[\"aria-label\"] ?? \"Choose an option\"}\n />\n );\n});\n\nexport function IconSelect({\n items,\n icon,\n value,\n onValueChange,\n disabled = false,\n searchable = false,\n searchPlaceholder = \"Search...\",\n ariaLabel = \"Choose an option\",\n size = \"default\",\n className,\n}: IconSelectProps) {\n const [open, setOpen] = React.useState(false);\n // cmdk's onSelect does not receive the mouse event, so a modified click is remembered here.\n const skipSelectRef = React.useRef(false);\n\n if (searchable) {\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <IconSelectTrigger icon={icon} disabled={disabled} ariaLabel={ariaLabel} size={size} className={className} />\n </PopoverTrigger>\n <PopoverContent sizing=\"content\" className=\"p-0\" align=\"start\">\n <Command>\n <CommandInput placeholder={searchPlaceholder} className=\"h-9 text-sm\" />\n <CommandList>\n <CommandEmpty>No results found.</CommandEmpty>\n <CommandGroup className=\"max-h-72 overflow-auto\">\n {items.map((item) => (\n <CommandItem\n key={item.id}\n value={item.label}\n onPointerDown={(e) => {\n if (item.href && wantsNewTab(e)) {\n skipSelectRef.current = true;\n e.preventDefault();\n openOutbound(item.href, \"_blank\", \"noopener\");\n setOpen(false);\n }\n }}\n onSelect={() => {\n if (skipSelectRef.current) {\n skipSelectRef.current = false;\n return;\n }\n onValueChange?.(item.value);\n setOpen(false);\n }}\n >\n <div className=\"flex items-center\">\n {item.icon && <span className=\"mr-2\">{item.icon}</span>}\n {item.label}\n </div>\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n );\n }\n\n return (\n <Select {...(value === undefined ? {} : { value })} {...(onValueChange ? { onValueChange } : {})} disabled={disabled}>\n <SelectTrigger\n aria-label={ariaLabel}\n className={cn(TRIGGER_FACE, TRIGGER_SIZE[size], className)}\n hideArrow={true}\n >\n {icon}\n </SelectTrigger>\n <SelectContent>\n <SelectGroup>\n {items.map((item) => (\n <SelectItem\n key={item.id}\n value={item.value}\n onPointerDown={(e) => {\n if (item.href && wantsNewTab(e)) {\n e.preventDefault();\n openOutbound(item.href, \"_blank\", \"noopener\");\n }\n }}\n >\n <div className=\"flex items-center\">\n {item.icon && <span className=\"mr-2\">{item.icon}</span>}\n {item.label}\n </div>\n </SelectItem>\n ))}\n </SelectGroup>\n </SelectContent>\n </Select>\n );\n}\n","\"use client\";\n\n/**\n * AdvancedCollapsible — a bordered collapsible section with an icon + title header and, when open, an\n * action row: save, reset (both confirm on the button), copy the content, and full screen.\n * Moved from matrx-frontend `components/official/AdvancedCollapsible` (wave 3, 2026-10-22).\n *\n * - Copy goes through kit's one clipboard door (a toast on success, the manual-copy dialog when the\n * browser refuses); no host copy component.\n * - Full screen is the package Dialog at `size=\"full\"`, with the same actions in its header; the app's\n * FullScreenOverlay is not needed.\n * - Glyph colors are glyph tones (info / warning / primary), not palette classes.\n */\n\nimport * as React from \"react\";\n\nimport { copyText } from \"@ai-matrx/kit/clipboard\";\nimport { openClipboardFallback } from \"@ai-matrx/kit/clipboard-fallback-opener\";\nimport { toast } from \"@ai-matrx/kit/notify\";\n\nimport { cn } from \"../cn\";\nimport { Collapsible, CollapsibleContent, CollapsibleTrigger } from \"../collapsible\";\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from \"../dialog\";\nimport { ChevronDownIcon, CopyIcon, Maximize2Icon, Minimize2Icon, RefreshCwIcon, SaveIcon } from \"../icons\";\nimport { IconButton } from \"../icon-button\";\nimport { ActionFeedbackButton } from \"./action-feedback-button\";\n\nexport interface AdvancedCollapsibleProps {\n icon: React.ReactNode;\n title: React.ReactNode;\n initialOpen?: boolean;\n onStateChange?: (open: boolean) => void;\n children: React.ReactNode;\n /** Where the section sits (margin, width); never how it looks. */\n className?: string;\n onSave?: () => void;\n onReset?: () => void;\n /** Called after the content was copied (the copy itself always happens). */\n onCopy?: () => void;\n saveTooltip?: string;\n resetTooltip?: string;\n copyTooltip?: string;\n fullscreenTooltip?: string;\n fullscreenExitTooltip?: string;\n fullScreenTitle?: string;\n fullScreenDescription?: string;\n}\n\nexport function AdvancedCollapsible({\n icon,\n title,\n initialOpen = true,\n onStateChange,\n children,\n className,\n onSave,\n onReset,\n onCopy,\n saveTooltip = \"Save\",\n resetTooltip = \"Reset\",\n copyTooltip = \"Copy to clipboard\",\n fullscreenTooltip = \"Expand to full screen\",\n fullscreenExitTooltip = \"Exit full screen\",\n fullScreenTitle,\n fullScreenDescription,\n}: AdvancedCollapsibleProps) {\n const [isOpen, setIsOpen] = React.useState(initialOpen);\n const [isFullScreen, setIsFullScreen] = React.useState(false);\n const contentRef = React.useRef<HTMLDivElement>(null);\n const fullRef = React.useRef<HTMLDivElement>(null);\n\n const handleOpenChange = (open: boolean) => {\n setIsOpen(open);\n onStateChange?.(open);\n };\n\n const handleCopy = async () => {\n const box = isFullScreen ? fullRef.current : contentRef.current;\n // innerText keeps the visible line breaks; a DOM without it (a test runner) reads textContent.\n const text = box ? (box.innerText ?? box.textContent ?? \"\") : \"\";\n if (!text) return;\n const landed = await copyText(text, {\n successMessage: \"Copied to clipboard\",\n notify: (message, kind) => {\n if (kind === \"success\") toast.success(message);\n },\n });\n // A copy that did not land opens the manual-copy dialog, which shows the text.\n if (!landed) void openClipboardFallback(text);\n else onCopy?.();\n };\n\n const actions = (\n <div className=\"flex items-center justify-end gap-2\">\n {onSave && (\n <ActionFeedbackButton\n icon={<SaveIcon />}\n glyphTone=\"info\"\n tooltip={saveTooltip}\n successTooltip=\"Saved!\"\n onClick={onSave}\n />\n )}\n {onReset && (\n <ActionFeedbackButton\n icon={<RefreshCwIcon />}\n glyphTone=\"warning\"\n tooltip={resetTooltip}\n successTooltip=\"Reset!\"\n onClick={onReset}\n />\n )}\n <IconButton icon={CopyIcon} tooltip={copyTooltip} onClick={() => void handleCopy()} />\n <IconButton\n icon={isFullScreen ? Minimize2Icon : Maximize2Icon}\n glyphTone=\"primary\"\n tooltip={isFullScreen ? fullscreenExitTooltip : fullscreenTooltip}\n onClick={() => setIsFullScreen(!isFullScreen)}\n />\n </div>\n );\n\n const heading = typeof title === \"string\" ? title : \"Content\";\n\n return (\n <>\n <Collapsible\n open={isOpen}\n onOpenChange={handleOpenChange}\n className={cn(\"w-full rounded-xl border border-border shadow-sm\", className)}\n >\n <CollapsibleTrigger className=\"relative flex w-full items-center justify-between rounded-t-xl px-4 py-3 font-medium hover:bg-muted\">\n <div className=\"flex items-center gap-2\">\n {icon}\n {typeof title === \"string\" ? <span>{title}</span> : title}\n </div>\n <ChevronDownIcon\n className={cn(\n \"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-(--matrx-motion-duration-base) motion-reduce:transition-none\",\n isOpen && \"rotate-180\",\n )}\n />\n </CollapsibleTrigger>\n <CollapsibleContent>\n <div className=\"relative\">\n <div className=\"absolute left-8 right-8 top-0 h-px bg-border\" />\n <div ref={contentRef} className=\"p-4\">\n {children}\n </div>\n <div className=\"mb-1 mr-1 mt-2\">{actions}</div>\n </div>\n </CollapsibleContent>\n </Collapsible>\n\n <Dialog open={isFullScreen} onOpenChange={setIsFullScreen}>\n <DialogContent size=\"full\" height=\"tall\">\n <DialogHeader>\n <DialogTitle>{fullScreenTitle || heading}</DialogTitle>\n {fullScreenDescription ? <DialogDescription>{fullScreenDescription}</DialogDescription> : null}\n </DialogHeader>\n {actions}\n <div ref={fullRef} className=\"min-h-0 flex-1 overflow-auto p-4\">\n {children}\n </div>\n </DialogContent>\n </Dialog>\n </>\n );\n}\n","\"use client\";\n\n/**\n * Collapsible — Radix's, with the one thing Radix does not ship: the open/close\n * transition.\n *\n * THE ROOT RENDERS UNCONDITIONALLY — no mount gate. The matrx-frontend\n * original carried the note that earned this line: a wrapper used to defer\n * rendering until after hydration on the theory that \"Radix generates dynamic\n * aria-controls ids that differ between SSR and client\". That was false —\n * Radix ids come from React's SSR-stable `useId` — and the gate was actively\n * harmful, because a Collapsible's Trigger wraps ALWAYS-VISIBLE content, so\n * `return null` deleted it from SSR and from the first client paint.\n *\n * THE TRANSITION IS PACKAGE-OWNED (census row 19f, the tail of 19c). Until\n * 0.9.0 this file was a bare re-export and the package shipped NO transition,\n * so every consumer invented its own — and two of them invented it wrong.\n * `matrx-collapsible.tsx` and `enhanced-collapsible.tsx` put\n * `animate-accordion-down`/`-up` on a COLLAPSIBLE panel: those keyframes\n * interpolate to `--radix-ACCORDION-content-height`, a variable Radix never\n * publishes on a collapsible, so they had never animated once — silently, with\n * no error, for as long as they existed. Six other matrx-frontend components\n * used host-only `animate-slide-down`/`-up` keyframes that WERE keyed\n * correctly — and worked in exactly one app in the fleet, because the\n * keyframes lived in that app's `globals.css`. Both shapes are the same C26\n * failure: a component whose motion depends on a contract the host has to\n * happen to hold. `.matrx-collapsible-content` in `styles.css` ends it — keyed\n * off Radix's runtime `--radix-collapsible-content-height`, honoring\n * `prefers-reduced-motion`, shipped in the tarball.\n *\n * Nothing else here is restyled: the trigger and the panel's own padding are\n * the host's to dress, and every fork agreed on that. Unlike `AccordionContent`\n * this component does NOT wrap children in a padding div — collapsibles in the\n * fleet pad their own bodies, and inserting a box would move every one of them.\n */\n\nimport * as CollapsiblePrimitive from \"@radix-ui/react-collapsible\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nconst Collapsible = CollapsiblePrimitive.Root;\nconst CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;\n\nexport interface CollapsibleContentProps\n extends React.ComponentPropsWithoutRef<\n typeof CollapsiblePrimitive.CollapsibleContent\n > {\n /**\n * Animate the height on open/close. Default `true`.\n *\n * Pass `false` for the rare panel that must not clip or must not move: the\n * animated panel carries `overflow-hidden` (a height transition without it\n * spills the body over whatever is below), so a panel with a child that\n * deliberately overflows its bounds — a non-portalled popover, a sticky\n * column header — opts out here rather than fighting the class. Opting out\n * gives you bare Radix: instant open, no clipping, no keyframes.\n *\n * `prefers-reduced-motion` is NOT this prop's job; the stylesheet already\n * drops the animation for those users while keeping the clipping.\n */\n animated?: boolean;\n}\n\nconst CollapsibleContent = React.forwardRef<\n React.ComponentRef<typeof CollapsiblePrimitive.CollapsibleContent>,\n CollapsibleContentProps\n>(({ className, animated = true, ...props }, ref) => (\n <CollapsiblePrimitive.CollapsibleContent\n ref={ref}\n data-slot=\"collapsible-content\"\n className={cn(\n animated && \"matrx-collapsible-content overflow-hidden\",\n className,\n )}\n {...props}\n />\n));\nCollapsibleContent.displayName = \"CollapsibleContent\";\n\nexport { Collapsible, CollapsibleContent, CollapsibleTrigger };\n","\"use client\";\n\n/**\n * Dialog — the modal surface, carrying every ruling the host forks paid for.\n *\n * Four hosts shipped four dialogs. Three were the stock shadcn body: a\n * fixed-size centered card with `overflow: visible`. matrx-frontend's had been\n * hardened, incident by incident, and those hardenings are the reason this\n * component belongs in the package rather than being copied a fifth time:\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 — Radix ids come from React's SSR-stable `useId` — and it deleted\n * the always-visible Trigger from SSR and the first client paint.\n *\n * 2. THE DIALOG IS CLAMPED TO THE VIEWPORT AND SCROLLS INSIDE ITSELF. Proven\n * live: an admin \"Create Category\" dialog rendered 851px tall in a 657px\n * viewport with `overflow-y: visible`, so its Create button sat below the\n * fold, unreachable. The only way out was a backdrop click — which\n * dismisses WITHOUT writing, and is indistinguishable from a silent save\n * failure. `max-h-[85dvh] overflow-y-auto` is the cap.\n *\n * 3. THE PRIMARY ACTION IS ALWAYS PRESSABLE — AND NEVER ON TOP OF THE BODY.\n * `DialogFooter` is sticky and bleeds to the card's edges using\n * `--dialog-pad`. Until 0.11.3 that bleed was a NEGATIVE BLOCK MARGIN,\n * which sticky clamps: the footer was dragged up over the row above it by\n * `--dialog-pad` minus the card gap. The card now RESERVES the footer's\n * block size instead (`.matrx-dialog-card` in `styles.css` hands its bottom\n * padding to the footer), so scrolled content never shows through beneath\n * the actions AND the footer never covers the row above it. Outside a\n * DialogContent both variables are unset, the padding falls back to `0px`,\n * and the footer is the plain row it always was.\n *\n * 4. ON MOBILE THE SAME DIALOG IS A BOTTOM SHEET — full width, bottom\n * anchored, height-capped, internally scrollable, safe-area padded. Opt out\n * with `mobileSheet={false}` only for the rare surface that must stay\n * centered (a tiny spinner). The sheet geometry is re-asserted AFTER the\n * caller's className so a desktop `max-w-2xl` cannot un-fullscreen it.\n *\n * 5. AN UNTITLED DIALOG IS STILL ACCESSIBLE. Radix warns (correctly) that\n * every dialog needs a title; rather than let hosts ship the warning, a\n * visually-hidden title is injected when the tree has none, and\n * `aria-describedby` is dropped when there is no description rather than\n * pointing at nothing.\n *\n * 6. ON DESKTOP A DIALOG IS A WINDOW, NOT A WALL (0.38.0, Arman 2026-09-23:\n * \"none of the built-in page ai integrations are accessible because the\n * page is totally blocked\"). Unless the caller passes `modal`, a desktop\n * dialog does not block the page: no overlay, the page, the Agents menu,\n * the assist dock and right-click AI stay usable beside it. It behaves like\n * a window: a click outside never closes it (`dismissOnOutsideClick` opts a\n * quick picker back in), Escape closes it only while focus is inside it\n * (Escape in the page belongs to the page), and its `DialogHeader` drags\n * it, clamped on screen, double-click to recenter. On a phone it stays the\n * blocking bottom sheet — nothing useful sits behind a sheet. Confirmations\n * are `AlertDialog`, a different component, and stay blocking. This is a\n * LIGHT window: the host's heavy window manager (tray, persistence) is a\n * separate system and must not be pulled into every dialog.\n *\n * SEAM INVERSIONS. The host original resolved its portal target through\n * app-shaped hooks (a popped-out window-panel body). Here that is the\n * package's `PortalContainerProvider` seam, with an explicit `container` prop\n * keeping top priority. And DialogContent PROVIDES that seam to its own\n * children, so a Popover or menu opened inside a dialog portals INTO the\n * dialog — staying inside the scroll shard, where its wheel events work.\n * `useDialogContainer` exposes the same element for host code that needs it.\n */\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport * as VisuallyHidden from \"@radix-ui/react-visually-hidden\";\nimport { treeContainsComponent } from \"@ai-matrx/kit/react-tree\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport {\n MOTION_BOTTOM_SHEET,\n MOTION_DIALOG,\n MOTION_OVERLAY,\n} from \"./motion\";\nimport { CloseRow, CloseSlotProvider, HeaderWithClose, useCloseSlot } from \"./close-slot\";\nimport { usePortalContainer, PortalContainerProvider } from \"./portal-container\";\nimport { useLook } from \"./look\";\nimport {\n RadixDialogModalProvider,\n useRadixDialogModal,\n} from \"./radix-dialog-modal-context\";\nimport { useIsMobile } from \"./use-is-mobile\";\nimport { announceLayerFront, LAYER_FRONT_EVENT, type LayerFrontDetail } from \"./layer-front\";\nimport { clampRectToViewport, readViewport, useDragMove } from \"./window-drag\";\nimport { keepFloatingLayersInside, useModalLayer } from \"./floating-layer\";\nimport { keepMovedFocus } from \"./focus-return\";\n\n/**\n * True when the dialog is a window because the caller said nothing about\n * modality (rule 6), false when the caller passed `modal={false}` itself.\n * The two sit on different layers: a default window sits WITH the other\n * layers it was opened from (z-10000 — a dialog opened from a menu, a popover\n * or a host window must never appear behind its opener), while an explicit\n * `modal={false}` keeps the older coexistence contract below the host's window\n * manager (z-900).\n */\nconst DialogWindowedByDefaultContext = React.createContext(false);\n\nconst Dialog = ({\n children,\n ...props\n}: React.ComponentPropsWithoutRef<typeof DialogPrimitive.Root>) => {\n const isMobile = useIsMobile();\n // THE LOOK (look.tsx): in a desktop scope every dialog is a macOS sheet, modal over a dimmed\n // window, whatever `modal` says (the desktop standard's Dialog).\n const desktopLook = useLook() === \"desktop\";\n // A window on desktop, a blocking sheet on a phone; `modal` forces either (rule 6).\n const modal = desktopLook || (props.modal ?? isMobile);\n return (\n <DialogWindowedByDefaultContext.Provider value={!desktopLook && props.modal === undefined}>\n <RadixDialogModalProvider modal={modal}>\n <DialogPrimitive.Root {...props} modal={modal}>\n {children}\n </DialogPrimitive.Root>\n </RadixDialogModalProvider>\n </DialogWindowedByDefaultContext.Provider>\n );\n};\nDialog.displayName = \"Dialog\";\n\nconst DialogTrigger = DialogPrimitive.Trigger;\nconst DialogClose = DialogPrimitive.Close;\n\n/**\n * Portal-seam-aware DialogPortal. An explicit `container` always wins; with\n * none, the injected `PortalContainerProvider` value decides; with neither,\n * Radix's `document.body`.\n */\nconst DialogPortal = ({\n container,\n ...props\n}: Omit<\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.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 <DialogPrimitive.Portal container={resolved ?? null} {...props} />;\n};\nDialogPortal.displayName = \"DialogPortal\";\n\n// Shared identity across independently bundled public entrypoints/loaders.\nconst CONTEXT_SLOT = Symbol.for(\"ai-matrx.design-system.dialog-container-context\");\nconst contextRegistry = globalThis as typeof globalThis & { [CONTEXT_SLOT]?: React.Context<HTMLElement | null> };\nconst DialogContainerContext = contextRegistry[CONTEXT_SLOT] ??= React.createContext<HTMLElement | null>(null);\n\n/** The DialogContent element, for host code that portals into the dialog. */\nexport const useDialogContainer = (): HTMLElement | null =>\n React.useContext(DialogContainerContext);\n\nconst DialogOverlay = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n data-slot=\"dialog-overlay\"\n className={cn(\n // Page context behind the modal stays readable; separation comes from a\n // light token scrim, not a blur.\n \"fixed inset-0 z-[10000] bg-[var(--matrx-overlay-scrim-soft)]\",\n MOTION_OVERLAY,\n className,\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\n/**\n * Unstyled, non-portalling Content for custom dialog layouts. Preserves Radix\n * focus/background behavior and derives `aria-modal` from the Root.\n */\nconst DialogContentPrimitive = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ onInteractOutside, onCloseAutoFocus, ...props }, ref) => {\n const isModal = useRadixDialogModal();\n // A blocking dialog registers, so floating layers opened from it (a host\n // window, a picker window) stack above its scrim (floating-layer.tsx).\n useModalLayer(isModal);\n return (\n <DialogPrimitive.Content\n {...props}\n ref={ref}\n aria-modal={isModal || undefined}\n onInteractOutside={keepFloatingLayersInside(onInteractOutside)}\n onCloseAutoFocus={keepMovedFocus(onCloseAutoFocus)}\n />\n );\n});\nDialogContentPrimitive.displayName = \"DialogContentPrimitive\";\n\nconst DIALOG_DESKTOP_CLASSES =\n \"matrx-dialog-card fixed inset-0 z-[10000] m-auto grid h-fit min-w-0 w-full max-w-lg gap-4 max-h-[85dvh] overflow-y-auto overscroll-contain [--dialog-pad:1.5rem] overflow-x-clip border bg-background p-6 shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full sm:rounded-lg\";\n\nconst DIALOG_MOBILE_SHEET_CLASSES =\n \"matrx-mobile-sheet matrx-dialog-card fixed inset-x-0 bottom-0 left-0 right-0 top-auto z-[10000] flex min-w-0 flex-col w-full max-w-full max-h-[90dvh] gap-4 [--dialog-pad:1rem] overflow-x-clip border-t bg-background p-4 pb-safe shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full rounded-t-2xl rounded-b-none overflow-y-auto overscroll-contain\";\n\n// Re-asserted LAST so sheet geometry always wins over a caller className.\nconst DIALOG_MOBILE_SHEET_OVERRIDE =\n \"inset-x-0 bottom-0 left-0 right-0 top-auto translate-none w-full max-w-full max-h-[90dvh] rounded-b-none rounded-t-2xl overflow-y-auto\";\n\n/** Drag props the windowed DialogContent hands its DialogHeader (rule 6). */\ntype DialogWindowHandle = {\n onPointerDown: (event: React.PointerEvent<HTMLElement>) => void;\n onDoubleClick: () => void;\n};\nconst DialogWindowHandleContext = React.createContext<DialogWindowHandle | null>(null);\n\n/** Pixels of a dragged window that must stay on screen. */\nconst WINDOW_KEEP_VISIBLE = 80;\n\nexport interface DialogContentProps\n extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {\n /**\n * Windowed (non-blocking) dialogs never close from a click outside them —\n * the person is reaching for the page or an AI control beside the window.\n * Pass `true` for a quick picker that should close when the person clicks\n * away. Ignored on a blocking dialog, which keeps Radix's behavior.\n */\n dismissOnOutsideClick?: boolean;\n /** Render as a bottom sheet below the mobile breakpoint. Default `true`. */\n mobileSheet?: boolean;\n /** Render the built-in close control. Default `true`. */\n showCloseButton?: boolean;\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 honors `prefers-reduced-motion`.\n */\n animated?: boolean;\n /**\n * THE NAMED WIDTHS (0.68.22) — a dialog never pastes `max-w-[860px]`. Derived from the call\n * sites: `sm` 28rem (a confirm, a one-field ask), `md` 32rem (default), `lg` 42rem (a form with\n * two columns), `xl` 56rem (a detail or a table), `2xl` 72rem (a workspace in a dialog),\n * `full` the viewport less 1rem each side, `screen` the whole viewport (a record opened as a\n * page). On a phone the dialog is a bottom sheet at every size.\n */\n size?: DialogSize;\n /**\n * `default`: the card pads and gaps its children (24px). `none`: the content draws its own\n * frame edge to edge — a command palette, a picker with its own header row, a full-bleed grid.\n */\n padding?: \"default\" | \"none\";\n /**\n * `auto` (default): the card is as tall as its content, up to 85dvh. `tall`: the card holds\n * 85dvh whatever its content — a workspace whose body scrolls inside (a grid, a document).\n */\n height?: \"auto\" | \"tall\";\n}\n\nexport type DialogSize = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\" | \"full\" | \"screen\";\n\n/**\n * Literal classes so a host's Tailwind scan of the package finds every one. Every width above\n * `md` keeps a 1rem gutter each side on a screen narrower than itself (the card is `w-full`\n * with `inset-0`, so an un-guttered `max-w-4xl` ran edge to edge at 800px). `screen` is the\n * whole viewport, square-cornered — a record opened \"as a page\".\n */\nexport const DIALOG_SIZE_CLASS: Record<DialogSize, string> = {\n sm: \"max-w-md\",\n md: \"max-w-lg\",\n lg: \"max-w-[min(42rem,calc(100vw-2rem))]\",\n xl: \"max-w-[min(56rem,calc(100vw-2rem))]\",\n \"2xl\": \"max-w-[min(72rem,calc(100vw-2rem))]\",\n full: \"max-w-[calc(100vw-2rem)]\",\n screen: \"max-w-none w-screen h-dvh max-h-none rounded-none sm:rounded-none\",\n};\n\nconst DialogContent = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Content>,\n DialogContentProps\n>(\n (\n {\n className,\n children,\n mobileSheet = true,\n animated = true,\n showCloseButton = true,\n container,\n dismissOnOutsideClick = false,\n size = \"md\",\n padding = \"default\",\n height = \"auto\",\n onInteractOutside,\n onEscapeKeyDown,\n onPointerDownCapture,\n onFocusCapture,\n style,\n ...props\n },\n ref,\n ) => {\n const isMobile = useIsMobile();\n const isModal = useRadixDialogModal();\n // Falls through to the injected container while `containerEl` is unset\n // (pre-mount) — the original's dialog > popout > body priority.\n const injectedContainer = usePortalContainer(container);\n // THE LOOK (look.tsx): inside a desktop scope the dialog is a macOS sheet — never a phone's\n // bottom sheet, no close (×), no web motion; look-desktop.css draws it from `data-desktop-sheet`.\n const desktopLook = useLook() === \"desktop\";\n const asSheet = mobileSheet && isMobile && !desktopLook;\n const windowed = !isModal && !asSheet;\n const windowedByDefault = React.useContext(DialogWindowedByDefaultContext);\n const [containerEl, setContainerEl] = React.useState<HTMLElement | null>(\n null,\n );\n\n // ── the front-most layer (layer-front.ts) ───────────────────────────────\n // A default window sits at z-10000 with the layers it was opened from; it\n // steps behind when another layer comes to the front after it (a host\n // window opened from the Agents menu) and returns when the person reaches\n // for it again. An explicit modal={false} keeps its fixed z-900 contract.\n const stacks = windowed && windowedByDefault;\n const [behind, setBehind] = React.useState(false);\n React.useEffect(() => {\n if (!stacks || !containerEl) return;\n const onFront = (event: Event) => {\n const element = (event as CustomEvent<LayerFrontDetail>).detail?.element ?? null;\n if (element && (element === containerEl || containerEl.contains(element))) return;\n setBehind(true);\n };\n document.addEventListener(LAYER_FRONT_EVENT, onFront);\n // Opening is coming to the front.\n announceLayerFront(containerEl);\n return () => document.removeEventListener(LAYER_FRONT_EVENT, onFront);\n }, [stacks, containerEl]);\n const bringToFront = () => {\n if (!stacks || !containerEl) return;\n setBehind(false);\n announceLayerFront(containerEl);\n };\n\n // ── rule 6: the windowed dialog drags by its header ──────────────────────\n // THE WINDOW DRAG (window-drag.ts): painted per frame, committed once on release,\n // the header kept on screen.\n const [offset, setOffset] = React.useState({ x: 0, y: 0 });\n const drag = useDragMove({\n element: containerEl,\n enabled: windowed,\n paint: \"offset\",\n offset,\n constrain: (next) => clampRectToViewport(next, readViewport(), { keepVisible: WINDOW_KEEP_VISIBLE }),\n onCommit: (_rect, commit) => setOffset(commit.offset),\n });\n const handle = React.useMemo<DialogWindowHandle | null>(\n () => (windowed ? { onPointerDown: drag.onPointerDown, onDoubleClick: () => setOffset({ x: 0, y: 0 }) } : null),\n [windowed, drag.onPointerDown],\n );\n\n const mergedRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n setContainerEl(node);\n if (typeof ref === \"function\") ref(node);\n else if (ref)\n (ref as React.MutableRefObject<HTMLDivElement | null>).current = node;\n },\n [ref],\n );\n\n // The × sits in the header's row, or in a row of its own (close-slot.tsx).\n const closeSlot = useCloseSlot(showCloseButton && !desktopLook);\n\n const hasTitle =\n treeContainsComponent(children, DialogTitle) ||\n treeContainsComponent(children, DialogPrimitive.Title);\n const hasDescription =\n treeContainsComponent(children, DialogDescription) ||\n treeContainsComponent(children, DialogPrimitive.Description);\n\n return (\n <DialogPortal container={container}>\n {isModal ? <DialogOverlay /> : null}\n <DialogContentPrimitive\n ref={mergedRef}\n data-slot=\"dialog-content\"\n data-size={size}\n data-padding={padding === \"none\" ? \"none\" : undefined}\n data-height={height === \"tall\" ? \"tall\" : undefined}\n data-desktop-sheet={desktopLook ? \"\" : undefined}\n className={cn(\n asSheet ? DIALOG_MOBILE_SHEET_CLASSES : DIALOG_DESKTOP_CLASSES,\n !asSheet && DIALOG_SIZE_CLASS[size],\n padding === \"none\" && (asSheet ? \"gap-0 p-0 pb-safe [--dialog-pad:0px]\" : \"gap-0 p-0 [--dialog-pad:0px]\"),\n height === \"tall\" && (asSheet ? \"h-[90dvh]\" : \"h-[85dvh]\"),\n animated && !desktopLook && (asSheet ? MOTION_BOTTOM_SHEET : MOTION_DIALOG),\n className,\n asSheet && DIALOG_MOBILE_SHEET_OVERRIDE,\n // A non-modal dialog is the coexistence contract for content that\n // can sit beside a host's floating window manager (which starts at\n // z=1000); staying below that boundary makes a newly focused window\n // usable without coupling the two systems.\n !isModal && !windowedByDefault && \"z-[900]\",\n // Another layer came to the front after this window (layer-front.ts).\n stacks && behind && \"z-[999]\",\n // Without an overlay the card needs its own separation from the page.\n windowed && \"shadow-2xl ring-1 ring-border/60\",\n )}\n style={\n windowed && (offset.x !== 0 || offset.y !== 0)\n ? { ...style, translate: `${offset.x}px ${offset.y}px` }\n : style\n }\n onPointerDownCapture={(event) => {\n onPointerDownCapture?.(event);\n if (behind) bringToFront();\n }}\n onFocusCapture={(event) => {\n onFocusCapture?.(event);\n if (behind) bringToFront();\n }}\n onInteractOutside={(event) => {\n onInteractOutside?.(event);\n if (windowed && !dismissOnOutsideClick) event.preventDefault();\n }}\n onEscapeKeyDown={(event) => {\n onEscapeKeyDown?.(event);\n // Escape pressed in the page belongs to the page (a grid canceling\n // an edit), not to the window beside it.\n // The key's own target is where the person pressed it; focus is\n // the fallback when the event carries no element target.\n const pressedIn =\n event.target instanceof Node && event.target !== document.body\n ? event.target\n : document.activeElement;\n // Focus on <body> (or nowhere) belongs to nobody in the page: a button that disabled itself\n // while it worked (Share with User) drops focus there, and Escape must still close the window.\n const nowhere =\n !pressedIn || pressedIn === document.body || pressedIn === document.documentElement;\n if (windowed && containerEl && !nowhere && !containerEl.contains(pressedIn)) {\n event.preventDefault();\n }\n }}\n {...(hasDescription ? {} : { \"aria-describedby\": undefined })}\n {...props}\n >\n {hasTitle ? null : (\n <VisuallyHidden.Root>\n <DialogPrimitive.Title>Dialog</DialogPrimitive.Title>\n </VisuallyHidden.Root>\n )}\n {closeSlot.slot && !closeSlot.claimed ? <CloseRow /> : null}\n <CloseSlotProvider value={closeSlot.slot}>\n <DialogContainerContext.Provider value={containerEl}>\n <DialogWindowHandleContext.Provider value={handle}>\n <PortalContainerProvider\n container={containerEl ?? injectedContainer ?? null}\n >\n {children}\n </PortalContainerProvider>\n </DialogWindowHandleContext.Provider>\n </DialogContainerContext.Provider>\n </CloseSlotProvider>\n </DialogContentPrimitive>\n </DialogPortal>\n );\n },\n);\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => {\n // In a windowed dialog the header is the drag handle (rule 6).\n const handle = React.useContext(DialogWindowHandleContext);\n return (\n <HeaderWithClose\n slotName=\"dialog-header\"\n baseClassName=\"flex flex-col space-y-1.5 text-center sm:text-left\"\n // DialogTitle's line is 18px (text-lg leading-none): (44 - 18) / 2 = 13, (32 - 18) / 2 = 7.\n closeOffsetClassName=\"-mt-3 lg:-mt-1.5\"\n {...(handle\n ? {\n ...handle,\n \"data-window-handle\": \"\",\n title: \"Drag to move · double-click to recenter\",\n }\n : {})}\n className={cn(handle && \"cursor-grab select-none active:cursor-grabbing\", className)}\n {...props}\n />\n );\n};\nDialogHeader.displayName = \"DialogHeader\";\n\nconst DialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n // `gap-2` is the stacked (phone) gap — the buttons never touch; from sm up the\n // row keeps its `space-x-2`, so the gap resets to 0 there.\n \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end sm:gap-0 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);\nDialogFooter.displayName = \"DialogFooter\";\n\nconst DialogTitle = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n data-slot=\"dialog-title\"\n className={cn(\"text-lg font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n data-slot=\"dialog-description\"\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogContentPrimitive,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n","\"use client\";\n\n/**\n * THE LOOK — one implementation, the host's native skin.\n *\n * A shared workspace (the Vault, …) is written ONCE in the web vocabulary (`/controls`, the root\n * Dialog/menus, semantic Tailwind tokens). Inside Matrx Desktop it must look like a Mac app (the\n * desktop standard, `desktop/DESKTOP.md`). `LookScope look=\"desktop\"` is that switch:\n *\n * - it draws a `data-matrx-look=\"desktop\"` box; `look-desktop.css` (imported by styles.css, inert\n * without the attribute) puts the web tokens on AppKit's values, Tailwind's type scale on\n * Apple's text styles, the platform's system font, and the `/controls` on NSControl geometry;\n * - every portal-aware layer opened inside it (Dialog, Popover, menus, Select, Tooltip) mounts in a\n * layer that carries the same attribute, so a menu or sheet wears the look too;\n * - `useLook()` tells a component the look, so the root `DialogContent` becomes a macOS sheet.\n *\n * `look=\"web\"` (the default) renders its children only: the web output is byte-for-byte unchanged.\n * Never a second component tree, never per-call-site overrides.\n */\n\nimport * as React from \"react\";\nimport { PortalContainerProvider } from \"./portal-container\";\n\nexport type Look = \"web\" | \"desktop\";\n\n// Shared identity across independently bundled public entrypoints (as portal-container does).\nconst CONTEXT_SLOT = Symbol.for(\"ai-matrx.design-system.look-context\");\nconst registry = globalThis as typeof globalThis & { [CONTEXT_SLOT]?: React.Context<Look> };\nconst LookContext = (registry[CONTEXT_SLOT] ??= React.createContext<Look>(\"web\"));\n\n/** The look the nearest `LookScope` chose; `\"web\"` outside any scope. */\nexport function useLook(): Look {\n return React.useContext(LookContext);\n}\n\nexport const LOOK_ATTRIBUTE = \"data-matrx-look\";\n\nexport interface LookScopeProps extends React.HTMLAttributes<HTMLDivElement> {\n look: Look;\n children: React.ReactNode;\n}\n\n/** The layer every portal opened inside a desktop scope mounts in: a body child wearing the look. */\nfunction useLookLayer(look: Look): HTMLElement | null {\n const [layer, setLayer] = React.useState<HTMLElement | null>(null);\n React.useEffect(() => {\n if (look === \"web\" || typeof document === \"undefined\") return;\n const el = document.createElement(\"div\");\n el.setAttribute(LOOK_ATTRIBUTE, look);\n el.setAttribute(\"data-slot\", \"look-layer\");\n document.body.appendChild(el);\n setLayer(el);\n return () => {\n el.remove();\n setLayer(null);\n };\n }, [look]);\n return layer;\n}\n\nexport function LookScope({ look, children, ...div }: LookScopeProps) {\n const layer = useLookLayer(look);\n if (look === \"web\") return <LookContext.Provider value=\"web\">{children}</LookContext.Provider>;\n return (\n <LookContext.Provider value={look}>\n <div {...div} {...{ [LOOK_ATTRIBUTE]: look }}>\n <PortalContainerProvider container={layer}>{children}</PortalContainerProvider>\n </div>\n </LookContext.Provider>\n );\n}\n","/**\n * THE FRONT-MOST LAYER — one signal every floating layer shares, so the layer\n * the person used last is the one on top.\n *\n * A windowed Dialog sits at z-10000 so it is never behind the menu, popover or\n * host window it was opened from (0.38.1). But a host window opened or focused\n * AFTER it — the window an agent run opens from the Agents menu while Table\n * settings is open — then sat underneath it, and its composer could not be\n * clicked or typed into (found live 2026-09-26, register ARE-010). Recency has\n * to decide, across both systems, without coupling them.\n *\n * So any layer that comes to the front announces it: `announceLayerFront(el)`\n * dispatches `matrx:layer-front` on `document`. A windowed Dialog announces\n * itself when it opens and when the person presses or focuses inside it; it\n * steps BEHIND (z-999, still above the page and below the host's window\n * manager at 1000+) whenever another layer announces, and comes back the\n * moment the person reaches for it. A host window manager announces its\n * window on open and on focus.\n */\n\nexport const LAYER_FRONT_EVENT = \"matrx:layer-front\";\n\nexport interface LayerFrontDetail {\n /** The element that came to the front. */\n element: Element | null;\n}\n\n/** Tell every other floating layer that `element` is now the one in front. */\nexport function announceLayerFront(element: Element | null): void {\n if (typeof document === \"undefined\") return;\n document.dispatchEvent(\n new CustomEvent<LayerFrontDetail>(LAYER_FRONT_EVENT, { detail: { element } }),\n );\n}\n","/**\n * THE WINDOW DRAG — the ONE pointer-drag / resize / viewport-clamp primitive\n * every floating surface uses: a windowed Dialog's header, a PeekWindow, the\n * desktop InspectorPanel, @ai-matrx/summon's WindowPanel, Dock and LiteWindow,\n * and @ai-matrx/associations' DefaultWindowShell. It lives at this layer\n * because every one of them sits on design-system; nothing below may fork it.\n *\n * Three layers, use the highest one that fits:\n *\n * 1. `useDragMove()` — the React hook. A pointer move PAINTS the element\n * inside one animation frame (CSS `translate`, plus `width`/`height` for a\n * resize) and the host's state is committed EXACTLY ONCE, on release.\n * Writing state per pointer event re-renders whatever streams inside the\n * window sixty times a second (paid for in Workflow Studio's floating chat\n * and chat's ChatPanel). It also carries THE CURSOR LAW (`holdDragCursor`\n * for the whole gesture), z-order (`announceLayerFront` on press), the\n * \"controls in the handle stay controls\" rule, and a cleanup that leaves\n * no listener, frame or cursor behind on unmount.\n * 2. `startPointerDrag()` — the gesture lifecycle alone (window listeners per\n * pointer id, threshold, cursor hold, frame-coalesced moves, trailing-click\n * swallow, cancel). For a host whose moves must reach a store live (summon's\n * WindowPanel: pop-out drag-out detection and window-manager geometry).\n * 3. Pure geometry — `resizeRect()` (8-edge resize with size limits) and\n * `clampRectToViewport()` (the header always stays reachable).\n */\n\nimport {\n useCallback,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n type PointerEvent as ReactPointerEvent,\n} from \"react\";\n\nimport { type DragCursor, holdDragCursor } from \"./drag-cursor\";\nimport { announceLayerFront } from \"./layer-front\";\n\n// ── Geometry ─────────────────────────────────────────────────────────────────\n\n/** A window's box in px — viewport px unless the host measures in a container. */\nexport interface DragRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport interface DragViewport {\n width: number;\n height: number;\n}\n\n/** The edge or corner a resize handle grabs. */\nexport type ResizeEdge = \"n\" | \"s\" | \"e\" | \"w\" | \"ne\" | \"nw\" | \"se\" | \"sw\";\n\n/** The cursor held on the document while each edge resizes (THE CURSOR LAW). */\nexport const RESIZE_EDGE_CURSOR: Record<ResizeEdge, DragCursor> = {\n e: \"ew-resize\",\n w: \"ew-resize\",\n n: \"ns-resize\",\n s: \"ns-resize\",\n se: \"nwse-resize\",\n nw: \"nwse-resize\",\n ne: \"nesw-resize\",\n sw: \"nesw-resize\",\n};\n\nexport interface SizeLimits {\n minWidth?: number;\n minHeight?: number;\n maxWidth?: number;\n maxHeight?: number;\n}\n\n/** Controls inside a drag handle that stay controls — a press there never starts a drag. */\nexport const DRAG_IGNORE_SELECTOR =\n \"button,a,input,select,textarea,[role='button'],[contenteditable='true'],[data-no-drag]\";\n\nconst bound = (value: number, min: number, max: number): number => Math.min(max, Math.max(min, value));\n\n/**\n * `origin` resized by a pointer that traveled (`dx`, `dy`) from the press on\n * `edge`. A west or north edge keeps the opposite edge still; sizes honor\n * `limits`.\n */\nexport function resizeRect(origin: DragRect, edge: ResizeEdge, dx: number, dy: number, limits: SizeLimits = {}): DragRect {\n const minWidth = limits.minWidth ?? 0;\n const minHeight = limits.minHeight ?? 0;\n const maxWidth = limits.maxWidth ?? Number.POSITIVE_INFINITY;\n const maxHeight = limits.maxHeight ?? Number.POSITIVE_INFINITY;\n const next = { ...origin };\n if (edge.includes(\"e\")) next.width = bound(origin.width + dx, minWidth, maxWidth);\n if (edge.includes(\"s\")) next.height = bound(origin.height + dy, minHeight, maxHeight);\n if (edge.includes(\"w\")) {\n next.width = bound(origin.width - dx, minWidth, maxWidth);\n next.x = origin.x + (origin.width - next.width);\n }\n if (edge.includes(\"n\")) {\n next.height = bound(origin.height - dy, minHeight, maxHeight);\n next.y = origin.y + (origin.height - next.height);\n }\n return next;\n}\n\nexport interface ViewportClamp {\n /** Smallest gap kept to the viewport edge. Default 0. */\n margin?: number;\n /**\n * Px of the window that must stay on screen horizontally and below the top\n * edge. Omit to keep the WHOLE window on screen. Either way the top edge (the\n * header) is never above `margin`, and a window larger than the room keeps\n * its top-left visible — an unreachable header is an unclosable window.\n */\n keepVisible?: number;\n /** Shrink the window to the room (never below these) before placing it. */\n fit?: { minWidth: number; minHeight: number };\n}\n\n/** `rect` kept reachable inside `viewport` (see `ViewportClamp`). */\nexport function clampRectToViewport(rect: DragRect, viewport: DragViewport, clamp: ViewportClamp = {}): DragRect {\n const margin = clamp.margin ?? 0;\n let { width, height } = rect;\n if (clamp.fit) {\n width = Math.min(width, Math.max(clamp.fit.minWidth, viewport.width - margin * 2));\n height = Math.min(height, Math.max(clamp.fit.minHeight, viewport.height - margin * 2));\n }\n const keep = clamp.keepVisible;\n const lowX = keep === undefined ? margin : margin + Math.min(keep, width) - width;\n const highX = keep === undefined ? viewport.width - width - margin : viewport.width - Math.min(keep, width) - margin;\n const highY = keep === undefined ? viewport.height - height - margin : viewport.height - Math.min(keep, height) - margin;\n return {\n width,\n height,\n x: Math.round(Math.max(lowX, Math.min(rect.x, highX))),\n y: Math.round(Math.max(margin, Math.min(rect.y, highY))),\n };\n}\n\n/** The browser viewport (a sane desktop size during SSR). */\nexport function readViewport(): DragViewport {\n return typeof window === \"undefined\" ? { width: 1280, height: 800 } : { width: window.innerWidth, height: window.innerHeight };\n}\n\n// ── The gesture ──────────────────────────────────────────────────────────────\n\nexport interface DragDelta {\n dx: number;\n dy: number;\n}\n\nexport interface PointerDragOptions {\n /** Px the pointer must travel before the press becomes a drag. Default 0 (a drag from the press). */\n threshold?: number;\n /** Cursor held on the document while dragging. Default `grabbing`; `null` holds none. */\n cursor?: DragCursor | null;\n /** Coalesce moves to one call per animation frame. Default true. */\n frame?: boolean;\n /** Swallow the click the browser fires after a real drag. Default: `threshold > 0`. */\n swallowClick?: boolean;\n /** The press became a drag (immediately when `threshold` is 0). */\n onStart?(): void;\n /** The pointer traveled `delta` from the press (only after `onStart`). */\n onMove(delta: DragDelta, event: PointerEvent): void;\n /** Released or canceled by the browser. `moved` is false for a press that never traveled. */\n onEnd?(delta: DragDelta, info: { moved: boolean; started: boolean; cancelled: boolean }): void;\n}\n\nexport interface PointerDragHandle {\n /** Abort silently (unmount, close): listeners, frame and cursor are released, `onEnd` is not called. */\n cancel(): void;\n}\n\ninterface PressPoint {\n clientX: number;\n clientY: number;\n pointerId: number;\n}\n\n/** Track one pointer from its press until release. See the module doc. */\nexport function startPointerDrag(press: PressPoint, options: PointerDragOptions): PointerDragHandle {\n const threshold = options.threshold ?? 0;\n const useFrame = options.frame !== false;\n const swallowClick = options.swallowClick ?? threshold > 0;\n let started = false;\n let moved = false;\n let releaseCursor: (() => void) | null = null;\n let frame: number | null = null;\n let pending: { delta: DragDelta; event: PointerEvent } | null = null;\n let last: DragDelta = { dx: 0, dy: 0 };\n let done = false;\n\n const start = () => {\n started = true;\n if (options.cursor !== null) releaseCursor = holdDragCursor(options.cursor ?? \"grabbing\");\n options.onStart?.();\n };\n const flush = () => {\n frame = null;\n if (!pending) return;\n const { delta, event } = pending;\n pending = null;\n options.onMove(delta, event);\n };\n const onMove = (event: PointerEvent) => {\n if (event.pointerId !== press.pointerId) return;\n const delta = { dx: event.clientX - press.clientX, dy: event.clientY - press.clientY };\n if (!started) {\n if (Math.abs(delta.dx) < threshold && Math.abs(delta.dy) < threshold) return;\n start();\n }\n if (delta.dx !== 0 || delta.dy !== 0) moved = true;\n last = delta;\n pending = { delta, event };\n if (!useFrame || typeof window.requestAnimationFrame !== \"function\") flush();\n else if (frame === null) frame = window.requestAnimationFrame(flush);\n };\n const teardown = () => {\n done = true;\n window.removeEventListener(\"pointermove\", onMove);\n window.removeEventListener(\"pointerup\", onUp);\n window.removeEventListener(\"pointercancel\", onUp);\n if (frame !== null) window.cancelAnimationFrame?.(frame);\n frame = null;\n releaseCursor?.();\n releaseCursor = null;\n };\n const onUp = (event: PointerEvent) => {\n if (event.pointerId !== press.pointerId || done) return;\n // The last position is painted before the gesture ends, never dropped with its frame.\n if (pending) flush();\n teardown();\n options.onEnd?.(last, { moved, started, cancelled: event.type === \"pointercancel\" });\n if (moved && swallowClick) {\n const swallow = (click: MouseEvent) => {\n click.stopPropagation();\n click.preventDefault();\n };\n window.addEventListener(\"click\", swallow, { capture: true, once: true });\n window.setTimeout(() => window.removeEventListener(\"click\", swallow, { capture: true }), 0);\n }\n };\n\n window.addEventListener(\"pointermove\", onMove);\n window.addEventListener(\"pointerup\", onUp);\n window.addEventListener(\"pointercancel\", onUp);\n if (threshold <= 0) start();\n return {\n cancel: () => {\n if (!done) teardown();\n },\n };\n}\n\n// ── The hook ─────────────────────────────────────────────────────────────────\n\n/** What a gesture is doing: moving the window, or resizing it from an edge. */\nexport type DragGesture = \"move\" | ResizeEdge;\n\nexport interface DragCommit {\n /** The window's box when pressed. */\n origin: DragRect;\n gesture: DragGesture;\n /** Pointer travel, after `constrain`: `rect.x - origin.x`, `rect.y - origin.y`. */\n delta: DragDelta;\n /** `paint: \"offset\"` only: the host's `offset` at the press plus `delta`. */\n offset: { x: number; y: number };\n}\n\nexport interface UseDragMoveOptions {\n /** The element that MOVES (the window frame). */\n element: HTMLElement | null;\n /** Default true. False: presses do nothing (a phone sheet, a maximized window). */\n enabled?: boolean;\n /** Px before a press becomes a drag. Default 0. A handle that is also a click target passes 4. */\n threshold?: number;\n /** Allow touch drags. Default true. */\n touch?: boolean;\n /** Controls inside a handle that never start a drag. Default `DRAG_IGNORE_SELECTOR`; `null` = none. */\n ignore?: string | null;\n /** Announce the element as the front-most layer on press (layer-front.ts). Default true. */\n announce?: boolean;\n /**\n * How a drag paints the element before the commit:\n * - `delta` (default): `translate` by the travel, cleared in the commit's own render\n * (the host positions with left/top/right/bottom and commits the new place);\n * - `offset`: the host renders `translate` from its own `offset` — the drag paints\n * `offset + travel` and leaves it for the host's commit to own.\n */\n paint?: \"delta\" | \"offset\";\n /** The host's committed translate (`paint: \"offset\"`). */\n offset?: { x: number; y: number };\n /** The window's box at the press. Default: the element's viewport rect. */\n getRect?: () => DragRect;\n /** Keep every painted box legal (e.g. `clampRectToViewport`). */\n constrain?: (next: DragRect, gesture: DragGesture, origin: DragRect) => DragRect;\n /** Resize size limits. */\n limits?: SizeLimits;\n /** Cursor held while moving. Default `grabbing` (resizes hold their edge's cursor). */\n cursor?: DragCursor;\n /** A press is starting a gesture (focus or raise the window here). */\n onPress?: (event: ReactPointerEvent<HTMLElement>, gesture: DragGesture) => void;\n /** Every painted frame — for observers that are NOT React state. */\n onFrame?: (rect: DragRect, gesture: DragGesture) => void;\n /** Once per gesture that moved, on release. Commit the host's state here. */\n onCommit: (rect: DragRect, commit: DragCommit) => void;\n}\n\nexport interface DragMoveApi {\n /** Spread onto the element you drag BY: `onPointerDown={drag.onPointerDown}`. */\n onPointerDown: (event: ReactPointerEvent<HTMLElement>) => void;\n /** `onPointerDown` for the handle that resizes from `edge`. */\n resizeHandle: (edge: ResizeEdge) => (event: ReactPointerEvent<HTMLElement>) => void;\n /** True from the moment a press becomes a drag until release. */\n dragging: boolean;\n /** Abandon a drag in flight (the window closed): nothing is committed, the cursor is released. */\n cancel: () => void;\n}\n\n/** Drag and resize a floating element without re-rendering it while the pointer moves. */\nexport function useDragMove(options: UseDragMoveOptions): DragMoveApi {\n const live = useRef(options);\n useLayoutEffect(() => {\n live.current = options;\n });\n const [dragging, setDragging] = useState(false);\n const gestureRef = useRef<PointerDragHandle | null>(null);\n /** The translate to put back once the commit has rendered (`paint: \"delta\"`). */\n const restoreRef = useRef<{ element: HTMLElement; translate: string } | null>(null);\n\n useLayoutEffect(() => {\n const restore = restoreRef.current;\n if (!restore) return;\n restoreRef.current = null;\n restore.element.style.translate = restore.translate;\n });\n\n useEffect(\n () => () => {\n gestureRef.current?.cancel();\n gestureRef.current = null;\n },\n [],\n );\n\n const begin = useCallback((event: ReactPointerEvent<HTMLElement>, gesture: DragGesture) => {\n const opts = live.current;\n const element = opts.element;\n if (opts.enabled === false || !element || event.button !== 0) return;\n if (opts.touch === false && event.pointerType === \"touch\") return;\n const target = event.target instanceof Element ? event.target : null;\n const ignore = opts.ignore === undefined ? DRAG_IGNORE_SELECTOR : opts.ignore;\n if (gesture === \"move\" && ignore && target) {\n const hit = target.closest(ignore);\n if (hit && hit !== event.currentTarget && event.currentTarget.contains(hit)) return;\n }\n // A press on bare chrome must not start a text selection; a press on a control keeps its default.\n if (gesture !== \"move\" || !target?.closest(\"button,a,input,select,textarea,label,[role=button]\")) event.preventDefault();\n if (gesture !== \"move\") event.stopPropagation();\n gestureRef.current?.cancel();\n opts.onPress?.(event, gesture);\n if (opts.announce !== false) announceLayerFront(element);\n\n const origin = opts.getRect?.() ?? (() => {\n const rect = element.getBoundingClientRect();\n return { x: rect.left, y: rect.top, width: rect.width, height: rect.height };\n })();\n const paintMode = opts.paint ?? \"delta\";\n const base = paintMode === \"offset\" ? (opts.offset ?? { x: 0, y: 0 }) : { x: 0, y: 0 };\n const baseTranslate = element.style.translate;\n let latest = origin;\n\n gestureRef.current = startPointerDrag(event, {\n threshold: opts.threshold ?? 0,\n cursor: gesture === \"move\" ? (opts.cursor ?? \"grabbing\") : RESIZE_EDGE_CURSOR[gesture],\n onStart: () => setDragging(true),\n onMove: ({ dx, dy }) => {\n const now = live.current;\n const raw =\n gesture === \"move\"\n ? { ...origin, x: origin.x + dx, y: origin.y + dy }\n : resizeRect(origin, gesture, dx, dy, now.limits);\n latest = now.constrain ? now.constrain(raw, gesture, origin) : raw;\n element.style.translate = `${base.x + latest.x - origin.x}px ${base.y + latest.y - origin.y}px`;\n if (gesture !== \"move\") {\n element.style.width = `${latest.width}px`;\n element.style.height = `${latest.height}px`;\n }\n now.onFrame?.(latest, gesture);\n },\n onEnd: (_delta, { moved, started }) => {\n gestureRef.current = null;\n if (started) setDragging(false);\n if (!moved) return;\n if (paintMode === \"delta\") restoreRef.current = { element, translate: baseTranslate };\n const delta = { dx: latest.x - origin.x, dy: latest.y - origin.y };\n live.current.onCommit(latest, {\n origin,\n gesture,\n delta,\n offset: { x: base.x + delta.dx, y: base.y + delta.dy },\n });\n },\n });\n }, []);\n\n const onPointerDown = useCallback((event: ReactPointerEvent<HTMLElement>) => begin(event, \"move\"), [begin]);\n const resizeHandle = useCallback(\n (edge: ResizeEdge) => (event: ReactPointerEvent<HTMLElement>) => begin(event, edge),\n [begin],\n );\n\n const cancel = useCallback(() => {\n if (!gestureRef.current) return;\n gestureRef.current.cancel();\n gestureRef.current = null;\n setDragging(false);\n }, []);\n\n return { onPointerDown, resizeHandle, dragging, cancel };\n}\n","/**\n * THE DRAG CURSOR HOLD — the ONE way a drag sets its cursor (THE CURSOR LAW,\n * common-docs/policies/cursor-law.md).\n *\n * A cursor set on the dragged element flickers: the pointer outruns the\n * element, crosses a button or a field, and the cursor changes under it. So a\n * drag holds its cursor on `<html data-dragging=\"…\">` for its whole duration,\n * and `styles.css` § THE CURSOR LAW pins that cursor on every element,\n * important, in the first layer (`matrx-tap-lock`), so nothing — not a\n * utility, not the tap lock's own `cursor: pointer !important` — can override\n * it mid-drag.\n *\n * const release = holdDragCursor(); // pointerdown\n * … // pointermove\n * release(); // pointerup / pointercancel\n *\n * Holds nest: the newest hold's cursor shows, and the attribute clears only\n * when every hold has released. A release is idempotent.\n *\n * Inside a dnd-kit `<DndContext>`, render `<DragCursorMonitor />` (from\n * `./drag-cursor-monitor`) instead of calling this by hand.\n */\n\nexport const DRAG_CURSORS = [\n \"grabbing\",\n \"move\",\n \"col-resize\",\n \"row-resize\",\n \"ew-resize\",\n \"ns-resize\",\n \"nwse-resize\",\n \"nesw-resize\",\n] as const;\n\nexport type DragCursor = (typeof DRAG_CURSORS)[number];\n\nconst holds: { id: number; cursor: DragCursor }[] = [];\nlet nextId = 0;\n\nfunction apply(): void {\n if (typeof document === \"undefined\") return;\n const root = document.documentElement;\n const top = holds[holds.length - 1];\n if (top) root.dataset.dragging = top.cursor;\n else delete root.dataset.dragging;\n}\n\n/** Hold `cursor` on the whole document until the returned release is called. */\nexport function holdDragCursor(cursor: DragCursor = \"grabbing\"): () => void {\n const id = nextId++;\n holds.push({ id, cursor });\n apply();\n let released = false;\n return () => {\n if (released) return;\n released = true;\n const index = holds.findIndex((hold) => hold.id === id);\n if (index >= 0) holds.splice(index, 1);\n apply();\n };\n}\n","\"use client\";\nimport React from \"react\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"./tooltip\";\nimport { Button, type GlyphTone } from \"./controls/index\";\nimport { MOTION_SPIN } from \"./motion\";\n\n// Moved whole from matrx-frontend components/official/IconButton (chat host slots, 2026-10-08).\n\n/**\n * A door onto THE control: an icon-only controls `Button` (the 28px circle) with an optional\n * tooltip. It has no size and no color of its own — a glyph whose color carries meaning says\n * so with `glyphTone`; `className` places it (margin, position, flex), never restyles it.\n */\nexport interface IconButtonProps\n extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"children\"> {\n /** Any glyph component (a design-system glyph, a Lucide icon, …); it receives `className`. */\n icon: React.ComponentType<{ className?: string }>;\n tooltip?: string;\n /** Legacy tone words map onto the control's variants: ghost → quiet, default → primary,\n * destructive → danger. */\n variant?: \"ghost\" | \"outline\" | \"default\" | \"secondary\" | \"destructive\" | \"link\";\n /** The glyph's own status ink when its color carries meaning. */\n glyphTone?: GlyphTone;\n /** Work in flight: the glyph turns (a refresh, a duplicate, an export). */\n spinning?: boolean;\n tooltipSide?: \"top\" | \"right\" | \"bottom\" | \"left\";\n tooltipAlign?: \"start\" | \"center\" | \"end\";\n tooltipOffset?: number;\n}\n\nconst VARIANT = {\n ghost: \"quiet\",\n outline: \"outline\",\n secondary: \"outline\",\n default: \"primary\",\n destructive: \"danger\",\n link: \"link\",\n} as const;\n\nexport function IconButton({\n icon: Icon,\n tooltip,\n variant = \"ghost\",\n glyphTone,\n spinning = false,\n tooltipSide = \"bottom\",\n tooltipAlign = \"center\",\n tooltipOffset = 5,\n \"aria-label\": ariaLabel,\n ...props\n}: IconButtonProps) {\n const control = (\n <Button\n variant={VARIANT[variant]}\n icon={spinning ? <Icon className={MOTION_SPIN} /> : <Icon />}\n {...(glyphTone ? { glyphTone } : {})}\n aria-label={ariaLabel ?? tooltip ?? \"Action\"}\n {...props}\n />\n );\n if (!tooltip) return control;\n return (\n <Tooltip>\n <TooltipTrigger asChild>{control}</TooltipTrigger>\n <TooltipContent side={tooltipSide} align={tooltipAlign} className=\"z-[9999]\" sideOffset={tooltipOffset}>\n {tooltip}\n </TooltipContent>\n </Tooltip>\n );\n}\n","\"use client\";\n\n/**\n * EmptyStateCard — the centered \"nothing here\" block: a large tinted icon, a title, a sentence, and an\n * optional call to action. Moved from matrx-frontend `components/official/cards/EmptyStateCard`\n * (wave 3, 2026-10-22).\n *\n * The old alternate-state machinery (six class props: icon color, icon background, button color, ...) is one\n * named option: `tone=\"success\"` draws the done / all-clear look from the success role; the default is the\n * primary role. The call to action is the controls `Button` (primary, or outline in the success tone).\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { Button } from \"./controls\";\n\nexport interface EmptyStateCardProps {\n title: string;\n description: string;\n /** Any glyph component (a package glyph, a Lucide icon); it receives `className`. */\n icon: React.ComponentType<{ className?: string; strokeWidth?: number }>;\n buttonText?: string;\n onButtonClick?: () => void;\n /** Drawn beside the call to action. */\n secondaryButton?: React.ReactNode;\n /** `primary` (default) or `success`, the all-clear look. */\n tone?: \"primary\" | \"success\";\n}\n\nconst TONE = {\n primary: { data: \"primary\", button: \"primary\" },\n success: { data: \"success\", button: \"outline\" },\n} as const;\n\nexport function EmptyStateCard({\n title,\n description,\n icon: Icon,\n buttonText,\n onButtonClick,\n secondaryButton,\n tone = \"primary\",\n}: EmptyStateCardProps) {\n const t = TONE[tone];\n return (\n <div data-tone={t.data} className=\"matrx-hue-card flex flex-col items-center justify-center px-6 py-12 text-center\">\n <div className=\"matrx-hue-icon mb-6 rounded-full p-6\">\n <Icon className=\"h-12 w-12\" strokeWidth={1.5} />\n </div>\n <h3 className={cn(\"mb-3 text-xl font-semibold\", tone === \"success\" ? \"text-success-ink\" : \"text-foreground\")}>\n {title}\n </h3>\n <p className=\"mb-8 max-w-md text-muted-foreground\">{description}</p>\n {buttonText && (\n <div className=\"flex flex-col gap-4 sm:flex-row\">\n <Button variant={t.button} {...(tone === \"success\" ? { tone: \"success\" as const } : {})} {...(onButtonClick ? { onClick: onButtonClick } : {})}>\n {buttonText}\n </Button>\n {secondaryButton}\n </div>\n )}\n </div>\n );\n}\n","\"use client\";\n\n/**\n * THE HUE CARDS — the colored icon cards: a card (`HueCard`, with a compact iOS squircle form), a grid of them\n * (`HueGrid`), a horizontal row (`HueRow`) and its list (`HueList`), and the 2x2 gradient widget (`IosWidget`);\n * plus the plain tile (`TileCard`) and its grid (`TileCardGrid`).\n *\n * Moved from matrx-frontend `components/official/card-and-grid/*` and `components/official/cards/CardGrid`\n * (wave 3, 2026-10-22). The ~150 palette classes (`bg-indigo-100 dark:bg-indigo-900/70`, gradient stops, ...) are\n * gone: a card's color is a NAMED hue (`CardColor`) that picks the chip tone table in `controls.css`, so it\n * is a token in light and dark. The look follows the tokens:\n * - the former `yellow` and `amber` share the amber token (the table has no yellow); `purple` is `violet`,\n * `pink` is `fuchsia`, `gray` is `slate`, `red` is the destructive role, `green` the success role;\n * - the squircle / widget gradient runs from the hue to the hue darkened toward black.\n * Links draw through `HostLink` (the registered tap-target link). Text is foreground / muted tokens only.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { HostLink } from \"../host-link\";\nimport { ChevronRightIcon, PlusIcon } from \"../icons\";\n\n/** The names callers already use. Each picks one tone of the chip table (see `HUE_TONE`). */\nexport type CardColor =\n | \"indigo\"\n | \"emerald\"\n | \"blue\"\n | \"amber\"\n | \"purple\"\n | \"gray\"\n | \"red\"\n | \"green\"\n | \"yellow\"\n | \"pink\"\n | \"orange\"\n | \"teal\"\n | \"cyan\"\n | \"lime\"\n | \"rose\"\n | \"violet\"\n | \"slate\";\n\n/** CardColor -> the `data-tone` of the chip table in controls.css. */\nexport const HUE_TONE: Record<CardColor, string> = {\n indigo: \"indigo\",\n emerald: \"emerald\",\n blue: \"blue\",\n amber: \"amber\",\n purple: \"violet\",\n gray: \"slate\",\n red: \"destructive\",\n green: \"success\",\n yellow: \"amber\",\n pink: \"fuchsia\",\n orange: \"orange\",\n teal: \"teal\",\n cyan: \"cyan\",\n lime: \"lime\",\n rose: \"rose\",\n violet: \"violet\",\n slate: \"slate\",\n};\n\nexport type CardSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n\ntype SizedIcon = React.ReactElement<{ size?: number; className?: string }>;\n\nfunction sizedIcon(icon: SizedIcon, fallback: number): React.ReactNode {\n return React.isValidElement<{ size?: number }>(icon)\n ? React.cloneElement(icon, { size: icon.props.size || fallback })\n : icon;\n}\n\nfunction tone(color: CardColor): string {\n return HUE_TONE[color] ?? HUE_TONE.slate;\n}\n\n/** The card's destination: a link when it has a path, else a click target. */\nfunction Destination({\n path,\n onClick,\n external,\n className,\n children,\n}: {\n path?: string | undefined;\n onClick?: (() => void) | undefined;\n external?: boolean | undefined;\n className?: string;\n children: React.ReactNode;\n}) {\n if (path) {\n return (\n <HostLink\n href={path}\n className={className ?? \"block\"}\n {...(onClick ? { onClick } : {})}\n {...(external ? { target: \"_blank\", rel: \"noopener noreferrer\" } : {})}\n >\n {children}\n </HostLink>\n );\n }\n return (\n <div {...(className ? { className } : {})} {...(onClick ? { onClick } : {})}>\n {children}\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* HueCard */\n/* ------------------------------------------------------------------ */\n\nexport interface HueCardProps {\n title: string;\n description?: string;\n descriptionNode?: React.ReactNode;\n icon: SizedIcon;\n color: CardColor;\n path?: string;\n size?: CardSize;\n /** Where the card sits (width, margin, grid span); never how it looks. */\n className?: string;\n onClick?: () => void;\n /** The compact iOS form: a small squircle with the icon and a label, no description. */\n compact?: boolean;\n /** `path` points at a separately hosted app: open it in a new tab. */\n external?: boolean;\n}\n\nconst SIZE_PADDING: Record<CardSize, string> = {\n xs: \"p-3\",\n sm: \"p-4\",\n md: \"p-5\",\n lg: \"p-6\",\n xl: \"p-8\",\n};\n\nexport function HueCard({\n title,\n description,\n descriptionNode,\n icon,\n color,\n path,\n size = \"md\",\n className,\n onClick,\n compact = false,\n external = false,\n}: HueCardProps) {\n if (compact) {\n return (\n <Destination path={path} onClick={onClick} external={external}>\n <div\n data-tone={tone(color)}\n className={cn(\"matrx-hue-card flex cursor-pointer select-none flex-col items-center gap-1.5\", className)}\n >\n <div className=\"matrx-hue-squircle flex aspect-square w-full max-w-[62px] items-center justify-center rounded-[22%] shadow-sm transition-colors\">\n {sizedIcon(icon, 36)}\n </div>\n <span className=\"type-meta w-full truncate px-0.5 text-center font-medium leading-tight text-foreground\">\n {title}\n </span>\n </div>\n </Destination>\n );\n }\n\n return (\n <Destination path={path} onClick={onClick} external={external}>\n <div\n data-tone={tone(color)}\n className={cn(\n \"matrx-hue-card matrx-hue-surface cursor-pointer rounded-xl bg-card shadow-md transition-colors\",\n SIZE_PADDING[size],\n className,\n )}\n >\n <div className=\"flex flex-col items-center space-y-3 text-center\">\n <div className=\"matrx-hue-icon rounded-full p-3\">{sizedIcon(icon, 28)}</div>\n <h3 className=\"text-lg font-semibold\">{title}</h3>\n {description && <p className=\"type-body text-muted-foreground\">{description}</p>}\n {descriptionNode && !description && descriptionNode}\n </div>\n </div>\n </Destination>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* HueGrid */\n/* ------------------------------------------------------------------ */\n\nexport interface HueGridProps {\n title?: string;\n description?: string;\n items: HueCardProps[];\n /** 1 to 6 columns at the widest breakpoint. Default 6. */\n columns?: number;\n className?: string;\n /** Places every card (width, span); never how it looks. */\n cardClassName?: string;\n /** Draw a dashed \"add\" tile after the cards. */\n showAddButton?: boolean;\n onAddButtonClick?: () => void;\n addButtonText?: string;\n /** Compact iOS icons, four to a row. */\n compact?: boolean;\n}\n\nconst GRID_COLUMNS: Record<number, string> = {\n 1: \"grid-cols-1\",\n 2: \"grid-cols-1 sm:grid-cols-2\",\n 3: \"grid-cols-1 sm:grid-cols-2 md:grid-cols-3\",\n 4: \"grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4\",\n 5: \"grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5\",\n 6: \"grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6\",\n};\n\nexport function HueGrid({\n title,\n description,\n items,\n columns = 6,\n className,\n cardClassName,\n showAddButton = false,\n onAddButtonClick,\n addButtonText = \"Add\",\n compact = false,\n}: HueGridProps) {\n const colsClass = compact ? \"grid-cols-4\" : GRID_COLUMNS[Math.min(6, Math.max(1, columns))];\n return (\n <div className={className}>\n {title && <h2 className=\"mb-4 text-base font-semibold\">{title}</h2>}\n {description && <p className=\"type-body mb-4 text-muted-foreground\">{description}</p>}\n <div className={cn(\"grid\", compact ? \"gap-2\" : \"gap-4\", colsClass)}>\n {items.map((item, index) => (\n <HueCard key={`card-${index}`} {...item} compact={compact} className={cn(cardClassName, item.className)} />\n ))}\n {showAddButton && (\n <button\n type=\"button\"\n onClick={onAddButtonClick}\n className={cn(\n \"flex cursor-pointer flex-col items-center justify-center space-y-3 rounded-xl border-2 border-dashed border-border p-5 text-center transition-colors hover:bg-muted\",\n cardClassName,\n )}\n >\n <span className=\"rounded-full bg-muted p-3 text-muted-foreground\">\n <PlusIcon className=\"h-7 w-7\" />\n </span>\n <span className=\"text-lg font-semibold\">{addButtonText}</span>\n </button>\n )}\n </div>\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* HueRow / HueList */\n/* ------------------------------------------------------------------ */\n\nexport interface HueRowProps {\n title: string;\n description?: string;\n descriptionNode?: React.ReactNode;\n icon: SizedIcon;\n color: CardColor;\n path?: string;\n className?: string;\n rightIcon?: React.ReactNode;\n onClick?: () => void;\n showBorder?: boolean;\n isLast?: boolean;\n}\n\nexport function HueRow({\n title,\n description,\n descriptionNode,\n icon,\n color,\n path,\n className,\n rightIcon = <ChevronRightIcon className=\"h-5 w-5 text-muted-foreground\" />,\n onClick,\n showBorder = true,\n isLast = false,\n}: HueRowProps) {\n return (\n <Destination path={path} onClick={onClick}>\n <div\n data-tone={tone(color)}\n className={cn(\n \"matrx-hue-card matrx-hue-surface flex cursor-pointer items-center justify-between rounded-lg p-4 transition-colors\",\n !isLast && showBorder && \"border-b border-border\",\n className,\n )}\n >\n <div className=\"flex items-center\">\n <div className=\"matrx-hue-icon mr-4 rounded-lg p-2\">{sizedIcon(icon, 20)}</div>\n <div>\n <h3 className=\"font-medium\">{title}</h3>\n {description && <p className=\"type-body text-muted-foreground\">{description}</p>}\n {descriptionNode && !description && descriptionNode}\n </div>\n </div>\n {rightIcon}\n </div>\n </Destination>\n );\n}\n\nexport interface HueListProps {\n title?: string;\n description?: string;\n items: HueRowProps[];\n className?: string;\n /** Places every row; never how it looks. */\n cardClassName?: string;\n showBorders?: boolean;\n /** Wrap the rows in the raised rounded container. Default true. */\n showContainer?: boolean;\n}\n\nexport function HueList({\n title,\n description,\n items,\n className,\n cardClassName,\n showBorders = true,\n showContainer = true,\n}: HueListProps) {\n const rows = items.map((item, index) => (\n <HueRow\n key={`row-${index}`}\n {...item}\n isLast={index === items.length - 1}\n showBorder={showBorders}\n className={cn(cardClassName, item.className)}\n />\n ));\n return (\n <div className={className}>\n {title && <h2 className=\"mb-4 text-base font-semibold\">{title}</h2>}\n {description && <p className=\"type-body mb-4 text-muted-foreground\">{description}</p>}\n {showContainer ? <div className=\"rounded-xl bg-card shadow-md\">{rows}</div> : rows}\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* IosWidget */\n/* ------------------------------------------------------------------ */\n\nexport interface IosWidgetProps {\n title: string;\n description?: string;\n icon: SizedIcon;\n color: CardColor;\n path?: string;\n badge?: string;\n className?: string;\n onClick?: () => void;\n}\n\n/** The iOS 2x2 widget: occupies the grid area its parent gives it; a hue gradient, a large icon, title, brief text. */\nexport function IosWidget({ title, description, icon, color, path, badge, className, onClick }: IosWidgetProps) {\n return (\n <Destination path={path} onClick={onClick} className=\"contents\">\n <div\n data-tone={tone(color)}\n className={cn(\n \"matrx-hue-card matrx-hue-squircle flex h-full w-full cursor-pointer select-none flex-col justify-between rounded-[20px] p-3 shadow-md transition-[filter] active:brightness-90\",\n className,\n )}\n >\n <div className=\"flex items-start justify-between\">\n <div>{sizedIcon(icon, 32)}</div>\n {badge && (\n <span className=\"type-meta rounded-full bg-black/25 px-2 py-0.5 font-semibold leading-tight\">{badge}</span>\n )}\n </div>\n <div>\n <p className=\"type-title line-clamp-2 leading-tight\">{title}</p>\n {description && <p className=\"type-meta mt-0.5 line-clamp-2 leading-tight\">{description}</p>}\n </div>\n </div>\n </Destination>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* TileCard / TileCardGrid */\n/* ------------------------------------------------------------------ */\n\nexport interface TileCardProps {\n icon?: React.ReactNode;\n title?: React.ReactNode;\n description?: React.ReactNode;\n onClick?: () => void;\n href?: string;\n /** Places the tile (width, height); never how it looks. */\n className?: string;\n}\n\n/** A tall, plain tile: a primary-ink icon and title over a muted description; the border takes the brand on hover. */\nexport function TileCard({ icon, title, description, onClick, href, className }: TileCardProps) {\n const face = cn(\n \"flex h-64 cursor-pointer flex-col items-center justify-center space-y-6 rounded-xl border-2 border-border bg-muted p-4 text-xl transition-colors hover:border-primary hover:bg-accent\",\n className,\n );\n const content = (\n <>\n {icon && <div className=\"h-12 w-12 text-primary-ink\">{icon}</div>}\n {title && <span className=\"font-medium text-primary-ink\">{title}</span>}\n {description && <p className=\"type-secondary mt-1 text-center text-muted-foreground\">{description}</p>}\n </>\n );\n return href ? (\n <HostLink href={href} className={face}>\n {content}\n </HostLink>\n ) : (\n <div onClick={onClick} className={face}>\n {content}\n </div>\n );\n}\n\nexport interface TileCardGridProps {\n title?: React.ReactNode;\n description?: React.ReactNode;\n cards: TileCardProps[];\n /** 1 to 4 columns from the md breakpoint. Default 2. */\n columns?: 1 | 2 | 3 | 4;\n className?: string;\n}\n\nconst TILE_COLUMNS = { 1: \"md:grid-cols-1\", 2: \"md:grid-cols-2\", 3: \"md:grid-cols-3\", 4: \"md:grid-cols-4\" } as const;\n\nexport function TileCardGrid({ title, description, cards, columns = 2, className }: TileCardGridProps) {\n return (\n <div className={cn(\"w-full\", className)}>\n {(title || description) && (\n <div className=\"pb-8 text-center\">\n {title && <h2 className=\"text-2xl font-bold text-foreground md:text-3xl\">{title}</h2>}\n {description && <p className=\"mt-2 text-muted-foreground\">{description}</p>}\n </div>\n )}\n <div className={cn(\"grid grid-cols-1 gap-6\", TILE_COLUMNS[columns] ?? TILE_COLUMNS[2])}>\n {cards.map((card, index) => (\n <TileCard key={index} {...card} />\n ))}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAAC;AAAA,EAAA;AA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kB,WAAW,MAC/B,mBACH;AAEJ;AAWA,IAAM,eAAe,EAAE,GAAG,kBAAkB,GAAG,kBAAkB,GAAG,kBAAkB,GAAG,iBAAiB;AAEnG,SAAS,aAAa,EAAE,OAAO,aAAa,OAAO,UAAU,GAAG,UAAU,GAAsB;AACrG,SACE,+CAAC,SAAI,WAAW,GAAG,UAAU,SAAS,GAClC;AAAA,cAAS,gBACT,+CAAC,SAAI,WAAU,oBACZ;AAAA,eAAS,8CAAC,QAAG,WAAU,kDAAkD,iBAAM;AAAA,MAC/E,eAAe,8CAAC,OAAE,WAAU,8BAA8B,uBAAY;AAAA,OACzE;AAAA,IAEF,8CAAC,SAAI,WAAW,GAAG,0BAA0B,aAAa,OAAO,KAAK,aAAa,CAAC,CAAC,GAClF,gBAAM,IAAI,CAAC,MAAM,UAChB,8CAAC,YAAsB,GAAG,QAAX,KAAiB,CACjC,GACH;AAAA,KACF;AAEJ;","names":["Button","Select","SelectTrigger","Textarea","import_react_slot","React","React","import_jsx_runtime","React","import_jsx_runtime","React","import_jsx_runtime","React","React","import_jsx_runtime","import_jsx_runtime","tone","import_class_variance_authority","React","import_jsx_runtime","React","React","import_jsx_runtime","import_jsx_runtime","Button","tone","Select","Textarea","React","import_jsx_runtime","React","import_jsx_runtime","Button","import_dates","React","import_vaul","React","import_react_slot","React","import_jsx_runtime","React","import_jsx_runtime","CONTEXT_SLOT","contextRegistry","import_jsx_runtime","DrawerPrimitive","import_jsx_runtime","DrawerPrimitive","React","import_jsx_runtime","v","import_jsx_runtime","emit","days","SelectPrimitive","React","import_jsx_runtime","SelectTrigger","import_react_slot","React","import_react_tree","React","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","tone","Button","import_react","import_jsx_runtime","React","import_jsx_runtime","import_jsx_runtime","state","step","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","DialogPrimitive","React","React","import_jsx_runtime","import_jsx_runtime","CommandPrimitive","CommandPrimitive","CommandPrimitive","import_jsx_runtime","import_jsx_runtime","import_react","React","import_jsx_runtime","import_jsx_runtime","Button","Icon","import_jsx_runtime","Icon","import_jsx_runtime","import_jsx_runtime","TONE","tone","Icon","Button","React","import_jsx_runtime","import_react","import_jsx_runtime","Button","import_react","React","import_jsx_runtime","import_jsx_runtime","Button","import_react","import_jsx_runtime","import_jsx_runtime","tone","Icon","React","import_jsx_runtime","import_jsx_runtime","Button","React","import_jsx_runtime","registry","ErrorBox","React","import_jsx_runtime","Label","import_jsx_runtime","Label","React","import_jsx_runtime","useState","useLayoutEffect","useRef","React","text","Button","import_clipboard","import_notify","import_clipboard_fallback_opener","React","import_jsx_runtime","Button","React","import_jsx_runtime","HostLink","import_jsx_runtime","import_jsx_runtime","tone","React","import_jsx_runtime","Button","import_react","import_jsx_runtime","Icon","React","import_jsx_runtime","Icon","Button","React","import_jsx_runtime","React","import_jsx_runtime","React","import_jsx_runtime","React","import_jsx_runtime","React","import_jsx_runtime","IconSelectTrigger","Button","React","import_clipboard","import_clipboard_fallback_opener","import_notify","React","import_jsx_runtime","CollapsibleTrigger","CollapsibleContent","DialogPrimitive","VisuallyHidden","import_react_tree","React","React","import_jsx_runtime","CONTEXT_SLOT","registry","import_react","clamp","swallowClick","import_jsx_runtime","CONTEXT_SLOT","contextRegistry","DIALOG_DESKTOP_CLASSES","DIALOG_MOBILE_SHEET_CLASSES","DIALOG_MOBILE_SHEET_OVERRIDE","import_jsx_runtime","Icon","tooltipSide","Button","import_jsx_runtime","CollapsibleTrigger","CollapsibleContent","import_jsx_runtime","TONE","Icon","tone","Button","React","import_jsx_runtime"]}
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/solid-surface.ts","../src/icons.tsx","../src/portal-container.tsx","../src/menu-scroll-edges.tsx","../src/use-scroll-fade.ts","../src/submenu-focus.ts","../src/submenu-side.tsx","../src/focus-return.ts","../src/select.tsx","../src/field-surface.ts","../src/controls/icon-only.ts","../src/textarea.tsx","../src/controls/window-controls.tsx","../src/controls/decision-control.tsx","../src/controls/date-field.tsx","../src/bottom-sheet.tsx","../src/drawer.tsx","../src/floating-layer.tsx","../src/title-tooltips.ts","../src/radix-dialog-modal-context.tsx","../src/popover.tsx","../src/use-is-mobile.ts","../src/controls/date-parse.ts","../src/controls/doors.tsx","../src/controls/surfaces.tsx","../src/alert-dialog.tsx","../src/confirm-dialog.tsx","../src/skeleton.tsx","../src/controls/number-stepper.tsx","../src/slider.tsx","../src/controls/stage-steps.tsx","../src/controls/checklist.tsx","../src/controls/clamped-number-input.tsx","../src/controls/light-switch-toggle.tsx","../src/controls/option-combobox.tsx","../src/command.tsx","../src/close-slot.tsx","../src/controls/aspect-ratio-options.ts","../src/controls/aspect-ratio-select.tsx","../src/controls/configuration-fields.tsx","../src/table.tsx","../src/controls/value-summary.ts","../src/indicator-strip.tsx","../src/controls/middle-truncate.tsx","../src/controls/callout-banner.tsx","../src/controls/gated-action-button.tsx","../src/controls/search-input.tsx","../src/controls/collapsible-text.tsx","../src/tooltip.tsx","../src/controls/info-hint.tsx","../src/controls/status-badge.tsx","../src/controls/structured-section-card.tsx","../src/controls/icon-dropdown-menu.tsx","../src/error-box.tsx","../src/desktop/errors.ts","../src/error-sentence.ts","../src/label.tsx","../src/controls/field.tsx","../src/controls/help-icon.tsx","../src/controls/text-array-input.tsx","../src/host-link.tsx","../src/stand-in-notice.ts","../src/tap-target/link.ts","../src/read-state/untrusted-count.tsx","../src/controls/kpi-tile.tsx","../src/controls/action-feedback-button.tsx","../src/controls/citation-chip.tsx","../src/controls/tool-rail.tsx","../src/controls/page-range-input.tsx","../src/controls/page-ranges.ts","../src/controls/opacity-slider.tsx","../src/controls/color-swatch-row.tsx","../src/controls/anchored-toolbar.tsx","../src/controls/icon-select.tsx","../src/controls/advanced-collapsible.tsx","../src/collapsible.tsx","../src/dialog.tsx","../src/look.tsx","../src/layer-front.ts","../src/window-drag.ts","../src/drag-cursor.ts","../src/icon-button.tsx","../src/controls/empty-state-card.tsx","../src/controls/hue-cards.tsx"],"sourcesContent":["\"use client\";\n\n/**\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 CHIP_TONES,\n Chip,\n ChipSet,\n CONTROLS_COLLAPSE_BELOW_REM,\n CONTROLS_CONTAINER_CLASS,\n CONTROLS_CONTAINER_NAME,\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 GlyphTone,\n ChipHue,\n ChipProps,\n ChipSetProps,\n ChipTone,\n ControlRowProps,\n ControlVariant,\n ControlWidth,\n FieldProps,\n SegmentedControlProps,\n SegmentOption,\n SelectOption,\n SelectProps,\n SwitchProps,\n TabsProps,\n TextareaProps,\n} from \"./controls\";\n// THE window chrome: a floating window's traffic lights and title-bar icon actions at macOS geometry (2026-10-23).\nexport { WindowChromeButton, WindowLight, WindowLights } from \"./window-controls\";\nexport type { WindowChromeButtonProps, WindowLightKind, WindowLightProps, WindowLightsProps } from \"./window-controls\";\n// THE row decision: [Yes] [No] [Other] + the Other picker ending in \"Skip for now\" (Arman, 2026-10-14).\nexport { DecisionControl } from \"./decision-control\";\nexport type { DecisionAnswer, DecisionControlProps, WayOutItem } from \"./decision-control\";\n// THE date control: typed entry + calendar popover (sheet on a phone), ISO in and out.\nexport { DateField, DateTimeField, TimeField } from \"./date-field\";\nexport type { DateFieldMode, DateFieldProps } from \"./date-field\";\nexport { formatDay, formatTime, parseTypedDate, parseTypedTime } from \"./date-parse\";\n// The compound doors: the same controls behind the Radix compound / bare-<input> APIs.\nexport { Input, SelectTrigger, TabsList, TabsTrigger } from \"./doors\";\nexport type { InputProps, SelectTriggerProps, TabsListProps, TabsVariant } from \"./doors\";\nexport {\n ConfirmDelete,\n DangerZone,\n DeleteButton,\n DisclosureHeader,\n EmptyState,\n PromoBanner,\n RegionSkeleton,\n RowGroup,\n SettingRow,\n Tile,\n} from \"./surfaces\";\nexport type {\n ConfirmDeleteProps,\n DeleteButtonProps,\n DisclosureHeaderProps,\n DisclosureHeaderVariant,\n EmptyStateProps,\n PromoBannerProps,\n PromoTone,\n RegionSkeletonProps,\n RowGroupProps,\n SettingRowProps,\n TileLayout,\n TileProps,\n} from \"./surfaces\";\n\n// Moved from matrx-frontend (chat host slots get real package defaults, 2026-10-08).\nexport { NumberStepper, type NumberStepperProps } from \"./number-stepper\";\n// The shared range control, also used by OpacitySlider; keep drag and keyboard semantics.\nexport { Slider, type SliderProps } from \"../slider\";\nexport { StageSteps, stageStates, type StageStep, type StageState, type StageStepsProps } from \"./stage-steps\";\nexport {\n Checklist,\n ChecklistItem,\n ChecklistMark,\n ChecklistMeter,\n type ChecklistItemProps,\n type ChecklistMeterProps,\n type ChecklistProps,\n type ChecklistState,\n} from \"./checklist\";\nexport { ClampedNumberInput, clampDraft, shownDraft, type ClampedNumberInputProps } from \"./clamped-number-input\";\nexport { LightSwitchToggle, type LightSwitchToggleProps } from \"./light-switch-toggle\";\nexport { OptionCombobox, type OptionComboboxGroup, type OptionComboboxProps } from \"./option-combobox\";\nexport { AspectRatioSelect, AspectRatioGlyph, type AspectRatioSelectProps } from \"./aspect-ratio-select\";\nexport {\n parseRatio,\n isAspectRatioOptionSet,\n ratioShapeName,\n humanizeRatioWord,\n groupRatioOptions,\n type ParsedRatio,\n type RatioGroups,\n} from \"./aspect-ratio-options\";\nexport {\n CONFIGURATION_CHOICE_SIZE,\n FieldHelp,\n StatusToken,\n PropertyRow,\n MissingTag,\n type PropertyRowProps,\n ConfigurationValueList,\n ConfigurationTable,\n ConfigurationTableRow,\n type ConfigurationColumn,\n} from \"./configuration-fields\";\n// THE one-line summary of collected data for a closed PropertyRow (value-summary.ts).\nexport { valueSummary, isCollectedValue } from \"./value-summary\";\n// THE yes/no icon strip for a table cell: every flag always drawn, muted when off (indicator-strip.tsx).\nexport { IndicatorStrip, indicatorText } from \"../indicator-strip\";\nexport type { IndicatorItem, IndicatorStripProps, IndicatorTone } from \"../indicator-strip\";\n\n// Moved from matrx-frontend components/official (2026-10-22): the pure and light units.\nexport { MiddleTruncate, splitForMiddleTruncate } from \"./middle-truncate\";\nexport { CalloutBanner, type CalloutTone } from \"./callout-banner\";\nexport { GatedActionButton, firstBlockingReason, type BlockingCheck, type GatedActionButtonProps } from \"./gated-action-button\";\nexport { SearchInput, type SearchInputProps } from \"./search-input\";\nexport { CollapsibleText, CollapsibleTextGroupControls } from \"./collapsible-text\";\nexport { InfoHint, type InfoHintProps } from \"./info-hint\";\nexport { StatusBadge, STATUS_TONES, type StatusBadgeProps, type StatusBadgeSize, type StatusTone } from \"./status-badge\";\nexport { StructuredSectionCard, type StructuredSectionCardProps, type StructuredSectionCardTitleTone } from \"./structured-section-card\";\nexport { IconDropdownMenu, type IconDropdownMenuProps, type IconDropdownOption } from \"./icon-dropdown-menu\";\nexport { LabeledField, type LabeledFieldProps } from \"./field\";\nexport { HelpIcon, type HelpIconProps } from \"./help-icon\";\nexport { TextArrayInput, cleanUrl, type TextArrayInputProps } from \"./text-array-input\";\nexport { KpiGrid, KpiTile, type KpiTileProps, type KpiTone, type KpiTrend } from \"./kpi-tile\";\nexport { ActionFeedbackButton, type ActionFeedbackButtonProps } from \"./action-feedback-button\";\nexport { CitationChip, CitationPopoverBody, type CitationChipProps, type CitationPopoverBodyProps } from \"./citation-chip\";\n\n// Acrobat-style workspace controls (PDF-PLAN U5): rail, page ranges, opacity, swatches, anchored toolbar.\nexport { ToolRail, type ToolRailItem, type ToolRailProps } from \"./tool-rail\";\nexport { PageRangeInput, type PageRangeInputProps } from \"./page-range-input\";\nexport {\n formatPageRanges,\n parsePageRanges,\n spansOf,\n type PageRangeIssue,\n type PageRangeIssueKind,\n type ParsedPageRanges,\n} from \"./page-ranges\";\nexport { OpacitySlider, type OpacitySliderProps } from \"./opacity-slider\";\nexport { ColorSwatchRow, type ColorSwatch, type ColorSwatchRowProps } from \"./color-swatch-row\";\nexport { AnchoredToolbar, type AnchorRect, type AnchoredToolbarProps } from \"./anchored-toolbar\";\n// Wave 3 (2026-10-22): moved from matrx-frontend components/official.\nexport { IconSelect, type IconSelectItem, type IconSelectProps } from \"./icon-select\";\nexport { AdvancedCollapsible, type AdvancedCollapsibleProps } from \"./advanced-collapsible\";\nexport { EmptyStateCard, type EmptyStateCardProps } from \"./empty-state-card\";\nexport {\n HUE_TONE,\n HueCard,\n HueGrid,\n HueList,\n HueRow,\n IosWidget,\n TileCard,\n TileCardGrid,\n type CardColor,\n type CardSize,\n type HueCardProps,\n type HueGridProps,\n type HueListProps,\n type HueRowProps,\n type IosWidgetProps,\n type TileCardGridProps,\n type TileCardProps,\n} from \"./hue-cards\";\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 color 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 behavior 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 DropdownMenuLabel,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"../dropdown-menu\";\nimport { MagnifyingGlassIcon, PlusIcon } from \"../icons\";\nimport { SelectChevron } from \"../select\";\nimport { isIconOnly } from \"./icon-only\";\nimport { boxStyle, useAutoGrow, useMergedTextareaRef } from \"../textarea\";\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 * THE CONTAINER a collapsing control measures (`Button collapse=\"container\"`).\n * A host declares it on the box whose WIDTH decides — a list pane, a panel,\n * never the viewport: beside a chat panel a 1024px screen holds a 540px list.\n * `className={CONTROLS_CONTAINER_CLASS}`, or add the name to the box's own\n * `container-name` when it already names a container (`list matrx-controls`).\n */\nexport const CONTROLS_CONTAINER_NAME = \"matrx-controls\";\nexport const CONTROLS_CONTAINER_CLASS = \"matrx-controls-container\";\n/** Below this container width a `collapse=\"container\"` button is its icon alone (48rem). */\nexport const CONTROLS_COLLAPSE_BELOW_REM = 48;\n\n/* ------------------------------------------------------------------ */\n/* Button */\n/* ------------------------------------------------------------------ */\n\n/**\n * Tone, never size. `success` is the solid confirm-a-good-outcome fill (approve,\n * publish, mark done); `link` is a text action at the control's height — no\n * fill, no border, primary ink, underline on hover (an inline \"View all\").\n */\nexport type ControlVariant = \"primary\" | \"quiet\" | \"outline\" | \"danger\" | \"success\" | \"link\" | \"meta\";\n\n/**\n * THE NAMED CONTROL WIDTHS (0.68.22) — a button, field or select trigger that should not fill\n * its row takes one of these instead of a pasted `w-40`. Derived from the call sites:\n * `xs` 6rem (a unit, a short enum), `sm` 8rem, `md` 10rem (a date, a status), `lg` 14rem (a\n * name, an account), `xl` 20rem (a search, a URL). Never wider than its container.\n */\nexport type ControlWidth = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n\ninterface ButtonBase extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"children\"> {\n /** Tone, never size. Default `outline`. */\n variant?: ControlVariant;\n /** A status tint from the role tokens (the Badge's), for a button that\n * reports a state — a drift door, an alert count. Default: none. */\n tone?: BadgeTone;\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 /**\n * `\"container\"`: below 48rem of the nearest `matrx-controls` container\n * (CONTROLS_CONTAINER_NAME) the button is its leading `icon` alone — a 28px\n * circle; the label stays its accessible name and its tooltip. Needs `icon`;\n * without one it never collapses. Outside such a container it never does.\n */\n collapse?: \"container\";\n /**\n * A TOGGLE (a choice in a set, a mode, a tab-like switch): `true` is on —\n * the accent fill and full ink; `false` is off — no fill, quiet ink. Sets\n * `aria-pressed`. Omit for an ordinary action.\n */\n pressed?: boolean;\n /**\n * A count or a dot on the button's top-right corner, for something waiting\n * behind it (items added, unread). A number draws the count (99+ above 99;\n * 0 draws nothing); `true` draws an 8px dot. On a button with a text label\n * the count sits in the row after the label instead (never over it). Name it in `aria-label` too —\n * the mark is decoration.\n */\n badge?: number | boolean;\n /**\n * The glyph's own status ink, for a glyph whose COLOR carries meaning (the\n * green check after a copy, an amber debug bug) while the button stays\n * quiet. Tints only the icon(s), never the fill. Default: none.\n */\n glyphTone?: GlyphTone;\n /**\n * A removing act (clear, remove, disconnect): muted until hover,\n * destructive on hover — the delete tier-1 skin on any glyph or label.\n * Quiet variant only.\n */\n removes?: boolean;\n /**\n * MIXED CONTENT (0.68.12): a short muted fact after the label — a count, a\n * size, a shortcut, a \"3 of 12\" — in the 12px secondary ink. The button\n * stays 28px; the fact is part of the button, never a second element styled\n * beside it. Never a sentence.\n */\n meta?: React.ReactNode;\n /** A named width instead of the label's own (see `ControlWidth`). */\n width?: ControlWidth;\n /**\n * THE INVITING-PAGE CALL TO ACTION (0.68.22): a 44px capsule with a 16px/600 label and a\n * 24px inset — the size a marketing hero, a module landing or a kit's front door asks for.\n * Inviting pages are never densified; functional pages never use it. A `primary` hero\n * carries a soft primary glow.\n */\n hero?: boolean;\n}\n/** The status inks a glyph may carry (the role tokens). */\nexport type GlyphTone = \"success\" | \"warning\" | \"destructive\" | \"info\" | \"primary\";\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 / success / link, 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\", tone, icon, iconEnd, asChild = false, collapse, pressed, badge, glyphTone, removes, meta, width, hero, children, onClick, type, ...props }, ref) => {\n const Component = asChild ? Slot : \"button\";\n const badgeText =\n typeof badge === \"number\" ? (badge > 0 ? (badge > 99 ? \"99+\" : String(badge)) : null) : badge ? \"\" : null;\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 const collapses = collapse === \"container\" && Boolean(icon) && Boolean(label);\n return (\n <Component\n ref={ref}\n type={asChild ? undefined : (type ?? \"button\")}\n data-matrx-control=\"button\"\n data-variant={variant}\n data-tone={tone && tone !== \"neutral\" ? tone : undefined}\n data-glyph={glyphSlot(icon, iconEnd, label)}\n data-collapse={collapses ? \"container\" : undefined}\n data-pressed={pressed === undefined ? undefined : pressed ? \"true\" : \"false\"}\n aria-pressed={pressed}\n data-badge={badgeText === null ? undefined : badgeText === \"\" ? \"dot\" : \"count\"}\n // A labeled button carries its count IN the row after the label: the\n // corner count sat over the label's last letter (\"HR 28\" on /tasks).\n data-badge-place={badgeText && label ? \"inline\" : undefined}\n data-glyph-tone={glyphTone}\n data-delete={removes ? \"\" : undefined}\n data-width={width}\n data-hero={hero ? \"\" : undefined}\n className={cn(\"matrx-control matrx-control-button matrx-glyph-trim\", className)}\n // A collapsed button still says what it does on hover.\n title={collapses && typeof label === \"string\" && props.title === undefined ? label : undefined}\n {...props}\n aria-disabled={disabledChild ? true : ariaDisabled}\n tabIndex={disabledChild ? -1 : props.tabIndex}\n onClick={inert ? swallowClick : onClick}\n >\n {icon}\n <Slottable>\n {/* A text label NEVER spills past its button (owner, 2026-10-05: a\n long chat title ran under the mode switch beside it). It sits in\n its own box so a capped button ellipsizes instead of overflowing. */}\n {!asChild && (typeof children === \"string\" || typeof children === \"number\") ? (\n <span className=\"matrx-control-button-label\">{children}</span>\n ) : (\n children\n )}\n </Slottable>\n {meta === undefined || meta === null || meta === false ? null : (\n <span className=\"matrx-control-button-meta\">{meta}</span>\n )}\n {iconEnd}\n {badgeText === null ? null : (\n <span className=\"matrx-control-button-badge\" aria-hidden=\"true\">\n {badgeText}\n </span>\n )}\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 /** A named width instead of filling the row (see `ControlWidth`). */\n width?: ControlWidth;\n /**\n * THE INVITING-PAGE INPUT: a 56px capsule with an 18px value and a 24px inset — the big,\n * friendly field a welcome / onboarding front door asks for (pairs with Button `hero`).\n * Inviting pages only; functional pages never use it.\n */\n hero?: boolean;\n /**\n * THE LEADING SEARCH: a 48px filled capsule — no frame, the muted fill, a 16px value, a 20px\n * glyph — that turns the card color with a soft lift on focus. The one search a home page leads\n * with (a file home's search, as on Google Docs / Drive). One per page; never in a form or toolbar.\n */\n filled?: boolean;\n /**\n * BARE: the surrounding surface draws the frame (a search pill with its own glyphs and buttons).\n * No border, no fill, no focus ring — the host capsule shows focus.\n */\n bare?: boolean | undefined;\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, width, hero, filled, bare, ...props }, ref) => (\n <label\n data-matrx-control=\"field\"\n data-glyph={icon ? \"start\" : undefined}\n data-width={width}\n data-hero={hero ? \"\" : undefined}\n data-filled={filled ? \"\" : undefined}\n data-variant={bare ? \"bare\" : 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 /** Muted text right after the label, menu and trigger alike: what tells two same-named options apart (a short id, an owner). */\n hint?: string;\n /** A section heading: the menu shows it (foreground weight) above the first option of each consecutive run. */\n group?: string;\n /** Shown but not choosable (an unavailable tool, a sentinel the URL set). */\n disabled?: boolean;\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 /**\n * `field` (default): the capsule a form row uses. `inline`: the value as text with a small chevron,\n * no capsule — for a choice that sits inside a dense row or a toolbar sentence (\"Full ⌄\"), where a\n * row of capsules reads as clutter (Arman, 2026-10-14).\n */\n variant?: \"field\" | \"inline\";\n /**\n * A search row at the top of the menu once there are at least this many options (a long list of\n * organizations). It matches label, hint and group. Omitted: never.\n */\n searchAt?: number;\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 variant = \"field\",\n searchAt,\n}: SelectProps<T>) {\n const current = options.find((o) => o.value === value);\n const [query, setQuery] = React.useState(\"\");\n const searchable = searchAt !== undefined && options.length >= searchAt;\n const q = searchable ? query.trim().toLowerCase() : \"\";\n const shown = q ? options.filter((o) => [o.label, o.hint, o.group].some((t) => t?.toLowerCase().includes(q))) : options;\n return (\n <DropdownMenu onOpenChange={(open) => !open && setQuery(\"\")}>\n <DropdownMenuTrigger asChild disabled={disabled}>\n <button\n type=\"button\"\n data-matrx-control=\"select\"\n data-variant={variant === \"inline\" ? \"inline\" : undefined}\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 {current?.hint ? <span className=\"text-muted-foreground\" data-select-hint=\"\">{current.hint}</span> : null}\n </span>\n <SelectChevron />\n </button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align={align} className=\"max-h-80 w-max min-w-[max(10rem,var(--radix-dropdown-menu-trigger-width))] max-w-[min(24rem,var(--radix-dropdown-menu-content-available-width))] overflow-y-auto\">\n {searchable ? (\n <div className=\"sticky top-0 z-10 bg-popover p-1\" data-select-search=\"\">\n <SearchField\n className=\"w-full\"\n value={query}\n autoFocus\n aria-label={`Search ${ariaLabel}`}\n onChange={(e) => setQuery(e.target.value)}\n // The menu's type-ahead never takes the letters; arrows and Escape still drive the menu.\n onKeyDown={(e) => {\n if (e.key !== \"ArrowDown\" && e.key !== \"ArrowUp\" && e.key !== \"Escape\" && e.key !== \"Tab\") e.stopPropagation();\n }}\n />\n </div>\n ) : null}\n {searchable && shown.length === 0 ? <div className=\"px-2 py-1.5 text-[0.8125rem] text-muted-foreground\" role=\"status\">No match</div> : null}\n <DropdownMenuRadioGroup value={value} onValueChange={(v) => onValueChange(v as T)}>\n {shown.map((o, i) => (\n <React.Fragment key={o.value}>\n {o.group && o.group !== shown[i - 1]?.group ? (\n <>\n {i > 0 ? <DropdownMenuSeparator /> : null}\n <DropdownMenuLabel>{o.group}</DropdownMenuLabel>\n </>\n ) : null}\n <DropdownMenuRadioItem value={o.value} disabled={o.disabled === true} className=\"text-[0.8125rem]\">\n {/* The label truncates; the hint never does (it is what tells two same-named options apart). */}\n <span className=\"flex min-w-0 flex-1 items-baseline\">\n <span className=\"min-w-0 truncate\">{o.label}</span>\n {o.hint ? <span className=\"ml-1.5 shrink-0 text-muted-foreground\" data-select-hint=\"\">{o.hint}</span> : null}\n </span>\n {o.meta ? <span className=\"ml-3 text-[0.6875rem] text-muted-foreground\">{o.meta}</span> : null}\n </DropdownMenuRadioItem>\n </React.Fragment>\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 /** The selected segment; `null` = none is selected (an optional choice). */\n value: T | null;\n onValueChange: (value: T) => void;\n data: readonly SegmentOption<T>[];\n \"aria-label\": string;\n /** The segments share the row's whole width equally (a full-width choice: levels, modes). */\n fill?: boolean;\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 | null;\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 data-icon-only={o.count == null && isIconOnly(o.label) ? \"\" : undefined}\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 fill,\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 data-fill={fill ? \"\" : undefined}\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 /** Underline tabs inside a framed panel (a card, a bordered box): the labels start at the\n * panel's 12px content inset while the hairline still runs edge to edge. Page-level tabs\n * stay flush with the page gutter (default). Arman, 2026-10-21. */\n inset?: 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 inset = false,\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 data-inset={inset ? \"\" : undefined}\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 /** A 12px glyph before the label, 4px gap, in the badge's own tone color. */\n icon?: React.ReactNode;\n}\n\n/** Outline, 18px, 11px text, clamped to one line (≤20rem) — never a sentence. */\nexport function Badge({ tone = \"neutral\", icon, 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 {icon ? (\n <span className=\"matrx-control-badge-icon\" aria-hidden=\"true\">\n {icon}\n </span>\n ) : null}\n <span>{children}</span>\n </span>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Chip and ChipSet */\n/* ------------------------------------------------------------------ */\n\n/**\n * The status tones (the Badge's) plus a FIXED set of categorical hues, each a\n * token pair in `controls.css` (`--matrx-chip-<hue>`, stepped for dark). A\n * feature maps its kinds onto these through ONE table of its own\n * (`kind → ChipTone`) — never a class string.\n */\nexport type ChipHue =\n | \"sky\"\n | \"blue\"\n | \"indigo\"\n | \"violet\"\n | \"fuchsia\"\n | \"rose\"\n | \"orange\"\n | \"amber\"\n | \"lime\"\n | \"emerald\"\n | \"teal\"\n | \"cyan\"\n | \"slate\";\nexport type ChipTone = BadgeTone | ChipHue;\n\n/** Every tone a chip accepts, in a fixed order (tests, pickers, demos). */\nexport const CHIP_TONES: readonly ChipTone[] = [\n \"neutral\",\n \"primary\",\n \"success\",\n \"warning\",\n \"destructive\",\n \"info\",\n \"sky\",\n \"blue\",\n \"indigo\",\n \"violet\",\n \"fuchsia\",\n \"rose\",\n \"orange\",\n \"amber\",\n \"lime\",\n \"emerald\",\n \"teal\",\n \"cyan\",\n \"slate\",\n] as const;\n\nexport interface ChipProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, \"children\"> {\n /** The one line of text. Truncates; the full text is the tooltip. */\n label: string;\n /** `item` (default): an existing thing, tinted. `add`: a suggestion to make\n * one — dashed, quiet, with the package's own leading `+`. */\n variant?: \"item\" | \"add\";\n /** A named tone, never a class. Default `neutral`. Ignored by `add`. */\n tone?: ChipTone;\n /** Leading glyph (drawn 14px, optically trimmed). */\n icon?: React.ReactNode;\n /** Put the chip's skin on the one child element (a link or a button); the\n * child carries no children of its own — the chip draws glyph + label. */\n asChild?: boolean;\n /**\n * A FILTER chip (a toggle in a set of choices): `true` is on — tinted in its\n * `tone` (default `primary`); `false` is off — untinted outline, quiet ink.\n * Sets `aria-pressed`. Use with `asChild` on a `<button>`. Omit for a tag.\n */\n pressed?: boolean;\n children?: React.ReactElement;\n}\n\n/**\n * THE chip: a tag that names a thing (a format, a kind, a status, a source).\n * ONE 24px height, one 6px radius, one 12px/500 label, 14px glyph, matched\n * insets, single line with an ellipsis and a tooltip, and the controls' 3px\n * half-gap of its own so a `ChipSet` adds none. Geometry and tint are locked\n * in `controls.css`; a call site may place it, never restyle it.\n */\nexport const Chip = React.forwardRef<HTMLSpanElement, ChipProps>(\n ({ label, variant = \"item\", tone, icon, asChild = false, pressed, children, className, title, ...props }, ref) => {\n const Component = asChild ? Slot : \"span\";\n const glyph = variant === \"add\" ? <PlusIcon className=\"lucide lucide-plus\" /> : icon;\n const toggle = pressed !== undefined && variant === \"item\";\n const resolvedTone = tone ?? (toggle ? \"primary\" : \"neutral\");\n return (\n <Component\n ref={ref}\n data-matrx-control=\"chip\"\n data-variant={variant}\n data-tone={variant === \"add\" ? undefined : resolvedTone}\n data-pressed={toggle ? String(pressed) : undefined}\n aria-pressed={toggle ? pressed : undefined}\n data-glyph={glyph ? (variant === \"add\" && icon ? \"both\" : \"start\") : undefined}\n className={cn(\"matrx-control-chip matrx-glyph-trim\", className)}\n title={title ?? label}\n {...props}\n >\n {glyph}\n {variant === \"add\" ? icon : null}\n {asChild ? <Slottable>{children}</Slottable> : null}\n <span className=\"matrx-control-chip-label\">{label}</span>\n </Component>\n );\n },\n);\nChip.displayName = \"Chip\";\n\nexport interface ChipSetProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * `flow` (default): chips sit at their own width and wrap.\n * `grid`: every chip is the same width (auto-filled columns of at least\n * 7.5rem), labels truncate — for a SET of siblings (a kit's formats).\n */\n layout?: \"flow\" | \"grid\";\n}\n\n/** A set of chips: same height, one baseline, the chips space themselves. */\nexport const ChipSet = React.forwardRef<HTMLDivElement, ChipSetProps>(\n ({ layout = \"flow\", className, ...props }, ref) => (\n <div\n ref={ref}\n data-matrx-control=\"chip-set\"\n data-layout={layout}\n className={cn(\"matrx-control-chip-set\", className)}\n {...props}\n />\n ),\n);\nChipSet.displayName = \"ChipSet\";\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\nexport interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {\n /** The roomy writing surface used by inviting prompt boxes. */\n hero?: boolean;\n /** Join a pinned status row below this field from the small breakpoint upward. */\n joinedBottom?: boolean;\n /** `field` (default): the field skin. `bare`: the surrounding surface draws the frame (a\n * composer) — no border, no fill, no inset, no focus ring of its own. */\n variant?: \"field\" | \"bare\";\n /** Monospace text — code, JSON, keys. */\n mono?: boolean;\n /** Grow with the content (stopping at `maxHeight`, then scroll). */\n autoGrow?: boolean;\n /** Minimum height in px (a writing area that must start tall). `rows` also sizes it. */\n minHeight?: number;\n /** Maximum height in px; past it the field scrolls. */\n maxHeight?: number;\n /** Space occupied by an overlaid control cluster, so editable text stays clear of it. */\n reservedInlineEnd?: number;\n /** Space occupied by an overlaid row of controls at the bottom of the writing area. */\n reservedBlockEnd?: number;\n}\n\n/**\n * The field skin, multi-line (8px radius — a capsule cannot hold paragraphs). Height is the\n * textarea's own business — `rows`, `minHeight`/`maxHeight`, `autoGrow`, `resize` — never a class.\n */\nexport const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, style, variant = \"field\", mono, hero, joinedBottom, autoGrow, minHeight, maxHeight, reservedInlineEnd, reservedBlockEnd, ...props }, forwarded) => {\n const { ref, callback } = useMergedTextareaRef(forwarded);\n useAutoGrow(ref, props.value, autoGrow, minHeight, maxHeight);\n return (\n <textarea\n ref={callback}\n data-matrx-control=\"textarea\"\n data-variant={variant === \"bare\" ? \"bare\" : undefined}\n data-mono={mono ? \"\" : undefined}\n data-hero={hero ? \"\" : undefined}\n data-joined-bottom={joinedBottom ? \"\" : undefined}\n className={cn(\"matrx-control-textarea\", className)}\n style={{ ...boxStyle(minHeight, maxHeight), ...style,\n ...(reservedInlineEnd === undefined ? {} : { \"--matrx-textarea-reserved-inline-end\": `${Math.max(0, reservedInlineEnd)}px` }),\n ...(reservedBlockEnd === undefined ? {} : { \"--matrx-textarea-reserved-block-end\": `${Math.max(0, reservedBlockEnd)}px` }),\n } as React.CSSProperties}\n {...props}\n />\n );\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-danger-fill text-danger-fill-foreground shadow-sm hover:bg-danger-fill/90\",\n /** The affirmative twin of `destructive` — confirm, approve, publish. */\n success:\n \"bg-success-fill text-success-fill-foreground shadow-sm hover:bg-success-fill/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-ink 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 honors), 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 behaviors 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 { SOLID_SURFACE_CLASS, type PopoverSurface } from \"./solid-surface\";\nimport { RadixCheckIcon, DotFilledIcon, RadixChevronRightIcon } from \"./icons\";\nimport { usePortalContainer } from \"./portal-container\";\nimport { useMenuScrollEdges } from \"./menu-scroll-edges\";\nimport { useSubmenuSurvivesParentPanelFocus } from \"./submenu-focus\";\nimport { useNestedSubmenuPlacement } from \"./submenu-side\";\nimport { keepMovedFocus } from \"./focus-return\";\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\n// The cap is exactly the room Radix measured. What floats at the bottom (the host publishes\n// --matrx-floating-clearance) is kept clear as COLLISION PADDING (see readBottomClearance), never subtracted\n// here: subtracting it crushed any menu opened from inside or just above that floating chrome — the attention\n// dock's snooze menu (the dock is itself bottom chrome, ~240 px) opened as a 0 px sliver.\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]:text-disabled-foreground\";\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]:text-disabled-foreground\";\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> & {\n container?: HTMLElement | null;\n /** `\"solid\"` = opaque surface (see PopoverContent `surface`). */\n surface?: PopoverSurface;\n }\n>(({ className, container, surface = \"default\", sideOffset = 2, alignOffset = -4, collisionPadding, onFocusOutside, children, ...props }, ref) => {\n const portalContainer = usePortalContainer(container);\n const [bottomClearance] = React.useState(sharedBottomClearance);\n const padding = menuCollisionPadding(collisionPadding ?? 8, 0, bottomClearance);\n // A nested submenu opens on its parent's side (see submenu-side.tsx).\n const nested = useNestedSubmenuPlacement(ref, padding);\n // A flipped submenu survives the pointer leaving its trigger (see submenu-focus.ts).\n const keep = useSubmenuSurvivesParentPanelFocus(nested.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 data-surface={surface === \"solid\" ? \"solid\" : undefined}\n sideOffset={sideOffset}\n alignOffset={alignOffset}\n {...(nested.padding === undefined ? {} : { collisionPadding: nested.padding })}\n className={cn(MENU_SURFACE_CLASS, edges.surfaceClassName, \"shadow-lg\", surface === \"solid\" && SOLID_SURFACE_CLASS, MOTION_POPPER, className)}\n {...props}\n >\n {nested.wrap(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 /** `\"solid\"` = opaque surface (see PopoverContent `surface`). */\n surface?: PopoverSurface;\n}\n\n/**\n * The px a menu keeps clear of the TOP edge: what the host publishes as `--matrx-floating-top-clearance`\n * (a page's sticky header row, on top of the app header) or, absent that, the app header\n * (`--shell-header-h`). Radix positions against the raw viewport, so without it a menu opened from the first\n * row under a sticky header flips up and its first items sit underneath it. Read once, when the menu opens.\n * Hosts without either variable lose nothing (0px = Radix's own default).\n */\nexport function readTopClearance(): number {\n return readClearance(TOP_CLEARANCE);\n}\n\n/**\n * The px a menu keeps clear of the BOTTOM edge: what the host publishes as `--matrx-floating-clearance`\n * (the assists pill, the attention dock, any `data-matrx-floating-bottom` chrome). As collision padding,\n * Radix FLIPS a menu upward when the room left below that chrome is too small, and its available height\n * already excludes it — so the last item never ends under the pill, and a menu opened from INSIDE that\n * chrome opens upward at full height instead of collapsing. Read once, when the menu opens.\n */\nexport function readBottomClearance(): number {\n return readClearance(BOTTOM_CLEARANCE);\n}\n\ntype MenuCollisionPadding = number | Partial<Record<\"top\" | \"right\" | \"bottom\" | \"left\", number>>;\n\n/** Pure: the caller's collision padding (or `fallback` on sides it leaves unset), with the host's top and bottom\n * clearance as a floor — a caller's own padding never puts a menu under the app header or the assists pill. */\nexport function menuCollisionPadding(\n caller: MenuCollisionPadding | undefined,\n top: number,\n bottom: number,\n fallback = 0,\n): Record<\"top\" | \"right\" | \"bottom\" | \"left\", number> {\n const side = (key: \"top\" | \"right\" | \"bottom\" | \"left\") =>\n typeof caller === \"number\" ? caller : (caller?.[key] ?? fallback);\n return { top: Math.max(side(\"top\"), top), right: side(\"right\"), bottom: Math.max(side(\"bottom\"), bottom), left: side(\"left\") };\n}\n\n/**\n * ONE MEASUREMENT PER BURST. A list mounts a menu per row, and each menu reads both clearances when it\n * mounts; every read appends a probe and forces a layout. Admin's /files/trash (432 rows) spent 1.46 s in\n * these reads before the list could draw (2026-10-24). Reads within CLEARANCE_REUSE_MS of a measurement\n * share it: the variables only change with the page's chrome (a header row, the assists pill).\n */\nconst CLEARANCE_REUSE_MS = 500;\nconst clearanceCache = new Map<string, { px: number; at: number }>();\nconst clock = (): number => (typeof performance !== \"undefined\" ? performance.now() : Date.now());\n\nfunction readClearance(height: string, shared = false): number {\n if (typeof document === \"undefined\") return 0;\n const now = clock();\n const held = shared ? clearanceCache.get(height) : undefined;\n if (held && now - held.at < CLEARANCE_REUSE_MS) return held.px;\n const px = measureClearance(height);\n clearanceCache.set(height, { px, at: now });\n return px;\n}\n\n/** The mount-time reads every menu content makes: shared across the menus that mount in one burst. */\nconst TOP_CLEARANCE = \"var(--matrx-floating-top-clearance, var(--shell-header-h, 0px))\";\nconst BOTTOM_CLEARANCE = \"var(--matrx-floating-clearance, 0px)\";\nconst sharedTopClearance = (): number => readClearance(TOP_CLEARANCE, true);\nconst sharedBottomClearance = (): number => readClearance(BOTTOM_CLEARANCE, true);\n\nfunction measureClearance(height: string): number {\n const probe = document.createElement(\"div\");\n probe.style.cssText = `position:fixed;top:0;left:0;width:0;visibility:hidden;pointer-events:none;height:${height}`;\n document.body.appendChild(probe);\n const px = probe.getBoundingClientRect().height;\n probe.remove();\n return Number.isFinite(px) ? Math.ceil(px) : 0;\n}\n\nconst DropdownMenuContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Content>,\n DropdownMenuContentProps\n>(({ className, sideOffset = 4, container, surface = \"default\", children, onCloseAutoFocus, collisionPadding, ...props }, ref) => {\n const portalContainer = usePortalContainer(container);\n const [topClearance] = React.useState(sharedTopClearance);\n const [bottomClearance] = React.useState(sharedBottomClearance);\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 data-surface={surface === \"solid\" ? \"solid\" : undefined}\n sideOffset={sideOffset}\n collisionPadding={menuCollisionPadding(collisionPadding, topClearance, bottomClearance)}\n className={cn(\n MENU_SURFACE_CLASS,\n edges.surfaceClassName,\n \"shadow-md\",\n surface === \"solid\" && SOLID_SURFACE_CLASS,\n MOTION_POPPER,\n className,\n )}\n {...props}\n onCloseAutoFocus={keepMovedFocus(onCloseAutoFocus)}\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 /** `danger`: a destructive item (Delete, Remove) — destructive text and icon, destructive soft\n * fill on hover / focus. Default: the ordinary item. */\n tone?: \"danger\";\n /** `sm`: 13px text on the 28px control row height, for dense frames. Default: the menu's 14px. */\n size?: \"sm\";\n }\n>(({ className, inset, tone, size, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n data-slot=\"dropdown-menu-item\"\n data-tone={tone}\n data-size={size}\n className={cn(MENU_ITEM_CLASS, size === \"sm\" && \"h-7 py-0 text-[13px]\", 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 <RadixCheckIcon 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(\"type-label px-2 pb-1 pt-2 font-medium text-foreground\", 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 text-muted-foreground\", 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 centered dialog card. Fades and scales; centering is not its business. */\nexport const MOTION_DIALOG = \"matrx-motion-dialog\";\n\n/**\n * THE CENTERING OF A CENTERED 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 centering inside `transform`,\n * which was harmless on v3 and doubled the centering 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 centered\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/** A waiting box's crossing band of light (Skeleton `motion=\"shimmer\"`). Reduced motion: a slow breathe, no travel. */\nexport const MOTION_SHIMMER = \"matrx-shimmer\";\n\n/** The spinner loop, for every inline busy indicator in the package. */\nexport const MOTION_SPIN = \"matrx-spin\";\n\n/**\n * FirstUseHint's beacon: a soft ring that pulses three times around the anchor, on\n * `box-shadow` only, so nothing moves. A still ring under reduced motion.\n */\nexport const MOTION_HINT_BEACON = \"matrx-motion-hint-beacon\";\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_SHIMMER,\n MOTION_SPIN,\n MOTION_HINT_BEACON,\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/**\n * THE PANEL MOTION as a Tailwind class string (moved from matrx-frontend\n * `lib/motion/panel-motion.ts`): every panel, sidebar, dock, drawer and sheet\n * slides its size/position on the host's `--matrx-motion-duration-panel` /\n * `--matrx-motion-ease-panel` (tokens.css ships the standard). Pair it with the\n * transition property you animate (`transition-transform`, …).\n */\nexport const PANEL_MOTION_CLASS =\n \"duration-(--matrx-motion-duration-panel) ease-(--matrx-motion-ease-panel) motion-reduce:transition-none\";\nexport const PANEL_MOTION_DURATION_VAR = \"var(--matrx-motion-duration-panel)\";\nexport const PANEL_MOTION_EASE_VAR = \"var(--matrx-motion-ease-panel)\";\n","/**\n * The opaque surface option shared by every floating menu surface\n * (`PopoverContent`, `DropdownMenuContent`, `DropdownMenuSubContent`).\n * `data-surface=\"solid\"` is also styled in `styles.css`, so the fill holds even\n * where a host utility layer tints the default surface.\n */\nexport type PopoverSurface = \"default\" | \"solid\";\n\nexport const SOLID_SURFACE_CLASS =\n \"bg-[hsl(var(--popover)/1)] [backdrop-filter:none] [-webkit-backdrop-filter:none]\";\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\nexport type IconProps = React.SVGAttributes<SVGSVGElement>;\n\n/**\n * Every lucide glyph carries `lucide-<name>`, the class lucide-react itself renders: THE OPTICAL\n * GLYPH TRIM (tap-target.css) reads the glyph's real air from it, and a caller's own class follows it.\n */\nfunction lucideProps(name: string, { className, ...props }: IconProps): React.SVGAttributes<SVGSVGElement> {\n return {\n className: className ? `lucide-${name} ${className}` : `lucide-${name}`,\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(\"loader-circle\", 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(\"chevron-left\", 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(\"chevron-right\", 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(\"chevron-down\", props)}>\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n );\n}\n\n/** lucide `trash-2` (moved from @ai-matrx/agents). */\nexport function Trash2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"trash-2\", props)}>\n <path d=\"M10 11v6\" />\n <path d=\"M14 11v6\" />\n <path d=\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\" />\n <path d=\"M3 6h18\" />\n <path d=\"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\" />\n </svg>\n );\n}\n\n/** lucide `archive` — the archived-rows glyph (ArchivedDisclosure). */\nexport function ArchiveIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"archive\", 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(\"ellipsis\", 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 CheckIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"check\", 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(\"chevrons-up-down\", 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(\"external-link\", 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(\"lock\", 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(\"pencil\", 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 `message-square` — a row's comments (records-ui SectionCard). */\nexport function MessageSquareIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"message-square\", props)}>\n <path d=\"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z\" />\n </svg>\n );\n}\n\n/** lucide `sticky-note` — a row's usage note (records-ui SectionCard). */\nexport function StickyNoteIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sticky-note\", props)}>\n <path d=\"M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z\" />\n <path d=\"M15 3v4a2 2 0 0 0 2 2h4\" />\n </svg>\n );\n}\n\n/** lucide `minus` — the decrease glyph (NumberStepper). */\nexport function MinusIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"minus\", props)}>\n <path d=\"M5 12h14\" />\n </svg>\n );\n}\n\n/** lucide `plus` — the create/add glyph. */\nexport function PlusIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"plus\", props)}>\n <path d=\"M5 12h14\" />\n <path d=\"M12 5v14\" />\n </svg>\n );\n}\n\n/** lucide `search` — the magnifier (the `@ai-matrx/design-system/icons` section). */\nexport function SearchIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"search\", props)}>\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"m21 21-4.3-4.3\" />\n </svg>\n );\n}\n\n/** lucide `list-filter` — a table's filter button (Mail's and Finder's filter). */\nexport function ListFilterIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"list-filter\", props)}>\n <path d=\"M3 6h18\" />\n <path d=\"M7 12h10\" />\n <path d=\"M10 18h4\" />\n </svg>\n );\n}\n\n/** lucide `pin` — pinned state (the `@ai-matrx/design-system/icons` section). */\nexport function PinIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"pin\", props)}>\n <path d=\"M12 17v5\" />\n <path d=\"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z\" />\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(\"x\", 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 RadixCheckIcon(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 saved-organization badge (OrganizationPicker). */\nexport function StarIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"star\", 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(\"building-2\", 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(\"panel-left\", 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(\"ellipsis-vertical\", 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(\"maximize-2\", 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(\"minimize-2\", 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(\"arrow-left\", 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(\"arrow-right\", props)}>\n <path d=\"M5 12h14\" />\n <path d=\"m12 5 7 7-7 7\" />\n </svg>\n );\n}\n\n/** lucide `arrow-up` — the swipe deck's up edge. */\nexport function ArrowUpIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-up\", props)}>\n <path d=\"m5 12 7-7 7 7\" />\n <path d=\"M12 19V5\" />\n </svg>\n );\n}\n\n/** lucide `arrow-down` — the swipe deck's down edge. */\nexport function ArrowDownIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-down\", props)}>\n <path d=\"M12 5v14\" />\n <path d=\"m19 12-7 7-7-7\" />\n </svg>\n );\n}\n\n/** lucide `undo-2` — take back the last change. */\nexport function Undo2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"undo-2\", props)}>\n <path d=\"M9 14 4 9l5-5\" />\n <path d=\"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11\" />\n </svg>\n );\n}\n\n/** lucide `eraser` — forget a marked part. */\nexport function EraserIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"eraser\", props)}>\n <path d=\"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21\" />\n <path d=\"M22 21H7\" />\n <path d=\"m5 11 9 9\" />\n </svg>\n );\n}\n\n/** lucide `rotate-cw` — reload. */\nexport function RotateCwIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"rotate-cw\", 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(\"globe\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20\" />\n <path d=\"M2 12h20\" />\n </svg>\n );\n}\n\n/** lucide `calendar` — the date field's glyph. */\nexport function CalendarIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"calendar\", props)}>\n <path d=\"M8 2v4\" />\n <path d=\"M16 2v4\" />\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"4\" rx=\"2\" />\n <path d=\"M3 10h18\" />\n </svg>\n );\n}\n\n/** lucide `clock` — the time field's glyph. */\nexport function ClockIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"clock\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <polyline points=\"12 6 12 12 16 14\" />\n </svg>\n );\n}\n\n/** lucide `refresh-cw` — retry / reload. */\nexport function RefreshCwIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"refresh-cw\", props)}>\n <path d=\"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\" />\n <path d=\"M21 3v5h-5\" />\n <path d=\"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\" />\n <path d=\"M8 16H3v5\" />\n </svg>\n );\n}\n\n/** lucide `triangle-alert` (alias `AlertTriangle`) — an error or warning. */\nexport function AlertTriangleIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"triangle-alert\", props)}>\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n </svg>\n );\n}\n\n/** lucide `circle-check` — a passing state. */\nexport function CircleCheckIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"circle-check\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"m16 9-5.5 5.5L8 12\" />\n </svg>\n );\n}\n\n/** lucide `circle-question-mark` (alias `CircleHelp`) — field help. */\nexport function CircleHelpIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"circle-question-mark\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n );\n}\n\n/** lucide `circle-x` — a failing state. */\nexport function CircleXIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"circle-x\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"m15 9-6 6\" />\n <path d=\"m9 9 6 6\" />\n </svg>\n );\n}\n\n/** lucide `info` — a row label's help glyph (controls `PropertyRow`). */\nexport function InfoIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"info\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4\" />\n <path d=\"M12 8h.01\" />\n </svg>\n );\n}\n\n/** lucide `circle-dot` — the \"Get help from Matrx AI\" button glyph (controls `HelpIcon`). */\nexport function CircleDotIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"circle-dot\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <circle cx=\"12\" cy=\"12\" r=\"1\" />\n </svg>\n );\n}\n\n/** lucide `copy` — the Peek's token chip (copy the exact token). */\nexport function CopyIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"copy\", props)}>\n <rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n <path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" />\n </svg>\n );\n}\n\n/** lucide `upload` (moved from @ai-matrx/media). */\nexport function UploadIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"upload\", props)}>\n <path d=\"M12 3v12\" />\n <path d=\"m17 8-5-5-5 5\" />\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n </svg>\n );\n}\n\n/** lucide `circle-alert` — an error or attention state. */\nexport function CircleAlertIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"circle-alert\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <line x1=\"12\" x2=\"12\" y1=\"8\" y2=\"12\" />\n <line x1=\"12\" x2=\"12.01\" y1=\"16\" y2=\"16\" />\n </svg>\n );\n}\n\n/** lucide `panel-right` — a side pane toggle. */\nexport function PanelRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"panel-right\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M15 3v18\" />\n </svg>\n );\n}\n\n/** lucide `bell` — notifications. */\nexport function BellIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"bell\", props)}>\n <path d=\"M10.268 21a2 2 0 0 0 3.464 0\" />\n <path d=\"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326\" />\n </svg>\n );\n}\n\n/** lucide `eye-off` — hidden. */\nexport function EyeOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"eye-off\", props)}>\n <path d=\"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\" />\n <path d=\"M14.084 14.158a3 3 0 0 1-4.242-4.242\" />\n <path d=\"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\" />\n <path d=\"m2 2 20 20\" />\n </svg>\n );\n}\n\n/** lucide `app-window` — open as a window. */\nexport function AppWindowIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"app-window\", props)}>\n <rect x=\"2\" y=\"4\" width=\"20\" height=\"16\" rx=\"2\" />\n <path d=\"M10 4v4\" />\n <path d=\"M2 8h20\" />\n <path d=\"M6 4v4\" />\n </svg>\n );\n}\n\n/** lucide `video` — a video call or clip. */\nexport function VideoIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"video\", props)}>\n <path d=\"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5\" />\n <rect x=\"2\" y=\"6\" width=\"14\" height=\"12\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `phone` — a voice call. */\nexport function PhoneIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"phone\", props)}>\n <path d=\"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384\" />\n </svg>\n );\n}\n\n/** lucide `sparkles` — AI. */\nexport function SparklesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sparkles\", props)}>\n <path d=\"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z\" />\n <path d=\"M20 2v4\" />\n <path d=\"M22 4h-4\" />\n <circle cx=\"4\" cy=\"20\" r=\"2\" />\n </svg>\n );\n}\n\n/** lucide `panels-top-left` — a layout. */\nexport function PanelsTopLeftIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"panels-top-left\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M3 9h18\" />\n <path d=\"M9 21V9\" />\n </svg>\n );\n}\n\n/** lucide `download`. */\nexport function DownloadIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"download\", props)}>\n <path d=\"M12 15V3\" />\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n <path d=\"m7 10 5 5 5-5\" />\n </svg>\n );\n}\n\n/** lucide `settings`. */\nexport function SettingsIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"settings\", props)}>\n <path d=\"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n );\n}\n\n/** lucide `users`. */\nexport function UsersIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"users\", props)}>\n <path d=\"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\" />\n <path d=\"M16 3.128a4 4 0 0 1 0 7.744\" />\n <path d=\"M22 21v-2a4 4 0 0 0-3-3.87\" />\n <circle cx=\"9\" cy=\"7\" r=\"4\" />\n </svg>\n );\n}\n\n/** lucide `grip-vertical` — a drag handle. */\nexport function GripVerticalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"grip-vertical\", props)}>\n <circle cx=\"9\" cy=\"12\" r=\"1\" />\n <circle cx=\"9\" cy=\"5\" r=\"1\" />\n <circle cx=\"9\" cy=\"19\" r=\"1\" />\n <circle cx=\"15\" cy=\"12\" r=\"1\" />\n <circle cx=\"15\" cy=\"5\" r=\"1\" />\n <circle cx=\"15\" cy=\"19\" r=\"1\" />\n </svg>\n );\n}\n\n/** lucide `history`. */\nexport function HistoryIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"history\", props)}>\n <path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\" />\n <path d=\"M3 3v5h5\" />\n <path d=\"M12 7v5l4 2\" />\n </svg>\n );\n}\n\n/** lucide `workflow`. */\nexport function WorkflowIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"workflow\", props)}>\n <rect width=\"8\" height=\"8\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M7 11v4a2 2 0 0 0 2 2h4\" />\n <rect width=\"8\" height=\"8\" x=\"13\" y=\"13\" rx=\"2\" />\n </svg>\n );\n}\n\n// ---- Glyphs consolidated from the packages above the design system (one glyph home). ----\n\n/** lucide `activities` (moved from @ai-matrx/meet). */\nexport function ActivitiesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"activities\", props)}>\n <path d=\"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z\" />\n <rect x=\"3\" y=\"14\" width=\"7\" height=\"7\" rx=\"1\" />\n <circle cx=\"17.5\" cy=\"17.5\" r=\"3.5\" />\n </svg>\n );\n}\n\n/** lucide `arrow-down-to-line` (moved from @ai-matrx/agents). */\nexport function ArrowDownToLineIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-down-to-line\", props)}>\n <path d=\"M12 17V3\" />\n <path d=\"m6 11 6 6 6-6\" />\n <path d=\"M19 21H5\" />\n </svg>\n );\n}\n\n/** lucide `arrow-left-right` (moved from @ai-matrx/diff). */\nexport function ArrowLeftRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-left-right\", props)}>\n <path d=\"M8 3 4 7l4 4\" />\n <path d=\"M4 7h16\" />\n <path d=\"m16 21 4-4-4-4\" />\n <path d=\"M20 17H4\" />\n </svg>\n );\n}\n\n/** lucide `arrow-left-to-line` (moved from @ai-matrx/summon). */\nexport function ArrowLeftToLineIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-left-to-line\", props)}>\n <path d=\"M3 19V5\" />\n <path d=\"m13 6-6 6 6 6\" />\n <path d=\"M7 12h14\" />\n </svg>\n );\n}\n\n/** lucide `atom` (moved from @ai-matrx/agents). */\nexport function AtomIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"atom\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"1\" />\n <path d=\"M20.2 20.2c2.04-2.03.02-7.36-4.5-11.9-4.54-4.52-9.87-6.54-11.9-4.5-2.04 2.03-.02 7.36 4.5 11.9 4.54 4.52 9.87 6.54 11.9 4.5Z\" />\n <path d=\"M15.7 15.7c4.52-4.54 6.54-9.87 4.5-11.9-2.03-2.04-7.36-.02-11.9 4.5-4.52 4.54-6.54 9.87-4.5 11.9 2.03 2.04 7.36.02 11.9-4.5Z\" />\n </svg>\n );\n}\n\n/** lucide `audio-lines` (moved from @ai-matrx/content-ir). */\nexport function AudioLinesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"audio-lines\", props)}>\n <path d=\"M2 10v3\" />\n <path d=\"M6 6v11\" />\n <path d=\"M10 3v18\" />\n <path d=\"M14 8v7\" />\n <path d=\"M18 5v13\" />\n <path d=\"M22 10v3\" />\n </svg>\n );\n}\n\n/** lucide `boxes` (moved from @ai-matrx/associations). */\nexport function BoxesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"boxes\", props)}>\n <path d=\"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z\" />\n <path d=\"m7 16.5-4.74-2.85\" />\n <path d=\"m7 16.5 5-3\" />\n <path d=\"M7 16.5v5.17\" />\n <path d=\"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z\" />\n <path d=\"m17 16.5-5-3\" />\n <path d=\"m17 16.5 4.74-2.85\" />\n <path d=\"M17 16.5v5.17\" />\n <path d=\"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z\" />\n <path d=\"M12 8 7.26 5.15\" />\n <path d=\"m12 8 4.74-2.85\" />\n <path d=\"M12 13.5V8\" />\n </svg>\n );\n}\n\n/** lucide `braces` (moved from @ai-matrx/media). */\nexport function BracesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"braces\", props)}>\n <path d=\"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1\" />\n <path d=\"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1\" />\n </svg>\n );\n}\n\n/** lucide `breakout` (moved from @ai-matrx/meet). */\nexport function BreakoutIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"breakout\", props)}>\n <rect width=\"7\" height=\"18\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"14\" rx=\"1\" />\n </svg>\n );\n}\n\n/** lucide `camera` (moved from @ai-matrx/meet). */\nexport function CameraIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"camera\", props)}>\n <path d=\"m23 7-7 5 7 5V7Z\" />\n <rect x=\"1\" y=\"5\" width=\"15\" height=\"14\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `camera-off` (moved from @ai-matrx/meet). */\nexport function CameraOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"camera-off\", props)}>\n <path d=\"M2 2l20 20\" />\n <path d=\"M10.66 5H14a2 2 0 0 1 2 2v3.34l1 1L23 7v10\" />\n <path d=\"M16 16a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h2\" />\n </svg>\n );\n}\n\n/** lucide `captions` (moved from @ai-matrx/meet). */\nexport function CaptionsIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"captions\", props)}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <path d=\"M10 10.5a2 2 0 1 0 0 3M16 10.5a2 2 0 1 0 0 3\" />\n </svg>\n );\n}\n\n/** lucide `chat-bubble` (moved from @ai-matrx/coding-sessions). */\nexport function ChatBubbleIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chat-bubble\", props)}>\n <path d=\"M20 12.5a7.5 7.5 0 0 1-10.9 6.7L4 20.5l1.3-4.6A7.5 7.5 0 1 1 20 12.5z\" />\n </svg>\n );\n}\n\n/** lucide `chat` (moved from @ai-matrx/meet). */\nexport function ChatIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chat\", props)}>\n <path d=\"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z\" />\n </svg>\n );\n}\n\n/** lucide `check-circle-2` (moved from @ai-matrx/media). */\nexport function CheckCircle2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"check-circle-2\", props)}>\n <path d=\"M21.801 10A10 10 0 1 1 17 3.335\" />\n <path d=\"m9 11 3 3L22 4\" />\n </svg>\n );\n}\n\n/** lucide `chevron-up` (moved from @ai-matrx/meet). */\nexport function ChevronUpIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevron-up\", props)}>\n <path d=\"m6 15 6-6 6 6\" />\n </svg>\n );\n}\n\n/** lucide `chevrons-down-up` (moved from @ai-matrx/diff). */\nexport function ChevronsDownUpIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevrons-down-up\", props)}>\n <path d=\"m7 20 5-5 5 5\" />\n <path d=\"m7 4 5 5 5-5\" />\n </svg>\n );\n}\n\n/** lucide `clock-3` (moved from @ai-matrx/diff). */\nexport function Clock3Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"clock-3\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 6v6h4\" />\n </svg>\n );\n}\n\n/** lucide `code-2` (moved from @ai-matrx/office). */\nexport function Code2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"code-2\", props)}>\n <path d=\"m18 16 4-4-4-4\" />\n <path d=\"m6 8-4 4 4 4\" />\n <path d=\"m14.5 4-5 16\" />\n </svg>\n );\n}\n\n/** lucide `code` (moved from @ai-matrx/media). */\nexport function CodeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"code\", props)}>\n <path d=\"m16 18 6-6-6-6\" />\n <path d=\"m8 6-6 6 6 6\" />\n </svg>\n );\n}\n\n/** lucide `columns-2` (moved from @ai-matrx/diff). */\nexport function Columns2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"columns-2\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M12 3v18\" />\n </svg>\n );\n}\n\n/** lucide `corner-down-right` (moved from @ai-matrx/associations). */\nexport function CornerDownRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"corner-down-right\", props)}>\n <polyline points=\"15 10 20 15 15 20\" />\n <path d=\"M4 4v7a4 4 0 0 0 4 4h12\" />\n </svg>\n );\n}\n\n/** lucide `database` (moved from @ai-matrx/media). */\nexport function DatabaseIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"database\", props)}>\n <ellipse cx=\"12\" cy=\"5\" rx=\"9\" ry=\"3\" />\n <path d=\"M3 5V19A9 3 0 0 0 21 19V5\" />\n <path d=\"M3 12A9 3 0 0 0 21 12\" />\n </svg>\n );\n}\n\n/** lucide `dock` (moved from @ai-matrx/canvas). */\nexport function DockIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"dock\", props)}>\n <path d=\"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6\" />\n <path d=\"M21 3 12 12\" />\n <path d=\"M12 6v6h6\" />\n </svg>\n );\n}\n\n/** lucide `expand` (moved from @ai-matrx/detail). */\nexport function ExpandIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"expand\", props)}>\n <path d=\"m15 15 6 6\" />\n <path d=\"m15 9 6-6\" />\n <path d=\"M21 16v5h-5\" />\n <path d=\"M21 8V3h-5\" />\n <path d=\"M3 16v5h5\" />\n <path d=\"m3 21 6-6\" />\n <path d=\"M3 8V3h5\" />\n <path d=\"M9 9 3 3\" />\n </svg>\n );\n}\n\n/** lucide `eye` (moved from @ai-matrx/agents). */\nexport function EyeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"eye\", props)}>\n <path d=\"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n );\n}\n\n/** lucide `file-archive` (moved from @ai-matrx/content-ir). */\nexport function FileArchiveIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-archive\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M10 6h1\" />\n <path d=\"M10 10h1\" />\n <circle cx=\"10\" cy=\"16\" r=\"2\" />\n <path d=\"M10 2v12\" />\n </svg>\n );\n}\n\n/** lucide `file-audio` (moved from @ai-matrx/media). */\nexport function FileAudioIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-audio\", props)}>\n <path d=\"M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0\" />\n </svg>\n );\n}\n\n/** lucide `file-code` (moved from @ai-matrx/media). */\nexport function FileCodeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-code\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M10 12.5 8 15l2 2.5\" />\n <path d=\"m14 12.5 2 2.5-2 2.5\" />\n </svg>\n );\n}\n\n/** lucide `file-json` (moved from @ai-matrx/media). */\nexport function FileJsonIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-json\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1\" />\n <path d=\"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1\" />\n </svg>\n );\n}\n\n/** lucide `file` (moved from @ai-matrx/media). */\nexport function FilePageIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n </svg>\n );\n}\n\n/** lucide `file-plus` (moved from @ai-matrx/content-ir). */\nexport function FilePlusIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-plus\", props)}>\n <path d=\"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4\" />\n <path d=\"M14 2v4a2 2 0 0 0 2 2h4\" />\n <path d=\"M3 15h6\" />\n <path d=\"M6 12v6\" />\n </svg>\n );\n}\n\n/** lucide `file-spreadsheet` (moved from @ai-matrx/media). */\nexport function FileSpreadsheetIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-spreadsheet\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M8 13h2\" />\n <path d=\"M14 13h2\" />\n <path d=\"M8 17h2\" />\n <path d=\"M14 17h2\" />\n </svg>\n );\n}\n\n/** lucide `file-text` (moved from @ai-matrx/media). */\nexport function FileTextIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-text\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M10 9H8\" />\n <path d=\"M16 13H8\" />\n <path d=\"M16 17H8\" />\n </svg>\n );\n}\n\n/** lucide `file-type` (moved from @ai-matrx/media). */\nexport function FileTypeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-type\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M11 18h2\" />\n <path d=\"M12 12v6\" />\n <path d=\"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5\" />\n </svg>\n );\n}\n\n/** lucide `file-video` (moved from @ai-matrx/media). */\nexport function FileVideoIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-video\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z\" />\n </svg>\n );\n}\n\n/** lucide `film` (moved from @ai-matrx/content-ir). */\nexport function FilmIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"film\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M7 3v18\" />\n <path d=\"M3 7.5h4\" />\n <path d=\"M3 12h18\" />\n <path d=\"M3 16.5h4\" />\n <path d=\"M17 3v18\" />\n <path d=\"M17 7.5h4\" />\n <path d=\"M17 16.5h4\" />\n </svg>\n );\n}\n\n/** lucide `flag` (moved from @ai-matrx/meet). */\nexport function FlagIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"flag\", props)}>\n <path d=\"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z\" />\n <line x1=\"4\" x2=\"4\" y1=\"22\" y2=\"15\" />\n </svg>\n );\n}\n\n/** lucide `flip-horizontal-2` (moved from @ai-matrx/capture). */\nexport function FlipHorizontal2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"flip-horizontal-2\", props)}>\n <path d=\"m3 7 5 5-5 5V7\" />\n <path d=\"m21 7-5 5 5 5V7\" />\n <path d=\"M12 20v2\" />\n <path d=\"M12 14v2\" />\n <path d=\"M12 8v2\" />\n <path d=\"M12 2v2\" />\n </svg>\n );\n}\n\n/** lucide `fold-vertical` (moved from @ai-matrx/diff). */\nexport function FoldVerticalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"fold-vertical\", props)}>\n <path d=\"M12 22v-6\" />\n <path d=\"M12 8V2\" />\n <path d=\"M4 12H2\" />\n <path d=\"M10 12H8\" />\n <path d=\"M16 12h-2\" />\n <path d=\"M22 12h-2\" />\n <path d=\"m15 19-3-3-3 3\" />\n <path d=\"m15 5-3 3-3-3\" />\n </svg>\n );\n}\n\n/** lucide `folder` (moved from @ai-matrx/media). */\nexport function FolderIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"folder\", props)}>\n <path d=\"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z\" />\n </svg>\n );\n}\n\n/** lucide `folder-open` (moved from @ai-matrx/media). */\nexport function FolderOpenIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"folder-open\", props)}>\n <path d=\"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2\" />\n </svg>\n );\n}\n\n/** lucide `git-merge` (moved from @ai-matrx/diff). */\nexport function GitMergeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"git-merge\", props)}>\n <circle cx=\"18\" cy=\"18\" r=\"3\" />\n <circle cx=\"6\" cy=\"6\" r=\"3\" />\n <path d=\"M6 21V9a9 9 0 0 0 9 9\" />\n </svg>\n );\n}\n\n/** lucide `graduation-cap` (moved from @ai-matrx/office). */\nexport function GraduationCapIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"graduation-cap\", props)}>\n <path d=\"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z\" />\n <path d=\"M22 10v6\" />\n <path d=\"M6 12.5V16a6 3 0 0 0 12 0v-3.5\" />\n </svg>\n );\n}\n\n/** lucide `grid-3x-3` (moved from @ai-matrx/capture). */\nexport function Grid3x3Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"grid-3x-3\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M3 9h18\" />\n <path d=\"M3 15h18\" />\n <path d=\"M9 3v18\" />\n <path d=\"M15 3v18\" />\n </svg>\n );\n}\n\n/** lucide `grip` (moved from @ai-matrx/capture). */\nexport function GripIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"grip\", props)}>\n <circle cx=\"12\" cy=\"5\" r=\"1\" />\n <circle cx=\"19\" cy=\"5\" r=\"1\" />\n <circle cx=\"5\" cy=\"5\" r=\"1\" />\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 <circle cx=\"12\" cy=\"19\" r=\"1\" />\n <circle cx=\"19\" cy=\"19\" r=\"1\" />\n <circle cx=\"5\" cy=\"19\" r=\"1\" />\n </svg>\n );\n}\n\n/** lucide `grip-resize` (moved from @ai-matrx/associations). */\nexport function GripResizeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"grip-resize\", props)}>\n <path d=\"M21 15 15 21\" />\n <path d=\"M21 20 20 21\" />\n </svg>\n );\n}\n\n/** lucide `hammer` (moved from @ai-matrx/agents). */\nexport function HammerIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"hammer\", props)}>\n <path d=\"m15 12-8.5 8.5c-.83.83-2.17.83-3 0 0 0 0 0 0 0a2.12 2.12 0 0 1 0-3L12 9\" />\n <path d=\"M17.64 15 22 10.64\" />\n <path d=\"m20.91 11.7-1.25-1.25c-.6-.6-.93-1.4-.93-2.25v-.86L16.01 4.6a5.56 5.56 0 0 0-3.94-1.64H9l.92.82A6.18 6.18 0 0 1 12 8.4v1.56l2 2h2.47l2.26 1.91\" />\n </svg>\n );\n}\n\n/** lucide `hand` (moved from @ai-matrx/meet). */\nexport function HandIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"hand\", props)}>\n <path d=\"M18 11V6a2 2 0 0 0-4 0v5\" />\n <path d=\"M14 10V4a2 2 0 0 0-4 0v7\" />\n <path d=\"M10 10.5V6a2 2 0 0 0-4 0v8\" />\n <path d=\"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2a8 8 0 0 1-8-8v-1a2 2 0 1 1 4 0\" />\n </svg>\n );\n}\n\n/** lucide `handoff` (moved from @ai-matrx/coding-sessions). */\nexport function HandoffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"handoff\", props)}>\n <path d=\"M5 12h12M13 7l5 5-5 5\" />\n <path d=\"M5 5v14\" />\n </svg>\n );\n}\n\n/** lucide `hash` (moved from @ai-matrx/diff). */\nexport function HashIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"hash\", props)}>\n <path d=\"M4 9h16\" />\n <path d=\"M4 15h16\" />\n <path d=\"M10 3 8 21\" />\n <path d=\"M16 3l-2 18\" />\n </svg>\n );\n}\n\n/** lucide `highlighter` (moved from @ai-matrx/diff). */\nexport function HighlighterIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"highlighter\", props)}>\n <path d=\"m9 11-6 6v3h9l3-3\" />\n <path d=\"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4\" />\n </svg>\n );\n}\n\n/** lucide `image` (moved from @ai-matrx/media). */\nexport function ImageIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"image\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" ry=\"2\" />\n <circle cx=\"9\" cy=\"9\" r=\"2\" />\n <path d=\"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21\" />\n </svg>\n );\n}\n\n/** lucide `image-off` (moved from @ai-matrx/media). */\nexport function ImageOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"image-off\", props)}>\n <line x1=\"2\" x2=\"22\" y1=\"2\" y2=\"22\" />\n <path d=\"M10.41 10.41a2 2 0 1 1-2.83-2.83\" />\n <line x1=\"13.5\" x2=\"6\" y1=\"13.5\" y2=\"21\" />\n <line x1=\"18\" x2=\"21\" y1=\"12\" y2=\"15\" />\n <path d=\"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59\" />\n <path d=\"M21 15V5a2 2 0 0 0-2-2H9\" />\n </svg>\n );\n}\n\n/** lucide `images` (moved from @ai-matrx/capture). */\nexport function ImagesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"images\", props)}>\n <path d=\"m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16\" />\n <path d=\"M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2\" />\n <circle cx=\"13\" cy=\"7\" r=\"1\" fill=\"currentColor\" />\n <rect x=\"8\" y=\"2\" width=\"14\" height=\"14\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `keyboard` (moved from @ai-matrx/meet). */\nexport function KeyboardIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"keyboard\", props)}>\n <path d=\"M10 8h.01M12 12h.01M14 8h.01M16 12h.01M18 8h.01M6 8h.01M7 16h10M8 12h.01\" />\n <rect width=\"20\" height=\"16\" x=\"2\" y=\"4\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `languages` (moved from @ai-matrx/agents). */\nexport function LanguagesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"languages\", props)}>\n <path d=\"m5 8 6 6\" />\n <path d=\"m4 14 6-6 2-3\" />\n <path d=\"M2 5h12\" />\n <path d=\"M7 2h1\" />\n <path d=\"m22 22-5-10-5 10\" />\n <path d=\"M14 18h6\" />\n </svg>\n );\n}\n\n/** lucide `layers` (moved from @ai-matrx/agents). */\nexport function LayersIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"layers\", props)}>\n <path d=\"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z\" />\n <path d=\"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12\" />\n <path d=\"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17\" />\n </svg>\n );\n}\n\n/** lucide `layout-grid` (moved from @ai-matrx/canvas). */\nexport function LayoutGridIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"layout-grid\", props)}>\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"14\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"14\" rx=\"1\" />\n </svg>\n );\n}\n\n/** lucide `link-2` (moved from @ai-matrx/media). */\nexport function Link2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"link-2\", props)}>\n <path d=\"M9 17H7A5 5 0 0 1 7 7h2\" />\n <path d=\"M15 7h2a5 5 0 1 1 0 10h-2\" />\n <line x1=\"8\" x2=\"16\" y1=\"12\" y2=\"12\" />\n </svg>\n );\n}\n\n/** lucide `list-checks` (moved from @ai-matrx/diff). */\nexport function ListChecksIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"list-checks\", props)}>\n <path d=\"m3 17 2 2 4-4\" />\n <path d=\"m3 7 2 2 4-4\" />\n <path d=\"M13 6h8\" />\n <path d=\"M13 12h8\" />\n <path d=\"M13 18h8\" />\n </svg>\n );\n}\n\n/** lucide `list` (moved from @ai-matrx/diff). */\nexport function ListIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"list\", props)}>\n <path d=\"M3 12h.01\" />\n <path d=\"M3 18h.01\" />\n <path d=\"M3 6h.01\" />\n <path d=\"M8 12h13\" />\n <path d=\"M8 18h13\" />\n <path d=\"M8 6h13\" />\n </svg>\n );\n}\n\n/** lucide `maximize` (moved from @ai-matrx/content-ir). */\nexport function MaximizeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"maximize\", props)}>\n <polyline points=\"15 3 21 3 21 9\" />\n <polyline points=\"9 21 3 21 3 15\" />\n <line x1=\"21\" x2=\"14\" y1=\"3\" y2=\"10\" />\n <line x1=\"3\" x2=\"10\" y1=\"21\" y2=\"14\" />\n </svg>\n );\n}\n\n/** lucide `megaphone` (moved from @ai-matrx/office). */\nexport function MegaphoneIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"megaphone\", props)}>\n <path d=\"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z\" />\n <path d=\"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14\" />\n <path d=\"M8 6v8\" />\n </svg>\n );\n}\n\n/** lucide `message-square-warning` (moved from @ai-matrx/office). */\nexport function MessageSquareWarningIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"message-square-warning\", props)}>\n <path d=\"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z\" />\n <path d=\"M12 15h.01\" />\n <path d=\"M12 7v4\" />\n </svg>\n );\n}\n\n/** lucide `mic` (moved from @ai-matrx/meet). */\nexport function MicIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"mic\", props)}>\n <path d=\"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z\" />\n <path d=\"M19 10v2a7 7 0 0 1-14 0v-2\" />\n <path d=\"M12 19v3\" />\n </svg>\n );\n}\n\n/** lucide `mic-off` (moved from @ai-matrx/meet). */\nexport function MicOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"mic-off\", props)}>\n <path d=\"M2 2l20 20\" />\n <path d=\"M9 9v3a3 3 0 0 0 5.12 2.12\" />\n <path d=\"M15 9.34V5a3 3 0 0 0-5.94-.6\" />\n <path d=\"M19 10v2a7 7 0 0 1-.11 1.23M5 10v2a7 7 0 0 0 11 5.66\" />\n <path d=\"M12 19v3\" />\n </svg>\n );\n}\n\n/** lucide `monitor` (moved from @ai-matrx/coding-sessions). */\nexport function MonitorIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"monitor\", props)}>\n <rect x=\"3\" y=\"4.5\" width=\"18\" height=\"12\" rx=\"2\" />\n <path d=\"M8.5 20h7M12 16.5V20\" />\n </svg>\n );\n}\n\n/** lucide `moon` (moved from @ai-matrx/coding-sessions). */\nexport function MoonIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"moon\", props)}>\n <path d=\"M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5z\" />\n </svg>\n );\n}\n\n/** lucide `music` (moved from @ai-matrx/media). */\nexport function MusicIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"music\", props)}>\n <path d=\"M9 18V5l12-2v13\" />\n <circle cx=\"6\" cy=\"18\" r=\"3\" />\n <circle cx=\"18\" cy=\"16\" r=\"3\" />\n </svg>\n );\n}\n\n/** lucide `notes` (moved from @ai-matrx/meet). */\nexport function NotesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"notes\", props)}>\n <path d=\"M4 20l1-4L16.5 4.5a2.1 2.1 0 0 1 3 3L8 19l-4 1Z\" />\n <path d=\"M14 7l3 3\" />\n </svg>\n );\n}\n\n/** lucide `package-box` (moved from @ai-matrx/media). */\nexport function PackageBoxIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"package-box\", props)}>\n <path d=\"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z\" />\n <path d=\"M12 22V12\" />\n <polyline points=\"3.29 7 12 12 20.71 7\" />\n <path d=\"m7.5 4.27 9 5.15\" />\n </svg>\n );\n}\n\n/** lucide `page` (moved from @ai-matrx/canvas). */\nexport function PageIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"page\", props)}>\n <rect x=\"4\" y=\"4\" width=\"16\" height=\"16\" rx=\"2\" />\n <path d=\"M8 9h8\" />\n <path d=\"M8 13h8\" />\n <path d=\"M8 17h5\" />\n </svg>\n );\n}\n\n/** lucide `panel-left-close` (moved from @ai-matrx/summon). */\nexport function PanelLeftCloseIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"panel-left-close\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M9 3v18\" />\n <path d=\"m16 15-3-3 3-3\" />\n </svg>\n );\n}\n\n/** lucide `pause` (moved from @ai-matrx/media). */\nexport function PauseIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"pause\", props)}>\n <rect x=\"14\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n <rect x=\"5\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n </svg>\n );\n}\n\n/** lucide `pen-tool` (moved from @ai-matrx/media). */\nexport function PenToolIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"pen-tool\", props)}>\n <path d=\"M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z\" />\n <path d=\"m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18\" />\n <path d=\"m2.3 2.3 7.286 7.286\" />\n <circle cx=\"11\" cy=\"11\" r=\"2\" />\n </svg>\n );\n}\n\n/** lucide `people` (moved from @ai-matrx/meet). */\nexport function PeopleIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"people\", props)}>\n <path d=\"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\" />\n <circle cx=\"9\" cy=\"7\" r=\"4\" />\n <path d=\"M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75\" />\n </svg>\n );\n}\n\n/** lucide `phone-off` (moved from @ai-matrx/meet). */\nexport function PhoneOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"phone-off\", props)}>\n <path d=\"M12 9c-1.6 0-3.15.25-4.6.72v3.1c0 .39-.23.74-.56.9-.98.49-1.87 1.12-2.66 1.85-.18.18-.43.28-.7.28-.28 0-.53-.11-.71-.29L.29 13.08a.99.99 0 0 1-.29-.7c0-.28.11-.53.29-.71C3.34 8.78 7.46 7 12 7s8.66 1.78 11.71 4.67c.18.18.29.43.29.71 0 .28-.11.53-.29.71l-2.48 2.48c-.18.18-.43.29-.71.29-.27 0-.52-.11-.7-.28a11.27 11.27 0 0 0-2.67-1.85.996.996 0 0 1-.56-.9v-3.1C15.15 9.25 13.6 9 12 9Z\" fill=\"currentColor\" stroke=\"none\" />\n </svg>\n );\n}\n\n/** lucide `play` (moved from @ai-matrx/media). */\nexport function PlayIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"play\", props)}>\n <path d=\"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z\" />\n </svg>\n );\n}\n\n/** lucide `poll` (moved from @ai-matrx/meet). */\nexport function PollIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"poll\", props)}>\n <line x1=\"18\" x2=\"18\" y1=\"20\" y2=\"10\" />\n <line x1=\"12\" x2=\"12\" y1=\"20\" y2=\"4\" />\n <line x1=\"6\" x2=\"6\" y1=\"20\" y2=\"14\" />\n </svg>\n );\n}\n\n/** lucide `proportions` (moved from @ai-matrx/capture). */\nexport function ProportionsIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"proportions\", props)}>\n <rect width=\"20\" height=\"16\" x=\"2\" y=\"4\" rx=\"2\" />\n <path d=\"M12 9v11\" />\n <path d=\"M2 9h13a2 2 0 0 1 2 2v9\" />\n </svg>\n );\n}\n\n/** lucide `puzzle` (moved from @ai-matrx/office). */\nexport function PuzzleIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"puzzle\", props)}>\n <path d=\"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z\" />\n </svg>\n );\n}\n\n/** lucide `question` (moved from @ai-matrx/meet). */\nexport function QuestionIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"question\", props)}>\n <path d=\"M7.9 20A9 9 0 1 0 4 16.1L2 22Z\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n );\n}\n\n/** lucide `record` (moved from @ai-matrx/meet). */\nexport function RecordIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"record\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"8\" fill=\"currentColor\" stroke=\"none\" />\n </svg>\n );\n}\n\n/** lucide `rectangle-vertical` (moved from @ai-matrx/summon). */\nexport function RectangleVerticalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"rectangle-vertical\", props)}>\n <rect width=\"12\" height=\"20\" x=\"6\" y=\"2\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `restore` (moved from @ai-matrx/associations). */\nexport function RestoreIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"restore\", props)}>\n <path d=\"M4 14h6v6\" />\n <path d=\"M20 10h-6V4\" />\n <path d=\"M14 10l7-7\" />\n <path d=\"M3 21l7-7\" />\n </svg>\n );\n}\n\n/** lucide `rotate-ccw` (moved from @ai-matrx/capture). */\nexport function RotateCcwIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"rotate-ccw\", props)}>\n <path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\" />\n <path d=\"M3 3v5h5\" />\n </svg>\n );\n}\n\n/** lucide `rows-3` (moved from @ai-matrx/diff). */\nexport function Rows3Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"rows-3\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M21 9H3\" />\n <path d=\"M21 15H3\" />\n </svg>\n );\n}\n\n/** lucide `save` (moved from @ai-matrx/summon). */\nexport function SaveIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"save\", props)}>\n <path d=\"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z\" />\n <path d=\"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7\" />\n <path d=\"M7 3v4a1 1 0 0 0 1 1h7\" />\n </svg>\n );\n}\n\n/** lucide `scale` (moved from @ai-matrx/agents). */\nexport function ScaleIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"scale\", props)}>\n <path d=\"M12 3v18\" />\n <path d=\"m19 8 3 8a5 5 0 0 1-6 0zV7\" />\n <path d=\"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1\" />\n <path d=\"m5 8 3 8a5 5 0 0 1-6 0zV7\" />\n <path d=\"M7 21h10\" />\n </svg>\n );\n}\n\n/** lucide `screen-share` (moved from @ai-matrx/meet). */\nexport function ScreenShareIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"screen-share\", props)}>\n <rect x=\"2\" y=\"3\" width=\"20\" height=\"14\" rx=\"2\" />\n <path d=\"M8 21h8M12 17v4\" />\n <path d=\"M12 13V8m0 0-2.5 2.5M12 8l2.5 2.5\" />\n </svg>\n );\n}\n\n/** lucide `server` (moved from @ai-matrx/agents). */\nexport function ServerIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"server\", props)}>\n <rect width=\"20\" height=\"8\" x=\"2\" y=\"2\" rx=\"2\" ry=\"2\" />\n <rect width=\"20\" height=\"8\" x=\"2\" y=\"14\" rx=\"2\" ry=\"2\" />\n <line x1=\"6\" x2=\"6.01\" y1=\"6\" y2=\"6\" />\n <line x1=\"6\" x2=\"6.01\" y1=\"18\" y2=\"18\" />\n </svg>\n );\n}\n\n/** lucide `settings-2` (moved from @ai-matrx/media). */\nexport function Settings2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"settings-2\", props)}>\n <path d=\"M20 7h-9\" />\n <path d=\"M14 17H5\" />\n <circle cx=\"17\" cy=\"17\" r=\"3\" />\n <circle cx=\"7\" cy=\"7\" r=\"3\" />\n </svg>\n );\n}\n\n/** lucide `share-2` (moved from @ai-matrx/media). */\nexport function Share2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"share-2\", props)}>\n <circle cx=\"18\" cy=\"5\" r=\"3\" />\n <circle cx=\"6\" cy=\"12\" r=\"3\" />\n <circle cx=\"18\" cy=\"19\" r=\"3\" />\n <line x1=\"8.59\" x2=\"15.42\" y1=\"13.51\" y2=\"17.49\" />\n <line x1=\"15.41\" x2=\"8.59\" y1=\"6.51\" y2=\"10.49\" />\n </svg>\n );\n}\n\n/** lucide `shield-alert` (moved from @ai-matrx/detail). */\nexport function ShieldAlertIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"shield-alert\", props)}>\n <path d=\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\" />\n <path d=\"M12 8v4\" />\n <path d=\"M12 16h.01\" />\n </svg>\n );\n}\n\n/** lucide `shield-check` (moved from @ai-matrx/detail). */\nexport function ShieldCheckIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"shield-check\", props)}>\n <path d=\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\" />\n <path d=\"m9 12 2 2 4-4\" />\n </svg>\n );\n}\n\n/** lucide `badge-check` — the verified mark. */\nexport function BadgeCheckIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"badge-check\", props)}>\n <path d=\"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z\" />\n <path d=\"m9 12 2 2 4-4\" />\n </svg>\n );\n}\n\n/** lucide `shield` (moved from @ai-matrx/agents). */\nexport function ShieldIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"shield\", props)}>\n <path d=\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\" />\n </svg>\n );\n}\n\n/** lucide `sidebar` (moved from @ai-matrx/coding-sessions). */\nexport function SidebarIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sidebar\", props)}>\n <rect x=\"3.5\" y=\"4.5\" width=\"17\" height=\"15\" rx=\"2.5\" />\n <path d=\"M9.5 4.5v15\" />\n </svg>\n );\n}\n\n/** lucide `sliders-horizontal` (moved from @ai-matrx/agents). */\nexport function SlidersHorizontalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sliders-horizontal\", props)}>\n <path d=\"M10 5H3\" />\n <path d=\"M12 19H3\" />\n <path d=\"M14 3v4\" />\n <path d=\"M16 17v4\" />\n <path d=\"M21 12h-9\" />\n <path d=\"M21 19h-5\" />\n <path d=\"M21 5h-7\" />\n <path d=\"M8 10v4\" />\n <path d=\"M8 12H3\" />\n </svg>\n );\n}\n\n/** lucide `smile` (moved from @ai-matrx/meet). */\nexport function SmileIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"smile\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M8 14s1.5 2 4 2 4-2 4-2\" />\n <line x1=\"9\" x2=\"9.01\" y1=\"9\" y2=\"9\" />\n <line x1=\"15\" x2=\"15.01\" y1=\"9\" y2=\"9\" />\n </svg>\n );\n}\n\n/** lucide `speaker` (moved from @ai-matrx/meet). */\nexport function SpeakerIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"speaker\", props)}>\n <path d=\"M11 5 6 9H2v6h4l5 4V5Z\" />\n <path d=\"M15.54 8.46a5 5 0 0 1 0 7.07\" />\n <path d=\"M19.07 4.93a10 10 0 0 1 0 14.14\" />\n </svg>\n );\n}\n\n/** lucide `split-down` (moved from @ai-matrx/canvas). */\nexport function SplitDownIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"split-down\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M3 12h18\" />\n </svg>\n );\n}\n\n/** lucide `spotlight` (moved from @ai-matrx/meet). */\nexport function SpotlightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"spotlight\", props)}>\n <path d=\"M12 2 15 8.5 22 9.3 17 14 18.2 21 12 17.6 5.8 21 7 14 2 9.3 9 8.5Z\" />\n </svg>\n );\n}\n\n/** lucide `stop` (moved from @ai-matrx/coding-sessions). */\nexport function StopIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"stop\", props)}>\n <rect x=\"6\" y=\"6\" width=\"12\" height=\"12\" rx=\"2\" fill=\"currentColor\" stroke=\"none\" />\n </svg>\n );\n}\n\n/** lucide `subtitles` (moved from @ai-matrx/media). */\nexport function SubtitlesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"subtitles\", props)}>\n <rect width=\"18\" height=\"14\" x=\"3\" y=\"5\" rx=\"2\" ry=\"2\" />\n <path d=\"M7 15h4M15 15h2M7 11h2M13 11h4\" />\n </svg>\n );\n}\n\n/** lucide `sun` (moved from @ai-matrx/coding-sessions). */\nexport function SunIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sun\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d=\"M12 2.5v2M12 19.5v2M4.2 4.2l1.4 1.4M18.4 18.4l1.4 1.4M2.5 12h2M19.5 12h2M4.2 19.8l1.4-1.4M18.4 5.6l1.4-1.4\" />\n </svg>\n );\n}\n\n/** lucide `sun-medium` (moved from @ai-matrx/capture). */\nexport function SunMediumIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sun-medium\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d=\"M12 3v1\" />\n <path d=\"M12 20v1\" />\n <path d=\"M3 12h1\" />\n <path d=\"M20 12h1\" />\n <path d=\"m18.364 5.636-.707.707\" />\n <path d=\"m6.343 17.657-.707.707\" />\n <path d=\"m5.636 5.636.707.707\" />\n <path d=\"m17.657 17.657.707.707\" />\n </svg>\n );\n}\n\n/** lucide `tag` (moved from @ai-matrx/associations). */\nexport function TagIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"tag\", props)}>\n <path d=\"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z\" />\n <circle cx=\"7.5\" cy=\"7.5\" r=\".5\" fill=\"currentColor\" />\n </svg>\n );\n}\n\n/** lucide `timer` (moved from @ai-matrx/capture). */\nexport function TimerIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"timer\", props)}>\n <line x1=\"10\" x2=\"14\" y1=\"2\" y2=\"2\" />\n <line x1=\"12\" x2=\"15\" y1=\"14\" y2=\"11\" />\n <circle cx=\"12\" cy=\"14\" r=\"8\" />\n </svg>\n );\n}\n\n/** lucide `type` (moved from @ai-matrx/agents). */\nexport function TypeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"type\", props)}>\n <path d=\"M12 4v16\" />\n <path d=\"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2\" />\n <path d=\"M9 20h6\" />\n </svg>\n );\n}\n\n/** lucide `unfold-vertical` (moved from @ai-matrx/diff). */\nexport function UnfoldVerticalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"unfold-vertical\", props)}>\n <path d=\"M12 22v-6\" />\n <path d=\"M12 8V2\" />\n <path d=\"M4 12H2\" />\n <path d=\"M10 12H8\" />\n <path d=\"M16 12h-2\" />\n <path d=\"M22 12h-2\" />\n <path d=\"m15 19-3 3-3-3\" />\n <path d=\"m15 5-3-3-3 3\" />\n </svg>\n );\n}\n\n/** lucide `unlink` (moved from @ai-matrx/agents). */\nexport function UnlinkIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"unlink\", props)}>\n <path d=\"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71\" />\n <path d=\"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71\" />\n <line x1=\"8\" x2=\"8\" y1=\"2\" y2=\"5\" />\n <line x1=\"2\" x2=\"5\" y1=\"8\" y2=\"8\" />\n <line x1=\"16\" x2=\"16\" y1=\"19\" y2=\"22\" />\n <line x1=\"19\" x2=\"22\" y1=\"16\" y2=\"16\" />\n </svg>\n );\n}\n\n/** lucide `upvote` (moved from @ai-matrx/meet). */\nexport function UpvoteIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"upvote\", props)}>\n <path d=\"M9 18v-6H5l7-7 7 7h-4v6H9z\" />\n </svg>\n );\n}\n\n/** lucide `variable` (moved from @ai-matrx/agents). */\nexport function VariableIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"variable\", props)}>\n <path d=\"M8 21s-4-3-4-9 4-9 4-9\" />\n <path d=\"M16 3s4 3 4 9-4 9-4 9\" />\n <line x1=\"15\" x2=\"9\" y1=\"9\" y2=\"15\" />\n <line x1=\"9\" x2=\"15\" y1=\"9\" y2=\"15\" />\n </svg>\n );\n}\n\n/** lucide `video-off` (moved from @ai-matrx/media). */\nexport function VideoOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"video-off\", props)}>\n <path d=\"M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196\" />\n <path d=\"M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2\" />\n <path d=\"m2 2 20 20\" />\n </svg>\n );\n}\n\n/** lucide `volume-x` (moved from @ai-matrx/media). */\nexport function VolumeXIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"volume-x\", props)}>\n <path d=\"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\" />\n <line x1=\"22\" x2=\"16\" y1=\"9\" y2=\"15\" />\n <line x1=\"16\" x2=\"22\" y1=\"9\" y2=\"15\" />\n </svg>\n );\n}\n\n/** lucide `webhook` (moved from @ai-matrx/agents). */\nexport function WebhookIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"webhook\", props)}>\n <path d=\"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2\" />\n <path d=\"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06\" />\n <path d=\"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8\" />\n </svg>\n );\n}\n\n/** lucide `whiteboard` (moved from @ai-matrx/meet). */\nexport function WhiteboardIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"whiteboard\", props)}>\n <path d=\"M2 3h20\" />\n <path d=\"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3\" />\n <path d=\"m7 21 5-5 5 5\" />\n </svg>\n );\n}\n\n/** lucide `wifi-low` (moved from @ai-matrx/meet). */\nexport function WifiLowIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"wifi-low\", props)}>\n <path d=\"M12 20h.01\" />\n <path d=\"M8.5 16.5a5 5 0 0 1 7 0\" />\n </svg>\n );\n}\n\n/** lucide `wrap-text` (moved from @ai-matrx/diff). */\nexport function WrapTextIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"wrap-text\", props)}>\n <path d=\"M3 6h18\" />\n <path d=\"M3 12h15a3 3 0 1 1 0 6h-4\" />\n <path d=\"m16 16-2 2 2 2\" />\n <path d=\"M3 18h7\" />\n </svg>\n );\n}\n\n/** lucide `wrench` (moved from @ai-matrx/agents). */\nexport function WrenchIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"wrench\", props)}>\n <path d=\"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z\" />\n </svg>\n );\n}\n\n/** lucide `youtube` (moved from @ai-matrx/agents). */\nexport function YoutubeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"youtube\", props)}>\n <path d=\"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17\" />\n <path d=\"m10 15 5-3-5-3z\" />\n </svg>\n );\n}\n\n/** lucide `zap` (moved from @ai-matrx/capture). */\nexport function ZapIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"zap\", props)}>\n <path d=\"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z\" />\n </svg>\n );\n}\n\n/** lucide `zap-off` (moved from @ai-matrx/capture). */\nexport function ZapOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"zap-off\", props)}>\n <path d=\"M10.513 4.856 13.12 2.17a.5.5 0 0 1 .86.46l-1.377 4.317\" />\n <path d=\"M15.656 10H20a1 1 0 0 1 .78 1.63l-1.72 1.773\" />\n <path d=\"M16.273 16.273 10.88 21.83a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14H4a1 1 0 0 1-.78-1.63l4.507-4.643\" />\n <path d=\"m2 2 20 20\" />\n </svg>\n );\n}\n\n/** lucide `log-in` — the sign-in action of the auth gate. */\nexport function LogInIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"log-in\", props)}>\n <path d=\"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4\" />\n <polyline points=\"10 17 15 12 10 7\" />\n <line x1=\"15\" x2=\"3\" y1=\"12\" y2=\"12\" />\n </svg>\n );\n}\n\n/** lucide `gem` — the create-account action of the auth gate. */\nexport function GemIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"gem\", props)}>\n <path d=\"M6 3h12l4 6-10 13L2 9Z\" />\n <path d=\"M11 3 8 9l4 13 4-13-3-6\" />\n <path d=\"M2 9h20\" />\n </svg>\n );\n}\n\n/** lucide `key`. */\nexport function KeyIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"key\", props)}>\n <path d=\"m2 21 9.6-9.6\" />\n <path d=\"m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19\" />\n <circle cx=\"15.5\" cy=\"7.5\" r=\"5.5\" />\n </svg>\n );\n}\n\n/** lucide `credit-card`. */\nexport function CreditCardIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"credit-card\", props)}>\n <rect width=\"20\" height=\"14\" x=\"2\" y=\"5\" rx=\"2\" />\n <line x1=\"2\" x2=\"22\" y1=\"10\" y2=\"10\" />\n <path d=\"M6 14h2\" />\n </svg>\n );\n}\n\n/** lucide `user-round`. */\nexport function UserRoundIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"user-round\", props)}>\n <circle cx=\"12\" cy=\"8\" r=\"5\" />\n <path d=\"M20 21a8 8 0 0 0-16 0\" />\n </svg>\n );\n}\n\n/** lucide `user`. */\nexport function UserIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"user\", props)}>\n <path d=\"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\" />\n <circle cx=\"12\" cy=\"7\" r=\"4\" />\n </svg>\n );\n}\n\n/** lucide `terminal`. */\nexport function TerminalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"terminal\", props)}>\n <path d=\"M12 19h8\" />\n <path d=\"m4 17 6-6-6-6\" />\n </svg>\n );\n}\n\n/** lucide `trash`. */\nexport function TrashIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"trash\", props)}>\n <path d=\"M10 11v6\" />\n <path d=\"M14 11v6\" />\n <path d=\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\" />\n <path d=\"M3 6h18\" />\n <path d=\"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\" />\n </svg>\n );\n}\n\n/** lucide `building`. */\nexport function BuildingIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"building\", props)}>\n <path d=\"M12 10h.01\" />\n <path d=\"M12 14h.01\" />\n <path d=\"M12 6h.01\" />\n <path d=\"M16 10h.01\" />\n <path d=\"M16 14h.01\" />\n <path d=\"M16 6h.01\" />\n <path d=\"M8 10h.01\" />\n <path d=\"M8 14h.01\" />\n <path d=\"M8 6h.01\" />\n <path d=\"M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3\" />\n <rect x=\"4\" y=\"2\" width=\"16\" height=\"20\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `plug`. */\nexport function PlugIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"plug\", props)}>\n <path d=\"M12 22v-5\" />\n <path d=\"M15 8V2\" />\n <path d=\"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z\" />\n <path d=\"M9 8V2\" />\n </svg>\n );\n}\n\n/** lucide `share`. */\nexport function ShareIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"share\", props)}>\n <path d=\"M12 2v13\" />\n <path d=\"m16 6-4-4-4 4\" />\n <path d=\"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8\" />\n </svg>\n );\n}\n\n/** lucide `arrow-up-down`. */\nexport function ArrowUpDownIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-up-down\", props)}>\n <path d=\"m21 16-4 4-4-4\" />\n <path d=\"M17 20V4\" />\n <path d=\"m3 8 4-4 4 4\" />\n <path d=\"M7 4v16\" />\n </svg>\n );\n}\n\n/** lucide `move`. */\nexport function MoveIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"move\", props)}>\n <path d=\"M12 2v20\" />\n <path d=\"m15 19-3 3-3-3\" />\n <path d=\"m19 9 3 3-3 3\" />\n <path d=\"M2 12h20\" />\n <path d=\"m5 9-3 3 3 3\" />\n <path d=\"m9 5 3-3 3 3\" />\n </svg>\n );\n}\n\n/** lucide `qr-code`. */\nexport function QrCodeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"qr-code\", props)}>\n <rect width=\"5\" height=\"5\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"5\" height=\"5\" x=\"16\" y=\"3\" rx=\"1\" />\n <rect width=\"5\" height=\"5\" x=\"3\" y=\"16\" rx=\"1\" />\n <path d=\"M21 16h-3a2 2 0 0 0-2 2v3\" />\n <path d=\"M21 21v.01\" />\n <path d=\"M12 7v3a2 2 0 0 1-2 2H7\" />\n <path d=\"M3 12h.01\" />\n <path d=\"M12 3h.01\" />\n <path d=\"M12 16v.01\" />\n <path d=\"M16 12h1\" />\n <path d=\"M21 12v.01\" />\n <path d=\"M12 21v-1\" />\n </svg>\n );\n}\n\n/** lucide `power`. */\nexport function PowerIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"power\", props)}>\n <path d=\"M12 2v10\" />\n <path d=\"M18.4 6.6a9 9 0 1 1-12.77.04\" />\n </svg>\n );\n}\n\n/** lucide `sliders-vertical`. */\nexport function SlidersVerticalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sliders-vertical\", props)}>\n <path d=\"M10 8h4\" />\n <path d=\"M12 21v-9\" />\n <path d=\"M12 8V3\" />\n <path d=\"M17 16h4\" />\n <path d=\"M19 12V3\" />\n <path d=\"M19 21v-5\" />\n <path d=\"M3 14h4\" />\n <path d=\"M5 10V3\" />\n <path d=\"M5 21v-7\" />\n </svg>\n );\n}\n\n/** lucide `fingerprint-pattern`. */\nexport function FingerprintPatternIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"fingerprint-pattern\", props)}>\n <path d=\"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4\" />\n <path d=\"M14 13.12c0 2.38 0 6.38-1 8.88\" />\n <path d=\"M17.29 21.02c.12-.6.43-2.3.5-3.02\" />\n <path d=\"M2 12a10 10 0 0 1 18-6\" />\n <path d=\"M2 16h.01\" />\n <path d=\"M21.8 16c.2-2 .131-5.354 0-6\" />\n <path d=\"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2\" />\n <path d=\"M8.65 22c.21-.66.45-1.32.57-2\" />\n <path d=\"M9 6.8a6 6 0 0 1 9 5.2v2\" />\n </svg>\n );\n}\n\n/** lucide `send`. */\nexport function SendIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"send\", props)}>\n <path d=\"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z\" />\n <path d=\"m21.854 2.147-10.94 10.939\" />\n </svg>\n );\n}\n\n/** lucide `paperclip`. */\nexport function PaperclipIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"paperclip\", props)}>\n <path d=\"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551\" />\n </svg>\n );\n}\n\n/** lucide `check-check`. */\nexport function CheckCheckIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"check-check\", props)}>\n <path d=\"M18 6 7 17l-5-5\" />\n <path d=\"m22 10-7.5 7.5L13 16\" />\n </svg>\n );\n}\n\n/** lucide `reply`. */\nexport function ReplyIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"reply\", props)}>\n <path d=\"M20 18v-2a4 4 0 0 0-4-4H4\" />\n <path d=\"m9 17-5-5 5-5\" />\n </svg>\n );\n}\n\n/** lucide `link`. */\nexport function LinkIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"link\", props)}>\n <path d=\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\" />\n <path d=\"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\" />\n </svg>\n );\n}\n\n/** lucide `bot`. */\nexport function BotIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"bot\", props)}>\n <path d=\"M12 8V4H8\" />\n <rect width=\"16\" height=\"12\" x=\"4\" y=\"8\" rx=\"2\" />\n <path d=\"M2 14h2\" />\n <path d=\"M20 14h2\" />\n <path d=\"M15 13v2\" />\n <path d=\"M9 13v2\" />\n </svg>\n );\n}\n\n/** lucide `bell-off`. */\nexport function BellOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"bell-off\", props)}>\n <path d=\"M10.268 21a2 2 0 0 0 3.464 0\" />\n <path d=\"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742\" />\n <path d=\"m2 2 20 20\" />\n <path d=\"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05\" />\n </svg>\n );\n}\n\n/** lucide `mail`. */\nexport function MailIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"mail\", props)}>\n <path d=\"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7\" />\n <rect x=\"2\" y=\"4\" width=\"20\" height=\"16\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `mail-open`. */\nexport function MailOpenIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"mail-open\", props)}>\n <path d=\"M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z\" />\n <path d=\"m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10\" />\n </svg>\n );\n}\n\n/** lucide `folder-input`. */\nexport function FolderInputIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"folder-input\", props)}>\n <path d=\"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1\" />\n <path d=\"M2 13h10\" />\n <path d=\"m9 16 3-3-3-3\" />\n </svg>\n );\n}\n\n/** lucide `star-off`. */\nexport function StarOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"star-off\", props)}>\n <path d=\"m10.344 4.688 1.181-2.393a.53.53 0 0 1 .95 0l2.31 4.679a2.12 2.12 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.237 3.152\" />\n <path d=\"m17.945 17.945.43 2.505a.53.53 0 0 1-.771.56l-4.618-2.428a2.12 2.12 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.12 2.12 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a8 8 0 0 0 .4-.099\" />\n <path d=\"m2 2 20 20\" />\n </svg>\n );\n}\n\n/** lucide `columns-3`. */\nexport function Columns3Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"columns-3\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M9 3v18\" />\n <path d=\"M15 3v18\" />\n </svg>\n );\n}\n\n/** lucide `blocks`. */\nexport function BlocksIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"blocks\", props)}>\n <path d=\"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2\" />\n <rect x=\"14\" y=\"2\" width=\"8\" height=\"8\" rx=\"1\" />\n </svg>\n );\n}\n\n/** lucide `calendar-clock`. */\nexport function CalendarClockIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"calendar-clock\", props)}>\n <path d=\"M16 14v2.2l1.6 1\" />\n <path d=\"M16 2v3\" />\n <path d=\"M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338\" />\n <path d=\"M3 9h5.859\" />\n <path d=\"M8 2v3\" />\n <circle cx=\"16\" cy=\"16\" r=\"6\" />\n </svg>\n );\n}\n\n/** lucide `door-open`. */\nexport function DoorOpenIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"door-open\", props)}>\n <path d=\"M10 21H2\" />\n <path d=\"M10 3H7a2 2 0 00-2 2v16\" />\n <path d=\"M14 12h.01\" />\n <path d=\"M19 21V5a2 2 0 00-1.675-1.974l-6.163-1.013A1 1 0 0010 3v18a1 1 0 001.124.992z\" />\n <path d=\"M22 21h-3\" />\n </svg>\n );\n}\n\n/** lucide `inbox`. */\nexport function InboxIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"inbox\", props)}>\n <polyline points=\"22 12 16 12 14 15 10 15 8 12 2 12\" />\n <path d=\"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z\" />\n </svg>\n );\n}\n\n/** lucide `layout-dashboard`. */\nexport function LayoutDashboardIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"layout-dashboard\", props)}>\n <rect width=\"7\" height=\"9\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"5\" x=\"14\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"9\" x=\"14\" y=\"12\" rx=\"1\" />\n <rect width=\"7\" height=\"5\" x=\"3\" y=\"16\" rx=\"1\" />\n </svg>\n );\n}\n\n/** lucide `archive-restore`. */\nexport function ArchiveRestoreIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"archive-restore\", props)}>\n <rect width=\"20\" height=\"5\" x=\"2\" y=\"3\" rx=\"1\" />\n <path d=\"M4 8v11a2 2 0 0 0 2 2h2\" />\n <path d=\"M20 8v11a2 2 0 0 1-2 2h-2\" />\n <path d=\"m9 15 3-3 3 3\" />\n <path d=\"M12 12v9\" />\n </svg>\n );\n}\n\n/** lucide `split`. */\nexport function SplitIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"split\", props)}>\n <path d=\"M16 3h5v5\" />\n <path d=\"M8 3H3v5\" />\n <path d=\"M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3\" />\n <path d=\"m15 9 6-6\" />\n </svg>\n );\n}\n\n/** lucide `arrow-up-from-line`. */\nexport function ArrowUpFromLineIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-up-from-line\", props)}>\n <path d=\"m18 9-6-6-6 6\" />\n <path d=\"M12 3v14\" />\n <path d=\"M5 21h14\" />\n </svg>\n );\n}\n\n/** lucide `lock-open`. */\nexport function LockOpenIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"lock-open\", props)}>\n <rect width=\"18\" height=\"11\" x=\"3\" y=\"11\" rx=\"2\" ry=\"2\" />\n <path d=\"M7 11V7a5 5 0 0 1 9.9-1\" />\n </svg>\n );\n}\n\n/** lucide `printer`. */\nexport function PrinterIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"printer\", props)}>\n <path d=\"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2\" />\n <path d=\"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6\" />\n <rect x=\"6\" y=\"14\" width=\"12\" height=\"8\" rx=\"1\" />\n </svg>\n );\n}\n\n/** lucide `rocket`. */\nexport function RocketIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"rocket\", props)}>\n <path d=\"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5\" />\n <path d=\"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09\" />\n <path d=\"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z\" />\n <path d=\"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05\" />\n </svg>\n );\n}\n\n/** lucide `message-circle`. */\nexport function MessageCircleIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"message-circle\", props)}>\n <path d=\"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719\" />\n </svg>\n );\n}\n\n/** lucide `copy-plus`. */\nexport function CopyPlusIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"copy-plus\", props)}>\n <line x1=\"15\" x2=\"15\" y1=\"12\" y2=\"18\" />\n <line x1=\"12\" x2=\"18\" y1=\"15\" y2=\"15\" />\n <rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n <path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" />\n </svg>\n );\n}\n\n/** lucide `map-pin`. */\nexport function MapPinIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"map-pin\", props)}>\n <path d=\"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0\" />\n <circle cx=\"12\" cy=\"10\" r=\"3\" />\n </svg>\n );\n}\n\n/** lucide `at-sign`. */\nexport function AtSignIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"at-sign\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d=\"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8\" />\n </svg>\n );\n}\n\n/** lucide `link-2-off`. */\nexport function Link2OffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"link-2-off\", props)}>\n <path d=\"M9 17H7A5 5 0 0 1 7 7\" />\n <path d=\"M15 7h2a5 5 0 0 1 4 8\" />\n <line x1=\"8\" x2=\"12\" y1=\"12\" y2=\"12\" />\n <line x1=\"2\" x2=\"22\" y1=\"2\" y2=\"22\" />\n </svg>\n );\n}\n\n/** lucide `whole-word`. */\nexport function WholeWordIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"whole-word\", props)}>\n <circle cx=\"7\" cy=\"12\" r=\"3\" />\n <path d=\"M10 9v6\" />\n <circle cx=\"17\" cy=\"12\" r=\"3\" />\n <path d=\"M14 7v8\" />\n <path d=\"M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1\" />\n </svg>\n );\n}\n\n/** lucide `lightbulb`. */\nexport function LightbulbIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"lightbulb\", props)}>\n <path d=\"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5\" />\n <path d=\"M9 18h6\" />\n <path d=\"M10 22h4\" />\n </svg>\n );\n}\n\n/** lucide `shield-off`. */\nexport function ShieldOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"shield-off\", props)}>\n <path d=\"m2 2 20 20\" />\n <path d=\"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71\" />\n <path d=\"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264\" />\n </svg>\n );\n}\n\n/** lucide `chevrons-left`. */\nexport function ChevronsLeftIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevrons-left\", props)}>\n <path d=\"m11 17-5-5 5-5\" />\n <path d=\"m18 17-5-5 5-5\" />\n </svg>\n );\n}\n\n/** lucide `chevrons-right`. */\nexport function ChevronsRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevrons-right\", props)}>\n <path d=\"m6 17 5-5-5-5\" />\n <path d=\"m13 17 5-5-5-5\" />\n </svg>\n );\n}\n\n/** lucide `users-round`. */\nexport function UsersRoundIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"users-round\", props)}>\n <path d=\"M18 21a8 8 0 0 0-16 0\" />\n <circle cx=\"10\" cy=\"8\" r=\"5\" />\n <path d=\"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3\" />\n </svg>\n );\n}\n\n/** lucide `landmark`. */\nexport function LandmarkIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"landmark\", props)}>\n <path d=\"M10 18v-7\" />\n <path d=\"M11.119 2.205a2 2 0 0 1 1.762 0l7.84 3.846A.5.5 0 0 1 20.5 7h-17a.5.5 0 0 1-.22-.949z\" />\n <path d=\"M14 18v-7\" />\n <path d=\"M18 18v-7\" />\n <path d=\"M3 22h18\" />\n <path d=\"M6 18v-7\" />\n </svg>\n );\n}\n\n/** lucide `factory`. */\nexport function FactoryIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"factory\", props)}>\n <path d=\"M12 16h.01\" />\n <path d=\"M16 16h.01\" />\n <path d=\"M3 19a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a.5.5 0 0 0-.769-.422l-4.462 2.844A.5.5 0 0 1 15 10.5v-2a.5.5 0 0 0-.769-.422L9.77 10.922A.5.5 0 0 1 9 10.5V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2z\" />\n <path d=\"M8 16h.01\" />\n </svg>\n );\n}\n\n/** lucide `chevrons-down` — CollapsibleText's \"expand all\". */\nexport function ChevronsDownIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevrons-down\", props)}>\n <path d=\"m7 6 5 5 5-5\" />\n <path d=\"m7 13 5 5 5-5\" />\n </svg>\n );\n}\n\n/** lucide `chevrons-up` — CollapsibleText's \"collapse all\". */\nexport function ChevronsUpIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevrons-up\", props)}>\n <path d=\"m17 11-5-5-5 5\" />\n <path d=\"m17 18-5-5-5 5\" />\n </svg>\n );\n}\n\n/** lucide `arrow-up-right` — CitationChip's \"open source\". */\nexport function ArrowUpRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-up-right\", props)}>\n <path d=\"M7 7h10v10\" />\n <path d=\"M7 17 17 7\" />\n </svg>\n );\n}\n\n/** lucide `quote` — CitationChip's excerpt blockquote. */\nexport function QuoteIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"quote\", props)}>\n <path d=\"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z\" />\n <path d=\"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z\" />\n </svg>\n );\n}\n\n/** lucide `panel-top-open` — the floating dock's phone menu button (opens the list). */\nexport function PanelTopOpenIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"panel-top-open\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M3 9h18\" />\n <path d=\"m15 14-3 3-3-3\" />\n </svg>\n );\n}\n\n/** lucide `panel-top-close` — the floating dock's phone menu button (closes the list). */\nexport function PanelTopCloseIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"panel-top-close\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M3 9h18\" />\n <path d=\"m9 16 3-3 3 3\" />\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\nimport * as React from \"react\";\n\n/**\n * A NESTED SUBMENU OPENS ON ITS PARENT'S SIDE (0.62.4).\n *\n * Radix draws every submenu on the right (left in RTL) and flips only when THAT side lacks room.\n * Measured at a 1600 px viewport: main menu x 1194–1482, first submenu flipped left to 909–1197,\n * second submenu — with 118 px to spare on the right of its trigger — drawn at 1194–1482, exactly\n * over the main menu. The second level must follow the first: when the parent resolved to the\n * non-default side, the default side is closed to the child with collision padding, so Radix's own\n * flip sends it the same way as its parent. When the parent's side has no room either, Radix's\n * best-fit still decides — it flips only when that side has no room.\n *\n * `side` is not overridable on a Radix SubContent (it is spread after the caller's props); the\n * collision padding is the supported lever.\n */\nexport type SubmenuCollisionPadding = number | Partial<Record<\"top\" | \"right\" | \"bottom\" | \"left\", number>>;\n\nexport const SubmenuParentContext = React.createContext<React.MutableRefObject<HTMLElement | null> | null>(null);\n\nfunction normalise(base: SubmenuCollisionPadding | undefined, fallback: number) {\n if (typeof base === \"number\") return { top: base, right: base, bottom: base, left: base };\n return { top: base?.top ?? fallback, right: base?.right ?? fallback, bottom: base?.bottom ?? fallback, left: base?.left ?? fallback };\n}\n\n/** Pure: the collision padding a nested submenu takes, given the parent submenu's element. */\nexport function nestedSubmenuCollisionPadding(\n parent: HTMLElement | null,\n base?: SubmenuCollisionPadding,\n viewportWidth?: number,\n): SubmenuCollisionPadding | undefined {\n if (!parent) return base;\n const side = parent.getAttribute(\"data-side\");\n if (side !== \"left\" && side !== \"right\") return base;\n const view = parent.ownerDocument.defaultView;\n const rtl = view?.getComputedStyle(parent).direction === \"rtl\";\n const preferred = rtl ? \"left\" : \"right\";\n if (side === preferred) return base; // the parent took the default side; the child follows it\n const padding = normalise(base, 0);\n const rect = parent.getBoundingClientRect();\n if (preferred === \"right\") {\n const vw = viewportWidth ?? parent.ownerDocument.documentElement.clientWidth ?? view?.innerWidth ?? 0;\n if (!vw) return base;\n padding.right = Math.max(padding.right, vw - rect.left);\n } else {\n padding.left = Math.max(padding.left, rect.right);\n }\n return padding;\n}\n\n/** For a SubContent wrapper: the collision padding to pass, a ref to compose onto the content,\n * and a wrapper that tells THIS submenu's own children where their parent is. */\nexport function useNestedSubmenuPlacement(\n forwardedRef: React.ForwardedRef<HTMLDivElement>,\n collisionPadding: SubmenuCollisionPadding | undefined,\n) {\n const parent = React.useContext(SubmenuParentContext);\n const own = React.useRef<HTMLElement | null>(null);\n const ref = React.useCallback(\n (node: HTMLDivElement | null) => {\n own.current = node;\n if (typeof forwardedRef === \"function\") forwardedRef(node);\n else if (forwardedRef) forwardedRef.current = node;\n },\n [forwardedRef],\n );\n const padding = nestedSubmenuCollisionPadding(parent?.current ?? null, collisionPadding);\n const wrap = (children: React.ReactNode) => (\n <SubmenuParentContext.Provider value={own}>{children}</SubmenuParentContext.Provider>\n );\n return { ref, padding, wrap };\n}\n","/**\n * THE FOCUS-RETURN GUARD — a closing menu, popover, select or dialog never takes focus back from a\n * field the person has already moved into.\n *\n * Radix returns focus to the trigger when its content UNMOUNTS (FocusScope: a `setTimeout(0)` after the\n * exit animation, unconditionally). On a busy page that is hundreds of milliseconds after the person\n * picked an option — long enough for them to click the next field and start typing. The return then\n * lands mid-word: focus jumps to the trigger and every key after it is lost (\"https://drive…\" saved as\n * \"https:\", Applet social planner, 2026-10-08).\n *\n * `keepMovedFocus(handler)` composes a content's `onCloseAutoFocus`: when focus already sits on a live\n * element outside the closing content (not the page body), the return is canceled; otherwise Radix\n * returns focus to the trigger exactly as before (keyboard users closing with Escape keep their place).\n */\n/** True when focus has already moved to something the person chose, outside `container`. */\nexport function focusMovedElsewhere(container: EventTarget | null, doc: Document | undefined = typeof document === \"undefined\" ? undefined : document): boolean {\n if (!doc) return false;\n const active = doc.activeElement;\n if (!active || active === doc.body || active === doc.documentElement) return false;\n if (!active.isConnected) return false;\n if (container && typeof (container as Node).contains === \"function\" && (container as Node).contains(active)) return false;\n return true;\n}\n\n/** Compose a content's `onCloseAutoFocus` with THE FOCUS-RETURN GUARD (the caller's handler runs first). */\nexport function keepMovedFocus(handler?: (event: Event) => void): (event: Event) => void {\n return (event: Event) => {\n handler?.(event);\n if (event.defaultPrevented) return;\n const container = (event.currentTarget ?? event.target) as EventTarget | null;\n if (focusMovedElsewhere(container, (container as Node | null)?.ownerDocument ?? undefined)) event.preventDefault();\n };\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 { RadixCheckIcon, RadixChevronDownIcon, RadixChevronUpIcon } from \"./icons\";\nimport { usePortalContainer } from \"./portal-container\";\nimport { FIELD_SURFACE_CLASS } from \"./field-surface\";\nimport { keepMovedFocus } from \"./focus-return\";\n\nexport const Select = SelectPrimitive.Root;\n\nexport const SelectGroup = SelectPrimitive.Group;\n\nexport const SelectValue = SelectPrimitive.Value;\n\nexport const selectTriggerVariants = cva(\n `matrx-glyph-trim 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-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15 data-[state=open]:border-primary disabled:cursor-not-allowed disabled:bg-muted disabled:text-disabled-foreground [&>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 | undefined; size?: \"sm\" | \"default\" | undefined }) {\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 honors `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 onCloseAutoFocus,\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 centered dialog card — see motion.ts.\n position === \"popper\" && POPPER_OFFSET,\n className,\n )}\n position={position}\n {...props}\n onCloseAutoFocus={keepMovedFocus(onCloseAutoFocus)}\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(\"type-label px-2 pb-1 pt-2 text-muted-foreground\", 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 * What the option means, as its HOVER text — never a second line on desktop\n * (Arman, 2026-10-14: no \"novels\" in menus). Where nothing can hover (a phone,\n * a mouse-less tablet) it is the option's muted second line in the open list\n * (`data-touch-hint`, menu-look.css). The trigger shows only the label.\n */\n description?: string;\n /** Short trailing text in the menu only (a count, a size, why it cannot be chosen); the trigger never shows it. */\n meta?: React.ReactNode;\n }\n>(({ className, children, description, meta, title, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n title={title ?? description}\n className={cn(\n \"relative flex w-full min-w-0 select-none items-center rounded-sm py-1 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:text-disabled-foreground\",\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 <RadixCheckIcon 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 {/* Outside ItemText: the closed trigger shows the label alone. */}\n {description ? (\n <span data-touch-hint=\"\" className=\"hidden text-xs leading-snug text-muted-foreground [@media(hover:none)]:block\">\n {description}\n </span>\n ) : null}\n </span>\n {meta ? (\n <span data-slot=\"select-item-meta\" className=\"ml-3 min-w-0 shrink text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {meta}\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 gray page color in light mode),\n * BasicInput and the control Textarea were `bg-transparent` (gray on a gray\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","import * as React from \"react\";\n\n/** True when a node holds visible text anywhere in its React tree. */\nfunction hasText(node: React.ReactNode): boolean {\n if (typeof node === \"string\") return node.trim().length > 0;\n if (typeof node === \"number\" || typeof node === \"bigint\") return true;\n if (Array.isArray(node)) return node.some(hasText);\n if (React.isValidElement<{ children?: React.ReactNode }>(node)) return hasText(node.props.children);\n return false;\n}\n\n/**\n * A segment whose children are a glyph and no text — the square segment. Decided here, not in\n * CSS: `:has(> svg:only-child)` ignores text nodes, so an icon + name tab matched as well.\n */\nexport function isIconOnly(children: React.ReactNode): boolean {\n return React.Children.toArray(children).some((c) => React.isValidElement(c)) && !hasText(children);\n}\n","\"use client\";\n\n/**\n * Textarea — the multi-line twin of the Input family, same three shapes:\n * `Textarea` (elevated), `BasicTextarea` (plain control), and\n * `TextareaWithPrefix`.\n *\n * WHAT THE FORKS PROVED. Three hosts shipped a bare `<textarea>` with a\n * min-height and nothing else; matrx-frontend shipped auto-grow, min/max\n * height clamping, and a stretch-detection pass. That last one is the reason\n * this file is worth having: a `<textarea>` is a REPLACED element, so\n * `className=\"h-full\"` on it does nothing useful unless its parent is also\n * told to stretch — which is why every host that wanted a filling textarea\n * ended up wrapping it by hand at the call site, differently each time.\n * `getStretchClasses` reads the caller's own fill intent out of the className\n * and builds the wrapper for them.\n *\n * COLOR IS TOKENS (C26). The ported original pinned its body text to literal\n * black/white, its placeholder and focus ring to raw palette steps, and its\n * dark elevation to a custom property no host defined — so that shadow\n * computed to nothing. All four now resolve from the semantic vocabulary.\n *\n * AND `shadow-textarea` NOW EXISTS. The original's resting elevation class was\n * `shadow-textarea`, and NO host defined `--shadow-textarea` or generated that\n * utility — 125 call sites asked for an elevation they never got. The package\n * ships the token (defaulting to the Input family's `--shadow-input`, which is\n * plainly what the twin class meant) and the rule, so the class finally does\n * what it says. A host that wants the flat look sets `--shadow-textarea: none`.\n *\n * The clipboard/motion variants matrx-frontend layers on top (CopyTextarea,\n * FancyTextarea) stay host-owned under the C8 split-out law: they drag in\n * `motion/react`, and plain-textarea consumers must not pay for it.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { FIELD_SURFACE_CLASS } from \"./field-surface\";\n\nexport interface TextareaProps\n extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {\n /** Grow to fit content as the user types (and stop growing at `maxHeight`). */\n autoGrow?: boolean;\n /** Minimum height in px. */\n minHeight?: number;\n /** Maximum height in px; past it the field scrolls instead of growing. */\n maxHeight?: number;\n /** Classes for the wrapper this component adds when one is needed. */\n wrapperClassName?: string;\n}\n\nconst FILL_HEIGHT_REGEX = /(?:^|\\s)(h-full|h-dvh|flex-1|grow)(?:\\s|$)/;\nconst FILL_WIDTH_REGEX = /(?:^|\\s)(w-full|w-screen)(?:\\s|$)/;\n\n/**\n * A `<textarea>` cannot fill a box on its own — the box has to be told too.\n * Read the caller's fill intent out of its own className and mirror it onto\n * the wrapper, so `className=\"h-full\"` means what the caller thought it meant.\n */\nfunction getStretchClasses(className?: string): string | undefined {\n if (!className) return undefined;\n const fills: string[] = [];\n if (FILL_HEIGHT_REGEX.test(className)) fills.push(\"h-full min-h-0\");\n if (FILL_WIDTH_REGEX.test(className)) fills.push(\"w-full\");\n return fills.length ? fills.join(\" \") : undefined;\n}\n\nconst TEXTAREA_ELEVATED_CLASS =\n `flex h-auto w-full rounded-md ${FIELD_SURFACE_CLASS} px-3 py-2 text-sm text-foreground shadow-textarea transition duration-400 placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15 disabled:cursor-not-allowed disabled:opacity-50`;\n\nconst TEXTAREA_CONTROL_CLASS =\n `flex w-full rounded-md ${FIELD_SURFACE_CLASS} px-3 py-2 text-sm text-foreground shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15 disabled:cursor-not-allowed disabled:opacity-50`;\n\nexport function useAutoGrow(\n ref: React.RefObject<HTMLTextAreaElement | null>,\n value: React.TextareaHTMLAttributes<HTMLTextAreaElement>[\"value\"],\n autoGrow = false,\n minHeight?: number,\n maxHeight?: number,\n): void {\n React.useEffect(() => {\n if (!autoGrow || !ref.current) return;\n\n const textarea = ref.current;\n textarea.style.height = \"auto\";\n\n let newHeight = textarea.scrollHeight;\n if (minHeight) newHeight = Math.max(newHeight, minHeight);\n\n if (maxHeight && newHeight >= maxHeight) {\n textarea.style.height = `${maxHeight}px`;\n textarea.style.overflowY = \"auto\";\n } else {\n textarea.style.height = `${newHeight}px`;\n textarea.style.overflowY = \"hidden\";\n }\n }, [value, autoGrow, minHeight, maxHeight, ref]);\n}\n\n/** Merge a forwarded ref with the internal one auto-grow needs to measure. */\nexport function useMergedTextareaRef(\n forwarded: React.ForwardedRef<HTMLTextAreaElement>,\n): {\n ref: React.RefObject<HTMLTextAreaElement | null>;\n callback: (node: HTMLTextAreaElement | null) => void;\n} {\n const internal = React.useRef<HTMLTextAreaElement | null>(null);\n const callback = React.useCallback(\n (node: HTMLTextAreaElement | null) => {\n internal.current = node;\n if (typeof forwarded === \"function\") forwarded(node);\n else if (forwarded) forwarded.current = node;\n },\n [forwarded],\n );\n return { ref: internal, callback };\n}\n\nexport function boxStyle(\n minHeight?: number,\n maxHeight?: number,\n): React.CSSProperties | undefined {\n if (minHeight === undefined && maxHeight === undefined) return undefined;\n return {\n minHeight: minHeight ? `${minHeight}px` : undefined,\n maxHeight: maxHeight ? `${maxHeight}px` : undefined,\n };\n}\n\n/** The elevated textarea — the Input family's `Input`, in multi-line form. */\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n (\n { className, autoGrow, minHeight, maxHeight, wrapperClassName, ...props },\n forwarded,\n ) => {\n const { ref, callback } = useMergedTextareaRef(forwarded);\n const stretchClasses = getStretchClasses(className);\n const needsWrapper = Boolean(wrapperClassName || stretchClasses);\n\n useAutoGrow(ref, props.value, autoGrow, minHeight, maxHeight);\n\n const textarea = (\n <textarea\n ref={callback}\n data-slot=\"textarea\"\n className={cn(\n TEXTAREA_ELEVATED_CLASS,\n autoGrow && \"resize-none\",\n stretchClasses,\n className,\n )}\n style={boxStyle(minHeight, maxHeight)}\n {...props}\n />\n );\n\n if (!needsWrapper) return textarea;\n\n return <div className={cn(stretchClasses, wrapperClassName)}>{textarea}</div>;\n },\n);\nTextarea.displayName = \"Textarea\";\n\n/**\n * The plain control — a bordered, transparent field with a 60px floor. This is\n * what matrx-extend, aidream/apps/dashboard and workflow-studio each called\n * `Textarea`; the floor is theirs and it is the sensible default (a one-line\n * box for multi-line content invites a scrollbar on the first Enter).\n */\nconst BasicTextarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, autoGrow, minHeight, maxHeight, ...props }, forwarded) => {\n const { ref, callback } = useMergedTextareaRef(forwarded);\n\n useAutoGrow(ref, props.value, autoGrow, minHeight, maxHeight);\n\n return (\n <textarea\n ref={callback}\n data-slot=\"textarea\"\n className={cn(\n TEXTAREA_CONTROL_CLASS,\n \"h-auto min-h-[60px]\",\n autoGrow && \"resize-none\",\n className,\n )}\n style={boxStyle(minHeight, maxHeight)}\n {...props}\n />\n );\n },\n);\nBasicTextarea.displayName = \"BasicTextarea\";\n\nexport interface TextareaWithPrefixProps extends Omit<TextareaProps, \"prefix\"> {\n /** Leading adornment, absolutely placed at the field's top-left. */\n prefix?: React.ReactNode;\n}\n\nconst TextareaWithPrefix = React.forwardRef<\n HTMLTextAreaElement,\n TextareaWithPrefixProps\n>(\n (\n {\n prefix,\n className,\n wrapperClassName,\n autoGrow,\n minHeight,\n maxHeight,\n ...props\n },\n forwarded,\n ) => {\n const { ref, callback } = useMergedTextareaRef(forwarded);\n\n useAutoGrow(ref, props.value, autoGrow, minHeight, maxHeight);\n\n return (\n <div\n className={cn(\"relative\", getStretchClasses(className), wrapperClassName)}\n >\n {prefix ? (\n <div className=\"pointer-events-none absolute left-3 top-3 z-10 text-muted-foreground\">\n {prefix}\n </div>\n ) : null}\n <textarea\n ref={callback}\n data-slot=\"textarea\"\n className={cn(\n TEXTAREA_CONTROL_CLASS,\n \"resize-y\",\n prefix && \"pl-10\",\n autoGrow && \"resize-none\",\n className,\n )}\n style={boxStyle(minHeight, maxHeight)}\n {...props}\n />\n </div>\n );\n },\n);\nTextareaWithPrefix.displayName = \"TextareaWithPrefix\";\n\nexport { BasicTextarea, Textarea, TextareaWithPrefix };\n","\"use client\";\n\n/**\n * THE WINDOW CHROME CONTROLS (2026-10-23) — the title bar of a floating window (summon's\n * WindowPanel) drawn at macOS's own geometry, never the 28px control:\n *\n * WindowLights the traffic-light group: 12px dots 8px apart; hovering (or focusing) the\n * group reveals every light's 8px glyph, as macOS does. `inactive` greys the\n * lights of a window that is not in front until the pointer reaches them.\n * `touch` is the phone header's lights: 24px dots, 10px glyphs always shown.\n * WindowLight one light: `kind` close / minimize / maximize picks its color and glyph;\n * `restores` swaps in the restore glyph (a minimized window's yellow, a\n * maximized window's green). Disabled is a grey dot with no glyph.\n * WindowChromeButton a title-bar icon action (the sidebar toggle, pop out): a 20px square with\n * a 14px glyph, quiet until hovered.\n *\n * Geometry and color live in `controls.css` (THE WINDOW CHROME), locked in\n * `@layer matrx-tap-lock` like every control, so `className` places them and never restyles them.\n * Colors are the `--matrx-window-light-*` tokens in `tokens.css` (both themes). The contract is\n * pinned by `window-controls-geometry.test.tsx`: moving a light back onto the 28px Button fails it.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { Maximize2Icon, Minimize2Icon, MinusIcon, XIcon } from \"../icons\";\n\nexport type WindowLightKind = \"close\" | \"minimize\" | \"maximize\";\n\nexport interface WindowLightsProps extends React.HTMLAttributes<HTMLDivElement> {\n /** The window is not the one in front: the lights are grey until the pointer reaches them. */\n inactive?: boolean;\n /** The phone header's lights: 24px dots with their glyphs always shown (no hover on touch). */\n touch?: boolean;\n}\n\n/** The traffic-light group. Its hover (or keyboard focus) reveals every light's glyph. */\nexport const WindowLights = React.forwardRef<HTMLDivElement, WindowLightsProps>(\n ({ className, inactive, touch, role = \"group\", \"aria-label\": ariaLabel = \"Window controls\", ...props }, ref) => (\n <div\n ref={ref}\n role={role}\n aria-label={ariaLabel}\n data-matrx-window-lights=\"\"\n data-inactive={inactive ? \"\" : undefined}\n data-touch={touch ? \"\" : undefined}\n className={cn(\"matrx-window-lights\", className)}\n {...props}\n />\n ),\n);\nWindowLights.displayName = \"WindowLights\";\n\nexport interface WindowLightProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"children\"> {\n /** Which light: close (red), minimize (yellow), maximize (green). */\n kind: WindowLightKind;\n /** The light undoes its window's state (restore a minimized or maximized window): the restore glyph. */\n restores?: boolean;\n /** A light must say what it does. */\n \"aria-label\": string;\n}\n\nfunction lightGlyph(kind: WindowLightKind, restores: boolean): React.ReactNode {\n if (kind === \"close\") return <XIcon aria-hidden=\"true\" />;\n if (kind === \"minimize\") return restores ? <Maximize2Icon aria-hidden=\"true\" /> : <MinusIcon aria-hidden=\"true\" />;\n return restores ? <Minimize2Icon aria-hidden=\"true\" /> : <Maximize2Icon aria-hidden=\"true\" />;\n}\n\n/** One traffic light. Place it inside `WindowLights`. */\nexport const WindowLight = React.forwardRef<HTMLButtonElement, WindowLightProps>(\n ({ className, kind, restores = false, type, ...props }, ref) => (\n <button\n ref={ref}\n type={type ?? \"button\"}\n data-matrx-window-light={kind}\n data-restores={restores ? \"\" : undefined}\n className={cn(\"matrx-window-light\", className)}\n {...props}\n >\n {lightGlyph(kind, restores)}\n </button>\n ),\n);\nWindowLight.displayName = \"WindowLight\";\n\nexport interface WindowChromeButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"children\"> {\n /** The 14px glyph. */\n icon: React.ReactNode;\n /** A title-bar action must say what it does (also its tooltip unless `title` is given). */\n \"aria-label\": string;\n}\n\n/** A title-bar icon action (sidebar toggle, pop out): 20px, quiet until hovered. */\nexport const WindowChromeButton = React.forwardRef<HTMLButtonElement, WindowChromeButtonProps>(\n ({ className, icon, type, title, ...props }, ref) => (\n <button\n ref={ref}\n type={type ?? \"button\"}\n data-matrx-window-chrome-button=\"\"\n className={cn(\"matrx-window-chrome-button\", className)}\n title={title ?? props[\"aria-label\"]}\n {...props}\n >\n {icon}\n </button>\n ),\n);\nWindowChromeButton.displayName = \"WindowChromeButton\";\n","\"use client\";\n\n/**\n * DecisionControl — THE row decision: [Yes] [No] [Other] + the answer's value chip.\n *\n * EVERY DECISION OFFERS A WAY OUT (Arman, 2026-10-14): a row that only offers\n * \"Preferred / Alias / Not us\" forces a person to decide something they cannot,\n * and they freeze. So every decision is exactly three clear buttons in one row —\n * Yes, No, Other — the same words in the same place on every row, for a person\n * or a business and for any kind of data (the section header asks the question:\n * \"Is this yours?\", \"Is this your name?\"). Other's menu holds the smart,\n * context-specific answers first (Tagline, Former name, grouped relationships…)\n * and ALWAYS ends with the generic exit \"Skip for now\", which leaves the item\n * undecided — neither kept nor rejected.\n *\n * NO EMPTY BOX, EVER (Arman, 2026-10-14: \"There is a border remaining … no\n * professional app does that\"). Champion: Linear's issue properties (the issue\n * view sidebar and the row property chips) — a property with no value draws\n * nothing; the menu opens FROM the control that asked for it; a chosen value is\n * a compact chip, and clicking the chip reopens the same menu. So:\n * · no answer, No, or a plain Yes: nothing is drawn beside the buttons (the\n * column's width is reserved invisibly on desktop, so rows never jump);\n * · Other: its menu opens anchored to the Other button; closing it without a\n * pick is no answer again; Other pressed while answered clears (onClear);\n * · Yes with `yesKinds` (\"Main name\" / \"Also known as\", \"Primary site\" /\n * \"Also ours\"): the host sets the default kind and it shows as a chip — the\n * primary kind in the strong primary style; click the chip to change it;\n * · a way-out answer or a skip shows as a neutral chip; click to change it.\n *\n * Layout: one line on desktop; below `sm` the three buttons share the row\n * equally and the chip appears under them only once there is a value.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n} from \"../dropdown-menu\";\nimport { RadixCheckIcon } from \"../icons\";\nimport { Button, Chip } from \"./controls\";\n\nexport type DecisionAnswer = \"yes\" | \"no\" | \"other\";\n\nexport interface WayOutItem {\n value: string;\n label: string;\n /** 11px trailing text (a shortcut, \"We think\"). */\n meta?: string;\n /** A submenu (one level). Prefer `group` headings: a flat picker reads faster. */\n items?: WayOutItem[];\n /** A heading above this item, starting a group inside its menu. */\n group?: string;\n}\n\nexport interface DecisionControlProps {\n /** The answer: Yes, No, or Other (a way-out answer or a skip). Null = undecided. */\n value: DecisionAnswer | null;\n /** Yes or No pressed. Pressing the chosen one again is the host's to clear (EVERY BUTTON TOGGLES). */\n onChange: (value: \"yes\" | \"no\") => void;\n /** Context-specific way-out answers: Other's menu's first entries. */\n wayOut?: WayOutItem[];\n onWayOut?: (value: string) => void;\n /** The chosen way-out answer (a leaf value): the chip shows its label. */\n wayOutValue?: string | null;\n /** The kinds of yes (\"Main name\", \"Also known as\"): with Yes on, the chip shows the kind and changes it. */\n yesKinds?: WayOutItem[];\n /** The current kind of yes (one of `yesKinds`' values). */\n yesKind?: string | null;\n onYesKind?: (value: string) => void;\n /** Other pressed while on: the row goes back to no answer (EVERY BUTTON TOGGLES, Arman 2026-10-14). */\n onClear?: () => void;\n /** THE generic exit, always Other's last entry. Required: no decision without a way out. */\n onSkip: () => void;\n /** The item is skipped (undecided on purpose). */\n skipped?: boolean;\n /** Other's last entry. Default \"Skip for now\". */\n skipLabel?: string;\n /** The chip once skipped. Default \"Skipped for now\". */\n skippedLabel?: string;\n /** Button words; defaults Yes / No / Other. Keep the defaults unless a surface's question needs others. */\n labels?: Partial<Record<DecisionAnswer, string>>;\n /** Keyboard shortcuts shown as each button's muted meta (\"Y\"). */\n shortcuts?: Partial<Record<DecisionAnswer, string>>;\n /** \"We think\": the suggested answer glows (a ring) — it is never chosen for the person. */\n suggested?: DecisionAnswer | null;\n /** The chip's text when Yes is on with kinds but the host set none. Default \"Choose…\". */\n pickerPlaceholder?: string;\n disabled?: boolean;\n /**\n * \"row\" (default): the 28px everyday geometry for lists of decisions. \"stage\": a focus stage that shows ONE\n * decision at a time (Smart Add's validation page) — the buttons take the 44px inviting geometry (Button `hero`)\n * and the row keeps one line on every width. Arman's rule: flagship screens get an elevated stage.\n */\n size?: \"row\" | \"stage\";\n className?: string;\n \"aria-label\"?: string;\n}\n\nfunction find(items: WayOutItem[] | undefined, value: string | null | undefined): WayOutItem | null {\n if (!items || !value) return null;\n for (const i of items) {\n if (i.value === value) return i;\n const inner = find(i.items, value);\n if (inner) return inner;\n }\n return null;\n}\n\nfunction WayOutEntries({ items, chosen, onPick }: { items: WayOutItem[]; chosen: string | null | undefined; onPick: (value: string) => void }) {\n return (\n <>\n {items.map((item, index) => (\n <React.Fragment key={item.value}>\n {item.group ? (\n <>\n {index > 0 ? <DropdownMenuSeparator /> : null}\n {/* A heading as DropdownMenuLabel ships it (the style guide: never restyled). */}\n <DropdownMenuLabel data-way-out-group=\"\">{item.group}</DropdownMenuLabel>\n </>\n ) : null}\n {item.items?.length ? (\n <DropdownMenuSub>\n <DropdownMenuSubTrigger data-way-out={item.value} className=\"text-foreground\">\n <span className=\"flex-1\">{item.label}</span>\n {find(item.items, chosen) ? <RadixCheckIcon className=\"mr-1 size-3.5\" aria-hidden=\"true\" /> : null}\n </DropdownMenuSubTrigger>\n <DropdownMenuSubContent>\n <WayOutEntries items={item.items} chosen={chosen} onPick={onPick} />\n </DropdownMenuSubContent>\n </DropdownMenuSub>\n ) : (\n <DropdownMenuItem data-way-out={item.value} className=\"text-foreground\" onSelect={() => onPick(item.value)}>\n <span className=\"flex-1\">{item.label}</span>\n {item.meta ? <span className=\"text-[11px] text-muted-foreground\">{item.meta}</span> : null}\n {chosen === item.value ? <RadixCheckIcon className=\"size-3.5\" aria-hidden=\"true\" /> : null}\n </DropdownMenuItem>\n )}\n </React.Fragment>\n ))}\n </>\n );\n}\n\nconst ring = \"rounded-full ring-2 ring-primary ring-offset-1 ring-offset-background\";\n\n/** [Yes] [No] [Other] + the value chip (nothing drawn without a value; Other's menu opens from Other). */\nexport function DecisionControl({\n value,\n onChange,\n wayOut,\n onWayOut,\n wayOutValue,\n yesKinds,\n yesKind,\n onYesKind,\n onClear,\n onSkip,\n skipped,\n skipLabel = \"Skip for now\",\n skippedLabel = \"Skipped for now\",\n labels,\n shortcuts,\n suggested,\n pickerPlaceholder = \"Choose…\",\n disabled,\n size = \"row\",\n className,\n \"aria-label\": ariaLabel,\n}: DecisionControlProps) {\n // Other's menu is open from the Other button (Other is on while it is open, before anything is picked).\n const [otherOpen, setOtherOpen] = React.useState(false);\n const [chipOpen, setChipOpen] = React.useState(false);\n const otherOn = value === \"other\" || otherOpen;\n const word = (a: DecisionAnswer) => labels?.[a] ?? (a === \"yes\" ? \"Yes\" : a === \"no\" ? \"No\" : \"Other\");\n const yesMode = value === \"yes\" && Boolean(yesKinds?.length);\n const otherMode = value === \"other\";\n const chosen = yesMode ? find(yesKinds, yesKind) : otherMode ? find(wayOut, wayOutValue) : null;\n // The chip exists only with something to say: a kind of yes, a way-out answer, or a skip.\n const chipLabel = yesMode ? (chosen?.label ?? pickerPlaceholder) : otherMode ? (chosen?.label ?? (skipped ? skippedLabel : null)) : null;\n const primary = yesMode && yesKinds?.[0]?.value === yesKind;\n\n const wayOutMenu = (\n <>\n {wayOut?.length ? (\n <>\n <WayOutEntries items={wayOut} chosen={wayOutValue} onPick={(v) => onWayOut?.(v)} />\n <DropdownMenuSeparator />\n </>\n ) : null}\n <DropdownMenuItem data-way-out=\"skip\" className=\"text-foreground\" onSelect={onSkip}>\n <span className=\"flex-1\">{skipLabel}</span>\n {skipped ? <RadixCheckIcon className=\"size-3.5\" aria-hidden=\"true\" /> : null}\n </DropdownMenuItem>\n </>\n );\n\n const stage = size === \"stage\";\n const button = (a: \"yes\" | \"no\") => (\n <span data-decision-slot={a} data-suggested={suggested === a ? \"\" : undefined} className={cn(\"inline-flex max-sm:flex-1\", suggested === a && ring)}>\n <Button\n variant={value === a ? (a === \"no\" ? \"danger\" : \"primary\") : \"outline\"}\n aria-pressed={value === a}\n meta={shortcuts?.[a]}\n disabled={disabled}\n hero={stage}\n data-decision-option={a}\n className=\"max-sm:w-full\"\n onClick={() => onChange(a)}\n >\n {word(a)}\n </Button>\n </span>\n );\n return (\n <div\n role=\"group\"\n aria-label={ariaLabel ?? \"Answer\"}\n data-matrx-control=\"decision\"\n data-decision={value ?? (otherOpen ? \"other\" : \"open\")}\n data-decision-size={size}\n className={cn(\"flex shrink-0 flex-wrap items-center gap-1 max-sm:w-full sm:flex-nowrap\", stage && \"gap-2\", className)}\n >\n {button(\"yes\")}\n {button(\"no\")}\n {/* Other is the menu's own trigger, so the menu opens from it. Answered, pressing it again clears. */}\n <DropdownMenu\n open={otherOpen}\n onOpenChange={(next) => {\n if (next && value === \"other\") {\n onClear?.();\n return;\n }\n setOtherOpen(next);\n }}\n >\n <span data-decision-slot=\"other\" data-suggested={suggested === \"other\" ? \"\" : undefined} className={cn(\"inline-flex max-sm:flex-1\", suggested === \"other\" && ring)}>\n <DropdownMenuTrigger asChild disabled={disabled}>\n <Button\n variant={otherOn ? \"primary\" : \"outline\"}\n aria-pressed={otherOn}\n meta={shortcuts?.other}\n disabled={disabled}\n hero={stage}\n data-decision-option=\"other\"\n className=\"max-sm:w-full\"\n >\n {word(\"other\")}\n </Button>\n </DropdownMenuTrigger>\n </span>\n <DropdownMenuContent align=\"start\" className=\"min-w-48\">\n {wayOutMenu}\n </DropdownMenuContent>\n </DropdownMenu>\n {/* The value column: its width is reserved on desktop so rows stay aligned, but nothing is drawn\n until there is a value. On mobile it takes its own line under the buttons, only with a value. */}\n <div className={cn(\"flex min-w-0 items-center sm:w-40\", chipLabel === null && \"max-sm:hidden\", \"max-sm:w-full\")} data-decision-picker-slot=\"\">\n {chipLabel === null ? null : (\n <DropdownMenu open={chipOpen} onOpenChange={setChipOpen}>\n <DropdownMenuTrigger asChild disabled={disabled}>\n <Chip\n asChild\n label={chipLabel}\n tone={yesMode ? \"primary\" : \"neutral\"}\n data-decision-picker=\"\"\n data-picker-primary={primary ? \"\" : undefined}\n aria-label={`${yesMode ? word(\"yes\") : word(\"other\")}: ${chipLabel}`}\n >\n <button type=\"button\" disabled={disabled} />\n </Chip>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\" className=\"min-w-48\">\n {yesMode ? <WayOutEntries items={yesKinds ?? []} chosen={yesKind} onPick={(v) => onYesKind?.(v)} /> : wayOutMenu}\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n </div>\n </div>\n );\n}\n","\"use client\";\n\n/**\n * DateField / DateTimeField / TimeField — THE date control of the one-control\n * family (lane G16, 2026-10-07). The field capsule (28px, locked in\n * `controls.css`) with typed entry, a calendar (desktop popover, phone bottom\n * sheet), Clear, and full keyboard access. Bar: Linear's and Stripe's date\n * fields — type the day the way you say it, or pick it, never a browser mask.\n *\n * value / onValueChange ISO in and out: `yyyy-mm-dd`, `HH:mm`,\n * `yyyy-mm-ddTHH:mm`; `null` is empty.\n * emptyLabel the caller's empty word (\"Pick a date\",\n * \"Unchanged\") — the placeholder, never a mask.\n * locale display + typed order; the browser's by default.\n *\n * Keyboard: type and press Enter (or leave the field) to commit; Escape\n * reverts; Alt+ArrowDown / ArrowDown opens the calendar; in the calendar the\n * arrows move a day / week, Home / End the week, PageUp / PageDown a month\n * (Shift: a year), Enter picks, Escape closes. Text the field cannot read\n * stays visible and the capsule turns destructive (`aria-invalid`) — nothing\n * is silently dropped.\n */\n\nimport { parseDateOnly, toDateOnly } from \"@ai-matrx/kit/dates\";\nimport * as React from \"react\";\n\nimport { BottomSheet } from \"../bottom-sheet\";\nimport { cn } from \"../cn\";\nimport { CalendarIcon, ChevronLeftIcon, ChevronRightIcon, ClockIcon, XIcon } from \"../icons\";\nimport { Popover, PopoverAnchor, PopoverContent } from \"../popover\";\nimport { useIsMobile } from \"../use-is-mobile\";\nimport type { ControlWidth } from \"./controls\";\nimport {\n type DateFieldMode,\n TIME_SLOTS,\n formatDay,\n formatTime,\n monthGrid,\n parseTypedDate,\n parseTypedTime,\n splitValue,\n weekStart,\n} from \"./date-parse\";\n\nexport type { DateFieldMode } from \"./date-parse\";\n\nexport interface DateFieldProps {\n /** ISO: `yyyy-mm-dd` (date), `yyyy-mm-ddTHH:mm` (datetime), `HH:mm` (time); `null`/\"\" is empty. */\n value: string | null | undefined;\n onValueChange: (value: string | null) => void;\n /** `date` (default), `datetime` (a day and a time in one capsule), `time`. */\n mode?: DateFieldMode | undefined;\n /** The empty word, shown as the placeholder: \"Pick a date\", \"Unchanged\". */\n emptyLabel?: string | undefined;\n /** BCP-47 tag for display and typed order; the browser's when omitted. */\n locale?: string | undefined;\n /** Show the clear (x) button when there is a value. Default `true`. */\n clearable?: boolean | undefined;\n disabled?: boolean | undefined;\n /** The day input's id, for a `<label htmlFor>`. */\n id?: string | undefined;\n \"aria-label\"?: string | undefined;\n /** A named width instead of filling the row. */\n width?: ControlWidth | undefined;\n /** Placement only (width, flex, grid). */\n className?: string | undefined;\n style?: React.CSSProperties | undefined;\n}\n\nconst sameDay = (a: Date, b: Date) =>\n a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();\n\nexport const DateField = React.forwardRef<HTMLDivElement, DateFieldProps>(\n (\n {\n value,\n onValueChange,\n mode = \"date\",\n emptyLabel,\n locale,\n clearable = true,\n disabled,\n id,\n \"aria-label\": ariaLabel,\n width,\n className,\n style,\n },\n ref,\n ) => {\n const isMobile = useIsMobile();\n const { day, time } = splitValue(value, mode);\n const hasDay = mode !== \"time\";\n const hasTime = mode !== \"date\";\n const empty = hasDay ? !day : !time;\n const word = emptyLabel ?? (mode === \"time\" ? \"Pick a time\" : \"Pick a date\");\n\n const dayText = day ? formatDay(day, locale) : \"\";\n const timeText = time ? formatTime(time, locale) : \"\";\n const [dayDraft, setDayDraft] = React.useState<string | null>(null);\n const [timeDraft, setTimeDraft] = React.useState<string | null>(null);\n const [dayInvalid, setDayInvalid] = React.useState(false);\n const [timeInvalid, setTimeInvalid] = React.useState(false);\n const [open, setOpen] = React.useState(false);\n const dayRef = React.useRef<HTMLInputElement>(null);\n const timeRef = React.useRef<HTMLInputElement>(null);\n\n // Escape on a draft reverts it — and only that. A dialog's Escape listener sits in the\n // document's capture phase, ahead of the input; the window's capture phase runs first, so a\n // draft is reverted there and the dialog (with the rest of the person's form) stays open.\n const hasDraft = dayDraft !== null || timeDraft !== null;\n React.useEffect(() => {\n if (!hasDraft) return;\n const onKey = (e: KeyboardEvent) => {\n if (e.key !== \"Escape\") return;\n const active = document.activeElement;\n if (active === dayRef.current && dayDraft !== null) {\n setDayDraft(null);\n setDayInvalid(false);\n } else if (active === timeRef.current && timeDraft !== null) {\n setTimeDraft(null);\n setTimeInvalid(false);\n } else {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n };\n window.addEventListener(\"keydown\", onKey, true);\n return () => window.removeEventListener(\"keydown\", onKey, true);\n }, [hasDraft, dayDraft, timeDraft]);\n\n const emit = (nextDay: string, nextTime: string) => {\n if (mode === \"time\") return onValueChange(nextTime || null);\n if (mode === \"date\") return onValueChange(nextDay || null);\n if (!nextDay && !nextTime) return onValueChange(null);\n onValueChange(`${nextDay || toDateOnly(new Date())}T${nextTime || \"00:00\"}`);\n };\n\n const commitDay = (text: string) => {\n const t = text.trim();\n if (!t) {\n setDayDraft(null);\n setDayInvalid(false);\n if (day) emit(\"\", mode === \"datetime\" ? \"\" : time);\n return true;\n }\n const parsed = parseTypedDate(t, locale);\n if (!parsed) {\n setDayInvalid(true);\n return false;\n }\n setDayDraft(null);\n setDayInvalid(false);\n if (parsed !== day) emit(parsed, time);\n return true;\n };\n\n const commitTime = (text: string) => {\n const t = text.trim();\n if (!t) {\n setTimeDraft(null);\n setTimeInvalid(false);\n if (time) emit(mode === \"time\" ? \"\" : day, \"\");\n return true;\n }\n const parsed = parseTypedTime(t);\n if (!parsed) {\n setTimeInvalid(true);\n return false;\n }\n setTimeDraft(null);\n setTimeInvalid(false);\n if (parsed !== time) emit(day, parsed);\n return true;\n };\n\n const pickDay = (iso: string) => {\n setDayDraft(null);\n setDayInvalid(false);\n setOpen(false);\n emit(iso, time);\n // Return to typing: a datetime moves on to its time.\n requestAnimationFrame(() => (mode === \"datetime\" ? timeRef : dayRef).current?.focus());\n };\n const pickTime = (hhmm: string) => {\n setTimeDraft(null);\n setTimeInvalid(false);\n setOpen(false);\n emit(day, hhmm);\n requestAnimationFrame(() => timeRef.current?.focus());\n };\n const clear = () => {\n setDayDraft(null);\n setTimeDraft(null);\n setDayInvalid(false);\n setTimeInvalid(false);\n setOpen(false);\n onValueChange(null);\n (hasDay ? dayRef : timeRef).current?.focus();\n };\n\n const inputKeys =\n (kind: \"day\" | \"time\") =>\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === \"Enter\") {\n e.preventDefault();\n if (kind === \"day\") commitDay(e.currentTarget.value);\n else commitTime(e.currentTarget.value);\n } else if (e.key === \"ArrowDown\" && (e.altKey || !e.currentTarget.value)) {\n e.preventDefault();\n if (kind === \"day\" ? commitDay(e.currentTarget.value) : commitTime(e.currentTarget.value)) setOpen(true);\n }\n };\n\n const panelKind: \"day\" | \"time\" = hasDay ? \"day\" : \"time\";\n const panel =\n panelKind === \"day\" ? (\n <CalendarGrid\n value={day}\n locale={locale}\n onPick={pickDay}\n onClose={() => setOpen(false)}\n footer={\n <>\n <button type=\"button\" className=\"matrx-date-panel-action\" onClick={() => pickDay(toDateOnly(new Date()))}>\n Today\n </button>\n {!empty && clearable ? (\n <button type=\"button\" className=\"matrx-date-panel-action\" onClick={clear}>\n Clear\n </button>\n ) : null}\n </>\n }\n />\n ) : (\n <TimeList value={time} locale={locale} onPick={pickTime} onClose={() => setOpen(false)} />\n );\n\n const glyph = (\n <button\n type=\"button\"\n tabIndex={-1}\n disabled={disabled}\n aria-label={hasDay ? \"Open calendar\" : \"Open times\"}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n data-matrx-date-trigger=\"\"\n onClick={() => setOpen((o) => !o)}\n >\n {hasDay ? <CalendarIcon /> : <ClockIcon />}\n </button>\n );\n\n const capsule = (\n <div\n ref={ref}\n role=\"group\"\n aria-label={ariaLabel ?? word}\n data-matrx-control=\"date-field\"\n data-mode={mode}\n data-glyph=\"start\"\n data-width={width}\n data-empty={empty ? \"\" : undefined}\n aria-disabled={disabled || undefined}\n className={cn(\"matrx-control matrx-control-field matrx-control-date\", className)}\n style={style}\n onMouseDown={(e) => {\n // A press on the capsule's padding types into it, like a text field.\n if (e.target === e.currentTarget) {\n e.preventDefault();\n (hasDay ? dayRef : timeRef).current?.focus();\n }\n }}\n >\n {glyph}\n {hasDay ? (\n <input\n ref={dayRef}\n id={id}\n type=\"text\"\n inputMode=\"text\"\n autoComplete=\"off\"\n spellCheck={false}\n disabled={disabled}\n value={dayDraft ?? dayText}\n placeholder={word}\n aria-label={ariaLabel ?? (mode === \"datetime\" ? \"Date\" : word)}\n aria-invalid={dayInvalid || undefined}\n onChange={(e) => {\n setDayDraft(e.target.value);\n setDayInvalid(false);\n }}\n onFocus={(e) => e.currentTarget.select()}\n onBlur={(e) => {\n if (dayDraft !== null) commitDay(e.target.value);\n }}\n onKeyDown={inputKeys(\"day\")}\n />\n ) : null}\n {hasTime ? (\n <input\n ref={timeRef}\n id={hasDay ? (id ? `${id}-time` : undefined) : id}\n type=\"text\"\n inputMode=\"text\"\n autoComplete=\"off\"\n spellCheck={false}\n disabled={disabled}\n value={timeDraft ?? timeText}\n placeholder={hasDay ? (day ? \"Time\" : \"\") : word}\n aria-label={hasDay ? \"Time\" : (ariaLabel ?? word)}\n aria-invalid={timeInvalid || undefined}\n data-matrx-date-part={hasDay ? \"time\" : undefined}\n onChange={(e) => {\n setTimeDraft(e.target.value);\n setTimeInvalid(false);\n }}\n onFocus={(e) => e.currentTarget.select()}\n onBlur={(e) => {\n if (timeDraft !== null) commitTime(e.target.value);\n }}\n onKeyDown={inputKeys(\"time\")}\n />\n ) : null}\n {clearable && !empty && !disabled ? (\n <button type=\"button\" aria-label=\"Clear\" data-matrx-date-clear=\"\" onClick={clear}>\n <XIcon />\n </button>\n ) : null}\n </div>\n );\n\n if (isMobile) {\n return (\n <>\n {capsule}\n <BottomSheet open={open} onOpenChange={setOpen} title={hasDay ? \"Pick a date\" : \"Pick a time\"} surface=\"solid\">\n <div className=\"matrx-date-sheet\">{panel}</div>\n </BottomSheet>\n </>\n );\n }\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverAnchor asChild>{capsule}</PopoverAnchor>\n <PopoverContent\n /* sizing: content — the calendar decides its own width */\n sizing=\"content\"\n padding=\"none\"\n align=\"start\"\n className=\"matrx-date-popover\"\n onOpenAutoFocus={(e) => e.preventDefault()}\n // The glyph toggles: a press on it is not an outside press (or it would close, then reopen).\n onInteractOutside={(e) => {\n const target = e.target as Element | null;\n if (target?.closest?.(\"[data-matrx-date-trigger]\")) e.preventDefault();\n }}\n >\n {panel}\n </PopoverContent>\n </Popover>\n );\n },\n);\nDateField.displayName = \"DateField\";\n\n/** A day and a time in one capsule: `yyyy-mm-ddTHH:mm`. */\nexport const DateTimeField = React.forwardRef<HTMLDivElement, Omit<DateFieldProps, \"mode\">>((props, ref) => (\n <DateField ref={ref} {...props} mode=\"datetime\" />\n));\nDateTimeField.displayName = \"DateTimeField\";\n\n/** A time of day: `HH:mm`. */\nexport const TimeField = React.forwardRef<HTMLDivElement, Omit<DateFieldProps, \"mode\">>((props, ref) => (\n <DateField ref={ref} {...props} mode=\"time\" />\n));\nTimeField.displayName = \"TimeField\";\n\n/* ------------------------------------------------------------------ */\n/* The calendar — a WAI-ARIA date grid with a roving focus */\n/* ------------------------------------------------------------------ */\n\nfunction CalendarGrid({\n value,\n locale,\n onPick,\n onClose,\n footer,\n}: {\n value: string;\n locale?: string | undefined;\n onPick: (iso: string) => void;\n onClose: () => void;\n footer?: React.ReactNode | undefined;\n}) {\n const selected = parseDateOnly(value);\n const today = new Date();\n const [focus, setFocus] = React.useState<Date>(() => selected ?? today);\n const gridRef = React.useRef<HTMLDivElement>(null);\n const firstDay = weekStart(locale);\n const days = monthGrid(focus.getFullYear(), focus.getMonth(), firstDay);\n const weekdayFmt = new Intl.DateTimeFormat(locale, { weekday: \"short\" });\n const weekdayLong = new Intl.DateTimeFormat(locale, { weekday: \"long\" });\n const monthFmt = new Intl.DateTimeFormat(locale, { month: \"long\", year: \"numeric\" });\n const dayLabel = new Intl.DateTimeFormat(locale, { weekday: \"long\", month: \"long\", day: \"numeric\", year: \"numeric\" });\n\n React.useEffect(() => {\n gridRef.current?.querySelector<HTMLButtonElement>('[tabindex=\"0\"]')?.focus();\n }, [focus]);\n\n const move = (days: number, months = 0) =>\n setFocus((f) => {\n if (months) {\n const target = new Date(f.getFullYear(), f.getMonth() + months, 1);\n const last = new Date(target.getFullYear(), target.getMonth() + 1, 0).getDate();\n return new Date(target.getFullYear(), target.getMonth(), Math.min(f.getDate(), last));\n }\n return new Date(f.getFullYear(), f.getMonth(), f.getDate() + days);\n });\n\n const onKeyDown = (e: React.KeyboardEvent) => {\n const col = (focus.getDay() - firstDay + 7) % 7;\n const keys: Record<string, () => void> = {\n ArrowLeft: () => move(-1),\n ArrowRight: () => move(1),\n ArrowUp: () => move(-7),\n ArrowDown: () => move(7),\n Home: () => move(-col),\n End: () => move(6 - col),\n PageUp: () => move(0, e.shiftKey ? -12 : -1),\n PageDown: () => move(0, e.shiftKey ? 12 : 1),\n Enter: () => onPick(toDateOnly(focus)),\n \" \": () => onPick(toDateOnly(focus)),\n Escape: onClose,\n };\n const run = keys[e.key];\n if (run) {\n e.preventDefault();\n e.stopPropagation();\n run();\n }\n };\n\n const headers = days.slice(0, 7);\n return (\n <div className=\"matrx-date-panel\" data-matrx-date-panel=\"calendar\">\n <div className=\"matrx-date-panel-head\">\n <button type=\"button\" className=\"matrx-date-panel-nav\" aria-label=\"Previous month\" onClick={() => move(0, -1)}>\n <ChevronLeftIcon />\n </button>\n <span className=\"matrx-date-panel-title\" aria-live=\"polite\">\n {monthFmt.format(focus)}\n </span>\n <button type=\"button\" className=\"matrx-date-panel-nav\" aria-label=\"Next month\" onClick={() => move(0, 1)}>\n <ChevronRightIcon />\n </button>\n </div>\n <div ref={gridRef} role=\"grid\" aria-label={monthFmt.format(focus)} className=\"matrx-date-grid\" onKeyDown={onKeyDown}>\n <div role=\"row\" className=\"matrx-date-row\">\n {headers.map((d) => (\n <span key={d.getDay()} role=\"columnheader\" aria-label={weekdayLong.format(d)} className=\"matrx-date-weekday\">\n {weekdayFmt.format(d).slice(0, 2)}\n </span>\n ))}\n </div>\n {[0, 1, 2, 3, 4, 5].map((w) => (\n <div key={w} role=\"row\" className=\"matrx-date-row\">\n {days.slice(w * 7, w * 7 + 7).map((d) => {\n const isSelected = selected ? sameDay(d, selected) : false;\n const isFocus = sameDay(d, focus);\n return (\n <span key={d.toISOString()} role=\"gridcell\" aria-selected={isSelected}>\n <button\n type=\"button\"\n tabIndex={isFocus ? 0 : -1}\n className=\"matrx-date-day\"\n data-outside={d.getMonth() !== focus.getMonth() ? \"\" : undefined}\n data-today={sameDay(d, today) ? \"\" : undefined}\n data-selected={isSelected ? \"\" : undefined}\n aria-label={dayLabel.format(d)}\n aria-current={sameDay(d, today) ? \"date\" : undefined}\n onClick={() => onPick(toDateOnly(d))}\n onFocus={() => {\n if (!isFocus) setFocus(d);\n }}\n >\n {d.getDate()}\n </button>\n </span>\n );\n })}\n </div>\n ))}\n </div>\n {footer ? <div className=\"matrx-date-panel-foot\">{footer}</div> : null}\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* The time list — half-hour slots, arrow keys, the value in view */\n/* ------------------------------------------------------------------ */\n\nfunction TimeList({\n value,\n locale,\n onPick,\n onClose,\n}: {\n value: string;\n locale?: string | undefined;\n onPick: (hhmm: string) => void;\n onClose: () => void;\n}) {\n const listRef = React.useRef<HTMLDivElement>(null);\n const start = value ? TIME_SLOTS.findIndex((s) => s >= value) : TIME_SLOTS.indexOf(\"09:00\");\n const [active, setActive] = React.useState(start < 0 ? TIME_SLOTS.length - 1 : start);\n\n React.useEffect(() => {\n const el = listRef.current?.querySelector<HTMLButtonElement>(`[data-index=\"${active}\"]`);\n el?.focus();\n el?.scrollIntoView?.({ block: \"nearest\" });\n }, [active]);\n\n const onKeyDown = (e: React.KeyboardEvent) => {\n const keys: Record<string, () => void> = {\n ArrowDown: () => setActive((a) => Math.min(TIME_SLOTS.length - 1, a + 1)),\n ArrowUp: () => setActive((a) => Math.max(0, a - 1)),\n Home: () => setActive(0),\n End: () => setActive(TIME_SLOTS.length - 1),\n Escape: onClose,\n };\n const run = keys[e.key];\n if (run) {\n e.preventDefault();\n e.stopPropagation();\n run();\n }\n };\n\n return (\n <div ref={listRef} role=\"listbox\" aria-label=\"Times\" className=\"matrx-date-panel matrx-time-list\" onKeyDown={onKeyDown}>\n {TIME_SLOTS.map((slot, i) => (\n <button\n key={slot}\n type=\"button\"\n role=\"option\"\n aria-selected={slot === value}\n tabIndex={i === active ? 0 : -1}\n data-index={i}\n data-selected={slot === value ? \"\" : undefined}\n className=\"matrx-time-slot\"\n onClick={() => onPick(slot)}\n >\n {formatTime(slot, locale)}\n </button>\n ))}\n </div>\n );\n}\n","\"use client\";\n\n/**\n * BottomSheet — the canonical mobile sheet. Ported verbatim from\n * matrx-frontend `components/official/bottom-sheet/BottomSheet.tsx` (S19).\n *\n * `vaul` is a sanctioned real dependency here, the same way\n * @radix-ui/react-alert-dialog is for @ai-matrx/kit `/confirm`: the drag-to-\n * dismiss drawer physics IS the component — there is no BottomSheet without\n * it, and reimplementing gesture/velocity handling would be a vendored twin\n * of a maintained library rather than of our own code. Rationale recorded in\n * FEATURE.md.\n *\n * Seam inversions:\n * - The vaul wrappers (root + unstyled content primitive) were inlined here\n * privately in 0.5.0 because no shared Drawer existed. Since 0.6.0 the\n * package OWNS `./drawer`, so this file composes `Drawer` and\n * `DrawerContentPrimitive` from it: one vaul wrapper in the package, not\n * two. BottomSheet keeps its own geometry (that IS its product).\n * - `ChevronLeft` is the package's inlined SVG (C19).\n *\n * Host-owned CSS contracts (documented, not shipped): the glass tokens\n * `--matrx-glass-bg` / `--matrx-glass-border-color`, the utility classes\n * `matrx-glass-thin-border` and `pb-safe`, and semantic color tokens.\n */\n\nimport { VisuallyHidden } from \"@radix-ui/react-visually-hidden\";\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\n\nimport { cn } from \"./cn\";\nimport { usePortalContainer } from \"./portal-container\";\nimport { Drawer as DrawerRoot, DrawerContentPrimitive } from \"./drawer\";\nimport { ChevronLeftIcon } from \"./icons\";\n\n\nexport interface BottomSheetProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n title?: string;\n /**\n * `adaptive` (default) — the sheet sizes to its content, up to\n * 90dvh (no minimum). Correct for a single short list.\n *\n * `full` — ONE fixed height (92dvh) that never changes as content changes.\n * Use it for any sheet whose body varies (multi-level navigation, tabs,\n * search results): an adaptive sheet there resizes under the user's thumb\n * on every keystroke and every drill-in, which reads as the panel jumping.\n */\n size?: \"adaptive\" | \"full\";\n /** Visual treatment for the panel. Solid is intended for dense, long-lived surfaces. */\n surface?: \"glass\" | \"solid\";\n /** Merged onto the sheet panel. */\n contentClassName?: string;\n children: React.ReactNode;\n}\n\nexport function BottomSheet({\n open,\n onOpenChange,\n title = \"Bottom Sheet\",\n size = \"adaptive\",\n surface = \"glass\",\n contentClassName,\n children,\n}: BottomSheetProps) {\n // The injected portal seam (portal-container.tsx), as every other layer: a sheet opened inside a\n // look=\"mac\" table mounts in its Mac layer, one opened in a popped-out window in that window.\n const container = usePortalContainer();\n return (\n <DrawerRoot open={open} onOpenChange={onOpenChange}>\n <DrawerPrimitive.Portal container={container}>\n {/* Identical output to the host's DrawerOverlay wrapper: its base\n classes merged with the caller classes, inline background wins. */}\n {/* The dialog layer (z-[10000], see dialog.tsx), never below it: a\n sheet opened from inside a dialog or modal (the phone's ⋯ menu in\n a compact chat modal) otherwise opens BEHIND that dialog's scrim.\n Equal z, so the later-opened layer paints on top. */}\n <DrawerPrimitive.Overlay\n className={cn(\"fixed inset-0 z-[10000] bg-[var(--matrx-overlay-scrim)]\", \"fixed inset-0 z-[10000]\")}\n style={{ background: \"var(--matrx-overlay-scrim-drawer)\" }}\n />\n <DrawerContentPrimitive\n className={cn(\n \"fixed inset-x-0 bottom-0 z-[10000] mt-24 flex flex-col rounded-t-2xl overflow-hidden\",\n // Adaptive sizes to its content, up to 90dvh — never a 60dvh floor that\n // left a two-action sheet mostly empty (hosts overrode it with min-h-0).\n size === \"full\" ? \"h-[92dvh]\" : \"max-h-[90dvh]\",\n surface === \"solid\" &&\n \"border border-b-0 border-border bg-background shadow-2xl\",\n contentClassName,\n )}\n style={\n surface === \"glass\"\n ? {\n background: \"var(--matrx-glass-bg)\",\n backdropFilter: \"blur(20px) saturate(180%)\",\n WebkitBackdropFilter: \"blur(20px) saturate(180%)\",\n border: \"1px solid var(--matrx-glass-border-color)\",\n borderBottom: \"none\",\n }\n : undefined\n }\n >\n <VisuallyHidden>\n <DrawerPrimitive.Title>{title}</DrawerPrimitive.Title>\n <DrawerPrimitive.Description>\n Bottom sheet panel.\n </DrawerPrimitive.Description>\n </VisuallyHidden>\n <div className=\"mx-auto mt-3 mb-1 h-1.5 w-10 rounded-full bg-muted-foreground/30 flex-shrink-0\" />\n {children}\n </DrawerContentPrimitive>\n </DrawerPrimitive.Portal>\n </DrawerRoot>\n );\n}\n\nexport interface BottomSheetHeaderProps {\n title: string;\n showBack?: boolean;\n onBack?: () => void;\n trailing?: React.ReactNode;\n}\n\nexport function BottomSheetHeader({\n title,\n showBack = false,\n onBack,\n trailing,\n}: BottomSheetHeaderProps) {\n return (\n <div className=\"flex items-center px-2 pt-1 pb-2 flex-shrink-0 min-h-[44px]\">\n <div className=\"min-w-[44px] flex items-center justify-start\">\n <button\n type=\"button\"\n aria-label=\"Back\"\n onClick={onBack}\n className={cn(\n \"h-8 w-8 rounded-full matrx-glass-thin-border flex items-center justify-center transition-all active:scale-95\",\n showBack ? \"opacity-100\" : \"opacity-0 pointer-events-none\",\n )}\n aria-hidden={!showBack}\n tabIndex={showBack ? 0 : -1}\n >\n <ChevronLeftIcon className=\"h-4 w-4 text-foreground\" />\n </button>\n </div>\n <span className=\"text-[17px] font-semibold flex-1 text-center truncate\">\n {title}\n </span>\n <div className=\"min-w-[44px] flex items-center justify-end\">\n {trailing}\n </div>\n </div>\n );\n}\n\nexport interface BottomSheetBodyProps {\n children: React.ReactNode;\n className?: string;\n}\n\nexport function BottomSheetBody({ children, className }: BottomSheetBodyProps) {\n return (\n <div\n className={cn(\n // min-h-0 is load-bearing: without it a flex child's min-height:auto\n // floors it at content height and the body grows instead of scrolling.\n \"min-h-0 flex-1 overflow-y-auto overscroll-contain pb-safe\",\n className,\n )}\n >\n {children}\n </div>\n );\n}\n\nexport interface BottomSheetFooterProps {\n children: React.ReactNode;\n className?: string;\n}\n\nexport function BottomSheetFooter({\n children,\n className,\n}: BottomSheetFooterProps) {\n return (\n <div\n data-slot=\"bottom-sheet-footer\"\n className={cn(\n \"flex-shrink-0 px-4 py-3 pb-safe border-t border-[var(--matrx-sheet-divider)]\",\n className,\n )}\n >\n {children}\n </div>\n );\n}\n","\"use client\";\n\n/**\n * Drawer — the vaul drawer family, and the package's iOS-mobile-first surface.\n *\n * WHY IT IS HERE. matrx-frontend's `components/ui/drawer.tsx` had 121 import\n * sites, and that host's own doctrine is \"Drawer, not Dialog, on mobile\" — so\n * the drawer is the surface most of this platform's mobile UX lands on. It was\n * also the LAST place still holding a copy of `RadixDialogModalProvider`, the\n * context this package already owned: a host copy of a React CONTEXT is the\n * quiet twin, because `useContext` matches by object identity, so the host\n * Drawer's provider and the package Sheet's consumer were two different\n * contexts that merely looked alike. Shipping the Drawer here closes that.\n *\n * `BottomSheet` (this package) previously inlined its own private vaul\n * wrappers because no Drawer existed to share; it now composes these, so there\n * is one vaul wrapper in the package rather than two.\n *\n * THE MOBILE-FIRST RULES THIS COMPONENT OWNS (so no host re-derives them):\n *\n * 1. `dvh`, NEVER `vh`. iOS Safari's `vh` is the tallest-possible viewport, so\n * a `vh`-capped drawer hides its own footer behind the browser chrome. The\n * cap is `max-h-[90dvh]`, and `size=\"full\"` is `h-dvh`.\n * 2. THE SAFE AREA IS PADDING, NOT A GUESS. Content bottom padding is\n * `pb-safe` (`env(safe-area-inset-bottom)`; shipped in `styles.css`), so the\n * home indicator never sits on top of the last control.\n * 3. THE GRAB HANDLE IS A 44px TARGET. The visible pill is 4px tall; it lives\n * inside a `min-h-11` (44px) grab area, the Apple HIG minimum. The old host\n * copy shipped the pill alone, so the affordance was three times smaller\n * than the gesture it advertises.\n * 4. THE BODY SCROLLS, THE FOOTER DOES NOT. `DrawerBody` is the\n * `flex-1 min-h-0 overflow-y-auto overscroll-contain` shard;\n * `DrawerFooter` is `mt-auto` and safe-area padded, so the primary action\n * is reachable however long the body is.\n * 5. A FIELD UNDER 16px ZOOMS iOS IN AND NEVER BACK OUT — the drawer's own\n * text scale therefore never goes below `text-base` on coarse pointers;\n * the floor itself is a host CSS concern, restated in `styles.css`.\n *\n * `direction` is forwarded to vaul and drives the content geometry, so a side\n * or top drawer is a prop rather than a fork.\n */\n\nimport { treeContainsComponent } from \"@ai-matrx/kit/react-tree\";\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\n\nimport { cn } from \"./cn\";\nimport { keepFloatingLayersInside, useModalLayer } from \"./floating-layer\";\nimport { RadixDialogModalProvider } from \"./radix-dialog-modal-context\";\n\nexport type DrawerDirection = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nconst DrawerDirectionContext = React.createContext<DrawerDirection>(\"bottom\");\n\n/** The direction of the nearest Drawer root. */\nexport const useDrawerDirection = (): DrawerDirection =>\n React.useContext(DrawerDirectionContext);\n\n/**\n * `vaul`'s Root props are a DISCRIMINATED UNION (the snap-point branch adds\n * `fadeFromIndex`), so this type intersects the union rather than `Omit`-ing\n * from it — flattening the union collapses the discriminant and makes every\n * snap-point drawer a type error.\n *\n * Vaul does not forward `modal={false}` to its underlying Radix root, so a\n * \"non-modal\" drawer would claim ARIA semantics it does not have; the type\n * refuses the value rather than shipping the lie.\n */\nexport type DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root> & {\n modal?: true;\n direction?: DrawerDirection;\n};\n\nconst Drawer = ({\n children,\n shouldScaleBackground = true,\n onOpenChange,\n ...props\n}: DrawerProps) => {\n const direction: DrawerDirection = props.direction ?? \"bottom\";\n const handleOpenChange = (open: boolean) => {\n if (\n open &&\n typeof document !== \"undefined\" &&\n document.activeElement instanceof HTMLElement\n ) {\n // Vaul applies aria-hidden to the application tree synchronously, before\n // Radix transfers focus into the portalled dialog. Release the trigger\n // first so a focused descendant is never hidden from assistive tech.\n document.activeElement.blur();\n }\n onOpenChange?.(open);\n };\n return (\n <RadixDialogModalProvider modal>\n <DrawerDirectionContext.Provider value={direction}>\n <DrawerPrimitive.Root\n modal\n shouldScaleBackground={shouldScaleBackground}\n {...props}\n onOpenChange={handleOpenChange}\n direction={direction}\n >\n {children}\n </DrawerPrimitive.Root>\n </DrawerDirectionContext.Provider>\n </RadixDialogModalProvider>\n );\n};\nDrawer.displayName = \"Drawer\";\n\nconst DrawerTrigger = DrawerPrimitive.Trigger;\nconst DrawerPortal = DrawerPrimitive.Portal;\nconst DrawerClose = DrawerPrimitive.Close;\n\nconst DrawerOverlay = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Overlay\n ref={ref}\n data-slot=\"drawer-overlay\"\n className={cn(\n \"fixed inset-0 z-[10000] bg-[var(--matrx-overlay-scrim)]\",\n className,\n )}\n {...props}\n />\n));\nDrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;\n\nconst DrawerDescription = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Description\n ref={ref}\n data-slot=\"drawer-description\"\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n/**\n * Unstyled, non-portalling Content for custom Drawer layouts. It derives\n * explicit modal semantics while vaul retains focus/background behavior.\n */\nconst DrawerContentPrimitive = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>\n>(({ onInteractOutside, ...props }, ref) => {\n // A drawer is always modal: floating layers opened from it stack above its\n // scrim, and a press inside one is not an outside press (floating-layer.tsx).\n useModalLayer(true);\n return (\n <DrawerPrimitive.Content\n // NO SLIDE-IN (styles.css, `[data-matrx-entrance=\"none\"]`). Measured on\n // a 375x812 phone (PB-08, 2026-10-01): for ~250 ms after open the spot\n // where a row settles was still the SCRIM, so a tap there was an outside\n // press and closed the sheet; for the next ~150 ms it was a DIFFERENT\n // row. The sheet is therefore at rest from its first frame; the scrim\n // still fades and the exit still slides. Same class as the composer\n // menu's popper entrance (matrx-frontend 286ef577fb).\n data-matrx-entrance=\"none\"\n {...props}\n ref={ref}\n aria-modal=\"true\"\n onInteractOutside={keepFloatingLayersInside(onInteractOutside)}\n />\n );\n});\nDrawerContentPrimitive.displayName = \"DrawerContentPrimitive\";\n\n/**\n * `adaptive` (default) sizes to content up to 90dvh — right for one short\n * list. `full` is ONE fixed height that never changes as content changes: use\n * it for any drawer whose body varies (tabs, search results, multi-level\n * navigation), because an adaptive drawer there resizes under the user's thumb\n * on every keystroke, which reads as the panel jumping.\n */\nexport type DrawerSize = \"adaptive\" | \"full\";\n\nconst DIRECTION_CLASSES: Record<DrawerDirection, string> = {\n bottom:\n \"inset-x-0 bottom-0 mt-24 flex-col rounded-t-[10px] border-t pb-safe\",\n top: \"inset-x-0 top-0 mb-24 flex-col rounded-b-[10px] border-b pt-safe\",\n left: \"inset-y-0 left-0 mr-24 flex-row rounded-r-[10px] border-r\",\n right: \"inset-y-0 right-0 ml-24 flex-row rounded-l-[10px] border-l\",\n};\n\nconst SIZE_CLASSES: Record<DrawerDirection, Record<DrawerSize, string>> = {\n bottom: { adaptive: \"h-auto max-h-[90dvh]\", full: \"h-[92dvh]\" },\n top: { adaptive: \"h-auto max-h-[90dvh]\", full: \"h-[92dvh]\" },\n left: { adaptive: \"w-auto max-w-[92vw]\", full: \"h-dvh w-[92vw] max-w-sm\" },\n right: { adaptive: \"w-auto max-w-[92vw]\", full: \"h-dvh w-[92vw] max-w-sm\" },\n};\n\nexport interface DrawerContentProps\n extends React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content> {\n /** Height/width posture. Default `adaptive`. */\n size?: DrawerSize;\n /** Render the drag-handle pill. Default: only for `top`/`bottom` drawers. */\n showHandle?: boolean;\n}\n\nconst DrawerContent = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Content>,\n DrawerContentProps\n>(({ className, children, size = \"adaptive\", showHandle, ...props }, ref) => {\n const direction = useDrawerDirection();\n const hasDescription =\n treeContainsComponent(children, DrawerDescription) ||\n treeContainsComponent(children, DrawerPrimitive.Description);\n const withHandle =\n showHandle ?? (direction === \"bottom\" || direction === \"top\");\n\n return (\n <DrawerPortal>\n <DrawerOverlay />\n <DrawerContentPrimitive\n ref={ref}\n data-slot=\"drawer-content\"\n data-direction={direction}\n className={cn(\n \"fixed z-[10000] flex min-w-0 border bg-background\",\n DIRECTION_CLASSES[direction],\n SIZE_CLASSES[direction][size],\n className,\n )}\n {...(hasDescription ? {} : { \"aria-describedby\": undefined })}\n {...props}\n >\n {withHandle ? (\n // Rule 3: the pill is 4px; the TARGET is 44px.\n <div\n aria-hidden\n data-slot=\"drawer-handle\"\n className={cn(\n \"flex min-h-11 w-full shrink-0 cursor-grab items-center justify-center active:cursor-grabbing\",\n direction === \"top\" && \"order-last\",\n )}\n >\n <div className=\"h-1 w-[100px] rounded-full bg-muted\" />\n </div>\n ) : null}\n {children}\n </DrawerContentPrimitive>\n </DrawerPortal>\n );\n});\nDrawerContent.displayName = \"DrawerContent\";\n\nconst DrawerHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n \"grid shrink-0 gap-1.5 p-4 text-center sm:text-left\",\n className,\n )}\n {...props}\n />\n);\nDrawerHeader.displayName = \"DrawerHeader\";\n\n/**\n * The scroll shard. `flex-1 min-h-0` is the pair that actually bounds a scroll\n * area inside a flex column — `flex-1` alone leaves `min-height: auto`, and the\n * body grows past the drawer instead of scrolling inside it.\n */\nconst DrawerBody = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n data-slot=\"drawer-body\"\n className={cn(\"min-h-0 flex-1 overflow-y-auto overscroll-contain px-4\", className)}\n {...props}\n />\n);\nDrawerBody.displayName = \"DrawerBody\";\n\nconst DrawerFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n data-slot=\"drawer-footer\"\n className={cn(\"mt-auto flex shrink-0 flex-col gap-2 p-4 pb-safe\", className)}\n {...props}\n />\n);\nDrawerFooter.displayName = \"DrawerFooter\";\n\nconst DrawerTitle = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n data-slot=\"drawer-title\"\n className={cn(\n \"text-lg font-semibold leading-none tracking-tight\",\n className,\n )}\n {...props}\n />\n));\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\nexport {\n Drawer,\n DrawerBody,\n DrawerClose,\n DrawerContent,\n DrawerContentPrimitive,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerOverlay,\n DrawerPortal,\n DrawerTitle,\n DrawerTrigger,\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/** THE tooltip layer (defined beside the tooltips, `title-tooltips.ts`). */\nexport { TOOLTIP_LAYER_Z } from \"./title-tooltips\";\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\n// ── THE Escape stack ────────────────────────────────────────────────────────\n// One Escape owner for every floating window (summon's WindowPanel and\n// LiteWindow, the PeekWindow here): the TOPMOST open layer gets the key, and\n// only it — two windows never close on one press, and a window under another\n// never closes first. A layer joins on open (top), `raise()`s when it comes to\n// the front (a focused window), and leaves on close. Its handler decides\n// whether it closes (a menu or dialog it does not own may hold the key) and\n// calls `preventDefault()` when it does; a layer that declines still keeps the\n// key from the layers under it. One window listener, shared across bundled\n// copies of this module through a global slot (like the modal registry).\ninterface EscapeLayerEntry {\n readonly key: symbol;\n handle: (event: KeyboardEvent) => void;\n}\ninterface EscapeStack {\n layers: EscapeLayerEntry[];\n listening: boolean;\n}\nconst ESCAPE_SLOT = Symbol.for(\"ai-matrx.design-system.escape-stack\");\nconst escapeHost = globalThis as typeof globalThis & { [ESCAPE_SLOT]?: EscapeStack };\nconst escapeStack = (): EscapeStack => (escapeHost[ESCAPE_SLOT] ??= { layers: [], listening: false });\n\nfunction onEscapeKeydown(event: KeyboardEvent): void {\n if (event.key !== \"Escape\" || event.defaultPrevented) return;\n const { layers } = escapeStack();\n layers[layers.length - 1]?.handle(event);\n}\n\nexport interface EscapeLayerHandle {\n /** Move this layer to the top (it came to the front). */\n raise(): void;\n /** Leave the stack (closed). */\n release(): void;\n}\n\n/** Join the Escape stack at the top. The handler runs only while this layer is topmost. */\nexport function pushEscapeLayer(handle: (event: KeyboardEvent) => void): EscapeLayerHandle {\n const stack = escapeStack();\n if (!stack.listening && typeof window !== \"undefined\") {\n window.addEventListener(\"keydown\", onEscapeKeydown);\n stack.listening = true;\n }\n const entry: EscapeLayerEntry = { key: Symbol(\"escape-layer\"), handle };\n stack.layers.push(entry);\n const drop = () => {\n const at = stack.layers.indexOf(entry);\n if (at !== -1) stack.layers.splice(at, 1);\n };\n return {\n raise() {\n drop();\n stack.layers.push(entry);\n },\n release: drop,\n };\n}\n\n/** How many layers hold the Escape stack (tests and diagnostics). */\nexport function escapeLayerDepth(): number {\n return escapeStack().layers.length;\n}\n\n/**\n * Hold a place in the Escape stack while `active`. The latest `onEscape` runs\n * (never a stale closure). `raiseKey`: when it changes the layer moves to the\n * top (pass a window manager's z-index). Returns a stable `raise()` for a\n * layer that tracks \"front\" itself (a pointerdown on the window).\n */\nexport function useEscapeLayer(active: boolean, onEscape: (event: KeyboardEvent) => void, raiseKey?: unknown): () => void {\n const latest = React.useRef(onEscape);\n latest.current = onEscape;\n const handleRef = React.useRef<EscapeLayerHandle | null>(null);\n React.useEffect(() => {\n if (!active) return undefined;\n const handle = pushEscapeLayer((event) => latest.current(event));\n handleRef.current = handle;\n return () => {\n handle.release();\n handleRef.current = null;\n };\n }, [active]);\n const first = React.useRef(true);\n React.useEffect(() => {\n if (first.current) {\n first.current = false;\n return;\n }\n handleRef.current?.raise();\n }, [raiseKey]);\n return React.useCallback(() => handleRef.current?.raise(), []);\n}\n","/**\n * THE TITLE TAKEOVER — every native `title` attribute in the document shows\n * as THE fleet tooltip instead of the browser's.\n *\n * Why this exists. A `title=` is the one tooltip nobody has to import, so it\n * is what every hand-written control reaches for: ~50 of them on an ordinary\n * matrx-frontend page (2026-09-28), next to the Radix tooltips on the tap\n * buttons. The browser draws those as a slow, unstyled system box, and a page\n * that mixes the two reads as having \"lost all of its tooltips\" (Arman,\n * 2026-09-28). Asking every author — human or agent — to wrap every control in\n * `<Tooltip>` is a rule that is broken the day it is written. So the\n * `TooltipProvider` every host already mounts at its root installs this layer,\n * and a `title` is simply a tooltip from then on. Nothing to remember.\n *\n * How it works. On hover (mouse or pen) or keyboard focus (`:focus-visible`)\n * of an element that carries a `title`, the attribute is lifted onto\n * `data-matrx-title` for exactly as long as the pointer or focus stays — so\n * the browser has nothing to show — and one shared, script-placed element\n * wearing `.matrx-tooltip` shows the text instead. When the pointer or focus\n * leaves, the `title` is put back, so assistive technology and every\n * `[title]` selector read the element exactly as authored the rest of the\n * time. Touch never shows it (a `title` has no touch affordance either).\n *\n * What it does not draw: a tooltip that only repeats text already readable in\n * full inside the element (it still draws when that text is hidden or\n * truncated).\n *\n * What it leaves alone:\n * - an element that is already a Radix tooltip trigger\n * (`[data-matrx-tooltip-trigger]`, stamped by `TooltipTrigger`): its\n * `title` is still lifted — two tooltips on one control was the other\n * half of the mess — but only the Radix one shows;\n * - anything inside `[data-native-title]` (the explicit opt-out);\n * - SVG `<title>` children, which are elements, not attributes.\n *\n * Placement. `tooltipSide` (THE SMART SIDE, below): beside a control in a\n * vertical stack, else the host's side; flipped when there is no room,\n * clamped into the viewport. `data-title-side=\"right\" | \"left\" | \"bottom\" |\n * \"top\"` on the element or any ancestor states a preferred side — a vertical\n * rail sets `right` once on its container.\n *\n * Installed at most once per document, reference-counted across every\n * mounted provider, and removed when the last one unmounts.\n */\n\n/**\n * THE SMART SIDE (Arman, 2026-10-15: tooltips \"don't show up intelligently\"). A tooltip never\n * covers the control next to its own. Where the control's neighbours stand decides the side:\n * - an explicit side (a prop, or `data-title-side` on the control or an ancestor below <html>) wins;\n * - an icon-sized control in a vertical stack (an icon column, a tool palette) has its neighbours\n * above and below, so it opens beside the control: right, or left when the control is in the\n * window's right half (an inspector column). A wide row in a list keeps the host's side: its\n * tooltip is the row's own text in full, and beside it would sit over the page next to the list;\n * - anywhere else (a toolbar, a row of buttons, a lone control) it opens on the host's default\n * side (`data-title-side` on <html>: macOS desktop hosts say \"bottom\"; the web's is \"top\").\n * Either way it flips to the other side when there is no room, and stays inside the window.\n */\nexport function tooltipSide(el: Element | null, fallback?: Side): Side {\n if (!el) return fallback ?? \"top\";\n const doc = el.ownerDocument;\n const hinted = el.closest(\"[data-title-side]\");\n const hint = hinted?.getAttribute(\"data-title-side\");\n const isSide = (v: string | null | undefined): v is Side => v === \"top\" || v === \"bottom\" || v === \"left\" || v === \"right\";\n if (hinted && hinted !== doc.documentElement && isSide(hint)) return hint;\n const base: Side = fallback ?? (isSide(hint) ? hint : \"top\");\n const box = el.getBoundingClientRect();\n if (box.width <= ICON_CONTROL_MAX_PX && stackDirection(el) === \"vertical\") {\n const vw = doc.defaultView?.innerWidth ?? 0;\n return vw > 0 && box.left + box.width / 2 > vw / 2 ? \"left\" : \"right\";\n }\n return base;\n}\n\n/** The widest control that counts as an icon (a navigator item, a palette tool). */\nconst ICON_CONTROL_MAX_PX = 64;\n\n/** How the control's nearest group of siblings is laid out, from where they actually are on screen. */\nfunction stackDirection(el: Element): \"vertical\" | \"horizontal\" | null {\n let node: Element | null = el;\n for (let depth = 0; node && depth < 4; depth++, node = node.parentElement) {\n const parent: Element | null = node.parentElement;\n if (!parent) return null;\n const me = node.getBoundingClientRect();\n if (me.width === 0 && me.height === 0) return null;\n let vertical = 0;\n let horizontal = 0;\n for (const sib of Array.from(parent.children)) {\n if (sib === node) continue;\n const r = sib.getBoundingClientRect();\n if (r.width === 0 || r.height === 0) continue;\n const overlapX = Math.min(me.right, r.right) - Math.max(me.left, r.left);\n const overlapY = Math.min(me.bottom, r.bottom) - Math.max(me.top, r.top);\n if (overlapX > 0.5 * Math.min(me.width, r.width) && overlapY <= 0) vertical++;\n else if (overlapY > 0.5 * Math.min(me.height, r.height) && overlapX <= 0) horizontal++;\n }\n if (vertical > 0 && horizontal === 0) return \"vertical\";\n if (horizontal > 0) return \"horizontal\";\n }\n return null;\n}\n\nexport const TITLE_TOOLTIP_ATTR = \"data-matrx-title\";\nexport const TOOLTIP_TRIGGER_ATTR = \"data-matrx-tooltip-trigger\";\nexport const NATIVE_TITLE_OPT_OUT_ATTR = \"data-native-title\";\n\nexport type Side = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nconst OPEN_DELAY_MS = 350;\n/** Moving from one titled control to the next inside this window is instant. */\nconst SKIP_DELAY_MS = 500;\n/**\n * THE HOVER BRIDGE. Leaving the control does not close the tooltip at once: the pointer has this\n * long to reach the tooltip itself (Arman, 2026-10-14: a tooltip must stay long enough to put the\n * mouse on it and copy its text). Entering the tooltip holds it open.\n */\n/**\n * THE TOOLTIP LAYER — above every other layer, always (Arman, 2026-10-14: a tooltip \"coming up\n * behind the content\"). Menus and popovers share the modal tier (equal z, DOM order decides), so a\n * tooltip on that tier lost to any menu opened after it. A tooltip is transient and never takes a\n * press, so nothing ever needs to sit above it.\n */\nexport const TOOLTIP_LAYER_Z = 2_147_483_000;\n\nexport const TOOLTIP_CLOSE_DELAY_MS = 300;\nconst GAP_PX = 6;\nconst EDGE_PX = 8;\n/** How far every tooltip stays from the window's edge (both implementations). */\nexport const TOOLTIP_EDGE_PX = EDGE_PX;\n/**\n * A tooltip is a short hint, never a paragraph (Apple HIG: a tooltip is a few words): text past\n * this budget is cut at a word boundary with an ellipsis. Long detail belongs in a sheet or a\n * Copy details action, not on hover.\n */\nexport const TOOLTIP_TEXT_BUDGET = 140;\n\nexport function clipTooltipText(text: string, budget: number = TOOLTIP_TEXT_BUDGET): string {\n const flat = text.replace(/\\s+/g, \" \").trim();\n if (flat.length <= budget) return flat;\n const cut = flat.slice(0, budget - 1);\n const space = cut.lastIndexOf(\" \");\n return `${(space > budget * 0.6 ? cut.slice(0, space) : cut).replace(/[\\s,.;:–—-]+$/, \"\")}…`;\n}\n\nconst SURFACE_CLASS =\n \"matrx-tooltip matrx-title-tooltip matrx-motion-popper max-w-xs select-text rounded-md border border-border bg-popover px-2.5 py-1 text-xs font-medium text-popover-foreground\";\n\ninterface Installation {\n count: number;\n uninstall: () => void;\n}\n\n/**\n * Keyed on the document itself through a registered symbol, never a module\n * WeakMap: tsup bundles this module into more than one entry (`index`,\n * `tap-target`), and two module copies each holding their own map would\n * install twice — two listeners, two surfaces.\n */\nconst INSTALLATION_KEY = Symbol.for(\"@ai-matrx/design-system/title-tooltips\");\ntype DocumentWithInstallation = Document & { [INSTALLATION_KEY]?: Installation };\nconst installations = {\n get: (doc: Document) => (doc as DocumentWithInstallation)[INSTALLATION_KEY],\n set: (doc: Document, value: Installation) => {\n (doc as DocumentWithInstallation)[INSTALLATION_KEY] = value;\n },\n delete: (doc: Document) => {\n delete (doc as DocumentWithInstallation)[INSTALLATION_KEY];\n },\n};\n\n/** Install the takeover on `doc`. Returns the release function. */\nexport function acquireTitleTooltips(doc: Document | undefined = typeof document === \"undefined\" ? undefined : document): () => void {\n if (!doc) return () => {};\n const existing = installations.get(doc);\n if (existing) {\n existing.count += 1;\n } else {\n installations.set(doc, { count: 1, uninstall: install(doc) });\n }\n let released = false;\n return () => {\n if (released) return;\n released = true;\n const current = installations.get(doc);\n if (!current) return;\n current.count -= 1;\n if (current.count <= 0) {\n current.uninstall();\n installations.delete(doc);\n }\n };\n}\n\nfunction install(doc: Document): () => void {\n const win = doc.defaultView;\n let active: HTMLElement | null = null;\n let surface: HTMLDivElement | null = null;\n let openTimer: ReturnType<typeof setTimeout> | undefined;\n let closeTimer: ReturnType<typeof setTimeout> | undefined;\n let lastClosedAt = 0;\n /** A press began on the tooltip (selecting its text): it must not close until release. */\n let holding = false;\n\n const HTMLElementCtor = win?.HTMLElement;\n\n const titledAncestor = (node: EventTarget | null): HTMLElement | null => {\n if (!HTMLElementCtor || !(node instanceof win!.Node)) return null;\n const start = node instanceof HTMLElementCtor ? node : (node as Node).parentElement;\n if (!start) return null;\n const el = start.closest<HTMLElement>(`[title], [${TITLE_TOOLTIP_ATTR}]`);\n if (!el || !(el instanceof HTMLElementCtor)) return null;\n if (el.closest(`[${NATIVE_TITLE_OPT_OUT_ATTR}]`)) return null;\n return el;\n };\n\n const textOf = (el: HTMLElement) => clipTooltipText(el.getAttribute(TITLE_TOOLTIP_ATTR) ?? el.getAttribute(\"title\") ?? \"\");\n\n const lift = (el: HTMLElement) => {\n const title = el.getAttribute(\"title\");\n if (title === null) return;\n el.setAttribute(TITLE_TOOLTIP_ATTR, title);\n el.removeAttribute(\"title\");\n };\n\n const restore = (el: HTMLElement) => {\n const held = el.getAttribute(TITLE_TOOLTIP_ATTR);\n if (held === null) return;\n // An author who changed or removed the title while it was lifted wins:\n // only put ours back when nothing re-set it in the meantime.\n if (!el.hasAttribute(\"title\")) el.setAttribute(\"title\", held);\n el.removeAttribute(TITLE_TOOLTIP_ATTR);\n };\n\n const ensureSurface = () => {\n if (surface && surface.isConnected) return surface;\n surface = doc.createElement(\"div\");\n surface.setAttribute(\"role\", \"tooltip\");\n surface.setAttribute(\"data-slot\", \"title-tooltip\");\n surface.className = SURFACE_CLASS;\n surface.style.position = \"fixed\";\n surface.style.zIndex = String(TOOLTIP_LAYER_Z);\n surface.style.visibility = \"hidden\";\n doc.body.appendChild(surface);\n return surface;\n };\n\n /**\n * THE PART OF `el` A PERSON CAN SEE: its box clipped by every ancestor that clips (scrolls or hides\n * overflow) and by the window. A truncated cell in a sideways-scrolling table is far wider than its\n * visible part; anchored to the whole box the tooltip landed at the window's edge (2026-10-14).\n */\n const visibleRect = (el: HTMLElement, vw: number, vh: number) => {\n const box = el.getBoundingClientRect();\n let left = box.left;\n let top = box.top;\n let right = box.right;\n let bottom = box.bottom;\n for (let node = el.parentElement; node && node !== doc.body && node !== doc.documentElement; node = node.parentElement) {\n const cs = win?.getComputedStyle(node);\n if (!cs) break;\n const clipsX = cs.overflowX !== \"visible\" || cs.overflow === \"hidden\";\n const clipsY = cs.overflowY !== \"visible\" || cs.overflow === \"hidden\";\n if (!clipsX && !clipsY) continue;\n const clip = node.getBoundingClientRect();\n if (clipsX) { left = Math.max(left, clip.left); right = Math.min(right, clip.right); }\n if (clipsY) { top = Math.max(top, clip.top); bottom = Math.min(bottom, clip.bottom); }\n }\n left = Math.max(left, 0);\n top = Math.max(top, 0);\n right = Math.min(right, vw || right);\n bottom = Math.min(bottom, vh || bottom);\n // Nothing of it is visible (scrolled away under the pointer is impossible, but a test DOM can say so): the box itself.\n if (right <= left || bottom <= top) return box;\n return { left, top, right, bottom, width: right - left, height: bottom - top };\n };\n\n const preferredSide = (el: HTMLElement): Side => tooltipSide(el);\n\n const place = (el: HTMLElement, node: HTMLDivElement) => {\n // The VISIBLE viewport, not the window: inside a clipped host (the kind\n // sandbox frame is window-wide but shown only at its column) the visual\n // viewport is what the reader sees, so a tooltip never lands past it.\n const vw = win?.visualViewport?.width ?? win?.innerWidth ?? 0;\n const vh = win?.visualViewport?.height ?? win?.innerHeight ?? 0;\n const anchor = visibleRect(el, vw, vh);\n const box = node.getBoundingClientRect();\n const fits: Record<Side, boolean> = {\n top: anchor.top - GAP_PX - box.height >= EDGE_PX,\n bottom: anchor.bottom + GAP_PX + box.height <= vh - EDGE_PX,\n left: anchor.left - GAP_PX - box.width >= EDGE_PX,\n right: anchor.right + GAP_PX + box.width <= vw - EDGE_PX,\n };\n const opposite: Record<Side, Side> = { top: \"bottom\", bottom: \"top\", left: \"right\", right: \"left\" };\n const wanted = preferredSide(el);\n const side: Side = fits[wanted] ? wanted : fits[opposite[wanted]] ? opposite[wanted] : wanted;\n\n let x: number;\n let y: number;\n if (side === \"top\" || side === \"bottom\") {\n x = anchor.left + anchor.width / 2 - box.width / 2;\n y = side === \"top\" ? anchor.top - GAP_PX - box.height : anchor.bottom + GAP_PX;\n } else {\n y = anchor.top + anchor.height / 2 - box.height / 2;\n x = side === \"left\" ? anchor.left - GAP_PX - box.width : anchor.right + GAP_PX;\n }\n x = Math.min(Math.max(x, EDGE_PX), Math.max(EDGE_PX, vw - EDGE_PX - box.width));\n y = Math.min(Math.max(y, EDGE_PX), Math.max(EDGE_PX, vh - EDGE_PX - box.height));\n // Placed with `left`/`top`, NEVER `transform`: the open animation\n // (`.matrx-motion-popper`) animates `transform`, and a running animation\n // overrides an inline transform — the chip sat at the page's top-left\n // corner for the whole animation, then jumped to its control (2026-10-08).\n node.style.left = `${Math.round(x)}px`;\n node.style.top = `${Math.round(y)}px`;\n node.setAttribute(\"data-side\", side);\n };\n\n const isShown = (node: HTMLElement, root: HTMLElement) => {\n const rect = node.getBoundingClientRect();\n if (rect.width <= 0 || rect.height <= 0) return false;\n for (let cur: HTMLElement | null = node; cur; cur = cur === root ? null : cur.parentElement) {\n const cs = win?.getComputedStyle(cur);\n if (!cs) return false;\n if (cs.display === \"none\" || cs.visibility === \"hidden\" || Number(cs.opacity) === 0) return false;\n }\n return true;\n };\n\n /**\n * A tooltip that repeats text the person can already read in full is noise\n * (an expanded sidebar row, a \"Save\" button titled \"Save\"). It still shows\n * when that text is hidden (a collapsed rail's label) or cut off\n * (truncated) — the two cases a title exists for.\n */\n const isClipped = (host: HTMLElement, root: HTMLElement) => {\n for (let node: HTMLElement | null = host; node; node = node.parentElement) {\n if (node.scrollWidth > node.clientWidth + 1 && node.clientWidth > 0) return true;\n if (node.scrollHeight > node.clientHeight + 1 && node.clientHeight > 0) return true;\n if (node === root) break;\n }\n return false;\n };\n\n const repeatsVisibleText = (el: HTMLElement, text: string) => {\n const norm = (t: string) => t.replace(/\\s+/g, \" \").trim().toLowerCase();\n const want = norm(text);\n if (!want || !win) return false;\n const walker = doc.createTreeWalker(el, win.NodeFilter.SHOW_TEXT);\n for (let node = walker.nextNode(); node; node = walker.nextNode()) {\n if (norm(node.textContent ?? \"\") !== want) continue;\n const host = node.parentElement;\n if (!host || !isShown(host, el)) continue;\n // Cut off is measured on the BOX that clips: an inline host (a span inside a truncating\n // cell) has no box width of its own, so every ancestor up to the titled element is asked.\n if (isClipped(host, el)) continue;\n return true;\n }\n return false;\n };\n\n const show = (el: HTMLElement, instant: boolean) => {\n if (active !== el) return;\n // A Radix tooltip trigger shows its own tooltip — never a second one.\n if (el.closest(`[${TOOLTIP_TRIGGER_ATTR}]`)) return;\n const text = textOf(el);\n if (!text || !el.isConnected) return;\n if (repeatsVisibleText(el, text)) return;\n const node = ensureSurface();\n node.textContent = text;\n node.style.visibility = \"hidden\";\n // Measure and place BEFORE the open state starts the animation: measured\n // mid-animation the box reads at its 0.95 entry scale and lands off-centre.\n node.removeAttribute(\"data-state\");\n // The surface is ONE shared fixed element that keeps the `left` of its last\n // placement. Measured there, a longer text wraps against the room that is\n // left of the OLD spot, reads one line too tall, and lands a line too high\n // once it moves (the sandbox tooltip spec caught a 16px extra gap). Rewind\n // to the origin so the box is measured at its natural, unwrapped size.\n node.style.left = \"0px\";\n node.style.top = \"0px\";\n place(el, node);\n node.setAttribute(\"data-state\", instant ? \"instant-open\" : \"delayed-open\");\n node.style.visibility = \"visible\";\n if (el.id) node.id = `${el.id}-title-tooltip`;\n };\n\n const hide = () => {\n if (openTimer !== undefined) clearTimeout(openTimer);\n openTimer = undefined;\n cancelClose();\n holding = false;\n if (surface && surface.style.visibility === \"visible\") lastClosedAt = Date.now();\n if (surface) {\n surface.style.visibility = \"hidden\";\n surface.removeAttribute(\"data-state\");\n }\n };\n\n const cancelClose = () => {\n if (closeTimer !== undefined) clearTimeout(closeTimer);\n closeTimer = undefined;\n };\n\n const inSurface = (node: EventTarget | null) =>\n !!surface && !!win && node instanceof win.Node && surface.contains(node);\n\n const hasSelectionInSurface = () => {\n const sel = win?.getSelection();\n return !!sel && !sel.isCollapsed && !!surface && !!sel.anchorNode && surface.contains(sel.anchorNode);\n };\n\n /** Close after the bridge delay unless the pointer reached the tooltip or text in it is selected. */\n const scheduleClose = () => {\n cancelClose();\n // Nothing is showing yet (the open delay has not run, or the text was not worth drawing): there is\n // nothing to bridge to, so leaving simply cancels.\n if (!surface || surface.style.visibility !== \"visible\") {\n deactivate();\n return;\n }\n closeTimer = setTimeout(() => {\n closeTimer = undefined;\n if (holding || hasSelectionInSurface()) return;\n deactivate();\n }, TOOLTIP_CLOSE_DELAY_MS);\n };\n\n const activate = (el: HTMLElement) => {\n cancelClose();\n if (active === el) return;\n deactivate();\n active = el;\n lift(el);\n const instant = Date.now() - lastClosedAt < SKIP_DELAY_MS;\n if (instant) show(el, true);\n else openTimer = setTimeout(() => show(el, false), OPEN_DELAY_MS);\n };\n\n const deactivate = () => {\n hide();\n if (active) restore(active);\n active = null;\n };\n\n // A touch has no hover: the tap that focuses a button must not open its tooltip, and a tooltip\n // that is open when a finger lands closes. The compat mouse events and the focus a tap leaves\n // behind used to pin \"Copy chart source\" over the chart title on a phone (review 5, G13).\n let lastTouchAt = Number.NEGATIVE_INFINITY;\n const TOUCH_FOCUS_WINDOW_MS = 1000;\n const onPointerOver = (e: PointerEvent) => {\n if (e.pointerType === \"touch\") {\n lastTouchAt = Date.now();\n if (active) deactivate();\n return;\n }\n if (inSurface(e.target)) {\n cancelClose();\n return;\n }\n if (holding || hasSelectionInSurface()) {\n // Text is being selected in the tooltip: another control passing under the pointer must not replace it.\n return;\n }\n const el = titledAncestor(e.target);\n if (el) activate(el);\n else if (active && closeTimer === undefined) scheduleClose();\n };\n\n const onPointerOut = (e: PointerEvent) => {\n if (!active) return;\n const next = e.relatedTarget;\n if (next instanceof win!.Node && (active.contains(next) || inSurface(next))) return;\n if (inSurface(e.target)) {\n if (holding) return;\n scheduleClose();\n return;\n }\n scheduleClose();\n };\n\n const onPointerDown = (e: PointerEvent) => {\n if (e.pointerType === \"touch\") lastTouchAt = Date.now();\n if (inSurface(e.target)) {\n // Selecting the tooltip's text: keep it open until the press ends.\n holding = true;\n cancelClose();\n return;\n }\n deactivate();\n };\n\n const onPointerUp = () => {\n if (!holding) return;\n holding = false;\n if (!hasSelectionInSurface()) scheduleClose();\n };\n\n const onFocusIn = (e: FocusEvent) => {\n if (Date.now() - lastTouchAt < TOUCH_FOCUS_WINDOW_MS) return;\n const el = titledAncestor(e.target);\n if (!el) return;\n let visible = true;\n try {\n visible = (e.target as Element).matches(\":focus-visible\");\n } catch {\n visible = true;\n }\n if (visible) activate(el);\n };\n\n const onFocusOut = (e: FocusEvent) => {\n if (!active) return;\n const next = e.relatedTarget;\n if (next instanceof win!.Node && active.contains(next)) return;\n deactivate();\n };\n\n const onDismiss = (e?: Event) => {\n if (e && inSurface(e.target)) return;\n deactivate();\n };\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") deactivate();\n };\n\n doc.addEventListener(\"pointerover\", onPointerOver, true);\n doc.addEventListener(\"pointerout\", onPointerOut, true);\n doc.addEventListener(\"focusin\", onFocusIn, true);\n doc.addEventListener(\"focusout\", onFocusOut, true);\n doc.addEventListener(\"pointerdown\", onPointerDown, true);\n doc.addEventListener(\"pointerup\", onPointerUp, true);\n doc.addEventListener(\"keydown\", onKeyDown, true);\n doc.addEventListener(\"scroll\", onDismiss, true);\n win?.addEventListener(\"blur\", onDismiss);\n\n return () => {\n deactivate();\n doc.removeEventListener(\"pointerover\", onPointerOver, true);\n doc.removeEventListener(\"pointerout\", onPointerOut, true);\n doc.removeEventListener(\"focusin\", onFocusIn, true);\n doc.removeEventListener(\"focusout\", onFocusOut, true);\n doc.removeEventListener(\"pointerdown\", onPointerDown, true);\n doc.removeEventListener(\"pointerup\", onPointerUp, true);\n doc.removeEventListener(\"keydown\", onKeyDown, true);\n doc.removeEventListener(\"scroll\", onDismiss, true);\n win?.removeEventListener(\"blur\", onDismiss);\n surface?.remove();\n surface = null;\n };\n}\n","\"use client\";\n\n/**\n * Ported verbatim from matrx-frontend `components/ui/radix-dialog-modal-context.tsx`.\n * Shared by the Sheet and BottomSheet families (and available to hosts that\n * compose their own Radix Dialog-derived wrappers around these primitives).\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.dialog-modal-context\");\nconst contextRegistry = globalThis as typeof globalThis & { [CONTEXT_SLOT]?: React.Context<boolean> };\nconst RadixDialogModalContext = contextRegistry[CONTEXT_SLOT] ??= React.createContext<boolean>(true);\n\nexport interface RadixDialogModalProviderProps {\n children: React.ReactNode;\n modal: boolean;\n}\n\n/**\n * Keeps our Radix-based content wrappers aligned with the owning Root's\n * modality so ARIA semantics cannot drift from focus/pointer behavior.\n */\nexport function RadixDialogModalProvider({\n children,\n modal,\n}: RadixDialogModalProviderProps) {\n return (\n <RadixDialogModalContext.Provider value={modal}>\n {children}\n </RadixDialogModalContext.Provider>\n );\n}\n\n/** Returns whether the nearest Radix Dialog-derived root is modal. */\nexport function useRadixDialogModal(): boolean {\n return React.useContext(RadixDialogModalContext);\n}\n","\"use client\";\n\n/**\n * Popover — ported verbatim from matrx-frontend `components/ui/popover.tsx`.\n *\n * Seam inversion: the host's `useNestedPortalContainer` (dialog/popout aware)\n * becomes the injected `PortalContainerProvider` seam (`portal-container.tsx`);\n * the explicit `container` prop keeps top priority, exactly as before.\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-popover 1.1.17 / react-id 1.1.2). The gate was actively\n * harmful — the Trigger wraps ALWAYS-VISIBLE content, so `return null`\n * deleted it from SSR and the first client paint.\n */\n\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { MOTION_POPPER } from \"./motion\";\nimport { SOLID_SURFACE_CLASS, type PopoverSurface } from \"./solid-surface\";\nimport { usePortalContainer } from \"./portal-container\";\nimport { keepMovedFocus } from \"./focus-return\";\n\nexport const Popover = PopoverPrimitive.Root;\n\nexport const PopoverTrigger = PopoverPrimitive.Trigger;\n\nexport const PopoverAnchor = PopoverPrimitive.Anchor;\n\nexport interface PopoverContentProps\n extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.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 — a picker re-anchoring while the user\n * types, a measurement pass. It is NOT the reduced-motion switch;\n * `styles.css` already honors `prefers-reduced-motion`.\n */\n animated?: boolean;\n /**\n * HOW WIDE THE POPOVER IS ALLOWED TO BE, and it is the SYSTEM that decides — never a\n * surface pasting its own `w-64` over the default (lane FIX-14, 2026-09-22).\n *\n * `\"fixed\"` (default) is the historical `w-72`: right for a menu of short, known\n * labels, where a ragged edge would look broken.\n *\n * `\"content\"` is for a popover whose whole job is to SHOW SOMETHING THE SYSTEM DID\n * NOT CHOOSE — a person's name, a record's title, a row the user is about to\n * create. The relation picker offered\n *\n * Create “Marisol Okonkwo — 418 Calle Pu\n *\n * inside a 16rem box, cut mid-word, on the one control that exists to show the name\n * being created. A fixed width cannot be right for content of unknown length, so\n * this one grows to its content between an honest floor and an honest ceiling:\n *\n * · at least the trigger's own width, and at least 20rem — the width Airtable's and\n * Notion's link-record pickers settle on, and wide enough that an ordinary\n * \"name — street, town\" fits on one line;\n * · at most 28rem, and never wider than the viewport less a 1rem gutter each side,\n * so it still fits a 375px phone with nothing running off the screen. The floor is\n * clamped by the same gutter, so on a very narrow screen the ceiling still wins.\n *\n * Beyond that ceiling the CONTENT truncates with an ellipsis and carries a `title`.\n * Growing, then ellipsis — never a mid-word cut.\n *\n * BOTH modes keep the phone gutter (2026-09-26): the box is never wider than the\n * viewport less 1rem each side, and Radix keeps it `collisionPadding` (16px) off every\n * screen edge. Measured at 375px before this: `w-72`/`w-80` callers landed flush on\n * the right edge (55→375) because collision padding was 0.\n */\n sizing?: \"fixed\" | \"content\";\n /**\n * The surface fill. `\"default\"` is the theme's popover surface (a host may render it\n * translucent / glass). `\"solid\"` is the OPAQUE surface — the popover token at full\n * alpha, no backdrop blur — for a menu that must read as paper over a cover image or a\n * busy page (a Notion-style ••• menu). Same option on `DropdownMenuContent`.\n */\n surface?: PopoverSurface;\n /**\n * A NAMED fixed width (0.68.22), for a `sizing=\"fixed\"` popover whose content needs more or\n * less room than the default `md` (18rem) — never a pasted `w-[260px]`. Every width keeps the\n * phone gutter (never wider than the viewport less 1rem each side). Derived from the call\n * sites: `xs` 12rem (a short menu), `sm` 15rem (a ••• menu), `md` 18rem (default),\n * `lg` 20rem (a small form), `xl` 26rem (a picker grid), `2xl` 34rem (a gallery).\n * Ignored when `sizing=\"content\"`.\n */\n width?: PopoverWidth;\n /**\n * The inner padding, named (0.68.22): `none` (the content draws its own — a command list, a\n * picker), `xs` 4px (a menu of rows), `sm` 8px, `md` 12px, `default` 16px.\n */\n padding?: PopoverPadding;\n}\n\nexport type PopoverWidth = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\nexport type PopoverPadding = \"none\" | \"xs\" | \"sm\" | \"md\" | \"default\";\n\n/** Literal class per width so a host's Tailwind scan of the package finds every one. */\nexport const POPOVER_WIDTH_CLASS: Record<PopoverWidth, string> = {\n xs: \"w-48\",\n sm: \"w-60\",\n md: \"w-72\",\n lg: \"w-80\",\n xl: \"w-[26rem]\",\n \"2xl\": \"w-[34rem]\",\n};\nexport const POPOVER_PADDING_CLASS: Record<PopoverPadding, string> = {\n none: \"p-0\",\n xs: \"p-1\",\n sm: \"p-2\",\n md: \"p-3\",\n default: \"p-4\",\n};\n\nexport const PopoverContent = React.forwardRef<\n React.ComponentRef<typeof PopoverPrimitive.Content>,\n PopoverContentProps\n>(\n (\n {\n className,\n align = \"center\",\n sideOffset = 4,\n container,\n animated = true,\n sizing = \"fixed\",\n surface = \"default\",\n width = \"md\",\n padding = \"default\",\n collisionPadding = 16,\n onCloseAutoFocus,\n ...props\n },\n ref,\n ) => {\n const portalContainer = usePortalContainer(container);\n return (\n <PopoverPrimitive.Portal container={portalContainer}>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n data-surface={surface === \"solid\" ? \"solid\" : undefined}\n data-width={sizing === \"content\" ? undefined : width}\n data-padding={padding}\n className={cn(\n // Cap to the viewport space Radix measured and scroll — a popover taller\n // than the screen must never trap the user with unreachable content.\n // z must EQUAL the dialog layer (z-[10000]), never exceed it: with equal\n // z, DOM portal order decides, so a dialog opened FROM a popover stacks\n // above it, and a popover opened from a dialog still stacks above the\n // dialog. z-[10001] buried dialogs behind fullscreen popovers.\n \"z-[10000] max-h-[var(--radix-popover-content-available-height)] overflow-y-auto overscroll-contain rounded-md border bg-popover text-popover-foreground shadow-md outline-none\",\n POPOVER_PADDING_CLASS[padding],\n sizing === \"content\"\n ? \"w-auto min-w-[min(max(var(--radix-popover-trigger-width),20rem),calc(100vw-2rem))] max-w-[min(28rem,calc(100vw-2rem))]\"\n : cn(POPOVER_WIDTH_CLASS[width], \"max-w-[calc(100vw-2rem)]\"),\n surface === \"solid\" && SOLID_SURFACE_CLASS,\n animated && MOTION_POPPER,\n className,\n )}\n {...props}\n onCloseAutoFocus={keepMovedFocus(onCloseAutoFocus)}\n />\n </PopoverPrimitive.Portal>\n );\n },\n);\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n","/**\n * useIsMobile — the ONE breakpoint hook the package's responsive primitives\n * read (CommandDialog and Dialog both auto-render as a bottom sheet below it).\n *\n * The body lives in `@ai-matrx/kit/media-query` (chat-package independence\n * P12, 2026-10-01): the app's `hooks/use-mobile` and this package each carried\n * their own copy, and two breakpoint hooks is exactly the duplication this\n * package exists to end. Kit's reads through `useSyncExternalStore` — `false`\n * on the server and during hydration, so the desktop geometry hydrates — and\n * never throws where `matchMedia` is absent.\n */\nexport { MOBILE_BREAKPOINT, useIsMobile } from \"@ai-matrx/kit/media-query\";\n","/**\n * The date field's words — locale-aware display and typed-entry parsing, pure.\n *\n * Values are ISO, always: a day is `yyyy-mm-dd`, a time is `HH:mm` (24h), a\n * date-and-time is `yyyy-mm-ddTHH:mm` (local, no zone — the shape\n * `<input type=\"datetime-local\">` and kit's `datetimeLocalValue` speak). What a\n * person SEES and TYPES is their locale's: `Oct 7, 2026` / `7 Oct 2026`,\n * `3:30 PM` / `15:30`. Typed entry accepts the locale's numeric order\n * (10/7/2026 in en-US, 7/10/2026 in en-GB), ISO, month names (the locale's and\n * English), digit runs (10072026), and today / tomorrow / yesterday.\n */\n\nimport { isValidDateOnly, parseDateOnly, toDateOnly } from \"@ai-matrx/kit/dates\";\n\nexport type DateFieldMode = \"date\" | \"datetime\" | \"time\";\n\nconst pad = (n: number) => String(n).padStart(2, \"0\");\n\n/** The day / month / year order the locale writes numeric dates in. */\nexport function dateOrder(locale?: string): Array<\"day\" | \"month\" | \"year\"> {\n const parts = new Intl.DateTimeFormat(locale, { year: \"numeric\", month: \"2-digit\", day: \"2-digit\" })\n .formatToParts(new Date(2026, 9, 7));\n const order = parts\n .map((p) => p.type)\n .filter((t): t is \"day\" | \"month\" | \"year\" => t === \"day\" || t === \"month\" || t === \"year\");\n return order.length === 3 ? order : [\"month\", \"day\", \"year\"];\n}\n\n/** 0 = Sunday … 6 = Saturday: the first column of the locale's week. */\nexport function weekStart(locale?: string): number {\n try {\n const loc = new Intl.Locale(locale ?? new Intl.DateTimeFormat().resolvedOptions().locale) as Intl.Locale & {\n getWeekInfo?: () => { firstDay: number };\n weekInfo?: { firstDay: number };\n };\n const first = loc.getWeekInfo?.().firstDay ?? loc.weekInfo?.firstDay;\n if (typeof first === \"number\") return first % 7; // Intl: 1 = Monday … 7 = Sunday\n } catch {\n // An unknown locale tag falls through to the region default below.\n }\n return 0;\n}\n\nfunction monthNames(locale?: string): Map<string, number> {\n const names = new Map<string, number>();\n const add = (fmtLocale: string | undefined) => {\n for (const style of [\"long\", \"short\"] as const) {\n const fmt = new Intl.DateTimeFormat(fmtLocale, { month: style });\n for (let m = 0; m < 12; m++) {\n const name = fmt.format(new Date(2026, m, 1)).toLowerCase().replace(/\\./g, \"\");\n if (name && !names.has(name)) names.set(name, m);\n }\n }\n };\n add(locale);\n add(\"en-US\");\n return names;\n}\n\nfunction expandYear(y: number, raw: string): number {\n if (raw.length > 2) return y;\n const now = new Date().getFullYear();\n const century = Math.floor(now / 100) * 100;\n const candidate = century + y;\n return candidate > now + 20 ? candidate - 100 : candidate;\n}\n\nfunction build(y: number, m: number, d: number): string | null {\n if (!Number.isFinite(y) || !Number.isFinite(m) || !Number.isFinite(d)) return null;\n const iso = `${String(y).padStart(4, \"0\")}-${pad(m)}-${pad(d)}`;\n return isValidDateOnly(iso) ? iso : null;\n}\n\n/** Typed text → `yyyy-mm-dd`, or `null` when it is not a day this field can name. */\nexport function parseTypedDate(text: string, locale?: string, now: Date = new Date()): string | null {\n const raw = text.trim().toLowerCase().replace(/,/g, \" \").replace(/\\s+/g, \" \");\n if (!raw) return null;\n\n const relative: Record<string, number> = { today: 0, tod: 0, tomorrow: 1, tom: 1, yesterday: -1 };\n if (raw in relative) {\n const d = new Date(now.getFullYear(), now.getMonth(), now.getDate() + relative[raw]!);\n return toDateOnly(d);\n }\n\n const iso = /^(\\d{4})[-/.](\\d{1,2})[-/.](\\d{1,2})$/.exec(raw);\n if (iso) return build(Number(iso[1]), Number(iso[2]), Number(iso[3]));\n\n const order = dateOrder(locale);\n\n // Month names: \"oct 7 2026\", \"7 october\", \"october 7\".\n if (/[a-zÀ-￿]/.test(raw)) {\n const names = monthNames(locale);\n const tokens = raw.replace(/\\./g, \"\").split(/[\\s/\\-]+/).filter(Boolean);\n let month: number | undefined;\n const nums: string[] = [];\n for (const t of tokens) {\n if (/^\\d+(st|nd|rd|th)?$/.test(t)) {\n nums.push(t.replace(/\\D/g, \"\"));\n continue;\n }\n const exact = names.get(t);\n const prefix =\n exact ?? (t.length >= 3 ? [...names].find(([name]) => name.startsWith(t))?.[1] : undefined);\n if (prefix === undefined || month !== undefined) return null;\n month = prefix;\n }\n if (month === undefined || nums.length === 0 || nums.length > 2) return null;\n const day = Number(nums[0]);\n const year = nums[1] ? expandYear(Number(nums[1]), nums[1]) : now.getFullYear();\n return build(year, month + 1, day);\n }\n\n // Numbers in the locale's order: separators, or one digit run.\n let pieces = raw.split(/[\\s/.\\-]+/).filter(Boolean);\n if (pieces.length === 1 && /^\\d+$/.test(raw)) {\n const yearFirst = order[0] === \"year\";\n if (raw.length === 8) {\n pieces = yearFirst ? [raw.slice(0, 4), raw.slice(4, 6), raw.slice(6)] : [raw.slice(0, 2), raw.slice(2, 4), raw.slice(4)];\n } else if (raw.length === 6) {\n pieces = [raw.slice(0, 2), raw.slice(2, 4), raw.slice(4)];\n } else {\n return null;\n }\n }\n if (!pieces.every((p) => /^\\d+$/.test(p))) return null;\n if (pieces.length === 2) {\n const dm = order.filter((o) => o !== \"year\");\n const v: Record<string, number> = {};\n dm.forEach((k, i) => (v[k] = Number(pieces[i])));\n return build(now.getFullYear(), v.month!, v.day!);\n }\n if (pieces.length !== 3) return null;\n // A four-digit first piece is a year whatever the locale says.\n const effective = pieces[0]!.length === 4 ? ([\"year\", \"month\", \"day\"] as const) : order;\n const v: Record<string, number> = {};\n effective.forEach((k, i) => {\n const p = pieces[i]!;\n v[k] = k === \"year\" ? expandYear(Number(p), p) : Number(p);\n });\n return build(v.year!, v.month!, v.day!);\n}\n\n/** Typed text → `HH:mm` (24h), or `null`. Accepts 3pm, 3:30 pm, 15:30, 1530, noon, midnight. */\nexport function parseTypedTime(text: string): string | null {\n const raw = text.trim().toLowerCase().replace(/\\s+/g, \"\").replace(/\\./g, \"\");\n if (!raw) return null;\n if (raw === \"noon\") return \"12:00\";\n if (raw === \"midnight\") return \"00:00\";\n const m = /^(\\d{1,2})(?::?(\\d{2}))?(am|pm|a|p)?$/.exec(raw);\n if (!m) return null;\n let h = Number(m[1]);\n const min = m[2] ? Number(m[2]) : 0;\n const mer = m[3]?.[0];\n if (min > 59) return null;\n if (mer) {\n if (h < 1 || h > 12) return null;\n if (mer === \"a\") h = h === 12 ? 0 : h;\n else h = h === 12 ? 12 : h + 12;\n } else if (h > 23) {\n return null;\n }\n return `${pad(h)}:${pad(min)}`;\n}\n\n/** `yyyy-mm-dd` → the locale's medium day (`Oct 7, 2026`). */\nexport function formatDay(iso: string, locale?: string): string {\n const d = parseDateOnly(iso);\n if (!d) return iso;\n return new Intl.DateTimeFormat(locale, { month: \"short\", day: \"numeric\", year: \"numeric\" }).format(d);\n}\n\n/** `HH:mm` → the locale's short time (`3:30 PM` / `15:30`). */\nexport function formatTime(hhmm: string, locale?: string): string {\n const m = /^(\\d{2}):(\\d{2})$/.exec(hhmm);\n if (!m) return hhmm;\n return new Intl.DateTimeFormat(locale, { hour: \"numeric\", minute: \"2-digit\" }).format(\n new Date(2026, 0, 1, Number(m[1]), Number(m[2])),\n );\n}\n\n/** Split an ISO value into its day and time halves for a mode. */\nexport function splitValue(value: string | null | undefined, mode: DateFieldMode): { day: string; time: string } {\n const v = (value ?? \"\").trim();\n if (!v) return { day: \"\", time: \"\" };\n if (mode === \"time\") {\n const t = /(\\d{2}:\\d{2})/.exec(v);\n return { day: \"\", time: t ? t[1]! : \"\" };\n }\n const day = /^(\\d{4}-\\d{2}-\\d{2})/.exec(v)?.[1] ?? \"\";\n const time = mode === \"datetime\" ? (/[T ](\\d{2}:\\d{2})/.exec(v)?.[1] ?? \"\") : \"\";\n return { day, time };\n}\n\n/** The 42 days (six weeks) a month grid shows, starting on the locale's first weekday. */\nexport function monthGrid(year: number, month: number, firstDay: number): Date[] {\n const first = new Date(year, month, 1);\n const offset = (first.getDay() - firstDay + 7) % 7;\n return Array.from({ length: 42 }, (_, i) => new Date(year, month, 1 - offset + i));\n}\n\n/** Half-hour slots for the time list, `HH:mm`. */\nexport const TIME_SLOTS: readonly string[] = Array.from({ length: 48 }, (_, i) => `${pad(Math.floor(i / 2))}:${i % 2 ? \"30\" : \"00\"}`);\n","\"use client\";\n\n/**\n * THE COMPOUND DOORS — the one control behind the APIs a host already speaks.\n *\n * `Field`, `Select`, `Tabs` (controls.tsx) are the options-array controls. Hundreds of host call\n * sites speak the compound Radix APIs instead (`<SelectTrigger><SelectValue/></SelectTrigger>`,\n * `<TabsList><TabsTrigger/></TabsList>`, a bare `<Input/>` with its own ref and props). These are\n * THE SAME controls for those APIs: the same classes, the same locked geometry and color in\n * `@layer matrx-tap-lock` (controls.css), no size. They live here, under `/controls`, so the\n * package-root primitives (`SelectTrigger`, `TabsList`, `Input`) keep their legacy look for every\n * host that has not adopted the controls.\n *\n * Fill: a compound field or select trigger FILLS its container by default (minus its half-gaps),\n * because the API it replaces did (`w-full`); a call site's width class still places it.\n */\n\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\";\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { isIconOnly } from \"./icon-only\";\nimport { SelectChevron } from \"../select\";\nimport type { ControlWidth } from \"./controls\";\n\n/* ------------------------------------------------------------------ */\n/* Input — the field capsule on the <input> itself */\n/* ------------------------------------------------------------------ */\n\nexport interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {\n /** `field` (default): the capsule. `bare`: the surrounding surface draws the frame (an inline\n * editor, a composite control) — no border, no fill, no inset, no focus ring of its own. */\n variant?: \"field\" | \"bare\";\n /** Monospace text — code, ids, keys, JSON. */\n mono?: boolean;\n /** Reserve room for a 16px glyph the host overlays at the start / end (a search icon, a clear\n * button). Prefer `Field`'s own `icon` / `end` slots for new code. */\n adornment?: \"start\" | \"end\" | \"both\";\n /** Where the value sits: `start` (default), `center` (a stepper's count), `end` (an amount). */\n align?: \"start\" | \"center\" | \"end\";\n /** Tabular figures, end-aligned unless `align` says otherwise — quantities, money, limits. */\n numeric?: boolean;\n /** A value's provenance, on the frame: `inherited` (dashed — empty, a default applies) or\n * `changed` (primary — edited, not yet saved). An error is `aria-invalid`, never a mark. */\n mark?: \"inherited\" | \"changed\";\n /** A named width instead of filling the row (see `ControlWidth`). */\n width?: ControlWidth;\n}\n\n/**\n * The input capsule for the bare-`<input>` API: every prop, the ref and `className` (placement)\n * land on the `<input>`. Use `Field` when you want the glyph slots.\n */\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, variant = \"field\", mono, adornment, align, numeric, mark, width, ...props }, ref) => (\n <input\n ref={ref}\n data-matrx-control=\"input\"\n data-width={width}\n data-variant={variant === \"bare\" ? \"bare\" : undefined}\n data-mono={mono ? \"\" : undefined}\n data-adornment={adornment}\n data-align={align ?? (numeric ? \"end\" : undefined)}\n data-numeric={numeric ? \"\" : undefined}\n data-mark={mark}\n className={cn(\"matrx-control matrx-control-field matrx-control-input\", className)}\n {...props}\n />\n ),\n);\nInput.displayName = \"Input\";\n\n/* ------------------------------------------------------------------ */\n/* SelectTrigger — the select capsule on Radix Select's trigger */\n/* ------------------------------------------------------------------ */\n\nexport interface SelectTriggerProps extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> {\n /** No chevron (a trigger that is its value alone). */\n hideArrow?: boolean;\n /** `field` (default): the capsule. `bare`: the surrounding surface draws the frame. */\n variant?: \"field\" | \"bare\";\n /** A named width instead of filling the row (see `ControlWidth`). */\n width?: ControlWidth;\n}\n\n/**\n * THE select trigger for the compound Radix API (`Select` root, `SelectValue`, `SelectContent`,\n * `SelectItem` stay the package root's). 28px capsule, 13px value, 16px glyphs, one chevron.\n */\nexport const SelectTrigger = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Trigger>,\n SelectTriggerProps\n>(({ className, children, hideArrow = false, variant = \"field\", width, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n data-matrx-control=\"select\"\n data-width={width}\n data-compound=\"\"\n data-variant={variant === \"bare\" ? \"bare\" : undefined}\n className={cn(\"matrx-control matrx-control-select\", className)}\n {...props}\n >\n {children}\n {!hideArrow && (\n <SelectPrimitive.Icon asChild>\n <SelectChevron />\n </SelectPrimitive.Icon>\n )}\n </SelectPrimitive.Trigger>\n));\nSelectTrigger.displayName = \"SelectTrigger\";\n\n/* ------------------------------------------------------------------ */\n/* TabsList / TabsTrigger — the controls' tabs on Radix Tabs */\n/* ------------------------------------------------------------------ */\n\nexport type TabsVariant = \"underline\" | \"capsule\";\nconst TabsVariantContext = React.createContext<TabsVariant>(\"capsule\");\n\nexport interface TabsListProps extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.List> {\n /** `capsule` (default): a muted track, the active tab a raised thumb — filters, view switches.\n * `underline`: page sections, the active tab underlined on a hairline. */\n variant?: TabsVariant;\n /** The tabs share the row's whole width equally. */\n fill?: boolean;\n /** Underline only: draw the hairline (default). `false` when the row already draws it. */\n rule?: boolean;\n /** More tabs than fit: `scroll` (one row that scrolls sideways, no scrollbar drawn) or `wrap`\n * (further rows). Default: neither — the row is as wide as its tabs. */\n overflow?: \"scroll\" | \"wrap\";\n}\n\n/** The tab row for the compound Radix API (`Tabs` root and `TabsContent` stay the root's). */\nexport const TabsList = React.forwardRef<React.ComponentRef<typeof TabsPrimitive.List>, TabsListProps>(\n ({ className, variant = \"capsule\", fill, rule = true, overflow, ...props }, ref) => (\n <TabsVariantContext.Provider value={variant}>\n <TabsPrimitive.List\n ref={ref}\n data-matrx-control=\"tabs\"\n data-variant={variant}\n data-fill={fill ? \"\" : undefined}\n data-rule={variant === \"underline\" && !rule ? \"none\" : undefined}\n data-overflow={overflow}\n className={cn(variant === \"capsule\" ? \"matrx-control matrx-control-segmented\" : \"matrx-control-tabs\", className)}\n {...props}\n />\n </TabsVariantContext.Provider>\n ),\n);\nTabsList.displayName = \"TabsList\";\n\n/** One tab. Its skin follows the `TabsList` it sits in. */\nexport const TabsTrigger = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, ...props }, ref) => {\n const variant = React.useContext(TabsVariantContext);\n return (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(variant === \"capsule\" ? \"matrx-control-segment\" : \"matrx-control-tab\", className)}\n data-icon-only={variant === \"capsule\" && isIconOnly(props.children) ? \"\" : undefined}\n {...props}\n />\n );\n});\nTabsTrigger.displayName = \"TabsTrigger\";\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 { Slot } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\n\nimport { swallowClick } from \"../button\";\nimport { cn } from \"../cn\";\nimport { ConfirmDialog } from \"../confirm-dialog\";\nimport { ChevronRightIcon, Trash2Icon } from \"../icons\";\nimport { Skeleton } from \"../skeleton\";\nimport { Button, ControlRow, type ChipTone, type GlyphTone } 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/* Tile — the pressable row / tile (a choice, a destination) */\n/* ------------------------------------------------------------------ */\n\nexport type TileLayout = \"row\" | \"stack\" | \"adaptive\" | \"icon\";\n\nexport interface TileProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"title\"> {\n /** `row` (default): glyph, then a 13px title over a 12px line, start-aligned, full width — a\n * choice in a list, a quick action. `stack`: glyph on top, title and line under it — a grid\n * tile. `adaptive`: `stack` from the `sm` breakpoint (640px) up, a compact `row` below it — a\n * grid of option cards that becomes a list on a phone. `icon`: the launcher tile of an icon\n * grid (a \"Can make\" grid, a sidebar's pinned apps, a copy palette) — the glyph centered over\n * an 11px label centered under it, up to two lines, no frame, a pick is a soft tint, `end`\n * is a badge on the top corner, `line` is hidden. All are taller than a control: they carry\n * text, so they never take the 28px lock. */\n layout?: TileLayout;\n /** `outline` (default): the bordered card skin. `quiet`: no frame until hover — a row in a\n * menu-like list. */\n variant?: \"outline\" | \"quiet\";\n /** Leading 16px glyph (an avatar or image works too). */\n icon?: React.ReactNode;\n /** The 13px title. */\n title: React.ReactNode;\n /** The title wraps over several lines (up to 6) instead of one line with an ellipsis: a quiz\n * answer, a step, a sentence-long choice. Off by default — a short title is one line. */\n wrapTitle?: boolean;\n /** One 12px secondary line (clamped to two lines; one with `oneLine`). */\n line?: React.ReactNode;\n /** The `line` stays ONE line with an ellipsis, so every row of a master list keeps one height. */\n oneLine?: boolean;\n /** Trailing content in a row (a chevron, a count, a shortcut). */\n end?: React.ReactNode;\n /** A choice: `true` tints it and sets `aria-pressed`; `false` sets `aria-pressed=\"false\"`. A link tile (`asChild`) never sets `aria-pressed`: the caller sets `aria-current`. */\n selected?: boolean;\n /** How `selected` looks. `outline` (default): primary frame and tint. `fill`: a soft neutral fill,\n * no outline, ink unchanged — a sidebar's active row. `primary`: the solid primary fill with\n * every ink (title, line, glyph, end) on primary — the open item of a master list. */\n selectedStyle?: \"outline\" | \"fill\" | \"primary\";\n /** The hover / focus tooltip (the native `title` attribute: `title` is the visible label). */\n tooltip?: string;\n /** Nesting depth under a parent row: each level moves the row's start past one glyph and its\n * gap, so an icon-less child's title starts where its parent's title does. */\n level?: 1 | 2 | 3;\n /** Size to the content and never shrink or truncate the title — a code, a short value. */\n fit?: boolean;\n /** Keep room at the row's end for a control laid OVER it (a row's More button): `control`\n * reserves one control's width plus its gap, so the title never runs under it. */\n endInset?: \"control\";\n /** A dashed border: the \"add another\" tile (an empty slot to fill), never a choice. */\n dashed?: boolean;\n /** hoverStyle=\"fill\": the pointer's soft neutral fill (the desktop look's secondary fill) instead of the accent. */\n hoverStyle?: \"fill\";\n /** A destructive row (Remove, Delete): destructive title and glyph, destructive hover tint. */\n danger?: boolean;\n /**\n * A choice that is ALREADY USED elsewhere (an option already placed, a field already mapped): a\n * faint shade and quieter ink, still fully pressable — a hint for the eye, never a disabled state.\n */\n dimmed?: boolean;\n /** The glyph's own status ink when its color carries meaning (Button's `glyphTone`). */\n glyphTone?: GlyphTone;\n /** The inviting choice card for a front door: roomy padding, a 40px icon square, a 14px title. */\n hero?: boolean;\n /** Tint card, edge and icon square from one `ChipTone` (the `Chip` hue tokens). */\n tone?: ChipTone;\n /** Tint ONLY the icon, as a 28px colored square, on a neutral card: a grid of actions where each\n * job keeps its own hue (quick actions) without every card turning into a colored card. */\n iconTone?: ChipTone;\n /** A 28px navigation / filter row for sidebars and dense lists: `min-height` is the control size,\n * padding 4px 8px, gap 8px, 13px title. The `line` is HIDDEN when dense (one line, always).\n * `variant=\"quiet\"` + `dense` is a clean nav row: transparent until hover / selected. */\n dense?: boolean;\n /** Render the one child element (a link) with the tile's skin; its children are ignored —\n * the tile draws `icon`/`title`/`line`/`end`. */\n asChild?: boolean;\n}\n\n/**\n * THE pressable row / tile: two named layouts, two skins, no size. `className` places it\n * (width, grid cell); its height follows its text.\n */\nexport const Tile = React.forwardRef<HTMLButtonElement, TileProps>(\n (\n { layout = \"row\", variant = \"outline\", icon, title, wrapTitle, line, end, selected, selectedStyle, tooltip, level, fit, endInset, oneLine, dashed, hoverStyle, danger, dimmed, glyphTone, hero, tone, iconTone, dense, asChild = false, className, children, onClick, type, ...props },\n ref,\n ) => {\n const Component = asChild ? Slot : \"button\";\n const ariaDisabled = props[\"aria-disabled\"];\n const inert = ariaDisabled === true || ariaDisabled === \"true\";\n const body = (\n <>\n {icon ? (\n <span className=\"matrx-tile-icon\" data-tone={iconTone && iconTone !== \"neutral\" ? iconTone : undefined}>\n {icon}\n </span>\n ) : null}\n <span className=\"matrx-tile-text\">\n <span className=\"matrx-tile-title\">{title}</span>\n {line ? <span className=\"matrx-tile-line\">{line}</span> : null}\n </span>\n {end ? <span className=\"matrx-tile-end\">{end}</span> : null}\n </>\n );\n return (\n <Component\n ref={ref}\n type={asChild ? undefined : (type ?? \"button\")}\n data-matrx-tile=\"\"\n data-layout={layout}\n data-variant={variant}\n data-selected={selected ? \"\" : undefined}\n data-selected-style={selected && (selectedStyle === \"fill\" || selectedStyle === \"primary\") ? selectedStyle : undefined}\n data-level={level}\n data-fit={fit ? \"\" : undefined}\n data-one-line={oneLine ? \"\" : undefined}\n data-end-inset={endInset}\n data-dashed={dashed ? \"\" : undefined}\n data-hover-style={hoverStyle}\n title={tooltip}\n data-danger={danger ? \"\" : undefined}\n data-dimmed={dimmed ? \"\" : undefined}\n data-wrap-title={wrapTitle ? \"\" : undefined}\n data-glyph-tone={glyphTone}\n data-hero={hero ? \"\" : undefined}\n data-dense={dense ? \"\" : undefined}\n data-tone={tone}\n aria-pressed={asChild || selected === undefined ? undefined : selected}\n className={cn(\"matrx-tile\", className)}\n {...props}\n onClick={inert ? swallowClick : onClick}\n >\n {asChild && React.isValidElement(children) ? (\n React.cloneElement(children as React.ReactElement<{ children?: React.ReactNode }>, undefined, body)\n ) : (\n body\n )}\n </Component>\n );\n },\n);\nTile.displayName = \"Tile\";\n\n/* ------------------------------------------------------------------ */\n/* Section disclosure header */\n/* ------------------------------------------------------------------ */\n\nexport type DisclosureHeaderVariant = \"row\" | \"label\";\n\nexport interface DisclosureHeaderProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"title\"> {\n /** Whether the section under the header is showing. Sets `aria-expanded`. */\n open: boolean;\n /** `row` (default): a 13px/500 title — a collapsible section, a group of results, a \"details\"\n * fold. `label`: the 11px uppercase muted label that heads a sidebar or menu group. */\n variant?: DisclosureHeaderVariant;\n /** Optional 16px glyph after the chevron (row variant). */\n icon?: React.ReactNode;\n /** Colors ONLY the icon: a status tone uses its `-ink` token, a hue its `--matrx-chip-<hue>-ink`.\n * A section that carries a color (violet Organization, amber Projects) keeps it here. */\n glyphTone?: GlyphTone | ChipTone;\n /** The section's name. */\n title: React.ReactNode;\n /** A short muted fact after the title: a count, a size, \"3 of 12\". Never a sentence. */\n meta?: React.ReactNode;\n /** Trailing content pinned to the end (a status glyph, a count badge). Non-interactive — a\n * control beside the header sits outside it, never inside the button. */\n end?: React.ReactNode;\n /** One 12px secondary line under the title (row variant) — what the section holds. */\n line?: React.ReactNode;\n /** Where the turning chevron sits. `start` (default) leads the row; `end` trails it, for a\n * sidebar section whose label keeps the column's left edge. */\n chevron?: \"start\" | \"end\";\n}\n\n/**\n * THE section-disclosure header: a chevron that turns, a title, an optional count and trailing\n * status — one full-width pressable row that opens and closes the section below it. Every\n * \"click the heading to fold\" row is this, never a raw button with a hand-drawn chevron.\n */\nexport const DisclosureHeader = React.forwardRef<HTMLButtonElement, DisclosureHeaderProps>(\n ({ open, variant = \"row\", icon, glyphTone, title, meta, end, line, chevron = \"start\", className, type, ...props }, ref) => (\n <button\n ref={ref}\n type={type ?? \"button\"}\n aria-expanded={open}\n data-matrx-disclosure=\"\"\n data-variant={variant}\n data-open={open ? \"\" : undefined}\n data-chevron={chevron}\n className={cn(\"matrx-disclosure\", className)}\n {...props}\n >\n {chevron === \"start\" ? (\n <span className=\"matrx-disclosure-chevron\" aria-hidden=\"true\">\n <ChevronRightIcon />\n </span>\n ) : null}\n {icon ? (\n <span className=\"matrx-disclosure-icon\" data-glyph-tone={glyphTone}>\n {icon}\n </span>\n ) : null}\n {line ? (\n <span className=\"matrx-disclosure-text\">\n <span className=\"matrx-disclosure-title\">{title}</span>\n <span className=\"matrx-disclosure-line\">{line}</span>\n </span>\n ) : (\n <span className=\"matrx-disclosure-title\">{title}</span>\n )}\n {meta === undefined || meta === null || meta === false ? null : (\n <span className=\"matrx-disclosure-meta\">{meta}</span>\n )}\n {end ? <span className=\"matrx-disclosure-end\">{end}</span> : null}\n {chevron === \"end\" ? (\n <span className=\"matrx-disclosure-chevron\" data-end=\"\" aria-hidden=\"true\">\n <ChevronRightIcon />\n </span>\n ) : null}\n </button>\n ),\n);\nDisclosureHeader.displayName = \"DisclosureHeader\";\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 /**\n * Let the title wrap onto as many lines as it needs, for a sentence that must be read whole (a question with its\n * answer buttons beside it). Default false: one line, truncated.\n */\n wrap?: boolean;\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 wrap = false,\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 data-wrap={wrap ? \"\" : undefined}\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\";\nimport { keepMovedFocus } from \"./focus-return\";\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>(({ onCloseAutoFocus, ...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\" onCloseAutoFocus={keepMovedFocus(onCloseAutoFocus)} />;\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 honors `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 gap-2 sm:flex-row sm:justify-end sm:gap-0 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 * 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","\"use client\";\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 gray 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, MOTION_SHIMMER } 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 * How it says \"coming\": `pulse` (default, the whole box breathes) or `shimmer` — a soft band of light\n * crossing the box, for a picture still being made (a logo, a page screenshot). Reduced motion: the\n * shimmer stops traveling and breathes slowly.\n */\n motion?: \"pulse\" | \"shimmer\";\n /**\n * THE NAMED SHAPES (0.68.22) — a placeholder says what is coming, never a pasted `h-6 w-48`.\n * Derived from the call sites:\n * · `line` — a line of body text (14px, rounded);\n * · `title` — a heading (24px);\n * · `control` — a 28px capsule, where a button, field or select will be;\n * · `row` — a 36px list row;\n * · `block` — a region (a card, a chart, a panel); its height is `height`;\n * · `circle` — an avatar or a glyph disc (2.5rem round; `height` sizes it too).\n * Omit for the legacy free box.\n */\n shape?: SkeletonShape;\n /** A `block` / `circle`'s height: `sm` 3rem, `md` 5rem, `lg` 10rem, `xl` 16rem, `fill` the parent. */\n height?: SkeletonHeight;\n /** How much of the row it takes: `full` (default), a fraction, or a fixed `sm` 8rem / `md` 12rem / `lg` 16rem. */\n width?: SkeletonWidth;\n}\n\nexport type SkeletonShape = \"line\" | \"title\" | \"control\" | \"row\" | \"block\" | \"circle\";\nexport type SkeletonHeight = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"fill\";\nexport type SkeletonWidth = \"full\" | \"3/4\" | \"2/3\" | \"1/2\" | \"1/3\" | \"sm\" | \"md\" | \"lg\";\n\n/** Literal classes so a host's Tailwind scan of the package finds every one. */\nconst SHAPE_CLASS: Record<SkeletonShape, string> = {\n line: \"h-3.5 rounded\",\n title: \"h-6 rounded-md\",\n control: \"h-7 rounded-full\",\n row: \"h-9 rounded-md\",\n block: \"rounded-lg\",\n circle: \"aspect-square rounded-full\",\n};\nconst HEIGHT_CLASS: Record<SkeletonHeight, string> = {\n sm: \"h-12\",\n md: \"h-20\",\n lg: \"h-40\",\n xl: \"h-64\",\n fill: \"h-full\",\n};\nconst CIRCLE_SIZE_CLASS: Record<SkeletonHeight, string> = {\n sm: \"size-8\",\n md: \"size-10\",\n lg: \"size-16\",\n xl: \"size-24\",\n fill: \"h-full\",\n};\nconst WIDTH_CLASS: Record<SkeletonWidth, string> = {\n full: \"w-full\",\n \"3/4\": \"w-3/4\",\n \"2/3\": \"w-2/3\",\n \"1/2\": \"w-1/2\",\n \"1/3\": \"w-1/3\",\n sm: \"w-32 max-w-full\",\n md: \"w-48 max-w-full\",\n lg: \"w-64 max-w-full\",\n};\n\nexport function Skeleton({ className, animated = true, motion = \"pulse\", shape, height, width, ...props }: SkeletonProps) {\n const sized = shape === \"circle\"\n ? CIRCLE_SIZE_CLASS[height ?? \"md\"]\n : cn(\n shape && SHAPE_CLASS[shape],\n shape === \"block\" && HEIGHT_CLASS[height ?? \"md\"],\n shape && WIDTH_CLASS[width ?? \"full\"],\n );\n return (\n <div\n data-slot=\"skeleton\"\n data-shape={shape}\n data-motion={animated ? motion : undefined}\n className={cn(\n \"rounded-md bg-primary/10\",\n shape === \"circle\" && SHAPE_CLASS.circle,\n sized,\n animated && (motion === \"shimmer\" ? MOTION_SHIMMER : MOTION_PULSE),\n className,\n )}\n {...props}\n />\n );\n}\n","\"use client\";\n\n/**\n * NumberStepper — moved from matrx-frontend (chat host slot; the package default now).\n *\n * A compact number input with − / + stepper buttons on either side.\n * The input auto-sizes to its content in `ch` units so it always fits\n * exactly — no fixed width needed, works for 1 digit or 10 000+.\n *\n * Features:\n * - Auto-sizing input: width tracks the current draft string length in `ch`\n * - No browser-native spinner arrows (uses type=\"text\" + inputMode=\"numeric\")\n * - Validates only on blur or Enter — never interrupts mid-type editing\n * - Clearing the field is allowed; the committed value falls back to `fallback`\n * - Arrow-key stepping (↑ / ↓) works while the input is focused\n * - Buttons use onMouseDown + preventDefault so focus stays in the input\n * - Fully theme-aware: uses bg-background / text-foreground / border-input tokens\n * - THE ONE CONTROL's height by default (`--matrx-control-size`, 28px) and\n * its 13px label, so it lines up with Button / Select / Switch beside it;\n * a dense host may still pass a smaller height; width is automatic\n *\n * Props:\n * value – controlled numeric value\n * onChange – called with the new committed value\n * min – optional minimum (clamped on commit)\n * max – optional maximum (clamped on commit)\n * fallback – value to use when the field is empty or non-numeric (default 0)\n * step – amount to increment / decrement per button click (default 1)\n * minChars – minimum visible character width of the input area (default 2)\n * className – applied to the outer wrapper\n */\n\nimport { useState, useEffect } from \"react\";\nimport { cn } from \"../cn\";\nimport { MinusIcon, PlusIcon } from \"../icons\";\n\nexport interface NumberStepperProps {\n value: number;\n onChange: (v: number) => void;\n min?: number;\n max?: number;\n fallback?: number;\n step?: number;\n minChars?: number;\n className?: string;\n}\n\nexport function NumberStepper({\n value,\n onChange,\n min,\n max,\n fallback = 0,\n step = 1,\n minChars = 2,\n className,\n}: NumberStepperProps) {\n const [draft, setDraft] = useState(String(value));\n\n useEffect(() => {\n setDraft(String(value));\n }, [value]);\n\n const commit = (override?: number) => {\n const parsed = override !== undefined ? override : parseInt(draft, 10);\n let next = isNaN(parsed) ? fallback : parsed;\n if (min !== undefined) next = Math.max(min, next);\n if (max !== undefined) next = Math.min(max, next);\n setDraft(String(next));\n if (next !== value) onChange(next);\n };\n\n const nudge = (delta: number) => {\n const current = parseInt(draft, 10);\n const base = isNaN(current) ? (fallback ?? 0) : current;\n commit(base + delta);\n };\n\n const btnCls =\n \"flex items-center justify-center border border-input bg-background \" +\n \"text-muted-foreground hover:text-foreground hover:bg-muted \" +\n \"transition-colors select-none shrink-0 \" +\n \"h-full aspect-square leading-none\";\n\n return (\n <div\n className={cn(\n \"flex h-[var(--matrx-control-size,1.75rem)] items-stretch rounded-md overflow-hidden shrink-0\",\n className,\n )}\n >\n <button\n type=\"button\"\n onMouseDown={(e) => {\n e.preventDefault();\n nudge(-step);\n }}\n className={cn(btnCls, \"rounded-l-md border-r-0\")}\n tabIndex={-1}\n aria-label=\"Decrease\"\n >\n <MinusIcon width={12} height={12} strokeWidth={2.25} />\n </button>\n\n <input\n type=\"text\"\n inputMode=\"numeric\"\n value={draft}\n onChange={(e) => setDraft(e.target.value)}\n onBlur={() => commit()}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") {\n e.preventDefault();\n commit();\n }\n if (e.key === \"ArrowUp\") {\n e.preventDefault();\n nudge(step);\n }\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n nudge(-step);\n }\n }}\n style={{ width: `${Math.max(minChars, draft.length) + 3}ch` }}\n className={cn(\n \"border-y border-input bg-background text-foreground\",\n \"px-1.5 font-mono text-[length:var(--matrx-control-label,0.8125rem)] text-center outline-none\",\n \"focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring\",\n \"disabled:cursor-not-allowed disabled:opacity-50\",\n )}\n />\n\n <button\n type=\"button\"\n onMouseDown={(e) => {\n e.preventDefault();\n nudge(step);\n }}\n className={cn(btnCls, \"rounded-r-md border-l-0\")}\n tabIndex={-1}\n aria-label=\"Increase\"\n >\n <PlusIcon width={12} height={12} strokeWidth={2.25} />\n </button>\n </div>\n );\n}\n\n","\"use client\";\n\n/**\n * Slider — the range control (46 host import sites).\n *\n * Ported from matrx-frontend `components/ui/slider.tsx`. Two things the host\n * copy could not do, both fixed here rather than in a fork:\n *\n * 1. A 16px THUMB IS NOT A TOUCH TARGET. The stock thumb is `h-4 w-4`, well\n * under the 44px Apple HIG minimum, so a slider that worked with a mouse\n * was a coin-flip with a thumb. The visible thumb keeps its size (`size`\n * controls it), and an invisible `::after` pseudo-target expands the hit\n * area to 44px on coarse pointers without changing the layout — the same\n * trick `ResizableHandle` uses for mouse tolerance.\n *\n * 2. DENSITY IS A PROP, NOT A FORK (C18). `size=\"sm|md|lg\"` picks the track\n * height and thumb diameter together, so a dense admin panel and a\n * touch-first settings screen use ONE component.\n *\n * Multi-thumb ranges work: a `Thumb` is rendered per value, which is what\n * Radix requires and what the host copy (a single hardcoded Thumb) got wrong\n * for any `value` array longer than one.\n */\n\nimport * as SliderPrimitive from \"@radix-ui/react-slider\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nexport type SliderSize = \"sm\" | \"md\" | \"lg\";\n\nconst TRACK_CLASSES: Record<SliderSize, string> = {\n sm: \"h-1\",\n md: \"h-1.5\",\n lg: \"h-2.5\",\n};\n\nconst THUMB_CLASSES: Record<SliderSize, string> = {\n sm: \"h-3.5 w-3.5\",\n md: \"h-4 w-4\",\n lg: \"h-5 w-5\",\n};\n\nexport interface SliderProps\n extends React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root> {\n /** Track + thumb scale. Default `md`. */\n size?: SliderSize;\n}\n\nconst Slider = React.forwardRef<\n React.ComponentRef<typeof SliderPrimitive.Root>,\n SliderProps\n>(({ className, size = \"md\", ...props }, ref) => {\n // One Thumb per value — controlled `value` wins, then `defaultValue`, then\n // the single-thumb default. Radix renders nothing sensible if the count is\n // wrong, which is how the host copy silently dropped a range's upper thumb.\n const thumbCount = Math.max(\n 1,\n (props.value ?? props.defaultValue ?? [0]).length,\n );\n\n return (\n <SliderPrimitive.Root\n ref={ref}\n data-slot=\"slider\"\n className={cn(\n \"relative flex w-full touch-none select-none items-center data-[disabled]:opacity-50\",\n \"data-[orientation=vertical]:h-full data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col\",\n className,\n )}\n {...props}\n >\n <SliderPrimitive.Track\n data-slot=\"slider-track\"\n className={cn(\n \"relative w-full grow overflow-hidden rounded-full bg-primary/20\",\n TRACK_CLASSES[size],\n \"data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5\",\n )}\n >\n <SliderPrimitive.Range\n data-slot=\"slider-range\"\n className=\"absolute h-full bg-primary data-[orientation=vertical]:w-full\"\n />\n </SliderPrimitive.Track>\n {Array.from({ length: thumbCount }, (_, index) => (\n <SliderPrimitive.Thumb\n key={index}\n data-slot=\"slider-thumb\"\n // The thumb is the focusable slider: it carries the control's name (a label on the root alone leaves it unnamed).\n {...(props[\"aria-label\"] ? { \"aria-label\": props[\"aria-label\"] } : {})}\n {...(props[\"aria-valuetext\"] !== undefined ? { \"aria-valuetext\": props[\"aria-valuetext\"] } : {})}\n className={cn(\n \"relative block cursor-grab rounded-full border border-primary/50 bg-background shadow transition-colors active:cursor-grabbing\",\n \"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n // Ruling 1 — invisible 44px target, coarse pointers only, so a\n // dense desktop row keeps its exact hit behavior.\n \"after:absolute after:left-1/2 after:top-1/2 after:-translate-x-1/2 after:-translate-y-1/2 after:content-['']\",\n \"pointer-coarse:after:h-11 pointer-coarse:after:w-11\",\n THUMB_CLASSES[size],\n )}\n />\n ))}\n </SliderPrimitive.Root>\n );\n});\nSlider.displayName = SliderPrimitive.Root.displayName;\n\nexport { Slider };\n","\"use client\";\n\n/**\n * StageSteps — where a person is on a short path (\"Get a result → Make it an agent → Test & improve\").\n * One quiet row at control height (28px): a numbered mark per step, its label, a hairline between.\n * Steps before `current` are done (check), `current` is the filled primary mark with foreground text\n * (`aria-current=\"step\"`), later steps are muted. It only reports where you are — never a button row,\n * so it adds no choice to a header.\n *\n * `labels=\"current\"` keeps every mark but shows only the current step's label (a narrow header);\n * every hidden label stays the step's tooltip and accessible name. `labels=\"auto\"` shows every label\n * on wide screens and only the current one on a phone. Styles: controls.css `.matrx-stage-steps`.\n * Pinned by `stage-steps.test.tsx`.\n *\n * A long path (`maxVisible`) keeps the first and last steps and a window around the current one;\n * each run of hidden steps folds into one \"+N\" mark (its tooltip names them). The row never grows\n * past its container: labels truncate before anything spills.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { RadixCheckIcon } from \"../icons\";\n\nexport interface StageStep {\n id: string;\n label: string;\n}\n\nexport type StageState = \"done\" | \"current\" | \"upcoming\";\n\nexport interface StageStepsProps extends Omit<React.HTMLAttributes<HTMLOListElement>, \"children\"> {\n steps: readonly StageStep[];\n /** Index of the step the person is on; earlier steps read as done. Clamped to the list. */\n current: number;\n \"aria-label\": string;\n /**\n * \"all\" (default) shows every label; \"current\" only the current one (narrow headers); \"auto\"\n * every label on wide screens, only the current one under 640px.\n */\n labels?: \"all\" | \"current\" | \"auto\";\n /** At most this many marks (min 5); longer paths fold hidden runs into \"+N\". Default: all. */\n maxVisible?: number;\n}\n\nexport type StageSlot = { kind: \"step\"; index: number } | { kind: \"more\"; from: number; to: number };\n\n/**\n * Which marks a path of `count` steps draws with at most `maxVisible` marks: the first and last\n * step, a window around the current one, and one \"+N\" slot per hidden run. Pure (tested).\n */\nexport function stageSlots(count: number, current: number, maxVisible?: number): StageSlot[] {\n const all: StageSlot[] = Array.from({ length: count }, (_, index) => ({ kind: \"step\", index }));\n if (!maxVisible || count <= Math.max(5, maxVisible)) return all;\n const max = Math.max(5, Math.trunc(maxVisible));\n const at = Math.max(0, Math.min(count - 1, Math.trunc(current)));\n const size = max - 4; // first + last + up to two \"+N\" slots\n const start = Math.max(1, Math.min(count - 1 - size, at - Math.floor((size - 1) / 2)));\n const end = start + size - 1;\n const out: StageSlot[] = [{ kind: \"step\", index: 0 }];\n if (start > 1) out.push({ kind: \"more\", from: 1, to: start - 1 });\n for (let index = start; index <= end; index++) out.push({ kind: \"step\", index });\n if (end < count - 2) out.push({ kind: \"more\", from: end + 1, to: count - 2 });\n out.push({ kind: \"step\", index: count - 1 });\n return out;\n}\n\n/** The state each step draws in. Pure, so the rule is tested without a DOM. */\nexport function stageStates(count: number, current: number): StageState[] {\n const at = Math.max(0, Math.min(count - 1, Math.trunc(current)));\n return Array.from({ length: count }, (_, i) => (i < at ? \"done\" : i === at ? \"current\" : \"upcoming\"));\n}\n\nexport function StageSteps({ steps, current, labels = \"all\", maxVisible, className, ...props }: StageStepsProps) {\n const states = stageStates(steps.length, current);\n const slots = stageSlots(steps.length, current, maxVisible);\n return (\n <ol data-matrx-control=\"stage-steps\" data-labels={labels} className={cn(\"matrx-stage-steps\", className)} {...props}>\n {slots.map((slot, n) => {\n if (slot.kind === \"more\") {\n const hidden = steps.slice(slot.from, slot.to + 1);\n const state = states[slot.from];\n const names = hidden.map((step) => step.label).join(\", \");\n return (\n <li\n key={`more-${slot.from}`}\n data-stage=\"more\"\n data-state={state}\n title={names}\n aria-label={`${hidden.length} more steps: ${names}`}\n className=\"matrx-stage-steps-item\"\n >\n {n > 0 ? <span className=\"matrx-stage-steps-sep\" aria-hidden=\"true\" /> : null}\n <span className=\"matrx-stage-steps-more\" aria-hidden=\"true\">+{hidden.length}</span>\n </li>\n );\n }\n const i = slot.index;\n const step = steps[i]!;\n const state = states[i];\n return (\n <li\n key={step.id}\n data-stage={step.id}\n data-state={state}\n aria-current={state === \"current\" ? \"step\" : undefined}\n title={step.label}\n className=\"matrx-stage-steps-item\"\n >\n {n > 0 ? <span className=\"matrx-stage-steps-sep\" aria-hidden=\"true\" /> : null}\n <span className=\"matrx-stage-steps-mark\" aria-hidden=\"true\">\n {state === \"done\" ? <RadixCheckIcon /> : i + 1}\n </span>\n <span className=\"matrx-stage-steps-label\">\n {step.label}\n {state === \"done\" ? <span className=\"matrx-sr-only\"> (done)</span> : null}\n </span>\n </li>\n );\n })}\n </ol>\n );\n}\n","\"use client\";\n\n/**\n * Checklist — conditions a person works through, each with a status mark, and a meter over them.\n *\n * `ChecklistItem` is one condition: a 16px mark (done = filled success disc with a check, open =\n * a warning ring, unknown = a dashed muted ring), a 13px title, one 12px line (one line, full text\n * in its tooltip) and an optional end slot for the ONE action that fixes it. Under 640px the end\n * slot drops under the text, on the text's left edge. `ChecklistMeter` heads a group: its name,\n * \"N of M\" and one segment per condition, met segments in success. A status word goes in `end`\n * (a `Badge`). Neither draws a frame: they sit inside the caller's card.\n *\n * First caller: the brand page's research readiness (2026-10-23). Pinned by `checklist.test.tsx`.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { CheckIcon } from \"../icons\";\n\nexport type ChecklistState = \"done\" | \"open\" | \"unknown\";\n\nconst STATE_WORD: Record<ChecklistState, string> = {\n done: \"Met\",\n open: \"Missing\",\n unknown: \"Not measured\",\n};\n\nexport function ChecklistMark({ state, className }: { state: ChecklistState; className?: string }) {\n return (\n <span\n data-matrx-checklist-mark=\"\"\n data-state={state}\n role=\"img\"\n aria-label={STATE_WORD[state]}\n className={cn(\n \"grid size-4 shrink-0 place-items-center rounded-full\",\n state === \"done\" && \"bg-success text-success-foreground\",\n state === \"open\" && \"border-2 border-warning\",\n state === \"unknown\" && \"border-2 border-dashed border-muted-foreground\",\n className,\n )}\n >\n {state === \"done\" ? <CheckIcon className=\"size-3\" strokeWidth={3} /> : null}\n </span>\n );\n}\n\nexport interface ChecklistProps extends React.HTMLAttributes<HTMLUListElement> {\n \"aria-label\"?: string;\n}\n\n/** The list around `ChecklistItem`s: no frame, no gap of its own beyond the rows. */\nexport function Checklist({ className, children, ...props }: ChecklistProps) {\n return (\n <ul data-matrx-checklist=\"\" className={cn(\"grid min-w-0\", className)} {...props}>\n {children}\n </ul>\n );\n}\n\nexport interface ChecklistItemProps extends Omit<React.LiHTMLAttributes<HTMLLIElement>, \"title\"> {\n state: ChecklistState;\n /** The condition, in a few words. */\n title: React.ReactNode;\n /** One line under the title: what was measured, or what is missing. Its full text is the tooltip. */\n line?: string | null;\n /** The one action that fixes this condition (a `Button`). */\n end?: React.ReactNode;\n}\n\nexport function ChecklistItem({ state, title, line, end, className, ...props }: ChecklistItemProps) {\n return (\n <li\n data-matrx-checklist-item=\"\"\n data-state={state}\n className={cn(\n \"grid min-w-0 grid-cols-[auto_minmax(0,1fr)] items-start gap-x-2 py-1.5 sm:grid-cols-[auto_minmax(0,1fr)_auto]\",\n className,\n )}\n {...props}\n >\n <ChecklistMark state={state} className=\"mt-0.5\" />\n <div className=\"min-w-0\">\n <div className=\"type-title truncate text-foreground\">{title}</div>\n {line ? (\n <div className=\"type-secondary truncate text-muted-foreground\" title={line}>\n {line}\n </div>\n ) : null}\n </div>\n {end ? (\n <div className=\"col-start-2 mt-1.5 flex justify-start sm:col-start-3 sm:row-start-1 sm:mt-0 sm:justify-end sm:self-center\">\n {end}\n </div>\n ) : null}\n </li>\n );\n}\n\nexport interface ChecklistMeterProps {\n /** The group's name (\"What others say\"). */\n label: React.ReactNode;\n met: number;\n total: number;\n /** A status word after the count (a `Badge`). */\n end?: React.ReactNode;\n className?: string;\n}\n\n/** A group's head: name, \"N of M\" and one segment per condition. */\nexport function ChecklistMeter({ label, met, total, end, className }: ChecklistMeterProps) {\n const done = Math.max(0, Math.min(total, met));\n return (\n <div data-matrx-checklist-meter=\"\" className={cn(\"grid min-w-0 gap-1.5\", className)}>\n <div className=\"flex min-w-0 items-center gap-2\">\n <span className=\"type-title min-w-0 truncate text-foreground\">{label}</span>\n <span className=\"type-meta shrink-0 tabular-nums text-muted-foreground\">\n {done} of {total}\n </span>\n {end ? <span className=\"ml-auto flex shrink-0 items-center\">{end}</span> : null}\n </div>\n <div\n role=\"meter\"\n aria-valuemin={0}\n aria-valuemax={total}\n aria-valuenow={done}\n aria-label={`${done} of ${total} met`}\n className=\"flex gap-1\"\n >\n {Array.from({ length: total }, (_, i) => (\n <span\n key={i}\n data-filled={i < done ? \"\" : undefined}\n className={cn(\"h-1.5 flex-1 rounded-full\", i < done ? \"bg-success\" : \"bg-border\")}\n />\n ))}\n </div>\n </div>\n );\n}\n","\"use client\";\n\n// The ONE integer field (moved from matrx-frontend components/official, 2026-10-08; before that\n// features/marketing/components/shared,\n// 2026-10-01). A number field bound straight to a number state paints \"04\":\n// clearing it parses to 0, the next keystroke makes the DOM value \"04\", and\n// React leaves it because \"04\" == 4 (verify-6 #3, flashcards \"Number of\n// cards\"). This keeps a text draft while typing and clamps on blur or Enter,\n// so the field can go empty and never shows a leading zero.\n\nimport { useEffect, useState } from \"react\";\nimport { Input } from \"./doors\";\n\nexport type ClampedNumberInputProps = {\n id?: string;\n value: number;\n min: number;\n /** Omit while the ceiling is still being read. */\n max?: number | null;\n /** Fractional values (ratios, prices). Integers by default. */\n decimal?: boolean;\n /** HTML step; defaults to 1 for integers and \"any\" for decimals. */\n step?: number | \"any\";\n disabled?: boolean;\n className?: string;\n \"aria-label\"?: string;\n \"data-testid\"?: string;\n title?: string;\n onChange: (value: number) => void;\n /**\n * The number the field shows right now when it is a value it would keep as typed, else null\n * (empty, or out of range until blur clamps it). A label that repeats the count (\"Make 5\n * cards\") reads this, so it never names a number the field does not show (verify-7 #3).\n */\n onDraftChange?: (shown: number | null) => void;\n};\n\n/** The number a draft shows when it is exactly a value the field would keep, else null. */\nexport function shownDraft(raw: string, min: number, max?: number | null, decimal = false): number | null {\n const next = clampDraft(raw, min, max, decimal);\n if (next === null) return null;\n return String(next) === raw.replace(/^0+(?=\\d)/, \"\") ? next : null;\n}\n\n/** The committed value for a typed draft, or null to restore the last value. */\nexport function clampDraft(\n raw: string,\n min: number,\n max?: number | null,\n decimal = false,\n): number | null {\n const parsed = decimal ? Number.parseFloat(raw) : Number.parseInt(raw, 10);\n if (Number.isNaN(parsed)) return null;\n const floored = Math.max(min, parsed);\n return max === undefined || max === null ? floored : Math.min(max, floored);\n}\n\n/**\n * Controlled integer input that lets the field go empty while typing. An\n * in-range number commits as it is typed; clamp / restore of anything else\n * happens on blur or Enter — never mid-keystroke.\n */\nexport function ClampedNumberInput({\n id,\n value,\n min,\n max,\n decimal = false,\n step,\n disabled,\n className,\n \"aria-label\": ariaLabel,\n \"data-testid\": testId,\n title,\n onChange,\n onDraftChange,\n}: ClampedNumberInputProps) {\n const [draft, setDraftState] = useState(String(value));\n // Reported in the same event as the keystroke, so a label repeating the count is never one\n // render behind the field.\n const setDraft = (raw: string) => {\n setDraftState(raw);\n onDraftChange?.(shownDraft(raw, min, max, decimal));\n };\n\n useEffect(() => {\n setDraftState(String(value));\n onDraftChange?.(shownDraft(String(value), min, max, decimal));\n }, [value, min, max, decimal, onDraftChange]);\n\n const commit = (raw: string) => {\n const next = clampDraft(raw, min, max, decimal);\n if (next === null) {\n setDraft(String(value));\n return;\n }\n setDraft(String(next));\n if (next !== value) onChange(next);\n };\n\n return (\n <Input\n id={id}\n type=\"number\"\n inputMode={decimal ? \"decimal\" : \"numeric\"}\n step={step ?? (decimal ? \"any\" : 1)}\n min={min}\n max={max ?? undefined}\n disabled={disabled}\n aria-label={ariaLabel}\n data-testid={testId}\n title={title}\n className={className}\n value={draft}\n onChange={(event) => {\n const raw = event.target.value;\n setDraft(raw);\n // An in-range value is the value now (a \"Make 10 cards\" button must\n // not lag the field until blur); anything else waits for blur.\n const next = shownDraft(raw, min, max, decimal);\n if (next !== null && next !== value) onChange(next);\n }}\n onBlur={(event) => commit(event.target.value)}\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n event.currentTarget.blur();\n }\n }}\n />\n );\n}\n","\"use client\";\n// LightSwitchToggle — moved from matrx-frontend components/matrx (chat host slot; the package default now).\n\nimport { useState, forwardRef } from \"react\";\nimport { cn } from \"../cn\";\n\nconst defaultSizes = {\n width: \"w-48\",\n height: \"h-16\",\n} as const;\n\nexport interface LightSwitchToggleProps {\n variant?: \"rounded\" | \"geometric\" | string;\n defaultValue?: boolean;\n value?: boolean;\n onChange?: (value: boolean) => void;\n width?: string;\n height?: string;\n labels?: {\n on: string;\n off: string;\n };\n disabled?: boolean;\n className?: string;\n}\n\nconst LightSwitchToggle = forwardRef<HTMLDivElement, LightSwitchToggleProps>(\n (\n {\n variant,\n defaultValue = false,\n value,\n onChange,\n width,\n height,\n labels = { on: \"ON\", off: \"OFF\" },\n disabled = false,\n className,\n }: LightSwitchToggleProps,\n ref,\n ) => {\n const [internalState, setInternalState] = useState(defaultValue);\n const validVariant = variant === \"geometric\" ? \"geometric\" : \"rounded\";\n\n const isOn = value !== undefined ? value : internalState;\n\n const handleToggle = (newState: boolean) => {\n if (disabled) return;\n if (value === undefined) {\n setInternalState(newState);\n }\n onChange?.(newState);\n };\n\n const containerClasses = cn(\n \"relative flex bg-muted shadow-inner overflow-hidden\",\n width || defaultSizes.width,\n height || defaultSizes.height,\n validVariant === \"rounded\" && \"rounded-full\",\n disabled && \"opacity-50 cursor-not-allowed\",\n className,\n );\n\n const buttonBaseClasses =\n \"relative w-1/2 h-full transition-all duration-300\";\n const activeButtonClasses =\n \"bg-primary transform -translate-y-px shadow-[inset_0_1px_3px_rgba(0,0,0,0.2)]\";\n const inactiveButtonClasses = \"bg-muted/60 transform -translate-y-1.5\";\n\n const renderOption = (\n isActive: boolean,\n label: string,\n side: \"left\" | \"right\",\n onClick: () => void,\n ) => (\n <button\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n aria-pressed={isActive}\n className={cn(\n buttonBaseClasses,\n isActive ? activeButtonClasses : inactiveButtonClasses,\n )}\n >\n <div\n className={cn(\n \"absolute inset-0\",\n side === \"left\"\n ? \"border-r border-border\"\n : \"border-l border-border\",\n validVariant === \"rounded\" &&\n (side === \"left\" ? \"rounded-l-full\" : \"rounded-r-full\"),\n isActive\n ? \"bg-gradient-to-br from-primary/90 via-primary to-primary/90\"\n : \"bg-gradient-to-br from-muted/70 via-muted/50 to-muted/70 dark:from-muted/40 dark:via-muted/30 dark:to-muted/40\",\n )}\n />\n <span\n className={cn(\n \"relative z-20 font-semibold text-xs truncate px-1 transition-colors\",\n isActive ? \"text-primary-foreground\" : \"text-muted-foreground\",\n )}\n >\n {label}\n </span>\n </button>\n );\n\n return (\n <div className=\"flex items-center justify-center\">\n <div ref={ref} className={containerClasses}>\n <div className=\"absolute left-1/2 top-0 bottom-0 w-[2px] bg-border transform -translate-x-1/2 z-10\" />\n {renderOption(!isOn, labels.off, \"left\", () => handleToggle(false))}\n {renderOption(isOn, labels.on, \"right\", () => handleToggle(true))}\n </div>\n </div>\n );\n },\n);\n\nLightSwitchToggle.displayName = \"LightSwitchToggle\";\n\nexport { LightSwitchToggle };\n","\"use client\";\n\n/**\n * OptionCombobox — a single-select over a string option list, searchable.\n *\n * The house choice rule (features/agents/utils/choice-rule.ts): pills for up to\n * four short options, a plain select up to twelve, and THIS above twelve — a\n * list that long is scanned by typing, never by scrolling a pill wall. Groups\n * are optional; a group marked `collapsed` shows behind a \"More\" row until the\n * person opens it, searches, or its option is the current value.\n *\n * Two trigger looks: `field` (bordered, matches SelectTrigger) and `inline`\n * (borderless, for dense settings rows).\n */\n\nimport { useState, type ReactNode } from \"react\";\nimport { CheckIcon, ChevronRightIcon as ChevronRight } from \"../icons\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../popover\";\nimport { SelectChevron } from \"../select\";\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from \"../command\";\nimport { cn } from \"../cn\";\n\nexport interface OptionComboboxGroup {\n heading?: string;\n options: string[];\n /** Hidden behind a \"More\" row until opened (or searched, or selected). */\n collapsed?: boolean;\n}\n\nexport interface OptionComboboxProps {\n value: string;\n onChange: (value: string) => void;\n /** Flat list — or pass `groups`. */\n options?: readonly string[] | undefined;\n groups?: OptionComboboxGroup[] | undefined;\n /** Display text for an option (defaults to the option itself). */\n getLabel?: ((option: string) => string) | undefined;\n /** Secondary text shown muted after the label. */\n getHint?: ((option: string) => string | null | undefined) | undefined;\n /** Leading visual for an option (e.g. a ratio shape). */\n renderIcon?: ((option: string) => ReactNode) | undefined;\n placeholder?: string | undefined;\n searchPlaceholder?: string | undefined;\n /** Hide the search box (short grouped lists). */\n searchable?: boolean | undefined;\n variant?: \"field\" | \"inline\" | undefined;\n compact?: boolean | undefined;\n disabled?: boolean | undefined;\n id?: string | undefined;\n ariaLabel?: string | undefined;\n className?: string | undefined;\n}\n\nexport function OptionCombobox({\n value,\n onChange,\n options,\n groups: groupsProp,\n getLabel = (o) => o,\n getHint,\n renderIcon,\n placeholder = \"Choose…\",\n searchPlaceholder = \"Search…\",\n searchable = true,\n variant = \"field\",\n compact = false,\n disabled = false,\n id,\n ariaLabel,\n className,\n}: OptionComboboxProps) {\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState(\"\");\n const [showMore, setShowMore] = useState(false);\n\n const groups: OptionComboboxGroup[] = groupsProp ?? [\n { options: [...(options ?? [])] },\n ];\n const q = query.trim().toLowerCase();\n const matches = (o: string) =>\n !q ||\n o.toLowerCase().includes(q) ||\n getLabel(o).toLowerCase().includes(q) ||\n (getHint?.(o) ?? \"\").toLowerCase().includes(q);\n\n const hasValue = value !== \"\";\n const hint = hasValue ? getHint?.(value) : null;\n\n const pick = (o: string) => {\n onChange(o);\n setOpen(false);\n setQuery(\"\");\n };\n\n return (\n <Popover\n open={open}\n onOpenChange={(next) => {\n setOpen(next);\n if (!next) {\n setQuery(\"\");\n setShowMore(false);\n }\n }}\n >\n <PopoverTrigger asChild disabled={disabled}>\n <button\n id={id}\n type=\"button\"\n role=\"combobox\"\n aria-expanded={open}\n aria-label={ariaLabel}\n className={cn(\n \"flex w-full min-w-0 items-center gap-2 text-left transition-colors\",\n \"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\",\n \"disabled:cursor-not-allowed disabled:opacity-50\",\n variant === \"field\"\n ? cn(\n // The one field surface (design-system FIELD_SURFACE_CLASS) — never gray beside a Select.\n \"rounded-md border border-border bg-card px-3 shadow-xs hover:bg-accent/40\",\n compact ? \"h-8 text-xs\" : \"h-9 text-sm\",\n )\n : \"h-7 rounded px-1 text-xs font-medium text-muted-foreground hover:text-foreground\",\n className,\n )}\n >\n {hasValue && renderIcon?.(value)}\n <span\n className={cn(\n \"min-w-0 flex-1 truncate\",\n !hasValue && \"text-muted-foreground\",\n )}\n >\n {hasValue ? getLabel(value) : placeholder}\n {hint && (\n <span className=\"ml-1.5 text-muted-foreground\">{hint}</span>\n )}\n </span>\n <SelectChevron size=\"sm\" className={variant === \"inline\" ? \"h-3 w-3\" : undefined} />\n </button>\n </PopoverTrigger>\n <PopoverContent\n sizing=\"content\"\n align=\"start\"\n className=\"p-0\"\n >\n <Command shouldFilter={false}>\n {searchable && (\n <CommandInput\n placeholder={searchPlaceholder}\n value={query}\n onValueChange={setQuery}\n />\n )}\n <CommandList className=\"max-h-72\">\n <CommandEmpty>No match for “{query}”.</CommandEmpty>\n {groups.map((group, gi) => {\n const visible = group.options.filter(matches);\n if (visible.length === 0) return null;\n const folded =\n group.collapsed &&\n !showMore &&\n !q &&\n !group.options.includes(value);\n if (folded) {\n return (\n <CommandGroup key={`g-${gi}`}>\n <CommandItem\n value={`__more_${gi}`}\n onSelect={() => setShowMore(true)}\n className=\"text-muted-foreground\"\n >\n <ChevronRight className=\"h-3.5 w-3.5\" />\n {group.heading ?? \"More\"}\n <span className=\"ml-auto type-secondary tabular-nums\">\n {group.options.length}\n </span>\n </CommandItem>\n </CommandGroup>\n );\n }\n return (\n <CommandGroup key={`g-${gi}`} heading={group.heading}>\n {visible.map((o) => {\n const selected = o === value;\n const h = getHint?.(o);\n return (\n <CommandItem\n key={o}\n value={o}\n onSelect={() => pick(o)}\n className=\"gap-2\"\n >\n {renderIcon?.(o)}\n <span className=\"min-w-0 flex-1 truncate\">\n {getLabel(o)}\n {h && (\n <span className=\"ml-1.5 text-muted-foreground\">\n {h}\n </span>\n )}\n </span>\n <CheckIcon\n className={cn(\n \"h-3.5 w-3.5 shrink-0\",\n selected ? \"opacity-100\" : \"opacity-0\",\n )}\n />\n </CommandItem>\n );\n })}\n </CommandGroup>\n );\n })}\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n );\n}\n","\"use client\";\n\n/**\n * Command — ported verbatim from matrx-frontend `components/ui/command.tsx`.\n *\n * `cmdk` is a SANCTIONED REAL DEPENDENCY (the vaul ↔ BottomSheet precedent):\n * the filtering/scoring/keyboard engine IS the component's product — there is\n * no Command palette without it, and reimplementing type-ahead ranking plus\n * roving keyboard selection would twin a maintained library rather than our\n * own code. See FEATURE.md.\n *\n * Seam inversions:\n * - `MagnifyingGlassIcon` comes from the package's inlined SVGs (C19), not\n * @radix-ui/react-icons.\n * - `CommandDialog` composed the host dialog module (`Dialog`, `DialogContent`,\n * `DialogTitle`). Those pieces are inlined privately below with identical\n * behavior — modal context, overlay, desktop card / mobile bottom-sheet\n * geometry, close control, portal — except the host's popout-aware\n * `DialogPortal` becomes the package's `PortalContainerProvider` seam\n * (plus an explicit `container` prop, which keeps top priority).\n * - The host's `useIsMobile` (a plain matchMedia breakpoint hook, not\n * host-shaped) became the package's own `./use-is-mobile`, with the same\n * 768px breakpoint. It started life inlined here; `Dialog` needed the same\n * answer, so it moved to a module both read rather than being copied.\n */\n\nimport type { DialogProps } from \"@radix-ui/react-dialog\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { keepFloatingLayersInside, useModalLayer } from \"./floating-layer\";\nimport {\n CENTERED_DIALOG,\n MOTION_BOTTOM_SHEET,\n MOTION_DIALOG,\n MOTION_OVERLAY,\n} from \"./motion\";\nimport { CloseControl, CloseRow, CloseSlotProvider, SearchRowCloseSlotProvider, useCloseSlot, useSearchRowCloseSlotClaim } from \"./close-slot\";\nimport { MagnifyingGlassIcon } from \"./icons\";\nimport { usePortalContainer } from \"./portal-container\";\nimport {\n RadixDialogModalProvider,\n useRadixDialogModal,\n} from \"./radix-dialog-modal-context\";\nimport { useIsMobile } from \"./use-is-mobile\";\n\nexport const Command = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground\",\n className,\n )}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\n/* ------------------------------------------------------------------ */\n/* Private dialog internals for CommandDialog (host dialog module, */\n/* behavior-identical, portal seam inverted). */\n/* ------------------------------------------------------------------ */\n\nconst DIALOG_DESKTOP_CLASSES =\n `fixed left-[50%] top-[50%] z-[10000] grid min-w-0 w-full max-w-lg ${CENTERED_DIALOG} gap-4 overflow-x-clip border bg-background p-6 shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full sm:rounded-lg`;\n\nconst DIALOG_MOBILE_SHEET_CLASSES =\n \"fixed inset-x-0 bottom-0 left-0 right-0 top-auto z-[10000] flex min-w-0 flex-col w-full max-w-full max-h-[90dvh] translate-x-0 translate-y-0 gap-4 overflow-x-clip border-t bg-background p-4 pb-safe shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full rounded-t-2xl rounded-b-none overflow-y-auto overscroll-contain\";\n\n// Re-asserted LAST so the sheet geometry always wins over any caller className.\nconst DIALOG_MOBILE_SHEET_OVERRIDE =\n \"inset-x-0 bottom-0 left-0 right-0 top-auto translate-x-0 translate-y-0 w-full max-w-full max-h-[90dvh] rounded-b-none rounded-t-2xl overflow-y-auto\";\n\nconst CommandDialogContent = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n container?: HTMLElement | null;\n }\n>(({ className, children, container, onInteractOutside, ...props }, ref) => {\n const isMobile = useIsMobile();\n const isModal = useRadixDialogModal();\n useModalLayer(isModal);\n const portalContainer = usePortalContainer(container);\n // The × is the last item of the search row (close-slot.tsx); a palette with\n // no CommandInput gets a close row of its own.\n const closeSlot = useCloseSlot(true);\n return (\n <DialogPrimitive.Portal container={portalContainer}>\n {isModal ? (\n <DialogPrimitive.Overlay\n className={cn(\n \"fixed inset-0 z-[10000] bg-[var(--matrx-overlay-scrim-soft)]\",\n MOTION_OVERLAY,\n )}\n />\n ) : null}\n <DialogPrimitive.Content\n ref={ref}\n aria-modal={isModal || undefined}\n aria-describedby={undefined}\n className={cn(\n isMobile ? DIALOG_MOBILE_SHEET_CLASSES : DIALOG_DESKTOP_CLASSES,\n isMobile ? MOTION_BOTTOM_SHEET : MOTION_DIALOG,\n className,\n isMobile && DIALOG_MOBILE_SHEET_OVERRIDE,\n !isModal && \"z-[900]\",\n )}\n {...props}\n onInteractOutside={keepFloatingLayersInside(onInteractOutside)}\n >\n {closeSlot.slot && !closeSlot.claimed ? <CloseRow className=\"px-4 pt-4\" /> : null}\n {/* A header inside a palette never reaches past it to an outer Dialog's slot. */}\n <CloseSlotProvider value={null}>\n <SearchRowCloseSlotProvider value={closeSlot.slot}>{children}</SearchRowCloseSlotProvider>\n </CloseSlotProvider>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n );\n});\nCommandDialogContent.displayName = \"CommandDialogContent\";\n\nexport interface CommandDialogProps extends DialogProps {\n /** Explicit portal target for the dialog; beats the injected seam. */\n container?: HTMLElement | null;\n}\n\nexport const CommandDialog = ({\n children,\n container,\n ...props\n}: CommandDialogProps) => {\n const modal = props.modal ?? true;\n return (\n <RadixDialogModalProvider modal={modal}>\n <DialogPrimitive.Root {...props} modal={modal}>\n <CommandDialogContent\n className=\"overflow-hidden p-0\"\n {...(container !== undefined ? { container } : {})}\n >\n <DialogPrimitive.Title className=\"sr-only\"></DialogPrimitive.Title>\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </CommandDialogContent>\n </DialogPrimitive.Root>\n </RadixDialogModalProvider>\n );\n};\n\nexport const CommandInput = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\n>(({ className, ...props }, ref) => {\n // Inside a CommandDialog the search row owns the × (never a combobox's input in a Dialog).\n const ownsClose = useSearchRowCloseSlotClaim();\n return (\n <div className=\"flex items-center gap-2 border-b px-3\" cmdk-input-wrapper=\"\">\n <MagnifyingGlassIcon className=\"h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"flex h-10 w-full min-w-0 rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:text-disabled-foreground\",\n className,\n )}\n {...props}\n />\n {ownsClose ? <CloseControl className=\"-mr-1\" /> : null}\n </div>\n );\n});\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\n/**\n * The × for a CommandDialog whose search row is the caller's own (chips, a raw\n * input): put `<CommandRowClose />` last in that row and it claims the palette's\n * slot like `CommandInput` does — never an empty close row above the search.\n * Outside a CommandDialog it draws nothing.\n */\nexport function CommandRowClose({ className }: { className?: string }): React.ReactElement | null {\n const owns = useSearchRowCloseSlotClaim();\n return owns ? <CloseControl className={cn(\"-mr-1\", className)} /> : null;\n}\n\nexport const CommandList = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\"max-h-[300px] overflow-y-auto overflow-x-hidden\", className)}\n {...props}\n />\n));\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nexport const CommandEmpty = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty\n ref={ref}\n className=\"py-6 text-center text-sm\"\n {...props}\n />\n));\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nexport const CommandGroup = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground\",\n className,\n )}\n {...props}\n />\n));\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nexport const CommandSeparator = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 h-px bg-border\", className)}\n {...props}\n />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nexport const CommandItem = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:text-disabled-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n className,\n )}\n {...props}\n />\n));\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nexport const CommandShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n \"ml-auto text-xs tracking-widest text-muted-foreground\",\n className,\n )}\n {...props}\n />\n );\n};\nCommandShortcut.displayName = \"CommandShortcut\";\n","\"use client\";\n\n/**\n * THE CLOSE CONTROL LIVES IN A ROW, NEVER IN A CORNER.\n *\n * The stock shadcn dialog pins its × with `absolute right-4 top-4`: a\n * coordinate guess about how tall the content's first row will be. Every\n * content whose first row is a different height got an × floating off its\n * row — the command palette's sat 12px below its 48px search row, on the\n * divider, with the query running underneath it (Arman, 2026-10-20: \"each\n * time they use this component, we end up with a very oddly placed x\").\n * Agents re-typed that snippet from memory faster than it could be fixed.\n *\n * So the × is a flex item of the row it belongs to, centered by layout:\n *\n * - `CommandInput` inside a `CommandDialog` draws it at the end of the\n * search row.\n * - `DialogHeader` / `SheetHeader` draw it at the end of the header row and\n * CLAIM it, so the content does not draw a second one; with two headers the\n * first one mounted draws it.\n * - Content with no visible header gets a close row of its own at the top,\n * in flow — it takes space, it never covers anything.\n *\n * Guard: `close-in-flow.test.tsx` — no `*.Close` in this package or its\n * consumers carries `absolute`/`fixed`, and each surface puts the × inside\n * its row.\n */\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { XIcon } from \"./icons\";\n\n/** 44px on touch, 32px from `lg`; a flex item, never positioned. */\nconst CLOSE_CONTROL_CLASSES =\n \"flex h-11 w-11 shrink-0 items-center justify-center rounded-sm text-muted-foreground ring-offset-background transition-colors hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none lg:h-8 lg:w-8\";\n\nexport function CloseControl({ className }: { className?: string }): React.ReactElement {\n return (\n <DialogPrimitive.Close data-slot=\"dialog-close\" aria-label=\"Close\" className={cn(CLOSE_CONTROL_CLASSES, className)}>\n <XIcon className=\"h-4 w-4\" aria-hidden=\"true\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n );\n}\n\ninterface CloseSlot {\n /** A row takes the × into itself; returns the release. The FIRST live claimant owns it. */\n claim(id: string): () => void;\n /** The id that draws the ×, or null while nobody claims it. */\n owner: string | null;\n}\n\n/** Dialog and Sheet: claimed by their header. */\nconst CloseSlotContext = React.createContext<CloseSlot | null>(null);\n/**\n * CommandDialog: claimed by its search row only. A separate context so a\n * CommandInput in a combobox (Popover > Command) opened INSIDE a Dialog never\n * takes the dialog's × — context crosses portals, and that × closes the dialog.\n */\nconst SearchRowCloseSlotContext = React.createContext<CloseSlot | null>(null);\n\n/**\n * For a content surface: returns the provider value and whether a row has\n * claimed the ×. Unclaimed (no header, or only an `sr-only`/`hidden` one) the\n * content draws `<CloseRow />` first, in flow. Claims land in a layout effect,\n * so the fallback never paints when a row takes it.\n */\nexport function useCloseSlot(enabled: boolean): { slot: CloseSlot | null; claimed: boolean } {\n const [claims, setClaims] = React.useState<string[]>([]);\n const owner = claims[0] ?? null;\n const claim = React.useCallback((id: string) => {\n setClaims((list) => [...list, id]);\n return () => setClaims((list) => list.filter((c) => c !== id));\n }, []);\n const slot = React.useMemo<CloseSlot | null>(() => (enabled ? { claim, owner } : null), [enabled, claim, owner]);\n return { slot, claimed: owner !== null };\n}\n\nexport const CloseSlotProvider = CloseSlotContext.Provider;\nexport const SearchRowCloseSlotProvider = SearchRowCloseSlotContext.Provider;\n\nfunction useClaim(context: React.Context<CloseSlot | null>, declined: boolean): boolean {\n const slot = React.useContext(context);\n const id = React.useId();\n const claim = slot?.claim;\n const wants = claim !== undefined && !declined;\n // Depends on the stable `claim`, never on `owner`, so a change of owner never re-claims.\n React.useLayoutEffect(() => (wants && claim ? claim(id) : undefined), [wants, claim, id]);\n return wants && slot?.owner === id;\n}\n\n/** For a header row: claims the Dialog/Sheet slot; true when this row draws the ×. */\nexport function useCloseSlotClaim(declined = false): boolean {\n return useClaim(CloseSlotContext, declined);\n}\n\n/** For CommandInput: claims only a CommandDialog's slot; true when this row draws the ×. */\nexport function useSearchRowCloseSlotClaim(): boolean {\n return useClaim(SearchRowCloseSlotContext, false);\n}\n\n/** The fallback: a row of its own at the top of the content. */\nexport function CloseRow({ className }: { className?: string }): React.ReactElement {\n return (\n <div data-slot=\"close-row\" className={cn(\"flex justify-end\", className)}>\n <CloseControl />\n </div>\n );\n}\n\n/** Classes that lay out a header's CHILDREN; they move to the header's body. */\nconst BODY_LAYOUT = /^!?(?:[a-z0-9]+:)*(?:flex|grid|flex-(?:row|col)(?:-reverse)?|grid-(?:cols|rows|flow)-\\S+|place-\\S+|items-\\S+|justify-\\S+|content-\\S+|gap(?:-[xy])?-\\S+|space-[xy]-\\S+|text-(?:left|center|right|start|end)|flex-wrap|flex-nowrap)$/;\n/**\n * Right padding a header carried to clear the old corner ×; with the × in the\n * row it would only push the × inward, so it is dropped.\n */\nconst OLD_CLOSE_RESERVE = /^pr-(?:8|9|10|11|12|14|16)$/;\n\nfunction splitHeaderClasses(className: string | undefined): { row: string; body: string } {\n const row: string[] = [];\n const body: string[] = [];\n for (const c of (className ?? \"\").split(/\\s+/)) {\n if (!c || OLD_CLOSE_RESERVE.test(c)) continue;\n (BODY_LAYOUT.test(c) ? body : row).push(c);\n }\n return { row: row.join(\" \"), body: body.join(\" \") };\n}\n\n/**\n * A header's element. With a close slot it is a row — the caller's children\n * in a body column, the × after them; the caller's padding, border and\n * background stay on the row, the caller's child layout (`flex-row`,\n * `space-y-*`, `text-left`…) moves to the body. Without one (no ×, or the\n * header is `sr-only`) it renders exactly as `baseClassName` + `className`.\n */\nexport function HeaderWithClose({\n slotName,\n baseClassName,\n closeOffsetClassName,\n className,\n children,\n ...props\n}: React.HTMLAttributes<HTMLDivElement> & {\n slotName: string;\n baseClassName: string;\n /** Pulls the × up so its center sits on the title's first line (the title's line height is the header's to know). */\n closeOffsetClassName: string;\n}): React.ReactElement {\n // A header nobody sees declines the ×; the content's own close row draws it.\n const owns = useCloseSlotClaim(/(?:^|\\s)(?:sr-only|hidden)(?:\\s|$)/.test(className ?? \"\"));\n if (!owns) {\n return (\n <div data-slot={slotName} className={cn(baseClassName, className)} {...props}>\n {children}\n </div>\n );\n }\n const { row, body } = splitHeaderClasses(className);\n // A header laid out as a row centers the × on that row; a stacked one, on the title's first line.\n const rowish = /(?:^|\\s)(?:[a-z0-9]+:)*flex-row(?:\\s|$)/.test(body);\n return (\n <div data-slot={slotName} data-has-close=\"\" className={cn(\"flex gap-2\", rowish ? \"items-center\" : \"items-start\", row)} {...props}>\n <div data-slot={`${slotName}-body`} className={cn(\"min-w-0 flex-1\", baseClassName, body)}>\n {children}\n </div>\n <CloseControl className={cn(\"-mr-2\", !rowish && closeOffsetClassName)} />\n </div>\n );\n}\n","import { humanizeIdentifier } from \"@ai-matrx/kit/text-case\";\n/**\n * Aspect-ratio option sets — recognizing them and ordering them for a picker.\n *\n * Model catalogs expose aspect ratio as a plain string enum (\"1:1\", \"16:9\",\n * \"9:19.5\", Runway's pixel pairs \"1280:720\", plus words like \"auto\" or\n * \"match_input_image\"). Any option list that is mostly ratios renders through\n * `AspectRatioSelect` — wherever it came from — so the rule lives on the data,\n * not on one control key.\n */\n\nexport interface ParsedRatio {\n w: number;\n h: number;\n}\n\nconst RATIO_RE = /^\\s*(\\d+(?:\\.\\d+)?)\\s*[:x×/]\\s*(\\d+(?:\\.\\d+)?)\\s*$/i;\n\nexport function parseRatio(value: string): ParsedRatio | null {\n const m = RATIO_RE.exec(value);\n if (!m) return null;\n const w = Number(m[1]);\n const h = Number(m[2]);\n if (!(w > 0 && h > 0)) return null;\n return { w, h };\n}\n\n/** True when at least two options and every option but the words is a ratio. */\nexport function isAspectRatioOptionSet(options: readonly string[]): boolean {\n const ratios = options.filter((o) => parseRatio(o) !== null).length;\n return ratios >= 2 && ratios >= options.length - 2;\n}\n\n/** The ratios people reach for, in the order they reach for them. */\nconst COMMON_ORDER = [\n \"1:1\",\n \"16:9\",\n \"9:16\",\n \"4:3\",\n \"3:4\",\n \"3:2\",\n \"2:3\",\n \"4:5\",\n \"5:4\",\n \"21:9\",\n];\n\nfunction reduced(r: ParsedRatio): string {\n const scale = 1000;\n let a = Math.round(r.w * scale);\n let b = Math.round(r.h * scale);\n const gcd = (x: number, y: number): number => (y === 0 ? x : gcd(y, x % y));\n const g = gcd(a, b);\n a /= g;\n b /= g;\n return `${a}:${b}`;\n}\n\n/** \"Square\", \"Landscape\", … — a plain word for the shape. */\nexport function ratioShapeName(value: string): string | null {\n const r = parseRatio(value);\n if (!r) return null;\n const k = r.w / r.h;\n if (Math.abs(k - 1) < 0.02) return \"Square\";\n if (k >= 2.2) return \"Ultrawide\";\n if (k <= 1 / 2.2) return \"Tall\";\n if (k > 1.6) return \"Widescreen\";\n if (k < 1 / 1.6) return \"Story\";\n return k > 1 ? \"Landscape\" : \"Portrait\";\n}\n\n/** Words that are not ratios (\"auto\", \"match_input_image\") read as words. */\nexport function humanizeRatioWord(value: string): string {\n return humanizeIdentifier(value) || value;\n}\n\nexport interface RatioGroups {\n /** Non-ratio words first (Auto, Match input image). */\n words: string[];\n common: string[];\n more: string[];\n}\n\n/** Split options into words, common ratios (fixed order) and the rest (by shape). */\nexport function groupRatioOptions(options: readonly string[]): RatioGroups {\n const words: string[] = [];\n const ratioOpts: string[] = [];\n for (const o of options) (parseRatio(o) ? ratioOpts : words).push(o);\n\n const byReduced = new Map<string, string>();\n for (const o of ratioOpts) {\n const key = reduced(parseRatio(o)!);\n if (!byReduced.has(key)) byReduced.set(key, o);\n }\n const common: string[] = [];\n for (const c of COMMON_ORDER) {\n const hit = byReduced.get(reduced(parseRatio(c)!));\n if (hit) common.push(hit);\n }\n const commonSet = new Set(common);\n const more = ratioOpts\n .filter((o) => !commonSet.has(o))\n .sort((a, b) => {\n const ra = parseRatio(a)!;\n const rb = parseRatio(b)!;\n return rb.w / rb.h - ra.w / ra.h;\n });\n // A short list has no \"More\": everything is common.\n if (ratioOpts.length <= 6) {\n return { words, common: [...common, ...more], more: [] };\n }\n return { words, common, more };\n}\n","\"use client\";\n\n/**\n * AspectRatioSelect — the aspect-ratio picker every surface uses.\n *\n * A compact select where each ratio carries a small shape preview and a plain\n * name (Square, Widescreen, Story…); common ratios first, the rest behind\n * \"More ratios\"; words such as \"auto\" read as words. Champion: the ratio menus\n * in Midjourney's web app and Figma's frame presets — a shape you can see beats\n * a number you must picture.\n */\n\nimport { OptionCombobox } from \"./option-combobox\";\nimport { cn } from \"../cn\";\nimport {\n groupRatioOptions,\n humanizeRatioWord,\n parseRatio,\n ratioShapeName,\n} from \"./aspect-ratio-options\";\n\n/** A ratio drawn as a rectangle inside a 14px box. */\nexport function AspectRatioGlyph({\n value,\n className,\n}: {\n value: string;\n className?: string;\n}) {\n const r = parseRatio(value);\n const box = 14;\n if (!r) {\n return (\n <span\n aria-hidden\n className={cn(\n \"inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center\",\n className,\n )}\n >\n <span className=\"h-2.5 w-2.5 rounded-[2px] border border-dashed border-current opacity-60\" />\n </span>\n );\n }\n const k = r.w / r.h;\n const w = k >= 1 ? box : Math.max(3, box * k);\n const h = k >= 1 ? Math.max(3, box / k) : box;\n return (\n <span\n aria-hidden\n className={cn(\n \"inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center\",\n className,\n )}\n >\n <span\n className=\"rounded-[2px] border-[1.5px] border-current opacity-80\"\n style={{ width: w, height: h }}\n />\n </span>\n );\n}\n\nexport interface AspectRatioSelectProps {\n value: string;\n onChange: (value: string) => void;\n options: readonly string[];\n variant?: \"field\" | \"inline\";\n compact?: boolean;\n disabled?: boolean;\n id?: string;\n ariaLabel?: string;\n placeholder?: string;\n}\n\nexport function AspectRatioSelect({\n value,\n onChange,\n options,\n variant = \"field\",\n compact,\n disabled,\n id,\n ariaLabel = \"Aspect ratio\",\n placeholder = \"Choose a ratio\",\n}: AspectRatioSelectProps) {\n const { words, common, more } = groupRatioOptions(options);\n const groups = [\n ...(words.length ? [{ options: words }] : []),\n { options: common },\n ...(more.length\n ? [{ heading: \"More ratios\", options: more, collapsed: true }]\n : []),\n ];\n return (\n <OptionCombobox\n value={value}\n onChange={onChange}\n groups={groups}\n getLabel={(o) => (parseRatio(o) ? o : humanizeRatioWord(o))}\n getHint={(o) => ratioShapeName(o)}\n renderIcon={(o) => (\n <AspectRatioGlyph value={o} className=\"text-muted-foreground\" />\n )}\n searchable={options.length > 12}\n searchPlaceholder=\"Search ratios…\"\n placeholder={placeholder}\n variant={variant}\n compact={compact}\n disabled={disabled}\n id={id}\n ariaLabel={ariaLabel}\n />\n );\n}\n","\"use client\";\n\n// Moved from matrx-frontend components/official/ConfigurationFields (chat host slots, 2026-10-08).\n\nimport { useEffect, useId, useRef, useState, type ReactNode } from \"react\";\nimport {\n AlertTriangleIcon as TriangleAlert,\n CircleCheckIcon as CircleCheck,\n CircleHelpIcon as CircleHelp,\n CircleXIcon as CircleX,\n XIcon as X,\n InfoIcon,\n ChevronDownIcon as ChevronDown,\n ChevronRightIcon as ChevronRight,\n} from \"../icons\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"../popover\";\nimport { cn } from \"../cn\";\nimport {\n Table,\n TableHeader,\n TableBody,\n TableHead,\n TableRow,\n TableCell,\n} from \"../table\";\n\nimport { Button } from \"./controls\";\nimport { valueSummary } from \"./value-summary\";\n/** Source-selector dimensions shared by configuration choices and pickers. */\nexport const CONFIGURATION_CHOICE_SIZE =\n \"h-[34px] min-h-[34px] rounded-lg px-2.5 text-[11.5px] font-medium\";\n\nconst FIELD_HELP_OPEN = \"matrx:field-help-open\";\n\n/** Field-attached help, reachable by pointer, keyboard and touch. */\nexport function FieldHelp({\n label,\n children,\n triggerIcon,\n triggerLabel,\n unavailable = false,\n}: {\n label: string;\n children: ReactNode;\n triggerIcon?: ReactNode;\n triggerLabel?: string;\n unavailable?: boolean;\n}) {\n const [open, setOpen] = useState(false);\n const id = useId();\n const dismissed = useRef(false);\n const trigger = useRef<HTMLButtonElement>(null);\n const content = useRef<HTMLDivElement>(null);\n const closeTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const hovered = useRef(false);\n const keyboardFocus = useRef(false);\n const pointerFocus = useRef(false);\n const cancelClose = () => {\n if (closeTimer.current) clearTimeout(closeTimer.current);\n closeTimer.current = null;\n };\n const changeOpen = (next: boolean) => {\n cancelClose();\n dismissed.current = !next;\n // A close notification coordinates independent local popovers without a\n // second store of their open state. Opening one dismisses its siblings.\n if (next)\n document.dispatchEvent(new CustomEvent(FIELD_HELP_OPEN, { detail: id }));\n setOpen(next);\n };\n const scheduleClose = () => {\n cancelClose();\n closeTimer.current = setTimeout(() => {\n if (!hovered.current && !keyboardFocus.current) changeOpen(false);\n }, 200);\n };\n const leaveFocus = (next: EventTarget | null) => {\n if (\n next instanceof Node &&\n (trigger.current?.contains(next) || content.current?.contains(next))\n )\n return;\n keyboardFocus.current = false;\n pointerFocus.current = false;\n dismissed.current = false;\n scheduleClose();\n };\n useEffect(() => {\n const closeSibling = (event: Event) => {\n if ((event as CustomEvent<string>).detail === id) return;\n if (closeTimer.current) clearTimeout(closeTimer.current);\n dismissed.current = true;\n setOpen(false);\n };\n document.addEventListener(FIELD_HELP_OPEN, closeSibling);\n return () => {\n document.removeEventListener(FIELD_HELP_OPEN, closeSibling);\n if (closeTimer.current) clearTimeout(closeTimer.current);\n };\n }, [id]);\n return (\n <Popover open={open} onOpenChange={changeOpen}>\n <PopoverTrigger asChild>\n <button\n ref={trigger}\n type=\"button\"\n aria-label={triggerLabel ?? `Help: ${label}`}\n aria-disabled={unavailable || undefined}\n className=\"inline-flex size-7 shrink-0 items-center justify-center rounded-md text-foreground hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n onPointerEnter={(event) => {\n if (event.pointerType === \"mouse\") {\n hovered.current = true;\n changeOpen(true);\n }\n }}\n onPointerLeave={() => {\n hovered.current = false;\n scheduleClose();\n }}\n onPointerDown={() => {\n pointerFocus.current = true;\n keyboardFocus.current = false;\n }}\n onKeyDownCapture={(event) => {\n if (event.key === \"Tab\") pointerFocus.current = false;\n }}\n onFocus={() => {\n if (!dismissed.current) {\n keyboardFocus.current = !pointerFocus.current;\n changeOpen(true);\n }\n }}\n onBlur={(event) => leaveFocus(event.relatedTarget)}\n onClick={(event) => {\n event.preventDefault();\n changeOpen(true);\n }}\n >\n {triggerIcon ?? (\n <CircleHelp className=\"size-3.5\" aria-hidden=\"true\" />\n )}\n </button>\n </PopoverTrigger>\n <PopoverContent\n ref={content}\n align=\"start\"\n onPointerEnter={() => {\n hovered.current = true;\n cancelClose();\n }}\n onPointerLeave={() => {\n hovered.current = false;\n scheduleClose();\n }}\n onPointerDownCapture={() => {\n pointerFocus.current = true;\n }}\n onKeyDownCapture={(event) => {\n if (event.key === \"Tab\") pointerFocus.current = false;\n }}\n onFocusCapture={() => {\n keyboardFocus.current = !pointerFocus.current;\n cancelClose();\n }}\n onBlurCapture={(event) => leaveFocus(event.relatedTarget)}\n onCloseAutoFocus={(event) => event.preventDefault()}\n onEscapeKeyDown={() => {\n changeOpen(false);\n trigger.current?.focus({ preventScroll: true });\n }}\n className={cn(\n \"matrx-config-help\",\n \"w-80 max-w-[calc(100vw-2rem)] space-y-2 type-body\",\n )}\n onOpenAutoFocus={(event) => event.preventDefault()}\n >\n <div className=\"flex items-center justify-between gap-3\">\n <span className=\"font-medium\">{label}</span>\n <Button variant=\"quiet\" icon={<X />} aria-label={`Close help: ${label}`} onClick={() => changeOpen(false)} className=\"shrink-0\" />\n </div>\n <div className=\"whitespace-pre-wrap break-words text-foreground\">\n {children}\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n\nconst STATUS = {\n neutral: {\n label: \"Not evaluated\",\n Icon: null,\n color: \"text-foreground\",\n },\n ok: { label: \"Passed\", Icon: CircleCheck, color: \"text-success\" },\n caution: { label: \"Attention\", Icon: TriangleAlert, color: \"text-warning\" },\n error: { label: \"Failed\", Icon: CircleX, color: \"text-destructive\" },\n unknown: {\n label: \"Unknown\",\n Icon: CircleHelp,\n color: \"text-foreground\",\n },\n} as const;\n\n/** Status always has text. Only meaningful severity icons accompany it. */\nexport function StatusToken({\n status,\n label,\n}: {\n status: keyof typeof STATUS;\n label?: string;\n}) {\n const { Icon, color, label: defaultLabel } = STATUS[status];\n return (\n <span\n className={cn(\n \"matrx-config-status\",\n \"inline-flex max-w-full items-center gap-1.5 type-secondary\",\n color,\n )}\n >\n {Icon ? <Icon className=\"size-3.5 shrink-0\" aria-hidden=\"true\" /> : null}\n <span className=\"break-words\">{label ?? defaultLabel}</span>\n </span>\n );\n}\n\nexport interface PropertyRowProps {\n /** The label — gray, medium weight, 11px (one step below the value). */\n label: string;\n /** The value — full black, regular weight, 14px, no box. Empty (`null`/`undefined`/`\"\"`) shows the missing tag. */\n value?: ReactNode;\n /** Alias for `value` when the value is markup. */\n children?: ReactNode;\n /** Help text — never between label and value: a string is a tooltip on a small info icon by the label; markup opens a help popover. */\n help?: ReactNode;\n /** Right-edge meta, always gray: field code name, size, copy button. */\n meta?: ReactNode;\n /** Missing value: `true` → \"Not provided\" tag; a string names the tag (\"Not set\", \"Unknown\"). Never gray italics. */\n missing?: boolean | string;\n /** Monospace — ONLY for code / raw data (ids, paths, hashes), never for names or plain strings. */\n mono?: boolean;\n /** Collected data (array / object): closed, the row shows its one-line summary (\"17 items · BBB, Facebook…\"). */\n data?: unknown;\n /** Full content shown when the row is expanded; its presence draws the expand arrow in the left margin column. */\n expanded?: ReactNode;\n defaultOpen?: boolean;\n /** Reserve the arrow's margin column with no arrow, so non-expandable rows line up with expandable siblings. */\n gutter?: boolean;\n /** `stacked` (default): label over value on ONE left edge. `inline`: fixed label column beside the value (the default when `source`/`state` is set). */\n layout?: \"stacked\" | \"inline\";\n /** Inline layout only — value attribution. */\n source?: ReactNode;\n /** Inline layout only — value state. */\n state?: ReactNode;\n className?: string;\n \"data-testid\"?: string;\n}\n\n/** The missing-value status tag: small, outlined, never gray italics. */\nexport function MissingTag({ children = \"Not provided\" }: { children?: ReactNode }) {\n return (\n <span\n data-matrx-missing=\"\"\n className=\"inline-flex items-center rounded border border-border px-1.5 type-meta font-medium text-muted-foreground\"\n >\n {children}\n </span>\n );\n}\n\nfunction RowHelp({ label, help }: { label: string; help: ReactNode }) {\n if (typeof help === \"string\" || typeof help === \"number\") {\n return (\n <span\n title={String(help)}\n aria-label={String(help)}\n data-matrx-row-help=\"\"\n className=\"inline-flex shrink-0 cursor-help text-muted-foreground hover:text-foreground\"\n >\n <InfoIcon className=\"size-3\" aria-hidden=\"true\" />\n </span>\n );\n }\n return (\n <FieldHelp label={label} triggerIcon={<InfoIcon className=\"size-3\" aria-hidden=\"true\" />}>\n {help}\n </FieldHelp>\n );\n}\n\nfunction isBlank(v: ReactNode): boolean {\n return v === null || v === undefined || v === false || v === \"\";\n}\n\n/**\n * THE label-with-its-value row (Arman-approved rules, 2026-10-13; the Apple settings / Stripe / Linear pattern):\n * 1. label gray (muted) + medium, 11px; help is a tooltip on an info icon by the label, never between label and value;\n * 2. value full black, regular, 14px (`type-value`), no fill or box;\n * 3. monospace only for code / raw data (`mono`);\n * 4. label and value share ONE left edge; the expand arrow lives in its own margin column;\n * 5. missing value = a small \"Not provided\" tag;\n * 6. collected data closed = a one-line summary (`data`), never raw JSON cut mid-word;\n * 7. right-edge meta stays gray.\n */\nexport function PropertyRow({\n label,\n value,\n children,\n help,\n meta,\n missing,\n mono = false,\n data,\n expanded,\n defaultOpen = false,\n gutter = false,\n layout: layoutProp,\n source,\n state,\n className,\n \"data-testid\": testId,\n}: PropertyRowProps) {\n const [open, setOpen] = useState(defaultOpen);\n // A caller that attributes its value (source/state) keeps the inline sheet it was written for.\n const layout = layoutProp ?? (source != null || state != null ? \"inline\" : \"stacked\");\n const content: ReactNode =\n value !== undefined ? value : children !== undefined ? children : data !== undefined && data !== null ? valueSummary(data) : undefined;\n const isMissing = missing ? true : isBlank(content) && (data === undefined || data === null);\n const missingText = typeof missing === \"string\" ? missing : \"Not provided\";\n const expandable = expanded != null && !isMissing;\n const valueClass = cn(\"min-w-0 type-value leading-5 [overflow-wrap:anywhere]\", mono && \"font-mono\");\n const focusRing = \"rounded-sm outline-none focus-visible:ring-2 focus-visible:ring-ring\";\n\n if (layout === \"inline\") {\n return (\n <div\n data-matrx-property-row=\"inline\"\n data-testid={testId}\n className={cn(\n \"flex min-w-0 flex-col gap-1 border-b border-border/60 py-2 last:border-b-0 sm:flex-row sm:items-center sm:gap-4\",\n className,\n )}\n >\n <div className=\"flex min-w-0 shrink-0 items-center gap-1.5 type-label leading-4 sm:w-44\">\n <span className=\"break-words\">{label}</span>\n {help != null ? <RowHelp label={label} help={help} /> : null}\n </div>\n <div className=\"flex min-w-0 flex-1 flex-wrap items-center gap-x-6 gap-y-1\">\n <div className={cn(\"flex-1\", valueClass)}>{isMissing ? <MissingTag>{missingText}</MissingTag> : content}</div>\n {source != null || state != null ? (\n <div className=\"flex flex-wrap items-center gap-x-4 gap-y-1 type-secondary text-foreground\">\n {source != null ? (\n <span>\n <span className=\"font-medium\">Source:</span> {source}\n </span>\n ) : null}\n {state != null ? (\n <span>\n <span className=\"font-medium\">State:</span> {state}\n </span>\n ) : null}\n </div>\n ) : null}\n {meta != null ? (\n <div className=\"flex shrink-0 items-center gap-1.5 type-meta text-muted-foreground\">{meta}</div>\n ) : null}\n </div>\n </div>\n );\n }\n\n const margin = expandable || gutter;\n return (\n <div\n data-matrx-property-row=\"stacked\"\n data-testid={testId}\n className={cn(\n \"grid gap-x-1 border-b border-border/60 py-2 last:border-b-0\",\n margin ? \"grid-cols-[1rem_minmax(0,1fr)]\" : \"grid-cols-[minmax(0,1fr)]\",\n className,\n )}\n >\n {margin ? (\n <div className=\"flex h-4 items-center\">\n {expandable ? (\n <button\n type=\"button\"\n onClick={() => setOpen((o) => !o)}\n aria-expanded={open}\n aria-label={open ? `Collapse ${label}` : `Expand ${label}`}\n className={cn(\"inline-flex text-muted-foreground hover:text-foreground\", focusRing)}\n >\n {open ? <ChevronDown className=\"size-3.5\" aria-hidden=\"true\" /> : <ChevronRight className=\"size-3.5\" aria-hidden=\"true\" />}\n </button>\n ) : null}\n </div>\n ) : null}\n <div className=\"flex h-4 min-w-0 items-center gap-1.5\">\n <span className=\"truncate type-label leading-4\">{label}</span>\n {help != null ? <RowHelp label={label} help={help} /> : null}\n {meta != null ? (\n <div className=\"ml-auto flex min-w-0 shrink-0 items-center gap-1.5 type-meta text-muted-foreground\">{meta}</div>\n ) : null}\n </div>\n <div\n className={cn(\n \"mt-0.5 min-w-0\",\n margin && \"col-start-2\",\n // A \"Not provided\" row is exactly as tall as a text row: the value line is a fixed 20px.\n isMissing ? \"flex h-5 items-center\" : expandable && open ? \"mt-1\" : \"flex min-h-5 items-center\",\n )}\n >\n {isMissing ? (\n <MissingTag>{missingText}</MissingTag>\n ) : expandable && open ? (\n expanded\n ) : expandable ? (\n <button\n type=\"button\"\n onClick={() => setOpen(true)}\n className={cn(\"block max-w-full truncate text-left\", valueClass, focusRing)}\n >\n {content}\n </button>\n ) : (\n <div className={valueClass}>{content}</div>\n )}\n </div>\n </div>\n );\n}\n\nexport interface ConfigurationColumn {\n key: string;\n label: string;\n help?: ReactNode;\n}\n\n/** Rich configuration values get a full-width reading surface below their label. */\nexport function ConfigurationValueList({\n label,\n entries,\n}: {\n label: string;\n entries: readonly { key: string; label: string; value: ReactNode }[];\n}) {\n return (\n <dl aria-label={label} className=\"min-w-0 divide-y divide-border rounded-lg border border-border bg-card type-body text-foreground\">\n {entries.map((entry) => (\n <div key={entry.key} className=\"min-w-0 p-3\">\n <dt className=\"mb-2 break-words font-semibold\">{entry.label}</dt>\n <dd className=\"min-w-0 [overflow-wrap:anywhere]\">{entry.value}</dd>\n </div>\n ))}\n </dl>\n );\n}\n\n/** Repeated configuration data: table on desktop, labeled records on phones. */\nexport function ConfigurationTable({\n label,\n columns,\n children,\n}: {\n label: string;\n columns: readonly ConfigurationColumn[];\n children: ReactNode;\n}) {\n return (\n <div className=\"min-w-0 rounded-lg border border-border bg-card\">\n <Table\n size=\"sm\"\n wrap={false}\n aria-label={label}\n className={cn(\"matrx-config-table\", \"type-body text-foreground\")}\n >\n <TableHeader className={\"matrx-config-head\"}>\n <TableRow className=\"bg-accent/40 hover:bg-accent/40\">\n {columns.map((column) => (\n <TableHead\n key={column.key}\n scope=\"col\"\n className=\"whitespace-normal align-middle font-semibold text-foreground\"\n >\n <span className={\"matrx-config-heading\"}>\n {column.label}\n {column.help ? (\n <FieldHelp label={column.label}>{column.help}</FieldHelp>\n ) : null}\n </span>\n </TableHead>\n ))}\n </TableRow>\n </TableHeader>\n <TableBody className={\"matrx-config-body\"}>{children}</TableBody>\n </Table>\n </div>\n );\n}\n\nexport function ConfigurationTableRow({\n columns,\n cells,\n}: {\n columns: readonly ConfigurationColumn[];\n cells: Record<string, ReactNode>;\n}) {\n return (\n <TableRow\n className={cn(\"matrx-config-row\", \"border-b border-border last:border-b-0\")}\n >\n {columns.map((column) => (\n <TableCell\n key={column.key}\n className={cn(\"matrx-config-cell\", \"min-w-0 whitespace-normal align-middle\")}\n >\n <span\n className={cn(\n \"matrx-config-mobile-label\",\n \"mb-1 items-center gap-1 font-semibold\",\n )}\n >\n {column.label}:\n {column.help ? (\n <FieldHelp label={column.label}>{column.help}</FieldHelp>\n ) : null}\n </span>\n <div className={\"matrx-config-cell-content\"}>\n {cells[column.key] ?? \"Not specified\"}\n </div>\n </TableCell>\n ))}\n </TableRow>\n );\n}\n","\"use client\";\n\n/**\n * Table — the semantic table shell. No data logic, no sorting, no virtualiser:\n * those belong to the host's data-table layer, which composes these elements.\n *\n * The two forks disagreed on exactly three things, all of them now props:\n *\n * 1. matrx-frontend wrapped `<table>` in `relative w-full overflow-auto` so a\n * wide table scrolls inside itself instead of pushing the page sideways;\n * dashboard emitted a bare `<table>`. The wrapper is the correct default —\n * a table that widens its page is a layout bug on every narrow viewport —\n * so it stays on, with `wrap={false}` for a host that already owns a\n * scroll container (double scrollers are their own defect).\n * 2. dashboard's header was `sticky top-0 z-10 bg-background`. That is a real\n * capability, not a style opinion, so it is `sticky` on `TableHeader` —\n * opt-in, because a sticky header inside an unbounded page sticks to\n * nothing and only costs a stacking context.\n * 3. Cell density: `p-2` vs `p-3`. Declared once on `<Table size>` and read\n * from context by every cell, so a table cannot mix densities.\n *\n * Color is tokens only.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nexport type TableSize = \"sm\" | \"md\";\n\nconst TABLE_SIZES: Record<TableSize, { head: string; cell: string }> = {\n sm: { head: \"px-2\", cell: \"p-2\" },\n md: { head: \"px-3\", cell: \"p-3\" },\n};\n\nconst TableSizeContext = React.createContext<TableSize>(\"md\");\n\n/** The density the nearest enclosing `<Table>` declared. `md` outside one. */\nexport function useTableSize(): TableSize {\n return React.useContext(TableSizeContext);\n}\n\nexport interface TableProps extends React.HTMLAttributes<HTMLTableElement> {\n /** Cell density for this table. Default `md` (`p-3`); `sm` is `p-2`. */\n size?: TableSize;\n /**\n * Wrap the table in its own horizontal scroll container. Default `true`.\n * Pass `false` only when an ancestor already scrolls this table.\n */\n wrap?: boolean;\n /** Classes for the scroll wrapper (ignored when `wrap` is false). */\n wrapperClassName?: string;\n}\n\nconst Table = React.forwardRef<HTMLTableElement, TableProps>(\n ({ className, size = \"md\", wrap = true, wrapperClassName, ...props }, ref) => {\n const table = (\n <table\n ref={ref}\n data-slot=\"table\"\n data-size={size}\n className={cn(\"w-full caption-bottom text-sm\", className)}\n {...props}\n />\n );\n\n return (\n <TableSizeContext.Provider value={size}>\n {wrap ? (\n <div\n data-slot=\"table-wrapper\"\n className={cn(\"relative w-full overflow-auto\", wrapperClassName)}\n >\n {table}\n </div>\n ) : (\n table\n )}\n </TableSizeContext.Provider>\n );\n },\n);\nTable.displayName = \"Table\";\n\nexport interface TableHeaderProps\n extends React.HTMLAttributes<HTMLTableSectionElement> {\n /**\n * Pin the header to the top of the nearest scroll container. Opt-in: it\n * needs a bounded scroll ancestor to stick to, and it opens a stacking\n * context whether or not it sticks.\n */\n sticky?: boolean;\n}\n\nconst TableHeader = React.forwardRef<\n HTMLTableSectionElement,\n TableHeaderProps\n>(({ className, sticky = false, ...props }, ref) => (\n <thead\n ref={ref}\n data-slot=\"table-header\"\n className={cn(\n \"[&_tr]:border-b\",\n sticky && \"sticky top-0 z-10 bg-background\",\n className,\n )}\n {...props}\n />\n));\nTableHeader.displayName = \"TableHeader\";\n\nconst TableBody = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tbody\n ref={ref}\n data-slot=\"table-body\"\n className={cn(\"[&_tr:last-child]:border-0\", className)}\n {...props}\n />\n));\nTableBody.displayName = \"TableBody\";\n\nconst TableFooter = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tfoot\n ref={ref}\n data-slot=\"table-footer\"\n className={cn(\n \"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0\",\n className,\n )}\n {...props}\n />\n));\nTableFooter.displayName = \"TableFooter\";\n\nconst TableRow = React.forwardRef<\n HTMLTableRowElement,\n React.HTMLAttributes<HTMLTableRowElement>\n>(({ className, ...props }, ref) => (\n <tr\n ref={ref}\n data-slot=\"table-row\"\n className={cn(\n \"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted\",\n className,\n )}\n {...props}\n />\n));\nTableRow.displayName = \"TableRow\";\n\nconst TableHead = React.forwardRef<\n HTMLTableCellElement,\n React.ThHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => {\n const size = useTableSize();\n return (\n <th\n ref={ref}\n data-slot=\"table-head\"\n className={cn(\n \"h-10 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n TABLE_SIZES[size].head,\n className,\n )}\n {...props}\n />\n );\n});\nTableHead.displayName = \"TableHead\";\n\nconst TableCell = React.forwardRef<\n HTMLTableCellElement,\n React.TdHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => {\n const size = useTableSize();\n return (\n <td\n ref={ref}\n data-slot=\"table-cell\"\n className={cn(\n \"align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n TABLE_SIZES[size].cell,\n className,\n )}\n {...props}\n />\n );\n});\nTableCell.displayName = \"TableCell\";\n\nconst TableCaption = React.forwardRef<\n HTMLTableCaptionElement,\n React.HTMLAttributes<HTMLTableCaptionElement>\n>(({ className, ...props }, ref) => (\n <caption\n ref={ref}\n data-slot=\"table-caption\"\n className={cn(\"mt-4 text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nTableCaption.displayName = \"TableCaption\";\n\nexport {\n Table,\n TableBody,\n TableCaption,\n TableCell,\n TableFooter,\n TableHead,\n TableHeader,\n TableRow,\n};\n","/**\n * THE one-line summary of collected data (arrays / objects) for a closed `PropertyRow`:\n * \"17 items · BBB, Facebook, LinkedIn…\" — never raw JSON cut off mid-word.\n * Moved from matrx-frontend features/provision-window/data.ts (2026-10-13).\n */\n\nconst NAME_KEYS = [\"label\", \"name\", \"title\", \"platform\", \"field\", \"url\"] as const;\n\nfunction isEmpty(v: unknown): boolean {\n return v === null || v === undefined || v === \"\" || (Array.isArray(v) && v.length === 0);\n}\n\nexport function valueSummary(value: unknown): string {\n if (value === null || value === undefined) return \"\";\n if (typeof value !== \"object\") return String(value);\n if (Array.isArray(value)) {\n const names: string[] = [];\n for (const item of value) {\n if (item && typeof item === \"object\" && !Array.isArray(item)) {\n const rec = item as Record<string, unknown>;\n const key = NAME_KEYS.find((k) => typeof rec[k] === \"string\");\n const name = key ? String(rec[key]).trim() : \"\";\n if (name && !names.includes(name)) names.push(name);\n } else if ((typeof item === \"string\" || typeof item === \"number\") && !names.includes(String(item))) {\n names.push(String(item));\n }\n if (names.length >= 4) break;\n }\n const head = `${value.length} ${value.length === 1 ? \"item\" : \"items\"}`;\n if (names.length === 0) return head;\n return `${head} · ${names.slice(0, 3).join(\", \")}${names.length > 3 ? \"…\" : \"\"}`;\n }\n const entries = Object.entries(value as Record<string, unknown>);\n if (entries.length === 0) return \"Empty\";\n const filled = entries.filter(([, v]) => !isEmpty(v));\n if (filled.length === 0) return `${entries.map(([k]) => k).join(\", \")} — all empty`;\n const shown = filled\n .slice(0, 3)\n .map(([k, v]) => `${k}: ${typeof v === \"object\" ? (Array.isArray(v) ? `${v.length} items` : \"…\") : String(v)}`)\n .join(\" · \");\n return filled.length > 3 ? `${shown} · +${filled.length - 3} more` : shown;\n}\n\n/** True for values a `PropertyRow` should summarize instead of print (arrays and plain objects). */\nexport function isCollectedValue(value: unknown): boolean {\n return value !== null && typeof value === \"object\" && !isReactElementLike(value);\n}\n\nfunction isReactElementLike(value: object): boolean {\n return \"$$typeof\" in value;\n}\n","\"use client\";\n\n/**\n * IndicatorStrip — a fixed row of small yes/no icons for a table cell\n * (owner, 2026-10-08: \"create an icon for each option and have it gray if it's\n * not true and color if it is. Show them all at all times so the UI doesn't\n * shift their position in any rows. Add a tooltip that says what they are.\n * Small icons with a small amount of separation.\").\n *\n * The contract, pinned by `indicator-strip.test.tsx`:\n * - EVERY item renders in every row, in the order given — off is a muted\n * glyph, never a gap — so a column of strips lines up icon over icon;\n * - 14px glyphs, 4px apart, one line, never wraps, never shrinks;\n * - an on item takes its tone from semantic tokens (`danger` → destructive,\n * `warning`, `info`, `success`); `soft` is the same tone at reduced ink, for a\n * hint rather than a verdict;\n * - every icon names itself: `aria-label` and `title` (\"Premium model: yes —\n * Uses gpt-5\"), and every `title` is the fleet tooltip (title-tooltips.ts).\n *\n * The caller passes the glyph (any lucide-style component) so the package\n * stays icon-library free and a board keeps its domain icons.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nexport type IndicatorTone = \"danger\" | \"warning\" | \"info\" | \"success\" | \"neutral\";\n\nexport interface IndicatorItem {\n /** Stable key, also `data-indicator`. */\n id: string;\n /** The glyph: any component that takes `className` (lucide icons do). */\n icon: React.ComponentType<{ className?: string; \"aria-hidden\"?: boolean | \"true\" | \"false\" }>;\n /** What the icon means, as a short name (\"Premium model\"). */\n label: string;\n /** True draws the tone; false draws the muted glyph. */\n on: boolean;\n /** Ink when on. Default `warning`. */\n tone?: IndicatorTone;\n /** The tone at reduced ink: a hint, not a verdict. */\n soft?: boolean;\n /** Shown after the label when on (≤ ~100 chars: the tooltip budget is 140). */\n detail?: string;\n}\n\nexport interface IndicatorStripProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, \"children\"> {\n items: readonly IndicatorItem[];\n}\n\nconst TONE: Record<IndicatorTone, string> = {\n danger: \"text-destructive\",\n warning: \"text-warning\",\n info: \"text-info\",\n success: \"text-success\",\n neutral: \"text-foreground\",\n};\n\nexport function indicatorText(item: IndicatorItem): string {\n if (!item.on) return `${item.label}: no`;\n return item.detail ? `${item.label}: yes — ${item.detail}` : `${item.label}: yes`;\n}\n\nexport function IndicatorStrip({ items, className, ...props }: IndicatorStripProps) {\n return (\n <span\n data-slot=\"indicator-strip\"\n role=\"list\"\n className={cn(\"inline-flex shrink-0 flex-nowrap items-center gap-1 whitespace-nowrap align-middle\", className)}\n {...props}\n >\n {items.map((item) => {\n const Icon = item.icon;\n const text = indicatorText(item);\n return (\n <span\n key={item.id}\n role=\"listitem\"\n aria-label={text}\n title={text}\n data-indicator={item.id}\n data-on={item.on ? \"true\" : \"false\"}\n className={cn(\n \"inline-flex size-3.5 shrink-0 items-center justify-center\",\n item.on ? TONE[item.tone ?? \"warning\"] : \"text-muted-foreground opacity-30\",\n item.on && item.soft && \"opacity-55\",\n )}\n >\n <Icon className=\"size-3.5\" aria-hidden />\n </span>\n );\n })}\n </span>\n );\n}\n","// MiddleTruncate (moved from matrx-frontend components/official, 2026-10-22)\n//\n// ONE-LINE TEXT THAT KEEPS BOTH ENDS. CSS ellipsis eats the END of a name, so\n// four scopes named \"LCP Test Repositories lcp-2026-…\" all read the same (the\n// phone Context sheet, page-pass /notes 2026-09-28). This keeps the tail — the\n// part that tells siblings apart — and lets only the middle give way:\n// \"LCP Test Rep…lcp-0917-b\". Pure CSS at render (no measuring, no layout\n// shift): the head truncates, the tail never shrinks. A name that fits shows\n// whole. The full text is the title and, once, the screen-reader text.\n\nimport * as React from \"react\";\nimport { cn } from \"../cn\";\n\n/** Characters kept at the end (at most half the text). */\nconst DEFAULT_TAIL = 10;\n\nexport function splitForMiddleTruncate(text: string, tail = DEFAULT_TAIL): { head: string; end: string } {\n const keep = Math.min(tail, Math.floor(text.length / 2));\n if (keep <= 0) return { head: text, end: \"\" };\n return { head: text.slice(0, text.length - keep), end: text.slice(text.length - keep) };\n}\n\nexport function MiddleTruncate({\n text,\n tail = DEFAULT_TAIL,\n className,\n}: {\n text: string;\n /** Characters kept at the end. Default 10. */\n tail?: number;\n className?: string;\n}): React.ReactElement {\n const { head, end } = splitForMiddleTruncate(text, tail);\n return (\n <span className={cn(\"flex min-w-0 items-baseline\", className)} title={text}>\n <span className=\"sr-only\">{text}</span>\n <span aria-hidden className=\"min-w-0 truncate whitespace-pre\">\n {head}\n </span>\n {end ? (\n <span aria-hidden className=\"shrink-0 whitespace-pre\">\n {end}\n </span>\n ) : null}\n </span>\n );\n}\n","/**\n * CalloutBanner — a compact, dismissible inline callout in a semantic tone.\n * Reusable across the app (first consumer: the agents-page drift banner). No\n * such primitive existed; this is the canonical one — extend it, don't fork.\n */\n\n\"use client\";\n\nimport type * as React from \"react\";\nimport { XIcon } from \"../icons\";\nimport { cn } from \"../cn\";\n\nimport { Button } from \"./controls\";\nexport type CalloutTone = \"destructive\" | \"warning\" | \"info\" | \"success\";\n\nconst TONE: Record<CalloutTone, { container: string; icon: string }> = {\n destructive: { container: \"border-destructive/30 bg-destructive/10\", icon: \"text-destructive\" },\n warning: { container: \"border-warning/30 bg-warning/10\", icon: \"text-warning\" },\n info: { container: \"border-primary/30 bg-primary/10\", icon: \"text-primary\" },\n success: { container: \"border-success/30 bg-success/10\", icon: \"text-success\" },\n};\n\ninterface CalloutBannerProps {\n tone: CalloutTone;\n icon?: React.ComponentType<{ className?: string; \"aria-hidden\"?: boolean }>;\n title: React.ReactNode;\n description?: React.ReactNode;\n /** Action buttons / chips rendered on the trailing edge. */\n actions?: React.ReactNode;\n onDismiss?: () => void;\n dismissing?: boolean;\n className?: string;\n}\n\nexport function CalloutBanner({\n tone,\n icon: Icon,\n title,\n description,\n actions,\n onDismiss,\n dismissing,\n className,\n}: CalloutBannerProps) {\n const t = TONE[tone];\n return (\n <div\n className={cn(\n \"flex flex-col gap-2 rounded-lg border px-3 py-2.5 sm:flex-row sm:items-center\",\n t.container,\n className,\n )}\n role=\"status\"\n >\n <div className=\"flex min-w-0 flex-1 items-start gap-2\">\n {Icon && <Icon className={cn(\"mt-0.5 h-4 w-4 shrink-0\", t.icon)} aria-hidden />}\n <div className=\"min-w-0\">\n <p className=\"type-title text-foreground\">{title}</p>\n {description && (\n <p className=\"mt-0.5 type-secondary text-muted-foreground\">{description}</p>\n )}\n </div>\n </div>\n <div className=\"flex shrink-0 items-center gap-1.5 sm:ml-2\">\n {actions}\n {onDismiss && (\n <Button variant=\"quiet\" icon={<XIcon />} aria-label=\"Dismiss\" onClick={onDismiss} disabled={dismissing} />\n )}\n </div>\n </div>\n );\n}\n","/**\n * GatedActionButton — a primary action that is never dead.\n *\n * ## The wall this closes (2026-09-15, `teach-recent-practitioner` W2)\n *\n * A non-technical Expert reached the payoff moment of the whole product — the\n * \"Build the Masterwork\" button — and it was **silently disabled**. No red\n * text, no tooltip, no validation message, no console error. Clicking it did\n * nothing, twice, by ref and by coordinate. The reason was one empty required\n * field whose placeholder read like a real value, so the screen told the user\n * everything was filled in and then refused to move.\n *\n * That is a LAW 4 violation — *nothing fails silently; a screen is absent or\n * honest, never dead, disabled-looking, or wearing a false state.* A disabled\n * button that says nothing is a screen telling a lie.\n *\n * ## The contract\n *\n * A gated action takes a `reason`, not a boolean. When a reason is present the\n * button is disabled AND the reason is rendered beside it, in plain words a\n * non-technical person can act on (\"Name your Masterwork to build it\"), wired\n * to the button by `aria-describedby` so a screen reader gets it too. When\n * there is no reason, the button is a normal `<Button>` and renders no chrome.\n *\n * **`disabled` for a reason that is not a blocker is still allowed** — a\n * button already running its own action (`disabled={running}` with the label\n * \"Building…\") is honest about itself, so it needs no sentence. Use `reason`\n * for every state where the user must DO something first.\n *\n * ## Usage\n *\n * ```tsx\n * <GatedActionButton\n * reason={firstBlockingReason([\n * { when: !name.trim(), reason: \"Name your Masterwork to build it\" },\n * { when: approved === 0, reason: \"Approve at least one rule to build it\" },\n * ])}\n * disabled={running}\n * onClick={build}\n * >\n * Build the Masterwork\n * </GatedActionButton>\n * ```\n *\n * `firstBlockingReason` returns the FIRST unmet check, so order the list the\n * way you want the user to fix things: one sentence at a time, never a wall of\n * validation errors.\n *\n * @official-component\n */\n\n\"use client\";\n\nimport * as React from \"react\";\n\nimport { Button, type ButtonProps } from \"../button\";\nimport { cn } from \"../cn\";\n\n/** One reason an action cannot fire yet, and the condition that makes it true. */\nexport interface BlockingCheck {\n /** True when this check is currently blocking the action. */\n when: boolean;\n /**\n * What the user must do, in plain words, phrased as an instruction — not a\n * validation complaint. \"Name your Masterwork to build it\", never\n * \"name is required\".\n */\n reason: string;\n}\n\n/**\n * The first blocking reason in the list, or `null` when nothing blocks.\n *\n * Order the checks in the order you want the user to fix them. Returning ONE\n * reason is deliberate: a non-technical person acts on a single next step, not\n * on a list of everything wrong at once.\n */\nexport function firstBlockingReason(\n checks: ReadonlyArray<BlockingCheck | null | undefined | false>,\n): string | null {\n for (const check of checks) {\n if (check && check.when) return check.reason;\n }\n return null;\n}\n\nexport interface GatedActionButtonProps extends ButtonProps {\n /**\n * Why this action cannot fire yet. When set, the button is disabled and this\n * sentence is rendered next to it. `null`/`undefined` means nothing blocks.\n */\n reason?: string | null;\n /** Layout escape hatch for the wrapper that holds the reason and the button. */\n wrapperClassName?: string;\n /** Layout escape hatch for the reason text itself (e.g. `max-w-[16rem]`). */\n reasonClassName?: string;\n}\n\n/**\n * @see {@link GatedActionButtonProps} for the full prop contract.\n */\nexport function GatedActionButton({\n reason,\n wrapperClassName,\n reasonClassName,\n disabled,\n title,\n children,\n ...buttonProps\n}: GatedActionButtonProps) {\n const reactId = React.useId();\n const blocked = Boolean(reason && reason.trim());\n const reasonId = `gated-action-reason-${reactId}`;\n\n return (\n <span\n className={cn(\n \"inline-flex min-w-0 flex-wrap items-center justify-end gap-2\",\n wrapperClassName,\n )}\n >\n {blocked ? (\n <span\n id={reasonId}\n role=\"status\"\n data-slot=\"gated-action-reason\"\n // NOT `text-destructive`. This sentence is an instruction for\n // something the user has not done YET — on a form's first paint it\n // is the normal state, not a failure. Red said \"you did something\n // wrong\" to a first-timer who had not yet typed a character\n // (jobs-bar-2026-09-16, item 6). The contract above is explicit:\n // \"phrased as an instruction — not a validation complaint.\"\n className={cn(\n \"min-w-0 type-secondary font-medium text-muted-foreground\",\n reasonClassName,\n )}\n >\n {reason}\n </span>\n ) : null}\n <Button\n {...buttonProps}\n disabled={disabled || blocked}\n title={blocked ? (reason ?? undefined) : title}\n aria-describedby={blocked ? reasonId : buttonProps[\"aria-describedby\"]}\n >\n {children}\n </Button>\n </span>\n );\n}\n\nGatedActionButton.displayName = \"GatedActionButton\";\n","\"use client\";\n\nimport React, { useEffect, useRef, useState } from \"react\";\nimport { Loader2Icon, SearchIcon, XIcon } from \"../icons\";\nimport { cn } from \"../cn\";\nimport { Input } from \"./doors\";\nimport { Button } from \"./controls\";\n\nexport interface SearchInputProps {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n onSearch?: (value: string) => void;\n placeholder?: string;\n loading?: boolean;\n debounceTime?: number;\n showClearButton?: boolean;\n showSubmitButton?: boolean;\n autoFocus?: boolean;\n disabled?: boolean;\n className?: string;\n inputClassName?: string;\n buttonClassName?: string;\n \"aria-label\"?: string;\n}\n\nexport function SearchInput({\n value,\n defaultValue = \"\",\n onValueChange,\n onSearch,\n placeholder = \"Search...\",\n loading = false,\n debounceTime = 300,\n showClearButton = true,\n showSubmitButton = false,\n autoFocus = false,\n disabled = false,\n className,\n inputClassName,\n buttonClassName,\n \"aria-label\": ariaLabel = \"Search\",\n}: SearchInputProps) {\n const [internalValue, setInternalValue] = useState(defaultValue);\n const inputRef = useRef<HTMLInputElement>(null);\n const isControlled = value !== undefined;\n const currentValue = isControlled ? value : internalValue;\n const searchValue = currentValue.trim();\n const didMountRef = useRef(false);\n const onSearchRef = useRef(onSearch);\n\n useEffect(() => {\n if (!autoFocus) return;\n inputRef.current?.focus();\n }, [autoFocus]);\n\n useEffect(() => {\n onSearchRef.current = onSearch;\n }, [onSearch]);\n\n useEffect(() => {\n if (!onSearchRef.current) return undefined;\n if (!didMountRef.current) {\n didMountRef.current = true;\n return undefined;\n }\n const timer = window.setTimeout(() => {\n onSearchRef.current?.(currentValue);\n }, debounceTime);\n return () => window.clearTimeout(timer);\n }, [currentValue, debounceTime]);\n\n const setNextValue = (nextValue: string) => {\n if (!isControlled) setInternalValue(nextValue);\n onValueChange?.(nextValue);\n };\n\n const handleSubmit = (event: React.FormEvent) => {\n event.preventDefault();\n onSearch?.(currentValue);\n };\n\n const handleClear = () => {\n setNextValue(\"\");\n onSearch?.(\"\");\n inputRef.current?.focus();\n };\n\n return (\n <form\n onSubmit={handleSubmit}\n className={cn(\"flex min-w-0 items-center gap-2\", className)}\n >\n <div className=\"relative min-w-0 flex-1\">\n <SearchIcon\n className=\"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground\"\n aria-hidden\n />\n <Input\n ref={inputRef}\n type=\"search\"\n value={currentValue}\n onChange={(event) => setNextValue(event.target.value)}\n placeholder={placeholder}\n disabled={disabled}\n aria-label={ariaLabel}\n className={inputClassName} adornment={showClearButton && searchValue ? \"both\" : \"start\"}\n />\n {showClearButton && searchValue ? (\n <button\n type=\"button\"\n onClick={handleClear}\n disabled={disabled}\n aria-label=\"Clear search\"\n className=\"absolute right-2 top-1/2 flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:pointer-events-none disabled:text-disabled-foreground\"\n >\n <XIcon className=\"h-3.5 w-3.5\" />\n </button>\n ) : null}\n </div>\n {showSubmitButton ? (\n <Button\n icon={loading ? (\n <Loader2Icon className=\"animate-spin\" />\n ) : (\n <SearchIcon />\n )}\n variant=\"primary\"\n type=\"submit\"\n disabled={disabled || loading}\n aria-label=\"Submit search\"\n className={buttonClassName}\n />\n ) : null}\n </form>\n );\n}\n\nexport default SearchInput;\n","/**\n * CollapsibleText — measured multiline text with a compact preview and fade.\n *\n * Use for user-authored text that can become long inside dense lists, timelines,\n * and cards. The caller owns expansion state so individual toggles and\n * expand-all/collapse-all controls stay in sync.\n *\n * @official-component\n */\n\n\"use client\";\n\nimport { useLayoutEffect, useRef, useState, type ReactNode } from \"react\";\nimport { ChevronDownIcon, ChevronUpIcon, ChevronsDownIcon, ChevronsUpIcon } from \"../icons\";\nimport { Button } from \"./controls\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"../tooltip\";\nimport { cn } from \"../cn\";\n\ninterface CollapsibleTextProps {\n children: ReactNode;\n expanded: boolean;\n onExpandedChange: (expanded: boolean) => void;\n collapsedLines?: number;\n className?: string;\n expandLabel?: string;\n collapseLabel?: string;\n /**\n * Show the label as visible text on the toggle (\"Show more\" / \"Show less\"),\n * as comment threads do (Linear, Notion). Default: icon-only, labeled for\n * assistive tech.\n */\n showLabel?: boolean;\n}\n\nexport function CollapsibleText({\n children,\n expanded,\n onExpandedChange,\n collapsedLines = 4,\n className,\n expandLabel = \"Expand text\",\n collapseLabel = \"Collapse text\",\n showLabel = false,\n}: CollapsibleTextProps) {\n const contentRef = useRef<HTMLDivElement>(null);\n const [collapsedHeight, setCollapsedHeight] = useState(0);\n const [isOverflowing, setIsOverflowing] = useState(false);\n\n useLayoutEffect(() => {\n const node = contentRef.current;\n if (!node) return undefined;\n\n const measure = () => {\n const styles = window.getComputedStyle(node);\n const parsedLineHeight = Number.parseFloat(styles.lineHeight);\n const parsedFontSize = Number.parseFloat(styles.fontSize);\n const lineHeight = Number.isFinite(parsedLineHeight)\n ? parsedLineHeight\n : parsedFontSize * 1.4;\n const nextCollapsedHeight = Math.ceil(lineHeight * collapsedLines);\n setCollapsedHeight(nextCollapsedHeight);\n setIsOverflowing(node.scrollHeight > nextCollapsedHeight + 1);\n };\n\n measure();\n if (typeof ResizeObserver === \"undefined\") return undefined;\n const observer = new ResizeObserver(measure);\n observer.observe(node);\n return () => observer.disconnect();\n }, [children, collapsedLines]);\n\n const isCollapsed = isOverflowing && !expanded;\n\n if (showLabel) {\n return (\n <div className=\"relative min-w-0\">\n <div\n ref={contentRef}\n className={cn(\n \"overflow-hidden whitespace-pre-wrap break-words\",\n isCollapsed &&\n \"[mask-image:linear-gradient(to_bottom,black_55%,transparent_100%)] [-webkit-mask-image:linear-gradient(to_bottom,black_55%,transparent_100%)]\",\n className,\n )}\n style={isCollapsed && collapsedHeight > 0 ? { maxHeight: `${collapsedHeight}px` } : undefined}\n >\n {children}\n </div>\n {isOverflowing ? (\n <button\n type=\"button\"\n aria-expanded={!isCollapsed}\n onClick={(event) => {\n event.stopPropagation();\n onExpandedChange(isCollapsed);\n }}\n className=\"mt-0.5 inline-flex min-h-6 items-center gap-0.5 rounded text-xs font-medium text-primary hover:underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring\"\n >\n {isCollapsed ? <ChevronDownIcon className=\"h-3.5 w-3.5\" aria-hidden /> : <ChevronUpIcon className=\"h-3.5 w-3.5\" aria-hidden />}\n {isCollapsed ? expandLabel : collapseLabel}\n </button>\n ) : null}\n </div>\n );\n }\n\n return (\n <div className=\"relative min-w-0\">\n <div\n ref={contentRef}\n className={cn(\n \"overflow-hidden whitespace-pre-wrap break-words transition-[max-height] duration-300 ease-out\",\n isCollapsed &&\n \"[mask-image:linear-gradient(to_bottom,black_55%,transparent_100%)] [-webkit-mask-image:linear-gradient(to_bottom,black_55%,transparent_100%)]\",\n className,\n )}\n style={\n isCollapsed && collapsedHeight > 0\n ? { maxHeight: `${collapsedHeight}px` }\n : undefined\n }\n >\n {children}\n </div>\n\n {isCollapsed ? (\n <div className=\"pointer-events-none absolute inset-x-0 bottom-0 flex justify-center\">\n <Button\n icon={<ChevronDownIcon />}\n type=\"button\"\n variant=\"outline\"\n aria-label={expandLabel}\n aria-expanded={false}\n onClick={(event) => {\n event.stopPropagation();\n onExpandedChange(true);\n }}\n className=\"pointer-events-auto\"\n />\n </div>\n ) : isOverflowing ? (\n <div className=\"flex justify-center pt-0.5\">\n <Button\n icon={<ChevronUpIcon />}\n type=\"button\"\n variant=\"quiet\"\n aria-label={collapseLabel}\n aria-expanded\n onClick={(event) => {\n event.stopPropagation();\n onExpandedChange(false);\n }}\n />\n </div>\n ) : null}\n </div>\n );\n}\n\ninterface CollapsibleTextGroupControlsProps {\n onExpandAll: () => void;\n onCollapseAll: () => void;\n allExpanded: boolean;\n anyExpanded: boolean;\n disabled?: boolean;\n}\n\nexport function CollapsibleTextGroupControls({\n onExpandAll,\n onCollapseAll,\n allExpanded,\n anyExpanded,\n disabled = false,\n}: CollapsibleTextGroupControlsProps) {\n return (\n <div className=\"flex items-center gap-0.5\">\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n icon={<ChevronsDownIcon className=\"!size-[18px] lg:!size-3.5\" />}\n type=\"button\"\n variant=\"quiet\"\n aria-label=\"Expand all\"\n onClick={onExpandAll}\n disabled={disabled || allExpanded}\n />\n </TooltipTrigger>\n <TooltipContent side=\"top\">Expand all</TooltipContent>\n </Tooltip>\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n icon={<ChevronsUpIcon className=\"!size-[18px] lg:!size-3.5\" />}\n type=\"button\"\n variant=\"quiet\"\n aria-label=\"Collapse all\"\n onClick={onCollapseAll}\n disabled={disabled || !anyExpanded}\n />\n </TooltipTrigger>\n <TooltipContent side=\"top\">Collapse all</TooltipContent>\n </Tooltip>\n </div>\n );\n}\n","\"use client\";\n\n/**\n * Tooltip — the ONE tooltip in the fleet.\n *\n * THE COLLAPSE (0.6.0). Two implementations existed: matrx-frontend's\n * `components/ui/tooltip.tsx` (182 import sites) and `@ai-matrx/tap-target`'s\n * `src/tooltip.tsx` — the latter an explicit inlined PORT of the former,\n * carrying a header that said so. tap-target shipped it only because its ~60\n * tap buttons need a tooltip and no shared package owned one; four repos then\n * adopted `TooltipProvider` from tap-target. That made tap-target — a\n * button-geometry package — the accidental owner of a design-system primitive,\n * with a second copy living in the biggest host.\n *\n * A tooltip is a design-system surface, so it lives here. tap-target now takes\n * `@ai-matrx/design-system` as an ordinary sibling dependency and imports this\n * file; its own copy is deleted, and its re-export removed. The DAG already\n * ordered design-system before tap-target, so no cycle is introduced.\n *\n * BEHAVIOR is matrx-frontend's, verbatim, including the ruling both copies\n * carried in prose:\n *\n * 1. THE ROOT RENDERS UNCONDITIONALLY — no hydration mount gate. The gate the\n * host wrapper once carried (\"Radix generates dynamic aria-controls ids that\n * differ between SSR and client\") was false: Radix ids come from React's\n * SSR-stable `useId`. It was actively harmful — a Trigger wraps\n * ALWAYS-VISIBLE content, so `return null` deleted that subtree from SSR and\n * the first client paint.\n *\n * 2. THE SURFACE IS TOKEN-DRIVEN, NOT BRANDED. Popover tokens, not\n * `bg-primary`: rich tooltip content using `text-muted-foreground` was\n * illegible on a brand-colored background in one theme or the other.\n * Since 2026-09-28 the `.matrx-tooltip` class re-scopes those tokens to a dark,\n * high-contrast chip in both themes (styles.css, THE TOOLTIP SURFACE): the\n * neutral white surface it wore before was indistinguishable from the\n * browser's own `title` box.\n *\n * 3. EVERY `title` IS THIS TOOLTIP. The provider installs the title takeover\n * (`title-tooltips.ts`), so a hand-written `title=` anywhere in the\n * document shows this surface, never the browser's.\n *\n * SEAM INVERSION. The host resolved nested portal targets through\n * `useNestedPortalContainer` (an app hook wired to its dialog + window-panel\n * systems); tap-target's port dropped that seam entirely and always portalled\n * to `document.body` — which is why a tooltip inside a popped-out panel landed\n * in the wrong window. Here it is the package's `PortalContainerProvider`\n * seam: an explicit `container` prop wins, then the injected container, then\n * `document.body`. Both prior behaviors are reachable; neither is forked.\n */\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { MOTION_POPPER } from \"./motion\";\nimport { usePortalContainer } from \"./portal-container\";\nimport { acquireTitleTooltips, clipTooltipText, tooltipSide, TOOLTIP_EDGE_PX, TOOLTIP_LAYER_Z, TOOLTIP_TRIGGER_ATTR, type Side } from \"./title-tooltips\";\n\nexport interface TooltipProviderProps\n extends React.ComponentProps<typeof TooltipPrimitive.Provider> {\n /**\n * THE TITLE TAKEOVER (2026-09-28) — while any provider is mounted, every native\n * `title` attribute in the document shows as this tooltip instead of the\n * browser's (see `title-tooltips.ts`). On by default, because a rule every\n * author must remember is a rule that is broken; pass `false` only for a\n * surface that must keep the browser's own box. One provider opting out does\n * not turn it off while another one is mounted.\n */\n titleTooltips?: boolean;\n}\n\n/**\n * Mount once near the app root. Every tooltip in the tree shares its\n * `delayDuration` / `skipDelayDuration` timing, and the root provider takes\n * over native `title` attributes (see `titleTooltips`). The fleet default keeps\n * tooltip content hoverable and selectable. A native mirrored Desktop shell may\n * explicitly opt in to `disableHoverableContent` so its overlay view yields the\n * pointer back to the host; ordinary application tooltips must leave it unset.\n */\nfunction TooltipProvider({ titleTooltips = true, disableHoverableContent = false, ...props }: TooltipProviderProps) {\n React.useEffect(() => {\n if (!titleTooltips) return;\n return acquireTitleTooltips();\n }, [titleTooltips]);\n return <TooltipPrimitive.Provider {...props} disableHoverableContent={disableHoverableContent} />;\n}\n\n/**\n * The tooltip root inherits its provider's hoverability policy: the ordinary\n * provider defaults to hoverable, selectable content (Arman, 2026-10-14), while\n * a native mirrored Desktop shell may opt in at its provider so the overlay view\n * yields pointer control to its host. An explicit root prop still wins.\n */\n/** The tooltip's trigger and whether it is open, so its content takes THE SMART SIDE\n * (title-tooltips.ts) from where the trigger stands at the moment it opens. */\ninterface TriggerState {\n ref: React.MutableRefObject<HTMLElement | null>;\n open: boolean;\n}\nconst TriggerContext = React.createContext<TriggerState | null>(null);\n\nconst Tooltip = ({ onOpenChange, ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>) => {\n const ref = React.useRef<HTMLElement | null>(null);\n const [open, setOpen] = React.useState(Boolean(props.open ?? props.defaultOpen));\n const shown = props.open ?? open;\n const value = React.useMemo(() => ({ ref, open: shown }), [shown]);\n return (\n <TriggerContext.Provider value={value}>\n <TooltipPrimitive.Root\n {...props}\n onOpenChange={(next) => {\n setOpen(next);\n onOpenChange?.(next);\n }}\n />\n </TriggerContext.Provider>\n );\n};\nTooltip.displayName = \"Tooltip\";\n\n/**\n * Stamps `data-matrx-tooltip-trigger` so the title takeover never draws a\n * second tooltip over a control that already has this one — it still lifts a\n * `title` on the same control, so the browser's box never doubles it either.\n */\nconst TooltipTrigger = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Trigger>\n>((props, ref) => {\n const trigger = React.useContext(TriggerContext);\n const setRef = React.useCallback(\n (node: HTMLButtonElement | null) => {\n if (trigger) trigger.ref.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n },\n [trigger, ref],\n );\n return <TooltipPrimitive.Trigger ref={setRef} {...{ [TOOLTIP_TRIGGER_ATTR]: \"\" }} {...props} />;\n});\nTooltipTrigger.displayName = TooltipPrimitive.Trigger.displayName;\n\nexport interface TooltipContentProps\n extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> {\n /**\n * Explicit portal target; wins over the injected `PortalContainerProvider`\n * value. Pass `null` to force `document.body`.\n */\n container?: HTMLElement | null;\n /**\n * Package-owned open/close motion. Default `true`. Pass `false` for a\n * surface that must appear instantly. It is NOT the reduced-motion switch;\n * `styles.css` already honors `prefers-reduced-motion`.\n */\n animated?: boolean;\n /**\n * The side when the control is not in a vertical stack and no side is given (the host's default:\n * a macOS desktop host says \"bottom\"). Omit for the document's `data-title-side`, else \"top\".\n */\n fallbackSide?: Side;\n}\n\nconst TooltipContent = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Content>,\n TooltipContentProps\n>(({ className, side, fallbackSide, sideOffset = 4, collisionPadding = TOOLTIP_EDGE_PX, container, animated = true, children, style, ...props }, ref) => {\n const resolved = usePortalContainer(container);\n const trigger = React.useContext(TriggerContext);\n // THE SMART SIDE: an explicit side wins; otherwise where the trigger's neighbours stand decides.\n const placed = side ?? (trigger?.open ? tooltipSide(trigger.ref.current, fallbackSide) : (fallbackSide ?? \"top\"));\n return (\n <TooltipPrimitive.Portal container={resolved ?? null}>\n <TooltipPrimitive.Content\n ref={ref}\n data-slot=\"tooltip-content\"\n side={placed}\n sideOffset={sideOffset}\n // Flip and stay inside the window: Radix flips to the opposite side when the preferred one\n // does not fit, and shifts along the edge; the padding keeps it off the window's border.\n avoidCollisions\n collisionPadding={collisionPadding}\n className={cn(\n \"matrx-tooltip max-w-xs select-text overflow-hidden whitespace-normal break-words rounded-md border border-border bg-popover px-2.5 py-1 text-xs font-medium text-popover-foreground\",\n animated && MOTION_POPPER,\n className,\n )}\n // THE tooltip layer: above every menu, popover and modal (Radix copies it onto its wrapper).\n style={{ zIndex: TOOLTIP_LAYER_Z, ...style }}\n {...props}\n >\n {typeof children === \"string\" ? clipTooltipText(children) : children}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n});\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nexport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };\nexport { acquireTitleTooltips, clipTooltipText, NATIVE_TITLE_OPT_OUT_ATTR, TOOLTIP_TEXT_BUDGET } from \"./title-tooltips\";\n","// InfoHint (moved from matrx-frontend components/official, 2026-10-22)\n//\n// THE DEFINITION HINT — a small info icon beside a label that reveals one\n// sentence defining it. Use it wherever a label needs a definition\n// (`common-docs/policies/interface-text-is-layout.md`: definitions live behind\n// an info icon, never in visible prose). Model: Stripe dashboard metric labels.\n//\n// Reachable three ways, which a native `title=` is not:\n// - mouse: hover opens the tooltip;\n// - keyboard: the icon is a real button, so Tab focus opens the tooltip and\n// Escape closes it;\n// - touch (`pointer: coarse` or a phone-width viewport): tap toggles a small\n// popover; outside tap or Escape closes it.\n//\n// Safe inside a link or clickable row (KpiTile with `href`): the trigger and\n// the portaled content both stop propagation and prevent the default, so\n// opening a definition never navigates.\n//\n// The icon's hit area is ≥ 24px (44px on a coarse pointer) via an absolutely positioned pseudo-element,\n// so the glyph sits inline without changing the surrounding line height.\n// Text budget: one sentence, ≤ 140 characters.\n\n\"use client\";\n\nimport { InfoIcon } from \"../icons\";\nimport { useState, useSyncExternalStore, type SyntheticEvent } from \"react\";\n\nimport { Popover, PopoverContent, PopoverTrigger } from \"../popover\";\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from \"../tooltip\";\nimport { useIsMobile } from \"../use-is-mobile\";\nimport { cn } from \"../cn\";\n\nconst COARSE_POINTER_QUERY = \"(pointer: coarse)\";\n\nfunction subscribeCoarse(onChange: () => void) {\n const mq = window.matchMedia(COARSE_POINTER_QUERY);\n mq.addEventListener(\"change\", onChange);\n return () => mq.removeEventListener(\"change\", onChange);\n}\n\nfunction useCoarsePointer() {\n return useSyncExternalStore(\n subscribeCoarse,\n () => window.matchMedia(COARSE_POINTER_QUERY).matches,\n () => false,\n );\n}\n\n/** Keep a hint's clicks from reaching a parent link, row, or card. */\nfunction isolate(e: SyntheticEvent) {\n e.stopPropagation();\n e.preventDefault();\n}\n\nexport interface InfoHintProps {\n /** The definition: one sentence, ≤ 140 characters. */\n text: string;\n /** Accessible name of the icon button. */\n label?: string;\n className?: string;\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n}\n\nconst TRIGGER_CLASS =\n \"relative inline-flex h-3.5 w-3.5 shrink-0 cursor-help items-center justify-center rounded-sm align-[-0.125em] text-muted-foreground transition-colors hover:text-foreground focus-visible:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring before:absolute before:-inset-[5px] before:content-[''] [@media(pointer:coarse)]:before:-inset-[15px]\";\n\nconst CONTENT_CLASS =\n \"max-w-[16rem] text-xs font-normal normal-case leading-snug tracking-normal\";\n\nexport function InfoHint({ text, label = \"More info\", className, side = \"top\" }: InfoHintProps) {\n const coarse = useCoarsePointer();\n const isMobile = useIsMobile();\n const [open, setOpen] = useState(false);\n\n const glyph = <InfoIcon aria-hidden className=\"h-3.5 w-3.5\" strokeWidth={2} />;\n\n if (coarse || isMobile) {\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n aria-label={label}\n className={cn(TRIGGER_CLASS, className)}\n onClick={(e) => {\n isolate(e);\n setOpen((v) => !v);\n }}\n onPointerDown={(e) => e.stopPropagation()}\n >\n {glyph}\n </button>\n </PopoverTrigger>\n <PopoverContent /* sizing: fixed — a fixed-measure panel on purpose; its rows truncate inside the box */\n side={side}\n sideOffset={6}\n className={cn(\"w-auto px-3 py-2 text-popover-foreground\", CONTENT_CLASS)}\n onClick={isolate}\n onPointerDown={(e) => e.stopPropagation()}\n onOpenAutoFocus={(e) => e.preventDefault()}\n >\n {text}\n </PopoverContent>\n </Popover>\n );\n }\n\n return (\n // Brings its own provider: an official component works wherever it is imported (a\n // test, a portal, a page without the app shell) — 2026-09-30, final-switch tests.\n <TooltipProvider delayDuration={200}>\n <Tooltip open={open} onOpenChange={setOpen}>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n aria-label={label}\n className={cn(TRIGGER_CLASS, className)}\n // A click opens it too (hover is not the only way in).\n onClick={(e) => {\n isolate(e);\n setOpen(true);\n }}\n // Inside a table header (or any parent that has its own tooltip or drag handle), the\n // parent must not see the pointer: its tooltip would open and close this one, and a\n // press would start a column drag. Found 2026-10-11 on MatrxDataTable headers.\n onPointerMove={(e) => e.stopPropagation()}\n onPointerDown={(e) => e.stopPropagation()}\n onFocus={(e) => e.stopPropagation()}\n >\n {glyph}\n </button>\n </TooltipTrigger>\n <TooltipContent side={side} className={CONTENT_CLASS} onClick={isolate}>\n {text}\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n );\n}\n\nexport default InfoHint;\n","\"use client\";\n\n// THE canonical lifecycle-status badge (moved from matrx-frontend components/official/status-badge,\n// wave 2, 2026-10-22): one tinted, icon-led pill for \"what state is this record in\" (draft / active /\n// disabled / archived and their cousins on other entities). The tone is a NAME (`success`, `warning`,\n// `danger`, `neutral`, `info`) resolved through the role tokens — the same tints the Badge and the\n// Chip use — never a color class at a call site. The icon carries the meaning for color-blind\n// readers, and the label is always a word, never a dot alone.\n//\n// Entity modules own their status VOCABULARY (which statuses exist, what each means, which tone it\n// wears); this primitive owns only the LOOK, so every entity's status reads the same everywhere.\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\n\nexport type StatusTone = \"success\" | \"warning\" | \"danger\" | \"neutral\" | \"info\";\nexport type StatusBadgeSize = \"sm\" | \"md\" | \"lg\";\n\n/** Every status tone, in a fixed order (tests, pickers, demos). */\nexport const STATUS_TONES: readonly StatusTone[] = [\"success\", \"warning\", \"danger\", \"neutral\", \"info\"] as const;\n\nconst TONE_CLASS: Record<StatusTone, string> = {\n success: \"border-success/40 bg-success/15 text-success-ink\",\n warning: \"border-warning/50 bg-warning/20 text-warning-ink\",\n danger: \"border-destructive/40 bg-destructive/15 text-destructive-ink\",\n neutral: \"border-border bg-muted text-foreground\",\n info: \"border-info/40 bg-info/15 text-info-ink\",\n};\n\nconst SIZE_CLASS: Record<StatusBadgeSize, { root: string; icon: string }> = {\n sm: { root: \"gap-1 px-1.5 py-0.5 text-[11px]\", icon: \"h-3 w-3\" },\n md: { root: \"gap-1.5 px-2 py-0.5 text-xs\", icon: \"h-3.5 w-3.5\" },\n lg: { root: \"gap-1.5 px-2.5 py-1 text-sm\", icon: \"h-4 w-4\" },\n};\n\nexport interface StatusBadgeProps {\n label: string;\n tone: StatusTone;\n /** Any glyph component (a design-system glyph, a Lucide icon); it receives `className`. */\n icon?: React.ComponentType<{ className?: string; \"aria-hidden\"?: boolean }>;\n size?: StatusBadgeSize;\n /** One sentence saying what the status means — the hover text. */\n title?: string;\n /**\n * A glyph drawn INSIDE the capsule after the label — the chevron of a status that opens a menu.\n * One capsule, never a pill wrapped in another rounded box.\n */\n trailing?: React.ReactNode;\n className?: string;\n}\n\nexport function StatusBadge({ label, tone, icon: Icon, size = \"md\", title, trailing, className }: StatusBadgeProps) {\n const s = SIZE_CLASS[size];\n return (\n <span\n role=\"status\"\n aria-label={title ? `${label}: ${title}` : label}\n title={title}\n data-status-tone={tone}\n className={cn(\n // matrx-glyph-trim: the icon's and chevron's own air is removed on both sides, so the INK\n // sits the same distance from either edge.\n \"matrx-glyph-trim inline-flex shrink-0 items-center whitespace-nowrap rounded-full border font-semibold leading-none\",\n TONE_CLASS[tone],\n s.root,\n className,\n )}\n >\n {Icon ? <Icon aria-hidden className={cn(\"shrink-0\", s.icon)} /> : null}\n {label}\n {trailing}\n </span>\n );\n}\n","\"use client\";\n\n// A titled section card: a header (title, description, actions), a body, and an optional three-column\n// footer. Moved from matrx-frontend components/official/StructuredSectionCard (wave 2, 2026-10-22).\n// The header and title used hard-coded gray / rose; they are now the role tokens, with the title's\n// ink a NAMED option (`titleTone`) instead of a pasted color: `primary` (default) or `foreground`.\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\n\nexport type StructuredSectionCardTitleTone = \"primary\" | \"foreground\";\n\nconst TITLE_TONE: Record<StructuredSectionCardTitleTone, string> = {\n primary: \"text-primary-ink\",\n foreground: \"text-foreground\",\n};\n\nexport interface StructuredSectionCardProps {\n title: string;\n description?: string;\n children: React.ReactNode;\n headerActions?: React.ReactNode[];\n footerLeft?: React.ReactNode;\n footerCenter?: React.ReactNode;\n footerRight?: React.ReactNode;\n /** The title's ink, by name. Default `primary`. */\n titleTone?: StructuredSectionCardTitleTone;\n className?: string;\n}\n\nexport function StructuredSectionCard({\n title,\n description,\n children,\n headerActions = [],\n footerLeft,\n footerCenter,\n footerRight,\n titleTone = \"primary\",\n className,\n}: StructuredSectionCardProps) {\n const hasFooter = footerLeft || footerCenter || footerRight;\n return (\n <div\n data-slot=\"structured-section-card\"\n className={cn(\"overflow-hidden rounded-xl border-border bg-textured shadow-sm\", className)}\n >\n <div className=\"flex items-center justify-between border-b border-border bg-muted px-4 py-3\">\n <div className=\"min-w-0\">\n <h3 className={cn(\"font-medium\", TITLE_TONE[titleTone])}>{title}</h3>\n {description && <p className=\"type-body text-muted-foreground\">{description}</p>}\n </div>\n {headerActions.length > 0 && (\n <div className=\"ml-4 flex shrink-0 items-center space-x-2\">\n {headerActions.map((action, index) => (\n <React.Fragment key={index}>{action}</React.Fragment>\n ))}\n </div>\n )}\n </div>\n\n <div className=\"p-4\">{children}</div>\n\n {hasFooter && (\n <div className=\"flex flex-wrap items-center border-t border-border px-4 py-3\">\n <div className=\"flex min-w-[33%] flex-1 justify-start space-x-2 sm:min-w-0\">{footerLeft}</div>\n <div className=\"mt-2 flex min-w-[33%] flex-1 justify-center space-x-2 sm:mt-0 sm:min-w-0\">{footerCenter}</div>\n <div className=\"mt-2 flex min-w-[33%] flex-1 justify-end space-x-2 sm:mt-0 sm:min-w-0\">{footerRight}</div>\n </div>\n )}\n </div>\n );\n}\n","\"use client\";\n\n// An icon-led selection menu: the trigger shows the SELECTED option's glyph and a chevron; the menu\n// lists every option with its glyph, the selected one tinted and checked. For sort controls, view\n// modes, filters. Moved from matrx-frontend components/official/IconDropdownMenu (wave 2,\n// 2026-10-22); the selected state was a hard-coded blue and is now the primary role tokens.\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { CheckIcon, ChevronDownIcon } from \"../icons\";\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from \"../dropdown-menu\";\nimport { Button } from \"./controls\";\n\ntype GlyphComponent = React.ComponentType<{ className?: string }>;\n\nexport interface IconDropdownOption<T = string> {\n value: T;\n label: string;\n /** Any glyph component (a design-system glyph, a Lucide icon); it receives `className`. */\n icon: GlyphComponent;\n}\n\nexport interface IconDropdownMenuProps<T = string> {\n options: IconDropdownOption<T>[];\n value: T;\n onValueChange: (value: T) => void;\n /** Dropdown alignment. Default `end`. */\n align?: \"start\" | \"center\" | \"end\";\n /** Places the trigger (margin, position), never restyles it. */\n className?: string;\n /** Width class of the menu. Default `w-48`. */\n menuWidth?: string;\n}\n\nexport function IconDropdownMenu<T extends string = string>({\n options,\n value,\n onValueChange,\n align = \"end\",\n className,\n menuWidth = \"w-48\",\n}: IconDropdownMenuProps<T>) {\n const selected = options.find((opt) => opt.value === value) ?? options[0];\n const SelectedIcon = selected?.icon;\n if (!SelectedIcon) {\n console.warn(\"IconDropdownMenu: no option to show — pass at least one option.\");\n return null;\n }\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n icon={<SelectedIcon />}\n iconEnd={<ChevronDownIcon />}\n variant=\"outline\"\n aria-label={selected.label}\n {...(className ? { className } : {})}\n />\n </DropdownMenuTrigger>\n <DropdownMenuContent align={align} className={cn(\"rounded-2xl p-1\", menuWidth)}>\n {options.map((option) => {\n const isSelected = option.value === value;\n const OptionIcon = option.icon;\n return (\n <DropdownMenuItem\n key={String(option.value)}\n onClick={() => onValueChange(option.value)}\n data-selected={isSelected ? \"\" : undefined}\n className={cn(\n \"flex cursor-pointer items-center gap-3 rounded-lg px-3 py-2.5 transition-colors\",\n isSelected && \"bg-primary/10\",\n )}\n >\n <OptionIcon className={cn(\"h-4 w-4 shrink-0\", isSelected ? \"text-primary-ink\" : \"text-muted-foreground\")} />\n <span className={cn(\"type-body flex-1 leading-tight\", isSelected ? \"font-medium text-primary-ink\" : \"text-foreground\")}>\n {option.label}\n </span>\n {isSelected && <CheckIcon className=\"h-4 w-4 shrink-0 text-primary-ink\" />}\n </DropdownMenuItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n","/**\n * ErrorBox — THE one way a package draws an error on screen, and the seam a\n * host uses to put its own actions on every one of them.\n *\n * Every error sentence this package (and every sibling package that depends\n * on it) shows is an `ErrorBox`. The box is a plain `role=\"alert\"` element —\n * its tag and classes are the caller's, so nothing about the look changes — and\n * after its children it renders whatever the host's `ErrorActionsProvider`\n * returns for that error. With no provider it renders nothing extra.\n *\n * Why a slot and not a menu: the package cannot know the host's AI copy, bug\n * report, or support flow (Matrx fills it with its Alchemy copy-for-AI menu at\n * the app root). The package supplies the error's facts — the sentence, the\n * raw error, the operation, the records — and the host decides the actions.\n *\n * Guard: `error-box.census.test.ts` fails when a package file renders\n * `role=\"alert\"` for an error without going through `ErrorBox` (or, for the\n * `Alert` family, `ErrorActions`).\n */\nimport * as React from \"react\";\nimport { peopleErrorSentence } from \"./error-sentence\";\n\nexport interface ErrorActionsRecord {\n type: string;\n id: string;\n label?: string;\n}\n\n/** The facts a package knows about an error it is showing. All optional. */\nexport interface ErrorActionsInput {\n /** The sentence shown. Omit when the words are only in the rendered box. */\n message?: string | undefined;\n title?: string | undefined;\n /** The raw error (code/status/stack stay available to the host). */\n error?: unknown | undefined;\n /** What was being attempted (\"Load saved views\"). */\n operation?: string | undefined;\n records?: readonly ErrorActionsRecord[] | undefined;\n /** The person's input that did not land. */\n unsavedInput?: unknown | undefined;\n /** The package + component that drew it (\"design-system/SavedViewsControl\"). */\n origin?: string | undefined;\n /** Extra structured facts for the AI payload (never shown). */\n details?: Record<string, unknown> | undefined;\n code?: string | number | undefined;\n status?: number | undefined;\n /** The tables / RPCs the failed call used — pins its captured request as the cause. */\n calls?: readonly string[] | undefined;\n /** Where it was drawn: an `ErrorNotice` card/line (\"inline\") or a package alert box (\"alert\", the default). */\n source?: \"inline\" | \"alert\" | undefined;\n}\n\nexport type ErrorActionsRenderer = (input: ErrorActionsInput) => React.ReactNode;\n\n/**\n * ONE context for every copy of this module. tsup builds each entry point\n * (`.`, `./data-table`, …) without code splitting, so this file is inlined into\n * several bundles; a plain `createContext` would give each bundle its own\n * context and the host's provider (imported from `.`) would never reach an\n * error drawn by the data table. The registry key makes them one.\n */\nconst CONTEXT_KEY = Symbol.for(\"@ai-matrx/design-system/error-actions\");\ntype ContextRegistry = Record<symbol, React.Context<ErrorActionsRenderer | null> | undefined>;\nconst registry = globalThis as unknown as ContextRegistry;\nconst ErrorActionsContext: React.Context<ErrorActionsRenderer | null> =\n registry[CONTEXT_KEY] ??\n (registry[CONTEXT_KEY] = React.createContext<ErrorActionsRenderer | null>(null));\n\n/** Mount once at the host's app root; every ErrorBox below renders `render(...)`. */\nexport function ErrorActionsProvider({\n render,\n children,\n}: {\n render: ErrorActionsRenderer;\n children: React.ReactNode;\n}) {\n return (\n <ErrorActionsContext.Provider value={render}>{children}</ErrorActionsContext.Provider>\n );\n}\n\n/**\n * The host's content menu around an error card (`ErrorNotice`): the corner ⋯\n * button and the right-click boundary that show the host's content actions\n * over the error's sentence. Read-only — nothing here may change a record.\n * Without a provider the card draws neither (the actions slot still renders).\n */\nexport interface ErrorCardMenus {\n /** The corner ⋯ button over `{ title, text }`. */\n Button: React.ComponentType<{ title: string; text: string; className?: string }>;\n /** Wraps the whole card so right-click opens the same menu. */\n Boundary: React.ComponentType<{ title: string; text: string; children: React.ReactNode }>;\n}\n\nconst MENUS_KEY = Symbol.for(\"@ai-matrx/design-system/error-card-menus\");\ntype MenusRegistry = Record<symbol, React.Context<ErrorCardMenus | null> | undefined>;\nconst menusRegistry = globalThis as unknown as MenusRegistry;\nconst ErrorCardMenusContext: React.Context<ErrorCardMenus | null> =\n menusRegistry[MENUS_KEY] ??\n (menusRegistry[MENUS_KEY] = React.createContext<ErrorCardMenus | null>(null));\n\n/** Mount once at the host's app root beside `ErrorActionsProvider`. */\nexport function ErrorCardMenusProvider({\n menus,\n children,\n}: {\n menus: ErrorCardMenus;\n children: React.ReactNode;\n}) {\n return <ErrorCardMenusContext.Provider value={menus}>{children}</ErrorCardMenusContext.Provider>;\n}\n\nexport function useErrorCardMenus(): ErrorCardMenus | null {\n return React.useContext(ErrorCardMenusContext);\n}\n\nexport function useErrorActions(): ErrorActionsRenderer | null {\n return React.useContext(ErrorActionsContext);\n}\n\n/**\n * The host's actions for one error, placed wherever the caller puts this\n * element. Renders nothing without a provider. Use inside a box you do not\n * render yourself (the `Alert` family); everything else uses `ErrorBox`.\n */\nexport function ErrorActions(props: ErrorActionsInput) {\n const render = useErrorActions();\n if (!render) return null;\n return <>{render(props)}</>;\n}\n\ntype ErrorBoxTag = \"p\" | \"div\" | \"span\" | \"section\" | \"li\";\n\nexport interface ErrorBoxProps\n extends Omit<React.HTMLAttributes<HTMLElement>, \"role\" | \"title\">,\n ErrorActionsInput {\n /** The element drawn — the caller's existing tag, so layout never shifts. */\n as?: ErrorBoxTag;\n}\n\n/** A plain-string body goes through the one funnel (error-sentence.ts); rich children are the caller's. */\nfunction sayable(body: React.ReactNode, error: unknown): React.ReactNode {\n if (typeof body === \"string\") return peopleErrorSentence(error, body);\n if (Array.isArray(body)) return body.map((b) => (typeof b === \"string\" && b.trim() ? peopleErrorSentence(error, b) : b));\n return body;\n}\n\nexport const ErrorBox = React.forwardRef<HTMLElement, ErrorBoxProps>(function ErrorBox(\n {\n as = \"p\",\n message,\n title,\n error,\n operation,\n records,\n unsavedInput,\n origin,\n children,\n ...rest\n },\n ref,\n) {\n // A component type, never a bare ElementType: an app compiling this source may carry global JSX\n // elements (react-three-fiber) that make a bare ElementType's props `never` (2026-10-22).\n const Tag = as as unknown as React.ComponentType<React.HTMLAttributes<HTMLElement> & { ref?: React.Ref<HTMLElement> }>;\n const facts: ErrorActionsInput = {\n ...(message !== undefined ? { message } : {}),\n ...(title !== undefined ? { title } : {}),\n ...(error !== undefined ? { error } : {}),\n ...(operation !== undefined ? { operation } : {}),\n ...(records !== undefined ? { records } : {}),\n ...(unsavedInput !== undefined ? { unsavedInput } : {}),\n ...(origin !== undefined ? { origin } : {}),\n };\n return (\n <Tag ref={ref} role=\"alert\" data-error-box=\"\" {...rest}>\n {sayable(children ?? message, error)}\n <ErrorActions {...facts} />\n </Tag>\n );\n});\n","/**\n * THE error-wording layer. A failure is shown as a cause the person can act on (\"A program it\n * needs isn't installed\"), never as the raw text a process threw (\"spawn uv ENOENT\"). The raw text\n * is kept, whole, as `detail` — the banner offers it behind Copy details and a tooltip, for a bug\n * report or an agent. One table, so every screen and every service says the same thing.\n */\n\nexport interface DescribedError {\n /** One plain sentence: what went wrong and, where it helps, what to do. */\n cause: string;\n /** The raw text, unedited (empty when it would only repeat `cause`). */\n detail: string;\n /** A short machine code when one was recognized (\"ENOENT\", \"TIMEOUT\"). */\n code?: string;\n}\n\ninterface Rule {\n code: string;\n test: RegExp;\n cause: string;\n}\n\n/** Ordered: the first rule whose pattern matches the raw text wins. */\nconst RULES: ReadonlyArray<Rule> = [\n { code: \"ENOENT\", test: /\\b(spawn\\s+\\S+\\s+)?ENOENT\\b|command not found|no such file or directory/i, cause: \"A program or file it needs isn't on this computer. Install it or update Matrx, then try again.\" },\n { code: \"EACCES\", test: /\\bEACCES\\b|\\bEPERM\\b|permission denied|operation not permitted|not authori[sz]ed by the user/i, cause: \"Matrx isn't allowed to do that. Grant access in System Settings › Privacy & Security, then try again.\" },\n { code: \"EADDRINUSE\", test: /\\bEADDRINUSE\\b|address already in use|port .* (is )?(already )?in use/i, cause: \"Another program is already using that port. Stop it, or choose another port.\" },\n { code: \"ECONNREFUSED\", test: /\\bECONNREFUSED\\b|connection refused/i, cause: \"The service isn't answering. It may have stopped; start it again.\" },\n { code: \"OFFLINE\", test: /\\bENOTFOUND\\b|\\bEAI_AGAIN\\b|\\bENETUNREACH\\b|getaddrinfo|network (is )?unreachable|failed to fetch|offline/i, cause: \"Can't reach the internet. Check the connection and try again.\" },\n { code: \"TIMEOUT\", test: /\\bETIMEDOUT\\b|timed? ?out|\\bTIMEOUT\\b|deadline exceeded/i, cause: \"It took too long to answer. Try again in a moment.\" },\n { code: \"ENOSPC\", test: /\\bENOSPC\\b|no space left/i, cause: \"The disk is full. Free some space, then try again.\" },\n { code: \"ENOMEM\", test: /\\bENOMEM\\b|out of memory|cannot allocate memory/i, cause: \"The computer ran out of memory. Close something and try again.\" },\n { code: \"UNAUTHORIZED\", test: /\\b401\\b|unauthori[sz]ed|invalid (api )?key|not signed in|jwt expired|session expired/i, cause: \"You're signed out, or the key was refused. Sign in again.\" },\n { code: \"FORBIDDEN\", test: /\\b403\\b|forbidden/i, cause: \"This account isn't allowed to do that.\" },\n { code: \"NOT_FOUND\", test: /\\b404\\b|not found/i, cause: \"It isn't there any more. Refresh and try again.\" },\n { code: \"RATE_LIMIT\", test: /\\b429\\b|rate.?limit|too many requests/i, cause: \"Too many requests just now. Wait a moment and try again.\" },\n { code: \"SERVER\", test: /\\b5\\d\\d\\b|internal server error|bad gateway|service unavailable/i, cause: \"The server had a problem. Try again in a moment.\" },\n { code: \"EXITED\", test: /exited with code|process exited|crashed|SIGKILL|SIGSEGV|SIGTERM/i, cause: \"The service stopped unexpectedly. Start it again; Copy details if it keeps happening.\" },\n];\n\nconst RAW = /\\b[A-Z]{2,}[A-Z_]*\\b|[\\\\/][\\w.-]+[\\\\/]|\\bat \\S+ \\(|\\{|\\}|errno|stack|undefined|null|\\bspawn\\b/;\n\nfunction rawText(error: unknown): string {\n if (error instanceof Error) return error.message || error.name;\n if (typeof error === \"string\") return error;\n if (error && typeof error === \"object\" && \"message\" in error && typeof (error as { message: unknown }).message === \"string\") {\n return (error as { message: string }).message;\n }\n return \"\";\n}\n\n/**\n * Turn any thrown or returned error into words a person can act on. Already-humane text (a full\n * sentence the app wrote itself, with no codes, paths or stack) passes through unchanged.\n */\nexport function describeError(error: unknown, fallback = \"Something went wrong. Try again.\"): DescribedError {\n const detail = rawText(error).trim();\n if (!detail) return { cause: fallback, detail: \"\" };\n for (const rule of RULES) {\n if (rule.test.test(detail)) return { cause: rule.cause, detail, code: rule.code };\n }\n if (!RAW.test(detail) && detail.length <= 160) return { cause: detail, detail: \"\" };\n return { cause: fallback, detail };\n}\n","/**\n * THE SENTENCE A PERSON READS FOR AN ERROR — the one funnel every error surface draws through\n * (ErrorNotice, ErrorBox, the desktop Banner). Raw error text never reaches the screen: no\n * \"TypeError: Failed to fetch\", no `sidebar_conversations:` RPC prefix, no stack frame or file\n * path (Arman, 2026-10-24: notices are small and plain). The raw error still travels to the\n * Alchemy Menu / AI payload through the `error` prop; only the screen gets the sentence.\n *\n * The wording table is desktop/errors.ts `describeError` (one table for every screen); this file\n * adds what decides WHEN a sentence must go through it, narrow enough that an app's own sentence\n * (\"PDF too large\") passes untouched.\n */\nimport { describeError } from \"./desktop/errors\";\n\n/**\n * The sentence an error carries: its own message (string, Error, or any\n * object with a `message`). Empty when it has none.\n */\nexport function errorSentenceOf(error: unknown): string {\n if (error == null || error === true || error === false) return \"\";\n if (typeof error === \"string\") return error;\n if (typeof error !== \"object\") return String(error);\n const message = (error as { message?: unknown }).message;\n return typeof message === \"string\" ? message : \"\";\n}\n\n/**\n * What a person reads when the store cancelled a call at its statement timeout\n * (SQLSTATE 57014). Postgres' own \"canceling statement due to statement\n * timeout\" is about the database, not the person; the cancelled call rolled\n * back, so nothing was written (lane AT-SLOW, 2026-10-19). The same sentence\n * @ai-matrx/records' `TIMED_OUT_MESSAGE` gives.\n */\nexport const TIMED_OUT_SENTENCE = \"That took too long. Nothing was lost; try again.\";\n\n/** What a person reads when an error says nothing a person can use. */\nexport const FALLBACK_ERROR_SENTENCE = \"Something went wrong. Try again.\";\n\n/**\n * A notice CARD's words (the web toast, Matrx 2's floating card): a card is ~22 rem at most and its\n * action shares the row, so a line is a few words (notice-stack.ts NOTICE_TEXT_BUDGET). The same\n * causes as the sentences above, said short enough to fit at the smallest window, never cut by \"…\".\n */\nexport const CARD_ERROR_LINE = {\n OFFLINE: \"No connection\",\n TIMEOUT: \"Took too long. Nothing was lost.\",\n UNAUTHORIZED: \"Signed out. Sign in again.\",\n FORBIDDEN: \"Not allowed for this account\",\n NOT_FOUND: \"Not found. Refresh and retry.\",\n RATE_LIMIT: \"Too many requests. Wait a moment.\",\n SERVER: \"Server problem. Try again soon.\",\n FALLBACK: \"Something went wrong\",\n} as const;\n\n/** True when an error, its code, or its sentence is the store's statement timeout. */\nexport function isTimedOutError(error: unknown, message?: string | null, code?: string | number): boolean {\n if (code === \"57014\" || code === \"timed_out\") return true;\n if (error && typeof error === \"object\") {\n const o = error as { code?: unknown; sqlstate?: unknown };\n if (o.code === \"57014\" || o.code === \"timed_out\" || o.sqlstate === \"57014\") return true;\n }\n const text = `${message ?? \"\"} ${errorSentenceOf(error)}`;\n return /canceling statement due to statement timeout/i.test(text);\n}\n\n/** True when the call failed because the device is offline or the network never answered. */\nexport function isOfflineError(error: unknown, message?: string | null): boolean {\n if (typeof navigator !== \"undefined\" && navigator.onLine === false) return true;\n return offlineText(`${message ?? \"\"} ${errorSentenceOf(error)}`);\n}\n\nfunction offlineText(text: string): boolean {\n const t = text.trim();\n return t !== \"\" && (describeError(t).code === \"OFFLINE\" || /networkerror|network request failed|load failed/i.test(t));\n}\n\n/** describeError's causes that hold on every host (its process codes — ENOENT, EACCES, ports — are\n * the desktop's words for a local program and would mislead on a database refusal). */\nconst ANY_HOST_CODES = new Set([\"OFFLINE\", \"TIMEOUT\", \"UNAUTHORIZED\", \"FORBIDDEN\", \"NOT_FOUND\", \"RATE_LIMIT\", \"SERVER\"]);\n\n/** A leading machine label: `sidebar_conversations: …`, `chat.rpc_name: …`, `[chat-sidebar] …`. */\nconst MACHINE_PREFIX = /^\\s*(?:\\[[\\w./-]+\\]\\s*|[a-z][\\w]*(?:[._][\\w]+)+:\\s+)/;\n/** Text no person should read: JS error class names, stack frames, source paths. */\nconst RAW_TEXT =\n /\\b(?:Type|Reference|Syntax|Range|Internal|Eval|URI)Error\\b|\\bat\\s+[\\w$.<>]+\\s*\\(|\\.(?:[cm]?[jt]sx?|py):\\d+|(?:^|[\\s(])(?:\\/[\\w.@-]+){2,}|\\bundefined is not\\b|\\bcannot read propert(?:y|ies)\\b|\\bis not a function\\b|\\bunexpected token\\b/i;\n\n/** True when a sentence carries raw error text or a code path (what the guard refuses on screen). */\nexport function isRawErrorText(text: string): boolean {\n return MACHINE_PREFIX.test(text) || RAW_TEXT.test(text);\n}\n\n/**\n * `card: true` = the short CARD_ERROR_LINE words for a notice card. Otherwise:\n * the sentence for the screen: the timeout sentence for a statement timeout; a caller's plain\n * sentence as is; a machine label stripped from the front; anything raw or offline worded by\n * `describeError` (its table, else `fallback`).\n */\nexport function peopleErrorSentence(\n error: unknown,\n message?: string | null,\n options: { code?: string | number | undefined; fallback?: string | undefined; card?: boolean | undefined } = {},\n): string {\n const card = options.card === true;\n if (isTimedOutError(error, message, options.code)) return card ? CARD_ERROR_LINE.TIMEOUT : TIMED_OUT_SENTENCE;\n const fallback = options.fallback ?? (card ? CARD_ERROR_LINE.FALLBACK : FALLBACK_ERROR_SENTENCE);\n const raw = message?.trim() || errorSentenceOf(error).trim();\n if (!raw) return fallback;\n let text = raw;\n for (let i = 0; i < 3 && MACHINE_PREFIX.test(text); i++) text = text.replace(MACHINE_PREFIX, \"\").trim();\n if (!text) return fallback;\n if (offlineText(text) || RAW_TEXT.test(text) || text !== raw) {\n const said = describeError(text, fallback);\n if (!said.code || !ANY_HOST_CODES.has(said.code)) return fallback;\n return card ? CARD_ERROR_LINE[said.code as keyof typeof CARD_ERROR_LINE] : said.cause;\n }\n return text;\n}\n","\"use client\";\n\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nexport const Label = React.forwardRef<\n React.ComponentRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(\n \"text-sm font-medium leading-none text-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-70\",\n className,\n )}\n {...props}\n />\n));\nLabel.displayName = LabelPrimitive.Root.displayName;\n","/**\n * Field — the canonical above-label wrapper for any form input.\n *\n * Wraps **any** input (ProTextarea, shadcn Input, Select, custom controls) with\n * a consistent, accessible label/description/error/counter layout. Composition\n * over prop bloat: instead of every input growing label/help/error props, the\n * input stays focused on its job and `Field` owns the surrounding chrome.\n *\n * ## Layout (fixed, by design)\n *\n * ```\n * Label *required (optional) [?] ← help icon, hover for tooltip\n * Description text. Markdown-style hints, format rules.\n * ┌────────────────────────────┐\n * │ <child input> │\n * └────────────────────────────┘\n * ⚠ error message count / max ← right-aligned, color-tiered\n * ```\n *\n * The order is fixed and not configurable. This is intentional: every Field in\n * the app should look identical so users can scan forms without re-learning.\n *\n * ## Required props\n *\n * - `label` — visible text. Always required (a Field without a label is just a div).\n * - `htmlFor` — must match the child input's `id`. This wires the label to the\n * input for screen readers and click-to-focus. Pass the same id to the input.\n *\n * ## Usage\n *\n * Simple labeled input:\n *\n * ```tsx\n * <Field label=\"Title\" htmlFor=\"title\" required>\n * <ProTextarea\n * id=\"title\"\n * value={title}\n * onChange={(e) => setTitle(e.target.value)}\n * />\n * </Field>\n * ```\n *\n * Full feature set:\n *\n * ```tsx\n * <Field\n * label=\"Bio\"\n * htmlFor=\"bio\"\n * required\n * help=\"Markdown supported. Visible on your public profile.\"\n * description=\"Tell visitors who you are.\"\n * error={errors.bio}\n * count={bio.length}\n * maxCount={500}\n * >\n * <ProTextarea id=\"bio\" value={bio} onChange={…} />\n * </Field>\n * ```\n *\n * ## When to use what\n *\n * - **Above-label form (most cases)** → `<Field>` (this component)\n * - **Dense form, label inside the input border** → `<ProTextarea floatingLabel=\"…\" />`\n * - **No label at all (search, comments, filters)** → bare `<ProTextarea>` with `placeholder`\n *\n * ## Constraints (intentional)\n *\n * - The label, description, error, and counter render in a fixed visual order.\n * - No `labelClassName` / `descriptionClassName` / `errorClassName` props.\n * These are styled to a single house standard. If you need a different look,\n * you're outside the official component's scope — build a one-off, don't fork.\n * - `required` and `optional` are mutually exclusive. If both are passed,\n * `required` wins.\n * - The character counter is always **soft** (warns and colors but doesn't\n * block typing). For hard DB-bound limits, also pass `maxLength` to the\n * input itself.\n *\n * @official-component\n */\n\n\"use client\";\n\n// Named LabeledField in the package because `Field` here is already the input capsule (controls.tsx).\n// Moved from matrx-frontend components/official/Field (wave 2, 2026-10-22).\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { CircleAlertIcon, CircleHelpIcon } from \"../icons\";\nimport { ErrorActions } from \"../error-box\";\nimport { Label } from \"../label\";\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from \"../tooltip\";\nimport { InfoHint } from \"./info-hint\";\n\nexport interface LabeledFieldProps {\n /** Visible label text. Always required. */\n label: React.ReactNode;\n /**\n * Must match the child input's `id`. Wires the label for screen readers and\n * click-to-focus. Required — there is no \"no a11y\" mode.\n */\n htmlFor: string;\n /** Marks the field as required. Renders a red asterisk. Wins over `optional`. */\n required?: boolean;\n /**\n * Marks the field as optional. Renders a small gray \"(optional)\" tag.\n * Use sparingly — it's only worth showing when most fields nearby are required.\n */\n optional?: boolean;\n /**\n * Help for the label — one sentence, ≤ 140 chars. A string renders through\n * `InfoHint` (hover, keyboard and tap); a ReactNode keeps a hover tooltip.\n */\n help?: React.ReactNode;\n /**\n * Static helper text rendered between the label and the input. Hidden when\n * an `error` is present so the error takes the spotlight.\n */\n description?: React.ReactNode;\n /**\n * Validation error. When set, the label turns destructive and the error\n * replaces the description. Pair with `aria-invalid` on the child input.\n */\n error?: React.ReactNode;\n /**\n * Current character/word count. Pass `value.length` (or your own metric).\n * Renders bottom-right of the field.\n */\n count?: number;\n /**\n * Soft limit. Counter turns warning at >90%, destructive past 100%.\n * **Does not block typing.** For hard limits, also set `maxLength` on the input.\n */\n maxCount?: number;\n /**\n * 🚨 **THE EMPTY-LOOKS-EMPTY RULE (2026-09-15).** The child input's current\n * value. Pass it on every `required` field.\n *\n * A required field that is EMPTY must LOOK empty. On 2026-09-15 a\n * non-technical Expert could not build their Masterwork because the name\n * field's placeholder (\"Headless Headhunter Resume Review Masterwork\") was\n * indistinguishable from a typed value: the screen said filled, the field\n * was empty, and the primary action sat silently disabled\n * (`teach-recent-practitioner` W2). A placeholder is a suggestion, never an\n * answer, and the screen must say which one it is showing.\n *\n * When `required` is set and this value is blank, `Field` dashes the input's\n * border, fades and italicises its placeholder, and says so underneath — so\n * no placeholder, however value-shaped, can pass for a filled field. The\n * sentence shows only while the control actually shows placeholder text\n * (`:placeholder-shown`): under a box with no example, or a select, it would\n * be false (2026-09-27, /hr/settings/employer).\n *\n * Leave it `undefined` on fields you do not track; the honesty chrome then\n * never renders (it cannot know). `\"\"` means empty and IS tracked.\n */\n value?: string | null;\n /** Outer wrapper className. The only styling escape hatch — used for layout (e.g. `flex-1`). */\n className?: string;\n /** The input. Must have `id={htmlFor}` for the label to work correctly. */\n children: React.ReactNode;\n}\n\n/**\n * @see {@link LabeledFieldProps} for the full prop contract.\n */\nexport function LabeledField({\n label,\n htmlFor,\n required,\n optional,\n help,\n description,\n error,\n count,\n maxCount,\n value,\n className,\n children,\n}: LabeledFieldProps) {\n /**\n * Tracked AND required AND blank. `undefined` is \"not tracked\" — only an\n * explicitly passed value can be judged empty.\n */\n const requiredEmpty =\n Boolean(required) && value !== undefined && !String(value ?? \"\").trim();\n const hasCounter = typeof count === \"number\";\n const overLimit = hasCounter && maxCount != null && count! > maxCount;\n const nearLimit =\n hasCounter &&\n maxCount != null &&\n count! > maxCount * 0.9 &&\n !overLimit;\n\n return (\n <div data-field-root=\"\" className={cn(\"group/field space-y-1.5\", className)}>\n <div className=\"flex items-center gap-1.5\">\n <Label\n htmlFor={htmlFor}\n className={cn(\n \"text-sm font-medium text-foreground\",\n error && \"text-destructive\",\n )}\n >\n {label}\n {required && (\n <span className=\"text-destructive ml-1\" aria-hidden>\n *\n </span>\n )}\n {!required && optional && (\n <span className=\"text-muted-foreground ml-1.5 type-secondary font-normal\">\n (optional)\n </span>\n )}\n </Label>\n {/* A text hint goes through InfoHint so it opens on tap and keyboard too; rich help keeps the hover tooltip. */}\n {typeof help === \"string\" && help && (\n <InfoHint text={help} label={typeof label === \"string\" ? `About ${label}` : \"Help\"} />\n )}\n {help && typeof help !== \"string\" && (\n <TooltipProvider delayDuration={150}>\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n aria-label=\"Help\"\n className=\"inline-flex items-center justify-center h-4 w-4 rounded-full text-muted-foreground hover:text-foreground transition-colors\"\n >\n <CircleHelpIcon className=\"h-3.5 w-3.5\" />\n </button>\n </TooltipTrigger>\n <TooltipContent side=\"top\" className=\"max-w-xs type-secondary\">\n {help}\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n )}\n </div>\n\n {description && !error && (\n <p className=\"type-secondary text-muted-foreground\">{description}</p>\n )}\n\n {/*\n THE EMPTY-LOOKS-EMPTY RULE. Styled on a wrapper with descendant\n selectors rather than by cloning the child, so it holds for EVERY\n input a Field can wrap — shadcn Input, ProTextarea, a bespoke control —\n without the child having to opt in or even know.\n */}\n <div\n data-slot=\"field-control\"\n data-required-empty={requiredEmpty ? \"true\" : undefined}\n className={cn(\n requiredEmpty &&\n \"[&_input]:border-dashed [&_textarea]:border-dashed [&_input]:border-muted-foreground/50 [&_textarea]:border-muted-foreground/50 [&_input]:placeholder:italic [&_textarea]:placeholder:italic [&_input]:placeholder:text-disabled-foreground [&_textarea]:placeholder:text-disabled-foreground\",\n )}\n >\n {children}\n </div>\n\n {(error || hasCounter || requiredEmpty) && (\n <div\n className={cn(\n \"flex items-start justify-between gap-2 min-h-[1rem]\",\n // The notice alone is only true while the control is SHOWING an\n // example (a visible placeholder). An empty box with no example text,\n // or a select, has nothing to be mistaken for an answer — so the row\n // stays hidden until `:placeholder-shown` matches inside this field.\n !error && !hasCounter && \"hidden [[data-field-root]:has(:placeholder-shown)_&]:flex\",\n )}\n >\n {error ? (\n <p className=\"type-secondary text-destructive flex items-center gap-1\">\n <CircleAlertIcon className=\"h-3 w-3 flex-shrink-0\" />\n <span>{error}</span>\n {/* The host's error actions (Copy, Copy for AI, fix request): the slot every package error uses.\n The raw `error` goes through untouched so the host formats a non-string one itself. */}\n <ErrorActions\n {...(typeof error === \"string\" ? { message: error } : {})}\n error={error}\n origin=\"design-system/LabeledField\"\n />\n </p>\n ) : requiredEmpty ? (\n <p\n data-slot=\"field-empty-notice\"\n className=\"hidden type-secondary text-muted-foreground items-center gap-1 [[data-field-root]:has(:placeholder-shown)_&]:flex\"\n >\n <CircleAlertIcon className=\"h-3 w-3 flex-shrink-0\" />\n <span>Empty — the gray text is an example, not your answer.</span>\n </p>\n ) : (\n <span />\n )}\n {hasCounter && (\n <span\n className={cn(\n \"type-secondary tabular-nums text-muted-foreground ml-auto\",\n nearLimit && \"text-warning\",\n overLimit && \"text-destructive font-medium\",\n )}\n >\n {maxCount != null ? `${count} / ${maxCount}` : `${count}`}\n </span>\n )}\n </div>\n )}\n </div>\n );\n}\n\n\n","\"use client\";\n\n// A small info glyph that opens a hover card: title, text or content, a copy button, a \"Required\"\n// pill and an optional \"Get help from Matrx AI\" action. Moved from matrx-frontend\n// components/official/HelpIcon (wave 2, 2026-10-22). Copy goes through kit's one clipboard door\n// (a failure opens the clipboard fallback dialog); the blue / amber hard-codes are the info and\n// warning role tokens now. New usages of a label's one-sentence definition belong in `InfoHint`\n// (reachable by mouse, keyboard and touch); this icon opens on mouse hover only.\n\nimport { copyText } from \"@ai-matrx/kit/clipboard\";\nimport { openClipboardFallback } from \"@ai-matrx/kit/clipboard-fallback-opener\";\nimport { toast } from \"@ai-matrx/kit/notify\";\nimport * as React from \"react\";\nimport { createPortal } from \"react-dom\";\n\nimport { CheckIcon, CircleDotIcon, CircleHelpIcon, CopyIcon, InfoIcon } from \"../icons\";\nimport { Button } from \"./controls\";\n\nconst { useState, useLayoutEffect, useRef } = React;\n\nexport interface HelpIconProps {\n text?: string;\n content?: React.ReactNode;\n className?: string;\n title?: string;\n required?: boolean;\n onAiAssistance?: () => void;\n}\n\nexport function HelpIcon({ \n text, \n content, \n className = \"\", \n title = \"\", \n required = false,\n onAiAssistance\n}: HelpIconProps) {\n const [copied, setCopied] = useState(false);\n const [isVisible, setIsVisible] = useState(false);\n const [position, setPosition] = useState({ top: 0, left: 0 });\n const iconRef = useRef<HTMLDivElement>(null);\n const tooltipRef = useRef<HTMLDivElement>(null);\n const hideTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const showTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n \n const handleCopy = async (e: React.MouseEvent) => {\n e.stopPropagation();\n if (text) {\n // The success notice goes through kit's one toast (the host's, once registered); a failure opens the fallback dialog instead of a second notice.\n if (!(await copyText(text, { successMessage: \"Copied to clipboard\", notify: (message, kind) => { if (kind === \"success\") toast.success(message); } }))) {\n // A copy that did not land says so: the fallback dialog shows the text to copy by hand.\n void openClipboardFallback(text);\n return;\n }\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n }\n };\n\n const handleAiClick = (e: React.MouseEvent) => {\n e.stopPropagation();\n if (onAiAssistance) {\n onAiAssistance();\n }\n };\n \n const updatePosition = () => {\n if (iconRef.current && tooltipRef.current) {\n const rect = iconRef.current.getBoundingClientRect();\n const tooltipRect = tooltipRef.current.getBoundingClientRect();\n const viewportWidth = window.innerWidth;\n \n let left = rect.left + (rect.width / 2) - (tooltipRect.width / 2);\n let top = rect.top - tooltipRect.height - 8;\n \n // Adjust if tooltip would go off-screen\n if (left < 10) left = 10;\n if (left + tooltipRect.width > viewportWidth - 10) {\n left = viewportWidth - tooltipRect.width - 10;\n }\n \n // If tooltip would go above viewport, position below icon\n if (top < 10) {\n top = rect.bottom + 8;\n }\n \n setPosition({ top, left });\n }\n };\n \n const showTooltip = () => {\n if (hideTimeoutRef.current) {\n clearTimeout(hideTimeoutRef.current);\n hideTimeoutRef.current = null;\n }\n \n if (!isVisible && !showTimeoutRef.current) {\n showTimeoutRef.current = setTimeout(() => {\n setIsVisible(true);\n showTimeoutRef.current = null;\n }, 200);\n }\n };\n \n const hideTooltip = () => {\n if (showTimeoutRef.current) {\n clearTimeout(showTimeoutRef.current);\n showTimeoutRef.current = null;\n }\n \n hideTimeoutRef.current = setTimeout(() => {\n setIsVisible(false);\n }, 150);\n };\n \n const cancelHideTooltip = () => {\n if (hideTimeoutRef.current) {\n clearTimeout(hideTimeoutRef.current);\n hideTimeoutRef.current = null;\n }\n };\n \n // A LAYOUT effect: the card is measured and placed before the browser paints it. As a plain\n // effect it painted at the window's top-left corner first, then jumped to the icon (2026-10-08).\n useLayoutEffect(() => {\n if (isVisible) {\n updatePosition();\n window.addEventListener('scroll', updatePosition);\n window.addEventListener('resize', updatePosition);\n }\n \n return () => {\n window.removeEventListener('scroll', updatePosition);\n window.removeEventListener('resize', updatePosition);\n if (hideTimeoutRef.current) {\n clearTimeout(hideTimeoutRef.current);\n }\n if (showTimeoutRef.current) {\n clearTimeout(showTimeoutRef.current);\n }\n };\n }, [isVisible]);\n \n // Format text to handle both literal newlines and \\n escape sequences\n const formatTextWithLineBreaks = (text: string) => {\n const processedText = text.replace(/\\\\n/g, '\\n');\n return processedText.split('\\n').map((line, index) => (\n <React.Fragment key={index}>\n {index > 0 && <br />}\n {line}\n </React.Fragment>\n ));\n };\n \n // The nothing-to-show guard sits BELOW every hook. Above them it made all 8\n // hook calls conditional (react-hooks/rules-of-hooks) — a HelpIcon whose\n // `text` arrives asynchronously would crash with \"rendered more hooks than\n // during the previous render\".\n if (!text && !content) return null;\n\n return (\n <div \n className={`inline-block relative cursor-help ${className}`}\n ref={iconRef}\n onMouseEnter={showTooltip}\n onMouseLeave={hideTooltip}\n >\n <InfoIcon className=\"h-4 w-4 text-muted-foreground transition-colors duration-200\" />\n \n {isVisible && typeof document !== 'undefined' && createPortal(\n <div \n ref={tooltipRef}\n className=\"fixed max-w-sm bg-textured border-border rounded-lg shadow-xl z-[9999] animate-in fade-in-0 zoom-in-95 duration-100\"\n style={{ \n top: `${position.top}px`, \n left: `${position.left}px`,\n pointerEvents: 'auto' \n }}\n onMouseEnter={cancelHideTooltip}\n onMouseLeave={hideTooltip}\n >\n <div className=\"p-3\">\n {/* Header row with icon and title */}\n <div className=\"flex items-center gap-2 mb-2\">\n <CircleHelpIcon className=\"h-4 w-4 flex-shrink-0 text-info-ink\" />\n {title && (\n <h3 className=\"text-foreground type-title\">\n {title}\n </h3>\n )}\n {text && (\n <Button\n variant=\"quiet\"\n className=\"ml-auto\"\n icon={copied ? <CheckIcon /> : <CopyIcon />}\n aria-label=\"Copy to clipboard\"\n onClick={handleCopy}\n />\n )}\n </div>\n \n {/* Content */}\n <div className=\"type-body text-foreground leading-relaxed\">\n {content ? content : (text && formatTextWithLineBreaks(text))}\n </div>\n \n {/* Required field pill */}\n {required && (\n <div className=\"mt-3 inline-flex items-center gap-1.5 px-2.5 py-1 bg-warning/15 text-warning-ink type-secondary font-medium rounded-full\">\n <div className=\"w-1.5 h-1.5 bg-warning-ink rounded-full\"></div>\n Required Field\n </div>\n )}\n \n {/* AI Assistance button */}\n {onAiAssistance && (\n <Button variant=\"primary\" icon={<CircleDotIcon />} className=\"mt-3 w-full\" onClick={handleAiClick}>\n Get Help From Matrx AI\n </Button>\n )}\n </div>\n \n {/* Tooltip arrow */}\n <div className=\"absolute -bottom-1.5 left-1/2 -translate-x-1/2 w-3 h-3 bg-textured border-r border-b border-border rotate-45\"></div>\n </div>,\n document.body\n )}\n </div>\n );\n}\n","\"use client\";\n\n// A list of short texts typed one by one (Enter or comma adds): the field on top, the chips under it,\n// each chip with its own remove button, and a copy-all button in the field. Moved from matrx-frontend\n// components/official/TextArrayInput (wave 2, 2026-10-22), with its two private helpers: copy goes\n// through kit's one clipboard door (a failure opens the clipboard fallback dialog) and `cleanUrl`\n// (strip tracking parameters, keep p / q / id) lives here next to its only caller.\n\nimport { copyText } from \"@ai-matrx/kit/clipboard\";\nimport { toast } from \"@ai-matrx/kit/notify\";\nimport { openClipboardFallback } from \"@ai-matrx/kit/clipboard-fallback-opener\";\nimport * as React from \"react\";\n\nimport { CheckIcon, CopyIcon, XIcon } from \"../icons\";\nimport { Button } from \"./controls\";\nimport { Input } from \"./doors\";\n\n/** A URL without its tracking parameters (keeps `p`, `q`, `id`); anything that is not a URL comes back unchanged. */\nexport function cleanUrl(url: string): string {\n try {\n const parsed = new URL(url);\n const kept = new URLSearchParams();\n for (const [key, value] of new URLSearchParams(parsed.search)) {\n if ([\"p\", \"q\", \"id\"].includes(key)) kept.set(key, value);\n }\n parsed.search = kept.toString();\n return parsed.toString();\n } catch {\n return url;\n }\n}\n\nexport interface TextArrayInputProps {\n value?: string[];\n onChange?: (value: string[]) => void;\n placeholder?: string;\n className?: string;\n /** Classes of each chip (its fill and ink). Default: the primary fill. */\n chipClassName?: string;\n /** Drop repeats. Default true. */\n uniqueFilter?: boolean;\n /** Show the copy-all button when there are values. Default true. */\n showCopyIcon?: boolean;\n /** Strip tracking parameters from each added item. */\n shouldCleanUrl?: boolean;\n /** Override sequential focus for copy/remove controls in dense composite fields. */\n auxiliaryControlsTabIndex?: number;\n}\n\nexport function TextArrayInput({\n value: externalValue,\n onChange,\n placeholder = \"Add items (press Enter)\",\n className = \"\",\n chipClassName = \"bg-primary text-primary-foreground\",\n uniqueFilter = true,\n showCopyIcon = true,\n shouldCleanUrl = false,\n auxiliaryControlsTabIndex,\n}: TextArrayInputProps) {\n const [internalValue, setInternalValue] = React.useState<string[]>([]);\n const [inputValue, setInputValue] = React.useState(\"\");\n const [copied, setCopied] = React.useState(false);\n\n const value = externalValue || internalValue;\n const tabIndexProp = auxiliaryControlsTabIndex === undefined ? {} : { tabIndex: auxiliaryControlsTabIndex };\n\n const handleCopy = async () => {\n const text = value.join(\", \");\n // Success is told through kit's one toast; a failure opens the fallback dialog (no second notice).\n if (!(await copyText(text, { successMessage: \"Copied\", notify: (message, kind) => { if (kind === \"success\") toast.success(message); } }))) {\n void openClipboardFallback(text);\n return;\n }\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n };\n\n const handleChange = (newItems: string[]) => {\n const processed = uniqueFilter ? [...new Set(newItems)] : newItems;\n if (onChange) onChange(processed);\n else setInternalValue(processed);\n };\n\n const handleSubmit = (e: React.SyntheticEvent) => {\n e.preventDefault();\n if (!inputValue.trim()) return;\n const added = inputValue\n .split(\",\")\n .map((item) => {\n const trimmed = item.trim();\n return shouldCleanUrl && trimmed ? cleanUrl(trimmed) : trimmed;\n })\n .filter((item) => item.length > 0);\n handleChange([...value, ...added]);\n setInputValue(\"\");\n };\n\n return (\n <div className={`space-y-3 ${className}`}>\n <form onSubmit={handleSubmit} className=\"relative w-full\">\n <Input\n adornment=\"end\"\n type=\"text\"\n value={inputValue}\n onChange={(e) => setInputValue(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") handleSubmit(e);\n }}\n placeholder={placeholder}\n className=\"w-full\"\n />\n {showCopyIcon && value.length > 0 && (\n <Button\n {...tabIndexProp}\n variant=\"quiet\"\n icon={copied ? <CheckIcon /> : <CopyIcon />}\n {...(copied ? { glyphTone: \"success\" as const } : {})}\n aria-label=\"Copy values\"\n onClick={handleCopy}\n className=\"absolute right-2 top-1/2 -translate-y-1/2\"\n />\n )}\n </form>\n\n <div className=\"flex flex-wrap gap-2\">\n {value.length === 0 ? (\n <span className=\"type-body inline-flex items-center rounded-full bg-muted px-3 py-1 text-muted-foreground\">None Added</span>\n ) : (\n value.map((item, index) => (\n <span\n key={`${item}-${index}`}\n className={`inline-flex cursor-default items-center gap-1 rounded-full px-3 py-1 text-sm transition-all duration-200 ${chipClassName}`}\n >\n {item}\n <button\n {...tabIndexProp}\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n handleChange(value.filter((_, i) => i !== index));\n }}\n className=\"cursor-pointer rounded-full p-0.5 transition-colors duration-200 hover:bg-primary-foreground/20\"\n aria-label={`Remove ${item}`}\n >\n <XIcon className=\"h-3.5 w-3.5\" />\n </button>\n </span>\n ))\n )}\n </div>\n </div>\n );\n}\n","\"use client\";\n\n/**\n * HostLink — the link the design-system's own components draw for an internal destination (a KPI\n * tile that opens its records, a dock tab, a card that opens a page).\n *\n * It is NOT a new seam: it resolves the tap-target link component the host registered once with\n * `setTapTargetLinkComponent` (`tap-target/link.ts`, the same slot the tap buttons and the settings\n * blocks use). A host that routes through its own link door (cross-deployment aware, prefetch rules)\n * registers THAT door there, and every component here inherits it.\n *\n * Nothing registered: a plain `<a>` (a working link, a full page load) that says so — one console\n * notice and `data-link-host=\"unconfigured\"` on what it draws.\n */\n\nimport * as React from \"react\";\n\nimport { announceStandIn, UNCONFIGURED } from \"./stand-in-notice\";\nimport { getTapTargetLinkComponent } from \"./tap-target/link\";\n\nexport interface HostLinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"href\"> {\n href: string;\n prefetch?: boolean | null;\n}\n\nexport const HostLink = React.forwardRef<HTMLAnchorElement, HostLinkProps>(function HostLink(\n { href, prefetch, ...rest },\n ref,\n) {\n const Registered = getTapTargetLinkComponent() as unknown as React.ComponentType<\n HostLinkProps & { ref?: React.Ref<HTMLAnchorElement> }\n > | null;\n if (Registered) {\n return <Registered ref={ref} href={href} {...(prefetch === undefined ? {} : { prefetch })} {...rest} />;\n }\n announceStandIn(\n \"link-host\",\n \"HostLink drew a plain <a>: register the app's link component once with setTapTargetLinkComponent() from @ai-matrx/design-system/tap-target.\",\n );\n return <a ref={ref} href={href} data-link-host={UNCONFIGURED} {...rest} />;\n});\n","/**\n * A STAND-IN ANNOUNCES ITSELF (law 4). Where a design-system component has a working default for a\n * part the host is meant to supply (the writing box, the sandbox panel, how a scope is drawn), the\n * default says so: ONE console notice per stand-in naming what to pass, and a `data-*=\"unconfigured\"`\n * attribute on what it draws. The pattern is records-ui's `data-entity-ref-host=\"unconfigured\"` and\n * settings' `data-settings-host=\"unconfigured\"`.\n */\nconst announced = new Set<string>();\n\n/** Warn once per `key`, in words naming the field the host should pass. */\nexport function announceStandIn(key: string, message: string): void {\n if (announced.has(key)) return;\n announced.add(key);\n console.warn(`[design-system] ${message}`);\n}\n\n/** Test seam: forget every notice that was printed. */\nexport function _resetStandInNotices(): void {\n announced.clear();\n}\n\n/** The value every stand-in's data attribute carries. */\nexport const UNCONFIGURED = \"unconfigured\" as const;\n","import type { ComponentType, ReactNode, Ref } from \"react\";\n\n/**\n * The injectable link seam — the package's replacement for the original\n * hard `next/link` import.\n *\n * Internal hrefs (anything NOT matching `http(s):`, `mailto:`, `tel:`) render\n * through the link component resolved here; external hrefs always render a\n * plain `<a target=\"_blank\" rel=\"noopener noreferrer\">`, exactly like the\n * original. When nothing is registered and no per-instance `linkComponent`\n * prop is given, internal hrefs fall back to a plain `<a>` (no prefetch, no\n * client-side routing — still a working link).\n */\nexport interface TapTargetLinkProps {\n href: string;\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\" | undefined;\n rel?: string | undefined;\n /** Router prefetch hint (next/link semantics). Plain `<a>` fallback ignores it. */\n prefetch?: boolean | null | undefined;\n \"aria-label\"?: string | undefined;\n /** Tooltip text drawn through `title` (the provider's title takeover). */\n title?: string | undefined;\n className?: string | undefined;\n children?: ReactNode;\n /** The trigger's ref (the development guard measures the rendered link).\n * next/link forwards it to its `<a>`. */\n ref?: Ref<HTMLAnchorElement> | undefined;\n}\n\nexport type TapTargetLinkComponent = ComponentType<TapTargetLinkProps>;\n\n/**\n * The registered component lives in a `Symbol.for` slot on `globalThis` — NOT\n * in module state — so it survives the module graph being instantiated more\n * than once: the `.` and `./buttons` dist bundles each inline the primitives\n * (tsup `splitting: false`), and a consumer may even mix `import` and\n * `require`. One registration must reach every copy.\n */\nconst LINK_SLOT = Symbol.for(\"@ai-matrx/tap-target:link-component\");\n\ntype GlobalWithLinkSlot = typeof globalThis & {\n [LINK_SLOT]?: TapTargetLinkComponent | null;\n};\n\n/**\n * Register the app's link component once at startup (e.g. `next/link`):\n *\n * ```tsx\n * import Link from \"next/link\";\n * import { setTapTargetLinkComponent } from \"@ai-matrx/tap-target\";\n * setTapTargetLinkComponent(Link);\n * ```\n *\n * Pass `null` to unregister (plain `<a>` fallback resumes).\n */\nexport function setTapTargetLinkComponent(\n component: TapTargetLinkComponent | null,\n): void {\n (globalThis as GlobalWithLinkSlot)[LINK_SLOT] = component;\n}\n\n/** The currently registered link component, or `null` when none is set. */\nexport function getTapTargetLinkComponent(): TapTargetLinkComponent | null {\n return (globalThis as GlobalWithLinkSlot)[LINK_SLOT] ?? null;\n}\n","/**\n * UntrustedCount — a number that refuses to be reported when the read that\n * produced it failed.\n *\n * THE DEAD END this kills: every count on a surface is derived from the rows\n * currently in state (`rows.length`, `rows.filter(…).length`). When a fetch\n * fails and the rows are cleared — which is the correct thing to do, since\n * stale rows under a fresh banner are their own defect — every one of those\n * counters silently becomes `0`. A console then reports \"Total 0 · Failed 0\"\n * in confident bold type, which is not \"we couldn't read this\": it is a\n * positive claim about the database that nobody is entitled to make. Zero is\n * the single most dangerous default a failed read can produce, because it is\n * indistinguishable from good news.\n *\n * `StaleDataNotice` is the banner half of the same rule and this is the inline\n * half — a surface that shows the notice and still prints `0` beside it is\n * contradicting itself, and the number wins because it looks like data.\n *\n * Renders the value when the read succeeded, an em dash when it failed, and a\n * quiet ellipsis while it is still in flight. It carries the screen-reader\n * explanation itself so a caller cannot forget it: an em dash is mute to a\n * screen reader, so without the label the failure is invisible to exactly the\n * users least able to infer it from context.\n *\n * Tell it the read's outcome ONE of two ways:\n * - `read={{ status, error }}` — the same `ReadOutcome` a table's `read=`\n * takes (structurally the design-system `MatrxDataTableRead`);\n * - `trustworthy={!loadFailed}` — when all you hold is the failure flag.\n *\n * Styling is entirely the caller's — this owns the VALUE, never the chrome, so\n * it drops unchanged into a stat card, a pill badge, or a sentence. The shared\n * count primitives (KpiTile, MetricCell, ResearchFilterBar) take the same\n * `read=` and resolve it with `countReadState` below, so every stat tile on the\n * platform says \"—\" the same way.\n */\n\nimport type { ReadOutcome } from \"./read-gate\";\n\n/** The read outcome a count primitive is told: a `ReadOutcome` (or a `MatrxDataTableRead`). */\nexport type CountRead = Pick<ReadOutcome, \"status\" | \"error\" | \"hasData\">;\n\n/** What a count may honestly show for its read: the number, a failure dash, or a loading mark. */\nexport type CountReadState = \"ready\" | \"loading\" | \"failed\";\n\n/**\n * Fold a count's read input into what it may show.\n * - First load (nothing known yet): \"loading\" → \"…\".\n * - A read that failed with nothing known: \"failed\" → \"—\".\n * - STALE-WHILE-ERROR (RC-B12 r13 ruling): once a read has produced a value\n * (`read.hasData`), a refetch in flight or a failed refresh keeps showing the\n * last known value (\"ready\") — the surface's stale notice says it may be out\n * of date; `countIsStale` lets a count mark itself. No flicker to \"…\" or \"—\".\n * With neither input the number is shown (nothing was said about a read).\n */\nexport function countReadState(input: {\n read?: CountRead | null | undefined;\n trustworthy?: boolean | undefined;\n}): CountReadState {\n const { read, trustworthy } = input;\n if (trustworthy === false) return \"failed\";\n if (read) {\n const failed = read.status === \"error\" || (read.error != null && read.error !== false && read.error !== \"\");\n if (read.hasData) return \"ready\";\n if (failed) return \"failed\";\n if (read.status === \"loading\") return \"loading\";\n }\n return \"ready\";\n}\n\n/** A last-known value shown over a failed refresh (see `countReadState`). */\nexport function countIsStale(read: CountRead | null | undefined): boolean {\n if (!read?.hasData) return false;\n return read.status === \"error\" || (read.error != null && read.error !== false && read.error !== \"\");\n}\n\n/** The screen-reader sentence for a count that could not be read. */\nexport function unavailableCountLabel(label: string): string {\n return `${label} unavailable — could not be read`;\n}\n\ntype UntrustedCountRead =\n | {\n /**\n * Whether the read behind this number succeeded. Pass `!loadFailed` — the\n * same flag that drives the surface's `StaleDataNotice`, so the banner and\n * the number can never disagree.\n */\n trustworthy: boolean;\n read?: never;\n }\n | {\n /** The read behind this number — `{ status, error }` (a table's `read=` value fits). */\n read: CountRead;\n trustworthy?: never;\n };\n\nexport type UntrustedCountProps = UntrustedCountRead & {\n /** The derived count (or its formatted text). Never rendered unless the read succeeded. */\n value: number | string;\n /**\n * What this counts, as the user reads it on screen (\"Total\", \"Unresolved\").\n * Becomes \"<label> unavailable\" for screen readers when the read failed.\n */\n label: string;\n className?: string;\n};\n\nexport function UntrustedCount({\n value,\n trustworthy,\n read,\n label,\n className,\n}: UntrustedCountProps) {\n const state = countReadState({ read, trustworthy });\n if (state === \"ready\") {\n if (countIsStale(read)) {\n return (\n <span\n className={className}\n aria-label={`${label} ${value} — last known value, couldn't refresh`}\n title=\"Couldn't refresh — last known value\"\n >\n {value}\n </span>\n );\n }\n return <span className={className}>{value}</span>;\n }\n if (state === \"loading\") {\n return (\n <span className={className} aria-busy=\"true\" aria-label={`${label} loading`}>\n …\n </span>\n );\n }\n return (\n <span\n className={className}\n aria-label={unavailableCountLabel(label)}\n title=\"Couldn't be read\"\n >\n —\n </span>\n );\n}\n","// design-system controls/kpi-tile.tsx (moved from matrx-frontend components/official/kpi, wave 2, 2026-10-22;\n// tone colors are the role tokens, the drill-in link is the registered tap-target link via HostLink)\n//\n// THE KPI TILE — one number, its label, an optional one-line hint, and an\n// optional drill-in. The shared primitive for KPI pages (Spend's TotalsStrip\n// tile is the model it was lifted from). A tile with `href` is a link: every\n// number that names a set of records opens that set.\n//\n// A number that could not be measured is never shown as 0: pass\n// `value={null}` and the tile renders \"—\" with the hint saying why. A number\n// read from the database takes that read's outcome — `read={{ status, error }}`\n// (a table's `read=` value fits): a failed read renders \"—\" with an\n// \"unavailable\" label for screen readers, an in-flight read renders loading.\n//\n// `title` is the number's one-sentence definition. It renders through\n// `InfoHint` from the design system — an info icon right after the label that\n// opens on hover, keyboard focus, and tap — never as a native `title=` on the\n// tile, which phones and keyboard users can't reach.\n//\n// `trend` draws a small history line beside the number (oldest first). Pass it\n// only when real history exists — never a flat stand-in; `period` names the\n// span (\"28 days\") for screen readers and the hover label.\n\n\"use client\";\n\nimport type { ReactNode } from \"react\";\n\nimport { cn } from \"../cn\";\nimport { HostLink } from \"../host-link\";\nimport { countReadState, unavailableCountLabel, type CountRead } from \"../read-state/untrusted-count\";\nimport { InfoHint } from \"./info-hint\";\n\nexport type KpiTone = \"neutral\" | \"good\" | \"warn\" | \"bad\";\n\nconst TONE_VALUE: Record<KpiTone, string> = {\n neutral: \"text-foreground\",\n good: \"text-success-ink\",\n warn: \"text-warning-ink\",\n bad: \"text-destructive-ink\",\n};\n\nconst TONE_DOT: Record<KpiTone, string | null> = {\n neutral: null,\n good: \"bg-success\",\n warn: \"bg-warning\",\n bad: \"bg-destructive\",\n};\n\nexport interface KpiTileProps {\n label: string;\n /** `null` = not measured; renders \"—\", never 0. */\n value: ReactNode | null;\n hint?: ReactNode;\n tone?: KpiTone;\n /** Drill-in destination. The whole tile becomes the link. */\n href?: string;\n /** Definition — what the number counts, in one sentence (≤ 140 chars). Renders as an InfoHint after the label. */\n title?: string;\n loading?: boolean;\n /** The read behind `value`. Failed → \"—\" (never 0); loading → the loading bar. */\n read?: CountRead | null;\n /** Real history behind the number, oldest first (≥ 2 points), and the span it covers. */\n trend?: KpiTrend | null;\n className?: string;\n}\n\nexport interface KpiTrend {\n values: readonly number[];\n /** The span the line covers (\"28 days\", \"12 weeks\"). */\n period: string;\n /** What the line counts when it is not the tile's number (\"Posts per week\"). */\n label?: string;\n}\n\nconst SPARK_W = 64;\nconst SPARK_H = 20;\n\n/** The tile's history line: a filled area under the line (none when flat), scaled from its low point. */\nfunction KpiSparkline({ trend, label }: { trend: KpiTrend; label: string }) {\n const n = trend.values.length;\n if (n < 2) return null;\n const min = Math.min(...trend.values);\n const max = Math.max(...trend.values);\n // A floor of 10% of the peak: a change of 11 on 3,700 stays a near-flat line, never a cliff.\n const range = Math.max(max - min, Math.abs(max) * 0.1) || 1;\n // A level line sits at mid-height: drawn on the floor it would read as zero.\n const y = (v: number) => (max === min ? SPARK_H / 2 : SPARK_H - 2 - ((v - min) / range) * (SPARK_H - 4));\n const pts = trend.values\n .map((v, i) => `${((i / (n - 1)) * SPARK_W).toFixed(1)},${y(v).toFixed(1)}`)\n .join(\" \");\n return (\n <svg\n viewBox={`0 0 ${SPARK_W} ${SPARK_H}`}\n preserveAspectRatio=\"none\"\n role=\"img\"\n aria-label={`${trend.label ?? label}, last ${trend.period}`}\n className=\"h-5 w-16 shrink-0 text-primary\"\n >\n <title>{`${trend.label ?? label}, last ${trend.period}`}</title>\n {/* A flat series is a line only: an area under it would read as a filled bar, not \"no change\". */}\n {max === min ? null : <polygon points={`0,${SPARK_H} ${pts} ${SPARK_W},${SPARK_H}`} fill=\"currentColor\" fillOpacity={0.15} />}\n <polyline points={pts} fill=\"none\" stroke=\"currentColor\" strokeWidth={1.5} strokeLinejoin=\"round\" vectorEffect=\"non-scaling-stroke\" />\n </svg>\n );\n}\n\nexport function KpiTile({\n label,\n value,\n hint,\n tone = \"neutral\",\n href,\n title,\n loading: loadingProp = false,\n read,\n trend,\n className,\n}: KpiTileProps) {\n const readState = countReadState({ read });\n const loading = loadingProp || readState === \"loading\";\n const failed = readState === \"failed\";\n const shown = failed ? null : value;\n const dot = TONE_DOT[tone];\n const body = (\n <>\n {/* A label wraps to a second line rather than being cut (\"NO DEFAULT\n MANDA…\" on a phone, punch list 2026-09-26) — a KPI whose name is\n unreadable is a number without a meaning. */}\n <div className=\"flex min-w-0 items-start gap-1.5 type-meta font-medium uppercase tracking-wide text-muted-foreground\">\n {dot ? (\n <span aria-hidden className={cn(\"mt-1 inline-block h-2 w-2 shrink-0 rounded-sm\", dot)} />\n ) : null}\n <span className=\"line-clamp-2 break-words\">\n {label}\n {title ? (\n <>\n {\" \"}\n <InfoHint text={title} label={`What ${label} means`} />\n </>\n ) : null}\n </span>\n </div>\n {loading ? (\n <div className=\"my-0.5 h-6 w-12 animate-pulse rounded bg-muted\" aria-hidden />\n ) : (\n <div className=\"flex min-w-0 items-end justify-between gap-2\">\n <div\n className={cn(\n \"truncate text-lg font-semibold leading-tight tabular-nums\",\n shown === null ? \"text-muted-foreground\" : TONE_VALUE[tone],\n )}\n aria-label={failed ? unavailableCountLabel(label) : undefined}\n title={failed ? \"Couldn't be read\" : undefined}\n >\n {shown === null ? \"—\" : shown}\n </div>\n {trend && shown !== null ? <KpiSparkline trend={trend} label={label} /> : null}\n </div>\n )}\n {hint ? (\n <div className=\"truncate type-meta text-muted-foreground\">{hint}</div>\n ) : null}\n </>\n );\n\n const shell = cn(\n \"flex min-w-0 flex-col gap-0.5 rounded-md border border-border bg-card px-3 py-2\",\n className,\n );\n\n if (href && !loading && shown !== null) {\n return (\n <HostLink\n href={href}\n data-look-surface=\"card\"\n className={cn(\n shell,\n \"transition-colors hover:border-primary/50 hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n )}\n >\n {body}\n </HostLink>\n );\n }\n return (\n <div className={shell} data-look-surface=\"card\" aria-busy={loading || undefined}>\n {body}\n </div>\n );\n}\n\n/** The standard responsive tile row. */\nexport function KpiGrid({\n children,\n className,\n}: {\n children: ReactNode;\n className?: string;\n}) {\n return (\n <div\n className={cn(\n \"grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-6\",\n className,\n )}\n >\n {children}\n </div>\n );\n}\n","\"use client\";\n\n// A button whose action is confirmed ON the button: after the click its glyph turns into a check\n// (and its tooltip says so) for a moment, then goes back. Moved from matrx-frontend\n// components/official/ActionFeedbackButton onto THE control (wave 2, 2026-10-22), so it has the\n// controls' one geometry — no size, no color of its own. A glyph whose color carries meaning says so\n// with `glyphTone`; `className` places it, never restyles it.\n\nimport * as React from \"react\";\n\nimport { CheckCircle2Icon } from \"../icons\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"../tooltip\";\nimport { Button, type ButtonProps } from \"./controls\";\n\nexport interface ActionFeedbackButtonProps\n extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"children\" | \"onClick\"> {\n /** The glyph, as an element (it keeps its own className). */\n icon: React.ReactNode;\n /** Required: an icon-only button says what it does. */\n tooltip: string;\n onClick: () => void;\n /** Tone, never size. Default `quiet`. */\n variant?: ButtonProps[\"variant\"];\n /** The glyph's own status ink while it is NOT confirming. */\n glyphTone?: ButtonProps[\"glyphTone\"];\n /** Shown during the confirmation. Default: the package's check-circle. */\n successIcon?: React.ReactNode;\n successTooltip?: string;\n /** Milliseconds the confirmation stays. Default 2000. */\n feedbackDuration?: number;\n /** Tooltip while disabled, when it differs from `tooltip`. */\n disabledTooltip?: string;\n}\n\nexport function ActionFeedbackButton({\n icon,\n tooltip,\n onClick,\n variant = \"quiet\",\n glyphTone,\n successIcon,\n successTooltip = \"Success!\",\n feedbackDuration = 2000,\n disabledTooltip,\n disabled = false,\n ...props\n}: ActionFeedbackButtonProps) {\n const [showSuccess, setShowSuccess] = React.useState(false);\n const timer = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n React.useEffect(() => () => {\n if (timer.current) clearTimeout(timer.current);\n }, []);\n\n const handleClick = () => {\n onClick();\n setShowSuccess(true);\n if (timer.current) clearTimeout(timer.current);\n timer.current = setTimeout(() => setShowSuccess(false), feedbackDuration);\n };\n\n const text = showSuccess ? successTooltip : disabled && disabledTooltip ? disabledTooltip : tooltip;\n const button = (\n <Button\n variant={variant}\n icon={showSuccess ? (successIcon ?? <CheckCircle2Icon />) : icon}\n {...(showSuccess ? { glyphTone: \"success\" as const } : glyphTone ? { glyphTone } : {})}\n {...props}\n aria-label={text}\n // A confirming button ignores a second click; a disabled one wears the native state.\n disabled={disabled || showSuccess}\n onClick={handleClick}\n />\n );\n return (\n <Tooltip>\n <TooltipTrigger asChild>{disabled ? <span className=\"inline-flex\">{button}</span> : button}</TooltipTrigger>\n <TooltipContent side=\"bottom\" sideOffset={5} className=\"z-[9999]\">\n {text}\n </TooltipContent>\n </Tooltip>\n );\n}\n","\"use client\";\n\n/**\n * CitationChip — THE shared presentational citation-chip primitive.\n *\n * One tappable source chip + its excerpt popover (number badge / icon /\n * title / locator / verbatim quote / open action). Every citation chip UI\n * renders through this:\n * - chat Sources footer (features/agents/components/messages-display/\n * citations/MessageSourcesRow.tsx — MessageCitationSource),\n * - education trust chips (features/education/trust/components/\n * SourceCitations.tsx — TrustEnvelope SourceCitation),\n * - the popover body alone backs the inline superscript marker\n * (components/mardown-display/chat-markdown/citations/\n * CitationMarkerInline.tsx).\n *\n * BOUNDARY: deliberately pure-presentational and citation-shape-agnostic —\n * it knows NOTHING of MessageCitationSource, TrustEnvelope, or openers.\n * Consumers map their citation shape to these props and pass `onOpen`\n * pre-wired to their canonical opener (useOpenCitationSource /\n * openCitationSource). That keeps chat free of TrustEnvelope coupling and\n * education free of the chat execution-system — the ONE chip stays shared.\n *\n * Styling knobs (chipClassName / clampExcerpt / chipSuffix / number) exist\n * so each consumer keeps its established visual language; `cn` uses\n * tailwind-merge, so a consumer's max-w/gap override wins over the base.\n */\n\nimport { useState } from \"react\";\nimport type * as React from \"react\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"../popover\";\nimport { cn } from \"../cn\";\nimport { ArrowUpRightIcon, QuoteIcon } from \"../icons\";\n\nexport interface CitationPopoverBodyProps {\n /** Icon representing the source (FileText for documents, Globe for web…). */\n icon: React.ComponentType<{ className?: string; \"aria-hidden\"?: boolean }>;\n /** Source title / domain / fallback label. */\n label: string;\n /** Secondary locator line under the title (e.g. \"Page 3 · example.com\"). */\n locator?: string | null;\n /** Verbatim cited excerpt, rendered as a blockquote. */\n excerpt?: string | null;\n /** Clamp the excerpt to 6 lines (long chat quotes). Default false. */\n clampExcerpt?: boolean;\n /** Open-the-real-source action; the button renders only when provided. */\n onOpen?: (() => void) | undefined;\n /** Label for the open action (e.g. \"Open source\", \"Open web source\"). */\n openLabel?: string;\n}\n\n/**\n * The popover interior: icon + title + locator, excerpt blockquote, open\n * action. Exported so non-chip triggers (the inline superscript marker)\n * share the identical body.\n */\nexport function CitationPopoverBody({\n icon: Icon,\n label,\n locator,\n excerpt,\n clampExcerpt = false,\n onOpen,\n openLabel = \"Open source\",\n}: CitationPopoverBodyProps) {\n return (\n <div className=\"flex flex-col gap-2\">\n <div className=\"flex items-start gap-2\">\n <Icon\n className=\"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground\"\n aria-hidden\n />\n <div className=\"min-w-0\">\n <p className=\"truncate type-title text-foreground\">\n {label}\n </p>\n {locator && (\n <p className=\"type-secondary text-muted-foreground\">{locator}</p>\n )}\n </div>\n </div>\n {excerpt && (\n <blockquote className=\"flex gap-2 rounded-md bg-muted/60 p-2 type-secondary italic text-muted-foreground\">\n <QuoteIcon className=\"h-3 w-3 shrink-0\" aria-hidden />\n <span className={cn(\"not-italic\", clampExcerpt && \"line-clamp-6\")}>\n {excerpt}\n </span>\n </blockquote>\n )}\n {onOpen && (\n <button\n type=\"button\"\n onClick={onOpen}\n className=\"inline-flex items-center gap-1 self-start text-xs font-medium text-primary hover:underline\"\n >\n <ArrowUpRightIcon className=\"h-3 w-3\" aria-hidden />\n {openLabel}\n </button>\n )}\n </div>\n );\n}\n\nexport interface CitationChipProps extends CitationPopoverBodyProps {\n /** 1-based display number badge on the chip. Omit for unnumbered chips. */\n number?: number;\n /** Trailing inline suffix on the chip (e.g. \"p.7\"). */\n chipSuffix?: string | null;\n /** Native `title` attribute for the chip button. */\n chipTitle?: string;\n /** Appended to the chip button's classes (tailwind-merge: overrides win). */\n chipClassName?: string;\n}\n\nexport function CitationChip({\n number,\n chipSuffix,\n chipTitle,\n chipClassName,\n ...body\n}: CitationChipProps) {\n const { icon: Icon, label } = body;\n // Opening the source closes the excerpt — it never floats over the viewer\n // it just opened (verify-4 #33/#34).\n const [open, setOpen] = useState(false);\n const onOpen = body.onOpen\n ? () => {\n setOpen(false);\n body.onOpen?.();\n }\n : undefined;\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n title={chipTitle}\n className={cn(\n \"inline-flex max-w-[16rem] items-center gap-1 rounded-md border border-border bg-muted/50 px-1.5 py-0.5 text-xs text-foreground transition-colors hover:bg-accent\",\n chipClassName,\n )}\n >\n {number != null && (\n <span className=\"inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full bg-muted px-1 text-[0.65rem] font-medium leading-none text-muted-foreground\">\n {number}\n </span>\n )}\n <Icon className=\"h-3 w-3 shrink-0 text-muted-foreground\" aria-hidden />\n <span className=\"truncate\">{label}</span>\n {chipSuffix && (\n <span className=\"shrink-0 text-muted-foreground\">{chipSuffix}</span>\n )}\n </button>\n </PopoverTrigger>\n <PopoverContent sizing=\"content\" align=\"start\" className=\"p-3\">\n <CitationPopoverBody {...body} onOpen={onOpen} />\n </PopoverContent>\n </Popover>\n );\n}\n\nexport default CitationChip;\n","\"use client\";\n\n/**\n * ToolRail — the vertical tool rail of a canvas workspace (Acrobat, Figma): one icon-only control\n * per tool, one tool active, groups split by a hairline. `orientation=\"horizontal\"` makes the same\n * control a tool strip.\n *\n * `role=\"toolbar\"` with ONE tab stop (roving): Tab enters on the active tool (or the first\n * enabled one), the arrow keys of the rail's axis move focus (wrapping, skipping disabled tools),\n * Home/End jump, Enter/Space choose. Choosing the active tool again clears it when\n * `allowDeselect`. Every tool is named by its tooltip and `aria-label` (with its shortcut hint),\n * the active tool is `aria-pressed`. The rail has a fixed 28px control per tool, so activating or\n * hovering never moves anything.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"../tooltip\";\nimport { Button } from \"./controls\";\n\nexport interface ToolRailItem {\n id: string;\n label: string;\n icon: React.ComponentType<{ className?: string }>;\n /** Shown after the label in the tooltip (\"V\", \"Ctrl+Z\"). */\n shortcut?: string;\n disabled?: boolean;\n}\n\nexport interface ToolRailProps {\n /** Groups of tools; a hairline sits between groups. */\n groups: ReadonlyArray<ReadonlyArray<ToolRailItem>>;\n /** The active tool's id, or null for none. */\n value: string | null;\n onValueChange: (id: string | null, item: ToolRailItem) => void;\n orientation?: \"vertical\" | \"horizontal\";\n /** Choosing the active tool again sets `null` (a tool you can put down). Default false. */\n allowDeselect?: boolean;\n className?: string;\n \"aria-label\": string;\n}\n\nexport function ToolRail({\n groups,\n value,\n onValueChange,\n orientation = \"vertical\",\n allowDeselect = false,\n className,\n \"aria-label\": ariaLabel,\n}: ToolRailProps) {\n const flat = React.useMemo(() => groups.flat(), [groups]);\n const refs = React.useRef(new Map<string, HTMLButtonElement>());\n const enabled = flat.filter((t) => !t.disabled);\n const activeEnabled = enabled.find((t) => t.id === value);\n const [focusId, setFocusId] = React.useState<string | null>(null);\n const stopId = (focusId && enabled.some((t) => t.id === focusId) ? focusId : null) ?? activeEnabled?.id ?? enabled[0]?.id;\n const vertical = orientation === \"vertical\";\n\n const focusAt = (id: string | undefined) => {\n if (!id) return;\n setFocusId(id);\n refs.current.get(id)?.focus();\n };\n const onKeyDown = (e: React.KeyboardEvent, id: string) => {\n const at = enabled.findIndex((t) => t.id === id);\n const next = vertical ? \"ArrowDown\" : \"ArrowRight\";\n const prev = vertical ? \"ArrowUp\" : \"ArrowLeft\";\n if (e.key === next) { e.preventDefault(); focusAt(enabled[(at + 1) % enabled.length]?.id); }\n else if (e.key === prev) { e.preventDefault(); focusAt(enabled[(at - 1 + enabled.length) % enabled.length]?.id); }\n else if (e.key === \"Home\") { e.preventDefault(); focusAt(enabled[0]?.id); }\n else if (e.key === \"End\") { e.preventDefault(); focusAt(enabled[enabled.length - 1]?.id); }\n };\n\n return (\n <div\n role=\"toolbar\"\n aria-label={ariaLabel}\n aria-orientation={orientation}\n data-matrx-tool-rail=\"\"\n data-orientation={orientation}\n className={cn(\"flex w-fit shrink-0 items-center gap-1\", vertical ? \"flex-col\" : \"flex-row\", className)}\n >\n {groups.map((group, gi) => (\n <React.Fragment key={gi}>\n {gi > 0 ? (\n <div\n role=\"separator\"\n aria-orientation={vertical ? \"horizontal\" : \"vertical\"}\n className={cn(\"shrink-0 bg-border\", vertical ? \"my-0.5 h-px w-5\" : \"mx-0.5 h-5 w-px\")}\n />\n ) : null}\n {group.map((tool) => {\n const on = tool.id === value;\n const Icon = tool.icon;\n const name = tool.shortcut ? `${tool.label} (${tool.shortcut})` : tool.label;\n return (\n <Tooltip key={tool.id}>\n <TooltipTrigger asChild>\n <Button\n ref={(el: HTMLButtonElement | null) => {\n if (el) refs.current.set(tool.id, el);\n else refs.current.delete(tool.id);\n }}\n variant={on ? \"primary\" : \"quiet\"}\n icon={<Icon />}\n aria-label={name}\n pressed={on}\n disabled={tool.disabled}\n tabIndex={tool.id === stopId ? 0 : -1}\n data-tool-id={tool.id}\n onFocus={() => setFocusId(tool.id)}\n onKeyDown={(e) => onKeyDown(e, tool.id)}\n onClick={() => onValueChange(on && allowDeselect ? null : tool.id, tool)}\n />\n </TooltipTrigger>\n <TooltipContent side={vertical ? \"right\" : \"bottom\"} sideOffset={6}>\n {name}\n </TooltipContent>\n </Tooltip>\n );\n })}\n </React.Fragment>\n ))}\n </div>\n );\n}\n","\"use client\";\n\n/**\n * PageRangeInput — \"1-3, 5, 8-\" in one field, with the parse reported underneath.\n *\n * Validation offers, never blocks: the text is always the caller's to keep. `onChange` reports\n * the text AND its parse (`pages`, `issues`); an issue shows as one hint line and sets\n * `aria-invalid`, but nothing is refused. The hint line is always reserved (one line of height),\n * so showing a hint, a count or an error never shifts the layout. Grammar: `page-ranges.ts`.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { Input } from \"./doors\";\nimport { type ParsedPageRanges, formatPageRanges, parsePageRanges } from \"./page-ranges\";\n\nexport interface PageRangeInputProps {\n /** The typed text (controlled). */\n value: string;\n onChange: (text: string, parsed: ParsedPageRanges) => void;\n /** Pages in the document; ranges are checked against it and \"8-\" runs to it. */\n pageCount: number;\n \"aria-label\"?: string;\n id?: string;\n placeholder?: string;\n disabled?: boolean;\n className?: string;\n /** Pressed Enter on a range that parsed clean. */\n onSubmit?: (parsed: ParsedPageRanges) => void;\n}\n\nexport function PageRangeInput({\n value,\n onChange,\n pageCount,\n placeholder = \"e.g. 1-3, 5, 8-\",\n disabled,\n className,\n onSubmit,\n id,\n \"aria-label\": ariaLabel = \"Page range\",\n}: PageRangeInputProps) {\n const autoId = React.useId();\n const hintId = `${id ?? autoId}-hint`;\n const parsed = React.useMemo(() => parsePageRanges(value, pageCount), [value, pageCount]);\n const first = parsed.issues[0];\n const hint = parsed.empty\n ? `${pageCount} page${pageCount === 1 ? \"\" : \"s\"}`\n : first\n ? first.hint\n : `${parsed.pages.length} page${parsed.pages.length === 1 ? \"\" : \"s\"}: ${formatPageRanges(parsed.pages)}`;\n return (\n <div className={cn(\"flex min-w-0 flex-col gap-1\", className)} data-matrx-page-range-input=\"\">\n <Input\n id={id}\n value={value}\n disabled={disabled}\n placeholder={placeholder}\n aria-label={ariaLabel}\n aria-invalid={first ? true : undefined}\n aria-describedby={hintId}\n autoComplete=\"off\"\n spellCheck={false}\n inputMode=\"text\"\n onChange={(e) => onChange(e.target.value, parsePageRanges(e.target.value, pageCount))}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" && parsed.valid) onSubmit?.(parsed);\n }}\n />\n <p\n id={hintId}\n role={first ? \"alert\" : \"status\"}\n data-state={first ? \"issue\" : parsed.empty ? \"idle\" : \"ok\"}\n className={cn(\"min-h-4 truncate text-xs leading-4\", first ? \"text-destructive\" : \"text-muted-foreground\")}\n >\n {hint}\n </p>\n </div>\n );\n}\n","/**\n * Page ranges — \"1-3, 5, 8-\" in, the pages out. Pure; the one parser behind `PageRangeInput`\n * and every PDF tool that takes a range (Split, Extract, Delete, Rotate, Print).\n *\n * Grammar (spaces anywhere are ignored): a token is `N`, `A-B`, `A-` (to the last page) or\n * `-B` (from the first). Tokens are separated by `,` or `;`. `end` and `last` mean the last\n * page. VALIDATION OFFERS, NEVER BLOCKS: a bad token is reported in `issues` with a hint and\n * skipped, the good tokens still count, and a reversed range (`5-3`) is read as `3-5` with a\n * note. Page numbers are 1-based.\n */\n\nexport type PageRangeIssueKind = \"syntax\" | \"out-of-range\" | \"reversed\" | \"zero\";\n\nexport interface PageRangeIssue {\n /** The token as typed (trimmed). */\n token: string;\n kind: PageRangeIssueKind;\n /** A sentence that says what to do, ready to show. */\n hint: string;\n}\n\nexport interface ParsedPageRanges {\n /** Every selected page, ascending, no repeats. */\n pages: number[];\n /** The same pages as ascending, non-touching [from, to] spans. */\n spans: Array<[number, number]>;\n issues: PageRangeIssue[];\n /** True when the text named at least one page and raised no issue. */\n valid: boolean;\n /** True when the text is empty (nothing typed yet — not an error). */\n empty: boolean;\n}\n\nconst WORD_END = /^(end|last)$/i;\n\nfunction num(part: string, pageCount: number): number | null {\n const p = part.trim();\n if (WORD_END.test(p)) return pageCount;\n if (!/^\\d+$/.test(p)) return null;\n return Number.parseInt(p, 10);\n}\n\nexport function spansOf(pages: readonly number[]): Array<[number, number]> {\n const out: Array<[number, number]> = [];\n for (const p of pages) {\n const last = out[out.length - 1];\n if (last && p === last[1] + 1) last[1] = p;\n else out.push([p, p]);\n }\n return out;\n}\n\n/** Parse `text` against a document of `pageCount` pages. */\nexport function parsePageRanges(text: string, pageCount: number): ParsedPageRanges {\n const issues: PageRangeIssue[] = [];\n const picked = new Set<number>();\n const trimmed = text.trim();\n if (trimmed === \"\") return { pages: [], spans: [], issues, valid: false, empty: true };\n const count = Math.max(0, Math.trunc(pageCount));\n\n for (const raw of trimmed.split(/[,;]/)) {\n const token = raw.trim();\n if (token === \"\") continue;\n const dash = token.indexOf(\"-\");\n let from: number | null;\n let to: number | null;\n if (dash === -1) {\n from = to = num(token, count);\n } else {\n const a = token.slice(0, dash);\n const b = token.slice(dash + 1);\n from = a.trim() === \"\" ? 1 : num(a, count);\n to = b.trim() === \"\" ? count : num(b, count);\n if (a.trim() === \"\" && b.trim() === \"\") from = to = null;\n }\n if (from === null || to === null) {\n issues.push({ token, kind: \"syntax\", hint: `“${token}” is not a page or range. Use numbers like 1-3, 5, 8-.` });\n continue;\n }\n if (from === 0 || to === 0) {\n issues.push({ token, kind: \"zero\", hint: `Pages start at 1; “${token}” was skipped.` });\n continue;\n }\n if (from > to) {\n issues.push({ token, kind: \"reversed\", hint: `“${token}” runs backwards; read as ${to}-${from}.` });\n [from, to] = [to, from];\n }\n if (from > count) {\n issues.push({ token, kind: \"out-of-range\", hint: `This file has ${count} page${count === 1 ? \"\" : \"s\"}; “${token}” was skipped.` });\n continue;\n }\n if (to > count) {\n issues.push({ token, kind: \"out-of-range\", hint: `This file has ${count} page${count === 1 ? \"\" : \"s\"}; “${token}” was cut to ${from}-${count}.` });\n to = count;\n }\n for (let p = from; p <= to; p++) picked.add(p);\n }\n const pages = [...picked].sort((x, y) => x - y);\n return { pages, spans: spansOf(pages), issues, valid: pages.length > 0 && issues.length === 0, empty: false };\n}\n\n/** The shortest text that parses back to `pages` (\"1-3, 5, 8-12\"). An open end is not written. */\nexport function formatPageRanges(pages: readonly number[]): string {\n const sorted = [...new Set(pages.filter((p) => Number.isInteger(p) && p > 0))].sort((a, b) => a - b);\n return spansOf(sorted)\n .map(([a, b]) => (a === b ? String(a) : b === a + 1 ? `${a}, ${b}` : `${a}-${b}`))\n .join(\", \");\n}\n","\"use client\";\n\n/**\n * OpacitySlider — a 0..1 opacity as a slider plus a percent field, one value, two ways to set it.\n * The value is a fraction (0-1) in and out; the field shows whole percent and commits on\n * blur/Enter (a text draft while typing, so it can be emptied without painting \"0\"). Arrow keys on\n * the slider step 1% (Shift: 10%). The percent field has a fixed width, so a change never shifts\n * the row.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { Slider } from \"../slider\";\nimport { Input } from \"./doors\";\n\nexport interface OpacitySliderProps {\n /** 0-1. */\n value: number;\n onChange: (value: number) => void;\n min?: number;\n max?: number;\n disabled?: boolean;\n className?: string;\n \"aria-label\"?: string;\n}\n\nconst clamp = (n: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, n));\nconst toPercent = (v: number) => Math.round(v * 100);\n\nexport function OpacitySlider({\n value,\n onChange,\n min = 0,\n max = 1,\n disabled,\n className,\n \"aria-label\": ariaLabel = \"Opacity\",\n}: OpacitySliderProps) {\n const [draft, setDraft] = React.useState<string | null>(null);\n const percent = toPercent(clamp(value, min, max));\n const commit = () => {\n if (draft !== null && draft.trim() !== \"\" && Number.isFinite(Number(draft))) {\n onChange(clamp(Math.round(Number(draft)) / 100, min, max));\n }\n setDraft(null);\n };\n return (\n <div className={cn(\"flex min-w-0 items-center gap-2\", className)} data-matrx-opacity-slider=\"\">\n <Slider\n className=\"min-w-0 flex-1\"\n aria-label={ariaLabel}\n {...(disabled !== undefined ? { disabled } : {})}\n min={toPercent(min)}\n max={toPercent(max)}\n step={1}\n value={[percent]}\n onValueChange={([v]) => onChange(clamp((v ?? 0) / 100, min, max))}\n />\n {/* The percent field fits its 4rem slot: a field's 8rem floor (controls.css \"A field never\n collapses\") is lowered here through its own knob, or the field spilled over the next control. */}\n <div className=\"flex w-16 shrink-0 items-center gap-1\" style={{ [\"--matrx-control-field-min\" as string]: \"0px\" }}>\n <Input\n numeric\n inputMode=\"numeric\"\n size={3}\n className=\"w-full\"\n aria-label={`${ariaLabel} percent`}\n disabled={disabled}\n value={draft ?? String(percent)}\n onFocus={(e) => e.currentTarget.select()}\n onChange={(e) => setDraft(e.target.value.replace(/[^\\d]/g, \"\").slice(0, 3))}\n onBlur={commit}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") commit();\n if (e.key === \"Escape\") setDraft(null);\n }}\n />\n <span aria-hidden className=\"text-xs text-muted-foreground\">%</span>\n </div>\n </div>\n );\n}\n","\"use client\";\n\n/**\n * ColorSwatchRow — a row of color swatches, one chosen (a highlight color, a pen, a stamp).\n * `role=\"radiogroup\"` with a roving tab stop: Tab enters on the chosen swatch, Left/Right (and\n * Up/Down) move and choose, Home/End jump. The chosen swatch shows a ring plus a check, so it\n * never reads by color alone, and the ring is drawn inside the swatch's own box (no layout\n * shift). The swatch color itself is data the caller passes (an annotation palette), the only\n * place a literal color appears; everything around it is a token.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { RadixCheckIcon } from \"../icons\";\n\nexport interface ColorSwatch {\n /** Any CSS color. */\n value: string;\n /** The swatch's spoken name (\"Yellow\"). */\n label: string;\n}\n\nexport interface ColorSwatchRowProps {\n colors: readonly ColorSwatch[];\n /** The chosen color's `value` (compared case-insensitively); none chosen when it matches nothing. */\n value: string | null | undefined;\n onChange: (value: string, swatch: ColorSwatch) => void;\n disabled?: boolean;\n className?: string;\n \"aria-label\"?: string;\n}\n\nexport function ColorSwatchRow({\n colors,\n value,\n onChange,\n disabled,\n className,\n \"aria-label\": ariaLabel = \"Color\",\n}: ColorSwatchRowProps) {\n const refs = React.useRef<Array<HTMLButtonElement | null>>([]);\n const chosen = colors.findIndex((c) => c.value.toLowerCase() === (value ?? \"\").toLowerCase());\n const stop = chosen >= 0 ? chosen : 0;\n const move = (to: number) => {\n const i = (to + colors.length) % colors.length;\n const c = colors[i];\n if (!c) return;\n refs.current[i]?.focus();\n onChange(c.value, c);\n };\n return (\n <div\n role=\"radiogroup\"\n aria-label={ariaLabel}\n aria-disabled={disabled || undefined}\n className={cn(\"flex flex-wrap items-center gap-1\", className)}\n data-matrx-color-swatch-row=\"\"\n >\n {colors.map((c, i) => {\n const on = i === chosen;\n return (\n <button\n key={`${c.value}-${i}`}\n ref={(el) => {\n refs.current[i] = el;\n }}\n type=\"button\"\n role=\"radio\"\n aria-checked={on}\n aria-label={c.label}\n title={c.label}\n disabled={disabled}\n tabIndex={i === stop ? 0 : -1}\n data-state={on ? \"checked\" : \"unchecked\"}\n onClick={() => onChange(c.value, c)}\n onKeyDown={(e) => {\n const k = e.key;\n if (k === \"ArrowRight\" || k === \"ArrowDown\") { e.preventDefault(); move(i + 1); }\n else if (k === \"ArrowLeft\" || k === \"ArrowUp\") { e.preventDefault(); move(i - 1); }\n else if (k === \"Home\") { e.preventDefault(); move(0); }\n else if (k === \"End\") { e.preventDefault(); move(colors.length - 1); }\n }}\n className={cn(\n \"relative inline-flex size-6 shrink-0 items-center justify-center rounded-full border border-border outline-none\",\n \"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background\",\n \"disabled:cursor-not-allowed disabled:border-dashed\",\n on && \"ring-2 ring-foreground ring-offset-1 ring-offset-background\",\n )}\n style={{ backgroundColor: c.value }}\n >\n {on ? <RadixCheckIcon className=\"size-3 mix-blend-difference text-white\" /> : null}\n </button>\n );\n })}\n </div>\n );\n}\n","\"use client\";\n\n/**\n * AnchoredToolbar — a floating toolbar anchored to a rectangle (a text selection, a picked\n * region, a selected annotation). It is a Popover whose anchor is the rect, so it is portaled and\n * positioned fixed: it never takes space in the page and never moves it. It sits above the rect\n * and flips below it (and slides along the edge) when there is no room; a rect scrolled out of the\n * viewport is left to the host to close (`onOpenChange`). Focus stays where it was (a selection\n * must not be lost by showing its toolbar); Escape and an outside press call `onOpenChange(false)`.\n *\n * `rect` is in viewport coordinates (`getBoundingClientRect()` / `Range.getBoundingClientRect()`).\n * Put an `OverflowToolbar` (or any row of controls) in `children`.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { Popover, PopoverAnchor, PopoverContent } from \"../popover\";\n\nexport interface AnchorRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport interface AnchoredToolbarProps {\n open: boolean;\n onOpenChange?: (open: boolean) => void;\n /** The selection rect, viewport coordinates. Null closes the toolbar. */\n rect: AnchorRect | DOMRectReadOnly | null;\n /** Preferred side; it flips when it does not fit. Default \"top\". */\n side?: \"top\" | \"bottom\";\n align?: \"start\" | \"center\" | \"end\";\n /** Gap between the rect and the toolbar, px. Default 8. */\n offset?: number;\n className?: string;\n \"aria-label\": string;\n children: React.ReactNode;\n}\n\n/** A virtual element for the popper: the rect, re-read on every position pass. */\nfunction virtualFor(rect: AnchorRect) {\n return {\n getBoundingClientRect: () =>\n ({\n x: rect.x, y: rect.y, left: rect.x, top: rect.y,\n width: rect.width, height: rect.height,\n right: rect.x + rect.width, bottom: rect.y + rect.height,\n toJSON: () => ({}),\n }) as DOMRect,\n };\n}\n\nexport function AnchoredToolbar({\n open,\n onOpenChange,\n rect,\n side = \"top\",\n align = \"center\",\n offset = 8,\n className,\n \"aria-label\": ariaLabel,\n children,\n}: AnchoredToolbarProps) {\n // A fresh virtual element whenever the rect's numbers change: Radix re-measures on a new anchor.\n const x = rect?.x ?? 0, y = rect?.y ?? 0, w = rect?.width ?? 0, h = rect?.height ?? 0;\n const virtualRef = React.useMemo(\n () => ({ current: virtualFor({ x, y, width: w, height: h }) }),\n [x, y, w, h],\n );\n const visible = open && rect !== null;\n return (\n <Popover open={visible} {...(onOpenChange ? { onOpenChange } : {})}>\n <PopoverAnchor virtualRef={virtualRef} />\n <PopoverContent\n role=\"toolbar\"\n aria-label={ariaLabel}\n data-matrx-anchored-toolbar=\"\"\n side={side}\n align={align}\n sideOffset={offset}\n padding=\"xs\"\n animated={false}\n className={cn(\"w-auto min-w-0 max-w-[calc(100vw-1rem)] overflow-visible\", className)}\n collisionPadding={8}\n avoidCollisions\n onOpenAutoFocus={(e) => e.preventDefault()}\n onCloseAutoFocus={(e) => e.preventDefault()}\n >\n {children}\n </PopoverContent>\n </Popover>\n );\n}\n","\"use client\";\n\n/**\n * IconSelect — an icon-only select: a 28px circle that opens either a plain select or (searchable) a\n * popover list with a filter box. Moved from matrx-frontend `components/official/IconSelect`\n * (wave 3, 2026-10-22).\n *\n * Navigation items MUST set `href`: Cmd/Ctrl/Shift/Alt or middle click then opens it in a new tab\n * through kit's one outbound door instead of choosing the item.\n *\n * The trigger forwards its ref and spreads the rest on purpose: `PopoverTrigger asChild` (Radix Slot)\n * clones its onClick / aria-expanded / data-state / ref onto it. Without both, the popover can never\n * open (found 2026-09-23); `icon-select.test.tsx` pins it.\n */\n\nimport * as React from \"react\";\n\nimport { openOutbound } from \"@ai-matrx/kit/outbound\";\n\nimport { cn } from \"../cn\";\nimport { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from \"../command\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../popover\";\nimport { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger } from \"../select\";\nimport { Button } from \"./controls\";\n\nexport interface IconSelectItem {\n id: string;\n label: string;\n icon?: React.ReactNode;\n value: string;\n /** Set on navigation items: a modified or middle click opens this URL in a new tab instead of choosing. */\n href?: string;\n}\n\nexport interface IconSelectProps {\n items: IconSelectItem[];\n icon?: React.ReactNode;\n value?: string;\n onValueChange?: (value: string) => void;\n disabled?: boolean;\n /** A searchable popover list instead of a plain select. */\n searchable?: boolean;\n searchPlaceholder?: string;\n /** Accessible name for the icon-only trigger (required in spirit: the trigger has no text). */\n ariaLabel?: string;\n /** The trigger's size: `default` 28px; `touch` 40px on a phone and 32px from `sm` up. */\n size?: \"default\" | \"touch\";\n /** Where the trigger sits (margin, flex); never how it looks. */\n className?: string;\n}\n\ninterface ClickLike {\n metaKey?: boolean;\n ctrlKey?: boolean;\n shiftKey?: boolean;\n altKey?: boolean;\n button?: number;\n}\n\n/** A click that asks for a new tab: a modifier, or the middle button. */\nfunction wantsNewTab(e: ClickLike): boolean {\n return Boolean(e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button === 1);\n}\n\nconst TRIGGER_SIZE = {\n default: \"\",\n touch: \"!h-10 !w-10 sm:!h-8 sm:!w-8\",\n} as const;\n\nconst TRIGGER_FACE = \"h-7 w-7 justify-center border-none bg-muted px-0 focus:outline-none focus:ring-0\";\n\nconst IconSelectTrigger = React.forwardRef<\n HTMLButtonElement,\n Pick<IconSelectProps, \"icon\" | \"disabled\" | \"ariaLabel\" | \"size\"> & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"children\">\n>(function IconSelectTrigger({ icon, disabled, ariaLabel, size = \"default\", className, ...rest }, ref) {\n return (\n <Button\n ref={ref}\n variant=\"quiet\"\n disabled={disabled}\n icon={icon}\n className={cn(TRIGGER_SIZE[size], className)}\n {...rest}\n aria-label={ariaLabel ?? rest[\"aria-label\"] ?? \"Choose an option\"}\n />\n );\n});\n\nexport function IconSelect({\n items,\n icon,\n value,\n onValueChange,\n disabled = false,\n searchable = false,\n searchPlaceholder = \"Search...\",\n ariaLabel = \"Choose an option\",\n size = \"default\",\n className,\n}: IconSelectProps) {\n const [open, setOpen] = React.useState(false);\n // cmdk's onSelect does not receive the mouse event, so a modified click is remembered here.\n const skipSelectRef = React.useRef(false);\n\n if (searchable) {\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <IconSelectTrigger icon={icon} disabled={disabled} ariaLabel={ariaLabel} size={size} className={className} />\n </PopoverTrigger>\n <PopoverContent sizing=\"content\" className=\"p-0\" align=\"start\">\n <Command>\n <CommandInput placeholder={searchPlaceholder} className=\"h-9 text-sm\" />\n <CommandList>\n <CommandEmpty>No results found.</CommandEmpty>\n <CommandGroup className=\"max-h-72 overflow-auto\">\n {items.map((item) => (\n <CommandItem\n key={item.id}\n value={item.label}\n onPointerDown={(e) => {\n if (item.href && wantsNewTab(e)) {\n skipSelectRef.current = true;\n e.preventDefault();\n openOutbound(item.href, \"_blank\", \"noopener\");\n setOpen(false);\n }\n }}\n onSelect={() => {\n if (skipSelectRef.current) {\n skipSelectRef.current = false;\n return;\n }\n onValueChange?.(item.value);\n setOpen(false);\n }}\n >\n <div className=\"flex items-center\">\n {item.icon && <span className=\"mr-2\">{item.icon}</span>}\n {item.label}\n </div>\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n );\n }\n\n return (\n <Select {...(value === undefined ? {} : { value })} {...(onValueChange ? { onValueChange } : {})} disabled={disabled}>\n <SelectTrigger\n aria-label={ariaLabel}\n className={cn(TRIGGER_FACE, TRIGGER_SIZE[size], className)}\n hideArrow={true}\n >\n {icon}\n </SelectTrigger>\n <SelectContent>\n <SelectGroup>\n {items.map((item) => (\n <SelectItem\n key={item.id}\n value={item.value}\n onPointerDown={(e) => {\n if (item.href && wantsNewTab(e)) {\n e.preventDefault();\n openOutbound(item.href, \"_blank\", \"noopener\");\n }\n }}\n >\n <div className=\"flex items-center\">\n {item.icon && <span className=\"mr-2\">{item.icon}</span>}\n {item.label}\n </div>\n </SelectItem>\n ))}\n </SelectGroup>\n </SelectContent>\n </Select>\n );\n}\n","\"use client\";\n\n/**\n * AdvancedCollapsible — a bordered collapsible section with an icon + title header and, when open, an\n * action row: save, reset (both confirm on the button), copy the content, and full screen.\n * Moved from matrx-frontend `components/official/AdvancedCollapsible` (wave 3, 2026-10-22).\n *\n * - Copy goes through kit's one clipboard door (a toast on success, the manual-copy dialog when the\n * browser refuses); no host copy component.\n * - Full screen is the package Dialog at `size=\"full\"`, with the same actions in its header; the app's\n * FullScreenOverlay is not needed.\n * - Glyph colors are glyph tones (info / warning / primary), not palette classes.\n */\n\nimport * as React from \"react\";\n\nimport { copyText } from \"@ai-matrx/kit/clipboard\";\nimport { openClipboardFallback } from \"@ai-matrx/kit/clipboard-fallback-opener\";\nimport { toast } from \"@ai-matrx/kit/notify\";\n\nimport { cn } from \"../cn\";\nimport { Collapsible, CollapsibleContent, CollapsibleTrigger } from \"../collapsible\";\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from \"../dialog\";\nimport { ChevronDownIcon, CopyIcon, Maximize2Icon, Minimize2Icon, RefreshCwIcon, SaveIcon } from \"../icons\";\nimport { IconButton } from \"../icon-button\";\nimport { ActionFeedbackButton } from \"./action-feedback-button\";\n\nexport interface AdvancedCollapsibleProps {\n icon: React.ReactNode;\n title: React.ReactNode;\n initialOpen?: boolean;\n onStateChange?: (open: boolean) => void;\n children: React.ReactNode;\n /** Where the section sits (margin, width); never how it looks. */\n className?: string;\n onSave?: () => void;\n onReset?: () => void;\n /** Called after the content was copied (the copy itself always happens). */\n onCopy?: () => void;\n saveTooltip?: string;\n resetTooltip?: string;\n copyTooltip?: string;\n fullscreenTooltip?: string;\n fullscreenExitTooltip?: string;\n fullScreenTitle?: string;\n fullScreenDescription?: string;\n}\n\nexport function AdvancedCollapsible({\n icon,\n title,\n initialOpen = true,\n onStateChange,\n children,\n className,\n onSave,\n onReset,\n onCopy,\n saveTooltip = \"Save\",\n resetTooltip = \"Reset\",\n copyTooltip = \"Copy to clipboard\",\n fullscreenTooltip = \"Expand to full screen\",\n fullscreenExitTooltip = \"Exit full screen\",\n fullScreenTitle,\n fullScreenDescription,\n}: AdvancedCollapsibleProps) {\n const [isOpen, setIsOpen] = React.useState(initialOpen);\n const [isFullScreen, setIsFullScreen] = React.useState(false);\n const contentRef = React.useRef<HTMLDivElement>(null);\n const fullRef = React.useRef<HTMLDivElement>(null);\n\n const handleOpenChange = (open: boolean) => {\n setIsOpen(open);\n onStateChange?.(open);\n };\n\n const handleCopy = async () => {\n const box = isFullScreen ? fullRef.current : contentRef.current;\n // innerText keeps the visible line breaks; a DOM without it (a test runner) reads textContent.\n const text = box ? (box.innerText ?? box.textContent ?? \"\") : \"\";\n if (!text) return;\n const landed = await copyText(text, {\n successMessage: \"Copied to clipboard\",\n notify: (message, kind) => {\n if (kind === \"success\") toast.success(message);\n },\n });\n // A copy that did not land opens the manual-copy dialog, which shows the text.\n if (!landed) void openClipboardFallback(text);\n else onCopy?.();\n };\n\n const actions = (\n <div className=\"flex items-center justify-end gap-2\">\n {onSave && (\n <ActionFeedbackButton\n icon={<SaveIcon />}\n glyphTone=\"info\"\n tooltip={saveTooltip}\n successTooltip=\"Saved!\"\n onClick={onSave}\n />\n )}\n {onReset && (\n <ActionFeedbackButton\n icon={<RefreshCwIcon />}\n glyphTone=\"warning\"\n tooltip={resetTooltip}\n successTooltip=\"Reset!\"\n onClick={onReset}\n />\n )}\n <IconButton icon={CopyIcon} tooltip={copyTooltip} onClick={() => void handleCopy()} />\n <IconButton\n icon={isFullScreen ? Minimize2Icon : Maximize2Icon}\n glyphTone=\"primary\"\n tooltip={isFullScreen ? fullscreenExitTooltip : fullscreenTooltip}\n onClick={() => setIsFullScreen(!isFullScreen)}\n />\n </div>\n );\n\n const heading = typeof title === \"string\" ? title : \"Content\";\n\n return (\n <>\n <Collapsible\n open={isOpen}\n onOpenChange={handleOpenChange}\n className={cn(\"w-full rounded-xl border border-border shadow-sm\", className)}\n >\n <CollapsibleTrigger className=\"relative flex w-full items-center justify-between rounded-t-xl px-4 py-3 font-medium hover:bg-muted\">\n <div className=\"flex items-center gap-2\">\n {icon}\n {typeof title === \"string\" ? <span>{title}</span> : title}\n </div>\n <ChevronDownIcon\n className={cn(\n \"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-(--matrx-motion-duration-base) motion-reduce:transition-none\",\n isOpen && \"rotate-180\",\n )}\n />\n </CollapsibleTrigger>\n <CollapsibleContent>\n <div className=\"relative\">\n <div className=\"absolute left-8 right-8 top-0 h-px bg-border\" />\n <div ref={contentRef} className=\"p-4\">\n {children}\n </div>\n <div className=\"mb-1 mr-1 mt-2\">{actions}</div>\n </div>\n </CollapsibleContent>\n </Collapsible>\n\n <Dialog open={isFullScreen} onOpenChange={setIsFullScreen}>\n <DialogContent size=\"full\" height=\"tall\">\n <DialogHeader>\n <DialogTitle>{fullScreenTitle || heading}</DialogTitle>\n {fullScreenDescription ? <DialogDescription>{fullScreenDescription}</DialogDescription> : null}\n </DialogHeader>\n {actions}\n <div ref={fullRef} className=\"min-h-0 flex-1 overflow-auto p-4\">\n {children}\n </div>\n </DialogContent>\n </Dialog>\n </>\n );\n}\n","\"use client\";\n\n/**\n * Collapsible — Radix's, with the one thing Radix does not ship: the open/close\n * transition.\n *\n * THE ROOT RENDERS UNCONDITIONALLY — no mount gate. The matrx-frontend\n * original carried the note that earned this line: a wrapper used to defer\n * rendering until after hydration on the theory that \"Radix generates dynamic\n * aria-controls ids that differ between SSR and client\". That was false —\n * Radix ids come from React's SSR-stable `useId` — and the gate was actively\n * harmful, because a Collapsible's Trigger wraps ALWAYS-VISIBLE content, so\n * `return null` deleted it from SSR and from the first client paint.\n *\n * THE TRANSITION IS PACKAGE-OWNED (census row 19f, the tail of 19c). Until\n * 0.9.0 this file was a bare re-export and the package shipped NO transition,\n * so every consumer invented its own — and two of them invented it wrong.\n * `matrx-collapsible.tsx` and `enhanced-collapsible.tsx` put\n * `animate-accordion-down`/`-up` on a COLLAPSIBLE panel: those keyframes\n * interpolate to `--radix-ACCORDION-content-height`, a variable Radix never\n * publishes on a collapsible, so they had never animated once — silently, with\n * no error, for as long as they existed. Six other matrx-frontend components\n * used host-only `animate-slide-down`/`-up` keyframes that WERE keyed\n * correctly — and worked in exactly one app in the fleet, because the\n * keyframes lived in that app's `globals.css`. Both shapes are the same C26\n * failure: a component whose motion depends on a contract the host has to\n * happen to hold. `.matrx-collapsible-content` in `styles.css` ends it — keyed\n * off Radix's runtime `--radix-collapsible-content-height`, honoring\n * `prefers-reduced-motion`, shipped in the tarball.\n *\n * Nothing else here is restyled: the trigger and the panel's own padding are\n * the host's to dress, and every fork agreed on that. Unlike `AccordionContent`\n * this component does NOT wrap children in a padding div — collapsibles in the\n * fleet pad their own bodies, and inserting a box would move every one of them.\n */\n\nimport * as CollapsiblePrimitive from \"@radix-ui/react-collapsible\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nconst Collapsible = CollapsiblePrimitive.Root;\nconst CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;\n\nexport interface CollapsibleContentProps\n extends React.ComponentPropsWithoutRef<\n typeof CollapsiblePrimitive.CollapsibleContent\n > {\n /**\n * Animate the height on open/close. Default `true`.\n *\n * Pass `false` for the rare panel that must not clip or must not move: the\n * animated panel carries `overflow-hidden` (a height transition without it\n * spills the body over whatever is below), so a panel with a child that\n * deliberately overflows its bounds — a non-portalled popover, a sticky\n * column header — opts out here rather than fighting the class. Opting out\n * gives you bare Radix: instant open, no clipping, no keyframes.\n *\n * `prefers-reduced-motion` is NOT this prop's job; the stylesheet already\n * drops the animation for those users while keeping the clipping.\n */\n animated?: boolean;\n}\n\nconst CollapsibleContent = React.forwardRef<\n React.ComponentRef<typeof CollapsiblePrimitive.CollapsibleContent>,\n CollapsibleContentProps\n>(({ className, animated = true, ...props }, ref) => (\n <CollapsiblePrimitive.CollapsibleContent\n ref={ref}\n data-slot=\"collapsible-content\"\n className={cn(\n animated && \"matrx-collapsible-content overflow-hidden\",\n className,\n )}\n {...props}\n />\n));\nCollapsibleContent.displayName = \"CollapsibleContent\";\n\nexport { Collapsible, CollapsibleContent, CollapsibleTrigger };\n","\"use client\";\n\n/**\n * Dialog — the modal surface, carrying every ruling the host forks paid for.\n *\n * Four hosts shipped four dialogs. Three were the stock shadcn body: a\n * fixed-size centered card with `overflow: visible`. matrx-frontend's had been\n * hardened, incident by incident, and those hardenings are the reason this\n * component belongs in the package rather than being copied a fifth time:\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 — Radix ids come from React's SSR-stable `useId` — and it deleted\n * the always-visible Trigger from SSR and the first client paint.\n *\n * 2. THE DIALOG IS CLAMPED TO THE VIEWPORT AND SCROLLS INSIDE ITSELF. Proven\n * live: an admin \"Create Category\" dialog rendered 851px tall in a 657px\n * viewport with `overflow-y: visible`, so its Create button sat below the\n * fold, unreachable. The only way out was a backdrop click — which\n * dismisses WITHOUT writing, and is indistinguishable from a silent save\n * failure. `max-h-[85dvh] overflow-y-auto` is the cap.\n *\n * 3. THE PRIMARY ACTION IS ALWAYS PRESSABLE — AND NEVER ON TOP OF THE BODY.\n * `DialogFooter` is sticky and bleeds to the card's edges using\n * `--dialog-pad`. Until 0.11.3 that bleed was a NEGATIVE BLOCK MARGIN,\n * which sticky clamps: the footer was dragged up over the row above it by\n * `--dialog-pad` minus the card gap. The card now RESERVES the footer's\n * block size instead (`.matrx-dialog-card` in `styles.css` hands its bottom\n * padding to the footer), so scrolled content never shows through beneath\n * the actions AND the footer never covers the row above it. Outside a\n * DialogContent both variables are unset, the padding falls back to `0px`,\n * and the footer is the plain row it always was.\n *\n * 4. ON MOBILE THE SAME DIALOG IS A BOTTOM SHEET — full width, bottom\n * anchored, height-capped, internally scrollable, safe-area padded. Opt out\n * with `mobileSheet={false}` only for the rare surface that must stay\n * centered (a tiny spinner). The sheet geometry is re-asserted AFTER the\n * caller's className so a desktop `max-w-2xl` cannot un-fullscreen it.\n *\n * 5. AN UNTITLED DIALOG IS STILL ACCESSIBLE. Radix warns (correctly) that\n * every dialog needs a title; rather than let hosts ship the warning, a\n * visually-hidden title is injected when the tree has none, and\n * `aria-describedby` is dropped when there is no description rather than\n * pointing at nothing.\n *\n * 6. ON DESKTOP A DIALOG IS A WINDOW, NOT A WALL (0.38.0, Arman 2026-09-23:\n * \"none of the built-in page ai integrations are accessible because the\n * page is totally blocked\"). Unless the caller passes `modal`, a desktop\n * dialog does not block the page: no overlay, the page, the Agents menu,\n * the assist dock and right-click AI stay usable beside it. It behaves like\n * a window: a click outside never closes it (`dismissOnOutsideClick` opts a\n * quick picker back in), Escape closes it only while focus is inside it\n * (Escape in the page belongs to the page), and its `DialogHeader` drags\n * it, clamped on screen, double-click to recenter. On a phone it stays the\n * blocking bottom sheet — nothing useful sits behind a sheet. Confirmations\n * are `AlertDialog`, a different component, and stay blocking. This is a\n * LIGHT window: the host's heavy window manager (tray, persistence) is a\n * separate system and must not be pulled into every dialog.\n *\n * SEAM INVERSIONS. The host original resolved its portal target through\n * app-shaped hooks (a popped-out window-panel body). Here that is the\n * package's `PortalContainerProvider` seam, with an explicit `container` prop\n * keeping top priority. And DialogContent PROVIDES that seam to its own\n * children, so a Popover or menu opened inside a dialog portals INTO the\n * dialog — staying inside the scroll shard, where its wheel events work.\n * `useDialogContainer` exposes the same element for host code that needs it.\n */\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport * as VisuallyHidden from \"@radix-ui/react-visually-hidden\";\nimport { treeContainsComponent } from \"@ai-matrx/kit/react-tree\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport {\n MOTION_BOTTOM_SHEET,\n MOTION_DIALOG,\n MOTION_OVERLAY,\n} from \"./motion\";\nimport { CloseRow, CloseSlotProvider, HeaderWithClose, useCloseSlot } from \"./close-slot\";\nimport { usePortalContainer, PortalContainerProvider } from \"./portal-container\";\nimport { useLook } from \"./look\";\nimport {\n RadixDialogModalProvider,\n useRadixDialogModal,\n} from \"./radix-dialog-modal-context\";\nimport { useIsMobile } from \"./use-is-mobile\";\nimport { announceLayerFront, LAYER_FRONT_EVENT, type LayerFrontDetail } from \"./layer-front\";\nimport { clampRectToViewport, readViewport, useDragMove } from \"./window-drag\";\nimport { keepFloatingLayersInside, useModalLayer } from \"./floating-layer\";\nimport { keepMovedFocus } from \"./focus-return\";\n\n/**\n * True when the dialog is a window because the caller said nothing about\n * modality (rule 6), false when the caller passed `modal={false}` itself.\n * The two sit on different layers: a default window sits WITH the other\n * layers it was opened from (z-10000 — a dialog opened from a menu, a popover\n * or a host window must never appear behind its opener), while an explicit\n * `modal={false}` keeps the older coexistence contract below the host's window\n * manager (z-900).\n */\nconst DialogWindowedByDefaultContext = React.createContext(false);\n\nconst Dialog = ({\n children,\n ...props\n}: React.ComponentPropsWithoutRef<typeof DialogPrimitive.Root>) => {\n const isMobile = useIsMobile();\n // THE LOOK (look.tsx): in a desktop scope every dialog is a macOS sheet, modal over a dimmed\n // window, whatever `modal` says (the desktop standard's Dialog).\n const desktopLook = useLook() === \"desktop\";\n // A window on desktop, a blocking sheet on a phone; `modal` forces either (rule 6).\n const modal = desktopLook || (props.modal ?? isMobile);\n return (\n <DialogWindowedByDefaultContext.Provider value={!desktopLook && props.modal === undefined}>\n <RadixDialogModalProvider modal={modal}>\n <DialogPrimitive.Root {...props} modal={modal}>\n {children}\n </DialogPrimitive.Root>\n </RadixDialogModalProvider>\n </DialogWindowedByDefaultContext.Provider>\n );\n};\nDialog.displayName = \"Dialog\";\n\nconst DialogTrigger = DialogPrimitive.Trigger;\nconst DialogClose = DialogPrimitive.Close;\n\n/**\n * Portal-seam-aware DialogPortal. An explicit `container` always wins; with\n * none, the injected `PortalContainerProvider` value decides; with neither,\n * Radix's `document.body`.\n */\nconst DialogPortal = ({\n container,\n ...props\n}: Omit<\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.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 <DialogPrimitive.Portal container={resolved ?? null} {...props} />;\n};\nDialogPortal.displayName = \"DialogPortal\";\n\n// Shared identity across independently bundled public entrypoints/loaders.\nconst CONTEXT_SLOT = Symbol.for(\"ai-matrx.design-system.dialog-container-context\");\nconst contextRegistry = globalThis as typeof globalThis & { [CONTEXT_SLOT]?: React.Context<HTMLElement | null> };\nconst DialogContainerContext = contextRegistry[CONTEXT_SLOT] ??= React.createContext<HTMLElement | null>(null);\n\n/** The DialogContent element, for host code that portals into the dialog. */\nexport const useDialogContainer = (): HTMLElement | null =>\n React.useContext(DialogContainerContext);\n\nconst DialogOverlay = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n data-slot=\"dialog-overlay\"\n className={cn(\n // Page context behind the modal stays readable; separation comes from a\n // light token scrim, not a blur.\n \"fixed inset-0 z-[10000] bg-[var(--matrx-overlay-scrim-soft)]\",\n MOTION_OVERLAY,\n className,\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\n/**\n * Unstyled, non-portalling Content for custom dialog layouts. Preserves Radix\n * focus/background behavior and derives `aria-modal` from the Root.\n */\nconst DialogContentPrimitive = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ onInteractOutside, onCloseAutoFocus, ...props }, ref) => {\n const isModal = useRadixDialogModal();\n // A blocking dialog registers, so floating layers opened from it (a host\n // window, a picker window) stack above its scrim (floating-layer.tsx).\n useModalLayer(isModal);\n return (\n <DialogPrimitive.Content\n {...props}\n ref={ref}\n aria-modal={isModal || undefined}\n onInteractOutside={keepFloatingLayersInside(onInteractOutside)}\n onCloseAutoFocus={keepMovedFocus(onCloseAutoFocus)}\n />\n );\n});\nDialogContentPrimitive.displayName = \"DialogContentPrimitive\";\n\nconst DIALOG_DESKTOP_CLASSES =\n \"matrx-dialog-card fixed inset-0 z-[10000] m-auto grid h-fit min-w-0 w-full max-w-lg gap-4 max-h-[85dvh] overflow-y-auto overscroll-contain [--dialog-pad:1.5rem] overflow-x-clip border bg-background p-6 shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full sm:rounded-lg\";\n\nconst DIALOG_MOBILE_SHEET_CLASSES =\n \"matrx-mobile-sheet matrx-dialog-card fixed inset-x-0 bottom-0 left-0 right-0 top-auto z-[10000] flex min-w-0 flex-col w-full max-w-full max-h-[90dvh] gap-4 [--dialog-pad:1rem] overflow-x-clip border-t bg-background p-4 pb-safe shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full rounded-t-2xl rounded-b-none overflow-y-auto overscroll-contain\";\n\n// Re-asserted LAST so sheet geometry always wins over a caller className.\nconst DIALOG_MOBILE_SHEET_OVERRIDE =\n \"inset-x-0 bottom-0 left-0 right-0 top-auto translate-none w-full max-w-full max-h-[90dvh] rounded-b-none rounded-t-2xl overflow-y-auto\";\n\n/** Drag props the windowed DialogContent hands its DialogHeader (rule 6). */\ntype DialogWindowHandle = {\n onPointerDown: (event: React.PointerEvent<HTMLElement>) => void;\n onDoubleClick: () => void;\n};\nconst DialogWindowHandleContext = React.createContext<DialogWindowHandle | null>(null);\n\n/** Pixels of a dragged window that must stay on screen. */\nconst WINDOW_KEEP_VISIBLE = 80;\n\nexport interface DialogContentProps\n extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {\n /**\n * Windowed (non-blocking) dialogs never close from a click outside them —\n * the person is reaching for the page or an AI control beside the window.\n * Pass `true` for a quick picker that should close when the person clicks\n * away. Ignored on a blocking dialog, which keeps Radix's behavior.\n */\n dismissOnOutsideClick?: boolean;\n /** Render as a bottom sheet below the mobile breakpoint. Default `true`. */\n mobileSheet?: boolean;\n /** Render the built-in close control. Default `true`. */\n showCloseButton?: boolean;\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 honors `prefers-reduced-motion`.\n */\n animated?: boolean;\n /**\n * THE NAMED WIDTHS (0.68.22) — a dialog never pastes `max-w-[860px]`. Derived from the call\n * sites: `sm` 28rem (a confirm, a one-field ask), `md` 32rem (default), `lg` 42rem (a form with\n * two columns), `xl` 56rem (a detail or a table), `2xl` 72rem (a workspace in a dialog),\n * `full` the viewport less 1rem each side, `screen` the whole viewport (a record opened as a\n * page). On a phone the dialog is a bottom sheet at every size.\n */\n size?: DialogSize;\n /**\n * `default`: the card pads and gaps its children (24px). `none`: the content draws its own\n * frame edge to edge — a command palette, a picker with its own header row, a full-bleed grid.\n */\n padding?: \"default\" | \"none\";\n /**\n * `auto` (default): the card is as tall as its content, up to 85dvh. `tall`: the card holds\n * 85dvh whatever its content — a workspace whose body scrolls inside (a grid, a document).\n */\n height?: \"auto\" | \"tall\";\n}\n\nexport type DialogSize = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\" | \"full\" | \"screen\";\n\n/**\n * Literal classes so a host's Tailwind scan of the package finds every one. Every width above\n * `md` keeps a 1rem gutter each side on a screen narrower than itself (the card is `w-full`\n * with `inset-0`, so an un-guttered `max-w-4xl` ran edge to edge at 800px). `screen` is the\n * whole viewport, square-cornered — a record opened \"as a page\".\n */\nexport const DIALOG_SIZE_CLASS: Record<DialogSize, string> = {\n sm: \"max-w-md\",\n md: \"max-w-lg\",\n lg: \"max-w-[min(42rem,calc(100vw-2rem))]\",\n xl: \"max-w-[min(56rem,calc(100vw-2rem))]\",\n \"2xl\": \"max-w-[min(72rem,calc(100vw-2rem))]\",\n full: \"max-w-[calc(100vw-2rem)]\",\n screen: \"max-w-none w-screen h-dvh max-h-none rounded-none sm:rounded-none\",\n};\n\nconst DialogContent = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Content>,\n DialogContentProps\n>(\n (\n {\n className,\n children,\n mobileSheet = true,\n animated = true,\n showCloseButton = true,\n container,\n dismissOnOutsideClick = false,\n size = \"md\",\n padding = \"default\",\n height = \"auto\",\n onInteractOutside,\n onEscapeKeyDown,\n onPointerDownCapture,\n onFocusCapture,\n style,\n ...props\n },\n ref,\n ) => {\n const isMobile = useIsMobile();\n const isModal = useRadixDialogModal();\n // Falls through to the injected container while `containerEl` is unset\n // (pre-mount) — the original's dialog > popout > body priority.\n const injectedContainer = usePortalContainer(container);\n // THE LOOK (look.tsx): inside a desktop scope the dialog is a macOS sheet — never a phone's\n // bottom sheet, no close (×), no web motion; look-desktop.css draws it from `data-desktop-sheet`.\n const desktopLook = useLook() === \"desktop\";\n const asSheet = mobileSheet && isMobile && !desktopLook;\n const windowed = !isModal && !asSheet;\n const windowedByDefault = React.useContext(DialogWindowedByDefaultContext);\n const [containerEl, setContainerEl] = React.useState<HTMLElement | null>(\n null,\n );\n\n // ── the front-most layer (layer-front.ts) ───────────────────────────────\n // A default window sits at z-10000 with the layers it was opened from; it\n // steps behind when another layer comes to the front after it (a host\n // window opened from the Agents menu) and returns when the person reaches\n // for it again. An explicit modal={false} keeps its fixed z-900 contract.\n const stacks = windowed && windowedByDefault;\n const [behind, setBehind] = React.useState(false);\n React.useEffect(() => {\n if (!stacks || !containerEl) return;\n const onFront = (event: Event) => {\n const element = (event as CustomEvent<LayerFrontDetail>).detail?.element ?? null;\n if (element && (element === containerEl || containerEl.contains(element))) return;\n setBehind(true);\n };\n document.addEventListener(LAYER_FRONT_EVENT, onFront);\n // Opening is coming to the front.\n announceLayerFront(containerEl);\n return () => document.removeEventListener(LAYER_FRONT_EVENT, onFront);\n }, [stacks, containerEl]);\n const bringToFront = () => {\n if (!stacks || !containerEl) return;\n setBehind(false);\n announceLayerFront(containerEl);\n };\n\n // ── rule 6: the windowed dialog drags by its header ──────────────────────\n // THE WINDOW DRAG (window-drag.ts): painted per frame, committed once on release,\n // the header kept on screen.\n const [offset, setOffset] = React.useState({ x: 0, y: 0 });\n const drag = useDragMove({\n element: containerEl,\n enabled: windowed,\n paint: \"offset\",\n offset,\n constrain: (next) => clampRectToViewport(next, readViewport(), { keepVisible: WINDOW_KEEP_VISIBLE }),\n onCommit: (_rect, commit) => setOffset(commit.offset),\n });\n const handle = React.useMemo<DialogWindowHandle | null>(\n () => (windowed ? { onPointerDown: drag.onPointerDown, onDoubleClick: () => setOffset({ x: 0, y: 0 }) } : null),\n [windowed, drag.onPointerDown],\n );\n\n const mergedRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n setContainerEl(node);\n if (typeof ref === \"function\") ref(node);\n else if (ref)\n (ref as React.MutableRefObject<HTMLDivElement | null>).current = node;\n },\n [ref],\n );\n\n // The × sits in the header's row, or in a row of its own (close-slot.tsx).\n const closeSlot = useCloseSlot(showCloseButton && !desktopLook);\n\n const hasTitle =\n treeContainsComponent(children, DialogTitle) ||\n treeContainsComponent(children, DialogPrimitive.Title);\n const hasDescription =\n treeContainsComponent(children, DialogDescription) ||\n treeContainsComponent(children, DialogPrimitive.Description);\n\n return (\n <DialogPortal container={container}>\n {isModal ? <DialogOverlay /> : null}\n <DialogContentPrimitive\n ref={mergedRef}\n data-slot=\"dialog-content\"\n data-size={size}\n data-padding={padding === \"none\" ? \"none\" : undefined}\n data-height={height === \"tall\" ? \"tall\" : undefined}\n data-desktop-sheet={desktopLook ? \"\" : undefined}\n className={cn(\n asSheet ? DIALOG_MOBILE_SHEET_CLASSES : DIALOG_DESKTOP_CLASSES,\n !asSheet && DIALOG_SIZE_CLASS[size],\n padding === \"none\" && (asSheet ? \"gap-0 p-0 pb-safe [--dialog-pad:0px]\" : \"gap-0 p-0 [--dialog-pad:0px]\"),\n height === \"tall\" && (asSheet ? \"h-[90dvh]\" : \"h-[85dvh]\"),\n animated && !desktopLook && (asSheet ? MOTION_BOTTOM_SHEET : MOTION_DIALOG),\n className,\n asSheet && DIALOG_MOBILE_SHEET_OVERRIDE,\n // A non-modal dialog is the coexistence contract for content that\n // can sit beside a host's floating window manager (which starts at\n // z=1000); staying below that boundary makes a newly focused window\n // usable without coupling the two systems.\n !isModal && !windowedByDefault && \"z-[900]\",\n // Another layer came to the front after this window (layer-front.ts).\n stacks && behind && \"z-[999]\",\n // Without an overlay the card needs its own separation from the page.\n windowed && \"shadow-2xl ring-1 ring-border/60\",\n )}\n style={\n windowed && (offset.x !== 0 || offset.y !== 0)\n ? { ...style, translate: `${offset.x}px ${offset.y}px` }\n : style\n }\n onPointerDownCapture={(event) => {\n onPointerDownCapture?.(event);\n if (behind) bringToFront();\n }}\n onFocusCapture={(event) => {\n onFocusCapture?.(event);\n if (behind) bringToFront();\n }}\n onInteractOutside={(event) => {\n onInteractOutside?.(event);\n if (windowed && !dismissOnOutsideClick) event.preventDefault();\n }}\n onEscapeKeyDown={(event) => {\n onEscapeKeyDown?.(event);\n // Escape pressed in the page belongs to the page (a grid canceling\n // an edit), not to the window beside it.\n // The key's own target is where the person pressed it; focus is\n // the fallback when the event carries no element target.\n const pressedIn =\n event.target instanceof Node && event.target !== document.body\n ? event.target\n : document.activeElement;\n // Focus on <body> (or nowhere) belongs to nobody in the page: a button that disabled itself\n // while it worked (Share with User) drops focus there, and Escape must still close the window.\n const nowhere =\n !pressedIn || pressedIn === document.body || pressedIn === document.documentElement;\n if (windowed && containerEl && !nowhere && !containerEl.contains(pressedIn)) {\n event.preventDefault();\n }\n }}\n {...(hasDescription ? {} : { \"aria-describedby\": undefined })}\n {...props}\n >\n {hasTitle ? null : (\n <VisuallyHidden.Root>\n <DialogPrimitive.Title>Dialog</DialogPrimitive.Title>\n </VisuallyHidden.Root>\n )}\n {closeSlot.slot && !closeSlot.claimed ? <CloseRow /> : null}\n <CloseSlotProvider value={closeSlot.slot}>\n <DialogContainerContext.Provider value={containerEl}>\n <DialogWindowHandleContext.Provider value={handle}>\n <PortalContainerProvider\n container={containerEl ?? injectedContainer ?? null}\n >\n {children}\n </PortalContainerProvider>\n </DialogWindowHandleContext.Provider>\n </DialogContainerContext.Provider>\n </CloseSlotProvider>\n </DialogContentPrimitive>\n </DialogPortal>\n );\n },\n);\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => {\n // In a windowed dialog the header is the drag handle (rule 6).\n const handle = React.useContext(DialogWindowHandleContext);\n return (\n <HeaderWithClose\n slotName=\"dialog-header\"\n baseClassName=\"flex flex-col space-y-1.5 text-center sm:text-left\"\n // DialogTitle's line is 18px (text-lg leading-none): (44 - 18) / 2 = 13, (32 - 18) / 2 = 7.\n closeOffsetClassName=\"-mt-3 lg:-mt-1.5\"\n {...(handle\n ? {\n ...handle,\n \"data-window-handle\": \"\",\n title: \"Drag to move · double-click to recenter\",\n }\n : {})}\n className={cn(handle && \"cursor-grab select-none active:cursor-grabbing\", className)}\n {...props}\n />\n );\n};\nDialogHeader.displayName = \"DialogHeader\";\n\nconst DialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n // `gap-2` is the stacked (phone) gap — the buttons never touch; from sm up the\n // row keeps its `space-x-2`, so the gap resets to 0 there.\n \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end sm:gap-0 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);\nDialogFooter.displayName = \"DialogFooter\";\n\nconst DialogTitle = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n data-slot=\"dialog-title\"\n className={cn(\"text-lg font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n data-slot=\"dialog-description\"\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogContentPrimitive,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n","\"use client\";\n\n/**\n * THE LOOK — one implementation, the host's native skin.\n *\n * A shared workspace (the Vault, …) is written ONCE in the web vocabulary (`/controls`, the root\n * Dialog/menus, semantic Tailwind tokens). Inside Matrx Desktop it must look like a Mac app (the\n * desktop standard, `desktop/DESKTOP.md`). `LookScope look=\"desktop\"` is that switch:\n *\n * - it draws a `data-matrx-look=\"desktop\"` box; `look-desktop.css` (imported by styles.css, inert\n * without the attribute) puts the web tokens on AppKit's values, Tailwind's type scale on\n * Apple's text styles, the platform's system font, and the `/controls` on NSControl geometry;\n * - every portal-aware layer opened inside it (Dialog, Popover, menus, Select, Tooltip) mounts in a\n * layer that carries the same attribute, so a menu or sheet wears the look too;\n * - `useLook()` tells a component the look, so the root `DialogContent` becomes a macOS sheet.\n *\n * `look=\"web\"` (the default) renders its children only: the web output is byte-for-byte unchanged.\n * Never a second component tree, never per-call-site overrides.\n */\n\nimport * as React from \"react\";\nimport { PortalContainerProvider } from \"./portal-container\";\n\nexport type Look = \"web\" | \"desktop\";\n\n// Shared identity across independently bundled public entrypoints (as portal-container does).\nconst CONTEXT_SLOT = Symbol.for(\"ai-matrx.design-system.look-context\");\nconst registry = globalThis as typeof globalThis & { [CONTEXT_SLOT]?: React.Context<Look> };\nconst LookContext = (registry[CONTEXT_SLOT] ??= React.createContext<Look>(\"web\"));\n\n/** The look the nearest `LookScope` chose; `\"web\"` outside any scope. */\nexport function useLook(): Look {\n return React.useContext(LookContext);\n}\n\nexport const LOOK_ATTRIBUTE = \"data-matrx-look\";\n\nexport interface LookScopeProps extends React.HTMLAttributes<HTMLDivElement> {\n look: Look;\n children: React.ReactNode;\n}\n\n/** The layer every portal opened inside a desktop scope mounts in: a body child wearing the look. */\nfunction useLookLayer(look: Look): HTMLElement | null {\n const [layer, setLayer] = React.useState<HTMLElement | null>(null);\n React.useEffect(() => {\n if (look === \"web\" || typeof document === \"undefined\") return;\n const el = document.createElement(\"div\");\n el.setAttribute(LOOK_ATTRIBUTE, look);\n el.setAttribute(\"data-slot\", \"look-layer\");\n document.body.appendChild(el);\n setLayer(el);\n return () => {\n el.remove();\n setLayer(null);\n };\n }, [look]);\n return layer;\n}\n\nexport function LookScope({ look, children, ...div }: LookScopeProps) {\n const layer = useLookLayer(look);\n if (look === \"web\") return <LookContext.Provider value=\"web\">{children}</LookContext.Provider>;\n return (\n <LookContext.Provider value={look}>\n <div {...div} {...{ [LOOK_ATTRIBUTE]: look }}>\n <PortalContainerProvider container={layer}>{children}</PortalContainerProvider>\n </div>\n </LookContext.Provider>\n );\n}\n","/**\n * THE FRONT-MOST LAYER — one signal every floating layer shares, so the layer\n * the person used last is the one on top.\n *\n * A windowed Dialog sits at z-10000 so it is never behind the menu, popover or\n * host window it was opened from (0.38.1). But a host window opened or focused\n * AFTER it — the window an agent run opens from the Agents menu while Table\n * settings is open — then sat underneath it, and its composer could not be\n * clicked or typed into (found live 2026-09-26, register ARE-010). Recency has\n * to decide, across both systems, without coupling them.\n *\n * So any layer that comes to the front announces it: `announceLayerFront(el)`\n * dispatches `matrx:layer-front` on `document`. A windowed Dialog announces\n * itself when it opens and when the person presses or focuses inside it; it\n * steps BEHIND (z-999, still above the page and below the host's window\n * manager at 1000+) whenever another layer announces, and comes back the\n * moment the person reaches for it. A host window manager announces its\n * window on open and on focus.\n */\n\nexport const LAYER_FRONT_EVENT = \"matrx:layer-front\";\n\nexport interface LayerFrontDetail {\n /** The element that came to the front. */\n element: Element | null;\n}\n\n/** Tell every other floating layer that `element` is now the one in front. */\nexport function announceLayerFront(element: Element | null): void {\n if (typeof document === \"undefined\") return;\n document.dispatchEvent(\n new CustomEvent<LayerFrontDetail>(LAYER_FRONT_EVENT, { detail: { element } }),\n );\n}\n","/**\n * THE WINDOW DRAG — the ONE pointer-drag / resize / viewport-clamp primitive\n * every floating surface uses: a windowed Dialog's header, a PeekWindow, the\n * desktop InspectorPanel, @ai-matrx/summon's WindowPanel, Dock and LiteWindow,\n * and @ai-matrx/associations' DefaultWindowShell. It lives at this layer\n * because every one of them sits on design-system; nothing below may fork it.\n *\n * Three layers, use the highest one that fits:\n *\n * 1. `useDragMove()` — the React hook. A pointer move PAINTS the element\n * inside one animation frame (CSS `translate`, plus `width`/`height` for a\n * resize) and the host's state is committed EXACTLY ONCE, on release.\n * Writing state per pointer event re-renders whatever streams inside the\n * window sixty times a second (paid for in Workflow Studio's floating chat\n * and chat's ChatPanel). It also carries THE CURSOR LAW (`holdDragCursor`\n * for the whole gesture), z-order (`announceLayerFront` on press), the\n * \"controls in the handle stay controls\" rule, and a cleanup that leaves\n * no listener, frame or cursor behind on unmount.\n * 2. `startPointerDrag()` — the gesture lifecycle alone (window listeners per\n * pointer id, threshold, cursor hold, frame-coalesced moves, trailing-click\n * swallow, cancel). For a host whose moves must reach a store live (summon's\n * WindowPanel: pop-out drag-out detection and window-manager geometry).\n * 3. Pure geometry — `resizeRect()` (8-edge resize with size limits) and\n * `clampRectToViewport()` (the header always stays reachable).\n */\n\nimport {\n useCallback,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n type PointerEvent as ReactPointerEvent,\n} from \"react\";\n\nimport { type DragCursor, holdDragCursor } from \"./drag-cursor\";\nimport { announceLayerFront } from \"./layer-front\";\n\n// ── Geometry ─────────────────────────────────────────────────────────────────\n\n/** A window's box in px — viewport px unless the host measures in a container. */\nexport interface DragRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport interface DragViewport {\n width: number;\n height: number;\n}\n\n/** The edge or corner a resize handle grabs. */\nexport type ResizeEdge = \"n\" | \"s\" | \"e\" | \"w\" | \"ne\" | \"nw\" | \"se\" | \"sw\";\n\n/** The cursor held on the document while each edge resizes (THE CURSOR LAW). */\nexport const RESIZE_EDGE_CURSOR: Record<ResizeEdge, DragCursor> = {\n e: \"ew-resize\",\n w: \"ew-resize\",\n n: \"ns-resize\",\n s: \"ns-resize\",\n se: \"nwse-resize\",\n nw: \"nwse-resize\",\n ne: \"nesw-resize\",\n sw: \"nesw-resize\",\n};\n\nexport interface SizeLimits {\n minWidth?: number;\n minHeight?: number;\n maxWidth?: number;\n maxHeight?: number;\n}\n\n/** Controls inside a drag handle that stay controls — a press there never starts a drag. */\nexport const DRAG_IGNORE_SELECTOR =\n \"button,a,input,select,textarea,[role='button'],[contenteditable='true'],[data-no-drag]\";\n\nconst bound = (value: number, min: number, max: number): number => Math.min(max, Math.max(min, value));\n\n/**\n * `origin` resized by a pointer that traveled (`dx`, `dy`) from the press on\n * `edge`. A west or north edge keeps the opposite edge still; sizes honor\n * `limits`.\n */\nexport function resizeRect(origin: DragRect, edge: ResizeEdge, dx: number, dy: number, limits: SizeLimits = {}): DragRect {\n const minWidth = limits.minWidth ?? 0;\n const minHeight = limits.minHeight ?? 0;\n const maxWidth = limits.maxWidth ?? Number.POSITIVE_INFINITY;\n const maxHeight = limits.maxHeight ?? Number.POSITIVE_INFINITY;\n const next = { ...origin };\n if (edge.includes(\"e\")) next.width = bound(origin.width + dx, minWidth, maxWidth);\n if (edge.includes(\"s\")) next.height = bound(origin.height + dy, minHeight, maxHeight);\n if (edge.includes(\"w\")) {\n next.width = bound(origin.width - dx, minWidth, maxWidth);\n next.x = origin.x + (origin.width - next.width);\n }\n if (edge.includes(\"n\")) {\n next.height = bound(origin.height - dy, minHeight, maxHeight);\n next.y = origin.y + (origin.height - next.height);\n }\n return next;\n}\n\nexport interface ViewportClamp {\n /** Smallest gap kept to the viewport edge. Default 0. */\n margin?: number;\n /**\n * Px of the window that must stay on screen horizontally and below the top\n * edge. Omit to keep the WHOLE window on screen. Either way the top edge (the\n * header) is never above `margin`, and a window larger than the room keeps\n * its top-left visible — an unreachable header is an unclosable window.\n */\n keepVisible?: number;\n /** Shrink the window to the room (never below these) before placing it. */\n fit?: { minWidth: number; minHeight: number };\n}\n\n/** `rect` kept reachable inside `viewport` (see `ViewportClamp`). */\nexport function clampRectToViewport(rect: DragRect, viewport: DragViewport, clamp: ViewportClamp = {}): DragRect {\n const margin = clamp.margin ?? 0;\n let { width, height } = rect;\n if (clamp.fit) {\n width = Math.min(width, Math.max(clamp.fit.minWidth, viewport.width - margin * 2));\n height = Math.min(height, Math.max(clamp.fit.minHeight, viewport.height - margin * 2));\n }\n const keep = clamp.keepVisible;\n const lowX = keep === undefined ? margin : margin + Math.min(keep, width) - width;\n const highX = keep === undefined ? viewport.width - width - margin : viewport.width - Math.min(keep, width) - margin;\n const highY = keep === undefined ? viewport.height - height - margin : viewport.height - Math.min(keep, height) - margin;\n return {\n width,\n height,\n x: Math.round(Math.max(lowX, Math.min(rect.x, highX))),\n y: Math.round(Math.max(margin, Math.min(rect.y, highY))),\n };\n}\n\n/** The browser viewport (a sane desktop size during SSR). */\nexport function readViewport(): DragViewport {\n return typeof window === \"undefined\" ? { width: 1280, height: 800 } : { width: window.innerWidth, height: window.innerHeight };\n}\n\n// ── The gesture ──────────────────────────────────────────────────────────────\n\nexport interface DragDelta {\n dx: number;\n dy: number;\n}\n\nexport interface PointerDragOptions {\n /** Px the pointer must travel before the press becomes a drag. Default 0 (a drag from the press). */\n threshold?: number;\n /** Cursor held on the document while dragging. Default `grabbing`; `null` holds none. */\n cursor?: DragCursor | null;\n /** Coalesce moves to one call per animation frame. Default true. */\n frame?: boolean;\n /** Swallow the click the browser fires after a real drag. Default: `threshold > 0`. */\n swallowClick?: boolean;\n /** The press became a drag (immediately when `threshold` is 0). */\n onStart?(): void;\n /** The pointer traveled `delta` from the press (only after `onStart`). */\n onMove(delta: DragDelta, event: PointerEvent): void;\n /** Released or canceled by the browser. `moved` is false for a press that never traveled. */\n onEnd?(delta: DragDelta, info: { moved: boolean; started: boolean; cancelled: boolean }): void;\n}\n\nexport interface PointerDragHandle {\n /** Abort silently (unmount, close): listeners, frame and cursor are released, `onEnd` is not called. */\n cancel(): void;\n}\n\ninterface PressPoint {\n clientX: number;\n clientY: number;\n pointerId: number;\n}\n\n/** Track one pointer from its press until release. See the module doc. */\nexport function startPointerDrag(press: PressPoint, options: PointerDragOptions): PointerDragHandle {\n const threshold = options.threshold ?? 0;\n const useFrame = options.frame !== false;\n const swallowClick = options.swallowClick ?? threshold > 0;\n let started = false;\n let moved = false;\n let releaseCursor: (() => void) | null = null;\n let frame: number | null = null;\n let pending: { delta: DragDelta; event: PointerEvent } | null = null;\n let last: DragDelta = { dx: 0, dy: 0 };\n let done = false;\n\n const start = () => {\n started = true;\n if (options.cursor !== null) releaseCursor = holdDragCursor(options.cursor ?? \"grabbing\");\n options.onStart?.();\n };\n const flush = () => {\n frame = null;\n if (!pending) return;\n const { delta, event } = pending;\n pending = null;\n options.onMove(delta, event);\n };\n const onMove = (event: PointerEvent) => {\n if (event.pointerId !== press.pointerId) return;\n const delta = { dx: event.clientX - press.clientX, dy: event.clientY - press.clientY };\n if (!started) {\n if (Math.abs(delta.dx) < threshold && Math.abs(delta.dy) < threshold) return;\n start();\n }\n if (delta.dx !== 0 || delta.dy !== 0) moved = true;\n last = delta;\n pending = { delta, event };\n if (!useFrame || typeof window.requestAnimationFrame !== \"function\") flush();\n else if (frame === null) frame = window.requestAnimationFrame(flush);\n };\n const teardown = () => {\n done = true;\n window.removeEventListener(\"pointermove\", onMove);\n window.removeEventListener(\"pointerup\", onUp);\n window.removeEventListener(\"pointercancel\", onUp);\n if (frame !== null) window.cancelAnimationFrame?.(frame);\n frame = null;\n releaseCursor?.();\n releaseCursor = null;\n };\n const onUp = (event: PointerEvent) => {\n if (event.pointerId !== press.pointerId || done) return;\n // The last position is painted before the gesture ends, never dropped with its frame.\n if (pending) flush();\n teardown();\n options.onEnd?.(last, { moved, started, cancelled: event.type === \"pointercancel\" });\n if (moved && swallowClick) {\n const swallow = (click: MouseEvent) => {\n click.stopPropagation();\n click.preventDefault();\n };\n window.addEventListener(\"click\", swallow, { capture: true, once: true });\n window.setTimeout(() => window.removeEventListener(\"click\", swallow, { capture: true }), 0);\n }\n };\n\n window.addEventListener(\"pointermove\", onMove);\n window.addEventListener(\"pointerup\", onUp);\n window.addEventListener(\"pointercancel\", onUp);\n if (threshold <= 0) start();\n return {\n cancel: () => {\n if (!done) teardown();\n },\n };\n}\n\n// ── The hook ─────────────────────────────────────────────────────────────────\n\n/** What a gesture is doing: moving the window, or resizing it from an edge. */\nexport type DragGesture = \"move\" | ResizeEdge;\n\nexport interface DragCommit {\n /** The window's box when pressed. */\n origin: DragRect;\n gesture: DragGesture;\n /** Pointer travel, after `constrain`: `rect.x - origin.x`, `rect.y - origin.y`. */\n delta: DragDelta;\n /** `paint: \"offset\"` only: the host's `offset` at the press plus `delta`. */\n offset: { x: number; y: number };\n}\n\nexport interface UseDragMoveOptions {\n /** The element that MOVES (the window frame). */\n element: HTMLElement | null;\n /** Default true. False: presses do nothing (a phone sheet, a maximized window). */\n enabled?: boolean;\n /** Px before a press becomes a drag. Default 0. A handle that is also a click target passes 4. */\n threshold?: number;\n /** Allow touch drags. Default true. */\n touch?: boolean;\n /** Controls inside a handle that never start a drag. Default `DRAG_IGNORE_SELECTOR`; `null` = none. */\n ignore?: string | null;\n /** Announce the element as the front-most layer on press (layer-front.ts). Default true. */\n announce?: boolean;\n /**\n * How a drag paints the element before the commit:\n * - `delta` (default): `translate` by the travel, cleared in the commit's own render\n * (the host positions with left/top/right/bottom and commits the new place);\n * - `offset`: the host renders `translate` from its own `offset` — the drag paints\n * `offset + travel` and leaves it for the host's commit to own.\n */\n paint?: \"delta\" | \"offset\";\n /** The host's committed translate (`paint: \"offset\"`). */\n offset?: { x: number; y: number };\n /** The window's box at the press. Default: the element's viewport rect. */\n getRect?: () => DragRect;\n /** Keep every painted box legal (e.g. `clampRectToViewport`). */\n constrain?: (next: DragRect, gesture: DragGesture, origin: DragRect) => DragRect;\n /** Resize size limits. */\n limits?: SizeLimits;\n /** Cursor held while moving. Default `grabbing` (resizes hold their edge's cursor). */\n cursor?: DragCursor;\n /** A press is starting a gesture (focus or raise the window here). */\n onPress?: (event: ReactPointerEvent<HTMLElement>, gesture: DragGesture) => void;\n /** Every painted frame — for observers that are NOT React state. */\n onFrame?: (rect: DragRect, gesture: DragGesture) => void;\n /** Once per gesture that moved, on release. Commit the host's state here. */\n onCommit: (rect: DragRect, commit: DragCommit) => void;\n}\n\nexport interface DragMoveApi {\n /** Spread onto the element you drag BY: `onPointerDown={drag.onPointerDown}`. */\n onPointerDown: (event: ReactPointerEvent<HTMLElement>) => void;\n /** `onPointerDown` for the handle that resizes from `edge`. */\n resizeHandle: (edge: ResizeEdge) => (event: ReactPointerEvent<HTMLElement>) => void;\n /** True from the moment a press becomes a drag until release. */\n dragging: boolean;\n /** Abandon a drag in flight (the window closed): nothing is committed, the cursor is released. */\n cancel: () => void;\n}\n\n/** Drag and resize a floating element without re-rendering it while the pointer moves. */\nexport function useDragMove(options: UseDragMoveOptions): DragMoveApi {\n const live = useRef(options);\n useLayoutEffect(() => {\n live.current = options;\n });\n const [dragging, setDragging] = useState(false);\n const gestureRef = useRef<PointerDragHandle | null>(null);\n /** The translate to put back once the commit has rendered (`paint: \"delta\"`). */\n const restoreRef = useRef<{ element: HTMLElement; translate: string } | null>(null);\n\n useLayoutEffect(() => {\n const restore = restoreRef.current;\n if (!restore) return;\n restoreRef.current = null;\n restore.element.style.translate = restore.translate;\n });\n\n useEffect(\n () => () => {\n gestureRef.current?.cancel();\n gestureRef.current = null;\n },\n [],\n );\n\n const begin = useCallback((event: ReactPointerEvent<HTMLElement>, gesture: DragGesture) => {\n const opts = live.current;\n const element = opts.element;\n if (opts.enabled === false || !element || event.button !== 0) return;\n if (opts.touch === false && event.pointerType === \"touch\") return;\n const target = event.target instanceof Element ? event.target : null;\n const ignore = opts.ignore === undefined ? DRAG_IGNORE_SELECTOR : opts.ignore;\n if (gesture === \"move\" && ignore && target) {\n const hit = target.closest(ignore);\n if (hit && hit !== event.currentTarget && event.currentTarget.contains(hit)) return;\n }\n // A press on bare chrome must not start a text selection; a press on a control keeps its default.\n if (gesture !== \"move\" || !target?.closest(\"button,a,input,select,textarea,label,[role=button]\")) event.preventDefault();\n if (gesture !== \"move\") event.stopPropagation();\n gestureRef.current?.cancel();\n opts.onPress?.(event, gesture);\n if (opts.announce !== false) announceLayerFront(element);\n\n const origin = opts.getRect?.() ?? (() => {\n const rect = element.getBoundingClientRect();\n return { x: rect.left, y: rect.top, width: rect.width, height: rect.height };\n })();\n const paintMode = opts.paint ?? \"delta\";\n const base = paintMode === \"offset\" ? (opts.offset ?? { x: 0, y: 0 }) : { x: 0, y: 0 };\n const baseTranslate = element.style.translate;\n let latest = origin;\n\n gestureRef.current = startPointerDrag(event, {\n threshold: opts.threshold ?? 0,\n cursor: gesture === \"move\" ? (opts.cursor ?? \"grabbing\") : RESIZE_EDGE_CURSOR[gesture],\n onStart: () => setDragging(true),\n onMove: ({ dx, dy }) => {\n const now = live.current;\n const raw =\n gesture === \"move\"\n ? { ...origin, x: origin.x + dx, y: origin.y + dy }\n : resizeRect(origin, gesture, dx, dy, now.limits);\n latest = now.constrain ? now.constrain(raw, gesture, origin) : raw;\n element.style.translate = `${base.x + latest.x - origin.x}px ${base.y + latest.y - origin.y}px`;\n if (gesture !== \"move\") {\n element.style.width = `${latest.width}px`;\n element.style.height = `${latest.height}px`;\n }\n now.onFrame?.(latest, gesture);\n },\n onEnd: (_delta, { moved, started }) => {\n gestureRef.current = null;\n if (started) setDragging(false);\n if (!moved) return;\n if (paintMode === \"delta\") restoreRef.current = { element, translate: baseTranslate };\n const delta = { dx: latest.x - origin.x, dy: latest.y - origin.y };\n live.current.onCommit(latest, {\n origin,\n gesture,\n delta,\n offset: { x: base.x + delta.dx, y: base.y + delta.dy },\n });\n },\n });\n }, []);\n\n const onPointerDown = useCallback((event: ReactPointerEvent<HTMLElement>) => begin(event, \"move\"), [begin]);\n const resizeHandle = useCallback(\n (edge: ResizeEdge) => (event: ReactPointerEvent<HTMLElement>) => begin(event, edge),\n [begin],\n );\n\n const cancel = useCallback(() => {\n if (!gestureRef.current) return;\n gestureRef.current.cancel();\n gestureRef.current = null;\n setDragging(false);\n }, []);\n\n return { onPointerDown, resizeHandle, dragging, cancel };\n}\n","/**\n * THE DRAG CURSOR HOLD — the ONE way a drag sets its cursor (THE CURSOR LAW,\n * common-docs/policies/cursor-law.md).\n *\n * A cursor set on the dragged element flickers: the pointer outruns the\n * element, crosses a button or a field, and the cursor changes under it. So a\n * drag holds its cursor on `<html data-dragging=\"…\">` for its whole duration,\n * and `styles.css` § THE CURSOR LAW pins that cursor on every element,\n * important, in the first layer (`matrx-tap-lock`), so nothing — not a\n * utility, not the tap lock's own `cursor: pointer !important` — can override\n * it mid-drag.\n *\n * const release = holdDragCursor(); // pointerdown\n * … // pointermove\n * release(); // pointerup / pointercancel\n *\n * Holds nest: the newest hold's cursor shows, and the attribute clears only\n * when every hold has released. A release is idempotent.\n *\n * Inside a dnd-kit `<DndContext>`, render `<DragCursorMonitor />` (from\n * `./drag-cursor-monitor`) instead of calling this by hand.\n */\n\nexport const DRAG_CURSORS = [\n \"grabbing\",\n \"move\",\n \"col-resize\",\n \"row-resize\",\n \"ew-resize\",\n \"ns-resize\",\n \"nwse-resize\",\n \"nesw-resize\",\n] as const;\n\nexport type DragCursor = (typeof DRAG_CURSORS)[number];\n\nconst holds: { id: number; cursor: DragCursor }[] = [];\nlet nextId = 0;\n\nfunction apply(): void {\n if (typeof document === \"undefined\") return;\n const root = document.documentElement;\n const top = holds[holds.length - 1];\n if (top) root.dataset.dragging = top.cursor;\n else delete root.dataset.dragging;\n}\n\n/** Hold `cursor` on the whole document until the returned release is called. */\nexport function holdDragCursor(cursor: DragCursor = \"grabbing\"): () => void {\n const id = nextId++;\n holds.push({ id, cursor });\n apply();\n let released = false;\n return () => {\n if (released) return;\n released = true;\n const index = holds.findIndex((hold) => hold.id === id);\n if (index >= 0) holds.splice(index, 1);\n apply();\n };\n}\n","\"use client\";\nimport React from \"react\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"./tooltip\";\nimport { Button, type GlyphTone } from \"./controls/index\";\nimport { MOTION_SPIN } from \"./motion\";\n\n// Moved whole from matrx-frontend components/official/IconButton (chat host slots, 2026-10-08).\n\n/**\n * A door onto THE control: an icon-only controls `Button` (the 28px circle) with an optional\n * tooltip. It has no size and no color of its own — a glyph whose color carries meaning says\n * so with `glyphTone`; `className` places it (margin, position, flex), never restyles it.\n */\nexport interface IconButtonProps\n extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"children\"> {\n /** Any glyph component (a design-system glyph, a Lucide icon, …); it receives `className`. */\n icon: React.ComponentType<{ className?: string }>;\n tooltip?: string;\n /** Legacy tone words map onto the control's variants: ghost → quiet, default → primary,\n * destructive → danger. */\n variant?: \"ghost\" | \"outline\" | \"default\" | \"secondary\" | \"destructive\" | \"link\";\n /** The glyph's own status ink when its color carries meaning. */\n glyphTone?: GlyphTone;\n /** Work in flight: the glyph turns (a refresh, a duplicate, an export). */\n spinning?: boolean;\n tooltipSide?: \"top\" | \"right\" | \"bottom\" | \"left\";\n tooltipAlign?: \"start\" | \"center\" | \"end\";\n tooltipOffset?: number;\n}\n\nconst VARIANT = {\n ghost: \"quiet\",\n outline: \"outline\",\n secondary: \"outline\",\n default: \"primary\",\n destructive: \"danger\",\n link: \"link\",\n} as const;\n\nexport function IconButton({\n icon: Icon,\n tooltip,\n variant = \"ghost\",\n glyphTone,\n spinning = false,\n tooltipSide = \"bottom\",\n tooltipAlign = \"center\",\n tooltipOffset = 5,\n \"aria-label\": ariaLabel,\n ...props\n}: IconButtonProps) {\n const control = (\n <Button\n variant={VARIANT[variant]}\n icon={spinning ? <Icon className={MOTION_SPIN} /> : <Icon />}\n {...(glyphTone ? { glyphTone } : {})}\n aria-label={ariaLabel ?? tooltip ?? \"Action\"}\n {...props}\n />\n );\n if (!tooltip) return control;\n return (\n <Tooltip>\n <TooltipTrigger asChild>{control}</TooltipTrigger>\n <TooltipContent side={tooltipSide} align={tooltipAlign} className=\"z-[9999]\" sideOffset={tooltipOffset}>\n {tooltip}\n </TooltipContent>\n </Tooltip>\n );\n}\n","\"use client\";\n\n/**\n * EmptyStateCard — the centered \"nothing here\" block: a large tinted icon, a title, a sentence, and an\n * optional call to action. Moved from matrx-frontend `components/official/cards/EmptyStateCard`\n * (wave 3, 2026-10-22).\n *\n * The old alternate-state machinery (six class props: icon color, icon background, button color, ...) is one\n * named option: `tone=\"success\"` draws the done / all-clear look from the success role; the default is the\n * primary role. The call to action is the controls `Button` (primary, or outline in the success tone).\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { Button } from \"./controls\";\n\nexport interface EmptyStateCardProps {\n title: string;\n description: string;\n /** Any glyph component (a package glyph, a Lucide icon); it receives `className`. */\n icon: React.ComponentType<{ className?: string; strokeWidth?: number }>;\n buttonText?: string;\n onButtonClick?: () => void;\n /** Drawn beside the call to action. */\n secondaryButton?: React.ReactNode;\n /** `primary` (default) or `success`, the all-clear look. */\n tone?: \"primary\" | \"success\";\n}\n\nconst TONE = {\n primary: { data: \"primary\", button: \"primary\" },\n success: { data: \"success\", button: \"outline\" },\n} as const;\n\nexport function EmptyStateCard({\n title,\n description,\n icon: Icon,\n buttonText,\n onButtonClick,\n secondaryButton,\n tone = \"primary\",\n}: EmptyStateCardProps) {\n const t = TONE[tone];\n return (\n <div data-tone={t.data} className=\"matrx-hue-card flex flex-col items-center justify-center px-6 py-12 text-center\">\n <div className=\"matrx-hue-icon mb-6 rounded-full p-6\">\n <Icon className=\"h-12 w-12\" strokeWidth={1.5} />\n </div>\n <h3 className={cn(\"mb-3 text-xl font-semibold\", tone === \"success\" ? \"text-success-ink\" : \"text-foreground\")}>\n {title}\n </h3>\n <p className=\"mb-8 max-w-md text-muted-foreground\">{description}</p>\n {buttonText && (\n <div className=\"flex flex-col gap-4 sm:flex-row\">\n <Button variant={t.button} {...(tone === \"success\" ? { tone: \"success\" as const } : {})} {...(onButtonClick ? { onClick: onButtonClick } : {})}>\n {buttonText}\n </Button>\n {secondaryButton}\n </div>\n )}\n </div>\n );\n}\n","\"use client\";\n\n/**\n * THE HUE CARDS — the colored icon cards: a card (`HueCard`, with a compact iOS squircle form), a grid of them\n * (`HueGrid`), a horizontal row (`HueRow`) and its list (`HueList`), and the 2x2 gradient widget (`IosWidget`);\n * plus the plain tile (`TileCard`) and its grid (`TileCardGrid`).\n *\n * Moved from matrx-frontend `components/official/card-and-grid/*` and `components/official/cards/CardGrid`\n * (wave 3, 2026-10-22). The ~150 palette classes (`bg-indigo-100 dark:bg-indigo-900/70`, gradient stops, ...) are\n * gone: a card's color is a NAMED hue (`CardColor`) that picks the chip tone table in `controls.css`, so it\n * is a token in light and dark. The look follows the tokens:\n * - the former `yellow` and `amber` share the amber token (the table has no yellow); `purple` is `violet`,\n * `pink` is `fuchsia`, `gray` is `slate`, `red` is the destructive role, `green` the success role;\n * - the squircle / widget gradient runs from the hue to the hue darkened toward black.\n * Links draw through `HostLink` (the registered tap-target link). Text is foreground / muted tokens only.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { HostLink } from \"../host-link\";\nimport { ChevronRightIcon, PlusIcon } from \"../icons\";\n\n/** The names callers already use. Each picks one tone of the chip table (see `HUE_TONE`). */\nexport type CardColor =\n | \"indigo\"\n | \"emerald\"\n | \"blue\"\n | \"amber\"\n | \"purple\"\n | \"gray\"\n | \"red\"\n | \"green\"\n | \"yellow\"\n | \"pink\"\n | \"orange\"\n | \"teal\"\n | \"cyan\"\n | \"lime\"\n | \"rose\"\n | \"violet\"\n | \"slate\";\n\n/** CardColor -> the `data-tone` of the chip table in controls.css. */\nexport const HUE_TONE: Record<CardColor, string> = {\n indigo: \"indigo\",\n emerald: \"emerald\",\n blue: \"blue\",\n amber: \"amber\",\n purple: \"violet\",\n gray: \"slate\",\n red: \"destructive\",\n green: \"success\",\n yellow: \"amber\",\n pink: \"fuchsia\",\n orange: \"orange\",\n teal: \"teal\",\n cyan: \"cyan\",\n lime: \"lime\",\n rose: \"rose\",\n violet: \"violet\",\n slate: \"slate\",\n};\n\nexport type CardSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n\ntype SizedIcon = React.ReactElement<{ size?: number; className?: string }>;\n\nfunction sizedIcon(icon: SizedIcon, fallback: number): React.ReactNode {\n return React.isValidElement<{ size?: number }>(icon)\n ? React.cloneElement(icon, { size: icon.props.size || fallback })\n : icon;\n}\n\nfunction tone(color: CardColor): string {\n return HUE_TONE[color] ?? HUE_TONE.slate;\n}\n\n/** The card's destination: a link when it has a path, else a click target. */\nfunction Destination({\n path,\n onClick,\n external,\n className,\n children,\n}: {\n path?: string | undefined;\n onClick?: (() => void) | undefined;\n external?: boolean | undefined;\n className?: string;\n children: React.ReactNode;\n}) {\n if (path) {\n return (\n <HostLink\n href={path}\n className={className ?? \"block\"}\n {...(onClick ? { onClick } : {})}\n {...(external ? { target: \"_blank\", rel: \"noopener noreferrer\" } : {})}\n >\n {children}\n </HostLink>\n );\n }\n return (\n <div {...(className ? { className } : {})} {...(onClick ? { onClick } : {})}>\n {children}\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* HueCard */\n/* ------------------------------------------------------------------ */\n\nexport interface HueCardProps {\n title: string;\n description?: string;\n descriptionNode?: React.ReactNode;\n icon: SizedIcon;\n color: CardColor;\n path?: string;\n size?: CardSize;\n /** Where the card sits (width, margin, grid span); never how it looks. */\n className?: string;\n onClick?: () => void;\n /** The compact iOS form: a small squircle with the icon and a label, no description. */\n compact?: boolean;\n /** `path` points at a separately hosted app: open it in a new tab. */\n external?: boolean;\n}\n\nconst SIZE_PADDING: Record<CardSize, string> = {\n xs: \"p-3\",\n sm: \"p-4\",\n md: \"p-5\",\n lg: \"p-6\",\n xl: \"p-8\",\n};\n\nexport function HueCard({\n title,\n description,\n descriptionNode,\n icon,\n color,\n path,\n size = \"md\",\n className,\n onClick,\n compact = false,\n external = false,\n}: HueCardProps) {\n if (compact) {\n return (\n <Destination path={path} onClick={onClick} external={external}>\n <div\n data-tone={tone(color)}\n className={cn(\"matrx-hue-card flex cursor-pointer select-none flex-col items-center gap-1.5\", className)}\n >\n <div className=\"matrx-hue-squircle flex aspect-square w-full max-w-[62px] items-center justify-center rounded-[22%] shadow-sm transition-colors\">\n {sizedIcon(icon, 36)}\n </div>\n <span className=\"type-meta w-full truncate px-0.5 text-center font-medium leading-tight text-foreground\">\n {title}\n </span>\n </div>\n </Destination>\n );\n }\n\n return (\n <Destination path={path} onClick={onClick} external={external}>\n <div\n data-tone={tone(color)}\n className={cn(\n \"matrx-hue-card matrx-hue-surface cursor-pointer rounded-xl bg-card shadow-md transition-colors\",\n SIZE_PADDING[size],\n className,\n )}\n >\n <div className=\"flex flex-col items-center space-y-3 text-center\">\n <div className=\"matrx-hue-icon rounded-full p-3\">{sizedIcon(icon, 28)}</div>\n <h3 className=\"text-lg font-semibold\">{title}</h3>\n {description && <p className=\"type-body text-muted-foreground\">{description}</p>}\n {descriptionNode && !description && descriptionNode}\n </div>\n </div>\n </Destination>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* HueGrid */\n/* ------------------------------------------------------------------ */\n\nexport interface HueGridProps {\n title?: string;\n description?: string;\n items: HueCardProps[];\n /** 1 to 6 columns at the widest breakpoint. Default 6. */\n columns?: number;\n className?: string;\n /** Places every card (width, span); never how it looks. */\n cardClassName?: string;\n /** Draw a dashed \"add\" tile after the cards. */\n showAddButton?: boolean;\n onAddButtonClick?: () => void;\n addButtonText?: string;\n /** Compact iOS icons, four to a row. */\n compact?: boolean;\n}\n\nconst GRID_COLUMNS: Record<number, string> = {\n 1: \"grid-cols-1\",\n 2: \"grid-cols-1 sm:grid-cols-2\",\n 3: \"grid-cols-1 sm:grid-cols-2 md:grid-cols-3\",\n 4: \"grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4\",\n 5: \"grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5\",\n 6: \"grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6\",\n};\n\nexport function HueGrid({\n title,\n description,\n items,\n columns = 6,\n className,\n cardClassName,\n showAddButton = false,\n onAddButtonClick,\n addButtonText = \"Add\",\n compact = false,\n}: HueGridProps) {\n const colsClass = compact ? \"grid-cols-4\" : GRID_COLUMNS[Math.min(6, Math.max(1, columns))];\n return (\n <div className={className}>\n {title && <h2 className=\"mb-4 text-base font-semibold\">{title}</h2>}\n {description && <p className=\"type-body mb-4 text-muted-foreground\">{description}</p>}\n <div className={cn(\"grid\", compact ? \"gap-2\" : \"gap-4\", colsClass)}>\n {items.map((item, index) => (\n <HueCard key={`card-${index}`} {...item} compact={compact} className={cn(cardClassName, item.className)} />\n ))}\n {showAddButton && (\n <button\n type=\"button\"\n onClick={onAddButtonClick}\n className={cn(\n \"flex cursor-pointer flex-col items-center justify-center space-y-3 rounded-xl border-2 border-dashed border-border p-5 text-center transition-colors hover:bg-muted\",\n cardClassName,\n )}\n >\n <span className=\"rounded-full bg-muted p-3 text-muted-foreground\">\n <PlusIcon className=\"h-7 w-7\" />\n </span>\n <span className=\"text-lg font-semibold\">{addButtonText}</span>\n </button>\n )}\n </div>\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* HueRow / HueList */\n/* ------------------------------------------------------------------ */\n\nexport interface HueRowProps {\n title: string;\n description?: string;\n descriptionNode?: React.ReactNode;\n icon: SizedIcon;\n color: CardColor;\n path?: string;\n className?: string;\n rightIcon?: React.ReactNode;\n onClick?: () => void;\n showBorder?: boolean;\n isLast?: boolean;\n}\n\nexport function HueRow({\n title,\n description,\n descriptionNode,\n icon,\n color,\n path,\n className,\n rightIcon = <ChevronRightIcon className=\"h-5 w-5 text-muted-foreground\" />,\n onClick,\n showBorder = true,\n isLast = false,\n}: HueRowProps) {\n return (\n <Destination path={path} onClick={onClick}>\n <div\n data-tone={tone(color)}\n className={cn(\n \"matrx-hue-card matrx-hue-surface flex cursor-pointer items-center justify-between rounded-lg p-4 transition-colors\",\n !isLast && showBorder && \"border-b border-border\",\n className,\n )}\n >\n <div className=\"flex items-center\">\n <div className=\"matrx-hue-icon mr-4 rounded-lg p-2\">{sizedIcon(icon, 20)}</div>\n <div>\n <h3 className=\"font-medium\">{title}</h3>\n {description && <p className=\"type-body text-muted-foreground\">{description}</p>}\n {descriptionNode && !description && descriptionNode}\n </div>\n </div>\n {rightIcon}\n </div>\n </Destination>\n );\n}\n\nexport interface HueListProps {\n title?: string;\n description?: string;\n items: HueRowProps[];\n className?: string;\n /** Places every row; never how it looks. */\n cardClassName?: string;\n showBorders?: boolean;\n /** Wrap the rows in the raised rounded container. Default true. */\n showContainer?: boolean;\n}\n\nexport function HueList({\n title,\n description,\n items,\n className,\n cardClassName,\n showBorders = true,\n showContainer = true,\n}: HueListProps) {\n const rows = items.map((item, index) => (\n <HueRow\n key={`row-${index}`}\n {...item}\n isLast={index === items.length - 1}\n showBorder={showBorders}\n className={cn(cardClassName, item.className)}\n />\n ));\n return (\n <div className={className}>\n {title && <h2 className=\"mb-4 text-base font-semibold\">{title}</h2>}\n {description && <p className=\"type-body mb-4 text-muted-foreground\">{description}</p>}\n {showContainer ? <div className=\"rounded-xl bg-card shadow-md\">{rows}</div> : rows}\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* IosWidget */\n/* ------------------------------------------------------------------ */\n\nexport interface IosWidgetProps {\n title: string;\n description?: string;\n icon: SizedIcon;\n color: CardColor;\n path?: string;\n badge?: string;\n className?: string;\n onClick?: () => void;\n}\n\n/** The iOS 2x2 widget: occupies the grid area its parent gives it; a hue gradient, a large icon, title, brief text. */\nexport function IosWidget({ title, description, icon, color, path, badge, className, onClick }: IosWidgetProps) {\n return (\n <Destination path={path} onClick={onClick} className=\"contents\">\n <div\n data-tone={tone(color)}\n className={cn(\n \"matrx-hue-card matrx-hue-squircle flex h-full w-full cursor-pointer select-none flex-col justify-between rounded-[20px] p-3 shadow-md transition-[filter] active:brightness-90\",\n className,\n )}\n >\n <div className=\"flex items-start justify-between\">\n <div>{sizedIcon(icon, 32)}</div>\n {badge && (\n <span className=\"type-meta rounded-full bg-black/25 px-2 py-0.5 font-semibold leading-tight\">{badge}</span>\n )}\n </div>\n <div>\n <p className=\"type-title line-clamp-2 leading-tight\">{title}</p>\n {description && <p className=\"type-meta mt-0.5 line-clamp-2 leading-tight\">{description}</p>}\n </div>\n </div>\n </Destination>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* TileCard / TileCardGrid */\n/* ------------------------------------------------------------------ */\n\nexport interface TileCardProps {\n icon?: React.ReactNode;\n title?: React.ReactNode;\n description?: React.ReactNode;\n onClick?: () => void;\n href?: string;\n /** Places the tile (width, height); never how it looks. */\n className?: string;\n}\n\n/** A tall, plain tile: a primary-ink icon and title over a muted description; the border takes the brand on hover. */\nexport function TileCard({ icon, title, description, onClick, href, className }: TileCardProps) {\n const face = cn(\n \"flex h-64 cursor-pointer flex-col items-center justify-center space-y-6 rounded-xl border-2 border-border bg-muted p-4 text-xl transition-colors hover:border-primary hover:bg-accent\",\n className,\n );\n const content = (\n <>\n {icon && <div className=\"h-12 w-12 text-primary-ink\">{icon}</div>}\n {title && <span className=\"font-medium text-primary-ink\">{title}</span>}\n {description && <p className=\"type-secondary mt-1 text-center text-muted-foreground\">{description}</p>}\n </>\n );\n return href ? (\n <HostLink href={href} className={face}>\n {content}\n </HostLink>\n ) : (\n <div onClick={onClick} className={face}>\n {content}\n </div>\n );\n}\n\nexport interface TileCardGridProps {\n title?: React.ReactNode;\n description?: React.ReactNode;\n cards: TileCardProps[];\n /** 1 to 4 columns from the md breakpoint. Default 2. */\n columns?: 1 | 2 | 3 | 4;\n className?: string;\n}\n\nconst TILE_COLUMNS = { 1: \"md:grid-cols-1\", 2: \"md:grid-cols-2\", 3: \"md:grid-cols-3\", 4: \"md:grid-cols-4\" } as const;\n\nexport function TileCardGrid({ title, description, cards, columns = 2, className }: TileCardGridProps) {\n return (\n <div className={cn(\"w-full\", className)}>\n {(title || description) && (\n <div className=\"pb-8 text-center\">\n {title && <h2 className=\"text-2xl font-bold text-foreground md:text-3xl\">{title}</h2>}\n {description && <p className=\"mt-2 text-muted-foreground\">{description}</p>}\n </div>\n )}\n <div className={cn(\"grid grid-cols-1 gap-6\", TILE_COLUMNS[columns] ?? TILE_COLUMNS[2])}>\n {cards.map((card, index) => (\n <TileCard key={index} {...card} />\n ))}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A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","Textarea","import_react_slot","React","React","import_jsx_runtime","React","import_jsx_runtime","React","import_jsx_runtime","React","React","import_jsx_runtime","import_jsx_runtime","tone","import_class_variance_authority","React","import_jsx_runtime","React","React","import_jsx_runtime","import_jsx_runtime","Button","tone","Select","Textarea","React","import_jsx_runtime","React","import_jsx_runtime","Button","import_dates","React","import_vaul","React","import_react_slot","React","import_jsx_runtime","React","import_jsx_runtime","CONTEXT_SLOT","contextRegistry","import_jsx_runtime","DrawerPrimitive","import_jsx_runtime","DrawerPrimitive","React","import_jsx_runtime","v","import_jsx_runtime","emit","days","SelectPrimitive","React","import_jsx_runtime","SelectTrigger","import_react_slot","React","import_react_tree","React","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","tone","Button","import_react","import_jsx_runtime","React","import_jsx_runtime","import_jsx_runtime","state","step","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","DialogPrimitive","React","React","import_jsx_runtime","import_jsx_runtime","CommandPrimitive","CommandPrimitive","CommandPrimitive","import_jsx_runtime","import_jsx_runtime","import_react","React","import_jsx_runtime","import_jsx_runtime","Button","Icon","import_jsx_runtime","Icon","import_jsx_runtime","import_jsx_runtime","TONE","tone","Icon","Button","React","import_jsx_runtime","import_react","import_jsx_runtime","Button","import_react","React","import_jsx_runtime","import_jsx_runtime","Button","import_react","import_jsx_runtime","import_jsx_runtime","tone","Icon","React","import_jsx_runtime","import_jsx_runtime","Button","React","import_jsx_runtime","registry","ErrorBox","React","import_jsx_runtime","Label","import_jsx_runtime","Label","React","import_jsx_runtime","useState","useLayoutEffect","useRef","React","text","Button","import_clipboard","import_notify","import_clipboard_fallback_opener","React","import_jsx_runtime","Button","React","import_jsx_runtime","HostLink","import_jsx_runtime","import_jsx_runtime","tone","React","import_jsx_runtime","Button","import_react","import_jsx_runtime","Icon","React","import_jsx_runtime","Icon","Button","React","import_jsx_runtime","React","import_jsx_runtime","React","import_jsx_runtime","React","import_jsx_runtime","React","import_jsx_runtime","IconSelectTrigger","Button","React","import_clipboard","import_clipboard_fallback_opener","import_notify","React","import_jsx_runtime","CollapsibleTrigger","CollapsibleContent","DialogPrimitive","VisuallyHidden","import_react_tree","React","React","import_jsx_runtime","CONTEXT_SLOT","registry","import_react","clamp","swallowClick","import_jsx_runtime","CONTEXT_SLOT","contextRegistry","DIALOG_DESKTOP_CLASSES","DIALOG_MOBILE_SHEET_CLASSES","DIALOG_MOBILE_SHEET_OVERRIDE","import_jsx_runtime","Icon","tooltipSide","Button","import_jsx_runtime","CollapsibleTrigger","CollapsibleContent","import_jsx_runtime","TONE","Icon","tone","Button","React","import_jsx_runtime"]}