-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathAuAccordion.stories.js
75 lines (72 loc) · 1.93 KB
/
AuAccordion.stories.js
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
import { hbs } from 'ember-cli-htmlbars';
import { icons } from '../../assets/icons';
export default {
title: 'Components/Content/AuAccordion',
argTypes: {
subtitle: {
control: 'text',
description: 'Set the subtitle of the accordion',
},
skin: {
control: 'select',
options: ['default', 'border'],
description: 'Sets the design of the accordion.',
},
reverse: {
control: 'boolean',
description: 'Reverse the layout direction of title and icon.',
},
iconOpen: {
control: 'select',
options: icons,
description:
"Adds an icon to the accordion when it's open. Defaults to nav-down.",
},
iconClosed: {
control: 'select',
options: icons,
description:
"Adds an icon to the accordion when it's closed. Defaults to nav-right.",
},
buttonLabel: { control: 'text', description: '' },
loading: {
control: 'boolean',
description: 'Adds a loading state to the button',
},
isOpenInitially: {
control: 'boolean',
description:
'When set to `true`, this will render the accordion in the "open" state from the start.',
},
},
parameters: {
layout: 'padded',
},
};
const Template = (args) => ({
template: hbs`
<AuAccordion
@subtitle={{this.subtitle}}
@skin={{this.skin}}
@reverse={{this.reverse}}
@iconOpen={{this.iconOpen}}
@iconClosed={{this.iconClosed}}
@buttonLabel={{this.buttonLabel}}
@loading={{this.loading}}
@isOpenInitially={{this.isOpenInitially}}
>
<p>I am information. I can even contain a <AuLink>A Link</AuLink>!</p>
</AuAccordion>`,
context: args,
});
export const Component = Template.bind({});
Component.args = {
subtitle: 'subtitle',
skin: 'default',
reverse: false,
iconOpen: 'nav-down',
iconClosed: 'nav-right',
buttonLabel: 'Accordion with arrows',
loading: false,
isOpenInitially: false,
};