@ai-matrx/design-system 0.86.331 → 0.86.333
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -1
- package/dist/auth-gate-dialog.js +4 -4
- package/dist/carousel.js +18 -18
- package/dist/{chunk-MVGMI6UZ.js → chunk-3MQMVPKO.js} +5 -5
- package/dist/{chunk-TBDMTCRW.js → chunk-6YZMGSQY.js} +10 -10
- package/dist/{chunk-OFJ5LGBU.js → chunk-7NEVJKDZ.js} +8 -8
- package/dist/{chunk-XTNAKJSH.js → chunk-B3LDW3IQ.js} +2 -2
- package/dist/{chunk-VTJWQPYR.js → chunk-BM2YYBUO.js} +5 -5
- package/dist/{chunk-FTZCPGTH.js → chunk-CFCWQDGC.js} +4 -4
- package/dist/{chunk-CN7C4KQB.js → chunk-CH2NWSES.js} +2 -2
- package/dist/{chunk-CJCUD62M.js → chunk-CSSD6NS4.js} +5 -5
- package/dist/{chunk-W3QSRJ3O.js → chunk-E4GS5QH7.js} +7 -7
- package/dist/{chunk-O4KANICE.js → chunk-FRJ4PPA2.js} +5 -5
- package/dist/{chunk-4PCLJAW2.js → chunk-FXT7PZAF.js} +5 -14
- package/dist/chunk-FXT7PZAF.js.map +1 -0
- package/dist/{chunk-D45XDOJS.js → chunk-GHPUO3O7.js} +2 -2
- package/dist/{chunk-RPUC5MNH.js → chunk-GLZJ7WZK.js} +3 -3
- package/dist/{chunk-VKWQTSB6.js → chunk-HEFTQUJ5.js} +6 -6
- package/dist/{chunk-KWBYKUKP.js → chunk-J6637L6D.js} +4 -4
- package/dist/chunk-KGW373MK.js +21 -0
- package/dist/chunk-KGW373MK.js.map +1 -0
- package/dist/{chunk-5LT34PFX.js → chunk-MEJVHDYJ.js} +18 -18
- package/dist/{chunk-PPB52S7F.js → chunk-MFUNGDHO.js} +7 -7
- package/dist/{chunk-LCPHFONA.js → chunk-MIJMP4WI.js} +5 -5
- package/dist/{chunk-2WL2SGKL.js → chunk-NNETFHGX.js} +8 -8
- package/dist/{chunk-XREKZXAL.js → chunk-SMJGESH7.js} +6 -6
- package/dist/{chunk-SNHCBHBE.js → chunk-U24MOJWK.js} +4 -4
- package/dist/{chunk-DO6G4EKJ.js → chunk-UWTODOMD.js} +2 -2
- package/dist/{chunk-BQR4N24F.js → chunk-VLLUUOYJ.js} +4 -4
- package/dist/{chunk-FD6V6JBN.js → chunk-VV6WZTH5.js} +8 -8
- package/dist/{chunk-LVM7XZRJ.js → chunk-WQ2QCMMA.js} +4 -4
- package/dist/{chunk-57OD2WTY.js → chunk-X6ZRHJQP.js} +6 -6
- package/dist/{chunk-PLFWDUJW.js → chunk-XEXSZBXV.js} +3 -3
- package/dist/{chunk-JSXNITMG.js → chunk-YC5GAO35.js} +2 -2
- package/dist/{chunk-5TF2AFDM.js → chunk-ZCRPESQX.js} +4 -4
- package/dist/{chunk-5IKQ6RU4.js → chunk-ZOQ2XKXF.js} +9 -9
- package/dist/clipboard-fallback-dialog.js +10 -10
- package/dist/controls.js +15 -15
- package/dist/data-table/data-row-inspector.js +15 -14
- package/dist/data-table/data-row-window.js +20 -19
- package/dist/data-table/index.cjs +16 -12
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.js +37 -36
- package/dist/data-table/index.js.map +1 -1
- package/dist/data-table/layered-filter-builder.js +4 -4
- package/dist/data-table/pagination.js +8 -8
- package/dist/data-table/uuid-cell.js +8 -8
- package/dist/desktop.js +22 -22
- package/dist/email-input-dialog.js +7 -7
- package/dist/index.cjs +16 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -7
- package/dist/index.d.ts +5 -7
- package/dist/index.js +88 -86
- package/dist/index.js.map +1 -1
- package/dist/intro-stage.js +3 -3
- package/dist/item.js +15 -15
- package/dist/lite-table.js +10 -10
- package/dist/menu-look.js +3 -3
- package/dist/record-list.js +13 -13
- package/dist/sandbox-gate-dialog.js +8 -8
- package/dist/scope-mismatch-dialog.js +7 -7
- package/dist/settings.cjs +16 -12
- package/dist/settings.cjs.map +1 -1
- package/dist/settings.js +20 -19
- package/dist/settings.js.map +1 -1
- package/dist/site-icon.js +2 -2
- package/dist/swipe-deck.js +1 -1
- package/dist/tap-shortcut.cjs +40 -0
- package/dist/tap-shortcut.cjs.map +1 -0
- package/dist/tap-shortcut.d.cts +13 -0
- package/dist/tap-shortcut.d.ts +13 -0
- package/dist/tap-shortcut.js +10 -0
- package/dist/tap-shortcut.js.map +1 -0
- package/dist/tap-target/ai-buttons.cjs +16 -12
- package/dist/tap-target/ai-buttons.cjs.map +1 -1
- package/dist/tap-target/ai-buttons.js +4 -3
- package/dist/tap-target/ai-buttons.js.map +1 -1
- package/dist/tap-target/buttons.cjs +16 -12
- package/dist/tap-target/buttons.cjs.map +1 -1
- package/dist/tap-target/buttons.d.cts +3 -5
- package/dist/tap-target/buttons.d.ts +3 -5
- package/dist/tap-target/buttons.js +4 -3
- package/dist/tap-target.cjs +16 -12
- package/dist/tap-target.cjs.map +1 -1
- package/dist/tap-target.d.cts +5 -7
- package/dist/tap-target.d.ts +5 -7
- package/dist/tap-target.js +6 -4
- package/dist/text-input-dialog.js +10 -10
- package/dist/thumbnail-grid.js +2 -2
- package/dist/transcript-scroll-nav.cjs +16 -12
- package/dist/transcript-scroll-nav.cjs.map +1 -1
- package/dist/transcript-scroll-nav.js +2 -1
- package/dist/transcript-scroll-nav.js.map +1 -1
- package/dist/value-prompts-dialog.js +5 -5
- package/dist/writing-field.cjs +16 -12
- package/dist/writing-field.cjs.map +1 -1
- package/dist/writing-field.js +21 -20
- package/dist/writing-field.js.map +1 -1
- package/package.json +12 -37
- package/dist/chunk-4PCLJAW2.js.map +0 -1
- /package/dist/{chunk-MVGMI6UZ.js.map → chunk-3MQMVPKO.js.map} +0 -0
- /package/dist/{chunk-TBDMTCRW.js.map → chunk-6YZMGSQY.js.map} +0 -0
- /package/dist/{chunk-OFJ5LGBU.js.map → chunk-7NEVJKDZ.js.map} +0 -0
- /package/dist/{chunk-XTNAKJSH.js.map → chunk-B3LDW3IQ.js.map} +0 -0
- /package/dist/{chunk-VTJWQPYR.js.map → chunk-BM2YYBUO.js.map} +0 -0
- /package/dist/{chunk-FTZCPGTH.js.map → chunk-CFCWQDGC.js.map} +0 -0
- /package/dist/{chunk-CN7C4KQB.js.map → chunk-CH2NWSES.js.map} +0 -0
- /package/dist/{chunk-CJCUD62M.js.map → chunk-CSSD6NS4.js.map} +0 -0
- /package/dist/{chunk-W3QSRJ3O.js.map → chunk-E4GS5QH7.js.map} +0 -0
- /package/dist/{chunk-O4KANICE.js.map → chunk-FRJ4PPA2.js.map} +0 -0
- /package/dist/{chunk-D45XDOJS.js.map → chunk-GHPUO3O7.js.map} +0 -0
- /package/dist/{chunk-RPUC5MNH.js.map → chunk-GLZJ7WZK.js.map} +0 -0
- /package/dist/{chunk-VKWQTSB6.js.map → chunk-HEFTQUJ5.js.map} +0 -0
- /package/dist/{chunk-KWBYKUKP.js.map → chunk-J6637L6D.js.map} +0 -0
- /package/dist/{chunk-5LT34PFX.js.map → chunk-MEJVHDYJ.js.map} +0 -0
- /package/dist/{chunk-PPB52S7F.js.map → chunk-MFUNGDHO.js.map} +0 -0
- /package/dist/{chunk-LCPHFONA.js.map → chunk-MIJMP4WI.js.map} +0 -0
- /package/dist/{chunk-2WL2SGKL.js.map → chunk-NNETFHGX.js.map} +0 -0
- /package/dist/{chunk-XREKZXAL.js.map → chunk-SMJGESH7.js.map} +0 -0
- /package/dist/{chunk-SNHCBHBE.js.map → chunk-U24MOJWK.js.map} +0 -0
- /package/dist/{chunk-DO6G4EKJ.js.map → chunk-UWTODOMD.js.map} +0 -0
- /package/dist/{chunk-BQR4N24F.js.map → chunk-VLLUUOYJ.js.map} +0 -0
- /package/dist/{chunk-FD6V6JBN.js.map → chunk-VV6WZTH5.js.map} +0 -0
- /package/dist/{chunk-LVM7XZRJ.js.map → chunk-WQ2QCMMA.js.map} +0 -0
- /package/dist/{chunk-57OD2WTY.js.map → chunk-X6ZRHJQP.js.map} +0 -0
- /package/dist/{chunk-PLFWDUJW.js.map → chunk-XEXSZBXV.js.map} +0 -0
- /package/dist/{chunk-JSXNITMG.js.map → chunk-YC5GAO35.js.map} +0 -0
- /package/dist/{chunk-5TF2AFDM.js.map → chunk-ZCRPESQX.js.map} +0 -0
- /package/dist/{chunk-5IKQ6RU4.js.map → chunk-ZOQ2XKXF.js.map} +0 -0
package/dist/settings.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/settings/index.ts","../src/settings/host.tsx","../src/host-link.tsx","../src/stand-in-notice.ts","../src/tap-target/link.ts","../src/settings/searchIdentity.ts","../src/settings/SettingsDesignProvider.tsx","../src/icons.tsx","../src/cn.ts","../src/controls/surfaces.tsx","../src/button.tsx","../src/floating-layer.tsx","../src/title-tooltips.ts","../src/motion.ts","../src/portal-container.tsx","../src/focus-return.ts","../src/controls/controls.tsx","../src/solid-surface.ts","../src/select.tsx","../src/field-surface.ts","../src/controls/icon-only.ts","../src/textarea.tsx","../src/settings/SettingsNavigationRow.tsx","../src/settings/SettingsPage.tsx","../src/settings/SettingsRow.tsx","../src/settings/SettingsSectionContext.tsx","../src/tap-target/tap-buttons.tsx","../src/tap-target/tap-target-button.tsx","../src/tooltip.tsx","../src/tap-target/tap-target-guard.ts","../src/layout-scale.ts","../src/tap-target/tap-surface.tsx","../src/tap-target/tap-features.tsx","../src/tap-target/tap-default-variant.tsx","../src/settings/layout/SettingsCallout.tsx","../src/settings/layout/SettingsGrid.tsx","../src/settings/layout/SettingsReadOnlyValue.tsx","../src/settings/layout/SettingsSection.tsx","../src/settings/layout/SettingsSubHeader.tsx","../src/settings/navigation/SettingsFlatNavigation.tsx","../src/settings/primitives/SettingsButton.tsx","../src/settings/primitives/SettingsCheckbox.tsx","../src/checkbox.tsx","../src/settings/primitives/SettingsColorPicker.tsx","../src/settings/primitives/SettingsDeviceSelect.tsx","../src/settings/primitives/SettingsKeybinding.tsx","../src/settings/primitives/SettingsLink.tsx","../src/settings/primitives/SettingsMultiSelect.tsx","../src/popover.tsx","../src/settings/primitives/SettingsNumberInput.tsx","../src/settings/primitives/SettingsRadioGroup.tsx","../src/settings/primitives/SettingsSegmented.tsx","../src/settings/primitives/SettingsSelect.tsx","../src/command.tsx","../src/close-slot.tsx","../src/radix-dialog-modal-context.tsx","../src/use-is-mobile.ts","../src/settings/primitives/SettingsSlider.tsx","../src/slider.tsx","../src/settings/primitives/SettingsSwitch.tsx","../src/settings/primitives/SettingsTextInput.tsx","../src/settings/tree/types.ts","../src/settings/tree/SettingsBreadcrumb.tsx","../src/settings/tree/SettingsDrawerNav.tsx","../src/drawer.tsx","../src/settings/tree/SettingsTree.tsx"],"sourcesContent":["\"use client\";\n\n/**\n * @ai-matrx/design-system/settings — THE SETTINGS BLOCKS: rows, sections, controls and navigation\n * every settings screen is made of. Bind the app once with `configureSettings(...)` (see ./host).\n *\n * App-coupled controls (the model picker, the PRO text areas, the Tailwind color picker) stay in\n * the app and compose `SettingsRow` from here.\n */\nexport * from \"./host\";\nexport * from \"./icon-type\";\nexport * from \"./types\";\nexport * from \"./searchIdentity\";\nexport * from \"./SettingsDesignProvider\";\nexport * from \"./SettingsNavigationRow\";\nexport * from \"./SettingsPage\";\nexport * from \"./SettingsRow\";\nexport * from \"./SettingsSectionContext\";\nexport * from \"./layout/SettingsCallout\";\nexport * from \"./layout/SettingsGrid\";\nexport * from \"./layout/SettingsReadOnlyValue\";\nexport * from \"./layout/SettingsSection\";\nexport * from \"./layout/SettingsSubHeader\";\nexport * from \"./navigation/SettingsFlatNavigation\";\nexport * from \"./primitives/SettingsButton\";\nexport * from \"./primitives/SettingsCheckbox\";\nexport * from \"./primitives/SettingsColorPicker\";\nexport * from \"./primitives/SettingsDeviceSelect\";\nexport * from \"./primitives/SettingsKeybinding\";\nexport * from \"./primitives/SettingsLink\";\nexport * from \"./primitives/SettingsMultiSelect\";\nexport * from \"./primitives/SettingsNumberInput\";\nexport * from \"./primitives/SettingsRadioGroup\";\nexport * from \"./primitives/SettingsSegmented\";\nexport * from \"./primitives/SettingsSelect\";\nexport * from \"./primitives/SettingsSlider\";\nexport * from \"./primitives/SettingsSwitch\";\nexport * from \"./primitives/SettingsTextInput\";\nexport * from \"./tree/SettingsBreadcrumb\";\nexport * from \"./tree/SettingsDrawerNav\";\nexport * from \"./tree/SettingsTree\";\nexport * from \"./tree/types\";\n","\"use client\";\n\n/**\n * src/settings/host.tsx — THE SETTINGS HOST: what the settings blocks need from the app that draws them.\n *\n * Settings rows are drawn inside routes, windows and drawers, far from any provider, so — like\n * the entity-ref host — this one is bound ONCE per page through `configureSettings(...)` (a\n * module-level slot on `globalThis`, so every module-graph copy of the package reads one binding).\n *\n * Each port has a default that ANNOUNCES ITSELF instead of pretending:\n *\n * Link the app's router link (basePath/deployment aware). Default: the registered tap-target\n * link component, else a plain <a>.\n * ErrorMenu the actions drawn beside a KNOWN refusal. Default: none.\n * Anchor wraps one control so a deep link (`?control=` / `#id`) can reveal and focus it.\n * Default: a plain div carrying the ids, with no reveal behaviour.\n * useNavigate a HOOK returning the presentation-aware navigate function (a settings window\n * closes itself after the push). Default: a full-page navigation.\n * copyNotify where a copy's outcome is told. Default: silent (kit's useClipboard contract).\n *\n * Unconfigured, the default anchor carries `data-settings-host=\"unconfigured\"` and the first draw\n * warns once in the console, naming `configureSettings`. The host MUST be configured before the first\n * render: `useNavigate` is a hook, and a component's hook count cannot change between renders.\n */\n\nimport type { ComponentType, MouseEvent as ReactMouseEvent, ReactNode, Ref } from \"react\";\nimport { globalSlot } from \"@ai-matrx/kit/global-slot\";\nimport { HostLink } from \"../host-link\";\n\nexport interface SettingsLinkAnchorProps {\n href: string;\n id?: string | undefined;\n className?: string | undefined;\n onClick?: ((event: ReactMouseEvent<HTMLAnchorElement>) => void) | undefined;\n children?: ReactNode;\n ref?: Ref<HTMLAnchorElement> | undefined;\n}\n\nexport type SettingsNavigateFn = (\n href: string,\n event?: ReactMouseEvent | MouseEvent | null,\n) => void;\n\nexport interface SettingsHost {\n Link?: ComponentType<SettingsLinkAnchorProps> | undefined;\n ErrorMenu?: ComponentType<{ error: unknown }> | undefined;\n Anchor?: ComponentType<{ id: string; children: ReactNode }> | undefined;\n useNavigate?: (() => SettingsNavigateFn) | undefined;\n copyNotify?: ((message: string, kind: \"success\" | \"error\") => void) | undefined;\n}\n\nconst bound = globalSlot(\"ai-matrx.design-system.settings-host\", () => ({ host: null as SettingsHost | null }));\n\n/** Bind the app's settings host. Call once, at module load, before anything renders. */\nexport function configureSettings(host: SettingsHost | null): void {\n bound.host = host;\n}\n\n/** True once a host has been bound. */\nexport function settingsConfigured(): boolean {\n return Boolean(bound.host);\n}\n\nlet warned = false;\nfunction announceUnconfigured(): void {\n if (warned) return;\n warned = true;\n if (typeof console !== \"undefined\") {\n console.warn(\n \"[@ai-matrx/design-system/settings] no host configured: settings links navigate with full page loads, \" +\n \"controls cannot be deep-linked and refusals show no actions. Call configureSettings(...) once before the first render.\",\n );\n }\n}\n\nfunction DefaultAnchor({ id, children }: { id: string; children: ReactNode }) {\n announceUnconfigured();\n return (\n <div\n id={id}\n data-setting-control={id}\n data-setting-search-key={id}\n data-settings-host=\"unconfigured\"\n tabIndex={-1}\n className=\"@container/settings scroll-mt-20 outline-none\"\n >\n {children}\n </div>\n );\n}\n\n// No settings-specific Link: the one internal-link seam is HostLink (the registered tap-target link).\nfunction DefaultLink({ ref, ...rest }: SettingsLinkAnchorProps) {\n return <HostLink ref={ref as Ref<HTMLAnchorElement> | undefined} {...rest} />;\n}\n\nfunction useDefaultNavigate(): SettingsNavigateFn {\n announceUnconfigured();\n return (href, event) => {\n if (event && \"preventDefault\" in event) event.preventDefault();\n if (typeof window !== \"undefined\") window.location.assign(href);\n };\n}\n\n/** The Link the settings blocks draw. */\nexport function SettingsHostLink(props: SettingsLinkAnchorProps) {\n const Link = bound.host?.Link ?? DefaultLink;\n return <Link {...props} />;\n}\n\n/** The actions beside a known refusal; nothing until the host binds one. */\nexport function SettingsHostErrorMenu({ error }: { error: unknown }) {\n const Menu = bound.host?.ErrorMenu;\n return Menu ? <Menu error={error} /> : null;\n}\n\n/** Wraps one control so a deep link can reveal it. */\nexport function SettingsHostAnchor(props: { id: string; children: ReactNode }) {\n const Anchor = bound.host?.Anchor ?? DefaultAnchor;\n return <Anchor {...props} />;\n}\n\n/** The presentation-aware navigate function (a HOOK — see the header). */\nexport function useSettingsHostNavigate(): SettingsNavigateFn {\n const hook = bound.host?.useNavigate ?? useDefaultNavigate;\n return hook();\n}\n\n/** The copy notifier the host bound, if any. */\nexport function settingsCopyNotify(): ((message: string, kind: \"success\" | \"error\") => void) | undefined {\n return bound.host?.copyNotify;\n}\n","\"use client\";\n\n/**\n * HostLink — the link the design-system's own components draw for an internal destination (a KPI\n * tile that opens its records, a dock tab, a card that opens a page).\n *\n * It is NOT a new seam: it resolves the tap-target link component the host registered once with\n * `setTapTargetLinkComponent` (`tap-target/link.ts`, the same slot the tap buttons and the settings\n * blocks use). A host that routes through its own link door (cross-deployment aware, prefetch rules)\n * registers THAT door there, and every component here inherits it.\n *\n * Nothing registered: a plain `<a>` (a working link, a full page load) that says so — one console\n * notice and `data-link-host=\"unconfigured\"` on what it draws.\n */\n\nimport * as React from \"react\";\n\nimport { announceStandIn, UNCONFIGURED } from \"./stand-in-notice\";\nimport { getTapTargetLinkComponent } from \"./tap-target/link\";\n\nexport interface HostLinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"href\"> {\n href: string;\n prefetch?: boolean | null;\n}\n\nexport const HostLink = React.forwardRef<HTMLAnchorElement, HostLinkProps>(function HostLink(\n { href, prefetch, ...rest },\n ref,\n) {\n const Registered = getTapTargetLinkComponent() as unknown as React.ComponentType<\n HostLinkProps & { ref?: React.Ref<HTMLAnchorElement> }\n > | null;\n if (Registered) {\n return <Registered ref={ref} href={href} {...(prefetch === undefined ? {} : { prefetch })} {...rest} />;\n }\n announceStandIn(\n \"link-host\",\n \"HostLink drew a plain <a>: register the app's link component once with setTapTargetLinkComponent() from @ai-matrx/design-system/tap-target.\",\n );\n return <a ref={ref} href={href} data-link-host={UNCONFIGURED} {...rest} />;\n});\n","/**\n * A STAND-IN ANNOUNCES ITSELF (law 4). Where a design-system component has a working default for a\n * part the host is meant to supply (the writing box, the sandbox panel, how a scope is drawn), the\n * default says so: ONE console notice per stand-in naming what to pass, and a `data-*=\"unconfigured\"`\n * attribute on what it draws. The pattern is records-ui's `data-entity-ref-host=\"unconfigured\"` and\n * settings' `data-settings-host=\"unconfigured\"`.\n */\nconst announced = new Set<string>();\n\n/** Warn once per `key`, in words naming the field the host should pass. */\nexport function announceStandIn(key: string, message: string): void {\n if (announced.has(key)) return;\n announced.add(key);\n console.warn(`[design-system] ${message}`);\n}\n\n/** Test seam: forget every notice that was printed. */\nexport function _resetStandInNotices(): void {\n announced.clear();\n}\n\n/** The value every stand-in's data attribute carries. */\nexport const UNCONFIGURED = \"unconfigured\" as const;\n","import type { ComponentType, ReactNode, Ref } from \"react\";\n\n/**\n * The injectable link seam — the package's replacement for the original\n * hard `next/link` import.\n *\n * Internal hrefs (anything NOT matching `http(s):`, `mailto:`, `tel:`) render\n * through the link component resolved here; external hrefs always render a\n * plain `<a target=\"_blank\" rel=\"noopener noreferrer\">`, exactly like the\n * original. When nothing is registered and no per-instance `linkComponent`\n * prop is given, internal hrefs fall back to a plain `<a>` (no prefetch, no\n * client-side routing — still a working link).\n */\nexport interface TapTargetLinkProps {\n href: string;\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\" | undefined;\n rel?: string | undefined;\n /** Router prefetch hint (next/link semantics). Plain `<a>` fallback ignores it. */\n prefetch?: boolean | null | undefined;\n \"aria-label\"?: string | undefined;\n /** Tooltip text drawn through `title` (the provider's title takeover). */\n title?: string | undefined;\n className?: string | undefined;\n children?: ReactNode;\n /** The trigger's ref (the development guard measures the rendered link).\n * next/link forwards it to its `<a>`. */\n ref?: Ref<HTMLAnchorElement> | undefined;\n}\n\nexport type TapTargetLinkComponent = ComponentType<TapTargetLinkProps>;\n\n/**\n * The registered component lives in a `Symbol.for` slot on `globalThis` — NOT\n * in module state — so it survives the module graph being instantiated more\n * than once: the `.` and `./buttons` dist bundles each inline the primitives\n * (tsup `splitting: false`), and a consumer may even mix `import` and\n * `require`. One registration must reach every copy.\n */\nconst LINK_SLOT = Symbol.for(\"@ai-matrx/tap-target:link-component\");\n\ntype GlobalWithLinkSlot = typeof globalThis & {\n [LINK_SLOT]?: TapTargetLinkComponent | null;\n};\n\n/**\n * Register the app's link component once at startup (e.g. `next/link`):\n *\n * ```tsx\n * import Link from \"next/link\";\n * import { setTapTargetLinkComponent } from \"@ai-matrx/tap-target\";\n * setTapTargetLinkComponent(Link);\n * ```\n *\n * Pass `null` to unregister (plain `<a>` fallback resumes).\n */\nexport function setTapTargetLinkComponent(\n component: TapTargetLinkComponent | null,\n): void {\n (globalThis as GlobalWithLinkSlot)[LINK_SLOT] = component;\n}\n\n/** The currently registered link component, or `null` when none is set. */\nexport function getTapTargetLinkComponent(): TapTargetLinkComponent | null {\n return (globalThis as GlobalWithLinkSlot)[LINK_SLOT] ?? null;\n}\n","/**\n * Stable deep-link identity for an authored setting. This is deliberately\n * separate from the React input id: controls remount, while setting doors and\n * bookmarked search results must keep resolving to the same row.\n */\nexport function settingsControlSearchId(sectionTitle: string, label: string): string {\n const slug = (value: string) =>\n value\n .normalize(\"NFKD\")\n .replace(/[\\u0300-\\u036f]/g, \"\")\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/(^-|-$)/g, \"\") || \"setting\";\n return `settings-control-${slug(sectionTitle)}-${slug(label)}`;\n}\n","\"use client\";\n\nimport { createContext, useContext } from \"react\";\nimport type { ReactNode } from \"react\";\n\nexport type SettingsDesignVariant = \"standard\" | \"compact\";\nexport type SettingsDesignProviderProps = {\n children: ReactNode;\n variant?: SettingsDesignVariant;\n};\n\nconst SettingsDesignContext = createContext<SettingsDesignVariant>(\"standard\");\n\n/**\n * Applies a presentation density to the local settings primitive family.\n * Omit it for existing embeddings, which retain the standard presentation.\n */\nexport function SettingsDesignProvider({\n children,\n variant = \"standard\",\n}: SettingsDesignProviderProps) {\n return (\n <SettingsDesignContext.Provider value={variant}>\n {children}\n </SettingsDesignContext.Provider>\n );\n}\n\nexport function useSettingsDesign() {\n return { variant: useContext(SettingsDesignContext) } as const;\n}\n","/**\n * Internal inlined SVG icons (policy C19: no icon-library dependency, ever).\n *\n * Each icon is copied from the exact glyph the ported originals rendered:\n * lucide-react's Loader2 / ChevronLeft / ChevronRight / MoreHorizontal and\n * @radix-ui/react-icons' Cross2Icon. Same viewBoxes, same paths, same default\n * stroke geometry — a host swapping the import sees pixel-identical output.\n *\n * Not exported from the package entry; components consume them directly.\n */\n\nimport * as React from \"react\";\n\nexport type IconProps = React.SVGAttributes<SVGSVGElement>;\n\n/**\n * Every lucide glyph carries `lucide-<name>`, the class lucide-react itself renders: THE OPTICAL\n * GLYPH TRIM (tap-target.css) reads the glyph's real air from it, and a caller's own class follows it.\n */\nfunction lucideProps(name: string, { className, ...props }: IconProps): React.SVGAttributes<SVGSVGElement> {\n return {\n className: className ? `lucide-${name} ${className}` : `lucide-${name}`,\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n \"aria-hidden\": true,\n ...props,\n };\n}\n\n/**\n * lucide `loader-2` — the spinner glyph. Callers add `matrx-spin`.\n * Never a resting icon: at rest this incomplete arc reads as a broken\n * half-circle. Refresh controls use arrows, then swap to this only while busy.\n */\nexport function Loader2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"loader-circle\", props)}>\n <path d=\"M21 12a9 9 0 1 1-6.219-8.56\" />\n </svg>\n );\n}\n\n/** lucide `chevron-left`. */\nexport function ChevronLeftIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevron-left\", props)}>\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n );\n}\n\n/** lucide `chevron-right`. */\nexport function ChevronRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevron-right\", props)}>\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n );\n}\n\n/** lucide `chevron-down` — the disclosure's open glyph. */\nexport function ChevronDownIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevron-down\", props)}>\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n );\n}\n\n/** lucide `trash-2` (moved from @ai-matrx/agents). */\nexport function Trash2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"trash-2\", props)}>\n <path d=\"M10 11v6\" />\n <path d=\"M14 11v6\" />\n <path d=\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\" />\n <path d=\"M3 6h18\" />\n <path d=\"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\" />\n </svg>\n );\n}\n\n/** lucide `archive` — the archived-rows glyph (ArchivedDisclosure). */\nexport function ArchiveIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"archive\", props)}>\n <rect width=\"20\" height=\"5\" x=\"2\" y=\"3\" rx=\"1\" />\n <path d=\"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8\" />\n <path d=\"M10 12h4\" />\n </svg>\n );\n}\n\n/** lucide `more-horizontal` — the kebab/ellipsis glyph. */\nexport function MoreHorizontalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"ellipsis\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"1\" />\n <circle cx=\"19\" cy=\"12\" r=\"1\" />\n <circle cx=\"5\" cy=\"12\" r=\"1\" />\n </svg>\n );\n}\n\n/** lucide `check` — the selected-row tick (CreatablePicker). */\nexport function CheckIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"check\", props)}>\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n );\n}\n\n/** lucide `chevrons-up-down` — the combobox trigger glyph. */\nexport function ChevronsUpDownIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevrons-up-down\", props)}>\n <path d=\"m7 15 5 5 5-5\" />\n <path d=\"m7 9 5-5 5 5\" />\n </svg>\n );\n}\n\n/** lucide `external-link` — the manage-in-new-tab glyph. */\nexport function ExternalLinkIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"external-link\", props)}>\n <path d=\"M15 3h6v6\" />\n <path d=\"M10 14 21 3\" />\n <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" />\n </svg>\n );\n}\n\n/** lucide `lock` — the platform-governed vocabulary glyph. */\nexport function LockIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"lock\", props)}>\n <rect width=\"18\" height=\"11\" x=\"3\" y=\"11\" rx=\"2\" ry=\"2\" />\n <path d=\"M7 11V7a5 5 0 0 1 10 0v4\" />\n </svg>\n );\n}\n\n/** lucide `pencil` — the edit glyph (the table card's Edit action). */\nexport function PencilIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"pencil\", props)}>\n <path d=\"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z\" />\n <path d=\"m15 5 4 4\" />\n </svg>\n );\n}\n\n/** lucide `message-square` — a row's comments (records-ui SectionCard). */\nexport function MessageSquareIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"message-square\", props)}>\n <path d=\"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z\" />\n </svg>\n );\n}\n\n/** lucide `sticky-note` — a row's usage note (records-ui SectionCard). */\nexport function StickyNoteIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sticky-note\", props)}>\n <path d=\"M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z\" />\n <path d=\"M15 3v4a2 2 0 0 0 2 2h4\" />\n </svg>\n );\n}\n\n/** lucide `minus` — the decrease glyph (NumberStepper). */\nexport function MinusIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"minus\", props)}>\n <path d=\"M5 12h14\" />\n </svg>\n );\n}\n\n/** lucide `plus` — the create/add glyph. */\nexport function PlusIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"plus\", props)}>\n <path d=\"M5 12h14\" />\n <path d=\"M12 5v14\" />\n </svg>\n );\n}\n\n/** lucide `search` — the magnifier (the `@ai-matrx/design-system/icons` section). */\nexport function SearchIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"search\", props)}>\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"m21 21-4.3-4.3\" />\n </svg>\n );\n}\n\n/** lucide `list-filter` — a table's filter button (Mail's and Finder's filter). */\nexport function ListFilterIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"list-filter\", props)}>\n <path d=\"M3 6h18\" />\n <path d=\"M7 12h10\" />\n <path d=\"M10 18h4\" />\n </svg>\n );\n}\n\n/** lucide `pin` — pinned state (the `@ai-matrx/design-system/icons` section). */\nexport function PinIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"pin\", props)}>\n <path d=\"M12 17v5\" />\n <path d=\"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z\" />\n </svg>\n );\n}\n\n/** lucide `x` — the dialog close glyph (host dialog module used lucide X). */\nexport function XIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"x\", props)}>\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n );\n}\n\n/**\n * @radix-ui/react-icons components default to width/height 15 — the bare\n * `<ChevronUpIcon />` renders in Select's scroll buttons rely on it.\n */\nfunction radixProps(props: IconProps): React.SVGAttributes<SVGSVGElement> {\n return {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 15 15\",\n width: 15,\n height: 15,\n fill: \"none\",\n \"aria-hidden\": true,\n ...props,\n };\n}\n\n/** @radix-ui/react-icons `MagnifyingGlassIcon` — the command search glyph. */\nexport function MagnifyingGlassIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** @radix-ui/react-icons `CheckIcon` — the select item indicator glyph. */\nexport function RadixCheckIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/**\n * @radix-ui/react-icons `DividerHorizontalIcon` — the INDETERMINATE checkbox\n * glyph. Radix renders the indicator for both `true` and `\"indeterminate\"`, so\n * a half-selected \"select all\" that shows a full check states something false;\n * the two states get different glyphs on purpose.\n */\nexport function DividerHorizontalIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M2 7.5C2 7.22386 2.22386 7 2.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H2.5C2.22386 8 2 7.77614 2 7.5Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** @radix-ui/react-icons `DotFilledIcon` — the menu radio-item indicator. */\nexport function DotFilledIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z\"\n fill=\"currentColor\"\n />\n </svg>\n );\n}\n\n/** @radix-ui/react-icons `ChevronRightIcon` — the submenu-trigger glyph. */\nexport function RadixChevronRightIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** @radix-ui/react-icons `ChevronDownIcon` — the select trigger/scroll glyph. */\nexport function RadixChevronDownIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** @radix-ui/react-icons `ChevronUpIcon` — the select scroll-up glyph. */\nexport function RadixChevronUpIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** @radix-ui/react-icons `Cross2Icon` — the dialog/sheet close glyph. */\nexport function Cross2Icon(props: IconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 15 15\"\n fill=\"none\"\n aria-hidden\n {...props}\n >\n <path\n d=\"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/**\n * @radix-ui/react-icons `DragHandleDots2Icon` — the grip on `ResizableHandle`.\n * Inlined per C19: this package depends on no icon library.\n */\nexport function DragHandleDots2Icon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M4.5 2.5C5.05228 2.5 5.5 2.05228 5.5 1.5C5.5 0.947715 5.05228 0.5 4.5 0.5C3.94772 0.5 3.5 0.947715 3.5 1.5C3.5 2.05228 3.94772 2.5 4.5 2.5ZM4.5 6.5C5.05228 6.5 5.5 6.05229 5.5 5.5C5.5 4.94771 5.05228 4.5 4.5 4.5C3.94772 4.5 3.5 4.94771 3.5 5.5C3.5 6.05229 3.94772 6.5 4.5 6.5ZM5.5 9.5C5.5 10.0523 5.05228 10.5 4.5 10.5C3.94772 10.5 3.5 10.0523 3.5 9.5C3.5 8.94771 3.94772 8.5 4.5 8.5C5.05228 8.5 5.5 8.94771 5.5 9.5ZM4.5 14.5C5.05228 14.5 5.5 14.0523 5.5 13.5C5.5 12.9477 5.05228 12.5 4.5 12.5C3.94772 12.5 3.5 12.9477 3.5 13.5C3.5 14.0523 3.94772 14.5 4.5 14.5ZM11.5 1.5C11.5 2.05228 11.0523 2.5 10.5 2.5C9.94771 2.5 9.5 2.05228 9.5 1.5C9.5 0.947715 9.94771 0.5 10.5 0.5C11.0523 0.5 11.5 0.947715 11.5 1.5ZM10.5 6.5C11.0523 6.5 11.5 6.05229 11.5 5.5C11.5 4.94771 11.0523 4.5 10.5 4.5C9.94771 4.5 9.5 4.94771 9.5 5.5C9.5 6.05229 9.94771 6.5 10.5 6.5ZM11.5 9.5C11.5 10.0523 11.0523 10.5 10.5 10.5C9.94771 10.5 9.5 10.0523 9.5 9.5C9.5 8.94771 9.94771 8.5 10.5 8.5C11.0523 8.5 11.5 8.94771 11.5 9.5ZM10.5 14.5C11.0523 14.5 11.5 14.0523 11.5 13.5C11.5 12.9477 11.0523 12.5 10.5 12.5C9.94771 12.5 9.5 12.9477 9.5 13.5C9.5 14.0523 9.94771 14.5 10.5 14.5Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** lucide `star` — the saved-organization badge (OrganizationPicker). */\nexport function StarIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"star\", props)}>\n <path d=\"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z\" />\n </svg>\n );\n}\n\n/** lucide `building-2` — the organization glyph (OrganizationPicker trigger). */\nexport function Building2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"building-2\", props)}>\n <path d=\"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z\" />\n <path d=\"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2\" />\n <path d=\"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2\" />\n <path d=\"M10 6h4\" />\n <path d=\"M10 10h4\" />\n <path d=\"M10 14h4\" />\n <path d=\"M10 18h4\" />\n </svg>\n );\n}\n\n/** lucide `panel-left` — the sidebar toggle glyph. */\nexport function PanelLeftIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"panel-left\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M9 3v18\" />\n </svg>\n );\n}\n\n/** lucide `ellipsis-vertical` — a panel's \"more\" menu. */\nexport function MoreVerticalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"ellipsis-vertical\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"1\" />\n <circle cx=\"12\" cy=\"5\" r=\"1\" />\n <circle cx=\"12\" cy=\"19\" r=\"1\" />\n </svg>\n );\n}\n\n/** lucide `maximize-2` — expand a panel. */\nexport function Maximize2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"maximize-2\", props)}>\n <path d=\"M15 3h6v6\" />\n <path d=\"m21 3-7 7\" />\n <path d=\"m3 21 7-7\" />\n <path d=\"M9 21H3v-6\" />\n </svg>\n );\n}\n\n/** lucide `minimize-2` — restore an expanded panel. */\nexport function Minimize2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"minimize-2\", props)}>\n <path d=\"m14 10 7-7\" />\n <path d=\"M20 10h-6V4\" />\n <path d=\"m3 21 7-7\" />\n <path d=\"M4 14h6v6\" />\n </svg>\n );\n}\n\n/** lucide `arrow-left`. */\nexport function ArrowLeftIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-left\", props)}>\n <path d=\"m12 19-7-7 7-7\" />\n <path d=\"M19 12H5\" />\n </svg>\n );\n}\n\n/** lucide `arrow-right`. */\nexport function ArrowRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-right\", props)}>\n <path d=\"M5 12h14\" />\n <path d=\"m12 5 7 7-7 7\" />\n </svg>\n );\n}\n\n/** lucide `arrow-up` — the swipe deck's up edge. */\nexport function ArrowUpIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-up\", props)}>\n <path d=\"m5 12 7-7 7 7\" />\n <path d=\"M12 19V5\" />\n </svg>\n );\n}\n\n/** lucide `arrow-down` — the swipe deck's down edge. */\nexport function ArrowDownIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-down\", props)}>\n <path d=\"M12 5v14\" />\n <path d=\"m19 12-7 7-7-7\" />\n </svg>\n );\n}\n\n/** lucide `undo-2` — take back the last change. */\nexport function Undo2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"undo-2\", props)}>\n <path d=\"M9 14 4 9l5-5\" />\n <path d=\"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11\" />\n </svg>\n );\n}\n\n/** lucide `eraser` — forget a marked part. */\nexport function EraserIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"eraser\", props)}>\n <path d=\"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21\" />\n <path d=\"M22 21H7\" />\n <path d=\"m5 11 9 9\" />\n </svg>\n );\n}\n\n/** lucide `rotate-cw` — reload. */\nexport function RotateCwIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"rotate-cw\", props)}>\n <path d=\"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8\" />\n <path d=\"M21 3v5h-5\" />\n </svg>\n );\n}\n\n/** lucide `globe` — a web page with no favicon. */\nexport function GlobeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"globe\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20\" />\n <path d=\"M2 12h20\" />\n </svg>\n );\n}\n\n/** lucide `calendar` — the date field's glyph. */\nexport function CalendarIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"calendar\", props)}>\n <path d=\"M8 2v4\" />\n <path d=\"M16 2v4\" />\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"4\" rx=\"2\" />\n <path d=\"M3 10h18\" />\n </svg>\n );\n}\n\n/** lucide `clock` — the time field's glyph. */\nexport function ClockIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"clock\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <polyline points=\"12 6 12 12 16 14\" />\n </svg>\n );\n}\n\n/** lucide `refresh-cw` — retry / reload. */\nexport function RefreshCwIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"refresh-cw\", props)}>\n <path d=\"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\" />\n <path d=\"M21 3v5h-5\" />\n <path d=\"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\" />\n <path d=\"M8 16H3v5\" />\n </svg>\n );\n}\n\n/** lucide `triangle-alert` (alias `AlertTriangle`) — an error or warning. */\nexport function AlertTriangleIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"triangle-alert\", props)}>\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n </svg>\n );\n}\n\n/** lucide `circle-check` — a passing state. */\nexport function CircleCheckIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"circle-check\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"m16 9-5.5 5.5L8 12\" />\n </svg>\n );\n}\n\n/** lucide `circle-question-mark` (alias `CircleHelp`) — field help. */\nexport function CircleHelpIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"circle-question-mark\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n );\n}\n\n/** lucide `circle-x` — a failing state. */\nexport function CircleXIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"circle-x\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"m15 9-6 6\" />\n <path d=\"m9 9 6 6\" />\n </svg>\n );\n}\n\n/** lucide `info` — a row label's help glyph (controls `PropertyRow`). */\nexport function InfoIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"info\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4\" />\n <path d=\"M12 8h.01\" />\n </svg>\n );\n}\n\n/** lucide `circle-dot` — the \"Get help from Matrx AI\" button glyph (controls `HelpIcon`). */\nexport function CircleDotIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"circle-dot\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <circle cx=\"12\" cy=\"12\" r=\"1\" />\n </svg>\n );\n}\n\n/** lucide `copy` — the Peek's token chip (copy the exact token). */\nexport function CopyIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"copy\", props)}>\n <rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n <path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" />\n </svg>\n );\n}\n\n/** lucide `upload` (moved from @ai-matrx/media). */\nexport function UploadIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"upload\", props)}>\n <path d=\"M12 3v12\" />\n <path d=\"m17 8-5-5-5 5\" />\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n </svg>\n );\n}\n\n/** lucide `circle-alert` — an error or attention state. */\nexport function CircleAlertIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"circle-alert\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <line x1=\"12\" x2=\"12\" y1=\"8\" y2=\"12\" />\n <line x1=\"12\" x2=\"12.01\" y1=\"16\" y2=\"16\" />\n </svg>\n );\n}\n\n/** lucide `panel-right` — a side pane toggle. */\nexport function PanelRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"panel-right\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M15 3v18\" />\n </svg>\n );\n}\n\n/** lucide `bell` — notifications. */\nexport function BellIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"bell\", props)}>\n <path d=\"M10.268 21a2 2 0 0 0 3.464 0\" />\n <path d=\"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326\" />\n </svg>\n );\n}\n\n/** lucide `eye-off` — hidden. */\nexport function EyeOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"eye-off\", props)}>\n <path d=\"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\" />\n <path d=\"M14.084 14.158a3 3 0 0 1-4.242-4.242\" />\n <path d=\"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\" />\n <path d=\"m2 2 20 20\" />\n </svg>\n );\n}\n\n/** lucide `app-window` — open as a window. */\nexport function AppWindowIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"app-window\", props)}>\n <rect x=\"2\" y=\"4\" width=\"20\" height=\"16\" rx=\"2\" />\n <path d=\"M10 4v4\" />\n <path d=\"M2 8h20\" />\n <path d=\"M6 4v4\" />\n </svg>\n );\n}\n\n/** lucide `video` — a video call or clip. */\nexport function VideoIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"video\", props)}>\n <path d=\"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5\" />\n <rect x=\"2\" y=\"6\" width=\"14\" height=\"12\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `phone` — a voice call. */\nexport function PhoneIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"phone\", props)}>\n <path d=\"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384\" />\n </svg>\n );\n}\n\n/** lucide `sparkles` — AI. */\nexport function SparklesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sparkles\", props)}>\n <path d=\"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z\" />\n <path d=\"M20 2v4\" />\n <path d=\"M22 4h-4\" />\n <circle cx=\"4\" cy=\"20\" r=\"2\" />\n </svg>\n );\n}\n\n/** lucide `panels-top-left` — a layout. */\nexport function PanelsTopLeftIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"panels-top-left\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M3 9h18\" />\n <path d=\"M9 21V9\" />\n </svg>\n );\n}\n\n/** lucide `download`. */\nexport function DownloadIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"download\", props)}>\n <path d=\"M12 15V3\" />\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n <path d=\"m7 10 5 5 5-5\" />\n </svg>\n );\n}\n\n/** lucide `settings`. */\nexport function SettingsIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"settings\", props)}>\n <path d=\"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n );\n}\n\n/** lucide `users`. */\nexport function UsersIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"users\", props)}>\n <path d=\"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\" />\n <path d=\"M16 3.128a4 4 0 0 1 0 7.744\" />\n <path d=\"M22 21v-2a4 4 0 0 0-3-3.87\" />\n <circle cx=\"9\" cy=\"7\" r=\"4\" />\n </svg>\n );\n}\n\n/** lucide `grip-vertical` — a drag handle. */\nexport function GripVerticalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"grip-vertical\", props)}>\n <circle cx=\"9\" cy=\"12\" r=\"1\" />\n <circle cx=\"9\" cy=\"5\" r=\"1\" />\n <circle cx=\"9\" cy=\"19\" r=\"1\" />\n <circle cx=\"15\" cy=\"12\" r=\"1\" />\n <circle cx=\"15\" cy=\"5\" r=\"1\" />\n <circle cx=\"15\" cy=\"19\" r=\"1\" />\n </svg>\n );\n}\n\n/** lucide `history`. */\nexport function HistoryIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"history\", props)}>\n <path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\" />\n <path d=\"M3 3v5h5\" />\n <path d=\"M12 7v5l4 2\" />\n </svg>\n );\n}\n\n/** lucide `workflow`. */\nexport function WorkflowIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"workflow\", props)}>\n <rect width=\"8\" height=\"8\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M7 11v4a2 2 0 0 0 2 2h4\" />\n <rect width=\"8\" height=\"8\" x=\"13\" y=\"13\" rx=\"2\" />\n </svg>\n );\n}\n\n// ---- Glyphs consolidated from the packages above the design system (one glyph home). ----\n\n/** lucide `activities` (moved from @ai-matrx/meet). */\nexport function ActivitiesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"activities\", props)}>\n <path d=\"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z\" />\n <rect x=\"3\" y=\"14\" width=\"7\" height=\"7\" rx=\"1\" />\n <circle cx=\"17.5\" cy=\"17.5\" r=\"3.5\" />\n </svg>\n );\n}\n\n/** lucide `arrow-down-to-line` (moved from @ai-matrx/agents). */\nexport function ArrowDownToLineIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-down-to-line\", props)}>\n <path d=\"M12 17V3\" />\n <path d=\"m6 11 6 6 6-6\" />\n <path d=\"M19 21H5\" />\n </svg>\n );\n}\n\n/** lucide `arrow-left-right` (moved from @ai-matrx/diff). */\nexport function ArrowLeftRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-left-right\", props)}>\n <path d=\"M8 3 4 7l4 4\" />\n <path d=\"M4 7h16\" />\n <path d=\"m16 21 4-4-4-4\" />\n <path d=\"M20 17H4\" />\n </svg>\n );\n}\n\n/** lucide `arrow-left-to-line` (moved from @ai-matrx/summon). */\nexport function ArrowLeftToLineIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-left-to-line\", props)}>\n <path d=\"M3 19V5\" />\n <path d=\"m13 6-6 6 6 6\" />\n <path d=\"M7 12h14\" />\n </svg>\n );\n}\n\n/** lucide `atom` (moved from @ai-matrx/agents). */\nexport function AtomIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"atom\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"1\" />\n <path d=\"M20.2 20.2c2.04-2.03.02-7.36-4.5-11.9-4.54-4.52-9.87-6.54-11.9-4.5-2.04 2.03-.02 7.36 4.5 11.9 4.54 4.52 9.87 6.54 11.9 4.5Z\" />\n <path d=\"M15.7 15.7c4.52-4.54 6.54-9.87 4.5-11.9-2.03-2.04-7.36-.02-11.9 4.5-4.52 4.54-6.54 9.87-4.5 11.9 2.03 2.04 7.36.02 11.9-4.5Z\" />\n </svg>\n );\n}\n\n/** lucide `audio-lines` (moved from @ai-matrx/content-ir). */\nexport function AudioLinesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"audio-lines\", props)}>\n <path d=\"M2 10v3\" />\n <path d=\"M6 6v11\" />\n <path d=\"M10 3v18\" />\n <path d=\"M14 8v7\" />\n <path d=\"M18 5v13\" />\n <path d=\"M22 10v3\" />\n </svg>\n );\n}\n\n/** lucide `boxes` (moved from @ai-matrx/associations). */\nexport function BoxesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"boxes\", props)}>\n <path d=\"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z\" />\n <path d=\"m7 16.5-4.74-2.85\" />\n <path d=\"m7 16.5 5-3\" />\n <path d=\"M7 16.5v5.17\" />\n <path d=\"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z\" />\n <path d=\"m17 16.5-5-3\" />\n <path d=\"m17 16.5 4.74-2.85\" />\n <path d=\"M17 16.5v5.17\" />\n <path d=\"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z\" />\n <path d=\"M12 8 7.26 5.15\" />\n <path d=\"m12 8 4.74-2.85\" />\n <path d=\"M12 13.5V8\" />\n </svg>\n );\n}\n\n/** lucide `braces` (moved from @ai-matrx/media). */\nexport function BracesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"braces\", props)}>\n <path d=\"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1\" />\n <path d=\"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1\" />\n </svg>\n );\n}\n\n/** lucide `breakout` (moved from @ai-matrx/meet). */\nexport function BreakoutIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"breakout\", props)}>\n <rect width=\"7\" height=\"18\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"14\" rx=\"1\" />\n </svg>\n );\n}\n\n/** lucide `camera` (moved from @ai-matrx/meet). */\nexport function CameraIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"camera\", props)}>\n <path d=\"m23 7-7 5 7 5V7Z\" />\n <rect x=\"1\" y=\"5\" width=\"15\" height=\"14\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `camera-off` (moved from @ai-matrx/meet). */\nexport function CameraOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"camera-off\", props)}>\n <path d=\"M2 2l20 20\" />\n <path d=\"M10.66 5H14a2 2 0 0 1 2 2v3.34l1 1L23 7v10\" />\n <path d=\"M16 16a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h2\" />\n </svg>\n );\n}\n\n/** lucide `captions` (moved from @ai-matrx/meet). */\nexport function CaptionsIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"captions\", props)}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <path d=\"M10 10.5a2 2 0 1 0 0 3M16 10.5a2 2 0 1 0 0 3\" />\n </svg>\n );\n}\n\n/** lucide `chat-bubble` (moved from @ai-matrx/coding-sessions). */\nexport function ChatBubbleIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chat-bubble\", props)}>\n <path d=\"M20 12.5a7.5 7.5 0 0 1-10.9 6.7L4 20.5l1.3-4.6A7.5 7.5 0 1 1 20 12.5z\" />\n </svg>\n );\n}\n\n/** lucide `chat` (moved from @ai-matrx/meet). */\nexport function ChatIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chat\", props)}>\n <path d=\"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z\" />\n </svg>\n );\n}\n\n/** lucide `check-circle-2` (moved from @ai-matrx/media). */\nexport function CheckCircle2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"check-circle-2\", props)}>\n <path d=\"M21.801 10A10 10 0 1 1 17 3.335\" />\n <path d=\"m9 11 3 3L22 4\" />\n </svg>\n );\n}\n\n/** lucide `chevron-up` (moved from @ai-matrx/meet). */\nexport function ChevronUpIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevron-up\", props)}>\n <path d=\"m6 15 6-6 6 6\" />\n </svg>\n );\n}\n\n/** lucide `chevrons-down-up` (moved from @ai-matrx/diff). */\nexport function ChevronsDownUpIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevrons-down-up\", props)}>\n <path d=\"m7 20 5-5 5 5\" />\n <path d=\"m7 4 5 5 5-5\" />\n </svg>\n );\n}\n\n/** lucide `clock-3` (moved from @ai-matrx/diff). */\nexport function Clock3Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"clock-3\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 6v6h4\" />\n </svg>\n );\n}\n\n/** lucide `code-2` (moved from @ai-matrx/office). */\nexport function Code2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"code-2\", props)}>\n <path d=\"m18 16 4-4-4-4\" />\n <path d=\"m6 8-4 4 4 4\" />\n <path d=\"m14.5 4-5 16\" />\n </svg>\n );\n}\n\n/** lucide `code` (moved from @ai-matrx/media). */\nexport function CodeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"code\", props)}>\n <path d=\"m16 18 6-6-6-6\" />\n <path d=\"m8 6-6 6 6 6\" />\n </svg>\n );\n}\n\n/** lucide `columns-2` (moved from @ai-matrx/diff). */\nexport function Columns2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"columns-2\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M12 3v18\" />\n </svg>\n );\n}\n\n/** lucide `corner-down-right` (moved from @ai-matrx/associations). */\nexport function CornerDownRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"corner-down-right\", props)}>\n <polyline points=\"15 10 20 15 15 20\" />\n <path d=\"M4 4v7a4 4 0 0 0 4 4h12\" />\n </svg>\n );\n}\n\n/** lucide `database` (moved from @ai-matrx/media). */\nexport function DatabaseIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"database\", props)}>\n <ellipse cx=\"12\" cy=\"5\" rx=\"9\" ry=\"3\" />\n <path d=\"M3 5V19A9 3 0 0 0 21 19V5\" />\n <path d=\"M3 12A9 3 0 0 0 21 12\" />\n </svg>\n );\n}\n\n/** lucide `dock` (moved from @ai-matrx/canvas). */\nexport function DockIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"dock\", props)}>\n <path d=\"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6\" />\n <path d=\"M21 3 12 12\" />\n <path d=\"M12 6v6h6\" />\n </svg>\n );\n}\n\n/** lucide `expand` (moved from @ai-matrx/detail). */\nexport function ExpandIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"expand\", props)}>\n <path d=\"m15 15 6 6\" />\n <path d=\"m15 9 6-6\" />\n <path d=\"M21 16v5h-5\" />\n <path d=\"M21 8V3h-5\" />\n <path d=\"M3 16v5h5\" />\n <path d=\"m3 21 6-6\" />\n <path d=\"M3 8V3h5\" />\n <path d=\"M9 9 3 3\" />\n </svg>\n );\n}\n\n/** lucide `eye` (moved from @ai-matrx/agents). */\nexport function EyeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"eye\", props)}>\n <path d=\"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n );\n}\n\n/** lucide `file-archive` (moved from @ai-matrx/content-ir). */\nexport function FileArchiveIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-archive\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M10 6h1\" />\n <path d=\"M10 10h1\" />\n <circle cx=\"10\" cy=\"16\" r=\"2\" />\n <path d=\"M10 2v12\" />\n </svg>\n );\n}\n\n/** lucide `file-audio` (moved from @ai-matrx/media). */\nexport function FileAudioIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-audio\", props)}>\n <path d=\"M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0\" />\n </svg>\n );\n}\n\n/** lucide `file-code` (moved from @ai-matrx/media). */\nexport function FileCodeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-code\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M10 12.5 8 15l2 2.5\" />\n <path d=\"m14 12.5 2 2.5-2 2.5\" />\n </svg>\n );\n}\n\n/** lucide `file-json` (moved from @ai-matrx/media). */\nexport function FileJsonIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-json\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1\" />\n <path d=\"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1\" />\n </svg>\n );\n}\n\n/** lucide `file` (moved from @ai-matrx/media). */\nexport function FilePageIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n </svg>\n );\n}\n\n/** lucide `file-plus` (moved from @ai-matrx/content-ir). */\nexport function FilePlusIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-plus\", props)}>\n <path d=\"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4\" />\n <path d=\"M14 2v4a2 2 0 0 0 2 2h4\" />\n <path d=\"M3 15h6\" />\n <path d=\"M6 12v6\" />\n </svg>\n );\n}\n\n/** lucide `file-spreadsheet` (moved from @ai-matrx/media). */\nexport function FileSpreadsheetIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-spreadsheet\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M8 13h2\" />\n <path d=\"M14 13h2\" />\n <path d=\"M8 17h2\" />\n <path d=\"M14 17h2\" />\n </svg>\n );\n}\n\n/** lucide `file-text` (moved from @ai-matrx/media). */\nexport function FileTextIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-text\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M10 9H8\" />\n <path d=\"M16 13H8\" />\n <path d=\"M16 17H8\" />\n </svg>\n );\n}\n\n/** lucide `file-type` (moved from @ai-matrx/media). */\nexport function FileTypeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-type\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M11 18h2\" />\n <path d=\"M12 12v6\" />\n <path d=\"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5\" />\n </svg>\n );\n}\n\n/** lucide `file-video` (moved from @ai-matrx/media). */\nexport function FileVideoIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-video\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z\" />\n </svg>\n );\n}\n\n/** lucide `film` (moved from @ai-matrx/content-ir). */\nexport function FilmIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"film\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M7 3v18\" />\n <path d=\"M3 7.5h4\" />\n <path d=\"M3 12h18\" />\n <path d=\"M3 16.5h4\" />\n <path d=\"M17 3v18\" />\n <path d=\"M17 7.5h4\" />\n <path d=\"M17 16.5h4\" />\n </svg>\n );\n}\n\n/** lucide `flag` (moved from @ai-matrx/meet). */\nexport function FlagIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"flag\", props)}>\n <path d=\"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z\" />\n <line x1=\"4\" x2=\"4\" y1=\"22\" y2=\"15\" />\n </svg>\n );\n}\n\n/** lucide `flip-horizontal-2` (moved from @ai-matrx/capture). */\nexport function FlipHorizontal2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"flip-horizontal-2\", props)}>\n <path d=\"m3 7 5 5-5 5V7\" />\n <path d=\"m21 7-5 5 5 5V7\" />\n <path d=\"M12 20v2\" />\n <path d=\"M12 14v2\" />\n <path d=\"M12 8v2\" />\n <path d=\"M12 2v2\" />\n </svg>\n );\n}\n\n/** lucide `fold-vertical` (moved from @ai-matrx/diff). */\nexport function FoldVerticalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"fold-vertical\", props)}>\n <path d=\"M12 22v-6\" />\n <path d=\"M12 8V2\" />\n <path d=\"M4 12H2\" />\n <path d=\"M10 12H8\" />\n <path d=\"M16 12h-2\" />\n <path d=\"M22 12h-2\" />\n <path d=\"m15 19-3-3-3 3\" />\n <path d=\"m15 5-3 3-3-3\" />\n </svg>\n );\n}\n\n/** lucide `folder` (moved from @ai-matrx/media). */\nexport function FolderIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"folder\", props)}>\n <path d=\"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z\" />\n </svg>\n );\n}\n\n/** lucide `folder-open` (moved from @ai-matrx/media). */\nexport function FolderOpenIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"folder-open\", props)}>\n <path d=\"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2\" />\n </svg>\n );\n}\n\n/** lucide `git-merge` (moved from @ai-matrx/diff). */\nexport function GitMergeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"git-merge\", props)}>\n <circle cx=\"18\" cy=\"18\" r=\"3\" />\n <circle cx=\"6\" cy=\"6\" r=\"3\" />\n <path d=\"M6 21V9a9 9 0 0 0 9 9\" />\n </svg>\n );\n}\n\n/** lucide `graduation-cap` (moved from @ai-matrx/office). */\nexport function GraduationCapIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"graduation-cap\", props)}>\n <path d=\"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z\" />\n <path d=\"M22 10v6\" />\n <path d=\"M6 12.5V16a6 3 0 0 0 12 0v-3.5\" />\n </svg>\n );\n}\n\n/** lucide `grid-3x-3` (moved from @ai-matrx/capture). */\nexport function Grid3x3Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"grid-3x-3\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M3 9h18\" />\n <path d=\"M3 15h18\" />\n <path d=\"M9 3v18\" />\n <path d=\"M15 3v18\" />\n </svg>\n );\n}\n\n/** lucide `grip` (moved from @ai-matrx/capture). */\nexport function GripIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"grip\", props)}>\n <circle cx=\"12\" cy=\"5\" r=\"1\" />\n <circle cx=\"19\" cy=\"5\" r=\"1\" />\n <circle cx=\"5\" cy=\"5\" r=\"1\" />\n <circle cx=\"12\" cy=\"12\" r=\"1\" />\n <circle cx=\"19\" cy=\"12\" r=\"1\" />\n <circle cx=\"5\" cy=\"12\" r=\"1\" />\n <circle cx=\"12\" cy=\"19\" r=\"1\" />\n <circle cx=\"19\" cy=\"19\" r=\"1\" />\n <circle cx=\"5\" cy=\"19\" r=\"1\" />\n </svg>\n );\n}\n\n/** lucide `grip-resize` (moved from @ai-matrx/associations). */\nexport function GripResizeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"grip-resize\", props)}>\n <path d=\"M21 15 15 21\" />\n <path d=\"M21 20 20 21\" />\n </svg>\n );\n}\n\n/** lucide `hammer` (moved from @ai-matrx/agents). */\nexport function HammerIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"hammer\", props)}>\n <path d=\"m15 12-8.5 8.5c-.83.83-2.17.83-3 0 0 0 0 0 0 0a2.12 2.12 0 0 1 0-3L12 9\" />\n <path d=\"M17.64 15 22 10.64\" />\n <path d=\"m20.91 11.7-1.25-1.25c-.6-.6-.93-1.4-.93-2.25v-.86L16.01 4.6a5.56 5.56 0 0 0-3.94-1.64H9l.92.82A6.18 6.18 0 0 1 12 8.4v1.56l2 2h2.47l2.26 1.91\" />\n </svg>\n );\n}\n\n/** lucide `hand` (moved from @ai-matrx/meet). */\nexport function HandIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"hand\", props)}>\n <path d=\"M18 11V6a2 2 0 0 0-4 0v5\" />\n <path d=\"M14 10V4a2 2 0 0 0-4 0v7\" />\n <path d=\"M10 10.5V6a2 2 0 0 0-4 0v8\" />\n <path d=\"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2a8 8 0 0 1-8-8v-1a2 2 0 1 1 4 0\" />\n </svg>\n );\n}\n\n/** lucide `handoff` (moved from @ai-matrx/coding-sessions). */\nexport function HandoffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"handoff\", props)}>\n <path d=\"M5 12h12M13 7l5 5-5 5\" />\n <path d=\"M5 5v14\" />\n </svg>\n );\n}\n\n/** lucide `hash` (moved from @ai-matrx/diff). */\nexport function HashIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"hash\", props)}>\n <path d=\"M4 9h16\" />\n <path d=\"M4 15h16\" />\n <path d=\"M10 3 8 21\" />\n <path d=\"M16 3l-2 18\" />\n </svg>\n );\n}\n\n/** lucide `highlighter` (moved from @ai-matrx/diff). */\nexport function HighlighterIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"highlighter\", props)}>\n <path d=\"m9 11-6 6v3h9l3-3\" />\n <path d=\"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4\" />\n </svg>\n );\n}\n\n/** lucide `image` (moved from @ai-matrx/media). */\nexport function ImageIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"image\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" ry=\"2\" />\n <circle cx=\"9\" cy=\"9\" r=\"2\" />\n <path d=\"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21\" />\n </svg>\n );\n}\n\n/** lucide `image-off` (moved from @ai-matrx/media). */\nexport function ImageOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"image-off\", props)}>\n <line x1=\"2\" x2=\"22\" y1=\"2\" y2=\"22\" />\n <path d=\"M10.41 10.41a2 2 0 1 1-2.83-2.83\" />\n <line x1=\"13.5\" x2=\"6\" y1=\"13.5\" y2=\"21\" />\n <line x1=\"18\" x2=\"21\" y1=\"12\" y2=\"15\" />\n <path d=\"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59\" />\n <path d=\"M21 15V5a2 2 0 0 0-2-2H9\" />\n </svg>\n );\n}\n\n/** lucide `images` (moved from @ai-matrx/capture). */\nexport function ImagesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"images\", props)}>\n <path d=\"m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16\" />\n <path d=\"M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2\" />\n <circle cx=\"13\" cy=\"7\" r=\"1\" fill=\"currentColor\" />\n <rect x=\"8\" y=\"2\" width=\"14\" height=\"14\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `keyboard` (moved from @ai-matrx/meet). */\nexport function KeyboardIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"keyboard\", props)}>\n <path d=\"M10 8h.01M12 12h.01M14 8h.01M16 12h.01M18 8h.01M6 8h.01M7 16h10M8 12h.01\" />\n <rect width=\"20\" height=\"16\" x=\"2\" y=\"4\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `languages` (moved from @ai-matrx/agents). */\nexport function LanguagesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"languages\", props)}>\n <path d=\"m5 8 6 6\" />\n <path d=\"m4 14 6-6 2-3\" />\n <path d=\"M2 5h12\" />\n <path d=\"M7 2h1\" />\n <path d=\"m22 22-5-10-5 10\" />\n <path d=\"M14 18h6\" />\n </svg>\n );\n}\n\n/** lucide `layers` (moved from @ai-matrx/agents). */\nexport function LayersIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"layers\", props)}>\n <path d=\"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z\" />\n <path d=\"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12\" />\n <path d=\"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17\" />\n </svg>\n );\n}\n\n/** lucide `layout-grid` (moved from @ai-matrx/canvas). */\nexport function LayoutGridIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"layout-grid\", props)}>\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"14\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"14\" rx=\"1\" />\n </svg>\n );\n}\n\n/** lucide `link-2` (moved from @ai-matrx/media). */\nexport function Link2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"link-2\", props)}>\n <path d=\"M9 17H7A5 5 0 0 1 7 7h2\" />\n <path d=\"M15 7h2a5 5 0 1 1 0 10h-2\" />\n <line x1=\"8\" x2=\"16\" y1=\"12\" y2=\"12\" />\n </svg>\n );\n}\n\n/** lucide `list-checks` (moved from @ai-matrx/diff). */\nexport function ListChecksIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"list-checks\", props)}>\n <path d=\"m3 17 2 2 4-4\" />\n <path d=\"m3 7 2 2 4-4\" />\n <path d=\"M13 6h8\" />\n <path d=\"M13 12h8\" />\n <path d=\"M13 18h8\" />\n </svg>\n );\n}\n\n/** lucide `list` (moved from @ai-matrx/diff). */\nexport function ListIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"list\", props)}>\n <path d=\"M3 12h.01\" />\n <path d=\"M3 18h.01\" />\n <path d=\"M3 6h.01\" />\n <path d=\"M8 12h13\" />\n <path d=\"M8 18h13\" />\n <path d=\"M8 6h13\" />\n </svg>\n );\n}\n\n/** lucide `maximize` (moved from @ai-matrx/content-ir). */\nexport function MaximizeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"maximize\", props)}>\n <polyline points=\"15 3 21 3 21 9\" />\n <polyline points=\"9 21 3 21 3 15\" />\n <line x1=\"21\" x2=\"14\" y1=\"3\" y2=\"10\" />\n <line x1=\"3\" x2=\"10\" y1=\"21\" y2=\"14\" />\n </svg>\n );\n}\n\n/** lucide `megaphone` (moved from @ai-matrx/office). */\nexport function MegaphoneIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"megaphone\", props)}>\n <path d=\"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z\" />\n <path d=\"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14\" />\n <path d=\"M8 6v8\" />\n </svg>\n );\n}\n\n/** lucide `message-square-warning` (moved from @ai-matrx/office). */\nexport function MessageSquareWarningIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"message-square-warning\", props)}>\n <path d=\"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z\" />\n <path d=\"M12 15h.01\" />\n <path d=\"M12 7v4\" />\n </svg>\n );\n}\n\n/** lucide `mic` (moved from @ai-matrx/meet). */\nexport function MicIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"mic\", props)}>\n <path d=\"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z\" />\n <path d=\"M19 10v2a7 7 0 0 1-14 0v-2\" />\n <path d=\"M12 19v3\" />\n </svg>\n );\n}\n\n/** lucide `mic-off` (moved from @ai-matrx/meet). */\nexport function MicOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"mic-off\", props)}>\n <path d=\"M2 2l20 20\" />\n <path d=\"M9 9v3a3 3 0 0 0 5.12 2.12\" />\n <path d=\"M15 9.34V5a3 3 0 0 0-5.94-.6\" />\n <path d=\"M19 10v2a7 7 0 0 1-.11 1.23M5 10v2a7 7 0 0 0 11 5.66\" />\n <path d=\"M12 19v3\" />\n </svg>\n );\n}\n\n/** lucide `monitor` (moved from @ai-matrx/coding-sessions). */\nexport function MonitorIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"monitor\", props)}>\n <rect x=\"3\" y=\"4.5\" width=\"18\" height=\"12\" rx=\"2\" />\n <path d=\"M8.5 20h7M12 16.5V20\" />\n </svg>\n );\n}\n\n/** lucide `moon` (moved from @ai-matrx/coding-sessions). */\nexport function MoonIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"moon\", props)}>\n <path d=\"M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5z\" />\n </svg>\n );\n}\n\n/** lucide `music` (moved from @ai-matrx/media). */\nexport function MusicIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"music\", props)}>\n <path d=\"M9 18V5l12-2v13\" />\n <circle cx=\"6\" cy=\"18\" r=\"3\" />\n <circle cx=\"18\" cy=\"16\" r=\"3\" />\n </svg>\n );\n}\n\n/** lucide `notes` (moved from @ai-matrx/meet). */\nexport function NotesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"notes\", props)}>\n <path d=\"M4 20l1-4L16.5 4.5a2.1 2.1 0 0 1 3 3L8 19l-4 1Z\" />\n <path d=\"M14 7l3 3\" />\n </svg>\n );\n}\n\n/** lucide `package-box` (moved from @ai-matrx/media). */\nexport function PackageBoxIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"package-box\", props)}>\n <path d=\"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z\" />\n <path d=\"M12 22V12\" />\n <polyline points=\"3.29 7 12 12 20.71 7\" />\n <path d=\"m7.5 4.27 9 5.15\" />\n </svg>\n );\n}\n\n/** lucide `page` (moved from @ai-matrx/canvas). */\nexport function PageIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"page\", props)}>\n <rect x=\"4\" y=\"4\" width=\"16\" height=\"16\" rx=\"2\" />\n <path d=\"M8 9h8\" />\n <path d=\"M8 13h8\" />\n <path d=\"M8 17h5\" />\n </svg>\n );\n}\n\n/** lucide `panel-left-close` (moved from @ai-matrx/summon). */\nexport function PanelLeftCloseIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"panel-left-close\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M9 3v18\" />\n <path d=\"m16 15-3-3 3-3\" />\n </svg>\n );\n}\n\n/** lucide `pause` (moved from @ai-matrx/media). */\nexport function PauseIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"pause\", props)}>\n <rect x=\"14\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n <rect x=\"5\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n </svg>\n );\n}\n\n/** lucide `pen-tool` (moved from @ai-matrx/media). */\nexport function PenToolIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"pen-tool\", props)}>\n <path d=\"M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z\" />\n <path d=\"m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18\" />\n <path d=\"m2.3 2.3 7.286 7.286\" />\n <circle cx=\"11\" cy=\"11\" r=\"2\" />\n </svg>\n );\n}\n\n/** lucide `people` (moved from @ai-matrx/meet). */\nexport function PeopleIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"people\", props)}>\n <path d=\"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\" />\n <circle cx=\"9\" cy=\"7\" r=\"4\" />\n <path d=\"M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75\" />\n </svg>\n );\n}\n\n/** lucide `phone-off` (moved from @ai-matrx/meet). */\nexport function PhoneOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"phone-off\", props)}>\n <path d=\"M12 9c-1.6 0-3.15.25-4.6.72v3.1c0 .39-.23.74-.56.9-.98.49-1.87 1.12-2.66 1.85-.18.18-.43.28-.7.28-.28 0-.53-.11-.71-.29L.29 13.08a.99.99 0 0 1-.29-.7c0-.28.11-.53.29-.71C3.34 8.78 7.46 7 12 7s8.66 1.78 11.71 4.67c.18.18.29.43.29.71 0 .28-.11.53-.29.71l-2.48 2.48c-.18.18-.43.29-.71.29-.27 0-.52-.11-.7-.28a11.27 11.27 0 0 0-2.67-1.85.996.996 0 0 1-.56-.9v-3.1C15.15 9.25 13.6 9 12 9Z\" fill=\"currentColor\" stroke=\"none\" />\n </svg>\n );\n}\n\n/** lucide `play` (moved from @ai-matrx/media). */\nexport function PlayIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"play\", props)}>\n <path d=\"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z\" />\n </svg>\n );\n}\n\n/** lucide `poll` (moved from @ai-matrx/meet). */\nexport function PollIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"poll\", props)}>\n <line x1=\"18\" x2=\"18\" y1=\"20\" y2=\"10\" />\n <line x1=\"12\" x2=\"12\" y1=\"20\" y2=\"4\" />\n <line x1=\"6\" x2=\"6\" y1=\"20\" y2=\"14\" />\n </svg>\n );\n}\n\n/** lucide `proportions` (moved from @ai-matrx/capture). */\nexport function ProportionsIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"proportions\", props)}>\n <rect width=\"20\" height=\"16\" x=\"2\" y=\"4\" rx=\"2\" />\n <path d=\"M12 9v11\" />\n <path d=\"M2 9h13a2 2 0 0 1 2 2v9\" />\n </svg>\n );\n}\n\n/** lucide `puzzle` (moved from @ai-matrx/office). */\nexport function PuzzleIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"puzzle\", props)}>\n <path d=\"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z\" />\n </svg>\n );\n}\n\n/** lucide `question` (moved from @ai-matrx/meet). */\nexport function QuestionIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"question\", props)}>\n <path d=\"M7.9 20A9 9 0 1 0 4 16.1L2 22Z\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n );\n}\n\n/** lucide `record` (moved from @ai-matrx/meet). */\nexport function RecordIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"record\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"8\" fill=\"currentColor\" stroke=\"none\" />\n </svg>\n );\n}\n\n/** lucide `rectangle-vertical` (moved from @ai-matrx/summon). */\nexport function RectangleVerticalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"rectangle-vertical\", props)}>\n <rect width=\"12\" height=\"20\" x=\"6\" y=\"2\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `restore` (moved from @ai-matrx/associations). */\nexport function RestoreIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"restore\", props)}>\n <path d=\"M4 14h6v6\" />\n <path d=\"M20 10h-6V4\" />\n <path d=\"M14 10l7-7\" />\n <path d=\"M3 21l7-7\" />\n </svg>\n );\n}\n\n/** lucide `rotate-ccw` (moved from @ai-matrx/capture). */\nexport function RotateCcwIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"rotate-ccw\", props)}>\n <path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\" />\n <path d=\"M3 3v5h5\" />\n </svg>\n );\n}\n\n/** lucide `rows-3` (moved from @ai-matrx/diff). */\nexport function Rows3Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"rows-3\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M21 9H3\" />\n <path d=\"M21 15H3\" />\n </svg>\n );\n}\n\n/** lucide `save` (moved from @ai-matrx/summon). */\nexport function SaveIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"save\", props)}>\n <path d=\"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z\" />\n <path d=\"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7\" />\n <path d=\"M7 3v4a1 1 0 0 0 1 1h7\" />\n </svg>\n );\n}\n\n/** lucide `scale` (moved from @ai-matrx/agents). */\nexport function ScaleIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"scale\", props)}>\n <path d=\"M12 3v18\" />\n <path d=\"m19 8 3 8a5 5 0 0 1-6 0zV7\" />\n <path d=\"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1\" />\n <path d=\"m5 8 3 8a5 5 0 0 1-6 0zV7\" />\n <path d=\"M7 21h10\" />\n </svg>\n );\n}\n\n/** lucide `screen-share` (moved from @ai-matrx/meet). */\nexport function ScreenShareIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"screen-share\", props)}>\n <rect x=\"2\" y=\"3\" width=\"20\" height=\"14\" rx=\"2\" />\n <path d=\"M8 21h8M12 17v4\" />\n <path d=\"M12 13V8m0 0-2.5 2.5M12 8l2.5 2.5\" />\n </svg>\n );\n}\n\n/** lucide `server` (moved from @ai-matrx/agents). */\nexport function ServerIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"server\", props)}>\n <rect width=\"20\" height=\"8\" x=\"2\" y=\"2\" rx=\"2\" ry=\"2\" />\n <rect width=\"20\" height=\"8\" x=\"2\" y=\"14\" rx=\"2\" ry=\"2\" />\n <line x1=\"6\" x2=\"6.01\" y1=\"6\" y2=\"6\" />\n <line x1=\"6\" x2=\"6.01\" y1=\"18\" y2=\"18\" />\n </svg>\n );\n}\n\n/** lucide `settings-2` (moved from @ai-matrx/media). */\nexport function Settings2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"settings-2\", props)}>\n <path d=\"M20 7h-9\" />\n <path d=\"M14 17H5\" />\n <circle cx=\"17\" cy=\"17\" r=\"3\" />\n <circle cx=\"7\" cy=\"7\" r=\"3\" />\n </svg>\n );\n}\n\n/** lucide `share-2` (moved from @ai-matrx/media). */\nexport function Share2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"share-2\", props)}>\n <circle cx=\"18\" cy=\"5\" r=\"3\" />\n <circle cx=\"6\" cy=\"12\" r=\"3\" />\n <circle cx=\"18\" cy=\"19\" r=\"3\" />\n <line x1=\"8.59\" x2=\"15.42\" y1=\"13.51\" y2=\"17.49\" />\n <line x1=\"15.41\" x2=\"8.59\" y1=\"6.51\" y2=\"10.49\" />\n </svg>\n );\n}\n\n/** lucide `shield-alert` (moved from @ai-matrx/detail). */\nexport function ShieldAlertIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"shield-alert\", props)}>\n <path d=\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\" />\n <path d=\"M12 8v4\" />\n <path d=\"M12 16h.01\" />\n </svg>\n );\n}\n\n/** lucide `shield-check` (moved from @ai-matrx/detail). */\nexport function ShieldCheckIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"shield-check\", props)}>\n <path d=\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\" />\n <path d=\"m9 12 2 2 4-4\" />\n </svg>\n );\n}\n\n/** lucide `badge-check` — the verified mark. */\nexport function BadgeCheckIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"badge-check\", props)}>\n <path d=\"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z\" />\n <path d=\"m9 12 2 2 4-4\" />\n </svg>\n );\n}\n\n/** lucide `shield` (moved from @ai-matrx/agents). */\nexport function ShieldIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"shield\", props)}>\n <path d=\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\" />\n </svg>\n );\n}\n\n/** lucide `sidebar` (moved from @ai-matrx/coding-sessions). */\nexport function SidebarIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sidebar\", props)}>\n <rect x=\"3.5\" y=\"4.5\" width=\"17\" height=\"15\" rx=\"2.5\" />\n <path d=\"M9.5 4.5v15\" />\n </svg>\n );\n}\n\n/** lucide `sliders-horizontal` (moved from @ai-matrx/agents). */\nexport function SlidersHorizontalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sliders-horizontal\", props)}>\n <path d=\"M10 5H3\" />\n <path d=\"M12 19H3\" />\n <path d=\"M14 3v4\" />\n <path d=\"M16 17v4\" />\n <path d=\"M21 12h-9\" />\n <path d=\"M21 19h-5\" />\n <path d=\"M21 5h-7\" />\n <path d=\"M8 10v4\" />\n <path d=\"M8 12H3\" />\n </svg>\n );\n}\n\n/** lucide `smile` (moved from @ai-matrx/meet). */\nexport function SmileIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"smile\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M8 14s1.5 2 4 2 4-2 4-2\" />\n <line x1=\"9\" x2=\"9.01\" y1=\"9\" y2=\"9\" />\n <line x1=\"15\" x2=\"15.01\" y1=\"9\" y2=\"9\" />\n </svg>\n );\n}\n\n/** lucide `speaker` (moved from @ai-matrx/meet). */\nexport function SpeakerIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"speaker\", props)}>\n <path d=\"M11 5 6 9H2v6h4l5 4V5Z\" />\n <path d=\"M15.54 8.46a5 5 0 0 1 0 7.07\" />\n <path d=\"M19.07 4.93a10 10 0 0 1 0 14.14\" />\n </svg>\n );\n}\n\n/** lucide `split-down` (moved from @ai-matrx/canvas). */\nexport function SplitDownIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"split-down\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M3 12h18\" />\n </svg>\n );\n}\n\n/** lucide `spotlight` (moved from @ai-matrx/meet). */\nexport function SpotlightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"spotlight\", props)}>\n <path d=\"M12 2 15 8.5 22 9.3 17 14 18.2 21 12 17.6 5.8 21 7 14 2 9.3 9 8.5Z\" />\n </svg>\n );\n}\n\n/** lucide `stop` (moved from @ai-matrx/coding-sessions). */\nexport function StopIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"stop\", props)}>\n <rect x=\"6\" y=\"6\" width=\"12\" height=\"12\" rx=\"2\" fill=\"currentColor\" stroke=\"none\" />\n </svg>\n );\n}\n\n/** lucide `subtitles` (moved from @ai-matrx/media). */\nexport function SubtitlesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"subtitles\", props)}>\n <rect width=\"18\" height=\"14\" x=\"3\" y=\"5\" rx=\"2\" ry=\"2\" />\n <path d=\"M7 15h4M15 15h2M7 11h2M13 11h4\" />\n </svg>\n );\n}\n\n/** lucide `sun` (moved from @ai-matrx/coding-sessions). */\nexport function SunIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sun\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d=\"M12 2.5v2M12 19.5v2M4.2 4.2l1.4 1.4M18.4 18.4l1.4 1.4M2.5 12h2M19.5 12h2M4.2 19.8l1.4-1.4M18.4 5.6l1.4-1.4\" />\n </svg>\n );\n}\n\n/** lucide `sun-medium` (moved from @ai-matrx/capture). */\nexport function SunMediumIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sun-medium\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d=\"M12 3v1\" />\n <path d=\"M12 20v1\" />\n <path d=\"M3 12h1\" />\n <path d=\"M20 12h1\" />\n <path d=\"m18.364 5.636-.707.707\" />\n <path d=\"m6.343 17.657-.707.707\" />\n <path d=\"m5.636 5.636.707.707\" />\n <path d=\"m17.657 17.657.707.707\" />\n </svg>\n );\n}\n\n/** lucide `tag` (moved from @ai-matrx/associations). */\nexport function TagIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"tag\", props)}>\n <path d=\"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z\" />\n <circle cx=\"7.5\" cy=\"7.5\" r=\".5\" fill=\"currentColor\" />\n </svg>\n );\n}\n\n/** lucide `timer` (moved from @ai-matrx/capture). */\nexport function TimerIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"timer\", props)}>\n <line x1=\"10\" x2=\"14\" y1=\"2\" y2=\"2\" />\n <line x1=\"12\" x2=\"15\" y1=\"14\" y2=\"11\" />\n <circle cx=\"12\" cy=\"14\" r=\"8\" />\n </svg>\n );\n}\n\n/** lucide `type` (moved from @ai-matrx/agents). */\nexport function TypeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"type\", props)}>\n <path d=\"M12 4v16\" />\n <path d=\"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2\" />\n <path d=\"M9 20h6\" />\n </svg>\n );\n}\n\n/** lucide `unfold-vertical` (moved from @ai-matrx/diff). */\nexport function UnfoldVerticalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"unfold-vertical\", props)}>\n <path d=\"M12 22v-6\" />\n <path d=\"M12 8V2\" />\n <path d=\"M4 12H2\" />\n <path d=\"M10 12H8\" />\n <path d=\"M16 12h-2\" />\n <path d=\"M22 12h-2\" />\n <path d=\"m15 19-3 3-3-3\" />\n <path d=\"m15 5-3-3-3 3\" />\n </svg>\n );\n}\n\n/** lucide `unlink` (moved from @ai-matrx/agents). */\nexport function UnlinkIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"unlink\", props)}>\n <path d=\"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71\" />\n <path d=\"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71\" />\n <line x1=\"8\" x2=\"8\" y1=\"2\" y2=\"5\" />\n <line x1=\"2\" x2=\"5\" y1=\"8\" y2=\"8\" />\n <line x1=\"16\" x2=\"16\" y1=\"19\" y2=\"22\" />\n <line x1=\"19\" x2=\"22\" y1=\"16\" y2=\"16\" />\n </svg>\n );\n}\n\n/** lucide `upvote` (moved from @ai-matrx/meet). */\nexport function UpvoteIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"upvote\", props)}>\n <path d=\"M9 18v-6H5l7-7 7 7h-4v6H9z\" />\n </svg>\n );\n}\n\n/** lucide `variable` (moved from @ai-matrx/agents). */\nexport function VariableIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"variable\", props)}>\n <path d=\"M8 21s-4-3-4-9 4-9 4-9\" />\n <path d=\"M16 3s4 3 4 9-4 9-4 9\" />\n <line x1=\"15\" x2=\"9\" y1=\"9\" y2=\"15\" />\n <line x1=\"9\" x2=\"15\" y1=\"9\" y2=\"15\" />\n </svg>\n );\n}\n\n/** lucide `video-off` (moved from @ai-matrx/media). */\nexport function VideoOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"video-off\", props)}>\n <path d=\"M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196\" />\n <path d=\"M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2\" />\n <path d=\"m2 2 20 20\" />\n </svg>\n );\n}\n\n/** lucide `volume-x` (moved from @ai-matrx/media). */\nexport function VolumeXIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"volume-x\", props)}>\n <path d=\"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\" />\n <line x1=\"22\" x2=\"16\" y1=\"9\" y2=\"15\" />\n <line x1=\"16\" x2=\"22\" y1=\"9\" y2=\"15\" />\n </svg>\n );\n}\n\n/** lucide `webhook` (moved from @ai-matrx/agents). */\nexport function WebhookIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"webhook\", props)}>\n <path d=\"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2\" />\n <path d=\"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06\" />\n <path d=\"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8\" />\n </svg>\n );\n}\n\n/** lucide `whiteboard` (moved from @ai-matrx/meet). */\nexport function WhiteboardIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"whiteboard\", props)}>\n <path d=\"M2 3h20\" />\n <path d=\"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3\" />\n <path d=\"m7 21 5-5 5 5\" />\n </svg>\n );\n}\n\n/** lucide `wifi-low` (moved from @ai-matrx/meet). */\nexport function WifiLowIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"wifi-low\", props)}>\n <path d=\"M12 20h.01\" />\n <path d=\"M8.5 16.5a5 5 0 0 1 7 0\" />\n </svg>\n );\n}\n\n/** lucide `wrap-text` (moved from @ai-matrx/diff). */\nexport function WrapTextIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"wrap-text\", props)}>\n <path d=\"M3 6h18\" />\n <path d=\"M3 12h15a3 3 0 1 1 0 6h-4\" />\n <path d=\"m16 16-2 2 2 2\" />\n <path d=\"M3 18h7\" />\n </svg>\n );\n}\n\n/** lucide `wrench` (moved from @ai-matrx/agents). */\nexport function WrenchIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"wrench\", props)}>\n <path d=\"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z\" />\n </svg>\n );\n}\n\n/** lucide `youtube` (moved from @ai-matrx/agents). */\nexport function YoutubeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"youtube\", props)}>\n <path d=\"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17\" />\n <path d=\"m10 15 5-3-5-3z\" />\n </svg>\n );\n}\n\n/** lucide `zap` (moved from @ai-matrx/capture). */\nexport function ZapIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"zap\", props)}>\n <path d=\"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z\" />\n </svg>\n );\n}\n\n/** lucide `zap-off` (moved from @ai-matrx/capture). */\nexport function ZapOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"zap-off\", props)}>\n <path d=\"M10.513 4.856 13.12 2.17a.5.5 0 0 1 .86.46l-1.377 4.317\" />\n <path d=\"M15.656 10H20a1 1 0 0 1 .78 1.63l-1.72 1.773\" />\n <path d=\"M16.273 16.273 10.88 21.83a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14H4a1 1 0 0 1-.78-1.63l4.507-4.643\" />\n <path d=\"m2 2 20 20\" />\n </svg>\n );\n}\n\n/** lucide `log-in` — the sign-in action of the auth gate. */\nexport function LogInIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"log-in\", props)}>\n <path d=\"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4\" />\n <polyline points=\"10 17 15 12 10 7\" />\n <line x1=\"15\" x2=\"3\" y1=\"12\" y2=\"12\" />\n </svg>\n );\n}\n\n/** lucide `gem` — the create-account action of the auth gate. */\nexport function GemIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"gem\", props)}>\n <path d=\"M6 3h12l4 6-10 13L2 9Z\" />\n <path d=\"M11 3 8 9l4 13 4-13-3-6\" />\n <path d=\"M2 9h20\" />\n </svg>\n );\n}\n\n/** lucide `key`. */\nexport function KeyIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"key\", props)}>\n <path d=\"m2 21 9.6-9.6\" />\n <path d=\"m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19\" />\n <circle cx=\"15.5\" cy=\"7.5\" r=\"5.5\" />\n </svg>\n );\n}\n\n/** lucide `credit-card`. */\nexport function CreditCardIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"credit-card\", props)}>\n <rect width=\"20\" height=\"14\" x=\"2\" y=\"5\" rx=\"2\" />\n <line x1=\"2\" x2=\"22\" y1=\"10\" y2=\"10\" />\n <path d=\"M6 14h2\" />\n </svg>\n );\n}\n\n/** lucide `user-round`. */\nexport function UserRoundIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"user-round\", props)}>\n <circle cx=\"12\" cy=\"8\" r=\"5\" />\n <path d=\"M20 21a8 8 0 0 0-16 0\" />\n </svg>\n );\n}\n\n/** lucide `user`. */\nexport function UserIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"user\", props)}>\n <path d=\"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\" />\n <circle cx=\"12\" cy=\"7\" r=\"4\" />\n </svg>\n );\n}\n\n/** lucide `terminal`. */\nexport function TerminalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"terminal\", props)}>\n <path d=\"M12 19h8\" />\n <path d=\"m4 17 6-6-6-6\" />\n </svg>\n );\n}\n\n/** lucide `trash`. */\nexport function TrashIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"trash\", props)}>\n <path d=\"M10 11v6\" />\n <path d=\"M14 11v6\" />\n <path d=\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\" />\n <path d=\"M3 6h18\" />\n <path d=\"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\" />\n </svg>\n );\n}\n\n/** lucide `building`. */\nexport function BuildingIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"building\", props)}>\n <path d=\"M12 10h.01\" />\n <path d=\"M12 14h.01\" />\n <path d=\"M12 6h.01\" />\n <path d=\"M16 10h.01\" />\n <path d=\"M16 14h.01\" />\n <path d=\"M16 6h.01\" />\n <path d=\"M8 10h.01\" />\n <path d=\"M8 14h.01\" />\n <path d=\"M8 6h.01\" />\n <path d=\"M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3\" />\n <rect x=\"4\" y=\"2\" width=\"16\" height=\"20\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `plug`. */\nexport function PlugIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"plug\", props)}>\n <path d=\"M12 22v-5\" />\n <path d=\"M15 8V2\" />\n <path d=\"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z\" />\n <path d=\"M9 8V2\" />\n </svg>\n );\n}\n\n/** lucide `share`. */\nexport function ShareIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"share\", props)}>\n <path d=\"M12 2v13\" />\n <path d=\"m16 6-4-4-4 4\" />\n <path d=\"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8\" />\n </svg>\n );\n}\n\n/** lucide `arrow-up-down`. */\nexport function ArrowUpDownIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-up-down\", props)}>\n <path d=\"m21 16-4 4-4-4\" />\n <path d=\"M17 20V4\" />\n <path d=\"m3 8 4-4 4 4\" />\n <path d=\"M7 4v16\" />\n </svg>\n );\n}\n\n/** lucide `move`. */\nexport function MoveIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"move\", props)}>\n <path d=\"M12 2v20\" />\n <path d=\"m15 19-3 3-3-3\" />\n <path d=\"m19 9 3 3-3 3\" />\n <path d=\"M2 12h20\" />\n <path d=\"m5 9-3 3 3 3\" />\n <path d=\"m9 5 3-3 3 3\" />\n </svg>\n );\n}\n\n/** lucide `qr-code`. */\nexport function QrCodeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"qr-code\", props)}>\n <rect width=\"5\" height=\"5\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"5\" height=\"5\" x=\"16\" y=\"3\" rx=\"1\" />\n <rect width=\"5\" height=\"5\" x=\"3\" y=\"16\" rx=\"1\" />\n <path d=\"M21 16h-3a2 2 0 0 0-2 2v3\" />\n <path d=\"M21 21v.01\" />\n <path d=\"M12 7v3a2 2 0 0 1-2 2H7\" />\n <path d=\"M3 12h.01\" />\n <path d=\"M12 3h.01\" />\n <path d=\"M12 16v.01\" />\n <path d=\"M16 12h1\" />\n <path d=\"M21 12v.01\" />\n <path d=\"M12 21v-1\" />\n </svg>\n );\n}\n\n/** lucide `power`. */\nexport function PowerIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"power\", props)}>\n <path d=\"M12 2v10\" />\n <path d=\"M18.4 6.6a9 9 0 1 1-12.77.04\" />\n </svg>\n );\n}\n\n/** lucide `sliders-vertical`. */\nexport function SlidersVerticalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sliders-vertical\", props)}>\n <path d=\"M10 8h4\" />\n <path d=\"M12 21v-9\" />\n <path d=\"M12 8V3\" />\n <path d=\"M17 16h4\" />\n <path d=\"M19 12V3\" />\n <path d=\"M19 21v-5\" />\n <path d=\"M3 14h4\" />\n <path d=\"M5 10V3\" />\n <path d=\"M5 21v-7\" />\n </svg>\n );\n}\n\n/** lucide `fingerprint-pattern`. */\nexport function FingerprintPatternIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"fingerprint-pattern\", props)}>\n <path d=\"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4\" />\n <path d=\"M14 13.12c0 2.38 0 6.38-1 8.88\" />\n <path d=\"M17.29 21.02c.12-.6.43-2.3.5-3.02\" />\n <path d=\"M2 12a10 10 0 0 1 18-6\" />\n <path d=\"M2 16h.01\" />\n <path d=\"M21.8 16c.2-2 .131-5.354 0-6\" />\n <path d=\"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2\" />\n <path d=\"M8.65 22c.21-.66.45-1.32.57-2\" />\n <path d=\"M9 6.8a6 6 0 0 1 9 5.2v2\" />\n </svg>\n );\n}\n\n/** lucide `send`. */\nexport function SendIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"send\", props)}>\n <path d=\"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z\" />\n <path d=\"m21.854 2.147-10.94 10.939\" />\n </svg>\n );\n}\n\n/** lucide `paperclip`. */\nexport function PaperclipIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"paperclip\", props)}>\n <path d=\"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551\" />\n </svg>\n );\n}\n\n/** lucide `check-check`. */\nexport function CheckCheckIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"check-check\", props)}>\n <path d=\"M18 6 7 17l-5-5\" />\n <path d=\"m22 10-7.5 7.5L13 16\" />\n </svg>\n );\n}\n\n/** lucide `reply`. */\nexport function ReplyIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"reply\", props)}>\n <path d=\"M20 18v-2a4 4 0 0 0-4-4H4\" />\n <path d=\"m9 17-5-5 5-5\" />\n </svg>\n );\n}\n\n/** lucide `link`. */\nexport function LinkIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"link\", props)}>\n <path d=\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\" />\n <path d=\"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\" />\n </svg>\n );\n}\n\n/** lucide `bot`. */\nexport function BotIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"bot\", props)}>\n <path d=\"M12 8V4H8\" />\n <rect width=\"16\" height=\"12\" x=\"4\" y=\"8\" rx=\"2\" />\n <path d=\"M2 14h2\" />\n <path d=\"M20 14h2\" />\n <path d=\"M15 13v2\" />\n <path d=\"M9 13v2\" />\n </svg>\n );\n}\n\n/** lucide `bell-off`. */\nexport function BellOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"bell-off\", props)}>\n <path d=\"M10.268 21a2 2 0 0 0 3.464 0\" />\n <path d=\"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742\" />\n <path d=\"m2 2 20 20\" />\n <path d=\"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05\" />\n </svg>\n );\n}\n\n/** lucide `mail`. */\nexport function MailIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"mail\", props)}>\n <path d=\"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7\" />\n <rect x=\"2\" y=\"4\" width=\"20\" height=\"16\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `mail-open`. */\nexport function MailOpenIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"mail-open\", props)}>\n <path d=\"M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z\" />\n <path d=\"m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10\" />\n </svg>\n );\n}\n\n/** lucide `folder-input`. */\nexport function FolderInputIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"folder-input\", props)}>\n <path d=\"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1\" />\n <path d=\"M2 13h10\" />\n <path d=\"m9 16 3-3-3-3\" />\n </svg>\n );\n}\n\n/** lucide `star-off`. */\nexport function StarOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"star-off\", props)}>\n <path d=\"m10.344 4.688 1.181-2.393a.53.53 0 0 1 .95 0l2.31 4.679a2.12 2.12 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.237 3.152\" />\n <path d=\"m17.945 17.945.43 2.505a.53.53 0 0 1-.771.56l-4.618-2.428a2.12 2.12 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.12 2.12 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a8 8 0 0 0 .4-.099\" />\n <path d=\"m2 2 20 20\" />\n </svg>\n );\n}\n\n/** lucide `columns-3`. */\nexport function Columns3Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"columns-3\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M9 3v18\" />\n <path d=\"M15 3v18\" />\n </svg>\n );\n}\n\n/** lucide `blocks`. */\nexport function BlocksIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"blocks\", props)}>\n <path d=\"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2\" />\n <rect x=\"14\" y=\"2\" width=\"8\" height=\"8\" rx=\"1\" />\n </svg>\n );\n}\n\n/** lucide `calendar-clock`. */\nexport function CalendarClockIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"calendar-clock\", props)}>\n <path d=\"M16 14v2.2l1.6 1\" />\n <path d=\"M16 2v3\" />\n <path d=\"M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338\" />\n <path d=\"M3 9h5.859\" />\n <path d=\"M8 2v3\" />\n <circle cx=\"16\" cy=\"16\" r=\"6\" />\n </svg>\n );\n}\n\n/** lucide `door-open`. */\nexport function DoorOpenIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"door-open\", props)}>\n <path d=\"M10 21H2\" />\n <path d=\"M10 3H7a2 2 0 00-2 2v16\" />\n <path d=\"M14 12h.01\" />\n <path d=\"M19 21V5a2 2 0 00-1.675-1.974l-6.163-1.013A1 1 0 0010 3v18a1 1 0 001.124.992z\" />\n <path d=\"M22 21h-3\" />\n </svg>\n );\n}\n\n/** lucide `inbox`. */\nexport function InboxIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"inbox\", props)}>\n <polyline points=\"22 12 16 12 14 15 10 15 8 12 2 12\" />\n <path d=\"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z\" />\n </svg>\n );\n}\n\n/** lucide `layout-dashboard`. */\nexport function LayoutDashboardIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"layout-dashboard\", props)}>\n <rect width=\"7\" height=\"9\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"5\" x=\"14\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"9\" x=\"14\" y=\"12\" rx=\"1\" />\n <rect width=\"7\" height=\"5\" x=\"3\" y=\"16\" rx=\"1\" />\n </svg>\n );\n}\n\n/** lucide `archive-restore`. */\nexport function ArchiveRestoreIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"archive-restore\", props)}>\n <rect width=\"20\" height=\"5\" x=\"2\" y=\"3\" rx=\"1\" />\n <path d=\"M4 8v11a2 2 0 0 0 2 2h2\" />\n <path d=\"M20 8v11a2 2 0 0 1-2 2h-2\" />\n <path d=\"m9 15 3-3 3 3\" />\n <path d=\"M12 12v9\" />\n </svg>\n );\n}\n\n/** lucide `split`. */\nexport function SplitIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"split\", props)}>\n <path d=\"M16 3h5v5\" />\n <path d=\"M8 3H3v5\" />\n <path d=\"M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3\" />\n <path d=\"m15 9 6-6\" />\n </svg>\n );\n}\n\n/** lucide `arrow-up-from-line`. */\nexport function ArrowUpFromLineIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-up-from-line\", props)}>\n <path d=\"m18 9-6-6-6 6\" />\n <path d=\"M12 3v14\" />\n <path d=\"M5 21h14\" />\n </svg>\n );\n}\n\n/** lucide `lock-open`. */\nexport function LockOpenIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"lock-open\", props)}>\n <rect width=\"18\" height=\"11\" x=\"3\" y=\"11\" rx=\"2\" ry=\"2\" />\n <path d=\"M7 11V7a5 5 0 0 1 9.9-1\" />\n </svg>\n );\n}\n\n/** lucide `printer`. */\nexport function PrinterIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"printer\", props)}>\n <path d=\"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2\" />\n <path d=\"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6\" />\n <rect x=\"6\" y=\"14\" width=\"12\" height=\"8\" rx=\"1\" />\n </svg>\n );\n}\n\n/** lucide `rocket`. */\nexport function RocketIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"rocket\", props)}>\n <path d=\"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5\" />\n <path d=\"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09\" />\n <path d=\"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z\" />\n <path d=\"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05\" />\n </svg>\n );\n}\n\n/** lucide `message-circle`. */\nexport function MessageCircleIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"message-circle\", props)}>\n <path d=\"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719\" />\n </svg>\n );\n}\n\n/** lucide `copy-plus`. */\nexport function CopyPlusIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"copy-plus\", props)}>\n <line x1=\"15\" x2=\"15\" y1=\"12\" y2=\"18\" />\n <line x1=\"12\" x2=\"18\" y1=\"15\" y2=\"15\" />\n <rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n <path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" />\n </svg>\n );\n}\n\n/** lucide `map-pin`. */\nexport function MapPinIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"map-pin\", props)}>\n <path d=\"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0\" />\n <circle cx=\"12\" cy=\"10\" r=\"3\" />\n </svg>\n );\n}\n\n/** lucide `at-sign`. */\nexport function AtSignIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"at-sign\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d=\"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8\" />\n </svg>\n );\n}\n\n/** lucide `link-2-off`. */\nexport function Link2OffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"link-2-off\", props)}>\n <path d=\"M9 17H7A5 5 0 0 1 7 7\" />\n <path d=\"M15 7h2a5 5 0 0 1 4 8\" />\n <line x1=\"8\" x2=\"12\" y1=\"12\" y2=\"12\" />\n <line x1=\"2\" x2=\"22\" y1=\"2\" y2=\"22\" />\n </svg>\n );\n}\n\n/** lucide `whole-word`. */\nexport function WholeWordIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"whole-word\", props)}>\n <circle cx=\"7\" cy=\"12\" r=\"3\" />\n <path d=\"M10 9v6\" />\n <circle cx=\"17\" cy=\"12\" r=\"3\" />\n <path d=\"M14 7v8\" />\n <path d=\"M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1\" />\n </svg>\n );\n}\n\n/** lucide `lightbulb`. */\nexport function LightbulbIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"lightbulb\", props)}>\n <path d=\"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5\" />\n <path d=\"M9 18h6\" />\n <path d=\"M10 22h4\" />\n </svg>\n );\n}\n\n/** lucide `shield-off`. */\nexport function ShieldOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"shield-off\", props)}>\n <path d=\"m2 2 20 20\" />\n <path d=\"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71\" />\n <path d=\"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264\" />\n </svg>\n );\n}\n\n/** lucide `chevrons-left`. */\nexport function ChevronsLeftIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevrons-left\", props)}>\n <path d=\"m11 17-5-5 5-5\" />\n <path d=\"m18 17-5-5 5-5\" />\n </svg>\n );\n}\n\n/** lucide `chevrons-right`. */\nexport function ChevronsRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevrons-right\", props)}>\n <path d=\"m6 17 5-5-5-5\" />\n <path d=\"m13 17 5-5-5-5\" />\n </svg>\n );\n}\n\n/** lucide `users-round`. */\nexport function UsersRoundIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"users-round\", props)}>\n <path d=\"M18 21a8 8 0 0 0-16 0\" />\n <circle cx=\"10\" cy=\"8\" r=\"5\" />\n <path d=\"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3\" />\n </svg>\n );\n}\n\n/** lucide `landmark`. */\nexport function LandmarkIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"landmark\", props)}>\n <path d=\"M10 18v-7\" />\n <path d=\"M11.119 2.205a2 2 0 0 1 1.762 0l7.84 3.846A.5.5 0 0 1 20.5 7h-17a.5.5 0 0 1-.22-.949z\" />\n <path d=\"M14 18v-7\" />\n <path d=\"M18 18v-7\" />\n <path d=\"M3 22h18\" />\n <path d=\"M6 18v-7\" />\n </svg>\n );\n}\n\n/** lucide `factory`. */\nexport function FactoryIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"factory\", props)}>\n <path d=\"M12 16h.01\" />\n <path d=\"M16 16h.01\" />\n <path d=\"M3 19a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a.5.5 0 0 0-.769-.422l-4.462 2.844A.5.5 0 0 1 15 10.5v-2a.5.5 0 0 0-.769-.422L9.77 10.922A.5.5 0 0 1 9 10.5V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2z\" />\n <path d=\"M8 16h.01\" />\n </svg>\n );\n}\n\n/** lucide `chevrons-down` — CollapsibleText's \"expand all\". */\nexport function ChevronsDownIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevrons-down\", props)}>\n <path d=\"m7 6 5 5 5-5\" />\n <path d=\"m7 13 5 5 5-5\" />\n </svg>\n );\n}\n\n/** lucide `chevrons-up` — CollapsibleText's \"collapse all\". */\nexport function ChevronsUpIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevrons-up\", props)}>\n <path d=\"m17 11-5-5-5 5\" />\n <path d=\"m17 18-5-5-5 5\" />\n </svg>\n );\n}\n\n/** lucide `arrow-up-right` — CitationChip's \"open source\". */\nexport function ArrowUpRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-up-right\", props)}>\n <path d=\"M7 7h10v10\" />\n <path d=\"M7 17 17 7\" />\n </svg>\n );\n}\n\n/** lucide `quote` — CitationChip's excerpt blockquote. */\nexport function QuoteIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"quote\", props)}>\n <path d=\"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z\" />\n <path d=\"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z\" />\n </svg>\n );\n}\n\n/** lucide `panel-top-open` — the floating dock's phone menu button (opens the list). */\nexport function PanelTopOpenIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"panel-top-open\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M3 9h18\" />\n <path d=\"m15 14-3 3-3-3\" />\n </svg>\n );\n}\n\n/** lucide `panel-top-close` — the floating dock's phone menu button (closes the list). */\nexport function PanelTopCloseIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"panel-top-close\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M3 9h18\" />\n <path d=\"m9 16 3-3 3 3\" />\n </svg>\n );\n}\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","\"use client\";\n\n/**\n * The settled surfaces that hold the one control (owner, 2026-10-02/03):\n * one surface level, ~36px hairline rows, 8px radius; the empty state; the\n * region-shaped skeleton; the three delete tiers; the one-feature promo banner.\n * Skins are locked in `controls.css` like the controls themselves.\n */\n\nimport { Slot } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\n\nimport { swallowClick } from \"../button\";\nimport { cn } from \"../cn\";\nimport { ConfirmDialog } from \"../confirm-dialog\";\nimport { ChevronRightIcon, Trash2Icon } from \"../icons\";\nimport { Skeleton } from \"../skeleton\";\nimport { Button, ControlRow, type ChipTone, type GlyphTone } from \"./controls\";\n\n/* ------------------------------------------------------------------ */\n/* Row groups */\n/* ------------------------------------------------------------------ */\n\nexport interface RowGroupProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n /** 11px uppercase heading above the group. */\n title?: React.ReactNode;\n /** The danger-zone skin (delete tier 3). */\n danger?: boolean;\n}\n\n/** A bordered group of hairline rows — the one surface for grouped content. */\nexport function RowGroup({ title, danger, className, children, ...props }: RowGroupProps) {\n return (\n <section\n data-matrx-row-group=\"\"\n data-danger={danger ? \"\" : undefined}\n className={cn(\"matrx-control-group\", className)}\n {...props}\n >\n {title ? <h2 className=\"matrx-control-group-title\">{title}</h2> : null}\n <div className=\"matrx-control-group-body\">{children}</div>\n </section>\n );\n}\n\nexport interface SettingRowProps {\n label: React.ReactNode;\n /** One 12px line under the label. */\n line?: React.ReactNode;\n /** Ties the label to the control it describes. */\n htmlFor?: string;\n /** The row's controls, right-aligned on one line. */\n children?: React.ReactNode;\n className?: string;\n}\n\n/** One ~36px row: 13px label, optional 12px line, controls on the right. */\nexport function SettingRow({ label, line, htmlFor, children, className }: SettingRowProps) {\n return (\n <div data-matrx-setting-row=\"\" className={cn(\"matrx-control-setting-row\", className)}>\n <div className=\"matrx-control-setting-text\">\n {htmlFor ? (\n <label htmlFor={htmlFor} className=\"matrx-control-setting-label\">\n {label}\n </label>\n ) : (\n <div className=\"matrx-control-setting-label\">{label}</div>\n )}\n {line ? <div className=\"matrx-control-setting-line\">{line}</div> : null}\n </div>\n {children ? (\n <ControlRow nowrap data-matrx-row-actions=\"\">\n {children}\n </ControlRow>\n ) : null}\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Tile — the pressable row / tile (a choice, a destination) */\n/* ------------------------------------------------------------------ */\n\nexport type TileLayout = \"row\" | \"stack\" | \"adaptive\";\n\nexport interface TileProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"title\"> {\n /** `row` (default): glyph, then a 13px title over a 12px line, start-aligned, full width — a\n * choice in a list, a quick action. `stack`: glyph on top, title and line under it — a grid\n * tile. `adaptive`: `stack` from the `sm` breakpoint (640px) up, a compact `row` below it — a\n * grid of option cards that becomes a list on a phone. All are taller than a control: they\n * carry text, so they never take the 28px lock. */\n layout?: TileLayout;\n /** `outline` (default): the bordered card skin. `quiet`: no frame until hover — a row in a\n * menu-like list. */\n variant?: \"outline\" | \"quiet\";\n /** Leading 16px glyph (an avatar or image works too). */\n icon?: React.ReactNode;\n /** The 13px title. */\n title: React.ReactNode;\n /** The title wraps over several lines (up to 6) instead of one line with an ellipsis: a quiz\n * answer, a step, a sentence-long choice. Off by default — a short title is one line. */\n wrapTitle?: boolean;\n /** One 12px secondary line (clamped to two lines; one with `oneLine`). */\n line?: React.ReactNode;\n /** The `line` stays ONE line with an ellipsis, so every row of a master list keeps one height. */\n oneLine?: boolean;\n /** Trailing content in a row (a chevron, a count, a shortcut). */\n end?: React.ReactNode;\n /** A choice: `true` tints it and sets `aria-pressed`; `false` sets `aria-pressed=\"false\"`. A link tile (`asChild`) never sets `aria-pressed`: the caller sets `aria-current`. */\n selected?: boolean;\n /** How `selected` looks. `outline` (default): primary frame and tint. `fill`: a soft neutral fill,\n * no outline, ink unchanged — a sidebar's active row. `primary`: the solid primary fill with\n * every ink (title, line, glyph, end) on primary — the open item of a master list. */\n selectedStyle?: \"outline\" | \"fill\" | \"primary\";\n /** The hover / focus tooltip (the native `title` attribute: `title` is the visible label). */\n tooltip?: string;\n /** Nesting depth under a parent row: each level moves the row's start past one glyph and its\n * gap, so an icon-less child's title starts where its parent's title does. */\n level?: 1 | 2 | 3;\n /** Size to the content and never shrink or truncate the title — a code, a short value. */\n fit?: boolean;\n /** Keep room at the row's end for a control laid OVER it (a row's More button): `control`\n * reserves one control's width plus its gap, so the title never runs under it. */\n endInset?: \"control\";\n /** A dashed border: the \"add another\" tile (an empty slot to fill), never a choice. */\n dashed?: boolean;\n /** hoverStyle=\"fill\": the pointer's soft neutral fill (the desktop look's secondary fill) instead of the accent. */\n hoverStyle?: \"fill\";\n /** A destructive row (Remove, Delete): destructive title and glyph, destructive hover tint. */\n danger?: boolean;\n /**\n * A choice that is ALREADY USED elsewhere (an option already placed, a field already mapped): a\n * faint shade and quieter ink, still fully pressable — a hint for the eye, never a disabled state.\n */\n dimmed?: boolean;\n /** The glyph's own status ink when its color carries meaning (Button's `glyphTone`). */\n glyphTone?: GlyphTone;\n /** The inviting choice card for a front door: roomy padding, a 40px icon square, a 14px title. */\n hero?: boolean;\n /** Tint card, edge and icon square from one `ChipTone` (the `Chip` hue tokens). */\n tone?: ChipTone;\n /** A 28px navigation / filter row for sidebars and dense lists: `min-height` is the control size,\n * padding 4px 8px, gap 8px, 13px title. The `line` is HIDDEN when dense (one line, always).\n * `variant=\"quiet\"` + `dense` is a clean nav row: transparent until hover / selected. */\n dense?: boolean;\n /** Render the one child element (a link) with the tile's skin; its children are ignored —\n * the tile draws `icon`/`title`/`line`/`end`. */\n asChild?: boolean;\n}\n\n/**\n * THE pressable row / tile: two named layouts, two skins, no size. `className` places it\n * (width, grid cell); its height follows its text.\n */\nexport const Tile = React.forwardRef<HTMLButtonElement, TileProps>(\n (\n { layout = \"row\", variant = \"outline\", icon, title, wrapTitle, line, end, selected, selectedStyle, tooltip, level, fit, endInset, oneLine, dashed, hoverStyle, danger, dimmed, glyphTone, hero, tone, dense, asChild = false, className, children, onClick, type, ...props },\n ref,\n ) => {\n const Component = asChild ? Slot : \"button\";\n const ariaDisabled = props[\"aria-disabled\"];\n const inert = ariaDisabled === true || ariaDisabled === \"true\";\n const body = (\n <>\n {icon ? <span className=\"matrx-tile-icon\">{icon}</span> : null}\n <span className=\"matrx-tile-text\">\n <span className=\"matrx-tile-title\">{title}</span>\n {line ? <span className=\"matrx-tile-line\">{line}</span> : null}\n </span>\n {end ? <span className=\"matrx-tile-end\">{end}</span> : null}\n </>\n );\n return (\n <Component\n ref={ref}\n type={asChild ? undefined : (type ?? \"button\")}\n data-matrx-tile=\"\"\n data-layout={layout}\n data-variant={variant}\n data-selected={selected ? \"\" : undefined}\n data-selected-style={selected && (selectedStyle === \"fill\" || selectedStyle === \"primary\") ? selectedStyle : undefined}\n data-level={level}\n data-fit={fit ? \"\" : undefined}\n data-one-line={oneLine ? \"\" : undefined}\n data-end-inset={endInset}\n data-dashed={dashed ? \"\" : undefined}\n data-hover-style={hoverStyle}\n title={tooltip}\n data-danger={danger ? \"\" : undefined}\n data-dimmed={dimmed ? \"\" : undefined}\n data-wrap-title={wrapTitle ? \"\" : undefined}\n data-glyph-tone={glyphTone}\n data-hero={hero ? \"\" : undefined}\n data-dense={dense ? \"\" : undefined}\n data-tone={tone}\n aria-pressed={asChild || selected === undefined ? undefined : selected}\n className={cn(\"matrx-tile\", className)}\n {...props}\n onClick={inert ? swallowClick : onClick}\n >\n {asChild && React.isValidElement(children) ? (\n React.cloneElement(children as React.ReactElement<{ children?: React.ReactNode }>, undefined, body)\n ) : (\n body\n )}\n </Component>\n );\n },\n);\nTile.displayName = \"Tile\";\n\n/* ------------------------------------------------------------------ */\n/* Section disclosure header */\n/* ------------------------------------------------------------------ */\n\nexport type DisclosureHeaderVariant = \"row\" | \"label\";\n\nexport interface DisclosureHeaderProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"title\"> {\n /** Whether the section under the header is showing. Sets `aria-expanded`. */\n open: boolean;\n /** `row` (default): a 13px/500 title — a collapsible section, a group of results, a \"details\"\n * fold. `label`: the 11px uppercase muted label that heads a sidebar or menu group. */\n variant?: DisclosureHeaderVariant;\n /** Optional 16px glyph after the chevron (row variant). */\n icon?: React.ReactNode;\n /** Colors ONLY the icon: a status tone uses its `-ink` token, a hue its `--matrx-chip-<hue>-ink`.\n * A section that carries a color (violet Organization, amber Projects) keeps it here. */\n glyphTone?: GlyphTone | ChipTone;\n /** The section's name. */\n title: React.ReactNode;\n /** A short muted fact after the title: a count, a size, \"3 of 12\". Never a sentence. */\n meta?: React.ReactNode;\n /** Trailing content pinned to the end (a status glyph, a count badge). Non-interactive — a\n * control beside the header sits outside it, never inside the button. */\n end?: React.ReactNode;\n /** One 12px secondary line under the title (row variant) — what the section holds. */\n line?: React.ReactNode;\n /** Where the turning chevron sits. `start` (default) leads the row; `end` trails it, for a\n * sidebar section whose label keeps the column's left edge. */\n chevron?: \"start\" | \"end\";\n}\n\n/**\n * THE section-disclosure header: a chevron that turns, a title, an optional count and trailing\n * status — one full-width pressable row that opens and closes the section below it. Every\n * \"click the heading to fold\" row is this, never a raw button with a hand-drawn chevron.\n */\nexport const DisclosureHeader = React.forwardRef<HTMLButtonElement, DisclosureHeaderProps>(\n ({ open, variant = \"row\", icon, glyphTone, title, meta, end, line, chevron = \"start\", className, type, ...props }, ref) => (\n <button\n ref={ref}\n type={type ?? \"button\"}\n aria-expanded={open}\n data-matrx-disclosure=\"\"\n data-variant={variant}\n data-open={open ? \"\" : undefined}\n data-chevron={chevron}\n className={cn(\"matrx-disclosure\", className)}\n {...props}\n >\n {chevron === \"start\" ? (\n <span className=\"matrx-disclosure-chevron\" aria-hidden=\"true\">\n <ChevronRightIcon />\n </span>\n ) : null}\n {icon ? (\n <span className=\"matrx-disclosure-icon\" data-glyph-tone={glyphTone}>\n {icon}\n </span>\n ) : null}\n {line ? (\n <span className=\"matrx-disclosure-text\">\n <span className=\"matrx-disclosure-title\">{title}</span>\n <span className=\"matrx-disclosure-line\">{line}</span>\n </span>\n ) : (\n <span className=\"matrx-disclosure-title\">{title}</span>\n )}\n {meta === undefined || meta === null || meta === false ? null : (\n <span className=\"matrx-disclosure-meta\">{meta}</span>\n )}\n {end ? <span className=\"matrx-disclosure-end\">{end}</span> : null}\n {chevron === \"end\" ? (\n <span className=\"matrx-disclosure-chevron\" data-end=\"\" aria-hidden=\"true\">\n <ChevronRightIcon />\n </span>\n ) : null}\n </button>\n ),\n);\nDisclosureHeader.displayName = \"DisclosureHeader\";\n\n/* ------------------------------------------------------------------ */\n/* Empty state */\n/* ------------------------------------------------------------------ */\n\nexport interface EmptyStateProps {\n /** A 20px glyph inside the tinted disc. */\n icon: React.ReactNode;\n /** 13px title. */\n title: React.ReactNode;\n /** One 12px line. */\n line?: React.ReactNode;\n /** The one 28px action (a controls `Button`). */\n action?: React.ReactNode;\n className?: string;\n}\n\n/** Tinted icon disc + 13px title + one line + one 28px button. */\nexport function EmptyState({ icon, title, line, action, className }: EmptyStateProps) {\n return (\n <div data-matrx-empty-state=\"\" className={cn(\"matrx-control-empty\", className)}>\n <div className=\"matrx-control-empty-disc\" aria-hidden=\"true\">\n {icon}\n </div>\n <div>\n <div className=\"matrx-control-empty-title\">{title}</div>\n {line ? <div className=\"matrx-control-empty-line\">{line}</div> : null}\n </div>\n {action ? <ControlRow className=\"justify-center\">{action}</ControlRow> : null}\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Region skeleton */\n/* ------------------------------------------------------------------ */\n\nexport interface RegionSkeletonProps {\n /** The region's shape: hairline rows, a form's label+field pairs, or cards. */\n shape?: \"rows\" | \"form\" | \"cards\";\n /** How many rows / fields / cards. */\n count?: number;\n /** Rows: a second (meta) line under each title. */\n twoLine?: boolean;\n className?: string;\n \"aria-label\"?: string;\n}\n\n/**\n * A skeleton shaped like the region it stands in for — never one block for a\n * page, never a spinner in the middle. A spinner belongs only inside a busy\n * control.\n */\nexport function RegionSkeleton({\n shape = \"rows\",\n count = shape === \"cards\" ? 3 : shape === \"form\" ? 4 : 8,\n twoLine = false,\n className,\n \"aria-label\": ariaLabel = \"Loading\",\n}: RegionSkeletonProps) {\n const items = Array.from({ length: count }, (_, i) => i);\n if (shape === \"form\") {\n return (\n <div aria-busy=\"true\" aria-label={ariaLabel} className={cn(\"flex flex-col gap-3\", className)}>\n {items.map((i) => (\n <div key={i} className=\"flex flex-col gap-1.5\">\n <Skeleton className=\"h-3 w-24\" />\n <Skeleton className=\"h-7 rounded-full\" />\n </div>\n ))}\n </div>\n );\n }\n if (shape === \"cards\") {\n return (\n <div aria-busy=\"true\" aria-label={ariaLabel} className={cn(\"grid gap-2 sm:grid-cols-3\", className)}>\n {items.map((i) => (\n <div key={i} className=\"flex items-center gap-3 rounded-lg border border-border p-3\">\n <Skeleton className=\"size-8 rounded-full\" />\n <div className=\"flex flex-1 flex-col gap-1.5\">\n <Skeleton className=\"h-3.5 w-2/3\" />\n <Skeleton className=\"h-2.5 w-1/2\" />\n </div>\n </div>\n ))}\n </div>\n );\n }\n return (\n <div aria-busy=\"true\" aria-label={ariaLabel} className={cn(\"divide-y divide-border\", className)}>\n {items.map((i) => (\n <div key={i} className=\"flex min-h-9 items-center gap-3 px-3 py-1.5\">\n <Skeleton className=\"size-4 rounded-full\" />\n <div className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <Skeleton className=\"h-3.5\" style={{ width: `${30 + ((i * 17) % 35)}%` }} />\n {twoLine ? <Skeleton className=\"h-2.5 w-1/4\" /> : null}\n </div>\n <Skeleton className=\"hidden h-[1.125rem] w-16 rounded-md sm:block\" />\n <Skeleton className=\"size-5 rounded-full\" />\n </div>\n ))}\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* The three delete tiers */\n/* ------------------------------------------------------------------ */\n\nexport interface DeleteButtonProps\n extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"children\" | \"aria-label\"> {\n /** What it deletes, e.g. \"Delete reference\". */\n \"aria-label\": string;\n}\n\n/** Tier 1 — the quiet trash glyph: muted until hover, destructive on hover. */\nexport const DeleteButton = React.forwardRef<HTMLButtonElement, DeleteButtonProps>((props, ref) => (\n <Button ref={ref} variant=\"quiet\" icon={<Trash2Icon />} data-delete=\"\" title={props[\"aria-label\"]} {...props} />\n));\nDeleteButton.displayName = \"DeleteButton\";\n\nexport interface ConfirmDeleteProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n /** \"Delete this project?\" */\n title: React.ReactNode;\n /** REQUIRED: name the cost — what is lost, what goes with it. Never \"Are you sure?\". */\n cost: React.ReactNode;\n /** The confirm button names the act, e.g. \"Delete project\". */\n confirmLabel: string;\n onConfirm: () => void | Promise<void>;\n busy?: boolean;\n}\n\n/** Tier 2 — a confirm that names the cost. */\nexport function ConfirmDelete({ open, onOpenChange, title, cost, confirmLabel, onConfirm, busy }: ConfirmDeleteProps) {\n return (\n <ConfirmDialog\n open={open}\n onOpenChange={onOpenChange}\n title={title}\n description={cost}\n confirmLabel={confirmLabel}\n variant=\"destructive\"\n busy={busy}\n onConfirm={onConfirm}\n />\n );\n}\n\n/** Tier 3 — the danger zone: a red-ruled group of rows at the end of settings. */\nexport function DangerZone({\n title = \"Danger zone\",\n children,\n className,\n}: {\n title?: React.ReactNode;\n children: React.ReactNode;\n className?: string;\n}) {\n return (\n <RowGroup title={title} danger className={className}>\n {children}\n </RowGroup>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Promo banner */\n/* ------------------------------------------------------------------ */\n\nexport type PromoTone = \"primary\" | \"success\" | \"warning\" | \"info\";\n\nexport interface PromoBannerProps {\n /** A 16px glyph inside the tinted disc. */\n icon: React.ReactNode;\n /** 11px label before the title, e.g. \"Next challenge\". Never a pill. */\n eyebrow?: React.ReactNode;\n /** One line, 13px. */\n title: React.ReactNode;\n /** One line, 12px, ≤60 characters. Omit rather than pad. */\n line?: React.ReactNode;\n /** Outline badges — the evidence behind the promo. */\n chips?: React.ReactNode;\n /** The one action: a controls `Button` (or a link wearing it). */\n action?: React.ReactNode;\n tone?: PromoTone;\n /**\n * Let the title wrap onto as many lines as it needs, for a sentence that must be read whole (a question with its\n * answer buttons beside it). Default false: one line, truncated.\n */\n wrap?: boolean;\n className?: string;\n /** Accessible name of the region. Defaults to \"Featured\". */\n \"aria-label\"?: string;\n}\n\n/**\n * A page-top variant that promotes ONE feature in one bordered row (~56px):\n * [disc] EYEBROW · Title / one line … [chips] [Action]. On a phone the chips\n * wrap under the text and the action stretches full width.\n */\nexport function PromoBanner({\n icon,\n eyebrow,\n title,\n line,\n chips,\n action,\n tone = \"primary\",\n wrap = false,\n className,\n \"aria-label\": ariaLabel,\n}: PromoBannerProps) {\n return (\n <section\n aria-label={ariaLabel ?? (typeof eyebrow === \"string\" ? eyebrow : \"Featured\")}\n data-matrx-promo=\"\"\n data-tone={tone}\n data-wrap={wrap ? \"\" : undefined}\n className={cn(\"matrx-control-promo\", className)}\n >\n <span className=\"matrx-control-promo-disc\" aria-hidden=\"true\">\n {icon}\n </span>\n <div className=\"matrx-control-promo-text\">\n <div className=\"matrx-control-promo-head\">\n {eyebrow ? <span className=\"matrx-control-promo-eyebrow\">{eyebrow}</span> : null}\n {eyebrow ? (\n <span className=\"matrx-control-promo-eyebrow\" aria-hidden=\"true\">\n ·\n </span>\n ) : null}\n <span className=\"matrx-control-promo-title\">{title}</span>\n </div>\n {line ? <div className=\"matrx-control-promo-line\">{line}</div> : null}\n </div>\n {chips ? <div className=\"matrx-control-promo-chips\">{chips}</div> : null}\n {action ? (\n <ControlRow nowrap className=\"matrx-control-promo-action\">\n {action}\n </ControlRow>\n ) : null}\n </section>\n );\n}\n","\"use client\";\n\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nexport const buttonVariants = cva(\n \"matrx-glyph-trim inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:opacity-50 active:scale-[0.98] [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90\",\n /**\n * An explicit spelling of `default`, identical by construction. It is\n * not decoration: matrx-frontend's `ButtonMine` fork carried it, ~17\n * call sites say `variant=\"primary\"`, and the alternative to keeping\n * the word was a host shim translating a prop — the massage C22 bans.\n */\n primary: \"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90\",\n destructive:\n \"bg-danger-fill text-danger-fill-foreground shadow-sm hover:bg-danger-fill/90\",\n /** The affirmative twin of `destructive` — confirm, approve, publish. */\n success:\n \"bg-success-fill text-success-fill-foreground shadow-sm hover:bg-success-fill/90\",\n outline:\n \"border border-border bg-card shadow-sm hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary-ink underline-offset-4 hover:underline\",\n subtle:\n \"border border-transparent bg-muted/50 text-foreground hover:border-border hover:bg-muted\",\n },\n /**\n * ONE size scale, xs → 3xl, plus the two icon boxes. The top and bottom\n * of the scale came in from matrx-frontend's `ButtonMine` fork (2026-09-07):\n * a dense toolbar needs `xs`, and a marketing/hero call to action needs\n * `xl`+. A host that has to reach outside this scale forks the button,\n * which is exactly how `ButtonMine` was born.\n */\n size: {\n xs: \"h-6 rounded-md px-1 text-xs\",\n sm: \"h-8 rounded-md px-3 text-xs\",\n default: \"h-9 px-4 py-2\",\n /** An explicit spelling of `default` (the fork's middle rung). */\n md: \"h-9 px-4 py-2\",\n lg: \"h-10 rounded-md px-6\",\n xl: \"h-12 px-8 py-3 text-base\",\n \"2xl\": \"h-14 px-10 py-3 text-base\",\n \"3xl\": \"h-16 px-12 py-3 text-base\",\n icon: \"h-9 w-9\",\n \"icon-sm\": \"h-7 w-7\",\n /** A circular icon box — an avatar-shaped control, not a square one. */\n roundIcon: \"h-8 w-8 rounded-full p-0\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\n/**\n * THE TOUCH FLOOR (2026-09-17).\n *\n * Every rung of the size scale below `xl` is shorter than the 44px platform\n * touch target: `xs` 24, `icon-sm` 28, `sm` 32, `roundIcon` 32, `default`/`md`\n * 36, `icon` 36, `lg` 40. Measured live at 390x844 on `/masterwork/<id>`, ALL\n * SEVEN design-system Buttons in the viewport were under the floor (four at\n * 32px, two at 28px).\n *\n * The floor is raised in CSS, under `@media (pointer: coarse)` ONLY, so DESKTOP\n * DENSITY IS UNTOUCHED — a narrow desktop window is not a finger, which is why\n * this rule deliberately does NOT carry the `(max-width: 1023px)` half that the\n * dialog-footer floor in `styles.css` uses.\n *\n * WHY EVERY SUB-44 RUNG AND NOT JUST `sm`: a floor applied to one rung inverts\n * the scale. Lift `sm` (32) alone and it renders TALLER on a phone than\n * `default` (36) and `lg` (40) — the scale would stop being a scale. A floor is\n * only coherent applied to everything beneath it.\n *\n * The mechanism is `min-height`/`min-width`, not an invisible 44px hit ring\n * over a 32px pill. A ring is the tap-target package's pattern and it is right\n * THERE (isolated glass buttons), but on a toolbar of adjacent `sm` buttons\n * separated by an 8px gap the rings overlap in the gap and one button silently\n * eats taps aimed at its neighbour — unacceptable where a neighbour is\n * destructive. `lib/entity-list`'s own phone contract (`h-11 min-w-11`) already\n * chose growth for the same reason; this is that choice made once, in the\n * primitive, instead of per surface.\n *\n * `min-width` is raised only on the SQUARE rungs (`icon`, `icon-sm`,\n * `roundIcon`) — a text button is already wider than 44px, and forcing a floor\n * on it would stretch short labels.\n *\n * Opt out on a control that is genuinely not a finger target with\n * `data-touch-exempt` (same escape hatch the footer floor honors), and say why\n * at the call site.\n */\nconst TOUCH_FLOOR_SIZES = new Set([\n \"xs\",\n \"sm\",\n \"default\",\n \"md\",\n \"lg\",\n \"icon\",\n \"icon-sm\",\n \"roundIcon\",\n]);\nconst SQUARE_SIZES = new Set([\"icon\", \"icon-sm\", \"roundIcon\"]);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\n/**\n * THE CURSOR LAW (common-docs/policies/cursor-law.md): a disabled control says\n * so with `not-allowed`, which the package's base layer sets on `:disabled`\n * and `[aria-disabled=\"true\"]`. `pointer-events: none` is never the mechanism\n * — it swallows the cursor. A native `<button disabled>` already fires no\n * click; the two shapes that WOULD fire one are handled here, once:\n * - `asChild` + `disabled` (a Link wearing button styles): marked\n * `aria-disabled`, taken out of the tab order, and its click is swallowed;\n * - `aria-disabled=\"true\"` on an enabled button: its click is swallowed.\n */\nexport function swallowClick(event: React.MouseEvent<HTMLButtonElement>): void {\n event.preventDefault();\n event.stopPropagation();\n}\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, onClick, ...props }, ref) => {\n const Component = asChild ? Slot : \"button\";\n const resolvedSize = size ?? \"default\";\n const disabledChild = asChild && Boolean(props.disabled);\n const ariaDisabled = props[\"aria-disabled\"];\n const inert =\n disabledChild || ariaDisabled === true || ariaDisabled === \"true\";\n return (\n <Component\n className={cn(buttonVariants({ variant, size, className }))}\n data-matrx-button=\"\"\n data-tap-floor={TOUCH_FLOOR_SIZES.has(resolvedSize) ? \"\" : undefined}\n data-tap-floor-square={\n SQUARE_SIZES.has(resolvedSize) ? \"\" : undefined\n }\n ref={ref}\n {...props}\n aria-disabled={disabledChild ? true : ariaDisabled}\n tabIndex={disabledChild ? -1 : props.tabIndex}\n onClick={inert ? swallowClick : onClick}\n />\n );\n },\n);\nButton.displayName = \"Button\";\n","\"use client\";\n\n/**\n * FLOATING LAYERS OPENED FROM INSIDE A MODAL — one contract, every surface.\n *\n * A blocking surface (a `modal` Dialog, AlertDialog, Sheet, Drawer,\n * BottomSheet, CommandDialog — and every Dialog on a phone) paints a scrim at\n * the modal tier, `MODAL_LAYER_Z`. Radix children of that surface (Popover,\n * Select, menus) are safe: they portal into it or after it at the same z, and\n * Radix counts a press inside them as inside. A floating layer that is NOT a\n * Radix child — a host window manager's window, the associations picker\n * window, anything `createPortal`ed to `<body>` at its own z — was not: it\n * painted UNDER the scrim (a window manager lives near z-1000), so the click\n * that picked an option landed on the scrim and closed the modal (Source\n * screen side sheet + association picker, 2026-09-26). Behind the scrim it\n * would also have lost focus to the modal's trap and had presses inside it\n * counted as outside-clicks.\n *\n * The contract, in three parts:\n *\n * 1. Every modal content registers while it is open (`useModalLayer`), and\n * treats a press or focus inside any `[data-matrx-floating-layer]` as\n * inside (`keepFloatingLayersInside`).\n * 2. A floating layer reads `useFloatingLayerZIndex(ownZ)`: while a modal is\n * open it is lifted to the modal tier. Equal z, so DOM order decides — a\n * layer opened AFTER the modal (portal appended later) paints above its\n * scrim; a window that was already open stays underneath, as it should.\n * While lifted, several floating layers order by when they opened, not by\n * their own manager's focus order; that returns when the modal closes.\n * 3. A floating layer's root is wrapped in `<FloatingLayer>`: it carries the\n * marker attribute, re-asserts `pointer-events: auto` (a modal sets `none`\n * on `<body>`), and mounts a non-trapping focus scope, which pauses the\n * modal's focus trap while the layer is open so its inputs take focus.\n *\n * 4. Popper content (a Popover, a combobox) a floating layer opens is portaled\n * to <body>; while a floating layer is open it counts as part of it, and\n * wheel/touchmove inside either stops at <body> so the modal's scroll lock\n * never cancels it.\n *\n * Guard: `floating-layer.test.tsx` — a window-manager-style layer opened from\n * each blocking surface must stack above the scrim, keep the modal open when\n * it or a popover it opened is pressed, scroll, keep focus in its own input,\n * and hand focus back to its opener when it closes.\n */\n\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\n\n/** The modal tier: every blocking scrim and its content sit here. */\nexport const MODAL_LAYER_Z = 10000;\n\n/** THE tooltip layer (defined beside the tooltips, `title-tooltips.ts`). */\nexport { TOOLTIP_LAYER_Z } from \"./title-tooltips\";\n\n/** Marker attribute on the root of a floating layer. */\nexport const FLOATING_LAYER_ATTR = \"data-matrx-floating-layer\";\n\n// ── the open-modal registry ─────────────────────────────────────────────────\n// Shared identity across independently bundled public entrypoints, like the\n// dialog contexts: two copies of this module must see one count.\ninterface ModalLayerRegistry {\n count: number;\n listeners: Set<() => void>;\n}\nconst REGISTRY_SLOT = Symbol.for(\"ai-matrx.design-system.modal-layer-registry\");\nconst registryHost = globalThis as typeof globalThis & {\n [REGISTRY_SLOT]?: ModalLayerRegistry;\n};\nconst registry: ModalLayerRegistry = (registryHost[REGISTRY_SLOT] ??= {\n count: 0,\n listeners: new Set(),\n});\n\nfunction emit(): void {\n for (const listener of registry.listeners) listener();\n}\n\n// A modal's scroll lock (react-remove-scroll) cancels wheel and touchmove on\n// `document` for anything outside the modal's own content — including a\n// floating layer opened from it, whose list then never scrolls. While a modal\n// is open, a scroll gesture inside a floating layer stops at <body>: React's\n// own portal listener on <body> still sees it (stopPropagation never stops\n// listeners on the same node), the lock on `document` never does.\nconst SCROLL_EVENTS = [\"wheel\", \"touchmove\"] as const;\nfunction stopAtBody(event: Event): void {\n if (isInsideFloatingLayer(event.target)) event.stopPropagation();\n}\nfunction setScrollPassthrough(on: boolean): void {\n if (typeof document === \"undefined\" || !document.body) return;\n for (const type of SCROLL_EVENTS) {\n if (on) document.body.addEventListener(type, stopAtBody, { passive: true });\n else document.body.removeEventListener(type, stopAtBody);\n }\n}\n\n/** Register one open modal layer; returns its release. */\nexport function registerModalLayer(): () => void {\n registry.count += 1;\n if (registry.count === 1) setScrollPassthrough(true);\n emit();\n let released = false;\n return () => {\n if (released) return;\n released = true;\n registry.count = Math.max(0, registry.count - 1);\n if (registry.count === 0) setScrollPassthrough(false);\n emit();\n };\n}\n\n/** True while at least one blocking surface is open. */\nexport function isModalLayerOpen(): boolean {\n return registry.count > 0;\n}\n\nfunction subscribe(listener: () => void): () => void {\n registry.listeners.add(listener);\n return () => registry.listeners.delete(listener);\n}\n\n/** Reactive `isModalLayerOpen()`. */\nexport function useModalLayerOpen(): boolean {\n return React.useSyncExternalStore(subscribe, isModalLayerOpen, () => false);\n}\n\n/**\n * Called by every modal content while it is mounted. `active` is false for a\n * content whose root is not modal (a windowed dialog, a `modal={false}` sheet).\n */\nexport function useModalLayer(active: boolean): void {\n React.useLayoutEffect(() => (active ? registerModalLayer() : undefined), [active]);\n}\n\n// ── the outside-click guard ─────────────────────────────────────────────────\n\nconst POPPER_WRAPPER = \"[data-radix-popper-content-wrapper]\";\n\n/**\n * True when `target` is inside a floating layer — or inside popper content (a\n * Popover, a combobox list) while a floating layer is open. Popper content a\n * window opens is portaled to <body>, outside the window's own element and\n * outside the modal's React tree; popper content the MODAL opens is portaled\n * into the modal and never reaches this check.\n */\nexport function isInsideFloatingLayer(target: EventTarget | null | undefined): boolean {\n if (!(target instanceof Element)) return false;\n if (target.closest(`[${FLOATING_LAYER_ATTR}]`)) return true;\n return (\n target.closest(POPPER_WRAPPER) !== null &&\n target.ownerDocument.querySelector(`[${FLOATING_LAYER_ATTR}]`) !== null\n );\n}\n\n/**\n * Wrap a Radix `onInteractOutside` so a press or focus inside a floating layer\n * never dismisses the modal. The caller's handler still runs first.\n */\nexport function keepFloatingLayersInside<\n E extends { target: EventTarget | null; preventDefault: () => void },\n>(handler?: (event: E) => void): (event: E) => void {\n return (event) => {\n handler?.(event);\n if (isInsideFloatingLayer(event.target)) event.preventDefault();\n };\n}\n\n// ── the floating layer's side ───────────────────────────────────────────────\n\n/** Pure form of `useFloatingLayerZIndex`, for callers outside React. */\nexport function floatingLayerZIndex(ownZ: number, modalOpen: boolean): number {\n return modalOpen ? Math.max(ownZ, MODAL_LAYER_Z) : ownZ;\n}\n\n/** The z-index a floating layer should paint at, given its own. */\nexport function useFloatingLayerZIndex(ownZ: number): number {\n return floatingLayerZIndex(ownZ, useModalLayerOpen());\n}\n\nconst preventAutoFocus = (event: Event) => event.preventDefault();\n\n/**\n * Wrap the root element of a floating layer (exactly one element child).\n * Marks it, keeps it pressable under a modal's `pointer-events: none` body,\n * and pauses the modal's focus trap while it is mounted. It never takes focus\n * on open. On close, if focus was lost with it while a modal is still open,\n * focus returns to the control that opened it — otherwise the next Tab would\n * land behind the modal.\n */\nexport const FloatingLayer = React.forwardRef<\n HTMLElement,\n { children: React.ReactElement }\n>(({ children }, ref) => {\n const [opener] = React.useState<Element | null>(() =>\n typeof document === \"undefined\" ? null : document.activeElement,\n );\n const returnFocus = (event: Event) => {\n event.preventDefault();\n const active = document.activeElement;\n const lost = !active || active === document.body || !active.isConnected;\n if (lost && isModalLayerOpen() && opener instanceof HTMLElement && opener.isConnected) {\n opener.focus({ preventScroll: true });\n }\n };\n return (\n <FocusScope\n asChild\n trapped={false}\n loop={false}\n onMountAutoFocus={preventAutoFocus}\n onUnmountAutoFocus={returnFocus}\n >\n <Slot\n ref={ref}\n {...{ [FLOATING_LAYER_ATTR]: \"\" }}\n style={{ pointerEvents: \"auto\" }}\n >\n {children}\n </Slot>\n </FocusScope>\n );\n});\nFloatingLayer.displayName = \"FloatingLayer\";\n\n// ── THE Escape stack ────────────────────────────────────────────────────────\n// One Escape owner for every floating window (summon's WindowPanel and\n// LiteWindow, the PeekWindow here): the TOPMOST open layer gets the key, and\n// only it — two windows never close on one press, and a window under another\n// never closes first. A layer joins on open (top), `raise()`s when it comes to\n// the front (a focused window), and leaves on close. Its handler decides\n// whether it closes (a menu or dialog it does not own may hold the key) and\n// calls `preventDefault()` when it does; a layer that declines still keeps the\n// key from the layers under it. One window listener, shared across bundled\n// copies of this module through a global slot (like the modal registry).\ninterface EscapeLayerEntry {\n readonly key: symbol;\n handle: (event: KeyboardEvent) => void;\n}\ninterface EscapeStack {\n layers: EscapeLayerEntry[];\n listening: boolean;\n}\nconst ESCAPE_SLOT = Symbol.for(\"ai-matrx.design-system.escape-stack\");\nconst escapeHost = globalThis as typeof globalThis & { [ESCAPE_SLOT]?: EscapeStack };\nconst escapeStack = (): EscapeStack => (escapeHost[ESCAPE_SLOT] ??= { layers: [], listening: false });\n\nfunction onEscapeKeydown(event: KeyboardEvent): void {\n if (event.key !== \"Escape\" || event.defaultPrevented) return;\n const { layers } = escapeStack();\n layers[layers.length - 1]?.handle(event);\n}\n\nexport interface EscapeLayerHandle {\n /** Move this layer to the top (it came to the front). */\n raise(): void;\n /** Leave the stack (closed). */\n release(): void;\n}\n\n/** Join the Escape stack at the top. The handler runs only while this layer is topmost. */\nexport function pushEscapeLayer(handle: (event: KeyboardEvent) => void): EscapeLayerHandle {\n const stack = escapeStack();\n if (!stack.listening && typeof window !== \"undefined\") {\n window.addEventListener(\"keydown\", onEscapeKeydown);\n stack.listening = true;\n }\n const entry: EscapeLayerEntry = { key: Symbol(\"escape-layer\"), handle };\n stack.layers.push(entry);\n const drop = () => {\n const at = stack.layers.indexOf(entry);\n if (at !== -1) stack.layers.splice(at, 1);\n };\n return {\n raise() {\n drop();\n stack.layers.push(entry);\n },\n release: drop,\n };\n}\n\n/** How many layers hold the Escape stack (tests and diagnostics). */\nexport function escapeLayerDepth(): number {\n return escapeStack().layers.length;\n}\n\n/**\n * Hold a place in the Escape stack while `active`. The latest `onEscape` runs\n * (never a stale closure). `raiseKey`: when it changes the layer moves to the\n * top (pass a window manager's z-index). Returns a stable `raise()` for a\n * layer that tracks \"front\" itself (a pointerdown on the window).\n */\nexport function useEscapeLayer(active: boolean, onEscape: (event: KeyboardEvent) => void, raiseKey?: unknown): () => void {\n const latest = React.useRef(onEscape);\n latest.current = onEscape;\n const handleRef = React.useRef<EscapeLayerHandle | null>(null);\n React.useEffect(() => {\n if (!active) return undefined;\n const handle = pushEscapeLayer((event) => latest.current(event));\n handleRef.current = handle;\n return () => {\n handle.release();\n handleRef.current = null;\n };\n }, [active]);\n const first = React.useRef(true);\n React.useEffect(() => {\n if (first.current) {\n first.current = false;\n return;\n }\n handleRef.current?.raise();\n }, [raiseKey]);\n return React.useCallback(() => handleRef.current?.raise(), []);\n}\n","/**\n * THE TITLE TAKEOVER — every native `title` attribute in the document shows\n * as THE fleet tooltip instead of the browser's.\n *\n * Why this exists. A `title=` is the one tooltip nobody has to import, so it\n * is what every hand-written control reaches for: ~50 of them on an ordinary\n * matrx-frontend page (2026-09-28), next to the Radix tooltips on the tap\n * buttons. The browser draws those as a slow, unstyled system box, and a page\n * that mixes the two reads as having \"lost all of its tooltips\" (Arman,\n * 2026-09-28). Asking every author — human or agent — to wrap every control in\n * `<Tooltip>` is a rule that is broken the day it is written. So the\n * `TooltipProvider` every host already mounts at its root installs this layer,\n * and a `title` is simply a tooltip from then on. Nothing to remember.\n *\n * How it works. On hover (mouse or pen) or keyboard focus (`:focus-visible`)\n * of an element that carries a `title`, the attribute is lifted onto\n * `data-matrx-title` for exactly as long as the pointer or focus stays — so\n * the browser has nothing to show — and one shared, script-placed element\n * wearing `.matrx-tooltip` shows the text instead. When the pointer or focus\n * leaves, the `title` is put back, so assistive technology and every\n * `[title]` selector read the element exactly as authored the rest of the\n * time. Touch never shows it (a `title` has no touch affordance either).\n *\n * What it does not draw: a tooltip that only repeats text already readable in\n * full inside the element (it still draws when that text is hidden or\n * truncated).\n *\n * What it leaves alone:\n * - an element that is already a Radix tooltip trigger\n * (`[data-matrx-tooltip-trigger]`, stamped by `TooltipTrigger`): its\n * `title` is still lifted — two tooltips on one control was the other\n * half of the mess — but only the Radix one shows;\n * - anything inside `[data-native-title]` (the explicit opt-out);\n * - SVG `<title>` children, which are elements, not attributes.\n *\n * Placement. `tooltipSide` (THE SMART SIDE, below): beside a control in a\n * vertical stack, else the host's side; flipped when there is no room,\n * clamped into the viewport. `data-title-side=\"right\" | \"left\" | \"bottom\" |\n * \"top\"` on the element or any ancestor states a preferred side — a vertical\n * rail sets `right` once on its container.\n *\n * Installed at most once per document, reference-counted across every\n * mounted provider, and removed when the last one unmounts.\n */\n\n/**\n * THE SMART SIDE (Arman, 2026-10-15: tooltips \"don't show up intelligently\"). A tooltip never\n * covers the control next to its own. Where the control's neighbours stand decides the side:\n * - an explicit side (a prop, or `data-title-side` on the control or an ancestor below <html>) wins;\n * - an icon-sized control in a vertical stack (an icon column, a tool palette) has its neighbours\n * above and below, so it opens beside the control: right, or left when the control is in the\n * window's right half (an inspector column). A wide row in a list keeps the host's side: its\n * tooltip is the row's own text in full, and beside it would sit over the page next to the list;\n * - anywhere else (a toolbar, a row of buttons, a lone control) it opens on the host's default\n * side (`data-title-side` on <html>: macOS desktop hosts say \"bottom\"; the web's is \"top\").\n * Either way it flips to the other side when there is no room, and stays inside the window.\n */\nexport function tooltipSide(el: Element | null, fallback?: Side): Side {\n if (!el) return fallback ?? \"top\";\n const doc = el.ownerDocument;\n const hinted = el.closest(\"[data-title-side]\");\n const hint = hinted?.getAttribute(\"data-title-side\");\n const isSide = (v: string | null | undefined): v is Side => v === \"top\" || v === \"bottom\" || v === \"left\" || v === \"right\";\n if (hinted && hinted !== doc.documentElement && isSide(hint)) return hint;\n const base: Side = fallback ?? (isSide(hint) ? hint : \"top\");\n const box = el.getBoundingClientRect();\n if (box.width <= ICON_CONTROL_MAX_PX && stackDirection(el) === \"vertical\") {\n const vw = doc.defaultView?.innerWidth ?? 0;\n return vw > 0 && box.left + box.width / 2 > vw / 2 ? \"left\" : \"right\";\n }\n return base;\n}\n\n/** The widest control that counts as an icon (a navigator item, a palette tool). */\nconst ICON_CONTROL_MAX_PX = 64;\n\n/** How the control's nearest group of siblings is laid out, from where they actually are on screen. */\nfunction stackDirection(el: Element): \"vertical\" | \"horizontal\" | null {\n let node: Element | null = el;\n for (let depth = 0; node && depth < 4; depth++, node = node.parentElement) {\n const parent: Element | null = node.parentElement;\n if (!parent) return null;\n const me = node.getBoundingClientRect();\n if (me.width === 0 && me.height === 0) return null;\n let vertical = 0;\n let horizontal = 0;\n for (const sib of Array.from(parent.children)) {\n if (sib === node) continue;\n const r = sib.getBoundingClientRect();\n if (r.width === 0 || r.height === 0) continue;\n const overlapX = Math.min(me.right, r.right) - Math.max(me.left, r.left);\n const overlapY = Math.min(me.bottom, r.bottom) - Math.max(me.top, r.top);\n if (overlapX > 0.5 * Math.min(me.width, r.width) && overlapY <= 0) vertical++;\n else if (overlapY > 0.5 * Math.min(me.height, r.height) && overlapX <= 0) horizontal++;\n }\n if (vertical > 0 && horizontal === 0) return \"vertical\";\n if (horizontal > 0) return \"horizontal\";\n }\n return null;\n}\n\nexport const TITLE_TOOLTIP_ATTR = \"data-matrx-title\";\nexport const TOOLTIP_TRIGGER_ATTR = \"data-matrx-tooltip-trigger\";\nexport const NATIVE_TITLE_OPT_OUT_ATTR = \"data-native-title\";\n\nexport type Side = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nconst OPEN_DELAY_MS = 350;\n/** Moving from one titled control to the next inside this window is instant. */\nconst SKIP_DELAY_MS = 500;\n/**\n * THE HOVER BRIDGE. Leaving the control does not close the tooltip at once: the pointer has this\n * long to reach the tooltip itself (Arman, 2026-10-14: a tooltip must stay long enough to put the\n * mouse on it and copy its text). Entering the tooltip holds it open.\n */\n/**\n * THE TOOLTIP LAYER — above every other layer, always (Arman, 2026-10-14: a tooltip \"coming up\n * behind the content\"). Menus and popovers share the modal tier (equal z, DOM order decides), so a\n * tooltip on that tier lost to any menu opened after it. A tooltip is transient and never takes a\n * press, so nothing ever needs to sit above it.\n */\nexport const TOOLTIP_LAYER_Z = 2_147_483_000;\n\nexport const TOOLTIP_CLOSE_DELAY_MS = 300;\nconst GAP_PX = 6;\nconst EDGE_PX = 8;\n/** How far every tooltip stays from the window's edge (both implementations). */\nexport const TOOLTIP_EDGE_PX = EDGE_PX;\n/**\n * A tooltip is a short hint, never a paragraph (Apple HIG: a tooltip is a few words): text past\n * this budget is cut at a word boundary with an ellipsis. Long detail belongs in a sheet or a\n * Copy details action, not on hover.\n */\nexport const TOOLTIP_TEXT_BUDGET = 140;\n\nexport function clipTooltipText(text: string, budget: number = TOOLTIP_TEXT_BUDGET): string {\n const flat = text.replace(/\\s+/g, \" \").trim();\n if (flat.length <= budget) return flat;\n const cut = flat.slice(0, budget - 1);\n const space = cut.lastIndexOf(\" \");\n return `${(space > budget * 0.6 ? cut.slice(0, space) : cut).replace(/[\\s,.;:–—-]+$/, \"\")}…`;\n}\n\nconst SURFACE_CLASS =\n \"matrx-tooltip matrx-title-tooltip matrx-motion-popper max-w-xs select-text rounded-md border border-border bg-popover px-2.5 py-1 text-xs font-medium text-popover-foreground\";\n\ninterface Installation {\n count: number;\n uninstall: () => void;\n}\n\n/**\n * Keyed on the document itself through a registered symbol, never a module\n * WeakMap: tsup bundles this module into more than one entry (`index`,\n * `tap-target`), and two module copies each holding their own map would\n * install twice — two listeners, two surfaces.\n */\nconst INSTALLATION_KEY = Symbol.for(\"@ai-matrx/design-system/title-tooltips\");\ntype DocumentWithInstallation = Document & { [INSTALLATION_KEY]?: Installation };\nconst installations = {\n get: (doc: Document) => (doc as DocumentWithInstallation)[INSTALLATION_KEY],\n set: (doc: Document, value: Installation) => {\n (doc as DocumentWithInstallation)[INSTALLATION_KEY] = value;\n },\n delete: (doc: Document) => {\n delete (doc as DocumentWithInstallation)[INSTALLATION_KEY];\n },\n};\n\n/** Install the takeover on `doc`. Returns the release function. */\nexport function acquireTitleTooltips(doc: Document | undefined = typeof document === \"undefined\" ? undefined : document): () => void {\n if (!doc) return () => {};\n const existing = installations.get(doc);\n if (existing) {\n existing.count += 1;\n } else {\n installations.set(doc, { count: 1, uninstall: install(doc) });\n }\n let released = false;\n return () => {\n if (released) return;\n released = true;\n const current = installations.get(doc);\n if (!current) return;\n current.count -= 1;\n if (current.count <= 0) {\n current.uninstall();\n installations.delete(doc);\n }\n };\n}\n\nfunction install(doc: Document): () => void {\n const win = doc.defaultView;\n let active: HTMLElement | null = null;\n let surface: HTMLDivElement | null = null;\n let openTimer: ReturnType<typeof setTimeout> | undefined;\n let closeTimer: ReturnType<typeof setTimeout> | undefined;\n let lastClosedAt = 0;\n /** A press began on the tooltip (selecting its text): it must not close until release. */\n let holding = false;\n\n const HTMLElementCtor = win?.HTMLElement;\n\n const titledAncestor = (node: EventTarget | null): HTMLElement | null => {\n if (!HTMLElementCtor || !(node instanceof win!.Node)) return null;\n const start = node instanceof HTMLElementCtor ? node : (node as Node).parentElement;\n if (!start) return null;\n const el = start.closest<HTMLElement>(`[title], [${TITLE_TOOLTIP_ATTR}]`);\n if (!el || !(el instanceof HTMLElementCtor)) return null;\n if (el.closest(`[${NATIVE_TITLE_OPT_OUT_ATTR}]`)) return null;\n return el;\n };\n\n const textOf = (el: HTMLElement) => clipTooltipText(el.getAttribute(TITLE_TOOLTIP_ATTR) ?? el.getAttribute(\"title\") ?? \"\");\n\n const lift = (el: HTMLElement) => {\n const title = el.getAttribute(\"title\");\n if (title === null) return;\n el.setAttribute(TITLE_TOOLTIP_ATTR, title);\n el.removeAttribute(\"title\");\n };\n\n const restore = (el: HTMLElement) => {\n const held = el.getAttribute(TITLE_TOOLTIP_ATTR);\n if (held === null) return;\n // An author who changed or removed the title while it was lifted wins:\n // only put ours back when nothing re-set it in the meantime.\n if (!el.hasAttribute(\"title\")) el.setAttribute(\"title\", held);\n el.removeAttribute(TITLE_TOOLTIP_ATTR);\n };\n\n const ensureSurface = () => {\n if (surface && surface.isConnected) return surface;\n surface = doc.createElement(\"div\");\n surface.setAttribute(\"role\", \"tooltip\");\n surface.setAttribute(\"data-slot\", \"title-tooltip\");\n surface.className = SURFACE_CLASS;\n surface.style.position = \"fixed\";\n surface.style.zIndex = String(TOOLTIP_LAYER_Z);\n surface.style.visibility = \"hidden\";\n doc.body.appendChild(surface);\n return surface;\n };\n\n /**\n * THE PART OF `el` A PERSON CAN SEE: its box clipped by every ancestor that clips (scrolls or hides\n * overflow) and by the window. A truncated cell in a sideways-scrolling table is far wider than its\n * visible part; anchored to the whole box the tooltip landed at the window's edge (2026-10-14).\n */\n const visibleRect = (el: HTMLElement, vw: number, vh: number) => {\n const box = el.getBoundingClientRect();\n let left = box.left;\n let top = box.top;\n let right = box.right;\n let bottom = box.bottom;\n for (let node = el.parentElement; node && node !== doc.body && node !== doc.documentElement; node = node.parentElement) {\n const cs = win?.getComputedStyle(node);\n if (!cs) break;\n const clipsX = cs.overflowX !== \"visible\" || cs.overflow === \"hidden\";\n const clipsY = cs.overflowY !== \"visible\" || cs.overflow === \"hidden\";\n if (!clipsX && !clipsY) continue;\n const clip = node.getBoundingClientRect();\n if (clipsX) { left = Math.max(left, clip.left); right = Math.min(right, clip.right); }\n if (clipsY) { top = Math.max(top, clip.top); bottom = Math.min(bottom, clip.bottom); }\n }\n left = Math.max(left, 0);\n top = Math.max(top, 0);\n right = Math.min(right, vw || right);\n bottom = Math.min(bottom, vh || bottom);\n // Nothing of it is visible (scrolled away under the pointer is impossible, but a test DOM can say so): the box itself.\n if (right <= left || bottom <= top) return box;\n return { left, top, right, bottom, width: right - left, height: bottom - top };\n };\n\n const preferredSide = (el: HTMLElement): Side => tooltipSide(el);\n\n const place = (el: HTMLElement, node: HTMLDivElement) => {\n // The VISIBLE viewport, not the window: inside a clipped host (the kind\n // sandbox frame is window-wide but shown only at its column) the visual\n // viewport is what the reader sees, so a tooltip never lands past it.\n const vw = win?.visualViewport?.width ?? win?.innerWidth ?? 0;\n const vh = win?.visualViewport?.height ?? win?.innerHeight ?? 0;\n const anchor = visibleRect(el, vw, vh);\n const box = node.getBoundingClientRect();\n const fits: Record<Side, boolean> = {\n top: anchor.top - GAP_PX - box.height >= EDGE_PX,\n bottom: anchor.bottom + GAP_PX + box.height <= vh - EDGE_PX,\n left: anchor.left - GAP_PX - box.width >= EDGE_PX,\n right: anchor.right + GAP_PX + box.width <= vw - EDGE_PX,\n };\n const opposite: Record<Side, Side> = { top: \"bottom\", bottom: \"top\", left: \"right\", right: \"left\" };\n const wanted = preferredSide(el);\n const side: Side = fits[wanted] ? wanted : fits[opposite[wanted]] ? opposite[wanted] : wanted;\n\n let x: number;\n let y: number;\n if (side === \"top\" || side === \"bottom\") {\n x = anchor.left + anchor.width / 2 - box.width / 2;\n y = side === \"top\" ? anchor.top - GAP_PX - box.height : anchor.bottom + GAP_PX;\n } else {\n y = anchor.top + anchor.height / 2 - box.height / 2;\n x = side === \"left\" ? anchor.left - GAP_PX - box.width : anchor.right + GAP_PX;\n }\n x = Math.min(Math.max(x, EDGE_PX), Math.max(EDGE_PX, vw - EDGE_PX - box.width));\n y = Math.min(Math.max(y, EDGE_PX), Math.max(EDGE_PX, vh - EDGE_PX - box.height));\n // Placed with `left`/`top`, NEVER `transform`: the open animation\n // (`.matrx-motion-popper`) animates `transform`, and a running animation\n // overrides an inline transform — the chip sat at the page's top-left\n // corner for the whole animation, then jumped to its control (2026-10-08).\n node.style.left = `${Math.round(x)}px`;\n node.style.top = `${Math.round(y)}px`;\n node.setAttribute(\"data-side\", side);\n };\n\n const isShown = (node: HTMLElement, root: HTMLElement) => {\n const rect = node.getBoundingClientRect();\n if (rect.width <= 0 || rect.height <= 0) return false;\n for (let cur: HTMLElement | null = node; cur; cur = cur === root ? null : cur.parentElement) {\n const cs = win?.getComputedStyle(cur);\n if (!cs) return false;\n if (cs.display === \"none\" || cs.visibility === \"hidden\" || Number(cs.opacity) === 0) return false;\n }\n return true;\n };\n\n /**\n * A tooltip that repeats text the person can already read in full is noise\n * (an expanded sidebar row, a \"Save\" button titled \"Save\"). It still shows\n * when that text is hidden (a collapsed rail's label) or cut off\n * (truncated) — the two cases a title exists for.\n */\n const isClipped = (host: HTMLElement, root: HTMLElement) => {\n for (let node: HTMLElement | null = host; node; node = node.parentElement) {\n if (node.scrollWidth > node.clientWidth + 1 && node.clientWidth > 0) return true;\n if (node.scrollHeight > node.clientHeight + 1 && node.clientHeight > 0) return true;\n if (node === root) break;\n }\n return false;\n };\n\n const repeatsVisibleText = (el: HTMLElement, text: string) => {\n const norm = (t: string) => t.replace(/\\s+/g, \" \").trim().toLowerCase();\n const want = norm(text);\n if (!want || !win) return false;\n const walker = doc.createTreeWalker(el, win.NodeFilter.SHOW_TEXT);\n for (let node = walker.nextNode(); node; node = walker.nextNode()) {\n if (norm(node.textContent ?? \"\") !== want) continue;\n const host = node.parentElement;\n if (!host || !isShown(host, el)) continue;\n // Cut off is measured on the BOX that clips: an inline host (a span inside a truncating\n // cell) has no box width of its own, so every ancestor up to the titled element is asked.\n if (isClipped(host, el)) continue;\n return true;\n }\n return false;\n };\n\n const show = (el: HTMLElement, instant: boolean) => {\n if (active !== el) return;\n // A Radix tooltip trigger shows its own tooltip — never a second one.\n if (el.closest(`[${TOOLTIP_TRIGGER_ATTR}]`)) return;\n const text = textOf(el);\n if (!text || !el.isConnected) return;\n if (repeatsVisibleText(el, text)) return;\n const node = ensureSurface();\n node.textContent = text;\n node.style.visibility = \"hidden\";\n // Measure and place BEFORE the open state starts the animation: measured\n // mid-animation the box reads at its 0.95 entry scale and lands off-centre.\n node.removeAttribute(\"data-state\");\n // The surface is ONE shared fixed element that keeps the `left` of its last\n // placement. Measured there, a longer text wraps against the room that is\n // left of the OLD spot, reads one line too tall, and lands a line too high\n // once it moves (the sandbox tooltip spec caught a 16px extra gap). Rewind\n // to the origin so the box is measured at its natural, unwrapped size.\n node.style.left = \"0px\";\n node.style.top = \"0px\";\n place(el, node);\n node.setAttribute(\"data-state\", instant ? \"instant-open\" : \"delayed-open\");\n node.style.visibility = \"visible\";\n if (el.id) node.id = `${el.id}-title-tooltip`;\n };\n\n const hide = () => {\n if (openTimer !== undefined) clearTimeout(openTimer);\n openTimer = undefined;\n cancelClose();\n holding = false;\n if (surface && surface.style.visibility === \"visible\") lastClosedAt = Date.now();\n if (surface) {\n surface.style.visibility = \"hidden\";\n surface.removeAttribute(\"data-state\");\n }\n };\n\n const cancelClose = () => {\n if (closeTimer !== undefined) clearTimeout(closeTimer);\n closeTimer = undefined;\n };\n\n const inSurface = (node: EventTarget | null) =>\n !!surface && !!win && node instanceof win.Node && surface.contains(node);\n\n const hasSelectionInSurface = () => {\n const sel = win?.getSelection();\n return !!sel && !sel.isCollapsed && !!surface && !!sel.anchorNode && surface.contains(sel.anchorNode);\n };\n\n /** Close after the bridge delay unless the pointer reached the tooltip or text in it is selected. */\n const scheduleClose = () => {\n cancelClose();\n // Nothing is showing yet (the open delay has not run, or the text was not worth drawing): there is\n // nothing to bridge to, so leaving simply cancels.\n if (!surface || surface.style.visibility !== \"visible\") {\n deactivate();\n return;\n }\n closeTimer = setTimeout(() => {\n closeTimer = undefined;\n if (holding || hasSelectionInSurface()) return;\n deactivate();\n }, TOOLTIP_CLOSE_DELAY_MS);\n };\n\n const activate = (el: HTMLElement) => {\n cancelClose();\n if (active === el) return;\n deactivate();\n active = el;\n lift(el);\n const instant = Date.now() - lastClosedAt < SKIP_DELAY_MS;\n if (instant) show(el, true);\n else openTimer = setTimeout(() => show(el, false), OPEN_DELAY_MS);\n };\n\n const deactivate = () => {\n hide();\n if (active) restore(active);\n active = null;\n };\n\n // A touch has no hover: the tap that focuses a button must not open its tooltip, and a tooltip\n // that is open when a finger lands closes. The compat mouse events and the focus a tap leaves\n // behind used to pin \"Copy chart source\" over the chart title on a phone (review 5, G13).\n let lastTouchAt = Number.NEGATIVE_INFINITY;\n const TOUCH_FOCUS_WINDOW_MS = 1000;\n const onPointerOver = (e: PointerEvent) => {\n if (e.pointerType === \"touch\") {\n lastTouchAt = Date.now();\n if (active) deactivate();\n return;\n }\n if (inSurface(e.target)) {\n cancelClose();\n return;\n }\n if (holding || hasSelectionInSurface()) {\n // Text is being selected in the tooltip: another control passing under the pointer must not replace it.\n return;\n }\n const el = titledAncestor(e.target);\n if (el) activate(el);\n else if (active && closeTimer === undefined) scheduleClose();\n };\n\n const onPointerOut = (e: PointerEvent) => {\n if (!active) return;\n const next = e.relatedTarget;\n if (next instanceof win!.Node && (active.contains(next) || inSurface(next))) return;\n if (inSurface(e.target)) {\n if (holding) return;\n scheduleClose();\n return;\n }\n scheduleClose();\n };\n\n const onPointerDown = (e: PointerEvent) => {\n if (e.pointerType === \"touch\") lastTouchAt = Date.now();\n if (inSurface(e.target)) {\n // Selecting the tooltip's text: keep it open until the press ends.\n holding = true;\n cancelClose();\n return;\n }\n deactivate();\n };\n\n const onPointerUp = () => {\n if (!holding) return;\n holding = false;\n if (!hasSelectionInSurface()) scheduleClose();\n };\n\n const onFocusIn = (e: FocusEvent) => {\n if (Date.now() - lastTouchAt < TOUCH_FOCUS_WINDOW_MS) return;\n const el = titledAncestor(e.target);\n if (!el) return;\n let visible = true;\n try {\n visible = (e.target as Element).matches(\":focus-visible\");\n } catch {\n visible = true;\n }\n if (visible) activate(el);\n };\n\n const onFocusOut = (e: FocusEvent) => {\n if (!active) return;\n const next = e.relatedTarget;\n if (next instanceof win!.Node && active.contains(next)) return;\n deactivate();\n };\n\n const onDismiss = (e?: Event) => {\n if (e && inSurface(e.target)) return;\n deactivate();\n };\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") deactivate();\n };\n\n doc.addEventListener(\"pointerover\", onPointerOver, true);\n doc.addEventListener(\"pointerout\", onPointerOut, true);\n doc.addEventListener(\"focusin\", onFocusIn, true);\n doc.addEventListener(\"focusout\", onFocusOut, true);\n doc.addEventListener(\"pointerdown\", onPointerDown, true);\n doc.addEventListener(\"pointerup\", onPointerUp, true);\n doc.addEventListener(\"keydown\", onKeyDown, true);\n doc.addEventListener(\"scroll\", onDismiss, true);\n win?.addEventListener(\"blur\", onDismiss);\n\n return () => {\n deactivate();\n doc.removeEventListener(\"pointerover\", onPointerOver, true);\n doc.removeEventListener(\"pointerout\", onPointerOut, true);\n doc.removeEventListener(\"focusin\", onFocusIn, true);\n doc.removeEventListener(\"focusout\", onFocusOut, true);\n doc.removeEventListener(\"pointerdown\", onPointerDown, true);\n doc.removeEventListener(\"pointerup\", onPointerUp, true);\n doc.removeEventListener(\"keydown\", onKeyDown, true);\n doc.removeEventListener(\"scroll\", onDismiss, true);\n win?.removeEventListener(\"blur\", onDismiss);\n surface?.remove();\n surface = null;\n };\n}\n","/**\n * THE MOTION CONTRACT (0.10.0) — the class names every animated surface in\n * this package puts on the DOM, in ONE place.\n *\n * Why a module and not ten inline strings: the sweep that produced this file\n * found the same defect ten times over, and it was invisible each time\n * because each primitive spelled its animation out by hand. Ten hand-written\n * copies of `data-[state=open]:animate-in data-[state=closed]:animate-out\n * data-[state=closed]:fade-out-0 …` meant ten chances to reach for a utility\n * nothing in the package defines — which is exactly what happened. A single\n * exported constant per motion SHAPE means the next primitive cannot invent\n * an eleventh spelling, and `styles.test.ts` can prove every one of them\n * resolves to a rule in the shipped stylesheet.\n *\n * Every rule these name lives in `styles.css` under the package's own\n * keyframes. NONE of them is a Tailwind utility, and none requires a host\n * plugin — see that file's header for the measurement that made this\n * necessary.\n */\n\n/** Modal scrims: Dialog, AlertDialog, Sheet, CommandDialog. Fade only. */\nexport const MOTION_OVERLAY = \"matrx-motion-overlay\";\n\n/** The centered dialog card. Fades and scales; centering is not its business. */\nexport const MOTION_DIALOG = \"matrx-motion-dialog\";\n\n/**\n * THE CENTERING OF A CENTERED DIALOG CARD — package-owned, in the `translate`\n * property, and NEVER a Tailwind `translate-x-[-50%] translate-y-[-50%]` pair.\n *\n * Those utilities do not compile to the same thing in every host: Tailwind v3\n * writes them into `transform`, Tailwind v4 writes them into the independent\n * `translate` property, which COMPOSES with `transform` instead of being\n * replaced by it. 0.10.0's keyframes restated the centering inside `transform`,\n * which was harmless on v3 and doubled the centering on v4 — the card flew in\n * from off the top-left of the viewport for the animation's whole duration and\n * snapped into place at the end (fixed in 0.10.1).\n *\n * Owning it here means one spelling that reads the same on both, and it frees\n * `transform` so the keyframes carry ONLY the delta. Put this on every centered\n * surface UNCONDITIONALLY — it is geometry, so unlike {@link MOTION_DIALOG} it\n * must survive `animated={false}`. Its rule ships in `styles.css`.\n */\nexport const CENTERED_DIALOG = \"matrx-dialog-centered\";\n\n/**\n * The resting gap between a `popper`-positioned surface and its trigger, for\n * the primitives that want one (today: `Select`). Same law and same reason as\n * {@link CENTERED_DIALOG} — a position an animated surface holds AT REST is\n * the `translate` property's job, never a Tailwind translate utility, because\n * those land in `transform` on a v3 host and in `translate` on a v4 one while\n * the keyframes animate `transform` either way. Sizes from\n * `--matrx-popper-offset`; keys off Radix's `data-side`.\n */\nexport const POPPER_OFFSET = \"matrx-popper-offset\";\n\n/** The mobile Dialog / CommandDialog bottom sheet. Slides up and fades. */\nexport const MOTION_BOTTOM_SHEET = \"matrx-motion-bottom-sheet\";\n\n/**\n * Radix-popper surfaces: Popover, DropdownMenu, ContextMenu, HoverCard,\n * Select, Tooltip. Reads `--radix-popper-transform-origin` so the surface\n * grows out of its trigger, and `data-side` so it travels from it.\n */\nexport const MOTION_POPPER = \"matrx-motion-popper\";\n\n/** Edge sheets, one class per `sheetVariants` side. */\nexport const MOTION_SHEET = {\n top: \"matrx-motion-sheet-top\",\n bottom: \"matrx-motion-sheet-bottom\",\n left: \"matrx-motion-sheet-left\",\n right: \"matrx-motion-sheet-right\",\n center: \"matrx-motion-sheet-center\",\n} as const;\n\n/** Skeleton's breathing loop. */\nexport const MOTION_PULSE = \"matrx-pulse\";\n/** A waiting box's crossing band of light (Skeleton `motion=\"shimmer\"`). Reduced motion: a slow breathe, no travel. */\nexport const MOTION_SHIMMER = \"matrx-shimmer\";\n\n/** The spinner loop, for every inline busy indicator in the package. */\nexport const MOTION_SPIN = \"matrx-spin\";\n\n/**\n * FirstUseHint's beacon: a soft ring that pulses three times around the anchor, on\n * `box-shadow` only, so nothing moves. A still ring under reduced motion.\n */\nexport const MOTION_HINT_BEACON = \"matrx-motion-hint-beacon\";\n\n/**\n * Every motion class the package ships, for the guards. If a rule for one of\n * these is missing from `styles.css`, a component animates in no consumer and\n * says nothing about it — the C26 failure this list exists to make loud.\n */\nexport const ALL_MOTION_CLASSES = [\n MOTION_OVERLAY,\n MOTION_DIALOG,\n MOTION_BOTTOM_SHEET,\n MOTION_POPPER,\n ...Object.values(MOTION_SHEET),\n MOTION_PULSE,\n MOTION_SHIMMER,\n MOTION_SPIN,\n MOTION_HINT_BEACON,\n] as const;\n\n/**\n * The host-plugin utilities this package is forbidden to emit. They are\n * supplied by `tailwindcss-animate` / `tw-animate-css`, which is a HOST CSS\n * entry concern a package cannot declare a dependency on: three of the four\n * AI Matrx consumers never loaded it, so every surface wearing these appeared\n * with no animation and no error. `styles.test.ts` fails the build if one\n * comes back.\n */\nexport const FORBIDDEN_HOST_MOTION_UTILITIES = [\n \"animate-in\",\n \"animate-out\",\n \"fade-in\",\n \"fade-out\",\n \"zoom-in\",\n \"zoom-out\",\n \"slide-in-from\",\n \"slide-out-to\",\n \"animate-accordion\",\n \"animate-slide-down\",\n \"animate-slide-up\",\n \"animate-pulse\",\n \"animate-spin\",\n] as const;\n\n/**\n * THE PANEL MOTION as a Tailwind class string (moved from matrx-frontend\n * `lib/motion/panel-motion.ts`): every panel, sidebar, dock, drawer and sheet\n * slides its size/position on the host's `--matrx-motion-duration-panel` /\n * `--matrx-motion-ease-panel` (tokens.css ships the standard). Pair it with the\n * transition property you animate (`transition-transform`, …).\n */\nexport const PANEL_MOTION_CLASS =\n \"duration-(--matrx-motion-duration-panel) ease-(--matrx-motion-ease-panel) motion-reduce:transition-none\";\nexport const PANEL_MOTION_DURATION_VAR = \"var(--matrx-motion-duration-panel)\";\nexport const PANEL_MOTION_EASE_VAR = \"var(--matrx-motion-ease-panel)\";\n","\"use client\";\n\n/**\n * Injected portal-container seam.\n *\n * The matrx-frontend original resolved nested portal targets through\n * `useNestedPortalContainer` (explicit prop > dialog content > popout body >\n * document.body) — a host-shaped hook wired to that app's dialog and\n * window-panel systems. The package inverts the seam: hosts provide the\n * resolved container through `PortalContainerProvider`; an explicit\n * `container` prop on a component still wins, and with neither the portal\n * falls through to `document.body` (Radix default). Priority semantics are\n * unchanged from the original.\n */\n\nimport * as React from \"react\";\n\n// Shared identity across independently bundled public entrypoints/loaders.\nconst CONTEXT_SLOT = Symbol.for(\"ai-matrx.design-system.portal-container-context\");\nconst contextRegistry = globalThis as typeof globalThis & { [CONTEXT_SLOT]?: React.Context<HTMLElement | null | undefined> };\nconst PortalContainerContext = contextRegistry[CONTEXT_SLOT] ??= React.createContext<HTMLElement | null | undefined>(undefined);\n\nexport interface PortalContainerProviderProps {\n /** Where nested Radix portals (Popover, etc.) should mount. `null`/`undefined` → document.body. */\n container: HTMLElement | null | undefined;\n children: React.ReactNode;\n}\n\nexport function PortalContainerProvider({\n container,\n children,\n}: PortalContainerProviderProps) {\n return (\n <PortalContainerContext.Provider value={container ?? undefined}>\n {children}\n </PortalContainerContext.Provider>\n );\n}\n\n/**\n * Resolve a portal target: explicit prop (including an explicit `null`,\n * meaning \"the default body\") beats the injected container.\n */\nexport function usePortalContainer(\n explicit?: HTMLElement | null,\n): HTMLElement | undefined {\n const injected = React.useContext(PortalContainerContext);\n\n if (explicit !== undefined) {\n return explicit ?? undefined;\n }\n\n return injected ?? undefined;\n}\n","/**\n * THE FOCUS-RETURN GUARD — a closing menu, popover, select or dialog never takes focus back from a\n * field the person has already moved into.\n *\n * Radix returns focus to the trigger when its content UNMOUNTS (FocusScope: a `setTimeout(0)` after the\n * exit animation, unconditionally). On a busy page that is hundreds of milliseconds after the person\n * picked an option — long enough for them to click the next field and start typing. The return then\n * lands mid-word: focus jumps to the trigger and every key after it is lost (\"https://drive…\" saved as\n * \"https:\", Applet social planner, 2026-10-08).\n *\n * `keepMovedFocus(handler)` composes a content's `onCloseAutoFocus`: when focus already sits on a live\n * element outside the closing content (not the page body), the return is canceled; otherwise Radix\n * returns focus to the trigger exactly as before (keyboard users closing with Escape keep their place).\n */\n/** True when focus has already moved to something the person chose, outside `container`. */\nexport function focusMovedElsewhere(container: EventTarget | null, doc: Document | undefined = typeof document === \"undefined\" ? undefined : document): boolean {\n if (!doc) return false;\n const active = doc.activeElement;\n if (!active || active === doc.body || active === doc.documentElement) return false;\n if (!active.isConnected) return false;\n if (container && typeof (container as Node).contains === \"function\" && (container as Node).contains(active)) return false;\n return true;\n}\n\n/** Compose a content's `onCloseAutoFocus` with THE FOCUS-RETURN GUARD (the caller's handler runs first). */\nexport function keepMovedFocus(handler?: (event: Event) => void): (event: Event) => void {\n return (event: Event) => {\n handler?.(event);\n if (event.defaultPrevented) return;\n const container = (event.currentTarget ?? event.target) as EventTarget | null;\n if (focusMovedElsewhere(container, (container as Node | null)?.ownerDocument ?? undefined)) event.preventDefault();\n };\n}\n","\"use client\";\n\n/**\n * 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","/**\n * The opaque surface option shared by every floating menu surface\n * (`PopoverContent`, `DropdownMenuContent`, `DropdownMenuSubContent`).\n * `data-surface=\"solid\"` is also styled in `styles.css`, so the fill holds even\n * where a host utility layer tints the default surface.\n */\nexport type PopoverSurface = \"default\" | \"solid\";\n\nexport const SOLID_SURFACE_CLASS =\n \"bg-[hsl(var(--popover)/1)] [backdrop-filter:none] [-webkit-backdrop-filter:none]\";\n","\"use client\";\n\n/**\n * Select — ported verbatim from matrx-frontend `components/ui/select.tsx`.\n *\n * Seam inversions:\n * - The host's `useNestedPortalContainer` (dialog/popout aware) becomes the\n * injected `PortalContainerProvider` seam (`portal-container.tsx`); the\n * explicit `container` prop keeps top priority, exactly as before.\n * - `ChevronDownIcon` / `ChevronUpIcon` / `CheckIcon` come from the package's\n * inlined SVGs (C19), not @radix-ui/react-icons — same glyphs, same\n * viewBoxes. (The origin also imported `CaretSortIcon` without ever using\n * it; the dead import is not carried along.)\n *\n * THE ROOT RENDERS UNCONDITIONALLY — no mount gate. This wrapper used to defer\n * rendering until after hydration (\"Radix generates dynamic aria-controls ids\n * that differ between SSR and client\"), and that justification was false:\n * Radix ids come from React's SSR-stable `useId` (verified against\n * @radix-ui/react-select 2.3.1 / react-id 1.1.2). The gate was actively\n * harmful — it deleted the ALWAYS-VISIBLE select trigger (a form control)\n * from SSR and the first client paint.\n */\n\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { MOTION_POPPER, POPPER_OFFSET } from \"./motion\";\nimport { RadixCheckIcon, RadixChevronDownIcon, RadixChevronUpIcon } from \"./icons\";\nimport { usePortalContainer } from \"./portal-container\";\nimport { FIELD_SURFACE_CLASS } from \"./field-surface\";\nimport { keepMovedFocus } from \"./focus-return\";\n\nexport const Select = SelectPrimitive.Root;\n\nexport const SelectGroup = SelectPrimitive.Group;\n\nexport const SelectValue = SelectPrimitive.Value;\n\nexport const selectTriggerVariants = cva(\n `matrx-glyph-trim flex w-full items-center justify-between gap-2 whitespace-nowrap rounded-md ${FIELD_SURFACE_CLASS} text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground transition-colors hover:bg-accent hover:border-accent-foreground/20 focus:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15 data-[state=open]:border-primary disabled:cursor-not-allowed disabled:bg-muted disabled:text-disabled-foreground [&>span]:min-w-0 [&>span]:line-clamp-1`,\n {\n variants: {\n size: {\n sm: \"h-7 px-2 py-1 text-xs\",\n default: \"h-9 px-3 py-1\",\n lg: \"h-10 px-3 py-2\",\n },\n },\n defaultVariants: {\n size: \"default\",\n },\n },\n);\n\n/**\n * THE ONE DROPDOWN CHEVRON (page-pass 2026-09-27, /crm/<id>). Pickers drew three\n * different trigger glyphs side by side — a down chevron, an up-down pair, and\n * a larger up-down — so one form read as three kinds of control. Every dropdown\n * trigger (Select, CreatablePicker, every host combobox) draws THIS.\n */\nexport function SelectChevron({ className, size = \"default\" }: { className?: string | undefined; size?: \"sm\" | \"default\" | undefined }) {\n return (\n <RadixChevronDownIcon\n aria-hidden=\"true\"\n data-select-chevron=\"\"\n className={cn(size === \"sm\" ? \"h-3.5 w-3.5\" : \"h-4 w-4\", \"shrink-0 opacity-50\", className)}\n />\n );\n}\n\nexport interface SelectTriggerProps\n extends\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>,\n VariantProps<typeof selectTriggerVariants> {\n hideArrow?: boolean;\n}\n\nexport const SelectTrigger = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Trigger>,\n SelectTriggerProps\n>(({ className, children, hideArrow = false, size, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(selectTriggerVariants({ size, className }))}\n {...props}\n >\n {children}\n {!hideArrow && (\n <SelectPrimitive.Icon asChild>\n <SelectChevron size={size === \"sm\" ? \"sm\" : \"default\"} />\n </SelectPrimitive.Icon>\n )}\n </SelectPrimitive.Trigger>\n));\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nexport const SelectScrollUpButton = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className,\n )}\n {...props}\n >\n <RadixChevronUpIcon />\n </SelectPrimitive.ScrollUpButton>\n));\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\nexport const SelectScrollDownButton = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className,\n )}\n {...props}\n >\n <RadixChevronDownIcon />\n </SelectPrimitive.ScrollDownButton>\n));\nSelectScrollDownButton.displayName =\n SelectPrimitive.ScrollDownButton.displayName;\n\nexport interface SelectContentProps\n extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> {\n /** Explicit portal target; wins over the injected container. */\n container?: HTMLElement | null;\n /**\n * Package-owned open/close motion. Default `true`. Pass `false` for a\n * surface that must appear instantly. It is NOT the reduced-motion switch;\n * `styles.css` already honors `prefers-reduced-motion`.\n */\n animated?: boolean;\n}\n\nexport const SelectContent = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Content>,\n SelectContentProps\n>(\n (\n {\n className,\n children,\n position = \"popper\",\n container,\n animated = true,\n onCloseAutoFocus,\n ...props\n },\n ref,\n ) => {\n const portalContainer = usePortalContainer(container);\n return (\n <SelectPrimitive.Portal container={portalContainer}>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n \"relative z-[10001] max-h-96 min-w-[8rem] max-w-[calc(100vw-2rem)] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md\",\n animated && MOTION_POPPER,\n // The resting gap from the trigger. It is the `translate` property\n // (POPPER_OFFSET), never Tailwind translate utilities: those compose\n // with `transform` on a v4 host and are REPLACED by it on a v3 one,\n // so on v3 the animation ate the gap and the surface snapped 4px at\n // the end. Same law as the centered dialog card — see motion.ts.\n position === \"popper\" && POPPER_OFFSET,\n className,\n )}\n position={position}\n {...props}\n onCloseAutoFocus={keepMovedFocus(onCloseAutoFocus)}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n \"max-w-full overflow-y-auto p-0.5\",\n position === \"popper\" &&\n \"w-full min-w-[var(--radix-select-trigger-width)] max-h-[var(--radix-select-content-available-height)]\",\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n});\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nexport const SelectLabel = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn(\"type-label px-2 pb-1 pt-2 text-muted-foreground\", className)}\n {...props}\n />\n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\nexport const SelectItem = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> & {\n /**\n * What the option means, as its HOVER text — never a second line (Arman,\n * 2026-10-14: no \"novels\" in menus). An option is one line; the trigger\n * shows exactly that line.\n */\n description?: string;\n /** Short trailing text in the menu only (a count, a size, why it cannot be chosen); the trigger never shows it. */\n meta?: React.ReactNode;\n }\n>(({ className, children, description, meta, title, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n title={title ?? description}\n className={cn(\n \"relative flex w-full min-w-0 select-none items-center rounded-sm py-1 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:text-disabled-foreground\",\n className,\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex h-3.5 w-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <RadixCheckIcon className=\"h-4 w-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <span className=\"min-w-0 whitespace-normal break-words [overflow-wrap:anywhere]\">\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </span>\n {meta ? (\n <span data-slot=\"select-item-meta\" className=\"ml-3 min-w-0 shrink text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {meta}\n </span>\n ) : null}\n </SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\nexport const SelectSeparator = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n","/**\n * THE ONE FIELD SURFACE (page-pass shared fix, 2026-09-27).\n *\n * Every control a person types into or picks from — Input, BasicInput,\n * Textarea, the Select trigger, and the host's ProInput / ProTextarea — sits on\n * this fill and this border. They used to disagree: Input and the elevated\n * Textarea filled with `bg-background` (the gray page color in light mode),\n * BasicInput and the control Textarea were `bg-transparent` (gray on a gray\n * page), while the Select trigger filled with `bg-card` (white). On one form\n * the text fields therefore looked disabled beside white Selects\n * (/hr/settings/employer, the message-template editor) — a screen that lies\n * about what it will let you do.\n *\n * The surface is the Select's: the card fill and the regular border. A caller\n * that genuinely wants no fill (an inline cell editor) still passes\n * `bg-transparent`, which wins through `cn`.\n */\nexport const FIELD_SURFACE_CLASS = \"border border-border bg-card\";\n","import * as React from \"react\";\n\n/** True when a node holds visible text anywhere in its React tree. */\nfunction hasText(node: React.ReactNode): boolean {\n if (typeof node === \"string\") return node.trim().length > 0;\n if (typeof node === \"number\" || typeof node === \"bigint\") return true;\n if (Array.isArray(node)) return node.some(hasText);\n if (React.isValidElement<{ children?: React.ReactNode }>(node)) return hasText(node.props.children);\n return false;\n}\n\n/**\n * A segment whose children are a glyph and no text — the square segment. Decided here, not in\n * CSS: `:has(> svg:only-child)` ignores text nodes, so an icon + name tab matched as well.\n */\nexport function isIconOnly(children: React.ReactNode): boolean {\n return React.Children.toArray(children).some((c) => React.isValidElement(c)) && !hasText(children);\n}\n","\"use client\";\n\n/**\n * Textarea — the multi-line twin of the Input family, same three shapes:\n * `Textarea` (elevated), `BasicTextarea` (plain control), and\n * `TextareaWithPrefix`.\n *\n * WHAT THE FORKS PROVED. Three hosts shipped a bare `<textarea>` with a\n * min-height and nothing else; matrx-frontend shipped auto-grow, min/max\n * height clamping, and a stretch-detection pass. That last one is the reason\n * this file is worth having: a `<textarea>` is a REPLACED element, so\n * `className=\"h-full\"` on it does nothing useful unless its parent is also\n * told to stretch — which is why every host that wanted a filling textarea\n * ended up wrapping it by hand at the call site, differently each time.\n * `getStretchClasses` reads the caller's own fill intent out of the className\n * and builds the wrapper for them.\n *\n * COLOR IS TOKENS (C26). The ported original pinned its body text to literal\n * black/white, its placeholder and focus ring to raw palette steps, and its\n * dark elevation to a custom property no host defined — so that shadow\n * computed to nothing. All four now resolve from the semantic vocabulary.\n *\n * AND `shadow-textarea` NOW EXISTS. The original's resting elevation class was\n * `shadow-textarea`, and NO host defined `--shadow-textarea` or generated that\n * utility — 125 call sites asked for an elevation they never got. The package\n * ships the token (defaulting to the Input family's `--shadow-input`, which is\n * plainly what the twin class meant) and the rule, so the class finally does\n * what it says. A host that wants the flat look sets `--shadow-textarea: none`.\n *\n * The clipboard/motion variants matrx-frontend layers on top (CopyTextarea,\n * FancyTextarea) stay host-owned under the C8 split-out law: they drag in\n * `motion/react`, and plain-textarea consumers must not pay for it.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { FIELD_SURFACE_CLASS } from \"./field-surface\";\n\nexport interface TextareaProps\n extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {\n /** Grow to fit content as the user types (and stop growing at `maxHeight`). */\n autoGrow?: boolean;\n /** Minimum height in px. */\n minHeight?: number;\n /** Maximum height in px; past it the field scrolls instead of growing. */\n maxHeight?: number;\n /** Classes for the wrapper this component adds when one is needed. */\n wrapperClassName?: string;\n}\n\nconst FILL_HEIGHT_REGEX = /(?:^|\\s)(h-full|h-dvh|flex-1|grow)(?:\\s|$)/;\nconst FILL_WIDTH_REGEX = /(?:^|\\s)(w-full|w-screen)(?:\\s|$)/;\n\n/**\n * A `<textarea>` cannot fill a box on its own — the box has to be told too.\n * Read the caller's fill intent out of its own className and mirror it onto\n * the wrapper, so `className=\"h-full\"` means what the caller thought it meant.\n */\nfunction getStretchClasses(className?: string): string | undefined {\n if (!className) return undefined;\n const fills: string[] = [];\n if (FILL_HEIGHT_REGEX.test(className)) fills.push(\"h-full min-h-0\");\n if (FILL_WIDTH_REGEX.test(className)) fills.push(\"w-full\");\n return fills.length ? fills.join(\" \") : undefined;\n}\n\nconst TEXTAREA_ELEVATED_CLASS =\n `flex h-auto w-full rounded-md ${FIELD_SURFACE_CLASS} px-3 py-2 text-sm text-foreground shadow-textarea transition duration-400 placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15 disabled:cursor-not-allowed disabled:opacity-50`;\n\nconst TEXTAREA_CONTROL_CLASS =\n `flex w-full rounded-md ${FIELD_SURFACE_CLASS} px-3 py-2 text-sm text-foreground shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15 disabled:cursor-not-allowed disabled:opacity-50`;\n\nexport function useAutoGrow(\n ref: React.RefObject<HTMLTextAreaElement | null>,\n value: React.TextareaHTMLAttributes<HTMLTextAreaElement>[\"value\"],\n autoGrow = false,\n minHeight?: number,\n maxHeight?: number,\n): void {\n React.useEffect(() => {\n if (!autoGrow || !ref.current) return;\n\n const textarea = ref.current;\n textarea.style.height = \"auto\";\n\n let newHeight = textarea.scrollHeight;\n if (minHeight) newHeight = Math.max(newHeight, minHeight);\n\n if (maxHeight && newHeight >= maxHeight) {\n textarea.style.height = `${maxHeight}px`;\n textarea.style.overflowY = \"auto\";\n } else {\n textarea.style.height = `${newHeight}px`;\n textarea.style.overflowY = \"hidden\";\n }\n }, [value, autoGrow, minHeight, maxHeight, ref]);\n}\n\n/** Merge a forwarded ref with the internal one auto-grow needs to measure. */\nexport function useMergedTextareaRef(\n forwarded: React.ForwardedRef<HTMLTextAreaElement>,\n): {\n ref: React.RefObject<HTMLTextAreaElement | null>;\n callback: (node: HTMLTextAreaElement | null) => void;\n} {\n const internal = React.useRef<HTMLTextAreaElement | null>(null);\n const callback = React.useCallback(\n (node: HTMLTextAreaElement | null) => {\n internal.current = node;\n if (typeof forwarded === \"function\") forwarded(node);\n else if (forwarded) forwarded.current = node;\n },\n [forwarded],\n );\n return { ref: internal, callback };\n}\n\nexport function boxStyle(\n minHeight?: number,\n maxHeight?: number,\n): React.CSSProperties | undefined {\n if (minHeight === undefined && maxHeight === undefined) return undefined;\n return {\n minHeight: minHeight ? `${minHeight}px` : undefined,\n maxHeight: maxHeight ? `${maxHeight}px` : undefined,\n };\n}\n\n/** The elevated textarea — the Input family's `Input`, in multi-line form. */\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n (\n { className, autoGrow, minHeight, maxHeight, wrapperClassName, ...props },\n forwarded,\n ) => {\n const { ref, callback } = useMergedTextareaRef(forwarded);\n const stretchClasses = getStretchClasses(className);\n const needsWrapper = Boolean(wrapperClassName || stretchClasses);\n\n useAutoGrow(ref, props.value, autoGrow, minHeight, maxHeight);\n\n const textarea = (\n <textarea\n ref={callback}\n data-slot=\"textarea\"\n className={cn(\n TEXTAREA_ELEVATED_CLASS,\n autoGrow && \"resize-none\",\n stretchClasses,\n className,\n )}\n style={boxStyle(minHeight, maxHeight)}\n {...props}\n />\n );\n\n if (!needsWrapper) return textarea;\n\n return <div className={cn(stretchClasses, wrapperClassName)}>{textarea}</div>;\n },\n);\nTextarea.displayName = \"Textarea\";\n\n/**\n * The plain control — a bordered, transparent field with a 60px floor. This is\n * what matrx-extend, aidream/apps/dashboard and workflow-studio each called\n * `Textarea`; the floor is theirs and it is the sensible default (a one-line\n * box for multi-line content invites a scrollbar on the first Enter).\n */\nconst BasicTextarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, autoGrow, minHeight, maxHeight, ...props }, forwarded) => {\n const { ref, callback } = useMergedTextareaRef(forwarded);\n\n useAutoGrow(ref, props.value, autoGrow, minHeight, maxHeight);\n\n return (\n <textarea\n ref={callback}\n data-slot=\"textarea\"\n className={cn(\n TEXTAREA_CONTROL_CLASS,\n \"h-auto min-h-[60px]\",\n autoGrow && \"resize-none\",\n className,\n )}\n style={boxStyle(minHeight, maxHeight)}\n {...props}\n />\n );\n },\n);\nBasicTextarea.displayName = \"BasicTextarea\";\n\nexport interface TextareaWithPrefixProps extends Omit<TextareaProps, \"prefix\"> {\n /** Leading adornment, absolutely placed at the field's top-left. */\n prefix?: React.ReactNode;\n}\n\nconst TextareaWithPrefix = React.forwardRef<\n HTMLTextAreaElement,\n TextareaWithPrefixProps\n>(\n (\n {\n prefix,\n className,\n wrapperClassName,\n autoGrow,\n minHeight,\n maxHeight,\n ...props\n },\n forwarded,\n ) => {\n const { ref, callback } = useMergedTextareaRef(forwarded);\n\n useAutoGrow(ref, props.value, autoGrow, minHeight, maxHeight);\n\n return (\n <div\n className={cn(\"relative\", getStretchClasses(className), wrapperClassName)}\n >\n {prefix ? (\n <div className=\"pointer-events-none absolute left-3 top-3 z-10 text-muted-foreground\">\n {prefix}\n </div>\n ) : null}\n <textarea\n ref={callback}\n data-slot=\"textarea\"\n className={cn(\n TEXTAREA_CONTROL_CLASS,\n \"resize-y\",\n prefix && \"pl-10\",\n autoGrow && \"resize-none\",\n className,\n )}\n style={boxStyle(minHeight, maxHeight)}\n {...props}\n />\n </div>\n );\n },\n);\nTextareaWithPrefix.displayName = \"TextareaWithPrefix\";\n\nexport { BasicTextarea, Textarea, TextareaWithPrefix };\n","\"use client\";\n\nimport { CircleAlertIcon as AlertCircle, AlertTriangleIcon as AlertTriangle, ChevronRightIcon as ChevronRight, Loader2Icon as LoaderCircle } from \"../icons\";\nimport type { ReactNode } from \"react\";\nimport { cn } from \"../cn\";\nimport { SettingsHostLink as AppLink } from \"./host\";\nimport type { SettingsBadge, SettingsCommonProps } from \"./types\";\nimport { SettingsHostErrorMenu as ErrorAlchemyMenu } from \"./host\";\nimport { Tile } from \"../controls/surfaces\";\n\nexport type SettingsNavigationRowProps = SettingsCommonProps & {\n value?: ReactNode;\n loading?: boolean;\n last?: boolean;\n} & (\n | { href: string; onNavigate?: never }\n | { href?: never; onNavigate: () => void }\n );\n\n/** A settings row with exactly one navigation action. */\nexport function SettingsNavigationRow({\n href,\n onNavigate,\n value,\n loading = false,\n last,\n disabled,\n label,\n description,\n warning,\n error,\n badge,\n icon: Icon,\n modified,\n id,\n}: SettingsNavigationRowProps) {\n const rowClass = cn(\n \"flex min-h-11 w-full items-center gap-3 px-4 py-2.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring sm:min-h-9\",\n !disabled && !loading && \"hover:bg-accent/60\",\n (disabled || loading) && \"cursor-default text-disabled-foreground\",\n !last && \"border-b border-border/40\",\n );\n const content = (\n <>\n <span className=\"min-w-0 flex-1\">\n <span className=\"flex min-w-0 items-center gap-1.5\">\n {modified && (\n <span\n aria-label=\"Modified from default\"\n className=\"h-1.5 w-1.5 shrink-0 rounded-full bg-primary\"\n />\n )}\n {Icon && (\n <Icon\n className=\"h-4 w-4 shrink-0 text-muted-foreground\"\n aria-hidden=\"true\"\n />\n )}\n <span className=\"truncate type-title text-foreground\">\n {label}\n </span>\n {badge && <Badge badge={badge} />}\n </span>\n {description && (\n <span className=\"mt-0.5 block type-secondary leading-snug text-muted-foreground sm:truncate\">\n {description}\n </span>\n )}\n {warning && (\n <span className=\"mt-1 flex items-start gap-1.5 type-secondary leading-snug text-amber-600 dark:text-amber-400\">\n <AlertTriangle\n className=\"mt-0.5 h-3.5 w-3.5 shrink-0\"\n aria-hidden=\"true\"\n />\n <span className=\"break-words\">{warning}</span>\n </span>\n )}\n {error && (\n <span className=\"mt-1 flex items-start gap-1.5 type-secondary leading-snug text-red-600 dark:text-red-400\">\n <AlertCircle\n className=\"mt-0.5 h-3.5 w-3.5 shrink-0\"\n aria-hidden=\"true\"\n />\n <span className=\"break-words\">{error}</span>\n <ErrorAlchemyMenu error={error} />\n </span>\n )}\n </span>\n {value && (\n <span className=\"min-w-0 max-w-40 truncate type-body text-muted-foreground\">\n {value}\n </span>\n )}\n {loading ? (\n <LoaderCircle\n className=\"h-4 w-4 shrink-0 animate-spin text-muted-foreground\"\n aria-hidden=\"true\"\n />\n ) : (\n <ChevronRight\n className=\"h-4 w-4 shrink-0 text-muted-foreground\"\n aria-hidden=\"true\"\n />\n )}\n </>\n );\n\n if (disabled || loading) {\n return (\n <div\n id={id}\n className={rowClass}\n aria-disabled=\"true\"\n aria-busy={loading || undefined}\n >\n {content}\n </div>\n );\n }\n if (href) {\n return (\n <AppLink id={id} className={rowClass} href={href}>\n {content}\n </AppLink>\n );\n }\n return (\n <Tile id={id} className={rowClass} type=\"button\" onClick={onNavigate} dense variant=\"quiet\" title={content} />\n );\n}\n\nfunction Badge({ badge }: { badge: SettingsBadge }) {\n return (\n <span className=\"rounded border border-border bg-muted px-1.5 py-0 type-meta font-semibold uppercase tracking-wide text-muted-foreground\">\n {badge.label}\n </span>\n );\n}\n","import type { ReactNode } from \"react\";\n\nexport type SettingsPageProps = { children: ReactNode };\n\n/**\n * Content canvas for a settings route or overlay. The surrounding shell owns\n * scrolling so this component never creates a nested scroll region.\n * `matrx-touch-targets` gives every control inside a 44px floor on touch and\n * below `lg`; desktop density is untouched.\n */\nexport function SettingsPage({ children }: SettingsPageProps) {\n return (\n <div className=\"matrx-touch-targets mx-auto min-h-full w-full max-w-5xl px-4 py-5 sm:px-6 sm:py-7 lg:px-8\">\n {children}\n </div>\n );\n}\n","\"use client\";\n\nimport { AlertTriangleIcon as AlertTriangle, CircleAlertIcon as AlertCircle, CircleHelpIcon as HelpCircle } from \"../icons\";\nimport * as Popover from \"@radix-ui/react-popover\";\nimport { useId, useRef, useState } from \"react\";\nimport { cn } from \"../cn\";\nimport type {\n SettingsCommonProps,\n SettingsRowVariant,\n SettingsRowDensity,\n SettingsBadge,\n} from \"./types\";\nimport { useSettingsDesign } from \"./SettingsDesignProvider\";\nimport { useSettingsSectionTitle } from \"./SettingsSectionContext\";\nimport { SettingsHostAnchor as SettingAnchor } from \"./host\";\nimport { settingsControlSearchId } from \"./searchIdentity\";\nimport { SettingsHostErrorMenu as ErrorAlchemyMenu } from \"./host\";\nimport { ResetTapButton } from \"../tap-target/buttons\";\nimport { Button } from \"../controls/controls\";\nimport { Tile } from \"../controls/surfaces\";\n\ntype SettingsRowProps = SettingsCommonProps & {\n /** Layout variant. Defaults to \"inline\". */\n variant?: SettingsRowVariant | undefined;\n /** Row density. Defaults to \"default\". */\n density?: SettingsRowDensity | undefined;\n /** The control (switch, input, slider, etc.) rendered on the right or below. */\n children: React.ReactNode;\n /** Whether this row is the last in a section. Removes trailing border. */\n last?: boolean | undefined;\n /** Wide controls stack below their label on narrow screens. */\n controlLayout?: \"compact\" | \"wide\" | undefined;\n /** Stable row anchor used by settings search and deep links. */\n anchorId?: string | undefined;\n /** Override the label target; pass null when the row exposes a labeled group. */\n labelFor?: string | null;\n};\n\nconst densityStyles: Record<SettingsRowDensity, string> = {\n compact: \"py-2.5\",\n default: \"py-3.5\",\n comfortable: \"py-4.5\",\n};\n\nconst badgeStyles: Record<SettingsBadge[\"variant\"], string> = {\n default: \"bg-muted text-muted-foreground border border-border\",\n new: \"bg-blue-500/10 text-blue-600 dark:text-blue-400 border border-blue-500/20\",\n beta: \"bg-purple-500/10 text-purple-600 dark:text-purple-400 border border-purple-500/20\",\n experimental:\n \"bg-amber-500/10 text-amber-600 dark:text-amber-400 border border-amber-500/20\",\n deprecated:\n \"bg-red-500/10 text-red-600 dark:text-red-400 border border-red-500/20\",\n admin:\n \"bg-foreground text-background border border-border\",\n};\n\nfunction BadgePill({ badge }: { badge: SettingsBadge }) {\n return (\n <span\n className={cn(\n \"inline-flex items-center rounded px-1.5 py-0 type-meta font-semibold uppercase tracking-wide leading-4\",\n badgeStyles[badge.variant],\n )}\n >\n {badge.label}\n </span>\n );\n}\n\n/**\n * SettingsRow — base layout for every settings control.\n *\n * Rarely used directly by tab authors. Each primitive (SettingsSwitch,\n * SettingsSelect, etc.) composes this internally and exposes a flat prop API.\n *\n * Variants handle layout differences; NEVER accept a className.\n */\nexport function SettingsRow({\n label,\n description,\n meta,\n warning,\n error,\n badge,\n icon: Icon,\n disabled,\n modified,\n id,\n helpText,\n variant = \"inline\",\n density = \"default\",\n children,\n last,\n controlLayout = \"compact\",\n anchorId,\n labelFor,\n onReset,\n resetLabel,\n}: SettingsRowProps) {\n const { variant: designVariant } = useSettingsDesign();\n const sectionTitle = useSettingsSectionTitle();\n const reactId = useId().replace(/:/g, \"\");\n // Input ids are React-instance ids. Search/deep-link ids intentionally use\n // only the authored section + label, so they survive remounts and markup.\n const inputId = id ?? `settings-input-${reactId}`;\n const labelId = `${inputId}-label`;\n const controlId = settingsControlSearchId(sectionTitle ?? \"Settings\", label);\n const rowAnchorId = anchorId ?? controlId;\n\n // One reset door, only when there is something to reset. A row that CAN\n // reset always reserves the slot (the same 36px as a ladder row's History\n // button), so every control on a screen ends at one edge instead of\n // shifting when a value changes.\n const resetButton = onReset ? (\n // The slot is the tap button's own box (never a fixed-size wrapper, which\n // squeezed the button off its geometry); hidden, not removed, so the slot\n // stays reserved and `visibility: hidden` drops it from the tab order.\n <span\n className={cn(\"inline-flex shrink-0\", !(modified && !disabled) && \"invisible\")}\n aria-hidden={modified && !disabled ? undefined : true}\n >\n <ResetTapButton\n variant=\"transparent\"\n ariaLabel={resetLabel ?? `Reset ${label.toLowerCase()} to default`}\n onClick={onReset}\n />\n </span>\n ) : null;\n\n const labelBlock = (\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex min-w-0 flex-wrap items-center gap-1.5\">\n {modified && (\n <span\n role=\"img\"\n aria-label=\"Changed from the default\"\n title=\"Changed from the default\"\n className=\"h-1.5 w-1.5 rounded-full bg-primary shrink-0\"\n />\n )}\n {Icon && (\n <Icon className=\"h-3.5 w-3.5 text-muted-foreground shrink-0\" />\n )}\n {labelFor === null ? (\n <span\n id={labelId}\n className={cn(\n \"min-w-0 break-words type-title leading-snug text-foreground\",\n disabled && \"text-disabled-foreground\",\n )}\n >\n {label}\n </span>\n ) : (\n <label\n id={labelId}\n htmlFor={labelFor ?? inputId}\n className={cn(\n \"min-w-0 break-words text-sm font-medium leading-snug text-foreground\",\n disabled && \"text-disabled-foreground\",\n )}\n >\n {label}\n </label>\n )}\n {badge && <BadgePill badge={badge} />}\n {/* The description is printed in full under the label; the help\n popover holds only the extra help, never a repeat of it. One\n popover for every design variant: a hover tooltip never opens on a\n phone, and its contents (a copy button) could not be reached. */}\n {helpText && <CompactHelpPopover label={label} helpText={helpText} />}\n </div>\n {meta ? (\n <div\n className={cn(\n \"mt-0.5 flex flex-wrap items-center gap-x-1.5 gap-y-0.5 break-words type-meta leading-snug text-muted-foreground [overflow-wrap:anywhere]\",\n disabled && \"text-disabled-foreground\",\n )}\n >\n {meta}\n </div>\n ) : null}\n {description ? (\n <TruncatedDescription description={description} disabled={disabled} />\n ) : null}\n {warning && (\n <div className=\"mt-1 flex items-start gap-1.5 type-secondary text-amber-600 dark:text-amber-400\">\n <AlertTriangle className=\"h-3.5 w-3.5 shrink-0 mt-0.5\" />\n <span className=\"break-words leading-snug\">{warning}</span>\n </div>\n )}\n {error && (\n <div className=\"mt-1 flex items-start gap-1.5 type-secondary text-red-600 dark:text-red-400\">\n <AlertCircle className=\"h-3.5 w-3.5 shrink-0 mt-0.5\" />\n <span className=\"break-words leading-snug\">{error}</span>\n <ErrorAlchemyMenu error={error} />\n </div>\n )}\n </div>\n );\n\n if (variant === \"block\") {\n return (\n <SettingAnchor id={rowAnchorId}>\n <div\n className={cn(\n \"px-4 border-b border-border/40\",\n densityStyles[\n designVariant === \"compact\" && density === \"default\"\n ? \"compact\"\n : density\n ],\n last && \"border-b-0\",\n )}\n >\n {children}\n </div>\n </SettingAnchor>\n );\n }\n\n if (variant === \"stacked\") {\n return (\n <SettingAnchor id={rowAnchorId}>\n <div\n className={cn(\n \"px-4 border-b border-border/40\",\n densityStyles[\n designVariant === \"compact\" && density === \"default\"\n ? \"compact\"\n : density\n ],\n last && \"border-b-0\",\n )}\n >\n <div className=\"mb-2.5\">{labelBlock}</div>\n <div className={cn(\"flex items-center gap-2\", disabled && \"text-disabled-foreground\")}>\n <div className=\"min-w-0 flex-1\">{children}</div>\n {resetButton}\n </div>\n </div>\n </SettingAnchor>\n );\n }\n\n return (\n <SettingAnchor id={rowAnchorId}>\n <div\n className={cn(\n controlLayout === \"wide\"\n ? \"flex flex-col items-stretch gap-2 border-b border-border/40 px-4 @[40rem]/settings:flex-row @[40rem]/settings:items-center @[40rem]/settings:gap-4\"\n : \"flex items-center gap-4 px-4 border-b border-border/40\",\n densityStyles[\n designVariant === \"compact\" && density === \"default\"\n ? \"compact\"\n : density\n ],\n last && \"border-b-0\",\n )}\n >\n {labelBlock}\n <div\n className={cn(\n controlLayout === \"wide\"\n ? \"w-full min-w-0 max-w-full [&_button]:max-w-full [&_input]:max-w-full @[40rem]/settings:w-auto @[40rem]/settings:shrink-0\"\n : \"w-auto min-w-0 max-w-full shrink-0 [&_button]:max-w-full [&_input]:max-w-full\",\n resetButton && \"flex items-center gap-1\",\n disabled && \"text-disabled-foreground\",\n )}\n >\n {/* The reset sits beside its control on every width, never on a\n line of its own under it. */}\n {resetButton ? <div className=\"min-w-0 flex-1\">{children}</div> : children}\n {resetButton}\n </div>\n </div>\n </SettingAnchor>\n );\n}\n\n/**\n * One line, truncated. When the text does not fit (a phone), a press opens the\n * full text in a popover; when it fits, the line is plain text and never opens.\n */\nfunction TruncatedDescription({\n description,\n disabled,\n}: Pick<SettingsCommonProps, \"description\" | \"disabled\">) {\n const lineRef = useRef<HTMLButtonElement>(null);\n const [open, setOpen] = useState(false);\n // Rich content (links, controls) cannot sit inside a button; it keeps wrapping.\n if (typeof description !== \"string\") {\n return (\n <div\n className={cn(\n \"mt-0.5 break-words type-secondary leading-snug text-muted-foreground\",\n disabled && \"text-disabled-foreground\",\n )}\n >\n {description}\n </div>\n );\n }\n return (\n <Popover.Root\n open={open}\n onOpenChange={(next) => {\n const el = lineRef.current;\n setOpen(next && !!el && el.scrollWidth > el.clientWidth);\n }}\n >\n <Popover.Trigger asChild>\n <Tile\n ref={lineRef}\n type=\"button\"\n dense\n variant=\"quiet\"\n title={description}\n className=\"mt-0.5 w-full min-w-0\"\n data-touch-exempt\n disabled={disabled}\n >\n </Tile>\n </Popover.Trigger>\n <Popover.Portal>\n <Popover.Content\n side=\"bottom\"\n align=\"start\"\n sideOffset={6}\n className=\"z-50 w-72 max-w-[calc(100vw-2rem)] break-words rounded-md border border-border bg-popover p-3 type-secondary leading-snug text-popover-foreground shadow-md [overflow-wrap:anywhere]\"\n >\n {description}\n </Popover.Content>\n </Popover.Portal>\n </Popover.Root>\n );\n}\n\nexport function CompactHelpPopover({\n label,\n description,\n helpText,\n}: Pick<SettingsCommonProps, \"label\" | \"description\" | \"helpText\">) {\n return (\n <Popover.Root>\n <Popover.Trigger asChild>\n {/* Icon-sized so it never makes the label line taller (on a phone a\n 44px-tall help button pushed the description a blank line down);\n `matrx-tap-area` gives it the 44px finger ring without growing it. */}\n <Button\n type=\"button\"\n variant=\"quiet\"\n aria-label={`About ${label}`}\n icon={<HelpCircle className=\"h-3.5 w-3.5\" aria-hidden=\"true\" />}\n data-touch-exempt\n className=\"shrink-0\"\n />\n </Popover.Trigger>\n <Popover.Portal>\n <Popover.Content\n side=\"bottom\"\n align=\"start\"\n sideOffset={6}\n className=\"z-50 w-72 max-w-[calc(100vw-2rem)] break-words rounded-md border border-border bg-popover p-3 type-secondary leading-snug text-popover-foreground shadow-md [overflow-wrap:anywhere]\"\n >\n {description && <div>{description}</div>}\n {helpText && (\n <div className={cn(description && \"mt-2\")}>{helpText}</div>\n )}\n </Popover.Content>\n </Popover.Portal>\n </Popover.Root>\n );\n}\n","\"use client\";\n\nimport { createContext, useContext } from \"react\";\nimport type { ReactNode } from \"react\";\n\nconst SettingsSectionContext = createContext<string | undefined>(undefined);\n\n/** The nearest section title gives static controls a stable deep-link scope. */\nexport function SettingsSectionProvider({\n title,\n children,\n}: {\n title: string;\n children: ReactNode;\n}) {\n return (\n <SettingsSectionContext.Provider value={title}>\n {children}\n </SettingsSectionContext.Provider>\n );\n}\n\nexport function useSettingsSectionTitle(): string | undefined {\n return useContext(SettingsSectionContext);\n}\n","\"use client\";\n\nimport { forwardRef, type Ref } from \"react\";\n// The spinner loop comes from `@ai-matrx/design-system`'s motion layer — the\n// package this one already depends on — NOT from core Tailwind's\n// `animate-spin` and NOT from a keyframe copied into this package's\n// stylesheet. See the note above `LoadingTapButton`.\nimport { MOTION_SPIN } from \"../motion\";\nimport {\n TapTargetButton,\n TapTargetButtonTransparent,\n TapTargetButtonOutline,\n TapTargetButtonSolid,\n TapTargetButtonForGroup,\n} from \"./tap-target-button\";\nimport type { TapTargetLinkComponent } from \"./link\";\nimport { useTapButtonVariant } from \"./tap-default-variant\";\nimport type { TapFeatureProps, TapSolidTone } from \"./tap-features\";\n\n// ---------------------------------------------------------------------------\n// Shared types\n// ---------------------------------------------------------------------------\n\ntype Variant = \"glass\" | \"transparent\" | \"outline\" | \"solid\" | \"group\";\n\nexport interface TapButtonProps extends TapFeatureProps {\n /** Forwarded to the underlying button (Radix `asChild`, focus chains, etc.). */\n ref?: Ref<HTMLButtonElement> | undefined;\n variant?: Variant | undefined;\n onClick?: (() => void) | undefined;\n as?: \"button\" | \"label\" | undefined;\n htmlFor?: string | undefined;\n ariaLabel?: string | undefined;\n disabled?: boolean | undefined;\n tabIndex?: number | undefined;\n className?: string | undefined;\n strokeWidth?: number | undefined;\n // Solid-variant color overrides — only used when variant=\"solid\"\n bgColor?: string | undefined;\n iconColor?: string | undefined;\n hoverBgColor?: string | undefined;\n activeBgColor?: string | undefined;\n // Link support — when set, the button renders as a link or <a>.\n // Internal hrefs use the injected link component (setTapTargetLinkComponent\n // or the `linkComponent` prop; plain <a> when none is registered); external\n // (http(s)://, mailto:, tel:) use <a> with target=\"_blank\" +\n // rel=\"noopener noreferrer\" by default. Pass an explicit `target` to\n // override (works for internal links too).\n href?: string | undefined;\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\" | undefined;\n rel?: string | undefined;\n prefetch?: boolean | null | undefined;\n /** Per-instance link component override for internal hrefs. */\n linkComponent?: TapTargetLinkComponent | undefined;\n // Tooltip support — defaults to `ariaLabel`. Pass `false` to opt out.\n tooltip?: string | false | undefined;\n tooltipSide?: \"top\" | \"right\" | \"bottom\" | \"left\" | undefined;\n tooltipAlign?: \"start\" | \"center\" | \"end\" | undefined;\n /** Inline caption after the icon — see TapTargetButton `label`. */\n label?: string | undefined;\n /** Passthrough from AITapButtonProps / MakerTapButton — stripped before DOM. */\n colored?: boolean | undefined;\n}\n\n// ---------------------------------------------------------------------------\n// Variant resolver — maps a variant string to the correct wrapper component.\n// Runs at build/server time so there's zero client cost.\n//\n// IMPORTANT: `Wrap` MUST forward refs. The pre-composed `*TapButton` functions\n// below are plain function components (in React 19 ref is a regular prop) and\n// spread `{...props}` to `Wrap` — that spread carries ref through. `Wrap`\n// extracts ref and passes it explicitly to the underlying `forwardRef`\n// primitive. Without this, every `*TapButton` placed inside a Radix\n// `*Trigger asChild` (DropdownMenu, Popover, Tooltip, etc.) silently loses\n// the ref — the popper can't anchor and Radix's injected event handlers /\n// `data-state` / `aria-*` get dropped. (Precedent: matrx-frontend\n// `features/files/FEATURE.md`, where this pattern was established.)\n// ---------------------------------------------------------------------------\n\nconst Wrap = forwardRef<\n HTMLButtonElement,\n TapButtonProps & { children: React.ReactNode }\n>(function Wrap(\n {\n variant: variantProp,\n children,\n bgColor,\n iconColor,\n hoverBgColor,\n activeBgColor,\n // AITapButtonProps passthrough — not a DOM attribute (see ai-tap-buttons Wrap)\n colored: _colored,\n ...props\n },\n ref,\n) {\n const variant = useTapButtonVariant(variantProp);\n switch (variant) {\n case \"transparent\":\n return (\n <TapTargetButtonTransparent ref={ref} {...props}>\n {children}\n </TapTargetButtonTransparent>\n );\n case \"outline\":\n return (\n <TapTargetButtonOutline ref={ref} {...props}>\n {children}\n </TapTargetButtonOutline>\n );\n case \"solid\": {\n // On a solid button `tone` is the FILL; a glyph-only tone (\"muted\",\n // \"default\", \"info\") has no fill meaning and falls back to primary.\n const { tone, ...solidProps } = props;\n const fill: TapSolidTone | undefined =\n tone === \"primary\" || tone === \"destructive\" || tone === \"success\" || tone === \"warning\" ? tone : undefined;\n return (\n <TapTargetButtonSolid\n ref={ref}\n tone={fill}\n bgColor={bgColor}\n iconColor={iconColor}\n hoverBgColor={hoverBgColor}\n activeBgColor={activeBgColor}\n {...solidProps}\n >\n {children}\n </TapTargetButtonSolid>\n );\n }\n case \"group\":\n return (\n <TapTargetButtonForGroup ref={ref} {...props}>\n {children}\n </TapTargetButtonForGroup>\n );\n default:\n return (\n <TapTargetButton ref={ref} {...props}>\n {children}\n </TapTargetButton>\n );\n }\n});\n\n// ---------------------------------------------------------------------------\n// Pre-composed buttons — one import, one tag, zero configuration needed.\n// Default variant is \"glass\". Override with variant=\"transparent\" etc.\n// All SVG paths match lucide-react v0.577.0 exactly.\n// ---------------------------------------------------------------------------\n\n// lucide: menu (hand-crafted HeroIcons path — no Lucide equivalent, kept as-is)\nexport function MenuTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Menu\" strokeWidth={1.75} {...props}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5\"\n />\n </Wrap>\n );\n}\n\n// lucide: plus (hand-crafted — no drift, kept as-is)\nexport function PlusTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Add\" {...props}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M12 4.5v15m7.5-7.5h-15\"\n />\n </Wrap>\n );\n}\n\n// lucide: search → circle cx=11 cy=11 r=8 + line to 21,21\nexport function SearchTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Search\" {...props}>\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"m21 21-4.34-4.34\" />\n </Wrap>\n );\n}\n\n// lucide: settings (hand-crafted — kept as-is, Lucide uses \"settings-2\" pattern)\nexport function SettingsTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Settings\" {...props}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z\"\n />\n </Wrap>\n );\n}\n\n// lucide: maximize (hand-crafted corner-arrows — kept as-is)\nexport function MaximizeTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Fullscreen\" {...props}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15\"\n />\n </Wrap>\n );\n}\n\n// lucide: home v0.577.0 — used as the \"Hub\" (main/list) action\nexport function HomeTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Hub\" {...props}>\n <path d=\"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8\" />\n <path d=\"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\" />\n </Wrap>\n );\n}\n\n// lucide: layout-grid v0.577.0\nexport function LayoutGridTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Card view\" {...props}>\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"14\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"14\" rx=\"1\" />\n </Wrap>\n );\n}\n\n// lucide: list v0.577.0\nexport function ListTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Table view\" {...props}>\n <path d=\"M3 5h.01\" />\n <path d=\"M3 12h.01\" />\n <path d=\"M3 19h.01\" />\n <path d=\"M8 5h13\" />\n <path d=\"M8 12h13\" />\n <path d=\"M8 19h13\" />\n </Wrap>\n );\n}\n\n// lucide: arrow-down-up (hand-crafted — kept as-is)\nexport function ArrowDownUpTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Sort\" {...props}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M3 4.5h14.25M3 9h9.75M3 13.5h5.25m5.25-.75L17.25 9m0 0L21 12.75M17.25 9v10.5\"\n />\n </Wrap>\n );\n}\n\n// lucide: bell v0.577.0\nexport function BellTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Notifications\" {...props}>\n <path d=\"M10.268 21a2 2 0 0 0 3.464 0\" />\n <path d=\"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326\" />\n </Wrap>\n );\n}\n\n// lucide: bell-ring v0.577.0 — animated cousin of bell, used for \"has unread\"\nexport function BellRingTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Notifications\" {...props}>\n <path d=\"M10.268 21a2 2 0 0 0 3.464 0\" />\n <path d=\"M22 8c0-2.3-.8-4.3-2-6\" />\n <path d=\"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326\" />\n <path d=\"M4 2C2.8 3.7 2 5.7 2 8\" />\n </Wrap>\n );\n}\n\n// lucide: zap v0.577.0 — lightning bolt, used as the Quick Actions trigger\nexport function ZapTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Quick actions\" {...props}>\n <path d=\"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z\" />\n </Wrap>\n );\n}\n\n// lucide: upload v0.577.0\nexport function UploadTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Upload\" {...props}>\n <path d=\"M12 3v12\" />\n <path d=\"m17 8-5-5-5 5\" />\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n </Wrap>\n );\n}\n\n// lucide: download v0.577.0\nexport function DownloadTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Download\" {...props}>\n <path d=\"M12 15V3\" />\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n <path d=\"m7 10 5 5 5-5\" />\n </Wrap>\n );\n}\n\n// lucide: share-2 v0.577.0\nexport function ShareTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Share\" {...props}>\n <circle cx=\"18\" cy=\"5\" r=\"3\" />\n <circle cx=\"6\" cy=\"12\" r=\"3\" />\n <circle cx=\"18\" cy=\"19\" r=\"3\" />\n <line x1=\"8.59\" x2=\"15.42\" y1=\"13.51\" y2=\"17.49\" />\n <line x1=\"15.41\" x2=\"8.59\" y1=\"6.51\" y2=\"10.49\" />\n </Wrap>\n );\n}\n\n// lucide: undo v0.577.0\nexport function UndoTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Undo\" {...props}>\n <path d=\"M3 7v6h6\" />\n <path d=\"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13\" />\n </Wrap>\n );\n}\n\n// lucide: redo v0.577.0\nexport function RedoTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Redo\" {...props}>\n <path d=\"M21 7v6h-6\" />\n <path d=\"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7\" />\n </Wrap>\n );\n}\n\n// lucide: copy v0.577.0\nexport function CopyTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Copy\" {...props}>\n <rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n <path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" />\n </Wrap>\n );\n}\n\n// lucide: trash v0.577.0\nexport function TrashTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Delete\" {...props}>\n <path d=\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\" />\n <path d=\"M3 6h18\" />\n <path d=\"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\" />\n </Wrap>\n );\n}\n\n// lucide: files v0.577.0\nexport function FilesTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Copy all\" {...props}>\n <path d=\"M20 7h-3a2 2 0 0 1-2-2V2\" />\n <path d=\"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z\" />\n <path d=\"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8\" />\n </Wrap>\n );\n}\n\n// lucide: chevron-left v0.577.0 — arms extended from 6 to 7 (45° kept) for a\n// slightly larger glyph that better fills the 32px inner pill.\nexport function ChevronLeftTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Back\" {...props}>\n <path d=\"m16 19-7-7 7-7\" />\n </Wrap>\n );\n}\n\n// lucide: chevron-right v0.577.0\nexport function ChevronRightTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Next\" {...props}>\n <path d=\"m9 18 6-6-6-6\" />\n </Wrap>\n );\n}\n\n// lucide: panel-left v0.577.0\nexport function PanelLeftTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Toggle sidebar\" {...props}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M9 3v18\" />\n </Wrap>\n );\n}\n\n// lucide: panel-right v0.577.0\nexport function PanelRightTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Toggle sidebar\" {...props}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M15 3v18\" />\n </Wrap>\n );\n}\n\n// lucide: square-pen v0.577.0\nexport function SquarePenTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"New chat\" {...props}>\n <path d=\"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\" />\n <path d=\"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z\" />\n </Wrap>\n );\n}\n\n// lucide: x v0.577.0\nexport function XTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Close\" {...props}>\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </Wrap>\n );\n}\n\n// lucide: funnel v0.577.0 (filter is an alias for funnel in this version)\nexport function FilterTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Filter\" {...props}>\n <path d=\"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z\" />\n </Wrap>\n );\n}\n\n// lucide: play v0.577.0\nexport function PlayTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Play\" {...props}>\n <path d=\"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z\" />\n </Wrap>\n );\n}\n\n// lucide: pause v0.577.0 — two rects (redesigned from bar paths)\nexport function PauseTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Pause\" {...props}>\n <rect x=\"14\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n <rect x=\"5\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n </Wrap>\n );\n}\n\n// lucide: square v0.577.0 (stop uses filled square)\nexport function StopTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Stop\" {...props}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n </Wrap>\n );\n}\n\n// lucide: volume-2 v0.577.0\nexport function Volume2TapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Speaker\" {...props}>\n <path d=\"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\" />\n <path d=\"M16 9a5 5 0 0 1 0 6\" />\n <path d=\"M19.364 18.364a9 9 0 0 0 0-12.728\" />\n </Wrap>\n );\n}\n\n// lucide: arrow-up v0.577.0\nexport function ArrowUpTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Send\" {...props}>\n <path d=\"m5 12 7-7 7 7\" />\n <path d=\"M12 19V5\" />\n </Wrap>\n );\n}\n\n// lucide: mic v0.577.0\nexport function MicTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Start recording\" {...props}>\n <path d=\"M12 19v3\" />\n <path d=\"M19 10v2a7 7 0 0 1-14 0v-2\" />\n <rect x=\"9\" y=\"2\" width=\"6\" height=\"13\" rx=\"3\" />\n </Wrap>\n );\n}\n\n// lucide: mic-off v0.577.0\nexport function MicOffTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Stop recording\" {...props}>\n <path d=\"M12 19v3\" />\n <path d=\"M15 9.34V5a3 3 0 0 0-5.68-1.33\" />\n <path d=\"M16.95 16.95A7 7 0 0 1 5 12v-2\" />\n <path d=\"M18.89 13.23A7 7 0 0 0 19 12v-2\" />\n <path d=\"m2 2 20 20\" />\n <path d=\"M9 9v3a3 3 0 0 0 5.12 2.12\" />\n </Wrap>\n );\n}\n\n// lucide: triangle-alert v0.577.0\nexport function TriangleAlertTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Alert\" {...props}>\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n </Wrap>\n );\n}\n\n// lucide: shield-check (context set)\nexport function ShieldCheckTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Context set\" {...props}>\n <path d=\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\" />\n <path d=\"m9 12 2 2 4-4\" />\n </Wrap>\n );\n}\n\n// lucide: shield-alert (context unset)\nexport function ShieldAlertTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"No context\" {...props}>\n <path d=\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\" />\n <path d=\"M12 8v4\" />\n <path d=\"M12 16h.01\" />\n </Wrap>\n );\n}\n\n// lucide: bug v0.577.0 (major update — full insect anatomy)\nexport function BugTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Debug\" {...props}>\n <path d=\"M12 20v-9\" />\n <path d=\"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z\" />\n <path d=\"M14.12 3.88 16 2\" />\n <path d=\"M21 21a4 4 0 0 0-3.81-4\" />\n <path d=\"M21 5a4 4 0 0 1-3.55 3.97\" />\n <path d=\"M22 13h-4\" />\n <path d=\"M3 21a4 4 0 0 1 3.81-4\" />\n <path d=\"M3 5a4 4 0 0 0 3.55 3.97\" />\n <path d=\"M6 13H2\" />\n <path d=\"m8 2 1.88 1.88\" />\n <path d=\"M9 7.13V6a3 3 0 1 1 6 0v1.13\" />\n </Wrap>\n );\n}\n\n// lucide: settings-2 v0.577.0 (gear + center circle — kept as-is, matches intent)\nexport function Settings2TapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Settings\" {...props}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z\"\n />\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M15 12a3 3 0 11-6 0 3 3 0 016 0z\"\n />\n </Wrap>\n );\n}\n\n// lucide: save (hand-crafted floppy disk — no direct Lucide equivalent, kept as-is)\nexport function SaveTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Save\" {...props}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M4.5 6a2 2 0 012-2h9.25L20.5 9v9a2 2 0 01-2 2h-12a2 2 0 01-2-2V6z\"\n />\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M8.5 4v4.5a.5.5 0 00.5.5h6a.5.5 0 00.5-.5V4\"\n />\n <rect\n x=\"8\"\n y=\"14\"\n width=\"8\"\n height=\"5.5\"\n rx=\"0.5\"\n strokeLinejoin=\"round\"\n />\n </Wrap>\n );\n}\n\n// lucide: send v0.577.0 (paper-airplane redesign)\nexport function SendTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Send\" {...props}>\n <path d=\"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z\" />\n <path d=\"m21.854 2.147-10.94 10.939\" />\n </Wrap>\n );\n}\n\n// lucide: message-square v0.577.0\nexport function MessageTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Message\" {...props}>\n <path d=\"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z\" />\n </Wrap>\n );\n}\n\n// lucide: variable v0.577.0 (major update — uses line elements + bracket paths)\nexport function VariableTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Variable\" {...props}>\n <path d=\"M8 21s-4-3-4-9 4-9 4-9\" />\n <path d=\"M16 3s4 3 4 9-4 9-4 9\" />\n <line x1=\"15\" x2=\"9\" y1=\"9\" y2=\"15\" />\n <line x1=\"9\" x2=\"15\" y1=\"9\" y2=\"15\" />\n </Wrap>\n );\n}\n\n// lucide: wrench v0.577.0 (single clean path)\nexport function WrenchTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Tool\" {...props}>\n <path d=\"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z\" />\n </Wrap>\n );\n}\n\n// lucide: command v0.577.0 (single continuous path)\nexport function CommandTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Command\" {...props}>\n <path d=\"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3\" />\n </Wrap>\n );\n}\n\n// lucide: terminal v0.577.0 (two paths: chevron + underline)\nexport function TerminalTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Terminal\" {...props}>\n <path d=\"M12 19h8\" />\n <path d=\"m4 17 6-6-6-6\" />\n </Wrap>\n );\n}\n\n// lucide: test-tube v0.577.0 (3 clean paths)\nexport function TestTubeTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Test\" {...props}>\n <path d=\"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2\" />\n <path d=\"M8.5 2h7\" />\n <path d=\"M14.5 16h-5\" />\n </Wrap>\n );\n}\n\n// lucide: rotate-ccw v0.577.0 (same shape as history minus the clock hand — used for Reset)\nexport function ResetTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Reset\" {...props}>\n <path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\" />\n <path d=\"M3 3v5h5\" />\n </Wrap>\n );\n}\n\n// lucide: eraser v0.577.0 (major update — proper eraser shape)\nexport function ClearTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Clear\" {...props}>\n <path d=\"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21\" />\n <path d=\"m5.082 11.09 8.828 8.828\" />\n </Wrap>\n );\n}\n\n// lucide: refresh-cw v1.22.0 (dual arrows — was a broken hand-crafted Heroicons-style path)\nexport function RetryTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Retry\" {...props}>\n <path d=\"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\" />\n <path d=\"M21 3v5h-5\" />\n <path d=\"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\" />\n <path d=\"M8 16H3v5\" />\n </Wrap>\n );\n}\n\n/** Alias — same Lucide refresh-cw glyph as RetryTapButton. */\nexport function RefreshCwTapButton(props: TapButtonProps) {\n return <RetryTapButton ariaLabel=\"Refresh\" {...props} />;\n}\n\n// lucide: loading spinner (custom animated — no Lucide equivalent)\n//\n// 🚨 `matrx-spin`, NEVER `animate-spin` (census row 19i, closed here at 0.2.1).\n// `animate-spin` is a core Tailwind utility, so it happened to survive in all\n// four current consumers — but a package cannot ship a class it does not\n// define: the first host without Tailwind's core animate utilities gets a\n// spinner that does not spin, which is a load-bearing lie (it says the work\n// has stopped) with no error to find it by. `matrx-spin` is design-system\n// 0.10.0's own keyframe + rule, shipped in ITS `styles.css` and asserted\n// present in ITS packed tarball. This package IMPORTS that contract (the\n// exported `MOTION_SPIN` constant, and `styles.css` `@import`s the sheet) —\n// it does not copy the keyframe, which would be a twin of exactly the kind\n// this row exists to kill. Under `prefers-reduced-motion` the shared rule\n// SLOWS the loop instead of stopping it, because a stopped spinner removes\n// information rather than motion.\nexport function LoadingTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Loading\" {...props}>\n <circle\n className={MOTION_SPIN}\n cx=\"12\"\n cy=\"12\"\n r=\"9\"\n strokeDasharray=\"28.27\"\n strokeDashoffset=\"9\"\n strokeLinecap=\"round\"\n style={{ transformOrigin: \"12px 12px\" }}\n />\n </Wrap>\n );\n}\n\n// lucide: bot/robot (hand-crafted — kept as-is)\nexport function RobotTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"AI Agent\" {...props}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M9 3.75H6.912a2.25 2.25 0 00-2.15 1.588L2.35 13.177a2.25 2.25 0 00-.1.661V18a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18v-4.162c0-.224-.034-.447-.1-.661L19.24 5.338a2.25 2.25 0 00-2.15-1.588H15M2.25 13.5h3.86a2.25 2.25 0 012.012 1.244l.256.512a2.25 2.25 0 002.013 1.244h3.218a2.25 2.25 0 002.013-1.244l.256-.512a2.25 2.25 0 012.013-1.244h3.859M12 3v8.25m0 0-3-3m3 3 3-3\"\n />\n </Wrap>\n );\n}\n\n// lucide: webhook v0.577.0\nexport function WebhookTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Webhook\" {...props}>\n <path d=\"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2\" />\n <path d=\"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06\" />\n <path d=\"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8\" />\n </Wrap>\n );\n}\n\n// lucide: eye v0.577.0\nexport function ViewTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"View\" {...props}>\n <path d=\"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </Wrap>\n );\n}\n\n// lucide: hammer v0.577.0\nexport function BuildTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Build\" {...props}>\n <path d=\"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9\" />\n <path d=\"m18 15 4-4\" />\n <path d=\"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5\" />\n </Wrap>\n );\n}\n\n// lucide: play v0.577.0 (alias for Run context)\nexport function RunTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Run\" {...props}>\n <path d=\"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z\" />\n </Wrap>\n );\n}\n\n// lucide: history v0.577.0\nexport function HistoryTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"History\" {...props}>\n <path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\" />\n <path d=\"M3 3v5h5\" />\n <path d=\"M12 7v5l4 2\" />\n </Wrap>\n );\n}\n\n// lucide: paperclip v0.577.0\nexport function PaperclipTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Attach file\" {...props}>\n <path d=\"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551\" />\n </Wrap>\n );\n}\n\n// lucide: thumbs-up v0.577.0\nexport function ThumbsUpTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Like\" {...props}>\n <path d=\"M7 10v12\" />\n <path d=\"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z\" />\n </Wrap>\n );\n}\n\n// lucide: thumbs-down v0.577.0\nexport function ThumbsDownTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Dislike\" {...props}>\n <path d=\"M17 14V2\" />\n <path d=\"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z\" />\n </Wrap>\n );\n}\n\n// lucide: check v0.577.0\nexport function CheckTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Done\" {...props}>\n <path d=\"M20 6 9 17l-5-5\" />\n </Wrap>\n );\n}\n\n// lucide: pencil v0.577.0\nexport function PencilTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Edit\" {...props}>\n <path d=\"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z\" />\n <path d=\"m15 5 4 4\" />\n </Wrap>\n );\n}\n\n// lucide: ellipsis (more-horizontal) v0.577.0\nexport function MoreHorizontalTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"More options\" {...props}>\n <circle cx=\"12\" cy=\"12\" r=\"1\" />\n <circle cx=\"19\" cy=\"12\" r=\"1\" />\n <circle cx=\"5\" cy=\"12\" r=\"1\" />\n </Wrap>\n );\n}\n\n// lucide: check-square v0.577.0\nexport function CheckSquareTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Task\" {...props}>\n <path d=\"m9 11 3 3L22 4\" />\n <path d=\"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11\" />\n </Wrap>\n );\n}\n\n// lucide: ghost v0.577.0\nexport function GhostTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Incognito chat\" {...props}>\n <path d=\"M9 10h.01\" />\n <path d=\"M15 10h.01\" />\n <path d=\"M12 2a8 8 0 0 0-8 8v12l3-3 2.5 2.5L12 19l2.5 2.5L17 19l3 3V10a8 8 0 0 0-8-8z\" />\n </Wrap>\n );\n}\n\n// lucide: link (chain link — used for \"attach to task\") v0.577.0\nexport function LinkTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Attach\" {...props}>\n <path d=\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\" />\n <path d=\"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\" />\n </Wrap>\n );\n}\n\n// lucide: external-link v0.577.0\nexport function ExternalLinkTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Open source\" {...props}>\n <path d=\"M15 3h6v6\" />\n <path d=\"M10 14 21 3\" />\n <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" />\n </Wrap>\n );\n}\n\n// lucide: clipboard-list v0.577.0\nexport function ClipboardListTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Copy Pages\" {...props}>\n <rect width=\"8\" height=\"4\" x=\"8\" y=\"2\" rx=\"1\" ry=\"1\" />\n <path d=\"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2\" />\n <path d=\"M12 11h4\" />\n <path d=\"M12 16h4\" />\n <path d=\"M8 11h.01\" />\n <path d=\"M8 16h.01\" />\n </Wrap>\n );\n}\n\n// lucide: party-popper v0.577.0\nexport function PartyPopperTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"AI Clean\" {...props}>\n <path d=\"M5.8 11.3 2 22l10.7-3.79\" />\n <path d=\"M4 3h.01\" />\n <path d=\"M22 8h.01\" />\n <path d=\"M15 2h.01\" />\n <path d=\"M22 20h.01\" />\n <path d=\"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10\" />\n <path d=\"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17\" />\n <path d=\"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7\" />\n <path d=\"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z\" />\n </Wrap>\n );\n}\n\n// lucide: layers v0.577.0 — \"this PDF everywhere\" surface switcher\nexport function LayersTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Open this PDF in another surface\" {...props}>\n <path d=\"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z\" />\n <path d=\"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12\" />\n <path d=\"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17\" />\n </Wrap>\n );\n}\n","\"use client\";\n\nimport {\n cloneElement,\n forwardRef,\n isValidElement,\n useCallback,\n useRef,\n type ButtonHTMLAttributes,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from \"react\";\n\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"../tooltip\";\nimport { joinClassNames } from \"@ai-matrx/kit/dom\";\nimport { classNameMisuse, useTapGuardRef } from \"./tap-target-guard\";\nimport { useTapSurface } from \"./tap-surface\";\nimport {\n TAP_SOLID_TONE,\n TAP_TONE_CLASS,\n TapBadge,\n TapChevron,\n TapSpinner,\n formatTapShortcut,\n tooltipBody,\n useTapShortcut,\n type TapFeatureProps,\n type TapShortcut,\n type TapSolidTone,\n} from \"./tap-features\";\nimport {\n getTapTargetLinkComponent,\n type TapTargetLinkComponent,\n} from \"./link\";\n\nexport interface TapTargetButtonProps extends TapFeatureProps {\n icon?: React.ReactNode;\n children?: React.ReactNode;\n strokeWidth?: number | undefined;\n onClick?: (() => void) | undefined;\n className?: string | undefined;\n as?: \"button\" | \"label\" | undefined;\n htmlFor?: string | undefined;\n ariaLabel?: string | undefined;\n disabled?: boolean | undefined;\n /**\n * When set, the tap button renders as a link instead of a button.\n * - Internal hrefs (e.g. \"/tasks\") render via the injected link component\n * (`setTapTargetLinkComponent` / the `linkComponent` prop), falling back\n * to a plain `<a>` when none is registered.\n * - External hrefs (http://, https://, mailto:, tel:) render as `<a>`\n * with `target=\"_blank\"` and `rel=\"noopener noreferrer\"` by default.\n * - When combined with `disabled`, the trigger renders as a non-navigable\n * `<span aria-disabled=\"true\">` with the same visual styling.\n */\n href?: string | undefined;\n /** Override target. Works on both internal links and external anchors. */\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\" | undefined;\n /** Override rel. Works on both internal links and external anchors. */\n rel?: string | undefined;\n /** Forwarded to the injected link component. Pass `false` to disable prefetching. */\n prefetch?: boolean | null | undefined;\n /**\n * Per-instance link component for internal hrefs — overrides the\n * module-level `setTapTargetLinkComponent` registration.\n */\n linkComponent?: TapTargetLinkComponent | undefined;\n /**\n * Tooltip text. Defaults to `ariaLabel` when omitted.\n * EVERY tap button shows a tooltip (owner ruling 2026-10-01). `false` no\n * longer hides it: it renders the tooltip through `title` (the provider's\n * title takeover draws the same surface) — for a button nested inside\n * another `asChild` trigger, where the Tooltip wrapper cannot sit.\n */\n tooltip?: string | false | undefined;\n /** Tooltip placement. Defaults to \"top\". */\n tooltipSide?: \"top\" | \"right\" | \"bottom\" | \"left\" | undefined;\n /** Tooltip alignment along its side. Defaults to \"center\". */\n tooltipAlign?: \"start\" | \"center\" | \"end\" | undefined;\n /**\n * Visible caption rendered inline after the icon (`[icon Label]`).\n * Widens the pill automatically. Tooltip defaults to off when set — the\n * label is self-describing. Visible text becomes the accessible name.\n */\n label?: string | undefined;\n /**\n * Collapse an icon + caption pill to its icon-only 44px tap target below\n * the `sm` breakpoint. The caption and inline geometry return at `sm+`;\n * `ariaLabel` (falling back to `label`) remains the accessible name.\n */\n mobileIconOnly?: boolean | undefined;\n}\n\nexport interface TapTargetButtonSolidProps extends Omit<TapTargetButtonProps, \"tone\"> {\n /** The fill, from the system's list. Replaces bgColor / iconColor / hover / active. */\n tone?: TapSolidTone | undefined;\n bgColor?: string | undefined;\n iconColor?: string | undefined;\n hoverBgColor?: string | undefined;\n /**\n * Press-state background. Defaults to `group-active/tap:brightness-90` (the\n * BOX is what is pressed — its touch area included), which works on\n * any color. Override when using a custom `bgColor` that should darken to a\n * specific shade on press (e.g. `group-active/tap:bg-primary/60`).\n */\n activeBgColor?: string | undefined;\n}\n\n/** Native button attributes a tap button accepts — everything except `style`:\n * a tap button's geometry is the system's, never the caller's. */\nexport type TapTargetNativeProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"style\">;\n\nconst EXTERNAL_RE = /^(https?:|mailto:|tel:)/i;\n\n// Geometry + press feedback + tap hygiene are the SINGLE SOURCE OF TRUTH in\n// the shipped stylesheet (the `.matrx-tap-*` family in styles.css — import\n// \"@ai-matrx/tap-target/styles.css\" once at app root). This component only\n// picks the right class and layers each variant's decoration on top.\nconst TAP_OUTER_CLASS = \"matrx-tap-target group group/tap\";\nconst TAP_GROUP_OUTER_CLASS = \"matrx-tap-target matrx-tap-target-sm group group/tap\";\n\nfunction IconContent({\n icon,\n children,\n strokeWidth = 2,\n className,\n}: Pick<\n TapTargetButtonProps,\n \"icon\" | \"children\" | \"strokeWidth\" | \"className\"\n>) {\n if (icon) {\n if (isValidElement<{ className?: string }>(icon)) {\n return cloneElement(icon, {\n className: joinClassNames(className, icon.props.className),\n });\n }\n return <span className={className}>{icon}</span>;\n }\n return (\n <svg\n className={className}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n {children}\n </svg>\n );\n}\n\ntype TapTargetSize = \"default\" | \"sm\";\n\nfunction resolveTapGeometry(\n label: string | undefined,\n size: TapTargetSize,\n mobileIconOnly: boolean,\n) {\n const inline = Boolean(label);\n if (size === \"sm\") {\n return {\n outerClassName:\n inline && mobileIconOnly\n ? \"matrx-tap-target matrx-tap-target-sm matrx-tap-target-mobile-icon-only-sm group group/tap\"\n : inline\n ? \"matrx-tap-target matrx-tap-target-sm matrx-tap-target-inline-sm group group/tap\"\n : TAP_GROUP_OUTER_CLASS,\n inlineModifier: mobileIconOnly\n ? \"matrx-tap-pill-mobile-icon-only-sm\"\n : \"matrx-tap-pill-inline-sm\",\n };\n }\n return {\n outerClassName:\n inline && mobileIconOnly\n ? `${TAP_OUTER_CLASS} matrx-tap-target-mobile-icon-only`\n : inline\n ? `${TAP_OUTER_CLASS} matrx-tap-target-inline`\n : TAP_OUTER_CLASS,\n inlineModifier: mobileIconOnly\n ? \"matrx-tap-pill-mobile-icon-only\"\n : \"matrx-tap-pill-inline\",\n };\n}\n\nfunction buildTapInner({\n label,\n pillClassName,\n iconClassName,\n labelClassName,\n inlineModifier,\n icon,\n children,\n strokeWidth = 2,\n loading,\n chevron,\n}: {\n label?: string | undefined;\n pillClassName: string;\n iconClassName: string;\n labelClassName?: string | undefined;\n inlineModifier: string;\n icon?: React.ReactNode;\n children?: React.ReactNode;\n strokeWidth?: number | undefined;\n loading?: boolean | undefined;\n chevron?: boolean | undefined;\n}) {\n const iconEl = loading ? (\n <TapSpinner className={iconClassName} />\n ) : (\n <IconContent\n icon={icon}\n strokeWidth={strokeWidth}\n className={iconClassName}\n >\n {children}\n </IconContent>\n );\n const pillClasses = label\n ? `${pillClassName} ${inlineModifier}`.trim()\n : pillClassName;\n\n if (!label) {\n return <div className={pillClasses}>{iconEl}</div>;\n }\n\n return (\n <div className={pillClasses}>\n {iconEl}\n <span className={labelClassName ?? \"matrx-tap-label\"}>{label}</span>\n {chevron ? <TapChevron /> : null}\n </div>\n );\n}\n\ninterface RenderTapTargetArgs extends Pick<\n TapTargetButtonProps,\n | \"icon\"\n | \"children\"\n | \"strokeWidth\"\n | \"label\"\n | \"mobileIconOnly\"\n | \"onClick\"\n | \"as\"\n | \"htmlFor\"\n | \"ariaLabel\"\n | \"disabled\"\n | \"href\"\n | \"target\"\n | \"rel\"\n | \"prefetch\"\n | \"linkComponent\"\n | \"tooltip\"\n | \"tooltipSide\"\n | \"tooltipAlign\"\n> {\n size?: TapTargetSize;\n /** The caller's raw `className` (the glyph color) — checked by the guard. */\n colorClassName?: string | undefined;\n pillClassName: string;\n iconClassName: string;\n labelClassName?: string | undefined;\n rest?: (TapTargetNativeProps & TapFeatureProps) | undefined;\n buttonRef?: Ref<HTMLButtonElement> | undefined;\n}\n\n// A hook (it carries the guard ref); every variant calls it exactly once.\nfunction useTapTarget({\n size = \"default\",\n colorClassName,\n pillClassName,\n iconClassName,\n labelClassName,\n icon,\n children,\n strokeWidth,\n label,\n mobileIconOnly = false,\n onClick,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n rest,\n buttonRef,\n}: RenderTapTargetArgs): ReactElement {\n const {\n tone,\n badge,\n pressed,\n loading,\n disabledReason,\n shortcut,\n chevron,\n ...nativeRest\n } = rest ?? {};\n const isDisabled = Boolean(disabled || disabledReason);\n // FORCED TOOLTIPS: the text is the reason, an explicit tooltip, the\n // accessible name, or the label — and a button with none is a defect.\n const tipText =\n disabledReason || (typeof tooltip === \"string\" && tooltip ? tooltip : undefined) || ariaLabel || label;\n const titleMode = tooltip === false;\n const propViolation =\n (tipText ? null : \"every tap button needs a tooltip — pass ariaLabel\") ??\n classNameMisuse(colorClassName ?? nativeRest.className) ??\n ((nativeRest as { style?: unknown }).style ? \"style is not supported on a tap button\" : null);\n const guardRef = useTapGuardRef<HTMLElement>(\n buttonRef as Ref<HTMLElement> | undefined,\n propViolation,\n );\n const nodeRef = useRef<HTMLElement | null>(null);\n const triggerRef = useCallback(\n (node: HTMLElement | null) => {\n nodeRef.current = node;\n guardRef(node);\n },\n [guardRef],\n );\n const getNode = useCallback(() => nodeRef.current, []);\n useTapShortcut(shortcut, getNode, !isDisabled && !loading);\n\n // Tone (or a pressed toggle) owns the glyph and label color.\n const toneColor = tone ? TAP_TONE_CLASS[tone] : pressed && !colorClassName ? TAP_TONE_CLASS.primary : null;\n if (toneColor) {\n iconClassName = `matrx-tap-icon ${toneColor}`;\n labelClassName = `matrx-tap-label ${toneColor}`;\n }\n if (pressed) pillClassName = `${pillClassName} matrx-tap-pressed`;\n const { outerClassName, inlineModifier } = resolveTapGeometry(\n label,\n size,\n mobileIconOnly,\n );\n const responsiveLabelClassName = mobileIconOnly\n ? `${labelClassName ?? \"matrx-tap-label\"} matrx-tap-label-mobile-icon-only`\n : labelClassName;\n const inner = buildTapInner({\n label,\n pillClassName,\n iconClassName,\n labelClassName: responsiveLabelClassName,\n inlineModifier: label ? inlineModifier : \"\",\n icon,\n children,\n strokeWidth,\n loading,\n chevron,\n });\n const triggerAriaLabel =\n label && !mobileIconOnly ? undefined : (ariaLabel ?? label);\n const trigger = renderTrigger({\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n as,\n htmlFor,\n onClick: loading ? undefined : onClick,\n ariaLabel: triggerAriaLabel,\n disabled: isDisabled,\n outerClassName,\n title: titleMode && tipText ? (shortcut ? `${tipText} (${formatTapShortcut(shortcut)})` : tipText) : undefined,\n children: (\n <>\n {inner}\n {badge !== undefined ? <TapBadge badge={badge} /> : null}\n </>\n ),\n rest: {\n ...nativeRest,\n ...(pressed !== undefined ? { \"aria-pressed\": pressed } : {}),\n ...(loading ? { \"aria-busy\": true } : {}),\n ...(shortcut ? { \"aria-keyshortcuts\": shortcut.replace(/mod/i, \"Meta\") } : {}),\n },\n triggerRef,\n });\n if (titleMode || !tipText) return trigger;\n return withTooltip(trigger, {\n tooltip: tipText,\n ariaLabel: tipText,\n disabled: isDisabled,\n tooltipSide,\n tooltipAlign,\n shortcut,\n });\n}\n\ninterface RenderTriggerArgs {\n href?: string | undefined;\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\" | undefined;\n rel?: string | undefined;\n prefetch?: boolean | null | undefined;\n linkComponent?: TapTargetLinkComponent | undefined;\n as?: \"button\" | \"label\" | undefined;\n htmlFor?: string | undefined;\n onClick?: (() => void) | undefined;\n ariaLabel?: string | undefined;\n disabled?: boolean | undefined;\n outerClassName: string;\n children: ReactNode;\n rest?: ButtonHTMLAttributes<HTMLButtonElement> | undefined;\n triggerRef: Ref<HTMLElement>;\n /** Tooltip text drawn through `title` (tooltip={false}: a nested trigger). */\n title?: string | undefined;\n}\n\n/**\n * Resolves the correct trigger element based on the props passed.\n *\n * - `href` + `disabled` → unclickable `<span aria-disabled>`\n * - `href` matching `http(s):|mailto:|tel:` → `<a target=\"_blank\" rel=\"noopener noreferrer\">`\n * - `href` (internal) → the injected link component (per-instance\n * `linkComponent` prop, else `setTapTargetLinkComponent` registration),\n * falling back to a plain `<a>` when none is registered\n * - `as=\"label\"` → `<label htmlFor=...>`\n * - default → `<button>`\n */\nfunction renderTrigger({\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n as,\n htmlFor,\n onClick,\n ariaLabel,\n disabled,\n outerClassName,\n children,\n rest,\n triggerRef,\n title,\n}: RenderTriggerArgs): ReactElement {\n const { style: _style, ...restWithoutStyle } = rest ?? {};\n if (disabled && href) {\n return (\n <span\n ref={triggerRef}\n aria-disabled=\"true\"\n aria-label={ariaLabel}\n title={title}\n className={`${outerClassName} opacity-40`}\n >\n {children}\n </span>\n );\n }\n if (href) {\n const isExternal = EXTERNAL_RE.test(href);\n if (isExternal) {\n return (\n <a\n ref={triggerRef as Ref<HTMLAnchorElement>}\n href={href}\n target={target ?? \"_blank\"}\n rel={rel ?? \"noopener noreferrer\"}\n aria-label={ariaLabel}\n title={title}\n className={outerClassName}\n >\n {children}\n </a>\n );\n }\n const Link = linkComponent ?? getTapTargetLinkComponent();\n if (Link) {\n return (\n <Link\n ref={triggerRef as Ref<HTMLAnchorElement>}\n href={href}\n target={target}\n rel={rel}\n prefetch={prefetch}\n aria-label={ariaLabel}\n title={title}\n className={outerClassName}\n >\n {children}\n </Link>\n );\n }\n // No link component registered — plain <a>. `prefetch` is a router hint,\n // not a DOM attribute, so it is deliberately dropped here.\n return (\n <a\n ref={triggerRef as Ref<HTMLAnchorElement>}\n href={href}\n target={target}\n rel={rel}\n aria-label={ariaLabel}\n title={title}\n className={outerClassName}\n >\n {children}\n </a>\n );\n }\n if (as === \"label\") {\n return (\n <label\n ref={triggerRef as Ref<HTMLLabelElement>}\n htmlFor={htmlFor}\n aria-label={ariaLabel}\n title={title}\n className={outerClassName}\n >\n {children}\n </label>\n );\n }\n return (\n <button\n ref={triggerRef as Ref<HTMLButtonElement>}\n type=\"button\"\n onClick={onClick}\n aria-label={ariaLabel}\n title={title}\n disabled={disabled}\n {...restWithoutStyle}\n className={outerClassName}\n >\n {children}\n </button>\n );\n}\n\n/**\n * Wraps a trigger element in a Tooltip when a tooltip label is available.\n * Falls back to `ariaLabel` when `tooltip` is not explicitly set. If both\n * are absent (or `tooltip === false`), the trigger is returned unwrapped.\n */\nfunction withTooltip(\n trigger: ReactElement,\n {\n tooltip,\n ariaLabel,\n disabled,\n tooltipSide = \"top\",\n tooltipAlign = \"center\",\n shortcut,\n }: {\n tooltip?: string | false | undefined;\n ariaLabel?: string | undefined;\n disabled?: boolean | undefined;\n tooltipSide?: \"top\" | \"right\" | \"bottom\" | \"left\" | undefined;\n tooltipAlign?: \"start\" | \"center\" | \"end\" | undefined;\n shortcut?: TapShortcut | undefined;\n },\n): ReactElement {\n if (tooltip === false) return trigger;\n const label =\n typeof tooltip === \"string\" && tooltip.length > 0 ? tooltip : ariaLabel;\n if (!label) return trigger;\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n {disabled ? (\n // Radix Tooltip triggers need a hoverable element; a disabled button\n // does not dispatch pointer events, so we wrap in a span for the\n // trigger target while keeping the disabled visual state.\n <span className=\"inline-flex\">{trigger}</span>\n ) : (\n trigger\n )}\n </TooltipTrigger>\n <TooltipContent side={tooltipSide} align={tooltipAlign}>\n {tooltipBody(label, shortcut)}\n </TooltipContent>\n </Tooltip>\n );\n}\n\n// To resize/retune every tap button, edit styles.css — not here.\n\nexport const TapTargetButton = forwardRef<\n HTMLButtonElement,\n TapTargetButtonProps & TapTargetNativeProps\n>(function TapTargetButton(\n {\n icon,\n children,\n strokeWidth = 2,\n onClick,\n className,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n ...rest\n },\n ref,\n) {\n const color = className ?? \"text-foreground\";\n return useTapTarget({\n colorClassName: className,\n icon,\n children,\n strokeWidth,\n onClick,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n pillClassName: \"matrx-tap-pill matrx-glass-thin-border\",\n iconClassName: `matrx-tap-icon ${color}`,\n rest,\n buttonRef: ref,\n });\n});\n\nexport const TapTargetButtonTransparent = forwardRef<\n HTMLButtonElement,\n TapTargetButtonProps & TapTargetNativeProps\n>(function TapTargetButtonTransparent(\n {\n icon,\n children,\n strokeWidth = 2,\n onClick,\n className,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n ...rest\n },\n ref,\n) {\n const color = className ?? \"text-foreground\";\n return useTapTarget({\n colorClassName: className,\n icon,\n children,\n strokeWidth,\n onClick,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n pillClassName:\n \"matrx-tap-pill group-hover/tap:bg-muted group-active/tap:bg-muted-foreground/15\",\n iconClassName: `matrx-tap-icon ${color}`,\n rest,\n buttonRef: ref,\n });\n});\n\n/** Outline pill — a plain 1px border, no fill, no blur, no shadow. Glass only\n * reads as glass over something you can see through; on an opaque card or\n * header use THIS. Same colors as the classic square \"+\": border-border,\n * muted glyph, primary border + foreground glyph on hover. */\nexport const TapTargetButtonOutline = forwardRef<\n HTMLButtonElement,\n TapTargetButtonProps & TapTargetNativeProps\n>(function TapTargetButtonOutline(\n {\n icon,\n children,\n strokeWidth = 2,\n onClick,\n className,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n ...rest\n },\n ref,\n) {\n const color =\n className ?? \"text-muted-foreground group-hover/tap:text-foreground\";\n return useTapTarget({\n colorClassName: className,\n icon,\n children,\n strokeWidth,\n onClick,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n pillClassName:\n \"matrx-tap-pill border border-border bg-transparent transition-colors group-hover/tap:border-primary/60 group-active/tap:bg-muted\",\n iconClassName: `matrx-tap-icon ${color}`,\n labelClassName: `matrx-tap-label ${color}`,\n rest,\n buttonRef: ref,\n });\n});\n\nexport const TapTargetButtonSolid = forwardRef<\n HTMLButtonElement,\n TapTargetButtonSolidProps & TapTargetNativeProps\n>(function TapTargetButtonSolid(\n {\n icon,\n children,\n strokeWidth = 2,\n onClick,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tone,\n bgColor,\n iconColor,\n hoverBgColor,\n activeBgColor,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n ...rest\n },\n ref,\n) {\n return useTapTarget({\n icon,\n children,\n strokeWidth,\n onClick,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n ...solidClasses(tone, bgColor, iconColor, hoverBgColor, activeBgColor),\n rest,\n buttonRef: ref,\n });\n});\n\n// `tone` is the system's fill; the four color strings are the pre-tone API,\n// accepted only until their last callers move to `tone`. `matrx-tap-solid` marks the\n// filled pill so the stylesheet can give a DISABLED solid the system's disabled token\n// (muted fill + --disabled-foreground glyph) instead of a 40%-opacity ghost of its fill.\nfunction solidClasses(\n tone: TapSolidTone | undefined,\n bgColor: string | undefined,\n iconColor: string | undefined,\n hoverBgColor: string | undefined,\n activeBgColor: string | undefined,\n) {\n const legacy = !tone && (bgColor || iconColor || hoverBgColor || activeBgColor);\n if (!legacy) {\n const t = TAP_SOLID_TONE[tone ?? \"primary\"];\n return {\n pillClassName: `matrx-tap-pill matrx-tap-solid ${t.fill} ${t.glyph} group-active/tap:brightness-90`,\n iconClassName: `matrx-tap-icon ${t.glyph}`,\n labelClassName: `matrx-tap-label ${t.glyph}`,\n };\n }\n const glyph = iconColor ?? \"text-primary-foreground\";\n return {\n pillClassName: `matrx-tap-pill matrx-tap-solid ${bgColor ?? \"bg-primary\"} ${glyph} ${hoverBgColor ?? \"group-hover/tap:bg-primary/80\"} ${activeBgColor ?? \"group-active/tap:brightness-90\"}`,\n iconClassName: `matrx-tap-icon ${glyph}`,\n labelClassName: `matrx-tap-label ${glyph}`,\n };\n}\n\n/** Solid destructive pill — delete/remove actions. White-on-red like the\n * primary solid is white-on-blue. Use THIS, never hand-pass bg-destructive\n * with the default (dark) icon color. */\nexport const TapTargetButtonDestructive = forwardRef<\n HTMLButtonElement,\n TapTargetButtonSolidProps & TapTargetNativeProps\n>(function TapTargetButtonDestructive({ tone = \"destructive\", ...rest }, ref) {\n return <TapTargetButtonSolid ref={ref} tone={tone} {...rest} />;\n});\n\nexport const TapTargetButtonForGroup = forwardRef<\n HTMLButtonElement,\n TapTargetButtonProps & TapTargetNativeProps\n>(function TapTargetButtonForGroup(\n {\n icon,\n children,\n strokeWidth = 2,\n onClick,\n className,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n ...rest\n },\n ref,\n) {\n const color = className ?? \"text-foreground\";\n return useTapTarget({\n colorClassName: className,\n size: \"sm\",\n icon,\n children,\n strokeWidth,\n onClick,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n pillClassName: \"matrx-tap-pill matrx-tap-pill-sm matrx-glass-interactive\",\n iconClassName: `matrx-tap-icon ${color}`,\n labelClassName: `matrx-tap-label ${color}`,\n rest,\n buttonRef: ref,\n });\n});\n\nexport function TapTargetButtonGroup({\n children,\n className,\n surface: surfaceProp,\n}: {\n children: React.ReactNode;\n className?: string | undefined;\n /**\n * GLASS ONLY FLOATS (owner rule, 2026-10-02): glass belongs on a bar that\n * floats over scrolling content or a see-through plane. On a solid surface\n * (a page, a card, a toast, a table toolbar) use `\"solid\"`: a muted track,\n * no glass stroke, the same geometry.\n */\n surface?: \"glass\" | \"solid\" | undefined;\n}) {\n // Geometry (height, the half-gap outside the capsule, the capsule itself)\n // is `.matrx-tap-group*` in tap-target.css.\n const surface = useTapSurface(surfaceProp);\n return (\n <div\n className={className ? `matrx-tap-group ${className}` : \"matrx-tap-group\"}\n data-surface={surface}\n >\n <div\n className={\n surface === \"solid\"\n ? \"matrx-tap-group-capsule matrx-tap-group-capsule-solid\"\n : \"matrx-tap-group-capsule matrx-glass-thin-border\"\n }\n />\n <div className=\"matrx-tap-group-row\">{children}</div>\n </div>\n );\n}\n","\"use client\";\n\n/**\n * Tooltip — the ONE tooltip in the fleet.\n *\n * THE COLLAPSE (0.6.0). Two implementations existed: matrx-frontend's\n * `components/ui/tooltip.tsx` (182 import sites) and `@ai-matrx/tap-target`'s\n * `src/tooltip.tsx` — the latter an explicit inlined PORT of the former,\n * carrying a header that said so. tap-target shipped it only because its ~60\n * tap buttons need a tooltip and no shared package owned one; four repos then\n * adopted `TooltipProvider` from tap-target. That made tap-target — a\n * button-geometry package — the accidental owner of a design-system primitive,\n * with a second copy living in the biggest host.\n *\n * A tooltip is a design-system surface, so it lives here. tap-target now takes\n * `@ai-matrx/design-system` as an ordinary sibling dependency and imports this\n * file; its own copy is deleted, and its re-export removed. The DAG already\n * ordered design-system before tap-target, so no cycle is introduced.\n *\n * BEHAVIOR is matrx-frontend's, verbatim, including the ruling both copies\n * carried in prose:\n *\n * 1. THE ROOT RENDERS UNCONDITIONALLY — no hydration mount gate. The gate the\n * host wrapper once carried (\"Radix generates dynamic aria-controls ids that\n * differ between SSR and client\") was false: Radix ids come from React's\n * SSR-stable `useId`. It was actively harmful — a Trigger wraps\n * ALWAYS-VISIBLE content, so `return null` deleted that subtree from SSR and\n * the first client paint.\n *\n * 2. THE SURFACE IS TOKEN-DRIVEN, NOT BRANDED. Popover tokens, not\n * `bg-primary`: rich tooltip content using `text-muted-foreground` was\n * illegible on a brand-colored background in one theme or the other.\n * Since 2026-09-28 the `.matrx-tooltip` class re-scopes those tokens to a dark,\n * high-contrast chip in both themes (styles.css, THE TOOLTIP SURFACE): the\n * neutral white surface it wore before was indistinguishable from the\n * browser's own `title` box.\n *\n * 3. EVERY `title` IS THIS TOOLTIP. The provider installs the title takeover\n * (`title-tooltips.ts`), so a hand-written `title=` anywhere in the\n * document shows this surface, never the browser's.\n *\n * SEAM INVERSION. The host resolved nested portal targets through\n * `useNestedPortalContainer` (an app hook wired to its dialog + window-panel\n * systems); tap-target's port dropped that seam entirely and always portalled\n * to `document.body` — which is why a tooltip inside a popped-out panel landed\n * in the wrong window. Here it is the package's `PortalContainerProvider`\n * seam: an explicit `container` prop wins, then the injected container, then\n * `document.body`. Both prior behaviors are reachable; neither is forked.\n */\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { MOTION_POPPER } from \"./motion\";\nimport { usePortalContainer } from \"./portal-container\";\nimport { acquireTitleTooltips, clipTooltipText, tooltipSide, TOOLTIP_EDGE_PX, TOOLTIP_LAYER_Z, TOOLTIP_TRIGGER_ATTR, type Side } from \"./title-tooltips\";\n\nexport interface TooltipProviderProps\n extends React.ComponentProps<typeof TooltipPrimitive.Provider> {\n /**\n * THE TITLE TAKEOVER (2026-09-28) — while any provider is mounted, every native\n * `title` attribute in the document shows as this tooltip instead of the\n * browser's (see `title-tooltips.ts`). On by default, because a rule every\n * author must remember is a rule that is broken; pass `false` only for a\n * surface that must keep the browser's own box. One provider opting out does\n * not turn it off while another one is mounted.\n */\n titleTooltips?: boolean;\n}\n\n/**\n * Mount once near the app root. Every tooltip in the tree shares its\n * `delayDuration` / `skipDelayDuration` timing, and the root provider takes\n * over native `title` attributes (see `titleTooltips`). The fleet default keeps\n * tooltip content hoverable and selectable. A native mirrored Desktop shell may\n * explicitly opt in to `disableHoverableContent` so its overlay view yields the\n * pointer back to the host; ordinary application tooltips must leave it unset.\n */\nfunction TooltipProvider({ titleTooltips = true, disableHoverableContent = false, ...props }: TooltipProviderProps) {\n React.useEffect(() => {\n if (!titleTooltips) return;\n return acquireTitleTooltips();\n }, [titleTooltips]);\n return <TooltipPrimitive.Provider {...props} disableHoverableContent={disableHoverableContent} />;\n}\n\n/**\n * The tooltip root inherits its provider's hoverability policy: the ordinary\n * provider defaults to hoverable, selectable content (Arman, 2026-10-14), while\n * a native mirrored Desktop shell may opt in at its provider so the overlay view\n * yields pointer control to its host. An explicit root prop still wins.\n */\n/** The tooltip's trigger and whether it is open, so its content takes THE SMART SIDE\n * (title-tooltips.ts) from where the trigger stands at the moment it opens. */\ninterface TriggerState {\n ref: React.MutableRefObject<HTMLElement | null>;\n open: boolean;\n}\nconst TriggerContext = React.createContext<TriggerState | null>(null);\n\nconst Tooltip = ({ onOpenChange, ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>) => {\n const ref = React.useRef<HTMLElement | null>(null);\n const [open, setOpen] = React.useState(Boolean(props.open ?? props.defaultOpen));\n const shown = props.open ?? open;\n const value = React.useMemo(() => ({ ref, open: shown }), [shown]);\n return (\n <TriggerContext.Provider value={value}>\n <TooltipPrimitive.Root\n {...props}\n onOpenChange={(next) => {\n setOpen(next);\n onOpenChange?.(next);\n }}\n />\n </TriggerContext.Provider>\n );\n};\nTooltip.displayName = \"Tooltip\";\n\n/**\n * Stamps `data-matrx-tooltip-trigger` so the title takeover never draws a\n * second tooltip over a control that already has this one — it still lifts a\n * `title` on the same control, so the browser's box never doubles it either.\n */\nconst TooltipTrigger = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Trigger>\n>((props, ref) => {\n const trigger = React.useContext(TriggerContext);\n const setRef = React.useCallback(\n (node: HTMLButtonElement | null) => {\n if (trigger) trigger.ref.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n },\n [trigger, ref],\n );\n return <TooltipPrimitive.Trigger ref={setRef} {...{ [TOOLTIP_TRIGGER_ATTR]: \"\" }} {...props} />;\n});\nTooltipTrigger.displayName = TooltipPrimitive.Trigger.displayName;\n\nexport interface TooltipContentProps\n extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> {\n /**\n * Explicit portal target; wins over the injected `PortalContainerProvider`\n * value. Pass `null` to force `document.body`.\n */\n container?: HTMLElement | null;\n /**\n * Package-owned open/close motion. Default `true`. Pass `false` for a\n * surface that must appear instantly. It is NOT the reduced-motion switch;\n * `styles.css` already honors `prefers-reduced-motion`.\n */\n animated?: boolean;\n /**\n * The side when the control is not in a vertical stack and no side is given (the host's default:\n * a macOS desktop host says \"bottom\"). Omit for the document's `data-title-side`, else \"top\".\n */\n fallbackSide?: Side;\n}\n\nconst TooltipContent = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Content>,\n TooltipContentProps\n>(({ className, side, fallbackSide, sideOffset = 4, collisionPadding = TOOLTIP_EDGE_PX, container, animated = true, children, style, ...props }, ref) => {\n const resolved = usePortalContainer(container);\n const trigger = React.useContext(TriggerContext);\n // THE SMART SIDE: an explicit side wins; otherwise where the trigger's neighbours stand decides.\n const placed = side ?? (trigger?.open ? tooltipSide(trigger.ref.current, fallbackSide) : (fallbackSide ?? \"top\"));\n return (\n <TooltipPrimitive.Portal container={resolved ?? null}>\n <TooltipPrimitive.Content\n ref={ref}\n data-slot=\"tooltip-content\"\n side={placed}\n sideOffset={sideOffset}\n // Flip and stay inside the window: Radix flips to the opposite side when the preferred one\n // does not fit, and shifts along the edge; the padding keeps it off the window's border.\n avoidCollisions\n collisionPadding={collisionPadding}\n className={cn(\n \"matrx-tooltip max-w-xs select-text overflow-hidden whitespace-normal break-words rounded-md border border-border bg-popover px-2.5 py-1 text-xs font-medium text-popover-foreground\",\n animated && MOTION_POPPER,\n className,\n )}\n // THE tooltip layer: above every menu, popover and modal (Radix copies it onto its wrapper).\n style={{ zIndex: TOOLTIP_LAYER_Z, ...style }}\n {...props}\n >\n {typeof children === \"string\" ? clipTooltipText(children) : children}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n});\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nexport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };\nexport { acquireTitleTooltips, clipTooltipText, NATIVE_TITLE_OPT_OUT_ATTR, TOOLTIP_TEXT_BUDGET } from \"./title-tooltips\";\n","\"use client\";\n\n// THE TAP-TARGET GUARD — development builds only.\n//\n// The lock layer in tap-target.css makes a tap button's own box, pill and\n// glyph impossible to resize from outside. What CSS cannot stop is a caller\n// bending the system AROUND the button: a parent that adds `gap` between two\n// tap buttons, a wrapper with margin or padding, a local override of a\n// `--matrx-tap-*` token, a utility class smuggled in through `className`.\n// After a tap button mounts, this guard measures it in the real layout and,\n// on any of those, marks it `data-matrx-tap-violation`: the stylesheet then\n// paints it as a giant red box carrying the reason, and the console names\n// the element.\n//\n// OFF until the host turns it on with `enableTapTargetGuard()` — from code the\n// HOST compiles, e.g. matrx-frontend's dev-only client boot. Never gate it on\n// `process.env.NODE_ENV` in here: this package's own build inlines that\n// expression, so a \"dev only\" check written here would run in production too\n// (see @ai-matrx/associations' context.tsx for the outage that taught this).\n\nimport { useCallback, useRef, type MutableRefObject, type Ref } from \"react\";\nimport { layoutScale } from \"../layout-scale\";\n\n// A `Symbol.for` slot on globalThis, like the link seam: the `.` and\n// `./buttons` bundles each inline this module, and one switch must reach both.\nconst GUARD_SLOT = Symbol.for(\"@ai-matrx/tap-target:guard\");\ntype GlobalWithGuard = typeof globalThis & { [GUARD_SLOT]?: boolean };\n\n/** Turn the development guard on (or off). Call once at client boot, only in\n * development builds of the host. */\nexport function enableTapTargetGuard(on = true): void {\n (globalThis as GlobalWithGuard)[GUARD_SLOT] = on;\n if (on) startPillInsetScan();\n}\n\nfunction guardOn(): boolean {\n return (globalThis as GlobalWithGuard)[GUARD_SLOT] === true;\n}\n\nconst TOKENS = [\n \"--matrx-tap-box\",\n \"--matrx-tap-gap\",\n \"--matrx-tap-pill-size\",\n \"--matrx-tap-pill-sm-size\",\n \"--matrx-tap-wide-size\",\n \"--matrx-tap-icon-size\",\n \"--matrx-tap-touch-min\",\n \"--matrx-tap-target-size\",\n] as const;\n\n/** The only scopes that may move tap tokens, and which ones — each owned by\n * this package's own CSS: the table density scales (tap-target.css) and\n * Alchemy's 18px trigger glyph (content-transfer.css). */\nconst SANCTIONED: ReadonlyArray<{ scope: string; tokens: ReadonlySet<string> }> = [\n {\n scope: \"[data-matrx-table][data-matrx-table-density]\",\n tokens: new Set([\n \"--matrx-tap-target-size\",\n \"--matrx-tap-pill-size\",\n \"--matrx-tap-wide-size\",\n \"--matrx-tap-pill-sm-size\",\n \"--matrx-tap-icon-size\",\n ]),\n },\n { scope: \"[data-alchemy-trigger]\", tokens: new Set([\"--matrx-tap-icon-size\"]) },\n // THE ONE CONTROL scope (controls.css): tap buttons beside the 28px controls\n // take the controls' height — a 28px pill in a 34px box, the same 6px apart.\n {\n scope: \"[data-matrx-controls]\",\n tokens: new Set([\n \"--matrx-tap-target-size\",\n \"--matrx-tap-pill-size\",\n \"--matrx-tap-wide-size\",\n \"--matrx-tap-pill-sm-size\",\n ]),\n },\n];\nconst TABLE_SCOPE = SANCTIONED[0]!.scope;\nconst CONTROL_SCOPE = SANCTIONED[2]!.scope;\nconst TAP_ITEM = \".matrx-tap-target, .matrx-tap-group\";\n\n/** `className` on a tap button is the GLYPH COLOR. Anything that sizes,\n * spaces, positions or fills is misuse. */\nconst NON_COLOR_CLASS =\n /^(?:[^\\s:]+:)*!?-?(?:\\[&|scale|translate|h|w|size|min-h|min-w|max-h|max-w|p|px|py|ps|pe|pt|pb|pl|pr|m|mx|my|ms|me|mt|mb|ml|mr|gap|space-x|space-y|bg|rounded|border|ring|shadow|absolute|relative|fixed|sticky|inset|top|left|right|bottom|flex|grid|block|inline|hidden|z|shrink|grow|basis|self|order)(?:-|$|\\[)/;\n\nexport function classNameMisuse(className: string | undefined): string | null {\n if (!guardOn() || !className) return null;\n const bad = className.split(/\\s+/).filter((t) => t && NON_COLOR_CLASS.test(t));\n return bad.length\n ? `className is the glyph color only — remove \"${bad.join(\" \")}\"`\n : null;\n}\n\n/**\n * The horizontal space a wrapper adds around what it holds. An `auto` margin (`ml-auto` pushing a\n * toolbar's actions to the end) only aligns — the browser resolves it to pixels in\n * `getComputedStyle`, so read the computed keyword from the typed OM and count it as zero.\n */\nexport function wrapperSpace(el: Element, view: Window): number {\n const pcs = view.getComputedStyle(el);\n const typed = (el as Element & { computedStyleMap?: () => { get(p: string): unknown } }).computedStyleMap?.();\n const margin = (prop: \"margin-left\" | \"margin-right\", resolved: string) =>\n typed && String(typed.get(prop)) === \"auto\" ? 0 : px(resolved);\n return margin(\"margin-left\", pcs.marginLeft) + margin(\"margin-right\", pcs.marginRight) + px(pcs.paddingLeft) + px(pcs.paddingRight);\n}\n\nfunction px(value: string): number {\n const n = Number.parseFloat(value);\n return Number.isFinite(n) ? n : 0;\n}\n\nfunction describe(el: Element): string {\n const cls = typeof el.className === \"string\" ? el.className.trim().split(/\\s+/).slice(0, 4).join(\".\") : \"\";\n return `<${el.tagName.toLowerCase()}${cls ? `.${cls}` : \"\"}>`;\n}\n\n/** Elements that ride along with a tap button without taking space from it\n * (a badge, a capsule, a tooltip portal anchor). */\nfunction isDecor(el: Element, view: Window): boolean {\n const cs = view.getComputedStyle(el);\n return cs.position === \"absolute\" || cs.position === \"fixed\" || cs.display === \"none\";\n}\n\nfunction tapCount(el: Element): number {\n return el.matches(TAP_ITEM) ? 1 : el.querySelectorAll(TAP_ITEM).length;\n}\n\n/** Visible text in `container` outside `tap` and outside decor (a badge's\n * count is decor) — a wrapper with its own words is a chip, not a wrapper. */\nfunction ownText(container: Element, tap: Element, view: Window): string {\n let out = \"\";\n const walk = (node: Node) => {\n if (node === tap) return;\n if (node.nodeType === 3) out += node.textContent ?? \"\";\n else if (node.nodeType === 1 && !isDecor(node as Element, view)) node.childNodes.forEach(walk);\n };\n container.childNodes.forEach(walk);\n return out.trim();\n}\n\n/** True when `child` is a tap button, or a plain wrapper whose only content\n * is ONE tap button (plus decor) — never a search box that happens to hold\n * a clear button, never a chip with words. */\nfunction isTapSlot(child: Element, view: Window): boolean {\n if (child.matches(TAP_ITEM)) return true;\n if (tapCount(child) !== 1) return false;\n const tap = child.querySelector(TAP_ITEM)!;\n const controls = Array.from(child.querySelectorAll(\"input, select, textarea, button, a, [role='button']\"));\n if (controls.some((c) => c !== tap && !tap.contains(c))) return false;\n return ownText(child, tap, view) === \"\";\n}\n\nlet probe: { key: string; target: number; pill: number; sm: number; smPill: number; wide: number; icon: number } | null = null;\n\n/** What the package's own CSS produces with no surrounding context — the\n * canon every mounted button is measured against. Re-measured whenever the\n * root tokens change (the lab page switches the gap). */\nfunction canon(doc: Document) {\n const view = doc.defaultView!;\n const root = view.getComputedStyle(doc.documentElement);\n const key = TOKENS.map((t) => root.getPropertyValue(t)).join(\"|\");\n if (probe?.key === key) return probe;\n const host = doc.createElement(\"div\");\n host.setAttribute(\"aria-hidden\", \"true\");\n host.style.cssText = \"position:absolute;visibility:hidden;pointer-events:none;left:-9999px;top:0\";\n host.innerHTML =\n '<button class=\"matrx-tap-target\"><div class=\"matrx-tap-pill\"><svg class=\"matrx-tap-icon\"></svg></div></button>' +\n '<button class=\"matrx-tap-target matrx-tap-target-sm\"><div class=\"matrx-tap-pill matrx-tap-pill-sm\"></div></button>' +\n '<button class=\"matrx-tap-target matrx-tap-target-inline\"><div class=\"matrx-tap-pill matrx-tap-pill-inline\"></div></button>';\n doc.body.appendChild(host);\n const [a, b, w] = Array.from(host.children) as HTMLElement[];\n probe = {\n key,\n target: a!.offsetHeight,\n pill: (a!.firstElementChild as HTMLElement).offsetHeight,\n icon: px(view.getComputedStyle(a!.querySelector(\"svg\")!).height),\n sm: b!.offsetHeight,\n smPill: (b!.firstElementChild as HTMLElement).offsetHeight,\n wide: (w!.firstElementChild as HTMLElement).offsetHeight,\n };\n host.remove();\n return probe;\n}\n\n/** Returns the first rule this mounted tap button breaks, or null. */\nexport function findTapViolation(el: HTMLElement): string | null {\n const doc = el.ownerDocument;\n const view = doc.defaultView;\n if (!view || !el.isConnected) return null;\n const cs = view.getComputedStyle(el);\n if (cs.display === \"none\") return null;\n\n // 1. Tokens are the package's alone. Only the table-density scope may move\n // the three it owns.\n const root = view.getComputedStyle(doc.documentElement);\n // Both scaled scopes size by their own tokens; the canon check below reads\n // the root canon, so it applies outside them only.\n const inTable = el.closest(TABLE_SCOPE) !== null || el.closest(CONTROL_SCOPE) !== null;\n const moved = new Set<string>();\n for (const token of TOKENS) {\n const mine = cs.getPropertyValue(token).trim();\n const base = root.getPropertyValue(token).trim();\n if (mine === base) continue;\n if (!SANCTIONED.some((s) => s.tokens.has(token) && el.closest(s.scope))) {\n return `${token} overridden to \"${mine}\" — tap geometry is not configurable`;\n }\n moved.add(token);\n }\n\n // 2. Measured geometry equals the canon (outside table density, which\n // sizes by its own tokens).\n const sm = el.classList.contains(\"matrx-tap-target-sm\");\n const inline = /matrx-tap-target-(?:inline|mobile-icon-only)/.test(el.className);\n const pill = el.querySelector<HTMLElement>(\":scope > .matrx-tap-pill\");\n const icon = pill?.querySelector(\".matrx-tap-icon\") ?? null;\n // A host touch floor (min-width / min-height) may enlarge a box; that is\n // the floor working, not a bend.\n const floored =\n px(cs.minHeight) >= el.offsetHeight - 0.5 || px(cs.minWidth) >= el.offsetWidth - 0.5;\n if (!inTable && pill && !floored) {\n const c = canon(doc);\n const box = sm ? c.sm : c.target;\n // A labeled pill is a WIDE shape (shorter than a round one); below the\n // `sm` breakpoint a mobile-icon-only pill is round again — either is canon.\n const pillSizes = sm ? [c.smPill] : inline ? [c.pill, c.wide] : [c.pill];\n if (Math.abs(el.offsetHeight - box) > 0.5) return `button is ${el.offsetHeight}px tall, canon is ${box}px`;\n if (!inline && Math.abs(el.offsetWidth - box) > 0.5) return `button is ${el.offsetWidth}px wide, canon is ${box}px`;\n if (!pillSizes.some((p) => Math.abs(pill.offsetHeight - p) <= 0.5)) {\n return `pill is ${pill.offsetHeight}px, canon is ${pillSizes.join(\" or \")}px`;\n }\n if (icon && !moved.has(\"--matrx-tap-icon-size\")) {\n const size = px(view.getComputedStyle(icon).height);\n if (Math.abs(size - c.icon) > 0.5) return `glyph is ${size}px, canon is ${c.icon}px`;\n }\n }\n\n // 3. Nothing adds space around it. Climb the wrappers that hold only this\n // button (plus decor such as a badge); none may carry inline margin or\n // padding. A tap button inside a group is represented by its group.\n let slot: Element = el;\n if (el.parentElement?.matches(\".matrx-tap-group-row, .matrx-tap-search-measure\")) {\n const group = el.closest(\".matrx-tap-group\");\n if (group && tapCount(el.parentElement) > 1) return null;\n slot = group ?? el;\n }\n for (let depth = 0; depth < 2; depth += 1) {\n const parent: HTMLElement | null = slot.parentElement;\n if (!parent || parent === doc.body) break;\n const others = Array.from(parent.children).filter((c) => c !== slot && !isDecor(c, view));\n if (others.length > 0) break; // `parent` is the row\n if (ownText(parent, slot, view) !== \"\") break; // a chip or a titled header\n const space = wrapperSpace(parent, view);\n if (space > 0.5) {\n return `${describe(parent)} adds ${space}px around a tap button — tap buttons space themselves`;\n }\n slot = parent;\n }\n\n // 4. The row adds no gap between tap buttons.\n const row = slot.parentElement;\n if (row) {\n const rcs = view.getComputedStyle(row);\n const flexOrGrid = /flex|grid/.test(rcs.display);\n const neighbours = Array.from(row.children).filter((c) => c !== slot && isTapSlot(c, view));\n if (flexOrGrid && neighbours.length > 0) {\n const horizontal = rcs.display.includes(\"grid\") || !rcs.flexDirection.startsWith(\"column\");\n const gap = px(horizontal ? rcs.columnGap : rcs.rowGap);\n if (gap > 0.5) {\n return `${describe(row)} adds a ${gap}px gap between tap buttons — remove it; tap buttons space themselves`;\n }\n }\n }\n return null;\n}\n\n/* ------------------------------------------------------------------ */\n/* PLACEMENT — the three rules a tap button's SURROUNDINGS must keep */\n/* (owner, 2026-10-02). Reported as a WARNING (a dashed outline and one */\n/* console error naming the fix), not the misuse box: they are about */\n/* the page around the button, and the whole app is being brought into */\n/* line with them. */\n/* 1. GLASS ONLY FLOATS — glass is see-through; it belongs on a bar */\n/* that floats over moving content (position fixed/sticky) or on a */\n/* plane marked `data-matrx-glass-plane`. On a page, card, toast or */\n/* table use `variant=\"transparent\"` / a solid group. */\n/* 2. ALL GLASS OR NONE — a glass item's row holds only glass items */\n/* (glass tap buttons, glass groups, or `data-matrx-glass` pieces). */\n/* 3. NEIGHBOURS KEEP THEIR HALF-GAP — a tap box carries 3px of unseen */\n/* space each side (box − pill = one gap, 6px). Anything beside it */\n/* adds its own 3px, so the visible distance is always one gap. */\n/* ------------------------------------------------------------------ */\n\nconst GLASS = \".matrx-glass-thin-border, .matrx-glass-interactive\";\n\nfunction isGlassItem(node: Element): boolean {\n if (node.hasAttribute(\"data-matrx-glass\")) return true;\n if (node.matches(\".matrx-tap-group\")) return node.querySelector(\":scope > .matrx-tap-group-capsule.matrx-glass-thin-border\") !== null;\n if (node.matches(\".matrx-tap-target\")) return node.querySelector(`:scope > .matrx-tap-pill:is(${GLASS})`) !== null;\n // A plain wrapper whose only content is ONE tap button (plus decor such as a\n // badge) is that button: a badge host around a glass button is glass.\n const view = node.ownerDocument.defaultView;\n if (view && isTapSlot(node, view)) return isGlassItem(node.querySelector(TAP_ITEM)!);\n return false;\n}\n\nconst SCROLLS = /^(auto|scroll|overlay)$/;\n\n/** True when `el` rides a bar over moving content: a fixed/sticky ancestor (or\n * a glass plane) reached BEFORE any scroll container. Inside a scroller the\n * button IS the moving content — an app root that is itself `position:\n * fixed` (the shell) must not make every page button \"float\". */\nfunction floats(el: Element, view: Window): boolean {\n for (let n: Element | null = el; n && n !== el.ownerDocument.body; n = n.parentElement) {\n if (n.hasAttribute(\"data-matrx-glass-plane\")) return true;\n const cs = view.getComputedStyle(n);\n if (cs.position === \"fixed\" || cs.position === \"sticky\") return true;\n if (n !== el && (SCROLLS.test(cs.overflowY) || SCROLLS.test(cs.overflowX))) return false;\n }\n return false;\n}\n\n/** True when the edge of `wrapper` that faces a neighbour (`side` is where the\n * wrapper sits relative to that neighbour) is itself a tap slot: that button\n * carries its own 3px half-gap, so the wrapper is spacing-correct however many\n * tap buttons it holds (the fading mic + More cluster beside Send). A wrapper\n * whose edge is text or a field is not — it still has to keep its distance. */\nfunction facesWithTapSlot(wrapper: Element, side: \"after\" | \"before\", view: Window): boolean {\n for (let node: Element | null = wrapper; node; ) {\n if (isTapSlot(node, view)) return true;\n const kids: Element[] = Array.from(node.children).filter((c) => !isDecor(c, view));\n node = (side === \"after\" ? kids[0] : kids[kids.length - 1]) ?? null;\n }\n return false;\n}\n\nfunction visible(el: Element, view: Window): boolean {\n if (el.getAttribute(\"aria-hidden\") === \"true\" || isDecor(el, view)) return false;\n const r = el.getBoundingClientRect();\n return r.width > 1 && r.height > 1;\n}\n\nconst INTERACTIVE = \"button, a[href], input, select, textarea, [role='button'], svg, img\";\n\n/** The box the eye sees on the side of `sib` that faces the tap button. An\n * unpainted layout wrapper (no fill, no border on that side, no words of its\n * own) is invisible, so the distance is judged at the first thing inside it —\n * the wrapper around ProTextarea's mic sits 3px from Expand while the mic\n * capsule, which keeps its own 3px margin, sits one gap away (2026-10-13). */\nfunction facingBox(sib: Element, side: \"after\" | \"before\", view: Window): Element {\n let node = sib;\n for (;;) {\n if (node.matches(INTERACTIVE)) return node;\n const cs = view.getComputedStyle(node);\n const fill = cs.backgroundColor;\n if ((fill && fill !== \"rgba(0, 0, 0, 0)\" && fill !== \"transparent\") || px(side === \"after\" ? cs.borderLeftWidth : cs.borderRightWidth) > 0) {\n return node;\n }\n if (Array.from(node.childNodes).some((c) => c.nodeType === 3 && c.textContent?.trim())) return node;\n const kids = Array.from(node.children).filter((c) => visible(c, view));\n const next = side === \"after\" ? kids[0] : kids[kids.length - 1];\n if (!next) return node;\n node = next;\n }\n}\n\n/** The first placement rule this tap button's surroundings break, or null. */\nexport function findTapPlacementWarning(el: HTMLElement): string | null {\n const doc = el.ownerDocument;\n const view = doc.defaultView;\n if (!view || !el.isConnected) return null;\n // A button inside a group is judged as its group.\n const slot: Element = el.closest(\".matrx-tap-group\") ?? el;\n const glass = isGlassItem(slot);\n\n if (glass && !floats(slot, view)) {\n return 'glass on a solid surface — glass only floats over moving content; use variant=\"transparent\" (or a solid group)';\n }\n\n const row = slot.parentElement;\n if (!row) return null;\n if (glass) {\n const mixed = Array.from(row.children).find((c) => c !== slot && visible(c, view) && !isGlassItem(c));\n if (mixed) return `glass beside non-glass ${describe(mixed)} — make the row all glass or none`;\n }\n\n const pill = (el.querySelector(\":scope > .matrx-tap-pill\") as HTMLElement | null) ?? (slot.querySelector(\".matrx-tap-group-capsule\") as HTMLElement | null);\n if (!pill) return null;\n const gap = px(view.getComputedStyle(el).getPropertyValue(\"--matrx-tap-gap\")) || 6;\n const p = pill.getBoundingClientRect();\n if (p.width === 0) return null;\n // Distances are judged in LAYOUT pixels: inside a zoomed (transformed) tile a screen distance\n // is the layout distance times the scale.\n const scale = layoutScale(pill);\n for (const [side, sib] of [[\"after\", slot.nextElementSibling], [\"before\", slot.previousElementSibling]] as const) {\n if (!sib || !visible(sib, view) || isTapSlot(sib, view) || isGlassItem(sib) || facesWithTapSlot(sib, side, view)) continue;\n if (Math.abs(sib.getBoundingClientRect().top + sib.getBoundingClientRect().height / 2 - (p.top + p.height / 2)) > p.height) continue; // not on this row\n const box = facingBox(sib, side, view);\n const r = box.getBoundingClientRect();\n const cs = view.getComputedStyle(box);\n const distance =\n (side === \"after\" ? r.left - p.right : p.left - r.right) / scale + (side === \"after\" ? px(cs.paddingLeft) : px(cs.paddingRight));\n if (distance < gap - 0.5) {\n return `${describe(sib)} sits ${Math.round(distance)}px from the pill — anything beside a tap button adds its own ${gap / 2}px (the box only carries ${gap / 2}px)`;\n }\n }\n return null;\n}\n\nconst reported = new Set<string>();\n\nfunction report(el: HTMLElement, reason: string) {\n el.setAttribute(\"data-matrx-tap-violation\", reason);\n const key = `${reason}@${el.getAttribute(\"aria-label\") ?? el.textContent ?? \"\"}`;\n if (reported.has(key)) return;\n reported.add(key);\n console.error(`[tap-target] ${reason}`, el);\n}\n\nconst mounted = new Set<HTMLElement>();\nlet resizeTimer: ReturnType<typeof setTimeout> | null = null;\nlet listening = false;\n\nfunction check(node: HTMLElement) {\n const reason = findTapViolation(node);\n if (reason) {\n report(node, reason);\n return;\n }\n node.removeAttribute(\"data-matrx-tap-violation\");\n const warning = findTapPlacementWarning(node);\n if (warning) {\n node.setAttribute(\"data-matrx-tap-warning\", warning);\n const key = `w:${warning}@${node.getAttribute(\"aria-label\") ?? \"\"}`;\n if (!reported.has(key)) {\n reported.add(key);\n console.error(`[tap-target] ${warning}`, node);\n }\n } else node.removeAttribute(\"data-matrx-tap-warning\");\n}\n\nfunction listenForResize(view: Window) {\n if (listening) return;\n listening = true;\n view.addEventListener(\"resize\", () => {\n if (resizeTimer) clearTimeout(resizeTimer);\n resizeTimer = setTimeout(() => mounted.forEach((n) => (n.isConnected ? check(n) : mounted.delete(n))), 200);\n });\n // A button is judged once, at mount — but its neighbours keep changing (a\n // loading placeholder becomes the real control). Re-judge a button when the\n // row it sits in gains or loses children, so a mark never outlives the\n // neighbour it named (2026-10-13: \"New run\" kept a red outline for a\n // skeleton that had already left the header).\n const Observer = (view as Window & { MutationObserver?: typeof MutationObserver }).MutationObserver;\n if (!Observer || !view.document.body) return;\n const changedRows = new Set<Node>();\n let rowTimer: ReturnType<typeof setTimeout> | null = null;\n new Observer((records) => {\n for (const r of records) changedRows.add(r.target);\n if (rowTimer) clearTimeout(rowTimer);\n rowTimer = setTimeout(() => {\n mounted.forEach((n) => {\n if (!n.isConnected) return void mounted.delete(n);\n const row = (n.closest(\".matrx-tap-group\") ?? n).parentElement;\n if (row && changedRows.has(row)) check(n);\n });\n changedRows.clear();\n }, 200);\n }).observe(view.document.body, { childList: true, subtree: true });\n}\n\nfunction assignRef<T>(ref: Ref<T> | undefined, value: T | null) {\n if (typeof ref === \"function\") ref(value);\n else if (ref) (ref as MutableRefObject<T | null>).current = value;\n}\n\n/**\n * The callback ref every tap trigger carries. In production it only forwards\n * the caller's ref; in development it also measures the trigger once it is in\n * the layout and paints a violation.\n */\nexport function useTapGuardRef<T extends HTMLElement>(\n forwarded: Ref<T> | undefined,\n propViolation: string | null,\n): (node: T | null) => void {\n const current = useRef<T | null>(null);\n return useCallback(\n (node: T | null) => {\n assignRef(forwarded, node);\n if (current.current && current.current !== node) mounted.delete(current.current);\n current.current = node;\n if (!guardOn() || !node) return;\n if (propViolation) {\n report(node, propViolation);\n return;\n }\n const view = node.ownerDocument.defaultView;\n if (!view) return;\n mounted.add(node);\n listenForResize(view);\n view.requestAnimationFrame(() => check(node));\n },\n [forwarded, propViolation],\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* THE PILL-INSET GUARD (0.60.10). A pill is balanced when its INK sits */\n/* the same distance from both edges. On 2026-10-04 every icon+label */\n/* pill read off-centre (1.3–3.3px) because padding was shaved on the */\n/* glyph side by a guess at the glyph's air. The trim in tap-target.css */\n/* now removes each glyph's real air; this measures the result in the */\n/* real layout and marks any pill whose ink insets differ by more than */\n/* 2px — dashed red outline + one console error naming both numbers. */\n/* ------------------------------------------------------------------ */\n\nconst PILL_TOLERANCE_PX = 2;\nconst PILL_ITEMS = \"button, a[href], [role='button'], [role='tab'], [role='radio'], [role='menuitem']\";\nconst PILL_CANDIDATES = \"button, a[href], [role='button'], .rounded-full, .matrx-tap-pill-inline, .matrx-tap-pill-mobile-icon-only\";\n\n/** Horizontal ink extents inside `el`: glyph geometry for svgs, text runs for text. */\nfunction inkExtents(el: Element): { left: number; right: number } | null {\n const doc = el.ownerDocument;\n const view = doc.defaultView;\n if (!view) return null;\n let left = Infinity;\n let right = -Infinity;\n const walker = doc.createTreeWalker(el, 0x1 | 0x4 /* SHOW_ELEMENT | SHOW_TEXT */);\n let n: Node | null;\n while ((n = walker.nextNode())) {\n if (n.nodeType === 1) {\n const node = n as Element;\n const cs = view.getComputedStyle(node);\n if (cs.display === \"none\" || cs.visibility === \"hidden\" || cs.position === \"absolute\") continue;\n const tag = node.tagName.toLowerCase();\n if (tag === \"img\" || tag === \"picture\" || tag === \"video\" || tag === \"canvas\") {\n // A picture (a favicon, an avatar) is ink by its box — it draws its own pixels, and a logo\n // renders exactly as it is, never tinted to make a guard see it (2026-10-13: every\n // favicon-led link pill read \"29px left vs 10px right\" because the image was invisible here).\n const r = node.getBoundingClientRect();\n if (r.width > 0) {\n left = Math.min(left, r.left);\n right = Math.max(right, r.right);\n }\n continue;\n }\n if (tag !== \"svg\" && (node.getAttribute(\"role\") === \"status\" || node.getAttribute(\"role\") === \"progressbar\")) {\n // A busy spinner drawn with borders (its rings are absolute, so nothing below sees them)\n // is ink by its box: a pill whose icon turned into a spinner read \"44px left vs 20px right\".\n const r = node.getBoundingClientRect();\n if (r.width > 0) {\n left = Math.min(left, r.left);\n right = Math.max(right, r.right);\n }\n continue;\n }\n if (tag !== \"svg\") {\n // A painted chip inside the pill (a count badge) is ink by its box: its fill is what the eye sees.\n const paintedChip = (cs.backgroundColor !== \"rgba(0, 0, 0, 0)\" && cs.backgroundColor !== \"transparent\") || parseFloat(cs.borderLeftWidth) > 0;\n if (paintedChip) {\n const r = node.getBoundingClientRect();\n if (r.width > 0) {\n left = Math.min(left, r.left);\n right = Math.max(right, r.right);\n }\n }\n continue;\n }\n const svg = node as SVGGraphicsElement;\n if (typeof svg.getBBox !== \"function\" || typeof svg.getScreenCTM !== \"function\") continue;\n const bb = svg.getBBox();\n const ctm = svg.getScreenCTM();\n if (!ctm || bb.width === 0) continue;\n if (Math.abs(ctm.b) > 0.001 || Math.abs(ctm.c) > 0.001) {\n // A turning glyph (a busy spinner) has no fixed ink: judge it by its layout box, centered\n // where the rotation centers it — never by a mid-turn snapshot of its paths.\n const r = node.getBoundingClientRect();\n const half = (parseFloat(cs.width) || r.width) / 2;\n const mid = r.left + r.width / 2;\n left = Math.min(left, mid - half);\n right = Math.max(right, mid + half);\n continue;\n }\n const half = ((parseFloat(cs.strokeWidth) || 0) * Math.abs(ctm.a)) / 2;\n const x1 = ctm.a * bb.x + ctm.e;\n const x2 = ctm.a * (bb.x + bb.width) + ctm.e;\n left = Math.min(left, Math.min(x1, x2) - half);\n right = Math.max(right, Math.max(x1, x2) + half);\n } else if (n.nodeValue && n.nodeValue.trim()) {\n const parent = n.parentElement;\n if (!parent || parent.closest(\"svg\")) continue;\n const pcs = view.getComputedStyle(parent);\n if (pcs.visibility === \"hidden\" || pcs.position === \"absolute\") continue;\n const range = doc.createRange();\n range.selectNodeContents(n);\n // A truncated label (`truncate max-w-*`) draws only what its clipping box shows: its text\n // run keeps going past the ellipsis, so the run is clipped to every overflow-hiding box\n // between it and the pill (2026-10-18: a scope chip \"matrx-frontend (LCP test)\" read\n // \"9.0px left vs 5.7px right\" while its ellipsis sat exactly 9px from the edge).\n const clip = textClip(parent, el, view);\n for (const r of Array.from(range.getClientRects())) {\n if (r.width <= 0) continue;\n const rl = Math.max(r.left, clip.left);\n const rr = Math.min(r.right, clip.right);\n if (rr <= rl) continue;\n left = Math.min(left, rl);\n right = Math.max(right, rr);\n }\n }\n }\n return Number.isFinite(left) && Number.isFinite(right) ? { left, right } : null;\n}\n\n/** The horizontal window a text run can paint in: its overflow-clipping ancestors up to (excluding) `pill`. */\nfunction textClip(from: Element, pill: Element, view: Window): { left: number; right: number } {\n let left = -Infinity;\n let right = Infinity;\n for (let node: Element | null = from; node && node !== pill; node = node.parentElement) {\n const cs = view.getComputedStyle(node);\n // overflow-x, or the shorthand's first (x) value where a runtime does not expand it (jsdom)\n const clipsX = (cs.overflowX && cs.overflowX !== \"visible\") || (cs.overflow && !cs.overflow.startsWith(\"visible\"));\n if (clipsX) {\n const r = node.getBoundingClientRect();\n if (r.width > 0) {\n left = Math.max(left, r.left);\n right = Math.min(right, r.right);\n }\n }\n }\n return { left, right };\n}\n\nconst FIELDS = \"input, textarea, select, [contenteditable='true'], [role='textbox'], [role='searchbox'], [role='combobox']\";\n\n/**\n * Only a BUTTON can be a pill whose ink must balance: an interactive element,\n * or the painted pill inside one (a tap button's `.matrx-tap-pill-inline`).\n * A field — or a capsule that holds one, like a rounded search box — aligns its\n * text to an edge by design, and a non-interactive container (a status chip, a\n * wrapper painted `rounded-full`) is never a pill button (2026-10-09: the\n * messenger's search field and messaging's AI chips wore the red outline).\n */\nexport function isPillButton(el: Element): boolean {\n if (el.matches(FIELDS) || el.querySelector(FIELDS) !== null) return false;\n if (el.matches(PILL_ITEMS)) return true;\n if (el.parentElement?.closest(PILL_ITEMS)) return true;\n return el.querySelector(PILL_ITEMS) !== null;\n}\n\n/** Why this pill's ink is off-centre, or null. Only judges a pill — a capsule\n * (radius ≥ half its height) with its own fill or border, carrying ink. */\nexport function findPillInsetWarning(el: HTMLElement): string | null {\n const view = el.ownerDocument.defaultView;\n if (!view || !el.isConnected) return null;\n if (!isPillButton(el)) return null;\n const box = el.getBoundingClientRect();\n const scale = layoutScale(el);\n if (box.width / scale < 20 || box.height / scale < 16 || box.height / scale > 48) return null;\n const cs = view.getComputedStyle(el);\n if (parseFloat(cs.borderTopLeftRadius) < box.height / scale / 2 - 1) return null;\n const painted = cs.backgroundColor !== \"rgba(0, 0, 0, 0)\" && cs.backgroundColor !== \"transparent\";\n if (!painted && !(parseFloat(cs.borderLeftWidth) > 0)) return null;\n // A wide capsule (a stretched select or field) aligns content to an edge on purpose.\n if (box.width / scale > 320) return null;\n // Ink balance is a question only for CENTERED content. A select trigger (value left, chevron\n // right), a field, or a full-width action row that says justify-start aligns its content on\n // purpose — content alignment is placement, not an inset to balance.\n if (cs.display.includes(\"flex\") && ![\"center\", \"normal\"].includes(cs.justifyContent)) return null;\n if (el.matches(\"[data-matrx-control='select'], [data-matrx-control='field']\")) return null;\n // A switch, checkbox or slider carries STATE, not a label: its thumb sits at one end by design\n // (measured 2026-10-04: every connector switch read \"18px left vs 2px right\" in the chat composer).\n if (el.matches(\"[role='switch'], [role='checkbox'], [role='slider'], [role='radio']\")) return null;\n // A TRACK of several controls (a segmented nav, a tab strip) is a container, not a pill: its\n // items sit where the selection puts them, so the ink is lopsided by design — each item is\n // judged on its own (measured 2026-10-05: the shell route nav's icon track read 2px vs 12.5px\n // at 768 because the selected item's fill hugs one end and the last glyph carries its air).\n if (el.querySelectorAll(PILL_ITEMS).length > 1) return null;\n const ink = inkExtents(el);\n if (!ink) return null;\n const left = (ink.left - box.left) / scale;\n const right = (box.right - ink.right) / scale;\n if (left < 0 || right < 0) return null; // clipped / overflowing content: not this guard's question\n if (Math.abs(left - right) <= PILL_TOLERANCE_PX) return null;\n return `pill ink is off-centre: ${left.toFixed(1)}px left vs ${right.toFixed(1)}px right — pad both sides alike and let the glyph trim (tap-target.css, THE OPTICAL GLYPH TRIM) remove the glyph's air; never shave one side by hand`;\n}\n\nlet pillTimer: ReturnType<typeof setTimeout> | null = null;\nlet pillObserver: MutationObserver | null = null;\n\nfunction scanPills(doc: Document) {\n if (!guardOn()) return;\n for (const node of Array.from(doc.querySelectorAll<HTMLElement>(PILL_CANDIDATES))) {\n // A tap button's own pill is judged, not its invisible box.\n if (node.classList.contains(\"matrx-tap-target\")) continue;\n const warning = findPillInsetWarning(node);\n if (warning) {\n if (node.getAttribute(\"data-matrx-pill-inset-warning\") === warning) continue;\n node.setAttribute(\"data-matrx-pill-inset-warning\", warning);\n const key = `p:${warning}@${(node.textContent ?? \"\").trim().slice(0, 40)}`;\n if (!reported.has(key)) {\n reported.add(key);\n console.error(`[tap-target] ${warning}`, node);\n }\n } else if (node.hasAttribute(\"data-matrx-pill-inset-warning\")) {\n node.removeAttribute(\"data-matrx-pill-inset-warning\");\n }\n }\n}\n\nfunction startPillInsetScan() {\n if (pillObserver || typeof document === \"undefined\" || typeof MutationObserver === \"undefined\") return;\n const doc = document;\n const schedule = () => {\n if (pillTimer) clearTimeout(pillTimer);\n pillTimer = setTimeout(() => scanPills(doc), 600);\n };\n pillObserver = new MutationObserver((records) => {\n // Our own attribute writes must not re-trigger the scan.\n if (records.every((r) => r.type === \"attributes\" && r.attributeName === \"data-matrx-pill-inset-warning\")) return;\n schedule();\n });\n const begin = () => {\n pillObserver?.observe(doc.body, { childList: true, subtree: true, characterData: true, attributes: true, attributeFilter: [\"class\", \"style\", \"data-matrx-pill-inset-warning\"] });\n schedule();\n };\n if (doc.body) begin();\n else doc.addEventListener(\"DOMContentLoaded\", begin, { once: true });\n}\n","// THE LAYOUT SCALE (0.62.4). The dev guards (pill guard, tap-target guard) judge spacing, ink\n// balance and width in LAYOUT pixels — the numbers a stylesheet writes. `getBoundingClientRect`\n// returns SCREEN pixels, so inside a CSS-transformed (zoomed) container — every Board tile at\n// overview zoom — a correct 11px gap read 5.3px at 0.48 and warned falsely. The effective scale\n// is the ratio of an element's drawn width to its layout width (`offsetWidth`, which ignores\n// transforms), taken from the nearest ancestor-or-self that has a box. 1 when no engine reports\n// layout (jsdom) or the ratio is within 2% of 1, so a real violation at scale 1 reads unchanged.\n\nexport function layoutScale(el: Element | null): number {\n for (let n: Element | null = el; n; n = n.parentElement) {\n const w = (n as HTMLElement).offsetWidth;\n if (!w) continue;\n const drawn = n.getBoundingClientRect().width;\n if (!(drawn > 0)) continue;\n const s = drawn / w;\n if (!Number.isFinite(s) || s <= 0) return 1;\n return Math.abs(s - 1) < 0.02 ? 1 : s;\n }\n return 1;\n}\n","\"use client\";\n\nimport { createContext, useContext, type ReactNode } from \"react\";\n\n/** The surface a tap group sits on. \"glass\" floats over moving content; \"solid\" is a page, card,\n * toast or a header row that is itself a solid band. */\nexport type TapSurfaceKind = \"glass\" | \"solid\";\n\n// Shared through a Symbol.for slot on globalThis (like the default-variant context): the `.` and\n// `./buttons` dist bundles each inline this module, and a provider rendered by one must reach\n// buttons rendered by the other.\nconst SLOT = Symbol.for(\"@ai-matrx/tap-target:surface\");\ntype GlobalWithSlot = typeof globalThis & { [SLOT]?: ReturnType<typeof createContext<TapSurfaceKind>> };\nconst TapSurfaceContext = ((globalThis as GlobalWithSlot)[SLOT] ??= createContext<TapSurfaceKind>(\"glass\"));\n\n/**\n * GLASS ONLY FLOATS, declared once by the surface. A host whose header (or any region) is a solid\n * row wraps it in `<TapSurface surface=\"solid\">`; every `TapTargetButtonGroup` /\n * `TapTargetSearchGroup` inside then renders solid by itself — no per-page `surface=\"solid\"`.\n * A group's own `surface` prop still wins.\n */\nexport function TapSurface({ surface, children }: { surface: TapSurfaceKind; children: ReactNode }) {\n return <TapSurfaceContext.Provider value={surface}>{children}</TapSurfaceContext.Provider>;\n}\n\n/** The group's surface: its explicit prop, else the nearest `<TapSurface>`, else glass. */\nexport function useTapSurface(explicit: TapSurfaceKind | undefined): TapSurfaceKind {\n const inherited = useContext(TapSurfaceContext);\n return explicit ?? inherited;\n}\n","\"use client\";\n\n// THE BUILT-IN CAPABILITIES of every tap button — each one an enum or a flag,\n// never a class a caller writes. Rendering and geometry live in tap-target.css\n// (`.matrx-tap-badge`, `.matrx-tap-pressed`, `.matrx-tap-chevron`, …).\n\nimport { useEffect, type ReactNode } from \"react\";\n\nimport { MOTION_SPIN } from \"../motion\";\n\n/** Glyph color. Replaces the free-form `className`. */\nexport type TapTone = \"default\" | \"muted\" | \"primary\" | \"destructive\" | \"success\" | \"warning\" | \"info\";\n\n/** Fill of a solid button. Replaces `bgColor` / `iconColor` / hover / active. */\nexport type TapSolidTone = \"primary\" | \"destructive\" | \"success\" | \"warning\" | \"neutral\";\n\nexport const TAP_TONE_CLASS: Record<TapTone, string> = {\n default: \"text-foreground\",\n muted: \"text-muted-foreground group-hover/tap:text-foreground\",\n primary: \"text-primary-ink\",\n destructive: \"text-destructive-ink\",\n success: \"text-success-ink\",\n warning: \"text-warning-ink\",\n info: \"text-info-ink\",\n};\n\nexport const TAP_SOLID_TONE: Record<TapSolidTone, { fill: string; glyph: string }> = {\n primary: { fill: \"bg-primary group-hover/tap:bg-primary/85\", glyph: \"text-primary-foreground\" },\n destructive: { fill: \"bg-danger-fill group-hover/tap:bg-danger-fill/85\", glyph: \"text-danger-fill-foreground\" },\n success: { fill: \"bg-success-fill group-hover/tap:bg-success-fill/85\", glyph: \"text-success-fill-foreground\" },\n warning: { fill: \"bg-warning group-hover/tap:bg-warning/85\", glyph: \"text-warning-foreground\" },\n neutral: { fill: \"bg-foreground group-hover/tap:bg-foreground/85\", glyph: \"text-background\" },\n};\n\n/**\n * A keyboard shortcut: modifiers joined by \"+\", then one key —\n * \"mod+k\" (⌘ on Apple, Ctrl elsewhere), \"shift+mod+p\", \"alt+n\", \"/\", \"?\".\n */\nexport type TapShortcut = string;\n\nexport interface TapFeatureProps {\n /** Glyph color, from the system's list. */\n tone?: TapTone | undefined;\n /** A count (99+ past 99) or a dot, drawn on the pill's corner by the system. */\n badge?: number | \"dot\" | undefined;\n /** A toggle that is on (sidebar open, filter on): tinted pill + aria-pressed. */\n pressed?: boolean | undefined;\n /** Work in flight: the glyph becomes a spinner and presses are ignored. */\n loading?: boolean | undefined;\n /** Why the button cannot be used — disables it and becomes its tooltip. */\n disabledReason?: string | undefined;\n /** Keyboard shortcut that presses the button; shown in its tooltip. */\n shortcut?: TapShortcut | undefined;\n /** A menu trigger: a small chevron after the label. */\n chevron?: boolean | undefined;\n}\n\nconst IS_APPLE =\n typeof navigator !== \"undefined\" && /Mac|iPhone|iPad|iPod/.test(navigator.platform || navigator.userAgent);\n\ninterface ParsedShortcut {\n mod: boolean;\n shift: boolean;\n alt: boolean;\n key: string;\n}\n\nexport function parseShortcut(shortcut: TapShortcut): ParsedShortcut {\n const parts = shortcut.toLowerCase().split(\"+\");\n const key = parts.pop() ?? \"\";\n return { mod: parts.includes(\"mod\"), shift: parts.includes(\"shift\"), alt: parts.includes(\"alt\"), key };\n}\n\n/** \"mod+k\" → \"⌘K\" on Apple, \"Ctrl+K\" elsewhere. */\nexport function formatTapShortcut(shortcut: TapShortcut): string {\n const p = parseShortcut(shortcut);\n const key = p.key.length === 1 ? p.key.toUpperCase() : p.key[0]!.toUpperCase() + p.key.slice(1);\n if (IS_APPLE) return `${p.alt ? \"⌥\" : \"\"}${p.shift ? \"⇧\" : \"\"}${p.mod ? \"⌘\" : \"\"}${key}`;\n return [p.mod && \"Ctrl\", p.alt && \"Alt\", p.shift && \"Shift\", key].filter(Boolean).join(\"+\");\n}\n\nfunction isTyping(target: EventTarget | null): boolean {\n const el = target as HTMLElement | null;\n return !!el && (el.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(el.tagName));\n}\n\nexport function matchesTapShortcut(e: KeyboardEvent, shortcut: TapShortcut): boolean {\n const p = parseShortcut(shortcut);\n if ((e.metaKey || e.ctrlKey) !== p.mod || e.altKey !== p.alt) return false;\n // \"?\" and other shifted symbols arrive with shiftKey set — only compare\n // shift for letters and named keys.\n if (/^[a-z0-9]$|^[a-z]{2,}$/.test(p.key) && e.shiftKey !== p.shift) return false;\n if (!p.mod && isTyping(e.target)) return false;\n return e.key.toLowerCase() === p.key;\n}\n\n/** Presses `node` when its shortcut is typed anywhere on the page. */\nexport function useTapShortcut(shortcut: TapShortcut | undefined, getNode: () => HTMLElement | null, enabled: boolean) {\n useEffect(() => {\n if (!shortcut || !enabled) return;\n const onKey = (e: KeyboardEvent) => {\n if (!matchesTapShortcut(e, shortcut)) return;\n const node = getNode();\n if (!node || !node.isConnected) return;\n e.preventDefault();\n node.click();\n };\n window.addEventListener(\"keydown\", onKey);\n return () => window.removeEventListener(\"keydown\", onKey);\n }, [shortcut, enabled, getNode]);\n}\n\nexport function TapBadge({ badge }: { badge: number | \"dot\" }) {\n if (badge === \"dot\") return <span aria-hidden=\"true\" className=\"matrx-tap-badge\" data-dot=\"\" />;\n if (badge <= 0) return null;\n return (\n <span aria-hidden=\"true\" className=\"matrx-tap-badge\">\n {badge > 99 ? \"99+\" : badge}\n </span>\n );\n}\n\nexport function TapSpinner({ className }: { className: string }) {\n return (\n <svg className={className} fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2} aria-hidden=\"true\">\n <circle\n className={MOTION_SPIN}\n cx=\"12\"\n cy=\"12\"\n r=\"9\"\n strokeDasharray=\"28.27\"\n strokeDashoffset=\"9\"\n strokeLinecap=\"round\"\n style={{ transformOrigin: \"12px 12px\" }}\n />\n </svg>\n );\n}\n\nexport function TapChevron() {\n return (\n <svg\n className=\"matrx-tap-chevron\"\n aria-hidden=\"true\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n );\n}\n\n/** Tooltip body: the label, then the shortcut as a key cap. */\nexport function tooltipBody(label: string, shortcut: TapShortcut | undefined): ReactNode {\n if (!shortcut) return label;\n return (\n <span className=\"matrx-tap-tooltip\">\n {label}\n <kbd className=\"matrx-tap-kbd\">{formatTapShortcut(shortcut)}</kbd>\n </span>\n );\n}\n","\"use client\";\n\nimport { createContext, useContext, type ReactNode } from \"react\";\n\nimport { useTapSurface } from \"./tap-surface\";\n\n// THE PLACEMENT DEFAULT — which variant a tap button takes when its caller\n// names none. Outside a provider that is \"glass\" (the floating-bar look). A\n// host region that holds tap buttons BESIDE text (a route header's back +\n// title cell) wraps itself in <TapDefaultVariant value=\"transparent\"> so every\n// button in it matches its neighbours (rule 2, \"all glass or none\") without\n// each call site repeating variant=\"transparent\". An explicit `variant` prop\n// always wins, so a bar whose pieces are ALL glass stays glass.\n//\n// The context object lives in a `Symbol.for` slot on globalThis, like the link\n// seam: the `.` and `./buttons` dist bundles each inline this module, and a\n// provider rendered by one must reach buttons rendered by the other.\n\nexport type TapDefaultVariantValue = \"glass\" | \"transparent\";\n\nconst SLOT = Symbol.for(\"@ai-matrx/tap-target:default-variant\");\ntype GlobalWithSlot = typeof globalThis & {\n [SLOT]?: ReturnType<typeof createContext<TapDefaultVariantValue>>;\n};\n\nfunction ctx() {\n const g = globalThis as GlobalWithSlot;\n return (g[SLOT] ??= createContext<TapDefaultVariantValue>(\"glass\"));\n}\n\n/** The variant tap buttons below take when they name none. */\nexport function useTapDefaultVariant(): TapDefaultVariantValue {\n return useContext(ctx());\n}\n\n/** Set the default variant for every tap button below that names none. */\nexport function TapDefaultVariant({ value, children }: { value: TapDefaultVariantValue; children: ReactNode }) {\n const Context = ctx();\n return <Context.Provider value={value}>{children}</Context.Provider>;\n}\n\n/**\n * The variant a lone tap button draws: its explicit `variant`, else a region's\n * <TapDefaultVariant>, else — on a <TapSurface surface=\"solid\"> — \"transparent\"\n * (glass only floats), else glass. An explicit variant always wins.\n */\nexport function useTapButtonVariant<V extends string>(explicit: V | undefined): V | TapDefaultVariantValue {\n const placed = useTapDefaultVariant();\n const surface = useTapSurface(undefined);\n if (explicit !== undefined) return explicit;\n if (placed !== \"glass\") return placed;\n return surface === \"solid\" ? \"transparent\" : \"glass\";\n}\n","\"use client\";\n\nimport { InfoIcon as Info, AlertTriangleIcon as AlertTriangle, CircleAlertIcon as AlertCircle, CircleCheckIcon as CheckCircle } from \"../../icons\";\nimport { cn } from \"../../cn\";\n\ntype Tone = \"info\" | \"warning\" | \"error\" | \"success\";\n\nconst toneStyles: Record<\n Tone,\n { container: string; icon: string; Icon: React.ComponentType<{ className?: string }> }\n> = {\n info: {\n container:\n \"border-blue-500/30 bg-blue-500/5 text-blue-900 dark:text-blue-100\",\n icon: \"text-blue-600 dark:text-blue-400\",\n Icon: Info,\n },\n warning: {\n container:\n \"border-amber-500/30 bg-amber-500/5 text-amber-900 dark:text-amber-100\",\n icon: \"text-amber-600 dark:text-amber-400\",\n Icon: AlertTriangle,\n },\n error: {\n container:\n \"border-red-500/30 bg-red-500/5 text-red-900 dark:text-red-100\",\n icon: \"text-red-600 dark:text-red-400\",\n Icon: AlertCircle,\n },\n success: {\n container:\n \"border-emerald-500/30 bg-emerald-500/5 text-emerald-900 dark:text-emerald-100\",\n icon: \"text-emerald-600 dark:text-emerald-400\",\n Icon: CheckCircle,\n },\n};\n\nexport type SettingsCalloutProps = {\n tone: Tone;\n title?: string;\n children: React.ReactNode;\n /** Optional action node rendered in the footer row of the callout. */\n action?: React.ReactNode;\n};\n\nexport function SettingsCallout({\n tone,\n title,\n children,\n action,\n}: SettingsCalloutProps) {\n const { container, icon, Icon } = toneStyles[tone];\n return (\n <div\n className={cn(\n \"mx-4 mb-4 flex items-start gap-2.5 rounded-md border px-3 py-2.5\",\n container,\n )}\n >\n <Icon className={cn(\"h-4 w-4 shrink-0 mt-0.5\", icon)} />\n <div className=\"flex-1 min-w-0 type-secondary leading-relaxed\">\n {title && <div className=\"font-semibold mb-0.5\">{title}</div>}\n <div>{children}</div>\n {action && <div className=\"mt-2\">{action}</div>}\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport { cn } from \"../../cn\";\n\nexport type SettingsGridProps = {\n /** Desktop column count. Defaults to 2. */\n columns?: 2 | 3;\n /** Gap size between cells. */\n gap?: \"sm\" | \"md\" | \"lg\";\n children: React.ReactNode;\n};\n\nconst gapClass = {\n sm: \"gap-2\",\n md: \"gap-3\",\n lg: \"gap-4\",\n};\n\nconst columnsClass = {\n 2: \"@[40rem]/settings-grid:grid-cols-2\",\n 3: \"@[40rem]/settings-grid:grid-cols-2 @[56rem]/settings-grid:grid-cols-3\",\n};\n\n/**\n * Grid container for dense dashboards — e.g. 2-up stat cards, side-by-side pickers.\n * On mobile always stacks to a single column to keep controls readable.\n */\nexport function SettingsGrid({\n columns = 2,\n gap = \"md\",\n children,\n}: SettingsGridProps) {\n return (\n <div\n className={cn(\n \"@container/settings-grid grid grid-cols-1 px-4 mb-4 [&>*]:min-w-0\",\n columnsClass[columns],\n gapClass[gap],\n )}\n >\n {children}\n </div>\n );\n}\n","\"use client\";\n\nimport { useClipboard } from \"@ai-matrx/kit/clipboard\";\nimport { settingsCopyNotify } from \"../host\";\nimport { CheckIcon as Check, CopyIcon as Copy } from \"../../icons\";\nimport { useId, useState } from \"react\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport { cn } from \"../../cn\";\nimport { Button } from \"../../controls/controls\";\nimport type { SettingsCommonProps } from \"../types\";\n\nexport type SettingsReadOnlyValueProps = Omit<\n SettingsCommonProps,\n \"disabled\" | \"modified\"\n> & {\n value: string;\n /** When true, shows a copy-to-clipboard button. */\n copyable?: boolean;\n /** Renders the value in a monospace font (for IDs, hashes, URLs). */\n mono?: boolean;\n last?: boolean;\n};\n\n/**\n * Informational row — no user control, just a key/value display.\n * Examples: \"App version: 0.3.217\", \"Build: abc123\", \"User ID: uuid-...\".\n */\nexport function SettingsReadOnlyValue({\n value,\n copyable,\n mono,\n last,\n ...rowProps\n}: SettingsReadOnlyValueProps) {\n const notify = settingsCopyNotify();\n const { copyText } = useClipboard(notify ? { notify } : {});\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n\n const [copied, setCopied] = useState(false);\n\n const handleCopy = async () => {\n if (!(await copyText(value))) return;\n setCopied(true);\n setTimeout(() => setCopied(false), 1200);\n };\n\n return (\n <SettingsRow\n {...rowProps}\n id={id}\n variant=\"inline\"\n controlLayout=\"wide\"\n last={last}\n >\n <div className=\"flex min-w-0 items-center gap-1.5\">\n <span\n className={cn(\n \"min-w-0 max-w-full type-secondary text-muted-foreground truncate @[40rem]/settings:max-w-64\",\n mono && \"font-mono tabular-nums\",\n )}\n title={value}\n >\n {value}\n </span>\n {copyable && (\n <Button\n type=\"button\"\n variant=\"quiet\"\n aria-label={copied ? \"Copied\" : \"Copy to clipboard\"}\n icon={copied ? <Check className=\"h-3 w-3 text-emerald-500\" /> : <Copy className=\"h-3 w-3\" />}\n onClick={handleCopy}\n className=\"shrink-0\"\n />\n )}\n </div>\n </SettingsRow>\n );\n}\n","\"use client\";\n\nimport { useId, useState } from \"react\";\nimport { ChevronDownIcon as ChevronDown } from \"../../icons\";\nimport type { SettingsIconType as LucideIcon } from \"../icon-type\";\nimport { cn } from \"../../cn\";\nimport { Tile } from \"../../controls/surfaces\";\nimport { useSettingsDesign } from \"../SettingsDesignProvider\";\nimport { SettingsSectionProvider } from \"../SettingsSectionContext\";\n\nexport type SettingsSectionProps = {\n title: string;\n description?: string;\n icon?: LucideIcon;\n /** Makes the section expand/collapse with a chevron header. */\n collapsible?: boolean;\n /** When collapsible, controls initial state. Defaults to expanded. */\n defaultOpen?: boolean;\n /** Section header emphasis. Defaults to \"default\". */\n emphasis?: \"subtle\" | \"default\" | \"strong\";\n /** Optional action node rendered to the right of the title (e.g. reset button). */\n action?: React.ReactNode;\n children: React.ReactNode;\n};\n\nexport type SettingsGroupProps = SettingsSectionProps;\n\nconst emphasisTitleClass = {\n subtle: \"text-xs font-semibold uppercase tracking-wide text-muted-foreground\",\n default: \"text-sm font-semibold text-foreground\",\n strong: \"text-base font-semibold text-foreground\",\n};\n\n/**\n * SettingsSection groups related rows under a common header.\n * Sections are the primary organizing unit inside a settings tab.\n */\nexport function SettingsSection({\n title,\n description,\n icon: Icon,\n collapsible,\n defaultOpen = true,\n emphasis = \"default\",\n action,\n children,\n}: SettingsSectionProps) {\n const { variant } = useSettingsDesign();\n const [open, setOpen] = useState(defaultOpen);\n const contentId = useId().replace(/:/g, \"\");\n const isOpen = collapsible ? open : true;\n\n return (\n <section className={cn(variant === \"compact\" ? \"mb-4\" : \"mb-6\")}>\n <header className=\"flex flex-wrap items-center gap-2 px-4 mb-2\">\n {collapsible ? (\n <Tile\n type=\"button\"\n dense\n variant=\"quiet\"\n title={\n <span className=\"flex min-w-0 items-center gap-2\">\n <ChevronDown\n className={cn(\"h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform\", !isOpen && \"-rotate-90\")}\n aria-hidden=\"true\"\n />\n {Icon ? <Icon className=\"h-4 w-4 shrink-0 text-muted-foreground\" aria-hidden=\"true\" /> : null}\n <span className={cn(emphasisTitleClass[emphasis], \"min-w-0 break-words\")}>{title}</span>\n </span>\n }\n className=\"-mx-2 flex min-w-0 flex-1 items-center gap-2 rounded px-2 py-1 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n aria-expanded={isOpen}\n aria-controls={contentId}\n onClick={() => setOpen((value) => !value)}\n />\n ) : (\n <>\n {Icon && (\n <Icon\n className=\"h-4 w-4 text-muted-foreground\"\n aria-hidden=\"true\"\n />\n )}\n <h3\n className={cn(\n emphasisTitleClass[emphasis],\n \"min-w-0 flex-1 break-words\",\n )}\n >\n {title}\n </h3>\n </>\n )}\n {action && <div className=\"ml-auto max-w-full shrink-0\">{action}</div>}\n </header>\n {description && isOpen && (\n <p className=\"px-4 type-secondary text-muted-foreground mb-2 leading-snug\">\n {description}\n </p>\n )}\n {isOpen && (\n <div\n id={contentId}\n className={cn(\n \"border border-border/40 bg-card/30\",\n variant === \"compact\" ? \"rounded-md\" : \"rounded-lg\",\n )}\n >\n <SettingsSectionProvider title={title}>\n {children}\n </SettingsSectionProvider>\n </div>\n )}\n </section>\n );\n}\n\n/** A named reusable settings group with the exact SettingsSection contract. */\nexport function SettingsGroup(props: SettingsGroupProps) {\n return <SettingsSection {...props} />;\n}\n","\"use client\";\n\nimport type { SettingsIconType as LucideIcon } from \"../icon-type\";\nimport { cn } from \"../../cn\";\nimport { useSettingsDesign } from \"../SettingsDesignProvider\";\nimport { CompactHelpPopover } from \"../SettingsRow\";\n\nexport type SettingsSubHeaderProps = {\n title: string;\n description?: string;\n icon?: LucideIcon;\n /** Renders a bottom border as a divider. Defaults to true. */\n divider?: boolean;\n};\n\n/**\n * Page-level header for a settings tab. The `description` opens from a help\n * icon beside the title rather than sitting under it.\n * Render once at the top of each tab component — above any SettingsSection.\n */\nexport function SettingsSubHeader({\n title,\n description,\n icon: Icon,\n divider = true,\n}: SettingsSubHeaderProps) {\n const { variant } = useSettingsDesign();\n return (\n <div\n data-settings-subheader=\"\"\n className={cn(\n \"px-4\",\n variant === \"compact\" ? \"pb-3 mb-3\" : \"pb-4 mb-4\",\n divider && \"border-b border-border/40\",\n )}\n >\n <div className=\"flex items-center gap-2\">\n {Icon && <Icon className=\"h-5 w-5 text-foreground\" />}\n <h2 className={cn(\"font-semibold text-foreground leading-tight\", variant === \"compact\" ? \"text-base\" : \"text-lg\")}>\n {title}\n </h2>\n {/* The title stands alone (page-pass core 3): what the tab is for is\n one tap away, never a sentence parked under every heading. */}\n {description && <CompactHelpPopover label={title} description={description} />}\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport type { ReactNode, Ref } from \"react\";\nimport { XIcon as X } from \"../../icons\";\nimport type { SettingsTreeNode } from \"../tree/types\";\nimport { cn } from \"../../cn\";\nimport { Button, SearchField } from \"../../controls/controls\";\n\nexport function SettingsNavigationSearch({\n value,\n onValueChange,\n label = \"Search settings\",\n inputRef,\n}: {\n value: string;\n onValueChange: (value: string) => void;\n label?: string;\n inputRef?: Ref<HTMLInputElement>;\n}) {\n return (\n // A solid band with a rule under it: the sidebar itself is transparent\n // over the textured shell, so a bare input let scrolled items show\n // through around it (page-pass 2026-09-27).\n <div className=\"sticky top-0 z-10 mb-1 border-b border-border/60 bg-textured pb-1.5 pt-1\" role=\"search\">\n <div className=\"relative\">\n <SearchField\n ref={inputRef}\n type=\"search\"\n value={value}\n onChange={(event) => onValueChange(event.target.value)}\n placeholder={label}\n aria-label={label}\n end={value ? <span aria-hidden=\"true\" className=\"w-7 shrink-0\" /> : undefined}\n className=\"w-full\"\n />\n {value ? <Button type=\"button\" variant=\"quiet\" className=\"absolute right-1.5 top-1/2 -translate-y-1/2\" onClick={() => onValueChange(\"\")} aria-label=\"Clear search\" icon={<X aria-hidden />} /> : null}\n </div>\n </div>\n );\n}\n\nexport type SettingsNavigationItem = {\n id: string;\n label: string;\n location: string;\n node: SettingsTreeNode;\n};\n\nexport type SettingsNavigationSection = {\n id: string;\n /** Omit when adjacent root links do not have a meaningful shared heading. */\n label?: string;\n items: SettingsNavigationItem[];\n};\n\n/**\n * Converts a settings tree into Notion-style, non-recursive sections. Desktop\n * navigation intentionally has no expandable state: headings orient people and\n * every destination stays visible as a flat link.\n */\nexport function settingsNavigationSections(\n nodes: SettingsTreeNode[],\n): SettingsNavigationSection[] {\n const sections: SettingsNavigationSection[] = [];\n for (const root of nodes) {\n if (!root.children?.length) {\n const last = sections.at(-1);\n if (last && !last.label) {\n last.items.push(asItem(root, \"Settings\"));\n } else {\n sections.push({ id: `unsectioned:${root.id}`, items: [asItem(root, \"Settings\")] });\n }\n continue;\n }\n\n // Registry folders are headings. Configuration domains use their routable\n // Overview child while keeping the domain's human name in the flat list.\n const items: SettingsNavigationItem[] = [];\n if (root.navigable) {\n items.push(asItem({ ...root, label: root.navigationLabel ?? root.label }, \"Settings\"));\n }\n const collect = (node: SettingsTreeNode, path: string[]): void => {\n if (!node.children?.length) {\n items.push(asItem(node, path.join(\" / \")));\n return;\n }\n\n const overview = node.children.find((child) => child.label === \"Overview\");\n if (overview) {\n // The domain's own icon travels with its name; the Overview leaf has\n // none, which drew the same fallback gear on every domain row.\n items.push(\n asItem(\n { ...overview, label: node.label, icon: overview.icon ?? node.icon },\n [...path, node.label].join(\" / \"),\n ),\n );\n return;\n }\n for (const child of node.children) collect(child, [...path, node.label]);\n };\n for (const child of root.children) collect(child, [root.label]);\n if (items.length) sections.push({ id: root.id, label: root.label, items });\n }\n return sections;\n}\n\nfunction asItem(node: SettingsTreeNode, location: string): SettingsNavigationItem {\n return { id: node.id, label: node.label, location, node };\n}\n\nexport function filterSettingsNavigationSections(\n sections: SettingsNavigationSection[],\n query: string,\n): SettingsNavigationSection[] {\n const needle = query.trim().toLocaleLowerCase();\n if (!needle) return sections;\n return sections.flatMap((section) => {\n const items = section.items.filter((item) =>\n [item.label, item.location, item.node.description, ...(item.node.searchKeywords ?? [])]\n .filter((value): value is string => Boolean(value))\n .join(\" \")\n .toLocaleLowerCase()\n .includes(needle),\n );\n return items.length ? [{ ...section, items }] : [];\n });\n}\n\nexport function SettingsFlatNavigation({\n sections,\n activeId,\n renderItem,\n empty,\n}: {\n sections: SettingsNavigationSection[];\n activeId: string | null;\n /** Return one native interactive root (`a` or `button`); this primitive owns its row styling. */\n renderItem: (item: SettingsNavigationItem, active: boolean) => ReactNode;\n empty?: ReactNode;\n}) {\n if (sections.length === 0) {\n return <div className=\"px-3 py-6 type-body text-muted-foreground\">{empty ?? \"No settings match.\"}</div>;\n }\n return (\n <div className=\"flex flex-col gap-3 py-1\">\n {sections.map((section) => (\n <section key={section.id} className=\"flex flex-col gap-0.5\" aria-label={section.label ?? \"Settings\"}>\n {section.label ? <h2 className={cn(\"m-0 px-2 py-1 type-secondary font-medium leading-5 text-muted-foreground\", section.id === activeId && \"rounded bg-muted text-foreground\")}>{section.label}</h2> : null}\n <div className=\"flex flex-col gap-px\">\n {section.items.map((item) => (\n <div\n key={item.id}\n className={cn(\n \"[&>a]:flex [&>a]:min-h-[1.875rem] [&>a]:w-full [&>a]:items-center [&>a]:rounded-sm [&>a]:pl-2 [&>a]:text-[0.8125rem] [&>button]:flex [&>button]:min-h-[1.875rem] [&>button]:w-full [&>button]:items-center [&>button]:rounded-sm [&>button]:pl-2 [&>button]:text-[0.8125rem]\",\n item.id === activeId && \"[&>a]:bg-muted [&>a]:text-foreground [&>button]:bg-muted [&>button]:text-foreground\",\n )}\n >\n {renderItem(item, item.id === activeId)}\n </div>\n ))}\n </div>\n </section>\n ))}\n </div>\n );\n}\n","\"use client\";\n\nimport { useId } from \"react\";\nimport type { SettingsIconType as LucideIcon } from \"../icon-type\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport { cn } from \"../../cn\";\nimport type { SettingsCommonProps, SettingsControlSize } from \"../types\";\nimport { Button } from \"../../controls/controls\";\n\ntype ButtonKind = \"default\" | \"outline\" | \"ghost\" | \"destructive\";\n\nexport type SettingsButtonProps = SettingsCommonProps & {\n /** Action label shown on the button itself. */\n actionLabel: string;\n onClick: () => void;\n kind?: ButtonKind;\n size?: SettingsControlSize;\n actionIcon?: LucideIcon;\n /** Stacks the button below the label. Use when the action label is long. */\n stacked?: boolean;\n last?: boolean;\n /** Shows a confirmation spinner / loading state. */\n loading?: boolean;\n};\n\n/**\n * Renders a settings row whose control is an action button.\n * Good for: \"Reset to defaults\", \"Clear cache\", \"Sign out\", \"Open in browser\".\n */\nexport function SettingsButton({\n actionLabel,\n onClick,\n kind = \"outline\",\n size = \"md\",\n actionIcon: ActionIcon,\n stacked,\n loading,\n last,\n ...rowProps\n}: SettingsButtonProps) {\n // Retain the API field for callers; canonical Button owns its geometry.\n void size;\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n\n return (\n <SettingsRow\n {...rowProps}\n id={id}\n variant={stacked ? \"stacked\" : \"inline\"}\n last={last}\n >\n <Button\n id={id}\n type=\"button\"\n variant={kind === \"default\" ? \"primary\" : kind === \"ghost\" ? \"quiet\" : kind === \"destructive\" ? \"danger\" : \"outline\"}\n icon={ActionIcon ? <ActionIcon className=\"h-3.5 w-3.5 shrink-0\" /> : undefined}\n onClick={onClick}\n disabled={rowProps.disabled || loading}\n className={cn(stacked && \"w-full\", loading && \"animate-pulse\")}\n >\n <span>{loading ? \"Working…\" : actionLabel}</span>\n </Button>\n </SettingsRow>\n );\n}\n","\"use client\";\n\nimport { useId } from \"react\";\nimport { Checkbox } from \"../../checkbox\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport type { SettingsCommonProps } from \"../types\";\n\nexport type SettingsCheckboxProps = SettingsCommonProps & {\n checked: boolean;\n onCheckedChange: (checked: boolean) => void;\n last?: boolean;\n};\n\n/**\n * Use for opt-in / consent / \"tick to enable\" flows.\n * For app-level feature toggles, prefer SettingsSwitch.\n */\nexport function SettingsCheckbox({\n checked,\n onCheckedChange,\n last,\n ...rowProps\n}: SettingsCheckboxProps) {\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n return (\n <SettingsRow {...rowProps} id={id} variant=\"inline\" last={last}>\n <Checkbox\n id={id}\n checked={checked}\n onCheckedChange={(v) => onCheckedChange(Boolean(v))}\n disabled={rowProps.disabled}\n />\n </SettingsRow>\n );\n}\n","\"use client\";\n\n/**\n * Checkbox — Radix checkbox, and the indeterminate ruling that came with it.\n *\n * RADIX RENDERS THE INDICATOR FOR BOTH `checked` AND `\"indeterminate\"`. The\n * stock shadcn body puts a full check inside it either way, so a half-selected\n * \"select all\" tells the user every row is selected — a screen stating\n * something false. The two states get different glyphs here, always.\n *\n * `size` carries the two boxes the hosts had forked into: matrx-frontend's\n * dense 14px control and the stock 16px one.\n */\n\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { RadixCheckIcon, DividerHorizontalIcon } from \"./icons\";\n\nexport type CheckboxSize = \"sm\" | \"md\";\n\nconst CHECKBOX_SIZES: Record<CheckboxSize, { root: string; glyph: string }> = {\n sm: { root: \"h-3.5 w-3.5 rounded-xs\", glyph: \"h-3 w-3\" },\n md: { root: \"h-4 w-4 rounded-sm\", glyph: \"h-3.5 w-3.5\" },\n};\n\nexport interface CheckboxProps\n extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> {\n /** Box size. Default `md` (the stock 16px control); `sm` is the dense 14px one. */\n size?: CheckboxSize;\n}\n\nconst Checkbox = React.forwardRef<\n React.ComponentRef<typeof CheckboxPrimitive.Root>,\n CheckboxProps\n>(({ className, size = \"md\", ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n data-slot=\"checkbox\"\n className={cn(\n \"peer shrink-0 border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground\",\n CHECKBOX_SIZES[size].root,\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"flex items-center justify-center text-current\"\n >\n {props.checked === \"indeterminate\" ? (\n <DividerHorizontalIcon className={CHECKBOX_SIZES[size].glyph} />\n ) : (\n <RadixCheckIcon className={CHECKBOX_SIZES[size].glyph} />\n )}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n));\nCheckbox.displayName = CheckboxPrimitive.Root.displayName;\n\nexport { Checkbox };\n","\"use client\";\n\nimport { useState, useEffect, useId } from \"react\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport { Field } from \"../../controls/controls\";\nimport { Button } from \"../../controls/controls\";\nimport type { SettingsCommonProps } from \"../types\";\n\nexport type SettingsColorPickerProps = SettingsCommonProps & {\n value: string;\n onValueChange: (value: string) => void;\n /** Small palette of preset swatches shown alongside the picker. */\n presets?: string[];\n last?: boolean;\n};\n\nfunction isValidHex(value: string): boolean {\n return /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(value);\n}\n\nexport function SettingsColorPicker({\n value,\n onValueChange,\n presets,\n last,\n ...rowProps\n}: SettingsColorPickerProps) {\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n\n const [draft, setDraft] = useState(value);\n\n useEffect(() => {\n setDraft(value);\n }, [value]);\n\n const commit = (raw: string) => {\n const candidate = raw.startsWith(\"#\") ? raw : `#${raw}`;\n if (isValidHex(candidate)) {\n onValueChange(candidate.toLowerCase());\n setDraft(candidate.toLowerCase());\n } else {\n setDraft(value);\n }\n };\n\n return (\n <SettingsRow {...rowProps} id={id} variant=\"inline\" controlLayout=\"wide\" last={last}>\n <div className=\"flex max-w-full flex-wrap items-center gap-1.5\">\n {presets && presets.length > 0 && (\n <div className=\"flex flex-wrap items-center gap-1 mr-1.5\">\n {presets.map((p) => (\n <Button\n key={p}\n type=\"button\"\n variant=\"quiet\"\n aria-label={`Set to ${p}`}\n icon={<span className=\"size-3.5 rounded-sm\" style={{ backgroundColor: p }} aria-hidden />}\n onClick={() => onValueChange(p)}\n disabled={rowProps.disabled}\n />\n ))}\n </div>\n )}\n <Field\n id={id}\n type=\"color\"\n value={isValidHex(value) ? value : \"#000000\"}\n disabled={rowProps.disabled}\n onChange={(e) => onValueChange(e.target.value)}\n aria-label={`${rowProps.label} color`}\n className=\"w-16 shrink-0\"\n />\n <Field\n type=\"text\"\n value={draft}\n placeholder=\"#000000\"\n maxLength={7}\n disabled={rowProps.disabled}\n onChange={(e) => setDraft(e.target.value)}\n onBlur={(e) => commit(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") (e.currentTarget as HTMLInputElement).blur();\n }}\n aria-label={`${rowProps.label} hex color`}\n width=\"xs\"\n />\n </div>\n </SettingsRow>\n );\n}\n","\"use client\";\n\nimport { useId } from \"react\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"../../select\";\nimport { SettingsRow } from \"../SettingsRow\";\n/** A device as the host lists it (structurally the media-devices manager descriptor). */\nexport interface MediaDeviceDescriptor {\n deviceId: string;\n label: string;\n groupId: string;\n}\nimport type { SettingsCommonProps, SettingsControlSize } from \"../types\";\n\ntype Width = \"auto\" | \"sm\" | \"md\" | \"lg\" | \"full\";\n\nconst widthClass: Record<Width, string> = {\n auto: \"w-full max-w-full @[40rem]/settings:w-auto @[40rem]/settings:min-w-32\",\n sm: \"w-32 max-w-full min-w-0\",\n md: \"w-44 max-w-full min-w-0\",\n lg: \"w-64 max-w-full min-w-0\",\n full: \"w-full\",\n};\n\n/** Sentinel for the \"no explicit choice\" option — never a real deviceId. */\nconst DEFAULT_SENTINEL = \"__system_default__\";\n\nexport type SettingsDeviceSelectProps = SettingsCommonProps & {\n /** Live device list from the media-device manager snapshot. */\n devices: MediaDeviceDescriptor[];\n /** Resolved live deviceId of the current choice (\"\" = default/auto). */\n selectedId: string;\n /** Fired with BOTH the deviceId and its label (\"\" + \"\" = default/auto) —\n * labels are persisted alongside ids because iOS Safari regenerates\n * deviceIds per page load (resolve is id → label → default). */\n onSelect: (deviceId: string, label: string) => void;\n /** Label for the \"no explicit choice\" option (default \"System default\"). */\n defaultOptionLabel?: string;\n /** Fallback label prefix for devices whose label is blank (pre-grant),\n * e.g. \"Microphone\" → \"Microphone (a1b2c3)\". */\n deviceKindLabel: string;\n size?: SettingsControlSize;\n width?: Width;\n /** Renders as a stacked layout. Use when the select should span full width. */\n stacked?: boolean;\n last?: boolean;\n};\n\n/**\n * A settings row whose control is a LIVE media-device picker (microphone,\n * speaker, or camera). Unlike `SettingsSelect`, its options come from a live\n * `enumerateDevices` snapshot and its change event carries the (id, label)\n * PAIR the device-preference model persists. Blank labels (permission not yet\n * granted) fall back to `deviceKindLabel (idPrefix)`.\n */\nexport function SettingsDeviceSelect({\n devices,\n selectedId,\n onSelect,\n defaultOptionLabel = \"System default\",\n deviceKindLabel,\n size = \"md\",\n width = \"md\",\n stacked,\n last,\n ...rowProps\n}: SettingsDeviceSelectProps) {\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n const variant = stacked ? \"stacked\" : \"inline\";\n const effectiveWidth: Width = stacked ? \"full\" : width;\n\n const optionLabel = (d: MediaDeviceDescriptor): string => {\n if (d.label) return d.label;\n const short = d.deviceId ? d.deviceId.slice(0, 6) : \"unknown\";\n return `${deviceKindLabel} (${short})`;\n };\n\n return (\n <SettingsRow\n {...rowProps}\n id={id}\n variant={variant}\n controlLayout=\"wide\"\n last={last}\n >\n <Select\n value={selectedId || DEFAULT_SENTINEL}\n onValueChange={(v) => {\n if (v === DEFAULT_SENTINEL) {\n onSelect(\"\", \"\");\n return;\n }\n const dev = devices.find((d) => d.deviceId === v);\n onSelect(v, dev?.label ?? \"\");\n }}\n disabled={rowProps.disabled ?? false}\n >\n <SelectTrigger\n id={id}\n className={widthClass[effectiveWidth]}\n >\n <SelectValue placeholder={defaultOptionLabel} />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value={DEFAULT_SENTINEL}>{defaultOptionLabel}</SelectItem>\n {devices.map((d) => (\n <SelectItem key={d.deviceId || \"default-device\"} value={d.deviceId}>\n {optionLabel(d)}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </SettingsRow>\n );\n}\n","\"use client\";\n\nimport { useId, useState } from \"react\";\nimport { XIcon as X } from \"../../icons\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport { cn } from \"../../cn\";\nimport { Button } from \"../../controls/controls\";\nimport type { SettingsCommonProps } from \"../types\";\n\nexport type KeybindingValue = {\n /** Key code from KeyboardEvent.code (e.g., \"KeyK\", \"Digit1\"). */\n key: string;\n /** Display string ready to render (e.g., \"⌘K\", \"Ctrl+Shift+P\"). */\n display: string;\n ctrl?: boolean;\n alt?: boolean;\n shift?: boolean;\n meta?: boolean;\n};\n\nexport type SettingsKeybindingProps = SettingsCommonProps & {\n value: KeybindingValue | null;\n onValueChange: (value: KeybindingValue | null) => void;\n /** Allow clearing the binding. */\n clearable?: boolean;\n last?: boolean;\n};\n\nconst NON_BINDING_KEYS = new Set([\n \"Escape\",\n \"Tab\",\n \"Meta\",\n \"Control\",\n \"Shift\",\n \"Alt\",\n \"ContextMenu\",\n \"CapsLock\",\n]);\n\nfunction formatEventAsBinding(\n e: React.KeyboardEvent<HTMLButtonElement>,\n): KeybindingValue | null {\n if (NON_BINDING_KEYS.has(e.key)) return null;\n const isMac =\n typeof navigator !== \"undefined\" &&\n /Mac|iPhone|iPad/.test(navigator.platform);\n const parts: string[] = [];\n if (e.ctrlKey) parts.push(isMac ? \"⌃\" : \"Ctrl\");\n if (e.altKey) parts.push(isMac ? \"⌥\" : \"Alt\");\n if (e.shiftKey) parts.push(isMac ? \"⇧\" : \"Shift\");\n if (e.metaKey) parts.push(isMac ? \"⌘\" : \"Meta\");\n const keyDisplay =\n e.key.length === 1\n ? e.key.toUpperCase()\n : e.key.replace(/^(Arrow|Digit)/, \"\");\n parts.push(keyDisplay);\n return {\n key: e.code,\n display: parts.join(isMac ? \"\" : \"+\"),\n ctrl: e.ctrlKey,\n alt: e.altKey,\n shift: e.shiftKey,\n meta: e.metaKey,\n };\n}\n\nexport function SettingsKeybinding({\n value,\n onValueChange,\n clearable = true,\n last,\n ...rowProps\n}: SettingsKeybindingProps) {\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n\n const [recording, setRecording] = useState(false);\n\n return (\n <SettingsRow\n {...rowProps}\n id={id}\n variant=\"inline\"\n controlLayout=\"wide\"\n last={last}\n >\n <div className=\"flex max-w-full flex-wrap items-center gap-1.5\">\n <Button\n id={id}\n type=\"button\"\n variant={recording ? \"primary\" : \"outline\"}\n onClick={() => setRecording(true)}\n onBlur={() => setRecording(false)}\n onKeyDown={(e) => {\n if (!recording) return;\n if (e.key === \"Escape\") {\n setRecording(false);\n return;\n }\n e.preventDefault();\n const next = formatEventAsBinding(e);\n if (next) {\n onValueChange(next);\n setRecording(false);\n }\n }}\n disabled={rowProps.disabled}\n className={cn(\"min-w-0 flex-1 font-mono tabular-nums @[40rem]/settings:min-w-32\", recording && \"animate-pulse\")}\n >\n {recording\n ? \"Press keys…\"\n : value\n ? value.display\n : \"Click to record\"}\n </Button>\n {clearable && value && !rowProps.disabled && (\n <Button\n type=\"button\"\n variant=\"quiet\"\n aria-label=\"Clear keybinding\"\n icon={<X className=\"h-3.5 w-3.5\" />}\n onClick={() => onValueChange(null)}\n />\n )}\n </div>\n </SettingsRow>\n );\n}\n","\"use client\";\n\nimport { useId } from \"react\";\nimport { SettingsHostLink as AppLink } from \"../host\";\nimport { ArrowRightIcon as ArrowRight, ExternalLinkIcon as ExternalLink } from \"../../icons\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport { cn } from \"../../cn\";\nimport { useSettingsHostNavigate as useSettingsNavigate } from \"../host\";\nimport type { SettingsCommonProps } from \"../types\";\nimport { OutboundLink } from \"@ai-matrx/kit/outbound-react\";\n\nexport type SettingsLinkProps = SettingsCommonProps & {\n /** Internal route (href starting with \"/\") or external URL. */\n href: string;\n /** Action label shown on the link button. */\n actionLabel?: string;\n /** Forces external-link behavior even for relative hrefs. */\n external?: boolean;\n last?: boolean;\n};\n\nexport function SettingsLink({\n href,\n actionLabel,\n external,\n last,\n ...rowProps\n}: SettingsLinkProps) {\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n const isExternal = external ?? /^https?:\\/\\//i.test(href);\n const Icon = isExternal ? ExternalLink : ArrowRight;\n const labelText = actionLabel ?? (isExternal ? \"Open\" : \"View\");\n\n const anchorClasses = cn(\n \"inline-flex min-h-11 items-center gap-1.5 rounded-md border border-border bg-card px-3 text-sm font-medium text-foreground shadow-sm transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring sm:min-h-8\",\n rowProps.disabled && \"pointer-events-none text-disabled-foreground\",\n );\n\n // Presentation-aware navigation: inside the settings window/drawer\n // this dismisses the shell *before* pushing, so the user lands on the\n // target page instead of seeing the window blink out. Cmd/Ctrl/middle\n // click still opens the link in a new tab (shell stays open).\n const navigate = useSettingsNavigate();\n\n return (\n <SettingsRow {...rowProps} id={id} variant=\"inline\" last={last}>\n {isExternal ? (\n <OutboundLink\n href={href}\n className={anchorClasses}\n >\n <span>{labelText}</span>\n <Icon className=\"h-3.5 w-3.5\" />\n </OutboundLink>\n ) : (\n <AppLink\n href={href}\n className={anchorClasses}\n onClick={(e) => {\n if (rowProps.disabled) {\n e.preventDefault();\n return;\n }\n navigate(href, e);\n }}\n >\n <span>{labelText}</span>\n <Icon className=\"h-3.5 w-3.5\" />\n </AppLink>\n )}\n </SettingsRow>\n );\n}\n","\"use client\";\n\nimport { useId, useState } from \"react\";\nimport { CheckIcon as Check, ChevronDownIcon as ChevronDown, XIcon as X } from \"../../icons\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport { cn } from \"../../cn\";\nimport { Button } from \"../../controls/controls\";\nimport { Tile } from \"../../controls/surfaces\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"../../popover\";\nimport type { SettingsCommonProps, SettingsOption } from \"../types\";\n\nexport type SettingsMultiSelectProps<T extends string = string> =\n SettingsCommonProps & {\n value: T[];\n onValueChange: (value: T[]) => void;\n options: SettingsOption<T>[];\n placeholder?: string;\n /** Maximum selected items. Extra selection attempts are ignored. */\n max?: number;\n /** Hide the selected tags display, show just a count (\"3 selected\"). */\n countOnly?: boolean;\n last?: boolean;\n };\n\nexport function SettingsMultiSelect<T extends string = string>({\n value,\n onValueChange,\n options,\n placeholder = \"Select…\",\n max,\n countOnly,\n last,\n ...rowProps\n}: SettingsMultiSelectProps<T>) {\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n\n const [open, setOpen] = useState(false);\n\n const selectedSet = new Set(value);\n const selectedOptions = options.filter((o) => selectedSet.has(o.value));\n\n const toggle = (v: T) => {\n if (selectedSet.has(v)) {\n onValueChange(value.filter((x) => x !== v));\n } else {\n if (max !== undefined && value.length >= max) return;\n onValueChange([...value, v]);\n }\n };\n\n const clearOne = (v: T) => onValueChange(value.filter((x) => x !== v));\n\n const summary = countOnly\n ? value.length === 0\n ? placeholder\n : `${value.length} selected`\n : null;\n\n return (\n <SettingsRow {...rowProps} id={id} variant=\"stacked\" last={last}>\n <div className=\"space-y-2\">\n {!countOnly && selectedOptions.length > 0 && (\n <div className=\"flex flex-wrap gap-1.5\">\n {selectedOptions.map((opt) => (\n <span\n key={opt.value}\n className=\"inline-flex max-w-full items-center gap-1 rounded-md border border-border bg-muted px-2 py-0.5 type-secondary text-foreground\"\n >\n {opt.icon && <opt.icon className=\"h-3 w-3\" />}\n <span className=\"min-w-0 truncate\">{opt.label}</span>\n {!rowProps.disabled && (\n <Button\n type=\"button\"\n variant=\"quiet\"\n aria-label={`Remove ${opt.label}`}\n icon={<X className=\"h-3 w-3\" />}\n onClick={() => clearOne(opt.value)}\n className=\"ml-0.5\"\n />\n )}\n </span>\n ))}\n </div>\n )}\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n id={id}\n type=\"button\"\n variant=\"outline\"\n iconEnd={<ChevronDown className=\"h-4 w-4 shrink-0 text-muted-foreground\" />}\n disabled={rowProps.disabled}\n className=\"w-full\"\n >\n <span\n className={cn(\n \"min-w-0 flex-1 truncate\",\n value.length === 0 && \"text-muted-foreground\",\n )}\n >\n {countOnly\n ? summary\n : value.length === 0\n ? placeholder\n : `${value.length} selected`}\n </span>\n </Button>\n </PopoverTrigger>\n <PopoverContent\n sizing=\"content\"\n align=\"start\"\n className=\"p-1\"\n >\n <div className=\"max-h-64 overflow-y-auto\">\n {options.map((opt) => {\n const isSelected = selectedSet.has(opt.value);\n const isDisabled =\n opt.disabled ||\n (!isSelected && max !== undefined && value.length >= max);\n return (\n <Tile\n key={opt.value}\n type=\"button\"\n dense\n variant=\"quiet\"\n selected={isSelected}\n disabled={isDisabled}\n onClick={() => toggle(opt.value)}\n icon={opt.icon ? <opt.icon className=\"h-3.5 w-3.5\" /> : <Check className=\"h-3.5 w-3.5\" />}\n title={opt.label}\n className=\"w-full\"\n />\n );\n })}\n </div>\n </PopoverContent>\n </Popover>\n </div>\n </SettingsRow>\n );\n}\n","\"use client\";\n\n/**\n * Popover — ported verbatim from matrx-frontend `components/ui/popover.tsx`.\n *\n * Seam inversion: the host's `useNestedPortalContainer` (dialog/popout aware)\n * becomes the injected `PortalContainerProvider` seam (`portal-container.tsx`);\n * the explicit `container` prop keeps top priority, exactly as before.\n *\n * THE ROOT RENDERS UNCONDITIONALLY — no mount gate. This wrapper used to defer\n * rendering until after hydration (\"Radix generates dynamic aria-controls ids\n * that differ between SSR and client\"), and that justification was false:\n * Radix ids come from React's SSR-stable `useId` (verified against\n * @radix-ui/react-popover 1.1.17 / react-id 1.1.2). The gate was actively\n * harmful — the Trigger wraps ALWAYS-VISIBLE content, so `return null`\n * deleted it from SSR and the first client paint.\n */\n\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { MOTION_POPPER } from \"./motion\";\nimport { SOLID_SURFACE_CLASS, type PopoverSurface } from \"./solid-surface\";\nimport { usePortalContainer } from \"./portal-container\";\nimport { keepMovedFocus } from \"./focus-return\";\n\nexport const Popover = PopoverPrimitive.Root;\n\nexport const PopoverTrigger = PopoverPrimitive.Trigger;\n\nexport const PopoverAnchor = PopoverPrimitive.Anchor;\n\nexport interface PopoverContentProps\n extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> {\n /** Explicit portal target; wins over the injected container. */\n container?: HTMLElement | null;\n /**\n * Package-owned open/close motion. Default `true`. Pass `false` for a\n * surface that must appear instantly — a picker re-anchoring while the user\n * types, a measurement pass. It is NOT the reduced-motion switch;\n * `styles.css` already honors `prefers-reduced-motion`.\n */\n animated?: boolean;\n /**\n * HOW WIDE THE POPOVER IS ALLOWED TO BE, and it is the SYSTEM that decides — never a\n * surface pasting its own `w-64` over the default (lane FIX-14, 2026-09-22).\n *\n * `\"fixed\"` (default) is the historical `w-72`: right for a menu of short, known\n * labels, where a ragged edge would look broken.\n *\n * `\"content\"` is for a popover whose whole job is to SHOW SOMETHING THE SYSTEM DID\n * NOT CHOOSE — a person's name, a record's title, a row the user is about to\n * create. The relation picker offered\n *\n * Create “Marisol Okonkwo — 418 Calle Pu\n *\n * inside a 16rem box, cut mid-word, on the one control that exists to show the name\n * being created. A fixed width cannot be right for content of unknown length, so\n * this one grows to its content between an honest floor and an honest ceiling:\n *\n * · at least the trigger's own width, and at least 20rem — the width Airtable's and\n * Notion's link-record pickers settle on, and wide enough that an ordinary\n * \"name — street, town\" fits on one line;\n * · at most 28rem, and never wider than the viewport less a 1rem gutter each side,\n * so it still fits a 375px phone with nothing running off the screen. The floor is\n * clamped by the same gutter, so on a very narrow screen the ceiling still wins.\n *\n * Beyond that ceiling the CONTENT truncates with an ellipsis and carries a `title`.\n * Growing, then ellipsis — never a mid-word cut.\n *\n * BOTH modes keep the phone gutter (2026-09-26): the box is never wider than the\n * viewport less 1rem each side, and Radix keeps it `collisionPadding` (16px) off every\n * screen edge. Measured at 375px before this: `w-72`/`w-80` callers landed flush on\n * the right edge (55→375) because collision padding was 0.\n */\n sizing?: \"fixed\" | \"content\";\n /**\n * The surface fill. `\"default\"` is the theme's popover surface (a host may render it\n * translucent / glass). `\"solid\"` is the OPAQUE surface — the popover token at full\n * alpha, no backdrop blur — for a menu that must read as paper over a cover image or a\n * busy page (a Notion-style ••• menu). Same option on `DropdownMenuContent`.\n */\n surface?: PopoverSurface;\n /**\n * A NAMED fixed width (0.68.22), for a `sizing=\"fixed\"` popover whose content needs more or\n * less room than the default `md` (18rem) — never a pasted `w-[260px]`. Every width keeps the\n * phone gutter (never wider than the viewport less 1rem each side). Derived from the call\n * sites: `xs` 12rem (a short menu), `sm` 15rem (a ••• menu), `md` 18rem (default),\n * `lg` 20rem (a small form), `xl` 26rem (a picker grid), `2xl` 34rem (a gallery).\n * Ignored when `sizing=\"content\"`.\n */\n width?: PopoverWidth;\n /**\n * The inner padding, named (0.68.22): `none` (the content draws its own — a command list, a\n * picker), `xs` 4px (a menu of rows), `sm` 8px, `md` 12px, `default` 16px.\n */\n padding?: PopoverPadding;\n}\n\nexport type PopoverWidth = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\nexport type PopoverPadding = \"none\" | \"xs\" | \"sm\" | \"md\" | \"default\";\n\n/** Literal class per width so a host's Tailwind scan of the package finds every one. */\nexport const POPOVER_WIDTH_CLASS: Record<PopoverWidth, string> = {\n xs: \"w-48\",\n sm: \"w-60\",\n md: \"w-72\",\n lg: \"w-80\",\n xl: \"w-[26rem]\",\n \"2xl\": \"w-[34rem]\",\n};\nexport const POPOVER_PADDING_CLASS: Record<PopoverPadding, string> = {\n none: \"p-0\",\n xs: \"p-1\",\n sm: \"p-2\",\n md: \"p-3\",\n default: \"p-4\",\n};\n\nexport const PopoverContent = React.forwardRef<\n React.ComponentRef<typeof PopoverPrimitive.Content>,\n PopoverContentProps\n>(\n (\n {\n className,\n align = \"center\",\n sideOffset = 4,\n container,\n animated = true,\n sizing = \"fixed\",\n surface = \"default\",\n width = \"md\",\n padding = \"default\",\n collisionPadding = 16,\n onCloseAutoFocus,\n ...props\n },\n ref,\n ) => {\n const portalContainer = usePortalContainer(container);\n return (\n <PopoverPrimitive.Portal container={portalContainer}>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n data-surface={surface === \"solid\" ? \"solid\" : undefined}\n data-width={sizing === \"content\" ? undefined : width}\n data-padding={padding}\n className={cn(\n // Cap to the viewport space Radix measured and scroll — a popover taller\n // than the screen must never trap the user with unreachable content.\n // z must EQUAL the dialog layer (z-[10000]), never exceed it: with equal\n // z, DOM portal order decides, so a dialog opened FROM a popover stacks\n // above it, and a popover opened from a dialog still stacks above the\n // dialog. z-[10001] buried dialogs behind fullscreen popovers.\n \"z-[10000] max-h-[var(--radix-popover-content-available-height)] overflow-y-auto overscroll-contain rounded-md border bg-popover text-popover-foreground shadow-md outline-none\",\n POPOVER_PADDING_CLASS[padding],\n sizing === \"content\"\n ? \"w-auto min-w-[min(max(var(--radix-popover-trigger-width),20rem),calc(100vw-2rem))] max-w-[min(28rem,calc(100vw-2rem))]\"\n : cn(POPOVER_WIDTH_CLASS[width], \"max-w-[calc(100vw-2rem)]\"),\n surface === \"solid\" && SOLID_SURFACE_CLASS,\n animated && MOTION_POPPER,\n className,\n )}\n {...props}\n onCloseAutoFocus={keepMovedFocus(onCloseAutoFocus)}\n />\n </PopoverPrimitive.Portal>\n );\n },\n);\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n","\"use client\";\n\nimport { useState, useEffect, useId } from \"react\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport { Field } from \"../../controls/controls\";\nimport type { SettingsCommonProps, SettingsControlSize } from \"../types\";\n\nexport type SettingsNumberInputProps = SettingsCommonProps & {\n value: number;\n onValueChange: (value: number) => void;\n min?: number;\n max?: number;\n step?: number;\n /** When true, integers only. */\n integer?: boolean;\n unit?: string;\n size?: SettingsControlSize;\n width?: \"sm\" | \"md\" | \"lg\";\n last?: boolean;\n};\n\nconst widthClass = {\n sm: \"w-20 max-w-full min-w-0\",\n md: \"w-24 max-w-full min-w-0\",\n lg: \"w-32 max-w-full min-w-0\",\n};\n\nexport function SettingsNumberInput({\n value,\n onValueChange,\n min,\n max,\n step = 1,\n integer,\n unit,\n size: _size,\n width = \"sm\",\n last,\n ...rowProps\n}: SettingsNumberInputProps) {\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n\n const [draft, setDraft] = useState(String(value));\n\n useEffect(() => {\n setDraft(String(value));\n }, [value]);\n\n const commit = (raw: string) => {\n const parsed = integer ? parseInt(raw, 10) : parseFloat(raw);\n if (Number.isNaN(parsed)) {\n setDraft(String(value));\n return;\n }\n let next = parsed;\n if (min !== undefined) next = Math.max(min, next);\n if (max !== undefined) next = Math.min(max, next);\n onValueChange(next);\n setDraft(String(next));\n };\n\n return (\n <SettingsRow\n {...rowProps}\n id={id}\n variant=\"inline\"\n controlLayout=\"wide\"\n last={last}\n >\n <div className=\"flex max-w-full flex-wrap items-center gap-1.5\">\n <Field\n id={id}\n type=\"number\"\n inputMode={integer ? \"numeric\" : \"decimal\"}\n value={draft}\n min={min}\n max={max}\n step={step}\n onChange={(e) => setDraft(e.target.value)}\n onBlur={(e) => commit(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") (e.currentTarget as HTMLInputElement).blur();\n }}\n disabled={rowProps.disabled}\n className={widthClass[width]}\n />\n {unit && (\n <span className=\"type-secondary text-muted-foreground tabular-nums\">\n {unit}\n </span>\n )}\n </div>\n </SettingsRow>\n );\n}\n","\"use client\";\n\nimport { useId } from \"react\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport { cn } from \"../../cn\";\nimport { Tile } from \"../../controls/surfaces\";\nimport type { SettingsCommonProps, SettingsOption } from \"../types\";\n\nexport type SettingsRadioGroupProps<T extends string = string> =\n SettingsCommonProps & {\n value: T;\n onValueChange: (value: T) => void;\n options: SettingsOption<T>[];\n /** How the radio options are arranged. Defaults to \"stacked\" which is readable on mobile. */\n orientation?: \"horizontal\" | \"stacked\";\n last?: boolean;\n };\n\nexport function SettingsRadioGroup<T extends string = string>({\n value,\n onValueChange,\n options,\n orientation = \"stacked\",\n last,\n ...rowProps\n}: SettingsRadioGroupProps<T>) {\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n\n return (\n <SettingsRow {...rowProps} id={id} variant=\"stacked\" last={last}>\n <div\n role=\"radiogroup\"\n aria-labelledby={id}\n className={cn(\n orientation === \"stacked\" ? \"flex flex-col gap-1.5\" : \"flex flex-wrap gap-2\",\n )}\n >\n {options.map((opt) => {\n const isSelected = opt.value === value;\n return (\n <Tile\n key={opt.value}\n type=\"button\"\n role=\"radio\"\n aria-checked={isSelected}\n disabled={opt.disabled || rowProps.disabled}\n onClick={() => onValueChange(opt.value)}\n variant=\"outline\"\n className={orientation === \"horizontal\" ? \"min-w-[120px] flex-1\" : \"w-full\"}\n icon={<span aria-hidden className={cn(\"size-4 rounded-full border-2 flex items-center justify-center\", isSelected ? \"border-primary\" : \"border-muted-foreground/40\")}>{isSelected ? <span className=\"size-2 rounded-full bg-primary\" /> : null}</span>}\n title={<span><span className=\"flex items-center gap-1.5\">{opt.icon ? <opt.icon className=\"h-3.5 w-3.5\" /> : null}<span className=\"type-title text-foreground\">{opt.label}</span></span>{opt.description ? <span className=\"mt-0.5 block type-secondary text-muted-foreground\">{opt.description}</span> : null}</span>}\n />\n );\n })}\n </div>\n </SettingsRow>\n );\n}\n","\"use client\";\n\nimport { useId } from \"react\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport { Tabs } from \"../../controls/controls\";\nimport type {\n SettingsCommonProps,\n SettingsOption,\n SettingsControlSize,\n} from \"../types\";\n\nexport type SettingsSegmentedProps<T extends string = string> =\n SettingsCommonProps & {\n value: T;\n onValueChange: (value: T) => void;\n /** Read-only: shared vocabularies (agent-writable-settings) are `as const`. */\n options: readonly SettingsOption<T>[];\n size?: SettingsControlSize;\n /** Takes the full row width (stacks on mobile). */\n fullWidth?: boolean;\n last?: boolean;\n };\n\nexport function SettingsSegmented<T extends string = string>({\n value,\n onValueChange,\n options,\n fullWidth,\n last,\n // `size` is retired: the control has one geometry.\n size: _size,\n ...rowProps\n}: SettingsSegmentedProps<T>) {\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n\n return (\n <SettingsRow\n {...rowProps}\n id={id}\n variant={fullWidth ? \"stacked\" : \"inline\"}\n controlLayout=\"wide\"\n last={last}\n >\n <Tabs\n variant=\"capsule\"\n aria-label={rowProps.label}\n value={value}\n onValueChange={onValueChange}\n data={options.map((opt) => ({\n value: opt.value,\n label: opt.icon ? (\n <>\n <opt.icon />\n {opt.label}\n </>\n ) : (\n opt.label\n ),\n disabled: Boolean(opt.disabled || rowProps.disabled),\n }))}\n />\n </SettingsRow>\n );\n}\n","\"use client\";\n\nimport { useId, useState } from \"react\";\nimport { CheckIcon as Check } from \"../../icons\";\nimport { SelectChevron } from \"../../select\";\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from \"../../command\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../../popover\";\nimport { cn } from \"../../cn\";\nimport { Button } from \"../../controls/controls\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"../../select\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport type {\n SettingsCommonProps,\n SettingsOption,\n SettingsControlSize,\n} from \"../types\";\n\ntype Width = \"auto\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"full\";\n\nconst widthClass: Record<Width, string> = {\n auto: \"w-full max-w-full @[40rem]/settings:w-auto @[40rem]/settings:min-w-32\",\n sm: \"w-32 max-w-full min-w-0\",\n md: \"w-44 max-w-full min-w-0\",\n lg: \"w-64 max-w-full min-w-0\",\n // The width of the ladder rows' model/voice pickers, so a screen mixing\n // both lines every control up on one edge.\n xl: \"w-80 max-w-full min-w-0\",\n full: \"w-full\",\n};\n\nconst triggerSize: Record<SettingsControlSize, \"sm\" | \"default\" | \"lg\"> = {\n sm: \"sm\",\n md: \"default\",\n lg: \"lg\",\n};\n\nconst triggerMinHeight: Record<SettingsControlSize, string> = {\n // 44px under touch or below lg — the same condition as the\n // matrx-touch-targets floor, which a min-h utility here would otherwise beat.\n sm: \"min-h-7 max-lg:min-h-11 pointer-coarse:min-h-11\",\n md: \"min-h-9 max-lg:min-h-11 pointer-coarse:min-h-11\",\n lg: \"min-h-10\",\n};\n\nexport type SettingsSelectProps<T extends string = string> =\n SettingsCommonProps & {\n value: T;\n onValueChange: (value: T) => void;\n /** Read-only: shared vocabularies (agent-writable-settings) are `as const`. */\n options: readonly SettingsOption<T>[];\n placeholder?: string;\n size?: SettingsControlSize;\n width?: Width;\n /** Renders as a stacked layout. Use when the select should span full width. */\n stacked?: boolean;\n last?: boolean;\n /** Long lists: a search box that filters by label and value (case-insensitive contains). */\n searchable?: boolean;\n searchPlaceholder?: string;\n };\n\n/** Case-insensitive contains over the label and the raw value; \"/\" and \"_\" read as spaces. */\nexport function matchesSettingsOption(\n query: string,\n option: { label: string; value: string },\n): boolean {\n const norm = (t: string) => t.toLowerCase().replace(/[_/]/g, \" \");\n const q = norm(query).trim();\n if (!q) return true;\n return norm(option.label).includes(q) || norm(option.value).includes(q);\n}\n\n/**\n * Radix Select reads a value of \"\" as \"nothing selected\" and shows a blank\n * trigger, so an option whose value IS \"\" (a \"None\" choice — e.g. voice\n * emotion) looked unset even while it was the saved choice. Every settings\n * select maps \"\" to this token on the way in and back to \"\" on the way out.\n */\nconst EMPTY_OPTION_VALUE = \"__settings-empty-option__\";\n\nexport function SettingsSelect<T extends string = string>({\n value,\n onValueChange,\n options,\n placeholder,\n size = \"md\",\n width = \"md\",\n stacked,\n last,\n searchable,\n searchPlaceholder = \"Search\",\n ...rowProps\n}: SettingsSelectProps<T>) {\n const [open, setOpen] = useState(false);\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n const variant = stacked ? \"stacked\" : \"inline\";\n const effectiveWidth: Width = stacked ? \"full\" : width;\n // Only a select that OFFERS \"\" as a choice maps it; elsewhere \"\" still\n // means \"not chosen yet\" and the placeholder shows.\n const hasEmptyOption = options.some((opt) => opt.value === \"\");\n\n return (\n <SettingsRow\n {...rowProps}\n id={id}\n variant={variant}\n controlLayout=\"wide\"\n last={last}\n >\n {searchable ? (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n type=\"button\"\n variant=\"outline\"\n id={id}\n role=\"combobox\"\n aria-expanded={open}\n iconEnd={<SelectChevron size=\"sm\" />}\n disabled={rowProps.disabled ?? false}\n className={widthClass[effectiveWidth]}\n >\n <span className=\"truncate\">\n {options.find((o) => o.value === value)?.label ??\n placeholder ??\n value}\n </span>\n </Button>\n </PopoverTrigger>\n <PopoverContent sizing=\"content\" className=\"p-0\" align=\"end\">\n <Command\n filter={(itemValue, search) => {\n const opt = options.find((o) => o.value === itemValue);\n return opt ? (matchesSettingsOption(search, opt) ? 1 : 0) : 0;\n }}\n >\n <CommandInput\n placeholder={searchPlaceholder}\n className=\"h-9 text-sm\"\n />\n <CommandList>\n <CommandEmpty>No results found.</CommandEmpty>\n <CommandGroup className=\"max-h-72 overflow-auto\">\n {options.map((opt) => (\n <CommandItem\n key={opt.value}\n value={opt.value}\n disabled={opt.disabled ?? false}\n onSelect={() => {\n onValueChange(opt.value as T);\n setOpen(false);\n }}\n >\n <Check\n className={cn(\n \"mr-2 h-3.5 w-3.5\",\n opt.value === value ? \"opacity-100\" : \"opacity-0\",\n )}\n />\n {opt.label}\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n ) : (\n <Select\n value={value === \"\" && hasEmptyOption ? EMPTY_OPTION_VALUE : value}\n onValueChange={(v) =>\n onValueChange((v === EMPTY_OPTION_VALUE ? \"\" : v) as T)\n }\n disabled={rowProps.disabled ?? false}\n >\n <SelectTrigger\n id={id}\n size={triggerSize[size]}\n className={`${widthClass[effectiveWidth]} h-auto ${triggerMinHeight[size]} whitespace-normal text-left [&>span]:line-clamp-none [&>span]:whitespace-normal`}\n >\n <SelectValue placeholder={placeholder} />\n </SelectTrigger>\n <SelectContent>\n {options.map((opt) => (\n <SelectItem\n key={opt.value}\n value={opt.value === \"\" ? EMPTY_OPTION_VALUE : opt.value}\n disabled={opt.disabled ?? false}\n // Outside ItemText via the prop — a description passed as a\n // child ends up inside the closed trigger and gets clipped.\n {...(opt.description === undefined ? {} : { description: opt.description })}\n >\n <span className=\"flex items-center gap-2\">\n {opt.icon && <opt.icon className=\"h-3.5 w-3.5\" />}\n <span>{opt.label}</span>\n </span>\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n </SettingsRow>\n );\n}\n","\"use client\";\n\n/**\n * Command — ported verbatim from matrx-frontend `components/ui/command.tsx`.\n *\n * `cmdk` is a SANCTIONED REAL DEPENDENCY (the vaul ↔ BottomSheet precedent):\n * the filtering/scoring/keyboard engine IS the component's product — there is\n * no Command palette without it, and reimplementing type-ahead ranking plus\n * roving keyboard selection would twin a maintained library rather than our\n * own code. See FEATURE.md.\n *\n * Seam inversions:\n * - `MagnifyingGlassIcon` comes from the package's inlined SVGs (C19), not\n * @radix-ui/react-icons.\n * - `CommandDialog` composed the host dialog module (`Dialog`, `DialogContent`,\n * `DialogTitle`). Those pieces are inlined privately below with identical\n * behavior — modal context, overlay, desktop card / mobile bottom-sheet\n * geometry, close control, portal — except the host's popout-aware\n * `DialogPortal` becomes the package's `PortalContainerProvider` seam\n * (plus an explicit `container` prop, which keeps top priority).\n * - The host's `useIsMobile` (a plain matchMedia breakpoint hook, not\n * host-shaped) became the package's own `./use-is-mobile`, with the same\n * 768px breakpoint. It started life inlined here; `Dialog` needed the same\n * answer, so it moved to a module both read rather than being copied.\n */\n\nimport type { DialogProps } from \"@radix-ui/react-dialog\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { keepFloatingLayersInside, useModalLayer } from \"./floating-layer\";\nimport {\n CENTERED_DIALOG,\n MOTION_BOTTOM_SHEET,\n MOTION_DIALOG,\n MOTION_OVERLAY,\n} from \"./motion\";\nimport { CloseControl, CloseRow, CloseSlotProvider, SearchRowCloseSlotProvider, useCloseSlot, useSearchRowCloseSlotClaim } from \"./close-slot\";\nimport { MagnifyingGlassIcon } from \"./icons\";\nimport { usePortalContainer } from \"./portal-container\";\nimport {\n RadixDialogModalProvider,\n useRadixDialogModal,\n} from \"./radix-dialog-modal-context\";\nimport { useIsMobile } from \"./use-is-mobile\";\n\nexport const Command = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground\",\n className,\n )}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\n/* ------------------------------------------------------------------ */\n/* Private dialog internals for CommandDialog (host dialog module, */\n/* behavior-identical, portal seam inverted). */\n/* ------------------------------------------------------------------ */\n\nconst DIALOG_DESKTOP_CLASSES =\n `fixed left-[50%] top-[50%] z-[10000] grid min-w-0 w-full max-w-lg ${CENTERED_DIALOG} gap-4 overflow-x-clip border bg-background p-6 shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full sm:rounded-lg`;\n\nconst DIALOG_MOBILE_SHEET_CLASSES =\n \"fixed inset-x-0 bottom-0 left-0 right-0 top-auto z-[10000] flex min-w-0 flex-col w-full max-w-full max-h-[90dvh] translate-x-0 translate-y-0 gap-4 overflow-x-clip border-t bg-background p-4 pb-safe shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full rounded-t-2xl rounded-b-none overflow-y-auto overscroll-contain\";\n\n// Re-asserted LAST so the sheet geometry always wins over any caller className.\nconst DIALOG_MOBILE_SHEET_OVERRIDE =\n \"inset-x-0 bottom-0 left-0 right-0 top-auto translate-x-0 translate-y-0 w-full max-w-full max-h-[90dvh] rounded-b-none rounded-t-2xl overflow-y-auto\";\n\nconst CommandDialogContent = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n container?: HTMLElement | null;\n }\n>(({ className, children, container, onInteractOutside, ...props }, ref) => {\n const isMobile = useIsMobile();\n const isModal = useRadixDialogModal();\n useModalLayer(isModal);\n const portalContainer = usePortalContainer(container);\n // The × is the last item of the search row (close-slot.tsx); a palette with\n // no CommandInput gets a close row of its own.\n const closeSlot = useCloseSlot(true);\n return (\n <DialogPrimitive.Portal container={portalContainer}>\n {isModal ? (\n <DialogPrimitive.Overlay\n className={cn(\n \"fixed inset-0 z-[10000] bg-[var(--matrx-overlay-scrim-soft)]\",\n MOTION_OVERLAY,\n )}\n />\n ) : null}\n <DialogPrimitive.Content\n ref={ref}\n aria-modal={isModal || undefined}\n aria-describedby={undefined}\n className={cn(\n isMobile ? DIALOG_MOBILE_SHEET_CLASSES : DIALOG_DESKTOP_CLASSES,\n isMobile ? MOTION_BOTTOM_SHEET : MOTION_DIALOG,\n className,\n isMobile && DIALOG_MOBILE_SHEET_OVERRIDE,\n !isModal && \"z-[900]\",\n )}\n {...props}\n onInteractOutside={keepFloatingLayersInside(onInteractOutside)}\n >\n {closeSlot.slot && !closeSlot.claimed ? <CloseRow className=\"px-4 pt-4\" /> : null}\n {/* A header inside a palette never reaches past it to an outer Dialog's slot. */}\n <CloseSlotProvider value={null}>\n <SearchRowCloseSlotProvider value={closeSlot.slot}>{children}</SearchRowCloseSlotProvider>\n </CloseSlotProvider>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n );\n});\nCommandDialogContent.displayName = \"CommandDialogContent\";\n\nexport interface CommandDialogProps extends DialogProps {\n /** Explicit portal target for the dialog; beats the injected seam. */\n container?: HTMLElement | null;\n}\n\nexport const CommandDialog = ({\n children,\n container,\n ...props\n}: CommandDialogProps) => {\n const modal = props.modal ?? true;\n return (\n <RadixDialogModalProvider modal={modal}>\n <DialogPrimitive.Root {...props} modal={modal}>\n <CommandDialogContent\n className=\"overflow-hidden p-0\"\n {...(container !== undefined ? { container } : {})}\n >\n <DialogPrimitive.Title className=\"sr-only\"></DialogPrimitive.Title>\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </CommandDialogContent>\n </DialogPrimitive.Root>\n </RadixDialogModalProvider>\n );\n};\n\nexport const CommandInput = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\n>(({ className, ...props }, ref) => {\n // Inside a CommandDialog the search row owns the × (never a combobox's input in a Dialog).\n const ownsClose = useSearchRowCloseSlotClaim();\n return (\n <div className=\"flex items-center gap-2 border-b px-3\" cmdk-input-wrapper=\"\">\n <MagnifyingGlassIcon className=\"h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"flex h-10 w-full min-w-0 rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:text-disabled-foreground\",\n className,\n )}\n {...props}\n />\n {ownsClose ? <CloseControl className=\"-mr-1\" /> : null}\n </div>\n );\n});\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\nexport const CommandList = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\"max-h-[300px] overflow-y-auto overflow-x-hidden\", className)}\n {...props}\n />\n));\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nexport const CommandEmpty = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty\n ref={ref}\n className=\"py-6 text-center text-sm\"\n {...props}\n />\n));\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nexport const CommandGroup = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground\",\n className,\n )}\n {...props}\n />\n));\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nexport const CommandSeparator = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 h-px bg-border\", className)}\n {...props}\n />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nexport const CommandItem = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:text-disabled-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n className,\n )}\n {...props}\n />\n));\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nexport const CommandShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n \"ml-auto text-xs tracking-widest text-muted-foreground\",\n className,\n )}\n {...props}\n />\n );\n};\nCommandShortcut.displayName = \"CommandShortcut\";\n","\"use client\";\n\n/**\n * THE CLOSE CONTROL LIVES IN A ROW, NEVER IN A CORNER.\n *\n * The stock shadcn dialog pins its × with `absolute right-4 top-4`: a\n * coordinate guess about how tall the content's first row will be. Every\n * content whose first row is a different height got an × floating off its\n * row — the command palette's sat 12px below its 48px search row, on the\n * divider, with the query running underneath it (Arman, 2026-10-20: \"each\n * time they use this component, we end up with a very oddly placed x\").\n * Agents re-typed that snippet from memory faster than it could be fixed.\n *\n * So the × is a flex item of the row it belongs to, centered by layout:\n *\n * - `CommandInput` inside a `CommandDialog` draws it at the end of the\n * search row.\n * - `DialogHeader` / `SheetHeader` draw it at the end of the header row and\n * CLAIM it, so the content does not draw a second one; with two headers the\n * first one mounted draws it.\n * - Content with no visible header gets a close row of its own at the top,\n * in flow — it takes space, it never covers anything.\n *\n * Guard: `close-in-flow.test.tsx` — no `*.Close` in this package or its\n * consumers carries `absolute`/`fixed`, and each surface puts the × inside\n * its row.\n */\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { XIcon } from \"./icons\";\n\n/** 44px on touch, 32px from `lg`; a flex item, never positioned. */\nconst CLOSE_CONTROL_CLASSES =\n \"flex h-11 w-11 shrink-0 items-center justify-center rounded-sm text-muted-foreground ring-offset-background transition-colors hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none lg:h-8 lg:w-8\";\n\nexport function CloseControl({ className }: { className?: string }): React.ReactElement {\n return (\n <DialogPrimitive.Close data-slot=\"dialog-close\" aria-label=\"Close\" className={cn(CLOSE_CONTROL_CLASSES, className)}>\n <XIcon className=\"h-4 w-4\" aria-hidden=\"true\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n );\n}\n\ninterface CloseSlot {\n /** A row takes the × into itself; returns the release. The FIRST live claimant owns it. */\n claim(id: string): () => void;\n /** The id that draws the ×, or null while nobody claims it. */\n owner: string | null;\n}\n\n/** Dialog and Sheet: claimed by their header. */\nconst CloseSlotContext = React.createContext<CloseSlot | null>(null);\n/**\n * CommandDialog: claimed by its search row only. A separate context so a\n * CommandInput in a combobox (Popover > Command) opened INSIDE a Dialog never\n * takes the dialog's × — context crosses portals, and that × closes the dialog.\n */\nconst SearchRowCloseSlotContext = React.createContext<CloseSlot | null>(null);\n\n/**\n * For a content surface: returns the provider value and whether a row has\n * claimed the ×. Unclaimed (no header, or only an `sr-only`/`hidden` one) the\n * content draws `<CloseRow />` first, in flow. Claims land in a layout effect,\n * so the fallback never paints when a row takes it.\n */\nexport function useCloseSlot(enabled: boolean): { slot: CloseSlot | null; claimed: boolean } {\n const [claims, setClaims] = React.useState<string[]>([]);\n const owner = claims[0] ?? null;\n const claim = React.useCallback((id: string) => {\n setClaims((list) => [...list, id]);\n return () => setClaims((list) => list.filter((c) => c !== id));\n }, []);\n const slot = React.useMemo<CloseSlot | null>(() => (enabled ? { claim, owner } : null), [enabled, claim, owner]);\n return { slot, claimed: owner !== null };\n}\n\nexport const CloseSlotProvider = CloseSlotContext.Provider;\nexport const SearchRowCloseSlotProvider = SearchRowCloseSlotContext.Provider;\n\nfunction useClaim(context: React.Context<CloseSlot | null>, declined: boolean): boolean {\n const slot = React.useContext(context);\n const id = React.useId();\n const claim = slot?.claim;\n const wants = claim !== undefined && !declined;\n // Depends on the stable `claim`, never on `owner`, so a change of owner never re-claims.\n React.useLayoutEffect(() => (wants && claim ? claim(id) : undefined), [wants, claim, id]);\n return wants && slot?.owner === id;\n}\n\n/** For a header row: claims the Dialog/Sheet slot; true when this row draws the ×. */\nexport function useCloseSlotClaim(declined = false): boolean {\n return useClaim(CloseSlotContext, declined);\n}\n\n/** For CommandInput: claims only a CommandDialog's slot; true when this row draws the ×. */\nexport function useSearchRowCloseSlotClaim(): boolean {\n return useClaim(SearchRowCloseSlotContext, false);\n}\n\n/** The fallback: a row of its own at the top of the content. */\nexport function CloseRow({ className }: { className?: string }): React.ReactElement {\n return (\n <div data-slot=\"close-row\" className={cn(\"flex justify-end\", className)}>\n <CloseControl />\n </div>\n );\n}\n\n/** Classes that lay out a header's CHILDREN; they move to the header's body. */\nconst BODY_LAYOUT = /^!?(?:[a-z0-9]+:)*(?:flex|grid|flex-(?:row|col)(?:-reverse)?|grid-(?:cols|rows|flow)-\\S+|place-\\S+|items-\\S+|justify-\\S+|content-\\S+|gap(?:-[xy])?-\\S+|space-[xy]-\\S+|text-(?:left|center|right|start|end)|flex-wrap|flex-nowrap)$/;\n/**\n * Right padding a header carried to clear the old corner ×; with the × in the\n * row it would only push the × inward, so it is dropped.\n */\nconst OLD_CLOSE_RESERVE = /^pr-(?:8|9|10|11|12|14|16)$/;\n\nfunction splitHeaderClasses(className: string | undefined): { row: string; body: string } {\n const row: string[] = [];\n const body: string[] = [];\n for (const c of (className ?? \"\").split(/\\s+/)) {\n if (!c || OLD_CLOSE_RESERVE.test(c)) continue;\n (BODY_LAYOUT.test(c) ? body : row).push(c);\n }\n return { row: row.join(\" \"), body: body.join(\" \") };\n}\n\n/**\n * A header's element. With a close slot it is a row — the caller's children\n * in a body column, the × after them; the caller's padding, border and\n * background stay on the row, the caller's child layout (`flex-row`,\n * `space-y-*`, `text-left`…) moves to the body. Without one (no ×, or the\n * header is `sr-only`) it renders exactly as `baseClassName` + `className`.\n */\nexport function HeaderWithClose({\n slotName,\n baseClassName,\n closeOffsetClassName,\n className,\n children,\n ...props\n}: React.HTMLAttributes<HTMLDivElement> & {\n slotName: string;\n baseClassName: string;\n /** Pulls the × up so its center sits on the title's first line (the title's line height is the header's to know). */\n closeOffsetClassName: string;\n}): React.ReactElement {\n // A header nobody sees declines the ×; the content's own close row draws it.\n const owns = useCloseSlotClaim(/(?:^|\\s)(?:sr-only|hidden)(?:\\s|$)/.test(className ?? \"\"));\n if (!owns) {\n return (\n <div data-slot={slotName} className={cn(baseClassName, className)} {...props}>\n {children}\n </div>\n );\n }\n const { row, body } = splitHeaderClasses(className);\n // A header laid out as a row centers the × on that row; a stacked one, on the title's first line.\n const rowish = /(?:^|\\s)(?:[a-z0-9]+:)*flex-row(?:\\s|$)/.test(body);\n return (\n <div data-slot={slotName} data-has-close=\"\" className={cn(\"flex gap-2\", rowish ? \"items-center\" : \"items-start\", row)} {...props}>\n <div data-slot={`${slotName}-body`} className={cn(\"min-w-0 flex-1\", baseClassName, body)}>\n {children}\n </div>\n <CloseControl className={cn(\"-mr-2\", !rowish && closeOffsetClassName)} />\n </div>\n );\n}\n","\"use client\";\n\n/**\n * Ported verbatim from matrx-frontend `components/ui/radix-dialog-modal-context.tsx`.\n * Shared by the Sheet and BottomSheet families (and available to hosts that\n * compose their own Radix Dialog-derived wrappers around these primitives).\n */\n\nimport * as React from \"react\";\n\n// Shared identity across independently bundled public entrypoints/loaders.\nconst CONTEXT_SLOT = Symbol.for(\"ai-matrx.design-system.dialog-modal-context\");\nconst contextRegistry = globalThis as typeof globalThis & { [CONTEXT_SLOT]?: React.Context<boolean> };\nconst RadixDialogModalContext = contextRegistry[CONTEXT_SLOT] ??= React.createContext<boolean>(true);\n\nexport interface RadixDialogModalProviderProps {\n children: React.ReactNode;\n modal: boolean;\n}\n\n/**\n * Keeps our Radix-based content wrappers aligned with the owning Root's\n * modality so ARIA semantics cannot drift from focus/pointer behavior.\n */\nexport function RadixDialogModalProvider({\n children,\n modal,\n}: RadixDialogModalProviderProps) {\n return (\n <RadixDialogModalContext.Provider value={modal}>\n {children}\n </RadixDialogModalContext.Provider>\n );\n}\n\n/** Returns whether the nearest Radix Dialog-derived root is modal. */\nexport function useRadixDialogModal(): boolean {\n return React.useContext(RadixDialogModalContext);\n}\n","/**\n * useIsMobile — the ONE breakpoint hook the package's responsive primitives\n * read (CommandDialog and Dialog both auto-render as a bottom sheet below it).\n *\n * The body lives in `@ai-matrx/kit/media-query` (chat-package independence\n * P12, 2026-10-01): the app's `hooks/use-mobile` and this package each carried\n * their own copy, and two breakpoint hooks is exactly the duplication this\n * package exists to end. Kit's reads through `useSyncExternalStore` — `false`\n * on the server and during hydration, so the desktop geometry hydrates — and\n * never throws where `matchMedia` is absent.\n */\nexport { MOBILE_BREAKPOINT, useIsMobile } from \"@ai-matrx/kit/media-query\";\n","\"use client\";\n\nimport { useId } from \"react\";\nimport { Slider } from \"../../slider\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport type { SettingsCommonProps } from \"../types\";\n\nexport type SettingsSliderProps = SettingsCommonProps & {\n value: number;\n onValueChange: (value: number) => void;\n /**\n * Fires once when the drag ends (Radix onValueCommit). Use it when each\n * write is a network/database round-trip: track the drag with local state\n * via `onValueChange`, persist here.\n */\n onValueCommit?: (value: number) => void;\n min: number;\n max: number;\n step?: number;\n /** Label shown on the low end (e.g. \"Slow\"). */\n minLabel?: string;\n /** Label shown in the middle (e.g. \"Balanced\"). */\n midLabel?: string;\n /** Label shown on the high end (e.g. \"Fast\"). */\n maxLabel?: string;\n /** Fixed decimal places for the numeric display. Defaults to 0 for ints, 2 for floats. */\n precision?: number;\n /** Optional unit string shown next to value (e.g. \"px\", \"%\"). */\n unit?: string;\n last?: boolean;\n};\n\nexport function SettingsSlider({\n value,\n onValueChange,\n onValueCommit,\n min,\n max,\n step = 1,\n minLabel,\n midLabel,\n maxLabel,\n precision,\n unit,\n last,\n ...rowProps\n}: SettingsSliderProps) {\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n const effectivePrecision =\n precision !== undefined\n ? precision\n : step >= 1 || Number.isInteger(step)\n ? 0\n : 2;\n const display = value.toFixed(effectivePrecision);\n\n return (\n <SettingsRow {...rowProps} id={id} variant=\"stacked\" last={last}>\n <div className=\"space-y-2\">\n <div className=\"flex min-w-0 items-center justify-between gap-2\">\n <span className=\"min-w-0 break-words type-secondary text-muted-foreground tabular-nums\">\n {display}\n {unit}\n </span>\n <span className=\"min-w-0 break-words text-right type-secondary text-muted-foreground tabular-nums\">\n {min} – {max}\n </span>\n </div>\n <Slider\n id={id}\n min={min}\n max={max}\n step={step}\n value={[value]}\n onValueChange={(v) => onValueChange(v[0] ?? min)}\n {...(onValueCommit ? { onValueCommit: (v: number[]) => onValueCommit(v[0] ?? min) } : {})}\n disabled={rowProps.disabled ?? false}\n />\n {(minLabel || midLabel || maxLabel) && (\n <div className=\"flex min-w-0 justify-between gap-2 type-meta text-muted-foreground\">\n <span className=\"min-w-0 break-words\">{minLabel}</span>\n <span className=\"hidden sm:inline\">{midLabel}</span>\n <span className=\"min-w-0 break-words text-right\">{maxLabel}</span>\n </div>\n )}\n </div>\n </SettingsRow>\n );\n}\n","\"use client\";\n\n/**\n * Slider — the range control (46 host import sites).\n *\n * Ported from matrx-frontend `components/ui/slider.tsx`. Two things the host\n * copy could not do, both fixed here rather than in a fork:\n *\n * 1. A 16px THUMB IS NOT A TOUCH TARGET. The stock thumb is `h-4 w-4`, well\n * under the 44px Apple HIG minimum, so a slider that worked with a mouse\n * was a coin-flip with a thumb. The visible thumb keeps its size (`size`\n * controls it), and an invisible `::after` pseudo-target expands the hit\n * area to 44px on coarse pointers without changing the layout — the same\n * trick `ResizableHandle` uses for mouse tolerance.\n *\n * 2. DENSITY IS A PROP, NOT A FORK (C18). `size=\"sm|md|lg\"` picks the track\n * height and thumb diameter together, so a dense admin panel and a\n * touch-first settings screen use ONE component.\n *\n * Multi-thumb ranges work: a `Thumb` is rendered per value, which is what\n * Radix requires and what the host copy (a single hardcoded Thumb) got wrong\n * for any `value` array longer than one.\n */\n\nimport * as SliderPrimitive from \"@radix-ui/react-slider\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nexport type SliderSize = \"sm\" | \"md\" | \"lg\";\n\nconst TRACK_CLASSES: Record<SliderSize, string> = {\n sm: \"h-1\",\n md: \"h-1.5\",\n lg: \"h-2.5\",\n};\n\nconst THUMB_CLASSES: Record<SliderSize, string> = {\n sm: \"h-3.5 w-3.5\",\n md: \"h-4 w-4\",\n lg: \"h-5 w-5\",\n};\n\nexport interface SliderProps\n extends React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root> {\n /** Track + thumb scale. Default `md`. */\n size?: SliderSize;\n}\n\nconst Slider = React.forwardRef<\n React.ComponentRef<typeof SliderPrimitive.Root>,\n SliderProps\n>(({ className, size = \"md\", ...props }, ref) => {\n // One Thumb per value — controlled `value` wins, then `defaultValue`, then\n // the single-thumb default. Radix renders nothing sensible if the count is\n // wrong, which is how the host copy silently dropped a range's upper thumb.\n const thumbCount = Math.max(\n 1,\n (props.value ?? props.defaultValue ?? [0]).length,\n );\n\n return (\n <SliderPrimitive.Root\n ref={ref}\n data-slot=\"slider\"\n className={cn(\n \"relative flex w-full touch-none select-none items-center data-[disabled]:opacity-50\",\n \"data-[orientation=vertical]:h-full data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col\",\n className,\n )}\n {...props}\n >\n <SliderPrimitive.Track\n data-slot=\"slider-track\"\n className={cn(\n \"relative w-full grow overflow-hidden rounded-full bg-primary/20\",\n TRACK_CLASSES[size],\n \"data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5\",\n )}\n >\n <SliderPrimitive.Range\n data-slot=\"slider-range\"\n className=\"absolute h-full bg-primary data-[orientation=vertical]:w-full\"\n />\n </SliderPrimitive.Track>\n {Array.from({ length: thumbCount }, (_, index) => (\n <SliderPrimitive.Thumb\n key={index}\n data-slot=\"slider-thumb\"\n // The thumb is the focusable slider: it carries the control's name (a label on the root alone leaves it unnamed).\n {...(props[\"aria-label\"] ? { \"aria-label\": props[\"aria-label\"] } : {})}\n className={cn(\n \"relative block cursor-grab rounded-full border border-primary/50 bg-background shadow transition-colors active:cursor-grabbing\",\n \"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n // Ruling 1 — invisible 44px target, coarse pointers only, so a\n // dense desktop row keeps its exact hit behavior.\n \"after:absolute after:left-1/2 after:top-1/2 after:-translate-x-1/2 after:-translate-y-1/2 after:content-['']\",\n \"pointer-coarse:after:h-11 pointer-coarse:after:w-11\",\n THUMB_CLASSES[size],\n )}\n />\n ))}\n </SliderPrimitive.Root>\n );\n});\nSlider.displayName = SliderPrimitive.Root.displayName;\n\nexport { Slider };\n","\"use client\";\n\nimport { useId } from \"react\";\nimport { Switch } from \"../../controls/controls\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport type { SettingsCommonProps } from \"../types\";\n\nexport type SettingsSwitchProps = SettingsCommonProps & {\n checked: boolean;\n onCheckedChange: (checked: boolean) => void;\n /** Controls whether the row renders a border underneath. */\n last?: boolean;\n};\n\nexport function SettingsSwitch({\n checked,\n onCheckedChange,\n last,\n ...rowProps\n}: SettingsSwitchProps) {\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n return (\n <SettingsRow {...rowProps} id={id} variant=\"inline\" last={last}>\n {/* The switch stays its painted size; its label carries the 44px\n touch ring (matrx-tap-area) so a finger can hit it on a phone. */}\n <label htmlFor={id} className=\"matrx-tap-area inline-flex\">\n <Switch\n id={id}\n checked={checked}\n onCheckedChange={onCheckedChange}\n disabled={rowProps.disabled}\n />\n </label>\n </SettingsRow>\n );\n}\n","\"use client\";\n\nimport { useId, useState } from \"react\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport { Field } from \"../../controls/controls\";\nimport type { SettingsCommonProps, SettingsControlSize } from \"../types\";\n\nconst widthClass = {\n sm: \"w-32 max-w-full min-w-0\",\n md: \"w-48 max-w-full min-w-0\",\n lg: \"w-72 max-w-full min-w-0\",\n full: \"w-full\",\n};\n\nexport type SettingsTextInputProps = SettingsCommonProps & {\n value: string;\n onValueChange: (value: string) => void;\n placeholder?: string;\n type?: \"text\" | \"email\" | \"url\" | \"password\" | \"tel\";\n inputMode?: \"text\" | \"email\" | \"url\" | \"tel\" | \"numeric\" | \"decimal\";\n /** Commit on blur/enter instead of every keystroke. Useful for expensive writes. */\n commitOnBlur?: boolean;\n maxLength?: number;\n size?: SettingsControlSize;\n width?: \"sm\" | \"md\" | \"lg\" | \"full\";\n /** Renders as a stacked layout so the input can be full-width. */\n stacked?: boolean;\n last?: boolean;\n};\n\nexport function SettingsTextInput({\n value,\n onValueChange,\n placeholder,\n type = \"text\",\n inputMode,\n commitOnBlur,\n maxLength,\n size: _size,\n width = \"md\",\n stacked,\n last,\n ...rowProps\n}: SettingsTextInputProps) {\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n\n const [draft, setDraft] = useState(value);\n const [lastCommittedValue, setLastCommittedValue] = useState(value);\n\n if (commitOnBlur && value !== lastCommittedValue) {\n setLastCommittedValue(value);\n setDraft(value);\n }\n\n const effective = commitOnBlur ? draft : value;\n const effectiveWidth = stacked ? \"full\" : width;\n\n return (\n <SettingsRow\n {...rowProps}\n id={id}\n variant={stacked ? \"stacked\" : \"inline\"}\n controlLayout=\"wide\"\n last={last}\n >\n <Field\n id={id}\n type={type}\n inputMode={inputMode}\n value={effective}\n placeholder={placeholder}\n maxLength={maxLength}\n disabled={rowProps.disabled}\n onChange={(e) => {\n if (commitOnBlur) setDraft(e.target.value);\n else onValueChange(e.target.value);\n }}\n onBlur={() => {\n if (commitOnBlur && draft !== value) {\n onValueChange(draft);\n }\n }}\n onKeyDown={(e) => {\n if (commitOnBlur && e.key === \"Enter\")\n (e.currentTarget as HTMLInputElement).blur();\n }}\n className={widthClass[effectiveWidth]}\n />\n </SettingsRow>\n );\n}\n","import type { SettingsIconType as LucideIcon } from \"../icon-type\";\nimport type { SettingsBadge } from \"../types\";\n\n/**\n * A node in the settings hierarchy.\n * - Has children: renders as a category (expandable on desktop, push-nav on mobile)\n * - No children: renders as a leaf (clicking activates the tab)\n */\nexport type SettingsTreeNode = {\n id: string;\n label: string;\n icon?: LucideIcon | undefined;\n /** Short summary shown under the label in mobile drawer and tree hover. */\n description?: string | undefined;\n /** When provided, the node is a category with sub-nodes. */\n children?: SettingsTreeNode[] | undefined;\n /** The folder itself has a page in addition to its children. */\n navigable?: boolean | undefined;\n navigationLabel?: string | undefined;\n /** Inline badge: built-in variants from SettingsBadge, or the special \"unsaved\" string for a dot indicator. */\n badge?: SettingsBadge | \"unsaved\" | undefined;\n /** Disabled leaves/categories can't be activated/expanded. */\n disabled?: boolean | undefined;\n /** Free-text keywords searched alongside label/description. */\n searchKeywords?: string[] | undefined;\n};\n\n/** Flatten the tree into every destination, including folders with their own page. */\nexport function flattenLeaves(nodes: SettingsTreeNode[]): SettingsTreeNode[] {\n const out: SettingsTreeNode[] = [];\n const walk = (arr: SettingsTreeNode[]) => {\n for (const n of arr) {\n if (n.navigable || !n.children?.length) out.push(n);\n if (n.children?.length) walk(n.children);\n }\n };\n walk(nodes);\n return out;\n}\n\n/** Returns the ancestor id path for a target node id (excluding the target itself). */\nexport function findAncestorPath(\n nodes: SettingsTreeNode[],\n targetId: string,\n): string[] {\n const path: string[] = [];\n const visit = (arr: SettingsTreeNode[], trail: string[]): boolean => {\n for (const n of arr) {\n if (n.id === targetId) {\n path.push(...trail);\n return true;\n }\n if (n.children && visit(n.children, [...trail, n.id])) return true;\n }\n return false;\n };\n visit(nodes, []);\n return path;\n}\n\n/**\n * Build the mobile drawer stack for an externally selected setting.\n *\n * Deep links activate a leaf before the drawer mounts. The drawer must start\n * on that leaf, including every ancestor screen, rather than discarding the\n * active id and showing its root list.\n */\nexport function getDrawerPathForActiveId(\n nodes: SettingsTreeNode[],\n activeId: string | null,\n): string[] {\n if (!activeId || !findNodeById(nodes, activeId)) return [];\n return [...findAncestorPath(nodes, activeId), activeId];\n}\n\n/** Find a single node by id anywhere in the tree. */\nexport function findNodeById(\n nodes: SettingsTreeNode[],\n id: string,\n): SettingsTreeNode | null {\n for (const n of nodes) {\n if (n.id === id) return n;\n if (n.children) {\n const found = findNodeById(n.children, id);\n if (found) return found;\n }\n }\n return null;\n}\n\n/**\n * Returns an array of [id, matchScore] pairs ranked by relevance.\n * Matches label (highest), keywords, description. Case-insensitive.\n */\nexport function searchTree(\n nodes: SettingsTreeNode[],\n query: string,\n): Set<string> {\n const matches = new Set<string>();\n const q = query.trim().toLowerCase();\n if (!q) return matches;\n const walk = (arr: SettingsTreeNode[]) => {\n for (const n of arr) {\n const haystack = [\n n.label,\n n.description ?? \"\",\n ...(n.searchKeywords ?? []),\n ]\n .join(\" \")\n .toLowerCase();\n if (haystack.includes(q)) matches.add(n.id);\n if (n.children) walk(n.children);\n }\n };\n walk(nodes);\n return matches;\n}\n\n/**\n * Given a set of matching node ids, returns a set of every id that should be\n * visible — matching ids plus all their ancestors — so that the tree can keep\n * path structure when filtering.\n */\nexport function withAncestors(\n nodes: SettingsTreeNode[],\n ids: Set<string>,\n): Set<string> {\n const visible = new Set(ids);\n for (const id of ids) {\n for (const anc of findAncestorPath(nodes, id)) visible.add(anc);\n }\n return visible;\n}\n","\"use client\";\n\nimport { Loader2Icon as Loader2 } from \"../../icons\";\n\n/** lucide `slash` — the breadcrumb separator. */\nfunction Slash({ className }: { className?: string }) {\n return (\n <svg aria-hidden xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={2} strokeLinecap=\"round\" strokeLinejoin=\"round\" className={className}>\n <path d=\"M22 2 2 22\" />\n </svg>\n );\n}\nimport { type SettingsTreeNode, findAncestorPath, findNodeById } from \"./types\";\n\nimport { Button } from \"../../controls/controls\";\ntype SettingsBreadcrumbProps = {\n nodes: SettingsTreeNode[];\n activeId: string | null;\n /** Root label shown as the first crumb. */\n rootLabel?: string;\n /** Click handler for crumbs — usually navigates via the registry. */\n onNavigate?: (id: string | null) => void;\n /** Disables duplicate navigation and announces the active route change. */\n navigationPending?: boolean;\n};\n\n/**\n * Renders a compact breadcrumb trail for the active settings path:\n * \"Settings / Appearance / Theme\"\n */\nexport function SettingsBreadcrumb({\n nodes,\n activeId,\n rootLabel = \"Settings\",\n onNavigate,\n navigationPending = false,\n}: SettingsBreadcrumbProps) {\n const ancestors = activeId ? findAncestorPath(nodes, activeId) : [];\n const active = activeId ? findNodeById(nodes, activeId) : null;\n\n return (\n <nav\n aria-label=\"Breadcrumb\"\n aria-busy={navigationPending}\n className=\"flex min-w-0 items-center gap-1 overflow-x-auto type-secondary text-muted-foreground\"\n >\n <Crumb\n label={rootLabel}\n onClick={onNavigate ? () => onNavigate(null) : undefined}\n interactive\n disabled={navigationPending}\n />\n {ancestors.map((id) => {\n const node = findNodeById(nodes, id);\n if (!node) return null;\n return (\n <span key={id} className=\"flex min-w-0 items-center gap-1\">\n <Slash className=\"h-3 w-3 text-muted-foreground\" />\n <Crumb\n label={node.label}\n onClick={onNavigate ? () => onNavigate(id) : undefined}\n interactive\n disabled={navigationPending}\n />\n </span>\n );\n })}\n {active && (\n <span className=\"flex min-w-0 items-center gap-1\">\n <Slash className=\"h-3 w-3 text-muted-foreground\" />\n <span className=\"truncate font-medium text-foreground\">\n {active.label}\n </span>\n </span>\n )}\n {navigationPending ? (\n <Loader2\n className=\"ml-1 h-3.5 w-3.5 shrink-0 animate-spin\"\n aria-label=\"Opening settings section\"\n />\n ) : null}\n </nav>\n );\n}\n\nfunction Crumb({\n label,\n onClick,\n interactive,\n disabled,\n}: {\n label: string;\n onClick?: (() => void) | undefined;\n interactive?: boolean | undefined;\n disabled?: boolean | undefined;\n}) {\n if (interactive && onClick) {\n return (\n <Button variant=\"quiet\" onClick={onClick} disabled={disabled}>{label}</Button>\n );\n }\n return <span>{label}</span>;\n}\n","\"use client\";\n\nimport { useState, useMemo } from \"react\";\nimport { ChevronLeftIcon as ChevronLeft, ChevronRightIcon as ChevronRight, SettingsIcon as SettingsIcon, XIcon as X } from \"../../icons\";\nimport { Drawer, DrawerContent, DrawerTitle } from \"../../drawer\";\nimport { Button, SearchField } from \"../../controls/controls\";\nimport { Tile } from \"../../controls/surfaces\";\nimport {\n type SettingsTreeNode,\n findNodeById,\n getDrawerPathForActiveId,\n searchTree,\n flattenLeaves,\n} from \"./types\";\n\ntype SettingsDrawerNavProps = {\n nodes: SettingsTreeNode[];\n activeId: string | null;\n onActivate: (id: string) => void;\n /** Render the tab body for the active leaf node. */\n renderTab: (node: SettingsTreeNode) => React.ReactNode;\n open: boolean;\n onOpenChange: (open: boolean) => void;\n /** Title shown on the root screen header. */\n title?: string;\n unsavedIds?: Set<string> | undefined;\n};\n\n/**\n * iOS-style hierarchical push-nav inside a bottom drawer.\n *\n * Three screens:\n * 1. Root category/leaf list\n * 2. Sub-category list (slides in from right when category tapped)\n * 3. Leaf tab content (slides in from right when leaf tapped)\n *\n * Back button pops the stack. Closing the drawer resets the stack.\n */\nexport function SettingsDrawerNav({\n nodes,\n activeId,\n onActivate,\n renderTab,\n open,\n onOpenChange,\n title = \"Settings\",\n unsavedIds,\n}: SettingsDrawerNavProps) {\n // Path: list of node ids representing the current navigation stack.\n // - [] = root list\n // - [catId] = sub-list of catId (which must be a folder)\n // - [..., leafId] = leaf content (last is leaf)\n const [path, setPath] = useState<string[]>(() =>\n getDrawerPathForActiveId(nodes, activeId),\n );\n const [folderTabId, setFolderTabId] = useState<string | null>(() =>\n activeId && findNodeById(nodes, activeId)?.navigable ? activeId : null,\n );\n const [query, setQuery] = useState(\"\");\n\n const handleOpenChange = (next: boolean) => {\n if (!next) {\n setPath([]);\n setFolderTabId(null);\n setQuery(\"\");\n }\n onOpenChange(next);\n };\n\n const pushId = (id: string) => setPath((p) => [...p, id]);\n const popOne = () => {\n if (folderTabId) setFolderTabId(null);\n else setPath((p) => p.slice(0, -1));\n };\n\n const currentId = path[path.length - 1] ?? null;\n const currentNode = currentId ? findNodeById(nodes, currentId) : null;\n const isLeaf = Boolean(\n currentNode && (!currentNode.children?.length || folderTabId === currentId),\n );\n\n // The list-of-nodes shown in the current screen (root or category)\n const listNodes = useMemo<SettingsTreeNode[]>(() => {\n if (!currentNode || isLeaf) return nodes;\n return currentNode.children ?? [];\n }, [currentNode, isLeaf, nodes]);\n\n // Search only applies at the root screen for simplicity — gives a flat result\n const searchMatches = useMemo(() => {\n if (!query.trim()) return null;\n const matched = searchTree(nodes, query);\n return flattenLeaves(nodes).filter((l) => matched.has(l.id));\n }, [nodes, query]);\n\n const handleItemTap = (node: SettingsTreeNode) => {\n if (node.disabled) return;\n if (node.children && node.children.length > 0) {\n pushId(node.id);\n setQuery(\"\");\n } else {\n onActivate(node.id);\n pushId(node.id);\n setQuery(\"\");\n }\n };\n\n const headerTitle = isLeaf\n ? currentNode?.label\n : currentNode\n ? currentNode.label\n : title;\n const backLabel = folderTabId\n ? (currentNode?.label ?? title)\n : path.length > 1\n ? (findNodeById(nodes, path[path.length - 2] ?? \"\")?.label ?? title)\n : title;\n\n return (\n <Drawer open={open} onOpenChange={handleOpenChange}>\n <DrawerContent className=\"h-[85dvh] flex flex-col\">\n <DrawerTitle className=\"sr-only\">{title}</DrawerTitle>\n\n {/* Header */}\n <div className=\"flex items-center justify-between gap-2 px-3 py-2.5 border-b border-border shrink-0\">\n {path.length === 0 ? (\n <div className=\"flex items-center gap-2 min-w-0\">\n <SettingsIcon className=\"h-4 w-4 text-muted-foreground shrink-0\" />\n <span className=\"type-title truncate\">{title}</span>\n </div>\n ) : (\n <Button\n type=\"button\"\n variant=\"quiet\"\n icon={<ChevronLeft className=\"h-4 w-4\" />}\n onClick={popOne}\n className=\"min-w-0 max-w-[calc(100%-5rem)] -ml-2\"\n >\n {backLabel}\n </Button>\n )}\n <div className=\"flex-1 flex items-center justify-center min-w-0 px-2\">\n {path.length > 0 && (\n <span className=\"type-title truncate\">\n {headerTitle}\n </span>\n )}\n </div>\n <Button\n type=\"button\"\n variant=\"quiet\"\n aria-label=\"Close\"\n icon={<X className=\"h-4 w-4\" />}\n onClick={() => handleOpenChange(false)}\n />\n </div>\n\n {/* Screen stack: only the current screen is rendered, with slide animation */}\n <div className=\"flex-1 min-h-0 overflow-hidden relative\">\n <div\n key={path.join(\"/\") || \"root\"}\n className=\"absolute inset-0 overflow-y-auto overscroll-contain\"\n style={path.length > 0 ? { animation: \"drawerPush 180ms cubic-bezier(0.4, 0, 0.2, 1) both\" } : undefined}\n >\n {isLeaf && currentNode ? (\n <div className=\"pb-safe\">{renderTab(currentNode)}</div>\n ) : (\n <>\n {/* Search bar only on the root screen */}\n {path.length === 0 && (\n <div className=\"relative px-3 py-2 border-b border-border sticky top-0 bg-background z-10\">\n <SearchField\n placeholder=\"Search settings\"\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n end={query ? <span aria-hidden=\"true\" className=\"w-7 shrink-0\" /> : undefined}\n className=\"w-full\"\n />\n {query && (\n <Button\n type=\"button\"\n variant=\"quiet\"\n aria-label=\"Clear search\"\n icon={<X className=\"h-4 w-4\" />}\n onClick={() => setQuery(\"\")}\n className=\"absolute right-5 top-1/2 -translate-y-1/2\"\n />\n )}\n </div>\n )}\n\n {searchMatches ? (\n <div className=\"pb-safe\">\n {searchMatches.length === 0 ? (\n <div className=\"px-4 py-8 text-center type-body text-muted-foreground\">\n No settings match \"{query}\".\n </div>\n ) : (\n searchMatches.map((n) => (\n <DrawerRow\n key={n.id}\n node={n}\n activeId={activeId}\n hasChevron\n onTap={handleItemTap}\n unsavedIds={unsavedIds}\n />\n ))\n )}\n </div>\n ) : (\n <div className=\"pb-safe\">\n {currentNode?.navigable ? (\n <DrawerRow\n node={{\n ...currentNode,\n label:\n currentNode.navigationLabel ?? currentNode.label,\n children: undefined,\n }}\n activeId={activeId}\n hasChevron\n onTap={() => {\n onActivate(currentNode.id);\n setFolderTabId(currentNode.id);\n }}\n unsavedIds={unsavedIds}\n />\n ) : null}\n {listNodes.map((n) => (\n <DrawerRow\n key={n.id}\n node={n}\n activeId={activeId}\n hasChevron\n onTap={handleItemTap}\n unsavedIds={unsavedIds}\n />\n ))}\n </div>\n )}\n </>\n )}\n </div>\n </div>\n\n <style>{`\n @keyframes drawerPush {\n from {\n transform: translateX(24%);\n opacity: 0;\n }\n to {\n transform: translateX(0%);\n opacity: 1;\n }\n }\n `}</style>\n </DrawerContent>\n </Drawer>\n );\n}\n\ntype DrawerRowProps = {\n node: SettingsTreeNode;\n activeId: string | null;\n hasChevron: boolean;\n onTap: (node: SettingsTreeNode) => void;\n unsavedIds?: Set<string> | undefined;\n};\n\nfunction DrawerRow({\n node,\n activeId,\n hasChevron,\n onTap,\n unsavedIds,\n}: DrawerRowProps) {\n const isActive = node.id === activeId;\n const hasUnsaved = unsavedIds?.has(node.id) ?? node.badge === \"unsaved\";\n\n return (\n <Tile\n type=\"button\"\n onClick={() => onTap(node)}\n disabled={node.disabled}\n variant=\"quiet\"\n selected={isActive}\n className=\"w-full\"\n icon={node.icon ? <node.icon className=\"h-4 w-4\" /> : undefined}\n title={<span className=\"flex items-center gap-1.5\">{node.label}{hasUnsaved ? <span aria-label=\"Unsaved changes\" className=\"h-1.5 w-1.5 rounded-full bg-primary shrink-0\" /> : null}</span>}\n line={node.description}\n end={hasChevron ? <ChevronRight className=\"h-4 w-4 text-muted-foreground shrink-0\" /> : undefined}\n />\n );\n}\n","\"use client\";\n\n/**\n * Drawer — the vaul drawer family, and the package's iOS-mobile-first surface.\n *\n * WHY IT IS HERE. matrx-frontend's `components/ui/drawer.tsx` had 121 import\n * sites, and that host's own doctrine is \"Drawer, not Dialog, on mobile\" — so\n * the drawer is the surface most of this platform's mobile UX lands on. It was\n * also the LAST place still holding a copy of `RadixDialogModalProvider`, the\n * context this package already owned: a host copy of a React CONTEXT is the\n * quiet twin, because `useContext` matches by object identity, so the host\n * Drawer's provider and the package Sheet's consumer were two different\n * contexts that merely looked alike. Shipping the Drawer here closes that.\n *\n * `BottomSheet` (this package) previously inlined its own private vaul\n * wrappers because no Drawer existed to share; it now composes these, so there\n * is one vaul wrapper in the package rather than two.\n *\n * THE MOBILE-FIRST RULES THIS COMPONENT OWNS (so no host re-derives them):\n *\n * 1. `dvh`, NEVER `vh`. iOS Safari's `vh` is the tallest-possible viewport, so\n * a `vh`-capped drawer hides its own footer behind the browser chrome. The\n * cap is `max-h-[90dvh]`, and `size=\"full\"` is `h-dvh`.\n * 2. THE SAFE AREA IS PADDING, NOT A GUESS. Content bottom padding is\n * `pb-safe` (`env(safe-area-inset-bottom)`; shipped in `styles.css`), so the\n * home indicator never sits on top of the last control.\n * 3. THE GRAB HANDLE IS A 44px TARGET. The visible pill is 4px tall; it lives\n * inside a `min-h-11` (44px) grab area, the Apple HIG minimum. The old host\n * copy shipped the pill alone, so the affordance was three times smaller\n * than the gesture it advertises.\n * 4. THE BODY SCROLLS, THE FOOTER DOES NOT. `DrawerBody` is the\n * `flex-1 min-h-0 overflow-y-auto overscroll-contain` shard;\n * `DrawerFooter` is `mt-auto` and safe-area padded, so the primary action\n * is reachable however long the body is.\n * 5. A FIELD UNDER 16px ZOOMS iOS IN AND NEVER BACK OUT — the drawer's own\n * text scale therefore never goes below `text-base` on coarse pointers;\n * the floor itself is a host CSS concern, restated in `styles.css`.\n *\n * `direction` is forwarded to vaul and drives the content geometry, so a side\n * or top drawer is a prop rather than a fork.\n */\n\nimport { treeContainsComponent } from \"@ai-matrx/kit/react-tree\";\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\n\nimport { cn } from \"./cn\";\nimport { keepFloatingLayersInside, useModalLayer } from \"./floating-layer\";\nimport { RadixDialogModalProvider } from \"./radix-dialog-modal-context\";\n\nexport type DrawerDirection = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nconst DrawerDirectionContext = React.createContext<DrawerDirection>(\"bottom\");\n\n/** The direction of the nearest Drawer root. */\nexport const useDrawerDirection = (): DrawerDirection =>\n React.useContext(DrawerDirectionContext);\n\n/**\n * `vaul`'s Root props are a DISCRIMINATED UNION (the snap-point branch adds\n * `fadeFromIndex`), so this type intersects the union rather than `Omit`-ing\n * from it — flattening the union collapses the discriminant and makes every\n * snap-point drawer a type error.\n *\n * Vaul does not forward `modal={false}` to its underlying Radix root, so a\n * \"non-modal\" drawer would claim ARIA semantics it does not have; the type\n * refuses the value rather than shipping the lie.\n */\nexport type DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root> & {\n modal?: true;\n direction?: DrawerDirection;\n};\n\nconst Drawer = ({\n children,\n shouldScaleBackground = true,\n onOpenChange,\n ...props\n}: DrawerProps) => {\n const direction: DrawerDirection = props.direction ?? \"bottom\";\n const handleOpenChange = (open: boolean) => {\n if (\n open &&\n typeof document !== \"undefined\" &&\n document.activeElement instanceof HTMLElement\n ) {\n // Vaul applies aria-hidden to the application tree synchronously, before\n // Radix transfers focus into the portalled dialog. Release the trigger\n // first so a focused descendant is never hidden from assistive tech.\n document.activeElement.blur();\n }\n onOpenChange?.(open);\n };\n return (\n <RadixDialogModalProvider modal>\n <DrawerDirectionContext.Provider value={direction}>\n <DrawerPrimitive.Root\n modal\n shouldScaleBackground={shouldScaleBackground}\n {...props}\n onOpenChange={handleOpenChange}\n direction={direction}\n >\n {children}\n </DrawerPrimitive.Root>\n </DrawerDirectionContext.Provider>\n </RadixDialogModalProvider>\n );\n};\nDrawer.displayName = \"Drawer\";\n\nconst DrawerTrigger = DrawerPrimitive.Trigger;\nconst DrawerPortal = DrawerPrimitive.Portal;\nconst DrawerClose = DrawerPrimitive.Close;\n\nconst DrawerOverlay = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Overlay\n ref={ref}\n data-slot=\"drawer-overlay\"\n className={cn(\n \"fixed inset-0 z-[10000] bg-[var(--matrx-overlay-scrim)]\",\n className,\n )}\n {...props}\n />\n));\nDrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;\n\nconst DrawerDescription = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Description\n ref={ref}\n data-slot=\"drawer-description\"\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n/**\n * Unstyled, non-portalling Content for custom Drawer layouts. It derives\n * explicit modal semantics while vaul retains focus/background behavior.\n */\nconst DrawerContentPrimitive = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>\n>(({ onInteractOutside, ...props }, ref) => {\n // A drawer is always modal: floating layers opened from it stack above its\n // scrim, and a press inside one is not an outside press (floating-layer.tsx).\n useModalLayer(true);\n return (\n <DrawerPrimitive.Content\n // NO SLIDE-IN (styles.css, `[data-matrx-entrance=\"none\"]`). Measured on\n // a 375x812 phone (PB-08, 2026-10-01): for ~250 ms after open the spot\n // where a row settles was still the SCRIM, so a tap there was an outside\n // press and closed the sheet; for the next ~150 ms it was a DIFFERENT\n // row. The sheet is therefore at rest from its first frame; the scrim\n // still fades and the exit still slides. Same class as the composer\n // menu's popper entrance (matrx-frontend 286ef577fb).\n data-matrx-entrance=\"none\"\n {...props}\n ref={ref}\n aria-modal=\"true\"\n onInteractOutside={keepFloatingLayersInside(onInteractOutside)}\n />\n );\n});\nDrawerContentPrimitive.displayName = \"DrawerContentPrimitive\";\n\n/**\n * `adaptive` (default) sizes to content up to 90dvh — right for one short\n * list. `full` is ONE fixed height that never changes as content changes: use\n * it for any drawer whose body varies (tabs, search results, multi-level\n * navigation), because an adaptive drawer there resizes under the user's thumb\n * on every keystroke, which reads as the panel jumping.\n */\nexport type DrawerSize = \"adaptive\" | \"full\";\n\nconst DIRECTION_CLASSES: Record<DrawerDirection, string> = {\n bottom:\n \"inset-x-0 bottom-0 mt-24 flex-col rounded-t-[10px] border-t pb-safe\",\n top: \"inset-x-0 top-0 mb-24 flex-col rounded-b-[10px] border-b pt-safe\",\n left: \"inset-y-0 left-0 mr-24 flex-row rounded-r-[10px] border-r\",\n right: \"inset-y-0 right-0 ml-24 flex-row rounded-l-[10px] border-l\",\n};\n\nconst SIZE_CLASSES: Record<DrawerDirection, Record<DrawerSize, string>> = {\n bottom: { adaptive: \"h-auto max-h-[90dvh]\", full: \"h-[92dvh]\" },\n top: { adaptive: \"h-auto max-h-[90dvh]\", full: \"h-[92dvh]\" },\n left: { adaptive: \"w-auto max-w-[92vw]\", full: \"h-dvh w-[92vw] max-w-sm\" },\n right: { adaptive: \"w-auto max-w-[92vw]\", full: \"h-dvh w-[92vw] max-w-sm\" },\n};\n\nexport interface DrawerContentProps\n extends React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content> {\n /** Height/width posture. Default `adaptive`. */\n size?: DrawerSize;\n /** Render the drag-handle pill. Default: only for `top`/`bottom` drawers. */\n showHandle?: boolean;\n}\n\nconst DrawerContent = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Content>,\n DrawerContentProps\n>(({ className, children, size = \"adaptive\", showHandle, ...props }, ref) => {\n const direction = useDrawerDirection();\n const hasDescription =\n treeContainsComponent(children, DrawerDescription) ||\n treeContainsComponent(children, DrawerPrimitive.Description);\n const withHandle =\n showHandle ?? (direction === \"bottom\" || direction === \"top\");\n\n return (\n <DrawerPortal>\n <DrawerOverlay />\n <DrawerContentPrimitive\n ref={ref}\n data-slot=\"drawer-content\"\n data-direction={direction}\n className={cn(\n \"fixed z-[10000] flex min-w-0 border bg-background\",\n DIRECTION_CLASSES[direction],\n SIZE_CLASSES[direction][size],\n className,\n )}\n {...(hasDescription ? {} : { \"aria-describedby\": undefined })}\n {...props}\n >\n {withHandle ? (\n // Rule 3: the pill is 4px; the TARGET is 44px.\n <div\n aria-hidden\n data-slot=\"drawer-handle\"\n className={cn(\n \"flex min-h-11 w-full shrink-0 cursor-grab items-center justify-center active:cursor-grabbing\",\n direction === \"top\" && \"order-last\",\n )}\n >\n <div className=\"h-1 w-[100px] rounded-full bg-muted\" />\n </div>\n ) : null}\n {children}\n </DrawerContentPrimitive>\n </DrawerPortal>\n );\n});\nDrawerContent.displayName = \"DrawerContent\";\n\nconst DrawerHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n \"grid shrink-0 gap-1.5 p-4 text-center sm:text-left\",\n className,\n )}\n {...props}\n />\n);\nDrawerHeader.displayName = \"DrawerHeader\";\n\n/**\n * The scroll shard. `flex-1 min-h-0` is the pair that actually bounds a scroll\n * area inside a flex column — `flex-1` alone leaves `min-height: auto`, and the\n * body grows past the drawer instead of scrolling inside it.\n */\nconst DrawerBody = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n data-slot=\"drawer-body\"\n className={cn(\"min-h-0 flex-1 overflow-y-auto overscroll-contain px-4\", className)}\n {...props}\n />\n);\nDrawerBody.displayName = \"DrawerBody\";\n\nconst DrawerFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n data-slot=\"drawer-footer\"\n className={cn(\"mt-auto flex shrink-0 flex-col gap-2 p-4 pb-safe\", className)}\n {...props}\n />\n);\nDrawerFooter.displayName = \"DrawerFooter\";\n\nconst DrawerTitle = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n data-slot=\"drawer-title\"\n className={cn(\n \"text-lg font-semibold leading-none tracking-tight\",\n className,\n )}\n {...props}\n />\n));\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\nexport {\n Drawer,\n DrawerBody,\n DrawerClose,\n DrawerContent,\n DrawerContentPrimitive,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerOverlay,\n DrawerPortal,\n DrawerTitle,\n DrawerTrigger,\n};\n","\"use client\";\n\nimport { useEffect, useRef, useState, type ReactNode } from \"react\";\nimport {\n filterSettingsNavigationSections,\n SettingsFlatNavigation,\n SettingsNavigationSearch,\n settingsNavigationSections,\n} from \"../navigation/SettingsFlatNavigation\";\nimport { Tile } from \"../../controls/surfaces\";\nimport type { SettingsTreeNode } from \"./types\";\n\ntype SettingsTreeProps = {\n nodes: SettingsTreeNode[];\n activeId: string | null;\n onActivate: (id: string) => void;\n unsavedIds?: Set<string>;\n searchable?: boolean;\n query?: string;\n onQueryChange?: (query: string) => void;\n searchResults?: ReactNode;\n hasSearchResults?: boolean;\n};\n\n/**\n * The overlay's settings navigation shares the route menu's flat section model.\n * Folder state is deliberately absent: headings provide orientation and every\n * available setting remains reachable without an accordion interaction.\n */\nexport function SettingsTree({\n nodes,\n activeId,\n onActivate,\n unsavedIds,\n searchable = true,\n query: controlledQuery,\n onQueryChange,\n searchResults,\n hasSearchResults = false,\n}: SettingsTreeProps) {\n const [internalQuery, setInternalQuery] = useState(\"\");\n const query = controlledQuery ?? internalQuery;\n const setQuery = onQueryChange ?? setInternalQuery;\n const searchRef = useRef<HTMLInputElement | null>(null);\n const treeRef = useRef<HTMLDivElement | null>(null);\n const sections = filterSettingsNavigationSections(settingsNavigationSections(nodes), query);\n\n useEffect(() => {\n const element = treeRef.current;\n if (!element) return undefined;\n const onKey = (event: KeyboardEvent) => {\n if (event.key === \"/\" && document.activeElement !== searchRef.current) {\n event.preventDefault();\n searchRef.current?.focus();\n }\n };\n element.addEventListener(\"keydown\", onKey);\n return () => element.removeEventListener(\"keydown\", onKey);\n }, []);\n\n return (\n <div ref={treeRef} className=\"flex h-full flex-col border-r border-border bg-card/20\" aria-label=\"Settings navigation\">\n {searchable ? <div className=\"shrink-0 border-b border-border px-2 py-2\"><SettingsNavigationSearch value={query} onValueChange={setQuery} inputRef={searchRef} /></div> : null}\n <div className=\"flex-1 overflow-y-auto py-1\">\n {searchResults}\n {sections.length > 0 ? <SettingsFlatNavigation\n sections={sections}\n activeId={activeId}\n renderItem={(item, active) => {\n const unsaved = unsavedIds?.has(item.id) ?? item.node.badge === \"unsaved\";\n return <Tile id={`settings-nav-${item.id}`} type=\"button\" disabled={item.node.disabled} onClick={() => !item.node.disabled && onActivate(item.id)} dense variant=\"quiet\" selected={active} className=\"w-full\" icon={item.node.icon ? <item.node.icon className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" /> : undefined} title={item.label} end={unsaved ? <span aria-label=\"Unsaved changes\" className=\"h-1.5 w-1.5 shrink-0 rounded-full bg-primary\" /> : undefined} aria-current={active ? \"page\" : undefined} />;\n }}\n /> : !hasSearchResults ? <p className=\"px-3 py-6 type-body text-muted-foreground\">{query ? `No settings match \"${query}\".` : \"No settings available.\"}</p> : null}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC0BA,yBAA2B;;;ACX3B,YAAuB;;;ACRvB,IAAM,YAAY,oBAAI,IAAY;AAG3B,SAAS,gBAAgB,KAAa,SAAuB;AAClE,MAAI,UAAU,IAAI,GAAG,EAAG;AACxB,YAAU,IAAI,GAAG;AACjB,UAAQ,KAAK,mBAAmB,OAAO,EAAE;AAC3C;AAQO,IAAM,eAAe;;;ACgB5B,IAAM,YAAY,uBAAO,IAAI,qCAAqC;AAwB3D,SAAS,4BAA2D;AACzE,SAAQ,WAAkC,SAAS,KAAK;AAC1D;;;AF/BW;AARJ,IAAM,WAAiB,iBAA6C,SAASA,UAClF,EAAE,MAAM,UAAU,GAAG,KAAK,GAC1B,KACA;AACA,QAAM,aAAa,0BAA0B;AAG7C,MAAI,YAAY;AACd,WAAO,4CAAC,cAA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AK,EAAE,IAAI,MAAK,UAAS,UAAU,KAAK,KAAK,UAAU,SAAS,MAAM,CAAC,KAAK,KAAK,YAAY,WAAW,KAAK,EAAE,GAAG,OAAK,MAAC,SAAQ,SAAQ,UAAU,QAAQ,WAAU,UAAS,MAAM,KAAK,KAAK,OAAO,8CAAC,KAAK,KAAK,MAAV,EAAe,WAAU,8CAA6C,IAAK,QAAW,OAAO,KAAK,OAAO,KAAK,UAAU,8CAAC,UAAK,cAAW,mBAAkB,WAAU,gDAA+C,IAAK,QAAW,gBAAc,SAAS,SAAS,QAAW;AAAA,UACvf;AAAA;AAAA,MACF,IAAK,CAAC,mBAAmB,8CAAC,OAAE,WAAU,6CAA6C,kBAAQ,sBAAsB,KAAK,OAAO,0BAAyB,IAAO;AAAA,OAC/J;AAAA,KACF;AAEJ;","names":["HostLink","import_jsx_runtime","Anchor","import_jsx_runtime","import_jsx_runtime","import_react_slot","React","React","import_jsx_runtime","import_react_slot","React","import_jsx_runtime","React","import_jsx_runtime","import_react_slot","React","import_class_variance_authority","React","import_jsx_runtime","React","React","import_jsx_runtime","import_jsx_runtime","Button","Textarea","import_jsx_runtime","Button","import_jsx_runtime","Icon","import_jsx_runtime","import_react","import_react","import_jsx_runtime","import_react","import_react","React","import_jsx_runtime","import_react","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","tooltipSide","TapTargetButton","TapTargetButtonTransparent","TapTargetButtonOutline","TapTargetButtonSolid","TapTargetButtonDestructive","TapTargetButtonForGroup","import_react","import_jsx_runtime","SLOT","import_jsx_runtime","Wrap","import_jsx_runtime","Icon","Button","import_jsx_runtime","Icon","import_jsx_runtime","import_react","import_jsx_runtime","Button","import_react","import_jsx_runtime","Icon","import_jsx_runtime","Icon","import_jsx_runtime","Button","import_react","import_jsx_runtime","Button","import_react","React","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime","Button","import_react","import_jsx_runtime","import_react","import_jsx_runtime","Button","import_react","import_jsx_runtime","Icon","import_react","React","import_jsx_runtime","Popover","import_jsx_runtime","Button","Popover","import_react","import_jsx_runtime","widthClass","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","DialogPrimitive","React","React","import_jsx_runtime","React","import_jsx_runtime","CONTEXT_SLOT","contextRegistry","import_jsx_runtime","CommandPrimitive","CommandPrimitive","import_jsx_runtime","widthClass","Popover","Button","import_react","React","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","widthClass","visible","import_jsx_runtime","Button","import_react","React","import_jsx_runtime","DrawerPrimitive","import_jsx_runtime","Button","import_react","import_jsx_runtime"]}
|
|
1
|
+
{"version":3,"sources":["../src/settings/index.ts","../src/settings/host.tsx","../src/host-link.tsx","../src/stand-in-notice.ts","../src/tap-target/link.ts","../src/settings/searchIdentity.ts","../src/settings/SettingsDesignProvider.tsx","../src/icons.tsx","../src/cn.ts","../src/controls/surfaces.tsx","../src/button.tsx","../src/floating-layer.tsx","../src/title-tooltips.ts","../src/motion.ts","../src/portal-container.tsx","../src/focus-return.ts","../src/controls/controls.tsx","../src/solid-surface.ts","../src/select.tsx","../src/field-surface.ts","../src/controls/icon-only.ts","../src/textarea.tsx","../src/settings/SettingsNavigationRow.tsx","../src/settings/SettingsPage.tsx","../src/settings/SettingsRow.tsx","../src/settings/SettingsSectionContext.tsx","../src/tap-target/tap-buttons.tsx","../src/tap-target/tap-target-button.tsx","../src/tooltip.tsx","../src/tap-target/tap-target-guard.ts","../src/layout-scale.ts","../src/tap-target/tap-surface.tsx","../src/tap-target/tap-features.tsx","../src/tap-shortcut.ts","../src/tap-target/tap-default-variant.tsx","../src/settings/layout/SettingsCallout.tsx","../src/settings/layout/SettingsGrid.tsx","../src/settings/layout/SettingsReadOnlyValue.tsx","../src/settings/layout/SettingsSection.tsx","../src/settings/layout/SettingsSubHeader.tsx","../src/settings/navigation/SettingsFlatNavigation.tsx","../src/settings/primitives/SettingsButton.tsx","../src/settings/primitives/SettingsCheckbox.tsx","../src/checkbox.tsx","../src/settings/primitives/SettingsColorPicker.tsx","../src/settings/primitives/SettingsDeviceSelect.tsx","../src/settings/primitives/SettingsKeybinding.tsx","../src/settings/primitives/SettingsLink.tsx","../src/settings/primitives/SettingsMultiSelect.tsx","../src/popover.tsx","../src/settings/primitives/SettingsNumberInput.tsx","../src/settings/primitives/SettingsRadioGroup.tsx","../src/settings/primitives/SettingsSegmented.tsx","../src/settings/primitives/SettingsSelect.tsx","../src/command.tsx","../src/close-slot.tsx","../src/radix-dialog-modal-context.tsx","../src/use-is-mobile.ts","../src/settings/primitives/SettingsSlider.tsx","../src/slider.tsx","../src/settings/primitives/SettingsSwitch.tsx","../src/settings/primitives/SettingsTextInput.tsx","../src/settings/tree/types.ts","../src/settings/tree/SettingsBreadcrumb.tsx","../src/settings/tree/SettingsDrawerNav.tsx","../src/drawer.tsx","../src/settings/tree/SettingsTree.tsx"],"sourcesContent":["\"use client\";\n\n/**\n * @ai-matrx/design-system/settings — THE SETTINGS BLOCKS: rows, sections, controls and navigation\n * every settings screen is made of. Bind the app once with `configureSettings(...)` (see ./host).\n *\n * App-coupled controls (the model picker, the PRO text areas, the Tailwind color picker) stay in\n * the app and compose `SettingsRow` from here.\n */\nexport * from \"./host\";\nexport * from \"./icon-type\";\nexport * from \"./types\";\nexport * from \"./searchIdentity\";\nexport * from \"./SettingsDesignProvider\";\nexport * from \"./SettingsNavigationRow\";\nexport * from \"./SettingsPage\";\nexport * from \"./SettingsRow\";\nexport * from \"./SettingsSectionContext\";\nexport * from \"./layout/SettingsCallout\";\nexport * from \"./layout/SettingsGrid\";\nexport * from \"./layout/SettingsReadOnlyValue\";\nexport * from \"./layout/SettingsSection\";\nexport * from \"./layout/SettingsSubHeader\";\nexport * from \"./navigation/SettingsFlatNavigation\";\nexport * from \"./primitives/SettingsButton\";\nexport * from \"./primitives/SettingsCheckbox\";\nexport * from \"./primitives/SettingsColorPicker\";\nexport * from \"./primitives/SettingsDeviceSelect\";\nexport * from \"./primitives/SettingsKeybinding\";\nexport * from \"./primitives/SettingsLink\";\nexport * from \"./primitives/SettingsMultiSelect\";\nexport * from \"./primitives/SettingsNumberInput\";\nexport * from \"./primitives/SettingsRadioGroup\";\nexport * from \"./primitives/SettingsSegmented\";\nexport * from \"./primitives/SettingsSelect\";\nexport * from \"./primitives/SettingsSlider\";\nexport * from \"./primitives/SettingsSwitch\";\nexport * from \"./primitives/SettingsTextInput\";\nexport * from \"./tree/SettingsBreadcrumb\";\nexport * from \"./tree/SettingsDrawerNav\";\nexport * from \"./tree/SettingsTree\";\nexport * from \"./tree/types\";\n","\"use client\";\n\n/**\n * src/settings/host.tsx — THE SETTINGS HOST: what the settings blocks need from the app that draws them.\n *\n * Settings rows are drawn inside routes, windows and drawers, far from any provider, so — like\n * the entity-ref host — this one is bound ONCE per page through `configureSettings(...)` (a\n * module-level slot on `globalThis`, so every module-graph copy of the package reads one binding).\n *\n * Each port has a default that ANNOUNCES ITSELF instead of pretending:\n *\n * Link the app's router link (basePath/deployment aware). Default: the registered tap-target\n * link component, else a plain <a>.\n * ErrorMenu the actions drawn beside a KNOWN refusal. Default: none.\n * Anchor wraps one control so a deep link (`?control=` / `#id`) can reveal and focus it.\n * Default: a plain div carrying the ids, with no reveal behaviour.\n * useNavigate a HOOK returning the presentation-aware navigate function (a settings window\n * closes itself after the push). Default: a full-page navigation.\n * copyNotify where a copy's outcome is told. Default: silent (kit's useClipboard contract).\n *\n * Unconfigured, the default anchor carries `data-settings-host=\"unconfigured\"` and the first draw\n * warns once in the console, naming `configureSettings`. The host MUST be configured before the first\n * render: `useNavigate` is a hook, and a component's hook count cannot change between renders.\n */\n\nimport type { ComponentType, MouseEvent as ReactMouseEvent, ReactNode, Ref } from \"react\";\nimport { globalSlot } from \"@ai-matrx/kit/global-slot\";\nimport { HostLink } from \"../host-link\";\n\nexport interface SettingsLinkAnchorProps {\n href: string;\n id?: string | undefined;\n className?: string | undefined;\n onClick?: ((event: ReactMouseEvent<HTMLAnchorElement>) => void) | undefined;\n children?: ReactNode;\n ref?: Ref<HTMLAnchorElement> | undefined;\n}\n\nexport type SettingsNavigateFn = (\n href: string,\n event?: ReactMouseEvent | MouseEvent | null,\n) => void;\n\nexport interface SettingsHost {\n Link?: ComponentType<SettingsLinkAnchorProps> | undefined;\n ErrorMenu?: ComponentType<{ error: unknown }> | undefined;\n Anchor?: ComponentType<{ id: string; children: ReactNode }> | undefined;\n useNavigate?: (() => SettingsNavigateFn) | undefined;\n copyNotify?: ((message: string, kind: \"success\" | \"error\") => void) | undefined;\n}\n\nconst bound = globalSlot(\"ai-matrx.design-system.settings-host\", () => ({ host: null as SettingsHost | null }));\n\n/** Bind the app's settings host. Call once, at module load, before anything renders. */\nexport function configureSettings(host: SettingsHost | null): void {\n bound.host = host;\n}\n\n/** True once a host has been bound. */\nexport function settingsConfigured(): boolean {\n return Boolean(bound.host);\n}\n\nlet warned = false;\nfunction announceUnconfigured(): void {\n if (warned) return;\n warned = true;\n if (typeof console !== \"undefined\") {\n console.warn(\n \"[@ai-matrx/design-system/settings] no host configured: settings links navigate with full page loads, \" +\n \"controls cannot be deep-linked and refusals show no actions. Call configureSettings(...) once before the first render.\",\n );\n }\n}\n\nfunction DefaultAnchor({ id, children }: { id: string; children: ReactNode }) {\n announceUnconfigured();\n return (\n <div\n id={id}\n data-setting-control={id}\n data-setting-search-key={id}\n data-settings-host=\"unconfigured\"\n tabIndex={-1}\n className=\"@container/settings scroll-mt-20 outline-none\"\n >\n {children}\n </div>\n );\n}\n\n// No settings-specific Link: the one internal-link seam is HostLink (the registered tap-target link).\nfunction DefaultLink({ ref, ...rest }: SettingsLinkAnchorProps) {\n return <HostLink ref={ref as Ref<HTMLAnchorElement> | undefined} {...rest} />;\n}\n\nfunction useDefaultNavigate(): SettingsNavigateFn {\n announceUnconfigured();\n return (href, event) => {\n if (event && \"preventDefault\" in event) event.preventDefault();\n if (typeof window !== \"undefined\") window.location.assign(href);\n };\n}\n\n/** The Link the settings blocks draw. */\nexport function SettingsHostLink(props: SettingsLinkAnchorProps) {\n const Link = bound.host?.Link ?? DefaultLink;\n return <Link {...props} />;\n}\n\n/** The actions beside a known refusal; nothing until the host binds one. */\nexport function SettingsHostErrorMenu({ error }: { error: unknown }) {\n const Menu = bound.host?.ErrorMenu;\n return Menu ? <Menu error={error} /> : null;\n}\n\n/** Wraps one control so a deep link can reveal it. */\nexport function SettingsHostAnchor(props: { id: string; children: ReactNode }) {\n const Anchor = bound.host?.Anchor ?? DefaultAnchor;\n return <Anchor {...props} />;\n}\n\n/** The presentation-aware navigate function (a HOOK — see the header). */\nexport function useSettingsHostNavigate(): SettingsNavigateFn {\n const hook = bound.host?.useNavigate ?? useDefaultNavigate;\n return hook();\n}\n\n/** The copy notifier the host bound, if any. */\nexport function settingsCopyNotify(): ((message: string, kind: \"success\" | \"error\") => void) | undefined {\n return bound.host?.copyNotify;\n}\n","\"use client\";\n\n/**\n * HostLink — the link the design-system's own components draw for an internal destination (a KPI\n * tile that opens its records, a dock tab, a card that opens a page).\n *\n * It is NOT a new seam: it resolves the tap-target link component the host registered once with\n * `setTapTargetLinkComponent` (`tap-target/link.ts`, the same slot the tap buttons and the settings\n * blocks use). A host that routes through its own link door (cross-deployment aware, prefetch rules)\n * registers THAT door there, and every component here inherits it.\n *\n * Nothing registered: a plain `<a>` (a working link, a full page load) that says so — one console\n * notice and `data-link-host=\"unconfigured\"` on what it draws.\n */\n\nimport * as React from \"react\";\n\nimport { announceStandIn, UNCONFIGURED } from \"./stand-in-notice\";\nimport { getTapTargetLinkComponent } from \"./tap-target/link\";\n\nexport interface HostLinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"href\"> {\n href: string;\n prefetch?: boolean | null;\n}\n\nexport const HostLink = React.forwardRef<HTMLAnchorElement, HostLinkProps>(function HostLink(\n { href, prefetch, ...rest },\n ref,\n) {\n const Registered = getTapTargetLinkComponent() as unknown as React.ComponentType<\n HostLinkProps & { ref?: React.Ref<HTMLAnchorElement> }\n > | null;\n if (Registered) {\n return <Registered ref={ref} href={href} {...(prefetch === undefined ? {} : { prefetch })} {...rest} />;\n }\n announceStandIn(\n \"link-host\",\n \"HostLink drew a plain <a>: register the app's link component once with setTapTargetLinkComponent() from @ai-matrx/design-system/tap-target.\",\n );\n return <a ref={ref} href={href} data-link-host={UNCONFIGURED} {...rest} />;\n});\n","/**\n * A STAND-IN ANNOUNCES ITSELF (law 4). Where a design-system component has a working default for a\n * part the host is meant to supply (the writing box, the sandbox panel, how a scope is drawn), the\n * default says so: ONE console notice per stand-in naming what to pass, and a `data-*=\"unconfigured\"`\n * attribute on what it draws. The pattern is records-ui's `data-entity-ref-host=\"unconfigured\"` and\n * settings' `data-settings-host=\"unconfigured\"`.\n */\nconst announced = new Set<string>();\n\n/** Warn once per `key`, in words naming the field the host should pass. */\nexport function announceStandIn(key: string, message: string): void {\n if (announced.has(key)) return;\n announced.add(key);\n console.warn(`[design-system] ${message}`);\n}\n\n/** Test seam: forget every notice that was printed. */\nexport function _resetStandInNotices(): void {\n announced.clear();\n}\n\n/** The value every stand-in's data attribute carries. */\nexport const UNCONFIGURED = \"unconfigured\" as const;\n","import type { ComponentType, ReactNode, Ref } from \"react\";\n\n/**\n * The injectable link seam — the package's replacement for the original\n * hard `next/link` import.\n *\n * Internal hrefs (anything NOT matching `http(s):`, `mailto:`, `tel:`) render\n * through the link component resolved here; external hrefs always render a\n * plain `<a target=\"_blank\" rel=\"noopener noreferrer\">`, exactly like the\n * original. When nothing is registered and no per-instance `linkComponent`\n * prop is given, internal hrefs fall back to a plain `<a>` (no prefetch, no\n * client-side routing — still a working link).\n */\nexport interface TapTargetLinkProps {\n href: string;\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\" | undefined;\n rel?: string | undefined;\n /** Router prefetch hint (next/link semantics). Plain `<a>` fallback ignores it. */\n prefetch?: boolean | null | undefined;\n \"aria-label\"?: string | undefined;\n /** Tooltip text drawn through `title` (the provider's title takeover). */\n title?: string | undefined;\n className?: string | undefined;\n children?: ReactNode;\n /** The trigger's ref (the development guard measures the rendered link).\n * next/link forwards it to its `<a>`. */\n ref?: Ref<HTMLAnchorElement> | undefined;\n}\n\nexport type TapTargetLinkComponent = ComponentType<TapTargetLinkProps>;\n\n/**\n * The registered component lives in a `Symbol.for` slot on `globalThis` — NOT\n * in module state — so it survives the module graph being instantiated more\n * than once: the `.` and `./buttons` dist bundles each inline the primitives\n * (tsup `splitting: false`), and a consumer may even mix `import` and\n * `require`. One registration must reach every copy.\n */\nconst LINK_SLOT = Symbol.for(\"@ai-matrx/tap-target:link-component\");\n\ntype GlobalWithLinkSlot = typeof globalThis & {\n [LINK_SLOT]?: TapTargetLinkComponent | null;\n};\n\n/**\n * Register the app's link component once at startup (e.g. `next/link`):\n *\n * ```tsx\n * import Link from \"next/link\";\n * import { setTapTargetLinkComponent } from \"@ai-matrx/tap-target\";\n * setTapTargetLinkComponent(Link);\n * ```\n *\n * Pass `null` to unregister (plain `<a>` fallback resumes).\n */\nexport function setTapTargetLinkComponent(\n component: TapTargetLinkComponent | null,\n): void {\n (globalThis as GlobalWithLinkSlot)[LINK_SLOT] = component;\n}\n\n/** The currently registered link component, or `null` when none is set. */\nexport function getTapTargetLinkComponent(): TapTargetLinkComponent | null {\n return (globalThis as GlobalWithLinkSlot)[LINK_SLOT] ?? null;\n}\n","/**\n * Stable deep-link identity for an authored setting. This is deliberately\n * separate from the React input id: controls remount, while setting doors and\n * bookmarked search results must keep resolving to the same row.\n */\nexport function settingsControlSearchId(sectionTitle: string, label: string): string {\n const slug = (value: string) =>\n value\n .normalize(\"NFKD\")\n .replace(/[\\u0300-\\u036f]/g, \"\")\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/(^-|-$)/g, \"\") || \"setting\";\n return `settings-control-${slug(sectionTitle)}-${slug(label)}`;\n}\n","\"use client\";\n\nimport { createContext, useContext } from \"react\";\nimport type { ReactNode } from \"react\";\n\nexport type SettingsDesignVariant = \"standard\" | \"compact\";\nexport type SettingsDesignProviderProps = {\n children: ReactNode;\n variant?: SettingsDesignVariant;\n};\n\nconst SettingsDesignContext = createContext<SettingsDesignVariant>(\"standard\");\n\n/**\n * Applies a presentation density to the local settings primitive family.\n * Omit it for existing embeddings, which retain the standard presentation.\n */\nexport function SettingsDesignProvider({\n children,\n variant = \"standard\",\n}: SettingsDesignProviderProps) {\n return (\n <SettingsDesignContext.Provider value={variant}>\n {children}\n </SettingsDesignContext.Provider>\n );\n}\n\nexport function useSettingsDesign() {\n return { variant: useContext(SettingsDesignContext) } as const;\n}\n","/**\n * Internal inlined SVG icons (policy C19: no icon-library dependency, ever).\n *\n * Each icon is copied from the exact glyph the ported originals rendered:\n * lucide-react's Loader2 / ChevronLeft / ChevronRight / MoreHorizontal and\n * @radix-ui/react-icons' Cross2Icon. Same viewBoxes, same paths, same default\n * stroke geometry — a host swapping the import sees pixel-identical output.\n *\n * Not exported from the package entry; components consume them directly.\n */\n\nimport * as React from \"react\";\n\nexport type IconProps = React.SVGAttributes<SVGSVGElement>;\n\n/**\n * Every lucide glyph carries `lucide-<name>`, the class lucide-react itself renders: THE OPTICAL\n * GLYPH TRIM (tap-target.css) reads the glyph's real air from it, and a caller's own class follows it.\n */\nfunction lucideProps(name: string, { className, ...props }: IconProps): React.SVGAttributes<SVGSVGElement> {\n return {\n className: className ? `lucide-${name} ${className}` : `lucide-${name}`,\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n \"aria-hidden\": true,\n ...props,\n };\n}\n\n/**\n * lucide `loader-2` — the spinner glyph. Callers add `matrx-spin`.\n * Never a resting icon: at rest this incomplete arc reads as a broken\n * half-circle. Refresh controls use arrows, then swap to this only while busy.\n */\nexport function Loader2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"loader-circle\", props)}>\n <path d=\"M21 12a9 9 0 1 1-6.219-8.56\" />\n </svg>\n );\n}\n\n/** lucide `chevron-left`. */\nexport function ChevronLeftIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevron-left\", props)}>\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n );\n}\n\n/** lucide `chevron-right`. */\nexport function ChevronRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevron-right\", props)}>\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n );\n}\n\n/** lucide `chevron-down` — the disclosure's open glyph. */\nexport function ChevronDownIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevron-down\", props)}>\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n );\n}\n\n/** lucide `trash-2` (moved from @ai-matrx/agents). */\nexport function Trash2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"trash-2\", props)}>\n <path d=\"M10 11v6\" />\n <path d=\"M14 11v6\" />\n <path d=\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\" />\n <path d=\"M3 6h18\" />\n <path d=\"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\" />\n </svg>\n );\n}\n\n/** lucide `archive` — the archived-rows glyph (ArchivedDisclosure). */\nexport function ArchiveIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"archive\", props)}>\n <rect width=\"20\" height=\"5\" x=\"2\" y=\"3\" rx=\"1\" />\n <path d=\"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8\" />\n <path d=\"M10 12h4\" />\n </svg>\n );\n}\n\n/** lucide `more-horizontal` — the kebab/ellipsis glyph. */\nexport function MoreHorizontalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"ellipsis\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"1\" />\n <circle cx=\"19\" cy=\"12\" r=\"1\" />\n <circle cx=\"5\" cy=\"12\" r=\"1\" />\n </svg>\n );\n}\n\n/** lucide `check` — the selected-row tick (CreatablePicker). */\nexport function CheckIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"check\", props)}>\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n );\n}\n\n/** lucide `chevrons-up-down` — the combobox trigger glyph. */\nexport function ChevronsUpDownIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevrons-up-down\", props)}>\n <path d=\"m7 15 5 5 5-5\" />\n <path d=\"m7 9 5-5 5 5\" />\n </svg>\n );\n}\n\n/** lucide `external-link` — the manage-in-new-tab glyph. */\nexport function ExternalLinkIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"external-link\", props)}>\n <path d=\"M15 3h6v6\" />\n <path d=\"M10 14 21 3\" />\n <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" />\n </svg>\n );\n}\n\n/** lucide `lock` — the platform-governed vocabulary glyph. */\nexport function LockIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"lock\", props)}>\n <rect width=\"18\" height=\"11\" x=\"3\" y=\"11\" rx=\"2\" ry=\"2\" />\n <path d=\"M7 11V7a5 5 0 0 1 10 0v4\" />\n </svg>\n );\n}\n\n/** lucide `pencil` — the edit glyph (the table card's Edit action). */\nexport function PencilIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"pencil\", props)}>\n <path d=\"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z\" />\n <path d=\"m15 5 4 4\" />\n </svg>\n );\n}\n\n/** lucide `message-square` — a row's comments (records-ui SectionCard). */\nexport function MessageSquareIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"message-square\", props)}>\n <path d=\"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z\" />\n </svg>\n );\n}\n\n/** lucide `sticky-note` — a row's usage note (records-ui SectionCard). */\nexport function StickyNoteIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sticky-note\", props)}>\n <path d=\"M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z\" />\n <path d=\"M15 3v4a2 2 0 0 0 2 2h4\" />\n </svg>\n );\n}\n\n/** lucide `minus` — the decrease glyph (NumberStepper). */\nexport function MinusIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"minus\", props)}>\n <path d=\"M5 12h14\" />\n </svg>\n );\n}\n\n/** lucide `plus` — the create/add glyph. */\nexport function PlusIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"plus\", props)}>\n <path d=\"M5 12h14\" />\n <path d=\"M12 5v14\" />\n </svg>\n );\n}\n\n/** lucide `search` — the magnifier (the `@ai-matrx/design-system/icons` section). */\nexport function SearchIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"search\", props)}>\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"m21 21-4.3-4.3\" />\n </svg>\n );\n}\n\n/** lucide `list-filter` — a table's filter button (Mail's and Finder's filter). */\nexport function ListFilterIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"list-filter\", props)}>\n <path d=\"M3 6h18\" />\n <path d=\"M7 12h10\" />\n <path d=\"M10 18h4\" />\n </svg>\n );\n}\n\n/** lucide `pin` — pinned state (the `@ai-matrx/design-system/icons` section). */\nexport function PinIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"pin\", props)}>\n <path d=\"M12 17v5\" />\n <path d=\"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z\" />\n </svg>\n );\n}\n\n/** lucide `x` — the dialog close glyph (host dialog module used lucide X). */\nexport function XIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"x\", props)}>\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n );\n}\n\n/**\n * @radix-ui/react-icons components default to width/height 15 — the bare\n * `<ChevronUpIcon />` renders in Select's scroll buttons rely on it.\n */\nfunction radixProps(props: IconProps): React.SVGAttributes<SVGSVGElement> {\n return {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 15 15\",\n width: 15,\n height: 15,\n fill: \"none\",\n \"aria-hidden\": true,\n ...props,\n };\n}\n\n/** @radix-ui/react-icons `MagnifyingGlassIcon` — the command search glyph. */\nexport function MagnifyingGlassIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** @radix-ui/react-icons `CheckIcon` — the select item indicator glyph. */\nexport function RadixCheckIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/**\n * @radix-ui/react-icons `DividerHorizontalIcon` — the INDETERMINATE checkbox\n * glyph. Radix renders the indicator for both `true` and `\"indeterminate\"`, so\n * a half-selected \"select all\" that shows a full check states something false;\n * the two states get different glyphs on purpose.\n */\nexport function DividerHorizontalIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M2 7.5C2 7.22386 2.22386 7 2.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H2.5C2.22386 8 2 7.77614 2 7.5Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** @radix-ui/react-icons `DotFilledIcon` — the menu radio-item indicator. */\nexport function DotFilledIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z\"\n fill=\"currentColor\"\n />\n </svg>\n );\n}\n\n/** @radix-ui/react-icons `ChevronRightIcon` — the submenu-trigger glyph. */\nexport function RadixChevronRightIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** @radix-ui/react-icons `ChevronDownIcon` — the select trigger/scroll glyph. */\nexport function RadixChevronDownIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** @radix-ui/react-icons `ChevronUpIcon` — the select scroll-up glyph. */\nexport function RadixChevronUpIcon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** @radix-ui/react-icons `Cross2Icon` — the dialog/sheet close glyph. */\nexport function Cross2Icon(props: IconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 15 15\"\n fill=\"none\"\n aria-hidden\n {...props}\n >\n <path\n d=\"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/**\n * @radix-ui/react-icons `DragHandleDots2Icon` — the grip on `ResizableHandle`.\n * Inlined per C19: this package depends on no icon library.\n */\nexport function DragHandleDots2Icon(props: IconProps) {\n return (\n <svg {...radixProps(props)}>\n <path\n d=\"M4.5 2.5C5.05228 2.5 5.5 2.05228 5.5 1.5C5.5 0.947715 5.05228 0.5 4.5 0.5C3.94772 0.5 3.5 0.947715 3.5 1.5C3.5 2.05228 3.94772 2.5 4.5 2.5ZM4.5 6.5C5.05228 6.5 5.5 6.05229 5.5 5.5C5.5 4.94771 5.05228 4.5 4.5 4.5C3.94772 4.5 3.5 4.94771 3.5 5.5C3.5 6.05229 3.94772 6.5 4.5 6.5ZM5.5 9.5C5.5 10.0523 5.05228 10.5 4.5 10.5C3.94772 10.5 3.5 10.0523 3.5 9.5C3.5 8.94771 3.94772 8.5 4.5 8.5C5.05228 8.5 5.5 8.94771 5.5 9.5ZM4.5 14.5C5.05228 14.5 5.5 14.0523 5.5 13.5C5.5 12.9477 5.05228 12.5 4.5 12.5C3.94772 12.5 3.5 12.9477 3.5 13.5C3.5 14.0523 3.94772 14.5 4.5 14.5ZM11.5 1.5C11.5 2.05228 11.0523 2.5 10.5 2.5C9.94771 2.5 9.5 2.05228 9.5 1.5C9.5 0.947715 9.94771 0.5 10.5 0.5C11.0523 0.5 11.5 0.947715 11.5 1.5ZM10.5 6.5C11.0523 6.5 11.5 6.05229 11.5 5.5C11.5 4.94771 11.0523 4.5 10.5 4.5C9.94771 4.5 9.5 4.94771 9.5 5.5C9.5 6.05229 9.94771 6.5 10.5 6.5ZM11.5 9.5C11.5 10.0523 11.0523 10.5 10.5 10.5C9.94771 10.5 9.5 10.0523 9.5 9.5C9.5 8.94771 9.94771 8.5 10.5 8.5C11.0523 8.5 11.5 8.94771 11.5 9.5ZM10.5 14.5C11.0523 14.5 11.5 14.0523 11.5 13.5C11.5 12.9477 11.0523 12.5 10.5 12.5C9.94771 12.5 9.5 12.9477 9.5 13.5C9.5 14.0523 9.94771 14.5 10.5 14.5Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** lucide `star` — the saved-organization badge (OrganizationPicker). */\nexport function StarIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"star\", props)}>\n <path d=\"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z\" />\n </svg>\n );\n}\n\n/** lucide `building-2` — the organization glyph (OrganizationPicker trigger). */\nexport function Building2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"building-2\", props)}>\n <path d=\"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z\" />\n <path d=\"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2\" />\n <path d=\"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2\" />\n <path d=\"M10 6h4\" />\n <path d=\"M10 10h4\" />\n <path d=\"M10 14h4\" />\n <path d=\"M10 18h4\" />\n </svg>\n );\n}\n\n/** lucide `panel-left` — the sidebar toggle glyph. */\nexport function PanelLeftIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"panel-left\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M9 3v18\" />\n </svg>\n );\n}\n\n/** lucide `ellipsis-vertical` — a panel's \"more\" menu. */\nexport function MoreVerticalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"ellipsis-vertical\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"1\" />\n <circle cx=\"12\" cy=\"5\" r=\"1\" />\n <circle cx=\"12\" cy=\"19\" r=\"1\" />\n </svg>\n );\n}\n\n/** lucide `maximize-2` — expand a panel. */\nexport function Maximize2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"maximize-2\", props)}>\n <path d=\"M15 3h6v6\" />\n <path d=\"m21 3-7 7\" />\n <path d=\"m3 21 7-7\" />\n <path d=\"M9 21H3v-6\" />\n </svg>\n );\n}\n\n/** lucide `minimize-2` — restore an expanded panel. */\nexport function Minimize2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"minimize-2\", props)}>\n <path d=\"m14 10 7-7\" />\n <path d=\"M20 10h-6V4\" />\n <path d=\"m3 21 7-7\" />\n <path d=\"M4 14h6v6\" />\n </svg>\n );\n}\n\n/** lucide `arrow-left`. */\nexport function ArrowLeftIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-left\", props)}>\n <path d=\"m12 19-7-7 7-7\" />\n <path d=\"M19 12H5\" />\n </svg>\n );\n}\n\n/** lucide `arrow-right`. */\nexport function ArrowRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-right\", props)}>\n <path d=\"M5 12h14\" />\n <path d=\"m12 5 7 7-7 7\" />\n </svg>\n );\n}\n\n/** lucide `arrow-up` — the swipe deck's up edge. */\nexport function ArrowUpIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-up\", props)}>\n <path d=\"m5 12 7-7 7 7\" />\n <path d=\"M12 19V5\" />\n </svg>\n );\n}\n\n/** lucide `arrow-down` — the swipe deck's down edge. */\nexport function ArrowDownIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-down\", props)}>\n <path d=\"M12 5v14\" />\n <path d=\"m19 12-7 7-7-7\" />\n </svg>\n );\n}\n\n/** lucide `undo-2` — take back the last change. */\nexport function Undo2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"undo-2\", props)}>\n <path d=\"M9 14 4 9l5-5\" />\n <path d=\"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11\" />\n </svg>\n );\n}\n\n/** lucide `eraser` — forget a marked part. */\nexport function EraserIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"eraser\", props)}>\n <path d=\"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21\" />\n <path d=\"M22 21H7\" />\n <path d=\"m5 11 9 9\" />\n </svg>\n );\n}\n\n/** lucide `rotate-cw` — reload. */\nexport function RotateCwIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"rotate-cw\", props)}>\n <path d=\"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8\" />\n <path d=\"M21 3v5h-5\" />\n </svg>\n );\n}\n\n/** lucide `globe` — a web page with no favicon. */\nexport function GlobeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"globe\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20\" />\n <path d=\"M2 12h20\" />\n </svg>\n );\n}\n\n/** lucide `calendar` — the date field's glyph. */\nexport function CalendarIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"calendar\", props)}>\n <path d=\"M8 2v4\" />\n <path d=\"M16 2v4\" />\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"4\" rx=\"2\" />\n <path d=\"M3 10h18\" />\n </svg>\n );\n}\n\n/** lucide `clock` — the time field's glyph. */\nexport function ClockIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"clock\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <polyline points=\"12 6 12 12 16 14\" />\n </svg>\n );\n}\n\n/** lucide `refresh-cw` — retry / reload. */\nexport function RefreshCwIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"refresh-cw\", props)}>\n <path d=\"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\" />\n <path d=\"M21 3v5h-5\" />\n <path d=\"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\" />\n <path d=\"M8 16H3v5\" />\n </svg>\n );\n}\n\n/** lucide `triangle-alert` (alias `AlertTriangle`) — an error or warning. */\nexport function AlertTriangleIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"triangle-alert\", props)}>\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n </svg>\n );\n}\n\n/** lucide `circle-check` — a passing state. */\nexport function CircleCheckIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"circle-check\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"m16 9-5.5 5.5L8 12\" />\n </svg>\n );\n}\n\n/** lucide `circle-question-mark` (alias `CircleHelp`) — field help. */\nexport function CircleHelpIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"circle-question-mark\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n );\n}\n\n/** lucide `circle-x` — a failing state. */\nexport function CircleXIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"circle-x\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"m15 9-6 6\" />\n <path d=\"m9 9 6 6\" />\n </svg>\n );\n}\n\n/** lucide `info` — a row label's help glyph (controls `PropertyRow`). */\nexport function InfoIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"info\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4\" />\n <path d=\"M12 8h.01\" />\n </svg>\n );\n}\n\n/** lucide `circle-dot` — the \"Get help from Matrx AI\" button glyph (controls `HelpIcon`). */\nexport function CircleDotIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"circle-dot\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <circle cx=\"12\" cy=\"12\" r=\"1\" />\n </svg>\n );\n}\n\n/** lucide `copy` — the Peek's token chip (copy the exact token). */\nexport function CopyIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"copy\", props)}>\n <rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n <path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" />\n </svg>\n );\n}\n\n/** lucide `upload` (moved from @ai-matrx/media). */\nexport function UploadIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"upload\", props)}>\n <path d=\"M12 3v12\" />\n <path d=\"m17 8-5-5-5 5\" />\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n </svg>\n );\n}\n\n/** lucide `circle-alert` — an error or attention state. */\nexport function CircleAlertIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"circle-alert\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <line x1=\"12\" x2=\"12\" y1=\"8\" y2=\"12\" />\n <line x1=\"12\" x2=\"12.01\" y1=\"16\" y2=\"16\" />\n </svg>\n );\n}\n\n/** lucide `panel-right` — a side pane toggle. */\nexport function PanelRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"panel-right\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M15 3v18\" />\n </svg>\n );\n}\n\n/** lucide `bell` — notifications. */\nexport function BellIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"bell\", props)}>\n <path d=\"M10.268 21a2 2 0 0 0 3.464 0\" />\n <path d=\"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326\" />\n </svg>\n );\n}\n\n/** lucide `eye-off` — hidden. */\nexport function EyeOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"eye-off\", props)}>\n <path d=\"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\" />\n <path d=\"M14.084 14.158a3 3 0 0 1-4.242-4.242\" />\n <path d=\"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\" />\n <path d=\"m2 2 20 20\" />\n </svg>\n );\n}\n\n/** lucide `app-window` — open as a window. */\nexport function AppWindowIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"app-window\", props)}>\n <rect x=\"2\" y=\"4\" width=\"20\" height=\"16\" rx=\"2\" />\n <path d=\"M10 4v4\" />\n <path d=\"M2 8h20\" />\n <path d=\"M6 4v4\" />\n </svg>\n );\n}\n\n/** lucide `video` — a video call or clip. */\nexport function VideoIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"video\", props)}>\n <path d=\"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5\" />\n <rect x=\"2\" y=\"6\" width=\"14\" height=\"12\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `phone` — a voice call. */\nexport function PhoneIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"phone\", props)}>\n <path d=\"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384\" />\n </svg>\n );\n}\n\n/** lucide `sparkles` — AI. */\nexport function SparklesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sparkles\", props)}>\n <path d=\"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z\" />\n <path d=\"M20 2v4\" />\n <path d=\"M22 4h-4\" />\n <circle cx=\"4\" cy=\"20\" r=\"2\" />\n </svg>\n );\n}\n\n/** lucide `panels-top-left` — a layout. */\nexport function PanelsTopLeftIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"panels-top-left\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M3 9h18\" />\n <path d=\"M9 21V9\" />\n </svg>\n );\n}\n\n/** lucide `download`. */\nexport function DownloadIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"download\", props)}>\n <path d=\"M12 15V3\" />\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n <path d=\"m7 10 5 5 5-5\" />\n </svg>\n );\n}\n\n/** lucide `settings`. */\nexport function SettingsIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"settings\", props)}>\n <path d=\"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n );\n}\n\n/** lucide `users`. */\nexport function UsersIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"users\", props)}>\n <path d=\"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\" />\n <path d=\"M16 3.128a4 4 0 0 1 0 7.744\" />\n <path d=\"M22 21v-2a4 4 0 0 0-3-3.87\" />\n <circle cx=\"9\" cy=\"7\" r=\"4\" />\n </svg>\n );\n}\n\n/** lucide `grip-vertical` — a drag handle. */\nexport function GripVerticalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"grip-vertical\", props)}>\n <circle cx=\"9\" cy=\"12\" r=\"1\" />\n <circle cx=\"9\" cy=\"5\" r=\"1\" />\n <circle cx=\"9\" cy=\"19\" r=\"1\" />\n <circle cx=\"15\" cy=\"12\" r=\"1\" />\n <circle cx=\"15\" cy=\"5\" r=\"1\" />\n <circle cx=\"15\" cy=\"19\" r=\"1\" />\n </svg>\n );\n}\n\n/** lucide `history`. */\nexport function HistoryIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"history\", props)}>\n <path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\" />\n <path d=\"M3 3v5h5\" />\n <path d=\"M12 7v5l4 2\" />\n </svg>\n );\n}\n\n/** lucide `workflow`. */\nexport function WorkflowIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"workflow\", props)}>\n <rect width=\"8\" height=\"8\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M7 11v4a2 2 0 0 0 2 2h4\" />\n <rect width=\"8\" height=\"8\" x=\"13\" y=\"13\" rx=\"2\" />\n </svg>\n );\n}\n\n// ---- Glyphs consolidated from the packages above the design system (one glyph home). ----\n\n/** lucide `activities` (moved from @ai-matrx/meet). */\nexport function ActivitiesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"activities\", props)}>\n <path d=\"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z\" />\n <rect x=\"3\" y=\"14\" width=\"7\" height=\"7\" rx=\"1\" />\n <circle cx=\"17.5\" cy=\"17.5\" r=\"3.5\" />\n </svg>\n );\n}\n\n/** lucide `arrow-down-to-line` (moved from @ai-matrx/agents). */\nexport function ArrowDownToLineIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-down-to-line\", props)}>\n <path d=\"M12 17V3\" />\n <path d=\"m6 11 6 6 6-6\" />\n <path d=\"M19 21H5\" />\n </svg>\n );\n}\n\n/** lucide `arrow-left-right` (moved from @ai-matrx/diff). */\nexport function ArrowLeftRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-left-right\", props)}>\n <path d=\"M8 3 4 7l4 4\" />\n <path d=\"M4 7h16\" />\n <path d=\"m16 21 4-4-4-4\" />\n <path d=\"M20 17H4\" />\n </svg>\n );\n}\n\n/** lucide `arrow-left-to-line` (moved from @ai-matrx/summon). */\nexport function ArrowLeftToLineIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-left-to-line\", props)}>\n <path d=\"M3 19V5\" />\n <path d=\"m13 6-6 6 6 6\" />\n <path d=\"M7 12h14\" />\n </svg>\n );\n}\n\n/** lucide `atom` (moved from @ai-matrx/agents). */\nexport function AtomIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"atom\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"1\" />\n <path d=\"M20.2 20.2c2.04-2.03.02-7.36-4.5-11.9-4.54-4.52-9.87-6.54-11.9-4.5-2.04 2.03-.02 7.36 4.5 11.9 4.54 4.52 9.87 6.54 11.9 4.5Z\" />\n <path d=\"M15.7 15.7c4.52-4.54 6.54-9.87 4.5-11.9-2.03-2.04-7.36-.02-11.9 4.5-4.52 4.54-6.54 9.87-4.5 11.9 2.03 2.04 7.36.02 11.9-4.5Z\" />\n </svg>\n );\n}\n\n/** lucide `audio-lines` (moved from @ai-matrx/content-ir). */\nexport function AudioLinesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"audio-lines\", props)}>\n <path d=\"M2 10v3\" />\n <path d=\"M6 6v11\" />\n <path d=\"M10 3v18\" />\n <path d=\"M14 8v7\" />\n <path d=\"M18 5v13\" />\n <path d=\"M22 10v3\" />\n </svg>\n );\n}\n\n/** lucide `boxes` (moved from @ai-matrx/associations). */\nexport function BoxesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"boxes\", props)}>\n <path d=\"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z\" />\n <path d=\"m7 16.5-4.74-2.85\" />\n <path d=\"m7 16.5 5-3\" />\n <path d=\"M7 16.5v5.17\" />\n <path d=\"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z\" />\n <path d=\"m17 16.5-5-3\" />\n <path d=\"m17 16.5 4.74-2.85\" />\n <path d=\"M17 16.5v5.17\" />\n <path d=\"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z\" />\n <path d=\"M12 8 7.26 5.15\" />\n <path d=\"m12 8 4.74-2.85\" />\n <path d=\"M12 13.5V8\" />\n </svg>\n );\n}\n\n/** lucide `braces` (moved from @ai-matrx/media). */\nexport function BracesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"braces\", props)}>\n <path d=\"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1\" />\n <path d=\"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1\" />\n </svg>\n );\n}\n\n/** lucide `breakout` (moved from @ai-matrx/meet). */\nexport function BreakoutIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"breakout\", props)}>\n <rect width=\"7\" height=\"18\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"14\" rx=\"1\" />\n </svg>\n );\n}\n\n/** lucide `camera` (moved from @ai-matrx/meet). */\nexport function CameraIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"camera\", props)}>\n <path d=\"m23 7-7 5 7 5V7Z\" />\n <rect x=\"1\" y=\"5\" width=\"15\" height=\"14\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `camera-off` (moved from @ai-matrx/meet). */\nexport function CameraOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"camera-off\", props)}>\n <path d=\"M2 2l20 20\" />\n <path d=\"M10.66 5H14a2 2 0 0 1 2 2v3.34l1 1L23 7v10\" />\n <path d=\"M16 16a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h2\" />\n </svg>\n );\n}\n\n/** lucide `captions` (moved from @ai-matrx/meet). */\nexport function CaptionsIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"captions\", props)}>\n <rect x=\"3\" y=\"5\" width=\"18\" height=\"14\" rx=\"2\" />\n <path d=\"M10 10.5a2 2 0 1 0 0 3M16 10.5a2 2 0 1 0 0 3\" />\n </svg>\n );\n}\n\n/** lucide `chat-bubble` (moved from @ai-matrx/coding-sessions). */\nexport function ChatBubbleIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chat-bubble\", props)}>\n <path d=\"M20 12.5a7.5 7.5 0 0 1-10.9 6.7L4 20.5l1.3-4.6A7.5 7.5 0 1 1 20 12.5z\" />\n </svg>\n );\n}\n\n/** lucide `chat` (moved from @ai-matrx/meet). */\nexport function ChatIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chat\", props)}>\n <path d=\"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z\" />\n </svg>\n );\n}\n\n/** lucide `check-circle-2` (moved from @ai-matrx/media). */\nexport function CheckCircle2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"check-circle-2\", props)}>\n <path d=\"M21.801 10A10 10 0 1 1 17 3.335\" />\n <path d=\"m9 11 3 3L22 4\" />\n </svg>\n );\n}\n\n/** lucide `chevron-up` (moved from @ai-matrx/meet). */\nexport function ChevronUpIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevron-up\", props)}>\n <path d=\"m6 15 6-6 6 6\" />\n </svg>\n );\n}\n\n/** lucide `chevrons-down-up` (moved from @ai-matrx/diff). */\nexport function ChevronsDownUpIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevrons-down-up\", props)}>\n <path d=\"m7 20 5-5 5 5\" />\n <path d=\"m7 4 5 5 5-5\" />\n </svg>\n );\n}\n\n/** lucide `clock-3` (moved from @ai-matrx/diff). */\nexport function Clock3Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"clock-3\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 6v6h4\" />\n </svg>\n );\n}\n\n/** lucide `code-2` (moved from @ai-matrx/office). */\nexport function Code2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"code-2\", props)}>\n <path d=\"m18 16 4-4-4-4\" />\n <path d=\"m6 8-4 4 4 4\" />\n <path d=\"m14.5 4-5 16\" />\n </svg>\n );\n}\n\n/** lucide `code` (moved from @ai-matrx/media). */\nexport function CodeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"code\", props)}>\n <path d=\"m16 18 6-6-6-6\" />\n <path d=\"m8 6-6 6 6 6\" />\n </svg>\n );\n}\n\n/** lucide `columns-2` (moved from @ai-matrx/diff). */\nexport function Columns2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"columns-2\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M12 3v18\" />\n </svg>\n );\n}\n\n/** lucide `corner-down-right` (moved from @ai-matrx/associations). */\nexport function CornerDownRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"corner-down-right\", props)}>\n <polyline points=\"15 10 20 15 15 20\" />\n <path d=\"M4 4v7a4 4 0 0 0 4 4h12\" />\n </svg>\n );\n}\n\n/** lucide `database` (moved from @ai-matrx/media). */\nexport function DatabaseIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"database\", props)}>\n <ellipse cx=\"12\" cy=\"5\" rx=\"9\" ry=\"3\" />\n <path d=\"M3 5V19A9 3 0 0 0 21 19V5\" />\n <path d=\"M3 12A9 3 0 0 0 21 12\" />\n </svg>\n );\n}\n\n/** lucide `dock` (moved from @ai-matrx/canvas). */\nexport function DockIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"dock\", props)}>\n <path d=\"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6\" />\n <path d=\"M21 3 12 12\" />\n <path d=\"M12 6v6h6\" />\n </svg>\n );\n}\n\n/** lucide `expand` (moved from @ai-matrx/detail). */\nexport function ExpandIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"expand\", props)}>\n <path d=\"m15 15 6 6\" />\n <path d=\"m15 9 6-6\" />\n <path d=\"M21 16v5h-5\" />\n <path d=\"M21 8V3h-5\" />\n <path d=\"M3 16v5h5\" />\n <path d=\"m3 21 6-6\" />\n <path d=\"M3 8V3h5\" />\n <path d=\"M9 9 3 3\" />\n </svg>\n );\n}\n\n/** lucide `eye` (moved from @ai-matrx/agents). */\nexport function EyeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"eye\", props)}>\n <path d=\"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n );\n}\n\n/** lucide `file-archive` (moved from @ai-matrx/content-ir). */\nexport function FileArchiveIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-archive\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M10 6h1\" />\n <path d=\"M10 10h1\" />\n <circle cx=\"10\" cy=\"16\" r=\"2\" />\n <path d=\"M10 2v12\" />\n </svg>\n );\n}\n\n/** lucide `file-audio` (moved from @ai-matrx/media). */\nexport function FileAudioIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-audio\", props)}>\n <path d=\"M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0\" />\n </svg>\n );\n}\n\n/** lucide `file-code` (moved from @ai-matrx/media). */\nexport function FileCodeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-code\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M10 12.5 8 15l2 2.5\" />\n <path d=\"m14 12.5 2 2.5-2 2.5\" />\n </svg>\n );\n}\n\n/** lucide `file-json` (moved from @ai-matrx/media). */\nexport function FileJsonIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-json\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1\" />\n <path d=\"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1\" />\n </svg>\n );\n}\n\n/** lucide `file` (moved from @ai-matrx/media). */\nexport function FilePageIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n </svg>\n );\n}\n\n/** lucide `file-plus` (moved from @ai-matrx/content-ir). */\nexport function FilePlusIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-plus\", props)}>\n <path d=\"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4\" />\n <path d=\"M14 2v4a2 2 0 0 0 2 2h4\" />\n <path d=\"M3 15h6\" />\n <path d=\"M6 12v6\" />\n </svg>\n );\n}\n\n/** lucide `file-spreadsheet` (moved from @ai-matrx/media). */\nexport function FileSpreadsheetIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-spreadsheet\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M8 13h2\" />\n <path d=\"M14 13h2\" />\n <path d=\"M8 17h2\" />\n <path d=\"M14 17h2\" />\n </svg>\n );\n}\n\n/** lucide `file-text` (moved from @ai-matrx/media). */\nexport function FileTextIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-text\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M10 9H8\" />\n <path d=\"M16 13H8\" />\n <path d=\"M16 17H8\" />\n </svg>\n );\n}\n\n/** lucide `file-type` (moved from @ai-matrx/media). */\nexport function FileTypeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-type\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M11 18h2\" />\n <path d=\"M12 12v6\" />\n <path d=\"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5\" />\n </svg>\n );\n}\n\n/** lucide `file-video` (moved from @ai-matrx/media). */\nexport function FileVideoIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"file-video\", props)}>\n <path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z\" />\n </svg>\n );\n}\n\n/** lucide `film` (moved from @ai-matrx/content-ir). */\nexport function FilmIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"film\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M7 3v18\" />\n <path d=\"M3 7.5h4\" />\n <path d=\"M3 12h18\" />\n <path d=\"M3 16.5h4\" />\n <path d=\"M17 3v18\" />\n <path d=\"M17 7.5h4\" />\n <path d=\"M17 16.5h4\" />\n </svg>\n );\n}\n\n/** lucide `flag` (moved from @ai-matrx/meet). */\nexport function FlagIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"flag\", props)}>\n <path d=\"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z\" />\n <line x1=\"4\" x2=\"4\" y1=\"22\" y2=\"15\" />\n </svg>\n );\n}\n\n/** lucide `flip-horizontal-2` (moved from @ai-matrx/capture). */\nexport function FlipHorizontal2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"flip-horizontal-2\", props)}>\n <path d=\"m3 7 5 5-5 5V7\" />\n <path d=\"m21 7-5 5 5 5V7\" />\n <path d=\"M12 20v2\" />\n <path d=\"M12 14v2\" />\n <path d=\"M12 8v2\" />\n <path d=\"M12 2v2\" />\n </svg>\n );\n}\n\n/** lucide `fold-vertical` (moved from @ai-matrx/diff). */\nexport function FoldVerticalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"fold-vertical\", props)}>\n <path d=\"M12 22v-6\" />\n <path d=\"M12 8V2\" />\n <path d=\"M4 12H2\" />\n <path d=\"M10 12H8\" />\n <path d=\"M16 12h-2\" />\n <path d=\"M22 12h-2\" />\n <path d=\"m15 19-3-3-3 3\" />\n <path d=\"m15 5-3 3-3-3\" />\n </svg>\n );\n}\n\n/** lucide `folder` (moved from @ai-matrx/media). */\nexport function FolderIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"folder\", props)}>\n <path d=\"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z\" />\n </svg>\n );\n}\n\n/** lucide `folder-open` (moved from @ai-matrx/media). */\nexport function FolderOpenIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"folder-open\", props)}>\n <path d=\"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2\" />\n </svg>\n );\n}\n\n/** lucide `git-merge` (moved from @ai-matrx/diff). */\nexport function GitMergeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"git-merge\", props)}>\n <circle cx=\"18\" cy=\"18\" r=\"3\" />\n <circle cx=\"6\" cy=\"6\" r=\"3\" />\n <path d=\"M6 21V9a9 9 0 0 0 9 9\" />\n </svg>\n );\n}\n\n/** lucide `graduation-cap` (moved from @ai-matrx/office). */\nexport function GraduationCapIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"graduation-cap\", props)}>\n <path d=\"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z\" />\n <path d=\"M22 10v6\" />\n <path d=\"M6 12.5V16a6 3 0 0 0 12 0v-3.5\" />\n </svg>\n );\n}\n\n/** lucide `grid-3x-3` (moved from @ai-matrx/capture). */\nexport function Grid3x3Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"grid-3x-3\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M3 9h18\" />\n <path d=\"M3 15h18\" />\n <path d=\"M9 3v18\" />\n <path d=\"M15 3v18\" />\n </svg>\n );\n}\n\n/** lucide `grip` (moved from @ai-matrx/capture). */\nexport function GripIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"grip\", props)}>\n <circle cx=\"12\" cy=\"5\" r=\"1\" />\n <circle cx=\"19\" cy=\"5\" r=\"1\" />\n <circle cx=\"5\" cy=\"5\" r=\"1\" />\n <circle cx=\"12\" cy=\"12\" r=\"1\" />\n <circle cx=\"19\" cy=\"12\" r=\"1\" />\n <circle cx=\"5\" cy=\"12\" r=\"1\" />\n <circle cx=\"12\" cy=\"19\" r=\"1\" />\n <circle cx=\"19\" cy=\"19\" r=\"1\" />\n <circle cx=\"5\" cy=\"19\" r=\"1\" />\n </svg>\n );\n}\n\n/** lucide `grip-resize` (moved from @ai-matrx/associations). */\nexport function GripResizeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"grip-resize\", props)}>\n <path d=\"M21 15 15 21\" />\n <path d=\"M21 20 20 21\" />\n </svg>\n );\n}\n\n/** lucide `hammer` (moved from @ai-matrx/agents). */\nexport function HammerIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"hammer\", props)}>\n <path d=\"m15 12-8.5 8.5c-.83.83-2.17.83-3 0 0 0 0 0 0 0a2.12 2.12 0 0 1 0-3L12 9\" />\n <path d=\"M17.64 15 22 10.64\" />\n <path d=\"m20.91 11.7-1.25-1.25c-.6-.6-.93-1.4-.93-2.25v-.86L16.01 4.6a5.56 5.56 0 0 0-3.94-1.64H9l.92.82A6.18 6.18 0 0 1 12 8.4v1.56l2 2h2.47l2.26 1.91\" />\n </svg>\n );\n}\n\n/** lucide `hand` (moved from @ai-matrx/meet). */\nexport function HandIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"hand\", props)}>\n <path d=\"M18 11V6a2 2 0 0 0-4 0v5\" />\n <path d=\"M14 10V4a2 2 0 0 0-4 0v7\" />\n <path d=\"M10 10.5V6a2 2 0 0 0-4 0v8\" />\n <path d=\"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2a8 8 0 0 1-8-8v-1a2 2 0 1 1 4 0\" />\n </svg>\n );\n}\n\n/** lucide `handoff` (moved from @ai-matrx/coding-sessions). */\nexport function HandoffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"handoff\", props)}>\n <path d=\"M5 12h12M13 7l5 5-5 5\" />\n <path d=\"M5 5v14\" />\n </svg>\n );\n}\n\n/** lucide `hash` (moved from @ai-matrx/diff). */\nexport function HashIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"hash\", props)}>\n <path d=\"M4 9h16\" />\n <path d=\"M4 15h16\" />\n <path d=\"M10 3 8 21\" />\n <path d=\"M16 3l-2 18\" />\n </svg>\n );\n}\n\n/** lucide `highlighter` (moved from @ai-matrx/diff). */\nexport function HighlighterIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"highlighter\", props)}>\n <path d=\"m9 11-6 6v3h9l3-3\" />\n <path d=\"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4\" />\n </svg>\n );\n}\n\n/** lucide `image` (moved from @ai-matrx/media). */\nexport function ImageIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"image\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" ry=\"2\" />\n <circle cx=\"9\" cy=\"9\" r=\"2\" />\n <path d=\"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21\" />\n </svg>\n );\n}\n\n/** lucide `image-off` (moved from @ai-matrx/media). */\nexport function ImageOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"image-off\", props)}>\n <line x1=\"2\" x2=\"22\" y1=\"2\" y2=\"22\" />\n <path d=\"M10.41 10.41a2 2 0 1 1-2.83-2.83\" />\n <line x1=\"13.5\" x2=\"6\" y1=\"13.5\" y2=\"21\" />\n <line x1=\"18\" x2=\"21\" y1=\"12\" y2=\"15\" />\n <path d=\"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59\" />\n <path d=\"M21 15V5a2 2 0 0 0-2-2H9\" />\n </svg>\n );\n}\n\n/** lucide `images` (moved from @ai-matrx/capture). */\nexport function ImagesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"images\", props)}>\n <path d=\"m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16\" />\n <path d=\"M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2\" />\n <circle cx=\"13\" cy=\"7\" r=\"1\" fill=\"currentColor\" />\n <rect x=\"8\" y=\"2\" width=\"14\" height=\"14\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `keyboard` (moved from @ai-matrx/meet). */\nexport function KeyboardIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"keyboard\", props)}>\n <path d=\"M10 8h.01M12 12h.01M14 8h.01M16 12h.01M18 8h.01M6 8h.01M7 16h10M8 12h.01\" />\n <rect width=\"20\" height=\"16\" x=\"2\" y=\"4\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `languages` (moved from @ai-matrx/agents). */\nexport function LanguagesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"languages\", props)}>\n <path d=\"m5 8 6 6\" />\n <path d=\"m4 14 6-6 2-3\" />\n <path d=\"M2 5h12\" />\n <path d=\"M7 2h1\" />\n <path d=\"m22 22-5-10-5 10\" />\n <path d=\"M14 18h6\" />\n </svg>\n );\n}\n\n/** lucide `layers` (moved from @ai-matrx/agents). */\nexport function LayersIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"layers\", props)}>\n <path d=\"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z\" />\n <path d=\"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12\" />\n <path d=\"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17\" />\n </svg>\n );\n}\n\n/** lucide `layout-grid` (moved from @ai-matrx/canvas). */\nexport function LayoutGridIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"layout-grid\", props)}>\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"14\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"14\" rx=\"1\" />\n </svg>\n );\n}\n\n/** lucide `link-2` (moved from @ai-matrx/media). */\nexport function Link2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"link-2\", props)}>\n <path d=\"M9 17H7A5 5 0 0 1 7 7h2\" />\n <path d=\"M15 7h2a5 5 0 1 1 0 10h-2\" />\n <line x1=\"8\" x2=\"16\" y1=\"12\" y2=\"12\" />\n </svg>\n );\n}\n\n/** lucide `list-checks` (moved from @ai-matrx/diff). */\nexport function ListChecksIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"list-checks\", props)}>\n <path d=\"m3 17 2 2 4-4\" />\n <path d=\"m3 7 2 2 4-4\" />\n <path d=\"M13 6h8\" />\n <path d=\"M13 12h8\" />\n <path d=\"M13 18h8\" />\n </svg>\n );\n}\n\n/** lucide `list` (moved from @ai-matrx/diff). */\nexport function ListIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"list\", props)}>\n <path d=\"M3 12h.01\" />\n <path d=\"M3 18h.01\" />\n <path d=\"M3 6h.01\" />\n <path d=\"M8 12h13\" />\n <path d=\"M8 18h13\" />\n <path d=\"M8 6h13\" />\n </svg>\n );\n}\n\n/** lucide `maximize` (moved from @ai-matrx/content-ir). */\nexport function MaximizeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"maximize\", props)}>\n <polyline points=\"15 3 21 3 21 9\" />\n <polyline points=\"9 21 3 21 3 15\" />\n <line x1=\"21\" x2=\"14\" y1=\"3\" y2=\"10\" />\n <line x1=\"3\" x2=\"10\" y1=\"21\" y2=\"14\" />\n </svg>\n );\n}\n\n/** lucide `megaphone` (moved from @ai-matrx/office). */\nexport function MegaphoneIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"megaphone\", props)}>\n <path d=\"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z\" />\n <path d=\"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14\" />\n <path d=\"M8 6v8\" />\n </svg>\n );\n}\n\n/** lucide `message-square-warning` (moved from @ai-matrx/office). */\nexport function MessageSquareWarningIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"message-square-warning\", props)}>\n <path d=\"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z\" />\n <path d=\"M12 15h.01\" />\n <path d=\"M12 7v4\" />\n </svg>\n );\n}\n\n/** lucide `mic` (moved from @ai-matrx/meet). */\nexport function MicIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"mic\", props)}>\n <path d=\"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z\" />\n <path d=\"M19 10v2a7 7 0 0 1-14 0v-2\" />\n <path d=\"M12 19v3\" />\n </svg>\n );\n}\n\n/** lucide `mic-off` (moved from @ai-matrx/meet). */\nexport function MicOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"mic-off\", props)}>\n <path d=\"M2 2l20 20\" />\n <path d=\"M9 9v3a3 3 0 0 0 5.12 2.12\" />\n <path d=\"M15 9.34V5a3 3 0 0 0-5.94-.6\" />\n <path d=\"M19 10v2a7 7 0 0 1-.11 1.23M5 10v2a7 7 0 0 0 11 5.66\" />\n <path d=\"M12 19v3\" />\n </svg>\n );\n}\n\n/** lucide `monitor` (moved from @ai-matrx/coding-sessions). */\nexport function MonitorIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"monitor\", props)}>\n <rect x=\"3\" y=\"4.5\" width=\"18\" height=\"12\" rx=\"2\" />\n <path d=\"M8.5 20h7M12 16.5V20\" />\n </svg>\n );\n}\n\n/** lucide `moon` (moved from @ai-matrx/coding-sessions). */\nexport function MoonIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"moon\", props)}>\n <path d=\"M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5z\" />\n </svg>\n );\n}\n\n/** lucide `music` (moved from @ai-matrx/media). */\nexport function MusicIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"music\", props)}>\n <path d=\"M9 18V5l12-2v13\" />\n <circle cx=\"6\" cy=\"18\" r=\"3\" />\n <circle cx=\"18\" cy=\"16\" r=\"3\" />\n </svg>\n );\n}\n\n/** lucide `notes` (moved from @ai-matrx/meet). */\nexport function NotesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"notes\", props)}>\n <path d=\"M4 20l1-4L16.5 4.5a2.1 2.1 0 0 1 3 3L8 19l-4 1Z\" />\n <path d=\"M14 7l3 3\" />\n </svg>\n );\n}\n\n/** lucide `package-box` (moved from @ai-matrx/media). */\nexport function PackageBoxIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"package-box\", props)}>\n <path d=\"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z\" />\n <path d=\"M12 22V12\" />\n <polyline points=\"3.29 7 12 12 20.71 7\" />\n <path d=\"m7.5 4.27 9 5.15\" />\n </svg>\n );\n}\n\n/** lucide `page` (moved from @ai-matrx/canvas). */\nexport function PageIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"page\", props)}>\n <rect x=\"4\" y=\"4\" width=\"16\" height=\"16\" rx=\"2\" />\n <path d=\"M8 9h8\" />\n <path d=\"M8 13h8\" />\n <path d=\"M8 17h5\" />\n </svg>\n );\n}\n\n/** lucide `panel-left-close` (moved from @ai-matrx/summon). */\nexport function PanelLeftCloseIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"panel-left-close\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M9 3v18\" />\n <path d=\"m16 15-3-3 3-3\" />\n </svg>\n );\n}\n\n/** lucide `pause` (moved from @ai-matrx/media). */\nexport function PauseIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"pause\", props)}>\n <rect x=\"14\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n <rect x=\"5\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n </svg>\n );\n}\n\n/** lucide `pen-tool` (moved from @ai-matrx/media). */\nexport function PenToolIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"pen-tool\", props)}>\n <path d=\"M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z\" />\n <path d=\"m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18\" />\n <path d=\"m2.3 2.3 7.286 7.286\" />\n <circle cx=\"11\" cy=\"11\" r=\"2\" />\n </svg>\n );\n}\n\n/** lucide `people` (moved from @ai-matrx/meet). */\nexport function PeopleIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"people\", props)}>\n <path d=\"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\" />\n <circle cx=\"9\" cy=\"7\" r=\"4\" />\n <path d=\"M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75\" />\n </svg>\n );\n}\n\n/** lucide `phone-off` (moved from @ai-matrx/meet). */\nexport function PhoneOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"phone-off\", props)}>\n <path d=\"M12 9c-1.6 0-3.15.25-4.6.72v3.1c0 .39-.23.74-.56.9-.98.49-1.87 1.12-2.66 1.85-.18.18-.43.28-.7.28-.28 0-.53-.11-.71-.29L.29 13.08a.99.99 0 0 1-.29-.7c0-.28.11-.53.29-.71C3.34 8.78 7.46 7 12 7s8.66 1.78 11.71 4.67c.18.18.29.43.29.71 0 .28-.11.53-.29.71l-2.48 2.48c-.18.18-.43.29-.71.29-.27 0-.52-.11-.7-.28a11.27 11.27 0 0 0-2.67-1.85.996.996 0 0 1-.56-.9v-3.1C15.15 9.25 13.6 9 12 9Z\" fill=\"currentColor\" stroke=\"none\" />\n </svg>\n );\n}\n\n/** lucide `play` (moved from @ai-matrx/media). */\nexport function PlayIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"play\", props)}>\n <path d=\"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z\" />\n </svg>\n );\n}\n\n/** lucide `poll` (moved from @ai-matrx/meet). */\nexport function PollIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"poll\", props)}>\n <line x1=\"18\" x2=\"18\" y1=\"20\" y2=\"10\" />\n <line x1=\"12\" x2=\"12\" y1=\"20\" y2=\"4\" />\n <line x1=\"6\" x2=\"6\" y1=\"20\" y2=\"14\" />\n </svg>\n );\n}\n\n/** lucide `proportions` (moved from @ai-matrx/capture). */\nexport function ProportionsIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"proportions\", props)}>\n <rect width=\"20\" height=\"16\" x=\"2\" y=\"4\" rx=\"2\" />\n <path d=\"M12 9v11\" />\n <path d=\"M2 9h13a2 2 0 0 1 2 2v9\" />\n </svg>\n );\n}\n\n/** lucide `puzzle` (moved from @ai-matrx/office). */\nexport function PuzzleIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"puzzle\", props)}>\n <path d=\"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z\" />\n </svg>\n );\n}\n\n/** lucide `question` (moved from @ai-matrx/meet). */\nexport function QuestionIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"question\", props)}>\n <path d=\"M7.9 20A9 9 0 1 0 4 16.1L2 22Z\" />\n <path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" />\n <path d=\"M12 17h.01\" />\n </svg>\n );\n}\n\n/** lucide `record` (moved from @ai-matrx/meet). */\nexport function RecordIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"record\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"8\" fill=\"currentColor\" stroke=\"none\" />\n </svg>\n );\n}\n\n/** lucide `rectangle-vertical` (moved from @ai-matrx/summon). */\nexport function RectangleVerticalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"rectangle-vertical\", props)}>\n <rect width=\"12\" height=\"20\" x=\"6\" y=\"2\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `restore` (moved from @ai-matrx/associations). */\nexport function RestoreIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"restore\", props)}>\n <path d=\"M4 14h6v6\" />\n <path d=\"M20 10h-6V4\" />\n <path d=\"M14 10l7-7\" />\n <path d=\"M3 21l7-7\" />\n </svg>\n );\n}\n\n/** lucide `rotate-ccw` (moved from @ai-matrx/capture). */\nexport function RotateCcwIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"rotate-ccw\", props)}>\n <path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\" />\n <path d=\"M3 3v5h5\" />\n </svg>\n );\n}\n\n/** lucide `rows-3` (moved from @ai-matrx/diff). */\nexport function Rows3Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"rows-3\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M21 9H3\" />\n <path d=\"M21 15H3\" />\n </svg>\n );\n}\n\n/** lucide `save` (moved from @ai-matrx/summon). */\nexport function SaveIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"save\", props)}>\n <path d=\"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z\" />\n <path d=\"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7\" />\n <path d=\"M7 3v4a1 1 0 0 0 1 1h7\" />\n </svg>\n );\n}\n\n/** lucide `scale` (moved from @ai-matrx/agents). */\nexport function ScaleIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"scale\", props)}>\n <path d=\"M12 3v18\" />\n <path d=\"m19 8 3 8a5 5 0 0 1-6 0zV7\" />\n <path d=\"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1\" />\n <path d=\"m5 8 3 8a5 5 0 0 1-6 0zV7\" />\n <path d=\"M7 21h10\" />\n </svg>\n );\n}\n\n/** lucide `screen-share` (moved from @ai-matrx/meet). */\nexport function ScreenShareIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"screen-share\", props)}>\n <rect x=\"2\" y=\"3\" width=\"20\" height=\"14\" rx=\"2\" />\n <path d=\"M8 21h8M12 17v4\" />\n <path d=\"M12 13V8m0 0-2.5 2.5M12 8l2.5 2.5\" />\n </svg>\n );\n}\n\n/** lucide `server` (moved from @ai-matrx/agents). */\nexport function ServerIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"server\", props)}>\n <rect width=\"20\" height=\"8\" x=\"2\" y=\"2\" rx=\"2\" ry=\"2\" />\n <rect width=\"20\" height=\"8\" x=\"2\" y=\"14\" rx=\"2\" ry=\"2\" />\n <line x1=\"6\" x2=\"6.01\" y1=\"6\" y2=\"6\" />\n <line x1=\"6\" x2=\"6.01\" y1=\"18\" y2=\"18\" />\n </svg>\n );\n}\n\n/** lucide `settings-2` (moved from @ai-matrx/media). */\nexport function Settings2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"settings-2\", props)}>\n <path d=\"M20 7h-9\" />\n <path d=\"M14 17H5\" />\n <circle cx=\"17\" cy=\"17\" r=\"3\" />\n <circle cx=\"7\" cy=\"7\" r=\"3\" />\n </svg>\n );\n}\n\n/** lucide `share-2` (moved from @ai-matrx/media). */\nexport function Share2Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"share-2\", props)}>\n <circle cx=\"18\" cy=\"5\" r=\"3\" />\n <circle cx=\"6\" cy=\"12\" r=\"3\" />\n <circle cx=\"18\" cy=\"19\" r=\"3\" />\n <line x1=\"8.59\" x2=\"15.42\" y1=\"13.51\" y2=\"17.49\" />\n <line x1=\"15.41\" x2=\"8.59\" y1=\"6.51\" y2=\"10.49\" />\n </svg>\n );\n}\n\n/** lucide `shield-alert` (moved from @ai-matrx/detail). */\nexport function ShieldAlertIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"shield-alert\", props)}>\n <path d=\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\" />\n <path d=\"M12 8v4\" />\n <path d=\"M12 16h.01\" />\n </svg>\n );\n}\n\n/** lucide `shield-check` (moved from @ai-matrx/detail). */\nexport function ShieldCheckIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"shield-check\", props)}>\n <path d=\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\" />\n <path d=\"m9 12 2 2 4-4\" />\n </svg>\n );\n}\n\n/** lucide `badge-check` — the verified mark. */\nexport function BadgeCheckIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"badge-check\", props)}>\n <path d=\"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z\" />\n <path d=\"m9 12 2 2 4-4\" />\n </svg>\n );\n}\n\n/** lucide `shield` (moved from @ai-matrx/agents). */\nexport function ShieldIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"shield\", props)}>\n <path d=\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\" />\n </svg>\n );\n}\n\n/** lucide `sidebar` (moved from @ai-matrx/coding-sessions). */\nexport function SidebarIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sidebar\", props)}>\n <rect x=\"3.5\" y=\"4.5\" width=\"17\" height=\"15\" rx=\"2.5\" />\n <path d=\"M9.5 4.5v15\" />\n </svg>\n );\n}\n\n/** lucide `sliders-horizontal` (moved from @ai-matrx/agents). */\nexport function SlidersHorizontalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sliders-horizontal\", props)}>\n <path d=\"M10 5H3\" />\n <path d=\"M12 19H3\" />\n <path d=\"M14 3v4\" />\n <path d=\"M16 17v4\" />\n <path d=\"M21 12h-9\" />\n <path d=\"M21 19h-5\" />\n <path d=\"M21 5h-7\" />\n <path d=\"M8 10v4\" />\n <path d=\"M8 12H3\" />\n </svg>\n );\n}\n\n/** lucide `smile` (moved from @ai-matrx/meet). */\nexport function SmileIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"smile\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M8 14s1.5 2 4 2 4-2 4-2\" />\n <line x1=\"9\" x2=\"9.01\" y1=\"9\" y2=\"9\" />\n <line x1=\"15\" x2=\"15.01\" y1=\"9\" y2=\"9\" />\n </svg>\n );\n}\n\n/** lucide `speaker` (moved from @ai-matrx/meet). */\nexport function SpeakerIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"speaker\", props)}>\n <path d=\"M11 5 6 9H2v6h4l5 4V5Z\" />\n <path d=\"M15.54 8.46a5 5 0 0 1 0 7.07\" />\n <path d=\"M19.07 4.93a10 10 0 0 1 0 14.14\" />\n </svg>\n );\n}\n\n/** lucide `split-down` (moved from @ai-matrx/canvas). */\nexport function SplitDownIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"split-down\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M3 12h18\" />\n </svg>\n );\n}\n\n/** lucide `spotlight` (moved from @ai-matrx/meet). */\nexport function SpotlightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"spotlight\", props)}>\n <path d=\"M12 2 15 8.5 22 9.3 17 14 18.2 21 12 17.6 5.8 21 7 14 2 9.3 9 8.5Z\" />\n </svg>\n );\n}\n\n/** lucide `stop` (moved from @ai-matrx/coding-sessions). */\nexport function StopIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"stop\", props)}>\n <rect x=\"6\" y=\"6\" width=\"12\" height=\"12\" rx=\"2\" fill=\"currentColor\" stroke=\"none\" />\n </svg>\n );\n}\n\n/** lucide `subtitles` (moved from @ai-matrx/media). */\nexport function SubtitlesIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"subtitles\", props)}>\n <rect width=\"18\" height=\"14\" x=\"3\" y=\"5\" rx=\"2\" ry=\"2\" />\n <path d=\"M7 15h4M15 15h2M7 11h2M13 11h4\" />\n </svg>\n );\n}\n\n/** lucide `sun` (moved from @ai-matrx/coding-sessions). */\nexport function SunIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sun\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d=\"M12 2.5v2M12 19.5v2M4.2 4.2l1.4 1.4M18.4 18.4l1.4 1.4M2.5 12h2M19.5 12h2M4.2 19.8l1.4-1.4M18.4 5.6l1.4-1.4\" />\n </svg>\n );\n}\n\n/** lucide `sun-medium` (moved from @ai-matrx/capture). */\nexport function SunMediumIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sun-medium\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d=\"M12 3v1\" />\n <path d=\"M12 20v1\" />\n <path d=\"M3 12h1\" />\n <path d=\"M20 12h1\" />\n <path d=\"m18.364 5.636-.707.707\" />\n <path d=\"m6.343 17.657-.707.707\" />\n <path d=\"m5.636 5.636.707.707\" />\n <path d=\"m17.657 17.657.707.707\" />\n </svg>\n );\n}\n\n/** lucide `tag` (moved from @ai-matrx/associations). */\nexport function TagIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"tag\", props)}>\n <path d=\"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z\" />\n <circle cx=\"7.5\" cy=\"7.5\" r=\".5\" fill=\"currentColor\" />\n </svg>\n );\n}\n\n/** lucide `timer` (moved from @ai-matrx/capture). */\nexport function TimerIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"timer\", props)}>\n <line x1=\"10\" x2=\"14\" y1=\"2\" y2=\"2\" />\n <line x1=\"12\" x2=\"15\" y1=\"14\" y2=\"11\" />\n <circle cx=\"12\" cy=\"14\" r=\"8\" />\n </svg>\n );\n}\n\n/** lucide `type` (moved from @ai-matrx/agents). */\nexport function TypeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"type\", props)}>\n <path d=\"M12 4v16\" />\n <path d=\"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2\" />\n <path d=\"M9 20h6\" />\n </svg>\n );\n}\n\n/** lucide `unfold-vertical` (moved from @ai-matrx/diff). */\nexport function UnfoldVerticalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"unfold-vertical\", props)}>\n <path d=\"M12 22v-6\" />\n <path d=\"M12 8V2\" />\n <path d=\"M4 12H2\" />\n <path d=\"M10 12H8\" />\n <path d=\"M16 12h-2\" />\n <path d=\"M22 12h-2\" />\n <path d=\"m15 19-3 3-3-3\" />\n <path d=\"m15 5-3-3-3 3\" />\n </svg>\n );\n}\n\n/** lucide `unlink` (moved from @ai-matrx/agents). */\nexport function UnlinkIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"unlink\", props)}>\n <path d=\"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71\" />\n <path d=\"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71\" />\n <line x1=\"8\" x2=\"8\" y1=\"2\" y2=\"5\" />\n <line x1=\"2\" x2=\"5\" y1=\"8\" y2=\"8\" />\n <line x1=\"16\" x2=\"16\" y1=\"19\" y2=\"22\" />\n <line x1=\"19\" x2=\"22\" y1=\"16\" y2=\"16\" />\n </svg>\n );\n}\n\n/** lucide `upvote` (moved from @ai-matrx/meet). */\nexport function UpvoteIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"upvote\", props)}>\n <path d=\"M9 18v-6H5l7-7 7 7h-4v6H9z\" />\n </svg>\n );\n}\n\n/** lucide `variable` (moved from @ai-matrx/agents). */\nexport function VariableIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"variable\", props)}>\n <path d=\"M8 21s-4-3-4-9 4-9 4-9\" />\n <path d=\"M16 3s4 3 4 9-4 9-4 9\" />\n <line x1=\"15\" x2=\"9\" y1=\"9\" y2=\"15\" />\n <line x1=\"9\" x2=\"15\" y1=\"9\" y2=\"15\" />\n </svg>\n );\n}\n\n/** lucide `video-off` (moved from @ai-matrx/media). */\nexport function VideoOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"video-off\", props)}>\n <path d=\"M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196\" />\n <path d=\"M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2\" />\n <path d=\"m2 2 20 20\" />\n </svg>\n );\n}\n\n/** lucide `volume-x` (moved from @ai-matrx/media). */\nexport function VolumeXIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"volume-x\", props)}>\n <path d=\"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\" />\n <line x1=\"22\" x2=\"16\" y1=\"9\" y2=\"15\" />\n <line x1=\"16\" x2=\"22\" y1=\"9\" y2=\"15\" />\n </svg>\n );\n}\n\n/** lucide `webhook` (moved from @ai-matrx/agents). */\nexport function WebhookIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"webhook\", props)}>\n <path d=\"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2\" />\n <path d=\"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06\" />\n <path d=\"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8\" />\n </svg>\n );\n}\n\n/** lucide `whiteboard` (moved from @ai-matrx/meet). */\nexport function WhiteboardIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"whiteboard\", props)}>\n <path d=\"M2 3h20\" />\n <path d=\"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3\" />\n <path d=\"m7 21 5-5 5 5\" />\n </svg>\n );\n}\n\n/** lucide `wifi-low` (moved from @ai-matrx/meet). */\nexport function WifiLowIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"wifi-low\", props)}>\n <path d=\"M12 20h.01\" />\n <path d=\"M8.5 16.5a5 5 0 0 1 7 0\" />\n </svg>\n );\n}\n\n/** lucide `wrap-text` (moved from @ai-matrx/diff). */\nexport function WrapTextIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"wrap-text\", props)}>\n <path d=\"M3 6h18\" />\n <path d=\"M3 12h15a3 3 0 1 1 0 6h-4\" />\n <path d=\"m16 16-2 2 2 2\" />\n <path d=\"M3 18h7\" />\n </svg>\n );\n}\n\n/** lucide `wrench` (moved from @ai-matrx/agents). */\nexport function WrenchIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"wrench\", props)}>\n <path d=\"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z\" />\n </svg>\n );\n}\n\n/** lucide `youtube` (moved from @ai-matrx/agents). */\nexport function YoutubeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"youtube\", props)}>\n <path d=\"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17\" />\n <path d=\"m10 15 5-3-5-3z\" />\n </svg>\n );\n}\n\n/** lucide `zap` (moved from @ai-matrx/capture). */\nexport function ZapIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"zap\", props)}>\n <path d=\"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z\" />\n </svg>\n );\n}\n\n/** lucide `zap-off` (moved from @ai-matrx/capture). */\nexport function ZapOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"zap-off\", props)}>\n <path d=\"M10.513 4.856 13.12 2.17a.5.5 0 0 1 .86.46l-1.377 4.317\" />\n <path d=\"M15.656 10H20a1 1 0 0 1 .78 1.63l-1.72 1.773\" />\n <path d=\"M16.273 16.273 10.88 21.83a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14H4a1 1 0 0 1-.78-1.63l4.507-4.643\" />\n <path d=\"m2 2 20 20\" />\n </svg>\n );\n}\n\n/** lucide `log-in` — the sign-in action of the auth gate. */\nexport function LogInIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"log-in\", props)}>\n <path d=\"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4\" />\n <polyline points=\"10 17 15 12 10 7\" />\n <line x1=\"15\" x2=\"3\" y1=\"12\" y2=\"12\" />\n </svg>\n );\n}\n\n/** lucide `gem` — the create-account action of the auth gate. */\nexport function GemIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"gem\", props)}>\n <path d=\"M6 3h12l4 6-10 13L2 9Z\" />\n <path d=\"M11 3 8 9l4 13 4-13-3-6\" />\n <path d=\"M2 9h20\" />\n </svg>\n );\n}\n\n/** lucide `key`. */\nexport function KeyIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"key\", props)}>\n <path d=\"m2 21 9.6-9.6\" />\n <path d=\"m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19\" />\n <circle cx=\"15.5\" cy=\"7.5\" r=\"5.5\" />\n </svg>\n );\n}\n\n/** lucide `credit-card`. */\nexport function CreditCardIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"credit-card\", props)}>\n <rect width=\"20\" height=\"14\" x=\"2\" y=\"5\" rx=\"2\" />\n <line x1=\"2\" x2=\"22\" y1=\"10\" y2=\"10\" />\n <path d=\"M6 14h2\" />\n </svg>\n );\n}\n\n/** lucide `user-round`. */\nexport function UserRoundIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"user-round\", props)}>\n <circle cx=\"12\" cy=\"8\" r=\"5\" />\n <path d=\"M20 21a8 8 0 0 0-16 0\" />\n </svg>\n );\n}\n\n/** lucide `user`. */\nexport function UserIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"user\", props)}>\n <path d=\"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\" />\n <circle cx=\"12\" cy=\"7\" r=\"4\" />\n </svg>\n );\n}\n\n/** lucide `terminal`. */\nexport function TerminalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"terminal\", props)}>\n <path d=\"M12 19h8\" />\n <path d=\"m4 17 6-6-6-6\" />\n </svg>\n );\n}\n\n/** lucide `trash`. */\nexport function TrashIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"trash\", props)}>\n <path d=\"M10 11v6\" />\n <path d=\"M14 11v6\" />\n <path d=\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\" />\n <path d=\"M3 6h18\" />\n <path d=\"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\" />\n </svg>\n );\n}\n\n/** lucide `building`. */\nexport function BuildingIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"building\", props)}>\n <path d=\"M12 10h.01\" />\n <path d=\"M12 14h.01\" />\n <path d=\"M12 6h.01\" />\n <path d=\"M16 10h.01\" />\n <path d=\"M16 14h.01\" />\n <path d=\"M16 6h.01\" />\n <path d=\"M8 10h.01\" />\n <path d=\"M8 14h.01\" />\n <path d=\"M8 6h.01\" />\n <path d=\"M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3\" />\n <rect x=\"4\" y=\"2\" width=\"16\" height=\"20\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `plug`. */\nexport function PlugIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"plug\", props)}>\n <path d=\"M12 22v-5\" />\n <path d=\"M15 8V2\" />\n <path d=\"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z\" />\n <path d=\"M9 8V2\" />\n </svg>\n );\n}\n\n/** lucide `share`. */\nexport function ShareIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"share\", props)}>\n <path d=\"M12 2v13\" />\n <path d=\"m16 6-4-4-4 4\" />\n <path d=\"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8\" />\n </svg>\n );\n}\n\n/** lucide `arrow-up-down`. */\nexport function ArrowUpDownIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-up-down\", props)}>\n <path d=\"m21 16-4 4-4-4\" />\n <path d=\"M17 20V4\" />\n <path d=\"m3 8 4-4 4 4\" />\n <path d=\"M7 4v16\" />\n </svg>\n );\n}\n\n/** lucide `move`. */\nexport function MoveIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"move\", props)}>\n <path d=\"M12 2v20\" />\n <path d=\"m15 19-3 3-3-3\" />\n <path d=\"m19 9 3 3-3 3\" />\n <path d=\"M2 12h20\" />\n <path d=\"m5 9-3 3 3 3\" />\n <path d=\"m9 5 3-3 3 3\" />\n </svg>\n );\n}\n\n/** lucide `qr-code`. */\nexport function QrCodeIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"qr-code\", props)}>\n <rect width=\"5\" height=\"5\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"5\" height=\"5\" x=\"16\" y=\"3\" rx=\"1\" />\n <rect width=\"5\" height=\"5\" x=\"3\" y=\"16\" rx=\"1\" />\n <path d=\"M21 16h-3a2 2 0 0 0-2 2v3\" />\n <path d=\"M21 21v.01\" />\n <path d=\"M12 7v3a2 2 0 0 1-2 2H7\" />\n <path d=\"M3 12h.01\" />\n <path d=\"M12 3h.01\" />\n <path d=\"M12 16v.01\" />\n <path d=\"M16 12h1\" />\n <path d=\"M21 12v.01\" />\n <path d=\"M12 21v-1\" />\n </svg>\n );\n}\n\n/** lucide `power`. */\nexport function PowerIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"power\", props)}>\n <path d=\"M12 2v10\" />\n <path d=\"M18.4 6.6a9 9 0 1 1-12.77.04\" />\n </svg>\n );\n}\n\n/** lucide `sliders-vertical`. */\nexport function SlidersVerticalIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"sliders-vertical\", props)}>\n <path d=\"M10 8h4\" />\n <path d=\"M12 21v-9\" />\n <path d=\"M12 8V3\" />\n <path d=\"M17 16h4\" />\n <path d=\"M19 12V3\" />\n <path d=\"M19 21v-5\" />\n <path d=\"M3 14h4\" />\n <path d=\"M5 10V3\" />\n <path d=\"M5 21v-7\" />\n </svg>\n );\n}\n\n/** lucide `fingerprint-pattern`. */\nexport function FingerprintPatternIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"fingerprint-pattern\", props)}>\n <path d=\"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4\" />\n <path d=\"M14 13.12c0 2.38 0 6.38-1 8.88\" />\n <path d=\"M17.29 21.02c.12-.6.43-2.3.5-3.02\" />\n <path d=\"M2 12a10 10 0 0 1 18-6\" />\n <path d=\"M2 16h.01\" />\n <path d=\"M21.8 16c.2-2 .131-5.354 0-6\" />\n <path d=\"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2\" />\n <path d=\"M8.65 22c.21-.66.45-1.32.57-2\" />\n <path d=\"M9 6.8a6 6 0 0 1 9 5.2v2\" />\n </svg>\n );\n}\n\n/** lucide `send`. */\nexport function SendIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"send\", props)}>\n <path d=\"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z\" />\n <path d=\"m21.854 2.147-10.94 10.939\" />\n </svg>\n );\n}\n\n/** lucide `paperclip`. */\nexport function PaperclipIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"paperclip\", props)}>\n <path d=\"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551\" />\n </svg>\n );\n}\n\n/** lucide `check-check`. */\nexport function CheckCheckIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"check-check\", props)}>\n <path d=\"M18 6 7 17l-5-5\" />\n <path d=\"m22 10-7.5 7.5L13 16\" />\n </svg>\n );\n}\n\n/** lucide `reply`. */\nexport function ReplyIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"reply\", props)}>\n <path d=\"M20 18v-2a4 4 0 0 0-4-4H4\" />\n <path d=\"m9 17-5-5 5-5\" />\n </svg>\n );\n}\n\n/** lucide `link`. */\nexport function LinkIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"link\", props)}>\n <path d=\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\" />\n <path d=\"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\" />\n </svg>\n );\n}\n\n/** lucide `bot`. */\nexport function BotIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"bot\", props)}>\n <path d=\"M12 8V4H8\" />\n <rect width=\"16\" height=\"12\" x=\"4\" y=\"8\" rx=\"2\" />\n <path d=\"M2 14h2\" />\n <path d=\"M20 14h2\" />\n <path d=\"M15 13v2\" />\n <path d=\"M9 13v2\" />\n </svg>\n );\n}\n\n/** lucide `bell-off`. */\nexport function BellOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"bell-off\", props)}>\n <path d=\"M10.268 21a2 2 0 0 0 3.464 0\" />\n <path d=\"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742\" />\n <path d=\"m2 2 20 20\" />\n <path d=\"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05\" />\n </svg>\n );\n}\n\n/** lucide `mail`. */\nexport function MailIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"mail\", props)}>\n <path d=\"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7\" />\n <rect x=\"2\" y=\"4\" width=\"20\" height=\"16\" rx=\"2\" />\n </svg>\n );\n}\n\n/** lucide `mail-open`. */\nexport function MailOpenIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"mail-open\", props)}>\n <path d=\"M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z\" />\n <path d=\"m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10\" />\n </svg>\n );\n}\n\n/** lucide `folder-input`. */\nexport function FolderInputIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"folder-input\", props)}>\n <path d=\"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1\" />\n <path d=\"M2 13h10\" />\n <path d=\"m9 16 3-3-3-3\" />\n </svg>\n );\n}\n\n/** lucide `star-off`. */\nexport function StarOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"star-off\", props)}>\n <path d=\"m10.344 4.688 1.181-2.393a.53.53 0 0 1 .95 0l2.31 4.679a2.12 2.12 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.237 3.152\" />\n <path d=\"m17.945 17.945.43 2.505a.53.53 0 0 1-.771.56l-4.618-2.428a2.12 2.12 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.12 2.12 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a8 8 0 0 0 .4-.099\" />\n <path d=\"m2 2 20 20\" />\n </svg>\n );\n}\n\n/** lucide `columns-3`. */\nexport function Columns3Icon(props: IconProps) {\n return (\n <svg {...lucideProps(\"columns-3\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M9 3v18\" />\n <path d=\"M15 3v18\" />\n </svg>\n );\n}\n\n/** lucide `blocks`. */\nexport function BlocksIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"blocks\", props)}>\n <path d=\"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2\" />\n <rect x=\"14\" y=\"2\" width=\"8\" height=\"8\" rx=\"1\" />\n </svg>\n );\n}\n\n/** lucide `calendar-clock`. */\nexport function CalendarClockIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"calendar-clock\", props)}>\n <path d=\"M16 14v2.2l1.6 1\" />\n <path d=\"M16 2v3\" />\n <path d=\"M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338\" />\n <path d=\"M3 9h5.859\" />\n <path d=\"M8 2v3\" />\n <circle cx=\"16\" cy=\"16\" r=\"6\" />\n </svg>\n );\n}\n\n/** lucide `door-open`. */\nexport function DoorOpenIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"door-open\", props)}>\n <path d=\"M10 21H2\" />\n <path d=\"M10 3H7a2 2 0 00-2 2v16\" />\n <path d=\"M14 12h.01\" />\n <path d=\"M19 21V5a2 2 0 00-1.675-1.974l-6.163-1.013A1 1 0 0010 3v18a1 1 0 001.124.992z\" />\n <path d=\"M22 21h-3\" />\n </svg>\n );\n}\n\n/** lucide `inbox`. */\nexport function InboxIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"inbox\", props)}>\n <polyline points=\"22 12 16 12 14 15 10 15 8 12 2 12\" />\n <path d=\"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z\" />\n </svg>\n );\n}\n\n/** lucide `layout-dashboard`. */\nexport function LayoutDashboardIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"layout-dashboard\", props)}>\n <rect width=\"7\" height=\"9\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"5\" x=\"14\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"9\" x=\"14\" y=\"12\" rx=\"1\" />\n <rect width=\"7\" height=\"5\" x=\"3\" y=\"16\" rx=\"1\" />\n </svg>\n );\n}\n\n/** lucide `archive-restore`. */\nexport function ArchiveRestoreIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"archive-restore\", props)}>\n <rect width=\"20\" height=\"5\" x=\"2\" y=\"3\" rx=\"1\" />\n <path d=\"M4 8v11a2 2 0 0 0 2 2h2\" />\n <path d=\"M20 8v11a2 2 0 0 1-2 2h-2\" />\n <path d=\"m9 15 3-3 3 3\" />\n <path d=\"M12 12v9\" />\n </svg>\n );\n}\n\n/** lucide `split`. */\nexport function SplitIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"split\", props)}>\n <path d=\"M16 3h5v5\" />\n <path d=\"M8 3H3v5\" />\n <path d=\"M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3\" />\n <path d=\"m15 9 6-6\" />\n </svg>\n );\n}\n\n/** lucide `arrow-up-from-line`. */\nexport function ArrowUpFromLineIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-up-from-line\", props)}>\n <path d=\"m18 9-6-6-6 6\" />\n <path d=\"M12 3v14\" />\n <path d=\"M5 21h14\" />\n </svg>\n );\n}\n\n/** lucide `lock-open`. */\nexport function LockOpenIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"lock-open\", props)}>\n <rect width=\"18\" height=\"11\" x=\"3\" y=\"11\" rx=\"2\" ry=\"2\" />\n <path d=\"M7 11V7a5 5 0 0 1 9.9-1\" />\n </svg>\n );\n}\n\n/** lucide `printer`. */\nexport function PrinterIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"printer\", props)}>\n <path d=\"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2\" />\n <path d=\"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6\" />\n <rect x=\"6\" y=\"14\" width=\"12\" height=\"8\" rx=\"1\" />\n </svg>\n );\n}\n\n/** lucide `rocket`. */\nexport function RocketIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"rocket\", props)}>\n <path d=\"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5\" />\n <path d=\"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09\" />\n <path d=\"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z\" />\n <path d=\"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05\" />\n </svg>\n );\n}\n\n/** lucide `message-circle`. */\nexport function MessageCircleIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"message-circle\", props)}>\n <path d=\"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719\" />\n </svg>\n );\n}\n\n/** lucide `copy-plus`. */\nexport function CopyPlusIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"copy-plus\", props)}>\n <line x1=\"15\" x2=\"15\" y1=\"12\" y2=\"18\" />\n <line x1=\"12\" x2=\"18\" y1=\"15\" y2=\"15\" />\n <rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n <path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" />\n </svg>\n );\n}\n\n/** lucide `map-pin`. */\nexport function MapPinIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"map-pin\", props)}>\n <path d=\"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0\" />\n <circle cx=\"12\" cy=\"10\" r=\"3\" />\n </svg>\n );\n}\n\n/** lucide `at-sign`. */\nexport function AtSignIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"at-sign\", props)}>\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d=\"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8\" />\n </svg>\n );\n}\n\n/** lucide `link-2-off`. */\nexport function Link2OffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"link-2-off\", props)}>\n <path d=\"M9 17H7A5 5 0 0 1 7 7\" />\n <path d=\"M15 7h2a5 5 0 0 1 4 8\" />\n <line x1=\"8\" x2=\"12\" y1=\"12\" y2=\"12\" />\n <line x1=\"2\" x2=\"22\" y1=\"2\" y2=\"22\" />\n </svg>\n );\n}\n\n/** lucide `whole-word`. */\nexport function WholeWordIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"whole-word\", props)}>\n <circle cx=\"7\" cy=\"12\" r=\"3\" />\n <path d=\"M10 9v6\" />\n <circle cx=\"17\" cy=\"12\" r=\"3\" />\n <path d=\"M14 7v8\" />\n <path d=\"M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1\" />\n </svg>\n );\n}\n\n/** lucide `lightbulb`. */\nexport function LightbulbIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"lightbulb\", props)}>\n <path d=\"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5\" />\n <path d=\"M9 18h6\" />\n <path d=\"M10 22h4\" />\n </svg>\n );\n}\n\n/** lucide `shield-off`. */\nexport function ShieldOffIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"shield-off\", props)}>\n <path d=\"m2 2 20 20\" />\n <path d=\"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71\" />\n <path d=\"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264\" />\n </svg>\n );\n}\n\n/** lucide `chevrons-left`. */\nexport function ChevronsLeftIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevrons-left\", props)}>\n <path d=\"m11 17-5-5 5-5\" />\n <path d=\"m18 17-5-5 5-5\" />\n </svg>\n );\n}\n\n/** lucide `chevrons-right`. */\nexport function ChevronsRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevrons-right\", props)}>\n <path d=\"m6 17 5-5-5-5\" />\n <path d=\"m13 17 5-5-5-5\" />\n </svg>\n );\n}\n\n/** lucide `users-round`. */\nexport function UsersRoundIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"users-round\", props)}>\n <path d=\"M18 21a8 8 0 0 0-16 0\" />\n <circle cx=\"10\" cy=\"8\" r=\"5\" />\n <path d=\"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3\" />\n </svg>\n );\n}\n\n/** lucide `landmark`. */\nexport function LandmarkIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"landmark\", props)}>\n <path d=\"M10 18v-7\" />\n <path d=\"M11.119 2.205a2 2 0 0 1 1.762 0l7.84 3.846A.5.5 0 0 1 20.5 7h-17a.5.5 0 0 1-.22-.949z\" />\n <path d=\"M14 18v-7\" />\n <path d=\"M18 18v-7\" />\n <path d=\"M3 22h18\" />\n <path d=\"M6 18v-7\" />\n </svg>\n );\n}\n\n/** lucide `factory`. */\nexport function FactoryIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"factory\", props)}>\n <path d=\"M12 16h.01\" />\n <path d=\"M16 16h.01\" />\n <path d=\"M3 19a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a.5.5 0 0 0-.769-.422l-4.462 2.844A.5.5 0 0 1 15 10.5v-2a.5.5 0 0 0-.769-.422L9.77 10.922A.5.5 0 0 1 9 10.5V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2z\" />\n <path d=\"M8 16h.01\" />\n </svg>\n );\n}\n\n/** lucide `chevrons-down` — CollapsibleText's \"expand all\". */\nexport function ChevronsDownIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevrons-down\", props)}>\n <path d=\"m7 6 5 5 5-5\" />\n <path d=\"m7 13 5 5 5-5\" />\n </svg>\n );\n}\n\n/** lucide `chevrons-up` — CollapsibleText's \"collapse all\". */\nexport function ChevronsUpIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"chevrons-up\", props)}>\n <path d=\"m17 11-5-5-5 5\" />\n <path d=\"m17 18-5-5-5 5\" />\n </svg>\n );\n}\n\n/** lucide `arrow-up-right` — CitationChip's \"open source\". */\nexport function ArrowUpRightIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"arrow-up-right\", props)}>\n <path d=\"M7 7h10v10\" />\n <path d=\"M7 17 17 7\" />\n </svg>\n );\n}\n\n/** lucide `quote` — CitationChip's excerpt blockquote. */\nexport function QuoteIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"quote\", props)}>\n <path d=\"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z\" />\n <path d=\"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z\" />\n </svg>\n );\n}\n\n/** lucide `panel-top-open` — the floating dock's phone menu button (opens the list). */\nexport function PanelTopOpenIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"panel-top-open\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M3 9h18\" />\n <path d=\"m15 14-3 3-3-3\" />\n </svg>\n );\n}\n\n/** lucide `panel-top-close` — the floating dock's phone menu button (closes the list). */\nexport function PanelTopCloseIcon(props: IconProps) {\n return (\n <svg {...lucideProps(\"panel-top-close\", props)}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M3 9h18\" />\n <path d=\"m9 16 3-3 3 3\" />\n </svg>\n );\n}\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","\"use client\";\n\n/**\n * The settled surfaces that hold the one control (owner, 2026-10-02/03):\n * one surface level, ~36px hairline rows, 8px radius; the empty state; the\n * region-shaped skeleton; the three delete tiers; the one-feature promo banner.\n * Skins are locked in `controls.css` like the controls themselves.\n */\n\nimport { Slot } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\n\nimport { swallowClick } from \"../button\";\nimport { cn } from \"../cn\";\nimport { ConfirmDialog } from \"../confirm-dialog\";\nimport { ChevronRightIcon, Trash2Icon } from \"../icons\";\nimport { Skeleton } from \"../skeleton\";\nimport { Button, ControlRow, type ChipTone, type GlyphTone } from \"./controls\";\n\n/* ------------------------------------------------------------------ */\n/* Row groups */\n/* ------------------------------------------------------------------ */\n\nexport interface RowGroupProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n /** 11px uppercase heading above the group. */\n title?: React.ReactNode;\n /** The danger-zone skin (delete tier 3). */\n danger?: boolean;\n}\n\n/** A bordered group of hairline rows — the one surface for grouped content. */\nexport function RowGroup({ title, danger, className, children, ...props }: RowGroupProps) {\n return (\n <section\n data-matrx-row-group=\"\"\n data-danger={danger ? \"\" : undefined}\n className={cn(\"matrx-control-group\", className)}\n {...props}\n >\n {title ? <h2 className=\"matrx-control-group-title\">{title}</h2> : null}\n <div className=\"matrx-control-group-body\">{children}</div>\n </section>\n );\n}\n\nexport interface SettingRowProps {\n label: React.ReactNode;\n /** One 12px line under the label. */\n line?: React.ReactNode;\n /** Ties the label to the control it describes. */\n htmlFor?: string;\n /** The row's controls, right-aligned on one line. */\n children?: React.ReactNode;\n className?: string;\n}\n\n/** One ~36px row: 13px label, optional 12px line, controls on the right. */\nexport function SettingRow({ label, line, htmlFor, children, className }: SettingRowProps) {\n return (\n <div data-matrx-setting-row=\"\" className={cn(\"matrx-control-setting-row\", className)}>\n <div className=\"matrx-control-setting-text\">\n {htmlFor ? (\n <label htmlFor={htmlFor} className=\"matrx-control-setting-label\">\n {label}\n </label>\n ) : (\n <div className=\"matrx-control-setting-label\">{label}</div>\n )}\n {line ? <div className=\"matrx-control-setting-line\">{line}</div> : null}\n </div>\n {children ? (\n <ControlRow nowrap data-matrx-row-actions=\"\">\n {children}\n </ControlRow>\n ) : null}\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Tile — the pressable row / tile (a choice, a destination) */\n/* ------------------------------------------------------------------ */\n\nexport type TileLayout = \"row\" | \"stack\" | \"adaptive\";\n\nexport interface TileProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"title\"> {\n /** `row` (default): glyph, then a 13px title over a 12px line, start-aligned, full width — a\n * choice in a list, a quick action. `stack`: glyph on top, title and line under it — a grid\n * tile. `adaptive`: `stack` from the `sm` breakpoint (640px) up, a compact `row` below it — a\n * grid of option cards that becomes a list on a phone. All are taller than a control: they\n * carry text, so they never take the 28px lock. */\n layout?: TileLayout;\n /** `outline` (default): the bordered card skin. `quiet`: no frame until hover — a row in a\n * menu-like list. */\n variant?: \"outline\" | \"quiet\";\n /** Leading 16px glyph (an avatar or image works too). */\n icon?: React.ReactNode;\n /** The 13px title. */\n title: React.ReactNode;\n /** The title wraps over several lines (up to 6) instead of one line with an ellipsis: a quiz\n * answer, a step, a sentence-long choice. Off by default — a short title is one line. */\n wrapTitle?: boolean;\n /** One 12px secondary line (clamped to two lines; one with `oneLine`). */\n line?: React.ReactNode;\n /** The `line` stays ONE line with an ellipsis, so every row of a master list keeps one height. */\n oneLine?: boolean;\n /** Trailing content in a row (a chevron, a count, a shortcut). */\n end?: React.ReactNode;\n /** A choice: `true` tints it and sets `aria-pressed`; `false` sets `aria-pressed=\"false\"`. A link tile (`asChild`) never sets `aria-pressed`: the caller sets `aria-current`. */\n selected?: boolean;\n /** How `selected` looks. `outline` (default): primary frame and tint. `fill`: a soft neutral fill,\n * no outline, ink unchanged — a sidebar's active row. `primary`: the solid primary fill with\n * every ink (title, line, glyph, end) on primary — the open item of a master list. */\n selectedStyle?: \"outline\" | \"fill\" | \"primary\";\n /** The hover / focus tooltip (the native `title` attribute: `title` is the visible label). */\n tooltip?: string;\n /** Nesting depth under a parent row: each level moves the row's start past one glyph and its\n * gap, so an icon-less child's title starts where its parent's title does. */\n level?: 1 | 2 | 3;\n /** Size to the content and never shrink or truncate the title — a code, a short value. */\n fit?: boolean;\n /** Keep room at the row's end for a control laid OVER it (a row's More button): `control`\n * reserves one control's width plus its gap, so the title never runs under it. */\n endInset?: \"control\";\n /** A dashed border: the \"add another\" tile (an empty slot to fill), never a choice. */\n dashed?: boolean;\n /** hoverStyle=\"fill\": the pointer's soft neutral fill (the desktop look's secondary fill) instead of the accent. */\n hoverStyle?: \"fill\";\n /** A destructive row (Remove, Delete): destructive title and glyph, destructive hover tint. */\n danger?: boolean;\n /**\n * A choice that is ALREADY USED elsewhere (an option already placed, a field already mapped): a\n * faint shade and quieter ink, still fully pressable — a hint for the eye, never a disabled state.\n */\n dimmed?: boolean;\n /** The glyph's own status ink when its color carries meaning (Button's `glyphTone`). */\n glyphTone?: GlyphTone;\n /** The inviting choice card for a front door: roomy padding, a 40px icon square, a 14px title. */\n hero?: boolean;\n /** Tint card, edge and icon square from one `ChipTone` (the `Chip` hue tokens). */\n tone?: ChipTone;\n /** A 28px navigation / filter row for sidebars and dense lists: `min-height` is the control size,\n * padding 4px 8px, gap 8px, 13px title. The `line` is HIDDEN when dense (one line, always).\n * `variant=\"quiet\"` + `dense` is a clean nav row: transparent until hover / selected. */\n dense?: boolean;\n /** Render the one child element (a link) with the tile's skin; its children are ignored —\n * the tile draws `icon`/`title`/`line`/`end`. */\n asChild?: boolean;\n}\n\n/**\n * THE pressable row / tile: two named layouts, two skins, no size. `className` places it\n * (width, grid cell); its height follows its text.\n */\nexport const Tile = React.forwardRef<HTMLButtonElement, TileProps>(\n (\n { layout = \"row\", variant = \"outline\", icon, title, wrapTitle, line, end, selected, selectedStyle, tooltip, level, fit, endInset, oneLine, dashed, hoverStyle, danger, dimmed, glyphTone, hero, tone, dense, asChild = false, className, children, onClick, type, ...props },\n ref,\n ) => {\n const Component = asChild ? Slot : \"button\";\n const ariaDisabled = props[\"aria-disabled\"];\n const inert = ariaDisabled === true || ariaDisabled === \"true\";\n const body = (\n <>\n {icon ? <span className=\"matrx-tile-icon\">{icon}</span> : null}\n <span className=\"matrx-tile-text\">\n <span className=\"matrx-tile-title\">{title}</span>\n {line ? <span className=\"matrx-tile-line\">{line}</span> : null}\n </span>\n {end ? <span className=\"matrx-tile-end\">{end}</span> : null}\n </>\n );\n return (\n <Component\n ref={ref}\n type={asChild ? undefined : (type ?? \"button\")}\n data-matrx-tile=\"\"\n data-layout={layout}\n data-variant={variant}\n data-selected={selected ? \"\" : undefined}\n data-selected-style={selected && (selectedStyle === \"fill\" || selectedStyle === \"primary\") ? selectedStyle : undefined}\n data-level={level}\n data-fit={fit ? \"\" : undefined}\n data-one-line={oneLine ? \"\" : undefined}\n data-end-inset={endInset}\n data-dashed={dashed ? \"\" : undefined}\n data-hover-style={hoverStyle}\n title={tooltip}\n data-danger={danger ? \"\" : undefined}\n data-dimmed={dimmed ? \"\" : undefined}\n data-wrap-title={wrapTitle ? \"\" : undefined}\n data-glyph-tone={glyphTone}\n data-hero={hero ? \"\" : undefined}\n data-dense={dense ? \"\" : undefined}\n data-tone={tone}\n aria-pressed={asChild || selected === undefined ? undefined : selected}\n className={cn(\"matrx-tile\", className)}\n {...props}\n onClick={inert ? swallowClick : onClick}\n >\n {asChild && React.isValidElement(children) ? (\n React.cloneElement(children as React.ReactElement<{ children?: React.ReactNode }>, undefined, body)\n ) : (\n body\n )}\n </Component>\n );\n },\n);\nTile.displayName = \"Tile\";\n\n/* ------------------------------------------------------------------ */\n/* Section disclosure header */\n/* ------------------------------------------------------------------ */\n\nexport type DisclosureHeaderVariant = \"row\" | \"label\";\n\nexport interface DisclosureHeaderProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"title\"> {\n /** Whether the section under the header is showing. Sets `aria-expanded`. */\n open: boolean;\n /** `row` (default): a 13px/500 title — a collapsible section, a group of results, a \"details\"\n * fold. `label`: the 11px uppercase muted label that heads a sidebar or menu group. */\n variant?: DisclosureHeaderVariant;\n /** Optional 16px glyph after the chevron (row variant). */\n icon?: React.ReactNode;\n /** Colors ONLY the icon: a status tone uses its `-ink` token, a hue its `--matrx-chip-<hue>-ink`.\n * A section that carries a color (violet Organization, amber Projects) keeps it here. */\n glyphTone?: GlyphTone | ChipTone;\n /** The section's name. */\n title: React.ReactNode;\n /** A short muted fact after the title: a count, a size, \"3 of 12\". Never a sentence. */\n meta?: React.ReactNode;\n /** Trailing content pinned to the end (a status glyph, a count badge). Non-interactive — a\n * control beside the header sits outside it, never inside the button. */\n end?: React.ReactNode;\n /** One 12px secondary line under the title (row variant) — what the section holds. */\n line?: React.ReactNode;\n /** Where the turning chevron sits. `start` (default) leads the row; `end` trails it, for a\n * sidebar section whose label keeps the column's left edge. */\n chevron?: \"start\" | \"end\";\n}\n\n/**\n * THE section-disclosure header: a chevron that turns, a title, an optional count and trailing\n * status — one full-width pressable row that opens and closes the section below it. Every\n * \"click the heading to fold\" row is this, never a raw button with a hand-drawn chevron.\n */\nexport const DisclosureHeader = React.forwardRef<HTMLButtonElement, DisclosureHeaderProps>(\n ({ open, variant = \"row\", icon, glyphTone, title, meta, end, line, chevron = \"start\", className, type, ...props }, ref) => (\n <button\n ref={ref}\n type={type ?? \"button\"}\n aria-expanded={open}\n data-matrx-disclosure=\"\"\n data-variant={variant}\n data-open={open ? \"\" : undefined}\n data-chevron={chevron}\n className={cn(\"matrx-disclosure\", className)}\n {...props}\n >\n {chevron === \"start\" ? (\n <span className=\"matrx-disclosure-chevron\" aria-hidden=\"true\">\n <ChevronRightIcon />\n </span>\n ) : null}\n {icon ? (\n <span className=\"matrx-disclosure-icon\" data-glyph-tone={glyphTone}>\n {icon}\n </span>\n ) : null}\n {line ? (\n <span className=\"matrx-disclosure-text\">\n <span className=\"matrx-disclosure-title\">{title}</span>\n <span className=\"matrx-disclosure-line\">{line}</span>\n </span>\n ) : (\n <span className=\"matrx-disclosure-title\">{title}</span>\n )}\n {meta === undefined || meta === null || meta === false ? null : (\n <span className=\"matrx-disclosure-meta\">{meta}</span>\n )}\n {end ? <span className=\"matrx-disclosure-end\">{end}</span> : null}\n {chevron === \"end\" ? (\n <span className=\"matrx-disclosure-chevron\" data-end=\"\" aria-hidden=\"true\">\n <ChevronRightIcon />\n </span>\n ) : null}\n </button>\n ),\n);\nDisclosureHeader.displayName = \"DisclosureHeader\";\n\n/* ------------------------------------------------------------------ */\n/* Empty state */\n/* ------------------------------------------------------------------ */\n\nexport interface EmptyStateProps {\n /** A 20px glyph inside the tinted disc. */\n icon: React.ReactNode;\n /** 13px title. */\n title: React.ReactNode;\n /** One 12px line. */\n line?: React.ReactNode;\n /** The one 28px action (a controls `Button`). */\n action?: React.ReactNode;\n className?: string;\n}\n\n/** Tinted icon disc + 13px title + one line + one 28px button. */\nexport function EmptyState({ icon, title, line, action, className }: EmptyStateProps) {\n return (\n <div data-matrx-empty-state=\"\" className={cn(\"matrx-control-empty\", className)}>\n <div className=\"matrx-control-empty-disc\" aria-hidden=\"true\">\n {icon}\n </div>\n <div>\n <div className=\"matrx-control-empty-title\">{title}</div>\n {line ? <div className=\"matrx-control-empty-line\">{line}</div> : null}\n </div>\n {action ? <ControlRow className=\"justify-center\">{action}</ControlRow> : null}\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Region skeleton */\n/* ------------------------------------------------------------------ */\n\nexport interface RegionSkeletonProps {\n /** The region's shape: hairline rows, a form's label+field pairs, or cards. */\n shape?: \"rows\" | \"form\" | \"cards\";\n /** How many rows / fields / cards. */\n count?: number;\n /** Rows: a second (meta) line under each title. */\n twoLine?: boolean;\n className?: string;\n \"aria-label\"?: string;\n}\n\n/**\n * A skeleton shaped like the region it stands in for — never one block for a\n * page, never a spinner in the middle. A spinner belongs only inside a busy\n * control.\n */\nexport function RegionSkeleton({\n shape = \"rows\",\n count = shape === \"cards\" ? 3 : shape === \"form\" ? 4 : 8,\n twoLine = false,\n className,\n \"aria-label\": ariaLabel = \"Loading\",\n}: RegionSkeletonProps) {\n const items = Array.from({ length: count }, (_, i) => i);\n if (shape === \"form\") {\n return (\n <div aria-busy=\"true\" aria-label={ariaLabel} className={cn(\"flex flex-col gap-3\", className)}>\n {items.map((i) => (\n <div key={i} className=\"flex flex-col gap-1.5\">\n <Skeleton className=\"h-3 w-24\" />\n <Skeleton className=\"h-7 rounded-full\" />\n </div>\n ))}\n </div>\n );\n }\n if (shape === \"cards\") {\n return (\n <div aria-busy=\"true\" aria-label={ariaLabel} className={cn(\"grid gap-2 sm:grid-cols-3\", className)}>\n {items.map((i) => (\n <div key={i} className=\"flex items-center gap-3 rounded-lg border border-border p-3\">\n <Skeleton className=\"size-8 rounded-full\" />\n <div className=\"flex flex-1 flex-col gap-1.5\">\n <Skeleton className=\"h-3.5 w-2/3\" />\n <Skeleton className=\"h-2.5 w-1/2\" />\n </div>\n </div>\n ))}\n </div>\n );\n }\n return (\n <div aria-busy=\"true\" aria-label={ariaLabel} className={cn(\"divide-y divide-border\", className)}>\n {items.map((i) => (\n <div key={i} className=\"flex min-h-9 items-center gap-3 px-3 py-1.5\">\n <Skeleton className=\"size-4 rounded-full\" />\n <div className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <Skeleton className=\"h-3.5\" style={{ width: `${30 + ((i * 17) % 35)}%` }} />\n {twoLine ? <Skeleton className=\"h-2.5 w-1/4\" /> : null}\n </div>\n <Skeleton className=\"hidden h-[1.125rem] w-16 rounded-md sm:block\" />\n <Skeleton className=\"size-5 rounded-full\" />\n </div>\n ))}\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* The three delete tiers */\n/* ------------------------------------------------------------------ */\n\nexport interface DeleteButtonProps\n extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"children\" | \"aria-label\"> {\n /** What it deletes, e.g. \"Delete reference\". */\n \"aria-label\": string;\n}\n\n/** Tier 1 — the quiet trash glyph: muted until hover, destructive on hover. */\nexport const DeleteButton = React.forwardRef<HTMLButtonElement, DeleteButtonProps>((props, ref) => (\n <Button ref={ref} variant=\"quiet\" icon={<Trash2Icon />} data-delete=\"\" title={props[\"aria-label\"]} {...props} />\n));\nDeleteButton.displayName = \"DeleteButton\";\n\nexport interface ConfirmDeleteProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n /** \"Delete this project?\" */\n title: React.ReactNode;\n /** REQUIRED: name the cost — what is lost, what goes with it. Never \"Are you sure?\". */\n cost: React.ReactNode;\n /** The confirm button names the act, e.g. \"Delete project\". */\n confirmLabel: string;\n onConfirm: () => void | Promise<void>;\n busy?: boolean;\n}\n\n/** Tier 2 — a confirm that names the cost. */\nexport function ConfirmDelete({ open, onOpenChange, title, cost, confirmLabel, onConfirm, busy }: ConfirmDeleteProps) {\n return (\n <ConfirmDialog\n open={open}\n onOpenChange={onOpenChange}\n title={title}\n description={cost}\n confirmLabel={confirmLabel}\n variant=\"destructive\"\n busy={busy}\n onConfirm={onConfirm}\n />\n );\n}\n\n/** Tier 3 — the danger zone: a red-ruled group of rows at the end of settings. */\nexport function DangerZone({\n title = \"Danger zone\",\n children,\n className,\n}: {\n title?: React.ReactNode;\n children: React.ReactNode;\n className?: string;\n}) {\n return (\n <RowGroup title={title} danger className={className}>\n {children}\n </RowGroup>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Promo banner */\n/* ------------------------------------------------------------------ */\n\nexport type PromoTone = \"primary\" | \"success\" | \"warning\" | \"info\";\n\nexport interface PromoBannerProps {\n /** A 16px glyph inside the tinted disc. */\n icon: React.ReactNode;\n /** 11px label before the title, e.g. \"Next challenge\". Never a pill. */\n eyebrow?: React.ReactNode;\n /** One line, 13px. */\n title: React.ReactNode;\n /** One line, 12px, ≤60 characters. Omit rather than pad. */\n line?: React.ReactNode;\n /** Outline badges — the evidence behind the promo. */\n chips?: React.ReactNode;\n /** The one action: a controls `Button` (or a link wearing it). */\n action?: React.ReactNode;\n tone?: PromoTone;\n /**\n * Let the title wrap onto as many lines as it needs, for a sentence that must be read whole (a question with its\n * answer buttons beside it). Default false: one line, truncated.\n */\n wrap?: boolean;\n className?: string;\n /** Accessible name of the region. Defaults to \"Featured\". */\n \"aria-label\"?: string;\n}\n\n/**\n * A page-top variant that promotes ONE feature in one bordered row (~56px):\n * [disc] EYEBROW · Title / one line … [chips] [Action]. On a phone the chips\n * wrap under the text and the action stretches full width.\n */\nexport function PromoBanner({\n icon,\n eyebrow,\n title,\n line,\n chips,\n action,\n tone = \"primary\",\n wrap = false,\n className,\n \"aria-label\": ariaLabel,\n}: PromoBannerProps) {\n return (\n <section\n aria-label={ariaLabel ?? (typeof eyebrow === \"string\" ? eyebrow : \"Featured\")}\n data-matrx-promo=\"\"\n data-tone={tone}\n data-wrap={wrap ? \"\" : undefined}\n className={cn(\"matrx-control-promo\", className)}\n >\n <span className=\"matrx-control-promo-disc\" aria-hidden=\"true\">\n {icon}\n </span>\n <div className=\"matrx-control-promo-text\">\n <div className=\"matrx-control-promo-head\">\n {eyebrow ? <span className=\"matrx-control-promo-eyebrow\">{eyebrow}</span> : null}\n {eyebrow ? (\n <span className=\"matrx-control-promo-eyebrow\" aria-hidden=\"true\">\n ·\n </span>\n ) : null}\n <span className=\"matrx-control-promo-title\">{title}</span>\n </div>\n {line ? <div className=\"matrx-control-promo-line\">{line}</div> : null}\n </div>\n {chips ? <div className=\"matrx-control-promo-chips\">{chips}</div> : null}\n {action ? (\n <ControlRow nowrap className=\"matrx-control-promo-action\">\n {action}\n </ControlRow>\n ) : null}\n </section>\n );\n}\n","\"use client\";\n\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nexport const buttonVariants = cva(\n \"matrx-glyph-trim inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:opacity-50 active:scale-[0.98] [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90\",\n /**\n * An explicit spelling of `default`, identical by construction. It is\n * not decoration: matrx-frontend's `ButtonMine` fork carried it, ~17\n * call sites say `variant=\"primary\"`, and the alternative to keeping\n * the word was a host shim translating a prop — the massage C22 bans.\n */\n primary: \"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90\",\n destructive:\n \"bg-danger-fill text-danger-fill-foreground shadow-sm hover:bg-danger-fill/90\",\n /** The affirmative twin of `destructive` — confirm, approve, publish. */\n success:\n \"bg-success-fill text-success-fill-foreground shadow-sm hover:bg-success-fill/90\",\n outline:\n \"border border-border bg-card shadow-sm hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary-ink underline-offset-4 hover:underline\",\n subtle:\n \"border border-transparent bg-muted/50 text-foreground hover:border-border hover:bg-muted\",\n },\n /**\n * ONE size scale, xs → 3xl, plus the two icon boxes. The top and bottom\n * of the scale came in from matrx-frontend's `ButtonMine` fork (2026-09-07):\n * a dense toolbar needs `xs`, and a marketing/hero call to action needs\n * `xl`+. A host that has to reach outside this scale forks the button,\n * which is exactly how `ButtonMine` was born.\n */\n size: {\n xs: \"h-6 rounded-md px-1 text-xs\",\n sm: \"h-8 rounded-md px-3 text-xs\",\n default: \"h-9 px-4 py-2\",\n /** An explicit spelling of `default` (the fork's middle rung). */\n md: \"h-9 px-4 py-2\",\n lg: \"h-10 rounded-md px-6\",\n xl: \"h-12 px-8 py-3 text-base\",\n \"2xl\": \"h-14 px-10 py-3 text-base\",\n \"3xl\": \"h-16 px-12 py-3 text-base\",\n icon: \"h-9 w-9\",\n \"icon-sm\": \"h-7 w-7\",\n /** A circular icon box — an avatar-shaped control, not a square one. */\n roundIcon: \"h-8 w-8 rounded-full p-0\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\n/**\n * THE TOUCH FLOOR (2026-09-17).\n *\n * Every rung of the size scale below `xl` is shorter than the 44px platform\n * touch target: `xs` 24, `icon-sm` 28, `sm` 32, `roundIcon` 32, `default`/`md`\n * 36, `icon` 36, `lg` 40. Measured live at 390x844 on `/masterwork/<id>`, ALL\n * SEVEN design-system Buttons in the viewport were under the floor (four at\n * 32px, two at 28px).\n *\n * The floor is raised in CSS, under `@media (pointer: coarse)` ONLY, so DESKTOP\n * DENSITY IS UNTOUCHED — a narrow desktop window is not a finger, which is why\n * this rule deliberately does NOT carry the `(max-width: 1023px)` half that the\n * dialog-footer floor in `styles.css` uses.\n *\n * WHY EVERY SUB-44 RUNG AND NOT JUST `sm`: a floor applied to one rung inverts\n * the scale. Lift `sm` (32) alone and it renders TALLER on a phone than\n * `default` (36) and `lg` (40) — the scale would stop being a scale. A floor is\n * only coherent applied to everything beneath it.\n *\n * The mechanism is `min-height`/`min-width`, not an invisible 44px hit ring\n * over a 32px pill. A ring is the tap-target package's pattern and it is right\n * THERE (isolated glass buttons), but on a toolbar of adjacent `sm` buttons\n * separated by an 8px gap the rings overlap in the gap and one button silently\n * eats taps aimed at its neighbour — unacceptable where a neighbour is\n * destructive. `lib/entity-list`'s own phone contract (`h-11 min-w-11`) already\n * chose growth for the same reason; this is that choice made once, in the\n * primitive, instead of per surface.\n *\n * `min-width` is raised only on the SQUARE rungs (`icon`, `icon-sm`,\n * `roundIcon`) — a text button is already wider than 44px, and forcing a floor\n * on it would stretch short labels.\n *\n * Opt out on a control that is genuinely not a finger target with\n * `data-touch-exempt` (same escape hatch the footer floor honors), and say why\n * at the call site.\n */\nconst TOUCH_FLOOR_SIZES = new Set([\n \"xs\",\n \"sm\",\n \"default\",\n \"md\",\n \"lg\",\n \"icon\",\n \"icon-sm\",\n \"roundIcon\",\n]);\nconst SQUARE_SIZES = new Set([\"icon\", \"icon-sm\", \"roundIcon\"]);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\n/**\n * THE CURSOR LAW (common-docs/policies/cursor-law.md): a disabled control says\n * so with `not-allowed`, which the package's base layer sets on `:disabled`\n * and `[aria-disabled=\"true\"]`. `pointer-events: none` is never the mechanism\n * — it swallows the cursor. A native `<button disabled>` already fires no\n * click; the two shapes that WOULD fire one are handled here, once:\n * - `asChild` + `disabled` (a Link wearing button styles): marked\n * `aria-disabled`, taken out of the tab order, and its click is swallowed;\n * - `aria-disabled=\"true\"` on an enabled button: its click is swallowed.\n */\nexport function swallowClick(event: React.MouseEvent<HTMLButtonElement>): void {\n event.preventDefault();\n event.stopPropagation();\n}\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, onClick, ...props }, ref) => {\n const Component = asChild ? Slot : \"button\";\n const resolvedSize = size ?? \"default\";\n const disabledChild = asChild && Boolean(props.disabled);\n const ariaDisabled = props[\"aria-disabled\"];\n const inert =\n disabledChild || ariaDisabled === true || ariaDisabled === \"true\";\n return (\n <Component\n className={cn(buttonVariants({ variant, size, className }))}\n data-matrx-button=\"\"\n data-tap-floor={TOUCH_FLOOR_SIZES.has(resolvedSize) ? \"\" : undefined}\n data-tap-floor-square={\n SQUARE_SIZES.has(resolvedSize) ? \"\" : undefined\n }\n ref={ref}\n {...props}\n aria-disabled={disabledChild ? true : ariaDisabled}\n tabIndex={disabledChild ? -1 : props.tabIndex}\n onClick={inert ? swallowClick : onClick}\n />\n );\n },\n);\nButton.displayName = \"Button\";\n","\"use client\";\n\n/**\n * FLOATING LAYERS OPENED FROM INSIDE A MODAL — one contract, every surface.\n *\n * A blocking surface (a `modal` Dialog, AlertDialog, Sheet, Drawer,\n * BottomSheet, CommandDialog — and every Dialog on a phone) paints a scrim at\n * the modal tier, `MODAL_LAYER_Z`. Radix children of that surface (Popover,\n * Select, menus) are safe: they portal into it or after it at the same z, and\n * Radix counts a press inside them as inside. A floating layer that is NOT a\n * Radix child — a host window manager's window, the associations picker\n * window, anything `createPortal`ed to `<body>` at its own z — was not: it\n * painted UNDER the scrim (a window manager lives near z-1000), so the click\n * that picked an option landed on the scrim and closed the modal (Source\n * screen side sheet + association picker, 2026-09-26). Behind the scrim it\n * would also have lost focus to the modal's trap and had presses inside it\n * counted as outside-clicks.\n *\n * The contract, in three parts:\n *\n * 1. Every modal content registers while it is open (`useModalLayer`), and\n * treats a press or focus inside any `[data-matrx-floating-layer]` as\n * inside (`keepFloatingLayersInside`).\n * 2. A floating layer reads `useFloatingLayerZIndex(ownZ)`: while a modal is\n * open it is lifted to the modal tier. Equal z, so DOM order decides — a\n * layer opened AFTER the modal (portal appended later) paints above its\n * scrim; a window that was already open stays underneath, as it should.\n * While lifted, several floating layers order by when they opened, not by\n * their own manager's focus order; that returns when the modal closes.\n * 3. A floating layer's root is wrapped in `<FloatingLayer>`: it carries the\n * marker attribute, re-asserts `pointer-events: auto` (a modal sets `none`\n * on `<body>`), and mounts a non-trapping focus scope, which pauses the\n * modal's focus trap while the layer is open so its inputs take focus.\n *\n * 4. Popper content (a Popover, a combobox) a floating layer opens is portaled\n * to <body>; while a floating layer is open it counts as part of it, and\n * wheel/touchmove inside either stops at <body> so the modal's scroll lock\n * never cancels it.\n *\n * Guard: `floating-layer.test.tsx` — a window-manager-style layer opened from\n * each blocking surface must stack above the scrim, keep the modal open when\n * it or a popover it opened is pressed, scroll, keep focus in its own input,\n * and hand focus back to its opener when it closes.\n */\n\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\n\n/** The modal tier: every blocking scrim and its content sit here. */\nexport const MODAL_LAYER_Z = 10000;\n\n/** THE tooltip layer (defined beside the tooltips, `title-tooltips.ts`). */\nexport { TOOLTIP_LAYER_Z } from \"./title-tooltips\";\n\n/** Marker attribute on the root of a floating layer. */\nexport const FLOATING_LAYER_ATTR = \"data-matrx-floating-layer\";\n\n// ── the open-modal registry ─────────────────────────────────────────────────\n// Shared identity across independently bundled public entrypoints, like the\n// dialog contexts: two copies of this module must see one count.\ninterface ModalLayerRegistry {\n count: number;\n listeners: Set<() => void>;\n}\nconst REGISTRY_SLOT = Symbol.for(\"ai-matrx.design-system.modal-layer-registry\");\nconst registryHost = globalThis as typeof globalThis & {\n [REGISTRY_SLOT]?: ModalLayerRegistry;\n};\nconst registry: ModalLayerRegistry = (registryHost[REGISTRY_SLOT] ??= {\n count: 0,\n listeners: new Set(),\n});\n\nfunction emit(): void {\n for (const listener of registry.listeners) listener();\n}\n\n// A modal's scroll lock (react-remove-scroll) cancels wheel and touchmove on\n// `document` for anything outside the modal's own content — including a\n// floating layer opened from it, whose list then never scrolls. While a modal\n// is open, a scroll gesture inside a floating layer stops at <body>: React's\n// own portal listener on <body> still sees it (stopPropagation never stops\n// listeners on the same node), the lock on `document` never does.\nconst SCROLL_EVENTS = [\"wheel\", \"touchmove\"] as const;\nfunction stopAtBody(event: Event): void {\n if (isInsideFloatingLayer(event.target)) event.stopPropagation();\n}\nfunction setScrollPassthrough(on: boolean): void {\n if (typeof document === \"undefined\" || !document.body) return;\n for (const type of SCROLL_EVENTS) {\n if (on) document.body.addEventListener(type, stopAtBody, { passive: true });\n else document.body.removeEventListener(type, stopAtBody);\n }\n}\n\n/** Register one open modal layer; returns its release. */\nexport function registerModalLayer(): () => void {\n registry.count += 1;\n if (registry.count === 1) setScrollPassthrough(true);\n emit();\n let released = false;\n return () => {\n if (released) return;\n released = true;\n registry.count = Math.max(0, registry.count - 1);\n if (registry.count === 0) setScrollPassthrough(false);\n emit();\n };\n}\n\n/** True while at least one blocking surface is open. */\nexport function isModalLayerOpen(): boolean {\n return registry.count > 0;\n}\n\nfunction subscribe(listener: () => void): () => void {\n registry.listeners.add(listener);\n return () => registry.listeners.delete(listener);\n}\n\n/** Reactive `isModalLayerOpen()`. */\nexport function useModalLayerOpen(): boolean {\n return React.useSyncExternalStore(subscribe, isModalLayerOpen, () => false);\n}\n\n/**\n * Called by every modal content while it is mounted. `active` is false for a\n * content whose root is not modal (a windowed dialog, a `modal={false}` sheet).\n */\nexport function useModalLayer(active: boolean): void {\n React.useLayoutEffect(() => (active ? registerModalLayer() : undefined), [active]);\n}\n\n// ── the outside-click guard ─────────────────────────────────────────────────\n\nconst POPPER_WRAPPER = \"[data-radix-popper-content-wrapper]\";\n\n/**\n * True when `target` is inside a floating layer — or inside popper content (a\n * Popover, a combobox list) while a floating layer is open. Popper content a\n * window opens is portaled to <body>, outside the window's own element and\n * outside the modal's React tree; popper content the MODAL opens is portaled\n * into the modal and never reaches this check.\n */\nexport function isInsideFloatingLayer(target: EventTarget | null | undefined): boolean {\n if (!(target instanceof Element)) return false;\n if (target.closest(`[${FLOATING_LAYER_ATTR}]`)) return true;\n return (\n target.closest(POPPER_WRAPPER) !== null &&\n target.ownerDocument.querySelector(`[${FLOATING_LAYER_ATTR}]`) !== null\n );\n}\n\n/**\n * Wrap a Radix `onInteractOutside` so a press or focus inside a floating layer\n * never dismisses the modal. The caller's handler still runs first.\n */\nexport function keepFloatingLayersInside<\n E extends { target: EventTarget | null; preventDefault: () => void },\n>(handler?: (event: E) => void): (event: E) => void {\n return (event) => {\n handler?.(event);\n if (isInsideFloatingLayer(event.target)) event.preventDefault();\n };\n}\n\n// ── the floating layer's side ───────────────────────────────────────────────\n\n/** Pure form of `useFloatingLayerZIndex`, for callers outside React. */\nexport function floatingLayerZIndex(ownZ: number, modalOpen: boolean): number {\n return modalOpen ? Math.max(ownZ, MODAL_LAYER_Z) : ownZ;\n}\n\n/** The z-index a floating layer should paint at, given its own. */\nexport function useFloatingLayerZIndex(ownZ: number): number {\n return floatingLayerZIndex(ownZ, useModalLayerOpen());\n}\n\nconst preventAutoFocus = (event: Event) => event.preventDefault();\n\n/**\n * Wrap the root element of a floating layer (exactly one element child).\n * Marks it, keeps it pressable under a modal's `pointer-events: none` body,\n * and pauses the modal's focus trap while it is mounted. It never takes focus\n * on open. On close, if focus was lost with it while a modal is still open,\n * focus returns to the control that opened it — otherwise the next Tab would\n * land behind the modal.\n */\nexport const FloatingLayer = React.forwardRef<\n HTMLElement,\n { children: React.ReactElement }\n>(({ children }, ref) => {\n const [opener] = React.useState<Element | null>(() =>\n typeof document === \"undefined\" ? null : document.activeElement,\n );\n const returnFocus = (event: Event) => {\n event.preventDefault();\n const active = document.activeElement;\n const lost = !active || active === document.body || !active.isConnected;\n if (lost && isModalLayerOpen() && opener instanceof HTMLElement && opener.isConnected) {\n opener.focus({ preventScroll: true });\n }\n };\n return (\n <FocusScope\n asChild\n trapped={false}\n loop={false}\n onMountAutoFocus={preventAutoFocus}\n onUnmountAutoFocus={returnFocus}\n >\n <Slot\n ref={ref}\n {...{ [FLOATING_LAYER_ATTR]: \"\" }}\n style={{ pointerEvents: \"auto\" }}\n >\n {children}\n </Slot>\n </FocusScope>\n );\n});\nFloatingLayer.displayName = \"FloatingLayer\";\n\n// ── THE Escape stack ────────────────────────────────────────────────────────\n// One Escape owner for every floating window (summon's WindowPanel and\n// LiteWindow, the PeekWindow here): the TOPMOST open layer gets the key, and\n// only it — two windows never close on one press, and a window under another\n// never closes first. A layer joins on open (top), `raise()`s when it comes to\n// the front (a focused window), and leaves on close. Its handler decides\n// whether it closes (a menu or dialog it does not own may hold the key) and\n// calls `preventDefault()` when it does; a layer that declines still keeps the\n// key from the layers under it. One window listener, shared across bundled\n// copies of this module through a global slot (like the modal registry).\ninterface EscapeLayerEntry {\n readonly key: symbol;\n handle: (event: KeyboardEvent) => void;\n}\ninterface EscapeStack {\n layers: EscapeLayerEntry[];\n listening: boolean;\n}\nconst ESCAPE_SLOT = Symbol.for(\"ai-matrx.design-system.escape-stack\");\nconst escapeHost = globalThis as typeof globalThis & { [ESCAPE_SLOT]?: EscapeStack };\nconst escapeStack = (): EscapeStack => (escapeHost[ESCAPE_SLOT] ??= { layers: [], listening: false });\n\nfunction onEscapeKeydown(event: KeyboardEvent): void {\n if (event.key !== \"Escape\" || event.defaultPrevented) return;\n const { layers } = escapeStack();\n layers[layers.length - 1]?.handle(event);\n}\n\nexport interface EscapeLayerHandle {\n /** Move this layer to the top (it came to the front). */\n raise(): void;\n /** Leave the stack (closed). */\n release(): void;\n}\n\n/** Join the Escape stack at the top. The handler runs only while this layer is topmost. */\nexport function pushEscapeLayer(handle: (event: KeyboardEvent) => void): EscapeLayerHandle {\n const stack = escapeStack();\n if (!stack.listening && typeof window !== \"undefined\") {\n window.addEventListener(\"keydown\", onEscapeKeydown);\n stack.listening = true;\n }\n const entry: EscapeLayerEntry = { key: Symbol(\"escape-layer\"), handle };\n stack.layers.push(entry);\n const drop = () => {\n const at = stack.layers.indexOf(entry);\n if (at !== -1) stack.layers.splice(at, 1);\n };\n return {\n raise() {\n drop();\n stack.layers.push(entry);\n },\n release: drop,\n };\n}\n\n/** How many layers hold the Escape stack (tests and diagnostics). */\nexport function escapeLayerDepth(): number {\n return escapeStack().layers.length;\n}\n\n/**\n * Hold a place in the Escape stack while `active`. The latest `onEscape` runs\n * (never a stale closure). `raiseKey`: when it changes the layer moves to the\n * top (pass a window manager's z-index). Returns a stable `raise()` for a\n * layer that tracks \"front\" itself (a pointerdown on the window).\n */\nexport function useEscapeLayer(active: boolean, onEscape: (event: KeyboardEvent) => void, raiseKey?: unknown): () => void {\n const latest = React.useRef(onEscape);\n latest.current = onEscape;\n const handleRef = React.useRef<EscapeLayerHandle | null>(null);\n React.useEffect(() => {\n if (!active) return undefined;\n const handle = pushEscapeLayer((event) => latest.current(event));\n handleRef.current = handle;\n return () => {\n handle.release();\n handleRef.current = null;\n };\n }, [active]);\n const first = React.useRef(true);\n React.useEffect(() => {\n if (first.current) {\n first.current = false;\n return;\n }\n handleRef.current?.raise();\n }, [raiseKey]);\n return React.useCallback(() => handleRef.current?.raise(), []);\n}\n","/**\n * THE TITLE TAKEOVER — every native `title` attribute in the document shows\n * as THE fleet tooltip instead of the browser's.\n *\n * Why this exists. A `title=` is the one tooltip nobody has to import, so it\n * is what every hand-written control reaches for: ~50 of them on an ordinary\n * matrx-frontend page (2026-09-28), next to the Radix tooltips on the tap\n * buttons. The browser draws those as a slow, unstyled system box, and a page\n * that mixes the two reads as having \"lost all of its tooltips\" (Arman,\n * 2026-09-28). Asking every author — human or agent — to wrap every control in\n * `<Tooltip>` is a rule that is broken the day it is written. So the\n * `TooltipProvider` every host already mounts at its root installs this layer,\n * and a `title` is simply a tooltip from then on. Nothing to remember.\n *\n * How it works. On hover (mouse or pen) or keyboard focus (`:focus-visible`)\n * of an element that carries a `title`, the attribute is lifted onto\n * `data-matrx-title` for exactly as long as the pointer or focus stays — so\n * the browser has nothing to show — and one shared, script-placed element\n * wearing `.matrx-tooltip` shows the text instead. When the pointer or focus\n * leaves, the `title` is put back, so assistive technology and every\n * `[title]` selector read the element exactly as authored the rest of the\n * time. Touch never shows it (a `title` has no touch affordance either).\n *\n * What it does not draw: a tooltip that only repeats text already readable in\n * full inside the element (it still draws when that text is hidden or\n * truncated).\n *\n * What it leaves alone:\n * - an element that is already a Radix tooltip trigger\n * (`[data-matrx-tooltip-trigger]`, stamped by `TooltipTrigger`): its\n * `title` is still lifted — two tooltips on one control was the other\n * half of the mess — but only the Radix one shows;\n * - anything inside `[data-native-title]` (the explicit opt-out);\n * - SVG `<title>` children, which are elements, not attributes.\n *\n * Placement. `tooltipSide` (THE SMART SIDE, below): beside a control in a\n * vertical stack, else the host's side; flipped when there is no room,\n * clamped into the viewport. `data-title-side=\"right\" | \"left\" | \"bottom\" |\n * \"top\"` on the element or any ancestor states a preferred side — a vertical\n * rail sets `right` once on its container.\n *\n * Installed at most once per document, reference-counted across every\n * mounted provider, and removed when the last one unmounts.\n */\n\n/**\n * THE SMART SIDE (Arman, 2026-10-15: tooltips \"don't show up intelligently\"). A tooltip never\n * covers the control next to its own. Where the control's neighbours stand decides the side:\n * - an explicit side (a prop, or `data-title-side` on the control or an ancestor below <html>) wins;\n * - an icon-sized control in a vertical stack (an icon column, a tool palette) has its neighbours\n * above and below, so it opens beside the control: right, or left when the control is in the\n * window's right half (an inspector column). A wide row in a list keeps the host's side: its\n * tooltip is the row's own text in full, and beside it would sit over the page next to the list;\n * - anywhere else (a toolbar, a row of buttons, a lone control) it opens on the host's default\n * side (`data-title-side` on <html>: macOS desktop hosts say \"bottom\"; the web's is \"top\").\n * Either way it flips to the other side when there is no room, and stays inside the window.\n */\nexport function tooltipSide(el: Element | null, fallback?: Side): Side {\n if (!el) return fallback ?? \"top\";\n const doc = el.ownerDocument;\n const hinted = el.closest(\"[data-title-side]\");\n const hint = hinted?.getAttribute(\"data-title-side\");\n const isSide = (v: string | null | undefined): v is Side => v === \"top\" || v === \"bottom\" || v === \"left\" || v === \"right\";\n if (hinted && hinted !== doc.documentElement && isSide(hint)) return hint;\n const base: Side = fallback ?? (isSide(hint) ? hint : \"top\");\n const box = el.getBoundingClientRect();\n if (box.width <= ICON_CONTROL_MAX_PX && stackDirection(el) === \"vertical\") {\n const vw = doc.defaultView?.innerWidth ?? 0;\n return vw > 0 && box.left + box.width / 2 > vw / 2 ? \"left\" : \"right\";\n }\n return base;\n}\n\n/** The widest control that counts as an icon (a navigator item, a palette tool). */\nconst ICON_CONTROL_MAX_PX = 64;\n\n/** How the control's nearest group of siblings is laid out, from where they actually are on screen. */\nfunction stackDirection(el: Element): \"vertical\" | \"horizontal\" | null {\n let node: Element | null = el;\n for (let depth = 0; node && depth < 4; depth++, node = node.parentElement) {\n const parent: Element | null = node.parentElement;\n if (!parent) return null;\n const me = node.getBoundingClientRect();\n if (me.width === 0 && me.height === 0) return null;\n let vertical = 0;\n let horizontal = 0;\n for (const sib of Array.from(parent.children)) {\n if (sib === node) continue;\n const r = sib.getBoundingClientRect();\n if (r.width === 0 || r.height === 0) continue;\n const overlapX = Math.min(me.right, r.right) - Math.max(me.left, r.left);\n const overlapY = Math.min(me.bottom, r.bottom) - Math.max(me.top, r.top);\n if (overlapX > 0.5 * Math.min(me.width, r.width) && overlapY <= 0) vertical++;\n else if (overlapY > 0.5 * Math.min(me.height, r.height) && overlapX <= 0) horizontal++;\n }\n if (vertical > 0 && horizontal === 0) return \"vertical\";\n if (horizontal > 0) return \"horizontal\";\n }\n return null;\n}\n\nexport const TITLE_TOOLTIP_ATTR = \"data-matrx-title\";\nexport const TOOLTIP_TRIGGER_ATTR = \"data-matrx-tooltip-trigger\";\nexport const NATIVE_TITLE_OPT_OUT_ATTR = \"data-native-title\";\n\nexport type Side = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nconst OPEN_DELAY_MS = 350;\n/** Moving from one titled control to the next inside this window is instant. */\nconst SKIP_DELAY_MS = 500;\n/**\n * THE HOVER BRIDGE. Leaving the control does not close the tooltip at once: the pointer has this\n * long to reach the tooltip itself (Arman, 2026-10-14: a tooltip must stay long enough to put the\n * mouse on it and copy its text). Entering the tooltip holds it open.\n */\n/**\n * THE TOOLTIP LAYER — above every other layer, always (Arman, 2026-10-14: a tooltip \"coming up\n * behind the content\"). Menus and popovers share the modal tier (equal z, DOM order decides), so a\n * tooltip on that tier lost to any menu opened after it. A tooltip is transient and never takes a\n * press, so nothing ever needs to sit above it.\n */\nexport const TOOLTIP_LAYER_Z = 2_147_483_000;\n\nexport const TOOLTIP_CLOSE_DELAY_MS = 300;\nconst GAP_PX = 6;\nconst EDGE_PX = 8;\n/** How far every tooltip stays from the window's edge (both implementations). */\nexport const TOOLTIP_EDGE_PX = EDGE_PX;\n/**\n * A tooltip is a short hint, never a paragraph (Apple HIG: a tooltip is a few words): text past\n * this budget is cut at a word boundary with an ellipsis. Long detail belongs in a sheet or a\n * Copy details action, not on hover.\n */\nexport const TOOLTIP_TEXT_BUDGET = 140;\n\nexport function clipTooltipText(text: string, budget: number = TOOLTIP_TEXT_BUDGET): string {\n const flat = text.replace(/\\s+/g, \" \").trim();\n if (flat.length <= budget) return flat;\n const cut = flat.slice(0, budget - 1);\n const space = cut.lastIndexOf(\" \");\n return `${(space > budget * 0.6 ? cut.slice(0, space) : cut).replace(/[\\s,.;:–—-]+$/, \"\")}…`;\n}\n\nconst SURFACE_CLASS =\n \"matrx-tooltip matrx-title-tooltip matrx-motion-popper max-w-xs select-text rounded-md border border-border bg-popover px-2.5 py-1 text-xs font-medium text-popover-foreground\";\n\ninterface Installation {\n count: number;\n uninstall: () => void;\n}\n\n/**\n * Keyed on the document itself through a registered symbol, never a module\n * WeakMap: tsup bundles this module into more than one entry (`index`,\n * `tap-target`), and two module copies each holding their own map would\n * install twice — two listeners, two surfaces.\n */\nconst INSTALLATION_KEY = Symbol.for(\"@ai-matrx/design-system/title-tooltips\");\ntype DocumentWithInstallation = Document & { [INSTALLATION_KEY]?: Installation };\nconst installations = {\n get: (doc: Document) => (doc as DocumentWithInstallation)[INSTALLATION_KEY],\n set: (doc: Document, value: Installation) => {\n (doc as DocumentWithInstallation)[INSTALLATION_KEY] = value;\n },\n delete: (doc: Document) => {\n delete (doc as DocumentWithInstallation)[INSTALLATION_KEY];\n },\n};\n\n/** Install the takeover on `doc`. Returns the release function. */\nexport function acquireTitleTooltips(doc: Document | undefined = typeof document === \"undefined\" ? undefined : document): () => void {\n if (!doc) return () => {};\n const existing = installations.get(doc);\n if (existing) {\n existing.count += 1;\n } else {\n installations.set(doc, { count: 1, uninstall: install(doc) });\n }\n let released = false;\n return () => {\n if (released) return;\n released = true;\n const current = installations.get(doc);\n if (!current) return;\n current.count -= 1;\n if (current.count <= 0) {\n current.uninstall();\n installations.delete(doc);\n }\n };\n}\n\nfunction install(doc: Document): () => void {\n const win = doc.defaultView;\n let active: HTMLElement | null = null;\n let surface: HTMLDivElement | null = null;\n let openTimer: ReturnType<typeof setTimeout> | undefined;\n let closeTimer: ReturnType<typeof setTimeout> | undefined;\n let lastClosedAt = 0;\n /** A press began on the tooltip (selecting its text): it must not close until release. */\n let holding = false;\n\n const HTMLElementCtor = win?.HTMLElement;\n\n const titledAncestor = (node: EventTarget | null): HTMLElement | null => {\n if (!HTMLElementCtor || !(node instanceof win!.Node)) return null;\n const start = node instanceof HTMLElementCtor ? node : (node as Node).parentElement;\n if (!start) return null;\n const el = start.closest<HTMLElement>(`[title], [${TITLE_TOOLTIP_ATTR}]`);\n if (!el || !(el instanceof HTMLElementCtor)) return null;\n if (el.closest(`[${NATIVE_TITLE_OPT_OUT_ATTR}]`)) return null;\n return el;\n };\n\n const textOf = (el: HTMLElement) => clipTooltipText(el.getAttribute(TITLE_TOOLTIP_ATTR) ?? el.getAttribute(\"title\") ?? \"\");\n\n const lift = (el: HTMLElement) => {\n const title = el.getAttribute(\"title\");\n if (title === null) return;\n el.setAttribute(TITLE_TOOLTIP_ATTR, title);\n el.removeAttribute(\"title\");\n };\n\n const restore = (el: HTMLElement) => {\n const held = el.getAttribute(TITLE_TOOLTIP_ATTR);\n if (held === null) return;\n // An author who changed or removed the title while it was lifted wins:\n // only put ours back when nothing re-set it in the meantime.\n if (!el.hasAttribute(\"title\")) el.setAttribute(\"title\", held);\n el.removeAttribute(TITLE_TOOLTIP_ATTR);\n };\n\n const ensureSurface = () => {\n if (surface && surface.isConnected) return surface;\n surface = doc.createElement(\"div\");\n surface.setAttribute(\"role\", \"tooltip\");\n surface.setAttribute(\"data-slot\", \"title-tooltip\");\n surface.className = SURFACE_CLASS;\n surface.style.position = \"fixed\";\n surface.style.zIndex = String(TOOLTIP_LAYER_Z);\n surface.style.visibility = \"hidden\";\n doc.body.appendChild(surface);\n return surface;\n };\n\n /**\n * THE PART OF `el` A PERSON CAN SEE: its box clipped by every ancestor that clips (scrolls or hides\n * overflow) and by the window. A truncated cell in a sideways-scrolling table is far wider than its\n * visible part; anchored to the whole box the tooltip landed at the window's edge (2026-10-14).\n */\n const visibleRect = (el: HTMLElement, vw: number, vh: number) => {\n const box = el.getBoundingClientRect();\n let left = box.left;\n let top = box.top;\n let right = box.right;\n let bottom = box.bottom;\n for (let node = el.parentElement; node && node !== doc.body && node !== doc.documentElement; node = node.parentElement) {\n const cs = win?.getComputedStyle(node);\n if (!cs) break;\n const clipsX = cs.overflowX !== \"visible\" || cs.overflow === \"hidden\";\n const clipsY = cs.overflowY !== \"visible\" || cs.overflow === \"hidden\";\n if (!clipsX && !clipsY) continue;\n const clip = node.getBoundingClientRect();\n if (clipsX) { left = Math.max(left, clip.left); right = Math.min(right, clip.right); }\n if (clipsY) { top = Math.max(top, clip.top); bottom = Math.min(bottom, clip.bottom); }\n }\n left = Math.max(left, 0);\n top = Math.max(top, 0);\n right = Math.min(right, vw || right);\n bottom = Math.min(bottom, vh || bottom);\n // Nothing of it is visible (scrolled away under the pointer is impossible, but a test DOM can say so): the box itself.\n if (right <= left || bottom <= top) return box;\n return { left, top, right, bottom, width: right - left, height: bottom - top };\n };\n\n const preferredSide = (el: HTMLElement): Side => tooltipSide(el);\n\n const place = (el: HTMLElement, node: HTMLDivElement) => {\n // The VISIBLE viewport, not the window: inside a clipped host (the kind\n // sandbox frame is window-wide but shown only at its column) the visual\n // viewport is what the reader sees, so a tooltip never lands past it.\n const vw = win?.visualViewport?.width ?? win?.innerWidth ?? 0;\n const vh = win?.visualViewport?.height ?? win?.innerHeight ?? 0;\n const anchor = visibleRect(el, vw, vh);\n const box = node.getBoundingClientRect();\n const fits: Record<Side, boolean> = {\n top: anchor.top - GAP_PX - box.height >= EDGE_PX,\n bottom: anchor.bottom + GAP_PX + box.height <= vh - EDGE_PX,\n left: anchor.left - GAP_PX - box.width >= EDGE_PX,\n right: anchor.right + GAP_PX + box.width <= vw - EDGE_PX,\n };\n const opposite: Record<Side, Side> = { top: \"bottom\", bottom: \"top\", left: \"right\", right: \"left\" };\n const wanted = preferredSide(el);\n const side: Side = fits[wanted] ? wanted : fits[opposite[wanted]] ? opposite[wanted] : wanted;\n\n let x: number;\n let y: number;\n if (side === \"top\" || side === \"bottom\") {\n x = anchor.left + anchor.width / 2 - box.width / 2;\n y = side === \"top\" ? anchor.top - GAP_PX - box.height : anchor.bottom + GAP_PX;\n } else {\n y = anchor.top + anchor.height / 2 - box.height / 2;\n x = side === \"left\" ? anchor.left - GAP_PX - box.width : anchor.right + GAP_PX;\n }\n x = Math.min(Math.max(x, EDGE_PX), Math.max(EDGE_PX, vw - EDGE_PX - box.width));\n y = Math.min(Math.max(y, EDGE_PX), Math.max(EDGE_PX, vh - EDGE_PX - box.height));\n // Placed with `left`/`top`, NEVER `transform`: the open animation\n // (`.matrx-motion-popper`) animates `transform`, and a running animation\n // overrides an inline transform — the chip sat at the page's top-left\n // corner for the whole animation, then jumped to its control (2026-10-08).\n node.style.left = `${Math.round(x)}px`;\n node.style.top = `${Math.round(y)}px`;\n node.setAttribute(\"data-side\", side);\n };\n\n const isShown = (node: HTMLElement, root: HTMLElement) => {\n const rect = node.getBoundingClientRect();\n if (rect.width <= 0 || rect.height <= 0) return false;\n for (let cur: HTMLElement | null = node; cur; cur = cur === root ? null : cur.parentElement) {\n const cs = win?.getComputedStyle(cur);\n if (!cs) return false;\n if (cs.display === \"none\" || cs.visibility === \"hidden\" || Number(cs.opacity) === 0) return false;\n }\n return true;\n };\n\n /**\n * A tooltip that repeats text the person can already read in full is noise\n * (an expanded sidebar row, a \"Save\" button titled \"Save\"). It still shows\n * when that text is hidden (a collapsed rail's label) or cut off\n * (truncated) — the two cases a title exists for.\n */\n const isClipped = (host: HTMLElement, root: HTMLElement) => {\n for (let node: HTMLElement | null = host; node; node = node.parentElement) {\n if (node.scrollWidth > node.clientWidth + 1 && node.clientWidth > 0) return true;\n if (node.scrollHeight > node.clientHeight + 1 && node.clientHeight > 0) return true;\n if (node === root) break;\n }\n return false;\n };\n\n const repeatsVisibleText = (el: HTMLElement, text: string) => {\n const norm = (t: string) => t.replace(/\\s+/g, \" \").trim().toLowerCase();\n const want = norm(text);\n if (!want || !win) return false;\n const walker = doc.createTreeWalker(el, win.NodeFilter.SHOW_TEXT);\n for (let node = walker.nextNode(); node; node = walker.nextNode()) {\n if (norm(node.textContent ?? \"\") !== want) continue;\n const host = node.parentElement;\n if (!host || !isShown(host, el)) continue;\n // Cut off is measured on the BOX that clips: an inline host (a span inside a truncating\n // cell) has no box width of its own, so every ancestor up to the titled element is asked.\n if (isClipped(host, el)) continue;\n return true;\n }\n return false;\n };\n\n const show = (el: HTMLElement, instant: boolean) => {\n if (active !== el) return;\n // A Radix tooltip trigger shows its own tooltip — never a second one.\n if (el.closest(`[${TOOLTIP_TRIGGER_ATTR}]`)) return;\n const text = textOf(el);\n if (!text || !el.isConnected) return;\n if (repeatsVisibleText(el, text)) return;\n const node = ensureSurface();\n node.textContent = text;\n node.style.visibility = \"hidden\";\n // Measure and place BEFORE the open state starts the animation: measured\n // mid-animation the box reads at its 0.95 entry scale and lands off-centre.\n node.removeAttribute(\"data-state\");\n // The surface is ONE shared fixed element that keeps the `left` of its last\n // placement. Measured there, a longer text wraps against the room that is\n // left of the OLD spot, reads one line too tall, and lands a line too high\n // once it moves (the sandbox tooltip spec caught a 16px extra gap). Rewind\n // to the origin so the box is measured at its natural, unwrapped size.\n node.style.left = \"0px\";\n node.style.top = \"0px\";\n place(el, node);\n node.setAttribute(\"data-state\", instant ? \"instant-open\" : \"delayed-open\");\n node.style.visibility = \"visible\";\n if (el.id) node.id = `${el.id}-title-tooltip`;\n };\n\n const hide = () => {\n if (openTimer !== undefined) clearTimeout(openTimer);\n openTimer = undefined;\n cancelClose();\n holding = false;\n if (surface && surface.style.visibility === \"visible\") lastClosedAt = Date.now();\n if (surface) {\n surface.style.visibility = \"hidden\";\n surface.removeAttribute(\"data-state\");\n }\n };\n\n const cancelClose = () => {\n if (closeTimer !== undefined) clearTimeout(closeTimer);\n closeTimer = undefined;\n };\n\n const inSurface = (node: EventTarget | null) =>\n !!surface && !!win && node instanceof win.Node && surface.contains(node);\n\n const hasSelectionInSurface = () => {\n const sel = win?.getSelection();\n return !!sel && !sel.isCollapsed && !!surface && !!sel.anchorNode && surface.contains(sel.anchorNode);\n };\n\n /** Close after the bridge delay unless the pointer reached the tooltip or text in it is selected. */\n const scheduleClose = () => {\n cancelClose();\n // Nothing is showing yet (the open delay has not run, or the text was not worth drawing): there is\n // nothing to bridge to, so leaving simply cancels.\n if (!surface || surface.style.visibility !== \"visible\") {\n deactivate();\n return;\n }\n closeTimer = setTimeout(() => {\n closeTimer = undefined;\n if (holding || hasSelectionInSurface()) return;\n deactivate();\n }, TOOLTIP_CLOSE_DELAY_MS);\n };\n\n const activate = (el: HTMLElement) => {\n cancelClose();\n if (active === el) return;\n deactivate();\n active = el;\n lift(el);\n const instant = Date.now() - lastClosedAt < SKIP_DELAY_MS;\n if (instant) show(el, true);\n else openTimer = setTimeout(() => show(el, false), OPEN_DELAY_MS);\n };\n\n const deactivate = () => {\n hide();\n if (active) restore(active);\n active = null;\n };\n\n // A touch has no hover: the tap that focuses a button must not open its tooltip, and a tooltip\n // that is open when a finger lands closes. The compat mouse events and the focus a tap leaves\n // behind used to pin \"Copy chart source\" over the chart title on a phone (review 5, G13).\n let lastTouchAt = Number.NEGATIVE_INFINITY;\n const TOUCH_FOCUS_WINDOW_MS = 1000;\n const onPointerOver = (e: PointerEvent) => {\n if (e.pointerType === \"touch\") {\n lastTouchAt = Date.now();\n if (active) deactivate();\n return;\n }\n if (inSurface(e.target)) {\n cancelClose();\n return;\n }\n if (holding || hasSelectionInSurface()) {\n // Text is being selected in the tooltip: another control passing under the pointer must not replace it.\n return;\n }\n const el = titledAncestor(e.target);\n if (el) activate(el);\n else if (active && closeTimer === undefined) scheduleClose();\n };\n\n const onPointerOut = (e: PointerEvent) => {\n if (!active) return;\n const next = e.relatedTarget;\n if (next instanceof win!.Node && (active.contains(next) || inSurface(next))) return;\n if (inSurface(e.target)) {\n if (holding) return;\n scheduleClose();\n return;\n }\n scheduleClose();\n };\n\n const onPointerDown = (e: PointerEvent) => {\n if (e.pointerType === \"touch\") lastTouchAt = Date.now();\n if (inSurface(e.target)) {\n // Selecting the tooltip's text: keep it open until the press ends.\n holding = true;\n cancelClose();\n return;\n }\n deactivate();\n };\n\n const onPointerUp = () => {\n if (!holding) return;\n holding = false;\n if (!hasSelectionInSurface()) scheduleClose();\n };\n\n const onFocusIn = (e: FocusEvent) => {\n if (Date.now() - lastTouchAt < TOUCH_FOCUS_WINDOW_MS) return;\n const el = titledAncestor(e.target);\n if (!el) return;\n let visible = true;\n try {\n visible = (e.target as Element).matches(\":focus-visible\");\n } catch {\n visible = true;\n }\n if (visible) activate(el);\n };\n\n const onFocusOut = (e: FocusEvent) => {\n if (!active) return;\n const next = e.relatedTarget;\n if (next instanceof win!.Node && active.contains(next)) return;\n deactivate();\n };\n\n const onDismiss = (e?: Event) => {\n if (e && inSurface(e.target)) return;\n deactivate();\n };\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") deactivate();\n };\n\n doc.addEventListener(\"pointerover\", onPointerOver, true);\n doc.addEventListener(\"pointerout\", onPointerOut, true);\n doc.addEventListener(\"focusin\", onFocusIn, true);\n doc.addEventListener(\"focusout\", onFocusOut, true);\n doc.addEventListener(\"pointerdown\", onPointerDown, true);\n doc.addEventListener(\"pointerup\", onPointerUp, true);\n doc.addEventListener(\"keydown\", onKeyDown, true);\n doc.addEventListener(\"scroll\", onDismiss, true);\n win?.addEventListener(\"blur\", onDismiss);\n\n return () => {\n deactivate();\n doc.removeEventListener(\"pointerover\", onPointerOver, true);\n doc.removeEventListener(\"pointerout\", onPointerOut, true);\n doc.removeEventListener(\"focusin\", onFocusIn, true);\n doc.removeEventListener(\"focusout\", onFocusOut, true);\n doc.removeEventListener(\"pointerdown\", onPointerDown, true);\n doc.removeEventListener(\"pointerup\", onPointerUp, true);\n doc.removeEventListener(\"keydown\", onKeyDown, true);\n doc.removeEventListener(\"scroll\", onDismiss, true);\n win?.removeEventListener(\"blur\", onDismiss);\n surface?.remove();\n surface = null;\n };\n}\n","/**\n * THE MOTION CONTRACT (0.10.0) — the class names every animated surface in\n * this package puts on the DOM, in ONE place.\n *\n * Why a module and not ten inline strings: the sweep that produced this file\n * found the same defect ten times over, and it was invisible each time\n * because each primitive spelled its animation out by hand. Ten hand-written\n * copies of `data-[state=open]:animate-in data-[state=closed]:animate-out\n * data-[state=closed]:fade-out-0 …` meant ten chances to reach for a utility\n * nothing in the package defines — which is exactly what happened. A single\n * exported constant per motion SHAPE means the next primitive cannot invent\n * an eleventh spelling, and `styles.test.ts` can prove every one of them\n * resolves to a rule in the shipped stylesheet.\n *\n * Every rule these name lives in `styles.css` under the package's own\n * keyframes. NONE of them is a Tailwind utility, and none requires a host\n * plugin — see that file's header for the measurement that made this\n * necessary.\n */\n\n/** Modal scrims: Dialog, AlertDialog, Sheet, CommandDialog. Fade only. */\nexport const MOTION_OVERLAY = \"matrx-motion-overlay\";\n\n/** The centered dialog card. Fades and scales; centering is not its business. */\nexport const MOTION_DIALOG = \"matrx-motion-dialog\";\n\n/**\n * THE CENTERING OF A CENTERED DIALOG CARD — package-owned, in the `translate`\n * property, and NEVER a Tailwind `translate-x-[-50%] translate-y-[-50%]` pair.\n *\n * Those utilities do not compile to the same thing in every host: Tailwind v3\n * writes them into `transform`, Tailwind v4 writes them into the independent\n * `translate` property, which COMPOSES with `transform` instead of being\n * replaced by it. 0.10.0's keyframes restated the centering inside `transform`,\n * which was harmless on v3 and doubled the centering on v4 — the card flew in\n * from off the top-left of the viewport for the animation's whole duration and\n * snapped into place at the end (fixed in 0.10.1).\n *\n * Owning it here means one spelling that reads the same on both, and it frees\n * `transform` so the keyframes carry ONLY the delta. Put this on every centered\n * surface UNCONDITIONALLY — it is geometry, so unlike {@link MOTION_DIALOG} it\n * must survive `animated={false}`. Its rule ships in `styles.css`.\n */\nexport const CENTERED_DIALOG = \"matrx-dialog-centered\";\n\n/**\n * The resting gap between a `popper`-positioned surface and its trigger, for\n * the primitives that want one (today: `Select`). Same law and same reason as\n * {@link CENTERED_DIALOG} — a position an animated surface holds AT REST is\n * the `translate` property's job, never a Tailwind translate utility, because\n * those land in `transform` on a v3 host and in `translate` on a v4 one while\n * the keyframes animate `transform` either way. Sizes from\n * `--matrx-popper-offset`; keys off Radix's `data-side`.\n */\nexport const POPPER_OFFSET = \"matrx-popper-offset\";\n\n/** The mobile Dialog / CommandDialog bottom sheet. Slides up and fades. */\nexport const MOTION_BOTTOM_SHEET = \"matrx-motion-bottom-sheet\";\n\n/**\n * Radix-popper surfaces: Popover, DropdownMenu, ContextMenu, HoverCard,\n * Select, Tooltip. Reads `--radix-popper-transform-origin` so the surface\n * grows out of its trigger, and `data-side` so it travels from it.\n */\nexport const MOTION_POPPER = \"matrx-motion-popper\";\n\n/** Edge sheets, one class per `sheetVariants` side. */\nexport const MOTION_SHEET = {\n top: \"matrx-motion-sheet-top\",\n bottom: \"matrx-motion-sheet-bottom\",\n left: \"matrx-motion-sheet-left\",\n right: \"matrx-motion-sheet-right\",\n center: \"matrx-motion-sheet-center\",\n} as const;\n\n/** Skeleton's breathing loop. */\nexport const MOTION_PULSE = \"matrx-pulse\";\n/** A waiting box's crossing band of light (Skeleton `motion=\"shimmer\"`). Reduced motion: a slow breathe, no travel. */\nexport const MOTION_SHIMMER = \"matrx-shimmer\";\n\n/** The spinner loop, for every inline busy indicator in the package. */\nexport const MOTION_SPIN = \"matrx-spin\";\n\n/**\n * FirstUseHint's beacon: a soft ring that pulses three times around the anchor, on\n * `box-shadow` only, so nothing moves. A still ring under reduced motion.\n */\nexport const MOTION_HINT_BEACON = \"matrx-motion-hint-beacon\";\n\n/**\n * Every motion class the package ships, for the guards. If a rule for one of\n * these is missing from `styles.css`, a component animates in no consumer and\n * says nothing about it — the C26 failure this list exists to make loud.\n */\nexport const ALL_MOTION_CLASSES = [\n MOTION_OVERLAY,\n MOTION_DIALOG,\n MOTION_BOTTOM_SHEET,\n MOTION_POPPER,\n ...Object.values(MOTION_SHEET),\n MOTION_PULSE,\n MOTION_SHIMMER,\n MOTION_SPIN,\n MOTION_HINT_BEACON,\n] as const;\n\n/**\n * The host-plugin utilities this package is forbidden to emit. They are\n * supplied by `tailwindcss-animate` / `tw-animate-css`, which is a HOST CSS\n * entry concern a package cannot declare a dependency on: three of the four\n * AI Matrx consumers never loaded it, so every surface wearing these appeared\n * with no animation and no error. `styles.test.ts` fails the build if one\n * comes back.\n */\nexport const FORBIDDEN_HOST_MOTION_UTILITIES = [\n \"animate-in\",\n \"animate-out\",\n \"fade-in\",\n \"fade-out\",\n \"zoom-in\",\n \"zoom-out\",\n \"slide-in-from\",\n \"slide-out-to\",\n \"animate-accordion\",\n \"animate-slide-down\",\n \"animate-slide-up\",\n \"animate-pulse\",\n \"animate-spin\",\n] as const;\n\n/**\n * THE PANEL MOTION as a Tailwind class string (moved from matrx-frontend\n * `lib/motion/panel-motion.ts`): every panel, sidebar, dock, drawer and sheet\n * slides its size/position on the host's `--matrx-motion-duration-panel` /\n * `--matrx-motion-ease-panel` (tokens.css ships the standard). Pair it with the\n * transition property you animate (`transition-transform`, …).\n */\nexport const PANEL_MOTION_CLASS =\n \"duration-(--matrx-motion-duration-panel) ease-(--matrx-motion-ease-panel) motion-reduce:transition-none\";\nexport const PANEL_MOTION_DURATION_VAR = \"var(--matrx-motion-duration-panel)\";\nexport const PANEL_MOTION_EASE_VAR = \"var(--matrx-motion-ease-panel)\";\n","\"use client\";\n\n/**\n * Injected portal-container seam.\n *\n * The matrx-frontend original resolved nested portal targets through\n * `useNestedPortalContainer` (explicit prop > dialog content > popout body >\n * document.body) — a host-shaped hook wired to that app's dialog and\n * window-panel systems. The package inverts the seam: hosts provide the\n * resolved container through `PortalContainerProvider`; an explicit\n * `container` prop on a component still wins, and with neither the portal\n * falls through to `document.body` (Radix default). Priority semantics are\n * unchanged from the original.\n */\n\nimport * as React from \"react\";\n\n// Shared identity across independently bundled public entrypoints/loaders.\nconst CONTEXT_SLOT = Symbol.for(\"ai-matrx.design-system.portal-container-context\");\nconst contextRegistry = globalThis as typeof globalThis & { [CONTEXT_SLOT]?: React.Context<HTMLElement | null | undefined> };\nconst PortalContainerContext = contextRegistry[CONTEXT_SLOT] ??= React.createContext<HTMLElement | null | undefined>(undefined);\n\nexport interface PortalContainerProviderProps {\n /** Where nested Radix portals (Popover, etc.) should mount. `null`/`undefined` → document.body. */\n container: HTMLElement | null | undefined;\n children: React.ReactNode;\n}\n\nexport function PortalContainerProvider({\n container,\n children,\n}: PortalContainerProviderProps) {\n return (\n <PortalContainerContext.Provider value={container ?? undefined}>\n {children}\n </PortalContainerContext.Provider>\n );\n}\n\n/**\n * Resolve a portal target: explicit prop (including an explicit `null`,\n * meaning \"the default body\") beats the injected container.\n */\nexport function usePortalContainer(\n explicit?: HTMLElement | null,\n): HTMLElement | undefined {\n const injected = React.useContext(PortalContainerContext);\n\n if (explicit !== undefined) {\n return explicit ?? undefined;\n }\n\n return injected ?? undefined;\n}\n","/**\n * THE FOCUS-RETURN GUARD — a closing menu, popover, select or dialog never takes focus back from a\n * field the person has already moved into.\n *\n * Radix returns focus to the trigger when its content UNMOUNTS (FocusScope: a `setTimeout(0)` after the\n * exit animation, unconditionally). On a busy page that is hundreds of milliseconds after the person\n * picked an option — long enough for them to click the next field and start typing. The return then\n * lands mid-word: focus jumps to the trigger and every key after it is lost (\"https://drive…\" saved as\n * \"https:\", Applet social planner, 2026-10-08).\n *\n * `keepMovedFocus(handler)` composes a content's `onCloseAutoFocus`: when focus already sits on a live\n * element outside the closing content (not the page body), the return is canceled; otherwise Radix\n * returns focus to the trigger exactly as before (keyboard users closing with Escape keep their place).\n */\n/** True when focus has already moved to something the person chose, outside `container`. */\nexport function focusMovedElsewhere(container: EventTarget | null, doc: Document | undefined = typeof document === \"undefined\" ? undefined : document): boolean {\n if (!doc) return false;\n const active = doc.activeElement;\n if (!active || active === doc.body || active === doc.documentElement) return false;\n if (!active.isConnected) return false;\n if (container && typeof (container as Node).contains === \"function\" && (container as Node).contains(active)) return false;\n return true;\n}\n\n/** Compose a content's `onCloseAutoFocus` with THE FOCUS-RETURN GUARD (the caller's handler runs first). */\nexport function keepMovedFocus(handler?: (event: Event) => void): (event: Event) => void {\n return (event: Event) => {\n handler?.(event);\n if (event.defaultPrevented) return;\n const container = (event.currentTarget ?? event.target) as EventTarget | null;\n if (focusMovedElsewhere(container, (container as Node | null)?.ownerDocument ?? undefined)) event.preventDefault();\n };\n}\n","\"use client\";\n\n/**\n * 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","/**\n * The opaque surface option shared by every floating menu surface\n * (`PopoverContent`, `DropdownMenuContent`, `DropdownMenuSubContent`).\n * `data-surface=\"solid\"` is also styled in `styles.css`, so the fill holds even\n * where a host utility layer tints the default surface.\n */\nexport type PopoverSurface = \"default\" | \"solid\";\n\nexport const SOLID_SURFACE_CLASS =\n \"bg-[hsl(var(--popover)/1)] [backdrop-filter:none] [-webkit-backdrop-filter:none]\";\n","\"use client\";\n\n/**\n * Select — ported verbatim from matrx-frontend `components/ui/select.tsx`.\n *\n * Seam inversions:\n * - The host's `useNestedPortalContainer` (dialog/popout aware) becomes the\n * injected `PortalContainerProvider` seam (`portal-container.tsx`); the\n * explicit `container` prop keeps top priority, exactly as before.\n * - `ChevronDownIcon` / `ChevronUpIcon` / `CheckIcon` come from the package's\n * inlined SVGs (C19), not @radix-ui/react-icons — same glyphs, same\n * viewBoxes. (The origin also imported `CaretSortIcon` without ever using\n * it; the dead import is not carried along.)\n *\n * THE ROOT RENDERS UNCONDITIONALLY — no mount gate. This wrapper used to defer\n * rendering until after hydration (\"Radix generates dynamic aria-controls ids\n * that differ between SSR and client\"), and that justification was false:\n * Radix ids come from React's SSR-stable `useId` (verified against\n * @radix-ui/react-select 2.3.1 / react-id 1.1.2). The gate was actively\n * harmful — it deleted the ALWAYS-VISIBLE select trigger (a form control)\n * from SSR and the first client paint.\n */\n\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { MOTION_POPPER, POPPER_OFFSET } from \"./motion\";\nimport { RadixCheckIcon, RadixChevronDownIcon, RadixChevronUpIcon } from \"./icons\";\nimport { usePortalContainer } from \"./portal-container\";\nimport { FIELD_SURFACE_CLASS } from \"./field-surface\";\nimport { keepMovedFocus } from \"./focus-return\";\n\nexport const Select = SelectPrimitive.Root;\n\nexport const SelectGroup = SelectPrimitive.Group;\n\nexport const SelectValue = SelectPrimitive.Value;\n\nexport const selectTriggerVariants = cva(\n `matrx-glyph-trim flex w-full items-center justify-between gap-2 whitespace-nowrap rounded-md ${FIELD_SURFACE_CLASS} text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground transition-colors hover:bg-accent hover:border-accent-foreground/20 focus:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15 data-[state=open]:border-primary disabled:cursor-not-allowed disabled:bg-muted disabled:text-disabled-foreground [&>span]:min-w-0 [&>span]:line-clamp-1`,\n {\n variants: {\n size: {\n sm: \"h-7 px-2 py-1 text-xs\",\n default: \"h-9 px-3 py-1\",\n lg: \"h-10 px-3 py-2\",\n },\n },\n defaultVariants: {\n size: \"default\",\n },\n },\n);\n\n/**\n * THE ONE DROPDOWN CHEVRON (page-pass 2026-09-27, /crm/<id>). Pickers drew three\n * different trigger glyphs side by side — a down chevron, an up-down pair, and\n * a larger up-down — so one form read as three kinds of control. Every dropdown\n * trigger (Select, CreatablePicker, every host combobox) draws THIS.\n */\nexport function SelectChevron({ className, size = \"default\" }: { className?: string | undefined; size?: \"sm\" | \"default\" | undefined }) {\n return (\n <RadixChevronDownIcon\n aria-hidden=\"true\"\n data-select-chevron=\"\"\n className={cn(size === \"sm\" ? \"h-3.5 w-3.5\" : \"h-4 w-4\", \"shrink-0 opacity-50\", className)}\n />\n );\n}\n\nexport interface SelectTriggerProps\n extends\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>,\n VariantProps<typeof selectTriggerVariants> {\n hideArrow?: boolean;\n}\n\nexport const SelectTrigger = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Trigger>,\n SelectTriggerProps\n>(({ className, children, hideArrow = false, size, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(selectTriggerVariants({ size, className }))}\n {...props}\n >\n {children}\n {!hideArrow && (\n <SelectPrimitive.Icon asChild>\n <SelectChevron size={size === \"sm\" ? \"sm\" : \"default\"} />\n </SelectPrimitive.Icon>\n )}\n </SelectPrimitive.Trigger>\n));\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nexport const SelectScrollUpButton = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className,\n )}\n {...props}\n >\n <RadixChevronUpIcon />\n </SelectPrimitive.ScrollUpButton>\n));\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\nexport const SelectScrollDownButton = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className,\n )}\n {...props}\n >\n <RadixChevronDownIcon />\n </SelectPrimitive.ScrollDownButton>\n));\nSelectScrollDownButton.displayName =\n SelectPrimitive.ScrollDownButton.displayName;\n\nexport interface SelectContentProps\n extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> {\n /** Explicit portal target; wins over the injected container. */\n container?: HTMLElement | null;\n /**\n * Package-owned open/close motion. Default `true`. Pass `false` for a\n * surface that must appear instantly. It is NOT the reduced-motion switch;\n * `styles.css` already honors `prefers-reduced-motion`.\n */\n animated?: boolean;\n}\n\nexport const SelectContent = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Content>,\n SelectContentProps\n>(\n (\n {\n className,\n children,\n position = \"popper\",\n container,\n animated = true,\n onCloseAutoFocus,\n ...props\n },\n ref,\n ) => {\n const portalContainer = usePortalContainer(container);\n return (\n <SelectPrimitive.Portal container={portalContainer}>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n \"relative z-[10001] max-h-96 min-w-[8rem] max-w-[calc(100vw-2rem)] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md\",\n animated && MOTION_POPPER,\n // The resting gap from the trigger. It is the `translate` property\n // (POPPER_OFFSET), never Tailwind translate utilities: those compose\n // with `transform` on a v4 host and are REPLACED by it on a v3 one,\n // so on v3 the animation ate the gap and the surface snapped 4px at\n // the end. Same law as the centered dialog card — see motion.ts.\n position === \"popper\" && POPPER_OFFSET,\n className,\n )}\n position={position}\n {...props}\n onCloseAutoFocus={keepMovedFocus(onCloseAutoFocus)}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n \"max-w-full overflow-y-auto p-0.5\",\n position === \"popper\" &&\n \"w-full min-w-[var(--radix-select-trigger-width)] max-h-[var(--radix-select-content-available-height)]\",\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n});\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nexport const SelectLabel = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn(\"type-label px-2 pb-1 pt-2 text-muted-foreground\", className)}\n {...props}\n />\n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\nexport const SelectItem = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> & {\n /**\n * What the option means, as its HOVER text — never a second line (Arman,\n * 2026-10-14: no \"novels\" in menus). An option is one line; the trigger\n * shows exactly that line.\n */\n description?: string;\n /** Short trailing text in the menu only (a count, a size, why it cannot be chosen); the trigger never shows it. */\n meta?: React.ReactNode;\n }\n>(({ className, children, description, meta, title, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n title={title ?? description}\n className={cn(\n \"relative flex w-full min-w-0 select-none items-center rounded-sm py-1 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:text-disabled-foreground\",\n className,\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex h-3.5 w-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <RadixCheckIcon className=\"h-4 w-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <span className=\"min-w-0 whitespace-normal break-words [overflow-wrap:anywhere]\">\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </span>\n {meta ? (\n <span data-slot=\"select-item-meta\" className=\"ml-3 min-w-0 shrink text-xs text-muted-foreground [overflow-wrap:anywhere]\">\n {meta}\n </span>\n ) : null}\n </SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\nexport const SelectSeparator = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n","/**\n * THE ONE FIELD SURFACE (page-pass shared fix, 2026-09-27).\n *\n * Every control a person types into or picks from — Input, BasicInput,\n * Textarea, the Select trigger, and the host's ProInput / ProTextarea — sits on\n * this fill and this border. They used to disagree: Input and the elevated\n * Textarea filled with `bg-background` (the gray page color in light mode),\n * BasicInput and the control Textarea were `bg-transparent` (gray on a gray\n * page), while the Select trigger filled with `bg-card` (white). On one form\n * the text fields therefore looked disabled beside white Selects\n * (/hr/settings/employer, the message-template editor) — a screen that lies\n * about what it will let you do.\n *\n * The surface is the Select's: the card fill and the regular border. A caller\n * that genuinely wants no fill (an inline cell editor) still passes\n * `bg-transparent`, which wins through `cn`.\n */\nexport const FIELD_SURFACE_CLASS = \"border border-border bg-card\";\n","import * as React from \"react\";\n\n/** True when a node holds visible text anywhere in its React tree. */\nfunction hasText(node: React.ReactNode): boolean {\n if (typeof node === \"string\") return node.trim().length > 0;\n if (typeof node === \"number\" || typeof node === \"bigint\") return true;\n if (Array.isArray(node)) return node.some(hasText);\n if (React.isValidElement<{ children?: React.ReactNode }>(node)) return hasText(node.props.children);\n return false;\n}\n\n/**\n * A segment whose children are a glyph and no text — the square segment. Decided here, not in\n * CSS: `:has(> svg:only-child)` ignores text nodes, so an icon + name tab matched as well.\n */\nexport function isIconOnly(children: React.ReactNode): boolean {\n return React.Children.toArray(children).some((c) => React.isValidElement(c)) && !hasText(children);\n}\n","\"use client\";\n\n/**\n * Textarea — the multi-line twin of the Input family, same three shapes:\n * `Textarea` (elevated), `BasicTextarea` (plain control), and\n * `TextareaWithPrefix`.\n *\n * WHAT THE FORKS PROVED. Three hosts shipped a bare `<textarea>` with a\n * min-height and nothing else; matrx-frontend shipped auto-grow, min/max\n * height clamping, and a stretch-detection pass. That last one is the reason\n * this file is worth having: a `<textarea>` is a REPLACED element, so\n * `className=\"h-full\"` on it does nothing useful unless its parent is also\n * told to stretch — which is why every host that wanted a filling textarea\n * ended up wrapping it by hand at the call site, differently each time.\n * `getStretchClasses` reads the caller's own fill intent out of the className\n * and builds the wrapper for them.\n *\n * COLOR IS TOKENS (C26). The ported original pinned its body text to literal\n * black/white, its placeholder and focus ring to raw palette steps, and its\n * dark elevation to a custom property no host defined — so that shadow\n * computed to nothing. All four now resolve from the semantic vocabulary.\n *\n * AND `shadow-textarea` NOW EXISTS. The original's resting elevation class was\n * `shadow-textarea`, and NO host defined `--shadow-textarea` or generated that\n * utility — 125 call sites asked for an elevation they never got. The package\n * ships the token (defaulting to the Input family's `--shadow-input`, which is\n * plainly what the twin class meant) and the rule, so the class finally does\n * what it says. A host that wants the flat look sets `--shadow-textarea: none`.\n *\n * The clipboard/motion variants matrx-frontend layers on top (CopyTextarea,\n * FancyTextarea) stay host-owned under the C8 split-out law: they drag in\n * `motion/react`, and plain-textarea consumers must not pay for it.\n */\n\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { FIELD_SURFACE_CLASS } from \"./field-surface\";\n\nexport interface TextareaProps\n extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {\n /** Grow to fit content as the user types (and stop growing at `maxHeight`). */\n autoGrow?: boolean;\n /** Minimum height in px. */\n minHeight?: number;\n /** Maximum height in px; past it the field scrolls instead of growing. */\n maxHeight?: number;\n /** Classes for the wrapper this component adds when one is needed. */\n wrapperClassName?: string;\n}\n\nconst FILL_HEIGHT_REGEX = /(?:^|\\s)(h-full|h-dvh|flex-1|grow)(?:\\s|$)/;\nconst FILL_WIDTH_REGEX = /(?:^|\\s)(w-full|w-screen)(?:\\s|$)/;\n\n/**\n * A `<textarea>` cannot fill a box on its own — the box has to be told too.\n * Read the caller's fill intent out of its own className and mirror it onto\n * the wrapper, so `className=\"h-full\"` means what the caller thought it meant.\n */\nfunction getStretchClasses(className?: string): string | undefined {\n if (!className) return undefined;\n const fills: string[] = [];\n if (FILL_HEIGHT_REGEX.test(className)) fills.push(\"h-full min-h-0\");\n if (FILL_WIDTH_REGEX.test(className)) fills.push(\"w-full\");\n return fills.length ? fills.join(\" \") : undefined;\n}\n\nconst TEXTAREA_ELEVATED_CLASS =\n `flex h-auto w-full rounded-md ${FIELD_SURFACE_CLASS} px-3 py-2 text-sm text-foreground shadow-textarea transition duration-400 placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15 disabled:cursor-not-allowed disabled:opacity-50`;\n\nconst TEXTAREA_CONTROL_CLASS =\n `flex w-full rounded-md ${FIELD_SURFACE_CLASS} px-3 py-2 text-sm text-foreground shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15 disabled:cursor-not-allowed disabled:opacity-50`;\n\nexport function useAutoGrow(\n ref: React.RefObject<HTMLTextAreaElement | null>,\n value: React.TextareaHTMLAttributes<HTMLTextAreaElement>[\"value\"],\n autoGrow = false,\n minHeight?: number,\n maxHeight?: number,\n): void {\n React.useEffect(() => {\n if (!autoGrow || !ref.current) return;\n\n const textarea = ref.current;\n textarea.style.height = \"auto\";\n\n let newHeight = textarea.scrollHeight;\n if (minHeight) newHeight = Math.max(newHeight, minHeight);\n\n if (maxHeight && newHeight >= maxHeight) {\n textarea.style.height = `${maxHeight}px`;\n textarea.style.overflowY = \"auto\";\n } else {\n textarea.style.height = `${newHeight}px`;\n textarea.style.overflowY = \"hidden\";\n }\n }, [value, autoGrow, minHeight, maxHeight, ref]);\n}\n\n/** Merge a forwarded ref with the internal one auto-grow needs to measure. */\nexport function useMergedTextareaRef(\n forwarded: React.ForwardedRef<HTMLTextAreaElement>,\n): {\n ref: React.RefObject<HTMLTextAreaElement | null>;\n callback: (node: HTMLTextAreaElement | null) => void;\n} {\n const internal = React.useRef<HTMLTextAreaElement | null>(null);\n const callback = React.useCallback(\n (node: HTMLTextAreaElement | null) => {\n internal.current = node;\n if (typeof forwarded === \"function\") forwarded(node);\n else if (forwarded) forwarded.current = node;\n },\n [forwarded],\n );\n return { ref: internal, callback };\n}\n\nexport function boxStyle(\n minHeight?: number,\n maxHeight?: number,\n): React.CSSProperties | undefined {\n if (minHeight === undefined && maxHeight === undefined) return undefined;\n return {\n minHeight: minHeight ? `${minHeight}px` : undefined,\n maxHeight: maxHeight ? `${maxHeight}px` : undefined,\n };\n}\n\n/** The elevated textarea — the Input family's `Input`, in multi-line form. */\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n (\n { className, autoGrow, minHeight, maxHeight, wrapperClassName, ...props },\n forwarded,\n ) => {\n const { ref, callback } = useMergedTextareaRef(forwarded);\n const stretchClasses = getStretchClasses(className);\n const needsWrapper = Boolean(wrapperClassName || stretchClasses);\n\n useAutoGrow(ref, props.value, autoGrow, minHeight, maxHeight);\n\n const textarea = (\n <textarea\n ref={callback}\n data-slot=\"textarea\"\n className={cn(\n TEXTAREA_ELEVATED_CLASS,\n autoGrow && \"resize-none\",\n stretchClasses,\n className,\n )}\n style={boxStyle(minHeight, maxHeight)}\n {...props}\n />\n );\n\n if (!needsWrapper) return textarea;\n\n return <div className={cn(stretchClasses, wrapperClassName)}>{textarea}</div>;\n },\n);\nTextarea.displayName = \"Textarea\";\n\n/**\n * The plain control — a bordered, transparent field with a 60px floor. This is\n * what matrx-extend, aidream/apps/dashboard and workflow-studio each called\n * `Textarea`; the floor is theirs and it is the sensible default (a one-line\n * box for multi-line content invites a scrollbar on the first Enter).\n */\nconst BasicTextarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, autoGrow, minHeight, maxHeight, ...props }, forwarded) => {\n const { ref, callback } = useMergedTextareaRef(forwarded);\n\n useAutoGrow(ref, props.value, autoGrow, minHeight, maxHeight);\n\n return (\n <textarea\n ref={callback}\n data-slot=\"textarea\"\n className={cn(\n TEXTAREA_CONTROL_CLASS,\n \"h-auto min-h-[60px]\",\n autoGrow && \"resize-none\",\n className,\n )}\n style={boxStyle(minHeight, maxHeight)}\n {...props}\n />\n );\n },\n);\nBasicTextarea.displayName = \"BasicTextarea\";\n\nexport interface TextareaWithPrefixProps extends Omit<TextareaProps, \"prefix\"> {\n /** Leading adornment, absolutely placed at the field's top-left. */\n prefix?: React.ReactNode;\n}\n\nconst TextareaWithPrefix = React.forwardRef<\n HTMLTextAreaElement,\n TextareaWithPrefixProps\n>(\n (\n {\n prefix,\n className,\n wrapperClassName,\n autoGrow,\n minHeight,\n maxHeight,\n ...props\n },\n forwarded,\n ) => {\n const { ref, callback } = useMergedTextareaRef(forwarded);\n\n useAutoGrow(ref, props.value, autoGrow, minHeight, maxHeight);\n\n return (\n <div\n className={cn(\"relative\", getStretchClasses(className), wrapperClassName)}\n >\n {prefix ? (\n <div className=\"pointer-events-none absolute left-3 top-3 z-10 text-muted-foreground\">\n {prefix}\n </div>\n ) : null}\n <textarea\n ref={callback}\n data-slot=\"textarea\"\n className={cn(\n TEXTAREA_CONTROL_CLASS,\n \"resize-y\",\n prefix && \"pl-10\",\n autoGrow && \"resize-none\",\n className,\n )}\n style={boxStyle(minHeight, maxHeight)}\n {...props}\n />\n </div>\n );\n },\n);\nTextareaWithPrefix.displayName = \"TextareaWithPrefix\";\n\nexport { BasicTextarea, Textarea, TextareaWithPrefix };\n","\"use client\";\n\nimport { CircleAlertIcon as AlertCircle, AlertTriangleIcon as AlertTriangle, ChevronRightIcon as ChevronRight, Loader2Icon as LoaderCircle } from \"../icons\";\nimport type { ReactNode } from \"react\";\nimport { cn } from \"../cn\";\nimport { SettingsHostLink as AppLink } from \"./host\";\nimport type { SettingsBadge, SettingsCommonProps } from \"./types\";\nimport { SettingsHostErrorMenu as ErrorAlchemyMenu } from \"./host\";\nimport { Tile } from \"../controls/surfaces\";\n\nexport type SettingsNavigationRowProps = SettingsCommonProps & {\n value?: ReactNode;\n loading?: boolean;\n last?: boolean;\n} & (\n | { href: string; onNavigate?: never }\n | { href?: never; onNavigate: () => void }\n );\n\n/** A settings row with exactly one navigation action. */\nexport function SettingsNavigationRow({\n href,\n onNavigate,\n value,\n loading = false,\n last,\n disabled,\n label,\n description,\n warning,\n error,\n badge,\n icon: Icon,\n modified,\n id,\n}: SettingsNavigationRowProps) {\n const rowClass = cn(\n \"flex min-h-11 w-full items-center gap-3 px-4 py-2.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring sm:min-h-9\",\n !disabled && !loading && \"hover:bg-accent/60\",\n (disabled || loading) && \"cursor-default text-disabled-foreground\",\n !last && \"border-b border-border/40\",\n );\n const content = (\n <>\n <span className=\"min-w-0 flex-1\">\n <span className=\"flex min-w-0 items-center gap-1.5\">\n {modified && (\n <span\n aria-label=\"Modified from default\"\n className=\"h-1.5 w-1.5 shrink-0 rounded-full bg-primary\"\n />\n )}\n {Icon && (\n <Icon\n className=\"h-4 w-4 shrink-0 text-muted-foreground\"\n aria-hidden=\"true\"\n />\n )}\n <span className=\"truncate type-title text-foreground\">\n {label}\n </span>\n {badge && <Badge badge={badge} />}\n </span>\n {description && (\n <span className=\"mt-0.5 block type-secondary leading-snug text-muted-foreground sm:truncate\">\n {description}\n </span>\n )}\n {warning && (\n <span className=\"mt-1 flex items-start gap-1.5 type-secondary leading-snug text-amber-600 dark:text-amber-400\">\n <AlertTriangle\n className=\"mt-0.5 h-3.5 w-3.5 shrink-0\"\n aria-hidden=\"true\"\n />\n <span className=\"break-words\">{warning}</span>\n </span>\n )}\n {error && (\n <span className=\"mt-1 flex items-start gap-1.5 type-secondary leading-snug text-red-600 dark:text-red-400\">\n <AlertCircle\n className=\"mt-0.5 h-3.5 w-3.5 shrink-0\"\n aria-hidden=\"true\"\n />\n <span className=\"break-words\">{error}</span>\n <ErrorAlchemyMenu error={error} />\n </span>\n )}\n </span>\n {value && (\n <span className=\"min-w-0 max-w-40 truncate type-body text-muted-foreground\">\n {value}\n </span>\n )}\n {loading ? (\n <LoaderCircle\n className=\"h-4 w-4 shrink-0 animate-spin text-muted-foreground\"\n aria-hidden=\"true\"\n />\n ) : (\n <ChevronRight\n className=\"h-4 w-4 shrink-0 text-muted-foreground\"\n aria-hidden=\"true\"\n />\n )}\n </>\n );\n\n if (disabled || loading) {\n return (\n <div\n id={id}\n className={rowClass}\n aria-disabled=\"true\"\n aria-busy={loading || undefined}\n >\n {content}\n </div>\n );\n }\n if (href) {\n return (\n <AppLink id={id} className={rowClass} href={href}>\n {content}\n </AppLink>\n );\n }\n return (\n <Tile id={id} className={rowClass} type=\"button\" onClick={onNavigate} dense variant=\"quiet\" title={content} />\n );\n}\n\nfunction Badge({ badge }: { badge: SettingsBadge }) {\n return (\n <span className=\"rounded border border-border bg-muted px-1.5 py-0 type-meta font-semibold uppercase tracking-wide text-muted-foreground\">\n {badge.label}\n </span>\n );\n}\n","import type { ReactNode } from \"react\";\n\nexport type SettingsPageProps = { children: ReactNode };\n\n/**\n * Content canvas for a settings route or overlay. The surrounding shell owns\n * scrolling so this component never creates a nested scroll region.\n * `matrx-touch-targets` gives every control inside a 44px floor on touch and\n * below `lg`; desktop density is untouched.\n */\nexport function SettingsPage({ children }: SettingsPageProps) {\n return (\n <div className=\"matrx-touch-targets mx-auto min-h-full w-full max-w-5xl px-4 py-5 sm:px-6 sm:py-7 lg:px-8\">\n {children}\n </div>\n );\n}\n","\"use client\";\n\nimport { AlertTriangleIcon as AlertTriangle, CircleAlertIcon as AlertCircle, CircleHelpIcon as HelpCircle } from \"../icons\";\nimport * as Popover from \"@radix-ui/react-popover\";\nimport { useId, useRef, useState } from \"react\";\nimport { cn } from \"../cn\";\nimport type {\n SettingsCommonProps,\n SettingsRowVariant,\n SettingsRowDensity,\n SettingsBadge,\n} from \"./types\";\nimport { useSettingsDesign } from \"./SettingsDesignProvider\";\nimport { useSettingsSectionTitle } from \"./SettingsSectionContext\";\nimport { SettingsHostAnchor as SettingAnchor } from \"./host\";\nimport { settingsControlSearchId } from \"./searchIdentity\";\nimport { SettingsHostErrorMenu as ErrorAlchemyMenu } from \"./host\";\nimport { ResetTapButton } from \"../tap-target/buttons\";\nimport { Button } from \"../controls/controls\";\nimport { Tile } from \"../controls/surfaces\";\n\ntype SettingsRowProps = SettingsCommonProps & {\n /** Layout variant. Defaults to \"inline\". */\n variant?: SettingsRowVariant | undefined;\n /** Row density. Defaults to \"default\". */\n density?: SettingsRowDensity | undefined;\n /** The control (switch, input, slider, etc.) rendered on the right or below. */\n children: React.ReactNode;\n /** Whether this row is the last in a section. Removes trailing border. */\n last?: boolean | undefined;\n /** Wide controls stack below their label on narrow screens. */\n controlLayout?: \"compact\" | \"wide\" | undefined;\n /** Stable row anchor used by settings search and deep links. */\n anchorId?: string | undefined;\n /** Override the label target; pass null when the row exposes a labeled group. */\n labelFor?: string | null;\n};\n\nconst densityStyles: Record<SettingsRowDensity, string> = {\n compact: \"py-2.5\",\n default: \"py-3.5\",\n comfortable: \"py-4.5\",\n};\n\nconst badgeStyles: Record<SettingsBadge[\"variant\"], string> = {\n default: \"bg-muted text-muted-foreground border border-border\",\n new: \"bg-blue-500/10 text-blue-600 dark:text-blue-400 border border-blue-500/20\",\n beta: \"bg-purple-500/10 text-purple-600 dark:text-purple-400 border border-purple-500/20\",\n experimental:\n \"bg-amber-500/10 text-amber-600 dark:text-amber-400 border border-amber-500/20\",\n deprecated:\n \"bg-red-500/10 text-red-600 dark:text-red-400 border border-red-500/20\",\n admin:\n \"bg-foreground text-background border border-border\",\n};\n\nfunction BadgePill({ badge }: { badge: SettingsBadge }) {\n return (\n <span\n className={cn(\n \"inline-flex items-center rounded px-1.5 py-0 type-meta font-semibold uppercase tracking-wide leading-4\",\n badgeStyles[badge.variant],\n )}\n >\n {badge.label}\n </span>\n );\n}\n\n/**\n * SettingsRow — base layout for every settings control.\n *\n * Rarely used directly by tab authors. Each primitive (SettingsSwitch,\n * SettingsSelect, etc.) composes this internally and exposes a flat prop API.\n *\n * Variants handle layout differences; NEVER accept a className.\n */\nexport function SettingsRow({\n label,\n description,\n meta,\n warning,\n error,\n badge,\n icon: Icon,\n disabled,\n modified,\n id,\n helpText,\n variant = \"inline\",\n density = \"default\",\n children,\n last,\n controlLayout = \"compact\",\n anchorId,\n labelFor,\n onReset,\n resetLabel,\n}: SettingsRowProps) {\n const { variant: designVariant } = useSettingsDesign();\n const sectionTitle = useSettingsSectionTitle();\n const reactId = useId().replace(/:/g, \"\");\n // Input ids are React-instance ids. Search/deep-link ids intentionally use\n // only the authored section + label, so they survive remounts and markup.\n const inputId = id ?? `settings-input-${reactId}`;\n const labelId = `${inputId}-label`;\n const controlId = settingsControlSearchId(sectionTitle ?? \"Settings\", label);\n const rowAnchorId = anchorId ?? controlId;\n\n // One reset door, only when there is something to reset. A row that CAN\n // reset always reserves the slot (the same 36px as a ladder row's History\n // button), so every control on a screen ends at one edge instead of\n // shifting when a value changes.\n const resetButton = onReset ? (\n // The slot is the tap button's own box (never a fixed-size wrapper, which\n // squeezed the button off its geometry); hidden, not removed, so the slot\n // stays reserved and `visibility: hidden` drops it from the tab order.\n <span\n className={cn(\"inline-flex shrink-0\", !(modified && !disabled) && \"invisible\")}\n aria-hidden={modified && !disabled ? undefined : true}\n >\n <ResetTapButton\n variant=\"transparent\"\n ariaLabel={resetLabel ?? `Reset ${label.toLowerCase()} to default`}\n onClick={onReset}\n />\n </span>\n ) : null;\n\n const labelBlock = (\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex min-w-0 flex-wrap items-center gap-1.5\">\n {modified && (\n <span\n role=\"img\"\n aria-label=\"Changed from the default\"\n title=\"Changed from the default\"\n className=\"h-1.5 w-1.5 rounded-full bg-primary shrink-0\"\n />\n )}\n {Icon && (\n <Icon className=\"h-3.5 w-3.5 text-muted-foreground shrink-0\" />\n )}\n {labelFor === null ? (\n <span\n id={labelId}\n className={cn(\n \"min-w-0 break-words type-title leading-snug text-foreground\",\n disabled && \"text-disabled-foreground\",\n )}\n >\n {label}\n </span>\n ) : (\n <label\n id={labelId}\n htmlFor={labelFor ?? inputId}\n className={cn(\n \"min-w-0 break-words text-sm font-medium leading-snug text-foreground\",\n disabled && \"text-disabled-foreground\",\n )}\n >\n {label}\n </label>\n )}\n {badge && <BadgePill badge={badge} />}\n {/* The description is printed in full under the label; the help\n popover holds only the extra help, never a repeat of it. One\n popover for every design variant: a hover tooltip never opens on a\n phone, and its contents (a copy button) could not be reached. */}\n {helpText && <CompactHelpPopover label={label} helpText={helpText} />}\n </div>\n {meta ? (\n <div\n className={cn(\n \"mt-0.5 flex flex-wrap items-center gap-x-1.5 gap-y-0.5 break-words type-meta leading-snug text-muted-foreground [overflow-wrap:anywhere]\",\n disabled && \"text-disabled-foreground\",\n )}\n >\n {meta}\n </div>\n ) : null}\n {description ? (\n <TruncatedDescription description={description} disabled={disabled} />\n ) : null}\n {warning && (\n <div className=\"mt-1 flex items-start gap-1.5 type-secondary text-amber-600 dark:text-amber-400\">\n <AlertTriangle className=\"h-3.5 w-3.5 shrink-0 mt-0.5\" />\n <span className=\"break-words leading-snug\">{warning}</span>\n </div>\n )}\n {error && (\n <div className=\"mt-1 flex items-start gap-1.5 type-secondary text-red-600 dark:text-red-400\">\n <AlertCircle className=\"h-3.5 w-3.5 shrink-0 mt-0.5\" />\n <span className=\"break-words leading-snug\">{error}</span>\n <ErrorAlchemyMenu error={error} />\n </div>\n )}\n </div>\n );\n\n if (variant === \"block\") {\n return (\n <SettingAnchor id={rowAnchorId}>\n <div\n className={cn(\n \"px-4 border-b border-border/40\",\n densityStyles[\n designVariant === \"compact\" && density === \"default\"\n ? \"compact\"\n : density\n ],\n last && \"border-b-0\",\n )}\n >\n {children}\n </div>\n </SettingAnchor>\n );\n }\n\n if (variant === \"stacked\") {\n return (\n <SettingAnchor id={rowAnchorId}>\n <div\n className={cn(\n \"px-4 border-b border-border/40\",\n densityStyles[\n designVariant === \"compact\" && density === \"default\"\n ? \"compact\"\n : density\n ],\n last && \"border-b-0\",\n )}\n >\n <div className=\"mb-2.5\">{labelBlock}</div>\n <div className={cn(\"flex items-center gap-2\", disabled && \"text-disabled-foreground\")}>\n <div className=\"min-w-0 flex-1\">{children}</div>\n {resetButton}\n </div>\n </div>\n </SettingAnchor>\n );\n }\n\n return (\n <SettingAnchor id={rowAnchorId}>\n <div\n className={cn(\n controlLayout === \"wide\"\n ? \"flex flex-col items-stretch gap-2 border-b border-border/40 px-4 @[40rem]/settings:flex-row @[40rem]/settings:items-center @[40rem]/settings:gap-4\"\n : \"flex items-center gap-4 px-4 border-b border-border/40\",\n densityStyles[\n designVariant === \"compact\" && density === \"default\"\n ? \"compact\"\n : density\n ],\n last && \"border-b-0\",\n )}\n >\n {labelBlock}\n <div\n className={cn(\n controlLayout === \"wide\"\n ? \"w-full min-w-0 max-w-full [&_button]:max-w-full [&_input]:max-w-full @[40rem]/settings:w-auto @[40rem]/settings:shrink-0\"\n : \"w-auto min-w-0 max-w-full shrink-0 [&_button]:max-w-full [&_input]:max-w-full\",\n resetButton && \"flex items-center gap-1\",\n disabled && \"text-disabled-foreground\",\n )}\n >\n {/* The reset sits beside its control on every width, never on a\n line of its own under it. */}\n {resetButton ? <div className=\"min-w-0 flex-1\">{children}</div> : children}\n {resetButton}\n </div>\n </div>\n </SettingAnchor>\n );\n}\n\n/**\n * One line, truncated. When the text does not fit (a phone), a press opens the\n * full text in a popover; when it fits, the line is plain text and never opens.\n */\nfunction TruncatedDescription({\n description,\n disabled,\n}: Pick<SettingsCommonProps, \"description\" | \"disabled\">) {\n const lineRef = useRef<HTMLButtonElement>(null);\n const [open, setOpen] = useState(false);\n // Rich content (links, controls) cannot sit inside a button; it keeps wrapping.\n if (typeof description !== \"string\") {\n return (\n <div\n className={cn(\n \"mt-0.5 break-words type-secondary leading-snug text-muted-foreground\",\n disabled && \"text-disabled-foreground\",\n )}\n >\n {description}\n </div>\n );\n }\n return (\n <Popover.Root\n open={open}\n onOpenChange={(next) => {\n const el = lineRef.current;\n setOpen(next && !!el && el.scrollWidth > el.clientWidth);\n }}\n >\n <Popover.Trigger asChild>\n <Tile\n ref={lineRef}\n type=\"button\"\n dense\n variant=\"quiet\"\n title={description}\n className=\"mt-0.5 w-full min-w-0\"\n data-touch-exempt\n disabled={disabled}\n >\n </Tile>\n </Popover.Trigger>\n <Popover.Portal>\n <Popover.Content\n side=\"bottom\"\n align=\"start\"\n sideOffset={6}\n className=\"z-50 w-72 max-w-[calc(100vw-2rem)] break-words rounded-md border border-border bg-popover p-3 type-secondary leading-snug text-popover-foreground shadow-md [overflow-wrap:anywhere]\"\n >\n {description}\n </Popover.Content>\n </Popover.Portal>\n </Popover.Root>\n );\n}\n\nexport function CompactHelpPopover({\n label,\n description,\n helpText,\n}: Pick<SettingsCommonProps, \"label\" | \"description\" | \"helpText\">) {\n return (\n <Popover.Root>\n <Popover.Trigger asChild>\n {/* Icon-sized so it never makes the label line taller (on a phone a\n 44px-tall help button pushed the description a blank line down);\n `matrx-tap-area` gives it the 44px finger ring without growing it. */}\n <Button\n type=\"button\"\n variant=\"quiet\"\n aria-label={`About ${label}`}\n icon={<HelpCircle className=\"h-3.5 w-3.5\" aria-hidden=\"true\" />}\n data-touch-exempt\n className=\"shrink-0\"\n />\n </Popover.Trigger>\n <Popover.Portal>\n <Popover.Content\n side=\"bottom\"\n align=\"start\"\n sideOffset={6}\n className=\"z-50 w-72 max-w-[calc(100vw-2rem)] break-words rounded-md border border-border bg-popover p-3 type-secondary leading-snug text-popover-foreground shadow-md [overflow-wrap:anywhere]\"\n >\n {description && <div>{description}</div>}\n {helpText && (\n <div className={cn(description && \"mt-2\")}>{helpText}</div>\n )}\n </Popover.Content>\n </Popover.Portal>\n </Popover.Root>\n );\n}\n","\"use client\";\n\nimport { createContext, useContext } from \"react\";\nimport type { ReactNode } from \"react\";\n\nconst SettingsSectionContext = createContext<string | undefined>(undefined);\n\n/** The nearest section title gives static controls a stable deep-link scope. */\nexport function SettingsSectionProvider({\n title,\n children,\n}: {\n title: string;\n children: ReactNode;\n}) {\n return (\n <SettingsSectionContext.Provider value={title}>\n {children}\n </SettingsSectionContext.Provider>\n );\n}\n\nexport function useSettingsSectionTitle(): string | undefined {\n return useContext(SettingsSectionContext);\n}\n","\"use client\";\n\nimport { forwardRef, type Ref } from \"react\";\n// The spinner loop comes from `@ai-matrx/design-system`'s motion layer — the\n// package this one already depends on — NOT from core Tailwind's\n// `animate-spin` and NOT from a keyframe copied into this package's\n// stylesheet. See the note above `LoadingTapButton`.\nimport { MOTION_SPIN } from \"../motion\";\nimport {\n TapTargetButton,\n TapTargetButtonTransparent,\n TapTargetButtonOutline,\n TapTargetButtonSolid,\n TapTargetButtonForGroup,\n} from \"./tap-target-button\";\nimport type { TapTargetLinkComponent } from \"./link\";\nimport { useTapButtonVariant } from \"./tap-default-variant\";\nimport type { TapFeatureProps, TapSolidTone } from \"./tap-features\";\n\n// ---------------------------------------------------------------------------\n// Shared types\n// ---------------------------------------------------------------------------\n\ntype Variant = \"glass\" | \"transparent\" | \"outline\" | \"solid\" | \"group\";\n\nexport interface TapButtonProps extends TapFeatureProps {\n /** Forwarded to the underlying button (Radix `asChild`, focus chains, etc.). */\n ref?: Ref<HTMLButtonElement> | undefined;\n variant?: Variant | undefined;\n onClick?: (() => void) | undefined;\n as?: \"button\" | \"label\" | undefined;\n htmlFor?: string | undefined;\n ariaLabel?: string | undefined;\n disabled?: boolean | undefined;\n tabIndex?: number | undefined;\n className?: string | undefined;\n strokeWidth?: number | undefined;\n // Solid-variant color overrides — only used when variant=\"solid\"\n bgColor?: string | undefined;\n iconColor?: string | undefined;\n hoverBgColor?: string | undefined;\n activeBgColor?: string | undefined;\n // Link support — when set, the button renders as a link or <a>.\n // Internal hrefs use the injected link component (setTapTargetLinkComponent\n // or the `linkComponent` prop; plain <a> when none is registered); external\n // (http(s)://, mailto:, tel:) use <a> with target=\"_blank\" +\n // rel=\"noopener noreferrer\" by default. Pass an explicit `target` to\n // override (works for internal links too).\n href?: string | undefined;\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\" | undefined;\n rel?: string | undefined;\n prefetch?: boolean | null | undefined;\n /** Per-instance link component override for internal hrefs. */\n linkComponent?: TapTargetLinkComponent | undefined;\n // Tooltip support — defaults to `ariaLabel`. Pass `false` to opt out.\n tooltip?: string | false | undefined;\n tooltipSide?: \"top\" | \"right\" | \"bottom\" | \"left\" | undefined;\n tooltipAlign?: \"start\" | \"center\" | \"end\" | undefined;\n /** Inline caption after the icon — see TapTargetButton `label`. */\n label?: string | undefined;\n /** Passthrough from AITapButtonProps / MakerTapButton — stripped before DOM. */\n colored?: boolean | undefined;\n}\n\n// ---------------------------------------------------------------------------\n// Variant resolver — maps a variant string to the correct wrapper component.\n// Runs at build/server time so there's zero client cost.\n//\n// IMPORTANT: `Wrap` MUST forward refs. The pre-composed `*TapButton` functions\n// below are plain function components (in React 19 ref is a regular prop) and\n// spread `{...props}` to `Wrap` — that spread carries ref through. `Wrap`\n// extracts ref and passes it explicitly to the underlying `forwardRef`\n// primitive. Without this, every `*TapButton` placed inside a Radix\n// `*Trigger asChild` (DropdownMenu, Popover, Tooltip, etc.) silently loses\n// the ref — the popper can't anchor and Radix's injected event handlers /\n// `data-state` / `aria-*` get dropped. (Precedent: matrx-frontend\n// `features/files/FEATURE.md`, where this pattern was established.)\n// ---------------------------------------------------------------------------\n\nconst Wrap = forwardRef<\n HTMLButtonElement,\n TapButtonProps & { children: React.ReactNode }\n>(function Wrap(\n {\n variant: variantProp,\n children,\n bgColor,\n iconColor,\n hoverBgColor,\n activeBgColor,\n // AITapButtonProps passthrough — not a DOM attribute (see ai-tap-buttons Wrap)\n colored: _colored,\n ...props\n },\n ref,\n) {\n const variant = useTapButtonVariant(variantProp);\n switch (variant) {\n case \"transparent\":\n return (\n <TapTargetButtonTransparent ref={ref} {...props}>\n {children}\n </TapTargetButtonTransparent>\n );\n case \"outline\":\n return (\n <TapTargetButtonOutline ref={ref} {...props}>\n {children}\n </TapTargetButtonOutline>\n );\n case \"solid\": {\n // On a solid button `tone` is the FILL; a glyph-only tone (\"muted\",\n // \"default\", \"info\") has no fill meaning and falls back to primary.\n const { tone, ...solidProps } = props;\n const fill: TapSolidTone | undefined =\n tone === \"primary\" || tone === \"destructive\" || tone === \"success\" || tone === \"warning\" ? tone : undefined;\n return (\n <TapTargetButtonSolid\n ref={ref}\n tone={fill}\n bgColor={bgColor}\n iconColor={iconColor}\n hoverBgColor={hoverBgColor}\n activeBgColor={activeBgColor}\n {...solidProps}\n >\n {children}\n </TapTargetButtonSolid>\n );\n }\n case \"group\":\n return (\n <TapTargetButtonForGroup ref={ref} {...props}>\n {children}\n </TapTargetButtonForGroup>\n );\n default:\n return (\n <TapTargetButton ref={ref} {...props}>\n {children}\n </TapTargetButton>\n );\n }\n});\n\n// ---------------------------------------------------------------------------\n// Pre-composed buttons — one import, one tag, zero configuration needed.\n// Default variant is \"glass\". Override with variant=\"transparent\" etc.\n// All SVG paths match lucide-react v0.577.0 exactly.\n// ---------------------------------------------------------------------------\n\n// lucide: menu (hand-crafted HeroIcons path — no Lucide equivalent, kept as-is)\nexport function MenuTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Menu\" strokeWidth={1.75} {...props}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5\"\n />\n </Wrap>\n );\n}\n\n// lucide: plus (hand-crafted — no drift, kept as-is)\nexport function PlusTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Add\" {...props}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M12 4.5v15m7.5-7.5h-15\"\n />\n </Wrap>\n );\n}\n\n// lucide: search → circle cx=11 cy=11 r=8 + line to 21,21\nexport function SearchTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Search\" {...props}>\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"m21 21-4.34-4.34\" />\n </Wrap>\n );\n}\n\n// lucide: settings (hand-crafted — kept as-is, Lucide uses \"settings-2\" pattern)\nexport function SettingsTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Settings\" {...props}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z\"\n />\n </Wrap>\n );\n}\n\n// lucide: maximize (hand-crafted corner-arrows — kept as-is)\nexport function MaximizeTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Fullscreen\" {...props}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15\"\n />\n </Wrap>\n );\n}\n\n// lucide: home v0.577.0 — used as the \"Hub\" (main/list) action\nexport function HomeTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Hub\" {...props}>\n <path d=\"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8\" />\n <path d=\"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\" />\n </Wrap>\n );\n}\n\n// lucide: layout-grid v0.577.0\nexport function LayoutGridTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Card view\" {...props}>\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"14\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"14\" rx=\"1\" />\n </Wrap>\n );\n}\n\n// lucide: list v0.577.0\nexport function ListTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Table view\" {...props}>\n <path d=\"M3 5h.01\" />\n <path d=\"M3 12h.01\" />\n <path d=\"M3 19h.01\" />\n <path d=\"M8 5h13\" />\n <path d=\"M8 12h13\" />\n <path d=\"M8 19h13\" />\n </Wrap>\n );\n}\n\n// lucide: arrow-down-up (hand-crafted — kept as-is)\nexport function ArrowDownUpTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Sort\" {...props}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M3 4.5h14.25M3 9h9.75M3 13.5h5.25m5.25-.75L17.25 9m0 0L21 12.75M17.25 9v10.5\"\n />\n </Wrap>\n );\n}\n\n// lucide: bell v0.577.0\nexport function BellTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Notifications\" {...props}>\n <path d=\"M10.268 21a2 2 0 0 0 3.464 0\" />\n <path d=\"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326\" />\n </Wrap>\n );\n}\n\n// lucide: bell-ring v0.577.0 — animated cousin of bell, used for \"has unread\"\nexport function BellRingTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Notifications\" {...props}>\n <path d=\"M10.268 21a2 2 0 0 0 3.464 0\" />\n <path d=\"M22 8c0-2.3-.8-4.3-2-6\" />\n <path d=\"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326\" />\n <path d=\"M4 2C2.8 3.7 2 5.7 2 8\" />\n </Wrap>\n );\n}\n\n// lucide: zap v0.577.0 — lightning bolt, used as the Quick Actions trigger\nexport function ZapTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Quick actions\" {...props}>\n <path d=\"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z\" />\n </Wrap>\n );\n}\n\n// lucide: upload v0.577.0\nexport function UploadTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Upload\" {...props}>\n <path d=\"M12 3v12\" />\n <path d=\"m17 8-5-5-5 5\" />\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n </Wrap>\n );\n}\n\n// lucide: download v0.577.0\nexport function DownloadTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Download\" {...props}>\n <path d=\"M12 15V3\" />\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n <path d=\"m7 10 5 5 5-5\" />\n </Wrap>\n );\n}\n\n// lucide: share-2 v0.577.0\nexport function ShareTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Share\" {...props}>\n <circle cx=\"18\" cy=\"5\" r=\"3\" />\n <circle cx=\"6\" cy=\"12\" r=\"3\" />\n <circle cx=\"18\" cy=\"19\" r=\"3\" />\n <line x1=\"8.59\" x2=\"15.42\" y1=\"13.51\" y2=\"17.49\" />\n <line x1=\"15.41\" x2=\"8.59\" y1=\"6.51\" y2=\"10.49\" />\n </Wrap>\n );\n}\n\n// lucide: undo v0.577.0\nexport function UndoTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Undo\" {...props}>\n <path d=\"M3 7v6h6\" />\n <path d=\"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13\" />\n </Wrap>\n );\n}\n\n// lucide: redo v0.577.0\nexport function RedoTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Redo\" {...props}>\n <path d=\"M21 7v6h-6\" />\n <path d=\"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7\" />\n </Wrap>\n );\n}\n\n// lucide: copy v0.577.0\nexport function CopyTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Copy\" {...props}>\n <rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n <path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" />\n </Wrap>\n );\n}\n\n// lucide: trash v0.577.0\nexport function TrashTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Delete\" {...props}>\n <path d=\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\" />\n <path d=\"M3 6h18\" />\n <path d=\"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\" />\n </Wrap>\n );\n}\n\n// lucide: files v0.577.0\nexport function FilesTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Copy all\" {...props}>\n <path d=\"M20 7h-3a2 2 0 0 1-2-2V2\" />\n <path d=\"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z\" />\n <path d=\"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8\" />\n </Wrap>\n );\n}\n\n// lucide: chevron-left v0.577.0 — arms extended from 6 to 7 (45° kept) for a\n// slightly larger glyph that better fills the 32px inner pill.\nexport function ChevronLeftTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Back\" {...props}>\n <path d=\"m16 19-7-7 7-7\" />\n </Wrap>\n );\n}\n\n// lucide: chevron-right v0.577.0\nexport function ChevronRightTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Next\" {...props}>\n <path d=\"m9 18 6-6-6-6\" />\n </Wrap>\n );\n}\n\n// lucide: panel-left v0.577.0\nexport function PanelLeftTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Toggle sidebar\" {...props}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M9 3v18\" />\n </Wrap>\n );\n}\n\n// lucide: panel-right v0.577.0\nexport function PanelRightTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Toggle sidebar\" {...props}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"M15 3v18\" />\n </Wrap>\n );\n}\n\n// lucide: square-pen v0.577.0\nexport function SquarePenTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"New chat\" {...props}>\n <path d=\"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\" />\n <path d=\"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z\" />\n </Wrap>\n );\n}\n\n// lucide: x v0.577.0\nexport function XTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Close\" {...props}>\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </Wrap>\n );\n}\n\n// lucide: funnel v0.577.0 (filter is an alias for funnel in this version)\nexport function FilterTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Filter\" {...props}>\n <path d=\"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z\" />\n </Wrap>\n );\n}\n\n// lucide: play v0.577.0\nexport function PlayTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Play\" {...props}>\n <path d=\"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z\" />\n </Wrap>\n );\n}\n\n// lucide: pause v0.577.0 — two rects (redesigned from bar paths)\nexport function PauseTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Pause\" {...props}>\n <rect x=\"14\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n <rect x=\"5\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n </Wrap>\n );\n}\n\n// lucide: square v0.577.0 (stop uses filled square)\nexport function StopTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Stop\" {...props}>\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n </Wrap>\n );\n}\n\n// lucide: volume-2 v0.577.0\nexport function Volume2TapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Speaker\" {...props}>\n <path d=\"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\" />\n <path d=\"M16 9a5 5 0 0 1 0 6\" />\n <path d=\"M19.364 18.364a9 9 0 0 0 0-12.728\" />\n </Wrap>\n );\n}\n\n// lucide: arrow-up v0.577.0\nexport function ArrowUpTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Send\" {...props}>\n <path d=\"m5 12 7-7 7 7\" />\n <path d=\"M12 19V5\" />\n </Wrap>\n );\n}\n\n// lucide: mic v0.577.0\nexport function MicTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Start recording\" {...props}>\n <path d=\"M12 19v3\" />\n <path d=\"M19 10v2a7 7 0 0 1-14 0v-2\" />\n <rect x=\"9\" y=\"2\" width=\"6\" height=\"13\" rx=\"3\" />\n </Wrap>\n );\n}\n\n// lucide: mic-off v0.577.0\nexport function MicOffTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Stop recording\" {...props}>\n <path d=\"M12 19v3\" />\n <path d=\"M15 9.34V5a3 3 0 0 0-5.68-1.33\" />\n <path d=\"M16.95 16.95A7 7 0 0 1 5 12v-2\" />\n <path d=\"M18.89 13.23A7 7 0 0 0 19 12v-2\" />\n <path d=\"m2 2 20 20\" />\n <path d=\"M9 9v3a3 3 0 0 0 5.12 2.12\" />\n </Wrap>\n );\n}\n\n// lucide: triangle-alert v0.577.0\nexport function TriangleAlertTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Alert\" {...props}>\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n </Wrap>\n );\n}\n\n// lucide: shield-check (context set)\nexport function ShieldCheckTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Context set\" {...props}>\n <path d=\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\" />\n <path d=\"m9 12 2 2 4-4\" />\n </Wrap>\n );\n}\n\n// lucide: shield-alert (context unset)\nexport function ShieldAlertTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"No context\" {...props}>\n <path d=\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\" />\n <path d=\"M12 8v4\" />\n <path d=\"M12 16h.01\" />\n </Wrap>\n );\n}\n\n// lucide: bug v0.577.0 (major update — full insect anatomy)\nexport function BugTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Debug\" {...props}>\n <path d=\"M12 20v-9\" />\n <path d=\"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z\" />\n <path d=\"M14.12 3.88 16 2\" />\n <path d=\"M21 21a4 4 0 0 0-3.81-4\" />\n <path d=\"M21 5a4 4 0 0 1-3.55 3.97\" />\n <path d=\"M22 13h-4\" />\n <path d=\"M3 21a4 4 0 0 1 3.81-4\" />\n <path d=\"M3 5a4 4 0 0 0 3.55 3.97\" />\n <path d=\"M6 13H2\" />\n <path d=\"m8 2 1.88 1.88\" />\n <path d=\"M9 7.13V6a3 3 0 1 1 6 0v1.13\" />\n </Wrap>\n );\n}\n\n// lucide: settings-2 v0.577.0 (gear + center circle — kept as-is, matches intent)\nexport function Settings2TapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Settings\" {...props}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z\"\n />\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M15 12a3 3 0 11-6 0 3 3 0 016 0z\"\n />\n </Wrap>\n );\n}\n\n// lucide: save (hand-crafted floppy disk — no direct Lucide equivalent, kept as-is)\nexport function SaveTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Save\" {...props}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M4.5 6a2 2 0 012-2h9.25L20.5 9v9a2 2 0 01-2 2h-12a2 2 0 01-2-2V6z\"\n />\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M8.5 4v4.5a.5.5 0 00.5.5h6a.5.5 0 00.5-.5V4\"\n />\n <rect\n x=\"8\"\n y=\"14\"\n width=\"8\"\n height=\"5.5\"\n rx=\"0.5\"\n strokeLinejoin=\"round\"\n />\n </Wrap>\n );\n}\n\n// lucide: send v0.577.0 (paper-airplane redesign)\nexport function SendTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Send\" {...props}>\n <path d=\"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z\" />\n <path d=\"m21.854 2.147-10.94 10.939\" />\n </Wrap>\n );\n}\n\n// lucide: message-square v0.577.0\nexport function MessageTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Message\" {...props}>\n <path d=\"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z\" />\n </Wrap>\n );\n}\n\n// lucide: variable v0.577.0 (major update — uses line elements + bracket paths)\nexport function VariableTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Variable\" {...props}>\n <path d=\"M8 21s-4-3-4-9 4-9 4-9\" />\n <path d=\"M16 3s4 3 4 9-4 9-4 9\" />\n <line x1=\"15\" x2=\"9\" y1=\"9\" y2=\"15\" />\n <line x1=\"9\" x2=\"15\" y1=\"9\" y2=\"15\" />\n </Wrap>\n );\n}\n\n// lucide: wrench v0.577.0 (single clean path)\nexport function WrenchTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Tool\" {...props}>\n <path d=\"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z\" />\n </Wrap>\n );\n}\n\n// lucide: command v0.577.0 (single continuous path)\nexport function CommandTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Command\" {...props}>\n <path d=\"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3\" />\n </Wrap>\n );\n}\n\n// lucide: terminal v0.577.0 (two paths: chevron + underline)\nexport function TerminalTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Terminal\" {...props}>\n <path d=\"M12 19h8\" />\n <path d=\"m4 17 6-6-6-6\" />\n </Wrap>\n );\n}\n\n// lucide: test-tube v0.577.0 (3 clean paths)\nexport function TestTubeTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Test\" {...props}>\n <path d=\"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2\" />\n <path d=\"M8.5 2h7\" />\n <path d=\"M14.5 16h-5\" />\n </Wrap>\n );\n}\n\n// lucide: rotate-ccw v0.577.0 (same shape as history minus the clock hand — used for Reset)\nexport function ResetTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Reset\" {...props}>\n <path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\" />\n <path d=\"M3 3v5h5\" />\n </Wrap>\n );\n}\n\n// lucide: eraser v0.577.0 (major update — proper eraser shape)\nexport function ClearTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Clear\" {...props}>\n <path d=\"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21\" />\n <path d=\"m5.082 11.09 8.828 8.828\" />\n </Wrap>\n );\n}\n\n// lucide: refresh-cw v1.22.0 (dual arrows — was a broken hand-crafted Heroicons-style path)\nexport function RetryTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Retry\" {...props}>\n <path d=\"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\" />\n <path d=\"M21 3v5h-5\" />\n <path d=\"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\" />\n <path d=\"M8 16H3v5\" />\n </Wrap>\n );\n}\n\n/** Alias — same Lucide refresh-cw glyph as RetryTapButton. */\nexport function RefreshCwTapButton(props: TapButtonProps) {\n return <RetryTapButton ariaLabel=\"Refresh\" {...props} />;\n}\n\n// lucide: loading spinner (custom animated — no Lucide equivalent)\n//\n// 🚨 `matrx-spin`, NEVER `animate-spin` (census row 19i, closed here at 0.2.1).\n// `animate-spin` is a core Tailwind utility, so it happened to survive in all\n// four current consumers — but a package cannot ship a class it does not\n// define: the first host without Tailwind's core animate utilities gets a\n// spinner that does not spin, which is a load-bearing lie (it says the work\n// has stopped) with no error to find it by. `matrx-spin` is design-system\n// 0.10.0's own keyframe + rule, shipped in ITS `styles.css` and asserted\n// present in ITS packed tarball. This package IMPORTS that contract (the\n// exported `MOTION_SPIN` constant, and `styles.css` `@import`s the sheet) —\n// it does not copy the keyframe, which would be a twin of exactly the kind\n// this row exists to kill. Under `prefers-reduced-motion` the shared rule\n// SLOWS the loop instead of stopping it, because a stopped spinner removes\n// information rather than motion.\nexport function LoadingTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Loading\" {...props}>\n <circle\n className={MOTION_SPIN}\n cx=\"12\"\n cy=\"12\"\n r=\"9\"\n strokeDasharray=\"28.27\"\n strokeDashoffset=\"9\"\n strokeLinecap=\"round\"\n style={{ transformOrigin: \"12px 12px\" }}\n />\n </Wrap>\n );\n}\n\n// lucide: bot/robot (hand-crafted — kept as-is)\nexport function RobotTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"AI Agent\" {...props}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M9 3.75H6.912a2.25 2.25 0 00-2.15 1.588L2.35 13.177a2.25 2.25 0 00-.1.661V18a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18v-4.162c0-.224-.034-.447-.1-.661L19.24 5.338a2.25 2.25 0 00-2.15-1.588H15M2.25 13.5h3.86a2.25 2.25 0 012.012 1.244l.256.512a2.25 2.25 0 002.013 1.244h3.218a2.25 2.25 0 002.013-1.244l.256-.512a2.25 2.25 0 012.013-1.244h3.859M12 3v8.25m0 0-3-3m3 3 3-3\"\n />\n </Wrap>\n );\n}\n\n// lucide: webhook v0.577.0\nexport function WebhookTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Webhook\" {...props}>\n <path d=\"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2\" />\n <path d=\"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06\" />\n <path d=\"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8\" />\n </Wrap>\n );\n}\n\n// lucide: eye v0.577.0\nexport function ViewTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"View\" {...props}>\n <path d=\"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </Wrap>\n );\n}\n\n// lucide: hammer v0.577.0\nexport function BuildTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Build\" {...props}>\n <path d=\"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9\" />\n <path d=\"m18 15 4-4\" />\n <path d=\"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5\" />\n </Wrap>\n );\n}\n\n// lucide: play v0.577.0 (alias for Run context)\nexport function RunTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Run\" {...props}>\n <path d=\"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z\" />\n </Wrap>\n );\n}\n\n// lucide: history v0.577.0\nexport function HistoryTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"History\" {...props}>\n <path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\" />\n <path d=\"M3 3v5h5\" />\n <path d=\"M12 7v5l4 2\" />\n </Wrap>\n );\n}\n\n// lucide: paperclip v0.577.0\nexport function PaperclipTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Attach file\" {...props}>\n <path d=\"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551\" />\n </Wrap>\n );\n}\n\n// lucide: thumbs-up v0.577.0\nexport function ThumbsUpTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Like\" {...props}>\n <path d=\"M7 10v12\" />\n <path d=\"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z\" />\n </Wrap>\n );\n}\n\n// lucide: thumbs-down v0.577.0\nexport function ThumbsDownTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Dislike\" {...props}>\n <path d=\"M17 14V2\" />\n <path d=\"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z\" />\n </Wrap>\n );\n}\n\n// lucide: check v0.577.0\nexport function CheckTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Done\" {...props}>\n <path d=\"M20 6 9 17l-5-5\" />\n </Wrap>\n );\n}\n\n// lucide: pencil v0.577.0\nexport function PencilTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Edit\" {...props}>\n <path d=\"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z\" />\n <path d=\"m15 5 4 4\" />\n </Wrap>\n );\n}\n\n// lucide: ellipsis (more-horizontal) v0.577.0\nexport function MoreHorizontalTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"More options\" {...props}>\n <circle cx=\"12\" cy=\"12\" r=\"1\" />\n <circle cx=\"19\" cy=\"12\" r=\"1\" />\n <circle cx=\"5\" cy=\"12\" r=\"1\" />\n </Wrap>\n );\n}\n\n// lucide: check-square v0.577.0\nexport function CheckSquareTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Task\" {...props}>\n <path d=\"m9 11 3 3L22 4\" />\n <path d=\"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11\" />\n </Wrap>\n );\n}\n\n// lucide: ghost v0.577.0\nexport function GhostTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Incognito chat\" {...props}>\n <path d=\"M9 10h.01\" />\n <path d=\"M15 10h.01\" />\n <path d=\"M12 2a8 8 0 0 0-8 8v12l3-3 2.5 2.5L12 19l2.5 2.5L17 19l3 3V10a8 8 0 0 0-8-8z\" />\n </Wrap>\n );\n}\n\n// lucide: link (chain link — used for \"attach to task\") v0.577.0\nexport function LinkTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Attach\" {...props}>\n <path d=\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\" />\n <path d=\"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\" />\n </Wrap>\n );\n}\n\n// lucide: external-link v0.577.0\nexport function ExternalLinkTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Open source\" {...props}>\n <path d=\"M15 3h6v6\" />\n <path d=\"M10 14 21 3\" />\n <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" />\n </Wrap>\n );\n}\n\n// lucide: clipboard-list v0.577.0\nexport function ClipboardListTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Copy Pages\" {...props}>\n <rect width=\"8\" height=\"4\" x=\"8\" y=\"2\" rx=\"1\" ry=\"1\" />\n <path d=\"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2\" />\n <path d=\"M12 11h4\" />\n <path d=\"M12 16h4\" />\n <path d=\"M8 11h.01\" />\n <path d=\"M8 16h.01\" />\n </Wrap>\n );\n}\n\n// lucide: party-popper v0.577.0\nexport function PartyPopperTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"AI Clean\" {...props}>\n <path d=\"M5.8 11.3 2 22l10.7-3.79\" />\n <path d=\"M4 3h.01\" />\n <path d=\"M22 8h.01\" />\n <path d=\"M15 2h.01\" />\n <path d=\"M22 20h.01\" />\n <path d=\"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10\" />\n <path d=\"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17\" />\n <path d=\"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7\" />\n <path d=\"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z\" />\n </Wrap>\n );\n}\n\n// lucide: layers v0.577.0 — \"this PDF everywhere\" surface switcher\nexport function LayersTapButton(props: TapButtonProps) {\n return (\n <Wrap ariaLabel=\"Open this PDF in another surface\" {...props}>\n <path d=\"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z\" />\n <path d=\"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12\" />\n <path d=\"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17\" />\n </Wrap>\n );\n}\n","\"use client\";\n\nimport {\n cloneElement,\n forwardRef,\n isValidElement,\n useCallback,\n useRef,\n type ButtonHTMLAttributes,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from \"react\";\n\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"../tooltip\";\nimport { joinClassNames } from \"@ai-matrx/kit/dom\";\nimport { classNameMisuse, useTapGuardRef } from \"./tap-target-guard\";\nimport { useTapSurface } from \"./tap-surface\";\nimport {\n TAP_SOLID_TONE,\n TAP_TONE_CLASS,\n TapBadge,\n TapChevron,\n TapSpinner,\n formatTapShortcut,\n tooltipBody,\n useTapShortcut,\n type TapFeatureProps,\n type TapShortcut,\n type TapSolidTone,\n} from \"./tap-features\";\nimport {\n getTapTargetLinkComponent,\n type TapTargetLinkComponent,\n} from \"./link\";\n\nexport interface TapTargetButtonProps extends TapFeatureProps {\n icon?: React.ReactNode;\n children?: React.ReactNode;\n strokeWidth?: number | undefined;\n onClick?: (() => void) | undefined;\n className?: string | undefined;\n as?: \"button\" | \"label\" | undefined;\n htmlFor?: string | undefined;\n ariaLabel?: string | undefined;\n disabled?: boolean | undefined;\n /**\n * When set, the tap button renders as a link instead of a button.\n * - Internal hrefs (e.g. \"/tasks\") render via the injected link component\n * (`setTapTargetLinkComponent` / the `linkComponent` prop), falling back\n * to a plain `<a>` when none is registered.\n * - External hrefs (http://, https://, mailto:, tel:) render as `<a>`\n * with `target=\"_blank\"` and `rel=\"noopener noreferrer\"` by default.\n * - When combined with `disabled`, the trigger renders as a non-navigable\n * `<span aria-disabled=\"true\">` with the same visual styling.\n */\n href?: string | undefined;\n /** Override target. Works on both internal links and external anchors. */\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\" | undefined;\n /** Override rel. Works on both internal links and external anchors. */\n rel?: string | undefined;\n /** Forwarded to the injected link component. Pass `false` to disable prefetching. */\n prefetch?: boolean | null | undefined;\n /**\n * Per-instance link component for internal hrefs — overrides the\n * module-level `setTapTargetLinkComponent` registration.\n */\n linkComponent?: TapTargetLinkComponent | undefined;\n /**\n * Tooltip text. Defaults to `ariaLabel` when omitted.\n * EVERY tap button shows a tooltip (owner ruling 2026-10-01). `false` no\n * longer hides it: it renders the tooltip through `title` (the provider's\n * title takeover draws the same surface) — for a button nested inside\n * another `asChild` trigger, where the Tooltip wrapper cannot sit.\n */\n tooltip?: string | false | undefined;\n /** Tooltip placement. Defaults to \"top\". */\n tooltipSide?: \"top\" | \"right\" | \"bottom\" | \"left\" | undefined;\n /** Tooltip alignment along its side. Defaults to \"center\". */\n tooltipAlign?: \"start\" | \"center\" | \"end\" | undefined;\n /**\n * Visible caption rendered inline after the icon (`[icon Label]`).\n * Widens the pill automatically. Tooltip defaults to off when set — the\n * label is self-describing. Visible text becomes the accessible name.\n */\n label?: string | undefined;\n /**\n * Collapse an icon + caption pill to its icon-only 44px tap target below\n * the `sm` breakpoint. The caption and inline geometry return at `sm+`;\n * `ariaLabel` (falling back to `label`) remains the accessible name.\n */\n mobileIconOnly?: boolean | undefined;\n}\n\nexport interface TapTargetButtonSolidProps extends Omit<TapTargetButtonProps, \"tone\"> {\n /** The fill, from the system's list. Replaces bgColor / iconColor / hover / active. */\n tone?: TapSolidTone | undefined;\n bgColor?: string | undefined;\n iconColor?: string | undefined;\n hoverBgColor?: string | undefined;\n /**\n * Press-state background. Defaults to `group-active/tap:brightness-90` (the\n * BOX is what is pressed — its touch area included), which works on\n * any color. Override when using a custom `bgColor` that should darken to a\n * specific shade on press (e.g. `group-active/tap:bg-primary/60`).\n */\n activeBgColor?: string | undefined;\n}\n\n/** Native button attributes a tap button accepts — everything except `style`:\n * a tap button's geometry is the system's, never the caller's. */\nexport type TapTargetNativeProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"style\">;\n\nconst EXTERNAL_RE = /^(https?:|mailto:|tel:)/i;\n\n// Geometry + press feedback + tap hygiene are the SINGLE SOURCE OF TRUTH in\n// the shipped stylesheet (the `.matrx-tap-*` family in styles.css — import\n// \"@ai-matrx/tap-target/styles.css\" once at app root). This component only\n// picks the right class and layers each variant's decoration on top.\nconst TAP_OUTER_CLASS = \"matrx-tap-target group group/tap\";\nconst TAP_GROUP_OUTER_CLASS = \"matrx-tap-target matrx-tap-target-sm group group/tap\";\n\nfunction IconContent({\n icon,\n children,\n strokeWidth = 2,\n className,\n}: Pick<\n TapTargetButtonProps,\n \"icon\" | \"children\" | \"strokeWidth\" | \"className\"\n>) {\n if (icon) {\n if (isValidElement<{ className?: string }>(icon)) {\n return cloneElement(icon, {\n className: joinClassNames(className, icon.props.className),\n });\n }\n return <span className={className}>{icon}</span>;\n }\n return (\n <svg\n className={className}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n {children}\n </svg>\n );\n}\n\ntype TapTargetSize = \"default\" | \"sm\";\n\nfunction resolveTapGeometry(\n label: string | undefined,\n size: TapTargetSize,\n mobileIconOnly: boolean,\n) {\n const inline = Boolean(label);\n if (size === \"sm\") {\n return {\n outerClassName:\n inline && mobileIconOnly\n ? \"matrx-tap-target matrx-tap-target-sm matrx-tap-target-mobile-icon-only-sm group group/tap\"\n : inline\n ? \"matrx-tap-target matrx-tap-target-sm matrx-tap-target-inline-sm group group/tap\"\n : TAP_GROUP_OUTER_CLASS,\n inlineModifier: mobileIconOnly\n ? \"matrx-tap-pill-mobile-icon-only-sm\"\n : \"matrx-tap-pill-inline-sm\",\n };\n }\n return {\n outerClassName:\n inline && mobileIconOnly\n ? `${TAP_OUTER_CLASS} matrx-tap-target-mobile-icon-only`\n : inline\n ? `${TAP_OUTER_CLASS} matrx-tap-target-inline`\n : TAP_OUTER_CLASS,\n inlineModifier: mobileIconOnly\n ? \"matrx-tap-pill-mobile-icon-only\"\n : \"matrx-tap-pill-inline\",\n };\n}\n\nfunction buildTapInner({\n label,\n pillClassName,\n iconClassName,\n labelClassName,\n inlineModifier,\n icon,\n children,\n strokeWidth = 2,\n loading,\n chevron,\n}: {\n label?: string | undefined;\n pillClassName: string;\n iconClassName: string;\n labelClassName?: string | undefined;\n inlineModifier: string;\n icon?: React.ReactNode;\n children?: React.ReactNode;\n strokeWidth?: number | undefined;\n loading?: boolean | undefined;\n chevron?: boolean | undefined;\n}) {\n const iconEl = loading ? (\n <TapSpinner className={iconClassName} />\n ) : (\n <IconContent\n icon={icon}\n strokeWidth={strokeWidth}\n className={iconClassName}\n >\n {children}\n </IconContent>\n );\n const pillClasses = label\n ? `${pillClassName} ${inlineModifier}`.trim()\n : pillClassName;\n\n if (!label) {\n return <div className={pillClasses}>{iconEl}</div>;\n }\n\n return (\n <div className={pillClasses}>\n {iconEl}\n <span className={labelClassName ?? \"matrx-tap-label\"}>{label}</span>\n {chevron ? <TapChevron /> : null}\n </div>\n );\n}\n\ninterface RenderTapTargetArgs extends Pick<\n TapTargetButtonProps,\n | \"icon\"\n | \"children\"\n | \"strokeWidth\"\n | \"label\"\n | \"mobileIconOnly\"\n | \"onClick\"\n | \"as\"\n | \"htmlFor\"\n | \"ariaLabel\"\n | \"disabled\"\n | \"href\"\n | \"target\"\n | \"rel\"\n | \"prefetch\"\n | \"linkComponent\"\n | \"tooltip\"\n | \"tooltipSide\"\n | \"tooltipAlign\"\n> {\n size?: TapTargetSize;\n /** The caller's raw `className` (the glyph color) — checked by the guard. */\n colorClassName?: string | undefined;\n pillClassName: string;\n iconClassName: string;\n labelClassName?: string | undefined;\n rest?: (TapTargetNativeProps & TapFeatureProps) | undefined;\n buttonRef?: Ref<HTMLButtonElement> | undefined;\n}\n\n// A hook (it carries the guard ref); every variant calls it exactly once.\nfunction useTapTarget({\n size = \"default\",\n colorClassName,\n pillClassName,\n iconClassName,\n labelClassName,\n icon,\n children,\n strokeWidth,\n label,\n mobileIconOnly = false,\n onClick,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n rest,\n buttonRef,\n}: RenderTapTargetArgs): ReactElement {\n const {\n tone,\n badge,\n pressed,\n loading,\n disabledReason,\n shortcut,\n chevron,\n ...nativeRest\n } = rest ?? {};\n const isDisabled = Boolean(disabled || disabledReason);\n // FORCED TOOLTIPS: the text is the reason, an explicit tooltip, the\n // accessible name, or the label — and a button with none is a defect.\n const tipText =\n disabledReason || (typeof tooltip === \"string\" && tooltip ? tooltip : undefined) || ariaLabel || label;\n const titleMode = tooltip === false;\n const propViolation =\n (tipText ? null : \"every tap button needs a tooltip — pass ariaLabel\") ??\n classNameMisuse(colorClassName ?? nativeRest.className) ??\n ((nativeRest as { style?: unknown }).style ? \"style is not supported on a tap button\" : null);\n const guardRef = useTapGuardRef<HTMLElement>(\n buttonRef as Ref<HTMLElement> | undefined,\n propViolation,\n );\n const nodeRef = useRef<HTMLElement | null>(null);\n const triggerRef = useCallback(\n (node: HTMLElement | null) => {\n nodeRef.current = node;\n guardRef(node);\n },\n [guardRef],\n );\n const getNode = useCallback(() => nodeRef.current, []);\n useTapShortcut(shortcut, getNode, !isDisabled && !loading);\n\n // Tone (or a pressed toggle) owns the glyph and label color.\n const toneColor = tone ? TAP_TONE_CLASS[tone] : pressed && !colorClassName ? TAP_TONE_CLASS.primary : null;\n if (toneColor) {\n iconClassName = `matrx-tap-icon ${toneColor}`;\n labelClassName = `matrx-tap-label ${toneColor}`;\n }\n if (pressed) pillClassName = `${pillClassName} matrx-tap-pressed`;\n const { outerClassName, inlineModifier } = resolveTapGeometry(\n label,\n size,\n mobileIconOnly,\n );\n const responsiveLabelClassName = mobileIconOnly\n ? `${labelClassName ?? \"matrx-tap-label\"} matrx-tap-label-mobile-icon-only`\n : labelClassName;\n const inner = buildTapInner({\n label,\n pillClassName,\n iconClassName,\n labelClassName: responsiveLabelClassName,\n inlineModifier: label ? inlineModifier : \"\",\n icon,\n children,\n strokeWidth,\n loading,\n chevron,\n });\n const triggerAriaLabel =\n label && !mobileIconOnly ? undefined : (ariaLabel ?? label);\n const trigger = renderTrigger({\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n as,\n htmlFor,\n onClick: loading ? undefined : onClick,\n ariaLabel: triggerAriaLabel,\n disabled: isDisabled,\n outerClassName,\n title: titleMode && tipText ? (shortcut ? `${tipText} (${formatTapShortcut(shortcut)})` : tipText) : undefined,\n children: (\n <>\n {inner}\n {badge !== undefined ? <TapBadge badge={badge} /> : null}\n </>\n ),\n rest: {\n ...nativeRest,\n ...(pressed !== undefined ? { \"aria-pressed\": pressed } : {}),\n ...(loading ? { \"aria-busy\": true } : {}),\n ...(shortcut ? { \"aria-keyshortcuts\": shortcut.replace(/mod/i, \"Meta\") } : {}),\n },\n triggerRef,\n });\n if (titleMode || !tipText) return trigger;\n return withTooltip(trigger, {\n tooltip: tipText,\n ariaLabel: tipText,\n disabled: isDisabled,\n tooltipSide,\n tooltipAlign,\n shortcut,\n });\n}\n\ninterface RenderTriggerArgs {\n href?: string | undefined;\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\" | undefined;\n rel?: string | undefined;\n prefetch?: boolean | null | undefined;\n linkComponent?: TapTargetLinkComponent | undefined;\n as?: \"button\" | \"label\" | undefined;\n htmlFor?: string | undefined;\n onClick?: (() => void) | undefined;\n ariaLabel?: string | undefined;\n disabled?: boolean | undefined;\n outerClassName: string;\n children: ReactNode;\n rest?: ButtonHTMLAttributes<HTMLButtonElement> | undefined;\n triggerRef: Ref<HTMLElement>;\n /** Tooltip text drawn through `title` (tooltip={false}: a nested trigger). */\n title?: string | undefined;\n}\n\n/**\n * Resolves the correct trigger element based on the props passed.\n *\n * - `href` + `disabled` → unclickable `<span aria-disabled>`\n * - `href` matching `http(s):|mailto:|tel:` → `<a target=\"_blank\" rel=\"noopener noreferrer\">`\n * - `href` (internal) → the injected link component (per-instance\n * `linkComponent` prop, else `setTapTargetLinkComponent` registration),\n * falling back to a plain `<a>` when none is registered\n * - `as=\"label\"` → `<label htmlFor=...>`\n * - default → `<button>`\n */\nfunction renderTrigger({\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n as,\n htmlFor,\n onClick,\n ariaLabel,\n disabled,\n outerClassName,\n children,\n rest,\n triggerRef,\n title,\n}: RenderTriggerArgs): ReactElement {\n const { style: _style, ...restWithoutStyle } = rest ?? {};\n if (disabled && href) {\n return (\n <span\n ref={triggerRef}\n aria-disabled=\"true\"\n aria-label={ariaLabel}\n title={title}\n className={`${outerClassName} opacity-40`}\n >\n {children}\n </span>\n );\n }\n if (href) {\n const isExternal = EXTERNAL_RE.test(href);\n if (isExternal) {\n return (\n <a\n ref={triggerRef as Ref<HTMLAnchorElement>}\n href={href}\n target={target ?? \"_blank\"}\n rel={rel ?? \"noopener noreferrer\"}\n aria-label={ariaLabel}\n title={title}\n className={outerClassName}\n >\n {children}\n </a>\n );\n }\n const Link = linkComponent ?? getTapTargetLinkComponent();\n if (Link) {\n return (\n <Link\n ref={triggerRef as Ref<HTMLAnchorElement>}\n href={href}\n target={target}\n rel={rel}\n prefetch={prefetch}\n aria-label={ariaLabel}\n title={title}\n className={outerClassName}\n >\n {children}\n </Link>\n );\n }\n // No link component registered — plain <a>. `prefetch` is a router hint,\n // not a DOM attribute, so it is deliberately dropped here.\n return (\n <a\n ref={triggerRef as Ref<HTMLAnchorElement>}\n href={href}\n target={target}\n rel={rel}\n aria-label={ariaLabel}\n title={title}\n className={outerClassName}\n >\n {children}\n </a>\n );\n }\n if (as === \"label\") {\n return (\n <label\n ref={triggerRef as Ref<HTMLLabelElement>}\n htmlFor={htmlFor}\n aria-label={ariaLabel}\n title={title}\n className={outerClassName}\n >\n {children}\n </label>\n );\n }\n return (\n <button\n ref={triggerRef as Ref<HTMLButtonElement>}\n type=\"button\"\n onClick={onClick}\n aria-label={ariaLabel}\n title={title}\n disabled={disabled}\n {...restWithoutStyle}\n className={outerClassName}\n >\n {children}\n </button>\n );\n}\n\n/**\n * Wraps a trigger element in a Tooltip when a tooltip label is available.\n * Falls back to `ariaLabel` when `tooltip` is not explicitly set. If both\n * are absent (or `tooltip === false`), the trigger is returned unwrapped.\n */\nfunction withTooltip(\n trigger: ReactElement,\n {\n tooltip,\n ariaLabel,\n disabled,\n tooltipSide = \"top\",\n tooltipAlign = \"center\",\n shortcut,\n }: {\n tooltip?: string | false | undefined;\n ariaLabel?: string | undefined;\n disabled?: boolean | undefined;\n tooltipSide?: \"top\" | \"right\" | \"bottom\" | \"left\" | undefined;\n tooltipAlign?: \"start\" | \"center\" | \"end\" | undefined;\n shortcut?: TapShortcut | undefined;\n },\n): ReactElement {\n if (tooltip === false) return trigger;\n const label =\n typeof tooltip === \"string\" && tooltip.length > 0 ? tooltip : ariaLabel;\n if (!label) return trigger;\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n {disabled ? (\n // Radix Tooltip triggers need a hoverable element; a disabled button\n // does not dispatch pointer events, so we wrap in a span for the\n // trigger target while keeping the disabled visual state.\n <span className=\"inline-flex\">{trigger}</span>\n ) : (\n trigger\n )}\n </TooltipTrigger>\n <TooltipContent side={tooltipSide} align={tooltipAlign}>\n {tooltipBody(label, shortcut)}\n </TooltipContent>\n </Tooltip>\n );\n}\n\n// To resize/retune every tap button, edit styles.css — not here.\n\nexport const TapTargetButton = forwardRef<\n HTMLButtonElement,\n TapTargetButtonProps & TapTargetNativeProps\n>(function TapTargetButton(\n {\n icon,\n children,\n strokeWidth = 2,\n onClick,\n className,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n ...rest\n },\n ref,\n) {\n const color = className ?? \"text-foreground\";\n return useTapTarget({\n colorClassName: className,\n icon,\n children,\n strokeWidth,\n onClick,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n pillClassName: \"matrx-tap-pill matrx-glass-thin-border\",\n iconClassName: `matrx-tap-icon ${color}`,\n rest,\n buttonRef: ref,\n });\n});\n\nexport const TapTargetButtonTransparent = forwardRef<\n HTMLButtonElement,\n TapTargetButtonProps & TapTargetNativeProps\n>(function TapTargetButtonTransparent(\n {\n icon,\n children,\n strokeWidth = 2,\n onClick,\n className,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n ...rest\n },\n ref,\n) {\n const color = className ?? \"text-foreground\";\n return useTapTarget({\n colorClassName: className,\n icon,\n children,\n strokeWidth,\n onClick,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n pillClassName:\n \"matrx-tap-pill group-hover/tap:bg-muted group-active/tap:bg-muted-foreground/15\",\n iconClassName: `matrx-tap-icon ${color}`,\n rest,\n buttonRef: ref,\n });\n});\n\n/** Outline pill — a plain 1px border, no fill, no blur, no shadow. Glass only\n * reads as glass over something you can see through; on an opaque card or\n * header use THIS. Same colors as the classic square \"+\": border-border,\n * muted glyph, primary border + foreground glyph on hover. */\nexport const TapTargetButtonOutline = forwardRef<\n HTMLButtonElement,\n TapTargetButtonProps & TapTargetNativeProps\n>(function TapTargetButtonOutline(\n {\n icon,\n children,\n strokeWidth = 2,\n onClick,\n className,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n ...rest\n },\n ref,\n) {\n const color =\n className ?? \"text-muted-foreground group-hover/tap:text-foreground\";\n return useTapTarget({\n colorClassName: className,\n icon,\n children,\n strokeWidth,\n onClick,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n pillClassName:\n \"matrx-tap-pill border border-border bg-transparent transition-colors group-hover/tap:border-primary/60 group-active/tap:bg-muted\",\n iconClassName: `matrx-tap-icon ${color}`,\n labelClassName: `matrx-tap-label ${color}`,\n rest,\n buttonRef: ref,\n });\n});\n\nexport const TapTargetButtonSolid = forwardRef<\n HTMLButtonElement,\n TapTargetButtonSolidProps & TapTargetNativeProps\n>(function TapTargetButtonSolid(\n {\n icon,\n children,\n strokeWidth = 2,\n onClick,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tone,\n bgColor,\n iconColor,\n hoverBgColor,\n activeBgColor,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n ...rest\n },\n ref,\n) {\n return useTapTarget({\n icon,\n children,\n strokeWidth,\n onClick,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n ...solidClasses(tone, bgColor, iconColor, hoverBgColor, activeBgColor),\n rest,\n buttonRef: ref,\n });\n});\n\n// `tone` is the system's fill; the four color strings are the pre-tone API,\n// accepted only until their last callers move to `tone`. `matrx-tap-solid` marks the\n// filled pill so the stylesheet can give a DISABLED solid the system's disabled token\n// (muted fill + --disabled-foreground glyph) instead of a 40%-opacity ghost of its fill.\nfunction solidClasses(\n tone: TapSolidTone | undefined,\n bgColor: string | undefined,\n iconColor: string | undefined,\n hoverBgColor: string | undefined,\n activeBgColor: string | undefined,\n) {\n const legacy = !tone && (bgColor || iconColor || hoverBgColor || activeBgColor);\n if (!legacy) {\n const t = TAP_SOLID_TONE[tone ?? \"primary\"];\n return {\n pillClassName: `matrx-tap-pill matrx-tap-solid ${t.fill} ${t.glyph} group-active/tap:brightness-90`,\n iconClassName: `matrx-tap-icon ${t.glyph}`,\n labelClassName: `matrx-tap-label ${t.glyph}`,\n };\n }\n const glyph = iconColor ?? \"text-primary-foreground\";\n return {\n pillClassName: `matrx-tap-pill matrx-tap-solid ${bgColor ?? \"bg-primary\"} ${glyph} ${hoverBgColor ?? \"group-hover/tap:bg-primary/80\"} ${activeBgColor ?? \"group-active/tap:brightness-90\"}`,\n iconClassName: `matrx-tap-icon ${glyph}`,\n labelClassName: `matrx-tap-label ${glyph}`,\n };\n}\n\n/** Solid destructive pill — delete/remove actions. White-on-red like the\n * primary solid is white-on-blue. Use THIS, never hand-pass bg-destructive\n * with the default (dark) icon color. */\nexport const TapTargetButtonDestructive = forwardRef<\n HTMLButtonElement,\n TapTargetButtonSolidProps & TapTargetNativeProps\n>(function TapTargetButtonDestructive({ tone = \"destructive\", ...rest }, ref) {\n return <TapTargetButtonSolid ref={ref} tone={tone} {...rest} />;\n});\n\nexport const TapTargetButtonForGroup = forwardRef<\n HTMLButtonElement,\n TapTargetButtonProps & TapTargetNativeProps\n>(function TapTargetButtonForGroup(\n {\n icon,\n children,\n strokeWidth = 2,\n onClick,\n className,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n ...rest\n },\n ref,\n) {\n const color = className ?? \"text-foreground\";\n return useTapTarget({\n colorClassName: className,\n size: \"sm\",\n icon,\n children,\n strokeWidth,\n onClick,\n as,\n htmlFor,\n ariaLabel,\n disabled,\n href,\n target,\n rel,\n prefetch,\n linkComponent,\n tooltip,\n tooltipSide,\n tooltipAlign,\n label,\n mobileIconOnly,\n pillClassName: \"matrx-tap-pill matrx-tap-pill-sm matrx-glass-interactive\",\n iconClassName: `matrx-tap-icon ${color}`,\n labelClassName: `matrx-tap-label ${color}`,\n rest,\n buttonRef: ref,\n });\n});\n\nexport function TapTargetButtonGroup({\n children,\n className,\n surface: surfaceProp,\n}: {\n children: React.ReactNode;\n className?: string | undefined;\n /**\n * GLASS ONLY FLOATS (owner rule, 2026-10-02): glass belongs on a bar that\n * floats over scrolling content or a see-through plane. On a solid surface\n * (a page, a card, a toast, a table toolbar) use `\"solid\"`: a muted track,\n * no glass stroke, the same geometry.\n */\n surface?: \"glass\" | \"solid\" | undefined;\n}) {\n // Geometry (height, the half-gap outside the capsule, the capsule itself)\n // is `.matrx-tap-group*` in tap-target.css.\n const surface = useTapSurface(surfaceProp);\n return (\n <div\n className={className ? `matrx-tap-group ${className}` : \"matrx-tap-group\"}\n data-surface={surface}\n >\n <div\n className={\n surface === \"solid\"\n ? \"matrx-tap-group-capsule matrx-tap-group-capsule-solid\"\n : \"matrx-tap-group-capsule matrx-glass-thin-border\"\n }\n />\n <div className=\"matrx-tap-group-row\">{children}</div>\n </div>\n );\n}\n","\"use client\";\n\n/**\n * Tooltip — the ONE tooltip in the fleet.\n *\n * THE COLLAPSE (0.6.0). Two implementations existed: matrx-frontend's\n * `components/ui/tooltip.tsx` (182 import sites) and `@ai-matrx/tap-target`'s\n * `src/tooltip.tsx` — the latter an explicit inlined PORT of the former,\n * carrying a header that said so. tap-target shipped it only because its ~60\n * tap buttons need a tooltip and no shared package owned one; four repos then\n * adopted `TooltipProvider` from tap-target. That made tap-target — a\n * button-geometry package — the accidental owner of a design-system primitive,\n * with a second copy living in the biggest host.\n *\n * A tooltip is a design-system surface, so it lives here. tap-target now takes\n * `@ai-matrx/design-system` as an ordinary sibling dependency and imports this\n * file; its own copy is deleted, and its re-export removed. The DAG already\n * ordered design-system before tap-target, so no cycle is introduced.\n *\n * BEHAVIOR is matrx-frontend's, verbatim, including the ruling both copies\n * carried in prose:\n *\n * 1. THE ROOT RENDERS UNCONDITIONALLY — no hydration mount gate. The gate the\n * host wrapper once carried (\"Radix generates dynamic aria-controls ids that\n * differ between SSR and client\") was false: Radix ids come from React's\n * SSR-stable `useId`. It was actively harmful — a Trigger wraps\n * ALWAYS-VISIBLE content, so `return null` deleted that subtree from SSR and\n * the first client paint.\n *\n * 2. THE SURFACE IS TOKEN-DRIVEN, NOT BRANDED. Popover tokens, not\n * `bg-primary`: rich tooltip content using `text-muted-foreground` was\n * illegible on a brand-colored background in one theme or the other.\n * Since 2026-09-28 the `.matrx-tooltip` class re-scopes those tokens to a dark,\n * high-contrast chip in both themes (styles.css, THE TOOLTIP SURFACE): the\n * neutral white surface it wore before was indistinguishable from the\n * browser's own `title` box.\n *\n * 3. EVERY `title` IS THIS TOOLTIP. The provider installs the title takeover\n * (`title-tooltips.ts`), so a hand-written `title=` anywhere in the\n * document shows this surface, never the browser's.\n *\n * SEAM INVERSION. The host resolved nested portal targets through\n * `useNestedPortalContainer` (an app hook wired to its dialog + window-panel\n * systems); tap-target's port dropped that seam entirely and always portalled\n * to `document.body` — which is why a tooltip inside a popped-out panel landed\n * in the wrong window. Here it is the package's `PortalContainerProvider`\n * seam: an explicit `container` prop wins, then the injected container, then\n * `document.body`. Both prior behaviors are reachable; neither is forked.\n */\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { MOTION_POPPER } from \"./motion\";\nimport { usePortalContainer } from \"./portal-container\";\nimport { acquireTitleTooltips, clipTooltipText, tooltipSide, TOOLTIP_EDGE_PX, TOOLTIP_LAYER_Z, TOOLTIP_TRIGGER_ATTR, type Side } from \"./title-tooltips\";\n\nexport interface TooltipProviderProps\n extends React.ComponentProps<typeof TooltipPrimitive.Provider> {\n /**\n * THE TITLE TAKEOVER (2026-09-28) — while any provider is mounted, every native\n * `title` attribute in the document shows as this tooltip instead of the\n * browser's (see `title-tooltips.ts`). On by default, because a rule every\n * author must remember is a rule that is broken; pass `false` only for a\n * surface that must keep the browser's own box. One provider opting out does\n * not turn it off while another one is mounted.\n */\n titleTooltips?: boolean;\n}\n\n/**\n * Mount once near the app root. Every tooltip in the tree shares its\n * `delayDuration` / `skipDelayDuration` timing, and the root provider takes\n * over native `title` attributes (see `titleTooltips`). The fleet default keeps\n * tooltip content hoverable and selectable. A native mirrored Desktop shell may\n * explicitly opt in to `disableHoverableContent` so its overlay view yields the\n * pointer back to the host; ordinary application tooltips must leave it unset.\n */\nfunction TooltipProvider({ titleTooltips = true, disableHoverableContent = false, ...props }: TooltipProviderProps) {\n React.useEffect(() => {\n if (!titleTooltips) return;\n return acquireTitleTooltips();\n }, [titleTooltips]);\n return <TooltipPrimitive.Provider {...props} disableHoverableContent={disableHoverableContent} />;\n}\n\n/**\n * The tooltip root inherits its provider's hoverability policy: the ordinary\n * provider defaults to hoverable, selectable content (Arman, 2026-10-14), while\n * a native mirrored Desktop shell may opt in at its provider so the overlay view\n * yields pointer control to its host. An explicit root prop still wins.\n */\n/** The tooltip's trigger and whether it is open, so its content takes THE SMART SIDE\n * (title-tooltips.ts) from where the trigger stands at the moment it opens. */\ninterface TriggerState {\n ref: React.MutableRefObject<HTMLElement | null>;\n open: boolean;\n}\nconst TriggerContext = React.createContext<TriggerState | null>(null);\n\nconst Tooltip = ({ onOpenChange, ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>) => {\n const ref = React.useRef<HTMLElement | null>(null);\n const [open, setOpen] = React.useState(Boolean(props.open ?? props.defaultOpen));\n const shown = props.open ?? open;\n const value = React.useMemo(() => ({ ref, open: shown }), [shown]);\n return (\n <TriggerContext.Provider value={value}>\n <TooltipPrimitive.Root\n {...props}\n onOpenChange={(next) => {\n setOpen(next);\n onOpenChange?.(next);\n }}\n />\n </TriggerContext.Provider>\n );\n};\nTooltip.displayName = \"Tooltip\";\n\n/**\n * Stamps `data-matrx-tooltip-trigger` so the title takeover never draws a\n * second tooltip over a control that already has this one — it still lifts a\n * `title` on the same control, so the browser's box never doubles it either.\n */\nconst TooltipTrigger = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Trigger>\n>((props, ref) => {\n const trigger = React.useContext(TriggerContext);\n const setRef = React.useCallback(\n (node: HTMLButtonElement | null) => {\n if (trigger) trigger.ref.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n },\n [trigger, ref],\n );\n return <TooltipPrimitive.Trigger ref={setRef} {...{ [TOOLTIP_TRIGGER_ATTR]: \"\" }} {...props} />;\n});\nTooltipTrigger.displayName = TooltipPrimitive.Trigger.displayName;\n\nexport interface TooltipContentProps\n extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> {\n /**\n * Explicit portal target; wins over the injected `PortalContainerProvider`\n * value. Pass `null` to force `document.body`.\n */\n container?: HTMLElement | null;\n /**\n * Package-owned open/close motion. Default `true`. Pass `false` for a\n * surface that must appear instantly. It is NOT the reduced-motion switch;\n * `styles.css` already honors `prefers-reduced-motion`.\n */\n animated?: boolean;\n /**\n * The side when the control is not in a vertical stack and no side is given (the host's default:\n * a macOS desktop host says \"bottom\"). Omit for the document's `data-title-side`, else \"top\".\n */\n fallbackSide?: Side;\n}\n\nconst TooltipContent = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Content>,\n TooltipContentProps\n>(({ className, side, fallbackSide, sideOffset = 4, collisionPadding = TOOLTIP_EDGE_PX, container, animated = true, children, style, ...props }, ref) => {\n const resolved = usePortalContainer(container);\n const trigger = React.useContext(TriggerContext);\n // THE SMART SIDE: an explicit side wins; otherwise where the trigger's neighbours stand decides.\n const placed = side ?? (trigger?.open ? tooltipSide(trigger.ref.current, fallbackSide) : (fallbackSide ?? \"top\"));\n return (\n <TooltipPrimitive.Portal container={resolved ?? null}>\n <TooltipPrimitive.Content\n ref={ref}\n data-slot=\"tooltip-content\"\n side={placed}\n sideOffset={sideOffset}\n // Flip and stay inside the window: Radix flips to the opposite side when the preferred one\n // does not fit, and shifts along the edge; the padding keeps it off the window's border.\n avoidCollisions\n collisionPadding={collisionPadding}\n className={cn(\n \"matrx-tooltip max-w-xs select-text overflow-hidden whitespace-normal break-words rounded-md border border-border bg-popover px-2.5 py-1 text-xs font-medium text-popover-foreground\",\n animated && MOTION_POPPER,\n className,\n )}\n // THE tooltip layer: above every menu, popover and modal (Radix copies it onto its wrapper).\n style={{ zIndex: TOOLTIP_LAYER_Z, ...style }}\n {...props}\n >\n {typeof children === \"string\" ? clipTooltipText(children) : children}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n});\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nexport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };\nexport { acquireTitleTooltips, clipTooltipText, NATIVE_TITLE_OPT_OUT_ATTR, TOOLTIP_TEXT_BUDGET } from \"./title-tooltips\";\n","\"use client\";\n\n// THE TAP-TARGET GUARD — development builds only.\n//\n// The lock layer in tap-target.css makes a tap button's own box, pill and\n// glyph impossible to resize from outside. What CSS cannot stop is a caller\n// bending the system AROUND the button: a parent that adds `gap` between two\n// tap buttons, a wrapper with margin or padding, a local override of a\n// `--matrx-tap-*` token, a utility class smuggled in through `className`.\n// After a tap button mounts, this guard measures it in the real layout and,\n// on any of those, marks it `data-matrx-tap-violation`: the stylesheet then\n// paints it as a giant red box carrying the reason, and the console names\n// the element.\n//\n// OFF until the host turns it on with `enableTapTargetGuard()` — from code the\n// HOST compiles, e.g. matrx-frontend's dev-only client boot. Never gate it on\n// `process.env.NODE_ENV` in here: this package's own build inlines that\n// expression, so a \"dev only\" check written here would run in production too\n// (see @ai-matrx/associations' context.tsx for the outage that taught this).\n\nimport { useCallback, useRef, type MutableRefObject, type Ref } from \"react\";\nimport { layoutScale } from \"../layout-scale\";\n\n// A `Symbol.for` slot on globalThis, like the link seam: the `.` and\n// `./buttons` bundles each inline this module, and one switch must reach both.\nconst GUARD_SLOT = Symbol.for(\"@ai-matrx/tap-target:guard\");\ntype GlobalWithGuard = typeof globalThis & { [GUARD_SLOT]?: boolean };\n\n/** Turn the development guard on (or off). Call once at client boot, only in\n * development builds of the host. */\nexport function enableTapTargetGuard(on = true): void {\n (globalThis as GlobalWithGuard)[GUARD_SLOT] = on;\n if (on) startPillInsetScan();\n}\n\nfunction guardOn(): boolean {\n return (globalThis as GlobalWithGuard)[GUARD_SLOT] === true;\n}\n\nconst TOKENS = [\n \"--matrx-tap-box\",\n \"--matrx-tap-gap\",\n \"--matrx-tap-pill-size\",\n \"--matrx-tap-pill-sm-size\",\n \"--matrx-tap-wide-size\",\n \"--matrx-tap-icon-size\",\n \"--matrx-tap-touch-min\",\n \"--matrx-tap-target-size\",\n] as const;\n\n/** The only scopes that may move tap tokens, and which ones — each owned by\n * this package's own CSS: the table density scales (tap-target.css) and\n * Alchemy's 18px trigger glyph (content-transfer.css). */\nconst SANCTIONED: ReadonlyArray<{ scope: string; tokens: ReadonlySet<string> }> = [\n {\n scope: \"[data-matrx-table][data-matrx-table-density]\",\n tokens: new Set([\n \"--matrx-tap-target-size\",\n \"--matrx-tap-pill-size\",\n \"--matrx-tap-wide-size\",\n \"--matrx-tap-pill-sm-size\",\n \"--matrx-tap-icon-size\",\n ]),\n },\n { scope: \"[data-alchemy-trigger]\", tokens: new Set([\"--matrx-tap-icon-size\"]) },\n // THE ONE CONTROL scope (controls.css): tap buttons beside the 28px controls\n // take the controls' height — a 28px pill in a 34px box, the same 6px apart.\n {\n scope: \"[data-matrx-controls]\",\n tokens: new Set([\n \"--matrx-tap-target-size\",\n \"--matrx-tap-pill-size\",\n \"--matrx-tap-wide-size\",\n \"--matrx-tap-pill-sm-size\",\n ]),\n },\n];\nconst TABLE_SCOPE = SANCTIONED[0]!.scope;\nconst CONTROL_SCOPE = SANCTIONED[2]!.scope;\nconst TAP_ITEM = \".matrx-tap-target, .matrx-tap-group\";\n\n/** `className` on a tap button is the GLYPH COLOR. Anything that sizes,\n * spaces, positions or fills is misuse. */\nconst NON_COLOR_CLASS =\n /^(?:[^\\s:]+:)*!?-?(?:\\[&|scale|translate|h|w|size|min-h|min-w|max-h|max-w|p|px|py|ps|pe|pt|pb|pl|pr|m|mx|my|ms|me|mt|mb|ml|mr|gap|space-x|space-y|bg|rounded|border|ring|shadow|absolute|relative|fixed|sticky|inset|top|left|right|bottom|flex|grid|block|inline|hidden|z|shrink|grow|basis|self|order)(?:-|$|\\[)/;\n\nexport function classNameMisuse(className: string | undefined): string | null {\n if (!guardOn() || !className) return null;\n const bad = className.split(/\\s+/).filter((t) => t && NON_COLOR_CLASS.test(t));\n return bad.length\n ? `className is the glyph color only — remove \"${bad.join(\" \")}\"`\n : null;\n}\n\n/**\n * The horizontal space a wrapper adds around what it holds. An `auto` margin (`ml-auto` pushing a\n * toolbar's actions to the end) only aligns — the browser resolves it to pixels in\n * `getComputedStyle`, so read the computed keyword from the typed OM and count it as zero.\n */\nexport function wrapperSpace(el: Element, view: Window): number {\n const pcs = view.getComputedStyle(el);\n const typed = (el as Element & { computedStyleMap?: () => { get(p: string): unknown } }).computedStyleMap?.();\n const margin = (prop: \"margin-left\" | \"margin-right\", resolved: string) =>\n typed && String(typed.get(prop)) === \"auto\" ? 0 : px(resolved);\n return margin(\"margin-left\", pcs.marginLeft) + margin(\"margin-right\", pcs.marginRight) + px(pcs.paddingLeft) + px(pcs.paddingRight);\n}\n\nfunction px(value: string): number {\n const n = Number.parseFloat(value);\n return Number.isFinite(n) ? n : 0;\n}\n\nfunction describe(el: Element): string {\n const cls = typeof el.className === \"string\" ? el.className.trim().split(/\\s+/).slice(0, 4).join(\".\") : \"\";\n return `<${el.tagName.toLowerCase()}${cls ? `.${cls}` : \"\"}>`;\n}\n\n/** Elements that ride along with a tap button without taking space from it\n * (a badge, a capsule, a tooltip portal anchor). */\nfunction isDecor(el: Element, view: Window): boolean {\n const cs = view.getComputedStyle(el);\n return cs.position === \"absolute\" || cs.position === \"fixed\" || cs.display === \"none\";\n}\n\nfunction tapCount(el: Element): number {\n return el.matches(TAP_ITEM) ? 1 : el.querySelectorAll(TAP_ITEM).length;\n}\n\n/** Visible text in `container` outside `tap` and outside decor (a badge's\n * count is decor) — a wrapper with its own words is a chip, not a wrapper. */\nfunction ownText(container: Element, tap: Element, view: Window): string {\n let out = \"\";\n const walk = (node: Node) => {\n if (node === tap) return;\n if (node.nodeType === 3) out += node.textContent ?? \"\";\n else if (node.nodeType === 1 && !isDecor(node as Element, view)) node.childNodes.forEach(walk);\n };\n container.childNodes.forEach(walk);\n return out.trim();\n}\n\n/** True when `child` is a tap button, or a plain wrapper whose only content\n * is ONE tap button (plus decor) — never a search box that happens to hold\n * a clear button, never a chip with words. */\nfunction isTapSlot(child: Element, view: Window): boolean {\n if (child.matches(TAP_ITEM)) return true;\n if (tapCount(child) !== 1) return false;\n const tap = child.querySelector(TAP_ITEM)!;\n const controls = Array.from(child.querySelectorAll(\"input, select, textarea, button, a, [role='button']\"));\n if (controls.some((c) => c !== tap && !tap.contains(c))) return false;\n return ownText(child, tap, view) === \"\";\n}\n\nlet probe: { key: string; target: number; pill: number; sm: number; smPill: number; wide: number; icon: number } | null = null;\n\n/** What the package's own CSS produces with no surrounding context — the\n * canon every mounted button is measured against. Re-measured whenever the\n * root tokens change (the lab page switches the gap). */\nfunction canon(doc: Document) {\n const view = doc.defaultView!;\n const root = view.getComputedStyle(doc.documentElement);\n const key = TOKENS.map((t) => root.getPropertyValue(t)).join(\"|\");\n if (probe?.key === key) return probe;\n const host = doc.createElement(\"div\");\n host.setAttribute(\"aria-hidden\", \"true\");\n host.style.cssText = \"position:absolute;visibility:hidden;pointer-events:none;left:-9999px;top:0\";\n host.innerHTML =\n '<button class=\"matrx-tap-target\"><div class=\"matrx-tap-pill\"><svg class=\"matrx-tap-icon\"></svg></div></button>' +\n '<button class=\"matrx-tap-target matrx-tap-target-sm\"><div class=\"matrx-tap-pill matrx-tap-pill-sm\"></div></button>' +\n '<button class=\"matrx-tap-target matrx-tap-target-inline\"><div class=\"matrx-tap-pill matrx-tap-pill-inline\"></div></button>';\n doc.body.appendChild(host);\n const [a, b, w] = Array.from(host.children) as HTMLElement[];\n probe = {\n key,\n target: a!.offsetHeight,\n pill: (a!.firstElementChild as HTMLElement).offsetHeight,\n icon: px(view.getComputedStyle(a!.querySelector(\"svg\")!).height),\n sm: b!.offsetHeight,\n smPill: (b!.firstElementChild as HTMLElement).offsetHeight,\n wide: (w!.firstElementChild as HTMLElement).offsetHeight,\n };\n host.remove();\n return probe;\n}\n\n/** Returns the first rule this mounted tap button breaks, or null. */\nexport function findTapViolation(el: HTMLElement): string | null {\n const doc = el.ownerDocument;\n const view = doc.defaultView;\n if (!view || !el.isConnected) return null;\n const cs = view.getComputedStyle(el);\n if (cs.display === \"none\") return null;\n\n // 1. Tokens are the package's alone. Only the table-density scope may move\n // the three it owns.\n const root = view.getComputedStyle(doc.documentElement);\n // Both scaled scopes size by their own tokens; the canon check below reads\n // the root canon, so it applies outside them only.\n const inTable = el.closest(TABLE_SCOPE) !== null || el.closest(CONTROL_SCOPE) !== null;\n const moved = new Set<string>();\n for (const token of TOKENS) {\n const mine = cs.getPropertyValue(token).trim();\n const base = root.getPropertyValue(token).trim();\n if (mine === base) continue;\n if (!SANCTIONED.some((s) => s.tokens.has(token) && el.closest(s.scope))) {\n return `${token} overridden to \"${mine}\" — tap geometry is not configurable`;\n }\n moved.add(token);\n }\n\n // 2. Measured geometry equals the canon (outside table density, which\n // sizes by its own tokens).\n const sm = el.classList.contains(\"matrx-tap-target-sm\");\n const inline = /matrx-tap-target-(?:inline|mobile-icon-only)/.test(el.className);\n const pill = el.querySelector<HTMLElement>(\":scope > .matrx-tap-pill\");\n const icon = pill?.querySelector(\".matrx-tap-icon\") ?? null;\n // A host touch floor (min-width / min-height) may enlarge a box; that is\n // the floor working, not a bend.\n const floored =\n px(cs.minHeight) >= el.offsetHeight - 0.5 || px(cs.minWidth) >= el.offsetWidth - 0.5;\n if (!inTable && pill && !floored) {\n const c = canon(doc);\n const box = sm ? c.sm : c.target;\n // A labeled pill is a WIDE shape (shorter than a round one); below the\n // `sm` breakpoint a mobile-icon-only pill is round again — either is canon.\n const pillSizes = sm ? [c.smPill] : inline ? [c.pill, c.wide] : [c.pill];\n if (Math.abs(el.offsetHeight - box) > 0.5) return `button is ${el.offsetHeight}px tall, canon is ${box}px`;\n if (!inline && Math.abs(el.offsetWidth - box) > 0.5) return `button is ${el.offsetWidth}px wide, canon is ${box}px`;\n if (!pillSizes.some((p) => Math.abs(pill.offsetHeight - p) <= 0.5)) {\n return `pill is ${pill.offsetHeight}px, canon is ${pillSizes.join(\" or \")}px`;\n }\n if (icon && !moved.has(\"--matrx-tap-icon-size\")) {\n const size = px(view.getComputedStyle(icon).height);\n if (Math.abs(size - c.icon) > 0.5) return `glyph is ${size}px, canon is ${c.icon}px`;\n }\n }\n\n // 3. Nothing adds space around it. Climb the wrappers that hold only this\n // button (plus decor such as a badge); none may carry inline margin or\n // padding. A tap button inside a group is represented by its group.\n let slot: Element = el;\n if (el.parentElement?.matches(\".matrx-tap-group-row, .matrx-tap-search-measure\")) {\n const group = el.closest(\".matrx-tap-group\");\n if (group && tapCount(el.parentElement) > 1) return null;\n slot = group ?? el;\n }\n for (let depth = 0; depth < 2; depth += 1) {\n const parent: HTMLElement | null = slot.parentElement;\n if (!parent || parent === doc.body) break;\n const others = Array.from(parent.children).filter((c) => c !== slot && !isDecor(c, view));\n if (others.length > 0) break; // `parent` is the row\n if (ownText(parent, slot, view) !== \"\") break; // a chip or a titled header\n const space = wrapperSpace(parent, view);\n if (space > 0.5) {\n return `${describe(parent)} adds ${space}px around a tap button — tap buttons space themselves`;\n }\n slot = parent;\n }\n\n // 4. The row adds no gap between tap buttons.\n const row = slot.parentElement;\n if (row) {\n const rcs = view.getComputedStyle(row);\n const flexOrGrid = /flex|grid/.test(rcs.display);\n const neighbours = Array.from(row.children).filter((c) => c !== slot && isTapSlot(c, view));\n if (flexOrGrid && neighbours.length > 0) {\n const horizontal = rcs.display.includes(\"grid\") || !rcs.flexDirection.startsWith(\"column\");\n const gap = px(horizontal ? rcs.columnGap : rcs.rowGap);\n if (gap > 0.5) {\n return `${describe(row)} adds a ${gap}px gap between tap buttons — remove it; tap buttons space themselves`;\n }\n }\n }\n return null;\n}\n\n/* ------------------------------------------------------------------ */\n/* PLACEMENT — the three rules a tap button's SURROUNDINGS must keep */\n/* (owner, 2026-10-02). Reported as a WARNING (a dashed outline and one */\n/* console error naming the fix), not the misuse box: they are about */\n/* the page around the button, and the whole app is being brought into */\n/* line with them. */\n/* 1. GLASS ONLY FLOATS — glass is see-through; it belongs on a bar */\n/* that floats over moving content (position fixed/sticky) or on a */\n/* plane marked `data-matrx-glass-plane`. On a page, card, toast or */\n/* table use `variant=\"transparent\"` / a solid group. */\n/* 2. ALL GLASS OR NONE — a glass item's row holds only glass items */\n/* (glass tap buttons, glass groups, or `data-matrx-glass` pieces). */\n/* 3. NEIGHBOURS KEEP THEIR HALF-GAP — a tap box carries 3px of unseen */\n/* space each side (box − pill = one gap, 6px). Anything beside it */\n/* adds its own 3px, so the visible distance is always one gap. */\n/* ------------------------------------------------------------------ */\n\nconst GLASS = \".matrx-glass-thin-border, .matrx-glass-interactive\";\n\nfunction isGlassItem(node: Element): boolean {\n if (node.hasAttribute(\"data-matrx-glass\")) return true;\n if (node.matches(\".matrx-tap-group\")) return node.querySelector(\":scope > .matrx-tap-group-capsule.matrx-glass-thin-border\") !== null;\n if (node.matches(\".matrx-tap-target\")) return node.querySelector(`:scope > .matrx-tap-pill:is(${GLASS})`) !== null;\n // A plain wrapper whose only content is ONE tap button (plus decor such as a\n // badge) is that button: a badge host around a glass button is glass.\n const view = node.ownerDocument.defaultView;\n if (view && isTapSlot(node, view)) return isGlassItem(node.querySelector(TAP_ITEM)!);\n return false;\n}\n\nconst SCROLLS = /^(auto|scroll|overlay)$/;\n\n/** True when `el` rides a bar over moving content: a fixed/sticky ancestor (or\n * a glass plane) reached BEFORE any scroll container. Inside a scroller the\n * button IS the moving content — an app root that is itself `position:\n * fixed` (the shell) must not make every page button \"float\". */\nfunction floats(el: Element, view: Window): boolean {\n for (let n: Element | null = el; n && n !== el.ownerDocument.body; n = n.parentElement) {\n if (n.hasAttribute(\"data-matrx-glass-plane\")) return true;\n const cs = view.getComputedStyle(n);\n if (cs.position === \"fixed\" || cs.position === \"sticky\") return true;\n if (n !== el && (SCROLLS.test(cs.overflowY) || SCROLLS.test(cs.overflowX))) return false;\n }\n return false;\n}\n\n/** True when the edge of `wrapper` that faces a neighbour (`side` is where the\n * wrapper sits relative to that neighbour) is itself a tap slot: that button\n * carries its own 3px half-gap, so the wrapper is spacing-correct however many\n * tap buttons it holds (the fading mic + More cluster beside Send). A wrapper\n * whose edge is text or a field is not — it still has to keep its distance. */\nfunction facesWithTapSlot(wrapper: Element, side: \"after\" | \"before\", view: Window): boolean {\n for (let node: Element | null = wrapper; node; ) {\n if (isTapSlot(node, view)) return true;\n const kids: Element[] = Array.from(node.children).filter((c) => !isDecor(c, view));\n node = (side === \"after\" ? kids[0] : kids[kids.length - 1]) ?? null;\n }\n return false;\n}\n\nfunction visible(el: Element, view: Window): boolean {\n if (el.getAttribute(\"aria-hidden\") === \"true\" || isDecor(el, view)) return false;\n const r = el.getBoundingClientRect();\n return r.width > 1 && r.height > 1;\n}\n\nconst INTERACTIVE = \"button, a[href], input, select, textarea, [role='button'], svg, img\";\n\n/** The box the eye sees on the side of `sib` that faces the tap button. An\n * unpainted layout wrapper (no fill, no border on that side, no words of its\n * own) is invisible, so the distance is judged at the first thing inside it —\n * the wrapper around ProTextarea's mic sits 3px from Expand while the mic\n * capsule, which keeps its own 3px margin, sits one gap away (2026-10-13). */\nfunction facingBox(sib: Element, side: \"after\" | \"before\", view: Window): Element {\n let node = sib;\n for (;;) {\n if (node.matches(INTERACTIVE)) return node;\n const cs = view.getComputedStyle(node);\n const fill = cs.backgroundColor;\n if ((fill && fill !== \"rgba(0, 0, 0, 0)\" && fill !== \"transparent\") || px(side === \"after\" ? cs.borderLeftWidth : cs.borderRightWidth) > 0) {\n return node;\n }\n if (Array.from(node.childNodes).some((c) => c.nodeType === 3 && c.textContent?.trim())) return node;\n const kids = Array.from(node.children).filter((c) => visible(c, view));\n const next = side === \"after\" ? kids[0] : kids[kids.length - 1];\n if (!next) return node;\n node = next;\n }\n}\n\n/** The first placement rule this tap button's surroundings break, or null. */\nexport function findTapPlacementWarning(el: HTMLElement): string | null {\n const doc = el.ownerDocument;\n const view = doc.defaultView;\n if (!view || !el.isConnected) return null;\n // A button inside a group is judged as its group.\n const slot: Element = el.closest(\".matrx-tap-group\") ?? el;\n const glass = isGlassItem(slot);\n\n if (glass && !floats(slot, view)) {\n return 'glass on a solid surface — glass only floats over moving content; use variant=\"transparent\" (or a solid group)';\n }\n\n const row = slot.parentElement;\n if (!row) return null;\n if (glass) {\n const mixed = Array.from(row.children).find((c) => c !== slot && visible(c, view) && !isGlassItem(c));\n if (mixed) return `glass beside non-glass ${describe(mixed)} — make the row all glass or none`;\n }\n\n const pill = (el.querySelector(\":scope > .matrx-tap-pill\") as HTMLElement | null) ?? (slot.querySelector(\".matrx-tap-group-capsule\") as HTMLElement | null);\n if (!pill) return null;\n const gap = px(view.getComputedStyle(el).getPropertyValue(\"--matrx-tap-gap\")) || 6;\n const p = pill.getBoundingClientRect();\n if (p.width === 0) return null;\n // Distances are judged in LAYOUT pixels: inside a zoomed (transformed) tile a screen distance\n // is the layout distance times the scale.\n const scale = layoutScale(pill);\n for (const [side, sib] of [[\"after\", slot.nextElementSibling], [\"before\", slot.previousElementSibling]] as const) {\n if (!sib || !visible(sib, view) || isTapSlot(sib, view) || isGlassItem(sib) || facesWithTapSlot(sib, side, view)) continue;\n if (Math.abs(sib.getBoundingClientRect().top + sib.getBoundingClientRect().height / 2 - (p.top + p.height / 2)) > p.height) continue; // not on this row\n const box = facingBox(sib, side, view);\n const r = box.getBoundingClientRect();\n const cs = view.getComputedStyle(box);\n const distance =\n (side === \"after\" ? r.left - p.right : p.left - r.right) / scale + (side === \"after\" ? px(cs.paddingLeft) : px(cs.paddingRight));\n if (distance < gap - 0.5) {\n return `${describe(sib)} sits ${Math.round(distance)}px from the pill — anything beside a tap button adds its own ${gap / 2}px (the box only carries ${gap / 2}px)`;\n }\n }\n return null;\n}\n\nconst reported = new Set<string>();\n\nfunction report(el: HTMLElement, reason: string) {\n el.setAttribute(\"data-matrx-tap-violation\", reason);\n const key = `${reason}@${el.getAttribute(\"aria-label\") ?? el.textContent ?? \"\"}`;\n if (reported.has(key)) return;\n reported.add(key);\n console.error(`[tap-target] ${reason}`, el);\n}\n\nconst mounted = new Set<HTMLElement>();\nlet resizeTimer: ReturnType<typeof setTimeout> | null = null;\nlet listening = false;\n\nfunction check(node: HTMLElement) {\n const reason = findTapViolation(node);\n if (reason) {\n report(node, reason);\n return;\n }\n node.removeAttribute(\"data-matrx-tap-violation\");\n const warning = findTapPlacementWarning(node);\n if (warning) {\n node.setAttribute(\"data-matrx-tap-warning\", warning);\n const key = `w:${warning}@${node.getAttribute(\"aria-label\") ?? \"\"}`;\n if (!reported.has(key)) {\n reported.add(key);\n console.error(`[tap-target] ${warning}`, node);\n }\n } else node.removeAttribute(\"data-matrx-tap-warning\");\n}\n\nfunction listenForResize(view: Window) {\n if (listening) return;\n listening = true;\n view.addEventListener(\"resize\", () => {\n if (resizeTimer) clearTimeout(resizeTimer);\n resizeTimer = setTimeout(() => mounted.forEach((n) => (n.isConnected ? check(n) : mounted.delete(n))), 200);\n });\n // A button is judged once, at mount — but its neighbours keep changing (a\n // loading placeholder becomes the real control). Re-judge a button when the\n // row it sits in gains or loses children, so a mark never outlives the\n // neighbour it named (2026-10-13: \"New run\" kept a red outline for a\n // skeleton that had already left the header).\n const Observer = (view as Window & { MutationObserver?: typeof MutationObserver }).MutationObserver;\n if (!Observer || !view.document.body) return;\n const changedRows = new Set<Node>();\n let rowTimer: ReturnType<typeof setTimeout> | null = null;\n new Observer((records) => {\n for (const r of records) changedRows.add(r.target);\n if (rowTimer) clearTimeout(rowTimer);\n rowTimer = setTimeout(() => {\n mounted.forEach((n) => {\n if (!n.isConnected) return void mounted.delete(n);\n const row = (n.closest(\".matrx-tap-group\") ?? n).parentElement;\n if (row && changedRows.has(row)) check(n);\n });\n changedRows.clear();\n }, 200);\n }).observe(view.document.body, { childList: true, subtree: true });\n}\n\nfunction assignRef<T>(ref: Ref<T> | undefined, value: T | null) {\n if (typeof ref === \"function\") ref(value);\n else if (ref) (ref as MutableRefObject<T | null>).current = value;\n}\n\n/**\n * The callback ref every tap trigger carries. In production it only forwards\n * the caller's ref; in development it also measures the trigger once it is in\n * the layout and paints a violation.\n */\nexport function useTapGuardRef<T extends HTMLElement>(\n forwarded: Ref<T> | undefined,\n propViolation: string | null,\n): (node: T | null) => void {\n const current = useRef<T | null>(null);\n return useCallback(\n (node: T | null) => {\n assignRef(forwarded, node);\n if (current.current && current.current !== node) mounted.delete(current.current);\n current.current = node;\n if (!guardOn() || !node) return;\n if (propViolation) {\n report(node, propViolation);\n return;\n }\n const view = node.ownerDocument.defaultView;\n if (!view) return;\n mounted.add(node);\n listenForResize(view);\n view.requestAnimationFrame(() => check(node));\n },\n [forwarded, propViolation],\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* THE PILL-INSET GUARD (0.60.10). A pill is balanced when its INK sits */\n/* the same distance from both edges. On 2026-10-04 every icon+label */\n/* pill read off-centre (1.3–3.3px) because padding was shaved on the */\n/* glyph side by a guess at the glyph's air. The trim in tap-target.css */\n/* now removes each glyph's real air; this measures the result in the */\n/* real layout and marks any pill whose ink insets differ by more than */\n/* 2px — dashed red outline + one console error naming both numbers. */\n/* ------------------------------------------------------------------ */\n\nconst PILL_TOLERANCE_PX = 2;\nconst PILL_ITEMS = \"button, a[href], [role='button'], [role='tab'], [role='radio'], [role='menuitem']\";\nconst PILL_CANDIDATES = \"button, a[href], [role='button'], .rounded-full, .matrx-tap-pill-inline, .matrx-tap-pill-mobile-icon-only\";\n\n/** Horizontal ink extents inside `el`: glyph geometry for svgs, text runs for text. */\nfunction inkExtents(el: Element): { left: number; right: number } | null {\n const doc = el.ownerDocument;\n const view = doc.defaultView;\n if (!view) return null;\n let left = Infinity;\n let right = -Infinity;\n const walker = doc.createTreeWalker(el, 0x1 | 0x4 /* SHOW_ELEMENT | SHOW_TEXT */);\n let n: Node | null;\n while ((n = walker.nextNode())) {\n if (n.nodeType === 1) {\n const node = n as Element;\n const cs = view.getComputedStyle(node);\n if (cs.display === \"none\" || cs.visibility === \"hidden\" || cs.position === \"absolute\") continue;\n const tag = node.tagName.toLowerCase();\n if (tag === \"img\" || tag === \"picture\" || tag === \"video\" || tag === \"canvas\") {\n // A picture (a favicon, an avatar) is ink by its box — it draws its own pixels, and a logo\n // renders exactly as it is, never tinted to make a guard see it (2026-10-13: every\n // favicon-led link pill read \"29px left vs 10px right\" because the image was invisible here).\n const r = node.getBoundingClientRect();\n if (r.width > 0) {\n left = Math.min(left, r.left);\n right = Math.max(right, r.right);\n }\n continue;\n }\n if (tag !== \"svg\" && (node.getAttribute(\"role\") === \"status\" || node.getAttribute(\"role\") === \"progressbar\")) {\n // A busy spinner drawn with borders (its rings are absolute, so nothing below sees them)\n // is ink by its box: a pill whose icon turned into a spinner read \"44px left vs 20px right\".\n const r = node.getBoundingClientRect();\n if (r.width > 0) {\n left = Math.min(left, r.left);\n right = Math.max(right, r.right);\n }\n continue;\n }\n if (tag !== \"svg\") {\n // A painted chip inside the pill (a count badge) is ink by its box: its fill is what the eye sees.\n const paintedChip = (cs.backgroundColor !== \"rgba(0, 0, 0, 0)\" && cs.backgroundColor !== \"transparent\") || parseFloat(cs.borderLeftWidth) > 0;\n if (paintedChip) {\n const r = node.getBoundingClientRect();\n if (r.width > 0) {\n left = Math.min(left, r.left);\n right = Math.max(right, r.right);\n }\n }\n continue;\n }\n const svg = node as SVGGraphicsElement;\n if (typeof svg.getBBox !== \"function\" || typeof svg.getScreenCTM !== \"function\") continue;\n const bb = svg.getBBox();\n const ctm = svg.getScreenCTM();\n if (!ctm || bb.width === 0) continue;\n if (Math.abs(ctm.b) > 0.001 || Math.abs(ctm.c) > 0.001) {\n // A turning glyph (a busy spinner) has no fixed ink: judge it by its layout box, centered\n // where the rotation centers it — never by a mid-turn snapshot of its paths.\n const r = node.getBoundingClientRect();\n const half = (parseFloat(cs.width) || r.width) / 2;\n const mid = r.left + r.width / 2;\n left = Math.min(left, mid - half);\n right = Math.max(right, mid + half);\n continue;\n }\n const half = ((parseFloat(cs.strokeWidth) || 0) * Math.abs(ctm.a)) / 2;\n const x1 = ctm.a * bb.x + ctm.e;\n const x2 = ctm.a * (bb.x + bb.width) + ctm.e;\n left = Math.min(left, Math.min(x1, x2) - half);\n right = Math.max(right, Math.max(x1, x2) + half);\n } else if (n.nodeValue && n.nodeValue.trim()) {\n const parent = n.parentElement;\n if (!parent || parent.closest(\"svg\")) continue;\n const pcs = view.getComputedStyle(parent);\n if (pcs.visibility === \"hidden\" || pcs.position === \"absolute\") continue;\n const range = doc.createRange();\n range.selectNodeContents(n);\n // A truncated label (`truncate max-w-*`) draws only what its clipping box shows: its text\n // run keeps going past the ellipsis, so the run is clipped to every overflow-hiding box\n // between it and the pill (2026-10-18: a scope chip \"matrx-frontend (LCP test)\" read\n // \"9.0px left vs 5.7px right\" while its ellipsis sat exactly 9px from the edge).\n const clip = textClip(parent, el, view);\n for (const r of Array.from(range.getClientRects())) {\n if (r.width <= 0) continue;\n const rl = Math.max(r.left, clip.left);\n const rr = Math.min(r.right, clip.right);\n if (rr <= rl) continue;\n left = Math.min(left, rl);\n right = Math.max(right, rr);\n }\n }\n }\n return Number.isFinite(left) && Number.isFinite(right) ? { left, right } : null;\n}\n\n/** The horizontal window a text run can paint in: its overflow-clipping ancestors up to (excluding) `pill`. */\nfunction textClip(from: Element, pill: Element, view: Window): { left: number; right: number } {\n let left = -Infinity;\n let right = Infinity;\n for (let node: Element | null = from; node && node !== pill; node = node.parentElement) {\n const cs = view.getComputedStyle(node);\n // overflow-x, or the shorthand's first (x) value where a runtime does not expand it (jsdom)\n const clipsX = (cs.overflowX && cs.overflowX !== \"visible\") || (cs.overflow && !cs.overflow.startsWith(\"visible\"));\n if (clipsX) {\n const r = node.getBoundingClientRect();\n if (r.width > 0) {\n left = Math.max(left, r.left);\n right = Math.min(right, r.right);\n }\n }\n }\n return { left, right };\n}\n\nconst FIELDS = \"input, textarea, select, [contenteditable='true'], [role='textbox'], [role='searchbox'], [role='combobox']\";\n\n/**\n * Only a BUTTON can be a pill whose ink must balance: an interactive element,\n * or the painted pill inside one (a tap button's `.matrx-tap-pill-inline`).\n * A field — or a capsule that holds one, like a rounded search box — aligns its\n * text to an edge by design, and a non-interactive container (a status chip, a\n * wrapper painted `rounded-full`) is never a pill button (2026-10-09: the\n * messenger's search field and messaging's AI chips wore the red outline).\n */\nexport function isPillButton(el: Element): boolean {\n if (el.matches(FIELDS) || el.querySelector(FIELDS) !== null) return false;\n if (el.matches(PILL_ITEMS)) return true;\n if (el.parentElement?.closest(PILL_ITEMS)) return true;\n return el.querySelector(PILL_ITEMS) !== null;\n}\n\n/** Why this pill's ink is off-centre, or null. Only judges a pill — a capsule\n * (radius ≥ half its height) with its own fill or border, carrying ink. */\nexport function findPillInsetWarning(el: HTMLElement): string | null {\n const view = el.ownerDocument.defaultView;\n if (!view || !el.isConnected) return null;\n if (!isPillButton(el)) return null;\n const box = el.getBoundingClientRect();\n const scale = layoutScale(el);\n if (box.width / scale < 20 || box.height / scale < 16 || box.height / scale > 48) return null;\n const cs = view.getComputedStyle(el);\n if (parseFloat(cs.borderTopLeftRadius) < box.height / scale / 2 - 1) return null;\n const painted = cs.backgroundColor !== \"rgba(0, 0, 0, 0)\" && cs.backgroundColor !== \"transparent\";\n if (!painted && !(parseFloat(cs.borderLeftWidth) > 0)) return null;\n // A wide capsule (a stretched select or field) aligns content to an edge on purpose.\n if (box.width / scale > 320) return null;\n // Ink balance is a question only for CENTERED content. A select trigger (value left, chevron\n // right), a field, or a full-width action row that says justify-start aligns its content on\n // purpose — content alignment is placement, not an inset to balance.\n if (cs.display.includes(\"flex\") && ![\"center\", \"normal\"].includes(cs.justifyContent)) return null;\n if (el.matches(\"[data-matrx-control='select'], [data-matrx-control='field']\")) return null;\n // A switch, checkbox or slider carries STATE, not a label: its thumb sits at one end by design\n // (measured 2026-10-04: every connector switch read \"18px left vs 2px right\" in the chat composer).\n if (el.matches(\"[role='switch'], [role='checkbox'], [role='slider'], [role='radio']\")) return null;\n // A TRACK of several controls (a segmented nav, a tab strip) is a container, not a pill: its\n // items sit where the selection puts them, so the ink is lopsided by design — each item is\n // judged on its own (measured 2026-10-05: the shell route nav's icon track read 2px vs 12.5px\n // at 768 because the selected item's fill hugs one end and the last glyph carries its air).\n if (el.querySelectorAll(PILL_ITEMS).length > 1) return null;\n const ink = inkExtents(el);\n if (!ink) return null;\n const left = (ink.left - box.left) / scale;\n const right = (box.right - ink.right) / scale;\n if (left < 0 || right < 0) return null; // clipped / overflowing content: not this guard's question\n if (Math.abs(left - right) <= PILL_TOLERANCE_PX) return null;\n return `pill ink is off-centre: ${left.toFixed(1)}px left vs ${right.toFixed(1)}px right — pad both sides alike and let the glyph trim (tap-target.css, THE OPTICAL GLYPH TRIM) remove the glyph's air; never shave one side by hand`;\n}\n\nlet pillTimer: ReturnType<typeof setTimeout> | null = null;\nlet pillObserver: MutationObserver | null = null;\n\nfunction scanPills(doc: Document) {\n if (!guardOn()) return;\n for (const node of Array.from(doc.querySelectorAll<HTMLElement>(PILL_CANDIDATES))) {\n // A tap button's own pill is judged, not its invisible box.\n if (node.classList.contains(\"matrx-tap-target\")) continue;\n const warning = findPillInsetWarning(node);\n if (warning) {\n if (node.getAttribute(\"data-matrx-pill-inset-warning\") === warning) continue;\n node.setAttribute(\"data-matrx-pill-inset-warning\", warning);\n const key = `p:${warning}@${(node.textContent ?? \"\").trim().slice(0, 40)}`;\n if (!reported.has(key)) {\n reported.add(key);\n console.error(`[tap-target] ${warning}`, node);\n }\n } else if (node.hasAttribute(\"data-matrx-pill-inset-warning\")) {\n node.removeAttribute(\"data-matrx-pill-inset-warning\");\n }\n }\n}\n\nfunction startPillInsetScan() {\n if (pillObserver || typeof document === \"undefined\" || typeof MutationObserver === \"undefined\") return;\n const doc = document;\n const schedule = () => {\n if (pillTimer) clearTimeout(pillTimer);\n pillTimer = setTimeout(() => scanPills(doc), 600);\n };\n pillObserver = new MutationObserver((records) => {\n // Our own attribute writes must not re-trigger the scan.\n if (records.every((r) => r.type === \"attributes\" && r.attributeName === \"data-matrx-pill-inset-warning\")) return;\n schedule();\n });\n const begin = () => {\n pillObserver?.observe(doc.body, { childList: true, subtree: true, characterData: true, attributes: true, attributeFilter: [\"class\", \"style\", \"data-matrx-pill-inset-warning\"] });\n schedule();\n };\n if (doc.body) begin();\n else doc.addEventListener(\"DOMContentLoaded\", begin, { once: true });\n}\n","// THE LAYOUT SCALE (0.62.4). The dev guards (pill guard, tap-target guard) judge spacing, ink\n// balance and width in LAYOUT pixels — the numbers a stylesheet writes. `getBoundingClientRect`\n// returns SCREEN pixels, so inside a CSS-transformed (zoomed) container — every Board tile at\n// overview zoom — a correct 11px gap read 5.3px at 0.48 and warned falsely. The effective scale\n// is the ratio of an element's drawn width to its layout width (`offsetWidth`, which ignores\n// transforms), taken from the nearest ancestor-or-self that has a box. 1 when no engine reports\n// layout (jsdom) or the ratio is within 2% of 1, so a real violation at scale 1 reads unchanged.\n\nexport function layoutScale(el: Element | null): number {\n for (let n: Element | null = el; n; n = n.parentElement) {\n const w = (n as HTMLElement).offsetWidth;\n if (!w) continue;\n const drawn = n.getBoundingClientRect().width;\n if (!(drawn > 0)) continue;\n const s = drawn / w;\n if (!Number.isFinite(s) || s <= 0) return 1;\n return Math.abs(s - 1) < 0.02 ? 1 : s;\n }\n return 1;\n}\n","\"use client\";\n\nimport { createContext, useContext, type ReactNode } from \"react\";\n\n/** The surface a tap group sits on. \"glass\" floats over moving content; \"solid\" is a page, card,\n * toast or a header row that is itself a solid band. */\nexport type TapSurfaceKind = \"glass\" | \"solid\";\n\n// Shared through a Symbol.for slot on globalThis (like the default-variant context): the `.` and\n// `./buttons` dist bundles each inline this module, and a provider rendered by one must reach\n// buttons rendered by the other.\nconst SLOT = Symbol.for(\"@ai-matrx/tap-target:surface\");\ntype GlobalWithSlot = typeof globalThis & { [SLOT]?: ReturnType<typeof createContext<TapSurfaceKind>> };\nconst TapSurfaceContext = ((globalThis as GlobalWithSlot)[SLOT] ??= createContext<TapSurfaceKind>(\"glass\"));\n\n/**\n * GLASS ONLY FLOATS, declared once by the surface. A host whose header (or any region) is a solid\n * row wraps it in `<TapSurface surface=\"solid\">`; every `TapTargetButtonGroup` /\n * `TapTargetSearchGroup` inside then renders solid by itself — no per-page `surface=\"solid\"`.\n * A group's own `surface` prop still wins.\n */\nexport function TapSurface({ surface, children }: { surface: TapSurfaceKind; children: ReactNode }) {\n return <TapSurfaceContext.Provider value={surface}>{children}</TapSurfaceContext.Provider>;\n}\n\n/** The group's surface: its explicit prop, else the nearest `<TapSurface>`, else glass. */\nexport function useTapSurface(explicit: TapSurfaceKind | undefined): TapSurfaceKind {\n const inherited = useContext(TapSurfaceContext);\n return explicit ?? inherited;\n}\n","\"use client\";\n\n// THE BUILT-IN CAPABILITIES of every tap button — each one an enum or a flag,\n// never a class a caller writes. Rendering and geometry live in tap-target.css\n// (`.matrx-tap-badge`, `.matrx-tap-pressed`, `.matrx-tap-chevron`, …).\n\nimport { useEffect, type ReactNode } from \"react\";\n\nimport { MOTION_SPIN } from \"../motion\";\nimport { formatTapShortcut, parseShortcut, type TapShortcut } from \"../tap-shortcut\";\n\n/** Glyph color. Replaces the free-form `className`. */\nexport type TapTone = \"default\" | \"muted\" | \"primary\" | \"destructive\" | \"success\" | \"warning\" | \"info\";\n\n/** Fill of a solid button. Replaces `bgColor` / `iconColor` / hover / active. */\nexport type TapSolidTone = \"primary\" | \"destructive\" | \"success\" | \"warning\" | \"neutral\";\n\nexport const TAP_TONE_CLASS: Record<TapTone, string> = {\n default: \"text-foreground\",\n muted: \"text-muted-foreground group-hover/tap:text-foreground\",\n primary: \"text-primary-ink\",\n destructive: \"text-destructive-ink\",\n success: \"text-success-ink\",\n warning: \"text-warning-ink\",\n info: \"text-info-ink\",\n};\n\nexport const TAP_SOLID_TONE: Record<TapSolidTone, { fill: string; glyph: string }> = {\n primary: { fill: \"bg-primary group-hover/tap:bg-primary/85\", glyph: \"text-primary-foreground\" },\n destructive: { fill: \"bg-danger-fill group-hover/tap:bg-danger-fill/85\", glyph: \"text-danger-fill-foreground\" },\n success: { fill: \"bg-success-fill group-hover/tap:bg-success-fill/85\", glyph: \"text-success-fill-foreground\" },\n warning: { fill: \"bg-warning group-hover/tap:bg-warning/85\", glyph: \"text-warning-foreground\" },\n neutral: { fill: \"bg-foreground group-hover/tap:bg-foreground/85\", glyph: \"text-background\" },\n};\n\n/**\n * A keyboard shortcut: modifiers joined by \"+\", then one key —\n * \"mod+k\" (⌘ on Apple, Ctrl elsewhere), \"shift+mod+p\", \"alt+n\", \"/\", \"?\".\n */\nexport { formatTapShortcut, parseShortcut, type TapShortcut };\n\nexport interface TapFeatureProps {\n /** Glyph color, from the system's list. */\n tone?: TapTone | undefined;\n /** A count (99+ past 99) or a dot, drawn on the pill's corner by the system. */\n badge?: number | \"dot\" | undefined;\n /** A toggle that is on (sidebar open, filter on): tinted pill + aria-pressed. */\n pressed?: boolean | undefined;\n /** Work in flight: the glyph becomes a spinner and presses are ignored. */\n loading?: boolean | undefined;\n /** Why the button cannot be used — disables it and becomes its tooltip. */\n disabledReason?: string | undefined;\n /** Keyboard shortcut that presses the button; shown in its tooltip. */\n shortcut?: TapShortcut | undefined;\n /** A menu trigger: a small chevron after the label. */\n chevron?: boolean | undefined;\n}\n\nfunction isTyping(target: EventTarget | null): boolean {\n const el = target as HTMLElement | null;\n return !!el && (el.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(el.tagName));\n}\n\nexport function matchesTapShortcut(e: KeyboardEvent, shortcut: TapShortcut): boolean {\n const p = parseShortcut(shortcut);\n if ((e.metaKey || e.ctrlKey) !== p.mod || e.altKey !== p.alt) return false;\n // \"?\" and other shifted symbols arrive with shiftKey set — only compare\n // shift for letters and named keys.\n if (/^[a-z0-9]$|^[a-z]{2,}$/.test(p.key) && e.shiftKey !== p.shift) return false;\n if (!p.mod && isTyping(e.target)) return false;\n return e.key.toLowerCase() === p.key;\n}\n\n/** Presses `node` when its shortcut is typed anywhere on the page. */\nexport function useTapShortcut(shortcut: TapShortcut | undefined, getNode: () => HTMLElement | null, enabled: boolean) {\n useEffect(() => {\n if (!shortcut || !enabled) return;\n const onKey = (e: KeyboardEvent) => {\n if (!matchesTapShortcut(e, shortcut)) return;\n const node = getNode();\n if (!node || !node.isConnected) return;\n e.preventDefault();\n node.click();\n };\n window.addEventListener(\"keydown\", onKey);\n return () => window.removeEventListener(\"keydown\", onKey);\n }, [shortcut, enabled, getNode]);\n}\n\nexport function TapBadge({ badge }: { badge: number | \"dot\" }) {\n if (badge === \"dot\") return <span aria-hidden=\"true\" className=\"matrx-tap-badge\" data-dot=\"\" />;\n if (badge <= 0) return null;\n return (\n <span aria-hidden=\"true\" className=\"matrx-tap-badge\">\n {badge > 99 ? \"99+\" : badge}\n </span>\n );\n}\n\nexport function TapSpinner({ className }: { className: string }) {\n return (\n <svg className={className} fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2} aria-hidden=\"true\">\n <circle\n className={MOTION_SPIN}\n cx=\"12\"\n cy=\"12\"\n r=\"9\"\n strokeDasharray=\"28.27\"\n strokeDashoffset=\"9\"\n strokeLinecap=\"round\"\n style={{ transformOrigin: \"12px 12px\" }}\n />\n </svg>\n );\n}\n\nexport function TapChevron() {\n return (\n <svg\n className=\"matrx-tap-chevron\"\n aria-hidden=\"true\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n );\n}\n\n/** Tooltip body: the label, then the shortcut as a key cap. */\nexport function tooltipBody(label: string, shortcut: TapShortcut | undefined): ReactNode {\n if (!shortcut) return label;\n return (\n <span className=\"matrx-tap-tooltip\">\n {label}\n <kbd className=\"matrx-tap-kbd\">{formatTapShortcut(shortcut)}</kbd>\n </span>\n );\n}\n","// src/tap-shortcut.ts — @ai-matrx/design-system/tap-shortcut\n//\n// THE ONE SHORTCUT FORMATTER, light (FB5, 2026-10-23). `formatTapShortcut` (\"mod+k\" → \"⌘K\" on Apple, \"Ctrl+K\"\n// elsewhere) is pure; it lived in tap-target's \"use client\" feature module, so a plain helper that only needed the\n// words (records-ui's table action list) had to import the whole tap-target entry and was itself stamped\n// \"use client\". This entry carries the parse and the words only — no React. `./tap-target` re-exports both.\n\n/** A keyboard shortcut, written \"mod+k\", \"shift+?\", \"alt+enter\". */\nexport type TapShortcut = string;\n\nexport interface ParsedShortcut {\n mod: boolean;\n shift: boolean;\n alt: boolean;\n key: string;\n}\n\nconst IS_APPLE =\n typeof navigator !== \"undefined\" && /Mac|iPhone|iPad|iPod/.test(navigator.platform || navigator.userAgent);\n\nexport function parseShortcut(shortcut: TapShortcut): ParsedShortcut {\n const parts = shortcut.toLowerCase().split(\"+\");\n const key = parts.pop() ?? \"\";\n return { mod: parts.includes(\"mod\"), shift: parts.includes(\"shift\"), alt: parts.includes(\"alt\"), key };\n}\n\n/** \"mod+k\" → \"⌘K\" on Apple, \"Ctrl+K\" elsewhere. */\nexport function formatTapShortcut(shortcut: TapShortcut): string {\n const p = parseShortcut(shortcut);\n const key = p.key.length === 1 ? p.key.toUpperCase() : p.key[0]!.toUpperCase() + p.key.slice(1);\n if (IS_APPLE) return `${p.alt ? \"⌥\" : \"\"}${p.shift ? \"⇧\" : \"\"}${p.mod ? \"⌘\" : \"\"}${key}`;\n return [p.mod && \"Ctrl\", p.alt && \"Alt\", p.shift && \"Shift\", key].filter(Boolean).join(\"+\");\n}\n","\"use client\";\n\nimport { createContext, useContext, type ReactNode } from \"react\";\n\nimport { useTapSurface } from \"./tap-surface\";\n\n// THE PLACEMENT DEFAULT — which variant a tap button takes when its caller\n// names none. Outside a provider that is \"glass\" (the floating-bar look). A\n// host region that holds tap buttons BESIDE text (a route header's back +\n// title cell) wraps itself in <TapDefaultVariant value=\"transparent\"> so every\n// button in it matches its neighbours (rule 2, \"all glass or none\") without\n// each call site repeating variant=\"transparent\". An explicit `variant` prop\n// always wins, so a bar whose pieces are ALL glass stays glass.\n//\n// The context object lives in a `Symbol.for` slot on globalThis, like the link\n// seam: the `.` and `./buttons` dist bundles each inline this module, and a\n// provider rendered by one must reach buttons rendered by the other.\n\nexport type TapDefaultVariantValue = \"glass\" | \"transparent\";\n\nconst SLOT = Symbol.for(\"@ai-matrx/tap-target:default-variant\");\ntype GlobalWithSlot = typeof globalThis & {\n [SLOT]?: ReturnType<typeof createContext<TapDefaultVariantValue>>;\n};\n\nfunction ctx() {\n const g = globalThis as GlobalWithSlot;\n return (g[SLOT] ??= createContext<TapDefaultVariantValue>(\"glass\"));\n}\n\n/** The variant tap buttons below take when they name none. */\nexport function useTapDefaultVariant(): TapDefaultVariantValue {\n return useContext(ctx());\n}\n\n/** Set the default variant for every tap button below that names none. */\nexport function TapDefaultVariant({ value, children }: { value: TapDefaultVariantValue; children: ReactNode }) {\n const Context = ctx();\n return <Context.Provider value={value}>{children}</Context.Provider>;\n}\n\n/**\n * The variant a lone tap button draws: its explicit `variant`, else a region's\n * <TapDefaultVariant>, else — on a <TapSurface surface=\"solid\"> — \"transparent\"\n * (glass only floats), else glass. An explicit variant always wins.\n */\nexport function useTapButtonVariant<V extends string>(explicit: V | undefined): V | TapDefaultVariantValue {\n const placed = useTapDefaultVariant();\n const surface = useTapSurface(undefined);\n if (explicit !== undefined) return explicit;\n if (placed !== \"glass\") return placed;\n return surface === \"solid\" ? \"transparent\" : \"glass\";\n}\n","\"use client\";\n\nimport { InfoIcon as Info, AlertTriangleIcon as AlertTriangle, CircleAlertIcon as AlertCircle, CircleCheckIcon as CheckCircle } from \"../../icons\";\nimport { cn } from \"../../cn\";\n\ntype Tone = \"info\" | \"warning\" | \"error\" | \"success\";\n\nconst toneStyles: Record<\n Tone,\n { container: string; icon: string; Icon: React.ComponentType<{ className?: string }> }\n> = {\n info: {\n container:\n \"border-blue-500/30 bg-blue-500/5 text-blue-900 dark:text-blue-100\",\n icon: \"text-blue-600 dark:text-blue-400\",\n Icon: Info,\n },\n warning: {\n container:\n \"border-amber-500/30 bg-amber-500/5 text-amber-900 dark:text-amber-100\",\n icon: \"text-amber-600 dark:text-amber-400\",\n Icon: AlertTriangle,\n },\n error: {\n container:\n \"border-red-500/30 bg-red-500/5 text-red-900 dark:text-red-100\",\n icon: \"text-red-600 dark:text-red-400\",\n Icon: AlertCircle,\n },\n success: {\n container:\n \"border-emerald-500/30 bg-emerald-500/5 text-emerald-900 dark:text-emerald-100\",\n icon: \"text-emerald-600 dark:text-emerald-400\",\n Icon: CheckCircle,\n },\n};\n\nexport type SettingsCalloutProps = {\n tone: Tone;\n title?: string;\n children: React.ReactNode;\n /** Optional action node rendered in the footer row of the callout. */\n action?: React.ReactNode;\n};\n\nexport function SettingsCallout({\n tone,\n title,\n children,\n action,\n}: SettingsCalloutProps) {\n const { container, icon, Icon } = toneStyles[tone];\n return (\n <div\n className={cn(\n \"mx-4 mb-4 flex items-start gap-2.5 rounded-md border px-3 py-2.5\",\n container,\n )}\n >\n <Icon className={cn(\"h-4 w-4 shrink-0 mt-0.5\", icon)} />\n <div className=\"flex-1 min-w-0 type-secondary leading-relaxed\">\n {title && <div className=\"font-semibold mb-0.5\">{title}</div>}\n <div>{children}</div>\n {action && <div className=\"mt-2\">{action}</div>}\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport { cn } from \"../../cn\";\n\nexport type SettingsGridProps = {\n /** Desktop column count. Defaults to 2. */\n columns?: 2 | 3;\n /** Gap size between cells. */\n gap?: \"sm\" | \"md\" | \"lg\";\n children: React.ReactNode;\n};\n\nconst gapClass = {\n sm: \"gap-2\",\n md: \"gap-3\",\n lg: \"gap-4\",\n};\n\nconst columnsClass = {\n 2: \"@[40rem]/settings-grid:grid-cols-2\",\n 3: \"@[40rem]/settings-grid:grid-cols-2 @[56rem]/settings-grid:grid-cols-3\",\n};\n\n/**\n * Grid container for dense dashboards — e.g. 2-up stat cards, side-by-side pickers.\n * On mobile always stacks to a single column to keep controls readable.\n */\nexport function SettingsGrid({\n columns = 2,\n gap = \"md\",\n children,\n}: SettingsGridProps) {\n return (\n <div\n className={cn(\n \"@container/settings-grid grid grid-cols-1 px-4 mb-4 [&>*]:min-w-0\",\n columnsClass[columns],\n gapClass[gap],\n )}\n >\n {children}\n </div>\n );\n}\n","\"use client\";\n\nimport { useClipboard } from \"@ai-matrx/kit/clipboard\";\nimport { settingsCopyNotify } from \"../host\";\nimport { CheckIcon as Check, CopyIcon as Copy } from \"../../icons\";\nimport { useId, useState } from \"react\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport { cn } from \"../../cn\";\nimport { Button } from \"../../controls/controls\";\nimport type { SettingsCommonProps } from \"../types\";\n\nexport type SettingsReadOnlyValueProps = Omit<\n SettingsCommonProps,\n \"disabled\" | \"modified\"\n> & {\n value: string;\n /** When true, shows a copy-to-clipboard button. */\n copyable?: boolean;\n /** Renders the value in a monospace font (for IDs, hashes, URLs). */\n mono?: boolean;\n last?: boolean;\n};\n\n/**\n * Informational row — no user control, just a key/value display.\n * Examples: \"App version: 0.3.217\", \"Build: abc123\", \"User ID: uuid-...\".\n */\nexport function SettingsReadOnlyValue({\n value,\n copyable,\n mono,\n last,\n ...rowProps\n}: SettingsReadOnlyValueProps) {\n const notify = settingsCopyNotify();\n const { copyText } = useClipboard(notify ? { notify } : {});\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n\n const [copied, setCopied] = useState(false);\n\n const handleCopy = async () => {\n if (!(await copyText(value))) return;\n setCopied(true);\n setTimeout(() => setCopied(false), 1200);\n };\n\n return (\n <SettingsRow\n {...rowProps}\n id={id}\n variant=\"inline\"\n controlLayout=\"wide\"\n last={last}\n >\n <div className=\"flex min-w-0 items-center gap-1.5\">\n <span\n className={cn(\n \"min-w-0 max-w-full type-secondary text-muted-foreground truncate @[40rem]/settings:max-w-64\",\n mono && \"font-mono tabular-nums\",\n )}\n title={value}\n >\n {value}\n </span>\n {copyable && (\n <Button\n type=\"button\"\n variant=\"quiet\"\n aria-label={copied ? \"Copied\" : \"Copy to clipboard\"}\n icon={copied ? <Check className=\"h-3 w-3 text-emerald-500\" /> : <Copy className=\"h-3 w-3\" />}\n onClick={handleCopy}\n className=\"shrink-0\"\n />\n )}\n </div>\n </SettingsRow>\n );\n}\n","\"use client\";\n\nimport { useId, useState } from \"react\";\nimport { ChevronDownIcon as ChevronDown } from \"../../icons\";\nimport type { SettingsIconType as LucideIcon } from \"../icon-type\";\nimport { cn } from \"../../cn\";\nimport { Tile } from \"../../controls/surfaces\";\nimport { useSettingsDesign } from \"../SettingsDesignProvider\";\nimport { SettingsSectionProvider } from \"../SettingsSectionContext\";\n\nexport type SettingsSectionProps = {\n title: string;\n description?: string;\n icon?: LucideIcon;\n /** Makes the section expand/collapse with a chevron header. */\n collapsible?: boolean;\n /** When collapsible, controls initial state. Defaults to expanded. */\n defaultOpen?: boolean;\n /** Section header emphasis. Defaults to \"default\". */\n emphasis?: \"subtle\" | \"default\" | \"strong\";\n /** Optional action node rendered to the right of the title (e.g. reset button). */\n action?: React.ReactNode;\n children: React.ReactNode;\n};\n\nexport type SettingsGroupProps = SettingsSectionProps;\n\nconst emphasisTitleClass = {\n subtle: \"text-xs font-semibold uppercase tracking-wide text-muted-foreground\",\n default: \"text-sm font-semibold text-foreground\",\n strong: \"text-base font-semibold text-foreground\",\n};\n\n/**\n * SettingsSection groups related rows under a common header.\n * Sections are the primary organizing unit inside a settings tab.\n */\nexport function SettingsSection({\n title,\n description,\n icon: Icon,\n collapsible,\n defaultOpen = true,\n emphasis = \"default\",\n action,\n children,\n}: SettingsSectionProps) {\n const { variant } = useSettingsDesign();\n const [open, setOpen] = useState(defaultOpen);\n const contentId = useId().replace(/:/g, \"\");\n const isOpen = collapsible ? open : true;\n\n return (\n <section className={cn(variant === \"compact\" ? \"mb-4\" : \"mb-6\")}>\n <header className=\"flex flex-wrap items-center gap-2 px-4 mb-2\">\n {collapsible ? (\n <Tile\n type=\"button\"\n dense\n variant=\"quiet\"\n title={\n <span className=\"flex min-w-0 items-center gap-2\">\n <ChevronDown\n className={cn(\"h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform\", !isOpen && \"-rotate-90\")}\n aria-hidden=\"true\"\n />\n {Icon ? <Icon className=\"h-4 w-4 shrink-0 text-muted-foreground\" aria-hidden=\"true\" /> : null}\n <span className={cn(emphasisTitleClass[emphasis], \"min-w-0 break-words\")}>{title}</span>\n </span>\n }\n className=\"-mx-2 flex min-w-0 flex-1 items-center gap-2 rounded px-2 py-1 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n aria-expanded={isOpen}\n aria-controls={contentId}\n onClick={() => setOpen((value) => !value)}\n />\n ) : (\n <>\n {Icon && (\n <Icon\n className=\"h-4 w-4 text-muted-foreground\"\n aria-hidden=\"true\"\n />\n )}\n <h3\n className={cn(\n emphasisTitleClass[emphasis],\n \"min-w-0 flex-1 break-words\",\n )}\n >\n {title}\n </h3>\n </>\n )}\n {action && <div className=\"ml-auto max-w-full shrink-0\">{action}</div>}\n </header>\n {description && isOpen && (\n <p className=\"px-4 type-secondary text-muted-foreground mb-2 leading-snug\">\n {description}\n </p>\n )}\n {isOpen && (\n <div\n id={contentId}\n className={cn(\n \"border border-border/40 bg-card/30\",\n variant === \"compact\" ? \"rounded-md\" : \"rounded-lg\",\n )}\n >\n <SettingsSectionProvider title={title}>\n {children}\n </SettingsSectionProvider>\n </div>\n )}\n </section>\n );\n}\n\n/** A named reusable settings group with the exact SettingsSection contract. */\nexport function SettingsGroup(props: SettingsGroupProps) {\n return <SettingsSection {...props} />;\n}\n","\"use client\";\n\nimport type { SettingsIconType as LucideIcon } from \"../icon-type\";\nimport { cn } from \"../../cn\";\nimport { useSettingsDesign } from \"../SettingsDesignProvider\";\nimport { CompactHelpPopover } from \"../SettingsRow\";\n\nexport type SettingsSubHeaderProps = {\n title: string;\n description?: string;\n icon?: LucideIcon;\n /** Renders a bottom border as a divider. Defaults to true. */\n divider?: boolean;\n};\n\n/**\n * Page-level header for a settings tab. The `description` opens from a help\n * icon beside the title rather than sitting under it.\n * Render once at the top of each tab component — above any SettingsSection.\n */\nexport function SettingsSubHeader({\n title,\n description,\n icon: Icon,\n divider = true,\n}: SettingsSubHeaderProps) {\n const { variant } = useSettingsDesign();\n return (\n <div\n data-settings-subheader=\"\"\n className={cn(\n \"px-4\",\n variant === \"compact\" ? \"pb-3 mb-3\" : \"pb-4 mb-4\",\n divider && \"border-b border-border/40\",\n )}\n >\n <div className=\"flex items-center gap-2\">\n {Icon && <Icon className=\"h-5 w-5 text-foreground\" />}\n <h2 className={cn(\"font-semibold text-foreground leading-tight\", variant === \"compact\" ? \"text-base\" : \"text-lg\")}>\n {title}\n </h2>\n {/* The title stands alone (page-pass core 3): what the tab is for is\n one tap away, never a sentence parked under every heading. */}\n {description && <CompactHelpPopover label={title} description={description} />}\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport type { ReactNode, Ref } from \"react\";\nimport { XIcon as X } from \"../../icons\";\nimport type { SettingsTreeNode } from \"../tree/types\";\nimport { cn } from \"../../cn\";\nimport { Button, SearchField } from \"../../controls/controls\";\n\nexport function SettingsNavigationSearch({\n value,\n onValueChange,\n label = \"Search settings\",\n inputRef,\n}: {\n value: string;\n onValueChange: (value: string) => void;\n label?: string;\n inputRef?: Ref<HTMLInputElement>;\n}) {\n return (\n // A solid band with a rule under it: the sidebar itself is transparent\n // over the textured shell, so a bare input let scrolled items show\n // through around it (page-pass 2026-09-27).\n <div className=\"sticky top-0 z-10 mb-1 border-b border-border/60 bg-textured pb-1.5 pt-1\" role=\"search\">\n <div className=\"relative\">\n <SearchField\n ref={inputRef}\n type=\"search\"\n value={value}\n onChange={(event) => onValueChange(event.target.value)}\n placeholder={label}\n aria-label={label}\n end={value ? <span aria-hidden=\"true\" className=\"w-7 shrink-0\" /> : undefined}\n className=\"w-full\"\n />\n {value ? <Button type=\"button\" variant=\"quiet\" className=\"absolute right-1.5 top-1/2 -translate-y-1/2\" onClick={() => onValueChange(\"\")} aria-label=\"Clear search\" icon={<X aria-hidden />} /> : null}\n </div>\n </div>\n );\n}\n\nexport type SettingsNavigationItem = {\n id: string;\n label: string;\n location: string;\n node: SettingsTreeNode;\n};\n\nexport type SettingsNavigationSection = {\n id: string;\n /** Omit when adjacent root links do not have a meaningful shared heading. */\n label?: string;\n items: SettingsNavigationItem[];\n};\n\n/**\n * Converts a settings tree into Notion-style, non-recursive sections. Desktop\n * navigation intentionally has no expandable state: headings orient people and\n * every destination stays visible as a flat link.\n */\nexport function settingsNavigationSections(\n nodes: SettingsTreeNode[],\n): SettingsNavigationSection[] {\n const sections: SettingsNavigationSection[] = [];\n for (const root of nodes) {\n if (!root.children?.length) {\n const last = sections.at(-1);\n if (last && !last.label) {\n last.items.push(asItem(root, \"Settings\"));\n } else {\n sections.push({ id: `unsectioned:${root.id}`, items: [asItem(root, \"Settings\")] });\n }\n continue;\n }\n\n // Registry folders are headings. Configuration domains use their routable\n // Overview child while keeping the domain's human name in the flat list.\n const items: SettingsNavigationItem[] = [];\n if (root.navigable) {\n items.push(asItem({ ...root, label: root.navigationLabel ?? root.label }, \"Settings\"));\n }\n const collect = (node: SettingsTreeNode, path: string[]): void => {\n if (!node.children?.length) {\n items.push(asItem(node, path.join(\" / \")));\n return;\n }\n\n const overview = node.children.find((child) => child.label === \"Overview\");\n if (overview) {\n // The domain's own icon travels with its name; the Overview leaf has\n // none, which drew the same fallback gear on every domain row.\n items.push(\n asItem(\n { ...overview, label: node.label, icon: overview.icon ?? node.icon },\n [...path, node.label].join(\" / \"),\n ),\n );\n return;\n }\n for (const child of node.children) collect(child, [...path, node.label]);\n };\n for (const child of root.children) collect(child, [root.label]);\n if (items.length) sections.push({ id: root.id, label: root.label, items });\n }\n return sections;\n}\n\nfunction asItem(node: SettingsTreeNode, location: string): SettingsNavigationItem {\n return { id: node.id, label: node.label, location, node };\n}\n\nexport function filterSettingsNavigationSections(\n sections: SettingsNavigationSection[],\n query: string,\n): SettingsNavigationSection[] {\n const needle = query.trim().toLocaleLowerCase();\n if (!needle) return sections;\n return sections.flatMap((section) => {\n const items = section.items.filter((item) =>\n [item.label, item.location, item.node.description, ...(item.node.searchKeywords ?? [])]\n .filter((value): value is string => Boolean(value))\n .join(\" \")\n .toLocaleLowerCase()\n .includes(needle),\n );\n return items.length ? [{ ...section, items }] : [];\n });\n}\n\nexport function SettingsFlatNavigation({\n sections,\n activeId,\n renderItem,\n empty,\n}: {\n sections: SettingsNavigationSection[];\n activeId: string | null;\n /** Return one native interactive root (`a` or `button`); this primitive owns its row styling. */\n renderItem: (item: SettingsNavigationItem, active: boolean) => ReactNode;\n empty?: ReactNode;\n}) {\n if (sections.length === 0) {\n return <div className=\"px-3 py-6 type-body text-muted-foreground\">{empty ?? \"No settings match.\"}</div>;\n }\n return (\n <div className=\"flex flex-col gap-3 py-1\">\n {sections.map((section) => (\n <section key={section.id} className=\"flex flex-col gap-0.5\" aria-label={section.label ?? \"Settings\"}>\n {section.label ? <h2 className={cn(\"m-0 px-2 py-1 type-secondary font-medium leading-5 text-muted-foreground\", section.id === activeId && \"rounded bg-muted text-foreground\")}>{section.label}</h2> : null}\n <div className=\"flex flex-col gap-px\">\n {section.items.map((item) => (\n <div\n key={item.id}\n className={cn(\n \"[&>a]:flex [&>a]:min-h-[1.875rem] [&>a]:w-full [&>a]:items-center [&>a]:rounded-sm [&>a]:pl-2 [&>a]:text-[0.8125rem] [&>button]:flex [&>button]:min-h-[1.875rem] [&>button]:w-full [&>button]:items-center [&>button]:rounded-sm [&>button]:pl-2 [&>button]:text-[0.8125rem]\",\n item.id === activeId && \"[&>a]:bg-muted [&>a]:text-foreground [&>button]:bg-muted [&>button]:text-foreground\",\n )}\n >\n {renderItem(item, item.id === activeId)}\n </div>\n ))}\n </div>\n </section>\n ))}\n </div>\n );\n}\n","\"use client\";\n\nimport { useId } from \"react\";\nimport type { SettingsIconType as LucideIcon } from \"../icon-type\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport { cn } from \"../../cn\";\nimport type { SettingsCommonProps, SettingsControlSize } from \"../types\";\nimport { Button } from \"../../controls/controls\";\n\ntype ButtonKind = \"default\" | \"outline\" | \"ghost\" | \"destructive\";\n\nexport type SettingsButtonProps = SettingsCommonProps & {\n /** Action label shown on the button itself. */\n actionLabel: string;\n onClick: () => void;\n kind?: ButtonKind;\n size?: SettingsControlSize;\n actionIcon?: LucideIcon;\n /** Stacks the button below the label. Use when the action label is long. */\n stacked?: boolean;\n last?: boolean;\n /** Shows a confirmation spinner / loading state. */\n loading?: boolean;\n};\n\n/**\n * Renders a settings row whose control is an action button.\n * Good for: \"Reset to defaults\", \"Clear cache\", \"Sign out\", \"Open in browser\".\n */\nexport function SettingsButton({\n actionLabel,\n onClick,\n kind = \"outline\",\n size = \"md\",\n actionIcon: ActionIcon,\n stacked,\n loading,\n last,\n ...rowProps\n}: SettingsButtonProps) {\n // Retain the API field for callers; canonical Button owns its geometry.\n void size;\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n\n return (\n <SettingsRow\n {...rowProps}\n id={id}\n variant={stacked ? \"stacked\" : \"inline\"}\n last={last}\n >\n <Button\n id={id}\n type=\"button\"\n variant={kind === \"default\" ? \"primary\" : kind === \"ghost\" ? \"quiet\" : kind === \"destructive\" ? \"danger\" : \"outline\"}\n icon={ActionIcon ? <ActionIcon className=\"h-3.5 w-3.5 shrink-0\" /> : undefined}\n onClick={onClick}\n disabled={rowProps.disabled || loading}\n className={cn(stacked && \"w-full\", loading && \"animate-pulse\")}\n >\n <span>{loading ? \"Working…\" : actionLabel}</span>\n </Button>\n </SettingsRow>\n );\n}\n","\"use client\";\n\nimport { useId } from \"react\";\nimport { Checkbox } from \"../../checkbox\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport type { SettingsCommonProps } from \"../types\";\n\nexport type SettingsCheckboxProps = SettingsCommonProps & {\n checked: boolean;\n onCheckedChange: (checked: boolean) => void;\n last?: boolean;\n};\n\n/**\n * Use for opt-in / consent / \"tick to enable\" flows.\n * For app-level feature toggles, prefer SettingsSwitch.\n */\nexport function SettingsCheckbox({\n checked,\n onCheckedChange,\n last,\n ...rowProps\n}: SettingsCheckboxProps) {\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n return (\n <SettingsRow {...rowProps} id={id} variant=\"inline\" last={last}>\n <Checkbox\n id={id}\n checked={checked}\n onCheckedChange={(v) => onCheckedChange(Boolean(v))}\n disabled={rowProps.disabled}\n />\n </SettingsRow>\n );\n}\n","\"use client\";\n\n/**\n * Checkbox — Radix checkbox, and the indeterminate ruling that came with it.\n *\n * RADIX RENDERS THE INDICATOR FOR BOTH `checked` AND `\"indeterminate\"`. The\n * stock shadcn body puts a full check inside it either way, so a half-selected\n * \"select all\" tells the user every row is selected — a screen stating\n * something false. The two states get different glyphs here, always.\n *\n * `size` carries the two boxes the hosts had forked into: matrx-frontend's\n * dense 14px control and the stock 16px one.\n */\n\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { RadixCheckIcon, DividerHorizontalIcon } from \"./icons\";\n\nexport type CheckboxSize = \"sm\" | \"md\";\n\nconst CHECKBOX_SIZES: Record<CheckboxSize, { root: string; glyph: string }> = {\n sm: { root: \"h-3.5 w-3.5 rounded-xs\", glyph: \"h-3 w-3\" },\n md: { root: \"h-4 w-4 rounded-sm\", glyph: \"h-3.5 w-3.5\" },\n};\n\nexport interface CheckboxProps\n extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> {\n /** Box size. Default `md` (the stock 16px control); `sm` is the dense 14px one. */\n size?: CheckboxSize;\n}\n\nconst Checkbox = React.forwardRef<\n React.ComponentRef<typeof CheckboxPrimitive.Root>,\n CheckboxProps\n>(({ className, size = \"md\", ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n data-slot=\"checkbox\"\n className={cn(\n \"peer shrink-0 border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground\",\n CHECKBOX_SIZES[size].root,\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"flex items-center justify-center text-current\"\n >\n {props.checked === \"indeterminate\" ? (\n <DividerHorizontalIcon className={CHECKBOX_SIZES[size].glyph} />\n ) : (\n <RadixCheckIcon className={CHECKBOX_SIZES[size].glyph} />\n )}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n));\nCheckbox.displayName = CheckboxPrimitive.Root.displayName;\n\nexport { Checkbox };\n","\"use client\";\n\nimport { useState, useEffect, useId } from \"react\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport { Field } from \"../../controls/controls\";\nimport { Button } from \"../../controls/controls\";\nimport type { SettingsCommonProps } from \"../types\";\n\nexport type SettingsColorPickerProps = SettingsCommonProps & {\n value: string;\n onValueChange: (value: string) => void;\n /** Small palette of preset swatches shown alongside the picker. */\n presets?: string[];\n last?: boolean;\n};\n\nfunction isValidHex(value: string): boolean {\n return /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(value);\n}\n\nexport function SettingsColorPicker({\n value,\n onValueChange,\n presets,\n last,\n ...rowProps\n}: SettingsColorPickerProps) {\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n\n const [draft, setDraft] = useState(value);\n\n useEffect(() => {\n setDraft(value);\n }, [value]);\n\n const commit = (raw: string) => {\n const candidate = raw.startsWith(\"#\") ? raw : `#${raw}`;\n if (isValidHex(candidate)) {\n onValueChange(candidate.toLowerCase());\n setDraft(candidate.toLowerCase());\n } else {\n setDraft(value);\n }\n };\n\n return (\n <SettingsRow {...rowProps} id={id} variant=\"inline\" controlLayout=\"wide\" last={last}>\n <div className=\"flex max-w-full flex-wrap items-center gap-1.5\">\n {presets && presets.length > 0 && (\n <div className=\"flex flex-wrap items-center gap-1 mr-1.5\">\n {presets.map((p) => (\n <Button\n key={p}\n type=\"button\"\n variant=\"quiet\"\n aria-label={`Set to ${p}`}\n icon={<span className=\"size-3.5 rounded-sm\" style={{ backgroundColor: p }} aria-hidden />}\n onClick={() => onValueChange(p)}\n disabled={rowProps.disabled}\n />\n ))}\n </div>\n )}\n <Field\n id={id}\n type=\"color\"\n value={isValidHex(value) ? value : \"#000000\"}\n disabled={rowProps.disabled}\n onChange={(e) => onValueChange(e.target.value)}\n aria-label={`${rowProps.label} color`}\n className=\"w-16 shrink-0\"\n />\n <Field\n type=\"text\"\n value={draft}\n placeholder=\"#000000\"\n maxLength={7}\n disabled={rowProps.disabled}\n onChange={(e) => setDraft(e.target.value)}\n onBlur={(e) => commit(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") (e.currentTarget as HTMLInputElement).blur();\n }}\n aria-label={`${rowProps.label} hex color`}\n width=\"xs\"\n />\n </div>\n </SettingsRow>\n );\n}\n","\"use client\";\n\nimport { useId } from \"react\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"../../select\";\nimport { SettingsRow } from \"../SettingsRow\";\n/** A device as the host lists it (structurally the media-devices manager descriptor). */\nexport interface MediaDeviceDescriptor {\n deviceId: string;\n label: string;\n groupId: string;\n}\nimport type { SettingsCommonProps, SettingsControlSize } from \"../types\";\n\ntype Width = \"auto\" | \"sm\" | \"md\" | \"lg\" | \"full\";\n\nconst widthClass: Record<Width, string> = {\n auto: \"w-full max-w-full @[40rem]/settings:w-auto @[40rem]/settings:min-w-32\",\n sm: \"w-32 max-w-full min-w-0\",\n md: \"w-44 max-w-full min-w-0\",\n lg: \"w-64 max-w-full min-w-0\",\n full: \"w-full\",\n};\n\n/** Sentinel for the \"no explicit choice\" option — never a real deviceId. */\nconst DEFAULT_SENTINEL = \"__system_default__\";\n\nexport type SettingsDeviceSelectProps = SettingsCommonProps & {\n /** Live device list from the media-device manager snapshot. */\n devices: MediaDeviceDescriptor[];\n /** Resolved live deviceId of the current choice (\"\" = default/auto). */\n selectedId: string;\n /** Fired with BOTH the deviceId and its label (\"\" + \"\" = default/auto) —\n * labels are persisted alongside ids because iOS Safari regenerates\n * deviceIds per page load (resolve is id → label → default). */\n onSelect: (deviceId: string, label: string) => void;\n /** Label for the \"no explicit choice\" option (default \"System default\"). */\n defaultOptionLabel?: string;\n /** Fallback label prefix for devices whose label is blank (pre-grant),\n * e.g. \"Microphone\" → \"Microphone (a1b2c3)\". */\n deviceKindLabel: string;\n size?: SettingsControlSize;\n width?: Width;\n /** Renders as a stacked layout. Use when the select should span full width. */\n stacked?: boolean;\n last?: boolean;\n};\n\n/**\n * A settings row whose control is a LIVE media-device picker (microphone,\n * speaker, or camera). Unlike `SettingsSelect`, its options come from a live\n * `enumerateDevices` snapshot and its change event carries the (id, label)\n * PAIR the device-preference model persists. Blank labels (permission not yet\n * granted) fall back to `deviceKindLabel (idPrefix)`.\n */\nexport function SettingsDeviceSelect({\n devices,\n selectedId,\n onSelect,\n defaultOptionLabel = \"System default\",\n deviceKindLabel,\n size = \"md\",\n width = \"md\",\n stacked,\n last,\n ...rowProps\n}: SettingsDeviceSelectProps) {\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n const variant = stacked ? \"stacked\" : \"inline\";\n const effectiveWidth: Width = stacked ? \"full\" : width;\n\n const optionLabel = (d: MediaDeviceDescriptor): string => {\n if (d.label) return d.label;\n const short = d.deviceId ? d.deviceId.slice(0, 6) : \"unknown\";\n return `${deviceKindLabel} (${short})`;\n };\n\n return (\n <SettingsRow\n {...rowProps}\n id={id}\n variant={variant}\n controlLayout=\"wide\"\n last={last}\n >\n <Select\n value={selectedId || DEFAULT_SENTINEL}\n onValueChange={(v) => {\n if (v === DEFAULT_SENTINEL) {\n onSelect(\"\", \"\");\n return;\n }\n const dev = devices.find((d) => d.deviceId === v);\n onSelect(v, dev?.label ?? \"\");\n }}\n disabled={rowProps.disabled ?? false}\n >\n <SelectTrigger\n id={id}\n className={widthClass[effectiveWidth]}\n >\n <SelectValue placeholder={defaultOptionLabel} />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value={DEFAULT_SENTINEL}>{defaultOptionLabel}</SelectItem>\n {devices.map((d) => (\n <SelectItem key={d.deviceId || \"default-device\"} value={d.deviceId}>\n {optionLabel(d)}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </SettingsRow>\n );\n}\n","\"use client\";\n\nimport { useId, useState } from \"react\";\nimport { XIcon as X } from \"../../icons\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport { cn } from \"../../cn\";\nimport { Button } from \"../../controls/controls\";\nimport type { SettingsCommonProps } from \"../types\";\n\nexport type KeybindingValue = {\n /** Key code from KeyboardEvent.code (e.g., \"KeyK\", \"Digit1\"). */\n key: string;\n /** Display string ready to render (e.g., \"⌘K\", \"Ctrl+Shift+P\"). */\n display: string;\n ctrl?: boolean;\n alt?: boolean;\n shift?: boolean;\n meta?: boolean;\n};\n\nexport type SettingsKeybindingProps = SettingsCommonProps & {\n value: KeybindingValue | null;\n onValueChange: (value: KeybindingValue | null) => void;\n /** Allow clearing the binding. */\n clearable?: boolean;\n last?: boolean;\n};\n\nconst NON_BINDING_KEYS = new Set([\n \"Escape\",\n \"Tab\",\n \"Meta\",\n \"Control\",\n \"Shift\",\n \"Alt\",\n \"ContextMenu\",\n \"CapsLock\",\n]);\n\nfunction formatEventAsBinding(\n e: React.KeyboardEvent<HTMLButtonElement>,\n): KeybindingValue | null {\n if (NON_BINDING_KEYS.has(e.key)) return null;\n const isMac =\n typeof navigator !== \"undefined\" &&\n /Mac|iPhone|iPad/.test(navigator.platform);\n const parts: string[] = [];\n if (e.ctrlKey) parts.push(isMac ? \"⌃\" : \"Ctrl\");\n if (e.altKey) parts.push(isMac ? \"⌥\" : \"Alt\");\n if (e.shiftKey) parts.push(isMac ? \"⇧\" : \"Shift\");\n if (e.metaKey) parts.push(isMac ? \"⌘\" : \"Meta\");\n const keyDisplay =\n e.key.length === 1\n ? e.key.toUpperCase()\n : e.key.replace(/^(Arrow|Digit)/, \"\");\n parts.push(keyDisplay);\n return {\n key: e.code,\n display: parts.join(isMac ? \"\" : \"+\"),\n ctrl: e.ctrlKey,\n alt: e.altKey,\n shift: e.shiftKey,\n meta: e.metaKey,\n };\n}\n\nexport function SettingsKeybinding({\n value,\n onValueChange,\n clearable = true,\n last,\n ...rowProps\n}: SettingsKeybindingProps) {\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n\n const [recording, setRecording] = useState(false);\n\n return (\n <SettingsRow\n {...rowProps}\n id={id}\n variant=\"inline\"\n controlLayout=\"wide\"\n last={last}\n >\n <div className=\"flex max-w-full flex-wrap items-center gap-1.5\">\n <Button\n id={id}\n type=\"button\"\n variant={recording ? \"primary\" : \"outline\"}\n onClick={() => setRecording(true)}\n onBlur={() => setRecording(false)}\n onKeyDown={(e) => {\n if (!recording) return;\n if (e.key === \"Escape\") {\n setRecording(false);\n return;\n }\n e.preventDefault();\n const next = formatEventAsBinding(e);\n if (next) {\n onValueChange(next);\n setRecording(false);\n }\n }}\n disabled={rowProps.disabled}\n className={cn(\"min-w-0 flex-1 font-mono tabular-nums @[40rem]/settings:min-w-32\", recording && \"animate-pulse\")}\n >\n {recording\n ? \"Press keys…\"\n : value\n ? value.display\n : \"Click to record\"}\n </Button>\n {clearable && value && !rowProps.disabled && (\n <Button\n type=\"button\"\n variant=\"quiet\"\n aria-label=\"Clear keybinding\"\n icon={<X className=\"h-3.5 w-3.5\" />}\n onClick={() => onValueChange(null)}\n />\n )}\n </div>\n </SettingsRow>\n );\n}\n","\"use client\";\n\nimport { useId } from \"react\";\nimport { SettingsHostLink as AppLink } from \"../host\";\nimport { ArrowRightIcon as ArrowRight, ExternalLinkIcon as ExternalLink } from \"../../icons\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport { cn } from \"../../cn\";\nimport { useSettingsHostNavigate as useSettingsNavigate } from \"../host\";\nimport type { SettingsCommonProps } from \"../types\";\nimport { OutboundLink } from \"@ai-matrx/kit/outbound-react\";\n\nexport type SettingsLinkProps = SettingsCommonProps & {\n /** Internal route (href starting with \"/\") or external URL. */\n href: string;\n /** Action label shown on the link button. */\n actionLabel?: string;\n /** Forces external-link behavior even for relative hrefs. */\n external?: boolean;\n last?: boolean;\n};\n\nexport function SettingsLink({\n href,\n actionLabel,\n external,\n last,\n ...rowProps\n}: SettingsLinkProps) {\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n const isExternal = external ?? /^https?:\\/\\//i.test(href);\n const Icon = isExternal ? ExternalLink : ArrowRight;\n const labelText = actionLabel ?? (isExternal ? \"Open\" : \"View\");\n\n const anchorClasses = cn(\n \"inline-flex min-h-11 items-center gap-1.5 rounded-md border border-border bg-card px-3 text-sm font-medium text-foreground shadow-sm transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring sm:min-h-8\",\n rowProps.disabled && \"pointer-events-none text-disabled-foreground\",\n );\n\n // Presentation-aware navigation: inside the settings window/drawer\n // this dismisses the shell *before* pushing, so the user lands on the\n // target page instead of seeing the window blink out. Cmd/Ctrl/middle\n // click still opens the link in a new tab (shell stays open).\n const navigate = useSettingsNavigate();\n\n return (\n <SettingsRow {...rowProps} id={id} variant=\"inline\" last={last}>\n {isExternal ? (\n <OutboundLink\n href={href}\n className={anchorClasses}\n >\n <span>{labelText}</span>\n <Icon className=\"h-3.5 w-3.5\" />\n </OutboundLink>\n ) : (\n <AppLink\n href={href}\n className={anchorClasses}\n onClick={(e) => {\n if (rowProps.disabled) {\n e.preventDefault();\n return;\n }\n navigate(href, e);\n }}\n >\n <span>{labelText}</span>\n <Icon className=\"h-3.5 w-3.5\" />\n </AppLink>\n )}\n </SettingsRow>\n );\n}\n","\"use client\";\n\nimport { useId, useState } from \"react\";\nimport { CheckIcon as Check, ChevronDownIcon as ChevronDown, XIcon as X } from \"../../icons\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport { cn } from \"../../cn\";\nimport { Button } from \"../../controls/controls\";\nimport { Tile } from \"../../controls/surfaces\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"../../popover\";\nimport type { SettingsCommonProps, SettingsOption } from \"../types\";\n\nexport type SettingsMultiSelectProps<T extends string = string> =\n SettingsCommonProps & {\n value: T[];\n onValueChange: (value: T[]) => void;\n options: SettingsOption<T>[];\n placeholder?: string;\n /** Maximum selected items. Extra selection attempts are ignored. */\n max?: number;\n /** Hide the selected tags display, show just a count (\"3 selected\"). */\n countOnly?: boolean;\n last?: boolean;\n };\n\nexport function SettingsMultiSelect<T extends string = string>({\n value,\n onValueChange,\n options,\n placeholder = \"Select…\",\n max,\n countOnly,\n last,\n ...rowProps\n}: SettingsMultiSelectProps<T>) {\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n\n const [open, setOpen] = useState(false);\n\n const selectedSet = new Set(value);\n const selectedOptions = options.filter((o) => selectedSet.has(o.value));\n\n const toggle = (v: T) => {\n if (selectedSet.has(v)) {\n onValueChange(value.filter((x) => x !== v));\n } else {\n if (max !== undefined && value.length >= max) return;\n onValueChange([...value, v]);\n }\n };\n\n const clearOne = (v: T) => onValueChange(value.filter((x) => x !== v));\n\n const summary = countOnly\n ? value.length === 0\n ? placeholder\n : `${value.length} selected`\n : null;\n\n return (\n <SettingsRow {...rowProps} id={id} variant=\"stacked\" last={last}>\n <div className=\"space-y-2\">\n {!countOnly && selectedOptions.length > 0 && (\n <div className=\"flex flex-wrap gap-1.5\">\n {selectedOptions.map((opt) => (\n <span\n key={opt.value}\n className=\"inline-flex max-w-full items-center gap-1 rounded-md border border-border bg-muted px-2 py-0.5 type-secondary text-foreground\"\n >\n {opt.icon && <opt.icon className=\"h-3 w-3\" />}\n <span className=\"min-w-0 truncate\">{opt.label}</span>\n {!rowProps.disabled && (\n <Button\n type=\"button\"\n variant=\"quiet\"\n aria-label={`Remove ${opt.label}`}\n icon={<X className=\"h-3 w-3\" />}\n onClick={() => clearOne(opt.value)}\n className=\"ml-0.5\"\n />\n )}\n </span>\n ))}\n </div>\n )}\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n id={id}\n type=\"button\"\n variant=\"outline\"\n iconEnd={<ChevronDown className=\"h-4 w-4 shrink-0 text-muted-foreground\" />}\n disabled={rowProps.disabled}\n className=\"w-full\"\n >\n <span\n className={cn(\n \"min-w-0 flex-1 truncate\",\n value.length === 0 && \"text-muted-foreground\",\n )}\n >\n {countOnly\n ? summary\n : value.length === 0\n ? placeholder\n : `${value.length} selected`}\n </span>\n </Button>\n </PopoverTrigger>\n <PopoverContent\n sizing=\"content\"\n align=\"start\"\n className=\"p-1\"\n >\n <div className=\"max-h-64 overflow-y-auto\">\n {options.map((opt) => {\n const isSelected = selectedSet.has(opt.value);\n const isDisabled =\n opt.disabled ||\n (!isSelected && max !== undefined && value.length >= max);\n return (\n <Tile\n key={opt.value}\n type=\"button\"\n dense\n variant=\"quiet\"\n selected={isSelected}\n disabled={isDisabled}\n onClick={() => toggle(opt.value)}\n icon={opt.icon ? <opt.icon className=\"h-3.5 w-3.5\" /> : <Check className=\"h-3.5 w-3.5\" />}\n title={opt.label}\n className=\"w-full\"\n />\n );\n })}\n </div>\n </PopoverContent>\n </Popover>\n </div>\n </SettingsRow>\n );\n}\n","\"use client\";\n\n/**\n * Popover — ported verbatim from matrx-frontend `components/ui/popover.tsx`.\n *\n * Seam inversion: the host's `useNestedPortalContainer` (dialog/popout aware)\n * becomes the injected `PortalContainerProvider` seam (`portal-container.tsx`);\n * the explicit `container` prop keeps top priority, exactly as before.\n *\n * THE ROOT RENDERS UNCONDITIONALLY — no mount gate. This wrapper used to defer\n * rendering until after hydration (\"Radix generates dynamic aria-controls ids\n * that differ between SSR and client\"), and that justification was false:\n * Radix ids come from React's SSR-stable `useId` (verified against\n * @radix-ui/react-popover 1.1.17 / react-id 1.1.2). The gate was actively\n * harmful — the Trigger wraps ALWAYS-VISIBLE content, so `return null`\n * deleted it from SSR and the first client paint.\n */\n\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { MOTION_POPPER } from \"./motion\";\nimport { SOLID_SURFACE_CLASS, type PopoverSurface } from \"./solid-surface\";\nimport { usePortalContainer } from \"./portal-container\";\nimport { keepMovedFocus } from \"./focus-return\";\n\nexport const Popover = PopoverPrimitive.Root;\n\nexport const PopoverTrigger = PopoverPrimitive.Trigger;\n\nexport const PopoverAnchor = PopoverPrimitive.Anchor;\n\nexport interface PopoverContentProps\n extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> {\n /** Explicit portal target; wins over the injected container. */\n container?: HTMLElement | null;\n /**\n * Package-owned open/close motion. Default `true`. Pass `false` for a\n * surface that must appear instantly — a picker re-anchoring while the user\n * types, a measurement pass. It is NOT the reduced-motion switch;\n * `styles.css` already honors `prefers-reduced-motion`.\n */\n animated?: boolean;\n /**\n * HOW WIDE THE POPOVER IS ALLOWED TO BE, and it is the SYSTEM that decides — never a\n * surface pasting its own `w-64` over the default (lane FIX-14, 2026-09-22).\n *\n * `\"fixed\"` (default) is the historical `w-72`: right for a menu of short, known\n * labels, where a ragged edge would look broken.\n *\n * `\"content\"` is for a popover whose whole job is to SHOW SOMETHING THE SYSTEM DID\n * NOT CHOOSE — a person's name, a record's title, a row the user is about to\n * create. The relation picker offered\n *\n * Create “Marisol Okonkwo — 418 Calle Pu\n *\n * inside a 16rem box, cut mid-word, on the one control that exists to show the name\n * being created. A fixed width cannot be right for content of unknown length, so\n * this one grows to its content between an honest floor and an honest ceiling:\n *\n * · at least the trigger's own width, and at least 20rem — the width Airtable's and\n * Notion's link-record pickers settle on, and wide enough that an ordinary\n * \"name — street, town\" fits on one line;\n * · at most 28rem, and never wider than the viewport less a 1rem gutter each side,\n * so it still fits a 375px phone with nothing running off the screen. The floor is\n * clamped by the same gutter, so on a very narrow screen the ceiling still wins.\n *\n * Beyond that ceiling the CONTENT truncates with an ellipsis and carries a `title`.\n * Growing, then ellipsis — never a mid-word cut.\n *\n * BOTH modes keep the phone gutter (2026-09-26): the box is never wider than the\n * viewport less 1rem each side, and Radix keeps it `collisionPadding` (16px) off every\n * screen edge. Measured at 375px before this: `w-72`/`w-80` callers landed flush on\n * the right edge (55→375) because collision padding was 0.\n */\n sizing?: \"fixed\" | \"content\";\n /**\n * The surface fill. `\"default\"` is the theme's popover surface (a host may render it\n * translucent / glass). `\"solid\"` is the OPAQUE surface — the popover token at full\n * alpha, no backdrop blur — for a menu that must read as paper over a cover image or a\n * busy page (a Notion-style ••• menu). Same option on `DropdownMenuContent`.\n */\n surface?: PopoverSurface;\n /**\n * A NAMED fixed width (0.68.22), for a `sizing=\"fixed\"` popover whose content needs more or\n * less room than the default `md` (18rem) — never a pasted `w-[260px]`. Every width keeps the\n * phone gutter (never wider than the viewport less 1rem each side). Derived from the call\n * sites: `xs` 12rem (a short menu), `sm` 15rem (a ••• menu), `md` 18rem (default),\n * `lg` 20rem (a small form), `xl` 26rem (a picker grid), `2xl` 34rem (a gallery).\n * Ignored when `sizing=\"content\"`.\n */\n width?: PopoverWidth;\n /**\n * The inner padding, named (0.68.22): `none` (the content draws its own — a command list, a\n * picker), `xs` 4px (a menu of rows), `sm` 8px, `md` 12px, `default` 16px.\n */\n padding?: PopoverPadding;\n}\n\nexport type PopoverWidth = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\nexport type PopoverPadding = \"none\" | \"xs\" | \"sm\" | \"md\" | \"default\";\n\n/** Literal class per width so a host's Tailwind scan of the package finds every one. */\nexport const POPOVER_WIDTH_CLASS: Record<PopoverWidth, string> = {\n xs: \"w-48\",\n sm: \"w-60\",\n md: \"w-72\",\n lg: \"w-80\",\n xl: \"w-[26rem]\",\n \"2xl\": \"w-[34rem]\",\n};\nexport const POPOVER_PADDING_CLASS: Record<PopoverPadding, string> = {\n none: \"p-0\",\n xs: \"p-1\",\n sm: \"p-2\",\n md: \"p-3\",\n default: \"p-4\",\n};\n\nexport const PopoverContent = React.forwardRef<\n React.ComponentRef<typeof PopoverPrimitive.Content>,\n PopoverContentProps\n>(\n (\n {\n className,\n align = \"center\",\n sideOffset = 4,\n container,\n animated = true,\n sizing = \"fixed\",\n surface = \"default\",\n width = \"md\",\n padding = \"default\",\n collisionPadding = 16,\n onCloseAutoFocus,\n ...props\n },\n ref,\n ) => {\n const portalContainer = usePortalContainer(container);\n return (\n <PopoverPrimitive.Portal container={portalContainer}>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n data-surface={surface === \"solid\" ? \"solid\" : undefined}\n data-width={sizing === \"content\" ? undefined : width}\n data-padding={padding}\n className={cn(\n // Cap to the viewport space Radix measured and scroll — a popover taller\n // than the screen must never trap the user with unreachable content.\n // z must EQUAL the dialog layer (z-[10000]), never exceed it: with equal\n // z, DOM portal order decides, so a dialog opened FROM a popover stacks\n // above it, and a popover opened from a dialog still stacks above the\n // dialog. z-[10001] buried dialogs behind fullscreen popovers.\n \"z-[10000] max-h-[var(--radix-popover-content-available-height)] overflow-y-auto overscroll-contain rounded-md border bg-popover text-popover-foreground shadow-md outline-none\",\n POPOVER_PADDING_CLASS[padding],\n sizing === \"content\"\n ? \"w-auto min-w-[min(max(var(--radix-popover-trigger-width),20rem),calc(100vw-2rem))] max-w-[min(28rem,calc(100vw-2rem))]\"\n : cn(POPOVER_WIDTH_CLASS[width], \"max-w-[calc(100vw-2rem)]\"),\n surface === \"solid\" && SOLID_SURFACE_CLASS,\n animated && MOTION_POPPER,\n className,\n )}\n {...props}\n onCloseAutoFocus={keepMovedFocus(onCloseAutoFocus)}\n />\n </PopoverPrimitive.Portal>\n );\n },\n);\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n","\"use client\";\n\nimport { useState, useEffect, useId } from \"react\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport { Field } from \"../../controls/controls\";\nimport type { SettingsCommonProps, SettingsControlSize } from \"../types\";\n\nexport type SettingsNumberInputProps = SettingsCommonProps & {\n value: number;\n onValueChange: (value: number) => void;\n min?: number;\n max?: number;\n step?: number;\n /** When true, integers only. */\n integer?: boolean;\n unit?: string;\n size?: SettingsControlSize;\n width?: \"sm\" | \"md\" | \"lg\";\n last?: boolean;\n};\n\nconst widthClass = {\n sm: \"w-20 max-w-full min-w-0\",\n md: \"w-24 max-w-full min-w-0\",\n lg: \"w-32 max-w-full min-w-0\",\n};\n\nexport function SettingsNumberInput({\n value,\n onValueChange,\n min,\n max,\n step = 1,\n integer,\n unit,\n size: _size,\n width = \"sm\",\n last,\n ...rowProps\n}: SettingsNumberInputProps) {\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n\n const [draft, setDraft] = useState(String(value));\n\n useEffect(() => {\n setDraft(String(value));\n }, [value]);\n\n const commit = (raw: string) => {\n const parsed = integer ? parseInt(raw, 10) : parseFloat(raw);\n if (Number.isNaN(parsed)) {\n setDraft(String(value));\n return;\n }\n let next = parsed;\n if (min !== undefined) next = Math.max(min, next);\n if (max !== undefined) next = Math.min(max, next);\n onValueChange(next);\n setDraft(String(next));\n };\n\n return (\n <SettingsRow\n {...rowProps}\n id={id}\n variant=\"inline\"\n controlLayout=\"wide\"\n last={last}\n >\n <div className=\"flex max-w-full flex-wrap items-center gap-1.5\">\n <Field\n id={id}\n type=\"number\"\n inputMode={integer ? \"numeric\" : \"decimal\"}\n value={draft}\n min={min}\n max={max}\n step={step}\n onChange={(e) => setDraft(e.target.value)}\n onBlur={(e) => commit(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") (e.currentTarget as HTMLInputElement).blur();\n }}\n disabled={rowProps.disabled}\n className={widthClass[width]}\n />\n {unit && (\n <span className=\"type-secondary text-muted-foreground tabular-nums\">\n {unit}\n </span>\n )}\n </div>\n </SettingsRow>\n );\n}\n","\"use client\";\n\nimport { useId } from \"react\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport { cn } from \"../../cn\";\nimport { Tile } from \"../../controls/surfaces\";\nimport type { SettingsCommonProps, SettingsOption } from \"../types\";\n\nexport type SettingsRadioGroupProps<T extends string = string> =\n SettingsCommonProps & {\n value: T;\n onValueChange: (value: T) => void;\n options: SettingsOption<T>[];\n /** How the radio options are arranged. Defaults to \"stacked\" which is readable on mobile. */\n orientation?: \"horizontal\" | \"stacked\";\n last?: boolean;\n };\n\nexport function SettingsRadioGroup<T extends string = string>({\n value,\n onValueChange,\n options,\n orientation = \"stacked\",\n last,\n ...rowProps\n}: SettingsRadioGroupProps<T>) {\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n\n return (\n <SettingsRow {...rowProps} id={id} variant=\"stacked\" last={last}>\n <div\n role=\"radiogroup\"\n aria-labelledby={id}\n className={cn(\n orientation === \"stacked\" ? \"flex flex-col gap-1.5\" : \"flex flex-wrap gap-2\",\n )}\n >\n {options.map((opt) => {\n const isSelected = opt.value === value;\n return (\n <Tile\n key={opt.value}\n type=\"button\"\n role=\"radio\"\n aria-checked={isSelected}\n disabled={opt.disabled || rowProps.disabled}\n onClick={() => onValueChange(opt.value)}\n variant=\"outline\"\n className={orientation === \"horizontal\" ? \"min-w-[120px] flex-1\" : \"w-full\"}\n icon={<span aria-hidden className={cn(\"size-4 rounded-full border-2 flex items-center justify-center\", isSelected ? \"border-primary\" : \"border-muted-foreground/40\")}>{isSelected ? <span className=\"size-2 rounded-full bg-primary\" /> : null}</span>}\n title={<span><span className=\"flex items-center gap-1.5\">{opt.icon ? <opt.icon className=\"h-3.5 w-3.5\" /> : null}<span className=\"type-title text-foreground\">{opt.label}</span></span>{opt.description ? <span className=\"mt-0.5 block type-secondary text-muted-foreground\">{opt.description}</span> : null}</span>}\n />\n );\n })}\n </div>\n </SettingsRow>\n );\n}\n","\"use client\";\n\nimport { useId } from \"react\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport { Tabs } from \"../../controls/controls\";\nimport type {\n SettingsCommonProps,\n SettingsOption,\n SettingsControlSize,\n} from \"../types\";\n\nexport type SettingsSegmentedProps<T extends string = string> =\n SettingsCommonProps & {\n value: T;\n onValueChange: (value: T) => void;\n /** Read-only: shared vocabularies (agent-writable-settings) are `as const`. */\n options: readonly SettingsOption<T>[];\n size?: SettingsControlSize;\n /** Takes the full row width (stacks on mobile). */\n fullWidth?: boolean;\n last?: boolean;\n };\n\nexport function SettingsSegmented<T extends string = string>({\n value,\n onValueChange,\n options,\n fullWidth,\n last,\n // `size` is retired: the control has one geometry.\n size: _size,\n ...rowProps\n}: SettingsSegmentedProps<T>) {\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n\n return (\n <SettingsRow\n {...rowProps}\n id={id}\n variant={fullWidth ? \"stacked\" : \"inline\"}\n controlLayout=\"wide\"\n last={last}\n >\n <Tabs\n variant=\"capsule\"\n aria-label={rowProps.label}\n value={value}\n onValueChange={onValueChange}\n data={options.map((opt) => ({\n value: opt.value,\n label: opt.icon ? (\n <>\n <opt.icon />\n {opt.label}\n </>\n ) : (\n opt.label\n ),\n disabled: Boolean(opt.disabled || rowProps.disabled),\n }))}\n />\n </SettingsRow>\n );\n}\n","\"use client\";\n\nimport { useId, useState } from \"react\";\nimport { CheckIcon as Check } from \"../../icons\";\nimport { SelectChevron } from \"../../select\";\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from \"../../command\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../../popover\";\nimport { cn } from \"../../cn\";\nimport { Button } from \"../../controls/controls\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"../../select\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport type {\n SettingsCommonProps,\n SettingsOption,\n SettingsControlSize,\n} from \"../types\";\n\ntype Width = \"auto\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"full\";\n\nconst widthClass: Record<Width, string> = {\n auto: \"w-full max-w-full @[40rem]/settings:w-auto @[40rem]/settings:min-w-32\",\n sm: \"w-32 max-w-full min-w-0\",\n md: \"w-44 max-w-full min-w-0\",\n lg: \"w-64 max-w-full min-w-0\",\n // The width of the ladder rows' model/voice pickers, so a screen mixing\n // both lines every control up on one edge.\n xl: \"w-80 max-w-full min-w-0\",\n full: \"w-full\",\n};\n\nconst triggerSize: Record<SettingsControlSize, \"sm\" | \"default\" | \"lg\"> = {\n sm: \"sm\",\n md: \"default\",\n lg: \"lg\",\n};\n\nconst triggerMinHeight: Record<SettingsControlSize, string> = {\n // 44px under touch or below lg — the same condition as the\n // matrx-touch-targets floor, which a min-h utility here would otherwise beat.\n sm: \"min-h-7 max-lg:min-h-11 pointer-coarse:min-h-11\",\n md: \"min-h-9 max-lg:min-h-11 pointer-coarse:min-h-11\",\n lg: \"min-h-10\",\n};\n\nexport type SettingsSelectProps<T extends string = string> =\n SettingsCommonProps & {\n value: T;\n onValueChange: (value: T) => void;\n /** Read-only: shared vocabularies (agent-writable-settings) are `as const`. */\n options: readonly SettingsOption<T>[];\n placeholder?: string;\n size?: SettingsControlSize;\n width?: Width;\n /** Renders as a stacked layout. Use when the select should span full width. */\n stacked?: boolean;\n last?: boolean;\n /** Long lists: a search box that filters by label and value (case-insensitive contains). */\n searchable?: boolean;\n searchPlaceholder?: string;\n };\n\n/** Case-insensitive contains over the label and the raw value; \"/\" and \"_\" read as spaces. */\nexport function matchesSettingsOption(\n query: string,\n option: { label: string; value: string },\n): boolean {\n const norm = (t: string) => t.toLowerCase().replace(/[_/]/g, \" \");\n const q = norm(query).trim();\n if (!q) return true;\n return norm(option.label).includes(q) || norm(option.value).includes(q);\n}\n\n/**\n * Radix Select reads a value of \"\" as \"nothing selected\" and shows a blank\n * trigger, so an option whose value IS \"\" (a \"None\" choice — e.g. voice\n * emotion) looked unset even while it was the saved choice. Every settings\n * select maps \"\" to this token on the way in and back to \"\" on the way out.\n */\nconst EMPTY_OPTION_VALUE = \"__settings-empty-option__\";\n\nexport function SettingsSelect<T extends string = string>({\n value,\n onValueChange,\n options,\n placeholder,\n size = \"md\",\n width = \"md\",\n stacked,\n last,\n searchable,\n searchPlaceholder = \"Search\",\n ...rowProps\n}: SettingsSelectProps<T>) {\n const [open, setOpen] = useState(false);\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n const variant = stacked ? \"stacked\" : \"inline\";\n const effectiveWidth: Width = stacked ? \"full\" : width;\n // Only a select that OFFERS \"\" as a choice maps it; elsewhere \"\" still\n // means \"not chosen yet\" and the placeholder shows.\n const hasEmptyOption = options.some((opt) => opt.value === \"\");\n\n return (\n <SettingsRow\n {...rowProps}\n id={id}\n variant={variant}\n controlLayout=\"wide\"\n last={last}\n >\n {searchable ? (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n type=\"button\"\n variant=\"outline\"\n id={id}\n role=\"combobox\"\n aria-expanded={open}\n iconEnd={<SelectChevron size=\"sm\" />}\n disabled={rowProps.disabled ?? false}\n className={widthClass[effectiveWidth]}\n >\n <span className=\"truncate\">\n {options.find((o) => o.value === value)?.label ??\n placeholder ??\n value}\n </span>\n </Button>\n </PopoverTrigger>\n <PopoverContent sizing=\"content\" className=\"p-0\" align=\"end\">\n <Command\n filter={(itemValue, search) => {\n const opt = options.find((o) => o.value === itemValue);\n return opt ? (matchesSettingsOption(search, opt) ? 1 : 0) : 0;\n }}\n >\n <CommandInput\n placeholder={searchPlaceholder}\n className=\"h-9 text-sm\"\n />\n <CommandList>\n <CommandEmpty>No results found.</CommandEmpty>\n <CommandGroup className=\"max-h-72 overflow-auto\">\n {options.map((opt) => (\n <CommandItem\n key={opt.value}\n value={opt.value}\n disabled={opt.disabled ?? false}\n onSelect={() => {\n onValueChange(opt.value as T);\n setOpen(false);\n }}\n >\n <Check\n className={cn(\n \"mr-2 h-3.5 w-3.5\",\n opt.value === value ? \"opacity-100\" : \"opacity-0\",\n )}\n />\n {opt.label}\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n ) : (\n <Select\n value={value === \"\" && hasEmptyOption ? EMPTY_OPTION_VALUE : value}\n onValueChange={(v) =>\n onValueChange((v === EMPTY_OPTION_VALUE ? \"\" : v) as T)\n }\n disabled={rowProps.disabled ?? false}\n >\n <SelectTrigger\n id={id}\n size={triggerSize[size]}\n className={`${widthClass[effectiveWidth]} h-auto ${triggerMinHeight[size]} whitespace-normal text-left [&>span]:line-clamp-none [&>span]:whitespace-normal`}\n >\n <SelectValue placeholder={placeholder} />\n </SelectTrigger>\n <SelectContent>\n {options.map((opt) => (\n <SelectItem\n key={opt.value}\n value={opt.value === \"\" ? EMPTY_OPTION_VALUE : opt.value}\n disabled={opt.disabled ?? false}\n // Outside ItemText via the prop — a description passed as a\n // child ends up inside the closed trigger and gets clipped.\n {...(opt.description === undefined ? {} : { description: opt.description })}\n >\n <span className=\"flex items-center gap-2\">\n {opt.icon && <opt.icon className=\"h-3.5 w-3.5\" />}\n <span>{opt.label}</span>\n </span>\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n </SettingsRow>\n );\n}\n","\"use client\";\n\n/**\n * Command — ported verbatim from matrx-frontend `components/ui/command.tsx`.\n *\n * `cmdk` is a SANCTIONED REAL DEPENDENCY (the vaul ↔ BottomSheet precedent):\n * the filtering/scoring/keyboard engine IS the component's product — there is\n * no Command palette without it, and reimplementing type-ahead ranking plus\n * roving keyboard selection would twin a maintained library rather than our\n * own code. See FEATURE.md.\n *\n * Seam inversions:\n * - `MagnifyingGlassIcon` comes from the package's inlined SVGs (C19), not\n * @radix-ui/react-icons.\n * - `CommandDialog` composed the host dialog module (`Dialog`, `DialogContent`,\n * `DialogTitle`). Those pieces are inlined privately below with identical\n * behavior — modal context, overlay, desktop card / mobile bottom-sheet\n * geometry, close control, portal — except the host's popout-aware\n * `DialogPortal` becomes the package's `PortalContainerProvider` seam\n * (plus an explicit `container` prop, which keeps top priority).\n * - The host's `useIsMobile` (a plain matchMedia breakpoint hook, not\n * host-shaped) became the package's own `./use-is-mobile`, with the same\n * 768px breakpoint. It started life inlined here; `Dialog` needed the same\n * answer, so it moved to a module both read rather than being copied.\n */\n\nimport type { DialogProps } from \"@radix-ui/react-dialog\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { keepFloatingLayersInside, useModalLayer } from \"./floating-layer\";\nimport {\n CENTERED_DIALOG,\n MOTION_BOTTOM_SHEET,\n MOTION_DIALOG,\n MOTION_OVERLAY,\n} from \"./motion\";\nimport { CloseControl, CloseRow, CloseSlotProvider, SearchRowCloseSlotProvider, useCloseSlot, useSearchRowCloseSlotClaim } from \"./close-slot\";\nimport { MagnifyingGlassIcon } from \"./icons\";\nimport { usePortalContainer } from \"./portal-container\";\nimport {\n RadixDialogModalProvider,\n useRadixDialogModal,\n} from \"./radix-dialog-modal-context\";\nimport { useIsMobile } from \"./use-is-mobile\";\n\nexport const Command = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground\",\n className,\n )}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\n/* ------------------------------------------------------------------ */\n/* Private dialog internals for CommandDialog (host dialog module, */\n/* behavior-identical, portal seam inverted). */\n/* ------------------------------------------------------------------ */\n\nconst DIALOG_DESKTOP_CLASSES =\n `fixed left-[50%] top-[50%] z-[10000] grid min-w-0 w-full max-w-lg ${CENTERED_DIALOG} gap-4 overflow-x-clip border bg-background p-6 shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full sm:rounded-lg`;\n\nconst DIALOG_MOBILE_SHEET_CLASSES =\n \"fixed inset-x-0 bottom-0 left-0 right-0 top-auto z-[10000] flex min-w-0 flex-col w-full max-w-full max-h-[90dvh] translate-x-0 translate-y-0 gap-4 overflow-x-clip border-t bg-background p-4 pb-safe shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full rounded-t-2xl rounded-b-none overflow-y-auto overscroll-contain\";\n\n// Re-asserted LAST so the sheet geometry always wins over any caller className.\nconst DIALOG_MOBILE_SHEET_OVERRIDE =\n \"inset-x-0 bottom-0 left-0 right-0 top-auto translate-x-0 translate-y-0 w-full max-w-full max-h-[90dvh] rounded-b-none rounded-t-2xl overflow-y-auto\";\n\nconst CommandDialogContent = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n container?: HTMLElement | null;\n }\n>(({ className, children, container, onInteractOutside, ...props }, ref) => {\n const isMobile = useIsMobile();\n const isModal = useRadixDialogModal();\n useModalLayer(isModal);\n const portalContainer = usePortalContainer(container);\n // The × is the last item of the search row (close-slot.tsx); a palette with\n // no CommandInput gets a close row of its own.\n const closeSlot = useCloseSlot(true);\n return (\n <DialogPrimitive.Portal container={portalContainer}>\n {isModal ? (\n <DialogPrimitive.Overlay\n className={cn(\n \"fixed inset-0 z-[10000] bg-[var(--matrx-overlay-scrim-soft)]\",\n MOTION_OVERLAY,\n )}\n />\n ) : null}\n <DialogPrimitive.Content\n ref={ref}\n aria-modal={isModal || undefined}\n aria-describedby={undefined}\n className={cn(\n isMobile ? DIALOG_MOBILE_SHEET_CLASSES : DIALOG_DESKTOP_CLASSES,\n isMobile ? MOTION_BOTTOM_SHEET : MOTION_DIALOG,\n className,\n isMobile && DIALOG_MOBILE_SHEET_OVERRIDE,\n !isModal && \"z-[900]\",\n )}\n {...props}\n onInteractOutside={keepFloatingLayersInside(onInteractOutside)}\n >\n {closeSlot.slot && !closeSlot.claimed ? <CloseRow className=\"px-4 pt-4\" /> : null}\n {/* A header inside a palette never reaches past it to an outer Dialog's slot. */}\n <CloseSlotProvider value={null}>\n <SearchRowCloseSlotProvider value={closeSlot.slot}>{children}</SearchRowCloseSlotProvider>\n </CloseSlotProvider>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n );\n});\nCommandDialogContent.displayName = \"CommandDialogContent\";\n\nexport interface CommandDialogProps extends DialogProps {\n /** Explicit portal target for the dialog; beats the injected seam. */\n container?: HTMLElement | null;\n}\n\nexport const CommandDialog = ({\n children,\n container,\n ...props\n}: CommandDialogProps) => {\n const modal = props.modal ?? true;\n return (\n <RadixDialogModalProvider modal={modal}>\n <DialogPrimitive.Root {...props} modal={modal}>\n <CommandDialogContent\n className=\"overflow-hidden p-0\"\n {...(container !== undefined ? { container } : {})}\n >\n <DialogPrimitive.Title className=\"sr-only\"></DialogPrimitive.Title>\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </CommandDialogContent>\n </DialogPrimitive.Root>\n </RadixDialogModalProvider>\n );\n};\n\nexport const CommandInput = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\n>(({ className, ...props }, ref) => {\n // Inside a CommandDialog the search row owns the × (never a combobox's input in a Dialog).\n const ownsClose = useSearchRowCloseSlotClaim();\n return (\n <div className=\"flex items-center gap-2 border-b px-3\" cmdk-input-wrapper=\"\">\n <MagnifyingGlassIcon className=\"h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"flex h-10 w-full min-w-0 rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:text-disabled-foreground\",\n className,\n )}\n {...props}\n />\n {ownsClose ? <CloseControl className=\"-mr-1\" /> : null}\n </div>\n );\n});\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\nexport const CommandList = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\"max-h-[300px] overflow-y-auto overflow-x-hidden\", className)}\n {...props}\n />\n));\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nexport const CommandEmpty = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty\n ref={ref}\n className=\"py-6 text-center text-sm\"\n {...props}\n />\n));\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nexport const CommandGroup = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground\",\n className,\n )}\n {...props}\n />\n));\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nexport const CommandSeparator = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 h-px bg-border\", className)}\n {...props}\n />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nexport const CommandItem = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:text-disabled-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n className,\n )}\n {...props}\n />\n));\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nexport const CommandShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n \"ml-auto text-xs tracking-widest text-muted-foreground\",\n className,\n )}\n {...props}\n />\n );\n};\nCommandShortcut.displayName = \"CommandShortcut\";\n","\"use client\";\n\n/**\n * THE CLOSE CONTROL LIVES IN A ROW, NEVER IN A CORNER.\n *\n * The stock shadcn dialog pins its × with `absolute right-4 top-4`: a\n * coordinate guess about how tall the content's first row will be. Every\n * content whose first row is a different height got an × floating off its\n * row — the command palette's sat 12px below its 48px search row, on the\n * divider, with the query running underneath it (Arman, 2026-10-20: \"each\n * time they use this component, we end up with a very oddly placed x\").\n * Agents re-typed that snippet from memory faster than it could be fixed.\n *\n * So the × is a flex item of the row it belongs to, centered by layout:\n *\n * - `CommandInput` inside a `CommandDialog` draws it at the end of the\n * search row.\n * - `DialogHeader` / `SheetHeader` draw it at the end of the header row and\n * CLAIM it, so the content does not draw a second one; with two headers the\n * first one mounted draws it.\n * - Content with no visible header gets a close row of its own at the top,\n * in flow — it takes space, it never covers anything.\n *\n * Guard: `close-in-flow.test.tsx` — no `*.Close` in this package or its\n * consumers carries `absolute`/`fixed`, and each surface puts the × inside\n * its row.\n */\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\nimport { XIcon } from \"./icons\";\n\n/** 44px on touch, 32px from `lg`; a flex item, never positioned. */\nconst CLOSE_CONTROL_CLASSES =\n \"flex h-11 w-11 shrink-0 items-center justify-center rounded-sm text-muted-foreground ring-offset-background transition-colors hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none lg:h-8 lg:w-8\";\n\nexport function CloseControl({ className }: { className?: string }): React.ReactElement {\n return (\n <DialogPrimitive.Close data-slot=\"dialog-close\" aria-label=\"Close\" className={cn(CLOSE_CONTROL_CLASSES, className)}>\n <XIcon className=\"h-4 w-4\" aria-hidden=\"true\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n );\n}\n\ninterface CloseSlot {\n /** A row takes the × into itself; returns the release. The FIRST live claimant owns it. */\n claim(id: string): () => void;\n /** The id that draws the ×, or null while nobody claims it. */\n owner: string | null;\n}\n\n/** Dialog and Sheet: claimed by their header. */\nconst CloseSlotContext = React.createContext<CloseSlot | null>(null);\n/**\n * CommandDialog: claimed by its search row only. A separate context so a\n * CommandInput in a combobox (Popover > Command) opened INSIDE a Dialog never\n * takes the dialog's × — context crosses portals, and that × closes the dialog.\n */\nconst SearchRowCloseSlotContext = React.createContext<CloseSlot | null>(null);\n\n/**\n * For a content surface: returns the provider value and whether a row has\n * claimed the ×. Unclaimed (no header, or only an `sr-only`/`hidden` one) the\n * content draws `<CloseRow />` first, in flow. Claims land in a layout effect,\n * so the fallback never paints when a row takes it.\n */\nexport function useCloseSlot(enabled: boolean): { slot: CloseSlot | null; claimed: boolean } {\n const [claims, setClaims] = React.useState<string[]>([]);\n const owner = claims[0] ?? null;\n const claim = React.useCallback((id: string) => {\n setClaims((list) => [...list, id]);\n return () => setClaims((list) => list.filter((c) => c !== id));\n }, []);\n const slot = React.useMemo<CloseSlot | null>(() => (enabled ? { claim, owner } : null), [enabled, claim, owner]);\n return { slot, claimed: owner !== null };\n}\n\nexport const CloseSlotProvider = CloseSlotContext.Provider;\nexport const SearchRowCloseSlotProvider = SearchRowCloseSlotContext.Provider;\n\nfunction useClaim(context: React.Context<CloseSlot | null>, declined: boolean): boolean {\n const slot = React.useContext(context);\n const id = React.useId();\n const claim = slot?.claim;\n const wants = claim !== undefined && !declined;\n // Depends on the stable `claim`, never on `owner`, so a change of owner never re-claims.\n React.useLayoutEffect(() => (wants && claim ? claim(id) : undefined), [wants, claim, id]);\n return wants && slot?.owner === id;\n}\n\n/** For a header row: claims the Dialog/Sheet slot; true when this row draws the ×. */\nexport function useCloseSlotClaim(declined = false): boolean {\n return useClaim(CloseSlotContext, declined);\n}\n\n/** For CommandInput: claims only a CommandDialog's slot; true when this row draws the ×. */\nexport function useSearchRowCloseSlotClaim(): boolean {\n return useClaim(SearchRowCloseSlotContext, false);\n}\n\n/** The fallback: a row of its own at the top of the content. */\nexport function CloseRow({ className }: { className?: string }): React.ReactElement {\n return (\n <div data-slot=\"close-row\" className={cn(\"flex justify-end\", className)}>\n <CloseControl />\n </div>\n );\n}\n\n/** Classes that lay out a header's CHILDREN; they move to the header's body. */\nconst BODY_LAYOUT = /^!?(?:[a-z0-9]+:)*(?:flex|grid|flex-(?:row|col)(?:-reverse)?|grid-(?:cols|rows|flow)-\\S+|place-\\S+|items-\\S+|justify-\\S+|content-\\S+|gap(?:-[xy])?-\\S+|space-[xy]-\\S+|text-(?:left|center|right|start|end)|flex-wrap|flex-nowrap)$/;\n/**\n * Right padding a header carried to clear the old corner ×; with the × in the\n * row it would only push the × inward, so it is dropped.\n */\nconst OLD_CLOSE_RESERVE = /^pr-(?:8|9|10|11|12|14|16)$/;\n\nfunction splitHeaderClasses(className: string | undefined): { row: string; body: string } {\n const row: string[] = [];\n const body: string[] = [];\n for (const c of (className ?? \"\").split(/\\s+/)) {\n if (!c || OLD_CLOSE_RESERVE.test(c)) continue;\n (BODY_LAYOUT.test(c) ? body : row).push(c);\n }\n return { row: row.join(\" \"), body: body.join(\" \") };\n}\n\n/**\n * A header's element. With a close slot it is a row — the caller's children\n * in a body column, the × after them; the caller's padding, border and\n * background stay on the row, the caller's child layout (`flex-row`,\n * `space-y-*`, `text-left`…) moves to the body. Without one (no ×, or the\n * header is `sr-only`) it renders exactly as `baseClassName` + `className`.\n */\nexport function HeaderWithClose({\n slotName,\n baseClassName,\n closeOffsetClassName,\n className,\n children,\n ...props\n}: React.HTMLAttributes<HTMLDivElement> & {\n slotName: string;\n baseClassName: string;\n /** Pulls the × up so its center sits on the title's first line (the title's line height is the header's to know). */\n closeOffsetClassName: string;\n}): React.ReactElement {\n // A header nobody sees declines the ×; the content's own close row draws it.\n const owns = useCloseSlotClaim(/(?:^|\\s)(?:sr-only|hidden)(?:\\s|$)/.test(className ?? \"\"));\n if (!owns) {\n return (\n <div data-slot={slotName} className={cn(baseClassName, className)} {...props}>\n {children}\n </div>\n );\n }\n const { row, body } = splitHeaderClasses(className);\n // A header laid out as a row centers the × on that row; a stacked one, on the title's first line.\n const rowish = /(?:^|\\s)(?:[a-z0-9]+:)*flex-row(?:\\s|$)/.test(body);\n return (\n <div data-slot={slotName} data-has-close=\"\" className={cn(\"flex gap-2\", rowish ? \"items-center\" : \"items-start\", row)} {...props}>\n <div data-slot={`${slotName}-body`} className={cn(\"min-w-0 flex-1\", baseClassName, body)}>\n {children}\n </div>\n <CloseControl className={cn(\"-mr-2\", !rowish && closeOffsetClassName)} />\n </div>\n );\n}\n","\"use client\";\n\n/**\n * Ported verbatim from matrx-frontend `components/ui/radix-dialog-modal-context.tsx`.\n * Shared by the Sheet and BottomSheet families (and available to hosts that\n * compose their own Radix Dialog-derived wrappers around these primitives).\n */\n\nimport * as React from \"react\";\n\n// Shared identity across independently bundled public entrypoints/loaders.\nconst CONTEXT_SLOT = Symbol.for(\"ai-matrx.design-system.dialog-modal-context\");\nconst contextRegistry = globalThis as typeof globalThis & { [CONTEXT_SLOT]?: React.Context<boolean> };\nconst RadixDialogModalContext = contextRegistry[CONTEXT_SLOT] ??= React.createContext<boolean>(true);\n\nexport interface RadixDialogModalProviderProps {\n children: React.ReactNode;\n modal: boolean;\n}\n\n/**\n * Keeps our Radix-based content wrappers aligned with the owning Root's\n * modality so ARIA semantics cannot drift from focus/pointer behavior.\n */\nexport function RadixDialogModalProvider({\n children,\n modal,\n}: RadixDialogModalProviderProps) {\n return (\n <RadixDialogModalContext.Provider value={modal}>\n {children}\n </RadixDialogModalContext.Provider>\n );\n}\n\n/** Returns whether the nearest Radix Dialog-derived root is modal. */\nexport function useRadixDialogModal(): boolean {\n return React.useContext(RadixDialogModalContext);\n}\n","/**\n * useIsMobile — the ONE breakpoint hook the package's responsive primitives\n * read (CommandDialog and Dialog both auto-render as a bottom sheet below it).\n *\n * The body lives in `@ai-matrx/kit/media-query` (chat-package independence\n * P12, 2026-10-01): the app's `hooks/use-mobile` and this package each carried\n * their own copy, and two breakpoint hooks is exactly the duplication this\n * package exists to end. Kit's reads through `useSyncExternalStore` — `false`\n * on the server and during hydration, so the desktop geometry hydrates — and\n * never throws where `matchMedia` is absent.\n */\nexport { MOBILE_BREAKPOINT, useIsMobile } from \"@ai-matrx/kit/media-query\";\n","\"use client\";\n\nimport { useId } from \"react\";\nimport { Slider } from \"../../slider\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport type { SettingsCommonProps } from \"../types\";\n\nexport type SettingsSliderProps = SettingsCommonProps & {\n value: number;\n onValueChange: (value: number) => void;\n /**\n * Fires once when the drag ends (Radix onValueCommit). Use it when each\n * write is a network/database round-trip: track the drag with local state\n * via `onValueChange`, persist here.\n */\n onValueCommit?: (value: number) => void;\n min: number;\n max: number;\n step?: number;\n /** Label shown on the low end (e.g. \"Slow\"). */\n minLabel?: string;\n /** Label shown in the middle (e.g. \"Balanced\"). */\n midLabel?: string;\n /** Label shown on the high end (e.g. \"Fast\"). */\n maxLabel?: string;\n /** Fixed decimal places for the numeric display. Defaults to 0 for ints, 2 for floats. */\n precision?: number;\n /** Optional unit string shown next to value (e.g. \"px\", \"%\"). */\n unit?: string;\n last?: boolean;\n};\n\nexport function SettingsSlider({\n value,\n onValueChange,\n onValueCommit,\n min,\n max,\n step = 1,\n minLabel,\n midLabel,\n maxLabel,\n precision,\n unit,\n last,\n ...rowProps\n}: SettingsSliderProps) {\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n const effectivePrecision =\n precision !== undefined\n ? precision\n : step >= 1 || Number.isInteger(step)\n ? 0\n : 2;\n const display = value.toFixed(effectivePrecision);\n\n return (\n <SettingsRow {...rowProps} id={id} variant=\"stacked\" last={last}>\n <div className=\"space-y-2\">\n <div className=\"flex min-w-0 items-center justify-between gap-2\">\n <span className=\"min-w-0 break-words type-secondary text-muted-foreground tabular-nums\">\n {display}\n {unit}\n </span>\n <span className=\"min-w-0 break-words text-right type-secondary text-muted-foreground tabular-nums\">\n {min} – {max}\n </span>\n </div>\n <Slider\n id={id}\n min={min}\n max={max}\n step={step}\n value={[value]}\n onValueChange={(v) => onValueChange(v[0] ?? min)}\n {...(onValueCommit ? { onValueCommit: (v: number[]) => onValueCommit(v[0] ?? min) } : {})}\n disabled={rowProps.disabled ?? false}\n />\n {(minLabel || midLabel || maxLabel) && (\n <div className=\"flex min-w-0 justify-between gap-2 type-meta text-muted-foreground\">\n <span className=\"min-w-0 break-words\">{minLabel}</span>\n <span className=\"hidden sm:inline\">{midLabel}</span>\n <span className=\"min-w-0 break-words text-right\">{maxLabel}</span>\n </div>\n )}\n </div>\n </SettingsRow>\n );\n}\n","\"use client\";\n\n/**\n * Slider — the range control (46 host import sites).\n *\n * Ported from matrx-frontend `components/ui/slider.tsx`. Two things the host\n * copy could not do, both fixed here rather than in a fork:\n *\n * 1. A 16px THUMB IS NOT A TOUCH TARGET. The stock thumb is `h-4 w-4`, well\n * under the 44px Apple HIG minimum, so a slider that worked with a mouse\n * was a coin-flip with a thumb. The visible thumb keeps its size (`size`\n * controls it), and an invisible `::after` pseudo-target expands the hit\n * area to 44px on coarse pointers without changing the layout — the same\n * trick `ResizableHandle` uses for mouse tolerance.\n *\n * 2. DENSITY IS A PROP, NOT A FORK (C18). `size=\"sm|md|lg\"` picks the track\n * height and thumb diameter together, so a dense admin panel and a\n * touch-first settings screen use ONE component.\n *\n * Multi-thumb ranges work: a `Thumb` is rendered per value, which is what\n * Radix requires and what the host copy (a single hardcoded Thumb) got wrong\n * for any `value` array longer than one.\n */\n\nimport * as SliderPrimitive from \"@radix-ui/react-slider\";\nimport * as React from \"react\";\n\nimport { cn } from \"./cn\";\n\nexport type SliderSize = \"sm\" | \"md\" | \"lg\";\n\nconst TRACK_CLASSES: Record<SliderSize, string> = {\n sm: \"h-1\",\n md: \"h-1.5\",\n lg: \"h-2.5\",\n};\n\nconst THUMB_CLASSES: Record<SliderSize, string> = {\n sm: \"h-3.5 w-3.5\",\n md: \"h-4 w-4\",\n lg: \"h-5 w-5\",\n};\n\nexport interface SliderProps\n extends React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root> {\n /** Track + thumb scale. Default `md`. */\n size?: SliderSize;\n}\n\nconst Slider = React.forwardRef<\n React.ComponentRef<typeof SliderPrimitive.Root>,\n SliderProps\n>(({ className, size = \"md\", ...props }, ref) => {\n // One Thumb per value — controlled `value` wins, then `defaultValue`, then\n // the single-thumb default. Radix renders nothing sensible if the count is\n // wrong, which is how the host copy silently dropped a range's upper thumb.\n const thumbCount = Math.max(\n 1,\n (props.value ?? props.defaultValue ?? [0]).length,\n );\n\n return (\n <SliderPrimitive.Root\n ref={ref}\n data-slot=\"slider\"\n className={cn(\n \"relative flex w-full touch-none select-none items-center data-[disabled]:opacity-50\",\n \"data-[orientation=vertical]:h-full data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col\",\n className,\n )}\n {...props}\n >\n <SliderPrimitive.Track\n data-slot=\"slider-track\"\n className={cn(\n \"relative w-full grow overflow-hidden rounded-full bg-primary/20\",\n TRACK_CLASSES[size],\n \"data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5\",\n )}\n >\n <SliderPrimitive.Range\n data-slot=\"slider-range\"\n className=\"absolute h-full bg-primary data-[orientation=vertical]:w-full\"\n />\n </SliderPrimitive.Track>\n {Array.from({ length: thumbCount }, (_, index) => (\n <SliderPrimitive.Thumb\n key={index}\n data-slot=\"slider-thumb\"\n // The thumb is the focusable slider: it carries the control's name (a label on the root alone leaves it unnamed).\n {...(props[\"aria-label\"] ? { \"aria-label\": props[\"aria-label\"] } : {})}\n className={cn(\n \"relative block cursor-grab rounded-full border border-primary/50 bg-background shadow transition-colors active:cursor-grabbing\",\n \"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n // Ruling 1 — invisible 44px target, coarse pointers only, so a\n // dense desktop row keeps its exact hit behavior.\n \"after:absolute after:left-1/2 after:top-1/2 after:-translate-x-1/2 after:-translate-y-1/2 after:content-['']\",\n \"pointer-coarse:after:h-11 pointer-coarse:after:w-11\",\n THUMB_CLASSES[size],\n )}\n />\n ))}\n </SliderPrimitive.Root>\n );\n});\nSlider.displayName = SliderPrimitive.Root.displayName;\n\nexport { Slider };\n","\"use client\";\n\nimport { useId } from \"react\";\nimport { Switch } from \"../../controls/controls\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport type { SettingsCommonProps } from \"../types\";\n\nexport type SettingsSwitchProps = SettingsCommonProps & {\n checked: boolean;\n onCheckedChange: (checked: boolean) => void;\n /** Controls whether the row renders a border underneath. */\n last?: boolean;\n};\n\nexport function SettingsSwitch({\n checked,\n onCheckedChange,\n last,\n ...rowProps\n}: SettingsSwitchProps) {\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n return (\n <SettingsRow {...rowProps} id={id} variant=\"inline\" last={last}>\n {/* The switch stays its painted size; its label carries the 44px\n touch ring (matrx-tap-area) so a finger can hit it on a phone. */}\n <label htmlFor={id} className=\"matrx-tap-area inline-flex\">\n <Switch\n id={id}\n checked={checked}\n onCheckedChange={onCheckedChange}\n disabled={rowProps.disabled}\n />\n </label>\n </SettingsRow>\n );\n}\n","\"use client\";\n\nimport { useId, useState } from \"react\";\nimport { SettingsRow } from \"../SettingsRow\";\nimport { Field } from \"../../controls/controls\";\nimport type { SettingsCommonProps, SettingsControlSize } from \"../types\";\n\nconst widthClass = {\n sm: \"w-32 max-w-full min-w-0\",\n md: \"w-48 max-w-full min-w-0\",\n lg: \"w-72 max-w-full min-w-0\",\n full: \"w-full\",\n};\n\nexport type SettingsTextInputProps = SettingsCommonProps & {\n value: string;\n onValueChange: (value: string) => void;\n placeholder?: string;\n type?: \"text\" | \"email\" | \"url\" | \"password\" | \"tel\";\n inputMode?: \"text\" | \"email\" | \"url\" | \"tel\" | \"numeric\" | \"decimal\";\n /** Commit on blur/enter instead of every keystroke. Useful for expensive writes. */\n commitOnBlur?: boolean;\n maxLength?: number;\n size?: SettingsControlSize;\n width?: \"sm\" | \"md\" | \"lg\" | \"full\";\n /** Renders as a stacked layout so the input can be full-width. */\n stacked?: boolean;\n last?: boolean;\n};\n\nexport function SettingsTextInput({\n value,\n onValueChange,\n placeholder,\n type = \"text\",\n inputMode,\n commitOnBlur,\n maxLength,\n size: _size,\n width = \"md\",\n stacked,\n last,\n ...rowProps\n}: SettingsTextInputProps) {\n const generatedId = useId().replace(/:/g, \"\");\n const id = rowProps.id ?? `settings-${generatedId}`;\n\n const [draft, setDraft] = useState(value);\n const [lastCommittedValue, setLastCommittedValue] = useState(value);\n\n if (commitOnBlur && value !== lastCommittedValue) {\n setLastCommittedValue(value);\n setDraft(value);\n }\n\n const effective = commitOnBlur ? draft : value;\n const effectiveWidth = stacked ? \"full\" : width;\n\n return (\n <SettingsRow\n {...rowProps}\n id={id}\n variant={stacked ? \"stacked\" : \"inline\"}\n controlLayout=\"wide\"\n last={last}\n >\n <Field\n id={id}\n type={type}\n inputMode={inputMode}\n value={effective}\n placeholder={placeholder}\n maxLength={maxLength}\n disabled={rowProps.disabled}\n onChange={(e) => {\n if (commitOnBlur) setDraft(e.target.value);\n else onValueChange(e.target.value);\n }}\n onBlur={() => {\n if (commitOnBlur && draft !== value) {\n onValueChange(draft);\n }\n }}\n onKeyDown={(e) => {\n if (commitOnBlur && e.key === \"Enter\")\n (e.currentTarget as HTMLInputElement).blur();\n }}\n className={widthClass[effectiveWidth]}\n />\n </SettingsRow>\n );\n}\n","import type { SettingsIconType as LucideIcon } from \"../icon-type\";\nimport type { SettingsBadge } from \"../types\";\n\n/**\n * A node in the settings hierarchy.\n * - Has children: renders as a category (expandable on desktop, push-nav on mobile)\n * - No children: renders as a leaf (clicking activates the tab)\n */\nexport type SettingsTreeNode = {\n id: string;\n label: string;\n icon?: LucideIcon | undefined;\n /** Short summary shown under the label in mobile drawer and tree hover. */\n description?: string | undefined;\n /** When provided, the node is a category with sub-nodes. */\n children?: SettingsTreeNode[] | undefined;\n /** The folder itself has a page in addition to its children. */\n navigable?: boolean | undefined;\n navigationLabel?: string | undefined;\n /** Inline badge: built-in variants from SettingsBadge, or the special \"unsaved\" string for a dot indicator. */\n badge?: SettingsBadge | \"unsaved\" | undefined;\n /** Disabled leaves/categories can't be activated/expanded. */\n disabled?: boolean | undefined;\n /** Free-text keywords searched alongside label/description. */\n searchKeywords?: string[] | undefined;\n};\n\n/** Flatten the tree into every destination, including folders with their own page. */\nexport function flattenLeaves(nodes: SettingsTreeNode[]): SettingsTreeNode[] {\n const out: SettingsTreeNode[] = [];\n const walk = (arr: SettingsTreeNode[]) => {\n for (const n of arr) {\n if (n.navigable || !n.children?.length) out.push(n);\n if (n.children?.length) walk(n.children);\n }\n };\n walk(nodes);\n return out;\n}\n\n/** Returns the ancestor id path for a target node id (excluding the target itself). */\nexport function findAncestorPath(\n nodes: SettingsTreeNode[],\n targetId: string,\n): string[] {\n const path: string[] = [];\n const visit = (arr: SettingsTreeNode[], trail: string[]): boolean => {\n for (const n of arr) {\n if (n.id === targetId) {\n path.push(...trail);\n return true;\n }\n if (n.children && visit(n.children, [...trail, n.id])) return true;\n }\n return false;\n };\n visit(nodes, []);\n return path;\n}\n\n/**\n * Build the mobile drawer stack for an externally selected setting.\n *\n * Deep links activate a leaf before the drawer mounts. The drawer must start\n * on that leaf, including every ancestor screen, rather than discarding the\n * active id and showing its root list.\n */\nexport function getDrawerPathForActiveId(\n nodes: SettingsTreeNode[],\n activeId: string | null,\n): string[] {\n if (!activeId || !findNodeById(nodes, activeId)) return [];\n return [...findAncestorPath(nodes, activeId), activeId];\n}\n\n/** Find a single node by id anywhere in the tree. */\nexport function findNodeById(\n nodes: SettingsTreeNode[],\n id: string,\n): SettingsTreeNode | null {\n for (const n of nodes) {\n if (n.id === id) return n;\n if (n.children) {\n const found = findNodeById(n.children, id);\n if (found) return found;\n }\n }\n return null;\n}\n\n/**\n * Returns an array of [id, matchScore] pairs ranked by relevance.\n * Matches label (highest), keywords, description. Case-insensitive.\n */\nexport function searchTree(\n nodes: SettingsTreeNode[],\n query: string,\n): Set<string> {\n const matches = new Set<string>();\n const q = query.trim().toLowerCase();\n if (!q) return matches;\n const walk = (arr: SettingsTreeNode[]) => {\n for (const n of arr) {\n const haystack = [\n n.label,\n n.description ?? \"\",\n ...(n.searchKeywords ?? []),\n ]\n .join(\" \")\n .toLowerCase();\n if (haystack.includes(q)) matches.add(n.id);\n if (n.children) walk(n.children);\n }\n };\n walk(nodes);\n return matches;\n}\n\n/**\n * Given a set of matching node ids, returns a set of every id that should be\n * visible — matching ids plus all their ancestors — so that the tree can keep\n * path structure when filtering.\n */\nexport function withAncestors(\n nodes: SettingsTreeNode[],\n ids: Set<string>,\n): Set<string> {\n const visible = new Set(ids);\n for (const id of ids) {\n for (const anc of findAncestorPath(nodes, id)) visible.add(anc);\n }\n return visible;\n}\n","\"use client\";\n\nimport { Loader2Icon as Loader2 } from \"../../icons\";\n\n/** lucide `slash` — the breadcrumb separator. */\nfunction Slash({ className }: { className?: string }) {\n return (\n <svg aria-hidden xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={2} strokeLinecap=\"round\" strokeLinejoin=\"round\" className={className}>\n <path d=\"M22 2 2 22\" />\n </svg>\n );\n}\nimport { type SettingsTreeNode, findAncestorPath, findNodeById } from \"./types\";\n\nimport { Button } from \"../../controls/controls\";\ntype SettingsBreadcrumbProps = {\n nodes: SettingsTreeNode[];\n activeId: string | null;\n /** Root label shown as the first crumb. */\n rootLabel?: string;\n /** Click handler for crumbs — usually navigates via the registry. */\n onNavigate?: (id: string | null) => void;\n /** Disables duplicate navigation and announces the active route change. */\n navigationPending?: boolean;\n};\n\n/**\n * Renders a compact breadcrumb trail for the active settings path:\n * \"Settings / Appearance / Theme\"\n */\nexport function SettingsBreadcrumb({\n nodes,\n activeId,\n rootLabel = \"Settings\",\n onNavigate,\n navigationPending = false,\n}: SettingsBreadcrumbProps) {\n const ancestors = activeId ? findAncestorPath(nodes, activeId) : [];\n const active = activeId ? findNodeById(nodes, activeId) : null;\n\n return (\n <nav\n aria-label=\"Breadcrumb\"\n aria-busy={navigationPending}\n className=\"flex min-w-0 items-center gap-1 overflow-x-auto type-secondary text-muted-foreground\"\n >\n <Crumb\n label={rootLabel}\n onClick={onNavigate ? () => onNavigate(null) : undefined}\n interactive\n disabled={navigationPending}\n />\n {ancestors.map((id) => {\n const node = findNodeById(nodes, id);\n if (!node) return null;\n return (\n <span key={id} className=\"flex min-w-0 items-center gap-1\">\n <Slash className=\"h-3 w-3 text-muted-foreground\" />\n <Crumb\n label={node.label}\n onClick={onNavigate ? () => onNavigate(id) : undefined}\n interactive\n disabled={navigationPending}\n />\n </span>\n );\n })}\n {active && (\n <span className=\"flex min-w-0 items-center gap-1\">\n <Slash className=\"h-3 w-3 text-muted-foreground\" />\n <span className=\"truncate font-medium text-foreground\">\n {active.label}\n </span>\n </span>\n )}\n {navigationPending ? (\n <Loader2\n className=\"ml-1 h-3.5 w-3.5 shrink-0 animate-spin\"\n aria-label=\"Opening settings section\"\n />\n ) : null}\n </nav>\n );\n}\n\nfunction Crumb({\n label,\n onClick,\n interactive,\n disabled,\n}: {\n label: string;\n onClick?: (() => void) | undefined;\n interactive?: boolean | undefined;\n disabled?: boolean | undefined;\n}) {\n if (interactive && onClick) {\n return (\n <Button variant=\"quiet\" onClick={onClick} disabled={disabled}>{label}</Button>\n );\n }\n return <span>{label}</span>;\n}\n","\"use client\";\n\nimport { useState, useMemo } from \"react\";\nimport { ChevronLeftIcon as ChevronLeft, ChevronRightIcon as ChevronRight, SettingsIcon as SettingsIcon, XIcon as X } from \"../../icons\";\nimport { Drawer, DrawerContent, DrawerTitle } from \"../../drawer\";\nimport { Button, SearchField } from \"../../controls/controls\";\nimport { Tile } from \"../../controls/surfaces\";\nimport {\n type SettingsTreeNode,\n findNodeById,\n getDrawerPathForActiveId,\n searchTree,\n flattenLeaves,\n} from \"./types\";\n\ntype SettingsDrawerNavProps = {\n nodes: SettingsTreeNode[];\n activeId: string | null;\n onActivate: (id: string) => void;\n /** Render the tab body for the active leaf node. */\n renderTab: (node: SettingsTreeNode) => React.ReactNode;\n open: boolean;\n onOpenChange: (open: boolean) => void;\n /** Title shown on the root screen header. */\n title?: string;\n unsavedIds?: Set<string> | undefined;\n};\n\n/**\n * iOS-style hierarchical push-nav inside a bottom drawer.\n *\n * Three screens:\n * 1. Root category/leaf list\n * 2. Sub-category list (slides in from right when category tapped)\n * 3. Leaf tab content (slides in from right when leaf tapped)\n *\n * Back button pops the stack. Closing the drawer resets the stack.\n */\nexport function SettingsDrawerNav({\n nodes,\n activeId,\n onActivate,\n renderTab,\n open,\n onOpenChange,\n title = \"Settings\",\n unsavedIds,\n}: SettingsDrawerNavProps) {\n // Path: list of node ids representing the current navigation stack.\n // - [] = root list\n // - [catId] = sub-list of catId (which must be a folder)\n // - [..., leafId] = leaf content (last is leaf)\n const [path, setPath] = useState<string[]>(() =>\n getDrawerPathForActiveId(nodes, activeId),\n );\n const [folderTabId, setFolderTabId] = useState<string | null>(() =>\n activeId && findNodeById(nodes, activeId)?.navigable ? activeId : null,\n );\n const [query, setQuery] = useState(\"\");\n\n const handleOpenChange = (next: boolean) => {\n if (!next) {\n setPath([]);\n setFolderTabId(null);\n setQuery(\"\");\n }\n onOpenChange(next);\n };\n\n const pushId = (id: string) => setPath((p) => [...p, id]);\n const popOne = () => {\n if (folderTabId) setFolderTabId(null);\n else setPath((p) => p.slice(0, -1));\n };\n\n const currentId = path[path.length - 1] ?? null;\n const currentNode = currentId ? findNodeById(nodes, currentId) : null;\n const isLeaf = Boolean(\n currentNode && (!currentNode.children?.length || folderTabId === currentId),\n );\n\n // The list-of-nodes shown in the current screen (root or category)\n const listNodes = useMemo<SettingsTreeNode[]>(() => {\n if (!currentNode || isLeaf) return nodes;\n return currentNode.children ?? [];\n }, [currentNode, isLeaf, nodes]);\n\n // Search only applies at the root screen for simplicity — gives a flat result\n const searchMatches = useMemo(() => {\n if (!query.trim()) return null;\n const matched = searchTree(nodes, query);\n return flattenLeaves(nodes).filter((l) => matched.has(l.id));\n }, [nodes, query]);\n\n const handleItemTap = (node: SettingsTreeNode) => {\n if (node.disabled) return;\n if (node.children && node.children.length > 0) {\n pushId(node.id);\n setQuery(\"\");\n } else {\n onActivate(node.id);\n pushId(node.id);\n setQuery(\"\");\n }\n };\n\n const headerTitle = isLeaf\n ? currentNode?.label\n : currentNode\n ? currentNode.label\n : title;\n const backLabel = folderTabId\n ? (currentNode?.label ?? title)\n : path.length > 1\n ? (findNodeById(nodes, path[path.length - 2] ?? \"\")?.label ?? title)\n : title;\n\n return (\n <Drawer open={open} onOpenChange={handleOpenChange}>\n <DrawerContent className=\"h-[85dvh] flex flex-col\">\n <DrawerTitle className=\"sr-only\">{title}</DrawerTitle>\n\n {/* Header */}\n <div className=\"flex items-center justify-between gap-2 px-3 py-2.5 border-b border-border shrink-0\">\n {path.length === 0 ? (\n <div className=\"flex items-center gap-2 min-w-0\">\n <SettingsIcon className=\"h-4 w-4 text-muted-foreground shrink-0\" />\n <span className=\"type-title truncate\">{title}</span>\n </div>\n ) : (\n <Button\n type=\"button\"\n variant=\"quiet\"\n icon={<ChevronLeft className=\"h-4 w-4\" />}\n onClick={popOne}\n className=\"min-w-0 max-w-[calc(100%-5rem)] -ml-2\"\n >\n {backLabel}\n </Button>\n )}\n <div className=\"flex-1 flex items-center justify-center min-w-0 px-2\">\n {path.length > 0 && (\n <span className=\"type-title truncate\">\n {headerTitle}\n </span>\n )}\n </div>\n <Button\n type=\"button\"\n variant=\"quiet\"\n aria-label=\"Close\"\n icon={<X className=\"h-4 w-4\" />}\n onClick={() => handleOpenChange(false)}\n />\n </div>\n\n {/* Screen stack: only the current screen is rendered, with slide animation */}\n <div className=\"flex-1 min-h-0 overflow-hidden relative\">\n <div\n key={path.join(\"/\") || \"root\"}\n className=\"absolute inset-0 overflow-y-auto overscroll-contain\"\n style={path.length > 0 ? { animation: \"drawerPush 180ms cubic-bezier(0.4, 0, 0.2, 1) both\" } : undefined}\n >\n {isLeaf && currentNode ? (\n <div className=\"pb-safe\">{renderTab(currentNode)}</div>\n ) : (\n <>\n {/* Search bar only on the root screen */}\n {path.length === 0 && (\n <div className=\"relative px-3 py-2 border-b border-border sticky top-0 bg-background z-10\">\n <SearchField\n placeholder=\"Search settings\"\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n end={query ? <span aria-hidden=\"true\" className=\"w-7 shrink-0\" /> : undefined}\n className=\"w-full\"\n />\n {query && (\n <Button\n type=\"button\"\n variant=\"quiet\"\n aria-label=\"Clear search\"\n icon={<X className=\"h-4 w-4\" />}\n onClick={() => setQuery(\"\")}\n className=\"absolute right-5 top-1/2 -translate-y-1/2\"\n />\n )}\n </div>\n )}\n\n {searchMatches ? (\n <div className=\"pb-safe\">\n {searchMatches.length === 0 ? (\n <div className=\"px-4 py-8 text-center type-body text-muted-foreground\">\n No settings match \"{query}\".\n </div>\n ) : (\n searchMatches.map((n) => (\n <DrawerRow\n key={n.id}\n node={n}\n activeId={activeId}\n hasChevron\n onTap={handleItemTap}\n unsavedIds={unsavedIds}\n />\n ))\n )}\n </div>\n ) : (\n <div className=\"pb-safe\">\n {currentNode?.navigable ? (\n <DrawerRow\n node={{\n ...currentNode,\n label:\n currentNode.navigationLabel ?? currentNode.label,\n children: undefined,\n }}\n activeId={activeId}\n hasChevron\n onTap={() => {\n onActivate(currentNode.id);\n setFolderTabId(currentNode.id);\n }}\n unsavedIds={unsavedIds}\n />\n ) : null}\n {listNodes.map((n) => (\n <DrawerRow\n key={n.id}\n node={n}\n activeId={activeId}\n hasChevron\n onTap={handleItemTap}\n unsavedIds={unsavedIds}\n />\n ))}\n </div>\n )}\n </>\n )}\n </div>\n </div>\n\n <style>{`\n @keyframes drawerPush {\n from {\n transform: translateX(24%);\n opacity: 0;\n }\n to {\n transform: translateX(0%);\n opacity: 1;\n }\n }\n `}</style>\n </DrawerContent>\n </Drawer>\n );\n}\n\ntype DrawerRowProps = {\n node: SettingsTreeNode;\n activeId: string | null;\n hasChevron: boolean;\n onTap: (node: SettingsTreeNode) => void;\n unsavedIds?: Set<string> | undefined;\n};\n\nfunction DrawerRow({\n node,\n activeId,\n hasChevron,\n onTap,\n unsavedIds,\n}: DrawerRowProps) {\n const isActive = node.id === activeId;\n const hasUnsaved = unsavedIds?.has(node.id) ?? node.badge === \"unsaved\";\n\n return (\n <Tile\n type=\"button\"\n onClick={() => onTap(node)}\n disabled={node.disabled}\n variant=\"quiet\"\n selected={isActive}\n className=\"w-full\"\n icon={node.icon ? <node.icon className=\"h-4 w-4\" /> : undefined}\n title={<span className=\"flex items-center gap-1.5\">{node.label}{hasUnsaved ? <span aria-label=\"Unsaved changes\" className=\"h-1.5 w-1.5 rounded-full bg-primary shrink-0\" /> : null}</span>}\n line={node.description}\n end={hasChevron ? <ChevronRight className=\"h-4 w-4 text-muted-foreground shrink-0\" /> : undefined}\n />\n );\n}\n","\"use client\";\n\n/**\n * Drawer — the vaul drawer family, and the package's iOS-mobile-first surface.\n *\n * WHY IT IS HERE. matrx-frontend's `components/ui/drawer.tsx` had 121 import\n * sites, and that host's own doctrine is \"Drawer, not Dialog, on mobile\" — so\n * the drawer is the surface most of this platform's mobile UX lands on. It was\n * also the LAST place still holding a copy of `RadixDialogModalProvider`, the\n * context this package already owned: a host copy of a React CONTEXT is the\n * quiet twin, because `useContext` matches by object identity, so the host\n * Drawer's provider and the package Sheet's consumer were two different\n * contexts that merely looked alike. Shipping the Drawer here closes that.\n *\n * `BottomSheet` (this package) previously inlined its own private vaul\n * wrappers because no Drawer existed to share; it now composes these, so there\n * is one vaul wrapper in the package rather than two.\n *\n * THE MOBILE-FIRST RULES THIS COMPONENT OWNS (so no host re-derives them):\n *\n * 1. `dvh`, NEVER `vh`. iOS Safari's `vh` is the tallest-possible viewport, so\n * a `vh`-capped drawer hides its own footer behind the browser chrome. The\n * cap is `max-h-[90dvh]`, and `size=\"full\"` is `h-dvh`.\n * 2. THE SAFE AREA IS PADDING, NOT A GUESS. Content bottom padding is\n * `pb-safe` (`env(safe-area-inset-bottom)`; shipped in `styles.css`), so the\n * home indicator never sits on top of the last control.\n * 3. THE GRAB HANDLE IS A 44px TARGET. The visible pill is 4px tall; it lives\n * inside a `min-h-11` (44px) grab area, the Apple HIG minimum. The old host\n * copy shipped the pill alone, so the affordance was three times smaller\n * than the gesture it advertises.\n * 4. THE BODY SCROLLS, THE FOOTER DOES NOT. `DrawerBody` is the\n * `flex-1 min-h-0 overflow-y-auto overscroll-contain` shard;\n * `DrawerFooter` is `mt-auto` and safe-area padded, so the primary action\n * is reachable however long the body is.\n * 5. A FIELD UNDER 16px ZOOMS iOS IN AND NEVER BACK OUT — the drawer's own\n * text scale therefore never goes below `text-base` on coarse pointers;\n * the floor itself is a host CSS concern, restated in `styles.css`.\n *\n * `direction` is forwarded to vaul and drives the content geometry, so a side\n * or top drawer is a prop rather than a fork.\n */\n\nimport { treeContainsComponent } from \"@ai-matrx/kit/react-tree\";\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\n\nimport { cn } from \"./cn\";\nimport { keepFloatingLayersInside, useModalLayer } from \"./floating-layer\";\nimport { RadixDialogModalProvider } from \"./radix-dialog-modal-context\";\n\nexport type DrawerDirection = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nconst DrawerDirectionContext = React.createContext<DrawerDirection>(\"bottom\");\n\n/** The direction of the nearest Drawer root. */\nexport const useDrawerDirection = (): DrawerDirection =>\n React.useContext(DrawerDirectionContext);\n\n/**\n * `vaul`'s Root props are a DISCRIMINATED UNION (the snap-point branch adds\n * `fadeFromIndex`), so this type intersects the union rather than `Omit`-ing\n * from it — flattening the union collapses the discriminant and makes every\n * snap-point drawer a type error.\n *\n * Vaul does not forward `modal={false}` to its underlying Radix root, so a\n * \"non-modal\" drawer would claim ARIA semantics it does not have; the type\n * refuses the value rather than shipping the lie.\n */\nexport type DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root> & {\n modal?: true;\n direction?: DrawerDirection;\n};\n\nconst Drawer = ({\n children,\n shouldScaleBackground = true,\n onOpenChange,\n ...props\n}: DrawerProps) => {\n const direction: DrawerDirection = props.direction ?? \"bottom\";\n const handleOpenChange = (open: boolean) => {\n if (\n open &&\n typeof document !== \"undefined\" &&\n document.activeElement instanceof HTMLElement\n ) {\n // Vaul applies aria-hidden to the application tree synchronously, before\n // Radix transfers focus into the portalled dialog. Release the trigger\n // first so a focused descendant is never hidden from assistive tech.\n document.activeElement.blur();\n }\n onOpenChange?.(open);\n };\n return (\n <RadixDialogModalProvider modal>\n <DrawerDirectionContext.Provider value={direction}>\n <DrawerPrimitive.Root\n modal\n shouldScaleBackground={shouldScaleBackground}\n {...props}\n onOpenChange={handleOpenChange}\n direction={direction}\n >\n {children}\n </DrawerPrimitive.Root>\n </DrawerDirectionContext.Provider>\n </RadixDialogModalProvider>\n );\n};\nDrawer.displayName = \"Drawer\";\n\nconst DrawerTrigger = DrawerPrimitive.Trigger;\nconst DrawerPortal = DrawerPrimitive.Portal;\nconst DrawerClose = DrawerPrimitive.Close;\n\nconst DrawerOverlay = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Overlay\n ref={ref}\n data-slot=\"drawer-overlay\"\n className={cn(\n \"fixed inset-0 z-[10000] bg-[var(--matrx-overlay-scrim)]\",\n className,\n )}\n {...props}\n />\n));\nDrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;\n\nconst DrawerDescription = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Description\n ref={ref}\n data-slot=\"drawer-description\"\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n/**\n * Unstyled, non-portalling Content for custom Drawer layouts. It derives\n * explicit modal semantics while vaul retains focus/background behavior.\n */\nconst DrawerContentPrimitive = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>\n>(({ onInteractOutside, ...props }, ref) => {\n // A drawer is always modal: floating layers opened from it stack above its\n // scrim, and a press inside one is not an outside press (floating-layer.tsx).\n useModalLayer(true);\n return (\n <DrawerPrimitive.Content\n // NO SLIDE-IN (styles.css, `[data-matrx-entrance=\"none\"]`). Measured on\n // a 375x812 phone (PB-08, 2026-10-01): for ~250 ms after open the spot\n // where a row settles was still the SCRIM, so a tap there was an outside\n // press and closed the sheet; for the next ~150 ms it was a DIFFERENT\n // row. The sheet is therefore at rest from its first frame; the scrim\n // still fades and the exit still slides. Same class as the composer\n // menu's popper entrance (matrx-frontend 286ef577fb).\n data-matrx-entrance=\"none\"\n {...props}\n ref={ref}\n aria-modal=\"true\"\n onInteractOutside={keepFloatingLayersInside(onInteractOutside)}\n />\n );\n});\nDrawerContentPrimitive.displayName = \"DrawerContentPrimitive\";\n\n/**\n * `adaptive` (default) sizes to content up to 90dvh — right for one short\n * list. `full` is ONE fixed height that never changes as content changes: use\n * it for any drawer whose body varies (tabs, search results, multi-level\n * navigation), because an adaptive drawer there resizes under the user's thumb\n * on every keystroke, which reads as the panel jumping.\n */\nexport type DrawerSize = \"adaptive\" | \"full\";\n\nconst DIRECTION_CLASSES: Record<DrawerDirection, string> = {\n bottom:\n \"inset-x-0 bottom-0 mt-24 flex-col rounded-t-[10px] border-t pb-safe\",\n top: \"inset-x-0 top-0 mb-24 flex-col rounded-b-[10px] border-b pt-safe\",\n left: \"inset-y-0 left-0 mr-24 flex-row rounded-r-[10px] border-r\",\n right: \"inset-y-0 right-0 ml-24 flex-row rounded-l-[10px] border-l\",\n};\n\nconst SIZE_CLASSES: Record<DrawerDirection, Record<DrawerSize, string>> = {\n bottom: { adaptive: \"h-auto max-h-[90dvh]\", full: \"h-[92dvh]\" },\n top: { adaptive: \"h-auto max-h-[90dvh]\", full: \"h-[92dvh]\" },\n left: { adaptive: \"w-auto max-w-[92vw]\", full: \"h-dvh w-[92vw] max-w-sm\" },\n right: { adaptive: \"w-auto max-w-[92vw]\", full: \"h-dvh w-[92vw] max-w-sm\" },\n};\n\nexport interface DrawerContentProps\n extends React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content> {\n /** Height/width posture. Default `adaptive`. */\n size?: DrawerSize;\n /** Render the drag-handle pill. Default: only for `top`/`bottom` drawers. */\n showHandle?: boolean;\n}\n\nconst DrawerContent = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Content>,\n DrawerContentProps\n>(({ className, children, size = \"adaptive\", showHandle, ...props }, ref) => {\n const direction = useDrawerDirection();\n const hasDescription =\n treeContainsComponent(children, DrawerDescription) ||\n treeContainsComponent(children, DrawerPrimitive.Description);\n const withHandle =\n showHandle ?? (direction === \"bottom\" || direction === \"top\");\n\n return (\n <DrawerPortal>\n <DrawerOverlay />\n <DrawerContentPrimitive\n ref={ref}\n data-slot=\"drawer-content\"\n data-direction={direction}\n className={cn(\n \"fixed z-[10000] flex min-w-0 border bg-background\",\n DIRECTION_CLASSES[direction],\n SIZE_CLASSES[direction][size],\n className,\n )}\n {...(hasDescription ? {} : { \"aria-describedby\": undefined })}\n {...props}\n >\n {withHandle ? (\n // Rule 3: the pill is 4px; the TARGET is 44px.\n <div\n aria-hidden\n data-slot=\"drawer-handle\"\n className={cn(\n \"flex min-h-11 w-full shrink-0 cursor-grab items-center justify-center active:cursor-grabbing\",\n direction === \"top\" && \"order-last\",\n )}\n >\n <div className=\"h-1 w-[100px] rounded-full bg-muted\" />\n </div>\n ) : null}\n {children}\n </DrawerContentPrimitive>\n </DrawerPortal>\n );\n});\nDrawerContent.displayName = \"DrawerContent\";\n\nconst DrawerHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n \"grid shrink-0 gap-1.5 p-4 text-center sm:text-left\",\n className,\n )}\n {...props}\n />\n);\nDrawerHeader.displayName = \"DrawerHeader\";\n\n/**\n * The scroll shard. `flex-1 min-h-0` is the pair that actually bounds a scroll\n * area inside a flex column — `flex-1` alone leaves `min-height: auto`, and the\n * body grows past the drawer instead of scrolling inside it.\n */\nconst DrawerBody = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n data-slot=\"drawer-body\"\n className={cn(\"min-h-0 flex-1 overflow-y-auto overscroll-contain px-4\", className)}\n {...props}\n />\n);\nDrawerBody.displayName = \"DrawerBody\";\n\nconst DrawerFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n data-slot=\"drawer-footer\"\n className={cn(\"mt-auto flex shrink-0 flex-col gap-2 p-4 pb-safe\", className)}\n {...props}\n />\n);\nDrawerFooter.displayName = \"DrawerFooter\";\n\nconst DrawerTitle = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n data-slot=\"drawer-title\"\n className={cn(\n \"text-lg font-semibold leading-none tracking-tight\",\n className,\n )}\n {...props}\n />\n));\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\nexport {\n Drawer,\n DrawerBody,\n DrawerClose,\n DrawerContent,\n DrawerContentPrimitive,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerOverlay,\n DrawerPortal,\n DrawerTitle,\n DrawerTrigger,\n};\n","\"use client\";\n\nimport { useEffect, useRef, useState, type ReactNode } from \"react\";\nimport {\n filterSettingsNavigationSections,\n SettingsFlatNavigation,\n SettingsNavigationSearch,\n settingsNavigationSections,\n} from \"../navigation/SettingsFlatNavigation\";\nimport { Tile } from \"../../controls/surfaces\";\nimport type { SettingsTreeNode } from \"./types\";\n\ntype SettingsTreeProps = {\n nodes: SettingsTreeNode[];\n activeId: string | null;\n onActivate: (id: string) => void;\n unsavedIds?: Set<string>;\n searchable?: boolean;\n query?: string;\n onQueryChange?: (query: string) => void;\n searchResults?: ReactNode;\n hasSearchResults?: boolean;\n};\n\n/**\n * The overlay's settings navigation shares the route menu's flat section model.\n * Folder state is deliberately absent: headings provide orientation and every\n * available setting remains reachable without an accordion interaction.\n */\nexport function SettingsTree({\n nodes,\n activeId,\n onActivate,\n unsavedIds,\n searchable = true,\n query: controlledQuery,\n onQueryChange,\n searchResults,\n hasSearchResults = false,\n}: SettingsTreeProps) {\n const [internalQuery, setInternalQuery] = useState(\"\");\n const query = controlledQuery ?? internalQuery;\n const setQuery = onQueryChange ?? setInternalQuery;\n const searchRef = useRef<HTMLInputElement | null>(null);\n const treeRef = useRef<HTMLDivElement | null>(null);\n const sections = filterSettingsNavigationSections(settingsNavigationSections(nodes), query);\n\n useEffect(() => {\n const element = treeRef.current;\n if (!element) return undefined;\n const onKey = (event: KeyboardEvent) => {\n if (event.key === \"/\" && document.activeElement !== searchRef.current) {\n event.preventDefault();\n searchRef.current?.focus();\n }\n };\n element.addEventListener(\"keydown\", onKey);\n return () => element.removeEventListener(\"keydown\", onKey);\n }, []);\n\n return (\n <div ref={treeRef} className=\"flex h-full flex-col border-r border-border bg-card/20\" aria-label=\"Settings navigation\">\n {searchable ? <div className=\"shrink-0 border-b border-border px-2 py-2\"><SettingsNavigationSearch value={query} onValueChange={setQuery} inputRef={searchRef} /></div> : null}\n <div className=\"flex-1 overflow-y-auto py-1\">\n {searchResults}\n {sections.length > 0 ? <SettingsFlatNavigation\n sections={sections}\n activeId={activeId}\n renderItem={(item, active) => {\n const unsaved = unsavedIds?.has(item.id) ?? item.node.badge === \"unsaved\";\n return <Tile id={`settings-nav-${item.id}`} type=\"button\" disabled={item.node.disabled} onClick={() => !item.node.disabled && onActivate(item.id)} dense variant=\"quiet\" selected={active} className=\"w-full\" icon={item.node.icon ? <item.node.icon className=\"h-3.5 w-3.5 shrink-0 text-muted-foreground\" /> : undefined} title={item.label} end={unsaved ? <span aria-label=\"Unsaved changes\" className=\"h-1.5 w-1.5 shrink-0 rounded-full bg-primary\" /> : undefined} aria-current={active ? \"page\" : undefined} />;\n }}\n /> : !hasSearchResults ? <p className=\"px-3 py-6 type-body text-muted-foreground\">{query ? `No settings match \"${query}\".` : \"No settings available.\"}</p> : null}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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Q,iBAAiB,WAAW,KAAK;AACzC,WAAO,MAAM,QAAQ,oBAAoB,WAAW,KAAK;AAAA,EAC3D,GAAG,CAAC,CAAC;AAEL,SACE,+CAAC,SAAI,KAAK,SAAS,WAAU,0DAAyD,cAAW,uBAC9F;AAAA,iBAAa,8CAAC,SAAI,WAAU,6CAA4C,wDAAC,4BAAyB,OAAO,OAAO,eAAe,UAAU,UAAU,WAAW,GAAE,IAAS;AAAA,IAC1K,+CAAC,SAAI,WAAU,+BACZ;AAAA;AAAA,MACA,SAAS,SAAS,IAAI;AAAA,QAAC;AAAA;AAAA,UACtB;AAAA,UACA;AAAA,UACA,YAAY,CAAC,MAAM,WAAW;AAC5B,kBAAM,UAAU,YAAY,IAAI,KAAK,EAAE,KAAK,KAAK,KAAK,UAAU;AAChE,mBAAO,8CAAC,QAAK,IAAI,gBAAgB,KAAK,EAAE,IAAI,MAAK,UAAS,UAAU,KAAK,KAAK,UAAU,SAAS,MAAM,CAAC,KAAK,KAAK,YAAY,WAAW,KAAK,EAAE,GAAG,OAAK,MAAC,SAAQ,SAAQ,UAAU,QAAQ,WAAU,UAAS,MAAM,KAAK,KAAK,OAAO,8CAAC,KAAK,KAAK,MAAV,EAAe,WAAU,8CAA6C,IAAK,QAAW,OAAO,KAAK,OAAO,KAAK,UAAU,8CAAC,UAAK,cAAW,mBAAkB,WAAU,gDAA+C,IAAK,QAAW,gBAAc,SAAS,SAAS,QAAW;AAAA,UACvf;AAAA;AAAA,MACF,IAAK,CAAC,mBAAmB,8CAAC,OAAE,WAAU,6CAA6C,kBAAQ,sBAAsB,KAAK,OAAO,0BAAyB,IAAO;AAAA,OAC/J;AAAA,KACF;AAEJ;","names":["HostLink","import_jsx_runtime","Anchor","import_jsx_runtime","import_jsx_runtime","import_react_slot","React","React","import_jsx_runtime","import_react_slot","React","import_jsx_runtime","React","import_jsx_runtime","import_react_slot","React","import_class_variance_authority","React","import_jsx_runtime","React","React","import_jsx_runtime","import_jsx_runtime","Button","Textarea","import_jsx_runtime","Button","import_jsx_runtime","Icon","import_jsx_runtime","import_react","import_react","import_jsx_runtime","import_react","import_react","React","import_jsx_runtime","import_react","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","tooltipSide","TapTargetButton","TapTargetButtonTransparent","TapTargetButtonOutline","TapTargetButtonSolid","TapTargetButtonDestructive","TapTargetButtonForGroup","import_react","import_jsx_runtime","SLOT","import_jsx_runtime","Wrap","import_jsx_runtime","Icon","Button","import_jsx_runtime","Icon","import_jsx_runtime","import_react","import_jsx_runtime","Button","import_react","import_jsx_runtime","Icon","import_jsx_runtime","Icon","import_jsx_runtime","Button","import_react","import_jsx_runtime","Button","import_react","React","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime","Button","import_react","import_jsx_runtime","import_react","import_jsx_runtime","Button","import_react","import_jsx_runtime","Icon","import_react","React","import_jsx_runtime","Popover","import_jsx_runtime","Button","Popover","import_react","import_jsx_runtime","widthClass","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","DialogPrimitive","React","React","import_jsx_runtime","React","import_jsx_runtime","CONTEXT_SLOT","contextRegistry","import_jsx_runtime","CommandPrimitive","CommandPrimitive","import_jsx_runtime","widthClass","Popover","Button","import_react","React","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","widthClass","visible","import_jsx_runtime","Button","import_react","React","import_jsx_runtime","DrawerPrimitive","import_jsx_runtime","Button","import_react","import_jsx_runtime"]}
|