diff --git a/packages/odyssey-react-mui/src/labs/Grid.tsx b/packages/odyssey-react-mui/src/labs/Grid.tsx index 1100ba7ea5..3303272b84 100644 --- a/packages/odyssey-react-mui/src/labs/Grid.tsx +++ b/packages/odyssey-react-mui/src/labs/Grid.tsx @@ -17,7 +17,7 @@ import { useOdysseyDesignTokens, } from "../OdysseyDesignTokensContext"; -type SupportedPaneRatios = +type SupportedRegionRatios = | [1] | [1, 1] | [1, 2] @@ -29,11 +29,11 @@ type SupportedPaneRatios = export type GridProps = { /** - * The supported pane ratios for the Grid. Each number is a fractional unit that is mapped to the 'fr' CSS unit. + * The supported region ratios for the Grid. Each number is a fractional unit that is mapped to the 'fr' CSS unit. * e.g. [2, 1] defines a 2/3, 1/3 layout and [1, 1, 1] defines a 1/3, 1/3, 1/3 layout * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_grid_layout/Basic_concepts_of_grid_layout#the_fr_unit */ - panes: SupportedPaneRatios; + regions: SupportedRegionRatios; /** * The content of the Grid. May be a `string` or any other `ReactNode` or array of `ReactNode`s. */ @@ -42,7 +42,7 @@ export type GridProps = { interface GridContentProps { odysseyDesignTokens: DesignTokens; - panes: string; + regions: string; } const GridContainer = styled("div", { @@ -56,10 +56,11 @@ const GridContainer = styled("div", { ); const GridContent = styled("div", { - shouldForwardProp: (prop) => !["odysseyDesignTokens", "panes"].includes(prop), -})(({ odysseyDesignTokens, panes }) => ({ + shouldForwardProp: (prop) => + !["odysseyDesignTokens", "regions"].includes(prop), +})(({ odysseyDesignTokens, regions }) => ({ display: "grid", - gridTemplateColumns: panes, + gridTemplateColumns: regions, gridColumnGap: odysseyDesignTokens.Spacing4, columnGap: odysseyDesignTokens.Spacing4, @@ -68,15 +69,17 @@ const GridContent = styled("div", { }, })); -const Grid = ({ panes, children }: GridProps) => { +const Grid = ({ regions, children }: GridProps) => { const odysseyDesignTokens = useOdysseyDesignTokens(); - const mappedPanes = panes.map((pane) => `minmax(0, ${pane}fr)`).join(" "); + const mappedRegions = regions + .map((region) => `minmax(0, ${region}fr)`) + .join(" "); return ( {Children.toArray(children).map((child) => child)} diff --git a/packages/odyssey-storybook/src/components/odyssey-labs/Grid/Grid.stories.tsx b/packages/odyssey-storybook/src/components/odyssey-labs/Grid/Grid.stories.tsx index 00689a4108..edab970c6a 100644 --- a/packages/odyssey-storybook/src/components/odyssey-labs/Grid/Grid.stories.tsx +++ b/packages/odyssey-storybook/src/components/odyssey-labs/Grid/Grid.stories.tsx @@ -20,13 +20,13 @@ const storybookMeta: Meta = { title: "Labs Components/Grid", component: Grid, argTypes: { - panes: { + regions: { control: "text", description: - "The supported pane ratios for the Grid. Each number is a fractional unit that is mapped to the 'fr' CSS unit. For example: [2, 1] defines a 2/3, 1/3 layout and [1, 1, 1] defines a 1/3, 1/3, 1/3 layout", + "The supported region ratios for the Grid. Each number is a fractional unit that is mapped to the 'fr' CSS unit. For example: [2, 1] defines a 2/3, 1/3 layout and [1, 1, 1] defines a 1/3, 1/3, 1/3 layout", table: { type: { - summary: "SupportedPaneRatios", + summary: "SupportedRegionRatios", }, }, }, @@ -57,13 +57,13 @@ export default storybookMeta; export const Single: StoryObj = { args: { - panes: [1], + regions: [1], }, render: function C(args) { return ( -

Pane

+

Region

); @@ -72,16 +72,16 @@ export const Single: StoryObj = { export const Split: StoryObj = { args: { - panes: [1, 1], + regions: [1, 1], }, render: function C(args) { return ( -

Pane

+

Region

-

Pane

+

Region

); @@ -90,16 +90,16 @@ export const Split: StoryObj = { export const TwoThirdsStart: StoryObj = { args: { - panes: [2, 1], + regions: [2, 1], }, render: function C(args) { return ( -

Pane

+

Region

-

Pane

+

Region

); @@ -108,16 +108,16 @@ export const TwoThirdsStart: StoryObj = { export const TwoThirdsEnd: StoryObj = { args: { - panes: [1, 2], + regions: [1, 2], }, render: function C(args) { return ( -

Pane

+

Region

-

Pane

+

Region

); @@ -126,16 +126,16 @@ export const TwoThirdsEnd: StoryObj = { export const ThreeFourthsStart: StoryObj = { args: { - panes: [3, 1], + regions: [3, 1], }, render: function C(args) { return ( -

Pane

+

Region

-

Pane

+

Region

); @@ -144,61 +144,61 @@ export const ThreeFourthsStart: StoryObj = { export const ThreeFourthsEnd: StoryObj = { args: { - panes: [1, 3], + regions: [1, 3], }, render: function C(args) { return ( -

Pane

+

Region

-

Pane

+

Region

); }, }; -export const ThreePaneSplit: StoryObj = { +export const ThreeRegionSplit: StoryObj = { args: { - panes: [1, 1, 1], + regions: [1, 1, 1], }, render: function C(args) { return ( -

Pane

+

Region

-

Pane

+

Region

-

Pane

+

Region

); }, }; -export const FourPaneSplit: StoryObj = { +export const FourRegionSplit: StoryObj = { args: { - panes: [1, 1, 1, 1], + regions: [1, 1, 1, 1], }, render: function C(args) { return ( -

Pane

+

Region

-

Pane

+

Region

-

Pane

+

Region

-

Pane

+

Region

); @@ -209,74 +209,74 @@ export const KitchenSink: StoryObj = { render: function () { return ( <> - + -

Pane

+

Region

- + -

Pane

+

Region

-

Pane

+

Region

- + -

Pane

+

Region

-

Pane

+

Region

- + -

Pane

+

Region

-

Pane

+

Region

- + -

Pane

+

Region

-

Pane

+

Region

- + -

Pane

+

Region

-

Pane

+

Region

- + -

Pane

+

Region

-

Pane

+

Region

-

Pane

+

Region

- + -

Pane

+

Region

-

Pane

+

Region

-

Pane

+

Region

-

Pane

+

Region

diff --git a/packages/odyssey-storybook/src/components/odyssey-labs/OdysseyLayout/OdysseyLayout.stories.tsx b/packages/odyssey-storybook/src/components/odyssey-labs/OdysseyLayout/OdysseyLayout.stories.tsx index 14dd6ac60f..a8fc06f345 100644 --- a/packages/odyssey-storybook/src/components/odyssey-labs/OdysseyLayout/OdysseyLayout.stories.tsx +++ b/packages/odyssey-storybook/src/components/odyssey-labs/OdysseyLayout/OdysseyLayout.stories.tsx @@ -326,7 +326,7 @@ export const KitchenSink: StoryObj = { onClose={onCloseDialog} isOpen={isDialogVisible} /> - + = { } isFullWidth={args.isFullWidth} > - + = {