-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBaseInputsList.stories.tsx
More file actions
82 lines (71 loc) · 1.94 KB
/
BaseInputsList.stories.tsx
File metadata and controls
82 lines (71 loc) · 1.94 KB
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
import React from 'react';
import type { Meta, StoryObj } from '@storybook/react';
import BaseInputsList from './BaseInputsList';
import { DIRECTION } from './BaseInputsList.types';
interface ItemType {
id: string;
label: string;
}
const meta: Meta<typeof BaseInputsList<ItemType>> = {
title: 'components/src/base/BaseInputsList',
component: BaseInputsList<ItemType>,
parameters: {
layout: 'centered',
docs: {
controls: { exclude: ['items', 'renderItem', 'labelProps', 'helperTextProps'] },
},
},
tags: ['autodocs', 'foundation', 'base'],
argTypes: {
className: { control: 'text' },
direction: {
control: 'select',
options: Object.values(DIRECTION),
},
},
args: {
items: [
{ id: '1', label: 'Item 1' },
{ id: '2', label: 'Item 2' },
{ id: '3', label: 'Item 3' },
],
renderItem: (item: ItemType) => (
<div key={item.id}>
{item.id}: {item.label}
</div>
),
},
};
export default meta;
type Story = StoryObj<typeof BaseInputsList<ItemType>>;
export const Default: Story = {
name: 'Default',
args: {
labelProps: { children: 'Choice Inputs List Label' },
helperTextProps: { children: 'This is a helper text' },
},
};
export const Horizontal: Story = {
name: 'Horizontal',
args: {
labelProps: { children: 'Choice Inputs List Label' },
helperTextProps: { children: 'This is a helper text' },
direction: DIRECTION.HORIZONTAL,
},
};
export const NoHelper: Story = {
name: 'No Helper',
args: {
labelProps: { children: 'Choice Inputs List Label' },
},
};
export const NoLabel: Story = {
name: 'No Label',
args: {
helperTextProps: { children: 'This is a helper text' },
},
};
export const OnlyItems: Story = {
name: 'Only Items',
args: {},
};