An open source design system that's fully customizable and agent ready
TypeScript
feat(theme): rename elevation tokens to shadow-N + insetshadow-border-* (#700)
Cindy Zhanga294b290e58d
diff --git a/apps/storybook/stories/Layout.stories.tsx b/apps/storybook/stories/Layout.stories.tsxindex 01812e15da..2110d08aa8 100644--- a/apps/storybook/stories/Layout.stories.tsx+++ b/apps/storybook/stories/Layout.stories.tsx@@ -18,7 +18,7 @@ import {spacingVars,typographyVars,radiusVars,- elevationVars,+ shadowVars,} from '@xds/core/theme/tokens.stylex';import {XDSTheme} from '@xds/core';import {defaultTheme} from '@xds/theme-default';@@ -108,7 +108,7 @@ const styles = stylex.create({demoContainer: {backgroundColor: colorVars['--color-card'],borderRadius: radiusVars['--radius-3'],- boxShadow: elevationVars['--elevation-base'],+ boxShadow: shadowVars['--shadow-1'],},// Demo sizing for outer padding storydemoSize: {@@ -144,7 +144,7 @@ const meta: Meta<typeof XDSLayout> = {The XDS Layout System provides a structured way to build page and component layouts.**Components:**-- \`XDSCard\` - Card container with elevation+- \`XDSCard\` - Card container with shadow- \`XDSSection\` - Section container with background variants- \`XDSLayout\` - Arranges content into header, content, footer, and panel slots- \`XDSLayoutHeader\` - Header slot with optional dividerdiff --git a/apps/storybook/stories/ThemeEditor.stories.tsx b/apps/storybook/stories/ThemeEditor.stories.tsxindex aa7e522319..b1511e6fca 100644--- a/apps/storybook/stories/ThemeEditor.stories.tsx+++ b/apps/storybook/stories/ThemeEditor.stories.tsx@@ -32,7 +32,7 @@ import {fontWeightDefaults,typeScaleDefaults,sizeDefaults,- elevationDefaults,+ shadowDefaults,durationDefaults,easingDefaults,transitionDefaults,@@ -75,10 +75,10 @@ const TOKEN_GROUPS = {description: 'Component size tokens (sm, md, lg)',tokens: sizeDefaults,},- elevation: {+ shadow: {label: 'Elevation',- description: 'Shadow and elevation tokens',- tokens: elevationDefaults,+ description: 'Shadow tokens',+ tokens: shadowDefaults,},duration: {label: 'Duration',@@ -1320,7 +1320,7 @@ function ThemeEditorComponent() {...fontWeightDefaults,...typeScaleDefaults,...sizeDefaults,- ...elevationDefaults,+ ...shadowDefaults,...durationDefaults,...easingDefaults,...transitionDefaults,diff --git a/internal/vibe-tests/prompts/evaluator.md b/internal/vibe-tests/prompts/evaluator.mdindex 77b428dea3..2a788a0817 100644--- a/internal/vibe-tests/prompts/evaluator.md+++ b/internal/vibe-tests/prompts/evaluator.md@@ -74,17 +74,17 @@ XDS uses specific CSS variable naming. **Any variable not matching these pattern**Valid CSS variable prefixes:**-| Category | Prefix | Examples |-| ------------- | ---------------------------------------------- | ------------------------------------------------------------ |-| Colors | `--color-*` | `--color-surface`, `--color-text-primary`, `--color-accent` |-| Spacing | `--spacing-*` | `--spacing-0` through `--spacing-7` |+| Category | Prefix | Examples |+| ------------- | ---------------------------------------------- | ---------------------------------------------------------------------------------------- |+| Colors | `--color-*` | `--color-surface`, `--color-text-primary`, `--color-accent` |+| Spacing | `--spacing-*` | `--spacing-0` through `--spacing-7` || Radius | `--radius-*` | `--radius-0`, `--radius-1`, `--radius-2`, `--radius-3`, `--radius-4`, `--radius-rounded` |-| Elevation | `--elevation-*` | `--elevation-base`, `--elevation-dialog`, `--elevation-menu` |-| Transitions | `--transition-*` | `--transition-fast`, `--transition-normal` |-| Font families | `--font-body`, `--font-code`, `--font-heading` | (only these three) |-| Text sizes | `--text-*` | `--text-base`, `--text-sm`, `--text-lg`, `--text-xl` |-| Line heights | `--leading-*` | `--leading-tight`, `--leading-normal`, `--leading-relaxed` |-| Font weights | `--font-weight-*` | `--font-weight-normal`, `--font-weight-bold` |+| Shadow | `--shadow-*`, `--insetshadow-border-*` | `--shadow-1`, `--shadow-4`, `--insetshadow-border-hover` |+| Transitions | `--transition-*` | `--transition-fast`, `--transition-normal` |+| Font families | `--font-body`, `--font-code`, `--font-heading` | (only these three) |+| Text sizes | `--text-*` | `--text-base`, `--text-sm`, `--text-lg`, `--text-xl` |+| Line heights | `--leading-*` | `--leading-tight`, `--leading-normal`, `--leading-relaxed` |+| Font weights | `--font-weight-*` | `--font-weight-normal`, `--font-weight-bold` |**Common hallucinations to flag:**@@ -94,7 +94,7 @@ XDS uses specific CSS variable naming. **Any variable not matching these pattern- `--border-*` (doesn't exist - use `--color-divider` or component props)- `--font-family-*` (doesn't exist - use `--font-body`, `--font-code`, `--font-heading`)- `--font-size-*` (doesn't exist - use `--text-*`)-- `--shadow-*` (doesn't exist - use `--elevation-*`)+- `--elevation-*` (doesn't exist - use `--shadow-*` and `--insetshadow-border-*`)When you detect a hallucinated CSS variable, create an escape hatch entry:diff --git a/packages/cli/docs/theme.doc.dense.mjs b/packages/cli/docs/theme.doc.dense.mjsindex f140df2c80..86159ee739 100644--- a/packages/cli/docs/theme.doc.dense.mjs+++ b/packages/cli/docs/theme.doc.dense.mjs@@ -6,7 +6,7 @@ export const docsDense = {{ title: 'Quick Start', content: [null] },{ title: 'Themes', content: [null, { type: 'prose', text: 'xds theme --list to see project themes' }] },{ title: 'Props', content: [null] },- { title: 'Custom Theme', content: [{ type: 'prose', text: 'CLI wizard or manual. only override token groups that differ.' }, null, null, { type: 'prose', text: 'token groups: colors/spacing/size/radius/elevation/transition/typography/textSize/lineHeight/fontWeight' }, { type: 'list', items: ['no variable refs in createTheme (static analysis)', 'no spread in createTheme'] }] },+ { title: 'Custom Theme', content: [{ type: 'prose', text: 'CLI wizard or manual. only override token groups that differ.' }, null, null, { type: 'prose', text: 'token groups: colors/spacing/size/radius/shadow/transition/typography/textSize/lineHeight/fontWeight' }, { type: 'list', items: ['no variable refs in createTheme (static analysis)', 'no spread in createTheme'] }] },{ title: 'Light/Dark', content: [{ type: 'prose', text: 'light-dark() in token values. mode=system follows OS.' }, null, null] },{ title: 'Nesting', content: [{ type: 'prose', text: 'wrap sections in separate <XDSTheme> providers' }, null] },{ title: 'Page Background', content: [{ type: 'prose', text: 'XDSTheme is display:contents. apply bg to wrapper.' }, null] },diff --git a/packages/cli/docs/theme.doc.mjs b/packages/cli/docs/theme.doc.mjsindex a1a5db51d1..0a04170f30 100644--- a/packages/cli/docs/theme.doc.mjs+++ b/packages/cli/docs/theme.doc.mjs@@ -102,7 +102,7 @@ export const myTheme: Theme = {},{type: 'prose',- text: "Token groups (all optional in styles): colors, spacing, size, radius, elevation, transition, typography, textSize, lineHeight, fontWeight. Omitted groups use defineVars defaults.",+ text: "Token groups (all optional in styles): colors, spacing, size, radius, shadow, transition, typography, textSize, lineHeight, fontWeight. Omitted groups use defineVars defaults.",},{type: 'list',diff --git a/packages/cli/docs/tokens.doc.dense.mjs b/packages/cli/docs/tokens.doc.dense.mjsindex 177bc31097..0aa7d5b437 100644--- a/packages/cli/docs/tokens.doc.dense.mjs+++ b/packages/cli/docs/tokens.doc.dense.mjs@@ -1,7 +1,7 @@/** @type {import('../../core/src/docs-types').ReferenceTranslationDoc} */export const docsDense = {- description: 'spacing/color/radius/type/elevation token ref',+ description: 'spacing/color/radius/type/shadow token ref',sections: [{ title: 'Spacing', content: [{ type: 'prose', text: 'defined in tokens.stylex.ts. gap props use space0-space12.' }, null] },{ title: 'Size', content: [{ type: 'prose', text: 'control heights for buttons/inputs/selectors.' }, null] },diff --git a/packages/cli/docs/tokens.doc.mjs b/packages/cli/docs/tokens.doc.mjsindex 88b18b4ba6..0b1f4edf66 100644--- a/packages/cli/docs/tokens.doc.mjs+++ b/packages/cli/docs/tokens.doc.mjs@@ -3,7 +3,7 @@export const docs = {name: 'tokens',title: 'XDS Design Tokens',- description: 'Spacing, color, radius, typography, and elevation token reference.',+ description: 'Spacing, color, radius, typography, and shadow token reference.',sections: [{@@ -138,16 +138,21 @@ const sharpTheme = defineTheme({],},{- title: 'Elevation Tokens',+ title: 'Shadow Tokens',content: [{type: 'table',headers: ['Token', 'Usage'],rows: [- ['--elevation-base', 'Subtle shadow'],- ['--elevation-menu', 'Dropdowns, menus'],- ['--elevation-dialog', 'Modals, dialogs'],- ['--elevation-hover', 'Hover states'],+ ['--shadow-1', 'Subtle lift (cards)'],+ ['--shadow-2', 'Floating elements (menus, popovers)'],+ ['--shadow-3', 'Hover lift, toasts'],+ ['--shadow-4', 'Dialogs, modals'],+ ['--insetshadow-border-hover', 'Input hover ring'],+ ['--insetshadow-border-accent', 'Input focused/active ring'],+ ['--insetshadow-border-positive', 'Input success ring'],+ ['--insetshadow-border-warning', 'Input warning ring'],+ ['--insetshadow-border-negative', 'Input error ring'],],},],diff --git a/packages/cli/docs/tokens.md b/packages/cli/docs/tokens.mdindex 82a5677441..76bf3f1669 100644--- a/packages/cli/docs/tokens.md+++ b/packages/cli/docs/tokens.md@@ -85,35 +85,39 @@ import {defineTheme} from '@xds/core/theme';const roundedTheme = defineTheme({name: 'rounded',- radiusScale: { base: 4, multiplier: 1.5 },+ radiusScale: {base: 4, multiplier: 1.5},// Produces: radius-1=6px, radius-2=12px, radius-3=18px, radius-4=24px// radius-0 stays 0px, radius-rounded stays 9999px});const sharpTheme = defineTheme({name: 'sharp',- radiusScale: { base: 4, multiplier: 0 },+ radiusScale: {base: 4, multiplier: 0},// All scalable radii become 0px});```-| Multiplier | Effect | radius-3 becomes |-| ---------- | --------- | ---------------- |-| 0 | Sharp | 0px |-| 0.5 | Subtle | 6px |-| 1 (default)| Default | 12px |-| 1.5 | Rounded | 18px |-| 2 | Pill-like | 24px |--## Elevation Tokens--| Token | Usage |-| ------------------ | ---------------- |-| --elevation-base | Subtle shadow |-| --elevation-thumb | Slider thumbs |-| --elevation-menu | Dropdowns, menus |-| --elevation-dialog | Modals, dialogs |-| --elevation-hover | Hover states |+| Multiplier | Effect | radius-3 becomes |+| ----------- | --------- | ---------------- |+| 0 | Sharp | 0px |+| 0.5 | Subtle | 6px |+| 1 (default) | Default | 12px |+| 1.5 | Rounded | 18px |+| 2 | Pill-like | 24px |++## Shadow Tokens++| Token | Usage |+| ----------------------------- | ------------------------- |+| --shadow-1 | Subtle lift (cards) |+| --shadow-2 | Floating elements (menus) |+| --shadow-3 | Hover lift, toasts |+| --shadow-4 | Dialogs, modals |+| --insetshadow-border-hover | Input hover ring |+| --insetshadow-border-accent | Input focused/active ring |+| --insetshadow-border-positive | Input success ring |+| --insetshadow-border-warning | Input warning ring |+| --insetshadow-border-negative | Input error ring |## Typography Tokensdiff --git a/packages/cli/src/commands/theme.mjs b/packages/cli/src/commands/theme.mjsindex 60551030e1..73c8a9535e 100644--- a/packages/cli/src/commands/theme.mjs+++ b/packages/cli/src/commands/theme.mjs@@ -317,7 +317,7 @@ ${colorEntries}// createTheme calls// =============================================================================// Only create themes for token groups you want to override.-// Omitted groups (spacing, size, radius, elevation, transition, typography,+// Omitted groups (spacing, size, radius, shadow, transition, typography,// textSize, lineHeight, fontWeight) use the defineVars defaults automatically.const colorTheme = stylex.createTheme(@@ -326,7 +326,7 @@ const colorTheme = stylex.createTheme();// Uncomment and customize to override other token groups:-// import { radiusVars, elevationVars, typographyVars, ... } from '@xds/core/theme/tokens.stylex';+// import { radiusVars, shadowVars, typographyVars, ... } from '@xds/core/theme/tokens.stylex';// const radiusTheme = stylex.createTheme(radiusVars, { '--radius-3': '16px', ... });${componentOverrideSection}// =============================================================================diff --git a/packages/cli/templates/login/page.tsx b/packages/cli/templates/login/page.tsxindex a56adc2892..6ecf601ea4 100644--- a/packages/cli/templates/login/page.tsx+++ b/packages/cli/templates/login/page.tsx@@ -21,7 +21,7 @@ const styles = stylex.create({padding: 'var(--spacing-7)',backgroundColor: 'var(--color-surface)',borderRadius: 'var(--radius-3)',- boxShadow: 'var(--elevation-menu)',+ boxShadow: 'var(--shadow-2)',},});diff --git a/packages/core/src/Banner/XDSBanner.tsx b/packages/core/src/Banner/XDSBanner.tsxindex efdb65372e..02083c8ff8 100644--- a/packages/core/src/Banner/XDSBanner.tsx+++ b/packages/core/src/Banner/XDSBanner.tsx@@ -54,7 +54,7 @@ export type XDSBannerStatus = 'info' | 'warning' | 'error' | 'success';/*** Visual variant of the banner.- * - `card`: standalone card with border-radius and elevation+ * - `card`: standalone card with border-radius and shadow* - `section`: full-width section banner (no border-radius)*/export type XDSBannerVariant = 'card' | 'section';diff --git a/packages/core/src/Card/Card.doc.mjs b/packages/core/src/Card/Card.doc.mjsindex c7f1e467c8..c6300d5b70 100644--- a/packages/core/src/Card/Card.doc.mjs+++ b/packages/core/src/Card/Card.doc.mjs@@ -2,7 +2,7 @@export const docs = {name: 'Card',- description: 'Card container component with elevation and themed styling.',+ description: 'Card container component with shadow and themed styling.',features: ['Top-level container for elevated content','Provides card-specific appearance: background, shadow, and border-radius',diff --git a/packages/core/src/Card/XDSCard.tsx b/packages/core/src/Card/XDSCard.tsxindex 4767c784b5..c56513cda8 100644--- a/packages/core/src/Card/XDSCard.tsx+++ b/packages/core/src/Card/XDSCard.tsx@@ -14,7 +14,7 @@import {type ReactNode} from 'react';import * as stylex from '@stylexjs/stylex';-import {colorVars, radiusVars, elevationVars} from '../theme/tokens.stylex';+import {colorVars, radiusVars, shadowVars} from '../theme/tokens.stylex';import {container} from '../Layout/container.stylex';import type {SpacingToken} from '../Layout/container.stylex';import {@@ -31,7 +31,7 @@ const styles = stylex.create({cardOuter: {backgroundColor: colorVars['--color-card'],borderRadius: radiusVars['--radius-3'],- boxShadow: elevationVars['--elevation-base'],+ boxShadow: shadowVars['--shadow-1'],// Clip content to border-radius so nested containers don\'t peek out cornersoverflow: 'clip',borderWidth: 1,@@ -114,7 +114,7 @@ export interface XDSCardProps extends XDSBaseProps {}/**- * A card container with elevation and themed styling.+ * A card container with shadow and themed styling.** Applies card-specific appearance (background, shadow, border-radius)* and sets CSS variables for child layout components.diff --git a/packages/core/src/DateInput/XDSDateInput.tsx b/packages/core/src/DateInput/XDSDateInput.tsxindex a311a7436e..8e003e0a89 100644--- a/packages/core/src/DateInput/XDSDateInput.tsx+++ b/packages/core/src/DateInput/XDSDateInput.tsx@@ -28,7 +28,7 @@ import {colorVars,sizeVars,radiusVars,- elevationVars,+ shadowVars,typographyVars,textSizeVars,lineHeightVars,@@ -99,7 +99,7 @@ const styles = stylex.create({popover: {backgroundColor: colorVars['--color-popover'],borderRadius: radiusVars['--radius-3'],- boxShadow: elevationVars['--elevation-menu'],+ boxShadow: shadowVars['--shadow-2'],},});diff --git a/packages/core/src/Dialog/XDSDialog.tsx b/packages/core/src/Dialog/XDSDialog.tsxindex 97e02825e9..f1b6de54aa 100644--- a/packages/core/src/Dialog/XDSDialog.tsx+++ b/packages/core/src/Dialog/XDSDialog.tsx@@ -21,7 +21,7 @@ import {radiusVars,durationVars,easingVars,- elevationVars,+ shadowVars,} from '../theme/tokens.stylex';import {xdsClassName, mergeProps} from '../utils';@@ -62,7 +62,7 @@ const styles = stylex.create({border: 'none',backgroundColor: colorVars['--color-surface'],borderRadius: radiusVars['--radius-3'],- boxShadow: elevationVars['--elevation-dialog'],+ boxShadow: shadowVars['--shadow-4'],display: {default: 'none',':where([open])': 'flex',diff --git a/packages/core/src/DropdownMenu/XDSDropdownMenu.tsx b/packages/core/src/DropdownMenu/XDSDropdownMenu.tsxindex 2cd9af5b34..233f1d9414 100644--- a/packages/core/src/DropdownMenu/XDSDropdownMenu.tsx+++ b/packages/core/src/DropdownMenu/XDSDropdownMenu.tsx@@ -31,7 +31,7 @@ import {XDSDivider} from '../Divider';import {XDSDropdownMenuItem} from './XDSDropdownMenuItem';import {colorVars,- elevationVars,+ shadowVars,spacingVars,radiusVars,durationVars,@@ -50,7 +50,7 @@ const styles = stylex.create({padding: spacingVars['--spacing-1'],borderRadius: radiusVars['--radius-2'],backgroundColor: colorVars['--color-surface'],- boxShadow: elevationVars['--elevation-menu'],+ boxShadow: shadowVars['--shadow-2'],opacity: 1,transitionProperty: 'opacity',transitionDuration: durationVars['--duration-fast'],diff --git a/packages/core/src/Field/inputStyles.stylex.ts b/packages/core/src/Field/inputStyles.stylex.tsindex 091ea90496..b66e52954c 100644--- a/packages/core/src/Field/inputStyles.stylex.ts+++ b/packages/core/src/Field/inputStyles.stylex.ts@@ -1,6 +1,6 @@/*** @file inputStyles.stylex.ts- * @input Uses theme tokens (color, spacing, radius, elevation, transition)+ * @input Uses theme tokens (color, spacing, radius, shadow, transition)* @output Exports shared input wrapper appearance styles* @position Shared styles consumed by TextInput, TextArea, NumberInput, DateInput,* TimeInput, Selector, Typeahead, and Tokenizer@@ -16,7 +16,7 @@ import {colorVars,spacingVars,radiusVars,- elevationVars,+ shadowVars,durationVars,easingVars,} from '../theme/tokens.stylex';@@ -51,7 +51,7 @@ export const inputWrapperStyles = stylex.create({boxShadow: {default: 'none',':hover': {- '@media (hover: hover)': elevationVars['--elevation-input-hover'],+ '@media (hover: hover)': shadowVars['--insetshadow-border-hover'],},},outline: {@@ -92,8 +92,7 @@ export const inputStatusHoverShadowStyles = stylex.create({boxShadow: {default: 'none',':hover': {- '@media (hover: hover)':- elevationVars['--elevation-input-hover-warning'],+ '@media (hover: hover)': shadowVars['--insetshadow-border-warning'],},},},@@ -101,7 +100,7 @@ export const inputStatusHoverShadowStyles = stylex.create({boxShadow: {default: 'none',':hover': {- '@media (hover: hover)': elevationVars['--elevation-input-hover-error'],+ '@media (hover: hover)': shadowVars['--insetshadow-border-negative'],},},},@@ -109,8 +108,7 @@ export const inputStatusHoverShadowStyles = stylex.create({boxShadow: {default: 'none',':hover': {- '@media (hover: hover)':- elevationVars['--elevation-input-hover-success'],+ '@media (hover: hover)': shadowVars['--insetshadow-border-positive'],},},},diff --git a/packages/core/src/HoverCard/useXDSHoverCard.tsx b/packages/core/src/HoverCard/useXDSHoverCard.tsxindex 12e1c58abf..8cc8015c76 100644--- a/packages/core/src/HoverCard/useXDSHoverCard.tsx+++ b/packages/core/src/HoverCard/useXDSHoverCard.tsx@@ -28,7 +28,7 @@ import {colorVars,durationVars,easingVars,- elevationVars,+ shadowVars,radiusVars,spacingVars,} from '../theme/tokens.stylex';@@ -38,7 +38,7 @@ const styles = stylex.create({container: {backgroundColor: colorVars['--color-surface'],borderRadius: radiusVars['--radius-3'],- boxShadow: elevationVars['--elevation-hover'],+ boxShadow: shadowVars['--shadow-3'],// Animation: closed state (default) and open stateopacity: {default: 0,diff --git a/packages/core/src/Layout/Layout.doc.mjs b/packages/core/src/Layout/Layout.doc.mjsindex 107810b52e..7a4717ab9f 100644--- a/packages/core/src/Layout/Layout.doc.mjs+++ b/packages/core/src/Layout/Layout.doc.mjs@@ -308,7 +308,7 @@ export const docs = {{name: 'XDSCard',description:- 'Card with elevation and themed styling, built on XDSLayoutContainer.',+ 'Card with shadow and themed styling, built on XDSLayoutContainer.',props: [],examples: [{@@ -869,7 +869,7 @@ export const docsDense = {{name: 'XDSCard',description:- 'Card w/ elevation + themed styling, built on XDSLayoutContainer.',+ 'Card w/ shadow + themed styling, built on XDSLayoutContainer.',},{name: 'XDSSection',diff --git a/packages/core/src/Popover/XDSPopover.tsx b/packages/core/src/Popover/XDSPopover.tsxindex 09cbc42126..03f3451888 100644--- a/packages/core/src/Popover/XDSPopover.tsx+++ b/packages/core/src/Popover/XDSPopover.tsx@@ -32,7 +32,7 @@ import {easingVars,spacingVars,radiusVars,- elevationVars,+ shadowVars,} from '../theme/tokens.stylex';// =============================================================================@@ -195,7 +195,7 @@ const styles = stylex.create({backgroundColor: colorVars['--color-surface'],color: colorVars['--color-text-primary'],borderRadius: radiusVars['--radius-2'],- boxShadow: elevationVars['--elevation-menu'],+ boxShadow: shadowVars['--shadow-2'],},contentPadding: {paddingBlockStart: spacingVars['--spacing-3'],diff --git a/packages/core/src/PowerSearch/PowerSearchEditPopover.tsx b/packages/core/src/PowerSearch/PowerSearchEditPopover.tsxindex 40aa341c00..e04849994c 100644--- a/packages/core/src/PowerSearch/PowerSearchEditPopover.tsx+++ b/packages/core/src/PowerSearch/PowerSearchEditPopover.tsx@@ -21,7 +21,7 @@ import {spacingVars,colorVars,radiusVars,- elevationVars,+ shadowVars,textSizeVars,} from '../theme/tokens.stylex';import {PowerSearchValueEditor} from './PowerSearchValueEditor';@@ -37,7 +37,7 @@ const styles = stylex.create({container: {backgroundColor: colorVars['--color-surface'],borderRadius: radiusVars['--radius-2'],- boxShadow: elevationVars['--elevation-menu'],+ boxShadow: shadowVars['--shadow-2'],overflow: 'hidden',},content: {diff --git a/packages/core/src/Selector/XDSSelector.tsx b/packages/core/src/Selector/XDSSelector.tsxindex 92c0bf4480..5f112270b3 100644--- a/packages/core/src/Selector/XDSSelector.tsx+++ b/packages/core/src/Selector/XDSSelector.tsx@@ -36,7 +36,7 @@ import {sizeVars,spacingVars,radiusVars,- elevationVars,+ shadowVars,durationVars,easingVars,typographyVars,@@ -89,7 +89,7 @@ const styles = stylex.create({boxShadow: {default: 'none',':hover': {- '@media (hover: hover)': elevationVars['--elevation-input-hover'],+ '@media (hover: hover)': shadowVars['--insetshadow-border-hover'],},},outline: {diff --git a/packages/core/src/TabList/XDSTabMenu.tsx b/packages/core/src/TabList/XDSTabMenu.tsxindex 66c3b635d1..9208d0223e 100644--- a/packages/core/src/TabList/XDSTabMenu.tsx+++ b/packages/core/src/TabList/XDSTabMenu.tsx@@ -23,7 +23,7 @@ import {radiusVars,durationVars,easingVars,- elevationVars,+ shadowVars,textSizeVars,fontWeightVars,lineHeightVars,@@ -161,7 +161,7 @@ const styles = stylex.create({paddingInline: spacingVars['--spacing-1'],backgroundColor: colorVars['--color-surface'],borderRadius: radiusVars['--radius-2'],- boxShadow: elevationVars['--elevation-menu'],+ boxShadow: shadowVars['--shadow-2'],minWidth: '160px',},menuItem: {diff --git a/packages/core/src/TopNav/XDSTopNavMegaMenu.tsx b/packages/core/src/TopNav/XDSTopNavMegaMenu.tsxindex 385e6906df..228c5adc0a 100644--- a/packages/core/src/TopNav/XDSTopNavMegaMenu.tsx+++ b/packages/core/src/TopNav/XDSTopNavMegaMenu.tsx@@ -31,7 +31,7 @@ import {textSizeVars,fontWeightVars,lineHeightVars,- elevationVars,+ shadowVars,} from '../theme/tokens.stylex';import {useXDSPopover} from '../Popover/useXDSPopover';import {XDSGrid} from '../Grid/XDSGrid';@@ -120,7 +120,7 @@ const styles = stylex.create({borderTopRightRadius: 0,borderBottomLeftRadius: radiusVars['--radius-3'],borderBottomRightRadius: radiusVars['--radius-3'],- boxShadow: elevationVars['--elevation-menu'],+ boxShadow: shadowVars['--shadow-2'],overflow: 'hidden',},panelContent: {diff --git a/packages/core/src/TopNav/XDSTopNavMenu.tsx b/packages/core/src/TopNav/XDSTopNavMenu.tsxindex eda65b8587..e499933618 100644--- a/packages/core/src/TopNav/XDSTopNavMenu.tsx+++ b/packages/core/src/TopNav/XDSTopNavMenu.tsx@@ -35,7 +35,7 @@ import {textSizeVars,fontWeightVars,lineHeightVars,- elevationVars,+ shadowVars,} from '../theme/tokens.stylex';// =============================================================================@@ -98,7 +98,7 @@ const styles = stylex.create({padding: spacingVars['--spacing-1'],backgroundColor: colorVars['--color-popover'],borderRadius: radiusVars['--radius-3'],- boxShadow: elevationVars['--elevation-menu'],+ boxShadow: shadowVars['--shadow-2'],},menuOffset: {marginBlockStart: spacingVars['--spacing-1'],diff --git a/packages/core/src/theme/defineTheme.ts b/packages/core/src/theme/defineTheme.tsindex 3f1747a6b7..9fc3ae6fa5 100644--- a/packages/core/src/theme/defineTheme.ts+++ b/packages/core/src/theme/defineTheme.ts@@ -35,7 +35,7 @@ import {spacingDefaults,sizeDefaults,radiusDefaults,- elevationDefaults,+ shadowDefaults,durationDefaults,easingDefaults,transitionDefaults,@@ -69,7 +69,7 @@ export type XDSTokenName =| keyof typeof spacingDefaults| keyof typeof sizeDefaults| keyof typeof radiusDefaults- | keyof typeof elevationDefaults+ | keyof typeof shadowDefaults| keyof typeof durationDefaults| keyof typeof easingDefaults| keyof typeof transitionDefaults@@ -235,7 +235,7 @@ export const xdsTokenDefaults: Record<string, string> = {...spacingDefaults,...sizeDefaults,...radiusDefaults,- ...elevationDefaults,+ ...shadowDefaults,...durationDefaults,...easingDefaults,...transitionDefaults,diff --git a/packages/core/src/theme/index.ts b/packages/core/src/theme/index.tsindex 50a5940da1..c0ab2df64a 100644--- a/packages/core/src/theme/index.ts+++ b/packages/core/src/theme/index.ts@@ -49,7 +49,7 @@ export {spacingDefaults,sizeDefaults,radiusDefaults,- elevationDefaults,+ shadowDefaults,durationDefaults,easingDefaults,transitionDefaults,@@ -62,7 +62,7 @@ export {spacingVars,sizeVars,radiusVars,- elevationVars,+ shadowVars,durationVars,easingVars,transitionVars,@@ -79,7 +79,7 @@ export type {SpacingVarName,SizeVarName,RadiusVarName,- ElevationVarName,+ ShadowVarName,DurationVarName,EasingVarName,TransitionVarName,diff --git a/packages/core/src/theme/tokens.stylex.ts b/packages/core/src/theme/tokens.stylex.tsindex 379b9bfbd9..eea6344469 100644--- a/packages/core/src/theme/tokens.stylex.ts+++ b/packages/core/src/theme/tokens.stylex.ts@@ -199,30 +199,35 @@ export const radiusRaw = radiusDefaults;export const radiusVars = stylex.defineVars(radiusDefaults);// =============================================================================-// Elevation Tokens+// Shadow Tokens// =============================================================================+// Outer shadows: shadow-1 (subtle) → shadow-4 (strongest). Numbers = depth.+// Inset shadows: insetshadow-border-* for input state rings.-export const elevationDefaults = {- '--elevation-base': '0px 0px 1px light-dark(rgba(0, 0, 0, 0.1), #111112)',- '--elevation-dialog':- '0px 2px 2px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2)), 0px 8px 24px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3))',- '--elevation-hover':- '0px 1px 2px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2)), 0px 2px 12px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2))',- '--elevation-menu':+export const shadowDefaults = {+ // Outer elevation shadows (ascending intensity: 1 = least, 4 = most)+ '--shadow-1': '0px 0px 1px light-dark(rgba(0, 0, 0, 0.1), #111112)',+ '--shadow-2':'0px 1px 1px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2)), 0px 2px 8px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2))',- '--elevation-input-hover': 'inset 0px 0px 0px 2px rgba(1, 113, 227, 0.3)',- '--elevation-input-hover-success':+ '--shadow-3':+ '0px 1px 2px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2)), 0px 2px 12px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2))',+ '--shadow-4':+ '0px 2px 2px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2)), 0px 8px 24px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3))',+ // Inset shadows for input border rings (interaction + validation states)+ '--insetshadow-border-hover': 'inset 0px 0px 0px 2px rgba(1, 113, 227, 0.3)',+ '--insetshadow-border-accent': 'inset 0px 0px 0px 2px rgba(1, 113, 227, 0.5)',+ '--insetshadow-border-positive':'inset 0px 0px 0px 2px rgba(38, 167, 86, 0.3)',- '--elevation-input-hover-warning':+ '--insetshadow-border-warning':'inset 0px 0px 0px 2px rgba(226, 164, 0, 0.3)',- '--elevation-input-hover-error':+ '--insetshadow-border-negative':'inset 0px 0px 0px 2px rgba(227, 25, 59, 0.3)',} as const;-/** @deprecated Use elevationDefaults */-export const elevationRaw = elevationDefaults;+/** @deprecated Use shadowDefaults */+export const shadowRaw = shadowDefaults;-export const elevationVars = stylex.defineVars(elevationDefaults);+export const shadowVars = stylex.defineVars(shadowDefaults);// =============================================================================// Motion Tokens — Duration@@ -353,7 +358,7 @@ export type ColorVarName = keyof typeof colorDefaults;export type SpacingVarName = keyof typeof spacingDefaults;export type SizeVarName = keyof typeof sizeDefaults;export type RadiusVarName = keyof typeof radiusDefaults;-export type ElevationVarName = keyof typeof elevationDefaults;+export type ShadowVarName = keyof typeof shadowDefaults;/** @deprecated Use DurationVarName | EasingVarName instead */export type TransitionVarName = keyof typeof transitionDefaults;export type TypographyVarName = keyof typeof typographyDefaults;diff --git a/packages/themes/neutral/src/neutralTheme.ts b/packages/themes/neutral/src/neutralTheme.tsindex 6352e2ba6c..c049e47821 100644--- a/packages/themes/neutral/src/neutralTheme.ts+++ b/packages/themes/neutral/src/neutralTheme.ts@@ -269,22 +269,24 @@ export const neutralTheme = defineTheme({'--radius-rounded': '9999px',// =========================================================================- // Elevation — oklch-based shadows+ // Shadows — oklch-based// =========================================================================- '--elevation-base':- '0 1px 2px light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 20%))',- '--elevation-dialog':- '0 4px 6px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 25%)), 0 12px 24px light-dark(oklch(0 0 0 / 15%), oklch(0 0 0 / 35%))',- '--elevation-hover':- '0 2px 4px light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 15%)), 0 4px 12px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 20%))',- '--elevation-menu':+ '--shadow-1': '0 1px 2px light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 20%))',+ '--shadow-2':'0 2px 4px light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 15%)), 0 4px 8px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 20%))',- '--elevation-input-hover': 'inset 0px 0px 0px 2px rgba(1, 113, 227, 0.3)',- '--elevation-input-hover-success':+ '--shadow-3':+ '0 2px 4px light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 15%)), 0 4px 12px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 20%))',+ '--shadow-4':+ '0 4px 6px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 25%)), 0 12px 24px light-dark(oklch(0 0 0 / 15%), oklch(0 0 0 / 35%))',+ '--insetshadow-border-hover':+ 'inset 0px 0px 0px 2px rgba(1, 113, 227, 0.3)',+ '--insetshadow-border-accent':+ 'inset 0px 0px 0px 2px rgba(1, 113, 227, 0.5)',+ '--insetshadow-border-positive':'inset 0px 0px 0px 2px rgba(38, 167, 86, 0.3)',- '--elevation-input-hover-warning':+ '--insetshadow-border-warning':'inset 0px 0px 0px 2px rgba(226, 164, 0, 0.3)',- '--elevation-input-hover-error':+ '--insetshadow-border-negative':'inset 0px 0px 0px 2px rgba(227, 25, 59, 0.3)',// =========================================================================