Skip to content

Commit

Permalink
Add stories
Browse files Browse the repository at this point in the history
  • Loading branch information
mirka committed Dec 12, 2022
1 parent 0278d3e commit d99f3e2
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/components/src/sandbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const style = `
}
`;

export default function SandBox( {
function SandBox( {
html = '',
title = '',
type,
Expand Down Expand Up @@ -276,3 +276,5 @@ export default function SandBox( {
/>
);
}

export default SandBox;
32 changes: 32 additions & 0 deletions packages/components/src/sandbox/stories/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* External dependencies
*/
import type { ComponentMeta, ComponentStory } from '@storybook/react';

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

const meta: ComponentMeta< typeof SandBox > = {
component: SandBox,
title: 'Components/SandBox',
argTypes: {
onFocus: { control: { type: null } },
},
parameters: {
actions: { argTypesRegex: '^on.*' },
controls: { expanded: true },
docs: { source: { state: 'open' } },
},
};
export default meta;

const Template: ComponentStory< typeof SandBox > = ( args ) => (
<SandBox { ...args } />
);

export const Default = Template.bind( {} );
Default.args = {
html: '<p>Arbitrary HTML content</p>',
};

0 comments on commit d99f3e2

Please sign in to comment.