@rio-cloud/rio-uikit 0.16.4-beta.18 → 0.16.4-beta.19

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 (137) hide show
  1. package/Carousel.d.ts +2 -11
  2. package/Carousel.js +2 -2
  3. package/Dialog.d.ts +2 -15
  4. package/Dialog.js +2 -2
  5. package/Fade.d.ts +2 -14
  6. package/Fade.js +2 -2
  7. package/InfoDialog.d.ts +2 -5
  8. package/InfoDialog.js +2 -2
  9. package/MediaDialog.d.ts +2 -9
  10. package/MediaDialog.js +2 -2
  11. package/RadioButton.d.ts +2 -5
  12. package/RadioButton.js +2 -2
  13. package/ReleaseNotes.d.ts +2 -2
  14. package/ReleaseNotes.js +2 -2
  15. package/ReleaseNotesDialog.d.ts +2 -5
  16. package/SaveDialog.d.ts +2 -14
  17. package/SaveDialog.js +2 -2
  18. package/SimpleDialog.d.ts +2 -14
  19. package/SimpleDialog.js +2 -2
  20. package/SplitDialog.d.ts +2 -14
  21. package/SplitDialog.js +2 -2
  22. package/components/assetTree/TreeSummary.js +1 -1
  23. package/components/assetTree/TypeCounter.js +2 -2
  24. package/components/button/Button.d.ts +25 -19
  25. package/components/button/Button.js +11 -25
  26. package/components/carousel/Carousel.d.ts +8 -2
  27. package/components/carousel/Carousel.js +5 -9
  28. package/components/dialog/ConfirmationDialog.d.ts +11 -24
  29. package/components/dialog/ConfirmationDialog.js +8 -26
  30. package/components/dialog/Dialog.d.ts +102 -42
  31. package/components/dialog/Dialog.js +17 -25
  32. package/components/dialog/DialogBody.d.ts +5 -15
  33. package/components/dialog/DialogBody.js +4 -10
  34. package/components/dialog/DialogFooter.d.ts +6 -15
  35. package/components/dialog/DialogFooter.js +6 -12
  36. package/components/dialog/DialogHeader.d.ts +10 -17
  37. package/components/dialog/DialogHeader.js +7 -15
  38. package/components/dialog/InfoDialog.d.ts +9 -17
  39. package/components/dialog/InfoDialog.js +6 -7
  40. package/components/dialog/MediaDialog.d.ts +64 -57
  41. package/components/dialog/MediaDialog.js +40 -83
  42. package/components/dialog/ReleaseNotesDialog.d.ts +56 -19
  43. package/components/dialog/ReleaseNotesDialog.js +9 -30
  44. package/components/dialog/SaveDialog.d.ts +34 -30
  45. package/components/dialog/SaveDialog.js +8 -18
  46. package/components/dialog/SimpleDialog.d.ts +9 -20
  47. package/components/dialog/SimpleDialog.js +6 -10
  48. package/components/dialog/SplitDialog.d.ts +21 -31
  49. package/components/dialog/SplitDialog.js +5 -15
  50. package/components/fade/Fade.d.ts +75 -45
  51. package/components/fade/Fade.js +16 -98
  52. package/components/map/components/features/layers/baselayers/useBaseLayer.js +0 -1
  53. package/components/numberControl/NumberControl.js +4 -4
  54. package/components/numberInput/NumberInput.d.ts +22 -0
  55. package/components/numberInput/NumberInput.js +6 -6
  56. package/components/radiobutton/RadioButton.d.ts +110 -44
  57. package/components/radiobutton/RadioButton.js +16 -44
  58. package/components/releaseNotes/ReleaseNotes.d.ts +7 -6
  59. package/components/selects/Select.d.ts +1 -0
  60. package/components/selects/Select.js +14 -6
  61. package/components/sidebars/Sidebar.js +1 -1
  62. package/hooks/useAfterMount.d.ts +1 -1
  63. package/hooks/useMergeRefs.d.ts +4 -0
  64. package/hooks/useMergeRefs.js +28 -0
  65. package/index.d.ts +22 -22
  66. package/index.js +22 -22
  67. package/lib/es/Carousel.d.ts +2 -11
  68. package/lib/es/Carousel.js +3 -2
  69. package/lib/es/Dialog.d.ts +2 -15
  70. package/lib/es/Dialog.js +3 -2
  71. package/lib/es/Fade.d.ts +2 -14
  72. package/lib/es/Fade.js +3 -2
  73. package/lib/es/InfoDialog.d.ts +2 -5
  74. package/lib/es/InfoDialog.js +3 -2
  75. package/lib/es/MediaDialog.d.ts +2 -9
  76. package/lib/es/MediaDialog.js +3 -2
  77. package/lib/es/RadioButton.d.ts +2 -5
  78. package/lib/es/RadioButton.js +3 -2
  79. package/lib/es/ReleaseNotes.d.ts +2 -2
  80. package/lib/es/ReleaseNotes.js +3 -2
  81. package/lib/es/ReleaseNotesDialog.d.ts +2 -5
  82. package/lib/es/SaveDialog.d.ts +2 -14
  83. package/lib/es/SaveDialog.js +3 -2
  84. package/lib/es/SimpleDialog.d.ts +2 -14
  85. package/lib/es/SimpleDialog.js +3 -2
  86. package/lib/es/SplitDialog.d.ts +2 -14
  87. package/lib/es/SplitDialog.js +3 -2
  88. package/lib/es/components/assetTree/TreeSummary.js +1 -1
  89. package/lib/es/components/assetTree/TypeCounter.js +2 -2
  90. package/lib/es/components/button/Button.d.ts +25 -19
  91. package/lib/es/components/button/Button.js +11 -25
  92. package/lib/es/components/carousel/Carousel.d.ts +8 -2
  93. package/lib/es/components/carousel/Carousel.js +4 -9
  94. package/lib/es/components/dialog/ConfirmationDialog.d.ts +11 -24
  95. package/lib/es/components/dialog/ConfirmationDialog.js +8 -26
  96. package/lib/es/components/dialog/Dialog.d.ts +102 -42
  97. package/lib/es/components/dialog/Dialog.js +17 -25
  98. package/lib/es/components/dialog/DialogBody.d.ts +5 -15
  99. package/lib/es/components/dialog/DialogBody.js +4 -10
  100. package/lib/es/components/dialog/DialogFooter.d.ts +6 -15
  101. package/lib/es/components/dialog/DialogFooter.js +6 -12
  102. package/lib/es/components/dialog/DialogHeader.d.ts +10 -17
  103. package/lib/es/components/dialog/DialogHeader.js +7 -15
  104. package/lib/es/components/dialog/InfoDialog.d.ts +9 -17
  105. package/lib/es/components/dialog/InfoDialog.js +5 -7
  106. package/lib/es/components/dialog/MediaDialog.d.ts +64 -57
  107. package/lib/es/components/dialog/MediaDialog.js +40 -83
  108. package/lib/es/components/dialog/ReleaseNotesDialog.d.ts +56 -19
  109. package/lib/es/components/dialog/ReleaseNotesDialog.js +9 -30
  110. package/lib/es/components/dialog/SaveDialog.d.ts +34 -30
  111. package/lib/es/components/dialog/SaveDialog.js +8 -18
  112. package/lib/es/components/dialog/SimpleDialog.d.ts +9 -20
  113. package/lib/es/components/dialog/SimpleDialog.js +5 -10
  114. package/lib/es/components/dialog/SplitDialog.d.ts +21 -31
  115. package/lib/es/components/dialog/SplitDialog.js +5 -15
  116. package/lib/es/components/fade/Fade.d.ts +75 -45
  117. package/lib/es/components/fade/Fade.js +16 -98
  118. package/lib/es/components/map/components/features/layers/baselayers/useBaseLayer.js +0 -1
  119. package/lib/es/components/numberControl/NumberControl.js +4 -4
  120. package/lib/es/components/numberInput/NumberInput.d.ts +22 -0
  121. package/lib/es/components/numberInput/NumberInput.js +5 -5
  122. package/lib/es/components/radiobutton/RadioButton.d.ts +110 -44
  123. package/lib/es/components/radiobutton/RadioButton.js +16 -44
  124. package/lib/es/components/releaseNotes/ReleaseNotes.d.ts +7 -6
  125. package/lib/es/components/selects/Select.d.ts +1 -0
  126. package/lib/es/components/selects/Select.js +14 -6
  127. package/lib/es/components/sidebars/Sidebar.js +1 -1
  128. package/lib/es/hooks/useAfterMount.d.ts +1 -1
  129. package/lib/es/hooks/useMergeRefs.d.ts +4 -0
  130. package/lib/es/hooks/useMergeRefs.js +30 -0
  131. package/lib/es/index.d.ts +22 -22
  132. package/lib/es/index.js +37 -26
  133. package/lib/es/types.d.ts +0 -205
  134. package/lib/es/version.json +1 -1
  135. package/package.json +2 -2
  136. package/types.d.ts +0 -205
  137. package/version.json +1 -1
