Skip to content

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

TypeScript

refactor: move Card, Section, Stack to own modules and flatten Layout (#229)

Cindy Zhang45dd288152ac
diff --git a/apps/storybook/stories/Card.stories.tsx b/apps/storybook/stories/Card.stories.tsx
index 150aeb72a1..a07d80504d 100644
--- a/apps/storybook/stories/Card.stories.tsx
+++ b/apps/storybook/stories/Card.stories.tsx
@@ -1,7 +1,10 @@
import type {Meta, StoryObj} from '@storybook/react';
import * as stylex from '@stylexjs/stylex';
-import {XDSCard, XDSSection, XDSVStack, XDSHStack} from '@xds/core/Layout';
+import {XDSCard} from '@xds/core/Card';
+import {XDSSection} from '@xds/core/Section';
import {
+ XDSVStack,
+ XDSHStack,
XDSLayout,
XDSLayoutHeader,
XDSLayoutContent,
diff --git a/apps/storybook/stories/Center.stories.tsx b/apps/storybook/stories/Center.stories.tsx
index 6813afdced..962cfe70bd 100644
--- a/apps/storybook/stories/Center.stories.tsx
+++ b/apps/storybook/stories/Center.stories.tsx
@@ -1,7 +1,8 @@
import type {Meta, StoryObj} from '@storybook/react';
import * as stylex from '@stylexjs/stylex';
import {XDSCenter} from '@xds/core/Center';
-import {XDSCard, XDSSection} from '@xds/core/Layout';
+import {XDSCard} from '@xds/core/Card';
+import {XDSSection} from '@xds/core/Section';
import {XDSIcon} from '@xds/core/Icon';
import {XDSText} from '@xds/core/Text';
import {CheckCircleIcon} from '@heroicons/react/24/outline';
diff --git a/apps/storybook/stories/Divider.stories.tsx b/apps/storybook/stories/Divider.stories.tsx
index 170cf18d6b..b8506ba520 100644
--- a/apps/storybook/stories/Divider.stories.tsx
+++ b/apps/storybook/stories/Divider.stories.tsx
@@ -1,7 +1,9 @@
import type {Meta, StoryObj} from '@storybook/react';
import * as stylex from '@stylexjs/stylex';
import {XDSDivider} from '@xds/core/Divider';
-import {XDSVStack, XDSHStack, XDSCard, XDSSection} from '@xds/core/Layout';
+import {XDSCard} from '@xds/core/Card';
+import {XDSSection} from '@xds/core/Section';
+import {XDSVStack, XDSHStack} from '@xds/core/Layout';
import {XDSText} from '@xds/core/Text';
import {spacingVars} from '@xds/core/theme/tokens.stylex';
diff --git a/apps/storybook/stories/Grid.stories.tsx b/apps/storybook/stories/Grid.stories.tsx
index 8f07f62cf2..1116da3777 100644
--- a/apps/storybook/stories/Grid.stories.tsx
+++ b/apps/storybook/stories/Grid.stories.tsx
@@ -1,7 +1,8 @@
import type {Meta, StoryObj} from '@storybook/react';
import * as stylex from '@stylexjs/stylex';
import {XDSGrid, XDSGridSpan} from '@xds/core/Grid';
-import {XDSCard, XDSSection} from '@xds/core/Layout';
+import {XDSCard} from '@xds/core/Card';
+import {XDSSection} from '@xds/core/Section';
import {XDSText} from '@xds/core/Text';
import {
colorVars,
diff --git a/apps/storybook/stories/Layout.stories.tsx b/apps/storybook/stories/Layout.stories.tsx
index daa4ca7175..4d92f8e0d2 100644
--- a/apps/storybook/stories/Layout.stories.tsx
+++ b/apps/storybook/stories/Layout.stories.tsx
@@ -1,5 +1,7 @@
import type {Meta, StoryObj} from '@storybook/react';
import * as stylex from '@stylexjs/stylex';
+import {XDSCard} from '@xds/core/Card';
+import {XDSSection} from '@xds/core/Section';
import {
XDSLayout,
XDSLayoutHeader,
@@ -7,8 +9,6 @@ import {
XDSLayoutContent,
XDSLayoutPanel,
container,
- XDSCard,
- XDSSection,
XDSHStack,
XDSVStack,
} from '@xds/core/Layout';
diff --git a/apps/storybook/stories/Section.stories.tsx b/apps/storybook/stories/Section.stories.tsx
index f7c9d9f990..5346e21dff 100644
--- a/apps/storybook/stories/Section.stories.tsx
+++ b/apps/storybook/stories/Section.stories.tsx
@@ -1,6 +1,7 @@
import type {Meta, StoryObj} from '@storybook/react';
import * as stylex from '@stylexjs/stylex';
-import {XDSSection, XDSVStack, XDSHStack} from '@xds/core/Layout';
+import {XDSSection} from '@xds/core/Section';
+import {XDSVStack, XDSHStack} from '@xds/core/Layout';
import {
XDSLayout,
XDSLayoutHeader,
diff --git a/apps/storybook/stories/Skeleton.stories.tsx b/apps/storybook/stories/Skeleton.stories.tsx
index f4102d553c..eab4cc2560 100644
--- a/apps/storybook/stories/Skeleton.stories.tsx
+++ b/apps/storybook/stories/Skeleton.stories.tsx
@@ -1,6 +1,7 @@
-import type { Meta, StoryObj } from '@storybook/react';
-import { XDSSkeleton } from '@xds/core/Skeleton';
-import { XDSHStack, XDSVStack, XDSCard } from '@xds/core/Layout';
+import type {Meta, StoryObj} from '@storybook/react';
+import {XDSSkeleton} from '@xds/core/Skeleton';
+import {XDSCard} from '@xds/core/Card';
+import {XDSHStack, XDSVStack} from '@xds/core/Layout';
const meta: Meta<typeof XDSSkeleton> = {
title: 'Core/XDSSkeleton',
@@ -21,7 +22,7 @@ const meta: Meta<typeof XDSSkeleton> = {
description: 'Border radius using design tokens',
},
index: {
- control: { type: 'number', min: 0, max: 10, step: 1 },
+ control: {type: 'number', min: 0, max: 10, step: 1},
description: 'Index for staggered animation timing',
},
},
@@ -86,7 +87,7 @@ export const CardSkeleton: Story = {
export const TableRowSkeleton: Story = {
render: () => (
<XDSVStack gap="space2">
- {[0, 1, 2, 3].map((rowIndex) => (
+ {[0, 1, 2, 3].map(rowIndex => (
<XDSHStack key={rowIndex} gap="space4" vAlign="center">
<XDSSkeleton width={50} height={16} index={rowIndex * 4} />
<XDSSkeleton width={180} height={16} index={rowIndex * 4 + 1} />
diff --git a/packages/core/package.json b/packages/core/package.json
index 4cdf04db66..23a7f9f7a4 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -35,6 +35,11 @@
"import": "./dist/Button/index.mjs",
"require": "./dist/Button/index.js"
},
+ "./Card": {
+ "types": "./dist/Card/index.d.ts",
+ "import": "./dist/Card/index.mjs",
+ "require": "./dist/Card/index.js"
+ },
"./Calendar": {
"types": "./dist/Calendar/index.d.ts",
"import": "./dist/Calendar/index.mjs",
@@ -60,11 +65,21 @@
"import": "./dist/Icon/index.mjs",
"require": "./dist/Icon/index.js"
},
+ "./Section": {
+ "types": "./dist/Section/index.d.ts",
+ "import": "./dist/Section/index.mjs",
+ "require": "./dist/Section/index.js"
+ },
"./Selector": {
"types": "./dist/Selector/index.d.ts",
"import": "./dist/Selector/index.mjs",
"require": "./dist/Selector/index.js"
},
+ "./Stack": {
+ "types": "./dist/Stack/index.d.ts",
+ "import": "./dist/Stack/index.mjs",
+ "require": "./dist/Stack/index.js"
+ },
"./Layout": {
"types": "./dist/Layout/index.d.ts",
"import": "./dist/Layout/index.mjs",
diff --git a/packages/core/src/Card/README.md b/packages/core/src/Card/README.md
new file mode 100644
index 0000000000..042a0ea6fd
--- /dev/null
+++ b/packages/core/src/Card/README.md
@@ -0,0 +1,66 @@
+# /packages/core/src/Card
+
+Card container component with elevation and themed styling.
+
+<!-- SYNC: When files in this directory change, update this document. -->
+
+## Overview
+
+XDSCard is a top-level container for elevated content. It provides card-specific appearance (background, shadow, border-radius) and sets CSS variables for child layout components.
+
+## Import
+
+```tsx
+import {XDSCard} from '@xds/core/Card';
+```
+
+## Usage
+
+```tsx
+<XDSCard width={400} height={300}>
+ <XDSLayout
+ header={<XDSLayoutHeader hasDivider>Title</XDSLayoutHeader>}
+ content={<XDSLayoutContent>Content</XDSLayoutContent>}
+ footer={<XDSLayoutFooter hasDivider>Actions</XDSLayoutFooter>}
+ />
+</XDSCard>
+```
+
+## Props
+
+| Prop | Type | Default | Description |
+| ------------- | ----------- | ------- | ------------------------------------------------- |
+| `width` | `SizeValue` | — | Width (number = pixels, string = as-is) |
+| `height` | `SizeValue` | — | Height (number = pixels, string = as-is) |
+| `maxWidth` | `SizeValue` | — | Maximum width |
+| `minHeight` | `SizeValue` | — | Minimum height |
+| `children` | `ReactNode` | — | Content (typically XDSLayout) |
+| `isFullBleed` | `boolean` | `false` | Removes internal padding for edge-to-edge content |
+
+## Types
+
+```tsx
+// Size value type - accepts numbers (pixels) or strings (CSS values)
+type SizeValue = number | string;
+```
+
+## Theming
+
+```tsx
+declare module '@xds/core' {
+ interface ComponentStyles {
+ card?: {
+ container?: StyleXStyles;
+ content?: StyleXStyles;
+ };
+ }
+}
+```
+
+## Files
+
+| File | Role | Purpose |
+| ------------- | --------- | ----------------------------- |
+| `index.ts` | Entry | Exports component and types |
+| `XDSCard.tsx` | Component | Card container implementation |
+| `README.md` | Docs | This documentation |
diff --git a/packages/core/src/Layout/Container/XDSCard.tsx b/packages/core/src/Card/XDSCard.tsx
similarity index 85%
rename from packages/core/src/Layout/Container/XDSCard.tsx
rename to packages/core/src/Card/XDSCard.tsx
index 0187571a72..9dd763704d 100644
--- a/packages/core/src/Layout/Container/XDSCard.tsx
+++ b/packages/core/src/Card/XDSCard.tsx
@@ -2,21 +2,27 @@
* @file XDSCard.tsx
* @input Uses container utility, StyleX, ThemeContext
* @output Exports XDSCard component and XDSCardProps
- * @position Higher-order container component for card layouts
+ * @position Core card container component
+ *
+ * SYNC: When modified, update these files to stay in sync:
+ * - /packages/core/src/Card/README.md (props table, features)
+ * - /packages/core/src/Card/index.ts (exports if types change)
+ * - /apps/storybook/stories/Card.stories.tsx (storybook stories)
*/
import {forwardRef, useContext, type ReactNode} from 'react';
import * as stylex from '@stylexjs/stylex';
-import {colorVars, radiusVars, elevationVars} from '../../theme/tokens.stylex';
-import {ThemeContext} from '../../theme/ThemeContext';
-import type {StyleXStyles as ThemeStyleXStyles} from '../../theme/types';
-import {container} from './container.stylex';
+import {colorVars, radiusVars, elevationVars} from '../theme/tokens.stylex';
+import {ThemeContext} from '../theme/ThemeContext';
+import type {StyleXStyles as ThemeStyleXStyles} from '../theme/types';
+import {container} from '../Layout/container.stylex';
+import type {SizeValue} from '../utils/types';
// =============================================================================
// Module Augmentation - Register XDSCard's themeable properties
// =============================================================================
-declare module '../../theme/types' {
+declare module '../theme/types' {
interface ComponentStyles {
card?: {
/** Outer container styles (background, border, shadow, border-radius) */
@@ -74,10 +80,7 @@ const dynamicStyles = stylex.create({
}),
});
-/**
- * Size value type - accepts numbers (treated as pixels) or strings (e.g., '100%', '50vh')
- */
-export type SizeValue = number | string;
+export type {SizeValue} from '../utils/types';
export interface XDSCardProps {
/**
@@ -123,6 +126,9 @@ export interface XDSCardProps {
* Applies card-specific appearance (background, shadow, border-radius)
* and sets CSS variables for child layout components.
*
+ * @compositionHint Use as a top-level container for elevated content.
+ * Pair with XDSLayout for structured header/content/footer layouts.
+ *
* @example
* ```tsx
* <XDSCard width={400} height={300}>
diff --git a/packages/core/src/Card/index.ts b/packages/core/src/Card/index.ts
new file mode 100644
index 0000000000..af25b12d5e
--- /dev/null
+++ b/packages/core/src/Card/index.ts
@@ -0,0 +1,11 @@
+/**
+ * @file index.ts
+ * @input Imports XDSCard component
+ * @output Exports XDSCard component and types
+ * @position Entry point for @xds/core/Card module
+ *
+ * SYNC: When modified, update /packages/core/src/Card/README.md
+ */
+
+export {XDSCard} from './XDSCard';
+export type {XDSCardProps, SizeValue} from './XDSCard';
diff --git a/packages/core/src/Center/XDSCenter.tsx b/packages/core/src/Center/XDSCenter.tsx
index d9e9350e0b..12b2516da6 100644
--- a/packages/core/src/Center/XDSCenter.tsx
+++ b/packages/core/src/Center/XDSCenter.tsx
@@ -13,7 +13,7 @@
import {forwardRef, type HTMLAttributes, type ReactNode} from 'react';
import * as stylex from '@stylexjs/stylex';
import type {StyleXStyles} from '@stylexjs/stylex';
-import type {SizeValue} from '../Layout';
+import type {SizeValue} from '../utils/types';
const styles = stylex.create({
base: {
diff --git a/packages/core/src/Dialog/XDSDialogHeader.tsx b/packages/core/src/Dialog/XDSDialogHeader.tsx
index 7e44e844f8..5862af9ee2 100644
--- a/packages/core/src/Dialog/XDSDialogHeader.tsx
+++ b/packages/core/src/Dialog/XDSDialogHeader.tsx
@@ -14,7 +14,7 @@
import {forwardRef, useEffect, useRef, type ReactNode} from 'react';
import * as stylex from '@stylexjs/stylex';
import {spacingVars} from '../theme/tokens.stylex';
-import {XDSLayoutHeader} from '../Layout/XDSLayout/XDSLayoutHeader';
+import {XDSLayoutHeader} from '../Layout/XDSLayoutHeader';
import {XDSCloseButton} from '../CloseButton';
import {XDSHeading} from '../Text/XDSHeading';
import {XDSText} from '../Text/XDSText';
diff --git a/packages/core/src/Grid/XDSGrid.tsx b/packages/core/src/Grid/XDSGrid.tsx
index c09266afe4..086fbe5259 100644
--- a/packages/core/src/Grid/XDSGrid.tsx
+++ b/packages/core/src/Grid/XDSGrid.tsx
@@ -14,7 +14,8 @@ import {forwardRef, type HTMLAttributes, type ReactNode} from 'react';
import * as stylex from '@stylexjs/stylex';
import type {StyleXStyles} from '@stylexjs/stylex';
import {spacingVars} from '../theme/tokens.stylex';
-import type {SpacingScale, SizeValue} from '../Layout';
+import type {SpacingScale} from '../Layout';
+import type {SizeValue} from '../utils/types';
/**
* Grid alignment options for align-items and justify-items.
diff --git a/packages/core/src/Layout/Container/README.md b/packages/core/src/Layout/Container/README.md
deleted file mode 100644
index dd3b6f3246..0000000000
--- a/packages/core/src/Layout/Container/README.md
+++ /dev/null
@@ -1,169 +0,0 @@
-# /packages/core/src/Layout/Container
-
-Layout container components: a primitive and higher-order containers for cards and sections.
-
-<!-- SYNC: When files in this directory change, update this document. -->
-
-## Overview
-
-This folder contains:
-
-- **XDSLayoutContainer** — A primitive that sets CSS variables for padding
-- **XDSCard** — Higher-order component with card styling (elevation, radius)
-- **XDSSection** — Higher-order component with background variants
-
-## Import
-
-```tsx
-import {XDSLayoutContainer, XDSCard, XDSSection} from '@xds/core/Layout';
-```
-
-## Components
-
-### Types
-
-```tsx
-// Size value type - accepts numbers (pixels) or strings (CSS values)
-type SizeValue = number | string;
-
-// Examples:
-// width={400} → "400px"
-// width="100%" → "100%"
-// width="50vh" → "50vh"
-```
-
-### XDSCard
-
-A card container with elevation and themed styling. Use for elevated content containers.
-
-```tsx
-<XDSCard width={400} height={300}>
- <XDSLayout
- header={<XDSLayoutHeader hasDivider>Title</XDSLayoutHeader>}
- content={<XDSLayoutContent>Content</XDSLayoutContent>}
- footer={<XDSLayoutFooter hasDivider>Actions</XDSLayoutFooter>}
- />
-</XDSCard>
-```
-
-| Prop | Type | Default | Description |
-| ----------- | ----------- | ------- | ---------------------------------------- |
-| `width` | `SizeValue` | — | Width (number = pixels, string = as-is) |
-| `height` | `SizeValue` | — | Height (number = pixels, string = as-is) |
-| `maxWidth` | `SizeValue` | — | Maximum width |
-| `minHeight` | `SizeValue` | — | Minimum height |
-| `children` | `ReactNode` | — | Content (typically XDSLayout) |
-
-### XDSSection
-
-A section container with background variants. Use for content sections within a page.
-
-```tsx
-<XDSSection variant="wash" width={300} height={250}>
- <XDSLayout
- content={<XDSLayoutContent>Content in wash section</XDSLayoutContent>}
- />
-</XDSSection>
-```
-
-| Prop | Type | Default | Description |
-| ----------- | -------------------------------------- | ----------- | ---------------------------------------- |
-| `variant` | `'section' \| 'transparent' \| 'wash'` | `'section'` | Background variant |
-| `width` | `SizeValue` | — | Width (number = pixels, string = as-is) |
-| `height` | `SizeValue` | — | Height (number = pixels, string = as-is) |
-| `maxWidth` | `SizeValue` | — | Maximum width |
-| `minHeight` | `SizeValue` | — | Minimum height |
-| `children` | `ReactNode` | — | Content |
-
-**Variants:**
-
-| Variant | Background |
-| ------------- | ------------- |
-| `section` | Surface color |
-| `transparent` | Transparent |
-| `wash` | Wash color |
-
-### XDSLayoutContainer (Primitive)
-
-A low-level primitive that sets CSS variables for layout padding. Prefer XDSCard or XDSSection for most use cases.
-
-```tsx
-// Direct usage is rare - prefer higher-order components
-<XDSLayoutContainer
- xstyle={customStyles}
- paddingInnerX="space3"
- paddingInnerY="space3"
->
- <XDSLayout ... />
-</XDSLayoutContainer>
-```
-
-| Prop | Type | Default | Description |
-| --------------- | -------------- | ---------- | -------------------------------------------------- |
-| `xstyle` | `StyleXStyles` | — | Custom styles (background, shadow, radius, sizing) |
-| `paddingOuterX` | `SpacingToken` | `'space4'` | Outer horizontal padding |
-| `paddingOuterY` | `SpacingToken` | `'space4'` | Outer vertical padding |
-| `paddingInnerX` | `SpacingToken` | `'space4'` | Inner horizontal padding for content areas |
-| `paddingInnerY` | `SpacingToken` | `'space4'` | Inner vertical padding for content areas |
-| `children` | `ReactNode` | — | Content |
-
-**CSS Variables Set:**
-
-- `--layout-padding-outer-x`, `--layout-padding-outer-y` — Used by XDSLayout for fullBleed calculations
-- `--layout-padding-inner-x`, `--layout-padding-inner-y` — Used by content areas (Header, Footer, Content, Panel)
-
-## Files
-
-| File | Role | Purpose |
-| ------------------------ | --------- | ---------------------------------- |
-| `index.ts` | Entry | Exports all components and types |
-| `XDSLayoutContainer.tsx` | Primitive | Base container, sets CSS variables |
-| `XDSCard.tsx` | Component | Card with elevation |
-| `XDSSection.tsx` | Component | Section with background variants |
-| `README.md` | Docs | This documentation |
-
-## Theming
-
-Higher-order components support theme-level overrides:
-
-```tsx
-// XDSCard theming
-declare module '@xds/core' {
- interface ComponentStyles {
- card?: {base?: StyleXStyles};
- }
-}
-
-// XDSSection theming
-declare module '@xds/core' {
- interface ComponentStyles {
- section?: {variants?: Partial<Record<XDSSectionVariant, StyleXStyles>>};
- }
-}
-```
-
-Themes can override padding by setting the CSS variables in their style overrides:
-
-```tsx
-const cardStyles = stylex.create({
- base: {
- '--layout-padding-inner-x': spacingTokens.space3,
- '--layout-padding-inner-y': spacingTokens.space3,
- },
-});
-```
-
-## Architecture
-
-```
-┌─────────────────────────────────────────────────────────┐
-│ Higher-Order Components │
-│ XDSCard, XDSSection (and future: XDSModal, XDSPopover) │
-├─────────────────────────────────────────────────────────┤
-│ Primitive │
-│ XDSLayoutContainer │
-│ (Sets CSS variables, flex container) │
-└─────────────────────────────────────────────────────────┘
-```
-
-XDSCard and XDSSection wrap XDSLayoutContainer, adding their own styling. They expose explicit sizing props (width, height, maxWidth, minHeight) rather than xstyle for better introspectability. Padding values are fixed internally (not exposed as props).
diff --git a/packages/core/src/Layout/Container/index.ts b/packages/core/src/Layout/Container/index.ts
deleted file mode 100644
index a8af94bbc8..0000000000
--- a/packages/core/src/Layout/Container/index.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-/**
- * @file index.ts
- * @input Imports Container components
- * @output Exports XDSCard, XDSSection components and types
- * @position Entry point for Layout/Container module
- *
- * SYNC: When modified, update /packages/core/src/Layout/Container/README.md
- */
-
-export {XDSCard} from './XDSCard';
-export type {XDSCardProps, SizeValue} from './XDSCard';
-
-export {XDSSection} from './XDSSection';
-export type {XDSSectionProps, XDSSectionVariant} from './XDSSection';
diff --git a/packages/core/src/Layout/XDSLayout/XDSLayout.tsx b/packages/core/src/Layout/XDSLayout.tsx
similarity index 100%
rename from packages/core/src/Layout/XDSLayout/XDSLayout.tsx
rename to packages/core/src/Layout/XDSLayout.tsx
diff --git a/packages/core/src/Layout/XDSLayout/README.md b/packages/core/src/Layout/XDSLayout/README.md
deleted file mode 100644
index 6f4bf21db9..0000000000
--- a/packages/core/src/Layout/XDSLayout/README.md
+++ /dev/null
@@ -1,280 +0,0 @@
-# /packages/core/src/Layout/XDSLayout
-
-Page shell and app layout system with header, sidebar, content, and footer slots.
-
-<!-- SYNC: When files in this directory change, update this document. -->
-
-## When to use
-
-- Building a page with a sidebar → XDSLayout with `start` slot
-- Dashboard with header + scrollable body → XDSLayout with `header` + `content`
-- Settings page with nav panel → XDSLayout with `start` + `content`
-- App shell with top bar, side nav, and main area → XDSLayout with all slots
-- Card with header/body/footer sections → XDSLayout inside XDSCard
-
-Don't use XDSLayout for simple vertical/horizontal stacking — use XDSVStack/XDSHStack instead.
-
-## Overview
-
-The XDSLayout system provides a 5-slot layout structure for building page shells and structured layouts. It handles padding collapse between adjacent slots, scroll containment, and automatic RTL support. It follows a **zero styling** principle — no `xstyle` customization props.
-
-```
-┌─────────────────────────────────────────┐
-│ header │
-├──────┬─────────────────────────┬────────┤
-│ │ │ │
-│start │ content │ end │
-│ │ │ │
-├──────┴─────────────────────────┴────────┤
-│ footer │
-└─────────────────────────────────────────┘
-```
-
-## Import
-
-```tsx
-import {
- XDSCard,
- XDSSection,
- XDSLayout,
- XDSLayoutHeader,
- XDSLayoutFooter,
- XDSLayoutContent,
- XDSLayoutPanel,
-} from '@xds/core/Layout';
-```
-
-## Usage
-
-XDSLayout can be used standalone for page-level layouts, or inside a container
-component (XDSCard, XDSSection) for content-level layouts like cards with
-header/body/footer sections.
-
-### Full-page app shell with sidebar
-
-```tsx
-<XDSLayout
- header={<XDSLayoutHeader hasDivider>App Name</XDSLayoutHeader>}
- start={
- <XDSLayoutPanel hasDivider width={240} role="navigation">
- <Navigation />
- </XDSLayoutPanel>
- }
- content={
- <XDSLayoutContent role="main">
- <MainContent />
- </XDSLayoutContent>
- }
-/>
-```
-
-### App shell with XDSTopNav
-
-XDSLayout slots accept any component — you don't need to wrap in XDSLayoutHeader.
-Components like XDSTopNav that manage their own padding, height, and divider
-can go directly in the `header` slot:
-
-```tsx
-<XDSLayout
- header={
- <XDSTopNav
- label="Main navigation"
- title={<XDSTopNavTitle title="My App" logo={<Logo />} />}
- startContent={
- <>
- <XDSTopNavItem label="Home" href="/" isSelected />
- <XDSTopNavItem label="Settings" href="/settings" />
- </>
- }
- endContent={<Avatar />}
- />
- }
- start={
- <XDSLayoutPanel hasDivider width={240} role="navigation">
- <SideNav />
- </XDSLayoutPanel>
- }
- content={
- <XDSLayoutContent role="main">
- <MainContent />
- </XDSLayoutContent>
- }
-/>
-```
-
-Use XDSLayoutHeader when your header is simple content (a heading, buttons, etc.)
-that needs the layout's padding and divider management. Use XDSTopNav or other
-self-contained components directly when they handle their own chrome.
-
-### Dashboard with sidebar and detail panel
-
-```tsx
-<XDSLayout
- header={<XDSLayoutHeader hasDivider>Dashboard</XDSLayoutHeader>}
- start={
- <XDSLayoutPanel hasDivider width={200} role="navigation">
- <Navigation />
- </XDSLayoutPanel>
- }
- content={<XDSLayoutContent>Main content</XDSLayoutContent>}
- end={
- <XDSLayoutPanel hasDivider width={300} role="complementary">
- <DetailPanel />
- </XDSLayoutPanel>
- }
-/>
-```
-
-### Card with structured content
-
-```tsx
-<XDSCard>
- <XDSLayout
- header={<XDSLayoutHeader hasDivider>Page Title</XDSLayoutHeader>}
- content={<XDSLayoutContent>Main content here</XDSLayoutContent>}
- footer={<XDSLayoutFooter hasDivider>Actions</XDSLayoutFooter>}
- />
-</XDSCard>
-```
-
-### Full Bleed Content
-
-Use `isFullBleed` on XDSLayoutContent to remove internal padding, allowing content to touch the edges. Useful for tables, images, or other edge-to-edge content.
-
-```tsx
-<XDSCard>
- <XDSLayout
- header={<XDSLayoutHeader hasDivider>Users</XDSLayoutHeader>}
- content={
- <XDSLayoutContent isFullBleed>
- <Table />
- </XDSLayoutContent>
- }
- footer={<XDSLayoutFooter hasDivider>Actions</XDSLayoutFooter>}
- />
-</XDSCard>
-```
-
-### Section Variants
-
-```tsx
-<XDSSection variant="wash">
- <XDSLayout
- content={<XDSLayoutContent>Content in wash section</XDSLayoutContent>}
- />
-</XDSSection>
-```
-
-## Components
-
-| Component | Description | Renders |
-| ------------------ | ------------------------------------------------------------------------- | --------------------------------- |
-| `XDSLayout` | Page shell with header, sidebar(s), content, and footer slots | `<div>` |
-| `XDSLayoutHeader` | Top bar — page titles, app bars, toolbars | `<div>` (use `role` for landmark) |
-| `XDSLayoutFooter` | Bottom bar — action bars, pagination, status bars | `<div>` (use `role` for landmark) |
-| `XDSLayoutContent` | Scrollable main content area | `<div>` (use `role` for landmark) |
-| `XDSLayoutPanel` | Sidebar — navigation panels, settings sidebars, detail/inspector panels | `<div>` (use `role` for landmark) |
-
-## Props
-
-### XDSLayout
-
-| Prop | Type | Default | Description |
-| ------------- | ------------------ | -------- | ---------------------------------------------------------------------------------- |
-| `header` | `ReactNode` | — | Header slot content |
-| `footer` | `ReactNode` | — | Footer slot content |
-| `content` | `ReactNode` | — | Main content slot |
-| `start` | `ReactNode` | — | Start panel (left in LTR) |
-| `end` | `ReactNode` | — | End panel (right in LTR) |
-| `height` | `'fill' \| 'auto'` | `'fill'` | `fill`: layout fills container, content scrolls. `auto`: layout grows with content |
-| `isFullBleed` | `boolean` | `false` | Removes padding at layout's outer edges |
-
-### XDSLayoutHeader / XDSLayoutFooter
-
-| Prop | Type | Default | Description |
-| ------------- | ----------- | ------- | --------------------------------------------------------------------------------- |
-| `children` | `ReactNode` | — | Area content |
-| `hasDivider` | `boolean` | `false` | Adds themed border (bottom for header, top for footer) |
-| `isFullBleed` | `boolean` | `false` | Removes internal padding |
-| `label` | `string` | — | Accessible label for the landmark (required when multiple landmarks of same type) |
-| `role` | `AriaRole` | — | ARIA landmark role (e.g., `'banner'`, `'contentinfo'`) |
-
-### XDSLayoutContent
-
-| Prop | Type | Default | Description |
-| -------------- | ----------- | ------- | ---------------------------------------------------------------------------------------- |
-| `children` | `ReactNode` | — | Area content |
-| `isFullBleed` | `boolean` | `false` | Removes internal padding |
-| `isScrollable` | `boolean` | `true` | Enables scrollable overflow. Set to `false` for auto-height layouts with sticky elements |
-| `label` | `string` | — | Accessible label for the landmark |
-| `role` | `AriaRole` | — | ARIA landmark role (e.g., `'main'`) |
-
-### XDSLayoutPanel
-
-| Prop | Type | Default | Description |
-| ------------- | ----------- | ------- | --------------------------------------------------------------------------------- |
-| `children` | `ReactNode` | — | Area content |
-| `hasDivider` | `boolean` | `false` | Adds themed border (auto-positioned based on slot) |
-| `isFullBleed` | `boolean` | `false` | Removes internal padding |
-| `label` | `string` | — | Accessible label for the landmark (required when multiple landmarks of same type) |
-| `role` | `AriaRole` | — | ARIA landmark role (e.g., `'navigation'`, `'complementary'`) |
-
-## Files
-
-| File | Role | Purpose |
-| ------------------------- | --------- | -------------------------------- |
-| `index.ts` | Entry | Exports all components and types |
-| `XDSLayout.tsx` | Core | Main layout component |
-| `XDSLayoutHeader.tsx` | Component | Header content area |
-| `XDSLayoutFooter.tsx` | Component | Footer content area |
-| `XDSLayoutContent.tsx` | Component | Main content area |
-| `XDSLayoutPanel.tsx` | Component | Side panel component |
-| `XDSLayoutAreaContext.ts` | Context | Slot detection context |
-
-## Dividers
-
-`hasDivider` on content areas auto-places the divider on the correct edge:
-
-| Component | Divider Position |
-| ------------- | ---------------- |
-| Header | Bottom edge |
-| Footer | Top edge |
-| Panel (start) | End edge |
-| Panel (end) | Start edge |
-
-When `hasDivider` is false, spacing collapse is applied automatically for seamless visual flow.
-
-## Padding and Scroll
-
-Layout slot components (`XDSLayoutContent`, `XDSLayoutPanel`, `XDSLayoutHeader`, `XDSLayoutFooter`) provide their own padding and scroll containment. Don't add padding or overflow styles to their children — it will double up.
-
-```tsx
-// ✅ Correct — let the layout slot handle padding
-<XDSLayoutPanel hasDivider width={320}>
- <Navigation />
-</XDSLayoutPanel>
-
-// ❌ Wrong — padding doubles up with the panel's built-in padding
-<XDSLayoutPanel hasDivider width={320}>
- <div style={{ padding: 16, overflow: 'auto' }}>
- <Navigation />
- </div>
-</XDSLayoutPanel>
-```
-
-If you need to remove the built-in padding (e.g., for edge-to-edge tables or content that manages its own padding), use `isFullBleed`:
-
-```tsx
-<XDSLayoutContent isFullBleed>
- <Table />
-</XDSLayoutContent>
-```
-
-## RTL Support
-
-Uses CSS logical properties (`padding-inline`, `border-inline-start`, etc.) for automatic RTL support. The `start`/`end` naming ensures panels appear on the correct side in both LTR and RTL contexts.
-
-## Related
-
-- See `.context/proposals/layout-system.md` for full design proposal
-- See `../Stack/README.md` for stack primitives used internally
diff --git a/packages/core/src/Layout/XDSLayout/index.ts b/packages/core/src/Layout/XDSLayout/index.ts
deleted file mode 100644
index f7fd74d331..0000000000
--- a/packages/core/src/Layout/XDSLayout/index.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * @file index.ts
- * @input Imports layout components
- * @output Exports XDSLayout system components and types
- * @position Entry point for XDSLayout components
- *
- * SYNC: When modified, update /packages/core/src/Layout/XDSLayout/README.md
- */
-
-export {XDSLayout} from './XDSLayout';
-export type {XDSLayoutProps, XDSLayoutHeight} from './XDSLayout';
-
-export {XDSLayoutHeader} from './XDSLayoutHeader';
-export type {XDSLayoutHeaderProps} from './XDSLayoutHeader';
-
-export {XDSLayoutFooter} from './XDSLayoutFooter';
-export type {XDSLayoutFooterProps} from './XDSLayoutFooter';
-
-export {XDSLayoutContent} from './XDSLayoutContent';
-export type {XDSLayoutContentProps} from './XDSLayoutContent';
-
-export {XDSLayoutPanel} from './XDSLayoutPanel';
-export type {XDSLayoutPanelProps} from './XDSLayoutPanel';
-
-export {XDSLayoutAreaContext} from './XDSLayoutAreaContext';
-export type {LayoutArea} from './XDSLayoutAreaContext';
-
-export {XDSLayoutSlotsContext} from './XDSLayoutSlotsContext';
-export type {LayoutSlots} from './XDSLayoutSlotsContext';
diff --git a/packages/core/src/Layout/XDSLayout/XDSLayoutAreaContext.ts b/packages/core/src/Layout/XDSLayoutAreaContext.ts
similarity index 100%
rename from packages/core/src/Layout/XDSLayout/XDSLayoutAreaContext.ts
rename to packages/core/src/Layout/XDSLayoutAreaContext.ts
diff --git a/packages/core/src/Layout/XDSLayout/XDSLayoutContent.tsx b/packages/core/src/Layout/XDSLayoutContent.tsx
similarity index 98%
rename from packages/core/src/Layout/XDSLayout/XDSLayoutContent.tsx
rename to packages/core/src/Layout/XDSLayoutContent.tsx
index 2deca9a223..ce3058c2fe 100644
--- a/packages/core/src/Layout/XDSLayout/XDSLayoutContent.tsx
+++ b/packages/core/src/Layout/XDSLayoutContent.tsx
@@ -13,7 +13,7 @@
import type {AriaRole, HTMLAttributes, ReactNode} from 'react';
import {forwardRef, useContext} from 'react';
import * as stylex from '@stylexjs/stylex';
-import {spacingVars} from '../../theme/tokens.stylex';
+import {spacingVars} from '../theme/tokens.stylex';
import {XDSLayoutSlotsContext} from './XDSLayoutSlotsContext';
const styles = stylex.create({
diff --git a/packages/core/src/Layout/XDSLayout/XDSLayoutFooter.tsx b/packages/core/src/Layout/XDSLayoutFooter.tsx
similarity index 98%
rename from packages/core/src/Layout/XDSLayout/XDSLayoutFooter.tsx
rename to packages/core/src/Layout/XDSLayoutFooter.tsx
index 0ac602b357..75fddc66f5 100644
--- a/packages/core/src/Layout/XDSLayout/XDSLayoutFooter.tsx
+++ b/packages/core/src/Layout/XDSLayoutFooter.tsx
@@ -13,7 +13,7 @@
import type {AriaRole, HTMLAttributes, ReactNode} from 'react';
import {forwardRef} from 'react';
import * as stylex from '@stylexjs/stylex';
-import {colorVars, spacingVars} from '../../theme/tokens.stylex';
+import {colorVars, spacingVars} from '../theme/tokens.stylex';
const styles = stylex.create({
footer: {
diff --git a/packages/core/src/Layout/XDSLayout/XDSLayoutHeader.tsx b/packages/core/src/Layout/XDSLayoutHeader.tsx
similarity index 98%
rename from packages/core/src/Layout/XDSLayout/XDSLayoutHeader.tsx
rename to packages/core/src/Layout/XDSLayoutHeader.tsx
index 22b015ba46..c2d15fc7fd 100644
--- a/packages/core/src/Layout/XDSLayout/XDSLayoutHeader.tsx
+++ b/packages/core/src/Layout/XDSLayoutHeader.tsx
@@ -13,7 +13,7 @@
import type {AriaRole, HTMLAttributes, ReactNode} from 'react';
import {forwardRef} from 'react';
import * as stylex from '@stylexjs/stylex';
-import {colorVars, spacingVars} from '../../theme/tokens.stylex';
+import {colorVars, spacingVars} from '../theme/tokens.stylex';
const styles = stylex.create({
header: {
diff --git a/packages/core/src/Layout/XDSLayout/XDSLayoutPanel.tsx b/packages/core/src/Layout/XDSLayoutPanel.tsx
similarity index 99%
rename from packages/core/src/Layout/XDSLayout/XDSLayoutPanel.tsx
rename to packages/core/src/Layout/XDSLayoutPanel.tsx
index cc33c6992e..fac6e9d720 100644
--- a/packages/core/src/Layout/XDSLayout/XDSLayoutPanel.tsx
+++ b/packages/core/src/Layout/XDSLayoutPanel.tsx
@@ -13,7 +13,7 @@
import type {AriaRole, HTMLAttributes, ReactNode} from 'react';
import {forwardRef, useContext} from 'react';
import * as stylex from '@stylexjs/stylex';
-import {colorVars, spacingVars} from '../../theme/tokens.stylex';
+import {colorVars, spacingVars} from '../theme/tokens.stylex';
import {XDSLayoutAreaContext} from './XDSLayoutAreaContext';
import {XDSLayoutSlotsContext} from './XDSLayoutSlotsContext';
diff --git a/packages/core/src/Layout/XDSLayout/XDSLayoutSlotsContext.ts b/packages/core/src/Layout/XDSLayoutSlotsContext.ts
similarity index 100%
rename from packages/core/src/Layout/XDSLayout/XDSLayoutSlotsContext.ts
rename to packages/core/src/Layout/XDSLayoutSlotsContext.ts
diff --git a/packages/core/src/Layout/Container/container.stylex.ts b/packages/core/src/Layout/container.stylex.ts
similarity index 99%
rename from packages/core/src/Layout/Container/container.stylex.ts
rename to packages/core/src/Layout/container.stylex.ts
index 24d4d72571..7860e90c13 100644
--- a/packages/core/src/Layout/Container/container.stylex.ts
+++ b/packages/core/src/Layout/container.stylex.ts
@@ -8,7 +8,7 @@
*/
import * as stylex from '@stylexjs/stylex';
-import {spacingVars} from '../../theme/tokens.stylex';
+import {spacingVars} from '../theme/tokens.stylex';
/**
* Spacing token keys for padding props.
diff --git a/packages/core/src/Layout/index.ts b/packages/core/src/Layout/index.ts
index 5cf7d7d0c3..e26a7e49b8 100644
--- a/packages/core/src/Layout/index.ts
+++ b/packages/core/src/Layout/index.ts
@@ -1,20 +1,18 @@
/**
* @file index.ts
- * @input Imports layout utilities and components from subfolders
+ * @input Imports layout utilities and components
* @output Exports XDS layout system
* @position Entry point for @xds/core/Layout
*
* SYNC: When modified, update /packages/core/src/Layout/README.md
*/
-// Utilities
-export {container} from './Container/container.stylex';
-export type {
- ContainerOptions,
- SpacingToken,
-} from './Container/container.stylex';
+// Container utility
+export {container} from './container.stylex';
+export type {ContainerOptions, SpacingToken} from './container.stylex';
-export {stack} from './Stack/stack.stylex';
+// Stack utilities (re-exported from Stack module)
+export {stack} from '../Stack/stack.stylex';
export type {
StackOptions,
StackDirection,
@@ -22,43 +20,43 @@ export type {
StackMainAlignment,
StackWrap,
SpacingScale,
-} from './Stack/stack.stylex';
+} from '../Stack/stack.stylex';
-export {stackItem} from './Stack/stackItem.stylex';
+export {stackItem} from '../Stack/stackItem.stylex';
export type {
StackItemOptions,
StackItemCrossAlignSelf,
StackItemSize,
-} from './Stack/stackItem.stylex';
+} from '../Stack/stackItem.stylex';
-// Stack components
-export {XDSHStack, XDSVStack, XDSStackItem} from './Stack';
-export type {XDSHStackProps, XDSVStackProps, XDSStackItemProps} from './Stack';
+// Stack components (re-exported from Stack module)
+export {XDSHStack, XDSVStack, XDSStackItem} from '../Stack';
+export type {XDSHStackProps, XDSVStackProps, XDSStackItemProps} from '../Stack';
-// Container components
-export {XDSCard, XDSSection} from './Container';
-export type {
- XDSCardProps,
- SizeValue,
- XDSSectionProps,
- XDSSectionVariant,
-} from './Container';
+// Container components (re-exported from their own modules)
+export {XDSCard} from '../Card';
+export type {XDSCardProps} from '../Card';
+
+export {XDSSection} from '../Section';
+export type {XDSSectionProps, XDSSectionVariant} from '../Section';
+
+export type {SizeValue} from '../utils/types';
// Layout structure components
-export {
- XDSLayout,
- XDSLayoutHeader,
- XDSLayoutFooter,
- XDSLayoutContent,
- XDSLayoutPanel,
- XDSLayoutAreaContext,
-} from './XDSLayout';
-export type {
- XDSLayoutProps,
- XDSLayoutHeight,
- XDSLayoutHeaderProps,
- XDSLayoutFooterProps,
- XDSLayoutContentProps,
- XDSLayoutPanelProps,
- LayoutArea,
-} from './XDSLayout';
+export {XDSLayout} from './XDSLayout';
+export type {XDSLayoutProps, XDSLayoutHeight} from './XDSLayout';
+
+export {XDSLayoutHeader} from './XDSLayoutHeader';
+export type {XDSLayoutHeaderProps} from './XDSLayoutHeader';
+
+export {XDSLayoutFooter} from './XDSLayoutFooter';
+export type {XDSLayoutFooterProps} from './XDSLayoutFooter';
+
+export {XDSLayoutContent} from './XDSLayoutContent';
+export type {XDSLayoutContentProps} from './XDSLayoutContent';
+
+export {XDSLayoutPanel} from './XDSLayoutPanel';
+export type {XDSLayoutPanelProps} from './XDSLayoutPanel';
+
+export {XDSLayoutAreaContext} from './XDSLayoutAreaContext';
+export type {LayoutArea} from './XDSLayoutAreaContext';
diff --git a/packages/core/src/Section/README.md b/packages/core/src/Section/README.md
new file mode 100644
index 0000000000..4b40de5ee0
--- /dev/null
+++ b/packages/core/src/Section/README.md
@@ -0,0 +1,46 @@
+# /packages/core/src/Section
+
+Section container component with background variants.
+
+<!-- SYNC: When files in this directory change, update this document. -->
+
+## Overview
+
+XDSSection is a container with background variants for creating visually distinct regions. Sections automatically escape parent container padding for edge-to-edge fills.
+
+## Import
+
+```tsx
+import {XDSSection} from '@xds/core/Section';
+```
+
+## Usage
+
+```tsx
+<XDSSection variant="wash" width={300} height={250}>
+ <XDSLayout
+ content={<XDSLayoutContent>Content in wash section</XDSLayoutContent>}
+ />
+</XDSSection>
+```
+
+## Props
+
+| Prop | Type | Default | Description |
+| ------------- | ---------------------------------------- | ----------- | ------------------------------------------------- |
+| `variant` | `'section' \| 'transparent' \| 'wash'` | `'section'` | Background variant |
+| `width` | `SizeValue` | — | Width (number = pixels, string = as-is) |
+| `height` | `SizeValue` | — | Height (number = pixels, string = as-is) |
+| `maxWidth` | `SizeValue` | — | Maximum width |
+| `minHeight` | `SizeValue` | — | Minimum height |
+| `children` | `ReactNode` | — | Content |
+| `dividers` | `Array<'top'\|'bottom'\|'start'\|'end'>` | — | Which sides have divider borders |
+| `isFullBleed` | `boolean` | `false` | Removes internal padding for edge-to-edge content |
+
+## Files
+
+| File | Role | Purpose |
+| ---------------- | --------- | -------------------------------- |
+| `index.ts` | Entry | Exports component and types |
+| `XDSSection.tsx` | Component | Section container implementation |
+| `README.md` | Docs | This documentation |
diff --git a/packages/core/src/Layout/Container/XDSSection.tsx b/packages/core/src/Section/XDSSection.tsx
similarity index 89%
rename from packages/core/src/Layout/Container/XDSSection.tsx
rename to packages/core/src/Section/XDSSection.tsx
index 249b103db1..a781a72700 100644
--- a/packages/core/src/Layout/Container/XDSSection.tsx
+++ b/packages/core/src/Section/XDSSection.tsx
@@ -2,16 +2,21 @@
* @file XDSSection.tsx
* @input Uses container utility, StyleX, ThemeContext
* @output Exports XDSSection component and XDSSectionProps
- * @position Higher-order container component for section layouts
+ * @position Core section container component
+ *
+ * SYNC: When modified, update these files to stay in sync:
+ * - /packages/core/src/Section/README.md (props table, features)
+ * - /packages/core/src/Section/index.ts (exports if types change)
+ * - /apps/storybook/stories/Section.stories.tsx (storybook stories)
*/
import {forwardRef, useContext, type ReactNode} from 'react';
import * as stylex from '@stylexjs/stylex';
-import {colorVars} from '../../theme/tokens.stylex';
-import {ThemeContext} from '../../theme/ThemeContext';
-import type {StyleXStyles as ThemeStyleXStyles} from '../../theme/types';
-import {container} from './container.stylex';
-import type {SizeValue} from './XDSCard';
+import {colorVars} from '../theme/tokens.stylex';
+import {ThemeContext} from '../theme/ThemeContext';
+import type {StyleXStyles as ThemeStyleXStyles} from '../theme/types';
+import {container} from '../Layout/container.stylex';
+import type {SizeValue} from '../utils/types';
/**
* Visual variant for the section.
@@ -22,7 +27,7 @@ export type XDSSectionVariant = 'section' | 'transparent' | 'wash';
// Module Augmentation - Register XDSSection's themeable properties
// =============================================================================
-declare module '../../theme/types' {
+declare module '../theme/types' {
interface ComponentStyles {
section?: {
/** Outer container styles (positioning, margins) */
@@ -182,6 +187,9 @@ export interface XDSSectionProps {
* Applies section-specific appearance based on the variant prop
* and sets CSS variables for child layout components.
*
+ * @compositionHint Use inside XDSCard to create visually distinct regions.
+ * Sections automatically escape parent container padding for edge-to-edge fills.
+ *
* @example
* ```tsx
* <XDSSection variant="wash" width={300} height={250}>
diff --git a/packages/core/src/Section/index.ts b/packages/core/src/Section/index.ts
new file mode 100644
index 0000000000..62796faf7a
--- /dev/null
+++ b/packages/core/src/Section/index.ts
@@ -0,0 +1,11 @@
+/**
+ * @file index.ts
+ * @input Imports XDSSection component
+ * @output Exports XDSSection component and types
+ * @position Entry point for @xds/core/Section module
+ *
+ * SYNC: When modified, update /packages/core/src/Section/README.md
+ */
+
+export {XDSSection} from './XDSSection';
+export type {XDSSectionProps, XDSSectionVariant} from './XDSSection';
diff --git a/packages/core/src/Layout/Stack/README.md b/packages/core/src/Stack/README.md
similarity index 100%
rename from packages/core/src/Layout/Stack/README.md
rename to packages/core/src/Stack/README.md
diff --git a/packages/core/src/Layout/Stack/XDSHStack.test.tsx b/packages/core/src/Stack/XDSHStack.test.tsx
similarity index 100%
rename from packages/core/src/Layout/Stack/XDSHStack.test.tsx
rename to packages/core/src/Stack/XDSHStack.test.tsx
diff --git a/packages/core/src/Layout/Stack/XDSHStack.tsx b/packages/core/src/Stack/XDSHStack.tsx
similarity index 100%
rename from packages/core/src/Layout/Stack/XDSHStack.tsx
rename to packages/core/src/Stack/XDSHStack.tsx
diff --git a/packages/core/src/Layout/Stack/XDSStackItem.test.tsx b/packages/core/src/Stack/XDSStackItem.test.tsx
similarity index 100%
rename from packages/core/src/Layout/Stack/XDSStackItem.test.tsx
rename to packages/core/src/Stack/XDSStackItem.test.tsx
diff --git a/packages/core/src/Layout/Stack/XDSStackItem.tsx b/packages/core/src/Stack/XDSStackItem.tsx
similarity index 100%
rename from packages/core/src/Layout/Stack/XDSStackItem.tsx
rename to packages/core/src/Stack/XDSStackItem.tsx
diff --git a/packages/core/src/Layout/Stack/XDSVStack.test.tsx b/packages/core/src/Stack/XDSVStack.test.tsx
similarity index 100%
rename from packages/core/src/Layout/Stack/XDSVStack.test.tsx
rename to packages/core/src/Stack/XDSVStack.test.tsx
diff --git a/packages/core/src/Layout/Stack/XDSVStack.tsx b/packages/core/src/Stack/XDSVStack.tsx
similarity index 100%
rename from packages/core/src/Layout/Stack/XDSVStack.tsx
rename to packages/core/src/Stack/XDSVStack.tsx
diff --git a/packages/core/src/Layout/Stack/index.ts b/packages/core/src/Stack/index.ts
similarity index 100%
rename from packages/core/src/Layout/Stack/index.ts
rename to packages/core/src/Stack/index.ts
diff --git a/packages/core/src/Layout/Stack/stack.stylex.ts b/packages/core/src/Stack/stack.stylex.ts
similarity index 99%
rename from packages/core/src/Layout/Stack/stack.stylex.ts
rename to packages/core/src/Stack/stack.stylex.ts
index adb4744e8f..68f8d0705b 100644
--- a/packages/core/src/Layout/Stack/stack.stylex.ts
+++ b/packages/core/src/Stack/stack.stylex.ts
@@ -8,7 +8,7 @@
*/
import * as stylex from '@stylexjs/stylex';
-import {spacingVars} from '../../theme/tokens.stylex';
+import {spacingVars} from '../theme/tokens.stylex';
const alignItemsStyles = stylex.create({
center: {
diff --git a/packages/core/src/Layout/Stack/stackItem.stylex.ts b/packages/core/src/Stack/stackItem.stylex.ts
similarity index 100%
rename from packages/core/src/Layout/Stack/stackItem.stylex.ts
rename to packages/core/src/Stack/stackItem.stylex.ts
diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts
index 49f5c6544c..1f5238f43f 100644
--- a/packages/core/src/index.ts
+++ b/packages/core/src/index.ts
@@ -1,6 +1,6 @@
/**
* @file index.ts
- * @input Imports from component directories (Button/, Layout/, Layer/)
+ * @input Imports from component directories (Button/, Card/, Layout/, Layer/)
* @output Exports all public components and types for @xds/core
* @position Package entry point; consumed by external applications
*
@@ -13,6 +13,7 @@ export * from './Avatar';
export * from './Badge';
export * from './Breadcrumbs';
export * from './Button';
+export * from './Card';
export * from './Calendar';
export * from './Center';
export * from './CheckboxInput';
@@ -22,10 +23,12 @@ export * from './Divider';
export * from './EmptyState';
export * from './Link';
export * from './Slider';
+export * from './Stack';
export * from './Switch';
export * from './DateInput';
export * from './Field';
export * from './Grid';
+export * from './Section';
export * from './Selector';
export * from './Icon';
export * from './Text';
diff --git a/packages/core/src/utils/index.ts b/packages/core/src/utils/index.ts
index 60399f35eb..6513369f14 100644
--- a/packages/core/src/utils/index.ts
+++ b/packages/core/src/utils/index.ts
@@ -1,10 +1,12 @@
/**
* @file index.ts
* @input Utils module exports
- * @output Re-exports all utility functions
+ * @output Re-exports all utility functions and shared types
* @position Package entry point for utils
*/
+export type {SizeValue} from './types';
+
export {
parseDateInput,
formatDisplayDate,
diff --git a/packages/core/src/utils/types.ts b/packages/core/src/utils/types.ts
new file mode 100644
index 0000000000..8e415add4d
--- /dev/null
+++ b/packages/core/src/utils/types.ts
@@ -0,0 +1,11 @@
+/**
+ * @file types.ts
+ * @input None
+ * @output Exports shared utility types
+ * @position Shared types used across multiple components
+ */
+
+/**
+ * Size value type - accepts numbers (treated as pixels) or strings (e.g., '100%', '50vh').
+ */
+export type SizeValue = number | string;
diff --git a/yarn.lock b/yarn.lock
index a87592ea27..772622e29c 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -305,7 +305,7 @@
"@babel/helper-skip-transparent-expression-wrappers" "^7.27.1"
"@babel/plugin-syntax-typescript" "^7.28.6"
-"@babel/preset-react@^7.28.5":
+"@babel/preset-react@^7.25.0", "@babel/preset-react@^7.28.5":
version "7.28.5"
resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.28.5.tgz#6fcc0400fa79698433d653092c3919bb4b0878d9"
integrity sha512-Z3J8vhRq7CeLjdC58jLv4lnZ5RKFUJWqH5emvxmv9Hv3BD1T9R/Im713R4MTKwvFaV74ejZ3sM01LyEKk4ugNQ==
@@ -317,7 +317,7 @@
"@babel/plugin-transform-react-jsx-development" "^7.27.1"
"@babel/plugin-transform-react-pure-annotations" "^7.27.1"
-"@babel/preset-typescript@^7.28.5":
+"@babel/preset-typescript@^7.25.0", "@babel/preset-typescript@^7.28.5":
version "7.28.5"
resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.28.5.tgz#540359efa3028236958466342967522fd8f2a60c"
integrity sha512-+bQy5WOI2V6LJZpPVxY+yp66XdZ2yifu0Mc1aP5CQKgjn4QM5IN2i5fAZ4xKop47pr8rpVhiAeu+nDQa12C8+g==
@@ -2009,6 +2009,18 @@
"@babel/plugin-syntax-typescript" "^7.25.9"
"@stylexjs/babel-plugin" "0.11.1"
+"@stylexjs/postcss-plugin@^0.17.4":
+ version "0.17.5"
+ resolved "https://registry.yarnpkg.com/@stylexjs/postcss-plugin/-/postcss-plugin-0.17.5.tgz#03ecd009409cbcb59e5083cac8a62f591ec38e16"
+ integrity sha512-GeveZXN8aDrXTSRpDM0SvCjmmY7WCfoel+lWcsf47QcJvjz5auGmh3a9LhIFLpwmAgpsVr20RyB8yxX93NaKow==
+ dependencies:
+ "@babel/core" "^7.26.8"
+ "@stylexjs/babel-plugin" "0.17.5"
+ fast-glob "^3.3.2"
+ glob-parent "^6.0.2"
+ is-glob "^4.0.3"
+ postcss "^8.4.49"
+
"@stylexjs/[email protected]":
version "0.11.1"
resolved "https://registry.yarnpkg.com/@stylexjs/shared/-/shared-0.11.1.tgz#c92160f33161f5721f5e1b4a623f99892df5d319"
@@ -3225,7 +3237,7 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==
-fast-glob@^3.2.9:
+fast-glob@^3.2.9, fast-glob@^3.3.2:
version "3.3.3"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.3.tgz#d06d585ce8dba90a16b0505c543c3ccfb3aeb818"
integrity sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==
@@ -4364,7 +4376,7 @@ [email protected]:
picocolors "^1.0.0"
source-map-js "^1.0.2"
-postcss@^8.4.43:
+postcss@^8.4.43, postcss@^8.4.49:
version "8.5.6"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.5.6.tgz#2825006615a619b4f62a9e7426cc120b349a8f3c"
integrity sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==