@eturnity/eturnity_reusable_components 8.16.2--EPDM-14330.5 → 8.16.2--EPDM-14330.7

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 (103) hide show
  1. package/package.json +1 -1
  2. package/src/assets/svgIcons/ac_power.svg +4 -0
  3. package/src/assets/svgIcons/arrow_long_left.svg +3 -0
  4. package/src/assets/svgIcons/arrow_long_right.svg +3 -0
  5. package/src/assets/svgIcons/chassis_ground_symbol.svg +27 -0
  6. package/src/assets/svgIcons/dc_power.svg +8 -0
  7. package/src/assets/svgIcons/double_arrow_long.svg +4 -0
  8. package/src/assets/svgIcons/ed_ac.svg +3 -0
  9. package/src/assets/svgIcons/ed_acgrid.svg +4 -0
  10. package/src/assets/svgIcons/ed_arrow_both.svg +7 -0
  11. package/src/assets/svgIcons/ed_arrow_left.svg +7 -0
  12. package/src/assets/svgIcons/ed_arrow_right.svg +7 -0
  13. package/src/assets/svgIcons/ed_battery.svg +10 -0
  14. package/src/assets/svgIcons/ed_batteryacinverter.svg +16 -0
  15. package/src/assets/svgIcons/ed_batteryintegratedinverter.svg +19 -0
  16. package/src/assets/svgIcons/ed_cirquitbreaker.svg +4 -0
  17. package/src/assets/svgIcons/ed_cirquitbreaker_magnetic.svg +6 -0
  18. package/src/assets/svgIcons/ed_cirquitbreaker_thermal.svg +4 -0
  19. package/src/assets/svgIcons/ed_cirquitbreaker_thermal_magnetic.svg +5 -0
  20. package/src/assets/svgIcons/ed_consumption.svg +3 -0
  21. package/src/assets/svgIcons/ed_dc.svg +6 -0
  22. package/src/assets/svgIcons/ed_disconnector.svg +4 -0
  23. package/src/assets/svgIcons/ed_disconnector_fuse.svg +4 -0
  24. package/src/assets/svgIcons/ed_disconnector_fuse_switch.svg +4 -0
  25. package/src/assets/svgIcons/ed_disconnector_loadbreak switch.svg +4 -0
  26. package/src/assets/svgIcons/ed_disconnector_switch.svg +4 -0
  27. package/src/assets/svgIcons/ed_disconnector_switch_auto_release.svg +5 -0
  28. package/src/assets/svgIcons/ed_energymanagement_rectangle.svg +3 -0
  29. package/src/assets/svgIcons/ed_evcharger.svg +19 -0
  30. package/src/assets/svgIcons/ed_flexiblecomponent_circle.svg +3 -0
  31. package/src/assets/svgIcons/ed_flexiblecomponent_square.svg +3 -0
  32. package/src/assets/svgIcons/ed_fuse.svg +3 -0
  33. package/src/assets/svgIcons/ed_ground.svg +5 -0
  34. package/src/assets/svgIcons/ed_heatpump.svg +4 -0
  35. package/src/assets/svgIcons/ed_icon_battery.svg +9 -0
  36. package/src/assets/svgIcons/ed_icon_circle.svg +3 -0
  37. package/src/assets/svgIcons/ed_icon_heatpump.svg +3 -0
  38. package/src/assets/svgIcons/ed_icon_inverter.svg +8 -0
  39. package/src/assets/svgIcons/ed_icon_optimizer.svg +11 -0
  40. package/src/assets/svgIcons/ed_integratedbatteryinverter.svg +10 -0
  41. package/src/assets/svgIcons/ed_inverter-blank.svg +3 -0
  42. package/src/assets/svgIcons/ed_mainsconnection.svg +3 -0
  43. package/src/assets/svgIcons/ed_meter_arrowleft.svg +4 -0
  44. package/src/assets/svgIcons/ed_meter_arrowright.svg +4 -0
  45. package/src/assets/svgIcons/ed_meter_bidirectional.svg +5 -0
  46. package/src/assets/svgIcons/ed_networkandsystemprotection_double.svg +14 -0
  47. package/src/assets/svgIcons/ed_networkandsystemprotection_single.svg +7 -0
  48. package/src/assets/svgIcons/ed_pvpanel.svg +7 -0
  49. package/src/assets/svgIcons/ed_rcd.svg +5 -0
  50. package/src/assets/svgIcons/ed_rcd_simple.svg +3 -0
  51. package/src/assets/svgIcons/ed_spd.svg +6 -0
  52. package/src/assets/svgIcons/ed_stringwithoptimizer.svg +33 -0
  53. package/src/assets/svgIcons/ed_stringwithoutoptimizer.svg +17 -0
  54. package/src/assets/svgIcons/ed_transformer.svg +3 -0
  55. package/src/assets/svgIcons/filter.svg +3 -0
  56. package/src/assets/svgIcons/ground_symbol.svg +28 -0
  57. package/src/assets/svgIcons/move_left.svg +3 -0
  58. package/src/assets/svgIcons/move_right.svg +3 -0
  59. package/src/assets/svgIcons/rectangle.svg +3 -0
  60. package/src/assets/svgIcons/refresh.svg +3 -0
  61. package/src/assets/svgIcons/text_icon.svg +3 -0
  62. package/src/assets/theme.js +17 -1
  63. package/src/components/banner/infoBanner/InfoBanner.spec.js +29 -42
  64. package/src/components/barchart/BottomFields.vue +253 -0
  65. package/src/components/barchart/ChartControls.vue +113 -0
  66. package/src/components/barchart/SelectionBox.vue +150 -0
  67. package/src/components/barchart/composables/index.js +5 -0
  68. package/src/components/barchart/composables/useAxisCalculations.js +104 -0
  69. package/src/components/barchart/composables/useChartData.js +114 -0
  70. package/src/components/barchart/composables/useChartScroll.js +61 -0
  71. package/src/components/barchart/composables/useSelection.js +75 -0
  72. package/src/components/barchart/composables/useTooltip.js +100 -0
  73. package/src/components/barchart/index.vue +385 -0
  74. package/src/components/barchart/styles/bottomFields.js +66 -0
  75. package/src/components/barchart/styles/chart.js +272 -0
  76. package/src/components/barchart/styles/chartControls.js +59 -0
  77. package/src/components/buttons/buttonIcon/index.vue +35 -1
  78. package/src/components/buttons/splitButtons/index.vue +86 -0
  79. package/src/components/collapsableInfoText/index.vue +2 -2
  80. package/src/components/errorMessage/errorMessage.spec.js +34 -0
  81. package/src/components/errorMessage/errorMessage.stories.js +35 -0
  82. package/src/components/filter/filterSettings.vue +2 -0
  83. package/src/components/filterComponent/viewFilter.vue +589 -0
  84. package/src/components/filterComponent/viewSettings.vue +63 -2
  85. package/src/components/filterComponent/viewSort.vue +18 -5
  86. package/src/components/icon/index.vue +32 -9
  87. package/src/components/infoText/index.vue +2 -2
  88. package/src/components/infoText/infoText.spec.js +6 -1
  89. package/src/components/inputs/inputNumber/index.vue +14 -2
  90. package/src/components/inputs/searchInput/index.vue +19 -3
  91. package/src/components/inputs/select/index.vue +108 -19
  92. package/src/components/inputs/select/option/index.vue +5 -0
  93. package/src/components/modals/actionModal/actionModal.spec.js +52 -0
  94. package/src/components/modals/actionModal/actionModal.stories.js +53 -0
  95. package/src/components/modals/actionModal/index.vue +6 -6
  96. package/src/components/modals/infoModal/index.vue +49 -19
  97. package/src/components/modals/infoModal/infoModal.spec.js +55 -0
  98. package/src/components/modals/infoModal/infoModal.stories.js +47 -0
  99. package/src/components/modals/modal/index.vue +16 -5
  100. package/src/components/pageSubtitle/PageSubtitle.stories.js +0 -1
  101. package/src/helpers/isObjectEqual.js +22 -0
  102. package/src/helpers/translateLang.js +95 -24
  103. package/src/main.js +1 -0
