-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathempty-state.stories.js
95 lines (87 loc) · 2.46 KB
/
empty-state.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
import { hbs } from 'ember-cli-htmlbars';
export default {
title: 'Components/OSS::EmptyState',
component: 'empty state',
argTypes: {
badgeIcon: {
description: 'A font-awesome icon to be displayed in a badge',
table: {
type: {
summary: 'string'
},
defaultValue: { summary: 'undefined' }
},
control: { type: 'text' }
},
title: {
description: 'A title displayed below the icon or badge in the component',
table: {
type: {
summary: 'string'
},
defaultValue: { summary: 'undefined' }
},
control: { type: 'text' }
},
subtitle: {
description: 'A subtitle displayed under the title in the component',
table: {
type: {
summary: 'string'
},
defaultValue: { summary: 'undefined' }
},
control: { type: 'text' }
},
size: {
description: 'The size of the state',
table: {
type: {
summary: 'string'
},
defaultValue: { summary: 'undefined' }
},
control: { type: 'select' },
options: ['sm', 'md']
}
},
parameters: {
docs: {
description: {
component: 'A component used when there is nothing to display on a page'
}
}
}
};
const defaultArgs = {
badgeIcon: 'fa-thumbs-up',
title: 'Empty State Title',
subtitle: 'Additional information here',
size: 'md'
};
const Template = (args) => ({
template: hbs`<OSS::EmptyState @badgeIcon={{this.badgeIcon}} @title={{this.title}} @subtitle={{this.subtitle}} @size={{this.size}} />`,
context: args
});
const ImageTemplate = (args) => ({
template: hbs`<OSS::EmptyState @badgeIcon={{this.badgeIcon}} @title={{this.title}} @subtitle={{this.subtitle}} @size={{this.size}}>
<:image>
<OSS::Illustration @src="/@upfluence/oss-components/assets/images/no-records.svg" />
</:image>
</OSS::EmptyState>`,
context: args
});
const ActionTemplate = (args) => ({
template: hbs`<OSS::EmptyState @badgeIcon={{this.badgeIcon}} @title={{this.title}} @subtitle={{this.subtitle}} @size={{this.size}}>
<:actions>
<OSS::Button @label="Click me" />
</:actions>
</OSS::EmptyState>`,
context: args
});
export const Default = Template.bind({});
Default.args = defaultArgs;
export const UsageWithImage = ImageTemplate.bind({});
UsageWithImage.args = defaultArgs;
export const UsageWithActions = ActionTemplate.bind({});
UsageWithActions.args = defaultArgs;