@rio-cloud/rio-uikit 1.3.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/ChartLabel.d.ts +2 -0
  2. package/ChartLabel.js +2 -0
  3. package/ComposedChart.d.ts +2 -0
  4. package/ComposedChart.js +2 -0
  5. package/GroupedItemList.d.ts +2 -0
  6. package/GroupedItemList.js +2 -0
  7. package/LicensePlate.d.ts +2 -0
  8. package/LicensePlate.js +2 -0
  9. package/ReferenceLine.d.ts +2 -0
  10. package/ReferenceLine.js +2 -0
  11. package/components/assetTree/TreeOptions.js +7 -3
  12. package/components/charts/Area.d.ts +5 -0
  13. package/components/charts/Area.js +1 -9
  14. package/components/charts/AreaChart.d.ts +2 -0
  15. package/components/charts/AreaChart.js +9 -6
  16. package/components/charts/BarChart.js +4 -4
  17. package/components/charts/ChartLabel.d.ts +5 -0
  18. package/components/charts/ChartLabel.js +2 -0
  19. package/components/charts/ComposedChart.d.ts +34 -0
  20. package/components/charts/ComposedChart.js +30 -0
  21. package/components/charts/Legend.d.ts +8 -10
  22. package/components/charts/Legend.js +4 -13
  23. package/components/charts/Line.d.ts +5 -0
  24. package/components/charts/Line.js +1 -9
  25. package/components/charts/LineChart.d.ts +2 -0
  26. package/components/charts/LineChart.js +8 -5
  27. package/components/charts/PieChart.js +5 -5
  28. package/components/charts/RadialBarChart.js +5 -5
  29. package/components/charts/ReferenceLine.d.ts +7 -0
  30. package/components/charts/ReferenceLine.js +2 -0
  31. package/components/dialog/Dialog.d.ts +12 -4
  32. package/components/dialog/SplitDialog.d.ts +3 -3
  33. package/components/dropdown/ButtonDropdown.d.ts +3 -1
  34. package/components/dropdown/ButtonDropdown.js +6 -5
  35. package/components/dropdown/DropdownToggleButton.d.ts +1 -0
  36. package/components/dropdown/DropdownToggleButton.js +4 -2
  37. package/components/groupedItemList/GroupedItemList.d.ts +79 -0
  38. package/components/groupedItemList/GroupedItemList.js +77 -0
  39. package/components/licensePlate/LicensePlate.d.ts +19 -0
  40. package/components/licensePlate/LicensePlate.js +14 -0
  41. package/components/selects/BaseSelectDropdown.d.ts +1 -0
  42. package/components/selects/BaseSelectDropdown.js +16 -14
  43. package/components/selects/Multiselect.d.ts +5 -0
  44. package/components/selects/Multiselect.js +2 -2
  45. package/components/selects/Select.d.ts +5 -0
  46. package/components/selects/Select.js +2 -2
  47. package/components/switch/Switch.d.ts +6 -5
  48. package/components/switch/Switch.js +5 -5
  49. package/components/tag/Tag.d.ts +2 -2
  50. package/components/tag/Tag.js +5 -6
  51. package/hooks/useDOMNodeCount.d.ts +2 -0
  52. package/hooks/useDOMNodeCount.js +29 -0
  53. package/hooks/useEventListenerCount.d.ts +5 -0
  54. package/hooks/useEventListenerCount.js +42 -0
  55. package/hooks/useKey.d.ts +7 -4
  56. package/hooks/useKey.js +36 -8
  57. package/lib/es/ChartLabel.d.ts +2 -0
  58. package/lib/es/ChartLabel.js +7 -0
  59. package/lib/es/ComposedChart.d.ts +2 -0
  60. package/lib/es/ComposedChart.js +7 -0
  61. package/lib/es/GroupedItemList.d.ts +2 -0
  62. package/lib/es/GroupedItemList.js +7 -0
  63. package/lib/es/LicensePlate.d.ts +2 -0
  64. package/lib/es/LicensePlate.js +7 -0
  65. package/lib/es/ReferenceLine.d.ts +2 -0
  66. package/lib/es/ReferenceLine.js +7 -0
  67. package/lib/es/components/assetTree/TreeOptions.js +7 -3
  68. package/lib/es/components/charts/Area.d.ts +5 -0
  69. package/lib/es/components/charts/Area.js +1 -9
  70. package/lib/es/components/charts/AreaChart.d.ts +2 -0
  71. package/lib/es/components/charts/AreaChart.js +7 -4
  72. package/lib/es/components/charts/BarChart.js +3 -3
  73. package/lib/es/components/charts/ChartLabel.d.ts +5 -0
  74. package/lib/es/components/charts/ChartLabel.js +4 -0
  75. package/lib/es/components/charts/ComposedChart.d.ts +34 -0
  76. package/lib/es/components/charts/ComposedChart.js +32 -0
  77. package/lib/es/components/charts/Legend.d.ts +8 -10
  78. package/lib/es/components/charts/Legend.js +6 -13
  79. package/lib/es/components/charts/Line.d.ts +5 -0
  80. package/lib/es/components/charts/Line.js +1 -9
  81. package/lib/es/components/charts/LineChart.d.ts +2 -0
  82. package/lib/es/components/charts/LineChart.js +7 -4
  83. package/lib/es/components/charts/PieChart.js +4 -4
  84. package/lib/es/components/charts/RadialBarChart.js +4 -4
  85. package/lib/es/components/charts/ReferenceLine.d.ts +7 -0
  86. package/lib/es/components/charts/ReferenceLine.js +4 -0
  87. package/lib/es/components/dialog/Dialog.d.ts +12 -4
  88. package/lib/es/components/dialog/SplitDialog.d.ts +3 -3
  89. package/lib/es/components/dropdown/ButtonDropdown.d.ts +3 -1
  90. package/lib/es/components/dropdown/ButtonDropdown.js +5 -4
  91. package/lib/es/components/dropdown/DropdownToggleButton.d.ts +1 -0
  92. package/lib/es/components/dropdown/DropdownToggleButton.js +4 -2
  93. package/lib/es/components/groupedItemList/GroupedItemList.d.ts +79 -0
  94. package/lib/es/components/groupedItemList/GroupedItemList.js +80 -0
  95. package/lib/es/components/licensePlate/LicensePlate.d.ts +19 -0
  96. package/lib/es/components/licensePlate/LicensePlate.js +16 -0
  97. package/lib/es/components/selects/BaseSelectDropdown.d.ts +1 -0
  98. package/lib/es/components/selects/BaseSelectDropdown.js +16 -14
  99. package/lib/es/components/selects/Multiselect.d.ts +5 -0
  100. package/lib/es/components/selects/Multiselect.js +2 -2
  101. package/lib/es/components/selects/Select.d.ts +5 -0
  102. package/lib/es/components/selects/Select.js +2 -2
  103. package/lib/es/components/switch/Switch.d.ts +6 -5
  104. package/lib/es/components/switch/Switch.js +5 -5
  105. package/lib/es/components/tag/Tag.d.ts +2 -2
  106. package/lib/es/components/tag/Tag.js +5 -6
  107. package/lib/es/hooks/useDOMNodeCount.d.ts +2 -0
  108. package/lib/es/hooks/useDOMNodeCount.js +31 -0
  109. package/lib/es/hooks/useEventListenerCount.d.ts +5 -0
  110. package/lib/es/hooks/useEventListenerCount.js +45 -0
  111. package/lib/es/hooks/useKey.d.ts +7 -4
  112. package/lib/es/hooks/useKey.js +35 -7
  113. package/lib/es/useDOMNodeCount.d.ts +2 -0
  114. package/lib/es/useDOMNodeCount.js +7 -0
  115. package/lib/es/useEventListenerCount.d.ts +2 -0
  116. package/lib/es/useEventListenerCount.js +7 -0
  117. package/lib/es/utils/colorScheme.js +10 -8
  118. package/lib/es/version.json +1 -1
  119. package/package.json +14 -22
  120. package/useDOMNodeCount.d.ts +2 -0
  121. package/useDOMNodeCount.js +2 -0
  122. package/useEventListenerCount.d.ts +2 -0
  123. package/useEventListenerCount.js +2 -0
  124. package/utils/colorScheme.js +10 -8
  125. package/version.json +1 -1
