@vantageos/mosaic-blocks 0.5.35-alpha → 0.5.36-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/README.md +9 -8
  2. package/dist/index.cjs +338 -40
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +231 -11
  5. package/dist/index.d.ts +231 -11
  6. package/dist/index.js +328 -41
  7. package/dist/index.js.map +1 -1
  8. package/dist/styles.css +18 -0
  9. package/package.json +12 -7
  10. package/r/mosaic-accordion.json +1 -2
  11. package/r/mosaic-activity-feed.json +16 -0
  12. package/r/mosaic-adaptive-grid.json +18 -0
  13. package/r/mosaic-adaptive-modal.json +18 -0
  14. package/r/mosaic-adaptive-navigation.json +18 -0
  15. package/r/mosaic-add-memory-form.json +25 -0
  16. package/r/mosaic-admin-only-guard.json +18 -0
  17. package/r/mosaic-agent-builder-modal.json +23 -0
  18. package/r/mosaic-agent-card.json +16 -0
  19. package/r/mosaic-agent-chat.json +26 -0
  20. package/r/mosaic-agent-composer.json +28 -0
  21. package/r/mosaic-agent-editor.json +25 -0
  22. package/r/mosaic-agent-list.json +21 -0
  23. package/r/mosaic-agent-preview.json +21 -0
  24. package/r/mosaic-alert-dialog.json +23 -0
  25. package/r/mosaic-animated-list.json +16 -0
  26. package/r/mosaic-api-key-panel.json +21 -0
  27. package/r/mosaic-app-sidebar.json +18 -0
  28. package/r/mosaic-approval-prompt.json +21 -0
  29. package/r/mosaic-artifact-canvas-adapter.json +26 -0
  30. package/r/mosaic-artifact-chart.json +18 -0
  31. package/r/mosaic-artifact-checklist.json +18 -0
  32. package/r/mosaic-artifact-data-table.json +18 -0
  33. package/r/mosaic-artifact-document.json +16 -0
  34. package/r/mosaic-artifact-library.json +18 -0
  35. package/r/mosaic-artifact-save-as-memory-form.json +24 -0
  36. package/r/mosaic-artifact-version-history.json +16 -0
  37. package/r/mosaic-avatar.json +18 -0
  38. package/r/mosaic-badge.json +23 -0
  39. package/r/mosaic-blurred-orb.json +16 -0
  40. package/r/mosaic-button.json +24 -0
  41. package/r/mosaic-callout.json +23 -0
  42. package/r/mosaic-card.json +16 -0
  43. package/r/mosaic-chat-composer.json +21 -0
  44. package/r/mosaic-chat-message.json +23 -0
  45. package/r/mosaic-chat-sidebar.json +21 -0
  46. package/r/mosaic-chat-thread.json +21 -0
  47. package/r/mosaic-checkbox.json +18 -0
  48. package/r/mosaic-clerk-org-switcher.json +18 -0
  49. package/r/mosaic-clerk-webhook-handler.json +18 -0
  50. package/r/mosaic-collapsible.json +18 -0
  51. package/r/mosaic-combobox.json +18 -0
  52. package/r/mosaic-counter.json +16 -0
  53. package/r/mosaic-dashboard-content.json +18 -0
  54. package/r/mosaic-dashboard-header.json +18 -0
  55. package/r/mosaic-dashboard-layout.json +20 -0
  56. package/r/mosaic-data-table.json +16 -0
  57. package/r/mosaic-delete-confirmation-dialog.json +18 -0
  58. package/r/mosaic-device-provider.json +16 -0
  59. package/r/mosaic-document-table.json +52 -0
  60. package/r/mosaic-document-upload.json +21 -0
  61. package/r/mosaic-drawer.json +23 -0
  62. package/r/mosaic-dropdown-menu.json +18 -0
  63. package/r/mosaic-edit-memory-dialog.json +27 -0
  64. package/r/mosaic-edit-session-dialog.json +25 -0
  65. package/r/mosaic-editable-cell.json +23 -0
  66. package/r/mosaic-empty-state.json +16 -0
  67. package/r/mosaic-falling-pattern.json +16 -0
  68. package/r/mosaic-feature-3col.json +16 -0
  69. package/r/mosaic-feature-centered-media.json +16 -0
  70. package/r/mosaic-field.json +18 -0
  71. package/r/mosaic-filter-bar.json +18 -0
  72. package/r/mosaic-filter-sidebar.json +18 -0
  73. package/r/mosaic-footer-simple.json +16 -0
  74. package/r/mosaic-hero-split.json +16 -0
  75. package/r/mosaic-input-group.json +16 -0
  76. package/r/mosaic-input.json +18 -0
  77. package/r/mosaic-integrations-badge.json +16 -0
  78. package/r/mosaic-kanban-board.json +21 -0
  79. package/r/mosaic-logos-grid.json +16 -0
  80. package/r/mosaic-main-nav.json +18 -0
  81. package/r/mosaic-markdown.json +21 -0
  82. package/r/mosaic-marketplace-card.json +24 -0
  83. package/r/mosaic-marketplace-list.json +20 -0
  84. package/r/mosaic-match-input.json +23 -0
  85. package/r/mosaic-memory-card.json +21 -0
  86. package/r/mosaic-memory-dashboard.json +23 -0
  87. package/r/mosaic-memory-grid.json +21 -0
  88. package/r/mosaic-memory-list.json +21 -0
  89. package/r/mosaic-memory-search.json +23 -0
  90. package/r/mosaic-mention-input.json +23 -0
  91. package/r/mosaic-message-card.json +16 -0
  92. package/r/mosaic-message-list.json +19 -0
  93. package/r/mosaic-message-search.json +18 -0
  94. package/r/mosaic-model-selector.json +23 -0
  95. package/r/mosaic-module-card.json +16 -0
  96. package/r/mosaic-module-library.json +18 -0
  97. package/r/mosaic-multi-tenant-provider.json +19 -0
  98. package/r/mosaic-navbar.json +16 -0
  99. package/r/mosaic-org-context-display.json +18 -0
  100. package/r/mosaic-org-panel.json +19 -0
  101. package/r/mosaic-org-profile-page.json +18 -0
  102. package/r/mosaic-org-switcher.json +16 -0
  103. package/r/mosaic-pdf-viewer.json +23 -0
  104. package/r/mosaic-popover.json +23 -0
  105. package/r/mosaic-preferences-panel.json +18 -0
  106. package/r/mosaic-pricing-card.json +16 -0
  107. package/r/mosaic-profile-panel.json +18 -0
  108. package/r/mosaic-progress.json +18 -0
  109. package/r/mosaic-quick-action-card.json +16 -0
  110. package/r/mosaic-quick-actions-menu.json +18 -0
  111. package/r/mosaic-quick-agent-selector.json +19 -0
  112. package/r/mosaic-radio-group.json +18 -0
  113. package/r/mosaic-reply-input.json +21 -0
  114. package/r/mosaic-resizable-split-pane.json +23 -0
  115. package/r/mosaic-save-chat-as-memory-form.json +25 -0
  116. package/r/mosaic-save-template-modal.json +27 -0
  117. package/r/mosaic-scroll-area.json +18 -0
  118. package/r/mosaic-select.json +18 -0
  119. package/r/mosaic-selector-modal.json +18 -0
  120. package/r/mosaic-separator.json +18 -0
  121. package/r/mosaic-session-card.json +24 -0
  122. package/r/mosaic-session-list.json +21 -0
  123. package/r/mosaic-sign-in-layout.json +18 -0
  124. package/r/mosaic-sign-up-layout.json +18 -0
  125. package/r/mosaic-skeleton.json +23 -0
  126. package/r/mosaic-slider.json +18 -0
  127. package/r/mosaic-stats-grid.json +16 -0
  128. package/r/mosaic-step-pipeline.json +21 -0
  129. package/r/mosaic-switch.json +18 -0
  130. package/r/mosaic-tabs.json +18 -0
  131. package/r/mosaic-tag-input.json +23 -0
  132. package/r/mosaic-template-agent-card.json +21 -0
  133. package/r/mosaic-template-category-chips.json +21 -0
  134. package/r/mosaic-template-gallery.json +20 -0
  135. package/r/mosaic-template-list.json +21 -0
  136. package/r/mosaic-template-management-panel.json +25 -0
  137. package/r/mosaic-testimonials-grid.json +16 -0
  138. package/r/mosaic-textarea.json +16 -0
  139. package/r/mosaic-theme-provider.json +18 -0
  140. package/r/mosaic-theme-toggle.json +16 -0
  141. package/r/mosaic-thread-indicator.json +21 -0
  142. package/r/mosaic-thread-view.json +21 -0
  143. package/r/mosaic-toast.json +28 -0
  144. package/r/mosaic-tool-toggle-list.json +23 -0
  145. package/r/mosaic-tooltip.json +18 -0
  146. package/r/mosaic-url-scraper.json +21 -0
  147. package/r/mosaic-user-button.json +18 -0
  148. package/r/use-effective-workspace-id.json +18 -0
  149. package/registry.json +35 -130
