@rio-cloud/rio-uikit 1.4.0 → 1.5.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 (174) hide show
  1. package/.DS_Store +0 -0
  2. package/FadeExpander.d.ts +2 -0
  3. package/FadeExpander.js +2 -0
  4. package/FadeUp.d.ts +2 -0
  5. package/FadeUp.js +2 -0
  6. package/XAxis.d.ts +2 -0
  7. package/XAxis.js +2 -0
  8. package/YAxis.d.ts +2 -0
  9. package/YAxis.js +2 -0
  10. package/components/applicationLayout/ApplicationLayoutBody.d.ts +5 -0
  11. package/components/applicationLayout/ApplicationLayoutBody.js +10 -1
  12. package/components/charts/Area.d.ts +11 -3
  13. package/components/charts/Area.js +9 -1
  14. package/components/charts/AreaChart.d.ts +4 -3
  15. package/components/charts/AreaChart.js +9 -8
  16. package/components/charts/Bar.d.ts +6 -2
  17. package/components/charts/Bar.js +3 -4
  18. package/components/charts/BarChart.d.ts +2 -1
  19. package/components/charts/BarChart.js +8 -4
  20. package/components/charts/ComposedChart.d.ts +6 -5
  21. package/components/charts/ComposedChart.js +16 -11
  22. package/components/charts/Legend.js +1 -1
  23. package/components/charts/Line.d.ts +11 -3
  24. package/components/charts/Line.js +9 -1
  25. package/components/charts/LineChart.d.ts +6 -4
  26. package/components/charts/LineChart.js +10 -9
  27. package/components/charts/ReferenceLine.d.ts +8 -4
  28. package/components/charts/ReferenceLine.js +18 -2
  29. package/components/charts/XAxis.d.ts +7 -0
  30. package/components/charts/XAxis.js +18 -0
  31. package/components/charts/YAxis.d.ts +5 -0
  32. package/components/charts/YAxis.js +2 -0
  33. package/components/collapse/Collapse.js +3 -2
  34. package/components/dropdown/ButtonDropdown.d.ts +3 -1
  35. package/components/dropdown/ButtonDropdown.js +6 -5
  36. package/components/dropdown/DropdownToggleButton.d.ts +1 -0
  37. package/components/dropdown/DropdownToggleButton.js +4 -2
  38. package/components/fade/FadeExpander.d.ts +27 -0
  39. package/components/fade/FadeExpander.js +41 -0
  40. package/components/fade/FadeUp.d.ts +27 -0
  41. package/components/fade/FadeUp.js +28 -0
  42. package/components/listMenu/ListMenu.d.ts +7 -0
  43. package/components/listMenu/ListMenu.js +6 -3
  44. package/components/map/components/features/Route.d.ts +13 -2
  45. package/components/map/components/features/Route.js +19 -11
  46. package/components/map/components/features/basics/Polygon.d.ts +1 -0
  47. package/components/map/components/features/basics/Polygon.js +1 -0
  48. package/components/map/components/features/basics/Polyline.d.ts +3 -1
  49. package/components/map/components/features/basics/Polyline.js +5 -16
  50. package/components/map/components/features/basics/polygonColors.d.ts +252 -0
  51. package/components/map/components/features/basics/polygonColors.js +252 -0
  52. package/components/map/utils/mapTypes.d.ts +1 -1
  53. package/components/map/utils/mapTypes.js +2 -0
  54. package/components/mapMarker/SingleMapMarker.d.ts +3 -2
  55. package/components/mapMarker/SingleMapMarker.js +3 -3
  56. package/components/selects/BaseSelectDropdown.d.ts +0 -1
  57. package/components/selects/BaseSelectDropdown.js +7 -1
  58. package/components/selects/Multiselect.js +1 -4
  59. package/components/selects/Select.d.ts +1 -1
  60. package/components/selects/Select.js +1 -4
  61. package/components/smoothScrollbars/SmoothScrollbars.js +28 -3
  62. package/components/switch/Switch.d.ts +6 -5
  63. package/components/switch/Switch.js +5 -5
  64. package/components/tag/Tag.d.ts +2 -2
  65. package/components/tag/Tag.js +5 -6
  66. package/hooks/useDOMNodeCount.d.ts +2 -0
  67. package/hooks/useDOMNodeCount.js +29 -0
  68. package/hooks/useEventListenerCount.d.ts +5 -0
  69. package/hooks/useEventListenerCount.js +42 -0
  70. package/hooks/useSorting.d.ts +29 -0
  71. package/hooks/useSorting.js +41 -0
  72. package/lib/es/FadeExpander.d.ts +2 -0
  73. package/lib/es/FadeExpander.js +7 -0
  74. package/lib/es/FadeUp.d.ts +2 -0
  75. package/lib/es/FadeUp.js +7 -0
  76. package/lib/es/XAxis.d.ts +2 -0
  77. package/lib/es/XAxis.js +7 -0
  78. package/lib/es/YAxis.d.ts +2 -0
  79. package/lib/es/YAxis.js +7 -0
  80. package/lib/es/components/applicationLayout/ApplicationLayoutBody.d.ts +5 -0
  81. package/lib/es/components/applicationLayout/ApplicationLayoutBody.js +10 -1
  82. package/lib/es/components/charts/Area.d.ts +11 -3
  83. package/lib/es/components/charts/Area.js +11 -1
  84. package/lib/es/components/charts/AreaChart.d.ts +4 -3
  85. package/lib/es/components/charts/AreaChart.js +8 -7
  86. package/lib/es/components/charts/Bar.d.ts +6 -2
  87. package/lib/es/components/charts/Bar.js +5 -4
  88. package/lib/es/components/charts/BarChart.d.ts +2 -1
  89. package/lib/es/components/charts/BarChart.js +7 -3
  90. package/lib/es/components/charts/ComposedChart.d.ts +6 -5
  91. package/lib/es/components/charts/ComposedChart.js +15 -10
  92. package/lib/es/components/charts/Legend.js +1 -1
  93. package/lib/es/components/charts/Line.d.ts +11 -3
  94. package/lib/es/components/charts/Line.js +11 -1
  95. package/lib/es/components/charts/LineChart.d.ts +6 -4
  96. package/lib/es/components/charts/LineChart.js +9 -8
  97. package/lib/es/components/charts/ReferenceLine.d.ts +8 -4
  98. package/lib/es/components/charts/ReferenceLine.js +21 -2
  99. package/lib/es/components/charts/XAxis.d.ts +7 -0
  100. package/lib/es/components/charts/XAxis.js +23 -0
  101. package/lib/es/components/charts/YAxis.d.ts +5 -0
  102. package/lib/es/components/charts/YAxis.js +4 -0
  103. package/lib/es/components/collapse/Collapse.js +3 -2
  104. package/lib/es/components/dropdown/ButtonDropdown.d.ts +3 -1
  105. package/lib/es/components/dropdown/ButtonDropdown.js +5 -4
  106. package/lib/es/components/dropdown/DropdownToggleButton.d.ts +1 -0
  107. package/lib/es/components/dropdown/DropdownToggleButton.js +4 -2
  108. package/lib/es/components/fade/FadeExpander.d.ts +27 -0
  109. package/lib/es/components/fade/FadeExpander.js +43 -0
  110. package/lib/es/components/fade/FadeUp.d.ts +27 -0
  111. package/lib/es/components/fade/FadeUp.js +30 -0
  112. package/lib/es/components/listMenu/ListMenu.d.ts +7 -0
  113. package/lib/es/components/listMenu/ListMenu.js +6 -3
  114. package/lib/es/components/map/components/features/Route.d.ts +13 -2
  115. package/lib/es/components/map/components/features/Route.js +20 -12
  116. package/lib/es/components/map/components/features/basics/Polygon.d.ts +1 -0
  117. package/lib/es/components/map/components/features/basics/Polygon.js +10 -0
  118. package/lib/es/components/map/components/features/basics/Polyline.d.ts +3 -1
  119. package/lib/es/components/map/components/features/basics/Polyline.js +5 -16
  120. package/lib/es/components/map/components/features/basics/polygonColors.d.ts +252 -0
  121. package/lib/es/components/map/components/features/basics/polygonColors.js +255 -0
  122. package/lib/es/components/map/utils/mapTypes.d.ts +1 -1
  123. package/lib/es/components/map/utils/mapTypes.js +2 -0
  124. package/lib/es/components/mapMarker/SingleMapMarker.d.ts +3 -2
  125. package/lib/es/components/mapMarker/SingleMapMarker.js +3 -3
  126. package/lib/es/components/selects/BaseSelectDropdown.d.ts +0 -1
  127. package/lib/es/components/selects/BaseSelectDropdown.js +6 -0
  128. package/lib/es/components/selects/Multiselect.js +1 -4
  129. package/lib/es/components/selects/Select.d.ts +1 -1
  130. package/lib/es/components/selects/Select.js +1 -4
  131. package/lib/es/components/smoothScrollbars/SmoothScrollbars.js +27 -2
  132. package/lib/es/components/switch/Switch.d.ts +6 -5
  133. package/lib/es/components/switch/Switch.js +5 -5
  134. package/lib/es/components/tag/Tag.d.ts +2 -2
  135. package/lib/es/components/tag/Tag.js +5 -6
  136. package/lib/es/hooks/useDOMNodeCount.d.ts +2 -0
  137. package/lib/es/hooks/useDOMNodeCount.js +31 -0
  138. package/lib/es/hooks/useEventListenerCount.d.ts +5 -0
  139. package/lib/es/hooks/useEventListenerCount.js +45 -0
  140. package/lib/es/hooks/useSorting.d.ts +29 -0
  141. package/lib/es/hooks/useSorting.js +43 -0
  142. package/lib/es/storageUtils.d.ts +1 -0
  143. package/lib/es/storageUtils.js +4 -0
  144. package/lib/es/styles/variables/colors/colors.json +4 -3
  145. package/lib/es/urlFeatureToggles.d.ts +1 -0
  146. package/lib/es/urlFeatureToggles.js +4 -0
  147. package/lib/es/useDOMNodeCount.d.ts +2 -0
  148. package/lib/es/useDOMNodeCount.js +7 -0
  149. package/lib/es/useEventListenerCount.d.ts +2 -0
  150. package/lib/es/useEventListenerCount.js +7 -0
  151. package/lib/es/useSorting.d.ts +2 -0
  152. package/lib/es/useSorting.js +7 -0
  153. package/lib/es/utils/storageUtils.d.ts +5 -0
  154. package/lib/es/utils/storageUtils.js +32 -0
  155. package/lib/es/utils/urlFeatureToggles.d.ts +10 -0
  156. package/lib/es/utils/urlFeatureToggles.js +41 -0
  157. package/lib/es/version.json +1 -1
  158. package/package.json +4 -1
  159. package/storageUtils.d.ts +1 -0
  160. package/storageUtils.js +1 -0
  161. package/styles/variables/colors/colors.json +4 -3
  162. package/urlFeatureToggles.d.ts +1 -0
  163. package/urlFeatureToggles.js +1 -0
  164. package/useDOMNodeCount.d.ts +2 -0
  165. package/useDOMNodeCount.js +2 -0
  166. package/useEventListenerCount.d.ts +2 -0
  167. package/useEventListenerCount.js +2 -0
  168. package/useSorting.d.ts +2 -0
  169. package/useSorting.js +2 -0
  170. package/utils/storageUtils.d.ts +5 -0
  171. package/utils/storageUtils.js +29 -0
  172. package/utils/urlFeatureToggles.d.ts +10 -0
  173. package/utils/urlFeatureToggles.js +32 -0
  174. package/version.json +1 -1
