@eturnity/eturnity_reusable_components 8.26.11-EPDM-11600.15 → 8.26.11-qa-07.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.
@@ -16,9 +16,12 @@ export const GraphSection = styled('div', { width: String, height: String })`
16
16
  display: flex;
17
17
  `
18
18
 
19
- export const YAxis = styled('div', { width: String })`
19
+ export const YAxis = styled('div', { width: String, height: String })`
20
20
  width: ${(props) => props.width};
21
+ display: flex;
22
+ flex-direction: column;
21
23
  position: relative;
24
+ height: ${(props) => props.height};
22
25
  `
23
26
 
24
27
  export const YAxisRow = styled('div', { percentage: Number })`
@@ -26,13 +29,10 @@ export const YAxisRow = styled('div', { percentage: Number })`
26
29
  align-items: center;
27
30
  width: 100%;
28
31
  position: absolute;
29
- height: 1px;
32
+ height: 0;
30
33
  bottom: ${(props) =>
31
34
  Number.isFinite(props.percentage) ? `${props.percentage}%` : '0'};
32
- ${(props) =>
33
- Number.isFinite(props.percentage) && props.percentage === 100
34
- ? 'transform: translateY(1px)'
35
- : ''};
35
+ transform: translateY(50%);
36
36
  `
37
37
 
38
38
  export const YAxisLabel = styled.div`
@@ -50,24 +50,25 @@ export const YAxisLine = styled('div', { yAxisWidth: String })`
50
50
  right: -10px;
51
51
  left: calc(${(props) => props.yAxisWidth} - 10px);
52
52
  height: 1px;
53
- background-color: ${(props) => props.theme.semanticColors.grey[400]};
53
+ background-color: rgba(0, 0, 0, 0.1);
54
54
  width: 12px;
55
55
  z-index: 0;
56
+ top: 50%;
57
+ transform: translateY(-50%);
56
58
  `
57
59
 
58
- export const YAxisTitleWrapper = styled('div')`
60
+ export const YAxisTitleWrapper = styled('div', { height: String })`
61
+ position: absolute;
62
+ left: -66px;
63
+ top: ${(props) => props.height};
64
+ transform: rotate(-90deg) translateX(50%);
65
+ transform-origin: right;
59
66
  font-size: 12px;
60
- font-weight: 500;
61
- color: ${(props) => props.theme.semanticColors.grey[700]};
62
- white-space: nowrap;
63
- height: 0;
64
- width: 0;
67
+ color: ${(props) => props.theme.semanticColors.teal[600]};
65
68
  display: flex;
66
- align-items: flex-start;
67
- justify-content: center;
68
- position: absolute;
69
- top: 50%;
70
- transform: rotate(-90deg);
69
+ align-items: center;
70
+ white-space: nowrap;
71
+ font-family: ${(props) => props.theme.fonts.mainFont};
71
72
  `
72
73
 
