@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.
Files changed (92) hide show
  1. package/dist/index.es3.js +268 -156
  2. package/package.json +3 -3
  3. package/src/assets/theme.js +202 -90
  4. package/src/components/accordion/Accordion.stories.js +1 -1
  5. package/src/components/addNewButton/AddNewButton.stories.js +40 -8
  6. package/src/components/banner/actionBanner/ActionBanner.stories.js +1 -1
  7. package/src/components/banner/actionBanner/index.vue +4 -2
  8. package/src/components/banner/banner/Banner.stories.js +1 -1
  9. package/src/components/banner/infoBanner/InfoBanner.stories.js +1 -1
  10. package/src/components/banner/infoBanner/index.vue +4 -2
  11. package/src/components/banner/notificationBanner/notificationBanner.stories.js +81 -0
  12. package/src/components/buttons/buttonIcon/index.vue +216 -80
  13. package/src/components/buttons/closeButton/CloseButton.stories.js +1 -1
  14. package/src/components/buttons/collection/index.vue +1 -3
  15. package/src/components/buttons/mainButton/index.vue +98 -44
  16. package/src/components/buttons/splitButtons/splitButtons.stories.js +70 -0
  17. package/src/components/card/Card.stories.js +16 -4
  18. package/src/components/card/index.vue +1 -1
  19. package/src/components/collapsableInfoText/collapsableInfoText.stories.js +52 -0
  20. package/src/components/deleteIcon/DeleteIcon.stories.js +1 -1
  21. package/src/components/draggableCard/draggableCard.stories.js +1 -1
  22. package/src/components/draggableInputHandle/draggableInputHandle.stories.js +43 -0
  23. package/src/components/dropdown/Dropdown.stories.js +1 -1
  24. package/src/components/errorMessage/errorMessage.stories.js +31 -17
  25. package/src/components/filter/filterSettings.vue +1 -1
  26. package/src/components/icon/Icon.stories.js +1 -1
  27. package/src/components/iconWrapper/iconWrapper.stories.js +78 -0
  28. package/src/components/infoCard/InfoCard.stories.js +1 -1
  29. package/src/components/infoLabel/infoLabel.stories.js +61 -0
  30. package/src/components/infoText/infoText.stories.js +1 -1
  31. package/src/components/inputs/checkbox/Checkbox.stories.js +1 -1
  32. package/src/components/inputs/checkbox/index.vue +10 -1
  33. package/src/components/inputs/inputNumber/InputNumber.stories.js +1 -1
  34. package/src/components/inputs/inputNumber/index.vue +15 -5
  35. package/src/components/inputs/inputNumberQuestion/inputNumberQuestion.stories.js +77 -0
  36. package/src/components/inputs/inputText/InputText.stories.js +1 -1
  37. package/src/components/inputs/inputText/index.vue +29 -20
  38. package/src/components/inputs/isRequiredLabelStar/isRequiredLabelStar.stories.js +26 -0
  39. package/src/components/inputs/radioButton/RadioButton.stories.js +1 -1
  40. package/src/components/inputs/radioButton/index.vue +21 -7
  41. package/src/components/inputs/searchInput/SearchInput.stories.js +1 -1
  42. package/src/components/inputs/select/index.vue +33 -21
  43. package/src/components/inputs/select/option/index.vue +1 -1
  44. package/src/components/inputs/select/select.stories.js +4 -25
  45. package/src/components/inputs/shared/inputLabelTypography.js +7 -0
  46. package/src/components/inputs/slider/index.vue +9 -12
  47. package/src/components/inputs/slider/slider.stories.js +71 -0
  48. package/src/components/inputs/switchField/index.vue +37 -10
  49. package/src/components/inputs/switchField/switchField.stories.js +71 -0
  50. package/src/components/inputs/textAreaInput/TextAreaInput.stories.js +1 -1
  51. package/src/components/inputs/textAreaInput/index.vue +19 -6
  52. package/src/components/inputs/toggle/Toggle.stories.js +1 -1
  53. package/src/components/inputs/toggle/index.vue +10 -6
  54. package/src/components/label/index.vue +39 -11
  55. package/src/components/label/label.stories.js +69 -0
  56. package/src/components/markerItem/markerItem.stories.js +46 -0
  57. package/src/components/modals/actionModal/actionModal.stories.js +1 -1
  58. package/src/components/modals/actionModal/index.vue +1 -1
  59. package/src/components/modals/infoModal/index.vue +1 -10
  60. package/src/components/modals/infoModal/infoModal.stories.js +1 -1
  61. package/src/components/modals/modal/modal.spec.js +168 -0
  62. package/src/components/modals/modal/modal.stories.js +287 -26
  63. package/src/components/modals/modalBody/index.vue +30 -0
  64. package/src/components/modals/modalButtonContainer/index.vue +42 -0
  65. package/src/components/modals/modalButtonContainer/modalButtonContainer.stories.js +59 -0
  66. package/src/components/modals/modalContent/index.vue +125 -0
  67. package/src/components/modals/modalTitle/index.vue +34 -0
  68. package/src/components/navigationTabs/navigationTabs.stories.js +58 -0
  69. package/src/components/pageSubtitle/PageSubtitle.stories.js +1 -1
  70. package/src/components/pageTitle/PageTitle.stories.js +1 -1
  71. package/src/components/pagination/pagination.stories.js +79 -0
  72. package/src/components/paginationV2/paginationV2.spec.js +132 -0
  73. package/src/components/paginationV2/paginationV2.stories.js +68 -0
  74. package/src/components/panelRangeInfo/panelRangeInfo.stories.js +60 -0
  75. package/src/components/progressBar/ProgressBar.stories.js +1 -1
  76. package/src/components/progressStep/progressStep.stories.js +1 -1
  77. package/src/components/projectMarker/ProjectMarker.stories.js +1 -1
  78. package/src/components/rangeSlider/RangeSlider.stories.js +1 -1
  79. package/src/components/roundTabs/roundTabs.stories.js +54 -0
  80. package/src/components/selectedOptions/selectedOptions.stories.js +1 -1
  81. package/src/components/sideMenu/sideMenu.stories.js +53 -0
  82. package/src/components/spinner/Spinner.stories.js +1 -1
  83. package/src/components/spinnerGif/SpinnerGif.stories.js +1 -1
  84. package/src/components/statusIndicator/statusIndicator.stories.js +101 -0
  85. package/src/components/tableDropdown/TableDropdown.stories.js +1 -1
  86. package/src/components/tables/viewTable/viewTable.stories.js +85 -0
  87. package/src/components/tabsHeader/TabsHeader.stories.js +1 -1
  88. package/src/components/tag/conversionTag/conversionTag.stories.js +47 -0
  89. package/src/components/tag/freeTrialTag/freeTrialTag.stories.js +42 -0
  90. package/src/components/threeDots/index.vue +20 -3
  91. package/src/components/threeDots/threeDots.stories.js +59 -0
  92. package/src/components/videoThumbnail/videoThumbnail.stories.js +1 -1
