@rio-cloud/rio-uikit 1.2.2 → 1.4.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 (207) hide show
  1. package/.DS_Store +0 -0
  2. package/ChartLabel.d.ts +2 -0
  3. package/ChartLabel.js +2 -0
  4. package/ComposedChart.d.ts +2 -0
  5. package/ComposedChart.js +2 -0
  6. package/DateRangePicker.d.ts +6 -7
  7. package/DateRangePicker.js +7 -3
  8. package/GroupedItemList.d.ts +2 -0
  9. package/GroupedItemList.js +2 -0
  10. package/LicensePlate.d.ts +2 -0
  11. package/LicensePlate.js +2 -0
  12. package/README.md +3 -3
  13. package/ReferenceLine.d.ts +2 -0
  14. package/ReferenceLine.js +2 -0
  15. package/components/actionBarItem/ActionBarItem.js +5 -1
  16. package/components/actionBarItem/ActionBarItemIcon.d.ts +6 -8
  17. package/components/actionBarItem/ActionBarItemIcon.js +4 -4
  18. package/components/actionBarItem/ActionBarOverlay.d.ts +3 -2
  19. package/components/actionBarItem/ActionBarOverlay.js +7 -7
  20. package/components/applicationLayout/ApplicationLayout.js +1 -0
  21. package/components/applicationLayout/ApplicationLayoutHeader.js +0 -4
  22. package/components/assetTree/TreeOptions.js +8 -4
  23. package/components/assetTree/treeUtils.js +1 -1
  24. package/components/calendarStripe/CalendarStripe.d.ts +8 -0
  25. package/components/calendarStripe/CalendarStripe.js +7 -4
  26. package/components/charts/Area.d.ts +5 -0
  27. package/components/charts/Area.js +1 -9
  28. package/components/charts/AreaChart.d.ts +2 -0
  29. package/components/charts/AreaChart.js +9 -6
  30. package/components/charts/BarChart.js +4 -4
  31. package/components/charts/ChartLabel.d.ts +5 -0
  32. package/components/charts/ChartLabel.js +2 -0
  33. package/components/charts/ComposedChart.d.ts +34 -0
  34. package/components/charts/ComposedChart.js +30 -0
  35. package/components/charts/Legend.d.ts +8 -10
  36. package/components/charts/Legend.js +3 -12
  37. package/components/charts/Line.d.ts +5 -0
  38. package/components/charts/Line.js +1 -9
  39. package/components/charts/LineChart.d.ts +2 -0
  40. package/components/charts/LineChart.js +8 -5
  41. package/components/charts/PieChart.js +5 -5
  42. package/components/charts/RadialBarChart.js +5 -5
  43. package/components/charts/ReferenceLine.d.ts +7 -0
  44. package/components/charts/ReferenceLine.js +2 -0
  45. package/components/dataTabs/DataTab.js +2 -1
  46. package/components/dialog/Dialog.d.ts +12 -4
  47. package/components/dialog/SimpleDialog.d.ts +2 -2
  48. package/components/dialog/SplitDialog.d.ts +6 -0
  49. package/components/expander/ExpanderList.js +2 -1
  50. package/components/groupedItemList/GroupedItemList.d.ts +79 -0
  51. package/components/groupedItemList/GroupedItemList.js +77 -0
  52. package/components/licensePlate/LicensePlate.d.ts +19 -0
  53. package/components/licensePlate/LicensePlate.js +14 -0
  54. package/components/listMenu/ListMenu.js +1 -1
  55. package/components/onboarding/OnboardingTip.d.ts +2 -2
  56. package/components/onboarding/OnboardingTip.js +2 -0
  57. package/components/overlay/OverlayTrigger.d.ts +92 -3
  58. package/components/overlay/OverlayTrigger.js +140 -8
  59. package/components/popover/Popover.d.ts +27 -9
  60. package/components/popover/Popover.js +18 -5
  61. package/components/selects/BaseSelectDropdown.d.ts +1 -0
  62. package/components/selects/BaseSelectDropdown.js +16 -14
  63. package/components/selects/Multiselect.d.ts +5 -0
  64. package/components/selects/Multiselect.js +2 -2
  65. package/components/selects/Select.d.ts +5 -0
  66. package/components/selects/Select.js +2 -2
  67. package/components/slider/RangeSlider.d.ts +7 -0
  68. package/components/slider/RangeSlider.js +10 -4
  69. package/components/slider/Slider.d.ts +7 -0
  70. package/components/slider/Slider.js +5 -3
  71. package/components/states/CustomState.js +4 -5
  72. package/components/switch/Switch.d.ts +7 -0
  73. package/components/switch/Switch.js +4 -3
  74. package/components/tooltip/SimpleTooltip.d.ts +2 -2
  75. package/components/tooltip/Tooltip.d.ts +2 -2
  76. package/components/tooltip/Tooltip.js +6 -2
  77. package/hooks/useClickOutside.d.ts +1 -0
  78. package/hooks/useClickOutside.js +9 -3
  79. package/hooks/useElapsedTime.d.ts +26 -0
  80. package/hooks/useElapsedTime.js +36 -0
  81. package/hooks/useEvent.d.ts +1 -1
  82. package/hooks/useKey.d.ts +7 -4
  83. package/hooks/useKey.js +36 -8
  84. package/hooks/useTimeout.d.ts +5 -0
  85. package/hooks/useTimeout.js +39 -1
  86. package/hooks/useUncontrollable.d.ts +13 -0
  87. package/hooks/useUncontrollable.js +41 -0
  88. package/lib/es/ChartLabel.d.ts +2 -0
  89. package/lib/es/ChartLabel.js +7 -0
  90. package/lib/es/ComposedChart.d.ts +2 -0
  91. package/lib/es/ComposedChart.js +7 -0
  92. package/lib/es/DateRangePicker.d.ts +6 -7
  93. package/lib/es/DateRangePicker.js +5 -1
  94. package/lib/es/GroupedItemList.d.ts +2 -0
  95. package/lib/es/GroupedItemList.js +7 -0
  96. package/lib/es/LicensePlate.d.ts +2 -0
  97. package/lib/es/LicensePlate.js +7 -0
  98. package/lib/es/ReferenceLine.d.ts +2 -0
  99. package/lib/es/ReferenceLine.js +7 -0
  100. package/lib/es/components/actionBarItem/ActionBarItem.js +5 -1
  101. package/lib/es/components/actionBarItem/ActionBarItemIcon.d.ts +6 -8
  102. package/lib/es/components/actionBarItem/ActionBarItemIcon.js +4 -4
  103. package/lib/es/components/actionBarItem/ActionBarOverlay.d.ts +3 -2
  104. package/lib/es/components/actionBarItem/ActionBarOverlay.js +7 -7
  105. package/lib/es/components/applicationLayout/ApplicationLayout.js +1 -0
  106. package/lib/es/components/applicationLayout/ApplicationLayoutHeader.js +0 -4
  107. package/lib/es/components/assetTree/TreeOptions.js +8 -4
  108. package/lib/es/components/assetTree/treeUtils.js +1 -1
  109. package/lib/es/components/calendarStripe/CalendarStripe.d.ts +8 -0
  110. package/lib/es/components/calendarStripe/CalendarStripe.js +7 -4
  111. package/lib/es/components/charts/Area.d.ts +5 -0
  112. package/lib/es/components/charts/Area.js +1 -9
  113. package/lib/es/components/charts/AreaChart.d.ts +2 -0
  114. package/lib/es/components/charts/AreaChart.js +7 -4
  115. package/lib/es/components/charts/BarChart.js +3 -3
  116. package/lib/es/components/charts/ChartLabel.d.ts +5 -0
  117. package/lib/es/components/charts/ChartLabel.js +4 -0
  118. package/lib/es/components/charts/ComposedChart.d.ts +34 -0
  119. package/lib/es/components/charts/ComposedChart.js +32 -0
  120. package/lib/es/components/charts/Legend.d.ts +8 -10
  121. package/lib/es/components/charts/Legend.js +5 -12
  122. package/lib/es/components/charts/Line.d.ts +5 -0
  123. package/lib/es/components/charts/Line.js +1 -9
  124. package/lib/es/components/charts/LineChart.d.ts +2 -0
  125. package/lib/es/components/charts/LineChart.js +7 -4
  126. package/lib/es/components/charts/PieChart.js +4 -4
  127. package/lib/es/components/charts/RadialBarChart.js +4 -4
  128. package/lib/es/components/charts/ReferenceLine.d.ts +7 -0
  129. package/lib/es/components/charts/ReferenceLine.js +4 -0
  130. package/lib/es/components/dataTabs/DataTab.js +2 -1
  131. package/lib/es/components/dialog/Dialog.d.ts +12 -4
  132. package/lib/es/components/dialog/SimpleDialog.d.ts +2 -2
  133. package/lib/es/components/dialog/SplitDialog.d.ts +6 -0
  134. package/lib/es/components/expander/ExpanderList.js +2 -1
  135. package/lib/es/components/groupedItemList/GroupedItemList.d.ts +79 -0
  136. package/lib/es/components/groupedItemList/GroupedItemList.js +80 -0
  137. package/lib/es/components/licensePlate/LicensePlate.d.ts +19 -0
  138. package/lib/es/components/licensePlate/LicensePlate.js +16 -0
  139. package/lib/es/components/listMenu/ListMenu.js +1 -1
  140. package/lib/es/components/onboarding/OnboardingTip.d.ts +2 -2
  141. package/lib/es/components/onboarding/OnboardingTip.js +2 -0
  142. package/lib/es/components/overlay/OverlayTrigger.d.ts +92 -3
  143. package/lib/es/components/overlay/OverlayTrigger.js +139 -7
  144. package/lib/es/components/popover/Popover.d.ts +27 -9
  145. package/lib/es/components/popover/Popover.js +20 -6
  146. package/lib/es/components/selects/BaseSelectDropdown.d.ts +1 -0
  147. package/lib/es/components/selects/BaseSelectDropdown.js +16 -14
  148. package/lib/es/components/selects/Multiselect.d.ts +5 -0
  149. package/lib/es/components/selects/Multiselect.js +2 -2
  150. package/lib/es/components/selects/Select.d.ts +5 -0
  151. package/lib/es/components/selects/Select.js +2 -2
  152. package/lib/es/components/slider/RangeSlider.d.ts +7 -0
  153. package/lib/es/components/slider/RangeSlider.js +10 -4
  154. package/lib/es/components/slider/Slider.d.ts +7 -0
  155. package/lib/es/components/slider/Slider.js +5 -3
  156. package/lib/es/components/states/CustomState.js +4 -5
  157. package/lib/es/components/switch/Switch.d.ts +7 -0
  158. package/lib/es/components/switch/Switch.js +4 -3
  159. package/lib/es/components/tooltip/SimpleTooltip.d.ts +2 -2
  160. package/lib/es/components/tooltip/Tooltip.d.ts +2 -2
  161. package/lib/es/components/tooltip/Tooltip.js +5 -1
  162. package/lib/es/hooks/useClickOutside.d.ts +1 -0
  163. package/lib/es/hooks/useClickOutside.js +11 -3
  164. package/lib/es/hooks/useElapsedTime.d.ts +26 -0
  165. package/lib/es/hooks/useElapsedTime.js +38 -0
  166. package/lib/es/hooks/useEvent.d.ts +1 -1
  167. package/lib/es/hooks/useKey.d.ts +7 -4
  168. package/lib/es/hooks/useKey.js +35 -7
  169. package/lib/es/hooks/useTimeout.d.ts +5 -0
  170. package/lib/es/hooks/useTimeout.js +40 -0
  171. package/lib/es/hooks/useUncontrollable.d.ts +13 -0
  172. package/lib/es/hooks/useUncontrollable.js +46 -0
  173. package/lib/es/styles/variables/colors/colors.json +3 -3
  174. package/lib/es/useElapsedTime.d.ts +2 -0
  175. package/lib/es/useElapsedTime.js +7 -0
  176. package/lib/es/utils/colorScheme.js +10 -8
  177. package/lib/es/utils/currentColors.d.ts +3 -0
  178. package/lib/es/utils/currentColors.js +14 -0
  179. package/lib/es/utils/hasUtilityClass.d.ts +30 -0
  180. package/lib/es/utils/hasUtilityClass.js +71 -0
  181. package/lib/es/utils/init/initCSS.js +12 -0
  182. package/lib/es/utils/mergeRefs.d.ts +1 -1
  183. package/lib/es/values/Trigger.d.ts +1 -2
  184. package/lib/es/version.json +1 -1
  185. package/package.json +26 -20
  186. package/styles/variables/colors/colors.json +3 -3
  187. package/useElapsedTime.d.ts +2 -0
  188. package/useElapsedTime.js +2 -0
  189. package/utils/colorScheme.js +10 -8
  190. package/utils/currentColors.d.ts +3 -0
  191. package/utils/currentColors.js +10 -0
  192. package/utils/hasUtilityClass.d.ts +30 -0
  193. package/utils/hasUtilityClass.js +40 -0
  194. package/utils/init/initCSS.js +12 -0
  195. package/utils/mergeRefs.d.ts +1 -1
  196. package/values/Trigger.d.ts +1 -2
  197. package/version.json +1 -1
  198. package/components/.DS_Store +0 -0
  199. package/components/feedback/Feedback.d.ts +0 -2
  200. package/components/feedback/Feedback.js +0 -5
  201. package/components/map/.DS_Store +0 -0
  202. package/components/map/components/.DS_Store +0 -0
  203. package/lib/.DS_Store +0 -0
  204. package/lib/es/.DS_Store +0 -0
  205. package/lib/es/components/.DS_Store +0 -0
  206. package/lib/es/components/feedback/Feedback.d.ts +0 -2
  207. package/lib/es/components/feedback/Feedback.js +0 -7