73
74
  export const ScrollContainer = styled('div', {
@@ -89,8 +90,6 @@ export const ChartContent = styled('div', {
89
90
  height: ${(props) => props.height};
90
91
  position: relative;
91
92
  background: ${(props) => props.theme.semanticColors.grey[100]};
92
- border-bottom: ${(props) =>
93
- `1px solid ${props.theme.semanticColors.grey[400]}`};
94
93
  ${(props) =>
95
94
  props.isScrollable
96
95
  ? ` min-width: ${props.totalBars * (props.barWidth + 8) + 24}px;`
@@ -180,7 +179,7 @@ export const XAxisLabelHighlight = styled.div`
180
179
  export const XAxisLine = styled.div`
181
180
  width: 1px;
182
181
  height: 6px;
183
- background-color: ${(props) => props.theme.semanticColors.grey[400]};
182
+ background-color: rgba(0, 0, 0, 0.1);
184
183
  position: absolute;
185
184
  bottom: -6px;
186
185
  left: 50%;
@@ -272,13 +271,3 @@ export const LoadingOverlay = styled('div')`
272
271
  align-items: center;
273
272
  z-index: 2;
274
273
  `
275
-
276
- export const InfoCardContainer = styled('div')`
277
- position: absolute;
278
- top: 50%;
279
- left: 50%;
280
- transform: translate(-50%, -50%);
281
- width: 500px;
282
- max-width: 500px;
283
- z-index: 2;
284
- `
@@ -50,6 +50,7 @@
50
50
  numberCount
51
51
  }}</NumberText>
52
52
  </NumberContainer>
53
+ <BetaTag v-if="isBeta" :is-disabled="isDisabled"> Beta </BetaTag>
53
54
  </ButtonWrapper>
54
55
  </PageContainer>
55
56
  </template>
@@ -70,7 +71,9 @@
70
71
  import styled from 'vue3-styled-components'
71
72
  import Theme from '@/assets/theme'
72
73
 
73
- const PageContainer = styled.div``
74
+ const PageContainer = styled.div`
75
+ position: relative;
76
+ `
74
77
 
75
78
  const ButtonAttrs = {
76
79
  type: String,
@@ -200,6 +203,23 @@
200
203
  background-color: ${(props) => props.theme.semanticColors.purple[50]};
201
204
  `
202
205
 
206
+ const BetaTag = styled('div', { isDisabled: Boolean })`
207
+ position: absolute;
208
+ top: -5px;
209
+ right: -8px;
210
+ padding: 4px;
211
+ border-radius: 4px;
212
+ font-size: 10px;
213
+ background-color: ${(props) =>
214
+ props.isDisabled
215
+ ? props.theme.colors.disabled
216
+ : props.theme.semanticColors.red[500]};
217
+ color: ${(props) => props.theme.colors.white};
218
+ font-weight: 700;
219
+ transform: rotate(20deg);
220
+ cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
221
+ `
222
+
203
223
  export default {
204
224
  name: 'ButtonIcon',
205
225
  components: {
@@ -210,6 +230,7 @@
210
230
  Icon,
211
231
  NumberContainer,
212
232
  NumberText,
233
+ BetaTag,
213
234
  },
214
235
  props: {
215
236
  type: {
@@ -293,6 +314,10 @@
293
314
  type: String,
294
315
  default: 'auto',
295
316
  },
317
+ isBeta: {
318
+ type: Boolean,
319
+ default: false,
320
+ },
296
321
  },
297
322
  data() {
298
323
  return {
@@ -7,11 +7,13 @@
7
7
  :data-id="dataId"
8
8
  :data-qa-id="dataQaId"
9
9
  :height="height"
10
+ :is-active="isActive"
10
11
  :is-disabled="isDisabled"
11
12
  :min-width="minWidth"
12
13
  :no-wrap="noWrap"
13
14
  :type="type"
14
15
  :variant="variant"
16
+ :width="width"
15
17
  >
16
18
  <LabelComponent :has-icon="Boolean(icon)">
17
19
  <Icon
@@ -50,11 +52,13 @@
50
52
  type: String,
51
53
  isDisabled: Boolean,
52
54
  minWidth: String,
55
+ width: String,
53
56
  noWrap: Boolean,
54
57
  height: String,
55
58
  variant: String,
56
59
  buttonSize: String,
57
60
  appTheme: String,
61
+ isActive: Boolean,
58
62
  }
59
63
  const ButtonContainer = styled('div', ButtonAttrs)`
60
64
  display: flex;
@@ -73,6 +77,9 @@
73
77
  props.isDisabled
74
78
  ? props.theme.mainButton[props.appTheme][props.type][props.variant]
75
79
  .disabled.backgroundColor
80
+ : props.isActive
81
+ ? props.theme.mainButton[props.appTheme][props.type][props.variant]
82
+ .active.backgroundColor
76
83
  : props.theme.mainButton[props.appTheme][props.type][props.variant]
77
84
  .default.backgroundColor};
78
85
  border: ${(props) => {
@@ -91,7 +98,7 @@
91
98
  ${(props) => (props.noWrap ? `white-space: nowrap;` : '')};
92
99
  height: ${(props) => props.height};
93
100
  line-height: 1;
94
-
101
+ width: ${(props) => props.width};
95
102
  &:hover {
96
103
  background-color: ${(props) =>
97
104
  props.isDisabled
@@ -170,6 +177,11 @@
170
177
  default: false,
171
178
  type: Boolean,
172
179
  },
180
+ isActive: {
181
+ required: false,
182
+ default: false,
183
+ type: Boolean,
184
+ },
173
185
  icon: {
174
186
  required: false,
175
187
  default: null,
@@ -204,6 +216,11 @@
204
216
  default: null,
205
217
  type: String,
206
218
  },
219
+ width: {
220
+ required: false,
221
+ default: 'auto',
222
+ type: String,
223
+ },
207
224
  height: {
208
225
  required: false,
209
226
  default: 'auto',
@@ -49,7 +49,10 @@
49
49
  <slot name="trigger"></slot>
50
50
  </IconWrapper>
51
51
  </div>
52
- <Teleport v-if="isVisible && (!!text || $slots.default)" to="body">
52
+ <Teleport
53
+ v-if="!hideInfoText && isVisible && (!!text || $slots.default)"
54
+ to="body"
55
+ >
53
56
  <TextWrapper data-test-id="info_text_wrapper" :style="wrapperStyle">
54
57
  <TextOverlay
55
58
  ref="infoBox"
@@ -3,15 +3,15 @@ import InputNumber from './index.vue'
3
3
  export default {
4
4
  title: 'InputNumber',
5
5
  component: InputNumber,
6
+ // argTypes: {},
6
7
  }
7
8
 
8
- const Template = (args) => ({
9
+ const Template = (args, { argTypes }) => ({
9
10
  // Components used in your story `template` are defined in the `components` object
10
11
  components: { InputNumber },
11
- setup() {
12
- return { args: args }
13
- },
14
- template: `<InputNumber v-bind="args" />`,
12
+ // The story's `args` need to be mapped into the template through the `setup()` method
13
+ props: Object.keys(argTypes),
14
+ template: '<input-number v-bind="$props" />',
15
15
 
16
16
  // import InputNumber from "@eturnity/eturnity_reusable_components/src/components/inputs/inputNumber"
17
17
  // How to use:
@@ -50,6 +50,7 @@
50
50
  :color-mode="colorMode"
51
51
  :data-id="inputDataId"
52
52
  :data-qa-id="dataQaId"
53
+ :disabled="disabled && !isDisabledStyledOnly"
53
54
  :font-color="colorMode === 'transparent' ? 'white' : fontColor"
54
55
  :font-size="fontSize"
55
56
  :has-label-slot="hasLabelSlot"
@@ -57,7 +58,7 @@
57
58
  :has-unit="unitName && !!unitName.length"
58
59
  :input-height="inputHeight"
59
60
  :is-border-error-only="isBorderErrorOnly"
60
- :is-disabled="disabled && !isDisabledStyledOnly"
61
+ :is-disabled="disabled"
61
62
  :is-error="isError"
62
63
  :is-info-border="isInfoBorder"
63
64
  :is-interactive="isInteractive"
@@ -95,6 +96,7 @@
95
96
  :color-mode="colorMode"
96
97
  :data-id="inputDataId"
97
98
  :data-qa-id="dataQaId"
99
+ :disabled="disabled && !isDisabledStyledOnly"
98
100
  :font-color="colorMode === 'transparent' ? 'white' : fontColor"
99
101
  :font-size="fontSize"
100
102
  :has-label-slot="hasLabelSlot"
@@ -102,7 +104,7 @@
102
104
  :has-unit="unitName && !!unitName.length"
103
105
  :input-height="inputHeight"
104
106
  :is-border-error-only="isBorderErrorOnly"
105
- :is-disabled="disabled && !isDisabledStyledOnly"
107
+ :is-disabled="disabled"
106
108
  :is-error="isError"
107
109
  :is-info-border="isInfoBorder"
108
110
  :is-interactive="isInteractive"
@@ -746,7 +748,6 @@
746
748
  default: '',
747
749
  },
748
750
  dataQaId: {
749
- type: String,
750
751
  required: false,
751
752
  default: '',
752
753
  },
@@ -798,6 +799,10 @@
798
799
  type: Boolean,
799
800
  default: false,
800
801
  },
802
+ hasSpaceBetweenUnit: {
803
+ type: Boolean,
804
+ default: true,
805
+ },
801
806
  },
802
807
  data() {
803
808
  return {
@@ -811,8 +816,12 @@
811
816
  displayedPlaceholder() {
812
817
  if (this.placeholder) return this.placeholder
813
818
  if (this.defaultNumber)
814
- return `${this.defaultNumber} ${this.unitName ? this.unitName : ''}`
815
- return `${this.minNumber || 0} ${this.unitName ? this.unitName : ''}`
819
+ return `${this.defaultNumber}${this.hasSpaceBetweenUnit ? ' ' : ''}${
820
+ this.unitName ? this.unitName : ''
821
+ }`
822
+ return `${this.minNumber || 0}${this.hasSpaceBetweenUnit ? ' ' : ''}${
823
+ this.unitName ? this.unitName : ''
824
+ }`
816
825
  },
817
826
  hasSlot() {
818
827
  return !!this.$slots.default
@@ -1026,8 +1035,9 @@
1026
1035
  return
1027
1036
  }
1028
1037
  this.textInput = this.formatWithCurrency(this.value)
1038
+ const textInputWithoutUnit = this.formatWithoutUnit(this.value)
1029
1039
  this.enteredValue = stringToNumber({
1030
- value: this.textInput,
1040
+ value: textInputWithoutUnit,
1031
1041
  numberPrecision: this.numberPrecision,
1032
1042
  minDecimals: this.minDecimals,
1033
1043
  })
@@ -1048,6 +1058,38 @@
1048
1058
  this.$refs.inputField1.$el.blur()
1049
1059
  })
1050
1060
  },
1061
+ formatWithoutUnit(value) {
1062
+ let adjustedMinValue =
1063
+ value || value === 0
1064
+ ? value
1065
+ : this.defaultNumber
1066
+ ? this.defaultNumber
1067
+ : this.minNumber || this.minNumber === 0
1068
+ ? this.minNumber
1069
+ : ''
1070
+ if (adjustedMinValue || adjustedMinValue === 0) {
1071
+ let input = this.numberToStringEnabled
1072
+ ? numberToString({
1073
+ value: adjustedMinValue,
1074
+ numberPrecision: this.numberPrecision,
1075
+ minDecimals: this.minDecimals,
1076
+ })
1077
+ : adjustedMinValue
1078
+ return input
1079
+ } else if (!adjustedMinValue && adjustedMinValue !== 0) {
1080
+ return ''
1081
+ } else if (this.isFocused) {
1082
+ return value
1083
+ } else {
1084
+ return this.numberToStringEnabled
1085
+ ? numberToString({
1086
+ value: adjustedMinValue,
1087
+ numberPrecision: this.numberPrecision,
1088
+ minDecimals: this.minDecimals,
1089
+ })
1090
+ : adjustedMinValue
1091
+ }
1092
+ },
1051
1093
  formatWithCurrency(value) {
1052
1094
  let adjustedMinValue =
1053
1095
  value || value === 0
@@ -1068,7 +1110,7 @@
1068
1110
  let unit = this.showLinearUnitName ? '' : this.unitName
1069
1111
  //return input + ' ' + unit
1070
1112
  if (unit) {
1071
- return input + ' ' + unit
1113
+ return `${input}${this.hasSpaceBetweenUnit ? ' ' : ''}${unit}`
1072
1114
  }
1073
1115
  return input
1074
1116
  } else if (!adjustedMinValue && adjustedMinValue !== 0) {
@@ -5,8 +5,7 @@
5
5
  :has-info-text="!!infoText"
6
6
  :margin-bottom="marginBottom"
7
7
  >
8
- <span v-if="containsHtml" data-test-id="page_subtitle_text" v-html="text"></span>
9
- <span v-else data-test-id="page_subtitle_text">
8
+ <span data-test-id="page_subtitle_text">
10
9
  {{ text }}
11
10
  </span>
12
11
  <InfoText
@@ -59,11 +58,6 @@
59
58
  required: true,
60
59
  type: String,
61
60
  },
62
- containsHtml: {
63
- required: false,
64
- type: Boolean,
65
- default: false,
66
- },
67
61
  color: {
68
62
  required: false,
69
63
  type: String,