Skip to content

Commit

Permalink
Add storybook example
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewserong committed Nov 22, 2022
1 parent c8351eb commit 8cad9c7
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/block-editor/src/components/height-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default function HeightControl( {
};

return (
<fieldset className="component-height-control">
<fieldset className="block-editor-height-control">
<BaseControl.VisualLabel as="legend">
{ label }
</BaseControl.VisualLabel>
Expand Down Expand Up @@ -113,6 +113,7 @@ export default function HeightControl( {
}
withInputField={ false }
onChange={ handleSliderChange }
__nextHasNoMarginBottom
/>
</Spacer>
</FlexItem>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* WordPress dependencies
*/
import { useState } from '@wordpress/element';

/**
* Internal dependencies
*/
import HeightControl from '../';

export default {
component: HeightControl,
title: 'BlockEditor/HeightControl',
};

const Template = ( props ) => {
const [ value, setValue ] = useState();
return <HeightControl onChange={ setValue } value={ value } { ...props } />;
};

export const Default = Template.bind( {} );
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.block-editor-height-control {
border: 0;
margin: 0;
padding: 0;
}
1 change: 1 addition & 0 deletions packages/block-editor/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
@import "./components/date-format-picker/style.scss";
@import "./components/duotone-control/style.scss";
@import "./components/font-appearance-control/style.scss";
@import "./components/height-control/style.scss";
@import "./components/image-size-control/style.scss";
@import "./components/inner-blocks/style.scss";
@import "./components/inserter-list-item/style.scss";
Expand Down

0 comments on commit 8cad9c7

Please sign in to comment.