@elliemae/ds-tooltip 2.2.0-alpha.3 → 3.0.0-next.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 (70) hide show
  1. package/cjs/index.js +23 -41
  2. package/cjs/v1/DSTooltip.js +105 -108
  3. package/cjs/v1/TooltipType.js +8 -36
  4. package/cjs/v2/DSTooltip.js +121 -117
  5. package/cjs/v2/DSTooltipArrow.js +38 -50
  6. package/cjs/v2/TooltipType.js +8 -36
  7. package/cjs/v2/index.d.js +2 -27
  8. package/cjs/v2/propTypes.js +25 -54
  9. package/cjs/v2/styles.js +59 -128
  10. package/cjs/v2/utils/setMultipleRefs.js +21 -41
  11. package/cjs/v2/utils/tooltipPositions.js +18 -46
  12. package/cjs/v3/TooltipV3DatatestId.js +8 -36
  13. package/cjs/v3/config/useWithDefaultProps.js +14 -40
  14. package/cjs/v3/index.d.js +2 -27
  15. package/cjs/v3/index.js +103 -90
  16. package/cjs/v3/propsTypes.js +94 -78
  17. package/cjs/v3/styleds.js +46 -69
  18. package/esm/index.js +5 -12
  19. package/esm/v1/DSTooltip.js +87 -88
  20. package/esm/v1/TooltipType.js +4 -7
  21. package/esm/v2/DSTooltip.js +97 -80
  22. package/esm/v2/DSTooltipArrow.js +30 -21
  23. package/esm/v2/TooltipType.js +4 -7
  24. package/esm/v2/index.d.js +1 -2
  25. package/esm/v2/propTypes.js +21 -25
  26. package/esm/v2/styles.js +47 -100
  27. package/esm/v2/utils/setMultipleRefs.js +18 -13
  28. package/esm/v2/utils/tooltipPositions.js +14 -17
  29. package/esm/v3/TooltipV3DatatestId.js +4 -7
  30. package/esm/v3/config/useWithDefaultProps.js +10 -11
  31. package/esm/v3/index.d.js +1 -2
  32. package/esm/v3/index.js +79 -54
  33. package/esm/v3/propsTypes.js +90 -49
  34. package/esm/v3/styleds.js +36 -41
  35. package/package.json +10 -10
  36. package/types/index.d.ts +1 -1
  37. package/cjs/index.js.map +0 -7
  38. package/cjs/v1/DSTooltip.js.map +0 -7
  39. package/cjs/v1/TooltipType.js.map +0 -7
  40. package/cjs/v2/DSTooltip.js.map +0 -7
  41. package/cjs/v2/DSTooltipArrow.js.map +0 -7
  42. package/cjs/v2/TooltipType.js.map +0 -7
  43. package/cjs/v2/index.d.js.map +0 -7
  44. package/cjs/v2/propTypes.js.map +0 -7
  45. package/cjs/v2/styles.js.map +0 -7
  46. package/cjs/v2/utils/setMultipleRefs.js.map +0 -7
  47. package/cjs/v2/utils/tooltipPositions.js.map +0 -7
  48. package/cjs/v3/TooltipV3DatatestId.js.map +0 -7
  49. package/cjs/v3/config/useWithDefaultProps.js.map +0 -7
  50. package/cjs/v3/index.d.js.map +0 -7
  51. package/cjs/v3/index.js.map +0 -7
  52. package/cjs/v3/propsTypes.js.map +0 -7
  53. package/cjs/v3/styleds.js.map +0 -7
  54. package/esm/index.js.map +0 -7
  55. package/esm/v1/DSTooltip.js.map +0 -7
  56. package/esm/v1/TooltipType.js.map +0 -7
  57. package/esm/v2/DSTooltip.js.map +0 -7
  58. package/esm/v2/DSTooltipArrow.js.map +0 -7
  59. package/esm/v2/TooltipType.js.map +0 -7
  60. package/esm/v2/index.d.js.map +0 -7
  61. package/esm/v2/propTypes.js.map +0 -7
  62. package/esm/v2/styles.js.map +0 -7
  63. package/esm/v2/utils/setMultipleRefs.js.map +0 -7
  64. package/esm/v2/utils/tooltipPositions.js.map +0 -7
  65. package/esm/v3/TooltipV3DatatestId.js.map +0 -7
  66. package/esm/v3/config/useWithDefaultProps.js.map +0 -7
  67. package/esm/v3/index.d.js.map +0 -7
  68. package/esm/v3/index.js.map +0 -7
  69. package/esm/v3/propsTypes.js.map +0 -7
  70. package/esm/v3/styleds.js.map +0 -7
