@eturnity/eturnity_reusable_components 9.22.2 → 9.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es3.js +268 -156
- package/package.json +3 -3
- package/src/assets/theme.js +202 -90
- package/src/components/accordion/Accordion.stories.js +1 -1
- package/src/components/addNewButton/AddNewButton.stories.js +40 -8
- package/src/components/banner/actionBanner/ActionBanner.stories.js +1 -1
- package/src/components/banner/actionBanner/index.vue +4 -2
- package/src/components/banner/banner/Banner.stories.js +1 -1
- package/src/components/banner/infoBanner/InfoBanner.stories.js +1 -1
- package/src/components/banner/infoBanner/index.vue +4 -2
- package/src/components/banner/notificationBanner/notificationBanner.stories.js +81 -0
- package/src/components/buttons/buttonIcon/index.vue +216 -80
- package/src/components/buttons/closeButton/CloseButton.stories.js +1 -1
- package/src/components/buttons/collection/index.vue +1 -3
- package/src/components/buttons/mainButton/index.vue +98 -44
- package/src/components/buttons/splitButtons/splitButtons.stories.js +70 -0
- package/src/components/card/Card.stories.js +16 -4
- package/src/components/card/index.vue +1 -1
- package/src/components/collapsableInfoText/collapsableInfoText.stories.js +52 -0
- package/src/components/deleteIcon/DeleteIcon.stories.js +1 -1
- package/src/components/draggableCard/draggableCard.stories.js +1 -1
- package/src/components/draggableInputHandle/draggableInputHandle.stories.js +43 -0
- package/src/components/dropdown/Dropdown.stories.js +1 -1
- package/src/components/errorMessage/errorMessage.stories.js +31 -17
- package/src/components/filter/filterSettings.vue +1 -1
- package/src/components/icon/Icon.stories.js +1 -1
- package/src/components/iconWrapper/iconWrapper.stories.js +78 -0
- package/src/components/infoCard/InfoCard.stories.js +1 -1
- package/src/components/infoLabel/infoLabel.stories.js +61 -0
- package/src/components/infoText/infoText.stories.js +1 -1
- package/src/components/inputs/checkbox/Checkbox.stories.js +1 -1
- package/src/components/inputs/checkbox/index.vue +10 -1
- package/src/components/inputs/inputNumber/InputNumber.stories.js +1 -1
- package/src/components/inputs/inputNumber/index.vue +15 -5
- package/src/components/inputs/inputNumberQuestion/inputNumberQuestion.stories.js +77 -0
- package/src/components/inputs/inputText/InputText.stories.js +1 -1
- package/src/components/inputs/inputText/index.vue +29 -20
- package/src/components/inputs/isRequiredLabelStar/isRequiredLabelStar.stories.js +26 -0
- package/src/components/inputs/radioButton/RadioButton.stories.js +1 -1
- package/src/components/inputs/radioButton/index.vue +21 -7
- package/src/components/inputs/searchInput/SearchInput.stories.js +1 -1
- package/src/components/inputs/select/index.vue +33 -21
- package/src/components/inputs/select/option/index.vue +1 -1
- package/src/components/inputs/select/select.stories.js +4 -25
- package/src/components/inputs/shared/inputLabelTypography.js +7 -0
- package/src/components/inputs/slider/index.vue +9 -12
- package/src/components/inputs/slider/slider.stories.js +71 -0
- package/src/components/inputs/switchField/index.vue +37 -10
- package/src/components/inputs/switchField/switchField.stories.js +71 -0
- package/src/components/inputs/textAreaInput/TextAreaInput.stories.js +1 -1
- package/src/components/inputs/textAreaInput/index.vue +19 -6
- package/src/components/inputs/toggle/Toggle.stories.js +1 -1
- package/src/components/inputs/toggle/index.vue +10 -6
- package/src/components/label/index.vue +39 -11
- package/src/components/label/label.stories.js +69 -0
- package/src/components/markerItem/markerItem.stories.js +46 -0
- package/src/components/modals/actionModal/actionModal.stories.js +1 -1
- package/src/components/modals/actionModal/index.vue +1 -1
- package/src/components/modals/infoModal/index.vue +1 -10
- package/src/components/modals/infoModal/infoModal.stories.js +1 -1
- package/src/components/modals/modal/modal.spec.js +168 -0
- package/src/components/modals/modal/modal.stories.js +287 -26
- package/src/components/modals/modalBody/index.vue +30 -0
- package/src/components/modals/modalButtonContainer/index.vue +42 -0
- package/src/components/modals/modalButtonContainer/modalButtonContainer.stories.js +59 -0
- package/src/components/modals/modalContent/index.vue +125 -0
- package/src/components/modals/modalTitle/index.vue +34 -0
- package/src/components/navigationTabs/navigationTabs.stories.js +58 -0
- package/src/components/pageSubtitle/PageSubtitle.stories.js +1 -1
- package/src/components/pageTitle/PageTitle.stories.js +1 -1
- package/src/components/pagination/pagination.stories.js +79 -0
- package/src/components/paginationV2/paginationV2.spec.js +132 -0
- package/src/components/paginationV2/paginationV2.stories.js +68 -0
- package/src/components/panelRangeInfo/panelRangeInfo.stories.js +60 -0
- package/src/components/progressBar/ProgressBar.stories.js +1 -1
- package/src/components/progressStep/progressStep.stories.js +1 -1
- package/src/components/projectMarker/ProjectMarker.stories.js +1 -1
- package/src/components/rangeSlider/RangeSlider.stories.js +1 -1
- package/src/components/roundTabs/roundTabs.stories.js +54 -0
- package/src/components/selectedOptions/selectedOptions.stories.js +1 -1
- package/src/components/sideMenu/sideMenu.stories.js +53 -0
- package/src/components/spinner/Spinner.stories.js +1 -1
- package/src/components/spinnerGif/SpinnerGif.stories.js +1 -1
- package/src/components/statusIndicator/statusIndicator.stories.js +101 -0
- package/src/components/tableDropdown/TableDropdown.stories.js +1 -1
- package/src/components/tables/viewTable/viewTable.stories.js +85 -0
- package/src/components/tabsHeader/TabsHeader.stories.js +1 -1
- package/src/components/tag/conversionTag/conversionTag.stories.js +47 -0
- package/src/components/tag/freeTrialTag/freeTrialTag.stories.js +42 -0
- package/src/components/threeDots/index.vue +20 -3
- package/src/components/threeDots/threeDots.stories.js +59 -0
- package/src/components/videoThumbnail/videoThumbnail.stories.js +1 -1
|
@@ -54,6 +54,47 @@
|
|
|
54
54
|
import Icon from '../../icon'
|
|
55
55
|
import theme from '../../../assets/theme'
|
|
56
56
|
|
|
57
|
+
const getButtonState = (props) => {
|
|
58
|
+
if (props.isDisabled) return 'disabled'
|
|
59
|
+
if (props.isActive) return 'active'
|
|
60
|
+
return 'default'
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const getButtonTextColor = (variantStyles, state) =>
|
|
64
|
+
variantStyles[state]?.textColor ?? variantStyles.default?.textColor
|
|
65
|
+
|
|
66
|
+
const getButtonBorder = (variantStyles, state) => {
|
|
67
|
+
const borderColor = variantStyles[state]?.borderColor
|
|
68
|
+
return borderColor ? `1px solid ${borderColor}` : 'none'
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const resolveButtonTextColor = (
|
|
72
|
+
variantStyles,
|
|
73
|
+
props,
|
|
74
|
+
interactionState = 'default'
|
|
75
|
+
) => {
|
|
76
|
+
if (props.isDisabled) {
|
|
77
|
+
return getButtonTextColor(variantStyles, 'disabled')
|
|
78
|
+
}
|
|
79
|
+
if (props.customTextColor) return props.customTextColor
|
|
80
|
+
return getButtonTextColor(variantStyles, interactionState)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const resolveButtonBackgroundColor = (
|
|
84
|
+
variantStyles,
|
|
85
|
+
props,
|
|
86
|
+
interactionState = 'default'
|
|
87
|
+
) => {
|
|
88
|
+
if (props.isDisabled) {
|
|
89
|
+
return variantStyles.disabled?.backgroundColor
|
|
90
|
+
}
|
|
91
|
+
if (props.noBackgroundColor) return 'transparent'
|
|
92
|
+
return (
|
|
93
|
+
variantStyles[interactionState]?.backgroundColor ??
|
|
94
|
+
variantStyles.default?.backgroundColor
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
|
|
57
98
|
const PageContainer = styled('div', { height: String, width: String })`
|
|
58
99
|
height: ${(props) => props.height};
|
|
59
100
|
width: ${(props) => props.width};
|
|
@@ -82,32 +123,22 @@
|
|
|
82
123
|
props.theme?.mainButton?.size?.[props.buttonSize]?.padding};
|
|
83
124
|
font-size: ${(props) =>
|
|
84
125
|
props.theme?.mainButton?.size?.[props.buttonSize]?.fontSize};
|
|
85
|
-
color: ${(props) =>
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
props.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
? props.theme.mainButton[props.appTheme][props.type][props.variant]
|
|
98
|
-
.disabled.backgroundColor
|
|
99
|
-
: props.isActive
|
|
100
|
-
? props.theme.mainButton[props.appTheme][props.type][props.variant]
|
|
101
|
-
.active.backgroundColor
|
|
102
|
-
: props.theme.mainButton[props.appTheme][props.type][props.variant]
|
|
103
|
-
.default.backgroundColor};
|
|
126
|
+
color: ${(props) => {
|
|
127
|
+
const variantStyles =
|
|
128
|
+
props.theme.mainButton[props.appTheme][props.type][props.variant]
|
|
129
|
+
const state = props.isActive ? 'active' : 'default'
|
|
130
|
+
return resolveButtonTextColor(variantStyles, props, state)
|
|
131
|
+
}};
|
|
132
|
+
background-color: ${(props) => {
|
|
133
|
+
const variantStyles =
|
|
134
|
+
props.theme.mainButton[props.appTheme][props.type][props.variant]
|
|
135
|
+
const state = props.isActive ? 'active' : 'default'
|
|
136
|
+
return resolveButtonBackgroundColor(variantStyles, props, state)
|
|
137
|
+
}};
|
|
104
138
|
border: ${(props) => {
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
: props.theme.mainButton[props.appTheme][props.type][props.variant]
|
|
109
|
-
.default.borderColor
|
|
110
|
-
return borderValue ? '1px solid ' + borderValue : 'none'
|
|
139
|
+
const variantStyles =
|
|
140
|
+
props.theme.mainButton[props.appTheme][props.type][props.variant]
|
|
141
|
+
return getButtonBorder(variantStyles, getButtonState(props))
|
|
111
142
|
}};
|
|
112
143
|
border-radius: 4px;
|
|
113
144
|
text-align: center;
|
|
@@ -122,22 +153,46 @@
|
|
|
122
153
|
|
|
123
154
|
@media (hover: hover) and (pointer: fine) {
|
|
124
155
|
&:hover {
|
|
125
|
-
background-color: ${(props) =>
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
156
|
+
background-color: ${(props) => {
|
|
157
|
+
const variantStyles =
|
|
158
|
+
props.theme.mainButton[props.appTheme][props.type][props.variant]
|
|
159
|
+
return resolveButtonBackgroundColor(variantStyles, props, 'hover')
|
|
160
|
+
}};
|
|
161
|
+
color: ${(props) => {
|
|
162
|
+
const variantStyles =
|
|
163
|
+
props.theme.mainButton[props.appTheme][props.type][props.variant]
|
|
164
|
+
return resolveButtonTextColor(variantStyles, props, 'hover')
|
|
165
|
+
}};
|
|
166
|
+
border: ${(props) => {
|
|
167
|
+
const variantStyles =
|
|
168
|
+
props.theme.mainButton[props.appTheme][props.type][props.variant]
|
|
169
|
+
return getButtonBorder(
|
|
170
|
+
variantStyles,
|
|
171
|
+
props.isDisabled ? 'disabled' : 'hover'
|
|
172
|
+
)
|
|
173
|
+
}};
|
|
131
174
|
}
|
|
132
175
|
}
|
|
133
176
|
|
|
134
177
|
&:active {
|
|
135
|
-
background-color: ${(props) =>
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
178
|
+
background-color: ${(props) => {
|
|
179
|
+
const variantStyles =
|
|
180
|
+
props.theme.mainButton[props.appTheme][props.type][props.variant]
|
|
181
|
+
return resolveButtonBackgroundColor(variantStyles, props, 'active')
|
|
182
|
+
}};
|
|
183
|
+
color: ${(props) => {
|
|
184
|
+
const variantStyles =
|
|
185
|
+
props.theme.mainButton[props.appTheme][props.type][props.variant]
|
|
186
|
+
return resolveButtonTextColor(variantStyles, props, 'active')
|
|
187
|
+
}};
|
|
188
|
+
border: ${(props) => {
|
|
189
|
+
const variantStyles =
|
|
190
|
+
props.theme.mainButton[props.appTheme][props.type][props.variant]
|
|
191
|
+
return getButtonBorder(
|
|
192
|
+
variantStyles,
|
|
193
|
+
props.isDisabled ? 'disabled' : 'active'
|
|
194
|
+
)
|
|
195
|
+
}};
|
|
141
196
|
}
|
|
142
197
|
`
|
|
143
198
|
|
|
@@ -311,13 +366,12 @@
|
|
|
311
366
|
return theme
|
|
312
367
|
},
|
|
313
368
|
getIconColor() {
|
|
314
|
-
return this.
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
.default.textColor
|
|
369
|
+
if (this.iconColor) return this.iconColor
|
|
370
|
+
if (this.isDisabled) {
|
|
371
|
+
return this.theme.mainButton[this.appTheme][this.type][this.variant]
|
|
372
|
+
.disabled.textColor
|
|
373
|
+
}
|
|
374
|
+
return 'currentColor'
|
|
321
375
|
},
|
|
322
376
|
},
|
|
323
377
|
methods: {
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ref } from 'vue'
|
|
2
|
+
import SplitButtons from './index.vue'
|
|
3
|
+
import theme from '@/assets/theme'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Components/Buttons/SplitButtons',
|
|
7
|
+
component: SplitButtons,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
argTypes: {
|
|
10
|
+
options: {
|
|
11
|
+
description: 'Array of `{ label, value }` segments',
|
|
12
|
+
},
|
|
13
|
+
modelValue: {
|
|
14
|
+
control: 'text',
|
|
15
|
+
description: 'Currently selected value (v-model)',
|
|
16
|
+
},
|
|
17
|
+
dataIdKey: {
|
|
18
|
+
control: 'text',
|
|
19
|
+
description: 'Prefix for `data-id-key` on each segment',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const billingOptions = [
|
|
25
|
+
{ label: 'Monthly', value: 'monthly' },
|
|
26
|
+
{ label: 'Yearly', value: 'yearly' },
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
const segmentOptions = [
|
|
30
|
+
{ label: 'Small', value: 'sm' },
|
|
31
|
+
{ label: 'Medium', value: 'md' },
|
|
32
|
+
{ label: 'Large', value: 'lg' },
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
const Template = (args) => ({
|
|
36
|
+
components: { SplitButtons },
|
|
37
|
+
setup() {
|
|
38
|
+
const modelValue = ref(args.modelValue)
|
|
39
|
+
return { args, modelValue }
|
|
40
|
+
},
|
|
41
|
+
template: `
|
|
42
|
+
<div data-test-id="split-buttons-story" style="padding: 16px;">
|
|
43
|
+
<SplitButtons
|
|
44
|
+
v-model="modelValue"
|
|
45
|
+
:options="args.options"
|
|
46
|
+
:data-id-key="args.dataIdKey"
|
|
47
|
+
/>
|
|
48
|
+
<p style="margin-top: 12px; font-size: 13px; color: #444;">
|
|
49
|
+
Selected: <strong>{{ modelValue }}</strong>
|
|
50
|
+
</p>
|
|
51
|
+
</div>
|
|
52
|
+
`,
|
|
53
|
+
provide: {
|
|
54
|
+
theme,
|
|
55
|
+
},
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
export const TwoOptions = Template.bind({})
|
|
59
|
+
TwoOptions.args = {
|
|
60
|
+
options: billingOptions,
|
|
61
|
+
modelValue: 'monthly',
|
|
62
|
+
dataIdKey: 'billing_period',
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const ThreeOptions = Template.bind({})
|
|
66
|
+
ThreeOptions.args = {
|
|
67
|
+
options: segmentOptions,
|
|
68
|
+
modelValue: 'md',
|
|
69
|
+
dataIdKey: 'size',
|
|
70
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Card from './index.vue'
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
title: 'Card',
|
|
4
|
+
title: 'Components/Card/Card',
|
|
5
5
|
component: Card,
|
|
6
6
|
tags: ['autodocs'],
|
|
7
7
|
}
|
|
@@ -30,15 +30,27 @@ export const Default = {
|
|
|
30
30
|
template: `
|
|
31
31
|
<Card v-bind="args">
|
|
32
32
|
Sample card content
|
|
33
|
-
</
|
|
33
|
+
</Card>
|
|
34
34
|
`,
|
|
35
35
|
}),
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
export const LoadingCard = {
|
|
39
39
|
args: {
|
|
40
|
+
title: 'Sample card title',
|
|
40
41
|
isLoading: true,
|
|
41
42
|
},
|
|
43
|
+
render: (args) => ({
|
|
44
|
+
components: { Card },
|
|
45
|
+
setup() {
|
|
46
|
+
return { args }
|
|
47
|
+
},
|
|
48
|
+
template: `
|
|
49
|
+
<Card v-bind="args">
|
|
50
|
+
Sample card content
|
|
51
|
+
</Card>
|
|
52
|
+
`,
|
|
53
|
+
}),
|
|
42
54
|
}
|
|
43
55
|
|
|
44
56
|
export const CustomWidth = {
|
|
@@ -54,7 +66,7 @@ export const CustomWidth = {
|
|
|
54
66
|
template: `
|
|
55
67
|
<Card v-bind="args">
|
|
56
68
|
Sample card content
|
|
57
|
-
</
|
|
69
|
+
</Card>
|
|
58
70
|
`,
|
|
59
71
|
}),
|
|
60
72
|
}
|
|
@@ -73,7 +85,7 @@ export const PopoverShown = {
|
|
|
73
85
|
template: `
|
|
74
86
|
<Card v-bind="args">
|
|
75
87
|
Sample card content
|
|
76
|
-
</
|
|
88
|
+
</Card>
|
|
77
89
|
`,
|
|
78
90
|
}),
|
|
79
91
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import CollapsableInfoText from './index.vue'
|
|
2
|
+
import theme from '@/assets/theme'
|
|
3
|
+
|
|
4
|
+
const longCopy = `Line one introduces the topic.
|
|
5
|
+
Line two adds technical detail your integrators care about.
|
|
6
|
+
Line three explains edge cases.
|
|
7
|
+
Line four lists prerequisites.
|
|
8
|
+
Line five describes troubleshooting steps.
|
|
9
|
+
Line six thanks the reader for patience.`
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
title: 'Components/CollapsableInfoText/CollapsableInfoText',
|
|
13
|
+
component: CollapsableInfoText,
|
|
14
|
+
tags: ['autodocs'],
|
|
15
|
+
argTypes: {
|
|
16
|
+
text: { control: 'text' },
|
|
17
|
+
fontSize: { control: 'text' },
|
|
18
|
+
lineCount: { control: 'number' },
|
|
19
|
+
minWidth: { control: 'text' },
|
|
20
|
+
},
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const Template = (args) => ({
|
|
24
|
+
components: { CollapsableInfoText },
|
|
25
|
+
setup() {
|
|
26
|
+
return { args }
|
|
27
|
+
},
|
|
28
|
+
template: `
|
|
29
|
+
<div data-test-id="collapsable-info-story" style="padding: 16px; max-width: 480px;">
|
|
30
|
+
<CollapsableInfoText v-bind="args" />
|
|
31
|
+
</div>
|
|
32
|
+
`,
|
|
33
|
+
provide: {
|
|
34
|
+
theme,
|
|
35
|
+
},
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
export const Default = Template.bind({})
|
|
39
|
+
Default.args = {
|
|
40
|
+
text: longCopy,
|
|
41
|
+
fontSize: '14px',
|
|
42
|
+
lineCount: 3,
|
|
43
|
+
minWidth: '100%',
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const ShortText = Template.bind({})
|
|
47
|
+
ShortText.args = {
|
|
48
|
+
text: 'Only two lines.\nNo expand needed.',
|
|
49
|
+
fontSize: '14px',
|
|
50
|
+
lineCount: 5,
|
|
51
|
+
minWidth: '100%',
|
|
52
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import DraggableInputHandle from './index.vue'
|
|
2
|
+
import theme from '@/assets/theme'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Components/DraggableInputHandle/DraggableInputHandle',
|
|
6
|
+
component: DraggableInputHandle,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'centered',
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
height: { control: 'text', description: 'Total handle height (matches select row)' },
|
|
13
|
+
},
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const Template = (args) => ({
|
|
17
|
+
components: { DraggableInputHandle },
|
|
18
|
+
setup() {
|
|
19
|
+
return { args }
|
|
20
|
+
},
|
|
21
|
+
template: `
|
|
22
|
+
<div
|
|
23
|
+
data-test-id="draggable-handle-story"
|
|
24
|
+
style="position: relative; height: 42px; width: 120px; border: 1px dashed #ccc; padding-left: 8px;"
|
|
25
|
+
>
|
|
26
|
+
<DraggableInputHandle :height="args.height" />
|
|
27
|
+
<span style="margin-left: 28px; line-height: 42px; font-size: 13px;">Drag icon</span>
|
|
28
|
+
</div>
|
|
29
|
+
`,
|
|
30
|
+
provide: {
|
|
31
|
+
theme,
|
|
32
|
+
},
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
export const Default = Template.bind({})
|
|
36
|
+
Default.args = {
|
|
37
|
+
height: '34px',
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const TallRow = Template.bind({})
|
|
41
|
+
TallRow.args = {
|
|
42
|
+
height: '48px',
|
|
43
|
+
}
|
|
@@ -1,35 +1,49 @@
|
|
|
1
1
|
import ErrorMessage from './index.vue'
|
|
2
|
+
import theme from '@/assets/theme'
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
|
-
title: 'ErrorMessage',
|
|
5
|
+
title: 'Components/ErrorMessage/ErrorMessage',
|
|
5
6
|
component: ErrorMessage,
|
|
6
7
|
tags: ['autodocs'],
|
|
7
8
|
parameters: {
|
|
8
9
|
layout: 'centered',
|
|
9
10
|
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
marginTop: { control: 'text' },
|
|
13
|
+
},
|
|
10
14
|
}
|
|
11
15
|
|
|
12
|
-
|
|
13
|
-
//
|
|
14
|
-
//To use:
|
|
15
|
-
// <error-message>
|
|
16
|
-
// <span>
|
|
17
|
-
// testing error message
|
|
18
|
-
// </span>
|
|
19
|
-
// </error-message>
|
|
20
|
-
|
|
21
|
-
const Template = (args, { argTypes }) => ({
|
|
16
|
+
const Template = (args) => ({
|
|
22
17
|
components: { ErrorMessage },
|
|
23
|
-
|
|
18
|
+
setup() {
|
|
19
|
+
return { args }
|
|
20
|
+
},
|
|
24
21
|
template: `
|
|
25
|
-
<
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
</
|
|
29
|
-
</
|
|
22
|
+
<div data-test-id="error-message-story" style="max-width: 420px;">
|
|
23
|
+
<ErrorMessage v-bind="args">
|
|
24
|
+
<span data-test-id="error-slot">{{ args.message }}</span>
|
|
25
|
+
</ErrorMessage>
|
|
26
|
+
</div>`,
|
|
27
|
+
provide: {
|
|
28
|
+
theme,
|
|
29
|
+
},
|
|
30
30
|
})
|
|
31
31
|
|
|
32
32
|
export const Default = Template.bind({})
|
|
33
33
|
Default.args = {
|
|
34
34
|
marginTop: '13px',
|
|
35
|
+
message: 'The reference number could not be validated. Check the format and try again.',
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const ShortInline = Template.bind({})
|
|
39
|
+
ShortInline.args = {
|
|
40
|
+
marginTop: '8px',
|
|
41
|
+
message: 'Required field.',
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const LongServerMessage = Template.bind({})
|
|
45
|
+
LongServerMessage.args = {
|
|
46
|
+
marginTop: '16px',
|
|
47
|
+
message:
|
|
48
|
+
'We could not reach the billing service (timeout after 30s). Your changes were not saved. Retry in a few minutes or contact support with correlation ID 8f3c-2291.',
|
|
35
49
|
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import IconWrapper from './index.vue'
|
|
2
|
+
import theme from '@/assets/theme'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Components/IconWrapper/IconWrapper',
|
|
6
|
+
component: IconWrapper,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'centered',
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
name: { control: 'text', description: 'SVG icon key under svgIcons' },
|
|
13
|
+
size: { control: 'text' },
|
|
14
|
+
iconSize: { control: 'text' },
|
|
15
|
+
iconColor: { control: 'text' },
|
|
16
|
+
hasBorder: { control: 'boolean' },
|
|
17
|
+
hasCaret: { control: 'boolean' },
|
|
18
|
+
hasLock: { control: 'boolean' },
|
|
19
|
+
disabled: { control: 'boolean' },
|
|
20
|
+
isLoading: { control: 'boolean' },
|
|
21
|
+
isStriked: { control: 'boolean' },
|
|
22
|
+
dataId: { control: 'text' },
|
|
23
|
+
dataQaId: { control: 'text' },
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const Template = (args) => ({
|
|
28
|
+
components: { IconWrapper },
|
|
29
|
+
setup() {
|
|
30
|
+
return { args }
|
|
31
|
+
},
|
|
32
|
+
template: `
|
|
33
|
+
<div data-test-id="icon-wrapper-story" style="padding: 24px; background: #f4f6f8;">
|
|
34
|
+
<IconWrapper v-bind="args" />
|
|
35
|
+
</div>
|
|
36
|
+
`,
|
|
37
|
+
provide: {
|
|
38
|
+
theme,
|
|
39
|
+
},
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
export const Default = Template.bind({})
|
|
43
|
+
Default.args = {
|
|
44
|
+
name: 'House',
|
|
45
|
+
size: '40px',
|
|
46
|
+
iconSize: '22px',
|
|
47
|
+
iconColor: 'purple',
|
|
48
|
+
hasBorder: true,
|
|
49
|
+
borderRadius: '8px',
|
|
50
|
+
dataId: 'icon_wrapper_demo',
|
|
51
|
+
dataQaId: 'icon_wrapper_demo',
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const WithCaret = Template.bind({})
|
|
55
|
+
WithCaret.args = {
|
|
56
|
+
...Default.args,
|
|
57
|
+
name: 'arrow_down',
|
|
58
|
+
hasCaret: true,
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export const WithLockBadge = Template.bind({})
|
|
62
|
+
WithLockBadge.args = {
|
|
63
|
+
...Default.args,
|
|
64
|
+
name: 'House',
|
|
65
|
+
hasLock: true,
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export const Loading = Template.bind({})
|
|
69
|
+
Loading.args = {
|
|
70
|
+
...Default.args,
|
|
71
|
+
isLoading: true,
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export const Disabled = Template.bind({})
|
|
75
|
+
Disabled.args = {
|
|
76
|
+
...Default.args,
|
|
77
|
+
disabled: true,
|
|
78
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import InfoLabel from './index.vue'
|
|
2
|
+
import theme from '@/assets/theme'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Components/InfoLabel/InfoLabel',
|
|
6
|
+
component: InfoLabel,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'centered',
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
infoType: {
|
|
13
|
+
control: 'select',
|
|
14
|
+
options: ['hint', 'warning', 'error'],
|
|
15
|
+
description: 'Drives background colour and default copy',
|
|
16
|
+
},
|
|
17
|
+
labelText: {
|
|
18
|
+
control: 'text',
|
|
19
|
+
description: 'When set, overrides translated default for the type',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const Template = (args) => ({
|
|
25
|
+
components: { InfoLabel },
|
|
26
|
+
setup() {
|
|
27
|
+
return { args }
|
|
28
|
+
},
|
|
29
|
+
template: `
|
|
30
|
+
<div data-test-id="info-label-story" style="padding: 16px;">
|
|
31
|
+
<InfoLabel v-bind="args" />
|
|
32
|
+
</div>
|
|
33
|
+
`,
|
|
34
|
+
provide: {
|
|
35
|
+
theme,
|
|
36
|
+
},
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
export const Hint = Template.bind({})
|
|
40
|
+
Hint.args = {
|
|
41
|
+
infoType: 'hint',
|
|
42
|
+
labelText: '',
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const Warning = Template.bind({})
|
|
46
|
+
Warning.args = {
|
|
47
|
+
infoType: 'warning',
|
|
48
|
+
labelText: '',
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const Error = Template.bind({})
|
|
52
|
+
Error.args = {
|
|
53
|
+
infoType: 'error',
|
|
54
|
+
labelText: '',
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const CustomCopy = Template.bind({})
|
|
58
|
+
CustomCopy.args = {
|
|
59
|
+
infoType: 'hint',
|
|
60
|
+
labelText: 'VAT applies to Swiss customers only.',
|
|
61
|
+
}
|