// @flow
import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { withDocs } from '../../../../.storybook/with-docs';
import docs from './CLICK_OUTSIDE.mkd';
import { ClickOutside } from './index';
import { Box } from '../../../primitives';
import { Card } from '../../structures';

storiesOf('Core/Behaviors/ClickOutside', module).add(
  'normal',
  withDocs(docs)(() => (
    <Box
      colorName="background"
      spacing="p7"
      stacked="column"
      justify="center"
      align="center"
    >
      <ClickOutside onClickOutside={action('Click Outside')}>
        <Card spacing="p5" />
      </ClickOutside>
    </Box>
  )),
);
