/** * design-system-preview-meta — zero-React metadata for live-preview presence checks. * * Callers that only need to know *whether* a slug has a live preview (e.g. the * design-system index page badge, the doc-page toggle) can import from here and * avoid pulling in the full PREVIEW_SECTIONS registry or component-doc modules. * * Keep `PREVIEW_SECTIONS_SLUGS` in sync with the keys of `PREVIEW_SECTIONS` in * `design-system-previews.tsx`. Component-doc slugs live in `component-doc-slugs.ts`. */ import { COMPONENT_DOC_SLUGS } from "@/lib/design-system/component-doc-slugs" /** * Slugs that have sections defined in the `PREVIEW_SECTIONS` registry inside * `design-system-previews.tsx` (fallback when there is no component-doc spec). */ const PREVIEW_SECTIONS_SLUGS = new Set([ "animated-blob-background", "ask-leo-composer", "ask-leo-shell", "command-menu", "data-row-list", "dedicated-search", "dedicated-search-landing-template", "dedicated-search-results-template", "discovery-hub-template", "dot-pattern", "drag-handle-grip", "exam-lock-template", "export-drawer", "finder-panel-view", "focus-workflow-template", "folder-grid-view", "horizontal-scroll-controls", "horizontal-scroll-region", "invite-collaborators-drawer", "leo-ambience-settings", "leo-ambient-surface", "leo-pulse-border", "list-page-board-card", "list-page-board-template", "list-page-template", "list-page-tree-panel-shell", "list-page-view-frame", "login-page", "nested-secondary-panel-shell", "new-focus-template", "outline-tree-menu", "product-marketing-page", "products-home", "resizable", "secondary-hub-nav-primitives", "secondary-panel-hub-template", "settings-form-row", "site-header", "accordion", "breadcrumb", "carousel", "chart-card", "command", "data-table", "date-picker", "dialog", "dropdown-button", "dropdown-menu", "form", "input", "key-metrics", "page-header", "popover", "radio-group", "select", "separator", "table-cells", "page-scroll-nav", "tabs", "tip", "wizard", ]) /** * Returns `true` if the given design-system slug has at least one live preview * section (either from `component-docs/*.tsx` or from the PREVIEW_SECTIONS registry). */ export function designSystemHasLivePreview(slug: string): boolean { return COMPONENT_DOC_SLUGS.has(slug) || PREVIEW_SECTIONS_SLUGS.has(slug) }