aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/atoms/figure/figure.stories.tsx
blob: 776364105447677ec590acd3b0c36a84f95f3fc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import type { ComponentMeta, ComponentStory } from '@storybook/react';
import NextImage from 'next/image';
import { Figure } from './figure';

/**
 * Figure - Storybook Meta
 */
export default {
  title: 'Atoms/Figure',
  component: Figure,
  args: {},
  argTypes: {
    caption: {
      control: {
        type: 'text',
      },
      description: 'A figure caption.',
      table: {
        category: 'Options',
      },
      type: {
        name: 'string',
        required: false,
      },
    },
    hasBorders: {
      control: {
        type: 'boolean',
      },
      description: 'Add borders around the figure.',
      table: {
        category: 'Styles',
        defaultValue: { summary: false },
      },
      type: {
        name: 'boolean',
        required: false,
      },
    },
  },
} as ComponentMeta<typeof Figure>;

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

/**
 * Figure Stories - Illustration
 */
export const Illustration = Template.bind({});
Illustration.args = {
  children: (
    <NextImage
      alt="An example"
      height={480}
      src="https://picsum.photos/640/480"
      width={640}
    />
  ),
};

/**
 * Figure Stories - BorderedIllustration
 */
export const BorderedIllustration = Template.bind({});
BorderedIllustration.args = {
  children: (
    <NextImage
      alt="An example"
      height={480}
      src="https://picsum.photos/640/480"
      width={640}
    />
  ),
  hasBorders: true,
};