@eturnity/eturnity_reusable_components 9.22.2 → 9.25.1
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/svgIcons/add_thin_icon.svg +3 -0
- package/src/assets/svgIcons/delete.svg +2 -3
- package/src/assets/svgIcons/location_outline.svg +3 -0
- package/src/assets/svgIcons/redo.svg +2 -5
- package/src/assets/svgIcons/save.svg +2 -2
- package/src/assets/svgIcons/subtract_thin_icon.svg +3 -0
- package/src/assets/svgIcons/undo.svg +2 -5
- 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 +213 -81
- 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 +99 -45
- 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/colorSelector/ColorSelector.stories.js +78 -0
- package/src/components/inputs/colorSelector/colorSelector.spec.js +73 -0
- package/src/components/inputs/colorSelector/defaultProps.js +11 -0
- package/src/components/inputs/colorSelector/index.vue +224 -0
- package/src/components/inputs/inputNumber/InputNumber.stories.js +1 -1
- package/src/components/inputs/inputNumber/index.vue +69 -59
- 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 +38 -10
- package/src/components/inputs/switchField/switchField.stories.js +72 -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/conversionTag/index.vue +1 -1
- 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
- package/src/constants/colorPalettes.js +71 -0
|
@@ -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,30 @@
|
|
|
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
|
-
.disabled.borderColor
|
|
160
|
-
: props.customColor
|
|
161
|
-
? props.customColor
|
|
162
|
-
: props.theme.mainButton[props.appTheme][props.type][props.variant]
|
|
163
|
-
.default.borderColor
|
|
164
|
-
return borderValue ? '1px solid ' + borderValue : 'none'
|
|
214
|
+
const variantStyles = getVariantStyles(props)
|
|
215
|
+
return resolveButtonBorder(variantStyles, props, getButtonState(props))
|
|
165
216
|
}};
|
|
166
217
|
cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
|
|
167
218
|
user-select: none;
|
|
@@ -169,26 +220,71 @@
|
|
|
169
220
|
overflow: visible;
|
|
170
221
|
min-width: ${(props) => props.minWidth || 'initial'};
|
|
171
222
|
|
|
223
|
+
.button-icon-container {
|
|
224
|
+
border-right: ${(props) => {
|
|
225
|
+
const variantStyles = getVariantStyles(props)
|
|
226
|
+
return getButtonBorder(variantStyles, getInteractionState(props))
|
|
227
|
+
}};
|
|
228
|
+
}
|
|
229
|
+
|
|
172
230
|
@media (hover: hover) and (pointer: fine) {
|
|
173
231
|
&:hover {
|
|
174
|
-
background-color: ${(props) =>
|
|
175
|
-
props
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
232
|
+
background-color: ${(props) => {
|
|
233
|
+
const variantStyles = getVariantStyles(props)
|
|
234
|
+
return resolveButtonBackgroundColor(variantStyles, props, 'hover')
|
|
235
|
+
}};
|
|
236
|
+
color: ${(props) => {
|
|
237
|
+
const variantStyles = getVariantStyles(props)
|
|
238
|
+
return resolveButtonTextColor(variantStyles, props, 'hover')
|
|
239
|
+
}};
|
|
240
|
+
border: ${(props) => {
|
|
241
|
+
const variantStyles = getVariantStyles(props)
|
|
242
|
+
return resolveButtonBorder(
|
|
243
|
+
variantStyles,
|
|
244
|
+
props,
|
|
245
|
+
props.isDisabled ? 'disabled' : 'hover'
|
|
246
|
+
)
|
|
247
|
+
}};
|
|
248
|
+
|
|
249
|
+
.button-icon-container {
|
|
250
|
+
border-right: ${(props) => {
|
|
251
|
+
const variantStyles = getVariantStyles(props)
|
|
252
|
+
return getButtonBorder(
|
|
253
|
+
variantStyles,
|
|
254
|
+
props.isDisabled ? 'disabled' : 'hover'
|
|
255
|
+
)
|
|
256
|
+
}};
|
|
257
|
+
}
|
|
182
258
|
}
|
|
183
259
|
}
|
|
184
260
|
|
|
185
261
|
&:active {
|
|
186
|
-
background-color: ${(props) =>
|
|
187
|
-
props
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
262
|
+
background-color: ${(props) => {
|
|
263
|
+
const variantStyles = getVariantStyles(props)
|
|
264
|
+
return resolveButtonBackgroundColor(variantStyles, props, 'active')
|
|
265
|
+
}};
|
|
266
|
+
color: ${(props) => {
|
|
267
|
+
const variantStyles = getVariantStyles(props)
|
|
268
|
+
return resolveButtonTextColor(variantStyles, props, 'active')
|
|
269
|
+
}};
|
|
270
|
+
border: ${(props) => {
|
|
271
|
+
const variantStyles = getVariantStyles(props)
|
|
272
|
+
return resolveButtonBorder(
|
|
273
|
+
variantStyles,
|
|
274
|
+
props,
|
|
275
|
+
props.isDisabled ? 'disabled' : 'active'
|
|
276
|
+
)
|
|
277
|
+
}};
|
|
278
|
+
|
|
279
|
+
.button-icon-container {
|
|
280
|
+
border-right: ${(props) => {
|
|
281
|
+
const variantStyles = getVariantStyles(props)
|
|
282
|
+
return getButtonBorder(
|
|
283
|
+
variantStyles,
|
|
284
|
+
props.isDisabled ? 'disabled' : 'active'
|
|
285
|
+
)
|
|
286
|
+
}};
|
|
287
|
+
}
|
|
192
288
|
}
|
|
193
289
|
`
|
|
194
290
|
|
|
@@ -213,6 +309,9 @@
|
|
|
213
309
|
type: String,
|
|
214
310
|
variant: String,
|
|
215
311
|
height: String,
|
|
312
|
+
isDisabled: Boolean,
|
|
313
|
+
isActive: Boolean,
|
|
314
|
+
isHovered: Boolean,
|
|
216
315
|
}
|
|
217
316
|
const IconContainer = styled('div', IconContainerAttrs)`
|
|
218
317
|
display: grid;
|
|
@@ -221,14 +320,39 @@
|
|
|
221
320
|
justify-items: center;
|
|
222
321
|
width: ${(props) =>
|
|
223
322
|
props.theme?.mainButton?.size?.[props.buttonSize]?.iconWidth};
|
|
224
|
-
background:
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
props
|
|
229
|
-
|
|
230
|
-
|
|
323
|
+
background: ${(props) => {
|
|
324
|
+
const variantStyles = getVariantStyles(props)
|
|
325
|
+
return resolveIconBackgroundColor(
|
|
326
|
+
variantStyles,
|
|
327
|
+
props,
|
|
328
|
+
getInteractionState(props)
|
|
329
|
+
)
|
|
231
330
|
}};
|
|
331
|
+
border-radius: 4px 0 0 4px;
|
|
332
|
+
|
|
333
|
+
@media (hover: hover) and (pointer: fine) {
|
|
334
|
+
&:hover {
|
|
335
|
+
background: ${(props) => {
|
|
336
|
+
const variantStyles = getVariantStyles(props)
|
|
337
|
+
return resolveIconBackgroundColor(
|
|
338
|
+
variantStyles,
|
|
339
|
+
props,
|
|
340
|
+
props.isDisabled ? 'disabled' : 'hover'
|
|
341
|
+
)
|
|
342
|
+
}};
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
&:active {
|
|
347
|
+
background: ${(props) => {
|
|
348
|
+
const variantStyles = getVariantStyles(props)
|
|
349
|
+
return resolveIconBackgroundColor(
|
|
350
|
+
variantStyles,
|
|
351
|
+
props,
|
|
352
|
+
props.isDisabled ? 'disabled' : 'active'
|
|
353
|
+
)
|
|
354
|
+
}};
|
|
355
|
+
}
|
|
232
356
|
`
|
|
233
357
|
|
|
234
358
|
const NumberContainer = styled.div`
|
|
@@ -282,7 +406,7 @@
|
|
|
282
406
|
? props.theme.colors.disabled
|
|
283
407
|
: props.theme.semanticColors.red[500]};
|
|
284
408
|
color: ${(props) => props.theme.colors.white};
|
|
285
|
-
font-weight:
|
|
409
|
+
font-weight: 500;
|
|
286
410
|
transform: rotate(20deg);
|
|
287
411
|
cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
|
|
288
412
|
`
|
|
@@ -418,10 +542,18 @@
|
|
|
418
542
|
type: Boolean,
|
|
419
543
|
},
|
|
420
544
|
},
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
theme
|
|
424
|
-
}
|
|
545
|
+
computed: {
|
|
546
|
+
theme() {
|
|
547
|
+
return theme
|
|
548
|
+
},
|
|
549
|
+
getIconColor() {
|
|
550
|
+
if (this.iconColor) return this.iconColor
|
|
551
|
+
if (this.isDisabled) {
|
|
552
|
+
return this.theme.mainButton[this.appTheme][this.type][this.variant]
|
|
553
|
+
.disabled.textColor
|
|
554
|
+
}
|
|
555
|
+
return 'currentColor'
|
|
556
|
+
},
|
|
425
557
|
},
|
|
426
558
|
methods: {
|
|
427
559
|
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);
|