@@ -10,23 +10,28 @@ 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
12
  const Legend_1 = require("./Legend");
13
+ const XAxis_1 = require("./XAxis");
14
+ const Bar_1 = require("./Bar");
15
+ const ReferenceLine_1 = require("./ReferenceLine");
16
+ const Line_1 = require("./Line");
17
+ const Area_1 = require("./Area");
13
18
  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"]);
19
+ const { width, height, data = [], dataUnit = '', dataKey = 'value', lines = [], bars = [], areas = [], referenceLines = [], xAxisOptions, yAxisOptions, additionalAxes = [], 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", "additionalAxes", "gridOptions", "containerOptions", "showXAxis", "showYAxis", "showGrid", "legend", "brush", "tooltip"]);
15
20
  const tooltipProps = (0, isObject_1.default)(tooltip) ? tooltip.props : {};
16
21
  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"]);
22
+ 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)), additionalAxes.map(XAxis_1.renderAxis), 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 => {
23
+ const areaPropsWithDefault = Object.assign(Object.assign({}, (0, Area_1.getAreaDefaultProps)()), area.props);
24
+ const { strokeColor, fill } = areaPropsWithDefault, remainingAreaProps = tslib_1.__rest(areaPropsWithDefault, ["strokeColor", "fill"]);
19
25
  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
26
  }), bars.map(bar => {
21
- const _a = bar.props, { color } = _a, remainingBarProps = tslib_1.__rest(_a, ["color"]);
27
+ const barPropsWithDefault = Object.assign(Object.assign({}, (0, Bar_1.getBarDefaultProps)()), bar.props);
28
+ const { color } = barPropsWithDefault, remainingBarProps = tslib_1.__rest(barPropsWithDefault, ["color"]);
22
29
  const cellColor = color && (0, chartHelper_1.getColor)(color);
23
30
  return (0, jsx_runtime_1.jsx)(recharts_1.Bar, Object.assign({ unit: dataUnit }, remainingBarProps, { fill: cellColor }), bar.key);
24
31
  }), 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') })] })) })));
