carbon-react 106.2.2 → 106.3.2

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 (73) hide show
  1. package/esm/__internal__/input/input-presentation.component.js +13 -0
  2. package/esm/__internal__/input/input.component.js +294 -0
  3. package/esm/__internal__/input-behaviour/input-behaviour.component.js +4 -0
  4. package/esm/__internal__/input-behaviour/input-group-behaviour.component.js +5 -0
  5. package/esm/__internal__/validation-message/validation-message.component.js +5 -0
  6. package/esm/__internal__/validations/validation-icon.component.js +41 -1
  7. package/esm/components/alert/alert.component.js +38 -252
  8. package/esm/components/alert/index.d.ts +1 -0
  9. package/esm/components/badge/badge.component.js +20 -60
  10. package/esm/components/button/button.component.js +760 -3310
  11. package/esm/components/carbon-provider/carbon-provider.component.js +48 -106
  12. package/esm/components/date/__internal__/utils.js +1 -1
  13. package/esm/components/date/date.component.js +3 -1
  14. package/esm/components/heading/heading.style.d.ts +2 -2
  15. package/esm/components/hr/hr.component.js +171 -1305
  16. package/esm/components/hr/index.d.ts +1 -0
  17. package/esm/components/inline-inputs/inline-inputs.component.js +35 -90
  18. package/esm/components/link/index.d.ts +1 -0
  19. package/esm/components/link/link.component.js +123 -1228
  20. package/esm/components/navigation-bar/index.d.ts +1 -0
  21. package/esm/components/navigation-bar/navigation-bar.component.js +1018 -10761
  22. package/esm/components/pager/pager.style.d.ts +1 -1
  23. package/esm/components/pod/pod.style.d.ts +1 -1
  24. package/esm/components/progress-tracker/progress-tracker.component.d.ts +4 -1
  25. package/esm/components/progress-tracker/progress-tracker.component.js +25 -2
  26. package/esm/components/progress-tracker/progress-tracker.config.d.ts +0 -1
  27. package/esm/components/progress-tracker/progress-tracker.config.js +1 -1
  28. package/esm/components/progress-tracker/progress-tracker.d.ts +5 -3
  29. package/esm/components/progress-tracker/progress-tracker.style.js +9 -7
  30. package/esm/components/radio-button/radio-button-svg.component.js +16 -29
  31. package/esm/components/text-editor/__internal__/editor-link/editor-link.style.d.ts +1 -1
  32. package/esm/components/tooltip/tooltip.component.js +85 -254
  33. package/esm/components/vertical-divider/index.d.ts +1 -0
  34. package/esm/components/vertical-divider/vertical-divider.component.d.ts +2 -2
  35. package/esm/components/vertical-divider/vertical-divider.component.js +328 -1406
  36. package/esm/components/vertical-divider/vertical-divider.style.d.ts +3 -3
  37. package/lib/__internal__/input/input-presentation.component.js +16 -0
  38. package/lib/__internal__/input/input.component.js +295 -0
  39. package/lib/__internal__/input-behaviour/input-behaviour.component.js +6 -1
  40. package/lib/__internal__/input-behaviour/input-group-behaviour.component.js +7 -1
  41. package/lib/__internal__/validation-message/validation-message.component.js +6 -0
  42. package/lib/__internal__/validations/validation-icon.component.js +39 -0
  43. package/lib/components/alert/alert.component.js +42 -143
  44. package/lib/components/alert/index.d.ts +1 -0
  45. package/lib/components/badge/badge.component.js +24 -50
  46. package/lib/components/button/button.component.js +768 -3378
  47. package/lib/components/carbon-provider/carbon-provider.component.js +54 -110
  48. package/lib/components/date/__internal__/utils.js +1 -1
  49. package/lib/components/date/date.component.js +3 -1
  50. package/lib/components/heading/heading.style.d.ts +2 -2
  51. package/lib/components/hr/hr.component.js +175 -676
  52. package/lib/components/hr/index.d.ts +1 -0
  53. package/lib/components/inline-inputs/inline-inputs.component.js +43 -137
  54. package/lib/components/link/index.d.ts +1 -0
  55. package/lib/components/link/link.component.js +142 -746
  56. package/lib/components/navigation-bar/index.d.ts +1 -0
  57. package/lib/components/navigation-bar/navigation-bar.component.js +1022 -5426
  58. package/lib/components/pager/pager.style.d.ts +1 -1
  59. package/lib/components/pod/pod.style.d.ts +1 -1
  60. package/lib/components/progress-tracker/progress-tracker.component.d.ts +4 -1
  61. package/lib/components/progress-tracker/progress-tracker.component.js +30 -2
  62. package/lib/components/progress-tracker/progress-tracker.config.d.ts +0 -1
  63. package/lib/components/progress-tracker/progress-tracker.config.js +3 -3
  64. package/lib/components/progress-tracker/progress-tracker.d.ts +5 -3
  65. package/lib/components/progress-tracker/progress-tracker.style.js +8 -6
  66. package/lib/components/radio-button/radio-button-svg.component.js +20 -38
  67. package/lib/components/text-editor/__internal__/editor-link/editor-link.style.d.ts +1 -1
  68. package/lib/components/tooltip/tooltip.component.js +98 -215
  69. package/lib/components/vertical-divider/index.d.ts +1 -0
  70. package/lib/components/vertical-divider/vertical-divider.component.d.ts +2 -2
  71. package/lib/components/vertical-divider/vertical-divider.component.js +334 -1457
  72. package/lib/components/vertical-divider/vertical-divider.style.d.ts +3 -3
  73. package/package.json +4 -3
