@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,16 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-footer-simple",
4
+ "title": "MosaicFooterSimple",
5
+ "description": "Simple multi-column footer. Props: columns[] {id, heading, links[]}, legal, logo?, social[] {label, href, iconSrc?}.",
6
+ "dependencies": [],
7
+ "registryDependencies": [],
8
+ "files": [
9
+ {
10
+ "path": "src/components/footer-simple/MosaicFooterSimple.tsx",
11
+ "type": "registry:ui",
12
+ "content": "/**\n * MosaicFooterSimple — simple multi-column footer\n *\n * Ported from heyfabrika/styleui components/templates/axis/footer.tsx (MIT).\n * Adapted: props-driven columns (heading + links), legal text, social links.\n * No next/image or next/link — lib-portable.\n */\n\nimport type * as React from \"react\";\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\nexport interface FooterLink {\n label: string;\n href: string;\n}\n\nexport interface FooterColumn {\n /** Stable unique identifier */\n id: string;\n /** Column heading */\n heading: string;\n /** Links in this column */\n links: FooterLink[];\n}\n\nexport interface SocialLink {\n label: string;\n href: string;\n /** Optional icon — renders as img if src provided, else renders label text */\n iconSrc?: string;\n}\n\nexport interface MosaicFooterSimpleProps {\n /** Footer link columns */\n columns: FooterColumn[];\n /** Legal / copyright string */\n legal: string;\n /** Optional logo node */\n logo?: React.ReactNode;\n /** Optional social icon links */\n social?: SocialLink[];\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 * MosaicFooterSimple — footer with columns of links, optional logo, social\n * links, and legal text. All content via props.\n *\n * @example\n * <MosaicFooterSimple\n * logo={<img src=\"/logo.svg\" alt=\"Brand\" className=\"h-8 w-auto\" />}\n * columns={[\n * { id: \"c1\", heading: \"Product\", links: [{ label: \"Features\", href: \"#\" }] },\n * { id: \"c2\", heading: \"Company\", links: [{ label: \"About\", href: \"#\" }] },\n * ]}\n * social={[{ label: \"Twitter\", href: \"https://x.com\", iconSrc: \"/icons/x.svg\" }]}\n * legal=\"© 2026 Mosaic. All rights reserved.\"\n * />\n */\nexport function MosaicFooterSimple({\n columns,\n legal,\n logo,\n social,\n className,\n ref,\n}: MosaicFooterSimpleProps) {\n return (\n <footer\n ref={ref}\n className={cn(\n \"flex flex-col items-center gap-10 px-4 py-16 border-t border-[oklch(0.9_0.005_250)]\",\n className,\n )}\n >\n {/* Logo */}\n {logo && <div>{logo}</div>}\n\n {/* Columns */}\n {columns.length > 0 && (\n <div\n className=\"grid w-full max-w-4xl gap-8\"\n style={{\n gridTemplateColumns: `repeat(${Math.min(columns.length, 4)}, minmax(0, 1fr))`,\n }}\n >\n {columns.map((col) => (\n <div key={col.id} className=\"flex flex-col gap-3\">\n <p className=\"text-xs font-semibold uppercase tracking-widest text-[oklch(0.3_0.01_250)]\">\n {col.heading}\n </p>\n <ul className=\"flex flex-col gap-2\">\n {col.links.map((link) => (\n <li key={link.href}>\n <a\n href={link.href}\n className=\"text-sm text-[oklch(0.5_0.01_250)] transition-colors hover:text-[oklch(0.15_0.01_250)]\"\n >\n {link.label}\n </a>\n </li>\n ))}\n </ul>\n </div>\n ))}\n </div>\n )}\n\n {/* Social links */}\n {social && social.length > 0 && (\n <div className=\"flex flex-row gap-4\">\n {social.map((s) => (\n <a\n key={s.href}\n href={s.href}\n aria-label={s.label}\n className=\"flex items-center justify-center transition-opacity hover:opacity-70\"\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n >\n {s.iconSrc ? (\n <img src={s.iconSrc} alt={s.label} width={24} height={24} className=\"size-6\" />\n ) : (\n <span className=\"text-sm text-[oklch(0.5_0.01_250)]\">{s.label}</span>\n )}\n </a>\n ))}\n </div>\n )}\n\n {/* Legal */}\n <p className=\"text-center text-sm text-[oklch(0.55_0.01_250)]\">{legal}</p>\n </footer>\n );\n}\n\nMosaicFooterSimple.displayName = \"MosaicFooterSimple\";\n"
13
+ }
14
+ ],
15
+ "type": "registry:ui"
16
+ }
@@ -0,0 +1,53 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-grille-registre",
4
+ "title": "GrilleRegistre",
5
+ "description": "GrilleRegistre — the shared AG Grid of a registry screen: AG Grid Community, a stable row identity, and every column sortable, filterable (with a floating filter) and resizable.",
6
+ "dependencies": [
7
+ "@heroui/react",
8
+ "ag-grid-community",
9
+ "ag-grid-react",
10
+ "lucide-react"
11
+ ],
12
+ "registryDependencies": [
13
+ "https://cdn.jsdelivr.net/npm/@vantageos/mosaic-blocks@0.5.37-alpha/r/mosaic-document-table.json"
14
+ ],
15
+ "files": [
16
+ {
17
+ "path": "src/components/registre/ChoixColonnes.tsx",
18
+ "type": "registry:ui",
19
+ "content": "/**\n * ChoixColonnes — the « visible columns » chooser of a registry screen: a HeroUI\n * Popover of Checkboxes. AG Grid Community exposes the hiding API\n * (`setColumnsVisible`) but its ready-made chooser belongs to the enterprise\n * edition, so this is the one piece of grid UI the blocks write.\n *\n * The list height is bounded by the viewport (`max-h-[60vh]`), never a pixel\n * constant: a fixed height overflows a short window and makes the first and last\n * columns unreachable.\n */\nimport { Button, Checkbox, Popover } from \"@heroui/react\";\nimport { useState } from \"react\";\nimport { type ColonneChoisie, type EtatVisibilite, estVisible } from \"./colonnes.js\";\n\nexport interface ChoixColonnesLabels {\n /** The trigger's text, given the number of hidden columns (derived each render). */\n columnsButton: (hiddenCount: number) => string;\n /** Accessible name of the checkbox group. */\n columnsGroupAriaLabel: string;\n}\n\nexport interface ChoixColonnesProps {\n colonnes: readonly ColonneChoisie[];\n visibilite: EtatVisibilite;\n onBasculer: (champ: string) => void;\n labels: ChoixColonnesLabels;\n /** Display transform of a column label (casing); identity when omitted. */\n formatLibelle?: (libelle: string) => string;\n /** For layout tests only: render the chooser already open. */\n ouvertParDefaut?: boolean;\n}\n\n// allow-undeclared-theme-token: `default` is a HeroUI theme token; these blocks require @heroui/react and its styles.\nconst OPTION_CLASS =\n \"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-sm hover:bg-default\";\n\nexport function ChoixColonnes({\n colonnes,\n visibilite,\n onBasculer,\n labels,\n formatLibelle = (libelle) => libelle,\n ouvertParDefaut = false,\n}: ChoixColonnesProps) {\n const [ouvert, setOuvert] = useState(ouvertParDefaut);\n\n // Derived from the state every render, never kept apart: a separately\n // maintained counter ends up lying.\n const nbMasquees = colonnes.filter((c) => !estVisible(visibilite, c.champ)).length;\n\n return (\n <Popover isOpen={ouvert} onOpenChange={setOuvert}>\n <Button variant=\"outline\" size=\"sm\">\n {labels.columnsButton(nbMasquees)}\n </Button>\n <Popover.Content placement=\"bottom\">\n <Popover.Dialog>\n <fieldset\n aria-label={labels.columnsGroupAriaLabel}\n className=\"z-50 max-h-[60vh] w-72 overflow-y-auto border-0 p-1\"\n >\n {colonnes.map((c) => (\n <Checkbox\n key={c.champ}\n isSelected={estVisible(visibilite, c.champ)}\n onChange={() => onBasculer(c.champ)}\n >\n <Checkbox.Content className={OPTION_CLASS}>\n <Checkbox.Control>\n <Checkbox.Indicator />\n </Checkbox.Control>\n <span className=\"w-4 tabular-nums text-muted-foreground\">{c.lettre}</span>\n <span>{formatLibelle(c.libelle)}</span>\n </Checkbox.Content>\n </Checkbox>\n ))}\n </fieldset>\n </Popover.Dialog>\n </Popover.Content>\n </Popover>\n );\n}\n"
20
+ },
21
+ {
22
+ "path": "src/components/registre/GrilleRegistre.tsx",
23
+ "type": "registry:ui",
24
+ "content": "/**\n * GrilleRegistre — the shared AG Grid of a registry screen: AG Grid Community, a\n * stable row identity, and every column sortable, filterable (with a floating\n * filter) and resizable.\n *\n * THIS MODULE DECIDES NOTHING ABOUT COLUMNS. The caller passes its own\n * `columnDefs`. The grid-level behaviours a registry screen may need — in-grid\n * edit, a selected-row style, cell tooltips — are forwarded as optional props,\n * never wired in here.\n */\nimport type {\n CellClickedEvent,\n CellValueChangedEvent,\n ColDef,\n GridReadyEvent,\n GridSizeChangedEvent,\n RowClassParams,\n RowStyle,\n Theme,\n} from \"ag-grid-community\";\nimport { AllCommunityModule, ModuleRegistry } from \"ag-grid-community\";\nimport { AgGridReact } from \"ag-grid-react\";\nimport { fitGridWidthStrategy, registreGridTheme } from \"./grid-theme.js\";\n\n// Registered on first render, not at import: a host importing the package\n// without rendering a grid gets no global AG Grid side effect.\nlet modulesRegistered = false;\nfunction ensureModules(): void {\n if (modulesRegistered) return;\n ModuleRegistry.registerModules([AllCommunityModule]);\n modulesRegistered = true;\n}\n\n/** Every column sorts, filters (with a floating filter) and resizes. */\nconst DEFAUTS: ColDef = {\n resizable: true,\n sortable: true,\n filter: true,\n floatingFilter: true,\n};\n\nexport interface GrilleRegistreProps<T> {\n lignes: readonly T[];\n columnDefs: readonly ColDef<T>[];\n /** Stable row identity: a correction after a sort reaches its row. */\n getRowId: (ligne: T) => string;\n /** Global search, applied by the grid across every visible column. */\n filtreGlobal?: string;\n /** AG Grid theme; defaults to `registreGridTheme` (HeroUI variables). */\n theme?: Theme;\n onGridReady?: (e: GridReadyEvent<T>) => void;\n /** Fired when a grid cell has just been validated (in-grid edit). */\n onCelluleEditee?: (e: CellValueChangedEvent<T>) => void;\n /** Per-row style, e.g. the selected-row highlight. */\n getRowStyle?: (p: RowClassParams<T>) => RowStyle | undefined;\n /** ms before a cell tooltip shows; set when columns carry tooltips. */\n tooltipShowDelay?: number;\n /** false lets a cell take keyboard focus (needed for in-grid edit). */\n suppressCellFocus?: boolean;\n /** A cell click, e.g. to open a row's detail panel. */\n onCellClicked?: (e: CellClickedEvent<T>) => void;\n /** Fixed row height; set when a cell carries a tall control (a row action). */\n rowHeight?: number;\n /** AG Grid layout; `\"autoHeight\"` grows the grid to its rows (no inner scroll). */\n domLayout?: \"normal\" | \"autoHeight\" | \"print\";\n /** Refit columns on a size change — `refitColumns` on an autoHeight grid. */\n onGridSizeChanged?: (e: GridSizeChangedEvent<T>) => void;\n}\n\nexport function GrilleRegistre<T>({\n lignes,\n columnDefs,\n getRowId,\n filtreGlobal,\n theme = registreGridTheme,\n onGridReady,\n onCelluleEditee,\n getRowStyle,\n tooltipShowDelay,\n suppressCellFocus,\n onCellClicked,\n rowHeight,\n domLayout,\n onGridSizeChanged,\n}: GrilleRegistreProps<T>) {\n ensureModules();\n // The parent sets the height unless the caller asks for autoHeight.\n return (\n <div className=\"isolate h-full min-h-0 w-full\">\n <AgGridReact<T>\n theme={theme}\n autoSizeStrategy={fitGridWidthStrategy}\n rowData={lignes as T[]}\n columnDefs={columnDefs as ColDef<T>[]}\n defaultColDef={DEFAUTS}\n quickFilterText={filtreGlobal}\n getRowId={(p) => getRowId(p.data)}\n onGridReady={onGridReady}\n onCellValueChanged={onCelluleEditee}\n onCellClicked={onCellClicked}\n getRowStyle={getRowStyle}\n tooltipShowDelay={tooltipShowDelay}\n suppressCellFocus={suppressCellFocus}\n rowHeight={rowHeight}\n domLayout={domLayout}\n onGridSizeChanged={onGridSizeChanged}\n animateRows\n />\n </div>\n );\n}\n"
25
+ },
26
+ {
27
+ "path": "src/components/registre/PanneauRegistreShell.tsx",
28
+ "type": "registry:ui",
29
+ "content": "/**\n * PanneauRegistreShell — the ONE drawer shell every registry screen's side panel\n * mounts. It owns the HeroUI Drawer, the left-edge resize handle, the\n * ArrowUp/ArrowDown row navigation, the header band and the prev/next footer.\n * The body is supplied as `children`: the mounting screen puts the ROW'S FIELDS\n * FIRST there.\n *\n * Why one shell: two separately written panels drift apart on the frame, and a\n * panel that mounts a tall control first pushes every field below the fold. With\n * one shell, a new registry panel cannot diverge on the frame.\n *\n * `Drawer.Content`'s published props carry no `style` slot, so the resizable\n * width rides a CSS variable on a scoped class. `forceWidthRatio` lets a screen\n * momentarily override the width (e.g. a compare mode) without owning the\n * resize state itself.\n */\nimport { Button, Drawer } from \"@heroui/react\";\nimport { ChevronDown, ChevronUp } from \"lucide-react\";\nimport {\n type ReactNode,\n type PointerEvent as ReactPointerEvent,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport { isEditableTarget } from \"@/components/ui/row-navigation\";\n\nconst DEFAULT_WIDTH_RATIO = 0.45;\nconst MIN_WIDTH_PX = 360;\nconst MAX_WIDTH_RATIO = 0.9;\n\n// Not user-facing text. Kept as an object-literal constant with the marker BETWEEN\n// properties: esbuild strips a statement-level `//` comment, never this one.\nconst CSS_RULES = {\n // allow-hardcoded-word: a CSS rule (the scoped width variable), not user-facing text\n width: (px: number) => `.panneau-registre-shell { --panneau-registre-width: ${px}px; }`,\n};\n\nexport interface PanneauRegistreShellLabels {\n /** Accessible name of the left-edge resize handle. */\n resizeHandle: string;\n /** Accessible name of the close trigger. */\n close: string;\n previousRow: string;\n nextRow: string;\n}\n\nexport interface PanneauRegistreShellProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n labels: PanneauRegistreShellLabels;\n /** The dialog's accessible name. */\n ariaLabel?: string;\n /** The header line naming the row in words. */\n contexte: string;\n /** Optional header controls (e.g. a compare toggle), left of the close trigger. */\n headerActions?: ReactNode;\n /** When set, overrides the resizable width for the duration (e.g. a compare mode). */\n forceWidthRatio?: number | null;\n onPrev: () => void;\n onNext: () => void;\n prevDisabled: boolean;\n nextDisabled: boolean;\n /** The panel body. The mounting screen puts the ROW'S FIELDS FIRST here. */\n children: ReactNode;\n}\n\nexport function PanneauRegistreShell({\n open,\n onOpenChange,\n labels,\n ariaLabel,\n contexte,\n headerActions,\n forceWidthRatio = null,\n onPrev,\n onNext,\n prevDisabled,\n nextDisabled,\n children,\n}: PanneauRegistreShellProps) {\n // null until measured on the client.\n const [widthPx, setWidthPx] = useState<number | null>(null);\n const dragStart = useRef<{ x: number; width: number } | null>(null);\n\n useEffect(() => {\n if (widthPx !== null || typeof window === \"undefined\") return;\n setWidthPx(Math.round(window.innerWidth * DEFAULT_WIDTH_RATIO));\n }, [widthPx]);\n\n const onPointerMove = useCallback((e: PointerEvent) => {\n const drag = dragStart.current;\n if (!drag) return;\n // Handle sits on the panel's LEFT edge: dragging left grows the panel.\n const dx = drag.x - e.clientX;\n const maxWidth = window.innerWidth * MAX_WIDTH_RATIO;\n setWidthPx(Math.min(maxWidth, Math.max(MIN_WIDTH_PX, drag.width + dx)));\n }, []);\n\n const onPointerUp = useCallback(() => {\n dragStart.current = null;\n window.removeEventListener(\"pointermove\", onPointerMove);\n window.removeEventListener(\"pointerup\", onPointerUp);\n }, [onPointerMove]);\n\n const onHandlePointerDown = useCallback(\n (e: ReactPointerEvent<HTMLButtonElement>) => {\n dragStart.current = {\n x: e.clientX,\n width: widthPx ?? Math.round(window.innerWidth * DEFAULT_WIDTH_RATIO),\n };\n window.addEventListener(\"pointermove\", onPointerMove);\n window.addEventListener(\"pointerup\", onPointerUp);\n },\n [widthPx, onPointerMove, onPointerUp],\n );\n\n useEffect(() => () => onPointerUp(), [onPointerUp]);\n\n // ArrowUp/ArrowDown move to the neighbour row without closing the panel.\n useEffect(() => {\n if (!open) return;\n function onKeyDown(e: KeyboardEvent) {\n if (isEditableTarget(e.target)) return;\n if (e.key === \"ArrowUp\" && !prevDisabled) {\n e.preventDefault();\n onPrev();\n } else if (e.key === \"ArrowDown\" && !nextDisabled) {\n e.preventDefault();\n onNext();\n }\n }\n // Capture phase: the drawer stops arrow keys from its own buttons before they bubble to window.\n window.addEventListener(\"keydown\", onKeyDown, true);\n return () => window.removeEventListener(\"keydown\", onKeyDown, true);\n }, [open, prevDisabled, nextDisabled, onPrev, onNext]);\n\n const resolvedWidth =\n forceWidthRatio !== null && typeof window !== \"undefined\"\n ? Math.round(window.innerWidth * forceWidthRatio)\n : (widthPx ?? MIN_WIDTH_PX);\n\n const widthRule = CSS_RULES.width(resolvedWidth);\n\n return (\n <Drawer isOpen={open} onOpenChange={onOpenChange}>\n <Drawer.Backdrop>\n <Drawer.Content placement=\"right\">\n <style>{widthRule}</style>\n <Drawer.Dialog\n aria-label={ariaLabel}\n className=\"panneau-registre-shell relative flex h-full w-full! flex-col overflow-hidden sm:w-[var(--panneau-registre-width)]! sm:min-w-[360px]! sm:max-w-[90vw]!\"\n >\n <button\n type=\"button\"\n aria-label={labels.resizeHandle}\n className=\"absolute inset-y-0 left-0 hidden w-1.5 cursor-col-resize touch-none bg-transparent hover:bg-border sm:block\"\n onPointerDown={onHandlePointerDown}\n />\n <Drawer.Header className=\"flex shrink-0 flex-row items-center justify-between gap-3\">\n <p className=\"min-w-0 truncate text-sm text-muted-foreground\">{contexte}</p>\n <div className=\"flex shrink-0 flex-row items-center gap-2\">\n {headerActions}\n <Drawer.CloseTrigger aria-label={labels.close} />\n </div>\n </Drawer.Header>\n {children}\n <Drawer.Footer className=\"flex shrink-0 flex-row items-center justify-end gap-2\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n isIconOnly\n aria-label={labels.previousRow}\n isDisabled={prevDisabled}\n onPress={onPrev}\n >\n <ChevronUp className=\"h-4 w-4\" aria-hidden=\"true\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n isIconOnly\n aria-label={labels.nextRow}\n isDisabled={nextDisabled}\n onPress={onNext}\n >\n <ChevronDown className=\"h-4 w-4\" aria-hidden=\"true\" />\n </Button>\n </Drawer.Footer>\n </Drawer.Dialog>\n </Drawer.Content>\n </Drawer.Backdrop>\n </Drawer>\n );\n}\n"
30
+ },
31
+ {
32
+ "path": "src/components/registre/RegistreEcran.tsx",
33
+ "type": "registry:ui",
34
+ "content": "/**\n * RegistreEcran — the shared chrome of a registry screen: the fullscreen section\n * wrapper, the Escape / body-scroll-lock behaviour, and the toolbar scaffold — a\n * global search, the column chooser and the fullscreen toggle.\n *\n * It OWNS the fullscreen state (the one behaviour every registry screen wants\n * identically) and leaves the data region to `children`: a screen keeps its own\n * loading / empty / error states and its own grid (GrilleRegistre) beneath the\n * toolbar. Search and column visibility are CONTROLLED by the host, so a host\n * can keep them above a period selector and a period change resets neither.\n */\nimport { Button, SearchField, Toolbar } from \"@heroui/react\";\nimport { Maximize2, Minimize2 } from \"lucide-react\";\nimport { type ReactNode, useEffect, useState } from \"react\";\nimport { ChoixColonnes, type ChoixColonnesLabels } from \"./ChoixColonnes.js\";\nimport type { ColonneChoisie, EtatVisibilite } from \"./colonnes.js\";\n\nexport interface RegistreEcranLabels extends ChoixColonnesLabels {\n searchPlaceholder: string;\n searchAriaLabel: string;\n enterFullscreen: string;\n exitFullscreen: string;\n}\n\nexport interface RegistreEcranProps {\n /** Section landmark label. */\n ariaLabel: string;\n labels: RegistreEcranLabels;\n /** The columns the chooser offers. */\n colonnes: readonly ColonneChoisie[];\n visibilite: EtatVisibilite;\n onBasculerColonne: (champ: string) => void;\n /** Display transform of a column label in the chooser; identity when omitted. */\n formatLibelleColonne?: (libelle: string) => string;\n /** Global search text, owned by the host. */\n filtreGlobal: string;\n onFiltreGlobalChange: (valeur: string) => void;\n /** Rendered at the start of the toolbar (e.g. a period selector). */\n avantRecherche?: ReactNode;\n /** Rendered after the chooser, before the fullscreen toggle (e.g. « add »). */\n actionsToolbar?: ReactNode;\n /** The data region: the screen's loading / empty / error states and grid. */\n children: ReactNode;\n}\n\n// Not user-facing text. Kept as an object-literal constant with the marker BETWEEN\n// properties: esbuild strips a statement-level `//` comment, never this one.\nconst CSS_SELECTORS = {\n // allow-hardcoded-word: a CSS attribute selector (HeroUI data-slot names), not user-facing text\n openOverlay: \"[data-slot=select-popover], [data-slot=popover-dialog]\",\n};\n\nexport function RegistreEcran({\n ariaLabel,\n labels,\n colonnes,\n visibilite,\n onBasculerColonne,\n formatLibelleColonne,\n filtreGlobal,\n onFiltreGlobalChange,\n avantRecherche,\n actionsToolbar,\n children,\n}: RegistreEcranProps) {\n const [fullScreen, setFullScreen] = useState(false);\n\n // Escape leaves fullscreen and the page behind must not scroll; an open HeroUI\n // overlay (a select list, a popover) takes Escape first.\n useEffect(() => {\n if (!fullScreen) return;\n const onKeyDown = (e: KeyboardEvent) => {\n if (document.querySelector(CSS_SELECTORS.openOverlay)) return;\n if (e.key === \"Escape\") setFullScreen(false);\n };\n const previousOverflow = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n window.addEventListener(\"keydown\", onKeyDown);\n return () => {\n window.removeEventListener(\"keydown\", onKeyDown);\n document.body.style.overflow = previousOverflow;\n };\n }, [fullScreen]);\n\n return (\n <section\n aria-label={ariaLabel}\n data-fullscreen={fullScreen ? \"true\" : undefined}\n // Same element in both modes so the grid keeps its sort, filters and scroll.\n className={\n fullScreen\n ? \"fixed inset-0 z-40 flex flex-col gap-4 bg-background p-4\"\n : // Phones let the page scroll so content above cannot squeeze the grid to nothing.\n \"flex min-h-[70vh] flex-1 flex-col gap-4 sm:min-h-0\"\n }\n >\n <div className=\"shrink-0\">\n <Toolbar className=\"flex flex-wrap items-center gap-2\">\n {avantRecherche}\n <SearchField\n value={filtreGlobal}\n onChange={onFiltreGlobalChange}\n aria-label={labels.searchAriaLabel}\n className=\"w-full sm:w-auto\"\n >\n <SearchField.Group className=\"h-10 min-w-64\">\n <SearchField.SearchIcon />\n {/* text-base on mobile avoids iOS Safari zoom-on-focus under 16px */}\n <SearchField.Input\n placeholder={labels.searchPlaceholder}\n className=\"text-base sm:text-sm\"\n />\n <SearchField.ClearButton />\n </SearchField.Group>\n </SearchField>\n <ChoixColonnes\n colonnes={colonnes}\n visibilite={visibilite}\n onBasculer={onBasculerColonne}\n labels={labels}\n formatLibelle={formatLibelleColonne}\n />\n {actionsToolbar}\n <Button\n variant=\"outline\"\n size=\"sm\"\n aria-pressed={fullScreen}\n onPress={() => setFullScreen((f) => !f)}\n >\n {fullScreen ? (\n <Minimize2 aria-hidden className=\"size-4\" />\n ) : (\n <Maximize2 aria-hidden className=\"size-4\" />\n )}\n {fullScreen ? labels.exitFullscreen : labels.enterFullscreen}\n </Button>\n </Toolbar>\n </div>\n\n {children}\n </section>\n );\n}\n"
35
+ },
36
+ {
37
+ "path": "src/components/registre/RegistreLigneDetail.tsx",
38
+ "type": "registry:ui",
39
+ "content": "/**\n * RegistreLigneDetail — the per-field detail of one registry row, driven by the\n * column declaration (ColonneRegistre).\n *\n * A field declared `editable` carries a pencil; a non-editable field reads the\n * host's « computed » label; a corrected field shows the host's correction line\n * (who, when, previous value). The edit is one path — `onSaveField(champ, saisie)`\n * — the same the grid cell uses. A number is edited with the host's decimal\n * separator, the format the host's validator parses.\n */\nimport { Pencil } from \"lucide-react\";\nimport { type FormEvent, type KeyboardEvent, useState } from \"react\";\nimport type { ColonneRegistre } from \"./colonnes.js\";\n\n/** The correction trace a row carries per field. */\nexport interface CorrectionChamp {\n par: string;\n leMs: number;\n valeurAvant: string | number | null;\n}\n\nexport interface RegistreLigneDetailLabels {\n /** Accessible name of a field's pencil button. */\n edit: (libelle: string) => string;\n /** Accessible name of a field's editor input. */\n fieldInput: (colonne: ColonneRegistre) => string;\n /** Shown on a non-editable field. */\n computed: string;\n save: string;\n cancel: string;\n /** The correction line of a corrected field (the host formats the date and an empty value). */\n correction: (correction: CorrectionChamp) => string;\n}\n\nexport interface RegistreLigneDetailProps {\n colonnes: readonly ColonneRegistre[];\n /** The row, read generically by field key. */\n ligne: Readonly<Record<string, string | number | null>>;\n /** Per-field correction trace, keyed by `champ`. */\n corrections?: Readonly<Record<string, CorrectionChamp | undefined>>;\n labels: RegistreLigneDetailLabels;\n /** Renders a `montant` field. */\n formatMontant: (value: number) => string;\n /** Renders a `nombre` or `entier` field. */\n formatNombre: (value: number) => string;\n /** The decimal separator a number is edited with. */\n decimalSeparator: string;\n onSaveField: (champ: string, saisie: string) => Promise<boolean>;\n}\n\nfunction editValue(value: string | number | null, decimalSeparator: string): string {\n if (value == null) return \"\";\n return typeof value === \"number\" ? String(value).replace(\".\", decimalSeparator) : value;\n}\n\nfunction FieldEditor({\n col,\n initial,\n labels,\n onSave,\n onCancel,\n}: {\n col: ColonneRegistre;\n initial: string;\n labels: RegistreLigneDetailLabels;\n onSave: (saisie: string) => Promise<void>;\n onCancel: () => void;\n}) {\n const [draft, setDraft] = useState(initial);\n const [saving, setSaving] = useState(false);\n const inputId = `registre-field-${col.champ}`;\n const label = labels.fieldInput(col);\n\n async function submit(e: FormEvent) {\n e.preventDefault();\n setSaving(true);\n await onSave(draft);\n setSaving(false);\n }\n\n function onKeyDown(e: KeyboardEvent) {\n if (e.key === \"Escape\") {\n e.stopPropagation();\n onCancel();\n }\n }\n\n const inputClass =\n \"h-8 min-w-0 flex-1 rounded-md border border-border bg-background px-2 text-base sm:text-sm\";\n\n return (\n <form onSubmit={submit} onKeyDown={onKeyDown} className=\"flex flex-wrap items-center gap-2\">\n {col.valeurs ? (\n <select\n id={inputId}\n aria-label={label}\n value={draft}\n onChange={(e) => setDraft(e.target.value)}\n className={inputClass}\n >\n <option value=\"\">—</option>\n {col.valeurs.map((v) => (\n <option key={v} value={v}>\n {v}\n </option>\n ))}\n </select>\n ) : (\n <input\n id={inputId}\n aria-label={label}\n value={draft}\n onChange={(e) => setDraft(e.target.value)}\n // biome-ignore lint/a11y/noAutofocus: the field was opened on purpose by the pencil\n autoFocus\n className={inputClass}\n />\n )}\n <button\n type=\"submit\"\n disabled={saving}\n className=\"h-8 rounded-md bg-primary px-3 text-sm text-primary-foreground disabled:opacity-50\"\n >\n {labels.save}\n </button>\n <button\n type=\"button\"\n onClick={onCancel}\n className=\"h-8 rounded-md border border-border px-3 text-sm\"\n >\n {labels.cancel}\n </button>\n </form>\n );\n}\n\n// allow-undeclared-theme-token: `default` is a HeroUI theme token; these blocks require @heroui/react and its styles.\nconst PENCIL_CLASS =\n \"inline-flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-default hover:text-foreground\";\n\nexport function RegistreLigneDetail({\n colonnes,\n ligne,\n corrections,\n labels,\n formatMontant,\n formatNombre,\n decimalSeparator,\n onSaveField,\n}: RegistreLigneDetailProps) {\n const [editing, setEditing] = useState<string | null>(null);\n\n function displayValue(col: ColonneRegistre, value: string | number | null): string {\n if (value == null || value === \"\") return \"\";\n if (col.type === \"montant\") return formatMontant(Number(value));\n if (col.type === \"nombre\" || col.type === \"entier\") return formatNombre(Number(value));\n return String(value);\n }\n\n return (\n <dl className=\"divide-y divide-border rounded-md border border-border\">\n {colonnes.map((col) => {\n const value = ligne[col.champ] ?? null;\n const correction = corrections?.[col.champ];\n return (\n <div\n key={col.champ}\n data-field={col.champ}\n className={`grid gap-1 px-3 py-2 sm:grid-cols-[11rem_1fr] sm:gap-3 ${correction ? \"bg-amber-50 dark:bg-amber-950/30\" : \"\"}`}\n >\n <dt className=\"text-muted-foreground\">\n {col.libelle} <span className=\"text-xs\">· {col.lettre}</span>\n </dt>\n <dd className=\"flex min-w-0 flex-col gap-1\">\n {editing === col.champ ? (\n <FieldEditor\n col={col}\n initial={editValue(value, decimalSeparator)}\n labels={labels}\n onCancel={() => setEditing(null)}\n onSave={async (saisie) => {\n if (await onSaveField(col.champ, saisie)) setEditing(null);\n }}\n />\n ) : (\n <div className=\"flex items-center justify-between gap-2\">\n <span className=\"min-w-0 break-words tabular-nums\">\n {displayValue(col, value)}\n </span>\n {col.editable ? (\n <button\n type=\"button\"\n aria-label={labels.edit(col.libelle)}\n onClick={() => setEditing(col.champ)}\n className={PENCIL_CLASS}\n >\n <Pencil className=\"size-3.5\" aria-hidden=\"true\" />\n </button>\n ) : (\n <span className=\"shrink-0 text-xs text-muted-foreground\">\n {labels.computed}\n </span>\n )}\n </div>\n )}\n {correction && (\n <p className=\"text-xs text-amber-800 dark:text-amber-300\">\n {labels.correction(correction)}\n </p>\n )}\n </dd>\n </div>\n );\n })}\n </dl>\n );\n}\n"
40
+ },
41
+ {
42
+ "path": "src/components/registre/colonnes.ts",
43
+ "type": "registry:ui",
44
+ "content": "/**\n * The column/field declaration a registry screen supplies. It is DATA, never a\n * code branch: the grid, the column chooser and the per-field edit all read it,\n * so a new registry screen declares its columns without touching a component.\n */\nexport type TypeColonneRegistre = \"texte\" | \"nombre\" | \"entier\" | \"montant\";\n\nexport interface ColonneRegistre {\n /** The key of the field on the row (technical identity). */\n champ: string;\n /** The source column letter, shown in the chooser and the panel. */\n lettre: string;\n /** The displayed label. */\n libelle: string;\n /** Drives formatting: the panel renders a number per this type. */\n type: TypeColonneRegistre;\n /** true = pencil + edit; false = the host's « computed » label. */\n editable: boolean;\n /** Optional closed set of a choice field, rendered as a menu. */\n valeurs?: readonly string[];\n /** Optional minimum width hint for the grid column. */\n largeurMin?: number;\n}\n\n/** The columns a chooser offers: only identity and label are needed. */\nexport interface ColonneChoisie {\n champ: string;\n lettre: string;\n libelle: string;\n}\n\n/** Which columns the user wants to see. true = visible; an absent field reads as visible. */\nexport type EtatVisibilite = Readonly<Record<string, boolean>>;\n\nexport function estVisible(etat: EtatVisibilite, champ: string): boolean {\n return etat[champ] !== false;\n}\n"
45
+ },
46
+ {
47
+ "path": "src/components/registre/grid-theme.ts",
48
+ "type": "registry:ui",
49
+ "content": "/**\n * The default AG Grid theme of a registry grid (GrilleRegistre), on AG Grid's\n * Theming API (no `ag-theme-*` class). Every colour is a HeroUI theme variable:\n * the registry blocks are built on HeroUI, so a host rendering them already\n * ships those variables. A host with its own brand passes its own theme through\n * GrilleRegistre's `theme` prop instead.\n */\nimport type { SizeColumnsToFitGridStrategy } from \"ag-grid-community\";\nimport { themeQuartz } from \"ag-grid-community\";\n\nexport const registreGridTheme = themeQuartz.withParams({\n accentColor: \"var(--accent)\",\n backgroundColor: \"var(--surface)\",\n foregroundColor: \"var(--foreground)\",\n textColor: \"var(--foreground)\",\n borderColor: \"var(--border)\",\n headerBackgroundColor: \"var(--surface-secondary)\",\n headerTextColor: \"var(--surface-secondary-foreground)\",\n headerFontWeight: 600,\n fontFamily: \"var(--font-sans)\",\n fontSize: 14,\n headerFontSize: 13,\n rowHeight: 40,\n headerHeight: 44,\n spacing: 8,\n wrapperBorderRadius: 8,\n rowHoverColor: \"var(--surface-hover)\",\n // No `selectedRowBackgroundColor`: the grid does not use the native AG Grid row\n // selection. A host highlights its selected row through `getRowStyle`.\n});\n\n/** Columns fill the grid's width instead of leaving a blank strip on the right. */\nexport const fitGridWidthStrategy: SizeColumnsToFitGridStrategy = {\n type: \"fitGridWidth\",\n};\n\n/** fitGridWidth sizes once; refit whenever the grid's width changes (pass to `onGridSizeChanged`). */\nexport function refitColumns(e: { api: { sizeColumnsToFit: () => void } }): void {\n e.api.sizeColumnsToFit();\n}\n"
50
+ }
51
+ ],
52
+ "type": "registry:ui"
53
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-hero-split",
4
+ "title": "MosaicHeroSplit",
5
+ "description": "Two-column split hero: copy left, media right. Props: eyebrow, title, subtitle, cta, ctaSecondary, media. Falls back to centered single-column when no media.",
6
+ "dependencies": [],
7
+ "registryDependencies": [],
8
+ "files": [
9
+ {
10
+ "path": "src/components/hero-split/MosaicHeroSplit.tsx",
11
+ "type": "registry:ui",
12
+ "content": "/**\n * MosaicHeroSplit — split hero section\n *\n * Ported from heyfabrika/styleui components/templates/axis/hero.tsx (MIT).\n * Adapted: fully props-driven, no hardcoded copy/images/branding.\n * Motion: CSS fade-up via Tailwind animate utilities (@keyframes in globals).\n * Media slot: accepts any React node (image, illustration, video, etc.).\n */\n\nimport type * as React from \"react\";\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\nexport interface HeroCta {\n label: string;\n href: string;\n}\n\nexport interface MosaicHeroSplitProps {\n /** Small badge text above the title */\n eyebrow?: string;\n /** Main heading — the primary message */\n title: React.ReactNode;\n /** Supporting paragraph */\n subtitle: React.ReactNode;\n /** Primary CTA */\n cta?: HeroCta;\n /** Secondary CTA */\n ctaSecondary?: HeroCta;\n /** Right-column media slot — accepts img, video, SVG, or any node */\n media?: 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 * MosaicHeroSplit — two-column hero: copy on left, media on right.\n * Falls back to centered single-column when no media provided.\n *\n * @example\n * <MosaicHeroSplit\n * eyebrow=\"New\"\n * title=\"The platform built for modern teams\"\n * subtitle=\"Ship faster, collaborate smarter.\"\n * cta={{ label: \"Start free\", href: \"/signup\" }}\n * media={<img src=\"/hero.png\" alt=\"Product screenshot\" className=\"w-full rounded-2xl\" />}\n * />\n */\nexport function MosaicHeroSplit({\n eyebrow,\n title,\n subtitle,\n cta,\n ctaSecondary,\n media,\n className,\n ref,\n}: MosaicHeroSplitProps) {\n return (\n <section\n ref={ref}\n className={cn(\n \"flex flex-col gap-16 items-center justify-center py-8 lg:pt-16 px-4\",\n className,\n )}\n >\n <div className=\"flex flex-col lg:flex-row items-center justify-between w-full gap-8 max-w-6xl mx-auto\">\n {/* Copy */}\n <div className=\"flex flex-col gap-6 lg:max-w-xl\">\n {eyebrow && (\n <span className=\"inline-flex w-fit items-center rounded-full border border-[oklch(0.85_0.01_250)] bg-[oklch(0.97_0.005_250)] px-3 py-1 text-xs font-semibold tracking-wide text-[oklch(0.4_0.02_250)] uppercase\">\n {eyebrow}\n </span>\n )}\n <h1 className=\"text-3xl md:text-5xl lg:text-6xl font-medium tracking-tighter text-center lg:text-left text-[oklch(0.12_0.01_250)]\">\n {title}\n </h1>\n <p className=\"text-base md:text-lg text-center lg:text-left text-[oklch(0.45_0.01_250)] leading-relaxed\">\n {subtitle}\n </p>\n {(cta ?? ctaSecondary) && (\n <div className=\"flex flex-row flex-wrap gap-3 justify-center lg:justify-start\">\n {cta && (\n <a\n href={cta.href}\n className=\"inline-flex items-center justify-center rounded-full bg-[oklch(0.15_0.01_250)] px-6 py-2.5 text-sm font-medium text-[oklch(0.98_0_0)] transition-colors hover:bg-[oklch(0.25_0.01_250)]\"\n >\n {cta.label}\n </a>\n )}\n {ctaSecondary && (\n <a\n href={ctaSecondary.href}\n className=\"inline-flex items-center justify-center rounded-full border border-[oklch(0.75_0.01_250)] bg-transparent px-6 py-2.5 text-sm font-medium text-[oklch(0.15_0.01_250)] transition-colors hover:bg-[oklch(0.96_0.005_250)]\"\n >\n {ctaSecondary.label}\n </a>\n )}\n </div>\n )}\n </div>\n\n {/* Media slot */}\n {media && <div className=\"w-full lg:max-w-lg xl:max-w-2xl flex-shrink-0\">{media}</div>}\n </div>\n </section>\n );\n}\n\nMosaicHeroSplit.displayName = \"MosaicHeroSplit\";\n"
13
+ }
14
+ ],
15
+ "type": "registry:ui"
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-input-group",
4
+ "title": "MosaicInputGroup",
5
+ "description": "Composition wrapper laying out prefix/suffix addons around an input. data-slot=\"input-group\".",
6
+ "dependencies": [],
7
+ "registryDependencies": [],
8
+ "files": [
9
+ {
10
+ "path": "src/components/input-group/MosaicInputGroup.tsx",
11
+ "type": "registry:ui",
12
+ "content": "/**\n * MosaicInputGroup — composition wrapper for MosaicInput with addons\n *\n * Lays out an optional prefix addon + children (MosaicInput) + optional suffix\n * horizontally. Plain <div> wrapper — no base-ui primitive needed.\n * data-slot=\"input-group\".\n *\n * Design tokens: Tailwind v4 semantic classes only.\n */\n\nimport type * as React from \"react\";\n\n// ── Utility ───────────────────────────────────────────────────────────────────\n\nfunction cn(...classes: (string | undefined | null | false)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\n// Omit 'prefix' from HTMLAttributes because the DOM attribute is `string | undefined`\n// but our `prefix` prop accepts any ReactNode.\nexport interface MosaicInputGroupProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"prefix\"> {\n /** Element rendered before the input (icon, text addon, etc.) */\n prefix?: React.ReactNode;\n /** Element rendered after the input (icon, text addon, etc.) */\n suffix?: React.ReactNode;\n className?: string;\n children: React.ReactNode;\n ref?: React.Ref<HTMLDivElement>;\n}\n\n/**\n * MosaicInputGroup — wraps MosaicInput with optional prefix/suffix addons.\n *\n * @example\n * <MosaicInputGroup prefix={<SearchIcon />}>\n * <MosaicInput placeholder=\"Search…\" />\n * </MosaicInputGroup>\n *\n * <MosaicInputGroup\n * prefix={<span>https://</span>}\n * suffix={<span>.com</span>}\n * >\n * <MosaicInput placeholder=\"yoursite\" />\n * </MosaicInputGroup>\n */\nexport function MosaicInputGroup({\n prefix,\n suffix,\n className,\n children,\n ref,\n ...props\n}: MosaicInputGroupProps) {\n return (\n <div\n ref={ref}\n data-slot=\"input-group\"\n className={cn(\"flex items-center\", className)}\n {...props}\n >\n {prefix ? (\n <div\n data-slot=\"input-group-prefix\"\n className=\"flex shrink-0 items-center text-sm text-muted-foreground\"\n >\n {prefix}\n </div>\n ) : null}\n <div className=\"min-w-0 flex-1\">{children}</div>\n {suffix ? (\n <div\n data-slot=\"input-group-suffix\"\n className=\"flex shrink-0 items-center text-sm text-muted-foreground\"\n >\n {suffix}\n </div>\n ) : null}\n </div>\n );\n}\n\nMosaicInputGroup.displayName = \"MosaicInputGroup\";\n"
13
+ }
14
+ ],
15
+ "type": "registry:ui"
16
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-input",
4
+ "title": "MosaicInput",
5
+ "description": "Text input built on @base-ui/react/input. Forwards ref to native input. data-slot=\"input\".",
6
+ "dependencies": [
7
+ "@base-ui/react"
8
+ ],
9
+ "registryDependencies": [],
10
+ "files": [
11
+ {
12
+ "path": "src/components/input/MosaicInput.tsx",
13
+ "type": "registry:ui",
14
+ "content": "/**\n * MosaicInput — built on @base-ui/react/input\n *\n * Uses the Input primitive from @base-ui/react/input which renders a native\n * <input> element with Field integration and ref-as-prop (React 19).\n * data-slot=\"input\".\n *\n * Design tokens: Tailwind v4 semantic classes (bg-background, border-border,\n * text-foreground, ring-ring). No hardcoded colors.\n */\n\nimport { Input as InputPrimitive } from \"@base-ui/react/input\";\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// ── Component ─────────────────────────────────────────────────────────────────\n\nexport interface MosaicInputProps extends InputPrimitive.Props {\n className?: string;\n}\n\n/**\n * MosaicInput — accessible text input built on @base-ui/react Input.\n *\n * Forwards ref to the underlying <input> element.\n * Accepts all standard input props plus className.\n *\n * @example\n * <MosaicInput placeholder=\"Search…\" />\n * <MosaicInput type=\"email\" value={email} onChange={handleChange} />\n */\nexport function MosaicInput({ className, ref, ...props }: MosaicInputProps) {\n return (\n <InputPrimitive\n ref={ref as React.Ref<HTMLElement>}\n data-slot=\"input\"\n className={cn(\n \"flex h-9 w-full rounded-md border border-border bg-background px-3 py-1\",\n \"text-sm text-foreground shadow-xs\",\n \"placeholder:text-muted-foreground\",\n \"outline-none transition-colors\",\n \"focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/20\",\n \"disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n />\n );\n}\n\nMosaicInput.displayName = \"MosaicInput\";\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-integrations-badge",
4
+ "title": "MosaicIntegrationsBadge",
5
+ "description": "Integration badge/pill with logo slot + label. Renders as <a> when href provided. Props: label, logo?, href?, target?. OKLCH theme-reactive. No hardcoded branding.",
6
+ "dependencies": [],
7
+ "registryDependencies": [],
8
+ "files": [
9
+ {
10
+ "path": "src/components/integrations-badge/MosaicIntegrationsBadge.tsx",
11
+ "type": "registry:ui",
12
+ "content": "/**\n * MosaicIntegrationsBadge — integration badge / pill\n *\n * Ported from heyfabrika/styleui components/integrations-badge (MIT).\n * Props-driven: logo slot (ReactNode), label string, optional href.\n * Theme-reactive via OKLCH CSS variables; no hardcoded branding colors.\n * Zero extra deps — pure HTML/CSS.\n */\n\nimport type * as React from \"react\";\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\nexport interface MosaicIntegrationsBadgeProps {\n /** Badge label text (e.g. \"Stripe\", \"GitHub\") */\n label: string;\n /** Optional logo/icon slot — use <img>, <svg>, or any ReactNode */\n logo?: React.ReactNode;\n /** When provided, renders the badge as an <a> tag */\n href?: string;\n /** Link target (default \"_blank\" for external links) */\n target?: React.HTMLAttributeAnchorTarget;\n className?: string;\n ref?: React.Ref<HTMLAnchorElement & HTMLSpanElement>;\n}\n\n// ── Utility ──────────────────────────────────────────────────────────────────\n\nfunction cn(...classes: (string | undefined | null | false)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n\n// ── Shared styles ─────────────────────────────────────────────────────────────\n\nconst badgeClass =\n \"inline-flex items-center gap-2 rounded-full border border-[oklch(0.88_0.01_250)] bg-[oklch(0.98_0.005_250)] px-3 py-1.5 text-sm font-medium text-[oklch(0.25_0.01_250)] shadow-[0_1px_3px_oklch(0_0_0_/_0.06)] transition-colors\";\n\nconst hoverClass =\n \"hover:border-[oklch(0.8_0.01_250)] hover:bg-[oklch(0.96_0.005_250)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[oklch(0.5_0.15_250)]\";\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\n/**\n * MosaicIntegrationsBadge — pill-shaped badge showing a logo + label.\n * Renders as `<a>` when `href` is provided.\n *\n * @example\n * <MosaicIntegrationsBadge\n * label=\"Stripe\"\n * logo={<img src=\"/stripe-logo.svg\" alt=\"\" width={16} height={16} />}\n * href=\"https://stripe.com\"\n * />\n */\nexport function MosaicIntegrationsBadge({\n label,\n logo,\n href,\n target = \"_blank\",\n className,\n ref,\n}: MosaicIntegrationsBadgeProps) {\n const inner = (\n <>\n {logo && <span className=\"flex shrink-0 items-center\">{logo}</span>}\n <span>{label}</span>\n </>\n );\n\n if (href) {\n return (\n <a\n ref={ref as React.Ref<HTMLAnchorElement>}\n href={href}\n target={target}\n rel={target === \"_blank\" ? \"noopener noreferrer\" : undefined}\n className={cn(badgeClass, hoverClass, className)}\n >\n {inner}\n </a>\n );\n }\n\n return (\n <span ref={ref as React.Ref<HTMLSpanElement>} className={cn(badgeClass, className)}>\n {inner}\n </span>\n );\n}\n\nMosaicIntegrationsBadge.displayName = \"MosaicIntegrationsBadge\";\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-kanban-board",
4
+ "title": "MosaicKanbanBoard",
5
+ "description": "MosaicKanbanBoard — horizontal scrollable kanban board container.",
6
+ "dependencies": [],
7
+ "registryDependencies": [],
8
+ "files": [
9
+ {
10
+ "path": "src/components/kanban/MosaicKanbanBoard.tsx",
11
+ "type": "registry:ui",
12
+ "content": "/**\n * MosaicKanbanBoard — horizontal scrollable kanban board container.\n *\n * Presentational container — columns are caller-provided children.\n * No drag-drop logic, no data fetching, no \"use client\" directive.\n * data-slot=\"kanban-board\" for composability and testing.\n *\n * Design tokens: Tailwind v4 semantic classes only. No hardcoded colors.\n *\n * @example\n * <MosaicKanbanBoard>\n * <MosaicKanbanColumn title=\"À faire\" count={3}>\n * <TaskCard />\n * </MosaicKanbanColumn>\n * <MosaicKanbanColumn title=\"En cours\" count={1}>\n * <TaskCard />\n * </MosaicKanbanColumn>\n * </MosaicKanbanBoard>\n */\n\nimport type * as React from \"react\";\n\n// ── Utility ───────────────────────────────────────────────────────────────────\n\nfunction cn(...classes: (string | undefined | null | false)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\nexport interface MosaicKanbanBoardProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Kanban columns (MosaicKanbanColumn elements). */\n children: React.ReactNode;\n className?: string;\n ref?: React.Ref<HTMLDivElement>;\n}\n\n/**\n * MosaicKanbanBoard — horizontal-scroll flex row of kanban columns.\n *\n * Replaces TaskBoard / MandateBoard / MissionBoard in the VP shell.\n * Pure presentational — columns and cards are caller-owned children.\n *\n * @example\n * <MosaicKanbanBoard>\n * <MosaicKanbanColumn title=\"Backlog\" count={5}>…</MosaicKanbanColumn>\n * <MosaicKanbanColumn title=\"In Progress\" count={2}>…</MosaicKanbanColumn>\n * <MosaicKanbanColumn title=\"Done\" count={12}>…</MosaicKanbanColumn>\n * </MosaicKanbanBoard>\n */\nexport function MosaicKanbanBoard({ children, className, ref, ...props }: MosaicKanbanBoardProps) {\n return (\n <div\n ref={ref}\n data-slot=\"kanban-board\"\n className={cn(\n \"flex gap-4 overflow-x-auto pb-4\",\n \"min-h-0\",\n // Smooth momentum scrolling on iOS\n \"[scroll-behavior:smooth]\",\n className,\n )}\n {...props}\n >\n {children}\n </div>\n );\n}\n\nMosaicKanbanBoard.displayName = \"MosaicKanbanBoard\";\n"
13
+ },
14
+ {
15
+ "path": "src/components/kanban/MosaicKanbanColumn.tsx",
16
+ "type": "registry:ui",
17
+ "content": "/**\n * MosaicKanbanColumn — vertical column within a MosaicKanbanBoard.\n *\n * Presentational container — cards are caller-provided children.\n * Renders: header (title + optional count badge + optional trailing actions)\n * scrollable card stack (children)\n * optional footer (e.g. \"load more\" / Convex paginate trigger)\n *\n * No drag-drop logic, no data fetching, no \"use client\" directive.\n * data-slot=\"kanban-column\" for composability and testing.\n *\n * Design tokens: Tailwind v4 semantic classes only (border-border, bg-muted,\n * text-muted-foreground, bg-background). No hardcoded colors.\n *\n * i18n: `countLabel` is a REQUIRED prop — the host owns the language (e.g.\n * next-intl `t()`). No English default, no fallback lives in this component.\n *\n * @example\n * // Host owns i18n (e.g. next-intl) — countLabel is always a required prop.\n * <MosaicKanbanColumn\n * title=\"To Do\"\n * count={3}\n * countLabel={(n) => t('Kanban.itemCount', { count: n })}\n * >\n * <TaskCard task={task} />\n * </MosaicKanbanColumn>\n *\n * // French host\n * <MosaicKanbanColumn\n * title=\"À faire\"\n * count={3}\n * countLabel={(n) => `${n} éléments`}\n * headerActions={<button aria-label={t('Kanban.aria.addTask')}>+</button>}\n * footer={<button>{t('Kanban.loadMore')}</button>}\n * >\n * <TaskCard task={task} />\n * </MosaicKanbanColumn>\n */\n\nimport type * as React from \"react\";\n\n// ── Utility ───────────────────────────────────────────────────────────────────\n\nfunction cn(...classes: (string | undefined | null | false)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\nexport interface MosaicKanbanColumnProps {\n /** Column heading — caller-provided; can be a string or any ReactNode. */\n title: React.ReactNode;\n /** Optional item count rendered as a badge in the header. */\n count?: number;\n /** Optional trailing slot in the header (e.g. add-task button). */\n headerActions?: React.ReactNode;\n /** Card children — caller-owned. */\n children: React.ReactNode;\n /** Optional footer slot (e.g. \"Load more\" / Convex pagination button). */\n footer?: React.ReactNode;\n /**\n * Formatter for the count badge aria-label. Required — the host owns the\n * language (e.g. FR: `(n) => \\`${n} éléments\\``). No default, no fallback.\n */\n countLabel: (count: number) => string;\n className?: string;\n ref?: React.Ref<HTMLElement>;\n}\n\n/**\n * MosaicKanbanColumn — single column within MosaicKanbanBoard.\n *\n * Replaces TaskColumn / MandateColumn in the VP shell.\n * The column is a fixed-width, shrink-0 card with a scrollable body.\n * Title and labels are caller-provided — no hardcoded English strings.\n *\n * @example\n * <MosaicKanbanColumn title=\"En cours\" count={2} countLabel={(n) => `${n} éléments`}>\n * <TaskCard />\n * </MosaicKanbanColumn>\n */\nexport function MosaicKanbanColumn({\n title,\n count,\n headerActions,\n children,\n footer,\n countLabel,\n className,\n ref,\n}: MosaicKanbanColumnProps) {\n return (\n <section\n ref={ref}\n data-slot=\"kanban-column\"\n className={cn(\n // Fixed column width, never shrink so board stays scrollable\n \"flex flex-col w-72 shrink-0\",\n // Surface\n \"rounded-lg border border-border bg-muted/30\",\n className,\n )}\n >\n {/* ── Header ─────────────────────────────────────────────────────── */}\n <div\n data-slot=\"kanban-column-header\"\n className=\"flex items-center justify-between gap-2 px-3 py-2.5 border-b border-border\"\n >\n <div className=\"flex items-center gap-2 min-w-0\">\n <span className=\"text-sm font-semibold text-foreground truncate\">{title}</span>\n {count !== undefined && (\n <span\n data-slot=\"kanban-column-count\"\n aria-label={countLabel(count)}\n className={cn(\n \"inline-flex items-center justify-center\",\n \"min-w-[1.25rem] h-5 px-1.5 rounded-full\",\n \"bg-muted text-muted-foreground\",\n \"text-xs font-medium tabular-nums\",\n \"select-none\",\n )}\n >\n {count}\n </span>\n )}\n </div>\n {headerActions && (\n <div\n data-slot=\"kanban-column-header-actions\"\n className=\"flex items-center gap-1 shrink-0\"\n >\n {headerActions}\n </div>\n )}\n </div>\n\n {/* ── Card stack ─────────────────────────────────────────────────── */}\n <div\n data-slot=\"kanban-column-body\"\n className=\"flex flex-col gap-2 p-2 overflow-y-auto flex-1 min-h-0\"\n >\n {children}\n </div>\n\n {/* ── Footer (optional) ──────────────────────────────────────────── */}\n {footer && (\n <div\n data-slot=\"kanban-column-footer\"\n className=\"px-3 py-2 border-t border-border text-sm text-muted-foreground\"\n >\n {footer}\n </div>\n )}\n </section>\n );\n}\n\nMosaicKanbanColumn.displayName = \"MosaicKanbanColumn\";\n"
18
+ }
19
+ ],
20
+ "type": "registry:ui"
21
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-logos-grid",
4
+ "title": "MosaicLogosGrid",
5
+ "description": "Logo cloud / partner logos grid. Props: logos[] {name, src, width, height}, heading. Grayscale hover effect. Optional stagger-motion variant: pass stagger=true or stagger=80 for CSS keyframe staggered reveal; respects prefers-reduced-motion.",
6
+ "dependencies": [],
7
+ "registryDependencies": [],
8
+ "files": [
9
+ {
10
+ "path": "src/components/logos-grid/MosaicLogosGrid.tsx",
11
+ "type": "registry:ui",
12
+ "content": "/**\n * MosaicLogosGrid — logo cloud / partner logos grid\n *\n * Ported from heyfabrika/styleui blocks/logo-cloud.tsx (MIT).\n * Adapted: fully props-driven logos array (name, src, width, height).\n * No next/image dependency (lib-portable), uses native <img> with role.\n * No motion/react dependency — CSS opacity transition only.\n *\n * T4 addition: opt-in `stagger` prop for staggered reveal animation.\n * The `mosaic-logo-in` keyframe ships statically in styles.css (no runtime injection).\n * Requires importing `@vantageos/mosaic-blocks/styles.css`. Respects prefers-reduced-motion.\n */\n\nimport type * as React from \"react\";\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\nexport interface LogoItem {\n /** Alt text / brand name */\n name: string;\n /** Image src URL */\n src: string;\n /** Optional explicit width (defaults to 80) */\n width?: number;\n /** Optional explicit height (defaults to 80) */\n height?: number;\n}\n\nexport interface MosaicLogosGridProps {\n /** Array of logos to display */\n logos: LogoItem[];\n /** Optional heading text above the grid */\n heading?: React.ReactNode;\n /**\n * Opt-in staggered reveal animation.\n * - `true` → default step of 80ms between items\n * - `number` → explicit ms step between items\n * - `false` / `undefined` → no animation (default, fully backward-compatible)\n * Respects prefers-reduced-motion: no delay applied when reduced motion is set.\n * Requires importing `@vantageos/mosaic-blocks/styles.css` for the keyframe.\n */\n stagger?: boolean | number;\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// ── Helpers ──────────────────────────────────────────────────────────────────\n\nfunction prefersReducedMotion(): boolean {\n if (typeof window === \"undefined\") return false;\n return window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n}\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\n/**\n * MosaicLogosGrid — wrapping flex grid of partner/integration logos.\n * Pass `heading` for a \"Trusted by\" label above the logos.\n * Pass `stagger` (true or ms number) for a staggered reveal animation.\n * The `mosaic-logo-in` keyframe is defined in styles.css (static, SSR-safe).\n *\n * @example\n * <MosaicLogosGrid\n * heading=\"Trusted by leading teams\"\n * logos={[\n * { name: \"Notion\", src: \"/logos/notion.svg\", width: 100, height: 40 },\n * { name: \"Slack\", src: \"/logos/slack.svg\", width: 80, height: 80 },\n * ]}\n * stagger={80}\n * />\n */\nexport function MosaicLogosGrid({ logos, heading, stagger, className, ref }: MosaicLogosGridProps) {\n const isStagger = stagger !== undefined && stagger !== false;\n const stepMs = typeof stagger === \"number\" ? stagger : 80;\n\n const reducedMotion = prefersReducedMotion();\n\n return (\n <section\n ref={ref}\n className={cn(\n \"flex flex-col items-center justify-center gap-8 px-4 py-12 mx-auto max-w-6xl\",\n className,\n )}\n >\n {heading && (\n <p className=\"text-center text-sm font-light text-[oklch(0.5_0.01_250)]\">{heading}</p>\n )}\n <div className=\"flex flex-wrap items-center justify-center gap-6 md:gap-8 lg:gap-12\">\n {logos.map((logo, i) => {\n return (\n <div\n key={logo.name}\n data-slot=\"logos-grid-item\"\n className={cn(\n \"transition-transform duration-200 hover:scale-110\",\n isStagger && !reducedMotion && \"mosaic-logo-stagger\",\n )}\n style={\n isStagger && !reducedMotion\n ? {\n opacity: 0,\n animation: `mosaic-logo-in 400ms ease-out ${i * stepMs}ms forwards`,\n animationDelay: `${i * stepMs}ms`,\n }\n : {}\n }\n >\n {/* Native img — lib-portable; consumers using Next.js should wrap with next/image */}\n <img\n src={logo.src}\n alt={logo.name}\n width={logo.width ?? 80}\n height={logo.height ?? 80}\n className=\"object-contain opacity-70 grayscale hover:opacity-100 hover:grayscale-0 transition-all duration-200\"\n />\n </div>\n );\n })}\n </div>\n </section>\n );\n}\n\nMosaicLogosGrid.displayName = \"MosaicLogosGrid\";\n"
13
+ }
14
+ ],
15
+ "type": "registry:ui"
16
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-main-nav",
4
+ "title": "MosaicMainNav",
5
+ "description": "Generic responsive top-nav. Desktop: inline link strip. Mobile: hamburger + drawer. Items are props.",
6
+ "dependencies": [],
7
+ "registryDependencies": [
8
+ "https://cdn.jsdelivr.net/npm/@vantageos/mosaic-blocks@0.5.37-alpha/r/mosaic-device-provider.json"
9
+ ],
10
+ "files": [
11
+ {
12
+ "path": "src/components/main-nav/MosaicMainNav.tsx",
13
+ "type": "registry:ui",
14
+ "content": "\"use client\";\n\n/**\n * MosaicMainNav — generic responsive top-nav\n *\n * Ported from components/layout/main-nav.tsx\n *\n * Desktop: inline horizontal link strip.\n * Mobile: hamburger → slide-out drawer (pure CSS, no Radix Sheet dep).\n * All nav items, branding, and hrefs are props — zero hardcoded debate routes.\n * next/link replaced with `renderLink` prop (default: <a> tag).\n * Respects prefers-reduced-motion.\n */\n\nimport * as React from \"react\";\nimport { useDevice } from \"@/components/ui/MosaicDeviceProvider\";\n\n// ── Utility ───────────────────────────────────────────────────────────────────\n\nfunction cn(...classes: (string | undefined | null | false)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\nexport interface MosaicNavItem {\n href: string;\n label: string;\n /** Lucide-compatible icon component */\n icon?: React.ElementType;\n /** If true, only rendered when isAdmin=true */\n adminOnly?: boolean;\n /** Whether this item is currently active */\n isActive?: boolean;\n}\n\nexport interface MosaicMainNavProps {\n items?: MosaicNavItem[];\n /** Current pathname for active-state matching (if items don't carry isActive) */\n activePath?: string;\n /** When true, adminOnly items are shown */\n isAdmin?: boolean;\n /** Custom link renderer (e.g. Next.js Link). Defaults to <a>. */\n renderLink?: (\n item: MosaicNavItem,\n children: React.ReactNode,\n className: string,\n onClick?: () => void,\n ) => React.ReactNode;\n /** Mobile drawer title. Required, no default. */\n drawerTitle: string;\n /** Mobile drawer subtitle. Required, no default. */\n drawerSubtitle: string;\n /**\n * Required host-owned strings — no default, no fallback. The host owns\n * the language (e.g. next-intl `t()`).\n */\n openMenuAriaLabel: string;\n closeMenuAriaLabel: string;\n drawerNavAriaLabel: string;\n mainNavAriaLabel: string;\n adminBadgeLabel: string;\n className?: string;\n}\n\n// ── Keyframe injection ────────────────────────────────────────────────────────\n\nconst ANIM_ID = \"mosaic-main-nav-kf\";\n\nfunction injectStyles() {\n if (typeof document === \"undefined\") return;\n if (document.getElementById(ANIM_ID)) return;\n const s = document.createElement(\"style\");\n s.id = ANIM_ID;\n s.textContent = `\n @keyframes mosaic-drawer-in {\n from { transform: translateX(-100%); }\n to { transform: translateX(0); }\n }\n @keyframes mosaic-drawer-out {\n from { transform: translateX(0); }\n to { transform: translateX(-100%); }\n }\n .mosaic-nav-drawer[data-open=\"true\"] {\n animation: mosaic-drawer-in 220ms ease-out forwards;\n }\n .mosaic-nav-drawer[data-open=\"false\"] {\n animation: mosaic-drawer-out 180ms ease-in forwards;\n }\n @media (prefers-reduced-motion: reduce) {\n .mosaic-nav-drawer { animation: none !important; }\n }\n `;\n document.head.appendChild(s);\n}\n\n// ── Hamburger icon (inline SVG) ───────────────────────────────────────────────\n\nfunction HamburgerIcon() {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <line x1=\"3\" y1=\"12\" x2=\"21\" y2=\"12\" />\n <line x1=\"3\" y1=\"6\" x2=\"21\" y2=\"6\" />\n <line x1=\"3\" y1=\"18\" x2=\"21\" y2=\"18\" />\n </svg>\n );\n}\n\nfunction CloseIcon() {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n );\n}\n\n// ── Default link renderer ─────────────────────────────────────────────────────\n\nfunction defaultRenderLink(\n item: MosaicNavItem,\n children: React.ReactNode,\n className: string,\n onClick?: () => void,\n) {\n return (\n <a key={item.href} href={item.href} className={className} onClick={onClick}>\n {children}\n </a>\n );\n}\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\nexport function MosaicMainNav({\n items = [],\n activePath,\n isAdmin = false,\n renderLink,\n drawerTitle,\n drawerSubtitle,\n openMenuAriaLabel,\n closeMenuAriaLabel,\n drawerNavAriaLabel,\n mainNavAriaLabel,\n adminBadgeLabel,\n className,\n}: MosaicMainNavProps) {\n const { isMobile } = useDevice();\n const [isOpen, setIsOpen] = React.useState(false);\n const linkRenderer = renderLink ?? defaultRenderLink;\n\n React.useEffect(() => {\n injectStyles();\n }, []);\n\n // Close on escape\n React.useEffect(() => {\n if (!isOpen) return;\n const handler = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") setIsOpen(false);\n };\n document.addEventListener(\"keydown\", handler);\n return () => document.removeEventListener(\"keydown\", handler);\n }, [isOpen]);\n\n const filteredItems = items.filter((item) => !item.adminOnly || isAdmin);\n\n const isItemActive = (item: MosaicNavItem) =>\n item.isActive ?? (activePath !== undefined && item.href === activePath);\n\n if (isMobile) {\n return (\n <div data-slot=\"main-nav\" className={className}>\n <button\n type=\"button\"\n onClick={() => setIsOpen(!isOpen)}\n className={cn(\n \"inline-flex min-h-[44px] min-w-[44px] items-center justify-center rounded-md p-0\",\n \"text-foreground hover:bg-accent hover:text-accent-foreground\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n )}\n aria-label={openMenuAriaLabel}\n aria-expanded={isOpen}\n >\n <HamburgerIcon />\n </button>\n\n {/* Backdrop */}\n {isOpen && (\n <button\n type=\"button\"\n className=\"fixed inset-0 z-40 bg-black/50 cursor-default\"\n onClick={() => setIsOpen(false)}\n aria-label={closeMenuAriaLabel}\n tabIndex={-1}\n />\n )}\n\n {/* Drawer */}\n <dialog\n aria-label={drawerNavAriaLabel}\n open={isOpen}\n data-open={isOpen ? \"true\" : \"false\"}\n className={cn(\n \"mosaic-nav-drawer\",\n \"fixed inset-y-0 left-0 z-50 m-0 w-[280px] max-h-none h-full p-0\",\n \"border-r border-border bg-background shadow-xl\",\n !isOpen && \"hidden\",\n )}\n >\n <div className=\"flex items-center justify-between border-b border-border p-4\">\n <div>\n <p className=\"font-semibold\">{drawerTitle}</p>\n <p className=\"text-sm text-muted-foreground\">{drawerSubtitle}</p>\n </div>\n <button\n type=\"button\"\n onClick={() => setIsOpen(false)}\n className={cn(\n \"inline-flex h-8 w-8 items-center justify-center rounded-md\",\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 aria-label={closeMenuAriaLabel}\n >\n <CloseIcon />\n </button>\n </div>\n <nav className=\"flex flex-col gap-1 p-4\" aria-label={mainNavAriaLabel}>\n {filteredItems.map((item) => {\n const Icon = item.icon;\n const active = isItemActive(item);\n const itemClass = cn(\n \"flex items-center gap-3 rounded-lg px-3 py-3 text-sm font-medium transition-colors\",\n \"hover:bg-accent hover:text-accent-foreground\",\n \"min-h-[44px]\",\n active && \"bg-accent text-accent-foreground\",\n );\n return (\n <React.Fragment key={item.href}>\n {linkRenderer(\n item,\n <>\n {Icon && <Icon className=\"h-5 w-5 shrink-0\" aria-hidden=\"true\" />}\n <span>{item.label}</span>\n {item.adminOnly && (\n <span className=\"ml-auto rounded bg-primary/10 px-2 py-0.5 text-xs text-primary\">\n {adminBadgeLabel}\n </span>\n )}\n </>,\n itemClass,\n () => setIsOpen(false),\n )}\n </React.Fragment>\n );\n })}\n </nav>\n </dialog>\n </div>\n );\n }\n\n return (\n <nav\n data-slot=\"main-nav\"\n className={cn(\"flex items-center gap-1\", className)}\n aria-label={mainNavAriaLabel}\n >\n {filteredItems.map((item) => {\n const Icon = item.icon;\n const active = isItemActive(item);\n const itemClass = cn(\n \"flex items-center gap-2 rounded-lg px-3 py-2 text-sm font-medium transition-colors\",\n \"hover:bg-accent hover:text-accent-foreground\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n active && \"bg-accent text-accent-foreground\",\n );\n return (\n <React.Fragment key={item.href}>\n {linkRenderer(\n item,\n <>\n {Icon && <Icon className=\"h-4 w-4\" aria-hidden=\"true\" />}\n <span>{item.label}</span>\n {item.adminOnly && (\n <span className=\"rounded bg-primary/10 px-1.5 py-0.5 text-xs text-primary\">\n {adminBadgeLabel}\n </span>\n )}\n </>,\n itemClass,\n )}\n </React.Fragment>\n );\n })}\n </nav>\n );\n}\n\nMosaicMainNav.displayName = \"MosaicMainNav\";\n"
15
+ }
16
+ ],
17
+ "type": "registry:ui"
18
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-markdown",
4
+ "title": "MosaicMarkdown",
5
+ "description": "MosaicMarkdown — presentational, dependency-free markdown renderer",
6
+ "dependencies": [],
7
+ "registryDependencies": [],
8
+ "files": [
9
+ {
10
+ "path": "src/components/markdown/MosaicMarkdown.tsx",
11
+ "type": "registry:ui",
12
+ "content": "/**\n * MosaicMarkdown — presentational, dependency-free markdown renderer\n *\n * Renders a subset of markdown (headings, paragraphs, ordered/unordered\n * lists, links, bold/italic, inline code, fenced code blocks, tables,\n * blockquotes, horizontal rules) straight from a `content: string` prop.\n *\n * SECURITY — non-negotiable: `content` is assumed to come from an untrusted\n * source (an LLM's own generated text). This component NEVER parses raw HTML\n * out of that string and NEVER uses `dangerouslySetInnerHTML`: every markdown\n * token is turned into React elements built from parsed TEXT, so anything\n * that looks like an HTML tag (`<script>…</script>`, `<img onerror=…>`) is\n * rendered as an inert text node, never as an active DOM element. Link\n * `href`s are scheme-checked (`http:`/`https:`/`mailto:`/relative only), after\n * every ASCII control character is stripped from the whole string (not just\n * the edges) so a scheme obfuscated with an internal control character (e.g.\n * a TAB inserted mid-`javascript:`) cannot slip past as scheme-less —\n * `javascript:`/`data:` and any other scheme are rejected and the link\n * degrades to its plain label text. Every external link renders with\n * `rel=\"noopener noreferrer\"` and `target=\"_blank\"`.\n *\n * DEPENDENCY POLICY: this library's `dependencies` are currently limited to\n * `@base-ui/react` and `class-variance-authority`. A full markdown renderer\n * (react-markdown, marked, remark, streamdown…) was deliberately NOT added\n * — none of them are declared here, in `dependencies` or otherwise. Instead\n * this file implements a minimal, dependency-free block + inline parser\n * covering the required subset. See this package's PR description for the\n * explicit statement of this choice.\n *\n * Code blocks: no syntax highlighter is bundled (would be a hidden\n * dependency and/or heavy runtime cost). The optional `renderCodeBlock` prop\n * is the host's extension point — pass a highlighter of your choice\n * (Shiki, Prism, etc.) and this component defers to it entirely; omit it and\n * a plain `<pre><code>` block is rendered.\n *\n * No \"use client\" — prepend-use-client.mjs adds it to dist. Presentational:\n * zero network calls, zero side effects beyond rendering.\n *\n * @example\n * <MosaicMarkdown content={\"# Title\\n\\nSome **bold** text with a [link](https://example.com).\"} />\n *\n * @example\n * // Host-provided syntax highlighting\n * <MosaicMarkdown\n * content={agentReply}\n * renderCodeBlock={({ language, code }) => <MyHighlighter language={language}>{code}</MyHighlighter>}\n * />\n */\n\nimport type * as React from \"react\";\nimport {\n markdownBlockquoteVariants,\n markdownCodeBlockVariants,\n markdownEmphasisVariants,\n markdownHeadingVariants,\n markdownHrVariants,\n markdownInlineCodeVariants,\n markdownLinkVariants,\n markdownListItemVariants,\n markdownListVariants,\n markdownParagraphVariants,\n markdownRootVariants,\n markdownTableCellVariants,\n markdownTableVariants,\n markdownTableWrapperVariants,\n} from \"./markdown-variants.js\";\n\n// ── Utility ───────────────────────────────────────────────────────────────────\n\nfunction cn(...classes: (string | undefined | null | false)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n\n/**\n * Allow-list link scheme check. `javascript:`, `data:`, `vbscript:` and any\n * other active/opaque scheme are rejected — only `http:`, `https:`,\n * `mailto:`, or a scheme-less (relative/anchor) URL are considered safe.\n *\n * This guarantee holds on its own, independent of any host-runtime behavior:\n * every ASCII control character (`\\x00`-`\\x20`, which includes tab, newline,\n * and carriage return) is stripped from the ENTIRE string — not just the\n * leading/trailing edges — before the scheme is matched. Without this, a\n * scheme obfuscated with an internal control character (e.g. `java` + TAB +\n * `script:...`) would fail the scheme regex, get treated as scheme-less, and\n * be returned unmodified; only React's own href-sanitization would then\n * block it at render time — a filter this component must not rely on.\n */\nfunction sanitizeHref(rawHref: string): string | null {\n // Strip every ASCII control character (\\x00-\\x20) anywhere in the string,\n // not merely at the edges: trim() alone only removes edge whitespace and\n // leaves an internally-inserted control character (e.g. a TAB placed\n // mid-scheme) untouched — exactly the obfuscation vector this guards\n // against.\n // biome-ignore lint/suspicious/noControlCharactersInRegex: intentional — stripping control chars is the security fix itself\n const href = rawHref.replace(/[\\x00-\\x20]/g, \"\");\n if (!href) return null;\n const schemeMatch = /^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(href);\n if (!schemeMatch) return href; // scheme-less: relative path, anchor, etc.\n const scheme = schemeMatch[1].toLowerCase();\n return scheme === \"http\" || scheme === \"https\" || scheme === \"mailto\" ? href : null;\n}\n\n// ── Inline parsing ──────────────────────────────────────────────────────────\n\ntype IdSource = { next: () => number };\n\nfunction makeIdSource(): IdSource {\n let current = 0;\n return {\n next: () => {\n current += 1;\n return current;\n },\n };\n}\n\n/**\n * Turns a run of inline markdown text into React nodes. Recognizes, in\n * priority order: inline code (`` `code` ``), links (`[label](href)`), bold\n * (`**text**`), italic (`*text*`). Everything else — including anything that\n * LOOKS like an HTML tag — is treated as plain text and never parsed as\n * markup, so it can never execute.\n */\nfunction parseInline(text: string, ids: IdSource): React.ReactNode[] {\n const nodes: React.ReactNode[] = [];\n let buffer = \"\";\n let i = 0;\n\n const flush = () => {\n if (buffer.length > 0) {\n nodes.push(buffer);\n buffer = \"\";\n }\n };\n\n while (i < text.length) {\n const rest = text.slice(i);\n\n const codeMatch = /^`([^`]+)`/.exec(rest);\n if (codeMatch) {\n flush();\n nodes.push(\n <code key={ids.next()} className={markdownInlineCodeVariants()}>\n {codeMatch[1]}\n </code>,\n );\n i += codeMatch[0].length;\n continue;\n }\n\n const linkMatch = /^\\[([^\\]]*)\\]\\(((?:[^()]|\\([^()]*\\))*)\\)/.exec(rest);\n if (linkMatch) {\n flush();\n const label = linkMatch[1];\n const safeHref = sanitizeHref(linkMatch[2]);\n if (safeHref) {\n nodes.push(\n <a\n key={ids.next()}\n href={safeHref}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={markdownLinkVariants()}\n >\n {parseInline(label, ids)}\n </a>,\n );\n } else {\n nodes.push(...parseInline(label, ids));\n }\n i += linkMatch[0].length;\n continue;\n }\n\n const boldMatch = /^\\*\\*([^*]+)\\*\\*/.exec(rest);\n if (boldMatch) {\n flush();\n nodes.push(\n <strong key={ids.next()} className={markdownEmphasisVariants({ tone: \"strong\" })}>\n {parseInline(boldMatch[1], ids)}\n </strong>,\n );\n i += boldMatch[0].length;\n continue;\n }\n\n const italicMatch = /^\\*([^*]+)\\*/.exec(rest);\n if (italicMatch) {\n flush();\n nodes.push(\n <em key={ids.next()} className={markdownEmphasisVariants({ tone: \"emphasis\" })}>\n {parseInline(italicMatch[1], ids)}\n </em>,\n );\n i += italicMatch[0].length;\n continue;\n }\n\n buffer += text[i];\n i += 1;\n }\n\n flush();\n return nodes;\n}\n\n// ── Block parsing ─────────────────────────────────────────────────────────────\n\ntype Block =\n | { id: number; kind: \"heading\"; level: 1 | 2 | 3 | 4 | 5 | 6; text: string }\n | { id: number; kind: \"paragraph\"; text: string }\n | { id: number; kind: \"list\"; ordered: boolean; items: { id: number; text: string }[] }\n | { id: number; kind: \"blockquote\"; text: string }\n | { id: number; kind: \"hr\" }\n | { id: number; kind: \"code\"; language: string | undefined; code: string }\n | { id: number; kind: \"table\"; header: string[]; rows: string[][] };\n\nconst FENCE_RE = /^```(\\S*)\\s*$/;\nconst HEADING_RE = /^(#{1,6})\\s+(.*)$/;\nconst HR_RE = /^(-{3,}|\\*{3,}|_{3,})$/;\nconst UNORDERED_ITEM_RE = /^[-*+]\\s+/;\nconst ORDERED_ITEM_RE = /^\\d+\\.\\s+/;\nconst BLOCKQUOTE_LINE_RE = /^>\\s?/;\nconst TABLE_SEPARATOR_RE = /^\\s*\\|?\\s*:?-+:?\\s*(\\|\\s*:?-+:?\\s*)*\\|?\\s*$/;\n\nfunction parseTableRow(line: string): string[] {\n const trimmed = line.trim().replace(/^\\|/, \"\").replace(/\\|$/, \"\");\n return trimmed.split(\"|\").map((cell) => cell.trim());\n}\n\nfunction parseBlocks(content: string): Block[] {\n const lines = content.split(/\\r?\\n/);\n const blocks: Block[] = [];\n let id = 0;\n const nextId = () => {\n id += 1;\n return id;\n };\n\n let i = 0;\n while (i < lines.length) {\n const line = lines[i];\n\n if (line.trim() === \"\") {\n i += 1;\n continue;\n }\n\n const fenceMatch = FENCE_RE.exec(line);\n if (fenceMatch) {\n const language = fenceMatch[1] || undefined;\n const codeLines: string[] = [];\n i += 1;\n while (i < lines.length && !/^```\\s*$/.test(lines[i])) {\n codeLines.push(lines[i]);\n i += 1;\n }\n i += 1; // skip closing fence\n blocks.push({ id: nextId(), kind: \"code\", language, code: codeLines.join(\"\\n\") });\n continue;\n }\n\n const headingMatch = HEADING_RE.exec(line);\n if (headingMatch) {\n blocks.push({\n id: nextId(),\n kind: \"heading\",\n level: headingMatch[1].length as 1 | 2 | 3 | 4 | 5 | 6,\n text: headingMatch[2].trim(),\n });\n i += 1;\n continue;\n }\n\n if (HR_RE.test(line.trim())) {\n blocks.push({ id: nextId(), kind: \"hr\" });\n i += 1;\n continue;\n }\n\n if (line.includes(\"|\") && i + 1 < lines.length && TABLE_SEPARATOR_RE.test(lines[i + 1])) {\n const header = parseTableRow(line);\n i += 2;\n const rows: string[][] = [];\n while (i < lines.length && lines[i].trim() !== \"\" && lines[i].includes(\"|\")) {\n rows.push(parseTableRow(lines[i]));\n i += 1;\n }\n blocks.push({ id: nextId(), kind: \"table\", header, rows });\n continue;\n }\n\n if (BLOCKQUOTE_LINE_RE.test(line)) {\n const quoteLines: string[] = [];\n while (i < lines.length && BLOCKQUOTE_LINE_RE.test(lines[i])) {\n quoteLines.push(lines[i].replace(BLOCKQUOTE_LINE_RE, \"\"));\n i += 1;\n }\n blocks.push({ id: nextId(), kind: \"blockquote\", text: quoteLines.join(\" \") });\n continue;\n }\n\n if (UNORDERED_ITEM_RE.test(line)) {\n const items: { id: number; text: string }[] = [];\n while (i < lines.length && UNORDERED_ITEM_RE.test(lines[i])) {\n items.push({ id: nextId(), text: lines[i].replace(UNORDERED_ITEM_RE, \"\") });\n i += 1;\n }\n blocks.push({ id: nextId(), kind: \"list\", ordered: false, items });\n continue;\n }\n\n if (ORDERED_ITEM_RE.test(line)) {\n const items: { id: number; text: string }[] = [];\n while (i < lines.length && ORDERED_ITEM_RE.test(lines[i])) {\n items.push({ id: nextId(), text: lines[i].replace(ORDERED_ITEM_RE, \"\") });\n i += 1;\n }\n blocks.push({ id: nextId(), kind: \"list\", ordered: true, items });\n continue;\n }\n\n const paragraphLines: string[] = [];\n while (\n i < lines.length &&\n lines[i].trim() !== \"\" &&\n !FENCE_RE.test(lines[i]) &&\n !HEADING_RE.test(lines[i]) &&\n !UNORDERED_ITEM_RE.test(lines[i]) &&\n !ORDERED_ITEM_RE.test(lines[i]) &&\n !BLOCKQUOTE_LINE_RE.test(lines[i]) &&\n !HR_RE.test(lines[i].trim())\n ) {\n paragraphLines.push(lines[i]);\n i += 1;\n }\n blocks.push({ id: nextId(), kind: \"paragraph\", text: paragraphLines.join(\" \") });\n }\n\n return blocks;\n}\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\nexport interface MosaicMarkdownProps {\n /**\n * Markdown source to render. Treated as UNTRUSTED (e.g. straight from an\n * LLM reply): no raw HTML in this string is ever parsed as active markup.\n */\n content: string;\n /**\n * Extension point for fenced-code-block rendering (e.g. host-side syntax\n * highlighting). When omitted, code renders in a plain `<pre><code>` block\n * with no highlighting and no bundled highlighter dependency.\n */\n renderCodeBlock?: (props: { language: string | undefined; code: string }) => React.ReactNode;\n /** Additional Tailwind classes on the root element. */\n className?: string;\n /** React 19 ref prop — forwarded to the root element. */\n ref?: React.Ref<HTMLDivElement>;\n}\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\n/**\n * MosaicMarkdown — production markdown-rendering atom for\n * @vantageos/mosaic-blocks.\n *\n * Purely presentational: parses `content` into a minimal block/inline AST and\n * renders it as React elements. No network call, no raw-HTML injection.\n */\nexport function MosaicMarkdown({ content, renderCodeBlock, className, ref }: MosaicMarkdownProps) {\n const blocks = parseBlocks(content);\n const ids = makeIdSource();\n\n return (\n <div ref={ref} data-slot=\"markdown\" className={cn(markdownRootVariants(), className)}>\n {blocks.map((block) => {\n if (block.kind === \"heading\") {\n const HeadingTag = `h${block.level}` as \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n return (\n <HeadingTag key={block.id} className={markdownHeadingVariants({ level: block.level })}>\n {parseInline(block.text, ids)}\n </HeadingTag>\n );\n }\n\n if (block.kind === \"paragraph\") {\n return (\n <p key={block.id} className={markdownParagraphVariants()}>\n {parseInline(block.text, ids)}\n </p>\n );\n }\n\n if (block.kind === \"list\") {\n const ListTag = block.ordered ? \"ol\" : \"ul\";\n return (\n <ListTag key={block.id} className={markdownListVariants({ ordered: block.ordered })}>\n {block.items.map((item) => (\n <li key={item.id} className={markdownListItemVariants()}>\n {parseInline(item.text, ids)}\n </li>\n ))}\n </ListTag>\n );\n }\n\n if (block.kind === \"blockquote\") {\n return (\n <blockquote key={block.id} className={markdownBlockquoteVariants()}>\n {parseInline(block.text, ids)}\n </blockquote>\n );\n }\n\n if (block.kind === \"hr\") {\n return <hr key={block.id} className={markdownHrVariants()} />;\n }\n\n if (block.kind === \"code\") {\n if (renderCodeBlock) {\n return (\n <div key={block.id}>\n {renderCodeBlock({ language: block.language, code: block.code })}\n </div>\n );\n }\n return (\n <pre\n key={block.id}\n data-slot=\"markdown-code-block\"\n {...(block.language ? { \"data-language\": block.language } : {})}\n className={markdownCodeBlockVariants()}\n >\n <code>{block.code}</code>\n </pre>\n );\n }\n\n // table\n return (\n <div key={block.id} className={markdownTableWrapperVariants()}>\n <table className={markdownTableVariants()}>\n <thead>\n <tr>\n {block.header.map((cell) => (\n <th key={ids.next()} className={markdownTableCellVariants({ header: true })}>\n {parseInline(cell, ids)}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {block.rows.map((row) => (\n <tr key={ids.next()}>\n {row.map((cell) => (\n <td key={ids.next()} className={markdownTableCellVariants({ header: false })}>\n {parseInline(cell, ids)}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n })}\n </div>\n );\n}\n\nMosaicMarkdown.displayName = \"MosaicMarkdown\";\n"
13
+ },
14
+ {
15
+ "path": "src/components/markdown/markdown-variants.ts",
16
+ "type": "registry:ui",
17
+ "content": "/**\n * markdownVariants — pure CVA variant functions for MosaicMarkdown.\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 — resets first/last child margins so the block sits flush. */\nexport const markdownRootVariants = cva([\n \"min-w-0 text-[15px] leading-6 text-foreground [&>*:first-child]:mt-0 [&>*:last-child]:mb-0\",\n]);\n\n/** Heading variants, by level 1-6. */\nexport const markdownHeadingVariants = cva([\"font-medium tracking-normal text-foreground\"], {\n variants: {\n level: {\n 1: \"mt-7 mb-4 text-xl leading-7\",\n 2: \"mt-6 mb-3 text-base leading-6\",\n 3: \"mt-5 mb-2 text-sm leading-6\",\n 4: \"mt-4 mb-2 text-sm leading-6\",\n 5: \"mt-4 mb-2 text-xs leading-5\",\n 6: \"mt-4 mb-2 text-xs leading-5 text-muted-foreground\",\n },\n },\n defaultVariants: {\n level: 1,\n },\n});\n\n/** Paragraph text. */\nexport const markdownParagraphVariants = cva([\"mb-3 text-[15px] leading-6 text-foreground\"]);\n\n/** Ordered/unordered list container, by ordered flag. */\nexport const markdownListVariants = cva([\"mb-3 flex flex-col gap-1.5 pl-8 text-[15px] leading-6\"], {\n variants: {\n ordered: {\n true: \"list-decimal\",\n false: \"list-disc\",\n },\n },\n defaultVariants: {\n ordered: false,\n },\n});\n\n/** List item. */\nexport const markdownListItemVariants = cva([\"pl-1 text-[15px] leading-6 text-foreground\"]);\n\n/** Blockquote. */\nexport const markdownBlockquoteVariants = cva([\n \"mb-3 border-l-2 border-border pl-3 text-[15px] leading-6 text-muted-foreground\",\n]);\n\n/** Horizontal rule. */\nexport const markdownHrVariants = cva([\"my-4 border-border/70\"]);\n\n/** Inline emphasis (bold / italic). */\nexport const markdownEmphasisVariants = cva([], {\n variants: {\n tone: {\n strong: \"font-medium text-foreground\",\n emphasis: \"italic\",\n },\n },\n});\n\n/** Inline code span. */\nexport const markdownInlineCodeVariants = cva([\n \"rounded-md border border-border/70 bg-muted/40 px-1.5 py-0.5 font-mono text-[0.92em] text-foreground\",\n]);\n\n/** Fenced code block container. */\nexport const markdownCodeBlockVariants = cva([\n \"mb-3 overflow-x-auto rounded-md border border-border bg-muted/40 p-3 font-mono text-[0.92em] text-foreground\",\n]);\n\n/** External link. */\nexport const markdownLinkVariants = cva([\n \"font-medium text-foreground underline decoration-border underline-offset-4 transition-colors hover:decoration-foreground\",\n]);\n\n/** Table wrapper (scroll container). */\nexport const markdownTableWrapperVariants = cva([\"mb-3 w-full overflow-x-auto\"]);\n\n/** Table element. */\nexport const markdownTableVariants = cva([\"w-full border-collapse text-[15px] leading-6\"]);\n\n/** Table cell, by header flag + column alignment. */\nexport const markdownTableCellVariants = cva([\"border border-border px-3 py-1.5\"], {\n variants: {\n header: {\n true: \"bg-muted/40 font-medium text-foreground\",\n false: \"text-foreground\",\n },\n align: {\n left: \"text-left\",\n center: \"text-center\",\n right: \"text-right\",\n },\n },\n defaultVariants: {\n header: false,\n align: \"left\",\n },\n});\n"
18
+ }
19
+ ],
20
+ "type": "registry:ui"
21
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-marketplace-card",
4
+ "title": "MosaicMarketplaceCard",
5
+ "description": "MosaicMarketplaceCard — standalone agent-type gallery tile (M1)",
6
+ "dependencies": [],
7
+ "registryDependencies": [
8
+ "https://cdn.jsdelivr.net/npm/@vantageos/mosaic-blocks@0.5.37-alpha/r/mosaic-badge.json",
9
+ "https://cdn.jsdelivr.net/npm/@vantageos/mosaic-blocks@0.5.37-alpha/r/mosaic-card.json"
10
+ ],
11
+ "files": [
12
+ {
13
+ "path": "src/components/marketplace-card/MosaicMarketplaceCard.tsx",
14
+ "type": "registry:ui",
15
+ "content": "\"use client\";\n\n/**\n * MosaicMarketplaceCard — standalone agent-type gallery tile (M1)\n *\n * Ported from any-debate-ai components/marketplace/desktop/marketplace-card-desktop.tsx\n * and components/marketplace/mobile/marketplace-card-mobile.tsx.\n *\n * This is the tile shown for an agent-type inside a PUBLIC gallery — what a\n * visitor sees before adopting someone else's work. Distinct from the private\n * `MarketplaceCard` embedded inside MosaicMarketplaceList (which is coupled to\n * that list's filter/search state and not exported standalone): this card is a\n * composable, standalone atom usable in any grid, storybook page, or gallery\n * outside a filtered list context.\n *\n * SIN-01: every visible string (adopt/unadopt/preview labels, rating label,\n * mentions) is a required prop with no default. No popularity threshold, no\n * computed rating judgement, no host-decided badge — mentions are plain\n * strings supplied by the caller.\n *\n * Composes MosaicCard sub-parts + MosaicBadge rather than re-implementing\n * card chrome or badge chrome.\n */\n\nimport type * as React from \"react\";\nimport { MosaicBadge } from \"@/components/ui/MosaicBadge\";\nimport { MosaicCard, MosaicCardDescription, MosaicCardTitle } from \"@/components/ui/MosaicCard\";\nimport { marketplaceCardVariants } from \"./marketplace-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 MosaicMarketplaceCardProps {\n /** Stable identifier forwarded to onAdopt/onUnadopt/onPreview. */\n id: string;\n /** Agent-type name. Required content. */\n name: string;\n /** Optional agent-type description. */\n description?: string;\n /** Icon/avatar node rendered at the top of the card. */\n icon?: React.ReactNode;\n /** Host-provided rating value (e.g. 4.8). No computed threshold or judgement. */\n rating?: number;\n /** Host-provided plain-text mentions/badges (e.g. \"Verified\", \"New\"). No lib-decided badges. */\n mentions?: string[];\n /** Whether this agent-type is already adopted by the viewer. */\n isAdopted?: boolean;\n /** Called with `id` when the adopt action is invoked. */\n onAdopt?: (id: string) => void;\n /** Called with `id` when the unadopt action is invoked. */\n onUnadopt?: (id: string) => void;\n /** Called with `id` when the preview action is invoked. Preview button renders only when provided. */\n onPreview?: (id: string) => void;\n /** Label for the adopt action button. Required — host-owned, no default. */\n adoptLabel: string;\n /** Label for the unadopt action button. Required — host-owned, no default. */\n unadoptLabel: string;\n /** Label for the preview action button. Required — host-owned, no default. */\n previewLabel: string;\n /** Accessible suffix rendered next to the rating value (e.g. \"out of 5\"). Required — host-owned, no default. */\n ratingLabel: string;\n /** Layout variant. */\n variant?: \"default\" | \"compact\";\n className?: string;\n}\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\n/**\n * MosaicMarketplaceCard — standalone tile for an agent-type in a public gallery.\n *\n * @example\n * <MosaicMarketplaceCard\n * id=\"agent-42\"\n * name=\"Vantage Researcher\"\n * description=\"Deep research agent for market analysis\"\n * mentions={[\"Verified\"]}\n * onAdopt={(id) => adopt(id)}\n * onPreview={(id) => openPreview(id)}\n * adoptLabel=\"Adopt\"\n * unadoptLabel=\"Remove\"\n * previewLabel=\"Preview\"\n * ratingLabel=\"out of 5\"\n * />\n */\nexport function MosaicMarketplaceCard({\n id,\n name,\n description,\n icon,\n rating,\n mentions,\n isAdopted = false,\n onAdopt,\n onUnadopt,\n onPreview,\n adoptLabel,\n unadoptLabel,\n previewLabel,\n ratingLabel,\n variant = \"default\",\n className,\n}: MosaicMarketplaceCardProps) {\n const compact = variant === \"compact\";\n\n return (\n <MosaicCard\n data-slot=\"marketplace-card\"\n className={cn(marketplaceCardVariants({ variant }), className)}\n >\n {icon && (\n <div\n className={cn(\n \"flex shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground\",\n compact ? \"h-10 w-10\" : \"h-12 w-12\",\n )}\n >\n {icon}\n </div>\n )}\n\n <div className=\"min-w-0 flex-1\">\n <MosaicCardTitle className={cn(\"truncate\", compact ? \"text-sm\" : \"text-base\")}>\n {name}\n </MosaicCardTitle>\n\n {description && (\n <MosaicCardDescription\n data-slot=\"marketplace-card-description\"\n className=\"mt-1 line-clamp-2\"\n >\n {description}\n </MosaicCardDescription>\n )}\n\n {mentions && mentions.length > 0 && (\n <div className=\"mt-2 flex flex-wrap gap-1\">\n {mentions.map((mention) => (\n <MosaicBadge key={mention} variant=\"secondary\">\n {mention}\n </MosaicBadge>\n ))}\n </div>\n )}\n\n {rating != null && (\n <div\n data-slot=\"marketplace-card-rating\"\n className=\"mt-2 flex items-center gap-1 text-xs text-muted-foreground\"\n >\n <span className=\"font-medium text-foreground\">{rating}</span>\n <span>{ratingLabel}</span>\n </div>\n )}\n </div>\n\n <div className={cn(\"flex gap-2\", compact ? \"shrink-0\" : \"mt-1\")}>\n {onPreview && (\n <button\n type=\"button\"\n onClick={() => onPreview(id)}\n className={cn(\n \"inline-flex min-h-[36px] items-center justify-center rounded-md border border-border\",\n \"bg-background px-3 text-xs 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 {previewLabel}\n </button>\n )}\n {isAdopted\n ? onUnadopt && (\n <button\n type=\"button\"\n onClick={() => onUnadopt(id)}\n className={cn(\n \"inline-flex min-h-[36px] items-center justify-center rounded-md\",\n \"bg-secondary px-3 text-xs font-medium text-secondary-foreground\",\n \"hover:bg-secondary/80\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n )}\n >\n {unadoptLabel}\n </button>\n )\n : onAdopt && (\n <button\n type=\"button\"\n onClick={() => onAdopt(id)}\n className={cn(\n \"inline-flex min-h-[36px] items-center justify-center rounded-md\",\n \"bg-primary px-3 text-xs font-medium text-primary-foreground\",\n \"hover:bg-primary/90\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n )}\n >\n {adoptLabel}\n </button>\n )}\n </div>\n </MosaicCard>\n );\n}\n\nMosaicMarketplaceCard.displayName = \"MosaicMarketplaceCard\";\n"
16
+ },
17
+ {
18
+ "path": "src/components/marketplace-card/marketplace-card-variants.ts",
19
+ "type": "registry:ui",
20
+ "content": "/**\n * marketplaceCardVariants — pure CVA variant function for MosaicMarketplaceCard.\n *\n * Isolated in its own module so it can be re-exported from the\n * `@vantageos/mosaic-blocks/server` subpath without pulling in React.\n *\n * Zero browser / React runtime dependencies — safe in RSC / Node.js.\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const marketplaceCardVariants = cva(\n [\"rounded-xl border border-border bg-card p-4 transition-shadow\", \"hover:shadow-md\"],\n {\n variants: {\n variant: {\n default: \"flex flex-col gap-3\",\n compact: \"flex flex-row items-center gap-3\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n"
21
+ }
22
+ ],
23
+ "type": "registry:ui"
24
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "mosaic-marketplace-list",
4
+ "title": "MosaicMarketplaceList",
5
+ "description": "Responsive marketplace grid/list (responsive-pair). Install/uninstall actions, rating, downloads, price.",
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/marketplace-list/MosaicMarketplaceList.tsx",
15
+ "type": "registry:ui",
16
+ "content": "\"use client\";\n\n/**\n * MosaicMarketplaceList — responsive marketplace grid/list (responsive-pair)\n *\n * Ported from components/marketplace/ (marketplace-list.tsx +\n * desktop/marketplace-list-desktop.tsx + mobile/marketplace-list-mobile.tsx +\n * MarketplaceFilterSidebar.tsx)\n *\n * Features:\n * - Desktop: filter sidebar + card grid\n * - Mobile: compact list + filter sheet\n * - Install/uninstall action callbacks\n * - Rating stars, download count, price, category badges\n *\n * Reuses MosaicFilterSidebar for filter sidebar.\n * All mock data stripped — items are props.\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 MosaicMarketplaceItem {\n id: string;\n title: string;\n description?: string;\n category: string;\n rating?: number;\n downloads?: number;\n price?: string;\n isInstalled?: boolean;\n /** Tailwind accent class for the icon bg (e.g. \"bg-purple-500/10 text-purple-500\") */\n accentClass?: string;\n /** Icon node to render */\n icon?: React.ReactNode;\n tags?: string[];\n}\n\nexport interface MosaicMarketplaceListProps {\n items: MosaicMarketplaceItem[];\n filters?: MosaicFilterOption[];\n selectedFilter: string;\n onFilterChange: (id: string) => void;\n categories?: MosaicFilterOption[];\n selectedCategory: string;\n onCategoryChange: (id: string) => void;\n onInstall?: (itemId: string) => void;\n onUninstall?: (itemId: string) => void;\n onPreview?: (itemId: string) => void;\n title?: string;\n searchPlaceholder?: string;\n /** Label for the install action button. Required, no default. */\n installLabel: string;\n /** Label for the uninstall action button. Required, no default. */\n uninstallLabel: string;\n /**\n * Label for the preview button on each card. Required — host-owned,\n * no default.\n */\n previewLabel: string;\n /**\n * Message shown when the filtered item list is empty. Required —\n * host-owned, no default.\n */\n emptyMessage: string;\n /** aria-label for the mobile \"open filters\" button. Required, no default. */\n openFiltersAriaLabel: string;\n /** Title of the mobile filters modal. Required, no default. */\n filtersModalTitle: 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 className?: string;\n}\n\n// ── Inline icons ──────────────────────────────────────────────────────────────\n\nfunction StarIcon({ filled }: { filled?: boolean }) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill={filled ? \"currentColor\" : \"none\"}\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\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 DownloadIcon() {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n <polyline points=\"7 10 12 15 17 10\" />\n <line x1=\"12\" y1=\"15\" x2=\"12\" y2=\"3\" />\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// ── Item card ─────────────────────────────────────────────────────────────────\n\nfunction MarketplaceCard({\n item,\n onInstall,\n onUninstall,\n onPreview,\n installLabel,\n uninstallLabel,\n previewLabel,\n compact = false,\n}: {\n item: MosaicMarketplaceItem;\n onInstall?: (id: string) => void;\n onUninstall?: (id: string) => void;\n onPreview?: (id: string) => void;\n installLabel: string;\n uninstallLabel: string;\n previewLabel: string;\n compact?: boolean;\n}) {\n const ratingInt = Math.round(item.rating ?? 0);\n\n return (\n <div\n data-slot=\"marketplace-card\"\n className={cn(\n \"rounded-lg border border-border bg-card p-4 transition-shadow hover:shadow-md\",\n compact ? \"flex items-center gap-3\" : \"flex flex-col gap-3\",\n )}\n >\n {/* Icon */}\n {item.icon && (\n <div\n className={cn(\n \"flex shrink-0 items-center justify-center rounded-lg\",\n compact ? \"h-10 w-10\" : \"h-12 w-12\",\n item.accentClass ?? \"bg-muted text-muted-foreground\",\n )}\n >\n {item.icon}\n </div>\n )}\n\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-start justify-between gap-2\">\n <div className=\"min-w-0\">\n <p className={cn(\"font-semibold leading-tight\", compact ? \"text-sm\" : \"text-base\")}>\n {item.title}\n </p>\n {item.description && !compact && (\n <p className=\"mt-1 text-sm text-muted-foreground line-clamp-2\">{item.description}</p>\n )}\n </div>\n {item.price && (\n <span className=\"shrink-0 rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground\">\n {item.price}\n </span>\n )}\n </div>\n\n {!compact && (\n <div className=\"mt-2 flex items-center gap-3 text-xs text-muted-foreground\">\n <span className=\"rounded-md border border-border px-2 py-0.5\">{item.category}</span>\n {item.rating != null && (\n <span className=\"flex items-center gap-1 text-yellow-500\">\n {([1, 2, 3, 4, 5] as const).map((star) => (\n <StarIcon key={star} filled={star <= ratingInt} />\n ))}\n <span className=\"text-muted-foreground\">{item.rating.toFixed(1)}</span>\n </span>\n )}\n {item.downloads != null && (\n <span className=\"flex items-center gap-1\">\n <DownloadIcon />\n {item.downloads.toLocaleString()}\n </span>\n )}\n </div>\n )}\n </div>\n\n {/* Actions */}\n <div className={cn(\"flex gap-2\", compact ? \"shrink-0\" : \"mt-1\")}>\n {onPreview && (\n <button\n type=\"button\"\n onClick={() => onPreview(item.id)}\n className={cn(\n \"inline-flex min-h-[36px] items-center justify-center rounded-md border border-border\",\n \"bg-background px-3 text-xs 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 {previewLabel}\n </button>\n )}\n {item.isInstalled\n ? onUninstall && (\n <button\n type=\"button\"\n onClick={() => onUninstall(item.id)}\n className={cn(\n \"inline-flex min-h-[36px] items-center justify-center rounded-md\",\n \"bg-secondary px-3 text-xs font-medium text-secondary-foreground\",\n \"hover:bg-secondary/80\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n )}\n >\n {uninstallLabel}\n </button>\n )\n : onInstall && (\n <button\n type=\"button\"\n onClick={() => onInstall(item.id)}\n className={cn(\n \"inline-flex min-h-[36px] items-center justify-center rounded-md\",\n \"bg-primary px-3 text-xs font-medium text-primary-foreground\",\n \"hover:bg-primary/90\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n )}\n >\n {installLabel}\n </button>\n )}\n </div>\n </div>\n );\n}\n\n// ── Desktop variant ───────────────────────────────────────────────────────────\n\nfunction MarketplaceListDesktop(props: MosaicMarketplaceListProps) {\n const {\n items,\n filters,\n selectedFilter,\n onFilterChange,\n categories,\n selectedCategory,\n onCategoryChange,\n onInstall,\n onUninstall,\n onPreview,\n title,\n searchPlaceholder,\n installLabel,\n uninstallLabel,\n previewLabel,\n emptyMessage,\n expandFiltersAriaLabel,\n categoriesHeading,\n collapseSidebarAriaLabel,\n expandSidebarAriaLabel,\n } = props;\n\n const [query, setQuery] = React.useState(\"\");\n const [sidebarCollapsed, setSidebarCollapsed] = React.useState(false);\n\n const filtered = items.filter(\n (i) =>\n !query ||\n i.title.toLowerCase().includes(query.toLowerCase()) ||\n (i.description ?? \"\").toLowerCase().includes(query.toLowerCase()),\n );\n\n return (\n <div data-slot=\"marketplace-list-desktop\" className=\"flex h-full flex-col\">\n <div className=\"flex items-center 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 <MosaicFilterSidebar\n isCollapsed={sidebarCollapsed}\n onToggleCollapse={() => setSidebarCollapsed((v) => !v)}\n filters={filters}\n selectedFilter={selectedFilter}\n onFilterChange={onFilterChange}\n categories={categories}\n selectedCategory={selectedCategory}\n onCategoryChange={onCategoryChange}\n expandFiltersAriaLabel={expandFiltersAriaLabel}\n categoriesHeading={categoriesHeading}\n collapseSidebarAriaLabel={collapseSidebarAriaLabel}\n expandSidebarAriaLabel={expandSidebarAriaLabel}\n />\n <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\",\n \"text-sm placeholder:text-muted-foreground\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n )}\n />\n </div>\n </div>\n <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((item) => (\n <MarketplaceCard\n key={item.id}\n item={item}\n onInstall={onInstall}\n onUninstall={onUninstall}\n onPreview={onPreview}\n installLabel={installLabel}\n uninstallLabel={uninstallLabel}\n previewLabel={previewLabel}\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\n// ── Mobile variant ────────────────────────────────────────────────────────────\n\nfunction MarketplaceListMobile(props: MosaicMarketplaceListProps) {\n const {\n items,\n filters,\n selectedFilter,\n onFilterChange,\n categories,\n selectedCategory,\n onCategoryChange,\n onInstall,\n onUninstall,\n onPreview,\n title,\n searchPlaceholder,\n installLabel,\n uninstallLabel,\n previewLabel,\n emptyMessage,\n openFiltersAriaLabel,\n filtersModalTitle,\n closeFiltersAriaLabel,\n expandFiltersAriaLabel,\n categoriesHeading,\n collapseSidebarAriaLabel,\n expandSidebarAriaLabel,\n } = props;\n\n const [filterOpen, setFilterOpen] = React.useState(false);\n const [query, setQuery] = React.useState(\"\");\n\n const filtered = items.filter(\n (i) =>\n !query ||\n i.title.toLowerCase().includes(query.toLowerCase()) ||\n (i.description ?? \"\").toLowerCase().includes(query.toLowerCase()),\n );\n\n return (\n <div data-slot=\"marketplace-list-mobile\" 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 hover:text-accent-foreground 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\",\n \"text-sm placeholder:text-muted-foreground\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n )}\n />\n </div>\n </div>\n\n <div className=\"space-y-3 p-4\">\n {filtered.map((item) => (\n <MarketplaceCard\n key={item.id}\n item={item}\n onInstall={onInstall}\n onUninstall={onUninstall}\n onPreview={onPreview}\n installLabel={installLabel}\n uninstallLabel={uninstallLabel}\n previewLabel={previewLabel}\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\n <MosaicAdaptiveModal\n isOpen={filterOpen}\n onClose={() => setFilterOpen(false)}\n title={filtersModalTitle}\n closeAriaLabel={closeFiltersAriaLabel}\n >\n <div className=\"p-4\">\n <MosaicFilterSidebar\n isCollapsed={false}\n onToggleCollapse={() => setFilterOpen(false)}\n filters={filters}\n selectedFilter={selectedFilter}\n onFilterChange={(id) => {\n onFilterChange(id);\n setFilterOpen(false);\n }}\n categories={categories}\n selectedCategory={selectedCategory}\n expandFiltersAriaLabel={expandFiltersAriaLabel}\n categoriesHeading={categoriesHeading}\n collapseSidebarAriaLabel={collapseSidebarAriaLabel}\n expandSidebarAriaLabel={expandSidebarAriaLabel}\n onCategoryChange={(id) => {\n onCategoryChange(id);\n setFilterOpen(false);\n }}\n />\n </div>\n </MosaicAdaptiveModal>\n </div>\n );\n}\n\n// ── Orchestrator ──────────────────────────────────────────────────────────────\n\nexport function MosaicMarketplaceList(props: MosaicMarketplaceListProps) {\n const { isMobile } = useDevice();\n return isMobile ? <MarketplaceListMobile {...props} /> : <MarketplaceListDesktop {...props} />;\n}\n\nMosaicMarketplaceList.displayName = \"MosaicMarketplaceList\";\n\nexport { MarketplaceListDesktop as MosaicMarketplaceListDesktop };\nexport { MarketplaceListMobile as MosaicMarketplaceListMobile };\n"
17
+ }
18
+ ],
19
+ "type": "registry:ui"
20
+ }