@razorpay/blade 12.63.0 → 12.64.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 (100) hide show
  1. package/build/lib/native/components/Charts/CommonChartComponents/CommonChartComponentsContext.js +6 -0
  2. package/build/lib/native/components/Charts/CommonChartComponents/CommonChartComponentsContext.js.map +1 -0
  3. package/build/lib/native/components/Charts/CommonChartComponents/tokens.js +4 -0
  4. package/build/lib/native/components/Charts/CommonChartComponents/tokens.js.map +1 -0
  5. package/build/lib/native/components/index.js +2 -0
  6. package/build/lib/native/components/index.js.map +1 -1
  7. package/build/lib/native/tokens/global/colors.js +1 -1
  8. package/build/lib/native/tokens/global/colors.js.map +1 -1
  9. package/build/lib/native/tokens/theme/bladeTheme.js +1 -1
  10. package/build/lib/native/tokens/theme/bladeTheme.js.map +1 -1
  11. package/build/lib/native/tokens/theme/theme.js.map +1 -1
  12. package/build/lib/web/development/components/Charts/AreaChart/AreaChart.web.js +140 -38
  13. package/build/lib/web/development/components/Charts/AreaChart/AreaChart.web.js.map +1 -1
  14. package/build/lib/web/development/components/Charts/BarChart/BarChart.web.js +121 -57
  15. package/build/lib/web/development/components/Charts/BarChart/BarChart.web.js.map +1 -1
  16. package/build/lib/web/development/components/Charts/CommonChartComponents/CommonChartComponents.web.js +145 -92
  17. package/build/lib/web/development/components/Charts/CommonChartComponents/CommonChartComponents.web.js.map +1 -1
  18. package/build/lib/web/development/components/Charts/CommonChartComponents/CommonChartComponentsContext.js +15 -0
  19. package/build/lib/web/development/components/Charts/CommonChartComponents/CommonChartComponentsContext.js.map +1 -0
  20. package/build/lib/web/development/components/Charts/CommonChartComponents/index.js +2 -0
  21. package/build/lib/web/development/components/Charts/CommonChartComponents/index.js.map +1 -1
  22. package/build/lib/web/development/components/Charts/CommonChartComponents/tokens.js +2 -1
  23. package/build/lib/web/development/components/Charts/CommonChartComponents/tokens.js.map +1 -1
  24. package/build/lib/web/development/components/Charts/DonutChart/DonutChart.web.js +202 -69
  25. package/build/lib/web/development/components/Charts/DonutChart/DonutChart.web.js.map +1 -1
  26. package/build/lib/web/development/components/Charts/LineChart/LineChart.web.js +84 -32
  27. package/build/lib/web/development/components/Charts/LineChart/LineChart.web.js.map +1 -1
  28. package/build/lib/web/development/components/Charts/utils/assignDataColorMapping/assignDataColorMapping.js +33 -0
  29. package/build/lib/web/development/components/Charts/utils/assignDataColorMapping/assignDataColorMapping.js.map +1 -0
  30. package/build/lib/web/development/components/Charts/utils/assignDataColorMapping/index.js +2 -0
  31. package/build/lib/web/development/components/Charts/utils/assignDataColorMapping/index.js.map +1 -0
  32. package/build/lib/web/development/components/Charts/utils/getHighestColorInRange.js +53 -0
  33. package/build/lib/web/development/components/Charts/utils/getHighestColorInRange.js.map +1 -0
  34. package/build/lib/web/development/components/Charts/utils/index.js +5 -0
  35. package/build/lib/web/development/components/Charts/utils/index.js.map +1 -1
  36. package/build/lib/web/development/components/Charts/utils/isSequentialColor.js +35 -0
  37. package/build/lib/web/development/components/Charts/utils/isSequentialColor.js.map +1 -0
  38. package/build/lib/web/development/components/Charts/utils/sanitizeString/index.js +2 -0
  39. package/build/lib/web/development/components/Charts/utils/sanitizeString/index.js.map +1 -0
  40. package/build/lib/web/development/components/Charts/utils/sanitizeString/sanitizeString.js +30 -0
  41. package/build/lib/web/development/components/Charts/utils/sanitizeString/sanitizeString.js.map +1 -0
  42. package/build/lib/web/development/components/Charts/utils/tokens.js +7 -0
  43. package/build/lib/web/development/components/Charts/utils/tokens.js.map +1 -0
  44. package/build/lib/web/development/components/Charts/utils/useColorTheme.js +32 -11
  45. package/build/lib/web/development/components/Charts/utils/useColorTheme.js.map +1 -1
  46. package/build/lib/web/development/components/index.js +2 -0
  47. package/build/lib/web/development/components/index.js.map +1 -1
  48. package/build/lib/web/development/tokens/global/colors.js +48 -48
  49. package/build/lib/web/development/tokens/global/colors.js.map +1 -1
  50. package/build/lib/web/development/tokens/theme/bladeTheme.js +139 -111
  51. package/build/lib/web/development/tokens/theme/bladeTheme.js.map +1 -1
  52. package/build/lib/web/development/tokens/theme/theme.js.map +1 -1
  53. package/build/lib/web/production/components/Charts/AreaChart/AreaChart.web.js +140 -38
  54. package/build/lib/web/production/components/Charts/AreaChart/AreaChart.web.js.map +1 -1
  55. package/build/lib/web/production/components/Charts/BarChart/BarChart.web.js +121 -57
  56. package/build/lib/web/production/components/Charts/BarChart/BarChart.web.js.map +1 -1
  57. package/build/lib/web/production/components/Charts/CommonChartComponents/CommonChartComponents.web.js +145 -92
  58. package/build/lib/web/production/components/Charts/CommonChartComponents/CommonChartComponents.web.js.map +1 -1
  59. package/build/lib/web/production/components/Charts/CommonChartComponents/CommonChartComponentsContext.js +15 -0
  60. package/build/lib/web/production/components/Charts/CommonChartComponents/CommonChartComponentsContext.js.map +1 -0
  61. package/build/lib/web/production/components/Charts/CommonChartComponents/index.js +2 -0
  62. package/build/lib/web/production/components/Charts/CommonChartComponents/index.js.map +1 -1
  63. package/build/lib/web/production/components/Charts/CommonChartComponents/tokens.js +2 -1
  64. package/build/lib/web/production/components/Charts/CommonChartComponents/tokens.js.map +1 -1
  65. package/build/lib/web/production/components/Charts/DonutChart/DonutChart.web.js +202 -69
  66. package/build/lib/web/production/components/Charts/DonutChart/DonutChart.web.js.map +1 -1
  67. package/build/lib/web/production/components/Charts/LineChart/LineChart.web.js +84 -32
  68. package/build/lib/web/production/components/Charts/LineChart/LineChart.web.js.map +1 -1
  69. package/build/lib/web/production/components/Charts/utils/assignDataColorMapping/assignDataColorMapping.js +33 -0
  70. package/build/lib/web/production/components/Charts/utils/assignDataColorMapping/assignDataColorMapping.js.map +1 -0
  71. package/build/lib/web/production/components/Charts/utils/assignDataColorMapping/index.js +2 -0
  72. package/build/lib/web/production/components/Charts/utils/assignDataColorMapping/index.js.map +1 -0
  73. package/build/lib/web/production/components/Charts/utils/getHighestColorInRange.js +53 -0
  74. package/build/lib/web/production/components/Charts/utils/getHighestColorInRange.js.map +1 -0
  75. package/build/lib/web/production/components/Charts/utils/index.js +5 -0
  76. package/build/lib/web/production/components/Charts/utils/index.js.map +1 -1
  77. package/build/lib/web/production/components/Charts/utils/isSequentialColor.js +35 -0
  78. package/build/lib/web/production/components/Charts/utils/isSequentialColor.js.map +1 -0
  79. package/build/lib/web/production/components/Charts/utils/sanitizeString/index.js +2 -0
  80. package/build/lib/web/production/components/Charts/utils/sanitizeString/index.js.map +1 -0
  81. package/build/lib/web/production/components/Charts/utils/sanitizeString/sanitizeString.js +30 -0
  82. package/build/lib/web/production/components/Charts/utils/sanitizeString/sanitizeString.js.map +1 -0
  83. package/build/lib/web/production/components/Charts/utils/tokens.js +7 -0
  84. package/build/lib/web/production/components/Charts/utils/tokens.js.map +1 -0
  85. package/build/lib/web/production/components/Charts/utils/useColorTheme.js +32 -11
  86. package/build/lib/web/production/components/Charts/utils/useColorTheme.js.map +1 -1
  87. package/build/lib/web/production/components/index.js +2 -0
  88. package/build/lib/web/production/components/index.js.map +1 -1
  89. package/build/lib/web/production/tokens/global/colors.js +48 -48
  90. package/build/lib/web/production/tokens/global/colors.js.map +1 -1
  91. package/build/lib/web/production/tokens/theme/bladeTheme.js +139 -111
  92. package/build/lib/web/production/tokens/theme/bladeTheme.js.map +1 -1
  93. package/build/lib/web/production/tokens/theme/theme.js.map +1 -1
  94. package/build/types/components/index.d.ts +63 -15
  95. package/build/types/components/index.native.d.ts +63 -15
  96. package/build/types/tokens/index.d.ts +6 -6
  97. package/build/types/tokens/index.native.d.ts +6 -6
  98. package/build/types/utils/index.d.ts +29 -6
  99. package/build/types/utils/index.native.d.ts +29 -6
  100. package/package.json +1 -1
