@vantageos/mosaic-blocks 0.5.34-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 +1517 -101
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +1283 -15
  5. package/dist/index.d.ts +1283 -15
  6. package/dist/index.js +1487 -102
  7. package/dist/index.js.map +1 -1
  8. package/dist/styles.css +18 -0
  9. package/package.json +38 -26
  10. package/r/mosaic-accordion.json +18 -0
  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 +179 -130
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-stats-grid",
4
+ "title": "MosaicStatsGrid",
5
+ "description": "Border-grid statistics section. Props: stats[] {label, value}, heading, subtext. Values are plain strings; animate at consumer level.",
6
+ "dependencies": [],
7
+ "registryDependencies": [],
8
+ "files": [
9
+ {
10
+ "path": "src/components/stats-grid/MosaicStatsGrid.tsx",
11
+ "type": "registry:ui",
12
+ "content": "/**\n * MosaicStatsGrid β€” statistics grid section\n *\n * Ported from heyfabrika/styleui components/templates/axis/stats.tsx (MIT).\n * Adapted: props-driven stats array (label + value as strings β€” no animated counter\n * dependency for portability; consumers may wrap value in their own counter component).\n * Grid layout: border-grid pattern for visual rhythm.\n */\n\nimport type * as React from \"react\";\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\nexport interface StatItem {\n /** Stat numeric or string value, e.g. \"10K+\" or \"99.9%\" */\n value: string;\n /** Human-readable label, e.g. \"Active users\" */\n label: string;\n}\n\nexport interface MosaicStatsGridProps {\n /** Array of stats to display */\n stats: StatItem[];\n /** Optional section heading */\n heading?: React.ReactNode;\n /** Optional section subtext */\n subtext?: React.ReactNode;\n className?: string;\n ref?: React.Ref<HTMLElement>;\n}\n\n// ── Utility ──────────────────────────────────────────────────────────────────\n\nfunction cn(...classes: (string | undefined | null | false)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\n/**\n * MosaicStatsGrid β€” border-grid layout for 2–6 stats. Values are plain strings;\n * wrap in an animated counter component at the consumer level if needed.\n *\n * @example\n * <MosaicStatsGrid\n * heading=\"Trusted by thousands\"\n * stats={[\n * { value: \"10K+\", label: \"Active users\" },\n * { value: \"99.9%\", label: \"Uptime\" },\n * { value: \"50+\", label: \"Countries\" },\n * ]}\n * />\n */\nexport function MosaicStatsGrid({ stats, heading, subtext, className, ref }: MosaicStatsGridProps) {\n return (\n <section ref={ref} className={cn(\"w-full py-16\", className)}>\n {(heading ?? subtext) && (\n <div className=\"mb-16 flex flex-col items-center gap-3 px-4 text-center\">\n {heading && (\n <h2 className=\"text-3xl font-medium tracking-tight text-[oklch(0.12_0.01_250)] sm:text-4xl\">\n {heading}\n </h2>\n )}\n {subtext && (\n <p className=\"max-w-md text-sm text-[oklch(0.5_0.01_250)] sm:text-base\">{subtext}</p>\n )}\n </div>\n )}\n\n <div className=\"mx-auto max-w-5xl px-4\">\n <div\n className=\"grid grid-cols-1 border-l border-t border-[oklch(0.9_0.005_250)]\"\n style={{\n gridTemplateColumns: `repeat(${Math.min(stats.length, 3)}, minmax(0, 1fr))`,\n }}\n >\n {stats.map((stat) => (\n <div\n key={stat.label}\n className=\"flex flex-col items-center justify-center border-b border-r border-[oklch(0.9_0.005_250)] py-12 px-6 text-center\"\n >\n <span className=\"text-3xl font-semibold tracking-tight text-[oklch(0.12_0.01_250)] md:text-4xl tabular-nums\">\n {stat.value}\n </span>\n <p className=\"mt-2 text-sm text-[oklch(0.5_0.01_250)]\">{stat.label}</p>\n </div>\n ))}\n </div>\n </div>\n </section>\n );\n}\n\nMosaicStatsGrid.displayName = \"MosaicStatsGrid\";\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-step-pipeline",
4
+ "title": "MosaicStepPipeline",
5
+ "description": "MosaicStepPipeline β€” ordered stage progress pipeline",
6
+ "dependencies": [],
7
+ "registryDependencies": [],
8
+ "files": [
9
+ {
10
+ "path": "src/components/step-pipeline/MosaicStepPipeline.tsx",
11
+ "type": "registry:ui",
12
+ "content": "/**\n * MosaicStepPipeline β€” ordered stage progress pipeline\n *\n * Presentational atom. Renders an ordered sequence of stages with status each\n * (done / current / upcoming) and connector lines between them.\n * Supports horizontal (default) and vertical orientations.\n *\n * Pattern: Button.tsx (data-slot, inline cn, React 19 ref prop, displayName, JSDoc).\n * No \"use client\" β€” prepend-use-client.mjs adds it to dist.\n * Design tokens: --foreground, --muted, --muted-foreground, --border, --ring, --background.\n * No icon library β€” uses βœ“ char for done steps, index+1 number for others.\n * a11y: ol/li semantics, aria-current=\"step\" on current step.\n * Bilingual: all labels/descriptions are caller-provided (no hardcoded English).\n *\n * Closes issue #22 β€” mosaic-step-pipeline.\n *\n * @example\n * // Derive status from currentIndex\n * <MosaicStepPipeline\n * steps={[\n * { label: \"Setup\" },\n * { label: \"Configure\" },\n * { label: \"Deploy\" },\n * ]}\n * currentIndex={1}\n * />\n *\n * @example\n * // Explicit per-step status\n * <MosaicStepPipeline\n * steps={[\n * { label: \"Γ‰tape 1\", status: \"done\" },\n * { label: \"Γ‰tape 2\", status: \"current\", description: \"En cours…\" },\n * { label: \"Γ‰tape 3\", status: \"upcoming\" },\n * ]}\n * orientation=\"vertical\"\n * />\n */\n\nimport type * as React from \"react\";\nimport {\n stepConnectorVariants,\n stepDescriptionVariants,\n stepIndicatorVariants,\n stepLabelVariants,\n stepPipelineVariants,\n stepSegmentBarVariants,\n stepSegmentVariants,\n} from \"./step-pipeline-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 type MosaicStepStatus = \"done\" | \"current\" | \"upcoming\";\n\nexport interface MosaicStep {\n /** Optional stable id for React key. When absent, array index is used. */\n id?: string;\n /** Step label β€” ReactNode for i18n / rich content. Caller-provided. */\n label: React.ReactNode;\n /** Optional supporting description. Caller-provided. */\n description?: React.ReactNode;\n /**\n * Explicit step status. When absent on all steps, `currentIndex` derivation\n * is used: index < currentIndex β†’ done, === current, > upcoming.\n */\n status?: MosaicStepStatus;\n}\n\ninterface MosaicStepPipelineBaseProps {\n /** Ordered array of pipeline stages. */\n steps: MosaicStep[];\n /**\n * Active step index (0-based). Used to derive status when a step has no\n * explicit `status`. Ignored when all steps carry explicit status.\n * @default 0\n */\n currentIndex?: number;\n /** Additional Tailwind classes on the root element. */\n className?: string;\n}\n\nexport interface MosaicStepPipelineDotsProps extends MosaicStepPipelineBaseProps {\n /**\n * Full dot-layout rendering (indicator + label + description per step).\n * @default \"dots\"\n */\n variant?: \"dots\";\n /**\n * Layout orientation. Only meaningful for `variant=\"dots\"`.\n * @default \"horizontal\"\n */\n orientation?: \"horizontal\" | \"vertical\";\n /** React 19 ref prop β€” forwarded to the root <ol> element. */\n ref?: React.Ref<HTMLOListElement>;\n}\n\nexport interface MosaicStepPipelineSegmentsProps extends MosaicStepPipelineBaseProps {\n /**\n * Compact horizontal progress-segment bar β€” colored segment fills only,\n * no dots and no step labels. Intended for space-constrained UIs (e.g.\n * mission cards) where a thin progress indicator is enough.\n */\n variant: \"segments\";\n /**\n * Accessible name for the segment bar (`aria-label`). Required β€” the\n * library ships zero user-facing strings; the host owns the copy and its\n * language.\n */\n progressAriaLabel: string;\n /**\n * Optional function producing the live `aria-valuetext` announced by\n * screen readers, e.g. `(current, total) => \\`Γ‰tape ${current} sur ${total}\\``.\n * When omitted, `progressAriaLabel` alone is used as the accessible name\n * and no `aria-valuetext` is set.\n */\n progressLabel?: (current: number, total: number) => string;\n /** React 19 ref prop β€” forwarded to the root segment-bar element. */\n ref?: React.Ref<HTMLDivElement>;\n}\n\nexport type MosaicStepPipelineProps = MosaicStepPipelineDotsProps | MosaicStepPipelineSegmentsProps;\n\n// ── Helpers ───────────────────────────────────────────────────────────────────\n\nfunction resolveStatus(step: MosaicStep, index: number, currentIndex: number): MosaicStepStatus {\n if (step.status !== undefined) return step.status;\n if (index < currentIndex) return \"done\";\n if (index === currentIndex) return \"current\";\n return \"upcoming\";\n}\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\n/**\n * MosaicStepPipeline β€” production step-pipeline atom for @vantageos/mosaic-blocks.\n *\n * Two rendering modes selected via `variant`:\n * - `\"dots\"` (default): full ordered stage progress with done/current/upcoming\n * status, connector lines, horizontal and vertical orientations. Accessible\n * via ol/li + aria-current.\n * - `\"segments\"`: compact horizontal progress-segment bar β€” colored fills\n * only, no dots and no labels. Accessible via role=\"progressbar\".\n */\nexport function MosaicStepPipeline(props: MosaicStepPipelineProps) {\n if (props.variant === \"segments\") {\n return <MosaicStepPipelineSegments {...props} />;\n }\n return <MosaicStepPipelineDots {...props} />;\n}\n\nMosaicStepPipeline.displayName = \"MosaicStepPipeline\";\n\n/**\n * MosaicStepPipelineSegments β€” compact segment-bar rendering.\n *\n * Renders one filled/unfilled segment per step, no dots, no labels.\n * Accessible name via required `progressAriaLabel`; optional `progressLabel`\n * function drives the live `aria-valuetext`.\n */\nfunction MosaicStepPipelineSegments({\n steps,\n currentIndex = 0,\n className,\n progressAriaLabel,\n progressLabel,\n ref,\n}: MosaicStepPipelineSegmentsProps) {\n const total = steps.length;\n const current = steps.reduce((count, step, index) => {\n const status = resolveStatus(step, index, currentIndex);\n return status === \"upcoming\" ? count : count + 1;\n }, 0);\n\n return (\n <div\n ref={ref}\n data-slot=\"step-segment-bar\"\n role=\"progressbar\"\n // Non-interactive status indicator: not a tab stop, but still\n // programmatically focusable to satisfy a11y/useFocusableInteractive.\n tabIndex={-1}\n aria-label={progressAriaLabel}\n aria-valuemin={0}\n aria-valuemax={total}\n aria-valuenow={current}\n aria-valuetext={progressLabel ? progressLabel(current, total) : undefined}\n className={cn(stepSegmentBarVariants(), className)}\n >\n {steps.map((step, index) => {\n const status = resolveStatus(step, index, currentIndex);\n const filled = status !== \"upcoming\";\n const key = step.id !== undefined ? step.id : index;\n\n return (\n <div\n key={key}\n data-slot=\"step-segment\"\n data-status={status}\n data-filled={filled}\n aria-hidden=\"true\"\n className={cn(stepSegmentVariants({ filled }))}\n />\n );\n })}\n </div>\n );\n}\n\nMosaicStepPipelineSegments.displayName = \"MosaicStepPipelineSegments\";\n\n/**\n * MosaicStepPipelineDots β€” full dot-layout rendering (default variant).\n *\n * Ordered stage progress with done/current/upcoming status, connector lines,\n * horizontal and vertical orientations. Accessible via ol/li + aria-current.\n */\nfunction MosaicStepPipelineDots({\n steps,\n currentIndex = 0,\n orientation = \"horizontal\",\n className,\n ref,\n}: MosaicStepPipelineDotsProps) {\n return (\n <ol\n ref={ref}\n data-slot=\"step-pipeline\"\n className={cn(stepPipelineVariants({ orientation }), className)}\n >\n {steps.map((step, index) => {\n const status = resolveStatus(step, index, currentIndex);\n const isCurrent = status === \"current\";\n const isLast = index === steps.length - 1;\n // Key: use step.id when provided; fall back to index (safe β€” index is stable\n // for this ordered list, and step labels may repeat across pipelines)\n const key = step.id !== undefined ? step.id : index;\n\n return (\n <li\n key={key}\n data-slot=\"step\"\n data-status={status}\n aria-current={isCurrent ? \"step\" : undefined}\n className={cn(\n \"flex shrink-0\",\n orientation === \"horizontal\"\n ? \"flex-col items-center gap-2\"\n : \"flex-row items-start gap-3\",\n orientation === \"horizontal\" && !isLast && \"flex-1\",\n )}\n >\n {/* Step row: indicator + connector (horizontal) or indicator + content (vertical) */}\n {orientation === \"horizontal\" ? (\n <>\n {/* Horizontal: indicator row with connectors flanking it */}\n <div className=\"flex w-full items-center\">\n {/* Left connector (not for first step) */}\n {index > 0 && (\n <div\n data-slot=\"step-connector\"\n className={cn(stepConnectorVariants({ status, orientation }))}\n />\n )}\n {/* Step indicator */}\n <div\n data-slot=\"step-indicator\"\n className={cn(stepIndicatorVariants({ status, orientation }))}\n aria-hidden=\"true\"\n >\n {status === \"done\" ? \"βœ“\" : <span>{index + 1}</span>}\n </div>\n {/* Right connector (not for last step) */}\n {!isLast && (\n <div\n data-slot=\"step-connector\"\n className={cn(\n stepConnectorVariants({\n // connector after current step is still upcoming\n status: status === \"done\" ? \"done\" : \"upcoming\",\n orientation,\n }),\n )}\n />\n )}\n </div>\n {/* Label + description below indicator */}\n <div className=\"flex flex-col items-center gap-0.5 text-center px-1\">\n <span data-slot=\"step-label\" className={cn(stepLabelVariants({ status }))}>\n {step.label}\n </span>\n {step.description !== undefined && (\n <span\n data-slot=\"step-description\"\n className={cn(stepDescriptionVariants({ status }))}\n >\n {step.description}\n </span>\n )}\n </div>\n </>\n ) : (\n <>\n {/* Vertical: indicator column with connector below it */}\n <div className=\"flex flex-col items-center\">\n <div\n data-slot=\"step-indicator\"\n className={cn(stepIndicatorVariants({ status, orientation }))}\n aria-hidden=\"true\"\n >\n {status === \"done\" ? \"βœ“\" : <span>{index + 1}</span>}\n </div>\n {!isLast && (\n <div\n data-slot=\"step-connector\"\n className={cn(\n stepConnectorVariants({\n status: status === \"done\" ? \"done\" : \"upcoming\",\n orientation,\n }),\n )}\n />\n )}\n </div>\n {/* Label + description to the right */}\n <div className=\"flex flex-col gap-0.5 pt-1 pb-4\">\n <span data-slot=\"step-label\" className={cn(stepLabelVariants({ status }))}>\n {step.label}\n </span>\n {step.description !== undefined && (\n <span\n data-slot=\"step-description\"\n className={cn(stepDescriptionVariants({ status }))}\n >\n {step.description}\n </span>\n )}\n </div>\n </>\n )}\n </li>\n );\n })}\n </ol>\n );\n}\n\nMosaicStepPipelineDots.displayName = \"MosaicStepPipelineDots\";\n"
13
+ },
14
+ {
15
+ "path": "src/components/step-pipeline/step-pipeline-variants.ts",
16
+ "type": "registry:ui",
17
+ "content": "/**\n * stepPipelineVariants β€” pure CVA variant functions for MosaicStepPipeline.\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 pipeline container variants */\nexport const stepPipelineVariants = cva([\"flex\", \"items-stretch\"], {\n variants: {\n orientation: {\n horizontal: \"flex-row items-center w-full\",\n vertical: \"flex-col\",\n },\n },\n defaultVariants: {\n orientation: \"horizontal\",\n },\n});\n\n/** Individual step indicator (circle/icon area) variants by status */\nexport const stepIndicatorVariants = cva(\n [\n \"flex items-center justify-center shrink-0\",\n \"rounded-full border-2 font-semibold text-sm select-none\",\n \"transition-colors\",\n ],\n {\n variants: {\n status: {\n done: \"bg-foreground text-background border-foreground\",\n current: \"bg-background text-foreground border-foreground ring-2 ring-ring ring-offset-2\",\n upcoming: \"bg-muted text-muted-foreground border-border\",\n },\n orientation: {\n horizontal: \"size-8\",\n vertical: \"size-8\",\n },\n },\n defaultVariants: {\n status: \"upcoming\",\n orientation: \"horizontal\",\n },\n },\n);\n\n/** Connector line between steps */\nexport const stepConnectorVariants = cva([\"shrink-0 transition-colors\"], {\n variants: {\n status: {\n done: \"bg-foreground\",\n current: \"bg-border\",\n upcoming: \"bg-border\",\n },\n orientation: {\n horizontal: \"h-px flex-1 min-w-4\",\n vertical: \"w-px self-stretch min-h-4 ml-4\",\n },\n },\n defaultVariants: {\n status: \"upcoming\",\n orientation: \"horizontal\",\n },\n});\n\n/** Step label text variants */\nexport const stepLabelVariants = cva([\"text-sm font-medium transition-colors\"], {\n variants: {\n status: {\n done: \"text-foreground\",\n current: \"text-foreground\",\n upcoming: \"text-muted-foreground\",\n },\n },\n defaultVariants: {\n status: \"upcoming\",\n },\n});\n\n/** Step description text variants */\nexport const stepDescriptionVariants = cva([\"text-xs transition-colors\"], {\n variants: {\n status: {\n done: \"text-muted-foreground\",\n current: \"text-muted-foreground\",\n upcoming: \"text-muted-foreground/60\",\n },\n },\n defaultVariants: {\n status: \"upcoming\",\n },\n});\n\n/** Root container for the compact segment-bar variant */\nexport const stepSegmentBarVariants = cva([\"flex w-full items-center gap-1\"], {\n variants: {},\n defaultVariants: {},\n});\n\n/** Individual segment fill in the compact segment-bar variant */\nexport const stepSegmentVariants = cva([\"h-1.5 flex-1 min-w-2 rounded-full transition-colors\"], {\n variants: {\n filled: {\n true: \"bg-foreground\",\n false: \"bg-muted\",\n },\n },\n defaultVariants: {\n filled: false,\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-switch",
4
+ "title": "MosaicSwitch",
5
+ "description": "Toggle switch built on @base-ui/react/switch. Controlled + uncontrolled, role=switch, keyboard accessible. data-slot=\"switch\".",
6
+ "dependencies": [
7
+ "@base-ui/react"
8
+ ],
9
+ "registryDependencies": [],
10
+ "files": [
11
+ {
12
+ "path": "src/components/switch/MosaicSwitch.tsx",
13
+ "type": "registry:ui",
14
+ "content": "/**\n * MosaicSwitch β€” @base-ui/react Switch primitive\n *\n * Builds on Switch.Root + Switch.Thumb.\n * Supports controlled (checked + onCheckedChange) and uncontrolled (defaultChecked).\n * role=switch and aria-checked are managed by the primitive automatically.\n *\n * data-slot=\"switch\" on Root, data-slot=\"switch-thumb\" on Thumb.\n * Styling: Tailwind v4 semantic tokens only.\n */\n\nimport { Switch } from \"@base-ui/react/switch\";\nimport type * as React from \"react\";\n\n// ── Utility ──────────────────────────────────────────────────────────────────\n\nfunction cn(...classes: (string | undefined | null | false)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n\n// ── Props ─────────────────────────────────────────────────────────────────────\n\nexport interface MosaicSwitchProps extends React.ComponentPropsWithoutRef<typeof Switch.Root> {\n className?: string;\n ref?: React.Ref<HTMLElement>;\n}\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\n/**\n * MosaicSwitch β€” production Switch atom for @vantageos/mosaic-blocks.\n *\n * Built on @base-ui/react/switch. Supports controlled + uncontrolled modes.\n * role=switch + aria-checked managed automatically by the primitive.\n *\n * @example\n * // Uncontrolled\n * <MosaicSwitch aria-label=\"Dark mode\" defaultChecked />\n *\n * // Controlled\n * <MosaicSwitch checked={enabled} onCheckedChange={setEnabled} aria-label=\"Notifications\" />\n */\nexport function MosaicSwitch({ className, ref, ...props }: MosaicSwitchProps) {\n return (\n <Switch.Root\n ref={ref}\n data-slot=\"switch\"\n className={cn(\n // Track\n \"relative inline-flex h-6 w-10 shrink-0 cursor-pointer items-center\",\n \"rounded-full border-2 border-transparent outline-none\",\n \"bg-muted transition-colors\",\n // Checked state β€” bg-foreground when on\n \"data-[checked]:bg-foreground\",\n // Focus ring\n \"focus-visible:ring-ring focus-visible:ring-[3px]\",\n // Disabled\n \"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\",\n className,\n )}\n {...props}\n >\n <Switch.Thumb\n data-slot=\"switch-thumb\"\n className={cn(\n \"pointer-events-none block h-4 w-4 rounded-full\",\n \"bg-background shadow-sm\",\n \"translate-x-0 transition-transform\",\n \"data-[checked]:translate-x-5\",\n )}\n />\n </Switch.Root>\n );\n}\n\nMosaicSwitch.displayName = \"MosaicSwitch\";\n"
15
+ }
16
+ ],
17
+ "type": "registry:ui"
18
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-tabs",
4
+ "title": "MosaicTabs",
5
+ "description": "MosaicTabs β€” @base-ui/react Tabs primitive",
6
+ "dependencies": [
7
+ "@base-ui/react"
8
+ ],
9
+ "registryDependencies": [],
10
+ "files": [
11
+ {
12
+ "path": "src/components/tabs/MosaicTabs.tsx",
13
+ "type": "registry:ui",
14
+ "content": "/**\n * MosaicTabs β€” @base-ui/react Tabs primitive\n *\n * Builds on Tabs.Root + Tabs.List + Tabs.Tab + Tabs.Panel + Tabs.Indicator.\n * Supports controlled (value + onValueChange) and uncontrolled modes.\n * role=tablist, role=tab, role=tabpanel managed by the primitive automatically.\n *\n * data-slot=\"tabs\" on Root, \"tabs-list\" on List, \"tabs-trigger\" on Tab,\n * \"tabs-panel\" on Panel.\n * Styling: Tailwind v4 semantic tokens only.\n */\n\nimport { Tabs } from \"@base-ui/react/tabs\";\nimport type * as React from \"react\";\n\n// ── Utility ──────────────────────────────────────────────────────────────────\n\nfunction cn(...classes: (string | undefined | null | false)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n\n// ── Props ─────────────────────────────────────────────────────────────────────\n\nexport interface MosaicTabsProps extends Tabs.Root.Props {\n className?: string;\n ref?: React.Ref<HTMLDivElement>;\n}\n\nexport interface MosaicTabsListProps extends Tabs.List.Props {\n className?: string;\n ref?: React.Ref<HTMLDivElement>;\n}\n\nexport interface MosaicTabsTriggerProps extends Tabs.Tab.Props {\n className?: string;\n ref?: React.Ref<HTMLButtonElement>;\n}\n\nexport interface MosaicTabsPanelProps extends Tabs.Panel.Props {\n className?: string;\n ref?: React.Ref<HTMLDivElement>;\n}\n\n// ── Components ────────────────────────────────────────────────────────────────\n\n/**\n * MosaicTabs β€” production Tabs root for @vantageos/mosaic-blocks.\n *\n * Compose with MosaicTabsList, MosaicTabsTrigger, MosaicTabsPanel.\n *\n * @example\n * <MosaicTabs defaultValue=\"overview\">\n * <MosaicTabsList>\n * <MosaicTabsTrigger value=\"overview\">Overview</MosaicTabsTrigger>\n * <MosaicTabsTrigger value=\"details\">Details</MosaicTabsTrigger>\n * </MosaicTabsList>\n * <MosaicTabsPanel value=\"overview\">Overview content</MosaicTabsPanel>\n * <MosaicTabsPanel value=\"details\">Details content</MosaicTabsPanel>\n * </MosaicTabs>\n */\nexport function MosaicTabs({ className, ref, ...props }: MosaicTabsProps) {\n return (\n <Tabs.Root\n ref={ref}\n data-slot=\"tabs\"\n className={cn(\"flex flex-col gap-2\", className)}\n {...props}\n />\n );\n}\n\nMosaicTabs.displayName = \"MosaicTabs\";\n\n/**\n * MosaicTabsList β€” the tab bar containing tab triggers.\n */\nexport function MosaicTabsList({ className, ref, ...props }: MosaicTabsListProps) {\n return (\n <Tabs.List\n ref={ref}\n data-slot=\"tabs-list\"\n className={cn(\n \"relative inline-flex items-center justify-start gap-1\",\n \"rounded-lg bg-muted p-1 text-muted-foreground\",\n className,\n )}\n {...props}\n />\n );\n}\n\nMosaicTabsList.displayName = \"MosaicTabsList\";\n\n/**\n * MosaicTabsTrigger β€” individual tab button.\n * Must supply a `value` prop matching the corresponding MosaicTabsPanel value.\n */\nexport function MosaicTabsTrigger({ className, ref, ...props }: MosaicTabsTriggerProps) {\n return (\n <Tabs.Tab\n ref={ref}\n data-slot=\"tabs-trigger\"\n className={cn(\n \"inline-flex items-center justify-center gap-1.5 whitespace-nowrap\",\n \"rounded-md px-3 py-1.5 text-sm font-medium\",\n \"outline-none transition-all\",\n \"focus-visible:ring-ring focus-visible:ring-[3px]\",\n \"disabled:cursor-not-allowed disabled:opacity-50\",\n // Selected state\n \"data-[selected]:bg-background data-[selected]:text-foreground data-[selected]:shadow-xs\",\n // Unselected hover\n \"hover:text-foreground\",\n className,\n )}\n {...props}\n />\n );\n}\n\nMosaicTabsTrigger.displayName = \"MosaicTabsTrigger\";\n\n/**\n * MosaicTabsPanel β€” content panel revealed by the corresponding tab trigger.\n * Must supply a `value` prop matching the corresponding MosaicTabsTrigger value.\n */\nexport function MosaicTabsPanel({ className, ref, ...props }: MosaicTabsPanelProps) {\n return (\n <Tabs.Panel\n ref={ref}\n data-slot=\"tabs-panel\"\n className={cn(\n \"flex-1 outline-none\",\n \"focus-visible:ring-ring focus-visible:ring-[3px] focus-visible:rounded-md\",\n className,\n )}\n {...props}\n />\n );\n}\n\nMosaicTabsPanel.displayName = \"MosaicTabsPanel\";\n"
15
+ }
16
+ ],
17
+ "type": "registry:ui"
18
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-tag-input",
4
+ "title": "MosaicTagInput",
5
+ "description": "MosaicTagInput β€” presentational tag/chip input with optional autocomplete.",
6
+ "dependencies": [
7
+ "@base-ui/react"
8
+ ],
9
+ "registryDependencies": [],
10
+ "files": [
11
+ {
12
+ "path": "src/components/tag-input/MosaicTagInput.tsx",
13
+ "type": "registry:ui",
14
+ "content": "/**\n * MosaicTagInput β€” presentational tag/chip input with optional autocomplete.\n *\n * Controlled component: `tags` is the single source of truth, supplied and\n * owned by the host. This component never keeps its own copy of the tag\n * list β€” it only reports add/remove intents via `onAddTag`/`onRemoveTag`,\n * same controlled-callback shape as `MosaicResizableSplitPane` and\n * `MosaicToolToggleList`.\n *\n * Filtering of `suggestions` follows the `MosaicCombobox` convention:\n * `@base-ui/react/combobox`'s `useFilter({ sensitivity: \"base\" }).contains`\n * strategy, additionally excluding tags already selected.\n *\n * `maxTags` is enforced LOUDLY, never silently: past the cap, the\n * underlying input exposes `aria-disabled=\"true\"` and\n * `data-max-reached=\"true\"` so a host/test can observe the refusal, not\n * just infer it from a missing callback call.\n *\n * data-slot=\"tag-input\" on the root, data-slot=\"tag-input-tag\" on each chip.\n * Bilingual: `placeholder` and `removeTagAriaLabel` are required\n * host-supplied props β€” zero hardcoded copy, zero default (SIN-01).\n *\n * No \"use client\" in source β€” prepend-use-client.mjs adds it to dist.\n * Design tokens: --border, --background, --ring, --accent,\n * --accent-foreground, --foreground, --muted-foreground.\n *\n * @example\n * <MosaicTagInput\n * tags={tags}\n * onAddTag={(tag) => setTags((prev) => [...prev, tag])}\n * onRemoveTag={(tag) => setTags((prev) => prev.filter((t) => t !== tag))}\n * placeholder=\"Ajouter un tag…\"\n * removeTagAriaLabel={(tag) => `Retirer ${tag}`}\n * suggestions={[\"react\", \"vue\", \"svelte\"]}\n * maxTags={10}\n * />\n */\n\nimport { Combobox } from \"@base-ui/react/combobox\";\nimport type * as React from \"react\";\nimport { useMemo, useRef, useState } from \"react\";\nimport {\n tagInputFieldVariants,\n tagInputRemoveButtonVariants,\n tagInputRootVariants,\n tagInputTagVariants,\n} from \"./tag-input-variants.js\";\n\n// ── Utility ───────────────────────────────────────────────────────────────────\n\nfunction cn(...classes: (string | undefined | null | false)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n\n/** Merges an external React-19 ref prop with an internally-held ref. */\nfunction mergeRefs<T>(externalRef: React.Ref<T> | undefined, node: T | null) {\n if (typeof externalRef === \"function\") {\n externalRef(node);\n } else if (externalRef && typeof externalRef === \"object\") {\n (externalRef as React.MutableRefObject<T | null>).current = node;\n }\n}\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\nexport interface MosaicTagInputProps {\n /** Current list of tags. Controlled β€” the host owns the source of truth. */\n tags: string[];\n /** Called when a new tag should be added. */\n onAddTag: (tag: string) => void;\n /** Called when a tag should be removed. */\n onRemoveTag: (tag: string) => void;\n /** Input placeholder. Required β€” host-supplied, host-localized. */\n placeholder: string;\n /** Per-tag accessible name for the remove button. Required, no default. */\n removeTagAriaLabel: (tag: string) => string;\n /** Optional autocomplete source, filtered with \"contains\" against typed text. */\n suggestions?: string[];\n /** Maximum number of tags allowed. */\n maxTags?: number;\n /** Additional Tailwind classes on the root element. */\n className?: string;\n /** React 19 ref prop β€” forwarded to the underlying input. */\n ref?: React.Ref<HTMLInputElement>;\n}\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\n/**\n * MosaicTagInput β€” production tag/chip input atom for\n * @vantageos/mosaic-blocks.\n *\n * Purely presentational and fully controlled: renders `tags` as removable\n * chips plus a text field, reports add/remove intents via callbacks, and\n * optionally suggests matches from a host-supplied `suggestions` list.\n */\nexport function MosaicTagInput({\n tags,\n onAddTag,\n onRemoveTag,\n placeholder,\n removeTagAriaLabel,\n suggestions,\n maxTags,\n className,\n ref,\n}: MosaicTagInputProps) {\n const [inputValue, setInputValue] = useState(\"\");\n const inputRef = useRef<HTMLInputElement>(null);\n const filter = Combobox.useFilter({ sensitivity: \"base\" });\n\n const isMaxReached = maxTags !== undefined && tags.length >= maxTags;\n\n const trimmedValue = inputValue.trim();\n\n const filteredSuggestions = useMemo(() => {\n if (!suggestions || trimmedValue.length === 0) return [];\n return suggestions.filter(\n (suggestion) => !tags.includes(suggestion) && filter.contains(suggestion, trimmedValue),\n );\n }, [suggestions, tags, trimmedValue, filter]);\n\n function commitTag(rawValue: string) {\n if (isMaxReached) return;\n const trimmed = rawValue.trim();\n if (trimmed.length === 0) return;\n if (tags.includes(trimmed)) return;\n onAddTag(trimmed);\n setInputValue(\"\");\n }\n\n function handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>) {\n if (event.key === \"Enter\") {\n event.preventDefault();\n commitTag(inputValue);\n return;\n }\n if (event.key === \"Backspace\" && inputValue.length === 0 && tags.length > 0) {\n const lastTag = tags[tags.length - 1];\n if (lastTag !== undefined) onRemoveTag(lastTag);\n }\n }\n\n return (\n <div data-slot=\"tag-input\" className={cn(tagInputRootVariants(), className)}>\n {tags.map((tag) => (\n <span key={tag} data-slot=\"tag-input-tag\" className={tagInputTagVariants()}>\n {tag}\n <button\n type=\"button\"\n aria-label={removeTagAriaLabel(tag)}\n data-slot=\"tag-input-remove-button\"\n className={tagInputRemoveButtonVariants()}\n onClick={() => onRemoveTag(tag)}\n >\n Γ—\n </button>\n </span>\n ))}\n\n <input\n ref={(node) => {\n inputRef.current = node;\n mergeRefs(ref, node);\n }}\n type=\"text\"\n value={inputValue}\n placeholder={placeholder}\n onChange={(event) => setInputValue(event.target.value)}\n onKeyDown={handleKeyDown}\n aria-disabled={isMaxReached ? true : undefined}\n data-max-reached={isMaxReached ? true : undefined}\n data-slot=\"tag-input-field\"\n className={tagInputFieldVariants()}\n />\n\n {filteredSuggestions.length > 0 && (\n <ul\n data-slot=\"tag-input-suggestions\"\n className={cn(\n \"z-50 mt-1 w-full min-w-[8rem] overflow-hidden rounded-md border border-border\",\n \"bg-popover p-1 text-sm text-popover-foreground shadow-md\",\n )}\n >\n {filteredSuggestions.map((suggestion) => (\n <li key={suggestion}>\n <button\n type=\"button\"\n data-slot=\"tag-input-suggestion\"\n className=\"w-full cursor-pointer select-none rounded-sm px-2 py-1.5 text-left outline-none hover:bg-accent hover:text-accent-foreground focus-visible:ring-ring focus-visible:ring-[2px]\"\n onClick={() => commitTag(suggestion)}\n >\n {suggestion}\n </button>\n </li>\n ))}\n </ul>\n )}\n </div>\n );\n}\n\nMosaicTagInput.displayName = \"MosaicTagInput\";\n"
15
+ },
16
+ {
17
+ "path": "src/components/tag-input/tag-input-variants.ts",
18
+ "type": "registry:ui",
19
+ "content": "/**\n * tagInputVariants β€” pure CVA variant functions for MosaicTagInput.\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 container β€” wraps tags + input, bordered like a text field. */\nexport const tagInputRootVariants = cva([\n \"flex w-full flex-wrap items-center gap-1.5 rounded-md border border-border\",\n \"bg-background px-2 py-1.5 text-sm shadow-xs\",\n \"focus-within:ring-ring focus-within:ring-[3px]\",\n \"has-[input[aria-disabled='true']]:cursor-not-allowed has-[input[aria-disabled='true']]:opacity-50\",\n]);\n\n/** One tag chip. */\nexport const tagInputTagVariants = cva([\n \"inline-flex items-center gap-1 rounded-md bg-accent px-2 py-0.5\",\n \"text-sm text-accent-foreground\",\n]);\n\n/** Remove button inside a tag chip. */\nexport const tagInputRemoveButtonVariants = cva([\n \"inline-flex size-4 shrink-0 items-center justify-center rounded-sm\",\n \"text-accent-foreground/70 outline-none transition-colors\",\n \"hover:bg-accent-foreground/10 hover:text-accent-foreground\",\n \"focus-visible:ring-ring focus-visible:ring-[2px]\",\n]);\n\n/** Bare text input where new tags are typed. */\nexport const tagInputFieldVariants = cva([\n \"min-w-[6ch] flex-1 border-none bg-transparent px-1 py-0.5 text-sm text-foreground outline-none\",\n \"placeholder:text-muted-foreground\",\n]);\n"
20
+ }
21
+ ],
22
+ "type": "registry:ui"
23
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-template-agent-card",
4
+ "title": "MosaicTemplateAgentCard",
5
+ "description": "MosaicTemplateAgentCard β€” agent-type template preview card",
6
+ "dependencies": [],
7
+ "registryDependencies": [],
8
+ "files": [
9
+ {
10
+ "path": "src/components/template-agent-card/MosaicTemplateAgentCard.tsx",
11
+ "type": "registry:ui",
12
+ "content": "\"use client\";\n\n/**\n * MosaicTemplateAgentCard β€” agent-type template preview card\n *\n * Ported from any-debate-ai's components/templates/TemplateCard.tsx.\n *\n * What was dropped and why:\n * - `useDevice()` / `isMobile` breakpoint branching β€” a JS-side responsive\n * toggle is app-specific plumbing, not a library concern. The host controls\n * density via `className` / CSS container queries instead.\n * - `conversationIcons` (debate/collaboration/analysis -> lucide icon map) and\n * the `isPopular`/`isTrending` thresholds derived from `usageCount` β€” both\n * are hardcoded business knowledge (a taxonomy of conversation types, and a\n * \"popular\" threshold) that does not belong in the component. The host\n * passes an optional `icon` node and decides its own popularity badges, if\n * any, via composition around this card.\n * - `framer-motion` hover/tap scale β€” not a locked dependency here; dropped\n * with a plain CSS `transition-all` on the CVA root instead.\n * - lucide-react icons β€” no icon library dependency in this repo; inline SVG\n * only, same as MosaicAgentCard / MosaicModuleCard / MosaicMemoryCard.\n *\n * a11y fix vs. the source: the source made the whole `<Card>` a `<div\n * onClick>` with nested `<Button>`s for preview/duplicate (stopping click\n * propagation). A `<div onClick>` is not keyboard-actionable, and nesting\n * `<button>` inside a clickable non-button element is fragile. Here the\n * \"select\" affordance is its own real `<button>` (name + `aria-pressed`\n * driven by the host), and preview/duplicate are SIBLING buttons β€” never\n * nested inside another interactive element.\n *\n * SIN-01 (bilingual by design): every visible string is a required prop or a\n * required formatter function, no default, no fallback operator, no\n * destructuring default. `agentCountLabel` is the one exception that would\n * look surprising: it is the fully-formatted string (\"3 agents\"), not a\n * number, because pluralization is a locale rule the library must not own.\n *\n * Pattern: MosaicMemoryCard.tsx (data-slot, cva variants module, manual\n * dropdown-free actions row, inline SVG icons, React 19 ref prop,\n * displayName, JSDoc, formatter props over hardcoded strings).\n * Design tokens: --card, --card-foreground, --border, --primary,\n * --muted-foreground, --muted.\n * No icon library β€” inline SVGs only.\n */\n\nimport type * as React from \"react\";\nimport {\n templateAgentCardBadgeVariants,\n templateAgentCardTagVariants,\n templateAgentCardVariants,\n} from \"./template-agent-card-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 MosaicTemplateAgentData {\n id: string;\n name: string;\n description: string;\n /** Number of agents composing this template. Formatted by the host via `agentCountLabel`. */\n agentCount: number;\n /** Raw usage count. Formatted by the host via `formatUsageCount`. */\n usageCount: number;\n /** Free-form category string β€” host-owned taxonomy, never a library enum. */\n category?: string;\n tags?: string[];\n}\n\nexport interface MosaicTemplateAgentCardProps {\n template: MosaicTemplateAgentData;\n isSelected?: boolean;\n onSelect: (template: MosaicTemplateAgentData) => void;\n onPreview?: (template: MosaicTemplateAgentData) => void;\n onDuplicate?: (template: MosaicTemplateAgentData) => void;\n /** Optional leading icon β€” host-owned, no default (no icon-library dependency here). */\n icon?: React.ReactNode;\n /**\n * Accessible name for the card's clickable \"select\" button. Required β€”\n * host-owned (e.g. `t(\"templates.select\", { name: template.name })`).\n */\n selectAriaLabel: string;\n /**\n * Fully-formatted agent-count caption (e.g. \"3 agents\"). Required β€” the\n * host owns pluralization and language, the library never counts words.\n */\n agentCountLabel: string;\n /**\n * Formatter producing the usage-count caption from `template.usageCount`.\n * Required β€” always called, even when the count is 0; a host that wants\n * the badge hidden at 0 returns `null` from this formatter itself.\n */\n formatUsageCount: (count: number) => React.ReactNode;\n /**\n * Formatter producing the \"+N\" overflow caption when a template has more\n * than 3 tags. Required β€” host-owned (e.g. `(n) => \\`+\\${n}\\`` or a\n * pluralized `t()` call).\n */\n formatMoreTags: (count: number) => React.ReactNode;\n /** aria-label for the preview action. Required, no default. */\n previewAriaLabel: string;\n /** aria-label for the duplicate action. Required, no default. */\n duplicateAriaLabel: string;\n className?: string;\n /** React 19 ref prop β€” forwarded to the root element. */\n ref?: React.Ref<HTMLDivElement>;\n}\n\nconst MAX_VISIBLE_TAGS = 3;\n\n// ── Inline SVG icons ──────────────────────────────────────────────────────────\n\nfunction EyeIcon() {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/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=\"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n );\n}\n\nfunction CopyIcon() {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/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 <rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\" ry=\"2\" />\n <path d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\" />\n </svg>\n );\n}\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\n/**\n * MosaicTemplateAgentCard β€” production template preview card for\n * @vantageos/mosaic-blocks. Presentational and controlled: it renders a\n * template's identity and metadata and reports intents (`onSelect`,\n * `onPreview`, `onDuplicate`) β€” it never decides anything about the data.\n *\n * @example\n * <MosaicTemplateAgentCard\n * template={template}\n * isSelected={selectedId === template.id}\n * onSelect={(t) => setSelectedId(t.id)}\n * onPreview={(t) => openPreview(t)}\n * onDuplicate={(t) => duplicateTemplate(t)}\n * selectAriaLabel={t(\"templates.select\", { name: template.name })}\n * agentCountLabel={t(\"templates.agentCount\", { count: template.agentCount })}\n * formatUsageCount={(count) => (count > 0 ? t(\"templates.uses\", { count }) : null)}\n * formatMoreTags={(count) => `+${count}`}\n * previewAriaLabel={t(\"templates.preview\")}\n * duplicateAriaLabel={t(\"templates.duplicate\")}\n * />\n */\nexport function MosaicTemplateAgentCard({\n template,\n isSelected = false,\n onSelect,\n onPreview,\n onDuplicate,\n icon,\n selectAriaLabel,\n agentCountLabel,\n formatUsageCount,\n formatMoreTags,\n previewAriaLabel,\n duplicateAriaLabel,\n className,\n ref,\n}: MosaicTemplateAgentCardProps) {\n const visibleTags = template.tags?.slice(0, MAX_VISIBLE_TAGS) ?? [];\n const hiddenTagCount = (template.tags?.length ?? 0) - visibleTags.length;\n\n return (\n <div\n ref={ref}\n data-slot=\"template-agent-card\"\n className={cn(templateAgentCardVariants({ selected: isSelected }), \"p-4\", className)}\n >\n <div className=\"flex items-start justify-between gap-2\">\n <button\n type=\"button\"\n onClick={() => onSelect(template)}\n aria-label={selectAriaLabel}\n aria-pressed={isSelected}\n className={cn(\n \"flex min-w-0 flex-1 items-start gap-2 rounded-md text-left\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n )}\n >\n {icon && (\n <span className=\"mt-0.5 shrink-0 text-primary\" aria-hidden=\"true\">\n {icon}\n </span>\n )}\n <span className=\"min-w-0\">\n <span className=\"block truncate text-sm font-semibold leading-tight\">\n {template.name}\n </span>\n <span className=\"mt-1 block line-clamp-2 text-xs text-muted-foreground\">\n {template.description}\n </span>\n </span>\n </button>\n </div>\n\n <div className=\"mt-3 flex flex-wrap items-center gap-2\">\n {template.category && (\n <span className={cn(templateAgentCardBadgeVariants())}>{template.category}</span>\n )}\n <span className={cn(templateAgentCardBadgeVariants())}>{agentCountLabel}</span>\n {formatUsageCount(template.usageCount) != null && (\n <span className={cn(templateAgentCardBadgeVariants())}>\n {formatUsageCount(template.usageCount)}\n </span>\n )}\n {visibleTags.map((tag) => (\n <span key={tag} className={cn(templateAgentCardTagVariants())}>\n {tag}\n </span>\n ))}\n {hiddenTagCount > 0 && (\n <span className={cn(templateAgentCardTagVariants())}>\n {formatMoreTags(hiddenTagCount)}\n </span>\n )}\n </div>\n\n {(onPreview || onDuplicate) && (\n <div className=\"mt-3 flex items-center gap-2 border-t border-border pt-2\">\n {onPreview && (\n <button\n type=\"button\"\n onClick={() => onPreview(template)}\n aria-label={previewAriaLabel}\n className={cn(\n \"inline-flex h-8 flex-1 items-center justify-center gap-1.5 rounded-md text-xs font-medium\",\n \"text-muted-foreground hover:bg-accent hover:text-accent-foreground\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n )}\n >\n <EyeIcon />\n {previewAriaLabel}\n </button>\n )}\n {onDuplicate && (\n <button\n type=\"button\"\n onClick={() => onDuplicate(template)}\n aria-label={duplicateAriaLabel}\n className={cn(\n \"inline-flex h-8 flex-1 items-center justify-center gap-1.5 rounded-md text-xs font-medium\",\n \"text-muted-foreground hover:bg-accent hover:text-accent-foreground\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n )}\n >\n <CopyIcon />\n {duplicateAriaLabel}\n </button>\n )}\n </div>\n )}\n </div>\n );\n}\n\nMosaicTemplateAgentCard.displayName = \"MosaicTemplateAgentCard\";\n"
13
+ },
14
+ {
15
+ "path": "src/components/template-agent-card/template-agent-card-variants.ts",
16
+ "type": "registry:ui",
17
+ "content": "/**\n * templateAgentCardVariants β€” pure CVA variant functions for MosaicTemplateAgentCard.\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 β€” selected state only. */\nexport const templateAgentCardVariants = cva(\n [\n \"rounded-lg border border-border bg-card text-card-foreground shadow-sm\",\n \"transition-all hover:border-primary/50\",\n ],\n {\n variants: {\n selected: {\n true: \"ring-2 ring-primary border-primary bg-primary/5\",\n false: \"\",\n },\n },\n defaultVariants: {\n selected: false,\n },\n },\n);\n\n/** Category / agent-count / usage-count badge. */\nexport const templateAgentCardBadgeVariants = cva([\n \"inline-flex items-center rounded-md border border-border px-2 py-0.5 text-xs font-medium\",\n]);\n\n/** Tag chip, including the \"+N\" overflow chip. */\nexport const templateAgentCardTagVariants = cva([\n \"inline-flex items-center rounded-full border border-border bg-muted px-2 py-0.5 text-xs text-muted-foreground\",\n]);\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-template-category-chips",
4
+ "title": "MosaicTemplateCategoryChips",
5
+ "description": "MosaicTemplateCategoryChips β€” presentational horizontal chip row filtering agent-templates by category.",
6
+ "dependencies": [],
7
+ "registryDependencies": [],
8
+ "files": [
9
+ {
10
+ "path": "src/components/template-category-chips/MosaicTemplateCategoryChips.tsx",
11
+ "type": "registry:ui",
12
+ "content": "/**\n * MosaicTemplateCategoryChips β€” presentational horizontal chip row filtering\n * agent-templates by category.\n *\n * Ported from any-debate-ai `components/templates/shared/\n * TemplateCategoryChips.tsx` (source read verbatim via `gh api repos/\n * elpiarthera/any-debate-ai/contents/components/templates/shared/\n * TemplateCategoryChips.tsx`). That source hardcodes the `\"All\"` sentinel\n * string in its prop type (`TemplateCategory | \"All\"`) and imports a closed\n * `TemplateCategory` union from `@/lib/templates/types` β€” both a business\n * taxonomy AND a business copy string baked into the component. It also\n * omits scroll-fade / arrow chrome handling from this port (that is\n * presentation-shell concern, not the filter atom itself) and drops the\n * `useDevice()` mobile/desktop branch β€” a single responsive `flex-wrap` row\n * covers both, since this library never assumes a host's device-detection\n * context exists.\n *\n * Differentiator (the whole point of this component): the category\n * catalogue β€” including any \"All\" / \"Tous\" pseudo-category β€” is 100%\n * host-supplied DATA (`categories` prop). This library has never heard of a\n * single business category name; a client with a different vertical (legal,\n * healthcare, e-commerce) supplies its own list without touching this\n * package.\n *\n * Controlled component: no internal selection state. `selected` +\n * `onSelect` are host-owned; the host re-renders with the new selection\n * after handling the callback.\n *\n * No \"use client\" β€” prepend-use-client.mjs adds it to dist.\n * Design tokens: --primary, --primary-foreground, --background,\n * --foreground, --border, --muted, --ring.\n * a11y: every chip is a real `<button>` (keyboard-activatable natively β€”\n * Enter/Space), and the selected chip announces `aria-pressed=\"true\"` so\n * screen-reader users get the selection state without relying on color\n * alone.\n * Bilingual: every category label is host-supplied data β€” zero hardcoded\n * copy, zero default (including the \"All\" / \"Tous\" sentinel).\n *\n * @example\n * <MosaicTemplateCategoryChips\n * categories={[\n * { id: \"all\", label: \"Toutes\" },\n * { id: \"business\", label: \"Business\" },\n * { id: \"creative\", label: \"CrΓ©atif\" },\n * ]}\n * selected={selectedCategoryId}\n * onSelect={(id) => setSelectedCategoryId(id)}\n * />\n */\n\nimport type * as React from \"react\";\nimport { templateCategoryChipVariants } from \"./template-category-chips-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 * One selectable category. The library knows nothing about any category by\n * name β€” including the \"show everything\" pseudo-category, which is just\n * another host-supplied entry (e.g. `{ id: \"all\", label: \"All\" }`).\n */\nexport interface MosaicTemplateCategory {\n /** Stable identifier, matched against `selected` and passed to `onSelect`. */\n id: string;\n /** Host-supplied, host-localized display label. No built-in taxonomy. */\n label: string;\n}\n\nexport interface MosaicTemplateCategoryChipsProps {\n /** Full open catalogue of categories β€” a PROP, never a library constant. */\n categories: MosaicTemplateCategory[];\n /** Currently selected category id. Controlled by the host. */\n selected: string;\n /** Called with the category id when a chip is activated. */\n onSelect: (id: string) => void;\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// ── Component ─────────────────────────────────────────────────────────────────\n\n/**\n * MosaicTemplateCategoryChips β€” production template-filter atom for\n * @vantageos/mosaic-blocks.\n *\n * Purely presentational: renders one real `<button>` per host-supplied\n * category, reports every activation via `onSelect`. No network call, no\n * internal state, no hardcoded category catalogue.\n */\nexport function MosaicTemplateCategoryChips({\n categories,\n selected,\n onSelect,\n className,\n ref,\n}: MosaicTemplateCategoryChipsProps) {\n return (\n <div\n ref={ref}\n data-slot=\"template-category-chips\"\n className={cn(\"flex flex-wrap items-center gap-2\", className)}\n >\n {categories.map((category) => {\n const isSelected = category.id === selected;\n return (\n <button\n key={category.id}\n type=\"button\"\n data-slot=\"template-category-chip\"\n aria-pressed={isSelected}\n onClick={() => onSelect(category.id)}\n className={templateCategoryChipVariants({ selected: isSelected })}\n >\n {category.label}\n </button>\n );\n })}\n </div>\n );\n}\n\nMosaicTemplateCategoryChips.displayName = \"MosaicTemplateCategoryChips\";\n"
13
+ },
14
+ {
15
+ "path": "src/components/template-category-chips/template-category-chips-variants.ts",
16
+ "type": "registry:ui",
17
+ "content": "/**\n * templateCategoryChipVariants β€” pure CVA variant function for\n * MosaicTemplateCategoryChips.\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\n/** One category chip button β€” selected vs. unselected tone. */\nexport const templateCategoryChipVariants = cva(\n [\n \"inline-flex items-center justify-center whitespace-nowrap\",\n \"rounded-full border px-3 py-1.5\",\n \"text-xs font-medium transition-colors\",\n \"focus-visible:outline-none focus-visible:ring-ring focus-visible:ring-[3px]\",\n ],\n {\n variants: {\n selected: {\n true: \"border-transparent bg-primary text-primary-foreground\",\n false: \"border-border bg-background text-foreground hover:bg-muted\",\n },\n },\n defaultVariants: {\n selected: false,\n },\n },\n);\n"
18
+ }
19
+ ],
20
+ "type": "registry:ui"
21
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-template-gallery",
4
+ "title": "MosaicTemplateGallery",
5
+ "description": "Responsive template browser (responsive-pair). Includes MosaicTemplateCard, MosaicTemplatePreview, MosaicQuickStartPanel, MosaicAgentTeamPreview.",
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-device-provider.json",
10
+ "https://cdn.jsdelivr.net/npm/@vantageos/mosaic-blocks@0.5.36-alpha/r/mosaic-filter-sidebar.json"
11
+ ],
12
+ "files": [
13
+ {
14
+ "path": "src/components/template-gallery/MosaicTemplateGallery.tsx",
15
+ "type": "registry:ui",
16
+ "content": "\"use client\";\n\n/**\n * MosaicTemplateGallery β€” generic template browser (responsive-pair)\n *\n * Ported from components/templates/ (TemplateGallery, TemplateCard,\n * TemplatePreview, TemplateSelectorModal, QuickStartPanel, AgentTeamPreview)\n * Combined into a single composable module.\n *\n * Exports:\n * MosaicTemplateGallery β€” responsive orchestrator (main entry point)\n * MosaicTemplateCard β€” individual card\n * MosaicTemplatePreview β€” detail preview panel\n * MosaicQuickStartPanel β€” quick-start scenario / preset grid\n * MosaicAgentTeamPreview β€” visual agent team display\n *\n * All domain types (DebateTemplate, AgentTeamPreset, etc.) replaced with\n * generic MosaicTemplate*, MosaicAgentPreset, MosaicScenario types.\n * framer-motion replaced with CSS transitions.\n */\n\nimport * as React from \"react\";\nimport { MosaicAdaptiveModal } from \"@/components/ui/MosaicAdaptiveModal\";\nimport { useDevice } from \"@/components/ui/MosaicDeviceProvider\";\nimport { MosaicFilterSidebar } from \"@/components/ui/MosaicFilterSidebar\";\nimport type { MosaicFilterOption } from \"@/components/ui/MosaicFilterSidebar\";\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 MosaicTemplateAgent {\n id: string;\n name: string;\n type?: string;\n accentColor?: string;\n}\n\nexport interface MosaicTemplateMetadata {\n usageCount?: number;\n tags?: string[];\n createdBy?: string;\n createdAt?: string | Date;\n}\n\nexport interface MosaicTemplate {\n id: string;\n name: string;\n description?: string;\n category: string;\n agents?: MosaicTemplateAgent[];\n metadata?: MosaicTemplateMetadata;\n /** \"debate\" | \"collaboration\" | \"analysis\" | string */\n type?: string;\n}\n\nexport interface MosaicScenario {\n id: string;\n title: string;\n description?: string;\n icon?: React.ReactNode;\n tags?: string[];\n}\n\nexport interface MosaicAgentPreset {\n id: string;\n name: string;\n description?: string;\n agents?: MosaicTemplateAgent[];\n}\n\n// ── Inline icons ──────────────────────────────────────────────────────────────\n\nfunction StarIcon() {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"13\"\n height=\"13\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n className=\"text-yellow-500\"\n >\n <polygon points=\"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2\" />\n </svg>\n );\n}\n\nfunction TrendingIcon() {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"13\"\n height=\"13\"\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 className=\"text-success-500\"\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\nfunction ChevronRightIcon() {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/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=\"9 18 15 12 9 6\" />\n </svg>\n );\n}\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 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// ── MosaicTemplateCard ────────────────────────────────────────────────────────\n\nexport interface MosaicTemplateCardProps {\n template: MosaicTemplate;\n isSelected?: boolean;\n onSelect: (template: MosaicTemplate) => void;\n onPreview?: (template: MosaicTemplate) => void;\n onDuplicate?: (template: MosaicTemplate) => void;\n showActions?: boolean;\n compact?: boolean;\n /** Label for the preview action button. Required, no default. */\n previewLabel: string;\n /** Label for the duplicate action button. Required, no default. */\n duplicateLabel: string;\n /** Badge text for the agent count. Receives the count; host owns the unit word. Required, no default. */\n formatAgentCount: (count: number) => string;\n /** Badge text for the usage count. Receives the count; host owns the unit word. Required, no default. */\n formatUsageCount: (count: number) => string;\n}\n\nexport function MosaicTemplateCard({\n template,\n isSelected,\n onSelect,\n onPreview,\n onDuplicate,\n showActions = false,\n compact = false,\n previewLabel,\n duplicateLabel,\n formatAgentCount,\n formatUsageCount,\n}: MosaicTemplateCardProps) {\n const isPopular = (template.metadata?.usageCount ?? 0) > 10;\n const isTrending = (template.metadata?.usageCount ?? 0) > 5;\n const tags = template.metadata?.tags ?? [];\n\n return (\n <button\n type=\"button\"\n onClick={() => onSelect(template)}\n data-slot=\"template-card\"\n className={cn(\n \"w-full text-left rounded-lg border transition-all duration-200\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n isSelected\n ? \"border-primary bg-primary/5 ring-2 ring-primary\"\n : \"border-border bg-card hover:border-primary/50\",\n compact ? \"p-3\" : \"p-4\",\n )}\n >\n <div className=\"flex items-start justify-between gap-2\">\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-sm font-semibold leading-tight line-clamp-1\">{template.name}</p>\n {template.description && (\n <p className=\"mt-1 text-xs text-muted-foreground line-clamp-2\">\n {template.description}\n </p>\n )}\n </div>\n <div className=\"flex shrink-0 items-center gap-1\">\n {isPopular && <StarIcon />}\n {isTrending && <TrendingIcon />}\n {compact && <ChevronRightIcon />}\n </div>\n </div>\n\n <div className=\"mt-2 flex flex-wrap items-center gap-1.5\">\n <span className=\"rounded-md bg-secondary px-2 py-0.5 text-xs text-secondary-foreground\">\n {template.category}\n </span>\n {template.agents && template.agents.length > 0 && (\n <span className=\"rounded-md border border-border px-2 py-0.5 text-xs text-muted-foreground\">\n {formatAgentCount(template.agents.length)}\n </span>\n )}\n {(template.metadata?.usageCount ?? 0) > 0 && (\n <span className=\"rounded-md border border-border px-2 py-0.5 text-xs text-muted-foreground\">\n {formatUsageCount(template.metadata?.usageCount ?? 0)}\n </span>\n )}\n {tags.slice(0, compact ? 1 : 2).map((tag) => (\n <span\n key={tag}\n className=\"rounded-md border border-border px-2 py-0.5 text-xs text-muted-foreground\"\n >\n #{tag}\n </span>\n ))}\n </div>\n\n {showActions && (\n <div className=\"mt-3 flex gap-2\">\n {onPreview && (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n onPreview(template);\n }}\n className=\"inline-flex h-7 items-center gap-1 rounded-md border border-border bg-background px-2.5 text-xs font-medium hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\"\n >\n {previewLabel}\n </button>\n )}\n {onDuplicate && (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n onDuplicate(template);\n }}\n className=\"inline-flex h-7 items-center gap-1 rounded-md border border-border bg-background px-2.5 text-xs font-medium hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\"\n >\n {duplicateLabel}\n </button>\n )}\n </div>\n )}\n </button>\n );\n}\n\nMosaicTemplateCard.displayName = \"MosaicTemplateCard\";\n\n// ── MosaicTemplatePreview ─────────────────────────────────────────────────────\n\nexport interface MosaicTemplatePreviewProps {\n template: MosaicTemplate;\n onSelect: (template: MosaicTemplate) => void;\n onClose?: () => void;\n /** Label for the \"use template\" confirm button. Required, no default. */\n selectLabel: string;\n /** Label for the cancel button (shown when `onClose` is set). Required, no default. */\n cancelLabel: string;\n /**\n * Formatter for the \"Agents (N)\" heading, shown only when `template.agents`\n * is non-empty. Optional β€” when absent, the heading is not rendered at all\n * (no fallback word). The host owns the language\n * (e.g. `(count) => t('TemplatePreview.agentsCount', { count })`).\n */\n formatAgentsHeading?: (count: number) => string;\n}\n\nexport function MosaicTemplatePreview({\n template,\n onSelect,\n onClose,\n selectLabel,\n cancelLabel,\n formatAgentsHeading,\n}: MosaicTemplatePreviewProps) {\n return (\n <div data-slot=\"template-preview\" className=\"flex flex-col gap-4 p-4\">\n <div>\n <h3 className=\"text-lg font-semibold\">{template.name}</h3>\n {template.description && (\n <p className=\"mt-1 text-sm text-muted-foreground\">{template.description}</p>\n )}\n </div>\n\n <div className=\"flex flex-wrap gap-2\">\n <span className=\"rounded-md bg-secondary px-2 py-1 text-xs text-secondary-foreground\">\n {template.category}\n </span>\n {template.type && (\n <span className=\"rounded-md border border-border px-2 py-1 text-xs text-muted-foreground\">\n {template.type}\n </span>\n )}\n </div>\n\n {template.agents && template.agents.length > 0 && (\n <div>\n {formatAgentsHeading && (\n <p className=\"mb-2 text-sm font-medium\">\n {formatAgentsHeading(template.agents.length)}\n </p>\n )}\n <div className=\"flex flex-wrap gap-2\">\n {template.agents.map((agent) => (\n <div\n key={agent.id}\n className=\"flex items-center gap-1.5 rounded-md border border-border px-2 py-1\"\n >\n {agent.accentColor && (\n <span\n className={cn(\"h-2 w-2 rounded-full\", agent.accentColor)}\n aria-hidden=\"true\"\n />\n )}\n <span className=\"text-xs text-foreground\">{agent.name}</span>\n {agent.type && (\n <span className=\"text-xs text-muted-foreground\">({agent.type})</span>\n )}\n </div>\n ))}\n </div>\n </div>\n )}\n\n {(template.metadata?.tags ?? []).length > 0 && (\n <div className=\"flex flex-wrap gap-1.5\">\n {(template.metadata?.tags ?? []).map((tag) => (\n <span\n key={tag}\n className=\"rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground\"\n >\n #{tag}\n </span>\n ))}\n </div>\n )}\n\n <div className=\"flex justify-end gap-2 pt-2\">\n {onClose && (\n <button\n type=\"button\"\n onClick={onClose}\n className=\"inline-flex min-h-[44px] items-center justify-center rounded-md border border-border bg-background px-4 text-sm font-medium text-foreground hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n {cancelLabel}\n </button>\n )}\n <button\n type=\"button\"\n onClick={() => onSelect(template)}\n className=\"inline-flex min-h-[44px] items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n {selectLabel}\n </button>\n </div>\n </div>\n );\n}\n\nMosaicTemplatePreview.displayName = \"MosaicTemplatePreview\";\n\n// ── MosaicAgentTeamPreview ────────────────────────────────────────────────────\n\nexport interface MosaicAgentTeamPreviewProps {\n agents: MosaicTemplateAgent[];\n label?: string;\n}\n\nexport function MosaicAgentTeamPreview({ agents, label }: MosaicAgentTeamPreviewProps) {\n return (\n <div data-slot=\"agent-team-preview\" className=\"flex flex-col gap-3\">\n {label && <p className=\"text-sm font-medium text-foreground\">{label}</p>}\n <div className=\"flex flex-wrap gap-2\">\n {agents.map((agent) => (\n <div\n key={agent.id}\n className=\"flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-2\"\n >\n {agent.accentColor && (\n <span\n className={cn(\"h-2.5 w-2.5 rounded-full\", agent.accentColor)}\n aria-hidden=\"true\"\n />\n )}\n <span className=\"text-sm font-medium\">{agent.name}</span>\n {agent.type && (\n <span className=\"rounded-md bg-muted px-1.5 py-0.5 text-xs text-muted-foreground\">\n {agent.type}\n </span>\n )}\n </div>\n ))}\n </div>\n </div>\n );\n}\n\nMosaicAgentTeamPreview.displayName = \"MosaicAgentTeamPreview\";\n\n// ── MosaicQuickStartPanel ─────────────────────────────────────────────────────\n\nexport interface MosaicQuickStartPanelProps {\n scenarios?: MosaicScenario[];\n presets?: MosaicAgentPreset[];\n onSelectScenario: (scenario: MosaicScenario) => void;\n onSelectPreset: (preset: MosaicAgentPreset) => void;\n onStartFromScratch?: () => void;\n scenariosTitle?: string;\n presetsTitle?: string;\n scratchLabel?: string;\n className?: string;\n}\n\nexport function MosaicQuickStartPanel({\n scenarios = [],\n presets = [],\n onSelectScenario,\n onSelectPreset,\n onStartFromScratch,\n scenariosTitle,\n presetsTitle,\n scratchLabel,\n className,\n}: MosaicQuickStartPanelProps) {\n return (\n <div data-slot=\"quick-start-panel\" className={cn(\"flex flex-col gap-6\", className)}>\n {scenarios.length > 0 && (\n <div>\n <h3 className=\"mb-3 text-sm font-semibold text-foreground\">{scenariosTitle}</h3>\n <div className=\"grid gap-3 sm:grid-cols-2\">\n {scenarios.map((scenario) => (\n <button\n key={scenario.id}\n type=\"button\"\n onClick={() => onSelectScenario(scenario)}\n className={cn(\n \"flex items-start gap-3 rounded-lg border border-border bg-card p-4 text-left\",\n \"hover:border-primary/50 hover:bg-primary/5\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n \"transition-colors\",\n )}\n >\n {scenario.icon && <span className=\"mt-0.5 shrink-0\">{scenario.icon}</span>}\n <div>\n <p className=\"text-sm font-medium\">{scenario.title}</p>\n {scenario.description && (\n <p className=\"mt-0.5 text-xs text-muted-foreground\">{scenario.description}</p>\n )}\n {scenario.tags && (\n <div className=\"mt-2 flex flex-wrap gap-1\">\n {scenario.tags.map((tag) => (\n <span\n key={tag}\n className=\"rounded bg-muted px-1.5 py-0.5 text-xs text-muted-foreground\"\n >\n {tag}\n </span>\n ))}\n </div>\n )}\n </div>\n </button>\n ))}\n </div>\n </div>\n )}\n\n {presets.length > 0 && (\n <div>\n <h3 className=\"mb-3 text-sm font-semibold text-foreground\">{presetsTitle}</h3>\n <div className=\"flex flex-col gap-2\">\n {presets.map((preset) => (\n <button\n key={preset.id}\n type=\"button\"\n onClick={() => onSelectPreset(preset)}\n className={cn(\n \"flex items-center justify-between gap-3 rounded-lg border border-border bg-card px-4 py-3 text-left\",\n \"hover:border-primary/50\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n \"transition-colors\",\n )}\n >\n <div>\n <p className=\"text-sm font-medium\">{preset.name}</p>\n {preset.description && (\n <p className=\"mt-0.5 text-xs text-muted-foreground\">{preset.description}</p>\n )}\n {preset.agents && preset.agents.length > 0 && (\n <div className=\"mt-2 flex gap-1.5\">\n {preset.agents.map((a) => (\n <div key={a.id} className=\"flex items-center gap-1\">\n {a.accentColor && (\n <span\n className={cn(\"h-2 w-2 rounded-full\", a.accentColor)}\n aria-hidden=\"true\"\n />\n )}\n <span className=\"text-xs text-muted-foreground\">{a.name}</span>\n </div>\n ))}\n </div>\n )}\n </div>\n <ChevronRightIcon />\n </button>\n ))}\n </div>\n </div>\n )}\n\n {onStartFromScratch && (\n <button\n type=\"button\"\n onClick={onStartFromScratch}\n className={cn(\n \"inline-flex min-h-[44px] w-full items-center justify-center rounded-md border border-border\",\n \"bg-background px-4 text-sm font-medium 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 >\n {scratchLabel}\n </button>\n )}\n </div>\n );\n}\n\nMosaicQuickStartPanel.displayName = \"MosaicQuickStartPanel\";\n\n// ── MosaicTemplateGallery (orchestrator) ──────────────────────────────────────\n\nexport interface MosaicTemplateGalleryProps {\n templates: MosaicTemplate[];\n selectedTemplate?: MosaicTemplate;\n onSelectTemplate: (template: MosaicTemplate) => void;\n onPreviewTemplate?: (template: MosaicTemplate) => void;\n onDuplicateTemplate?: (template: MosaicTemplate) => void;\n filters?: MosaicFilterOption[];\n selectedFilter: string;\n onFilterChange: (id: string) => void;\n categories?: MosaicFilterOption[];\n selectedCategory: string;\n onCategoryChange: (id: string) => void;\n showActions?: boolean;\n title?: string;\n searchPlaceholder?: string;\n /** Message shown when the filtered template list is empty. Required, no default. */\n emptyMessage: string;\n /** aria-label for the mobile \"open filters\" button. Required, no default. */\n openFiltersAriaLabel: string;\n /** Title of the filter sidebar / mobile filters modal. Required, no default. */\n filtersTitle: string;\n /** aria-label for the mobile filters modal close button. Required, no default. */\n closeFiltersAriaLabel: string;\n /** Forwarded to MosaicFilterSidebar β€” required, no default. */\n expandFiltersAriaLabel: string;\n /** Forwarded to MosaicFilterSidebar β€” required, no default. */\n categoriesHeading: string;\n /** Forwarded to MosaicFilterSidebar β€” required, no default. */\n collapseSidebarAriaLabel: string;\n /** Forwarded to MosaicFilterSidebar β€” required, no default. */\n expandSidebarAriaLabel: string;\n /** Required host-owned strings forwarded to every MosaicTemplateCard. */\n previewLabel: string;\n duplicateLabel: string;\n /** Forwarded to every MosaicTemplateCard β€” required, no default. */\n formatAgentCount: (count: number) => string;\n /** Forwarded to every MosaicTemplateCard β€” required, no default. */\n formatUsageCount: (count: number) => string;\n className?: string;\n}\n\nfunction TemplateGalleryContent({\n templates,\n selectedTemplate,\n onSelectTemplate,\n onPreviewTemplate,\n onDuplicateTemplate,\n filters,\n selectedFilter,\n onFilterChange,\n categories,\n selectedCategory,\n onCategoryChange,\n showActions,\n title,\n searchPlaceholder,\n emptyMessage,\n openFiltersAriaLabel,\n filtersTitle,\n closeFiltersAriaLabel,\n expandFiltersAriaLabel,\n categoriesHeading,\n collapseSidebarAriaLabel,\n expandSidebarAriaLabel,\n previewLabel,\n duplicateLabel,\n formatAgentCount,\n formatUsageCount,\n isMobile,\n}: MosaicTemplateGalleryProps & { isMobile: boolean }) {\n const [query, setQuery] = React.useState(\"\");\n const [filterOpen, setFilterOpen] = React.useState(false);\n const [sidebarCollapsed, setSidebarCollapsed] = React.useState(false);\n\n const filtered = templates.filter(\n (t) =>\n !query ||\n t.name.toLowerCase().includes(query.toLowerCase()) ||\n (t.description ?? \"\").toLowerCase().includes(query.toLowerCase()),\n );\n\n const sidebar = (\n <MosaicFilterSidebar\n isCollapsed={sidebarCollapsed}\n onToggleCollapse={() => setSidebarCollapsed((v) => !v)}\n filters={filters}\n selectedFilter={selectedFilter}\n onFilterChange={\n isMobile\n ? (id) => {\n onFilterChange(id);\n setFilterOpen(false);\n }\n : onFilterChange\n }\n categories={categories}\n selectedCategory={selectedCategory}\n onCategoryChange={\n isMobile\n ? (id) => {\n onCategoryChange(id);\n setFilterOpen(false);\n }\n : onCategoryChange\n }\n title={filtersTitle}\n expandFiltersAriaLabel={expandFiltersAriaLabel}\n categoriesHeading={categoriesHeading}\n collapseSidebarAriaLabel={collapseSidebarAriaLabel}\n expandSidebarAriaLabel={expandSidebarAriaLabel}\n />\n );\n\n if (isMobile) {\n return (\n <div data-slot=\"template-gallery\" className=\"flex flex-col\">\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 <button\n type=\"button\"\n onClick={() => setFilterOpen(true)}\n className=\"inline-flex h-9 w-9 items-center justify-center rounded-md border border-border bg-background text-foreground hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n aria-label={openFiltersAriaLabel}\n >\n <FilterIcon />\n </button>\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 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n )}\n />\n </div>\n </div>\n <div className=\"space-y-3 p-4\">\n {filtered.map((template) => (\n <MosaicTemplateCard\n key={template.id}\n template={template}\n isSelected={selectedTemplate?.id === template.id}\n onSelect={onSelectTemplate}\n onPreview={onPreviewTemplate}\n onDuplicate={onDuplicateTemplate}\n showActions={showActions}\n previewLabel={previewLabel}\n duplicateLabel={duplicateLabel}\n formatAgentCount={formatAgentCount}\n formatUsageCount={formatUsageCount}\n compact\n />\n ))}\n {filtered.length === 0 && (\n <p className=\"py-10 text-center text-sm text-muted-foreground\">{emptyMessage}</p>\n )}\n </div>\n <MosaicAdaptiveModal\n isOpen={filterOpen}\n onClose={() => setFilterOpen(false)}\n title={filtersTitle}\n closeAriaLabel={closeFiltersAriaLabel}\n >\n <div className=\"p-4\">{sidebar}</div>\n </MosaicAdaptiveModal>\n </div>\n );\n }\n\n return (\n <div data-slot=\"template-gallery\" className=\"flex h-full flex-col\">\n <div className=\"border-b border-border px-6 py-4\">\n <h1 className=\"text-lg font-semibold\">{title}</h1>\n </div>\n <div className=\"flex flex-1 min-h-0\">\n {sidebar}\n <div className=\"flex flex-1 flex-col min-w-0\">\n <div className=\"border-b border-border px-6 py-4\">\n <div className=\"relative 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 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n )}\n />\n </div>\n </div>\n <div className=\"flex-1 overflow-y-auto p-6\">\n <div className=\"grid gap-4 grid-cols-1 md:grid-cols-2 lg:grid-cols-3\">\n {filtered.map((template) => (\n <MosaicTemplateCard\n key={template.id}\n template={template}\n isSelected={selectedTemplate?.id === template.id}\n onSelect={onSelectTemplate}\n onPreview={onPreviewTemplate}\n onDuplicate={onDuplicateTemplate}\n showActions={showActions}\n previewLabel={previewLabel}\n duplicateLabel={duplicateLabel}\n formatAgentCount={formatAgentCount}\n formatUsageCount={formatUsageCount}\n />\n ))}\n </div>\n {filtered.length === 0 && (\n <p className=\"py-12 text-center text-sm text-muted-foreground\">{emptyMessage}</p>\n )}\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nexport function MosaicTemplateGallery(props: MosaicTemplateGalleryProps) {\n const { isMobile } = useDevice();\n return <TemplateGalleryContent {...props} isMobile={isMobile} />;\n}\n\nMosaicTemplateGallery.displayName = \"MosaicTemplateGallery\";\n"
17
+ }
18
+ ],
19
+ "type": "registry:ui"
20
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-template-list",
4
+ "title": "MosaicTemplateList",
5
+ "description": "MosaicTemplateList β€” presentational, disposition-only list of host items",
6
+ "dependencies": [],
7
+ "registryDependencies": [],
8
+ "files": [
9
+ {
10
+ "path": "src/components/template-list/MosaicTemplateList.tsx",
11
+ "type": "registry:ui",
12
+ "content": "/**\n * MosaicTemplateList β€” presentational, disposition-only list of host items\n *\n * Ported from any-debate-ai's five scattered template-listing variants\n * (components/templates/TemplateGallery.tsx β€” grid/list toggle,\n * components/templates/template-list.tsx β€” responsive-pair orchestrator,\n * components/templates/desktop/TemplateListDesktop.tsx,\n * components/templates/mobile/TemplateListMobile.tsx,\n * components/templates/QuickStartPanel.tsx β€” quick-start responsive-pair).\n *\n * MERGED: the common shape across all five is \"a disposition (grid or\n * single-column list) over an array of items, each one rendered as some kind\n * of card, with an empty state when the array is empty\". That shape β€” and\n * ONLY that shape β€” is what ships here.\n *\n * LEFT BEHIND (host-specific, NOT ported):\n * - Search input, category chips, sort mode, filter sidebar (TemplateGallery,\n * template-list.tsx): the host composes its own search/filter UI and\n * passes the ALREADY-FILTERED `items` array in. A list should not own\n * filtering state.\n * - The two-pane \"list + preview\" desktop layout (TemplateListDesktop /\n * TemplatePreviewDesktop): that is a split-pane composition concern\n * (`MosaicResizableSplitPane` already exists for that), not a list concern.\n * - Any per-card content: title, description, category badge, agent count,\n * usage count, favorite star, \"use template\" action (TemplateCard,\n * TemplateGalleryCard, TemplateCardDesktop, TemplateCardCompact,\n * AgentTeamPreview, QuickStart scenario/preset cards). The card shape\n * differs across all five sources and is exactly the kind of business\n * content a list must NOT hardcode β€” the host supplies it via\n * `renderItem`, exactly like `MosaicChatThread` takes message rendering\n * as `children` rather than rendering `MosaicChatMessage` itself.\n * - framer-motion stagger-in animation (TemplateListDesktop /\n * TemplateListMobile): decorative entrance motion is a host concern, not\n * part of the disposition contract.\n * - Mock template data, DebateTemplate / QuickStartScenario / AgentTeamPreset\n * types: business shapes belong to the consuming app, never to a\n * library-level UI atom (SIN-01 + no-hardcoded-business-knowledge).\n *\n * Disposition (grid vs. single-column list) is exposed as a `layout` cva\n * variant (`template-list-variants.ts`) β€” switching it changes ONLY the\n * container's Tailwind classes, never the props contract.\n *\n * Keyboard: roving tabindex across items (native `<ul>` / `<li>` β€” semantic\n * list roles come from the elements themselves, no explicit `role` needed)\n * β€” ArrowRight/ArrowDown moves focus to the next item, ArrowLeft/ArrowUp to\n * the previous, Home/End jump to the first/last. Exactly one item is\n * `tabIndex={0}` at a time; the rest are `tabIndex={-1}` β€” the browser's\n * native Tab key steps over the whole list in one stop, then arrow keys\n * navigate within it.\n *\n * Empty state: the host owns the empty message (`emptyMessage`, required,\n * no default β€” SIN-01) β€” never an invented English fallback and never a\n * silent blank.\n */\n\nimport type * as React from \"react\";\nimport { useRef, useState } from \"react\";\nimport { templateListVariants } from \"./template-list-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 MosaicTemplateListProps<T extends { id: string }> {\n /** The items to lay out. The list never inspects their shape beyond `id`. */\n items: T[];\n /** Host-owned renderer for a single item β€” the list owns disposition only. */\n renderItem: (item: T, index: number) => React.ReactNode;\n /** Disposition: grid (responsive columns) or single-column list. Default \"grid\". */\n layout?: \"grid\" | \"list\";\n /**\n * Message shown when `items` is empty. Required, no default β€” the host\n * owns the language (e.g. `t('TemplateList.empty')`).\n */\n emptyMessage: string;\n /** Additional Tailwind classes on the root container. */\n className?: string;\n /** Additional Tailwind classes on each item wrapper. */\n itemClassName?: string;\n /** React 19 ref prop β€” forwarded to the root container. */\n ref?: React.Ref<HTMLDivElement | HTMLUListElement>;\n}\n\n// ── Keyboard navigation ───────────────────────────────────────────────────────\n\nconst NEXT_KEYS = new Set([\"ArrowRight\", \"ArrowDown\"]);\nconst PREV_KEYS = new Set([\"ArrowLeft\", \"ArrowUp\"]);\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\n/**\n * MosaicTemplateList β€” production disposition-only list atom for\n * @vantageos/mosaic-blocks.\n *\n * Purely presentational: no filtering, no sorting, no item rendering β€” the\n * host owns the item content via `renderItem`; this component only owns the\n * grid/list layout and keyboard roving-tabindex navigation.\n */\nexport function MosaicTemplateList<T extends { id: string }>({\n items,\n renderItem,\n layout = \"grid\",\n emptyMessage,\n className,\n itemClassName,\n ref,\n}: MosaicTemplateListProps<T>) {\n const itemRefs = useRef<Array<HTMLLIElement | null>>([]);\n const [focusedIndex, setFocusedIndex] = useState(0);\n\n function focusItem(index: number) {\n if (items.length === 0) {\n return;\n }\n const clamped = Math.max(0, Math.min(items.length - 1, index));\n setFocusedIndex(clamped);\n itemRefs.current[clamped]?.focus();\n }\n\n function handleKeyDown(event: React.KeyboardEvent<HTMLLIElement>, index: number) {\n if (NEXT_KEYS.has(event.key)) {\n event.preventDefault();\n focusItem(index + 1);\n } else if (PREV_KEYS.has(event.key)) {\n event.preventDefault();\n focusItem(index - 1);\n } else if (event.key === \"Home\") {\n event.preventDefault();\n focusItem(0);\n } else if (event.key === \"End\") {\n event.preventDefault();\n focusItem(items.length - 1);\n }\n }\n\n if (items.length === 0) {\n return (\n <div\n ref={ref as React.Ref<HTMLDivElement> | undefined}\n data-slot=\"template-list\"\n className={cn(templateListVariants({ layout }), className)}\n >\n <p\n data-slot=\"template-list-empty\"\n className=\"col-span-full py-12 text-center text-sm text-muted-foreground\"\n >\n {emptyMessage}\n </p>\n </div>\n );\n }\n\n return (\n <ul\n ref={ref as React.Ref<HTMLUListElement> | undefined}\n data-slot=\"template-list\"\n className={cn(\"list-none\", templateListVariants({ layout }), className)}\n >\n {items.map((item, index) => (\n <li\n key={item.id}\n ref={(node) => {\n itemRefs.current[index] = node;\n }}\n data-slot=\"template-list-item\"\n tabIndex={index === focusedIndex ? 0 : -1}\n onKeyDown={(event) => handleKeyDown(event, index)}\n onFocus={() => setFocusedIndex(index)}\n className={itemClassName}\n >\n {renderItem(item, index)}\n </li>\n ))}\n </ul>\n );\n}\n\nMosaicTemplateList.displayName = \"MosaicTemplateList\";\n"
13
+ },
14
+ {
15
+ "path": "src/components/template-list/template-list-variants.ts",
16
+ "type": "registry:ui",
17
+ "content": "/**\n * templateListVariants β€” pure CVA variant function for MosaicTemplateList.\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\n/**\n * Root container layout β€” owns disposition ONLY (grid vs. single-column\n * list). The list never owns item content; item markup is entirely\n * host-supplied via `renderItem`.\n */\nexport const templateListVariants = cva([\"grid gap-4\"], {\n variants: {\n layout: {\n grid: \"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3\",\n list: \"grid-cols-1\",\n },\n },\n defaultVariants: {\n layout: \"grid\",\n },\n});\n"
18
+ }
19
+ ],
20
+ "type": "registry:ui"
21
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-template-management-panel",
4
+ "title": "MosaicTemplateManagementPanel",
5
+ "description": "MosaicTemplateManagementPanel β€” manage a host-supplied list of saved agent templates: rename, duplicate, delete.",
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-dropdown-menu.json",
10
+ "https://cdn.jsdelivr.net/npm/@vantageos/mosaic-blocks@0.5.36-alpha/r/mosaic-input.json"
11
+ ],
12
+ "files": [
13
+ {
14
+ "path": "src/components/template-management-panel/MosaicTemplateManagementPanel.tsx",
15
+ "type": "registry:ui",
16
+ "content": "\"use client\";\n\n/**\n * MosaicTemplateManagementPanel β€” manage a host-supplied list of saved\n * agent templates: rename, duplicate, delete.\n *\n * Presentational + interaction-owning atom. The template DATA (id, name)\n * belongs entirely to the host β€” this component never fetches, filters, or\n * invents a template. All three mutating actions (rename / duplicate /\n * delete) are callbacks up: the host decides what happens next (persist,\n * confirm, optimistic-update, etc.). Duplicate and Delete fire immediately\n * on selection β€” pairing Delete with a confirmation step (e.g.\n * MosaicDeleteConfirmationDialog) is a host-composition concern, not\n * something this panel assumes.\n *\n * Rename is the one action with local interaction state: selecting \"Rename\"\n * switches that row into an edit mode (a controlled text input pre-filled\n * with the current name) with Save/Cancel. Save calls\n * `onRename(id, trimmedValue)`; Cancel discards the local edit and\n * calls nothing.\n *\n * Every user-facing string is a required prop with no default β€” this\n * library carries zero words (SIN-01), bilingual FR+EN by design.\n * `actionsAriaLabelFor` is a required function prop so the host can compose\n * a localized \"Actions for {name}\" string per row without the component\n * ever concatenating language itself.\n *\n * data-slot=\"template-management-panel\" on the root, data-slot=\n * \"template-management-row\" on each row (scopes row-local queries and keeps\n * per-row menus from resolving by name collision when two templates share a\n * name).\n *\n * Deps: @base-ui/react (via MosaicButton, MosaicInput, MosaicDropdownMenu) +\n * class-variance-authority only.\n */\n\nimport * as React from \"react\";\nimport { MosaicButton } from \"@/components/ui/Button\";\nimport { MosaicDropdownMenu } from \"@/components/ui/MosaicDropdownMenu\";\nimport type { MosaicDropdownMenuItem } from \"@/components/ui/MosaicDropdownMenu\";\nimport { MosaicInput } from \"@/components/ui/MosaicInput\";\nimport { templateManagementRowVariants } from \"./template-management-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\nexport interface MosaicTemplateManagementItem {\n /** Stable identifier, forwarded verbatim to every callback. */\n id: string;\n /** Host-owned template name β€” pure data, never invented by this component. */\n name: string;\n}\n\nexport interface MosaicTemplateManagementPanelProps {\n /** Host-supplied templates. Pure data β€” never fetched or filtered here. */\n templates: MosaicTemplateManagementItem[];\n /** Panel heading. Required, no default. */\n heading: string;\n /** Message shown when `templates` is empty. Required, no default. */\n emptyMessage: string;\n /** Row action-menu item label for the rename action. Required, no default. */\n renameLabel: string;\n /** Row action-menu item label for the duplicate action. Required, no default. */\n duplicateLabel: string;\n /** Row action-menu item label for the delete action. Required, no default. */\n deleteLabel: string;\n /** Label for the confirm button while a row is in rename mode. Required, no default. */\n saveLabel: string;\n /** Label for the discard button while a row is in rename mode. Required, no default. */\n cancelLabel: string;\n /** aria-label for the rename text input. Required, no default. */\n renameInputAriaLabel: string;\n /**\n * Derives the aria-label for a row's action-menu trigger from that row's\n * current name (e.g. `(name) => \\`Actions for ${name}\\``). Required β€” the\n * host owns the language, this component never concatenates copy itself.\n */\n actionsAriaLabelFor: (name: string) => string;\n /** Called with (id, trimmedNewName) when a rename is saved. */\n onRename: (id: string, newName: string) => void;\n /** Called with the template id when Duplicate is selected. */\n onDuplicate: (id: string) => void;\n /** Called with the template id when Delete is selected. */\n onDelete: (id: string) => void;\n className?: string;\n}\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\n/**\n * MosaicTemplateManagementPanel β€” production template-management panel for\n * @vantageos/mosaic-blocks.\n *\n * @example\n * <MosaicTemplateManagementPanel\n * templates={templates}\n * heading=\"Saved templates\"\n * emptyMessage=\"No saved templates yet.\"\n * renameLabel=\"Rename\" duplicateLabel=\"Duplicate\" deleteLabel=\"Delete\"\n * saveLabel=\"Save\" cancelLabel=\"Cancel\"\n * renameInputAriaLabel=\"Template name\"\n * actionsAriaLabelFor={(name) => `Actions for ${name}`}\n * onRename={(id, name) => renameTemplate(id, name)}\n * onDuplicate={(id) => duplicateTemplate(id)}\n * onDelete={(id) => deleteTemplate(id)}\n * />\n */\nexport function MosaicTemplateManagementPanel({\n templates,\n heading,\n emptyMessage,\n renameLabel,\n duplicateLabel,\n deleteLabel,\n saveLabel,\n cancelLabel,\n renameInputAriaLabel,\n actionsAriaLabelFor,\n onRename,\n onDuplicate,\n onDelete,\n className,\n}: MosaicTemplateManagementPanelProps) {\n const [renamingId, setRenamingId] = React.useState<string | null>(null);\n const [draftName, setDraftName] = React.useState(\"\");\n\n const startRename = (item: MosaicTemplateManagementItem) => {\n setRenamingId(item.id);\n setDraftName(item.name);\n };\n\n const cancelRename = () => {\n setRenamingId(null);\n setDraftName(\"\");\n };\n\n const saveRename = (id: string) => {\n const trimmed = draftName.trim();\n if (trimmed.length > 0) {\n onRename(id, trimmed);\n }\n setRenamingId(null);\n setDraftName(\"\");\n };\n\n const menuItems: MosaicDropdownMenuItem[] = [\n { id: \"rename\", label: renameLabel },\n { id: \"duplicate\", label: duplicateLabel },\n { id: \"delete\", label: deleteLabel, separator: true },\n ];\n\n const handleItemSelect = (item: MosaicTemplateManagementItem, actionId: string) => {\n if (actionId === \"rename\") {\n startRename(item);\n } else if (actionId === \"duplicate\") {\n onDuplicate(item.id);\n } else if (actionId === \"delete\") {\n onDelete(item.id);\n }\n };\n\n return (\n <div\n data-slot=\"template-management-panel\"\n className={cn(\"flex flex-col rounded-lg border border-border bg-background\", className)}\n >\n <h2 className=\"border-b border-border px-4 py-3 font-semibold text-foreground text-sm\">\n {heading}\n </h2>\n\n {templates.length === 0 ? (\n <p className=\"px-4 py-6 text-center text-muted-foreground text-sm\">{emptyMessage}</p>\n ) : (\n <ul>\n {templates.map((item) => {\n const isRenaming = renamingId === item.id;\n return (\n <li\n key={item.id}\n data-slot=\"template-management-row\"\n className={templateManagementRowVariants()}\n >\n {isRenaming ? (\n <div className=\"flex flex-1 items-center gap-2\">\n <MosaicInput\n aria-label={renameInputAriaLabel}\n value={draftName}\n onChange={(event) => setDraftName(event.target.value)}\n className=\"flex-1\"\n />\n <MosaicButton type=\"button\" size=\"sm\" onClick={() => saveRename(item.id)}>\n {saveLabel}\n </MosaicButton>\n <MosaicButton type=\"button\" variant=\"outline\" size=\"sm\" onClick={cancelRename}>\n {cancelLabel}\n </MosaicButton>\n </div>\n ) : (\n <>\n <span className=\"truncate text-foreground text-sm\">{item.name}</span>\n <MosaicDropdownMenu\n trigger={\n <button\n type=\"button\"\n aria-label={actionsAriaLabelFor(item.name)}\n className={cn(\n \"flex size-8 items-center justify-center rounded-md\",\n \"text-muted-foreground hover:bg-muted hover:text-foreground\",\n )}\n >\n <DotsIcon />\n </button>\n }\n items={menuItems}\n onItemSelect={(actionId) => handleItemSelect(item, actionId)}\n />\n </>\n )}\n </li>\n );\n })}\n </ul>\n )}\n </div>\n );\n}\n\nMosaicTemplateManagementPanel.displayName = \"MosaicTemplateManagementPanel\";\n\n// ── Inline icon ───────────────────────────────────────────────────────────────\n\nfunction DotsIcon() {\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=\"currentColor\"\n aria-hidden=\"true\"\n >\n <circle cx=\"12\" cy=\"5\" r=\"1.5\" />\n <circle cx=\"12\" cy=\"12\" r=\"1.5\" />\n <circle cx=\"12\" cy=\"19\" r=\"1.5\" />\n </svg>\n );\n}\n"
17
+ },
18
+ {
19
+ "path": "src/components/template-management-panel/template-management-panel-variants.ts",
20
+ "type": "registry:ui",
21
+ "content": "import { cva } from \"class-variance-authority\";\n\nexport const templateManagementRowVariants = cva(\n \"flex items-center justify-between gap-3 border-b border-border px-4 py-3 last:border-b-0\",\n);\n"
22
+ }
23
+ ],
24
+ "type": "registry:ui"
25
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-testimonials-grid",
4
+ "title": "MosaicTestimonialsGrid",
5
+ "description": "Masonry-style testimonials grid: featured item spans half width, rest stack. Props: testimonials[] {id, quote, author, role, avatar?, logo?}, heading.",
6
+ "dependencies": [],
7
+ "registryDependencies": [],
8
+ "files": [
9
+ {
10
+ "path": "src/components/testimonials-grid/MosaicTestimonialsGrid.tsx",
11
+ "type": "registry:ui",
12
+ "content": "/**\n * MosaicTestimonialsGrid β€” testimonials masonry-style grid\n *\n * Ported from heyfabrika/styleui blocks/testimonial/testimonial.tsx (MIT).\n * Adapted: fully props-driven testimonials array. No shadcn Card/Avatar.\n * Layout: 6-col grid (featured first item spans 3, rest stack 3+3).\n * Falls back to uniform 2-col for 2 items, 3-col for 3+.\n */\n\nimport type * as React from \"react\";\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\nexport interface TestimonialItem {\n /** Stable unique identifier */\n id: string;\n /** Quote text */\n quote: string;\n /** Author full name */\n author: string;\n /** Author role / title */\n role: string;\n /** Optional avatar src */\n avatar?: string;\n /** Optional company/brand logo src */\n logo?: string;\n}\n\nexport interface MosaicTestimonialsGridProps {\n /** Testimonials to render */\n testimonials: TestimonialItem[];\n /** Optional section heading */\n heading?: React.ReactNode;\n className?: string;\n ref?: React.Ref<HTMLElement>;\n}\n\n// ── Utility ──────────────────────────────────────────────────────────────────\n\nfunction cn(...classes: (string | undefined | null | false)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n\nfunction getInitials(name: string): string {\n return name\n .split(\" \")\n .map((n) => n[0])\n .slice(0, 2)\n .join(\"\")\n .toUpperCase();\n}\n\n// ── Sub-component ─────────────────────────────────────────────────────────────\n\ninterface TestimonialCardProps {\n item: TestimonialItem;\n featured?: boolean;\n}\n\nfunction TestimonialCard({ item, featured = false }: TestimonialCardProps) {\n return (\n <article\n className={cn(\n \"flex flex-col gap-4 rounded-xl border border-[oklch(0.9_0.005_250)] bg-[oklch(1_0_0)] p-6\",\n featured && \"h-full\",\n )}\n >\n {item.logo && (\n <img\n src={item.logo}\n alt={`${item.author} company logo`}\n width={100}\n height={32}\n className=\"h-8 w-auto object-contain grayscale\"\n />\n )}\n <blockquote className=\"flex-1 text-base leading-relaxed text-[oklch(0.2_0.01_250)]\">\n <p>{item.quote}</p>\n </blockquote>\n <footer className=\"flex items-center gap-3\">\n {item.avatar ? (\n <img\n src={item.avatar}\n alt={item.author}\n width={40}\n height={40}\n className=\"size-10 rounded-full object-cover\"\n />\n ) : (\n <div\n aria-hidden=\"true\"\n className=\"flex size-10 shrink-0 items-center justify-center rounded-full bg-[oklch(0.92_0.02_250)] text-xs font-semibold text-[oklch(0.3_0.02_250)]\"\n >\n {getInitials(item.author)}\n </div>\n )}\n <div className=\"flex flex-col\">\n <span className=\"text-sm font-medium text-[oklch(0.15_0.01_250)]\">{item.author}</span>\n <span className=\"text-xs text-[oklch(0.5_0.01_250)]\">{item.role}</span>\n </div>\n </footer>\n </article>\n );\n}\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\n/**\n * MosaicTestimonialsGrid β€” masonry-style testimonial grid.\n * First item spans full-width on mobile, half on md; rest fill remaining slots.\n *\n * @example\n * <MosaicTestimonialsGrid\n * heading=\"What our customers say\"\n * testimonials={[\n * { id: \"t1\", quote: \"...\", author: \"Alice\", role: \"CTO\", avatar: \"/a.jpg\" },\n * { id: \"t2\", quote: \"...\", author: \"Bob\", role: \"Designer\" },\n * ]}\n * />\n */\nexport function MosaicTestimonialsGrid({\n testimonials,\n heading,\n className,\n ref,\n}: MosaicTestimonialsGridProps) {\n const [featured, ...rest] = testimonials;\n\n return (\n <section ref={ref} className={cn(\"px-4 py-16 mx-auto max-w-6xl\", className)}>\n {heading && (\n <div className=\"mb-12 text-center\">\n <h2 className=\"text-2xl font-normal tracking-tight text-[oklch(0.12_0.01_250)] md:text-4xl\">\n {heading}\n </h2>\n </div>\n )}\n\n {testimonials.length === 0 ? null : testimonials.length === 1 ? (\n <TestimonialCard item={featured} />\n ) : (\n <div className=\"grid grid-cols-1 gap-6 md:grid-cols-6\">\n {/* Featured β€” spans 3 cols on md */}\n <div className=\"md:col-span-3 h-full\">\n <TestimonialCard item={featured} featured />\n </div>\n\n {/* Rest β€” stacked in 3-col right side */}\n <div className=\"md:col-span-3 flex flex-col gap-6\">\n {rest.map((item) => (\n <TestimonialCard key={item.id} item={item} />\n ))}\n </div>\n </div>\n )}\n </section>\n );\n}\n\nMosaicTestimonialsGrid.displayName = \"MosaicTestimonialsGrid\";\n"
13
+ }
14
+ ],
15
+ "type": "registry:ui"
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-textarea",
4
+ "title": "MosaicTextarea",
5
+ "description": "MosaicTextarea β€” native <textarea> styled atom",
6
+ "dependencies": [],
7
+ "registryDependencies": [],
8
+ "files": [
9
+ {
10
+ "path": "src/components/textarea/MosaicTextarea.tsx",
11
+ "type": "registry:ui",
12
+ "content": "/**\n * MosaicTextarea β€” native <textarea> styled atom\n *\n * No @base-ui/react primitive for textarea β€” uses the native HTML element.\n * Consistent token vocabulary with MosaicInput.\n *\n * data-slot=\"textarea\" on the rendered <textarea>.\n * Styling: Tailwind v4 semantic tokens only.\n */\n\nimport type * as React from \"react\";\n\n// ── Utility ──────────────────────────────────────────────────────────────────\n\nfunction cn(...classes: (string | undefined | null | false)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n\n// ── Props ─────────────────────────────────────────────────────────────────────\n\nexport interface MosaicTextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {\n className?: string;\n ref?: React.Ref<HTMLTextAreaElement>;\n}\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\n/**\n * MosaicTextarea β€” production Textarea atom for @vantageos/mosaic-blocks.\n *\n * Styled native <textarea>. Matches MosaicInput visual vocabulary.\n * Resize: vertical only by default.\n *\n * @example\n * <MosaicTextarea placeholder=\"Describe your idea…\" rows={4} />\n * <MosaicTextarea disabled value=\"Read-only text\" readOnly />\n */\nexport function MosaicTextarea({ className, ref, ...props }: MosaicTextareaProps) {\n return (\n <textarea\n ref={ref}\n data-slot=\"textarea\"\n className={cn(\n \"flex min-h-[80px] w-full resize-y\",\n \"rounded-md border border-border bg-background px-3 py-2\",\n \"text-sm text-foreground shadow-xs\",\n \"placeholder:text-muted-foreground\",\n \"outline-none transition-colors\",\n \"focus-visible:ring-ring focus-visible:ring-[3px]\",\n \"disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n />\n );\n}\n\nMosaicTextarea.displayName = \"MosaicTextarea\";\n"
13
+ }
14
+ ],
15
+ "type": "registry:ui"
16
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-theme-provider",
4
+ "title": "MosaicThemeProvider",
5
+ "description": "Thin next-themes ThemeProvider wrapper. Generic, zero branding. All ThemeProviderProps forwarded.",
6
+ "dependencies": [
7
+ "next-themes"
8
+ ],
9
+ "registryDependencies": [],
10
+ "files": [
11
+ {
12
+ "path": "src/components/theme-provider/MosaicThemeProvider.tsx",
13
+ "type": "registry:ui",
14
+ "content": "\"use client\";\n\n/**\n * MosaicThemeProvider β€” next-themes wrapper (generic)\n *\n * Ported from components/theme-provider.tsx\n *\n * Thin wrapper that accepts next-themes ThemeProvider as a peer dependency.\n * Consumers who use next-themes can pass it directly; otherwise falls back to\n * a plain div wrapper for SSR compatibility.\n *\n * This avoids a hard dep on next-themes in mosaic-blocks itself.\n */\n\nimport type * as React from \"react\";\n\nexport interface MosaicThemeProviderProps {\n children: React.ReactNode;\n /** next-themes ThemeProvider component β€” injected by caller */\n provider?: React.ComponentType<{ children: React.ReactNode; [key: string]: unknown }>;\n attribute?: string;\n defaultTheme?: string;\n enableSystem?: boolean;\n disableTransitionOnChange?: boolean;\n storageKey?: string;\n themes?: string[];\n forcedTheme?: string;\n [key: string]: unknown;\n}\n\n/**\n * MosaicThemeProvider β€” wraps children with a theme provider.\n *\n * Pass `provider` = ThemeProvider from \"next-themes\" (or any compatible\n * theme provider) to enable full theme switching. If omitted, renders\n * children directly (no theme context).\n *\n * @example\n * import { ThemeProvider } from \"next-themes\"\n * <MosaicThemeProvider provider={ThemeProvider} attribute=\"class\" defaultTheme=\"system\" enableSystem>\n * {children}\n * </MosaicThemeProvider>\n */\nexport function MosaicThemeProvider({\n children,\n provider: Provider,\n ...props\n}: MosaicThemeProviderProps) {\n if (Provider) {\n return (\n <Provider {...props}>\n <div data-slot=\"theme-provider\">{children}</div>\n </Provider>\n );\n }\n\n return <div data-slot=\"theme-provider\">{children}</div>;\n}\n\nMosaicThemeProvider.displayName = \"MosaicThemeProvider\";\n"
15
+ }
16
+ ],
17
+ "type": "registry:ui"
18
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-theme-toggle",
4
+ "title": "MosaicThemeToggle",
5
+ "description": "Light/dark/system theme toggle. Flips data-theme on document.documentElement. Props: themes?, onChange?, label?. Theme-reactive via OKLCH CSS vars.",
6
+ "dependencies": [],
7
+ "registryDependencies": [],
8
+ "files": [
9
+ {
10
+ "path": "src/components/theme-toggle/MosaicThemeToggle.tsx",
11
+ "type": "registry:ui",
12
+ "content": "\"use client\";\n\n/**\n * MosaicThemeToggle β€” light / dark / system theme toggle\n *\n * Ported from heyfabrika/styleui components/theme-toggle (MIT).\n * Flips `data-theme` attribute on document.documentElement.\n * Theme-reactive: reads current state from DOM on mount.\n * No hardcoded branding β€” icon is a pure SVG, all color via theme tokens\n * (Tailwind utilities wired from @vantageos/mosaic-tokens / mosaic-blocks\n * styles.css) β€” never an inline literal OKLCH value.\n *\n * Earlier defect fixed here: the previous build used an arbitrary\n * `bg-[oklch(var(--mosaic-surface,1_0_0))]` value. `--mosaic-surface` (bare,\n * no suffix) is not a real token anywhere in this package β€” the fallback\n * `1 0 0` (solid white) always won, so the button rendered a white disc in\n * BOTH themes, and its `currentColor` icon (white foreground in dark mode)\n * disappeared into it. Fixed by using the real wired tokens: `bg-secondary`\n * (a neutral/ghost surface, distinct in both modes) + `text-foreground`\n * (explicit icon colour) + `hover:bg-accent` for the ghost hover state.\n */\n\nimport * as React from \"react\";\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\nexport type Theme = \"light\" | \"dark\" | \"system\";\n\nexport interface MosaicThemeToggleProps {\n /**\n * Ordered list of theme values to cycle through.\n * Default: [\"light\", \"dark\"]\n */\n themes?: Theme[];\n /** Called with the new theme string after each toggle */\n onChange?: (theme: Theme) => void;\n className?: string;\n /** aria-label override for the toggle button (takes precedence over the dynamic labels below). */\n label?: string;\n /** aria-label when toggling would switch to light theme. Required, no default. */\n switchToLightLabel: string;\n /** aria-label when toggling would switch to dark theme. Required, no default. */\n switchToDarkLabel: string;\n ref?: React.Ref<HTMLButtonElement>;\n}\n\n// ── Helpers ───────────────────────────────────────────────────────────────────\n\nfunction cn(...classes: (string | undefined | null | false)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n\nfunction getSystemTheme(): \"light\" | \"dark\" {\n if (typeof window === \"undefined\") return \"light\";\n return window.matchMedia(\"(prefers-color-scheme: dark)\").matches ? \"dark\" : \"light\";\n}\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\n/**\n * MosaicThemeToggle β€” cycles through themes, setting `data-theme` on\n * document.documentElement. Works with any OKLCH-var-based CSS theme.\n *\n * @example\n * <MosaicThemeToggle onChange={(t) => console.log(\"theme:\", t)} />\n */\nexport function MosaicThemeToggle({\n themes = [\"light\", \"dark\"],\n onChange,\n className,\n label,\n switchToLightLabel,\n switchToDarkLabel,\n ref,\n}: MosaicThemeToggleProps) {\n const [theme, setTheme] = React.useState<Theme>(() => {\n // SSR-safe: read from DOM if available, else default to first theme\n if (typeof document === \"undefined\") return themes[0];\n const current = document.documentElement.getAttribute(\"data-theme\") as Theme | null;\n return current && themes.includes(current) ? current : themes[0];\n });\n\n const applyTheme = React.useCallback(\n (next: Theme) => {\n const resolved = next === \"system\" ? getSystemTheme() : next;\n document.documentElement.setAttribute(\"data-theme\", resolved);\n setTheme(next);\n onChange?.(next);\n },\n [onChange],\n );\n\n const handleToggle = () => {\n const idx = themes.indexOf(theme);\n const next = themes[(idx + 1) % themes.length];\n applyTheme(next);\n };\n\n const isDark =\n theme === \"dark\" ||\n (theme === \"system\" && typeof window !== \"undefined\" && getSystemTheme() === \"dark\");\n\n const ariaLabel = label ?? (isDark ? switchToLightLabel : switchToDarkLabel);\n\n return (\n <button\n ref={ref}\n type=\"button\"\n aria-label={ariaLabel}\n aria-pressed={isDark}\n onClick={handleToggle}\n className={cn(\n \"inline-flex size-9 items-center justify-center rounded-full border border-border\",\n \"bg-secondary text-foreground transition-colors hover:bg-accent\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n className,\n )}\n >\n {/* Sun icon β€” shown in dark mode */}\n {isDark ? (\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=\"12\" cy=\"12\" r=\"4\" />\n <path d=\"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41\" />\n </svg>\n ) : (\n /* Moon icon β€” shown in light mode */\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 <path d=\"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z\" />\n </svg>\n )}\n </button>\n );\n}\n\nMosaicThemeToggle.displayName = \"MosaicThemeToggle\";\n"
13
+ }
14
+ ],
15
+ "type": "registry:ui"
16
+ }