@elliemae/ds-tooltip 2.0.0-alpha.11 → 2.0.0-alpha.12
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.
- package/cjs/v1/DSTooltip.js +9 -7
- package/cjs/v2/DSTooltip.js +23 -17
- package/cjs/v2/DSTooltipArrow.js +22 -19
- package/cjs/v2/styles.js +26 -11
- package/cjs/v2/utils/setMultipleRefs.js +11 -1
- package/cjs/v3/config/useWithDefaultProps.js +2 -1
- package/cjs/v3/index.js +67 -21
- package/cjs/v3/propsTypes.js +17 -2
- package/cjs/v3/styleds.js +30 -8
- package/esm/v1/DSTooltip.js +7 -4
- package/esm/v2/DSTooltip.js +23 -17
- package/esm/v2/DSTooltipArrow.js +22 -19
- package/esm/v2/styles.js +26 -11
- package/esm/v2/utils/setMultipleRefs.js +11 -1
- package/esm/v3/config/useWithDefaultProps.js +2 -1
- package/esm/v3/index.js +70 -24
- package/esm/v3/propsTypes.js +17 -2
- package/esm/v3/styleds.js +29 -9
- package/package.json +23 -10
- package/types/v1/DSTooltip.d.ts +79 -16
- package/types/v2/DSTooltip.d.ts +62 -15
- package/types/v2/propTypes.d.ts +57 -14
- package/types/v2/styles.d.ts +5 -5
- package/types/v3/propsTypes.d.ts +58 -15
- package/types/v3/styleds.d.ts +6 -2
package/esm/v3/index.js
CHANGED
|
@@ -2,21 +2,35 @@ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
|
2
2
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
3
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
4
4
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
5
|
-
import
|
|
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';
|
|
6
11
|
import { DSPopperJS } from '@elliemae/ds-popperjs';
|
|
7
12
|
import { describe } from 'react-desc';
|
|
8
13
|
import { dsTooltipPropTypes } from './propsTypes.js';
|
|
9
14
|
import { useWithDefaultProps } from './config/useWithDefaultProps.js';
|
|
10
15
|
import { TooltipV3DatatestId } from './TooltipV3DatatestId.js';
|
|
11
|
-
import { StyledTooltipContainer, StyledTooltipText } from './styleds.js';
|
|
12
|
-
import {
|
|
16
|
+
import { StyledTriggerWrapper, StyledTooltipContainer, StyledTooltipText, StyledMouseOverDetectionBox } from './styleds.js';
|
|
17
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
13
18
|
|
|
14
|
-
|
|
19
|
+
var _StyledMouseOverDetec;
|
|
20
|
+
|
|
21
|
+
const _excluded = ["text", "children", "onOpen", "onClose", "id", "textAlign"];
|
|
15
22
|
|
|
16
23
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
17
24
|
|
|
18
25
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
19
26
|
|
|
27
|
+
const useGlobalKeyboardListener = func => {
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
document.addEventListener('keydown', func);
|
|
30
|
+
return () => document.removeEventListener('keydown', func);
|
|
31
|
+
}, [func]);
|
|
32
|
+
};
|
|
33
|
+
|
|
20
34
|
const DSTooltipV3 = props => {
|
|
21
35
|
const _useWithDefaultProps = useWithDefaultProps(props),
|
|
22
36
|
{
|
|
@@ -24,10 +38,14 @@ const DSTooltipV3 = props => {
|
|
|
24
38
|
children,
|
|
25
39
|
onOpen,
|
|
26
40
|
onClose,
|
|
27
|
-
id
|
|
41
|
+
id,
|
|
42
|
+
textAlign
|
|
28
43
|
} = _useWithDefaultProps,
|
|
29
44
|
extraPopperJsProps = _objectWithoutProperties(_useWithDefaultProps, _excluded);
|
|
30
45
|
|
|
46
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
47
|
+
const [isHover, setIsHover] = useState(false);
|
|
48
|
+
const [latestOpenInteraction, setLatestOpenInteraction] = useState('');
|
|
31
49
|
const [referenceElement, setReferenceElement] = useState();
|
|
32
50
|
const [showPopover, setShowPopover] = useState(false);
|
|
33
51
|
const showTooltip = useCallback(() => {
|
|
@@ -38,29 +56,57 @@ const DSTooltipV3 = props => {
|
|
|
38
56
|
setShowPopover(false);
|
|
39
57
|
onClose();
|
|
40
58
|
}, [onClose]);
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
59
|
+
const onFocus = useCallback(() => {
|
|
60
|
+
setIsFocused(true);
|
|
61
|
+
|
|
62
|
+
if (!showPopover) {
|
|
63
|
+
showTooltip();
|
|
64
|
+
setLatestOpenInteraction('onFocus');
|
|
65
|
+
}
|
|
66
|
+
}, [showPopover, showTooltip]);
|
|
67
|
+
const onBlur = useCallback(() => {
|
|
68
|
+
setIsFocused(false);
|
|
69
|
+
if (!isHover || latestOpenInteraction === 'onFocus') hideTooltip();
|
|
70
|
+
}, [hideTooltip, isHover, latestOpenInteraction]);
|
|
71
|
+
const onMouseEnter = useCallback(() => {
|
|
72
|
+
setIsHover(true);
|
|
73
|
+
|
|
74
|
+
if (!showPopover) {
|
|
75
|
+
showTooltip();
|
|
76
|
+
setLatestOpenInteraction('onMouseEnter');
|
|
77
|
+
}
|
|
78
|
+
}, [showPopover, showTooltip]);
|
|
79
|
+
const onMouseLeave = useCallback(() => {
|
|
80
|
+
setIsHover(false);
|
|
81
|
+
if (!isFocused || latestOpenInteraction === 'onMouseEnter') hideTooltip();
|
|
82
|
+
}, [hideTooltip, isFocused, latestOpenInteraction]);
|
|
83
|
+
const handleEscKey = useCallback(_ref => {
|
|
84
|
+
let {
|
|
85
|
+
key
|
|
86
|
+
} = _ref;
|
|
44
87
|
if (key === 'Escape') hideTooltip();
|
|
45
88
|
}, [hideTooltip]);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}, void 0, /*#__PURE__*/_jsx(StyledTooltipContainer, {}, void 0, /*#__PURE__*/_jsx(StyledTooltipText, {}, void 0, text)))
|
|
54
|
-
})), /*#__PURE__*/jsx("div", {
|
|
55
|
-
onMouseOver: showTooltip,
|
|
56
|
-
onFocus: showTooltip,
|
|
57
|
-
onMouseOut: hideTooltip,
|
|
58
|
-
onBlur: hideTooltip,
|
|
59
|
-
onKeyDown: handleEscKey,
|
|
89
|
+
useGlobalKeyboardListener(handleEscKey);
|
|
90
|
+
return /*#__PURE__*/jsx(Fragment, {
|
|
91
|
+
children: /*#__PURE__*/jsxs(StyledTriggerWrapper, {
|
|
92
|
+
onMouseEnter: onMouseEnter,
|
|
93
|
+
onMouseLeave: onMouseLeave,
|
|
94
|
+
onFocus: onFocus,
|
|
95
|
+
onBlur: onBlur,
|
|
60
96
|
ref: setReferenceElement,
|
|
61
97
|
"data-testid": "".concat(TooltipV3DatatestId.TRIGGER_WRAPPER).concat(id !== '' ? "_".concat(id) : ''),
|
|
62
|
-
children:
|
|
63
|
-
|
|
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
|
+
})
|
|
64
110
|
});
|
|
65
111
|
};
|
|
66
112
|
|
package/esm/v3/propsTypes.js
CHANGED
|
@@ -2,9 +2,14 @@ import { PropTypes } from 'react-desc';
|
|
|
2
2
|
|
|
3
3
|
const dsTooltipPropTypes = {
|
|
4
4
|
/**
|
|
5
|
-
* Tooltip text to be displayed on hover
|
|
5
|
+
* Tooltip text to be displayed on hover/focus
|
|
6
6
|
*/
|
|
7
|
-
text: PropTypes.string.description('Tooltip text to be displayed on hover').isRequired,
|
|
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'),
|
|
8
13
|
|
|
9
14
|
/**
|
|
10
15
|
* Element to tie the tooltip to, must be a single node
|
|
@@ -27,6 +32,16 @@ const dsTooltipPropTypes = {
|
|
|
27
32
|
*/
|
|
28
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),
|
|
29
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
|
+
|
|
30
45
|
/**
|
|
31
46
|
* When using portal, the container in which to append the DOM content, defaults to document body
|
|
32
47
|
*/
|
package/esm/v3/styleds.js
CHANGED
|
@@ -2,15 +2,35 @@ import styled from 'styled-components';
|
|
|
2
2
|
|
|
3
3
|
const StyledTooltipContainer = /*#__PURE__*/styled.div.withConfig({
|
|
4
4
|
componentId: "sc-18a4gem-0"
|
|
5
|
-
})(["text-align:center;min-width:", ";max-width:250px;min-height:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
})(["text-align:center;min-width:", ";max-width:250px;min-height:30px;display:grid;align-items:center;padding:", ";position:relative;background-color:white;border-radius:2px;font-size:13px;color:", ";"], _ref => {
|
|
6
|
+
let {
|
|
7
|
+
theme
|
|
8
|
+
} = _ref;
|
|
9
|
+
return theme.space.l;
|
|
10
|
+
}, _ref2 => {
|
|
11
|
+
let {
|
|
12
|
+
theme
|
|
13
|
+
} = _ref2;
|
|
14
|
+
return "".concat(theme.space.xxxs, " ").concat(theme.space.xs);
|
|
15
|
+
}, _ref3 => {
|
|
16
|
+
let {
|
|
17
|
+
theme
|
|
18
|
+
} = _ref3;
|
|
19
|
+
return theme.colors.neutral[600];
|
|
20
|
+
});
|
|
12
21
|
const StyledTooltipText = /*#__PURE__*/styled.div.withConfig({
|
|
13
22
|
componentId: "sc-18a4gem-1"
|
|
14
|
-
})(["white-space:normal;word-wrap:break-word;display:inline-block;"]
|
|
23
|
+
})(["white-space:normal;word-wrap:break-word;display:inline-block;text-align:", ";"], _ref4 => {
|
|
24
|
+
let {
|
|
25
|
+
textAlign
|
|
26
|
+
} = _ref4;
|
|
27
|
+
return textAlign;
|
|
28
|
+
});
|
|
29
|
+
const StyledMouseOverDetectionBox = /*#__PURE__*/styled.div.withConfig({
|
|
30
|
+
componentId: "sc-18a4gem-2"
|
|
31
|
+
})(["position:absolute;top:-15px;right:-15px;width:calc(100% + 30px);height:calc(100% + 30px);z-index:-1;"]);
|
|
32
|
+
const StyledTriggerWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
33
|
+
componentId: "sc-18a4gem-3"
|
|
34
|
+
})(["display:inline-block;width:100%;"]);
|
|
15
35
|
|
|
16
|
-
export { StyledTooltipContainer, StyledTooltipText };
|
|
36
|
+
export { StyledMouseOverDetectionBox, StyledTooltipContainer, StyledTooltipText, StyledTriggerWrapper };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-tooltip",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.12",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Tooltip",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -92,18 +92,31 @@
|
|
|
92
92
|
"build": "node ../../scripts/build/build.js"
|
|
93
93
|
},
|
|
94
94
|
"dependencies": {
|
|
95
|
-
"@elliemae/ds-
|
|
96
|
-
"@elliemae/ds-
|
|
97
|
-
"@elliemae/ds-
|
|
98
|
-
"@elliemae/ds-
|
|
99
|
-
"@elliemae/ds-
|
|
100
|
-
"@
|
|
101
|
-
"
|
|
102
|
-
"
|
|
95
|
+
"@elliemae/ds-button": "2.0.0-alpha.12",
|
|
96
|
+
"@elliemae/ds-classnames": "2.0.0-alpha.12",
|
|
97
|
+
"@elliemae/ds-popper": "2.0.0-alpha.12",
|
|
98
|
+
"@elliemae/ds-popperjs": "2.0.0-alpha.12",
|
|
99
|
+
"@elliemae/ds-portal": "2.0.0-alpha.12",
|
|
100
|
+
"@elliemae/ds-props-helpers": "2.0.0-alpha.12",
|
|
101
|
+
"@elliemae/ds-shared": "2.0.0-alpha.12",
|
|
102
|
+
"@elliemae/ds-system": "2.0.0-alpha.12",
|
|
103
|
+
"@elliemae/ds-utilities": "2.0.0-alpha.12",
|
|
104
|
+
"@popperjs/core": "~2.9.2",
|
|
105
|
+
"react-desc": "~4.1.3",
|
|
106
|
+
"react-popper": "~2.2.5"
|
|
107
|
+
},
|
|
108
|
+
"devDependencies": {
|
|
109
|
+
"@testing-library/jest-dom": "~5.15.0",
|
|
110
|
+
"@testing-library/react": "~12.1.2",
|
|
111
|
+
"@testing-library/user-event": "~13.5.0",
|
|
112
|
+
"react": "^17.0.2",
|
|
113
|
+
"react-dom": "^17.0.2",
|
|
114
|
+
"styled-components": "~5.3.3"
|
|
103
115
|
},
|
|
104
116
|
"peerDependencies": {
|
|
105
117
|
"react": "^17.0.2",
|
|
106
|
-
"react-dom": "^17.0.2"
|
|
118
|
+
"react-dom": "^17.0.2",
|
|
119
|
+
"styled-components": "^5.3.3"
|
|
107
120
|
},
|
|
108
121
|
"publishConfig": {
|
|
109
122
|
"access": "public",
|
package/types/v1/DSTooltip.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference path="../../../../../shared/typings/react-desc.d.ts" />
|
|
1
2
|
import React from 'react';
|
|
2
3
|
declare const TooltipContainer: React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
|
|
3
4
|
declare const TooltipText: React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
|
|
@@ -21,23 +22,85 @@ declare const DSTooltip: {
|
|
|
21
22
|
zIndex: any;
|
|
22
23
|
}): JSX.Element;
|
|
23
24
|
propTypes: {
|
|
24
|
-
containerProps:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
25
|
+
containerProps: {
|
|
26
|
+
defaultValue<T = unknown>(arg: T): {
|
|
27
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
28
|
+
};
|
|
29
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
30
|
+
};
|
|
31
|
+
placement: {
|
|
32
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
33
|
+
};
|
|
34
|
+
title: import("react-desc").PropTypesDescValidator;
|
|
35
|
+
delayClose: {
|
|
36
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
37
|
+
};
|
|
38
|
+
delayOpen: {
|
|
39
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
40
|
+
};
|
|
41
|
+
interactionType: {
|
|
42
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
43
|
+
};
|
|
44
|
+
triggerComponent: import("react-desc").PropTypesDescValidator;
|
|
45
|
+
isOpen: {
|
|
46
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
47
|
+
};
|
|
48
|
+
onOpen: {
|
|
49
|
+
defaultValue<T = unknown>(arg: T): {
|
|
50
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
51
|
+
};
|
|
52
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
53
|
+
};
|
|
54
|
+
springAnimationComponent: {
|
|
55
|
+
defaultValue<T = unknown>(arg: T): {
|
|
56
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
57
|
+
};
|
|
58
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
59
|
+
};
|
|
60
|
+
showArrow: {
|
|
61
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
62
|
+
};
|
|
63
|
+
className: {
|
|
64
|
+
defaultValue<T = unknown>(arg: T): {
|
|
65
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
66
|
+
};
|
|
67
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
68
|
+
};
|
|
69
|
+
tooltipType: {
|
|
70
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
71
|
+
};
|
|
72
|
+
zIndex: {
|
|
73
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
74
|
+
};
|
|
75
|
+
innerRef: {
|
|
76
|
+
defaultValue<T = unknown>(arg: T): {
|
|
77
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
78
|
+
};
|
|
79
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
80
|
+
};
|
|
39
81
|
};
|
|
40
82
|
};
|
|
41
|
-
declare const TooltipWithSchema:
|
|
83
|
+
declare const TooltipWithSchema: {
|
|
84
|
+
(props?: {
|
|
85
|
+
[x: string]: any;
|
|
86
|
+
containerProps?: {} | undefined;
|
|
87
|
+
innerRef: any;
|
|
88
|
+
placement?: string | undefined;
|
|
89
|
+
title?: string | undefined;
|
|
90
|
+
delayClose?: any;
|
|
91
|
+
delayOpen?: any;
|
|
92
|
+
interactionType?: string | undefined;
|
|
93
|
+
triggerComponent?: null | undefined;
|
|
94
|
+
className?: string | undefined;
|
|
95
|
+
isOpen?: undefined;
|
|
96
|
+
onOpen?: (() => null) | undefined;
|
|
97
|
+
springAnimationComponent?: undefined;
|
|
98
|
+
tooltipType?: string | undefined;
|
|
99
|
+
showArrow?: boolean | undefined;
|
|
100
|
+
zIndex: any;
|
|
101
|
+
} | undefined): JSX.Element;
|
|
102
|
+
propTypes: unknown;
|
|
103
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
104
|
+
};
|
|
42
105
|
export { DSTooltip, TooltipContainer, TooltipText, TooltipWithSchema };
|
|
43
106
|
export default DSTooltip;
|
package/types/v2/DSTooltip.d.ts
CHANGED
|
@@ -1,23 +1,70 @@
|
|
|
1
|
+
/// <reference path="../../../../../shared/typings/react-desc.d.ts" />
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { DSTooltipT } from '.';
|
|
3
4
|
declare const DSTooltipV2: {
|
|
4
5
|
({ containerProps, innerRef, placement, title, delayClose, delayOpen, triggerComponent, className, getIsOpen, onOpen, tooltipType, showArrow, offset, zIndex, extraModifiers, }: DSTooltipT): React.ReactElement;
|
|
5
6
|
propTypes: {
|
|
6
|
-
containerProps:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
containerProps: {
|
|
8
|
+
defaultValue<T = unknown>(arg: T): {
|
|
9
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
10
|
+
};
|
|
11
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
12
|
+
};
|
|
13
|
+
placement: {
|
|
14
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
15
|
+
};
|
|
16
|
+
title: import("react-desc").PropTypesDescValidator;
|
|
17
|
+
delayClose: {
|
|
18
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
19
|
+
};
|
|
20
|
+
delayOpen: {
|
|
21
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
22
|
+
};
|
|
23
|
+
triggerComponent: import("react-desc").PropTypesDescValidator;
|
|
24
|
+
getIsOpen: {
|
|
25
|
+
defaultValue<T = unknown>(arg: T): {
|
|
26
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
27
|
+
};
|
|
28
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
29
|
+
};
|
|
30
|
+
onOpen: {
|
|
31
|
+
defaultValue<T = unknown>(arg: T): {
|
|
32
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
33
|
+
};
|
|
34
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
35
|
+
};
|
|
36
|
+
showArrow: {
|
|
37
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
38
|
+
};
|
|
39
|
+
className: {
|
|
40
|
+
defaultValue<T = unknown>(arg: T): {
|
|
41
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
42
|
+
};
|
|
43
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
44
|
+
};
|
|
45
|
+
tooltipType: {
|
|
46
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
47
|
+
};
|
|
48
|
+
zIndex: {
|
|
49
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
50
|
+
};
|
|
51
|
+
innerRef: {
|
|
52
|
+
defaultValue<T = unknown>(arg: T): {
|
|
53
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
54
|
+
};
|
|
55
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
56
|
+
};
|
|
57
|
+
offset: {
|
|
58
|
+
defaultValue<T = unknown>(arg: T): {
|
|
59
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
60
|
+
};
|
|
61
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
62
|
+
};
|
|
20
63
|
};
|
|
21
64
|
};
|
|
22
|
-
declare const TooltipV2WithSchema:
|
|
65
|
+
declare const TooltipV2WithSchema: {
|
|
66
|
+
(props?: DSTooltipT | undefined): JSX.Element;
|
|
67
|
+
propTypes: unknown;
|
|
68
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
69
|
+
};
|
|
23
70
|
export { DSTooltipV2, TooltipV2WithSchema };
|
package/types/v2/propTypes.d.ts
CHANGED
|
@@ -1,17 +1,60 @@
|
|
|
1
|
+
/// <reference path="../../../../../shared/typings/react-desc.d.ts" />
|
|
1
2
|
declare const tooltipV2Props: {
|
|
2
|
-
containerProps:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
3
|
+
containerProps: {
|
|
4
|
+
defaultValue<T = unknown>(arg: T): {
|
|
5
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
6
|
+
};
|
|
7
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
8
|
+
};
|
|
9
|
+
placement: {
|
|
10
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
11
|
+
};
|
|
12
|
+
title: import("react-desc").PropTypesDescValidator;
|
|
13
|
+
delayClose: {
|
|
14
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
15
|
+
};
|
|
16
|
+
delayOpen: {
|
|
17
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
18
|
+
};
|
|
19
|
+
triggerComponent: import("react-desc").PropTypesDescValidator;
|
|
20
|
+
getIsOpen: {
|
|
21
|
+
defaultValue<T = unknown>(arg: T): {
|
|
22
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
23
|
+
};
|
|
24
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
25
|
+
};
|
|
26
|
+
onOpen: {
|
|
27
|
+
defaultValue<T = unknown>(arg: T): {
|
|
28
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
29
|
+
};
|
|
30
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
31
|
+
};
|
|
32
|
+
showArrow: {
|
|
33
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
34
|
+
};
|
|
35
|
+
className: {
|
|
36
|
+
defaultValue<T = unknown>(arg: T): {
|
|
37
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
38
|
+
};
|
|
39
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
40
|
+
};
|
|
41
|
+
tooltipType: {
|
|
42
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
43
|
+
};
|
|
44
|
+
zIndex: {
|
|
45
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
46
|
+
};
|
|
47
|
+
innerRef: {
|
|
48
|
+
defaultValue<T = unknown>(arg: T): {
|
|
49
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
50
|
+
};
|
|
51
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
52
|
+
};
|
|
53
|
+
offset: {
|
|
54
|
+
defaultValue<T = unknown>(arg: T): {
|
|
55
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
56
|
+
};
|
|
57
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
58
|
+
};
|
|
16
59
|
};
|
|
17
60
|
export { tooltipV2Props };
|
package/types/v2/styles.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TooltipAnimationT, TooltipContainerT } from './index.d';
|
|
2
|
-
declare const StyledTooltipContainer: import("styled-components").StyledComponent<"div",
|
|
3
|
-
declare const StyledAnimatedTooltip: import("styled-components").StyledComponent<"div",
|
|
4
|
-
declare const StyledTriggerComponentContainer: import("styled-components").StyledComponent<"div",
|
|
5
|
-
declare const StyledTooltipText: import("styled-components").StyledComponent<"div",
|
|
6
|
-
declare const StyledTooltipArrow: import("styled-components").StyledComponent<"div",
|
|
2
|
+
declare const StyledTooltipContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TooltipContainerT, never>;
|
|
3
|
+
declare const StyledAnimatedTooltip: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TooltipAnimationT, never>;
|
|
4
|
+
declare const StyledTriggerComponentContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
5
|
+
declare const StyledTooltipText: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
6
|
+
declare const StyledTooltipArrow: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
7
7
|
export { StyledTooltipContainer, StyledTriggerComponentContainer, StyledTooltipText, StyledTooltipArrow, StyledAnimatedTooltip, };
|
package/types/v3/propsTypes.d.ts
CHANGED
|
@@ -1,60 +1,103 @@
|
|
|
1
|
+
/// <reference path="../../../../../shared/typings/react-desc.d.ts" />
|
|
1
2
|
export declare const dsTooltipPropTypes: {
|
|
2
3
|
/**
|
|
3
|
-
* Tooltip text to be displayed on hover
|
|
4
|
+
* Tooltip text to be displayed on hover/focus
|
|
4
5
|
*/
|
|
5
|
-
text:
|
|
6
|
+
text: import("react-desc").PropTypesDescValidator;
|
|
7
|
+
/**
|
|
8
|
+
* Tooltip text alignment
|
|
9
|
+
*/
|
|
10
|
+
textAlign: {
|
|
11
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
12
|
+
};
|
|
6
13
|
/**
|
|
7
14
|
* Element to tie the tooltip to, must be a single node
|
|
8
15
|
*/
|
|
9
|
-
children:
|
|
16
|
+
children: import("react-desc").PropTypesDescValidator;
|
|
10
17
|
/**
|
|
11
18
|
* Wheter or not the tooltip content should appear in a DOM portal or not
|
|
12
19
|
*/
|
|
13
|
-
withoutPortal:
|
|
20
|
+
withoutPortal: {
|
|
21
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
22
|
+
};
|
|
14
23
|
/**
|
|
15
24
|
* Wheter or not the tooltip should use the arrow
|
|
16
25
|
*/
|
|
17
|
-
withoutArrow:
|
|
26
|
+
withoutArrow: {
|
|
27
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
28
|
+
};
|
|
18
29
|
/**
|
|
19
30
|
* Bounding element to calculate upon, defaults to it is "clippingParents",
|
|
20
31
|
* which are the scrolling containers that may cause the element to be partially or fully cut off.
|
|
21
32
|
*/
|
|
22
|
-
boundaryElement:
|
|
33
|
+
boundaryElement: {
|
|
34
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Whether or not the popper context menu should be animated
|
|
38
|
+
*/
|
|
39
|
+
withoutAnimation: {
|
|
40
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Popper context menus Animation duration in ms
|
|
44
|
+
*/
|
|
45
|
+
animationDuration: {
|
|
46
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
47
|
+
};
|
|
23
48
|
/**
|
|
24
49
|
* When using portal, the container in which to append the DOM content, defaults to document body
|
|
25
50
|
*/
|
|
26
|
-
portalDOMContainer:
|
|
51
|
+
portalDOMContainer: {
|
|
52
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
53
|
+
};
|
|
27
54
|
/**
|
|
28
55
|
* start placement preferences, as per popperjs placement option
|
|
29
56
|
*/
|
|
30
|
-
startPlacementPreference:
|
|
57
|
+
startPlacementPreference: {
|
|
58
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
59
|
+
};
|
|
31
60
|
/**
|
|
32
61
|
* Array of placement preferences, as per popperjs "flip" placement option
|
|
33
62
|
*/
|
|
34
|
-
placementOrderPreference:
|
|
63
|
+
placementOrderPreference: {
|
|
64
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
65
|
+
};
|
|
35
66
|
/**
|
|
36
67
|
* tooltip wrapper z-index
|
|
37
68
|
*/
|
|
38
|
-
zIndex:
|
|
69
|
+
zIndex: {
|
|
70
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
71
|
+
};
|
|
39
72
|
/**
|
|
40
73
|
* placement offset array
|
|
41
74
|
*/
|
|
42
|
-
customOffset:
|
|
75
|
+
customOffset: {
|
|
76
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
77
|
+
};
|
|
43
78
|
/**
|
|
44
79
|
* modifiers array for full-custom tooltip-js override
|
|
45
80
|
* https://tooltip.js.org/docs/v2/modifiers/
|
|
46
81
|
*/
|
|
47
|
-
modifiers:
|
|
82
|
+
modifiers: {
|
|
83
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
84
|
+
};
|
|
48
85
|
/**
|
|
49
86
|
* Optional id appended to data-testid
|
|
50
87
|
*/
|
|
51
|
-
id:
|
|
88
|
+
id: {
|
|
89
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
90
|
+
};
|
|
52
91
|
/**
|
|
53
92
|
* Optional callback to be invoked when the tooltip opens
|
|
54
93
|
*/
|
|
55
|
-
onOpen:
|
|
94
|
+
onOpen: {
|
|
95
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
96
|
+
};
|
|
56
97
|
/**
|
|
57
98
|
* 'Optional callback to be invoked when the tooltip closes
|
|
58
99
|
*/
|
|
59
|
-
onClose:
|
|
100
|
+
onClose: {
|
|
101
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
102
|
+
};
|
|
60
103
|
};
|