32
+ const linePropsWithDefault = Object.assign(Object.assign({}, (0, Line_1.getLineDefaultProps)()), line.props);
33
+ const { strokeColor } = linePropsWithDefault, remainingLineProps = tslib_1.__rest(linePropsWithDefault, ["strokeColor"]);
34
+ return ((0, react_1.createElement)(recharts_1.Line, Object.assign({}, remainingLineProps, { key: line.key, stroke: (0, chartHelper_1.getColor)(strokeColor) })));
35
+ }), referenceLines.map(ReferenceLine_1.renderReferenceLine), brush && (0, jsx_runtime_1.jsx)(recharts_1.Brush, { stroke: (0, chartHelper_1.getColor)('gray') })] })) })));
31
36
  };
32
37
  exports.default = ComposedChart;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getLegendDefaultProps = void 0;
4
- // @ts-ignore-next-line importsNotUsedAsValues
4
+ // @ts-ignore importsNotUsedAsValues
5
5
  require("react");
6
6
  const getLegendDefaultProps = () => ({
7
7
  iconType: 'circle',
@@ -1,12 +1,20 @@
1
- /// <reference types="react" />
2
1
  import type { LineProps as RechartsLineProps } from 'recharts';
2
+ import type { CurveType } from 'recharts/types/shape/Curve';
3
3
  export type LineProps = Omit<RechartsLineProps, 'ref'> & {
4
4
  strokeColor?: string;
5
5
  dataKey?: string;
6
6
  unit?: string;
7
7
  legendType?: string;
8
- type?: string;
8
+ type?: CurveType;
9
9
  isAnimationActive?: boolean;
10
10
  };
11
- declare const Line: React.FC<LineProps>;
11
+ export declare const getLineDefaultProps: () => {
12
+ dataKey: string;
13
+ unit: string;
14
+ strokeColor: string;
15
+ legendType: string;
16
+ type: string;
17
+ isAnimationActive: boolean;
18
+ };
19
+ declare const Line: (props: LineProps) => null;
12
20
  export default Line;
@@ -1,4 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const Line = ({ dataKey = 'value', unit = '', strokeColor = 'color-coldplay-fountain', legendType = 'square', type = 'monotone', isAnimationActive = true, }) => null;
3
+ exports.getLineDefaultProps = void 0;
4
+ const getLineDefaultProps = () => ({
5
+ dataKey: 'value',
6
+ unit: '',
7
+ strokeColor: 'color-coldplay-fountain',
8
+ legendType: 'square',
9
+ type: 'monotone',
10
+ isAnimationActive: true,
11
+ });
12
+ exports.getLineDefaultProps = getLineDefaultProps;
13
+ const Line = (props) => null;
4
14
  exports.default = Line;
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- import { LineChart as RechartsLineChart, type XAxisProps, type YAxisProps } from 'recharts';
3
- import { ChartTooltipProps } from './ChartTooltip';
2
+ import { LineChart as RechartsLineChart, type XAxisProps, type YAxisProps, type BrushProps } from 'recharts';
3
+ import { type ChartTooltipProps } from './ChartTooltip';
4
4
  import { type LegendProps } from './Legend';
5
- import type { LineProps } from './Line';
6
- import type { ReferenceLineProps } from './ReferenceLine';
5
+ import { type LineProps } from './Line';
6
+ import { type ReferenceLineProps } from './ReferenceLine';
7
7
  import type { GridProps } from './ChartGrid';
8
8
  import type { ResponsiveContainerProps } from './ResponsiveContainer';
9
9
  type RechartsLineChartProps = React.ComponentProps<typeof RechartsLineChart>;
@@ -17,6 +17,7 @@ export type LineChartProps<T extends object> = Omit<RechartsLineChartProps, 'dat
17
17
  referenceLines?: React.ReactElement<ReferenceLineProps>[];
18
18
  xAxisOptions?: XAxisProps;
19
19
  yAxisOptions?: YAxisProps;
20
+ additionalAxes?: React.ReactElement<XAxisProps | YAxisProps>[];
20
21
  gridOptions?: GridProps;
21
22
  containerOptions?: ResponsiveContainerProps;
22
23
  showXAxis?: boolean;
@@ -25,6 +26,7 @@ export type LineChartProps<T extends object> = Omit<RechartsLineChartProps, 'dat
25
26
  legend?: React.ReactElement<LegendProps> | boolean;
26
27
  tooltip?: React.ReactElement<ChartTooltipProps> | boolean;
27
28
  brush?: boolean;
29
+ brushOptions?: BrushProps;
28
30
  };
29
31
  declare const LineChart: <T extends object>(props: LineChartProps<T>) => import("react/jsx-runtime").JSX.Element;
30
32
  export default LineChart;
@@ -10,16 +10,17 @@ 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
12
  const Legend_1 = require("./Legend");
13
+ const XAxis_1 = require("./XAxis");
14
+ const Line_1 = require("./Line");
15
+ const ReferenceLine_1 = require("./ReferenceLine");
13
16
  const LineChart = (props) => {
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"]);
17
+ const { width, height, data = [], dataUnit = '', dataKey = 'value', lines = [], referenceLines = [], xAxisOptions, yAxisOptions, gridOptions, containerOptions, showXAxis = true, showYAxis = false, additionalAxes = [], showGrid = false, legend, brush = false, tooltip = true, brushOptions = {} } = props, remainingProps = tslib_1.__rest(props, ["width", "height", "data", "dataUnit", "dataKey", "lines", "referenceLines", "xAxisOptions", "yAxisOptions", "gridOptions", "containerOptions", "showXAxis", "showYAxis", "additionalAxes", "showGrid", "legend", "brush", "tooltip", "brushOptions"]);
15
18
  const tooltipProps = (0, isObject_1.default)(tooltip) ? tooltip.props : {};
16
19
  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
- const _a = line.props, { strokeColor } = _a, remainingLineProps = tslib_1.__rest(_a, ["strokeColor"]);
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) })));
23
- }), brush && (0, jsx_runtime_1.jsx)(recharts_1.Brush, { stroke: (0, chartHelper_1.getColor)('gray') })] })) })));
20
+ 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)), additionalAxes.map(XAxis_1.renderAxis), 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 => {
21
+ const linePropsWithDefault = Object.assign(Object.assign({}, (0, Line_1.getLineDefaultProps)()), line.props);
22
+ const { strokeColor } = linePropsWithDefault, remainingLineProps = tslib_1.__rest(linePropsWithDefault, ["strokeColor"]);
23
+ return ((0, react_1.createElement)(recharts_1.Line, Object.assign({}, remainingLineProps, { key: line.key, stroke: (0, chartHelper_1.getColor)(strokeColor) })));
24
+ }), referenceLines.map(ReferenceLine_1.renderReferenceLine), brush && (0, jsx_runtime_1.jsx)(recharts_1.Brush, Object.assign({}, brushOptions, { stroke: (0, chartHelper_1.getColor)('gray') }))] })) })));
24
25
  };