@@ -1,32 +1,56 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import 'react';
3
3
  import { XAxis, YAxis, CartesianGrid, Tooltip, Legend, ReferenceLine } from 'recharts';
4
+ import '../utils/index.js';
4
5
  import { X_OFFSET, Y_OFFSET, X_AXIS_TEXT_BASELINE, componentId, TEXT_BASELINE, PADDING_HORIZONTAL, PADDING_VERTICAL, RECT_HEIGHT } from './tokens.js';
5
6
  import { calculateTextWidth } from './utils.js';
7
+ import { useCommonChartComponentsContext } from './CommonChartComponentsContext.js';
6
8
  import '../../Typography/index.js';
7
9
  import '../../Box/index.js';
8
10
  import '../../BladeProvider/index.js';
9
11
  import '../../../utils/assignWithoutSideEffects/index.js';
12
+ import getIn from '../../../utils/lodashButBetter/get.js';
10
13
  import { jsx, jsxs } from 'react/jsx-runtime';
14
+ import { sanitizeString } from '../utils/sanitizeString/sanitizeString.js';
15
+ import { isSequentialColor } from '../utils/isSequentialColor.js';
16
+ import { getHighestColorInRange } from '../utils/getHighestColorInRange.js';
17
+ import { totalChartColors } from '../utils/tokens.js';
11
18
  import useTheme from '../../BladeProvider/useTheme.js';
12
- import { Heading } from '../../Typography/Heading/Heading.js';
13
19
  import { Box } from '../../Box/Box.js';
14
20
  import { Text } from '../../Typography/Text/Text.js';
21
+ import { Heading } from '../../Typography/Heading/Heading.js';
15
22
  import { assignWithoutSideEffects } from '../../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
16
23
 
