diff --git a/packages/grafana-ui/src/components/Layout/Stack/Stack.story.tsx b/packages/grafana-ui/src/components/Layout/Stack/Stack.story.tsx index aace7d3f546..450cecb1eb0 100644 --- a/packages/grafana-ui/src/components/Layout/Stack/Stack.story.tsx +++ b/packages/grafana-ui/src/components/Layout/Stack/Stack.story.tsx @@ -80,13 +80,13 @@ export const AlignItemsExamples: StoryFn = () => { return (

Align items flex-start

- + {Array.from({ length: 5 }).map((_, i) => ( ))}

Align items flex-end

- + {Array.from({ length: 5 }).map((_, i) => ( ))} @@ -98,13 +98,13 @@ export const AlignItemsExamples: StoryFn = () => { ))}

Align items center

- + {Array.from({ length: 5 }).map((_, i) => ( ))}

Align items stretch

- + @@ -131,7 +131,7 @@ export const JustifyContentExamples: StoryFn = () => { {justifyContentOptions.map((justifyContent) => ( <>

Justify Content {justifyContent}

- + {Array.from({ length: 5 }).map((_, i) => ( ))} @@ -150,7 +150,7 @@ export const GapExamples: StoryFn = () => { {gapOptions.map((gap) => ( <>

Gap with spacingToken set to {gap}

- + {Array.from({ length: 5 }).map((_, i) => ( ))} @@ -188,7 +188,7 @@ export const DirectionExamples: StoryFn = () => { {directionOptions.map((direction) => ( <>

Direction {direction}

- + {Array.from({ length: 5 }).map((_, i) => ( ))} diff --git a/packages/grafana-ui/src/components/Layout/Stack/Stack.tsx b/packages/grafana-ui/src/components/Layout/Stack/Stack.tsx index 1f3279ae9c1..05d544739f5 100644 --- a/packages/grafana-ui/src/components/Layout/Stack/Stack.tsx +++ b/packages/grafana-ui/src/components/Layout/Stack/Stack.tsx @@ -69,7 +69,7 @@ const getStyles = ( flexDirection: val, })), getResponsiveStyle(theme, wrap, (val) => ({ - flexWrap: val, + flexWrap: typeof val === 'boolean' ? (val ? 'wrap' : 'nowrap') : val, })), getResponsiveStyle(theme, alignItems, (val) => ({ alignItems: val, diff --git a/packages/grafana-ui/src/components/Layout/types.ts b/packages/grafana-ui/src/components/Layout/types.ts index b31f68c97ab..f76d7738942 100644 --- a/packages/grafana-ui/src/components/Layout/types.ts +++ b/packages/grafana-ui/src/components/Layout/types.ts @@ -24,7 +24,7 @@ export type JustifyContent = | 'right'; export type Direction = 'row' | 'row-reverse' | 'column' | 'column-reverse'; -export type Wrap = 'nowrap' | 'wrap' | 'wrap-reverse'; +export type Wrap = boolean | 'nowrap' | 'wrap' | 'wrap-reverse'; type FlexGrow = number; type FlexShrink = number;