25
26
  exports.default = LineChart;
@@ -1,7 +1,11 @@
1
- /// <reference types="react" />
2
- import type { ReferenceLineProps as RechartsReferenceLineProps } from 'recharts';
1
+ import React from 'react';
2
+ import { type ReferenceLineProps as RechartsReferenceLineProps } from 'recharts';
3
3
  export type ReferenceLineProps = Omit<RechartsReferenceLineProps, 'ref'> & {
4
4
  stroke?: string;
5
5
  };
6
- declare const Line: React.FC<ReferenceLineProps>;
7
- export default Line;
6
+ export declare const getReferenceLineDefaultProps: () => {
7
+ stroke: string;
8
+ };
9
+ export declare const renderReferenceLine: (element: React.ReactElement<ReferenceLineProps>) => import("react/jsx-runtime").JSX.Element;
10
+ declare const ReferenceLine: (props: ReferenceLineProps) => null;
11
+ export default ReferenceLine;
@@ -1,4 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const Line = ({ stroke = 'color-coldplay-fountain' }) => null;
4
- exports.default = Line;
3
+ exports.renderReferenceLine = exports.getReferenceLineDefaultProps = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const react_1 = require("react");
6
+ // @ts-ignore-next-line importsNotUsedAsValues
7
+ require("react");
8
+ const recharts_1 = require("recharts");
9
+ const chartHelper_1 = require("./chartHelper");
10
+ const getReferenceLineDefaultProps = () => ({
11
+ stroke: 'color-coldplay-fountain',
12
+ });
13
+ exports.getReferenceLineDefaultProps = getReferenceLineDefaultProps;
14
+ const renderReferenceLine = (element) => {
15
+ const referenceLinePropsWithDefault = Object.assign(Object.assign({}, (0, exports.getReferenceLineDefaultProps)()), element.props);
16
+ const { stroke } = referenceLinePropsWithDefault, remainingReferenceLineProps = tslib_1.__rest(referenceLinePropsWithDefault, ["stroke"]);
17
+ return (0, react_1.createElement)(recharts_1.ReferenceLine, Object.assign({}, remainingReferenceLineProps, { key: element.key, stroke: (0, chartHelper_1.getColor)(stroke) }));
18
+ };
19
+ exports.renderReferenceLine = renderReferenceLine;
20
+ // This is only used for passing this as prop to the UIKIT charts wrapper.
21
+ // Recharts component need to be direct children of the chart itself and cannot be wrapped again
22
+ const ReferenceLine = (props) => null;
23
+ exports.default = ReferenceLine;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { type XAxisProps as XAxisPropsProps } from 'recharts';
3
+ import { type YAxisProps } from './YAxis';
4
+ export type XAxisProps = Partial<XAxisPropsProps> & {};
5
+ export declare const renderAxis: (axis: React.ReactElement<XAxisProps | YAxisProps>, index: number) => import("react/jsx-runtime").JSX.Element | null;
6
+ declare const XAxis: React.FC<XAxisProps>;
7
+ export default XAxis;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.renderAxis = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const react_1 = tslib_1.__importDefault(require("react"));
7
+ const recharts_1 = require("recharts");
8
+ const YAxis_1 = tslib_1.__importDefault(require("./YAxis"));
9
+ const renderAxis = (axis, index) => {
10
+ const key = `additional-axis-${index}`;
11
+ if (react_1.default.isValidElement(axis)) {
12
+ if (axis.type === XAxis) {
13
+ return (0, jsx_runtime_1.jsx)(recharts_1.XAxis, Object.assign({}, axis.props), key);
14
+ }
15
+ if (axis.type === YAxis_1.default) {
16
+ return (0, jsx_runtime_1.jsx)(recharts_1.YAxis, Object.assign({}, axis.props), key);
17
+ }
18
+ }
19
+ return null;
20
+ };
21
+ exports.renderAxis = renderAxis;
22
+ const XAxis = props => null;
23
+ exports.default = XAxis;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import type { YAxisProps as YAxisPropsProps } from 'recharts';
3
+ export type YAxisProps = Omit<YAxisPropsProps, 'ref'> & {};
4
+ declare const YAxis: React.FC<YAxisProps>;
5
+ export default YAxis;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const YAxis = props => null;
4
+ exports.default = YAxis;
@@ -6,7 +6,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  require("react");
7
7
  const framer_motion_1 = require("framer-motion");