@@ -0,0 +1,2 @@
1
+ export { default } from './components/groupedItemList/GroupedItemList';
2
+ export * from './components/groupedItemList/GroupedItemList';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = void 0;
4
+ const tslib_1 = require("tslib");
5
+ var GroupedItemList_1 = require("./components/groupedItemList/GroupedItemList");
6
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return tslib_1.__importDefault(GroupedItemList_1).default; } });
7
+ tslib_1.__exportStar(require("./components/groupedItemList/GroupedItemList"), exports);
@@ -0,0 +1,2 @@
1
+ export { default } from './components/licensePlate/LicensePlate';
2
+ export * from './components/licensePlate/LicensePlate';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = void 0;
4
+ const tslib_1 = require("tslib");
5
+ var LicensePlate_1 = require("./components/licensePlate/LicensePlate");
6
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return tslib_1.__importDefault(LicensePlate_1).default; } });
7
+ tslib_1.__exportStar(require("./components/licensePlate/LicensePlate"), exports);
@@ -0,0 +1,2 @@
1
+ export { default } from './components/charts/ReferenceLine';
2
+ export * from './components/charts/ReferenceLine';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = void 0;
4
+ const tslib_1 = require("tslib");
5
+ var ReferenceLine_1 = require("./components/charts/ReferenceLine");
6
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return tslib_1.__importDefault(ReferenceLine_1).default; } });
7
+ tslib_1.__exportStar(require("./components/charts/ReferenceLine"), exports);
@@ -17,16 +17,20 @@ const TreeOptions = (props) => {
17
17
  const customDropdown = (0, jsx_runtime_1.jsx)("div", Object.assign({ className: dropdownClasses }, { children: treeOptions }));
18
18
  const dropdown = ((0, jsx_runtime_1.jsx)(ButtonDropdown_1.default, { title: (0, jsx_runtime_1.jsx)("span", { className: 'rioglyph rioglyph-option-vertical', "aria-hidden": 'true' }), bsStyle: 'default', bsSize: 'sm', customDropdown: customDropdown, toggleClassName: 'hover-bg-white border-none text-color-gray hover-text-color-dark', className: 'TreeHeaderOptions height-20', pullRight: true, iconOnly: true }));
19
19
  if (treeOptionsTooltip) {
20
- return ((0, jsx_runtime_1.jsx)(SimpleTooltip_1.default, Object.assign({ content: treeOptionsTooltip, placement: 'bottom', delay: { show: 1000, hide: 0 }, popperConfig: {
20
+ return ((0, jsx_runtime_1.jsx)(SimpleTooltip_1.default, Object.assign({ content: treeOptionsTooltip, placement: 'bottom-end', delay: { show: 1000, hide: 0 }, popperConfig: {
21
21
  modifiers: [
22
22
  {
23
23
  name: 'offset',
24
24
  options: {
25
- offset: [-20, 10],
25
+ offset: [10, 5],
26
26
  },
27
27
  },
28
+ {
29
+ name: 'arrow',
30
+ options: {},
31
+ },
28
32
  ],
29
- } }, { children: dropdown })));
33
+ } }, { children: (0, jsx_runtime_1.jsx)("div", { children: dropdown }) })));
30
34
  }
31
35
  return dropdown;
32
36
  };
@@ -2,6 +2,11 @@
2
2
  import type { AreaProps as RechartsAreaProps } from 'recharts';
3
3
  export type AreaProps = Omit<RechartsAreaProps, 'ref'> & {
4
4
  strokeColor?: string;
5
+ dataKey?: string;
6
+ unit?: string;
7
+ legendType?: string;
8
+ type?: string;
9
+ isAnimationActive?: boolean;
5
10
  };
6
11
  declare const Area: React.FC<AreaProps>;
7
12
  export default Area;
@@ -1,12 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const Area = () => null;
4
- Area.defaultProps = {
5
- dataKey: 'value',
6
- unit: '',
7
- strokeColor: 'color-coldplay-fountain',
8
- legendType: 'square',
9
- type: 'monotone',
10
- isAnimationActive: true,
11
- };
3
+ const Area = ({ dataKey = 'value', unit = '', strokeColor = 'color-coldplay-fountain', legendType = 'square', type = 'monotone', isAnimationActive = true, }) => null;
12
4
  exports.default = Area;
@@ -6,6 +6,7 @@ import { type LegendProps } from './Legend';
6
6
  import type { AreaProps } from './Area';
7
7
  import type { GridProps } from './ChartGrid';
8
8
  import type { ResponsiveContainerProps } from './ResponsiveContainer';
9
+ import type { ReferenceLineProps } from './ReferenceLine';
9
10
  type RechartsAreaChartProps = React.ComponentProps<typeof RechartsAreaChart>;
