@adieyal/catalogue-cli 0.1.0
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.
- package/dist/bin.d.ts +5 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +53 -0
- package/dist/bin.js.map +1 -0
- package/dist/commands/build.d.ts +9 -0
- package/dist/commands/build.d.ts.map +1 -0
- package/dist/commands/dev.d.ts +9 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/index.d.ts +8 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/init.d.ts +7 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/new.d.ts +11 -0
- package/dist/commands/new.d.ts.map +1 -0
- package/dist/commands/preview.d.ts +9 -0
- package/dist/commands/preview.d.ts.map +1 -0
- package/dist/commands/test.d.ts +10 -0
- package/dist/commands/test.d.ts.map +1 -0
- package/dist/commands/validate.d.ts +8 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/config/index.d.ts +3 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/loader.d.ts +17 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/schema.d.ts +229 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/init-CI0WzrG1.js +2702 -0
- package/dist/init-CI0WzrG1.js.map +1 -0
- package/dist/registry/file-loader.d.ts +21 -0
- package/dist/registry/file-loader.d.ts.map +1 -0
- package/dist/registry/index.d.ts +2 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/vite/entry.d.ts +6 -0
- package/dist/vite/entry.d.ts.map +1 -0
- package/dist/vite/index.d.ts +4 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/plugin.d.ts +15 -0
- package/dist/vite/plugin.d.ts.map +1 -0
- package/dist/vite/server.d.ts +15 -0
- package/dist/vite/server.d.ts.map +1 -0
- package/package.json +59 -0
- package/skills/document-component.md +83 -0
- package/skills/migrate-library.md +193 -0
- package/skills/new-component.md +98 -0
- package/skills/new-scenario.md +56 -0
- package/skills/setup-tokens.md +148 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-CI0WzrG1.js","sources":["../src/config/schema.ts","../src/config/loader.ts","../src/registry/file-loader.ts","../src/vite/plugin.ts","../src/vite/entry.ts","../src/vite/server.ts","../src/commands/dev.ts","../src/commands/build.ts","../src/commands/preview.ts","../../catalogue-core/dist/index.js","../src/commands/validate.ts","../src/commands/test.ts","../src/commands/new.ts","../src/commands/init.ts"],"sourcesContent":["/**\n * Configuration schema for catalogue.config.ts\n */\n\nimport { z } from 'zod';\n\nexport const CategoryDefinitionSchema = z.object({\n /** Unique category identifier (kebab-case) */\n id: z.string().min(1).regex(/^[a-z][a-z0-9-]*$/, {\n message: 'Category ID must be kebab-case starting with a letter'\n }),\n /** Human-readable label */\n label: z.string().min(1),\n /** Optional description */\n description: z.string().optional(),\n});\n\nexport type CategoryDefinition = z.infer<typeof CategoryDefinitionSchema>;\n\nexport const CategoriesConfigSchema = z.object({\n /** Category definitions */\n items: z.array(CategoryDefinitionSchema).default([]),\n /** Label for uncategorised components */\n uncategorisedLabel: z.string().optional().default('Other'),\n});\n\nexport const CatalogueConfigSchema = z.object({\n /** Title for the catalogue */\n title: z.string().optional().default('Component Catalogue'),\n\n /** Category configuration */\n categories: CategoriesConfigSchema.optional().default({ items: [], uncategorisedLabel: 'Other' }),\n\n /** Path to the registry directory (relative to config) */\n registryDir: z.string().optional().default('./registry'),\n\n /** Output directory for builds (relative to config) */\n outDir: z.string().optional().default('./dist/catalogue'),\n\n /** Base path for deployment (e.g., '/docs/ui/') */\n basePath: z.string().optional().default('/'),\n\n /** Port for dev server */\n port: z.number().optional().default(5173),\n\n /** Component imports configuration */\n components: z.object({\n /** Path to component entry point (relative to config) */\n entry: z.string().optional().default('./src/components/index.ts'),\n /** Package name for imports */\n package: z.string().optional(),\n }).optional().default({}),\n\n /** Playwright test configuration */\n playwright: z.object({\n /** Breakpoints for visual regression tests */\n breakpoints: z.array(z.object({\n name: z.string(),\n width: z.number(),\n height: z.number(),\n })).optional(),\n /** Themes to test */\n themes: z.array(z.enum(['light', 'dark'])).optional().default(['light', 'dark']),\n /** Screenshot directory */\n screenshotDir: z.string().optional().default('./screenshots'),\n }).optional().default({}),\n\n /** Additional Vite configuration */\n vite: z.record(z.unknown()).optional(),\n});\n\nexport type CatalogueConfig = z.infer<typeof CatalogueConfigSchema>;\n\nexport interface ResolvedConfig extends CatalogueConfig {\n /** Absolute path to config file */\n configPath: string;\n /** Absolute path to config directory */\n configDir: string;\n /** Absolute path to registry */\n registryPath: string;\n /** Absolute path to output directory */\n outPath: string;\n}\n\nexport function validateConfig(data: unknown): { success: true; data: CatalogueConfig } | { success: false; errors: string[] } {\n const result = CatalogueConfigSchema.safeParse(data);\n if (!result.success) {\n return {\n success: false,\n errors: result.error.errors.map(e => `${e.path.join('.')}: ${e.message}`),\n };\n }\n return { success: true, data: result.data };\n}\n","/**\n * Configuration loader for catalogue.config.ts\n */\n\nimport { pathToFileURL } from 'node:url';\nimport { resolve, dirname } from 'node:path';\nimport { existsSync } from 'node:fs';\nimport { validateConfig, type ResolvedConfig, type CatalogueConfig } from './schema.js';\n\nconst CONFIG_FILES = [\n 'catalogue.config.ts',\n 'catalogue.config.js',\n 'catalogue.config.mjs',\n];\n\nexport interface LoadConfigOptions {\n /** Working directory to search for config */\n cwd?: string;\n /** Explicit config file path */\n configFile?: string;\n}\n\n/**\n * Load and resolve the catalogue configuration.\n */\nexport async function loadConfig(options: LoadConfigOptions = {}): Promise<ResolvedConfig> {\n const cwd = options.cwd || process.cwd();\n let configPath: string | undefined;\n\n if (options.configFile) {\n configPath = resolve(cwd, options.configFile);\n if (!existsSync(configPath)) {\n throw new Error(`Config file not found: ${configPath}`);\n }\n } else {\n // Search for config file\n for (const filename of CONFIG_FILES) {\n const candidate = resolve(cwd, filename);\n if (existsSync(candidate)) {\n configPath = candidate;\n break;\n }\n }\n }\n\n if (!configPath) {\n throw new Error(\n `No catalogue config found in ${cwd}. ` +\n `Create one of: ${CONFIG_FILES.join(', ')}`\n );\n }\n\n // Load the config file\n const configUrl = pathToFileURL(configPath).href;\n let rawConfig: unknown;\n\n try {\n const module = await import(configUrl);\n rawConfig = module.default;\n } catch (error) {\n throw new Error(\n `Failed to load config from ${configPath}: ${error instanceof Error ? error.message : 'Unknown error'}`\n );\n }\n\n // Validate the config\n const result = validateConfig(rawConfig);\n if (!result.success) {\n throw new Error(\n `Invalid config in ${configPath}:\\n${result.errors.map(e => ` - ${e}`).join('\\n')}`\n );\n }\n\n const config = result.data;\n const configDir = dirname(configPath);\n\n // Resolve paths\n return {\n ...config,\n configPath,\n configDir,\n registryPath: resolve(configDir, config.registryDir),\n outPath: resolve(configDir, config.outDir),\n };\n}\n\n/**\n * Create a default config object.\n */\nexport function createDefaultConfig(): CatalogueConfig {\n return {\n title: 'Component Catalogue',\n categories: {\n items: [],\n uncategorisedLabel: 'Other',\n },\n registryDir: './registry',\n outDir: './dist/catalogue',\n basePath: '/',\n port: 5173,\n components: {\n entry: './src/components/index.ts',\n },\n playwright: {\n themes: ['light', 'dark'],\n screenshotDir: './screenshots',\n },\n };\n}\n","/**\n * File system registry loader.\n * Reads component, scenario, and example files from disk.\n */\n\nimport { readFileSync, readdirSync, existsSync, statSync } from 'node:fs';\nimport { join, relative, dirname } from 'node:path';\nimport type { RawRegistryData } from '@adieyal/catalogue-core';\n\nexport interface FileLoaderOptions {\n /** Path to the registry directory */\n registryPath: string;\n /** Base path for relative file paths */\n basePath?: string;\n}\n\n/**\n * Load all registry files from disk.\n */\nexport function loadRegistryFiles(options: FileLoaderOptions): RawRegistryData {\n const { registryPath, basePath = registryPath } = options;\n\n const components: RawRegistryData['components'] = [];\n const scenarios: RawRegistryData['scenarios'] = [];\n const examples: RawRegistryData['examples'] = [];\n\n // Load components\n const componentsDir = join(registryPath, 'components');\n if (existsSync(componentsDir)) {\n const componentDirs = readdirSync(componentsDir).filter(name => {\n const path = join(componentsDir, name);\n return statSync(path).isDirectory();\n });\n\n for (const componentId of componentDirs) {\n const componentDir = join(componentsDir, componentId);\n const componentJsonPath = join(componentDir, 'component.json');\n\n if (existsSync(componentJsonPath)) {\n try {\n const data = JSON.parse(readFileSync(componentJsonPath, 'utf-8'));\n const filePath = relative(basePath, componentJsonPath);\n\n // Load docs.md if exists\n let docs: string | undefined;\n const docsPath = join(componentDir, 'docs.md');\n if (existsSync(docsPath)) {\n docs = readFileSync(docsPath, 'utf-8');\n }\n\n components.push({ filePath, data, docs });\n } catch (error) {\n const err = error instanceof Error ? error.message : 'Unknown error';\n console.error(`Error loading ${componentJsonPath}: ${err}`);\n }\n }\n\n // Load scenarios for this component\n const scenariosDir = join(componentDir, 'scenarios');\n if (existsSync(scenariosDir)) {\n const scenarioFiles = readdirSync(scenariosDir).filter(name =>\n name.endsWith('.json')\n );\n\n for (const scenarioFile of scenarioFiles) {\n const scenarioPath = join(scenariosDir, scenarioFile);\n try {\n const data = JSON.parse(readFileSync(scenarioPath, 'utf-8'));\n const filePath = relative(basePath, scenarioPath);\n scenarios.push({ filePath, data });\n } catch (error) {\n const err = error instanceof Error ? error.message : 'Unknown error';\n console.error(`Error loading ${scenarioPath}: ${err}`);\n }\n }\n }\n }\n }\n\n // Load examples\n const examplesDir = join(registryPath, 'examples');\n if (existsSync(examplesDir)) {\n const exampleFiles = readdirSync(examplesDir).filter(name =>\n name.endsWith('.json')\n );\n\n for (const exampleFile of exampleFiles) {\n const examplePath = join(examplesDir, exampleFile);\n try {\n const data = JSON.parse(readFileSync(examplePath, 'utf-8'));\n const filePath = relative(basePath, examplePath);\n examples.push({ filePath, data });\n } catch (error) {\n const err = error instanceof Error ? error.message : 'Unknown error';\n console.error(`Error loading ${examplePath}: ${err}`);\n }\n }\n }\n\n return { components, scenarios, examples };\n}\n\n/**\n * Generate a virtual module that exports the registry data.\n */\nexport function generateRegistryModule(registryPath: string): string {\n const data = loadRegistryFiles({ registryPath });\n\n return `\n// Auto-generated registry data\nexport const registryData = ${JSON.stringify(data, null, 2)};\n`;\n}\n\n/**\n * Get list of all registry files for watching.\n */\nexport function getRegistryWatchPaths(registryPath: string): string[] {\n const paths: string[] = [];\n\n function walkDir(dir: string) {\n if (!existsSync(dir)) return;\n\n const entries = readdirSync(dir, { withFileTypes: true });\n for (const entry of entries) {\n const fullPath = join(dir, entry.name);\n if (entry.isDirectory()) {\n walkDir(fullPath);\n } else if (entry.name.endsWith('.json') || entry.name.endsWith('.md')) {\n paths.push(fullPath);\n }\n }\n }\n\n walkDir(registryPath);\n return paths;\n}\n","/**\n * Vite plugin for the catalogue.\n * Handles registry loading and hot module replacement.\n */\n\nimport type { Plugin, ViteDevServer } from 'vite';\nimport { loadRegistryFiles, getRegistryWatchPaths } from '../registry/file-loader.js';\nimport type { ResolvedConfig } from '../config/index.js';\n\nconst VIRTUAL_REGISTRY_ID = 'virtual:catalogue-registry';\nconst RESOLVED_VIRTUAL_REGISTRY_ID = '\\0' + VIRTUAL_REGISTRY_ID;\n\nexport interface CataloguePluginOptions {\n config: ResolvedConfig;\n}\n\n/**\n * Create the catalogue Vite plugin.\n */\nexport function cataloguePlugin(options: CataloguePluginOptions): Plugin {\n const { config } = options;\n let server: ViteDevServer | undefined;\n\n return {\n name: 'catalogue',\n\n configResolved(viteConfig) {\n // Store reference if needed\n },\n\n configureServer(_server) {\n server = _server;\n\n // Watch registry files for changes\n const watchPaths = getRegistryWatchPaths(config.registryPath);\n for (const path of watchPaths) {\n server.watcher.add(path);\n }\n\n // Trigger HMR on registry file changes\n server.watcher.on('change', (file) => {\n if (file.startsWith(config.registryPath)) {\n const module = server!.moduleGraph.getModuleById(RESOLVED_VIRTUAL_REGISTRY_ID);\n if (module) {\n server!.moduleGraph.invalidateModule(module);\n server!.ws.send({\n type: 'full-reload',\n path: '*',\n });\n }\n }\n });\n },\n\n resolveId(id) {\n if (id === VIRTUAL_REGISTRY_ID) {\n return RESOLVED_VIRTUAL_REGISTRY_ID;\n }\n },\n\n load(id) {\n if (id === RESOLVED_VIRTUAL_REGISTRY_ID) {\n const data = loadRegistryFiles({ registryPath: config.registryPath });\n\n // Include categories from config in registry data\n const registryData = {\n ...data,\n categories: config.categories,\n };\n\n return `\n export const registryData = ${JSON.stringify(registryData)};\n export const config = ${JSON.stringify({\n title: config.title,\n basePath: config.basePath,\n })};\n `;\n }\n },\n };\n}\n\n/**\n * Create the HTML template for the catalogue.\n */\nexport function createHtmlTemplate(config: ResolvedConfig): string {\n return `<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>${config.title}</title>\n <style>\n * {\n box-sizing: border-box;\n }\n\n :root {\n --catalogue-bg: #ffffff;\n --catalogue-text: #1a1a1a;\n --catalogue-border: #e5e5e5;\n --catalogue-primary: #3b82f6;\n --catalogue-code-bg: #f5f5f5;\n }\n\n [data-theme=\"dark\"] {\n --catalogue-bg: #1a1a1a;\n --catalogue-text: #f5f5f5;\n --catalogue-border: #333333;\n --catalogue-primary: #60a5fa;\n --catalogue-code-bg: #2a2a2a;\n }\n\n body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n background: var(--catalogue-bg);\n color: var(--catalogue-text);\n line-height: 1.5;\n }\n\n .catalogue-harness-body {\n padding: 0;\n margin: 0;\n }\n\n #app {\n min-height: 100vh;\n }\n\n /* Landing page styles */\n .catalogue-landing {\n max-width: 1200px;\n margin: 0 auto;\n padding: 2rem;\n }\n\n .catalogue-landing-header {\n margin-bottom: 2rem;\n }\n\n .catalogue-landing-title {\n margin: 0;\n font-size: 2rem;\n }\n\n .catalogue-landing-controls {\n display: flex;\n flex-direction: column;\n gap: 1rem;\n margin-bottom: 2rem;\n }\n\n .catalogue-search-input {\n width: 100%;\n padding: 0.75rem 1rem;\n font-size: 1rem;\n border: 1px solid var(--catalogue-border);\n border-radius: 0.5rem;\n background: var(--catalogue-bg);\n color: var(--catalogue-text);\n }\n\n .catalogue-filters {\n display: flex;\n flex-wrap: wrap;\n gap: 1rem;\n }\n\n .catalogue-filter-group {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n }\n\n .catalogue-filter-label {\n font-weight: 500;\n font-size: 0.875rem;\n }\n\n .catalogue-filter-option {\n display: flex;\n align-items: center;\n gap: 0.25rem;\n cursor: pointer;\n font-size: 0.875rem;\n }\n\n .catalogue-component-list {\n display: flex;\n flex-direction: column;\n gap: 1.5rem;\n }\n\n .catalogue-component-list--flat {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));\n }\n\n .catalogue-expand-toggle {\n padding: 0.5rem 1rem;\n font-size: 0.875rem;\n border: 1px solid var(--catalogue-border);\n border-radius: 0.375rem;\n background: var(--catalogue-bg);\n color: var(--catalogue-text);\n cursor: pointer;\n margin-left: auto;\n }\n\n .catalogue-expand-toggle:hover {\n background: var(--catalogue-code-bg);\n }\n\n .catalogue-category-section {\n border: 1px solid var(--catalogue-border);\n border-radius: 0.5rem;\n overflow: hidden;\n }\n\n .catalogue-category-header {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 1rem 1.25rem;\n background: var(--catalogue-code-bg);\n cursor: pointer;\n list-style: none;\n }\n\n .catalogue-category-header::-webkit-details-marker {\n display: none;\n }\n\n .catalogue-category-header::before {\n content: '▶';\n font-size: 0.75rem;\n transition: transform 0.2s;\n }\n\n .catalogue-category-section[open] .catalogue-category-header::before {\n transform: rotate(90deg);\n }\n\n .catalogue-category-label {\n font-weight: 600;\n font-size: 1rem;\n }\n\n .catalogue-category-count {\n font-size: 0.875rem;\n color: var(--catalogue-text);\n opacity: 0.6;\n }\n\n .catalogue-category-content {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));\n gap: 1.5rem;\n padding: 1.5rem;\n }\n\n .catalogue-component-card {\n border: 1px solid var(--catalogue-border);\n border-radius: 0.5rem;\n padding: 1.25rem;\n background: var(--catalogue-bg);\n }\n\n .catalogue-component-card-header {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n margin-bottom: 0.5rem;\n }\n\n .catalogue-component-card-title {\n margin: 0;\n font-size: 1.125rem;\n }\n\n .catalogue-component-card-title a {\n color: var(--catalogue-primary);\n text-decoration: none;\n }\n\n .catalogue-component-card-title a:hover {\n text-decoration: underline;\n }\n\n .catalogue-status-badge {\n font-size: 0.75rem;\n padding: 0.125rem 0.5rem;\n border-radius: 9999px;\n text-transform: uppercase;\n font-weight: 500;\n }\n\n .catalogue-status-badge[data-status=\"stable\"] {\n background: #dcfce7;\n color: #166534;\n }\n\n .catalogue-status-badge[data-status=\"beta\"] {\n background: #fef3c7;\n color: #92400e;\n }\n\n .catalogue-status-badge[data-status=\"deprecated\"] {\n background: #fee2e2;\n color: #991b1b;\n }\n\n [data-theme=\"dark\"] .catalogue-status-badge[data-status=\"stable\"] {\n background: #166534;\n color: #dcfce7;\n }\n\n [data-theme=\"dark\"] .catalogue-status-badge[data-status=\"beta\"] {\n background: #92400e;\n color: #fef3c7;\n }\n\n [data-theme=\"dark\"] .catalogue-status-badge[data-status=\"deprecated\"] {\n background: #991b1b;\n color: #fee2e2;\n }\n\n .catalogue-component-card-description {\n margin: 0.5rem 0;\n color: var(--catalogue-text);\n opacity: 0.8;\n font-size: 0.875rem;\n }\n\n .catalogue-component-card-tags {\n display: flex;\n flex-wrap: wrap;\n gap: 0.25rem;\n margin: 0.75rem 0;\n }\n\n .catalogue-tag {\n font-size: 0.75rem;\n padding: 0.125rem 0.5rem;\n background: var(--catalogue-code-bg);\n border-radius: 0.25rem;\n }\n\n .catalogue-component-card-meta {\n font-size: 0.75rem;\n color: var(--catalogue-text);\n opacity: 0.6;\n }\n\n /* Breadcrumb */\n .catalogue-breadcrumb {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n margin-bottom: 1rem;\n font-size: 0.875rem;\n }\n\n .catalogue-breadcrumb a {\n color: var(--catalogue-primary);\n text-decoration: none;\n }\n\n .catalogue-breadcrumb a:hover {\n text-decoration: underline;\n }\n\n .catalogue-breadcrumb-separator {\n color: var(--catalogue-text);\n opacity: 0.5;\n }\n\n /* Component page */\n .catalogue-component-page {\n max-width: 1200px;\n margin: 0 auto;\n padding: 2rem;\n }\n\n .catalogue-component-header {\n margin-bottom: 2rem;\n }\n\n .catalogue-component-title-row {\n display: flex;\n align-items: center;\n gap: 1rem;\n margin-bottom: 0.5rem;\n }\n\n .catalogue-component-title {\n margin: 0;\n font-size: 1.75rem;\n }\n\n .catalogue-component-description {\n margin: 0.5rem 0;\n font-size: 1rem;\n opacity: 0.8;\n }\n\n .catalogue-component-tags {\n display: flex;\n flex-wrap: wrap;\n gap: 0.5rem;\n margin: 1rem 0;\n }\n\n .catalogue-component-actions {\n margin-top: 1rem;\n }\n\n .catalogue-button {\n display: inline-block;\n padding: 0.5rem 1rem;\n border-radius: 0.375rem;\n text-decoration: none;\n font-size: 0.875rem;\n font-weight: 500;\n cursor: pointer;\n border: none;\n }\n\n .catalogue-button-primary {\n background: var(--catalogue-primary);\n color: white;\n }\n\n .catalogue-button-primary:hover {\n opacity: 0.9;\n }\n\n /* Variants grid */\n .catalogue-variants-section {\n margin-top: 2rem;\n }\n\n .catalogue-variants-section h2 {\n font-size: 1.25rem;\n margin-bottom: 1rem;\n }\n\n .catalogue-variants-grid {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));\n gap: 1.5rem;\n }\n\n .catalogue-scenario-card {\n border: 1px solid var(--catalogue-border);\n border-radius: 0.5rem;\n overflow: hidden;\n }\n\n .catalogue-scenario-card-primary {\n border-color: var(--catalogue-primary);\n }\n\n .catalogue-scenario-preview {\n padding: 1.5rem;\n background: var(--catalogue-bg);\n min-height: 100px;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .catalogue-scenario-info {\n padding: 1rem;\n border-top: 1px solid var(--catalogue-border);\n }\n\n .catalogue-scenario-title-row {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n }\n\n .catalogue-scenario-title {\n margin: 0;\n font-size: 0.875rem;\n font-weight: 500;\n }\n\n .catalogue-primary-badge {\n font-size: 0.625rem;\n padding: 0.125rem 0.375rem;\n background: var(--catalogue-primary);\n color: white;\n border-radius: 0.25rem;\n text-transform: uppercase;\n }\n\n .catalogue-scenario-description {\n margin: 0.5rem 0;\n font-size: 0.75rem;\n opacity: 0.7;\n }\n\n .catalogue-scenario-links {\n margin-top: 0.5rem;\n }\n\n .catalogue-link {\n font-size: 0.75rem;\n color: var(--catalogue-primary);\n text-decoration: none;\n }\n\n .catalogue-link:hover {\n text-decoration: underline;\n }\n\n /* Docs section */\n .catalogue-docs-section {\n margin-top: 2rem;\n padding-top: 2rem;\n border-top: 1px solid var(--catalogue-border);\n }\n\n .catalogue-docs-section h2 {\n font-size: 1.25rem;\n margin-bottom: 1rem;\n }\n\n .catalogue-docs-content {\n line-height: 1.7;\n }\n\n .catalogue-docs-content h1,\n .catalogue-docs-content h2,\n .catalogue-docs-content h3 {\n margin-top: 1.5rem;\n margin-bottom: 0.5rem;\n }\n\n .catalogue-docs-content pre {\n background: var(--catalogue-code-bg);\n padding: 1rem;\n border-radius: 0.375rem;\n overflow-x: auto;\n }\n\n .catalogue-docs-content code {\n font-family: ui-monospace, 'SF Mono', Menlo, Monaco, monospace;\n font-size: 0.875em;\n }\n\n /* Playground */\n .catalogue-playground {\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n }\n\n .catalogue-playground-header {\n padding: 1rem 2rem;\n border-bottom: 1px solid var(--catalogue-border);\n }\n\n .catalogue-playground-title-row {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n\n .catalogue-playground-title-row h1 {\n font-size: 1.25rem;\n margin: 0;\n }\n\n .catalogue-playground-main {\n display: flex;\n flex: 1;\n }\n\n .catalogue-playground-preview-section {\n flex: 1;\n padding: 1rem;\n display: flex;\n flex-direction: column;\n }\n\n .catalogue-scenario-selector {\n margin-bottom: 1rem;\n }\n\n .catalogue-scenario-select {\n padding: 0.375rem 0.75rem;\n border: 1px solid var(--catalogue-border);\n border-radius: 0.25rem;\n background: var(--catalogue-bg);\n color: var(--catalogue-text);\n }\n\n .catalogue-playground-sidebar {\n width: 350px;\n border-left: 1px solid var(--catalogue-border);\n display: flex;\n flex-direction: column;\n }\n\n .catalogue-playground-controls-section {\n padding: 1rem;\n border-bottom: 1px solid var(--catalogue-border);\n }\n\n .catalogue-playground-controls-section h2 {\n font-size: 0.875rem;\n margin: 0 0 1rem 0;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n opacity: 0.7;\n }\n\n .catalogue-playground-code-section {\n flex: 1;\n overflow: auto;\n }\n\n /* Controls */\n .catalogue-controls {\n display: flex;\n flex-direction: column;\n gap: 1rem;\n }\n\n .catalogue-control {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n }\n\n .catalogue-control-label {\n font-size: 0.75rem;\n font-weight: 500;\n }\n\n .catalogue-control-input,\n .catalogue-control-select {\n padding: 0.5rem;\n border: 1px solid var(--catalogue-border);\n border-radius: 0.25rem;\n background: var(--catalogue-bg);\n color: var(--catalogue-text);\n font-size: 0.875rem;\n }\n\n .catalogue-control-checkbox {\n display: flex;\n align-items: center;\n }\n\n .catalogue-control-radio-group {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n }\n\n .catalogue-control-radio {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n font-size: 0.875rem;\n cursor: pointer;\n }\n\n .catalogue-control-range-wrapper {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n }\n\n .catalogue-control-range {\n flex: 1;\n }\n\n .catalogue-control-range-value {\n font-size: 0.75rem;\n min-width: 3ch;\n text-align: right;\n }\n\n .catalogue-control-json {\n width: 100%;\n padding: 0.5rem;\n border: 1px solid var(--catalogue-border);\n border-radius: 0.25rem;\n background: var(--catalogue-bg);\n color: var(--catalogue-text);\n font-family: ui-monospace, monospace;\n font-size: 0.75rem;\n resize: vertical;\n }\n\n .catalogue-control-json.invalid {\n border-color: #ef4444;\n }\n\n /* Resizer */\n .catalogue-resizer-wrapper {\n flex: 1;\n display: flex;\n justify-content: center;\n padding: 1rem;\n }\n\n .catalogue-resizer {\n position: relative;\n border: 1px solid var(--catalogue-border);\n border-radius: 0.25rem;\n background: var(--catalogue-bg);\n overflow: hidden;\n }\n\n .catalogue-resizer-content {\n width: 100%;\n height: 100%;\n overflow: auto;\n padding: 1rem;\n }\n\n .catalogue-resizer-handle {\n position: absolute;\n background: transparent;\n }\n\n .catalogue-resizer-handle-right {\n right: 0;\n top: 0;\n bottom: 0;\n width: 8px;\n cursor: ew-resize;\n }\n\n .catalogue-resizer-handle-bottom {\n bottom: 0;\n left: 0;\n right: 0;\n height: 8px;\n cursor: ns-resize;\n }\n\n .catalogue-resizer-handle-corner {\n right: 0;\n bottom: 0;\n width: 16px;\n height: 16px;\n cursor: nwse-resize;\n }\n\n .catalogue-resizer-dimensions {\n position: absolute;\n bottom: 4px;\n right: 20px;\n font-size: 0.625rem;\n color: var(--catalogue-text);\n opacity: 0.5;\n font-family: ui-monospace, monospace;\n }\n\n .catalogue-breakpoint-presets {\n display: flex;\n flex-wrap: wrap;\n gap: 0.5rem;\n margin-bottom: 1rem;\n }\n\n .catalogue-breakpoint-button {\n padding: 0.25rem 0.5rem;\n font-size: 0.75rem;\n border: 1px solid var(--catalogue-border);\n border-radius: 0.25rem;\n background: var(--catalogue-bg);\n color: var(--catalogue-text);\n cursor: pointer;\n }\n\n .catalogue-breakpoint-button:hover {\n background: var(--catalogue-code-bg);\n }\n\n /* Code panel */\n .catalogue-code-panel {\n border-top: 1px solid var(--catalogue-border);\n }\n\n .catalogue-code-panel-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0.75rem 1rem;\n border-bottom: 1px solid var(--catalogue-border);\n }\n\n .catalogue-code-panel-title {\n font-size: 0.75rem;\n font-weight: 500;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n }\n\n .catalogue-code-panel-copy {\n padding: 0.25rem 0.5rem;\n font-size: 0.75rem;\n border: 1px solid var(--catalogue-border);\n border-radius: 0.25rem;\n background: var(--catalogue-bg);\n color: var(--catalogue-text);\n cursor: pointer;\n }\n\n .catalogue-code-panel-copy.copied {\n background: #22c55e;\n color: white;\n border-color: #22c55e;\n }\n\n .catalogue-code-panel-content {\n margin: 0;\n padding: 1rem;\n background: var(--catalogue-code-bg);\n overflow-x: auto;\n font-size: 0.75rem;\n line-height: 1.5;\n }\n\n .catalogue-code-panel-content code {\n font-family: ui-monospace, 'SF Mono', Menlo, Monaco, monospace;\n }\n\n .catalogue-code-panel[data-collapsed] .catalogue-code-panel-content {\n display: none;\n }\n\n /* Theme toggle */\n .catalogue-theme-toggle {\n padding: 0.5rem;\n border: 1px solid var(--catalogue-border);\n border-radius: 0.375rem;\n background: var(--catalogue-bg);\n color: var(--catalogue-text);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .catalogue-theme-toggle:hover {\n background: var(--catalogue-code-bg);\n }\n\n /* Harness */\n .catalogue-harness {\n min-height: 100vh;\n }\n\n .catalogue-harness-container {\n display: inline-block;\n }\n\n /* Global header */\n .catalogue-global-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0.75rem 2rem;\n border-bottom: 1px solid var(--catalogue-border);\n background: var(--catalogue-bg);\n }\n\n .catalogue-home-link {\n font-weight: 600;\n color: var(--catalogue-text);\n text-decoration: none;\n }\n\n .catalogue-home-link:hover {\n color: var(--catalogue-primary);\n }\n\n /* Not found */\n .catalogue-not-found {\n max-width: 600px;\n margin: 4rem auto;\n text-align: center;\n padding: 2rem;\n }\n\n .catalogue-not-found h1 {\n font-size: 1.5rem;\n margin-bottom: 0.5rem;\n }\n\n .catalogue-not-found a {\n color: var(--catalogue-primary);\n }\n\n /* Empty state */\n .catalogue-empty-state {\n grid-column: 1 / -1;\n text-align: center;\n padding: 3rem;\n color: var(--catalogue-text);\n opacity: 0.6;\n }\n\n /* Subcomponents */\n .catalogue-subcomponents-section {\n margin-top: 2rem;\n }\n\n .catalogue-subcomponents-section h2 {\n font-size: 1.25rem;\n margin-bottom: 1rem;\n }\n\n .catalogue-subcomponents-list {\n display: flex;\n flex-wrap: wrap;\n gap: 1rem;\n }\n\n .catalogue-subcomponent-card {\n padding: 1rem;\n border: 1px solid var(--catalogue-border);\n border-radius: 0.375rem;\n }\n\n .catalogue-subcomponent-card a {\n color: var(--catalogue-primary);\n text-decoration: none;\n font-weight: 500;\n }\n\n .catalogue-subcomponent-card p {\n margin: 0.5rem 0 0;\n font-size: 0.875rem;\n opacity: 0.7;\n }\n </style>\n</head>\n<body>\n <div id=\"app\"></div>\n <script type=\"module\" src=\"/@catalogue/entry.ts\"></script>\n</body>\n</html>`;\n}\n","/**\n * Virtual entry module template.\n * This is transformed and served by the Vite plugin.\n */\n\nexport const entryTemplate = `\nimport { loadRegistry, mountCatalogueApp } from '@adieyal/catalogue-core';\nimport { registryData, config } from 'virtual:catalogue-registry';\n\n// Import consumer's components\nimport '{{COMPONENTS_ENTRY}}';\n\n// Load and validate the registry\nconst { registry, errors } = loadRegistry(registryData);\n\nif (errors.length > 0) {\n console.error('Registry validation errors:', errors);\n}\n\n// Mount the app\nconst app = mountCatalogueApp('#app', registry, {\n basePath: config.basePath,\n});\n\n// Hot module replacement\nif (import.meta.hot) {\n import.meta.hot.accept('virtual:catalogue-registry', (newModule) => {\n if (newModule) {\n window.location.reload();\n }\n });\n}\n`;\n","/**\n * Vite server configuration for the catalogue.\n */\n\nimport { createServer, build as viteBuild, preview as vitePreview, type InlineConfig } from 'vite';\nimport { resolve } from 'node:path';\nimport { cataloguePlugin, createHtmlTemplate } from './plugin.js';\nimport { entryTemplate } from './entry.js';\nimport type { ResolvedConfig } from '../config/index.js';\n\nconst VIRTUAL_ENTRY_ID = '@catalogue/entry.ts';\nconst RESOLVED_VIRTUAL_ENTRY_ID = '\\0' + VIRTUAL_ENTRY_ID;\nconst VIRTUAL_ENTRY_PATH = '/@catalogue/entry.ts';\n\n/**\n * Create base Vite config for the catalogue.\n */\nfunction createViteConfig(config: ResolvedConfig, mode: 'development' | 'production'): InlineConfig {\n const componentsEntry = config.components?.entry\n ? resolve(config.configDir, config.components.entry)\n : resolve(config.configDir, './src/components/index.ts');\n\n return {\n root: config.configDir,\n base: config.basePath,\n mode,\n define: {\n 'process.env.NODE_ENV': JSON.stringify(mode),\n },\n plugins: [\n cataloguePlugin({ config }),\n {\n name: 'catalogue-entry',\n enforce: 'pre',\n resolveId(id) {\n if (id === VIRTUAL_ENTRY_ID || id === VIRTUAL_ENTRY_PATH || id.endsWith('@catalogue/entry.ts')) {\n return RESOLVED_VIRTUAL_ENTRY_ID;\n }\n },\n load(id) {\n if (id === RESOLVED_VIRTUAL_ENTRY_ID) {\n return entryTemplate.replace('{{COMPONENTS_ENTRY}}', componentsEntry);\n }\n },\n },\n {\n name: 'catalogue-html',\n configureServer(server) {\n server.middlewares.use((req, res, next) => {\n if (req.url === '/' || req.url?.startsWith('/?')) {\n res.setHeader('Content-Type', 'text/html');\n server.transformIndexHtml('/', createHtmlTemplate(config)).then(html => {\n res.end(html);\n });\n return;\n }\n next();\n });\n },\n // Only transform HTML in dev mode - production uses the written index.html\n transformIndexHtml: {\n order: 'pre',\n handler(html, ctx) {\n // In dev mode, return our template\n if (ctx.server) {\n return createHtmlTemplate(config);\n }\n // In build mode, don't transform - let Vite process the file as-is\n return html;\n },\n },\n },\n ],\n server: {\n port: config.port,\n },\n build: {\n outDir: config.outPath,\n emptyOutDir: true,\n },\n ...(config.vite || {}),\n };\n}\n\n/**\n * Start the development server.\n */\nexport async function startDevServer(config: ResolvedConfig): Promise<void> {\n const viteConfig = createViteConfig(config, 'development');\n\n const server = await createServer(viteConfig);\n await server.listen();\n\n server.printUrls();\n}\n\n/**\n * Build the static site.\n */\nexport async function buildStatic(config: ResolvedConfig): Promise<void> {\n const viteConfig = createViteConfig(config, 'production');\n\n // Generate index.html and entry.ts for build\n const { writeFileSync, mkdirSync, existsSync } = await import('node:fs');\n const { join } = await import('node:path');\n\n // Ensure output directory exists\n if (!existsSync(config.configDir)) {\n mkdirSync(config.configDir, { recursive: true });\n }\n\n // Resolve components entry\n const componentsEntry = config.components?.entry\n ? resolve(config.configDir, config.components.entry)\n : resolve(config.configDir, './src/components/index.ts');\n\n // Write temporary entry.ts that will be bundled\n const entryPath = join(config.configDir, '.catalogue-entry.ts');\n writeFileSync(entryPath, entryTemplate.replace('{{COMPONENTS_ENTRY}}', componentsEntry));\n\n // Write temporary index.html pointing to the entry\n const indexPath = join(config.configDir, 'index.html');\n writeFileSync(indexPath, createHtmlTemplate(config).replace(\n '/@catalogue/entry.ts',\n './.catalogue-entry.ts'\n ));\n\n try {\n await viteBuild(viteConfig);\n } finally {\n // Clean up temporary files\n const { unlinkSync } = await import('node:fs');\n try {\n unlinkSync(indexPath);\n unlinkSync(entryPath);\n } catch {\n // Ignore cleanup errors\n }\n }\n}\n\n/**\n * Start the preview server.\n */\nexport async function startPreviewServer(config: ResolvedConfig): Promise<void> {\n const viteConfig = createViteConfig(config, 'production');\n\n const server = await vitePreview({\n ...viteConfig,\n preview: {\n port: config.port,\n },\n });\n\n server.printUrls();\n}\n","/**\n * Dev command - Start the Vite development server.\n */\n\nimport { loadConfig } from '../config/index.js';\nimport { startDevServer } from '../vite/server.js';\nimport pc from 'picocolors';\n\nexport interface DevOptions {\n config?: string;\n port?: number;\n}\n\nexport async function dev(options: DevOptions = {}): Promise<void> {\n console.log(pc.cyan('Starting development server...'));\n\n try {\n const config = await loadConfig({\n configFile: options.config,\n });\n\n if (options.port) {\n config.port = options.port;\n }\n\n await startDevServer(config);\n } catch (error) {\n console.error(pc.red('Error starting dev server:'));\n console.error(error instanceof Error ? error.message : error);\n process.exit(1);\n }\n}\n","/**\n * Build command - Build the static catalogue site.\n */\n\nimport { loadConfig } from '../config/index.js';\nimport { buildStatic } from '../vite/server.js';\nimport pc from 'picocolors';\n\nexport interface BuildOptions {\n config?: string;\n outDir?: string;\n}\n\nexport async function build(options: BuildOptions = {}): Promise<void> {\n console.log(pc.cyan('Building catalogue...'));\n\n try {\n const config = await loadConfig({\n configFile: options.config,\n });\n\n if (options.outDir) {\n config.outPath = options.outDir;\n }\n\n await buildStatic(config);\n\n console.log(pc.green(`✓ Built to ${config.outPath}`));\n } catch (error) {\n console.error(pc.red('Error building catalogue:'));\n console.error(error instanceof Error ? error.message : error);\n process.exit(1);\n }\n}\n","/**\n * Preview command - Serve the built catalogue.\n */\n\nimport { loadConfig } from '../config/index.js';\nimport { startPreviewServer } from '../vite/server.js';\nimport pc from 'picocolors';\n\nexport interface PreviewOptions {\n config?: string;\n port?: number;\n}\n\nexport async function preview(options: PreviewOptions = {}): Promise<void> {\n console.log(pc.cyan('Starting preview server...'));\n\n try {\n const config = await loadConfig({\n configFile: options.config,\n });\n\n if (options.port) {\n config.port = options.port;\n }\n\n await startPreviewServer(config);\n } catch (error) {\n console.error(pc.red('Error starting preview server:'));\n console.error(error instanceof Error ? error.message : error);\n process.exit(1);\n }\n}\n","var le = Object.defineProperty;\nvar ie = (t, e, a) => e in t ? le(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;\nvar V = (t, e, a) => ie(t, typeof e != \"symbol\" ? e + \"\" : e, a);\nimport { z as l } from \"zod\";\nimport { marked as de } from \"marked\";\nconst ue = l.object({\n /** Element tag name (e.g., 'div', 'my-component') */\n element: l.string().min(1),\n /** DOM attributes (set via setAttribute) */\n attrs: l.record(l.union([l.string(), l.number(), l.boolean(), l.null()])).optional(),\n /** DOM properties (set directly on element, for objects/arrays) */\n props: l.record(l.unknown()).optional(),\n /** Text content (mutually exclusive with children) */\n text: l.string().optional()\n}), R = ue.extend({\n /** Named slots - content to render with slot attribute */\n slots: l.record(l.union([\n l.string(),\n l.lazy(() => R),\n l.array(l.lazy(() => R))\n ])).optional(),\n /** Child elements */\n children: l.array(l.lazy(() => R)).optional()\n});\nfunction ut(t) {\n const e = R.safeParse(t);\n return e.success ? { success: !0, data: e.data } : {\n success: !1,\n errors: e.error.errors.map((a) => `${a.path.join(\".\")}: ${a.message}`)\n };\n}\nconst pe = l.object({\n type: l.literal(\"text\"),\n label: l.string().optional(),\n defaultValue: l.string().optional(),\n placeholder: l.string().optional()\n}), me = l.object({\n type: l.literal(\"number\"),\n label: l.string().optional(),\n defaultValue: l.number().optional(),\n min: l.number().optional(),\n max: l.number().optional(),\n step: l.number().optional()\n}), he = l.object({\n type: l.literal(\"boolean\"),\n label: l.string().optional(),\n defaultValue: l.boolean().optional()\n}), ge = l.object({\n type: l.literal(\"select\"),\n label: l.string().optional(),\n defaultValue: l.string().optional(),\n options: l.array(l.union([\n l.string(),\n l.object({\n label: l.string(),\n value: l.string()\n })\n ]))\n}), fe = l.object({\n type: l.literal(\"radio\"),\n label: l.string().optional(),\n defaultValue: l.string().optional(),\n options: l.array(l.union([\n l.string(),\n l.object({\n label: l.string(),\n value: l.string()\n })\n ]))\n}), Ce = l.object({\n type: l.literal(\"color\"),\n label: l.string().optional(),\n defaultValue: l.string().optional()\n}), be = l.object({\n type: l.literal(\"range\"),\n label: l.string().optional(),\n defaultValue: l.number().optional(),\n min: l.number(),\n max: l.number(),\n step: l.number().optional()\n}), ve = l.object({\n type: l.literal(\"json\"),\n label: l.string().optional(),\n defaultValue: l.unknown().optional()\n}), Z = l.discriminatedUnion(\"type\", [\n pe,\n me,\n he,\n ge,\n fe,\n Ce,\n be,\n ve\n]);\nfunction pt(t) {\n const e = Z.safeParse(t);\n return e.success ? { success: !0, data: e.data } : {\n success: !1,\n errors: e.error.errors.map((a) => `${a.path.join(\".\")}: ${a.message}`)\n };\n}\nconst ye = l.enum([\"stable\", \"beta\", \"deprecated\"]), Ee = l.enum([\"standalone\", \"subcomponent\", \"feature\"]), xe = l.object({\n /** Custom element tag name (must be kebab-case with at least one hyphen) */\n customElement: l.string().regex(/^[a-z][a-z0-9]*-[a-z0-9-]+$/, {\n message: 'Custom element name must be kebab-case with at least one hyphen (e.g., \"my-button\")'\n }),\n /** npm package name (optional, defaults to consumer's package) */\n package: l.string().optional(),\n /** Entry point path (optional, defaults to main entry) */\n entry: l.string().optional()\n}), we = l.object({\n /** ID of the primary scenario to use as default in playground */\n primaryScenarioId: l.string().min(1),\n /** Control definitions keyed by property name */\n controls: l.record(Z)\n}), Ne = l.object({\n /** Unique identifier for the component (kebab-case) */\n id: l.string().min(1).regex(/^[a-z][a-z0-9-]*$/, {\n message: \"Component ID must be kebab-case starting with a letter\"\n }),\n /** Human-readable title */\n title: l.string().min(1),\n /** Component maturity status */\n status: ye,\n /** Component kind */\n kind: Ee,\n /** Optional description */\n description: l.string().optional(),\n /** Tags for search and filtering */\n tags: l.array(l.string()).optional(),\n /** Category ID (must match a category defined in config) */\n category: l.string().regex(/^[a-z][a-z0-9-]*$/, {\n message: \"Category must be kebab-case starting with a letter\"\n }).optional(),\n /** Export configuration */\n exports: xe,\n /** Playground configuration */\n playground: we,\n /** Parent component ID (required when kind is 'subcomponent') */\n parentId: l.string().optional(),\n /** List of subcomponent IDs */\n subcomponents: l.array(l.string()).optional()\n}).refine(\n (t) => !(t.kind === \"subcomponent\" && !t.parentId),\n {\n message: \"Subcomponents must have a parentId\",\n path: [\"parentId\"]\n }\n);\nfunction $e(t) {\n const e = Ne.safeParse(t);\n return e.success ? { success: !0, data: e.data } : {\n success: !1,\n errors: e.error.errors.map((a) => ({\n path: a.path.join(\".\") || \"(root)\",\n message: a.message\n }))\n };\n}\nfunction mt(t, e) {\n const a = e ? `${e}: ` : \"\";\n return t.map((o) => `${a}${o.path}: ${o.message}`).join(`\n`);\n}\nconst ee = l.object({\n /** Unique identifier for the scenario (kebab-case) */\n id: l.string().min(1).regex(/^[a-z][a-z0-9-]*$/, {\n message: \"Scenario ID must be kebab-case starting with a letter\"\n }),\n /** Human-readable title */\n title: l.string().min(1),\n /** Optional description explaining the scenario */\n description: l.string().optional(),\n /** Component ID this scenario belongs to */\n componentId: l.string().min(1),\n /** Tags for search and filtering */\n tags: l.array(l.string()).optional(),\n /** The RenderNode tree that defines the DOM structure */\n render: R,\n /** Optional viewport configuration for screenshots */\n viewport: l.object({\n width: l.number().positive().optional(),\n height: l.number().positive().optional()\n }).optional(),\n /** Optional background color override */\n background: l.string().optional(),\n /** Whether this is the primary scenario (shown first) */\n primary: l.boolean().optional()\n}), ht = ee;\nfunction te(t) {\n const e = ee.safeParse(t);\n return e.success ? { success: !0, data: e.data } : {\n success: !1,\n errors: e.error.errors.map((a) => ({\n path: a.path.join(\".\") || \"(root)\",\n message: a.message\n }))\n };\n}\nfunction Se(t) {\n return te(t);\n}\nfunction gt(t, e) {\n const a = e ? `${e}: ` : \"\";\n return t.map((o) => `${a}${o.path}: ${o.message}`).join(`\n`);\n}\nfunction ft(t) {\n const e = [], a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();\n for (const { filePath: s, data: i, docs: c } of t.components) {\n const d = $e(i);\n if (d.success) {\n if (d.data) {\n const u = d.data;\n a.set(u.id, {\n ...u,\n filePath: s,\n docs: c,\n scenarios: []\n });\n }\n } else for (const u of d.errors || [])\n e.push({\n file: s,\n path: u.path,\n message: u.message\n });\n }\n for (const { filePath: s, data: i } of t.scenarios) {\n const c = te(i);\n if (c.success) {\n if (c.data) {\n const d = c.data, u = {\n ...d,\n filePath: s\n };\n o.set(d.id, u);\n const h = a.get(d.componentId);\n h && h.scenarios.push(u);\n }\n } else for (const d of c.errors || [])\n e.push({\n file: s,\n path: d.path,\n message: d.message\n });\n }\n for (const { filePath: s, data: i } of t.examples) {\n const c = Se(i);\n if (c.success) {\n if (c.data) {\n const d = c.data;\n n.set(d.id, {\n ...d,\n filePath: s\n });\n }\n } else for (const d of c.errors || [])\n e.push({\n file: s,\n path: d.path,\n message: d.message\n });\n }\n const r = t.categories ?? {\n items: [],\n uncategorisedLabel: \"Other\"\n };\n return {\n registry: { components: a, scenarios: o, examples: n, categories: r },\n errors: e\n };\n}\nfunction Ct() {\n return {\n components: /* @__PURE__ */ new Map(),\n scenarios: /* @__PURE__ */ new Map(),\n examples: /* @__PURE__ */ new Map(),\n categories: { items: [], uncategorisedLabel: \"Other\" }\n };\n}\nfunction ke(t) {\n return Array.from(t.components.values()).filter((e) => e.kind !== \"subcomponent\");\n}\nfunction Le(t, e) {\n return Array.from(t.components.values()).filter((a) => a.parentId === e);\n}\nfunction Ae(t, e, a) {\n const o = e.toLowerCase();\n return Array.from(t.components.values()).filter((n) => {\n var r, s, i, c, d, u;\n if (n.kind === \"subcomponent\")\n return !1;\n if (e) {\n const h = n.id.toLowerCase().includes(o), p = n.title.toLowerCase().includes(o), g = (r = n.tags) == null ? void 0 : r.some(\n ($) => $.toLowerCase().includes(o)\n ), N = (s = n.description) == null ? void 0 : s.toLowerCase().includes(o);\n if (!h && !p && !g && !N)\n return !1;\n }\n return !((i = a == null ? void 0 : a.status) != null && i.length && !a.status.includes(n.status) || (c = a == null ? void 0 : a.kind) != null && c.length && !a.kind.includes(n.kind) || (d = a == null ? void 0 : a.tags) != null && d.length && !((u = n.tags) == null ? void 0 : u.some(\n (p) => a.tags.includes(p)\n )));\n });\n}\nfunction Y(t) {\n const e = ke(t), a = /* @__PURE__ */ new Map(), o = [];\n for (const r of e)\n r.category ? (a.has(r.category) || a.set(r.category, []), a.get(r.category).push(r)) : o.push(r);\n const n = [];\n for (const r of t.categories.items) {\n const s = a.get(r.id) || [];\n s.length > 0 && n.push({ category: r, components: s });\n }\n return o.length > 0 && n.push({ category: null, components: o }), n;\n}\nfunction bt(t) {\n const e = [], a = [], o = /* @__PURE__ */ new Map();\n for (const [n, r] of t.components)\n o.has(n) || o.set(n, []), o.get(n).push(r.filePath);\n for (const [n, r] of t.scenarios)\n o.has(n) || o.set(n, []), o.get(n).push(r.filePath);\n for (const [n, r] of t.examples)\n o.has(n) || o.set(n, []), o.get(n).push(r.filePath);\n for (const [n, r] of o)\n r.length > 1 && e.push({\n file: r.join(\", \"),\n path: \"id\",\n message: `Duplicate ID \"${n}\" found in multiple files`\n });\n for (const [n, r] of t.components) {\n const s = r.playground.primaryScenarioId;\n if (r.scenarios.some((c) => c.id === s) || e.push({\n file: r.filePath,\n path: \"playground.primaryScenarioId\",\n message: `Primary scenario \"${s}\" not found for component \"${n}\"`\n }), r.parentId && (t.components.has(r.parentId) || e.push({\n file: r.filePath,\n path: \"parentId\",\n message: `Parent component \"${r.parentId}\" not found for component \"${n}\"`\n })), r.subcomponents)\n for (const c of r.subcomponents)\n if (!t.components.has(c))\n e.push({\n file: r.filePath,\n path: \"subcomponents\",\n message: `Subcomponent \"${c}\" not found for component \"${n}\"`\n });\n else {\n const d = t.components.get(c);\n d.parentId !== n && a.push({\n file: r.filePath,\n path: \"subcomponents\",\n message: `Subcomponent \"${c}\" has different parentId \"${d.parentId}\" than expected \"${n}\"`\n });\n }\n r.scenarios.length === 0 && e.push({\n file: r.filePath,\n path: \"scenarios\",\n message: `Component \"${n}\" has no scenarios`\n });\n }\n for (const [n, r] of t.scenarios)\n t.components.has(r.componentId) || e.push({\n file: r.filePath,\n path: \"componentId\",\n message: `Component \"${r.componentId}\" not found for scenario \"${n}\"`\n });\n for (const [n, r] of t.examples)\n t.components.has(r.componentId) || e.push({\n file: r.filePath,\n path: \"componentId\",\n message: `Component \"${r.componentId}\" not found for example \"${n}\"`\n });\n return {\n valid: e.length === 0,\n errors: e,\n warnings: a\n };\n}\nfunction vt(t) {\n const e = [];\n if (t.errors.length > 0) {\n e.push(\"Errors:\");\n for (const a of t.errors)\n e.push(` ${a.file}: ${a.path}: ${a.message}`);\n }\n if (t.warnings.length > 0) {\n e.push(\"Warnings:\");\n for (const a of t.warnings)\n e.push(` ${a.file}: ${a.path}: ${a.message}`);\n }\n return e.join(`\n`);\n}\nfunction D(t) {\n const e = document.createElement(t.element);\n if (t.attrs)\n for (const [a, o] of Object.entries(t.attrs))\n o != null && (typeof o == \"boolean\" ? o && e.setAttribute(a, \"\") : e.setAttribute(a, String(o)));\n if (t.props)\n for (const [a, o] of Object.entries(t.props))\n e[a] = o;\n if (t.text !== void 0 && (e.textContent = t.text), t.slots)\n for (const [a, o] of Object.entries(t.slots))\n Ie(e, a, o);\n if (t.children)\n for (const a of t.children) {\n const o = D(a);\n e.appendChild(o);\n }\n return e;\n}\nfunction Ie(t, e, a) {\n if (typeof a == \"string\") {\n const o = document.createElement(\"span\");\n e !== \"default\" && o.setAttribute(\"slot\", e), o.textContent = a, t.appendChild(o);\n } else if (Array.isArray(a))\n for (const o of a) {\n const n = D(o);\n e !== \"default\" && n.setAttribute(\"slot\", e), t.appendChild(n);\n }\n else {\n const o = D(a);\n e !== \"default\" && o.setAttribute(\"slot\", e), t.appendChild(o);\n }\n}\nfunction ne(t, e) {\n var o;\n const a = [];\n e.clear && (e.container.innerHTML = \"\");\n try {\n const n = D(t);\n return e.container.appendChild(n), { element: n, errors: a };\n } catch (n) {\n const r = n instanceof Error ? n : new Error(String(n));\n a.push({ node: t, error: r }), (o = e.onError) == null || o.call(e, r, t);\n const s = document.createElement(\"div\");\n return s.setAttribute(\"data-catalogue-error\", \"\"), s.textContent = `Render error: ${r.message}`, s.style.cssText = \"color: red; padding: 1em; border: 1px solid red; font-family: monospace;\", e.container.appendChild(s), { element: s, errors: a };\n }\n}\nfunction ae(t, e, a) {\n if (e) {\n const o = t.getAttributeNames();\n for (const n of o)\n n in e || t.removeAttribute(n);\n for (const [n, r] of Object.entries(e))\n r == null ? t.removeAttribute(n) : typeof r == \"boolean\" ? r ? t.setAttribute(n, \"\") : t.removeAttribute(n) : t.setAttribute(n, String(r));\n }\n if (a)\n for (const [o, n] of Object.entries(a))\n t[o] = n;\n}\nfunction yt(t, e) {\n ae(t, e.attrs, e.props), e.text !== void 0 && (t.textContent = e.text);\n}\nconst oe = \"catalogue-theme\";\nfunction Pe() {\n const t = localStorage.getItem(oe);\n return t === \"dark\" || t === \"light\" ? t : window.matchMedia(\"(prefers-color-scheme: dark)\").matches ? \"dark\" : \"light\";\n}\nfunction J(t) {\n localStorage.setItem(oe, t), document.documentElement.setAttribute(\"data-theme\", t), document.querySelectorAll(\"[data-catalogue-container]\").forEach((e) => {\n e.setAttribute(\"data-theme\", t);\n });\n}\nfunction Te() {\n const e = (document.documentElement.getAttribute(\"data-theme\") || \"light\") === \"light\" ? \"dark\" : \"light\";\n return J(e), e;\n}\nfunction re() {\n const t = Pe();\n return J(t), t;\n}\nfunction se() {\n const t = document.createElement(\"button\");\n t.className = \"catalogue-theme-toggle\", t.setAttribute(\"type\", \"button\"), t.setAttribute(\"aria-label\", \"Toggle theme\"), t.setAttribute(\"title\", \"Toggle light/dark theme\");\n const e = () => {\n const a = document.documentElement.getAttribute(\"data-theme\") || \"light\";\n t.innerHTML = a === \"light\" ? '<svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z\"/></svg>' : '<svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><circle cx=\"12\" cy=\"12\" r=\"5\"/><line x1=\"12\" y1=\"1\" x2=\"12\" y2=\"3\"/><line x1=\"12\" y1=\"21\" x2=\"12\" y2=\"23\"/><line x1=\"4.22\" y1=\"4.22\" x2=\"5.64\" y2=\"5.64\"/><line x1=\"18.36\" y1=\"18.36\" x2=\"19.78\" y2=\"19.78\"/><line x1=\"1\" y1=\"12\" x2=\"3\" y2=\"12\"/><line x1=\"21\" y1=\"12\" x2=\"23\" y2=\"12\"/><line x1=\"4.22\" y1=\"19.78\" x2=\"5.64\" y2=\"18.36\"/><line x1=\"18.36\" y1=\"5.64\" x2=\"19.78\" y2=\"4.22\"/></svg>';\n };\n return e(), t.addEventListener(\"click\", () => {\n Te(), e();\n }), t;\n}\nconst Me = [\n { name: \"Mobile S\", width: 320, height: 568 },\n { name: \"Mobile M\", width: 375, height: 667 },\n { name: \"Mobile L\", width: 425, height: 812 },\n { name: \"Tablet\", width: 768, height: 1024 },\n { name: \"Laptop\", width: 1024, height: 768 },\n { name: \"Desktop\", width: 1440, height: 900 },\n { name: \"Full\", width: 0, height: 0, fullScreen: !0 }\n], je = \"width 0.3s ease, height 0.3s ease\";\nfunction ze(t = {}) {\n const {\n initialWidth: e = \"100%\",\n initialHeight: a = \"auto\",\n minWidth: o = 200,\n minHeight: n = 100,\n maxWidth: r = 2e3,\n maxHeight: s = 2e3,\n onResize: i,\n onFullScreenChange: c,\n animatePresets: d = !0\n } = t;\n let u = !1;\n const h = document.createElement(\"div\");\n h.className = \"catalogue-resizer-wrapper\";\n const p = document.createElement(\"div\");\n p.className = \"catalogue-resizer\", p.setAttribute(\"data-catalogue-container\", \"\"), p.style.width = e, p.style.height = a, p.style.minWidth = `${o}px`, p.style.minHeight = `${n}px`;\n const g = document.createElement(\"div\");\n g.className = \"catalogue-resizer-content\", g.style.cssText = \"container-type: inline-size; width: 100%; height: 100%;\", p.appendChild(g);\n const N = document.createElement(\"div\");\n N.className = \"catalogue-resizer-handle catalogue-resizer-handle-right\";\n const $ = document.createElement(\"div\");\n $.className = \"catalogue-resizer-handle catalogue-resizer-handle-bottom\";\n const I = document.createElement(\"div\");\n I.className = \"catalogue-resizer-handle catalogue-resizer-handle-corner\", p.appendChild(N), p.appendChild($), p.appendChild(I);\n const b = document.createElement(\"div\");\n b.className = \"catalogue-resizer-dimensions\", p.appendChild(b);\n const S = () => {\n if (u)\n b.textContent = \"Full Screen\";\n else {\n const y = p.getBoundingClientRect();\n b.textContent = `${Math.round(y.width)} × ${Math.round(y.height)}`;\n }\n }, E = (y) => {\n p.style.transition = y ? je : \"none\";\n };\n let T = !1, L = 0, m = 0, f = 0, v = 0, k = \"corner\";\n const j = (y, C) => {\n u && (u = !1, p.classList.remove(\"catalogue-resizer-fullscreen\"), c == null || c(!1)), T = !0, k = C, L = y.clientX, m = y.clientY;\n const x = p.getBoundingClientRect();\n f = x.width, v = x.height, E(!1), document.body.style.cursor = C === \"corner\" ? \"nwse-resize\" : C === \"right\" ? \"ew-resize\" : \"ns-resize\", document.body.style.userSelect = \"none\", y.preventDefault();\n }, w = (y) => {\n if (!T) return;\n const C = y.clientX - L, x = y.clientY - m;\n let A = f, P = v;\n (k === \"right\" || k === \"corner\") && (A = Math.max(o, Math.min(r, f + C))), (k === \"bottom\" || k === \"corner\") && (P = Math.max(n, Math.min(s, v + x))), p.style.width = `${A}px`, p.style.height = `${P}px`, S(), i == null || i(A, P);\n }, M = () => {\n T && (T = !1, document.body.style.cursor = \"\", document.body.style.userSelect = \"\");\n };\n return N.addEventListener(\"mousedown\", (y) => j(y, \"right\")), $.addEventListener(\"mousedown\", (y) => j(y, \"bottom\")), I.addEventListener(\"mousedown\", (y) => j(y, \"corner\")), document.addEventListener(\"mousemove\", w), document.addEventListener(\"mouseup\", M), h.appendChild(p), p.addEventListener(\"transitionend\", S), requestAnimationFrame(S), {\n wrapper: h,\n container: p,\n content: g,\n handleRight: N,\n handleBottom: $,\n handleCorner: I,\n dimensionLabel: b,\n setSize: (y, C, x = d) => {\n const A = u;\n y === \"full\" || C === \"full\" ? (u = !0, p.classList.add(\"catalogue-resizer-fullscreen\"), E(x), p.style.width = \"100%\", p.style.height = \"100%\", S(), A || c == null || c(!0), requestAnimationFrame(() => {\n const P = p.getBoundingClientRect();\n i == null || i(P.width, P.height);\n })) : (u = !1, p.classList.remove(\"catalogue-resizer-fullscreen\"), E(x), p.style.width = `${y}px`, p.style.height = `${C}px`, S(), i == null || i(y, C), A && (c == null || c(!1)));\n },\n isFullScreen: () => u\n };\n}\nfunction He(t, e = Me, a) {\n const o = document.createElement(\"div\");\n o.className = \"catalogue-breakpoint-presets\";\n let n = null;\n for (const r of e) {\n const s = document.createElement(\"button\");\n s.className = \"catalogue-breakpoint-button\", s.textContent = r.name, s.title = r.fullScreen ? \"Fill available space\" : `${r.width} × ${r.height}`, s.type = \"button\", s.addEventListener(\"click\", () => {\n n == null || n.classList.remove(\"active\"), s.classList.add(\"active\"), n = s, r.fullScreen ? t.setSize(\"full\", \"full\", !0) : (t.setSize(r.width, r.height, !0), t.dimensionLabel.textContent = `${r.width} × ${r.height}`), a == null || a(r);\n }), o.appendChild(s);\n }\n return o;\n}\nfunction Et(t, e, a, o = !0) {\n t.setSize(e, a, o);\n}\nfunction Re(t) {\n const {\n code: e,\n language: a = \"html\",\n collapsible: o = !0,\n collapsed: n = !1,\n title: r = \"Code\"\n } = t, s = document.createElement(\"div\");\n s.className = \"catalogue-code-panel\", s.setAttribute(\"data-language\", a), n && s.setAttribute(\"data-collapsed\", \"\");\n const i = document.createElement(\"div\");\n i.className = \"catalogue-code-panel-header\";\n const c = document.createElement(\"span\");\n c.className = \"catalogue-code-panel-title\", c.textContent = r, o && (c.style.cursor = \"pointer\", c.addEventListener(\"click\", () => {\n s.hasAttribute(\"data-collapsed\") ? s.removeAttribute(\"data-collapsed\") : s.setAttribute(\"data-collapsed\", \"\");\n }));\n const d = document.createElement(\"button\");\n d.className = \"catalogue-code-panel-copy\", d.type = \"button\", d.textContent = \"Copy\", d.title = \"Copy to clipboard\", d.addEventListener(\"click\", async () => {\n try {\n await navigator.clipboard.writeText(e), d.textContent = \"Copied!\", d.classList.add(\"copied\"), setTimeout(() => {\n d.textContent = \"Copy\", d.classList.remove(\"copied\");\n }, 2e3);\n } catch {\n d.textContent = \"Failed\", setTimeout(() => {\n d.textContent = \"Copy\";\n }, 2e3);\n }\n }), i.appendChild(c), i.appendChild(d);\n const u = document.createElement(\"pre\");\n u.className = \"catalogue-code-panel-content\";\n const h = document.createElement(\"code\");\n return h.className = `language-${a}`, h.textContent = e, u.appendChild(h), s.appendChild(i), s.appendChild(u), {\n wrapper: s,\n header: i,\n content: u,\n copyButton: d\n };\n}\nfunction De(t, e) {\n const a = t.content.querySelector(\"code\");\n a && (a.textContent = e);\n const o = t.copyButton.cloneNode(!0);\n o.addEventListener(\"click\", async () => {\n try {\n await navigator.clipboard.writeText(e), o.textContent = \"Copied!\", o.classList.add(\"copied\"), setTimeout(() => {\n o.textContent = \"Copy\", o.classList.remove(\"copied\");\n }, 2e3);\n } catch {\n o.textContent = \"Failed\", setTimeout(() => {\n o.textContent = \"Copy\";\n }, 2e3);\n }\n }), t.copyButton.replaceWith(o), t.copyButton = o;\n}\nfunction xt(t, e = 2) {\n const a = t.split(`\n`);\n let o = 0;\n const n = \" \".repeat(e);\n return a.map((r) => {\n const s = r.trim();\n if (!s) return \"\";\n s.startsWith(\"</\") && (o = Math.max(0, o - 1));\n const i = n.repeat(o) + s;\n return s.startsWith(\"<\") && !s.startsWith(\"</\") && !s.endsWith(\"/>\") && !s.includes(\"</\") && o++, i;\n }).filter((r) => r.length > 0).join(`\n`);\n}\nclass Oe {\n constructor(e) {\n V(this, \"routes\", []);\n V(this, \"options\");\n this.options = e, this.setupListeners();\n }\n /**\n * Add a route.\n */\n route(e, a) {\n const o = e.replace(/\\//g, \"\\\\/\").replace(/:([a-zA-Z]+)/g, \"(?<$1>[^/]+)\");\n return this.routes.push({\n pattern: new RegExp(`^${o}$`),\n handler: a\n }), this;\n }\n /**\n * Navigate to a path.\n */\n navigate(e) {\n window.location.hash = e;\n }\n /**\n * Get current path from hash.\n */\n getCurrentPath() {\n return window.location.hash.slice(1) || \"/\";\n }\n /**\n * Get query parameters from current URL.\n */\n getQueryParams() {\n const e = window.location.hash.slice(1), a = e.indexOf(\"?\");\n return a === -1 ? new URLSearchParams() : new URLSearchParams(e.slice(a + 1));\n }\n /**\n * Resolve the current route.\n */\n resolve() {\n var r, s;\n const e = window.location.hash.slice(1) || \"/\", a = e.indexOf(\"?\"), o = a === -1 ? e : e.slice(0, a), n = this.getQueryParams();\n for (const i of this.routes) {\n const c = o.match(i.pattern);\n if (c) {\n const d = c.groups || {};\n i.handler(d, n);\n return;\n }\n }\n (s = (r = this.options).onNotFound) == null || s.call(r, o);\n }\n /**\n * Start listening for route changes.\n */\n setupListeners() {\n window.addEventListener(\"hashchange\", () => this.resolve()), window.addEventListener(\"DOMContentLoaded\", () => this.resolve());\n }\n /**\n * Manually trigger route resolution.\n */\n start() {\n this.resolve();\n }\n}\nfunction H(t, e, a) {\n const o = document.createElement(\"a\");\n return o.href = `#${t}`, o.textContent = e, a && (o.className = a), o;\n}\nfunction wt(t, e) {\n const a = t.replace(/\\//g, \"\\\\/\").replace(/:([a-zA-Z]+)/g, \"(?<$1>[^/]+)\"), o = new RegExp(`^${a}$`), n = e.match(o);\n return n ? n.groups || {} : null;\n}\nfunction Be(t) {\n const { registry: e, onNavigate: a } = t, o = document.createElement(\"div\");\n o.className = \"catalogue-landing\", o.setAttribute(\"data-catalogue-root\", \"\");\n const n = document.createElement(\"header\");\n n.className = \"catalogue-landing-header\";\n const r = document.createElement(\"h1\");\n r.className = \"catalogue-landing-title\", r.textContent = \"Component Catalogue\", n.appendChild(r), o.appendChild(n);\n const s = document.createElement(\"div\");\n s.className = \"catalogue-landing-controls\";\n const i = document.createElement(\"input\");\n i.type = \"search\", i.className = \"catalogue-search-input\", i.placeholder = \"Search components...\", i.setAttribute(\"aria-label\", \"Search components\"), s.appendChild(i);\n const c = document.createElement(\"div\");\n c.className = \"catalogue-filters\";\n const d = K(\"Status\", [\n { value: \"stable\", label: \"Stable\" },\n { value: \"beta\", label: \"Beta\" },\n { value: \"deprecated\", label: \"Deprecated\" }\n ]);\n c.appendChild(d.container);\n const u = K(\"Kind\", [\n { value: \"standalone\", label: \"Standalone\" },\n { value: \"feature\", label: \"Feature\" }\n ]);\n c.appendChild(u.container), s.appendChild(c);\n const h = e.categories.items.length > 0;\n let p = null;\n h && (p = document.createElement(\"button\"), p.className = \"catalogue-expand-toggle\", p.textContent = \"Collapse All\", p.setAttribute(\"data-expanded\", \"true\"), s.appendChild(p)), o.appendChild(s);\n const g = document.createElement(\"div\");\n g.className = \"catalogue-component-list\", o.appendChild(g);\n const N = d.container.querySelectorAll('input[type=\"checkbox\"]'), $ = u.container.querySelectorAll('input[type=\"checkbox\"]'), I = () => {\n const b = i.value, S = Array.from(N).filter((m) => m.checked).map((m) => m.value), E = Array.from($).filter((m) => m.checked).map((m) => m.value), T = {\n status: S.length > 0 ? S : void 0,\n kind: E.length > 0 ? E : void 0\n }, L = !!(b || T.status || T.kind);\n if (g.innerHTML = \"\", h && !L) {\n g.classList.remove(\"catalogue-component-list--flat\");\n const m = Y(e);\n if (m.length === 0) {\n const f = document.createElement(\"div\");\n f.className = \"catalogue-empty-state\", f.textContent = \"No components found\", g.appendChild(f);\n return;\n }\n for (const f of m) {\n const v = Fe(f, e.categories.uncategorisedLabel, a);\n g.appendChild(v);\n }\n } else {\n g.classList.add(\"catalogue-component-list--flat\");\n const m = L ? Ae(e, b, T) : Y(e).flatMap((f) => f.components);\n if (m.length === 0) {\n const f = document.createElement(\"div\");\n f.className = \"catalogue-empty-state\", f.textContent = \"No components found\", g.appendChild(f);\n return;\n }\n for (const f of m) {\n const v = ce(f, a);\n g.appendChild(v);\n }\n }\n };\n return i.addEventListener(\"input\", () => {\n I();\n }), N.forEach((b) => {\n b.addEventListener(\"change\", I);\n }), $.forEach((b) => {\n b.addEventListener(\"change\", I);\n }), p && p.addEventListener(\"click\", () => {\n const b = p.getAttribute(\"data-expanded\") === \"true\";\n g.querySelectorAll(\".catalogue-category-section\").forEach((E) => {\n E.open = !b;\n }), p.setAttribute(\"data-expanded\", String(!b)), p.textContent = b ? \"Expand All\" : \"Collapse All\";\n }), I(), {\n root: o,\n searchInput: i,\n filterContainer: c,\n componentList: g\n };\n}\nfunction Fe(t, e, a) {\n var d, u;\n const o = document.createElement(\"details\");\n o.className = \"catalogue-category-section\", o.open = !0;\n const n = document.createElement(\"summary\");\n n.className = \"catalogue-category-header\";\n const r = ((d = t.category) == null ? void 0 : d.label) ?? e, s = document.createElement(\"span\");\n s.className = \"catalogue-category-label\", s.textContent = r;\n const i = document.createElement(\"span\");\n i.className = \"catalogue-category-count\", i.textContent = `(${t.components.length})`, n.appendChild(s), n.appendChild(i), (u = t.category) != null && u.description && (n.title = t.category.description), o.appendChild(n);\n const c = document.createElement(\"div\");\n c.className = \"catalogue-category-content\";\n for (const h of t.components) {\n const p = ce(h, a);\n c.appendChild(p);\n }\n return o.appendChild(c), o;\n}\nfunction K(t, e) {\n const a = document.createElement(\"div\");\n a.className = \"catalogue-filter-group\";\n const o = document.createElement(\"span\");\n o.className = \"catalogue-filter-label\", o.textContent = t, a.appendChild(o);\n for (const n of e) {\n const r = document.createElement(\"label\");\n r.className = \"catalogue-filter-option\";\n const s = document.createElement(\"input\");\n s.type = \"checkbox\", s.value = n.value;\n const i = document.createElement(\"span\");\n i.textContent = n.label, r.appendChild(s), r.appendChild(i), a.appendChild(r);\n }\n return { container: a };\n}\nfunction ce(t, e) {\n const a = document.createElement(\"div\");\n a.className = \"catalogue-component-card\", a.setAttribute(\"data-status\", t.status), a.setAttribute(\"data-kind\", t.kind);\n const o = document.createElement(\"div\");\n o.className = \"catalogue-component-card-header\";\n const n = document.createElement(\"h3\");\n n.className = \"catalogue-component-card-title\";\n const r = H(`/component/${t.id}`, t.title);\n r.addEventListener(\"click\", (c) => {\n c.preventDefault(), e(`/component/${t.id}`);\n }), n.appendChild(r);\n const s = document.createElement(\"span\");\n if (s.className = \"catalogue-status-badge\", s.setAttribute(\"data-status\", t.status), s.textContent = t.status, o.appendChild(n), o.appendChild(s), a.appendChild(o), t.description) {\n const c = document.createElement(\"p\");\n c.className = \"catalogue-component-card-description\", c.textContent = t.description, a.appendChild(c);\n }\n if (t.tags && t.tags.length > 0) {\n const c = document.createElement(\"div\");\n c.className = \"catalogue-component-card-tags\";\n for (const d of t.tags) {\n const u = document.createElement(\"span\");\n u.className = \"catalogue-tag\", u.textContent = d, c.appendChild(u);\n }\n a.appendChild(c);\n }\n const i = document.createElement(\"div\");\n return i.className = \"catalogue-component-card-meta\", i.textContent = `${t.scenarios.length} scenario${t.scenarios.length !== 1 ? \"s\" : \"\"}`, a.appendChild(i), a;\n}\nfunction qe(t, e) {\n t.innerHTML = \"\";\n const a = Be(e);\n return t.appendChild(a.root), a;\n}\nfunction Ve(t) {\n const { registry: e, componentId: a, onNavigate: o } = t, n = e.components.get(a);\n if (!n)\n return null;\n const r = document.createElement(\"div\");\n r.className = \"catalogue-component-page\", r.setAttribute(\"data-catalogue-root\", \"\");\n const s = document.createElement(\"nav\");\n s.className = \"catalogue-breadcrumb\", s.setAttribute(\"aria-label\", \"Breadcrumb\");\n const i = H(\"/\", \"Components\");\n i.addEventListener(\"click\", (m) => {\n m.preventDefault(), o(\"/\");\n }), s.appendChild(i);\n const c = document.createElement(\"span\");\n if (c.className = \"catalogue-breadcrumb-separator\", c.textContent = \"/\", s.appendChild(c), n.parentId) {\n const m = e.components.get(n.parentId);\n if (m) {\n const f = H(`/component/${m.id}`, m.title);\n f.addEventListener(\"click\", (k) => {\n k.preventDefault(), o(`/component/${m.id}`);\n }), s.appendChild(f);\n const v = document.createElement(\"span\");\n v.className = \"catalogue-breadcrumb-separator\", v.textContent = \"/\", s.appendChild(v);\n }\n }\n const d = document.createElement(\"span\");\n d.className = \"catalogue-breadcrumb-current\", d.textContent = n.title, s.appendChild(d), r.appendChild(s);\n const u = document.createElement(\"header\");\n u.className = \"catalogue-component-header\";\n const h = document.createElement(\"div\");\n h.className = \"catalogue-component-title-row\";\n const p = document.createElement(\"h1\");\n p.className = \"catalogue-component-title\", p.textContent = n.title, h.appendChild(p);\n const g = document.createElement(\"span\");\n if (g.className = \"catalogue-status-badge\", g.setAttribute(\"data-status\", n.status), g.textContent = n.status, h.appendChild(g), u.appendChild(h), n.description) {\n const m = document.createElement(\"p\");\n m.className = \"catalogue-component-description\", m.textContent = n.description, u.appendChild(m);\n }\n if (n.tags && n.tags.length > 0) {\n const m = document.createElement(\"div\");\n m.className = \"catalogue-component-tags\";\n for (const f of n.tags) {\n const v = document.createElement(\"span\");\n v.className = \"catalogue-tag\", v.textContent = f, m.appendChild(v);\n }\n u.appendChild(m);\n }\n const N = document.createElement(\"div\");\n N.className = \"catalogue-component-actions\";\n const $ = document.createElement(\"a\");\n $.href = `#/playground/${n.id}`, $.className = \"catalogue-button catalogue-button-primary\", $.textContent = \"Open Playground\", $.addEventListener(\"click\", (m) => {\n m.preventDefault(), o(`/playground/${n.id}`);\n }), N.appendChild($), u.appendChild(N), r.appendChild(u);\n const I = Le(e, a);\n if (I.length > 0) {\n const m = document.createElement(\"section\");\n m.className = \"catalogue-subcomponents-section\";\n const f = document.createElement(\"h2\");\n f.textContent = \"Subcomponents\", m.appendChild(f);\n const v = document.createElement(\"div\");\n v.className = \"catalogue-subcomponents-list\";\n for (const k of I) {\n const j = document.createElement(\"div\");\n j.className = \"catalogue-subcomponent-card\";\n const w = H(`/component/${k.id}`, k.title);\n if (w.addEventListener(\"click\", (M) => {\n M.preventDefault(), o(`/component/${k.id}`);\n }), j.appendChild(w), k.description) {\n const M = document.createElement(\"p\");\n M.textContent = k.description, j.appendChild(M);\n }\n v.appendChild(j);\n }\n m.appendChild(v), r.appendChild(m);\n }\n const b = document.createElement(\"section\");\n b.className = \"catalogue-variants-section\";\n const S = document.createElement(\"h2\");\n S.textContent = \"Variants\", b.appendChild(S);\n const E = document.createElement(\"div\");\n E.className = \"catalogue-variants-grid\";\n const T = [...n.scenarios].sort((m, f) => m.id === n.playground.primaryScenarioId ? -1 : f.id === n.playground.primaryScenarioId ? 1 : 0);\n for (const m of T) {\n const f = We(m, n, o);\n E.appendChild(f);\n }\n b.appendChild(E), r.appendChild(b);\n let L = null;\n if (n.docs) {\n L = document.createElement(\"div\"), L.className = \"catalogue-docs-section\";\n const m = document.createElement(\"h2\");\n m.textContent = \"Documentation\", L.appendChild(m);\n const f = document.createElement(\"div\");\n f.className = \"catalogue-docs-content\", f.innerHTML = de.parse(n.docs), L.appendChild(f), r.appendChild(L);\n }\n return {\n root: r,\n header: u,\n variantsGrid: E,\n docsSection: L\n };\n}\nfunction We(t, e, a) {\n const o = document.createElement(\"div\");\n o.className = \"catalogue-scenario-card\";\n const n = t.id === e.playground.primaryScenarioId;\n n && o.classList.add(\"catalogue-scenario-card-primary\");\n const r = document.createElement(\"div\");\n r.className = \"catalogue-scenario-preview\", r.setAttribute(\"data-catalogue-container\", \"\");\n try {\n ne(t.render, { container: r, clear: !0 });\n } catch (h) {\n const p = document.createElement(\"div\");\n p.className = \"catalogue-scenario-error\", p.textContent = `Render error: ${h instanceof Error ? h.message : \"Unknown error\"}`, r.appendChild(p);\n }\n o.appendChild(r);\n const s = document.createElement(\"div\");\n s.className = \"catalogue-scenario-info\";\n const i = document.createElement(\"div\");\n i.className = \"catalogue-scenario-title-row\";\n const c = document.createElement(\"h3\");\n if (c.className = \"catalogue-scenario-title\", c.textContent = t.title, i.appendChild(c), n) {\n const h = document.createElement(\"span\");\n h.className = \"catalogue-primary-badge\", h.textContent = \"Primary\", i.appendChild(h);\n }\n if (s.appendChild(i), t.description) {\n const h = document.createElement(\"p\");\n h.className = \"catalogue-scenario-description\", h.textContent = t.description, s.appendChild(h);\n }\n const d = document.createElement(\"div\");\n d.className = \"catalogue-scenario-links\";\n const u = document.createElement(\"a\");\n return u.href = `#/harness/${t.id}`, u.className = \"catalogue-link\", u.textContent = \"Harness\", u.addEventListener(\"click\", (h) => {\n h.preventDefault(), a(`/harness/${t.id}`);\n }), d.appendChild(u), s.appendChild(d), o.appendChild(s), o;\n}\nfunction Ue(t, e) {\n t.innerHTML = \"\";\n const a = Ve(e);\n if (!a) {\n const o = document.createElement(\"div\");\n return o.className = \"catalogue-not-found\", o.textContent = `Component \"${e.componentId}\" not found`, t.appendChild(o), null;\n }\n return t.appendChild(a.root), a;\n}\nfunction W(t, e = {}) {\n const { indent: a = \" \", includeScript: o = !0, elementId: n } = e, r = [], s = [];\n if (B(t, r, s, \"\", a, n), o && s.length > 0) {\n r.push(\"\"), r.push('<script type=\"module\">');\n const i = n ? `#${n}` : t.element;\n r.push(`${a}const el = document.querySelector('${i}');`);\n for (const { key: c, value: d } of s) {\n const u = JSON.stringify(d);\n r.push(`${a}el.${c} = ${u};`);\n }\n r.push(\"<\\/script>\");\n }\n return r.join(`\n`);\n}\nfunction B(t, e, a, o, n, r) {\n var u, h;\n let s = `<${t.element}`;\n if (r && (s += ` id=\"${U(r)}\"`), t.attrs)\n for (const [p, g] of Object.entries(t.attrs))\n g != null && (typeof g == \"boolean\" ? g && (s += ` ${p}`) : s += ` ${p}=\"${U(String(g))}\"`);\n if (t.props)\n for (const [p, g] of Object.entries(t.props))\n a.push({ key: p, value: g });\n if (!(t.text !== void 0 || ((u = t.children) == null ? void 0 : u.length) || t.slots && Object.keys(t.slots).length > 0) && (/* @__PURE__ */ new Set([\n \"area\",\n \"base\",\n \"br\",\n \"col\",\n \"embed\",\n \"hr\",\n \"img\",\n \"input\",\n \"link\",\n \"meta\",\n \"param\",\n \"source\",\n \"track\",\n \"wbr\"\n ])).has(t.element)) {\n e.push(`${o}${s} />`);\n return;\n }\n if (s += \">\", t.text !== void 0 && !((h = t.children) != null && h.length) && !t.slots) {\n e.push(`${o}${s}${F(t.text)}</${t.element}>`);\n return;\n }\n e.push(`${o}${s}`);\n const d = o + n;\n if (t.text !== void 0 && e.push(`${d}${F(t.text)}`), t.slots)\n for (const [p, g] of Object.entries(t.slots))\n Je(g, p, e, a, d, n);\n if (t.children)\n for (const p of t.children)\n B(p, e, a, d, n);\n e.push(`${o}</${t.element}>`);\n}\nfunction Je(t, e, a, o, n, r) {\n if (typeof t == \"string\")\n e === \"default\" ? a.push(`${n}${F(t)}`) : a.push(`${n}<span slot=\"${U(e)}\">${F(t)}</span>`);\n else if (Array.isArray(t))\n for (const s of t) {\n const i = e === \"default\" ? s : X(s, e);\n B(i, a, o, n, r);\n }\n else {\n const s = e === \"default\" ? t : X(t, e);\n B(s, a, o, n, r);\n }\n}\nfunction X(t, e) {\n return {\n ...t,\n attrs: {\n ...t.attrs,\n slot: e\n }\n };\n}\nfunction F(t) {\n return t.replace(/&/g, \"&\").replace(/</g, \"<\").replace(/>/g, \">\");\n}\nfunction U(t) {\n return t.replace(/&/g, \"&\").replace(/\"/g, \""\").replace(/</g, \"<\").replace(/>/g, \">\");\n}\nfunction Nt(t, e = {}) {\n return W(t, { ...e, includeScript: !1 });\n}\nfunction $t(t, e, a = {}) {\n const { indent: o = \" \" } = a;\n if (!t.props || Object.keys(t.props).length === 0)\n return null;\n const n = [];\n n.push(`const el = document.querySelector('${e}');`);\n for (const [r, s] of Object.entries(t.props)) {\n const i = JSON.stringify(s);\n n.push(`el.${r} = ${i};`);\n }\n return n.map((r) => `${o}${r}`).join(`\n`);\n}\nfunction Ye(t) {\n const { component: e, values: a, onChange: o } = t, n = document.createElement(\"div\");\n n.className = \"catalogue-controls\";\n const r = /* @__PURE__ */ new Map();\n for (const [s, i] of Object.entries(e.playground.controls)) {\n const c = Ke(s, i, a[s], (d) => {\n o(s, d);\n });\n r.set(s, c.wrapper), n.appendChild(c.wrapper);\n }\n return { container: n, controls: r };\n}\nfunction Ke(t, e, a, o) {\n const n = document.createElement(\"div\");\n n.className = \"catalogue-control\", n.setAttribute(\"data-control-type\", e.type);\n const r = document.createElement(\"label\");\n r.className = \"catalogue-control-label\", r.textContent = e.label || t, n.appendChild(r);\n let s;\n switch (e.type) {\n case \"text\":\n s = Xe(t, e, a, o);\n break;\n case \"number\":\n s = Ge(t, e, a, o);\n break;\n case \"boolean\":\n s = _e(t, e, a, o);\n break;\n case \"select\":\n s = Qe(t, e, a, o);\n break;\n case \"radio\":\n s = Ze(t, e, a, o);\n break;\n case \"color\":\n s = et(t, e, a, o);\n break;\n case \"range\":\n s = tt(t, e, a, o);\n break;\n case \"json\":\n s = nt(t, e, a, o);\n break;\n default:\n s = document.createElement(\"span\"), s.textContent = \"Unknown control type\";\n }\n return n.appendChild(s), { wrapper: n, input: s };\n}\nfunction Xe(t, e, a, o) {\n const n = document.createElement(\"input\");\n return n.type = \"text\", n.className = \"catalogue-control-input\", n.name = t, n.value = a ?? e.defaultValue ?? \"\", e.placeholder && (n.placeholder = e.placeholder), n.addEventListener(\"input\", () => {\n o(n.value);\n }), n;\n}\nfunction Ge(t, e, a, o) {\n const n = document.createElement(\"input\");\n return n.type = \"number\", n.className = \"catalogue-control-input\", n.name = t, n.value = String(a ?? e.defaultValue ?? 0), e.min !== void 0 && (n.min = String(e.min)), e.max !== void 0 && (n.max = String(e.max)), e.step !== void 0 && (n.step = String(e.step)), n.addEventListener(\"input\", () => {\n o(parseFloat(n.value) || 0);\n }), n;\n}\nfunction _e(t, e, a, o) {\n const n = document.createElement(\"div\");\n n.className = \"catalogue-control-checkbox\";\n const r = document.createElement(\"input\");\n return r.type = \"checkbox\", r.className = \"catalogue-control-checkbox-input\", r.name = t, r.checked = a ?? e.defaultValue ?? !1, r.addEventListener(\"change\", () => {\n o(r.checked);\n }), n.appendChild(r), n;\n}\nfunction Qe(t, e, a, o) {\n const n = document.createElement(\"select\");\n n.className = \"catalogue-control-select\", n.name = t;\n for (const r of e.options) {\n const s = document.createElement(\"option\");\n typeof r == \"string\" ? (s.value = r, s.textContent = r) : (s.value = r.value, s.textContent = r.label), n.appendChild(s);\n }\n return n.value = a ?? e.defaultValue ?? \"\", n.addEventListener(\"change\", () => {\n o(n.value);\n }), n;\n}\nfunction Ze(t, e, a, o) {\n const n = document.createElement(\"div\");\n n.className = \"catalogue-control-radio-group\";\n const r = a ?? e.defaultValue;\n for (const s of e.options) {\n const i = document.createElement(\"label\");\n i.className = \"catalogue-control-radio\";\n const c = document.createElement(\"input\");\n c.type = \"radio\", c.name = t;\n const d = typeof s == \"string\" ? s : s.value, u = typeof s == \"string\" ? s : s.label;\n c.value = d, c.checked = d === r, c.addEventListener(\"change\", () => {\n c.checked && o(c.value);\n });\n const h = document.createElement(\"span\");\n h.textContent = u, i.appendChild(c), i.appendChild(h), n.appendChild(i);\n }\n return n;\n}\nfunction et(t, e, a, o) {\n const n = document.createElement(\"input\");\n return n.type = \"color\", n.className = \"catalogue-control-color\", n.name = t, n.value = a ?? e.defaultValue ?? \"#000000\", n.addEventListener(\"input\", () => {\n o(n.value);\n }), n;\n}\nfunction tt(t, e, a, o) {\n const n = document.createElement(\"div\");\n n.className = \"catalogue-control-range-wrapper\";\n const r = document.createElement(\"input\");\n r.type = \"range\", r.className = \"catalogue-control-range\", r.name = t, r.min = String(e.min), r.max = String(e.max), e.step !== void 0 && (r.step = String(e.step)), r.value = String(a ?? e.defaultValue ?? e.min);\n const s = document.createElement(\"span\");\n return s.className = \"catalogue-control-range-value\", s.textContent = r.value, r.addEventListener(\"input\", () => {\n s.textContent = r.value, o(parseFloat(r.value));\n }), n.appendChild(r), n.appendChild(s), n;\n}\nfunction nt(t, e, a, o) {\n const n = document.createElement(\"textarea\");\n n.className = \"catalogue-control-json\", n.name = t, n.rows = 4;\n const r = a ?? e.defaultValue;\n return n.value = r !== void 0 ? JSON.stringify(r, null, 2) : \"\", n.addEventListener(\"input\", () => {\n try {\n const s = JSON.parse(n.value);\n n.classList.remove(\"invalid\"), o(s);\n } catch {\n n.classList.add(\"invalid\");\n }\n }), n;\n}\nfunction at(t) {\n const { registry: e, componentId: a, onNavigate: o } = t, n = e.components.get(a);\n if (!n)\n return null;\n const r = n.scenarios.find(\n (C) => C.id === n.playground.primaryScenarioId\n );\n if (!r)\n return null;\n re();\n const s = document.createElement(\"div\");\n s.className = \"catalogue-playground\", s.setAttribute(\"data-catalogue-root\", \"\");\n const i = document.createElement(\"header\");\n i.className = \"catalogue-playground-header\";\n const c = document.createElement(\"nav\");\n c.className = \"catalogue-breadcrumb\";\n const d = H(\"/\", \"Components\");\n d.addEventListener(\"click\", (C) => {\n C.preventDefault(), o(\"/\");\n }), c.appendChild(d);\n const u = document.createElement(\"span\");\n u.className = \"catalogue-breadcrumb-separator\", u.textContent = \"/\", c.appendChild(u);\n const h = H(`/component/${n.id}`, n.title);\n h.addEventListener(\"click\", (C) => {\n C.preventDefault(), o(`/component/${n.id}`);\n }), c.appendChild(h);\n const p = document.createElement(\"span\");\n p.className = \"catalogue-breadcrumb-separator\", p.textContent = \"/\", c.appendChild(p);\n const g = document.createElement(\"span\");\n g.className = \"catalogue-breadcrumb-current\", g.textContent = \"Playground\", c.appendChild(g), i.appendChild(c);\n const N = document.createElement(\"div\");\n N.className = \"catalogue-playground-title-row\";\n const $ = document.createElement(\"h1\");\n $.textContent = `${n.title} Playground`, N.appendChild($);\n const I = se();\n N.appendChild(I), i.appendChild(N), s.appendChild(i);\n const b = document.createElement(\"div\");\n b.className = \"catalogue-playground-main\";\n const S = document.createElement(\"div\");\n if (S.className = \"catalogue-playground-preview-section\", n.scenarios.length > 1) {\n const C = document.createElement(\"div\");\n C.className = \"catalogue-scenario-selector\";\n const x = document.createElement(\"label\");\n x.textContent = \"Scenario: \";\n const A = document.createElement(\"select\");\n A.className = \"catalogue-scenario-select\";\n for (const P of n.scenarios) {\n const z = document.createElement(\"option\");\n z.value = P.id, z.textContent = P.title, P.id === r.id && (z.selected = !0), A.appendChild(z);\n }\n x.appendChild(A), C.appendChild(x), S.appendChild(C), A.addEventListener(\"change\", () => {\n const P = n.scenarios.find((z) => z.id === A.value);\n P && (w = structuredClone(P.render), O(), q());\n });\n }\n const E = ze({\n initialWidth: \"100%\",\n initialHeight: \"400px\",\n onResize: (C, x) => {\n },\n onFullScreenChange: (C) => {\n s.classList.toggle(\"catalogue-playground-fullscreen\", C);\n }\n }), T = He(E);\n S.appendChild(T), S.appendChild(E.wrapper), b.appendChild(S);\n const L = document.createElement(\"div\");\n L.className = \"catalogue-playground-sidebar\";\n const m = document.createElement(\"div\");\n m.className = \"catalogue-playground-controls-section\";\n const f = document.createElement(\"h2\");\n f.textContent = \"Controls\", m.appendChild(f);\n const v = document.createElement(\"div\");\n v.className = \"catalogue-controls-container\", m.appendChild(v), L.appendChild(m);\n const k = document.createElement(\"div\");\n k.className = \"catalogue-playground-code-section\";\n const j = Re({\n code: W(r.render),\n title: \"HTML\",\n collapsible: !0,\n collapsed: !1\n });\n k.appendChild(j.wrapper), L.appendChild(k), b.appendChild(L), s.appendChild(b);\n let w = structuredClone(r.render), M = null;\n const O = () => {\n E.content.innerHTML = \"\";\n try {\n M = D(w), E.content.appendChild(M);\n } catch (C) {\n const x = document.createElement(\"div\");\n x.className = \"catalogue-render-error\", x.textContent = `Error: ${C instanceof Error ? C.message : \"Unknown error\"}`, E.content.appendChild(x), M = null;\n }\n }, q = () => {\n const C = W(w);\n De(j, C);\n }, y = Ye({\n component: n,\n values: ot(n, w),\n onChange: (C, x) => {\n w.attrs || (w.attrs = {});\n const A = n.playground.controls[C];\n A && (A.type === \"json\" ? (w.props || (w.props = {}), w.props[C] = x) : A.type === \"boolean\" ? x ? w.attrs[C] = !0 : delete w.attrs[C] : w.attrs[C] = x), M ? ae(M, w.attrs, w.props) : O(), q();\n }\n });\n return v.appendChild(y.container), O(), {\n root: s,\n preview: E.content,\n controls: v,\n codePanel: k\n };\n}\nfunction ot(t, e) {\n const a = {};\n for (const [o, n] of Object.entries(t.playground.controls))\n e.attrs && o in e.attrs ? a[o] = e.attrs[o] : e.props && o in e.props ? a[o] = e.props[o] : \"defaultValue\" in n && (a[o] = n.defaultValue);\n return a;\n}\nfunction rt(t, e) {\n t.innerHTML = \"\";\n const a = at(e);\n if (!a) {\n const o = document.createElement(\"div\");\n return o.className = \"catalogue-not-found\", o.textContent = `Component \"${e.componentId}\" not found or missing primary scenario`, t.appendChild(o), null;\n }\n return t.appendChild(a.root), a;\n}\nfunction st(t) {\n const { registry: e, scenarioId: a, query: o } = t, n = e.scenarios.get(a);\n if (!n)\n return null;\n const r = o.get(\"theme\") || \"light\", s = o.get(\"w\") ? parseInt(o.get(\"w\"), 10) : void 0, i = o.get(\"h\") ? parseInt(o.get(\"h\"), 10) : void 0, c = o.get(\"bg\") || n.background;\n J(r);\n const d = document.createElement(\"div\");\n d.className = \"catalogue-harness\", d.setAttribute(\"data-catalogue-root\", \"\"), d.setAttribute(\"data-theme\", r);\n const u = document.createElement(\"div\");\n u.className = \"catalogue-harness-container\", u.setAttribute(\"data-catalogue-container\", \"\"), u.setAttribute(\"data-theme\", r), s !== void 0 && (u.style.width = `${s}px`), i !== void 0 && (u.style.height = `${i}px`), c && (u.style.backgroundColor = c), !s && !i && n.viewport && (n.viewport.width && (u.style.width = `${n.viewport.width}px`), n.viewport.height && (u.style.height = `${n.viewport.height}px`));\n try {\n ne(n.render, { container: u, clear: !0 });\n } catch (h) {\n const p = document.createElement(\"div\");\n p.setAttribute(\"data-catalogue-error\", \"\"), p.style.cssText = \"color: red; padding: 1em; font-family: monospace;\", p.textContent = `Render error: ${h instanceof Error ? h.message : \"Unknown error\"}`, u.appendChild(p);\n }\n return d.appendChild(u), {\n root: d,\n container: u\n };\n}\nfunction G(t, e) {\n t.innerHTML = \"\", document.body.classList.add(\"catalogue-harness-body\");\n const a = st(e);\n if (!a) {\n const o = document.createElement(\"div\");\n return o.className = \"catalogue-not-found\", o.setAttribute(\"data-catalogue-error\", \"\"), o.textContent = `Scenario \"${e.scenarioId}\" not found`, t.appendChild(o), null;\n }\n return t.appendChild(a.root), a;\n}\nfunction _(t, e) {\n const a = new URLSearchParams();\n e != null && e.theme && a.set(\"theme\", e.theme), (e == null ? void 0 : e.width) !== void 0 && a.set(\"w\", String(e.width)), (e == null ? void 0 : e.height) !== void 0 && a.set(\"h\", String(e.height)), e != null && e.background && a.set(\"bg\", e.background);\n const o = a.toString();\n return `/harness/${t}${o ? `?${o}` : \"\"}`;\n}\nfunction St(t, e) {\n const a = [], o = [\"light\", \"dark\"], n = e || [\n { width: 375, height: 667 },\n // Mobile\n { width: 1024, height: 768 }\n // Desktop\n ];\n for (const [r, s] of t.scenarios) {\n for (const i of o)\n a.push({\n scenarioId: r,\n componentId: s.componentId,\n url: _(r, { theme: i }),\n theme: i\n });\n for (const i of n)\n for (const c of o)\n a.push({\n scenarioId: r,\n componentId: s.componentId,\n url: _(r, {\n theme: c,\n width: i.width,\n height: i.height\n }),\n theme: c,\n width: i.width,\n height: i.height\n });\n }\n return a;\n}\nfunction ct(t) {\n const { container: e, registry: a, basePath: o = \"\" } = t;\n re();\n const n = new Oe({\n basePath: o,\n root: e,\n onNotFound: (s) => {\n e.innerHTML = \"\";\n const i = document.createElement(\"div\");\n i.className = \"catalogue-not-found\", i.innerHTML = `\n <h1>Page Not Found</h1>\n <p>The page \"${s}\" does not exist.</p>\n <a href=\"#/\">Back to Components</a>\n `, e.appendChild(i);\n }\n }), r = (s) => {\n n.navigate(s);\n };\n return n.route(\"/\", () => {\n qe(e, { registry: a, onNavigate: r }), Q(e, r);\n }), n.route(\"/component/:componentId\", (s) => {\n Ue(e, {\n registry: a,\n componentId: s.componentId,\n onNavigate: r\n }), Q(e, r);\n }), n.route(\"/playground/:componentId\", (s) => {\n rt(e, {\n registry: a,\n componentId: s.componentId,\n onNavigate: r\n });\n }), n.route(\"/harness/:scenarioId\", (s, i) => {\n G(e, {\n registry: a,\n scenarioId: s.scenarioId,\n query: i\n });\n }), n.route(\"/example/:exampleId\", (s, i) => {\n const c = a.examples.get(s.exampleId);\n c ? G(e, {\n registry: {\n ...a,\n scenarios: /* @__PURE__ */ new Map([[c.id, { ...c, filePath: c.filePath }]])\n },\n scenarioId: s.exampleId,\n query: i\n }) : n.navigate(\"/\");\n }), {\n router: n,\n start: () => n.start(),\n navigate: r,\n registry: a\n };\n}\nfunction Q(t, e) {\n if (t.querySelector(\".catalogue-global-header\"))\n return;\n const o = t.querySelector(\"[data-catalogue-root]\");\n if (!o)\n return;\n const n = document.createElement(\"div\");\n n.className = \"catalogue-global-header\";\n const r = document.createElement(\"a\");\n r.href = \"#/\", r.className = \"catalogue-home-link\", r.textContent = \"Component Catalogue\", r.addEventListener(\"click\", (i) => {\n i.preventDefault(), e(\"/\");\n }), n.appendChild(r);\n const s = se();\n n.appendChild(s), o.insertBefore(n, o.firstChild);\n}\nfunction kt(t, e, a) {\n const o = document.querySelector(t);\n if (!o)\n throw new Error(`Container element not found: ${t}`);\n const n = ct({\n container: o,\n registry: e,\n ...a\n });\n return n.start(), n;\n}\nexport {\n xe as ComponentExportsSchema,\n Ee as ComponentKindSchema,\n Ne as ComponentSchema,\n ye as ComponentStatusSchema,\n Z as ControlSpecSchema,\n Me as DEFAULT_BREAKPOINTS,\n ht as ExampleSchema,\n we as PlaygroundConfigSchema,\n R as RenderNodeSchema,\n Oe as Router,\n ee as ScenarioSchema,\n yt as applyNodeToElement,\n He as createBreakpointPresets,\n ct as createCatalogueApp,\n Re as createCodePanel,\n Ve as createComponentPage,\n Ye as createControls,\n Ct as createEmptyRegistry,\n st as createHarnessPage,\n Be as createLandingPage,\n H as createNavLink,\n at as createPlaygroundPage,\n ze as createResizer,\n se as createThemeToggle,\n mt as formatComponentErrors,\n xt as formatHtml,\n gt as formatScenarioErrors,\n vt as formatValidationErrors,\n W as generateHtml,\n Nt as generateHtmlOnly,\n $t as generatePropsScript,\n St as getAllHarnessUrls,\n Y as getComponentsByCategory,\n _ as getHarnessUrl,\n Pe as getInitialTheme,\n ke as getStandaloneComponents,\n Le as getSubcomponents,\n re as initTheme,\n ft as loadRegistry,\n kt as mountCatalogueApp,\n wt as parseRouteParams,\n ne as render,\n Ue as renderComponentPage,\n G as renderHarnessPage,\n qe as renderLandingPage,\n D as renderNode,\n rt as renderPlaygroundPage,\n Ae as searchComponents,\n Et as setResizerDimensions,\n J as setTheme,\n Te as toggleTheme,\n De as updateCodePanel,\n ae as updateElement,\n $e as validateComponent,\n pt as validateControlSpec,\n Se as validateExample,\n bt as validateRegistry,\n ut as validateRenderNode,\n te as validateScenario\n};\n//# sourceMappingURL=index.js.map\n","/**\n * Validate command - Validate the registry.\n */\n\nimport { loadConfig } from '../config/index.js';\nimport { loadRegistryFiles } from '../registry/file-loader.js';\nimport { loadRegistry, validateRegistry, formatValidationErrors } from '@adieyal/catalogue-core';\nimport pc from 'picocolors';\n\nexport interface ValidateOptions {\n config?: string;\n}\n\nexport async function validate(options: ValidateOptions = {}): Promise<void> {\n console.log(pc.cyan('Validating registry...'));\n\n try {\n const config = await loadConfig({\n configFile: options.config,\n });\n\n // Load registry files\n const rawData = loadRegistryFiles({ registryPath: config.registryPath });\n\n // Parse and validate individual files\n const { registry, errors: parseErrors } = loadRegistry(rawData);\n\n if (parseErrors.length > 0) {\n console.log(pc.red('\\nSchema validation errors:'));\n for (const error of parseErrors) {\n console.log(pc.red(` ${error.file}: ${error.path}: ${error.message}`));\n }\n }\n\n // Cross-reference validation\n const crossRefResult = validateRegistry(registry);\n\n if (!crossRefResult.valid) {\n console.log(pc.red('\\nCross-reference validation errors:'));\n console.log(formatValidationErrors(crossRefResult));\n }\n\n if (crossRefResult.warnings.length > 0) {\n console.log(pc.yellow('\\nWarnings:'));\n for (const warning of crossRefResult.warnings) {\n console.log(pc.yellow(` ${warning.file}: ${warning.path}: ${warning.message}`));\n }\n }\n\n // Summary\n const componentCount = registry.components.size;\n const scenarioCount = registry.scenarios.size;\n const exampleCount = registry.examples.size;\n\n console.log('');\n console.log(pc.dim(`Found ${componentCount} component(s), ${scenarioCount} scenario(s), ${exampleCount} example(s)`));\n\n if (parseErrors.length > 0 || !crossRefResult.valid) {\n console.log(pc.red('\\n✗ Validation failed'));\n process.exit(1);\n }\n\n console.log(pc.green('\\n✓ Registry is valid'));\n } catch (error) {\n console.error(pc.red('Error validating registry:'));\n console.error(error instanceof Error ? error.message : error);\n process.exit(1);\n }\n}\n","/**\n * Test command - Run Playwright visual tests.\n */\n\nimport { loadConfig } from '../config/index.js';\nimport { loadRegistryFiles } from '../registry/file-loader.js';\nimport { loadRegistry, validateRegistry, getAllHarnessUrls } from '@adieyal/catalogue-core';\nimport { startPreviewServer, buildStatic } from '../vite/server.js';\nimport { spawn } from 'node:child_process';\nimport { writeFileSync, mkdirSync, existsSync } from 'node:fs';\nimport { join, resolve } from 'node:path';\nimport pc from 'picocolors';\n\nexport interface TestOptions {\n config?: string;\n update?: boolean;\n headed?: boolean;\n}\n\nexport async function test(options: TestOptions = {}): Promise<void> {\n console.log(pc.cyan('Running visual tests...'));\n\n try {\n const config = await loadConfig({\n configFile: options.config,\n });\n\n // First validate the registry\n console.log(pc.dim('Validating registry...'));\n const rawData = loadRegistryFiles({ registryPath: config.registryPath });\n const { registry, errors: parseErrors } = loadRegistry(rawData);\n\n if (parseErrors.length > 0) {\n console.log(pc.red('Registry validation failed:'));\n for (const error of parseErrors) {\n console.log(pc.red(` ${error.file}: ${error.path}: ${error.message}`));\n }\n process.exit(1);\n }\n\n const crossRefResult = validateRegistry(registry);\n if (!crossRefResult.valid) {\n console.log(pc.red('Cross-reference validation failed'));\n process.exit(1);\n }\n\n // Build the static site\n console.log(pc.dim('Building catalogue...'));\n await buildStatic(config);\n\n // Generate harness URLs for testing\n const breakpoints = config.playwright?.breakpoints || [\n { name: 'mobile', width: 375, height: 667 },\n { name: 'desktop', width: 1024, height: 768 },\n ];\n\n const harnessUrls = getAllHarnessUrls(\n registry,\n breakpoints.map(bp => ({ width: bp.width, height: bp.height }))\n );\n\n // Generate Playwright test file\n const testDir = join(config.configDir, '.catalogue-tests');\n if (!existsSync(testDir)) {\n mkdirSync(testDir, { recursive: true });\n }\n\n const testFile = generatePlaywrightTest(harnessUrls, config);\n const testFilePath = join(testDir, 'visual.spec.ts');\n writeFileSync(testFilePath, testFile);\n\n // Generate Playwright config\n const playwrightConfig = generatePlaywrightConfig(config, testDir);\n const configFilePath = join(testDir, 'playwright.config.ts');\n writeFileSync(configFilePath, playwrightConfig);\n\n // Run Playwright\n console.log(pc.dim('Running Playwright tests...'));\n\n const args = ['playwright', 'test', '-c', configFilePath];\n if (options.update) {\n args.push('--update-snapshots');\n }\n if (options.headed) {\n args.push('--headed');\n }\n\n const playwrightProcess = spawn('npx', args, {\n cwd: config.configDir,\n stdio: 'inherit',\n shell: true,\n });\n\n playwrightProcess.on('close', (code) => {\n if (code === 0) {\n console.log(pc.green('\\n✓ All visual tests passed'));\n } else {\n console.log(pc.red(`\\n✗ Tests failed with code ${code}`));\n process.exit(code || 1);\n }\n });\n } catch (error) {\n console.error(pc.red('Error running tests:'));\n console.error(error instanceof Error ? error.message : error);\n process.exit(1);\n }\n}\n\nfunction generatePlaywrightTest(\n harnessUrls: Array<{\n scenarioId: string;\n componentId: string;\n url: string;\n theme: string;\n width?: number;\n height?: number;\n }>,\n config: { port: number }\n): string {\n const baseUrl = `http://localhost:${config.port}`;\n\n return `\nimport { test, expect } from '@playwright/test';\n\nconst scenarios = ${JSON.stringify(harnessUrls, null, 2)};\n\nfor (const scenario of scenarios) {\n const testName = [\n scenario.componentId,\n scenario.scenarioId,\n scenario.theme,\n scenario.width ? \\`\\${scenario.width}x\\${scenario.height}\\` : 'default',\n ].join('-');\n\n test(testName, async ({ page }) => {\n const url = '${baseUrl}#' + scenario.url;\n await page.goto(url);\n\n // Wait for component to render\n await page.waitForSelector('[data-catalogue-container]');\n\n // Take screenshot\n const container = page.locator('[data-catalogue-container]');\n await expect(container).toHaveScreenshot(\\`\\${testName}.png\\`);\n });\n}\n`;\n}\n\nfunction generatePlaywrightConfig(\n config: { port: number; configDir: string; playwright?: { screenshotDir?: string } },\n testDir: string\n): string {\n const screenshotDir = config.playwright?.screenshotDir\n ? resolve(config.configDir, config.playwright.screenshotDir)\n : join(config.configDir, 'screenshots');\n\n return `\nimport { defineConfig, devices } from '@playwright/test';\n\nexport default defineConfig({\n testDir: '${testDir}',\n snapshotDir: '${screenshotDir}',\n snapshotPathTemplate: '{snapshotDir}/{testName}/{arg}{ext}',\n fullyParallel: true,\n forbidOnly: !!process.env.CI,\n retries: process.env.CI ? 2 : 0,\n workers: process.env.CI ? 1 : undefined,\n reporter: 'list',\n use: {\n baseURL: 'http://localhost:${config.port}',\n trace: 'on-first-retry',\n },\n projects: [\n {\n name: 'chromium',\n use: { ...devices['Desktop Chrome'] },\n },\n ],\n webServer: {\n command: 'npx vite preview --port ${config.port}',\n port: ${config.port},\n reuseExistingServer: !process.env.CI,\n cwd: '${config.configDir}',\n },\n});\n`;\n}\n","/**\n * New command - Scaffold a new component.\n */\n\nimport { loadConfig } from '../config/index.js';\nimport { existsSync, mkdirSync, writeFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport pc from 'picocolors';\n\nexport interface NewOptions {\n config?: string;\n title?: string;\n status?: 'stable' | 'beta' | 'deprecated';\n kind?: 'standalone' | 'subcomponent' | 'feature';\n}\n\nexport async function newComponent(componentId: string, options: NewOptions = {}): Promise<void> {\n if (!componentId) {\n console.error(pc.red('Error: Component ID is required'));\n console.log('Usage: catalogue new <component-id>');\n process.exit(1);\n }\n\n // Validate component ID format\n if (!/^[a-z][a-z0-9-]*$/.test(componentId)) {\n console.error(pc.red('Error: Component ID must be kebab-case starting with a letter'));\n console.log('Example: my-button, data-table, user-card');\n process.exit(1);\n }\n\n try {\n const config = await loadConfig({\n configFile: options.config,\n });\n\n const componentDir = join(config.registryPath, 'components', componentId);\n const scenariosDir = join(componentDir, 'scenarios');\n\n // Check if component already exists\n if (existsSync(componentDir)) {\n console.error(pc.red(`Error: Component \"${componentId}\" already exists at ${componentDir}`));\n process.exit(1);\n }\n\n // Create directories\n mkdirSync(scenariosDir, { recursive: true });\n\n // Generate custom element name (ensure it has a hyphen)\n const customElement = componentId.includes('-') ? componentId : `x-${componentId}`;\n\n // Generate title from ID\n const title = options.title || componentId\n .split('-')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ');\n\n const status = options.status || 'beta';\n const kind = options.kind || 'standalone';\n const scenarioId = `${componentId}-default`;\n\n // Write component.json\n const componentJson = {\n id: componentId,\n title,\n status,\n kind,\n description: `TODO: Add description for ${title}`,\n tags: [],\n exports: {\n customElement,\n },\n playground: {\n primaryScenarioId: scenarioId,\n controls: {\n // Example controls - customize as needed\n },\n },\n };\n\n writeFileSync(\n join(componentDir, 'component.json'),\n JSON.stringify(componentJson, null, 2) + '\\n'\n );\n\n // Write default scenario\n const scenarioJson = {\n id: scenarioId,\n title: 'Default',\n description: `Default state of ${title}`,\n componentId,\n primary: true,\n render: {\n element: customElement,\n attrs: {},\n slots: {\n default: `${title} content`,\n },\n },\n };\n\n writeFileSync(\n join(scenariosDir, 'default.json'),\n JSON.stringify(scenarioJson, null, 2) + '\\n'\n );\n\n // Write docs.md\n const docsMd = `# ${title}\n\nTODO: Add description for ${title}.\n\n## Usage\n\n\\`\\`\\`html\n<${customElement}>Content</${customElement}>\n\\`\\`\\`\n\n## Properties\n\n| Property | Type | Default | Description |\n|----------|------|---------|-------------|\n| | | | |\n\n## Slots\n\n| Slot | Description |\n|------|-------------|\n| default | Main content |\n\n## Examples\n\n### Basic\n\n\\`\\`\\`html\n<${customElement}>\n Hello World\n</${customElement}>\n\\`\\`\\`\n`;\n\n writeFileSync(join(componentDir, 'docs.md'), docsMd);\n\n // Generate component TypeScript template\n const componentTs = `/**\n * ${title} Web Component\n */\n\nexport class ${toPascalCase(componentId)} extends HTMLElement {\n static get observedAttributes() {\n return [];\n }\n\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n }\n\n connectedCallback() {\n this.render();\n }\n\n attributeChangedCallback() {\n this.render();\n }\n\n private render() {\n this.shadowRoot!.innerHTML = \\`\n <style>\n :host {\n display: block;\n }\n </style>\n <div class=\"${componentId}\">\n <slot></slot>\n </div>\n \\`;\n }\n}\n\ncustomElements.define('${customElement}', ${toPascalCase(componentId)});\n`;\n\n // Determine where to put the component source\n const srcDir = join(config.configDir, 'src', 'components');\n if (existsSync(srcDir)) {\n const componentSrcPath = join(srcDir, `${componentId}.ts`);\n if (!existsSync(componentSrcPath)) {\n writeFileSync(componentSrcPath, componentTs);\n console.log(pc.green(`✓ Created ${pc.bold(`src/components/${componentId}.ts`)}`));\n console.log(pc.yellow(` → Add to src/components/index.ts: export * from './${componentId}.js';`));\n }\n }\n\n console.log(pc.green(`\\n✓ Created component \"${componentId}\":`));\n console.log(pc.dim(` ${componentDir}/`));\n console.log(` ├── component.json`);\n console.log(` ├── docs.md`);\n console.log(` └── scenarios/`);\n console.log(` └── default.json`);\n\n console.log(pc.cyan('\\nNext steps:'));\n console.log(` 1. Edit ${pc.bold('component.json')} to add controls`);\n console.log(` 2. Edit ${pc.bold('docs.md')} to add documentation`);\n console.log(` 3. Add more scenarios in ${pc.bold('scenarios/')}`);\n console.log(` 4. Run ${pc.bold('catalogue validate')} to verify`);\n console.log(` 5. Run ${pc.bold('catalogue dev')} to preview`);\n\n } catch (error) {\n console.error(pc.red('Error creating component:'));\n console.error(error instanceof Error ? error.message : error);\n process.exit(1);\n }\n}\n\nfunction toPascalCase(str: string): string {\n return str\n .split('-')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join('');\n}\n","import { existsSync, mkdirSync, writeFileSync, readFileSync, readdirSync } from 'node:fs';\nimport { resolve, join, dirname } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport pc from 'picocolors';\n\nexport interface InitOptions {\n name?: string;\n force?: boolean;\n withClaude?: boolean;\n}\n\nexport async function init(options: InitOptions = {}): Promise<void> {\n const cwd = process.cwd();\n const projectName = options.name || 'my-component-catalogue';\n\n console.log(pc.cyan(`\\nInitializing component catalogue...\\n`));\n\n // Check for existing config\n const configFiles = ['catalogue.config.ts', 'catalogue.config.js', 'catalogue.config.mjs'];\n const existingConfig = configFiles.find(f => existsSync(resolve(cwd, f)));\n\n if (existingConfig && !options.force) {\n console.log(pc.yellow(`Found existing ${existingConfig}. Use --force to overwrite.\\n`));\n return;\n }\n\n // Create directories\n const dirs = [\n 'registry/components',\n 'registry/examples',\n 'src/components',\n 'screenshots',\n ];\n\n for (const dir of dirs) {\n const dirPath = resolve(cwd, dir);\n if (!existsSync(dirPath)) {\n mkdirSync(dirPath, { recursive: true });\n console.log(pc.green(` Created ${dir}/`));\n }\n }\n\n // Create catalogue.config.ts\n const configContent = `import type { CatalogueConfig } from '@adieyal/catalogue-cli';\n\nexport default {\n name: '${projectName}',\n registryDir: './registry',\n componentLoader: () => import('./src/components/index.js'),\n playwright: {\n breakpoints: [\n { name: 'mobile', width: 375, height: 667 },\n { name: 'tablet', width: 768, height: 1024 },\n { name: 'desktop', width: 1280, height: 800 },\n ],\n themes: ['light', 'dark'],\n screenshotDir: './screenshots',\n },\n} satisfies CatalogueConfig;\n`;\n\n writeFileSync(resolve(cwd, 'catalogue.config.ts'), configContent);\n console.log(pc.green(` Created catalogue.config.ts`));\n\n // Create src/components/index.ts\n const componentsIndexContent = `// Export your web components here\n// Example:\n// export * from './button.js';\n// export * from './card.js';\n`;\n\n writeFileSync(resolve(cwd, 'src/components/index.ts'), componentsIndexContent);\n console.log(pc.green(` Created src/components/index.ts`));\n\n // Create a sample component\n const sampleComponentDir = resolve(cwd, 'registry/components/sample-button');\n mkdirSync(sampleComponentDir, { recursive: true });\n mkdirSync(resolve(sampleComponentDir, 'scenarios'), { recursive: true });\n\n const componentJson = {\n id: 'sample-button',\n title: 'Sample Button',\n status: 'beta',\n kind: 'standalone',\n description: 'A sample button component to get you started.',\n tags: ['form', 'interactive'],\n playground: {\n primaryScenarioId: 'sample-button-default',\n },\n };\n\n writeFileSync(\n resolve(sampleComponentDir, 'component.json'),\n JSON.stringify(componentJson, null, 2)\n );\n\n const docsContent = `# Sample Button\n\nThis is a sample button component to help you get started.\n\n## Usage\n\n\\`\\`\\`html\n<sample-button variant=\"primary\">Click me</sample-button>\n\\`\\`\\`\n\n## Features\n\n- Multiple variants (primary, secondary, outline)\n- Disabled state\n- Click handling\n\nDelete this component and create your own using \\`catalogue new <component-id>\\`.\n`;\n\n writeFileSync(resolve(sampleComponentDir, 'docs.md'), docsContent);\n\n const scenarioJson = {\n id: 'sample-button-default',\n componentId: 'sample-button',\n title: 'Default',\n description: 'Default button appearance',\n render: {\n element: 'sample-button',\n attributes: {\n variant: 'primary',\n },\n slots: {\n default: 'Click me',\n },\n },\n };\n\n writeFileSync(\n resolve(sampleComponentDir, 'scenarios/default.json'),\n JSON.stringify(scenarioJson, null, 2)\n );\n\n console.log(pc.green(` Created sample-button component`));\n\n // Create sample web component source\n const sampleButtonTs = `export class SampleButton extends HTMLElement {\n static observedAttributes = ['variant', 'disabled'];\n\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n }\n\n connectedCallback() {\n this.render();\n }\n\n attributeChangedCallback() {\n this.render();\n }\n\n get variant() {\n return this.getAttribute('variant') || 'primary';\n }\n\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n render() {\n const styles = \\`\n :host {\n display: inline-block;\n }\n button {\n padding: 8px 16px;\n border-radius: 4px;\n border: 2px solid transparent;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s;\n }\n button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n button.primary {\n background: #3b82f6;\n color: white;\n }\n button.primary:hover:not(:disabled) {\n background: #2563eb;\n }\n button.secondary {\n background: #6b7280;\n color: white;\n }\n button.secondary:hover:not(:disabled) {\n background: #4b5563;\n }\n button.outline {\n background: transparent;\n border-color: #3b82f6;\n color: #3b82f6;\n }\n button.outline:hover:not(:disabled) {\n background: #3b82f6;\n color: white;\n }\n \\`;\n\n this.shadowRoot!.innerHTML = \\`\n <style>\\${styles}</style>\n <button class=\"\\${this.variant}\" \\${this.disabled ? 'disabled' : ''}>\n <slot></slot>\n </button>\n \\`;\n }\n}\n\ncustomElements.define('sample-button', SampleButton);\n`;\n\n writeFileSync(resolve(cwd, 'src/components/sample-button.ts'), sampleButtonTs);\n console.log(pc.green(` Created src/components/sample-button.ts`));\n\n // Update components index\n writeFileSync(\n resolve(cwd, 'src/components/index.ts'),\n `export * from './sample-button.js';\\n`\n );\n\n // Create/update package.json\n const packageJsonPath = resolve(cwd, 'package.json');\n let packageJson: Record<string, unknown> = {};\n\n if (existsSync(packageJsonPath)) {\n packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));\n }\n\n packageJson.scripts = {\n ...(packageJson.scripts as Record<string, string> || {}),\n 'catalogue': 'catalogue dev',\n 'catalogue:build': 'catalogue build',\n 'catalogue:preview': 'catalogue preview',\n 'catalogue:validate': 'catalogue validate',\n 'catalogue:test': 'catalogue test',\n };\n\n writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\\n');\n console.log(pc.green(` Updated package.json scripts`));\n\n // Create tsconfig.json if it doesn't exist\n const tsconfigPath = resolve(cwd, 'tsconfig.json');\n if (!existsSync(tsconfigPath)) {\n const tsconfig = {\n compilerOptions: {\n target: 'ES2022',\n module: 'ESNext',\n moduleResolution: 'bundler',\n strict: true,\n esModuleInterop: true,\n skipLibCheck: true,\n declaration: true,\n outDir: './dist',\n rootDir: './src',\n },\n include: ['src/**/*', 'catalogue.config.ts'],\n exclude: ['node_modules', 'dist'],\n };\n\n writeFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 2) + '\\n');\n console.log(pc.green(` Created tsconfig.json`));\n }\n\n // Create .gitignore additions\n const gitignorePath = resolve(cwd, '.gitignore');\n const gitignoreAdditions = `\n# Catalogue\n.catalogue-tests/\nplaywright-report/\ntest-results/\n`;\n\n if (existsSync(gitignorePath)) {\n const existing = readFileSync(gitignorePath, 'utf-8');\n if (!existing.includes('.catalogue-tests')) {\n writeFileSync(gitignorePath, existing + gitignoreAdditions);\n console.log(pc.green(` Updated .gitignore`));\n }\n } else {\n writeFileSync(gitignorePath, `node_modules/\\ndist/\\n${gitignoreAdditions}`);\n console.log(pc.green(` Created .gitignore`));\n }\n\n // Install Claude Code skills if requested\n if (options.withClaude) {\n const claudeSkillsDir = resolve(cwd, '.claude/skills');\n mkdirSync(claudeSkillsDir, { recursive: true });\n\n // Get the package's skills directory\n const __filename = fileURLToPath(import.meta.url);\n const __dirname = dirname(__filename);\n const packageSkillsDir = resolve(__dirname, '../../skills');\n\n if (existsSync(packageSkillsDir)) {\n const skillFiles = readdirSync(packageSkillsDir).filter(f => f.endsWith('.md'));\n for (const file of skillFiles) {\n const content = readFileSync(resolve(packageSkillsDir, file), 'utf-8');\n writeFileSync(resolve(claudeSkillsDir, file), content);\n }\n console.log(pc.green(` Created .claude/skills/ (${skillFiles.length} skills)`));\n } else {\n // Fallback: embed skills directly\n installEmbeddedSkills(claudeSkillsDir);\n console.log(pc.green(` Created .claude/skills/`));\n }\n }\n\n console.log(pc.cyan(`\\n✓ Component catalogue initialized!\\n`));\n console.log(`Next steps:\\n`);\n console.log(` 1. Install dependencies:`);\n console.log(pc.gray(` npm install @adieyal/catalogue-cli @adieyal/catalogue-core\\n`));\n console.log(` 2. Start the dev server:`);\n console.log(pc.gray(` npm run catalogue\\n`));\n console.log(` 3. Create your first component:`);\n console.log(pc.gray(` npx catalogue new my-component\\n`));\n\n if (options.withClaude) {\n console.log(` Claude Code skills installed. Available commands:`);\n console.log(pc.gray(` /new-component <id> - Create a new component`));\n console.log(pc.gray(` /new-scenario <id> <name> - Add a scenario`));\n console.log(pc.gray(` /document-component <id> - Generate docs`));\n console.log(pc.gray(` /migrate-library [path] - Migrate existing library`));\n console.log(pc.gray(` /setup-tokens [path] - Configure design tokens\\n`));\n }\n}\n\nfunction installEmbeddedSkills(skillsDir: string): void {\n const skills: Record<string, string> = {\n 'new-component.md': `# Create New Component\n\nCreate a new component entry in the catalogue registry.\n\n## Arguments\n\n- \\`$ARGUMENTS\\` - Component ID (kebab-case, e.g., \\`user-avatar\\`)\n\n## Instructions\n\n1. Parse the component ID from \\`$ARGUMENTS\\`. If empty, ask the user for a component ID (must be kebab-case).\n\n2. Derive the component title by converting kebab-case to Title Case (e.g., \\`user-avatar\\` → \\`User Avatar\\`).\n\n3. Ask the user:\n - What is the component's purpose/description?\n - What status? (stable, beta, deprecated) - default: beta\n - What kind? (standalone, subcomponent, feature) - default: standalone\n - What tags apply? (e.g., form, layout, navigation, feedback)\n\n4. Create the directory structure:\n - \\`registry/components/<id>/\\`\n - \\`registry/components/<id>/scenarios/\\`\n\n5. Create \\`registry/components/<id>/component.json\\`:\n\n\\`\\`\\`json\n{\n \"id\": \"<component-id>\",\n \"title\": \"<Component Title>\",\n \"status\": \"<status>\",\n \"kind\": \"<kind>\",\n \"description\": \"<description>\",\n \"tags\": [<tags>],\n \"playground\": {\n \"primaryScenarioId\": \"<component-id>-default\"\n }\n}\n\\`\\`\\`\n\n6. Create \\`registry/components/<id>/docs.md\\`:\n\n\\`\\`\\`markdown\n# <Component Title>\n\n<description>\n\n## Usage\n\n\\\\<\\\\<component-id>>\\\\</\\\\<component-id>>\n\n## Properties\n\n| Property | Type | Default | Description |\n|----------|------|---------|-------------|\n\n## Slots\n\n| Slot | Description |\n|------|-------------|\n| default | Main content |\n\\`\\`\\`\n\n7. Create \\`registry/components/<id>/scenarios/default.json\\`:\n\n\\`\\`\\`json\n{\n \"id\": \"<component-id>-default\",\n \"componentId\": \"<component-id>\",\n \"title\": \"Default\",\n \"description\": \"Default appearance\",\n \"render\": {\n \"element\": \"<component-id>\",\n \"slots\": {\n \"default\": \"Content\"\n }\n }\n}\n\\`\\`\\`\n\n8. Create \\`src/components/<id>.ts\\` with a Web Component class:\n - Class name: PascalCase version of the ID (e.g., \\`user-avatar\\` → \\`UserAvatar\\`)\n - Use Shadow DOM with \\`mode: 'open'\\`\n - Include basic styles and a slot\n\n9. Update \\`src/components/index.ts\\` to add:\n\\`\\`\\`typescript\nexport * from './<component-id>.js';\n\\`\\`\\`\n\n10. Run \\`npx catalogue validate\\` to verify.\n\n11. Tell the user what was created and suggest:\n - Adding properties to the component\n - Creating more scenarios\n - Updating the docs\n`,\n 'new-scenario.md': `# Create New Scenario\n\nAdd a new scenario to an existing component.\n\n## Arguments\n\n- \\`$ARGUMENTS\\` - Format: \\`<component-id> <scenario-name>\\` (e.g., \\`button disabled\\`)\n\n## Instructions\n\n1. Parse arguments from \\`$ARGUMENTS\\`:\n - First word: component ID\n - Remaining words: scenario name\n - If missing, ask the user for component ID and scenario name\n\n2. Verify the component exists at \\`registry/components/<component-id>/component.json\\`. If not, list available components and ask user to choose.\n\n3. Generate scenario ID: \\`<component-id>-<scenario-name-kebab>\\` (e.g., \\`button-disabled\\`)\n\n4. Ask the user:\n - Brief description of this scenario\n - What attributes/properties should be set?\n - What slot content should be shown?\n - Any custom viewport size? (optional)\n - Any custom background color? (optional)\n\n5. Create \\`registry/components/<component-id>/scenarios/<scenario-name-kebab>.json\\`:\n\n\\`\\`\\`json\n{\n \"id\": \"<scenario-id>\",\n \"componentId\": \"<component-id>\",\n \"title\": \"<Scenario Title>\",\n \"description\": \"<description>\",\n \"render\": {\n \"element\": \"<component-id>\",\n \"attributes\": {\n // based on user input\n },\n \"slots\": {\n \"default\": \"<slot content>\"\n }\n }\n}\n\\`\\`\\`\n\nInclude optional fields only if provided:\n- \\`\"viewport\": { \"width\": <w>, \"height\": <h> }\\`\n- \\`\"background\": \"<color>\"\\`\n\n6. Run \\`npx catalogue validate\\` to verify.\n\n7. Tell the user:\n - Scenario created at \\`registry/components/<id>/scenarios/<name>.json\\`\n - View it at \\`http://localhost:5173/#/harness/<scenario-id>\\`\n - Suggest running \\`npm run catalogue\\` to see it\n`,\n 'document-component.md': `# Document Component\n\nGenerate or improve documentation for a component by analyzing its source code.\n\n## Arguments\n\n- \\`$ARGUMENTS\\` - Component ID (e.g., \\`button\\`)\n\n## Instructions\n\n1. Parse component ID from \\`$ARGUMENTS\\`. If empty, list components in \\`registry/components/\\` and ask user to choose.\n\n2. Read the component source file at \\`src/components/<id>.ts\\` (or \\`.js\\`).\n\n3. Analyze the source code to extract:\n - \\`static observedAttributes\\` → Properties\n - Getter/setter pairs → Properties with types\n - \\`<slot>\\` elements → Available slots\n - \\`this.dispatchEvent()\\` calls → Events\n - Any JSDoc comments\n\n4. Read existing docs at \\`registry/components/<id>/docs.md\\`.\n\n5. Read \\`registry/components/<id>/component.json\\` for title and description.\n\n6. Generate improved documentation with sections for Usage, Properties, Slots, Events, Examples, and Accessibility.\n\n7. Show the user the generated docs and ask if they want to:\n - Replace existing docs entirely\n - Merge with existing docs\n - Just see the output without saving\n\n8. If saving, write to \\`registry/components/<id>/docs.md\\`.\n\n9. Suggest creating scenarios for any documented states/variants not yet covered.\n`,\n 'migrate-library.md': `# Migrate Existing Component Library\n\nGuide migration of an existing component library to use the catalogue.\n\n## Arguments\n\n- \\`$ARGUMENTS\\` - Optional: path to components directory (e.g., \\`src/components\\`)\n\n## Instructions\n\nFollow this phased approach. Do NOT try to \"port everything\" at once.\n\n### Phase 1: Assess the Library\n\n1. If \\`$ARGUMENTS\\` provided, scan that directory. Otherwise, look for common patterns:\n - \\`src/components/\\`\n - \\`lib/components/\\`\n - \\`packages/*/src/\\`\n\n2. List all components found (custom elements, web components, or framework components).\n\n3. Check how components are currently registered:\n - Side-effect registration on import?\n - Manual \\`customElements.define()\\` calls?\n\n4. Check for existing: design tokens, theme support, documentation, demo pages.\n\n5. Report findings to user before proceeding.\n\n### Phase 2: Create Registration Entrypoint\n\nCreate \\`src/register-all.ts\\` that imports all components:\n\n\\`\\`\\`typescript\nimport './components/button/button';\nimport './components/card/card';\n\\`\\`\\`\n\nUpdate \\`catalogue.config.ts\\` to point to this entrypoint.\n\n### Phase 3: Generate Seed Registry\n\nFor EACH component, create minimal registry files:\n- \\`registry/components/<id>/component.json\\`\n- \\`registry/components/<id>/scenarios/default.json\\`\n- \\`registry/components/<id>/docs.md\\`\n\nRules: 1 scenario per component is enough initially. Use default props.\n\n### Phase 4: Add Critical Variants (2-5 per component)\n\n- Default/primary state\n- Disabled/loading (if applicable)\n- Dense case (long labels, overflow)\n- Responsive stress (narrow container)\n\nDo NOT create scenarios for every prop combination.\n\n### Phase 5: Establish Hierarchy\n\n- \\`standalone\\` - User-facing components\n- \\`subcomponent\\` - Internal pieces (add \\`parentId\\`)\n- \\`feature\\` - Complex composites\n\n### Phase 6: Validate\n\nRun \\`npx catalogue validate\\` and \\`npx catalogue dev\\`.\n\n### Migration Tips\n\n**Components requiring app context:** Create wrapper scenarios that provide context.\n\n**Components that fetch data:** Add prop to accept data directly. Scenarios must NOT make network calls.\n\n**Container queries:** Recommend \\`@container\\` for component internals, \\`@media\\` for page layout. The catalogue resizer tests container width, not viewport.\n\n### What \"Done\" Looks Like\n\n- Every component has a primary scenario\n- Key components have 3-5 variants\n- Playground works for top 20% of components\n- Old demo pages can be deleted\n`,\n 'setup-tokens.md': `# Setup Design Tokens\n\nConfigure design tokens for the catalogue so components render with correct styling.\n\n## Arguments\n\n- \\`$ARGUMENTS\\` - Optional: path to tokens file (e.g., \\`src/tokens/tokens.css\\`)\n\n## Instructions\n\n### Step 1: Identify Token Source\n\nSearch for: \\`**/tokens.css\\`, \\`**/variables.css\\`, \\`**/theme.css\\`, \\`**/design-tokens.json\\`\n\nAsk user to confirm the correct path.\n\n### Step 2: Identify Themes\n\nCheck for:\n- Separate files: \\`tokens-light.css\\`, \\`tokens-dark.css\\`\n- Selectors: \\`[data-theme=\"dark\"]\\`, \\`.dark-theme\\`\n\n### Step 3: Update Configuration\n\n**Single theme:**\n\\`\\`\\`typescript\nexport default {\n themes: {\n tokenCss: './src/tokens/tokens.css',\n }\n}\n\\`\\`\\`\n\n**Multiple themes:**\n\\`\\`\\`typescript\nexport default {\n themes: {\n default: 'light',\n available: ['light', 'dark'],\n tokenCss: {\n light: './src/tokens/tokens-light.css',\n dark: './src/tokens/tokens-dark.css',\n }\n }\n}\n\\`\\`\\`\n\n### Step 4: Scope Decision\n\n**Model A - Global tokens (recommended):** Tokens apply to entire document.\n\n**Model B - Scoped tokens:** Tokens apply only inside preview frame. Better if tokens use generic names (\\`--text\\`, \\`--bg\\`).\n\n### Step 5: Container Query Setup\n\nEnsure preview frame has:\n\\`\\`\\`css\n.preview-frame {\n container-type: inline-size;\n}\n\\`\\`\\`\n\nTell user: \"Components should use \\`@container\\` queries for internal responsiveness, not \\`@media\\` queries.\"\n\n### Step 6: Verify\n\n1. Run \\`npx catalogue dev\\`\n2. Check components render with correct colors, typography, spacing\n3. Toggle themes and verify switching works\n4. Resize preview frame and verify container queries respond\n`,\n };\n\n for (const [filename, content] of Object.entries(skills)) {\n writeFileSync(resolve(skillsDir, filename), content);\n }\n}\n"],"names":["writeFileSync","mkdirSync","existsSync","join","viteBuild","vitePreview","l","loadRegistry","validateRegistry","formatValidationErrors","getAllHarnessUrls"],"mappings":";;;;;;;;AAMO,MAAM,2BAA2B,EAAE,OAAO;AAAA;AAAA,EAE/C,IAAI,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,MAAM,q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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAyErB,aAAW,CAAC,UAAU,OAAO,KAAK,OAAO,QAAQ,MAAM,GAAG;AACxD,kBAAc,QAAQ,WAAW,QAAQ,GAAG,OAAO;AAAA,EACrD;AACF;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RawRegistryData } from '@adieyal/catalogue-core';
|
|
2
|
+
|
|
3
|
+
export interface FileLoaderOptions {
|
|
4
|
+
/** Path to the registry directory */
|
|
5
|
+
registryPath: string;
|
|
6
|
+
/** Base path for relative file paths */
|
|
7
|
+
basePath?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Load all registry files from disk.
|
|
11
|
+
*/
|
|
12
|
+
export declare function loadRegistryFiles(options: FileLoaderOptions): RawRegistryData;
|
|
13
|
+
/**
|
|
14
|
+
* Generate a virtual module that exports the registry data.
|
|
15
|
+
*/
|
|
16
|
+
export declare function generateRegistryModule(registryPath: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Get list of all registry files for watching.
|
|
19
|
+
*/
|
|
20
|
+
export declare function getRegistryWatchPaths(registryPath: string): string[];
|
|
21
|
+
//# sourceMappingURL=file-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-loader.d.ts","sourceRoot":"","sources":["../../src/registry/file-loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,MAAM,WAAW,iBAAiB;IAChC,qCAAqC;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,GAAG,eAAe,CAiF7E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAOnE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,CAmBpE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,KAAK,iBAAiB,GACvB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Virtual entry module template.
|
|
3
|
+
* This is transformed and served by the Vite plugin.
|
|
4
|
+
*/
|
|
5
|
+
export declare const entryTemplate = "\nimport { loadRegistry, mountCatalogueApp } from '@adieyal/catalogue-core';\nimport { registryData, config } from 'virtual:catalogue-registry';\n\n// Import consumer's components\nimport '{{COMPONENTS_ENTRY}}';\n\n// Load and validate the registry\nconst { registry, errors } = loadRegistry(registryData);\n\nif (errors.length > 0) {\n console.error('Registry validation errors:', errors);\n}\n\n// Mount the app\nconst app = mountCatalogueApp('#app', registry, {\n basePath: config.basePath,\n});\n\n// Hot module replacement\nif (import.meta.hot) {\n import.meta.hot.accept('virtual:catalogue-registry', (newModule) => {\n if (newModule) {\n window.location.reload();\n }\n });\n}\n";
|
|
6
|
+
//# sourceMappingURL=entry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../../src/vite/entry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,aAAa,isBA2BzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vite/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,KAAK,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC/F,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
import { ResolvedConfig } from '../config/index.js';
|
|
3
|
+
|
|
4
|
+
export interface CataloguePluginOptions {
|
|
5
|
+
config: ResolvedConfig;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Create the catalogue Vite plugin.
|
|
9
|
+
*/
|
|
10
|
+
export declare function cataloguePlugin(options: CataloguePluginOptions): Plugin;
|
|
11
|
+
/**
|
|
12
|
+
* Create the HTML template for the catalogue.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createHtmlTemplate(config: ResolvedConfig): string;
|
|
15
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/vite/plugin.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,MAAM,CAAC;AAElD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAKzD,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,cAAc,CAAC;CACxB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,MAAM,CA6DvE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAo2BjE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ResolvedConfig } from '../config/index.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Start the development server.
|
|
5
|
+
*/
|
|
6
|
+
export declare function startDevServer(config: ResolvedConfig): Promise<void>;
|
|
7
|
+
/**
|
|
8
|
+
* Build the static site.
|
|
9
|
+
*/
|
|
10
|
+
export declare function buildStatic(config: ResolvedConfig): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Start the preview server.
|
|
13
|
+
*/
|
|
14
|
+
export declare function startPreviewServer(config: ResolvedConfig): Promise<void>;
|
|
15
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/vite/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AA4EzD;;GAEG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAO1E;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAwCvE;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAW9E"}
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@adieyal/catalogue-cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CLI for generating and managing component catalogues",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/adieyal/component-catalogue.git",
|
|
9
|
+
"directory": "packages/catalogue-cli"
|
|
10
|
+
},
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"bin": {
|
|
16
|
+
"catalogue": "./dist/bin.js"
|
|
17
|
+
},
|
|
18
|
+
"main": "./dist/index.js",
|
|
19
|
+
"module": "./dist/index.js",
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"import": "./dist/index.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"skills"
|
|
30
|
+
],
|
|
31
|
+
"scripts": {
|
|
32
|
+
"dev": "vite build --watch",
|
|
33
|
+
"build": "vite build",
|
|
34
|
+
"test": "vitest run",
|
|
35
|
+
"test:watch": "vitest"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@adieyal/catalogue-core": "workspace:*",
|
|
39
|
+
"cac": "^6.7.14",
|
|
40
|
+
"picocolors": "^1.0.0",
|
|
41
|
+
"vite": "^5.0.12",
|
|
42
|
+
"zod": "^3.22.4"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@playwright/test": "^1.41.0",
|
|
46
|
+
"@types/node": "^20.11.0",
|
|
47
|
+
"typescript": "^5.3.3",
|
|
48
|
+
"vite-plugin-dts": "^3.7.0",
|
|
49
|
+
"vitest": "^1.2.0"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"@playwright/test": "^1.41.0"
|
|
53
|
+
},
|
|
54
|
+
"peerDependenciesMeta": {
|
|
55
|
+
"@playwright/test": {
|
|
56
|
+
"optional": true
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|