From 8837ffd20ae16021e262cb46d8abd626e1bdcfbb Mon Sep 17 00:00:00 2001 From: Aaron Robertshaw <60436221+aaronrobertshaw@users.noreply.github.com> Date: Thu, 14 Oct 2021 17:51:35 +1000 Subject: [PATCH] Add story illustrating custom panel columns --- .../src/tools-panel/stories/index.js | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) diff --git a/packages/components/src/tools-panel/stories/index.js b/packages/components/src/tools-panel/stories/index.js index c326418aff4985..e9a39b2932dbd7 100644 --- a/packages/components/src/tools-panel/stories/index.js +++ b/packages/components/src/tools-panel/stories/index.js @@ -221,6 +221,114 @@ export const WithSlotFillItems = () => { ); }; +export const WithCustomColumns = () => { + const [ size, setSize ] = useState(); + const [ width, setWidth ] = useState(); + const [ height, setHeight ] = useState(); + const [ depth, setDepth ] = useState(); + const [ padding, setPadding ] = useState(); + const [ margin, setMargin ] = useState(); + + const resetAll = () => { + setSize( undefined ); + setWidth( undefined ); + setHeight( undefined ); + setDepth( undefined ); + setPadding( undefined ); + setMargin( undefined ); + }; + + return ( + + + + !! size } + label="Size" + onDeselect={ () => setSize( undefined ) } + isShownByDefault={ true } + > + setSize( next ) } + /> + + !! width } + label="Width" + onDeselect={ () => setWidth( undefined ) } + isShownByDefault={ true } + > + setWidth( next ) } + /> + + !! height } + label="Height" + onDeselect={ () => setHeight( undefined ) } + isShownByDefault={ true } + > + setHeight( next ) } + /> + + !! depth } + label="Depth" + onDeselect={ () => setDepth( undefined ) } + isShownByDefault={ true } + > + setDepth( next ) } + /> + + !! padding } + label="Padding" + onDeselect={ () => setPadding( undefined ) } + isShownByDefault={ true } + > + setPadding( next ) } + /> + + !! margin } + label="Margin" + onDeselect={ () => setMargin( undefined ) } + isShownByDefault={ true } + > + setMargin( next ) } + /> + + + + + ); +}; + export { TypographyPanel } from './typography-panel'; const PanelWrapperView = styled.div`