Skip to content

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

TypeScript

docsite(templates): polish centered-hero to pure-XDS (A, 95/100) (#2583)

rubyycheung4348786581c7
diff --git a/packages/cli/templates/pages/centered-hero/page.tsx b/packages/cli/templates/pages/centered-hero/page.tsx
index f9c789955d..89c6e06ec7 100644
--- a/packages/cli/templates/pages/centered-hero/page.tsx
+++ b/packages/cli/templates/pages/centered-hero/page.tsx
@@ -9,59 +9,48 @@ import {
XDSLayout,
XDSLayoutContent,
} from '@xds/core/Layout';
-import {XDSText} from '@xds/core/Text';
+import {XDSText, XDSHeading} from '@xds/core/Text';
import {XDSButton} from '@xds/core/Button';
import {XDSIcon} from '@xds/core/Icon';
+import {XDSAspectRatio} from '@xds/core/AspectRatio';
+import {XDSSection} from '@xds/core/Section';
import {ArrowRightIcon} from '@heroicons/react/20/solid';
-// light-scene-horizontal-1 from xds_oss asset set
-const IMAGE_URL =
- '/template-assets/light-scene-horizontal-1.png';
+const IMAGE_URL = '/template-assets/light-scene-horizontal-1.png';
const styles = stylex.create({
- textCenter: {
- textAlign: 'center',
- },
- titleResponsive: {
- fontSize: {
- default: 'var(--text-display-2-size)',
- '@media (max-width: 640px)': 'var(--text-display-3-size)',
- },
- },
- topSpacing: {
- paddingTop: 'var(--spacing-12)',
- },
heroImage: {
- width: 'calc(100% - var(--spacing-6) * 2)',
- marginInline: 'var(--spacing-6)',
- borderRadius: 'var(--radius-page)',
- display: 'block',
- maxHeight: 550,
+ width: '100%',
+ height: '100%',
objectFit: 'cover',
},
+ heroFrame: {
+ maxWidth: 1200,
+ marginInline: 'auto',
+ borderRadius: 'var(--radius-page)',
+ },
});
export default function CenteredHero() {
return (
<XDSLayout
content={
- <XDSLayoutContent padding={0}>
+ <XDSLayoutContent padding={6}>
<XDSVStack gap={10}>
- <XDSVStack gap={6} hAlign="center" xstyle={styles.topSpacing}>
+ <XDSVStack gap={6} hAlign="center">
<XDSVStack gap={3} hAlign="center">
- <XDSText
+ <XDSHeading
+ level={1}
type="display-2"
- as="h1"
- weight="bold"
- textWrap="balance"
- xstyle={[styles.textCenter, styles.titleResponsive]}>
+ justify="center"
+ textWrap="balance">
Little joys, everywhere you go
- </XDSText>
+ </XDSHeading>
<XDSText
type="body"
color="secondary"
- textWrap="balance"
- xstyle={styles.textCenter}>
+ justify="center"
+ textWrap="balance">
Sometimes all it takes is one small thing to turn your whole
day around.
</XDSText>
@@ -77,11 +66,15 @@ export default function CenteredHero() {
<XDSButton label="Learn more" variant="secondary" />
</XDSHStack>
</XDSVStack>
- <img
- {...stylex.props(styles.heroImage)}
- src={IMAGE_URL}
- alt="Serene landscape with cotton fields and towering clouds"
- />
+ <XDSSection variant="transparent" padding={0}>
+ <XDSAspectRatio ratio={16 / 9} xstyle={styles.heroFrame}>
+ <img
+ {...stylex.props(styles.heroImage)}
+ src={IMAGE_URL}
+ alt="A bright, colorful lifestyle scene"
+ />
+ </XDSAspectRatio>
+ </XDSSection>
</XDSVStack>
</XDSLayoutContent>
}
diff --git a/packages/cli/templates/pages/centered-hero/template.doc.mjs b/packages/cli/templates/pages/centered-hero/template.doc.mjs
index ade01143e4..c98f2d20de 100644
--- a/packages/cli/templates/pages/centered-hero/template.doc.mjs
+++ b/packages/cli/templates/pages/centered-hero/template.doc.mjs
@@ -3,11 +3,10 @@
/** @type {import('../../../../core/src/docs-types').TemplateDoc} */
export const doc = {
type: 'page',
- name: 'Basic',
- displayName: 'Basic',
+ name: 'Centered Hero',
+ displayName: 'Centered Hero',
description:
- 'Centered headline, description, and CTA buttons above a full-width image.',
- isReady: false,
- category: 'Gallery - Basic',
- isHiddenFromOverview: true,
+ 'Centered headline, description, and CTA buttons above a wide hero image.',
+ isReady: true,
+ category: 'Gallery - Hero',
};
diff --git a/packages/cli/templates/pages/contact-form/page.tsx b/packages/cli/templates/pages/contact-form/page.tsx
index b7118c1aa9..11f1f246bc 100644
--- a/packages/cli/templates/pages/contact-form/page.tsx
+++ b/packages/cli/templates/pages/contact-form/page.tsx
@@ -124,187 +124,191 @@ export default function FormSimplePage() {
return (
<XDSCenter axis="horizontal" xstyle={styles.page}>
<XDSVStack hAlign="center" width="100%">
- <XDSSection maxWidth={800} padding={6} paddingBlock={10} variant="section">
+ <XDSSection
+ maxWidth={800}
+ padding={6}
+ paddingBlock={10}
+ variant="section">
<XDSVStack gap={6}>
- {/* Header */}
- <XDSVStack gap={2} hAlign="center">
- <XDSText type="display-1" weight="bold">
- Let's work together
- </XDSText>
- <XDSText type="body" color="secondary">
- Tell us a bit about what you're working on — we'd love to help.
- </XDSText>
- </XDSVStack>
+ {/* Header */}
+ <XDSVStack gap={2} hAlign="center">
+ <XDSText type="display-1" weight="bold">
+ Let's work together
+ </XDSText>
+ <XDSText type="body" color="secondary">
+ Tell us a bit about what you're working on — we'd love to help.
+ </XDSText>
+ </XDSVStack>
- {/* Why work with us */}
- <XDSVStack gap={5}>
- <XDSGrid columns={{minWidth: 200}} gap={4}>
- {WHY_US.map(item => (
- <XDSCard key={item.title}>
- <XDSVStack gap={3}>
- <img
- src={item.image}
- alt={item.title}
- {...stylex.props(styles.imgFull)}
- />
- <XDSVStack gap={1}>
- <XDSText type="body" weight="bold">
- {item.title}
- </XDSText>
- <XDSText type="supporting" color="secondary">
- {item.description}
- </XDSText>
+ {/* Why work with us */}
+ <XDSVStack gap={5}>
+ <XDSGrid columns={{minWidth: 200}} gap={4}>
+ {WHY_US.map(item => (
+ <XDSCard key={item.title}>
+ <XDSVStack gap={3}>
+ <img
+ src={item.image}
+ alt={item.title}
+ {...stylex.props(styles.imgFull)}
+ />
+ <XDSVStack gap={1}>
+ <XDSText type="body" weight="bold">
+ {item.title}
+ </XDSText>
+ <XDSText type="supporting" color="secondary">
+ {item.description}
+ </XDSText>
+ </XDSVStack>
</XDSVStack>
- </XDSVStack>
- </XDSCard>
- ))}
- </XDSGrid>
- </XDSVStack>
+ </XDSCard>
+ ))}
+ </XDSGrid>
+ </XDSVStack>
- {/* Your details */}
- <XDSVStack gap={5}>
- <XDSGrid columns={{minWidth: 260}} gap={4}>
- <XDSTextInput
- label="Full Name"
- placeholder="Full Name"
- value={fullName}
- onChange={setFullName}
- status={
- errors.fullName
- ? {type: 'error', message: errors.fullName}
- : undefined
- }
- />
- <XDSTextInput
- label="Email"
- placeholder="[email protected]"
- value={email}
- onChange={setEmail}
+ {/* Your details */}
+ <XDSVStack gap={5}>
+ <XDSGrid columns={{minWidth: 260}} gap={4}>
+ <XDSTextInput
+ label="Full Name"
+ placeholder="Full Name"
+ value={fullName}
+ onChange={setFullName}
+ status={
+ errors.fullName
+ ? {type: 'error', message: errors.fullName}
+ : undefined
+ }
+ />
+ <XDSTextInput
+ label="Email"
+ placeholder="[email protected]"
+ value={email}
+ onChange={setEmail}
+ status={
+ errors.email
+ ? {type: 'error', message: errors.email}
+ : undefined
+ }
+ />
+ </XDSGrid>
+ <XDSGrid columns={{minWidth: 260}} gap={4}>
+ <XDSTextInput
+ label="Company"
+ placeholder="Company"
+ value={company}
+ onChange={setCompany}
+ status={
+ errors.company
+ ? {type: 'error', message: errors.company}
+ : undefined
+ }
+ />
+ <XDSTextInput
+ label="Phone"
+ placeholder="Phone number"
+ value={phone}
+ onChange={setPhone}
+ status={
+ errors.phone
+ ? {type: 'error', message: errors.phone}
+ : undefined
+ }
+ />
+ </XDSGrid>
+ </XDSVStack>
+
+ <XDSDivider />
+
+ {/* Your project */}
+ <XDSVStack gap={5}>
+ <XDSVStack gap={2}>
+ <XDSText type="label">What are you going for?</XDSText>
+ <XDSHStack gap={2} wrap="wrap">
+ {CAMPAIGN_GOALS.map(goal => (
+ <XDSToken
+ key={goal}
+ label={goal}
+ color={goals.includes(goal) ? 'blue' : 'default'}
+ onClick={() => toggleGoal(goal)}
+ />
+ ))}
+ </XDSHStack>
+ {errors.goals && (
+ <XDSBanner status="error" title={errors.goals} />
+ )}
+ </XDSVStack>
+
+ <XDSSelector
+ label="When are you thinking?"
+ placeholder="When are you thinking of launching?"
+ options={LAUNCH_OPTIONS}
+ value={timeline}
+ onChange={setTimeline}
status={
- errors.email
- ? {type: 'error', message: errors.email}
+ errors.timeline
+ ? {type: 'error', message: errors.timeline}
: undefined
}
/>
- </XDSGrid>
- <XDSGrid columns={{minWidth: 260}} gap={4}>
- <XDSTextInput
- label="Company"
- placeholder="Company"
- value={company}
- onChange={setCompany}
+
+ <XDSSelector
+ label="Ballpark budget?"
+ placeholder="What's your rough monthly budget?"
+ options={BUDGET_OPTIONS}
+ value={budget}
+ onChange={setBudget}
status={
- errors.company
- ? {type: 'error', message: errors.company}
+ errors.budget
+ ? {type: 'error', message: errors.budget}
: undefined
}
/>
- <XDSTextInput
- label="Phone"
- placeholder="Phone number"
- value={phone}
- onChange={setPhone}
- status={
- errors.phone
- ? {type: 'error', message: errors.phone}
- : undefined
- }
+
+ <XDSRadioList
+ label="How did you hear about us?"
+ value={hearAboutUs}
+ onChange={setHearAboutUs}>
+ <XDSRadioListItem label="Social media" value="social" />
+ <XDSRadioListItem label="Word of mouth" value="word-of-mouth" />
+ <XDSRadioListItem label="Search engine" value="search" />
+ <XDSRadioListItem label="Event or conference" value="event" />
+ <XDSRadioListItem label="Other" value="other" />
+ </XDSRadioList>
+
+ <XDSTextArea
+ label="Anything else?"
+ placeholder="Tell us whatever else is on your mind..."
+ value={message}
+ onChange={setMessage}
/>
- </XDSGrid>
- </XDSVStack>
- <XDSDivider />
+ <XDSCheckboxInput
+ label="I'm a budget decision-maker"
+ value={isDecider}
+ onChange={setIsDecider}
+ />
+ </XDSVStack>
- {/* Your project */}
- <XDSVStack gap={5}>
- <XDSVStack gap={2}>
- <XDSText type="label">What are you going for?</XDSText>
- <XDSHStack gap={2} wrap="wrap">
- {CAMPAIGN_GOALS.map(goal => (
- <XDSToken
- key={goal}
- label={goal}
- color={goals.includes(goal) ? 'blue' : 'default'}
- onClick={() => toggleGoal(goal)}
- />
- ))}
+ {/* Submit */}
+ <XDSVStack gap={3}>
+ <XDSButton
+ label="Submit"
+ variant="primary"
+ size="lg"
+ onClick={() => setSubmitted(true)}
+ />
+ <XDSHStack gap={1} hAlign="center">
+ <XDSText type="supporting" color="secondary">
+ By submitting you agree to our{' '}
+ <XDSLink href="#" type="supporting">
+ Privacy Policy
+ </XDSLink>
+ .
+ </XDSText>
</XDSHStack>
- {errors.goals && (
- <XDSBanner status="error" title={errors.goals} />
- )}
</XDSVStack>
-
- <XDSSelector
- label="When are you thinking?"
- placeholder="When are you thinking of launching?"
- options={LAUNCH_OPTIONS}
- value={timeline}
- onChange={setTimeline}
- status={
- errors.timeline
- ? {type: 'error', message: errors.timeline}
- : undefined
- }
- />
-
- <XDSSelector
- label="Ballpark budget?"
- placeholder="What's your rough monthly budget?"
- options={BUDGET_OPTIONS}
- value={budget}
- onChange={setBudget}
- status={
- errors.budget
- ? {type: 'error', message: errors.budget}
- : undefined
- }
- />
-
- <XDSRadioList
- label="How did you hear about us?"
- value={hearAboutUs}
- onChange={setHearAboutUs}>
- <XDSRadioListItem label="Social media" value="social" />
- <XDSRadioListItem label="Word of mouth" value="word-of-mouth" />
- <XDSRadioListItem label="Search engine" value="search" />
- <XDSRadioListItem label="Event or conference" value="event" />
- <XDSRadioListItem label="Other" value="other" />
- </XDSRadioList>
-
- <XDSTextArea
- label="Anything else?"
- placeholder="Tell us whatever else is on your mind..."
- value={message}
- onChange={setMessage}
- />
-
- <XDSCheckboxInput
- label="I'm a budget decision-maker"
- value={isDecider}
- onChange={setIsDecider}
- />
- </XDSVStack>
-
- {/* Submit */}
- <XDSVStack gap={3}>
- <XDSButton
- label="Submit"
- variant="primary"
- size="lg"
- onClick={() => setSubmitted(true)}
- />
- <XDSHStack gap={1} hAlign="center">
- <XDSText type="supporting" color="secondary">
- By submitting you agree to our{' '}
- <XDSLink href="#" type="supporting">
- Privacy Policy
- </XDSLink>
- .
- </XDSText>
- </XDSHStack>
</XDSVStack>
- </XDSVStack>
- </XDSSection>
+ </XDSSection>
</XDSVStack>
</XDSCenter>
);
diff --git a/packages/cli/templates/pages/form-two-column/page.tsx b/packages/cli/templates/pages/form-two-column/page.tsx
index a3408025df..a96b6578c0 100644
--- a/packages/cli/templates/pages/form-two-column/page.tsx
+++ b/packages/cli/templates/pages/form-two-column/page.tsx
@@ -21,8 +21,7 @@ import {XDSSelector} from '@xds/core/Selector';
import {colorVars} from '@xds/core/theme/tokens.stylex';
// illustration-horizontal-1 from xds_oss asset set
-const ILLUSTRATION_URL =
- '/template-assets/illustration-horizontal-1.png';
+const ILLUSTRATION_URL = '/template-assets/illustration-horizontal-1.png';
// ─────────────────────────────────────────────────────────────
// Constants
@@ -240,10 +239,7 @@ export default function FormTwoColumnPage() {
<XDSText type="supporting" color="secondary">
{col.label}
</XDSText>
- <XDSLink
- href={`mailto:${col.email}`}
- type="body"
- size="sm">
+ <XDSLink href={`mailto:${col.email}`} type="body" size="sm">
{col.email}
</XDSLink>
</XDSVStack>
diff --git a/packages/cli/templates/pages/library/page.tsx b/packages/cli/templates/pages/library/page.tsx
index 4cdb5960a2..8e792c37ab 100644
--- a/packages/cli/templates/pages/library/page.tsx
+++ b/packages/cli/templates/pages/library/page.tsx
@@ -37,8 +37,7 @@ const ITEMS: LibraryItem[] = [
'Vertical and horizontal stack layouts with configurable gap and alignment.',
category: 'Layout',
type: 'Component',
- imageUrl:
- '/template-assets/colorful-home-horizontal-1.png',
+ imageUrl: '/template-assets/colorful-home-horizontal-1.png',
},
{
id: '2',
@@ -47,8 +46,7 @@ const ITEMS: LibraryItem[] = [
'Responsive grid container with auto-fit columns and gap control.',
category: 'Layout',
type: 'Component',
- imageUrl:
- '/template-assets/illustrative-horizontal-3.jpg',
+ imageUrl: '/template-assets/illustrative-horizontal-3.jpg',
},
{
id: '3',
@@ -57,8 +55,7 @@ const ITEMS: LibraryItem[] = [
'Surface container with optional padding, border, and shadow variants.',
category: 'Layout',
type: 'Component',
- imageUrl:
- '/template-assets/light-working-horizontal-2.png',
+ imageUrl: '/template-assets/light-working-horizontal-2.png',
},
{
id: '4',
@@ -66,8 +63,7 @@ const ITEMS: LibraryItem[] = [
description: 'Centers its child both horizontally and vertically.',
category: 'Layout',
type: 'Utility',
- imageUrl:
- '/template-assets/moody-scene-horizontal-1.png',
+ imageUrl: '/template-assets/moody-scene-horizontal-1.png',
},
{
id: '5',
@@ -75,8 +71,7 @@ const ITEMS: LibraryItem[] = [
description: 'Semantic page section with optional heading and divider.',
category: 'Layout',
type: 'Pattern',
- imageUrl:
- '/template-assets/colorful-lifestyle-horizontal-2.png',
+ imageUrl: '/template-assets/colorful-lifestyle-horizontal-2.png',
},
{
id: '6',
@@ -84,8 +79,7 @@ const ITEMS: LibraryItem[] = [
description: 'Expandable region with animated height transition.',
category: 'Layout',
type: 'Component',
- imageUrl:
- '/template-assets/light-scene-horizontal-1.png',
+ imageUrl: '/template-assets/light-scene-horizontal-1.png',
},
{
id: '7',
@@ -94,8 +88,7 @@ const ITEMS: LibraryItem[] = [
'Single-line text field with label, placeholder, and validation states.',
category: 'Forms',
type: 'Component',
- imageUrl:
- '/template-assets/moody-working-horizontal-1.png',
+ imageUrl: '/template-assets/moody-working-horizontal-1.png',
},
{
id: '8',
@@ -103,8 +96,7 @@ const ITEMS: LibraryItem[] = [
description: 'Multi-line text field with auto-resize and character count.',
category: 'Forms',
type: 'Component',
- imageUrl:
- '/template-assets/colorful-working-horizontal-3.png',
+ imageUrl: '/template-assets/colorful-working-horizontal-3.png',
},
{
id: '9',
@@ -112,8 +104,7 @@ const ITEMS: LibraryItem[] = [
description: 'Checkbox with label, indeterminate state, and group support.',
category: 'Forms',
type: 'Component',
- imageUrl:
- '/template-assets/illustrative-horizontal-1.jpg',
+ imageUrl: '/template-assets/illustrative-horizontal-1.jpg',
},
{
id: '10',
@@ -121,8 +112,7 @@ const ITEMS: LibraryItem[] = [
description: 'Group of radio buttons with accessible fieldset wrapper.',
category: 'Forms',
type: 'Component',
- imageUrl:
- '/template-assets/light-home-horizontal-1.png',
+ imageUrl: '/template-assets/light-home-horizontal-1.png',
},
{
id: '11',
@@ -130,8 +120,7 @@ const ITEMS: LibraryItem[] = [
description: 'Toggle switch for binary on/off settings.',
category: 'Forms',
type: 'Component',
- imageUrl:
- '/template-assets/moody-home-horizontal-2.png',
+ imageUrl: '/template-assets/moody-home-horizontal-2.png',
},
{
id: '12',
@@ -140,8 +129,7 @@ const ITEMS: LibraryItem[] = [
'Dropdown or inline option selector with single and multi-select modes.',
category: 'Forms',
type: 'Component',
- imageUrl:
- '/template-assets/colorful-product-1.png',
+ imageUrl: '/template-assets/colorful-product-1.png',
},
{
id: '13',
@@ -150,8 +138,7 @@ const ITEMS: LibraryItem[] = [
'Horizontal tab navigation with underline indicator and keyboard support.',
category: 'Navigation',
type: 'Component',
- imageUrl:
- '/template-assets/illustrative-horizontal-5.jpg',
+ imageUrl: '/template-assets/illustrative-horizontal-5.jpg',
},
{
id: '14',
@@ -159,8 +146,7 @@ const ITEMS: LibraryItem[] = [
description: 'Application top bar with logo, nav links, and action slots.',
category: 'Navigation',
type: 'Pattern',
- imageUrl:
- '/template-assets/light-working-horizontal-1.png',
+ imageUrl: '/template-assets/light-working-horizontal-1.png',
},
{
id: '15',
@@ -169,8 +155,7 @@ const ITEMS: LibraryItem[] = [
'Vertical sidebar navigation with collapsible groups and active states.',
category: 'Navigation',
type: 'Pattern',
- imageUrl:
- '/template-assets/moody-lifestyle-horizontal-1.png',
+ imageUrl: '/template-assets/moody-lifestyle-horizontal-1.png',
},
{
id: '16',
@@ -178,8 +163,7 @@ const ITEMS: LibraryItem[] = [
description: 'Path trail navigation with separator and truncation support.',
category: 'Navigation',
type: 'Component',
- imageUrl:
- '/template-assets/colorful-home-horizontal-2.png',
+ imageUrl: '/template-assets/colorful-home-horizontal-2.png',
},
{
id: '17',
@@ -188,8 +172,7 @@ const ITEMS: LibraryItem[] = [
'Page navigation with prev/next controls and page count display.',
category: 'Navigation',
type: 'Component',
- imageUrl:
- '/template-assets/colorful-working-horizontal-1.png',
+ imageUrl: '/template-assets/colorful-working-horizontal-1.png',
},
{
id: '18',
@@ -198,8 +181,7 @@ const ITEMS: LibraryItem[] = [
'Bottom tab bar for mobile viewports with icon and label slots.',
category: 'Navigation',
type: 'Pattern',
- imageUrl:
- '/template-assets/light-working-horizontal-3.png',
+ imageUrl: '/template-assets/light-working-horizontal-3.png',
},
{
id: '19',
@@ -208,8 +190,7 @@ const ITEMS: LibraryItem[] = [
'Compact label for status, count, or category with semantic color variants.',
category: 'Feedback',
type: 'Component',
- imageUrl:
- '/template-assets/moody-working-horizontal-2.png',
+ imageUrl: '/template-assets/moody-working-horizontal-2.png',
},
{
id: '20',
@@ -218,8 +199,7 @@ const ITEMS: LibraryItem[] = [
'Full-width alert bar for info, success, warning, and error messages.',
category: 'Feedback',
type: 'Component',
- imageUrl:
- '/template-assets/illustrative-horizontal-2.jpg',
+ imageUrl: '/template-assets/illustrative-horizontal-2.jpg',
},
{
id: '21',
@@ -227,8 +207,7 @@ const ITEMS: LibraryItem[] = [
description: 'Animated loading indicator with size and color variants.',
category: 'Feedback',
type: 'Component',
- imageUrl:
- '/template-assets/colorful-lifestyle-horizontal-1.png',
+ imageUrl: '/template-assets/colorful-lifestyle-horizontal-1.png',
},
{
id: '22',
@@ -236,8 +215,7 @@ const ITEMS: LibraryItem[] = [
description: 'Horizontal bar indicating task completion percentage.',
category: 'Feedback',
type: 'Component',
- imageUrl:
- '/template-assets/light-lifestyle-horizontal-1.png',
+ imageUrl: '/template-assets/light-lifestyle-horizontal-1.png',
},
{
id: '23',
@@ -246,8 +224,7 @@ const ITEMS: LibraryItem[] = [
'Small dot indicator for presence, health, or pipeline status.',
category: 'Feedback',
type: 'Component',
- imageUrl:
- '/template-assets/moody-home-horizontal-1.png',
+ imageUrl: '/template-assets/moody-home-horizontal-1.png',
},
{
id: '24',
@@ -256,8 +233,7 @@ const ITEMS: LibraryItem[] = [
'Contextual label that appears on hover with configurable placement.',
category: 'Feedback',
type: 'Component',
- imageUrl:
- '/template-assets/colorful-working-horizontal-2.png',
+ imageUrl: '/template-assets/colorful-working-horizontal-2.png',
},
{
id: '25',
@@ -266,8 +242,7 @@ const ITEMS: LibraryItem[] = [
'Feature-rich data table with sorting, selection, and column resizing.',
category: 'Data',
type: 'Component',
- imageUrl:
- '/template-assets/illustrative-horizontal-4.jpg',
+ imageUrl: '/template-assets/illustrative-horizontal-4.jpg',
},
{
id: '26',
@@ -276,8 +251,7 @@ const ITEMS: LibraryItem[] = [
'User profile image with fallback initials and status dot support.',
category: 'Data',
type: 'Component',
- imageUrl:
- '/template-assets/light-working-horizontal-4.png',
+ imageUrl: '/template-assets/light-working-horizontal-4.png',
},
{
id: '27',
@@ -286,8 +260,7 @@ const ITEMS: LibraryItem[] = [
'Placeholder shimmer for loading states matching content shapes.',
category: 'Data',
type: 'Utility',
- imageUrl:
- '/template-assets/moody-lifestyle-horizontal-2.png',
+ imageUrl: '/template-assets/moody-lifestyle-horizontal-2.png',
},
{
id: '28',
@@ -295,8 +268,7 @@ const ITEMS: LibraryItem[] = [
description: 'Rich popover that appears on hover with arbitrary content.',
category: 'Data',
type: 'Component',
- imageUrl:
- '/template-assets/moody-scene-horizontal-2.png',
+ imageUrl: '/template-assets/moody-scene-horizontal-2.png',
},
{
id: '29',
@@ -305,8 +277,7 @@ const ITEMS: LibraryItem[] = [
'Command-palette style search with grouped results and keyboard nav.',
category: 'Data',
type: 'Pattern',
- imageUrl:
- '/template-assets/colorful-product-2.png',
+ imageUrl: '/template-assets/colorful-product-2.png',
},
{
id: '30',
@@ -315,8 +286,7 @@ const ITEMS: LibraryItem[] = [
'Autocomplete input with async suggestion loading and selection.',
category: 'Data',
type: 'Component',
- imageUrl:
- '/template-assets/moody-working-horizontal-3.png',
+ imageUrl: '/template-assets/moody-working-horizontal-3.png',
},
];
diff --git a/packages/cli/templates/pages/login-split/page.tsx b/packages/cli/templates/pages/login-split/page.tsx
index b44b537c91..cb408d54fe 100644
--- a/packages/cli/templates/pages/login-split/page.tsx
+++ b/packages/cli/templates/pages/login-split/page.tsx
@@ -23,21 +23,44 @@ import {
} from '@xds/core/theme/tokens.stylex';
// light-working-vertical-1 from xds_oss asset set
-const COVER_IMAGE_URL =
- '/template-assets/light-working-vertical-1.png';
+const COVER_IMAGE_URL = '/template-assets/light-working-vertical-1.png';
const AppleIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg viewBox="0 0 24 24" fill="currentColor" width={16} height={16} aria-hidden="true" {...props}>
+ <svg
+ viewBox="0 0 24 24"
+ fill="currentColor"
+ width={16}
+ height={16}
+ aria-hidden="true"
+ {...props}>
<path d="M17.05 20.28c-.98.95-2.05.88-3.08.4-1.09-.5-2.08-.48-3.24 0-1.44.62-2.2.44-3.06-.4C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z" />
</svg>
);
const GoogleIcon = (props: React.SVGProps<SVGSVGElement>) => (
- <svg viewBox="0 0 24 24" fill="currentColor" width={16} height={16} aria-hidden="true" {...props}>
- <path d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 01-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z" fill="#4285F4" />
- <path d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z" fill="#34A853" />
- <path d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z" fill="#FBBC05" />
- <path d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z" fill="#EA4335" />
+ <svg
+ viewBox="0 0 24 24"
+ fill="currentColor"
+ width={16}
+ height={16}
+ aria-hidden="true"
+ {...props}>
+ <path
+ d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 01-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z"
+ fill="#4285F4"
+ />
+ <path
+ d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"
+ fill="#34A853"
+ />
+ <path
+ d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"
+ fill="#FBBC05"
+ />
+ <path
+ d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"
+ fill="#EA4335"
+ />
</svg>
);
@@ -93,7 +116,9 @@ export default function LoginTwoColumn() {
<XDSVStack xstyle={styles.formColumn}>
<XDSHStack gap={2} vAlign="center">
<XDSIcon icon={SquaresPlusIcon} />
- <XDSText type="body" weight="bold">Product Inc.</XDSText>
+ <XDSText type="body" weight="bold">
+ Product Inc.
+ </XDSText>
</XDSHStack>
<XDSStackItem size="fill">
@@ -105,102 +130,104 @@ export default function LoginTwoColumn() {
icon={<CheckCircleIcon width={48} height={48} />}
/>
) : (
- <XDSVStack gap={4} xstyle={styles.fullWidth}>
- <XDSVStack gap={1}>
- <XDSText type="display-1" as="h2">Welcome back</XDSText>
- <XDSText type="body" color="secondary" size="sm">
- Login to your Product Inc. account
- </XDSText>
- </XDSVStack>
-
- <XDSVStack gap={2}>
- <XDSTextInput
- label="Email"
- isLabelHidden
- type="email"
- placeholder="[email protected]"
- value={email}
- onChange={setEmail}
- size="lg"
- />
+ <XDSVStack gap={4} xstyle={styles.fullWidth}>
<XDSVStack gap={1}>
+ <XDSText type="display-1" as="h2">
+ Welcome back
+ </XDSText>
+ <XDSText type="body" color="secondary" size="sm">
+ Login to your Product Inc. account
+ </XDSText>
+ </XDSVStack>
+
+ <XDSVStack gap={2}>
<XDSTextInput
- label="Password"
+ label="Email"
isLabelHidden
- placeholder="Enter your password"
- type="password"
- value={password}
- onChange={(v: string) => {
- setPassword(v);
- setLoginFailed(false);
- }}
+ type="email"
+ placeholder="[email protected]"
+ value={email}
+ onChange={setEmail}
size="lg"
- status={
- loginFailed
- ? {
- type: 'error',
- message: 'Incorrect password. Try again.',
- }
- : undefined
- }
/>
- {loginFailed && (
- <XDSVStack hAlign="end">
- <XDSLink
- href="#"
- size="sm"
- color="secondary"
- type="supporting">
- Forgot your password?
- </XDSLink>
- </XDSVStack>
- )}
+ <XDSVStack gap={1}>
+ <XDSTextInput
+ label="Password"
+ isLabelHidden
+ placeholder="Enter your password"
+ type="password"
+ value={password}
+ onChange={(v: string) => {
+ setPassword(v);
+ setLoginFailed(false);
+ }}
+ size="lg"
+ status={
+ loginFailed
+ ? {
+ type: 'error',
+ message: 'Incorrect password. Try again.',
+ }
+ : undefined
+ }
+ />
+ {loginFailed && (
+ <XDSVStack hAlign="end">
+ <XDSLink
+ href="#"
+ size="sm"
+ color="secondary"
+ type="supporting">
+ Forgot your password?
+ </XDSLink>
+ </XDSVStack>
+ )}
+ </XDSVStack>
</XDSVStack>
- </XDSVStack>
- <XDSButton
- label="Login"
- variant="primary"
- size="lg"
- isLoading={isLoading}
- xstyle={styles.fullWidth}
- onClick={handleLogin}
- />
+ <XDSButton
+ label="Login"
+ variant="primary"
+ size="lg"
+ isLoading={isLoading}
+ xstyle={styles.fullWidth}
+ onClick={handleLogin}
+ />
- <XDSDivider label="Or continue with" />
+ <XDSDivider label="Or continue with" />
- <XDSHStack gap={3}>
- <XDSStackItem size="fill">
- <XDSButton
- label="Apple"
- variant="secondary"
- icon={<AppleIcon />}
- size="lg"
- xstyle={styles.fullWidth}
- />
- </XDSStackItem>
- <XDSStackItem size="fill">
- <XDSButton
- label="Google"
- variant="secondary"
- icon={<GoogleIcon />}
- size="lg"
- xstyle={styles.fullWidth}
- />
- </XDSStackItem>
- </XDSHStack>
- </XDSVStack>
+ <XDSHStack gap={3}>
+ <XDSStackItem size="fill">
+ <XDSButton
+ label="Apple"
+ variant="secondary"
+ icon={<AppleIcon />}
+ size="lg"
+ xstyle={styles.fullWidth}
+ />
+ </XDSStackItem>
+ <XDSStackItem size="fill">
+ <XDSButton
+ label="Google"
+ variant="secondary"
+ icon={<GoogleIcon />}
+ size="lg"
+ xstyle={styles.fullWidth}
+ />
+ </XDSStackItem>
+ </XDSHStack>
+ </XDSVStack>
)}
</XDSCenter>
</XDSStackItem>
{!isSuccess && (
- <XDSText type="supporting" color="secondary">
- Don&apos;t have an account?{' '}
- <XDSLink href="#" type="supporting">
- Sign up
- </XDSLink>
- </XDSText>
+ <XDSText type="supporting" color="secondary">
+ Don&apos;t have an account?{' '}
+ <XDSLink href="#" type="supporting">
+ Sign up
+ </XDSLink>
+ </XDSText>
)}
</XDSVStack>
diff --git a/packages/cli/templates/pages/product-gallery/page.tsx b/packages/cli/templates/pages/product-gallery/page.tsx
index 13f5eecbe7..783708bd03 100644
--- a/packages/cli/templates/pages/product-gallery/page.tsx
+++ b/packages/cli/templates/pages/product-gallery/page.tsx
@@ -42,8 +42,7 @@ const PRODUCTS: Product[] = [
"Sometimes all it takes is one small thing to turn your whole day around. That's what good design is for.",
price: 75.0,
// illustrative-horizontal-1 from xds_oss asset set
- image:
- '/template-assets/illustrative-horizontal-1.jpg',
+ image: '/template-assets/illustrative-horizontal-1.jpg',
},
{
id: 2,
@@ -52,8 +51,7 @@ const PRODUCTS: Product[] = [
"Sometimes all it takes is one small thing to turn your whole day around. That's what good design is for.",
price: 80.0,
// illustrative-vertical-1 from xds_oss asset set
- image:
- '/template-assets/illustrative-vertical-1.jpg',
+ image: '/template-assets/illustrative-vertical-1.jpg',
},
{
id: 3,
@@ -62,8 +60,7 @@ const PRODUCTS: Product[] = [
"Sometimes all it takes is one small thing to turn your whole day around. That's what good design is for.",
price: 75.0,
// illustrative-horizontal-3 from xds_oss asset set
- image:
- '/template-assets/illustrative-horizontal-3.jpg',
+ image: '/template-assets/illustrative-horizontal-3.jpg',
},
{
id: 4,
@@ -72,8 +69,7 @@ const PRODUCTS: Product[] = [
"Sometimes all it takes is one small thing to turn your whole day around. That's what good design is for.",
price: 75.0,
// illustrative-horizontal-4 from xds_oss asset set
- image:
- '/template-assets/illustrative-horizontal-4.jpg',
+ image: '/template-assets/illustrative-horizontal-4.jpg',
},
{
id: 5,
@@ -82,8 +78,7 @@ const PRODUCTS: Product[] = [
"Sometimes all it takes is one small thing to turn your whole day around. That's what good design is for.",
price: 60.0,
// illustrative-horizontal-5 from xds_oss asset set
- image:
- '/template-assets/illustrative-horizontal-5.jpg',
+ image: '/template-assets/illustrative-horizontal-5.jpg',
},
{
id: 6,
@@ -92,8 +87,7 @@ const PRODUCTS: Product[] = [
"Sometimes all it takes is one small thing to turn your whole day around. That's what good design is for.",
price: 80.0,
// illustrative-horizontal-2 from xds_oss asset set
- image:
- '/template-assets/illustrative-horizontal-2.jpg',
+ image: '/template-assets/illustrative-horizontal-2.jpg',
},
];
diff --git a/packages/core/src/Carousel/XDSCarousel.tsx b/packages/core/src/Carousel/XDSCarousel.tsx
index 37bed3a59a..884cd88e97 100644
--- a/packages/core/src/Carousel/XDSCarousel.tsx
+++ b/packages/core/src/Carousel/XDSCarousel.tsx
@@ -173,17 +173,50 @@ const gapStyles = stylex.create({
});
const paddingStyles = stylex.create({
- 0: {paddingInline: spacingVars['--spacing-0'], scrollPaddingInline: spacingVars['--spacing-0']},
- 0.5: {paddingInline: spacingVars['--spacing-0-5'], scrollPaddingInline: spacingVars['--spacing-0-5']},
- 1: {paddingInline: spacingVars['--spacing-1'], scrollPaddingInline: spacingVars['--spacing-1']},
- 1.5: {paddingInline: spacingVars['--spacing-1-5'], scrollPaddingInline: spacingVars['--spacing-1-5']},
- 2: {paddingInline: spacingVars['--spacing-2'], scrollPaddingInline: spacingVars['--spacing-2']},
- 3: {paddingInline: spacingVars['--spacing-3'], scrollPaddingInline: spacingVars['--spacing-3']},
- 4: {paddingInline: spacingVars['--spacing-4'], scrollPaddingInline: spacingVars['--spacing-4']},
- 5: {paddingInline: spacingVars['--spacing-5'], scrollPaddingInline: spacingVars['--spacing-5']},
- 6: {paddingInline: spacingVars['--spacing-6'], scrollPaddingInline: spacingVars['--spacing-6']},
- 8: {paddingInline: spacingVars['--spacing-8'], scrollPaddingInline: spacingVars['--spacing-8']},
- 10: {paddingInline: spacingVars['--spacing-10'], scrollPaddingInline: spacingVars['--spacing-10']},
+ 0: {
+ paddingInline: spacingVars['--spacing-0'],
+ scrollPaddingInline: spacingVars['--spacing-0'],
+ },
+ 0.5: {
+ paddingInline: spacingVars['--spacing-0-5'],
+ scrollPaddingInline: spacingVars['--spacing-0-5'],
+ },
+ 1: {
+ paddingInline: spacingVars['--spacing-1'],
+ scrollPaddingInline: spacingVars['--spacing-1'],
+ },
+ 1.5: {
+ paddingInline: spacingVars['--spacing-1-5'],
+ scrollPaddingInline: spacingVars['--spacing-1-5'],
+ },
+ 2: {
+ paddingInline: spacingVars['--spacing-2'],
+ scrollPaddingInline: spacingVars['--spacing-2'],
+ },
+ 3: {
+ paddingInline: spacingVars['--spacing-3'],
+ scrollPaddingInline: spacingVars['--spacing-3'],
+ },
+ 4: {
+ paddingInline: spacingVars['--spacing-4'],
+ scrollPaddingInline: spacingVars['--spacing-4'],
+ },
+ 5: {
+ paddingInline: spacingVars['--spacing-5'],
+ scrollPaddingInline: spacingVars['--spacing-5'],
+ },
+ 6: {
+ paddingInline: spacingVars['--spacing-6'],
+ scrollPaddingInline: spacingVars['--spacing-6'],
+ },
+ 8: {
+ paddingInline: spacingVars['--spacing-8'],
+ scrollPaddingInline: spacingVars['--spacing-8'],
+ },
+ 10: {
+ paddingInline: spacingVars['--spacing-10'],
+ scrollPaddingInline: spacingVars['--spacing-10'],
+ },
});
// =============================================================================