-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathRow.stories.ts
More file actions
87 lines (80 loc) · 2.27 KB
/
Row.stories.ts
File metadata and controls
87 lines (80 loc) · 2.27 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
85
86
87
import Row, {aligns, justifies} from '.';
import Col from '@/components/Col';
import Container from '@/components/Container';
import {breakpoints} from '@/composables/useBreakpoints';
const numberArg = {control: {type: 'number'}};
export default {
title: 'Layout/Row',
component: Row,
argTypes: {
cols: numberArg,
...Object.fromEntries(breakpoints.map(b => [`cols-${b}`, numberArg])),
gutters: numberArg,
...Object.fromEntries(breakpoints.map(b => [`gutters-${b}`, numberArg])),
guttersX: numberArg,
...Object.fromEntries(breakpoints.map(b => [`gutters-x-${b}`, numberArg])),
guttersY: numberArg,
...Object.fromEntries(breakpoints.map(b => [`gutters-y-${b}`, numberArg])),
},
};
const template = (args) => ({
components: {Col, Container, Row},
setup: () => ({args}),
template: `
<Container class="p-3 border">
<Row v-bind="args">
<Col
v-for="i in 2"
class="border bg-light"
>
Column {{ i }}
</Col>
</Row>
</Container>
`,
});
export const Cols = template.bind({});
Cols.args = {cols: 6};
export const Justify = () => ({
components: {Col, Container, Row},
setup: () => ({justifies}),
template: `
<Container>
<Row
v-for="justify in justifies"
class="mb-3 p-3 border"
:justify="justify"
>
<Col
v-for="i in 2"
cols="4"
class="border bg-light"
>
{{ justify }}
</Col>
</Row>
</Container>
`,
});
export const Align = () => ({
components: {Col, Container, Row},
setup: () => ({aligns}),
template: `
<Container>
<Row
v-for="align in aligns"
:align="align"
class="mb-3 p-3 border"
style="height: 10rem"
>
<Col
v-for="i in 3"
cols="4"
class="border bg-light"
>
{{ align }}
</Col>
</Row>
</Container>
`,
});