package/Carousel.d.ts CHANGED
@@ -1,11 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/Carousel' {
2
- import React from 'react';
3
- import { CarouselProps, CarouselItemProps } from './types';
4
-
5
- export default class Carousel extends React.Component<CarouselProps> {
6
- static Item: React.ComponentClass<CarouselItemProps>;
7
- static Caption: React.ComponentClass<any>;
8
- static PREV = 'prev';
9
- static NEXT = 'next';
10
- }
11
- }
1
+ export { default } from './components/carousel/Carousel';
2
+ export * from './components/carousel/Carousel';
package/Carousel.js CHANGED
@@ -1,2 +1,2 @@
1
- import { default as _Carousel } from './components/carousel/Carousel';
2
- export { _Carousel as default };
1
+ export { default } from './components/carousel/Carousel';
2
+ export * from './components/carousel/Carousel';
package/Dialog.d.ts CHANGED
@@ -1,15 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/Dialog' {
2
- import React from 'react';
3
- import { DialogProps } from './types';
4
-
5
- export default class Dialog extends React.Component<DialogProps> {
6
- public static SIZE_FULL_SCREEN: 'fullscreen';
7
- public static SIZE_FULL: 'full';
8
- public static SIZE_FULL_WIDTH: 'fullwidth';
9
- public static SIZE_FULL_HEIGHT: 'fullheight';
10
- public static SIZE_XL: 'xl';
11
- public static SIZE_LG: 'lg';
12
- public static SIZE_MD: 'md';
13
- public static SIZE_SM: 'sm';
14
- }
15
- }
1
+ export { default } from './components/dialog/Dialog';
2
+ export * from './components/dialog/Dialog';
package/Dialog.js CHANGED
@@ -1,2 +1,2 @@
1
- import { default as _Dialog } from './components/dialog/Dialog';
2
- export { _Dialog as default };
1
+ export { default } from './components/dialog/Dialog';
2
+ export * from './components/dialog/Dialog';
package/Fade.d.ts CHANGED
@@ -1,14 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/Fade' {
2
- import React from 'react';
3
- import { FadeProps } from './types';
4
- export default class Fade extends React.Component<FadeProps> {
5
- static FADE = 'fade';
6
- static FROM_LEFT = 'fromLeft';
7
- static FROM_RIGHT = 'fromRight';
8
- static FROM_TOP = 'fromTop';
9
- static FROM_BOTTOM = 'fromBottom';
10
- static TABS = 'tabs';
11
- static PAGE = 'page';
12
- static PAGE_BACK = 'pageBack';
13
- }
14
- }
1
+ export { default } from './components/fade/Fade';
2
+ export * from './components/fade/Fade';
package/Fade.js CHANGED
@@ -1,2 +1,2 @@
1
- import { default as _Fade } from './components/fade/Fade';
2
- export { _Fade as default };
1
+ export { default } from './components/fade/Fade';
2
+ export * from './components/fade/Fade';
package/InfoDialog.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/InfoDialog' {
2
- import React from 'react';
3
- import { InfoDialogProps } from './types';
4
- export default class InfoDialog extends React.Component<InfoDialogProps> {}
5
- }
1
+ export { default } from './components/dialog/InfoDialog';
2
+ export * from './components/dialog/InfoDialog';
package/InfoDialog.js CHANGED
@@ -1,2 +1,2 @@
1
- import { default as _InfoDialog } from './components/dialog/InfoDialog';
2
- export { _InfoDialog as default };
1
+ export { default } from './components/dialog/InfoDialog';
2
+ export * from './components/dialog/InfoDialog';
package/MediaDialog.d.ts CHANGED
@@ -1,9 +1,2 @@
1
- import React from 'react';
2
- import { MediaDialogProps } from './types';
3
-
4
- export { MediaDialogMedia } from './types';
5
-
6
- export default class MediaDialog extends React.Component<MediaDialogProps> {
7
- static MEDIA_TYPE_IMAGE = 'image';
8
- static MEDIA_TYPE_VIDEO = 'video';
9
- }
1
+ export { default } from './components/dialog/MediaDialog';
2
+ export * from './components/dialog/MediaDialog';
package/MediaDialog.js CHANGED
@@ -1,2 +1,2 @@
1
- import { default as _MediaDialog } from './components/dialog/MediaDialog';
2
- export { _MediaDialog as default };
1
+ export { default } from './components/dialog/MediaDialog';
2
+ export * from './components/dialog/MediaDialog';
package/RadioButton.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/RadioButton' {
2
- import React from 'react';
3
- import { RadioButtonProps } from './types';
4
- export default class RadioButton extends React.Component<RadioButtonProps> {}
5
- }
1
+ export { default } from './components/radiobutton/RadioButton';
2
+ export * from './components/radiobutton/RadioButton';
package/RadioButton.js CHANGED
@@ -1,2 +1,2 @@
1
- import { default as _RadioButton } from './components/radiobutton/RadioButton';
2
- export { _RadioButton as default };
1
+ export { default } from './components/radiobutton/RadioButton';
2
+ export * from './components/radiobutton/RadioButton';
package/ReleaseNotes.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { _ReleaseNotes as default };
2
- import { default as _ReleaseNotes } from "./components/releaseNotes/ReleaseNotes";
1
+ export { default } from './components/releaseNotes/ReleaseNotes';
2
+ export * from './components/releaseNotes/ReleaseNotes';
package/ReleaseNotes.js CHANGED
@@ -1,2 +1,2 @@
1
- import { default as _ReleaseNotes } from './components/releaseNotes/ReleaseNotes';
2
- export { _ReleaseNotes as default };
1
+ export { default } from './components/releaseNotes/ReleaseNotes';
2
+ export * from './components/releaseNotes/ReleaseNotes';
@@ -1,5 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/ReleaseNotesDialog' {
2
- import React from 'react';
3
- import { ReleaseNotesDialogProps } from './types';
4
- export default class ReleaseNotesDialog extends React.Component<ReleaseNotesDialogProps> {}
5
- }
1
+ export { default } from './components/dialog/ReleaseNotesDialog';
2
+ export * from './components/dialog/ReleaseNotesDialog';
package/SaveDialog.d.ts CHANGED
@@ -1,14 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/SaveDialog' {
2
- import React from 'react';
3
- import { SaveDialogProps } from './types';
4
- export default class SaveDialog extends React.Component<SaveDialogProps> {
5
- static SIZE_SM = 'sm';
6
- static SIZE_MD = 'md';
7
- static SIZE_LG = 'lg';
8
- static SIZE_XL = 'xl';
9
- static SIZE_FULL = 'full';
10
- static SIZE_FULL_WIDTH: 'fullwidth';
11
- static SIZE_FULL_HEIGHT: 'fullheight';
12
- static SIZE_FULL_SCREEN = 'fullscreen';
13
- }
14
- }
1
+ export { default } from './components/dialog/SaveDialog';
2
+ export * from './components/dialog/SaveDialog';
package/SaveDialog.js CHANGED
@@ -1,2 +1,2 @@
1
- import { default as _SaveDialog } from './components/dialog/SaveDialog';
2
- export { _SaveDialog as default };
1
+ export { default } from './components/dialog/SaveDialog';
2
+ export * from './components/dialog/SaveDialog';
package/SimpleDialog.d.ts CHANGED
@@ -1,14 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/SimpleDialog' {
2
- import React from 'react';
3
- import { SimpleDialogProps } from './types';
4
- export default class SimpleDialog extends React.Component<SimpleDialogProps> {
5
- static SIZE_SM = 'sm';
6
- static SIZE_MD = 'md';
7
- static SIZE_LG = 'lg';
8
- static SIZE_XL = 'xl';
9
- static SIZE_FULL = 'full';
10
- static SIZE_FULL_WIDTH: 'fullwidth';
11
- static SIZE_FULL_HEIGHT: 'fullheight';
12
- static SIZE_FULL_SCREEN = 'fullscreen';
13
- }
14
- }
1
+ export { default } from './components/dialog/SimpleDialog';
2
+ export * from './components/dialog/SimpleDialog';
package/SimpleDialog.js CHANGED
@@ -1,2 +1,2 @@
1
- import { default as _SimpleDialog } from './components/dialog/SimpleDialog';
2
- export { _SimpleDialog as default };
1
+ export { default } from './components/dialog/SimpleDialog';
2
+ export * from './components/dialog/SimpleDialog';
package/SplitDialog.d.ts CHANGED
@@ -1,14 +1,2 @@
1
- declare module '@rio-cloud/rio-uikit/SplitDialog' {
2
- import React from 'react';
3
- import { SplitDialogProps } from './types';
4
- export default class SplitDialog extends React.Component<SplitDialogProps> {
5
- static SIZE_SM = 'sm';
6
- static SIZE_MD = 'md';
7
- static SIZE_LG = 'lg';
8
- static SIZE_XL = 'xl';
9
- static SIZE_FULL = 'full';
10
- static SIZE_FULL_WIDTH: 'fullwidth';
11
- static SIZE_FULL_HEIGHT: 'fullheight';
12
- static SIZE_FULL_SCREEN = 'fullscreen';
13
- }
14
- }
1
+ export { default } from './components/dialog/SplitDialog';
2
+ export * from './components/dialog/SplitDialog';
package/SplitDialog.js CHANGED
@@ -1,2 +1,2 @@
1
- import { default as _SplitDialog } from './components/dialog/SplitDialog';
2
- export { _SplitDialog as default };
1
+ export { default } from './components/dialog/SplitDialog';
2
+ export * from './components/dialog/SplitDialog';
@@ -9,7 +9,7 @@ const DefaultAssetCounts = ({ assetCounts }) => {
9
9
  };
