@elliemae/ds-tooltip 2.3.0-next.7 → 2.3.0-rc.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.
@@ -0,0 +1,25 @@
1
+ import { PropTypes } from 'react-desc';
2
+ import { TEXT_ALIGNMENT, PLACEMENT } from './constants.js';
3
+
4
+ const propTypes = {
5
+ text: PropTypes.string.description('Tooltip text to be displayed on hover/focus').isRequired,
6
+ textAlign: PropTypes.oneOf(TEXT_ALIGNMENT).description('Tooltip text alignment').defaultValue('left'),
7
+ wrapWords: PropTypes.bool.description('Break words into a new line. Useful when words exceed tooltip max-lenght.').defaultValue(false),
8
+ children: PropTypes.node.description('Element to tie the tooltip to, must be a single node').isRequired,
9
+ withoutPortal: PropTypes.bool.description('Whether or not the tooltip content should appear in a DOM portal or not').defaultValue(true),
10
+ withoutArrow: PropTypes.bool.description('Whether or not the tooltip should use the arrow').defaultValue(false),
11
+ 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),
12
+ withoutAnimation: PropTypes.bool.description('Whether or not the popper context menu should be animated').defaultValue(false),
13
+ animationDuration: PropTypes.number.description('Popper context menus Animation duration in ms').defaultValue(100),
14
+ portalDOMContainer: PropTypes.element.description('When using portal, the container in which to append the DOM content, defaults to document body').defaultValue(undefined),
15
+ startPlacementPreference: PropTypes.oneOf(PLACEMENT).description('start placement preferences, as per popperjs placement option').defaultValue("'top'"),
16
+ placementOrderPreference: PropTypes.arrayOf(PropTypes.oneOf(PLACEMENT)).description('Array of placement preferences, as per popperjs "flip" placement option').defaultValue("['top', 'bottom', 'left', 'right']"),
17
+ zIndex: PropTypes.number.description('popperjs content z-index').defaultValue(1),
18
+ customOffset: PropTypes.arrayOf(PropTypes.number).description('placement offset array').defaultValue([0, 14]),
19
+ modifiers: PropTypes.array.description('modifiers array for full-custom tooltip-js override, https://tooltip.js.org/docs/v2/modifiers/').defaultValue(1),
20
+ id: PropTypes.string.description('Optional id appended to data-testid').defaultValue(''),
21
+ onOpen: PropTypes.func.description('Optional callback to be invoked when the tooltip opens').defaultValue('() => {}'),
22
+ onClose: PropTypes.func.description('Optional callback to be invoked when the tooltip closes').defaultValue('() => {}')
23
+ };
24
+
25
+ export { propTypes };
@@ -1,7 +1,7 @@
1
1
  import styled from 'styled-components';
2
2
 