8
8
  const noop_1 = tslib_1.__importDefault(require("lodash/fp/noop"));
9
- const DEFAULT_ANIMATION_TIME_IN_MS = 270;
9
+ const DEFAULT_ANIMATION_TIME_IN_MS = 200;
10
10
  const Collapse = (props) => {
11
11
  const { open = false, unmountOnExit = false, appear = false, timeout = DEFAULT_ANIMATION_TIME_IN_MS, onEntered = noop_1.default, onExited = noop_1.default, onAnimationStart = noop_1.default, children, } = props;
12
12
  const shouldKeepContentInDom = !unmountOnExit;
@@ -23,6 +23,7 @@ const Collapse = (props) => {
23
23
  open: { opacity: 1, height: 'auto' },
24
24
  collapsed: { opacity: 0, height: 0 },
25
25
  };
26
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, Object.assign({ initial: appear, exitBeforeEnter: true }, { children: (open || shouldKeepContentInDom) && ((0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, Object.assign({ initial: 'collapsed', animate: open ? 'open' : 'collapsed', exit: 'collapsed', className: 'collapse display-block width-100pct', variants: variants, transition: { duration: timeout / 1000, ease: [0.04, 0.62, 0.23, 0.98] }, onAnimationComplete: handleAnimationComplete, onAnimationStart: handleAnimationStart }, { children: children }), 'content')) })) }));
26
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, Object.assign({ initial: appear, exitBeforeEnter: true }, { children: (open || shouldKeepContentInDom) && ((0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, Object.assign({ initial: 'collapsed', animate: open ? 'open' : 'collapsed', exit: 'collapsed', className: 'collapse display-block width-100pct', variants: variants, transition: { duration: timeout / 1000, ease: 'easeIn' }, onAnimationComplete: handleAnimationComplete, onAnimationStart: handleAnimationStart }, { children: children }), 'content')) })) }));
27
27
  };
