@rio-cloud/rio-uikit 1.2.2 → 1.3.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 (121) hide show
  1. package/.DS_Store +0 -0
  2. package/DateRangePicker.d.ts +6 -7
  3. package/DateRangePicker.js +7 -3
  4. package/README.md +3 -3
  5. package/components/actionBarItem/ActionBarItem.js +5 -1
  6. package/components/actionBarItem/ActionBarItemIcon.d.ts +6 -8
  7. package/components/actionBarItem/ActionBarItemIcon.js +4 -4
  8. package/components/actionBarItem/ActionBarOverlay.d.ts +3 -2
  9. package/components/actionBarItem/ActionBarOverlay.js +7 -7
  10. package/components/applicationLayout/ApplicationLayout.js +1 -0
  11. package/components/applicationLayout/ApplicationLayoutHeader.js +0 -4
  12. package/components/assetTree/TreeOptions.js +1 -1
  13. package/components/assetTree/treeUtils.js +1 -1
  14. package/components/calendarStripe/CalendarStripe.d.ts +8 -0
  15. package/components/calendarStripe/CalendarStripe.js +7 -4
  16. package/components/dataTabs/DataTab.js +2 -1
  17. package/components/dialog/SimpleDialog.d.ts +2 -2
  18. package/components/dialog/SplitDialog.d.ts +6 -0
  19. package/components/expander/ExpanderList.js +2 -1
  20. package/components/listMenu/ListMenu.js +1 -1
  21. package/components/onboarding/OnboardingTip.d.ts +2 -2
  22. package/components/onboarding/OnboardingTip.js +2 -0
  23. package/components/overlay/OverlayTrigger.d.ts +92 -3
  24. package/components/overlay/OverlayTrigger.js +140 -8
  25. package/components/popover/Popover.d.ts +27 -9
  26. package/components/popover/Popover.js +18 -5
  27. package/components/slider/RangeSlider.d.ts +7 -0
  28. package/components/slider/RangeSlider.js +10 -4
  29. package/components/slider/Slider.d.ts +7 -0
  30. package/components/slider/Slider.js +5 -3
  31. package/components/states/CustomState.js +4 -5
  32. package/components/switch/Switch.d.ts +7 -0
  33. package/components/switch/Switch.js +4 -3
  34. package/components/tooltip/SimpleTooltip.d.ts +2 -2
  35. package/components/tooltip/Tooltip.d.ts +2 -2
  36. package/components/tooltip/Tooltip.js +6 -2
  37. package/hooks/useClickOutside.d.ts +1 -0
  38. package/hooks/useClickOutside.js +9 -3
  39. package/hooks/useElapsedTime.d.ts +26 -0
  40. package/hooks/useElapsedTime.js +36 -0
  41. package/hooks/useEvent.d.ts +1 -1
  42. package/hooks/useTimeout.d.ts +5 -0
  43. package/hooks/useTimeout.js +39 -1
  44. package/hooks/useUncontrollable.d.ts +13 -0
  45. package/hooks/useUncontrollable.js +41 -0
  46. package/lib/es/DateRangePicker.d.ts +6 -7
  47. package/lib/es/DateRangePicker.js +5 -1
  48. package/lib/es/components/actionBarItem/ActionBarItem.js +5 -1
  49. package/lib/es/components/actionBarItem/ActionBarItemIcon.d.ts +6 -8
  50. package/lib/es/components/actionBarItem/ActionBarItemIcon.js +4 -4
  51. package/lib/es/components/actionBarItem/ActionBarOverlay.d.ts +3 -2
  52. package/lib/es/components/actionBarItem/ActionBarOverlay.js +7 -7
  53. package/lib/es/components/applicationLayout/ApplicationLayout.js +1 -0
  54. package/lib/es/components/applicationLayout/ApplicationLayoutHeader.js +0 -4
  55. package/lib/es/components/assetTree/TreeOptions.js +1 -1
  56. package/lib/es/components/assetTree/treeUtils.js +1 -1
  57. package/lib/es/components/calendarStripe/CalendarStripe.d.ts +8 -0
  58. package/lib/es/components/calendarStripe/CalendarStripe.js +7 -4
  59. package/lib/es/components/dataTabs/DataTab.js +2 -1
  60. package/lib/es/components/dialog/SimpleDialog.d.ts +2 -2
  61. package/lib/es/components/dialog/SplitDialog.d.ts +6 -0
  62. package/lib/es/components/expander/ExpanderList.js +2 -1
  63. package/lib/es/components/listMenu/ListMenu.js +1 -1
  64. package/lib/es/components/onboarding/OnboardingTip.d.ts +2 -2
  65. package/lib/es/components/onboarding/OnboardingTip.js +2 -0
  66. package/lib/es/components/overlay/OverlayTrigger.d.ts +92 -3
  67. package/lib/es/components/overlay/OverlayTrigger.js +139 -7
  68. package/lib/es/components/popover/Popover.d.ts +27 -9
  69. package/lib/es/components/popover/Popover.js +20 -6
  70. package/lib/es/components/slider/RangeSlider.d.ts +7 -0
  71. package/lib/es/components/slider/RangeSlider.js +10 -4
  72. package/lib/es/components/slider/Slider.d.ts +7 -0
  73. package/lib/es/components/slider/Slider.js +5 -3
  74. package/lib/es/components/states/CustomState.js +4 -5
  75. package/lib/es/components/switch/Switch.d.ts +7 -0
  76. package/lib/es/components/switch/Switch.js +4 -3
  77. package/lib/es/components/tooltip/SimpleTooltip.d.ts +2 -2
  78. package/lib/es/components/tooltip/Tooltip.d.ts +2 -2
  79. package/lib/es/components/tooltip/Tooltip.js +5 -1
  80. package/lib/es/hooks/useClickOutside.d.ts +1 -0
  81. package/lib/es/hooks/useClickOutside.js +11 -3
  82. package/lib/es/hooks/useElapsedTime.d.ts +26 -0
  83. package/lib/es/hooks/useElapsedTime.js +38 -0
  84. package/lib/es/hooks/useEvent.d.ts +1 -1
  85. package/lib/es/hooks/useTimeout.d.ts +5 -0
  86. package/lib/es/hooks/useTimeout.js +40 -0
  87. package/lib/es/hooks/useUncontrollable.d.ts +13 -0
  88. package/lib/es/hooks/useUncontrollable.js +46 -0
  89. package/lib/es/styles/variables/colors/colors.json +3 -3
  90. package/lib/es/useElapsedTime.d.ts +2 -0
  91. package/lib/es/useElapsedTime.js +7 -0
  92. package/lib/es/utils/currentColors.d.ts +3 -0
  93. package/lib/es/utils/currentColors.js +14 -0
  94. package/lib/es/utils/hasUtilityClass.d.ts +30 -0
  95. package/lib/es/utils/hasUtilityClass.js +71 -0
  96. package/lib/es/utils/init/initCSS.js +12 -0
  97. package/lib/es/utils/mergeRefs.d.ts +1 -1
  98. package/lib/es/values/Trigger.d.ts +1 -2
  99. package/lib/es/version.json +1 -1
  100. package/package.json +18 -12
  101. package/styles/variables/colors/colors.json +3 -3
  102. package/useElapsedTime.d.ts +2 -0
  103. package/useElapsedTime.js +2 -0
  104. package/utils/currentColors.d.ts +3 -0
  105. package/utils/currentColors.js +10 -0
  106. package/utils/hasUtilityClass.d.ts +30 -0
  107. package/utils/hasUtilityClass.js +40 -0
  108. package/utils/init/initCSS.js +12 -0
  109. package/utils/mergeRefs.d.ts +1 -1
  110. package/values/Trigger.d.ts +1 -2
  111. package/version.json +1 -1
  112. package/components/.DS_Store +0 -0
  113. package/components/feedback/Feedback.d.ts +0 -2
  114. package/components/feedback/Feedback.js +0 -5
  115. package/components/map/.DS_Store +0 -0
  116. package/components/map/components/.DS_Store +0 -0
  117. package/lib/.DS_Store +0 -0
  118. package/lib/es/.DS_Store +0 -0
  119. package/lib/es/components/.DS_Store +0 -0
  120. package/lib/es/components/feedback/Feedback.d.ts +0 -2
  121. package/lib/es/components/feedback/Feedback.js +0 -7
