aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/molecules/meta-list/meta-item/meta-item.stories.tsx
blob: 3ddb8f12ad7c093a829d7dabd11c51c1acfb9bb4 (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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import type { ComponentMeta, ComponentStory } from '@storybook/react';
import { Link } from '../../../atoms';
import { MetaItem } from './meta-item';

/**
 * MetaItem - Storybook Meta
 */
export default {
  title: 'Molecules/MetaList/Item',
  component: MetaItem,
  argTypes: {
    label: {
      control: {
        type: 'text',
      },
      description: 'The item label.',
      type: {
        name: 'string',
        required: true,
      },
    },
  },
} as ComponentMeta<typeof MetaItem>;

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

/**
 * MetaItem Stories - SingleValue
 */
export const SingleValue = Template.bind({});
SingleValue.args = {
  label: 'Comments',
  value: 'No comments',
};

/**
 * MetaItem Stories - MultipleValues
 */
export const MultipleValues = Template.bind({});
MultipleValues.args = {
  label: 'Tags',
  value: [
    { id: 'tag1', value: <Link href="#tag1">Tag 1</Link> },
    { id: 'tag2', value: <Link href="#tag2">Tag 2</Link> },
  ],
};

/**
 * MetaItem Stories - SingleValueBordered
 */
export const SingleValueBordered = Template.bind({});
SingleValueBordered.args = {
  hasBorderedValues: true,
  label: 'Comments',
  value: 'No comments',
};

/**
 * MetaItem Stories - MultipleValuesBordered
 */
export const MultipleValuesBordered = Template.bind({});
MultipleValuesBordered.args = {
  hasBorderedValues: true,
  label: 'Tags',
  value: [
    { id: 'tag1', value: <Link href="#tag1">Tag 1</Link> },
    { id: 'tag2', value: <Link href="#tag2">Tag 2</Link> },
  ],
};

/**
 * MetaItem Stories - SingleValueInlined
 */
export const SingleValueInlined = Template.bind({});
SingleValueInlined.args = {
  isInline: true,
  label: 'Comments',
  value: 'No comments',
};

/**
 * MetaItem Stories - MultipleValuesInlined
 */
export const MultipleValuesInlined = Template.bind({});
MultipleValuesInlined.args = {
  isInline: true,
  label: 'Tags',
  value: [
    { id: 'tag1', value: <Link href="#tag1">Tag 1</Link> },
    { id: 'tag2', value: <Link href="#tag2">Tag 2</Link> },
  ],
};

/**
 * MetaItem Stories - InlinedValues
 */
export const InlinedValues = Template.bind({});
InlinedValues.args = {
  hasInlinedValues: true,
  label: 'Tags',
  value: [
    { id: 'tag1', value: <Link href="#tag1">Tag 1</Link> },
    { id: 'tag2', value: <Link href="#tag2">A long tag 2</Link> },
    { id: 'tag3', value: <Link href="#tag3">Tag 3</Link> },
  ],
};