Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

fix(core): add playground wrapper and defaults for LayoutFooter docsite preview (#6341)

Rupesh Kumar088e039de9a2
diff --git a/.changeset/layout-footer-playground-wrapper.md b/.changeset/layout-footer-playground-wrapper.md
new file mode 100644
index 0000000000..c5a8590f3e
--- /dev/null
+++ b/.changeset/layout-footer-playground-wrapper.md
@@ -0,0 +1,9 @@
+---
+'@astryxdesign/core': patch
+---
+
+[fix] LayoutFooter: add playground wrapper and default children for docsite preview
+
+Prevents the properties-tab preview on the docsite from rendering an empty stage by wrapping LayoutFooter inside a Layout scaffold with representative footer content in the footer slot.
+
+@rupesh-kumar-sah
diff --git a/apps/docsite/src/__tests__/data-extraction.test.ts b/apps/docsite/src/__tests__/data-extraction.test.ts
index 4f5e637780..8d1785ace1 100644
--- a/apps/docsite/src/__tests__/data-extraction.test.ts
+++ b/apps/docsite/src/__tests__/data-extraction.test.ts
@@ -612,6 +612,20 @@ describe('componentRegistry', () => {
});
});
+ it('LayoutFooter declares a playground wrapper in footer slot so preview is not empty (#5895)', () => {
+ const core = components['@astryxdesign/core'];
+ const layoutFooter = core.find(c => c.name === 'LayoutFooter');
+ expect(layoutFooter).toBeDefined();
+ expect(layoutFooter!.playground?.defaults).toMatchObject({
+ children: expect.any(String),
+ hasDivider: true,
+ });
+ expect(layoutFooter!.playground?.wrapper).toMatchObject({
+ component: 'Layout',
+ slotProp: 'footer',
+ });
+ });
+
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/LayoutFooter.doc.mjs b/packages/core/src/Layout/LayoutFooter.doc.mjs
index 334a30db02..408ae4257a 100644
--- a/packages/core/src/Layout/LayoutFooter.doc.mjs
+++ b/packages/core/src/Layout/LayoutFooter.doc.mjs
@@ -8,6 +8,23 @@ export const docs = {
displayName: 'Layout Footer',
isHiddenFromOverview: true,
description: 'Bottom bar for action bars, pagination, and status bars.',
+ playground: {
+ defaults: {
+ children: 'Footer content: status bar or actions',
+ hasDivider: true,
+ },
+ wrapper: {
+ component: 'Layout',
+ slotProp: 'footer',
+ props: {
+ content: {
+ __element: 'LayoutContent',
+ props: {},
+ children: 'Main content area',
+ },
+ },
+ },
+ },
props: [
{
name: 'children',