-
Notifications
You must be signed in to change notification settings - Fork 1
/
Badge.stories.ts
60 lines (51 loc) · 1.63 KB
/
Badge.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
import Badge from '.';
import Btn from '@/components/Button';
import {variants} from '@/composables/useVariant';
export default {
title: 'Components/Badge',
component: Badge,
argTypes: {
variant: {
control: {type: 'select'},
options: variants,
},
},
};
const template = (args) => ({
components: {Badge},
setup() {
return {args};
},
template: '<Badge v-bind="args">I am a Badge</Badge>',
});
export const Default = template.bind({});
const variantsTemplate = (args) => ({
components: {Badge},
setup: () => ({args, variants}),
template: '<Badge v-for="v of variants" class="me-1 mb-1" :variant="v" v-bind="args">{{ v }}</Badge>',
});
export const Variants = variantsTemplate.bind({});
export const Pill = variantsTemplate.bind({});
Pill.args = {
pill: true,
};
export const Headings = (args) => ({
components: {Badge},
setup: () => ({args}),
template: `
<h1>Example heading <Badge>New</Badge></h1>
<h2>Example heading <Badge>New</Badge></h2>
<h3>Example heading <Badge>New</Badge></h3>
<h4>Example heading <Badge>New</Badge></h4>
<h5>Example heading <Badge>New</Badge></h5>
<h6>Example heading <Badge>New</Badge></h6>
`,
});
export const Buttons = (args) => ({
components: {Badge, Btn},
setup: () => ({args}),
template: `
<Btn class="me-1">Notifications <Badge variant="danger">4</Badge></Btn>
<Btn class="position-relative">Notifications <Badge class="position-absolute top-0 start-100 translate-middle border border-light" pill variant="danger">99+</Badge></Btn>
`,
});