10
11
  export type AreaChartProps<T extends object> = Omit<RechartsAreaChartProps, 'data'> & {
11
12
  width?: number;
@@ -15,6 +16,7 @@ export type AreaChartProps<T extends object> = Omit<RechartsAreaChartProps, 'dat
15
16
  dataKey?: string | number | ((obj: T) => any);
16
17
  gradients?: React.ReactElement<AreaGradientProps>[];
17
18
  areas: React.ReactElement<AreaProps>[];
19
+ referenceLines?: React.ReactElement<ReferenceLineProps>[];
18
20
  xAxisOptions?: XAxisProps;
19
21
  yAxisOptions?: YAxisProps;
20
22
  gridOptions?: GridProps;
@@ -10,9 +10,9 @@ const isObject_1 = tslib_1.__importDefault(require("lodash/fp/isObject"));
10
10
  const chartHelper_1 = require("./chartHelper");
11
11
  const AreaGradient_1 = tslib_1.__importStar(require("./AreaGradient"));
12
12
  const ChartTooltip_1 = tslib_1.__importDefault(require("./ChartTooltip"));
13
- const Legend_1 = tslib_1.__importDefault(require("./Legend"));
13
+ const Legend_1 = require("./Legend");
14
14
  const AreaChart = (props) => {
15
- const { width, height, data = [], dataUnit = '', dataKey = 'value', gradients = [], areas = [], xAxisOptions, yAxisOptions, gridOptions, containerOptions, showXAxis = true, showYAxis = false, showGrid = false, legend, brush = false, tooltip = true } = props, remainingProps = tslib_1.__rest(props, ["width", "height", "data", "dataUnit", "dataKey", "gradients", "areas", "xAxisOptions", "yAxisOptions", "gridOptions", "containerOptions", "showXAxis", "showYAxis", "showGrid", "legend", "brush", "tooltip"]);
15
+ const { width, height, data = [], dataUnit = '', dataKey = 'value', gradients = [], areas = [], referenceLines = [], xAxisOptions, yAxisOptions, gridOptions, containerOptions, showXAxis = true, showYAxis = false, showGrid = false, legend, brush = false, tooltip = true } = props, remainingProps = tslib_1.__rest(props, ["width", "height", "data", "dataUnit", "dataKey", "gradients", "areas", "referenceLines", "xAxisOptions", "yAxisOptions", "gridOptions", "containerOptions", "showXAxis", "showYAxis", "showGrid", "legend", "brush", "tooltip"]);
16
16
  const areasWithGradient = areas.map(area => {
17
17
  const _a = area.props, { strokeColor } = _a, remainingAreaProps = tslib_1.__rest(_a, ["strokeColor"]);
18
18
  const gradientId = area.key;
@@ -23,7 +23,10 @@ const AreaChart = (props) => {
23
23
  };
24
24
  });
25
25
  const tooltipProps = (0, isObject_1.default)(tooltip) ? tooltip.props : {};
26
- const legendProps = (0, isObject_1.default)(legend) ? legend.props : {};
27
- return ((0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, Object.assign({}, containerOptions, { children: (0, jsx_runtime_1.jsxs)(recharts_1.AreaChart, Object.assign({ width: width, height: height, data: data, margin: { top: 15, right: 15, left: 15, bottom: 15 } }, remainingProps, { children: [(0, jsx_runtime_1.jsxs)("defs", { children: [gradients, areasWithGradient.map(areaWithGradient => areaWithGradient.gradient)] }), showGrid && (0, jsx_runtime_1.jsx)(recharts_1.CartesianGrid, Object.assign({ strokeDasharray: '3 3' }, (0, chartHelper_1.mapGridOptions)(gridOptions))), (0, jsx_runtime_1.jsx)(recharts_1.XAxis, Object.assign({ hide: !showXAxis, dataKey: dataKey }, xAxisOptions)), (0, jsx_runtime_1.jsx)(recharts_1.YAxis, Object.assign({ hide: !showYAxis, unit: dataUnit }, yAxisOptions)), tooltip && (0, jsx_runtime_1.jsx)(ChartTooltip_1.default, Object.assign({}, tooltipProps)), legend && (0, jsx_runtime_1.jsx)(Legend_1.default, Object.assign({}, legendProps)), areasWithGradient.map(areaWithGradient => areaWithGradient.area), brush && (0, jsx_runtime_1.jsx)(recharts_1.Brush, { stroke: (0, chartHelper_1.getColor)('gray') })] })) })));
26
+ const legendProps = (0, isObject_1.default)(legend) ? Object.assign(Object.assign({}, (0, Legend_1.getLegendDefaultProps)()), legend.props) : {};
27
+ return ((0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, Object.assign({}, containerOptions, { children: (0, jsx_runtime_1.jsxs)(recharts_1.AreaChart, Object.assign({ width: width, height: height, data: data, margin: { top: 15, right: 15, left: 15, bottom: 15 } }, remainingProps, { children: [(0, jsx_runtime_1.jsxs)("defs", { children: [gradients, areasWithGradient.map(areaWithGradient => areaWithGradient.gradient)] }), showGrid && (0, jsx_runtime_1.jsx)(recharts_1.CartesianGrid, Object.assign({ strokeDasharray: '3 3' }, (0, chartHelper_1.mapGridOptions)(gridOptions))), (0, jsx_runtime_1.jsx)(recharts_1.XAxis, Object.assign({ hide: !showXAxis, dataKey: dataKey }, xAxisOptions)), (0, jsx_runtime_1.jsx)(recharts_1.YAxis, Object.assign({ hide: !showYAxis, unit: dataUnit }, yAxisOptions)), tooltip && (0, jsx_runtime_1.jsx)(ChartTooltip_1.default, Object.assign({}, tooltipProps)), legend && legendProps && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(recharts_1.Legend, Object.assign({ wrapperStyle: legendProps.verticalAlign === 'bottom' ? { bottom: 0 } : legendProps.wrapperStyle }, legendProps)) })), areasWithGradient.map(areaWithGradient => areaWithGradient.area), referenceLines.map(referenceLine => {
28
+ const _a = referenceLine.props, { stroke } = _a, remainingReferenceLineProps = tslib_1.__rest(_a, ["stroke"]);
29
+ return ((0, react_1.createElement)(recharts_1.ReferenceLine, Object.assign({}, remainingReferenceLineProps, { key: referenceLine.key, stroke: (0, chartHelper_1.getColor)(stroke) })));
30
+ }), brush && (0, jsx_runtime_1.jsx)(recharts_1.Brush, { stroke: (0, chartHelper_1.getColor)('gray') })] })) })));
28
31
  };
29
32
  exports.default = AreaChart;
@@ -9,11 +9,11 @@ const isFunction_1 = tslib_1.__importDefault(require("lodash/fp/isFunction"));
9
9
  const isObject_1 = tslib_1.__importDefault(require("lodash/fp/isObject"));
10
10
  const chartHelper_1 = require("./chartHelper");
11
11
  const ChartTooltip_1 = tslib_1.__importDefault(require("./ChartTooltip"));