@@ -0,0 +1,385 @@
1
+ <template>
2
+ <Container :class="`barchart-${chartId}`" :width="width">
3
+ <ChartControlsWrapper
4
+ v-if="isChartControlsShown('top')"
5
+ :position="chartControlsPosition"
6
+ >
7
+ <ChartControls
8
+ :is-legend-shown="isLegendShown"
9
+ :legends-item-per-row="legendsItemPerRow"
10
+ :position="chartControlsPosition"
11
+ :selected-split-button="selectedSplitButton"
12
+ :series="series"
13
+ :split-button-options="splitButtonOptions"
14
+ :stacked-colors="getStackedColors"
15
+ :y-axis-width="yAxisWidth"
16
+ @select-split-button="handleSelectSplitButton"
17
+ />
18
+ </ChartControlsWrapper>
19
+ <GraphSection :height="height" :width="width">
20
+ <YAxis :width="yAxisWidth" :height="height">
21
+ <YAxisTitleWrapper v-if="yAxisTitle" :height="yAxisHeight">
22
+ {{ yAxisTitle }}
23
+ </YAxisTitleWrapper>
24
+ <YAxisRow
25
+ v-for="label in yAxisLabels"
26
+ :key="label"
27
+ :percentage="
28
+ Number(
29
+ ((label / yAxisLabels[yAxisLabels.length - 1]) * 100).toFixed(4)
30
+ )
31
+ "
32
+ >
33
+ <YAxisLabel>{{ label }}</YAxisLabel>
34
+ <YAxisLine :y-axis-width="yAxisWidth" />
35
+ </YAxisRow>
36
+ </YAxis>
37
+
38
+ <ScrollContainer
39
+ :class="`chart-scroll-container-${chartId}`"
40
+ :is-scrollable="isScrollable"
41
+ :height="height"
42
+ @scroll="handleChartScroll"
43
+ >
44
+ <ChartContent
45
+ ref="chartContent"
46
+ :bar-width="barWidth"
47
+ :height="height"
48
+ :is-scrollable="isScrollable"
49
+ :total-bars="normalizedData.length"
50
+ >
51
+ <LoadingOverlay v-if="isLoading">
52
+ <Spinner size="60px" />
53
+ </LoadingOverlay>
54
+ <SelectionBox
55
+ v-if="selectionSize && isSelectionEnabled"
56
+ :bar-width="barWidth"
57
+ :bars-to-show="selectionSize"
58
+ :container-width="chartContentWidth"
59
+ :is-scrollable="isScrollable"
60
+ :total-bars="normalizedData.length"
61
+ @drag-end="handleSelectionDragEnd"
62
+ @update-selection="updateSelectedBars"
63
+ />
64
+ <BarsContainer>
65
+ <BarGroup
66
+ v-for="(item, index) in normalizedData"
67
+ :bar-width="barWidth"
68
+ class="bar-group"
69
+ :is-scrollable="isScrollable"
70
+ :key="index"
71
+ >
72
+ <BarWrapper>
73
+ <BarSegment
74
+ v-for="(segment, segIndex) in item.segments"
75
+ class="bar-segment"
76
+ :gradient-from="getSegmentGradient(index, segment).from"
77
+ :gradient-to="getSegmentGradient(index, segment).to"
78
+ :height="`${segment.percentage}%`"
79
+ :key="segIndex"
80
+ :z-index="item.segments.length - segIndex"
81
+ @mouseenter="showTooltip(item, $event, series)"
82
+ @mouseleave="hideTooltip"
83
+ />
84
+ </BarWrapper>
85
+ <XAxisLine />
86
+ <XAxisLabelHighlight v-if="isSelectionBoundary(index)">
87
+ {{ item.label }}
88
+ </XAxisLabelHighlight>
89
+ <XAxisLabel v-else>{{ item.label }}</XAxisLabel>
90
+ </BarGroup>
91
+ </BarsContainer>
92
+ </ChartContent>
93
+ </ScrollContainer>
94
+ <Tooltip
95
+ v-if="showTooltipContent"
96
+ :left="tooltipStyle.left"
97
+ :top="tooltipStyle.top"
98
+ >
99
+ <slot :item="tooltipData" name="tooltip" />
100
+ <TooltipTextWrapper v-if="!slots.tooltip && tooltipData">
101
+ <template v-if="!series.length">
102
+ <TooltipText font-weight="500">{{ tooltipData.label }}</TooltipText>
103
+ <TooltipText>
104
+ {{ handleValueFormatter(tooltipData.segments[0].value) }}
105
+ </TooltipText>
106
+ </template>
107
+
108
+ <template v-else>
109
+ <TooltipRow>
110
+ <TooltipText font-weight="500">{{
111
+ tooltipData.label
112
+ }}</TooltipText>
113
+ <TooltipText>
114
+ {{
115
+ handleValueFormatter(
116
+ getTotalSegmentValue(tooltipData.segments)
117
+ )
118
+ }}
119
+ </TooltipText>
120
+ </TooltipRow>
121
+ <template
122
+ v-for="(segment, index) in [...tooltipData.segments].reverse()"
123
+ :key="index"
124
+ >
125
+ <TooltipRow>
126
+ <TooltipGradientBox
127
+ :gradient-from="segment.gradientFrom"
128
+ :gradient-to="segment.gradientTo"
129
+ />
130
+ <TooltipText>
131
+ {{ handleValueFormatter(segment.value) }}
132
+ </TooltipText>
133
+ </TooltipRow>
134
+ </template>
135
+ </template>
136
+ </TooltipTextWrapper>
137
+ </Tooltip>
138
+ </GraphSection>
139
+ <ChartControlsWrapper
140
+ v-if="isChartControlsShown('bottom')"
141
+ :position="chartControlsPosition"
142
+ >
143
+ <ChartControls
144
+ :is-legend-shown="isLegendShown"
145
+ :legends-item-per-row="legendsItemPerRow"
146
+ :position="chartControlsPosition"
147
+ :selected-split-button="selectedSplitButton"
148
+ :series="series"
149
+ :split-button-options="splitButtonOptions"
150
+ :stacked-colors="getStackedColors"
151
+ :y-axis-width="yAxisWidth"
152
+ @select-split-button="handleSelectSplitButton"
153
+ />
154
+ </ChartControlsWrapper>
155
+ <BottomFields
156
+ v-if="isBottomFieldsShown"
157
+ :bar-width="barWidth"
158
+ :chart-id="chartId"
159
+ :data="data"
160
+ :field-mode="fieldMode"
161
+ :is-chart-controls-shown-in-bottom="isChartControlsShown('bottom')"
162
+ :is-scrollable="isScrollable"
163
+ :series="series"
164
+ :y-axis-width="yAxisWidth"
165
+ @input-blur="handleInputBlur"
166
+ @input-blur-all="handleInputBlurAll"
167
+ @input-focus="showTooltipFromInput"
168
+ @sync-scroll="handleBottomFieldsScroll"
169
+ />
170
+ </Container>
171
+ </template>
172
+
173
+ <script setup>
174
+ import { useSlots, computed } from 'vue'
175
+
176
+ import ChartControls from './ChartControls'
177
+ import BottomFields from './BottomFields'
178
+ import SelectionBox from './SelectionBox'
179
+ import Spinner from '../spinner'
180
+
181
+ import {
182
+ useTooltip,
183
+ useChartData,
184
+ useAxisCalculations,
185
+ useSelection,
186
+ useChartScroll,
187
+ } from './composables'
188
+
189
+ import {
190
+ Container,
191
+ GraphSection,
192
+ YAxis,
193
+ YAxisRow,
194
+ YAxisLabel,
195
+ YAxisLine,
196
+ YAxisTitleWrapper,
197
+ ScrollContainer,
198
+ ChartContent,
199
+ BarsContainer,
200
+ BarGroup,
201
+ BarWrapper,
202
+ BarSegment,
203
+ XAxisLabel,
204
+ XAxisLabelHighlight,
205
+ XAxisLine,
206
+ Tooltip,
207
+ TooltipText,
208
+ TooltipTextWrapper,
209
+ TooltipRow,
210
+ TooltipGradientBox,
211
+ ChartControlsWrapper,
212
+ LoadingOverlay,
213
+ } from './styles/chart'
214
+
215
+ const props = defineProps({
216
+ data: {
217
+ type: Array,
218
+ default: () => [],
219
+ validator: (value, ...args) => value.every((item) => 'label' in item),
220
+ },
221
+ series: {
222
+ type: Array,
223
+ default: () => [],
224
+ validator: (value) =>
225
+ value.every(
226
+ (item) => 'name' in item && 'data' in item && Array.isArray(item.data)
227
+ ),
228
+ },
229
+ width: {
230
+ type: String,
231
+ default: '100%',
232
+ },
233
+ height: {
234
+ type: String,
235
+ default: '400px',
236
+ },
237
+ barWidth: {
238
+ type: Number,
239
+ default: 60,
240
+ },
241
+ steps: {
242
+ type: Number,
243
+ default: null,
244
+ },
245
+ yAxisTitle: {
246
+ type: String,
247
+ default: '',
248
+ },
249
+ valueFormatter: {
250
+ type: Function,
251
+ default: null,
252
+ },
253
+ isLegendShown: {
254
+ type: Boolean,
255
+ default: false,
256
+ },
257
+ legendsItemPerRow: {
258
+ type: Number,
259
+ default: 4,
260
+ },
261
+ chartControlsPosition: {
262
+ type: String,
263
+ default: 'top',
264
+ validator: (value) => ['top', 'bottom'].includes(value),
265
+ },
266
+ splitButtonOptions: {
267
+ type: Array,
268
+ default: () => [],
269
+ },
270
+ selectedSplitButton: {
271
+ type: String,
272
+ default: '',
273
+ },
274
+ isScrollable: {
275
+ type: Boolean,
276
+ default: true,
277
+ },
278
+ isBottomFieldsShown: {
279
+ type: Boolean,
280
+ default: false,
281
+ },
282
+ selectionSize: {
283
+ type: Number,
284
+ default: 0,
285
+ },
286
+ isSelectionEnabled: {
287
+ type: Boolean,
288
+ default: false,
289
+ },
290
+ fieldMode: {
291
+ type: String,
292
+ default: 'absolute',
293
+ validator: (value) => ['absolute', 'percentage'].includes(value),
294
+ },
295
+ isLoading: {
296
+ type: Boolean,
297
+ default: false,
298
+ },
299
+ })
300
+
301
+ const generateChartId = () =>
302
+ `chart-${Date.now()}-${Math.floor(Math.random() * 1000)}`
303
+ const chartId = generateChartId()
304
+
305
+ const maxDataValue = computed(() => {
306
+ if (!props.data.length) return 0
307
+
308
+ return Math.max(
309
+ ...props.data.map((item) =>
310
+ props.series.length
311
+ ? props.series.reduce(
312
+ (sum, series) =>
313
+ sum +
314
+ (series.data.find((d) => d.label === item.label)?.value || 0),
315
+ 0
316
+ )
317
+ : item.value
318
+ )
319
+ )
320
+ })
321
+
322
+ const {
323
+ yAxisLabels,
324
+ yAxisHeight,
325
+ yAxisWidth,
326
+ isChartControlsShown,
327
+ paddedMaxValue,
328
+ } = useAxisCalculations(props, maxDataValue)
329
+
330
+ const { normalizedData, getStackedColors, getTotalSegmentValue } =
331
+ useChartData(props, paddedMaxValue)
332
+
333
+ const {
334
+ updateSelectedBars,
335
+ handleSelectionDragEnd,
336
+ isSelectionBoundary,
337
+ getSegmentGradient,
338
+ } = useSelection(props, normalizedData, emit)
339
+
340
+ const {
341
+ showTooltipContent,
342
+ showTooltip,
343
+ hideTooltip,
344
+ tooltipData,
345
+ tooltipStyle,
346
+ isInputFocused,
347
+ focusedBarData,
348
+ showTooltipFromInput,
349
+ handleInputBlurAll,
350
+ } = useTooltip(chartId, normalizedData)
351
+
352
+ const {
353
+ chartContent,
354
+ chartContentWidth,
355
+ handleChartScroll,
356
+ handleBottomFieldsScroll,
357
+ } = useChartScroll(
358
+ chartId,
359
+ isInputFocused,
360
+ focusedBarData,
361
+ showTooltipFromInput
362
+ )
363
+
364
+ const emit = defineEmits([
365
+ 'select-split-button',
366
+ 'selection-change',
367
+ 'input-blur',
368
+ ])
369
+
370
+ const slots = useSlots()
371
+
372
+ const handleSelectSplitButton = (value) => {
373
+ emit('select-split-button', value)
374
+ }
375
+
376
+ const handleInputBlur = (payload) => {
377
+ emit('input-blur', payload)
378
+ }
379
+
380
+ const handleValueFormatter = (value) => {
381
+ return props.valueFormatter
382
+ ? props.valueFormatter(Math.round(value))
383
+ : value
384
+ }
385
+ </script>
@@ -0,0 +1,66 @@
1
+ import styled from 'vue3-styled-components'
2
+
3
+ export const Container = styled('div', {
4
+ isChartControlsShownInBottom: Boolean,
5
+ })`
6
+ display: flex;
7
+ margin-top: ${(props) =>
8
+ props.isChartControlsShownInBottom ? '20px' : '44px'};
9
+ `
10
+
11
+ export const LabelsColumn = styled('div', { width: String })`
12
+ width: ${(props) => props.width};
13
+ display: flex;
14
+ flex-direction: column;
15
+ gap: 12px;
16
+ `
17
+
18
+ export const LabelRow = styled.div`
19
+ height: 32px;
20
+ font-size: 12px;
21
+ font-weight: 500;
22
+ color: ${(props) => props.theme.semanticColors.teal[600]};
23
+ display: flex;
24
+ align-items: flex-start;
25
+ `
26
+
27
+ export const TotalRow = styled(LabelRow)``
28
+
29
+ export const FieldsContainer = styled.div`
30
+ flex: 1;
31
+ overflow-x: auto;
32
+ scrollbar-width: none;
33
+
34
+ &::-webkit-scrollbar {
35
+ display: none;
36
+ }
37
+ `
38
+
39
+ export const FieldsWrapper = styled.div`
40
+ display: flex;
41
+ flex-direction: column;
42
+ gap: 8px;
43
+ `
44
+
45
+ export const InputRow = styled.div`
46
+ display: flex;
47
+ align-items: center;
48
+ justify-content: space-around;
49
+ gap: 8px;
50
+ padding-left: 12px;
51
+ padding-right: 12px;
52
+ `
53
+
54
+ export const TotalInputRow = styled(InputRow)`
55
+ margin-top: 0;
56
+ `
57
+
58
+ export const InputGroup = styled('div', {
59
+ barWidth: Number,
60
+ isScrollable: Boolean,
61
+ })`
62
+ ${(props) => (props.isScrollable ? 'min-width' : 'width')}:${(props) =>
63
+ props.barWidth}px;
64
+ display: flex;
65
+ justify-content: center;
66
+ `
@@ -0,0 +1,272 @@
1
+ import styled from 'vue3-styled-components'
2
+ import theme from '@/assets/theme'
3
+
4
+ export const Container = styled('div', { width: String })`
5
+ display: flex;
6
+ flex-direction: column;
7
+ padding-top: 40px;
8
+ font-family: ${(props) => props.theme.fonts.mainFont};
9
+ width: ${(props) => props.width};
10
+ `
11
+
12
+ export const GraphSection = styled('div', { width: String, height: String })`
13
+ height: ${(props) => props.height};
14
+ width: ${(props) => props.width};
15
+ position: relative;
16
+ display: flex;
17
+ `
18
+
19
+ export const YAxis = styled('div', { width: String, height: String })`
20
+ width: ${(props) => props.width};
21
+ display: flex;
22
+ flex-direction: column;
23
+ position: relative;
24
+ height: ${(props) => props.height};
25
+ `
26
+
27
+ export const YAxisRow = styled('div', { percentage: Number })`
28
+ display: flex;
29
+ align-items: center;
30
+ width: 100%;
31
+ position: absolute;
32
+ height: 0;
33
+ bottom: ${(props) =>
34
+ Number.isFinite(props.percentage) ? `${props.percentage}%` : '0'};
35
+ transform: translateY(50%);
36
+ `
37
+
38
+ export const YAxisLabel = styled.div`
39
+ font-size: 12px;
40
+ color: ${(props) => props.theme.semanticColors.teal[600]};
41
+ width: 100%;
42
+ text-align: right;
43
+ padding-right: 16px;
44
+ position: relative;
45
+ z-index: 1;
46
+ `
47
+
48
+ export const YAxisLine = styled('div', { yAxisWidth: String })`
49
+ position: absolute;
50
+ right: -10px;
51
+ left: calc(${(props) => props.yAxisWidth} - 10px);
52
+ height: 1px;
53
+ background-color: rgba(0, 0, 0, 0.1);
54
+ width: 12px;
55
+ z-index: 0;
56
+ top: 50%;
57
+ transform: translateY(-50%);
58
+ `
59
+
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;
66
+ font-size: 12px;
67
+ color: ${(props) => props.theme.semanticColors.teal[600]};
68
+ display: flex;
69
+ align-items: center;
70
+ white-space: nowrap;
71
+ font-family: ${(props) => props.theme.fonts.mainFont};
72
+ `
73
+
74
+ export const ScrollContainer = styled('div', {
75
+ isScrollable: Boolean,
76
+ height: String,
77
+ })`
78
+ flex: 1;
79
+ overflow-x: auto;
80
+ overflow-y: hidden;
81
+ height: calc(${(props) => props.height} + 30px);
82
+ `
83
+
84
+ export const ChartContent = styled('div', {
85
+ totalBars: Number,
86
+ barWidth: Number,
87
+ isScrollable: Boolean,
88
+ height: String,
89
+ })`
90
+ height: ${(props) => props.height};
91
+ position: relative;
92
+ background: ${(props) => props.theme.semanticColors.grey[100]};
93
+ ${(props) =>
94
+ props.isScrollable
95
+ ? ` min-width: ${props.totalBars * (props.barWidth + 8) + 24}px;`
96
+ : 'width: 100%;'}
97
+ `
98
+
99
+ export const BarsContainer = styled.div`
100
+ height: 100%;
101
+ display: flex;
102
+ align-items: flex-end;
103
+ justify-content: space-around;
104
+ gap: 8px;
105
+ padding-left: 12px;
106
+ padding-right: 12px;
107
+ position: relative;
108
+ z-index: 1;
109
+ pointer-events: none;
110
+ `
111
+
112
+ export const BarGroup = styled('div', {
113
+ barWidth: Number,
114
+ isScrollable: Boolean,
115
+ })`
116
+ display: flex;
117
+ flex-direction: column;
118
+ align-items: center;
119
+ height: 100%;
120
+ position: relative;
121
+ ${(props) => (props.isScrollable ? 'min-width' : 'width')}:${(props) =>
122
+ props.barWidth}px;
123
+ pointer-events: none;
124
+ `
125
+
126
+ export const BarWrapper = styled.div`
127
+ height: 100%;
128
+ width: 100%;
129
+ position: relative;
130
+ `
131
+
132
+ export const BarSegment = styled('div', {
133
+ gradientFrom: String,
134
+ gradientTo: String,
135
+ height: String,
136
+ zIndex: Number,
137
+ })`
138
+ position: absolute;
139
+ bottom: 0;
140
+ left: 0;
141
+ right: 0;
142
+ height: ${(props) => props.height};
143
+ z-index: ${(props) => props.zIndex};
144
+ transition: opacity 0.2s;
145
+ border-radius: 8px 8px 0 0;
146
+ background: ${(props) =>
147
+ `linear-gradient(180deg, ${props.gradientFrom} 0%, ${props.gradientTo} 100%)`};
148
+ transform-origin: bottom;
149
+ will-change: transform, height;
150
+ pointer-events: auto;
151
+ &:hover {
152
+ opacity: 0.8;
153
+ }
154
+ `
155
+
156
+ export const XAxisLabel = styled.div`
157
+ font-size: 12px;
158
+ color: ${(props) => props.theme.semanticColors.teal[600]};
159
+ position: absolute;
160
+ bottom: -12px;
161
+ transform: translateY(100%);
162
+ user-select: none;
163
+ `
164
+
165
+ export const XAxisLabelHighlight = styled.div`
166
+ background: ${theme.semanticColors.purple[500]};
167
+ color: white;
168
+ padding: 4px;
169
+ border-radius: 4px;
170
+ font-size: 12px;
171
+ position: absolute;
172
+ bottom: -8px;
173
+ transform: translateY(100%);
174
+ user-select: none;
175
+ text-align: center;
176
+ `
177
+
178
+ export const XAxisLine = styled.div`
179
+ width: 1px;
180
+ height: 6px;
181
+ background-color: rgba(0, 0, 0, 0.1);
182
+ position: absolute;
183
+ bottom: -6px;
184
+ left: 50%;
185
+ transform: translateX(-50%);
186
+ `
187
+
188
+ export const Tooltip = styled('div', {
189
+ top: String,
190
+ left: String,
191
+ })`
192
+ position: fixed;
193
+ top: ${(props) => props.top};
194
+ left: ${(props) => props.left};
195
+ background: rgba(0, 0, 0, 0.8);
196
+ color: white;
197
+ padding: 4px 6px;
198
+ border-radius: 4px;
199
+ font-size: 14px;
200
+ pointer-events: none;
201
+ transform: translate(-50%, -100%);
202
+ z-index: 1000;
203
+ margin-top: -10px;
204
+
205
+ &::after {
206
+ content: '';
207
+ position: absolute;
208
+ bottom: -6px;
209
+ left: 50%;
210
+ transform: translateX(-50%);
211
+ border-left: 4px solid transparent;
212
+ border-right: 4px solid transparent;
213
+ border-top: 6px solid rgba(0, 0, 0, 0.8);
214
+ width: 0;
215
+ height: 0;
216
+ }
217
+ `
218
+
219
+ export const TooltipText = styled('div', {
220
+ fontWeight: String,
221
+ })`
222
+ font-weight: ${(props) => props.fontWeight || '400'};
223
+ font-size: 12px;
224
+ `
225
+
226
+ export const TooltipTextWrapper = styled.div`
227
+ display: flex;
228
+ flex-direction: column;
229
+ gap: 4px;
230
+ `
231
+
232
+ export const TooltipRow = styled.div`
233
+ width: 100px;
234
+ display: flex;
235
+ flex-direction: row;
236
+ justify-content: space-between;
237
+ align-items: center;
238
+ `
239
+
240
+ export const TooltipGradientBox = styled('div', {
241
+ gradientFrom: String,
242
+ gradientTo: String,
243
+ })`
244
+ background: ${(props) =>
245
+ `linear-gradient(180deg, ${props.gradientFrom} 0%, ${props.gradientTo} 100%)`};
246
+ width: 12px;
247
+ height: 12px;
248
+ border-radius: 4px;
249
+ `
250
+
251
+ export const ChartControlsWrapper = styled('div', { position: String })`
252
+ ${(props) =>
253
+ props.position === 'top' ? 'margin-bottom: 6px;' : 'margin-top: 36px;'}
254
+ `
255
+
256
+ export const BottomFieldsContainer = styled.div`
257
+ margin-top: 16px;
258
+ width: 100%;
259
+ `
260
+
261
+ export const LoadingOverlay = styled('div')`
262
+ position: absolute;
263
+ top: 0;
264
+ left: 0;
265
+ right: 0;
266
+ bottom: 0;
267
+ background: rgba(255, 255, 255, 0.8);
268
+ display: flex;
269
+ justify-content: center;
270
+ align-items: center;
271
+ z-index: 2;
272
+ `