An open source design system that's fully customizable and agent ready
TypeScript
fix(docsite): make theme preview responsive on mobile (#2052)
Cindy Zhang8c9b9a338b53
diff --git a/apps/docsite/src/components/ThemeShowcasePreview.tsx b/apps/docsite/src/components/ThemeShowcasePreview.tsxindex 2b6376a113..0b1c6b69e9 100644--- a/apps/docsite/src/components/ThemeShowcasePreview.tsx+++ b/apps/docsite/src/components/ThemeShowcasePreview.tsx@@ -10,7 +10,7 @@ import {XDSCenter} from '@xds/core/Center';import {XDSSection} from '@xds/core/Section';import {XDSGrid} from '@xds/core/Grid';import {XDSBadge} from '@xds/core/Badge';-import {XDSTable} from '@xds/core/Table';+import {XDSTable, proportional} from '@xds/core/Table';import {XDSAspectRatio} from '@xds/core/AspectRatio';import {XDSTopNav, XDSTopNavHeading} from '@xds/core/TopNav';import {XDSRadioList, XDSRadioListItem} from '@xds/core/RadioList';@@ -46,6 +46,7 @@ const styles = stylex.create({},fontCard: {borderColor: 'transparent',+ minWidth: 0,},fontSample: {height: '100%',@@ -55,6 +56,8 @@ const styles = stylex.create({},componentCard: {borderColor: 'transparent',+ overflow: 'hidden',+ minWidth: 0,},});@@ -209,7 +212,7 @@ export function ThemeShowcasePreview({</XDSVStack></XDSCenter>- <XDSGrid columns={3} gap={4}>+ <XDSGrid columns={{minWidth: 240}} gap={4}>{PRODUCTS.map((p, i) => (<XDSCard key={p.name} padding={0}><XDSVStack gap={0}>@@ -244,10 +247,14 @@ export function ThemeShowcasePreview({<XDSTabledata={TABLE_DATA}columns={[- {key: 'name', header: 'Name'},- {key: 'description', header: 'Description'},- {key: 'price', header: 'Price'},- {key: 'stock', header: 'Stock'},+ {key: 'name', header: 'Name', width: proportional(1)},+ {+ key: 'description',+ header: 'Description',+ width: proportional(2),+ },+ {key: 'price', header: 'Price', width: proportional(1)},+ {key: 'stock', header: 'Stock', width: proportional(1)},]}density="spacious"dividers="rows"@@ -266,7 +273,7 @@ function ThemeShowcaseDetails() {return (<XDSVStack gap={4}>- <XDSGrid columns={2} gap={4}>+ <XDSGrid columns={{minWidth: 280}} gap={4}><XDSCard padding={6} xstyle={styles.fontCard}><XDSVStack gap={4}><XDSText type="label" weight="bold">@@ -310,12 +317,12 @@ function ThemeShowcaseDetails() {</XDSGrid><XDSCard padding={6} xstyle={styles.componentCard}>- <XDSGrid columns={2} gap={8}>+ <XDSGrid columns={{minWidth: 240}} gap={8}><XDSVStack gap={4}><XDSText type="label" weight="bold">Components</XDSText>- <XDSHStack gap={2}>+ <XDSHStack gap={2} wrap="wrap"><XDSButton label="Primary" variant="primary" size="sm" href="#" /><XDSButtonlabel="Secondary"@@ -325,14 +332,14 @@ function ThemeShowcaseDetails() {/><XDSButton label="Ghost" variant="ghost" size="sm" href="#" /></XDSHStack>- <XDSHStack gap={2}>+ <XDSHStack gap={2} wrap="wrap"><XDSBadge label="Badge" /><XDSBadge label="Info" variant="info" /><XDSBadge label="Success" variant="success" /><XDSBadge label="Warning" variant="warning" /><XDSBadge label="Error" variant="error" /></XDSHStack>- <XDSGrid columns={2} gap={4}>+ <XDSGrid columns={{minWidth: 180}} gap={4}><XDSVStack gap={2}><XDSText type="supporting" weight="bold">Label