Skip to content

Commit dce57d1

Browse files
rustem-nasyrovRustem Nasyrovasvae
authored
Stories rework: VaChip (#4039)
* VaChip stories * small tweaks --------- Co-authored-by: Rustem Nasyrov <[email protected]> Co-authored-by: Yauheni Prakopchyk <[email protected]>
1 parent 4931dbc commit dce57d1

File tree

2 files changed

+89
-208
lines changed

2 files changed

+89
-208
lines changed

packages/ui/src/components/va-chip/VaChip.demo.vue

-204
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,97 @@
1-
import { defineComponent } from 'vue'
2-
import VaChip from './VaChip.demo.vue'
1+
import { VaCheckbox } from '../va-checkbox'
2+
import { VaChip } from './'
33

44
export default {
55
title: 'VaChip',
66
component: VaChip,
7+
tags: ['autodocs'],
78
}
89

9-
export const Default = defineComponent({
10+
export const Default = () => ({
1011
components: { VaChip },
11-
template: '<VaChip/>',
12+
template: '<VaChip>text</VaChip>',
13+
})
14+
15+
export const Color = () => ({
16+
components: { VaChip },
17+
template: '<VaChip color="warning">text</VaChip>',
18+
})
19+
20+
export const Outline = () => ({
21+
components: { VaChip },
22+
template: '<VaChip outline>text</VaChip>',
23+
})
24+
25+
export const Flat = () => ({
26+
components: { VaChip },
27+
template: '<VaChip flat>text</VaChip>',
28+
})
29+
30+
export const Size = () => ({
31+
components: { VaChip },
32+
template: `
33+
<p>[small]</p>
34+
<VaChip size="small">text</VaChip>
35+
<p>[medium]</p>
36+
<VaChip>text</VaChip>
37+
<p>[large]</p>
38+
<VaChip size="large">text</VaChip>
39+
`,
40+
})
41+
42+
export const Icon = () => ({
43+
components: { VaChip },
44+
template: '<VaChip icon="face">text</VaChip>',
45+
})
46+
47+
export const SizesWithIcons = () => ({
48+
components: { VaChip },
49+
template: `
50+
<p>[small]</p>
51+
<VaChip icon="face" size="small">text</VaChip>
52+
<p>[medium]</p>
53+
<VaChip icon="face">text</VaChip>
54+
<p>[large]</p>
55+
<VaChip icon="face" size="large">text</VaChip>
56+
`,
57+
})
58+
59+
export const Square = () => ({
60+
components: { VaChip },
61+
template: '<VaChip square>text</VaChip>',
62+
})
63+
64+
export const Closeable = () => ({
65+
components: { VaChip, VaCheckbox },
66+
data: () => ({ value: true }),
67+
template: `
68+
<VaCheckbox v-model="value" label="toggle" />
69+
<br>
70+
<VaChip v-model="value" closeable>text</VaChip>
71+
`,
72+
})
73+
74+
export const Link = () => ({
75+
components: { VaChip },
76+
template: '<VaChip to="/?path=/docs/vachip--docs">text</VaChip>',
77+
})
78+
79+
export const Disabled = () => ({
80+
components: { VaChip },
81+
template: '<VaChip disabled>text</VaChip>',
82+
})
83+
84+
export const Readonly = () => ({
85+
components: { VaChip },
86+
template: '<VaChip readonly>text</VaChip>',
87+
})
88+
89+
export const Stateful = () => ({
90+
components: { VaChip },
91+
template: '<VaChip stateful closeable>text</VaChip>',
92+
})
93+
94+
export const Shadow = () => ({
95+
components: { VaChip },
96+
template: '<VaChip shadow>text</VaChip>',
1297
})

0 commit comments

Comments
 (0)