@@ -2,7 +2,7 @@ import Accordion from './index.vue'
2
2
  import theme from '@/assets/theme'
3
3
 
4
4
  export default {
5
- title: 'Accordion',
5
+ title: 'Components/Accordion/Accordion',
6
6
  component: Accordion,
7
7
  // argTypes: {},
8
8
  }
@@ -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
- // import AddNewButton from "@eturnity/eturnity_reusable_components/src/components/addNewButton"
10
- // To use:
11
- // <add-new-button :shouldPosition="true" />
12
-
13
- export const Default = {
14
- args: {
15
- shouldPosition: true,
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
  }
@@ -1,7 +1,7 @@
1
1
  import ActionBanner from './index.vue'
2
2
  import theme from '@/assets/theme'
3
3
  export default {
4
- title: 'ActionBanner',
4
+ title: 'Components/Banner/ActionBanner',
5
5
  component: ActionBanner,
6
6
  tags: ['autodocs'],
7
7
  }
@@ -42,9 +42,11 @@
42
42
  font-family: inherit;
43
43
  font-size: 18px;
44
44
  font-style: normal;
45
- font-weight: 700;
45
+ font-weight: 500;
46
46
  line-height: 120%;
47
- text-transform: uppercase;
47
+ &:first-letter {
48
+ text-transform: uppercase;
49
+ }
48
50
  `
49
51
  const ButtonContainer = styled.div`
50
52
  display: inline-flex;
@@ -2,7 +2,7 @@ import Banner from './index.vue'
2
2
  import theme from '@/assets/theme'
3
3
 
4
4
  export default {
5
- title: 'Banner',
5
+ title: 'Components/Banner/Banner',
6
6
  component: Banner,
7
7
  tags: ['autodocs'],
8
8
  argTypes: {
@@ -2,7 +2,7 @@ import InfoBanner from './index.vue'
2
2
  import theme from '@/assets/theme'
3
3
 
4
4
  export default {
5
- title: 'InfoBanner',
5
+ title: 'Components/Banner/InfoBanner',
6
6
  component: InfoBanner,
7
7
  tags: ['autodocs'],
8
8
  argTypes: {
@@ -41,9 +41,11 @@
41
41
  font-family: inherit;
42
42
  font-size: 18px;
43
43
  font-style: normal;
44
- font-weight: 700;
44
+ font-weight: 500;
45
45
  line-height: 120%;
46
- text-transform: uppercase;
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 Theme from '../../../assets/theme'
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
- return props.isDisabled
135
- ? props.theme.mainButton[props.appTheme][props.type][props.variant]
136
- .disabled.textColor
137
- : props.theme.mainButton[props.appTheme][props.type][props.variant]
138
- .default.textColor
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 borderValue = props.isDisabled
158
- ? props.theme.mainButton[props.appTheme][props.type][props.variant]
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(
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.isDisabled
176
- ? props.theme.mainButton[props.appTheme][props.type][props.variant]
177
- .disabled.backgroundColor
178
- : props.customColor
179
- ? props.customColor
180
- : props.theme.mainButton[props.appTheme][props.type][props.variant]
181
- .hover.backgroundColor};
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.isDisabled
188
- ? props.theme.mainButton[props.appTheme][props.type][props.variant]
189
- .disabled.backgroundColor
190
- : props.theme.mainButton[props.appTheme][props.type][props.variant]
191
- .active.backgroundColor};
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: rgba(255, 255, 255, 0.1);
225
- border-radius: 4px 0 0 4px;
226
- border-right: ${(props) => {
227
- const borderColor =
228
- props.theme.mainButton[props.appTheme][props.type][props.variant]
229
- .default.borderColor
230
- return borderColor ? `1px solid ${borderColor}` : 'none'
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
- data() {
422
- return {
423
- theme: 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) {
@@ -1,7 +1,7 @@
1
1
  import CloseButton from './index.vue'
2
2
 
3
3
  export default {
4
- title: 'CloseButton',
4
+ title: 'Components/Buttons/CloseButton',
5
5
  component: CloseButton,
6
6
  tags: ['autodocs'],
7
7
  }
@@ -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);