28
+ //
28
29
  exports.default = Collapse;
@@ -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>>;
@@ -5,9 +5,11 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const classnames_1 = tslib_1.__importDefault(require("classnames"));
7
7
  const Button_1 = tslib_1.__importDefault(require("../button/Button"));
8
+ const useMergeRefs_1 = tslib_1.__importDefault(require("../../hooks/useMergeRefs"));
8
9
  const DropdownToggleButton = (0, react_1.forwardRef)((props, ref) => {
9
- const { id, disabled, bsSize, bsStyle, variant, splitButton = false, onClick, className = '', children } = props, remainingProps = tslib_1.__rest(props, ["id", "disabled", "bsSize", "bsStyle", "variant", "splitButton", "onClick", "className", "children"]);
10
+ const { id, disabled, bsSize, bsStyle, variant, splitButton = false, onClick, className = '', children, outerRef } = props, remainingProps = tslib_1.__rest(props, ["id", "disabled", "bsSize", "bsStyle", "variant", "splitButton", "onClick", "className", "children", "outerRef"]);
11
+ const toggleRef = (0, useMergeRefs_1.default)(outerRef, ref);
10
12
  const labelButtonClasses = (0, classnames_1.default)(!splitButton && 'dropdown-toggle', !splitButton && className);
11
- return ((0, jsx_runtime_1.jsx)(Button_1.default, Object.assign({}, remainingProps, { id: splitButton ? `button-${id}` : id, type: 'button', ref: ref, disabled: disabled, bsStyle: bsStyle, bsSize: bsSize, variant: variant, onClick: onClick, className: labelButtonClasses }, { children: children })));
13
+ return ((0, jsx_runtime_1.jsx)(Button_1.default, Object.assign({}, remainingProps, { id: splitButton ? `button-${id}` : id, type: 'button', ref: toggleRef, disabled: disabled, bsStyle: bsStyle, bsSize: bsSize, variant: variant, onClick: onClick, className: labelButtonClasses }, { children: children })));
12
14
  });
13
15
  exports.default = DropdownToggleButton;