17
24
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
25
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
26
+ var getChartColor = function getChartColor(dataKey, name, dataColorMapping, chartName) {
27
+ var colorKey = chartName === 'donut' ? sanitizeString(name !== null && name !== void 0 ? name : '') : dataKey;
28
+ var mappedColorData = dataColorMapping === null || dataColorMapping === void 0 ? void 0 : dataColorMapping[colorKey !== null && colorKey !== void 0 ? colorKey : ''];
29
+ var mappedColor = mappedColorData.colorToken;
30
+ var isCustomColor = mappedColorData.isCustomColor;
31
+ if ((chartName === 'line' || chartName === 'area') && !isCustomColor) {
32
+ return mappedColor;
33
+ }
34
+ if (mappedColor && isSequentialColor(mappedColor)) {
35
+ return mappedColor !== null && mappedColor !== void 0 ? mappedColor : 'data.background.categorical.azure.faint';
36
+ }
37
+ return getHighestColorInRange({
38
+ colorToken: mappedColor !== null && mappedColor !== void 0 ? mappedColor : 'data.background.categorical.azure.faint',
39
+ followIntensityMapping: chartName === 'donut' && (isCustomColor || Object.keys(dataColorMapping).length > totalChartColors)
40
+ });
41
+ };
19
42
  var ChartXAxis = function ChartXAxis(props) {
20
43
  var _useTheme = useTheme(),
21
44
  theme = _useTheme.theme;
22
45
  return /*#__PURE__*/jsx(XAxis, _objectSpread(_objectSpread({}, props), {}, {
23
46
  tick: {
24
- fill: theme.colors.surface.text.gray.normal,
47
+ fill: theme.colors.surface.text.gray.muted,
25
48
  fontSize: theme.typography.fonts.size[75],
26
49
  fontFamily: theme.typography.fonts.family.text,
27
50
  fontWeight: theme.typography.fonts.weight.regular,
28
51
  letterSpacing: theme.typography.letterSpacings[100]
29
52
  },
53
+ tickLine: false,
30
54
  stroke: theme.colors.surface.border.gray.muted,
31
55
  label: function label(_ref) {
32
56
  var viewBox = _ref.viewBox;
@@ -34,10 +58,10 @@ var ChartXAxis = function ChartXAxis(props) {
34
58
  x: viewBox.x + viewBox.width / 2 - X_OFFSET,
35
59
  y: viewBox.y + Y_OFFSET + X_AXIS_TEXT_BASELINE,
36
60
  textAnchor: "middle",
37
- fill: theme.colors.surface.text.gray.subtle,
61
+ fill: theme.colors.surface.text.gray.muted,
38
62
  fontSize: theme.typography.fonts.size[75],
39
63
  fontFamily: theme.typography.fonts.family.text,
40
- fontWeight: theme.typography.fonts.weight.medium,
64
+ fontWeight: theme.typography.fonts.weight.regular,
41
65
  letterSpacing: theme.typography.letterSpacings[100],
42
66
  children: props === null || props === void 0 ? void 0 : props.label
43
67
  });
@@ -50,21 +74,22 @@ var ChartYAxis = function ChartYAxis(props) {
50
74
  theme = _useTheme2.theme;
51
75
  return /*#__PURE__*/jsx(YAxis, _objectSpread(_objectSpread({}, props), {}, {
52
76
  tick: {
53
- fill: theme.colors.surface.text.gray.normal,
77
+ fill: theme.colors.surface.text.gray.muted,
54
78
  fontSize: theme.typography.fonts.size[75],
55
79
  fontFamily: theme.typography.fonts.family.text,
56
80
  fontWeight: theme.typography.fonts.weight.regular,
57
81
  letterSpacing: theme.typography.letterSpacings[100]
58
82
  },
83
+ tickLine: false,
59
84
  stroke: theme.colors.surface.border.gray.muted,
60
85
  label: {
61
86
  value: props === null || props === void 0 ? void 0 : props.label,
62
87
  position: 'insideLeft',
63
88
  style: {
64
89
  textAnchor: 'middle',
65
- fill: theme.colors.surface.text.gray.subtle,
90
+ fill: theme.colors.surface.text.gray.muted,
66
91
  fontSize: theme.typography.fonts.size[75],
67
- fontWeight: theme.typography.fonts.weight.medium,
92
+ fontWeight: theme.typography.fonts.weight.regular,
68
93
  fontFamily: theme.typography.fonts.family.text,
69
94
  letterSpacing: theme.typography.letterSpacings[100],
70
95
  lineHeight: theme.typography.lineHeights[500]
@@ -83,13 +108,56 @@ var ChartCartesianGrid = function ChartCartesianGrid(props) {
83
108
  vertical: false
84
109
  }, props));
85
110
  };
86
- var ChartTooltip = function ChartTooltip(props) {
111
+ var CustomTooltip = function CustomTooltip(_ref2) {
112
+ var item = _ref2.item,
113
+ key = _ref2.key;
87
114
  var _useTheme4 = useTheme(),
88
115
  theme = _useTheme4.theme;
116
+ var _useCommonChartCompon = useCommonChartComponentsContext(),
117
+ dataColorMapping = _useCommonChartCompon.dataColorMapping,
118
+ chartName = _useCommonChartCompon.chartName;
119
+ var toolTipColor = getChartColor(item.dataKey, item.name, dataColorMapping !== null && dataColorMapping !== void 0 ? dataColorMapping : {}, chartName);
120
+ return /*#__PURE__*/jsxs(Box, {
121
+ display: "flex",
122
+ alignItems: "center",
123
+ justifyContent: "space-between",
124
+ gap: "spacing.4",
125
+ children: [/*#__PURE__*/jsxs(Box, {
126
+ display: "flex",
127
+ gap: "spacing.3",
128
+ alignItems: "center",
129
+ justifyContent: "center",
130
+ children: [/*#__PURE__*/jsx("div", {
131
+ style: {
132
+ width: theme.spacing[4],
133
+ height: theme.spacing[4],
134
+ backgroundColor: getIn(theme.colors, toolTipColor),
135
+ borderRadius: theme.border.radius.small
136
+ }
137
+ }), /*#__PURE__*/jsx(Text, {
138
+ size: "small",
139
+ weight: "regular",
140
+ color: "surface.text.staticWhite.normal",
141
+ children: item.name
142
+ })]
143
+ }), /*#__PURE__*/jsx(Text, {
144
+ size: "small",
145
+ weight: "regular",
146
+ color: "surface.text.staticWhite.normal",
147
+ children: item.value
148
+ })]
149
+ }, key);
150
+ };
151
+ var ChartTooltip = function ChartTooltip(props) {
152
+ var _useTheme5 = useTheme(),
153
+ theme = _useTheme5.theme;
89
154
  return /*#__PURE__*/jsx(Tooltip, _objectSpread({
90
- content: function content(_ref2) {
91
- var payload = _ref2.payload,
92
- label = _ref2.label;
155
+ content: function content(_ref3) {
156
+ var payload = _ref3.payload,
157
+ label = _ref3.label;
158
+ var filteredPayLoad = payload.filter(function (item) {
159
+ return item.type !== 'none';
160
+ });
93
161
  return /*#__PURE__*/jsxs("div", {
94
162
  style: {
95
163
  backgroundColor: theme.colors.surface.icon.staticBlack.normal,
@@ -104,36 +172,9 @@ var ChartTooltip = function ChartTooltip(props) {
104
172
  children: label
105
173
  }), /*#__PURE__*/jsx(Box, {
106
174
  paddingTop: label ? 'spacing.4' : undefined,
107
- children: payload.map(function (item) {
108
- return /*#__PURE__*/jsxs(Box, {
109
- display: "flex",
110
- alignItems: "center",
111
- justifyContent: "space-between",
112
- gap: "spacing.4",
113
- children: [/*#__PURE__*/jsxs(Box, {
114
- display: "flex",
115
- gap: "spacing.3",
116
- alignItems: "center",
117
- justifyContent: "center",
118
- children: [/*#__PURE__*/jsx("div", {
119
- style: {
120
- width: theme.spacing[4],
121
- height: theme.spacing[4],
122
- backgroundColor: item.color || item.payload.fill,
123
- borderRadius: theme.border.radius.small
124
- }
125
- }), /*#__PURE__*/jsx(Text, {
126
- size: "small",
127
- weight: "regular",
128
- color: "surface.text.staticWhite.normal",
129
- children: item.name
130
- })]
131
- }), /*#__PURE__*/jsx(Text, {
132
- size: "small",
133
- weight: "regular",
134
- color: "surface.text.staticWhite.normal",
135
- children: item.value
136
- })]
175
+ children: filteredPayLoad.map(function (item) {
176
+ return /*#__PURE__*/jsx(CustomTooltip, {
177
+ item: item
137
178
  }, item.name);
138
179
  })
139
180
  })]
@@ -145,11 +186,45 @@ var ChartTooltip = function ChartTooltip(props) {
145
186
  }
146
187
  }, props));
147
188
  };
189
+ var LegendItem = function LegendItem(_ref4) {
190
+ var entry = _ref4.entry,
191
+ index = _ref4.index;
192
+ var _useTheme6 = useTheme(),
193
+ theme = _useTheme6.theme;
194
+ var _useCommonChartCompon2 = useCommonChartComponentsContext(),
195
+ dataColorMapping = _useCommonChartCompon2.dataColorMapping,
196
+ chartName = _useCommonChartCompon2.chartName;
197
+ var legendColor = getChartColor(entry.dataKey, entry.value, dataColorMapping !== null && dataColorMapping !== void 0 ? dataColorMapping : {}, chartName);
198
+ return /*#__PURE__*/jsx(Box, {
199
+ display: "flex",
200
+ alignItems: "center",
201
+ children: /*#__PURE__*/jsxs(Box, {
202
+ display: "flex",
203
+ gap: "spacing.3",
204
+ justifyContent: "center",
205
+ alignItems: "center",
206
+ children: [/*#__PURE__*/jsx("span", {
207
+ style: {
208
+ backgroundColor: getIn(theme.colors, legendColor),
209
+ // Uses the color of the line/bar
210
+ width: theme.spacing[4],
211
+ // Size of the square
212
+ height: theme.spacing[4],
213
+ // Size of the square
214
+ display: 'inline-block',
215
+ borderRadius: theme.border.radius.small
216
+ }
217
+ }), /*#__PURE__*/jsx(Text, {
218
+ size: "medium",
219
+ color: "surface.text.gray.muted",
220
+ children: entry.value
221
+ })]
222
+ })
223
+ }, "item-".concat(index));
224
+ };
148
225
  var CustomSquareLegend = function CustomSquareLegend(props) {
149
226
  var payload = props.payload,
150
227
  layout = props.layout;
151
- var _useTheme5 = useTheme(),
152
- theme = _useTheme5.theme;
153
228
  if (!payload || payload.length === 0) {
154
229
  return null;
155
230
  }
@@ -161,7 +236,7 @@ var CustomSquareLegend = function CustomSquareLegend(props) {
161
236
  */
162
237
  var filteredPayload = payload.filter(function (entry) {
163
238
  var _entry$payload;
164
- return (entry === null || entry === void 0 || (_entry$payload = entry.payload) === null || _entry$payload === void 0 ? void 0 : _entry$payload.legendType) !== 'none';
239
+ return (entry === null || entry === void 0 || (_entry$payload = entry.payload) === null || _entry$payload === void 0 ? void 0 : _entry$payload.legendType) !== 'none' && (entry === null || entry === void 0 ? void 0 : entry.type) !== 'none';
165
240
  });
166
241
  var isVerticalLayout = layout === 'vertical';
167
242
  return /*#__PURE__*/jsx(Box, {
@@ -172,45 +247,23 @@ var CustomSquareLegend = function CustomSquareLegend(props) {
172
247
  width: isVerticalLayout ? '100%' : 'auto',
173
248
  flexWrap: "wrap",
174
249
  children: filteredPayload.map(function (entry, index) {
175
- return /*#__PURE__*/jsx(Box, {
176
- display: "flex",
177
- alignItems: "center",
178
- children: /*#__PURE__*/jsxs(Box, {
179
- display: "flex",
180
- gap: "spacing.3",
181
- justifyContent: "center",
182
- alignItems: "center",
183
- children: [/*#__PURE__*/jsx("span", {
184
- style: {
185
- backgroundColor: entry.color,
186
- // Uses the color of the line/bar
187
- width: theme.spacing[4],
188
- // Size of the square
189
- height: theme.spacing[4],
190
- // Size of the square
191
- display: 'inline-block',
192
- borderRadius: theme.border.radius.small
193
- }
194
- }), /*#__PURE__*/jsx(Text, {
195
- size: "medium",
196
- color: "surface.text.gray.muted",
197
- children: entry.value
198
- })]
199
- })
250
+ return /*#__PURE__*/jsx(LegendItem, {
251
+ entry: entry,
252
+ index: index
200
253
  }, "item-".concat(index));
201
254
  })
202
255
  });
203
256
  };
204
257
  var _ChartLegend = function _ChartLegend(props) {
205
258
  var _props$layout;
206
- var _useTheme6 = useTheme(),
207
- theme = _useTheme6.theme;
259
+ var _useTheme7 = useTheme(),
260
+ theme = _useTheme7.theme;
208
261
  return /*#__PURE__*/jsx(Legend, _objectSpread({
209
262
  wrapperStyle: {
210
263
  fontFamily: theme.typography.fonts.family.text,
211
264
  fontSize: theme.typography.fonts.size[100],
212
265
  color: theme.colors.surface.text.gray.normal,
213
- paddingTop: theme.spacing[5]
266
+ paddingTop: theme.spacing[7]
214
267
  },
215
268
  align: "center",
216
269
  verticalAlign: props.layout === 'vertical' ? 'middle' : 'bottom',
@@ -222,32 +275,32 @@ var _ChartLegend = function _ChartLegend(props) {
222
275
  var ChartLegend = /*#__PURE__*/assignWithoutSideEffects(_ChartLegend, {
223
276
  componentId: componentId.chartLegend
224
277
  });
225
- var CustomReferenceLabel = function CustomReferenceLabel(_ref3) {
226
- var viewBox = _ref3.viewBox,
227
- value = _ref3.value,
228
- isVertical = _ref3.isVertical;
278
+ var CustomReferenceLabel = function CustomReferenceLabel(_ref5) {
279
+ var viewBox = _ref5.viewBox,
280
+ value = _ref5.value,
281
+ isVertical = _ref5.isVertical;
229
282
  // Extract viewBox coordinates with fallback values to prevent undefined errors.
230
283
  // viewBox contains the positioning information for the reference line label from Recharts.
231
- var _ref4 = viewBox !== null && viewBox !== void 0 ? viewBox : {
284
+ var _ref6 = viewBox !== null && viewBox !== void 0 ? viewBox : {
232
285
  x: 0,
233
286
  y: 0,
234
287
  width: 0
235
288
  },
236
- x = _ref4.x,
237
- y = _ref4.y,
238
- width = _ref4.width;
239
- var _useTheme7 = useTheme(),
240
- theme = _useTheme7.theme;
289
+ x = _ref6.x,
290
+ y = _ref6.y,
291
+ width = _ref6.width;
292
+ var _useTheme8 = useTheme(),
293
+ theme = _useTheme8.theme;
241
294
 
242
295
  // Calculate dynamic text width to ensure the background rectangle fits the text perfectly.
243
296
  // This prevents text overflow for long labels and avoids unnecessarily large rectangles for short text.
244
297
  // The function also handles text truncation with ellipsis if the text exceeds the maximum width.
245
- var _ref5 = value ? calculateTextWidth(value, theme) : {
298
+ var _ref7 = value ? calculateTextWidth(value, theme) : {
246
299
  width: 80,
247
300
  displayText: value !== null && value !== void 0 ? value : ''
248
301
  },
249
- RECT_WIDTH = _ref5.width,
250
- displayText = _ref5.displayText;
302
+ RECT_WIDTH = _ref7.width,
303
+ displayText = _ref7.displayText;
251
304
  var rect_x = isVertical ? x + width - RECT_WIDTH / 2 : x + width - RECT_WIDTH;
252
305
  var rect_y = isVertical ? y : y - TEXT_BASELINE;
253
306
  // Text position with padding inside the rectangle
@@ -277,14 +330,14 @@ var CustomReferenceLabel = function CustomReferenceLabel(_ref3) {
277
330
  })]
278
331
  });
279
332
  };
280
- var ChartReferenceLine = function ChartReferenceLine(_ref6) {
281
- var label = _ref6.label,
282
- x = _ref6.x,
283
- y = _ref6.y;
284
- var _useTheme8 = useTheme(),
285
- theme = _useTheme8.theme;
333
+ var ChartReferenceLine = function ChartReferenceLine(_ref8) {
334
+ var label = _ref8.label,
335
+ x = _ref8.x,
336
+ y = _ref8.y;
337
+ var _useTheme9 = useTheme(),
338
+ theme = _useTheme9.theme;
286
339
  return /*#__PURE__*/jsx(ReferenceLine, {
287
- stroke: theme.colors.chart.background.categorical.gray.intense,
340
+ stroke: theme.colors.data.background.categorical.gray.intense,
288
341
  strokeWidth: 2,
289
342
  strokeDasharray: "4 4",
290
343
  label: /*#__PURE__*/jsx(CustomReferenceLabel, {
@@ -1 +1 @@
1
- {"version":3,"file":"CommonChartComponents.web.js","sources":["../../../../../../../src/components/Charts/CommonChartComponents/CommonChartComponents.web.tsx"],"sourcesContent":["import React from 'react';\nimport {\n XAxis as RechartsXAxis,\n YAxis as RechartsYAxis,\n CartesianGrid as RechartsCartesianGrid,\n Tooltip as RechartsTooltip,\n Legend as RechartsLegend,\n ReferenceLine as RechartsReferenceLine,\n} from 'recharts';\nimport type {\n ChartReferenceLineProps,\n ChartXAxisProps,\n ChartYAxisProps,\n ChartTooltipProps,\n ChartLegendProps,\n ChartCartesianGridProps,\n Layout,\n} from './types';\nimport {\n RECT_HEIGHT,\n TEXT_BASELINE,\n PADDING_VERTICAL,\n PADDING_HORIZONTAL,\n X_AXIS_TEXT_BASELINE,\n Y_OFFSET,\n X_OFFSET,\n componentId,\n} from './tokens';\nimport { calculateTextWidth } from './utils';\nimport { Heading, Text } from '~components/Typography';\nimport { Box } from '~components/Box';\nimport { useTheme } from '~components/BladeProvider';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\n\nconst ChartXAxis: React.FC<ChartXAxisProps> = (props) => {\n const { theme } = useTheme();\n\n return (\n <RechartsXAxis\n {...props}\n tick={{\n fill: theme.colors.surface.text.gray.normal,\n fontSize: theme.typography.fonts.size[75],\n fontFamily: theme.typography.fonts.family.text,\n fontWeight: theme.typography.fonts.weight.regular,\n letterSpacing: theme.typography.letterSpacings[100],\n }}\n stroke={theme.colors.surface.border.gray.muted}\n label={({ viewBox }: { viewBox: { x: number; y: number; width: number } }) => (\n <text\n x={viewBox.x + viewBox.width / 2 - X_OFFSET}\n y={viewBox.y + Y_OFFSET + X_AXIS_TEXT_BASELINE}\n textAnchor=\"middle\"\n fill={theme.colors.surface.text.gray.subtle}\n fontSize={theme.typography.fonts.size[75]}\n fontFamily={theme.typography.fonts.family.text}\n fontWeight={theme.typography.fonts.weight.medium}\n letterSpacing={theme.typography.letterSpacings[100]}\n >\n {props?.label}\n </text>\n )}\n dataKey={props?.dataKey}\n />\n );\n};\n\nconst ChartYAxis: React.FC<ChartYAxisProps> = (props) => {\n const { theme } = useTheme();\n\n return (\n <RechartsYAxis\n {...props}\n tick={{\n fill: theme.colors.surface.text.gray.normal,\n fontSize: theme.typography.fonts.size[75],\n fontFamily: theme.typography.fonts.family.text,\n fontWeight: theme.typography.fonts.weight.regular,\n letterSpacing: theme.typography.letterSpacings[100],\n }}\n stroke={theme.colors.surface.border.gray.muted}\n label={{\n value: props?.label,\n position: 'insideLeft',\n style: {\n textAnchor: 'middle',\n fill: theme.colors.surface.text.gray.subtle,\n fontSize: theme.typography.fonts.size[75],\n fontWeight: theme.typography.fonts.weight.medium,\n fontFamily: theme.typography.fonts.family.text,\n letterSpacing: theme.typography.letterSpacings[100],\n lineHeight: theme.typography.lineHeights[500],\n },\n angle: -90,\n fill: theme.colors.surface.text.gray.subtle,\n }}\n dataKey={props?.dataKey}\n />\n );\n};\n\nconst ChartCartesianGrid: React.FC<ChartCartesianGridProps> = (props) => {\n const { theme } = useTheme();\n\n return (\n <RechartsCartesianGrid\n stroke={theme.colors.surface.border.gray.muted}\n vertical={false}\n {...props}\n />\n );\n};\n\nconst ChartTooltip: React.FC<ChartTooltipProps> = (props) => {\n const { theme } = useTheme();\n\n return (\n <RechartsTooltip\n content={({ payload, label }) => {\n return (\n <div\n style={{\n backgroundColor: theme.colors.surface.icon.staticBlack.normal,\n borderRadius: theme.border.radius.large,\n border: `1px solid ${theme.colors.surface.border.gray.muted}`,\n padding: theme.spacing[4],\n }}\n >\n <Heading size=\"small\" weight=\"semibold\" color=\"surface.text.staticWhite.normal\">\n {label}\n </Heading>\n <Box paddingTop={label ? 'spacing.4' : undefined}>\n {payload.map((item) => (\n <Box\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"space-between\"\n gap=\"spacing.4\"\n key={item.name}\n >\n <Box display=\"flex\" gap=\"spacing.3\" alignItems=\"center\" justifyContent=\"center\">\n <div\n style={{\n width: theme.spacing[4],\n height: theme.spacing[4],\n backgroundColor: item.color || item.payload.fill,\n borderRadius: theme.border.radius.small,\n }}\n />\n <Text size=\"small\" weight=\"regular\" color=\"surface.text.staticWhite.normal\">\n {item.name}\n </Text>\n </Box>\n <Text size=\"small\" weight=\"regular\" color=\"surface.text.staticWhite.normal\">\n {item.value}\n </Text>\n </Box>\n ))}\n </Box>\n </div>\n );\n }}\n cursor={{ fill: 'transparent', stroke: 'transparent' }}\n {...props}\n />\n );\n};\n\nconst CustomSquareLegend = (props: {\n payload?: Array<{\n payload: {\n legendType: 'none' | 'line';\n };\n value: string;\n color: string;\n }>;\n layout: Layout;\n}): JSX.Element | null => {\n const { payload, layout } = props;\n const { theme } = useTheme();\n\n if (!payload || payload.length === 0) {\n return null;\n }\n\n /*\n This is a custom legend component that is used to display the legend for the chart.\n we need to show the legend only if the legendType is not none. (for example in line chart we don't want to show the legend for the reference line)\n so we are filtering the payload and then mapping over it to display the legend.\n */\n const filteredPayload = payload.filter((entry) => entry?.payload?.legendType !== 'none');\n const isVerticalLayout = layout === 'vertical';\n\n return (\n <Box\n display=\"flex\"\n justifyContent=\"center\"\n gap=\"spacing.5\"\n flexDirection={isVerticalLayout ? 'column' : 'row'}\n width={isVerticalLayout ? '100%' : 'auto'}\n flexWrap=\"wrap\"\n >\n {filteredPayload.map((entry, index) => (\n <Box key={`item-${index}`} display=\"flex\" alignItems=\"center\">\n <Box display=\"flex\" gap=\"spacing.3\" justifyContent=\"center\" alignItems=\"center\">\n <span\n style={{\n backgroundColor: entry.color, // Uses the color of the line/bar\n width: theme.spacing[4], // Size of the square\n height: theme.spacing[4], // Size of the square\n display: 'inline-block',\n borderRadius: theme.border.radius.small,\n }}\n />\n {/* Legend text with custom color and size */}\n <Text size=\"medium\" color=\"surface.text.gray.muted\">\n {entry.value}\n </Text>\n </Box>\n </Box>\n ))}\n </Box>\n );\n};\n\nconst _ChartLegend: React.FC<ChartLegendProps> = (props) => {\n const { theme } = useTheme();\n\n return (\n <RechartsLegend\n wrapperStyle={{\n fontFamily: theme.typography.fonts.family.text,\n fontSize: theme.typography.fonts.size[100],\n color: theme.colors.surface.text.gray.normal,\n paddingTop: theme.spacing[5],\n }}\n align=\"center\"\n verticalAlign={props.layout === 'vertical' ? 'middle' : 'bottom'}\n content={<CustomSquareLegend layout={props.layout ?? 'horizontal'} />}\n {...props}\n />\n );\n};\n\nconst ChartLegend = assignWithoutSideEffects(_ChartLegend, {\n componentId: componentId.chartLegend,\n});\n\nconst CustomReferenceLabel = ({\n viewBox,\n value,\n isVertical,\n}: {\n viewBox?: { x: number; y: number; width: number };\n value: string | undefined;\n isVertical: boolean;\n}): JSX.Element => {\n // Extract viewBox coordinates with fallback values to prevent undefined errors.\n // viewBox contains the positioning information for the reference line label from Recharts.\n const { x, y, width } = viewBox ?? { x: 0, y: 0, width: 0 };\n const { theme } = useTheme();\n\n // Calculate dynamic text width to ensure the background rectangle fits the text perfectly.\n // This prevents text overflow for long labels and avoids unnecessarily large rectangles for short text.\n // The function also handles text truncation with ellipsis if the text exceeds the maximum width.\n const { width: RECT_WIDTH, displayText } = value\n ? calculateTextWidth(value, theme)\n : { width: 80, displayText: value ?? '' };\n\n const rect_x = isVertical ? x + width - RECT_WIDTH / 2 : x + width - RECT_WIDTH;\n const rect_y = isVertical ? y : y - TEXT_BASELINE;\n // Text position with padding inside the rectangle\n const text_x = rect_x + PADDING_HORIZONTAL + (RECT_WIDTH - PADDING_HORIZONTAL * 2) / 2;\n const text_y = rect_y + PADDING_VERTICAL + TEXT_BASELINE; // +15 for text baseline\n\n return (\n <g>\n <rect\n x={rect_x}\n y={rect_y}\n width={RECT_WIDTH}\n height={RECT_HEIGHT}\n rx={theme.border.radius.medium}\n fill={theme.colors.surface.background.gray.subtle}\n stroke={theme.colors.surface.border.gray.muted}\n strokeWidth=\"1\"\n />\n <text\n x={text_x}\n y={text_y}\n textAnchor=\"middle\"\n fill={theme.colors.surface.text.gray.normal}\n fontSize={theme.typography.fonts.size[50]}\n fontFamily={theme.typography.fonts.family.text}\n fontWeight={theme.typography.fonts.weight.medium}\n letterSpacing={theme.typography.letterSpacings[100]}\n >\n {displayText}\n </text>\n </g>\n );\n};\n\nconst ChartReferenceLine: React.FC<ChartReferenceLineProps> = ({ label, x, y }) => {\n const { theme } = useTheme();\n return (\n <RechartsReferenceLine\n stroke={theme.colors.chart.background.categorical.gray.intense}\n strokeWidth={2}\n strokeDasharray=\"4 4\"\n label={<CustomReferenceLabel value={label} isVertical={Boolean(x)} />}\n x={x}\n y={y}\n />\n );\n};\n\nexport {\n ChartXAxis,\n ChartYAxis,\n ChartCartesianGrid,\n ChartLegend,\n ChartTooltip,\n ChartReferenceLine,\n};\n"],"names":["ChartXAxis","props","_useTheme","useTheme","theme","_jsx","RechartsXAxis","_objectSpread","tick","fill","colors","surface","text","gray","normal","fontSize","typography","fonts","size","fontFamily","family","fontWeight","weight","regular","letterSpacing","letterSpacings","stroke","border","muted","label","_ref","viewBox","x","width","X_OFFSET","y","Y_OFFSET","X_AXIS_TEXT_BASELINE","textAnchor","subtle","medium","children","dataKey","ChartYAxis","_useTheme2","RechartsYAxis","value","position","style","lineHeight","lineHeights","angle","ChartCartesianGrid","_useTheme3","RechartsCartesianGrid","vertical","ChartTooltip","_useTheme4","RechartsTooltip","content","_ref2","payload","_jsxs","backgroundColor","icon","staticBlack","borderRadius","radius","large","concat","padding","spacing","Heading","color","Box","paddingTop","undefined","map","item","display","alignItems","justifyContent","gap","height","small","Text","name","cursor","CustomSquareLegend","layout","_useTheme5","length","filteredPayload","filter","entry","_entry$payload","legendType","isVerticalLayout","flexDirection","flexWrap","index","_ChartLegend","_props$layout","_useTheme6","RechartsLegend","wrapperStyle","align","verticalAlign","ChartLegend","assignWithoutSideEffects","componentId","chartLegend","CustomReferenceLabel","_ref3","isVertical","_ref4","_useTheme7","_ref5","calculateTextWidth","displayText","RECT_WIDTH","rect_x","rect_y","TEXT_BASELINE","text_x","PADDING_HORIZONTAL","text_y","PADDING_VERTICAL","RECT_HEIGHT","rx","background","strokeWidth","ChartReferenceLine","_ref6","_useTheme8","RechartsReferenceLine","chart","categorical","intense","strokeDasharray","Boolean"],"mappings":";;;;;;;;;;;;;;;;;;AAkCA,IAAMA,UAAqC,GAAG,SAAxCA,UAAqCA,CAAIC,KAAK,EAAK;AACvD,EAAA,IAAAC,SAAA,GAAkBC,QAAQ,EAAE;IAApBC,KAAK,GAAAF,SAAA,CAALE,KAAK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AC,CAAA;AAAA,GACN,CAAC,CAAA;AAER,CAAC,CAAA;AAED,IAAMa,kBAAqD,GAAG,SAAxDA,kBAAqDA,CAAAC,KAAA,EAAwB;AAAA,EAAA,IAAlBxG,KAAK,GAAAwG,KAAA,CAALxG,KAAK;IAAEG,CAAC,GAAAqG,KAAA,CAADrG,CAAC;IAAEG,CAAC,GAAAkG,KAAA,CAADlG,CAAC,CAAA;AAC1E,EAAA,IAAAmG,UAAA,GAAkBnI,QAAQ,EAAE;IAApBC,KAAK,GAAAkI,UAAA,CAALlI,KAAK,CAAA;EACb,oBACEC,GAAA,CAACkI,aAAqB,EAAA;AACpB7G,IAAAA,MAAM,EAAEtB,KAAK,CAACM,MAAM,CAAC8H,KAAK,CAACN,UAAU,CAACO,WAAW,CAAC5H,IAAI,CAAC6H,OAAQ;AAC/DP,IAAAA,WAAW,EAAE,CAAE;AACfQ,IAAAA,eAAe,EAAC,KAAK;IACrB9G,KAAK,eAAExB,GAAA,CAAC2G,oBAAoB,EAAA;AAAClE,MAAAA,KAAK,EAAEjB,KAAM;MAACqF,UAAU,EAAE0B,OAAO,CAAC5G,CAAC,CAAA;AAAE,KAAE,CAAE;AACtEA,IAAAA,CAAC,EAAEA,CAAE;AACLG,IAAAA,CAAC,EAAEA,CAAAA;AAAE,GACN,CAAC,CAAA;AAEN;;;;"}
1
+ {"version":3,"file":"CommonChartComponents.web.js","sources":["../../../../../../../src/components/Charts/CommonChartComponents/CommonChartComponents.web.tsx"],"sourcesContent":["import React from 'react';\nimport {\n XAxis as RechartsXAxis,\n YAxis as RechartsYAxis,\n CartesianGrid as RechartsCartesianGrid,\n Tooltip as RechartsTooltip,\n Legend as RechartsLegend,\n ReferenceLine as RechartsReferenceLine,\n} from 'recharts';\nimport {\n getHighestColorInRange,\n isSequentialColor,\n sanitizeString,\n totalChartColors,\n} from '../utils';\nimport type {\n ChartReferenceLineProps,\n ChartXAxisProps,\n ChartYAxisProps,\n ChartTooltipProps,\n ChartLegendProps,\n ChartCartesianGridProps,\n Layout,\n ChartColorToken,\n DataColorMapping,\n} from './types';\nimport {\n RECT_HEIGHT,\n TEXT_BASELINE,\n PADDING_VERTICAL,\n PADDING_HORIZONTAL,\n X_AXIS_TEXT_BASELINE,\n Y_OFFSET,\n X_OFFSET,\n componentId,\n} from './tokens';\nimport { calculateTextWidth } from './utils';\nimport { useCommonChartComponentsContext } from './CommonChartComponentsContext';\nimport { Heading, Text } from '~components/Typography';\nimport { Box } from '~components/Box';\nimport { useTheme } from '~components/BladeProvider';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport getIn from '~utils/lodashButBetter/get';\n\n/**\n * Helper function to get the appropriate color for chart elements (tooltip, legend)\n *\n * This function resolves the color token for chart elements based on the chart type and color mapping.\n * The logic varies by chart type:\n * - For line/area charts: Returns the mapped color directly if it's not a custom color.\n * If it is a custom color, it maps to the highest color in the range (unless it's sequential).\n * - For sequential colors: Returns the mapped color as-is\n * - For other cases: Uses getHighestColorInRange to get the highest intensity color from the range,\n * with special handling for donut charts when custom colors are used or when there are more\n * data points than the default color palette\n *\n * @param dataKey - The data key for the chart element\n * @param name - The name/value of the chart element\n * @param dataColorMapping - Color mapping object\n * @param chartName - Type of chart (line, area, donut, etc.)\n * @returns The resolved color token\n */\nconst getChartColor = (\n dataKey: string,\n name: string,\n dataColorMapping: DataColorMapping,\n chartName: string | undefined,\n): ChartColorToken => {\n const colorKey = chartName === 'donut' ? sanitizeString(name ?? '') : dataKey;\n const mappedColorData = dataColorMapping?.[colorKey ?? ''];\n const mappedColor = mappedColorData.colorToken;\n const isCustomColor = mappedColorData.isCustomColor;\n\n if ((chartName === 'line' || chartName === 'area') && !isCustomColor) {\n return mappedColor;\n }\n\n if (mappedColor && isSequentialColor(mappedColor)) {\n return mappedColor ?? 'data.background.categorical.azure.faint';\n }\n return getHighestColorInRange({\n colorToken: mappedColor ?? ('data.background.categorical.azure.faint' as ChartColorToken),\n followIntensityMapping:\n chartName === 'donut' &&\n (isCustomColor || Object.keys(dataColorMapping).length > totalChartColors),\n });\n};\n\nconst ChartXAxis: React.FC<ChartXAxisProps> = (props) => {\n const { theme } = useTheme();\n\n return (\n <RechartsXAxis\n {...props}\n tick={{\n fill: theme.colors.surface.text.gray.muted,\n fontSize: theme.typography.fonts.size[75],\n fontFamily: theme.typography.fonts.family.text,\n fontWeight: theme.typography.fonts.weight.regular,\n letterSpacing: theme.typography.letterSpacings[100],\n }}\n tickLine={false}\n stroke={theme.colors.surface.border.gray.muted}\n label={({ viewBox }: { viewBox: { x: number; y: number; width: number } }) => (\n <text\n x={viewBox.x + viewBox.width / 2 - X_OFFSET}\n y={viewBox.y + Y_OFFSET + X_AXIS_TEXT_BASELINE}\n textAnchor=\"middle\"\n fill={theme.colors.surface.text.gray.muted}\n fontSize={theme.typography.fonts.size[75]}\n fontFamily={theme.typography.fonts.family.text}\n fontWeight={theme.typography.fonts.weight.regular}\n letterSpacing={theme.typography.letterSpacings[100]}\n >\n {props?.label}\n </text>\n )}\n dataKey={props?.dataKey}\n />\n );\n};\n\nconst ChartYAxis: React.FC<ChartYAxisProps> = (props) => {\n const { theme } = useTheme();\n\n return (\n <RechartsYAxis\n {...props}\n tick={{\n fill: theme.colors.surface.text.gray.muted,\n fontSize: theme.typography.fonts.size[75],\n fontFamily: theme.typography.fonts.family.text,\n fontWeight: theme.typography.fonts.weight.regular,\n letterSpacing: theme.typography.letterSpacings[100],\n }}\n tickLine={false}\n stroke={theme.colors.surface.border.gray.muted}\n label={{\n value: props?.label,\n position: 'insideLeft',\n style: {\n textAnchor: 'middle',\n fill: theme.colors.surface.text.gray.muted,\n fontSize: theme.typography.fonts.size[75],\n fontWeight: theme.typography.fonts.weight.regular,\n fontFamily: theme.typography.fonts.family.text,\n letterSpacing: theme.typography.letterSpacings[100],\n lineHeight: theme.typography.lineHeights[500],\n },\n angle: -90,\n fill: theme.colors.surface.text.gray.subtle,\n }}\n dataKey={props?.dataKey}\n />\n );\n};\n\nconst ChartCartesianGrid: React.FC<ChartCartesianGridProps> = (props) => {\n const { theme } = useTheme();\n\n return (\n <RechartsCartesianGrid\n stroke={theme.colors.surface.border.gray.muted}\n vertical={false}\n {...props}\n />\n );\n};\n\nconst CustomTooltip = ({\n item,\n key,\n}: {\n item: {\n name: string;\n value: string;\n color: string;\n dataKey: string;\n payload: { fill: string };\n };\n key: string;\n}): JSX.Element => {\n const { theme } = useTheme();\n const { dataColorMapping, chartName } = useCommonChartComponentsContext();\n\n const toolTipColor = getChartColor(item.dataKey, item.name, dataColorMapping ?? {}, chartName);\n return (\n <Box\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"space-between\"\n gap=\"spacing.4\"\n key={key}\n >\n <Box display=\"flex\" gap=\"spacing.3\" alignItems=\"center\" justifyContent=\"center\">\n <div\n style={{\n width: theme.spacing[4],\n height: theme.spacing[4],\n backgroundColor: getIn(theme.colors, toolTipColor),\n borderRadius: theme.border.radius.small,\n }}\n />\n <Text size=\"small\" weight=\"regular\" color=\"surface.text.staticWhite.normal\">\n {item.name}\n </Text>\n </Box>\n <Text size=\"small\" weight=\"regular\" color=\"surface.text.staticWhite.normal\">\n {item.value}\n </Text>\n </Box>\n );\n};\n\nconst ChartTooltip: React.FC<ChartTooltipProps> = (props) => {\n const { theme } = useTheme();\n return (\n <RechartsTooltip\n content={({ payload, label }) => {\n const filteredPayLoad = payload.filter((item) => item.type !== 'none');\n return (\n <div\n style={{\n backgroundColor: theme.colors.surface.icon.staticBlack.normal,\n borderRadius: theme.border.radius.large,\n border: `1px solid ${theme.colors.surface.border.gray.muted}`,\n padding: theme.spacing[4],\n }}\n >\n <Heading size=\"small\" weight=\"semibold\" color=\"surface.text.staticWhite.normal\">\n {label}\n </Heading>\n <Box paddingTop={label ? 'spacing.4' : undefined}>\n {filteredPayLoad.map((item) => (\n <CustomTooltip item={item} key={item.name} />\n ))}\n </Box>\n </div>\n );\n }}\n cursor={{ fill: 'transparent', stroke: 'transparent' }}\n {...props}\n />\n );\n};\n\nconst LegendItem = ({\n entry,\n index,\n}: {\n entry: { color: string; value: string; dataKey: string };\n index: number;\n}): JSX.Element => {\n const { theme } = useTheme();\n const { dataColorMapping, chartName } = useCommonChartComponentsContext();\n\n const legendColor = getChartColor(entry.dataKey, entry.value, dataColorMapping ?? {}, chartName);\n return (\n <Box key={`item-${index}`} display=\"flex\" alignItems=\"center\">\n <Box display=\"flex\" gap=\"spacing.3\" justifyContent=\"center\" alignItems=\"center\">\n <span\n style={{\n backgroundColor: getIn(theme.colors, legendColor), // Uses the color of the line/bar\n width: theme.spacing[4], // Size of the square\n height: theme.spacing[4], // Size of the square\n display: 'inline-block',\n borderRadius: theme.border.radius.small,\n }}\n />\n {/* Legend text with custom color and size */}\n <Text size=\"medium\" color=\"surface.text.gray.muted\">\n {entry.value}\n </Text>\n </Box>\n </Box>\n );\n};\n\nconst CustomSquareLegend = (props: {\n payload?: Array<{\n payload: {\n legendType: 'none' | 'line';\n type: 'none' | 'line';\n };\n value: string;\n color: string;\n type: 'none' | 'line';\n dataKey: string;\n }>;\n layout: Layout;\n}): JSX.Element | null => {\n const { payload, layout } = props;\n\n if (!payload || payload.length === 0) {\n return null;\n }\n\n /*\n This is a custom legend component that is used to display the legend for the chart.\n we need to show the legend only if the legendType is not none. (for example in line chart we don't want to show the legend for the reference line)\n so we are filtering the payload and then mapping over it to display the legend.\n */\n const filteredPayload = payload.filter(\n (entry) => entry?.payload?.legendType !== 'none' && entry?.type !== 'none',\n );\n const isVerticalLayout = layout === 'vertical';\n\n return (\n <Box\n display=\"flex\"\n justifyContent=\"center\"\n gap=\"spacing.5\"\n flexDirection={isVerticalLayout ? 'column' : 'row'}\n width={isVerticalLayout ? '100%' : 'auto'}\n flexWrap=\"wrap\"\n >\n {filteredPayload.map((entry, index) => (\n <LegendItem entry={entry} index={index} key={`item-${index}`} />\n ))}\n </Box>\n );\n};\n\nconst _ChartLegend: React.FC<ChartLegendProps> = (props) => {\n const { theme } = useTheme();\n\n return (\n <RechartsLegend\n wrapperStyle={{\n fontFamily: theme.typography.fonts.family.text,\n fontSize: theme.typography.fonts.size[100],\n color: theme.colors.surface.text.gray.normal,\n paddingTop: theme.spacing[7],\n }}\n align=\"center\"\n verticalAlign={props.layout === 'vertical' ? 'middle' : 'bottom'}\n content={<CustomSquareLegend layout={props.layout ?? 'horizontal'} />}\n {...props}\n />\n );\n};\n\nconst ChartLegend = assignWithoutSideEffects(_ChartLegend, {\n componentId: componentId.chartLegend,\n});\n\nconst CustomReferenceLabel = ({\n viewBox,\n value,\n isVertical,\n}: {\n viewBox?: { x: number; y: number; width: number };\n value: string | undefined;\n isVertical: boolean;\n}): JSX.Element => {\n // Extract viewBox coordinates with fallback values to prevent undefined errors.\n // viewBox contains the positioning information for the reference line label from Recharts.\n const { x, y, width } = viewBox ?? { x: 0, y: 0, width: 0 };\n const { theme } = useTheme();\n\n // Calculate dynamic text width to ensure the background rectangle fits the text perfectly.\n // This prevents text overflow for long labels and avoids unnecessarily large rectangles for short text.\n // The function also handles text truncation with ellipsis if the text exceeds the maximum width.\n const { width: RECT_WIDTH, displayText } = value\n ? calculateTextWidth(value, theme)\n : { width: 80, displayText: value ?? '' };\n\n const rect_x = isVertical ? x + width - RECT_WIDTH / 2 : x + width - RECT_WIDTH;\n const rect_y = isVertical ? y : y - TEXT_BASELINE;\n // Text position with padding inside the rectangle\n const text_x = rect_x + PADDING_HORIZONTAL + (RECT_WIDTH - PADDING_HORIZONTAL * 2) / 2;\n const text_y = rect_y + PADDING_VERTICAL + TEXT_BASELINE; // +15 for text baseline\n\n return (\n <g>\n <rect\n x={rect_x}\n y={rect_y}\n width={RECT_WIDTH}\n height={RECT_HEIGHT}\n rx={theme.border.radius.medium}\n fill={theme.colors.surface.background.gray.subtle}\n stroke={theme.colors.surface.border.gray.muted}\n strokeWidth=\"1\"\n />\n <text\n x={text_x}\n y={text_y}\n textAnchor=\"middle\"\n fill={theme.colors.surface.text.gray.normal}\n fontSize={theme.typography.fonts.size[50]}\n fontFamily={theme.typography.fonts.family.text}\n fontWeight={theme.typography.fonts.weight.medium}\n letterSpacing={theme.typography.letterSpacings[100]}\n >\n {displayText}\n </text>\n </g>\n );\n};\n\nconst ChartReferenceLine: React.FC<ChartReferenceLineProps> = ({ label, x, y }) => {\n const { theme } = useTheme();\n return (\n <RechartsReferenceLine\n stroke={theme.colors.data.background.categorical.gray.intense}\n strokeWidth={2}\n strokeDasharray=\"4 4\"\n label={<CustomReferenceLabel value={label} isVertical={Boolean(x)} />}\n x={x}\n y={y}\n />\n );\n};\n\nexport {\n ChartXAxis,\n ChartYAxis,\n ChartCartesianGrid,\n ChartLegend,\n ChartTooltip,\n ChartReferenceLine,\n};\n"],"names":["getChartColor","dataKey","name","dataColorMapping","chartName","colorKey","sanitizeString","mappedColorData","mappedColor","colorToken","isCustomColor","isSequentialColor","getHighestColorInRange","followIntensityMapping","Object","keys","length","totalChartColors","ChartXAxis","props","_useTheme","useTheme","theme","_jsx","RechartsXAxis","_objectSpread","tick","fill","colors","surface","text","gray","muted","fontSize","typography","fonts","size","fontFamily","family","fontWeight","weight","regular","letterSpacing","letterSpacings","tickLine","stroke","border","label","_ref","viewBox","x","width","X_OFFSET","y","Y_OFFSET","X_AXIS_TEXT_BASELINE","textAnchor","children","ChartYAxis","_useTheme2","RechartsYAxis","value","position","style","lineHeight","lineHeights","angle","subtle","ChartCartesianGrid","_useTheme3","RechartsCartesianGrid","vertical","CustomTooltip","_ref2","item","key","_useTheme4","_useCommonChartCompon","useCommonChartComponentsContext","toolTipColor","_jsxs","Box","display","alignItems","justifyContent","gap","spacing","height","backgroundColor","getIn","borderRadius","radius","small","Text","color","ChartTooltip","_useTheme5","RechartsTooltip","content","_ref3","payload","filteredPayLoad","filter","type","icon","staticBlack","normal","large","concat","padding","Heading","paddingTop","undefined","map","cursor","LegendItem","_ref4","entry","index","_useTheme6","_useCommonChartCompon2","legendColor","CustomSquareLegend","layout","filteredPayload","_entry$payload","legendType","isVerticalLayout","flexDirection","flexWrap","_ChartLegend","_props$layout","_useTheme7","RechartsLegend","wrapperStyle","align","verticalAlign","ChartLegend","assignWithoutSideEffects","componentId","chartLegend","CustomReferenceLabel","_ref5","isVertical","_ref6","_useTheme8","_ref7","calculateTextWidth","displayText","RECT_WIDTH","rect_x","rect_y","TEXT_BASELINE","text_x","PADDING_HORIZONTAL","text_y","PADDING_VERTICAL","RECT_HEIGHT","rx","medium","background","strokeWidth","ChartReferenceLine","_ref8","_useTheme9","RechartsReferenceLine","data","categorical","intense","strokeDasharray","Boolean"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA8DA,IAAMA,aAAa,GAAG,SAAhBA,aAAaA,CACjBC,OAAe,EACfC,IAAY,EACZC,gBAAkC,EAClCC,SAA6B,EACT;AACpB,EAAA,IAAMC,QAAQ,GAAGD,SAAS,KAAK,OAAO,GAAGE,cAAc,CAACJ,IAAI,KAAA,IAAA,IAAJA,IAAI,KAAJA,KAAAA,CAAAA,GAAAA,IAAI,GAAI,EAAE,CAAC,GAAGD,OAAO,CAAA;AAC7E,EAAA,IAAMM,eAAe,GAAGJ,gBAAgB,KAAA,IAAA,IAAhBA,gBAAgB,KAAhBA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,gBAAgB,CAAGE,QAAQ,aAARA,QAAQ,KAAA,KAAA,CAAA,GAARA,QAAQ,GAAI,EAAE,CAAC,CAAA;AAC1D,EAAA,IAAMG,WAAW,GAAGD,eAAe,CAACE,UAAU,CAAA;AAC9C,EAAA,IAAMC,aAAa,GAAGH,eAAe,CAACG,aAAa,CAAA;EAEnD,IAAI,CAACN,SAAS,KAAK,MAAM,IAAIA,SAAS,KAAK,MAAM,KAAK,CAACM,aAAa,EAAE;AACpE,IAAA,OAAOF,WAAW,CAAA;AACpB,GAAA;AAEA,EAAA,IAAIA,WAAW,IAAIG,iBAAiB,CAACH,WAAW,CAAC,EAAE;AACjD,IAAA,OAAOA,WAAW,KAAXA,IAAAA,IAAAA,WAAW,KAAXA,KAAAA,CAAAA,GAAAA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AAAA,EAAA,IAAlBpH,KAAK,GAAAoH,KAAA,CAALpH,KAAK;IAAEG,CAAC,GAAAiH,KAAA,CAADjH,CAAC;IAAEG,CAAC,GAAA8G,KAAA,CAAD9G,CAAC,CAAA;AAC1E,EAAA,IAAA+G,UAAA,GAAkB/I,QAAQ,EAAE;IAApBC,KAAK,GAAA8I,UAAA,CAAL9I,KAAK,CAAA;EACb,oBACEC,GAAA,CAAC8I,aAAqB,EAAA;AACpBxH,IAAAA,MAAM,EAAEvB,KAAK,CAACM,MAAM,CAAC0I,IAAI,CAACN,UAAU,CAACO,WAAW,CAACxI,IAAI,CAACyI,OAAQ;AAC9DP,IAAAA,WAAW,EAAE,CAAE;AACfQ,IAAAA,eAAe,EAAC,KAAK;IACrB1H,KAAK,eAAExB,GAAA,CAACsH,oBAAoB,EAAA;AAAChF,MAAAA,KAAK,EAAEd,KAAM;MAACgG,UAAU,EAAE2B,OAAO,CAACxH,CAAC,CAAA;AAAE,KAAE,CAAE;AACtEA,IAAAA,CAAC,EAAEA,CAAE;AACLG,IAAAA,CAAC,EAAEA,CAAAA;AAAE,GACN,CAAC,CAAA;AAEN;;;;"}
@@ -0,0 +1,15 @@
1
+ import { createContext, useContext } from 'react';
2
+
3
+ var CommonChartComponentsContext = /*#__PURE__*/createContext({
4
+ dataColorMapping: undefined,
5
+ setDataColorMapping: function setDataColorMapping() {
6
+ return undefined;
7
+ },
8
+ chartName: undefined
9
+ });
10
+ var useCommonChartComponentsContext = function useCommonChartComponentsContext() {
11
+ return useContext(CommonChartComponentsContext);
12
+ };
13
+
14
+ export { CommonChartComponentsContext, useCommonChartComponentsContext };
15
+ //# sourceMappingURL=CommonChartComponentsContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommonChartComponentsContext.js","sources":["../../../../../../../src/components/Charts/CommonChartComponents/CommonChartComponentsContext.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type { CommonChartComponentsContextType } from './types';\n\nexport const CommonChartComponentsContext = createContext<CommonChartComponentsContextType>({\n dataColorMapping: undefined,\n setDataColorMapping: () => undefined,\n chartName: undefined,\n});\n\nexport const useCommonChartComponentsContext = (): CommonChartComponentsContextType =>\n useContext(CommonChartComponentsContext);\n"],"names":["CommonChartComponentsContext","createContext","dataColorMapping","undefined","setDataColorMapping","chartName","useCommonChartComponentsContext","useContext"],"mappings":";;AAGaA,IAAAA,4BAA4B,gBAAGC,aAAa,CAAmC;AAC1FC,EAAAA,gBAAgB,EAAEC,SAAS;EAC3BC,mBAAmB,EAAE,SAArBA,mBAAmBA,GAAA;AAAA,IAAA,OAAQD,SAAS,CAAA;AAAA,GAAA;AACpCE,EAAAA,SAAS,EAAEF,SAAAA;AACb,CAAC,EAAC;AAEWG,IAAAA,+BAA+B,GAAG,SAAlCA,+BAA+BA,GAAA;EAAA,OAC1CC,UAAU,CAACP,4BAA4B,CAAC,CAAA;AAAA;;;;"}
@@ -1,2 +1,4 @@
1
1
  export { ChartCartesianGrid, ChartLegend, ChartReferenceLine, ChartTooltip, ChartXAxis, ChartYAxis } from './CommonChartComponents.web.js';
2
+ export { CommonChartComponentsContext, useCommonChartComponentsContext } from './CommonChartComponentsContext.js';
3
+ export { DEFAULT_COLOR } from './tokens.js';
2
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -10,9 +10,10 @@ var Y_OFFSET = 14.5;
10
10
  var X_AXIS_TEXT_BASELINE = 24;
11
11
  var MIN_WIDTH = RECT_WIDTH;
12
12
  var MAX_WIDTH = 200;
13
+ var DEFAULT_COLOR = 'data.background.categorical.gray.moderate';
13
14
  var componentId = {
14
15
  chartLegend: 'chart-legend'
15
16
  };
16
17
 
17
- export { MAX_WIDTH, MIN_WIDTH, PADDING_HORIZONTAL, PADDING_VERTICAL, RECT_HEIGHT, RECT_WIDTH, TEXT_BASELINE, X_AXIS_TEXT_BASELINE, X_OFFSET, Y_OFFSET, componentId };
18
+ export { DEFAULT_COLOR, MAX_WIDTH, MIN_WIDTH, PADDING_HORIZONTAL, PADDING_VERTICAL, RECT_HEIGHT, RECT_WIDTH, TEXT_BASELINE, X_AXIS_TEXT_BASELINE, X_OFFSET, Y_OFFSET, componentId };
18
19
  //# sourceMappingURL=tokens.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.js","sources":["../../../../../../../src/components/Charts/CommonChartComponents/tokens.ts"],"sourcesContent":["const RECT_WIDTH = 80;\nconst RECT_HEIGHT = 30;\nconst TEXT_BASELINE = 15;\n\n// Padding for text inside the rectangle (4px vertical, 8px horizontal)\nconst PADDING_VERTICAL = 4;\nconst PADDING_HORIZONTAL = 8;\n\nconst X_OFFSET = 32;\nconst Y_OFFSET = 14.5;\nconst X_AXIS_TEXT_BASELINE = 24;\n\nconst MIN_WIDTH = RECT_WIDTH;\nconst MAX_WIDTH = 200;\n\nconst componentId = {\n chartLegend: 'chart-legend',\n};\n\nexport {\n componentId,\n RECT_WIDTH,\n RECT_HEIGHT,\n TEXT_BASELINE,\n PADDING_VERTICAL,\n PADDING_HORIZONTAL,\n X_OFFSET,\n Y_OFFSET,\n X_AXIS_TEXT_BASELINE,\n MIN_WIDTH,\n MAX_WIDTH,\n};\n"],"names":["RECT_WIDTH","RECT_HEIGHT","TEXT_BASELINE","PADDING_VERTICAL","PADDING_HORIZONTAL","X_OFFSET","Y_OFFSET","X_AXIS_TEXT_BASELINE","MIN_WIDTH","MAX_WIDTH","componentId","chartLegend"],"mappings":"AAAMA,IAAAA,UAAU,GAAG,GAAE;AACfC,IAAAA,WAAW,GAAG,GAAE;AAChBC,IAAAA,aAAa,GAAG,GAAE;;AAExB;AACMC,IAAAA,gBAAgB,GAAG,EAAC;AACpBC,IAAAA,kBAAkB,GAAG,EAAC;AAEtBC,IAAAA,QAAQ,GAAG,GAAE;AACbC,IAAAA,QAAQ,GAAG,KAAI;AACfC,IAAAA,oBAAoB,GAAG,GAAE;AAEzBC,IAAAA,SAAS,GAAGR,WAAU;AACtBS,IAAAA,SAAS,GAAG,IAAG;AAErB,IAAMC,WAAW,GAAG;AAClBC,EAAAA,WAAW,EAAE,cAAA;AACf;;;;"}
1
+ {"version":3,"file":"tokens.js","sources":["../../../../../../../src/components/Charts/CommonChartComponents/tokens.ts"],"sourcesContent":["const RECT_WIDTH = 80;\nconst RECT_HEIGHT = 30;\nconst TEXT_BASELINE = 15;\n\n// Padding for text inside the rectangle (4px vertical, 8px horizontal)\nconst PADDING_VERTICAL = 4;\nconst PADDING_HORIZONTAL = 8;\n\nconst X_OFFSET = 32;\nconst Y_OFFSET = 14.5;\nconst X_AXIS_TEXT_BASELINE = 24;\n\nconst MIN_WIDTH = RECT_WIDTH;\nconst MAX_WIDTH = 200;\n\nconst DEFAULT_COLOR = 'data.background.categorical.gray.moderate';\n\nconst componentId = {\n chartLegend: 'chart-legend',\n};\n\nexport {\n componentId,\n RECT_WIDTH,\n RECT_HEIGHT,\n TEXT_BASELINE,\n PADDING_VERTICAL,\n PADDING_HORIZONTAL,\n X_OFFSET,\n Y_OFFSET,\n X_AXIS_TEXT_BASELINE,\n MIN_WIDTH,\n MAX_WIDTH,\n DEFAULT_COLOR,\n};\n"],"names":["RECT_WIDTH","RECT_HEIGHT","TEXT_BASELINE","PADDING_VERTICAL","PADDING_HORIZONTAL","X_OFFSET","Y_OFFSET","X_AXIS_TEXT_BASELINE","MIN_WIDTH","MAX_WIDTH","DEFAULT_COLOR","componentId","chartLegend"],"mappings":"AAAMA,IAAAA,UAAU,GAAG,GAAE;AACfC,IAAAA,WAAW,GAAG,GAAE;AAChBC,IAAAA,aAAa,GAAG,GAAE;;AAExB;AACMC,IAAAA,gBAAgB,GAAG,EAAC;AACpBC,IAAAA,kBAAkB,GAAG,EAAC;AAEtBC,IAAAA,QAAQ,GAAG,GAAE;AACbC,IAAAA,QAAQ,GAAG,KAAI;AACfC,IAAAA,oBAAoB,GAAG,GAAE;AAEzBC,IAAAA,SAAS,GAAGR,WAAU;AACtBS,IAAAA,SAAS,GAAG,IAAG;AAEfC,IAAAA,aAAa,GAAG,4CAA2C;AAEjE,IAAMC,WAAW,GAAG;AAClBC,EAAAA,WAAW,EAAE,cAAA;AACf;;;;"}