From f627f6955f5a426d73e54378f0f26d851451851c Mon Sep 17 00:00:00 2001 From: johndoe6345789 Date: Sun, 18 Jan 2026 13:15:04 +0000 Subject: [PATCH] Support branding and navigation molecules --- json-components-registry.json | 6 ++--- src/lib/component-definitions.json | 32 +++++++++++++++++++++++++ src/lib/json-ui/component-registry.ts | 13 ++++++---- src/schemas/new-molecules-showcase.json | 15 ++++++++++++ src/types/json-ui.ts | 2 +- 5 files changed, 60 insertions(+), 8 deletions(-) diff --git a/json-components-registry.json b/json-components-registry.json index 62e9f19..7559bab 100644 --- a/json-components-registry.json +++ b/json-components-registry.json @@ -761,7 +761,7 @@ "category": "navigation", "canHaveChildren": true, "description": "NavigationGroupHeader component", - "status": "json-compatible", + "status": "supported", "source": "molecules", "jsonCompatible": true }, @@ -910,7 +910,7 @@ "category": "feedback", "canHaveChildren": true, "description": "LabelWithBadge component", - "status": "json-compatible", + "status": "supported", "source": "molecules", "jsonCompatible": true }, @@ -1186,7 +1186,7 @@ "category": "custom", "canHaveChildren": true, "description": "AppBranding component", - "status": "json-compatible", + "status": "supported", "source": "molecules", "jsonCompatible": true }, diff --git a/src/lib/component-definitions.json b/src/lib/component-definitions.json index 9731f20..d54a6fc 100644 --- a/src/lib/component-definitions.json +++ b/src/lib/component-definitions.json @@ -274,6 +274,17 @@ "icon": "Circle", "defaultProps": { "status": "active", "children": "Active" } }, + { + "type": "LabelWithBadge", + "label": "Label With Badge", + "category": "feedback", + "icon": "Tag", + "defaultProps": { + "label": "Total Items", + "badge": 24, + "badgeVariant": "secondary" + } + }, { "type": "ErrorBadge", "label": "Error Badge", @@ -727,6 +738,17 @@ "errorCount": 0 } }, + { + "type": "NavigationGroupHeader", + "label": "Navigation Group Header", + "category": "navigation", + "icon": "CaretDown", + "defaultProps": { + "label": "Components", + "count": 12, + "isExpanded": true + } + }, { "type": "EmptyCanvasState", "label": "Empty Canvas State", @@ -773,6 +795,16 @@ "selectedTreeId": null } }, + { + "type": "AppBranding", + "label": "App Branding", + "category": "custom", + "icon": "Layout", + "defaultProps": { + "title": "CodeForge", + "subtitle": "Low-Code Next.js App Builder" + } + }, { "type": "AppHeader", "label": "App Header", diff --git a/src/lib/json-ui/component-registry.ts b/src/lib/json-ui/component-registry.ts index 90df225..ddee011 100644 --- a/src/lib/json-ui/component-registry.ts +++ b/src/lib/json-ui/component-registry.ts @@ -186,10 +186,15 @@ if (breadcrumbComponent) { atomComponents.Breadcrumb = breadcrumbComponent as ComponentType } -export const moleculeComponents: UIComponentRegistry = buildRegistryFromNames( - moleculeRegistryNames, - MoleculeComponents as Record> -) +export const moleculeComponents: UIComponentRegistry = { + ...buildRegistryFromNames( + moleculeRegistryNames, + MoleculeComponents as Record> + ), + AppBranding: (MoleculeComponents as Record>).AppBranding, + LabelWithBadge: (MoleculeComponents as Record>).LabelWithBadge, + NavigationGroupHeader: (MoleculeComponents as Record>).NavigationGroupHeader, +} export const organismComponents: UIComponentRegistry = buildRegistryFromNames( organismRegistryNames, diff --git a/src/schemas/new-molecules-showcase.json b/src/schemas/new-molecules-showcase.json index 16bcd81..602b388 100644 --- a/src/schemas/new-molecules-showcase.json +++ b/src/schemas/new-molecules-showcase.json @@ -76,6 +76,7 @@ { "id": "branding-content", "type": "CardContent", + "props": { "className": "space-y-4" }, "children": [ { "id": "branding-demo", @@ -84,6 +85,10 @@ "title": "My Amazing App", "subtitle": "Built with JSON-Powered Components" } + }, + { + "id": "branding-demo-default", + "type": "AppBranding" } ] } @@ -291,6 +296,7 @@ { "id": "nav-header-content", "type": "CardContent", + "props": { "className": "space-y-2" }, "children": [ { "id": "nav-header-demo", @@ -300,6 +306,15 @@ "count": 24, "isExpanded": true } + }, + { + "id": "nav-header-demo-collapsed", + "type": "NavigationGroupHeader", + "props": { + "label": "Workflows", + "count": 6, + "isExpanded": false + } } ] } diff --git a/src/types/json-ui.ts b/src/types/json-ui.ts index 51c6c9b..1f4e565 100644 --- a/src/types/json-ui.ts +++ b/src/types/json-ui.ts @@ -13,7 +13,7 @@ export type ComponentType = | 'DataList' | 'DataTable' | 'MetricCard' | 'Timeline' | 'LazyBarChart' | 'LazyLineChart' | 'LazyD3BarChart' | 'SeedDataManager' | 'SaveIndicator' | 'StorageSettings' - | 'AppBranding' | 'LabelWithBadge' | 'EmptyEditorState' | 'LoadingFallback' | 'LoadingState' | 'NavigationGroupHeader' + | 'AppBranding' | 'LabelWithBadge' | 'NavigationGroupHeader' | 'EmptyEditorState' | 'LoadingFallback' | 'LoadingState' | 'CodeExplanationDialog' | 'ComponentBindingDialog' | 'DataSourceCard' | 'DataSourceEditorDialog' | 'TreeCard' | 'TreeFormDialog' | 'ToolbarButton' | 'SchemaCodeViewer'