@@ -0,0 +1,27 @@
1
+ import { type PropsWithChildren } from 'react';
2
+ type FadeExpanderProps = {
3
+ /**
4
+ * Defines if the content is shown or not.
5
+ *
6
+ * @default false
7
+ */
8
+ show: boolean;
9
+ /**
10
+ * Allows customization of animation duration.
11
+ *
12
+ * @default 0.2
13
+ */
14
+ duration?: number;
15
+ /**
16
+ * Delay in seconds before starting the animation.
17
+ *
18
+ * @default 0
19
+ */
20
+ delay?: number;
21
+ /**
22
+ * Additional classes set to the wrapper element.
23
+ */
24
+ className?: string;
25
+ };
26
+ declare const FadeExpander: (props: PropsWithChildren<FadeExpanderProps>) => import("react/jsx-runtime").JSX.Element;
27
+ export default FadeExpander;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ const react_1 = require("react");
5
+ const framer_motion_1 = require("framer-motion");
6
+ const THRESHOLD_TIMEOUT_MS = 200;
7
+ const FadeExpander = (props) => {
8
+ const { children, show = false, duration = 0.2, delay = 0, className = '' } = props;
9
+ const [isVisible, setIsVisible] = (0, react_1.useState)(show);
10
+ const [overflow, setOverflow] = (0, react_1.useState)('hidden'); // Start with hidden overflow
11
+ const durationRef = (0, react_1.useRef)(duration);
12
+ // Effect to manage visibility based on show prop
13
+ (0, react_1.useEffect)(() => {
14
+ if (show) {
15
+ // Set to visible when show is true
16
+ setIsVisible(true);
17
+ }
18
+ else {
19
+ // Set overflow to hidden immediately when show is false
20
+ setOverflow('hidden');
21
+ // Delay setting isVisible to false so the overflow can change before
22
+ setTimeout(() => {
23
+ setIsVisible(false);
24
+ }, 0);
25
+ }
26
+ }, [show]);
27
+ const handleAnimationComplete = () => {
28
+ if (show) {
29
+ // Set overflow to visible after animation is done
30
+ setTimeout(() => setOverflow('visible'), durationRef.current * 1000 + THRESHOLD_TIMEOUT_MS);
31
+ }
32
+ };
33
+ return (
34
+ // @ts-ignore
35
+ (0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, Object.assign({ onExitComplete: () => setOverflow('hidden') }, { children: isVisible && ((0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, Object.assign({ initial: { height: 0, opacity: 0 }, animate: { height: 'auto', opacity: 1 }, exit: { height: 0, opacity: 0 }, transition: {
36
+ height: { duration, delay },
37
+ opacity: { duration, delay },
38
+ ease: 'easeIn',
39
+ },
40
+ // To ensures smooth height transition, the overflow should be "hidden" during the animation
41
+ style: { overflow }, onAnimationComplete: handleAnimationComplete, className: className }, { children: children }))) })));
42
+ };
43
+ exports.default = FadeExpander;
@@ -0,0 +1,27 @@
1
+ import { type ComponentProps, type PropsWithChildren } from 'react';
2
+ type FadeUpProps = Omit<ComponentProps<'div'>, 'onAnimationStart' | 'onDragStart' | 'onDragEnd' | 'onDrag'> & {
3
+ /**
4
+ * Defines the time the animation should wait until it starts.
5
+ *
6
+ * @default 0
7
+ */
8
+ delay?: number;
9
+ /**
10
+ * Defines the duration in seconds of the fade up animation.
11
+ *
12
+ * @default 0.4
13
+ */
14
+ duration?: number;
15
+ /**
16
+ * Defines the y offset from the bottom where the element starts to fade in.
17
+ *
18
+ * @default 15
19
+ */
20
+ offset?: number;
21
+ /**
22
+ * Additional classes names added to the motion div wrapper.
23
+ */
24
+ className?: string;
25
+ };
26
+ declare const FadeUp: (props: PropsWithChildren<FadeUpProps>) => import("react/jsx-runtime").JSX.Element;
27
+ export default FadeUp;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const framer_motion_1 = require("framer-motion");
7
+ const useOnScreen_1 = tslib_1.__importDefault(require("../../hooks/useOnScreen"));
8
+ const FadeUp = (props) => {
9
+ const { delay = 0, duration = 0.4, className = '', offset = 15, children } = props, remainingProps = tslib_1.__rest(props, ["delay", "duration", "className", "offset", "children"]);
10
+ const ref = (0, react_1.useRef)(null);
11
+ const isInView = (0, useOnScreen_1.default)(ref);
12
+ const [isVisible, setIsVisible] = (0, react_1.useState)(false);
13
+ const variants = {
14
+ hidden: {
15
+ opacity: 0,
16
+ y: offset,
17
+ },
18
+ visible: {
19
+ opacity: 1,
20
+ y: 0,
21
+ },
22
+ };
23
+ (0, react_1.useEffect)(() => {
24
+ if (isInView && !isVisible) {
25
+ setIsVisible(true);
26
+ }
27
+ }, [isInView, isVisible]);
28
+ return ((0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, Object.assign({ ref: ref, variants: variants, initial: 'hidden', animate: isVisible ? 'visible' : 'hidden', transition: { delay, type: 'spring', duration } }, remainingProps, { className: className }, { children: children })));
29
+ };
30
+ exports.default = FadeUp;
@@ -27,6 +27,13 @@ export type ListMenuProps<T extends ListMenuNavItem> = {
27
27
  * The placeholder text for the filter input.
28
28
  */
29
29
  filterPlaceholder?: string;
30
+ /**
31
+ * Gets called when the filter input changes.
32
+ *
33
+ * @param value
34
+ * @returns
35
+ */
36
+ onFilterChange?: (value: string) => void;
30
37
  /**
31
38
  * A localized message to be shown when the filter result is empty.
32
39
  */
@@ -18,7 +18,7 @@ const MOBILE_MAX_WIDTH = 580;
18
18
  const filterMenuItems = (items, value, filterKey) => items.map(item => (Object.assign(Object.assign({}, item), { navItems: item.navItems.filter(navItem => navItem[filterKey].toLowerCase().includes(value.toLowerCase())) })));
19
19
  const hasMenuItems = (items) => items.find(({ navItems }) => !(0, isEmpty_1.default)(navItems));
20
20
  const ListMenu = (props) => {
21
- const { menuItems, focusFilter = false, enableFilter = false, filterPlaceholder, notFoundMessage, className = '', groupClassName = '', responsive = true, autoClose = true, filterKey = 'key', trailingInputAddon } = props, remainingProps = tslib_1.__rest(props, ["menuItems", "focusFilter", "enableFilter", "filterPlaceholder", "notFoundMessage", "className", "groupClassName", "responsive", "autoClose", "filterKey", "trailingInputAddon"]);
21
+ const { menuItems, focusFilter = false, enableFilter = false, filterPlaceholder, onFilterChange = () => { }, notFoundMessage, className = '', groupClassName = '', responsive = true, autoClose = true, filterKey = 'key', trailingInputAddon } = props, remainingProps = tslib_1.__rest(props, ["menuItems", "focusFilter", "enableFilter", "filterPlaceholder", "onFilterChange", "notFoundMessage", "className", "groupClassName", "responsive", "autoClose", "filterKey", "trailingInputAddon"]);
22
22
  const [filterValue, setFilterValue] = (0, react_1.useState)('');
23
23
  const [isMobileMode, setIsMobileMode] = (0, react_1.useState)(false);
24
24
  const [isExpanderOpen, setIsExpanderOpen] = (0, react_1.useState)(false);
@@ -59,7 +59,10 @@ const ListMenu = (props) => {
59
59
  });
60
60
  (0, react_1.useLayoutEffect)(() => buildMobileHeader, [menuItems]);
61
61
  const handleClear = () => focusFilter && focusInput();
62
- const handleFilterChange = (value) => setFilterValue(value);
62
+ const handleFilterChange = (value) => {
63
+ setFilterValue(value);
64
+ onFilterChange(value);
65
+ };
63
66
  const filteredMenuItems = filterMenuItems(menuItems, filterValue, filterKey);
64
67
  const handleExpanderBodyClick = (event) => {
65
68
  var _a;
@@ -68,7 +71,7 @@ const ListMenu = (props) => {
68
71
  setIsExpanderOpen(false);
69
72
  }
70
73
  };
71
- const formClassNames = (0, classnames_1.default)('form-group', 'margin-top-5', 'margin-bottom-5', 'padding-left-15', 'padding-right-15', 'padding-bottom-15', 'position-sticky', 'top-0');
74
+ const formClassNames = (0, classnames_1.default)('form-group', 'margin-bottom-5', 'padding-left-15', 'padding-right-15', 'padding-bottom-15', 'position-sticky', 'top-0');
72
75
  const listMenu = ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, remainingProps, { className: `ListMenu ${className}`, ref: listRef }, { children: [enableFilter && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: formClassNames }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: 'input-group width-100pct' }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: 'input-group-addon' }, { children: (0, jsx_runtime_1.jsx)("span", { className: 'rioglyph rioglyph-search', "aria-hidden": 'true' }) })), (0, jsx_runtime_1.jsx)(ClearableInput_1.default, { value: filterValue, inputRef: inputRef, placeholder: filterPlaceholder, onChange: handleFilterChange, onClear: handleClear }), trailingInputAddon && trailingInputAddon] })) }))), !hasMenuItems(filteredMenuItems) && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'padding-top-25 text-center text-color-gray' }, { children: notFoundMessage }))), filteredMenuItems.map(menuGroup => ((0, jsx_runtime_1.jsx)(ListMenuGroup_1.default, { className: groupClassName, menuGroup: menuGroup }, crypto.randomUUID())))] })));
