An open source design system that's fully customizable and agent ready
TypeScript
fix(docsite): Docsite landing page cleanup (#2469)
Kenton Quatman4110b531f96b
diff --git a/apps/docsite/src/app/(site)/_landing/AboutShowcase.tsx b/apps/docsite/src/app/(site)/_landing/AboutShowcase.tsxindex cf66f83c9f..52852a4602 100644--- a/apps/docsite/src/app/(site)/_landing/AboutShowcase.tsx+++ b/apps/docsite/src/app/(site)/_landing/AboutShowcase.tsx@@ -4,67 +4,27 @@import type {ReactNode} from 'react';import * as stylex from '@stylexjs/stylex';-import {XDSVStack} from '@xds/core/Layout';+import {XDSCard, XDSVStack} from '@xds/core/Layout';+import {XDSGrid} from '@xds/core/Grid';+import {XDSAspectRatio} from '@xds/core/AspectRatio';import {XDSHeading, XDSText} from '@xds/core/Text';import {XDSLink} from '@xds/core/Link';import {XDSBadge} from '@xds/core/Badge';-import {XDSDivider} from '@xds/core/Divider';-import {XDSTheme} from '@xds/core/theme';-import {neutralTheme} from '@xds/theme-neutral/built';-import {spacingVars} from '@xds/core/theme/tokens.stylex';const styles = stylex.create({- section: {- width: '100%',- paddingBlock: spacingVars['--spacing-12'],- paddingInline: spacingVars['--spacing-6'],- backgroundColor: 'var(--color-background-surface)',- display: 'flex',- flexDirection: 'column',- alignItems: 'center',- gap: spacingVars['--spacing-10'],- },headingBlock: {textAlign: 'center',width: '100%',maxWidth: 680,},- subhead: {- width: '100%',- maxWidth: 680,- },- fillWidth: {- width: '100%',- },- grid: {- width: '100%',- maxWidth: 1200,- display: 'grid',- gridTemplateColumns: {- default: '1fr',- '@media (min-width: 720px)': 'repeat(3, 1fr)',- },- },- column: {- paddingBlock: spacingVars['--spacing-8'],- paddingInline: spacingVars['--spacing-6'],- borderLeftWidth: {- default: 0,- '@media (min-width: 720px)': 1,- },- borderLeftStyle: 'solid',- borderLeftColor: 'var(--color-border)',- },- firstColumn: {- borderLeftWidth: 0,- },- topDivider: {+ // Layout glue for the XDSGrid: cap at 1200px. XDSGrid doesn't expose+ // maxWidth as a prop, so we pass it through xstyle.+ gridLayout: {width: '100%',maxWidth: 1200,},iconSlot: {- height: 48,- marginBottom: spacingVars['--spacing-4'],+ height: 40,},});@@ -124,6 +84,17 @@ function DiamondIcon() {}const items: AboutItem[] = [+ {+ title: 'Designed for speed',+ description:+ 'Foundations you can trust, speed you can feel. The system is built so teams stop reinventing the basics and start shipping the ideas that matter.',+ link: (+ <XDSLink type="body" href="/docs/getting-started" hasUnderline>+ Get started in minutes+ </XDSLink>+ ),+ icon: <DiamondIcon />,+ },{title: 'Built by the people who use it',description:@@ -146,35 +117,16 @@ const items: AboutItem[] = [),icon: <SquareIcon />,},- {- title: 'Designed for speed',- description:- 'Foundations you can trust, speed you can feel. The system is built so teams stop reinventing the basics and start shipping the ideas that matter.',- link: (- <XDSLink type="body" href="/docs/getting-started" hasUnderline>- Get started in minutes- </XDSLink>- ),- icon: <DiamondIcon />,- },];function AboutHeading() {return (- <XDSVStack- gap={2}- align="center"- xstyle={styles.headingBlock}- style={{textAlign: 'center'}}>+ <XDSVStack gap={4} align="center" xstyle={styles.headingBlock}><XDSBadge variant="orange" label="About us" />- <XDSHeading- level={2}- type="display-2"- color="primary"- xstyle={styles.fillWidth}>+ <XDSHeading level={2} type="display-2" color="primary">Astryx powers over 13,000 apps</XDSHeading>- <XDSText type="body" color="secondary" xstyle={styles.subhead}>+ <XDSText type="body" color="secondary" style={{maxWidth: 560}}>Astryx has grown inside Meta over the last eight years, shaped by theengineers, designers, and product teams who depend on it every day.</XDSText>@@ -182,40 +134,39 @@ function AboutHeading() {);}-function AboutColumn({item, isFirst}: {item: AboutItem; isFirst: boolean}) {+function AboutColumn({item}: {item: AboutItem}) {return (- <div- {...stylex.props(styles.column, isFirst && styles.firstColumn)}- style={{textAlign: 'left'}}>- <div {...stylex.props(styles.iconSlot)}>{item.icon}</div>- <XDSVStack gap={2} align="start">- <XDSHeading level={3} color="primary">- {item.title}- </XDSHeading>- <XDSVStack gap={1} align="start">+ <XDSCard padding={5}>+ <XDSVStack gap={6}>+ <XDSAspectRatio ratio={1} xstyle={styles.iconSlot}>+ {item.icon}+ </XDSAspectRatio>+ <XDSVStack gap={1} align="stretch">+ <XDSHeading level={3} color="primary">+ {item.title}+ </XDSHeading><XDSText type="body" color="secondary">{item.description}</XDSText>- {item.link}</XDSVStack>+ {item.link}</XDSVStack>- </div>+ </XDSCard>);}export function AboutShowcase() {return (- <section {...stylex.props(styles.section)}>+ <XDSVStack as="section" align="center" gap={10} width="100%"><AboutHeading />- <XDSTheme theme={neutralTheme} mode="light">- <XDSDivider variant="subtle" xstyle={styles.topDivider} />- <div {...stylex.props(styles.grid)}>- {items.map((item, i) => (- <AboutColumn key={item.title} item={item} isFirst={i === 0} />- ))}- </div>- <XDSDivider variant="subtle" xstyle={styles.topDivider} />- </XDSTheme>- </section>+ <XDSGrid+ columns={{minWidth: 280, repeat: 'fit'}}+ gap={4}+ xstyle={styles.gridLayout}>+ {items.map(item => (+ <AboutColumn key={item.title} item={item} />+ ))}+ </XDSGrid>+ </XDSVStack>);}diff --git a/apps/docsite/src/app/(site)/_landing/DiscoverShowcase.tsx b/apps/docsite/src/app/(site)/_landing/DiscoverShowcase.tsxindex b84c01b9aa..aeeeee8da1 100644--- a/apps/docsite/src/app/(site)/_landing/DiscoverShowcase.tsx+++ b/apps/docsite/src/app/(site)/_landing/DiscoverShowcase.tsx@@ -25,13 +25,6 @@ const CORE_COMPONENT_COUNT_ROUNDED =const styles = stylex.create({section: {width: '100%',- paddingBlock: spacingVars['--spacing-12'],- paddingInline: spacingVars['--spacing-6'],- backgroundColor: 'var(--color-background-surface)',- display: 'flex',- flexDirection: 'column',- alignItems: 'center',- gap: spacingVars['--spacing-10'],overflowX: 'clip',},stage: {@@ -114,26 +107,19 @@ const styles = stylex.create({right: -32,transform: 'rotate(-6deg)',},- content: {- textAlign: 'center',- maxWidth: 680,- },- headlineRow: {- display: 'flex',- alignItems: 'center',- justifyContent: 'center',- flexWrap: 'wrap',- columnGap: spacingVars['--spacing-3'],- rowGap: spacingVars['--spacing-2'],- },inlineWordmark: {display: 'inline-block',- height: '0.6em',+ verticalAlign: 'baseline',+ height: '.625em',width: 'auto',- verticalAlign: '0.06em',- marginTop: 8,+ marginInline: 16,+ },+ cardContent: {+ maxWidth: 560,+ textAlign: 'center',+ marginInline: 'auto',},- buttons: {+ buttonGrid: {width: '100%',maxWidth: 360,},@@ -165,7 +151,7 @@ export function DiscoverShowcase() {}, []);return (- <section {...stylex.props(styles.section)}>+ <XDSVStack as="section" gap={10} align="center" xstyle={styles.section}><div ref={stageRef} {...stylex.props(styles.stage)}><imgsrc="/discover-card-1.png"@@ -204,28 +190,24 @@ export function DiscoverShowcase() {)}/><XDSCard variant="blue" padding={0} xstyle={styles.card}>- <XDSVStack- gap={4}- align="center"- xstyle={styles.content}- style={{textAlign: 'center', marginInline: 'auto'}}>- <XDSHeading level={2} type="display-1" color="primary">- <span {...stylex.props(styles.headlineRow)}>- <span>Discover the full</span>+ <XDSVStack gap={10} align="center" xstyle={styles.cardContent}>+ <XDSVStack gap={4} align="center">+ <XDSHeading level={2} type="display-1" color="primary">+ Discover the full<imgsrc="/astryx-logo.svg"alt="Astryx"{...stylex.props(styles.inlineWordmark)}/>- <span>design system.</span>- </span>- </XDSHeading>- <XDSText type="body" color="secondary">- Browse {CORE_COMPONENT_COUNT_ROUNDED}+ components, explore- production-ready templates, and tune themes to match your brand —- pick a starting point and go.- </XDSText>- <XDSGrid columns={2} gap={3} xstyle={styles.buttons}>+ design system.+ </XDSHeading>+ <XDSText type="body" color="secondary" style={{maxWidth: 480}}>+ Browse {CORE_COMPONENT_COUNT_ROUNDED}+ components, explore+ production-ready templates, and tune themes to match your brand+ — pick a starting point and go.+ </XDSText>+ </XDSVStack>+ <XDSGrid columns={2} gap={3} xstyle={styles.buttonGrid}><XDSButtonvariant="primary"size="lg"@@ -242,6 +224,6 @@ export function DiscoverShowcase() {</XDSVStack></XDSCard></div>- </section>+ </XDSVStack>);}diff --git a/apps/docsite/src/app/(site)/_landing/FeaturesShowcase.tsx b/apps/docsite/src/app/(site)/_landing/FeaturesShowcase.tsxindex b34be8a0d7..3dd1da5a39 100644--- a/apps/docsite/src/app/(site)/_landing/FeaturesShowcase.tsx+++ b/apps/docsite/src/app/(site)/_landing/FeaturesShowcase.tsx@@ -9,9 +9,6 @@ import {XDSGrid} from '@xds/core/Grid';import {XDSHeading, XDSText} from '@xds/core/Text';import {XDSLink} from '@xds/core/Link';import {XDSBadge} from '@xds/core/Badge';-import {XDSTheme} from '@xds/core/theme';-import {neutralTheme} from '@xds/theme-neutral/built';-import {spacingVars} from '@xds/core/theme/tokens.stylex';import {components} from '../../../generated/componentRegistry';// Count of public @xds/core components (excluding hooks and hidden entries).@@ -26,24 +23,11 @@ const CORE_COMPONENT_COUNT = (components['@xds/core'] ?? []).filter(const CORE_COMPONENT_COUNT_ROUNDED = Math.floor(CORE_COMPONENT_COUNT / 10) * 10;const styles = stylex.create({- section: {- width: '100%',- paddingBlock: spacingVars['--spacing-12'],- paddingInline: spacingVars['--spacing-6'],- backgroundColor: 'var(--color-background-surface)',- display: 'flex',- flexDirection: 'column',- alignItems: 'center',- gap: spacingVars['--spacing-10'],- },headingBlock: {textAlign: 'center',width: '100%',maxWidth: 680,},- fillWidth: {- width: '100%',- },// Layout glue for the XDSGrid: cap at 1200px and force every row to the// same height so the tall first card and the regular cards line up.// XDSGrid doesn't expose gridAutoRows or maxWidth as props, so we pass@@ -131,24 +115,17 @@ function FeatureCard({feature, isTall}: {feature: Feature; isTall?: boolean}) {function FeaturesHeading() {return (- <XDSVStack- gap={2}- align="center"- xstyle={styles.headingBlock}- style={{textAlign: 'center'}}>+ <XDSVStack gap={4} align="center" xstyle={styles.headingBlock}><XDSBadge variant="blue" label="Key features" />- <XDSHeading- level={2}- type="display-2"- color="primary"- xstyle={styles.fillWidth}>- Start anywhere.- <br />- Change anything. Ship faster.+ <XDSHeading level={2} type="display-2" color="primary">+ Start anywhere. Change anything. Ship faster.</XDSHeading>- <XDSText type="body" color="secondary" xstyle={styles.fillWidth}>+ <XDSText+ display="block"+ type="body"+ color="secondary"+ style={{maxWidth: 420}}>A design system that adapts to your workflow, not the other way around.- <br />Built for speed, clarity, and creative freedom.</XDSText></XDSVStack>@@ -157,22 +134,16 @@ function FeaturesHeading() {export function FeaturesShowcase() {return (- <section {...stylex.props(styles.section)}>+ <XDSVStack as="section" align="center" gap={10} width="100%"><FeaturesHeading />- <XDSTheme theme={neutralTheme} mode="light">- <XDSGrid- columns={{minWidth: 280, repeat: 'fit'}}- gap={4}- xstyle={styles.gridLayout}>- {features.map((feature, i) => (- <FeatureCard- key={feature.title}- feature={feature}- isTall={i === 0}- />- ))}- </XDSGrid>- </XDSTheme>- </section>+ <XDSGrid+ columns={{minWidth: 320, repeat: 'fit'}}+ gap={4}+ xstyle={styles.gridLayout}>+ {features.map((feature, i) => (+ <FeatureCard key={feature.title} feature={feature} isTall={i === 0} />+ ))}+ </XDSGrid>+ </XDSVStack>);}diff --git a/apps/docsite/src/app/(site)/_landing/ThemingShowcase.tsx b/apps/docsite/src/app/(site)/_landing/ThemingShowcase.tsxindex 498d26e1aa..69992e8808 100644--- a/apps/docsite/src/app/(site)/_landing/ThemingShowcase.tsx+++ b/apps/docsite/src/app/(site)/_landing/ThemingShowcase.tsx@@ -5,6 +5,7 @@import * as stylex from '@stylexjs/stylex';import {XDSText, XDSHeading} from '@xds/core/Text';import {XDSLink} from '@xds/core/Link';+import {XDSDivider} from '@xds/core/Divider';import {XDSHStack, XDSVStack} from '@xds/core/Stack';import {XDSGrid} from '@xds/core/Grid';import {XDSCard} from '@xds/core/Card';@@ -20,25 +21,14 @@ import {XDSStatusDot} from '@xds/core/StatusDot';import {XDSIcon} from '@xds/core/Icon';import {XDSTheme} from '@xds/core/theme';import {neutralTheme} from '@xds/theme-neutral/built';-import {spacingVars} from '@xds/core/theme/tokens.stylex';const noop = () => {};const styles = stylex.create({- section: {- width: '100%',- paddingBlock: spacingVars['--spacing-12'],- paddingInline: spacingVars['--spacing-6'],- backgroundColor: 'var(--color-background-surface)',- display: 'flex',- flexDirection: 'column',- alignItems: 'center',- gap: spacingVars['--spacing-10'],- },headingBlock: {- textAlign: 'center',width: '100%',maxWidth: 680,+ textAlign: 'center',},fillWidth: {width: '100%',@@ -50,6 +40,9 @@ const styles = stylex.create({subTile: {width: '100%',},+ captionDivider: {+ height: '1.125em',+ },swatchRow: {flexWrap: 'wrap',},@@ -60,13 +53,6 @@ const styles = stylex.create({boxShadow: 'inset 0 0 0 1px rgba(0,0,0,0.06)',flexShrink: 0,},- swatchSm: {- width: 32,- height: 32,- borderRadius: '50%',- boxShadow: 'inset 0 0 0 1px rgba(0,0,0,0.06)',- flexShrink: 0,- },paletteCol: {alignItems: 'center',minWidth: 48,@@ -135,12 +121,6 @@ const styles = stylex.create({lineHeight: 1,color: 'var(--color-text-primary)',},- dotsWrap: {- display: 'flex',- gap: 8,- alignItems: 'center',- justifyContent: 'center',- },});// =============================================================================@@ -149,31 +129,29 @@ const styles = stylex.create({function ShowcaseHeading() {return (- <XDSVStack- gap={1}- align="center"- xstyle={styles.headingBlock}- style={{textAlign: 'center'}}>+ <XDSVStack gap={4} align="center" xstyle={styles.headingBlock}><XDSHeadinglevel={2}type="display-2"color="primary"xstyle={styles.fillWidth}>- Every app deserves to look like itself+ Custom styles as unique as your app</XDSHeading>- <XDSVStack gap={1} align="center" xstyle={styles.fillWidth}>- <XDSText type="body" color="secondary" xstyle={styles.fillWidth}>- Astryx makes it effortless. Customize color, typography, radius, and- motion at the token level- <br />— your brand, no rewrites needed.+ <XDSVStack gap={4} align="center" xstyle={styles.fillWidth}>+ <XDSText+ display="block"+ type="body"+ color="secondary"+ style={{maxWidth: 560}}>+ Astryx makes it effortless to apply your brand — no rewrites needed.+ Customize your theme at the token level: color, typography, radius,+ and motion.</XDSText>- <XDSHStack gap={2} align="center">+ <XDSHStack gap={4} align="center"><XDSLink type="body" href="/themes" hasUnderline>Explore all themes</XDSLink>- <XDSText type="body" color="secondary" aria-hidden="true">- ·- </XDSText>+ <XDSDivider orientation="vertical" xstyle={styles.captionDivider} /><XDSLink type="body" href="/docs/theme" hasUnderline>Create a custom theme</XDSLink>@@ -528,7 +506,11 @@ function ShowcaseDots() {export function ThemingShowcase() {return (- <section {...stylex.props(styles.section)} data-theming-showcase="true">+ <XDSVStack+ as="section"+ gap={10}+ align="center"+ data-theming-showcase="true"><ShowcaseHeading /><XDSTheme theme={neutralTheme} mode="light">@@ -560,6 +542,6 @@ export function ThemingShowcase() {<ShowcaseDots /></XDSVStack></XDSTheme>- </section>+ </XDSVStack>);}diff --git a/apps/docsite/src/app/(site)/page.tsx b/apps/docsite/src/app/(site)/page.tsxindex e00950d825..92d797de90 100644--- a/apps/docsite/src/app/(site)/page.tsx+++ b/apps/docsite/src/app/(site)/page.tsx@@ -6,10 +6,10 @@ import {useEffect, useRef} from 'react';import * as stylex from '@stylexjs/stylex';import {XDSText, XDSHeading} from '@xds/core/Text';import {XDSLink} from '@xds/core/Link';-import {XDSVStack} from '@xds/core/Layout';+import {XDSDivider} from '@xds/core/Divider';+import {XDSHStack, XDSVStack} from '@xds/core/Layout';import {XDSGrid} from '@xds/core/Grid';import {XDSButton} from '@xds/core/Button';-import {XDSMediaTheme} from '@xds/core/theme';import {spacingVars} from '@xds/core/theme/tokens.stylex';import {ThemingShowcase} from './_landing/ThemingShowcase';import {FeaturesShowcase} from './_landing/FeaturesShowcase';@@ -24,47 +24,36 @@ const styles = stylex.create({// bleeding underneath the footer at the bottom of the page.heroScope: {position: 'relative',+ backgroundColor: 'var(--color-background-body)',},- hero: {+ heroContent: {position: 'sticky',top: 'var(--appshell-header-height, 0px)',- backgroundColor: 'var(--color-background-body)',- display: 'flex',- flexDirection: 'column',- alignItems: 'center',- justifyContent: 'center',- textAlign: 'center',- // 96px vertical (beyond --spacing-12, expressed as 2x). Horizontal gutter- // matches the showcase sections below (--spacing-6 = 24px) for consistency.+ maxWidth: 680,+ marginInline: 'auto',paddingBlock: `calc(${spacingVars['--spacing-12']} * 2)`,paddingInline: spacingVars['--spacing-6'],+ textAlign: 'center',+ gap: spacingVars['--spacing-12'],},- showcaseOverlay: {- position: 'relative',- borderTopLeftRadius: 'var(--radius-page)',- borderTopRightRadius: 'var(--radius-page)',- overflow: 'hidden',- backgroundColor: 'var(--color-background-surface)',- // Pulls the rounded overlay up so it visually lifts onto the hero.- marginTop: `calc(${spacingVars['--spacing-8']} * -1)`,- },- wordmark: {+ heroWordmark: {display: 'block',height: 42,width: 'auto',- marginBottom: spacingVars['--spacing-4'],- },- headline: {- maxWidth: 680,- },- caption: {- marginTop: spacingVars['--spacing-2'],- maxWidth: 560,},- buttons: {- marginTop: spacingVars['--spacing-8'],+ heroButtons: {width: '100%',- maxWidth: 360,+ maxWidth: 420,+ },+ showcaseOverlay: {+ position: 'relative',+ overflow: 'hidden',+ borderTopLeftRadius: 'var(--radius-page)',+ borderTopRightRadius: 'var(--radius-page)',+ backgroundColor: 'var(--color-background-surface)',+ paddingBlock: spacingVars['--spacing-12'],+ paddingInline: spacingVars['--spacing-6'],+ gap: `calc(${spacingVars['--spacing-12']} * 2)`,},});@@ -111,29 +100,47 @@ export default function HomePage() {return (<div {...stylex.props(styles.heroScope)}>- <div {...stylex.props(styles.hero)} data-home-page="true">- <XDSMediaTheme mode="light">- <XDSVStack gap={2} style={{alignItems: 'center'}}>- <img- src="/astryx-logo.svg"- alt="Astryx"- {...stylex.props(styles.wordmark)}+ <XDSVStack+ data-home-page="true"+ align="stretch"+ xstyle={styles.heroContent}>+ <img+ src="/astryx-logo.svg"+ alt="Astryx"+ {...stylex.props(styles.heroWordmark)}+ />+ <XDSHeading level={1} type="display-1" color="primary">+ Fully customizable, no-forking, open source design system+ </XDSHeading>+ <XDSVStack gap={6} align="center">+ <XDSGrid columns={2} gap={3} xstyle={styles.heroButtons}>+ <XDSButton+ variant="primary"+ size="lg"+ label="Get started"+ href="/docs/getting-started"+ />+ <XDSButton+ variant="secondary"+ size="lg"+ label="Browse components"+ href="/components"+ />+ </XDSGrid>+ <XDSHStack gap={4} align="center" hAlign="center">+ <XDSText display="block">+ Currently in{' '}+ <XDSText as="span" weight="bold">+ Beta+ </XDSText>+ </XDSText>+ <XDSDivider+ orientation="vertical"+ variant="strong"+ style={{height: '1em'}}/>- <XDSHeading- level={1}- type="display-1"- color="primary"- xstyle={styles.headline}>- An open source design system- <br />- built for collaboration, made for teams, crafted with care- </XDSHeading>- <XDSText- type="body"- size="base"- color="primary"- xstyle={styles.caption}>- Currently in <strong>Beta</strong>, built on{' '}+ <XDSText display="block">+ Built on{' '}<XDSLinktype="body"color="primary"@@ -154,31 +161,15 @@ export default function HomePage() {StyleX</XDSLink></XDSText>- <XDSGrid columns={2} gap={3} xstyle={styles.buttons}>- <XDSButton- variant="primary"- size="lg"- label="Get started"- href="/docs/getting-started"- />- <XDSButton- variant="secondary"- size="lg"- label="Browse components"- href="/components"- />- </XDSGrid>- </XDSVStack>- </XDSMediaTheme>- </div>- <div ref={showcaseRef} {...stylex.props(styles.showcaseOverlay)}>- <XDSMediaTheme mode="light">- <ThemingShowcase />- <FeaturesShowcase />- <AboutShowcase />- <DiscoverShowcase />- </XDSMediaTheme>- </div>+ </XDSHStack>+ </XDSVStack>+ </XDSVStack>+ <XDSVStack ref={showcaseRef} xstyle={styles.showcaseOverlay}>+ <ThemingShowcase />+ <FeaturesShowcase />+ <AboutShowcase />+ <DiscoverShowcase />+ </XDSVStack></div>);}