10
10
  const TreeSummary = React.memo(props => {
11
11
  const { className, assetCounts, children } = props;
12
- const classes = classNames('TreeSummary', 'display-flex', 'flex-wrap', 'align-items-center', 'column-gap-15', 'row-gap-5', className);
12
+ const classes = classNames('TreeSummary', 'display-flex', 'flex-wrap', 'align-items-center', 'column-gap-10', 'row-gap-5', className);
13
13
  return _jsx("div", Object.assign({ className: classes }, { children: children || _jsx(DefaultAssetCounts, { assetCounts: assetCounts }) }));
14
14
  });
15
15
  TreeSummary.displayName = 'TreeSummary';
@@ -5,13 +5,13 @@ import PropTypes from 'prop-types';
5
5
  import classNames from 'classnames';
6
6
  const TypeCounter = forwardRef((props, ref) => {
7
7
  const { icon, value, isActive, hasFilter, enableActivity, onClick, type, hideOnZero } = props, remainingProps = __rest(props, ["icon", "value", "isActive", "hasFilter", "enableActivity", "onClick", "type", "hideOnZero"]);
8
- const wrapperClassName = classNames('TypeCounter', 'display-flex align-items-center', 'user-select-none', enableActivity ? 'cursor-pointer' : 'pointer-events-none', enableActivity && hasFilter && !isActive && 'opacity-50');
8
+ const wrapperClassName = classNames('TypeCounter', 'display-flex align-items-center', 'user-select-none', 'margin-right-2', enableActivity ? 'cursor-pointer' : 'pointer-events-none', enableActivity && hasFilter && !isActive && 'opacity-50');
9
9
  const counterClassNames = classNames('TreeLabelCount', 'label label-condensed', isActive ? 'label-primary' : 'label-muted label-filled');
10
10
  const handleClick = () => onClick(type);
11
11
  if (hideOnZero && !value) {
12
12
  return null;
13
13
  }
14
- return (_jsxs("div", Object.assign({ ref: ref }, remainingProps, { className: wrapperClassName, onClick: handleClick }, { children: [_jsx("span", { className: `rioglyph rioglyph-${icon} text-size-16 margin-right-2 margin-left--4` }), _jsx("span", Object.assign({ className: counterClassNames }, { children: value || 0 }))] })));
14
+ return (_jsxs("div", Object.assign({ ref: ref }, remainingProps, { className: wrapperClassName, onClick: handleClick }, { children: [_jsx("span", { className: `rioglyph rioglyph-${icon} text-size-16 margin-right-2` }), _jsx("span", Object.assign({ className: counterClassNames }, { children: value || 0 }))] })));
15
15
  });