73
76
  if (responsive && isMobileMode) {
74
77
  return ((0, jsx_runtime_1.jsx)(ExpanderPanel_1.default, Object.assign({ title: mobileHeader, bsStyle: 'default', open: isExpanderOpen, onToggle: () => setIsExpanderOpen(!isExpanderOpen), unmountOnExit: false, className: 'shadow-default' }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ onClick: handleExpanderBodyClick }, { children: listMenu })) })));
@@ -1,10 +1,20 @@
1
1
  /// <reference types="react" />
2
+ import { type ArrowStyle } from './basics/Polyline';
2
3
  import type { Position } from '../../utils/mapTypes';
3
4
  import type { EventListenerMap } from '../../utils/eventHandling';
4
5
  export declare const MISSING_POSITIONS_EXCEPTION_MSG = "Route requires a minimum of 1 positions";
5
6
  export declare const TO_LESS_LINE_WIDTH_EXCEPTION_MSG = "If isBorderIncludedInWidth is set to true than width has to be greater than twice of borderWidth";
7
+ export declare const DEFAULT_LINE_STROKE_COLOR = "rgba(48, 194, 255, 1)";
8
+ export declare const DEFAULT_LINE_STROKE_COLOR_REDUCED = "rgba(48, 194, 255, 0.5)";
9
+ export declare const DEFAULT_LINE_STROKE_COLOR_ALTERNATIVE = "rgb(200, 243, 247)";
10
+ export declare const DEFAULT_BORDER_STROKE_COLOR = "rgba(22, 100, 141, 1)";
11
+ export declare const DEFAULT_BORDER_STROKE_COLOR_REDUCED = "rgba(255, 255, 255, 0)";
12
+ export declare const ROUTE_COLOR_DANGER = "#e22837";
13
+ export declare const ROUTE_COLOR_WARNING = "#ff8e3c";
14
+ export declare const ROUTE_COLOR_SUCCESS = "#5cb85c";
15
+ export declare const ROUTE_COLOR_WHITE = "rgba(255, 255, 255, 1)";
6
16
  export type RouteStyle = {
7
- width: number;
17
+ width?: number;
8
18
  color?: string;
9
19
  borderWidth?: number;
10
20
  borderColor?: string;
@@ -12,7 +22,7 @@ export type RouteStyle = {
12
22
  lineDash?: number[];
13
23
  };
14
24
  export type RouteProps = {
15
- arrowStyle?: object;
25
+ arrowStyle?: ArrowStyle;
16
26
  hasArrows?: boolean;
17
27
  positions: Position[];
18
28
  style?: RouteStyle;
@@ -23,6 +33,7 @@ export type RouteProps = {
23
33
  middleIcon?: JSX.Element;
24
34
  endIcon?: JSX.Element;
25
35
  markers?: JSX.Element[];
36
+ customData?: object;
26
37
  };
27
38
  declare const Route: (props: RouteProps) => import("react/jsx-runtime").JSX.Element | null;
28
39
  export default Route;