3
3
  const StyledTooltipContainer = /*#__PURE__*/styled.div.withConfig({
4
- componentId: "sc-18a4gem-0"
4
+ componentId: "sc-1jxtr2y-0"
5
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
6
  let {
7
7
  theme
@@ -19,18 +19,23 @@ const StyledTooltipContainer = /*#__PURE__*/styled.div.withConfig({
19
19
  return theme.colors.neutral[600];
20
20
  });
21
21
  const StyledTooltipText = /*#__PURE__*/styled.div.withConfig({
22
- componentId: "sc-18a4gem-1"
23
- })(["white-space:normal;word-wrap:break-word;display:inline-block;text-align:", ";"], _ref4 => {
22
+ componentId: "sc-1jxtr2y-1"
23
+ })(["display:inline-block;text-align:", ";word-wrap:break-word;", ""], _ref4 => {
24
24
  let {
25
25
  textAlign
26
26
  } = _ref4;
27
27
  return textAlign;
28
+ }, _ref5 => {
29
+ let {
30
+ wrapWords
31
+ } = _ref5;
32
+ return wrapWords ? "word-break: break-all;" : "white-space: normal;";
28
33
  });
29
34
  const StyledMouseOverDetectionBox = /*#__PURE__*/styled.div.withConfig({
30
- componentId: "sc-18a4gem-2"
35
+ componentId: "sc-1jxtr2y-2"
31
36
  })(["position:absolute;top:-15px;right:-15px;width:calc(100% + 30px);height:calc(100% + 30px);z-index:-1;"]);
32
37
  const StyledTriggerWrapper = /*#__PURE__*/styled.div.withConfig({
33
- componentId: "sc-18a4gem-3"
38
+ componentId: "sc-1jxtr2y-3"
34
39
  })(["display:inline-flex;width:100%;"]);
35
40
 
36
41
  export { StyledMouseOverDetectionBox, StyledTooltipContainer, StyledTooltipText, StyledTriggerWrapper };
@@ -0,0 +1,10 @@
1
+ import { useEffect } from 'react';
2
+
3
+ const useGlobalKeyboardListener = func => {
4
+ useEffect(() => {
5
+ document.addEventListener('keydown', func);
6
+ return () => document.removeEventListener('keydown', func);
7
+ }, [func]);
8
+ };
9
+
10
+ export { useGlobalKeyboardListener };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-tooltip",
3
- "version": "2.3.0-next.7",
3
+ "version": "2.3.0-rc.2",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Tooltip",
6
6
  "module": "./esm/index.js",
@@ -11,25 +11,37 @@
11
11
  "import": "./esm/index.js",
12
12
  "require": "./cjs/index.js"
13
13
  },
14
+ "./v3/utils": {
15
+ "import": "./esm/v3/utils.js",
16
+ "require": "./cjs/v3/utils.js"
17
+ },
14
18
  "./v3/TooltipV3DatatestId": {
15
19
  "import": "./esm/v3/TooltipV3DatatestId.js",
16
20
  "require": "./cjs/v3/TooltipV3DatatestId.js"
17
21
  },
18
- "./v3/styleds": {
19
- "import": "./esm/v3/styleds.js",
20
- "require": "./cjs/v3/styleds.js"
22
+ "./v3/styles": {
23
+ "import": "./esm/v3/styles.js",
24
+ "require": "./cjs/v3/styles.js"
21
25
  },
22
- "./v3/propsTypes": {
23
- "import": "./esm/v3/propsTypes.js",
24
- "require": "./cjs/v3/propsTypes.js"
26
+ "./v3/propTypes": {
27
+ "import": "./esm/v3/propTypes.js",
28
+ "require": "./cjs/v3/propTypes.js"
25
29
  },
26
30
  "./v3": {
27
31
  "import": "./esm/v3/index.js",
28
32
  "require": "./cjs/v3/index.js"
29
33
  },
30
- "./v3/config/useWithDefaultProps": {
31
- "import": "./esm/v3/config/useWithDefaultProps.js",
32
- "require": "./cjs/v3/config/useWithDefaultProps.js"
34
+ "./v3/DSTooltipV3": {
35
+ "import": "./esm/v3/DSTooltipV3.js",
36
+ "require": "./cjs/v3/DSTooltipV3.js"
37
+ },
38
+ "./v3/defaultProps": {
39
+ "import": "./esm/v3/defaultProps.js",
40
+ "require": "./cjs/v3/defaultProps.js"
41
+ },
42
+ "./v3/constants": {
43
+ "import": "./esm/v3/constants.js",
44
+ "require": "./cjs/v3/constants.js"
33
45
  },
34
46
  "./v2/utils/tooltipPositions": {
35
47
  "import": "./esm/v2/utils/tooltipPositions.js",
@@ -92,15 +104,15 @@
92
104
  "build": "node ../../scripts/build/build.js"
93
105
  },
94
106
  "dependencies": {
95
- "@elliemae/ds-button": "2.3.0-next.7",
96
- "@elliemae/ds-classnames": "2.3.0-next.7",
97
- "@elliemae/ds-popper": "2.3.0-next.7",
98
- "@elliemae/ds-popperjs": "2.3.0-next.7",
99
- "@elliemae/ds-portal": "2.3.0-next.7",
100
- "@elliemae/ds-props-helpers": "2.3.0-next.7",
101
- "@elliemae/ds-shared": "2.3.0-next.7",
102
- "@elliemae/ds-system": "2.3.0-next.7",
103
- "@elliemae/ds-utilities": "2.3.0-next.7",
107
+ "@elliemae/ds-button": "2.3.0-rc.2",
108
+ "@elliemae/ds-classnames": "2.3.0-rc.2",
109
+ "@elliemae/ds-popper": "2.3.0-rc.2",
110
+ "@elliemae/ds-popperjs": "2.3.0-rc.2",
111
+ "@elliemae/ds-portal": "2.3.0-rc.2",
112
+ "@elliemae/ds-props-helpers": "2.3.0-rc.2",
113
+ "@elliemae/ds-shared": "2.3.0-rc.2",
114
+ "@elliemae/ds-system": "2.3.0-rc.2",
115
+ "@elliemae/ds-utilities": "2.3.0-rc.2",
104
116
  "@popperjs/core": "~2.9.2",
105
117
  "react-desc": "~4.1.3",
106
118
  "react-popper": "~2.2.5"
@@ -0,0 +1,61 @@
1
+ /// <reference path="../../../../../shared/typings/react-desc.d.ts" />
2
+ /// <reference types="react" />
3
+ import type { DSTooltipV3T } from './propTypes';
4
+ declare const DSTooltipV3: {
5
+ (props: DSTooltipV3T.Props): JSX.Element;
6
+ propTypes: {
7
+ text: import("react-desc").PropTypesDescValue;
8
+ textAlign: {
9
+ deprecated: import("react-desc").PropTypesDescValidator;
10
+ };
11
+ wrapWords: {
12
+ deprecated: import("react-desc").PropTypesDescValidator;
13
+ };
14
+ children: import("react-desc").PropTypesDescValue;
15
+ withoutPortal: {
16
+ deprecated: import("react-desc").PropTypesDescValidator;
17
+ };
18
+ withoutArrow: {
19
+ deprecated: import("react-desc").PropTypesDescValidator;
20
+ };
21
+ boundaryElement: {
22
+ deprecated: import("react-desc").PropTypesDescValidator;
23
+ };
24
+ withoutAnimation: {
25
+ deprecated: import("react-desc").PropTypesDescValidator;
26
+ };
27
+ animationDuration: {
28
+ deprecated: import("react-desc").PropTypesDescValidator;
29
+ };
30
+ portalDOMContainer: {
31
+ deprecated: import("react-desc").PropTypesDescValidator;
32
+ };
33
+ startPlacementPreference: {
34
+ deprecated: import("react-desc").PropTypesDescValidator;
35
+ };
36
+ placementOrderPreference: {
37
+ deprecated: import("react-desc").PropTypesDescValidator;
38
+ };
39
+ zIndex: {
40
+ deprecated: import("react-desc").PropTypesDescValidator;
41
+ };
42
+ customOffset: {
43
+ deprecated: import("react-desc").PropTypesDescValidator;
44
+ };
45
+ modifiers: {
46
+ deprecated: import("react-desc").PropTypesDescValidator;
47
+ };
48
+ id: {
49
+ deprecated: import("react-desc").PropTypesDescValidator;
50
+ };
51
+ onOpen: {
52
+ deprecated: import("react-desc").PropTypesDescValidator;
53
+ };
54
+ onClose: {
55
+ deprecated: import("react-desc").PropTypesDescValidator;
56
+ };
57
+ };
58
+ };
59
+ declare const DSTooltipV3WithSchema: import("@elliemae/ds-props-helpers/types/propTypes/types").DocumentedReactComponent<DSTooltipV3T.Props>;
60
+ export { DSTooltipV3, DSTooltipV3WithSchema };
61
+ export default DSTooltipV3;
@@ -0,0 +1,2 @@
1
+ export declare const PLACEMENT: readonly ["top-start", "top", "top-end", "right-start", "right", "right-end", "bottom-end", "bottom", "bottom-start", "left-end", "left", "left-start"];
2
+ export declare const TEXT_ALIGNMENT: readonly ["left", "right", "center", "justify", "initial", "inherit"];
@@ -0,0 +1,2 @@
1
+ import type { DSTooltipV3T } from './propTypes';
2
+ export declare const defaultProps: DSTooltipV3T.DefaultProps;
@@ -1,6 +1,2 @@
1
- import React from 'react';
2
- import type { TooltipV3PropsT } from './index.d';
3
- declare const DSTooltipV3: React.ComponentType<TooltipV3PropsT>;
4
- declare const DSTooltipV3WithSchema: any;
5
- export { DSTooltipV3, DSTooltipV3WithSchema };
6
- export default DSTooltipV3;
1
+ export * from './DSTooltipV3';
2
+ export * from './TooltipV3DatatestId';
@@ -1,102 +1,86 @@
1
1
  /// <reference path="../../../../../shared/typings/react-desc.d.ts" />
2
- export declare const dsTooltipPropTypes: {
3
- /**
4
- * Tooltip text to be displayed on hover/focus
5
- */
2
+ /// <reference types="react" />
3
+ import { PLACEMENT, TEXT_ALIGNMENT } from './constants';
4
+ export declare namespace DSTooltipV3T {
5
+ type Placement = typeof PLACEMENT[number];
6
+ type TextAlignment = typeof TEXT_ALIGNMENT[number];
7
+ interface DefaultProps {
8
+ onOpen: () => void;
9
+ onClose: () => void;
10
+ id: string;
11
+ textAlign: TextAlignment;
12
+ wrapWords: boolean;
13
+ }
14
+ interface PropsOptional {
15
+ zIndex?: number;
16
+ withoutPortal?: boolean;
17
+ withoutArrow?: boolean;
18
+ withoutAnimation?: boolean;
19
+ boundaryElement?: React.ReactNode;
20
+ animationDuraction?: number;
21
+ portalDOMContainer?: React.ReactNode;
22
+ startPlacementPreference?: Placement;
23
+ placementOrderPreference?: Placement;
24
+ customOffset?: [number, number];
25
+ modifiers?: Record<string, unknown>[];
26
+ }
27
+ interface PropsRequired {
28
+ children: React.ReactNode;
29
+ text: string;
30
+ }
31
+ interface Props extends Partial<DefaultProps>, PropsRequired, PropsOptional {
32
+ }
33
+ interface InternalProps extends DefaultProps, PropsRequired, PropsOptional {
34
+ }
35
+ }
36
+ export declare const propTypes: {
6
37
  text: import("react-desc").PropTypesDescValue;
7
- /**
8
- * Tooltip text alignment
9
- */
10
38
  textAlign: {
11
39
  deprecated: import("react-desc").PropTypesDescValidator;
12
40
  };
13
- /**
14
- * Element to tie the tooltip to, must be a single node
15
- */
41
+ wrapWords: {
42
+ deprecated: import("react-desc").PropTypesDescValidator;
43
+ };
16
44
  children: import("react-desc").PropTypesDescValue;
17
- /**
18
- * Wheter or not the tooltip content should appear in a DOM portal or not
19
- */
20
45
  withoutPortal: {
21
46
  deprecated: import("react-desc").PropTypesDescValidator;
22
47
  };
23
- /**
24
- * Wheter or not the tooltip should use the arrow
25
- */
26
48
  withoutArrow: {
27
49
  deprecated: import("react-desc").PropTypesDescValidator;
28
50
  };
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
51
  boundaryElement: {
34
52
  deprecated: import("react-desc").PropTypesDescValidator;
35
53
  };
36
- /**
37
- * Whether or not the popper context menu should be animated
38
- */
39
54
  withoutAnimation: {
40
55
  deprecated: import("react-desc").PropTypesDescValidator;
41
56
  };
42
- /**
43
- * Popper context menus Animation duration in ms
44
- */
45
57
  animationDuration: {
46
58
  deprecated: import("react-desc").PropTypesDescValidator;
47
59
  };
48
- /**
49
- * When using portal, the container in which to append the DOM content, defaults to document body
50
- */
51
60
  portalDOMContainer: {
52
61
  deprecated: import("react-desc").PropTypesDescValidator;
53
62
  };
54
- /**
55
- * start placement preferences, as per popperjs placement option
56
- */
57
63
  startPlacementPreference: {
58
64
  deprecated: import("react-desc").PropTypesDescValidator;
59
65
  };
60
- /**
61
- * Array of placement preferences, as per popperjs "flip" placement option
62
- */
63
66
  placementOrderPreference: {
64
67
  deprecated: import("react-desc").PropTypesDescValidator;
65
68
  };
66
- /**
67
- * tooltip wrapper z-index
68
- */
69
69
  zIndex: {
70
70
  deprecated: import("react-desc").PropTypesDescValidator;
71
71
  };
72
- /**
73
- * placement offset array
74
- */
75
72
  customOffset: {
76
73
  deprecated: import("react-desc").PropTypesDescValidator;
77
74
  };
78
- /**
79
- * modifiers array for full-custom tooltip-js override
80
- * https://tooltip.js.org/docs/v2/modifiers/
81
- */
82
75
  modifiers: {
83
76
  deprecated: import("react-desc").PropTypesDescValidator;
84
77
  };
85
- /**
86
- * Optional id appended to data-testid
87
- */
88
78
  id: {
89
79
  deprecated: import("react-desc").PropTypesDescValidator;
90
80
  };
91
- /**
92
- * Optional callback to be invoked when the tooltip opens
93
- */
94
81
  onOpen: {
95
82
  deprecated: import("react-desc").PropTypesDescValidator;
96
83
  };
97
- /**
98
- * 'Optional callback to be invoked when the tooltip closes
99
- */
100
84
  onClose: {
101
85
  deprecated: import("react-desc").PropTypesDescValidator;
102
86
  };
@@ -1,6 +1,10 @@
1
+ import type { DSTooltipV3T } from './propTypes';
2
+ interface StyledTooltipTextT {
3
+ wrapWords: boolean;
4
+ textAlign: DSTooltipV3T.TextAlignment;
5
+ }
1
6
  export declare const StyledTooltipContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
2
- export declare const StyledTooltipText: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
3
- textAlign: string;
4
- }, never>;
7
+ export declare const StyledTooltipText: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledTooltipTextT, never>;
5
8
  export declare const StyledMouseOverDetectionBox: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
6
9
  export declare const StyledTriggerWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
10
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare const useGlobalKeyboardListener: (func: ({ key }: {
2
+ key: string;
3
+ }) => void) => void;
@@ -1,18 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var dsPropsHelpers = require('@elliemae/ds-props-helpers');
6
-
7
- // eslint-disable-next-line @typescript-eslint/no-empty-function
8
- const noop = () => {};
9
-
10
- const defaultProps = {
11
- onOpen: noop,
12
- onClose: noop,
13
- id: '',
14
- textAlign: 'left'
15
- };
16
- const useWithDefaultProps = props => dsPropsHelpers.useMemoMergePropsWithDefault(props, defaultProps);
17
-
18
- exports.useWithDefaultProps = useWithDefaultProps;
package/cjs/v3/index.d.js DELETED
@@ -1,2 +0,0 @@
1
- 'use strict';
2
-
@@ -1,96 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var reactDesc = require('react-desc');
6
-
7
- const dsTooltipPropTypes = {
8
- /**
9
- * Tooltip text to be displayed on hover/focus
10
- */
11
- text: reactDesc.PropTypes.string.description('Tooltip text to be displayed on hover/focus').isRequired,
12
-
13
- /**
14
- * Tooltip text alignment
15
- */
16
- textAlign: reactDesc.PropTypes.oneOf(['left', 'right', 'center', 'justify', 'initial', 'inherit']).description('Tooltip text alignment').defaultValue('left'),
17
-
18
- /**
19
- * Element to tie the tooltip to, must be a single node
20
- */
21
- children: reactDesc.PropTypes.node.description('Element to tie the tooltip to, must be a single node').isRequired,
22
-
23
- /**
24
- * Wheter or not the tooltip content should appear in a DOM portal or not
25
- */
26
- withoutPortal: reactDesc.PropTypes.bool.description('Whether or not the tooltip content should appear in a DOM portal or not').defaultValue(true),
27
-
28
- /**
29
- * Wheter or not the tooltip should use the arrow
30
- */
31
- withoutArrow: reactDesc.PropTypes.bool.description('Whether or not the tooltip should use the arrow').defaultValue(false),
32
-
33
- /**
34
- * Bounding element to calculate upon, defaults to it is "clippingParents",
35
- * which are the scrolling containers that may cause the element to be partially or fully cut off.
36
- */
37
- boundaryElement: reactDesc.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),
38
-
39
- /**
40
- * Whether or not the popper context menu should be animated
41
- */
42
- withoutAnimation: reactDesc.PropTypes.bool.description('Whether or not the popper context menu should be animated').defaultValue(false),
43
-
44
- /**
45
- * Popper context menus Animation duration in ms
46
- */
47
- animationDuration: reactDesc.PropTypes.number.description('Popper context menus Animation duration in ms').defaultValue(100),
48
-
49
- /**
50
- * When using portal, the container in which to append the DOM content, defaults to document body
51
- */
52
- portalDOMContainer: reactDesc.PropTypes.element.description('When using portal, the container in which to append the DOM content, defaults to document body').defaultValue(undefined),
53
-
54
- /**
55
- * start placement preferences, as per popperjs placement option
56
- */
57
- startPlacementPreference: reactDesc.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'"),
58
-
59
- /**
60
- * Array of placement preferences, as per popperjs "flip" placement option
61
- */
62
- placementOrderPreference: reactDesc.PropTypes.arrayOf(reactDesc.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']"),
63
-
64
- /**
65
- * tooltip wrapper z-index
66
- */
67
- zIndex: reactDesc.PropTypes.number.description('popperjs content z-index').defaultValue(1),
68
-
69
- /**
70
- * placement offset array
71
- */
72
- customOffset: reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.number).description('placement offset array').defaultValue([0, 14]),
73
-
74
- /**
75
- * modifiers array for full-custom tooltip-js override
76
- * https://tooltip.js.org/docs/v2/modifiers/
77
- */
78
- modifiers: reactDesc.PropTypes.array.description('modifiers array for full-custom tooltip-js override, https://tooltip.js.org/docs/v2/modifiers/').defaultValue(1),
79
-
80
- /**
81
- * Optional id appended to data-testid
82
- */
83
- id: reactDesc.PropTypes.string.description('Optional id appended to data-testid').defaultValue(''),
84
-
85
- /**
86
- * Optional callback to be invoked when the tooltip opens
87
- */
88
- onOpen: reactDesc.PropTypes.func.description('Optional callback to be invoked when the tooltip opens').defaultValue('() => {}'),
89
-
90
- /**
91
- * 'Optional callback to be invoked when the tooltip closes
92
- */
93
- onClose: reactDesc.PropTypes.func.description('Optional callback to be invoked when the tooltip closes').defaultValue('() => {}')
94
- };
95
-
96
- exports.dsTooltipPropTypes = dsTooltipPropTypes;
@@ -1,14 +0,0 @@
1
- import { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';
2
-
3
- // eslint-disable-next-line @typescript-eslint/no-empty-function
4
- const noop = () => {};
5
-
6
- const defaultProps = {
7
- onOpen: noop,
8
- onClose: noop,
9
- id: '',
10
- textAlign: 'left'
11
- };
12
- const useWithDefaultProps = props => useMemoMergePropsWithDefault(props, defaultProps);
13
-
14
- export { useWithDefaultProps };
package/esm/v3/index.d.js DELETED
@@ -1 +0,0 @@
1
-
@@ -1,92 +0,0 @@
1
- import { PropTypes } from 'react-desc';
2
-
3
- const dsTooltipPropTypes = {
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('() => {}')
90
- };
91
-
92
- export { dsTooltipPropTypes };
@@ -1,2 +0,0 @@
1
- import type { TooltipV3PropsT } from '../index.d';
2
- export declare const useWithDefaultProps: (props: Partial<TooltipV3PropsT>) => Partial<TooltipV3PropsT>;