@@ -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;
@@ -3,18 +3,21 @@ import { createElement as _createElement } from "react";
3
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  // @ts-ignore-next-line importsNotUsedAsValues
5
5
  import 'react';
6
- import { LineChart as RechartsLineChart, Line as RechartsLine, XAxis, YAxis, Brush, CartesianGrid, ResponsiveContainer, } from 'recharts';
6
+ import { LineChart as RechartsLineChart, Line as RechartsLine, ReferenceLine as RechartsReferenceLine, Legend as RechartsLegend, XAxis, YAxis, Brush, CartesianGrid, ResponsiveContainer, } from 'recharts';
7
7
  import isObject from 'lodash/fp/isObject';
8
8
  import { getColor, mapGridOptions } from './chartHelper';
9
9
  import ChartTooltip from './ChartTooltip';
10
- import Legend from './Legend';
10
+ import { getLegendDefaultProps } from './Legend';
11
11
  const LineChart = (props) => {
12
- 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 = __rest(props, ["width", "height", "data", "dataUnit", "dataKey", "lines", "xAxisOptions", "yAxisOptions", "gridOptions", "containerOptions", "showXAxis", "showYAxis", "showGrid", "legend", "brush", "tooltip"]);
12
+ 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 = __rest(props, ["width", "height", "data", "dataUnit", "dataKey", "lines", "referenceLines", "xAxisOptions", "yAxisOptions", "gridOptions", "containerOptions", "showXAxis", "showYAxis", "showGrid", "legend", "brush", "tooltip"]);
13
13
  const tooltipProps = isObject(tooltip) ? tooltip.props : {};
14
- const legendProps = isObject(legend) ? legend.props : {};
15
- return (_jsx(ResponsiveContainer, Object.assign({}, containerOptions, { children: _jsxs(RechartsLineChart, Object.assign({ width: width, height: height, data: data, margin: { top: 15, right: 15, left: 15, bottom: 15 } }, remainingProps, { children: [showGrid && _jsx(CartesianGrid, Object.assign({ strokeDasharray: '3 3' }, mapGridOptions(gridOptions))), _jsx(XAxis, Object.assign({ hide: !showXAxis, dataKey: dataKey }, xAxisOptions)), _jsx(YAxis, Object.assign({ hide: !showYAxis, unit: dataUnit }, yAxisOptions)), tooltip && _jsx(ChartTooltip, Object.assign({}, tooltipProps)), legend && _jsx(Legend, Object.assign({}, legendProps)), lines.map(line => {
14
+ const legendProps = isObject(legend) ? Object.assign(Object.assign({}, getLegendDefaultProps()), legend.props) : {};
15
+ return (_jsx(ResponsiveContainer, Object.assign({}, containerOptions, { children: _jsxs(RechartsLineChart, Object.assign({ width: width, height: height, data: data, margin: { top: 15, right: 15, left: 15, bottom: 15 } }, remainingProps, { children: [showGrid && _jsx(CartesianGrid, Object.assign({ strokeDasharray: '3 3' }, mapGridOptions(gridOptions))), _jsx(XAxis, Object.assign({ hide: !showXAxis, dataKey: dataKey }, xAxisOptions)), _jsx(YAxis, Object.assign({ hide: !showYAxis, unit: dataUnit }, yAxisOptions)), tooltip && _jsx(ChartTooltip, Object.assign({}, tooltipProps)), legend && _jsx(RechartsLegend, Object.assign({}, legendProps)), lines.map(line => {
16
16
  const _a = line.props, { strokeColor } = _a, remainingLineProps = __rest(_a, ["strokeColor"]);
17
17
  return _createElement(RechartsLine, Object.assign({}, remainingLineProps, { key: line.key, stroke: getColor(strokeColor) }));
18
+ }), referenceLines.map(referenceLine => {
19
+ const _a = referenceLine.props, { stroke } = _a, remainingReferenceLineProps = __rest(_a, ["stroke"]);
20
+ return (_createElement(RechartsReferenceLine, Object.assign({}, remainingReferenceLineProps, { key: referenceLine.key, stroke: getColor(stroke) })));
18
21
  }), brush && _jsx(Brush, { stroke: getColor('gray') })] })) })));
19
22
  };
20
23
  export default LineChart;
@@ -2,11 +2,11 @@ import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  // @ts-ignore-next-line importsNotUsedAsValues
4
4
  import 'react';
5
- import { PieChart as RechartsPieChart, Pie, Cell, ResponsiveContainer, } from 'recharts';
5
+ import { PieChart as RechartsPieChart, Legend as RechartsLegend, Pie, Cell, ResponsiveContainer, } from 'recharts';
6
6
  import isFunction from 'lodash/fp/isFunction';
7
7
  import isObject from 'lodash/fp/isObject';
8
8
  import { getFromDefaultColors, getColor } from './chartHelper';
9
- import Legend from './Legend';
9
+ import { getLegendDefaultProps } from './Legend';
10
10
  import ChartTooltip, { defaultFormatter } from './ChartTooltip';
11
11
  const RADIAN = Math.PI / 180;
12
12
  const renderCustomInnerLabel = (dataUnit) => ({ cx, cy, midAngle, innerRadius, outerRadius, value }) => {
@@ -16,13 +16,13 @@ const renderCustomInnerLabel = (dataUnit) => ({ cx, cy, midAngle, innerRadius, o
16
16
  return (_jsx("text", Object.assign({ x: x, y: y, fill: 'white', textAnchor: x > cx ? 'start' : 'end', dominantBaseline: 'central' }, { children: `${value} ${dataUnit}` })));
17
17
  };
18
18
  const PieChart = (props) => {
19
- const { width, height, innerRadius, outerRadius, data = [], dataKey = 'value', dataUnit = '', nameKey = 'name', color, filled = false, labels = true, innerLabels = false, paddingAngle = 3, legend = _jsx(Legend, {}), tooltip = true, pieOptions, containerOptions } = props, remainingProps = __rest(props, ["width", "height", "innerRadius", "outerRadius", "data", "dataKey", "dataUnit", "nameKey", "color", "filled", "labels", "innerLabels", "paddingAngle", "legend", "tooltip", "pieOptions", "containerOptions"]);
19
+ const { width, height, innerRadius, outerRadius, data = [], dataKey = 'value', dataUnit = '', nameKey = 'name', color, filled = false, labels = true, innerLabels = false, paddingAngle = 3, legend = _jsx(RechartsLegend, {}), tooltip = true, pieOptions, containerOptions } = props, remainingProps = __rest(props, ["width", "height", "innerRadius", "outerRadius", "data", "dataKey", "dataUnit", "nameKey", "color", "filled", "labels", "innerLabels", "paddingAngle", "legend", "tooltip", "pieOptions", "containerOptions"]);
20
20
  // biome-ignore lint/suspicious/noExplicitAny:
21
21
  const renderLabels = (entry) => `${isFunction(dataKey) ? dataKey(entry) : entry[dataKey]} ${dataUnit}`;
22
22
  const pieLabel = labels && (innerLabels ? renderCustomInnerLabel(dataUnit) : renderLabels);
23
23
  const tooltipProps = isObject(tooltip) ? tooltip.props : {};
24
- const legendProps = isObject(legend) ? legend.props : {};
25
- return (_jsx(ResponsiveContainer, Object.assign({}, containerOptions, { children: _jsxs(RechartsPieChart, Object.assign({ width: width, height: height }, remainingProps, { children: [legend && (_jsx(Legend, Object.assign({ formatter: (value, entry) => (_jsx("span", Object.assign({ className: 'text-color-darker' }, { children: value }))) }, legendProps))), _jsx(Pie, Object.assign({ data: data, isAnimationActive: true, nameKey: nameKey, dataKey: dataKey, label: pieLabel,
24
+ const legendProps = isObject(legend) ? Object.assign(Object.assign({}, getLegendDefaultProps()), legend.props) : {};
25
+ return (_jsx(ResponsiveContainer, Object.assign({}, containerOptions, { children: _jsxs(RechartsPieChart, Object.assign({ width: width, height: height }, remainingProps, { children: [legend && (_jsx(RechartsLegend, Object.assign({ formatter: (value, entry) => (_jsx("span", Object.assign({ className: 'text-color-darker' }, { children: value }))) }, legendProps))), _jsx(Pie, Object.assign({ data: data, isAnimationActive: true, nameKey: nameKey, dataKey: dataKey, label: pieLabel,
26
26
  // cx={Math.max(outerRadius, width / 3)}
27
27
  // cy={height / 2}
28
28
  innerRadius: filled ? 0 : innerRadius, outerRadius: outerRadius, paddingAngle: filled ? 0 : paddingAngle, labelLine: !innerLabels }, pieOptions, { children: data.map((entry, index) => {
@@ -2,14 +2,14 @@ import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  // @ts-ignore-next-line importsNotUsedAsValues
4
4
  import 'react';
5
- import { RadialBarChart as RechartsRadialBarChart, RadialBar as RechartsRadialBar, PolarAngleAxis, Cell, ResponsiveContainer, } from 'recharts';
5
+ import { RadialBarChart as RechartsRadialBarChart, RadialBar as RechartsRadialBar, Legend as RechartsLegend, PolarAngleAxis, Cell, ResponsiveContainer, } from 'recharts';
6
6
  import isFunction from 'lodash/fp/isFunction';
7
7
  import isObject from 'lodash/fp/isObject';
8
8
  import { getColor, getFromDefaultColors, CURSOR_BACKGROUND_COLOR } from './chartHelper';
9
- import Legend from './Legend';
9
+ import { getLegendDefaultProps } from './Legend';
10
10
  import ChartTooltip from './ChartTooltip';
11
11
  const RadialBarChart = (props) => {
12
- const { width, height, data = [], dataKey = 'value', startAngle = 180, endAngle = 0, innerRadius = '30%', outerRadius = '100%', legend = _jsx(Legend, {}), textOptions, radialBarOptions, containerOptions, showBarLabel = false, cornerRadius = 30, background = true, range, tooltip = false } = props, remainingProps = __rest(props, ["width", "height", "data", "dataKey", "startAngle", "endAngle", "innerRadius", "outerRadius", "legend", "textOptions", "radialBarOptions", "containerOptions", "showBarLabel", "cornerRadius", "background", "range", "tooltip"]);
12
+ const { width, height, data = [], dataKey = 'value', startAngle = 180, endAngle = 0, innerRadius = '30%', outerRadius = '100%', legend = _jsx(RechartsLegend, {}), textOptions, radialBarOptions, containerOptions, showBarLabel = false, cornerRadius = 30, background = true, range, tooltip = false } = props, remainingProps = __rest(props, ["width", "height", "data", "dataKey", "startAngle", "endAngle", "innerRadius", "outerRadius", "legend", "textOptions", "radialBarOptions", "containerOptions", "showBarLabel", "cornerRadius", "background", "range", "tooltip"]);
13
13
  const _a = textOptions || {}, { text, size = '500%', weight = 'normal', color = 'gray-darkest' } = _a, remainingTextOptions = __rest(_a, ["text", "size", "weight", "color"]);
14
14
  const textStyle = {
15
15
  fontSize: size,
@@ -17,10 +17,10 @@ const RadialBarChart = (props) => {
17
17
  fill: color && getColor(color),
18
18
  };
19
19
  const tooltipProps = isObject(tooltip) ? tooltip.props : {};
20
- const legendProps = isObject(legend) ? legend.props : {};
20
+ const legendProps = isObject(legend) ? Object.assign(Object.assign({}, getLegendDefaultProps()), legend.props) : {};
21
21
  return (_jsx(ResponsiveContainer, Object.assign({}, containerOptions, { children: _jsxs(RechartsRadialBarChart, Object.assign({ width: width, height: height, data: data, innerRadius: innerRadius, outerRadius: outerRadius, startAngle: startAngle, endAngle: endAngle }, remainingProps, { children: [_jsx(RechartsRadialBar, Object.assign({ label: showBarLabel && { fill: '#666', position: 'insideStart' }, background: background, dataKey: dataKey, cornerRadius: cornerRadius }, radialBarOptions, { children: data.map((entry, index) => {
22
22
  const cellColor = getColor(entry.color) || getFromDefaultColors(index);
23
23
  return (_jsx(Cell, { fill: isFunction(color) ? color(entry, index) : cellColor }, `cell-${index}`));
24
- }) })), range && _jsx(PolarAngleAxis, { type: 'number', domain: range, angleAxisId: 0, tick: false }), textOptions && (_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 && (_jsx(Legend, Object.assign({ formatter: (value, entry) => (_jsx("span", Object.assign({ className: 'text-color-darker' }, { children: value }))) }, legendProps))), tooltip && _jsx(ChartTooltip, Object.assign({ cursor: { fill: CURSOR_BACKGROUND_COLOR } }, tooltipProps))] })) })));
24
+ }) })), range && _jsx(PolarAngleAxis, { type: 'number', domain: range, angleAxisId: 0, tick: false }), textOptions && (_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 && (_jsx(RechartsLegend, Object.assign({ formatter: (value, entry) => (_jsx("span", Object.assign({ className: 'text-color-darker' }, { children: value }))) }, legendProps))), tooltip && _jsx(ChartTooltip, Object.assign({ cursor: { fill: CURSOR_BACKGROUND_COLOR } }, tooltipProps))] })) })));
25
25
  };
26
26
  export 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,2 @@
1
+ const Line = ({ stroke = 'color-coldplay-fountain' }) => null;
2
+ export default Line;
@@ -5,7 +5,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
5
5
  import 'react';
6
6
  import { motion } from 'framer-motion';
7
7
  const DataTab = (props) => {
8
- const { active = false, tabKey, disableTransition = false, className = '', children } = props, remainingProps = __rest(props, ["active", "tabKey", "disableTransition", "className", "children"]);
8
+ const { active = false, title, // exclude from remainingProps to avoid being set to the div element
9
+ tabKey, disableTransition = false, className = '', children } = props, remainingProps = __rest(props, ["active", "title", "tabKey", "disableTransition", "className", "children"]);
9
10
  if (disableTransition) {
10
11
  return _jsx("div", { children: active && children });
11
12
  }
@@ -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
  };
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { type BaseDialogProps } from './Dialog';
3
- export type SimpleDialogProps = BaseDialogProps & {
2
+ import { type DialogProps } from './Dialog';
3
+ export type SimpleDialogProps = Omit<DialogProps, 'body'> & {
4
4
  /**
5
5
  * The content of the dialog body itself.
6
6
  */
@@ -25,6 +25,12 @@ export type SplitDialogProps = BaseDialogProps & {
25
25
  * Additional classes for the modal-footer element.
26
26
  */
27
27
  footerClassName?: string;
28
+ /**
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
+ */
33
+ onCloseValidation?: () => boolean;
28
34
  };
29
35
  declare const SplitDialog: (props: SplitDialogProps) => import("react/jsx-runtime").JSX.Element;
30
36
  export default SplitDialog;
@@ -3,6 +3,7 @@ import { useState } from 'react';
3
3
  import isEqual from 'lodash/fp/isEqual';
4
4
  import classNames from 'classnames';
5
5
  import Collapse from '../collapse/Collapse';
6
+ import { hasBorderClass, hasRoundedClass } from '../../utils/hasUtilityClass';
6
7
  const getRandomString = () => (Math.random() + 1).toString(36).toUpperCase().substring(2);
7
8
  // Generate a unique id (if not present) instead of using the index for the key as it will create
8
9
  // side effects when removing items from the list and re-render the ExpanderList.
@@ -38,7 +39,7 @@ const ExpanderList = (props) => {
38
39
  });
39
40
  setListItems(updatedListItems);
40
41
  };
41
- const listClassNames = classNames('expander-list list-group', rounded && 'rounded', bordered && 'border', className);
42
+ const listClassNames = classNames('expander-list list-group', rounded && !hasRoundedClass(className) && 'rounded', bordered && !hasBorderClass(className) && 'border', className);
42
43
  return (_jsx("ul", Object.assign({ className: listClassNames }, { children: listItems.map(item => {
43
44
  const isOpen = item.open;
44
45
  const itemClassNames = classNames('list-group-item', item.className && item.className, item.body && 'expandable', isOpen && 'open');
@@ -0,0 +1,79 @@
1
+ import React from 'react';
2
+ import { SortDirectionType } from '../../SortUtils';
3
+ export type Group = {
4
+ groupKey: string;
5
+ items: any[];
6
+ };
7
+ export type GroupedItemListProps<T> = {
8
+ /**
9
+ * The list of items to be grouped and rendered.
10
+ *
11
+ * By default, the component assumes an item object containing an 'id' and 'name' property
12
+ * plus some other attributes.
13
+ */
14
+ items: T[];
15
+ /**
16
+ * The property of the items to group by as a string, or a custom group function.
17
+ * Defaults to 'name' if not provided.
18
+ *
19
+ * @default 'name'
20
+ */
21
+ groupBy?: keyof T | ((item: T) => string);
22
+ /**
23
+ * The order in which to sort the groups. Accepts 'asc' for ascending or 'desc' for descending.
24
+ * @default 'asc'.
25
+ */
26
+ groupSortOrder?: SortDirectionType;
27
+ /**
28
+ * The order in which to sort the items inside a group. Accepts 'asc' for ascending or 'desc' for descending.
29
+ * @default 'asc'.
30
+ */
31
+ itemSortOrder?: SortDirectionType;
32
+ /**
33
+ * Sorting function for the groups.
34
+ */
35
+ groupSortFunction?: (groups: Group[]) => Group[];
36
+ /**
37
+ * Sorting function for the items within each group.
38
+ */
39
+ itemSortFunction?: (items: T[]) => T[];
40
+ /**
41
+ * A custom render function for the group divider.
42
+ * Receives the group key (e.g., letter or date) as a parameter.
43
+ */
44
+ renderDivider?: (groupKey: string) => React.ReactNode;
45
+ /**
46
+ * A custom render function for individual list items.
47
+ * Receives an item as a parameter.
48
+ */
49
+ renderItem?: (item: T) => React.ReactNode;
50
+ /**
51
+ * Specifies the HTML element to use for the list inside each group.
52
+ * Default is 'div'. Use 'ul' for rendering the list items as `<li>` elements.
53
+ */
54
+ listElement?: 'div' | 'ul';
55
+ /**
56
+ * Optional class name for the list element inside each group.
57
+ * Applied to the `div` or `ul` wrapping the items.
58
+ */
59
+ listElementClassName?: string;
60
+ /**
61
+ * Optional class name for the divider element in each group.
62
+ * Applied to the `div` wrapping each group divider.
63
+ */
64
+ dividerElementClassName?: string;
65
+ /**
66
+ * Optional class name for the outer wrapper element.
67
+ * Applied to the outer `div` wrapping the entire component.
68
+ */
69
+ className?: string;
70
+ };
71
+ /**
72
+ * A React component that groups and renders a list of items based on a specified property.
73
+ * The component can be customized to render dividers and list items in different styles.
74
+ *
75
+ * @param {GroupedItemListProps} props - The props for the component.
76
+ * @returns {JSX.Element} The grouped and rendered list component.
77
+ */
78
+ declare const GroupedItemList: <T>(props: GroupedItemListProps<T>) => import("react/jsx-runtime").JSX.Element;
79
+ export default GroupedItemList;
@@ -0,0 +1,77 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React, { useMemo } from 'react';
3
+ import { naturalSortByProperty, sortByProperty } from '../../SortUtils';
4
+ /**
5
+ * A React component that groups and renders a list of items based on a specified property.
6
+ * The component can be customized to render dividers and list items in different styles.
7
+ *
8
+ * @param {GroupedItemListProps} props - The props for the component.
9
+ * @returns {JSX.Element} The grouped and rendered list component.
10
+ */
11
+ const GroupedItemList = (props) => {
12
+ const { items, groupBy = 'name', groupSortOrder = 'asc', // Default to ascending order if not specified
13
+ groupSortFunction, itemSortFunction, itemSortOrder = 'asc', // Default to ascending order if not specified
14
+ renderDivider, renderItem, listElement = 'div', // Default to 'div' if not specified
15
+ listElementClassName, dividerElementClassName, className, } = props;
16
+ // Default group sorting function or specific function provided
17
+ const groupSortFn = groupSortFunction
18
+ ? groupSortFunction
19
+ : (groups) => naturalSortByProperty(groups, 'groupKey', groupSortOrder);
20
+ // Default item sorting within groups or specific function provided
21
+ const itemSortFn = itemSortFunction
22
+ ? itemSortFunction
23
+ : (itemsToSort) => sortByProperty(itemsToSort, groupBy, itemSortOrder);
24
+ // Determine the grouping function based on the type of groupBy
25
+ // const getGroupKey = (item: T): string => {
26
+ // if (typeof groupBy === 'string') {
27
+ // if (groupBy === 'name') {
28
+ // return (item as any).name?.[0]?.toUpperCase() ?? '';
29
+ // }
30
+ // return (item as any)[groupBy]?.toString() ?? '';
31
+ // } else if (typeof groupBy === 'function') {
32
+ // return groupBy(item);
33
+ // }
34
+ // throw new Error('Please define a "groupBy" property as a string or function.');
35
+ // };
36
+ const getGroupKey = typeof groupBy === 'function'
37
+ ? groupBy
38
+ : (item) => { var _a, _b, _c; return (_c = (_b = (_a = item[groupBy]) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.toUpperCase()) !== null && _c !== void 0 ? _c : ''; };
39
+ // Group items by the specified property
40
+ // const allGroups = useMemo(
41
+ // () =>
42
+ // items.reduce<Record<string, T[]>>((acc, item) => {
43
+ // const groupKey = getGroupKey(item);
44
+ // if (!acc[groupKey]) {
45
+ // acc[groupKey] = [];
46
+ // }
47
+ // acc[groupKey].push(item);
48
+ // return acc;
49
+ // }, {}),
50
+ // [items, getGroupKey]
51
+ // );
52
+ // Group items by the specified property
53
+ const groupedItems = useMemo(() => {
54
+ // Explicitly typing the accumulator as Record<string, T[]>
55
+ const groups = items.reduce((acc, item) => {
56
+ const groupKey = getGroupKey(item);
57
+ if (!acc[groupKey]) {
58
+ acc[groupKey] = [];
59
+ }
60
+ acc[groupKey].push(item);
61
+ return acc;
62
+ }, {});
63
+ return Object.keys(groups).map(groupKey => ({
64
+ groupKey,
65
+ items: groups[groupKey],
66
+ }));
67
+ }, [items, getGroupKey]);
68
+ // Assign the specified list element ('div' or 'ul')
69
+ const ListElement = listElement;
70
+ // Sort groups using the provided sort function
71
+ const sortedGroups = useMemo(() => groupSortFn(groupedItems), [groupedItems, groupSortFn]);
72
+ return (_jsx("div", Object.assign({ className: `grouped-item-list ${className !== null && className !== void 0 ? className : ''}` }, { children: sortedGroups.map(group => (_jsxs(React.Fragment, { children: [_jsx("div", Object.assign({ className: `group-divider ${dividerElementClassName !== null && dividerElementClassName !== void 0 ? dividerElementClassName : ''}` }, { children: renderDivider ? renderDivider(group.groupKey) : group.groupKey })), _jsx(ListElement, Object.assign({ className: listElementClassName }, { children: itemSortFn(group.items).map(item => {
73
+ var _a;
74
+ return renderItem ? (renderItem(item)) : (_jsx(React.Fragment, { children: _jsx("div", Object.assign({ className: 'item-name' }, { children: item.name })) }, (_a = item.id) !== null && _a !== void 0 ? _a : crypto.randomUUID()));
75
+ }) }))] }, group.groupKey))) })));
76
+ };
77
+ export default GroupedItemList;
@@ -0,0 +1,19 @@
1
+ import { type PropsWithChildren } from 'react';
2
+ export type LicensePlateProps = {
3
+ /**
4
+ * The country code.
5
+ *
6
+ * Should be a string with 1-3 capital letters.
7
+ */
8
+ countryCode?: string;
9
+ /**
10
+ * Whether the EU stars should be hidden.
11
+ */
12
+ hideStars?: boolean;
13
+ /**
14
+ * Additional classes added to the wrapping element.
15
+ */
16
+ className?: string;
17
+ };
18
+ declare const LicensePlate: (props: PropsWithChildren<LicensePlateProps>) => import("react/jsx-runtime").JSX.Element;
19
+ export default LicensePlate;
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // @ts-ignore-next-line importsNotUsedAsValues
3
+ import 'react';
4
+ const euStars = (_jsx("svg", Object.assign({ xmlns: 'http://www.w3.org/2000/svg', width: '10', height: '10' }, { children: _jsx("path", { fill: '#FFC200', fillRule: 'nonzero', d: 'M5.143.439H5.6L5.23.71l.141.438L5 .88l-.371.27.14-.438L4.4.439h.459L5 0zm2.198.594h.458l-.37.272.141.44-.371-.271-.372.27.142-.439-.372-.271h.46l.142-.44zm1.607 1.625h.458l-.37.272.141.44-.371-.271-.372.27.142-.438-.371-.272.459-.001.142-.438zm.593 2.208H10l-.37.272.14.44-.37-.272-.372.271.14-.438-.37-.272.46-.001.141-.438zm-.59 2.214h.459l-.37.271.14.44-.37-.271-.372.271.141-.439-.371-.271.46-.001.141-.439zM7.337 8.701h.459l-.371.272.141.44-.371-.27-.371.27.14-.44-.37-.27.459-.002.142-.438zm-2.201.588h.458l-.37.272.141.439-.371-.27-.372.27.142-.439-.372-.271.46-.001.142-.438zM2.938 8.7h.458l-.37.273.141.439-.371-.27-.372.27.141-.44-.37-.27h.459l.142-.44zM1.33 7.083h.458l-.37.272.14.44-.371-.271-.372.27.142-.439-.37-.271h.458l.143-.44zM.743 4.869H1.2l-.37.272.141.439-.371-.27-.372.27.142-.439L0 4.87l.459-.001L.6 4.43zm.581-2.217h.459l-.37.272.14.439-.37-.27-.372.27.14-.439-.37-.271h.459l.142-.44zM2.94 1.03h.459l-.37.272.14.44-.37-.272-.372.271.14-.439-.37-.271.458-.001.143-.439z' }) })));
5
+ const LicensePlate = (props) => {
6
+ const { countryCode, hideStars, className = '', children } = props;
7
+ let letterCount = '';
8
+ if ((countryCode === null || countryCode === void 0 ? void 0 : countryCode.length) === 2)
9
+ letterCount = 'two-letters';
10
+ if ((countryCode === null || countryCode === void 0 ? void 0 : countryCode.length) === 3)
11
+ letterCount = 'three-letters';
12
+ return (_jsx("div", Object.assign({ className: `license-plate ${className}` }, { children: _jsxs("div", Object.assign({ className: 'plate-content' }, { children: [countryCode && (_jsxs("div", Object.assign({ className: 'plate-country' }, { children: [!hideStars && _jsx("span", Object.assign({ className: 'stars' }, { children: euStars })), _jsx("span", Object.assign({ className: `plate-country-code ${letterCount}` }, { children: countryCode }))] }))), _jsx("div", Object.assign({ className: 'plate-number' }, { children: children }))] })) })));
13
+ };
14
+ export default LicensePlate;
@@ -66,7 +66,7 @@ const ListMenu = (props) => {
66
66
  setIsExpanderOpen(false);
67
67
  }
68
68
  };
69
- const formClassNames = classNames('form-group', 'margin-bottom-5', 'padding-left-15', 'padding-right-15', 'padding-bottom-15', 'position-sticky', 'top-0');
69
+ const formClassNames = classNames('form-group', 'margin-top-5', 'margin-bottom-5', 'padding-left-15', 'padding-right-15', 'padding-bottom-15', 'position-sticky', 'top-0');
70
70
  const listMenu = (_jsxs("div", Object.assign({}, remainingProps, { className: `ListMenu ${className}`, ref: listRef }, { children: [enableFilter && (_jsx("div", Object.assign({ className: formClassNames }, { children: _jsxs("div", Object.assign({ className: 'input-group width-100pct' }, { children: [_jsx("span", Object.assign({ className: 'input-group-addon' }, { children: _jsx("span", { className: 'rioglyph rioglyph-search', "aria-hidden": 'true' }) })), _jsx(ClearableInput, { value: filterValue, inputRef: inputRef, placeholder: filterPlaceholder, onChange: handleFilterChange, onClear: handleClear }), trailingInputAddon && trailingInputAddon] })) }))), !hasMenuItems(filteredMenuItems) && (_jsx("div", Object.assign({ className: 'padding-top-25 text-center text-color-gray' }, { children: notFoundMessage }))), filteredMenuItems.map(menuGroup => (_jsx(ListMenuGroup, { className: groupClassName, menuGroup: menuGroup }, crypto.randomUUID())))] })));
71
71
  if (responsive && isMobileMode) {
72
72
  return (_jsx(ExpanderPanel, Object.assign({ title: mobileHeader, bsStyle: 'default', open: isExpanderOpen, onToggle: () => setIsExpanderOpen(!isExpanderOpen), unmountOnExit: false, className: 'shadow-default' }, { children: _jsx("div", Object.assign({ onClick: handleExpanderBodyClick }, { children: listMenu })) })));
@@ -1,14 +1,14 @@
1
1
  import React, { type PropsWithChildren, type ReactNode } from 'react';
2
- import type { OverlayProps } from 'react-bootstrap';
2
+ import type { Options } from '@popperjs/core';
3
3
  import { type TooltipWidth } from '../tooltip/Tooltip';
4
4
  import { type TextAlignment } from '../../values/TextAlignment';
5
5
  import { type Placement } from '../../values/Placement';
6
- type PopperConfig = OverlayProps['popperConfig'];
7
6
  export type OnboardingButton = {
8
7
  text: string | React.ReactNode;
9
8
  onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
10
9
  iconName?: string;
11
10
  };
11
+ type PopperConfig = Partial<Options>;
12
12
  export type OnboardingTipProps = {
13
13
  /**
14
14
  * The ID of the DOM element.
@@ -21,6 +21,8 @@ const OnboardingTip = (props) => {
21
21
  // Popper.js default is false but we enable it by default
22
22
  options: { altAxis: preventOverflow },
23
23
  },
24
+ // Use an arrow modifier, the arrow ref will be injected in OverlayTrigger with the right props
25
+ { name: 'arrow', options: {} },
24
26
  ],
25
27
  };
26
28
  const trigger = (_jsx(OverlayTrigger, Object.assign({ placement: placement, trigger: 'click', overlay: overlay, onToggle: onHide, show: show, rootClose: false, popperConfig: actualPopperConfig }, { children: children })));
@@ -1,6 +1,95 @@
1
- import { type PropsWithChildren } from 'react';
2
- import { type OverlayTriggerProps as BSOverlayTriggerProps } from 'react-bootstrap/OverlayTrigger';
3
- export type OverlayTriggerProps = Omit<BSOverlayTriggerProps, 'children'>;
1
+ import React, { type PropsWithChildren } from 'react';
2
+ import type { Options } from '@popperjs/core';
3
+ import { type Placement } from '../../values/Placement';
4
+ import { type TriggerType } from '../../values/Trigger';
5
+ type PopperConfig = Partial<Options>;
6
+ export type OverlayTriggerProps = {
7
+ /**
8
+ * The visibility of the Overlay. `show` is a _controlled_ prop so should be paired
9
+ * with `onToggle` to avoid breaking user interactions.
10
+ *
11
+ * Manually toggling `show` does **not** wait for `delay` to change the visibility.
12
+ *
13
+ * @controllable onToggle
14
+ * @default: false
15
+ */
16
+ show?: boolean;
17
+ /**
18
+ * The initial visibility state of the Overlay.
19
+ *
20
+ * @default false
21
+ */
22
+ defaultShow?: boolean;
23
+ /**
24
+ * Defines the usage of React Portal.
25
+ *
26
+ * @default true
27
+ */
28
+ enablePortal?: boolean;
29
+ /**
30
+ * Specify which action or actions trigger Overlay visibility
31
+ *
32
+ * The `click` trigger ignores the configured `delay`.
33
+ *
34
+ * @default 'hover'
35
+ */
36
+ trigger?: TriggerType;
37
+ /**
38
+ * A millisecond delay amount to show and hide the Overlay once triggered
39
+ */
40
+ delay?: number | {
41
+ show?: number;
42
+ hide?: number;
43
+ };
44
+ /**
45
+ * An element or text to overlay next to the target.
46
+ */
47
+ overlay: React.ReactElement;
48
+ /**
49
+ * The placement of the Overlay in relation to it's `target`.
50
+ *
51
+ * @default 'top'
52
+ */
53
+ placement?: Placement;
54
+ /**
55
+ * A Popper.js config object passed to the underlying popper instance.
56
+ * If no custom config is provided, a default config will be used. This default config
57
+ * includes an arrow element. In case you want to use a custom config and an arrow, include the arrow
58
+ * modifier so the correct arrow element can be injected for the arrow modifier.
59
+ *
60
+ * @example
61
+ * popperConfig={{
62
+ * modifiers: [
63
+ * {
64
+ * name: 'offset',
65
+ * options: {
66
+ * offset: [0, 5],
67
+ * },
68
+ * },
69
+ * {
70
+ * name: 'arrow',
71
+ * options: {},
72
+ * },
73
+ * ],
74
+ * }}
75
+ */
76
+ popperConfig?: PopperConfig;
77
+ /**
78
+ * Specify whether the overlay should trigger onHide when the user clicks outside the overlay.
79
+ *
80
+ * @default true
81
+ */
82
+ rootClose?: boolean;
83
+ /**
84
+ * A callback that fires when the user triggers a change in tooltip visibility.
85
+ *
86
+ * `onToggle` is called with the desired next `show`, and generally should be passed
87
+ * back to the `show` prop. `onToggle` fires _after_ the configured `delay`
88
+ *
89
+ * @controllable `show`
90
+ */
91
+ onToggle?: (show: boolean) => void;
92
+ };
4
93
  declare const OverlayTrigger: {
5
94
  (props: PropsWithChildren<OverlayTriggerProps>): import("react/jsx-runtime").JSX.Element;
6
95
  TRIGGER_CLICK: "click";