Skip to content

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

TypeScript

feat(docsite): Astryx brand redesign — new theme, home page, footer, and chrome (#2372)

rubyycheungeabdbbbab61c
diff --git a/apps/docsite/.gitignore b/apps/docsite/.gitignore
index 8e00477c79..d4595b7de3 100644
--- a/apps/docsite/.gitignore
+++ b/apps/docsite/.gitignore
@@ -6,3 +6,10 @@ src/generated/
# Auto-generated by scripts/generate-playground-types.mjs
public/playground-types.json
+
+# Auto-generated by `xds theme build` (pnpm build:theme). The theme source
+# lives at src/themes/astryxTheme.ts; the built JS/CSS/d.ts files are
+# regenerated locally and in CI before next dev / next build.
+src/themes/astryx.js
+src/themes/astryx.css
+src/themes/astryx.d.ts
diff --git a/apps/docsite/package.json b/apps/docsite/package.json
index 44c7f01b4e..f3e65b2d42 100644
--- a/apps/docsite/package.json
+++ b/apps/docsite/package.json
@@ -3,7 +3,8 @@
"version": "0.0.1",
"private": true,
"scripts": {
- "generate": "node scripts/generate-data.mjs && node scripts/generate-playground-types.mjs",
+ "build:theme": "xds theme build src/themes/astryxTheme.ts --out src/themes/astryx.css",
+ "generate": "pnpm build:theme && node scripts/generate-data.mjs && node scripts/generate-playground-types.mjs",
"dev": "pnpm generate && next dev",
"build": "pnpm generate && next build",
"start": "next start",
diff --git a/apps/docsite/public/astryx-logo.svg b/apps/docsite/public/astryx-logo.svg
new file mode 100644
index 0000000000..5bb848b313
--- /dev/null
+++ b/apps/docsite/public/astryx-logo.svg
@@ -0,0 +1,8 @@
+<svg width="217" height="33" viewBox="0 0 217 33" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M49.1872 31.0024C46.0231 30.1429 43.0415 28.8536 40.248 27.1345C40.06 27.0163 40.0117 26.7638 40.1406 26.5865L45.6846 19.0387C45.8028 18.8776 46.0284 18.84 46.195 18.9528C47.8872 20.1078 49.9017 21.021 52.244 21.6872C54.7205 22.3909 56.8532 22.7455 58.6475 22.7455C60.4418 22.7455 61.6827 22.5091 62.6175 22.031C63.5522 21.5529 64.0196 20.9351 64.0196 20.1722C64.0196 19.5652 63.7886 19.0871 63.332 18.7433C62.8753 18.3994 62.2468 18.2275 61.4464 18.2275C60.9521 18.2275 60.3881 18.249 59.7595 18.2866C59.131 18.3242 58.626 18.3618 58.2446 18.3994C56.2623 18.6251 54.2263 18.7433 52.1311 18.7433C48.7413 18.7433 45.9855 18.104 43.8742 16.8308C41.7576 15.5522 40.7047 13.4679 40.7047 10.5723C40.7047 7.22011 42.2841 4.62001 45.4482 2.77201C48.6124 0.924003 53.2593 0 59.3942 0C62.4026 0 65.4432 0.429768 68.5107 1.28393C71.4224 2.09512 74.0117 3.29847 76.2895 4.88324C76.4829 5.01754 76.5044 5.29689 76.3378 5.46343L70.2781 11.5769C70.1599 11.6951 69.9826 11.7219 69.8376 11.6413C67.7586 10.5669 65.8139 9.79871 63.9981 9.34208C62.1125 8.86397 60.2161 8.62759 58.3091 8.62759C56.9768 8.62759 55.8325 8.8962 54.8817 9.42804C53.9308 9.96525 53.4527 10.5723 53.4527 11.2599C53.4527 11.7918 53.6514 12.2108 54.0543 12.517C54.4519 12.8232 54.9784 12.9736 55.6284 12.9736C56.2784 12.9736 57.1702 12.9145 58.3144 12.8017C61.0972 12.6137 63.1708 12.517 64.5461 12.517C68.5107 12.517 71.5781 13.1831 73.7485 14.5154C75.9188 15.8477 77.004 17.8891 77.004 20.6289C77.004 24.7439 75.4031 27.7254 72.2013 29.5734C68.9995 31.4214 64.5783 32.3454 58.943 32.3454C55.7412 32.3454 52.4964 31.8995 49.198 31.0024H49.1872Z" fill="#225BFF" style="fill:#225BFF;fill:color(display-p3 0.1333 0.3569 1.0000);fill-opacity:1;"/>
+<path d="M38.5609 25.8618C38.3138 25.6899 38.1258 25.4857 37.9969 25.2547C37.6907 24.7175 37.5349 23.7935 37.5349 22.4881V15.6279C37.5349 10.3257 37.1158 4.70107 34.2579 2.14395C34.1182 2.0204 33.9785 1.90221 33.8335 1.78402C32.1628 0.435626 29.9871 -0.155307 27.9618 0.295949C26.7047 0.586043 25.6357 1.37574 25.0394 1.89683C23.8468 3.01423 22.3157 4.68496 21.2252 4.60975C20.0003 4.52379 19.0226 3.444 18.6627 2.26751C18.6627 2.26214 18.6627 2.2514 18.6573 2.24602C18.2651 0.945976 17.1316 0.00585938 15.7725 0.00585938H2.97614C1.33228 0.00585938 0 1.33814 0 2.982V7.17761C0 8.82147 1.33228 10.1538 2.97614 10.1538H21.2735C22.3103 10.1538 23.1162 10.3203 23.6963 10.6426C24.2712 10.9703 24.5612 11.3625 24.5612 11.8245C24.5612 12.3617 24.2712 12.8022 23.6963 13.1514C23.1215 13.4952 22.1223 13.6725 20.6987 13.6725C17.2391 13.6725 14.3543 13.8068 12.0496 14.0754L10.1479 14.3655C6.68827 14.9027 4.13115 15.8858 2.48191 17.304C0.827303 18.7276 0 20.6884 0 23.1865C0 26.2217 0.972349 28.5102 2.91168 30.0467C4.85101 31.5831 7.74657 32.3513 11.5876 32.3513C14.8915 32.3513 17.6151 31.5831 19.7478 30.0467C20.371 29.5954 20.9458 29.0689 21.483 28.4834V28.4995C21.483 28.4995 24.0294 25.3675 25.3295 28.4995V28.4887C25.5712 29.085 25.872 29.633 26.232 30.1326C27.3064 31.6153 29.4982 32.3513 32.8074 32.3513C34.3062 32.3513 35.5096 32.3137 36.4121 32.2385C36.6216 32.2224 36.8419 32.2009 37.0675 32.174C38.5287 32.0182 39.6515 30.8095 39.7159 29.3375L39.7536 28.5102C39.7965 27.4895 39.3936 26.4581 38.5609 25.8672V25.8618ZM24.6203 18.8028C23.8092 20.4682 22.3372 21.8058 20.1991 22.8319C18.061 23.8526 15.6597 24.363 13.0005 24.363C10.5293 24.363 9.29374 23.6753 9.29374 22.2947C9.29374 21.0108 10.6206 20.1083 13.2852 19.5872L15.8531 19.1574C17.8031 18.8727 19.4631 18.5772 20.8438 18.2656C22.219 17.9594 23.4815 17.5189 24.6203 16.9495V18.8028Z" fill="#225BFF" style="fill:#225BFF;fill:color(display-p3 0.1333 0.3569 1.0000);fill-opacity:1;"/>
+<path d="M177.884 0H169.315C167.349 0 165.754 0.854163 165.754 1.91247V12.474C165.754 13.1187 164.776 13.6451 163.573 13.6451C162.369 13.6451 161.392 13.1187 161.392 12.474V1.91247C161.392 0.859535 159.796 0 157.83 0H149.261C147.295 0 145.7 0.854163 145.7 1.91247V9.41193C145.7 13.7794 151.142 17.4593 158.582 18.6197H158.571C159.452 18.7057 159.237 19.5491 159.237 19.5491L156.97 30.0515C156.675 31.2173 157.556 32.3508 158.759 32.3508H168.375C169.579 32.3508 170.46 31.2173 170.164 30.0515L167.897 19.5491C167.897 19.5491 167.682 18.7057 168.563 18.6251H168.558C175.998 17.4647 181.44 13.7794 181.44 9.41193V1.91247C181.44 0.859535 179.845 0 177.879 0H177.884Z" fill="#225BFF" style="fill:#225BFF;fill:color(display-p3 0.1333 0.3569 1.0000);fill-opacity:1;"/>
+<path d="M144.797 31.6047L144.4 31.4166C144.324 31.379 144.265 31.3253 144.228 31.2555L137.958 20.0117C145.716 17.1913 144.163 10.1431 144.163 10.1431C142.826 -0.0800041 127.88 0.0596691 127.88 0.0596691H115.39C114.96 0.0596691 114.848 0.655977 115.245 0.811768L115.933 1.08574C116.083 1.14484 116.18 1.28988 116.18 1.45104V31.148C116.18 31.3199 116.072 31.465 115.911 31.5187L115.707 31.5832C115.283 31.7228 115.385 32.346 115.825 32.346H126.5C126.951 32.346 127.042 31.7014 126.607 31.5778C126.441 31.5294 126.328 31.3844 126.322 31.2125L126.048 20.0815C126.967 20.5757 128.869 20.8551 128.869 20.8551L133.908 30.4443C133.994 30.6054 133.956 30.8096 133.811 30.9278L132.941 31.653C132.662 31.8894 132.828 32.346 133.193 32.346H144.636C145.05 32.346 145.179 31.7819 144.802 31.6047H144.797ZM126.913 18.024V2.18165C126.913 2.18165 132.624 1.37584 133.757 10.7072C133.757 10.7072 135.036 20.9518 126.913 18.024Z" fill="#225BFF" style="fill:#225BFF;fill:color(display-p3 0.1333 0.3569 1.0000);fill-opacity:1;"/>
+<path d="M79 0.262695V9.80568H86.0628C88.2323 9.80568 89.9956 11.6463 89.9956 13.922V32.2627H102.004V13.922C102.004 11.6513 103.763 9.80568 105.937 9.80568H113V0.262695H79Z" fill="#225BFF" style="fill:#225BFF;fill:color(display-p3 0.1333 0.3569 1.0000);fill-opacity:1;"/>
+<path d="M211.409 15.351C214.496 15.351 217 12.8469 217 9.76046V3.72734C217 1.78812 215.428 0.209961 213.483 0.209961H207.449C204.363 0.209961 201.859 2.71406 201.859 5.8005V7.07584C201.638 7.97265 200.362 7.97265 200.141 7.07584V5.8005C200.141 2.71406 197.637 0.209961 194.55 0.209961H188.517C186.572 0.209961 185 1.7823 185 3.72734V9.76046C185 12.8469 187.504 15.351 190.591 15.351H191.866C192.763 15.5723 192.763 16.8476 191.866 17.0689H190.591C187.504 17.0689 185 19.573 185 22.6595V28.6926C185 30.6318 186.572 32.21 188.517 32.21H194.55C197.637 32.21 200.141 29.7059 200.141 26.6194V25.3441C200.362 24.4473 201.638 24.4473 201.859 25.3441V26.6194C201.859 29.7059 204.363 32.21 207.449 32.21H213.483C215.422 32.21 217 30.6376 217 28.6926V22.6595C217 19.573 214.496 17.0689 211.409 17.0689H208.142V15.351H211.409Z" fill="#225BFF" style="fill:#225BFF;fill:color(display-p3 0.1333 0.3569 1.0000);fill-opacity:1;"/>
+</svg>
diff --git a/apps/docsite/public/brand-icon.svg b/apps/docsite/public/brand-icon.svg
new file mode 100644
index 0000000000..83409b95ed
--- /dev/null
+++ b/apps/docsite/public/brand-icon.svg
@@ -0,0 +1,3 @@
+<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M26.4095 15.141C29.4959 15.141 32 12.6369 32 9.5505V3.51738C32 1.57816 30.4277 0 28.4826 0H22.4495C19.3631 0 16.859 2.50409 16.859 5.59054V6.86588C16.6377 7.76269 15.3623 7.76269 15.141 6.86588V5.59054C15.141 2.50409 12.6369 0 9.5505 0H3.51738C1.57234 0 0 1.57234 0 3.51738V9.5505C0 12.6369 2.50409 15.141 5.59054 15.141H6.86588C7.76269 15.3623 7.76269 16.6377 6.86588 16.859H5.59054C2.50409 16.859 0 19.3631 0 22.4495V28.4826C0 30.4218 1.57234 32 3.51738 32H9.5505C12.6369 32 15.141 29.4959 15.141 26.4095V25.1341C15.3623 24.2373 16.6377 24.2373 16.859 25.1341V26.4095C16.859 29.4959 19.3631 32 22.4495 32H28.4826C30.4218 32 32 30.4277 32 28.4826V22.4495C32 19.3631 29.4959 16.859 26.4095 16.859H23.1425V15.141H26.4095Z" fill="#225BFF" style="fill:#225BFF;fill:color(display-p3 0.1333 0.3569 1.0000);fill-opacity:1;"/>
+</svg>
diff --git a/apps/docsite/public/discover-card-1.png b/apps/docsite/public/discover-card-1.png
new file mode 100644
index 0000000000..cf6b630b91
Binary files /dev/null and b/apps/docsite/public/discover-card-1.png differ
diff --git a/apps/docsite/public/discover-card-2.png b/apps/docsite/public/discover-card-2.png
new file mode 100644
index 0000000000..649bcb351a
Binary files /dev/null and b/apps/docsite/public/discover-card-2.png differ
diff --git a/apps/docsite/public/discover-card-3.png b/apps/docsite/public/discover-card-3.png
new file mode 100644
index 0000000000..24fc04fd2e
Binary files /dev/null and b/apps/docsite/public/discover-card-3.png differ
diff --git a/apps/docsite/public/discover-card-4.png b/apps/docsite/public/discover-card-4.png
new file mode 100644
index 0000000000..e1a08f5a47
Binary files /dev/null and b/apps/docsite/public/discover-card-4.png differ
diff --git a/apps/docsite/public/favicon.svg b/apps/docsite/public/favicon.svg
new file mode 100644
index 0000000000..83409b95ed
--- /dev/null
+++ b/apps/docsite/public/favicon.svg
@@ -0,0 +1,3 @@
+<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M26.4095 15.141C29.4959 15.141 32 12.6369 32 9.5505V3.51738C32 1.57816 30.4277 0 28.4826 0H22.4495C19.3631 0 16.859 2.50409 16.859 5.59054V6.86588C16.6377 7.76269 15.3623 7.76269 15.141 6.86588V5.59054C15.141 2.50409 12.6369 0 9.5505 0H3.51738C1.57234 0 0 1.57234 0 3.51738V9.5505C0 12.6369 2.50409 15.141 5.59054 15.141H6.86588C7.76269 15.3623 7.76269 16.6377 6.86588 16.859H5.59054C2.50409 16.859 0 19.3631 0 22.4495V28.4826C0 30.4218 1.57234 32 3.51738 32H9.5505C12.6369 32 15.141 29.4959 15.141 26.4095V25.1341C15.3623 24.2373 16.6377 24.2373 16.859 25.1341V26.4095C16.859 29.4959 19.3631 32 22.4495 32H28.4826C30.4218 32 32 30.4277 32 28.4826V22.4495C32 19.3631 29.4959 16.859 26.4095 16.859H23.1425V15.141H26.4095Z" fill="#225BFF" style="fill:#225BFF;fill:color(display-p3 0.1333 0.3569 1.0000);fill-opacity:1;"/>
+</svg>
diff --git a/apps/docsite/src/app/(site)/_landing/AboutShowcase.tsx b/apps/docsite/src/app/(site)/_landing/AboutShowcase.tsx
new file mode 100644
index 0000000000..2030f0bd92
--- /dev/null
+++ b/apps/docsite/src/app/(site)/_landing/AboutShowcase.tsx
@@ -0,0 +1,201 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+
+'use client';
+
+import type {ReactNode} from 'react';
+import * as stylex from '@stylexjs/stylex';
+import {XDSVStack} from '@xds/core/Layout';
+import {XDSHeading, XDSText} from '@xds/core/Text';
+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: {
+ width: '100%',
+ maxWidth: 1200,
+ },
+ iconSlot: {
+ height: 48,
+ marginBottom: spacingVars['--spacing-4'],
+ },
+});
+
+type AboutItem = {
+ title: string;
+ description: string;
+ icon: ReactNode;
+};
+
+function BlobIcon() {
+ return (
+ <svg
+ width={40}
+ height={40}
+ viewBox="0 0 40 40"
+ fill="none"
+ aria-hidden="true">
+ <path
+ fill="var(--color-background-orange)"
+ d="M17.081 1.19166C18.7027 -0.397219 21.2973 -0.397219 22.919 1.19166C23.9616 2.21324 25.4625 2.61539 26.8763 2.25201C29.0751 1.68683 31.3221 2.98415 31.9321 5.17099C32.3243 6.57703 33.423 7.67574 34.829 8.06792C37.0159 8.67788 38.3132 10.9249 37.748 13.1237C37.3846 14.5375 37.7868 16.0384 38.8083 17.081C40.3972 18.7027 40.3972 21.2973 38.8083 22.919C37.7868 23.9616 37.3846 25.4625 37.748 26.8763C38.3132 29.0751 37.0159 31.3221 34.829 31.9321C33.423 32.3243 32.3243 33.423 31.9321 34.829C31.3221 37.0159 29.0751 38.3132 26.8763 37.748C25.4625 37.3846 23.9616 37.7868 22.919 38.8083C21.2973 40.3972 18.7027 40.3972 17.081 38.8083C16.0384 37.7868 14.5375 37.3846 13.1237 37.748C10.9249 38.3132 8.67788 37.0159 8.06792 34.829C7.67574 33.423 6.57703 32.3243 5.17099 31.9321C2.98415 31.3221 1.68683 29.0751 2.25201 26.8763C2.61539 25.4625 2.21324 23.9616 1.19166 22.919C-0.397219 21.2973 -0.397219 18.7027 1.19166 17.081C2.21324 16.0384 2.61539 14.5375 2.25201 13.1237C1.68683 10.9249 2.98415 8.67788 5.17099 8.06792C6.57703 7.67574 7.67574 6.57703 8.06792 5.17099C8.67788 2.98415 10.9249 1.68683 13.1237 2.25201C14.5375 2.61539 16.0384 2.21324 17.081 1.19166Z"
+ />
+ </svg>
+ );
+}
+
+function SquareIcon() {
+ return (
+ <svg
+ width={40}
+ height={40}
+ viewBox="0 0 40 40"
+ fill="none"
+ aria-hidden="true">
+ <path
+ fill="var(--color-background-purple)"
+ d="M33.0469 0C36.8869 0.00014921 39.9999 3.11308 40 6.95312C40 9.9458 38.109 12.4963 35.457 13.4766C38.109 14.4568 39.9999 17.0074 40 20C40 22.9927 38.109 25.5431 35.457 26.5234C38.109 27.5037 39.9999 30.0542 40 33.0469C40 36.887 36.887 39.9998 33.0469 40H6.95312C3.113 39.9999 0 36.887 0 33.0469C9.21712e-05 30.0545 1.89042 27.5039 4.54199 26.5234C1.89043 25.5429 0 22.9924 0 20C9.21712e-05 17.0077 1.89042 14.457 4.54199 13.4766C1.89043 12.496 0 9.94549 0 6.95312C0.000107288 3.11307 3.11307 0.000125546 6.95312 0H33.0469Z"
+ />
+ </svg>
+ );
+}
+
+function DiamondIcon() {
+ return (
+ <svg width={40} height={40} viewBox="0 0 40 40" aria-hidden="true">
+ <rect
+ x={6}
+ y={6}
+ width={28}
+ height={28}
+ rx={6}
+ fill="var(--color-background-yellow)"
+ transform="rotate(45 20 20)"
+ />
+ </svg>
+ );
+}
+
+const items: AboutItem[] = [
+ {
+ title: 'Built by the people who use it',
+ description:
+ 'The system gets sharper when more people can see it, use it, and shape it.',
+ icon: <BlobIcon />,
+ },
+ {
+ title: 'The bar keeps moving',
+ description:
+ "The quality bar isn't fixed – it's accelerating. AI is rewriting how we design, build, and review code, and Astryx is built to evolve with it. Opinionated foundations, flexible patterns, and a system that keeps pace with where craft is going next.",
+ 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.',
+ icon: <DiamondIcon />,
+ },
+];
+
+function AboutHeading() {
+ return (
+ <XDSVStack
+ gap={2}
+ align="center"
+ xstyle={styles.headingBlock}
+ style={{textAlign: 'center'}}>
+ <XDSBadge variant="orange" label="About us" />
+ <XDSHeading
+ level={2}
+ type="display-2"
+ color="primary"
+ xstyle={styles.fillWidth}>
+ Astryx powers over 13,000 apps
+ </XDSHeading>
+ <XDSText type="body" color="secondary" xstyle={styles.subhead}>
+ Astryx has grown inside Meta over the last eight years, shaped by the
+ engineers, designers, and product teams who depend on it every day.
+ </XDSText>
+ </XDSVStack>
+ );
+}
+
+function AboutColumn({item, isFirst}: {item: AboutItem; isFirst: boolean}) {
+ 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>
+ <XDSText type="body" color="secondary">
+ {item.description}
+ </XDSText>
+ </XDSVStack>
+ </div>
+ );
+}
+
+export function AboutShowcase() {
+ return (
+ <section {...stylex.props(styles.section)}>
+ <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>
+ );
+}
diff --git a/apps/docsite/src/app/(site)/_landing/DiscoverShowcase.tsx b/apps/docsite/src/app/(site)/_landing/DiscoverShowcase.tsx
new file mode 100644
index 0000000000..b84c01b9aa
--- /dev/null
+++ b/apps/docsite/src/app/(site)/_landing/DiscoverShowcase.tsx
@@ -0,0 +1,247 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+
+'use client';
+
+import {useEffect, useRef, useState} from 'react';
+import * as stylex from '@stylexjs/stylex';
+import {XDSVStack} from '@xds/core/Layout';
+import {XDSGrid} from '@xds/core/Grid';
+import {XDSCard} from '@xds/core/Card';
+import {XDSHeading, XDSText} from '@xds/core/Text';
+import {XDSButton} from '@xds/core/Button';
+import {spacingVars} from '@xds/core/theme/tokens.stylex';
+import {components} from '../../../generated/componentRegistry';
+
+// Count of public @xds/core components (excluding hooks and hidden entries),
+// rounded down to the nearest 10 for marketing copy. Sourced from the
+// generated registry so the number stays accurate as the library grows.
+const CORE_COMPONENT_COUNT_ROUNDED =
+ Math.floor(
+ (components['@xds/core'] ?? []).filter(
+ c => !c.hidden && !c.name.startsWith('use'),
+ ).length / 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'],
+ overflowX: 'clip',
+ },
+ stage: {
+ position: 'relative',
+ width: '100%',
+ maxWidth: 1200,
+ overflow: 'hidden',
+ borderRadius: 'var(--radius-container)',
+ },
+ card: {
+ position: 'relative',
+ width: '100%',
+ zIndex: 1,
+ // 96px / 80px — beyond --spacing-12 (48px), so expressed as 2x token values.
+ paddingBlock: `calc(${spacingVars['--spacing-12']} * 2)`,
+ paddingInline: `calc(${spacingVars['--spacing-10']} * 2)`,
+ },
+ // Each floating image is positioned absolutely against the stage,
+ // anchored to one of the four card corners (slightly outside them).
+ // The transform is animated from a centered "clumped" pose to the
+ // resting pose with rotation when the section scrolls into view.
+ floatingImage: {
+ position: 'absolute',
+ width: 260,
+ height: 'auto',
+ borderRadius: 'var(--radius-container)',
+ boxShadow: 'var(--shadow-high)',
+ pointerEvents: 'none',
+ transitionProperty: 'transform, top, left, right, bottom',
+ transitionDuration: 'var(--duration-slow-max)',
+ transitionTimingFunction: 'var(--ease-standard)',
+ zIndex: 2,
+ display: {
+ default: 'none',
+ '@media (min-width: 960px)': 'block',
+ },
+ },
+ // Starting "clumped" pose — all four images near the center of the card
+ // but with slight offsets and rotations so they fan out as an overlapping
+ // rosette (rather than perfectly stacked) before the spread animation.
+ floatTopLeftStart: {
+ top: '50%',
+ left: '50%',
+ transform: 'translate(calc(-50% - 80px), calc(-50% - 24px)) rotate(-8deg)',
+ },
+ floatTopRightStart: {
+ top: '50%',
+ left: '50%',
+ transform: 'translate(calc(-50% + 80px), calc(-50% - 32px)) rotate(6deg)',
+ },
+ floatBottomLeftStart: {
+ top: '50%',
+ left: '50%',
+ transform: 'translate(calc(-50% - 60px), calc(-50% + 40px)) rotate(7deg)',
+ },
+ floatBottomRightStart: {
+ top: '50%',
+ left: '50%',
+ transform: 'translate(calc(-50% + 60px), calc(-50% + 32px)) rotate(-5deg)',
+ },
+ // Resting "spread" poses — each image hugs a corner of the card with
+ // a slight offset outward so it overlaps just a little.
+ floatTopLeftEnd: {
+ top: -64,
+ left: -64,
+ transform: 'rotate(-7deg)',
+ },
+ floatTopRightEnd: {
+ top: -64,
+ right: -64,
+ transform: 'rotate(7deg)',
+ },
+ floatBottomLeftEnd: {
+ bottom: -64,
+ left: -32,
+ transform: 'rotate(6deg)',
+ },
+ floatBottomRightEnd: {
+ bottom: -64,
+ 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',
+ width: 'auto',
+ verticalAlign: '0.06em',
+ marginTop: 8,
+ },
+ buttons: {
+ width: '100%',
+ maxWidth: 360,
+ },
+});
+
+export function DiscoverShowcase() {
+ const stageRef = useRef<HTMLDivElement | null>(null);
+ const [spread, setSpread] = useState(false);
+
+ useEffect(() => {
+ const el = stageRef.current;
+ if (!el) {
+ return;
+ }
+ const observer = new IntersectionObserver(
+ entries => {
+ for (const entry of entries) {
+ if (entry.isIntersecting) {
+ setSpread(true);
+ observer.disconnect();
+ break;
+ }
+ }
+ },
+ {threshold: 0.4},
+ );
+ observer.observe(el);
+ return () => observer.disconnect();
+ }, []);
+
+ return (
+ <section {...stylex.props(styles.section)}>
+ <div ref={stageRef} {...stylex.props(styles.stage)}>
+ <img
+ src="/discover-card-1.png"
+ alt=""
+ aria-hidden="true"
+ {...stylex.props(
+ styles.floatingImage,
+ spread ? styles.floatTopLeftEnd : styles.floatTopLeftStart,
+ )}
+ />
+ <img
+ src="/discover-card-3.png"
+ alt=""
+ aria-hidden="true"
+ {...stylex.props(
+ styles.floatingImage,
+ spread ? styles.floatTopRightEnd : styles.floatTopRightStart,
+ )}
+ />
+ <img
+ src="/discover-card-2.png"
+ alt=""
+ aria-hidden="true"
+ {...stylex.props(
+ styles.floatingImage,
+ spread ? styles.floatBottomLeftEnd : styles.floatBottomLeftStart,
+ )}
+ />
+ <img
+ src="/discover-card-4.png"
+ alt=""
+ aria-hidden="true"
+ {...stylex.props(
+ styles.floatingImage,
+ spread ? styles.floatBottomRightEnd : styles.floatBottomRightStart,
+ )}
+ />
+ <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>
+ <img
+ src="/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}>
+ <XDSButton
+ variant="primary"
+ size="lg"
+ label="Get started"
+ href="/docs/getting-started"
+ />
+ <XDSButton
+ variant="secondary"
+ size="lg"
+ label="Browse components"
+ href="/components"
+ />
+ </XDSGrid>
+ </XDSVStack>
+ </XDSCard>
+ </div>
+ </section>
+ );
+}
diff --git a/apps/docsite/src/app/(site)/_landing/FeaturesShowcase.tsx b/apps/docsite/src/app/(site)/_landing/FeaturesShowcase.tsx
new file mode 100644
index 0000000000..b34be8a0d7
--- /dev/null
+++ b/apps/docsite/src/app/(site)/_landing/FeaturesShowcase.tsx
@@ -0,0 +1,178 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+
+'use client';
+
+import * as stylex from '@stylexjs/stylex';
+import {XDSCard} from '@xds/core/Card';
+import {XDSVStack} from '@xds/core/Layout';
+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).
+// Sourced from the generated registry so the number stays accurate as the
+// library grows.
+const CORE_COMPONENT_COUNT = (components['@xds/core'] ?? []).filter(
+ c => !c.hidden && !c.name.startsWith('use'),
+).length;
+// Round down to the nearest 10 for marketing copy ("Over X components"
+// reads better than "Over 87 components" and avoids the displayed number
+// going stale every time a single component lands.
+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
+ // them through xstyle.
+ gridLayout: {
+ width: '100%',
+ maxWidth: 1200,
+ gridAutoRows: '1fr',
+ },
+ cardTall: {
+ height: '100%',
+ gridRow: {
+ default: 'auto',
+ '@media (min-width: 720px)': 'span 2',
+ },
+ },
+ card: {
+ height: '100%',
+ },
+});
+
+type Feature = {
+ title: string;
+ description: string;
+ href: string;
+};
+
+const features: Feature[] = [
+ {
+ title: 'Measured and tested',
+ description:
+ 'Every API choice is measured against real usage by people and LLMs before it ships.',
+ href: '/docs',
+ },
+ {
+ title: `Over ${CORE_COMPONENT_COUNT_ROUNDED} components`,
+ description:
+ 'Accessible and themeable React components with built-in spacing, dark mode, and StyleX styling.',
+ href: '/components',
+ },
+ {
+ title: 'Themes that fit your brand',
+ description:
+ 'Fully customizable themes ready for use. Make it yours without starting from scratch.',
+ href: '/themes',
+ },
+ {
+ title: 'Ready to ship templates',
+ description:
+ 'Production-ready templates for common pages, just plug in your content.',
+ href: '/templates',
+ },
+ {
+ title: 'Your design system on the command line',
+ description:
+ 'Scaffold projects, browse templates, generate themes, and get agent-ready docs from the command line.',
+ href: '/docs/cli',
+ },
+];
+
+function FeatureCard({feature, isTall}: {feature: Feature; isTall?: boolean}) {
+ return (
+ <XDSCard
+ variant="default"
+ padding={5}
+ xstyle={isTall ? styles.cardTall : styles.card}>
+ <XDSVStack gap={3} align="start">
+ <XDSHeading level={3} color="primary">
+ {feature.title}
+ </XDSHeading>
+ <XDSText type="body" color="secondary">
+ {feature.description}
+ </XDSText>
+ <XDSLink
+ type="body"
+ color="active"
+ href={feature.href}
+ hasUnderline={false}>
+ Explore →
+ </XDSLink>
+ </XDSVStack>
+ </XDSCard>
+ );
+}
+
+function FeaturesHeading() {
+ return (
+ <XDSVStack
+ gap={2}
+ align="center"
+ xstyle={styles.headingBlock}
+ style={{textAlign: 'center'}}>
+ <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>
+ <XDSText type="body" color="secondary" xstyle={styles.fillWidth}>
+ A design system that adapts to your workflow, not the other way around.
+ <br />
+ Built for speed, clarity, and creative freedom.
+ </XDSText>
+ </XDSVStack>
+ );
+}
+
+export function FeaturesShowcase() {
+ return (
+ <section {...stylex.props(styles.section)}>
+ <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>
+ );
+}
diff --git a/apps/docsite/src/app/(site)/_landing/ThemingShowcase.tsx b/apps/docsite/src/app/(site)/_landing/ThemingShowcase.tsx
new file mode 100644
index 0000000000..5dc24f2abb
--- /dev/null
+++ b/apps/docsite/src/app/(site)/_landing/ThemingShowcase.tsx
@@ -0,0 +1,552 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+
+'use client';
+
+import * as stylex from '@stylexjs/stylex';
+import {XDSText, XDSHeading} from '@xds/core/Text';
+import {XDSLink} from '@xds/core/Link';
+import {XDSHStack, XDSVStack} from '@xds/core/Stack';
+import {XDSGrid} from '@xds/core/Grid';
+import {XDSCard} from '@xds/core/Card';
+import {XDSButton} from '@xds/core/Button';
+import {XDSBadge} from '@xds/core/Badge';
+import {XDSProgressBar} from '@xds/core/ProgressBar';
+import {XDSTextInput} from '@xds/core/TextInput';
+import {XDSPagination} from '@xds/core/Pagination';
+import {XDSSwitch} from '@xds/core/Switch';
+import {XDSBanner} from '@xds/core/Banner';
+import {XDSItem} from '@xds/core/Item';
+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,
+ },
+ fillWidth: {
+ width: '100%',
+ },
+ outerCard: {
+ width: '100%',
+ maxWidth: 1200,
+ },
+ subTile: {
+ width: '100%',
+ },
+ swatchRow: {
+ flexWrap: 'wrap',
+ },
+ swatch: {
+ width: 40,
+ height: 40,
+ borderRadius: '50%',
+ 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,
+ },
+ hexLabel: {
+ fontSize: 10,
+ letterSpacing: '0.02em',
+ },
+ swatchPairWrap: {
+ aspectRatio: '1 / 1',
+ borderRadius: 'var(--radius-container)',
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ overflow: 'hidden',
+ },
+ swatchPairInner: {
+ width: '62%',
+ height: '62%',
+ borderRadius: 'var(--radius-element)',
+ },
+ bigAaWrap: {
+ aspectRatio: '1 / 1',
+ borderRadius: 'var(--radius-container)',
+ backgroundColor: 'var(--color-background-muted)',
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ fontSize: 64,
+ lineHeight: 1,
+ fontWeight: 600,
+ color: 'var(--color-text-primary)',
+ },
+ // Both Aa tiles read their font from the active theme's typography
+ // tokens so the sample stays accurate as themes are swapped instead
+ // of hardcoding a specific font name.
+ bigAaHeading: {
+ fontFamily: 'var(--font-family-heading)',
+ },
+ bigAaBody: {
+ fontFamily: 'var(--font-family-body)',
+ },
+ radiusBlock: {
+ width: 44,
+ height: 44,
+ backgroundColor: 'var(--color-text-primary)',
+ },
+ photoCell: {
+ aspectRatio: '4 / 5',
+ borderRadius: 'var(--radius-element)',
+ overflow: 'hidden',
+ backgroundColor: 'var(--color-background-muted)',
+ },
+ photoImg: {
+ width: '100%',
+ height: '100%',
+ objectFit: 'cover',
+ display: 'block',
+ },
+ stoneWord: {
+ fontFamily:
+ 'Fraunces, "PT Serif", Georgia, "Times New Roman", Times, serif',
+ fontWeight: 600,
+ letterSpacing: '0.02em',
+ fontSize: 40,
+ lineHeight: 1,
+ color: 'var(--color-text-primary)',
+ },
+ dotsWrap: {
+ display: 'flex',
+ gap: 8,
+ alignItems: 'center',
+ justifyContent: 'center',
+ },
+});
+
+// =============================================================================
+// Heading
+// =============================================================================
+
+function ShowcaseHeading() {
+ return (
+ <XDSVStack
+ gap={1}
+ align="center"
+ xstyle={styles.headingBlock}
+ style={{textAlign: 'center'}}>
+ <XDSHeading
+ level={2}
+ type="display-2"
+ color="primary"
+ xstyle={styles.fillWidth}>
+ Every app deserves to look like itself
+ </XDSHeading>
+ <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 fork required.
+ </XDSText>
+ </XDSVStack>
+ );
+}
+
+// =============================================================================
+// Column 1
+// =============================================================================
+
+const PALETTE_GRAYS = [
+ '#28282A',
+ '#84848B',
+ '#D8D8DB',
+ '#F5F5F3',
+ '#FFFFFF',
+] as const;
+
+const PALETTE_ACCENTS = [
+ {hex: '#009936', label: '#009936'},
+ {hex: '#FFB600', label: '#FFB600'},
+ {hex: '#FD0000', label: '#FD0000'},
+] as const;
+
+function StoneSampleTile() {
+ return (
+ <XDSCard variant="muted" padding={5}>
+ <XDSVStack gap={4}>
+ <XDSVStack gap={1}>
+ <div {...stylex.props(styles.stoneWord)}>STONE</div>
+ <XDSLink
+ type="supporting"
+ color="secondary"
+ href="/themes"
+ hasUnderline>
+ Try Theme
+ </XDSLink>
+ </XDSVStack>
+
+ <XDSHStack gap={2} wrap="wrap">
+ <XDSButton variant="primary" size="sm" label="Primary" />
+ <XDSButton variant="secondary" size="sm" label="Secondary" />
+ <XDSButton
+ variant="ghost"
+ size="sm"
+ label="Ghost"
+ icon={<XDSIcon icon="wrench" size="sm" />}
+ />
+ </XDSHStack>
+
+ <XDSProgressBar
+ value={75}
+ label="Progress"
+ hasValueLabel
+ variant="accent"
+ />
+
+ <XDSTextInput
+ label="Example"
+ description="Description text"
+ placeholder="Type something..."
+ value=""
+ onChange={noop}
+ />
+
+ <XDSHStack gap={1} wrap="wrap" xstyle={styles.swatchRow}>
+ <XDSBadge variant="info" label="Badge" />
+ <XDSBadge variant="success" label="Badge" />
+ <XDSBadge variant="warning" label="Badge" />
+ <XDSBadge variant="error" label="Badge" />
+ <XDSBadge variant="purple" label="Badge" />
+ </XDSHStack>
+
+ <XDSPagination
+ page={3}
+ onChange={noop}
+ totalPages={10}
+ size="sm"
+ siblingCount={0}
+ />
+ </XDSVStack>
+ </XDSCard>
+ );
+}
+
+function PaletteTile() {
+ return (
+ <XDSCard variant="muted" padding={5}>
+ <XDSVStack gap={4}>
+ <XDSHStack gap={3} justify="between" wrap="wrap">
+ {PALETTE_GRAYS.map(hex => (
+ <XDSVStack
+ key={hex}
+ gap={1}
+ xstyle={styles.paletteCol}
+ align="center">
+ <div
+ {...stylex.props(styles.swatch)}
+ style={{backgroundColor: hex}}
+ />
+ <XDSText
+ type="supporting"
+ color="secondary"
+ xstyle={styles.hexLabel}>
+ {hex}
+ </XDSText>
+ </XDSVStack>
+ ))}
+ </XDSHStack>
+ <XDSHStack gap={3} justify="start" wrap="wrap">
+ {PALETTE_ACCENTS.map(({hex, label}) => (
+ <XDSVStack
+ key={hex}
+ gap={1}
+ xstyle={styles.paletteCol}
+ align="center">
+ <div
+ {...stylex.props(styles.swatch)}
+ style={{backgroundColor: hex}}
+ />
+ <XDSText
+ type="supporting"
+ color="secondary"
+ xstyle={styles.hexLabel}>
+ {label}
+ </XDSText>
+ </XDSVStack>
+ ))}
+ </XDSHStack>
+ </XDSVStack>
+ </XDSCard>
+ );
+}
+
+// =============================================================================
+// Column 2
+// =============================================================================
+
+function SettingsTogglesTile() {
+ return (
+ <XDSCard variant="muted" padding={5}>
+ <XDSVStack gap={3}>
+ <XDSSwitch
+ label="Light mode"
+ value={true}
+ onChange={noop}
+ labelSpacing="spread"
+ />
+ <XDSSwitch
+ label="Animations"
+ value={true}
+ onChange={noop}
+ labelSpacing="spread"
+ />
+ <XDSSwitch
+ label="Compact"
+ value={false}
+ onChange={noop}
+ labelSpacing="spread"
+ />
+ </XDSVStack>
+ </XDSCard>
+ );
+}
+
+function CardActionsTile() {
+ return (
+ <XDSCard variant="muted" padding={5}>
+ <XDSCard variant="default" padding={4}>
+ <XDSVStack gap={3}>
+ <XDSHeading level={4}>Card Title</XDSHeading>
+ <XDSText type="body" color="secondary">
+ A flexible surface for grouping related content and actions.
+ </XDSText>
+ <XDSHStack gap={2}>
+ <XDSButton variant="primary" size="sm" label="Primary" />
+ <XDSButton variant="secondary" size="sm" label="Secondary" />
+ </XDSHStack>
+ </XDSVStack>
+ </XDSCard>
+ </XDSCard>
+ );
+}
+
+function SearchFilterBannersTile() {
+ return (
+ <XDSCard variant="muted" padding={5}>
+ <XDSVStack gap={3}>
+ <XDSTextInput
+ label="Search"
+ isLabelHidden
+ placeholder="Search..."
+ value=""
+ onChange={noop}
+ startIcon={<XDSIcon icon="search" size="sm" />}
+ hasClear
+ />
+
+ <XDSVStack gap={1}>
+ <XDSItem
+ media={<XDSStatusDot variant="accent" label="Status" />}
+ label="Status"
+ description="Filter by status"
+ />
+ <XDSItem
+ media={<XDSStatusDot variant="neutral" label="Type" />}
+ label="Type"
+ description="Filter by type"
+ />
+ </XDSVStack>
+
+ <XDSVStack gap={2}>
+ <XDSBanner status="success" title="Banner Title" />
+ <XDSBanner status="warning" title="Banner Title" />
+ <XDSBanner status="error" title="Banner Title" />
+ </XDSVStack>
+ </XDSVStack>
+ </XDSCard>
+ );
+}
+
+// =============================================================================
+// Column 3
+// =============================================================================
+
+const SWATCH_PAIRS: ReadonlyArray<{bg: string; fg: string}> = [
+ {bg: '#D9E8E2', fg: '#2F5D52'}, // teal-on-mint
+ {bg: '#F4D9C4', fg: '#5A3A28'}, // brown-on-peach
+ {bg: '#EFEAD4', fg: '#5C5A30'}, // olive-on-cream
+ {bg: '#F4C77A', fg: '#7A4B12'}, // mustard-on-orange
+];
+
+function PaletteGridTile() {
+ return (
+ <XDSCard variant="muted" padding={4}>
+ <XDSGrid columns={2} gap={3}>
+ {SWATCH_PAIRS.map(({bg, fg}, i) => (
+ <div
+ key={i}
+ {...stylex.props(styles.swatchPairWrap)}
+ style={{backgroundColor: bg}}>
+ <div
+ {...stylex.props(styles.swatchPairInner)}
+ style={{backgroundColor: fg}}
+ />
+ </div>
+ ))}
+ </XDSGrid>
+ </XDSCard>
+ );
+}
+
+// Sample swatches for the radius row — each one references an XDS radius
+// token so the rendered shapes track the active theme (Astryx overrides
+// the default scale by +4, so what's labelled `--radius-element` here
+// resolves to 12px under Astryx vs 8px under the default theme).
+const RADIUS_SAMPLES: ReadonlyArray<{label: string; radiusVar: string}> = [
+ {label: '--radius-inner', radiusVar: 'var(--radius-inner)'},
+ {label: '--radius-element', radiusVar: 'var(--radius-element)'},
+ {label: '--radius-container', radiusVar: 'var(--radius-container)'},
+ {label: '--radius-page', radiusVar: 'var(--radius-page)'},
+ {label: '--radius-full', radiusVar: 'var(--radius-full)'},
+];
+
+function TypographyRadiusTile() {
+ return (
+ <XDSCard variant="muted" padding={5}>
+ <XDSVStack gap={4}>
+ <XDSGrid columns={2} gap={3}>
+ <XDSVStack gap={2} align="center">
+ <div {...stylex.props(styles.bigAaWrap, styles.bigAaHeading)}>
+ Aa
+ </div>
+ <XDSText type="supporting" color="secondary">
+ --font-family-heading
+ </XDSText>
+ </XDSVStack>
+ <XDSVStack gap={2} align="center">
+ <div {...stylex.props(styles.bigAaWrap, styles.bigAaBody)}>Aa</div>
+ <XDSText type="supporting" color="secondary">
+ --font-family-body
+ </XDSText>
+ </XDSVStack>
+ </XDSGrid>
+
+ <XDSHStack gap={2} justify="between" align="center">
+ {RADIUS_SAMPLES.map(({label, radiusVar}) => (
+ <XDSVStack key={label} gap={1} align="center">
+ <div
+ {...stylex.props(styles.radiusBlock)}
+ style={{borderRadius: radiusVar}}
+ />
+ <XDSText type="supporting" color="secondary">
+ {label}
+ </XDSText>
+ </XDSVStack>
+ ))}
+ </XDSHStack>
+ </XDSVStack>
+ </XDSCard>
+ );
+}
+
+function LifestylePhotoTile() {
+ return (
+ <XDSCard variant="muted" padding={4}>
+ <XDSGrid columns={2} gap={3}>
+ <div {...stylex.props(styles.photoCell)}>
+ {/* Plain <img> to avoid next/image remote host configuration changes. */}
+ <img
+ src="https://images.unsplash.com/photo-1505691938895-1758d7feb511?w=600&q=70"
+ alt="A cream-toned minimal living room"
+ {...stylex.props(styles.photoImg)}
+ loading="lazy"
+ />
+ </div>
+ <div {...stylex.props(styles.photoCell)}>
+ <img
+ src="https://images.unsplash.com/photo-1469474968028-56623f02e42e?w=400&q=70"
+ alt="A potted plant still life"
+ {...stylex.props(styles.photoImg)}
+ loading="lazy"
+ />
+ </div>
+ </XDSGrid>
+ </XDSCard>
+ );
+}
+
+// =============================================================================
+// Pagination dots
+// =============================================================================
+
+function ShowcaseDots() {
+ return (
+ <XDSPagination
+ page={2}
+ onChange={noop}
+ totalPages={4}
+ variant="dots"
+ size="sm"
+ />
+ );
+}
+
+// =============================================================================
+// Showcase root
+// =============================================================================
+
+export function ThemingShowcase() {
+ return (
+ <section {...stylex.props(styles.section)} data-theming-showcase="true">
+ <ShowcaseHeading />
+
+ <XDSTheme theme={neutralTheme} mode="light">
+ <XDSVStack gap={5} align="center" xstyle={styles.outerCard}>
+ <div {...stylex.props(styles.outerCard)}>
+ <XDSGrid columns={{minWidth: 320, repeat: 'fit'}} gap={3}>
+ {/* Column 1 */}
+ <XDSVStack gap={3} xstyle={styles.subTile}>
+ <StoneSampleTile />
+ <PaletteTile />
+ </XDSVStack>
+
+ {/* Column 2 */}
+ <XDSVStack gap={3} xstyle={styles.subTile}>
+ <SettingsTogglesTile />
+ <CardActionsTile />
+ <SearchFilterBannersTile />
+ </XDSVStack>
+
+ {/* Column 3 */}
+ <XDSVStack gap={3} xstyle={styles.subTile}>
+ <PaletteGridTile />
+ <TypographyRadiusTile />
+ <LifestylePhotoTile />
+ </XDSVStack>
+ </XDSGrid>
+ </div>
+
+ <ShowcaseDots />
+ </XDSVStack>
+ </XDSTheme>
+ </section>
+ );
+}
diff --git a/apps/docsite/src/app/(site)/page.tsx b/apps/docsite/src/app/(site)/page.tsx
index 15a20cf13b..e00950d825 100644
--- a/apps/docsite/src/app/(site)/page.tsx
+++ b/apps/docsite/src/app/(site)/page.tsx
@@ -1,56 +1,184 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
+'use client';
+
+import {useEffect, useRef} from 'react';
import * as stylex from '@stylexjs/stylex';
-import {XDSText} from '@xds/core/Text';
+import {XDSText, XDSHeading} from '@xds/core/Text';
+import {XDSLink} from '@xds/core/Link';
import {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';
+import {AboutShowcase} from './_landing/AboutShowcase';
+import {DiscoverShowcase} from './_landing/DiscoverShowcase';
const styles = stylex.create({
+ // Wraps hero + showcase together so the sticky hero (position: sticky)
+ // bounds its sticky range to this container. Without the wrapper, the
+ // hero would stay pinned through the footer (a sibling further down
+ // the AppShell main content), which on mobile shows up as the hero
+ // bleeding underneath the footer at the bottom of the page.
+ heroScope: {
+ position: 'relative',
+ },
hero: {
- minHeight: 'calc(100vh - 64px)',
+ position: 'sticky',
+ top: 'var(--appshell-header-height, 0px)',
+ backgroundColor: 'var(--color-background-body)',
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
textAlign: 'center',
- padding: 48,
+ // 96px vertical (beyond --spacing-12, expressed as 2x). Horizontal gutter
+ // matches the showcase sections below (--spacing-6 = 24px) for consistency.
+ paddingBlock: `calc(${spacingVars['--spacing-12']} * 2)`,
+ paddingInline: spacingVars['--spacing-6'],
+ },
+ 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: {
+ display: 'block',
+ height: 42,
+ width: 'auto',
+ marginBottom: spacingVars['--spacing-4'],
},
- subtitle: {
+ headline: {
+ maxWidth: 680,
+ },
+ caption: {
+ marginTop: spacingVars['--spacing-2'],
maxWidth: 560,
- marginTop: 8,
},
buttons: {
- marginTop: 32,
- display: 'flex',
- gap: 12,
+ marginTop: spacingVars['--spacing-8'],
+ width: '100%',
+ maxWidth: 360,
},
});
export default function HomePage() {
+ const showcaseRef = useRef<HTMLDivElement | null>(null);
+
+ useEffect(() => {
+ const el = showcaseRef.current;
+ if (!el) {
+ return;
+ }
+
+ function readNavHeight() {
+ const raw = getComputedStyle(document.documentElement).getPropertyValue(
+ '--appshell-header-height',
+ );
+ return parseFloat(raw) || 64;
+ }
+
+ function update() {
+ if (!el) {
+ return;
+ }
+ const navHeight = readNavHeight();
+ const top = el.getBoundingClientRect().top;
+ const reached = top <= navHeight;
+ if (reached) {
+ document.body.setAttribute('data-nav-mode', 'surface');
+ } else {
+ document.body.removeAttribute('data-nav-mode');
+ }
+ }
+
+ update();
+ window.addEventListener('scroll', update, {passive: true});
+ window.addEventListener('resize', update, {passive: true});
+
+ return () => {
+ window.removeEventListener('scroll', update);
+ window.removeEventListener('resize', update);
+ document.body.removeAttribute('data-nav-mode');
+ };
+ }, []);
+
return (
- <div {...stylex.props(styles.hero)}>
- <XDSMediaTheme mode="light">
- <XDSVStack gap={2} style={{alignItems: 'center'}}>
- <XDSText type="display-1">XDS Open Source</XDSText>
- <XDSText type="large" color="secondary" xstyle={styles.subtitle}>
- An open design system for building internal tools with AI-powered
- development.
- </XDSText>
- <div {...stylex.props(styles.buttons)}>
- <XDSButton
- variant="primary"
- label="Get started"
- href="/docs/getting-started"
- />
- <XDSButton
- variant="secondary"
- label="Browse components"
- href="/components"
+ <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)}
/>
- </div>
- </XDSVStack>
- </XDSMediaTheme>
+ <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{' '}
+ <XDSLink
+ type="body"
+ color="primary"
+ href="https://react.dev"
+ target="_blank"
+ rel="noopener noreferrer"
+ hasUnderline>
+ React
+ </XDSLink>{' '}
+ and{' '}
+ <XDSLink
+ type="body"
+ color="primary"
+ href="https://stylexjs.com"
+ target="_blank"
+ rel="noopener noreferrer"
+ hasUnderline>
+ 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>
</div>
);
}
diff --git a/apps/docsite/src/app/globals.css b/apps/docsite/src/app/globals.css
index bfee85865c..65da50f939 100644
--- a/apps/docsite/src/app/globals.css
+++ b/apps/docsite/src/app/globals.css
@@ -9,6 +9,7 @@
@import "@xds/theme-gothic/theme.css";
@import "@xds/theme-matcha/theme.css";
@import "@xds/theme-stone/theme.css";
+@import "../themes/astryx.css";
/* StyleX app styles injected here. useCSSLayers.before declares
reset, xds-base, xds-theme so product styles always win. */
@@ -30,6 +31,15 @@
padding-top: var(--appshell-header-height, 64px);
}
+/* The home page is excluded from the padding rule above — its sticky hero
+ (data-home-page) is already positioned flush under the nav by its own
+ `top: var(--appshell-header-height, 0px)` rule, and the extra padding
+ here would introduce a visible cream-colored gap between the nav and
+ the hero. scroll-padding-top is kept for anchor-link scrolling. */
+body:has([data-home-page]) #xds-app-shell-main {
+ padding-top: 0;
+}
+
/* Translucent top nav — frosted glass effect */
.xds-layout-header,
:has(> .xds-layout-header) {
diff --git a/apps/docsite/src/app/layout.tsx b/apps/docsite/src/app/layout.tsx
index 677ce3b392..c31e1c152a 100644
--- a/apps/docsite/src/app/layout.tsx
+++ b/apps/docsite/src/app/layout.tsx
@@ -4,9 +4,9 @@ import type {Metadata} from 'next';
import './globals.css';
import {Providers} from './providers';
-// Note: @xds/theme-astryx is Figtree-first. We can't use next/font/google
-// here (it requires SWC, but this app pins a custom babel.config.js for
-// StyleX — they're mutually exclusive per
+// Note: the Astryx theme (src/themes/astryxTheme.ts) is Figtree-first.
+// We can't use next/font/google here (it requires SWC, but this app pins
+// a custom babel.config.js for StyleX — they're mutually exclusive per
// https://nextjs.org/docs/messages/babel-font-loader-conflict). Figtree
// loads via the shared Google Fonts <link> in <head> below, which is the
// "Good" path from the theming wiki §Font Declarations.
diff --git a/apps/docsite/src/app/providers.tsx b/apps/docsite/src/app/providers.tsx
index 272dee6d75..641324a3ed 100644
--- a/apps/docsite/src/app/providers.tsx
+++ b/apps/docsite/src/app/providers.tsx
@@ -6,7 +6,7 @@ import {createContext, useContext, useState} from 'react';
import Link from 'next/link';
import {XDSTheme} from '@xds/core/theme';
import {XDSLinkProvider} from '@xds/core/Link';
-import {defaultTheme} from '@xds/theme-default/built';
+import {astryxTheme} from '../themes/astryx';
type ThemeMode = 'light' | 'dark';
@@ -29,7 +29,7 @@ export function Providers({children}: {children: React.ReactNode}) {
return (
<ThemeModeContext value={{mode, toggleMode}}>
- <XDSTheme theme={defaultTheme} mode={mode}>
+ <XDSTheme theme={astryxTheme} mode={mode}>
<XDSLinkProvider component={Link}>{children}</XDSLinkProvider>
</XDSTheme>
</ThemeModeContext>
diff --git a/apps/docsite/src/components/SharedTopNav.tsx b/apps/docsite/src/components/SharedTopNav.tsx
index 8e1f4e2629..5d19954571 100644
--- a/apps/docsite/src/components/SharedTopNav.tsx
+++ b/apps/docsite/src/components/SharedTopNav.tsx
@@ -14,7 +14,7 @@ import {
MoonIcon,
} from '@heroicons/react/24/outline';
import {GITHUB_REPO} from '../constants';
-import {XDS_WORDMARK} from './XDSWordmark';
+import {XDS_BRAND_ICON} from './XDSWordmark';
import {SearchPalette} from './SearchPalette';
import {components} from '../generated/componentRegistry';
import {packages} from '../generated/packageRegistry';
@@ -73,7 +73,7 @@ export function SharedTopNav() {
<>
<XDSTopNav
label="XDS navigation"
- heading={<XDSTopNavHeading logo={XDS_WORDMARK} headingHref="/" />}
+ heading={<XDSTopNavHeading logo={XDS_BRAND_ICON} headingHref="/" />}
centerContent={
<>
<XDSTopNavItem
diff --git a/apps/docsite/src/components/ShowcaseThumbnail.tsx b/apps/docsite/src/components/ShowcaseThumbnail.tsx
index 498b33c692..ca21534e36 100644
--- a/apps/docsite/src/components/ShowcaseThumbnail.tsx
+++ b/apps/docsite/src/components/ShowcaseThumbnail.tsx
@@ -13,6 +13,8 @@ import React, {
import * as stylex from '@stylexjs/stylex';
import {XDSSkeleton} from '@xds/core/Skeleton';
import {XDSText} from '@xds/core/Text';
+import {XDSTheme} from '@xds/core/theme';
+import {neutralTheme} from '@xds/theme-neutral/built';
const FIXED_SCALE = 0.5;
@@ -170,7 +172,9 @@ export function ShowcaseThumbnail({
<XDSSkeleton width="100%" height="100%" />
</div>
}>
- <Component />
+ <XDSTheme theme={neutralTheme}>
+ <Component />
+ </XDSTheme>
</Suspense>
</ShowcaseErrorBoundary>
</div>
diff --git a/apps/docsite/src/components/SiteFooter.tsx b/apps/docsite/src/components/SiteFooter.tsx
index 0bacab6b6c..ec47eabc46 100644
--- a/apps/docsite/src/components/SiteFooter.tsx
+++ b/apps/docsite/src/components/SiteFooter.tsx
@@ -1,59 +1,65 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
+import {Fragment} from 'react';
import * as stylex from '@stylexjs/stylex';
import {XDSText} from '@xds/core/Text';
import {XDSLink} from '@xds/core/Link';
+import {XDSHStack} from '@xds/core/Stack';
import {XDSDivider} from '@xds/core/Divider';
import {spacingVars} from '@xds/core/theme/tokens.stylex';
const styles = stylex.create({
- divider: {
- paddingBlockStart: spacingVars['--spacing-12'],
- },
footer: {
- paddingBlockStart: spacingVars['--spacing-12'],
- paddingBlockEnd: spacingVars['--spacing-12'],
- display: 'flex',
- flexDirection: 'column',
- alignItems: 'center',
- gap: spacingVars['--spacing-2'],
+ paddingBlock: spacingVars['--spacing-6'],
+ paddingInline: spacingVars['--spacing-4'],
+ },
+ verticalDivider: {
+ alignSelf: 'stretch',
+ height: '1em',
},
});
+const links = [
+ {
+ label: 'Terms of Use',
+ href: 'https://opensource.fb.com/legal/terms',
+ },
+ {
+ label: 'Privacy Policy',
+ href: 'https://opensource.fb.com/legal/privacy',
+ },
+ {
+ label: 'GitHub Pages',
+ href: 'https://studious-broccoli-o7e61n3.pages.github.io/',
+ },
+];
+
export function SiteFooter() {
+ const year = new Date().getFullYear();
+
return (
- <>
- <XDSDivider xstyle={styles.divider} />
- <footer {...stylex.props(styles.footer)}>
- <XDSText type="supporting" color="secondary">
- Copyright © Meta Platforms, Inc.
- </XDSText>
- <XDSText type="supporting" color="secondary">
- <XDSLink
- color="secondary"
- label="GitHub Pages"
- href="https://studious-broccoli-o7e61n3.pages.github.io/"
- isExternalLink>
- GitHub Pages
- </XDSLink>
- {' | '}
- <XDSLink
- color="secondary"
- label="Terms of Use"
- href="https://opensource.fb.com/legal/terms"
- isExternalLink>
- Terms of Use
- </XDSLink>
- {' | '}
- <XDSLink
- color="secondary"
- label="Privacy Policy"
- href="https://opensource.fb.com/legal/privacy"
- isExternalLink>
- Privacy Policy
- </XDSLink>
+ <footer {...stylex.props(styles.footer)}>
+ <XDSHStack gap={3} wrap="wrap" justify="center" align="center">
+ <XDSText type="supporting" color="primary">
+ Copyright © {year} Meta Platforms Inc.
</XDSText>
- </footer>
- </>
+ {links.map(link => (
+ <Fragment key={link.href}>
+ <XDSDivider
+ orientation="vertical"
+ variant="subtle"
+ xstyle={styles.verticalDivider}
+ />
+ <XDSLink
+ type="supporting"
+ color="primary"
+ label={link.label}
+ href={link.href}>
+ {link.label}
+ </XDSLink>
+ </Fragment>
+ ))}
+ </XDSHStack>
+ </footer>
);
}
diff --git a/apps/docsite/src/components/TemplateThumbnail.tsx b/apps/docsite/src/components/TemplateThumbnail.tsx
index 3d9827509a..4030dbc5b8 100644
--- a/apps/docsite/src/components/TemplateThumbnail.tsx
+++ b/apps/docsite/src/components/TemplateThumbnail.tsx
@@ -12,6 +12,8 @@ import React, {
} from 'react';
import * as stylex from '@stylexjs/stylex';
import {XDSSkeleton} from '@xds/core/Skeleton';
+import {XDSTheme} from '@xds/core/theme';
+import {neutralTheme} from '@xds/theme-neutral/built';
const FIXED_SCALE = 0.5;
@@ -221,7 +223,9 @@ export function TemplateThumbnail({slug}: {slug: string}) {
<XDSSkeleton width="100%" height="100%" />
</div>
}>
- <Component />
+ <XDSTheme theme={neutralTheme}>
+ <Component />
+ </XDSTheme>
</Suspense>
</div>
)}
diff --git a/apps/docsite/src/components/XDSWordmark.tsx b/apps/docsite/src/components/XDSWordmark.tsx
index c2ea933d8a..a37985ea83 100644
--- a/apps/docsite/src/components/XDSWordmark.tsx
+++ b/apps/docsite/src/components/XDSWordmark.tsx
@@ -1,26 +1,13 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
-// XDS wordmark SVG — uses currentColor for light/dark adaptation
-export const XDS_WORDMARK = (
- <svg
- width="46"
- height="24"
- viewBox="0 0 46 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg">
- <path
- d="M2.4239 15.8011C2.03945 16.3796 1.66972 16.9538 1.3147 17.524C0.707427 18.4992 1.42354 19.7348 2.57241 19.7348C3.13302 19.7348 3.64463 19.4209 3.91525 18.93C4.29391 18.243 4.71274 17.5352 5.17173 16.8066C5.38894 16.4618 5.60743 16.12 5.82721 15.7812C6.25251 15.1254 6.46516 14.7976 6.76252 14.68C6.99255 14.5891 7.27368 14.5899 7.50317 14.6822C7.79984 14.8014 8.00881 15.1278 8.42675 15.7804C8.64287 16.1179 8.85732 16.46 9.07008 16.8066C9.52175 17.534 9.93823 18.2339 10.3195 18.9063C10.6075 19.4141 11.1428 19.7348 11.7266 19.7348C12.9476 19.7348 13.7063 18.4203 13.0547 17.3877C12.7332 16.8781 12.3991 16.3639 12.0525 15.8453C11.3983 14.8527 10.7379 13.8906 10.0714 12.9592C9.81687 12.6036 9.68962 12.4258 9.64377 12.2384C9.60589 12.0836 9.60492 11.9307 9.64085 11.7754C9.68435 11.5874 9.80856 11.4091 10.057 11.0526C10.7093 10.1164 11.3596 9.15781 12.0078 8.1768C12.3869 7.60474 12.7521 7.03681 13.1035 6.47298C13.71 5.49987 12.9962 4.26519 11.8496 4.26519C11.2943 4.26519 10.7868 4.57405 10.5169 5.05923C10.1399 5.73688 9.72461 6.43721 9.27114 7.16022C9.06143 7.49458 8.8505 7.82569 8.63835 8.15358C8.21478 8.80819 8.003 9.1355 7.70554 9.25334C7.47561 9.34442 7.19397 9.34375 6.96448 9.25156C6.66759 9.13229 6.45853 8.80578 6.04043 8.15276C5.83116 7.82591 5.62351 7.49506 5.41747 7.16022C4.97918 6.44793 4.5738 5.76096 4.20132 5.0993C3.9136 4.58821 3.37617 4.26519 2.78967 4.26519C1.56624 4.26519 0.805692 5.58299 1.45419 6.62041C1.76588 7.11903 2.08912 7.6231 2.4239 8.1326C3.0752 9.10994 3.73263 10.059 4.3962 10.9796C4.65373 11.337 4.7825 11.5156 4.82882 11.7042C4.86709 11.86 4.86797 12.0139 4.83149 12.1702C4.78732 12.3593 4.66122 12.5385 4.40903 12.897C3.74526 13.8406 3.08355 14.8086 2.4239 15.8011Z"
- fill="currentColor"
- />
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M22.4734 4.26519C20.4471 4.26519 19.434 4.26519 18.6657 4.67201C18.0456 5.00031 17.5385 5.50739 17.2102 6.12744C16.8034 6.89579 16.8034 7.90892 16.8034 9.9352V14.0648C16.8034 16.0911 16.8034 17.1042 17.2102 17.8726C17.5385 18.4926 18.0456 18.9997 18.6657 19.328C19.434 19.7348 20.4471 19.7348 22.4734 19.7348H23.2039C24.8496 19.7348 26.2644 19.4033 27.4485 18.7403C28.6399 18.07 29.5559 17.1529 30.1963 15.989C30.8367 14.825 31.1569 13.4954 31.1569 12C31.1569 10.5046 30.8367 9.17495 30.1963 8.01105C29.5559 6.84714 28.6399 5.9337 27.4485 5.27072C26.2644 4.60037 24.8496 4.26519 23.2039 4.26519H22.4734ZM20.0092 8.74707C20.0092 8.16814 20.0092 7.87867 20.1255 7.65914C20.2193 7.48198 20.3641 7.33711 20.5413 7.24331C20.7608 7.12707 21.0503 7.12707 21.6292 7.12707H23.1927C24.6522 7.12707 25.7916 7.57274 26.6107 8.46409C27.4299 9.34807 27.8394 10.5267 27.8394 12C27.8394 13.4659 27.4299 14.6446 26.6107 15.5359C25.7916 16.4273 24.6522 16.8729 23.1927 16.8729H21.6292C21.0503 16.8729 20.7608 16.8729 20.5413 16.7567C20.3641 16.6629 20.2193 16.518 20.1255 16.3409C20.0092 16.1213 20.0092 15.8319 20.0092 15.2529V8.74707Z"
- fill="currentColor"
- />
- <path
- d="M35.4666 19.2376C36.6134 19.7459 37.9501 20 39.4767 20H39.8006C41.7144 20 43.2261 19.5801 44.3357 18.7403C45.4452 17.9006 46 16.7403 46 15.2597C46 14.3757 45.8213 13.6501 45.4638 13.0829C45.1064 12.5083 44.6559 12.0589 44.1123 11.7348C43.5761 11.4033 43.0325 11.1565 42.4814 10.9945C41.9304 10.8324 41.4575 10.7145 41.0628 10.6409L38.706 10.1878C38.0283 10.0552 37.4698 9.87477 37.0305 9.64641C36.5985 9.41068 36.3826 9.02762 36.3826 8.49724C36.3826 7.96685 36.6395 7.55064 37.1533 7.24862C37.6671 6.93923 38.3857 6.78453 39.3091 6.78453H39.6219C40.3964 6.78453 41.1224 6.93186 41.8001 7.22652C42.0982 7.35474 42.3899 7.5234 42.6754 7.73251C43.326 8.20923 44.2444 8.27802 44.8243 7.71734C45.34 7.21868 45.4053 6.39786 44.8761 5.91349C44.3498 5.43171 43.7638 5.03698 43.1181 4.72928C42.1054 4.24309 40.9511 4 39.6554 4H39.3315C38.0953 4 37.0156 4.19521 36.0922 4.58564C35.1762 4.97606 34.4613 5.52486 33.9475 6.23204C33.4411 6.93186 33.188 7.76059 33.188 8.71823C33.188 9.49171 33.3406 10.1436 33.6459 10.674C33.9587 11.2044 34.3571 11.6354 34.8411 11.9669C35.3326 12.2983 35.8539 12.5599 36.4049 12.7514C36.956 12.9355 37.4698 13.0718 37.9464 13.1602L40.3033 13.6243C40.6905 13.698 41.074 13.8011 41.4538 13.9337C41.841 14.0589 42.1612 14.2431 42.4144 14.4862C42.6676 14.7293 42.7942 15.0608 42.7942 15.4807C42.7942 16.6151 41.7814 17.1823 39.7559 17.1823H39.4432C38.49 17.1823 37.615 17.0055 36.8182 16.6519C36.4847 16.4994 36.1665 16.3134 35.8635 16.0938C35.17 15.5911 34.1857 15.5241 33.5784 16.1282C33.0651 16.6388 32.9912 17.4631 33.5198 17.9578C34.0797 18.4818 34.7287 18.9083 35.4666 19.2376Z"
- fill="currentColor"
- />
- </svg>
+// Brand mark used in shell chrome (top nav). Renders the icon-only logo
+// from /public/brand-icon.svg so the wordmark is replaced by the icon.
+export const XDS_BRAND_ICON = (
+ <img
+ src="/brand-icon.svg"
+ alt="XDS"
+ width={24}
+ height={24}
+ style={{display: 'block'}}
+ />
);
diff --git a/apps/docsite/src/components/component-detail/ExampleBlock.tsx b/apps/docsite/src/components/component-detail/ExampleBlock.tsx
index 6fe65a8bc6..a6ad29a183 100644
--- a/apps/docsite/src/components/component-detail/ExampleBlock.tsx
+++ b/apps/docsite/src/components/component-detail/ExampleBlock.tsx
@@ -12,6 +12,8 @@ import {XDSTabList, XDSTab} from '@xds/core/TabList';
import {XDSSpinner} from '@xds/core/Spinner';
import {XDSButton} from '@xds/core/Button';
import {XDSHStack} from '@xds/core/Layout';
+import {XDSTheme} from '@xds/core/theme';
+import {neutralTheme} from '@xds/theme-neutral/built';
import type {ExampleEntry} from '../../generated/exampleRegistry';
import {buildPlaygroundHref} from '../playgroundLink';
@@ -45,19 +47,21 @@ function LivePreview({entry}: {entry: ExampleEntry}) {
}
return (
- <div
- style={{
- width: '100%',
- overflow: 'auto',
- minHeight: 200,
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- }}>
- <div style={{minWidth: 'fit-content', padding: 'var(--spacing-4)'}}>
- <Component />
+ <XDSTheme theme={neutralTheme}>
+ <div
+ style={{
+ width: '100%',
+ overflow: 'auto',
+ minHeight: 200,
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ }}>
+ <div style={{minWidth: 'fit-content', padding: 'var(--spacing-4)'}}>
+ <Component />
+ </div>
</div>
- </div>
+ </XDSTheme>
);
}
diff --git a/apps/docsite/src/components/component-detail/InteractivePreview.tsx b/apps/docsite/src/components/component-detail/InteractivePreview.tsx
index 84218090e9..70879fab12 100644
--- a/apps/docsite/src/components/component-detail/InteractivePreview.tsx
+++ b/apps/docsite/src/components/component-detail/InteractivePreview.tsx
@@ -18,6 +18,8 @@ import {XDSCenter} from '@xds/core/Center';
import {XDSCodeBlock} from '@xds/core/CodeBlock';
import {XDSVStack} from '@xds/core/Layout';
import {XDSText} from '@xds/core/Text';
+import {XDSTheme} from '@xds/core/theme';
+import {neutralTheme} from '@xds/theme-neutral/built';
import {CodeBracketIcon} from '@heroicons/react/24/outline';
import {
coerceDefault,
@@ -291,16 +293,18 @@ export function InteractivePreviewStage({
<XDSCodeBlock code={code} language="tsx" hasCopyButton />
</div>
) : (
- <XDSCenter
- style={{
- minHeight: 200,
- width: '100%',
- padding: 'var(--spacing-4)',
- }}>
- <PreviewErrorBoundary resetKeys={[Component, state]}>
- {createElement(Component, state)}
- </PreviewErrorBoundary>
- </XDSCenter>
+ <XDSTheme theme={neutralTheme}>
+ <XDSCenter
+ style={{
+ minHeight: 200,
+ width: '100%',
+ padding: 'var(--spacing-4)',
+ }}>
+ <PreviewErrorBoundary resetKeys={[Component, state]}>
+ {createElement(Component, state)}
+ </PreviewErrorBoundary>
+ </XDSCenter>
+ </XDSTheme>
)}
</XDSCard>
);
diff --git a/apps/docsite/src/components/component-detail/ShowcasePreview.tsx b/apps/docsite/src/components/component-detail/ShowcasePreview.tsx
index c499d1d9cc..40a156a9f1 100644
--- a/apps/docsite/src/components/component-detail/ShowcasePreview.tsx
+++ b/apps/docsite/src/components/component-detail/ShowcasePreview.tsx
@@ -6,7 +6,9 @@ import {useEffect, useState, type ComponentType} from 'react';
import {XDSCenter} from '@xds/core/Center';
import {XDSText} from '@xds/core/Text';
import {XDSSpinner} from '@xds/core/Spinner';
+import {XDSTheme} from '@xds/core/theme';
import {useMediaQuery} from '@xds/core/hooks';
+import {neutralTheme} from '@xds/theme-neutral/built';
import {showcaseRegistry} from '../../generated/showcaseRegistry';
interface ShowcasePreviewProps {
@@ -53,33 +55,37 @@ export function ShowcasePreview({name}: ShowcasePreviewProps) {
if (isSmall) {
return (
+ <XDSTheme theme={neutralTheme}>
+ <div
+ style={{
+ width: '100%',
+ overflow: 'auto',
+ minHeight: 160,
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ }}>
+ <div style={{minWidth: 'fit-content'}}>
+ <Component />
+ </div>
+ </div>
+ </XDSTheme>
+ );
+ }
+
+ return (
+ <XDSTheme theme={neutralTheme}>
<div
style={{
width: '100%',
+ aspectRatio: '16 / 9',
overflow: 'auto',
- minHeight: 160,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
}}>
- <div style={{minWidth: 'fit-content'}}>
- <Component />
- </div>
+ <Component />
</div>
- );
- }
-
- return (
- <div
- style={{
- width: '100%',
- aspectRatio: '16 / 9',
- overflow: 'auto',
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- }}>
- <Component />
- </div>
+ </XDSTheme>
);
}
diff --git a/apps/docsite/src/themes/astryxTheme.ts b/apps/docsite/src/themes/astryxTheme.ts
new file mode 100644
index 0000000000..35b4e69cce
--- /dev/null
+++ b/apps/docsite/src/themes/astryxTheme.ts
@@ -0,0 +1,76 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+
+/**
+ * Astryx Theme
+ *
+ * Minimal — only two brand decisions:
+ * 1. Accent color: #292724 (warm near-black)
+ * 2. Typography: Figtree
+ *
+ * Everything else (surfaces, text, borders, status, radius, motion) is
+ * inherited from the default XDS theme behavior so the design system
+ * stays the source of truth and Astryx is a thin brand layer on top.
+ */
+
+import {defineTheme} from '@xds/core/theme';
+
+export const astryxTheme = defineTheme({
+ name: 'astryx',
+
+ // Set the accent token directly instead of using the `color: { accent }`
+ // scale config — the scale runs HCT derivation across the whole palette
+ // and bleeds the accent's hue into neutrals (which made all the "gray"
+ // surfaces come out brown). Setting --color-accent directly leaves every
+ // other token at the XDS default.
+ tokens: {
+ '--color-accent': '#292724',
+ '--color-background-body': '#F8F4ED',
+ // Astryx display headings render semibold (XDS default is normal weight).
+ '--text-display-1-weight': 'var(--font-weight-semibold)',
+ '--text-display-2-weight': 'var(--font-weight-semibold)',
+ '--text-display-3-weight': 'var(--font-weight-semibold)',
+ // Bump each radius scale step by +4px for slightly softer corners across
+ // the whole UI (inputs, cards, panels, page containers). --radius-none
+ // and --radius-full stay fixed.
+ '--radius-inner': '8px',
+ '--radius-element': '12px',
+ '--radius-container': '16px',
+ '--radius-page': '32px',
+ },
+
+ typography: {
+ body: {
+ family: 'var(--font-figtree,Figtree)',
+ fallbacks:
+ '"Figtree Variable", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',
+ },
+ heading: {
+ family: 'var(--font-figtree,Figtree)',
+ fallbacks:
+ '"Figtree Variable", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',
+ },
+ },
+
+ components: {
+ // Fully-rounded (pill) buttons across all variants and sizes.
+ button: {
+ base: {
+ borderRadius: 'var(--radius-full)',
+ },
+ },
+ // TopNav items: remove the "pill" background on the selected state and
+ // rely on weight + primary text color for emphasis. Hover/active still
+ // get the neutral overlay from the base styles.
+ 'top-nav-item': {
+ selected: {
+ backgroundColor: 'transparent',
+ ':hover': {
+ backgroundColor: 'var(--color-overlay-hover)',
+ },
+ ':active': {
+ backgroundColor: 'var(--color-overlay-pressed)',
+ },
+ },
+ },
+ },
+});
diff --git a/eslint.config.js b/eslint.config.js
index 81b5cbc147..b373526855 100644
--- a/eslint.config.js
+++ b/eslint.config.js
@@ -125,6 +125,7 @@ export default tseslint.config(
// Copyright header — all source files must have the Meta copyright notice
{
files: ["**/*.{ts,tsx}"],
+ ignores: ["**/*.d.ts", "**/dist/**"],
plugins: {
'@xds': xdsPlugin,
},