@vantageos/mosaic-blocks 0.5.35-alpha → 0.5.37-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 (150) hide show
  1. package/README.md +11 -8
  2. package/dist/index.cjs +828 -40
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +415 -11
  5. package/dist/index.d.ts +415 -11
  6. package/dist/index.js +809 -41
  7. package/dist/index.js.map +1 -1
  8. package/dist/styles.css +18 -0
  9. package/package.json +20 -7
  10. package/r/mosaic-accordion.json +1 -2
  11. package/r/mosaic-activity-feed.json +16 -0
  12. package/r/mosaic-adaptive-grid.json +18 -0
  13. package/r/mosaic-adaptive-modal.json +18 -0
  14. package/r/mosaic-adaptive-navigation.json +18 -0
  15. package/r/mosaic-add-memory-form.json +25 -0
  16. package/r/mosaic-admin-only-guard.json +18 -0
  17. package/r/mosaic-agent-builder-modal.json +23 -0
  18. package/r/mosaic-agent-card.json +16 -0
  19. package/r/mosaic-agent-chat.json +26 -0
  20. package/r/mosaic-agent-composer.json +28 -0
  21. package/r/mosaic-agent-editor.json +25 -0
  22. package/r/mosaic-agent-list.json +21 -0
  23. package/r/mosaic-agent-preview.json +21 -0
  24. package/r/mosaic-alert-dialog.json +23 -0
  25. package/r/mosaic-animated-list.json +16 -0
  26. package/r/mosaic-api-key-panel.json +21 -0
  27. package/r/mosaic-app-sidebar.json +18 -0
  28. package/r/mosaic-approval-prompt.json +21 -0
  29. package/r/mosaic-artifact-canvas-adapter.json +26 -0
  30. package/r/mosaic-artifact-chart.json +18 -0
  31. package/r/mosaic-artifact-checklist.json +18 -0
  32. package/r/mosaic-artifact-data-table.json +18 -0
  33. package/r/mosaic-artifact-document.json +16 -0
  34. package/r/mosaic-artifact-library.json +18 -0
  35. package/r/mosaic-artifact-save-as-memory-form.json +24 -0
  36. package/r/mosaic-artifact-version-history.json +16 -0
  37. package/r/mosaic-avatar.json +18 -0
  38. package/r/mosaic-badge.json +23 -0
  39. package/r/mosaic-blurred-orb.json +16 -0
  40. package/r/mosaic-button.json +24 -0
  41. package/r/mosaic-callout.json +23 -0
  42. package/r/mosaic-card.json +16 -0
  43. package/r/mosaic-chat-composer.json +21 -0
  44. package/r/mosaic-chat-message.json +23 -0
  45. package/r/mosaic-chat-sidebar.json +21 -0
  46. package/r/mosaic-chat-thread.json +21 -0
  47. package/r/mosaic-checkbox.json +18 -0
  48. package/r/mosaic-clerk-org-switcher.json +18 -0
  49. package/r/mosaic-clerk-webhook-handler.json +18 -0
  50. package/r/mosaic-collapsible.json +18 -0
  51. package/r/mosaic-combobox.json +18 -0
  52. package/r/mosaic-counter.json +16 -0
  53. package/r/mosaic-dashboard-content.json +18 -0
  54. package/r/mosaic-dashboard-header.json +18 -0
  55. package/r/mosaic-dashboard-layout.json +20 -0
  56. package/r/mosaic-data-table.json +16 -0
  57. package/r/mosaic-delete-confirmation-dialog.json +18 -0
  58. package/r/mosaic-device-provider.json +16 -0
  59. package/r/mosaic-document-table.json +52 -0
  60. package/r/mosaic-document-upload.json +21 -0
  61. package/r/mosaic-drawer.json +23 -0
  62. package/r/mosaic-dropdown-menu.json +18 -0
  63. package/r/mosaic-edit-memory-dialog.json +27 -0
  64. package/r/mosaic-edit-session-dialog.json +25 -0
  65. package/r/mosaic-editable-cell.json +23 -0
  66. package/r/mosaic-empty-state.json +16 -0
  67. package/r/mosaic-falling-pattern.json +16 -0
  68. package/r/mosaic-feature-3col.json +16 -0
  69. package/r/mosaic-feature-centered-media.json +16 -0
  70. package/r/mosaic-field.json +18 -0
  71. package/r/mosaic-filter-bar.json +18 -0
  72. package/r/mosaic-filter-sidebar.json +18 -0
  73. package/r/mosaic-footer-simple.json +16 -0
  74. package/r/mosaic-grille-registre.json +53 -0
  75. package/r/mosaic-hero-split.json +16 -0
  76. package/r/mosaic-input-group.json +16 -0
  77. package/r/mosaic-input.json +18 -0
  78. package/r/mosaic-integrations-badge.json +16 -0
  79. package/r/mosaic-kanban-board.json +21 -0
  80. package/r/mosaic-logos-grid.json +16 -0
  81. package/r/mosaic-main-nav.json +18 -0
  82. package/r/mosaic-markdown.json +21 -0
  83. package/r/mosaic-marketplace-card.json +24 -0
  84. package/r/mosaic-marketplace-list.json +20 -0
  85. package/r/mosaic-match-input.json +23 -0
  86. package/r/mosaic-memory-card.json +21 -0
  87. package/r/mosaic-memory-dashboard.json +23 -0
  88. package/r/mosaic-memory-grid.json +21 -0
  89. package/r/mosaic-memory-list.json +21 -0
  90. package/r/mosaic-memory-search.json +23 -0
  91. package/r/mosaic-mention-input.json +23 -0
  92. package/r/mosaic-message-card.json +16 -0
  93. package/r/mosaic-message-list.json +19 -0
  94. package/r/mosaic-message-search.json +18 -0
  95. package/r/mosaic-model-selector.json +23 -0
  96. package/r/mosaic-module-card.json +16 -0
  97. package/r/mosaic-module-library.json +18 -0
  98. package/r/mosaic-multi-tenant-provider.json +19 -0
  99. package/r/mosaic-navbar.json +16 -0
  100. package/r/mosaic-org-context-display.json +18 -0
  101. package/r/mosaic-org-panel.json +19 -0
  102. package/r/mosaic-org-profile-page.json +18 -0
  103. package/r/mosaic-org-switcher.json +16 -0
  104. package/r/mosaic-pdf-viewer.json +23 -0
  105. package/r/mosaic-popover.json +23 -0
  106. package/r/mosaic-preferences-panel.json +18 -0
  107. package/r/mosaic-pricing-card.json +16 -0
  108. package/r/mosaic-profile-panel.json +18 -0
  109. package/r/mosaic-progress.json +18 -0
  110. package/r/mosaic-quick-action-card.json +16 -0
  111. package/r/mosaic-quick-actions-menu.json +18 -0
  112. package/r/mosaic-quick-agent-selector.json +19 -0
  113. package/r/mosaic-radio-group.json +18 -0
  114. package/r/mosaic-reply-input.json +21 -0
  115. package/r/mosaic-resizable-split-pane.json +23 -0
  116. package/r/mosaic-save-chat-as-memory-form.json +25 -0
  117. package/r/mosaic-save-template-modal.json +27 -0
  118. package/r/mosaic-scroll-area.json +18 -0
  119. package/r/mosaic-select.json +18 -0
  120. package/r/mosaic-selector-modal.json +18 -0
  121. package/r/mosaic-separator.json +18 -0
  122. package/r/mosaic-session-card.json +24 -0
  123. package/r/mosaic-session-list.json +21 -0
  124. package/r/mosaic-sign-in-layout.json +18 -0
  125. package/r/mosaic-sign-up-layout.json +18 -0
  126. package/r/mosaic-skeleton.json +23 -0
  127. package/r/mosaic-slider.json +18 -0
  128. package/r/mosaic-stats-grid.json +16 -0
  129. package/r/mosaic-step-pipeline.json +21 -0
  130. package/r/mosaic-switch.json +18 -0
  131. package/r/mosaic-tabs.json +18 -0
  132. package/r/mosaic-tag-input.json +23 -0
  133. package/r/mosaic-template-agent-card.json +21 -0
  134. package/r/mosaic-template-category-chips.json +21 -0
  135. package/r/mosaic-template-gallery.json +20 -0
  136. package/r/mosaic-template-list.json +21 -0
  137. package/r/mosaic-template-management-panel.json +25 -0
  138. package/r/mosaic-testimonials-grid.json +16 -0
  139. package/r/mosaic-textarea.json +16 -0
  140. package/r/mosaic-theme-provider.json +18 -0
  141. package/r/mosaic-theme-toggle.json +16 -0
  142. package/r/mosaic-thread-indicator.json +21 -0
  143. package/r/mosaic-thread-view.json +21 -0
  144. package/r/mosaic-toast.json +28 -0
  145. package/r/mosaic-tool-toggle-list.json +23 -0
  146. package/r/mosaic-tooltip.json +18 -0
  147. package/r/mosaic-url-scraper.json +21 -0
  148. package/r/mosaic-user-button.json +18 -0
  149. package/r/use-effective-workspace-id.json +18 -0
  150. package/registry.json +77 -130
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-session-list",
4
+ "title": "MosaicSessionList",
5
+ "description": "MosaicSessionList — presentational, layout-disposition-only list of the workstation's in-progress sessions",
6
+ "dependencies": [],
7
+ "registryDependencies": [],
8
+ "files": [
9
+ {
10
+ "path": "src/components/session-list/MosaicSessionList.tsx",
11
+ "type": "registry:ui",
12
+ "content": "/**\n * MosaicSessionList — presentational, layout-disposition-only list of the\n * workstation's in-progress sessions\n *\n * The source implementation shipped as FOUR separate list components\n * (\"stack\", \"grid\", \"compact\", \"inline\" dispositions). Merged here into\n * ONE variant-driven component — the list does not exist without the\n * card, and it does not exist four times over either: same doctrine as\n * MosaicMemoryList, applied to the `layout` axis instead of `density`.\n *\n * The list owns disposition ONLY:\n * - `items`: the host's array of sessions, each requiring only an `id`.\n * - `renderItem`: the host-supplied per-session renderer (typically a\n * `MosaicSessionCard`) — the list never renders a row of its own and\n * never hardcodes a status, a sort order, or any domain content\n * (no-hardcoded-business-knowledge). It never fetches its own data.\n * - `emptyMessage`: required, no default (SIN-01) — the host owns the\n * language, e.g. `t('SessionList.empty')`.\n *\n * Keyboard: roving tabindex across items (native `<ul>` / `<li>` —\n * semantic list roles come from the elements themselves) — ArrowDown/\n * ArrowRight moves focus to the next row, ArrowUp/ArrowLeft to the\n * previous, Home/End jump to the first/last. Exactly one item is\n * `tabIndex={0}` at a time; the rest are `tabIndex={-1}`. Behavior is the\n * same across all four `layout` values — only the container/item Tailwind\n * classes differ.\n *\n * Pattern: MosaicMemoryList.tsx (data-slot, inline utility `cn`, roving\n * tabindex, React 19 ref prop, displayName, JSDoc).\n */\n\nimport type * as React from \"react\";\nimport { useRef, useState } from \"react\";\nimport { sessionListItemVariants, sessionListVariants } from \"./session-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\n/** The four merged source dispositions, as ONE variant prop. */\nexport type MosaicSessionListLayout = \"stack\" | \"grid\" | \"compact\" | \"inline\";\n\nexport interface MosaicSessionListProps<T extends { id: string }> {\n /** The sessions to lay out. The list never inspects their shape beyond `id`. */\n items: T[];\n /** Host-owned renderer for a single session — the list owns disposition only. */\n renderItem: (item: T, index: number) => React.ReactNode;\n /**\n * Container disposition — the four merged source variants.\n * @default \"stack\"\n */\n layout?: MosaicSessionListLayout;\n /**\n * Message shown when `items` is empty. Required, no default — the host\n * owns the language (e.g. `t('SessionList.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 * MosaicSessionList — production layout-disposition atom for\n * @vantageos/mosaic-blocks.\n *\n * Purely presentational: no filtering, no sorting, no item rendering, no\n * I/O — the host owns the session content via `renderItem`; this\n * component only owns the four merged layout dispositions and keyboard\n * roving-tabindex navigation.\n */\nexport function MosaicSessionList<T extends { id: string }>({\n items,\n renderItem,\n layout = \"stack\",\n emptyMessage,\n className,\n itemClassName,\n ref,\n}: MosaicSessionListProps<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=\"session-list\"\n data-layout={layout}\n className={cn(sessionListVariants({ layout }), className)}\n >\n <p\n data-slot=\"session-list-empty\"\n className=\"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=\"session-list\"\n data-layout={layout}\n className={cn(\"list-none\", sessionListVariants({ 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=\"session-list-item\"\n tabIndex={index === focusedIndex ? 0 : -1}\n onKeyDown={(event) => handleKeyDown(event, index)}\n onFocus={() => setFocusedIndex(index)}\n className={cn(sessionListItemVariants({ layout }), itemClassName)}\n >\n {renderItem(item, index)}\n </li>\n ))}\n </ul>\n );\n}\n\nMosaicSessionList.displayName = \"MosaicSessionList\";\n"
13
+ },
14
+ {
15
+ "path": "src/components/session-list/session-list-variants.ts",
16
+ "type": "registry:ui",
17
+ "content": "/**\n * sessionListVariants — pure CVA variant function for MosaicSessionList.\n *\n * The source implementation shipped as FOUR separate list components, one\n * per disposition. Merged here into ONE component with a `layout` variant\n * prop — the doctrine used throughout this repo (see MosaicMemoryCard,\n * MosaicMemoryList): one component, variants, never N components for what\n * is really the same `items` + `renderItem` + `emptyMessage` contract with\n * a different container layout.\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; item content is entirely\n * host-supplied via `renderItem`.\n */\nexport const sessionListVariants = cva([], {\n variants: {\n layout: {\n /** Single-column vertical stack, divided rows. */\n stack: \"flex flex-col divide-y divide-border\",\n /** Responsive tile grid. */\n grid: \"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3\",\n /** Dense single-column stack — tighter row padding, no divider. */\n compact: \"flex flex-col gap-1\",\n /** Horizontal-scroll row of tiles. */\n inline: \"flex flex-row gap-3 overflow-x-auto\",\n },\n },\n defaultVariants: {\n layout: \"stack\",\n },\n});\n\n/** Per-item wrapper — spacing depends on the container layout. */\nexport const sessionListItemVariants = cva([], {\n variants: {\n layout: {\n stack: \"py-3\",\n grid: \"\",\n compact: \"py-1\",\n inline: \"shrink-0\",\n },\n },\n defaultVariants: {\n layout: \"stack\",\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-sign-in-layout",
4
+ "title": "MosaicSignInLayout",
5
+ "description": "Sign-in page layout, themed, mobile-first. Wraps Clerk <SignIn> with OKLCH-token appearance. Clerk injected as peer prop.",
6
+ "dependencies": [
7
+ "@clerk/nextjs"
8
+ ],
9
+ "registryDependencies": [],
10
+ "files": [
11
+ {
12
+ "path": "src/components/auth/sign-in-layout/MosaicSignInLayout.tsx",
13
+ "type": "registry:ui",
14
+ "content": "\"use client\";\n\n/**\n * MosaicSignInLayout — sign-in page layout, themed, mobile-first.\n *\n * Wraps Clerk <SignIn> with OKLCH-token appearance prop. Clerk is injected as a\n * peer prop so mosaic-blocks does not bundle @clerk/nextjs directly.\n *\n * @example\n * import { SignIn } from \"@clerk/nextjs\"\n * <MosaicSignInLayout clerkSignIn={SignIn} />\n */\n\nimport type * as React from \"react\";\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\nexport interface MosaicSignInLayoutProps {\n /** Clerk <SignIn> component — injected by caller to avoid bundling Clerk */\n clerkSignIn: React.ComponentType<{\n appearance?: Record<string, unknown>;\n signUpUrl?: string;\n signInUrl?: string;\n fallbackRedirectUrl?: string;\n forceRedirectUrl?: string;\n routing?: \"hash\" | \"path\" | \"virtual\";\n path?: string;\n [key: string]: unknown;\n }>;\n /** URL for sign-up page */\n signUpUrl?: string;\n /** URL for sign-in page (passed to the Clerk widget as signInUrl) */\n signInUrl?: string;\n /** URL to redirect after successful sign-in (Clerk v7 fallbackRedirectUrl) */\n afterSignInUrl?: string;\n /** Force redirect URL — overrides query-param-based redirects (Clerk v7) */\n forceRedirectUrl?: string;\n /**\n * Clerk routing mode for catch-all routes.\n * Required for [[...sign-in]] App Router pages. Defaults to \"path\" when path is set.\n */\n routing?: \"hash\" | \"path\" | \"virtual\";\n /**\n * Base path for \"path\" routing (e.g. \"/sign-in\").\n * Required when routing=\"path\".\n */\n path?: string;\n /** Optional headline above the Clerk widget */\n headline?: string;\n /** Optional sub-headline */\n subheadline?: string;\n className?: string;\n}\n\n// ── Clerk OKLCH appearance tokens ─────────────────────────────────────────────\n\nconst clerkAppearance = {\n variables: {\n colorPrimary: \"var(--primary)\",\n colorBackground: \"var(--background)\",\n colorText: \"var(--foreground)\",\n colorTextSecondary: \"var(--muted-foreground)\",\n colorInputBackground: \"var(--background)\",\n colorInputText: \"var(--foreground)\",\n colorNeutral: \"var(--foreground)\",\n borderRadius: \"0.5rem\",\n },\n elements: {\n card: \"shadow-none border border-border bg-card\",\n headerTitle: \"text-foreground font-semibold\",\n headerSubtitle: \"text-muted-foreground\",\n formButtonPrimary: \"bg-primary text-primary-foreground hover:bg-primary/90 shadow-none\",\n formFieldInput: \"border-input bg-background text-foreground focus:ring-ring\",\n footerActionLink: \"text-primary hover:text-primary/80\",\n identityPreviewEditButton: \"text-primary hover:text-primary/80\",\n dividerLine: \"bg-border\",\n dividerText: \"text-muted-foreground text-xs\",\n socialButtonsBlockButton:\n \"border-border text-foreground hover:bg-accent hover:text-accent-foreground\",\n },\n};\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\nexport function MosaicSignInLayout({\n clerkSignIn: ClerkSignIn,\n signUpUrl = \"/sign-up\",\n signInUrl,\n afterSignInUrl = \"/\",\n forceRedirectUrl,\n routing,\n path,\n headline,\n subheadline,\n className,\n}: MosaicSignInLayoutProps) {\n return (\n <div\n data-slot=\"sign-in-layout\"\n className={[\n \"flex min-h-svh flex-col items-center justify-center\",\n \"bg-background px-4 py-12 sm:px-6 lg:px-8\",\n className,\n ]\n .filter(Boolean)\n .join(\" \")}\n >\n {(headline ?? subheadline) && (\n <div className=\"mb-8 text-center\">\n {headline && (\n <h1 className=\"text-2xl font-bold tracking-tight text-foreground sm:text-3xl\">\n {headline}\n </h1>\n )}\n {subheadline && <p className=\"mt-2 text-sm text-muted-foreground\">{subheadline}</p>}\n </div>\n )}\n <div className=\"w-full max-w-sm\">\n <ClerkSignIn\n appearance={clerkAppearance}\n signUpUrl={signUpUrl}\n {...(signInUrl !== undefined && { signInUrl })}\n fallbackRedirectUrl={afterSignInUrl}\n {...(forceRedirectUrl !== undefined && { forceRedirectUrl })}\n {...(routing !== undefined && { routing })}\n {...(path !== undefined && { path })}\n />\n </div>\n </div>\n );\n}\n\nMosaicSignInLayout.displayName = \"MosaicSignInLayout\";\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-sign-up-layout",
4
+ "title": "MosaicSignUpLayout",
5
+ "description": "Sign-up page layout, themed, mobile-first. Wraps Clerk <SignUp> with OKLCH-token appearance. Clerk injected as peer prop.",
6
+ "dependencies": [
7
+ "@clerk/nextjs"
8
+ ],
9
+ "registryDependencies": [],
10
+ "files": [
11
+ {
12
+ "path": "src/components/auth/sign-up-layout/MosaicSignUpLayout.tsx",
13
+ "type": "registry:ui",
14
+ "content": "\"use client\";\n\n/**\n * MosaicSignUpLayout — sign-up page layout, themed, mobile-first.\n *\n * Wraps Clerk <SignUp> with OKLCH-token appearance prop. Clerk is injected as a\n * peer prop so mosaic-blocks does not bundle @clerk/nextjs directly.\n *\n * @example\n * import { SignUp } from \"@clerk/nextjs\"\n * <MosaicSignUpLayout clerkSignUp={SignUp} />\n */\n\nimport type * as React from \"react\";\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\nexport interface MosaicSignUpLayoutProps {\n /** Clerk <SignUp> component — injected by caller to avoid bundling Clerk */\n clerkSignUp: React.ComponentType<{\n appearance?: Record<string, unknown>;\n signInUrl?: string;\n signUpUrl?: string;\n fallbackRedirectUrl?: string;\n forceRedirectUrl?: string;\n routing?: \"hash\" | \"path\" | \"virtual\";\n path?: string;\n [key: string]: unknown;\n }>;\n /** URL for sign-in page */\n signInUrl?: string;\n /** URL for sign-up page (passed to the Clerk widget as signUpUrl) */\n signUpUrl?: string;\n /** URL to redirect after successful sign-up (Clerk v7 fallbackRedirectUrl) */\n afterSignUpUrl?: string;\n /** Force redirect URL — overrides query-param-based redirects (Clerk v7) */\n forceRedirectUrl?: string;\n /**\n * Clerk routing mode for catch-all routes.\n * Required for [[...sign-up]] App Router pages. Defaults to \"path\" when path is set.\n */\n routing?: \"hash\" | \"path\" | \"virtual\";\n /**\n * Base path for \"path\" routing (e.g. \"/sign-up\").\n * Required when routing=\"path\".\n */\n path?: string;\n /** Optional headline above the Clerk widget */\n headline?: string;\n /** Optional sub-headline */\n subheadline?: string;\n className?: string;\n}\n\n// ── Clerk OKLCH appearance tokens ─────────────────────────────────────────────\n\nconst clerkAppearance = {\n variables: {\n colorPrimary: \"var(--primary)\",\n colorBackground: \"var(--background)\",\n colorText: \"var(--foreground)\",\n colorTextSecondary: \"var(--muted-foreground)\",\n colorInputBackground: \"var(--background)\",\n colorInputText: \"var(--foreground)\",\n colorNeutral: \"var(--foreground)\",\n borderRadius: \"0.5rem\",\n },\n elements: {\n card: \"shadow-none border border-border bg-card\",\n headerTitle: \"text-foreground font-semibold\",\n headerSubtitle: \"text-muted-foreground\",\n formButtonPrimary: \"bg-primary text-primary-foreground hover:bg-primary/90 shadow-none\",\n formFieldInput: \"border-input bg-background text-foreground focus:ring-ring\",\n footerActionLink: \"text-primary hover:text-primary/80\",\n identityPreviewEditButton: \"text-primary hover:text-primary/80\",\n dividerLine: \"bg-border\",\n dividerText: \"text-muted-foreground text-xs\",\n socialButtonsBlockButton:\n \"border-border text-foreground hover:bg-accent hover:text-accent-foreground\",\n },\n};\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\nexport function MosaicSignUpLayout({\n clerkSignUp: ClerkSignUp,\n signInUrl = \"/sign-in\",\n signUpUrl,\n afterSignUpUrl = \"/\",\n forceRedirectUrl,\n routing,\n path,\n headline,\n subheadline,\n className,\n}: MosaicSignUpLayoutProps) {\n return (\n <div\n data-slot=\"sign-up-layout\"\n className={[\n \"flex min-h-svh flex-col items-center justify-center\",\n \"bg-background px-4 py-12 sm:px-6 lg:px-8\",\n className,\n ]\n .filter(Boolean)\n .join(\" \")}\n >\n {(headline ?? subheadline) && (\n <div className=\"mb-8 text-center\">\n {headline && (\n <h1 className=\"text-2xl font-bold tracking-tight text-foreground sm:text-3xl\">\n {headline}\n </h1>\n )}\n {subheadline && <p className=\"mt-2 text-sm text-muted-foreground\">{subheadline}</p>}\n </div>\n )}\n <div className=\"w-full max-w-sm\">\n <ClerkSignUp\n appearance={clerkAppearance}\n signInUrl={signInUrl}\n {...(signUpUrl !== undefined && { signUpUrl })}\n fallbackRedirectUrl={afterSignUpUrl}\n {...(forceRedirectUrl !== undefined && { forceRedirectUrl })}\n {...(routing !== undefined && { routing })}\n {...(path !== undefined && { path })}\n />\n </div>\n </div>\n );\n}\n\nMosaicSignUpLayout.displayName = \"MosaicSignUpLayout\";\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-skeleton",
4
+ "title": "MosaicSkeleton",
5
+ "description": "MosaicSkeleton — loading skeleton primitive for @vantageos/mosaic-blocks.",
6
+ "dependencies": [
7
+ "class-variance-authority"
8
+ ],
9
+ "registryDependencies": [],
10
+ "files": [
11
+ {
12
+ "path": "src/components/skeleton/MosaicSkeleton.tsx",
13
+ "type": "registry:ui",
14
+ "content": "/**\n * MosaicSkeleton — loading skeleton primitive for @vantageos/mosaic-blocks.\n *\n * Pulsing placeholder block using the muted token background (animate-pulse bg-muted).\n * Supports shape variants and multi-line text skeletons.\n *\n * Pattern: follows Button.tsx conventions (data-slot, React 19 ref prop,\n * inline cn helper, no \"use client\" — prepend-use-client.mjs handles dist).\n *\n * Closes issue #20 — replaces DashboardSkeleton + 11+ inline loading sites\n * in vantage-peers-dashboard.\n *\n * @example\n * // Single block\n * <MosaicSkeleton className=\"h-24 w-full\" />\n *\n * @example\n * // Multi-line text placeholder (3 lines, last ~60% width)\n * <MosaicSkeleton variant=\"text\" lines={3} />\n *\n * @example\n * // Avatar circle\n * <MosaicSkeleton variant=\"circle\" className=\"w-10\" />\n *\n * @example\n * // Button-shaped placeholder\n * <MosaicSkeleton variant=\"button\" className=\"w-24\" />\n */\n\nimport type { VariantProps } from \"class-variance-authority\";\nimport type * as React from \"react\";\nimport { skeletonVariants } from \"./skeleton-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 MosaicSkeletonProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof skeletonVariants> {\n /**\n * Number of stacked text lines to render.\n * Only effective when `variant=\"text\"`. When > 1, renders N lines\n * where the last line is ~60% width to mimic natural text flow.\n * @default 1\n */\n lines?: number;\n /** ref is typed as HTMLDivElement (React 19 prop, no forwardRef needed) */\n ref?: React.Ref<HTMLDivElement>;\n}\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\n/**\n * MosaicSkeleton — production loading skeleton atom for @vantageos/mosaic-blocks.\n *\n * Renders an animated placeholder block. Use `variant` to control shape,\n * and `lines` (with `variant=\"text\"`) to render multi-line text skeletons.\n *\n * @example\n * <MosaicSkeleton className=\"h-24 w-full\" />\n * <MosaicSkeleton variant=\"text\" lines={3} />\n * <MosaicSkeleton variant=\"circle\" className=\"w-10\" />\n */\nexport function MosaicSkeleton({\n className,\n variant,\n lines = 1,\n ref,\n ...props\n}: MosaicSkeletonProps) {\n // Multi-line text skeleton: render N stacked lines, last one ~60% width\n if (variant === \"text\" && lines > 1) {\n // Build a stable key array from the line count — purely positional/static,\n // these placeholder divs never reorder, carry no state, and have no identity.\n const lineKeys = Array.from({ length: lines }, (_, i) => `line-${lines}-${i}`);\n return (\n <div\n ref={ref}\n data-slot=\"skeleton\"\n className={cn(\"flex flex-col gap-2\", className)}\n {...props}\n >\n {lineKeys.map((key, i) => (\n <div\n key={key}\n className={cn(skeletonVariants({ variant }), i === lines - 1 && \"w-[60%]\")}\n />\n ))}\n </div>\n );\n }\n\n return (\n <div\n ref={ref}\n data-slot=\"skeleton\"\n className={cn(skeletonVariants({ variant }), className)}\n {...props}\n />\n );\n}\n\nMosaicSkeleton.displayName = \"MosaicSkeleton\";\n"
15
+ },
16
+ {
17
+ "path": "src/components/skeleton/skeleton-variants.ts",
18
+ "type": "registry:ui",
19
+ "content": "/**\n * skeletonVariants — pure CVA variant function for MosaicSkeleton.\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 * (which is imported in MosaicSkeleton.tsx but not here).\n *\n * Zero browser / React runtime dependencies — safe in RSC / Node.js.\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const skeletonVariants = cva(\n // Base: animate-pulse + muted background token\n [\"animate-pulse\", \"bg-muted\"],\n {\n variants: {\n variant: {\n /** Rounded block — generic rectangular placeholder (cards, images, sections) */\n default: \"rounded-md\",\n /** Text line — h-4 rounded, for single/multi-line text placeholders */\n text: \"h-4 rounded\",\n /** Circle — rounded-full aspect-square, for avatars and icons */\n circle: \"rounded-full aspect-square\",\n /** Button-shaped — h-9 rounded-md, mirrors MosaicButton default size */\n button: \"h-9 rounded-md\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n"
20
+ }
21
+ ],
22
+ "type": "registry:ui"
23
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-slider",
4
+ "title": "MosaicSlider",
5
+ "description": "MosaicSlider — @base-ui/react Slider primitive",
6
+ "dependencies": [
7
+ "@base-ui/react"
8
+ ],
9
+ "registryDependencies": [],
10
+ "files": [
11
+ {
12
+ "path": "src/components/slider/MosaicSlider.tsx",
13
+ "type": "registry:ui",
14
+ "content": "/**\n * MosaicSlider — @base-ui/react Slider primitive\n *\n * Builds on Slider.Root + Slider.Control + Slider.Track +\n * Slider.Indicator + Slider.Thumb.\n * Supports single value and range (array) values.\n * role=slider and aria-valuenow managed by the primitive automatically.\n *\n * data-slot=\"slider\" on Root, \"slider-track\" on Track,\n * \"slider-indicator\" on Indicator, \"slider-thumb\" on Thumb.\n * Styling: Tailwind v4 semantic tokens only.\n */\n\nimport { Slider } from \"@base-ui/react/slider\";\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 MosaicSliderProps extends Slider.Root.Props {\n className?: string;\n ref?: React.Ref<HTMLDivElement>;\n}\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\n/**\n * MosaicSlider — production Slider atom for @vantageos/mosaic-blocks.\n *\n * Built on @base-ui/react/slider. Supports single value + range (array).\n * Keyboard accessible: arrow keys, Home, End.\n *\n * @example\n * <MosaicSlider defaultValue={50} aria-label=\"Volume\" />\n * <MosaicSlider defaultValue={[20, 80]} aria-label=\"Price range\" />\n */\nexport function MosaicSlider({ className, ref, ...props }: MosaicSliderProps) {\n const isRange = Array.isArray(props.defaultValue ?? props.value);\n const thumbCount = isRange ? ((props.defaultValue ?? props.value) as number[]).length : 1;\n\n return (\n <Slider.Root\n ref={ref}\n data-slot=\"slider\"\n className={cn(\"w-full touch-none select-none\", className)}\n {...props}\n >\n <Slider.Control className=\"flex items-center\">\n <Slider.Track\n data-slot=\"slider-track\"\n className=\"relative h-2 w-full grow rounded-full bg-secondary\"\n >\n <Slider.Indicator\n data-slot=\"slider-indicator\"\n className=\"absolute h-full rounded-full bg-foreground\"\n />\n {Array.from({ length: thumbCount }).map((_, i) => (\n <Slider.Thumb\n // biome-ignore lint/suspicious/noArrayIndexKey: slider thumbs have stable positional identity\n key={i}\n data-slot=\"slider-thumb\"\n className={cn(\n \"block size-5 rounded-full\",\n \"border-2 border-foreground bg-background\",\n \"shadow-sm outline-none transition-colors\",\n \"focus-visible:ring-ring focus-visible:ring-[3px]\",\n \"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\",\n )}\n />\n ))}\n </Slider.Track>\n </Slider.Control>\n </Slider.Root>\n );\n}\n\nMosaicSlider.displayName = \"MosaicSlider\";\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-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.37-alpha/r/mosaic-adaptive-modal.json",
9
+ "https://cdn.jsdelivr.net/npm/@vantageos/mosaic-blocks@0.5.37-alpha/r/mosaic-device-provider.json",
10
+ "https://cdn.jsdelivr.net/npm/@vantageos/mosaic-blocks@0.5.37-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
+ }