@@ -0,0 +1,28 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-agent-composer",
4
+ "title": "MosaicAgentComposer",
5
+ "description": "Responsive-pair agent composer: auto-selects Desktop (2-column with live preview) or Mobile (single-column + sticky CTA) via useDevice. Shared props contract: agentName, customInstructions, 4 module slots (role/persona/framework/model), labels override. Generic MosaicComposerModule type — no domain coupling.",
6
+ "dependencies": [],
7
+ "registryDependencies": [
8
+ "https://cdn.jsdelivr.net/npm/@vantageos/mosaic-blocks@0.5.36-alpha/r/mosaic-device-provider.json"
9
+ ],
10
+ "files": [
11
+ {
12
+ "path": "src/components/agent-composer/MosaicAgentComposer.tsx",
13
+ "type": "registry:ui",
14
+ "content": "\"use client\";\n\n/**\n * MosaicAgentComposer — responsive-pair orchestrator\n *\n * Selects MosaicAgentComposerDesktop or MosaicAgentComposerMobile based on\n * useDevice(). Both variants share the same MosaicAgentComposerProps contract.\n *\n * This is the canonical responsive-pair pattern from the upstream source:\n * orchestrator reads device → delegates to the correct variant → caller never\n * needs to know which renders.\n *\n * Both sub-components are also exported from src/index.ts for consumers who\n * want to bypass device detection and render a specific variant directly.\n *\n * Must be wrapped in MosaicDeviceProvider.\n */\n\n// React import not needed — JSX transform handles it\nimport { useDevice } from \"@/components/ui/MosaicDeviceProvider\";\nimport { MosaicAgentComposerDesktop } from \"./MosaicAgentComposerDesktop.js\";\nimport type { MosaicAgentComposerDesktopProps } from \"./MosaicAgentComposerDesktop.js\";\nimport { MosaicAgentComposerMobile } from \"./MosaicAgentComposerMobile.js\";\nimport type { MosaicAgentComposerMobileProps } from \"./MosaicAgentComposerMobile.js\";\n\n// Re-export shared types for convenience\nexport type { MosaicAgentComposerProps } from \"./MosaicAgentComposerDesktop.js\";\nexport type { MosaicAgentComposerDesktopProps } from \"./MosaicAgentComposerDesktop.js\";\nexport type { MosaicAgentComposerMobileProps } from \"./MosaicAgentComposerMobile.js\";\nexport type { MosaicComposerModule, MosaicComposerModel } from \"./MosaicAgentComposerDesktop.js\";\n\n/**\n * The orchestrator can render EITHER variant at runtime depending on\n * viewport, so it must accept the union of both variants' required props\n * up front — it cannot know statically which one will render. This is the\n * same reasoning already applied to `requiredLabel` (Mobile-only) and now\n * extended to the three Desktop-only module-slot sublabels.\n */\nexport type MosaicAgentComposerOrchestratorProps = MosaicAgentComposerMobileProps &\n Pick<\n MosaicAgentComposerDesktopProps,\n \"roleSublabel\" | \"personaSublabel\" | \"frameworkSublabel\" | \"previewRequires\"\n >;\n\n/**\n * MosaicAgentComposer — device-adaptive composer that renders the Desktop\n * variant on lg+ and the Mobile variant below lg.\n *\n * Wrap in MosaicDeviceProvider. All props flow through unchanged.\n *\n * @example\n * <MosaicDeviceProvider>\n * <MosaicAgentComposer\n * agentName={name}\n * onAgentNameChange={setName}\n * customInstructions={instructions}\n * onCustomInstructionsChange={setInstructions}\n * selectedRole={role}\n * onSelectRole={openRolePicker}\n * onRemoveRole={clearRole}\n * selectedPersona={persona}\n * onSelectPersona={openPersonaPicker}\n * onRemovePersona={clearPersona}\n * selectedFramework={framework}\n * onSelectFramework={openFrameworkPicker}\n * onRemoveFramework={clearFramework}\n * selectedModel={model}\n * onSelectModel={openModelPicker}\n * onRemoveModel={clearModel}\n * onSave={handleSave}\n * canSave={canSave}\n * />\n * </MosaicDeviceProvider>\n */\nexport function MosaicAgentComposer(props: MosaicAgentComposerOrchestratorProps) {\n const { isMobile } = useDevice();\n return isMobile ? (\n <MosaicAgentComposerMobile {...props} />\n ) : (\n <MosaicAgentComposerDesktop {...props} />\n );\n}\n\nMosaicAgentComposer.displayName = \"MosaicAgentComposer\";\n"
15
+ },
16
+ {
17
+ "path": "src/components/agent-composer/MosaicAgentComposerDesktop.tsx",
18
+ "type": "registry:ui",
19
+ "content": "\"use client\";\n\n/**\n * MosaicAgentComposerDesktop — 2-col agent builder, desktop variant (PC-09)\n *\n * Ported (source: private upstream) components/agent-composer/AgentComposerDesktop.tsx\n *\n * Two-column layout:\n * - Left: scrollable form (name, role/persona/framework/model slots, instructions)\n * - Right: live preview panel\n *\n * Generalized: ProfessionalRole / Persona / Framework / Model domain types replaced\n * with generic MosaicComposerModule + MosaicComposerModel interfaces.\n * All 4 module slots accept any MosaicComposerModule — callers use their own types.\n *\n * Framer-motion: N/A (no animation in source component).\n * Icons: inline SVG (no lucide dep).\n * No device context — caller selects Desktop vs Mobile via MosaicAgentComposer orchestrator.\n */\n\n// React import not needed — JSX transform handles it\n\n// ── Utility ───────────────────────────────────────────────────────────────────\n\nfunction cn(...classes: (string | undefined | null | false)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n\n// ── Generic types ─────────────────────────────────────────────────────────────\n\nexport interface MosaicComposerModule {\n name: string;\n description?: string;\n /** Short supplementary text (traits, expertise, step count, etc.) */\n detail?: string;\n icon?: string;\n tags?: string[];\n}\n\nexport interface MosaicComposerModel {\n name: string;\n provider?: string;\n contextWindow?: number;\n recommended?: boolean;\n pricingLabel?: string;\n}\n\n// ── Shared props interface ─────────────────────────────────────────────────────\n\nexport interface MosaicAgentComposerProps {\n agentName: string;\n onAgentNameChange: (name: string) => void;\n customInstructions: string;\n onCustomInstructionsChange: (instructions: string) => void;\n selectedRole?: MosaicComposerModule;\n selectedPersona?: MosaicComposerModule;\n selectedFramework?: MosaicComposerModule;\n selectedModel?: MosaicComposerModel;\n onSelectRole: () => void;\n onSelectPersona: () => void;\n onSelectFramework: () => void;\n onSelectModel: () => void;\n onRemoveRole: () => void;\n onRemovePersona: () => void;\n onRemoveFramework: () => void;\n onSave: () => void;\n onCancel?: () => void;\n canSave: boolean;\n isEditMode?: boolean;\n /**\n * Slot labels — required, host-owned, no default. The host owns the\n * language (e.g. next-intl `t()`). Every field is mandatory: a missing\n * label is a compile-time error, never a silent English fallback.\n */\n labels: {\n role: string;\n persona: string;\n framework: string;\n model: string;\n customInstructions: string;\n saveLabel: string;\n cancelLabel: string;\n heading: string;\n subheading: string;\n headingEdit: string;\n subheadingEdit: string;\n };\n /**\n * Required host-owned strings — no default, no fallback. The host owns\n * the language (e.g. next-intl `t()`).\n */\n agentNameLabel: string;\n agentNamePlaceholder: string;\n instructionsPlaceholder: string;\n modelDescriptionLabel: string;\n recommendedBadgeLabel: string;\n livePreviewHeading: string;\n livePreviewSubheading: string;\n previewConfigLabel: string;\n customInstructionsPreviewLabel: string;\n selectAllModulesLabel: string;\n /**\n * Module-slot action strings — required, host-owned, no default, no silent\n * English fallback (SIN-01). Each is a compose function rather than a\n * flat string because the composed phrase (\"Edit {label}\", \"Select\n * {label}\"…) is not just a word substitution: word order, articles, and\n * even verb placement relative to the noun vary by language (e.g. the verb\n * precedes the noun in English but not in every language). The host is the\n * only party that can own that composition.\n */\n editModuleAriaLabel: (label: string) => string;\n removeModuleAriaLabel: (label: string) => string;\n /** Used for both the empty-slot aria-label and its visible button text. */\n selectModuleAriaLabel: (label: string) => string;\n /** Visible text on the \"change selection\" button once a module is filled. */\n changeModuleLabel: (label: string) => string;\n // NOTE: `requiredLabel` used to be declared here, on the SHARED props type,\n // but the desktop composer never renders it — only MosaicAgentComposerMobile\n // does (its module slots show a \"required\" marker). Requiring it here forced\n // every desktop host to supply a string this component never displays. It now\n // lives on MosaicAgentComposerMobileProps, i.e. exactly where it is read.\n // Found by the no-lying-prop-contract guard.\n /** Fallback name shown in the preview when `agentName` is empty. Required, no default. */\n unnamedAgentLabel: string;\n /**\n * Visible context-window text under the selected model (e.g. \"128,000\n * context\"). Receives the raw token count; the host owns number formatting,\n * the unit word and word order. Required, no default.\n */\n formatContextWindow: (tokens: number) => string;\n}\n\n// NOTE: same class of gap that produced the `requiredLabel` split above.\n// The three module-slot sublabels below are rendered unconditionally by the\n// Desktop variant on every render, but MosaicAgentComposerMobile never reads\n// them — its own module-slot component takes no sublabel prop at all. Adding\n// them to the shared `MosaicAgentComposerProps` would force every Mobile-only\n// host to supply strings that component never displays, i.e. the exact\n// lying-prop-contract this codebase hunts. They live here instead, on a\n// Desktop-only extension of the shared type.\nexport interface MosaicAgentComposerDesktopProps extends MosaicAgentComposerProps {\n /**\n * Required host-owned strings — no default, no fallback. Read\n * unconditionally by the three module slots on every render.\n */\n roleSublabel: string;\n personaSublabel: string;\n frameworkSublabel: string;\n /**\n * Which module slots must be filled before the live preview renders.\n * Optional — defaults to all four (role, persona, framework, model), i.e.\n * the exact behavior this component had before this prop existed. No\n * existing consumer needs to change anything to keep working unchanged.\n * Desktop-only: MosaicAgentComposerMobile has no live-preview panel and\n * never reads this prop.\n */\n previewRequires?: Array<\"role\" | \"persona\" | \"framework\" | \"model\">;\n}\n\n// ── Inline icons ──────────────────────────────────────────────────────────────\n\nfunction SparklesIcon() {\n return (\n <svg\n width=\"18\"\n height=\"18\"\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 >\n <path d=\"M12 3L13.5 8.5L19 10L13.5 11.5L12 17L10.5 11.5L5 10L10.5 8.5Z\" />\n </svg>\n );\n}\n\nfunction PlusIcon() {\n return (\n <svg\n width=\"18\"\n height=\"18\"\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 >\n <line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\" />\n <line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\" />\n </svg>\n );\n}\n\nfunction SaveIcon() {\n return (\n <svg\n width=\"14\"\n height=\"14\"\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 >\n <path d=\"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z\" />\n <polyline points=\"17 21 17 13 7 13 7 21\" />\n <polyline points=\"7 3 7 8 15 8\" />\n </svg>\n );\n}\n\n// ── Sub-components ────────────────────────────────────────────────────────────\n\ninterface ModuleSlotProps {\n label: string;\n sublabel?: string;\n module?: MosaicComposerModule;\n onSelect: () => void;\n onRemove: () => void;\n editAriaLabel: string;\n removeAriaLabel: string;\n selectAriaLabel: string;\n}\n\nfunction ModuleSlot({\n label,\n sublabel,\n module,\n onSelect,\n onRemove,\n editAriaLabel,\n removeAriaLabel,\n selectAriaLabel,\n}: ModuleSlotProps) {\n return (\n <div className=\"rounded-xl border border-border bg-card\">\n <div className=\"border-b border-border px-4 pt-4 pb-3\">\n <h3 className=\"text-sm font-semibold text-foreground\">{label}</h3>\n {sublabel && <p className=\"text-xs text-muted-foreground mt-0.5\">{sublabel}</p>}\n </div>\n <div className=\"p-4\">\n {module ? (\n <div className=\"flex min-h-[72px] items-start gap-3 rounded-lg border border-border bg-muted/30 p-3\">\n {module.icon && (\n <span className=\"mt-0.5 shrink-0 text-xl\" aria-hidden=\"true\">\n {module.icon}\n </span>\n )}\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-medium text-foreground\">{module.name}</p>\n {module.description && (\n <p className=\"mt-0.5 text-xs text-muted-foreground line-clamp-2\">\n {module.description}\n </p>\n )}\n {module.detail && (\n <p className=\"mt-1 text-xs text-muted-foreground/70 truncate\">{module.detail}</p>\n )}\n </div>\n <div className=\"flex shrink-0 gap-1\">\n <button\n type=\"button\"\n onClick={onSelect}\n aria-label={editAriaLabel}\n className=\"flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n <svg\n width=\"12\"\n height=\"12\"\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 >\n <path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\" />\n <path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\" />\n </svg>\n </button>\n <button\n type=\"button\"\n onClick={onRemove}\n aria-label={removeAriaLabel}\n className=\"flex h-7 w-7 items-center justify-center rounded-md text-destructive hover:bg-destructive/10 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n <svg\n width=\"12\"\n height=\"12\"\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 >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n </button>\n </div>\n </div>\n ) : (\n <button\n type=\"button\"\n onClick={onSelect}\n aria-label={selectAriaLabel}\n className=\"flex w-full min-h-[72px] items-center justify-center gap-2 rounded-lg border border-dashed border-border text-sm text-muted-foreground transition-colors hover:border-primary hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n <PlusIcon />\n {selectAriaLabel}\n </button>\n )}\n </div>\n </div>\n );\n}\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\n/**\n * MosaicAgentComposerDesktop — two-column composer (desktop half of responsive pair).\n * Share the same props contract with MosaicAgentComposerMobile.\n * Use MosaicAgentComposer orchestrator to select the right variant automatically.\n */\nexport function MosaicAgentComposerDesktop({\n agentName,\n onAgentNameChange,\n customInstructions,\n onCustomInstructionsChange,\n selectedRole,\n selectedPersona,\n selectedFramework,\n selectedModel,\n onSelectRole,\n onSelectPersona,\n onSelectFramework,\n onSelectModel,\n onRemoveRole,\n onRemovePersona,\n onRemoveFramework,\n onSave,\n onCancel,\n canSave,\n isEditMode = false,\n labels,\n agentNameLabel,\n agentNamePlaceholder,\n instructionsPlaceholder,\n modelDescriptionLabel,\n recommendedBadgeLabel,\n livePreviewHeading,\n livePreviewSubheading,\n previewConfigLabel,\n customInstructionsPreviewLabel,\n selectAllModulesLabel,\n unnamedAgentLabel,\n formatContextWindow,\n roleSublabel,\n personaSublabel,\n frameworkSublabel,\n editModuleAriaLabel,\n removeModuleAriaLabel,\n selectModuleAriaLabel,\n changeModuleLabel,\n previewRequires = [\"role\", \"persona\", \"framework\", \"model\"],\n}: MosaicAgentComposerDesktopProps) {\n // `labels` is fully required — every field is host-supplied, no default,\n // no fallback. Aliased to `L` only for call-site brevity below.\n const L = labels;\n\n const moduleBySlot = {\n role: selectedRole,\n persona: selectedPersona,\n framework: selectedFramework,\n model: selectedModel,\n } as const;\n const allModulesSelected = previewRequires.every((slot) => !!moduleBySlot[slot]);\n\n return (\n <div data-slot=\"agent-composer-desktop\" className=\"grid h-full grid-cols-2 gap-6\">\n {/* Left — form */}\n <div className=\"space-y-5 overflow-y-auto pr-3\">\n {/* Heading */}\n <div className=\"flex items-center gap-2\">\n <SparklesIcon />\n <div>\n <h2 className=\"text-2xl font-semibold text-foreground\">\n {isEditMode ? L.headingEdit : L.heading}\n </h2>\n <p className=\"text-sm text-muted-foreground\">\n {isEditMode ? L.subheadingEdit : L.subheading}\n </p>\n </div>\n </div>\n\n <hr className=\"border-border\" />\n\n {/* Agent Name */}\n <div className=\"space-y-1.5\">\n <label\n htmlFor=\"mosaic-composer-name\"\n className=\"block text-sm font-medium text-foreground\"\n >\n {agentNameLabel}\n </label>\n <input\n id=\"mosaic-composer-name\"\n type=\"text\"\n value={agentName}\n onChange={(e) => onAgentNameChange(e.target.value)}\n placeholder={agentNamePlaceholder}\n className={cn(\n \"flex min-h-[48px] w-full rounded-lg border border-input bg-transparent px-3 py-2 text-sm\",\n \"placeholder:text-muted-foreground\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n \"transition-colors\",\n )}\n />\n </div>\n\n {/* Module slots */}\n <ModuleSlot\n label={L.role}\n sublabel={roleSublabel}\n module={selectedRole}\n onSelect={onSelectRole}\n onRemove={onRemoveRole}\n editAriaLabel={editModuleAriaLabel(L.role)}\n removeAriaLabel={removeModuleAriaLabel(L.role)}\n selectAriaLabel={selectModuleAriaLabel(L.role)}\n />\n <ModuleSlot\n label={L.persona}\n sublabel={personaSublabel}\n module={selectedPersona}\n onSelect={onSelectPersona}\n onRemove={onRemovePersona}\n editAriaLabel={editModuleAriaLabel(L.persona)}\n removeAriaLabel={removeModuleAriaLabel(L.persona)}\n selectAriaLabel={selectModuleAriaLabel(L.persona)}\n />\n <ModuleSlot\n label={L.framework}\n sublabel={frameworkSublabel}\n module={selectedFramework}\n onSelect={onSelectFramework}\n onRemove={onRemoveFramework}\n editAriaLabel={editModuleAriaLabel(L.framework)}\n removeAriaLabel={removeModuleAriaLabel(L.framework)}\n selectAriaLabel={selectModuleAriaLabel(L.framework)}\n />\n\n {/* Model slot */}\n <div className=\"rounded-xl border border-border bg-card\">\n <div className=\"border-b border-border px-4 pt-4 pb-3\">\n <h3 className=\"text-sm font-semibold text-foreground\">{L.model}</h3>\n <p className=\"text-xs text-muted-foreground mt-0.5\">{modelDescriptionLabel}</p>\n </div>\n <div className=\"p-4\">\n {selectedModel ? (\n <div className=\"space-y-3\">\n <div className=\"flex min-h-[72px] items-start gap-3 rounded-lg border border-border bg-muted/30 p-3\">\n <div className=\"flex-1 space-y-1\">\n <div className=\"flex items-center gap-2\">\n <p className=\"text-sm font-medium text-foreground\">{selectedModel.name}</p>\n {selectedModel.recommended && (\n <span className=\"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary\">\n {recommendedBadgeLabel}\n </span>\n )}\n </div>\n {selectedModel.provider && (\n <p className=\"text-xs capitalize text-muted-foreground\">\n {selectedModel.provider}\n </p>\n )}\n {(selectedModel.contextWindow || selectedModel.pricingLabel) && (\n <p className=\"text-xs text-muted-foreground\">\n {selectedModel.contextWindow &&\n formatContextWindow(selectedModel.contextWindow)}\n {selectedModel.contextWindow && selectedModel.pricingLabel && \" • \"}\n {selectedModel.pricingLabel}\n </p>\n )}\n </div>\n </div>\n <button\n type=\"button\"\n onClick={onSelectModel}\n className=\"flex w-full min-h-[44px] items-center justify-center rounded-lg border border-border text-sm text-muted-foreground transition-colors hover:border-primary hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n {changeModuleLabel(L.model)}\n </button>\n </div>\n ) : (\n <button\n type=\"button\"\n onClick={onSelectModel}\n aria-label={selectModuleAriaLabel(L.model)}\n className=\"flex w-full min-h-[72px] items-center justify-center gap-2 rounded-lg border border-dashed border-border text-sm text-muted-foreground transition-colors hover:border-primary hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n <PlusIcon />\n {selectModuleAriaLabel(L.model)}\n </button>\n )}\n </div>\n </div>\n\n {/* Custom instructions */}\n <div className=\"space-y-1.5\">\n <label\n htmlFor=\"mosaic-composer-instructions\"\n className=\"block text-sm font-medium text-foreground\"\n >\n {L.customInstructions}\n </label>\n <textarea\n id=\"mosaic-composer-instructions\"\n value={customInstructions}\n onChange={(e) => onCustomInstructionsChange(e.target.value)}\n placeholder={instructionsPlaceholder}\n rows={5}\n className={cn(\n \"flex w-full resize-y rounded-lg border border-input bg-transparent px-3 py-2 text-sm\",\n \"placeholder:text-muted-foreground\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n \"min-h-[120px] transition-colors\",\n )}\n />\n </div>\n </div>\n\n {/* Right — live preview */}\n <div className=\"flex flex-col gap-5 border-l border-border pl-6\">\n <div>\n <h2 className=\"text-lg font-semibold text-foreground\">{livePreviewHeading}</h2>\n <p className=\"text-sm text-muted-foreground\">{livePreviewSubheading}</p>\n </div>\n\n <hr className=\"border-border\" />\n\n {allModulesSelected ? (\n <div className=\"flex-1 overflow-y-auto rounded-xl border border-border bg-muted/30 p-4 space-y-4\">\n <h3 className=\"font-semibold text-foreground\">{agentName || unnamedAgentLabel}</h3>\n <p className=\"text-xs text-muted-foreground\">{previewConfigLabel}</p>\n <hr className=\"border-border\" />\n <div className=\"space-y-3 text-sm\">\n <div>\n <p className=\"font-medium text-foreground\">\n {L.role}: {selectedRole?.name}\n </p>\n {selectedRole?.description && (\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n {selectedRole?.description}\n </p>\n )}\n </div>\n <hr className=\"border-border\" />\n <div>\n <p className=\"font-medium text-foreground\">\n {L.persona}: {selectedPersona?.name}\n </p>\n {selectedPersona?.description && (\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n {selectedPersona?.description}\n </p>\n )}\n </div>\n <hr className=\"border-border\" />\n <div>\n <p className=\"font-medium text-foreground\">\n {L.framework}: {selectedFramework?.name}\n </p>\n {selectedFramework?.description && (\n <p className=\"text-xs text-muted-foreground mt-0.5\">\n {selectedFramework?.description}\n </p>\n )}\n </div>\n <hr className=\"border-border\" />\n <div>\n <p className=\"font-medium text-foreground\">\n {L.model}: {selectedModel?.name}\n </p>\n {selectedModel?.provider && (\n <p className=\"text-xs text-muted-foreground mt-0.5 capitalize\">\n {selectedModel?.provider}\n </p>\n )}\n </div>\n {customInstructions && (\n <>\n <hr className=\"border-border\" />\n <div>\n <p className=\"font-medium text-foreground\">{customInstructionsPreviewLabel}</p>\n <p className=\"text-xs text-muted-foreground mt-0.5\">{customInstructions}</p>\n </div>\n </>\n )}\n </div>\n </div>\n ) : (\n <div className=\"flex flex-1 items-center justify-center text-center\">\n <div className=\"space-y-2\">\n <SparklesIcon />\n <p className=\"text-sm text-muted-foreground\">{selectAllModulesLabel}</p>\n </div>\n </div>\n )}\n\n {/* CTA buttons */}\n <div className={cn(\"flex gap-2\", isEditMode && onCancel ? \"flex-row\" : \"flex-col\")}>\n {isEditMode && onCancel && (\n <button\n type=\"button\"\n onClick={onCancel}\n className=\"flex flex-1 min-h-[48px] items-center justify-center rounded-lg border border-border bg-transparent text-sm font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n {L.cancelLabel}\n </button>\n )}\n <button\n type=\"button\"\n onClick={onSave}\n disabled={!canSave}\n className={cn(\n \"flex min-h-[48px] items-center justify-center gap-2 rounded-lg text-sm font-medium transition-colors\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n \"bg-primary text-primary-foreground hover:bg-primary/90\",\n \"disabled:opacity-50 disabled:cursor-not-allowed\",\n isEditMode && onCancel ? \"flex-1\" : \"w-full\",\n )}\n >\n {isEditMode ? (\n <>\n <SaveIcon />\n {L.saveLabel}\n </>\n ) : (\n <>\n <SparklesIcon />\n {L.saveLabel}\n </>\n )}\n </button>\n </div>\n </div>\n </div>\n );\n}\n\nMosaicAgentComposerDesktop.displayName = \"MosaicAgentComposerDesktop\";\n"
20
+ },
21
+ {
22
+ "path": "src/components/agent-composer/MosaicAgentComposerMobile.tsx",
23
+ "type": "registry:ui",
24
+ "content": "\"use client\";\n\n/**\n * MosaicAgentComposerMobile — single-col composer, mobile variant (PC-10)\n *\n * Ported (source: private upstream) components/agent-composer/AgentComposerMobile.tsx\n *\n * Single-column scrollable form with:\n * - Sticky header with back button (edit mode) + title\n * - 4 module slots (role, persona, framework, model)\n * - Custom instructions textarea\n * - Sticky bottom CTA bar (Create / Save + Cancel)\n * - isLoading prop for async feedback\n * - Full ARIA attributes (aria-required, aria-invalid, aria-describedby)\n *\n * Shares MosaicAgentComposerProps with Desktop variant (same contract, minor extensions).\n * No device detection — parent (MosaicAgentComposer) routes device → variant.\n *\n * Framer-motion: N/A.\n * Icons: inline SVG (no lucide dep).\n */\n\nimport * as React from \"react\";\nimport type {\n MosaicAgentComposerProps,\n MosaicComposerModel,\n MosaicComposerModule,\n} from \"./MosaicAgentComposerDesktop.js\";\n\n// ── Utility ───────────────────────────────────────────────────────────────────\n\nfunction cn(...classes: (string | undefined | null | false)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n\n// ── Extended props ────────────────────────────────────────────────────────────\n\nexport interface MosaicAgentComposerMobileProps extends MosaicAgentComposerProps {\n /** Show loading state on submit button */\n isLoading?: boolean;\n /**\n * \"Required\" marker shown on a mandatory module slot. Declared HERE, not on\n * the shared MosaicAgentComposerProps, because only the mobile composer\n * renders it — the desktop one never does. (Moved by the\n * no-lying-prop-contract guard: a prop is required exactly where it is read.)\n */\n requiredLabel: string;\n /**\n * Required host-owned strings (mobile-only extras) — no default,\n * no fallback. The host owns the language (e.g. next-intl `t()`).\n */\n goBackAriaLabel: string;\n savingLabel: string;\n creatingLabel: string;\n optionalInstructionsHelp: string;\n}\n\n// NOTE: `editModuleAriaLabel` / `removeModuleAriaLabel` / `selectModuleAriaLabel`\n// / `changeModuleLabel` live on the SHARED `MosaicAgentComposerProps`\n// (declared in MosaicAgentComposerDesktop.ts) because both variants render\n// module slots and read all four. `previewRequires` is Desktop-only — Mobile\n// has no live-preview panel — so it stays out of this file entirely.\n\n// ── Re-export shared types for convenience ────────────────────────────────────\nexport type { MosaicComposerModule, MosaicComposerModel };\n\n// ── Inline icons ──────────────────────────────────────────────────────────────\n\nfunction SparklesIcon() {\n return (\n <svg\n width=\"16\"\n height=\"16\"\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 >\n <path d=\"M12 3L13.5 8.5L19 10L13.5 11.5L12 17L10.5 11.5L5 10L10.5 8.5Z\" />\n </svg>\n );\n}\n\nfunction ArrowLeftIcon() {\n return (\n <svg\n width=\"18\"\n height=\"18\"\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 >\n <line x1=\"19\" y1=\"12\" x2=\"5\" y2=\"12\" />\n <polyline points=\"12 19 5 12 12 5\" />\n </svg>\n );\n}\n\nfunction PlusIcon() {\n return (\n <svg\n width=\"16\"\n height=\"16\"\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 >\n <line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\" />\n <line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\" />\n </svg>\n );\n}\n\nfunction SaveIcon() {\n return (\n <svg\n width=\"14\"\n height=\"14\"\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 >\n <path d=\"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z\" />\n <polyline points=\"17 21 17 13 7 13 7 21\" />\n <polyline points=\"7 3 7 8 15 8\" />\n </svg>\n );\n}\n\n// ── Module slot (mobile variant — numbered) ───────────────────────────────────\n\ninterface MobileModuleSlotProps {\n step: number;\n label: string;\n module?: MosaicComposerModule;\n onSelect: () => void;\n onRemove: () => void;\n isLoading: boolean;\n requiredLabel: string;\n editAriaLabel: string;\n removeAriaLabel: string;\n selectAriaLabel: string;\n}\n\nfunction MobileModuleSlot({\n step,\n label,\n module,\n onSelect,\n onRemove,\n isLoading,\n requiredLabel,\n editAriaLabel,\n removeAriaLabel,\n selectAriaLabel,\n}: MobileModuleSlotProps) {\n return (\n <div className=\"rounded-xl border border-border bg-card\">\n <div className=\"border-b border-border px-4 pt-3 pb-2\">\n <div className=\"flex items-center justify-between\">\n <h3 className=\"text-sm font-medium text-foreground\">\n {step}. {label}\n </h3>\n <span className=\"text-xs text-muted-foreground\">{requiredLabel}</span>\n </div>\n </div>\n <div className=\"p-3\">\n {module ? (\n <div className=\"flex min-h-[64px] items-start gap-2 rounded-lg border border-border bg-muted/30 p-3\">\n {module.icon && (\n <span className=\"shrink-0 text-lg\" aria-hidden=\"true\">\n {module.icon}\n </span>\n )}\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-medium text-foreground\">{module.name}</p>\n {module.description && (\n <p className=\"mt-0.5 text-xs text-muted-foreground line-clamp-2\">\n {module.description}\n </p>\n )}\n </div>\n <div className=\"flex shrink-0 gap-1\">\n <button\n type=\"button\"\n onClick={onSelect}\n disabled={isLoading}\n aria-label={editAriaLabel}\n className=\"flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50\"\n >\n <svg\n width=\"12\"\n height=\"12\"\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 >\n <path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\" />\n <path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\" />\n </svg>\n </button>\n <button\n type=\"button\"\n onClick={onRemove}\n disabled={isLoading}\n aria-label={removeAriaLabel}\n className=\"flex h-8 w-8 items-center justify-center rounded-md text-destructive transition-colors hover:bg-destructive/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50\"\n >\n <svg\n width=\"12\"\n height=\"12\"\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 >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n </button>\n </div>\n </div>\n ) : (\n <button\n type=\"button\"\n onClick={onSelect}\n disabled={isLoading}\n aria-label={selectAriaLabel}\n className=\"flex w-full min-h-[64px] items-center justify-center gap-2 rounded-lg border border-dashed border-border text-sm text-muted-foreground transition-colors hover:border-primary hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50\"\n >\n <PlusIcon />\n {selectAriaLabel}\n </button>\n )}\n </div>\n </div>\n );\n}\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\n/**\n * MosaicAgentComposerMobile — single-column composer (mobile half of responsive pair).\n * Shares the same props contract as MosaicAgentComposerDesktop (plus isLoading).\n * Use MosaicAgentComposer orchestrator to select the right variant automatically.\n */\nexport function MosaicAgentComposerMobile({\n agentName,\n onAgentNameChange,\n customInstructions,\n onCustomInstructionsChange,\n selectedRole,\n selectedPersona,\n selectedFramework,\n selectedModel,\n onSelectRole,\n onSelectPersona,\n onSelectFramework,\n onSelectModel,\n onRemoveRole,\n onRemovePersona,\n onRemoveFramework,\n onSave,\n onCancel,\n canSave,\n isEditMode = false,\n isLoading = false,\n labels,\n agentNameLabel,\n agentNamePlaceholder,\n instructionsPlaceholder,\n recommendedBadgeLabel,\n requiredLabel,\n goBackAriaLabel,\n savingLabel,\n creatingLabel,\n optionalInstructionsHelp,\n editModuleAriaLabel,\n removeModuleAriaLabel,\n selectModuleAriaLabel,\n changeModuleLabel,\n formatContextWindow,\n}: MosaicAgentComposerMobileProps) {\n // `labels` is fully required — every field is host-supplied, no default,\n // no fallback. Aliased to `L` only for call-site brevity below.\n const L = labels;\n\n const instructionsId = React.useId();\n\n return (\n <div data-slot=\"agent-composer-mobile\" className=\"flex h-full flex-col\">\n {/* Sticky header */}\n <div className=\"shrink-0 sticky top-0 z-10 border-b border-border bg-background px-4 pt-4 pb-3\">\n <div className=\"flex items-center gap-2\">\n {isEditMode && onCancel && (\n <button\n type=\"button\"\n onClick={onCancel}\n disabled={isLoading}\n aria-label={goBackAriaLabel}\n className=\"flex h-11 w-11 shrink-0 items-center justify-center rounded-lg text-foreground transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50\"\n >\n <ArrowLeftIcon />\n </button>\n )}\n <SparklesIcon />\n <h1 className=\"text-lg font-semibold text-foreground\">\n {isEditMode ? L.headingEdit : L.heading}\n </h1>\n </div>\n <p className=\"mt-0.5 text-sm text-muted-foreground\">\n {isEditMode ? L.subheadingEdit : L.subheading}\n </p>\n </div>\n\n {/* Scrollable body */}\n <div className=\"flex-1 overflow-y-auto space-y-4 p-4\">\n {/* Agent Name */}\n <div className=\"space-y-1.5\">\n <label\n htmlFor=\"mosaic-composer-mobile-name\"\n className=\"block text-sm font-medium text-foreground\"\n >\n {agentNameLabel}\n </label>\n <input\n id=\"mosaic-composer-mobile-name\"\n type=\"text\"\n value={agentName}\n onChange={(e) => onAgentNameChange(e.target.value)}\n placeholder={agentNamePlaceholder}\n disabled={isLoading}\n aria-required=\"true\"\n aria-invalid={canSave && !agentName ? \"true\" : \"false\"}\n className={cn(\n \"flex min-h-[48px] w-full rounded-lg border border-input bg-transparent px-3 py-2 text-sm\",\n \"placeholder:text-muted-foreground\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n \"disabled:opacity-50 transition-colors\",\n )}\n />\n </div>\n\n {/* Module slots (numbered) */}\n <MobileModuleSlot\n step={1}\n label={L.role}\n module={selectedRole}\n onSelect={onSelectRole}\n onRemove={onRemoveRole}\n isLoading={isLoading}\n requiredLabel={requiredLabel}\n editAriaLabel={editModuleAriaLabel(L.role)}\n removeAriaLabel={removeModuleAriaLabel(L.role)}\n selectAriaLabel={selectModuleAriaLabel(L.role)}\n />\n <MobileModuleSlot\n step={2}\n label={L.persona}\n module={selectedPersona}\n onSelect={onSelectPersona}\n onRemove={onRemovePersona}\n isLoading={isLoading}\n requiredLabel={requiredLabel}\n editAriaLabel={editModuleAriaLabel(L.persona)}\n removeAriaLabel={removeModuleAriaLabel(L.persona)}\n selectAriaLabel={selectModuleAriaLabel(L.persona)}\n />\n <MobileModuleSlot\n step={3}\n label={L.framework}\n module={selectedFramework}\n onSelect={onSelectFramework}\n onRemove={onRemoveFramework}\n isLoading={isLoading}\n requiredLabel={requiredLabel}\n editAriaLabel={editModuleAriaLabel(L.framework)}\n removeAriaLabel={removeModuleAriaLabel(L.framework)}\n selectAriaLabel={selectModuleAriaLabel(L.framework)}\n />\n\n {/* Model slot */}\n <div className=\"rounded-xl border border-border bg-card\">\n <div className=\"border-b border-border px-4 pt-3 pb-2\">\n <div className=\"flex items-center justify-between\">\n <h3 className=\"text-sm font-medium text-foreground\">4. {L.model}</h3>\n <span className=\"text-xs text-muted-foreground\">{requiredLabel}</span>\n </div>\n </div>\n <div className=\"p-3\">\n {selectedModel ? (\n <div className=\"space-y-2\">\n <div className=\"flex min-h-[64px] items-start gap-2 rounded-lg border border-border bg-muted/30 p-3\">\n <div className=\"flex-1 space-y-0.5\">\n <div className=\"flex items-center gap-2\">\n <p className=\"text-sm font-medium text-foreground\">{selectedModel.name}</p>\n {selectedModel.recommended && (\n <span className=\"rounded-full bg-primary/10 px-1.5 py-0.5 text-xs font-medium text-primary\">\n {recommendedBadgeLabel}\n </span>\n )}\n </div>\n {selectedModel.provider && (\n <p className=\"text-xs capitalize text-muted-foreground\">\n {selectedModel.provider}\n </p>\n )}\n {(selectedModel.contextWindow || selectedModel.pricingLabel) && (\n <p className=\"text-xs text-muted-foreground\">\n {selectedModel.contextWindow &&\n formatContextWindow(selectedModel.contextWindow)}\n {selectedModel.contextWindow && selectedModel.pricingLabel && \" • \"}\n {selectedModel.pricingLabel}\n </p>\n )}\n </div>\n </div>\n <button\n type=\"button\"\n onClick={onSelectModel}\n disabled={isLoading}\n className=\"flex w-full min-h-[44px] items-center justify-center rounded-lg border border-border text-sm text-muted-foreground transition-colors hover:border-primary hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50\"\n >\n {changeModuleLabel(L.model)}\n </button>\n </div>\n ) : (\n <button\n type=\"button\"\n onClick={onSelectModel}\n disabled={isLoading}\n aria-label={selectModuleAriaLabel(L.model)}\n className=\"flex w-full min-h-[64px] items-center justify-center gap-2 rounded-lg border border-dashed border-border text-sm text-muted-foreground transition-colors hover:border-primary hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50\"\n >\n <PlusIcon />\n {selectModuleAriaLabel(L.model)}\n </button>\n )}\n </div>\n </div>\n\n {/* Custom instructions */}\n <div className=\"space-y-1.5\">\n <label htmlFor={instructionsId} className=\"block text-sm font-medium text-foreground\">\n {L.customInstructions}\n </label>\n <textarea\n id={instructionsId}\n value={customInstructions}\n onChange={(e) => onCustomInstructionsChange(e.target.value)}\n placeholder={instructionsPlaceholder}\n disabled={isLoading}\n aria-describedby={`${instructionsId}-help`}\n rows={4}\n className={cn(\n \"flex w-full resize-y rounded-lg border border-input bg-transparent px-3 py-2 text-sm\",\n \"placeholder:text-muted-foreground\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n \"min-h-[100px] disabled:opacity-50 transition-colors\",\n )}\n />\n <p id={`${instructionsId}-help`} className=\"text-xs text-muted-foreground\">\n {optionalInstructionsHelp}\n </p>\n </div>\n </div>\n\n {/* Sticky CTA */}\n <div className=\"shrink-0 sticky bottom-0 z-10 border-t border-border bg-background p-4\">\n {isEditMode && onCancel ? (\n <div className=\"flex gap-2\">\n <button\n type=\"button\"\n onClick={onCancel}\n disabled={isLoading}\n className=\"flex flex-1 min-h-[48px] items-center justify-center rounded-lg border border-border bg-transparent text-sm font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50\"\n >\n {L.cancelLabel}\n </button>\n <button\n type=\"button\"\n onClick={onSave}\n disabled={!canSave || isLoading}\n className=\"flex flex-1 min-h-[48px] items-center justify-center gap-2 rounded-lg bg-primary text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n <SaveIcon />\n {isLoading ? savingLabel : L.saveLabel}\n </button>\n </div>\n ) : (\n <button\n type=\"button\"\n onClick={onSave}\n disabled={!canSave || isLoading}\n className=\"flex w-full min-h-[48px] items-center justify-center gap-2 rounded-lg bg-primary text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n <SparklesIcon />\n {isLoading ? creatingLabel : L.saveLabel}\n </button>\n )}\n </div>\n </div>\n );\n}\n\nMosaicAgentComposerMobile.displayName = \"MosaicAgentComposerMobile\";\n"
25
+ }
26
+ ],
27
+ "type": "registry:ui"
28
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-agent-editor",
4
+ "title": "MosaicAgentEditor",
5
+ "description": "MosaicAgentEditor — agent config form (name / role / instructions)",
6
+ "dependencies": [],
7
+ "registryDependencies": [
8
+ "https://cdn.jsdelivr.net/npm/@vantageos/mosaic-blocks@0.5.36-alpha/r/mosaic-button.json",
9
+ "https://cdn.jsdelivr.net/npm/@vantageos/mosaic-blocks@0.5.36-alpha/r/mosaic-input.json",
10
+ "https://cdn.jsdelivr.net/npm/@vantageos/mosaic-blocks@0.5.36-alpha/r/mosaic-textarea.json"
11
+ ],
12
+ "files": [
13
+ {
14
+ "path": "src/components/agent-editor/MosaicAgentEditor.tsx",
15
+ "type": "registry:ui",
16
+ "content": "/**\n * MosaicAgentEditor — agent config form (name / role / instructions)\n *\n * Ported (shape only) from any-debate-ai:\n * - components/agent-composer/AgentEditor.tsx\n * - components/agent-config/AgentBuilderModal.tsx\n *\n * No business logic is carried over: no roles/personas/frameworks lists, no\n * model presets, no default prompts. Every visible string is a REQUIRED prop\n * with no default. The form is fully controlled: values, onChange handlers,\n * validation errors and the busy state all come from the host.\n *\n * data-slot=\"agent-editor\" on the root.\n * Deps: @base-ui/react (via MosaicButton) + class-variance-authority only.\n */\n\nimport type * as React from \"react\";\nimport { MosaicButton } from \"@/components/ui/Button\";\nimport { MosaicInput } from \"@/components/ui/MosaicInput\";\nimport { MosaicTextarea } from \"@/components/ui/MosaicTextarea\";\nimport { agentEditorVariants } from \"./agent-editor-variants.js\";\n\n// ── Props ─────────────────────────────────────────────────────────────────────\n\nexport interface MosaicAgentEditorProps {\n className?: string;\n ref?: React.Ref<HTMLDivElement>;\n\n /** Name field */\n nameLabel: string;\n nameValue: string;\n onNameChange: (value: string) => void;\n /** Host-decided validation error for the name field, or null when valid */\n nameError: string | null;\n\n /** Role field */\n roleLabel: string;\n roleValue: string;\n onRoleChange: (value: string) => void;\n /** Host-decided validation error for the role field, or null when valid */\n roleError: string | null;\n\n /** Instructions field */\n instructionsLabel: string;\n instructionsValue: string;\n onInstructionsChange: (value: string) => void;\n /** Host-decided validation error for the instructions field, or null when valid */\n instructionsError: string | null;\n\n /** Actions */\n saveLabel: string;\n cancelLabel: string;\n onSave: () => void;\n onCancel: () => void;\n /** Host decides whether the form is currently valid/submittable */\n canSave: boolean;\n /** Host-controlled submission-in-flight state */\n isSaving: boolean;\n /** Label shown on the save button while isSaving is true */\n savingLabel: string;\n}\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\n/**\n * MosaicAgentEditor — production agent-editor form for @vantageos/mosaic-blocks.\n *\n * Fully controlled: name/role/instructions values, onChange handlers,\n * validation errors and busy state are all supplied by the host. The\n * component carries no business knowledge (no role list, no model, no\n * default instructions) — it only renders the form shape.\n *\n * @example\n * <MosaicAgentEditor\n * nameLabel=\"Name\" nameValue={name} onNameChange={setName} nameError={nameError}\n * roleLabel=\"Role\" roleValue={role} onRoleChange={setRole} roleError={null}\n * instructionsLabel=\"Instructions\" instructionsValue={instructions}\n * onInstructionsChange={setInstructions} instructionsError={null}\n * saveLabel=\"Save\" cancelLabel=\"Cancel\" onSave={handleSave} onCancel={handleCancel}\n * canSave={isValid} isSaving={isSaving} savingLabel=\"Saving…\"\n * />\n */\nexport function MosaicAgentEditor({\n className,\n ref,\n nameLabel,\n nameValue,\n onNameChange,\n nameError,\n roleLabel,\n roleValue,\n onRoleChange,\n roleError,\n instructionsLabel,\n instructionsValue,\n onInstructionsChange,\n instructionsError,\n saveLabel,\n cancelLabel,\n onSave,\n onCancel,\n canSave,\n isSaving,\n savingLabel,\n}: MosaicAgentEditorProps) {\n const nameErrorId = nameError ? \"mosaic-agent-editor-name-error\" : undefined;\n const roleErrorId = roleError ? \"mosaic-agent-editor-role-error\" : undefined;\n const instructionsErrorId = instructionsError\n ? \"mosaic-agent-editor-instructions-error\"\n : undefined;\n\n const saveDisabled = !canSave || isSaving;\n\n const handleSave = () => {\n if (saveDisabled) return;\n onSave();\n };\n\n return (\n <div\n ref={ref}\n data-slot=\"agent-editor\"\n aria-busy={isSaving ? \"true\" : undefined}\n className={agentEditorVariants({ className })}\n >\n <div className=\"flex flex-col gap-1.5\">\n <label htmlFor=\"mosaic-agent-editor-name\" className=\"text-sm font-medium text-foreground\">\n {nameLabel}\n </label>\n <MosaicInput\n id=\"mosaic-agent-editor-name\"\n value={nameValue}\n onChange={(event) => onNameChange(event.target.value)}\n aria-invalid={nameError ? \"true\" : undefined}\n aria-describedby={nameErrorId}\n />\n {nameError ? (\n <p id={nameErrorId} className=\"text-xs font-medium text-destructive\">\n {nameError}\n </p>\n ) : null}\n </div>\n\n <div className=\"flex flex-col gap-1.5\">\n <label htmlFor=\"mosaic-agent-editor-role\" className=\"text-sm font-medium text-foreground\">\n {roleLabel}\n </label>\n <MosaicInput\n id=\"mosaic-agent-editor-role\"\n value={roleValue}\n onChange={(event) => onRoleChange(event.target.value)}\n aria-invalid={roleError ? \"true\" : undefined}\n aria-describedby={roleErrorId}\n />\n {roleError ? (\n <p id={roleErrorId} className=\"text-xs font-medium text-destructive\">\n {roleError}\n </p>\n ) : null}\n </div>\n\n <div className=\"flex flex-col gap-1.5\">\n <label\n htmlFor=\"mosaic-agent-editor-instructions\"\n className=\"text-sm font-medium text-foreground\"\n >\n {instructionsLabel}\n </label>\n <MosaicTextarea\n id=\"mosaic-agent-editor-instructions\"\n value={instructionsValue}\n onChange={(event) => onInstructionsChange(event.target.value)}\n aria-invalid={instructionsError ? \"true\" : undefined}\n aria-describedby={instructionsErrorId}\n />\n {instructionsError ? (\n <p id={instructionsErrorId} className=\"text-xs font-medium text-destructive\">\n {instructionsError}\n </p>\n ) : null}\n </div>\n\n <div className=\"flex items-center justify-end gap-2\">\n <MosaicButton type=\"button\" variant=\"outline\" onClick={onCancel}>\n {cancelLabel}\n </MosaicButton>\n <MosaicButton type=\"button\" onClick={handleSave} disabled={saveDisabled}>\n {isSaving ? savingLabel : saveLabel}\n </MosaicButton>\n </div>\n </div>\n );\n}\n\nMosaicAgentEditor.displayName = \"MosaicAgentEditor\";\n"
17
+ },
18
+ {
19
+ "path": "src/components/agent-editor/agent-editor-variants.ts",
20
+ "type": "registry:ui",
21
+ "content": "/**\n * agent-editor-variants — cva variants for MosaicAgentEditor\n *\n * Separated per house convention (variants isolated from component logic).\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const agentEditorVariants = cva(\"flex flex-col gap-4 w-full\", {\n variants: {},\n defaultVariants: {},\n});\n"
22
+ }
23
+ ],
24
+ "type": "registry:ui"
25
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-agent-list",
4
+ "title": "MosaicAgentList",
5
+ "description": "Responsive agent list (responsive-pair). Desktop: filter sidebar + grid. Mobile: stacked + filter sheet.",
6
+ "dependencies": [],
7
+ "registryDependencies": [
8
+ "https://cdn.jsdelivr.net/npm/@vantageos/mosaic-blocks@0.5.36-alpha/r/mosaic-adaptive-modal.json",
9
+ "https://cdn.jsdelivr.net/npm/@vantageos/mosaic-blocks@0.5.36-alpha/r/mosaic-agent-card.json",
10
+ "https://cdn.jsdelivr.net/npm/@vantageos/mosaic-blocks@0.5.36-alpha/r/mosaic-device-provider.json",
11
+ "https://cdn.jsdelivr.net/npm/@vantageos/mosaic-blocks@0.5.36-alpha/r/mosaic-filter-sidebar.json"
12
+ ],
13
+ "files": [
14
+ {
15
+ "path": "src/components/agent-list/MosaicAgentList.tsx",
16
+ "type": "registry:ui",
17
+ "content": "\"use client\";\n\n/**\n * MosaicAgentList — responsive agent list with filter sidebar (responsive-pair)\n *\n * Ported from components/agents/ (agent-list.tsx + desktop/agent-list-desktop.tsx +\n * mobile/agent-list-mobile.tsx + AgentFilterSidebar.tsx)\n *\n * Features:\n * - Desktop: two-column layout (MosaicFilterSidebar + agent grid)\n * - Mobile: stacked layout with filter sheet (MosaicAdaptiveModal)\n * - Search, filter, category — fully controlled via props\n * - Renders MosaicAgentCard for each agent\n *\n * All debate-specific deps stripped (OrgSwitcher, TokenBalance, QuickActionsMenu,\n * next/navigation router push).\n */\n\nimport * as React from \"react\";\nimport { MosaicAdaptiveModal } from \"@/components/ui/MosaicAdaptiveModal\";\nimport { MosaicAgentCard } from \"@/components/ui/MosaicAgentCard\";\nimport type { MosaicAgentCardProps, MosaicAgentData } from \"@/components/ui/MosaicAgentCard\";\nimport { useDevice } from \"@/components/ui/MosaicDeviceProvider\";\nimport { MosaicFilterSidebar } from \"@/components/ui/MosaicFilterSidebar\";\nimport type { MosaicFilterOption } from \"@/components/ui/MosaicFilterSidebar\";\n\n/** Required host-owned strings forwarded to every MosaicAgentCard rendered by the list. */\nexport type MosaicAgentListCardLabels = Pick<\n MosaicAgentCardProps,\n | \"activeBadgeLabel\"\n | \"agentActionsAriaLabel\"\n | \"deactivateLabel\"\n | \"activateLabel\"\n | \"editLabel\"\n | \"deleteLabel\"\n | \"pauseLabel\"\n | \"startLabel\"\n | \"createdLabel\"\n>;\n\n// ── Utility ───────────────────────────────────────────────────────────────────\n\nfunction cn(...classes: (string | undefined | null | false)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\nexport interface MosaicAgentListProps {\n agents: MosaicAgentData[];\n filters?: MosaicFilterOption[];\n selectedFilter: string;\n onFilterChange: (id: string) => void;\n categories?: MosaicFilterOption[];\n selectedCategory: string;\n onCategoryChange: (id: string) => void;\n onToggleStatus?: (agentId: string) => void;\n onDeleteAgent?: (agentId: string) => void;\n onEditAgent?: (agentId: string) => void;\n onCreateAgent?: () => void;\n /** Slot for header-right actions (e.g. OrgSwitcher) */\n headerActions?: React.ReactNode;\n /** Section heading. Required, no default. */\n title: string;\n /** Search input placeholder. Required, no default. */\n searchPlaceholder: string;\n /** Label for the \"create agent\" button. Required, no default. */\n createLabel: string;\n /**\n * Message shown when the filtered agent list is empty. Required — the\n * host owns the language (e.g. `t('AgentList.empty')`). No default.\n */\n emptyMessage: string;\n /**\n * aria-label for the mobile \"open filters\" button. Required — host-owned,\n * no default.\n */\n openFiltersAriaLabel: string;\n /** Title of the mobile filters modal. Required — host-owned, no default. */\n filtersModalTitle: string;\n /**\n * aria-label for the mobile filters modal close button. Required —\n * host-owned, no default.\n */\n closeFiltersAriaLabel: string;\n /** Required host-owned strings forwarded to every MosaicAgentCard. */\n agentCardLabels: MosaicAgentListCardLabels;\n /** Forwarded to MosaicFilterSidebar — required, host-owned, no default. */\n expandFiltersAriaLabel: string;\n /** Forwarded to MosaicFilterSidebar — required, host-owned, no default. */\n categoriesHeading: string;\n /** Forwarded to MosaicFilterSidebar — required, host-owned, no default. */\n collapseSidebarAriaLabel: string;\n /** Forwarded to MosaicFilterSidebar — required, host-owned, no default. */\n expandSidebarAriaLabel: string;\n className?: string;\n}\n\n// ── Inline icons ──────────────────────────────────────────────────────────────\n\nfunction SearchIcon() {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\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 >\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <line x1=\"21\" y1=\"21\" x2=\"16.65\" y2=\"16.65\" />\n </svg>\n );\n}\n\nfunction PlusIcon() {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\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 >\n <line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\" />\n <line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\" />\n </svg>\n );\n}\n\nfunction FilterIcon() {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\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 >\n <polygon points=\"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3\" />\n </svg>\n );\n}\n\n// ── Desktop variant ───────────────────────────────────────────────────────────\n\nfunction AgentListDesktop({\n agents,\n filters,\n selectedFilter,\n onFilterChange,\n categories,\n selectedCategory,\n onCategoryChange,\n onToggleStatus,\n onDeleteAgent,\n onEditAgent,\n onCreateAgent,\n headerActions,\n title,\n searchPlaceholder,\n createLabel,\n emptyMessage,\n agentCardLabels,\n expandFiltersAriaLabel,\n categoriesHeading,\n collapseSidebarAriaLabel,\n expandSidebarAriaLabel,\n}: MosaicAgentListProps) {\n const [query, setQuery] = React.useState(\"\");\n const [sidebarCollapsed, setSidebarCollapsed] = React.useState(false);\n\n const filtered = agents.filter(\n (a) =>\n !query ||\n a.name.toLowerCase().includes(query.toLowerCase()) ||\n a.description?.toLowerCase().includes(query.toLowerCase()),\n );\n\n return (\n <div data-slot=\"agent-list-desktop\" className=\"flex h-full flex-col\">\n {/* Header */}\n <div className=\"flex items-center justify-between border-b border-border px-6 py-4\">\n <div className=\"flex items-center gap-4\">\n {headerActions}\n <h1 className=\"text-lg font-semibold\">{title}</h1>\n </div>\n </div>\n\n <div className=\"flex flex-1 min-h-0\">\n {/* Filter sidebar */}\n <MosaicFilterSidebar\n isCollapsed={sidebarCollapsed}\n onToggleCollapse={() => setSidebarCollapsed((v) => !v)}\n filters={filters}\n selectedFilter={selectedFilter}\n onFilterChange={onFilterChange}\n categories={categories}\n selectedCategory={selectedCategory}\n onCategoryChange={onCategoryChange}\n expandFiltersAriaLabel={expandFiltersAriaLabel}\n categoriesHeading={categoriesHeading}\n collapseSidebarAriaLabel={collapseSidebarAriaLabel}\n expandSidebarAriaLabel={expandSidebarAriaLabel}\n />\n\n {/* Main content */}\n <div className=\"flex flex-1 flex-col min-w-0\">\n {/* Toolbar */}\n <div className=\"border-b border-border px-6 py-4\">\n <div className=\"flex items-center gap-3\">\n <div className=\"relative flex-1 max-w-md\">\n <span className=\"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground\">\n <SearchIcon />\n </span>\n <input\n type=\"search\"\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n placeholder={searchPlaceholder}\n className={cn(\n \"w-full rounded-md border border-input bg-background py-2 pl-9 pr-3\",\n \"text-sm placeholder:text-muted-foreground\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n )}\n />\n </div>\n {onCreateAgent && (\n <button\n type=\"button\"\n onClick={onCreateAgent}\n className={cn(\n \"inline-flex items-center gap-2 rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground\",\n \"hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n )}\n >\n <PlusIcon />\n {createLabel}\n </button>\n )}\n </div>\n </div>\n\n {/* Grid */}\n <div className=\"flex-1 overflow-y-auto p-6\">\n {filtered.length === 0 && (\n <p className=\"py-12 text-center text-sm text-muted-foreground\">{emptyMessage}</p>\n )}\n <div className=\"grid gap-4 grid-cols-1 md:grid-cols-2 lg:grid-cols-3\">\n {filtered.map((agent) => (\n <MosaicAgentCard\n key={agent.id}\n agent={agent}\n onToggleStatus={onToggleStatus}\n onDelete={onDeleteAgent}\n onEdit={onEditAgent}\n {...agentCardLabels}\n />\n ))}\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n}\n\n// ── Mobile variant ────────────────────────────────────────────────────────────\n\nfunction AgentListMobile({\n agents,\n filters,\n selectedFilter,\n onFilterChange,\n categories,\n selectedCategory,\n onCategoryChange,\n onToggleStatus,\n onDeleteAgent,\n onEditAgent,\n onCreateAgent,\n title,\n searchPlaceholder,\n createLabel,\n emptyMessage,\n openFiltersAriaLabel,\n filtersModalTitle,\n closeFiltersAriaLabel,\n agentCardLabels,\n expandFiltersAriaLabel,\n categoriesHeading,\n collapseSidebarAriaLabel,\n expandSidebarAriaLabel,\n}: MosaicAgentListProps) {\n const [filterOpen, setFilterOpen] = React.useState(false);\n const [query, setQuery] = React.useState(\"\");\n\n const filtered = agents.filter(\n (a) =>\n !query ||\n a.name.toLowerCase().includes(query.toLowerCase()) ||\n a.description?.toLowerCase().includes(query.toLowerCase()),\n );\n\n return (\n <div data-slot=\"agent-list-mobile\" className=\"flex flex-col\">\n {/* Sticky header */}\n <div className=\"sticky top-0 z-10 border-b border-border bg-background px-4 py-3\">\n <div className=\"flex items-center justify-between\">\n <h1 className=\"text-base font-semibold\">{title}</h1>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => setFilterOpen(true)}\n className={cn(\n \"inline-flex h-9 w-9 items-center justify-center rounded-md\",\n \"border border-border bg-background text-foreground\",\n \"hover:bg-accent hover:text-accent-foreground\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n )}\n aria-label={openFiltersAriaLabel}\n >\n <FilterIcon />\n </button>\n {onCreateAgent && (\n <button\n type=\"button\"\n onClick={onCreateAgent}\n className={cn(\n \"inline-flex h-9 items-center gap-1.5 rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground\",\n \"hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n )}\n >\n <PlusIcon />\n {createLabel}\n </button>\n )}\n </div>\n </div>\n <div className=\"relative mt-2\">\n <span className=\"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground\">\n <SearchIcon />\n </span>\n <input\n type=\"search\"\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n placeholder={searchPlaceholder}\n className={cn(\n \"w-full rounded-md border border-input bg-background py-2 pl-9 pr-3\",\n \"text-sm placeholder:text-muted-foreground\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n )}\n />\n </div>\n </div>\n\n {/* Agent cards */}\n <div className=\"space-y-3 p-4\">\n {filtered.map((agent) => (\n <MosaicAgentCard\n key={agent.id}\n agent={agent}\n onToggleStatus={onToggleStatus}\n onDelete={onDeleteAgent}\n onEdit={onEditAgent}\n {...agentCardLabels}\n />\n ))}\n {filtered.length === 0 && (\n <p className=\"py-10 text-center text-sm text-muted-foreground\">{emptyMessage}</p>\n )}\n </div>\n\n {/* Filter modal */}\n <MosaicAdaptiveModal\n isOpen={filterOpen}\n onClose={() => setFilterOpen(false)}\n title={filtersModalTitle}\n closeAriaLabel={closeFiltersAriaLabel}\n >\n <div className=\"p-4\">\n <MosaicFilterSidebar\n isCollapsed={false}\n onToggleCollapse={() => setFilterOpen(false)}\n filters={filters}\n selectedFilter={selectedFilter}\n onFilterChange={(id) => {\n onFilterChange(id);\n setFilterOpen(false);\n }}\n categories={categories}\n selectedCategory={selectedCategory}\n expandFiltersAriaLabel={expandFiltersAriaLabel}\n categoriesHeading={categoriesHeading}\n collapseSidebarAriaLabel={collapseSidebarAriaLabel}\n expandSidebarAriaLabel={expandSidebarAriaLabel}\n onCategoryChange={(id) => {\n onCategoryChange(id);\n setFilterOpen(false);\n }}\n />\n </div>\n </MosaicAdaptiveModal>\n </div>\n );\n}\n\n// ── Orchestrator ──────────────────────────────────────────────────────────────\n\nexport function MosaicAgentList(props: MosaicAgentListProps) {\n const { isMobile } = useDevice();\n return isMobile ? <AgentListMobile {...props} /> : <AgentListDesktop {...props} />;\n}\n\nMosaicAgentList.displayName = \"MosaicAgentList\";\n\nexport { AgentListDesktop as MosaicAgentListDesktop };\nexport { AgentListMobile as MosaicAgentListMobile };\n"
18
+ }
19
+ ],
20
+ "type": "registry:ui"
21
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-agent-preview",
4
+ "title": "MosaicAgentPreview",
5
+ "description": "MosaicAgentPreview — presentational, controlled preview of an agent configuration before creation is confirmed.",
6
+ "dependencies": [],
7
+ "registryDependencies": [],
8
+ "files": [
9
+ {
10
+ "path": "src/components/agent-preview/MosaicAgentPreview.tsx",
11
+ "type": "registry:ui",
12
+ "content": "/**\n * MosaicAgentPreview — presentational, controlled preview of an agent\n * configuration before creation is confirmed.\n *\n * Ported from components/agent-config/AgentPreview.tsx (any-debate-ai).\n *\n * Pure presentational — no business data (roles/personas/frameworks/models\n * are host-domain concepts and are NOT baked into this component). The host\n * passes a generic list of `attributes` (label/value pairs) for the\n * \"detailed\" variant, or a single `tagline` for the \"summary\" variant.\n *\n * Contract is non-lying: `variant` is a discriminated union — `tagline` +\n * `badgeLabel` only exist on the \"summary\" shape, `title` + `attributes` only\n * exist on the \"detailed\" shape. A field is required exactly where it is read.\n */\n\nimport { agentPreviewVariants } from \"./agent-preview-variants.js\";\n\n// ── Utility ───────────────────────────────────────────────────────────────────\n\nfunction cn(...classes: (string | undefined | null | false)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\nexport interface MosaicAgentPreviewAttribute {\n id: string;\n label: string;\n value: string;\n}\n\ninterface MosaicAgentPreviewBaseProps {\n /** The agent's display name. Required — no default, no fallback string. */\n name: string;\n className?: string;\n}\n\nexport interface MosaicAgentPreviewSummaryProps extends MosaicAgentPreviewBaseProps {\n variant: \"summary\";\n /** One-line description shown under the name. Required — host-owned. */\n tagline: string;\n /** Label for the trailing badge (e.g. \"Custom\"). Required — host-owned. */\n badgeLabel: string;\n}\n\nexport interface MosaicAgentPreviewDetailedProps extends MosaicAgentPreviewBaseProps {\n variant: \"detailed\";\n /** Card title (e.g. \"Configuration Summary\"). Required — host-owned. */\n title: string;\n /** Generic label/value rows. Required — no business data baked in. */\n attributes: MosaicAgentPreviewAttribute[];\n}\n\nexport type MosaicAgentPreviewProps =\n | MosaicAgentPreviewSummaryProps\n | MosaicAgentPreviewDetailedProps;\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\n/**\n * MosaicAgentPreview — read-only preview of an agent configuration before\n * the host confirms creation.\n *\n * @example\n * <MosaicAgentPreview\n * variant=\"summary\"\n * name=\"StrategyBot\"\n * tagline=\"Analyst • Formal • Claude Sonnet\"\n * badgeLabel=\"Custom\"\n * />\n *\n * @example\n * <MosaicAgentPreview\n * variant=\"detailed\"\n * name=\"StrategyBot\"\n * title=\"Configuration Summary\"\n * attributes={[{ id: \"role\", label: \"Role\", value: \"Strategist\" }]}\n * />\n */\nexport function MosaicAgentPreview(props: MosaicAgentPreviewProps) {\n if (props.variant === \"detailed\") {\n const { name, title, attributes, className } = props;\n return (\n <div\n data-slot=\"agent-preview\"\n className={cn(agentPreviewVariants({ variant: \"detailed\" }), className)}\n >\n <div data-slot=\"agent-preview-header\" className=\"p-4 pb-0\">\n <p className=\"text-base font-semibold leading-none tracking-tight\">{title}</p>\n </div>\n <div className=\"p-4\">\n <p className=\"mb-3 truncate text-sm font-medium\">{name}</p>\n {attributes.length > 0 && (\n <ul className=\"space-y-2\">\n {attributes.map((attribute) => (\n <li\n key={attribute.id}\n data-slot=\"agent-preview-attribute\"\n className=\"flex items-start justify-between gap-3\"\n >\n <span className=\"text-xs font-medium text-muted-foreground\">\n {attribute.label}\n </span>\n <span className=\"text-xs font-medium\">{attribute.value}</span>\n </li>\n ))}\n </ul>\n )}\n </div>\n </div>\n );\n }\n\n const { name, tagline, badgeLabel, className } = props;\n return (\n <div\n data-slot=\"agent-preview\"\n className={cn(agentPreviewVariants({ variant: \"summary\" }), className)}\n >\n <span\n aria-hidden=\"true\"\n data-slot=\"agent-preview-avatar\"\n className=\"h-10 w-10 shrink-0 rounded-full bg-primary/10\"\n />\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-medium\">{name}</p>\n <p className=\"truncate text-xs text-muted-foreground\">{tagline}</p>\n </div>\n <span\n data-slot=\"agent-preview-badge\"\n className=\"shrink-0 rounded-full bg-secondary px-2.5 py-0.5 text-xs font-semibold text-secondary-foreground\"\n >\n {badgeLabel}\n </span>\n </div>\n );\n}\n\nMosaicAgentPreview.displayName = \"MosaicAgentPreview\";\n"
13
+ },
14
+ {
15
+ "path": "src/components/agent-preview/agent-preview-variants.ts",
16
+ "type": "registry:ui",
17
+ "content": "/**\n * agentPreviewVariants — pure CVA variant function for MosaicAgentPreview.\n *\n * Isolated in its own module so it can be re-exported from the\n * `@vantageos/mosaic-blocks/server` subpath without pulling in React.\n *\n * Zero browser / React runtime dependencies — safe in RSC / Node.js.\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const agentPreviewVariants = cva([\"rounded-lg border border-border\"], {\n variants: {\n variant: {\n summary: [\"flex items-center gap-3 p-3 bg-background\"],\n detailed: [],\n },\n },\n defaultVariants: {\n variant: \"summary\",\n },\n});\n"
18
+ }
19
+ ],
20
+ "type": "registry:ui"
21
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-alert-dialog",
4
+ "title": "MosaicAlertDialog",
5
+ "description": "MosaicAlertDialog — confirm-before-irreversible-action dialog (compound API)",
6
+ "dependencies": [
7
+ "@base-ui/react"
8
+ ],
9
+ "registryDependencies": [],
10
+ "files": [
11
+ {
12
+ "path": "src/components/alert-dialog/MosaicAlertDialog.tsx",
13
+ "type": "registry:ui",
14
+ "content": "\"use client\";\n\n/**\n * MosaicAlertDialog — confirm-before-irreversible-action dialog (compound API)\n *\n * Ported from any-debate-ai components/ui/alert-dialog.tsx\n * (source: gh api repos/elpiarthera/any-debate-ai/contents/components/ui/alert-dialog.tsx)\n *\n * Radix (`@radix-ui/react-alert-dialog`) replaced with `@base-ui/react/alert-dialog`\n * per ADR-0001 — deps locked to @base-ui/react + class-variance-authority, no\n * radix, no vaul. `buttonVariants` from the shadcn source replaced with local\n * button-like classes (kept in-file to avoid a hard dependency between two\n * public components — MosaicButton is a separate export).\n *\n * Zero branding, zero copy: every visible string is a REQUIRED prop with no\n * default (SIN-01) — Title/Description/Cancel/Action are compound\n * components whose `children` is the required string; there is no `??`, no\n * `||`, no default-parameter fallback anywhere in this file.\n *\n * Accessibility (the reason this component exists — a human must be able to\n * say no):\n * - `role=\"alertdialog\"` is set automatically by @base-ui/react/alert-dialog\n * (AlertDialog.Root sets it, distinct from the plain \"dialog\" role).\n * - `aria-labelledby` / `aria-describedby` are wired automatically by\n * @base-ui/react from Title / Description element ids.\n * - Focus trap: @base-ui/react/alert-dialog Popup traps Tab within the popup.\n * - Escape closes and is treated as CANCEL, never as confirm — Escape only\n * ever calls `onOpenChange(false)`, it never calls the confirm handler.\n * - Focus returns to the trigger element on close (Popup `finalFocus`\n * default behavior).\n * - The destructive action is never the default focus target: DOM order\n * places MosaicAlertDialogCancel before MosaicAlertDialogAction, and\n * @base-ui/react's default `initialFocus` picks the FIRST tabbable element\n * in the popup — i.e. Cancel. A reflex Enter never destroys anything.\n */\n\nimport { AlertDialog as AlertDialogPrimitive } from \"@base-ui/react/alert-dialog\";\nimport type * as React from \"react\";\nimport { alertDialogContentVariants, alertDialogOverlayVariants } from \"./alert-dialog-variants.js\";\n\n// ── Utility ───────────────────────────────────────────────────────────────────\n\nfunction cn(...classes: (string | undefined | null | false)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n\n// ── Root / Trigger / Portal ──────────────────────────────────────────────────\n\nexport function MosaicAlertDialog(props: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {\n return <AlertDialogPrimitive.Root data-slot=\"alert-dialog\" {...props} />;\n}\nMosaicAlertDialog.displayName = \"MosaicAlertDialog\";\n\nexport function MosaicAlertDialogTrigger(\n props: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>,\n) {\n return <AlertDialogPrimitive.Trigger data-slot=\"alert-dialog-trigger\" {...props} />;\n}\nMosaicAlertDialogTrigger.displayName = \"MosaicAlertDialogTrigger\";\n\nexport function MosaicAlertDialogPortal(\n props: React.ComponentProps<typeof AlertDialogPrimitive.Portal>,\n) {\n return <AlertDialogPrimitive.Portal data-slot=\"alert-dialog-portal\" {...props} />;\n}\nMosaicAlertDialogPortal.displayName = \"MosaicAlertDialogPortal\";\n\n// ── Overlay ───────────────────────────────────────────────────────────────────\n\nexport interface MosaicAlertDialogOverlayProps\n extends React.ComponentProps<typeof AlertDialogPrimitive.Backdrop> {\n className?: string;\n}\n\nexport function MosaicAlertDialogOverlay({ className, ...props }: MosaicAlertDialogOverlayProps) {\n return (\n <AlertDialogPrimitive.Backdrop\n data-slot=\"alert-dialog-overlay\"\n className={cn(alertDialogOverlayVariants(), className)}\n {...props}\n />\n );\n}\nMosaicAlertDialogOverlay.displayName = \"MosaicAlertDialogOverlay\";\n\n// ── Content ───────────────────────────────────────────────────────────────────\n\nexport interface MosaicAlertDialogContentProps\n extends React.ComponentProps<typeof AlertDialogPrimitive.Popup> {\n className?: string;\n}\n\nexport function MosaicAlertDialogContent({ className, ...props }: MosaicAlertDialogContentProps) {\n return (\n <MosaicAlertDialogPortal>\n <MosaicAlertDialogOverlay />\n <AlertDialogPrimitive.Popup\n data-slot=\"alert-dialog-content\"\n className={cn(alertDialogContentVariants(), className)}\n {...props}\n />\n </MosaicAlertDialogPortal>\n );\n}\nMosaicAlertDialogContent.displayName = \"MosaicAlertDialogContent\";\n\n// ── Header / Footer ──────────────────────────────────────────────────────────\n\nexport function MosaicAlertDialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"alert-dialog-header\"\n className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n {...props}\n />\n );\n}\nMosaicAlertDialogHeader.displayName = \"MosaicAlertDialogHeader\";\n\nexport function MosaicAlertDialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"alert-dialog-footer\"\n className={cn(\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\", className)}\n {...props}\n />\n );\n}\nMosaicAlertDialogFooter.displayName = \"MosaicAlertDialogFooter\";\n\n// ── Title / Description ──────────────────────────────────────────────────────\n\nexport interface MosaicAlertDialogTitleProps\n extends Omit<React.ComponentProps<typeof AlertDialogPrimitive.Title>, \"children\"> {\n className?: string;\n /** Dialog title text. Required — the host owns the language, no default. */\n children: React.ReactNode;\n}\n\nexport function MosaicAlertDialogTitle({\n className,\n children,\n ...props\n}: MosaicAlertDialogTitleProps) {\n return (\n <AlertDialogPrimitive.Title\n data-slot=\"alert-dialog-title\"\n className={cn(\"text-lg font-semibold text-foreground\", className)}\n {...props}\n >\n {children}\n </AlertDialogPrimitive.Title>\n );\n}\nMosaicAlertDialogTitle.displayName = \"MosaicAlertDialogTitle\";\n\nexport interface MosaicAlertDialogDescriptionProps\n extends Omit<React.ComponentProps<typeof AlertDialogPrimitive.Description>, \"children\"> {\n className?: string;\n /** Dialog description text. Required — the host owns the language, no default. */\n children: React.ReactNode;\n}\n\nexport function MosaicAlertDialogDescription({\n className,\n children,\n ...props\n}: MosaicAlertDialogDescriptionProps) {\n return (\n <AlertDialogPrimitive.Description\n data-slot=\"alert-dialog-description\"\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n >\n {children}\n </AlertDialogPrimitive.Description>\n );\n}\nMosaicAlertDialogDescription.displayName = \"MosaicAlertDialogDescription\";\n\n// ── Action / Cancel ───────────────────────────────────────────────────────────\n//\n// DOM order matters for accessibility: Cancel MUST be rendered before Action\n// so that @base-ui/react's default `initialFocus` (first tabbable element)\n// lands on Cancel, never on the destructive Action. See MosaicAlertDialogFooter\n// usage guidance in the stories/README — Cancel first, Action second.\n\nexport interface MosaicAlertDialogActionProps\n extends Omit<React.ComponentProps<typeof AlertDialogPrimitive.Close>, \"children\"> {\n className?: string;\n /** Confirm button label. Required — the host owns the language, no default. */\n children: React.ReactNode;\n}\n\nexport function MosaicAlertDialogAction({\n className,\n children,\n ...props\n}: MosaicAlertDialogActionProps) {\n return (\n <AlertDialogPrimitive.Close\n data-slot=\"alert-dialog-action\"\n className={cn(\n \"inline-flex h-9 items-center justify-center gap-1.5 rounded-md px-4\",\n \"bg-destructive text-sm font-medium text-destructive-foreground\",\n \"hover:bg-destructive/90\",\n \"focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n {children}\n </AlertDialogPrimitive.Close>\n );\n}\nMosaicAlertDialogAction.displayName = \"MosaicAlertDialogAction\";\n\nexport interface MosaicAlertDialogCancelProps\n extends Omit<React.ComponentProps<typeof AlertDialogPrimitive.Close>, \"children\"> {\n className?: string;\n /** Cancel button label. Required — the host owns the language, no default. */\n children: React.ReactNode;\n}\n\nexport function MosaicAlertDialogCancel({\n className,\n children,\n ...props\n}: MosaicAlertDialogCancelProps) {\n return (\n <AlertDialogPrimitive.Close\n data-slot=\"alert-dialog-cancel\"\n className={cn(\n \"inline-flex h-9 items-center justify-center gap-1.5 rounded-md border border-border px-4\",\n \"bg-background text-sm font-medium text-foreground shadow-xs\",\n \"hover:bg-muted hover:text-foreground\",\n \"focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring\",\n \"disabled:pointer-events-none disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n {children}\n </AlertDialogPrimitive.Close>\n );\n}\nMosaicAlertDialogCancel.displayName = \"MosaicAlertDialogCancel\";\n"
15
+ },
16
+ {
17
+ "path": "src/components/alert-dialog/alert-dialog-variants.ts",
18
+ "type": "registry:ui",
19
+ "content": "/**\n * alertDialogContentVariants — pure CVA variant function for MosaicAlertDialog content.\n *\n * Isolated in its own module so it can be re-exported from the\n * `@vantageos/mosaic-blocks/server` subpath without pulling in\n * React or @base-ui/react (which live in MosaicAlertDialog.tsx but not here).\n *\n * Zero browser / React runtime dependencies — safe in RSC / Node.js.\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const alertDialogContentVariants = cva([\n \"fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)]\",\n \"-translate-x-1/2 -translate-y-1/2 gap-4\",\n \"rounded-lg border border-border bg-background p-6 shadow-lg\",\n \"sm:max-w-lg\",\n]);\n\nexport const alertDialogOverlayVariants = cva([\"fixed inset-0 z-50 bg-black/50\"]);\n"
20
+ }
21
+ ],
22
+ "type": "registry:ui"
23
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-animated-list",
4
+ "title": "MosaicAnimatedList",
5
+ "description": "Staggered reveal list. Children animate in on mount via CSS keyframe + inline animation-delay. Props: stagger?, children, as?. No motion dep. Respects prefers-reduced-motion.",
6
+ "dependencies": [],
7
+ "registryDependencies": [],
8
+ "files": [
9
+ {
10
+ "path": "src/components/animated-list/MosaicAnimatedList.tsx",
11
+ "type": "registry:ui",
12
+ "content": "\"use client\";\n\n/**\n * MosaicAnimatedList — staggered reveal list\n *\n * Ported from heyfabrika/styleui components/animated-list (MIT).\n * Animation decision: CSS keyframe animation with inline `animation-delay` stagger.\n * No `motion` dependency — saves ~45 kb gzip. This matches styleui's approach\n * of preferring CSS-first animation for simple stagger reveals.\n * Bundle impact: 0 extra deps (pure CSS animations).\n * Respects prefers-reduced-motion.\n */\n\nimport * as React from \"react\";\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\nexport interface MosaicAnimatedListProps {\n /** Delay between each item animation in ms (default 80) */\n stagger?: number;\n children: React.ReactNode;\n className?: string;\n /** Wrapper element tag (default \"ul\") */\n as?: \"ul\" | \"ol\" | \"div\";\n ref?: React.Ref<HTMLUListElement & HTMLOListElement & HTMLDivElement>;\n}\n\n// ── Keyframe style injection ──────────────────────────────────────────────────\n\nconst ANIMATION_ID = \"mosaic-animated-list-kf\";\n\nfunction injectKeyframes() {\n if (typeof document === \"undefined\") return;\n if (document.getElementById(ANIMATION_ID)) return;\n const style = document.createElement(\"style\");\n style.id = ANIMATION_ID;\n style.textContent = `\n @keyframes mosaic-list-item-in {\n from { opacity: 0; transform: translateY(12px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @media (prefers-reduced-motion: reduce) {\n .mosaic-list-item { animation: none !important; opacity: 1 !important; transform: none !important; }\n }\n `;\n document.head.appendChild(style);\n}\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\n/**\n * MosaicAnimatedList — wraps children in a list, stagger-revealing each item\n * on mount via CSS keyframe animations. Accessible: respects prefers-reduced-motion.\n *\n * @example\n * <MosaicAnimatedList stagger={100}>\n * <li>First feature</li>\n * <li>Second feature</li>\n * <li>Third feature</li>\n * </MosaicAnimatedList>\n */\nexport function MosaicAnimatedList({\n stagger = 80,\n children,\n className,\n as: Tag = \"ul\",\n ref,\n}: MosaicAnimatedListProps) {\n React.useEffect(() => {\n injectKeyframes();\n }, []);\n\n const items = React.Children.toArray(children);\n\n return (\n <Tag\n ref={ref as React.Ref<HTMLUListElement & HTMLOListElement & HTMLDivElement>}\n className={className}\n >\n {items.map((child, i) => {\n // React.Children.toArray() assigns stable .key values like \".$key\"\n const stableKey = (child as React.ReactElement).key ?? `item-${i}`;\n return (\n <React.Fragment key={stableKey}>\n <div\n className=\"mosaic-list-item\"\n style={{\n opacity: 0,\n animation: `mosaic-list-item-in 400ms ease-out ${i * stagger}ms forwards`,\n }}\n >\n {child}\n </div>\n </React.Fragment>\n );\n })}\n </Tag>\n );\n}\n\nMosaicAnimatedList.displayName = \"MosaicAnimatedList\";\n"
13
+ }
14
+ ],
15
+ "type": "registry:ui"
16
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-api-key-panel",
4
+ "title": "MosaicApiKeyPanel",
5
+ "description": "MosaicApiKeyPanel — presentational \"bring your own key\" (BYOK) panel.",
6
+ "dependencies": [],
7
+ "registryDependencies": [],
8
+ "files": [
9
+ {
10
+ "path": "src/components/api-key-panel/MosaicApiKeyPanel.tsx",
11
+ "type": "registry:ui",
12
+ "content": "/**\n * MosaicApiKeyPanel — presentational \"bring your own key\" (BYOK) panel.\n *\n * Presentational atom. Renders per-provider tabs (data-driven — the host\n * supplies the provider list, never a hardcoded set), a masked\n * (`type=\"password\"`) key input, a validate button, and one of four\n * host-controlled statuses: at rest (idle), validating, valid (with a\n * masked hint of the last 4 characters of an already-saved key), or\n * invalid (with a host-supplied error message). The component never\n * contacts any server or SDK: submitting the form calls the host callback\n * `onValidate(providerId, key)` — the host owns how the key is checked\n * against its provider (Vercel AI Gateway, OpenRouter, or anything else it\n * lists) and how long it takes.\n *\n * Security (non-negotiable, see JSDoc on each prop below): the raw key is\n * never logged, never written to storage by this library, and never\n * placed in any DOM attribute other than the password input's own\n * `value` (the same place any host-controlled `<input type=\"password\">`\n * necessarily holds it while the user types). No `console.*` call touches\n * the key. Only the last 4 characters of an *already-saved* key are ever\n * displayed, and only because the host explicitly supplies them via\n * `savedKeyLastFour` on the \"valid\" branch — this component computes\n * nothing from a live key itself.\n *\n * Pattern: MosaicUrlScraper.tsx (data-slot, inline cn, React 19 ref prop,\n * displayName, JSDoc, pure variants module, host-controlled status union\n * as a discriminated prop type, per-branch required props).\n * No \"use client\" — prepend-use-client.mjs adds it to dist.\n * Design tokens: --foreground, --muted-foreground, --border, --destructive,\n * --ring, --accent, --card, --background.\n * No icon library.\n * a11y: the provider selector is a `role=\"radiogroup\"` with a required\n * `tabsAriaLabel`; each tab is a `role=\"radio\"` with `aria-checked`; the\n * key input has a required accessible name; the validating region uses\n * `role=\"status\"`.\n * Bilingual: every user-facing string (tab labels/tabs aria-label/input\n * aria-label/validate button label/validating label/saved-key hint\n * label/remove button label/error message) is a required caller-supplied\n * prop — zero hardcoded copy, zero default.\n *\n * Ported from any-debate-ai (Eve) apps/web/src/lib/components/\n * ApiKeyDialog.svelte + apiKey.svelte.ts (rewritten from scratch — no\n * shared code, no license carried over): dropped the modal-dialog chrome,\n * the localStorage persistence (`modelKey` store — presentational\n * libraries never own storage, the host does), the hardcoded gateway/\n * openrouter provider table (now host-supplied `providers` data), and the\n * direct Convex `action` call (now the `onValidate` callback — this\n * library talks to no server). Kept: per-provider tab toggle, masked\n * input, validate/checking/error states, and the \"last 4 characters of a\n * saved key\" hint pattern.\n *\n * Props are pushed into the `MosaicApiKeyPanelState` discriminated union\n * exactly where they are read — no prop is required in a status branch\n * that never renders it (e.g. `validatingLabel` only exists on the\n * \"validating\" variant; `savedKeyLastFour`/`savedKeyHintLabel`/\n * `removeButtonLabel`/`onRemove` only on \"valid\"; `errorMessage` only on\n * \"invalid\").\n *\n * @example\n * // idle\n * <MosaicApiKeyPanel\n * status=\"idle\"\n * providers={[\n * { id: \"gateway\", label: \"Vercel AI Gateway\", placeholder: \"vck_…\" },\n * { id: \"openrouter\", label: \"OpenRouter\", placeholder: \"sk-or-v1-…\" },\n * ]}\n * activeProviderId=\"gateway\"\n * onProviderChange={setActiveProviderId}\n * tabsAriaLabel=\"Fournisseur de clé\"\n * keyValue={draft}\n * onKeyChange={setDraft}\n * onValidate={(providerId, key) => validate(providerId, key)}\n * inputAriaLabel=\"Clé API\"\n * validateButtonLabel=\"Valider et entrer\"\n * />\n *\n * @example\n * // valid (a key is already saved)\n * <MosaicApiKeyPanel\n * {...baseProps}\n * status=\"valid\"\n * savedKeyLastFour=\"a1b2\"\n * savedKeyHintLabel={(lastFour) => `Une clé se terminant par …${lastFour} est enregistrée.`}\n * removeButtonLabel=\"Retirer\"\n * onRemove={() => removeKey()}\n * />\n */\n\nimport type * as React from \"react\";\nimport {\n apiKeyPanelInputVariants,\n apiKeyPanelMessageVariants,\n apiKeyPanelTabVariants,\n} from \"./api-key-panel-variants.js\";\n\n// ── Utility ───────────────────────────────────────────────────────────────────\n\nfunction cn(...classes: (string | undefined | null | false)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\n/** Host-supplied model-key provider (tab), e.g. Vercel AI Gateway / OpenRouter. */\nexport interface MosaicApiKeyPanelProvider {\n /** Stable provider identifier, e.g. \"gateway\" / \"openrouter\". */\n id: string;\n /** Tab label, displayed as-is. */\n label: string;\n /** Placeholder for the key input when this provider is active. */\n placeholder: string;\n}\n\n/**\n * Base props required in EVERY status — read unconditionally by the\n * component regardless of `status` (provider tabs + key input + submit\n * row, all reachable from \"idle\").\n */\ntype MosaicApiKeyPanelBaseProps = {\n /** Host-supplied provider list. Data, never a hardcoded set. */\n providers: MosaicApiKeyPanelProvider[];\n /** `id` of the currently-selected provider (must match a `providers[].id`). */\n activeProviderId: string;\n /** Called with the provider `id` when a tab is activated. */\n onProviderChange: (providerId: string) => void;\n /** Accessible name for the provider tab group (`aria-label`). Required, no default. */\n tabsAriaLabel: string;\n /**\n * Host-controlled current key input value. Never persisted by this\n * library (no localStorage) — the host owns where, if anywhere, this\n * value is kept.\n */\n keyValue: string;\n /** Called with the raw input value on every keystroke. */\n onKeyChange: (key: string) => void;\n /**\n * Called with the active provider id and the trimmed key on submit.\n * The component performs no validation itself — the host decides how\n * the key is checked and how `status`/`errorMessage` are updated\n * afterward. Never call this with an empty key.\n */\n onValidate: (providerId: string, key: string) => void;\n /** Accessible name for the key input (`aria-label`). Required, no default. */\n inputAriaLabel: string;\n /** Label for the submit button when idle/ready. Required, no default. */\n validateButtonLabel: string;\n /** Additional Tailwind classes on the root element. */\n className?: string;\n /** React 19 ref prop — forwarded to the root element. */\n ref?: React.Ref<HTMLDivElement>;\n};\n\n/**\n * Host-controlled key-validation status. Every prop that is only ever\n * rendered in ONE status branch lives on that branch's variant — not on\n * the base props — so the type contract matches exactly what the\n * component reads.\n */\nexport type MosaicApiKeyPanelState =\n | { status: \"idle\" }\n | {\n status: \"validating\";\n /** Message/label shown while status === \"validating\". Required, no default. */\n validatingLabel: string;\n }\n | {\n status: \"valid\";\n /**\n * Last 4 characters of an already-saved key, supplied by the host\n * (this library never derives this from a live key value itself —\n * it only ever displays what the host explicitly hands it).\n */\n savedKeyLastFour: string;\n /**\n * Host-localized hint text, e.g.\n * `(lastFour) => \\`Key ending in …${lastFour} is saved.\\``.\n * Required — no hardcoded string.\n */\n savedKeyHintLabel: (lastFour: string) => string;\n /** Label for the \"remove saved key\" button. Required, no default. */\n removeButtonLabel: string;\n /** Called when the \"remove saved key\" button is activated. */\n onRemove: () => void;\n }\n | {\n status: \"invalid\";\n /**\n * Host-provided, host-localized error message. The library never\n * generates its own error strings, and never derives one from the\n * rejected key — every occurrence is a distinct required value\n * supplied by the caller.\n */\n errorMessage: string;\n };\n\nexport type MosaicApiKeyPanelProps = MosaicApiKeyPanelBaseProps & MosaicApiKeyPanelState;\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\n/**\n * MosaicApiKeyPanel — production BYOK (\"bring your own key\") atom for\n * @vantageos/mosaic-blocks.\n *\n * Purely presentational: renders provider tabs, a masked key input, and\n * the current status (idle/validating/valid/invalid), and reports a\n * provider change / validate request / remove request via callbacks. No\n * network call, no storage, no key logging.\n */\nexport function MosaicApiKeyPanel(props: MosaicApiKeyPanelProps) {\n const {\n providers,\n activeProviderId,\n onProviderChange,\n tabsAriaLabel,\n keyValue,\n onKeyChange,\n onValidate,\n inputAriaLabel,\n validateButtonLabel,\n className,\n ref,\n } = props;\n\n const isBusy = props.status === \"validating\";\n const activeProvider = providers.find((provider) => provider.id === activeProviderId);\n\n function handleSubmit(event: React.FormEvent<HTMLFormElement>) {\n event.preventDefault();\n const trimmed = keyValue.trim();\n if (!trimmed || isBusy) return;\n onValidate(activeProviderId, trimmed);\n }\n\n function handleKeyChange(event: React.ChangeEvent<HTMLInputElement>) {\n onKeyChange(event.target.value);\n }\n\n return (\n <div ref={ref} data-slot=\"api-key-panel\" className={cn(\"flex flex-col gap-3\", className)}>\n <div\n data-slot=\"api-key-panel-tabs\"\n role=\"radiogroup\"\n aria-label={tabsAriaLabel}\n className=\"flex gap-1 rounded-lg border border-border bg-background p-1\"\n >\n {providers.map((provider) => (\n <label\n key={provider.id}\n data-slot=\"api-key-panel-tab\"\n className={apiKeyPanelTabVariants({ active: provider.id === activeProviderId })}\n >\n <input\n type=\"radio\"\n className=\"sr-only\"\n name=\"api-key-panel-provider\"\n value={provider.id}\n checked={provider.id === activeProviderId}\n disabled={isBusy}\n onChange={() => onProviderChange(provider.id)}\n />\n {provider.label}\n </label>\n ))}\n </div>\n\n <form data-slot=\"api-key-panel-form\" onSubmit={handleSubmit} className=\"flex flex-col gap-2\">\n <input\n type=\"password\"\n data-slot=\"api-key-panel-input\"\n aria-label={inputAriaLabel}\n placeholder={activeProvider?.placeholder}\n value={keyValue}\n onChange={handleKeyChange}\n disabled={isBusy}\n autoComplete=\"off\"\n spellCheck={false}\n className={apiKeyPanelInputVariants({ invalid: props.status === \"invalid\" })}\n />\n <button\n type=\"submit\"\n data-slot=\"api-key-panel-submit-button\"\n disabled={isBusy || keyValue.trim().length === 0}\n className=\"min-h-9 inline-flex w-fit items-center justify-center rounded-md border border-border px-4 text-sm font-medium transition-colors hover:bg-accent/50 disabled:opacity-50\"\n >\n {props.status === \"validating\" ? props.validatingLabel : validateButtonLabel}\n </button>\n </form>\n\n {props.status === \"validating\" && (\n <output data-slot=\"api-key-panel-validating\">\n <p className={apiKeyPanelMessageVariants({ tone: \"muted\" })}>{props.validatingLabel}</p>\n </output>\n )}\n\n {props.status === \"invalid\" && (\n <p\n data-slot=\"api-key-panel-error-message\"\n className={apiKeyPanelMessageVariants({ tone: \"error\" })}\n >\n {props.errorMessage}\n </p>\n )}\n\n {props.status === \"valid\" && (\n <div\n data-slot=\"api-key-panel-saved-hint\"\n className=\"flex items-center gap-2 text-sm text-muted-foreground\"\n >\n <span data-slot=\"api-key-panel-saved-hint-text\">\n {props.savedKeyHintLabel(props.savedKeyLastFour)}\n </span>\n <button\n type=\"button\"\n data-slot=\"api-key-panel-remove-button\"\n onClick={props.onRemove}\n className=\"cursor-pointer border-none bg-transparent p-0 text-sm text-foreground underline decoration-ring underline-offset-4 hover:decoration-foreground\"\n >\n {props.removeButtonLabel}\n </button>\n </div>\n )}\n </div>\n );\n}\n\nMosaicApiKeyPanel.displayName = \"MosaicApiKeyPanel\";\n"
13
+ },
14
+ {
15
+ "path": "src/components/api-key-panel/api-key-panel-variants.ts",
16
+ "type": "registry:ui",
17
+ "content": "/**\n * apiKeyPanelVariants — pure CVA variant functions for MosaicApiKeyPanel.\n *\n * Isolated in their own module so they can be re-exported from the\n * `@vantageos/mosaic-blocks/server` subpath without pulling in React.\n *\n * Zero browser / React runtime dependencies — safe in RSC / Node.js.\n */\n\nimport { cva } from \"class-variance-authority\";\n\n/** Per-provider tab button variants — active vs. inactive. */\nexport const apiKeyPanelTabVariants = cva(\n [\n \"flex-1 cursor-pointer rounded-md border px-2.5 py-1.5 text-sm font-medium\",\n \"transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n ],\n {\n variants: {\n active: {\n true: \"border-ring bg-accent text-foreground\",\n false: \"border-transparent text-muted-foreground hover:text-foreground\",\n },\n },\n defaultVariants: {\n active: false,\n },\n },\n);\n\n/** Masked key input variants — normal vs. invalid (status === \"invalid\"). */\nexport const apiKeyPanelInputVariants = cva(\n [\n \"min-h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none\",\n \"transition-colors focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50\",\n ],\n {\n variants: {\n invalid: {\n true: \"border-destructive\",\n false: \"border-border\",\n },\n },\n defaultVariants: {\n invalid: false,\n },\n },\n);\n\n/** Inline message text variants by tone. */\nexport const apiKeyPanelMessageVariants = cva([\"text-sm\"], {\n variants: {\n tone: {\n error: \"text-destructive\",\n muted: \"text-muted-foreground\",\n },\n },\n defaultVariants: {\n tone: \"muted\",\n },\n});\n"
18
+ }
19
+ ],
20
+ "type": "registry:ui"
21
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-app-sidebar",
4
+ "title": "MosaicAppSidebar",
5
+ "description": "Collapsible sidebar (64px icon-only / 280px expanded) with nested nav, quick actions, recent items, and footer status slot. Full-width on mobile. Props: navItems[], quickActions[], recentItems[], logoSlot, footerStatus. No hardcoded routes or branding.",
6
+ "dependencies": [],
7
+ "registryDependencies": [
8
+ "https://cdn.jsdelivr.net/npm/@vantageos/mosaic-blocks@0.5.36-alpha/r/mosaic-device-provider.json"
9
+ ],
10
+ "files": [
11
+ {
12
+ "path": "src/components/app-sidebar/MosaicAppSidebar.tsx",
13
+ "type": "registry:ui",
14
+ "content": "\"use client\";\n\n/**\n * MosaicAppSidebar — collapsible nav sidebar + mobile drawer (PC-06)\n *\n * Ported (source: private upstream) components/dashboard/DashboardSidebar.tsx\n *\n * Features:\n * - Collapsible: 64px icon-only / 280–320px expanded\n * - Submenu support (nested nav items)\n * - Quick Actions section (pluggable via props)\n * - Recent Activity section (pluggable via props)\n * - Footer status slot\n * - Mobile: renders full-width when inside AdaptiveModal drawer\n *\n * Generalized: ALL hardcoded debate nav items, hrefs, branding stripped.\n * Now fully props-driven via navItems[], quickActions[], recentItems[], logoSlot.\n * Removed: next/navigation (usePathname, useRouter) → replaced with activePath prop +\n * onNavigate callback so consumers can wire their router.\n * Removed: ScrollArea radix dep → native overflow-y-auto with custom scrollbar.\n *\n * Framer-motion fully replaced with CSS transitions + keyframes.\n * Icons: inline SVG (no lucide dep) for structural icons; nav icons are caller-provided.\n * Respects prefers-reduced-motion.\n */\n\nimport * as React from \"react\";\nimport { useDevice } from \"@/components/ui/MosaicDeviceProvider\";\n\n// ── Utility ───────────────────────────────────────────────────────────────────\n\nfunction cn(...classes: (string | undefined | null | false)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n\n// ── Keyframes ─────────────────────────────────────────────────────────────────\n\nconst ANIM_ID = \"mosaic-sidebar-kf\";\n\nfunction injectStyles() {\n if (typeof document === \"undefined\") return;\n if (document.getElementById(ANIM_ID)) return;\n const s = document.createElement(\"style\");\n s.id = ANIM_ID;\n s.textContent = `\n @keyframes mosaic-sidebar-fade-in {\n from { opacity: 0; transform: translateX(-8px); }\n to { opacity: 1; transform: translateX(0); }\n }\n @keyframes mosaic-submenu-in {\n from { opacity: 0; max-height: 0; }\n to { opacity: 1; max-height: 400px; }\n }\n .mosaic-sidebar-label-in {\n animation: mosaic-sidebar-fade-in 200ms ease-out forwards;\n }\n .mosaic-sidebar-submenu {\n overflow: hidden;\n animation: mosaic-submenu-in 200ms ease-out forwards;\n }\n @media (prefers-reduced-motion: reduce) {\n .mosaic-sidebar-label-in,\n .mosaic-sidebar-submenu {\n animation: none !important;\n opacity: 1 !important;\n max-height: 9999px !important;\n transform: none !important;\n }\n }\n `;\n document.head.appendChild(s);\n}\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\nexport interface MosaicSidebarNavItem {\n /** Stable unique ID */\n id: string;\n label: string;\n href: string;\n /** Icon ReactNode (any SVG/component) */\n icon?: React.ReactNode;\n /** Badge label (e.g. count or \"New\") */\n badge?: string;\n /** Nested submenu items */\n submenu?: Array<{ id: string; label: string; href: string; icon?: React.ReactNode }>;\n}\n\nexport interface MosaicSidebarQuickAction {\n id: string;\n label: string;\n icon?: React.ReactNode;\n onClick: () => void;\n}\n\nexport interface MosaicSidebarRecentItem {\n id: string;\n title: string;\n time: string;\n count?: number;\n}\n\nexport interface MosaicSidebarFooterStatus {\n label: string;\n sublabel?: string;\n icon?: React.ReactNode;\n}\n\ninterface MosaicAppSidebarBaseProps {\n isCollapsed: boolean;\n onToggleCollapse: () => void;\n /** Current active path — used to highlight active nav items */\n activePath?: string;\n /** Called when a nav item is clicked (use to close mobile drawer, push router, etc.) */\n onNavigate?: (href: string) => void;\n /** Navigation items (main nav) */\n navItems?: MosaicSidebarNavItem[];\n /** Quick action buttons */\n quickActions?: MosaicSidebarQuickAction[];\n /** Recent activity items */\n recentItems?: MosaicSidebarRecentItem[];\n /** Logo / brand slot (shown in header when expanded) */\n logoSlot?: React.ReactNode;\n /** Footer status pill */\n footerStatus?: MosaicSidebarFooterStatus;\n /**\n * Position of the collapse/expand chevron toggle. Defaults to \"top\" (inside\n * the header) — the pre-existing behavior, unchanged for current consumers.\n * \"bottom\" anchors it in its own zone below the nav (and below bottomNavItems\n * when present), matching a footer-anchored nav pattern.\n */\n chevronPosition?: \"top\" | \"bottom\";\n /**\n * aria-label for the root `<div>` sidebar landmark. Required — host-owned,\n * no default.\n */\n sidebarAriaLabel: string;\n /** aria-label for the main `<nav>`. Required — host-owned, no default. */\n mainNavAriaLabel: string;\n /** Heading above the quick-actions section. Required — host-owned, no default. */\n quickActionsHeading: string;\n /** Heading above the recent-items section. Required — host-owned, no default. */\n recentHeading: string;\n /** aria-label for the collapse-toggle button when expanded. Required, no default. */\n collapseSidebarAriaLabel: string;\n /** aria-label for the collapse-toggle button when collapsed. Required, no default. */\n expandSidebarAriaLabel: string;\n className?: string;\n ref?: React.Ref<HTMLDivElement>;\n}\n\n/**\n * bottomNavAriaLabel is REQUIRED exactly where it is READ: the bottom nav zone\n * only renders `<nav>` when bottomNavItems is provided, so the label is only\n * required in that branch — never a silently-missing default.\n */\nexport type MosaicAppSidebarProps = MosaicAppSidebarBaseProps &\n (\n | { bottomNavItems?: undefined; bottomNavAriaLabel?: string }\n | { bottomNavItems: MosaicSidebarNavItem[]; bottomNavAriaLabel: string }\n );\n\n// ── Inline icons ──────────────────────────────────────────────────────────────\n\nfunction ChevronLeftIcon() {\n return (\n <svg\n width=\"16\"\n height=\"16\"\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 >\n <polyline points=\"15 18 9 12 15 6\" />\n </svg>\n );\n}\n\nfunction ChevronRightIcon() {\n return (\n <svg\n width=\"16\"\n height=\"16\"\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 >\n <polyline points=\"9 18 15 12 9 6\" />\n </svg>\n );\n}\n\nfunction ChevronDownIcon({ rotated }: { rotated: boolean }) {\n return (\n <svg\n width=\"14\"\n height=\"14\"\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 style={{\n transform: rotated ? \"rotate(180deg)\" : \"rotate(0deg)\",\n transition: \"transform 200ms ease-out\",\n }}\n >\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n );\n}\n\nfunction ClockIcon() {\n return (\n <svg\n width=\"12\"\n height=\"12\"\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 >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <polyline points=\"12 6 12 12 16 14\" />\n </svg>\n );\n}\n\nfunction TrendingUpIcon() {\n return (\n <svg\n width=\"14\"\n height=\"14\"\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 >\n <polyline points=\"23 6 13.5 15.5 8.5 10.5 1 18\" />\n <polyline points=\"17 6 23 6 23 12\" />\n </svg>\n );\n}\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\n/**\n * MosaicAppSidebar — collapsible sidebar with nav, quick actions, recent items, footer.\n * Props-driven: no hardcoded routes or branding. Wires to MosaicDeviceProvider.\n *\n * @example\n * <MosaicDeviceProvider>\n * <MosaicAppSidebar\n * isCollapsed={collapsed}\n * onToggleCollapse={() => setCollapsed(c => !c)}\n * activePath={router.pathname}\n * onNavigate={(href) => { router.push(href); }}\n * navItems={[{ id: \"home\", label: \"Home\", href: \"/\", icon: <HomeIcon /> }]}\n * logoSlot={<img src=\"/logo.svg\" alt=\"Brand\" className=\"h-6 w-auto\" />}\n * />\n * </MosaicDeviceProvider>\n */\nexport function MosaicAppSidebar({\n isCollapsed,\n onToggleCollapse,\n activePath,\n onNavigate,\n navItems = [],\n quickActions = [],\n recentItems = [],\n logoSlot,\n footerStatus,\n chevronPosition = \"top\",\n bottomNavItems = [],\n bottomNavAriaLabel,\n sidebarAriaLabel,\n mainNavAriaLabel,\n quickActionsHeading,\n recentHeading,\n collapseSidebarAriaLabel,\n expandSidebarAriaLabel,\n className,\n ref,\n}: MosaicAppSidebarProps) {\n const { isMobile } = useDevice();\n const [expandedItems, setExpandedItems] = React.useState<Set<string>>(new Set());\n\n React.useEffect(() => {\n injectStyles();\n }, []);\n\n const sidebarWidth = isMobile ? \"100%\" : isCollapsed ? \"64px\" : \"280px\";\n\n const footerStatusIconClass = \"text-success-500\";\n\n const toggleSubmenu = (id: string) => {\n setExpandedItems((prev) => {\n const next = new Set(prev);\n if (next.has(id)) {\n next.delete(id);\n } else {\n next.add(id);\n }\n return next;\n });\n };\n\n const handleNavClick = (href: string) => {\n onNavigate?.(href);\n };\n\n const collapseToggleButton = !isMobile && (\n <button\n type=\"button\"\n onClick={onToggleCollapse}\n aria-label={isCollapsed ? expandSidebarAriaLabel : collapseSidebarAriaLabel}\n className={cn(\n \"flex h-9 w-9 items-center justify-center rounded-lg transition-colors\",\n \"hover:bg-sidebar-accent text-sidebar-foreground\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n isCollapsed && \"mx-auto\",\n )}\n >\n {isCollapsed ? <ChevronRightIcon /> : <ChevronLeftIcon />}\n </button>\n );\n\n return (\n <div\n ref={ref}\n data-slot=\"app-sidebar\"\n className={cn(\n \"flex h-full flex-col bg-sidebar border-r border-sidebar-border\",\n isMobile && \"border-r-0\",\n className,\n )}\n style={{\n width: sidebarWidth,\n transition: \"width 280ms ease-in-out\",\n overflow: \"hidden\",\n }}\n aria-label={sidebarAriaLabel}\n >\n {/* ── Header ── */}\n <div className=\"shrink-0 border-b border-sidebar-border p-4\">\n <div className=\"flex items-center justify-between\">\n {!isCollapsed && logoSlot && (\n <div className=\"mosaic-sidebar-label-in flex items-center gap-2 min-w-0\">\n {logoSlot}\n </div>\n )}\n {chevronPosition === \"top\" && collapseToggleButton}\n </div>\n </div>\n\n {/* ── Navigation ── */}\n <div className=\"flex-1 overflow-y-auto p-2\" style={{ scrollbarWidth: \"thin\" }}>\n {/* Nav items */}\n {navItems.length > 0 && (\n <nav aria-label={mainNavAriaLabel}>\n <div className=\"space-y-0.5\">\n {navItems.map((item) => {\n const isActive = activePath === item.href;\n const isSubmenuActive = item.submenu?.some((s) => activePath === s.href) ?? false;\n const isExpanded = expandedItems.has(item.id);\n const hasSubmenu = (item.submenu?.length ?? 0) > 0;\n\n return (\n <div key={item.id}>\n {/* Main item */}\n <button\n type=\"button\"\n onClick={() => {\n if (hasSubmenu && !isCollapsed) {\n toggleSubmenu(item.id);\n } else {\n handleNavClick(item.href);\n }\n }}\n aria-current={isActive ? \"page\" : undefined}\n aria-expanded={hasSubmenu && !isCollapsed ? isExpanded : undefined}\n className={cn(\n \"group flex w-full min-h-[44px] items-center rounded-lg p-3 transition-colors\",\n \"hover:bg-sidebar-accent\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n (isActive || isSubmenuActive) && \"bg-sidebar-accent\",\n isCollapsed ? \"justify-center\" : \"justify-between\",\n )}\n >\n {isCollapsed ? (\n <span className=\"text-sidebar-foreground\" title={item.label}>\n {item.icon ?? (\n <span className=\"text-xs font-bold\">{item.label.charAt(0)}</span>\n )}\n </span>\n ) : (\n <div className=\"flex w-full items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n {item.icon && (\n <span className=\"text-sidebar-foreground\">{item.icon}</span>\n )}\n <span className=\"mosaic-sidebar-label-in text-sm font-medium text-sidebar-foreground\">\n {item.label}\n </span>\n </div>\n <div className=\"flex items-center gap-1.5\">\n {item.badge && (\n <span className=\"rounded-full bg-sidebar-accent/60 px-2 py-0.5 text-xs font-medium text-sidebar-foreground\">\n {item.badge}\n </span>\n )}\n {hasSubmenu && <ChevronDownIcon rotated={isExpanded} />}\n </div>\n </div>\n )}\n </button>\n\n {/* Submenu */}\n {hasSubmenu && !isCollapsed && isExpanded && (\n <div className=\"mosaic-sidebar-submenu ml-4 mt-0.5 space-y-0.5\">\n {item.submenu?.map((sub) => {\n const isSubActive = activePath === sub.href;\n return (\n <button\n key={sub.id}\n type=\"button\"\n onClick={() => handleNavClick(sub.href)}\n aria-current={isSubActive ? \"page\" : undefined}\n className={cn(\n \"flex w-full min-h-[40px] items-center gap-3 rounded-lg px-3 py-2 text-sm transition-colors\",\n \"hover:bg-sidebar-accent/50 text-sidebar-foreground\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n isSubActive && \"bg-sidebar-accent/70 font-medium\",\n )}\n >\n {sub.icon && (\n <span className=\"text-sidebar-foreground/80\">{sub.icon}</span>\n )}\n {sub.label}\n </button>\n );\n })}\n </div>\n )}\n </div>\n );\n })}\n </div>\n </nav>\n )}\n\n {/* Quick Actions */}\n {!isCollapsed && quickActions.length > 0 && (\n <div className=\"mt-6\">\n <p className=\"mb-2 px-3 text-xs font-medium uppercase tracking-wider text-sidebar-foreground/60\">\n {quickActionsHeading}\n </p>\n <div className=\"space-y-0.5\">\n {quickActions.map((action) => (\n <button\n key={action.id}\n type=\"button\"\n onClick={action.onClick}\n className={cn(\n \"flex w-full min-h-[44px] items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium\",\n \"text-sidebar-foreground transition-colors hover:bg-sidebar-accent\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n )}\n >\n {action.icon && <span>{action.icon}</span>}\n {action.label}\n </button>\n ))}\n </div>\n </div>\n )}\n\n {/* Recent items */}\n {!isCollapsed && recentItems.length > 0 && (\n <div className=\"mt-6\">\n <p className=\"mb-2 px-3 text-xs font-medium uppercase tracking-wider text-sidebar-foreground/60\">\n {recentHeading}\n </p>\n <div className=\"space-y-1.5\">\n {recentItems.map((item) => (\n <div\n key={item.id}\n className=\"cursor-pointer rounded-lg bg-sidebar-accent/30 p-3 transition-colors hover:bg-sidebar-accent\"\n >\n <div className=\"flex items-start justify-between\">\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-medium text-sidebar-foreground\">\n {item.title}\n </p>\n <div className=\"mt-0.5 flex items-center gap-1.5\">\n <ClockIcon />\n <span className=\"text-xs text-sidebar-foreground/60\">{item.time}</span>\n </div>\n </div>\n {item.count !== undefined && (\n <span className=\"ml-2 shrink-0 rounded-full bg-sidebar-accent/60 px-2 py-0.5 text-xs text-sidebar-foreground\">\n {item.count}\n </span>\n )}\n </div>\n </div>\n ))}\n </div>\n </div>\n )}\n </div>\n\n {/* ── Footer ── */}\n {footerStatus && (\n <div className=\"shrink-0 border-t border-sidebar-border p-4\">\n {!isCollapsed ? (\n <div className=\"flex items-center gap-3 rounded-lg bg-sidebar-accent/30 p-3\">\n {footerStatus.icon && (\n <span className={footerStatusIconClass}>{footerStatus.icon}</span>\n )}\n {!footerStatus.icon && <TrendingUpIcon />}\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm font-medium text-sidebar-foreground\">{footerStatus.label}</p>\n {footerStatus.sublabel && (\n <p className=\"text-xs text-sidebar-foreground/60\">{footerStatus.sublabel}</p>\n )}\n </div>\n </div>\n ) : (\n <div className=\"flex justify-center\">\n <div\n className={`flex h-8 w-8 items-center justify-center rounded-lg bg-sidebar-accent/30 ${footerStatusIconClass}`}\n >\n {footerStatus.icon ?? <TrendingUpIcon />}\n </div>\n </div>\n )}\n </div>\n )}\n\n {/* ── Bottom-anchored nav (e.g. Settings) — transposed from the reference\n Sidebar's border-t bottom zone, kept separate from footerStatus ── */}\n {bottomNavItems.length > 0 && (\n <div\n data-slot=\"app-sidebar-bottom-nav\"\n className={cn(\"shrink-0 border-t border-sidebar-border p-2\", isCollapsed && \"px-2\")}\n >\n <nav aria-label={bottomNavAriaLabel}>\n <div className=\"space-y-0.5\">\n {bottomNavItems.map((item) => {\n const isActive = activePath === item.href;\n return (\n <button\n key={item.id}\n type=\"button\"\n onClick={() => handleNavClick(item.href)}\n aria-current={isActive ? \"page\" : undefined}\n className={cn(\n \"group flex w-full min-h-[44px] items-center rounded-lg p-3 transition-colors\",\n \"hover:bg-sidebar-accent\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n isActive && \"bg-sidebar-accent\",\n isCollapsed ? \"justify-center\" : \"justify-start gap-3\",\n )}\n >\n {isCollapsed ? (\n <span className=\"text-sidebar-foreground\" title={item.label}>\n {item.icon ?? (\n <span className=\"text-xs font-bold\">{item.label.charAt(0)}</span>\n )}\n </span>\n ) : (\n <>\n {item.icon && <span className=\"text-sidebar-foreground\">{item.icon}</span>}\n <span className=\"mosaic-sidebar-label-in text-sm font-medium text-sidebar-foreground\">\n {item.label}\n </span>\n </>\n )}\n </button>\n );\n })}\n </div>\n </nav>\n </div>\n )}\n\n {/* ── Collapse toggle anchored at the bottom of the rail ── */}\n {chevronPosition === \"bottom\" && collapseToggleButton && (\n <div\n data-slot=\"app-sidebar-toggle-zone\"\n className={cn(\n \"shrink-0 border-t border-sidebar-border p-2 flex\",\n isCollapsed ? \"justify-center\" : \"justify-end\",\n )}\n >\n {collapseToggleButton}\n </div>\n )}\n </div>\n );\n}\n\nMosaicAppSidebar.displayName = \"MosaicAppSidebar\";\n"
15
+ }
16
+ ],
17
+ "type": "registry:ui"
18
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-approval-prompt",
4
+ "title": "MosaicApprovalPrompt",
5
+ "description": "MosaicApprovalPrompt — presentational \"reprendre la main\" tool-call approval",
6
+ "dependencies": [],
7
+ "registryDependencies": [],
8
+ "files": [
9
+ {
10
+ "path": "src/components/approval-prompt/MosaicApprovalPrompt.tsx",
11
+ "type": "registry:ui",
12
+ "content": "/**\n * MosaicApprovalPrompt — presentational \"reprendre la main\" tool-call approval\n *\n * Presentational atom. Shows which tool the agent wants to call, the tool's\n * arguments (host-rendered — this library never decides how a JSON payload\n * looks), and two actions: approve / deny. The component performs no\n * network call and owns no SDK: submitting a decision is surfaced purely via\n * the `onApprove()` / `onDeny()` callbacks — the host owns how the decision\n * is actually sent to the agent runtime and what happens next.\n *\n * Autonomous: does NOT depend on any chat-message component (developed in\n * parallel elsewhere) — the host inserts this component wherever an\n * approval-requested tool part appears in its own message rendering.\n *\n * Arguments rendering is host-controlled by design: `renderArguments` is a\n * required `React.ReactNode`, never a built-in JSON pretty-printer. The\n * host decides syntax highlighting, truncation, diffing, or any other\n * representation of the tool payload.\n *\n * Pattern: MosaicUrlScraper.tsx (data-slot, inline cn, React 19 ref prop,\n * displayName, JSDoc, pure variants module, host-controlled status union as\n * a discriminated prop type).\n * No \"use client\" — prepend-use-client.mjs adds it to dist.\n * Design tokens: --foreground, --muted-foreground, --border, --destructive,\n * --ring, --accent, --card, --background.\n * a11y: the root is a native `<fieldset>` whose `<legend>` is the required\n * `promptTitle` (an approval is a consequential action, so the whole prompt\n * is announced as one unit via the standard fieldset/legend semantics);\n * approve/deny are native `<button>` elements whose accessible\n * name IS their required visible label — no separate aria-label needed for\n * them. The tool-name region and the arguments region are always rendered,\n * in every status, so the decision/error state never loses the \"what was\n * this about\" context.\n * Bilingual: every user-facing string (promptTitle/toolNameLabel/\n * approveButtonLabel/denyButtonLabel/decisionMessage/errorMessage) is a\n * required caller-supplied prop — zero hardcoded copy, zero default.\n *\n * Props are pushed into the `MosaicApprovalPromptState` discriminated union\n * exactly where they are read — `onApprove`/`onDeny`/`approveButtonLabel`/\n * `denyButtonLabel` only exist on the \"pending\" branch, `decision`/\n * `decisionMessage` only on \"responded\", `errorMessage` only on \"error\".\n *\n * @example\n * // pending\n * <MosaicApprovalPrompt\n * status=\"pending\"\n * toolName=\"delete_file\"\n * toolNameLabel=\"Outil demandé\"\n * promptTitle=\"L'agent souhaite exécuter un outil\"\n * renderArguments={<ToolArgsViewer args={part.input} />}\n * onApprove={() => respond(\"approved\")}\n * onDeny={() => respond(\"denied\")}\n * approveButtonLabel=\"Approuver\"\n * denyButtonLabel=\"Refuser\"\n * />\n *\n * @example\n * // responded\n * <MosaicApprovalPrompt\n * {...baseProps}\n * status=\"responded\"\n * decision=\"approved\"\n * decisionMessage=\"Appel approuvé — exécution en cours\"\n * />\n */\n\nimport type * as React from \"react\";\nimport {\n approvalPromptButtonVariants,\n approvalPromptCardVariants,\n approvalPromptMessageVariants,\n} from \"./approval-prompt-variants.js\";\n\n// ── Utility ───────────────────────────────────────────────────────────────────\n\nfunction cn(...classes: (string | undefined | null | false)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\n/**\n * Base props required in EVERY status — read unconditionally by the\n * component regardless of `status` (title + tool-name + host-rendered\n * arguments region are always shown, even after a decision or on error).\n */\ntype MosaicApprovalPromptBaseProps = {\n /** Name of the tool the agent wants to call, displayed as-is. */\n toolName: string;\n /** Label preceding `toolName` (e.g. \"Requested tool\"). Required, no default. */\n toolNameLabel: string;\n /**\n * Heading for the whole prompt (e.g. \"The agent wants to run a tool\") —\n * also used as the accessible name of the root `role=\"group\"` region.\n * Required, no default.\n */\n promptTitle: string;\n /**\n * Host-rendered view of the tool's arguments. The library never decides\n * how a JSON payload is displayed — the host owns syntax highlighting,\n * truncation, diffing, or any other representation.\n */\n renderArguments: React.ReactNode;\n /** Additional Tailwind classes on the root element. */\n className?: string;\n /** React 19 ref prop — forwarded to the root element. */\n ref?: React.Ref<HTMLFieldSetElement>;\n};\n\n/**\n * Host-controlled approval status. Every prop that is only ever rendered in\n * ONE status branch lives on that branch's variant — not on the base props —\n * so the type contract matches exactly what the component reads (mirrors\n * MosaicUrlScraperState's status-driven shape).\n */\nexport type MosaicApprovalPromptState =\n | {\n status: \"pending\";\n /** Called when the host user approves the pending tool call. */\n onApprove: () => void;\n /** Called when the host user denies the pending tool call. */\n onDeny: () => void;\n /** Label for the approve button. Required, no default. */\n approveButtonLabel: string;\n /** Label for the deny button. Required, no default. */\n denyButtonLabel: string;\n }\n | {\n status: \"responded\";\n /** Which decision was sent — drives the message's visual tone only. */\n decision: \"approved\" | \"denied\";\n /**\n * Host-provided, host-localized message describing the sent decision\n * (e.g. \"Approved — running\", \"Denied by user\"). The library never\n * generates its own copy — every occurrence is a distinct required\n * value supplied by the caller.\n */\n decisionMessage: string;\n }\n | {\n status: \"error\";\n /**\n * Host-provided, host-localized error message (e.g. \"Decision could\n * not be sent\", \"Agent runtime unreachable\"). Required, no default.\n */\n errorMessage: string;\n };\n\nexport type MosaicApprovalPromptProps = MosaicApprovalPromptBaseProps & MosaicApprovalPromptState;\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\n/**\n * MosaicApprovalPrompt — production tool-call approval atom for\n * @vantageos/mosaic-blocks.\n *\n * Purely presentational: renders the requested tool + host-rendered\n * arguments + the current status (pending/responded/error), and reports an\n * approve/deny decision via callbacks. No network call, no SDK, no built-in\n * copy, no built-in arguments renderer.\n */\nexport function MosaicApprovalPrompt(props: MosaicApprovalPromptProps) {\n const { toolName, toolNameLabel, promptTitle, renderArguments, className, ref } = props;\n\n const tone =\n props.status === \"responded\" ? props.decision : props.status === \"error\" ? \"error\" : \"pending\";\n\n return (\n <fieldset\n ref={ref}\n data-slot=\"approval-prompt\"\n aria-label={promptTitle}\n className={cn(\"border-0 p-0 m-0\", approvalPromptCardVariants({ tone }), className)}\n >\n <legend data-slot=\"approval-prompt-title\" className=\"text-base font-semibold md:text-lg\">\n {promptTitle}\n </legend>\n\n <div data-slot=\"approval-prompt-tool\" className=\"flex flex-col gap-1\">\n <span\n data-slot=\"approval-prompt-tool-label\"\n className={approvalPromptMessageVariants({ tone: \"muted\" })}\n >\n {toolNameLabel}\n </span>\n <span data-slot=\"approval-prompt-tool-name\" className=\"text-sm font-medium\">\n {toolName}\n </span>\n </div>\n\n <div data-slot=\"approval-prompt-arguments\">{renderArguments}</div>\n\n {props.status === \"pending\" && (\n <div data-slot=\"approval-prompt-actions\" className=\"flex gap-2\">\n <button\n type=\"button\"\n data-slot=\"approval-prompt-approve-button\"\n onClick={props.onApprove}\n className={approvalPromptButtonVariants({ intent: \"approve\" })}\n >\n {props.approveButtonLabel}\n </button>\n <button\n type=\"button\"\n data-slot=\"approval-prompt-deny-button\"\n onClick={props.onDeny}\n className={approvalPromptButtonVariants({ intent: \"deny\" })}\n >\n {props.denyButtonLabel}\n </button>\n </div>\n )}\n\n {props.status === \"responded\" && (\n <p\n data-slot=\"approval-prompt-decision\"\n className={approvalPromptMessageVariants({ tone: props.decision })}\n >\n {props.decisionMessage}\n </p>\n )}\n\n {props.status === \"error\" && (\n <p\n data-slot=\"approval-prompt-error\"\n className={approvalPromptMessageVariants({ tone: \"error\" })}\n >\n {props.errorMessage}\n </p>\n )}\n </fieldset>\n );\n}\n\nMosaicApprovalPrompt.displayName = \"MosaicApprovalPrompt\";\n"
13
+ },
14
+ {
15
+ "path": "src/components/approval-prompt/approval-prompt-variants.ts",
16
+ "type": "registry:ui",
17
+ "content": "/**\n * approvalPromptVariants — pure CVA variant functions for MosaicApprovalPrompt.\n *\n * Isolated in their own module so they can be re-exported from the\n * `@vantageos/mosaic-blocks/server` subpath without pulling in React.\n *\n * Zero browser / React runtime dependencies — safe in RSC / Node.js.\n */\n\nimport { cva } from \"class-variance-authority\";\n\n/** Root card container variants by status. */\nexport const approvalPromptCardVariants = cva([\"flex flex-col gap-3 rounded-lg border p-4\"], {\n variants: {\n tone: {\n pending: \"border-border bg-card\",\n approved: \"border-border bg-card\",\n denied: \"border-destructive/40 bg-destructive/5\",\n error: \"border-destructive/40 bg-destructive/5\",\n },\n },\n defaultVariants: {\n tone: \"pending\",\n },\n});\n\n/** Decision badge / message text variants by tone. */\nexport const approvalPromptMessageVariants = cva([\"text-sm\"], {\n variants: {\n tone: {\n muted: \"text-muted-foreground\",\n approved: \"text-foreground\",\n denied: \"text-destructive\",\n error: \"text-destructive\",\n },\n },\n defaultVariants: {\n tone: \"muted\",\n },\n});\n\n/** Approve / deny action button variants. */\nexport const approvalPromptButtonVariants = cva(\n [\n \"min-h-9 inline-flex items-center justify-center rounded-md border px-4 text-sm font-medium transition-colors disabled:opacity-50\",\n ],\n {\n variants: {\n intent: {\n approve: \"border-border hover:bg-accent/50\",\n deny: \"border-destructive/40 text-destructive hover:bg-destructive/5\",\n },\n },\n },\n);\n"
18
+ }
19
+ ],
20
+ "type": "registry:ui"
21
+ }