@@ -3,7 +3,7 @@ export const StyledPagerSizeOptions: import("styled-components").StyledComponent
3
3
  export const StyledPagerSizeOptionsInner: import("styled-components").StyledComponent<"div", any, {}, never>;
4
4
  export const StyledPagerNavigation: import("styled-components").StyledComponent<"div", any, {}, never>;
5
5
  export const StyledPagerNavInner: import("styled-components").StyledComponent<"div", any, {}, never>;
6
- export const StyledPagerLinkStyles: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../link/link.component").LinkProps & import("react").RefAttributes<HTMLLinkElement | HTMLButtonElement>>, any, {}, never>;
6
+ export const StyledPagerLinkStyles: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../link").LinkProps & import("react").RefAttributes<HTMLLinkElement | HTMLButtonElement>>, any, {}, never>;
7
7
  export const StyledPagerNoSelect: import("styled-components").StyledComponent<"span", any, {}, never>;
8
8
  export const StyledPagerSummary: import("styled-components").StyledComponent<"div", any, {}, never>;
9
9
  export const StyledSelectContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,6 +1,6 @@
1
1
  export const StyledBlock: import("styled-components").StyledComponent<"div", any, {}, never>;
2
2
  export const StyledContent: import("styled-components").StyledComponent<"div", any, {}, never>;
3
- export const StyledEditAction: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../link/link.component").LinkProps & import("react").RefAttributes<HTMLLinkElement | HTMLButtonElement>>, any, {}, never>;
3
+ export const StyledEditAction: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../link").LinkProps & import("react").RefAttributes<HTMLLinkElement | HTMLButtonElement>>, any, {}, never>;
4
4
  export const StyledActionsContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
5
5
  export const StyledDeleteButton: import("styled-components").StyledComponent<typeof IconButton, any, {}, never>;
6
6
  export const StyledUndoButton: import("styled-components").StyledComponent<typeof IconButton, any, {}, never>;
@@ -1,5 +1,5 @@
1
1
  export default ProgressTracker;
