@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
|
@@ -1,17 +1,49 @@
|
|
|
1
1
|
import AddNewButton from './index.vue'
|
|
2
|
+
import theme from '@/assets/theme'
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
|
-
title: 'AddNewButton',
|
|
5
|
+
title: 'Components/AddNewButton/AddNewButton',
|
|
5
6
|
component: AddNewButton,
|
|
6
7
|
tags: ['autodocs'],
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'fullscreen',
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
shouldPosition: {
|
|
13
|
+
control: 'boolean',
|
|
14
|
+
description: 'Fixed to bottom-right vs inline in flow',
|
|
15
|
+
},
|
|
16
|
+
dataId: { control: 'text' },
|
|
17
|
+
dataQaId: { control: 'text' },
|
|
18
|
+
},
|
|
7
19
|
}
|
|
8
20
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
21
|
+
const Template = (args) => ({
|
|
22
|
+
components: { AddNewButton },
|
|
23
|
+
setup() {
|
|
24
|
+
return { args }
|
|
25
|
+
},
|
|
26
|
+
template: `
|
|
27
|
+
<div data-test-id="add-new-story" style="min-height: 200px; padding: 24px; position: relative; background: #f0f2f5;">
|
|
28
|
+
<p style="margin: 0 0 8px;">Floating action pattern for primary “create” entry points.</p>
|
|
29
|
+
<AddNewButton v-bind="args" />
|
|
30
|
+
</div>
|
|
31
|
+
`,
|
|
32
|
+
provide: {
|
|
33
|
+
theme,
|
|
16
34
|
},
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
export const FixedPosition = Template.bind({})
|
|
38
|
+
FixedPosition.args = {
|
|
39
|
+
shouldPosition: true,
|
|
40
|
+
dataId: 'add_new_fab',
|
|
41
|
+
dataQaId: 'add_new_fab',
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const InlineInLayout = Template.bind({})
|
|
45
|
+
InlineInLayout.args = {
|
|
46
|
+
shouldPosition: false,
|
|
47
|
+
dataId: 'add_new_inline',
|
|
48
|
+
dataQaId: 'add_new_inline',
|
|
17
49
|
}
|
|
@@ -42,9 +42,11 @@
|
|
|
42
42
|
font-family: inherit;
|
|
43
43
|
font-size: 18px;
|
|
44
44
|
font-style: normal;
|
|
45
|
-
font-weight:
|
|
45
|
+
font-weight: 500;
|
|
46
46
|
line-height: 120%;
|
|
47
|
-
|
|
47
|
+
&:first-letter {
|
|
48
|
+
text-transform: uppercase;
|
|
49
|
+
}
|
|
48
50
|
`
|
|
49
51
|
const ButtonContainer = styled.div`
|
|
50
52
|
display: inline-flex;
|
|
@@ -41,9 +41,11 @@
|
|
|
41
41
|
font-family: inherit;
|
|
42
42
|
font-size: 18px;
|
|
43
43
|
font-style: normal;
|
|
44
|
-
font-weight:
|
|
44
|
+
font-weight: 500;
|
|
45
45
|
line-height: 120%;
|
|
46
|
-
|
|
46
|
+
&:first-letter {
|
|
47
|
+
text-transform: uppercase;
|
|
48
|
+
}
|
|
47
49
|
`
|
|
48
50
|
const ButtonContainer = styled.div`
|
|
49
51
|
display: inline-flex;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { ref } from 'vue'
|
|
2
|
+
import NotificationBanner from './index.vue'
|
|
3
|
+
import theme from '@/assets/theme'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Components/Banner/NotificationBanner',
|
|
7
|
+
component: NotificationBanner,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'fullscreen',
|
|
11
|
+
},
|
|
12
|
+
argTypes: {
|
|
13
|
+
mainText: { control: 'text' },
|
|
14
|
+
buttonText: { control: 'text' },
|
|
15
|
+
backgroundColor: { control: 'text', description: 'Theme color key' },
|
|
16
|
+
textColor: { control: 'text' },
|
|
17
|
+
iconName: { control: 'text' },
|
|
18
|
+
isOpen: { control: 'boolean', description: 'When true, banner appears (auto-dismiss ~10s)' },
|
|
19
|
+
},
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const TriggerFromButton = {
|
|
23
|
+
render: () => ({
|
|
24
|
+
components: { NotificationBanner },
|
|
25
|
+
setup() {
|
|
26
|
+
const isOpen = ref(false)
|
|
27
|
+
return { isOpen }
|
|
28
|
+
},
|
|
29
|
+
template: `
|
|
30
|
+
<div data-test-id="notification-banner-story" style="padding: 24px;">
|
|
31
|
+
<p style="margin-bottom: 12px;">Snack-style banner fixed to the bottom of the viewport.</p>
|
|
32
|
+
<button type="button" style="padding: 8px 14px;" @click="isOpen = true">
|
|
33
|
+
Show notification
|
|
34
|
+
</button>
|
|
35
|
+
<NotificationBanner
|
|
36
|
+
:is-open="isOpen"
|
|
37
|
+
main-text="Your report has been generated and is ready to download."
|
|
38
|
+
button-text="Download PDF"
|
|
39
|
+
background-color="green"
|
|
40
|
+
text-color="white"
|
|
41
|
+
icon-name="checkmark"
|
|
42
|
+
@on-button-click="() => {}"
|
|
43
|
+
@on-close="isOpen = false"
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
`,
|
|
47
|
+
provide: {
|
|
48
|
+
theme,
|
|
49
|
+
},
|
|
50
|
+
}),
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const DarkStripe = {
|
|
54
|
+
render: () => ({
|
|
55
|
+
components: { NotificationBanner },
|
|
56
|
+
setup() {
|
|
57
|
+
const isOpen = ref(false)
|
|
58
|
+
return { isOpen }
|
|
59
|
+
},
|
|
60
|
+
template: `
|
|
61
|
+
<div data-test-id="notification-banner-dark" style="padding: 24px;">
|
|
62
|
+
<button type="button" style="padding: 8px 14px;" @click="isOpen = true">
|
|
63
|
+
Show update banner
|
|
64
|
+
</button>
|
|
65
|
+
<NotificationBanner
|
|
66
|
+
:is-open="isOpen"
|
|
67
|
+
main-text="Maintenance tonight from 22:00–23:00 UTC."
|
|
68
|
+
button-text="Learn more"
|
|
69
|
+
background-color="black"
|
|
70
|
+
text-color="white"
|
|
71
|
+
icon-name="warning_triangle"
|
|
72
|
+
@on-button-click="() => {}"
|
|
73
|
+
@on-close="isOpen = false"
|
|
74
|
+
/>
|
|
75
|
+
</div>
|
|
76
|
+
`,
|
|
77
|
+
provide: {
|
|
78
|
+
theme,
|
|
79
|
+
},
|
|
80
|
+
}),
|
|
81
|
+
}
|
|
@@ -19,26 +19,20 @@
|
|
|
19
19
|
<IconContainer
|
|
20
20
|
:app-theme="appTheme"
|
|
21
21
|
:button-size="buttonSize"
|
|
22
|
+
class="button-icon-container"
|
|
22
23
|
data-test-id="button-icon-icon-container"
|
|
23
24
|
:height="height"
|
|
25
|
+
:is-active="isActive"
|
|
26
|
+
:is-disabled="isDisabled"
|
|
27
|
+
:is-hovered="isHovered"
|
|
24
28
|
:type="type"
|
|
25
29
|
:variant="variant"
|
|
26
30
|
>
|
|
27
31
|
<Icon
|
|
28
|
-
:color="
|
|
29
|
-
iconColor ||
|
|
30
|
-
(isDisabled
|
|
31
|
-
? theme.mainButton[appTheme][type][variant].disabled.textColor
|
|
32
|
-
: theme.mainButton[appTheme][type][variant].default.textColor)
|
|
33
|
-
"
|
|
32
|
+
:color="getIconColor"
|
|
34
33
|
:disable-hover="disableIconHover"
|
|
35
34
|
:fill-type="fillType"
|
|
36
|
-
:hovered-color="
|
|
37
|
-
iconColor ||
|
|
38
|
-
(isDisabled
|
|
39
|
-
? theme.mainButton[appTheme][type][variant].disabled.textColor
|
|
40
|
-
: theme.mainButton[appTheme][type][variant].default.textColor)
|
|
41
|
-
"
|
|
35
|
+
:hovered-color="getIconColor"
|
|
42
36
|
:name="iconName"
|
|
43
37
|
size="14px"
|
|
44
38
|
/>
|
|
@@ -52,20 +46,10 @@
|
|
|
52
46
|
{{ isFirstLetterCapitalized ? capitalizeFirstLetter(text) : text }}
|
|
53
47
|
<Icon
|
|
54
48
|
v-if="showCaret"
|
|
55
|
-
:color="
|
|
56
|
-
iconColor ||
|
|
57
|
-
(isDisabled
|
|
58
|
-
? theme.mainButton[appTheme][type][variant].disabled.textColor
|
|
59
|
-
: theme.mainButton[appTheme][type][variant].default.textColor)
|
|
60
|
-
"
|
|
49
|
+
:color="getIconColor"
|
|
61
50
|
data-test-id="button-icon-caret"
|
|
62
51
|
:disable-hover="disableIconHover"
|
|
63
|
-
:hovered-color="
|
|
64
|
-
iconColor ||
|
|
65
|
-
(isDisabled
|
|
66
|
-
? theme.mainButton[appTheme][type][variant].disabled.textColor
|
|
67
|
-
: theme.mainButton[appTheme][type][variant].default.textColor)
|
|
68
|
-
"
|
|
52
|
+
:hovered-color="getIconColor"
|
|
69
53
|
name="arrow_down"
|
|
70
54
|
size="8px"
|
|
71
55
|
/>
|
|
@@ -103,7 +87,87 @@
|
|
|
103
87
|
|
|
104
88
|
import Icon from '../../icon'
|
|
105
89
|
import styled from 'vue3-styled-components'
|
|
106
|
-
import
|
|
90
|
+
import theme from '../../../assets/theme'
|
|
91
|
+
|
|
92
|
+
const getButtonState = (props) => {
|
|
93
|
+
if (props.isDisabled) return 'disabled'
|
|
94
|
+
if (props.isActive) return 'active'
|
|
95
|
+
if (props.isHovered) return 'hover'
|
|
96
|
+
return 'default'
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const getInteractionState = (props) => {
|
|
100
|
+
if (props.isActive) return 'active'
|
|
101
|
+
if (props.isHovered) return 'hover'
|
|
102
|
+
return 'default'
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const getButtonTextColor = (variantStyles, state) =>
|
|
106
|
+
variantStyles[state]?.textColor ?? variantStyles.default?.textColor
|
|
107
|
+
|
|
108
|
+
const getButtonBorder = (variantStyles, state) => {
|
|
109
|
+
const borderColor = variantStyles[state]?.borderColor
|
|
110
|
+
return borderColor ? `1px solid ${borderColor}` : 'none'
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const getIconBackgroundColor = (variantStyles, state) =>
|
|
114
|
+
variantStyles[state]?.iconBackgroundColor ??
|
|
115
|
+
variantStyles.default?.iconBackgroundColor
|
|
116
|
+
|
|
117
|
+
const resolveButtonTextColor = (
|
|
118
|
+
variantStyles,
|
|
119
|
+
props,
|
|
120
|
+
interactionState = 'default'
|
|
121
|
+
) => {
|
|
122
|
+
if (props.isDisabled) {
|
|
123
|
+
return getButtonTextColor(variantStyles, 'disabled')
|
|
124
|
+
}
|
|
125
|
+
return getButtonTextColor(variantStyles, interactionState)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const resolveButtonBackgroundColor = (
|
|
129
|
+
variantStyles,
|
|
130
|
+
props,
|
|
131
|
+
interactionState = 'default'
|
|
132
|
+
) => {
|
|
133
|
+
if (props.isDisabled) {
|
|
134
|
+
return variantStyles.disabled?.backgroundColor
|
|
135
|
+
}
|
|
136
|
+
if (props.isTransparent) return 'transparent'
|
|
137
|
+
if (props.customColor) return props.customColor
|
|
138
|
+
return (
|
|
139
|
+
variantStyles[interactionState]?.backgroundColor ??
|
|
140
|
+
variantStyles.default?.backgroundColor
|
|
141
|
+
)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const resolveButtonBorder = (
|
|
145
|
+
variantStyles,
|
|
146
|
+
props,
|
|
147
|
+
interactionState = 'default'
|
|
148
|
+
) => {
|
|
149
|
+
if (props.isDisabled) {
|
|
150
|
+
return getButtonBorder(variantStyles, 'disabled')
|
|
151
|
+
}
|
|
152
|
+
if (props.customColor) {
|
|
153
|
+
return `1px solid ${props.customColor}`
|
|
154
|
+
}
|
|
155
|
+
return getButtonBorder(variantStyles, interactionState)
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const resolveIconBackgroundColor = (
|
|
159
|
+
variantStyles,
|
|
160
|
+
props,
|
|
161
|
+
interactionState = 'default'
|
|
162
|
+
) => {
|
|
163
|
+
if (props.isDisabled) {
|
|
164
|
+
return getIconBackgroundColor(variantStyles, 'disabled')
|
|
165
|
+
}
|
|
166
|
+
return getIconBackgroundColor(variantStyles, interactionState)
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const getVariantStyles = (props) =>
|
|
170
|
+
props.theme.mainButton[props.appTheme][props.type][props.variant]
|
|
107
171
|
|
|
108
172
|
const PageContainer = styled.div`
|
|
109
173
|
position: relative;
|
|
@@ -125,43 +189,34 @@
|
|
|
125
189
|
const ButtonWrapper = styled('div', ButtonAttrs)`
|
|
126
190
|
position: relative;
|
|
127
191
|
display: grid;
|
|
128
|
-
align-content: center
|
|
192
|
+
align-content: center;
|
|
129
193
|
grid-template-columns: auto 1fr auto;
|
|
130
194
|
height: ${({ height }) => height};
|
|
131
195
|
font-size: ${(props) =>
|
|
132
196
|
props.theme?.mainButton?.size?.[props.buttonSize]?.fontSize};
|
|
133
197
|
color: ${(props) => {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
198
|
+
const variantStyles = getVariantStyles(props)
|
|
199
|
+
return resolveButtonTextColor(
|
|
200
|
+
variantStyles,
|
|
201
|
+
props,
|
|
202
|
+
getInteractionState(props)
|
|
203
|
+
)
|
|
204
|
+
}};
|
|
205
|
+
background-color: ${(props) => {
|
|
206
|
+
const variantStyles = getVariantStyles(props)
|
|
207
|
+
return resolveButtonBackgroundColor(
|
|
208
|
+
variantStyles,
|
|
209
|
+
props,
|
|
210
|
+
getInteractionState(props)
|
|
211
|
+
)
|
|
139
212
|
}};
|
|
140
|
-
background-color: ${(props) =>
|
|
141
|
-
props.isDisabled
|
|
142
|
-
? props.theme.mainButton[props.appTheme][props.type][props.variant]
|
|
143
|
-
.disabled.backgroundColor
|
|
144
|
-
: props.isTransparent
|
|
145
|
-
? 'transparent'
|
|
146
|
-
: props.customColor
|
|
147
|
-
? props.customColor
|
|
148
|
-
: props.isActive
|
|
149
|
-
? props.theme.mainButton[props.appTheme][props.type][props.variant]
|
|
150
|
-
.active.backgroundColor
|
|
151
|
-
: props.isHovered
|
|
152
|
-
? props.theme.mainButton[props.appTheme][props.type][props.variant]
|
|
153
|
-
.hover.backgroundColor
|
|
154
|
-
: props.theme.mainButton[props.appTheme][props.type][props.variant]
|
|
155
|
-
.default.backgroundColor};
|
|
156
213
|
border: ${(props) => {
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
.default.borderColor
|
|
164
|
-
return borderValue ? '1px solid ' + borderValue : 'none'
|
|
214
|
+
const variantStyles = getVariantStyles(props)
|
|
215
|
+
return resolveButtonBorder(
|
|
216
|
+
variantStyles,
|
|
217
|
+
props,
|
|
218
|
+
getButtonState(props)
|
|
219
|
+
)
|
|
165
220
|
}};
|
|
166
221
|
cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
|
|
167
222
|
user-select: none;
|
|
@@ -169,26 +224,71 @@
|
|
|
169
224
|
overflow: visible;
|
|
170
225
|
min-width: ${(props) => props.minWidth || 'initial'};
|
|
171
226
|
|
|
227
|
+
.button-icon-container {
|
|
228
|
+
border-right: ${(props) => {
|
|
229
|
+
const variantStyles = getVariantStyles(props)
|
|
230
|
+
return getButtonBorder(variantStyles, getInteractionState(props))
|
|
231
|
+
}};
|
|
232
|
+
}
|
|
233
|
+
|
|
172
234
|
@media (hover: hover) and (pointer: fine) {
|
|
173
235
|
&:hover {
|
|
174
|
-
background-color: ${(props) =>
|
|
175
|
-
props
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
236
|
+
background-color: ${(props) => {
|
|
237
|
+
const variantStyles = getVariantStyles(props)
|
|
238
|
+
return resolveButtonBackgroundColor(variantStyles, props, 'hover')
|
|
239
|
+
}};
|
|
240
|
+
color: ${(props) => {
|
|
241
|
+
const variantStyles = getVariantStyles(props)
|
|
242
|
+
return resolveButtonTextColor(variantStyles, props, 'hover')
|
|
243
|
+
}};
|
|
244
|
+
border: ${(props) => {
|
|
245
|
+
const variantStyles = getVariantStyles(props)
|
|
246
|
+
return resolveButtonBorder(
|
|
247
|
+
variantStyles,
|
|
248
|
+
props,
|
|
249
|
+
props.isDisabled ? 'disabled' : 'hover'
|
|
250
|
+
)
|
|
251
|
+
}};
|
|
252
|
+
|
|
253
|
+
.button-icon-container {
|
|
254
|
+
border-right: ${(props) => {
|
|
255
|
+
const variantStyles = getVariantStyles(props)
|
|
256
|
+
return getButtonBorder(
|
|
257
|
+
variantStyles,
|
|
258
|
+
props.isDisabled ? 'disabled' : 'hover'
|
|
259
|
+
)
|
|
260
|
+
}};
|
|
261
|
+
}
|
|
182
262
|
}
|
|
183
263
|
}
|
|
184
264
|
|
|
185
265
|
&:active {
|
|
186
|
-
background-color: ${(props) =>
|
|
187
|
-
props
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
266
|
+
background-color: ${(props) => {
|
|
267
|
+
const variantStyles = getVariantStyles(props)
|
|
268
|
+
return resolveButtonBackgroundColor(variantStyles, props, 'active')
|
|
269
|
+
}};
|
|
270
|
+
color: ${(props) => {
|
|
271
|
+
const variantStyles = getVariantStyles(props)
|
|
272
|
+
return resolveButtonTextColor(variantStyles, props, 'active')
|
|
273
|
+
}};
|
|
274
|
+
border: ${(props) => {
|
|
275
|
+
const variantStyles = getVariantStyles(props)
|
|
276
|
+
return resolveButtonBorder(
|
|
277
|
+
variantStyles,
|
|
278
|
+
props,
|
|
279
|
+
props.isDisabled ? 'disabled' : 'active'
|
|
280
|
+
)
|
|
281
|
+
}};
|
|
282
|
+
|
|
283
|
+
.button-icon-container {
|
|
284
|
+
border-right: ${(props) => {
|
|
285
|
+
const variantStyles = getVariantStyles(props)
|
|
286
|
+
return getButtonBorder(
|
|
287
|
+
variantStyles,
|
|
288
|
+
props.isDisabled ? 'disabled' : 'active'
|
|
289
|
+
)
|
|
290
|
+
}};
|
|
291
|
+
}
|
|
192
292
|
}
|
|
193
293
|
`
|
|
194
294
|
|
|
@@ -213,6 +313,9 @@
|
|
|
213
313
|
type: String,
|
|
214
314
|
variant: String,
|
|
215
315
|
height: String,
|
|
316
|
+
isDisabled: Boolean,
|
|
317
|
+
isActive: Boolean,
|
|
318
|
+
isHovered: Boolean,
|
|
216
319
|
}
|
|
217
320
|
const IconContainer = styled('div', IconContainerAttrs)`
|
|
218
321
|
display: grid;
|
|
@@ -221,14 +324,39 @@
|
|
|
221
324
|
justify-items: center;
|
|
222
325
|
width: ${(props) =>
|
|
223
326
|
props.theme?.mainButton?.size?.[props.buttonSize]?.iconWidth};
|
|
224
|
-
background:
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
props
|
|
229
|
-
|
|
230
|
-
|
|
327
|
+
background: ${(props) => {
|
|
328
|
+
const variantStyles = getVariantStyles(props)
|
|
329
|
+
return resolveIconBackgroundColor(
|
|
330
|
+
variantStyles,
|
|
331
|
+
props,
|
|
332
|
+
getInteractionState(props)
|
|
333
|
+
)
|
|
231
334
|
}};
|
|
335
|
+
border-radius: 4px 0 0 4px;
|
|
336
|
+
|
|
337
|
+
@media (hover: hover) and (pointer: fine) {
|
|
338
|
+
&:hover {
|
|
339
|
+
background: ${(props) => {
|
|
340
|
+
const variantStyles = getVariantStyles(props)
|
|
341
|
+
return resolveIconBackgroundColor(
|
|
342
|
+
variantStyles,
|
|
343
|
+
props,
|
|
344
|
+
props.isDisabled ? 'disabled' : 'hover'
|
|
345
|
+
)
|
|
346
|
+
}};
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
&:active {
|
|
351
|
+
background: ${(props) => {
|
|
352
|
+
const variantStyles = getVariantStyles(props)
|
|
353
|
+
return resolveIconBackgroundColor(
|
|
354
|
+
variantStyles,
|
|
355
|
+
props,
|
|
356
|
+
props.isDisabled ? 'disabled' : 'active'
|
|
357
|
+
)
|
|
358
|
+
}};
|
|
359
|
+
}
|
|
232
360
|
`
|
|
233
361
|
|
|
234
362
|
const NumberContainer = styled.div`
|
|
@@ -418,10 +546,18 @@
|
|
|
418
546
|
type: Boolean,
|
|
419
547
|
},
|
|
420
548
|
},
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
theme
|
|
424
|
-
}
|
|
549
|
+
computed: {
|
|
550
|
+
theme() {
|
|
551
|
+
return theme
|
|
552
|
+
},
|
|
553
|
+
getIconColor() {
|
|
554
|
+
if (this.iconColor) return this.iconColor
|
|
555
|
+
if (this.isDisabled) {
|
|
556
|
+
return this.theme.mainButton[this.appTheme][this.type][this.variant]
|
|
557
|
+
.disabled.textColor
|
|
558
|
+
}
|
|
559
|
+
return 'currentColor'
|
|
560
|
+
},
|
|
425
561
|
},
|
|
426
562
|
methods: {
|
|
427
563
|
capitalizeFirstLetter(word) {
|
|
@@ -191,9 +191,7 @@
|
|
|
191
191
|
const ThemeSectionAttrs = { isDark: Boolean }
|
|
192
192
|
const ThemeSection = styled('div', ThemeSectionAttrs)`
|
|
193
193
|
background-color: ${(props) =>
|
|
194
|
-
props.isDark
|
|
195
|
-
? props.theme.semanticColors.teal[800]
|
|
196
|
-
: props.theme.colors.white};
|
|
194
|
+
props.isDark ? 'black' : props.theme.colors.white};
|
|
197
195
|
border-radius: 16px;
|
|
198
196
|
padding: 24px;
|
|
199
197
|
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
|