diff --git a/packages/grafana-ui/src/components/ThemeDemos/ThemeDemo.tsx b/packages/grafana-ui/src/components/ThemeDemos/ThemeDemo.tsx index 6128326b5e8..cd5607a440b 100644 --- a/packages/grafana-ui/src/components/ThemeDemos/ThemeDemo.tsx +++ b/packages/grafana-ui/src/components/ThemeDemos/ThemeDemo.tsx @@ -18,17 +18,20 @@ import { Icon } from '../Icon/Icon'; import { Input } from '../Input/Input'; import { BackgroundColor, BorderColor, Box, BoxShadow } from '../Layout/Box/Box'; import { Stack } from '../Layout/Stack/Stack'; +import { ScrollContainer } from '../ScrollContainer/ScrollContainer'; import { Switch } from '../Switch/Switch'; import { Text, TextProps } from '../Text/Text'; interface DemoBoxProps { bg?: BackgroundColor; border?: BorderColor; + scrollable?: boolean; shadow?: BoxShadow; textColor?: TextProps['color']; } -const DemoBox = ({ bg, border, children, shadow }: React.PropsWithChildren) => { +const DemoBox = ({ bg, border, children, shadow, scrollable }: React.PropsWithChildren) => { + const MaybeScroll = scrollable ? ScrollContainer : React.Fragment; return ( - {children} + {children} ); }; @@ -121,7 +124,7 @@ export const ThemeDemo = () => { - + @@ -134,7 +137,7 @@ export const ThemeDemo = () => { - + @@ -154,7 +157,7 @@ export const ThemeDemo = () => { - +
@@ -229,7 +232,7 @@ export const ThemeDemo = () => { - + {allButtonVariants.map((variant) => (