-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dropdown.stories.ts
64 lines (53 loc) · 1.55 KB
/
Dropdown.stories.ts
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
import Dropdown from '.';
import DropdownMenu from '@/components/DropdownMenu';
import {sizes} from '@/composables/useSize';
import {variants} from '@/composables/useVariant';
export default {
title: 'Components/Dropdown',
component: Dropdown,
argTypes: {},
};
const defaultArgs = {
items: [
{label: 'Item 1'},
{label: 'Item 2'},
{label: 'Item 3'},
],
text: 'I am a dropdown',
};
const template = (args) => ({
components: {Dropdown},
setup: () => ({args}),
template: '<Dropdown v-bind="args" />',
});
export const Default = template.bind({});
Default.args = defaultArgs;
export const Variants = (args) => ({
components: {Dropdown},
setup: () => ({args, variants}),
template: '<Dropdown v-for="v of variants" class="me-1 mb-1 d-inline-block" :variant="v" v-bind="args" />',
});
Variants.args = defaultArgs;
export const Sizing = (args) => ({
components: {Dropdown},
setup: () => ({args, sizes}),
template: '<Dropdown v-for="s of sizes" class="me-1 mb-1 d-inline-block" :size="s" v-bind="args" />',
});
Sizing.args = defaultArgs;
export const Menu = (args) => ({
components: {DropdownMenu},
setup: () => ({args}),
template: '<DropdownMenu class="d-block" v-bind="args" />',
});
Menu.args = {
items: [
{label: 'Dropdown header', header: true},
{label: 'Item one'},
{label: 'Item two'},
{label: 'Active item', active: true},
{label: 'Item three'},
{divider: true},
{label: 'Item four'},
{label: 'Item five'},
],
};