@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
package/.DS_Store CHANGED
Binary file
@@ -0,0 +1,2 @@
1
+ export { default } from './components/charts/ChartLabel';
2
+ export * from './components/charts/ChartLabel';
package/ChartLabel.js ADDED
@@ -0,0 +1,2 @@
1
+ export { default } from './components/charts/ChartLabel';
2
+ export * from './components/charts/ChartLabel';
@@ -0,0 +1,2 @@
1
+ export { default } from './components/charts/ComposedChart';
2
+ export * from './components/charts/ComposedChart';
@@ -0,0 +1,2 @@
1
+ export { default } from './components/charts/ComposedChart';
2
+ export * from './components/charts/ComposedChart';
@@ -1,12 +1,12 @@
1
- import type { Component, JSX, PropsWithChildren, ReactNode } from 'react';
1
+ import type { JSX, PropsWithChildren, ReactNode } from 'react';
2
2
  import type { Moment } from 'moment/moment';
3
- export interface DateRangePickerCustomPresets {
3
+ export type DateRangePickerCustomPresets = {
4
4
  startValue: Moment;
5
5
  endValue: Moment;
6
6
  text: string | JSX.Element;
7
7
  onSelect?: Function;
8
- }
9
- export interface DateRangePickerProps {
8
+ };
9
+ export type DateRangePickerProps = {
10
10
  startValue?: Moment;
11
11
  endValue?: Moment;
12
12
  defaultStartValue?: Moment;
@@ -34,11 +34,10 @@ export interface DateRangePickerProps {
34
34
  dropup?: boolean;
35
35
  pullRight?: boolean;
36
36
  autoDropDirection?: boolean;
37
- }
37
+ };
38
38
  /**
39
39
  * Wrapper component for React-Datetime.
40
40
  *
41
41
  * @deprecated This will be removed from the UIKIT at some time.
42
42
  */
43
- declare const DateRangePicker: Component<PropsWithChildren<DateRangePickerProps>, {}, any>;
44
- export { DateRangePicker };
43
+ export declare const DateRangePicker: (props: PropsWithChildren<DateRangePickerProps>) => import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,12 @@
1
- import { default as _DateRangePicker } from './components/datepicker/DateRangePicker';
1
+ import { __rest } from "tslib";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import DeprecatedDateRangePicker from './components/datepicker/DateRangePicker';
2
4
  /**
3
5
  * Wrapper component for React-Datetime.
4
6
  *
5
7
  * @deprecated This will be removed from the UIKIT at some time.
6
8
  */
7
- const DateRangePicker = _DateRangePicker;
8
- export { DateRangePicker };
9
+ export const DateRangePicker = (props) => {
10
+ const { children } = props, remainingProps = __rest(props, ["children"]);
11
+ return _jsx(DeprecatedDateRangePicker, Object.assign({}, remainingProps, { children: children }));
12
+ };
@@ -0,0 +1,2 @@
1
+ export { default } from './components/groupedItemList/GroupedItemList';
2
+ export * from './components/groupedItemList/GroupedItemList';
@@ -0,0 +1,2 @@
1
+ export { default } from './components/groupedItemList/GroupedItemList';
2
+ export * from './components/groupedItemList/GroupedItemList';
@@ -0,0 +1,2 @@
1
+ export { default } from './components/licensePlate/LicensePlate';
2
+ export * from './components/licensePlate/LicensePlate';
@@ -0,0 +1,2 @@
1
+ export { default } from './components/licensePlate/LicensePlate';
2
+ export * from './components/licensePlate/LicensePlate';
package/README.md CHANGED
@@ -19,9 +19,9 @@ When releasing a new version:
19
19
 
20
20
  Create a new development beta version:
21
21
 
22
- 1. Update the `package.json`. Example `0.16.4-beta.1`
23
- 2. Update the `src/version.json`. Example `0.16.4-beta.1`
24
- 3. run `npm i` or update `package-lock.json`. Example `0.16.4-beta.1`
22
+ 1. Update the `package.json`. Example `1.2.4-beta.1`
23
+ 2. Update the `src/version.json`. Example `1.2.4-beta.1`
24
+ 3. run `npm i` or update `package-lock.json`. Example `1.2.4-beta.1`
25
25
 
26
26
  ## Development
27
27
 
@@ -0,0 +1,2 @@
1
+ export { default } from './components/charts/ReferenceLine';
2
+ export * from './components/charts/ReferenceLine';
@@ -0,0 +1,2 @@
1
+ export { default } from './components/charts/ReferenceLine';
2
+ export * from './components/charts/ReferenceLine';
@@ -97,7 +97,7 @@ const ActionBarItemBase = (props) => {
97
97
  return (_jsxs("div", Object.assign({}, remainingProps, { className: classes, ref: clickOutsideRef }, { children: [React.cloneElement(itemIcon, { onClick: onToggle }), _jsx("div", Object.assign({ onClick: () => setIsShown(false) }, { children: _jsx(Dialog, { show: isShown, onClose: () => setIsShown(false), body: itemPopover, bodyClassName: mobileDialogBodyClassName, title: title }) })), childrenWithoutPopoverAndIcon] })));
98
98
  }
99
99
  const overlay = (_jsx(ActionBarOverlay, Object.assign({ id: id, title: title, width: popoverWidth, preRender: useOffscreen, show: isShown }, { children: itemPopover }), 'child'));
100
- return (_jsxs("div", Object.assign({}, remainingProps, { className: classes, ref: clickOutsideRef }, { children: [_jsx(OverlayTrigger, Object.assign({ onToggle: onToggle, show: isShown || useOffscreen, placement: OverlayTrigger.BOTTOM_END, overlay: overlay, trigger: 'click', rootClose: false, popperConfig: {
100
+ return (_jsxs("div", Object.assign({}, remainingProps, { className: classes, ref: clickOutsideRef }, { children: [_jsx(OverlayTrigger, Object.assign({ onToggle: onToggle, show: isShown || useOffscreen, placement: OverlayTrigger.BOTTOM_END, overlay: overlay, rootClose: false, trigger: 'click', popperConfig: {
101
101
  modifiers: [
102
102
  {
103
103
  name: 'offset',
@@ -105,6 +105,10 @@ const ActionBarItemBase = (props) => {
105
105
  offset: [0, 5],
106
106
  },
107
107
  },
108
+ {
109
+ name: 'arrow',
110
+ options: {},
111
+ },
108
112
  ],
109
113
  } }, { children: itemIcon })), childrenWithoutPopoverAndIcon] })));
110
114
  };
@@ -1,9 +1,7 @@
1
- import { type HTMLAttributes, type PropsWithChildren } from 'react';
2
- type ActionBarItemIconProps = HTMLAttributes<HTMLDivElement> & {
3
- className?: string;
4
- };
5
- declare const ActionBarItemIcon: {
6
- (props: PropsWithChildren<ActionBarItemIconProps>): import("react/jsx-runtime").JSX.Element;
7
- displayName: string;
8
- };
1
+ import React from 'react';
2
+ declare const ActionBarItemIcon: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
3
+ className?: string | undefined;
4
+ } & {
5
+ children?: React.ReactNode;
6
+ } & React.RefAttributes<HTMLDivElement>>;
9
7
  export default ActionBarItemIcon;
@@ -1,13 +1,13 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  // @ts-ignore-next-line importsNotUsedAsValues
4
- import 'react';
4
+ import { forwardRef } from 'react';
5
5
  import classNames from 'classnames';
6
- const ActionBarItemIcon = (props) => {
6
+ const ActionBarItemIcon = forwardRef((props, ref) => {
7
7
  const { className, children } = props, remainingProps = __rest(props, ["className", "children"]);
8
8
  const classes = classNames('ActionBarItemIcon', className);
9
- return (_jsx("div", Object.assign({}, remainingProps, { className: classes }, { children: children })));
10
- };
9
+ return (_jsx("div", Object.assign({}, remainingProps, { className: classes, ref: ref }, { children: children })));
10
+ });
11
11
  // The displayName is used in ActionBarItem for checking the component "isActionBarItemIcon"
12
12
  ActionBarItemIcon.displayName = 'ActionBarItemIcon';
13
13
  export default ActionBarItemIcon;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- import { type Placement } from '../../values/Placement';
2
+ import { PLACEMENT_MAP } from '../popover/Popover';
3
+ import type { ObjectValues } from '../../utils/ObjectValues';
3
4
  export type ActionBarOverlayWidth = 100 | 150 | 200 | 250 | 300 | 350 | 400 | 450 | 500;
4
5
  export type ActionBarOverlayProps = {
5
6
  id: string;
@@ -9,7 +10,7 @@ export type ActionBarOverlayProps = {
9
10
  width?: ActionBarOverlayWidth;
10
11
  onClick?: () => void;
11
12
  style?: object;
12
- placement?: Placement;
13
+ placement?: ObjectValues<typeof PLACEMENT_MAP>;
13
14
  className?: string;
14
15
  };
15
16
  declare const ActionBarOverlay: React.ForwardRefExoticComponent<ActionBarOverlayProps & {
@@ -1,18 +1,18 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ // @ts-ignore-next-line importsNotUsedAsValues
3
4
  import { forwardRef } from 'react';
4
5
  import classNames from 'classnames';
5
- import Popover from 'react-bootstrap/Popover';
6
6
  import noop from 'lodash/fp/noop';
7
- import { PLACEMENT } from '../../values/Placement';
8
- const DEFAULT_PLACEMENT = PLACEMENT.BOTTOM;
7
+ import Popover, { PLACEMENT_MAP } from '../popover/Popover';
8
+ const DEFAULT_PLACEMENT = PLACEMENT_MAP.BOTTOM;
9
9
  const DEFAULT_WIDTH = 250;
10
10
  const ActionBarOverlay = forwardRef((props, ref) => {
11
- const { children, show, preRender, id, title, onClick = noop, width = DEFAULT_WIDTH, style = {}, className, placement = DEFAULT_PLACEMENT } = props, rest = __rest(props, ["children", "show", "preRender", "id", "title", "onClick", "width", "style", "className", "placement"]);
11
+ const { children, show, preRender, id, title, onClick = noop, width = DEFAULT_WIDTH, style = {}, className, placement = DEFAULT_PLACEMENT } = props, remainingProps = __rest(props, ["children", "show", "preRender", "id", "title", "onClick", "width", "style", "className", "placement"]);
12
12
  const adjustedStyles = Object.assign(Object.assign({}, style), { width });
13
13
  const adjustedClassName = preRender && !show ? classNames(className, 'position-offscreen') : className;
14
- const popoverTitleClasses = classNames('ActionBarItemPopover popover-title text-color-dark', className);
15
- const popoverContentClasses = classNames('ActionBarItemPopover popover-content', className);
16
- return (_jsxs(Popover, Object.assign({ ref: ref, id: id, onClick: onClick, placement: placement }, rest, { style: adjustedStyles, className: adjustedClassName }, { children: [title && _jsx(Popover.Title, Object.assign({ className: popoverTitleClasses }, { children: title })), _jsx(Popover.Content, Object.assign({ className: popoverContentClasses }, { children: children }))] })));
14
+ const popoverTitleClasses = classNames('ActionBarItemPopover text-color-dark', className);
15
+ const popoverContentClasses = classNames('ActionBarItemPopover', className);
16
+ return (_jsxs(Popover, Object.assign({ ref: ref, id: id, onClick: onClick, placement: placement }, remainingProps, { style: adjustedStyles, className: adjustedClassName }, { children: [title && _jsx(Popover.Title, Object.assign({ className: popoverTitleClasses }, { children: title })), _jsx(Popover.Content, Object.assign({ className: popoverContentClasses }, { children: children }))] })));
17
17
  });
18
18
  export default ActionBarOverlay;
@@ -7,6 +7,7 @@ import ApplicationLayoutHeader from './ApplicationLayoutHeader';
7
7
  import ApplicationLayoutSidebar from './ApplicationLayoutSidebar';
8
8
  import ApplicationLayoutBody from './ApplicationLayoutBody';
9
9
  import { initDocumentBootstrapping } from '../../utils/init/initDocumentBootstrapping';
10
+ import '../../utils/init/initConfig';
10
11
  // initializes document bootstrapping - keep the import to avoid being tree-shaken
11
12
  // noinspection JSIgnoredPromiseFromCall
12
13
  initDocumentBootstrapping();
@@ -1,14 +1,10 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { forwardRef } from 'react';
4
- import PropTypes from 'prop-types';
5
4
  import classNames from 'classnames';
6
5
  const ApplicationLayoutHeader = forwardRef((props, ref) => {
7
6
  const { className, children } = props, remainingProps = __rest(props, ["className", "children"]);
8
7
  const classes = classNames('ApplicationLayoutHeader', className);
9
8
  return (_jsx("div", Object.assign({ ref: ref }, remainingProps, { className: classes, id: 'ApplicationLayoutHeader' }, { children: children })));
10
9
  });
11
- ApplicationLayoutHeader.propTypes = {
12
- className: PropTypes.string,
13
- };
14
10
  export default ApplicationLayoutHeader;
@@ -12,18 +12,22 @@ const TreeOptions = (props) => {
12
12
  }
13
13
  const dropdownClasses = classNames('display-flex flex-column gap-10', 'width-250', 'padding-15', className);
14
14
  const customDropdown = _jsx("div", Object.assign({ className: dropdownClasses }, { children: treeOptions }));
15
- const dropdown = (_jsx(ButtonDropdown, { title: _jsx("span", { className: 'rioglyph rioglyph-option-vertical', "aria-hidden": 'true' }), bsStyle: 'default', bsSize: 'sm', customDropdown: customDropdown, toggleClassName: 'hover-bg-white border-none text-color-gray hover-text-color-dark', className: 'TreeHeaderOptions', pullRight: true, iconOnly: true }));
15
+ const dropdown = (_jsx(ButtonDropdown, { title: _jsx("span", { className: 'rioglyph rioglyph-option-vertical', "aria-hidden": 'true' }), bsStyle: 'default', bsSize: 'sm', customDropdown: customDropdown, toggleClassName: 'hover-bg-white border-none text-color-gray hover-text-color-dark', className: 'TreeHeaderOptions height-20', pullRight: true, iconOnly: true }));
16
16
  if (treeOptionsTooltip) {
17
- return (_jsx(SimpleTooltip, Object.assign({ content: treeOptionsTooltip, placement: 'bottom', delay: { show: 1000, hide: 0 }, popperConfig: {
17
+ return (_jsx(SimpleTooltip, Object.assign({ content: treeOptionsTooltip, placement: 'bottom-end', delay: { show: 1000, hide: 0 }, popperConfig: {
18
18
  modifiers: [
19
19
  {
20
20
  name: 'offset',
21
21
  options: {
22
- offset: [-20, 10],
22
+ offset: [10, 5],
23
23
  },
24
24
  },
25
+ {
26
+ name: 'arrow',
27
+ options: {},
28
+ },
25
29
  ],
26
- } }, { children: dropdown })));
30
+ } }, { children: _jsx("div", { children: dropdown }) })));
27
31
  }
28
32
  return dropdown;
29
33
  };
@@ -27,7 +27,7 @@ const orderByName = orderBy([
27
27
  var _a;
28
28
  return isNameObject(item)
29
29
  ? item.name.lastName.toLowerCase()
30
- : (_a = item.name.toLowerCase()) !== null && _a !== void 0 ? _a : '';
30
+ : ((_a = item.name.toLowerCase()) !== null && _a !== void 0 ? _a : '');
31
31
  },
32
32
  ], ['asc']);
33
33
  // TODO: extend to use provided external search function instead?
@@ -62,6 +62,14 @@ export type CalendarStripeProps = {
62
62
  * Additional classes set to the calendar element.
63
63
  */
64
64
  className?: string;
65
+ /**
66
+ * Additional classes set to the days wrapper element.
67
+ */
68
+ daysWrapperClassName?: string;
69
+ /**
70
+ * Additional classes set to the days wrapper element.
71
+ */
72
+ dayWrapperClassName?: string;
65
73
  };
66
74
  declare const CalendarStripe: React.ForwardRefExoticComponent<CalendarStripeProps & React.RefAttributes<HTMLDivElement>>;
67
75
  export default CalendarStripe;
@@ -6,6 +6,7 @@ import noop from 'lodash/noop';
6
6
  import useAfterMount from '../../hooks/useAfterMount';
7
7
  import useElementSize from '../../hooks/useElementSize';
8
8
  import usePrevious from '../../hooks/usePrevious';
9
+ import { hasAlignItemsClass, hasAlignSelfClass, hasBgClass, hasBorderClass, hasCursorClass, hasDisplayClass, hasFlexClass, hasHoverScaleClass, hasHoverTextColorClass, hasOverflowClass, hasPaddingClass, hasRoundedClass, hasSpaceClass, hasTextColorClass, hasTextSizeClass, hasUserSelectClass, } from '../../utils/hasUtilityClass';
9
10
  const DEFAULT_MIN_WITH = 200;
10
11
  const DEFAULT_MIN_DAYS = 1;
11
12
  const DEFAULT_MAX_DAYS = 7;
@@ -28,7 +29,7 @@ const getFirstColumnItem = (node) => {
28
29
  return getFirstColumnItem(node.children[0]);
29
30
  };
30
31
  const CalendarStripe = forwardRef((props, ref) => {
31
- const { minDayWith = DEFAULT_MIN_WITH, minDays = DEFAULT_MIN_DAYS, maxDays = DEFAULT_MAX_DAYS, render, renderDay, skipWeekends = false, startDate = new Date(), onNextClick = noop, onPreviousClick = noop, buttonClassName = '', className = '', } = props;
32
+ const { minDayWith = DEFAULT_MIN_WITH, minDays = DEFAULT_MIN_DAYS, maxDays = DEFAULT_MAX_DAYS, render, renderDay, skipWeekends = false, startDate = new Date(), onNextClick = noop, onPreviousClick = noop, buttonClassName = '', className = '', daysWrapperClassName = '', dayWrapperClassName = '', } = props;
32
33
  if (render) {
33
34
  console.warn('CalendarStripe has set the "render" prop deprecated. This will be removed in the upcoming releases,' +
34
35
  ' Please use the "renderDay" prop instead.');
@@ -114,8 +115,10 @@ const CalendarStripe = forwardRef((props, ref) => {
114
115
  addDays = false;
115
116
  }
116
117
  }
117
- const wrapperClassName = classNames('CalenderStripe', 'display-flex', 'align-items-center', 'overflow-hidden', 'bg-white', 'border', 'rounded', className);
118
- const baseButtonClassName = classNames('align-items-center', 'align-self-stretch', 'display-flex', 'hover-scale-105', 'hover-text-color-darkest', 'padding-10', 'cursor-pointer', 'text-color-darker', 'text-size-12', buttonClassName);
119
- return (_jsxs("div", Object.assign({ ref: ref, className: wrapperClassName }, { children: [_jsx("div", Object.assign({ className: baseButtonClassName, onClick: handlePrev }, { children: _jsx("span", { className: 'rioglyph rioglyph-chevron-left' }) })), _jsx("div", Object.assign({ className: 'flex-1-1 overflow-hidden', ref: columnWrapperRef }, { children: _jsx(AnimatePresence, Object.assign({ exitBeforeEnter: true, custom: animationDirection }, { children: _jsx(motion.div, Object.assign({ variants: variants, initial: enableInitialAnimation ? 'pageEnter' : false, animate: 'pageCenter', custom: animationDirection, transition: { duration: ANIMATION_DURATION } }, { children: _jsx("div", Object.assign({ className: 'ColumnWrapper display-flex space-x--1 user-select-none' }, { children: dates.map(date => (_jsxs("div", Object.assign({ className: `${ITEM_NAME} flex-1-1` }, { children: [renderDay ? renderDay(date) : null, render && React.cloneElement(_jsx(_Fragment, { children: render }), { date })] }), `${getDateString(date)}`))) })) }), getDateString(firstDate)) })) })), _jsx("div", Object.assign({ className: baseButtonClassName, onClick: handleNext }, { children: _jsx("span", { className: 'rioglyph rioglyph-chevron-right' }) }))] })));
118
+ const wrapperClassNames = classNames('CalenderStripe', !hasDisplayClass(className) && 'display-flex', !hasAlignItemsClass(className) && 'align-items-center', !hasOverflowClass(className) && 'overflow-hidden', !hasBgClass(className) && 'bg-white', !hasBorderClass(className) && 'border', !hasRoundedClass(className) && 'rounded', className);
119
+ const baseButtonClassNames = classNames(!hasAlignItemsClass(buttonClassName) && 'align-items-center', !hasDisplayClass(buttonClassName) && 'display-flex', !hasHoverScaleClass(buttonClassName) && 'hover-scale-105', !hasHoverTextColorClass(buttonClassName) && 'hover-text-color-darkest', !hasPaddingClass(buttonClassName) && 'padding-10', !hasCursorClass(buttonClassName) && 'cursor-pointer', !hasTextColorClass(buttonClassName) && 'text-color-darker', !hasTextSizeClass(buttonClassName) && 'text-size-12', !hasAlignSelfClass(buttonClassName) && 'align-self-stretch', buttonClassName);
120
+ const daysWrapperClassNames = classNames(!hasDisplayClass(daysWrapperClassName) && 'display-flex', !hasSpaceClass(daysWrapperClassName) && 'space-x--1', !hasUserSelectClass(daysWrapperClassName) && 'user-select-none', daysWrapperClassName);
121
+ const dayWrapperClassNames = classNames(ITEM_NAME, !hasFlexClass(dayWrapperClassName) && 'flex-1-1-0', !hasSpaceClass(dayWrapperClassName) && 'space-x--1', !hasUserSelectClass(dayWrapperClassName) && 'user-select-none', dayWrapperClassName);
122
+ return (_jsxs("div", Object.assign({ ref: ref, className: wrapperClassNames }, { children: [_jsx("div", Object.assign({ className: baseButtonClassNames, onClick: handlePrev }, { children: _jsx("span", { className: 'rioglyph rioglyph-chevron-left' }) })), _jsx("div", Object.assign({ className: 'flex-1-1 overflow-hidden', ref: columnWrapperRef }, { children: _jsx(AnimatePresence, Object.assign({ exitBeforeEnter: true, custom: animationDirection }, { children: _jsx(motion.div, Object.assign({ variants: variants, initial: enableInitialAnimation ? 'pageEnter' : false, animate: 'pageCenter', custom: animationDirection, transition: { duration: ANIMATION_DURATION } }, { children: _jsx("div", Object.assign({ className: daysWrapperClassNames }, { children: dates.map(date => (_jsxs("div", Object.assign({ className: dayWrapperClassNames }, { children: [renderDay ? renderDay(date) : null, render && React.cloneElement(_jsx(_Fragment, { children: render }), { date })] }), `${getDateString(date)}`))) })) }), getDateString(firstDate)) })) })), _jsx("div", Object.assign({ className: baseButtonClassNames, onClick: handleNext }, { children: _jsx("span", { className: 'rioglyph rioglyph-chevron-right' }) }))] })));
120
123
  });
121
124
  export default CalendarStripe;
@@ -2,6 +2,11 @@
2
2
  import type { AreaProps as RechartsAreaProps } from 'recharts';
3
3
  export type AreaProps = Omit<RechartsAreaProps, 'ref'> & {
4
4
  strokeColor?: string;
5
+ dataKey?: string;
6
+ unit?: string;
7
+ legendType?: string;
8
+ type?: string;
9
+ isAnimationActive?: boolean;
5
10
  };
6
11
  declare const Area: React.FC<AreaProps>;
7
12
  export default Area;
@@ -1,10 +1,2 @@
1
- const Area = () => null;
2
- Area.defaultProps = {
3
- dataKey: 'value',
4
- unit: '',
5
- strokeColor: 'color-coldplay-fountain',
6
- legendType: 'square',
7
- type: 'monotone',
8
- isAnimationActive: true,
9
- };
1
+ const Area = ({ dataKey = 'value', unit = '', strokeColor = 'color-coldplay-fountain', legendType = 'square', type = 'monotone', isAnimationActive = true, }) => null;
10
2
  export default Area;
@@ -6,6 +6,7 @@ import { type LegendProps } from './Legend';
6
6
  import type { AreaProps } from './Area';
7
7
  import type { GridProps } from './ChartGrid';
8
8
  import type { ResponsiveContainerProps } from './ResponsiveContainer';
9
+ import type { ReferenceLineProps } from './ReferenceLine';
9
10
  type RechartsAreaChartProps = React.ComponentProps<typeof RechartsAreaChart>;
10
11
  export type AreaChartProps<T extends object> = Omit<RechartsAreaChartProps, 'data'> & {
11
12
  width?: number;
@@ -15,6 +16,7 @@ export type AreaChartProps<T extends object> = Omit<RechartsAreaChartProps, 'dat
15
16
  dataKey?: string | number | ((obj: T) => any);
16
17
  gradients?: React.ReactElement<AreaGradientProps>[];
17
18
  areas: React.ReactElement<AreaProps>[];
19
+ referenceLines?: React.ReactElement<ReferenceLineProps>[];
18
20
  xAxisOptions?: XAxisProps;
19
21
  yAxisOptions?: YAxisProps;
20
22
  gridOptions?: GridProps;
@@ -1,16 +1,16 @@
1
1
  import { __rest } from "tslib";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { createElement as _createElement } from "react";
4
4
  // @ts-ignore-next-line importsNotUsedAsValues
5
5
  import 'react';
6
- import { AreaChart as RechartsAreaChart, Area as RechartsArea, XAxis, YAxis, Brush, CartesianGrid, ResponsiveContainer, } from 'recharts';
6
+ import { AreaChart as RechartsAreaChart, Area as RechartsArea, 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 AreaGradient, { DEFAULT_ARIA_GRADIENT_ID } from './AreaGradient';
10
10
  import ChartTooltip from './ChartTooltip';
11
- import Legend from './Legend';
11
+ import { getLegendDefaultProps } from './Legend';
12
12
  const AreaChart = (props) => {
13
- const { width, height, data = [], dataUnit = '', dataKey = 'value', gradients = [], areas = [], xAxisOptions, yAxisOptions, gridOptions, containerOptions, showXAxis = true, showYAxis = false, showGrid = false, legend, brush = false, tooltip = true } = props, remainingProps = __rest(props, ["width", "height", "data", "dataUnit", "dataKey", "gradients", "areas", "xAxisOptions", "yAxisOptions", "gridOptions", "containerOptions", "showXAxis", "showYAxis", "showGrid", "legend", "brush", "tooltip"]);
13
+ const { width, height, data = [], dataUnit = '', dataKey = 'value', gradients = [], areas = [], referenceLines = [], xAxisOptions, yAxisOptions, gridOptions, containerOptions, showXAxis = true, showYAxis = false, showGrid = false, legend, brush = false, tooltip = true } = props, remainingProps = __rest(props, ["width", "height", "data", "dataUnit", "dataKey", "gradients", "areas", "referenceLines", "xAxisOptions", "yAxisOptions", "gridOptions", "containerOptions", "showXAxis", "showYAxis", "showGrid", "legend", "brush", "tooltip"]);
14
14
  const areasWithGradient = areas.map(area => {
15
15
  const _a = area.props, { strokeColor } = _a, remainingAreaProps = __rest(_a, ["strokeColor"]);
16
16
  const gradientId = area.key;
@@ -21,7 +21,10 @@ const AreaChart = (props) => {
21
21
  };
22
22
  });
23
23
  const tooltipProps = isObject(tooltip) ? tooltip.props : {};
24
- const legendProps = isObject(legend) ? legend.props : {};
25
- return (_jsx(ResponsiveContainer, Object.assign({}, containerOptions, { children: _jsxs(RechartsAreaChart, Object.assign({ width: width, height: height, data: data, margin: { top: 15, right: 15, left: 15, bottom: 15 } }, remainingProps, { children: [_jsxs("defs", { children: [gradients, areasWithGradient.map(areaWithGradient => areaWithGradient.gradient)] }), 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)), areasWithGradient.map(areaWithGradient => areaWithGradient.area), brush && _jsx(Brush, { stroke: getColor('gray') })] })) })));
24
+ const legendProps = isObject(legend) ? Object.assign(Object.assign({}, getLegendDefaultProps()), legend.props) : {};
25
+ return (_jsx(ResponsiveContainer, Object.assign({}, containerOptions, { children: _jsxs(RechartsAreaChart, Object.assign({ width: width, height: height, data: data, margin: { top: 15, right: 15, left: 15, bottom: 15 } }, remainingProps, { children: [_jsxs("defs", { children: [gradients, areasWithGradient.map(areaWithGradient => areaWithGradient.gradient)] }), 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 && legendProps && (_jsx(_Fragment, { children: _jsx(RechartsLegend, Object.assign({ wrapperStyle: legendProps.verticalAlign === 'bottom' ? { bottom: 0 } : legendProps.wrapperStyle }, legendProps)) })), areasWithGradient.map(areaWithGradient => areaWithGradient.area), referenceLines.map(referenceLine => {
26
+ const _a = referenceLine.props, { stroke } = _a, remainingReferenceLineProps = __rest(_a, ["stroke"]);
27
+ return (_createElement(RechartsReferenceLine, Object.assign({}, remainingReferenceLineProps, { key: referenceLine.key, stroke: getColor(stroke) })));
28
+ }), brush && _jsx(Brush, { stroke: getColor('gray') })] })) })));
26
29
  };
27
30
  export default AreaChart;
@@ -2,16 +2,16 @@ 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 { BarChart as RechartsBarChart, Bar as RechartsBar, XAxis, YAxis, Brush, Cell, CartesianGrid, ResponsiveContainer, } from 'recharts';
5
+ import { BarChart as RechartsBarChart, Bar as RechartsBar, Legend as RechartsLegend, XAxis, YAxis, Brush, Cell, CartesianGrid, ResponsiveContainer, } from 'recharts';
6
6
  import isFunction from 'lodash/fp/isFunction';
7
7
  import isObject from 'lodash/fp/isObject';
8
8
  import { getFromDefaultColors, getColor, mapGridOptions, CURSOR_BACKGROUND_COLOR } from './chartHelper';
9
9
  import ChartTooltip from './ChartTooltip';
10
- import Legend from './Legend';
10
+ import { getLegendDefaultProps } from './Legend';
11
11
  const BarChart = (props) => {
12
12
  const { width, height, data = [], dataUnit, dataKey = 'value', layout = 'horizontal', legend = false, bars = [], xAxisOptions, yAxisOptions, gridOptions, containerOptions, showGrid = false, showXAxis = true, showYAxis = true, useDataColors = false, brush = false, tooltip = true } = props, remainingProps = __rest(props, ["width", "height", "data", "dataUnit", "dataKey", "layout", "legend", "bars", "xAxisOptions", "yAxisOptions", "gridOptions", "containerOptions", "showGrid", "showXAxis", "showYAxis", "useDataColors", "brush", "tooltip"]);
13
13
  const tooltipProps = isObject(tooltip) ? tooltip.props : {};
14
- const legendProps = isObject(legend) ? legend.props : {};
14
+ const legendProps = isObject(legend) ? Object.assign(Object.assign({}, getLegendDefaultProps()), legend.props) : {};
15
15
  let legendPayload;
16
16
  if (useDataColors) {
17
17
  legendPayload = data.map((entry, index) => {
@@ -19,7 +19,7 @@ const BarChart = (props) => {
19
19
  return Object.assign(Object.assign({}, entry), { value: isFunction(dataKey) ? dataKey(entry) : entry[dataKey], color: legendColor });
20
20
  });
21
21
  }
22
- return (_jsx(ResponsiveContainer, Object.assign({}, containerOptions, { children: _jsxs(RechartsBarChart, Object.assign({ layout: layout, width: width, height: height, data: data }, 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)), legend && _jsx(Legend, Object.assign({}, legendProps, { payload: legendPayload })), tooltip && _jsx(ChartTooltip, Object.assign({ cursor: { fill: CURSOR_BACKGROUND_COLOR } }, tooltipProps)), bars.map(bar => {
22
+ return (_jsx(ResponsiveContainer, Object.assign({}, containerOptions, { children: _jsxs(RechartsBarChart, Object.assign({ layout: layout, width: width, height: height, data: data }, 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({ cursor: { fill: CURSOR_BACKGROUND_COLOR } }, tooltipProps)), legend && _jsx(RechartsLegend, Object.assign({ payload: useDataColors ? legendPayload : undefined }, legendProps)), bars.map(bar => {
23
23
  const _a = bar.props, { color } = _a, remainingBarProps = __rest(_a, ["color"]);
24
24
  const cellColor = color && getColor(color);
25
25
  return (_jsx(RechartsBar, Object.assign({ unit: dataUnit }, remainingBarProps, { fill: cellColor }, { children: useDataColors &&
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import type { LabelProps as RechartsLabelProps } from 'recharts';
3
+ export type LabelProps = Omit<RechartsLabelProps, 'ref'> & {};
4
+ declare const ChartLabel: React.FC<LabelProps>;
5
+ export default ChartLabel;
@@ -0,0 +1,2 @@
1
+ const ChartLabel = props => null;
2
+ export default ChartLabel;
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import { ComposedChart as RechartsComposedChart, type XAxisProps, type YAxisProps } from 'recharts';
3
+ import { ChartTooltipProps } from './ChartTooltip';
4
+ import { type LegendProps } from './Legend';
5
+ import type { LineProps } from './Line';
6
+ import type { BarProps } from './Bar';
7
+ import type { ReferenceLineProps } from './ReferenceLine';
8
+ import type { GridProps } from './ChartGrid';
9
+ import type { ResponsiveContainerProps } from './ResponsiveContainer';
10
+ import type { AreaProps } from './Area';
11
+ type RechartsComposedChartProps = React.ComponentProps<typeof RechartsComposedChart>;
12
+ export type ComposedChartProps<T extends object> = Omit<RechartsComposedChartProps, 'data'> & {
13
+ width?: number;
14
+ height?: number;
15
+ data: T[];
16
+ dataUnit?: string;
17
+ dataKey?: string | number | ((obj: T) => any);
18
+ lines?: React.ReactElement<LineProps>[];
19
+ bars?: React.ReactElement<BarProps>[];
20
+ areas?: React.ReactElement<AreaProps>[];
21
+ referenceLines?: React.ReactElement<ReferenceLineProps>[];
22
+ xAxisOptions?: XAxisProps;
23
+ yAxisOptions?: YAxisProps;
24
+ gridOptions?: GridProps;
25
+ containerOptions?: ResponsiveContainerProps;
26
+ showXAxis?: boolean;
27
+ showYAxis?: boolean;
28
+ showGrid?: boolean;
29
+ legend?: React.ReactElement<LegendProps> | boolean;
30
+ tooltip?: React.ReactElement<ChartTooltipProps> | boolean;
31
+ brush?: boolean;
32
+ };
33
+ declare const ComposedChart: <T extends object>(props: ComposedChartProps<T>) => import("react/jsx-runtime").JSX.Element;
34
+ export default ComposedChart;
@@ -0,0 +1,30 @@
1
+ import { __rest } from "tslib";
2
+ import { createElement as _createElement } from "react";
3
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
+ // @ts-ignore-next-line importsNotUsedAsValues
5
+ import 'react';
6
+ import { ComposedChart as RechartsComposedChart, Line as RechartsLine, Bar as RechartsBar, Area as RechartsArea, ReferenceLine as RechartsReferenceLine, Legend as RechartsLegend, XAxis, YAxis, Brush, CartesianGrid, ResponsiveContainer, } from 'recharts';
7
+ import isObject from 'lodash/fp/isObject';
8
+ import { getColor, mapGridOptions } from './chartHelper';
9
+ import ChartTooltip from './ChartTooltip';
10
+ import { getLegendDefaultProps } from './Legend';
11
+ const ComposedChart = (props) => {
12
+ 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 = __rest(props, ["width", "height", "data", "dataUnit", "dataKey", "lines", "bars", "areas", "referenceLines", "xAxisOptions", "yAxisOptions", "gridOptions", "containerOptions", "showXAxis", "showYAxis", "showGrid", "legend", "brush", "tooltip"]);
13
+ const tooltipProps = isObject(tooltip) ? tooltip.props : {};
14
+ const legendProps = isObject(legend) ? Object.assign(Object.assign({}, getLegendDefaultProps()), legend.props) : {};
15
+ return (_jsx(ResponsiveContainer, Object.assign({}, containerOptions, { children: _jsxs(RechartsComposedChart, 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)), areas.map(area => {
16
+ const _a = area.props, { strokeColor, fill } = _a, remainingAreaProps = __rest(_a, ["strokeColor", "fill"]);
17
+ return (_createElement(RechartsArea, Object.assign({}, remainingAreaProps, { key: area.key, stroke: getColor(strokeColor), fill: getColor(fill) })));
18
+ }), bars.map(bar => {
19
+ const _a = bar.props, { color } = _a, remainingBarProps = __rest(_a, ["color"]);
20
+ const cellColor = color && getColor(color);
21
+ return _jsx(RechartsBar, Object.assign({ unit: dataUnit }, remainingBarProps, { fill: cellColor }), bar.key);
22
+ }), lines.map(line => {
23
+ const _a = line.props, { strokeColor } = _a, remainingLineProps = __rest(_a, ["strokeColor"]);
24
+ return _createElement(RechartsLine, Object.assign({}, remainingLineProps, { key: line.key, stroke: getColor(strokeColor) }));
25
+ }), referenceLines.map(referenceLine => {
26
+ const _a = referenceLine.props, { stroke } = _a, remainingReferenceLineProps = __rest(_a, ["stroke"]);
27
+ return (_createElement(RechartsReferenceLine, Object.assign({}, remainingReferenceLineProps, { key: referenceLine.key, stroke: getColor(stroke) })));
28
+ }), brush && _jsx(Brush, { stroke: getColor('gray') })] })) })));
29
+ };
30
+ export default ComposedChart;
@@ -1,18 +1,16 @@
1
- import { type LegendProps as RechartsLegendProps } from 'recharts';
1
+ import type { LegendProps as RechartsLegendProps } from 'recharts';
2
2
  import type { Formatter, Payload } from 'recharts/types/component/DefaultLegendContent';
3
3
  export type LegendFormatter = Formatter;
4
4
  export type LegendPayload = Payload;
5
5
  export type LegendProps = Omit<RechartsLegendProps, 'ref' | 'formatter'> & {
6
6
  formatter?: (value: any, entry: any, index: number) => void;
7
7
  };
8
- declare const Legend: {
9
- (props: LegendProps): import("react/jsx-runtime").JSX.Element;
10
- defaultProps: {
11
- iconType: string;
12
- iconSize: number;
13
- layout: string;
14
- align: string;
15
- verticalAlign: string;
16
- };
8
+ export declare const getLegendDefaultProps: () => {
9
+ iconType: string;
10
+ iconSize: number;
11
+ layout: string;
12
+ align: string;
13
+ verticalAlign: string;
17
14
  };
15
+ declare const Legend: (props: LegendProps) => null;
18
16
  export default Legend;
@@ -1,20 +1,11 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
1
  // @ts-ignore-next-line importsNotUsedAsValues
3
2
  import 'react';
4
- import { Legend as RechartsLegend } from 'recharts';
5
- const Legend = (props) => {
6
- const { verticalAlign, wrapperStyle } = props;
7
- return (_jsx(RechartsLegend
8
- // biome-ignore lint/suspicious/noExplicitAny: <explanation>
9
- , Object.assign({
10
- // biome-ignore lint/suspicious/noExplicitAny: <explanation>
11
- formatter: props.formatter, wrapperStyle: verticalAlign === 'bottom' ? { bottom: 0 } : wrapperStyle }, props)));
12
- };
13
- Legend.defaultProps = {
3
+ export const getLegendDefaultProps = () => ({
14
4
  iconType: 'circle',
15
5
  iconSize: 12,
16
6
  layout: 'vertical',
17
7
  align: 'right',
18
8
  verticalAlign: 'top',
19
- };
9
+ });
10
+ const Legend = (props) => null;
20
11
  export default Legend;
@@ -2,6 +2,11 @@
2
2
  import type { LineProps as RechartsLineProps } from 'recharts';
3
3
  export type LineProps = Omit<RechartsLineProps, 'ref'> & {
4
4
  strokeColor?: string;
5
+ dataKey?: string;
6
+ unit?: string;
7
+ legendType?: string;
8
+ type?: string;
9
+ isAnimationActive?: boolean;
5
10
  };
6
11
  declare const Line: React.FC<LineProps>;
7
12
  export default Line;
@@ -1,10 +1,2 @@
1
- const Line = () => null;
2
- Line.defaultProps = {
3
- dataKey: 'value',
4
- unit: '',
5
- strokeColor: 'color-coldplay-fountain',
6
- legendType: 'square',
7
- type: 'monotone',
8
- isAnimationActive: true,
9
- };
1
+ const Line = ({ dataKey = 'value', unit = '', strokeColor = 'color-coldplay-fountain', legendType = 'square', type = 'monotone', isAnimationActive = true, }) => null;
10
2
  export default Line;