Skip to content

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

TypeScript

refactor(lab): fully unprefix @xds/lab — XDS* -> bare names (no compat) (#2954)

EJ Hammond040d815a4caf
diff --git a/apps/storybook/stories/Chart.stories.tsx b/apps/storybook/stories/Chart.stories.tsx
index 7666bceb4c..da468aebac 100644
--- a/apps/storybook/stories/Chart.stories.tsx
+++ b/apps/storybook/stories/Chart.stories.tsx
@@ -3,31 +3,31 @@
import type {Meta, StoryObj} from '@storybook/react';
import {useMemo} from 'react';
import {
- XDSChart,
- XDSChartAxis,
- XDSChartGrid,
- XDSChartBar,
- XDSChartLine,
- XDSChartDot,
- XDSChartArea,
- XDSChartTooltip,
- XDSChartLegend,
- XDSChartDotGL,
- XDSChartHeatmapGL,
- useXDSChartColors,
+ Chart,
+ ChartAxis,
+ ChartGrid,
+ ChartBar,
+ ChartLine,
+ ChartDot,
+ ChartArea,
+ ChartTooltip,
+ ChartLegend,
+ ChartDotGL,
+ ChartHeatmapGL,
+ useChartColors,
} from '@xds/lab';
import {Stack, Text} from '@xds/core';
import {useDataset} from './useDataset';
/**
- * `XDSChart` — composable chart system built on d3. All marks share a single
+ * `Chart` — composable chart system built on d3. All marks share a single
* coordinate space via React context.
*
* Datasets from [vega-datasets](https://github.com/vega/vega-datasets) (CDN).
*/
-const meta: Meta<typeof XDSChart> = {
+const meta: Meta<typeof Chart> = {
title: 'Lab/Chart',
- component: XDSChart,
+ component: Chart,
tags: ['autodocs'],
};
@@ -43,7 +43,7 @@ type Gapminder = {country: string; year: number; life_expect: number};
/** Iowa barley yields — average by variety (barley.json) */
export const BarChart: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
const [raw, loading] = useDataset<Barley>('barley.json');
const data = useMemo(() => {
if (!raw.length) {
@@ -68,13 +68,13 @@ export const BarChart: StoryObj = {
return <Text type="supporting">Loading…</Text>;
}
return (
- <XDSChart data={data} xKey="variety" yKeys={['avgYield']} height={300}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartBar dataKey="avgYield" color={colors.categorical(1)[0]} />
- <XDSChartTooltip />
- </XDSChart>
+ <Chart data={data} xKey="variety" yKeys={['avgYield']} height={300}>
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartBar dataKey="avgYield" color={colors.categorical(1)[0]} />
+ <ChartTooltip />
+ </Chart>
);
},
};
@@ -82,7 +82,7 @@ export const BarChart: StoryObj = {
/** AAPL vs GOOG monthly prices (stocks.csv) */
export const LineChart: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
const [raw, loading] = useDataset<Stock>('stocks.csv');
const data = useMemo(() => {
if (!raw.length) {
@@ -106,25 +106,25 @@ export const LineChart: StoryObj = {
}
const c = colors.categorical(2);
return (
- <XDSChart
+ <Chart
data={data}
xKey="date"
yKeys={['AAPL', 'GOOG']}
yBaseline="data"
height={300}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartLine dataKey="AAPL" color={c[0]} dots />
- <XDSChartLine dataKey="GOOG" color={c[1]} dots />
- <XDSChartLegend
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartLine dataKey="AAPL" color={c[0]} dots />
+ <ChartLine dataKey="GOOG" color={c[1]} dots />
+ <ChartLegend
items={[
{label: 'AAPL', color: c[0]},
{label: 'GOOG', color: c[1]},
]}
/>
- <XDSChartTooltip />
- </XDSChart>
+ <ChartTooltip />
+ </Chart>
);
},
};
@@ -132,7 +132,7 @@ export const LineChart: StoryObj = {
/** Horsepower vs MPG — 406 cars (cars.json) */
export const ScatterPlot: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
const [raw, loading] = useDataset<Car>('cars.json');
const data = useMemo(() => {
return raw
@@ -143,22 +143,22 @@ export const ScatterPlot: StoryObj = {
return <Text type="supporting">Loading…</Text>;
}
return (
- <XDSChart
+ <Chart
data={data}
xKey="hp"
yKeys={['mpg']}
yBaseline="data"
height={350}>
- <XDSChartGrid horizontal vertical />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartDot
+ <ChartGrid horizontal vertical />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartDot
dataKey="mpg"
color={colors.categorical(1)[0]}
radius={3}
/>
- <XDSChartTooltip crosshair="xy" />
- </XDSChart>
+ <ChartTooltip crosshair="xy" />
+ </Chart>
);
},
};
@@ -166,7 +166,7 @@ export const ScatterPlot: StoryObj = {
/** Flight delay vs distance — 10k points via WebGL (flights-10k.json) */
export const WebGLScatter: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
const [raw, loading] = useDataset<Flight>('flights-10k.json');
const data = useMemo(() => {
return raw
@@ -181,22 +181,22 @@ export const WebGLScatter: StoryObj = {
<Text type="supporting" color="secondary">
{data.length.toLocaleString()} flights
</Text>
- <XDSChart
+ <Chart
data={data}
xKey="distance"
yKeys={['delay']}
yBaseline="zero"
height={400}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartDotGL
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartDotGL
dataKey="delay"
color={colors.categorical(1)[0]}
size={3}
opacity={0.3}
/>
- </XDSChart>
+ </Chart>
</Stack>
);
},
@@ -205,7 +205,7 @@ export const WebGLScatter: StoryObj = {
/** Seattle temperature range — monthly avg min/max band (seattle-weather.csv) */
export const ConfidenceBand: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
const [raw, loading] = useDataset<Weather>('seattle-weather.csv');
const data = useMemo(() => {
if (!raw.length) {
@@ -237,24 +237,24 @@ export const ConfidenceBand: StoryObj = {
return <Text type="supporting">Loading…</Text>;
}
return (
- <XDSChart
+ <Chart
data={data}
xKey="month"
yKeys={['avgMax', 'avgMin']}
yBaseline="data"
height={300}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartArea
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartArea
yUpper="avgMax"
yLower="avgMin"
color={colors.categorical(1)[0]}
opacity={0.15}
/>
- <XDSChartLine dataKey="avgMid" color={colors.categorical(1)[0]} dots />
- <XDSChartTooltip />
- </XDSChart>
+ <ChartLine dataKey="avgMid" color={colors.categorical(1)[0]} dots />
+ <ChartTooltip />
+ </Chart>
);
},
};
@@ -262,7 +262,7 @@ export const ConfidenceBand: StoryObj = {
/** Life expectancy by country × decade (gapminder.json) */
export const Heatmap: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
const [raw, loading] = useDataset<Gapminder>('gapminder.json');
const data = useMemo(() => {
if (!raw.length) {
@@ -295,20 +295,20 @@ export const Heatmap: StoryObj = {
return <Text type="supporting">Loading…</Text>;
}
return (
- <XDSChart data={data} xKey="year" yKeys={['lifeExp']} height={300}>
- <XDSChartAxis position="bottom" />
- <XDSChartHeatmapGL
+ <Chart data={data} xKey="year" yKeys={['lifeExp']} height={300}>
+ <ChartAxis position="bottom" />
+ <ChartHeatmapGL
xKey="year"
yKey="country"
valueKey="lifeExp"
colorRange={colors.sequential.blue(5)}
/>
- <XDSChartLegend
+ <ChartLegend
gradient={colors.sequential.blue(5)}
domain={[30, 85]}
label="Life Expectancy"
/>
- </XDSChart>
+ </Chart>
);
},
};
diff --git a/apps/storybook/stories/ChartAdvanced.stories.tsx b/apps/storybook/stories/ChartAdvanced.stories.tsx
index a998bc3be6..7b535e11ca 100644
--- a/apps/storybook/stories/ChartAdvanced.stories.tsx
+++ b/apps/storybook/stories/ChartAdvanced.stories.tsx
@@ -2,16 +2,16 @@
import type {Meta, StoryObj} from '@storybook/react';
import {
- XDSChart,
- XDSChartAxis,
- XDSChartGrid,
- XDSChartBar,
- XDSChartLine,
- XDSChartArea,
- XDSChartErrorBar,
- XDSChartCandlestick,
- XDSChartLegend,
- useXDSChartColors,
+ Chart,
+ ChartAxis,
+ ChartGrid,
+ ChartBar,
+ ChartLine,
+ ChartArea,
+ ChartErrorBar,
+ ChartCandlestick,
+ ChartLegend,
+ useChartColors,
} from '@xds/lab';
import {Stack, Text} from '@xds/core';
import {Heading} from '@xds/core/Text';
@@ -29,40 +29,40 @@ const ciData = [
];
function ConfidenceIntervalsDemo() {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
const c = colors.categorical(3);
return (
<Stack direction="vertical" gap={4}>
<Heading level={3}>Confidence Intervals</Heading>
- <XDSChart
+ <Chart
data={ciData}
xKey="month"
yKeys={['upper95', 'lower95']}
height={300}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartArea
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartArea
yUpper="upper95"
yLower="lower95"
color={c[0]}
opacity={0.1}
/>
- <XDSChartArea
+ <ChartArea
yUpper="upper80"
yLower="lower80"
color={c[0]}
opacity={0.2}
/>
- <XDSChartLine dataKey="mean" color={c[0]} dots />
- <XDSChartLegend
+ <ChartLine dataKey="mean" color={c[0]} dots />
+ <ChartLegend
items={[
{label: 'Mean', color: c[0]},
{label: '80% CI', color: colors.alpha(c[0], 0.3)},
{label: '95% CI', color: colors.alpha(c[0], 0.15)},
]}
/>
- </XDSChart>
+ </Chart>
</Stack>
);
}
@@ -71,27 +71,27 @@ export const ConfidenceIntervals: StoryObj = {
};
function UpperConfidenceDemo() {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
const c = colors.categorical(3);
return (
<Stack direction="vertical" gap={4}>
<Heading level={3}>Upper Confidence Only</Heading>
- <XDSChart
+ <Chart
data={ciData}
xKey="month"
yKeys={['upper95', 'mean']}
height={300}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartArea
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartArea
yUpper="upper95"
baseline="mean"
color={c[1]}
opacity={0.2}
/>
- <XDSChartLine dataKey="mean" color={c[1]} dots />
- </XDSChart>
+ <ChartLine dataKey="mean" color={c[1]} dots />
+ </Chart>
</Stack>
);
}
@@ -108,21 +108,21 @@ const errorData = [
];
function ErrorBarsDemo() {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
return (
<Stack direction="vertical" gap={4}>
<Heading level={3}>Bar Chart with Error Bars</Heading>
- <XDSChart
+ <Chart
data={errorData}
xKey="category"
yKeys={['upper', 'lower']}
height={300}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartBar dataKey="value" color={colors.categorical(1)[0]} />
- <XDSChartErrorBar yUpper="upper" yLower="lower" />
- </XDSChart>
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartBar dataKey="value" color={colors.categorical(1)[0]} />
+ <ChartErrorBar yUpper="upper" yLower="lower" />
+ </Chart>
</Stack>
);
}
@@ -140,39 +140,39 @@ export const Candlestick: StoryObj = {
render: () => (
<Stack direction="vertical" gap={4}>
<Heading level={3}>Candlestick (OHLC)</Heading>
- <XDSChart
+ <Chart
data={ohlcData}
xKey="day"
yKeys={['high', 'low']}
yBaseline="data"
height={300}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartCandlestick high="high" low="low" open="open" close="close" />
- </XDSChart>
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartCandlestick high="high" low="low" open="open" close="close" />
+ </Chart>
</Stack>
),
};
function CandlestickBarDemo() {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
return (
<Stack direction="vertical" gap={4}>
<Heading level={3}>OHLC Bar</Heading>
<Text type="supporting" color="secondary">
Vertical line for range, left tick at open, right tick at close.
</Text>
- <XDSChart
+ <Chart
data={ohlcData}
xKey="day"
yKeys={['high', 'low']}
yBaseline="data"
height={300}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartCandlestick
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartCandlestick
variant="bar"
high="high"
low="low"
@@ -180,7 +180,7 @@ function CandlestickBarDemo() {
close="close"
color={colors.categorical(1)[0]}
/>
- </XDSChart>
+ </Chart>
</Stack>
);
}
@@ -196,35 +196,35 @@ const plData = [
];
function ZeroCenteredDemo() {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
return (
<Stack direction="vertical" gap={4}>
<Heading level={3}>
Zero-Centered (yBaseline=&quot;zero&quot;)
</Heading>
- <XDSChart
+ <Chart
data={plData}
xKey="month"
yKeys={['profit']}
yBaseline="zero"
height={300}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartBar dataKey="profit" color={colors.categorical(1)[0]} />
- </XDSChart>
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartBar dataKey="profit" color={colors.categorical(1)[0]} />
+ </Chart>
</Stack>
);
}
export const ZeroCentered: StoryObj = {render: () => <ZeroCenteredDemo />};
function GradientLegendDemo() {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
return (
<Stack direction="vertical" gap={6}>
<Heading level={3}>Gradient Legends</Heading>
<Stack direction="vertical" gap={4}>
- <XDSChart
+ <Chart
data={[
{x: 0, v: 0},
{x: 1, v: 100},
@@ -232,13 +232,13 @@ function GradientLegendDemo() {
xKey="x"
yKeys={['v']}
height={80}>
- <XDSChartLegend
+ <ChartLegend
gradient={colors.sequential.blue(5)}
domain={[0, 100]}
label="Temperature"
/>
- </XDSChart>
- <XDSChart
+ </Chart>
+ <Chart
data={[
{x: 0, v: -50},
{x: 1, v: 50},
@@ -246,14 +246,14 @@ function GradientLegendDemo() {
xKey="x"
yKeys={['v']}
height={80}>
- <XDSChartLegend
+ <ChartLegend
gradient={colors.diverging.coldHot(7)}
domain={[-50, 50]}
label="Change %"
tickFormat={v => `${v > 0 ? '+' : ''}${v}%`}
/>
- </XDSChart>
- <XDSChart
+ </Chart>
+ <Chart
data={[
{x: 0, v: 0},
{x: 1, v: 1},
@@ -261,13 +261,13 @@ function GradientLegendDemo() {
xKey="x"
yKeys={['v']}
height={80}>
- <XDSChartLegend
+ <ChartLegend
gradient={colors.diverging.positiveNegative(9)}
domain={[-100, 100]}
label="Profit/Loss"
ticks={5}
/>
- </XDSChart>
+ </Chart>
</Stack>
</Stack>
);
diff --git a/apps/storybook/stories/ChartCoordinated.stories.tsx b/apps/storybook/stories/ChartCoordinated.stories.tsx
index e3650eac87..b60ecfa26e 100644
--- a/apps/storybook/stories/ChartCoordinated.stories.tsx
+++ b/apps/storybook/stories/ChartCoordinated.stories.tsx
@@ -3,14 +3,14 @@
import type {Meta, StoryObj} from '@storybook/react';
import {useState, useMemo} from 'react';
import {
- XDSChart,
- XDSChartAxis,
- XDSChartGrid,
- XDSChartDot,
- XDSChartBar,
- XDSChartBrush,
- XDSChartReferenceLine,
- useXDSChartColors,
+ Chart,
+ ChartAxis,
+ ChartGrid,
+ ChartDot,
+ ChartBar,
+ ChartBrush,
+ ChartReferenceLine,
+ useChartColors,
} from '@xds/lab';
import {Stack, Text} from '@xds/core';
import {Heading} from '@xds/core/Text';
@@ -31,7 +31,7 @@ type Car = {
/** Brush on scatter filters bar chart + table — coordinated views */
export const CoordinatedViews: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
const [raw] = useDataset<Car>('cars.json');
const [brushRange, setBrushRange] = useState<[number, number] | null>(null);
@@ -109,50 +109,50 @@ export const CoordinatedViews: StoryObj = {
{/* Scatter with brush */}
<Stack direction="vertical" gap={1}>
<Text type="label">Horsepower vs MPG</Text>
- <XDSChart
+ <Chart
data={scatterData}
xKey="hp"
yKeys={['mpg']}
yBaseline="data"
height={280}>
- <XDSChartGrid horizontal vertical />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartDot dataKey="mpg" color={c[0]} radius={3} />
- <XDSChartBrush
+ <ChartGrid horizontal vertical />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartDot dataKey="mpg" color={c[0]} radius={3} />
+ <ChartBrush
onBrush={range => setBrushRange(range.x)}
onClear={() => setBrushRange(null)}
/>
{brushRange && (
<>
- <XDSChartReferenceLine
+ <ChartReferenceLine
x={brushRange[0]}
color={c[0]}
strokeDasharray="none"
/>
- <XDSChartReferenceLine
+ <ChartReferenceLine
x={brushRange[1]}
color={c[0]}
strokeDasharray="none"
/>
</>
)}
- </XDSChart>
+ </Chart>
</Stack>
{/* Bar chart — reacts to brush */}
<Stack direction="vertical" gap={1}>
<Text type="label">Average MPG by Origin (filtered)</Text>
- <XDSChart
+ <Chart
data={barData}
xKey="origin"
yKeys={['avgMpg']}
height={200}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartBar dataKey="avgMpg" color={c[1]} />
- </XDSChart>
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartBar dataKey="avgMpg" color={c[1]} />
+ </Chart>
</Stack>
{/* Table — reacts to brush */}
diff --git a/apps/storybook/stories/ChartDotGL.stories.tsx b/apps/storybook/stories/ChartDotGL.stories.tsx
index ab2a6190b9..40a018ab6e 100644
--- a/apps/storybook/stories/ChartDotGL.stories.tsx
+++ b/apps/storybook/stories/ChartDotGL.stories.tsx
@@ -2,12 +2,12 @@
import type {Meta, StoryObj} from '@storybook/react';
import {
- XDSChart,
- XDSChartAxis,
- XDSChartGrid,
- XDSChartDot,
- XDSChartDotGL,
- useXDSChartColors,
+ Chart,
+ ChartAxis,
+ ChartGrid,
+ ChartDot,
+ ChartDotGL,
+ useChartColors,
} from '@xds/lab';
import {Stack, Text} from '@xds/core';
import {Heading} from '@xds/core/Text';
@@ -25,29 +25,29 @@ const largeData = Array.from({length: 5000}, () => ({
}));
function SVGvsWebGLDemo() {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
const c = colors.categorical(2);
return (
<Stack direction="vertical" gap={6}>
<Heading level={3}>SVG vs WebGL</Heading>
<Stack direction="horizontal" gap={6}>
<Stack direction="vertical" gap={1}>
- <Text type="label">SVG (XDSChartDot)</Text>
- <XDSChart data={smallData} xKey="x" yKeys={['y']} height={250}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartDot dataKey="y" color={c[0]} radius={4} />
- </XDSChart>
+ <Text type="label">SVG (ChartDot)</Text>
+ <Chart data={smallData} xKey="x" yKeys={['y']} height={250}>
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartDot dataKey="y" color={c[0]} radius={4} />
+ </Chart>
</Stack>
<Stack direction="vertical" gap={1}>
- <Text type="label">WebGL (XDSChartDotGL)</Text>
- <XDSChart data={smallData} xKey="x" yKeys={['y']} height={250}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartDotGL dataKey="y" color={c[0]} size={8} />
- </XDSChart>
+ <Text type="label">WebGL (ChartDotGL)</Text>
+ <Chart data={smallData} xKey="x" yKeys={['y']} height={250}>
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartDotGL dataKey="y" color={c[0]} size={8} />
+ </Chart>
</Stack>
</Stack>
</Stack>
@@ -56,21 +56,21 @@ function SVGvsWebGLDemo() {
export const SVGvsWebGL: StoryObj = {render: () => <SVGvsWebGLDemo />};
function LargeDatasetDemo() {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
return (
<Stack direction="vertical" gap={4}>
<Heading level={3}>WebGL \u2014 5,000 points</Heading>
- <XDSChart data={largeData} xKey="x" yKeys={['y']} height={400}>
- <XDSChartGrid horizontal vertical />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartDotGL
+ <Chart data={largeData} xKey="x" yKeys={['y']} height={400}>
+ <ChartGrid horizontal vertical />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartDotGL
dataKey="y"
color={colors.categorical(1)[0]}
size={4}
opacity={0.5}
/>
- </XDSChart>
+ </Chart>
</Stack>
);
}
diff --git a/apps/storybook/stories/ChartDotGLInteractive.stories.tsx b/apps/storybook/stories/ChartDotGLInteractive.stories.tsx
index cb761b9e0e..33f273de21 100644
--- a/apps/storybook/stories/ChartDotGLInteractive.stories.tsx
+++ b/apps/storybook/stories/ChartDotGLInteractive.stories.tsx
@@ -2,11 +2,11 @@
import type {Meta, StoryObj} from '@storybook/react';
import {
- XDSChart,
- XDSChartAxis,
- XDSChartGrid,
- XDSChartDotGLInteractive,
- useXDSChartColors,
+ Chart,
+ ChartAxis,
+ ChartGrid,
+ ChartDotGLInteractive,
+ useChartColors,
} from '@xds/lab';
import {Stack, Text} from '@xds/core';
import {Heading} from '@xds/core/Text';
@@ -24,39 +24,39 @@ const bigScatter = Array.from({length: 50000}, (_, i) => ({
}));
function GPUPicking5kDemo() {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
return (
<Stack direction="vertical" gap={4}>
<Heading level={3}>GPU Color-Picking \u2014 5,000 points</Heading>
<Text type="supporting" color="secondary">
Hover any point. O(1) via readPixels.
</Text>
- <XDSChart data={scatterData} xKey="x" yKeys={['y']} height={400}>
- <XDSChartGrid horizontal vertical />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartDotGLInteractive
+ <Chart data={scatterData} xKey="x" yKeys={['y']} height={400}>
+ <ChartGrid horizontal vertical />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartDotGLInteractive
dataKey="y"
color={colors.categorical(1)[0]}
size={6}
opacity={0.6}
/>
- </XDSChart>
+ </Chart>
</Stack>
);
}
export const GPUPicking5k: StoryObj = {render: () => <GPUPicking5kDemo />};
function GPUPicking50kDemo() {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
return (
<Stack direction="vertical" gap={4}>
<Heading level={3}>GPU Color-Picking \u2014 50,000 points</Heading>
- <XDSChart data={bigScatter} xKey="x" yKeys={['y']} height={400}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartDotGLInteractive
+ <Chart data={bigScatter} xKey="x" yKeys={['y']} height={400}>
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartDotGLInteractive
dataKey="y"
color={colors.categorical(2)[1]}
size={3}
@@ -69,7 +69,7 @@ function GPUPicking50kDemo() {
</div>
)}
/>
- </XDSChart>
+ </Chart>
</Stack>
);
}
diff --git a/apps/storybook/stories/ChartHeatmapGL.stories.tsx b/apps/storybook/stories/ChartHeatmapGL.stories.tsx
index a5d437d7fb..442b7652ac 100644
--- a/apps/storybook/stories/ChartHeatmapGL.stories.tsx
+++ b/apps/storybook/stories/ChartHeatmapGL.stories.tsx
@@ -2,11 +2,11 @@
import type {Meta, StoryObj} from '@storybook/react';
import {
- XDSChart,
- XDSChartAxis,
- XDSChartHeatmapGL,
- XDSChartLegend,
- useXDSChartColors,
+ Chart,
+ ChartAxis,
+ ChartHeatmapGL,
+ ChartLegend,
+ useChartColors,
type SequentialHue,
} from '@xds/lab';
import {Stack, Text} from '@xds/core';
@@ -38,31 +38,31 @@ const gridData = days.flatMap((day, di) =>
);
function ActivityGridDemo() {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
return (
<Stack direction="vertical" gap={4}>
<Heading level={3}>Heatmap \u2014 Activity by Day x Hour</Heading>
- <XDSChart data={gridData} xKey="hour" yKeys={['activity']} height={280}>
- <XDSChartAxis position="bottom" />
- <XDSChartHeatmapGL
+ <Chart data={gridData} xKey="hour" yKeys={['activity']} height={280}>
+ <ChartAxis position="bottom" />
+ <ChartHeatmapGL
xKey="hour"
yKey="day"
valueKey="activity"
colorRange={colors.sequential.blue(5)}
/>
- <XDSChartLegend
+ <ChartLegend
gradient={colors.sequential.blue(5)}
domain={[0, 100]}
label="Activity"
/>
- </XDSChart>
+ </Chart>
</Stack>
);
}
export const ActivityGrid: StoryObj = {render: () => <ActivityGridDemo />};
function ColorRampsDemo() {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
const hues: SequentialHue[] = ['blue', 'shamrock', 'orange', 'purple', 'red'];
return (
<Stack direction="vertical" gap={6}>
@@ -70,19 +70,19 @@ function ColorRampsDemo() {
{hues.map(hue => (
<Stack key={hue} direction="vertical" gap={1}>
<Text type="label">sequential.{hue}(5)</Text>
- <XDSChart
+ <Chart
data={gridData}
xKey="hour"
yKeys={['activity']}
height={200}>
- <XDSChartAxis position="bottom" />
- <XDSChartHeatmapGL
+ <ChartAxis position="bottom" />
+ <ChartHeatmapGL
xKey="hour"
yKey="day"
valueKey="activity"
colorRange={colors.sequential[hue](5)}
/>
- </XDSChart>
+ </Chart>
</Stack>
))}
</Stack>
@@ -103,24 +103,24 @@ const bigGrid = bigRows.flatMap(row =>
);
function LargeGridDemo() {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
return (
<Stack direction="vertical" gap={4}>
<Heading level={3}>Heatmap \u2014 50x50 Grid</Heading>
- <XDSChart data={bigGrid} xKey="col" yKeys={['value']} height={400}>
- <XDSChartHeatmapGL
+ <Chart data={bigGrid} xKey="col" yKeys={['value']} height={400}>
+ <ChartHeatmapGL
xKey="col"
yKey="row"
valueKey="value"
colorRange={colors.sequential.red(5)}
cellGap={0}
/>
- <XDSChartLegend
+ <ChartLegend
gradient={colors.sequential.red(5)}
domain={[0, 100]}
label="Intensity"
/>
- </XDSChart>
+ </Chart>
</Stack>
);
}
diff --git a/apps/storybook/stories/ChartInteractions.stories.tsx b/apps/storybook/stories/ChartInteractions.stories.tsx
index c9bc0b5337..35c5952d02 100644
--- a/apps/storybook/stories/ChartInteractions.stories.tsx
+++ b/apps/storybook/stories/ChartInteractions.stories.tsx
@@ -3,18 +3,18 @@
import type {Meta, StoryObj} from '@storybook/react';
import {useState, useMemo} from 'react';
import {
- XDSChart,
- XDSChartAxis,
- XDSChartGrid,
- XDSChartLine,
- XDSChartDot,
- XDSChartBar,
- XDSChartBrush,
- XDSChartTooltip,
- XDSChartZoom,
- XDSChartSelect,
- XDSChartReferenceLine,
- useXDSChartColors,
+ Chart,
+ ChartAxis,
+ ChartGrid,
+ ChartLine,
+ ChartDot,
+ ChartBar,
+ ChartBrush,
+ ChartTooltip,
+ ChartZoom,
+ ChartSelect,
+ ChartReferenceLine,
+ useChartColors,
} from '@xds/lab';
import {Stack, Text} from '@xds/core';
import {Heading} from '@xds/core/Text';
@@ -43,7 +43,7 @@ const monthlyData = [
/** 1D brush on a bar chart — select a range of months */
export const BrushBars: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
const [selected, setSelected] = useState<string | null>(null);
return (
<Stack direction="vertical" gap={4}>
@@ -51,20 +51,20 @@ export const BrushBars: StoryObj = {
<Text type="supporting" color="secondary">
Drag to select a range. {selected ?? 'Click to clear.'}
</Text>
- <XDSChart
+ <Chart
data={monthlyData}
xKey="month"
yKeys={['revenue']}
height={300}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartBar dataKey="revenue" color={colors.categorical(1)[0]} />
- <XDSChartBrush
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartBar dataKey="revenue" color={colors.categorical(1)[0]} />
+ <ChartBrush
onBrush={(_, sel) => setSelected(`${sel.length} months selected`)}
onClear={() => setSelected(null)}
/>
- </XDSChart>
+ </Chart>
</Stack>
);
},
@@ -73,7 +73,7 @@ export const BrushBars: StoryObj = {
/** 1D brush on a line chart — select a time range */
export const BrushLine: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
const [selected, setSelected] = useState<string | null>(null);
return (
<Stack direction="vertical" gap={4}>
@@ -81,29 +81,29 @@ export const BrushLine: StoryObj = {
<Text type="supporting" color="secondary">
Drag to select a range. {selected ?? 'Click to clear.'}
</Text>
- <XDSChart
+ <Chart
data={monthlyData}
xKey="month"
yKeys={['revenue', 'expenses']}
height={300}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartLine
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartLine
dataKey="revenue"
color={colors.categorical(2)[0]}
dots
/>
- <XDSChartLine
+ <ChartLine
dataKey="expenses"
color={colors.categorical(2)[1]}
dots
/>
- <XDSChartBrush
+ <ChartBrush
onBrush={(_, sel) => setSelected(`${sel.length} months selected`)}
onClear={() => setSelected(null)}
/>
- </XDSChart>
+ </Chart>
</Stack>
);
},
@@ -112,7 +112,7 @@ export const BrushLine: StoryObj = {
/** 2D rectangular brush on a scatter plot */
export const Brush2D: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
const [raw] = useDataset<Car>('cars.json');
const [count, setCount] = useState<number | null>(null);
const data = useMemo(
@@ -132,26 +132,26 @@ export const Brush2D: StoryObj = {
Drag a rectangle to select.{' '}
{count != null ? `${count} points selected.` : 'Click to clear.'}
</Text>
- <XDSChart
+ <Chart
data={data}
xKey="hp"
yKeys={['mpg']}
yBaseline="data"
height={350}>
- <XDSChartGrid horizontal vertical />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartDot
+ <ChartGrid horizontal vertical />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartDot
dataKey="mpg"
color={colors.categorical(1)[0]}
radius={3}
/>
- <XDSChartBrush
+ <ChartBrush
mode="xy"
onBrush={(_, sel) => setCount(sel.length)}
onClear={() => setCount(null)}
/>
- </XDSChart>
+ </Chart>
</Stack>
);
},
@@ -160,7 +160,7 @@ export const Brush2D: StoryObj = {
/** Crosshair with value readouts */
export const Crosshair: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
const [raw] = useDataset<Car>('cars.json');
const data = useMemo(
() =>
@@ -175,27 +175,27 @@ export const Crosshair: StoryObj = {
return (
<Stack direction="vertical" gap={4}>
<Heading level={3}>Crosshair</Heading>
- <XDSChart
+ <Chart
data={data}
xKey="hp"
yKeys={['mpg']}
yBaseline="data"
height={350}>
- <XDSChartGrid horizontal vertical />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartDot
+ <ChartGrid horizontal vertical />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartDot
dataKey="mpg"
color={colors.categorical(1)[0]}
radius={3}
/>
- <XDSChartTooltip
+ <ChartTooltip
crosshair="xy"
crosshairLabels
xFormat={v => `${Math.round(Number(v))} hp`}
yFormat={v => `${Math.round(v)} mpg`}
/>
- </XDSChart>
+ </Chart>
</Stack>
);
},
@@ -204,7 +204,7 @@ export const Crosshair: StoryObj = {
/** Scroll to zoom, drag to pan */
export const ZoomPan: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
const [raw] = useDataset<Car>('cars.json');
const data = useMemo(
() =>
@@ -225,26 +225,26 @@ export const ZoomPan: StoryObj = {
Scroll to zoom, drag to pan. x: [{Math.round(xDomain[0])},{' '}
{Math.round(xDomain[1])}]
</Text>
- <XDSChart
+ <Chart
data={data}
xKey="hp"
yKeys={['mpg']}
xDomain={xDomain}
yDomain={yDomain}
height={350}>
- <XDSChartGrid horizontal vertical />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartDot
+ <ChartGrid horizontal vertical />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartDot
dataKey="mpg"
color={colors.categorical(1)[0]}
radius={3}
/>
- <XDSChartZoom
+ <ChartZoom
onXDomainChange={setXDomain}
onYDomainChange={setYDomain}
/>
- </XDSChart>
+ </Chart>
</Stack>
);
},
@@ -253,7 +253,7 @@ export const ZoomPan: StoryObj = {
/** Click to select points */
export const ClickSelect: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
const [raw] = useDataset<Car>('cars.json');
const data = useMemo(
() =>
@@ -272,22 +272,22 @@ export const ClickSelect: StoryObj = {
<Text type="supporting" color="secondary">
Click a point. Shift-click for multi. {selected.length} selected.
</Text>
- <XDSChart
+ <Chart
data={data}
xKey="hp"
yKeys={['mpg']}
yBaseline="data"
height={350}>
- <XDSChartGrid horizontal vertical />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartDot
+ <ChartGrid horizontal vertical />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartDot
dataKey="mpg"
color={colors.categorical(1)[0]}
radius={3}
/>
- <XDSChartSelect selected={selected} onSelectionChange={setSelected} />
- </XDSChart>
+ <ChartSelect selected={selected} onSelectionChange={setSelected} />
+ </Chart>
</Stack>
);
},
@@ -296,30 +296,30 @@ export const ClickSelect: StoryObj = {
/** Reference lines for target and average */
export const ReferenceLines: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
return (
<Stack direction="vertical" gap={4}>
<Heading level={3}>Reference Lines</Heading>
- <XDSChart
+ <Chart
data={monthlyData}
xKey="month"
yKeys={['revenue']}
height={300}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartBar dataKey="revenue" color={colors.categorical(1)[0]} />
- <XDSChartReferenceLine
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartBar dataKey="revenue" color={colors.categorical(1)[0]} />
+ <ChartReferenceLine
y={5000}
label="Target"
color={colors.semantic.positive}
/>
- <XDSChartReferenceLine
+ <ChartReferenceLine
y={4700}
label="Average"
color={colors.semantic.neutral}
/>
- </XDSChart>
+ </Chart>
</Stack>
);
},
diff --git a/apps/storybook/stories/ChartStreamGL.stories.tsx b/apps/storybook/stories/ChartStreamGL.stories.tsx
index aca0b187c3..b856ea9582 100644
--- a/apps/storybook/stories/ChartStreamGL.stories.tsx
+++ b/apps/storybook/stories/ChartStreamGL.stories.tsx
@@ -3,12 +3,12 @@
import type {Meta, StoryObj} from '@storybook/react';
import {useRef, useEffect, useState} from 'react';
import {
- XDSChart,
- XDSChartAxis,
- XDSChartGrid,
- XDSChartStreamGL,
- useXDSChartColors,
- type XDSChartStreamGLHandle,
+ Chart,
+ ChartAxis,
+ ChartGrid,
+ ChartStreamGL,
+ useChartColors,
+ type ChartStreamGLHandle,
} from '@xds/lab';
import {Stack, Text} from '@xds/core';
import {Heading} from '@xds/core/Text';
@@ -26,8 +26,8 @@ export default meta;
/** Simulated stock price — GBM with drift and volatility */
export const StockPrice: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
- const streamRef = useRef<XDSChartStreamGLHandle>(null);
+ const colors = useChartColors();
+ const streamRef = useRef<ChartStreamGLHandle>(null);
const priceRef = useRef(150);
const tRef = useRef(0);
const [price, setPrice] = useState(150);
@@ -58,7 +58,7 @@ export const StockPrice: StoryObj = {
<Text type="label">ACME Corp</Text>
<Text type="body">${price.toFixed(2)}</Text>
</Stack>
- <XDSChart
+ <Chart
data={[
{t: 0, v: 130},
{t: 1, v: 170},
@@ -69,16 +69,16 @@ export const StockPrice: StoryObj = {
xDomain={xDomain}
yBaseline="data"
height={220}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartStreamGL
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartStreamGL
handleRef={streamRef}
color={colors.categorical(1)[0]}
bufferSize={400}
lineWidth={1.5}
/>
- </XDSChart>
+ </Chart>
</Stack>
);
},
@@ -89,7 +89,7 @@ export const StockPrice: StoryObj = {
// =============================================================================
function useMetricStream(
- ref: React.RefObject<XDSChartStreamGLHandle | null>,
+ ref: React.RefObject<ChartStreamGLHandle | null>,
setXDomain: (d: [number, number]) => void,
config: {
base: number;
@@ -135,10 +135,10 @@ function useMetricStream(
/** Server dashboard — CPU, Memory, and Network at 30fps */
export const ServerDashboard: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
- const cpuRef = useRef<XDSChartStreamGLHandle>(null);
- const memRef = useRef<XDSChartStreamGLHandle>(null);
- const netRef = useRef<XDSChartStreamGLHandle>(null);
+ const colors = useChartColors();
+ const cpuRef = useRef<ChartStreamGLHandle>(null);
+ const memRef = useRef<ChartStreamGLHandle>(null);
+ const netRef = useRef<ChartStreamGLHandle>(null);
const [cpuX, setCpuX] = useState<[number, number]>([0, 300]);
const [memX, setMemX] = useState<[number, number]>([0, 300]);
const [netX, setNetX] = useState<[number, number]>([0, 300]);
@@ -187,45 +187,45 @@ export const ServerDashboard: StoryObj = {
<Heading level={3}>Server Metrics Dashboard</Heading>
<Stack direction="vertical" gap={1}>
<Text type="label">CPU Usage (%)</Text>
- <XDSChart {...chartProps} xDomain={cpuX}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartStreamGL
+ <Chart {...chartProps} xDomain={cpuX}>
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartStreamGL
handleRef={cpuRef}
color={colors.categorical(3)[0]}
bufferSize={300}
lineWidth={1.5}
/>
- </XDSChart>
+ </Chart>
</Stack>
<Stack direction="vertical" gap={1}>
<Text type="label">Memory Usage (%)</Text>
- <XDSChart {...chartProps} xDomain={memX}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartStreamGL
+ <Chart {...chartProps} xDomain={memX}>
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartStreamGL
handleRef={memRef}
color={colors.categorical(3)[1]}
bufferSize={300}
lineWidth={1.5}
/>
- </XDSChart>
+ </Chart>
</Stack>
<Stack direction="vertical" gap={1}>
<Text type="label">Network I/O (Mbps)</Text>
- <XDSChart {...chartProps} xDomain={netX}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartStreamGL
+ <Chart {...chartProps} xDomain={netX}>
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartStreamGL
handleRef={netRef}
color={colors.categorical(3)[2]}
bufferSize={300}
lineWidth={1.5}
/>
- </XDSChart>
+ </Chart>
</Stack>
</Stack>
);
@@ -239,8 +239,8 @@ export const ServerDashboard: StoryObj = {
/** Seismograph — zero-centered with x-axis */
export const SeismographDemo: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
- const streamRef = useRef<XDSChartStreamGLHandle>(null);
+ const colors = useChartColors();
+ const streamRef = useRef<ChartStreamGLHandle>(null);
const tRef = useRef(0);
const quakeRef = useRef(0);
const [xDomain, setXDomain] = useState<[number, number]>([0, 600]);
@@ -277,7 +277,7 @@ export const SeismographDemo: StoryObj = {
yBaseline=&quot;zero&quot; anchors 0 to center. Both axes from chart
context.
</Text>
- <XDSChart
+ <Chart
data={[
{t: 0, v: -80},
{t: 1, v: 80},
@@ -288,17 +288,17 @@ export const SeismographDemo: StoryObj = {
xDomain={xDomain}
yBaseline="zero"
height={220}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartStreamGL
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartStreamGL
handleRef={streamRef}
color={colors.categorical(5)[3]}
bufferSize={600}
lineWidth={1}
opacity={0.9}
/>
- </XDSChart>
+ </Chart>
</Stack>
);
},
@@ -311,10 +311,10 @@ export const SeismographDemo: StoryObj = {
/** Three streams on one chart sharing xDomain and yDomain */
export const MultiSensorOverlay: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
- const s1Ref = useRef<XDSChartStreamGLHandle>(null);
- const s2Ref = useRef<XDSChartStreamGLHandle>(null);
- const s3Ref = useRef<XDSChartStreamGLHandle>(null);
+ const colors = useChartColors();
+ const s1Ref = useRef<ChartStreamGLHandle>(null);
+ const s2Ref = useRef<ChartStreamGLHandle>(null);
+ const s3Ref = useRef<ChartStreamGLHandle>(null);
const tRef = useRef(0);
const [xDomain, setXDomain] = useState<[number, number]>([0, 400]);
@@ -355,7 +355,7 @@ export const MultiSensorOverlay: StoryObj = {
Three streams sharing one chart, same xDomain, same yDomain=[0, 100].
</Text>
- <XDSChart
+ <Chart
data={[
{t: 0, v: 0},
{t: 1, v: 100},
@@ -365,31 +365,31 @@ export const MultiSensorOverlay: StoryObj = {
yDomain={[0, 100]}
xDomain={xDomain}
height={280}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartStreamGL
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartStreamGL
handleRef={s1Ref}
color={colors.categorical(3)[0]}
bufferSize={400}
lineWidth={1.5}
opacity={0.8}
/>
- <XDSChartStreamGL
+ <ChartStreamGL
handleRef={s2Ref}
color={colors.categorical(3)[1]}
bufferSize={400}
lineWidth={1.5}
opacity={0.8}
/>
- <XDSChartStreamGL
+ <ChartStreamGL
handleRef={s3Ref}
color={colors.categorical(3)[2]}
bufferSize={400}
lineWidth={1.5}
opacity={0.8}
/>
- </XDSChart>
+ </Chart>
</Stack>
);
},
diff --git a/apps/storybook/stories/ChartStreamPerf.stories.tsx b/apps/storybook/stories/ChartStreamPerf.stories.tsx
index 97348ccf6a..22e34be80b 100644
--- a/apps/storybook/stories/ChartStreamPerf.stories.tsx
+++ b/apps/storybook/stories/ChartStreamPerf.stories.tsx
@@ -3,12 +3,12 @@
import type {Meta, StoryObj} from '@storybook/react';
import {useRef, useEffect, useState} from 'react';
import {
- XDSChart,
- XDSChartAxis,
- XDSChartGrid,
- XDSChartStreamGL,
- useXDSChartColors,
- type XDSChartStreamGLHandle,
+ Chart,
+ ChartAxis,
+ ChartGrid,
+ ChartStreamGL,
+ useChartColors,
+ type ChartStreamGLHandle,
} from '@xds/lab';
import {Stack, Text} from '@xds/core';
import {Heading} from '@xds/core/Text';
@@ -25,8 +25,8 @@ export default meta;
*/
export const XDomainUpdateCost: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
- const streamRef = useRef<XDSChartStreamGLHandle>(null);
+ const colors = useChartColors();
+ const streamRef = useRef<ChartStreamGLHandle>(null);
const tRef = useRef(0);
const [xDomain, setXDomain] = useState<[number, number]>([0, 300]);
const [fps, setFps] = useState(0);
@@ -80,7 +80,7 @@ export const XDomainUpdateCost: StoryObj = {
xDomain updates via setState on every requestAnimationFrame
</Text>
</Stack>
- <XDSChart
+ <Chart
data={[
{t: 0, v: 0},
{t: 1, v: 100},
@@ -90,16 +90,16 @@ export const XDomainUpdateCost: StoryObj = {
yDomain={[0, 100]}
xDomain={xDomain}
height={250}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartStreamGL
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartStreamGL
handleRef={streamRef}
color={colors.categorical(1)[0]}
bufferSize={300}
lineWidth={1.5}
/>
- </XDSChart>
+ </Chart>
</Stack>
);
},
@@ -111,8 +111,8 @@ export const XDomainUpdateCost: StoryObj = {
*/
export const ThrottledXDomain: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
- const streamRef = useRef<XDSChartStreamGLHandle>(null);
+ const colors = useChartColors();
+ const streamRef = useRef<ChartStreamGLHandle>(null);
const tRef = useRef(0);
const [xDomain, setXDomain] = useState<[number, number]>([0, 300]);
const [fps, setFps] = useState(0);
@@ -170,7 +170,7 @@ export const ThrottledXDomain: StoryObj = {
xDomain updates every 500ms; WebGL draws every frame
</Text>
</Stack>
- <XDSChart
+ <Chart
data={[
{t: 0, v: 0},
{t: 1, v: 100},
@@ -180,16 +180,16 @@ export const ThrottledXDomain: StoryObj = {
yDomain={[0, 100]}
xDomain={xDomain}
height={250}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartStreamGL
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartStreamGL
handleRef={streamRef}
color={colors.categorical(1)[0]}
bufferSize={300}
lineWidth={1.5}
/>
- </XDSChart>
+ </Chart>
</Stack>
);
},
@@ -200,10 +200,10 @@ export const ThrottledXDomain: StoryObj = {
*/
export const StressTest: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
- const s1 = useRef<XDSChartStreamGLHandle>(null);
- const s2 = useRef<XDSChartStreamGLHandle>(null);
- const s3 = useRef<XDSChartStreamGLHandle>(null);
+ const colors = useChartColors();
+ const s1 = useRef<ChartStreamGLHandle>(null);
+ const s2 = useRef<ChartStreamGLHandle>(null);
+ const s3 = useRef<ChartStreamGLHandle>(null);
const tRef = useRef(0);
const [xDomain, setXDomain] = useState<[number, number]>([0, 400]);
const [fps, setFps] = useState(0);
@@ -263,7 +263,7 @@ export const StressTest: StoryObj = {
Stress: 3 streams + axes + grid @ 60fps
</Heading>
<Text type="label">FPS: {fps}</Text>
- <XDSChart
+ <Chart
data={[
{t: 0, v: 0},
{t: 1, v: 100},
@@ -273,31 +273,31 @@ export const StressTest: StoryObj = {
yDomain={[0, 100]}
xDomain={xDomain}
height={300}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartStreamGL
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartStreamGL
handleRef={s1}
color={c[0]}
bufferSize={400}
lineWidth={1.5}
opacity={0.8}
/>
- <XDSChartStreamGL
+ <ChartStreamGL
handleRef={s2}
color={c[1]}
bufferSize={400}
lineWidth={1.5}
opacity={0.8}
/>
- <XDSChartStreamGL
+ <ChartStreamGL
handleRef={s3}
color={c[2]}
bufferSize={400}
lineWidth={1.5}
opacity={0.8}
/>
- </XDSChart>
+ </Chart>
</Stack>
);
},
diff --git a/apps/storybook/stories/ChartV2.stories.tsx b/apps/storybook/stories/ChartV2.stories.tsx
index 7483bfc84c..f83ae88366 100644
--- a/apps/storybook/stories/ChartV2.stories.tsx
+++ b/apps/storybook/stories/ChartV2.stories.tsx
@@ -1,16 +1,16 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
import type {Meta, StoryObj} from '@storybook/react';
-import {XDSChartV2 as XDSChart, bar, line, area} from '@xds/lab';
+import {ChartV2 as Chart, bar, line, area} from '@xds/lab';
import {
- XDSChartV2Grid as XDSChartGrid,
- XDSChartV2Axis as XDSChartAxis,
+ ChartV2Grid as ChartGrid,
+ ChartV2Axis as ChartAxis,
currency,
} from '@xds/lab';
-const meta: Meta<typeof XDSChart> = {
+const meta: Meta<typeof Chart> = {
title: 'Lab/ChartV2',
- component: XDSChart,
+ component: Chart,
};
export default meta;
@@ -35,17 +35,17 @@ const groupedStackData = [
/** Simple bar chart */
export const SimpleBar: StoryObj = {
render: () => (
- <XDSChart
+ <Chart
data={monthlyData}
xKey="month"
title="Monthly Revenue"
series={[bar('revenue', {color: '#3b82f6'})]}
tooltip={true}
- grid={<XDSChartGrid />}
+ grid={<ChartGrid />}
axes={
<>
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" tickFormat={currency()} />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" tickFormat={currency()} />
</>
}
height={300}
@@ -56,16 +56,16 @@ export const SimpleBar: StoryObj = {
/** Simple line chart */
export const SimpleLine: StoryObj = {
render: () => (
- <XDSChart
+ <Chart
data={monthlyData}
xKey="month"
series={[line('trend', {color: '#3b82f6'})]}
tooltip={true}
- grid={<XDSChartGrid />}
+ grid={<ChartGrid />}
axes={
<>
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
</>
}
height={300}
@@ -76,7 +76,7 @@ export const SimpleLine: StoryObj = {
/** Stacked bars */
export const StackedBars: StoryObj = {
render: () => (
- <XDSChart
+ <Chart
data={monthlyData}
xKey="month"
title="Revenue & Costs"
@@ -86,11 +86,11 @@ export const StackedBars: StoryObj = {
bar('costs', {color: '#ef4444', stack: 'totals', label: 'Costs'}),
]}
legend={{position: 'bottom', alignment: 'center'}}
- grid={<XDSChartGrid />}
+ grid={<ChartGrid />}
axes={
<>
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
</>
}
height={300}
@@ -101,7 +101,7 @@ export const StackedBars: StoryObj = {
/** Grouped bars */
export const GroupedBars: StoryObj = {
render: () => (
- <XDSChart
+ <Chart
data={monthlyData}
xKey="month"
title="Revenue vs Costs"
@@ -110,11 +110,11 @@ export const GroupedBars: StoryObj = {
bar('costs', {color: '#ef4444', group: 'compare', label: 'Costs'}),
]}
legend={{position: 'top', alignment: 'end'}}
- grid={<XDSChartGrid />}
+ grid={<ChartGrid />}
axes={
<>
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
</>
}
height={300}
@@ -125,7 +125,7 @@ export const GroupedBars: StoryObj = {
/** Grouped stacked bars — two stacks side by side per x value */
export const GroupedStackedBars: StoryObj = {
render: () => (
- <XDSChart
+ <Chart
data={groupedStackData}
xKey="month"
series={[
@@ -144,11 +144,11 @@ export const GroupedStackedBars: StoryObj = {
}),
bar('costsB', {color: '#fca5a5', stack: 'stackB', group: 'comparison'}),
]}
- grid={<XDSChartGrid />}
+ grid={<ChartGrid />}
axes={
<>
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
</>
}
height={300}
@@ -159,7 +159,7 @@ export const GroupedStackedBars: StoryObj = {
/** Mixed: bars + line */
export const MixedMarks: StoryObj = {
render: () => (
- <XDSChart
+ <Chart
data={monthlyData}
xKey="month"
title="Revenue vs Trend"
@@ -170,11 +170,11 @@ export const MixedMarks: StoryObj = {
]}
tooltip={true}
legend={{position: 'end', alignment: 'start'}}
- grid={<XDSChartGrid />}
+ grid={<ChartGrid />}
axes={
<>
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
</>
}
height={300}
@@ -185,7 +185,7 @@ export const MixedMarks: StoryObj = {
/** Area with gradient */
export const AreaGradient: StoryObj = {
render: () => (
- <XDSChart
+ <Chart
data={monthlyData}
xKey="month"
title="Revenue Over Time"
@@ -193,11 +193,11 @@ export const AreaGradient: StoryObj = {
area('revenue', {color: '#3b82f6', gradient: true}),
line('revenue', {color: '#3b82f6'}),
]}
- grid={<XDSChartGrid />}
+ grid={<ChartGrid />}
axes={
<>
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
</>
}
height={300}
@@ -208,7 +208,7 @@ export const AreaGradient: StoryObj = {
/** Stacked areas */
export const StackedAreas: StoryObj = {
render: () => (
- <XDSChart
+ <Chart
data={monthlyData}
xKey="month"
title="Revenue & Costs Over Time"
@@ -217,11 +217,11 @@ export const StackedAreas: StoryObj = {
area('costs', {color: '#ef4444', stack: 'total', label: 'Costs'}),
]}
legend={true}
- grid={<XDSChartGrid />}
+ grid={<ChartGrid />}
axes={
<>
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
</>
}
height={300}
@@ -241,18 +241,18 @@ const profitLossData = [
/** Mixed marks with negative values */
export const NegativeValues: StoryObj = {
render: () => (
- <XDSChart
+ <Chart
data={profitLossData}
xKey="month"
series={[
bar('profit', {color: '#3b82f6'}),
line('trend', {color: '#f59e0b', dots: true, strokeWidth: 2}),
]}
- grid={<XDSChartGrid />}
+ grid={<ChartGrid />}
axes={
<>
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
</>
}
height={300}
diff --git a/apps/storybook/stories/ChartV2Advanced.stories.tsx b/apps/storybook/stories/ChartV2Advanced.stories.tsx
index fb3fe62fcb..3089ca5cb1 100644
--- a/apps/storybook/stories/ChartV2Advanced.stories.tsx
+++ b/apps/storybook/stories/ChartV2Advanced.stories.tsx
@@ -3,7 +3,7 @@
import type {Meta, StoryObj} from '@storybook/react';
import {useMemo, useRef, useEffect, type MutableRefObject} from 'react';
import {
- XDSChartV2 as XDSChart,
+ ChartV2 as Chart,
bar,
line,
band,
@@ -16,13 +16,13 @@ import {
type StreamGLHandle,
} from '@xds/lab';
import {
- XDSChartV2Grid as XDSChartGrid,
- XDSChartV2Axis as XDSChartAxis,
+ ChartV2Grid as ChartGrid,
+ ChartV2Axis as ChartAxis,
} from '@xds/lab';
-const meta: Meta<typeof XDSChart> = {
+const meta: Meta<typeof Chart> = {
title: 'Lab/ChartV2Advanced',
- component: XDSChart,
+ component: Chart,
};
export default meta;
@@ -92,7 +92,7 @@ for (const day of days) {
/** Candlestick chart */
export const Candlestick: StoryObj = {
render: () => (
- <XDSChart
+ <Chart
data={stockData}
xKey="day"
series={[
@@ -105,11 +105,11 @@ export const Candlestick: StoryObj = {
downColor: '#ef4444',
}),
]}
- grid={<XDSChartGrid />}
+ grid={<ChartGrid />}
axes={
<>
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
</>
}
height={350}
@@ -142,7 +142,7 @@ export const FinancialComposite: StoryObj = {
});
}, []);
return (
- <XDSChart
+ <Chart
data={data}
xKey="day"
series={[
@@ -157,11 +157,11 @@ export const FinancialComposite: StoryObj = {
line('ma5', {color: '#f59e0b', strokeWidth: 1.5}),
bar('volume', {color: '#94a3b8', opacity: 0.3}),
]}
- grid={<XDSChartGrid />}
+ grid={<ChartGrid />}
axes={
<>
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
</>
}
height={400}
@@ -173,7 +173,7 @@ export const FinancialComposite: StoryObj = {
/** Confidence bands (80% + 95%) */
export const ConfidenceBands: StoryObj = {
render: () => (
- <XDSChart
+ <Chart
data={predictionData}
xKey="x"
series={[
@@ -191,11 +191,11 @@ export const ConfidenceBands: StoryObj = {
}),
line('mean', {color: '#3b82f6', strokeWidth: 2}),
]}
- grid={<XDSChartGrid />}
+ grid={<ChartGrid />}
axes={
<>
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
</>
}
height={300}
@@ -207,7 +207,7 @@ export const ConfidenceBands: StoryObj = {
export const ErrorBarsWithTarget: StoryObj = {
name: 'Error Bars + Reference Line',
render: () => (
- <XDSChart
+ <Chart
data={salesData}
xKey="month"
series={[
@@ -222,11 +222,11 @@ export const ErrorBarsWithTarget: StoryObj = {
bandOpacity: 0.1,
}),
]}
- grid={<XDSChartGrid />}
+ grid={<ChartGrid />}
axes={
<>
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
</>
}
height={300}
@@ -238,15 +238,15 @@ export const ErrorBarsWithTarget: StoryObj = {
export const WebGLScatter: StoryObj = {
name: 'WebGL Scatter (dotGL)',
render: () => (
- <XDSChart
+ <Chart
data={scatterData}
xKey="x"
series={[dotGL('y', {color: '#3b82f6', size: 4})]}
- grid={<XDSChartGrid horizontal vertical />}
+ grid={<ChartGrid horizontal vertical />}
axes={
<>
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
</>
}
height={400}
@@ -258,7 +258,7 @@ export const WebGLScatter: StoryObj = {
export const WebGLHeatmap: StoryObj = {
name: 'WebGL Heatmap',
render: () => (
- <XDSChart
+ <Chart
data={heatmapData}
xKey="hour"
series={[
@@ -271,8 +271,8 @@ export const WebGLHeatmap: StoryObj = {
]}
axes={
<>
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
</>
}
height={280}
@@ -300,15 +300,15 @@ export const StreamingLine: StoryObj = {
}, []);
return (
- <XDSChart
+ <Chart
data={[]}
xKey="x"
series={[streamGL({handleRef, color: '#3b82f6'})]}
- grid={<XDSChartGrid />}
+ grid={<ChartGrid />}
axes={
<>
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
</>
}
height={300}
@@ -339,7 +339,7 @@ export const KitchenSink: StoryObj = {
) / 10,
}));
return (
- <XDSChart
+ <Chart
data={data}
xKey="month"
series={[
@@ -355,11 +355,11 @@ export const KitchenSink: StoryObj = {
errorBar({high: 'errorHigh', low: 'errorLow', color: '#1e3a5f'}),
line('runAvg', {color: '#f59e0b', strokeWidth: 2}),
]}
- grid={<XDSChartGrid />}
+ grid={<ChartGrid />}
axes={
<>
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
</>
}
height={400}
diff --git a/apps/storybook/stories/ChartV2Grid.stories.tsx b/apps/storybook/stories/ChartV2Grid.stories.tsx
index 9c1c56d069..ef5879b8da 100644
--- a/apps/storybook/stories/ChartV2Grid.stories.tsx
+++ b/apps/storybook/stories/ChartV2Grid.stories.tsx
@@ -1,10 +1,10 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
import type {Meta, StoryObj} from '@storybook/react';
-import {XDSChartV2 as XDSChart, bar} from '@xds/lab';
+import {ChartV2 as Chart, bar} from '@xds/lab';
import {
- XDSChartV2Grid as XDSChartGrid,
- XDSChartV2Axis as XDSChartAxis,
+ ChartV2Grid as ChartGrid,
+ ChartV2Axis as ChartAxis,
} from '@xds/lab';
interface AxesAndGridsArgs {
@@ -21,7 +21,7 @@ interface AxesAndGridsArgs {
}
const meta: Meta<AxesAndGridsArgs> = {
- title: 'Lab/XDSChart v2/Primitives/Axes & Grids',
+ title: 'Lab/Chart v2/Primitives/Axes & Grids',
argTypes: {
horizontalGrid: {control: 'boolean'},
verticalGrid: {control: 'boolean'},
@@ -60,24 +60,24 @@ const monthlyData = [
export const AxesAndGrids: StoryObj<AxesAndGridsArgs> = {
name: 'Axes & Grids',
render: args => (
- <XDSChart
+ <Chart
data={monthlyData}
xKey="month"
series={[bar('revenue', {color: '#3b82f6'})]}
grid={
- <XDSChartGrid
+ <ChartGrid
horizontal={args.horizontalGrid}
vertical={args.verticalGrid}
/>
}
axes={
<>
- <XDSChartAxis
+ <ChartAxis
position="bottom"
showAxisLine={args.bottomAxisLine}
showTicks={args.showTicks}
/>
- <XDSChartAxis
+ <ChartAxis
position="left"
showAxisLine={args.leftAxisLine}
showTicks={args.showTicks}
diff --git a/apps/storybook/stories/ChartV2Legend.stories.tsx b/apps/storybook/stories/ChartV2Legend.stories.tsx
index 2eed972488..2970d00c8a 100644
--- a/apps/storybook/stories/ChartV2Legend.stories.tsx
+++ b/apps/storybook/stories/ChartV2Legend.stories.tsx
@@ -1,7 +1,7 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
import type {Meta, StoryObj} from '@storybook/react';
-import {XDSChartV2Legend} from '@xds/lab';
+import {ChartV2Legend} from '@xds/lab';
const sampleItems = [
{label: 'Revenue', color: '#3b82f6', type: 'bar'},
@@ -9,9 +9,9 @@ const sampleItems = [
{label: 'Trend', color: '#f59e0b', type: 'line'},
];
-const meta: Meta<typeof XDSChartV2Legend> = {
+const meta: Meta<typeof ChartV2Legend> = {
title: 'Lab/ChartV2Legend',
- component: XDSChartV2Legend,
+ component: ChartV2Legend,
argTypes: {
position: {
control: 'inline-radio',
@@ -27,7 +27,7 @@ const meta: Meta<typeof XDSChartV2Legend> = {
items: sampleItems,
alignment: 'start',
},
- render: args => <XDSChartV2Legend {...args} />,
+ render: args => <ChartV2Legend {...args} />,
};
export default meta;
diff --git a/apps/storybook/stories/ChartV2Swatch.stories.tsx b/apps/storybook/stories/ChartV2Swatch.stories.tsx
index 230c34bc68..aba0830d39 100644
--- a/apps/storybook/stories/ChartV2Swatch.stories.tsx
+++ b/apps/storybook/stories/ChartV2Swatch.stories.tsx
@@ -1,11 +1,11 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
import type {Meta, StoryObj} from '@storybook/react';
-import {XDSChartV2Swatch} from '@xds/lab';
+import {ChartV2Swatch} from '@xds/lab';
-const meta: Meta<typeof XDSChartV2Swatch> = {
+const meta: Meta<typeof ChartV2Swatch> = {
title: 'Lab/ChartV2Swatch',
- component: XDSChartV2Swatch,
+ component: ChartV2Swatch,
argTypes: {
color: {control: 'color'},
variant: {
diff --git a/apps/storybook/stories/ChartV2Tooltip.stories.tsx b/apps/storybook/stories/ChartV2Tooltip.stories.tsx
index 311b647f0d..830bbefbf0 100644
--- a/apps/storybook/stories/ChartV2Tooltip.stories.tsx
+++ b/apps/storybook/stories/ChartV2Tooltip.stories.tsx
@@ -1,10 +1,10 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
import type {Meta, StoryObj} from '@storybook/react';
-import {XDSChartV2 as XDSChart, bar, line} from '@xds/lab';
+import {ChartV2 as Chart, bar, line} from '@xds/lab';
import {
- XDSChartV2Grid as XDSChartGrid,
- XDSChartV2Axis as XDSChartAxis,
+ ChartV2Grid as ChartGrid,
+ ChartV2Axis as ChartAxis,
currency,
} from '@xds/lab';
@@ -31,16 +31,16 @@ const series = [
/** Hover over the chart to see the grouped tooltip with all series values at the hovered x-position. */
export const Tooltip: StoryObj = {
render: () => (
- <XDSChart
+ <Chart
data={monthlyData}
xKey="month"
series={series}
tooltip
- grid={<XDSChartGrid />}
+ grid={<ChartGrid />}
axes={
<>
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" tickFormat={currency()} />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" tickFormat={currency()} />
</>
}
height={300}
diff --git a/apps/storybook/stories/ChatReasoning.stories.tsx b/apps/storybook/stories/ChatReasoning.stories.tsx
index c06343f6df..f250b58234 100644
--- a/apps/storybook/stories/ChatReasoning.stories.tsx
+++ b/apps/storybook/stories/ChatReasoning.stories.tsx
@@ -6,14 +6,14 @@ import {
ChatMessage,
ChatMessageBubble,
} from '@xds/core/Chat';
-import {XDSChatReasoning} from '@xds/lab';
+import {ChatReasoning} from '@xds/lab';
import {Avatar} from '@xds/core/Avatar';
import {Markdown} from '@xds/core/Markdown';
import {useState, useEffect} from 'react';
const meta: Meta = {
title: 'Lab/ChatReasoning',
- component: XDSChatReasoning,
+ component: ChatReasoning,
tags: ['autodocs'],
parameters: {
layout: 'centered',
@@ -31,25 +31,25 @@ export default meta;
/** Collapsed (default) — shows label, duration, and ellipsis preview */
export const Collapsed: StoryObj = {
render: () => (
- <XDSChatReasoning duration="12s">
+ <ChatReasoning duration="12s">
Let me work through the constraints systematically. The farmer has 3
fields and rotates wheat, corn, soy. No same crop in adjacent fields and
no same crop in the same field two years in a row...
- </XDSChatReasoning>
+ </ChatReasoning>
),
};
/** Expanded — shows full reasoning content */
export const Expanded: StoryObj = {
render: () => (
- <XDSChatReasoning duration="8s" defaultIsExpanded>
+ <ChatReasoning duration="8s" defaultIsExpanded>
<Markdown density="compact">{`First, I need to understand the constraints:
1. Three fields, three crops (wheat, corn, soy)
2. No adjacent fields can have the same crop
3. No field can repeat its crop from the previous year
For **Year 1**: 3 \u00d7 2 \u00d7 2 = 12 arrangements...`}</Markdown>
- </XDSChatReasoning>
+ </ChatReasoning>
),
};
@@ -63,9 +63,9 @@ export const Streaming: StoryObj = {
}, []);
return (
<div>
- <XDSChatReasoning isStreaming={streaming} label="Thinking">
+ <ChatReasoning isStreaming={streaming} label="Thinking">
Working through the combinatorial constraints...
- </XDSChatReasoning>
+ </ChatReasoning>
{!streaming && (
<p style={{marginTop: 8, fontSize: 13, color: '#888'}}>
(Shimmer stopped after 5s)
@@ -79,9 +79,9 @@ export const Streaming: StoryObj = {
/** Custom label */
export const CustomLabel: StoryObj = {
render: () => (
- <XDSChatReasoning label="Analyzing" duration="3s">
+ <ChatReasoning label="Analyzing" duration="3s">
Checking the codebase for similar patterns...
- </XDSChatReasoning>
+ </ChatReasoning>
),
};
@@ -97,9 +97,9 @@ export const InMessage: StoryObj = {
<ChatMessage
sender="assistant"
avatar={<Avatar name="AI" size="small" />}>
- <XDSChatReasoning duration="12s">
+ <ChatReasoning duration="12s">
Let me work through the constraints systematically...
- </XDSChatReasoning>
+ </ChatReasoning>
<Markdown density="compact">{`There are **42** valid planting arrangements over 3 years.`}</Markdown>
</ChatMessage>
</ChatMessageList>
diff --git a/apps/storybook/stories/CircularProgress.stories.tsx b/apps/storybook/stories/CircularProgress.stories.tsx
index f5ed6d8083..e556ce14b5 100644
--- a/apps/storybook/stories/CircularProgress.stories.tsx
+++ b/apps/storybook/stories/CircularProgress.stories.tsx
@@ -1,12 +1,12 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
import type {Meta, StoryObj} from '@storybook/react';
-import {XDSCircularProgress} from '@xds/lab/CircularProgress';
+import {CircularProgress} from '@xds/lab/CircularProgress';
import {Text} from '@xds/core/Text';
-const meta: Meta<typeof XDSCircularProgress> = {
+const meta: Meta<typeof CircularProgress> = {
title: 'Lab/CircularProgress',
- component: XDSCircularProgress,
+ component: CircularProgress,
tags: ['autodocs'],
argTypes: {
value: {
@@ -39,7 +39,7 @@ const meta: Meta<typeof XDSCircularProgress> = {
};
export default meta;
-type Story = StoryObj<typeof XDSCircularProgress>;
+type Story = StoryObj<typeof CircularProgress>;
export const Default: Story = {
args: {
@@ -60,9 +60,9 @@ export const WithCenterLabel: Story = {
export const Sizes: Story = {
render: () => (
<div style={{display: 'flex', gap: '24px', alignItems: 'center'}}>
- <XDSCircularProgress value={60} size="sm" label="Small" />
- <XDSCircularProgress value={60} size="md" label="Medium" />
- <XDSCircularProgress value={60} size="lg" label="Large" />
+ <CircularProgress value={60} size="sm" label="Small" />
+ <CircularProgress value={60} size="md" label="Medium" />
+ <CircularProgress value={60} size="lg" label="Large" />
</div>
),
};
@@ -70,19 +70,19 @@ export const Sizes: Story = {
export const SizesWithLabels: Story = {
render: () => (
<div style={{display: 'flex', gap: '24px', alignItems: 'center'}}>
- <XDSCircularProgress value={60} size="sm" label="Small">
+ <CircularProgress value={60} size="sm" label="Small">
<Text type="supporting" style={{fontSize: 8}}>
60%
</Text>
- </XDSCircularProgress>
- <XDSCircularProgress value={60} size="md" label="Medium">
+ </CircularProgress>
+ <CircularProgress value={60} size="md" label="Medium">
<Text type="supporting" style={{fontSize: 11}}>
60%
</Text>
- </XDSCircularProgress>
- <XDSCircularProgress value={60} size="lg" label="Large">
+ </CircularProgress>
+ <CircularProgress value={60} size="lg" label="Large">
<Text type="body">60%</Text>
- </XDSCircularProgress>
+ </CircularProgress>
</div>
),
};
@@ -90,11 +90,11 @@ export const SizesWithLabels: Story = {
export const Variants: Story = {
render: () => (
<div style={{display: 'flex', gap: '24px', alignItems: 'center'}}>
- <XDSCircularProgress value={60} label="Accent" variant="accent" />
- <XDSCircularProgress value={80} label="Positive" variant="success" />
- <XDSCircularProgress value={50} label="Warning" variant="warning" />
- <XDSCircularProgress value={92} label="Negative" variant="error" />
- <XDSCircularProgress value={35} label="Neutral" variant="neutral" />
+ <CircularProgress value={60} label="Accent" variant="accent" />
+ <CircularProgress value={80} label="Positive" variant="success" />
+ <CircularProgress value={50} label="Warning" variant="warning" />
+ <CircularProgress value={92} label="Negative" variant="error" />
+ <CircularProgress value={35} label="Neutral" variant="neutral" />
</div>
),
};
@@ -125,9 +125,9 @@ export const Indeterminate: Story = {
export const IndeterminateSizes: Story = {
render: () => (
<div style={{display: 'flex', gap: '24px', alignItems: 'center'}}>
- <XDSCircularProgress size="sm" label="Loading small" />
- <XDSCircularProgress size="md" label="Loading medium" />
- <XDSCircularProgress size="lg" label="Loading large" />
+ <CircularProgress size="sm" label="Loading small" />
+ <CircularProgress size="md" label="Loading medium" />
+ <CircularProgress size="lg" label="Loading large" />
</div>
),
};
@@ -135,10 +135,10 @@ export const IndeterminateSizes: Story = {
export const IndeterminateVariants: Story = {
render: () => (
<div style={{display: 'flex', gap: '24px', alignItems: 'center'}}>
- <XDSCircularProgress label="Accent" variant="accent" />
- <XDSCircularProgress label="Positive" variant="success" />
- <XDSCircularProgress label="Warning" variant="warning" />
- <XDSCircularProgress label="Negative" variant="error" />
+ <CircularProgress label="Accent" variant="accent" />
+ <CircularProgress label="Positive" variant="success" />
+ <CircularProgress label="Warning" variant="warning" />
+ <CircularProgress label="Negative" variant="error" />
</div>
),
};
diff --git a/apps/storybook/stories/CodeEditor.stories.tsx b/apps/storybook/stories/CodeEditor.stories.tsx
index 794623f0e6..f449209359 100644
--- a/apps/storybook/stories/CodeEditor.stories.tsx
+++ b/apps/storybook/stories/CodeEditor.stories.tsx
@@ -2,11 +2,11 @@
import type {Meta, StoryObj} from '@storybook/react';
import {useState} from 'react';
-import {XDSCodeEditor} from '@xds/lab';
+import {CodeEditor} from '@xds/lab';
-const meta: Meta<typeof XDSCodeEditor> = {
+const meta: Meta<typeof CodeEditor> = {
title: 'Lab/CodeEditor',
- component: XDSCodeEditor,
+ component: CodeEditor,
tags: ['autodocs'],
argTypes: {
language: {
@@ -33,7 +33,7 @@ const meta: Meta<typeof XDSCodeEditor> = {
};
export default meta;
-type Story = StoryObj<typeof XDSCodeEditor>;
+type Story = StoryObj<typeof CodeEditor>;
const defaultCode = `function greet(name: string): string {
const message = \`Hello, \${name}!\`;
@@ -42,11 +42,11 @@ const defaultCode = `function greet(name: string): string {
}`;
function ControlledEditor(
- props: Partial<React.ComponentProps<typeof XDSCodeEditor>>,
+ props: Partial<React.ComponentProps<typeof CodeEditor>>,
) {
const [value, setValue] = useState(props.value ?? defaultCode);
return (
- <XDSCodeEditor
+ <CodeEditor
language="typescript"
hasLineNumbers
{...props}
diff --git a/apps/storybook/stories/CodeEditorPerf.stories.tsx b/apps/storybook/stories/CodeEditorPerf.stories.tsx
index ce3f82b81d..b0d3ea042a 100644
--- a/apps/storybook/stories/CodeEditorPerf.stories.tsx
+++ b/apps/storybook/stories/CodeEditorPerf.stories.tsx
@@ -2,16 +2,16 @@
import type {Meta, StoryObj} from '@storybook/react';
import {useState, useRef, useEffect, useCallback} from 'react';
-import {XDSCodeEditor} from '@xds/lab';
+import {CodeEditor} from '@xds/lab';
-const meta: Meta<typeof XDSCodeEditor> = {
+const meta: Meta<typeof CodeEditor> = {
title: 'Lab/CodeEditorPerf',
- component: XDSCodeEditor,
+ component: CodeEditor,
parameters: {layout: 'fullscreen'},
};
export default meta;
-type Story = StoryObj<typeof XDSCodeEditor>;
+type Story = StoryObj<typeof CodeEditor>;
// ---------------------------------------------------------------------------
// Helpers
@@ -117,7 +117,7 @@ function StressTestImpl() {
<Metric label="Mount" value={`${mountTime.toFixed(1)}ms`} />
)}
</div>
- <XDSCodeEditor
+ <CodeEditor
value={code}
onChange={setCode}
language="typescript"
@@ -204,7 +204,7 @@ function TypingLatencyImpl() {
Type in the editor to measure input latency
</span>
</div>
- <XDSCodeEditor
+ <CodeEditor
value={code}
onChange={handleChange}
language="typescript"
diff --git a/apps/storybook/stories/CodeEditorTheme.stories.tsx b/apps/storybook/stories/CodeEditorTheme.stories.tsx
index 71964bc8ff..4e61f924ae 100644
--- a/apps/storybook/stories/CodeEditorTheme.stories.tsx
+++ b/apps/storybook/stories/CodeEditorTheme.stories.tsx
@@ -2,7 +2,7 @@
import type {Meta, StoryObj} from '@storybook/react';
import {useState} from 'react';
-import {XDSCodeEditor} from '@xds/lab';
+import {CodeEditor} from '@xds/lab';
import {
SyntaxTheme as SyntaxThemeProvider,
defineSyntaxTheme,
@@ -74,7 +74,7 @@ function ThemedEditor({
const [value, setValue] = useState(initialCode);
return (
<SyntaxThemeProvider theme={theme}>
- <XDSCodeEditor
+ <CodeEditor
value={value}
onChange={setValue}
language="typescript"
@@ -90,7 +90,7 @@ const meta: Meta = {
docs: {
description: {
component:
- 'Syntax theme showcase for XDSCodeEditor. All themes from SyntaxTheme ' +
+ 'Syntax theme showcase for CodeEditor. All themes from SyntaxTheme ' +
'work identically on both CodeBlock and CodeEditor.',
},
},
@@ -184,7 +184,7 @@ function GalleryEditor({
}}>
{theme.name}
</div>
- <XDSCodeEditor
+ <CodeEditor
value={value}
onChange={setValue}
language="typescript"
diff --git a/apps/storybook/stories/RadialChart.stories.tsx b/apps/storybook/stories/RadialChart.stories.tsx
index 0d93dec857..6f56b0fd38 100644
--- a/apps/storybook/stories/RadialChart.stories.tsx
+++ b/apps/storybook/stories/RadialChart.stories.tsx
@@ -2,13 +2,13 @@
import type {Meta, StoryObj} from '@storybook/react';
import {
- XDSRadialChart,
- XDSRadialGrid,
- XDSRadialArea,
- XDSRadialAxis,
- XDSRadialSlice,
- XDSChartLegend,
- useXDSChartColors,
+ RadialChart,
+ RadialGrid,
+ RadialArea,
+ RadialAxis,
+ RadialSlice,
+ ChartLegend,
+ useChartColors,
} from '@xds/lab';
import {Stack} from '@xds/core';
import {Heading} from '@xds/core/Text';
@@ -51,28 +51,28 @@ const spiderData = [
/** Spider/radar chart comparing three models across five dimensions */
export const SpiderChart: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
const c = colors.categorical(3);
return (
<Stack direction="vertical" gap={4}>
<Heading level={3}>Spider Chart</Heading>
- <XDSRadialChart
+ <RadialChart
data={spiderData}
axes={['speed', 'handling', 'comfort', 'safety', 'efficiency']}
height={400}>
- <XDSRadialGrid rings={5} />
- <XDSRadialArea dataKey="Model A" color={c[0]} dots />
- <XDSRadialArea dataKey="Model B" color={c[1]} dots />
- <XDSRadialArea dataKey="Model C" color={c[2]} dots />
- <XDSRadialAxis />
- <XDSChartLegend
+ <RadialGrid rings={5} />
+ <RadialArea dataKey="Model A" color={c[0]} dots />
+ <RadialArea dataKey="Model B" color={c[1]} dots />
+ <RadialArea dataKey="Model C" color={c[2]} dots />
+ <RadialAxis />
+ <ChartLegend
items={[
{label: 'Model A', color: c[0]},
{label: 'Model B', color: c[1]},
{label: 'Model C', color: c[2]},
]}
/>
- </XDSRadialChart>
+ </RadialChart>
</Stack>
);
},
@@ -90,23 +90,23 @@ const pieData = [
/** Pie chart — revenue by region */
export const PieChart: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
return (
<Stack direction="vertical" gap={4}>
<Heading level={3}>Pie Chart</Heading>
- <XDSRadialChart
+ <RadialChart
data={pieData}
valueKey="revenue"
labelKey="region"
height={400}>
- <XDSRadialSlice colors={colors.categorical(5)} />
- <XDSChartLegend
+ <RadialSlice colors={colors.categorical(5)} />
+ <ChartLegend
items={pieData.map((d, i) => ({
label: d.region,
color: colors.categorical(5)[i],
}))}
/>
- </XDSRadialChart>
+ </RadialChart>
</Stack>
);
},
@@ -115,24 +115,24 @@ export const PieChart: StoryObj = {
/** Donut chart — same data with inner radius */
export const DonutChart: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
return (
<Stack direction="vertical" gap={4}>
<Heading level={3}>Donut Chart</Heading>
- <XDSRadialChart
+ <RadialChart
data={pieData}
valueKey="revenue"
labelKey="region"
innerRadius={0.55}
height={400}>
- <XDSRadialSlice colors={colors.categorical(5)} />
- <XDSChartLegend
+ <RadialSlice colors={colors.categorical(5)} />
+ <ChartLegend
items={pieData.map((d, i) => ({
label: d.region,
color: colors.categorical(5)[i],
}))}
/>
- </XDSRadialChart>
+ </RadialChart>
</Stack>
);
},
@@ -141,21 +141,21 @@ export const DonutChart: StoryObj = {
/** Spider with donut center */
export const SpiderDonut: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
const c = colors.categorical(2);
return (
<Stack direction="vertical" gap={4}>
<Heading level={3}>Spider with Inner Radius</Heading>
- <XDSRadialChart
+ <RadialChart
data={spiderData}
axes={['speed', 'handling', 'comfort', 'safety', 'efficiency']}
innerRadius={0.2}
height={400}>
- <XDSRadialGrid rings={4} />
- <XDSRadialArea dataKey="Model A" color={c[0]} dots />
- <XDSRadialArea dataKey="Model B" color={c[1]} dots />
- <XDSRadialAxis />
- </XDSRadialChart>
+ <RadialGrid rings={4} />
+ <RadialArea dataKey="Model A" color={c[0]} dots />
+ <RadialArea dataKey="Model B" color={c[1]} dots />
+ <RadialAxis />
+ </RadialChart>
</Stack>
);
},
diff --git a/apps/storybook/stories/SVGIcon.stories.tsx b/apps/storybook/stories/SVGIcon.stories.tsx
index b212067f34..d766cd4ee2 100644
--- a/apps/storybook/stories/SVGIcon.stories.tsx
+++ b/apps/storybook/stories/SVGIcon.stories.tsx
@@ -3,7 +3,7 @@
import type {Meta, StoryObj} from '@storybook/react';
import {Fragment} from 'react';
import {
- XDSSVGIcon,
+ SVGIcon,
type SVGIconVariation,
type SVGIconSize,
type SVGIconColor,
@@ -20,9 +20,9 @@ import {
import {Stack, Text, Divider} from '@xds/core';
import {Heading} from '@xds/core/Text';
-const meta: Meta<typeof XDSSVGIcon> = {
+const meta: Meta<typeof SVGIcon> = {
title: 'Lab/SVGIcon',
- component: XDSSVGIcon,
+ component: SVGIcon,
argTypes: {
variation: {
control: 'select',
@@ -56,7 +56,7 @@ const meta: Meta<typeof XDSSVGIcon> = {
};
export default meta;
-type Story = StoryObj<typeof XDSSVGIcon>;
+type Story = StoryObj<typeof SVGIcon>;
// =============================================================================
// Basic
@@ -119,7 +119,7 @@ export const VariationMatrix: Story = {
<div
key={`${icon.name}-${v}`}
style={{display: 'flex', justifyContent: 'center'}}>
- <XDSSVGIcon icon={icon} variation={v} size="lg" />
+ <SVGIcon icon={icon} variation={v} size="lg" />
</div>
))}
</Fragment>
@@ -150,7 +150,7 @@ export const RoleBehavior: Story = {
<Stack direction="horizontal" gap={3}>
{VARIATIONS.map(v => (
<Stack direction="vertical" key={v} gap={0.5} hAlign="center">
- <XDSSVGIcon icon={menuIcon} variation={v} size="lg" />
+ <SVGIcon icon={menuIcon} variation={v} size="lg" />
<Text type="label" color="secondary">
{v}
</Text>
@@ -166,7 +166,7 @@ export const RoleBehavior: Story = {
<Stack direction="horizontal" gap={3}>
{VARIATIONS.map(v => (
<Stack direction="vertical" key={v} gap={0.5} hAlign="center">
- <XDSSVGIcon icon={homeIcon} variation={v} size="lg" />
+ <SVGIcon icon={homeIcon} variation={v} size="lg" />
<Text type="label" color="secondary">
{v}
</Text>
@@ -182,7 +182,7 @@ export const RoleBehavior: Story = {
<Stack direction="horizontal" gap={3}>
{VARIATIONS.map(v => (
<Stack direction="vertical" key={v} gap={0.5} hAlign="center">
- <XDSSVGIcon icon={settingsIcon} variation={v} size="lg" />
+ <SVGIcon icon={settingsIcon} variation={v} size="lg" />
<Text type="label" color="secondary">
{v}
</Text>
@@ -210,7 +210,7 @@ export const SizeScale: Story = {
<Stack direction="horizontal" gap={3} vAlign="end">
{SIZES.map(size => (
<Stack direction="vertical" key={size} gap={1} hAlign="center">
- <XDSSVGIcon icon={settingsIcon} variation="linear" size={size} />
+ <SVGIcon icon={settingsIcon} variation="linear" size={size} />
<Text type="label" color="secondary">
{size}
</Text>
@@ -242,7 +242,7 @@ export const Colors: Story = {
<Stack direction="horizontal" gap={3}>
{COLORS.map(c => (
<Stack direction="vertical" key={c} gap={1} hAlign="center">
- <XDSSVGIcon
+ <SVGIcon
icon={bellIcon}
variation="linear"
size="lg"
@@ -303,7 +303,7 @@ export const MaskGaps: Story = {
gap: 16,
}}>
{MASK_GAP_ICONS.map(icon => (
- <XDSSVGIcon
+ <SVGIcon
key={icon.name}
icon={icon}
variation="bold"
@@ -368,7 +368,7 @@ export const StrokeWidthRange: Story = {
<div
key={`${icon.name}-${w}`}
style={{display: 'flex', justifyContent: 'center'}}>
- <XDSSVGIcon
+ <SVGIcon
icon={icon}
variation="linear"
size="lg"
@@ -423,7 +423,7 @@ export const StructuralDiversity: Story = {
<div
key={`${icon.name}-${v}`}
style={{display: 'flex', justifyContent: 'center'}}>
- <XDSSVGIcon icon={icon} variation={v} size="lg" />
+ <SVGIcon icon={icon} variation={v} size="lg" />
</div>
))}
</Fragment>
diff --git a/apps/storybook/stories/SVGIconRegistry.stories.tsx b/apps/storybook/stories/SVGIconRegistry.stories.tsx
index 02ed72bbef..06ac4bb83d 100644
--- a/apps/storybook/stories/SVGIconRegistry.stories.tsx
+++ b/apps/storybook/stories/SVGIconRegistry.stories.tsx
@@ -9,7 +9,7 @@ import {
isValidElement,
} from 'react';
import {
- XDSSVGIcon,
+ SVGIcon,
type SVGIconVariation,
type SVGIconDef,
type IconShape,
@@ -286,7 +286,7 @@ export const DefaultRegistryIcons: StoryObj = {
<div
key={`${name}-${v}`}
style={{display: 'flex', justifyContent: 'center'}}>
- <XDSSVGIcon icon={def} variation={v} size="lg" />
+ <SVGIcon icon={def} variation={v} size="lg" />
</div>
))}
</Fragment>
diff --git a/apps/storybook/stories/SankeyChart.stories.tsx b/apps/storybook/stories/SankeyChart.stories.tsx
index 923c137a93..80e7aebb6b 100644
--- a/apps/storybook/stories/SankeyChart.stories.tsx
+++ b/apps/storybook/stories/SankeyChart.stories.tsx
@@ -2,13 +2,13 @@
import type {Meta, StoryObj} from '@storybook/react';
import {
- XDSSankeyChart,
- XDSSankeyLink,
- XDSSankeyNode,
- XDSSankeyLabel,
- XDSSankeyGrid,
- type SankeyNode,
- type SankeyLink,
+ SankeyChart,
+ SankeyLink,
+ SankeyNode,
+ SankeyLabel,
+ SankeyGrid,
+ type SankeyNodeDatum,
+ type SankeyLinkDatum,
} from '@xds/lab';
import {Stack, Text} from '@xds/core';
import {Heading} from '@xds/core/Text';
@@ -23,7 +23,7 @@ type Story = StoryObj;
// --- Data ---
-const funnelNodes: SankeyNode[] = [
+const funnelNodes: SankeyNodeDatum[] = [
{id: 'visitors', label: 'Visitors', value: 52000, color: [0.65, 0.2, 270]},
{id: 'signups', label: 'Sign Ups', value: 28000, color: [0.6, 0.17, 235]},
{id: 'bounced', label: 'Bounced', value: 24000, color: [0.55, 0.14, 350]},
@@ -38,7 +38,7 @@ const funnelNodes: SankeyNode[] = [
{id: 'churned', label: 'Churned', value: 7100, color: [0.54, 0.15, 20]},
];
-const funnelLinks: SankeyLink[] = [
+const funnelLinks: SankeyLinkDatum[] = [
{source: 'visitors', target: 'signups', value: 28000},
{source: 'visitors', target: 'bounced', value: 24000},
{source: 'signups', target: 'activated', value: 19500},
@@ -62,23 +62,23 @@ export const ConversionFunnel: Story = {
<Text type="body" color="secondary">
User journey · Last 30 days
</Text>
- <XDSSankeyChart
+ <SankeyChart
nodes={funnelNodes}
links={funnelLinks}
columns={funnelColumns}
height={360}>
- <XDSSankeyGrid />
- <XDSSankeyLink />
- <XDSSankeyNode />
- <XDSSankeyLabel />
- </XDSSankeyChart>
+ <SankeyGrid />
+ <SankeyLink />
+ <SankeyNode />
+ <SankeyLabel />
+ </SankeyChart>
</Stack>
),
};
// --- Revenue Sources (converging) ---
-const revenueNodes: SankeyNode[] = [
+const revenueNodes: SankeyNodeDatum[] = [
{id: 'organic', label: 'Organic', value: 18000, color: [0.62, 0.17, 155]},
{id: 'paid', label: 'Paid Ads', value: 22000, color: [0.6, 0.18, 240]},
{id: 'referral', label: 'Referral', value: 12000, color: [0.58, 0.15, 40]},
@@ -96,7 +96,7 @@ const revenueNodes: SankeyNode[] = [
},
];
-const revenueLinks: SankeyLink[] = [
+const revenueLinks: SankeyLinkDatum[] = [
{source: 'organic', target: 'web', value: 12000},
{source: 'organic', target: 'mobile', value: 6000},
{source: 'paid', target: 'web', value: 14000},
@@ -131,16 +131,16 @@ export const RevenueFlow: Story = {
<Text type="body" color="secondary">
Channel attribution · March 2026
</Text>
- <XDSSankeyChart
+ <SankeyChart
nodes={revenueNodes}
links={revenueLinks}
columns={revenueColumns}
height={420}>
- <XDSSankeyGrid />
- <XDSSankeyLink opacity={0.65} tension={0.55} />
- <XDSSankeyNode />
- <XDSSankeyLabel />
- </XDSSankeyChart>
+ <SankeyGrid />
+ <SankeyLink opacity={0.65} tension={0.55} />
+ <SankeyNode />
+ <SankeyLabel />
+ </SankeyChart>
</Stack>
),
};
@@ -148,14 +148,14 @@ export const RevenueFlow: Story = {
/** Minimal — auto-detected columns, no grid */
export const AutoColumns: Story = {
render: () => {
- const nodes: SankeyNode[] = [
+ const nodes: SankeyNodeDatum[] = [
{id: 'a', label: 'Source A', value: 100},
{id: 'b', label: 'Source B', value: 80},
{id: 'mid', label: 'Middle', value: 180},
{id: 'out1', label: 'Output 1', value: 120},
{id: 'out2', label: 'Output 2', value: 60},
];
- const links: SankeyLink[] = [
+ const links: SankeyLinkDatum[] = [
{source: 'a', target: 'mid', value: 100},
{source: 'b', target: 'mid', value: 80},
{source: 'mid', target: 'out1', value: 120},
@@ -168,11 +168,11 @@ export const AutoColumns: Story = {
<Text type="body" color="secondary">
No explicit columns — topologically sorted
</Text>
- <XDSSankeyChart nodes={nodes} links={links} height={280}>
- <XDSSankeyLink tension={0.6} />
- <XDSSankeyNode />
- <XDSSankeyLabel showPercent={false} />
- </XDSSankeyChart>
+ <SankeyChart nodes={nodes} links={links} height={280}>
+ <SankeyLink tension={0.6} />
+ <SankeyNode />
+ <SankeyLabel showPercent={false} />
+ </SankeyChart>
</Stack>
);
},
@@ -181,7 +181,7 @@ export const AutoColumns: Story = {
/** Many columns — demonstrates horizontal scroll with minColumnWidth */
export const ManyColumns: Story = {
render: () => {
- const nodes: SankeyNode[] = [
+ const nodes: SankeyNodeDatum[] = [
{id: 'awareness', label: 'Awareness', value: 100000},
{id: 'interest', label: 'Interest', value: 68000},
{id: 'dropped1', label: 'Dropped', value: 32000, color: [0.5, 0.12, 350]},
@@ -209,7 +209,7 @@ export const ManyColumns: Story = {
},
{id: 'dropped5', label: 'Rejected', value: 6000, color: [0.5, 0.12, 350]},
];
- const links: SankeyLink[] = [
+ const links: SankeyLinkDatum[] = [
{source: 'awareness', target: 'interest', value: 68000},
{source: 'awareness', target: 'dropped1', value: 32000},
{source: 'interest', target: 'consideration', value: 45000},
@@ -243,17 +243,17 @@ export const ManyColumns: Story = {
borderRadius: 12,
overflow: 'hidden',
}}>
- <XDSSankeyChart
+ <SankeyChart
nodes={nodes}
links={links}
columns={columns}
height={360}
minColumnWidth={160}>
- <XDSSankeyGrid />
- <XDSSankeyLink />
- <XDSSankeyNode />
- <XDSSankeyLabel />
- </XDSSankeyChart>
+ <SankeyGrid />
+ <SankeyLink />
+ <SankeyNode />
+ <SankeyLabel />
+ </SankeyChart>
</div>
</Stack>
);
@@ -268,7 +268,7 @@ export const ManyColumns: Story = {
// gray-4: #5D6C7B ≈ oklch(0.50 0.02 240)
// gray-3: #AFB9C4 ≈ oklch(0.77 0.02 240)
-const bizNodes: SankeyNode[] = [
+const bizNodes: SankeyNodeDatum[] = [
{id: 'visitors', label: 'Visitors', value: 84200, color: [0.55, 0.19, 255]},
{id: 'signups', label: 'Signed Up', value: 42100, color: [0.58, 0.18, 255]},
{id: 'bounce', label: 'Bounced', value: 42100, color: [0.5, 0.02, 240]},
@@ -280,7 +280,7 @@ const bizNodes: SankeyNode[] = [
{id: 'free', label: 'Free Tier', value: 6300, color: [0.5, 0.02, 240]},
];
-const bizLinks: SankeyLink[] = [
+const bizLinks: SankeyLinkDatum[] = [
{source: 'visitors', target: 'signups', value: 42100},
{source: 'visitors', target: 'bounce', value: 42100},
{source: 'signups', target: 'onboarded', value: 28700},
@@ -310,23 +310,23 @@ export const BusinessFunnel: Story = {
<Text type="body" color="secondary">
Blue = progression · Gray = drop-off
</Text>
- <XDSSankeyChart
+ <SankeyChart
nodes={bizNodes}
links={bizLinks}
columns={bizColumns}
height={380}>
- <XDSSankeyGrid />
- <XDSSankeyLink opacity={0.6} />
- <XDSSankeyNode />
- <XDSSankeyLabel />
- </XDSSankeyChart>
+ <SankeyGrid />
+ <SankeyLink opacity={0.6} />
+ <SankeyNode />
+ <SankeyLabel />
+ </SankeyChart>
</Stack>
),
};
// --- Art Deco style: wider bars with rotated labels + column headers ---
-const demoNodes: SankeyNode[] = [
+const demoNodes: SankeyNodeDatum[] = [
{id: 'single', label: 'Single', value: 48, color: [0.62, 0.16, 30]},
{id: 'married', label: 'Married', value: 35, color: [0.58, 0.14, 180]},
{id: 'divorced', label: 'Divorced', value: 17, color: [0.55, 0.12, 300]},
@@ -336,7 +336,7 @@ const demoNodes: SankeyNode[] = [
{id: 'unhappy', label: 'Unhappy', value: 38, color: [0.52, 0.14, 25]},
];
-const demoLinks: SankeyLink[] = [
+const demoLinks: SankeyLinkDatum[] = [
{source: 'single', target: 'male', value: 26},
{source: 'single', target: 'female', value: 22},
{source: 'married', target: 'male', value: 20},
@@ -363,17 +363,17 @@ export const WideBarStyle: Story = {
<Text type="body" color="secondary">
Wider node bars with rotated text labels
</Text>
- <XDSSankeyChart
+ <SankeyChart
nodes={demoNodes}
links={demoLinks}
columns={demoColumns}
height={380}
nodeGap={8}>
- <XDSSankeyGrid />
- <XDSSankeyLink opacity={0.5} tension={0.5} />
- <XDSSankeyNode />
- <XDSSankeyLabel />
- </XDSSankeyChart>
+ <SankeyGrid />
+ <SankeyLink opacity={0.5} tension={0.5} />
+ <SankeyNode />
+ <SankeyLabel />
+ </SankeyChart>
</Stack>
),
};
@@ -382,7 +382,7 @@ export const WideBarStyle: Story = {
// Source: vega-datasets budget.json — FY2020 federal receipts
// Revenue sources → receiving agencies (values in $thousands)
-const budgetNodes: SankeyNode[] = [
+const budgetNodes: SankeyNodeDatum[] = [
{
id: 'income_tax',
label: 'Income Tax',
@@ -468,7 +468,7 @@ const budgetNodes: SankeyNode[] = [
{id: 'opm', label: 'OPM', value: 5026000, color: [0.48, 0.08, 340]},
];
-const budgetLinks: SankeyLink[] = [
+const budgetLinks: SankeyLinkDatum[] = [
{source: 'income_tax', target: 'general_fund', value: 2118406000},
{source: 'payroll_tax', target: 'social_security', value: 968357000},
{source: 'corp_tax', target: 'general_fund', value: 511220000},
@@ -542,16 +542,16 @@ export const USFederalBudget: Story = {
<Text type="body" color="secondary">
Revenue sources → receiving agencies (vega-datasets/budget.json)
</Text>
- <XDSSankeyChart
+ <SankeyChart
nodes={budgetNodes}
links={budgetLinks}
columns={budgetColumns}
height={480}>
- <XDSSankeyGrid />
- <XDSSankeyLink opacity={0.6} tension={0.5} />
- <XDSSankeyNode />
- <XDSSankeyLabel formatValue={formatBudget} />
- </XDSSankeyChart>
+ <SankeyGrid />
+ <SankeyLink opacity={0.6} tension={0.5} />
+ <SankeyNode />
+ <SankeyLabel formatValue={formatBudget} />
+ </SankeyChart>
</Stack>
),
};
@@ -566,16 +566,16 @@ export const Monochrome: Story = {
<Text type="body" color="secondary">
Monochrome — flat color, no gradients
</Text>
- <XDSSankeyChart
+ <SankeyChart
nodes={funnelNodes}
links={funnelLinks}
columns={funnelColumns}
height={340}
nodeColor="#1a1a1e">
- <XDSSankeyLink color="#1a1a1e" opacity={0.75} />
- <XDSSankeyNode glow={false} />
- <XDSSankeyLabel />
- </XDSSankeyChart>
+ <SankeyLink color="#1a1a1e" opacity={0.75} />
+ <SankeyNode glow={false} />
+ <SankeyLabel />
+ </SankeyChart>
</Stack>
),
};
@@ -588,16 +588,16 @@ export const SourceColored: Story = {
<Text type="body" color="secondary">
Each ribbon matches its source node
</Text>
- <XDSSankeyChart
+ <SankeyChart
nodes={funnelNodes}
links={funnelLinks}
columns={funnelColumns}
height={340}>
- <XDSSankeyGrid />
- <XDSSankeyLink color="source" />
- <XDSSankeyNode />
- <XDSSankeyLabel />
- </XDSSankeyChart>
+ <SankeyGrid />
+ <SankeyLink color="source" />
+ <SankeyNode />
+ <SankeyLabel />
+ </SankeyChart>
</Stack>
),
};
@@ -610,16 +610,16 @@ export const TargetColored: Story = {
<Text type="body" color="secondary">
Each ribbon matches its destination node
</Text>
- <XDSSankeyChart
+ <SankeyChart
nodes={funnelNodes}
links={funnelLinks}
columns={funnelColumns}
height={340}>
- <XDSSankeyGrid />
- <XDSSankeyLink color="target" />
- <XDSSankeyNode />
- <XDSSankeyLabel />
- </XDSSankeyChart>
+ <SankeyGrid />
+ <SankeyLink color="target" />
+ <SankeyNode />
+ <SankeyLabel />
+ </SankeyChart>
</Stack>
),
};
@@ -632,16 +632,16 @@ export const LeanedSourceGradient: Story = {
<Text type="body" color="secondary">
bias=0.2 — holds source color, transitions near target
</Text>
- <XDSSankeyChart
+ <SankeyChart
nodes={funnelNodes}
links={funnelLinks}
columns={funnelColumns}
height={340}>
- <XDSSankeyGrid />
- <XDSSankeyLink color={{gradient: 0.2}} />
- <XDSSankeyNode />
- <XDSSankeyLabel />
- </XDSSankeyChart>
+ <SankeyGrid />
+ <SankeyLink color={{gradient: 0.2}} />
+ <SankeyNode />
+ <SankeyLabel />
+ </SankeyChart>
</Stack>
),
};
@@ -654,16 +654,16 @@ export const LeanedTargetGradient: Story = {
<Text type="body" color="secondary">
bias=0.8 — transitions early, holds target color
</Text>
- <XDSSankeyChart
+ <SankeyChart
nodes={funnelNodes}
links={funnelLinks}
columns={funnelColumns}
height={340}>
- <XDSSankeyGrid />
- <XDSSankeyLink color={{gradient: 0.8}} />
- <XDSSankeyNode />
- <XDSSankeyLabel />
- </XDSSankeyChart>
+ <SankeyGrid />
+ <SankeyLink color={{gradient: 0.8}} />
+ <SankeyNode />
+ <SankeyLabel />
+ </SankeyChart>
</Stack>
),
};
diff --git a/apps/storybook/stories/Schedule.stories.tsx b/apps/storybook/stories/Schedule.stories.tsx
index 84e95dd2fc..ec6c1855ef 100644
--- a/apps/storybook/stories/Schedule.stories.tsx
+++ b/apps/storybook/stories/Schedule.stories.tsx
@@ -3,25 +3,25 @@
import {useMemo, useState} from 'react';
import type {Meta, StoryObj} from '@storybook/react';
import {
- XDSSchedule,
- createXDSScheduleDayView,
- createXDSScheduleListView,
- createXDSScheduleMonthlyView,
- createXDSScheduleWeeklyView,
+ Schedule,
+ createScheduleDayView,
+ createScheduleListView,
+ createScheduleMonthlyView,
+ createScheduleWeeklyView,
createEventFromISO,
type CalendarEvent,
type Instant,
- type XDSScheduleCategory,
- type XDSScheduleViewSelectorOption,
- useXDSSchedulePaginationPlugin,
- useXDSScheduleViewSelectorPlugin,
+ type ScheduleCategory,
+ type ScheduleViewSelectorOption,
+ useSchedulePaginationPlugin,
+ useScheduleViewSelectorPlugin,
} from '@xds/lab';
const storyNow = new Date();
const focusDate = storyNow.getTime() as Instant;
const currentWeekStart = startOfWeek(storyNow);
-const categories: XDSScheduleCategory[] = [
+const categories: ScheduleCategory[] = [
{label: 'Company', color: 'blue'},
{label: 'Design', color: 'purple'},
{label: 'Launch', color: 'green'},
@@ -105,9 +105,9 @@ const events: CalendarEvent[] = [
}),
];
-const meta: Meta<typeof XDSSchedule> = {
+const meta: Meta<typeof Schedule> = {
title: 'Lab/Schedule',
- component: XDSSchedule,
+ component: Schedule,
tags: ['autodocs'],
parameters: {
layout: 'fullscreen',
@@ -123,7 +123,7 @@ const meta: Meta<typeof XDSSchedule> = {
export default meta;
-type Story = StoryObj<typeof XDSSchedule>;
+type Story = StoryObj<typeof Schedule>;
function addDays(date: Date, days: number): Date {
const nextDate = new Date(date);
@@ -215,10 +215,10 @@ function createAsyncEvents(start: Instant, end: Instant): CalendarEvent[] {
export const Monthly: Story = {
render: () => {
const [date, setDate] = useState<Instant>(focusDate);
- const view = useMemo(() => createXDSScheduleMonthlyView(), []);
+ const view = useMemo(() => createScheduleMonthlyView(), []);
return (
- <XDSSchedule
+ <Schedule
view={view}
events={events}
categories={categories}
@@ -235,12 +235,12 @@ export const Weekly: Story = {
render: () => {
const [date, setDate] = useState<Instant>(focusDate);
const view = useMemo(
- () => createXDSScheduleWeeklyView({minHour: 7, maxHour: 19}),
+ () => createScheduleWeeklyView({minHour: 7, maxHour: 19}),
[],
);
return (
- <XDSSchedule
+ <Schedule
view={view}
events={events}
categories={categories}
@@ -256,13 +256,13 @@ export const WeeklyFixedHeight: Story = {
render: () => {
const [date, setDate] = useState<Instant>(focusDate);
const view = useMemo(
- () => createXDSScheduleWeeklyView({minHour: 7, maxHour: 19}),
+ () => createScheduleWeeklyView({minHour: 7, maxHour: 19}),
[],
);
return (
<div style={{height: 520}}>
- <XDSSchedule
+ <Schedule
view={view}
events={events}
categories={categories}
@@ -279,10 +279,10 @@ export const WeeklyFixedHeight: Story = {
export const Day: Story = {
render: () => {
const [date, setDate] = useState<Instant>(focusDate);
- const view = useMemo(() => createXDSScheduleDayView(), []);
+ const view = useMemo(() => createScheduleDayView(), []);
return (
- <XDSSchedule
+ <Schedule
view={view}
events={events}
categories={categories}
@@ -298,10 +298,10 @@ export const Day: Story = {
export const List: Story = {
render: () => {
const [date, setDate] = useState<Instant>(focusDate);
- const view = useMemo(() => createXDSScheduleListView(), []);
+ const view = useMemo(() => createScheduleListView(), []);
return (
- <XDSSchedule
+ <Schedule
view={view}
events={events}
categories={categories}
@@ -318,7 +318,7 @@ export const AsyncLoader: Story = {
render: () => {
const [date, setDate] = useState<Instant>(focusDate);
const view = useMemo(
- () => createXDSScheduleWeeklyView({minHour: 7, maxHour: 19}),
+ () => createScheduleWeeklyView({minHour: 7, maxHour: 19}),
[],
);
const loadEvents = async (
@@ -330,7 +330,7 @@ export const AsyncLoader: Story = {
};
return (
- <XDSSchedule
+ <Schedule
view={view}
events={loadEvents}
categories={categories}
@@ -347,10 +347,10 @@ export const ViewSelectorPlugin: Story = {
render: () => {
const views = useMemo(
() => ({
- month: createXDSScheduleMonthlyView(),
- week: createXDSScheduleWeeklyView({minHour: 7, maxHour: 19}),
- day: createXDSScheduleDayView({minHour: 8, maxHour: 18}),
- list: createXDSScheduleListView(),
+ month: createScheduleMonthlyView(),
+ week: createScheduleWeeklyView({minHour: 7, maxHour: 19}),
+ day: createScheduleDayView({minHour: 8, maxHour: 18}),
+ list: createScheduleListView(),
}),
[],
);
@@ -358,7 +358,7 @@ export const ViewSelectorPlugin: Story = {
const [view, setView] = useState<StoryScheduleView>(() => views.week);
const [date, setDate] = useState<Instant>(focusDate);
const viewOptions = useMemo<
- ReadonlyArray<XDSScheduleViewSelectorOption<StoryScheduleView>>
+ ReadonlyArray<ScheduleViewSelectorOption<StoryScheduleView>>
>(
() => [
{view: views.month, label: 'Month'},
@@ -368,8 +368,8 @@ export const ViewSelectorPlugin: Story = {
],
[views],
);
- const paginationPlugin = useXDSSchedulePaginationPlugin();
- const viewSelectorPlugin = useXDSScheduleViewSelectorPlugin(viewOptions, {
+ const paginationPlugin = useSchedulePaginationPlugin();
+ const viewSelectorPlugin = useScheduleViewSelectorPlugin(viewOptions, {
onChangeView: setView,
});
const plugins = useMemo(
@@ -378,7 +378,7 @@ export const ViewSelectorPlugin: Story = {
);
return (
- <XDSSchedule
+ <Schedule
view={view}
events={events}
categories={categories}
diff --git a/apps/storybook/stories/Stepper.stories.tsx b/apps/storybook/stories/Stepper.stories.tsx
index 705a6ccd08..fc33766582 100644
--- a/apps/storybook/stories/Stepper.stories.tsx
+++ b/apps/storybook/stories/Stepper.stories.tsx
@@ -2,15 +2,15 @@
import {useState} from 'react';
import type {Meta, StoryObj} from '@storybook/react';
-import {XDSStepper, XDSStep} from '@xds/lab/Stepper';
+import {Stepper, Step} from '@xds/lab/Stepper';
import {TextInput} from '@xds/core/TextInput';
import {Button} from '@xds/core/Button';
import {Text} from '@xds/core/Text';
import {Icon} from '@xds/core/Icon';
-const meta: Meta<typeof XDSStepper> = {
+const meta: Meta<typeof Stepper> = {
title: 'Lab/Stepper',
- component: XDSStepper,
+ component: Stepper,
tags: ['autodocs'],
argTypes: {
activeStep: {control: {type: 'number', min: 0, max: 5}},
@@ -20,7 +20,7 @@ const meta: Meta<typeof XDSStepper> = {
};
export default meta;
-type Story = StoryObj<typeof XDSStepper>;
+type Story = StoryObj<typeof Stepper>;
// ============================================================
// DEFAULT (auto indicator)
@@ -32,36 +32,36 @@ export const Default: Story = {
const [active, setActive] = useState(2);
return (
<div style={{maxWidth: 400}}>
- <XDSStepper
+ <Stepper
activeStep={active}
orientation="vertical"
onStepClick={setActive}>
- <XDSStep
+ <Step
step={0}
label="Create workspace"
description="Name and configure your workspace"
/>
- <XDSStep
+ <Step
step={1}
label="Invite team members"
description="Add collaborators by email"
/>
- <XDSStep
+ <Step
step={2}
label="Set up integrations"
description="Connect Slack, GitHub, Jira"
/>
- <XDSStep
+ <Step
step={3}
label="Import data"
description="Bring in existing projects"
/>
- <XDSStep
+ <Step
step={4}
label="Launch"
description="Go live with your team"
/>
- </XDSStepper>
+ </Stepper>
</div>
);
},
@@ -73,16 +73,16 @@ export const DefaultHorizontal: Story = {
const [active, setActive] = useState(1);
return (
<div style={{maxWidth: 700}}>
- <XDSStepper
+ <Stepper
activeStep={active}
orientation="horizontal"
onStepClick={setActive}>
- <XDSStep step={0} label="Workspace" />
- <XDSStep step={1} label="Team" />
- <XDSStep step={2} label="Integrations" />
- <XDSStep step={3} label="Import" />
- <XDSStep step={4} label="Launch" />
- </XDSStepper>
+ <Step step={0} label="Workspace" />
+ <Step step={1} label="Team" />
+ <Step step={2} label="Integrations" />
+ <Step step={3} label="Import" />
+ <Step step={4} label="Launch" />
+ </Stepper>
</div>
);
},
@@ -98,41 +98,41 @@ export const NumberedVertical: Story = {
const [active, setActive] = useState(2);
return (
<div style={{maxWidth: 400}}>
- <XDSStepper
+ <Stepper
activeStep={active}
orientation="vertical"
onStepClick={setActive}>
- <XDSStep
+ <Step
step={0}
label="Push to main"
description="Merge your pull request"
indicator="number"
/>
- <XDSStep
+ <Step
step={1}
label="Run CI checks"
description="Lint, type-check, test"
indicator="number"
/>
- <XDSStep
+ <Step
step={2}
label="Build container"
description="Docker image to registry"
indicator="number"
/>
- <XDSStep
+ <Step
step={3}
label="Deploy to staging"
description="Verify in staging environment"
indicator="number"
/>
- <XDSStep
+ <Step
step={4}
label="Promote to production"
description="Canary → full rollout"
indicator="number"
/>
- </XDSStepper>
+ </Stepper>
</div>
);
},
@@ -144,15 +144,15 @@ export const NumberedHorizontal: Story = {
const [active, setActive] = useState(1);
return (
<div style={{maxWidth: 600}}>
- <XDSStepper
+ <Stepper
activeStep={active}
orientation="horizontal"
onStepClick={setActive}>
- <XDSStep step={0} label="Cart" indicator="number" />
- <XDSStep step={1} label="Shipping" indicator="number" />
- <XDSStep step={2} label="Payment" indicator="number" />
- <XDSStep step={3} label="Confirm" indicator="number" />
- </XDSStepper>
+ <Step step={0} label="Cart" indicator="number" />
+ <Step step={1} label="Shipping" indicator="number" />
+ <Step step={2} label="Payment" indicator="number" />
+ <Step step={3} label="Confirm" indicator="number" />
+ </Stepper>
</div>
);
},
@@ -172,45 +172,45 @@ export const StatusVertical: Story = {
const [active, setActive] = useState(3);
return (
<div style={{maxWidth: 400}}>
- <XDSStepper
+ <Stepper
activeStep={active}
orientation="vertical"
onStepClick={setActive}>
- <XDSStep
+ <Step
step={0}
label="Email verified"
description="[email protected]"
status="success"
icon={<Icon icon="check" size="sm" />}
/>
- <XDSStep
+ <Step
step={1}
label="Phone verified"
description="+1 (555) 012-3456"
status="success"
icon={<Icon icon="check" size="sm" />}
/>
- <XDSStep
+ <Step
step={2}
label="Identity document"
description="Passport upload failed"
status="error"
icon={<Icon icon="warning" size="sm" />}
/>
- <XDSStep
+ <Step
step={3}
label="Address verification"
description="Pending review"
status="accent"
/>
- <XDSStep
+ <Step
step={4}
label="Background check"
isOptional
description="Skipped"
/>
- <XDSStep step={5} label="Account activated" />
- </XDSStepper>
+ <Step step={5} label="Account activated" />
+ </Stepper>
</div>
);
},
@@ -222,43 +222,43 @@ export const StatusAllStates: Story = {
const [active, setActive] = useState(1);
return (
<div style={{maxWidth: 400}}>
- <XDSStepper
+ <Stepper
activeStep={active}
orientation="vertical"
onStepClick={setActive}>
- <XDSStep
+ <Step
step={0}
label="Accent"
description="--color-accent"
status="accent"
/>
- <XDSStep
+ <Step
step={1}
label="Success"
description="--color-success"
status="success"
icon={<Icon icon="check" size="sm" />}
/>
- <XDSStep
+ <Step
step={2}
label="Warning"
description="--color-warning"
status="warning"
icon={<Icon icon="warning" size="sm" />}
/>
- <XDSStep
+ <Step
step={3}
label="Error"
description="--color-error"
status="error"
icon={<Icon icon="warning" size="sm" />}
/>
- <XDSStep
+ <Step
step={4}
label="Default (no status)"
description="progress-derived color"
/>
- </XDSStepper>
+ </Stepper>
</div>
);
},
@@ -274,36 +274,36 @@ export const MinimalVertical: Story = {
const [active, setActive] = useState(2);
return (
<div style={{maxWidth: 400}}>
- <XDSStepper
+ <Stepper
activeStep={active}
orientation="vertical"
onStepClick={setActive}>
- <XDSStep
+ <Step
step={0}
label="Phone screen"
description="30 min with recruiter"
indicator="none"
/>
- <XDSStep
+ <Step
step={1}
label="Technical interview"
description="1 hour coding session"
indicator="none"
/>
- <XDSStep
+ <Step
step={2}
label="System design"
description="45 min whiteboard"
indicator="none"
/>
- <XDSStep
+ <Step
step={3}
label="Team match"
description="Meet potential teammates"
indicator="none"
/>
- <XDSStep step={4} label="Offer" indicator="none" />
- </XDSStepper>
+ <Step step={4} label="Offer" indicator="none" />
+ </Stepper>
</div>
);
},
@@ -315,15 +315,15 @@ export const MinimalHorizontal: Story = {
const [active, setActive] = useState(1);
return (
<div style={{maxWidth: 500}}>
- <XDSStepper
+ <Stepper
activeStep={active}
orientation="horizontal"
onStepClick={setActive}>
- <XDSStep step={0} label="Upload" indicator="none" />
- <XDSStep step={1} label="Details" indicator="none" />
- <XDSStep step={2} label="Audience" indicator="none" />
- <XDSStep step={3} label="Publish" indicator="none" />
- </XDSStepper>
+ <Step step={0} label="Upload" indicator="none" />
+ <Step step={1} label="Details" indicator="none" />
+ <Step step={2} label="Audience" indicator="none" />
+ <Step step={3} label="Publish" indicator="none" />
+ </Stepper>
</div>
);
},
@@ -341,75 +341,75 @@ export const IndicatorComparison: Story = {
<div style={{display: 'flex', gap: 48}}>
<div style={{maxWidth: 280}}>
<Text type="label">Auto (default)</Text>
- <XDSStepper
+ <Stepper
activeStep={active}
orientation="vertical"
onStepClick={setActive}>
- <XDSStep step={0} label="Account" />
- <XDSStep step={1} label="Profile" />
- <XDSStep step={2} label="Settings" />
- <XDSStep step={3} label="Review" />
- <XDSStep step={4} label="Done" />
- </XDSStepper>
+ <Step step={0} label="Account" />
+ <Step step={1} label="Profile" />
+ <Step step={2} label="Settings" />
+ <Step step={3} label="Review" />
+ <Step step={4} label="Done" />
+ </Stepper>
</div>
<div style={{maxWidth: 280}}>
<Text type="label">Number</Text>
- <XDSStepper
+ <Stepper
activeStep={active}
orientation="vertical"
onStepClick={setActive}>
- <XDSStep step={0} label="Account" indicator="number" />
- <XDSStep step={1} label="Profile" indicator="number" />
- <XDSStep step={2} label="Settings" indicator="number" />
- <XDSStep step={3} label="Review" indicator="number" />
- <XDSStep step={4} label="Done" indicator="number" />
- </XDSStepper>
+ <Step step={0} label="Account" indicator="number" />
+ <Step step={1} label="Profile" indicator="number" />
+ <Step step={2} label="Settings" indicator="number" />
+ <Step step={3} label="Review" indicator="number" />
+ <Step step={4} label="Done" indicator="number" />
+ </Stepper>
</div>
<div style={{maxWidth: 280}}>
<Text type="label">Custom icon</Text>
- <XDSStepper
+ <Stepper
activeStep={active}
orientation="vertical"
onStepClick={setActive}>
- <XDSStep
+ <Step
step={0}
label="Account"
icon={<Icon icon="info" size="sm" />}
/>
- <XDSStep
+ <Step
step={1}
label="Profile"
icon={<Icon icon="search" size="sm" />}
/>
- <XDSStep
+ <Step
step={2}
label="Settings"
icon={<Icon icon="wrench" size="sm" />}
/>
- <XDSStep
+ <Step
step={3}
label="Review"
icon={<Icon icon="clock" size="sm" />}
/>
- <XDSStep
+ <Step
step={4}
label="Done"
icon={<Icon icon="check" size="sm" />}
/>
- </XDSStepper>
+ </Stepper>
</div>
<div style={{maxWidth: 280}}>
<Text type="label">None</Text>
- <XDSStepper
+ <Stepper
activeStep={active}
orientation="vertical"
onStepClick={setActive}>
- <XDSStep step={0} label="Account" indicator="none" />
- <XDSStep step={1} label="Profile" indicator="none" />
- <XDSStep step={2} label="Settings" indicator="none" />
- <XDSStep step={3} label="Review" indicator="none" />
- <XDSStep step={4} label="Done" indicator="none" />
- </XDSStepper>
+ <Step step={0} label="Account" indicator="none" />
+ <Step step={1} label="Profile" indicator="none" />
+ <Step step={2} label="Settings" indicator="none" />
+ <Step step={3} label="Review" indicator="none" />
+ <Step step={4} label="Done" indicator="none" />
+ </Stepper>
</div>
</div>
);
@@ -426,11 +426,11 @@ export const WithContentSlot: Story = {
const [active, setActive] = useState(0);
return (
<div style={{maxWidth: 480}}>
- <XDSStepper
+ <Stepper
activeStep={active}
orientation="vertical"
onStepClick={setActive}>
- <XDSStep step={0} label="Project details" indicator="number">
+ <Step step={0} label="Project details" indicator="number">
{active === 0 && (
<div style={{display: 'flex', flexDirection: 'column', gap: 12}}>
<TextInput
@@ -452,8 +452,8 @@ export const WithContentSlot: Story = {
</div>
</div>
)}
- </XDSStep>
- <XDSStep step={1} label="Environment" indicator="number">
+ </Step>
+ <Step step={1} label="Environment" indicator="number">
{active === 1 && (
<div style={{display: 'flex', flexDirection: 'column', gap: 12}}>
<TextInput label="Node version" placeholder="20" value="" />
@@ -476,8 +476,8 @@ export const WithContentSlot: Story = {
</div>
</div>
)}
- </XDSStep>
- <XDSStep step={2} label="Deploy" indicator="number">
+ </Step>
+ <Step step={2} label="Deploy" indicator="number">
{active === 2 && (
<div style={{display: 'flex', flexDirection: 'column', gap: 12}}>
<Text type="body">
@@ -498,9 +498,9 @@ export const WithContentSlot: Story = {
</div>
</div>
)}
- </XDSStep>
- <XDSStep step={3} label="Done" indicator="number" />
- </XDSStepper>
+ </Step>
+ <Step step={3} label="Done" indicator="number" />
+ </Stepper>
</div>
);
},
@@ -518,42 +518,42 @@ export const DensityComparison: Story = {
<div style={{display: 'flex', gap: 48}}>
<div style={{maxWidth: 250}}>
<Text type="label">Compact</Text>
- <XDSStepper
+ <Stepper
activeStep={active}
orientation="vertical"
onStepClick={setActive}
density="compact">
- <XDSStep step={0} label="Account" indicator="number" />
- <XDSStep step={1} label="Profile" indicator="number" />
- <XDSStep step={2} label="Payment" indicator="number" />
- <XDSStep step={3} label="Review" indicator="number" />
- </XDSStepper>
+ <Step step={0} label="Account" indicator="number" />
+ <Step step={1} label="Profile" indicator="number" />
+ <Step step={2} label="Payment" indicator="number" />
+ <Step step={3} label="Review" indicator="number" />
+ </Stepper>
</div>
<div style={{maxWidth: 250}}>
<Text type="label">Balanced</Text>
- <XDSStepper
+ <Stepper
activeStep={active}
orientation="vertical"
onStepClick={setActive}
density="balanced">
- <XDSStep step={0} label="Account" indicator="number" />
- <XDSStep step={1} label="Profile" indicator="number" />
- <XDSStep step={2} label="Payment" indicator="number" />
- <XDSStep step={3} label="Review" indicator="number" />
- </XDSStepper>
+ <Step step={0} label="Account" indicator="number" />
+ <Step step={1} label="Profile" indicator="number" />
+ <Step step={2} label="Payment" indicator="number" />
+ <Step step={3} label="Review" indicator="number" />
+ </Stepper>
</div>
<div style={{maxWidth: 250}}>
<Text type="label">Spacious</Text>
- <XDSStepper
+ <Stepper
activeStep={active}
orientation="vertical"
onStepClick={setActive}
density="spacious">
- <XDSStep step={0} label="Account" indicator="number" />
- <XDSStep step={1} label="Profile" indicator="number" />
- <XDSStep step={2} label="Payment" indicator="number" />
- <XDSStep step={3} label="Review" indicator="number" />
- </XDSStepper>
+ <Step step={0} label="Account" indicator="number" />
+ <Step step={1} label="Profile" indicator="number" />
+ <Step step={2} label="Payment" indicator="number" />
+ <Step step={3} label="Review" indicator="number" />
+ </Stepper>
</div>
</div>
);
@@ -570,13 +570,13 @@ export const TwoSteps: Story = {
const [active, setActive] = useState(0);
return (
<div style={{maxWidth: 400}}>
- <XDSStepper
+ <Stepper
activeStep={active}
orientation="horizontal"
onStepClick={setActive}>
- <XDSStep step={0} label="Before" />
- <XDSStep step={1} label="After" />
- </XDSStepper>
+ <Step step={0} label="Before" />
+ <Step step={1} label="After" />
+ </Stepper>
</div>
);
},
@@ -587,18 +587,18 @@ export const ManySteps: Story = {
render: () => {
const [active, setActive] = useState(3);
return (
- <XDSStepper
+ <Stepper
activeStep={active}
orientation="horizontal"
onStepClick={setActive}>
- <XDSStep step={0} label="Idea" indicator="number" />
- <XDSStep step={1} label="Design" indicator="number" />
- <XDSStep step={2} label="Build" indicator="number" />
- <XDSStep step={3} label="Test" indicator="number" />
- <XDSStep step={4} label="Review" indicator="number" />
- <XDSStep step={5} label="Deploy" indicator="number" />
- <XDSStep step={6} label="Monitor" indicator="number" />
- </XDSStepper>
+ <Step step={0} label="Idea" indicator="number" />
+ <Step step={1} label="Design" indicator="number" />
+ <Step step={2} label="Build" indicator="number" />
+ <Step step={3} label="Test" indicator="number" />
+ <Step step={4} label="Review" indicator="number" />
+ <Step step={5} label="Deploy" indicator="number" />
+ <Step step={6} label="Monitor" indicator="number" />
+ </Stepper>
);
},
};
@@ -609,20 +609,20 @@ export const DisabledSteps: Story = {
const [active, setActive] = useState(1);
return (
<div style={{maxWidth: 400}}>
- <XDSStepper
+ <Stepper
activeStep={active}
orientation="vertical"
onStepClick={setActive}>
- <XDSStep step={0} label="Basic info" />
- <XDSStep step={1} label="Permissions" />
- <XDSStep
+ <Step step={0} label="Basic info" />
+ <Step step={1} label="Permissions" />
+ <Step
step={2}
label="Admin settings"
description="Requires admin role"
isDisabled
/>
- <XDSStep step={3} label="Confirm" />
- </XDSStepper>
+ <Step step={3} label="Confirm" />
+ </Stepper>
</div>
);
},
@@ -634,21 +634,21 @@ export const OptionalSteps: Story = {
const [active, setActive] = useState(3);
return (
<div style={{maxWidth: 400}}>
- <XDSStepper
+ <Stepper
activeStep={active}
orientation="vertical"
onStepClick={setActive}>
- <XDSStep step={0} label="Basic profile" />
- <XDSStep
+ <Step step={0} label="Basic profile" />
+ <Step
step={1}
label="Profile photo"
isOptional
description="Skipped"
/>
- <XDSStep step={2} label="Connect socials" isOptional />
- <XDSStep step={3} label="Preferences" />
- <XDSStep step={4} label="All done" />
- </XDSStepper>
+ <Step step={2} label="Connect socials" isOptional />
+ <Step step={3} label="Preferences" />
+ <Step step={4} label="All done" />
+ </Stepper>
</div>
);
},
@@ -660,26 +660,26 @@ export const LongLabels: Story = {
const [active, setActive] = useState(1);
return (
<div style={{maxWidth: 400}}>
- <XDSStepper
+ <Stepper
activeStep={active}
orientation="vertical"
onStepClick={setActive}>
- <XDSStep
+ <Step
step={0}
label="Configure your development environment"
description="Install dependencies, set up local database, configure environment variables"
/>
- <XDSStep
+ <Step
step={1}
label="Create initial data migration"
description="Define schema, seed data, and run migrations against staging"
/>
- <XDSStep
+ <Step
step={2}
label="Submit for code review"
description="Open pull request and address reviewer feedback"
/>
- </XDSStepper>
+ </Stepper>
</div>
);
},
diff --git a/apps/storybook/stories/ThreeD-Backdrop.stories.tsx b/apps/storybook/stories/ThreeD-Backdrop.stories.tsx
index 74122d4ed4..c8bf77f501 100644
--- a/apps/storybook/stories/ThreeD-Backdrop.stories.tsx
+++ b/apps/storybook/stories/ThreeD-Backdrop.stories.tsx
@@ -2,7 +2,7 @@
import type {Meta, StoryObj} from '@storybook/react';
import {useMemo} from 'react';
-import {XDS3DChart, use3D} from '@xds/lab';
+import {ThreeDChart, use3D} from '@xds/lab';
const meta: Meta = {title: 'Lab/3DChart/Backdrop'};
export default meta;
@@ -147,7 +147,7 @@ export const SplitDarkLight: StoryObj = {
const data = useMemo(() => sphere(2000), []);
return (
<div style={{borderRadius: 16, overflow: 'hidden', maxWidth: 600}}>
- <XDS3DChart
+ <ThreeDChart
data={data}
xKey="x"
yKey="y"
@@ -161,7 +161,7 @@ export const SplitDarkLight: StoryObj = {
leftDot="#DFE2E5"
rightDot="#0A1317"
/>
- </XDS3DChart>
+ </ThreeDChart>
</div>
);
},
@@ -173,7 +173,7 @@ export const SplitBoldColors: StoryObj = {
const data = useMemo(() => torusKnot(2500), []);
return (
<div style={{borderRadius: 16, overflow: 'hidden', maxWidth: 600}}>
- <XDS3DChart
+ <ThreeDChart
data={data}
xKey="x"
yKey="y"
@@ -187,7 +187,7 @@ export const SplitBoldColors: StoryObj = {
leftDot="#FFFFFF"
rightDot="#FFFFFF"
/>
- </XDS3DChart>
+ </ThreeDChart>
</div>
);
},
@@ -262,7 +262,7 @@ export const QuadSplit: StoryObj = {
const data = useMemo(() => sphere(2500), []);
return (
<div style={{borderRadius: 16, overflow: 'hidden', maxWidth: 600}}>
- <XDS3DChart
+ <ThreeDChart
data={data}
xKey="x"
yKey="y"
@@ -271,7 +271,7 @@ export const QuadSplit: StoryObj = {
interactive
autoRotate={0.15}>
<QuadBackdropInner />
- </XDS3DChart>
+ </ThreeDChart>
</div>
);
},
diff --git a/apps/storybook/stories/ThreeD-Showcase.stories.tsx b/apps/storybook/stories/ThreeD-Showcase.stories.tsx
index dbc37c774f..de4f979d07 100644
--- a/apps/storybook/stories/ThreeD-Showcase.stories.tsx
+++ b/apps/storybook/stories/ThreeD-Showcase.stories.tsx
@@ -3,9 +3,9 @@
import type {Meta, StoryObj} from '@storybook/react';
import {useMemo} from 'react';
import {
- XDS3DChart,
- XDS3DScatter,
- XDS3DScatterGL,
+ ThreeDChart,
+ ThreeDScatter,
+ ThreeDScatterGL,
} from '@xds/lab';
import {MediaTheme} from '@xds/core/theme';
@@ -193,7 +193,7 @@ function Cell({
flexDirection: 'column',
}}>
<div style={{flex: 1, padding: 4}}>
- <XDS3DChart
+ <ThreeDChart
data={data}
xKey="x"
yKey="y"
@@ -203,12 +203,12 @@ function Cell({
elevation={elevation}
interactive
autoRotate={0.3}>
- <XDS3DScatterGL
+ <ThreeDScatterGL
color={mediaMode === 'dark' ? '#DFE2E5' : '#0A1317'}
size={1.5}
opacity={0.6}
/>
- </XDS3DChart>
+ </ThreeDChart>
</div>
<div
style={{
@@ -361,9 +361,9 @@ export const SVGvsWebGL: StoryObj = {
letterSpacing: '0.05em',
textTransform: 'uppercase',
}}>
- SVG (XDS3DScatter)
+ SVG (ThreeDScatter)
</div>
- <XDS3DChart
+ <ThreeDChart
data={data}
xKey="x"
yKey="y"
@@ -373,8 +373,8 @@ export const SVGvsWebGL: StoryObj = {
elevation={20}
interactive
autoRotate={0.3}>
- <XDS3DScatter color="#DFE2E5" radius={1.5} opacity={0.85} />
- </XDS3DChart>
+ <ThreeDScatter color="#DFE2E5" radius={1.5} opacity={0.85} />
+ </ThreeDChart>
</MediaTheme>
</div>
<div
@@ -390,9 +390,9 @@ export const SVGvsWebGL: StoryObj = {
letterSpacing: '0.05em',
textTransform: 'uppercase',
}}>
- WebGL (XDS3DScatterGL)
+ WebGL (ThreeDScatterGL)
</div>
- <XDS3DChart
+ <ThreeDChart
data={data}
xKey="x"
yKey="y"
@@ -402,8 +402,8 @@ export const SVGvsWebGL: StoryObj = {
elevation={20}
interactive
autoRotate={0.3}>
- <XDS3DScatterGL color="#DFE2E5" size={3} opacity={0.85} />
- </XDS3DChart>
+ <ThreeDScatterGL color="#DFE2E5" size={3} opacity={0.85} />
+ </ThreeDChart>
</MediaTheme>
</div>
</div>
@@ -452,7 +452,7 @@ export const DebugProjection: StoryObj = {
}}>
SVG
</div>
- <XDS3DChart
+ <ThreeDChart
data={debugData}
xKey="x"
yKey="y"
@@ -460,8 +460,8 @@ export const DebugProjection: StoryObj = {
height={300}
azimuth={35}
elevation={25}>
- <XDS3DScatter color="#E3193B" radius={6} opacity={1} />
- </XDS3DChart>
+ <ThreeDScatter color="#E3193B" radius={6} opacity={1} />
+ </ThreeDChart>
</div>
<div
style={{
@@ -478,7 +478,7 @@ export const DebugProjection: StoryObj = {
}}>
WebGL
</div>
- <XDS3DChart
+ <ThreeDChart
data={debugData}
xKey="x"
yKey="y"
@@ -486,8 +486,8 @@ export const DebugProjection: StoryObj = {
height={300}
azimuth={35}
elevation={25}>
- <XDS3DScatterGL color="#0064E0" size={12} opacity={1} />
- </XDS3DChart>
+ <ThreeDScatterGL color="#0064E0" size={12} opacity={1} />
+ </ThreeDChart>
</div>
</div>
);
@@ -515,7 +515,7 @@ export const DebugOverlay: StoryObj = {
<div style={{padding: '4px 8px', fontSize: 11}}>
Red = SVG, Blue = WebGL. If Tier 1 holds, they overlap perfectly.
</div>
- <XDS3DChart
+ <ThreeDChart
data={debugData}
xKey="x"
yKey="y"
@@ -523,9 +523,9 @@ export const DebugOverlay: StoryObj = {
height={400}
azimuth={35}
elevation={25}>
- <XDS3DScatter color="#E3193B" radius={8} opacity={0.8} />
- <XDS3DScatterGL color="#0064E0" size={8} opacity={0.8} />
- </XDS3DChart>
+ <ThreeDScatter color="#E3193B" radius={8} opacity={0.8} />
+ <ThreeDScatterGL color="#0064E0" size={8} opacity={0.8} />
+ </ThreeDChart>
</div>
);
},
@@ -555,7 +555,7 @@ export const DebugSizeOpacity: StoryObj = {
textAlign: 'center',
}}>
<div style={{fontSize: 9, color: '#ccc'}}>SVG 16</div>
- <XDS3DChart
+ <ThreeDChart
data={pt}
xKey="x"
yKey="y"
@@ -563,8 +563,8 @@ export const DebugSizeOpacity: StoryObj = {
height={120}
azimuth={0}
elevation={0}>
- <XDS3DScatter color="#E3193B" radius={8} opacity={1} />
- </XDS3DChart>
+ <ThreeDScatter color="#E3193B" radius={8} opacity={1} />
+ </ThreeDChart>
</div>
<div
style={{
@@ -574,7 +574,7 @@ export const DebugSizeOpacity: StoryObj = {
textAlign: 'center',
}}>
<div style={{fontSize: 9, color: '#ccc'}}>GL 16</div>
- <XDS3DChart
+ <ThreeDChart
data={pt}
xKey="x"
yKey="y"
@@ -582,8 +582,8 @@ export const DebugSizeOpacity: StoryObj = {
height={120}
azimuth={0}
elevation={0}>
- <XDS3DScatterGL color="#0064E0" size={16} opacity={1} />
- </XDS3DChart>
+ <ThreeDScatterGL color="#0064E0" size={16} opacity={1} />
+ </ThreeDChart>
</div>
<div
style={{
@@ -593,7 +593,7 @@ export const DebugSizeOpacity: StoryObj = {
textAlign: 'center',
}}>
<div style={{fontSize: 9, color: '#ccc'}}>SVG on GL</div>
- <XDS3DChart
+ <ThreeDChart
data={pt}
xKey="x"
yKey="y"
@@ -601,9 +601,9 @@ export const DebugSizeOpacity: StoryObj = {
height={120}
azimuth={0}
elevation={0}>
- <XDS3DScatterGL color="#0064E0" size={16} opacity={1} />
- <XDS3DScatter color="#E3193B" radius={8} opacity={1} />
- </XDS3DChart>
+ <ThreeDScatterGL color="#0064E0" size={16} opacity={1} />
+ <ThreeDScatter color="#E3193B" radius={8} opacity={1} />
+ </ThreeDChart>
</div>
<div
style={{
@@ -613,7 +613,7 @@ export const DebugSizeOpacity: StoryObj = {
textAlign: 'center',
}}>
<div style={{fontSize: 9, color: '#ccc'}}>GL on SVG</div>
- <XDS3DChart
+ <ThreeDChart
data={pt}
xKey="x"
yKey="y"
@@ -621,9 +621,9 @@ export const DebugSizeOpacity: StoryObj = {
height={120}
azimuth={0}
elevation={0}>
- <XDS3DScatter color="#E3193B" radius={8} opacity={1} />
- <XDS3DScatterGL color="#0064E0" size={16} opacity={1} />
- </XDS3DChart>
+ <ThreeDScatter color="#E3193B" radius={8} opacity={1} />
+ <ThreeDScatterGL color="#0064E0" size={16} opacity={1} />
+ </ThreeDChart>
</div>
</div>
<div style={{fontSize: 11, fontWeight: 500}}>Size 16, \u03b1=0.5</div>
@@ -636,7 +636,7 @@ export const DebugSizeOpacity: StoryObj = {
textAlign: 'center',
}}>
<div style={{fontSize: 9, color: '#ccc'}}>SVG on GL</div>
- <XDS3DChart
+ <ThreeDChart
data={pt}
xKey="x"
yKey="y"
@@ -644,9 +644,9 @@ export const DebugSizeOpacity: StoryObj = {
height={120}
azimuth={0}
elevation={0}>
- <XDS3DScatterGL color="#0064E0" size={16} opacity={0.5} />
- <XDS3DScatter color="#E3193B" radius={8} opacity={0.5} />
- </XDS3DChart>
+ <ThreeDScatterGL color="#0064E0" size={16} opacity={0.5} />
+ <ThreeDScatter color="#E3193B" radius={8} opacity={0.5} />
+ </ThreeDChart>
</div>
<div
style={{
@@ -656,7 +656,7 @@ export const DebugSizeOpacity: StoryObj = {
textAlign: 'center',
}}>
<div style={{fontSize: 9, color: '#ccc'}}>GL on SVG</div>
- <XDS3DChart
+ <ThreeDChart
data={pt}
xKey="x"
yKey="y"
@@ -664,9 +664,9 @@ export const DebugSizeOpacity: StoryObj = {
height={120}
azimuth={0}
elevation={0}>
- <XDS3DScatter color="#E3193B" radius={8} opacity={0.5} />
- <XDS3DScatterGL color="#0064E0" size={16} opacity={0.5} />
- </XDS3DChart>
+ <ThreeDScatter color="#E3193B" radius={8} opacity={0.5} />
+ <ThreeDScatterGL color="#0064E0" size={16} opacity={0.5} />
+ </ThreeDChart>
</div>
</div>
</div>
diff --git a/apps/storybook/stories/ThreeDChart.stories.tsx b/apps/storybook/stories/ThreeDChart.stories.tsx
index 721f513f45..4b4f53b29a 100644
--- a/apps/storybook/stories/ThreeDChart.stories.tsx
+++ b/apps/storybook/stories/ThreeDChart.stories.tsx
@@ -2,13 +2,13 @@
import type {Meta, StoryObj} from '@storybook/react';
import {
- XDS3DChart,
- XDS3DScatter,
- XDS3DBar,
- XDS3DGrid,
- XDS3DAxis,
- XDS3DSurface,
- useXDSChartColors,
+ ThreeDChart,
+ ThreeDScatter,
+ ThreeDBar,
+ ThreeDGrid,
+ ThreeDAxis,
+ ThreeDSurface,
+ useChartColors,
} from '@xds/lab';
import {Stack, Text} from '@xds/core';
import {Heading} from '@xds/core/Text';
@@ -30,24 +30,24 @@ const scatterData = Array.from({length: 200}, () => ({
/** 3D scatter plot — drag to rotate */
export const Scatter3D: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
return (
<Stack direction="vertical" gap={4}>
<Heading level={3}>3D Scatter Plot</Heading>
<Text type="supporting" color="secondary">
200 points. Drag to rotate. Depth encoded via size and opacity.
</Text>
- <XDS3DChart
+ <ThreeDChart
data={scatterData}
xKey="x"
yKey="y"
zKey="z"
height={400}
interactive>
- <XDS3DGrid />
- <XDS3DAxis />
- <XDS3DScatter color={colors.categorical(1)[0]} radius={4} />
- </XDS3DChart>
+ <ThreeDGrid />
+ <ThreeDAxis />
+ <ThreeDScatter color={colors.categorical(1)[0]} radius={4} />
+ </ThreeDChart>
</Stack>
);
},
@@ -69,28 +69,28 @@ const barData = [
/** 3D bar chart — drag to rotate */
export const Bar3D: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
return (
<Stack direction="vertical" gap={4}>
<Heading level={3}>3D Bar Chart</Heading>
<Text type="supporting" color="secondary">
Sales by product x region. Drag to rotate.
</Text>
- <XDS3DChart
+ <ThreeDChart
data={barData}
xKey="product"
yKey="sales"
zKey="region"
height={400}
interactive>
- <XDS3DGrid divisions={3} />
- <XDS3DAxis />
- <XDS3DBar
+ <ThreeDGrid divisions={3} />
+ <ThreeDAxis />
+ <ThreeDBar
color={colors.categorical(1)[0]}
barWidth={0.12}
barDepth={0.12}
/>
- </XDS3DChart>
+ </ThreeDChart>
</Stack>
);
},
@@ -110,24 +110,24 @@ for (let x = 0; x <= 20; x++) {
/** 3D surface — height-colored mesh */
export const Surface3D: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
return (
<Stack direction="vertical" gap={4}>
<Heading level={3}>3D Surface</Heading>
<Text type="supporting" color="secondary">
sin(x) * cos(z) surface. Drag to rotate. Color maps to height.
</Text>
- <XDS3DChart
+ <ThreeDChart
data={surfaceData}
xKey="x"
yKey="y"
zKey="z"
height={450}
interactive>
- <XDS3DGrid />
- <XDS3DAxis />
- <XDS3DSurface colorRange={colors.sequential.blue(5)} />
- </XDS3DChart>
+ <ThreeDGrid />
+ <ThreeDAxis />
+ <ThreeDSurface colorRange={colors.sequential.blue(5)} />
+ </ThreeDChart>
</Stack>
);
},
@@ -136,20 +136,20 @@ export const Surface3D: StoryObj = {
/** 3D surface wireframe */
export const Wireframe3D: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
+ const colors = useChartColors();
return (
<Stack direction="vertical" gap={4}>
<Heading level={3}>3D Wireframe</Heading>
- <XDS3DChart
+ <ThreeDChart
data={surfaceData}
xKey="x"
yKey="y"
zKey="z"
height={450}
interactive>
- <XDS3DGrid />
- <XDS3DSurface colorRange={colors.sequential.teal(5)} wireframe />
- </XDS3DChart>
+ <ThreeDGrid />
+ <ThreeDSurface colorRange={colors.sequential.teal(5)} wireframe />
+ </ThreeDChart>
</Stack>
);
},
diff --git a/apps/storybook/stories/XIFSpec.stories.tsx b/apps/storybook/stories/XIFSpec.stories.tsx
index 7850b60d33..64c5148416 100644
--- a/apps/storybook/stories/XIFSpec.stories.tsx
+++ b/apps/storybook/stories/XIFSpec.stories.tsx
@@ -3,7 +3,7 @@
import type {Meta, StoryObj} from '@storybook/react';
import {Fragment} from 'react';
import {
- XDSSVGIcon,
+ SVGIcon,
type SVGIconVariation,
type SVGIconDef,
type IconShape,
@@ -24,7 +24,7 @@ import {
} from '../../../packages/lab/src/SVGIcon/xif-examples';
// =============================================================================
-// Adapter: XIFIcon → SVGIconDef (until XDSSVGIcon natively reads XIF)
+// Adapter: XIFIcon → SVGIconDef (until SVGIcon natively reads XIF)
// =============================================================================
function xifToSvgIconDef(xif: XIFIcon): SVGIconDef {
@@ -138,7 +138,7 @@ export const SpecExamples: StoryObj = {
<div
key={`${xif.name}-${v}`}
style={{display: 'flex', justifyContent: 'center'}}>
- <XDSSVGIcon icon={def} variation={v} size="lg" />
+ <SVGIcon icon={def} variation={v} size="lg" />
</div>
))}
</Fragment>
@@ -219,8 +219,8 @@ export const CompositionSlots: StoryObj = {
].map(({label, def}) => (
<Stack key={label} direction="vertical" gap={1} hAlign="center">
<Stack direction="horizontal" gap={2}>
- <XDSSVGIcon icon={def} variation="linear" size="lg" />
- <XDSSVGIcon icon={def} variation="bold" size="lg" />
+ <SVGIcon icon={def} variation="linear" size="lg" />
+ <SVGIcon icon={def} variation="bold" size="lg" />
</Stack>
<Text type="supporting" style={{fontSize: 10}}>
{label}
@@ -311,7 +311,7 @@ export const PersonalityAxes: StoryObj = {
justifyContent: 'center',
opacity: 0.3 + i * 0.175,
}}>
- <XDSSVGIcon
+ <SVGIcon
icon={def}
variation="linear"
size="lg"
diff --git a/apps/storybook/stories/useXDSChartRange.stories.tsx b/apps/storybook/stories/useChartRange.stories.tsx
similarity index 75%
rename from apps/storybook/stories/useXDSChartRange.stories.tsx
rename to apps/storybook/stories/useChartRange.stories.tsx
index 260db8ec44..7c982f7b33 100644
--- a/apps/storybook/stories/useXDSChartRange.stories.tsx
+++ b/apps/storybook/stories/useChartRange.stories.tsx
@@ -3,30 +3,30 @@
import type {Meta, StoryObj} from '@storybook/react';
import {useRef, useEffect} from 'react';
import {
- XDSChart,
- XDSChartAxis,
- XDSChartGrid,
- XDSChartStreamGL,
- useXDSChartColors,
- useXDSChartRange,
- type XDSChartStreamGLHandle,
+ Chart,
+ ChartAxis,
+ ChartGrid,
+ ChartStreamGL,
+ useChartColors,
+ useChartRange,
+ type ChartStreamGLHandle,
} from '@xds/lab';
import {Stack, Text} from '@xds/core';
import {Heading} from '@xds/core/Text';
const meta: Meta = {
- title: 'Lab/useXDSChartRange',
+ title: 'Lab/useChartRange',
};
export default meta;
-/** Known y-range — useXDSChartRange just manages the sliding x window */
+/** Known y-range — useChartRange just manages the sliding x window */
export const KnownRange: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
- const streamRef = useRef<XDSChartStreamGLHandle>(null);
+ const colors = useChartColors();
+ const streamRef = useRef<ChartStreamGLHandle>(null);
const tRef = useRef(0);
- const {xDomain, yDomain, push} = useXDSChartRange({
+ const {xDomain, yDomain, push} = useChartRange({
xWindow: 300,
yDomain: [0, 100],
});
@@ -45,26 +45,26 @@ export const KnownRange: StoryObj = {
<Stack direction="vertical" gap={4}>
<Heading level={3}>Known Range (0-100%)</Heading>
<Text type="supporting" color="secondary">
- yDomain fixed at [0, 100]. useXDSChartRange manages xDomain sliding
+ yDomain fixed at [0, 100]. useChartRange manages xDomain sliding
window.
</Text>
- <XDSChart
+ <Chart
data={[]}
xKey="t"
yKeys={[]}
xDomain={xDomain}
yDomain={yDomain}
height={200}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartStreamGL
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartStreamGL
handleRef={streamRef}
color={colors.categorical(1)[0]}
bufferSize={300}
lineWidth={1.5}
/>
- </XDSChart>
+ </Chart>
</Stack>
);
},
@@ -73,10 +73,10 @@ export const KnownRange: StoryObj = {
/** Unknown y-range — auto-tracks from data with 10% padding */
export const UnknownRange: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
- const streamRef = useRef<XDSChartStreamGLHandle>(null);
+ const colors = useChartColors();
+ const streamRef = useRef<ChartStreamGLHandle>(null);
const tRef = useRef(0);
- const {xDomain, yDomain, push} = useXDSChartRange({
+ const {xDomain, yDomain, push} = useChartRange({
xWindow: 300,
yPadding: 0.1,
});
@@ -99,23 +99,23 @@ export const UnknownRange: StoryObj = {
No fixed yDomain. Range auto-expands as data reveals amplitude.
Currently: [{yDomain[0].toFixed(1)}, {yDomain[1].toFixed(1)}]
</Text>
- <XDSChart
+ <Chart
data={[]}
xKey="t"
yKeys={[]}
xDomain={xDomain}
yDomain={yDomain}
height={200}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartStreamGL
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartStreamGL
handleRef={streamRef}
color={colors.categorical(2)[1]}
bufferSize={300}
lineWidth={1.5}
/>
- </XDSChart>
+ </Chart>
</Stack>
);
},
@@ -124,11 +124,11 @@ export const UnknownRange: StoryObj = {
/** Zero-centered — seismograph pattern with yCenter */
export const ZeroCentered: StoryObj = {
render: () => {
- const colors = useXDSChartColors();
- const streamRef = useRef<XDSChartStreamGLHandle>(null);
+ const colors = useChartColors();
+ const streamRef = useRef<ChartStreamGLHandle>(null);
const tRef = useRef(0);
const quakeRef = useRef(0);
- const {xDomain, yDomain, push} = useXDSChartRange({
+ const {xDomain, yDomain, push} = useChartRange({
xWindow: 600,
yCenter: true,
yPadding: 0.05,
@@ -163,7 +163,7 @@ export const ZeroCentered: StoryObj = {
yCenter=true keeps 0 at center. Range auto-expands on quake bursts.
Currently: [{yDomain[0].toFixed(1)}, {yDomain[1].toFixed(1)}]
</Text>
- <XDSChart
+ <Chart
data={[]}
xKey="t"
yKeys={[]}
@@ -171,17 +171,17 @@ export const ZeroCentered: StoryObj = {
yDomain={yDomain}
yBaseline="zero"
height={220}>
- <XDSChartGrid horizontal />
- <XDSChartAxis position="bottom" />
- <XDSChartAxis position="left" />
- <XDSChartStreamGL
+ <ChartGrid horizontal />
+ <ChartAxis position="bottom" />
+ <ChartAxis position="left" />
+ <ChartStreamGL
handleRef={streamRef}
color={colors.categorical(5)[3]}
bufferSize={600}
lineWidth={1}
opacity={0.9}
/>
- </XDSChart>
+ </Chart>
</Stack>
);
},
diff --git a/packages/cli/templates/pages/table-page-chart/page.tsx b/packages/cli/templates/pages/table-page-chart/page.tsx
index 6bd5f52d61..2c7c7c847b 100644
--- a/packages/cli/templates/pages/table-page-chart/page.tsx
+++ b/packages/cli/templates/pages/table-page-chart/page.tsx
@@ -20,9 +20,9 @@ import {Thumbnail} from '@xds/core/Thumbnail';
import {Table, proportional, pixel} from '@xds/core/Table';
import type {TableColumn} from '@xds/core/Table';
import {
- XDSChartV2 as XDSChart,
- XDSChartGrid,
- XDSChartAxis,
+ ChartV2 as Chart,
+ ChartGrid,
+ ChartAxis,
area,
line,
} from '@xds/lab';
@@ -550,18 +550,18 @@ export default function TablePageChartTemplate() {
content={
<LayoutContent padding={3}>
<VStack gap={4}>
- <XDSChart
+ <Chart
data={revenueData}
xKey="date"
series={[
area('revenue', {color: '#14b8a6', gradient: true}),
line('revenue', {color: '#14b8a6'}),
]}
- grid={<XDSChartGrid horizontal />}
+ grid={<ChartGrid horizontal />}
axes={
<>
- <XDSChartAxis position="bottom" />
- <XDSChartAxis
+ <ChartAxis position="bottom" />
+ <ChartAxis
position="left"
tickFormat={(v: unknown) => `$${v}`}
/>
diff --git a/packages/cli/templates/pages/table-page-heatmap-status/page.tsx b/packages/cli/templates/pages/table-page-heatmap-status/page.tsx
index a744228189..b9d2f7920d 100644
--- a/packages/cli/templates/pages/table-page-heatmap-status/page.tsx
+++ b/packages/cli/templates/pages/table-page-heatmap-status/page.tsx
@@ -20,7 +20,7 @@ import {Badge} from '@xds/core/Badge';
import {Link} from '@xds/core/Link';
import {Table, proportional, pixel} from '@xds/core/Table';
import type {TableColumn} from '@xds/core/Table';
-import {XDSChart, XDSChartAxis, XDSChartHeatmapGL} from '@xds/lab';
+import {Chart, ChartAxis, ChartHeatmapGL} from '@xds/lab';
import {
FunnelIcon,
ArrowDownTrayIcon,
@@ -408,20 +408,20 @@ function OutageHeatmap() {
const heatmapData = useMemo(() => buildHeatmapData(incidents), []);
return (
- <XDSChart
+ <Chart
data={heatmapData}
xKey="day"
yKeys={['incidents']}
height={280}
margin={{left: 0, right: 0, top: 0, bottom: 30}}>
- <XDSChartAxis position="bottom" />
- <XDSChartHeatmapGL
+ <ChartAxis position="bottom" />
+ <ChartHeatmapGL
xKey="day"
yKey="hour"
valueKey="incidents"
colorRange={['#dcfce7', '#fee2e2', '#fca5a5', '#ef4444', '#991b1b']}
/>
- </XDSChart>
+ </Chart>
);
}
diff --git a/packages/cli/templates/pages/table-page-shoe-store-heatmap/page.tsx b/packages/cli/templates/pages/table-page-shoe-store-heatmap/page.tsx
index 498c755669..c77d9d63a4 100644
--- a/packages/cli/templates/pages/table-page-shoe-store-heatmap/page.tsx
+++ b/packages/cli/templates/pages/table-page-shoe-store-heatmap/page.tsx
@@ -20,9 +20,9 @@ import {Thumbnail} from '@xds/core/Thumbnail';
import {Table, proportional, pixel} from '@xds/core/Table';
import type {TableColumn} from '@xds/core/Table';
import {
- XDSChartV2 as XDSChart,
- XDSChartGrid,
- XDSChartAxis,
+ ChartV2 as Chart,
+ ChartGrid,
+ ChartAxis,
area,
line,
} from '@xds/lab';
@@ -908,18 +908,18 @@ export default function TablePageShoeStoreHeatmapTemplate() {
content={
<LayoutContent padding={3}>
<VStack gap={4}>
- <XDSChart
+ <Chart
data={revenueData}
xKey="date"
series={[
area('revenue', {color: '#3b82f6', gradient: true}),
line('revenue', {color: '#3b82f6'}),
]}
- grid={<XDSChartGrid horizontal />}
+ grid={<ChartGrid horizontal />}
axes={
<>
- <XDSChartAxis position="bottom" />
- <XDSChartAxis
+ <ChartAxis position="bottom" />
+ <ChartAxis
position="left"
tickFormat={(v: unknown) => `$${Number(v) / 1000}k`}
/>
diff --git a/packages/lab/src/Chart/XDSChart.tsx b/packages/lab/src/Chart/Chart.tsx
similarity index 96%
rename from packages/lab/src/Chart/XDSChart.tsx
rename to packages/lab/src/Chart/Chart.tsx
index 6068ced871..b8a69d34b2 100644
--- a/packages/lab/src/Chart/XDSChart.tsx
+++ b/packages/lab/src/Chart/Chart.tsx
@@ -1,7 +1,7 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSChart.tsx
+ * @file Chart.tsx
* @output Root chart container — sets up SVG, scales, and context
* @position Parent component; all chart marks/axes/interactions are children
*
@@ -32,7 +32,7 @@ import type {ChartMargin, ChartScale} from './types';
*/
export type YBaseline = 'auto' | 'zero' | 'data';
-export interface XDSChartProps {
+export interface ChartProps {
/** The dataset — array of objects with consistent keys */
data: Record<string, unknown>[];
/**
@@ -86,14 +86,14 @@ const DEFAULT_MARGIN: ChartMargin = {top: 16, right: 16, bottom: 32, left: 48};
*
* @example
* ```
- * <XDSChart data={data} xKey="month" yKeys={['revenue']} height={300}>
- * <XDSChartAxis position="bottom" />
- * <XDSChartAxis position="left" />
- * <XDSChartBar dataKey="revenue" color={useXDSChartColors().categorical(1)[0]} />
- * </XDSChart>
+ * <Chart data={data} xKey="month" yKeys={['revenue']} height={300}>
+ * <ChartAxis position="bottom" />
+ * <ChartAxis position="left" />
+ * <ChartBar dataKey="revenue" color={useChartColors().categorical(1)[0]} />
+ * </Chart>
* ```
*/
-export function XDSChart({
+export function Chart({
data,
xKey,
yKeys,
@@ -104,7 +104,7 @@ export function XDSChart({
xDomain: xDomainProp,
interactive = false,
children,
-}: XDSChartProps) {
+}: ChartProps) {
const containerRef = useRef<HTMLDivElement>(null);
const svgRef = useRef<SVGSVGElement>(null);
const [containerWidth, setContainerWidth] = useState(0);
diff --git a/packages/lab/src/Chart/XDSChartArea.tsx b/packages/lab/src/Chart/ChartArea.tsx
similarity index 86%
rename from packages/lab/src/Chart/XDSChartArea.tsx
rename to packages/lab/src/Chart/ChartArea.tsx
index 8bc1712a9d..74cc8c1d01 100644
--- a/packages/lab/src/Chart/XDSChartArea.tsx
+++ b/packages/lab/src/Chart/ChartArea.tsx
@@ -1,9 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSChartArea.tsx
+ * @file ChartArea.tsx
* @output Renders a filled area between two y-bounds — confidence intervals, bands, ranges
- * @position Child of XDSChart; reads scales from context
+ * @position Child of Chart; reads scales from context
*/
import {useMemo} from 'react';
@@ -11,7 +11,7 @@ import {area, curveMonotoneX} from 'd3-shape';
import {useChart} from './ChartContext';
import {xPixel} from './utils';
-export interface XDSChartAreaProps {
+export interface ChartAreaProps {
/** Data key for the upper bound. If omitted, uses `baseline`. */
yUpper?: string;
/** Data key for the lower bound. If omitted, uses `baseline`. */
@@ -34,11 +34,11 @@ export interface XDSChartAreaProps {
*
* @example
* ```
- * <XDSChartArea yUpper="upper95" yLower="lower95" color={colors[0]} />
- * <XDSChartArea yUpper="upper95" baseline="mean" color={colors[0]} />
+ * <ChartArea yUpper="upper95" yLower="lower95" color={colors[0]} />
+ * <ChartArea yUpper="upper95" baseline="mean" color={colors[0]} />
* ```
*/
-export function XDSChartArea({
+export function ChartArea({
yUpper,
yLower,
baseline,
@@ -46,7 +46,7 @@ export function XDSChartArea({
opacity = 0.2,
stroke = false,
strokeWidth = 1,
-}: XDSChartAreaProps) {
+}: ChartAreaProps) {
const {data, xKey, xScale, yScale} = useChart();
const upperKey = yUpper ?? baseline;
diff --git a/packages/lab/src/Chart/XDSChartAxis.tsx b/packages/lab/src/Chart/ChartAxis.tsx
similarity index 93%
rename from packages/lab/src/Chart/XDSChartAxis.tsx
rename to packages/lab/src/Chart/ChartAxis.tsx
index 78854ef189..510e9daeac 100644
--- a/packages/lab/src/Chart/XDSChartAxis.tsx
+++ b/packages/lab/src/Chart/ChartAxis.tsx
@@ -1,9 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSChartAxis.tsx
+ * @file ChartAxis.tsx
* @output Renders an axis (top, right, bottom, left) using the chart's scales
- * @position Child of XDSChart; reads scales from context
+ * @position Child of Chart; reads scales from context
*
* Ticks use CSS transitions for smooth sliding during streaming updates.
*/
@@ -13,7 +13,7 @@ import {useChart} from './ChartContext';
import {isBandScale} from './utils';
import type {ScaleLinear, ScaleTime} from 'd3-scale';
-export interface XDSChartAxisProps {
+export interface ChartAxisProps {
/** Which edge to render the axis on */
position: 'top' | 'right' | 'bottom' | 'left';
/** Number of ticks (approximate — d3 decides final count) */
@@ -34,19 +34,19 @@ export interface XDSChartAxisProps {
*
* @example
* ```
- * <XDSChartAxis position="bottom" />
- * <XDSChartAxis position="left" tickCount={5} tickFormat={currency} />
- * <XDSChartAxis position="bottom" maxTicks={6} truncate={10} />
+ * <ChartAxis position="bottom" />
+ * <ChartAxis position="left" tickCount={5} tickFormat={currency} />
+ * <ChartAxis position="bottom" maxTicks={6} truncate={10} />
* ```
*/
-export function XDSChartAxis({
+export function ChartAxis({
position,
tickCount = 5,
maxTicks,
tickFormat,
truncate,
animated = true,
-}: XDSChartAxisProps) {
+}: ChartAxisProps) {
const {width, height, xScale, yScale} = useChart();
const isHorizontal = position === 'top' || position === 'bottom';
diff --git a/packages/lab/src/Chart/XDSChartBar.tsx b/packages/lab/src/Chart/ChartBar.tsx
similarity index 83%
rename from packages/lab/src/Chart/XDSChartBar.tsx
rename to packages/lab/src/Chart/ChartBar.tsx
index 198b79fcda..a764f3b765 100644
--- a/packages/lab/src/Chart/XDSChartBar.tsx
+++ b/packages/lab/src/Chart/ChartBar.tsx
@@ -1,15 +1,15 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSChartBar.tsx
+ * @file ChartBar.tsx
* @output Renders vertical bars for a data key
- * @position Child of XDSChart; reads scales from context
+ * @position Child of Chart; reads scales from context
*/
import {useChart} from './ChartContext';
import {isBandScale} from './utils';
-export interface XDSChartBarProps {
+export interface ChartBarProps {
/** Which data key to visualize */
dataKey: string;
/** Bar fill color (hex string, CSS var, etc.) */
@@ -24,10 +24,10 @@ export interface XDSChartBarProps {
*
* @example
* ```
- * <XDSChartBar dataKey="revenue" color={useXDSChartColors().categorical(1)[0]} />
+ * <ChartBar dataKey="revenue" color={useChartColors().categorical(1)[0]} />
* ```
*/
-export function XDSChartBar({dataKey, color, radius = 4}: XDSChartBarProps) {
+export function ChartBar({dataKey, color, radius = 4}: ChartBarProps) {
const {data, xKey, xScale, yScale} = useChart();
if (!isBandScale(xScale)) {
diff --git a/packages/lab/src/Chart/XDSChartBrush.tsx b/packages/lab/src/Chart/ChartBrush.tsx
similarity index 94%
rename from packages/lab/src/Chart/XDSChartBrush.tsx
rename to packages/lab/src/Chart/ChartBrush.tsx
index 1928514ff4..75ad488fc3 100644
--- a/packages/lab/src/Chart/XDSChartBrush.tsx
+++ b/packages/lab/src/Chart/ChartBrush.tsx
@@ -1,9 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSChartBrush.tsx
+ * @file ChartBrush.tsx
* @output Drag-to-select region. Supports x-only or 2D (xy) brush modes.
- * @position Child of XDSChart; reads scales from context
+ * @position Child of Chart; reads scales from context
*/
import React, {useState, useCallback, useRef} from 'react';
@@ -23,7 +23,7 @@ export interface BrushRange {
y?: [number, number];
}
-export interface XDSChartBrushProps {
+export interface ChartBrushProps {
/**
* Brush direction mode.
* - `'x'` — horizontal selection (default, good for time ranges)
@@ -78,19 +78,19 @@ function localCoords(e: React.PointerEvent<SVGRectElement>): {
* @example
* ```tsx
* // X-only (default)
- * <XDSChartBrush onBrush={({x}) => setZoom(x)} />
+ * <ChartBrush onBrush={({x}) => setZoom(x)} />
*
* // 2D rectangular
- * <XDSChartBrush mode="xy" onBrush={({x, y}, points) => setSelected(points)} />
+ * <ChartBrush mode="xy" onBrush={({x, y}, points) => setSelected(points)} />
* ```
*/
-export function XDSChartBrush({
+export function ChartBrush({
mode = 'x',
onBrush,
onClear,
color = 'var(--color-accent)',
opacity = 0.15,
-}: XDSChartBrushProps) {
+}: ChartBrushProps) {
const {width, height, data, xKey, xScale, yScale} = useChart();
const [brush, setBrush] = useState<{
x0: number;
diff --git a/packages/lab/src/Chart/XDSChartCandlestick.tsx b/packages/lab/src/Chart/ChartCandlestick.tsx
similarity index 92%
rename from packages/lab/src/Chart/XDSChartCandlestick.tsx
rename to packages/lab/src/Chart/ChartCandlestick.tsx
index a15e250db1..cec75596a5 100644
--- a/packages/lab/src/Chart/XDSChartCandlestick.tsx
+++ b/packages/lab/src/Chart/ChartCandlestick.tsx
@@ -1,9 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSChartCandlestick.tsx
+ * @file ChartCandlestick.tsx
* @output Renders candlestick/box-whisker marks for OHLC or statistical data
- * @position Child of XDSChart; reads scales from context
+ * @position Child of Chart; reads scales from context
*
* Two variants:
* - `'default'` — filled body with whiskers (traditional candlestick/box plot)
@@ -13,7 +13,7 @@
import {useChart} from './ChartContext';
import {isBandScale} from './utils';
-export interface XDSChartCandlestickProps {
+export interface ChartCandlestickProps {
/** Data key for the high/max value (top of whisker) */
high: string;
/** Data key for the low/min value (bottom of whisker) */
@@ -48,21 +48,21 @@ export interface XDSChartCandlestickProps {
* @example
* ```
* // Financial OHLC
- * <XDSChartCandlestick
+ * <ChartCandlestick
* high="high" low="low" open="open" close="close"
- * upColor={useXDSChartColors().semantic.positive}
- * downColor={useXDSChartColors().semantic.negative}
+ * upColor={useChartColors().semantic.positive}
+ * downColor={useChartColors().semantic.negative}
* />
*
* // OHLC bar
- * <XDSChartCandlestick
+ * <ChartCandlestick
* variant="bar"
* high="max" low="min" open="q1" close="median"
- * color={useXDSChartColors().categorical(1)[0]}
+ * color={useChartColors().categorical(1)[0]}
* />
* ```
*/
-export function XDSChartCandlestick({
+export function ChartCandlestick({
high,
low,
open,
@@ -74,7 +74,7 @@ export function XDSChartCandlestick({
bodyWidth = 0.6,
strokeWidth = 1.5,
radius = 2,
-}: XDSChartCandlestickProps) {
+}: ChartCandlestickProps) {
const {data, xKey, xScale, yScale} = useChart();
if (!isBandScale(xScale)) {
diff --git a/packages/lab/src/Chart/ChartContext.ts b/packages/lab/src/Chart/ChartContext.ts
index 8829b7439b..aa8e4cea47 100644
--- a/packages/lab/src/Chart/ChartContext.ts
+++ b/packages/lab/src/Chart/ChartContext.ts
@@ -3,7 +3,7 @@
/**
* @file ChartContext.ts
* @output React context for sharing scales and dimensions between chart components
- * @position Consumed by XDSChart (provider) and all child components (consumers)
+ * @position Consumed by Chart (provider) and all child components (consumers)
*/
import {createContext, useContext} from 'react';
@@ -13,11 +13,11 @@ const ChartCtx = createContext<ChartContext | null>(null);
export const ChartProvider = ChartCtx.Provider;
-/** Access the chart context. Throws if used outside <XDSChart>. */
+/** Access the chart context. Throws if used outside <Chart>. */
export function useChart(): ChartContext {
const ctx = useContext(ChartCtx);
if (!ctx) {
- throw new Error('Chart components must be used inside <XDSChart>');
+ throw new Error('Chart components must be used inside <Chart>');
}
return ctx;
}
diff --git a/packages/lab/src/Chart/XDSChartDot.tsx b/packages/lab/src/Chart/ChartDot.tsx
similarity index 72%
rename from packages/lab/src/Chart/XDSChartDot.tsx
rename to packages/lab/src/Chart/ChartDot.tsx
index 61a40d7da2..c0b7fdcb8a 100644
--- a/packages/lab/src/Chart/XDSChartDot.tsx
+++ b/packages/lab/src/Chart/ChartDot.tsx
@@ -1,15 +1,15 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSChartDot.tsx
+ * @file ChartDot.tsx
* @output Renders scatter dots for a data key
- * @position Child of XDSChart; reads scales from context
+ * @position Child of Chart; reads scales from context
*/
import {useChart} from './ChartContext';
import {xPixel} from './utils';
-export interface XDSChartDotProps {
+export interface ChartDotProps {
/** Which data key for the y values */
dataKey: string;
/** Dot fill color */
@@ -23,10 +23,10 @@ export interface XDSChartDotProps {
*
* @example
* ```
- * <XDSChartDot dataKey="outliers" color={useXDSChartColors().categorical(3)[2]} />
+ * <ChartDot dataKey="outliers" color={useChartColors().categorical(3)[2]} />
* ```
*/
-export function XDSChartDot({dataKey, color, radius = 4}: XDSChartDotProps) {
+export function ChartDot({dataKey, color, radius = 4}: ChartDotProps) {
const {data, xKey, xScale, yScale} = useChart();
return (
diff --git a/packages/lab/src/Chart/XDSChartDotGL.tsx b/packages/lab/src/Chart/ChartDotGL.tsx
similarity index 94%
rename from packages/lab/src/Chart/XDSChartDotGL.tsx
rename to packages/lab/src/Chart/ChartDotGL.tsx
index 76b6e77968..0a7d3354a4 100644
--- a/packages/lab/src/Chart/XDSChartDotGL.tsx
+++ b/packages/lab/src/Chart/ChartDotGL.tsx
@@ -1,9 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSChartDotGL.tsx
+ * @file ChartDotGL.tsx
* @output WebGL scatter — single draw call, canvas mounted outside SVG for sharp DPR
- * @position Child of XDSChart; reads scales from context
+ * @position Child of Chart; reads scales from context
*/
import {useRef, useEffect, useCallback} from 'react';
@@ -19,7 +19,7 @@ import {
POINT_SIZE_COMPENSATION,
} from './webgl';
-export interface XDSChartDotGLProps {
+export interface ChartDotGLProps {
dataKey: string;
color: string;
size?: number;
@@ -60,15 +60,15 @@ const FRAG = `
*
* @example
* ```
- * <XDSChartDotGL dataKey="value" color={colors.categorical(1)[0]} />
+ * <ChartDotGL dataKey="value" color={colors.categorical(1)[0]} />
* ```
*/
-export function XDSChartDotGL({
+export function ChartDotGL({
dataKey,
color,
size = 6,
opacity = 0.8,
-}: XDSChartDotGLProps) {
+}: ChartDotGLProps) {
const {data, xKey, xScale, yScale, width, height} = useChart();
const canvasRef = useRef<HTMLCanvasElement | null>(null);
const glRef = useRef<WebGLRenderingContext | null>(null);
diff --git a/packages/lab/src/Chart/XDSChartDotGLInteractive.tsx b/packages/lab/src/Chart/ChartDotGLInteractive.tsx
similarity index 97%
rename from packages/lab/src/Chart/XDSChartDotGLInteractive.tsx
rename to packages/lab/src/Chart/ChartDotGLInteractive.tsx
index 548fccfb1e..b71a8be4b8 100644
--- a/packages/lab/src/Chart/XDSChartDotGLInteractive.tsx
+++ b/packages/lab/src/Chart/ChartDotGLInteractive.tsx
@@ -1,9 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSChartDotGLInteractive.tsx
+ * @file ChartDotGLInteractive.tsx
* @output WebGL scatter with GPU color-picking for O(1) nearest-point hover detection
- * @position Child of XDSChart; renders to two canvases — one visible, one offscreen pick buffer
+ * @position Child of Chart; renders to two canvases — one visible, one offscreen pick buffer
*
* Technique: Each point is assigned a unique color encoding its index.
* On hover, we readPixels from the offscreen framebuffer at the cursor position
@@ -21,7 +21,7 @@ import {
import {useChart} from './ChartContext';
import {xPixel} from './utils';
-export interface XDSChartDotGLInteractiveProps {
+export interface ChartDotGLInteractiveProps {
/** Which data key for the y values */
dataKey: string;
/** Dot fill color (hex string) */
@@ -158,20 +158,20 @@ function linkProgram(
*
* @example
* ```
- * <XDSChartDotGLInteractive
+ * <ChartDotGLInteractive
* dataKey="value"
- * color={useXDSChartColors().categorical(1)[0]}
+ * color={useChartColors().categorical(1)[0]}
* renderTooltip={(d, i) => <span>Point {i}: {d.value}</span>}
* />
* ```
*/
-export function XDSChartDotGLInteractive({
+export function ChartDotGLInteractive({
dataKey,
color,
size = 6,
opacity = 0.8,
renderTooltip,
-}: XDSChartDotGLInteractiveProps) {
+}: ChartDotGLInteractiveProps) {
const {data, xKey, xScale, yScale, width, height} = useChart();
const visCanvasRef = useRef<HTMLCanvasElement>(null);
const pickCanvasRef = useRef<HTMLCanvasElement>(null);
diff --git a/packages/lab/src/Chart/XDSChartErrorBar.tsx b/packages/lab/src/Chart/ChartErrorBar.tsx
similarity index 82%
rename from packages/lab/src/Chart/XDSChartErrorBar.tsx
rename to packages/lab/src/Chart/ChartErrorBar.tsx
index 6aff58f2aa..0c693a7935 100644
--- a/packages/lab/src/Chart/XDSChartErrorBar.tsx
+++ b/packages/lab/src/Chart/ChartErrorBar.tsx
@@ -1,15 +1,15 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSChartErrorBar.tsx
+ * @file ChartErrorBar.tsx
* @output Renders error bars (whiskers) at each data point
- * @position Child of XDSChart; reads scales from context
+ * @position Child of Chart; reads scales from context
*/
import {useChart} from './ChartContext';
import {xPixel} from './utils';
-export interface XDSChartErrorBarProps {
+export interface ChartErrorBarProps {
/** Data key for the upper bound */
yUpper: string;
/** Data key for the lower bound */
@@ -23,21 +23,21 @@ export interface XDSChartErrorBarProps {
}
/**
- * Error bars with whisker caps. Pair with XDSChartBar or XDSChartDot.
+ * Error bars with whisker caps. Pair with ChartBar or ChartDot.
*
* @example
* ```
- * <XDSChartBar dataKey="mean" color={colors[0]} />
- * <XDSChartErrorBar yUpper="upper95" yLower="lower95" />
+ * <ChartBar dataKey="mean" color={colors[0]} />
+ * <ChartErrorBar yUpper="upper95" yLower="lower95" />
* ```
*/
-export function XDSChartErrorBar({
+export function ChartErrorBar({
yUpper,
yLower,
color = 'var(--color-text-primary)',
strokeWidth = 1.5,
capWidth = 8,
-}: XDSChartErrorBarProps) {
+}: ChartErrorBarProps) {
const {data, xKey, xScale, yScale} = useChart();
return (
diff --git a/packages/lab/src/Chart/XDSChartGrid.tsx b/packages/lab/src/Chart/ChartGrid.tsx
similarity index 87%
rename from packages/lab/src/Chart/XDSChartGrid.tsx
rename to packages/lab/src/Chart/ChartGrid.tsx
index 1bffe71784..1dc2c1d00e 100644
--- a/packages/lab/src/Chart/XDSChartGrid.tsx
+++ b/packages/lab/src/Chart/ChartGrid.tsx
@@ -1,9 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSChartGrid.tsx
+ * @file ChartGrid.tsx
* @output Renders horizontal and/or vertical grid lines
- * @position Child of XDSChart; reads scales from context
+ * @position Child of Chart; reads scales from context
*/
import {useMemo} from 'react';
@@ -11,7 +11,7 @@ import {useChart} from './ChartContext';
import {isBandScale} from './utils';
import type {ScaleLinear, ScaleTime} from 'd3-scale';
-export interface XDSChartGridProps {
+export interface ChartGridProps {
/** Show horizontal grid lines (default: true) */
horizontal?: boolean;
/** Show vertical grid lines */
@@ -23,14 +23,14 @@ export interface XDSChartGridProps {
*
* @example
* ```
- * <XDSChartGrid horizontal />
- * <XDSChartGrid horizontal vertical />
+ * <ChartGrid horizontal />
+ * <ChartGrid horizontal vertical />
* ```
*/
-export function XDSChartGrid({
+export function ChartGrid({
horizontal = true,
vertical = false,
-}: XDSChartGridProps) {
+}: ChartGridProps) {
const {width, height, xScale, yScale} = useChart();
const hLines = useMemo(() => {
diff --git a/packages/lab/src/Chart/XDSChartHeatmapGL.tsx b/packages/lab/src/Chart/ChartHeatmapGL.tsx
similarity index 96%
rename from packages/lab/src/Chart/XDSChartHeatmapGL.tsx
rename to packages/lab/src/Chart/ChartHeatmapGL.tsx
index d62d86b1ed..7522868964 100644
--- a/packages/lab/src/Chart/XDSChartHeatmapGL.tsx
+++ b/packages/lab/src/Chart/ChartHeatmapGL.tsx
@@ -1,9 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSChartHeatmapGL.tsx
+ * @file ChartHeatmapGL.tsx
* @output WebGL heatmap — 2D grid, canvas mounted outside SVG
- * @position Child of XDSChart; manages its own y band scale for rows
+ * @position Child of Chart; manages its own y band scale for rows
*/
import {useRef, useEffect, useMemo} from 'react';
@@ -19,7 +19,7 @@ import {
createProgram,
} from './webgl';
-export interface XDSChartHeatmapGLProps {
+export interface ChartHeatmapGLProps {
xKey: string;
yKey: string;
valueKey: string;
@@ -67,14 +67,14 @@ function sampleRamp(
];
}
-export function XDSChartHeatmapGL({
+export function ChartHeatmapGL({
xKey,
yKey,
valueKey,
colorRange,
domain: domainProp,
cellGap = 1,
-}: XDSChartHeatmapGLProps) {
+}: ChartHeatmapGLProps) {
const {data, xScale, width, height} = useChart();
const canvasRef = useRef<HTMLCanvasElement | null>(null);
const glRef = useRef<WebGLRenderingContext | null>(null);
diff --git a/packages/lab/src/Chart/XDSChartLegend.tsx b/packages/lab/src/Chart/ChartLegend.tsx
similarity index 85%
rename from packages/lab/src/Chart/XDSChartLegend.tsx
rename to packages/lab/src/Chart/ChartLegend.tsx
index d8c238cf6e..e5c5ec13b8 100644
--- a/packages/lab/src/Chart/XDSChartLegend.tsx
+++ b/packages/lab/src/Chart/ChartLegend.tsx
@@ -1,28 +1,28 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSChartLegend.tsx
+ * @file ChartLegend.tsx
* @output Renders a legend — discrete swatches or continuous gradient bar
- * @position Child of XDSChart or standalone
+ * @position Child of Chart or standalone
*
* Two modes:
* - Discrete: pass `items` — renders color swatches with labels
* - Gradient: pass `gradient` + `domain` — renders a continuous color bar with tick labels
*
- * The `gradient` prop accepts the output of useXDSChartColors().sequential/diverging directly.
+ * The `gradient` prop accepts the output of useChartColors().sequential/diverging directly.
*/
-export interface XDSChartLegendItem {
+export interface ChartLegendItem {
label: string;
color: string;
}
-export interface XDSChartLegendProps {
+export interface ChartLegendProps {
/** Discrete legend items — color swatches with labels */
- items?: XDSChartLegendItem[];
+ items?: ChartLegendItem[];
/**
* Continuous gradient — array of hex colors from low to high.
- * Pass the output of useXDSChartColors().sequential.blue(5) or diverging directly.
+ * Pass the output of useChartColors().sequential.blue(5) or diverging directly.
*/
gradient?: string[];
/** Numeric domain for the gradient [min, max]. Required when gradient is set. */
@@ -55,34 +55,34 @@ function toGradientCSS(colors: string[]): string {
* @example
* ```
* // Discrete
- * <XDSChartLegend items={[
+ * <ChartLegend items={[
* {label: 'Revenue', color: colors[0]},
* {label: 'Expenses', color: colors[1]},
* ]} />
*
- * // Continuous — pipe useXDSChartColors() directly
- * <XDSChartLegend
- * gradient={useXDSChartColors().sequential.blue(5)}
+ * // Continuous — pipe useChartColors() directly
+ * <ChartLegend
+ * gradient={useChartColors().sequential.blue(5)}
* domain={[0, 100]}
* label="Temperature"
* />
*
* // Diverging
- * <XDSChartLegend
- * gradient={useXDSChartColors().diverging.coldHot(7)}
+ * <ChartLegend
+ * gradient={useChartColors().diverging.coldHot(7)}
* domain={[-50, 50]}
* label="Change %"
* />
* ```
*/
-export function XDSChartLegend({
+export function ChartLegend({
items,
gradient,
domain,
label,
ticks = 3,
tickFormat = String,
-}: XDSChartLegendProps) {
+}: ChartLegendProps) {
// Gradient mode
if (gradient && gradient.length > 0 && domain) {
const [min, max] = domain;
diff --git a/packages/lab/src/Chart/XDSChartLine.tsx b/packages/lab/src/Chart/ChartLine.tsx
similarity index 82%
rename from packages/lab/src/Chart/XDSChartLine.tsx
rename to packages/lab/src/Chart/ChartLine.tsx
index 1d8b725249..e107bcd18b 100644
--- a/packages/lab/src/Chart/XDSChartLine.tsx
+++ b/packages/lab/src/Chart/ChartLine.tsx
@@ -1,9 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSChartLine.tsx
+ * @file ChartLine.tsx
* @output Renders a line for a data key
- * @position Child of XDSChart; reads scales from context
+ * @position Child of Chart; reads scales from context
*/
import {useMemo} from 'react';
@@ -11,7 +11,7 @@ import {line, curveMonotoneX} from 'd3-shape';
import {useChart} from './ChartContext';
import {xPixel} from './utils';
-export interface XDSChartLineProps {
+export interface ChartLineProps {
/** Which data key to visualize */
dataKey: string;
/** Line stroke color */
@@ -29,17 +29,17 @@ export interface XDSChartLineProps {
*
* @example
* ```
- * <XDSChartLine dataKey="trend" color={useXDSChartColors().categorical(2)[1]} />
- * <XDSChartLine dataKey="trend" color="#0171E3" dots />
+ * <ChartLine dataKey="trend" color={useChartColors().categorical(2)[1]} />
+ * <ChartLine dataKey="trend" color="#0171E3" dots />
* ```
*/
-export function XDSChartLine({
+export function ChartLine({
dataKey,
color,
strokeWidth = 2,
dots = false,
dotRadius = 3,
-}: XDSChartLineProps) {
+}: ChartLineProps) {
const {data, xKey, xScale, yScale} = useChart();
const points = useMemo(() => {
diff --git a/packages/lab/src/Chart/XDSChartReferenceLine.tsx b/packages/lab/src/Chart/ChartReferenceLine.tsx
similarity index 94%
rename from packages/lab/src/Chart/XDSChartReferenceLine.tsx
rename to packages/lab/src/Chart/ChartReferenceLine.tsx
index 6c37a39dc4..3f4c32bb6d 100644
--- a/packages/lab/src/Chart/XDSChartReferenceLine.tsx
+++ b/packages/lab/src/Chart/ChartReferenceLine.tsx
@@ -1,7 +1,7 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSChartReferenceLine.tsx
+ * @file ChartReferenceLine.tsx
* @output Horizontal or vertical reference line with crosshair-style badge label
*/
@@ -9,7 +9,7 @@ import {useChart} from './ChartContext';
import {isBandScale} from './utils';
import type {ScaleLinear} from 'd3-scale';
-export interface XDSChartReferenceLineProps {
+export interface ChartReferenceLineProps {
y?: number;
x?: number;
color?: string;
@@ -19,10 +19,10 @@ export interface XDSChartReferenceLineProps {
labelPosition?: 'start' | 'end';
}
-export function XDSChartReferenceLine({
+export function ChartReferenceLine({
y, x, color = 'var(--color-border-emphasized)',
strokeWidth = 1, strokeDasharray = '6 3', label, labelPosition = 'end',
-}: XDSChartReferenceLineProps) {
+}: ChartReferenceLineProps) {
const {width, height, xScale, yScale} = useChart();
// Shared badge dimensions — matches crosshair label style
diff --git a/packages/lab/src/Chart/XDSChartSelect.tsx b/packages/lab/src/Chart/ChartSelect.tsx
similarity index 95%
rename from packages/lab/src/Chart/XDSChartSelect.tsx
rename to packages/lab/src/Chart/ChartSelect.tsx
index e06c1abd5c..4962b55d0b 100644
--- a/packages/lab/src/Chart/XDSChartSelect.tsx
+++ b/packages/lab/src/Chart/ChartSelect.tsx
@@ -1,7 +1,7 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSChartSelect.tsx
+ * @file ChartSelect.tsx
* @output Click/tap to select data points. Pointer events.
*/
@@ -9,7 +9,7 @@ import {useCallback} from 'react';
import {useChart} from './ChartContext';
import {xPixel} from './utils';
-export interface XDSChartSelectProps {
+export interface ChartSelectProps {
onSelect?: (datum: Record<string, unknown>, index: number) => void;
onSelectionChange?: (indices: number[]) => void;
selected?: number[];
@@ -17,13 +17,13 @@ export interface XDSChartSelectProps {
radius?: number;
}
-export function XDSChartSelect({
+export function ChartSelect({
onSelect,
onSelectionChange,
selected = [],
color = 'var(--color-accent)',
radius = 6,
-}: XDSChartSelectProps) {
+}: ChartSelectProps) {
const {width, height, data, xKey, xScale, yScale} = useChart();
const handlePointerUp = useCallback(
diff --git a/packages/lab/src/Chart/XDSChartStreamGL.tsx b/packages/lab/src/Chart/ChartStreamGL.tsx
similarity index 93%
rename from packages/lab/src/Chart/XDSChartStreamGL.tsx
rename to packages/lab/src/Chart/ChartStreamGL.tsx
index 74cf28a6ab..d1f35751fc 100644
--- a/packages/lab/src/Chart/XDSChartStreamGL.tsx
+++ b/packages/lab/src/Chart/ChartStreamGL.tsx
@@ -1,11 +1,11 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSChartStreamGL.tsx
+ * @file ChartStreamGL.tsx
* @output WebGL streaming time-series line — ring buffer, canvas outside SVG
- * @position Child of XDSChart; uses the chart's xScale/yScale for mapping
+ * @position Child of Chart; uses the chart's xScale/yScale for mapping
*
- * Y-axis and x-axis domains are controlled by XDSChart.
+ * Y-axis and x-axis domains are controlled by Chart.
* For streaming, the parent should update xDomain as new data arrives.
*/
@@ -22,18 +22,18 @@ import {
createProgram,
} from './webgl';
-export interface XDSChartStreamGLProps {
+export interface ChartStreamGLProps {
/** Ref forwarded to the SVG marker element used to position the canvas. */
ref?: Ref<SVGGElement>;
/** Imperative handle ref for streaming data control. */
- handleRef?: Ref<XDSChartStreamGLHandle>;
+ handleRef?: Ref<ChartStreamGLHandle>;
color: string;
bufferSize?: number;
lineWidth?: number;
opacity?: number;
}
-export interface XDSChartStreamGLHandle {
+export interface ChartStreamGLHandle {
push(x: number, y: number): void;
clear(): void;
}
@@ -57,14 +57,14 @@ const FRAG = `
}
`;
-export function XDSChartStreamGL({
+export function ChartStreamGL({
ref,
handleRef,
color,
bufferSize = 500,
lineWidth = 2,
opacity = 1,
-}: XDSChartStreamGLProps) {
+}: ChartStreamGLProps) {
const {width, height, xScale, yScale} = useChart();
const canvasRef = useRef<HTMLCanvasElement | null>(null);
const glRef = useRef<WebGLRenderingContext | null>(null);
diff --git a/packages/lab/src/Chart/XDSChartTooltip.tsx b/packages/lab/src/Chart/ChartTooltip.tsx
similarity index 96%
rename from packages/lab/src/Chart/XDSChartTooltip.tsx
rename to packages/lab/src/Chart/ChartTooltip.tsx
index 3c98d66119..a0ae29b76c 100644
--- a/packages/lab/src/Chart/XDSChartTooltip.tsx
+++ b/packages/lab/src/Chart/ChartTooltip.tsx
@@ -1,9 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSChartTooltip.tsx
+ * @file ChartTooltip.tsx
* @output Hover tooltip with optional crosshair lines, rendered in the top layer
- * @position Child of XDSChart; reads scales from context
+ * @position Child of Chart; reads scales from context
*
* Combines tooltip content and crosshair display into one component.
* Uses the XDS Layer system (Popover API) so the tooltip renders above
@@ -14,7 +14,7 @@
import {useState, useCallback, useRef, type ReactNode} from 'react';
import {createPortal} from 'react-dom';
-import {useXDSLayer} from '@xds/core/Layer';
+import {useLayer} from '@xds/core/Layer';
import {useChart} from './ChartContext';
import {xPixel} from './utils';
import type {DataPoint} from './types';
@@ -28,7 +28,7 @@ import type {DataPoint} from './types';
*/
export type ChartCrosshairMode = 'x' | 'y' | 'xy' | false;
-export interface XDSChartTooltipProps {
+export interface ChartTooltipProps {
/**
* Custom render function for tooltip content.
* Receives the nearest data point and its index.
@@ -98,19 +98,19 @@ export interface XDSChartTooltipProps {
* @example
* ```tsx
* // Default: vertical crosshair + tooltip card
- * <XDSChartTooltip />
+ * <ChartTooltip />
*
* // Both axes, with labels
- * <XDSChartTooltip crosshair="xy" crosshairLabels />
+ * <ChartTooltip crosshair="xy" crosshairLabels />
*
* // Tooltip only, no crosshair lines
- * <XDSChartTooltip crosshair={false} />
+ * <ChartTooltip crosshair={false} />
*
* // Custom render
- * <XDSChartTooltip render={(d) => <span>{d.month}: ${d.revenue}</span>} />
+ * <ChartTooltip render={(d) => <span>{d.month}: ${d.revenue}</span>} />
* ```
*/
-export function XDSChartTooltip({
+export function ChartTooltip({
render,
crosshair = 'x',
crosshairLabels = false,
@@ -119,7 +119,7 @@ export function XDSChartTooltip({
yFormat,
crosshairColor = 'var(--color-border-emphasized)',
dot = true,
-}: XDSChartTooltipProps) {
+}: ChartTooltipProps) {
const {data, xKey, xScale, yScale, width, height, svgRef, pointerToData} =
useChart();
@@ -133,7 +133,7 @@ export function XDSChartTooltip({
const layerContainerRef = useRef<HTMLElement | null>(null);
const active = useRef(false);
- const layer = useXDSLayer({mode: 'fixed'});
+ const layer = useLayer({mode: 'fixed'});
// Find nearest data point. Uses Euclidean distance for scatter (linear x)
// and x-only distance for categorical/time series (band x).
diff --git a/packages/lab/src/Chart/XDSChartZoom.tsx b/packages/lab/src/Chart/ChartZoom.tsx
similarity index 97%
rename from packages/lab/src/Chart/XDSChartZoom.tsx
rename to packages/lab/src/Chart/ChartZoom.tsx
index 62cee04d84..162ee3b85c 100644
--- a/packages/lab/src/Chart/XDSChartZoom.tsx
+++ b/packages/lab/src/Chart/ChartZoom.tsx
@@ -1,9 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSChartZoom.tsx
+ * @file ChartZoom.tsx
* @output Scroll/pinch zoom + drag pan with optional toolbar.
- * @position Child of XDSChart; modifies x/yDomain via callbacks
+ * @position Child of Chart; modifies x/yDomain via callbacks
*
* Zoom is aspect-ratio-normalized: both axes scale by the same visual
* factor regardless of their domain ranges. Reset button restores
@@ -12,7 +12,7 @@
import {type CSSProperties, useCallback, useRef, useEffect} from 'react';
import {createPortal} from 'react-dom';
-import {XDSIconButton} from '@xds/core/IconButton';
+import {IconButton} from '@xds/core/IconButton';
import {useChart} from './ChartContext';
import {isBandScale} from './utils';
import type {ScaleLinear} from 'd3-scale';
@@ -24,7 +24,7 @@ export type ZoomToolbarPosition =
| 'bottom-right'
| 'bottom-left';
-export interface XDSChartZoomProps {
+export interface ChartZoomProps {
onXDomainChange?: (domain: [number, number]) => void;
onYDomainChange?: (domain: [number, number]) => void;
@@ -94,14 +94,14 @@ function ResetIcon() {
);
}
-export function XDSChartZoom({
+export function ChartZoom({
onXDomainChange,
onYDomainChange,
zoomSpeed = 0.1,
xOnly = false,
yOnly = false,
toolbar = 'top-right',
-}: XDSChartZoomProps) {
+}: ChartZoomProps) {
const {width, height, xScale, yScale, svgRef} = useChart();
// Capture initial domains on mount for reset
@@ -371,21 +371,21 @@ export function XDSChartZoom({
portalTarget &&
createPortal(
<div style={toolbarPositionStyle(toolbar)}>
- <XDSIconButton
+ <IconButton
label="Zoom in"
icon={<ZoomInIcon />}
variant="ghost"
size="sm"
onClick={() => zoomBy(1 / (1 + zoomSpeed))}
/>
- <XDSIconButton
+ <IconButton
label="Zoom out"
icon={<ZoomOutIcon />}
variant="ghost"
size="sm"
onClick={() => zoomBy(1 + zoomSpeed)}
/>
- <XDSIconButton
+ <IconButton
label="Reset zoom"
icon={<ResetIcon />}
variant="ghost"
diff --git a/packages/lab/src/Chart/formatters.ts b/packages/lab/src/Chart/formatters.ts
index 0d3820b7cc..561463c532 100644
--- a/packages/lab/src/Chart/formatters.ts
+++ b/packages/lab/src/Chart/formatters.ts
@@ -3,7 +3,7 @@
/**
* @file formatters.ts
* @output Built-in tick format utilities for common data types
- * @position Utility; consumed by XDSChartAxis via tickFormat prop
+ * @position Utility; consumed by ChartAxis via tickFormat prop
*/
/**
@@ -31,9 +31,9 @@ export function compactNumber(value: unknown): string {
*
* @example
* ```
- * <XDSChartAxis tickFormat={currency()} /> // $1.5K
- * <XDSChartAxis tickFormat={currency('€')} /> // €1.5K
- * <XDSChartAxis tickFormat={currency('¥')} /> // ¥1.5K
+ * <ChartAxis tickFormat={currency()} /> // $1.5K
+ * <ChartAxis tickFormat={currency('€')} /> // €1.5K
+ * <ChartAxis tickFormat={currency('¥')} /> // ¥1.5K
* ```
*/
export function currency(symbol = '$'): (value: unknown) => string {
diff --git a/packages/lab/src/Chart/getXDSChartColors.ts b/packages/lab/src/Chart/getChartColors.ts
similarity index 90%
rename from packages/lab/src/Chart/getXDSChartColors.ts
rename to packages/lab/src/Chart/getChartColors.ts
index 6ee0e2c7ac..99abf34f81 100644
--- a/packages/lab/src/Chart/getXDSChartColors.ts
+++ b/packages/lab/src/Chart/getChartColors.ts
@@ -1,15 +1,15 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file getXDSChartColors.ts
+ * @file getChartColors.ts
* @output Pure function to resolve chart colors from a theme — no React required
- * @position Foundation utility; consumed by useXDSChartColors and non-React contexts
+ * @position Foundation utility; consumed by useChartColors and non-React contexts
*
* Takes a token resolver function (or a defined theme + mode) and returns
- * the full chart colors API. The useXDSChartColors hook wraps this.
+ * the full chart colors API. The useChartColors hook wraps this.
*/
-import type {XDSDefinedTheme} from '@xds/core/theme';
+import type {DefinedTheme} from '@xds/core/theme';
// =============================================================================
// Types
@@ -27,8 +27,8 @@ export type SequentialHue =
| 'yellow'
| 'gray';
-/** The chart colors API returned by both getXDSChartColors and useXDSChartColors */
-export interface XDSChartColorsAPI {
+/** The chart colors API returned by both getChartColors and useChartColors */
+export interface ChartColorsAPI {
categorical(n: number): string[];
sequential: Record<SequentialHue, (n: number) => string[]>;
diverging: {
@@ -126,9 +126,9 @@ function hexAlpha(hex: string, opacity: number): string {
* Build chart colors from a token resolver function.
* This is the lowest-level API — pass any function that maps token names to values.
*/
-export function getXDSChartColorsFromResolver(
+export function getChartColorsFromResolver(
resolve: TokenResolver,
-): XDSChartColorsAPI {
+): ChartColorsAPI {
const categorical = CATEGORICAL_TOKENS.map(t => resolve(t));
const ramp = (hue: SequentialHue): string[] =>
@@ -217,14 +217,14 @@ export function getXDSChartColorsFromResolver(
* @example
* ```
* import { defaultTheme } from '@xds/theme-default';
- * const colors = getXDSChartColors(defaultTheme, 'light');
+ * const colors = getChartColors(defaultTheme, 'light');
* colors.categorical(5)
* ```
*/
-export function getXDSChartColors(
- theme: XDSDefinedTheme,
+export function getChartColors(
+ theme: DefinedTheme,
mode: 'light' | 'dark' = 'light',
-): XDSChartColorsAPI {
+): ChartColorsAPI {
// Build a resolver from the theme's token map
const resolve: TokenResolver = (name: string) => {
// Check theme token overrides first, then fall back to defaults
@@ -245,5 +245,5 @@ export function getXDSChartColors(
return raw;
};
- return getXDSChartColorsFromResolver(resolve);
+ return getChartColorsFromResolver(resolve);
}
diff --git a/packages/lab/src/Chart/index.ts b/packages/lab/src/Chart/index.ts
index 3deacba629..02f4827eba 100644
--- a/packages/lab/src/Chart/index.ts
+++ b/packages/lab/src/Chart/index.ts
@@ -1,7 +1,7 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
-export {XDSChart, type XDSChartProps, type YBaseline} from './XDSChart';
-export {XDSChartAxis, type XDSChartAxisProps} from './XDSChartAxis';
+export {Chart, type ChartProps, type YBaseline} from './Chart';
+export {ChartAxis, type ChartAxisProps} from './ChartAxis';
export {
compactNumber,
currency,
@@ -9,57 +9,57 @@ export {
shortDate,
monthYear,
} from './formatters';
-export {XDSChartGrid, type XDSChartGridProps} from './XDSChartGrid';
-export {XDSChartBar, type XDSChartBarProps} from './XDSChartBar';
-export {XDSChartLine, type XDSChartLineProps} from './XDSChartLine';
-export {XDSChartArea, type XDSChartAreaProps} from './XDSChartArea';
-export {XDSChartErrorBar, type XDSChartErrorBarProps} from './XDSChartErrorBar';
+export {ChartGrid, type ChartGridProps} from './ChartGrid';
+export {ChartBar, type ChartBarProps} from './ChartBar';
+export {ChartLine, type ChartLineProps} from './ChartLine';
+export {ChartArea, type ChartAreaProps} from './ChartArea';
+export {ChartErrorBar, type ChartErrorBarProps} from './ChartErrorBar';
export {
- XDSChartCandlestick,
- type XDSChartCandlestickProps,
-} from './XDSChartCandlestick';
-export {XDSChartDot, type XDSChartDotProps} from './XDSChartDot';
-export {XDSChartDotGL, type XDSChartDotGLProps} from './XDSChartDotGL';
+ ChartCandlestick,
+ type ChartCandlestickProps,
+} from './ChartCandlestick';
+export {ChartDot, type ChartDotProps} from './ChartDot';
+export {ChartDotGL, type ChartDotGLProps} from './ChartDotGL';
export {
- XDSChartDotGLInteractive,
- type XDSChartDotGLInteractiveProps,
-} from './XDSChartDotGLInteractive';
+ ChartDotGLInteractive,
+ type ChartDotGLInteractiveProps,
+} from './ChartDotGLInteractive';
export {
- XDSChartHeatmapGL,
- type XDSChartHeatmapGLProps,
-} from './XDSChartHeatmapGL';
+ ChartHeatmapGL,
+ type ChartHeatmapGLProps,
+} from './ChartHeatmapGL';
export {
- XDSChartStreamGL,
- type XDSChartStreamGLProps,
- type XDSChartStreamGLHandle,
-} from './XDSChartStreamGL';
+ ChartStreamGL,
+ type ChartStreamGLProps,
+ type ChartStreamGLHandle,
+} from './ChartStreamGL';
export {
- XDSChartTooltip,
- type XDSChartTooltipProps,
+ ChartTooltip,
+ type ChartTooltipProps,
type ChartCrosshairMode,
-} from './XDSChartTooltip';
+} from './ChartTooltip';
export {
- XDSChartLegend,
- type XDSChartLegendProps,
- type XDSChartLegendItem,
-} from './XDSChartLegend';
+ ChartLegend,
+ type ChartLegendProps,
+ type ChartLegendItem,
+} from './ChartLegend';
export {useChart} from './ChartContext';
export type {ChartContext, ChartMargin, ChartScale, DataPoint} from './types';
export {m4Reduce, type M4Point} from './m4';
export {isBandScale, xPixel} from './utils';
-export {useXDSChartColors} from './useXDSChartColors';
+export {useChartColors} from './useChartColors';
export {
- getXDSChartColors,
- getXDSChartColorsFromResolver,
- type XDSChartColorsAPI,
+ getChartColors,
+ getChartColorsFromResolver,
+ type ChartColorsAPI,
type SequentialHue,
type TokenResolver,
-} from './getXDSChartColors';
+} from './getChartColors';
export {
- useXDSChartRange,
- type UseXDSChartRangeOptions,
- type UseXDSChartRangeReturn,
-} from './useXDSChartRange';
+ useChartRange,
+ type UseChartRangeOptions,
+ type UseChartRangeReturn,
+} from './useChartRange';
export {
hexToGL,
getCanvasDPR,
@@ -73,18 +73,18 @@ export {
POINT_SIZE_COMPENSATION,
} from './webgl';
export {
- XDSChartBrush,
- type XDSChartBrushProps,
+ ChartBrush,
+ type ChartBrushProps,
type BrushMode,
type BrushRange,
-} from './XDSChartBrush';
+} from './ChartBrush';
export {
- XDSChartZoom,
- type XDSChartZoomProps,
+ ChartZoom,
+ type ChartZoomProps,
type ZoomToolbarPosition,
-} from './XDSChartZoom';
-export {XDSChartSelect, type XDSChartSelectProps} from './XDSChartSelect';
+} from './ChartZoom';
+export {ChartSelect, type ChartSelectProps} from './ChartSelect';
export {
- XDSChartReferenceLine,
- type XDSChartReferenceLineProps,
-} from './XDSChartReferenceLine';
+ ChartReferenceLine,
+ type ChartReferenceLineProps,
+} from './ChartReferenceLine';
diff --git a/packages/lab/src/Chart/types.ts b/packages/lab/src/Chart/types.ts
index ad50340e8d..547e81f6ee 100644
--- a/packages/lab/src/Chart/types.ts
+++ b/packages/lab/src/Chart/types.ts
@@ -34,7 +34,7 @@ export interface DataPoint {
py: number;
}
-/** Scale context provided by XDSChart to children */
+/** Scale context provided by Chart to children */
export interface ChartContext {
/** Inner width (SVG width minus margins) */
width: number;
diff --git a/packages/lab/src/Chart/useChartColors.ts b/packages/lab/src/Chart/useChartColors.ts
new file mode 100644
index 0000000000..e3422a58dd
--- /dev/null
+++ b/packages/lab/src/Chart/useChartColors.ts
@@ -0,0 +1,34 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+
+/**
+ * @file useChartColors.ts
+ * @output Theme-aware chart color palette hook
+ * @position React hook wrapping getChartColors — resolves from live theme context
+ */
+
+import {useMemo} from 'react';
+import {useTheme} from '@xds/core/theme';
+import {getChartColorsFromResolver} from './getChartColors';
+import type {ChartColorsAPI} from './getChartColors';
+
+/**
+ * Theme-aware chart colors. Resolves data-viz tokens from the current
+ * theme context — respects light/dark mode and custom themes.
+ *
+ * @example
+ * ```
+ * const colors = useChartColors();
+ * colors.categorical(5)
+ * colors.sequential.blue(3)
+ * colors.diverging.positiveNegative(5)
+ * colors.alpha('#0171E3', 0.5)
+ * ```
+ */
+export function useChartColors(): ChartColorsAPI {
+ const {token} = useTheme();
+
+ return useMemo(
+ () => getChartColorsFromResolver(name => token(name) || ''),
+ [token],
+ );
+}
diff --git a/packages/lab/src/Chart/useXDSChartRange.test.ts b/packages/lab/src/Chart/useChartRange.test.ts
similarity index 80%
rename from packages/lab/src/Chart/useXDSChartRange.test.ts
rename to packages/lab/src/Chart/useChartRange.test.ts
index 3855806391..0a68a77e03 100644
--- a/packages/lab/src/Chart/useXDSChartRange.test.ts
+++ b/packages/lab/src/Chart/useChartRange.test.ts
@@ -2,24 +2,24 @@
import {describe, it, expect} from 'vitest';
import {renderHook, act} from '@testing-library/react';
-import {useXDSChartRange} from './useXDSChartRange';
+import {useChartRange} from './useChartRange';
-describe('useXDSChartRange', () => {
+describe('useChartRange', () => {
it('initializes with zero domain', () => {
- const {result} = renderHook(() => useXDSChartRange({xWindow: 300}));
+ const {result} = renderHook(() => useChartRange({xWindow: 300}));
expect(result.current.xDomain).toEqual([0, 0]);
expect(result.current.yDomain).toEqual([0, 1]);
});
it('uses fixed yDomain when provided', () => {
const {result} = renderHook(() =>
- useXDSChartRange({xWindow: 300, yDomain: [0, 100]}),
+ useChartRange({xWindow: 300, yDomain: [0, 100]}),
);
expect(result.current.yDomain).toEqual([0, 100]);
});
it('grows xDomain during warmup then slides', () => {
- const {result} = renderHook(() => useXDSChartRange({xWindow: 100}));
+ const {result} = renderHook(() => useChartRange({xWindow: 100}));
// During warmup: [0, x]
act(() => {
@@ -42,7 +42,7 @@ describe('useXDSChartRange', () => {
it('auto-tracks y range with padding', () => {
const {result} = renderHook(() =>
- useXDSChartRange({xWindow: 100, yPadding: 0.1}),
+ useChartRange({xWindow: 100, yPadding: 0.1}),
);
act(() => {
@@ -62,7 +62,7 @@ describe('useXDSChartRange', () => {
it('does not auto-track y when fixed yDomain is set', () => {
const {result} = renderHook(() =>
- useXDSChartRange({xWindow: 100, yDomain: [0, 100]}),
+ useChartRange({xWindow: 100, yDomain: [0, 100]}),
);
act(() => {
@@ -73,7 +73,7 @@ describe('useXDSChartRange', () => {
it('centers y around zero when yCenter is true', () => {
const {result} = renderHook(() =>
- useXDSChartRange({xWindow: 100, yCenter: true, yPadding: 0}),
+ useChartRange({xWindow: 100, yCenter: true, yPadding: 0}),
);
act(() => {
@@ -85,7 +85,7 @@ describe('useXDSChartRange', () => {
});
it('resets state', () => {
- const {result} = renderHook(() => useXDSChartRange({xWindow: 200}));
+ const {result} = renderHook(() => useChartRange({xWindow: 200}));
act(() => {
result.current.push(500, 99);
diff --git a/packages/lab/src/Chart/useXDSChartRange.ts b/packages/lab/src/Chart/useChartRange.ts
similarity index 79%
rename from packages/lab/src/Chart/useXDSChartRange.ts
rename to packages/lab/src/Chart/useChartRange.ts
index f6dd890540..1d7fe955c3 100644
--- a/packages/lab/src/Chart/useXDSChartRange.ts
+++ b/packages/lab/src/Chart/useChartRange.ts
@@ -1,9 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file useXDSChartRange.ts
- * @output Hook that tracks streaming data ranges and provides domains for XDSChart
- * @position Helper hook; sits between the data source and XDSChart props
+ * @file useChartRange.ts
+ * @output Hook that tracks streaming data ranges and provides domains for Chart
+ * @position Helper hook; sits between the data source and Chart props
*
* Manages xDomain/yDomain as state. Domain updates are synchronous with
* every push — no throttling. The chart's declared domain must always
@@ -11,9 +11,9 @@
*/
import {useState, useRef, useCallback} from 'react';
-import type {XDSChartStreamGLHandle} from './XDSChartStreamGL';
+import type {ChartStreamGLHandle} from './ChartStreamGL';
-export interface UseXDSChartRangeOptions {
+export interface UseChartRangeOptions {
/** Sliding window size for x-axis (number of ticks visible). Required. */
xWindow: number;
/**
@@ -33,10 +33,10 @@ export interface UseXDSChartRangeOptions {
yCenter?: boolean;
}
-export interface UseXDSChartRangeReturn {
- /** Current x-axis domain — pass to XDSChart xDomain prop */
+export interface UseChartRangeReturn {
+ /** Current x-axis domain — pass to Chart xDomain prop */
xDomain: [number, number];
- /** Current y-axis domain — pass to XDSChart yDomain prop */
+ /** Current y-axis domain — pass to Chart yDomain prop */
yDomain: [number, number];
/**
* Push a data point. Updates domains synchronously, then optionally
@@ -45,33 +45,33 @@ export interface UseXDSChartRangeReturn {
push(
x: number,
y: number,
- streamRef?: React.RefObject<XDSChartStreamGLHandle | null>,
+ streamRef?: React.RefObject<ChartStreamGLHandle | null>,
): void;
/** Reset all tracking state */
reset(): void;
}
/**
- * Tracks streaming data ranges and provides xDomain/yDomain for XDSChart.
+ * Tracks streaming data ranges and provides xDomain/yDomain for Chart.
*
* Domain updates are synchronous with every push — no throttling, no lag.
* This ensures the chart's declared domain always matches the rendered data.
*
* @example
* ```
- * const {xDomain, yDomain, push} = useXDSChartRange({xWindow: 300, yPadding: 0.1});
+ * const {xDomain, yDomain, push} = useChartRange({xWindow: 300, yPadding: 0.1});
*
- * <XDSChart xDomain={xDomain} yDomain={yDomain} ...>
- * <XDSChartStreamGL handleRef={streamRef} ... />
- * </XDSChart>
+ * <Chart xDomain={xDomain} yDomain={yDomain} ...>
+ * <ChartStreamGL handleRef={streamRef} ... />
+ * </Chart>
* ```
*/
-export function useXDSChartRange({
+export function useChartRange({
xWindow,
yDomain: fixedYDomain,
yPadding = 0.1,
yCenter = false,
-}: UseXDSChartRangeOptions): UseXDSChartRangeReturn {
+}: UseChartRangeOptions): UseChartRangeReturn {
const [xDomain, setXDomain] = useState<[number, number]>([0, 0]);
const [yDomain, setYDomain] = useState<[number, number]>(
fixedYDomain ?? [0, 1],
@@ -86,7 +86,7 @@ export function useXDSChartRange({
(
x: number,
y: number,
- streamRef?: React.RefObject<XDSChartStreamGLHandle | null>,
+ streamRef?: React.RefObject<ChartStreamGLHandle | null>,
) => {
// Forward to stream
streamRef?.current?.push(x, y);
diff --git a/packages/lab/src/Chart/useXDSChartColors.ts b/packages/lab/src/Chart/useXDSChartColors.ts
deleted file mode 100644
index d1dfc04a3f..0000000000
--- a/packages/lab/src/Chart/useXDSChartColors.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (c) Meta Platforms, Inc. and affiliates.
-
-/**
- * @file useXDSChartColors.ts
- * @output Theme-aware chart color palette hook
- * @position React hook wrapping getXDSChartColors — resolves from live theme context
- */
-
-import {useMemo} from 'react';
-import {useXDSTheme} from '@xds/core/theme';
-import {getXDSChartColorsFromResolver} from './getXDSChartColors';
-import type {XDSChartColorsAPI} from './getXDSChartColors';
-
-/**
- * Theme-aware chart colors. Resolves data-viz tokens from the current
- * theme context — respects light/dark mode and custom themes.
- *
- * @example
- * ```
- * const colors = useXDSChartColors();
- * colors.categorical(5)
- * colors.sequential.blue(3)
- * colors.diverging.positiveNegative(5)
- * colors.alpha('#0171E3', 0.5)
- * ```
- */
-export function useXDSChartColors(): XDSChartColorsAPI {
- const {token} = useXDSTheme();
-
- return useMemo(
- () => getXDSChartColorsFromResolver(name => token(name) || ''),
- [token],
- );
-}
diff --git a/packages/lab/src/ChartV2/XDSChart.tsx b/packages/lab/src/ChartV2/Chart.tsx
similarity index 91%
rename from packages/lab/src/ChartV2/XDSChart.tsx
rename to packages/lab/src/ChartV2/Chart.tsx
index 736da54cae..952a0ea418 100644
--- a/packages/lab/src/ChartV2/XDSChart.tsx
+++ b/packages/lab/src/ChartV2/Chart.tsx
@@ -1,7 +1,7 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSChart.tsx (v2)
+ * @file Chart.tsx (v2)
* @output Root chart — coordinates layout, rendering, and events
* @position Top-level; delegates everything to series configs and interaction slots
*
@@ -25,14 +25,14 @@ import type {ChartV2Context, ChartMargin, ChartPointerEvent} from './types';
import {computeLayout} from './layout';
import {ChartV2Provider} from './ChartV2Context';
import {ChartProvider} from '../Chart/ChartContext';
-import {XDSText} from '@xds/core';
-import {XDSVStack, XDSHStack} from '@xds/core';
+import {Text} from '@xds/core';
+import {VStack, HStack} from '@xds/core';
import * as stylex from '@stylexjs/stylex';
-import {XDSChartLegend, type XDSChartLegendProps} from './XDSChartLegend';
+import {ChartLegend, type ChartLegendProps} from './ChartLegend';
import {deriveLegendItems} from './legend';
-import {XDSChartTooltip, type XDSChartTooltipProps} from './XDSChartTooltip';
+import {ChartTooltip, type ChartTooltipProps} from './ChartTooltip';
-export interface XDSChartProps {
+export interface ChartProps {
data: Record<string, unknown>[];
xKey: string;
series: SeriesDef[];
@@ -40,8 +40,8 @@ export interface XDSChartProps {
margin?: Partial<ChartMargin>;
grid?: ReactNode;
axes?: ReactNode;
- legend?: boolean | XDSChartLegendProps;
- tooltip?: boolean | Omit<XDSChartTooltipProps, 'series'>;
+ legend?: boolean | ChartLegendProps;
+ tooltip?: boolean | Omit<ChartTooltipProps, 'series'>;
interactions?: ReactNode;
children?: ReactNode;
title?: string;
@@ -64,7 +64,7 @@ const styles = stylex.create({
},
});
-export function XDSChart({
+export function Chart({
data,
xKey,
series,
@@ -78,7 +78,7 @@ export function XDSChart({
children,
title,
subtitle,
-}: XDSChartProps) {
+}: ChartProps) {
const chartId = useId();
const descId = `${chartId}-desc`;
const containerRef = useRef<HTMLDivElement>(null);
@@ -201,7 +201,7 @@ export function XDSChart({
[innerWidth, innerHeight, margin, data, xKey, layout, onPointer],
);
- // Bridge v1 context for XDSChartGrid/Axis compatibility
+ // Bridge v1 context for ChartGrid/Axis compatibility
const v1Ctx = useMemo(
() => ({
width: innerWidth,
@@ -232,7 +232,7 @@ export function XDSChart({
const legendConfig = legend === true ? {} : legend || null;
const legendElement = legendConfig ? (
- <XDSChartLegend
+ <ChartLegend
items={legendConfig.items ?? deriveLegendItems(series)}
position={legendConfig.position}
alignment={legendConfig.alignment}
@@ -259,14 +259,14 @@ export function XDSChart({
{(title || subtitle) && (
<div {...stylex.props(styles.title)}>
{title && (
- <XDSText type="body" weight="semibold" display="block">
+ <Text type="body" weight="semibold" display="block">
{title}
- </XDSText>
+ </Text>
)}
{subtitle && (
- <XDSText type="supporting" display="block">
+ <Text type="supporting" display="block">
{subtitle}
- </XDSText>
+ </Text>
)}
</div>
)}
@@ -275,17 +275,17 @@ export function XDSChart({
{legendConfig == null ? (
renderSvg()
) : isLegendHorizontal ? (
- <XDSHStack gap={4}>
+ <HStack gap={4}>
{legendPosition === 'start' && legendElement}
<div {...stylex.props(styles.chartArea)}>{renderSvg()}</div>
{legendPosition === 'end' && legendElement}
- </XDSHStack>
+ </HStack>
) : (
- <XDSVStack gap={4}>
+ <VStack gap={4}>
{legendPosition === 'top' && legendElement}
{renderSvg()}
{legendPosition === 'bottom' && legendElement}
- </XDSVStack>
+ </VStack>
)}
</ChartProvider>
</ChartV2Provider>
@@ -331,9 +331,9 @@ export function XDSChart({
{interactions}
{/* 5. Tooltip — declarative shortcut. For full control, render
- <XDSChartTooltip> directly via the `children` slot. */}
+ <ChartTooltip> directly via the `children` slot. */}
{tooltip && (
- <XDSChartTooltip
+ <ChartTooltip
series={series}
{...(tooltip === true ? {} : tooltip)}
/>
diff --git a/packages/lab/src/ChartV2/XDSChartAxis.tsx b/packages/lab/src/ChartV2/ChartAxis.tsx
similarity index 90%
rename from packages/lab/src/ChartV2/XDSChartAxis.tsx
rename to packages/lab/src/ChartV2/ChartAxis.tsx
index 89cb72d738..a958da044a 100644
--- a/packages/lab/src/ChartV2/XDSChartAxis.tsx
+++ b/packages/lab/src/ChartV2/ChartAxis.tsx
@@ -1,13 +1,13 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSChartAxis.tsx (v2)
+ * @file ChartAxis.tsx (v2)
* @output Renders an axis (top, right, bottom, left) using the chart's scales
- * @position Child of XDSChart v2; reads scales from chart context
+ * @position Child of Chart v2; reads scales from chart context
*
* The axis edge line and tick marks are independently toggleable so callers
* can compose: line-only, line + ticks, or line + ticks + grid (paired with
- * `<XDSChartGrid>`). To stay consistent with most charts, the bottom axis
+ * `<ChartGrid>`). To stay consistent with most charts, the bottom axis
* draws its edge line by default and other positions don't.
*
* Ticks use CSS transitions for smooth sliding during streaming updates.
@@ -20,7 +20,7 @@ import {useChart} from '../Chart/ChartContext';
import {isBandScale} from '../Chart/utils';
import type {ScaleLinear, ScaleTime} from 'd3-scale';
-export interface XDSChartAxisProps {
+export interface ChartAxisProps {
/** Which edge to render the axis on */
position: 'top' | 'right' | 'bottom' | 'left';
/** Number of ticks (approximate — d3 decides final count) */
@@ -36,7 +36,7 @@ export interface XDSChartAxisProps {
/**
* Show the axis edge line. Defaults to `true` for `position="bottom"`,
* `false` otherwise. Forced to `true` when `showTicks` is enabled.
- * Pair with `<XDSChartGrid vertical />` and pass `showAxisLine` on the
+ * Pair with `<ChartGrid vertical />` and pass `showAxisLine` on the
* corresponding side axis to keep the visual edge grounded.
*/
showAxisLine?: boolean;
@@ -59,16 +59,16 @@ const TICK_SIZE = 6;
/**
* Chart axis. Always draws tick labels; the axis edge line and tick marks
- * are independently toggleable. Pair with `<XDSChartGrid>` for grid lines.
+ * are independently toggleable. Pair with `<ChartGrid>` for grid lines.
*
* @example
* ```
- * <XDSChartAxis position="bottom" /> // edge line + labels
- * <XDSChartAxis position="left" /> // labels only (no edge line)
- * <XDSChartAxis position="left" showAxisLine showTicks />
+ * <ChartAxis position="bottom" /> // edge line + labels
+ * <ChartAxis position="left" /> // labels only (no edge line)
+ * <ChartAxis position="left" showAxisLine showTicks />
* ```
*/
-export function XDSChartAxis({
+export function ChartAxis({
position,
tickCount = 5,
maxTicks,
@@ -77,7 +77,7 @@ export function XDSChartAxis({
animated = true,
showAxisLine = position === 'bottom',
showTicks = false,
-}: XDSChartAxisProps) {
+}: ChartAxisProps) {
// Tick marks need an axis line to anchor against; force it on when ticks
// are enabled so the two visuals stay coherent.
const renderAxisLine = showAxisLine || showTicks;
diff --git a/packages/lab/src/ChartV2/XDSChartGrid.tsx b/packages/lab/src/ChartV2/ChartGrid.tsx
similarity index 84%
rename from packages/lab/src/ChartV2/XDSChartGrid.tsx
rename to packages/lab/src/ChartV2/ChartGrid.tsx
index e6d22314fa..a2833892a2 100644
--- a/packages/lab/src/ChartV2/XDSChartGrid.tsx
+++ b/packages/lab/src/ChartV2/ChartGrid.tsx
@@ -1,9 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSChartGrid.tsx (v2)
+ * @file ChartGrid.tsx (v2)
* @output Grid lines behind chart marks
- * @position Child of XDSChart v2; reads scales from chart context
+ * @position Child of Chart v2; reads scales from chart context
*/
import {useMemo} from 'react';
@@ -13,7 +13,7 @@ import {useChart} from '../Chart/ChartContext';
import {isBandScale} from '../Chart/utils';
import type {ScaleLinear, ScaleTime} from 'd3-scale';
-export interface XDSChartGridProps {
+export interface ChartGridProps {
/** Show horizontal grid lines. Default: `true`. */
horizontal?: boolean;
/** Show vertical grid lines. Default: `false`. */
@@ -30,19 +30,19 @@ const styles = stylex.create({
/**
* Grid lines behind chart marks.
*
- * Pair with `<XDSChartAxis>` so users always see an axis line beside the
+ * Pair with `<ChartAxis>` so users always see an axis line beside the
* grid — the components are designed to be used together.
*
* @example
* ```
- * <XDSChartGrid /> // horizontal grid lines (default)
- * <XDSChartGrid horizontal vertical />
+ * <ChartGrid /> // horizontal grid lines (default)
+ * <ChartGrid horizontal vertical />
* ```
*/
-export function XDSChartGrid({
+export function ChartGrid({
horizontal = true,
vertical = false,
-}: XDSChartGridProps) {
+}: ChartGridProps) {
const {width, height, xScale, yScale} = useChart();
// Skip the y=0 line when emphasizing it via the axis. Without this we'd
diff --git a/packages/lab/src/ChartV2/XDSChartLegend.tsx b/packages/lab/src/ChartV2/ChartLegend.tsx
similarity index 55%
rename from packages/lab/src/ChartV2/XDSChartLegend.tsx
rename to packages/lab/src/ChartV2/ChartLegend.tsx
index 7028585cac..99c40d98cf 100644
--- a/packages/lab/src/ChartV2/XDSChartLegend.tsx
+++ b/packages/lab/src/ChartV2/ChartLegend.tsx
@@ -1,21 +1,21 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSChartLegend.tsx
+ * @file ChartLegend.tsx
* @output Standalone chart legend component
- * @position Can be used inside XDSChart via the `legend` prop, or independently
+ * @position Can be used inside Chart via the `legend` prop, or independently
*
* @example
- * // Via XDSChart
- * <XDSChart legend={{position: 'top', alignment: 'start'}} ... />
+ * // Via Chart
+ * <Chart legend={{position: 'top', alignment: 'start'}} ... />
*
* // Standalone
- * <XDSChartLegend items={[{label: 'Revenue', color: '#3b82f6'}]} />
+ * <ChartLegend items={[{label: 'Revenue', color: '#3b82f6'}]} />
*/
-import {XDSText} from '@xds/core';
-import {XDSVStack, XDSHStack} from '@xds/core';
-import {XDSChartSwatch, swatchVariantForType} from './XDSChartSwatch';
+import {Text} from '@xds/core';
+import {VStack, HStack} from '@xds/core';
+import {ChartSwatch, swatchVariantForType} from './ChartSwatch';
import type {LegendItem} from './legend';
export type {LegendItem};
@@ -23,7 +23,7 @@ export type {LegendItem};
export type LegendPosition = 'top' | 'bottom' | 'start' | 'end';
export type LegendAlignment = 'start' | 'center' | 'end';
-export interface XDSChartLegendProps {
+export interface ChartLegendProps {
/** Legend items to display */
items?: LegendItem[];
/** Position of the legend relative to the chart. Default: 'bottom' */
@@ -32,11 +32,11 @@ export interface XDSChartLegendProps {
alignment?: LegendAlignment;
}
-export function XDSChartLegend({
+export function ChartLegend({
items = [],
position = 'bottom',
alignment = 'start',
-}: XDSChartLegendProps) {
+}: ChartLegendProps) {
if (items.length === 0) {
return null;
}
@@ -44,26 +44,26 @@ export function XDSChartLegend({
const isVertical = position === 'start' || position === 'end';
const legendItems = items.map(item => (
- <XDSHStack key={item.label} gap={2} vAlign="center">
- <XDSChartSwatch
+ <HStack key={item.label} gap={2} vAlign="center">
+ <ChartSwatch
color={item.color}
variant={swatchVariantForType(item.type)}
/>
- <XDSText type="supporting">{item.label}</XDSText>
- </XDSHStack>
+ <Text type="supporting">{item.label}</Text>
+ </HStack>
));
if (isVertical) {
return (
- <XDSVStack gap={2} hAlign={alignment}>
+ <VStack gap={2} hAlign={alignment}>
{legendItems}
- </XDSVStack>
+ </VStack>
);
}
return (
- <XDSHStack gap={4} justify={alignment} vAlign="center" wrap="wrap">
+ <HStack gap={4} justify={alignment} vAlign="center" wrap="wrap">
{legendItems}
- </XDSHStack>
+ </HStack>
);
}
diff --git a/packages/lab/src/ChartV2/XDSChartSwatch.tsx b/packages/lab/src/ChartV2/ChartSwatch.tsx
similarity index 71%
rename from packages/lab/src/ChartV2/XDSChartSwatch.tsx
rename to packages/lab/src/ChartV2/ChartSwatch.tsx
index 06b36f2465..01eed41d72 100644
--- a/packages/lab/src/ChartV2/XDSChartSwatch.tsx
+++ b/packages/lab/src/ChartV2/ChartSwatch.tsx
@@ -1,16 +1,16 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSChartSwatch.tsx
+ * @file ChartSwatch.tsx
* @output Color swatch primitive for legends, tooltips, and standalone use
- * @position Composable primitive — used by XDSChartLegend (and future
- * XDSChartTooltip), or independently anywhere a series indicator
+ * @position Composable primitive — used by ChartLegend (and future
+ * ChartTooltip), or independently anywhere a series indicator
* is needed.
*
* @example
* ```
- * <XDSChartSwatch color="#3b82f6" variant="square" />
- * <XDSChartSwatch color="#f59e0b" variant="line" />
+ * <ChartSwatch color="#3b82f6" variant="square" />
+ * <ChartSwatch color="#f59e0b" variant="line" />
* ```
*/
@@ -22,13 +22,13 @@ import * as stylex from '@stylexjs/stylex';
* - `'square'` — square chip (bar series)
* - `'line'` — short stroke (line, dot, area, and other non-bar series)
*/
-export type XDSChartSwatchVariant = 'square' | 'line';
+export type ChartSwatchVariant = 'square' | 'line';
-export interface XDSChartSwatchProps {
+export interface ChartSwatchProps {
/** Fill color — typically a series color token */
color: string;
/** Visual variant. Default: `'square'`. */
- variant?: XDSChartSwatchVariant;
+ variant?: ChartSwatchVariant;
}
const styles = stylex.create({
@@ -51,12 +51,12 @@ const styles = stylex.create({
/**
* Color swatch primitive.
*
- * Used by XDSChartLegend (and XDSChartTooltip) to render the colored
+ * Used by ChartLegend (and ChartTooltip) to render the colored
* indicator next to a series label. Exported as a primitive so consumers
* can build their own custom legend/tooltip layouts while keeping visuals
* consistent.
*/
-function XDSChartSwatchImpl({color, variant = 'square'}: XDSChartSwatchProps) {
+function ChartSwatchImpl({color, variant = 'square'}: ChartSwatchProps) {
return (
<div
aria-hidden
@@ -70,7 +70,7 @@ function XDSChartSwatchImpl({color, variant = 'square'}: XDSChartSwatchProps) {
* Memoized — swatches are static for a given (color, variant) tuple
* and can render many times in a tooltip/legend with several series.
*/
-export const XDSChartSwatch = memo(XDSChartSwatchImpl);
+export const ChartSwatch = memo(ChartSwatchImpl);
/**
* Map a SeriesDef.type string to its swatch variant.
@@ -81,6 +81,6 @@ export const XDSChartSwatch = memo(XDSChartSwatchImpl);
*/
export function swatchVariantForType(
type: string | undefined,
-): XDSChartSwatchVariant {
+): ChartSwatchVariant {
return type === 'bar' ? 'square' : 'line';
}
diff --git a/packages/lab/src/ChartV2/XDSChartTooltip.tsx b/packages/lab/src/ChartV2/ChartTooltip.tsx
similarity index 87%
rename from packages/lab/src/ChartV2/XDSChartTooltip.tsx
rename to packages/lab/src/ChartV2/ChartTooltip.tsx
index 1fdd553f0f..02a7a26063 100644
--- a/packages/lab/src/ChartV2/XDSChartTooltip.tsx
+++ b/packages/lab/src/ChartV2/ChartTooltip.tsx
@@ -1,24 +1,24 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSChartTooltip.tsx
+ * @file ChartTooltip.tsx
* @output Grouped chart tooltip — shows all series values at the hovered x-position.
- * Composable: drop into `<XDSChart tooltip>` or render directly inside a chart
+ * Composable: drop into `<Chart tooltip>` or render directly inside a chart
* to take full control of props.
- * @position Reads from ChartV2Context — must render inside an <XDSChart>.
+ * @position Reads from ChartV2Context — must render inside an <Chart>.
*
* @example
* ```
- * // Default — declarative on XDSChart
- * <XDSChart tooltip />
+ * // Default — declarative on Chart
+ * <Chart tooltip />
*
- * // Custom render function via XDSChart prop
- * <XDSChart tooltip={{render: (x, rows) => <MyCard x={x} rows={rows} />}} />
+ * // Custom render function via Chart prop
+ * <Chart tooltip={{render: (x, rows) => <MyCard x={x} rows={rows} />}} />
*
* // Composable — drop into the chart's children for full control
- * <XDSChart>
- * <XDSChartTooltip hoverIndicator={false} placement="top" />
- * </XDSChart>
+ * <Chart>
+ * <ChartTooltip hoverIndicator={false} placement="top" />
+ * </Chart>
* ```
*/
@@ -41,10 +41,10 @@ import {
shadowVars,
spacingVars,
} from '@xds/core/theme/tokens.stylex';
-import {XDSText} from '@xds/core';
-import {XDSVStack, XDSHStack} from '@xds/core';
+import {Text} from '@xds/core';
+import {VStack, HStack} from '@xds/core';
import {useChartV2} from './ChartV2Context';
-import {XDSChartSwatch, swatchVariantForType} from './XDSChartSwatch';
+import {ChartSwatch, swatchVariantForType} from './ChartSwatch';
import {
deriveTooltipSeriesValues,
shouldRenderHoverDot,
@@ -53,13 +53,13 @@ import {
import type {SeriesDef, ChartPointerEvent} from './types';
import type {ScaleBand} from 'd3-scale';
-export type XDSChartTooltipPlacement = 'auto' | 'right' | 'left' | 'top';
+export type ChartTooltipPlacement = 'auto' | 'right' | 'left' | 'top';
-export interface XDSChartTooltipProps {
+export interface ChartTooltipProps {
/**
* Series definitions — used to map the hovered datum to per-series rows.
- * When rendered via `<XDSChart tooltip />`, XDSChart injects this automatically.
- * When composing directly, pass the same `series` array you gave XDSChart.
+ * When rendered via `<Chart tooltip />`, Chart injects this automatically.
+ * When composing directly, pass the same `series` array you gave Chart.
*/
series?: readonly SeriesDef[];
/**
@@ -86,7 +86,7 @@ export interface XDSChartTooltipProps {
* - `'auto'` (default): right of the point, flips to left if it would overflow
* - `'right'` / `'left'` / `'top'`: pinned position
*/
- placement?: XDSChartTooltipPlacement;
+ placement?: ChartTooltipPlacement;
}
const styles = stylex.create({
@@ -120,46 +120,46 @@ const DefaultTooltipContent = memo(function DefaultTooltipContent({
rows: TooltipSeriesValue[];
}) {
return (
- <XDSVStack gap={1}>
- <XDSText type="body" weight="semibold">
+ <VStack gap={1}>
+ <Text type="body" weight="semibold">
{String(xValue)}
- </XDSText>
+ </Text>
{rows.length === 1 ? (
- <XDSText type="supporting">{String(rows[0].value)}</XDSText>
+ <Text type="supporting">{String(rows[0].value)}</Text>
) : (
- <XDSVStack gap={1}>
+ <VStack gap={1}>
{rows.map(row => (
- <XDSHStack key={row.key} gap={2} vAlign="center">
- <XDSChartSwatch
+ <HStack key={row.key} gap={2} vAlign="center">
+ <ChartSwatch
color={row.color}
variant={swatchVariantForType(row.type)}
/>
- <XDSText type="supporting">{row.label}</XDSText>
- <XDSText type="supporting" weight="semibold">
+ <Text type="supporting">{row.label}</Text>
+ <Text type="supporting" weight="semibold">
{String(row.value)}
- </XDSText>
- </XDSHStack>
+ </Text>
+ </HStack>
))}
- </XDSVStack>
+ </VStack>
)}
- </XDSVStack>
+ </VStack>
);
});
/**
- * Composable grouped tooltip for XDSChart.
+ * Composable grouped tooltip for Chart.
*
* Subscribes to the chart's pointer event stream and only re-renders when the
* hovered data index changes (not on every pointer move). Card position is
* updated imperatively via a ref to keep pointer-move cost ~free.
*/
-export function XDSChartTooltip({
+export function ChartTooltip({
series = [],
render,
hoverIndicator = true,
showHoverDots = true,
placement = 'auto',
-}: XDSChartTooltipProps) {
+}: ChartTooltipProps) {
const {
data,
xKey,
diff --git a/packages/lab/src/ChartV2/ChartV2Context.ts b/packages/lab/src/ChartV2/ChartV2Context.ts
index 8909a82976..fcf69d3454 100644
--- a/packages/lab/src/ChartV2/ChartV2Context.ts
+++ b/packages/lab/src/ChartV2/ChartV2Context.ts
@@ -9,7 +9,7 @@ export const ChartV2Provider = Ctx.Provider;
export function useChartV2(): ChartV2Context {
const ctx = useContext(Ctx);
if (!ctx) {
- throw new Error('Must be used inside <XDSChart>');
+ throw new Error('Must be used inside <Chart>');
}
return ctx;
}
diff --git a/packages/lab/src/ChartV2/index.ts b/packages/lab/src/ChartV2/index.ts
index b5e665b222..432ab6639c 100644
--- a/packages/lab/src/ChartV2/index.ts
+++ b/packages/lab/src/ChartV2/index.ts
@@ -1,26 +1,26 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
-export {XDSChart, type XDSChartProps} from './XDSChart';
-export {XDSChartAxis, type XDSChartAxisProps} from './XDSChartAxis';
-export {XDSChartGrid, type XDSChartGridProps} from './XDSChartGrid';
+export {Chart, type ChartProps} from './Chart';
+export {ChartAxis, type ChartAxisProps} from './ChartAxis';
+export {ChartGrid, type ChartGridProps} from './ChartGrid';
export {
- XDSChartLegend,
- type XDSChartLegendProps,
+ ChartLegend,
+ type ChartLegendProps,
type LegendPosition,
type LegendAlignment,
-} from './XDSChartLegend';
+} from './ChartLegend';
export {type LegendItem} from './legend';
export {
- XDSChartSwatch,
+ ChartSwatch,
swatchVariantForType,
- type XDSChartSwatchProps,
- type XDSChartSwatchVariant,
-} from './XDSChartSwatch';
+ type ChartSwatchProps,
+ type ChartSwatchVariant,
+} from './ChartSwatch';
export {
- XDSChartTooltip,
- type XDSChartTooltipProps,
- type XDSChartTooltipPlacement,
-} from './XDSChartTooltip';
+ ChartTooltip,
+ type ChartTooltipProps,
+ type ChartTooltipPlacement,
+} from './ChartTooltip';
export {type TooltipSeriesValue} from './tooltip';
export {
bar,
diff --git a/packages/lab/src/ChartV2/layout.ts b/packages/lab/src/ChartV2/layout.ts
index 7db23b5394..785334e1dd 100644
--- a/packages/lab/src/ChartV2/layout.ts
+++ b/packages/lab/src/ChartV2/layout.ts
@@ -3,7 +3,7 @@
/**
* @file layout.ts
* @output Computes scales, stacking, grouping, then delegates to each series.resolve()
- * @position Called by XDSChart root — the single layout pass
+ * @position Called by Chart root — the single layout pass
*
* The layout engine does NOT know about specific mark types.
* It handles cross-series coordination (scales, stacking, grouping)
diff --git a/packages/lab/src/ChartV2/legend.ts b/packages/lab/src/ChartV2/legend.ts
index 7b021a4028..7590decb38 100644
--- a/packages/lab/src/ChartV2/legend.ts
+++ b/packages/lab/src/ChartV2/legend.ts
@@ -3,7 +3,7 @@
/**
* @file legend.ts
* @output Legend utility — derives legend items from series definitions
- * @position Used by XDSChart to bridge series → legend items
+ * @position Used by Chart to bridge series → legend items
*/
import {isUtilityMarkType, type SeriesDef} from './types';
diff --git a/packages/lab/src/ChartV2/marks/streamGL.tsx b/packages/lab/src/ChartV2/marks/streamGL.tsx
index 0f921fb9b1..1e1bdbc526 100644
--- a/packages/lab/src/ChartV2/marks/streamGL.tsx
+++ b/packages/lab/src/ChartV2/marks/streamGL.tsx
@@ -213,7 +213,7 @@ function StreamGLCanvas({
* // Push data points in a rAF loop or event handler:
* streamRef.current?.push(Date.now(), value);
*
- * <XDSChart series={[streamGL({color: '#10b981', handleRef: streamRef})]} />
+ * <Chart series={[streamGL({color: '#10b981', handleRef: streamRef})]} />
* ```
*/
export function streamGL(options: StreamGLOptions): SeriesDef {
diff --git a/packages/lab/src/ChartV2/tooltip.ts b/packages/lab/src/ChartV2/tooltip.ts
index de024b4d5b..34a0871586 100644
--- a/packages/lab/src/ChartV2/tooltip.ts
+++ b/packages/lab/src/ChartV2/tooltip.ts
@@ -3,9 +3,9 @@
/**
* @file tooltip.ts
* @output Tooltip types + series-value derivation
- * @position Used by XDSChart to bridge series + hovered datum → tooltip rows.
+ * @position Used by Chart to bridge series + hovered datum → tooltip rows.
* Mirrors the legend.ts split: data shaping lives here, presentation
- * lives in XDSChartTooltip.tsx.
+ * lives in ChartTooltip.tsx.
*/
import {isUtilityMarkType, type SeriesDef} from './types';
diff --git a/packages/lab/src/ChartV2/types.ts b/packages/lab/src/ChartV2/types.ts
index 6a9a319176..b3bc72b56f 100644
--- a/packages/lab/src/ChartV2/types.ts
+++ b/packages/lab/src/ChartV2/types.ts
@@ -98,7 +98,7 @@ export interface ChartPointerEvent {
active: boolean;
}
-/** Context provided by XDSChart to interaction children */
+/** Context provided by Chart to interaction children */
export interface ChartV2Context {
width: number;
height: number;
diff --git a/packages/lab/src/ChatReasoning/XDSChatReasoning.test.tsx b/packages/lab/src/ChatReasoning/ChatReasoning.test.tsx
similarity index 68%
rename from packages/lab/src/ChatReasoning/XDSChatReasoning.test.tsx
rename to packages/lab/src/ChatReasoning/ChatReasoning.test.tsx
index cac6ec23ea..cbd1c5f03c 100644
--- a/packages/lab/src/ChatReasoning/XDSChatReasoning.test.tsx
+++ b/packages/lab/src/ChatReasoning/ChatReasoning.test.tsx
@@ -1,11 +1,11 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
import {render, screen, fireEvent} from '@testing-library/react';
-import {XDSChatReasoning} from './XDSChatReasoning';
+import {ChatReasoning} from './ChatReasoning';
-describe('XDSChatReasoning', () => {
+describe('ChatReasoning', () => {
it('renders collapsed by default', () => {
- render(<XDSChatReasoning>Some reasoning text</XDSChatReasoning>);
+ render(<ChatReasoning>Some reasoning text</ChatReasoning>);
expect(screen.getByText('Thinking')).toBeInTheDocument();
expect(screen.getByRole('button')).toHaveAttribute(
'aria-expanded',
@@ -15,9 +15,9 @@ describe('XDSChatReasoning', () => {
it('shows preview text when collapsed', () => {
render(
- <XDSChatReasoning>
+ <ChatReasoning>
Some reasoning text about constraints
- </XDSChatReasoning>,
+ </ChatReasoning>,
);
expect(
screen.getAllByText('Some reasoning text about constraints').length,
@@ -25,33 +25,33 @@ describe('XDSChatReasoning', () => {
});
it('expands on click', () => {
- render(<XDSChatReasoning>Reasoning content here</XDSChatReasoning>);
+ render(<ChatReasoning>Reasoning content here</ChatReasoning>);
const button = screen.getByRole('button');
fireEvent.click(button);
expect(button).toHaveAttribute('aria-expanded', 'true');
});
it('shows duration when not streaming', () => {
- render(<XDSChatReasoning duration="12s">Text</XDSChatReasoning>);
+ render(<ChatReasoning duration="12s">Text</ChatReasoning>);
expect(screen.getByText('12s')).toBeInTheDocument();
});
it('hides duration when streaming', () => {
render(
- <XDSChatReasoning duration="12s" isStreaming>
+ <ChatReasoning duration="12s" isStreaming>
Text
- </XDSChatReasoning>,
+ </ChatReasoning>,
);
expect(screen.queryByText('12s')).not.toBeInTheDocument();
});
it('supports custom label', () => {
- render(<XDSChatReasoning label="Processing">Text</XDSChatReasoning>);
+ render(<ChatReasoning label="Processing">Text</ChatReasoning>);
expect(screen.getByText('Processing')).toBeInTheDocument();
});
it('supports defaultIsExpanded', () => {
- render(<XDSChatReasoning defaultIsExpanded>Content</XDSChatReasoning>);
+ render(<ChatReasoning defaultIsExpanded>Content</ChatReasoning>);
expect(screen.getByRole('button')).toHaveAttribute('aria-expanded', 'true');
});
});
diff --git a/packages/lab/src/ChatReasoning/XDSChatReasoning.tsx b/packages/lab/src/ChatReasoning/ChatReasoning.tsx
similarity index 95%
rename from packages/lab/src/ChatReasoning/XDSChatReasoning.tsx
rename to packages/lab/src/ChatReasoning/ChatReasoning.tsx
index 5ee7e6a2ef..80162e6f4a 100644
--- a/packages/lab/src/ChatReasoning/XDSChatReasoning.tsx
+++ b/packages/lab/src/ChatReasoning/ChatReasoning.tsx
@@ -3,9 +3,9 @@
'use client';
/**
- * @file XDSChatReasoning.tsx
+ * @file ChatReasoning.tsx
* @input Uses React, StyleX, theme tokens
- * @output Exports XDSChatReasoning component
+ * @output Exports ChatReasoning component
* @position Chat component — compact collapsible reasoning/thinking display
*
* Renders model reasoning/thinking content as a compact single-line
@@ -34,8 +34,8 @@ import {xdsThemeProps} from '../../../core/src/utils/xdsThemeProps';
// Types
// =============================================================================
-export interface XDSChatReasoningProps extends BaseProps<HTMLDivElement> {
- /** Reasoning content. String renders as plain text; ReactNode for XDSMarkdown etc. */
+export interface ChatReasoningProps extends BaseProps<HTMLDivElement> {
+ /** Reasoning content. String renders as plain text; ReactNode for Markdown etc. */
children: ReactNode;
/** Header label. @default 'Thinking' */
label?: string;
@@ -219,15 +219,15 @@ function ChevronDownIcon() {
*
* @example
* ```
- * <XDSChatMessage sender="assistant">
- * <XDSChatReasoning duration="12s">
+ * <ChatMessage sender="assistant">
+ * <ChatReasoning duration="12s">
* Let me work through the constraints on adjacent fields...
- * </XDSChatReasoning>
- * <XDSMarkdown>{response}</XDSMarkdown>
- * </XDSChatMessage>
+ * </ChatReasoning>
+ * <Markdown>{response}</Markdown>
+ * </ChatMessage>
* ```
*/
-export function XDSChatReasoning(props: XDSChatReasoningProps) {
+export function ChatReasoning(props: ChatReasoningProps) {
const {
children,
label = 'Thinking',
@@ -319,4 +319,4 @@ export function XDSChatReasoning(props: XDSChatReasoningProps) {
);
}
-XDSChatReasoning.displayName = 'XDSChatReasoning';
+ChatReasoning.displayName = 'ChatReasoning';
diff --git a/packages/lab/src/CircularProgress/CircularProgress.doc.mjs b/packages/lab/src/CircularProgress/CircularProgress.doc.mjs
index 767e0ac4fd..9ff5b184fd 100644
--- a/packages/lab/src/CircularProgress/CircularProgress.doc.mjs
+++ b/packages/lab/src/CircularProgress/CircularProgress.doc.mjs
@@ -64,12 +64,12 @@ export const docs = {
},
usage: {
description:
- 'A circular progress indicator that shows completion as a ring or arc. Use it for upload progress, score displays, dashboard gauges, or compact progress where horizontal space is limited. Complements XDSProgressBar for radial layouts.',
+ 'A circular progress indicator that shows completion as a ring or arc. Use it for upload progress, score displays, dashboard gauges, or compact progress where horizontal space is limited. Complements ProgressBar for radial layouts.',
bestPractices: [
{ guidance: true, description: 'Pass a value for determinate progress; omit value for an indeterminate spinner.' },
{ guidance: true, description: 'Provide center content (children) to give context: a percentage, icon, or short label.' },
{ guidance: true, description: 'Always provide a label, even though it is visually hidden by default; screen readers need it.' },
- { guidance: false, description: 'Use circular progress for long text labels; use XDSProgressBar instead, which has more room for label and value display.' },
+ { guidance: false, description: 'Use circular progress for long text labels; use ProgressBar instead, which has more room for label and value display.' },
{ guidance: false, description: 'Stack multiple circular progress indicators for the same operation; use one with a value label.' },
],
},
@@ -135,12 +135,12 @@ export const docsZh = {
},
usage: {
description:
- 'A circular progress indicator that shows completion as a ring or arc. Use it for upload progress, score displays, dashboard gauges, or compact progress where horizontal space is limited. Complements XDSProgressBar for radial layouts.',
+ 'A circular progress indicator that shows completion as a ring or arc. Use it for upload progress, score displays, dashboard gauges, or compact progress where horizontal space is limited. Complements ProgressBar for radial layouts.',
bestPractices: [
{ guidance: true, description: 'Pass a value for determinate progress; omit value for an indeterminate spinner.' },
{ guidance: true, description: 'Provide center content (children) to give context: a percentage, icon, or short label.' },
{ guidance: true, description: 'Always provide a label, even though it is visually hidden by default; screen readers need it.' },
- { guidance: false, description: 'Use circular progress for long text labels; use XDSProgressBar instead, which has more room for label and value display.' },
+ { guidance: false, description: 'Use circular progress for long text labels; use ProgressBar instead, which has more room for label and value display.' },
{ guidance: false, description: 'Stack multiple circular progress indicators for the same operation; use one with a value label.' },
],
},
@@ -152,12 +152,12 @@ export const docsDense = {
'Circular/radial progress indicator showing completion as a ring arc.',
usage: {
description:
- 'A circular progress indicator that shows completion as a ring or arc. Use it for upload progress, score displays, dashboard gauges, or compact progress where horizontal space is limited. Complements XDSProgressBar for radial layouts.',
+ 'A circular progress indicator that shows completion as a ring or arc. Use it for upload progress, score displays, dashboard gauges, or compact progress where horizontal space is limited. Complements ProgressBar for radial layouts.',
bestPractices: [
{ guidance: true, description: 'Pass a value for determinate progress; omit value for an indeterminate spinner.' },
{ guidance: true, description: 'Provide center content (children) to give context: a percentage, icon, or short label.' },
{ guidance: true, description: 'Always provide a label, even though it is visually hidden by default; screen readers need it.' },
- { guidance: false, description: 'Use circular progress for long text labels; use XDSProgressBar instead, which has more room for label and value display.' },
+ { guidance: false, description: 'Use circular progress for long text labels; use ProgressBar instead, which has more room for label and value display.' },
{ guidance: false, description: 'Stack multiple circular progress indicators for the same operation; use one with a value label.' },
],
},
diff --git a/packages/lab/src/CircularProgress/XDSCircularProgress.test.tsx b/packages/lab/src/CircularProgress/CircularProgress.test.tsx
similarity index 76%
rename from packages/lab/src/CircularProgress/XDSCircularProgress.test.tsx
rename to packages/lab/src/CircularProgress/CircularProgress.test.tsx
index 07fb9389dc..64c516b33c 100644
--- a/packages/lab/src/CircularProgress/XDSCircularProgress.test.tsx
+++ b/packages/lab/src/CircularProgress/CircularProgress.test.tsx
@@ -2,11 +2,11 @@
import {describe, it, expect} from 'vitest';
import {render, screen} from '@testing-library/react';
-import {XDSCircularProgress} from './XDSCircularProgress';
+import {CircularProgress} from './CircularProgress';
-describe('XDSCircularProgress', () => {
+describe('CircularProgress', () => {
it('renders with default props', () => {
- render(<XDSCircularProgress value={50} label="Progress" />);
+ render(<CircularProgress value={50} label="Progress" />);
const meter = screen.getByRole('meter');
expect(meter).toBeInTheDocument();
expect(meter).toHaveAttribute('aria-valuenow', '50');
@@ -15,7 +15,7 @@ describe('XDSCircularProgress', () => {
});
it('renders label as visually hidden by default', () => {
- render(<XDSCircularProgress value={50} label="Upload progress" />);
+ render(<CircularProgress value={50} label="Upload progress" />);
expect(screen.getByText('Upload progress')).toBeInTheDocument();
const meter = screen.getByRole('meter');
expect(meter).toHaveAttribute('aria-labelledby');
@@ -23,7 +23,7 @@ describe('XDSCircularProgress', () => {
it('shows label visually when isLabelHidden is false', () => {
render(
- <XDSCircularProgress
+ <CircularProgress
value={50}
label="Upload progress"
isLabelHidden={false}
@@ -36,7 +36,7 @@ describe('XDSCircularProgress', () => {
});
it('respects custom max', () => {
- render(<XDSCircularProgress value={3} max={10} label="Steps" />);
+ render(<CircularProgress value={3} max={10} label="Steps" />);
const meter = screen.getByRole('meter');
expect(meter).toHaveAttribute('aria-valuenow', '3');
expect(meter).toHaveAttribute('aria-valuemax', '10');
@@ -44,34 +44,34 @@ describe('XDSCircularProgress', () => {
it('clamps value to [0, max]', () => {
const {rerender} = render(
- <XDSCircularProgress value={150} max={100} label="Over" />,
+ <CircularProgress value={150} max={100} label="Over" />,
);
let meter = screen.getByRole('meter');
expect(meter).toHaveAttribute('aria-valuenow', '100');
- rerender(<XDSCircularProgress value={-10} max={100} label="Under" />);
+ rerender(<CircularProgress value={-10} max={100} label="Under" />);
meter = screen.getByRole('meter');
expect(meter).toHaveAttribute('aria-valuenow', '0');
});
it('renders children in the center', () => {
render(
- <XDSCircularProgress value={75} label="Progress">
+ <CircularProgress value={75} label="Progress">
75%
- </XDSCircularProgress>,
+ </CircularProgress>,
);
expect(screen.getByText('75%')).toBeInTheDocument();
});
it('forwards ref to outer container', () => {
const ref = {current: null as HTMLDivElement | null};
- render(<XDSCircularProgress ref={ref} value={50} label="Test" />);
+ render(<CircularProgress ref={ref} value={50} label="Test" />);
expect(ref.current).toBeInstanceOf(HTMLDivElement);
});
it('passes data-testid', () => {
render(
- <XDSCircularProgress value={50} label="Test" data-testid="my-progress" />,
+ <CircularProgress value={50} label="Test" data-testid="my-progress" />,
);
expect(screen.getByTestId('my-progress')).toBeInTheDocument();
});
@@ -86,7 +86,7 @@ describe('XDSCircularProgress', () => {
] as const;
for (const variant of variants) {
const {unmount} = render(
- <XDSCircularProgress value={50} label={variant} variant={variant} />,
+ <CircularProgress value={50} label={variant} variant={variant} />,
);
expect(screen.getByRole('meter')).toBeInTheDocument();
unmount();
@@ -97,7 +97,7 @@ describe('XDSCircularProgress', () => {
const sizes = ['sm', 'md', 'lg'] as const;
for (const size of sizes) {
const {unmount} = render(
- <XDSCircularProgress value={50} label={size} size={size} />,
+ <CircularProgress value={50} label={size} size={size} />,
);
expect(screen.getByRole('meter')).toBeInTheDocument();
unmount();
@@ -105,7 +105,7 @@ describe('XDSCircularProgress', () => {
});
it('handles zero max gracefully', () => {
- render(<XDSCircularProgress value={0} max={0} label="Empty" />);
+ render(<CircularProgress value={0} max={0} label="Empty" />);
const meter = screen.getByRole('meter');
expect(meter).toHaveAttribute('aria-valuenow', '0');
expect(meter).toHaveAttribute('aria-valuemax', '0');
@@ -113,13 +113,13 @@ describe('XDSCircularProgress', () => {
describe('indeterminate mode', () => {
it('renders indeterminate when value is omitted', () => {
- render(<XDSCircularProgress label="Loading" />);
+ render(<CircularProgress label="Loading" />);
const progressbar = screen.getByRole('progressbar');
expect(progressbar).toBeInTheDocument();
});
it('does not set aria-valuenow/min/max when indeterminate', () => {
- render(<XDSCircularProgress label="Loading" />);
+ render(<CircularProgress label="Loading" />);
const progressbar = screen.getByRole('progressbar');
expect(progressbar).not.toHaveAttribute('aria-valuenow');
expect(progressbar).not.toHaveAttribute('aria-valuemin');
@@ -127,7 +127,7 @@ describe('XDSCircularProgress', () => {
});
it('is labelled via aria-labelledby when indeterminate', () => {
- render(<XDSCircularProgress label="Loading data" />);
+ render(<CircularProgress label="Loading data" />);
const progressbar = screen.getByRole('progressbar');
expect(progressbar).toHaveAttribute('aria-labelledby');
});
@@ -142,7 +142,7 @@ describe('XDSCircularProgress', () => {
] as const;
for (const variant of variants) {
const {unmount} = render(
- <XDSCircularProgress label={variant} variant={variant} />,
+ <CircularProgress label={variant} variant={variant} />,
);
expect(screen.getByRole('progressbar')).toBeInTheDocument();
unmount();
@@ -150,7 +150,7 @@ describe('XDSCircularProgress', () => {
});
it('renders children alongside indeterminate animation', () => {
- render(<XDSCircularProgress label="Loading">...</XDSCircularProgress>);
+ render(<CircularProgress label="Loading">...</CircularProgress>);
expect(screen.getByText('...')).toBeInTheDocument();
});
});
diff --git a/packages/lab/src/CircularProgress/XDSCircularProgress.tsx b/packages/lab/src/CircularProgress/CircularProgress.tsx
similarity index 89%
rename from packages/lab/src/CircularProgress/XDSCircularProgress.tsx
rename to packages/lab/src/CircularProgress/CircularProgress.tsx
index ef53f1ecb7..daf0856e28 100644
--- a/packages/lab/src/CircularProgress/XDSCircularProgress.tsx
+++ b/packages/lab/src/CircularProgress/CircularProgress.tsx
@@ -3,14 +3,14 @@
'use client';
/**
- * @file XDSCircularProgress.tsx
+ * @file CircularProgress.tsx
* @input Uses React, useId, stylex, SVG, color/spacing/duration/ease tokens
- * @output Exports XDSCircularProgress component, XDSCircularProgressProps, XDSCircularProgressSize, XDSCircularProgressVariant types
+ * @output Exports CircularProgress component, CircularProgressProps, CircularProgressSize, CircularProgressVariant types
* @position Core implementation; consumed by index.ts
*
* SYNC: When modified, update these files to stay in sync:
* - /packages/core/src/CircularProgress/CircularProgress.doc.mjs (props table, features, implementation notes)
- * - /packages/core/src/CircularProgress/XDSCircularProgress.test.tsx (tests for new/changed behavior)
+ * - /packages/core/src/CircularProgress/CircularProgress.test.tsx (tests for new/changed behavior)
* - /packages/core/src/CircularProgress/index.ts (exports if types change)
* - /apps/storybook/stories/CircularProgress.stories.tsx (storybook stories)
* - /packages/cli/templates/blocks/components/CircularProgress/ (showcase blocks)
@@ -32,19 +32,19 @@ import type {BaseProps} from '@xds/core';
import {xdsThemeProps} from '../../../core/src/utils/xdsThemeProps';
/**
- * Extensible variant map for XDSCircularProgress.
+ * Extensible variant map for CircularProgress.
*
* Theme packages can add custom variants via TypeScript module augmentation:
* @example
* ```
* declare module '@xds/core/CircularProgress' {
- * interface XDSCircularProgressVariantMap {
+ * interface CircularProgressVariantMap {
* 'brand': true;
* }
* }
* ```
*/
-export interface XDSCircularProgressVariantMap {
+export interface CircularProgressVariantMap {
accent: true;
success: true;
warning: true;
@@ -52,9 +52,9 @@ export interface XDSCircularProgressVariantMap {
neutral: true;
}
-export type XDSCircularProgressVariant = keyof XDSCircularProgressVariantMap;
+export type CircularProgressVariant = keyof CircularProgressVariantMap;
-export type XDSCircularProgressSize = 'sm' | 'md' | 'lg';
+export type CircularProgressSize = 'sm' | 'md' | 'lg';
const SIZE_CONFIG = {
sm: {diameter: 32, strokeWidth: 3},
@@ -62,7 +62,7 @@ const SIZE_CONFIG = {
lg: {diameter: 64, strokeWidth: 5},
} as const;
-export interface XDSCircularProgressProps extends BaseProps<HTMLDivElement> {
+export interface CircularProgressProps extends BaseProps<HTMLDivElement> {
/** Ref forwarded to the root element */
ref?: React.Ref<HTMLDivElement>;
/**
@@ -96,12 +96,12 @@ export interface XDSCircularProgressProps extends BaseProps<HTMLDivElement> {
* - 'lg': 64px
* @default 'md'
*/
- size?: XDSCircularProgressSize;
+ size?: CircularProgressSize;
/**
* Visual style variant mapped to semantic color tokens.
* @default 'accent'
*/
- variant?: XDSCircularProgressVariant;
+ variant?: CircularProgressVariant;
/**
* Test ID for testing utilities.
*/
@@ -260,12 +260,12 @@ const trackVariantStyles = stylex.create({
*
* @example
* ```
- * <XDSCircularProgress value={75} label="Upload progress" />
- * <XDSCircularProgress value={75} label="Progress" max={100}>75%</XDSCircularProgress>
- * <XDSCircularProgress label="Loading..." />
+ * <CircularProgress value={75} label="Upload progress" />
+ * <CircularProgress value={75} label="Progress" max={100}>75%</CircularProgress>
+ * <CircularProgress label="Loading..." />
* ```
*/
-export function XDSCircularProgress({
+export function CircularProgress({
value,
max = 100,
label,
@@ -279,7 +279,7 @@ export function XDSCircularProgress({
'data-testid': dataTestId,
ref,
...rest
-}: XDSCircularProgressProps) {
+}: CircularProgressProps) {
const labelId = useId();
const isIndeterminate = value == null;
const {diameter, strokeWidth} = SIZE_CONFIG[size];
@@ -370,4 +370,4 @@ export function XDSCircularProgress({
);
}
-XDSCircularProgress.displayName = 'XDSCircularProgress';
+CircularProgress.displayName = 'CircularProgress';
diff --git a/packages/lab/src/CircularProgress/index.ts b/packages/lab/src/CircularProgress/index.ts
index 743c7ef6fb..7066de5a30 100644
--- a/packages/lab/src/CircularProgress/index.ts
+++ b/packages/lab/src/CircularProgress/index.ts
@@ -6,10 +6,10 @@
* @file CircularProgress component barrel export
*/
-export {XDSCircularProgress} from './XDSCircularProgress';
+export {CircularProgress} from './CircularProgress';
export type {
- XDSCircularProgressProps,
- XDSCircularProgressSize,
- XDSCircularProgressVariant,
- XDSCircularProgressVariantMap,
-} from './XDSCircularProgress';
+ CircularProgressProps,
+ CircularProgressSize,
+ CircularProgressVariant,
+ CircularProgressVariantMap,
+} from './CircularProgress';
diff --git a/packages/lab/src/CodeBlock/index.ts b/packages/lab/src/CodeBlock/index.ts
index 41e4bc5d3d..94ea07effe 100644
--- a/packages/lab/src/CodeBlock/index.ts
+++ b/packages/lab/src/CodeBlock/index.ts
@@ -6,5 +6,5 @@
* This re-export exists for backwards compatibility.
*/
-export {XDSCodeBlock} from '@xds/core/CodeBlock';
-export type {XDSCodeBlockProps} from '@xds/core/CodeBlock';
+export {CodeBlock} from '@xds/core/CodeBlock';
+export type {CodeBlockProps} from '@xds/core/CodeBlock';
diff --git a/packages/lab/src/CodeEditor/XDSCodeEditor.tsx b/packages/lab/src/CodeEditor/CodeEditor.tsx
similarity index 97%
rename from packages/lab/src/CodeEditor/XDSCodeEditor.tsx
rename to packages/lab/src/CodeEditor/CodeEditor.tsx
index 1049ef41f1..d30999831c 100644
--- a/packages/lab/src/CodeEditor/XDSCodeEditor.tsx
+++ b/packages/lab/src/CodeEditor/CodeEditor.tsx
@@ -1,9 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSCodeEditor.tsx
+ * @file CodeEditor.tsx
* @input Uses React, StyleX, theme tokens, CSS Custom Highlight API
- * @output Exports XDSCodeEditor component and XDSCodeEditorProps
+ * @output Exports CodeEditor component and CodeEditorProps
* @position Core implementation; editable code input (lab/experimental)
*
* SYNC: When modified, update:
@@ -119,7 +119,7 @@ const styles = stylex.create({
// Props
// ---------------------------------------------------------------------------
-export interface XDSCodeEditorProps extends Omit<
+export interface CodeEditorProps extends Omit<
BaseProps<HTMLDivElement>,
'onChange'
> {
@@ -181,7 +181,7 @@ let editorInstanceCounter = 0;
* @example
* ```tsx
* const [code, setCode] = useState('');
- * <XDSCodeEditor
+ * <CodeEditor
* value={code}
* onChange={setCode}
* language="typescript"
@@ -189,7 +189,7 @@ let editorInstanceCounter = 0;
* />
* ```
*/
-export function XDSCodeEditor({
+export function CodeEditor({
value,
onChange,
language = 'plaintext',
@@ -204,7 +204,7 @@ export function XDSCodeEditor({
style,
ref,
...props
-}: XDSCodeEditorProps) {
+}: CodeEditorProps) {
const editorRef = useRef<HTMLElement>(null);
const [instanceId] = useState(() => ++editorInstanceCounter);
const [focused, setFocused] = useState(false);
@@ -463,4 +463,4 @@ export function XDSCodeEditor({
);
}
-XDSCodeEditor.displayName = 'XDSCodeEditor';
+CodeEditor.displayName = 'CodeEditor';
diff --git a/packages/lab/src/CodeEditor/index.ts b/packages/lab/src/CodeEditor/index.ts
index 003985fc2c..ff735d1733 100644
--- a/packages/lab/src/CodeEditor/index.ts
+++ b/packages/lab/src/CodeEditor/index.ts
@@ -4,5 +4,5 @@
* @file CodeEditor component barrel export
*/
-export {XDSCodeEditor} from './XDSCodeEditor';
-export type {XDSCodeEditorProps} from './XDSCodeEditor';
+export {CodeEditor} from './CodeEditor';
+export type {CodeEditorProps} from './CodeEditor';
diff --git a/packages/lab/src/Radial/XDSRadialArea.tsx b/packages/lab/src/Radial/RadialArea.tsx
similarity index 93%
rename from packages/lab/src/Radial/XDSRadialArea.tsx
rename to packages/lab/src/Radial/RadialArea.tsx
index 3aad8b8fc3..5fff19ede0 100644
--- a/packages/lab/src/Radial/XDSRadialArea.tsx
+++ b/packages/lab/src/Radial/RadialArea.tsx
@@ -1,14 +1,14 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSRadialArea.tsx
+ * @file RadialArea.tsx
* @output Renders a spider/radar polygon for a dataset
*/
import {useMemo} from 'react';
import {useRadial} from './RadialContext';
-export interface XDSRadialAreaProps {
+export interface RadialAreaProps {
/** Key identifying which dataset row to plot (matches a value in data) */
dataKey: string;
/** Fill color */
@@ -29,17 +29,17 @@ export interface XDSRadialAreaProps {
*
* @example
* ```
- * <XDSRadialArea dataKey="modelA" color={colors[0]} dots />
+ * <RadialArea dataKey="modelA" color={colors[0]} dots />
* ```
*/
-export function XDSRadialArea({
+export function RadialArea({
dataKey,
color,
opacity = 0.2,
strokeWidth = 2,
dots = false,
dotRadius = 4,
-}: XDSRadialAreaProps) {
+}: RadialAreaProps) {
const {cx, cy, data, axes, angleByAxis, radiusScale, axisDomains} =
useRadial();
diff --git a/packages/lab/src/Radial/XDSRadialAxis.tsx b/packages/lab/src/Radial/RadialAxis.tsx
similarity index 88%
rename from packages/lab/src/Radial/XDSRadialAxis.tsx
rename to packages/lab/src/Radial/RadialAxis.tsx
index 29bd2e9cd4..3125f7c076 100644
--- a/packages/lab/src/Radial/XDSRadialAxis.tsx
+++ b/packages/lab/src/Radial/RadialAxis.tsx
@@ -1,13 +1,13 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSRadialAxis.tsx
+ * @file RadialAxis.tsx
* @output Renders axis labels at each spider vertex
*/
import {useRadial} from './RadialContext';
-export interface XDSRadialAxisProps {
+export interface RadialAxisProps {
/** Label offset from the outer ring in pixels (default: 16) */
labelOffset?: number;
}
@@ -17,10 +17,10 @@ export interface XDSRadialAxisProps {
*
* @example
* ```
- * <XDSRadialAxis />
+ * <RadialAxis />
* ```
*/
-export function XDSRadialAxis({labelOffset = 16}: XDSRadialAxisProps) {
+export function RadialAxis({labelOffset = 16}: RadialAxisProps) {
const {cx, cy, radius, axes, angleByAxis} = useRadial();
if (!axes || !angleByAxis) {
diff --git a/packages/lab/src/Radial/XDSRadialChart.tsx b/packages/lab/src/Radial/RadialChart.tsx
similarity index 87%
rename from packages/lab/src/Radial/XDSRadialChart.tsx
rename to packages/lab/src/Radial/RadialChart.tsx
index 6250bd2474..f649f625d1 100644
--- a/packages/lab/src/Radial/XDSRadialChart.tsx
+++ b/packages/lab/src/Radial/RadialChart.tsx
@@ -1,12 +1,12 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSRadialChart.tsx
+ * @file RadialChart.tsx
* @output Root radial chart container — spider, pie, donut
* @position Parent component; all radial marks read from its context
*
* Owns the radial coordinate space: center, radius, angle/radius scales.
- * Same Tier 1 guarantee as XDSChart — all children map through the same context.
+ * Same Tier 1 guarantee as Chart — all children map through the same context.
*/
import {
@@ -19,7 +19,7 @@ import {
import {RadialProvider} from './RadialContext';
import type {RadialMode} from './types';
-export interface XDSRadialChartProps {
+export interface RadialChartProps {
/** The dataset */
data: Record<string, unknown>[];
/** Chart height in pixels. Width is responsive. */
@@ -62,24 +62,24 @@ export interface XDSRadialChartProps {
* @example
* ```
* // Spider
- * <XDSRadialChart data={data} axes={['speed', 'handling', 'comfort']} height={400}>
- * <XDSRadialGrid rings={5} />
- * <XDSRadialArea dataKey="modelA" color={colors[0]} />
- * <XDSRadialAxis />
- * </XDSRadialChart>
+ * <RadialChart data={data} axes={['speed', 'handling', 'comfort']} height={400}>
+ * <RadialGrid rings={5} />
+ * <RadialArea dataKey="modelA" color={colors[0]} />
+ * <RadialAxis />
+ * </RadialChart>
*
* // Pie
- * <XDSRadialChart data={data} valueKey="revenue" labelKey="region" height={400}>
- * <XDSRadialSlice />
- * </XDSRadialChart>
+ * <RadialChart data={data} valueKey="revenue" labelKey="region" height={400}>
+ * <RadialSlice />
+ * </RadialChart>
*
* // Donut
- * <XDSRadialChart data={data} valueKey="revenue" labelKey="region" innerRadius={0.6} height={400}>
- * <XDSRadialSlice />
- * </XDSRadialChart>
+ * <RadialChart data={data} valueKey="revenue" labelKey="region" innerRadius={0.6} height={400}>
+ * <RadialSlice />
+ * </RadialChart>
* ```
*/
-export function XDSRadialChart({
+export function RadialChart({
data,
height = 400,
axes,
@@ -88,7 +88,7 @@ export function XDSRadialChart({
innerRadius: innerRadiusFraction = 0,
padAngle = 0.02,
children,
-}: XDSRadialChartProps) {
+}: RadialChartProps) {
const containerRef = useRef<HTMLDivElement>(null);
const [containerWidth, setContainerWidth] = useState(0);
diff --git a/packages/lab/src/Radial/RadialContext.ts b/packages/lab/src/Radial/RadialContext.ts
index f41348e23c..246c85e347 100644
--- a/packages/lab/src/Radial/RadialContext.ts
+++ b/packages/lab/src/Radial/RadialContext.ts
@@ -12,11 +12,11 @@ const RadialCtx = createContext<RadialContext | null>(null);
export const RadialProvider = RadialCtx.Provider;
-/** Access the radial chart context. Throws if used outside XDSRadialChart. */
+/** Access the radial chart context. Throws if used outside RadialChart. */
export function useRadial(): RadialContext {
const ctx = useContext(RadialCtx);
if (!ctx) {
- throw new Error('Radial components must be used inside <XDSRadialChart>');
+ throw new Error('Radial components must be used inside <RadialChart>');
}
return ctx;
}
diff --git a/packages/lab/src/Radial/XDSRadialGrid.tsx b/packages/lab/src/Radial/RadialGrid.tsx
similarity index 92%
rename from packages/lab/src/Radial/XDSRadialGrid.tsx
rename to packages/lab/src/Radial/RadialGrid.tsx
index f43a78e348..b905dcd7d8 100644
--- a/packages/lab/src/Radial/XDSRadialGrid.tsx
+++ b/packages/lab/src/Radial/RadialGrid.tsx
@@ -1,13 +1,13 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSRadialGrid.tsx
+ * @file RadialGrid.tsx
* @output Renders concentric grid rings and axis lines for spider charts
*/
import {useRadial} from './RadialContext';
-export interface XDSRadialGridProps {
+export interface RadialGridProps {
/** Number of concentric rings (default: 5) */
rings?: number;
}
@@ -17,10 +17,10 @@ export interface XDSRadialGridProps {
*
* @example
* ```
- * <XDSRadialGrid rings={5} />
+ * <RadialGrid rings={5} />
* ```
*/
-export function XDSRadialGrid({rings = 5}: XDSRadialGridProps) {
+export function RadialGrid({rings = 5}: RadialGridProps) {
const {cx, cy, radius, innerRadius, axes, angleByAxis, radiusScale} =
useRadial();
diff --git a/packages/lab/src/Radial/XDSRadialSlice.tsx b/packages/lab/src/Radial/RadialSlice.tsx
similarity index 93%
rename from packages/lab/src/Radial/XDSRadialSlice.tsx
rename to packages/lab/src/Radial/RadialSlice.tsx
index 02caea6031..80107f3a85 100644
--- a/packages/lab/src/Radial/XDSRadialSlice.tsx
+++ b/packages/lab/src/Radial/RadialSlice.tsx
@@ -1,16 +1,16 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSRadialSlice.tsx
+ * @file RadialSlice.tsx
* @output Renders pie/donut slices from radial context
*/
import {useRadial} from './RadialContext';
-export interface XDSRadialSliceProps {
+export interface RadialSliceProps {
/**
* Colors for each slice. Array of hex strings.
- * Use useXDSChartColors().categorical(n).
+ * Use useChartColors().categorical(n).
*/
colors: string[];
/** Corner radius on slice edges (default: 2) */
@@ -67,15 +67,15 @@ function arcPath(
*
* @example
* ```
- * <XDSRadialSlice colors={colors.categorical(5)} />
+ * <RadialSlice colors={colors.categorical(5)} />
* ```
*/
-export function XDSRadialSlice({
+export function RadialSlice({
colors,
cornerRadius = 0,
labels = true,
labelThreshold = 5,
-}: XDSRadialSliceProps) {
+}: RadialSliceProps) {
const {cx, cy, radius, innerRadius, slices} = useRadial();
if (!slices || slices.length === 0) {
diff --git a/packages/lab/src/Radial/XDSRadialTooltip.tsx b/packages/lab/src/Radial/RadialTooltip.tsx
similarity index 94%
rename from packages/lab/src/Radial/XDSRadialTooltip.tsx
rename to packages/lab/src/Radial/RadialTooltip.tsx
index ab1df54926..f567dbcbc7 100644
--- a/packages/lab/src/Radial/XDSRadialTooltip.tsx
+++ b/packages/lab/src/Radial/RadialTooltip.tsx
@@ -1,9 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSRadialTooltip.tsx
+ * @file RadialTooltip.tsx
* @output Hover tooltip for radial charts (pie/donut/spider)
- * @position Child of XDSRadialChart; reads geometry from radial context
+ * @position Child of RadialChart; reads geometry from radial context
*
* Uses the XDS Layer system for top-layer rendering.
* Hit-tests pointer position against slices (pie/donut) or axis proximity (spider).
@@ -14,7 +14,7 @@
import {useState, useCallback, useRef, type ReactNode} from 'react';
import {createPortal} from 'react-dom';
-import {useXDSLayer} from '@xds/core/Layer';
+import {useLayer} from '@xds/core/Layer';
import {useRadial} from './RadialContext';
export interface RadialTooltipDatum {
@@ -28,7 +28,7 @@ export interface RadialTooltipDatum {
index: number;
}
-export interface XDSRadialTooltipProps {
+export interface RadialTooltipProps {
/**
* Custom render function for tooltip content.
* Receives the hovered slice/point info.
@@ -56,17 +56,17 @@ export interface XDSRadialTooltipProps {
*
* @example
* ```tsx
- * <XDSRadialChart data={data} valueKey="revenue" labelKey="region" height={400}>
- * <XDSRadialSlice colors={colors} />
- * <XDSRadialTooltip />
- * </XDSRadialChart>
+ * <RadialChart data={data} valueKey="revenue" labelKey="region" height={400}>
+ * <RadialSlice colors={colors} />
+ * <RadialTooltip />
+ * </RadialChart>
* ```
*/
-export function XDSRadialTooltip({
+export function RadialTooltip({
render,
highlight = true,
highlightOffset = 6,
-}: XDSRadialTooltipProps) {
+}: RadialTooltipProps) {
const {
cx,
cy,
@@ -86,7 +86,7 @@ export function XDSRadialTooltip({
const portalRef = useRef<HTMLElement | null>(null);
const active = useRef(false);
- const layer = useXDSLayer({mode: 'fixed'});
+ const layer = useLayer({mode: 'fixed'});
// Resolve SVG + portal target from the <g> mount
const gRef = useCallback((el: SVGGElement | null) => {
diff --git a/packages/lab/src/Radial/index.ts b/packages/lab/src/Radial/index.ts
index 1fb9194f3e..13261b1e2a 100644
--- a/packages/lab/src/Radial/index.ts
+++ b/packages/lab/src/Radial/index.ts
@@ -1,14 +1,14 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
-export {XDSRadialChart, type XDSRadialChartProps} from './XDSRadialChart';
-export {XDSRadialGrid, type XDSRadialGridProps} from './XDSRadialGrid';
-export {XDSRadialArea, type XDSRadialAreaProps} from './XDSRadialArea';
-export {XDSRadialAxis, type XDSRadialAxisProps} from './XDSRadialAxis';
-export {XDSRadialSlice, type XDSRadialSliceProps} from './XDSRadialSlice';
+export {RadialChart, type RadialChartProps} from './RadialChart';
+export {RadialGrid, type RadialGridProps} from './RadialGrid';
+export {RadialArea, type RadialAreaProps} from './RadialArea';
+export {RadialAxis, type RadialAxisProps} from './RadialAxis';
+export {RadialSlice, type RadialSliceProps} from './RadialSlice';
export {
- XDSRadialTooltip,
- type XDSRadialTooltipProps,
+ RadialTooltip,
+ type RadialTooltipProps,
type RadialTooltipDatum,
-} from './XDSRadialTooltip';
+} from './RadialTooltip';
export {useRadial} from './RadialContext';
export type {RadialContext, RadialMode} from './types';
diff --git a/packages/lab/src/Radial/types.ts b/packages/lab/src/Radial/types.ts
index 330527946c..8bb08e785c 100644
--- a/packages/lab/src/Radial/types.ts
+++ b/packages/lab/src/Radial/types.ts
@@ -9,7 +9,7 @@
/** Radial chart mode */
export type RadialMode = 'spider' | 'pie';
-/** Radial context provided by XDSRadialChart to children */
+/** Radial context provided by RadialChart to children */
export interface RadialContext {
/** Center x pixel position */
cx: number;
diff --git a/packages/lab/src/SVGIcon/XDSSVGIcon.tsx b/packages/lab/src/SVGIcon/SVGIcon.tsx
similarity index 98%
rename from packages/lab/src/SVGIcon/XDSSVGIcon.tsx
rename to packages/lab/src/SVGIcon/SVGIcon.tsx
index 31ea6ab306..fe70193ab0 100644
--- a/packages/lab/src/SVGIcon/XDSSVGIcon.tsx
+++ b/packages/lab/src/SVGIcon/SVGIcon.tsx
@@ -3,7 +3,7 @@
'use client';
/**
- * @file XDSSVGIcon.tsx
+ * @file SVGIcon.tsx
* @input SVG path data with per-element roles, variation preset, size, color
* @output CSS-variable-driven SVG icon with role-aware rendering and mask-based gaps
* @position Core implementation for the lab SVG icon system
@@ -80,7 +80,7 @@ export interface SVGIconDef {
secondary?: IconShape[];
}
-export interface XDSSVGIconProps extends Omit<
+export interface SVGIconProps extends Omit<
SVGProps<SVGSVGElement>,
'color'
> {
@@ -322,10 +322,10 @@ function splitByRole(shapes: IconShape[]): {
*
* @example
* ```
- * <XDSSVGIcon icon={bellIcon} variation="twotone" size="md" color="accent" />
+ * <SVGIcon icon={bellIcon} variation="twotone" size="md" color="accent" />
* ```
*/
-export function XDSSVGIcon({
+export function SVGIcon({
icon,
variation = 'linear',
size = 'md',
@@ -333,7 +333,7 @@ export function XDSSVGIcon({
strokeWidth,
style,
...props
-}: XDSSVGIconProps) {
+}: SVGIconProps) {
const uid = useId();
const viewBox = icon.viewBox ?? '0 0 24 24';
const hasSecondary = icon.secondary && icon.secondary.length > 0;
@@ -406,4 +406,4 @@ export function XDSSVGIcon({
);
}
-XDSSVGIcon.displayName = 'XDSSVGIcon';
+SVGIcon.displayName = 'SVGIcon';
diff --git a/packages/lab/src/SVGIcon/icons.ts b/packages/lab/src/SVGIcon/icons.ts
index 64bbfc044a..35392c584c 100644
--- a/packages/lab/src/SVGIcon/icons.ts
+++ b/packages/lab/src/SVGIcon/icons.ts
@@ -13,7 +13,7 @@
* The role defaults to "fill" if omitted.
*/
-import type {SVGIconDef} from './XDSSVGIcon';
+import type {SVGIconDef} from './SVGIcon';
/** Simple stroke-only: X / Close — both lines are stroke-role */
export const xIcon: SVGIconDef = {
diff --git a/packages/lab/src/SVGIcon/index.ts b/packages/lab/src/SVGIcon/index.ts
index 97aa0dc216..e9c8036d9b 100644
--- a/packages/lab/src/SVGIcon/index.ts
+++ b/packages/lab/src/SVGIcon/index.ts
@@ -9,16 +9,16 @@
* @position Entry point for the lab SVG icon system
*/
-export {XDSSVGIcon} from './XDSSVGIcon';
+export {SVGIcon} from './SVGIcon';
export type {
- XDSSVGIconProps,
+ SVGIconProps,
SVGIconVariation,
SVGIconSize,
SVGIconColor,
SVGIconDef,
IconShape,
IconShapeRole,
-} from './XDSSVGIcon';
+} from './SVGIcon';
export {variations, opticalSize} from './variations.stylex';
export {iconVars} from './tokens.stylex';
diff --git a/packages/lab/src/SVGIcon/tokens.stylex.ts b/packages/lab/src/SVGIcon/tokens.stylex.ts
index 8a8f0a6c77..04c4224dcf 100644
--- a/packages/lab/src/SVGIcon/tokens.stylex.ts
+++ b/packages/lab/src/SVGIcon/tokens.stylex.ts
@@ -4,7 +4,7 @@
* @file tokens.stylex.ts
* @input XDS design token system
* @output CSS custom properties for SVG icon rendering
- * @position Token definitions consumed by XDSSVGIcon and variation presets
+ * @position Token definitions consumed by SVGIcon and variation presets
*
* Two-layer system (primary/secondary) with per-role rendering (fill vs stroke).
* Bold mode uses mask-based gap subtraction controlled by --icon-gap tokens.
diff --git a/packages/lab/src/SVGIcon/variations.stylex.ts b/packages/lab/src/SVGIcon/variations.stylex.ts
index 9c4101c1ab..8c2a0674b9 100644
--- a/packages/lab/src/SVGIcon/variations.stylex.ts
+++ b/packages/lab/src/SVGIcon/variations.stylex.ts
@@ -4,7 +4,7 @@
* @file variations.stylex.ts
* @input Icon token vars
* @output StyleX styles for each icon variation preset
- * @position Consumed by XDSSVGIcon to apply variation-specific token overrides
+ * @position Consumed by SVGIcon to apply variation-specific token overrides
*
* Each variation sets tokens for both fill-role and stroke-role elements
* per the path role system. Stroke-role elements (lines, detail strokes)
diff --git a/packages/lab/src/Sankey/XDSSankeyChart.tsx b/packages/lab/src/Sankey/SankeyChart.tsx
similarity index 90%
rename from packages/lab/src/Sankey/XDSSankeyChart.tsx
rename to packages/lab/src/Sankey/SankeyChart.tsx
index 6e49739a7b..5892fead05 100644
--- a/packages/lab/src/Sankey/XDSSankeyChart.tsx
+++ b/packages/lab/src/Sankey/SankeyChart.tsx
@@ -1,7 +1,7 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSSankeyChart.tsx
+ * @file SankeyChart.tsx
* @output Root Sankey container — computes layout and provides context
* @position Parent component; all Sankey marks are children
*
@@ -18,13 +18,13 @@ import {
} from 'react';
import {SankeyProvider} from './SankeyContext';
import {computeLayout} from './layout';
-import type {SankeyNode, SankeyLink, SankeyColumn} from './types';
+import type {SankeyNodeDatum, SankeyLinkDatum, SankeyColumn} from './types';
-export interface XDSSankeyChartProps {
+export interface SankeyChartProps {
/** Node definitions */
- nodes: SankeyNode[];
+ nodes: SankeyNodeDatum[];
/** Link definitions */
- links: SankeyLink[];
+ links: SankeyLinkDatum[];
/**
* Column definitions. Accepts either:
* - Simple: `string[][]` — arrays of node IDs per column
@@ -42,7 +42,7 @@ export interface XDSSankeyChartProps {
nodeGap?: number;
/**
* Override all node bar colors with a single CSS color.
- * Both XDSSankeyNode and XDSSankeyLabel read this from context
+ * Both SankeyNode and SankeyLabel read this from context
* so labels adapt their text color for contrast.
*/
nodeColor?: string;
@@ -58,8 +58,8 @@ export interface XDSSankeyChartProps {
/** Resolve column count from raw column input or auto-detect from graph */
function resolveColumnCount(
columns: SankeyColumn[] | undefined,
- nodes: SankeyNode[],
- links: SankeyLink[],
+ nodes: SankeyNodeDatum[],
+ links: SankeyLinkDatum[],
): number {
if (columns) {
return columns.length;
@@ -108,7 +108,7 @@ function resolveColumnCount(
*
* @example
* ```tsx
- * <XDSSankeyChart
+ * <SankeyChart
* nodes={nodes}
* links={links}
* columns={[
@@ -116,14 +116,14 @@ function resolveColumnCount(
* {ids: ['c', 'd'], label: 'Target'},
* ]}
* >
- * <XDSSankeyGrid />
- * <XDSSankeyLink />
- * <XDSSankeyNode />
- * <XDSSankeyLabel />
- * </XDSSankeyChart>
+ * <SankeyGrid />
+ * <SankeyLink />
+ * <SankeyNode />
+ * <SankeyLabel />
+ * </SankeyChart>
* ```
*/
-export function XDSSankeyChart({
+export function SankeyChart({
nodes,
links,
columns,
@@ -133,7 +133,7 @@ export function XDSSankeyChart({
nodeColor,
minColumnWidth = 160,
children,
-}: XDSSankeyChartProps) {
+}: SankeyChartProps) {
const containerRef = useRef<HTMLDivElement>(null);
const [containerWidth, setContainerWidth] = useState(0);
@@ -217,4 +217,4 @@ export function XDSSankeyChart({
);
}
-XDSSankeyChart.displayName = 'XDSSankeyChart';
+SankeyChart.displayName = 'SankeyChart';
diff --git a/packages/lab/src/Sankey/SankeyContext.ts b/packages/lab/src/Sankey/SankeyContext.ts
index 3b57ebbac3..c41a2f9501 100644
--- a/packages/lab/src/Sankey/SankeyContext.ts
+++ b/packages/lab/src/Sankey/SankeyContext.ts
@@ -3,7 +3,7 @@
/**
* @file SankeyContext.ts
* @output React context for sharing Sankey layout between components
- * @position Consumed by XDSSankeyChart (provider) and all child components (consumers)
+ * @position Consumed by SankeyChart (provider) and all child components (consumers)
*/
import {createContext, useContext} from 'react';
@@ -13,11 +13,11 @@ const SankeyCtx = createContext<SankeyContext | null>(null);
export const SankeyProvider = SankeyCtx.Provider;
-/** Access the sankey context. Throws if used outside <XDSSankeyChart>. */
+/** Access the sankey context. Throws if used outside <SankeyChart>. */
export function useSankey(): SankeyContext {
const ctx = useContext(SankeyCtx);
if (!ctx) {
- throw new Error('Sankey components must be used inside <XDSSankeyChart>');
+ throw new Error('Sankey components must be used inside <SankeyChart>');
}
return ctx;
}
diff --git a/packages/lab/src/Sankey/XDSSankeyGrid.tsx b/packages/lab/src/Sankey/SankeyGrid.tsx
similarity index 87%
rename from packages/lab/src/Sankey/XDSSankeyGrid.tsx
rename to packages/lab/src/Sankey/SankeyGrid.tsx
index 02bfe38b4a..0bf849051e 100644
--- a/packages/lab/src/Sankey/XDSSankeyGrid.tsx
+++ b/packages/lab/src/Sankey/SankeyGrid.tsx
@@ -1,14 +1,14 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSSankeyGrid.tsx
+ * @file SankeyGrid.tsx
* @output Dashed vertical lines at each column + optional column headers
* @position Visual layer — structural guide behind the flow ribbons
*/
import {useSankey} from './SankeyContext';
-export interface XDSSankeyGridProps {
+export interface SankeyGridProps {
/** Dash pattern (default: "4 4") */
dashArray?: string;
/** Stroke color (default: theme border) */
@@ -22,14 +22,14 @@ export interface XDSSankeyGridProps {
/**
* Vertical grid lines at each column position, with optional column headers.
*
- * Place before XDSSankeyLink so grid renders behind ribbons.
+ * Place before SankeyLink so grid renders behind ribbons.
*/
-export function XDSSankeyGrid({
+export function SankeyGrid({
dashArray = '4 4',
color,
opacity = 0.3,
showHeaders = true,
-}: XDSSankeyGridProps) {
+}: SankeyGridProps) {
const {columns, height, nodeWidth} = useSankey();
return (
@@ -66,4 +66,4 @@ export function XDSSankeyGrid({
);
}
-XDSSankeyGrid.displayName = 'XDSSankeyGrid';
+SankeyGrid.displayName = 'SankeyGrid';
diff --git a/packages/lab/src/Sankey/XDSSankeyLabel.tsx b/packages/lab/src/Sankey/SankeyLabel.tsx
similarity index 95%
rename from packages/lab/src/Sankey/XDSSankeyLabel.tsx
rename to packages/lab/src/Sankey/SankeyLabel.tsx
index 9803e7ff7e..952d5716e7 100644
--- a/packages/lab/src/Sankey/XDSSankeyLabel.tsx
+++ b/packages/lab/src/Sankey/SankeyLabel.tsx
@@ -1,7 +1,7 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSSankeyLabel.tsx
+ * @file SankeyLabel.tsx
* @output Renders node labels — rotated on bar or beside it based on fit
* @position Visual layer — adapts placement for readability at every scale
*
@@ -10,13 +10,13 @@
* - Short nodes: horizontal label beside the bar with surface pill
*
* Last-column labels anchor to the left to avoid clipping at the chart edge.
- * Text on bars uses --color-on-dark/--color-on-light from XDSMediaTheme.
+ * Text on bars uses --color-on-dark/--color-on-light from MediaTheme.
*/
import {useSankey} from './SankeyContext';
import type {SankeyNodeLayout} from './types';
-export interface XDSSankeyLabelProps {
+export interface SankeyLabelProps {
/** Show percentage below the node (default: true) */
showPercent?: boolean;
/** Format function for the value (default: compact notation) */
@@ -59,10 +59,10 @@ function onSurfaceColor(
: 'var(--color-on-light, #000)';
}
-export function XDSSankeyLabel({
+export function SankeyLabel({
showPercent = true,
formatValue = defaultFormat,
-}: XDSSankeyLabelProps) {
+}: SankeyLabelProps) {
const {nodes, columns, maxValue, height, nodeWidth, nodeColor} = useSankey();
const lastColumn = columns.length - 1;
@@ -231,4 +231,4 @@ function BesideLabel({
);
}
-XDSSankeyLabel.displayName = 'XDSSankeyLabel';
+SankeyLabel.displayName = 'SankeyLabel';
diff --git a/packages/lab/src/Sankey/XDSSankeyLink.tsx b/packages/lab/src/Sankey/SankeyLink.tsx
similarity index 95%
rename from packages/lab/src/Sankey/XDSSankeyLink.tsx
rename to packages/lab/src/Sankey/SankeyLink.tsx
index 75e7c9d869..5073a8793e 100644
--- a/packages/lab/src/Sankey/XDSSankeyLink.tsx
+++ b/packages/lab/src/Sankey/SankeyLink.tsx
@@ -1,7 +1,7 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSSankeyLink.tsx
+ * @file SankeyLink.tsx
* @output Renders flow ribbons with configurable color modes
* @position Visual layer — the colorful flowing areas between nodes
*
@@ -27,7 +27,7 @@ export type SankeyLinkColor =
| {gradient: number}
| (string & {});
-export interface XDSSankeyLinkProps {
+export interface SankeyLinkProps {
/** Link coloring mode (default: 'gradient') */
color?: SankeyLinkColor;
/** Opacity of the link fills (default: 0.7) */
@@ -65,13 +65,13 @@ function resolveColor(color: SankeyLinkColor): ResolvedMode {
/**
* Renders all link ribbons in the Sankey chart.
*
- * Place before XDSSankeyNode so nodes render on top.
+ * Place before SankeyNode so nodes render on top.
*/
-export function XDSSankeyLink({
+export function SankeyLink({
color = 'gradient',
opacity = 0.7,
tension = 0.5,
-}: XDSSankeyLinkProps) {
+}: SankeyLinkProps) {
const {links} = useSankey();
const mode = resolveColor(color);
@@ -164,4 +164,4 @@ function GradientDef({
);
}
-XDSSankeyLink.displayName = 'XDSSankeyLink';
+SankeyLink.displayName = 'SankeyLink';
diff --git a/packages/lab/src/Sankey/XDSSankeyNode.tsx b/packages/lab/src/Sankey/SankeyNode.tsx
similarity index 89%
rename from packages/lab/src/Sankey/XDSSankeyNode.tsx
rename to packages/lab/src/Sankey/SankeyNode.tsx
index f2b4e9d637..8f591174c8 100644
--- a/packages/lab/src/Sankey/XDSSankeyNode.tsx
+++ b/packages/lab/src/Sankey/SankeyNode.tsx
@@ -1,7 +1,7 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSSankeyNode.tsx
+ * @file SankeyNode.tsx
* @output Renders node indicators with optional glow
* @position Visual layer — node bars that labels sit on
*
@@ -11,7 +11,7 @@
import {useSankey} from './SankeyContext';
-export interface XDSSankeyNodeProps {
+export interface SankeyNodeProps {
/** Whether to show the glow effect behind nodes (default: true) */
glow?: boolean;
}
@@ -26,7 +26,7 @@ function oklch(c: [number, number, number], alpha: number): string {
* Color comes from the chart's `nodeColor` prop (global override)
* or each node's individual color from data.
*/
-export function XDSSankeyNode({glow = true}: XDSSankeyNodeProps) {
+export function SankeyNode({glow = true}: SankeyNodeProps) {
const {nodes, nodeColor} = useSankey();
return (
@@ -63,4 +63,4 @@ export function XDSSankeyNode({glow = true}: XDSSankeyNodeProps) {
);
}
-XDSSankeyNode.displayName = 'XDSSankeyNode';
+SankeyNode.displayName = 'SankeyNode';
diff --git a/packages/lab/src/Sankey/index.ts b/packages/lab/src/Sankey/index.ts
index aac9a8dec5..683f92490b 100644
--- a/packages/lab/src/Sankey/index.ts
+++ b/packages/lab/src/Sankey/index.ts
@@ -1,18 +1,18 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
-export {XDSSankeyChart, type XDSSankeyChartProps} from './XDSSankeyChart';
+export {SankeyChart, type SankeyChartProps} from './SankeyChart';
export {
- XDSSankeyLink,
- type XDSSankeyLinkProps,
+ SankeyLink,
+ type SankeyLinkProps,
type SankeyLinkColor,
-} from './XDSSankeyLink';
-export {XDSSankeyNode, type XDSSankeyNodeProps} from './XDSSankeyNode';
-export {XDSSankeyLabel, type XDSSankeyLabelProps} from './XDSSankeyLabel';
-export {XDSSankeyGrid, type XDSSankeyGridProps} from './XDSSankeyGrid';
+} from './SankeyLink';
+export {SankeyNode, type SankeyNodeProps} from './SankeyNode';
+export {SankeyLabel, type SankeyLabelProps} from './SankeyLabel';
+export {SankeyGrid, type SankeyGridProps} from './SankeyGrid';
export {useSankey} from './SankeyContext';
export type {
- SankeyNode,
- SankeyLink,
+ SankeyNodeDatum,
+ SankeyLinkDatum,
SankeyColumn,
SankeyColumnDef,
SankeyNodeLayout,
diff --git a/packages/lab/src/Sankey/layout.ts b/packages/lab/src/Sankey/layout.ts
index a26db76f66..a036fb43bb 100644
--- a/packages/lab/src/Sankey/layout.ts
+++ b/packages/lab/src/Sankey/layout.ts
@@ -3,15 +3,15 @@
/**
* @file layout.ts
* @output Pure layout algorithm — computes node and link positions
- * @position Core logic; consumed by XDSSankeyChart during render
+ * @position Core logic; consumed by SankeyChart during render
*
* Accepts columns as either string[][] (simple) or SankeyColumnDef[]
* (with labels). Reserves margin for labels and column headers.
*/
import type {
- SankeyNode,
- SankeyLink,
+ SankeyNodeDatum,
+ SankeyLinkDatum,
SankeyColumn,
SankeyColumnDef,
SankeyNodeLayout,
@@ -45,8 +45,8 @@ function normalizeColumns(cols: SankeyColumn[]): SankeyColumnDef[] {
}
function autoColumns(
- nodes: SankeyNode[],
- links: SankeyLink[],
+ nodes: SankeyNodeDatum[],
+ links: SankeyLinkDatum[],
): SankeyColumnDef[] {
const inDegree = new Map<string, number>();
const outEdges = new Map<string, string[]>();
@@ -103,8 +103,8 @@ export interface LayoutResult {
}
export function computeLayout(
- nodes: SankeyNode[],
- links: SankeyLink[],
+ nodes: SankeyNodeDatum[],
+ links: SankeyLinkDatum[],
options: LayoutOptions,
): LayoutResult {
const {
@@ -122,7 +122,7 @@ export function computeLayout(
const hasHeaders = colDefs.some(c => c.label);
const headerMargin = hasHeaders ? 20 : 0;
- const nodeMap = new Map<string, SankeyNode>();
+ const nodeMap = new Map<string, SankeyNodeDatum>();
nodes.forEach(n => nodeMap.set(n.id, n));
// Usable height after reserving space for labels and headers
diff --git a/packages/lab/src/Sankey/types.ts b/packages/lab/src/Sankey/types.ts
index 88ece02853..122b7e338f 100644
--- a/packages/lab/src/Sankey/types.ts
+++ b/packages/lab/src/Sankey/types.ts
@@ -7,7 +7,7 @@
*/
/** A node in the Sankey diagram */
-export interface SankeyNode {
+export interface SankeyNodeDatum {
/** Unique identifier */
id: string;
/** Display label */
@@ -19,7 +19,7 @@ export interface SankeyNode {
}
/** A link (flow) between two nodes */
-export interface SankeyLink {
+export interface SankeyLinkDatum {
/** Source node ID */
source: string;
/** Target node ID */
@@ -78,7 +78,7 @@ export interface SankeyColumnLayout {
ids: string[];
}
-/** Context provided by XDSSankeyChart to children */
+/** Context provided by SankeyChart to children */
export interface SankeyContext {
nodes: SankeyNodeLayout[];
links: SankeyLinkLayout[];
diff --git a/packages/lab/src/Schedule/CalendarEvent.ts b/packages/lab/src/Schedule/CalendarEvent.ts
index 6d4deaee48..ca09c743a3 100644
--- a/packages/lab/src/Schedule/CalendarEvent.ts
+++ b/packages/lab/src/Schedule/CalendarEvent.ts
@@ -4,7 +4,7 @@
* @file CalendarEvent.ts
* @input ISO event definitions and PlainDate/Instant primitives
* @output Calendar event types and event construction helpers
- * @position Public schedule event model; consumed by XDSSchedule and views
+ * @position Public schedule event model; consumed by Schedule and views
*/
import {
@@ -12,16 +12,16 @@ import {
type ISODateString,
type PlainDate,
} from '@xds/core/utils';
-import type {XDSTokenColor} from '@xds/core/Token';
+import type {TokenColor} from '@xds/core/Token';
import type {Instant} from './types';
const DATE_ONLY_RE = /^\d{4}-\d{2}-\d{2}$/;
-export type XDSScheduleEventColor = Exclude<XDSTokenColor, 'default'>;
+export type ScheduleEventColor = Exclude<TokenColor, 'default'>;
-export interface XDSScheduleCategory {
+export interface ScheduleCategory {
label: string;
- color: XDSScheduleEventColor;
+ color: ScheduleEventColor;
}
export interface CalendarEventBase {
diff --git a/packages/lab/src/Schedule/DayView.tsx b/packages/lab/src/Schedule/DayView.tsx
index 2eb0103fc4..03bb677a1a 100644
--- a/packages/lab/src/Schedule/DayView.tsx
+++ b/packages/lab/src/Schedule/DayView.tsx
@@ -4,9 +4,9 @@
/**
* @file DayView.tsx
- * @input XDSSchedule context and day view options
+ * @input Schedule context and day view options
* @output Single-day time-grid schedule view factory
- * @position Concrete schedule view; exported as createXDSScheduleDayView
+ * @position Concrete schedule view; exported as createScheduleDayView
*/
import {
@@ -15,27 +15,27 @@ import {
plainDateFormat,
} from '@xds/core/utils';
import {enumerateDates, getScheduleRangeFromDates} from './dateMath';
-import {useXDSScheduleContext} from './context';
+import {useScheduleContext} from './context';
import {ScheduleMonthTitle, ScheduleFrame} from './shared';
import {TimeGridView} from './TimeGridView';
import {scheduleRangeToZonedDateTimeRange} from './zonedDateTime';
import type {
PlainDate,
- XDSScheduleView,
- XDSScheduleViewComponentProps,
+ ScheduleView,
+ ScheduleViewComponentProps,
} from './types';
-export interface XDSScheduleDayViewOptions {
+export interface ScheduleDayViewOptions {
minHour?: number;
maxHour?: number;
hourHeight?: number;
}
-function XDSScheduleDayView({
+function ScheduleDayView({
options,
-}: XDSScheduleViewComponentProps<XDSScheduleDayViewOptions>) {
+}: ScheduleViewComponentProps<ScheduleDayViewOptions>) {
const {events, date, focusDate, timezoneID, range, isLoading} =
- useXDSScheduleContext();
+ useScheduleContext();
const {minHour = 0, maxHour = 24, hourHeight = 100} = options;
const rangeDate = date.toPlainDate();
const days = enumerateDates(range.startDate, range.endDate);
@@ -59,13 +59,13 @@ function XDSScheduleDayView({
);
}
-export function createXDSScheduleDayView({
+export function createScheduleDayView({
minHour = 0,
maxHour = 24,
hourHeight = 100,
-}: XDSScheduleDayViewOptions = {}): XDSScheduleView<XDSScheduleDayViewOptions> {
+}: ScheduleDayViewOptions = {}): ScheduleView<ScheduleDayViewOptions> {
return {
- component: XDSScheduleDayView,
+ component: ScheduleDayView,
options: {minHour, maxHour, hourHeight},
getDateRange: date => {
const range = getDayDateRange({
diff --git a/packages/lab/src/Schedule/ListView.tsx b/packages/lab/src/Schedule/ListView.tsx
index d53ea52940..0eb0ce4cc9 100644
--- a/packages/lab/src/Schedule/ListView.tsx
+++ b/packages/lab/src/Schedule/ListView.tsx
@@ -4,9 +4,9 @@
/**
* @file ListView.tsx
- * @input XDSSchedule context and list view options
+ * @input Schedule context and list view options
* @output Event-list schedule view factory
- * @position Concrete schedule view; exported as createXDSScheduleListView
+ * @position Concrete schedule view; exported as createScheduleListView
*/
import * as stylex from '@stylexjs/stylex';
@@ -17,14 +17,14 @@ import {
plainDateToISO,
type PlainDate,
} from '@xds/core/utils';
-import {XDSHeading} from '@xds/core/Text';
+import {Heading} from '@xds/core/Text';
import {
enumerateDates,
eventOccursOnDate,
getScheduleRangeFromDates,
isDayEvent,
} from './dateMath';
-import {useXDSScheduleContext} from './context';
+import {useScheduleContext} from './context';
import {
formatDayNumber,
formatFullDate,
@@ -41,18 +41,18 @@ import {scheduleRangeToZonedDateTimeRange} from './zonedDateTime';
import type {
CalendarEvent,
Instant,
- XDSScheduleView,
- XDSScheduleViewComponentProps,
+ ScheduleView,
+ ScheduleViewComponentProps,
} from './types';
-export interface XDSScheduleListViewOptions {
+export interface ScheduleListViewOptions {
days?: number;
}
-function XDSScheduleListView(
- _props: XDSScheduleViewComponentProps<XDSScheduleListViewOptions>,
+function ScheduleListView(
+ _props: ScheduleViewComponentProps<ScheduleListViewOptions>,
) {
- const {events, timezoneID, range, isLoading} = useXDSScheduleContext();
+ const {events, timezoneID, range, isLoading} = useScheduleContext();
const days = enumerateDates(range.startDate, range.endDate);
const currentTime = useCurrentTime();
const currentPlainDate = plainDateFromInstant(currentTime, timezoneID);
@@ -123,7 +123,7 @@ function ListDayHeading({
timezoneID: string;
}) {
return (
- <XDSHeading
+ <Heading
level={4}
color="secondary"
display="block"
@@ -140,7 +140,7 @@ function ListDayHeading({
</span>
</span>
{formatWeekday(day, timezoneID, 'short')}
- </XDSHeading>
+ </Heading>
);
}
@@ -180,11 +180,11 @@ function renderListRows({
return [...rows.slice(0, insertIndex), marker, ...rows.slice(insertIndex)];
}
-export function createXDSScheduleListView({
+export function createScheduleListView({
days: listDays = 7,
-}: XDSScheduleListViewOptions = {}): XDSScheduleView<XDSScheduleListViewOptions> {
+}: ScheduleListViewOptions = {}): ScheduleView<ScheduleListViewOptions> {
return {
- component: XDSScheduleListView,
+ component: ScheduleListView,
options: {days: listDays},
getDateRange: date => {
const range = getListDateRange({
diff --git a/packages/lab/src/Schedule/MonthlyView.tsx b/packages/lab/src/Schedule/MonthlyView.tsx
index 0bc0cac152..ed5eaa4b3c 100644
--- a/packages/lab/src/Schedule/MonthlyView.tsx
+++ b/packages/lab/src/Schedule/MonthlyView.tsx
@@ -4,9 +4,9 @@
/**
* @file MonthlyView.tsx
- * @input XDSSchedule context and monthly view options
+ * @input Schedule context and monthly view options
* @output Month grid schedule view factory
- * @position Concrete schedule view; exported as createXDSScheduleMonthlyView
+ * @position Concrete schedule view; exported as createScheduleMonthlyView
*/
import * as stylex from '@stylexjs/stylex';
@@ -23,13 +23,13 @@ import {
plainDateToISO,
type PlainDate,
} from '@xds/core/utils';
-import {XDSHeading, XDSText} from '@xds/core/Text';
+import {Heading, Text} from '@xds/core/Text';
import {
enumerateDates,
getScheduleRangeFromDates,
isDayEvent,
} from './dateMath';
-import {useXDSScheduleContext} from './context';
+import {useScheduleContext} from './context';
import {
formatDayNumber,
formatEventAccessibilityLabel,
@@ -46,19 +46,19 @@ import {useCurrentTime} from './useCurrentTime';
import {scheduleRangeToZonedDateTimeRange} from './zonedDateTime';
import type {
CalendarEvent,
- XDSScheduleView,
- XDSScheduleViewComponentProps,
+ ScheduleView,
+ ScheduleViewComponentProps,
} from './types';
-export interface XDSScheduleMonthlyViewOptions {
+export interface ScheduleMonthlyViewOptions {
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
}
-function XDSScheduleMonthlyView(
- _props: XDSScheduleViewComponentProps<XDSScheduleMonthlyViewOptions>,
+function ScheduleMonthlyView(
+ _props: ScheduleViewComponentProps<ScheduleMonthlyViewOptions>,
) {
const {events, categories, date, focusDate, timezoneID, range, isLoading} =
- useXDSScheduleContext();
+ useScheduleContext();
const rangeDate = date.toPlainDate();
const highlightedDate = focusDate.toPlainDate();
const currentTime = useCurrentTime();
@@ -85,13 +85,13 @@ function XDSScheduleMonthlyView(
aria-label={formatWeekday(day, timezoneID, 'long')}
aria-colindex={index + 1}
{...stylex.props(styles.weekdayLabel)}>
- <XDSHeading
+ <Heading
level={4}
color="secondary"
display="block"
xstyle={styles.weekdayHeading}>
{formatWeekday(day, timezoneID, 'short')}
- </XDSHeading>
+ </Heading>
</div>
))}
</div>
@@ -130,13 +130,13 @@ function XDSScheduleMonthlyView(
plainDateIsEqual(day, highlightedDate) &&
styles.currentDayPill,
)}>
- <XDSText
+ <Text
type="supporting"
color="inherit"
weight="medium"
hasTabularNumbers>
{formatDayNumber(day, timezoneID)}
- </XDSText>
+ </Text>
</div>
{dayEvents.length > 0 && (
<ul {...stylex.props(styles.visuallyHidden)}>
@@ -340,11 +340,11 @@ function getAvailableLevel(levels: number[], columnStart: number): number {
return level >= 0 ? level : levels.length;
}
-export function createXDSScheduleMonthlyView({
+export function createScheduleMonthlyView({
weekStartsOn = 0,
-}: XDSScheduleMonthlyViewOptions = {}): XDSScheduleView<XDSScheduleMonthlyViewOptions> {
+}: ScheduleMonthlyViewOptions = {}): ScheduleView<ScheduleMonthlyViewOptions> {
return {
- component: XDSScheduleMonthlyView,
+ component: ScheduleMonthlyView,
options: {weekStartsOn},
getDateRange: date => {
const range = getMonthDateRange({
diff --git a/packages/lab/src/Schedule/XDSSchedule.test.tsx b/packages/lab/src/Schedule/Schedule.test.tsx
similarity index 87%
rename from packages/lab/src/Schedule/XDSSchedule.test.tsx
rename to packages/lab/src/Schedule/Schedule.test.tsx
index d4b34e222b..2e1249101e 100644
--- a/packages/lab/src/Schedule/XDSSchedule.test.tsx
+++ b/packages/lab/src/Schedule/Schedule.test.tsx
@@ -2,18 +2,18 @@
import {fireEvent, render, screen, waitFor} from '@testing-library/react';
import {createEventFromISO} from './CalendarEvent';
-import {XDSSchedule} from './XDSSchedule';
-import {createXDSScheduleDayView} from './DayView';
-import {createXDSScheduleListView} from './ListView';
-import {createXDSScheduleMonthlyView} from './MonthlyView';
-import {createXDSScheduleWeeklyView} from './WeeklyView';
+import {Schedule} from './Schedule';
+import {createScheduleDayView} from './DayView';
+import {createScheduleListView} from './ListView';
+import {createScheduleMonthlyView} from './MonthlyView';
+import {createScheduleWeeklyView} from './WeeklyView';
import {sortEvents} from './dateMath';
-import {useXDSScheduleViewSelectorPlugin} from './plugins/ViewSelectorPlugin';
+import {useScheduleViewSelectorPlugin} from './plugins/ViewSelectorPlugin';
import type {
CalendarEvent,
Instant,
- XDSScheduleCategory,
- XDSSchedulePlugin,
+ ScheduleCategory,
+ SchedulePlugin,
} from './types';
describe('createEventFromISO', () => {
@@ -48,8 +48,8 @@ describe('createEventFromISO', () => {
});
});
-describe('XDSSchedule', () => {
- const categories: XDSScheduleCategory[] = [
+describe('Schedule', () => {
+ const categories: ScheduleCategory[] = [
{label: 'Sync', color: 'blue'},
{label: 'Design', color: 'purple'},
{label: 'Blocked', color: 'red'},
@@ -81,8 +81,8 @@ describe('XDSSchedule', () => {
it('filters array events to the active view range', async () => {
render(
- <XDSSchedule
- view={createXDSScheduleMonthlyView()}
+ <Schedule
+ view={createScheduleMonthlyView()}
events={events}
categories={categories}
date={Date.UTC(2026, 4, 13)}
@@ -112,8 +112,8 @@ describe('XDSSchedule', () => {
);
render(
- <XDSSchedule
- view={createXDSScheduleDayView()}
+ <Schedule
+ view={createScheduleDayView()}
events={loader}
categories={categories}
date={Date.UTC(2026, 4, 13)}
@@ -143,8 +143,8 @@ describe('XDSSchedule', () => {
];
render(
- <XDSSchedule
- view={createXDSScheduleListView({days: 7})}
+ <Schedule
+ view={createScheduleListView({days: 7})}
events={listEvents}
categories={categories}
date={Date.UTC(2026, 4, 13)}
@@ -163,8 +163,8 @@ describe('XDSSchedule', () => {
it('renders weekly view with the same month title as monthly view', () => {
render(
- <XDSSchedule
- view={createXDSScheduleWeeklyView()}
+ <Schedule
+ view={createScheduleWeeklyView()}
events={events}
categories={categories}
date={Date.UTC(2026, 4, 13)}
@@ -178,8 +178,8 @@ describe('XDSSchedule', () => {
it('exposes monthly view as an ARIA grid', () => {
render(
- <XDSSchedule
- view={createXDSScheduleMonthlyView()}
+ <Schedule
+ view={createScheduleMonthlyView()}
events={events}
categories={categories}
date={Date.UTC(2026, 4, 13)}
@@ -211,8 +211,8 @@ describe('XDSSchedule', () => {
it('exposes time grid views as ARIA grids', () => {
render(
- <XDSSchedule
- view={createXDSScheduleDayView({minHour: 8, maxHour: 10})}
+ <Schedule
+ view={createScheduleDayView({minHour: 8, maxHour: 10})}
events={events}
categories={categories}
date={Date.UTC(2026, 4, 13)}
@@ -245,8 +245,8 @@ describe('XDSSchedule', () => {
it('exposes timed events in the accessible time grid cells', () => {
render(
- <XDSSchedule
- view={createXDSScheduleDayView({minHour: 16, maxHour: 17})}
+ <Schedule
+ view={createScheduleDayView({minHour: 16, maxHour: 17})}
events={events}
categories={categories}
date={Date.UTC(2026, 4, 13)}
@@ -263,8 +263,8 @@ describe('XDSSchedule', () => {
it('exposes all-day events in the accessible time grid cells', () => {
render(
- <XDSSchedule
- view={createXDSScheduleDayView({minHour: 8, maxHour: 10})}
+ <Schedule
+ view={createScheduleDayView({minHour: 8, maxHour: 10})}
events={events}
categories={categories}
date={Date.UTC(2026, 4, 13)}
@@ -281,8 +281,8 @@ describe('XDSSchedule', () => {
it('labels list day headings with the full date', () => {
render(
- <XDSSchedule
- view={createXDSScheduleListView({days: 7})}
+ <Schedule
+ view={createScheduleListView({days: 7})}
events={events}
categories={categories}
date={Date.UTC(2026, 4, 13)}
@@ -298,8 +298,8 @@ describe('XDSSchedule', () => {
it('calls onChangeDate with the previous view date preserving time of day', () => {
const onChangeDate = vi.fn();
render(
- <XDSSchedule
- view={createXDSScheduleDayView()}
+ <Schedule
+ view={createScheduleDayView()}
events={events}
categories={categories}
date={Date.UTC(2026, 4, 13, 15, 6) as Instant}
@@ -313,7 +313,7 @@ describe('XDSSchedule', () => {
});
it('allows plugins to customize header slots', () => {
- const plugin: XDSSchedulePlugin = {
+ const plugin: SchedulePlugin = {
renderHeader: (_startContent, centerContent, endContent) => ({
startContent: <span>Custom start</span>,
centerContent,
@@ -322,8 +322,8 @@ describe('XDSSchedule', () => {
};
render(
- <XDSSchedule
- view={createXDSScheduleDayView()}
+ <Schedule
+ view={createScheduleDayView()}
events={events}
categories={categories}
date={Date.UTC(2026, 4, 13) as Instant}
@@ -340,19 +340,19 @@ describe('XDSSchedule', () => {
it('renders a view selector plugin in the header end slot', () => {
const onChangeView = vi.fn();
- const dayView = createXDSScheduleDayView();
- const monthView = createXDSScheduleMonthlyView();
+ const dayView = createScheduleDayView();
+ const monthView = createScheduleMonthlyView();
const viewOptions = [
{view: monthView, label: 'Month'},
{view: dayView, label: 'Day'},
];
function ScheduleWithViewSelector() {
- const viewSelectorPlugin = useXDSScheduleViewSelectorPlugin(viewOptions, {
+ const viewSelectorPlugin = useScheduleViewSelectorPlugin(viewOptions, {
onChangeView,
});
return (
- <XDSSchedule
+ <Schedule
view={dayView}
events={events}
categories={categories}
diff --git a/packages/lab/src/Schedule/XDSSchedule.tsx b/packages/lab/src/Schedule/Schedule.tsx
similarity index 85%
rename from packages/lab/src/Schedule/XDSSchedule.tsx
rename to packages/lab/src/Schedule/Schedule.tsx
index bbcfd41d22..c838157407 100644
--- a/packages/lab/src/Schedule/XDSSchedule.tsx
+++ b/packages/lab/src/Schedule/Schedule.tsx
@@ -3,14 +3,14 @@
'use client';
/**
- * @file XDSSchedule.tsx
+ * @file Schedule.tsx
* @input Calendar events, event loader functions, view objects, date/focusDate/timezone props
* @output Generic read-only schedule shell that renders arbitrary schedule views
* @position Lab component shell; concrete views live in separate view files
*
* SYNC: When modified, update these files to stay in sync:
* - /packages/lab/src/Schedule/index.ts
- * - /packages/lab/src/Schedule/XDSSchedule.test.tsx
+ * - /packages/lab/src/Schedule/Schedule.test.tsx
* - /apps/storybook/stories/Schedule.stories.tsx
*/
@@ -19,8 +19,8 @@ import * as stylex from '@stylexjs/stylex';
import type {BaseProps} from '@xds/core';
import {mergeProps, plainDateFromInstant} from '@xds/core/utils';
import {eventOverlapsRange, getBrowserTimezoneID, sortEvents} from './dateMath';
-import {XDSScheduleContext} from './context';
-import {defaultXDSSchedulePlugins} from './plugins';
+import {ScheduleContext} from './context';
+import {defaultSchedulePlugins} from './plugins';
import {styles} from './shared';
import {createZonedDateTime} from './zonedDateTime';
import {xdsThemeProps} from '../../../core/src/utils/xdsThemeProps';
@@ -28,24 +28,24 @@ import type {
CalendarEvent,
Instant,
ScheduleRange,
- XDSScheduleCategory,
- XDSScheduleEventSource,
- XDSSchedulePlugin,
- XDSScheduleView,
- XDSScheduleViewOptions,
+ ScheduleCategory,
+ ScheduleEventSource,
+ SchedulePlugin,
+ ScheduleView,
+ ScheduleViewOptions,
ZonedDateTime,
ZonedDateTimeRange,
} from './types';
-export interface XDSScheduleProps<
- Options extends XDSScheduleViewOptions = XDSScheduleViewOptions,
+export interface ScheduleProps<
+ Options extends ScheduleViewOptions = ScheduleViewOptions,
> extends BaseProps<HTMLDivElement> {
- /** View object returned by a `createXDSSchedule*View()` factory. */
- view: XDSScheduleView<Options>;
+ /** View object returned by a `createSchedule*View()` factory. */
+ view: ScheduleView<Options>;
/** Static calendar events or an async loader called with the active Instant range. */
- events: XDSScheduleEventSource;
+ events: ScheduleEventSource;
/** Category definitions used to style and label events by their `category` value. */
- categories?: ReadonlyArray<XDSScheduleCategory>;
+ categories?: ReadonlyArray<ScheduleCategory>;
/** Focused Instant used to choose the currently rendered range. */
date: Instant;
/** Instant highlighted as the user's focus/current date. Defaults to mount time. */
@@ -55,7 +55,7 @@ export interface XDSScheduleProps<
/** IANA timezone ID used for date math and localized rendering. Defaults to browser timezone. */
timezoneID?: string;
/** Header/rendering plugins. Defaults to pagination controls. */
- plugins?: ReadonlyArray<XDSSchedulePlugin>;
+ plugins?: ReadonlyArray<SchedulePlugin>;
}
interface EventRecord {
@@ -66,12 +66,12 @@ interface EventRecord {
}
const eventLoaderCache = new WeakMap<
- Exclude<XDSScheduleEventSource, ReadonlyArray<CalendarEvent>>,
+ Exclude<ScheduleEventSource, ReadonlyArray<CalendarEvent>>,
Map<string, EventRecord>
>();
function readAsyncEvents(
- loader: Exclude<XDSScheduleEventSource, ReadonlyArray<CalendarEvent>>,
+ loader: Exclude<ScheduleEventSource, ReadonlyArray<CalendarEvent>>,
start: Instant,
end: Instant,
): ReadonlyArray<CalendarEvent> {
@@ -118,7 +118,7 @@ function readAsyncEvents(
}
function resolveEvents(
- eventSource: XDSScheduleEventSource,
+ eventSource: ScheduleEventSource,
range: ScheduleRange,
timezoneID: string,
): ReadonlyArray<CalendarEvent> {
@@ -132,8 +132,8 @@ function resolveEvents(
);
}
-function getRange<Options extends XDSScheduleViewOptions>(
- view: XDSScheduleView<Options>,
+function getRange<Options extends ScheduleViewOptions>(
+ view: ScheduleView<Options>,
date: ZonedDateTime,
): ScheduleRange {
const [start, end] = view.getDateRange(date);
@@ -145,7 +145,7 @@ function getRange<Options extends XDSScheduleViewOptions>(
};
}
-function ScheduleViewContent<Options extends XDSScheduleViewOptions>({
+function ScheduleViewContent<Options extends ScheduleViewOptions>({
view,
eventSource,
categories,
@@ -159,9 +159,9 @@ function ScheduleViewContent<Options extends XDSScheduleViewOptions>({
nextDateLabel,
plugins,
}: {
- view: XDSScheduleView<Options>;
- eventSource: XDSScheduleEventSource;
- categories: ReadonlyArray<XDSScheduleCategory>;
+ view: ScheduleView<Options>;
+ eventSource: ScheduleEventSource;
+ categories: ReadonlyArray<ScheduleCategory>;
date: ZonedDateTime;
focusDate: ZonedDateTime;
isLoading: boolean;
@@ -170,7 +170,7 @@ function ScheduleViewContent<Options extends XDSScheduleViewOptions>({
onToday: () => void;
onNextDate: () => void;
nextDateLabel: string;
- plugins: ReadonlyArray<XDSSchedulePlugin>;
+ plugins: ReadonlyArray<SchedulePlugin>;
}) {
const Component = view.component;
const range = getRange(view, date);
@@ -179,7 +179,7 @@ function ScheduleViewContent<Options extends XDSScheduleViewOptions>({
: resolveEvents(eventSource, range, date.timezoneID);
return (
- <XDSScheduleContext.Provider
+ <ScheduleContext.Provider
value={{
events,
categories,
@@ -197,11 +197,11 @@ function ScheduleViewContent<Options extends XDSScheduleViewOptions>({
plugins,
}}>
<Component options={view.options} />
- </XDSScheduleContext.Provider>
+ </ScheduleContext.Provider>
);
}
-export function XDSSchedule({
+export function Schedule({
view,
events,
categories = [],
@@ -209,12 +209,12 @@ export function XDSSchedule({
focusDate: focusDateProp,
onChangeDate,
timezoneID: timezoneIDProp,
- plugins = defaultXDSSchedulePlugins,
+ plugins = defaultSchedulePlugins,
xstyle,
className,
style,
...rest
-}: XDSScheduleProps) {
+}: ScheduleProps) {
const timezoneID = timezoneIDProp ?? getBrowserTimezoneID();
const [internalFocusDate] = useState<Instant>(() => Date.now() as Instant);
const focusDate = focusDateProp ?? internalFocusDate;
diff --git a/packages/lab/src/Schedule/TimeGridView.tsx b/packages/lab/src/Schedule/TimeGridView.tsx
index e62b2e81e0..ff66fa4516 100644
--- a/packages/lab/src/Schedule/TimeGridView.tsx
+++ b/packages/lab/src/Schedule/TimeGridView.tsx
@@ -19,8 +19,8 @@ import {
plainDateToISO,
type PlainDate,
} from '@xds/core/utils';
-import {XDSHeading, XDSText} from '@xds/core/Text';
-import {useXDSScheduleContext} from './context';
+import {Heading, Text} from '@xds/core/Text';
+import {useScheduleContext} from './context';
import {eventOccursOnDate, isDayEvent} from './dateMath';
import {
clamp,
@@ -45,7 +45,7 @@ import type {
CalendarDayEvent,
CalendarEvent,
CalendarInstantEvent,
- XDSScheduleCategory,
+ ScheduleCategory,
} from './types';
export function TimeGridView({
@@ -65,7 +65,7 @@ export function TimeGridView({
maxHour: number;
hourHeight: number;
}) {
- const {categories} = useXDSScheduleContext();
+ const {categories} = useScheduleContext();
const normalizedMinHour = Math.max(0, Math.min(23, Math.floor(minHour)));
const normalizedMaxHour = Math.max(
normalizedMinHour + 1,
@@ -113,7 +113,7 @@ export function TimeGridView({
styles.timeGridHeaderCell,
index === days.length - 1 && styles.timeGridHeaderCellLast,
)}>
- <XDSHeading
+ <Heading
level={4}
color="secondary"
display="block"
@@ -129,14 +129,14 @@ export function TimeGridView({
{formatDayNumber(day, timezoneID)}
</span>
</span>
- </XDSHeading>
+ </Heading>
</div>
))}
</div>
<div {...stylex.props(styles.allDayLabel)}>
- <XDSText type="supporting" color="secondary" weight="bold">
+ <Text type="supporting" color="secondary" weight="bold">
{timezoneLabel}
- </XDSText>
+ </Text>
</div>
<div {...stylex.props(styles.allDayRow)}>
<div
@@ -242,19 +242,19 @@ export function TimeGridView({
? eventPastSurfaceColorStyle(category.color)
: eventSurfaceColorStyle(category.color),
)}>
- <XDSText
+ <Text
type="supporting"
color="inherit"
weight="bold"
xstyle={styles.eventTitle}>
{event.title}
- </XDSText>
- <XDSText
+ </Text>
+ <Text
type="supporting"
color="inherit"
xstyle={styles.eventTime}>
{timeLabel}
- </XDSText>
+ </Text>
</div>
);
})}
@@ -288,7 +288,7 @@ function TimeGridAccessibilityGrid({
timezoneLabel,
}: {
allDayEvents: ReadonlyArray<CalendarDayEvent>;
- categories: ReadonlyArray<XDSScheduleCategory>;
+ categories: ReadonlyArray<ScheduleCategory>;
days: ReadonlyArray<PlainDate>;
events: ReadonlyArray<CalendarInstantEvent>;
focusDate: PlainDate;
@@ -381,7 +381,7 @@ function formatTimeGridAccessibilityCellLabel({
label,
timezoneID,
}: {
- categories: ReadonlyArray<XDSScheduleCategory>;
+ categories: ReadonlyArray<ScheduleCategory>;
day: PlainDate;
events: ReadonlyArray<CalendarEvent>;
label: string;
diff --git a/packages/lab/src/Schedule/WeeklyView.tsx b/packages/lab/src/Schedule/WeeklyView.tsx
index 05cf2614c8..438ba39ae8 100644
--- a/packages/lab/src/Schedule/WeeklyView.tsx
+++ b/packages/lab/src/Schedule/WeeklyView.tsx
@@ -4,14 +4,14 @@
/**
* @file WeeklyView.tsx
- * @input XDSSchedule context and weekly view options
+ * @input Schedule context and weekly view options
* @output Week time-grid schedule view factory
- * @position Concrete schedule view; exported as createXDSScheduleWeeklyView
+ * @position Concrete schedule view; exported as createScheduleWeeklyView
*/
import {plainDateAddDays, plainDateSetStartOfWeek} from '@xds/core/utils';
import {enumerateDates, getScheduleRangeFromDates} from './dateMath';
-import {useXDSScheduleContext} from './context';
+import {useScheduleContext} from './context';
import {
formatWeekTitle,
ScheduleFrame,
@@ -21,22 +21,22 @@ import {TimeGridView} from './TimeGridView';
import {scheduleRangeToZonedDateTimeRange} from './zonedDateTime';
import type {
PlainDate,
- XDSScheduleView,
- XDSScheduleViewComponentProps,
+ ScheduleView,
+ ScheduleViewComponentProps,
} from './types';
-export interface XDSScheduleWeeklyViewOptions {
+export interface ScheduleWeeklyViewOptions {
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
minHour?: number;
maxHour?: number;
hourHeight?: number;
}
-function XDSScheduleWeeklyView({
+function ScheduleWeeklyView({
options,
-}: XDSScheduleViewComponentProps<XDSScheduleWeeklyViewOptions>) {
+}: ScheduleViewComponentProps<ScheduleWeeklyViewOptions>) {
const {events, focusDate, timezoneID, range, isLoading} =
- useXDSScheduleContext();
+ useScheduleContext();
const {minHour = 0, maxHour = 24, hourHeight = 100} = options;
const days = enumerateDates(range.startDate, range.endDate);
const highlightedDate = focusDate.toPlainDate();
@@ -70,14 +70,14 @@ function XDSScheduleWeeklyView({
);
}
-export function createXDSScheduleWeeklyView({
+export function createScheduleWeeklyView({
weekStartsOn = 0,
minHour = 0,
maxHour = 24,
hourHeight = 100,
-}: XDSScheduleWeeklyViewOptions = {}): XDSScheduleView<XDSScheduleWeeklyViewOptions> {
+}: ScheduleWeeklyViewOptions = {}): ScheduleView<ScheduleWeeklyViewOptions> {
return {
- component: XDSScheduleWeeklyView,
+ component: ScheduleWeeklyView,
options: {weekStartsOn, minHour, maxHour, hourHeight},
getDateRange: date => {
const range = getWeekDateRange({
diff --git a/packages/lab/src/Schedule/context.tsx b/packages/lab/src/Schedule/context.tsx
index 92320407e9..1e886498d0 100644
--- a/packages/lab/src/Schedule/context.tsx
+++ b/packages/lab/src/Schedule/context.tsx
@@ -4,9 +4,9 @@
/**
* @file context.tsx
- * @input Resolved XDSSchedule events, range, timezone, and active date
+ * @input Resolved Schedule events, range, timezone, and active date
* @output Schedule context object and hook used by view components
- * @position Internal context bridge between generic XDSSchedule and concrete views
+ * @position Internal context bridge between generic Schedule and concrete views
*/
import {createContext, useContext} from 'react';
@@ -14,14 +14,14 @@ import type {
CalendarEvent,
ScheduleRange,
ZonedDateTime,
- XDSScheduleCategory,
- XDSSchedulePlugin,
- XDSScheduleViewBase,
+ ScheduleCategory,
+ SchedulePlugin,
+ ScheduleViewBase,
} from './types';
-export interface XDSScheduleContextValue {
+export interface ScheduleContextValue {
events: ReadonlyArray<CalendarEvent>;
- categories: ReadonlyArray<XDSScheduleCategory>;
+ categories: ReadonlyArray<ScheduleCategory>;
date: ZonedDateTime;
focusDate: ZonedDateTime;
timezoneID: string;
@@ -32,18 +32,18 @@ export interface XDSScheduleContextValue {
onToday: () => void;
onNextDate: () => void;
nextDateLabel: string;
- view: XDSScheduleViewBase;
- plugins: ReadonlyArray<XDSSchedulePlugin>;
+ view: ScheduleViewBase;
+ plugins: ReadonlyArray<SchedulePlugin>;
}
-export const XDSScheduleContext = createContext<XDSScheduleContextValue | null>(
+export const ScheduleContext = createContext<ScheduleContextValue | null>(
null,
);
-export function useXDSScheduleContext(): XDSScheduleContextValue {
- const context = useContext(XDSScheduleContext);
+export function useScheduleContext(): ScheduleContextValue {
+ const context = useContext(ScheduleContext);
if (context == null) {
- throw new Error('XDSSchedule views must be rendered inside XDSSchedule.');
+ throw new Error('Schedule views must be rendered inside Schedule.');
}
return context;
}
diff --git a/packages/lab/src/Schedule/dateMath.ts b/packages/lab/src/Schedule/dateMath.ts
index e11147b9b8..54039e7993 100644
--- a/packages/lab/src/Schedule/dateMath.ts
+++ b/packages/lab/src/Schedule/dateMath.ts
@@ -4,7 +4,7 @@
* @file dateMath.ts
* @input PlainDate records, Instant epoch milliseconds, IANA timezone IDs
* @output Pure range, conversion, formatting, and event-overlap utilities
- * @position Shared schedule utility layer; consumed by XDSSchedule and tests
+ * @position Shared schedule utility layer; consumed by Schedule and tests
*/
import {
diff --git a/packages/lab/src/Schedule/index.ts b/packages/lab/src/Schedule/index.ts
index 832cb6f12d..db76430c36 100644
--- a/packages/lab/src/Schedule/index.ts
+++ b/packages/lab/src/Schedule/index.ts
@@ -2,40 +2,40 @@
/**
* @file index.ts
- * @input XDSSchedule implementation and public schedule types
+ * @input Schedule implementation and public schedule types
* @output Public exports for @xds/lab Schedule
* @position Component entry point; re-exported by packages/lab/src/index.ts
*/
-export {XDSSchedule, type XDSScheduleProps} from './XDSSchedule';
+export {Schedule, type ScheduleProps} from './Schedule';
export {createEventFromISO} from './CalendarEvent';
export {
- createXDSScheduleMonthlyView,
- type XDSScheduleMonthlyViewOptions,
+ createScheduleMonthlyView,
+ type ScheduleMonthlyViewOptions,
} from './MonthlyView';
export {
- createXDSScheduleWeeklyView,
- type XDSScheduleWeeklyViewOptions,
+ createScheduleWeeklyView,
+ type ScheduleWeeklyViewOptions,
} from './WeeklyView';
export {
- createXDSScheduleDayView,
- type XDSScheduleDayViewOptions,
+ createScheduleDayView,
+ type ScheduleDayViewOptions,
} from './DayView';
export {
- createXDSScheduleListView,
- type XDSScheduleListViewOptions,
+ createScheduleListView,
+ type ScheduleListViewOptions,
} from './ListView';
-export {XDSScheduleContext, useXDSScheduleContext} from './context';
+export {ScheduleContext, useScheduleContext} from './context';
export {
- defaultXDSSchedulePlugins,
- useXDSSchedulePaginationPlugin,
- useXDSScheduleViewSelectorPlugin,
+ defaultSchedulePlugins,
+ useSchedulePaginationPlugin,
+ useScheduleViewSelectorPlugin,
} from './plugins';
-export type {XDSScheduleContextValue} from './context';
-export type {XDSSchedulePaginationPluginOptions} from './plugins/PaginationPlugin';
+export type {ScheduleContextValue} from './context';
+export type {SchedulePaginationPluginOptions} from './plugins/PaginationPlugin';
export type {
- XDSScheduleViewSelectorOption,
- XDSScheduleViewSelectorPluginOptions,
+ ScheduleViewSelectorOption,
+ ScheduleViewSelectorPluginOptions,
} from './plugins/ViewSelectorPlugin';
export type {
@@ -48,14 +48,14 @@ export type {
ScheduleRange,
ZonedDateTime,
ZonedDateTimeRange,
- XDSScheduleCategory,
- XDSScheduleDate,
- XDSScheduleEventColor,
- XDSScheduleEventSource,
- XDSScheduleHeaderContent,
- XDSSchedulePlugin,
- XDSSchedulePluginPosition,
- XDSScheduleView,
- XDSScheduleViewBase,
- XDSScheduleViewOptions,
+ ScheduleCategory,
+ ScheduleDate,
+ ScheduleEventColor,
+ ScheduleEventSource,
+ ScheduleHeaderContent,
+ SchedulePlugin,
+ SchedulePluginPosition,
+ ScheduleView,
+ ScheduleViewBase,
+ ScheduleViewOptions,
} from './types';
diff --git a/packages/lab/src/Schedule/plugins/PaginationPlugin.tsx b/packages/lab/src/Schedule/plugins/PaginationPlugin.tsx
index 177f97e59d..5d0aa188cd 100644
--- a/packages/lab/src/Schedule/plugins/PaginationPlugin.tsx
+++ b/packages/lab/src/Schedule/plugins/PaginationPlugin.tsx
@@ -4,62 +4,62 @@
/**
* @file PaginationPlugin.tsx
- * @input Schedule date navigation callbacks from XDSSchedule context
+ * @input Schedule date navigation callbacks from Schedule context
* @output Hook and default plugin that render previous, today, and next controls
- * @position Built-in XDSSchedule plugin; re-exported from plugins.tsx
+ * @position Built-in Schedule plugin; re-exported from plugins.tsx
*/
import {useMemo, type ReactNode} from 'react';
-import {XDSButton} from '@xds/core/Button';
-import {XDSButtonGroup} from '@xds/core/ButtonGroup';
-import {XDSIcon} from '@xds/core/Icon';
-import {XDSIconButton} from '@xds/core/IconButton';
-import {useXDSScheduleContext} from '../context';
+import {Button} from '@xds/core/Button';
+import {ButtonGroup} from '@xds/core/ButtonGroup';
+import {Icon} from '@xds/core/Icon';
+import {IconButton} from '@xds/core/IconButton';
+import {useScheduleContext} from '../context';
import type {
- XDSScheduleHeaderContent,
- XDSSchedulePlugin,
- XDSSchedulePluginPosition,
+ ScheduleHeaderContent,
+ SchedulePlugin,
+ SchedulePluginPosition,
} from '../types';
-export interface XDSSchedulePaginationPluginOptions {
- position?: XDSSchedulePluginPosition;
+export interface SchedulePaginationPluginOptions {
+ position?: SchedulePluginPosition;
}
-function XDSSchedulePaginationControls() {
+function SchedulePaginationControls() {
const {
onPreviousDate,
previousDateLabel,
onToday,
onNextDate,
nextDateLabel,
- } = useXDSScheduleContext();
+ } = useScheduleContext();
return (
- <XDSButtonGroup label="Schedule pagination" size="sm">
- <XDSIconButton
+ <ButtonGroup label="Schedule pagination" size="sm">
+ <IconButton
label={previousDateLabel}
- icon={<XDSIcon icon="chevronLeft" size="sm" color="inherit" />}
+ icon={<Icon icon="chevronLeft" size="sm" color="inherit" />}
onClick={onPreviousDate}
/>
- <XDSButton label="Today" size="sm" onClick={onToday} />
- <XDSIconButton
+ <Button label="Today" size="sm" onClick={onToday} />
+ <IconButton
label={nextDateLabel}
- icon={<XDSIcon icon="chevronRight" size="sm" color="inherit" />}
+ icon={<Icon icon="chevronRight" size="sm" color="inherit" />}
onClick={onNextDate}
/>
- </XDSButtonGroup>
+ </ButtonGroup>
);
}
-function createXDSSchedulePaginationPlugin({
+function createSchedulePaginationPlugin({
position = 'start',
-}: XDSSchedulePaginationPluginOptions = {}): XDSSchedulePlugin {
+}: SchedulePaginationPluginOptions = {}): SchedulePlugin {
return {
renderHeader(
startContent: ReactNode,
centerContent: ReactNode,
endContent: ReactNode,
- ): XDSScheduleHeaderContent {
- const controls = <XDSSchedulePaginationControls />;
+ ): ScheduleHeaderContent {
+ const controls = <SchedulePaginationControls />;
return position === 'start'
? {
startContent: (
@@ -85,14 +85,14 @@ function createXDSSchedulePaginationPlugin({
};
}
-export const defaultXDSSchedulePaginationPlugin =
- createXDSSchedulePaginationPlugin();
+export const defaultSchedulePaginationPlugin =
+ createSchedulePaginationPlugin();
-export function useXDSSchedulePaginationPlugin({
+export function useSchedulePaginationPlugin({
position = 'start',
-}: XDSSchedulePaginationPluginOptions = {}): XDSSchedulePlugin {
+}: SchedulePaginationPluginOptions = {}): SchedulePlugin {
return useMemo(
- () => createXDSSchedulePaginationPlugin({position}),
+ () => createSchedulePaginationPlugin({position}),
[position],
);
}
diff --git a/packages/lab/src/Schedule/plugins/ViewSelectorPlugin.tsx b/packages/lab/src/Schedule/plugins/ViewSelectorPlugin.tsx
index 58db94c330..64f74b47bd 100644
--- a/packages/lab/src/Schedule/plugins/ViewSelectorPlugin.tsx
+++ b/packages/lab/src/Schedule/plugins/ViewSelectorPlugin.tsx
@@ -5,48 +5,48 @@
/**
* @file ViewSelectorPlugin.tsx
* @input Schedule view options and caller-provided view change callback
- * @output Hook that renders an XDSDropdownMenu plugin for caller-provided views
- * @position Built-in XDSSchedule plugin; re-exported from plugins.tsx
+ * @output Hook that renders an DropdownMenu plugin for caller-provided views
+ * @position Built-in Schedule plugin; re-exported from plugins.tsx
*/
import {useMemo, type ReactNode} from 'react';
-import {XDSDropdownMenu, XDSDropdownMenuItem} from '@xds/core/DropdownMenu';
-import {XDSIcon} from '@xds/core/Icon';
-import {useXDSScheduleContext} from '../context';
+import {DropdownMenu, DropdownMenuItem} from '@xds/core/DropdownMenu';
+import {Icon} from '@xds/core/Icon';
+import {useScheduleContext} from '../context';
import type {
- XDSScheduleHeaderContent,
- XDSSchedulePlugin,
- XDSSchedulePluginPosition,
- XDSScheduleView,
- XDSScheduleViewBase,
+ ScheduleHeaderContent,
+ SchedulePlugin,
+ SchedulePluginPosition,
+ ScheduleView,
+ ScheduleViewBase,
} from '../types';
-export interface XDSScheduleViewSelectorOption<
- View extends XDSScheduleViewBase = XDSScheduleView,
+export interface ScheduleViewSelectorOption<
+ View extends ScheduleViewBase = ScheduleView,
> {
view: View;
label: string;
}
-export interface XDSScheduleViewSelectorPluginOptions<
- View extends XDSScheduleViewBase = XDSScheduleView,
+export interface ScheduleViewSelectorPluginOptions<
+ View extends ScheduleViewBase = ScheduleView,
> {
onChangeView?: (view: View) => void;
- position?: XDSSchedulePluginPosition;
+ position?: SchedulePluginPosition;
}
-function XDSScheduleViewSelectorControl<View extends XDSScheduleViewBase>({
+function ScheduleViewSelectorControl<View extends ScheduleViewBase>({
onChangeView,
options,
}: {
onChangeView?: (view: View) => void;
- options: ReadonlyArray<XDSScheduleViewSelectorOption<View>>;
+ options: ReadonlyArray<ScheduleViewSelectorOption<View>>;
}) {
- const {view} = useXDSScheduleContext();
+ const {view} = useScheduleContext();
const selectedIndex = options.findIndex(option => option.view === view);
const selectedLabel = options[selectedIndex]?.label ?? 'View';
return (
- <XDSDropdownMenu
+ <DropdownMenu
button={{
label: selectedLabel,
size: 'sm',
@@ -54,36 +54,36 @@ function XDSScheduleViewSelectorControl<View extends XDSScheduleViewBase>({
}}
menuWidth={160}>
{options.map((option, index) => (
- <XDSDropdownMenuItem
+ <DropdownMenuItem
key={option.label}
label={option.label}
onClick={() => onChangeView?.(option.view)}
endContent={
index === selectedIndex ? (
- <XDSIcon icon="check" size="sm" color="primary" />
+ <Icon icon="check" size="sm" color="primary" />
) : null
}
/>
))}
- </XDSDropdownMenu>
+ </DropdownMenu>
);
}
-function createXDSScheduleViewSelectorPlugin<View extends XDSScheduleViewBase>(
- options: ReadonlyArray<XDSScheduleViewSelectorOption<View>>,
+function createScheduleViewSelectorPlugin<View extends ScheduleViewBase>(
+ options: ReadonlyArray<ScheduleViewSelectorOption<View>>,
{
onChangeView,
position = 'end',
- }: XDSScheduleViewSelectorPluginOptions<View> = {},
-): XDSSchedulePlugin {
+ }: ScheduleViewSelectorPluginOptions<View> = {},
+): SchedulePlugin {
return {
renderHeader(
startContent: ReactNode,
centerContent: ReactNode,
endContent: ReactNode,
- ): XDSScheduleHeaderContent {
+ ): ScheduleHeaderContent {
const control = (
- <XDSScheduleViewSelectorControl
+ <ScheduleViewSelectorControl
onChangeView={onChangeView}
options={options}
/>
@@ -113,16 +113,16 @@ function createXDSScheduleViewSelectorPlugin<View extends XDSScheduleViewBase>(
};
}
-export function useXDSScheduleViewSelectorPlugin<
- View extends XDSScheduleViewBase,
+export function useScheduleViewSelectorPlugin<
+ View extends ScheduleViewBase,
>(
- options: ReadonlyArray<XDSScheduleViewSelectorOption<View>>,
- pluginOptions: XDSScheduleViewSelectorPluginOptions<View> = {},
-): XDSSchedulePlugin {
+ options: ReadonlyArray<ScheduleViewSelectorOption<View>>,
+ pluginOptions: ScheduleViewSelectorPluginOptions<View> = {},
+): SchedulePlugin {
const {onChangeView, position = 'end'} = pluginOptions;
return useMemo(
() =>
- createXDSScheduleViewSelectorPlugin(options, {onChangeView, position}),
+ createScheduleViewSelectorPlugin(options, {onChangeView, position}),
[onChangeView, options, position],
);
}
diff --git a/packages/lab/src/Schedule/plugins/index.tsx b/packages/lab/src/Schedule/plugins/index.tsx
index b7a30b2b06..2bc94d9631 100644
--- a/packages/lab/src/Schedule/plugins/index.tsx
+++ b/packages/lab/src/Schedule/plugins/index.tsx
@@ -5,16 +5,16 @@
/**
* @file plugins.tsx
* @input Built-in schedule plugin hooks and stable defaults
- * @output Default XDSSchedule plugin list and plugin hook re-exports
+ * @output Default Schedule plugin list and plugin hook re-exports
* @position Plugin barrel; plugin implementations live in separate files
*/
-import {defaultXDSSchedulePaginationPlugin} from './PaginationPlugin';
-import type {XDSSchedulePlugin} from '../types';
+import {defaultSchedulePaginationPlugin} from './PaginationPlugin';
+import type {SchedulePlugin} from '../types';
-export {useXDSSchedulePaginationPlugin} from './PaginationPlugin';
-export {useXDSScheduleViewSelectorPlugin} from './ViewSelectorPlugin';
+export {useSchedulePaginationPlugin} from './PaginationPlugin';
+export {useScheduleViewSelectorPlugin} from './ViewSelectorPlugin';
-export const defaultXDSSchedulePlugins: ReadonlyArray<XDSSchedulePlugin> = [
- defaultXDSSchedulePaginationPlugin,
+export const defaultSchedulePlugins: ReadonlyArray<SchedulePlugin> = [
+ defaultSchedulePaginationPlugin,
];
diff --git a/packages/lab/src/Schedule/shared.tsx b/packages/lab/src/Schedule/shared.tsx
index b41d419640..ce448d2108 100644
--- a/packages/lab/src/Schedule/shared.tsx
+++ b/packages/lab/src/Schedule/shared.tsx
@@ -20,9 +20,9 @@ import {
typographyVars,
typeScaleVars,
} from '@xds/core/theme/tokens.stylex';
-import {XDSSpinner} from '@xds/core/Spinner';
-import {XDSHStack} from '@xds/core/Stack';
-import {XDSHeading, XDSText} from '@xds/core/Text';
+import {Spinner} from '@xds/core/Spinner';
+import {HStack} from '@xds/core/Stack';
+import {Heading, Text} from '@xds/core/Text';
import {
plainDateFromInstant,
plainDateIsAfter,
@@ -31,17 +31,17 @@ import {
type PlainDate,
} from '@xds/core/utils';
import {isDayEvent} from './dateMath';
-import {useXDSScheduleContext} from './context';
+import {useScheduleContext} from './context';
import type {
CalendarEvent,
CalendarInstantEvent,
Instant,
- XDSScheduleCategory,
- XDSScheduleHeaderContent,
- XDSScheduleEventColor,
+ ScheduleCategory,
+ ScheduleHeaderContent,
+ ScheduleEventColor,
} from './types';
-const DEFAULT_EVENT_CATEGORY: XDSScheduleCategory = {
+const DEFAULT_EVENT_CATEGORY: ScheduleCategory = {
label: 'Event',
color: 'blue',
};
@@ -57,18 +57,18 @@ export function ScheduleFrame({
isLoading: boolean;
children: ReactNode;
}) {
- const {plugins} = useXDSScheduleContext();
- const initialHeader: XDSScheduleHeaderContent = {
+ const {plugins} = useScheduleContext();
+ const initialHeader: ScheduleHeaderContent = {
startContent: null,
centerContent: (
<span {...stylex.props(styles.headerTitleContent)}>
- <XDSHeading level={2}>{title}</XDSHeading>
+ <Heading level={2}>{title}</Heading>
<span
{...stylex.props(
styles.loadingSpinner,
!isLoading && styles.loadingSpinnerHidden,
)}>
- <XDSSpinner size="md" aria-label="Loading events" />
+ <Spinner size="md" aria-label="Loading events" />
</span>
</span>
),
@@ -87,19 +87,19 @@ export function ScheduleFrame({
return (
<section {...stylex.props(styles.frame)} aria-label={titleLabel}>
<div {...stylex.props(styles.header)}>
- <XDSHStack gap={8} align="center" xstyle={styles.headerControls}>
+ <HStack gap={8} align="center" xstyle={styles.headerControls}>
{header.startContent}
- </XDSHStack>
- <XDSHStack gap={8} align="center" xstyle={styles.headerTitle}>
+ </HStack>
+ <HStack gap={8} align="center" xstyle={styles.headerTitle}>
{header.centerContent}
- </XDSHStack>
- <XDSHStack
+ </HStack>
+ <HStack
gap={8}
align="center"
justify="end"
xstyle={styles.headerStatus}>
{header.endContent}
- </XDSHStack>
+ </HStack>
</div>
{children}
</section>
@@ -164,7 +164,7 @@ export function EventPill({
timezoneID?: string;
isPast?: boolean;
}) {
- const {categories} = useXDSScheduleContext();
+ const {categories} = useScheduleContext();
const category = getEventCategory(event, categories);
const timeLabel =
day != null && timezoneID != null && !isDayEvent(event)
@@ -179,17 +179,17 @@ export function EventPill({
: eventSurfaceColorStyle(category.color),
)}>
{timeLabel != null && (
- <XDSText type="supporting" color="inherit" xstyle={styles.eventTime}>
+ <Text type="supporting" color="inherit" xstyle={styles.eventTime}>
{timeLabel}
- </XDSText>
+ </Text>
)}
- <XDSText
+ <Text
type="supporting"
color="inherit"
weight="bold"
xstyle={styles.eventTitle}>
{event.title}
- </XDSText>
+ </Text>
</span>
);
}
@@ -203,7 +203,7 @@ export function MonthEventPill({
timezoneID: string;
isPast?: boolean;
}) {
- const {categories} = useXDSScheduleContext();
+ const {categories} = useScheduleContext();
const category = getEventCategory(event, categories);
const timeLabel = isDayEvent(event)
? null
@@ -217,17 +217,17 @@ export function MonthEventPill({
: eventSurfaceColorStyle(category.color),
)}>
{timeLabel != null && (
- <XDSText type="supporting" color="inherit" xstyle={styles.eventTime}>
+ <Text type="supporting" color="inherit" xstyle={styles.eventTime}>
{timeLabel}
- </XDSText>
+ </Text>
)}
- <XDSText
+ <Text
type="supporting"
color="inherit"
weight="bold"
xstyle={styles.eventTitle}>
{event.title}
- </XDSText>
+ </Text>
</span>
);
}
@@ -241,7 +241,7 @@ export function ListEventRow({
timezoneID: string;
isPast?: boolean;
}) {
- const {categories} = useXDSScheduleContext();
+ const {categories} = useScheduleContext();
const category = getEventCategory(event, categories);
return (
<div {...stylex.props(styles.listEventRow, isPast && styles.listEventPast)}>
@@ -264,8 +264,8 @@ export function ListEventRow({
export function getEventCategory(
event: CalendarEvent,
- categories: ReadonlyArray<XDSScheduleCategory>,
-): XDSScheduleCategory {
+ categories: ReadonlyArray<ScheduleCategory>,
+): ScheduleCategory {
return (
categories.find(category => category.label === event.category) ??
(event.category != null
@@ -274,7 +274,7 @@ export function getEventCategory(
);
}
-export function eventColorStyle(color: XDSScheduleEventColor | undefined) {
+export function eventColorStyle(color: ScheduleEventColor | undefined) {
switch (color) {
case 'cyan':
return styles.eventCyan;
@@ -300,7 +300,7 @@ export function eventColorStyle(color: XDSScheduleEventColor | undefined) {
}
}
-export function eventDotColorStyle(color: XDSScheduleEventColor | undefined) {
+export function eventDotColorStyle(color: ScheduleEventColor | undefined) {
switch (color) {
case 'cyan':
return styles.eventDotCyan;
@@ -327,7 +327,7 @@ export function eventDotColorStyle(color: XDSScheduleEventColor | undefined) {
}
export function eventSurfaceColorStyle(
- color: XDSScheduleEventColor | undefined,
+ color: ScheduleEventColor | undefined,
) {
switch (color) {
case 'cyan':
@@ -355,7 +355,7 @@ export function eventSurfaceColorStyle(
}
export function eventPastSurfaceColorStyle(
- color: XDSScheduleEventColor | undefined,
+ color: ScheduleEventColor | undefined,
) {
switch (color) {
case 'cyan':
@@ -518,7 +518,7 @@ export function formatEventAccessibilityLabel(
event: CalendarEvent,
day: PlainDate,
timezoneID: string,
- categories: ReadonlyArray<XDSScheduleCategory>,
+ categories: ReadonlyArray<ScheduleCategory>,
): string {
const category = getEventCategory(event, categories);
const timeLabel = isDayEvent(event)
diff --git a/packages/lab/src/Schedule/types.ts b/packages/lab/src/Schedule/types.ts
index ab8ec70e8a..6662243427 100644
--- a/packages/lab/src/Schedule/types.ts
+++ b/packages/lab/src/Schedule/types.ts
@@ -2,8 +2,8 @@
/**
* @file types.ts
- * @input Public XDSSchedule API concepts
- * @output Event, view, date, loader, and context types for XDSSchedule
+ * @input Public Schedule API concepts
+ * @output Event, view, date, loader, and context types for Schedule
* @position Public type surface; consumed by Schedule implementation and exports
*/
@@ -18,19 +18,19 @@ export type {
CalendarEvent,
CalendarEventBase,
CalendarInstantEvent,
- XDSScheduleCategory,
- XDSScheduleEventColor,
+ ScheduleCategory,
+ ScheduleEventColor,
} from './CalendarEvent';
export type {ZonedDateTime, ZonedDateTimeRange} from './zonedDateTime';
/** Unix epoch milliseconds. */
export type Instant = number;
-export type XDSScheduleEventSource =
+export type ScheduleEventSource =
| ReadonlyArray<CalendarEvent>
| ((start: Instant, end: Instant) => Promise<ReadonlyArray<CalendarEvent>>);
-export type XDSScheduleDate = Instant;
+export type ScheduleDate = Instant;
export interface ScheduleRange {
startDate: PlainDate;
@@ -39,48 +39,48 @@ export interface ScheduleRange {
end: Instant;
}
-export type XDSScheduleViewOptions = object;
+export type ScheduleViewOptions = object;
-export interface XDSScheduleViewComponentProps<
- Options extends XDSScheduleViewOptions = XDSScheduleViewOptions,
+export interface ScheduleViewComponentProps<
+ Options extends ScheduleViewOptions = ScheduleViewOptions,
> {
options: Options;
}
-export interface XDSScheduleNavigationRange {
+export interface ScheduleNavigationRange {
label: string;
range: ZonedDateTimeRange;
}
-export type XDSScheduleViewComponent<
- Options extends XDSScheduleViewOptions = XDSScheduleViewOptions,
-> = (props: XDSScheduleViewComponentProps<Options>) => ReactNode;
+export type ScheduleViewComponent<
+ Options extends ScheduleViewOptions = ScheduleViewOptions,
+> = (props: ScheduleViewComponentProps<Options>) => ReactNode;
-export interface XDSScheduleViewBase {
+export interface ScheduleViewBase {
getDateRange: (date: ZonedDateTime) => ZonedDateTimeRange;
- getPreviousDateRange: (date: ZonedDateTime) => XDSScheduleNavigationRange;
- getNextDateRange: (date: ZonedDateTime) => XDSScheduleNavigationRange;
+ getPreviousDateRange: (date: ZonedDateTime) => ScheduleNavigationRange;
+ getNextDateRange: (date: ZonedDateTime) => ScheduleNavigationRange;
}
-export interface XDSScheduleView<
- Options extends XDSScheduleViewOptions = XDSScheduleViewOptions,
-> extends XDSScheduleViewBase {
- component: XDSScheduleViewComponent<Options>;
+export interface ScheduleView<
+ Options extends ScheduleViewOptions = ScheduleViewOptions,
+> extends ScheduleViewBase {
+ component: ScheduleViewComponent<Options>;
options: Options;
}
-export interface XDSScheduleHeaderContent {
+export interface ScheduleHeaderContent {
startContent: ReactNode;
centerContent: ReactNode;
endContent: ReactNode;
}
-export type XDSSchedulePluginPosition = 'start' | 'end';
+export type SchedulePluginPosition = 'start' | 'end';
-export interface XDSSchedulePlugin {
+export interface SchedulePlugin {
renderHeader?: (
startContent: ReactNode,
centerContent: ReactNode,
endContent: ReactNode,
- ) => XDSScheduleHeaderContent;
+ ) => ScheduleHeaderContent;
}
diff --git a/packages/lab/src/Schedule/zonedDateTime.ts b/packages/lab/src/Schedule/zonedDateTime.ts
index 302b962256..effcee1f8d 100644
--- a/packages/lab/src/Schedule/zonedDateTime.ts
+++ b/packages/lab/src/Schedule/zonedDateTime.ts
@@ -3,7 +3,7 @@
/**
* @file zonedDateTime.ts
* @input Instant epoch milliseconds and IANA timezone IDs
- * @output Lightweight ZonedDateTime helpers used by XDSSchedule views
+ * @output Lightweight ZonedDateTime helpers used by Schedule views
* @position Internal timezone-aware date bridge between schedule shell and views
*/
@@ -13,7 +13,7 @@ import {
plainDateToInstant,
type PlainDate,
} from '@xds/core/utils';
-import type {Instant, ScheduleRange, XDSScheduleDate} from './types';
+import type {Instant, ScheduleRange, ScheduleDate} from './types';
export interface ZonedDateTime {
instant: Instant;
@@ -26,7 +26,7 @@ export interface ZonedDateTime {
export type ZonedDateTimeRange = [ZonedDateTime, ZonedDateTime];
export function createZonedDateTime(
- date: XDSScheduleDate,
+ date: ScheduleDate,
timezoneID: string,
): ZonedDateTime {
return zonedDateTimeFromInstant(date as Instant, timezoneID);
diff --git a/packages/lab/src/Stepper/XDSStep.tsx b/packages/lab/src/Stepper/Step.tsx
similarity index 94%
rename from packages/lab/src/Stepper/XDSStep.tsx
rename to packages/lab/src/Stepper/Step.tsx
index 7a525f0f22..ee09a94f4b 100644
--- a/packages/lab/src/Stepper/XDSStep.tsx
+++ b/packages/lab/src/Stepper/Step.tsx
@@ -3,14 +3,14 @@
'use client';
/**
- * @file XDSStep.tsx
- * @input Uses React, stylex, theme tokens, XDSStepperContext
- * @output Exports XDSStep component and XDSStepProps
- * @position Individual step item; used inside XDSStepper
+ * @file Step.tsx
+ * @input Uses React, stylex, theme tokens, StepperContext
+ * @output Exports Step component and StepProps
+ * @position Individual step item; used inside Stepper
*
* SYNC: When modified, update these files to stay in sync:
* - /packages/lab/src/Stepper/Stepper.doc.mjs
- * - /packages/lab/src/Stepper/XDSStepper.test.tsx
+ * - /packages/lab/src/Stepper/Stepper.test.tsx
* - /packages/lab/src/Stepper/index.ts
* - /apps/storybook/stories/Stepper.stories.tsx
* - /packages/cli/templates/blocks/components/Stepper/ (showcase blocks)
@@ -30,22 +30,22 @@ import {
} from '@xds/core/theme/tokens.stylex';
import {mergeProps} from '@xds/core/utils';
import type {BaseProps} from '@xds/core';
-import {useXDSStepperContext} from './XDSStepperContext';
+import {useStepperContext} from './StepperContext';
import {xdsThemeProps} from '../../../core/src/utils/xdsThemeProps';
-import type {XDSStepStatus} from './XDSStepStatus';
+import type {StepStatus} from './StepStatus';
/**
* Built-in indicator presets. Anything other than these strings passed to
- * `indicator` is treated as a custom ReactNode (e.g. an `<XDSIcon />`).
+ * `indicator` is treated as a custom ReactNode (e.g. an `<Icon />`).
* - 'auto': numbered badge for not-yet-reached steps, a check once completed
* (default)
* - 'number': always a numbered badge
* - 'none': no indicator — just the progress bar and label
*/
-export type XDSStepIndicatorPreset = 'auto' | 'number' | 'none';
-export type XDSStepDensity = 'compact' | 'balanced' | 'spacious';
+export type StepIndicatorPreset = 'auto' | 'number' | 'none';
+export type StepDensity = 'compact' | 'balanced' | 'spacious';
-export interface XDSStepProps extends BaseProps<HTMLLIElement> {
+export interface StepProps extends BaseProps<HTMLLIElement> {
/** Ref forwarded to the root element */
ref?: React.Ref<HTMLLIElement>;
/**
@@ -68,7 +68,7 @@ export interface XDSStepProps extends BaseProps<HTMLLIElement> {
children?: ReactNode;
/**
* Custom icon rendered inside the indicator. Accepts any ReactNode (for
- * example an `<XDSIcon />`). Equivalent to passing the node directly to
+ * example an `<Icon />`). Equivalent to passing the node directly to
* `indicator`; takes precedence over the built-in number/check.
*/
icon?: ReactNode;
@@ -77,7 +77,7 @@ export interface XDSStepProps extends BaseProps<HTMLLIElement> {
* global XDS semantic tokens (`accent`, `success`, `warning`, `error`).
* Leave unset to use the progress-derived default coloring.
*/
- status?: XDSStepStatus;
+ status?: StepStatus;
/**
* Disable interaction for this step.
* @default false
@@ -103,7 +103,7 @@ export interface XDSStepProps extends BaseProps<HTMLLIElement> {
* - ReactNode: any custom icon or element to render as the indicator
* @default 'auto'
*/
- indicator?: XDSStepIndicatorPreset | ReactNode;
+ indicator?: StepIndicatorPreset | ReactNode;
/**
* Controls vertical padding of the step. Falls back to the stepper-level
* density when unset.
@@ -111,7 +111,7 @@ export interface XDSStepProps extends BaseProps<HTMLLIElement> {
* - 'balanced': default (8px block)
* - 'spacious': generous (12px block, 12px inline)
*/
- density?: XDSStepDensity;
+ density?: StepDensity;
}
// --- Default progress icons (16px) ---
@@ -414,7 +414,7 @@ const styles = stylex.create({
});
/**
- * An individual step within an XDSStepper. Renders a 4px progress-bar segment,
+ * An individual step within an Stepper. Renders a 4px progress-bar segment,
* an indicator (numbered badge, check, or any custom icon), a label with
* optional description, and an optional content slot.
*
@@ -425,16 +425,16 @@ const styles = stylex.create({
*
* @example
* ```
- * <XDSStep step={0} label="Account details" description="Enter your email" />
+ * <Step step={0} label="Account details" description="Enter your email" />
* ```
*
* @example
* ```
* // Generic icon + semantic color
- * <XDSStep step={1} label="Payment" status="error" icon={<XDSIcon icon="warning" />} />
+ * <Step step={1} label="Payment" status="error" icon={<Icon icon="warning" />} />
* ```
*/
-export function XDSStep({
+export function Step({
step,
label,
description,
@@ -452,8 +452,8 @@ export function XDSStep({
ref,
'data-testid': dataTestId,
...rest
-}: XDSStepProps) {
- const ctx = useXDSStepperContext();
+}: StepProps) {
+ const ctx = useStepperContext();
const {activeStep, orientation, onStepClick, density: ctxDensity} = ctx;
const density = densityProp ?? ctxDensity;
@@ -461,9 +461,9 @@ export function XDSStep({
// Resolve indicator prop — may be a preset string or a custom ReactNode.
const isCustomIndicator =
indicatorProp != null && typeof indicatorProp !== 'string';
- const indicator: XDSStepIndicatorPreset = isCustomIndicator
+ const indicator: StepIndicatorPreset = isCustomIndicator
? 'auto'
- : ((indicatorProp as XDSStepIndicatorPreset | undefined) ?? 'auto');
+ : ((indicatorProp as StepIndicatorPreset | undefined) ?? 'auto');
// Internal progress, derived from the parent's activeStep. This is NOT the
// public `status` prop — `status` controls semantic color only.
@@ -753,4 +753,4 @@ export function XDSStep({
);
}
-XDSStep.displayName = 'XDSStep';
+Step.displayName = 'Step';
diff --git a/packages/lab/src/Stepper/XDSStepStatus.ts b/packages/lab/src/Stepper/StepStatus.ts
similarity index 80%
rename from packages/lab/src/Stepper/XDSStepStatus.ts
rename to packages/lab/src/Stepper/StepStatus.ts
index 9046033402..b94dca42f0 100644
--- a/packages/lab/src/Stepper/XDSStepStatus.ts
+++ b/packages/lab/src/Stepper/StepStatus.ts
@@ -1,10 +1,10 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDSStepStatus.ts
+ * @file StepStatus.ts
* @input None
- * @output Exports XDSStepStatus type
- * @position Shared type used by XDSStep and the stepper docs
+ * @output Exports StepStatus type
+ * @position Shared type used by Step and the stepper docs
*/
/**
@@ -23,4 +23,4 @@
* when you want to tint a step with a specific semantic color, e.g.
* `status="error"`.
*/
-export type XDSStepStatus = 'accent' | 'success' | 'warning' | 'error';
+export type StepStatus = 'accent' | 'success' | 'warning' | 'error';
diff --git a/packages/lab/src/Stepper/Stepper.doc.mjs b/packages/lab/src/Stepper/Stepper.doc.mjs
index cb4bd1d1d6..73c133c570 100644
--- a/packages/lab/src/Stepper/Stepper.doc.mjs
+++ b/packages/lab/src/Stepper/Stepper.doc.mjs
@@ -35,7 +35,7 @@ export const docs = {
},
components: [
{
- name: 'XDSStepper',
+ name: 'Stepper',
displayName: 'Stepper',
description:
'Container component that manages step state and renders steps in horizontal or vertical orientation as an ordered list.',
@@ -49,7 +49,7 @@ export const docs = {
{
name: 'children',
type: 'ReactNode',
- description: 'XDSStep elements to render in the stepper.',
+ description: 'Step elements to render in the stepper.',
required: true,
},
{
@@ -83,7 +83,7 @@ export const docs = {
],
},
{
- name: 'XDSStep',
+ name: 'Step',
displayName: 'Step',
description:
'Individual step within a stepper. Renders a progress-bar segment, an indicator, and a label with optional description.',
@@ -113,8 +113,8 @@ export const docs = {
{
name: 'icon',
type: 'ReactNode',
- description: 'Custom icon rendered inside the indicator. Accepts any node (e.g. an XDSIcon). Takes precedence over the built-in number/check.',
- slotElements: [{__element: 'XDSIcon', props: {icon: 'check', size: 'sm'}}],
+ description: 'Custom icon rendered inside the indicator. Accepts any node (e.g. an Icon). Takes precedence over the built-in number/check.',
+ slotElements: [{__element: 'Icon', props: {icon: 'check', size: 'sm'}}],
},
{
name: 'status',
@@ -173,12 +173,12 @@ export const docsDense = {
},
components: [
{
- name: 'XDSStepper',
+ name: 'Stepper',
displayName: 'Stepper',
description: 'container managing step state w/ horizontal/vertical layout',
propDescriptions: {
activeStep: 'zero-based active step index',
- children: 'XDSStep elements',
+ children: 'Step elements',
orientation: 'horizontal or vertical layout',
onStepClick: 'enables non-linear navigation',
label: 'ordered-list aria-label',
@@ -187,7 +187,7 @@ export const docsDense = {
},
},
{
- name: 'XDSStep',
+ name: 'Step',
displayName: 'Step',
description: 'individual step w/ progress bar, indicator, label',
propDescriptions: {
@@ -231,12 +231,12 @@ export const docsZh = {
},
components: [
{
- name: 'XDSStepper',
+ name: 'Stepper',
displayName: 'Stepper',
description: '容器组件,管理步骤状态并以水平或垂直方向渲染步骤。',
props: [
{name: 'activeStep', type: 'number', description: '当前活动步骤的从零开始的索引。', required: true},
- {name: 'children', type: 'ReactNode', description: '要在步骤器中渲染的 XDSStep 元素。', required: true},
+ {name: 'children', type: 'ReactNode', description: '要在步骤器中渲染的 Step 元素。', required: true},
{name: 'orientation', type: "'horizontal' | 'vertical'", description: '步骤器的布局方向。', default: "'horizontal'"},
{name: 'onStepClick', type: '(index: number) => void', description: '点击步骤时调用。启用非线性导航。'},
{name: 'label', type: 'string', description: '有序列表的无障碍标签。', default: "'Progress'"},
@@ -245,7 +245,7 @@ export const docsZh = {
],
},
{
- name: 'XDSStep',
+ name: 'Step',
displayName: 'Step',
description: '步骤器中的单个步骤。渲染进度条、指示器和带可选描述的标签。',
props: [
diff --git a/packages/lab/src/Stepper/XDSStepper.test.tsx b/packages/lab/src/Stepper/Stepper.test.tsx
similarity index 59%
rename from packages/lab/src/Stepper/XDSStepper.test.tsx
rename to packages/lab/src/Stepper/Stepper.test.tsx
index 34459760f0..3fa6bb6e6a 100644
--- a/packages/lab/src/Stepper/XDSStepper.test.tsx
+++ b/packages/lab/src/Stepper/Stepper.test.tsx
@@ -3,17 +3,17 @@
import {describe, it, expect, vi} from 'vitest';
import {render, screen} from '@testing-library/react';
import userEvent from '@testing-library/user-event';
-import {XDSStepper} from './XDSStepper';
-import {XDSStep} from './XDSStep';
+import {Stepper} from './Stepper';
+import {Step} from './Step';
-describe('XDSStepper', () => {
+describe('Stepper', () => {
it('renders an ordered list of steps (not a nav landmark)', () => {
render(
- <XDSStepper activeStep={0}>
- <XDSStep step={0} label="Step 1" />
- <XDSStep step={1} label="Step 2" />
- <XDSStep step={2} label="Step 3" />
- </XDSStepper>,
+ <Stepper activeStep={0}>
+ <Step step={0} label="Step 1" />
+ <Step step={1} label="Step 2" />
+ <Step step={2} label="Step 3" />
+ </Stepper>,
);
// A stepper is a sequence/progress list, not a navigation landmark.
expect(screen.queryByRole('navigation')).not.toBeInTheDocument();
@@ -26,10 +26,10 @@ describe('XDSStepper', () => {
it('renders step numbers', () => {
render(
- <XDSStepper activeStep={0}>
- <XDSStep step={0} label="First" indicator="number" />
- <XDSStep step={1} label="Second" indicator="number" />
- </XDSStepper>,
+ <Stepper activeStep={0}>
+ <Step step={0} label="First" indicator="number" />
+ <Step step={1} label="Second" indicator="number" />
+ </Stepper>,
);
expect(screen.getByText('1')).toBeInTheDocument();
expect(screen.getByText('2')).toBeInTheDocument();
@@ -37,11 +37,11 @@ describe('XDSStepper', () => {
it('marks the active step with aria-current', () => {
render(
- <XDSStepper activeStep={1}>
- <XDSStep step={0} label="Step 1" data-testid="step-0" />
- <XDSStep step={1} label="Step 2" data-testid="step-1" />
- <XDSStep step={2} label="Step 3" data-testid="step-2" />
- </XDSStepper>,
+ <Stepper activeStep={1}>
+ <Step step={0} label="Step 1" data-testid="step-0" />
+ <Step step={1} label="Step 2" data-testid="step-1" />
+ <Step step={2} label="Step 3" data-testid="step-2" />
+ </Stepper>,
);
expect(screen.getByTestId('step-0')).not.toHaveAttribute('aria-current');
expect(screen.getByTestId('step-1')).toHaveAttribute(
@@ -53,20 +53,20 @@ describe('XDSStepper', () => {
it('renders descriptions when provided', () => {
render(
- <XDSStepper activeStep={0}>
- <XDSStep step={0} label="Account" description="Create your account" />
- <XDSStep step={1} label="Profile" />
- </XDSStepper>,
+ <Stepper activeStep={0}>
+ <Step step={0} label="Account" description="Create your account" />
+ <Step step={1} label="Profile" />
+ </Stepper>,
);
expect(screen.getByText('Create your account')).toBeInTheDocument();
});
it('supports custom accessible label', () => {
render(
- <XDSStepper activeStep={0} label="Checkout progress">
- <XDSStep step={0} label="Cart" />
- <XDSStep step={1} label="Payment" />
- </XDSStepper>,
+ <Stepper activeStep={0} label="Checkout progress">
+ <Step step={0} label="Cart" />
+ <Step step={1} label="Payment" />
+ </Stepper>,
);
expect(
screen.getByRole('list', {name: 'Checkout progress'}),
@@ -75,10 +75,10 @@ describe('XDSStepper', () => {
it('supports vertical orientation', () => {
render(
- <XDSStepper activeStep={0} orientation="vertical">
- <XDSStep step={0} label="Step 1" />
- <XDSStep step={1} label="Step 2" />
- </XDSStepper>,
+ <Stepper activeStep={0} orientation="vertical">
+ <Step step={0} label="Step 1" />
+ <Step step={1} label="Step 2" />
+ </Stepper>,
);
const list = screen.getByRole('list');
expect(list).toHaveAttribute('data-orientation', 'vertical');
@@ -88,11 +88,11 @@ describe('XDSStepper', () => {
const user = userEvent.setup();
const handleClick = vi.fn();
render(
- <XDSStepper activeStep={2} onStepClick={handleClick}>
- <XDSStep step={0} label="Step 1" />
- <XDSStep step={1} label="Step 2" />
- <XDSStep step={2} label="Step 3" />
- </XDSStepper>,
+ <Stepper activeStep={2} onStepClick={handleClick}>
+ <Step step={0} label="Step 1" />
+ <Step step={1} label="Step 2" />
+ <Step step={2} label="Step 3" />
+ </Stepper>,
);
await user.click(
screen.getByRole('button', {name: 'Go to step 1: Step 1'}),
@@ -104,11 +104,11 @@ describe('XDSStepper', () => {
const user = userEvent.setup();
const handleClick = vi.fn();
render(
- <XDSStepper activeStep={1} onStepClick={handleClick}>
- <XDSStep step={0} label="Step 1" />
- <XDSStep step={1} label="Step 2" />
- <XDSStep step={2} label="Step 3" />
- </XDSStepper>,
+ <Stepper activeStep={1} onStepClick={handleClick}>
+ <Step step={0} label="Step 1" />
+ <Step step={1} label="Step 2" />
+ <Step step={2} label="Step 3" />
+ </Stepper>,
);
await user.click(
screen.getByRole('button', {name: 'Go to step 2: Step 2'}),
@@ -118,10 +118,10 @@ describe('XDSStepper', () => {
it('renders buttons for upcoming steps in non-linear mode', () => {
render(
- <XDSStepper activeStep={0} onStepClick={() => {}}>
- <XDSStep step={0} label="Step 1" />
- <XDSStep step={1} label="Step 2" />
- </XDSStepper>,
+ <Stepper activeStep={0} onStepClick={() => {}}>
+ <Step step={0} label="Step 1" />
+ <Step step={1} label="Step 2" />
+ </Stepper>,
);
expect(
screen.getByRole('button', {name: 'Go to step 1: Step 1'}),
@@ -135,11 +135,11 @@ describe('XDSStepper', () => {
const user = userEvent.setup();
const handleClick = vi.fn();
render(
- <XDSStepper activeStep={0} onStepClick={handleClick}>
- <XDSStep step={0} label="Step 1" />
- <XDSStep step={1} label="Step 2" />
- <XDSStep step={2} label="Step 3" />
- </XDSStepper>,
+ <Stepper activeStep={0} onStepClick={handleClick}>
+ <Step step={0} label="Step 1" />
+ <Step step={1} label="Step 2" />
+ <Step step={2} label="Step 3" />
+ </Stepper>,
);
await user.click(
screen.getByRole('button', {name: 'Go to step 3: Step 3'}),
@@ -149,11 +149,11 @@ describe('XDSStepper', () => {
it('does not render buttons for disabled steps', () => {
render(
- <XDSStepper activeStep={2} onStepClick={() => {}}>
- <XDSStep step={0} label="Step 1" isDisabled />
- <XDSStep step={1} label="Step 2" />
- <XDSStep step={2} label="Step 3" />
- </XDSStepper>,
+ <Stepper activeStep={2} onStepClick={() => {}}>
+ <Step step={0} label="Step 1" isDisabled />
+ <Step step={1} label="Step 2" />
+ <Step step={2} label="Step 3" />
+ </Stepper>,
);
expect(
screen.queryByRole('button', {name: 'Go to step 1: Step 1'}),
@@ -162,21 +162,21 @@ describe('XDSStepper', () => {
it('does not render buttons when onStepClick is not provided', () => {
render(
- <XDSStepper activeStep={2}>
- <XDSStep step={0} label="Step 1" />
- <XDSStep step={1} label="Step 2" />
- <XDSStep step={2} label="Step 3" />
- </XDSStepper>,
+ <Stepper activeStep={2}>
+ <Step step={0} label="Step 1" />
+ <Step step={1} label="Step 2" />
+ <Step step={2} label="Step 3" />
+ </Stepper>,
);
expect(screen.queryAllByRole('button')).toHaveLength(0);
});
it('applies a semantic color status (color only) via data attribute', () => {
render(
- <XDSStepper activeStep={1}>
- <XDSStep step={0} label="Step 1" data-testid="step-0" />
- <XDSStep step={1} label="Step 2" status="error" data-testid="step-1" />
- </XDSStepper>,
+ <Stepper activeStep={1}>
+ <Step step={0} label="Step 1" data-testid="step-0" />
+ <Step step={1} label="Step 2" status="error" data-testid="step-1" />
+ </Stepper>,
);
expect(screen.getByTestId('step-1')).toHaveAttribute(
'data-status',
@@ -191,12 +191,12 @@ describe('XDSStepper', () => {
it('reflects each global semantic status on the data attribute', () => {
render(
- <XDSStepper activeStep={0}>
- <XDSStep step={0} label="A" status="accent" data-testid="s-accent" />
- <XDSStep step={1} label="B" status="success" data-testid="s-success" />
- <XDSStep step={2} label="C" status="warning" data-testid="s-warning" />
- <XDSStep step={3} label="D" status="error" data-testid="s-error" />
- </XDSStepper>,
+ <Stepper activeStep={0}>
+ <Step step={0} label="A" status="accent" data-testid="s-accent" />
+ <Step step={1} label="B" status="success" data-testid="s-success" />
+ <Step step={2} label="C" status="warning" data-testid="s-warning" />
+ <Step step={3} label="D" status="error" data-testid="s-error" />
+ </Stepper>,
);
expect(screen.getByTestId('s-accent')).toHaveAttribute(
'data-status',
@@ -218,19 +218,19 @@ describe('XDSStepper', () => {
it('does not set a status data attribute when status is unset', () => {
render(
- <XDSStepper activeStep={0}>
- <XDSStep step={0} label="Step 1" data-testid="step-0" />
- </XDSStepper>,
+ <Stepper activeStep={0}>
+ <Step step={0} label="Step 1" data-testid="step-0" />
+ </Stepper>,
);
expect(screen.getByTestId('step-0')).not.toHaveAttribute('data-status');
});
it('handles zero active step correctly', () => {
render(
- <XDSStepper activeStep={0}>
- <XDSStep step={0} label="Step 1" data-testid="step-0" />
- <XDSStep step={1} label="Step 2" data-testid="step-1" />
- </XDSStepper>,
+ <Stepper activeStep={0}>
+ <Step step={0} label="Step 1" data-testid="step-0" />
+ <Step step={1} label="Step 2" data-testid="step-1" />
+ </Stepper>,
);
expect(screen.getByTestId('step-0')).toHaveAttribute(
'aria-current',
@@ -241,11 +241,11 @@ describe('XDSStepper', () => {
it('renders each step as a list item', () => {
render(
- <XDSStepper activeStep={0}>
- <XDSStep step={0} label="Step 1" />
- <XDSStep step={1} label="Step 2" />
- <XDSStep step={2} label="Step 3" />
- </XDSStepper>,
+ <Stepper activeStep={0}>
+ <Step step={0} label="Step 1" />
+ <Step step={1} label="Step 2" />
+ <Step step={2} label="Step 3" />
+ </Stepper>,
);
const items = screen.getAllByRole('listitem');
expect(items).toHaveLength(3);
@@ -254,13 +254,13 @@ describe('XDSStepper', () => {
it('accepts a custom ReactNode as indicator', () => {
render(
- <XDSStepper activeStep={0}>
- <XDSStep
+ <Stepper activeStep={0}>
+ <Step
step={0}
label="Step 1"
indicator={<span data-testid="custom-icon">★</span>}
/>
- </XDSStepper>,
+ </Stepper>,
);
expect(screen.getByTestId('custom-icon')).toBeInTheDocument();
expect(screen.getByText('★')).toBeInTheDocument();
@@ -268,13 +268,13 @@ describe('XDSStepper', () => {
it('accepts a generic icon via the icon prop', () => {
render(
- <XDSStepper activeStep={1}>
- <XDSStep
+ <Stepper activeStep={1}>
+ <Step
step={1}
label="Payment"
icon={<span data-testid="pay-icon">$</span>}
/>
- </XDSStepper>,
+ </Stepper>,
);
expect(screen.getByTestId('pay-icon')).toBeInTheDocument();
});
diff --git a/packages/lab/src/Stepper/XDSStepper.tsx b/packages/lab/src/Stepper/Stepper.tsx
similarity index 78%
rename from packages/lab/src/Stepper/XDSStepper.tsx
rename to packages/lab/src/Stepper/Stepper.tsx
index f8c34a10d2..2b5d85d8d8 100644
--- a/packages/lab/src/Stepper/XDSStepper.tsx
+++ b/packages/lab/src/Stepper/Stepper.tsx
@@ -3,14 +3,14 @@
'use client';
/**
- * @file XDSStepper.tsx
- * @input Uses React, stylex, theme tokens, XDSStepperContext
- * @output Exports XDSStepper component and XDSStepperProps
+ * @file Stepper.tsx
+ * @input Uses React, stylex, theme tokens, StepperContext
+ * @output Exports Stepper component and StepperProps
* @position Core container component; consumed by index.ts
*
* SYNC: When modified, update these files to stay in sync:
* - /packages/lab/src/Stepper/Stepper.doc.mjs (props table, features, implementation notes)
- * - /packages/lab/src/Stepper/XDSStepper.test.tsx (tests for new/changed behavior)
+ * - /packages/lab/src/Stepper/Stepper.test.tsx (tests for new/changed behavior)
* - /packages/lab/src/Stepper/index.ts (exports if types change)
* - /apps/storybook/stories/Stepper.stories.tsx (storybook stories)
* - /packages/cli/templates/blocks/components/Stepper/ (showcase blocks)
@@ -23,12 +23,12 @@ import {mergeProps} from '@xds/core/utils';
import type {BaseProps} from '@xds/core';
import {xdsThemeProps} from '../../../core/src/utils/xdsThemeProps';
import {
- XDSStepperContext,
- type XDSStepperOrientation,
- type XDSStepperContextValue,
-} from './XDSStepperContext';
+ StepperContext,
+ type StepperOrientation,
+ type StepperContextValue,
+} from './StepperContext';
-export interface XDSStepperProps extends BaseProps<HTMLOListElement> {
+export interface StepperProps extends BaseProps<HTMLOListElement> {
/** Ref forwarded to the root element */
ref?: React.Ref<HTMLOListElement>;
/**
@@ -36,14 +36,14 @@ export interface XDSStepperProps extends BaseProps<HTMLOListElement> {
*/
activeStep: number;
/**
- * XDSStep elements to render.
+ * Step elements to render.
*/
children: ReactNode;
/**
* Layout direction of the stepper.
* @default 'horizontal'
*/
- orientation?: XDSStepperOrientation;
+ orientation?: StepperOrientation;
/**
* Called when a step indicator is clicked. Enables non-linear navigation.
* When provided, completed and current steps become clickable.
@@ -86,7 +86,7 @@ const styles = stylex.create({
* A stepper component for multi-step workflows. Displays numbered steps
* with visual indicators for completed, active, and upcoming states.
*
- * Each XDSStep child must provide a `step` prop (zero-based index) so it
+ * Each Step child must provide a `step` prop (zero-based index) so it
* can derive its state from the parent's activeStep. CSS :last-child
* handles connector hiding — no child introspection needed.
*
@@ -99,14 +99,14 @@ const styles = stylex.create({
*
* @example
* ```
- * <XDSStepper activeStep={1}>
- * <XDSStep step={0} label="Account" />
- * <XDSStep step={1} label="Profile" />
- * <XDSStep step={2} label="Review" />
- * </XDSStepper>
+ * <Stepper activeStep={1}>
+ * <Step step={0} label="Account" />
+ * <Step step={1} label="Profile" />
+ * <Step step={2} label="Review" />
+ * </Stepper>
* ```
*/
-export function XDSStepper({
+export function Stepper({
activeStep,
children,
orientation = 'horizontal',
@@ -118,8 +118,8 @@ export function XDSStepper({
style,
ref,
...rest
-}: XDSStepperProps) {
- const ctxValue = useMemo<XDSStepperContextValue>(
+}: StepperProps) {
+ const ctxValue = useMemo<StepperContextValue>(
() => ({
activeStep,
orientation,
@@ -131,7 +131,7 @@ export function XDSStepper({
);
return (
- <XDSStepperContext value={ctxValue}>
+ <StepperContext value={ctxValue}>
<ol
ref={ref}
aria-label={label}
@@ -150,8 +150,8 @@ export function XDSStepper({
introspection needed — steps derive state from context. */}
{children}
</ol>
- </XDSStepperContext>
+ </StepperContext>
);
}
-XDSStepper.displayName = 'XDSStepper';
+Stepper.displayName = 'Stepper';
diff --git a/packages/lab/src/Stepper/StepperContext.ts b/packages/lab/src/Stepper/StepperContext.ts
new file mode 100644
index 0000000000..418440e8ff
--- /dev/null
+++ b/packages/lab/src/Stepper/StepperContext.ts
@@ -0,0 +1,43 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+
+'use client';
+
+/**
+ * @file StepperContext.ts
+ * @input Uses React createContext/use
+ * @output Exports StepperContext, useStepperContext, and context types
+ * @position Context for Stepper <-> Step communication
+ *
+ * SYNC: When modified, update these files to stay in sync:
+ * - /packages/lab/src/Stepper/Stepper.doc.mjs
+ * - /packages/lab/src/Stepper/index.ts
+ */
+
+import {createContext, use} from 'react';
+
+export type StepperOrientation = 'horizontal' | 'vertical';
+export type StepperDensity = 'compact' | 'balanced' | 'spacious';
+
+export interface StepperContextValue {
+ activeStep: number;
+ orientation: StepperOrientation;
+ isNonLinear: boolean;
+ onStepClick: ((index: number) => void) | null;
+ density: StepperDensity;
+}
+
+export const StepperContext = createContext<StepperContextValue | null>(
+ null,
+);
+StepperContext.displayName = 'StepperContext';
+
+export function useStepperContext(): StepperContextValue {
+ const ctx = use(StepperContext);
+ if (ctx == null) {
+ throw new Error(
+ 'useStepperContext must be used within Stepper. ' +
+ 'Wrap your Step in <Stepper>.',
+ );
+ }
+ return ctx;
+}
diff --git a/packages/lab/src/Stepper/XDSStepperContext.ts b/packages/lab/src/Stepper/XDSStepperContext.ts
deleted file mode 100644
index 3ec0e4a3e2..0000000000
--- a/packages/lab/src/Stepper/XDSStepperContext.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (c) Meta Platforms, Inc. and affiliates.
-
-'use client';
-
-/**
- * @file XDSStepperContext.ts
- * @input Uses React createContext/use
- * @output Exports XDSStepperContext, useXDSStepperContext, and context types
- * @position Context for XDSStepper <-> XDSStep communication
- *
- * SYNC: When modified, update these files to stay in sync:
- * - /packages/lab/src/Stepper/Stepper.doc.mjs
- * - /packages/lab/src/Stepper/index.ts
- */
-
-import {createContext, use} from 'react';
-
-export type XDSStepperOrientation = 'horizontal' | 'vertical';
-export type XDSStepperDensity = 'compact' | 'balanced' | 'spacious';
-
-export interface XDSStepperContextValue {
- activeStep: number;
- orientation: XDSStepperOrientation;
- isNonLinear: boolean;
- onStepClick: ((index: number) => void) | null;
- density: XDSStepperDensity;
-}
-
-export const XDSStepperContext = createContext<XDSStepperContextValue | null>(
- null,
-);
-XDSStepperContext.displayName = 'XDSStepperContext';
-
-export function useXDSStepperContext(): XDSStepperContextValue {
- const ctx = use(XDSStepperContext);
- if (ctx == null) {
- throw new Error(
- 'useXDSStepperContext must be used within XDSStepper. ' +
- 'Wrap your XDSStep in <XDSStepper>.',
- );
- }
- return ctx;
-}
diff --git a/packages/lab/src/Stepper/index.ts b/packages/lab/src/Stepper/index.ts
index 548ba9a613..f71cc98979 100644
--- a/packages/lab/src/Stepper/index.ts
+++ b/packages/lab/src/Stepper/index.ts
@@ -2,13 +2,13 @@
'use client';
-export {XDSStepper} from './XDSStepper';
-export type {XDSStepperProps} from './XDSStepper';
+export {Stepper} from './Stepper';
+export type {StepperProps} from './Stepper';
-export {XDSStep} from './XDSStep';
-export type {XDSStepProps, XDSStepIndicatorPreset} from './XDSStep';
+export {Step} from './Step';
+export type {StepProps, StepIndicatorPreset} from './Step';
-export type {XDSStepStatus} from './XDSStepStatus';
+export type {StepStatus} from './StepStatus';
-export {useXDSStepperContext} from './XDSStepperContext';
-export type {XDSStepperOrientation} from './XDSStepperContext';
+export {useStepperContext} from './StepperContext';
+export type {StepperOrientation} from './StepperContext';
diff --git a/packages/lab/src/ThreeD/XDS3DAxis.tsx b/packages/lab/src/ThreeD/ThreeDAxis.tsx
similarity index 93%
rename from packages/lab/src/ThreeD/XDS3DAxis.tsx
rename to packages/lab/src/ThreeD/ThreeDAxis.tsx
index bec7891cb3..f24f54a5a3 100644
--- a/packages/lab/src/ThreeD/XDS3DAxis.tsx
+++ b/packages/lab/src/ThreeD/ThreeDAxis.tsx
@@ -1,18 +1,18 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDS3DAxis.tsx
+ * @file ThreeDAxis.tsx
* @output 3D axis lines with labels at each end
*/
import {use3D} from './ThreeDContext';
-export interface XDS3DAxisProps {
+export interface ThreeDAxisProps {
/** Show axis labels (default: true) */
labels?: boolean;
}
-export function XDS3DAxis({labels = true}: XDS3DAxisProps) {
+export function ThreeDAxis({labels = true}: ThreeDAxisProps) {
const {project, xKey, yKey, zKey, xDomain, yDomain, zDomain} = use3D();
const origin = project(0, 0, 0);
diff --git a/packages/lab/src/ThreeD/XDS3DBar.tsx b/packages/lab/src/ThreeD/ThreeDBar.tsx
similarity index 96%
rename from packages/lab/src/ThreeD/XDS3DBar.tsx
rename to packages/lab/src/ThreeD/ThreeDBar.tsx
index adddb5b801..b0a74d8716 100644
--- a/packages/lab/src/ThreeD/XDS3DBar.tsx
+++ b/packages/lab/src/ThreeD/ThreeDBar.tsx
@@ -1,24 +1,24 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDS3DBar.tsx
+ * @file ThreeDBar.tsx
* @output 3D bar chart — projected rectangles with depth shading
*/
import {useMemo} from 'react';
import {use3D} from './ThreeDContext';
-export interface XDS3DBarProps {
+export interface ThreeDBarProps {
color: string;
barWidth?: number;
barDepth?: number;
}
-export function XDS3DBar({
+export function ThreeDBar({
color,
barWidth = 0.06,
barDepth = 0.06,
-}: XDS3DBarProps) {
+}: ThreeDBarProps) {
const {
data,
xKey,
diff --git a/packages/lab/src/ThreeD/XDS3DChart.tsx b/packages/lab/src/ThreeD/ThreeDChart.tsx
similarity index 97%
rename from packages/lab/src/ThreeD/XDS3DChart.tsx
rename to packages/lab/src/ThreeD/ThreeDChart.tsx
index c8f27886e1..0d0c171c33 100644
--- a/packages/lab/src/ThreeD/XDS3DChart.tsx
+++ b/packages/lab/src/ThreeD/ThreeDChart.tsx
@@ -1,7 +1,7 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDS3DChart.tsx
+ * @file ThreeDChart.tsx
* @output Root 3D chart container — projected SVG with depth sorting
* @position Parent component; all 3D marks read from its context
*/
@@ -19,7 +19,7 @@ import {
import {ThreeDProvider} from './ThreeDContext';
import type {Camera, ProjectedPoint} from './types';
-export interface XDS3DChartProps {
+export interface ThreeDChartProps {
data: Record<string, unknown>[];
xKey: string;
yKey: string;
@@ -56,7 +56,7 @@ function computeDomain(
return [min === Infinity ? 0 : min, max === -Infinity ? 1 : max];
}
-export function XDS3DChart({
+export function ThreeDChart({
data,
xKey,
yKey,
@@ -70,7 +70,7 @@ export function XDS3DChart({
interactive = false,
autoRotate = 0,
children,
-}: XDS3DChartProps) {
+}: ThreeDChartProps) {
const containerRef = useRef<HTMLDivElement>(null);
const [containerWidth, setContainerWidth] = useState(0);
const [camera, setCamera] = useState<Camera>({
@@ -108,7 +108,7 @@ export function XDS3DChart({
}, []);
// Projection: normalized [0,1]^3 → 2D pixel coords
- // SYNC: This math is replicated in XDS3DScatterGL's vertex shader.
+ // SYNC: This math is replicated in ThreeDScatterGL's vertex shader.
// Both must produce identical output. Verified by projection.test.ts.
// If you change this, update the shader and re-run the parity tests.
const project = useMemo(() => {
diff --git a/packages/lab/src/ThreeD/ThreeDContext.ts b/packages/lab/src/ThreeD/ThreeDContext.ts
index fca6d3ef02..b50f3d2435 100644
--- a/packages/lab/src/ThreeD/ThreeDContext.ts
+++ b/packages/lab/src/ThreeD/ThreeDContext.ts
@@ -12,11 +12,11 @@ const ThreeDCtx = createContext<ThreeDContext | null>(null);
export const ThreeDProvider = ThreeDCtx.Provider;
-/** Access the 3D chart context. Throws if used outside XDS3DChart. */
+/** Access the 3D chart context. Throws if used outside ThreeDChart. */
export function use3D(): ThreeDContext {
const ctx = useContext(ThreeDCtx);
if (!ctx) {
- throw new Error('3D components must be used inside <XDS3DChart>');
+ throw new Error('3D components must be used inside <ThreeDChart>');
}
return ctx;
}
diff --git a/packages/lab/src/ThreeD/XDS3DGrid.tsx b/packages/lab/src/ThreeD/ThreeDGrid.tsx
similarity index 91%
rename from packages/lab/src/ThreeD/XDS3DGrid.tsx
rename to packages/lab/src/ThreeD/ThreeDGrid.tsx
index bd4b510a6a..9bf75da097 100644
--- a/packages/lab/src/ThreeD/XDS3DGrid.tsx
+++ b/packages/lab/src/ThreeD/ThreeDGrid.tsx
@@ -1,18 +1,18 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDS3DGrid.tsx
+ * @file ThreeDGrid.tsx
* @output 3D wireframe grid on the floor plane (y=0)
*/
import {useMemo} from 'react';
import {use3D} from './ThreeDContext';
-export interface XDS3DGridProps {
+export interface ThreeDGridProps {
divisions?: number;
}
-export function XDS3DGrid({divisions = 5}: XDS3DGridProps) {
+export function ThreeDGrid({divisions = 5}: ThreeDGridProps) {
const {project} = use3D();
const lines = useMemo(() => {
diff --git a/packages/lab/src/ThreeD/XDS3DScatter.tsx b/packages/lab/src/ThreeD/ThreeDScatter.tsx
similarity index 91%
rename from packages/lab/src/ThreeD/XDS3DScatter.tsx
rename to packages/lab/src/ThreeD/ThreeDScatter.tsx
index 45252634e4..263c63bfe3 100644
--- a/packages/lab/src/ThreeD/XDS3DScatter.tsx
+++ b/packages/lab/src/ThreeD/ThreeDScatter.tsx
@@ -1,24 +1,24 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDS3DScatter.tsx
+ * @file ThreeDScatter.tsx
* @output 3D scatter plot — projected circles with depth-based sizing/opacity
*/
import {useMemo} from 'react';
import {use3D} from './ThreeDContext';
-export interface XDS3DScatterProps {
+export interface ThreeDScatterProps {
color: string;
radius?: number;
opacity?: number;
}
-export function XDS3DScatter({
+export function ThreeDScatter({
color,
radius = 4,
opacity = 0.85,
-}: XDS3DScatterProps) {
+}: ThreeDScatterProps) {
const {
data,
xKey,
diff --git a/packages/lab/src/ThreeD/XDS3DScatterGL.tsx b/packages/lab/src/ThreeD/ThreeDScatterGL.tsx
similarity index 95%
rename from packages/lab/src/ThreeD/XDS3DScatterGL.tsx
rename to packages/lab/src/ThreeD/ThreeDScatterGL.tsx
index d7e7378855..01d5b0f52b 100644
--- a/packages/lab/src/ThreeD/XDS3DScatterGL.tsx
+++ b/packages/lab/src/ThreeD/ThreeDScatterGL.tsx
@@ -1,11 +1,11 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDS3DScatterGL.tsx
+ * @file ThreeDScatterGL.tsx
* @output WebGL 3D scatter — canvas overlaid outside SVG for sharp DPR rendering
- * @position Child of XDS3DChart; reads camera from context (Tier 1)
+ * @position Child of ThreeDChart; reads camera from context (Tier 1)
*
- * SYNC: The vertex shader replicates XDS3DChart's project() math exactly.
+ * SYNC: The vertex shader replicates ThreeDChart's project() math exactly.
* Verified by projection.test.ts.
*
* The canvas renders as an absolute-positioned sibling to the SVG (not inside
@@ -16,7 +16,7 @@
import {useRef, useEffect, useMemo} from 'react';
import {use3D} from './ThreeDContext';
-export interface XDS3DScatterGLProps {
+export interface ThreeDScatterGLProps {
color: string;
size?: number;
opacity?: number;
@@ -27,7 +27,7 @@ function hexToGL(hex: string): [number, number, number] {
return [(n >> 16) / 255, ((n >> 8) & 0xff) / 255, (n & 0xff) / 255];
}
-// SYNC: Steps 1-5 match XDS3DChart.project() exactly.
+// SYNC: Steps 1-5 match ThreeDChart.project() exactly.
const VERT = `
attribute vec3 a_position;
uniform vec2 u_resolution;
@@ -112,11 +112,11 @@ function createProgram(gl: WebGLRenderingContext): WebGLProgram | null {
return p;
}
-export function XDS3DScatterGL({
+export function ThreeDScatterGL({
color,
size = 4,
opacity = 0.85,
-}: XDS3DScatterGLProps) {
+}: ThreeDScatterGLProps) {
const {
data,
xKey,
diff --git a/packages/lab/src/ThreeD/XDS3DSurface.tsx b/packages/lab/src/ThreeD/ThreeDSurface.tsx
similarity index 95%
rename from packages/lab/src/ThreeD/XDS3DSurface.tsx
rename to packages/lab/src/ThreeD/ThreeDSurface.tsx
index 17723871d2..3669c96cae 100644
--- a/packages/lab/src/ThreeD/XDS3DSurface.tsx
+++ b/packages/lab/src/ThreeD/ThreeDSurface.tsx
@@ -1,17 +1,17 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
/**
- * @file XDS3DSurface.tsx
+ * @file ThreeDSurface.tsx
* @output 3D surface mesh — projected triangulated grid with color mapping
*/
import {useMemo} from 'react';
import {use3D} from './ThreeDContext';
-export interface XDS3DSurfaceProps {
+export interface ThreeDSurfaceProps {
/**
* Color ramp for surface height — low to high.
- * Use useXDSChartColors().sequential.blue(5).
+ * Use useChartColors().sequential.blue(5).
*/
colorRange: string[];
opacity?: number;
@@ -34,11 +34,11 @@ function lerpColor(colors: string[], t: number): string {
* 3D surface mesh. Data should be a grid of points with x, y (height), z.
* Points are triangulated in order and colored by y-value.
*/
-export function XDS3DSurface({
+export function ThreeDSurface({
colorRange,
opacity = 0.8,
wireframe = false,
-}: XDS3DSurfaceProps) {
+}: ThreeDSurfaceProps) {
const {
data,
xKey,
diff --git a/packages/lab/src/ThreeD/index.ts b/packages/lab/src/ThreeD/index.ts
index 3c92573114..10747212f8 100644
--- a/packages/lab/src/ThreeD/index.ts
+++ b/packages/lab/src/ThreeD/index.ts
@@ -1,11 +1,11 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
-export {XDS3DChart, type XDS3DChartProps} from './XDS3DChart';
-export {XDS3DScatter, type XDS3DScatterProps} from './XDS3DScatter';
-export {XDS3DScatterGL, type XDS3DScatterGLProps} from './XDS3DScatterGL';
-export {XDS3DBar, type XDS3DBarProps} from './XDS3DBar';
-export {XDS3DGrid, type XDS3DGridProps} from './XDS3DGrid';
-export {XDS3DAxis, type XDS3DAxisProps} from './XDS3DAxis';
-export {XDS3DSurface, type XDS3DSurfaceProps} from './XDS3DSurface';
+export {ThreeDChart, type ThreeDChartProps} from './ThreeDChart';
+export {ThreeDScatter, type ThreeDScatterProps} from './ThreeDScatter';
+export {ThreeDScatterGL, type ThreeDScatterGLProps} from './ThreeDScatterGL';
+export {ThreeDBar, type ThreeDBarProps} from './ThreeDBar';
+export {ThreeDGrid, type ThreeDGridProps} from './ThreeDGrid';
+export {ThreeDAxis, type ThreeDAxisProps} from './ThreeDAxis';
+export {ThreeDSurface, type ThreeDSurfaceProps} from './ThreeDSurface';
export {use3D} from './ThreeDContext';
export type {ThreeDContext, Camera, Point3D, ProjectedPoint} from './types';
diff --git a/packages/lab/src/ThreeD/projection.test.ts b/packages/lab/src/ThreeD/projection.test.ts
index 06f61c4d70..d386d46f08 100644
--- a/packages/lab/src/ThreeD/projection.test.ts
+++ b/packages/lab/src/ThreeD/projection.test.ts
@@ -3,15 +3,15 @@
import {describe, it, expect} from 'vitest';
/**
- * Verifies that the XDS3DScatterGL shader projection produces identical
- * output to XDS3DChart's project() function. This is a Tier 1 guarantee —
+ * Verifies that the ThreeDScatterGL shader projection produces identical
+ * output to ThreeDChart's project() function. This is a Tier 1 guarantee —
* SVG and WebGL marks must agree on pixel positions.
*
* The shader's rotation math is replicated here in JS. If someone changes
* project() or the shader without updating the other, this test fails.
*/
-// JS implementation of project() from XDS3DChart
+// JS implementation of project() from ThreeDChart
function projectJS(
nx: number,
ny: number,
diff --git a/packages/lab/src/ThreeD/types.ts b/packages/lab/src/ThreeD/types.ts
index 678c7f8924..511a7dcf63 100644
--- a/packages/lab/src/ThreeD/types.ts
+++ b/packages/lab/src/ThreeD/types.ts
@@ -33,7 +33,7 @@ export interface Camera {
distance?: number;
}
-/** 3D context provided by XDS3DChart to children */
+/** 3D context provided by ThreeDChart to children */
export interface ThreeDContext {
/** Inner width in pixels */
width: number;
diff --git a/packages/lab/src/index.ts b/packages/lab/src/index.ts
index eac9f9a446..7910f53807 100644
--- a/packages/lab/src/index.ts
+++ b/packages/lab/src/index.ts
@@ -11,8 +11,8 @@
*/
// Code components — syntax highlighting domain
-export {XDSCodeBlock, type XDSCodeBlockProps} from './CodeBlock';
-export {XDSCodeEditor, type XDSCodeEditorProps} from './CodeEditor';
+export {CodeBlock, type CodeBlockProps} from './CodeBlock';
+export {CodeEditor, type CodeEditorProps} from './CodeEditor';
export {
tokenize,
tokenizeAsync,
@@ -22,17 +22,17 @@ export {
// Chat — experimental reasoning display
export {
- XDSChatReasoning,
- type XDSChatReasoningProps,
-} from './ChatReasoning/XDSChatReasoning';
+ ChatReasoning,
+ type ChatReasoningProps,
+} from './ChatReasoning/ChatReasoning';
// Schedule — experimental full-calendar views
export * from './Schedule';
// SVG Icon system — CSS-variable-driven multi-variation icons
export {
- XDSSVGIcon,
- type XDSSVGIconProps,
+ SVGIcon,
+ type SVGIconProps,
type SVGIconVariation,
type SVGIconSize,
type SVGIconColor,
@@ -62,53 +62,53 @@ export {
// Chart components — composable d3-based data visualization
export {
- XDSChart,
- type XDSChartProps,
+ Chart,
+ type ChartProps,
type YBaseline,
- XDSChartAxis,
- type XDSChartAxisProps,
- XDSChartGrid,
- type XDSChartGridProps,
- XDSChartBar,
- type XDSChartBarProps,
- XDSChartLine,
- type XDSChartLineProps,
- XDSChartArea,
- type XDSChartAreaProps,
- XDSChartErrorBar,
- type XDSChartErrorBarProps,
- XDSChartCandlestick,
- type XDSChartCandlestickProps,
- XDSChartDot,
- type XDSChartDotProps,
- XDSChartDotGL,
- type XDSChartDotGLProps,
- XDSChartDotGLInteractive,
- type XDSChartDotGLInteractiveProps,
- XDSChartHeatmapGL,
- type XDSChartHeatmapGLProps,
- XDSChartStreamGL,
- type XDSChartStreamGLProps,
- type XDSChartStreamGLHandle,
- XDSChartTooltip,
- type XDSChartTooltipProps,
+ ChartAxis,
+ type ChartAxisProps,
+ ChartGrid,
+ type ChartGridProps,
+ ChartBar,
+ type ChartBarProps,
+ ChartLine,
+ type ChartLineProps,
+ ChartArea,
+ type ChartAreaProps,
+ ChartErrorBar,
+ type ChartErrorBarProps,
+ ChartCandlestick,
+ type ChartCandlestickProps,
+ ChartDot,
+ type ChartDotProps,
+ ChartDotGL,
+ type ChartDotGLProps,
+ ChartDotGLInteractive,
+ type ChartDotGLInteractiveProps,
+ ChartHeatmapGL,
+ type ChartHeatmapGLProps,
+ ChartStreamGL,
+ type ChartStreamGLProps,
+ type ChartStreamGLHandle,
+ ChartTooltip,
+ type ChartTooltipProps,
type ChartCrosshairMode,
- XDSChartLegend,
- type XDSChartLegendProps,
- type XDSChartLegendItem,
+ ChartLegend,
+ type ChartLegendProps,
+ type ChartLegendItem,
useChart,
type ChartContext,
type ChartMargin,
type ChartScale,
m4Reduce,
type M4Point,
- useXDSChartColors,
- useXDSChartRange,
- type UseXDSChartRangeOptions,
- type UseXDSChartRangeReturn,
- getXDSChartColors,
- getXDSChartColorsFromResolver,
- type XDSChartColorsAPI,
+ useChartColors,
+ useChartRange,
+ type UseChartRangeOptions,
+ type UseChartRangeReturn,
+ getChartColors,
+ getChartColorsFromResolver,
+ type ChartColorsAPI,
type SequentialHue,
type TokenResolver,
compactNumber,
@@ -120,18 +120,18 @@ export {
// Radial charts — spider, pie, donut
export {
- XDSRadialChart,
- type XDSRadialChartProps,
- XDSRadialGrid,
- type XDSRadialGridProps,
- XDSRadialArea,
- type XDSRadialAreaProps,
- XDSRadialAxis,
- type XDSRadialAxisProps,
- XDSRadialSlice,
- type XDSRadialSliceProps,
- XDSRadialTooltip,
- type XDSRadialTooltipProps,
+ RadialChart,
+ type RadialChartProps,
+ RadialGrid,
+ type RadialGridProps,
+ RadialArea,
+ type RadialAreaProps,
+ RadialAxis,
+ type RadialAxisProps,
+ RadialSlice,
+ type RadialSliceProps,
+ RadialTooltip,
+ type RadialTooltipProps,
type RadialTooltipDatum,
useRadial,
type RadialContext,
@@ -140,20 +140,20 @@ export {
// 3D charts — projected SVG with interactive rotation
export {
- XDS3DChart,
- type XDS3DChartProps,
- XDS3DScatter,
- XDS3DScatterGL,
- type XDS3DScatterProps,
- type XDS3DScatterGLProps,
- XDS3DBar,
- type XDS3DBarProps,
- XDS3DGrid,
- type XDS3DGridProps,
- XDS3DAxis,
- type XDS3DAxisProps,
- XDS3DSurface,
- type XDS3DSurfaceProps,
+ ThreeDChart,
+ type ThreeDChartProps,
+ ThreeDScatter,
+ ThreeDScatterGL,
+ type ThreeDScatterProps,
+ type ThreeDScatterGLProps,
+ ThreeDBar,
+ type ThreeDBarProps,
+ ThreeDGrid,
+ type ThreeDGridProps,
+ ThreeDAxis,
+ type ThreeDAxisProps,
+ ThreeDSurface,
+ type ThreeDSurfaceProps,
use3D,
type ThreeDContext,
type Camera,
@@ -163,60 +163,60 @@ export {
// Chart interactions
export {
- XDSChartBrush,
- type XDSChartBrushProps,
+ ChartBrush,
+ type ChartBrushProps,
type BrushMode,
type BrushRange,
- XDSChartZoom,
- type XDSChartZoomProps,
- XDSChartSelect,
- type XDSChartSelectProps,
- XDSChartReferenceLine,
- type XDSChartReferenceLineProps,
+ ChartZoom,
+ type ChartZoomProps,
+ ChartSelect,
+ type ChartSelectProps,
+ ChartReferenceLine,
+ type ChartReferenceLineProps,
} from './Chart';
// Sankey / flow diagrams — ribbon-based flow visualization
export {
- XDSSankeyChart,
- type XDSSankeyChartProps,
- XDSSankeyLink,
- type XDSSankeyLinkProps,
- XDSSankeyNode,
- type XDSSankeyNodeProps,
- XDSSankeyLabel,
- type XDSSankeyLabelProps,
+ SankeyChart,
+ type SankeyChartProps,
+ SankeyLink,
+ type SankeyLinkProps,
+ SankeyNode,
+ type SankeyNodeProps,
+ SankeyLabel,
+ type SankeyLabelProps,
useSankey,
- type SankeyNode,
- type SankeyLink,
+ type SankeyNodeDatum,
+ type SankeyLinkDatum,
type SankeyColumn,
type SankeyColumnDef,
type SankeyNodeLayout,
type SankeyLinkLayout,
type SankeyColumnLayout,
- XDSSankeyGrid,
- type XDSSankeyGridProps,
+ SankeyGrid,
+ type SankeyGridProps,
type SankeyContext,
} from './Sankey';
// Chart v2 — config model
export {
- XDSChart as XDSChartV2,
- type XDSChartProps as XDSChartV2Props,
- XDSChartLegend as XDSChartV2Legend,
- type XDSChartLegendProps as XDSChartV2LegendProps,
- type LegendItem as XDSChartV2LegendItem,
- XDSChartAxis as XDSChartV2Axis,
- type XDSChartAxisProps as XDSChartV2AxisProps,
- XDSChartGrid as XDSChartV2Grid,
- type XDSChartGridProps as XDSChartV2GridProps,
- XDSChartSwatch as XDSChartV2Swatch,
+ Chart as ChartV2,
+ type ChartProps as ChartV2Props,
+ ChartLegend as ChartV2Legend,
+ type ChartLegendProps as ChartV2LegendProps,
+ type LegendItem as ChartV2LegendItem,
+ ChartAxis as ChartV2Axis,
+ type ChartAxisProps as ChartV2AxisProps,
+ ChartGrid as ChartV2Grid,
+ type ChartGridProps as ChartV2GridProps,
+ ChartSwatch as ChartV2Swatch,
swatchVariantForType as xdsChartV2SwatchVariantForType,
- type XDSChartSwatchProps as XDSChartV2SwatchProps,
- type XDSChartSwatchVariant as XDSChartV2SwatchVariant,
- XDSChartTooltip as XDSChartV2Tooltip,
- type XDSChartTooltipProps as XDSChartV2TooltipProps,
- type XDSChartTooltipPlacement as XDSChartV2TooltipPlacement,
- type TooltipSeriesValue as XDSChartV2TooltipSeriesValue,
+ type ChartSwatchProps as ChartV2SwatchProps,
+ type ChartSwatchVariant as ChartV2SwatchVariant,
+ ChartTooltip as ChartV2Tooltip,
+ type ChartTooltipProps as ChartV2TooltipProps,
+ type ChartTooltipPlacement as ChartV2TooltipPlacement,
+ type TooltipSeriesValue as ChartV2TooltipSeriesValue,
bar,
line,
dot,