@ai-matrx/design-system 0.86.333 → 0.86.335

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 (69) hide show
  1. package/CHANGELOG.md +42 -62
  2. package/dist/carousel.cjs.map +1 -1
  3. package/dist/carousel.js +4 -4
  4. package/dist/{chunk-NNETFHGX.js → chunk-4CO5STZU.js} +18 -4
  5. package/dist/chunk-4CO5STZU.js.map +1 -0
  6. package/dist/{chunk-MFUNGDHO.js → chunk-B24DLFWR.js} +2 -2
  7. package/dist/{chunk-CSSD6NS4.js → chunk-DQUCOMAC.js} +2 -2
  8. package/dist/{chunk-6YZMGSQY.js → chunk-M34WPTPX.js} +2 -2
  9. package/dist/{chunk-VV6WZTH5.js → chunk-PBDQZPKV.js} +2 -2
  10. package/dist/{chunk-E4GS5QH7.js → chunk-Q2HWDJED.js} +2 -2
  11. package/dist/{chunk-ZOQ2XKXF.js → chunk-QOEKPR37.js} +5 -5
  12. package/dist/chunk-QOEKPR37.js.map +1 -0
  13. package/dist/{chunk-MEJVHDYJ.js → chunk-RGJPHRU3.js} +2 -2
  14. package/dist/{chunk-7NEVJKDZ.js → chunk-SUVIHUAD.js} +3 -3
  15. package/dist/{chunk-3MQMVPKO.js → chunk-VQ3G6AFN.js} +4 -4
  16. package/dist/clipboard-fallback-dialog.cjs.map +1 -1
  17. package/dist/clipboard-fallback-dialog.js +1 -1
  18. package/dist/controls.cjs +4 -4
  19. package/dist/controls.cjs.map +1 -1
  20. package/dist/controls.css +6 -0
  21. package/dist/controls.js +4 -4
  22. package/dist/data-table/data-row-inspector.cjs.map +1 -1
  23. package/dist/data-table/data-row-inspector.js +4 -4
  24. package/dist/data-table/data-row-window.cjs.map +1 -1
  25. package/dist/data-table/data-row-window.js +5 -5
  26. package/dist/data-table/index.cjs +4 -4
  27. package/dist/data-table/index.cjs.map +1 -1
  28. package/dist/data-table/index.js +7 -7
  29. package/dist/data-table/pagination.cjs +4 -4
  30. package/dist/data-table/pagination.cjs.map +1 -1
  31. package/dist/data-table/pagination.js +2 -2
  32. package/dist/data-table/uuid-cell.cjs.map +1 -1
  33. package/dist/data-table/uuid-cell.js +2 -2
  34. package/dist/desktop.cjs.map +1 -1
  35. package/dist/desktop.js +3 -3
  36. package/dist/index.cjs +574 -385
  37. package/dist/index.cjs.map +1 -1
  38. package/dist/index.d.cts +115 -3
  39. package/dist/index.d.ts +115 -3
  40. package/dist/index.js +437 -268
  41. package/dist/index.js.map +1 -1
  42. package/dist/item.cjs +33 -17
  43. package/dist/item.cjs.map +1 -1
  44. package/dist/item.d.cts +7 -1
  45. package/dist/item.d.ts +7 -1
  46. package/dist/item.js +19 -17
  47. package/dist/item.js.map +1 -1
  48. package/dist/lite-table.cjs.map +1 -1
  49. package/dist/lite-table.js +1 -1
  50. package/dist/record-list.cjs +16 -2
  51. package/dist/record-list.cjs.map +1 -1
  52. package/dist/record-list.d.cts +7 -1
  53. package/dist/record-list.d.ts +7 -1
  54. package/dist/record-list.js +2 -2
  55. package/dist/settings.cjs.map +1 -1
  56. package/dist/settings.js +2 -2
  57. package/dist/writing-field.cjs.map +1 -1
  58. package/dist/writing-field.js +2 -2
  59. package/package.json +2 -2
  60. package/dist/chunk-NNETFHGX.js.map +0 -1
  61. package/dist/chunk-ZOQ2XKXF.js.map +0 -1
  62. /package/dist/{chunk-MFUNGDHO.js.map → chunk-B24DLFWR.js.map} +0 -0
  63. /package/dist/{chunk-CSSD6NS4.js.map → chunk-DQUCOMAC.js.map} +0 -0
  64. /package/dist/{chunk-6YZMGSQY.js.map → chunk-M34WPTPX.js.map} +0 -0
  65. /package/dist/{chunk-VV6WZTH5.js.map → chunk-PBDQZPKV.js.map} +0 -0
  66. /package/dist/{chunk-E4GS5QH7.js.map → chunk-Q2HWDJED.js.map} +0 -0
  67. /package/dist/{chunk-MEJVHDYJ.js.map → chunk-RGJPHRU3.js.map} +0 -0
  68. /package/dist/{chunk-7NEVJKDZ.js.map → chunk-SUVIHUAD.js.map} +0 -0
  69. /package/dist/{chunk-3MQMVPKO.js.map → chunk-VQ3G6AFN.js.map} +0 -0
@@ -20,7 +20,7 @@ import {
20
20
  AlertDialogHeader,
21
21
  AlertDialogTitle,
22
22
  Tile
23
- } from "./chunk-MFUNGDHO.js";
23
+ } from "./chunk-B24DLFWR.js";
24
24
  import "./chunk-DRSBLHOF.js";
25
25
  import {
26
26
  Dialog,
@@ -48,7 +48,7 @@ import {
48
48
  import {
49
49
  Field,
50
50
  Textarea
51
- } from "./chunk-ZOQ2XKXF.js";
51
+ } from "./chunk-QOEKPR37.js";
52
52
  import "./chunk-BD77DHUO.js";
53
53
  import "./chunk-BKCJUFD3.js";
54
54
  import "./chunk-PIQJULQB.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-matrx/design-system",
3
- "version": "0.86.333",
3
+ "version": "0.86.335",
4
4
  "description": "AI Matrx semantic React primitives shared across Vite, Next.js, desktop, and customer-built applications.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -776,5 +776,5 @@
776
776
  ],
777
777
  "layer": 2
778
778
  },