2
- declare function ProgressTracker({ "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, "aria-valuenow": ariaValueNow, "aria-valuemin": ariaValueMin, "aria-valuemax": ariaValueMax, "aria-valuetext": ariaValueText, size, progress, showDefaultLabels, currentProgressLabel, maxProgressLabel, orientation, direction, labelsPosition, ...rest }: {
2
+ declare function ProgressTracker({ "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, "aria-valuenow": ariaValueNow, "aria-valuemin": ariaValueMin, "aria-valuemax": ariaValueMax, "aria-valuetext": ariaValueText, size, length, progress, showDefaultLabels, currentProgressLabel, maxProgressLabel, orientation, direction, labelsPosition, ...rest }: {
3
3
  [x: string]: any;
4
4
  "aria-label"?: string | undefined;
5
5
  "aria-describedby": any;
@@ -8,6 +8,7 @@ declare function ProgressTracker({ "aria-label": ariaLabel, "aria-describedby":
8
8
  "aria-valuemax": any;
9
9
  "aria-valuetext": any;
10
10
  size?: string | undefined;
11
+ length?: string | undefined;
11
12
  progress?: number | undefined;
12
13
  showDefaultLabels?: boolean | undefined;
13
14
  currentProgressLabel: any;
@@ -34,6 +35,8 @@ declare namespace ProgressTracker {
34
35
  "aria-valuetext": PropTypes.Requireable<string>;
35
36
  /** Size of the progress bar. */
36
37
  size: PropTypes.Requireable<string>;
38
+ /** Length of the progress bar, any valid css string. */
39
+ length: PropTypes.Requireable<string>;
37
40
  /** Current progress (percentage). */
38
41
  progress: PropTypes.Requireable<number>;
39
42
  /** Flag to control whether the default value labels (as percentages) should be rendered. */
@@ -1,11 +1,12 @@
1
1
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
 
3
- import React from "react";
3
+ import React, { useCallback, useLayoutEffect, useRef, useState } from "react";
4
4
  import PropTypes from "prop-types";
5
5
  import styledSystemPropTypes from "@styled-system/prop-types";
6
6
  import tagComponent from "../../__internal__/utils/helpers/tags";
7
7
  import { filterStyledSystemMarginProps } from "../../style/utils";
8
8
  import { StyledProgressBar, InnerBar, StyledValuesLabel, StyledProgressTracker, StyledValue } from "./progress-tracker.style";
9
+ import useResizeObserver from "../../hooks/__internal__/useResizeObserver";
9
10
  const marginPropTypes = filterStyledSystemMarginProps(styledSystemPropTypes.space);
10
11
 
11
12
  const ProgressTracker = ({
@@ -16,6 +17,7 @@ const ProgressTracker = ({
16
17
  "aria-valuemax": ariaValueMax,
17
18
  "aria-valuetext": ariaValueText,
18
19
  size = "medium",
20
+ length = "256px",
19
21
  progress = 0,
20
22
  showDefaultLabels = false,
21
23
  currentProgressLabel,
@@ -25,8 +27,23 @@ const ProgressTracker = ({
25
27
  labelsPosition,
26
28
  ...rest
27
29
  }) => {
30
+ const barRef = useRef();
31
+ const [barLength, setBarLength] = useState(0);
28
32
  const isVertical = orientation === "vertical";
29
33
  const prefixLabels = !isVertical && labelsPosition !== "bottom" || isVertical && labelsPosition === "left";
34
+ const updateBarLength = useCallback(() => {
35
+ if (orientation === "horizontal") {
36
+ setBarLength(`${barRef.current.offsetWidth}px`);
37
+ } else {
38
+ setBarLength(`${barRef.current.offsetHeight}px`);
39
+ }
40
+ }, [barRef, orientation]);
41
+ useLayoutEffect(() => {
42
+ updateBarLength();
43
+ }, [barRef, orientation, updateBarLength]);
44
+ useResizeObserver(barRef, () => {
45
+ updateBarLength();
46
+ });
30
47
 
31
48
  const renderValueLabels = () => {
32
49
  if (!showDefaultLabels && !currentProgressLabel && !maxProgressLabel) {
@@ -53,6 +70,7 @@ const ProgressTracker = ({
53
70
 
54
71
  return /*#__PURE__*/React.createElement(StyledProgressTracker, _extends({
55
72
  size: size,
73
+ length: length,
56
74
  isVertical: isVertical
57
75
  }, rest, tagComponent("progress-bar", rest), {
58
76
  role: "progressbar",
@@ -65,10 +83,12 @@ const ProgressTracker = ({
65
83
  }), prefixLabels && renderValueLabels(), /*#__PURE__*/React.createElement(StyledProgressBar, {
66
84
  direction: isVertical ? direction : undefined,
67
85
  isVertical: isVertical,
68
- size: size
86
+ size: size,
87
+ ref: barRef
69
88
  }, /*#__PURE__*/React.createElement(InnerBar, {
70
89
  isVertical: isVertical,
71
90
  size: size,
91
+ length: barLength,
72
92
  progress: progress
73
93
  })), !prefixLabels && renderValueLabels());
74
94
  };
@@ -98,6 +118,9 @@ ProgressTracker.propTypes = { ...marginPropTypes,
98
118
  /** Size of the progress bar. */
99
119
  size: PropTypes.oneOf(["small", "medium", "large"]),
100
120
 
121
+ /** Length of the progress bar, any valid css string. */
122
+ length: PropTypes.string,
123
+
101
124
  /** Current progress (percentage). */
102
125
  progress: PropTypes.number,
103
126
 
@@ -1,2 +1 @@
1
- export const OUTER_TRACKER_LENGTH: "256px";
2
1
  export const PROGRESS_TRACKER_SIZES: string[];
@@ -1,2 +1,2 @@
1
- export const OUTER_TRACKER_LENGTH = "256px";
1
+ /* eslint-disable import/prefer-default-export */
2
2
  export const PROGRESS_TRACKER_SIZES = ["small", "medium", "large"];
@@ -1,6 +1,6 @@
1
1
  import { MarginProps } from "styled-system";
2
2
 
3
- export interface ProgressBarProps extends MarginProps {
3
+ export interface ProgressTrackerProps extends MarginProps {
4
4
  /** Specifies an aria-label to the component */
5
5
  "aria-label"?: string;
6
6
  /** Specifies the aria-describedby for the component */
@@ -16,6 +16,8 @@ export interface ProgressBarProps extends MarginProps {
16
16
  "aria-valuetext"?: string;
17
17
  /** Size of the progressBar. */
18
18
  size?: "small" | "medium" | "large";
19
+ /** Length of the progress bar, any valid css string. */
20
+ length?: string;
19
21
  /** Current progress (percentage). */
20
22
  progress?: number;
21
23
  /** Flag to control whether the default value labels (as percentages) should be rendered. */
@@ -35,6 +37,6 @@ export interface ProgressBarProps extends MarginProps {
35
37
  labelsPosition?: "top" | "bottom" | "left" | "right";
36
38
  }
37
39
 
38
- declare function ProgressBar(props: ProgressBarProps): JSX.Element;
40
+ declare function ProgressTracker(props: ProgressTrackerProps): JSX.Element;
39
41
 
40
- export default ProgressBar;
42
+ export default ProgressTracker;
@@ -2,20 +2,21 @@ import styled, { css } from "styled-components";
2
2
  import PropTypes from "prop-types";
3
3
  import { margin } from "styled-system";
4
4
  import baseTheme from "../../style/themes/base";
5
- import { OUTER_TRACKER_LENGTH, PROGRESS_TRACKER_SIZES } from "./progress-tracker.config";
5
+ import { PROGRESS_TRACKER_SIZES } from "./progress-tracker.config";
6
6
  const StyledProgressTracker = styled.div`
7
7
  ${margin}
8
8
  text-align: center;
9
9
  white-space: nowrap;
10
10
 
11
11
  ${({
12
- isVertical
12
+ isVertical,
13
+ length
13
14
  }) => css`
14
15
  ${!isVertical && `
15
- width: ${OUTER_TRACKER_LENGTH};
16
+ width: ${length};
16
17
  `}
17
18
  ${isVertical && `
18
- height: ${OUTER_TRACKER_LENGTH};
19
+ height: ${length};
19
20
  display: flex;
20
21
  `}
21
22
  `}
@@ -94,19 +95,20 @@ const InnerBar = styled.span`
94
95
  ${({
95
96
  isVertical,
96
97
  progress,
97
- size
98
+ size,
99
+ length
98
100
  }) => css`
99
101
  position: absolute;
100
102
  left: 0;
101
103
  background-color: ${getInnerBarColour(progress)};
102
104
 
103
105
  ${!isVertical && css`
104
- width: calc(${OUTER_TRACKER_LENGTH} * ${progress / 100});
106
+ width: calc(${length} * ${progress / 100});
105
107
  min-width: 2px;
106
108
  height: ${getHeight(size)};
107
109
  `}
108
110
  ${isVertical && css`
109
- height: calc(${OUTER_TRACKER_LENGTH} * ${progress / 100});
111
+ height: calc(${length} * ${progress / 100});
110
112
  min-height: 2px;
111
113
  width: ${getHeight(size)};
112
114
  `}
@@ -1,35 +1,22 @@
1
1
  import React from "react";
2
- import PropTypes from "prop-types";
3
2
  import StyledCheckableInputSvgWrapper from "../../__internal__/checkable-input/checkable-input-svg-wrapper.style";
4
3
 
5
4
  const RadioButtonSvg = () => {
6
- return /*#__PURE__*/ React.createElement(
7
- StyledCheckableInputSvgWrapper,
8
- null,
9
- /*#__PURE__*/ React.createElement(
10
- "svg",
11
- {
12
- focusable: "false",
13
- viewBox: "0 0 15 15",
14
- },
15
- /*#__PURE__*/ React.createElement(
16
- "g",
17
- {
18
- stroke: "none",
19
- strokeWidth: "1",
20
- fill: "none",
21
- fillRule: "evenodd",
22
- },
23
- /*#__PURE__*/ React.createElement("circle", {
24
- className: "radio-button-check",
25
- fill: "#FFFFFF",
26
- cx: "7.5",
27
- cy: "7.5",
28
- r: "5",
29
- })
30
- )
31
- )
32
- );
5
+ return /*#__PURE__*/React.createElement(StyledCheckableInputSvgWrapper, null, /*#__PURE__*/React.createElement("svg", {
6
+ focusable: "false",
7
+ viewBox: "0 0 15 15"
8
+ }, /*#__PURE__*/React.createElement("g", {
9
+ stroke: "none",
10
+ strokeWidth: "1",
11
+ fill: "none",
12
+ fillRule: "evenodd"
13
+ }, /*#__PURE__*/React.createElement("circle", {
14
+ className: "radio-button-check",
15
+ fill: "#FFFFFF",
16
+ cx: "7.5",
17
+ cy: "7.5",
18
+ r: "5"
19
+ }))));
33
20
  };
34
21
 
35
- export default /*#__PURE__*/ React.memo(RadioButtonSvg, () => true);
22
+ export default /*#__PURE__*/React.memo(RadioButtonSvg, () => true);
@@ -1,2 +1,2 @@
1
1
  export default StyledEditorLink;
2
- declare const StyledEditorLink: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../../link/link.component").LinkProps & import("react").RefAttributes<HTMLLinkElement | HTMLButtonElement>>, any, {}, never>;
2
+ declare const StyledEditorLink: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../../link").LinkProps & import("react").RefAttributes<HTMLLinkElement | HTMLButtonElement>>, any, {}, never>;
@@ -1,19 +1,4 @@
1
- function _extends() {
2
- _extends =
3
- Object.assign ||
4
- function (target) {
5
- for (var i = 1; i < arguments.length; i++) {
6
- var source = arguments[i];
7
- for (var key in source) {
8
- if (Object.prototype.hasOwnProperty.call(source, key)) {
9
- target[key] = source[key];
10
- }
11
- }
12
- }
13
- return target;
14
- };
15
- return _extends.apply(this, arguments);
16
- }
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
17
2
 
18
3
  import React from "react";
19
4
  import PropTypes from "prop-types";
@@ -27,253 +12,99 @@ import tagComponent from "../../__internal__/utils/helpers/tags/tags";
27
12
  import CarbonScopedTokensProvider from "../../style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component";
28
13
  const TOOLTIP_DELAY = 100;
29
14
  const tippyPlugins = [sticky];
30
- const Tooltip = /*#__PURE__*/ React.forwardRef(
31
- (
32
- {
33
- children,
34
- isVisible,
35
- position = "top",
36
- message,
37
- type,
38
- size = "medium",
39
- isPartOfInput,
40
- inputSize,
41
- id,
42
- bgColor,
43
- fontColor,
44
- flipOverrides,
45
- target,
46
- ...rest
47
- },
48
- ref
49
- ) => {
50
- const isFlipOverridesValid =
51
- !flipOverrides ||
52
- (Array.isArray(flipOverrides) &&
53
- flipOverrides.every((placement) =>
54
- TOOLTIP_POSITIONS.includes(placement)
55
- ));
56
- invariant(
57
- isFlipOverridesValid,
58
- `The flipOverrides prop supplied to Tooltip must be an array containing some or all of ["top", "bottom", "left", "right"].`
59
- );
15
+ const Tooltip = /*#__PURE__*/React.forwardRef(({
16
+ children,
17
+ isVisible,
18
+ position = "top",
19
+ message,
20
+ type,
21
+ size = "medium",
22
+ isPartOfInput,
23
+ inputSize,
24
+ id,
25
+ bgColor,
26
+ fontColor,
27
+ flipOverrides,
28
+ target,
29
+ ...rest
30
+ }, ref) => {
31
+ const isFlipOverridesValid = !flipOverrides || Array.isArray(flipOverrides) && flipOverrides.every(placement => TOOLTIP_POSITIONS.includes(placement));
32
+ invariant(isFlipOverridesValid, `The flipOverrides prop supplied to Tooltip must be an array containing some or all of ["top", "bottom", "left", "right"].`);
60
33
 
61
- const tooltip = (attrs, content) => {
62
- const currentPosition = attrs["data-placement"] || position;
63
- return /*#__PURE__*/ React.createElement(
64
- CarbonScopedTokensProvider,
65
- null,
66
- /*#__PURE__*/ React.createElement(
67
- StyledTooltip,
68
- _extends(
69
- {
70
- "data-element": "tooltip",
71
- role: "tooltip",
72
- tabIndex: -1,
73
- type: type,
74
- size: size,
75
- id: id,
76
- },
77
- tagComponent("tooltip", rest),
78
- {
79
- isPartOfInput: isPartOfInput,
80
- inputSize: inputSize,
81
- },
82
- attrs,
83
- {
84
- position: currentPosition,
85
- ref: ref,
86
- bgColor: bgColor,
87
- fontColor: fontColor,
88
- }
89
- ),
90
- /*#__PURE__*/ React.createElement(
91
- StyledPointer,
92
- _extends(
93
- {
94
- key: "pointer",
95
- type: type,
96
- },
97
- attrs,
98
- {
99
- position: currentPosition,
100
- "data-popper-arrow": "",
101
- "data-element": "tooltip-pointer",
102
- bgColor: bgColor,
103
- }
104
- )
105
- ),
106
- content
107
- )
108
- );
109
- };
34
+ const tooltip = (attrs, content) => {
35
+ const currentPosition = attrs["data-placement"] || position;
36
+ return /*#__PURE__*/React.createElement(CarbonScopedTokensProvider, null, /*#__PURE__*/React.createElement(StyledTooltip, _extends({
37
+ "data-element": "tooltip",
38
+ role: "tooltip",
39
+ tabIndex: -1,
40
+ type: type,
41
+ size: size,
42
+ id: id
43
+ }, tagComponent("tooltip", rest), {
44
+ isPartOfInput: isPartOfInput,
45
+ inputSize: inputSize
46
+ }, attrs, {
47
+ position: currentPosition,
48
+ ref: ref,
49
+ bgColor: bgColor,
50
+ fontColor: fontColor
51
+ }), /*#__PURE__*/React.createElement(StyledPointer, _extends({
52
+ key: "pointer",
53
+ type: type
54
+ }, attrs, {
55
+ position: currentPosition,
56
+ "data-popper-arrow": "",
57
+ "data-element": "tooltip-pointer",
58
+ bgColor: bgColor
59
+ })), content));
60
+ };
110
61
 
111
- return /*#__PURE__*/ React.createElement(
112
- Tippy,
113
- _extends(
114
- {
115
- placement: position,
116
- delay: TOOLTIP_DELAY,
117
- },
118
- isVisible !== undefined && {
119
- visible: isVisible,
120
- },
121
- {
122
- plugins: tippyPlugins,
123
- sticky: true,
124
- render: (attrs) => tooltip(attrs, message),
125
- reference: target,
126
- popperOptions: {
127
- modifiers: [
128
- ...(flipOverrides
129
- ? [
130
- {
131
- name: "flip",
132
- options: {
133
- fallbackPlacements: flipOverrides,
134
- },
135
- },
136
- ]
137
- : []),
138
- {
139
- name: "computeStyles",
140
- options: {
141
- gpuAcceleration: false,
142
- },
143
- },
144
- ],
145
- },
62
+ return /*#__PURE__*/React.createElement(Tippy, _extends({
63
+ placement: position,
64
+ delay: TOOLTIP_DELAY
65
+ }, isVisible !== undefined && {
66
+ visible: isVisible
67
+ }, {
68
+ plugins: tippyPlugins,
69
+ sticky: true,
70
+ render: attrs => tooltip(attrs, message),
71
+ reference: target,
72
+ popperOptions: {
73
+ modifiers: [...(flipOverrides ? [{
74
+ name: "flip",
75
+ options: {
76
+ fallbackPlacements: flipOverrides
146
77
  }
147
- ),
148
- children
149
- );
150
- }
151
- );
152
-
153
- Tooltip.propTypes = {
154
- /**
155
- * Override background color of the Tooltip, provide any color from palette or any valid css color value.
156
- */
157
- bgColor: PropTypes.string,
158
- /**
159
- * Children elements
160
- */
161
- children: PropTypes.element.isRequired,
162
- /**
163
- * Overrides the default flip behaviour of the Tooltip,
164
- * must be an array containing some or all of ["top", "bottom", "left", "right"]
165
- * (see https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements)
166
- */
167
- flipOverrides: PropTypes.arrayOf(
168
- PropTypes.oneOf(["bottom", "left", "right", "top"])
169
- ),
170
- /**
171
- * Override font color of the Tooltip, provide any color from palette or any valid css color value.
172
- */
173
- fontColor: PropTypes.string,
174
- /**
175
- * The id attribute to use for the tooltip
176
- */
177
- id: PropTypes.string,
178
- inputSize: PropTypes.oneOf(["large", "medium", "small"]),
179
- isPartOfInput: PropTypes.bool,
180
- /**
181
- * Whether to to show the Tooltip
182
- */
183
- isVisible: PropTypes.bool,
184
- key: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
185
- /**
186
- * The message to be displayed within the tooltip
187
- */
188
- message: PropTypes.node,
189
- /**
190
- * Sets position of the tooltip
191
- */
192
- position: PropTypes.oneOf(["bottom", "left", "right", "top"]),
193
- /**
194
- * Defines the size of the tooltip content
195
- */
196
- size: PropTypes.oneOf(["large", "medium"]),
197
- target: function (props, propName) {
198
- if (props[propName] == null) {
199
- return null;
200
- } else if (
201
- typeof props[propName] !== "object" ||
202
- props[propName].nodeType !== 1
203
- ) {
204
- return new Error(
205
- "Expected prop '" + propName + "' to be of type Element"
206
- );
78
+ }] : []), {
79
+ name: "computeStyles",
80
+ options: {
81
+ gpuAcceleration: false
82
+ }
83
+ }]
207
84
  }
208
- },
209
- /**
210
- * Defines the message type
211
- */
212
- type: PropTypes.string,
213
- };
214
-
85
+ }), children);
86
+ });
215
87
  Tooltip.propTypes = {
216
- /**
217
- * Override background color of the Tooltip, provide any color from palette or any valid css color value.
218
- */
219
- bgColor: PropTypes.string,
220
- /**
221
- * Children elements
222
- */
223
- children: PropTypes.element.isRequired,
224
- /**
225
- * Overrides the default flip behaviour of the Tooltip,
226
- * must be an array containing some or all of ["top", "bottom", "left", "right"]
227
- * (see https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements)
228
- */
229
- flipOverrides: PropTypes.arrayOf(
230
- PropTypes.oneOf(["bottom", "left", "right", "top"])
231
- ),
232
- /**
233
- * Override font color of the Tooltip, provide any color from palette or any valid css color value.
234
- */
235
- fontColor: PropTypes.string,
236
- /**
237
- * The id attribute to use for the tooltip
238
- */
239
- id: PropTypes.string,
240
- inputSize: PropTypes.oneOf(["large", "medium", "small"]),
241
- isPartOfInput: PropTypes.bool,
242
- /**
243
- * Whether to to show the Tooltip
244
- */
245
- isVisible: PropTypes.bool,
246
- key: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
247
- /**
248
- * The message to be displayed within the tooltip
249
- */
250
- message: PropTypes.node,
251
- /**
252
- * Sets position of the tooltip
253
- */
254
- position: PropTypes.oneOf(["bottom", "left", "right", "top"]),
255
- /**
256
- * Defines the size of the tooltip content
257
- */
258
- size: PropTypes.oneOf(["large", "medium"]),
259
- target: function (props, propName) {
88
+ "bgColor": PropTypes.string,
89
+ "children": PropTypes.element.isRequired,
90
+ "flipOverrides": PropTypes.arrayOf(PropTypes.oneOf(["bottom", "left", "right", "top"])),
91
+ "fontColor": PropTypes.string,
92
+ "id": PropTypes.string,
93
+ "inputSize": PropTypes.oneOf(["large", "medium", "small"]),
94
+ "isPartOfInput": PropTypes.bool,
95
+ "isVisible": PropTypes.bool,
96
+ "message": PropTypes.node,
97
+ "position": PropTypes.oneOf(["bottom", "left", "right", "top"]),
98
+ "size": PropTypes.oneOf(["large", "medium"]),
99
+ "target": function (props, propName) {
260
100
  if (props[propName] == null) {
261
101
  return null;
262
- } else if (
263
- typeof props[propName] !== "object" ||
264
- props[propName].nodeType !== 1
265
- ) {
266
- return new Error(
267
- "Expected prop '" + propName + "' to be of type Element"
268
- );
102
+ } else if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) {
103
+ return new Error("Expected prop '" + propName + "' to be of type Element");
269
104
  }
270
105
  },
271
- /**
272
- * Defines the message type
273
- */
274
- type: PropTypes.string,
106
+ "type": PropTypes.string
275
107
  };
276
-
277
108
  export { Tooltip };
278
109
  Tooltip.displayName = "Tooltip";
279
- export default Tooltip;
110
+ export default Tooltip;
@@ -1 +1,2 @@
1
1
  export { default } from "./vertical-divider.component";
2
+ export type { VerticalDividerProps } from "./vertical-divider.component";
@@ -1,12 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { SpaceProps } from "styled-system";
3
3
  declare type TintRange = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100;
4
- export interface VerticalDividerPropTypes extends SpaceProps {
4
+ export interface VerticalDividerProps extends SpaceProps {
5
5
  h?: number | string;
6
6
  height?: number | string;
7
7
  displayInline?: boolean;
8
8
  /** the supported rage is 1-100 */
9
9
  tint?: TintRange;
10
10
  }
11
- declare const VerticalDivider: ({ h, height, displayInline, tint, ...props }: VerticalDividerPropTypes) => JSX.Element;
11
+ declare const VerticalDivider: ({ h, height, displayInline, tint, ...props }: VerticalDividerProps) => JSX.Element;
12
12
  export default VerticalDivider;