package/.DS_Store CHANGED
Binary file
@@ -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
+ };
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
 
@@ -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,7 +12,7 @@ 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
17
  return (_jsx(SimpleTooltip, Object.assign({ content: treeOptionsTooltip, placement: 'bottom', delay: { show: 1000, hide: 0 }, popperConfig: {
18
18
  modifiers: [
@@ -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;
@@ -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
  }
@@ -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. If the function returns
30
+ * `false` the dialog will not be closed
31
+ * @returns
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');
@@ -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";
@@ -1,15 +1,147 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // @ts-ignore-next-line importsNotUsedAsValues
3
- import 'react';
4
- import BSOverlayTrigger from 'react-bootstrap/OverlayTrigger';
5
- import omit from 'lodash/omit';
3
+ import React, { useCallback, useEffect, useRef, useState } from 'react';
4
+ import ReactDOM from 'react-dom';
5
+ import { usePopper } from 'react-popper';
6
6
  import { PLACEMENT } from '../../values/Placement';
7
7
  import { TRIGGER } from '../../values/Trigger';
8
+ import mergeRefs from '../../utils/mergeRefs';
9
+ import { useClickOutsideWithRef } from '../../hooks/useClickOutside';
10
+ import { useChainedTimeout } from '../../hooks/useTimeout';
11
+ import { useUncontrolledProp } from '../../hooks/useUncontrollable';
8
12
  const OverlayTrigger = (props) => {
9
- const usedProps = Object.assign({ rootClose: true }, omit(props, 'children'));
10
- const { children } = props;
11
- // @ts-ignore
12
- return _jsx(BSOverlayTrigger, Object.assign({}, usedProps, { children: children }));
13
+ var _a, _b;
14
+ const { show: propsShow, defaultShow = false, enablePortal = true, trigger = TRIGGER.HOVER, delay, overlay, placement = 'top', popperConfig, onToggle = () => { }, rootClose = true, children, } = props;
15
+ // Use a hook to handle controlled props that work in pairs like in this case the "show" and "onToggle"
16
+ // props. It returns a setter function that automatically triggers the callback.
17
+ const [show, setShow] = useUncontrolledProp(propsShow, defaultShow, onToggle);
18
+ const hoverStateRef = useRef('');
19
+ const timeout = useChainedTimeout();
20
+ const { onFocus, onBlur, onClick } = typeof children !== 'function' ? React.Children.only(children).props : {};
21
+ // Simple implementation of mouseEnter and mouseLeave.
22
+ // React's built version is broken: https://github.com/facebook/react/issues/4251
23
+ // for cases when the trigger is disabled and mouseOut/Over can cause flicker
24
+ // moving from one child element to another.
25
+ const handleMouseOverOut = (handler, args, relatedNative) => {
26
+ const [event] = args;
27
+ const target = event.currentTarget;
28
+ const related = event.relatedTarget;
29
+ if ((!related || related !== target) && !target.contains(related)) {
30
+ handler(...args);
31
+ }
32
+ };
33
+ const handleShow = () => {
34
+ timeout.clear();
35
+ hoverStateRef.current = 'show';
36
+ if (typeof delay === 'number' || !(delay === null || delay === void 0 ? void 0 : delay.show)) {
37
+ setShow(true);
38
+ return;
39
+ }
40
+ timeout.set(() => {
41
+ if (hoverStateRef.current === 'show') {
42
+ setShow(true);
43
+ }
44
+ }, typeof delay === 'number' ? delay : delay === null || delay === void 0 ? void 0 : delay.show);
45
+ };
46
+ const handleHide = () => {
47
+ timeout.clear();
48
+ hoverStateRef.current = 'hide';
49
+ if (typeof delay === 'number' || !(delay === null || delay === void 0 ? void 0 : delay.hide)) {
50
+ setShow(false);
51
+ return;
52
+ }
53
+ timeout.set(() => {
54
+ if (hoverStateRef.current === 'hide') {
55
+ setShow(false);
56
+ }
57
+ }, typeof delay === 'number' ? delay : delay === null || delay === void 0 ? void 0 : delay.hide);
58
+ };
59
+ const handleFocus = useCallback((...args) => {
60
+ handleShow();
61
+ onFocus === null || onFocus === void 0 ? void 0 : onFocus(...args);
62
+ }, [handleShow, onFocus]);
63
+ const handleBlur = useCallback((...args) => {
64
+ handleHide();
65
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(...args);
66
+ }, [handleHide, onBlur]);
67
+ const handleClick = useCallback((...args) => {
68
+ setShow(!show);
69
+ onClick === null || onClick === void 0 ? void 0 : onClick(...args);
70
+ }, [onClick, setShow, show]);
71
+ const handleMouseOver = useCallback((...args) => {
72
+ handleMouseOverOut(handleShow, args, 'fromElement');
73
+ }, [handleShow]);
74
+ const handleMouseOut = useCallback((...args) => {
75
+ handleMouseOverOut(handleHide, args, 'toElement');
76
+ }, [handleHide]);
77
+ const [triggerNode, setTriggerNode] = useState(null);
78
+ const [popperElement, setPopperElement] = useState(null);
79
+ const [arrowElement, setArrowElement] = useState(null);
80
+ const [arrowPlacement, setArrowPlacement] = useState(placement);
81
+ const handleClickOutside = useCallback((event) => {
82
+ const isToggleTarget = triggerNode === null || triggerNode === void 0 ? void 0 : triggerNode.contains(event.target);
83
+ const isOverlayTarget = popperElement === null || popperElement === void 0 ? void 0 : popperElement.contains(event.target);
84
+ // Check if the click occurred outside the trigger element. Clicking on the trigger
85
+ // itself is handled by the onClick handler
86
+ if (show && rootClose && !isToggleTarget && !isOverlayTarget) {
87
+ handleHide();
88
+ }
89
+ }, [triggerNode, popperElement, rootClose, handleHide]);
90
+ useClickOutsideWithRef(triggerNode, handleClickOutside);
91
+ const triggerProps = {
92
+ ref: mergeRefs([children.ref, setTriggerNode]),
93
+ };
94
+ if (trigger === 'click') {
95
+ triggerProps.onClick = handleClick;
96
+ }
97
+ else if (trigger === 'focus') {
98
+ triggerProps.onFocus = handleFocus;
99
+ triggerProps.onBlur = handleBlur;
100
+ }
101
+ else if (trigger === 'hover') {
102
+ triggerProps.onMouseOver = handleMouseOver;
103
+ triggerProps.onMouseOut = handleMouseOut;
104
+ }
105
+ const defaultPopperConfig = {
106
+ placement,
107
+ modifiers: [
108
+ {
109
+ name: 'arrow',
110
+ options: {
111
+ element: arrowElement,
112
+ },
113
+ },
114
+ {
115
+ name: 'flip',
116
+ options: {
117
+ fallbackPlacements: ['right', 'left', 'top'],
118
+ },
119
+ },
120
+ ],
121
+ };
122
+ if (popperConfig) {
123
+ popperConfig.placement = placement;
124
+ // if it has an arrow modifier, inject the arrow element
125
+ const updatedModifiers = [];
126
+ (_a = popperConfig.modifiers) === null || _a === void 0 ? void 0 : _a.forEach((mod) => {
127
+ if (mod.name !== 'arrow') {
128
+ return updatedModifiers.push(mod);
129
+ }
130
+ return updatedModifiers.push(Object.assign(Object.assign({}, mod), { options: Object.assign(Object.assign({}, mod.options), { element: arrowElement }) }));
131
+ });
132
+ popperConfig.modifiers = updatedModifiers;
133
+ }
134
+ const popper = usePopper(triggerNode, popperElement, popperConfig || defaultPopperConfig);
135
+ // In case the overlay causes an overflow and the "flip" modifier
136
+ // changes the overlays placement, we nee to update the arrow placement as well
137
+ useEffect(() => {
138
+ if (popper.state) {
139
+ // Adjust arrow styles based on placement if necessary
140
+ setArrowPlacement(popper.state.placement);
141
+ }
142
+ }, [(_b = popper.state) === null || _b === void 0 ? void 0 : _b.placement]);
143
+ const overlayElement = React.cloneElement(overlay, Object.assign(Object.assign({}, popper.attributes.popper), { ref: setPopperElement, placement: arrowPlacement, style: Object.assign({}, popper.styles.popper), arrowProps: Object.assign(Object.assign({}, popper.attributes.arrow), { style: popper.styles.arrow, ref: setArrowElement }) }));
144
+ return (_jsxs(_Fragment, { children: [show && (enablePortal ? ReactDOM.createPortal(overlayElement, document.body) : overlayElement), React.cloneElement(children, triggerProps)] }));
13
145
  };
14
146
  OverlayTrigger.TRIGGER_CLICK = TRIGGER.CLICK;
15
147
  OverlayTrigger.TRIGGER_HOVER = TRIGGER.HOVER;