-
Notifications
You must be signed in to change notification settings - Fork 357
/
text-lockup.stories.js
74 lines (68 loc) · 1.63 KB
/
text-lockup.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
import './text-lockup';
import iconList from '../../../icons/material-codepoints.json';
const MAT_ICON_LIST = Object.keys(iconList);
export default {
title: 'Components/Text lockup',
argTypes: {
scale: {
options: ['large', 'small'],
control: { type: 'radio' },
defaultValue: 'small',
},
text: {
control: 'text',
defaultValue: 'TDICAM-8523411',
},
icon: {
options: MAT_ICON_LIST,
control: { type: 'select' },
},
subText: {
control: 'text',
defaultValue: 'environment Id',
},
subTextState: {
options: ['active', 'positive', 'negative', 'caution'],
control: { type: 'select' },
},
subTextTrailing: {
control: 'boolean',
defaultValue: false,
},
},
};
export const textLockup = ({
icon,
scale,
subText,
subTextState,
subTextTrailing,
text,
}) => {
return `
<td-text-lockup
subtext="${subText}"
scale="${scale}"
${icon ? `icon="${icon}"` : ''}
${subTextState ? `state="${subTextState}"` : ''}
${subTextTrailing ? 'trailingSubText' : ''}>${text}</td-text-lockup>
`;
};
export const textLockupLarge = textLockup.bind({});
textLockupLarge.args = {
scale: 'large',
};
export const textLockupTrailing = textLockup.bind({});
textLockupTrailing.args = {
text: 'Jan 12th, 2022 at 5:10pm',
subText: 'Date last ran successfully',
subTextTrailing: true,
};
export const textLockupWithIcon = textLockup.bind({});
textLockupWithIcon.args = {
icon: 'warning',
text: 'Daily production backup job',
subText: 'completed with issues',
subTextState: 'caution',
subTextTrailing: true,
};