package/esm/v2/styles.js CHANGED
@@ -1,102 +1,49 @@
1
- import * as React from "react";
2
- import styled from "styled-components";
3
- import { kfrm, css } from "@elliemae/ds-system";
4
- const showAnimation = kfrm`
5
- from {
6
- opacity: 0;
7
- transform: scale(0.8);
8
- }
1
+ import _taggedTemplateLiteral from '@babel/runtime/helpers/esm/taggedTemplateLiteral';
2
+ import styled from 'styled-components';
3
+ import { kfrm, css } from '@elliemae/ds-system';
9
4
 
10
- to {
11
- opacity: 1;
12
- transform: scale(1);
13
- visibility: visible;
14
- }
15
- `;
16
- const hideAnimation = kfrm`
17
- 0% {
18
- opacity: 1;
19
- transform: scale(1);
20
- }
5
+ var _templateObject, _templateObject2, _templateObject3;
6
+ const showAnimation = kfrm(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n from {\n opacity: 0;\n transform: scale(0.8);\n }\n\n to {\n opacity: 1;\n transform: scale(1);\n visibility: visible;\n }\n"])));
7
+ const hideAnimation = kfrm(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n 0% {\n opacity: 1;\n transform: scale(1);\n }\n\n 100% {\n opacity: 0;\n transform: scale(0.8);\n }\n"])));
8
+ const StyledTooltipContainer = /*#__PURE__*/styled.div.withConfig({
9
+ componentId: "sc-1dtjf9j-0"
10
+ })(["&[data-popper-reference-hidden='true']{display:none;pointer-events:none;}"]);
11
+ const StyledAnimatedTooltip = /*#__PURE__*/styled.div.withConfig({
12
+ componentId: "sc-1dtjf9j-1"
13
+ })(["text-align:center;min-width:", ";max-width:250px;min-height:24px;padding:", ";position:relative;background-color:white;border-radius:2px;font-size:13px;color:", ";box-shadow:0 1px 5px 0 rgb(0 0 0 / 13%),0 2px 4px 0 rgb(0 0 0 / 20%);filter:drop-shadow(0 4px 8px rgba(0,0,0,0.2));visibility:", ";", " transition:visibility 0.1s ease-in;"], _ref => {
14
+ let {
15
+ theme
16
+ } = _ref;
17
+ return theme.space.l;
18
+ }, _ref2 => {
19
+ let {
20
+ theme
21
+ } = _ref2;
22
+ return "".concat(theme.space.xxxs, " ").concat(theme.space.xs);
23
+ }, _ref3 => {
24
+ let {
25
+ theme
26
+ } = _ref3;
27
+ return theme.colors.neutral[600];
28
+ }, _ref4 => {
29
+ let {
30
+ showTooltip
31
+ } = _ref4;
32
+ return showTooltip ? 'visible' : 'hidden';
33
+ }, _ref5 => {
34
+ let {
35
+ showTooltip
36
+ } = _ref5;
37
+ return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n animation: ", " 0.1s ease-in;\n "])), showTooltip ? showAnimation : hideAnimation);
38
+ });
39
+ const StyledTriggerComponentContainer = /*#__PURE__*/styled.div.withConfig({
40
+ componentId: "sc-1dtjf9j-2"
41
+ })(["display:inline-block;"]);
42
+ const StyledTooltipText = /*#__PURE__*/styled.div.withConfig({
43
+ componentId: "sc-1dtjf9j-3"
44
+ })(["white-space:normal;word-wrap:break-word;display:inline-block;"]);
45
+ const StyledTooltipArrow = /*#__PURE__*/styled.div.withConfig({
46
+ componentId: "sc-1dtjf9j-4"
47
+ })(["position:absolute;width:18px;height:18px;pointer-events:none;background-color:transparent;& .stroke{fill:white;}& .fill{fill:white;}&[data-placement^='top']{svg{transform:rotateZ(180deg);}top:98%;}&[data-placement^='right']{svg{transform:rotateZ(-90deg);}right:99.5%;}&[data-placement^='bottom']{bottom:97%;}&[data-placement^='left']{svg{transform:rotateZ(90deg);}left:99.5%;}"]);
21
48
 
22
- 100% {
23
- opacity: 0;
24
- transform: scale(0.8);
25
- }
26
- `;
27
- const StyledTooltipContainer = styled.div`
28
- &[data-popper-reference-hidden='true'] {
29
- display: none;
30
- pointer-events: none;
31
- }
32
- `;
33
- const StyledAnimatedTooltip = styled.div`
34
- text-align: center;
35
- min-width: ${({ theme }) => theme.space.l};
36
- max-width: 250px;
37
- min-height: 24px;
38
- padding: ${({ theme }) => `${theme.space.xxxs} ${theme.space.xs}`};
39
- position: relative;
40
- background-color: white;
41
- border-radius: 2px;
42
- font-size: 13px;
43
- color: ${({ theme }) => theme.colors.neutral[600]};
44
- box-shadow: 0 1px 5px 0 rgb(0 0 0 / 13%), 0 2px 4px 0 rgb(0 0 0 / 20%);
45
- filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
46
- visibility: ${({ showTooltip }) => showTooltip ? "visible" : "hidden"};
47
- ${({ showTooltip }) => css`
48
- animation: ${showTooltip ? showAnimation : hideAnimation} 0.1s ease-in;
49
- `}
50
- transition: visibility 0.1s ease-in;
51
- `;
52
- const StyledTriggerComponentContainer = styled.div`
53
- display: inline-block;
54
- `;
55
- const StyledTooltipText = styled.div`
56
- white-space: normal;
57
- word-wrap: break-word;
58
- display: inline-block;
59
- `;
60
- const StyledTooltipArrow = styled.div`
61
- position: absolute;
62
- width: 18px;
63
- height: 18px;
64
- pointer-events: none;
65
- background-color: transparent;
66
- & .stroke {
67
- fill: white;
68
- }
69
- & .fill {
70
- fill: white;
71
- }
72
-
73
- &[data-placement^='top'] {
74
- svg {
75
- transform: rotateZ(180deg);
76
- }
77
- top: 98%;
78
- }
79
- &[data-placement^='right'] {
80
- svg {
81
- transform: rotateZ(-90deg);
82
- }
83
- right: 99.5%;
84
- }
85
- &[data-placement^='bottom'] {
86
- bottom: 97%;
87
- }
88
- &[data-placement^='left'] {
89
- svg {
90
- transform: rotateZ(90deg);
91
- }
92
- left: 99.5%;
93
- }
94
- `;
95
- export {
96
- StyledAnimatedTooltip,
97
- StyledTooltipArrow,
98
- StyledTooltipContainer,
99
- StyledTooltipText,
100
- StyledTriggerComponentContainer
101
- };
102
- //# sourceMappingURL=styles.js.map
49
+ export { StyledAnimatedTooltip, StyledTooltipArrow, StyledTooltipContainer, StyledTooltipText, StyledTriggerComponentContainer };
@@ -1,13 +1,20 @@
1
- import * as React from "react";
2
- const setMultipleRefs = (...refs) => {
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
6
+
7
+ const setMultipleRefs = function () {
8
+ for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
9
+ refs[_key] = arguments[_key];
10
+ }
11
+
3
12
  const filteredRefs = refs.filter(Boolean);
4
- if (!filteredRefs.length)
5
- return null;
6
- if (filteredRefs.length === 0)
7
- return filteredRefs[0];
8
- return (newRef) => {
9
- filteredRefs.forEach((refToBeUpdated) => {
10
- if (typeof refToBeUpdated === "function") {
13
+ if (!filteredRefs.length) return null;
14
+ if (filteredRefs.length === 0) return filteredRefs[0];
15
+ return newRef => {
16
+ filteredRefs.forEach(refToBeUpdated => {
17
+ if (typeof refToBeUpdated === 'function') {
11
18
  refToBeUpdated(newRef);
12
19
  } else if (refToBeUpdated) {
13
20
  refToBeUpdated.current = newRef;
@@ -15,7 +22,5 @@ const setMultipleRefs = (...refs) => {
15
22
  });
16
23
  };
17
24
  };
18
- export {
19
- setMultipleRefs
20
- };
21
- //# sourceMappingURL=setMultipleRefs.js.map
25
+
26
+ export { setMultipleRefs };
@@ -1,19 +1,16 @@
1
- import * as React from "react";
2
1
  const tooltipPositions = {
3
- TOP: "top",
4
- BOTTOM: "bottom",
5
- RIGHT: "right",
6
- LEFT: "left",
7
- TOP_START: "top-start",
8
- TOP_END: "top-end",
9
- BOTTOM_START: "bottom-start",
10
- BOTTOM_END: "bottom-end",
11
- RIGHT_START: "right-start",
12
- RIGHT_END: "right-end",
13
- LEFT_START: "left-start",
14
- LEFT_END: "left-end"
2
+ TOP: 'top',
3
+ BOTTOM: 'bottom',
4
+ RIGHT: 'right',
5
+ LEFT: 'left',
6
+ TOP_START: 'top-start',
7
+ TOP_END: 'top-end',
8
+ BOTTOM_START: 'bottom-start',
9
+ BOTTOM_END: 'bottom-end',
10
+ RIGHT_START: 'right-start',
11
+ RIGHT_END: 'right-end',
12
+ LEFT_START: 'left-start',
13
+ LEFT_END: 'left-end'
15
14
  };
16
- export {
17
- tooltipPositions
18
- };
19
- //# sourceMappingURL=tooltipPositions.js.map
15
+
16
+ export { tooltipPositions };
@@ -1,9 +1,6 @@
1
- import * as React from "react";
2
1
  const TooltipV3DatatestId = {
3
- TRIGGER_WRAPPER: "ds-tooltip-v3-trigger-wrapper",
4
- TOOLTIP_TEXT_WRAPPER: "ds-tooltip-v3-tooltip-text-wrapper"
2
+ TRIGGER_WRAPPER: 'ds-tooltip-v3-trigger-wrapper',
3
+ TOOLTIP_TEXT_WRAPPER: 'ds-tooltip-v3-tooltip-text-wrapper'
5
4
  };
6
- export {
7
- TooltipV3DatatestId
8
- };
9
- //# sourceMappingURL=TooltipV3DatatestId.js.map
5
+
6
+ export { TooltipV3DatatestId };
@@ -1,15 +1,14 @@
1
- import * as React from "react";
2
- import { useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
3
- const noop = () => {
4
- };
1
+ import { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';
2
+
3
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
4
+ const noop = () => {};
5
+
5
6
  const defaultProps = {
6
7
  onOpen: noop,
7
8
  onClose: noop,
8
- id: "",
9
- textAlign: "left"
10
- };
11
- const useWithDefaultProps = (props) => useMemoMergePropsWithDefault(props, defaultProps);
12
- export {
13
- useWithDefaultProps
9
+ id: '',
10
+ textAlign: 'left'
14
11
  };
15
- //# sourceMappingURL=useWithDefaultProps.js.map
12
+ const useWithDefaultProps = props => useMemoMergePropsWithDefault(props, defaultProps);
13
+
14
+ export { useWithDefaultProps };
package/esm/v3/index.d.js CHANGED
@@ -1,2 +1 @@
1
- import * as React from "react";
2
- //# sourceMappingURL=index.d.js.map
1
+
package/esm/v3/index.js CHANGED
@@ -1,27 +1,51 @@
1
- import * as React from "react";
2
- import React2, { useState, useCallback, useEffect } from "react";
3
- import { DSPopperJS } from "@elliemae/ds-popperjs";
4
- import { describe } from "react-desc";
5
- import { dsTooltipPropTypes } from "./propsTypes";
6
- import { useWithDefaultProps } from "./config/useWithDefaultProps";
7
- import { TooltipV3DatatestId } from "./TooltipV3DatatestId";
8
- import {
9
- StyledTooltipContainer,
10
- StyledTooltipText,
11
- StyledMouseOverDetectionBox,
12
- StyledTriggerWrapper
13
- } from "./styleds";
14
- const useGlobalKeyboardListener = (func) => {
1
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
3
+ import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
4
+ import 'core-js/modules/web.dom-collections.iterator.js';
5
+ import 'core-js/modules/esnext.async-iterator.filter.js';
6
+ import 'core-js/modules/esnext.iterator.constructor.js';
7
+ import 'core-js/modules/esnext.iterator.filter.js';
8
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
9
+ import 'core-js/modules/esnext.iterator.for-each.js';
10
+ import { useState, useCallback, useEffect } from 'react';
11
+ import { DSPopperJS } from '@elliemae/ds-popperjs';
12
+ import { describe } from 'react-desc';
13
+ import { dsTooltipPropTypes } from './propsTypes.js';
14
+ import { useWithDefaultProps } from './config/useWithDefaultProps.js';
15
+ import { TooltipV3DatatestId } from './TooltipV3DatatestId.js';
16
+ import { StyledTriggerWrapper, StyledTooltipContainer, StyledTooltipText, StyledMouseOverDetectionBox } from './styleds.js';
17
+ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
18
+
19
+ var _StyledMouseOverDetec;
20
+
21
+ const _excluded = ["text", "children", "onOpen", "onClose", "id", "textAlign"];
22
+
23
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
24
+
25
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
26
+
27
+ const useGlobalKeyboardListener = func => {
15
28
  useEffect(() => {
16
- document.addEventListener("keydown", func);
17
- return () => document.removeEventListener("keydown", func);
29
+ document.addEventListener('keydown', func);
30
+ return () => document.removeEventListener('keydown', func);
18
31
  }, [func]);
19
32
  };
20
- const DSTooltipV3 = (props) => {
21
- const { text, children, onOpen, onClose, id, textAlign, ...extraPopperJsProps } = useWithDefaultProps(props);
33
+
34
+ const DSTooltipV3 = props => {
35
+ const _useWithDefaultProps = useWithDefaultProps(props),
36
+ {
37
+ text,
38
+ children,
39
+ onOpen,
40
+ onClose,
41
+ id,
42
+ textAlign
43
+ } = _useWithDefaultProps,
44
+ extraPopperJsProps = _objectWithoutProperties(_useWithDefaultProps, _excluded);
45
+
22
46
  const [isFocused, setIsFocused] = useState(false);
23
47
  const [isHover, setIsHover] = useState(false);
24
- const [latestOpenInteraction, setLatestOpenInteraction] = useState("");
48
+ const [latestOpenInteraction, setLatestOpenInteraction] = useState('');
25
49
  const [referenceElement, setReferenceElement] = useState();
26
50
  const [showPopover, setShowPopover] = useState(false);
27
51
  const showTooltip = useCallback(() => {
@@ -34,58 +58,59 @@ const DSTooltipV3 = (props) => {
34
58
  }, [onClose]);
35
59
  const onFocus = useCallback(() => {
36
60
  setIsFocused(true);
61
+
37
62
  if (!showPopover) {
38
63
  showTooltip();
39
- setLatestOpenInteraction("onFocus");
64
+ setLatestOpenInteraction('onFocus');
40
65
  }
41
66
  }, [showPopover, showTooltip]);
42
67
  const onBlur = useCallback(() => {
43
68
  setIsFocused(false);
44
- if (!isHover || latestOpenInteraction === "onFocus")
45
- hideTooltip();
69
+ if (!isHover || latestOpenInteraction === 'onFocus') hideTooltip();
46
70
  }, [hideTooltip, isHover, latestOpenInteraction]);
47
71
  const onMouseEnter = useCallback(() => {
48
72
  setIsHover(true);
73
+
49
74
  if (!showPopover) {
50
75
  showTooltip();
51
- setLatestOpenInteraction("onMouseEnter");
76
+ setLatestOpenInteraction('onMouseEnter');
52
77
  }
53
78
  }, [showPopover, showTooltip]);
54
79
  const onMouseLeave = useCallback(() => {
55
80
  setIsHover(false);
56
- if (!isFocused || latestOpenInteraction === "onMouseEnter")
57
- hideTooltip();
81
+ if (!isFocused || latestOpenInteraction === 'onMouseEnter') hideTooltip();
58
82
  }, [hideTooltip, isFocused, latestOpenInteraction]);
59
- const handleEscKey = useCallback(({ key }) => {
60
- if (key === "Escape")
61
- hideTooltip();
83
+ const handleEscKey = useCallback(_ref => {
84
+ let {
85
+ key
86
+ } = _ref;
87
+ if (key === 'Escape') hideTooltip();
62
88
  }, [hideTooltip]);
63
89
  useGlobalKeyboardListener(handleEscKey);
64
- return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(StyledTriggerWrapper, {
65
- onMouseEnter,
66
- onMouseLeave,
67
- onFocus,
68
- onBlur,
69
- ref: setReferenceElement,
70
- "data-testid": `${TooltipV3DatatestId.TRIGGER_WRAPPER}${id !== "" ? `_${id}` : ""}`
71
- }, /* @__PURE__ */ React2.createElement(DSPopperJS, {
72
- referenceElement,
73
- showPopover,
74
- withoutPortal: true,
75
- ...extraPopperJsProps
76
- }, /* @__PURE__ */ React2.createElement("div", {
77
- "data-testid": `${TooltipV3DatatestId.TOOLTIP_TEXT_WRAPPER}${id !== "" ? `_${id}` : ""}`
78
- }, /* @__PURE__ */ React2.createElement(StyledTooltipContainer, null, /* @__PURE__ */ React2.createElement(StyledTooltipText, {
79
- textAlign
80
- }, text), /* @__PURE__ */ React2.createElement(StyledMouseOverDetectionBox, null)))), children));
90
+ return /*#__PURE__*/jsx(Fragment, {
91
+ children: /*#__PURE__*/jsxs(StyledTriggerWrapper, {
92
+ onMouseEnter: onMouseEnter,
93
+ onMouseLeave: onMouseLeave,
94
+ onFocus: onFocus,
95
+ onBlur: onBlur,
96
+ ref: setReferenceElement,
97
+ "data-testid": "".concat(TooltipV3DatatestId.TRIGGER_WRAPPER).concat(id !== '' ? "_".concat(id) : ''),
98
+ children: [/*#__PURE__*/jsx(DSPopperJS, _objectSpread(_objectSpread({
99
+ referenceElement: referenceElement,
100
+ showPopover: showPopover,
101
+ withoutPortal: true
102
+ }, extraPopperJsProps), {}, {
103
+ children: /*#__PURE__*/_jsx("div", {
104
+ "data-testid": "".concat(TooltipV3DatatestId.TOOLTIP_TEXT_WRAPPER).concat(id !== '' ? "_".concat(id) : '')
105
+ }, void 0, /*#__PURE__*/_jsx(StyledTooltipContainer, {}, void 0, /*#__PURE__*/_jsx(StyledTooltipText, {
106
+ textAlign: textAlign
107
+ }, void 0, text), _StyledMouseOverDetec || (_StyledMouseOverDetec = /*#__PURE__*/_jsx(StyledMouseOverDetectionBox, {}))))
108
+ })), children]
109
+ })
110
+ });
81
111
  };
82
- DSTooltipV3.propTypes = dsTooltipPropTypes;
83
- const DSTooltipV3WithSchema = describe(DSTooltipV3).description("A tooltip component");
112
+
113
+ const DSTooltipV3WithSchema = describe(DSTooltipV3).description('A tooltip component');
84
114
  DSTooltipV3WithSchema.propTypes = dsTooltipPropTypes;
85
- var v3_default = DSTooltipV3;
86
- export {
87
- DSTooltipV3,
88
- DSTooltipV3WithSchema,
89
- v3_default as default
90
- };
91
- //# sourceMappingURL=index.js.map
115
+
116
+ export { DSTooltipV3, DSTooltipV3WithSchema, DSTooltipV3 as default };
@@ -1,51 +1,92 @@
1
- import * as React from "react";
2
- import { PropTypes } from "react-desc";
1
+ import { PropTypes } from 'react-desc';
2
+
3
3
  const dsTooltipPropTypes = {
4
- text: PropTypes.string.description("Tooltip text to be displayed on hover/focus").isRequired,
5
- textAlign: PropTypes.oneOf(["left", "right", "center", "justify", "initial", "inherit"]).description("Tooltip text alignment").defaultValue("left"),
6
- children: PropTypes.node.description("Element to tie the tooltip to, must be a single node").isRequired,
7
- withoutPortal: PropTypes.bool.description("Whether or not the tooltip content should appear in a DOM portal or not").defaultValue(true),
8
- withoutArrow: PropTypes.bool.description("Whether or not the tooltip should use the arrow").defaultValue(false),
9
- boundaryElement: PropTypes.element.description('Bounding element to calculate upon, defaults to "clippingParents",which are the scrolling containers that may cause element to be partially or fully cut off').defaultValue(void 0),
10
- withoutAnimation: PropTypes.bool.description("Whether or not the popper context menu should be animated").defaultValue(false),
11
- animationDuration: PropTypes.number.description("Popper context menus Animation duration in ms").defaultValue(100),
12
- portalDOMContainer: PropTypes.element.description("When using portal, the container in which to append the DOM content, defaults to document body").defaultValue(void 0),
13
- startPlacementPreference: PropTypes.oneOf([
14
- "top-start",
15
- "top",
16
- "top-end",
17
- "right-start",
18
- "right",
19
- "right-end",
20
- "bottom-end",
21
- "bottom",
22
- "bottom-start",
23
- "left-end",
24
- "left",
25
- "left-start"
26
- ]).description("start placement preferences, as per popperjs placement option").defaultValue("'top'"),
27
- placementOrderPreference: PropTypes.arrayOf(PropTypes.oneOf([
28
- "top-start",
29
- "top",
30
- "top-end",
31
- "right-start",
32
- "right",
33
- "right-end",
34
- "bottom-end",
35
- "bottom",
36
- "bottom-start",
37
- "left-end",
38
- "left",
39
- "left-start"
40
- ])).description('Array of placement preferences, as per popperjs "flip" placement option').defaultValue("['top', 'bottom', 'left', 'right']"),
41
- zIndex: PropTypes.number.description("popperjs content z-index").defaultValue(1),
42
- customOffset: PropTypes.arrayOf(PropTypes.number).description("placement offset array").defaultValue([0, 14]),
43
- modifiers: PropTypes.array.description("modifiers array for full-custom tooltip-js override, https://tooltip.js.org/docs/v2/modifiers/").defaultValue(1),
44
- id: PropTypes.string.description("Optional id appended to data-testid").defaultValue(""),
45
- onOpen: PropTypes.func.description("Optional callback to be invoked when the tooltip opens").defaultValue("() => {}"),
46
- onClose: PropTypes.func.description("Optional callback to be invoked when the tooltip closes").defaultValue("() => {}")
4
+ /**
5
+ * Tooltip text to be displayed on hover/focus
6
+ */
7
+ text: PropTypes.string.description('Tooltip text to be displayed on hover/focus').isRequired,
8
+
9
+ /**
10
+ * Tooltip text alignment
11
+ */
12
+ textAlign: PropTypes.oneOf(['left', 'right', 'center', 'justify', 'initial', 'inherit']).description('Tooltip text alignment').defaultValue('left'),
13
+
14
+ /**
15
+ * Element to tie the tooltip to, must be a single node
16
+ */
17
+ children: PropTypes.node.description('Element to tie the tooltip to, must be a single node').isRequired,
18
+
19
+ /**
20
+ * Wheter or not the tooltip content should appear in a DOM portal or not
21
+ */
22
+ withoutPortal: PropTypes.bool.description('Whether or not the tooltip content should appear in a DOM portal or not').defaultValue(true),
23
+
24
+ /**
25
+ * Wheter or not the tooltip should use the arrow
26
+ */
27
+ withoutArrow: PropTypes.bool.description('Whether or not the tooltip should use the arrow').defaultValue(false),
28
+
29
+ /**
30
+ * Bounding element to calculate upon, defaults to it is "clippingParents",
31
+ * which are the scrolling containers that may cause the element to be partially or fully cut off.
32
+ */
33
+ boundaryElement: PropTypes.element.description('Bounding element to calculate upon, defaults to "clippingParents",' + 'which are the scrolling containers that may cause element to be partially or fully cut off').defaultValue(undefined),
34
+
35
+ /**
36
+ * Whether or not the popper context menu should be animated
37
+ */
38
+ withoutAnimation: PropTypes.bool.description('Whether or not the popper context menu should be animated').defaultValue(false),
39
+
40
+ /**
41
+ * Popper context menus Animation duration in ms
42
+ */
43
+ animationDuration: PropTypes.number.description('Popper context menus Animation duration in ms').defaultValue(100),
44
+
45
+ /**
46
+ * When using portal, the container in which to append the DOM content, defaults to document body
47
+ */
48
+ portalDOMContainer: PropTypes.element.description('When using portal, the container in which to append the DOM content, defaults to document body').defaultValue(undefined),
49
+
50
+ /**
51
+ * start placement preferences, as per popperjs placement option
52
+ */
53
+ startPlacementPreference: PropTypes.oneOf(['top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']).description('start placement preferences, as per popperjs placement option').defaultValue("'top'"),
54
+
55
+ /**
56
+ * Array of placement preferences, as per popperjs "flip" placement option
57
+ */
58
+ placementOrderPreference: PropTypes.arrayOf(PropTypes.oneOf(['top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'])).description('Array of placement preferences, as per popperjs "flip" placement option').defaultValue("['top', 'bottom', 'left', 'right']"),
59
+
60
+ /**
61
+ * tooltip wrapper z-index
62
+ */
63
+ zIndex: PropTypes.number.description('popperjs content z-index').defaultValue(1),
64
+
65
+ /**
66
+ * placement offset array
67
+ */
68
+ customOffset: PropTypes.arrayOf(PropTypes.number).description('placement offset array').defaultValue([0, 14]),
69
+
70
+ /**
71
+ * modifiers array for full-custom tooltip-js override
72
+ * https://tooltip.js.org/docs/v2/modifiers/
73
+ */
74
+ modifiers: PropTypes.array.description('modifiers array for full-custom tooltip-js override, https://tooltip.js.org/docs/v2/modifiers/').defaultValue(1),
75
+
76
+ /**
77
+ * Optional id appended to data-testid
78
+ */
79
+ id: PropTypes.string.description('Optional id appended to data-testid').defaultValue(''),
80
+
81
+ /**
82
+ * Optional callback to be invoked when the tooltip opens
83
+ */
84
+ onOpen: PropTypes.func.description('Optional callback to be invoked when the tooltip opens').defaultValue('() => {}'),
85
+
86
+ /**
87
+ * 'Optional callback to be invoked when the tooltip closes
88
+ */
89
+ onClose: PropTypes.func.description('Optional callback to be invoked when the tooltip closes').defaultValue('() => {}')
47
90
  };
48
- export {
49
- dsTooltipPropTypes
50
- };
51
- //# sourceMappingURL=propsTypes.js.map
91
+
92
+ export { dsTooltipPropTypes };