Skip to content

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

TypeScript

feat(cli): add showcases for Theme, MediaTheme, and SyntaxTheme utilities (#2040)

Cindy Zhangf40045e7b715
diff --git a/apps/docsite/src/components/component-detail/ComponentDetailClient.tsx b/apps/docsite/src/components/component-detail/ComponentDetailClient.tsx
index e3281a2514..317f508e93 100644
--- a/apps/docsite/src/components/component-detail/ComponentDetailClient.tsx
+++ b/apps/docsite/src/components/component-detail/ComponentDetailClient.tsx
@@ -9,6 +9,7 @@ import {XDSCard} from '@xds/core/Card';
import {XDSDivider} from '@xds/core';
import {XDSCodeBlock} from '@xds/core/CodeBlock';
import {XDSTabList, XDSTab} from '@xds/core/TabList';
+import {useMediaQuery} from '@xds/core/hooks';
import {ShowcasePreview} from './ShowcasePreview';
import {BestPractices} from './BestPractices';
import {HookSignature} from './HookSignature';
@@ -100,6 +101,7 @@ function ComponentDetailInner({
const isHook = comp.params != null;
const hasShowcase = comp.name in showcaseRegistry;
const hasPlayground = !isHook;
+ const isMobile = useMediaQuery('(max-width: 768px)');
const tab = searchParams.get('tab') ?? 'overview';
const setTab = (value: string) => {
@@ -160,7 +162,7 @@ function ComponentDetailInner({
zIndex: 10,
backgroundColor: 'var(--color-background-page)',
backdropFilter: 'blur(16px)',
- maxHeight: 400,
+ maxHeight: isMobile ? 250 : 400,
overflow: 'auto',
}}>
<InteractivePreviewStage name={comp.name} state={state} />
diff --git a/apps/docsite/src/components/component-detail/ExampleBlock.tsx b/apps/docsite/src/components/component-detail/ExampleBlock.tsx
index 5e25fe0384..ec838d067b 100644
--- a/apps/docsite/src/components/component-detail/ExampleBlock.tsx
+++ b/apps/docsite/src/components/component-detail/ExampleBlock.tsx
@@ -71,7 +71,7 @@ export function ExampleBlock({entry}: ExampleBlockProps) {
<LivePreview entry={entry} />
- <XDSSection variant="wash" padding={0} dividers={['top']}>
+ <XDSSection variant="wash" padding={1} dividers={['top']}>
<XDSTabList value={tab} onChange={setTab} size="sm">
<XDSTab value="description" label="Description" />
<XDSTab value="code" label="Code" />
diff --git a/packages/core/src/AppShell/AppShell.doc.mjs b/packages/core/src/AppShell/AppShell.doc.mjs
index 11d34fad0b..ba5dedb54d 100644
--- a/packages/core/src/AppShell/AppShell.doc.mjs
+++ b/packages/core/src/AppShell/AppShell.doc.mjs
@@ -50,7 +50,7 @@ export const docs = {
type: 'ReactNode',
description:
'Banner slot for system-wide announcements, placed above the topNav.',
- slotElements: [{__element: 'XDSBanner', props: {title: 'Info', status: 'info'}}],
+ slotElements: [{__element: 'XDSBanner', props: {title: 'Info', status: 'info', container: 'section'}}],
},
{
name: 'height',
@@ -90,6 +90,34 @@ export const docs = {
'StyleX styles for layout customization (margins, positioning, sizing). Must be a stylex.create() value — not an inline style object like style={{}}.',
},
],
+ playground: {
+ defaults: {
+ variant: 'surface',
+ contentPadding: 4,
+ topNav: {
+ __element: 'XDSTopNav',
+ props: {label: 'Navigation'},
+ children: {__element: 'XDSText', props: {type: 'body', weight: 'bold'}, children: 'My App'},
+ },
+ sideNav: {
+ __element: 'XDSSideNav',
+ props: {},
+ children: [
+ {__element: 'XDSSideNavItem', props: {label: 'Dashboard', isSelected: true}},
+ {__element: 'XDSSideNavItem', props: {label: 'Settings'}},
+ {__element: 'XDSSideNavItem', props: {label: 'Help'}},
+ ],
+ },
+ children: {
+ __element: 'XDSVStack',
+ props: {gap: 3},
+ children: [
+ {__element: 'XDSHeading', props: {level: 2}, children: 'Dashboard'},
+ {__element: 'XDSText', props: {type: 'body', color: 'secondary'}, children: 'Welcome back. Here is an overview of your workspace.'},
+ ],
+ },
+ },
+ },
theming: {
targets: [
{className: 'xds-app-shell', visualProps: ['variant']},