779
- "gitHead": "91557e5a859c37837fb92f40a4f42f5cb74e5945"
779
+ "gitHead": "dcbf369af427e153be6a29c260a35c898dc705c5"
780
780
  }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/item/types.ts","../src/item/host.tsx","../src/item/run-entry.ts","../src/item/ItemMenu.tsx","../src/item/ItemMenuDrawer.tsx","../src/item/ItemRow.tsx"],"sourcesContent":["/**\n * Item system — shared schema + prop types for ItemRow and ItemMenu.\n * Moved whole from @ai-matrx/chat/ui/item-types (2026-10-08); chat re-exports\n * these and narrows the surface fields to its closed registries.\n *\n * Pure types (no JSX). The menu config is a structured `sections` array with a\n * discriminated union of entries (`kind`), so ordering is explicit, section\n * labels are first-class, separators fall out of section boundaries, and\n * submenus nest naturally.\n *\n * Consumed by ItemMenu.tsx, ItemMenuDrawer.tsx, ItemRow.tsx.\n */\n\nimport type { ComponentType, ReactNode } from \"react\";\n\n/** Any icon component taking a className (lucide-react icons fit as-is). */\nexport type ItemMenuIcon = ComponentType<{ className?: string | undefined }>;\n\n/**\n * The record a row stands for, as the host's right-click menu reads it.\n * Structural on purpose: design-system knows no entity registry. A host\n * (chat) narrows it to its own `ContextMenuEntityRef`.\n */\nexport interface ItemEntityRef {\n type?: string | undefined;\n id?: string | undefined;\n title?: string | undefined;\n}\n\n// ── Menu entries ────────────────────────────────────────────────────────────\n\ninterface ItemMenuEntryBase {\n /** Stable identity within the menu. React key + shortcut/debug target. */\n id: string;\n label: string;\n icon?: ItemMenuIcon | undefined;\n /**\n * Semantic color class for the icon ONLY (e.g. \"text-amber-500\" for a pin).\n * Destructive entries use `tone: \"destructive\"`, never an iconClassName.\n */\n iconClassName?: string | undefined;\n /**\n * Hover text for the entry — never a second line (Arman, 2026-10-14: no\n * \"novels\" in menus). A menu is a list of verbs; the only second line an\n * entry draws is its `disabledReason`.\n */\n description?: string | undefined;\n /**\n * Short trailing chip, right-aligned on the same line (\"Coming soon\", \"Beta\",\n * \"Pro\"). This is the RIGHT way to qualify an entry — it costs no height,\n * unlike `description`. One or two words; it is a tag, not a sentence.\n */\n badge?: string | undefined;\n /** Omit the entry entirely. Builders compute this at config-build time. */\n hidden?: boolean | undefined;\n disabled?: boolean | undefined;\n /** Why it's disabled — rendered inline (muted) and as a `title` tooltip. */\n disabledReason?: string | undefined;\n}\n\n/** Visual + semantic severity. Destructive renders text/icon in text-destructive. */\nexport type ItemMenuTone = \"default\" | \"destructive\";\n\nexport interface ItemMenuToast {\n loading: string;\n success: string;\n /** Static message, or derive one from the thrown error. */\n error?: (string | ((error: unknown) => string)) | undefined;\n}\n\n/** A plain action. The default entry kind. */\nexport interface ItemMenuCommand extends ItemMenuEntryBase {\n kind?: \"command\" | undefined;\n tone?: ItemMenuTone | undefined;\n /**\n * Runs synchronously in the select handler (preserves the user-gesture\n * context required by clipboard writes), then the menu closes. If it\n * returns a Promise AND `toast` is set, the promise is handed to\n * sonner's `toast.promise`. If it returns a Promise WITHOUT `toast`, it's\n * fire-and-forget (the action owns its own optimistic update + feedback —\n * the conversation-thunk pattern). Void → nothing.\n */\n onSelect: () => void | Promise<void>;\n toast?: ItemMenuToast | undefined;\n /** Display-only shortcut hint, right-aligned (\"⌘D\", \"R\"). Desktop only. */\n shortcut?: string | undefined;\n /**\n * Single character that activates this entry while the menu is open\n * (Claude Code style: P/R/A/D). Case-insensitive, no modifiers.\n */\n shortcutKey?: string | undefined;\n /**\n * Declarative hook for host components. ItemRow intercepts `\"rename\"` and\n * starts its inline rename INSTEAD of running `onSelect`. Standalone\n * ItemMenu ignores intent and runs `onSelect` (keep a dialog fallback\n * there for non-row surfaces).\n */\n intent?: \"rename\" | undefined;\n}\n\n/**\n * A persistent on/off toggle (Radix CheckboxItem desktop, check glyph in the\n * drawer). Selecting it does NOT close the menu — it's a view option.\n *\n * RESERVED for genuine view options (\"Show timestamps\", \"Compact rows\").\n * State-FLIP actions (Pin/Unpin, Archive/Unarchive) stay plain `command`s\n * whose label+icon the builder swaps from current state.\n */\nexport interface ItemMenuCheckbox extends ItemMenuEntryBase {\n kind: \"checkbox\";\n checked: boolean;\n /** Should be optimistic. Failures are the caller's to toast + revert. */\n onCheckedChange: (next: boolean) => void | Promise<void>;\n shortcut?: string | undefined;\n shortcutKey?: string | undefined;\n}\n\n/** A real <a>. Gives middle-click / cmd-click semantics inside the menu. */\nexport interface ItemMenuLink extends ItemMenuEntryBase {\n kind: \"link\";\n href: string;\n /** \"_blank\" adds rel=\"noopener noreferrer\" automatically. */\n target?: \"_blank\" | undefined;\n}\n\n/** Nested submenu — Radix Sub on desktop, drill-in view on the drawer. */\nexport interface ItemMenuSubmenu extends ItemMenuEntryBase {\n kind: \"submenu\";\n /** Submenu body. Sections render with separators between them. */\n sections: ItemMenuSection[];\n /** Embed an existing canonical menu without duplicating its commands. */\n renderContent?: ((onClose: () => void) => ReactNode) | undefined;\n}\n\nexport type ItemMenuEntry =\n ItemMenuCommand | ItemMenuCheckbox | ItemMenuLink | ItemMenuSubmenu;\n\n// ── Sections + config ───────────────────────────────────────────────────────\n\nexport interface ItemMenuSection {\n /** React key. Defaults to `label` ?? index. Provide when label is absent. */\n id?: string | undefined;\n /** Optional muted heading (\"Manage\", \"Danger\"). */\n label?: string | undefined;\n items: ItemMenuEntry[];\n}\n\nexport interface ItemMenuHeader {\n /** e.g. the row title. The drawer renders it as DrawerTitle. */\n title: string;\n description?: string | undefined;\n}\n\nexport interface ItemMenuConfig {\n /** Optional header. Desktop renders a muted label row; drawer a real header. */\n header?: ItemMenuHeader | undefined;\n /** Separators are derived from section boundaries — never declared. */\n sections: ItemMenuSection[];\n}\n\n/**\n * Lazy form: invoked when the menu opens, so big lists don't build N configs\n * per render. Either form is accepted anywhere a config is.\n */\nexport type ItemMenuConfigInput = ItemMenuConfig | (() => ItemMenuConfig);\n\n// ── ItemMenu component props ────────────────────────────────────────────────\n\nexport interface ItemMenuProps {\n config: ItemMenuConfigInput;\n /** The trigger element — rendered via Radix `asChild` (must accept a ref). */\n children: ReactNode;\n /** Dropdown alignment relative to trigger. Default \"end\". */\n align?: \"start\" | \"center\" | \"end\" | undefined;\n side?: \"top\" | \"right\" | \"bottom\" | \"left\" | undefined;\n /**\n * Controlled open state. Pass when a surface opens the menu from outside the\n * trigger (e.g. whole-row click opens the same kebab menu). Omit for the\n * default uncontrolled trigger-driven behavior.\n */\n open?: boolean | undefined;\n /** Observe / drive open state (e.g. ItemRow pins the kebab visible while open). */\n onOpenChange?: ((open: boolean) => void) | undefined;\n /**\n * Radix `onCloseAutoFocus` passthrough. ItemRow uses it to move focus into\n * the rename input instead of back to the kebab. Desktop only.\n */\n onCloseAutoFocus?: ((event: Event) => void) | undefined;\n /** Min width of the dropdown content. Default \"12rem\". */\n contentMinWidth?: string | undefined;\n /** Force presentation. Default: useIsMobile(). For demos/tests. */\n presentation?: \"auto\" | \"dropdown\" | \"drawer\" | undefined;\n}\n\n/**\n * What the row IS, forwarded to the v3 context menu.\n *\n * This is the slot that was dark. `entity` gates **Attach To** and **Share**\n * inside `MenuContent`; `ItemContextMenu` never passed one, so every consumer\n * of the item system was denied both — not because the capability was missing,\n * but because the wrapper dropped it on the floor. `sourceFeature` was worse\n * than absent: it was hardcoded `\"files\"` for every caller, so a note row's\n * agent launches were attributed to the files feature.\n */\nexport interface ItemMenuSurface {\n /**\n * REQUIRED. v3 attributes every shortcut and agent launched from this menu\n * to it, and the type is a closed registry — there is deliberately no\n * generic member to hide behind.\n */\n sourceFeature: string;\n /** Registry surface name, when the row's surface has one (AI actions, bound agents). */\n surfaceName?: string | undefined;\n /**\n * The record itself. Present → Attach To. With `resourceType` → Share too.\n * Omit only when the row does not correspond to a registered entity.\n */\n entity?: ItemEntityRef | undefined;\n}\n\nexport interface ItemContextMenuProps extends ItemMenuSurface {\n config: ItemMenuConfigInput;\n /** The right-clickable surface (usually the whole row). */\n children: ReactNode;\n onOpenChange?: ((open: boolean) => void) | undefined;\n onCloseAutoFocus?: ((event: Event) => void) | undefined;\n /**\n * When false, children render bare (no Radix root). ItemRow passes `false`\n * on touch so long-press doesn't fight scroll + the always-visible kebab.\n */\n enabled?: boolean | undefined;\n /**\n * Live surface values for the universal menu. A delegated pane menu uses\n * the same scope builder as its SurfaceRuntimeProvider, so AI actions never\n * lose the values the surface declares.\n */\n getApplicationScope?: (() => unknown) | undefined;\n /**\n * ONE-MENU-PER-PANE delegation. Resolve the clicked row's existing kebab\n * config and per-row context from the event target at open time.\n */\n resolveItemOnOpen?: (target: HTMLElement | null) => {\n config: ItemMenuConfigInput;\n context?: unknown | undefined;\n } | null;\n}\n\n// ── ItemRow props ───────────────────────────────────────────────────────────\n\nexport interface ItemRowRename {\n /** Text being renamed. Defaults to `label`. */\n value?: string | undefined;\n onCommit: (next: string) => void | Promise<void>;\n validate?: ((next: string) => string | null) | undefined;\n emptyFallback?: string | undefined;\n maxLength?: number | undefined;\n /** Allow double-click on the row to start renaming. Default true. */\n doubleClick?: boolean | undefined;\n}\n\nexport interface ItemRowDisclosure {\n /** Whether the sub-list is showing (sets `aria-expanded`). */\n open: boolean;\n onToggle: () => void;\n /** Screen-reader name; absent = \"Expand <label>\" / \"Collapse <label>\". */\n ariaLabel?: string | undefined;\n}\n\nexport type ItemRowSize = \"xs\" | \"sm\" | \"md\" | \"lg\"; // h-6 nested sub-row (muted) / h-7 / h-8 (default) / h-10\n\nexport interface ItemRowProps extends ItemMenuSurface {\n label: string;\n /** Muted, never masked; sits between label and trailing indicators. */\n secondaryLabel?: string | undefined;\n /**\n * The most room the secondary label may take before it truncates (the label keeps the rest).\n * \"half\" (default) or \"third\" — for a secondary that only explains the row (a search reason).\n */\n secondaryShare?: \"half\" | \"third\" | undefined;\n /**\n * A second line under the label (a record's owner, path or snippet). The row\n * grows to two lines; the label keeps its fade, the subtitle is cut with an ellipsis.\n */\n subtitle?: ReactNode;\n /**\n * Controls at the row's trailing edge, OUTSIDE the row's link/button (so a\n * button here is never nested in the row's own control). With `actions`, the\n * kebab sits in the same group instead of floating over the label.\n */\n actions?: ReactNode;\n /** A control before the row's link/button (a selection checkbox), outside it. */\n leadingControl?: ReactNode;\n /**\n * The row folds a sub-list (a conversation's helpers, a folder's children). THE DISCLOSURE IS ON\n * THE RIGHT (Arman, 2026-10-23: \"CHEVRONS DO NOT GO ON THE LEFT SIDE of things\"): a chevron button\n * at the row's trailing edge, outside the row's link, after the trailing indicators; the label\n * keeps the column's one left edge. Never draw a chevron in `leading`.\n */\n disclosure?: ItemRowDisclosure | undefined;\n /**\n * Keep the disclosure's trailing room even with no `disclosure` — pass it on the plain rows that\n * sit among disclosure rows so every row's trailing meta (time) ends on one right edge.\n */\n reserveDisclosure?: boolean | undefined;\n /** Icon / status-dot slot. Fixed-width content recommended (size-4). */\n leading?: ReactNode;\n /**\n * Indicator slot (star, streaming dot). Sits at the right edge at rest and\n * glides LEFT (translate) when the kebab is revealed. Never masked.\n */\n trailing?: ReactNode;\n active?: boolean | undefined;\n disabled?: boolean | undefined;\n /** Navigation mode — renders next/link as the row's primary element. */\n href?: string | undefined;\n /** Click mode — renders a <button> primary. Ignored while renaming. */\n onOpen?: (() => void) | undefined;\n /**\n * Only meaningful alongside `href`. By default a plain click navigates to\n * `href` and `onOpen` runs as a side effect (close a popover, etc.). When\n * `true`, a plain left-click instead calls `onOpen` and PREVENTS navigation —\n * for self-contained surfaces (drawers, embedded panels) that open the target\n * in place rather than routing the page away. The `href` is kept so\n * modifier/middle-click still opens it in a new tab and \"Copy link\" still\n * works. Default false.\n */\n openInPlace?: boolean | undefined;\n /** Kebab + right-click menu. Omit for menu-less rows. */\n menu?: ItemMenuConfigInput | undefined;\n /**\n * `sourceFeature` / `surfaceName` / `entity` (inherited from\n * `ItemMenuSurface`) are forwarded to the right-click menu. **Pass `entity`**\n * — it is what turns Attach To and Share on, and every row that omits it\n * ships a menu missing two doors the platform already has.\n */\n /** Inline rename. Enables double-click + the `intent: \"rename\"` contract. */\n rename?: ItemRowRename | undefined;\n size?: ItemRowSize | undefined; // default \"md\"\n /** Tree depth. padding-inline-start = 8px + indent * 16px. */\n indent?: number | undefined;\n /** Accessible label for the kebab. Default `Options for ${label}`. */\n kebabAriaLabel?: string | undefined;\n /**\n * Suppress ItemRow's own right-click menu (the kebab keeps the config).\n * Set when the host wraps the row in the universal v3 context menu\n * (`features/context-menu-v3`) so right-click belongs to ONE system.\n */\n disableContextMenu?: boolean | undefined;\n className?: string | undefined;\n}\n\n// ── Type guards ─────────────────────────────────────────────────────────────\n\nexport function isCommand(entry: ItemMenuEntry): entry is ItemMenuCommand {\n return entry.kind === undefined || entry.kind === \"command\";\n}\nexport function isCheckbox(entry: ItemMenuEntry): entry is ItemMenuCheckbox {\n return entry.kind === \"checkbox\";\n}\nexport function isLink(entry: ItemMenuEntry): entry is ItemMenuLink {\n return entry.kind === \"link\";\n}\nexport function isSubmenu(entry: ItemMenuEntry): entry is ItemMenuSubmenu {\n return entry.kind === \"submenu\";\n}\n\nexport function resolveItemMenuConfig(\n input: ItemMenuConfigInput,\n): ItemMenuConfig {\n return typeof input === \"function\" ? input() : input;\n}\n","\"use client\";\n\n/**\n * The host seam for the item system (ItemRow / ItemMenu). A host may override\n * it, never NEED to: without a provider the row's right-click opens the same\n * menu config in design-system's own context menu, and a promised command's\n * failure is reported to the console instead of a toast.\n *\n * - `ContextMenu` — the host's universal right-click menu around a row (the\n * website / chat mount the v3 menu here, which adds Copy, agents, Attach To,\n * Share). It receives the full `ItemContextMenuProps`.\n * - `toastPromise` — the host's promise toast (sonner's `toast.promise` shape).\n */\n\nimport * as React from \"react\";\nimport type { ItemContextMenuProps, ItemMenuToast } from \"./types\";\n\nexport interface ItemToastPromise {\n (\n promise: Promise<unknown>,\n messages: { loading: string; success: string; error: (error: unknown) => string },\n ): void;\n}\n\nexport interface ItemMenuHost {\n ContextMenu?: React.ComponentType<ItemContextMenuProps>;\n toastPromise?: ItemToastPromise;\n}\n\nconst HOST_KEY = Symbol.for(\"@ai-matrx/design-system/item-menu-host\");\ntype HostRegistry = Record<symbol, React.Context<ItemMenuHost | null> | undefined>;\nconst hostRegistry = globalThis as unknown as HostRegistry;\nconst ItemMenuHostContext: React.Context<ItemMenuHost | null> =\n hostRegistry[HOST_KEY] ??\n (hostRegistry[HOST_KEY] = React.createContext<ItemMenuHost | null>(null));\n\n/** Mount once at the host's app root. */\nexport function ItemMenuHostProvider({\n host,\n children,\n}: {\n host: ItemMenuHost;\n children: React.ReactNode;\n}) {\n return <ItemMenuHostContext.Provider value={host}>{children}</ItemMenuHostContext.Provider>;\n}\n\nexport function useItemMenuHost(): ItemMenuHost | null {\n return React.useContext(ItemMenuHostContext);\n}\n\nexport type { ItemMenuToast };\n","/**\n * Action dispatch for ItemMenu entries — shared by the kebab/dropdown\n * renderer (ItemMenu.tsx), the drawer, the default right-click menu and any\n * host's right-click converter, so command/toggle semantics (sync-in-gesture\n * execution, promise toast, fire-and-forget promise swallow) can never drift\n * between presentations.\n */\n\nimport type { ItemToastPromise } from \"./host\";\nimport type { ItemMenuCheckbox, ItemMenuCommand } from \"./types\";\n\nexport function runCommand(entry: ItemMenuCommand, toastPromise?: ItemToastPromise) {\n const result = entry.onSelect();\n if (result instanceof Promise) {\n if (entry.toast && toastPromise) {\n const { loading, success, error } = entry.toast;\n toastPromise(result, {\n loading,\n success,\n error: (e) =>\n typeof error === \"function\"\n ? error(e)\n : (error ?? \"Something went wrong\"),\n });\n } else if (entry.toast) {\n // No host toaster: the failure still announces itself.\n result.catch((e) => console.error(`[ItemMenu] \"${entry.label}\" failed`, e));\n } else {\n result.catch(() => {});\n }\n }\n}\n\nexport function runToggle(entry: ItemMenuCheckbox, next: boolean) {\n const result = entry.onCheckedChange(next);\n if (result instanceof Promise) result.catch(() => {});\n}\n","\"use client\";\n\n/**\n * ItemMenu / ItemContextMenu — schema-driven menus rendered three ways from one\n * ItemMenuConfig:\n * - desktop dropdown (kebab trigger) → Radix DropdownMenu, modal={false}\n * - right-click (wraps a surface) → the host's right-click menu\n * (`ItemMenuHostProvider`; the\n * website/chat mount v3), else\n * design-system's ContextMenu\n * - mobile (kebab trigger) → Vaul bottom drawer w/ drill-in\n *\n * No dimming backdrop on the dropdown (modal={false}). Command/toggle\n * execution is shared across ALL presentations via run-entry.ts (sync-in-\n * gesture for clipboard, sonner toast.promise), so semantics cannot drift.\n */\n\nimport { Fragment, useCallback, useEffect, useRef, useState, type PointerEvent as ReactPointerEvent, type ReactNode } from \"react\";\nimport { useScrollFade } from \"../use-scroll-fade\";\nimport { ChevronDownIcon as ChevronDown } from \"../icons\";\nimport { ALCHEMY_GLYPH_PATHS } from \"../content-transfer/icon\";\nimport { declareLazyDataProps, useMatrxTableRowAlchemy, useMatrxTableRowControls } from \"../table-host/host\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cn } from \"../cn\";\nimport { useIsMobile } from \"@ai-matrx/kit/media-query\";\nimport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n DropdownMenuSeparator,\n DropdownMenuLabel,\n DropdownMenuShortcut,\n} from \"../dropdown-menu\";\nimport {\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuSub,\n ContextMenuSubTrigger,\n ContextMenuSubContent,\n ContextMenuSeparator,\n ContextMenuLabel,\n ContextMenuShortcut,\n} from \"../context-menu\";\nimport { ItemMenuDrawer } from \"./ItemMenuDrawer\";\nimport { useItemMenuHost } from \"./host\";\nimport { runCommand, runToggle } from \"./run-entry\";\nimport {\n isCheckbox,\n isCommand,\n isLink,\n isSubmenu,\n resolveItemMenuConfig,\n type ItemContextMenuProps,\n type ItemMenuConfig,\n type ItemMenuEntry,\n type ItemMenuProps,\n type ItemMenuSection,\n} from \"./types\";\nimport type { ItemToastPromise } from \"./host\";\n\n// ── Radix family adapter ────────────────────────────────────────────────────\n// One renderer, two component sets. Force z-[9999] on context content so menus\n// opened inside floating WindowPanels (z >= 1000) layer above the window.\n\ninterface MenuFamily {\n Item: React.ComponentType<{\n disabled?: boolean | undefined;\n onSelect?: ((event: Event) => void) | undefined;\n className?: string | undefined;\n asChild?: boolean | undefined;\n children?: ReactNode;\n }>;\n CheckboxItem: React.ComponentType<{\n checked?: boolean | undefined;\n disabled?: boolean | undefined;\n onSelect?: ((event: Event) => void) | undefined;\n onCheckedChange?: ((checked: boolean) => void) | undefined;\n className?: string | undefined;\n children?: ReactNode;\n }>;\n Sub: React.ComponentType<{ children?: ReactNode }>;\n SubTrigger: React.ComponentType<{\n onPointerLeave?: ((event: ReactPointerEvent<HTMLElement>) => void) | undefined;\n disabled?: boolean | undefined;\n className?: string | undefined;\n children?: ReactNode;\n }>;\n SubContent: React.ComponentType<{ className?: string | undefined; children?: ReactNode; onFocusOutside?: (event: CustomEvent<{ originalEvent: FocusEvent }>) => void; onPointerDownOutside?: (event: CustomEvent<{ originalEvent: PointerEvent }>) => void }>;\n Separator: React.ComponentType<{ className?: string }>;\n Label: React.ComponentType<{ className?: string; children?: ReactNode }>;\n Shortcut: React.ComponentType<{ className?: string; children?: ReactNode }>;\n}\n\nconst dropdownFamily = {\n Item: DropdownMenuItem,\n CheckboxItem: DropdownMenuCheckboxItem,\n Sub: DropdownMenuSub,\n SubTrigger: DropdownMenuSubTrigger,\n SubContent: DropdownMenuSubContent,\n Separator: DropdownMenuSeparator,\n Label: DropdownMenuLabel,\n Shortcut: DropdownMenuShortcut,\n} as unknown as MenuFamily;\n\nconst contextFamily = {\n Item: ContextMenuItem,\n CheckboxItem: ContextMenuCheckboxItem,\n Sub: ContextMenuSub,\n SubTrigger: ContextMenuSubTrigger,\n SubContent: ContextMenuSubContent as MenuFamily[\"SubContent\"],\n Separator: ContextMenuSeparator,\n Label: ContextMenuLabel,\n Shortcut: ContextMenuShortcut,\n} as unknown as MenuFamily;\n\nconst DESTRUCTIVE_ITEM_CLASS =\n \"text-destructive-ink focus:bg-destructive/10 focus:text-destructive-ink [&_svg]:text-destructive-ink\";\n\n// ── Action dispatch — shared with any host right-click converter ────────────\n// Lives in run-entry.ts so toast.promise / fire-and-forget semantics cannot\n// drift between the kebab dropdown and the universal right-click menu.\n\n// ── Shared leaf content ─────────────────────────────────────────────────────\n\nfunction EntryInner({\n entry,\n Shortcut,\n showShortcut = true,\n}: {\n entry: ItemMenuEntry;\n Shortcut: MenuFamily[\"Shortcut\"];\n showShortcut?: boolean;\n}) {\n const Icon = entry.icon;\n const destructive = isCommand(entry) && entry.tone === \"destructive\";\n const shortcutText =\n isCommand(entry) || isCheckbox(entry)\n ? (entry.shortcut ?? entry.shortcutKey?.toUpperCase())\n : undefined;\n // The only second line an entry draws is why it is disabled; `description`\n // is hover text (Arman, 2026-10-14: no \"novels\" in menus).\n const secondLine = entry.disabled && entry.disabledReason ? entry.disabledReason : undefined;\n\n return (\n <>\n {Icon && (\n <Icon\n className={cn(\n \"h-4 w-4 shrink-0\",\n destructive\n ? \"text-destructive\"\n : (entry.iconClassName ?? \"text-muted-foreground\"),\n )}\n />\n )}\n <span className=\"flex min-w-0 flex-1 flex-col\">\n <span className=\"truncate\" title={entry.description}>{entry.label}</span>\n {secondLine && (\n <span className=\"truncate type-secondary text-muted-foreground\">\n {secondLine}\n </span>\n )}\n </span>\n {entry.badge && (\n <span className=\"ml-2 shrink-0 rounded border border-border px-1.5 py-px type-meta font-medium uppercase tracking-wide text-muted-foreground\">\n {entry.badge}\n </span>\n )}\n {showShortcut && shortcutText && <Shortcut>{shortcutText}</Shortcut>}\n </>\n );\n}\n\n// ── Recursive section renderer (desktop dropdown + context) ─────────────────\n\nfunction MenuSections({\n family,\n sections,\n onCloseRequest,\n}: {\n family: MenuFamily;\n sections: ItemMenuSection[];\n /** Closes the menu (used by link clicks; commands close via Radix default). */\n onCloseRequest: () => void;\n}) {\n const visibleSections = sections\n .map((s) => ({ ...s, items: s.items.filter((e) => !e.hidden) }))\n .filter((s) => s.items.length > 0);\n\n return (\n <>\n {visibleSections.map((section, sIdx) => (\n <Fragment key={section.id ?? section.label ?? sIdx}>\n {sIdx > 0 && <family.Separator />}\n {section.label && (\n <family.Label className=\"text-xs font-medium uppercase tracking-wide text-muted-foreground\">\n {section.label}\n </family.Label>\n )}\n {section.items.map((entry) => (\n <MenuLeaf\n key={entry.id}\n family={family}\n entry={entry}\n onCloseRequest={onCloseRequest}\n />\n ))}\n </Fragment>\n ))}\n </>\n );\n}\n\nfunction keepCanonicalPaletteInteraction(event: CustomEvent<{ originalEvent: Event }>) {\n const target = event.detail.originalEvent.target;\n if (target instanceof Element && target.closest(\"[data-canonical-alchemy-submenu]\")) event.preventDefault();\n}\n\nfunction MenuLeaf({\n family,\n entry,\n onCloseRequest,\n}: {\n family: MenuFamily;\n entry: ItemMenuEntry;\n onCloseRequest: () => void;\n}) {\n const toastPromise = useItemMenuHost()?.toastPromise;\n if (isSubmenu(entry)) {\n return (\n <family.Sub>\n <family.SubTrigger disabled={entry.disabled} className=\"gap-2\" onPointerLeave={(event) => {\n if (entry.renderContent && event.relatedTarget instanceof Element && event.relatedTarget.closest(\"[data-canonical-alchemy-submenu]\")) event.preventDefault();\n }}>\n <EntryInner\n entry={entry}\n Shortcut={family.Shortcut}\n showShortcut={false}\n />\n </family.SubTrigger>\n <family.SubContent onFocusOutside={keepCanonicalPaletteInteraction} onPointerDownOutside={keepCanonicalPaletteInteraction} className={entry.renderContent ? \"p-0 [--radix-popover-content-available-height:var(--radix-dropdown-menu-content-available-height)]\" : undefined}>\n {entry.renderContent ? entry.renderContent(onCloseRequest) : <MenuSections\n family={family}\n sections={entry.sections}\n onCloseRequest={onCloseRequest}\n />}\n </family.SubContent>\n </family.Sub>\n );\n }\n\n if (isCheckbox(entry)) {\n return (\n <family.CheckboxItem\n checked={entry.checked}\n disabled={entry.disabled}\n onSelect={(e) => e.preventDefault()} // stay open\n onCheckedChange={(next) => runToggle(entry, next)}\n className=\"gap-2\"\n >\n <EntryInner entry={entry} Shortcut={family.Shortcut} />\n </family.CheckboxItem>\n );\n }\n\n if (isLink(entry)) {\n return (\n <family.Item asChild disabled={entry.disabled} className=\"gap-2\">\n <a\n href={entry.href}\n target={entry.target}\n rel={entry.target === \"_blank\" ? \"noopener noreferrer\" : undefined}\n onClick={onCloseRequest}\n >\n <EntryInner entry={entry} Shortcut={family.Shortcut} />\n </a>\n </family.Item>\n );\n }\n\n // command\n return (\n <family.Item\n disabled={entry.disabled}\n onSelect={() => runCommand(entry, toastPromise)}\n className={cn(\n \"gap-2\",\n entry.tone === \"destructive\" && DESTRUCTIVE_ITEM_CLASS,\n )}\n >\n <EntryInner entry={entry} Shortcut={family.Shortcut} />\n </family.Item>\n );\n}\n\n// ── Single-key shortcut handling ────────────────────────────────────────────\n\nfunction makeShortcutHandler(\n config: ItemMenuConfig,\n close: () => void,\n toastPromise?: ItemToastPromise,\n): (event: React.KeyboardEvent) => void {\n return (event) => {\n if (event.metaKey || event.ctrlKey || event.altKey) return;\n if (event.key.length !== 1) return;\n const key = event.key.toLowerCase();\n // Top-level entries only — submenus handle their own keys when open.\n const entries = config.sections\n .flatMap((s) => s.items)\n .filter((e) => !e.hidden && !e.disabled);\n const match = entries.find(\n (e) =>\n (isCommand(e) || isCheckbox(e)) && e.shortcutKey?.toLowerCase() === key,\n );\n if (!match) return;\n event.preventDefault();\n event.stopPropagation();\n if (isCheckbox(match)) {\n runToggle(match, !match.checked); // stays open\n } else if (isCommand(match)) {\n runCommand(match, toastPromise); // sets pendingRename etc. before close\n close();\n }\n };\n}\n\nfunction RowAlchemyIcon(props: { className?: string | undefined }) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={2} strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden {...props}>\n {ALCHEMY_GLYPH_PATHS.portal.map((d, index) => <path key={index} d={d} />)}\n </svg>\n );\n}\nfunction hasVisibleEntry(config: ItemMenuConfig | null, id: string): boolean {\n const entries = config?.sections.flatMap((section) => section.items) ?? [];\n return entries.some((entry) =>\n entry.id === id\n ? !entry.hidden\n : isSubmenu(entry) && entry.sections.some((section) =>\n section.items.some((child) => child.id === id && !child.hidden),\n ),\n );\n}\nconst containsDestructiveAction = (items: ItemMenuEntry[]): boolean => items.some((item) =>\n (isCommand(item) && item.tone === \"destructive\") || (isSubmenu(item) && item.sections.some((section) => containsDestructiveAction(section.items))),\n);\n\n/** The transfer session stays mounted in the row; only its canonical palette portals here. */\nfunction RowAlchemySubmenuContent({ onClose, restoreFocus }: { onClose: () => void; restoreFocus: () => void }) {\n const alchemy = useMatrxTableRowAlchemy();\n const target = useRef<HTMLDivElement>(null);\n const closeRef = useRef(onClose);\n const focusRef = useRef(restoreFocus);\n useEffect(() => { focusRef.current = restoreFocus; }, [restoreFocus]);\n useEffect(() => { closeRef.current = onClose; }, [onClose]);\n const mountMenu = alchemy?.mountMenu;\n useEffect(() => {\n mountMenu?.(target.current, () => closeRef.current(), () => focusRef.current());\n return () => mountMenu?.(null);\n }, [mountMenu]);\n return <div ref={target} data-canonical-alchemy-submenu aria-label=\"Alchemy output options\" onKeyDown={(event) => {\n // The embedded canonical palette uses native controls, not MenuItems.\n // Let Tab reach those controls instead of Radix's menu-only suppression.\n if (event.key === \"Tab\") event.stopPropagation();\n }} />;\n}\n\n// ── ItemMenu (trigger-anchored dropdown / drawer) ───────────────────────────\n\n/** How long the pointer rests on the trigger before the real menu mounts under it. */\nconst ARM_ON_HOVER_MS = 150;\n\nexport function ItemMenu({\n config,\n children,\n align = \"end\",\n side,\n open: openProp,\n onOpenChange,\n onCloseAutoFocus,\n contentMinWidth = \"12rem\",\n presentation = \"auto\",\n}: ItemMenuProps) {\n const toastPromise = useItemMenuHost()?.toastPromise;\n const rowAlchemy = useMatrxTableRowAlchemy();\n const rowControls = useMatrxTableRowControls();\n const restoreTargetRef = useRef<HTMLElement | null>(null);\n const dropdownTriggerRef = useRef<HTMLButtonElement | null>(null);\n useEffect(() => { rowAlchemy?.activate(); }, [rowAlchemy]);\n const isMobile = useIsMobile();\n const [uncontrolledOpen, setUncontrolledOpen] = useState(false);\n const isControlled = openProp !== undefined;\n const open = isControlled ? openProp : uncontrolledOpen;\n // Resolve while open so controlled open (whole-row click) and trigger open\n // share one path — no setState-during-render, no empty first frame.\n const baseConfig = open ? resolveItemMenuConfig(config) : null;\n const includeAlchemy = Boolean(rowAlchemy?.ready)\n && !hasVisibleEntry(baseConfig, \"alchemy\");\n const alchemyItem: ItemMenuEntry | null = rowAlchemy ? {\n kind: \"submenu\",\n id: \"alchemy\",\n label: \"Alchemy\",\n icon: RowAlchemyIcon,\n disabled: rowAlchemy.copy.disabled,\n sections: [],\n renderContent: (onClose) => <RowAlchemySubmenuContent onClose={onClose} restoreFocus={() => (dropdownTriggerRef.current ?? restoreTargetRef.current)?.focus()} />,\n } : null;\n const normalSections = baseConfig?.sections.map((section, index) => ({ section, index }))\n .filter(({ section }) => section.id !== \"danger\" && !containsDestructiveAction(section.items)) ?? [];\n const targetSection = (normalSections.find(({ section }) => !section.label) ?? normalSections[0])?.index;\n const injectedRowItems: ItemMenuEntry[] = [\n ...(rowControls?.beginEdit && !hasVisibleEntry(baseConfig, \"table-edit-row\") ? [{ id: \"table-edit-row\", label: \"Edit row\", onSelect: rowControls.beginEdit }] : []),\n ...(rowControls?.saveEdits && !hasVisibleEntry(baseConfig, \"table-save-row\") ? [{ id: \"table-save-row\", label: \"Save changes\", onSelect: rowControls.saveEdits }] : []),\n ...(rowControls?.cancelEdits && !hasVisibleEntry(baseConfig, \"table-discard-row\") ? [{ id: \"table-discard-row\", label: \"Discard changes\", onSelect: rowControls.cancelEdits }] : []),\n ...(alchemyItem && includeAlchemy ? [alchemyItem] : []),\n ];\n const resolved: ItemMenuConfig | null = baseConfig && injectedRowItems.length > 0 ? {\n ...baseConfig,\n sections: targetSection !== undefined\n ? baseConfig.sections.map((section, index) => index === targetSection ? { ...section, items: [...section.items, ...injectedRowItems] } : section)\n : [{ id: \"actions\", items: injectedRowItems }, ...baseConfig.sections],\n } : baseConfig;\n // ── A LONG MENU SAYS SO, IN WORDS ────────────────────────────────────────\n //\n // 🚨 Measured on production `/agents/all` at 1024x768 (one-resolution\n // FIX-Q13): the menu's DANGER section sat at y~735, past the clip. It was\n // reachable — the panel caps at the height Radix measured and scrolls — but\n // the ONLY thing saying so was a `mask-image` fade, which renders the very\n // control it is hinting at as a half-transparent smear. A live destructive\n // action that looks half-erased is the disabled-looking screen law 4\n // forbids, and the walker read the control as dead.\n //\n // So the fade is gone and the overflow is DECLARED: the panel is a flex\n // column that does not scroll, the entries scroll inside it, and an explicit\n // bar — legible text, a chevron, and a click that scrolls — sits at the\n // bottom edge whenever there is more below. `state` is measured, so a menu\n // that fits shows nothing at all.\n const scrollFade = useScrollFade();\n const viewportRef = useRef<HTMLDivElement | null>(null);\n const setViewport = useCallback(\n (node: HTMLDivElement | null) => {\n viewportRef.current = node;\n scrollFade.ref(node);\n },\n [scrollFade.ref],\n );\n const scrollToEnd = () => {\n const el = viewportRef.current;\n if (!el) return;\n el.scrollTo({ top: el.scrollHeight, behavior: \"smooth\" });\n };\n\n const handleOpenChange = (next: boolean) => {\n if (!isControlled) setUncontrolledOpen(next);\n onOpenChange?.(next);\n };\n\n const mode =\n presentation === \"auto\" ? (isMobile ? \"drawer\" : \"dropdown\") : presentation;\n\n // ── THE DROPDOWN MOUNTS ON FIRST INTENT ──────────────────────────────────\n //\n // A mounted Radix DropdownMenu listens to EVERY keydown on the document\n // (its keyboard-vs-pointer tracking), open or not. A list of 800 rows held\n // 800 of them: typing in a note beside the Notes sidebar paid 647ms of\n // listener work over 240 keystrokes (2026-10-10). Until the trigger is\n // hovered, focused or pressed it is the bare trigger; the first intent mounts\n // the real menu (a press opens it in the same gesture), and it stays mounted.\n const [armed, setArmed] = useState(false);\n const refocusOnArmRef = useRef(false);\n const armTimerRef = useRef<number | undefined>(undefined);\n useEffect(() => () => window.clearTimeout(armTimerRef.current), []);\n const live = armed || open;\n useEffect(() => {\n if (!armed || !refocusOnArmRef.current) return;\n // Mounting the menu replaced the trigger element; keep keyboard focus on it.\n refocusOnArmRef.current = false;\n dropdownTriggerRef.current?.focus();\n }, [armed]);\n\n if (mode === \"drawer\") {\n return (\n <>\n <Slot\n onClick={(e: React.MouseEvent) => {\n e.stopPropagation();\n if (e.currentTarget instanceof HTMLElement) restoreTargetRef.current = e.currentTarget;\n handleOpenChange(true);\n }}\n >\n {children}\n </Slot>\n {resolved && (\n <ItemMenuDrawer\n open={open}\n onOpenChange={handleOpenChange}\n config={resolved}\n onCommand={(entry) => isCommand(entry) && runCommand(entry, toastPromise)}\n onToggle={(entry, next) =>\n isCheckbox(entry) && runToggle(entry, next)\n }\n />\n )}\n </>\n );\n }\n\n if (!live) {\n return (\n <Slot\n data-item-menu-trigger=\"idle\"\n onPointerEnter={() => {\n // Hover INTENT, not hover: mounting the real trigger swaps the button's\n // DOM node, and a press that arrives in the same few milliseconds as the\n // pointer (automation, a fast tap) is dispatched at the node that was just\n // removed — React never sees it and the click does nothing. A press inside\n // the delay takes the pointerdown path below, on the live node.\n window.clearTimeout(armTimerRef.current);\n armTimerRef.current = window.setTimeout(() => setArmed(true), ARM_ON_HOVER_MS);\n }}\n onPointerLeave={() => window.clearTimeout(armTimerRef.current)}\n onFocus={() => {\n refocusOnArmRef.current = true;\n setArmed(true);\n }}\n onPointerDown={(e: ReactPointerEvent) => {\n // A press with no hover first (touch-like input, automation): mount\n // and open in the same gesture, as Radix's own trigger would.\n if (e.button !== 0 || e.ctrlKey) return;\n e.preventDefault();\n setArmed(true);\n handleOpenChange(true);\n }}\n >\n {children}\n </Slot>\n );\n }\n\n return (\n <DropdownMenu open={open} onOpenChange={handleOpenChange} modal={false}>\n <DropdownMenuTrigger ref={dropdownTriggerRef} asChild>{children}</DropdownMenuTrigger>\n {resolved && (\n <DropdownMenuContent\n onFocusOutside={keepCanonicalPaletteInteraction}\n onPointerDownOutside={keepCanonicalPaletteInteraction}\n align={align}\n {...(side ? { side } : {})}\n // A rich menu (a full record-action registry is 20+ entries) is\n // taller than a short viewport. Without this the overflow is simply\n // UNREACHABLE — Radix positions the panel but does not scroll it, so\n // Delete silently falls off the bottom of the screen.\n //\n // Bound to Radix's OWN available-height var, not a vh fraction: a\n // plain `max-h-[70vh]` still overhangs, because 70vh is measured\n // against the viewport while the panel starts partway down it.\n //\n // No arbitrary height cap: a menu is allowed to be long (Chrome's own\n // app menu is ~20 entries). It uses the space it has, and the fade\n // tells the eye when there is more.\n collisionPadding={12}\n className={cn(\n \"flex max-h-[var(--radix-dropdown-menu-content-available-height)] flex-col overflow-hidden p-0\",\n )}\n style={{ minWidth: contentMinWidth }}\n {...(onCloseAutoFocus ? { onCloseAutoFocus } : {})}\n onKeyDown={makeShortcutHandler(resolved, () =>\n handleOpenChange(false),\n toastPromise)}\n >\n <div\n ref={setViewport}\n data-slot=\"item-menu-viewport\"\n className=\"min-h-0 flex-1 overflow-y-auto overscroll-contain p-1\"\n >\n {resolved.header?.title && (\n <DropdownMenuLabel className=\"text-xs\">\n {resolved.header.title}\n {resolved.header.description && (\n <span className=\"mt-0.5 block type-meta font-normal text-muted-foreground\">\n {resolved.header.description}\n </span>\n )}\n </DropdownMenuLabel>\n )}\n <MenuSections\n family={dropdownFamily}\n sections={resolved.sections}\n onCloseRequest={() => handleOpenChange(false)}\n />\n </div>\n {scrollFade.state.bottom && (\n <button\n type=\"button\"\n data-slot=\"item-menu-more-below\"\n // Not a menu item: it must never take roving focus or be picked\n // by type-ahead, and Escape/arrow keys still belong to the list.\n tabIndex={-1}\n aria-hidden=\"true\"\n // Radix would otherwise close the menu on the pointer-down that\n // starts this click.\n onPointerDown={(e) => e.preventDefault()}\n onClick={scrollToEnd}\n className=\"flex w-full shrink-0 items-center justify-center gap-1 border-t border-border bg-popover px-2 py-1 text-[11px] font-medium text-muted-foreground hover:bg-accent hover:text-accent-foreground\"\n >\n <ChevronDown className=\"h-3 w-3\" />\n More actions below\n </button>\n )}\n </DropdownMenuContent>\n )}\n </DropdownMenu>\n );\n}\n// A record's menu is never a route header's phone primary: RouteHeader sends it\n// to the shell's ⋮ sheet instead of drawing a second overflow beside it\n// (`isMenuAction` in features/shell/components/header/route-header-layout.tsx).\nItemMenu.routeHeaderMenu = true as const;\n\n// ── ItemContextMenu (right-click anchored) ──────────────────────────────────\n// The host's universal right-click menu when one is provided\n// (`ItemMenuHostProvider` — the website and chat mount the v3 menu, which adds\n// Copy, agents, Attach To and Share around the row's own config). Without a\n// host, the same config opens in design-system's ContextMenu: right-click is\n// never missing, only less rich.\n\nexport function ItemContextMenu(props: ItemContextMenuProps) {\n const host = useItemMenuHost();\n if (props.enabled === false) return <>{props.children}</>;\n const HostMenu = host?.ContextMenu;\n if (HostMenu) return <HostMenu {...props} />;\n return <DefaultItemContextMenu {...props} />;\n}\n\nfunction DefaultItemContextMenu({\n config,\n children,\n resolveItemOnOpen,\n onOpenChange,\n onCloseAutoFocus,\n}: ItemContextMenuProps) {\n const [resolved, setResolved] = useState<ItemMenuConfig | null>(null);\n const targetRef = useRef<HTMLElement | null>(null);\n return (\n <ContextMenu\n modal={false}\n onOpenChange={(open) => {\n if (open) {\n const item = resolveItemOnOpen?.(targetRef.current);\n setResolved(resolveItemMenuConfig(item?.config ?? config));\n }\n onOpenChange?.(open);\n }}\n >\n <ContextMenuTrigger\n asChild\n onContextMenu={(event) => {\n targetRef.current = event.target instanceof HTMLElement ? event.target : null;\n }}\n >\n {children}\n </ContextMenuTrigger>\n {resolved && (\n <ContextMenuContent\n className=\"z-[9999] min-w-[12rem]\"\n onCloseAutoFocus={onCloseAutoFocus}\n >\n {resolved.header?.title && (\n <ContextMenuLabel className=\"text-xs font-medium text-muted-foreground\">\n {resolved.header.title}\n </ContextMenuLabel>\n )}\n <MenuSections family={contextFamily} sections={resolved.sections} onCloseRequest={() => onOpenChange?.(false)} />\n </ContextMenuContent>\n )}\n </ContextMenu>\n );\n}\n\n// `config` may be a GETTER resolved only when the menu opens. Every list writes it inline\n// (`config={() => menuFor(row)}`), so the table compares it by what it returns, never by identity —\n// otherwise each host render redrew every row (/crm: 25 of 25 per checkbox tick).\ndeclareLazyDataProps(ItemMenu, [\"config\"]);\ndeclareLazyDataProps(ItemContextMenu, [\"config\"]);\n","\"use client\";\n\n/**\n * ItemMenuDrawer — mobile presentation for ItemMenu.\n *\n * A Vaul bottom sheet with iOS-style submenu drill-in: tapping a submenu pushes\n * a new view (slide-in-from-right), the back button pops it (slide-in-from-left).\n * Renders the same ItemMenuConfig the desktop dropdown/context menu use.\n *\n * Used internally by ItemMenu — not exported as a standalone primitive.\n */\n\nimport { useState } from \"react\";\nimport { ChevronLeftIcon as ChevronLeft, ChevronRightIcon as ChevronRight, CheckIcon } from \"../icons\";\nimport {\n Drawer,\n DrawerContent,\n DrawerTitle,\n} from \"../drawer\";\nimport { cn } from \"../cn\";\nimport {\n isCheckbox,\n isCommand,\n isLink,\n isSubmenu,\n type ItemMenuConfig,\n type ItemMenuEntry,\n type ItemMenuSection,\n type ItemMenuSubmenu,\n} from \"./types\";\n\ninterface ItemMenuDrawerProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n config: ItemMenuConfig;\n /** Runs a command entry (close-then-execute is handled by the caller). */\n onCommand: (entry: ItemMenuEntry) => void;\n /** Toggles a checkbox entry without closing the drawer. */\n onToggle: (entry: ItemMenuEntry, next: boolean) => void;\n}\n\n/** Walk a submenu `path` (entry ids) to the sections it points at. */\nfunction resolveSections(\n config: ItemMenuConfig,\n path: string[],\n): { sections: ItemMenuSection[]; title: string | null; renderContent?: ItemMenuSubmenu[\"renderContent\"] } {\n let sections = config.sections;\n let title: string | null = null;\n let renderContent: ItemMenuSubmenu[\"renderContent\"];\n for (const id of path) {\n const found = sections\n .flatMap((s) => s.items)\n .find((e) => e.id === id && isSubmenu(e));\n if (found && isSubmenu(found)) {\n sections = found.sections;\n title = found.label;\n renderContent = found.renderContent;\n } else {\n // Unknown id — defensively reset to root.\n return { sections: config.sections, title: null };\n }\n }\n return { sections, title, renderContent };\n}\n\nexport function ItemMenuDrawer({\n open,\n onOpenChange,\n config,\n onCommand,\n onToggle,\n}: ItemMenuDrawerProps) {\n const [path, setPath] = useState<string[]>([]);\n const [direction, setDirection] = useState<\"push\" | \"pop\">(\"push\");\n\n const { sections, title, renderContent } = resolveSections(config, path);\n const atRoot = path.length === 0;\n const headerTitle = atRoot ? config.header?.title : title;\n\n const push = (id: string) => {\n setDirection(\"push\");\n setPath((p) => [...p, id]);\n };\n const pop = () => {\n setDirection(\"pop\");\n setPath((p) => p.slice(0, -1));\n };\n\n const handleOpenChange = (next: boolean) => {\n if (!next) setPath([]);\n onOpenChange(next);\n };\n\n return (\n <Drawer open={open} onOpenChange={handleOpenChange}>\n <DrawerContent className=\"max-h-[80dvh] flex flex-col\">\n {/* Header — Back button when drilled in. DrawerTitle always present. */}\n {atRoot ? (\n headerTitle ? (\n <div className=\"flex-shrink-0 border-b border-border px-4 pb-3 pt-1\">\n <DrawerTitle className=\"text-center text-[15px] font-semibold\">\n {headerTitle}\n </DrawerTitle>\n {config.header?.description && (\n <p className=\"mt-1 text-center type-body text-muted-foreground\">\n {config.header.description}\n </p>\n )}\n </div>\n ) : (\n <DrawerTitle className=\"sr-only\">Options</DrawerTitle>\n )\n ) : (\n <div className=\"flex h-11 flex-shrink-0 items-center border-b border-border px-1\">\n <button\n type=\"button\"\n onClick={pop}\n aria-label=\"Back\"\n className=\"flex h-9 items-center gap-1 rounded-md px-2 text-sm text-muted-foreground hover:bg-accent hover:text-foreground\"\n >\n <ChevronLeft className=\"h-5 w-5\" />\n </button>\n <DrawerTitle className=\"flex-1 truncate pr-10 text-center text-[15px] font-semibold\">\n {headerTitle ?? \"Options\"}\n </DrawerTitle>\n </div>\n )}\n\n {/* Body — keyed by path so each view animates in. */}\n <div\n key={path.join(\"/\")}\n className={cn(\n \"flex-1 overflow-y-auto overscroll-contain py-2 pb-safe\",\n direction === \"push\"\n ? \"animate-in fade-in slide-in-from-right-8 duration-200\"\n : \"animate-in fade-in slide-in-from-left-8 duration-200\",\n )}\n >\n {renderContent?.(() => handleOpenChange(false))}\n {sections.map((section, sIdx) => {\n const visible = section.items.filter((e) => !e.hidden);\n if (visible.length === 0) return null;\n return (\n <div key={section.id ?? section.label ?? sIdx}>\n {sIdx > 0 && <div className=\"my-1 h-px bg-border\" />}\n {section.label && (\n <div className=\"px-4 pb-1 pt-2 type-secondary font-medium uppercase tracking-wide text-muted-foreground\">\n {section.label}\n </div>\n )}\n {visible.map((entry) => (\n <DrawerEntry\n key={entry.id}\n entry={entry}\n onCommand={onCommand}\n onToggle={onToggle}\n onDrill={() => push(entry.id)}\n onClose={() => handleOpenChange(false)}\n />\n ))}\n </div>\n );\n })}\n </div>\n </DrawerContent>\n </Drawer>\n );\n}\n\ninterface DrawerEntryProps {\n entry: ItemMenuEntry;\n onCommand: (entry: ItemMenuEntry) => void;\n onToggle: (entry: ItemMenuEntry, next: boolean) => void;\n onDrill: () => void;\n onClose: () => void;\n}\n\nfunction DrawerEntry({\n entry,\n onCommand,\n onToggle,\n onDrill,\n onClose,\n}: DrawerEntryProps) {\n const Icon = entry.icon;\n const destructive = isCommand(entry) && entry.tone === \"destructive\";\n const disabled = entry.disabled;\n\n const rowClass = cn(\n \"flex min-h-12 w-full items-center gap-3 px-4 text-left\",\n disabled\n ? \"opacity-50\"\n : \"active:bg-accent\",\n destructive && \"text-destructive\",\n );\n\n const content = (\n <>\n {Icon && (\n <Icon\n className={cn(\n \"h-[18px] w-[18px] shrink-0\",\n destructive\n ? \"text-destructive\"\n : entry.iconClassName ?? \"text-muted-foreground\",\n )}\n />\n )}\n <span className=\"flex min-w-0 flex-1 flex-col\">\n <span className=\"truncate text-[15px]\" title={entry.description}>{entry.label}</span>\n {disabled && entry.disabledReason ? (\n <span className=\"truncate type-body text-muted-foreground\">{entry.disabledReason}</span>\n ) : null}\n </span>\n </>\n );\n\n if (isSubmenu(entry)) {\n return (\n <button type=\"button\" disabled={disabled} onClick={onDrill} className={rowClass}>\n {content}\n <ChevronRight className=\"h-5 w-5 shrink-0 text-muted-foreground\" />\n </button>\n );\n }\n\n if (isCheckbox(entry)) {\n return (\n <button\n type=\"button\"\n disabled={disabled}\n onClick={() => onToggle(entry, !entry.checked)}\n className={rowClass}\n >\n {content}\n {entry.checked && <CheckIcon className=\"h-5 w-5 shrink-0 text-primary\" />}\n </button>\n );\n }\n\n if (isLink(entry)) {\n return (\n <a\n href={entry.href}\n target={entry.target}\n rel={entry.target === \"_blank\" ? \"noopener noreferrer\" : undefined}\n onClick={onClose}\n className={rowClass}\n >\n {content}\n </a>\n );\n }\n\n // command\n return (\n <button\n type=\"button\"\n disabled={disabled}\n onClick={() => {\n onClose();\n onCommand(entry);\n }}\n className={rowClass}\n >\n {content}\n </button>\n );\n}\n","\"use client\";\n\n/**\n * ItemRow — the reusable list row.\n *\n * - Full-width label with a right-edge mask fade (NO ellipsis) that deepens on\n * hover/focus/menu-open to clear the kebab (see `.item-row`/`.item-fade` in\n * design-system styles.css). Trailing indicators glide left in sync.\n * - Kebab is an absolute sibling (reserves no layout space) revealed on\n * hover/focus/menu-open, and always visible on touch.\n * - Right-click opens the SAME menu config (ItemContextMenu), disabled on touch.\n * - Inline rename: double-click the row, or a menu entry with `intent: \"rename\"`\n * (ItemRow swaps that entry's action for its own edit state and wins the\n * focus race via onCloseAutoFocus).\n *\n * The menu/rename schema lives in ./types; menus render via ./ItemMenu.\n */\n\nimport { useRef, useState } from \"react\";\nimport {\n ChevronDownIcon as ChevronDown,\n ChevronRightIcon as ChevronRight,\n MoreHorizontalIcon as MoreHorizontal,\n} from \"../icons\";\nimport { cn } from \"../cn\";\nimport { Button } from \"../controls/controls\";\nimport { useIsMobile } from \"@ai-matrx/kit/media-query\";\nimport { EditableLabel } from \"../editable-label\";\nimport { getTapTargetLinkComponent } from \"../tap-target/link\";\nimport { ItemMenu, ItemContextMenu } from \"./ItemMenu\";\nimport {\n isCommand,\n isSubmenu,\n resolveItemMenuConfig,\n type ItemMenuConfig,\n type ItemMenuConfigInput,\n type ItemMenuEntry,\n type ItemMenuSection,\n type ItemRowProps,\n type ItemRowSize,\n} from \"./types\";\n\nconst SIZE: Record<\n ItemRowSize,\n { row: string; text: string; kebab: string; icon: string; tone?: string }\n> = {\n // A nested sub-row (a conversation's helpers under it in the chat sidebar):\n // finer and quieter than its parent, so a tree reads at a glance.\n xs: {\n row: \"h-6\",\n text: \"text-xs\",\n kebab: \"h-5 w-5\",\n icon: \"h-3.5 w-3.5\",\n tone: \"text-muted-foreground\",\n },\n sm: {\n row: \"h-7\",\n text: \"text-[13px]\",\n kebab: \"h-5 w-5\",\n icon: \"h-3.5 w-3.5\",\n },\n md: { row: \"h-8\", text: \"text-sm\", kebab: \"h-6 w-6\", icon: \"h-4 w-4\" },\n lg: { row: \"h-10\", text: \"text-sm\", kebab: \"h-7 w-7\", icon: \"h-4 w-4\" },\n};\n\n/**\n * The trailing room a row keeps for its disclosure: the button (kebab size) + the 4px end inset +\n * a 4px gap, so the trailing meta (time) never touches the chevron. A disclosure row and a plain\n * sibling that passes `reserveDisclosure` keep the SAME room, so every row's meta ends on one edge.\n */\nconst DISCLOSURE_RESERVE: Record<ItemRowSize, number> = { xs: 32, sm: 32, md: 36, lg: 40 };\n\n/**\n * Replace `intent: \"rename\"` command actions with the host's rename trigger —\n * or REMOVE them when this row has no `rename` prop at all.\n *\n * 🚨 The removal half is not tidiness. Without it, a row that renders a menu\n * carrying `intent: \"rename\"` but passes no `rename` handed the user a live\n * \"Rename\" row whose click set `pendingRenameRef`, flipped `editing`, and then\n * rendered the plain label again because `editing && rename` is false —\n * a control that looks clickable and does nothing (found by the LIVE-ITEM LAW,\n * 2026-09-11). `ctx.showRename === false` asks every consumer to remember;\n * this is the one place that KNOWS. Absent beats dead.\n */\nfunction mapRenameIntent(\n config: ItemMenuConfig,\n requestRename: (() => void) | null,\n): ItemMenuConfig {\n const mapEntry = (entry: ItemMenuEntry): ItemMenuEntry | null => {\n if (isSubmenu(entry)) {\n return { ...entry, sections: entry.sections.map(mapSection) };\n }\n if (isCommand(entry) && entry.intent === \"rename\") {\n return requestRename ? { ...entry, onSelect: requestRename } : null;\n }\n return entry;\n };\n const mapSection = (section: ItemMenuSection): ItemMenuSection => ({\n ...section,\n items: section.items\n .map(mapEntry)\n .filter((e): e is ItemMenuEntry => e !== null),\n });\n return { ...config, sections: config.sections.map(mapSection) };\n}\n\nexport function ItemRow({\n label,\n secondaryLabel,\n secondaryShare = \"half\",\n subtitle,\n actions,\n leadingControl,\n disclosure,\n reserveDisclosure = false,\n leading,\n trailing,\n active = false,\n disabled = false,\n href,\n onOpen,\n openInPlace = false,\n menu,\n rename,\n size = \"md\",\n indent,\n kebabAriaLabel,\n disableContextMenu = false,\n sourceFeature,\n surfaceName,\n entity,\n className,\n}: ItemRowProps) {\n const isMobile = useIsMobile();\n const [editing, setEditing] = useState(false);\n const pendingRenameRef = useRef(false);\n const sz = SIZE[size];\n\n const canRename = !!rename;\n const allowDoubleClick = canRename && rename.doubleClick !== false;\n\n // Wrap the menu so rename-intent entries drive ItemRow's edit state, and so\n // a static config is still resolved lazily (on open).\n const mappedMenu: ItemMenuConfigInput | undefined = menu\n ? () =>\n mapRenameIntent(\n resolveItemMenuConfig(menu),\n canRename\n ? () => {\n pendingRenameRef.current = true;\n }\n : null,\n )\n : undefined;\n\n // Radix returns focus to the trigger on close; when a rename was requested,\n // intercept it and move focus into the input instead (no focus tug-of-war).\n const handleCloseAutoFocus = (event: Event) => {\n if (pendingRenameRef.current) {\n pendingRenameRef.current = false;\n event.preventDefault();\n setEditing(true);\n }\n };\n\n const startInlineRename = () => {\n if (canRename) setEditing(true);\n };\n\n const labelNode =\n editing && rename ? (\n <EditableLabel\n activation=\"controlled\"\n editing\n onEditingChange={(next) => setEditing(next)}\n value={rename.value ?? label}\n onCommit={rename.onCommit}\n {...(rename.validate ? { validate: rename.validate } : {})}\n {...(rename.emptyFallback !== undefined ? { emptyFallback: rename.emptyFallback } : {})}\n {...(rename.maxLength !== undefined ? { maxLength: rename.maxLength } : {})}\n ariaLabel=\"Name\"\n className=\"flex-1\"\n inputClassName={cn(\"font-normal\", sz.text)}\n />\n ) : subtitle != null ? (\n <span className=\"flex min-w-0 flex-1 flex-col\">\n <span className={cn(\"item-fade min-w-0\", sz.text)} title={label}>\n {label}\n </span>\n <span className=\"min-w-0 truncate type-secondary text-muted-foreground\" data-item-subtitle=\"\">\n {subtitle}\n </span>\n </span>\n ) : (\n <span className={cn(\"item-fade min-w-0 flex-1\", sz.text)} title={label}>\n {label}\n </span>\n );\n\n const primaryInner = (\n <>\n {leading != null && (\n <span className=\"flex shrink-0 items-center\">{leading}</span>\n )}\n {labelNode}\n {secondaryLabel && (\n // Clamped: a secondary value can be a sentence (a lineage edge's\n // \"140 cards - 1 section could not be covered …\"). Unclamped it pushed\n // the label out of the row (owner, 2026-10-04).\n <span\n className={cn(\n \"item-shift min-w-0 truncate type-secondary text-muted-foreground\",\n secondaryShare === \"third\" ? \"max-w-[33%]\" : \"max-w-[50%]\",\n )}\n title={secondaryLabel}\n >\n {secondaryLabel}\n </span>\n )}\n {trailing != null && (\n <span className=\"item-shift flex shrink-0 items-center gap-1 pr-0.5\">\n {trailing}\n </span>\n )}\n </>\n );\n\n const twoLine = subtitle != null && !editing;\n const sideBySide = actions != null || leadingControl != null;\n\n // THE DISCLOSURE IS ON THE RIGHT (Arman, 2026-10-23): a real button outside the row's link, after\n // the label and the trailing indicators — never before the label. It glides with the trailing\n // indicators when the kebab shows, so the two never overlap.\n const disclosureButton = disclosure ? (\n <Button\n type=\"button\"\n variant=\"quiet\"\n data-item-disclosure=\"\"\n aria-expanded={disclosure.open}\n aria-label={disclosure.ariaLabel ?? `${disclosure.open ? \"Collapse\" : \"Expand\"} ${label}`}\n onClick={(e) => {\n e.stopPropagation();\n disclosure.onToggle();\n }}\n icon={disclosure.open ? <ChevronDown className={sz.icon} /> : <ChevronRight className={sz.icon} />}\n className=\"shrink-0\"\n >\n </Button>\n ) : null;\n const primaryClass = cn(\n \"flex min-w-0 items-center gap-1.5 rounded-lg px-2\",\n sideBySide ? \"flex-1\" : \"w-full\",\n twoLine ? \"min-h-11 py-1.5\" : sz.row,\n sz.text,\n \"outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring\",\n active ? \"font-medium text-primary\" : (sz.tone ?? \"text-foreground\"),\n );\n\n const indentStyle: React.CSSProperties | undefined =\n (indent && indent > 0) || ((disclosure || reserveDisclosure) && !sideBySide)\n ? {\n ...(indent && indent > 0 ? { paddingInlineStart: 8 + indent * 16 } : {}),\n // Room for the disclosure at the trailing edge (its box + the row's 4px end inset).\n ...((disclosure || reserveDisclosure) && !sideBySide ? { paddingInlineEnd: DISCLOSURE_RESERVE[size] } : {}),\n }\n : undefined;\n\n // Primary element: link (navigation), button (click), or div (editing/disabled).\n let primary: React.ReactNode;\n if (editing || disabled) {\n primary = (\n <div className={primaryClass} style={indentStyle} data-item-primary=\"\">\n {primaryInner}\n </div>\n );\n } else if (href) {\n // The host's registered link (`setTapTargetLinkComponent`, e.g. next/link), else a plain anchor.\n const RegisteredLink = getTapTargetLinkComponent();\n const Link = (RegisteredLink ?? \"a\") as unknown as React.ComponentType<React.AnchorHTMLAttributes<HTMLAnchorElement> & { href: string; prefetch?: boolean }>;\n primary = (\n <Link\n href={href}\n data-item-primary=\"\"\n // 🚨 A ROW NEVER PREFETCHES. next/link prefetches every link in view, so\n // a 20-row list (chat history) fired 20 background route renders on\n // page load (2026-10-09). A row is opened by a click; the click loads it.\n {...(RegisteredLink ? { prefetch: false } : {})}\n className={primaryClass}\n style={indentStyle}\n onClick={(e: React.MouseEvent<HTMLAnchorElement>) => {\n // Modifier / middle-click: native <a> opens a new tab/window.\n if (e.metaKey || e.ctrlKey || e.shiftKey || e.button === 1) return;\n // `openInPlace`: handle the click in-app and keep the page put. The\n // href stays for new-tab / copy-link affordances above.\n if (openInPlace) e.preventDefault();\n onOpen?.();\n // Without `openInPlace`, `onOpen` is a side effect only (close a\n // popover, etc.) — navigation stays on the Link href.\n }}\n onDoubleClick={\n allowDoubleClick\n ? (e: React.MouseEvent<HTMLAnchorElement>) => {\n e.preventDefault();\n e.stopPropagation();\n startInlineRename();\n }\n : undefined\n }\n >\n {primaryInner}\n </Link>\n );\n } else {\n primary = (\n <button\n type=\"button\"\n data-item-primary=\"\"\n className={cn(primaryClass, \"cursor-pointer text-left\")}\n style={indentStyle}\n onClick={onOpen}\n onDoubleClick={\n allowDoubleClick\n ? (e) => {\n e.preventDefault();\n e.stopPropagation();\n startInlineRename();\n }\n : undefined\n }\n >\n {primaryInner}\n </button>\n );\n }\n\n const kebab =\n mappedMenu && !editing ? (\n <ItemMenu\n config={mappedMenu}\n align=\"end\"\n onCloseAutoFocus={handleCloseAutoFocus}\n >\n <Button\n type=\"button\"\n variant=\"quiet\"\n aria-label={kebabAriaLabel ?? `Options for ${label}`}\n icon={<MoreHorizontal className={sz.icon} />}\n aria-haspopup=\"menu\"\n onClick={(e) => e.stopPropagation()}\n className={cn(\"shrink-0\", !sideBySide && \"absolute right-1 top-1/2 -translate-y-1/2\")}\n >\n </Button>\n </ItemMenu>\n ) : null;\n\n const row = (\n <div\n data-active={active || undefined}\n // The deep fade exists to clear the kebab; a menu-less row has none, so\n // its label keeps every pixel (touch used to fade it permanently).\n data-no-menu={mappedMenu && !sideBySide ? undefined : true}\n className={cn(\n \"item-row group/item relative rounded-lg transition-colors\",\n sideBySide && \"flex items-center\",\n !active && \"hover:bg-accent/60\",\n active && \"bg-primary/10 text-primary-ink\",\n className,\n )}\n >\n {leadingControl != null ? (\n <span className=\"flex shrink-0 items-center pl-2\" data-item-leading-control=\"\">\n {leadingControl}\n </span>\n ) : null}\n {primary}\n\n {!sideBySide && disclosureButton ? (\n <span\n className=\"item-shift absolute inset-y-0 right-1 flex items-center\"\n data-item-disclosure-slot=\"\"\n >\n {disclosureButton}\n </span>\n ) : null}\n {!sideBySide && kebab}\n {/* The actions wrapper adds NO gap or padding: tap buttons space themselves (tap-target guard\n rules 3 and 4 flag a wrapper that adds space around one); a plain (non-tap) child gets its own\n horizontal margin from the wrapper's child selector below. */}\n {sideBySide && (actions != null || kebab || disclosureButton) ? (\n <span\n className=\"flex shrink-0 items-center [&>:not(.matrx-tap-target,.matrx-alchemy)]:mx-0.5\"\n data-item-actions=\"\"\n >\n {actions}\n {disclosureButton}\n {kebab}\n </span>\n ) : null}\n </div>\n );\n\n if (!mappedMenu || disableContextMenu) return row;\n\n return (\n <ItemContextMenu\n config={mappedMenu}\n // Forwarded, not invented. `entity` is what turns Attach To and Share on\n // in the v3 menu; a row that omits it ships a menu missing two doors the\n // platform already owns. `sourceFeature` is REQUIRED rather than\n // defaulted: it used to be hardcoded `\"files\"` inside ItemContextMenu, a\n // confident lie on every non-file row, and `SourceFeature` is a closed\n // registry with no generic member to hide behind — so the compiler makes\n // each row name itself instead.\n sourceFeature={sourceFeature}\n surfaceName={surfaceName}\n entity={entity}\n enabled={!isMobile && !editing}\n onCloseAutoFocus={handleCloseAutoFocus}\n // The v3 context menu is not a Radix content, so `onCloseAutoFocus` never fires\n // there: a Rename picked from the right-click menu set the pending flag and\n // nothing ever opened the editor. Its close is the signal instead.\n onOpenChange={(open) => {\n if (!open && pendingRenameRef.current) {\n pendingRenameRef.current = false;\n setTimeout(() => setEditing(true), 0);\n }\n }}\n >\n {row}\n </ItemContextMenu>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiWO,SAAS,UAAU,OAAgD;AACxE,SAAO,MAAM,SAAS,UAAa,MAAM,SAAS;AACpD;AACO,SAAS,WAAW,OAAiD;AAC1E,SAAO,MAAM,SAAS;AACxB;AACO,SAAS,OAAO,OAA6C;AAClE,SAAO,MAAM,SAAS;AACxB;AACO,SAAS,UAAU,OAAgD;AACxE,SAAO,MAAM,SAAS;AACxB;AAEO,SAAS,sBACd,OACgB;AAChB,SAAO,OAAO,UAAU,aAAa,MAAM,IAAI;AACjD;;;ACpWA,YAAY,WAAW;AA8Bd;AAfT,IAAM,WAAW,uBAAO,IAAI,wCAAwC;AAEpE,IAAM,eAAe;AACrB,IAAM,sBACJ,aAAa,QAAQ,MACpB,aAAa,QAAQ,IAAU,oBAAmC,IAAI;AAGlE,SAAS,qBAAqB;AAAA,EACnC;AAAA,EACA;AACF,GAGG;AACD,SAAO,oBAAC,oBAAoB,UAApB,EAA6B,OAAO,MAAO,UAAS;AAC9D;AAEO,SAAS,kBAAuC;AACrD,SAAa,iBAAW,mBAAmB;AAC7C;;;ACtCO,SAAS,WAAW,OAAwB,cAAiC;AAClF,QAAM,SAAS,MAAM,SAAS;AAC9B,MAAI,kBAAkB,SAAS;AAC7B,QAAI,MAAM,SAAS,cAAc;AAC/B,YAAM,EAAE,SAAS,SAAS,MAAM,IAAI,MAAM;AAC1C,mBAAa,QAAQ;AAAA,QACnB;AAAA,QACA;AAAA,QACA,OAAO,CAAC,MACN,OAAO,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M,WAAW,IAAI,GAAG,CAAC;AAAA,QACtC;AAAA,MACF;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;","names":["Fragment","useState","jsx","Fragment","jsx","jsxs","useState","useRef","useState","useIsMobile","Fragment","jsx","jsxs","useIsMobile","useState","useRef"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/controls/controls.tsx"],"sourcesContent":["\"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\";\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\">{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 <span className=\"flex-1 truncate\">\n {o.label}\n {o.hint ? <span className=\"ml-1.5 text-muted-foreground\">{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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,YAAY,sBAAsB;AAClC,SAAS,MAAM,iBAAiB;AAChC,YAAY,WAAW;AA8BnB,SAsXY,YAAAA,WAtXZ,KAyJE,YAzJF;AAFG,IAAM,aAAmB;AAAA,EAC9B,CAAC,EAAE,WAAW,QAAQ,GAAG,MAAM,GAAG,QAChC;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,0BAAuB;AAAA,MACvB,eAAa,SAAS,KAAK;AAAA,MAC3B,WAAW,GAAG,qBAAqB,SAAS;AAAA,MAC3C,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,WAAW,cAAc;AA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