-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathAuLinkExternal.stories.js
121 lines (114 loc) · 2.7 KB
/
AuLinkExternal.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import { hbs } from 'ember-cli-htmlbars';
import { icons } from '../../assets/icons';
export default {
title: 'Components/Links/AuLinkExternal',
argTypes: {
text: { control: 'text', description: '' },
href: { control: 'text', description: '' },
skin: {
control: 'select',
options: [
'primary',
'secondary',
'button',
'button-secondary',
'button-naked',
],
description: 'Defines the style of the link',
},
icon: { control: 'select', options: icons, description: 'Adds an icon' },
iconAlignment: {
control: 'select',
options: ['left', 'right'],
description:
'hoose the position of the icon, adds correct margin next to the icon',
},
hideText: {
control: 'boolean',
description: 'Hides the link text visually',
},
newTab: {
control: 'boolean',
description:
'Should clicking the link open a new tab. Defaults to `true`.',
},
width: {
control: 'select',
options: ['', 'block'],
description: 'Defines the width of the link',
},
},
parameters: {
layout: 'padded',
},
};
const Template = (args) => ({
template: hbs`
<AuLinkExternal
href={{this.href}}
@skin={{this.skin}}
@icon={{this.icon}}
@iconAlignment={{this.iconAlignment}}
@hideText={{this.hideText}}
@newTab={{this.newTab}}
@width={{this.width}}
>
{{this.text}}
</AuLinkExternal>`,
context: args,
});
export const Primary = Template.bind({});
Primary.args = {
text: 'External link',
href: 'https://www.vlaanderen.be/',
route: 'index',
skin: 'primary',
icon: 'manual',
iconAlignment: 'left',
hideText: false,
width: '',
};
export const Secondary = Template.bind({});
Secondary.args = {
text: 'External link',
href: 'https://www.vlaanderen.be/',
route: 'index',
skin: 'secondary',
icon: 'manual',
iconAlignment: 'left',
hideText: false,
width: '',
};
export const PrimaryButton = Template.bind({});
PrimaryButton.args = {
text: 'External link',
href: 'https://www.vlaanderen.be/',
route: 'index',
skin: 'button',
icon: 'manual',
iconAlignment: 'left',
hideText: false,
width: '',
};
export const SecondaryButton = Template.bind({});
SecondaryButton.args = {
text: 'External link',
href: 'https://www.vlaanderen.be/',
route: 'index',
skin: 'button-secondary',
icon: 'manual',
iconAlignment: 'left',
hideText: false,
width: '',
};
export const NakedButton = Template.bind({});
NakedButton.args = {
text: 'External link',
href: 'https://www.vlaanderen.be/',
route: 'index',
skin: 'button-naked',
icon: 'manual',
iconAlignment: 'left',
hideText: false,
width: '',
};