16
16
  TypeCounter.defaultProps = {
17
17
  hideOnZero: false,
@@ -1,4 +1,4 @@
1
- import { type PropsWithChildren, type SyntheticEvent } from 'react';
1
+ import { type PropsWithChildren, type SyntheticEvent, type RefAttributes, type ForwardRefExoticComponent } from 'react';
2
2
  import type { ObjectValues } from '../../utils/ObjectValues';
3
3
  declare const STYLES_MAP: {
4
4
  readonly DEFAULT: "default";
@@ -61,6 +61,11 @@ export type ButtonProps = {
61
61
  * @default false
62
62
  */
63
63
  disabled?: boolean;
64
+ /**
65
+ * Defines the type of the button. This may be used for form submit buttons.
66
+ * @default 'button'
67
+ */
68
+ type?: 'button' | 'submit';
64
69
  /**
65
70
  * Use when the content of the button is an icon only to adapt the button spacing accordingly.
66
71
  * @default false
@@ -105,23 +110,24 @@ export type ButtonProps = {
105
110
  */
106
111
  className?: string;
107
112
  } & (RegularButtonProps | ToggleButtonProps);
108
- declare const Button: {
109
- (props: PropsWithChildren<ButtonProps>): import("react/jsx-runtime").JSX.Element;
110
- DEFAULT: "default";
111
- PRIMARY: "primary";
112
- SECONDARY: "secondary";
113
- INFO: "info";
114
- WARNING: "warning";
115
- DANGER: "danger";
116
- SUCCESS: "success";
117
- MUTED: "muted";
118
- VARIANT_LINK: "link";
119
- VARIANT_LINK_INLINE: "link-inline";
120
- VARIANT_OUTLINE: "outline";
121
- VARIANT_ACTION: "action";
122
- XS: "xs";
123
- SM: "sm";
124
- MD: "md";
125
- LG: "lg";
113
+ type Props = PropsWithChildren<ButtonProps>;
114
+ type ButtonType = ForwardRefExoticComponent<Props & RefAttributes<HTMLButtonElement>> & {
115
+ DEFAULT: 'default';
116
+ PRIMARY: 'primary';
117
+ SECONDARY: 'secondary';
118
+ INFO: 'info';
119
+ WARNING: 'warning';
120
+ DANGER: 'danger';
121
+ SUCCESS: 'success';
122
+ MUTED: 'muted';
123
+ VARIANT_LINK: 'link';
124
+ VARIANT_LINK_INLINE: 'link-inline';
125
+ VARIANT_OUTLINE: 'outline';
126
+ VARIANT_ACTION: 'action';
127
+ XS: 'xs';
128
+ SM: 'sm';
129
+ MD: 'md';
130
+ LG: 'lg';
126
131
  };
132
+ declare const Button: ButtonType;
127
133
  export default Button;
@@ -1,9 +1,10 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useRef, useState } from 'react';
3
+ import React, { useRef, useState, } from 'react';
4
4
  import classNames from 'classnames';
5
5
  import noop from 'lodash/fp/noop';
6
6
  import { createButtonRipple } from '../../utils/buttonEffect';
7
+ import useMergeRefs from '../../hooks/useMergeRefs';
7
8
  const STYLES_MAP = {
8
9
  DEFAULT: 'default',
9
10
  PRIMARY: 'primary',
@@ -26,10 +27,11 @@ const SIZES_MAP = {
26
27
  MD: 'md',
27
28
  LG: 'lg',
28
29
  };
29
- const Button = (props) => {
30
- const { active = false, disabled = false, asToggle = false, onClick = noop, bsStyle = 'default', bsSize, variant, iconOnly = false, iconName, multiline = false, block = false, className = '', noRippleEffect = false, children } = props, remainingProps = __rest(props, ["active", "disabled", "asToggle", "onClick", "bsStyle", "bsSize", "variant", "iconOnly", "iconName", "multiline", "block", "className", "noRippleEffect", "children"]);
30
+ const Button = React.forwardRef((props, ref) => {
31
+ const { active = false, disabled = false, asToggle = false, onClick = noop, bsStyle = 'default', bsSize, variant, iconOnly = false, iconName, multiline = false, block = false, className = '', noRippleEffect = false, type = 'button', children } = props, remainingProps = __rest(props, ["active", "disabled", "asToggle", "onClick", "bsStyle", "bsSize", "variant", "iconOnly", "iconName", "multiline", "block", "className", "noRippleEffect", "type", "children"]);
31
32
  const [isToggled, setIsToggled] = useState(active);
32
33
  const btnRef = useRef(null);
34
+ const buttonRef = useMergeRefs(btnRef, ref);
33
35
  // Update internal toggle state when used as controlled component and outside toggle state changes
34
36
  const [previousActive, setPreviousActive] = useState(active);
35
37
  if (active !== previousActive) {
@@ -54,26 +56,10 @@ const Button = (props) => {
54
56
  onClick(event);
55
57
  }
56
58
  };
57
- const buttonClassNames = classNames('btn', `btn-${bsStyle}`, variant === Button.VARIANT_LINK && 'btn-link', variant === Button.VARIANT_LINK_INLINE && 'btn-link btn-link-inline', variant === Button.VARIANT_OUTLINE && 'btn-outline', variant === Button.VARIANT_ACTION && 'btn-action', bsSize && `btn-${bsSize}`, asToggle && 'btn-toggle', isToggled && 'active', iconOnly && 'btn-icon-only', disabled && 'disabled', multiline && 'btn-multiline', block && 'btn-block', 'btn-component', className);
58
- return (_jsxs("button", Object.assign({ ref: btnRef, type: 'button' }, remainingProps, { className: buttonClassNames, onClick: handleClick }, { children: [iconName && _jsx("span", { className: `rioglyph ${iconName}` }), children] })));
59
- };
60
- // Button styles
61
- Button.DEFAULT = STYLES_MAP.DEFAULT;
62
- Button.PRIMARY = STYLES_MAP.PRIMARY;
63
- Button.SECONDARY = STYLES_MAP.SECONDARY;
64
- Button.INFO = STYLES_MAP.INFO;
65
- Button.WARNING = STYLES_MAP.WARNING;
66
- Button.DANGER = STYLES_MAP.DANGER;
67
- Button.SUCCESS = STYLES_MAP.SUCCESS;
68
- Button.MUTED = STYLES_MAP.MUTED;
69
- // Button Type
70
- Button.VARIANT_LINK = VARIANTS_MAP.VARIANT_LINK;
71
- Button.VARIANT_LINK_INLINE = VARIANTS_MAP.VARIANT_LINK_INLINE;
72
- Button.VARIANT_OUTLINE = VARIANTS_MAP.VARIANT_OUTLINE;
73
- Button.VARIANT_ACTION = VARIANTS_MAP.VARIANT_ACTION;
74
- // Button Size
75
- Button.XS = SIZES_MAP.XS;
76
- Button.SM = SIZES_MAP.SM;
77
- Button.MD = SIZES_MAP.MD;
78
- Button.LG = SIZES_MAP.LG;
59
+ const buttonClassNames = classNames('btn', `btn-${bsStyle}`, variant === VARIANTS_MAP.VARIANT_LINK && 'btn-link', variant === VARIANTS_MAP.VARIANT_LINK_INLINE && 'btn-link btn-link-inline', variant === VARIANTS_MAP.VARIANT_OUTLINE && 'btn-outline', variant === VARIANTS_MAP.VARIANT_ACTION && 'btn-action', bsSize && `btn-${bsSize}`, asToggle && 'btn-toggle', isToggled && 'active', iconOnly && 'btn-icon-only', disabled && 'disabled', multiline && 'btn-multiline', block && 'btn-block', 'btn-component', className);
60
+ return (_jsxs("button", Object.assign({ ref: buttonRef, type: type }, remainingProps, { className: buttonClassNames, onClick: handleClick }, { children: [iconName && _jsx("span", { className: `rioglyph ${iconName}` }), children] })));
61
+ });
62
+ Object.assign(Button, STYLES_MAP);
63
+ Object.assign(Button, VARIANTS_MAP);
64
+ Object.assign(Button, SIZES_MAP);
79
65
  export default Button;
@@ -1,2 +1,8 @@
1
- export { _Carousel as default };
2
- import { default as _Carousel } from "react-bootstrap/Carousel";
1
+ declare const Carousel: import("react-bootstrap/esm/helpers").BsPrefixRefForwardingComponent<"div", import("react-bootstrap/Carousel").CarouselProps> & {
2
+ Caption: import("react-bootstrap/esm/helpers").BsPrefixRefForwardingComponent<"div", unknown>;
3
+ Item: import("react-bootstrap/esm/CarouselItem").default;
4
+ } & {
5
+ PREV: 'prev';
6
+ NEXT: 'next';
7
+ };
8
+ export default Carousel;
@@ -1,9 +1,5 @@
1
- import React from 'react';
2
- // import { default as BSCarousel } from 'react-bootstrap/Carousel';
3
- // import { default as _Carousel } from 'react-bootstrap/Carousel';
4
- // const Carousel = props => {
5
- // return <_Carousel {...props} />;
6
- // };
7
- // export default Carousel;
8
- import { default as _Carousel } from 'react-bootstrap/Carousel';
9
- export { _Carousel as default };
1
+ import OriginalCarousel from 'react-bootstrap/Carousel';
2
+ const Carousel = OriginalCarousel;
3
+ Carousel.PREV = 'prev';
4
+ Carousel.NEXT = 'next';
5
+ export default Carousel;
@@ -1,25 +1,12 @@
1
+ import React from 'react';
2
+ import { type BaseDialogProps } from './Dialog';
3
+ export type ConfirmationDialogProps = BaseDialogProps & {
4
+ content?: string | React.ReactNode;
5
+ onClickConfirm?: VoidFunction;
6
+ onClickCancel?: VoidFunction;
7
+ cancelButtonText?: string | React.ReactNode;
8
+ confirmButtonText?: string | React.ReactNode;
9
+ disableConfirm?: boolean;
10
+ };
11
+ declare const ConfirmationDialog: (props: ConfirmationDialogProps) => import("react/jsx-runtime").JSX.Element;
1
12
  export default ConfirmationDialog;
2
- declare function ConfirmationDialog(props: any): import("react/jsx-runtime").JSX.Element;
3
- declare namespace ConfirmationDialog {
4
- namespace defaultProps {
5
- const show: boolean;
6
- function onClickCancel(): void;
7
- function onClickConfirm(): void;
8
- }
9
- namespace propTypes {
10
- const show_1: PropTypes.Validator<boolean>;
11
- export { show_1 as show };
12
- export const title: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
13
- export const subtitle: PropTypes.Requireable<PropTypes.ReactNodeLike>;
14
- export const content: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
15
- const onClickCancel_1: PropTypes.Validator<(...args: any[]) => any>;
16
- export { onClickCancel_1 as onClickCancel };
17
- const onClickConfirm_1: PropTypes.Validator<(...args: any[]) => any>;
18
- export { onClickConfirm_1 as onClickConfirm };
19
- export const cancelButtonText: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
20
- export const confirmButtonText: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
21
- export const disableConfirm: PropTypes.Requireable<boolean>;
22
- export const bsSize: PropTypes.Requireable<string>;
23
- }
24
- }
25
- import PropTypes from "prop-types";
@@ -1,31 +1,13 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import React from 'react';
4
- import PropTypes from 'prop-types';
3
+ // @ts-ignore-next-line importsNotUsedAsValues
4
+ import 'react';
5
+ import noop from 'lodash/fp/noop';
6
+ import Button from '../button/Button';
5
7
  import Dialog from './Dialog';
6
- /*
7
- * Confirmation dialog component to confirm or cancel an action
8
- */
9
- const ConfirmationDialog = props => {
10
- const { content, onClickCancel, cancelButtonText, onClickConfirm, confirmButtonText, disableConfirm } = props, remainingProps = __rest(props, ["content", "onClickCancel", "cancelButtonText", "onClickConfirm", "confirmButtonText", "disableConfirm"]);
11
- const footer = (_jsxs("div", Object.assign({ className: 'display-flex justify-content-end btn-toolbar' }, { children: [_jsx("button", Object.assign({ type: 'button', className: 'CancelButton btn btn-default', onClick: onClickCancel }, { children: cancelButtonText })), _jsx("button", Object.assign({ type: 'button', className: 'ConfirmationButton btn btn-primary', onClick: onClickConfirm, disabled: disableConfirm }, { children: confirmButtonText }))] })));
12
- return (_jsx(Dialog, Object.assign({}, remainingProps, { body: content, footer: footer, onHide: onClickCancel, showCloseButton: false, className: 'confirmation-dialog', disableEsc: true })));
13
- };
14
- ConfirmationDialog.defaultProps = {
15
- show: false,
16
- onClickCancel: () => { },
17
- onClickConfirm: () => { },
18
- };
19
- ConfirmationDialog.propTypes = {
20
- show: PropTypes.bool.isRequired,
21
- title: PropTypes.node.isRequired,
22
- subtitle: PropTypes.node,
23
- content: PropTypes.node.isRequired,
24
- onClickCancel: PropTypes.func.isRequired,
25
- onClickConfirm: PropTypes.func.isRequired,
26
- cancelButtonText: PropTypes.node.isRequired,
27
- confirmButtonText: PropTypes.node.isRequired,
28
- disableConfirm: PropTypes.bool,
29
- bsSize: PropTypes.string,
8
+ const ConfirmationDialog = (props) => {
9
+ const { content, onClickCancel = noop, cancelButtonText, onClickConfirm = noop, confirmButtonText, disableConfirm } = props, remainingProps = __rest(props, ["content", "onClickCancel", "cancelButtonText", "onClickConfirm", "confirmButtonText", "disableConfirm"]);
10
+ const footer = (_jsxs("div", Object.assign({ className: 'display-flex justify-content-end btn-toolbar' }, { children: [_jsx(Button, Object.assign({ className: 'CancelButton', onClick: onClickCancel }, { children: cancelButtonText })), _jsx(Button, Object.assign({ bsStyle: 'primary', className: 'ConfirmationButton', onClick: onClickConfirm, disabled: disableConfirm }, { children: confirmButtonText }))] })));
11
+ return (_jsx(Dialog, Object.assign({}, remainingProps, { body: content, footer: footer, onClose: onClickCancel, showCloseButton: false, className: 'confirmation-dialog', disableEsc: true })));
30
12
  };
31
13
  export default ConfirmationDialog;
@@ -1,43 +1,103 @@
1
+ import React from 'react';
2
+ export type bsSizeDialog = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full' | 'fullwidth' | 'fullheight' | 'fullscreen';
3
+ export type BaseDialogProps = {
4
+ /**
5
+ * Opens the dialog when set to `true`.
6
+ * @default false
7
+ */
8
+ show: boolean;
9
+ /**
10
+ * The dialog title (can also be a FormattedMessage component).
11
+ */
12
+ title?: React.ReactNode;
13
+ /**
14
+ * The dialog header subtitle content.
15
+ */
16
+ subtitle?: React.ReactNode;
17
+ /**
18
+ * Shows a close button when set to `true`.
19
+ * @default true
20
+ */
21
+ showCloseButton?: boolean;
22
+ /**
23
+ * A callback function invoked when the dialog closes.
24
+ */
25
+ onClose?: Function;
26
+ /**
27
+ * Defined how large the dialog will be rendered.
28
+ * By default, the dialog has a medium size and thus it can be omitted.
29
+ *
30
+ * Possible values are: `xs`, `sm`, `lg` `xl` `fullwidth` `fullheight` `fullscreen`
31
+ * @default 'md'
32
+ */
33
+ bsSize?: bsSizeDialog;
34
+ /**
35
+ * Enables or disabled closing the dialog via esc key.
36
+ * @default false
37
+ */
38
+ disableEsc?: boolean;
39
+ /**
40
+ * Enables the modal body to overflow and use inline scrolling if needed.
41
+ * @default false
42
+ */
43
+ useOverflow?: boolean;
44
+ /**
45
+ * Show Header and Footer Borders for the "xs" dialog
46
+ * @default false
47
+ */
48
+ showXsDialogBorders?: boolean;
49
+ /**
50
+ * Additional classes for the modal element.
51
+ */
52
+ className?: string;
53
+ };
54
+ export type DialogProps = BaseDialogProps & {
55
+ /**
56
+ * The dialog body content.
57
+ */
58
+ body: React.ReactNode;
59
+ /**
60
+ * The dialog body content.
61
+ */
62
+ footer?: React.ReactNode;
63
+ /**
64
+ * Additional classes for the modal-body element.
65
+ */
66
+ bodyClassName?: string;
67
+ /**
68
+ * Additional classes for the modal-footer element.
69
+ */
70
+ footerClassName?: string;
71
+ /**
72
+ * Allows to add additional buttons to the dialog header.
73
+ */
74
+ headerButtons?: React.ReactNode;
75
+ /**
76
+ * Deprecate to align with other dialog callbacks.
77
+ * @deprecated please use `onClose`
78
+ */
79
+ onHide?: VoidFunction;
80
+ /**
81
+ * A callback fired when esc key is pressed and the dialog is about to close.
82
+ */
83
+ onEsc?: VoidFunction;
84
+ /**
85
+ * A callback function to be executed before closing the dialog. If the function returns
86
+ * `false` the dialog will not be closed
87
+ * @returns
88
+ */
89
+ onCloseValidation?: () => boolean;
90
+ };
91
+ declare const Dialog: {
92
+ (props: DialogProps): React.ReactPortal;
93
+ SIZE_XS: "xs";
94
+ SIZE_SM: "sm";
95
+ SIZE_MD: "md";
96
+ SIZE_LG: "lg";
97
+ SIZE_XL: "xl";
98
+ SIZE_FULL: "full";
99
+ SIZE_FULL_WIDTH: "fullwidth";
100
+ SIZE_FULL_HEIGHT: "fullheight";
101
+ SIZE_FULL_SCREEN: "fullscreen";
102
+ };
1
103
  export default Dialog;
2
- declare function Dialog(props: any): React.ReactPortal;
3
- declare namespace Dialog {
4
- const SIZE_SM: string;
5
- const SIZE_MD: string;
6
- const SIZE_LG: string;
7
- const SIZE_XL: string;
8
- const SIZE_FULL: string;
9
- const SIZE_FULL_WIDTH: string;
10
- const SIZE_FULL_HEIGHT: string;
11
- const SIZE_FULL_SCREEN: string;
12
- namespace defaultProps {
13
- const show: boolean;
14
- function onHide(): void;
15
- function onEsc(): void;
16
- const className: string;
17
- const showCloseButton: boolean;
18
- const disableEsc: boolean;
19
- const useOverflow: boolean;
20
- function onCloseValidation(): boolean;
21
- }
22
- const propTypes: {
23
- body: PropTypes.Requireable<PropTypes.ReactNodeLike>;
24
- footer: PropTypes.Requireable<PropTypes.ReactNodeLike>;
25
- headerButtons: PropTypes.Requireable<PropTypes.ReactNodeLike>;
26
- className: PropTypes.Requireable<string>;
27
- bodyClassName: PropTypes.Requireable<string>;
28
- footerClassName: PropTypes.Requireable<string>;
29
- onHide: PropTypes.Requireable<(...args: any[]) => any>;
30
- onEsc: PropTypes.Requireable<(...args: any[]) => any>;
31
- show: PropTypes.Validator<boolean>;
32
- title: PropTypes.Requireable<PropTypes.ReactNodeLike>;
33
- subtitle: PropTypes.Requireable<PropTypes.ReactNodeLike>;
34
- iconNavigation: PropTypes.Requireable<PropTypes.ReactNodeLike>;
35
- showCloseButton: PropTypes.Requireable<boolean>;
36
- onClose: PropTypes.Requireable<(...args: any[]) => any>;
37
- bsSize: PropTypes.Requireable<string>;
38
- disableEsc: PropTypes.Requireable<boolean>;
39
- useOverflow: PropTypes.Requireable<boolean>;
40
- };
41
- }
42
- import React from "react";
43
- import PropTypes from "prop-types";