Newer
Older
import type { Meta, StoryObj } from '@storybook/vue3';
import SelectButton from './SelectButton.vue';
import { fn } from '@storybook/test';
const meta: Meta = {
title: 'Components/SelectButton',
component: SelectButton,
tags: ['autodocs'],
parameters: {
docs: {
description: {
component: 'A component that is used to select a value from a list using a button.',
},
},
},
argTypes: {
options: {
control: 'array',
},
size: { control: 'select', options: ['small', 'medium', 'large', 'huge'] },
rounded: { control: 'boolean' },
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
control: 'select',
options: [
'white',
'slate',
'blue',
'sky',
'teal',
'green',
'yellow',
'orange',
'pink',
'fuchsia',
'purple',
'indigo',
'rose',
'red',
'black',
],
},
border: {
control: 'select',
options: [
'white',
'slate',
'blue',
'sky',
'teal',
'green',
'yellow',
'orange',
'pink',
'fuchsia',
'purple',
'indigo',
'rose',
'red',
'black',
],
},
disabled: { control: 'boolean' },
},
args: {
// primary: false,
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
onClick: fn(),
},
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
109
110
111
112
export default meta;
type Story = StoryObj<typeof meta>;
export const Primary: Story = {
args: {
options: [
{
label: 'First',
},
{
label: 'Second',
},
],
rounded: false,
disabled: false,
},
};
export const LargeFull: Story = {
args: {
options: [
{
label: 'First',
color: 'white',
backgroundColor: 'black',
},
{
label: 'Second',
activeColor: 'blue',
backgroundColor: 'yellow',
},
{
label: 'Third',
activeColor: 'green',
backgroundColor: 'purple',
},
],
border: 'sky',
rounded: true,
disabled: false,
size: 'large',
},
};