An open source design system that's fully customizable and agent ready
TypeScript
fix(core): add playground wrapper and defaults for LayoutHeader docsite preview (#5918)
Geervan58d4b80c8bcd
diff --git a/.changeset/layout-header-playground-wrapper.md b/.changeset/layout-header-playground-wrapper.mdnew file mode 100644index 0000000000..7492fe0e3b--- /dev/null+++ b/.changeset/layout-header-playground-wrapper.md@@ -0,0 +1,9 @@+---+'@astryxdesign/core': patch+---++[fix] LayoutHeader: add playground wrapper and default children for docsite preview++Prevents the properties-tab preview on the docsite from rendering an empty stage by wrapping LayoutHeader inside a Layout scaffold with representative header text.++@Geervandiff --git a/apps/docsite/src/__tests__/data-extraction.test.ts b/apps/docsite/src/__tests__/data-extraction.test.tsindex 51ab0a0b1c..76482505fa 100644--- a/apps/docsite/src/__tests__/data-extraction.test.ts+++ b/apps/docsite/src/__tests__/data-extraction.test.ts@@ -311,6 +311,18 @@ describe('componentRegistry', () => {});});+ it('LayoutHeader declares a playground wrapper and default content so preview is not empty', () => {+ const core = components['@astryxdesign/core'];+ const layoutHeader = core.find(c => c.name === 'LayoutHeader');+ expect(layoutHeader).toBeDefined();+ expect(layoutHeader!.playground?.defaults).toMatchObject({+ children: expect.any(String),+ });+ expect(layoutHeader!.playground?.wrapper).toMatchObject({+ component: 'Layout',+ });+ });+it('Lightbox declares an overlay playground with a closed initial state (#3657)', () => {const core = components['@astryxdesign/core'];const lightbox = core.find(c => c.name === 'Lightbox');diff --git a/packages/core/src/Layout/LayoutHeader.doc.mjs b/packages/core/src/Layout/LayoutHeader.doc.mjsindex dcd4a0ce38..5752d3a065 100644--- a/packages/core/src/Layout/LayoutHeader.doc.mjs+++ b/packages/core/src/Layout/LayoutHeader.doc.mjs@@ -8,6 +8,15 @@ export const docs = {displayName: 'Layout Header',isHiddenFromOverview: true,description: 'Top bar for page titles, app bars, and toolbars.',+ playground: {+ defaults: {+ children: 'Page Title',+ hasDivider: true,+ },+ wrapper: {+ component: 'Layout',+ },+ },props: [{name: 'children',