12
- const Legend_1 = tslib_1.__importDefault(require("./Legend"));
12
+ const Legend_1 = require("./Legend");
13
13
  const BarChart = (props) => {
14
14
  const { width, height, data = [], dataUnit, dataKey = 'value', layout = 'horizontal', legend = false, bars = [], xAxisOptions, yAxisOptions, gridOptions, containerOptions, showGrid = false, showXAxis = true, showYAxis = true, useDataColors = false, brush = false, tooltip = true } = props, remainingProps = tslib_1.__rest(props, ["width", "height", "data", "dataUnit", "dataKey", "layout", "legend", "bars", "xAxisOptions", "yAxisOptions", "gridOptions", "containerOptions", "showGrid", "showXAxis", "showYAxis", "useDataColors", "brush", "tooltip"]);
15
15
  const tooltipProps = (0, isObject_1.default)(tooltip) ? tooltip.props : {};
16
- const legendProps = (0, isObject_1.default)(legend) ? legend.props : {};
16
+ const legendProps = (0, isObject_1.default)(legend) ? Object.assign(Object.assign({}, (0, Legend_1.getLegendDefaultProps)()), legend.props) : {};
17
17
  let legendPayload;
18
18
  if (useDataColors) {
19
19
  legendPayload = data.map((entry, index) => {
@@ -21,7 +21,7 @@ const BarChart = (props) => {
21
21
  return Object.assign(Object.assign({}, entry), { value: (0, isFunction_1.default)(dataKey) ? dataKey(entry) : entry[dataKey], color: legendColor });
22
22
  });
23
23
  }
24
- return ((0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, Object.assign({}, containerOptions, { children: (0, jsx_runtime_1.jsxs)(recharts_1.BarChart, Object.assign({ layout: layout, width: width, height: height, data: data }, remainingProps, { children: [showGrid && (0, jsx_runtime_1.jsx)(recharts_1.CartesianGrid, Object.assign({ strokeDasharray: '3 3' }, (0, chartHelper_1.mapGridOptions)(gridOptions))), (0, jsx_runtime_1.jsx)(recharts_1.XAxis, Object.assign({ hide: !showXAxis, dataKey: dataKey }, xAxisOptions)), (0, jsx_runtime_1.jsx)(recharts_1.YAxis, Object.assign({ hide: !showYAxis, unit: dataUnit }, yAxisOptions)), legend && (0, jsx_runtime_1.jsx)(Legend_1.default, Object.assign({}, legendProps, { payload: legendPayload })), tooltip && (0, jsx_runtime_1.jsx)(ChartTooltip_1.default, Object.assign({ cursor: { fill: chartHelper_1.CURSOR_BACKGROUND_COLOR } }, tooltipProps)), bars.map(bar => {
24
+ return ((0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, Object.assign({}, containerOptions, { children: (0, jsx_runtime_1.jsxs)(recharts_1.BarChart, Object.assign({ layout: layout, width: width, height: height, data: data }, remainingProps, { children: [showGrid && (0, jsx_runtime_1.jsx)(recharts_1.CartesianGrid, Object.assign({ strokeDasharray: '3 3' }, (0, chartHelper_1.mapGridOptions)(gridOptions))), (0, jsx_runtime_1.jsx)(recharts_1.XAxis, Object.assign({ hide: !showXAxis, dataKey: dataKey }, xAxisOptions)), (0, jsx_runtime_1.jsx)(recharts_1.YAxis, Object.assign({ hide: !showYAxis, unit: dataUnit }, yAxisOptions)), tooltip && (0, jsx_runtime_1.jsx)(ChartTooltip_1.default, Object.assign({ cursor: { fill: chartHelper_1.CURSOR_BACKGROUND_COLOR } }, tooltipProps)), legend && (0, jsx_runtime_1.jsx)(recharts_1.Legend, Object.assign({ payload: useDataColors ? legendPayload : undefined }, legendProps)), bars.map(bar => {
25
25
  const _a = bar.props, { color } = _a, remainingBarProps = tslib_1.__rest(_a, ["color"]);
26
26
  const cellColor = color && (0, chartHelper_1.getColor)(color);
27
27
  return ((0, jsx_runtime_1.jsx)(recharts_1.Bar, Object.assign({ unit: dataUnit }, remainingBarProps, { fill: cellColor }, { children: useDataColors &&
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import type { LabelProps as RechartsLabelProps } from 'recharts';
3
+ export type LabelProps = Omit<RechartsLabelProps, 'ref'> & {};
4
+ declare const ChartLabel: React.FC<LabelProps>;
5
+ export default ChartLabel;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const ChartLabel = props => null;
4
+ exports.default = ChartLabel;
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import { ComposedChart as RechartsComposedChart, type XAxisProps, type YAxisProps } from 'recharts';
3
+ import { ChartTooltipProps } from './ChartTooltip';
4
+ import { type LegendProps } from './Legend';
5
+ import type { LineProps } from './Line';
6
+ import type { BarProps } from './Bar';
7
+ import type { ReferenceLineProps } from './ReferenceLine';
8
+ import type { GridProps } from './ChartGrid';
9
+ import type { ResponsiveContainerProps } from './ResponsiveContainer';
10
+ import type { AreaProps } from './Area';
11
+ type RechartsComposedChartProps = React.ComponentProps<typeof RechartsComposedChart>;
12
+ export type ComposedChartProps<T extends object> = Omit<RechartsComposedChartProps, 'data'> & {
13
+ width?: number;
14
+ height?: number;
15
+ data: T[];
16
+ dataUnit?: string;
17
+ dataKey?: string | number | ((obj: T) => any);
18
+ lines?: React.ReactElement<LineProps>[];
19
+ bars?: React.ReactElement<BarProps>[];
20
+ areas?: React.ReactElement<AreaProps>[];
21
+ referenceLines?: React.ReactElement<ReferenceLineProps>[];
22
+ xAxisOptions?: XAxisProps;
23
+ yAxisOptions?: YAxisProps;
24
+ gridOptions?: GridProps;
25
+ containerOptions?: ResponsiveContainerProps;
26
+ showXAxis?: boolean;
27
+ showYAxis?: boolean;
28
+ showGrid?: boolean;
29
+ legend?: React.ReactElement<LegendProps> | boolean;
30
+ tooltip?: React.ReactElement<ChartTooltipProps> | boolean;
31
+ brush?: boolean;
32
+ };
33
+ declare const ComposedChart: <T extends object>(props: ComposedChartProps<T>) => import("react/jsx-runtime").JSX.Element;
34
+ export default ComposedChart;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const react_1 = require("react");
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ // @ts-ignore-next-line importsNotUsedAsValues
7
+ require("react");
8
+ const recharts_1 = require("recharts");
9
+ const isObject_1 = tslib_1.__importDefault(require("lodash/fp/isObject"));
10
+ const chartHelper_1 = require("./chartHelper");
11
+ const ChartTooltip_1 = tslib_1.__importDefault(require("./ChartTooltip"));
12
+ const Legend_1 = require("./Legend");
13
+ const ComposedChart = (props) => {
14
+ const { width, height, data = [], dataUnit = '', dataKey = 'value', lines = [], bars = [], areas = [], referenceLines = [], xAxisOptions, yAxisOptions, gridOptions, containerOptions, showXAxis = true, showYAxis = false, showGrid = false, legend, brush = false, tooltip = true } = props, remainingProps = tslib_1.__rest(props, ["width", "height", "data", "dataUnit", "dataKey", "lines", "bars", "areas", "referenceLines", "xAxisOptions", "yAxisOptions", "gridOptions", "containerOptions", "showXAxis", "showYAxis", "showGrid", "legend", "brush", "tooltip"]);
15
+ const tooltipProps = (0, isObject_1.default)(tooltip) ? tooltip.props : {};
16
+ const legendProps = (0, isObject_1.default)(legend) ? Object.assign(Object.assign({}, (0, Legend_1.getLegendDefaultProps)()), legend.props) : {};
17
+ return ((0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, Object.assign({}, containerOptions, { children: (0, jsx_runtime_1.jsxs)(recharts_1.ComposedChart, Object.assign({ width: width, height: height, data: data, margin: { top: 15, right: 15, left: 15, bottom: 15 } }, remainingProps, { children: [showGrid && (0, jsx_runtime_1.jsx)(recharts_1.CartesianGrid, Object.assign({ strokeDasharray: '3 3' }, (0, chartHelper_1.mapGridOptions)(gridOptions))), (0, jsx_runtime_1.jsx)(recharts_1.XAxis, Object.assign({ hide: !showXAxis, dataKey: dataKey }, xAxisOptions)), (0, jsx_runtime_1.jsx)(recharts_1.YAxis, Object.assign({ hide: !showYAxis, unit: dataUnit }, yAxisOptions)), tooltip && (0, jsx_runtime_1.jsx)(ChartTooltip_1.default, Object.assign({}, tooltipProps)), legend && (0, jsx_runtime_1.jsx)(recharts_1.Legend, Object.assign({}, legendProps)), areas.map(area => {
18
+ const _a = area.props, { strokeColor, fill } = _a, remainingAreaProps = tslib_1.__rest(_a, ["strokeColor", "fill"]);
19
+ return ((0, react_1.createElement)(recharts_1.Area, Object.assign({}, remainingAreaProps, { key: area.key, stroke: (0, chartHelper_1.getColor)(strokeColor), fill: (0, chartHelper_1.getColor)(fill) })));
20
+ }), bars.map(bar => {
21
+ const _a = bar.props, { color } = _a, remainingBarProps = tslib_1.__rest(_a, ["color"]);
22
+ const cellColor = color && (0, chartHelper_1.getColor)(color);
23
+ return (0, jsx_runtime_1.jsx)(recharts_1.Bar, Object.assign({ unit: dataUnit }, remainingBarProps, { fill: cellColor }), bar.key);
24
+ }), lines.map(line => {
25
+ const _a = line.props, { strokeColor } = _a, remainingLineProps = tslib_1.__rest(_a, ["strokeColor"]);
26
+ return (0, react_1.createElement)(recharts_1.Line, Object.assign({}, remainingLineProps, { key: line.key, stroke: (0, chartHelper_1.getColor)(strokeColor) }));
27
+ }), referenceLines.map(referenceLine => {
28
+ const _a = referenceLine.props, { stroke } = _a, remainingReferenceLineProps = tslib_1.__rest(_a, ["stroke"]);
29
+ return ((0, react_1.createElement)(recharts_1.ReferenceLine, Object.assign({}, remainingReferenceLineProps, { key: referenceLine.key, stroke: (0, chartHelper_1.getColor)(stroke) })));
30
+ }), brush && (0, jsx_runtime_1.jsx)(recharts_1.Brush, { stroke: (0, chartHelper_1.getColor)('gray') })] })) })));
31
+ };
32
+ exports.default = ComposedChart;
@@ -1,18 +1,16 @@
1
- import { type LegendProps as RechartsLegendProps } from 'recharts';
1
+ import type { LegendProps as RechartsLegendProps } from 'recharts';
2
2
  import type { Formatter, Payload } from 'recharts/types/component/DefaultLegendContent';
3
3
  export type LegendFormatter = Formatter;
4
4
  export type LegendPayload = Payload;
5
5
  export type LegendProps = Omit<RechartsLegendProps, 'ref' | 'formatter'> & {
6
6
  formatter?: (value: any, entry: any, index: number) => void;
7
7
  };
8
- declare const Legend: {
9
- (props: LegendProps): import("react/jsx-runtime").JSX.Element;
10
- defaultProps: {
11
- iconType: string;
12
- iconSize: number;
13
- layout: string;
14
- align: string;
15
- verticalAlign: string;
16
- };
8
+ export declare const getLegendDefaultProps: () => {
9
+ iconType: string;
10
+ iconSize: number;
11
+ layout: string;
12
+ align: string;
13
+ verticalAlign: string;
17
14
  };
15
+ declare const Legend: (props: LegendProps) => null;
18
16
  export default Legend;
@@ -1,22 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- // @ts-ignore-next-line importsNotUsedAsValues
3
+ exports.getLegendDefaultProps = void 0;
4
+ // @ts-ignore importsNotUsedAsValues
5
5
  require("react");
6
- const recharts_1 = require("recharts");
7
- const Legend = (props) => {
8
- const { verticalAlign, wrapperStyle } = props;
9
- return ((0, jsx_runtime_1.jsx)(recharts_1.Legend
10
- // biome-ignore lint/suspicious/noExplicitAny: <explanation>
11
- , Object.assign({
12
- // biome-ignore lint/suspicious/noExplicitAny: <explanation>
13
- formatter: props.formatter, wrapperStyle: verticalAlign === 'bottom' ? { bottom: 0 } : wrapperStyle }, props)));
14
- };
15
- Legend.defaultProps = {
6
+ const getLegendDefaultProps = () => ({
16
7
  iconType: 'circle',
17
8
  iconSize: 12,
18
9
  layout: 'vertical',
19
10
  align: 'right',
20
11
  verticalAlign: 'top',
21
- };
12
+ });
13
+ exports.getLegendDefaultProps = getLegendDefaultProps;
14
+ const Legend = (props) => null;
22
15
  exports.default = Legend;
@@ -2,6 +2,11 @@
2
2
  import type { LineProps as RechartsLineProps } from 'recharts';
3
3
  export type LineProps = Omit<RechartsLineProps, 'ref'> & {
4
4
  strokeColor?: string;
5
+ dataKey?: string;
6
+ unit?: string;
7
+ legendType?: string;
8
+ type?: string;
9
+ isAnimationActive?: boolean;
5
10
  };
6
11
  declare const Line: React.FC<LineProps>;
7
12
  export default Line;
@@ -1,12 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const Line = () => null;
4
- Line.defaultProps = {
5
- dataKey: 'value',
6
- unit: '',
7
- strokeColor: 'color-coldplay-fountain',
8
- legendType: 'square',
9
- type: 'monotone',
10
- isAnimationActive: true,
11
- };
3
+ const Line = ({ dataKey = 'value', unit = '', strokeColor = 'color-coldplay-fountain', legendType = 'square', type = 'monotone', isAnimationActive = true, }) => null;
12
4
  exports.default = Line;
@@ -3,6 +3,7 @@ import { LineChart as RechartsLineChart, type XAxisProps, type YAxisProps } from
3
3
  import { ChartTooltipProps } from './ChartTooltip';
4
4
  import { type LegendProps } from './Legend';
5
5
  import type { LineProps } from './Line';
6
+ import type { ReferenceLineProps } from './ReferenceLine';
6
7
  import type { GridProps } from './ChartGrid';
7
8
  import type { ResponsiveContainerProps } from './ResponsiveContainer';
8
9
  type RechartsLineChartProps = React.ComponentProps<typeof RechartsLineChart>;
@@ -13,6 +14,7 @@ export type LineChartProps<T extends object> = Omit<RechartsLineChartProps, 'dat
13
14
  dataUnit?: string;
14
15
  dataKey?: string | number | ((obj: T) => any);
15
16
  lines: React.ReactElement<LineProps>[];
17
+ referenceLines?: React.ReactElement<ReferenceLineProps>[];
16
18
  xAxisOptions?: XAxisProps;
17
19
  yAxisOptions?: YAxisProps;
18
20
  gridOptions?: GridProps;
@@ -9,14 +9,17 @@ const recharts_1 = require("recharts");
9
9
  const isObject_1 = tslib_1.__importDefault(require("lodash/fp/isObject"));
10
10
  const chartHelper_1 = require("./chartHelper");
11
11
  const ChartTooltip_1 = tslib_1.__importDefault(require("./ChartTooltip"));
12
- const Legend_1 = tslib_1.__importDefault(require("./Legend"));
12
+ const Legend_1 = require("./Legend");
13
13
  const LineChart = (props) => {
14
- const { width, height, data = [], dataUnit = '', dataKey = 'value', lines = [], xAxisOptions, yAxisOptions, gridOptions, containerOptions, showXAxis = true, showYAxis = false, showGrid = false, legend, brush = false, tooltip = true } = props, remainingProps = tslib_1.__rest(props, ["width", "height", "data", "dataUnit", "dataKey", "lines", "xAxisOptions", "yAxisOptions", "gridOptions", "containerOptions", "showXAxis", "showYAxis", "showGrid", "legend", "brush", "tooltip"]);
14
+ const { width, height, data = [], dataUnit = '', dataKey = 'value', lines = [], referenceLines = [], xAxisOptions, yAxisOptions, gridOptions, containerOptions, showXAxis = true, showYAxis = false, showGrid = false, legend, brush = false, tooltip = true } = props, remainingProps = tslib_1.__rest(props, ["width", "height", "data", "dataUnit", "dataKey", "lines", "referenceLines", "xAxisOptions", "yAxisOptions", "gridOptions", "containerOptions", "showXAxis", "showYAxis", "showGrid", "legend", "brush", "tooltip"]);
15
15
  const tooltipProps = (0, isObject_1.default)(tooltip) ? tooltip.props : {};
16
- const legendProps = (0, isObject_1.default)(legend) ? legend.props : {};
17
- return ((0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, Object.assign({}, containerOptions, { children: (0, jsx_runtime_1.jsxs)(recharts_1.LineChart, Object.assign({ width: width, height: height, data: data, margin: { top: 15, right: 15, left: 15, bottom: 15 } }, remainingProps, { children: [showGrid && (0, jsx_runtime_1.jsx)(recharts_1.CartesianGrid, Object.assign({ strokeDasharray: '3 3' }, (0, chartHelper_1.mapGridOptions)(gridOptions))), (0, jsx_runtime_1.jsx)(recharts_1.XAxis, Object.assign({ hide: !showXAxis, dataKey: dataKey }, xAxisOptions)), (0, jsx_runtime_1.jsx)(recharts_1.YAxis, Object.assign({ hide: !showYAxis, unit: dataUnit }, yAxisOptions)), tooltip && (0, jsx_runtime_1.jsx)(ChartTooltip_1.default, Object.assign({}, tooltipProps)), legend && (0, jsx_runtime_1.jsx)(Legend_1.default, Object.assign({}, legendProps)), lines.map(line => {
16
+ const legendProps = (0, isObject_1.default)(legend) ? Object.assign(Object.assign({}, (0, Legend_1.getLegendDefaultProps)()), legend.props) : {};
17
+ return ((0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, Object.assign({}, containerOptions, { children: (0, jsx_runtime_1.jsxs)(recharts_1.LineChart, Object.assign({ width: width, height: height, data: data, margin: { top: 15, right: 15, left: 15, bottom: 15 } }, remainingProps, { children: [showGrid && (0, jsx_runtime_1.jsx)(recharts_1.CartesianGrid, Object.assign({ strokeDasharray: '3 3' }, (0, chartHelper_1.mapGridOptions)(gridOptions))), (0, jsx_runtime_1.jsx)(recharts_1.XAxis, Object.assign({ hide: !showXAxis, dataKey: dataKey }, xAxisOptions)), (0, jsx_runtime_1.jsx)(recharts_1.YAxis, Object.assign({ hide: !showYAxis, unit: dataUnit }, yAxisOptions)), tooltip && (0, jsx_runtime_1.jsx)(ChartTooltip_1.default, Object.assign({}, tooltipProps)), legend && (0, jsx_runtime_1.jsx)(recharts_1.Legend, Object.assign({}, legendProps)), lines.map(line => {
18
18
  const _a = line.props, { strokeColor } = _a, remainingLineProps = tslib_1.__rest(_a, ["strokeColor"]);
19
19
  return (0, react_1.createElement)(recharts_1.Line, Object.assign({}, remainingLineProps, { key: line.key, stroke: (0, chartHelper_1.getColor)(strokeColor) }));
20
+ }), referenceLines.map(referenceLine => {
21
+ const _a = referenceLine.props, { stroke } = _a, remainingReferenceLineProps = tslib_1.__rest(_a, ["stroke"]);
22
+ return ((0, react_1.createElement)(recharts_1.ReferenceLine, Object.assign({}, remainingReferenceLineProps, { key: referenceLine.key, stroke: (0, chartHelper_1.getColor)(stroke) })));
20
23
  }), brush && (0, jsx_runtime_1.jsx)(recharts_1.Brush, { stroke: (0, chartHelper_1.getColor)('gray') })] })) })));
21
24
  };
22
25
  exports.default = LineChart;
@@ -8,7 +8,7 @@ const recharts_1 = require("recharts");
8
8
  const isFunction_1 = tslib_1.__importDefault(require("lodash/fp/isFunction"));
9
9
  const isObject_1 = tslib_1.__importDefault(require("lodash/fp/isObject"));
10
10
  const chartHelper_1 = require("./chartHelper");
11
- const Legend_1 = tslib_1.__importDefault(require("./Legend"));
11
+ const Legend_1 = require("./Legend");
12
12
  const ChartTooltip_1 = tslib_1.__importStar(require("./ChartTooltip"));
13
13
  const RADIAN = Math.PI / 180;
14
14
  const renderCustomInnerLabel = (dataUnit) => ({ cx, cy, midAngle, innerRadius, outerRadius, value }) => {
@@ -18,13 +18,13 @@ const renderCustomInnerLabel = (dataUnit) => ({ cx, cy, midAngle, innerRadius, o
18
18
  return ((0, jsx_runtime_1.jsx)("text", Object.assign({ x: x, y: y, fill: 'white', textAnchor: x > cx ? 'start' : 'end', dominantBaseline: 'central' }, { children: `${value} ${dataUnit}` })));
19
19
  };
20
20
  const PieChart = (props) => {
21
- const { width, height, innerRadius, outerRadius, data = [], dataKey = 'value', dataUnit = '', nameKey = 'name', color, filled = false, labels = true, innerLabels = false, paddingAngle = 3, legend = (0, jsx_runtime_1.jsx)(Legend_1.default, {}), tooltip = true, pieOptions, containerOptions } = props, remainingProps = tslib_1.__rest(props, ["width", "height", "innerRadius", "outerRadius", "data", "dataKey", "dataUnit", "nameKey", "color", "filled", "labels", "innerLabels", "paddingAngle", "legend", "tooltip", "pieOptions", "containerOptions"]);
21
+ const { width, height, innerRadius, outerRadius, data = [], dataKey = 'value', dataUnit = '', nameKey = 'name', color, filled = false, labels = true, innerLabels = false, paddingAngle = 3, legend = (0, jsx_runtime_1.jsx)(recharts_1.Legend, {}), tooltip = true, pieOptions, containerOptions } = props, remainingProps = tslib_1.__rest(props, ["width", "height", "innerRadius", "outerRadius", "data", "dataKey", "dataUnit", "nameKey", "color", "filled", "labels", "innerLabels", "paddingAngle", "legend", "tooltip", "pieOptions", "containerOptions"]);
22
22
  // biome-ignore lint/suspicious/noExplicitAny:
23
23
  const renderLabels = (entry) => `${(0, isFunction_1.default)(dataKey) ? dataKey(entry) : entry[dataKey]} ${dataUnit}`;
24
24
  const pieLabel = labels && (innerLabels ? renderCustomInnerLabel(dataUnit) : renderLabels);
25
25
  const tooltipProps = (0, isObject_1.default)(tooltip) ? tooltip.props : {};
26
- const legendProps = (0, isObject_1.default)(legend) ? legend.props : {};
27
- return ((0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, Object.assign({}, containerOptions, { children: (0, jsx_runtime_1.jsxs)(recharts_1.PieChart, Object.assign({ width: width, height: height }, remainingProps, { children: [legend && ((0, jsx_runtime_1.jsx)(Legend_1.default, Object.assign({ formatter: (value, entry) => ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: 'text-color-darker' }, { children: value }))) }, legendProps))), (0, jsx_runtime_1.jsx)(recharts_1.Pie, Object.assign({ data: data, isAnimationActive: true, nameKey: nameKey, dataKey: dataKey, label: pieLabel,
26
+ const legendProps = (0, isObject_1.default)(legend) ? Object.assign(Object.assign({}, (0, Legend_1.getLegendDefaultProps)()), legend.props) : {};
27
+ return ((0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, Object.assign({}, containerOptions, { children: (0, jsx_runtime_1.jsxs)(recharts_1.PieChart, Object.assign({ width: width, height: height }, remainingProps, { children: [legend && ((0, jsx_runtime_1.jsx)(recharts_1.Legend, Object.assign({ formatter: (value, entry) => ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: 'text-color-darker' }, { children: value }))) }, legendProps))), (0, jsx_runtime_1.jsx)(recharts_1.Pie, Object.assign({ data: data, isAnimationActive: true, nameKey: nameKey, dataKey: dataKey, label: pieLabel,
28
28
  // cx={Math.max(outerRadius, width / 3)}
29
29
  // cy={height / 2}
30
30
  innerRadius: filled ? 0 : innerRadius, outerRadius: outerRadius, paddingAngle: filled ? 0 : paddingAngle, labelLine: !innerLabels }, pieOptions, { children: data.map((entry, index) => {
@@ -8,10 +8,10 @@ const recharts_1 = require("recharts");
8
8
  const isFunction_1 = tslib_1.__importDefault(require("lodash/fp/isFunction"));
9
9
  const isObject_1 = tslib_1.__importDefault(require("lodash/fp/isObject"));
10
10
  const chartHelper_1 = require("./chartHelper");
11
- const Legend_1 = tslib_1.__importDefault(require("./Legend"));
11
+ const Legend_1 = require("./Legend");
12
12
  const ChartTooltip_1 = tslib_1.__importDefault(require("./ChartTooltip"));
13
13
  const RadialBarChart = (props) => {
14
- const { width, height, data = [], dataKey = 'value', startAngle = 180, endAngle = 0, innerRadius = '30%', outerRadius = '100%', legend = (0, jsx_runtime_1.jsx)(Legend_1.default, {}), textOptions, radialBarOptions, containerOptions, showBarLabel = false, cornerRadius = 30, background = true, range, tooltip = false } = props, remainingProps = tslib_1.__rest(props, ["width", "height", "data", "dataKey", "startAngle", "endAngle", "innerRadius", "outerRadius", "legend", "textOptions", "radialBarOptions", "containerOptions", "showBarLabel", "cornerRadius", "background", "range", "tooltip"]);
14
+ const { width, height, data = [], dataKey = 'value', startAngle = 180, endAngle = 0, innerRadius = '30%', outerRadius = '100%', legend = (0, jsx_runtime_1.jsx)(recharts_1.Legend, {}), textOptions, radialBarOptions, containerOptions, showBarLabel = false, cornerRadius = 30, background = true, range, tooltip = false } = props, remainingProps = tslib_1.__rest(props, ["width", "height", "data", "dataKey", "startAngle", "endAngle", "innerRadius", "outerRadius", "legend", "textOptions", "radialBarOptions", "containerOptions", "showBarLabel", "cornerRadius", "background", "range", "tooltip"]);
15
15
  const _a = textOptions || {}, { text, size = '500%', weight = 'normal', color = 'gray-darkest' } = _a, remainingTextOptions = tslib_1.__rest(_a, ["text", "size", "weight", "color"]);
16
16
  const textStyle = {
17
17
  fontSize: size,
@@ -19,10 +19,10 @@ const RadialBarChart = (props) => {
19
19
  fill: color && (0, chartHelper_1.getColor)(color),
20
20
  };
21
21
  const tooltipProps = (0, isObject_1.default)(tooltip) ? tooltip.props : {};
22
- const legendProps = (0, isObject_1.default)(legend) ? legend.props : {};
22
+ const legendProps = (0, isObject_1.default)(legend) ? Object.assign(Object.assign({}, (0, Legend_1.getLegendDefaultProps)()), legend.props) : {};
23
23
  return ((0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, Object.assign({}, containerOptions, { children: (0, jsx_runtime_1.jsxs)(recharts_1.RadialBarChart, Object.assign({ width: width, height: height, data: data, innerRadius: innerRadius, outerRadius: outerRadius, startAngle: startAngle, endAngle: endAngle }, remainingProps, { children: [(0, jsx_runtime_1.jsx)(recharts_1.RadialBar, Object.assign({ label: showBarLabel && { fill: '#666', position: 'insideStart' }, background: background, dataKey: dataKey, cornerRadius: cornerRadius }, radialBarOptions, { children: data.map((entry, index) => {
24
24
  const cellColor = (0, chartHelper_1.getColor)(entry.color) || (0, chartHelper_1.getFromDefaultColors)(index);
25
25
  return ((0, jsx_runtime_1.jsx)(recharts_1.Cell, { fill: (0, isFunction_1.default)(color) ? color(entry, index) : cellColor }, `cell-${index}`));
26
- }) })), range && (0, jsx_runtime_1.jsx)(recharts_1.PolarAngleAxis, { type: 'number', domain: range, angleAxisId: 0, tick: false }), textOptions && ((0, jsx_runtime_1.jsx)("text", Object.assign({ x: width ? width / 2 : '50%', y: height ? height / 2 : '50%', textAnchor: 'middle', dominantBaseline: 'middle', className: 'radialbarchart-text', style: textStyle }, remainingTextOptions, { children: text }))), legend && ((0, jsx_runtime_1.jsx)(Legend_1.default, Object.assign({ formatter: (value, entry) => ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: 'text-color-darker' }, { children: value }))) }, legendProps))), tooltip && (0, jsx_runtime_1.jsx)(ChartTooltip_1.default, Object.assign({ cursor: { fill: chartHelper_1.CURSOR_BACKGROUND_COLOR } }, tooltipProps))] })) })));
26
+ }) })), range && (0, jsx_runtime_1.jsx)(recharts_1.PolarAngleAxis, { type: 'number', domain: range, angleAxisId: 0, tick: false }), textOptions && ((0, jsx_runtime_1.jsx)("text", Object.assign({ x: width ? width / 2 : '50%', y: height ? height / 2 : '50%', textAnchor: 'middle', dominantBaseline: 'middle', className: 'radialbarchart-text', style: textStyle }, remainingTextOptions, { children: text }))), legend && ((0, jsx_runtime_1.jsx)(recharts_1.Legend, Object.assign({ formatter: (value, entry) => ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: 'text-color-darker' }, { children: value }))) }, legendProps))), tooltip && (0, jsx_runtime_1.jsx)(ChartTooltip_1.default, Object.assign({ cursor: { fill: chartHelper_1.CURSOR_BACKGROUND_COLOR } }, tooltipProps))] })) })));
27
27
  };
28
28
  exports.default = RadialBarChart;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import type { ReferenceLineProps as RechartsReferenceLineProps } from 'recharts';
3
+ export type ReferenceLineProps = Omit<RechartsReferenceLineProps, 'ref'> & {
4
+ stroke?: string;
5
+ };
6
+ declare const Line: React.FC<ReferenceLineProps>;
7
+ export default Line;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const Line = ({ stroke = 'color-coldplay-fountain' }) => null;
4
+ exports.default = Line;
@@ -3,6 +3,7 @@ export type DialogSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full' | 'fullwidth'
3
3
  export type BaseDialogProps = {
4
4
  /**
5
5
  * Opens the dialog when set to `true`.
6
+ *
6
7
  * @default false
7
8
  */
8
9
  show: boolean;
@@ -16,6 +17,7 @@ export type BaseDialogProps = {
16
17
  subtitle?: React.ReactNode;
17
18
  /**
18
19
  * Shows a close button when set to `true`.
20
+ *
19
21
  * @default true
20
22
  */
21
23
  showCloseButton?: boolean;
@@ -25,24 +27,29 @@ export type BaseDialogProps = {
25
27
  onClose?: () => void;
26
28
  /**
27
29
  * Defined how large the dialog will be rendered.
28
- * By default, the dialog has a medium size and thus it can be omitted.
30
+ *
31
+ * By default, the dialog has a medium size, and thus it can be omitted.
29
32
  *
30
33
  * Possible values are: `xs`, `sm`, `lg` `xl` `fullwidth` `fullheight` `fullscreen`
34
+ *
31
35
  * @default 'md'
32
36
  */
33
37
  bsSize?: DialogSize;
34
38
  /**
35
39
  * Enables or disabled closing the dialog via esc key.
40
+ *
36
41
  * @default false
37
42
  */
38
43
  disableEsc?: boolean;
39
44
  /**
40
45
  * Enables the modal body to overflow and use inline scrolling if needed.
46
+ *
41
47
  * @default false
42
48
  */
43
49
  useOverflow?: boolean;
44
50
  /**
45
51
  * Show Header and Footer Borders for the "xs" dialog
52
+ *
46
53
  * @default false
47
54
  */
48
55
  showXsDialogBorders?: boolean;
@@ -74,6 +81,7 @@ export type DialogProps = BaseDialogProps & {
74
81
  headerButtons?: React.ReactNode;
75
82
  /**
76
83
  * Deprecate to align with other dialog callbacks.
84
+ *
77
85
  * @deprecated please use `onClose`
78
86
  */
79
87
  onHide?: VoidFunction;
@@ -82,9 +90,9 @@ export type DialogProps = BaseDialogProps & {
82
90
  */
83
91
  onEsc?: VoidFunction;
84
92
  /**
85
- * A callback function to be executed before closing the dialog. If the function returns
86
- * `false` the dialog will not be closed
87
- * @returns
93
+ * A callback function to be executed before closing the dialog.
94
+ *
95
+ * If the function returns `false`, the dialog will not be closed
88
96
  */
89
97
  onCloseValidation?: () => boolean;
90
98
  };
@@ -26,9 +26,9 @@ export type SplitDialogProps = BaseDialogProps & {
26
26
  */
27
27
  footerClassName?: string;
28
28
  /**
29
- * A callback function to be executed before closing the dialog. If the function returns
30
- * `false` the dialog will not be closed
31
- * @returns
29
+ * A callback function to be executed before closing the dialog.
30
+ *
31
+ * If the function returns `false`, the dialog will not be closed
32
32
  */
33
33
  onCloseValidation?: () => boolean;
34
34
  };
@@ -117,5 +117,7 @@ export type ButtonDropdownProps = {
117
117
  */
118
118
  className?: string;
119
119
  };
120
- declare const ButtonDropdown: (props: ButtonDropdownProps) => import("react/jsx-runtime").JSX.Element;
120
+ declare const ButtonDropdown: React.ForwardRefExoticComponent<ButtonDropdownProps & {
121
+ children?: React.ReactNode;
122
+ } & React.RefAttributes<HTMLButtonElement>>;
121
123
  export default ButtonDropdown;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ // biome-ignore lint/style/useImportType: <explanation>
5
6
  const react_1 = require("react");
6
7
  const react_dom_1 = tslib_1.__importDefault(require("react-dom"));
7
8
  const react_popper_1 = require("react-popper");
@@ -27,8 +28,8 @@ const getPlacement = (pullRight, dropup) => {
27
28
  }
28
29
  return 'bottom-start';
29
30
  };
30
- const ButtonDropdown = (props) => {
31
- const { id = Math.random().toString(36).substr(2, 16), items = [], bsSize = 'md', bsStyle = 'default', variant, disabled = false, iconOnly = false, title, splitButton = false, customDropdown, open, dropup = false, pullRight = false, noCaret = false, onOpen = noop_1.default, onClose = noop_1.default, onLabelButtonClick = noop_1.default, usePortal = false, popperConfig, toggleClassName = '', dropdownClassName, className = '' } = props, remainingProps = tslib_1.__rest(props, ["id", "items", "bsSize", "bsStyle", "variant", "disabled", "iconOnly", "title", "splitButton", "customDropdown", "open", "dropup", "pullRight", "noCaret", "onOpen", "onClose", "onLabelButtonClick", "usePortal", "popperConfig", "toggleClassName", "dropdownClassName", "className"]);
31
+ const ButtonDropdown = (0, react_1.forwardRef)((props, ref) => {
32
+ const { id = Math.random().toString(36).slice(2, 16), items = [], bsSize = 'md', bsStyle = 'default', variant, disabled = false, iconOnly = false, title, splitButton = false, customDropdown, open, dropup = false, pullRight = false, noCaret = false, onOpen = noop_1.default, onClose = noop_1.default, onLabelButtonClick = noop_1.default, usePortal = false, popperConfig, toggleClassName = '', dropdownClassName, className = '' } = props, remainingProps = tslib_1.__rest(props, ["id", "items", "bsSize", "bsStyle", "variant", "disabled", "iconOnly", "title", "splitButton", "customDropdown", "open", "dropup", "pullRight", "noCaret", "onOpen", "onClose", "onLabelButtonClick", "usePortal", "popperConfig", "toggleClassName", "dropdownClassName", "className"]);
32
33
  const [internalOpen, setInternalOpen] = (0, react_1.useState)(open);
33
34
  const [refDropdownToggle, setRefDropdownToggle] = (0, react_1.useState)(null);
34
35
  const [refDropdownMenu, setRefDropdownMenu] = (0, react_1.useState)(null);
@@ -91,6 +92,6 @@ const ButtonDropdown = (props) => {
91
92
  const wrapperClasses = (0, classnames_1.default)('dropdown', 'btn-group', isOpen && 'open', className);
92
93
  const dropdownClasses = (0, classnames_1.default)(usePortal && 'dropdown-portal', splitButton && pullRight && 'pull-right', dropdownClassName);
93
94
  const dropdownMenu = ((0, jsx_runtime_1.jsx)(MenuItemList_1.default, Object.assign({ className: dropdownClasses, ref: setRefDropdownMenu, style: styles.popper }, attributes.popper, { children: customDropdown ? customDropdown : (0, jsx_runtime_1.jsx)(MenuItems_1.default, { items: items, closeMenu: toggleOpen }) })));
94
- return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, remainingProps, { className: wrapperClasses, ref: wrapperRef }, { children: [(0, jsx_runtime_1.jsx)(DropdownToggleButton_1.default, Object.assign({ id: id, splitButton: splitButton, bsStyle: bsStyle, bsSize: bsSize, variant: variant, iconOnly: iconOnly, disabled: disabled, ref: setRefDropdownToggle, onClick: handleDropdownButtonClick, className: toggleClassName }, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [title, shouldShowCaret && (0, jsx_runtime_1.jsx)(Caret_1.default, {})] }) })), splitButton && ((0, jsx_runtime_1.jsx)(SplitCaretButton_1.default, { id: id, bsStyle: bsStyle, bsSize: bsSize, disabled: disabled, className: toggleClassName, onClick: toggleOpen, ref: setRefSplitButtonToggle })), isOpen && usePortal && react_dom_1.default.createPortal(dropdownMenu, dropdownRoot), isOpen && !usePortal && dropdownMenu] })));
95
- };
95
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, remainingProps, { className: wrapperClasses, ref: wrapperRef }, { children: [(0, jsx_runtime_1.jsx)(DropdownToggleButton_1.default, Object.assign({ id: id, splitButton: splitButton, bsStyle: bsStyle, bsSize: bsSize, variant: variant, iconOnly: iconOnly, disabled: disabled, ref: setRefDropdownToggle, onClick: handleDropdownButtonClick, outerRef: ref, className: toggleClassName }, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [title, shouldShowCaret && (0, jsx_runtime_1.jsx)(Caret_1.default, {})] }) })), splitButton && ((0, jsx_runtime_1.jsx)(SplitCaretButton_1.default, { id: id, bsStyle: bsStyle, bsSize: bsSize, disabled: disabled, className: toggleClassName, onClick: toggleOpen, ref: setRefSplitButtonToggle })), isOpen && usePortal && react_dom_1.default.createPortal(dropdownMenu, dropdownRoot), isOpen && !usePortal && dropdownMenu] })));
96
+ });
96
97
  exports.default = ButtonDropdown;
@@ -9,6 +9,7 @@ export type DropdownToggleButtonProps = HTMLProps<HTMLButtonElement> & {
9
9
  bsSize: BUTTON_SIZE;
10
10
  bsStyle: BUTTON_STYLE;
11
11
  variant?: BUTTON_VARIANT;
12
+ outerRef?: React.Ref<HTMLButtonElement>;
12
13
  className?: string;
13
14
  };
14
15
  declare const DropdownToggleButton: React.ForwardRefExoticComponent<Omit<React.PropsWithChildren<DropdownToggleButtonProps>, "ref"> & React.RefAttributes<HTMLButtonElement>>;