-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIconButton.stories.ts
More file actions
84 lines (74 loc) · 1.95 KB
/
Copy pathIconButton.stories.ts
File metadata and controls
84 lines (74 loc) · 1.95 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
83
84
import type { StoryFn } from '@storybook/vue3-vite';
import { action } from 'storybook/actions';
import N8nIconButton from './IconButton.vue';
export default {
title: 'Core/Icon Button',
component: N8nIconButton,
argTypes: {
type: {
control: 'select',
options: ['primary', 'secondary', 'tertiary', 'success', 'warning', 'danger'],
},
size: {
control: {
type: 'select',
},
options: ['mini', 'small', 'medium', 'large', 'xlarge'],
},
},
parameters: {
backgrounds: { default: '--color--background--light-2' },
},
};
const methods = {
onClick: action('click'),
};
const Template: StoryFn = (args, { argTypes }) => ({
setup: () => ({ args }),
props: Object.keys(argTypes),
components: {
N8nIconButton,
},
template: '<n8n-icon-button @click="onClick" v-bind="args" />',
methods,
});
export const Button = Template.bind({});
Button.args = {
icon: 'plus',
title: 'my title',
};
const ManyTemplate: StoryFn = (args, { argTypes }) => ({
setup: () => ({ args }),
props: Object.keys(argTypes),
components: {
N8nIconButton,
},
template:
'<div> <n8n-icon-button v-bind="args" size="xlarge" @click="onClick" /> <n8n-icon-button v-bind="args" size="large" @click="onClick" /> <n8n-icon-button v-bind="args" size="medium" @click="onClick" /> <n8n-icon-button v-bind="args" size="small" @click="onClick" /> <n8n-icon-button v-bind="args" :loading="true" @click="onClick" /> <n8n-icon-button v-bind="args" :disabled="true" @click="onClick" /></div>',
methods,
});
export const Primary = ManyTemplate.bind({});
Primary.args = {
icon: 'plus',
title: 'my title',
type: 'primary',
};
export const Outline = ManyTemplate.bind({});
Outline.args = {
icon: 'plus',
title: 'my title',
type: 'primary',
outline: true,
};
export const Tertiary = ManyTemplate.bind({});
Tertiary.args = {
icon: 'plus',
title: 'my title',
type: 'tertiary',
};
export const Text = ManyTemplate.bind({});
Text.args = {
icon: 'plus',
title: 'my title',
type: 'text',
};