import { ComponentMeta, ComponentStory } from '@storybook/react';
import { IntlProvider } from 'react-intl';
import WidgetComponent from './widget';

export default {
  title: 'Molecules/Layout',
  component: WidgetComponent,
  args: {
    expanded: true,
    withBorders: false,
  },
  argTypes: {
    children: {
      control: {
        type: 'text',
      },
      description: 'The widget body',
      type: {
        name: 'string',
        required: true,
      },
    },
    expanded: {
      control: {
        type: 'boolean',
      },
      description: 'The widget state (expanded or collapsed)',
      table: {
        category: 'Options',
        defaultValue: { summary: true },
      },
      type: {
        name: 'boolean',
        required: false,
      },
    },
    level: {
      control: {
        type: 'number',
      },
      description: 'The heading level.',
      type: {
        name: 'number',
        required: true,
      },
    },
    title: {
      control: {
        type: 'text',
      },
      description: 'The widget title.',
      type: {
        name: 'string',
        required: true,
      },
    },
    withBorders: {
      control: {
        type: 'boolean',
      },
      description: 'Define if the content should have borders.',
      table: {
        category: 'Options',
        defaultValue: { summary: false },
      },
      type: {
        name: 'boolean',
        required: false,
      },
    },
  },
} as ComponentMeta<typeof WidgetComponent>;

const Template: ComponentStory<typeof WidgetComponent> = (args) => (
  <IntlProvider locale="en">
    <WidgetComponent {...args} />
  </IntlProvider>
);

export const Widget = Template.bind({});
Widget.args = {
  children: 'Widget body',
  level: 2,
  title: 'Widget title',
};
ce3d489a1675caafcbb5d74488de0c4e3ea'>commit</a><a href='/www.armandphilippot.com/diff/tests/jest/__mocks__/styleMock.js?h=v2.0.0&amp;id=2ce74ce3d489a1675caafcbb5d74488de0c4e3ea'>diff</a><a href='/www.armandphilippot.com/stats/tests/jest/__mocks__/styleMock.js?h=v2.0.0'>stats</a></td><td class='form'><form class='right' method='get' action='/www.armandphilippot.com/log/tests/jest/__mocks__/styleMock.js'>
<input type='hidden' name='h' value='v2.0.0'/><input type='hidden' name='id' value='2ce74ce3d489a1675caafcbb5d74488de0c4e3ea'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/www.armandphilippot.com/tree/?h=v2.0.0&amp;id=2ce74ce3d489a1675caafcbb5d74488de0c4e3ea'>root</a>/<a href='/www.armandphilippot.com/tree/tests?h=v2.0.0&amp;id=2ce74ce3d489a1675caafcbb5d74488de0c4e3ea'>tests</a>/<a href='/www.armandphilippot.com/tree/tests/jest?h=v2.0.0&amp;id=2ce74ce3d489a1675caafcbb5d74488de0c4e3ea'>jest</a>/<a href='/www.armandphilippot.com/tree/tests/jest/__mocks__?h=v2.0.0&amp;id=2ce74ce3d489a1675caafcbb5d74488de0c4e3ea'>__mocks__</a>/<a href='/www.armandphilippot.com/tree/tests/jest/__mocks__/styleMock.js?h=v2.0.0&amp;id=2ce74ce3d489a1675caafcbb5d74488de0c4e3ea'>styleMock.js</a></div><div class='content'>blob: f053ebf7976e3726d11f3c03fade2170903889a5 (<a href='/www.armandphilippot.com/plain/tests/jest/__mocks__/styleMock.js?h=v2.0.0&amp;id=2ce74ce3d489a1675caafcbb5d74488de0c4e3ea'>plain</a>)
<table summary='blob content' class='blob'>
<tr><td class='linenumbers'><pre><a id='n1' href='#n1'>1</a>
</pre></td>
<td class='lines'><pre><code>