@elliemae/ds-tooltip 1.57.0-rc.1 → 1.57.0-rc.13

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/index.js CHANGED
@@ -12,11 +12,9 @@ require('@babel/runtime/helpers/objectWithoutProperties');
12
12
  require('react');
13
13
  require('react-desc');
14
14
  require('@elliemae/ds-classnames');
15
- require('@elliemae/ds-utilities/getComponentFromProps');
15
+ require('@elliemae/ds-utilities');
16
16
  require('@elliemae/ds-shared/constants');
17
17
  require('@elliemae/ds-popper');
18
- require('@elliemae/ds-popper/interaction');
19
- require('@elliemae/ds-popper/positions');
20
18
  require('./v1/TooltipType.js');
21
19
  require('@babel/runtime/helpers/defineProperty');
22
20
  require('@babel/runtime/helpers/slicedToArray');
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -7,11 +7,9 @@ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProp
7
7
  var React = require('react');
8
8
  var reactDesc = require('react-desc');
9
9
  var dsClassnames = require('@elliemae/ds-classnames');
10
- var getComponentFromProps = require('@elliemae/ds-utilities/getComponentFromProps');
10
+ var dsUtilities = require('@elliemae/ds-utilities');
11
11
  var constants = require('@elliemae/ds-shared/constants');
12
12
  var DSPopper = require('@elliemae/ds-popper');
13
- var interaction = require('@elliemae/ds-popper/interaction');
14
- var positions = require('@elliemae/ds-popper/positions');
15
13
  var v1_TooltipType = require('./TooltipType.js');
16
14
 
17
15
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -19,7 +17,6 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
19
17
  var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
20
18
  var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
21
19
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
22
- var getComponentFromProps__default = /*#__PURE__*/_interopDefaultLegacy(getComponentFromProps);
23
20
  var DSPopper__default = /*#__PURE__*/_interopDefaultLegacy(DSPopper);
24
21
 
25
22
  var _excluded = ["containerProps", "innerRef", "placement", "title", "delayClose", "delayOpen", "interactionType", "triggerComponent", "className", "isOpen", "onOpen", "springAnimationComponent", "tooltipType", "showArrow", "zIndex"];
@@ -87,18 +84,18 @@ var DSTooltip = function DSTooltip(_ref) {
87
84
  placement: placement,
88
85
  showArrow: tooltipType === v1_TooltipType.TooltipType.TOOLTIP ? showArrow : false,
89
86
  springAnimationComponent: springAnimationComponent,
90
- triggerComponent: getComponentFromProps__default['default'](triggerComponent),
87
+ triggerComponent: dsUtilities.getComponentFromProps(triggerComponent),
91
88
  zIndex: zIndex
92
89
  });
93
90
  };
94
91
 
95
92
  var tooltipProps = {
96
93
  containerProps: reactDesc.PropTypes.object.description('Set of Properties attached to the main container'),
97
- placement: reactDesc.PropTypes.oneOf(positions.positions).description('Tooltip position').defaultValue(DSPopper.PopperPositions.TOP),
94
+ placement: reactDesc.PropTypes.oneOf(DSPopper.positions).description('Tooltip position').defaultValue(DSPopper.PopperPositions.TOP),
98
95
  title: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.string, reactDesc.PropTypes.element]).description('Tooltip content').isRequired,
99
96
  delayClose: reactDesc.PropTypes.string.description('Delay to close the tooltip').defaultValue(constants.DEFAULT_DELAY_CLOSE),
100
97
  delayOpen: reactDesc.PropTypes.string.description('Delay to open the tooltip ').defaultValue(constants.DEFAULT_DELAY_OPEN),
101
- interactionType: reactDesc.PropTypes.oneOf(interaction.interactions).description('A type indicating how to open/close the tooltip').defaultValue(DSPopper.PopperInteractions.HOVER),
98
+ interactionType: reactDesc.PropTypes.oneOf(DSPopper.interactions).description('A type indicating how to open/close the tooltip').defaultValue(DSPopper.PopperInteractions.HOVER),
102
99
  triggerComponent: reactDesc.PropTypes.element.description("The component that will open/close the tooltip. \n Cannot be used with disabled elements. \n https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled").isRequired,
103
100
  isOpen: reactDesc.PropTypes.bool.description('Whether the tooltip is visible or not').defaultValue(undefined),
104
101
  onOpen: reactDesc.PropTypes.func.description('Handler when the tooltip opens'),
@@ -1 +1 @@
1
- {"version":3,"file":"DSTooltip.js","sources":["../../../src/v1/DSTooltip.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport React from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport {\n aggregatedClasses,\n convertPropToCssClassName,\n} from '@elliemae/ds-classnames';\nimport getComponentFromProps from '@elliemae/ds-utilities/getComponentFromProps';\nimport {\n DEFAULT_DELAY_OPEN,\n DEFAULT_DELAY_CLOSE,\n} from '@elliemae/ds-shared/constants';\nimport DSPopper, {\n PopperPositions,\n PopperInteractions,\n} from '@elliemae/ds-popper';\nimport { interactions } from '@elliemae/ds-popper/interaction';\nimport { positions } from '@elliemae/ds-popper/positions';\nimport { TooltipType } from './TooltipType';\n\nconst blockName = 'tooltip';\n\nconst TooltipContainer = aggregatedClasses('div')(blockName, false, false, {\n propsToRemoveFromFinalElement: ['isHovered', 'isDragged'],\n});\nconst TooltipText = aggregatedClasses('span')(blockName, 'text', false, {\n propsToRemoveFromFinalElement: ['isHovered', 'isDragged'],\n});\n\nconst DSTooltip = ({\n containerProps = {},\n innerRef,\n placement = PopperPositions.TOP,\n title = '',\n delayClose = DEFAULT_DELAY_CLOSE,\n delayOpen = DEFAULT_DELAY_OPEN,\n interactionType = PopperInteractions.HOVER,\n triggerComponent = null,\n className = '',\n isOpen = undefined,\n onOpen = () => null,\n springAnimationComponent = undefined,\n tooltipType = TooltipType.TOOLTIP,\n showArrow = true,\n zIndex,\n ...otherTooltipProps\n}) => {\n const { cssClassName: tooltipBlockName } = convertPropToCssClassName(\n blockName,\n );\n\n let Content = title;\n if (typeof title === 'string') {\n Content = <TooltipText>{title}</TooltipText>;\n }\n return (\n <DSPopper\n blockName={tooltipBlockName}\n contentComponent={\n <TooltipContainer\n {...containerProps}\n {...otherTooltipProps}\n className={`tooltip-container--${tooltipType} ${className}`}\n innerRef={innerRef}\n >\n {Content}\n </TooltipContainer>\n }\n delayClose={delayClose}\n delayOpen={delayOpen}\n interactionType={interactionType}\n isOpen={isOpen}\n onOpen={onOpen}\n placement={placement}\n showArrow={tooltipType === TooltipType.TOOLTIP ? showArrow : false}\n springAnimationComponent={springAnimationComponent}\n triggerComponent={getComponentFromProps(triggerComponent)}\n zIndex={zIndex}\n />\n );\n};\n\nconst tooltipProps = {\n containerProps: PropTypes.object.description(\n 'Set of Properties attached to the main container',\n ),\n placement: PropTypes.oneOf(positions)\n .description('Tooltip position')\n .defaultValue(PopperPositions.TOP),\n title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).description(\n 'Tooltip content',\n ).isRequired,\n delayClose: PropTypes.string\n .description('Delay to close the tooltip')\n .defaultValue(DEFAULT_DELAY_CLOSE),\n delayOpen: PropTypes.string\n .description('Delay to open the tooltip ')\n .defaultValue(DEFAULT_DELAY_OPEN),\n interactionType: PropTypes.oneOf(interactions)\n .description('A type indicating how to open/close the tooltip')\n .defaultValue(PopperInteractions.HOVER),\n triggerComponent: PropTypes.element.description(\n `The component that will open/close the tooltip. \n Cannot be used with disabled elements. \n https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled`,\n ).isRequired,\n isOpen: PropTypes.bool\n .description('Whether the tooltip is visible or not')\n .defaultValue(undefined),\n onOpen: PropTypes.func.description('Handler when the tooltip opens'),\n springAnimationComponent: PropTypes.element.description(\n 'Spring animation component',\n ),\n showArrow: PropTypes.bool\n .description('Whether to show an arrow or not')\n .defaultValue(true),\n className: PropTypes.string.description('css class'),\n tooltipType: PropTypes.oneOf(['tooltip', 'toolbar'])\n .description('Type of tooltip')\n .defaultValue(TooltipType.TOOLTIP),\n zIndex: PropTypes.number\n .description('z-index value assigned to the tooltip')\n .defaultValue(undefined),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description(\n 'Ref to the tooltip container element',\n ),\n};\n\nDSTooltip.propTypes = tooltipProps;\n\nconst TooltipWithSchema = describe(DSTooltip);\nTooltipWithSchema.propTypes = tooltipProps;\n\nexport { DSTooltip, TooltipContainer, TooltipText, TooltipWithSchema };\nexport default DSTooltip;\n"],"names":["blockName","TooltipContainer","aggregatedClasses","propsToRemoveFromFinalElement","TooltipText","DSTooltip","containerProps","innerRef","placement","PopperPositions","TOP","title","delayClose","DEFAULT_DELAY_CLOSE","delayOpen","DEFAULT_DELAY_OPEN","interactionType","PopperInteractions","HOVER","triggerComponent","className","isOpen","undefined","onOpen","springAnimationComponent","tooltipType","TooltipType","TOOLTIP","showArrow","zIndex","otherTooltipProps","convertPropToCssClassName","tooltipBlockName","cssClassName","Content","React","DSPopper","getComponentFromProps","tooltipProps","PropTypes","object","description","oneOf","positions","defaultValue","oneOfType","string","element","isRequired","interactions","bool","func","number","propTypes","TooltipWithSchema","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,IAAMA,SAAS,GAAG,SAAlB;IAEMC,gBAAgB,GAAGC,8BAAiB,CAAC,KAAD,CAAjB,CAAyBF,SAAzB,EAAoC,KAApC,EAA2C,KAA3C,EAAkD;AACzEG,EAAAA,6BAA6B,EAAE,CAAC,WAAD,EAAc,WAAd;AAD0C,CAAlD;IAGnBC,WAAW,GAAGF,8BAAiB,CAAC,MAAD,CAAjB,CAA0BF,SAA1B,EAAqC,MAArC,EAA6C,KAA7C,EAAoD;AACtEG,EAAAA,6BAA6B,EAAE,CAAC,WAAD,EAAc,WAAd;AADuC,CAApD;;IAIdE,SAAS,GAAG,SAAZA,SAAY,OAiBZ;AAAA,iCAhBJ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ourcesContent":["/* eslint-disable max-lines */\nimport React from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport {\n aggregatedClasses,\n convertPropToCssClassName,\n} from '@elliemae/ds-classnames';\nimport { getComponentFromProps } from '@elliemae/ds-utilities';\nimport {\n DEFAULT_DELAY_OPEN,\n DEFAULT_DELAY_CLOSE,\n} from '@elliemae/ds-shared/constants';\nimport DSPopper, {\n PopperPositions,\n PopperInteractions,\n interactions,\n positions\n} from '@elliemae/ds-popper';\nimport { TooltipType } from './TooltipType';\n\nconst blockName = 'tooltip';\n\nconst TooltipContainer = aggregatedClasses('div')(blockName, false, false, {\n propsToRemoveFromFinalElement: ['isHovered', 'isDragged'],\n});\nconst TooltipText = aggregatedClasses('span')(blockName, 'text', false, {\n propsToRemoveFromFinalElement: ['isHovered', 'isDragged'],\n});\n\nconst DSTooltip = ({\n containerProps = {},\n innerRef,\n placement = PopperPositions.TOP,\n title = '',\n delayClose = DEFAULT_DELAY_CLOSE,\n delayOpen = DEFAULT_DELAY_OPEN,\n interactionType = PopperInteractions.HOVER,\n triggerComponent = null,\n className = '',\n isOpen = undefined,\n onOpen = () => null,\n springAnimationComponent = undefined,\n tooltipType = TooltipType.TOOLTIP,\n showArrow = true,\n zIndex,\n ...otherTooltipProps\n}) => {\n const { cssClassName: tooltipBlockName } = convertPropToCssClassName(\n blockName,\n );\n\n let Content = title;\n if (typeof title === 'string') {\n Content = <TooltipText>{title}</TooltipText>;\n }\n return (\n <DSPopper\n blockName={tooltipBlockName}\n contentComponent={\n <TooltipContainer\n {...containerProps}\n {...otherTooltipProps}\n className={`tooltip-container--${tooltipType} ${className}`}\n innerRef={innerRef}\n >\n {Content}\n </TooltipContainer>\n }\n delayClose={delayClose}\n delayOpen={delayOpen}\n interactionType={interactionType}\n isOpen={isOpen}\n onOpen={onOpen}\n placement={placement}\n showArrow={tooltipType === TooltipType.TOOLTIP ? showArrow : false}\n springAnimationComponent={springAnimationComponent}\n triggerComponent={getComponentFromProps(triggerComponent)}\n zIndex={zIndex}\n />\n );\n};\n\nconst tooltipProps = {\n containerProps: PropTypes.object.description(\n 'Set of Properties attached to the main container',\n ),\n placement: PropTypes.oneOf(positions)\n .description('Tooltip position')\n .defaultValue(PopperPositions.TOP),\n title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).description(\n 'Tooltip content',\n ).isRequired,\n delayClose: PropTypes.string\n .description('Delay to close the tooltip')\n .defaultValue(DEFAULT_DELAY_CLOSE),\n delayOpen: PropTypes.string\n .description('Delay to open the tooltip ')\n .defaultValue(DEFAULT_DELAY_OPEN),\n interactionType: PropTypes.oneOf(interactions)\n .description('A type indicating how to open/close the tooltip')\n .defaultValue(PopperInteractions.HOVER),\n triggerComponent: PropTypes.element.description(\n `The component that will open/close the tooltip. \n Cannot be used with disabled elements. \n https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled`,\n ).isRequired,\n isOpen: PropTypes.bool\n .description('Whether the tooltip is visible or not')\n .defaultValue(undefined),\n onOpen: PropTypes.func.description('Handler when the tooltip opens'),\n springAnimationComponent: PropTypes.element.description(\n 'Spring animation component',\n ),\n showArrow: PropTypes.bool\n .description('Whether to show an arrow or not')\n .defaultValue(true),\n className: PropTypes.string.description('css class'),\n tooltipType: PropTypes.oneOf(['tooltip', 'toolbar'])\n .description('Type of tooltip')\n .defaultValue(TooltipType.TOOLTIP),\n zIndex: PropTypes.number\n .description('z-index value assigned to the tooltip')\n .defaultValue(undefined),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description(\n 'Ref to the tooltip container element',\n ),\n};\n\nDSTooltip.propTypes = tooltipProps;\n\nconst TooltipWithSchema = describe(DSTooltip);\nTooltipWithSchema.propTypes = tooltipProps;\n\nexport { DSTooltip, TooltipContainer, TooltipText, TooltipWithSchema };\nexport default DSTooltip;\n"],"names":["blockName","TooltipContainer","aggregatedClasses","propsToRemoveFromFinalElement","TooltipText","DSTooltip","containerProps","innerRef","placement","PopperPositions","TOP","title","delayClose","DEFAULT_DELAY_CLOSE","delayOpen","DEFAULT_DELAY_OPEN","interactionType","PopperInteractions","HOVER","triggerComponent","className","isOpen","undefined","onOpen","springAnimationComponent","tooltipType","TooltipType","TOOLTIP","showArrow","zIndex","otherTooltipProps","convertPropToCssClassName","tooltipBlockName","cssClassName","Content","React","DSPopper","getComponentFromProps","tooltipProps","PropTypes","object","description","oneOf","positions","defaultValue","oneOfType","string","element","isRequired","interactions","bool","func","number","propTypes","TooltipWithSchema","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAoBA,IAAMA,SAAS,GAAG,SAAlB;IAEMC,gBAAgB,GAAGC,8BAAiB,CAAC,KAAD,CAAjB,CAAyBF,SAAzB,EAAoC,KAApC,EAA2C,KAA3C,EAAkD;AACzEG,EAAAA,6BAA6B,EAAE,CAAC,WAAD,EAAc,WAAd;AAD0C,CAAlD;IAGnBC,WAAW,GAAGF,8BAAiB,CAAC,MAAD,CAAjB,CAA0BF,SAA1B,EAAqC,MAArC,EAA6C,KAA7C,EAAoD;AACtEG,EAAAA,6BAA6B,EAAE,CAAC,WAAD,EAAc,WAAd;AADuC,CAApD;;IAIdE,SAAS,GAAG,SAAZA,SAAY,OAiBZ;AAAA,iCAhBJC,cAgBI;AAAA,MAhBJA,cAgBI,oCAhBa,EAgBb;AAAA,MAfJC,QAeI,QAfJA,QAeI;AAAA,4BAdJC,SAcI;AAAA,MAdJA,SAcI,+BAdQC,wBAAe,CAACC,GAcxB;AAAA,wBAbJC,KAaI;AAAA,MAbJA,KAaI,2BAbI,EAaJ;AAAA,6BAZJC,UAYI;AAAA,MAZJA,UAYI,gCAZSC,6BAYT;AAAA,4BAXJC,SAWI;AAAA,MAXJA,SAWI,+BAXQC,4BAWR;AAAA,kCAVJC,eAUI;AAAA,MAVJA,eAUI,qCAVcC,2BAAkB,CAACC,KAUjC;AAAA,mCATJC,gBASI;AAAA,MATJA,gBASI,sCATe,IASf;AAAA,4BARJC,SAQI;AAAA,MARJA,SAQI,+BARQ,EAQR;A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AFQ,CAEK,IAFL,CA/BQ;AAkCnBxB,EAAAA,SAAS,EAAEmB,mBAAS,CAACO,MAAV,CAAiBL,WAAjB,CAA6B,WAA7B,CAlCQ;AAmCnBhB,EAAAA,WAAW,EAAEc,mBAAS,CAACG,KAAV,CAAgB,CAAC,SAAD,EAAY,SAAZ,CAAhB,EACVD,WADU,CACE,iBADF,EAEVG,YAFU,CAEGlB,0BAAW,CAACC,OAFf,CAnCM;AAsCnBE,EAAAA,MAAM,EAAEU,mBAAS,CAACa,MAAV,CACLX,WADK,CACO,uCADP,EAELG,YAFK,CAEQtB,SAFR,CAtCW;AAyCnBf,EAAAA,QAAQ,EAAEgC,mBAAS,CAACM,SAAV,CAAoB,CAACN,mBAAS,CAACY,IAAX,EAAiBZ,mBAAS,CAACC,MAA3B,CAApB,EAAwDC,WAAxD,CACR,sCADQ;AAzCS,CAArB;AA8CApC,SAAS,CAACgD,SAAV,GAAsBf,YAAtB;IAEMgB,iBAAiB,GAAGC,kBAAQ,CAAClD,SAAD;AAClCiD,iBAAiB,CAACD,SAAlB,GAA8Bf,YAA9B;;;;;;;;"}
@@ -10,7 +10,8 @@ var noop = function noop() {};
10
10
  var defaultProps = {
11
11
  onOpen: noop,
12
12
  onClose: noop,
13
- id: ''
13
+ id: '',
14
+ textAlign: 'left'
14
15
  };
15
16
  var useWithDefaultProps = function useWithDefaultProps(props) {
16
17
  return dsPropsHelpers.useMemoMergePropsWithDefault(props, defaultProps);
@@ -1 +1 @@
1
- {"version":3,"file":"useWithDefaultProps.js","sources":["../../../../src/v3/config/useWithDefaultProps.ts"],"sourcesContent":["import { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport type { TooltipV3PropsT } from '../index.d';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = () => {};\n\nconst defaultProps = {\n onOpen: noop,\n onClose: noop,\n id: '',\n};\n\nexport const useWithDefaultProps = (props: Partial<TooltipV3PropsT>): Partial<TooltipV3PropsT> =>\n useMemoMergePropsWithDefault(props, defaultProps);\n"],"names":["noop","defaultProps","onOpen","onClose","id","useWithDefaultProps","props","useMemoMergePropsWithDefault"],"mappings":";;;;;;AAGA;AACA,IAAMA,IAAI,GAAG,SAAPA,IAAO,GAAM,EAAnB;;AAEA,IAAMC,YAAY,GAAG;AACnBC,EAAAA,MAAM,EAAEF,IADW;AAEnBG,EAAAA,OAAO,EAAEH,IAFU;AAGnBI,EAAAA,EAAE,EAAE;AAHe,CAArB;IAMaC,mBAAmB,GAAG,SAAtBA,mBAAsB,CAACC,KAAD;AAAA,SACjCC,2CAA4B,CAACD,KAAD,EAAQL,YAAR,CADK;AAAA;;;;"}
1
+ {"version":3,"file":"useWithDefaultProps.js","sources":["../../../../src/v3/config/useWithDefaultProps.ts"],"sourcesContent":["import { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport type { TooltipV3PropsT } from '../index.d';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = () => {};\n\nconst defaultProps = {\n onOpen: noop,\n onClose: noop,\n id: '',\n textAlign: 'left',\n};\n\nexport const useWithDefaultProps = (props: Partial<TooltipV3PropsT>): Partial<TooltipV3PropsT> =>\n useMemoMergePropsWithDefault(props, defaultProps);\n"],"names":["noop","defaultProps","onOpen","onClose","id","textAlign","useWithDefaultProps","props","useMemoMergePropsWithDefault"],"mappings":";;;;;;AAGA;AACA,IAAMA,IAAI,GAAG,SAAPA,IAAO,GAAM,EAAnB;;AAEA,IAAMC,YAAY,GAAG;AACnBC,EAAAA,MAAM,EAAEF,IADW;AAEnBG,EAAAA,OAAO,EAAEH,IAFU;AAGnBI,EAAAA,EAAE,EAAE,EAHe;AAInBC,EAAAA,SAAS,EAAE;AAJQ,CAArB;IAOaC,mBAAmB,GAAG,SAAtBA,mBAAsB,CAACC,KAAD;AAAA,SACjCC,2CAA4B,CAACD,KAAD,EAAQN,YAAR,CADK;AAAA;;;;"}
package/cjs/v3/index.js CHANGED
@@ -22,7 +22,16 @@ var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray)
22
22
  var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
23
23
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
24
24
 
25
- var _excluded = ["text", "children", "onOpen", "onClose", "id"];
25
+ var _excluded = ["text", "children", "onOpen", "onClose", "id", "textAlign"];
26
+
27
+ var useGlobalKeyboardListener = function useGlobalKeyboardListener(func) {
28
+ React.useEffect(function () {
29
+ document.addEventListener('keydown', func);
30
+ return function () {
31
+ return document.removeEventListener('keydown', func);
32
+ };
33
+ }, [func]);
34
+ };
26
35
 
27
36
  var DSTooltipV3 = function DSTooltipV3(props) {
28
37
  var _useWithDefaultProps = v3_config_useWithDefaultProps.useWithDefaultProps(props),
@@ -31,17 +40,33 @@ var DSTooltipV3 = function DSTooltipV3(props) {
31
40
  onOpen = _useWithDefaultProps.onOpen,
32
41
  onClose = _useWithDefaultProps.onClose,
33
42
  id = _useWithDefaultProps.id,
43
+ textAlign = _useWithDefaultProps.textAlign,
34
44
  extraPopperJsProps = _objectWithoutProperties__default['default'](_useWithDefaultProps, _excluded);
35
45
 
36
- var _useState = React.useState(),
46
+ var _useState = React.useState(false),
37
47
  _useState2 = _slicedToArray__default['default'](_useState, 2),
38
- referenceElement = _useState2[0],
39
- setReferenceElement = _useState2[1];
48
+ isFocused = _useState2[0],
49
+ setIsFocused = _useState2[1];
40
50
 
41
51
  var _useState3 = React.useState(false),
42
52
  _useState4 = _slicedToArray__default['default'](_useState3, 2),
43
- showPopover = _useState4[0],
44
- setShowPopover = _useState4[1];
53
+ isHover = _useState4[0],
54
+ setIsHover = _useState4[1];
55
+
56
+ var _useState5 = React.useState(''),
57
+ _useState6 = _slicedToArray__default['default'](_useState5, 2),
58
+ latestOpenInteraction = _useState6[0],
59
+ setLatestOpenInteraction = _useState6[1];
60
+
61
+ var _useState7 = React.useState(),
62
+ _useState8 = _slicedToArray__default['default'](_useState7, 2),
63
+ referenceElement = _useState8[0],
64
+ setReferenceElement = _useState8[1];
65
+
66
+ var _useState9 = React.useState(false),
67
+ _useState10 = _slicedToArray__default['default'](_useState9, 2),
68
+ showPopover = _useState10[0],
69
+ setShowPopover = _useState10[1];
45
70
 
46
71
  var showTooltip = React.useCallback(function () {
47
72
  setShowPopover(true);
@@ -51,24 +76,52 @@ var DSTooltipV3 = function DSTooltipV3(props) {
51
76
  setShowPopover(false);
52
77
  onClose();
53
78
  }, [onClose]);
79
+ var onFocus = React.useCallback(function () {
80
+ setIsFocused(true);
81
+
82
+ if (!showPopover) {
83
+ showTooltip();
84
+ setLatestOpenInteraction('onFocus');
85
+ }
86
+ }, [showPopover, showTooltip]);
87
+ var onBlur = React.useCallback(function () {
88
+ setIsFocused(false);
89
+ if (!isHover || latestOpenInteraction === 'onFocus') hideTooltip();
90
+ }, [hideTooltip, isHover, latestOpenInteraction]);
91
+ var onMouseEnter = React.useCallback(function () {
92
+ setIsHover(true);
93
+
94
+ if (!showPopover) {
95
+ showTooltip();
96
+ setLatestOpenInteraction('onMouseEnter');
97
+ }
98
+ }, [showPopover, showTooltip]);
99
+ var onMouseLeave = React.useCallback(function () {
100
+ setIsHover(false);
101
+ if (!isFocused || latestOpenInteraction === 'onMouseEnter') hideTooltip();
102
+ }, [hideTooltip, isFocused, latestOpenInteraction]);
54
103
  var handleEscKey = React.useCallback(function (_ref) {
55
104
  var key = _ref.key;
56
105
  if (key === 'Escape') hideTooltip();
57
106
  }, [hideTooltip]);
58
- return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(dsPopperjs.DSPopperJS, _extends__default['default']({
107
+ useGlobalKeyboardListener(handleEscKey);
108
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("span", {
109
+ onMouseEnter: onMouseEnter,
110
+ onMouseLeave: onMouseLeave,
111
+ onFocus: onFocus,
112
+ onBlur: onBlur
113
+ }, /*#__PURE__*/React__default['default'].createElement(dsPopperjs.DSPopperJS, _extends__default['default']({
59
114
  referenceElement: referenceElement,
60
- showPopover: showPopover
115
+ showPopover: showPopover,
116
+ withoutPortal: true
61
117
  }, extraPopperJsProps), /*#__PURE__*/React__default['default'].createElement("div", {
62
118
  "data-testid": "".concat(v3_TooltipV3DatatestId.TooltipV3DatatestId.TOOLTIP_TEXT_WRAPPER).concat(id !== '' ? "_".concat(id) : '')
63
- }, /*#__PURE__*/React__default['default'].createElement(v3_styleds.StyledTooltipContainer, null, /*#__PURE__*/React__default['default'].createElement(v3_styleds.StyledTooltipText, null, text)))), /*#__PURE__*/React__default['default'].createElement("div", {
64
- onMouseOver: showTooltip,
65
- onFocus: showTooltip,
66
- onMouseOut: hideTooltip,
67
- onBlur: hideTooltip,
68
- onKeyDown: handleEscKey,
119
+ }, /*#__PURE__*/React__default['default'].createElement(v3_styleds.StyledTooltipContainer, null, /*#__PURE__*/React__default['default'].createElement(v3_styleds.StyledTooltipText, {
120
+ textAlign: textAlign
121
+ }, text), /*#__PURE__*/React__default['default'].createElement(v3_styleds.StyledMouseOverDetectionBox, null)))), /*#__PURE__*/React__default['default'].createElement(v3_styleds.StyledTriggerWrapper, {
69
122
  ref: setReferenceElement,
70
123
  "data-testid": "".concat(v3_TooltipV3DatatestId.TooltipV3DatatestId.TRIGGER_WRAPPER).concat(id !== '' ? "_".concat(id) : '')
71
- }, children));
124
+ }, children)));
72
125
  };
73
126
 
74
127
  DSTooltipV3.propTypes = v3_propsTypes.dsTooltipPropTypes;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/v3/index.tsx"],"sourcesContent":["import React, { useState, useCallback } from 'react';\nimport { DSPopperJS } from '@elliemae/ds-popperjs';\nimport { describe } from 'react-desc';\n\nimport { dsTooltipPropTypes } from './propsTypes';\nimport { useWithDefaultProps } from './config/useWithDefaultProps';\nimport { TooltipV3DatatestId } from './TooltipV3DatatestId';\nimport { StyledTooltipContainer, StyledTooltipText } from './styleds';\nimport type { TooltipV3PropsT } from './index.d';\n\nconst DSTooltipV3: React.ComponentType<TooltipV3PropsT> = (props) => {\n const { text, children, onOpen, onClose, id, ...extraPopperJsProps } = useWithDefaultProps(props);\n\n const [referenceElement, setReferenceElement] = useState<HTMLDivElement>();\n const [showPopover, setShowPopover] = useState(false);\n const showTooltip = useCallback(() => {\n setShowPopover(true);\n onOpen();\n }, [onOpen]);\n const hideTooltip = useCallback(() => {\n setShowPopover(false);\n onClose();\n }, [onClose]);\n const handleEscKey = useCallback(\n ({ key }) => {\n if (key === 'Escape') hideTooltip();\n },\n [hideTooltip],\n );\n\n return (\n <>\n <DSPopperJS referenceElement={referenceElement} showPopover={showPopover} {...extraPopperJsProps}>\n <div data-testid={`${TooltipV3DatatestId.TOOLTIP_TEXT_WRAPPER}${id !== '' ? `_${id}` : ''}`}>\n <StyledTooltipContainer>\n <StyledTooltipText>{text}</StyledTooltipText>\n </StyledTooltipContainer>\n </div>\n </DSPopperJS>\n {/* The <div> element is catching the \"ESC\" key to close the tooltip, there is no valid aria role for this */}\n {/* eslint-disable-next-line max-len */}\n {/* https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md#case-the-event-handler-is-only-being-used-to-capture-bubbled-events */}\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}\n <div\n onMouseOver={showTooltip}\n onFocus={showTooltip}\n onMouseOut={hideTooltip}\n onBlur={hideTooltip}\n onKeyDown={handleEscKey}\n ref={setReferenceElement}\n data-testid={`${TooltipV3DatatestId.TRIGGER_WRAPPER}${id !== '' ? `_${id}` : ''}`}\n >\n {children}\n </div>\n </>\n );\n};\n\nDSTooltipV3.propTypes = dsTooltipPropTypes;\n\nconst DSTooltipV3WithSchema = describe(DSTooltipV3).description('A tooltip component');\nDSTooltipV3WithSchema.propTypes = dsTooltipPropTypes;\n\nexport { DSTooltipV3, DSTooltipV3WithSchema };\nexport default DSTooltipV3;\n"],"names":["DSTooltipV3","props","useWithDefaultProps","text","children","onOpen","onClose","id","extraPopperJsProps","useState","referenceElement","setReferenceElement","showPopover","setShowPopover","showTooltip","useCallback","hideTooltip","handleEscKey","key","React","DSPopperJS","TooltipV3DatatestId","TOOLTIP_TEXT_WRAPPER","StyledTooltipContainer","StyledTooltipText","TRIGGER_WRAPPER","propTypes","dsTooltipPropTypes","DSTooltipV3WithSchema","describe","description"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;IAUMA,WAAiD,GAAG,SAApDA,WAAoD,CAACC,KAAD,EAAW;AACnE,6BAAuEC,iDAAmB,CAACD,KAAD,CAA1F;AAAA,MAAQE,IAAR,wBAAQA,IAAR;AAAA,MAAcC,QAAd,wBAAcA,QAAd;AAAA,MAAwBC,MAAxB,wBAAwBA,MAAxB;AAAA,MAAgCC,OAAhC,wBAAgCA,OAAhC;AAAA,MAAyCC,EAAzC,wBAAyCA,EAAzC;AAAA,MAAgDC,kBAAhD;;AAEA,kBAAgDC,cAAQ,EAAxD;AAAA;AAAA,MAAOC,gBAAP;AAAA,MAAyBC,mBAAzB;;AACA,mBAAsCF,cAAQ,CAAC,KAAD,CAA9C;AAAA;AAAA,MAAOG,WAAP;AAAA,MAAoBC,cAApB;;AACA,MAAMC,WAAW,GAAGC,iBAAW,CAAC,YAAM;AACpCF,IAAAA,cAAc,CAAC,IAAD,CAAd;AACAR,IAAAA,MAAM;AACP,GAH8B,EAG5B,CAACA,MAAD,CAH4B,CAA/B;AAIA,MAAMW,WAAW,GAAGD,iBAAW,CAAC,YAAM;AACpCF,IAAAA,cAAc,CAAC,KAAD,CAAd;AACAP,IAAAA,OAAO;AACR,GAH8B,EAG5B,CAACA,OAAD,CAH4B,CAA/B;AAIA,MAAMW,YAAY,GAAGF,iBAAW,CAC9B,gBAAa;AAAA,QAAVG,GAAU,QAAVA,GAAU;AACX,QAAIA,GAAG,KAAK,QAAZ,EAAsBF,WAAW;AAClC,GAH6B,EAI9B,CAACA,WAAD,CAJ8B,CAAhC;AAOA,sBACEG,+FACEA,wCAACC,qBAAD;AAAY,IAAA,gBAAgB,EAAEV,gBAA9B;AAAgD,IAAA,WAAW,EAAEE;AAA7D,KAA8EJ,kBAA9E,gBACEW;AAAK,6BAAgBE,0CAAmB,CAACC,oBAApC,SAA2Df,EAAE,KAAK,EAAP,cAAgBA,EAAhB,IAAuB,EAAlF;AAAL,kBACEY,wCAACI,iCAAD,qBACEJ,wCAACK,4BAAD,QAAoBrB,IAApB,CADF,CADF,CADF,CADF,eAYEgB;AACE,IAAA,WAAW,EAAEL,WADf;AAEE,IAAA,OAAO,EAAEA,WAFX;AAGE,IAAA,UAAU,EAAEE,WAHd;AAIE,IAAA,MAAM,EAAEA,WAJV;AAKE,IAAA,SAAS,EAAEC,YALb;AAME,IAAA,GAAG,EAAEN,mBANP;AAOE,6BAAgBU,0CAAmB,CAACI,eAApC,SAAsDlB,EAAE,KAAK,EAAP,cAAgBA,EAAhB,IAAuB,EAA7E;AAPF,KASGH,QATH,CAZF,CADF;AA0BD;;AAEDJ,WAAW,CAAC0B,SAAZ,GAAwBC,gCAAxB;IAEMC,qBAAqB,GAAGC,kBAAQ,CAAC7B,WAAD,CAAR,CAAsB8B,WAAtB,CAAkC,qBAAlC;AAC9BF,qBAAqB,CAACF,SAAtB,GAAkCC,gCAAlC;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/v3/index.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport React, { useState, useCallback, useEffect } from 'react';\nimport { DSPopperJS } from '@elliemae/ds-popperjs';\nimport { describe } from 'react-desc';\n\nimport { dsTooltipPropTypes } from './propsTypes';\nimport { useWithDefaultProps } from './config/useWithDefaultProps';\nimport { TooltipV3DatatestId } from './TooltipV3DatatestId';\nimport {\n StyledTooltipContainer,\n StyledTooltipText,\n StyledMouseOverDetectionBox,\n StyledTriggerWrapper,\n} from './styleds';\nimport type { TooltipV3PropsT } from './index.d';\n\nconst useGlobalKeyboardListener = (func) => {\n useEffect(() => {\n document.addEventListener('keydown', func);\n return () => document.removeEventListener('keydown', func);\n }, [func]);\n};\n\nconst DSTooltipV3: React.ComponentType<TooltipV3PropsT> = (props) => {\n const { text, children, onOpen, onClose, id, textAlign, ...extraPopperJsProps } = useWithDefaultProps(props);\n\n const [isFocused, setIsFocused] = useState(false);\n const [isHover, setIsHover] = useState(false);\n const [latestOpenInteraction, setLatestOpenInteraction] = useState('');\n\n const [referenceElement, setReferenceElement] = useState<HTMLSpanElement>();\n const [showPopover, setShowPopover] = useState(false);\n const showTooltip = useCallback(() => {\n setShowPopover(true);\n onOpen();\n }, [onOpen]);\n const hideTooltip = useCallback(() => {\n setShowPopover(false);\n onClose();\n }, [onClose]);\n\n const onFocus = useCallback(() => {\n setIsFocused(true);\n if (!showPopover) {\n showTooltip();\n setLatestOpenInteraction('onFocus');\n }\n }, [showPopover, showTooltip]);\n const onBlur = useCallback(() => {\n setIsFocused(false);\n if (!isHover || latestOpenInteraction === 'onFocus') hideTooltip();\n }, [hideTooltip, isHover, latestOpenInteraction]);\n\n const onMouseEnter = useCallback(() => {\n setIsHover(true);\n if (!showPopover) {\n showTooltip();\n setLatestOpenInteraction('onMouseEnter');\n }\n }, [showPopover, showTooltip]);\n const onMouseLeave = useCallback(() => {\n setIsHover(false);\n if (!isFocused || latestOpenInteraction === 'onMouseEnter') hideTooltip();\n }, [hideTooltip, isFocused, latestOpenInteraction]);\n\n const handleEscKey = useCallback(\n ({ key }) => {\n if (key === 'Escape') hideTooltip();\n },\n [hideTooltip],\n );\n\n useGlobalKeyboardListener(handleEscKey);\n\n return (\n <>\n {/* The <div> element is catching the \"ESC\" key to close the tooltip, there is no valid aria role for this */}\n {/* eslint-disable-next-line max-len */}\n {/* https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md#case-the-event-handler-is-only-being-used-to-capture-bubbled-events */}\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}\n <span onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave} onFocus={onFocus} onBlur={onBlur}>\n <DSPopperJS referenceElement={referenceElement} showPopover={showPopover} withoutPortal {...extraPopperJsProps}>\n <div data-testid={`${TooltipV3DatatestId.TOOLTIP_TEXT_WRAPPER}${id !== '' ? `_${id}` : ''}`}>\n <StyledTooltipContainer>\n <StyledTooltipText textAlign={textAlign}>{text}</StyledTooltipText>\n <StyledMouseOverDetectionBox />\n </StyledTooltipContainer>\n </div>\n </DSPopperJS>\n <StyledTriggerWrapper\n ref={setReferenceElement}\n data-testid={`${TooltipV3DatatestId.TRIGGER_WRAPPER}${id !== '' ? `_${id}` : ''}`}\n >\n {children}\n </StyledTriggerWrapper>\n </span>\n </>\n );\n};\n\nDSTooltipV3.propTypes = dsTooltipPropTypes;\n\nconst DSTooltipV3WithSchema = describe(DSTooltipV3).description('A tooltip component');\nDSTooltipV3WithSchema.propTypes = dsTooltipPropTypes;\n\nexport { DSTooltipV3, DSTooltipV3WithSchema };\nexport default DSTooltipV3;\n"],"names":["useGlobalKeyboardListener","func","useEffect","document","addEventListener","removeEventListener","DSTooltipV3","props","useWithDefaultProps","text","children","onOpen","onClose","id","textAlign","extraPopperJsProps","useState","isFocused","setIsFocused","isHover","setIsHover","latestOpenInteraction","setLatestOpenInteraction","referenceElement","setReferenceElement","showPopover","setShowPopover","showTooltip","useCallback","hideTooltip","onFocus","onBlur","onMouseEnter","onMouseLeave","handleEscKey","key","React","DSPopperJS","TooltipV3DatatestId","TOOLTIP_TEXT_WRAPPER","StyledTooltipContainer","StyledTooltipText","StyledMouseOverDetectionBox","StyledTriggerWrapper","TRIGGER_WRAPPER","propTypes","dsTooltipPropTypes","DSTooltipV3WithSchema","describe","description"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,IAAMA,yBAAyB,GAAG,SAA5BA,yBAA4B,CAACC,IAAD,EAAU;AAC1CC,EAAAA,eAAS,CAAC,YAAM;AACdC,IAAAA,QAAQ,CAACC,gBAAT,CAA0B,SA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AkC,IAAA,YAAY,EAAEC,YAAhD;AAA8D,IAAA,OAAO,EAAEH,OAAvE;AAAgF,IAAA,MAAM,EAAEC;AAAxF,kBACEK,wCAACC,qBAAD;AAAY,IAAA,gBAAgB,EAAEd,gBAA9B;AAAgD,IAAA,WAAW,EAAEE,WAA7D;AAA0E,IAAA,aAAa;AAAvF,KAA4FV,kBAA5F,gBACEqB;AAAK,6BAAgBE,0CAAmB,CAACC,oBAApC,SAA2D1B,EAAE,KAAK,EAAP,cAAgBA,EAAhB,IAAuB,EAAlF;AAAL,kBACEuB,wCAACI,iCAAD,qBACEJ,wCAACK,4BAAD;AAAmB,IAAA,SAAS,EAAE3B;AAA9B,KAA0CL,IAA1C,CADF,eAEE2B,wCAACM,sCAAD,OAFF,CADF,CADF,CADF,eASEN,wCAACO,+BAAD;AACE,IAAA,GAAG,EAAEnB,mBADP;AAEE,6BAAgBc,0CAAmB,CAACM,eAApC,SAAsD/B,EAAE,KAAK,EAAP,cAAgBA,EAAhB,IAAuB,EAA7E;AAFF,KAIGH,QAJH,CATF,CALF,CADF;AAwBD;;AAEDJ,WAAW,CAACuC,SAAZ,GAAwBC,gCAAxB;IAEMC,qBAAqB,GAAGC,kBAAQ,CAAC1C,WAAD,CAAR,CAAsB2C,WAAtB,CAAkC,qBAAlC;AAC9BF,qBAAqB,CAACF,SAAtB,GAAkCC,gCAAlC;;;;;;"}
@@ -6,9 +6,14 @@ var reactDesc = require('react-desc');
6
6
 
7
7
  var dsTooltipPropTypes = {
8
8
  /**
9
- * Tooltip text to be displayed on hover
9
+ * Tooltip text to be displayed on hover/focus
10
10
  */
11
- text: reactDesc.PropTypes.string.description('Tooltip text to be displayed on hover').isRequired,
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'),
12
17
 
13
18
  /**
14
19
  * Element to tie the tooltip to, must be a single node
@@ -1 +1 @@
1
- {"version":3,"file":"propsTypes.js","sources":["../../../src/v3/propsTypes.tsx"],"sourcesContent":["import { PropTypes } from 'react-desc';\n\nexport const dsTooltipPropTypes = {\n /**\n * Tooltip text to be displayed on hover\n */\n text: PropTypes.string.description('Tooltip text to be displayed on hover').isRequired,\n /**\n * Element to tie the tooltip to, must be a single node\n */\n children: PropTypes.node.description('Element to tie the tooltip to, must be a single node').isRequired,\n /**\n * Wheter or not the tooltip content should appear in a DOM portal or not\n */\n withoutPortal: PropTypes.bool\n .description('Whether or not the tooltip content should appear in a DOM portal or not')\n .defaultValue(true),\n /**\n * Wheter or not the tooltip should use the arrow\n */\n withoutArrow: PropTypes.bool.description('Whether or not the tooltip should use the arrow').defaultValue(false),\n /**\n * Bounding element to calculate upon, defaults to it is \"clippingParents\",\n * which are the scrolling containers that may cause the element to be partially or fully cut off.\n */\n boundaryElement: PropTypes.element\n .description(\n 'Bounding element to calculate upon, defaults to \"clippingParents\",' +\n 'which are the scrolling containers that may cause element to be partially or fully cut off',\n )\n .defaultValue(undefined),\n /**\n * When using portal, the container in which to append the DOM content, defaults to document body\n */\n portalDOMContainer: PropTypes.element\n .description('When using portal, the container in which to append the DOM content, defaults to document body')\n .defaultValue(undefined),\n /**\n * start placement preferences, as per popperjs placement option\n */\n startPlacementPreference: PropTypes.oneOf([\n 'top-start',\n 'top',\n 'top-end',\n 'right-start',\n 'right',\n 'right-end',\n 'bottom-end',\n 'bottom',\n 'bottom-start',\n 'left-end',\n 'left',\n 'left-start',\n ])\n .description('start placement preferences, as per popperjs placement option')\n .defaultValue(\"'top'\"),\n /**\n * Array of placement preferences, as per popperjs \"flip\" placement option\n */\n placementOrderPreference: PropTypes.arrayOf(\n PropTypes.oneOf([\n 'top-start',\n 'top',\n 'top-end',\n 'right-start',\n 'right',\n 'right-end',\n 'bottom-end',\n 'bottom',\n 'bottom-start',\n 'left-end',\n 'left',\n 'left-start',\n ]),\n )\n .description('Array of placement preferences, as per popperjs \"flip\" placement option')\n .defaultValue(\"['top', 'bottom', 'left', 'right']\"),\n /**\n * tooltip wrapper z-index\n */\n zIndex: PropTypes.number.description('popperjs content z-index').defaultValue(1),\n /**\n * placement offset array\n */\n customOffset: PropTypes.arrayOf(PropTypes.number).description('placement offset array').defaultValue([0, 14]),\n /**\n * modifiers array for full-custom tooltip-js override\n * https://tooltip.js.org/docs/v2/modifiers/\n */\n modifiers: PropTypes.array\n .description('modifiers array for full-custom tooltip-js override, https://tooltip.js.org/docs/v2/modifiers/')\n .defaultValue(1),\n /**\n * Optional id appended to data-testid\n */\n id: PropTypes.string.description('Optional id appended to data-testid').defaultValue(''),\n /**\n * Optional callback to be invoked when the tooltip opens\n */\n onOpen: PropTypes.func.description('Optional callback to be invoked when the tooltip opens').defaultValue('() => {}'),\n /**\n * 'Optional callback to be invoked when the tooltip closes\n */\n onClose: PropTypes.func\n .description('Optional callback to be invoked when the tooltip closes')\n .defaultValue('() => {}'),\n};\n"],"names":["dsTooltipPropTypes","text","PropTypes","string","description","isRequired","children","node","withoutPortal","bool","defaultValue","withoutArrow","boundaryElement","element","undefined","portalDOMContainer","startPlacementPreference","oneOf","placementOrderPreference","arrayOf","zIndex","number","customOffset","modifiers","array","id","onOpen","func","onClose"],"mappings":";;;;;;IAEaA,kBAAkB,GAAG;AAChC;AACF;AACA;AACEC,EAAAA,IAAI,EAAEC,mBAAS,CAACC,MAAV,CAAiBC,WAAjB,CAA6B,uCAA7B,EAAsEC,UAJ5C;;AAKhC;AACF;AACA;AACEC,EAAAA,QAAQ,EAAEJ,mBAAS,CAACK,IAAV,CAAeH,WAAf,CAA2B,sDAA3B,EAAmFC,UAR7D;;AAShC;AACF;AACA;AACEG,EAAAA,aAAa,EAAEN,mBAAS,CAACO,IAAV,CACZL,WADY,CACA,yEADA,EAEZM,YAFY,CAEC,IAFD,CAZiB;;AAehC;AACF;AACA;AACEC,EAAAA,YAAY,EAAET,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AAgD,wBAAhD,EAA0EM,YAA1E,CAAuF,CAAC,CAAD,EAAI,EAAJ,CAAvF,CAlFkB;;AAmFhC;AACF;AACA;AACA;AACEa,EAAAA,SAAS,EAAErB,mBAAS,CAACsB,KAAV,CACRpB,WADQ,CACI,gGADJ,EAERM,YAFQ,CAEK,CAFL,CAvFqB;;AA0FhC;AACF;AACA;AACEe,EAAAA,EAAE,EAAEvB,mBAAS,CAACC,MAAV,CAAiBC,WAAjB,CAA6B,qCAA7B,EAAoEM,YAApE,CAAiF,EAAjF,CA7F4B;;AA8FhC;AACF;AACA;AACEgB,EAAAA,MAAM,EAAExB,mBAAS,CAACyB,IAAV,CAAevB,WAAf,CAA2B,wDAA3B,EAAqFM,YAArF,CAAkG,UAAlG,CAjGwB;;AAkGhC;AACF;AACA;AACEkB,EAAAA,OAAO,EAAE1B,mBAAS,CAACyB,IAAV,CACNvB,WADM,CACM,yDADN,EAENM,YAFM,CAEO,UAFP;AArGuB;;;;"}
1
+ {"version":3,"file":"propsTypes.js","sources":["../../../src/v3/propsTypes.tsx"],"sourcesContent":["import { PropTypes } from 'react-desc';\n\nexport const dsTooltipPropTypes = {\n /**\n * Tooltip text to be displayed on hover/focus\n */\n text: PropTypes.string.description('Tooltip text to be displayed on hover/focus').isRequired,\n /**\n * Tooltip text alignment\n */\n textAlign: PropTypes.oneOf(['left', 'right', 'center', 'justify', 'initial', 'inherit'])\n .description('Tooltip text alignment')\n .defaultValue('left'),\n /**\n * Element to tie the tooltip to, must be a single node\n */\n children: PropTypes.node.description('Element to tie the tooltip to, must be a single node').isRequired,\n /**\n * Wheter or not the tooltip content should appear in a DOM portal or not\n */\n withoutPortal: PropTypes.bool\n .description('Whether or not the tooltip content should appear in a DOM portal or not')\n .defaultValue(true),\n /**\n * Wheter or not the tooltip should use the arrow\n */\n withoutArrow: PropTypes.bool.description('Whether or not the tooltip should use the arrow').defaultValue(false),\n /**\n * Bounding element to calculate upon, defaults to it is \"clippingParents\",\n * which are the scrolling containers that may cause the element to be partially or fully cut off.\n */\n boundaryElement: PropTypes.element\n .description(\n 'Bounding element to calculate upon, defaults to \"clippingParents\",' +\n 'which are the scrolling containers that may cause element to be partially or fully cut off',\n )\n .defaultValue(undefined),\n /**\n * When using portal, the container in which to append the DOM content, defaults to document body\n */\n portalDOMContainer: PropTypes.element\n .description('When using portal, the container in which to append the DOM content, defaults to document body')\n .defaultValue(undefined),\n /**\n * start placement preferences, as per popperjs placement option\n */\n startPlacementPreference: PropTypes.oneOf([\n 'top-start',\n 'top',\n 'top-end',\n 'right-start',\n 'right',\n 'right-end',\n 'bottom-end',\n 'bottom',\n 'bottom-start',\n 'left-end',\n 'left',\n 'left-start',\n ])\n .description('start placement preferences, as per popperjs placement option')\n .defaultValue(\"'top'\"),\n /**\n * Array of placement preferences, as per popperjs \"flip\" placement option\n */\n placementOrderPreference: PropTypes.arrayOf(\n PropTypes.oneOf([\n 'top-start',\n 'top',\n 'top-end',\n 'right-start',\n 'right',\n 'right-end',\n 'bottom-end',\n 'bottom',\n 'bottom-start',\n 'left-end',\n 'left',\n 'left-start',\n ]),\n )\n .description('Array of placement preferences, as per popperjs \"flip\" placement option')\n .defaultValue(\"['top', 'bottom', 'left', 'right']\"),\n /**\n * tooltip wrapper z-index\n */\n zIndex: PropTypes.number.description('popperjs content z-index').defaultValue(1),\n /**\n * placement offset array\n */\n customOffset: PropTypes.arrayOf(PropTypes.number).description('placement offset array').defaultValue([0, 14]),\n /**\n * modifiers array for full-custom tooltip-js override\n * https://tooltip.js.org/docs/v2/modifiers/\n */\n modifiers: PropTypes.array\n .description('modifiers array for full-custom tooltip-js override, https://tooltip.js.org/docs/v2/modifiers/')\n .defaultValue(1),\n /**\n * Optional id appended to data-testid\n */\n id: PropTypes.string.description('Optional id appended to data-testid').defaultValue(''),\n /**\n * Optional callback to be invoked when the tooltip opens\n */\n onOpen: PropTypes.func.description('Optional callback to be invoked when the tooltip opens').defaultValue('() => {}'),\n /**\n * 'Optional callback to be invoked when the tooltip closes\n */\n onClose: PropTypes.func\n .description('Optional callback to be invoked when the tooltip closes')\n .defaultValue('() => {}'),\n};\n"],"names":["dsTooltipPropTypes","text","PropTypes","string","description","isRequired","textAlign","oneOf","defaultValue","children","node","withoutPortal","bool","withoutArrow","boundaryElement","element","undefined","portalDOMContainer","startPlacementPreference","placementOrderPreference","arrayOf","zIndex","number","customOffset","modifiers","array","id","onOpen","func","onClose"],"mappings":";;;;;;IAEaA,kBAAkB,GAAG;AAChC;AACF;AACA;AACEC,EAAAA,IAAI,EAAEC,mBAAS,CAACC,MAAV,CAAiBC,WAAjB,CAA6B,6CAA7B,EAA4EC,UAJlD;;AAKhC;AACF;AACA;AACEC,EAAAA,SAAS,EAAEJ,mBAAS,CAACK,KAAV,CAAgB,CAAC,MAAD,EAAS,OAAT,EAAkB,QAAlB,EAA4B,SAA5B,EAAuC,SAAvC,EAAkD,SAAlD,CAAhB,EACRH,WADQ,CACI,wBADJ,EAERI,YAFQ,CAEK,MAFL,CARqB;;AAWhC;AACF;AACA;AACEC,EAAAA,QAAQ,EAAEP,mBAAS,CAACQ,IAAV,CAAeN,WAAf,CAA2B,sDAA3B,EAAmFC,UAd7D;;AAehC;AACF;AACA;AACEM,EAAAA,aAAa,EAAET,mBAAS,CAACU,IAAV,CACZR,WADY,CACA,yEADA,EAEZI,YAFY,CAEC,IAFD,CAlBiB;;AAqBhC;AACF;AACA;AACEK,EAAAA,YAAY,EAAEX,mBAAS,CAACU,IAAV,CAAeR,WAAf,CAA2B,iDAA3B,EAA8EI,YAA9E,CAA2F,KAA3F,CAxBkB;;AAyBhC;AACF;AACA;AACA;AACEM,EAAAA,eAAe,EAAEZ,mBAAS,CAACa,OAAV,CACdX,WADc,CAEb,uEACE,4FAHW,EAKdI,YALc,CAKDQ,SALC,CA7Be;;AAmChC;AACF;AACA;AACEC,EAAAA,kBAAkB,EAAEf,mBAAS,CAACa,OAAV,CACjBX,WADiB,CACL,gGADK,EAEjBI,YAFiB,CAEJQ,SAFI,CAt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;;AAoGhC;AACF;AACA;AACEmB,EAAAA,MAAM,EAAEzB,mBAAS,CAAC0B,IAAV,CAAexB,WAAf,CAA2B,wDAA3B,EAAqFI,YAArF,CAAkG,UAAlG,CAvGwB;;AAwGhC;AACF;AACA;AACEqB,EAAAA,OAAO,EAAE3B,mBAAS,CAAC0B,IAAV,CACNxB,WADM,CACM,yDADN,EAENI,YAFM,CAEO,UAFP;AA3GuB;;;;"}
package/cjs/v3/styleds.js CHANGED
@@ -22,8 +22,19 @@ var StyledTooltipContainer = /*#__PURE__*/styled__default['default'].div.withCon
22
22
  });
23
23
  var StyledTooltipText = /*#__PURE__*/styled__default['default'].div.withConfig({
24
24
  componentId: "sc-18a4gem-1"
25
- })(["white-space:normal;word-wrap:break-word;display:inline-block;"]);
25
+ })(["white-space:normal;word-wrap:break-word;display:inline-block;text-align:", ";"], function (_ref4) {
26
+ var textAlign = _ref4.textAlign;
27
+ return textAlign;
28
+ });
29
+ var StyledMouseOverDetectionBox = /*#__PURE__*/styled__default['default'].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
+ var StyledTriggerWrapper = /*#__PURE__*/styled__default['default'].div.withConfig({
33
+ componentId: "sc-18a4gem-3"
34
+ })(["display:inline-block;"]);
26
35
 
36
+ exports.StyledMouseOverDetectionBox = StyledMouseOverDetectionBox;
27
37
  exports.StyledTooltipContainer = StyledTooltipContainer;
28
38
  exports.StyledTooltipText = StyledTooltipText;
39
+ exports.StyledTriggerWrapper = StyledTriggerWrapper;
29
40
  //# sourceMappingURL=styleds.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"styleds.js","sources":["../../../src/v3/styleds.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nexport const StyledTooltipContainer = styled.div`\n text-align: center;\n min-width: ${({ theme }) => theme.space.l};\n max-width: 250px;\n min-height: 30px;\n display: grid;\n align-items: center;\n padding: ${({ theme }) => `${theme.space.xxxs} ${theme.space.xs}`};\n position: relative;\n background-color: white;\n border-radius: 2px;\n font-size: 13px;\n color: ${({ theme }) => theme.colors.neutral[600]};\n box-shadow: 0 1px 5px 0 rgb(0 0 0 / 13%), 0 2px 4px 0 rgb(0 0 0 / 20%);\n filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));\n transition: visibility 0.1s ease-in;\n`;\n\nexport const StyledTooltipText = styled.div`\n white-space: normal;\n word-wrap: break-word;\n display: inline-block;\n`;\n"],"names":["StyledTooltipContainer","styled","div","theme","space","l","xxxs","xs","colors","neutral","StyledTooltipText"],"mappings":";;;;;;;;;;IAEaA,sBAAsB,gBAAGC,0BAAM,CAACC,GAAV;AAAA;AAAA,kWAEpB;AAAA,MAAGC,KAAH,QAAGA,KAAH;AAAA,SAAeA,KAAK,CAACC,KAAN,CAAYC,CAA3B;AAAA,CAFoB,EAOtB;AAAA,MAAGF,KAAH,SAAGA,KAAH;AAAA,mBAAkBA,KAAK,CAACC,KAAN,CAAYE,IAA9B,cAAsCH,KAAK,CAACC,KAAN,CAAYG,EAAlD;AAAA,CAPsB,EAYxB;AAAA,MAAGJ,KAAH,SAAGA,KAAH;AAAA,SAAeA,KAAK,CAACK,MAAN,CAAaC,OAAb,CAAqB,GAArB,CAAf;AAAA,CAZwB;IAkBtBC,iBAAiB,gBAAGT,0BAAM,CAACC,GAAV;AAAA;AAAA;;;;;"}
1
+ {"version":3,"file":"styleds.js","sources":["../../../src/v3/styleds.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nexport const StyledTooltipContainer = styled.div`\n text-align: center;\n min-width: ${({ theme }) => theme.space.l};\n max-width: 250px;\n min-height: 30px;\n display: grid;\n align-items: center;\n padding: ${({ theme }) => `${theme.space.xxxs} ${theme.space.xs}`};\n position: relative;\n background-color: white;\n border-radius: 2px;\n font-size: 13px;\n color: ${({ theme }) => theme.colors.neutral[600]};\n box-shadow: 0 1px 5px 0 rgb(0 0 0 / 13%), 0 2px 4px 0 rgb(0 0 0 / 20%);\n filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));\n transition: visibility 0.1s ease-in;\n`;\n\nexport const StyledTooltipText = styled.div<{ textAlign: string }>`\n white-space: normal;\n word-wrap: break-word;\n display: inline-block;\n text-align: ${({ textAlign }) => textAlign};\n`;\n\nexport const StyledMouseOverDetectionBox = styled.div`\n position: absolute;\n top: -15px;\n right: -15px;\n width: calc(100% + 30px);\n height: calc(100% + 30px);\n z-index: -1;\n`;\n\nexport const StyledTriggerWrapper = styled.div`\n display: inline-block;\n`;\n"],"names":["StyledTooltipContainer","styled","div","theme","space","l","xxxs","xs","colors","neutral","StyledTooltipText","textAlign","StyledMouseOverDetectionBox","StyledTriggerWrapper"],"mappings":";;;;;;;;;;IAEaA,sBAAsB,gBAAGC,0BAAM,CAACC,GAAV;AAAA;AAAA,kWAEpB;AAAA,MAAGC,KAAH,QAAGA,KAAH;AAAA,SAAeA,KAAK,CAACC,KAAN,CAAYC,CAA3B;AAAA,CAFoB,EAOtB;AAAA,MAAGF,KAAH,SAAGA,KAAH;AAAA,mBAAkBA,KAAK,CAACC,KAAN,CAAYE,IAA9B,cAAsCH,KAAK,CAACC,KAAN,CAAYG,EAAlD;AAAA,CAPsB,EAYxB;AAAA,MAAGJ,KAAH,SAAGA,KAAH;AAAA,SAAeA,KAAK,CAACK,MAAN,CAAaC,OAAb,CAAqB,GAArB,CAAf;AAAA,CAZwB;IAkBtBC,iBAAiB,gBAAGT,0BAAM,CAACC,GAAV;AAAA;AAAA,sFAId;AAAA,MAAGS,SAAH,SAAGA,SAAH;AAAA,SAAmBA,SAAnB;AAAA,CAJc;IAOjBC,2BAA2B,gBAAGX,0BAAM,CAACC,GAAV;AAAA;AAAA;IAS3BW,oBAAoB,gBAAGZ,0BAAM,CAACC,GAAV;AAAA;AAAA;;;;;;;"}
package/esm/index.js CHANGED
@@ -8,11 +8,9 @@ import '@babel/runtime/helpers/esm/objectWithoutProperties';
8
8
  import 'react';
9
9
  import 'react-desc';
10
10
  import '@elliemae/ds-classnames';
11
- import '@elliemae/ds-utilities/getComponentFromProps';
11
+ import '@elliemae/ds-utilities';
12
12
  import '@elliemae/ds-shared/constants';
13
13
  import '@elliemae/ds-popper';
14
- import '@elliemae/ds-popper/interaction';
15
- import '@elliemae/ds-popper/positions';
16
14
  import './v1/TooltipType.js';
17
15
  import '@babel/runtime/helpers/esm/defineProperty';
18
16
  import '@babel/runtime/helpers/esm/slicedToArray';
package/esm/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -3,11 +3,9 @@ import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutPr
3
3
  import React from 'react';
4
4
  import { PropTypes, describe } from 'react-desc';
5
5
  import { aggregatedClasses, convertPropToCssClassName } from '@elliemae/ds-classnames';
6
- import getComponentFromProps from '@elliemae/ds-utilities/getComponentFromProps';
6
+ import { getComponentFromProps } from '@elliemae/ds-utilities';
7
7
  import { DEFAULT_DELAY_CLOSE, DEFAULT_DELAY_OPEN } from '@elliemae/ds-shared/constants';
8
- import DSPopper, { PopperPositions, PopperInteractions } from '@elliemae/ds-popper';
9
- import { interactions } from '@elliemae/ds-popper/interaction';
10
- import { positions } from '@elliemae/ds-popper/positions';
8
+ import DSPopper, { positions, PopperPositions, interactions, PopperInteractions } from '@elliemae/ds-popper';
11
9
  import { TooltipType } from './TooltipType.js';
12
10
 
13
11
  var _excluded = ["containerProps", "innerRef", "placement", "title", "delayClose", "delayOpen", "interactionType", "triggerComponent", "className", "isOpen", "onOpen", "springAnimationComponent", "tooltipType", "showArrow", "zIndex"];
@@ -1 +1 @@
1
- {"version":3,"file":"DSTooltip.js","sources":["../../../src/v1/DSTooltip.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport React from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport {\n aggregatedClasses,\n convertPropToCssClassName,\n} from '@elliemae/ds-classnames';\nimport getComponentFromProps from '@elliemae/ds-utilities/getComponentFromProps';\nimport {\n DEFAULT_DELAY_OPEN,\n DEFAULT_DELAY_CLOSE,\n} from '@elliemae/ds-shared/constants';\nimport DSPopper, {\n PopperPositions,\n PopperInteractions,\n} from '@elliemae/ds-popper';\nimport { interactions } from '@elliemae/ds-popper/interaction';\nimport { positions } from '@elliemae/ds-popper/positions';\nimport { TooltipType } from './TooltipType';\n\nconst blockName = 'tooltip';\n\nconst TooltipContainer = aggregatedClasses('div')(blockName, false, false, {\n propsToRemoveFromFinalElement: ['isHovered', 'isDragged'],\n});\nconst TooltipText = aggregatedClasses('span')(blockName, 'text', false, {\n propsToRemoveFromFinalElement: ['isHovered', 'isDragged'],\n});\n\nconst DSTooltip = ({\n containerProps = {},\n innerRef,\n placement = PopperPositions.TOP,\n title = '',\n delayClose = DEFAULT_DELAY_CLOSE,\n delayOpen = DEFAULT_DELAY_OPEN,\n interactionType = PopperInteractions.HOVER,\n triggerComponent = null,\n className = '',\n isOpen = undefined,\n onOpen = () => null,\n springAnimationComponent = undefined,\n tooltipType = TooltipType.TOOLTIP,\n showArrow = true,\n zIndex,\n ...otherTooltipProps\n}) => {\n const { cssClassName: tooltipBlockName } = convertPropToCssClassName(\n blockName,\n );\n\n let Content = title;\n if (typeof title === 'string') {\n Content = <TooltipText>{title}</TooltipText>;\n }\n return (\n <DSPopper\n blockName={tooltipBlockName}\n contentComponent={\n <TooltipContainer\n {...containerProps}\n {...otherTooltipProps}\n className={`tooltip-container--${tooltipType} ${className}`}\n innerRef={innerRef}\n >\n {Content}\n </TooltipContainer>\n }\n delayClose={delayClose}\n delayOpen={delayOpen}\n interactionType={interactionType}\n isOpen={isOpen}\n onOpen={onOpen}\n placement={placement}\n showArrow={tooltipType === TooltipType.TOOLTIP ? showArrow : false}\n springAnimationComponent={springAnimationComponent}\n triggerComponent={getComponentFromProps(triggerComponent)}\n zIndex={zIndex}\n />\n );\n};\n\nconst tooltipProps = {\n containerProps: PropTypes.object.description(\n 'Set of Properties attached to the main container',\n ),\n placement: PropTypes.oneOf(positions)\n .description('Tooltip position')\n .defaultValue(PopperPositions.TOP),\n title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).description(\n 'Tooltip content',\n ).isRequired,\n delayClose: PropTypes.string\n .description('Delay to close the tooltip')\n .defaultValue(DEFAULT_DELAY_CLOSE),\n delayOpen: PropTypes.string\n .description('Delay to open the tooltip ')\n .defaultValue(DEFAULT_DELAY_OPEN),\n interactionType: PropTypes.oneOf(interactions)\n .description('A type indicating how to open/close the tooltip')\n .defaultValue(PopperInteractions.HOVER),\n triggerComponent: PropTypes.element.description(\n `The component that will open/close the tooltip. \n Cannot be used with disabled elements. \n https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled`,\n ).isRequired,\n isOpen: PropTypes.bool\n .description('Whether the tooltip is visible or not')\n .defaultValue(undefined),\n onOpen: PropTypes.func.description('Handler when the tooltip opens'),\n springAnimationComponent: PropTypes.element.description(\n 'Spring animation component',\n ),\n showArrow: PropTypes.bool\n .description('Whether to show an arrow or not')\n .defaultValue(true),\n className: PropTypes.string.description('css class'),\n tooltipType: PropTypes.oneOf(['tooltip', 'toolbar'])\n .description('Type of tooltip')\n .defaultValue(TooltipType.TOOLTIP),\n zIndex: PropTypes.number\n .description('z-index value assigned to the tooltip')\n .defaultValue(undefined),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description(\n 'Ref to the tooltip container element',\n ),\n};\n\nDSTooltip.propTypes = tooltipProps;\n\nconst TooltipWithSchema = describe(DSTooltip);\nTooltipWithSchema.propTypes = tooltipProps;\n\nexport { DSTooltip, TooltipContainer, TooltipText, TooltipWithSchema };\nexport default DSTooltip;\n"],"names":["blockName","TooltipContainer","aggregatedClasses","propsToRemoveFromFinalElement","TooltipText","DSTooltip","containerProps","innerRef","placement","PopperPositions","TOP","title","delayClose","DEFAULT_DELAY_CLOSE","delayOpen","DEFAULT_DELAY_OPEN","interactionType","PopperInteractions","HOVER","triggerComponent","className","isOpen","undefined","onOpen","springAnimationComponent","tooltipType","TooltipType","TOOLTIP","showArrow","zIndex","otherTooltipProps","convertPropToCssClassName","tooltipBlockName","cssClassName","Content","getComponentFromProps","tooltipProps","PropTypes","object","description","oneOf","positions","defaultValue","oneOfType","string","element","isRequired","interactions","bool","func","number","propTypes","TooltipWithSchema","describe"],"mappings":";;;;;;;;;;;;;AAoBA,IAAMA,SAAS,GAAG,SAAlB;IAEMC,gBAAgB,GAAGC,iBAAiB,CAAC,KAAD,CAAjB,CAAyBF,SAAzB,EAAoC,KAApC,EAA2C,KAA3C,EAAkD;AACzEG,EAAAA,6BAA6B,EAAE,CAAC,WAAD,EAAc,WAAd;AAD0C,CAAlD;IAGnBC,WAAW,GAAGF,iBAAiB,CAAC,MAAD,CAAjB,CAA0BF,SAA1B,EAAqC,MAArC,EAA6C,KAA7C,EAAoD;AACtEG,EAAAA,6BAA6B,EAAE,CAAC,WAAD,EAAc,WAAd;AADuC,CAApD;;IAIdE,SAAS,GAAG,SAAZA,SAAY,OAiBZ;AAAA,iCAhBJC,cAgBI;AAAA,MAhBJA,cAgBI,oCAhBa,EAgBb;AAAA,MAfJC,QAeI,QAfJA,QAeI;AAAA,4BAdJC,SAcI;AAAA,MAdJA,SAcI,+BAdQC,eAAe,CAACC,GAcxB;AAAA,wBAbJC,KAaI;AAAA,MAbJA,KAaI,2BAbI,EAaJ;AAAA,6BAZJC,UAYI;AAAA,MAZJA,UAYI,gCAZSC,mBAYT;AAAA,4BAXJC,SAWI;AAAA,MAXJA,SAWI,+BAXQC,kBAWR;AAAA,kCAVJC,eAUI;AAAA,MAVJA,eAUI,qCAVcC,kBAAkB,CAACC,KAUjC;AAAA,mCATJC,gBASI;AAAA,MATJA,gBASI,sCATe,IASf;AAAA,4BARJ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,EAERG,YAFQ,CAEK,IAFL,CA/BQ;AAkCnBtB,EAAAA,SAAS,EAAEiB,SAAS,CAACO,MAAV,CAAiBL,WAAjB,CAA6B,WAA7B,CAlCQ;AAmCnBd,EAAAA,WAAW,EAAEY,SAAS,CAACG,KAAV,CAAgB,CAAC,SAAD,EAAY,SAAZ,CAAhB,EACVD,WADU,CACE,iBADF,EAEVG,YAFU,CAEGhB,WAAW,CAACC,OAFf,CAnCM;AAsCnBE,EAAAA,MAAM,EAAEQ,SAAS,CAACa,MAAV,CACLX,WADK,CACO,uCADP,EAELG,YAFK,CAEQpB,SAFR,CAtCW;AAyCnBf,EAAAA,QAAQ,EAAE8B,SAAS,CAACM,SAAV,CAAoB,CAACN,SAAS,CAACY,IAAX,EAAiBZ,SAAS,CAACC,MAA3B,CAApB,EAAwDC,WAAxD,CACR,sCADQ;AAzCS,CAArB;AA8CAlC,SAAS,CAAC8C,SAAV,GAAsBf,YAAtB;IAEMgB,iBAAiB,GAAGC,QAAQ,CAAChD,SAAD;AAClC+C,iBAAiB,CAACD,SAAlB,GAA8Bf,YAA9B;;;;"}
1
+ {"version":3,"file":"DSTooltip.js","sources":["../../../src/v1/DSTooltip.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport React from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport {\n aggregatedClasses,\n convertPropToCssClassName,\n} from '@elliemae/ds-classnames';\nimport { getComponentFromProps } from '@elliemae/ds-utilities';\nimport {\n DEFAULT_DELAY_OPEN,\n DEFAULT_DELAY_CLOSE,\n} from '@elliemae/ds-shared/constants';\nimport DSPopper, {\n PopperPositions,\n PopperInteractions,\n interactions,\n positions\n} from '@elliemae/ds-popper';\nimport { TooltipType } from './TooltipType';\n\nconst blockName = 'tooltip';\n\nconst TooltipContainer = aggregatedClasses('div')(blockName, false, false, {\n propsToRemoveFromFinalElement: ['isHovered', 'isDragged'],\n});\nconst TooltipText = aggregatedClasses('span')(blockName, 'text', false, {\n propsToRemoveFromFinalElement: ['isHovered', 'isDragged'],\n});\n\nconst DSTooltip = ({\n containerProps = {},\n innerRef,\n placement = PopperPositions.TOP,\n title = '',\n delayClose = DEFAULT_DELAY_CLOSE,\n delayOpen = DEFAULT_DELAY_OPEN,\n interactionType = PopperInteractions.HOVER,\n triggerComponent = null,\n className = '',\n isOpen = undefined,\n onOpen = () => null,\n springAnimationComponent = undefined,\n tooltipType = TooltipType.TOOLTIP,\n showArrow = true,\n zIndex,\n ...otherTooltipProps\n}) => {\n const { cssClassName: tooltipBlockName } = convertPropToCssClassName(\n blockName,\n );\n\n let Content = title;\n if (typeof title === 'string') {\n Content = <TooltipText>{title}</TooltipText>;\n }\n return (\n <DSPopper\n blockName={tooltipBlockName}\n contentComponent={\n <TooltipContainer\n {...containerProps}\n {...otherTooltipProps}\n className={`tooltip-container--${tooltipType} ${className}`}\n innerRef={innerRef}\n >\n {Content}\n </TooltipContainer>\n }\n delayClose={delayClose}\n delayOpen={delayOpen}\n interactionType={interactionType}\n isOpen={isOpen}\n onOpen={onOpen}\n placement={placement}\n showArrow={tooltipType === TooltipType.TOOLTIP ? showArrow : false}\n springAnimationComponent={springAnimationComponent}\n triggerComponent={getComponentFromProps(triggerComponent)}\n zIndex={zIndex}\n />\n );\n};\n\nconst tooltipProps = {\n containerProps: PropTypes.object.description(\n 'Set of Properties attached to the main container',\n ),\n placement: PropTypes.oneOf(positions)\n .description('Tooltip position')\n .defaultValue(PopperPositions.TOP),\n title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).description(\n 'Tooltip content',\n ).isRequired,\n delayClose: PropTypes.string\n .description('Delay to close the tooltip')\n .defaultValue(DEFAULT_DELAY_CLOSE),\n delayOpen: PropTypes.string\n .description('Delay to open the tooltip ')\n .defaultValue(DEFAULT_DELAY_OPEN),\n interactionType: PropTypes.oneOf(interactions)\n .description('A type indicating how to open/close the tooltip')\n .defaultValue(PopperInteractions.HOVER),\n triggerComponent: PropTypes.element.description(\n `The component that will open/close the tooltip. \n Cannot be used with disabled elements. \n https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled`,\n ).isRequired,\n isOpen: PropTypes.bool\n .description('Whether the tooltip is visible or not')\n .defaultValue(undefined),\n onOpen: PropTypes.func.description('Handler when the tooltip opens'),\n springAnimationComponent: PropTypes.element.description(\n 'Spring animation component',\n ),\n showArrow: PropTypes.bool\n .description('Whether to show an arrow or not')\n .defaultValue(true),\n className: PropTypes.string.description('css class'),\n tooltipType: PropTypes.oneOf(['tooltip', 'toolbar'])\n .description('Type of tooltip')\n .defaultValue(TooltipType.TOOLTIP),\n zIndex: PropTypes.number\n .description('z-index value assigned to the tooltip')\n .defaultValue(undefined),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description(\n 'Ref to the tooltip container element',\n ),\n};\n\nDSTooltip.propTypes = tooltipProps;\n\nconst TooltipWithSchema = describe(DSTooltip);\nTooltipWithSchema.propTypes = tooltipProps;\n\nexport { DSTooltip, TooltipContainer, TooltipText, TooltipWithSchema };\nexport default DSTooltip;\n"],"names":["blockName","TooltipContainer","aggregatedClasses","propsToRemoveFromFinalElement","TooltipText","DSTooltip","containerProps","innerRef","placement","PopperPositions","TOP","title","delayClose","DEFAULT_DELAY_CLOSE","delayOpen","DEFAULT_DELAY_OPEN","interactionType","PopperInteractions","HOVER","triggerComponent","className","isOpen","undefined","onOpen","springAnimationComponent","tooltipType","TooltipType","TOOLTIP","showArrow","zIndex","otherTooltipProps","convertPropToCssClassName","tooltipBlockName","cssClassName","Content","getComponentFromProps","tooltipProps","PropTypes","object","description","oneOf","positions","defaultValue","oneOfType","string","element","isRequired","interactions","bool","func","number","propTypes","TooltipWithSchema","describe"],"mappings":";;;;;;;;;;;AAoBA,IAAMA,SAAS,GAAG,SAAlB;IAEMC,gBAAgB,GAAGC,iBAAiB,CAAC,KAAD,CAAjB,CAAyBF,SAAzB,EAAoC,KAApC,EAA2C,KAA3C,EAAkD;AACzEG,EAAAA,6BAA6B,EAAE,CAAC,WAAD,EAAc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lC,SAAS,CAAC8C,SAAV,GAAsBf,YAAtB;IAEMgB,iBAAiB,GAAGC,QAAQ,CAAChD,SAAD;AAClC+C,iBAAiB,CAACD,SAAlB,GAA8Bf,YAA9B;;;;"}
@@ -6,7 +6,8 @@ var noop = function noop() {};
6
6
  var defaultProps = {
7
7
  onOpen: noop,
8
8
  onClose: noop,
9
- id: ''
9
+ id: '',
10
+ textAlign: 'left'
10
11
  };
11
12
  var useWithDefaultProps = function useWithDefaultProps(props) {
12
13
  return useMemoMergePropsWithDefault(props, defaultProps);
@@ -1 +1 @@
1
- {"version":3,"file":"useWithDefaultProps.js","sources":["../../../../src/v3/config/useWithDefaultProps.ts"],"sourcesContent":["import { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport type { TooltipV3PropsT } from '../index.d';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = () => {};\n\nconst defaultProps = {\n onOpen: noop,\n onClose: noop,\n id: '',\n};\n\nexport const useWithDefaultProps = (props: Partial<TooltipV3PropsT>): Partial<TooltipV3PropsT> =>\n useMemoMergePropsWithDefault(props, defaultProps);\n"],"names":["noop","defaultProps","onOpen","onClose","id","useWithDefaultProps","props","useMemoMergePropsWithDefault"],"mappings":";;AAGA;AACA,IAAMA,IAAI,GAAG,SAAPA,IAAO,GAAM,EAAnB;;AAEA,IAAMC,YAAY,GAAG;AACnBC,EAAAA,MAAM,EAAEF,IADW;AAEnBG,EAAAA,OAAO,EAAEH,IAFU;AAGnBI,EAAAA,EAAE,EAAE;AAHe,CAArB;IAMaC,mBAAmB,GAAG,SAAtBA,mBAAsB,CAACC,KAAD;AAAA,SACjCC,4BAA4B,CAACD,KAAD,EAAQL,YAAR,CADK;AAAA;;;;"}
1
+ {"version":3,"file":"useWithDefaultProps.js","sources":["../../../../src/v3/config/useWithDefaultProps.ts"],"sourcesContent":["import { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport type { TooltipV3PropsT } from '../index.d';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = () => {};\n\nconst defaultProps = {\n onOpen: noop,\n onClose: noop,\n id: '',\n textAlign: 'left',\n};\n\nexport const useWithDefaultProps = (props: Partial<TooltipV3PropsT>): Partial<TooltipV3PropsT> =>\n useMemoMergePropsWithDefault(props, defaultProps);\n"],"names":["noop","defaultProps","onOpen","onClose","id","textAlign","useWithDefaultProps","props","useMemoMergePropsWithDefault"],"mappings":";;AAGA;AACA,IAAMA,IAAI,GAAG,SAAPA,IAAO,GAAM,EAAnB;;AAEA,IAAMC,YAAY,GAAG;AACnBC,EAAAA,MAAM,EAAEF,IADW;AAEnBG,EAAAA,OAAO,EAAEH,IAFU;AAGnBI,EAAAA,EAAE,EAAE,EAHe;AAInBC,EAAAA,SAAS,EAAE;AAJQ,CAArB;IAOaC,mBAAmB,GAAG,SAAtBA,mBAAsB,CAACC,KAAD;AAAA,SACjCC,4BAA4B,CAACD,KAAD,EAAQN,YAAR,CADK;AAAA;;;;"}
package/esm/v3/index.js CHANGED
@@ -1,17 +1,26 @@
1
1
  import _extends from '@babel/runtime/helpers/esm/extends';
2
2
  import _slicedToArray from '@babel/runtime/helpers/esm/slicedToArray';
3
3
  import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
4
- import React, { useState, useCallback } from 'react';
4
+ import React, { useState, useCallback, useEffect } from 'react';
5
5
  import { DSPopperJS } from '@elliemae/ds-popperjs';
6
6
  import { describe } from 'react-desc';
7
7
  import { dsTooltipPropTypes } from './propsTypes.js';
8
8
  import { useWithDefaultProps } from './config/useWithDefaultProps.js';
9
9
  import { TooltipV3DatatestId } from './TooltipV3DatatestId.js';
10
- import { StyledTooltipContainer, StyledTooltipText } from './styleds.js';
10
+ import { StyledTooltipContainer, StyledTooltipText, StyledMouseOverDetectionBox, StyledTriggerWrapper } from './styleds.js';
11
11
  import '@elliemae/ds-props-helpers';
12
12
  import 'styled-components';
13
13
 
14
- var _excluded = ["text", "children", "onOpen", "onClose", "id"];
14
+ var _excluded = ["text", "children", "onOpen", "onClose", "id", "textAlign"];
15
+
16
+ var useGlobalKeyboardListener = function useGlobalKeyboardListener(func) {
17
+ useEffect(function () {
18
+ document.addEventListener('keydown', func);
19
+ return function () {
20
+ return document.removeEventListener('keydown', func);
21
+ };
22
+ }, [func]);
23
+ };
15
24
 
16
25
  var DSTooltipV3 = function DSTooltipV3(props) {
17
26
  var _useWithDefaultProps = useWithDefaultProps(props),
@@ -20,17 +29,33 @@ var DSTooltipV3 = function DSTooltipV3(props) {
20
29
  onOpen = _useWithDefaultProps.onOpen,
21
30
  onClose = _useWithDefaultProps.onClose,
22
31
  id = _useWithDefaultProps.id,
32
+ textAlign = _useWithDefaultProps.textAlign,
23
33
  extraPopperJsProps = _objectWithoutProperties(_useWithDefaultProps, _excluded);
24
34
 
25
- var _useState = useState(),
35
+ var _useState = useState(false),
26
36
  _useState2 = _slicedToArray(_useState, 2),
27
- referenceElement = _useState2[0],
28
- setReferenceElement = _useState2[1];
37
+ isFocused = _useState2[0],
38
+ setIsFocused = _useState2[1];
29
39
 
30
40
  var _useState3 = useState(false),
31
41
  _useState4 = _slicedToArray(_useState3, 2),
32
- showPopover = _useState4[0],
33
- setShowPopover = _useState4[1];
42
+ isHover = _useState4[0],
43
+ setIsHover = _useState4[1];
44
+
45
+ var _useState5 = useState(''),
46
+ _useState6 = _slicedToArray(_useState5, 2),
47
+ latestOpenInteraction = _useState6[0],
48
+ setLatestOpenInteraction = _useState6[1];
49
+
50
+ var _useState7 = useState(),
51
+ _useState8 = _slicedToArray(_useState7, 2),
52
+ referenceElement = _useState8[0],
53
+ setReferenceElement = _useState8[1];
54
+
55
+ var _useState9 = useState(false),
56
+ _useState10 = _slicedToArray(_useState9, 2),
57
+ showPopover = _useState10[0],
58
+ setShowPopover = _useState10[1];
34
59
 
35
60
  var showTooltip = useCallback(function () {
36
61
  setShowPopover(true);
@@ -40,24 +65,52 @@ var DSTooltipV3 = function DSTooltipV3(props) {
40
65
  setShowPopover(false);
41
66
  onClose();
42
67
  }, [onClose]);
68
+ var onFocus = useCallback(function () {
69
+ setIsFocused(true);
70
+
71
+ if (!showPopover) {
72
+ showTooltip();
73
+ setLatestOpenInteraction('onFocus');
74
+ }
75
+ }, [showPopover, showTooltip]);
76
+ var onBlur = useCallback(function () {
77
+ setIsFocused(false);
78
+ if (!isHover || latestOpenInteraction === 'onFocus') hideTooltip();
79
+ }, [hideTooltip, isHover, latestOpenInteraction]);
80
+ var onMouseEnter = useCallback(function () {
81
+ setIsHover(true);
82
+
83
+ if (!showPopover) {
84
+ showTooltip();
85
+ setLatestOpenInteraction('onMouseEnter');
86
+ }
87
+ }, [showPopover, showTooltip]);
88
+ var onMouseLeave = useCallback(function () {
89
+ setIsHover(false);
90
+ if (!isFocused || latestOpenInteraction === 'onMouseEnter') hideTooltip();
91
+ }, [hideTooltip, isFocused, latestOpenInteraction]);
43
92
  var handleEscKey = useCallback(function (_ref) {
44
93
  var key = _ref.key;
45
94
  if (key === 'Escape') hideTooltip();
46
95
  }, [hideTooltip]);
47
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DSPopperJS, _extends({
96
+ useGlobalKeyboardListener(handleEscKey);
97
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
98
+ onMouseEnter: onMouseEnter,
99
+ onMouseLeave: onMouseLeave,
100
+ onFocus: onFocus,
101
+ onBlur: onBlur
102
+ }, /*#__PURE__*/React.createElement(DSPopperJS, _extends({
48
103
  referenceElement: referenceElement,
49
- showPopover: showPopover
104
+ showPopover: showPopover,
105
+ withoutPortal: true
50
106
  }, extraPopperJsProps), /*#__PURE__*/React.createElement("div", {
51
107
  "data-testid": "".concat(TooltipV3DatatestId.TOOLTIP_TEXT_WRAPPER).concat(id !== '' ? "_".concat(id) : '')
52
- }, /*#__PURE__*/React.createElement(StyledTooltipContainer, null, /*#__PURE__*/React.createElement(StyledTooltipText, null, text)))), /*#__PURE__*/React.createElement("div", {
53
- onMouseOver: showTooltip,
54
- onFocus: showTooltip,
55
- onMouseOut: hideTooltip,
56
- onBlur: hideTooltip,
57
- onKeyDown: handleEscKey,
108
+ }, /*#__PURE__*/React.createElement(StyledTooltipContainer, null, /*#__PURE__*/React.createElement(StyledTooltipText, {
109
+ textAlign: textAlign
110
+ }, text), /*#__PURE__*/React.createElement(StyledMouseOverDetectionBox, null)))), /*#__PURE__*/React.createElement(StyledTriggerWrapper, {
58
111
  ref: setReferenceElement,
59
112
  "data-testid": "".concat(TooltipV3DatatestId.TRIGGER_WRAPPER).concat(id !== '' ? "_".concat(id) : '')
60
- }, children));
113
+ }, children)));
61
114
  };
62
115
 
63
116
  DSTooltipV3.propTypes = dsTooltipPropTypes;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/v3/index.tsx"],"sourcesContent":["import React, { useState, useCallback } from 'react';\nimport { DSPopperJS } from '@elliemae/ds-popperjs';\nimport { describe } from 'react-desc';\n\nimport { dsTooltipPropTypes } from './propsTypes';\nimport { useWithDefaultProps } from './config/useWithDefaultProps';\nimport { TooltipV3DatatestId } from './TooltipV3DatatestId';\nimport { StyledTooltipContainer, StyledTooltipText } from './styleds';\nimport type { TooltipV3PropsT } from './index.d';\n\nconst DSTooltipV3: React.ComponentType<TooltipV3PropsT> = (props) => {\n const { text, children, onOpen, onClose, id, ...extraPopperJsProps } = useWithDefaultProps(props);\n\n const [referenceElement, setReferenceElement] = useState<HTMLDivElement>();\n const [showPopover, setShowPopover] = useState(false);\n const showTooltip = useCallback(() => {\n setShowPopover(true);\n onOpen();\n }, [onOpen]);\n const hideTooltip = useCallback(() => {\n setShowPopover(false);\n onClose();\n }, [onClose]);\n const handleEscKey = useCallback(\n ({ key }) => {\n if (key === 'Escape') hideTooltip();\n },\n [hideTooltip],\n );\n\n return (\n <>\n <DSPopperJS referenceElement={referenceElement} showPopover={showPopover} {...extraPopperJsProps}>\n <div data-testid={`${TooltipV3DatatestId.TOOLTIP_TEXT_WRAPPER}${id !== '' ? `_${id}` : ''}`}>\n <StyledTooltipContainer>\n <StyledTooltipText>{text}</StyledTooltipText>\n </StyledTooltipContainer>\n </div>\n </DSPopperJS>\n {/* The <div> element is catching the \"ESC\" key to close the tooltip, there is no valid aria role for this */}\n {/* eslint-disable-next-line max-len */}\n {/* https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md#case-the-event-handler-is-only-being-used-to-capture-bubbled-events */}\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}\n <div\n onMouseOver={showTooltip}\n onFocus={showTooltip}\n onMouseOut={hideTooltip}\n onBlur={hideTooltip}\n onKeyDown={handleEscKey}\n ref={setReferenceElement}\n data-testid={`${TooltipV3DatatestId.TRIGGER_WRAPPER}${id !== '' ? `_${id}` : ''}`}\n >\n {children}\n </div>\n </>\n );\n};\n\nDSTooltipV3.propTypes = dsTooltipPropTypes;\n\nconst DSTooltipV3WithSchema = describe(DSTooltipV3).description('A tooltip component');\nDSTooltipV3WithSchema.propTypes = dsTooltipPropTypes;\n\nexport { DSTooltipV3, DSTooltipV3WithSchema };\nexport default DSTooltipV3;\n"],"names":["DSTooltipV3","props","useWithDefaultProps","text","children","onOpen","onClose","id","extraPopperJsProps","useState","referenceElement","setReferenceElement","showPopover","setShowPopover","showTooltip","useCallback","hideTooltip","handleEscKey","key","TooltipV3DatatestId","TOOLTIP_TEXT_WRAPPER","TRIGGER_WRAPPER","propTypes","dsTooltipPropTypes","DSTooltipV3WithSchema","describe","description"],"mappings":";;;;;;;;;;;;;;;IAUMA,WAAiD,GAAG,SAApDA,WAAoD,CAACC,KAAD,EAAW;AACnE,6BAAuEC,mBAAmB,CAACD,KAAD,CAA1F;AAAA,MAAQE,IAAR,wBAAQA,IAAR;AAAA,MAAcC,QAAd,wBAAcA,QAAd;AAAA,MAAwBC,MAAxB,wBAAwBA,MAAxB;AAAA,MAAgCC,OAAhC,wBAAgCA,OAAhC;AAAA,MAAyCC,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EAAP,cAAgBA,EAAhB,IAAuB,EAA7E;AAPF,KASGH,QATH,CAZF,CADF;AA0BD;;AAEDJ,WAAW,CAACsB,SAAZ,GAAwBC,kBAAxB;IAEMC,qBAAqB,GAAGC,QAAQ,CAACzB,WAAD,CAAR,CAAsB0B,WAAtB,CAAkC,qBAAlC;AAC9BF,qBAAqB,CAACF,SAAtB,GAAkCC,kBAAlC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/v3/index.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport React, { useState, useCallback, useEffect } from 'react';\nimport { DSPopperJS } from '@elliemae/ds-popperjs';\nimport { describe } from 'react-desc';\n\nimport { dsTooltipPropTypes } from './propsTypes';\nimport { useWithDefaultProps } from './config/useWithDefaultProps';\nimport { TooltipV3DatatestId } from './TooltipV3DatatestId';\nimport {\n StyledTooltipContainer,\n StyledTooltipText,\n StyledMouseOverDetectionBox,\n StyledTriggerWrapper,\n} from './styleds';\nimport type { TooltipV3PropsT } from './index.d';\n\nconst useGlobalKeyboardListener = (func) => {\n useEffect(() => {\n document.addEventListener('keydown', func);\n return () => document.removeEventListener('keydown', func);\n }, [func]);\n};\n\nconst DSTooltipV3: React.ComponentType<TooltipV3PropsT> = (props) => {\n const { text, children, onOpen, onClose, id, textAlign, ...extraPopperJsProps } = useWithDefaultProps(props);\n\n const [isFocused, setIsFocused] = useState(false);\n const [isHover, setIsHover] = useState(false);\n const [latestOpenInteraction, setLatestOpenInteraction] = useState('');\n\n const [referenceElement, setReferenceElement] = useState<HTMLSpanElement>();\n const [showPopover, setShowPopover] = useState(false);\n const showTooltip = useCallback(() => {\n setShowPopover(true);\n onOpen();\n }, [onOpen]);\n const hideTooltip = useCallback(() => {\n setShowPopover(false);\n onClose();\n }, [onClose]);\n\n const onFocus = useCallback(() => {\n setIsFocused(true);\n if (!showPopover) {\n showTooltip();\n setLatestOpenInteraction('onFocus');\n }\n }, [showPopover, showTooltip]);\n const onBlur = useCallback(() => {\n setIsFocused(false);\n if (!isHover || latestOpenInteraction === 'onFocus') hideTooltip();\n }, [hideTooltip, isHover, latestOpenInteraction]);\n\n const onMouseEnter = useCallback(() => {\n setIsHover(true);\n if (!showPopover) {\n showTooltip();\n setLatestOpenInteraction('onMouseEnter');\n }\n }, [showPopover, showTooltip]);\n const onMouseLeave = useCallback(() => {\n setIsHover(false);\n if (!isFocused || latestOpenInteraction === 'onMouseEnter') hideTooltip();\n }, [hideTooltip, isFocused, latestOpenInteraction]);\n\n const handleEscKey = useCallback(\n ({ key }) => {\n if (key === 'Escape') hideTooltip();\n },\n [hideTooltip],\n );\n\n useGlobalKeyboardListener(handleEscKey);\n\n return (\n <>\n {/* The <div> element is catching the \"ESC\" key to close the tooltip, there is no valid aria role for this */}\n {/* eslint-disable-next-line max-len */}\n {/* https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md#case-the-event-handler-is-only-being-used-to-capture-bubbled-events */}\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}\n <span onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave} onFocus={onFocus} onBlur={onBlur}>\n <DSPopperJS referenceElement={referenceElement} showPopover={showPopover} withoutPortal {...extraPopperJsProps}>\n <div data-testid={`${TooltipV3DatatestId.TOOLTIP_TEXT_WRAPPER}${id !== '' ? `_${id}` : ''}`}>\n <StyledTooltipContainer>\n <StyledTooltipText textAlign={textAlign}>{text}</StyledTooltipText>\n <StyledMouseOverDetectionBox />\n </StyledTooltipContainer>\n </div>\n </DSPopperJS>\n <StyledTriggerWrapper\n ref={setReferenceElement}\n data-testid={`${TooltipV3DatatestId.TRIGGER_WRAPPER}${id !== '' ? `_${id}` : ''}`}\n >\n {children}\n </StyledTriggerWrapper>\n </span>\n </>\n );\n};\n\nDSTooltipV3.propTypes = dsTooltipPropTypes;\n\nconst DSTooltipV3WithSchema = describe(DSTooltipV3).description('A tooltip component');\nDSTooltipV3WithSchema.propTypes = dsTooltipPropTypes;\n\nexport { DSTooltipV3, DSTooltipV3WithSchema };\nexport default DSTooltipV3;\n"],"names":["useGlobalKeyboardListener","func","useEffect","document","addEventListener","removeEventListener","DSTooltipV3","props","useWithDefaultProps","text","children","onOpen","onClose","id","textAlign","extraPopperJsProps","useState","isFocused","setIsFocused","isHover","setIsHover","latestOpenInteraction","setLatestOpenInteraction","referenceElement","setReferenceElement","showPopover","setShowPopover","showTooltip","useCallback","hideTooltip","onFocus","onBlur","onMouseEnter","onMouseLeave","handleEscKey","key","TooltipV3DatatestId","TOOLTIP_TEXT_WRAPPER","TRIGGER_WRAPPER","propTypes","dsTooltipPropTypes","DSTooltipV3WithSchema","describe","description"],"mappings":";;;;;;;;;;;;;;;AAgBA,IAAMA,yBAAyB,GAAG,SAA5BA,yBAA4B,CAACC,IAAD,EAAU;AAC1CC,EAAAA,SAAS,CAAC,YAAM;AACdC,IAAAA,QAAQ,CAACC,gBAAT,CAA0B,SAA1B,EAAqCH,IAArC;AACA,WAAO;AAAA,aAAME,QAAQ,CAACE,mBAAT,CAA6B,SAA7B,EAAwCJ,IAAxC,CAAN;AAAA,KAAP;AACD,GAHQ,EAGN,CAACA,IAAD,CAHM,CAAT;AAID,CALD;;IAOMK,WAAiD,GAAG,SAApDA,WAAoD,CAACC,KAAD,EAAW;AACnE,6BAAkFC,mBAAmB,CAACD,KAAD,CAArG;AAAA,MAAQE,IAAR,wBAAQA,IAAR;AAAA,MAAcC,QAAd,wBAAcA,QAAd;AAAA,MAAwBC,MAAxB,wBAAwBA,MAAxB;AAAA,MAAgCC,OAAhC,wBAAgCA,OAAhC;AAAA,MAAyCC,EAAzC,wBAAyCA,EAAzC;AAAA,MAA6CC,SAA7C,wBAA6CA,SAA7C;AAAA,MAA2DC,kBAA3D;;AAEA,kBAAkCC,QAAQ,CAAC,KAAD,CAA1C;AAAA;AAAA,MAAOC,SAAP;AAAA,MAAkBC,YAAlB;;AACA,mBAA8BF,QAAQ,CAAC,KAAD,CAAtC;AAAA;AAAA,MAAO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,WAAW,CAACiC,SAAZ,GAAwBC,kBAAxB;IAEMC,qBAAqB,GAAGC,QAAQ,CAACpC,WAAD,CAAR,CAAsBqC,WAAtB,CAAkC,qBAAlC;AAC9BF,qBAAqB,CAACF,SAAtB,GAAkCC,kBAAlC;;;;"}
@@ -2,9 +2,14 @@ import { PropTypes } from 'react-desc';
2
2
 
3
3
  var 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
@@ -1 +1 @@
1
- {"version":3,"file":"propsTypes.js","sources":["../../../src/v3/propsTypes.tsx"],"sourcesContent":["import { PropTypes } from 'react-desc';\n\nexport const dsTooltipPropTypes = {\n /**\n * Tooltip text to be displayed on hover\n */\n text: PropTypes.string.description('Tooltip text to be displayed on hover').isRequired,\n /**\n * Element to tie the tooltip to, must be a single node\n */\n children: PropTypes.node.description('Element to tie the tooltip to, must be a single node').isRequired,\n /**\n * Wheter or not the tooltip content should appear in a DOM portal or not\n */\n withoutPortal: PropTypes.bool\n .description('Whether or not the tooltip content should appear in a DOM portal or not')\n .defaultValue(true),\n /**\n * Wheter or not the tooltip should use the arrow\n */\n withoutArrow: PropTypes.bool.description('Whether or not the tooltip should use the arrow').defaultValue(false),\n /**\n * Bounding element to calculate upon, defaults to it is \"clippingParents\",\n * which are the scrolling containers that may cause the element to be partially or fully cut off.\n */\n boundaryElement: PropTypes.element\n .description(\n 'Bounding element to calculate upon, defaults to \"clippingParents\",' +\n 'which are the scrolling containers that may cause element to be partially or fully cut off',\n )\n .defaultValue(undefined),\n /**\n * When using portal, the container in which to append the DOM content, defaults to document body\n */\n portalDOMContainer: PropTypes.element\n .description('When using portal, the container in which to append the DOM content, defaults to document body')\n .defaultValue(undefined),\n /**\n * start placement preferences, as per popperjs placement option\n */\n startPlacementPreference: PropTypes.oneOf([\n 'top-start',\n 'top',\n 'top-end',\n 'right-start',\n 'right',\n 'right-end',\n 'bottom-end',\n 'bottom',\n 'bottom-start',\n 'left-end',\n 'left',\n 'left-start',\n ])\n .description('start placement preferences, as per popperjs placement option')\n .defaultValue(\"'top'\"),\n /**\n * Array of placement preferences, as per popperjs \"flip\" placement option\n */\n placementOrderPreference: PropTypes.arrayOf(\n PropTypes.oneOf([\n 'top-start',\n 'top',\n 'top-end',\n 'right-start',\n 'right',\n 'right-end',\n 'bottom-end',\n 'bottom',\n 'bottom-start',\n 'left-end',\n 'left',\n 'left-start',\n ]),\n )\n .description('Array of placement preferences, as per popperjs \"flip\" placement option')\n .defaultValue(\"['top', 'bottom', 'left', 'right']\"),\n /**\n * tooltip wrapper z-index\n */\n zIndex: PropTypes.number.description('popperjs content z-index').defaultValue(1),\n /**\n * placement offset array\n */\n customOffset: PropTypes.arrayOf(PropTypes.number).description('placement offset array').defaultValue([0, 14]),\n /**\n * modifiers array for full-custom tooltip-js override\n * https://tooltip.js.org/docs/v2/modifiers/\n */\n modifiers: PropTypes.array\n .description('modifiers array for full-custom tooltip-js override, https://tooltip.js.org/docs/v2/modifiers/')\n .defaultValue(1),\n /**\n * Optional id appended to data-testid\n */\n id: PropTypes.string.description('Optional id appended to data-testid').defaultValue(''),\n /**\n * Optional callback to be invoked when the tooltip opens\n */\n onOpen: PropTypes.func.description('Optional callback to be invoked when the tooltip opens').defaultValue('() => {}'),\n /**\n * 'Optional callback to be invoked when the tooltip closes\n */\n onClose: PropTypes.func\n .description('Optional callback to be invoked when the tooltip closes')\n .defaultValue('() => {}'),\n};\n"],"names":["dsTooltipPropTypes","text","PropTypes","string","description","isRequired","children","node","withoutPortal","bool","defaultValue","withoutArrow","boundaryElement","element","undefined","portalDOMContainer","startPlacementPreference","oneOf","placementOrderPreference","arrayOf","zIndex","number","customOffset","modifiers","array","id","onOpen","func","onClose"],"mappings":";;IAEaA,kBAAkB,GAAG;AAChC;AACF;AACA;AACEC,EAAAA,IAAI,EAAEC,SAAS,CAACC,MAAV,CAAiBC,WAAjB,CAA6B,uCAA7B,EAAsEC,UAJ5C;;AAKhC;AACF;AACA;AACEC,EAAAA,QAAQ,EAAEJ,SAAS,CAACK,IAAV,CAAeH,WAAf,CAA2B,sDAA3B,EAAmFC,UAR7D;;AAShC;AACF;AACA;AACEG,EAAAA,aAAa,EAAEN,SAAS,CAACO,IAAV,CACZL,WADY,CACA,yEADA,EAEZM,YAFY,CAEC,IAFD,CAZiB;;AAehC;AACF;AACA;AACEC,EAAAA,YAAY,EAAET,SAAS,CAACO,IAAV,CAAeL,WAAf,CAA2B,iDAA3B,EAA8EM,YAA9E,CAA2F,KAA3F,CAlBkB;;AAmBhC;AACF;AACA;AACA;AACEE,EAAAA,eAAe,EAAEV,SAAS,CAACW,OAAV,CACdT,WADc,CAEb,uEACE,4FAHW,EAKdM,YALc,CAKDI,SALC,CAvBe;;AA6BhC;AACF;AACA;AACEC,EAAAA,kBAAkB,EAAEb,SAAS,CAACW,OAAV,CACjBT,WADiB,CACL,gGADK,EAEjBM,YAFiB,CAEJI,SAFI,CAhCY;;AAmChC;AACF;AACA;AACEE,EAAAA,wBAAwB,EAAEd,SAAS,CAACe,KAAV,CAAgB,CACxC,WADwC,EAExC,KAFwC,EAGxC,SAHwC,EAIxC,aAJwC,EAKxC,OALwC,EAMxC,WANwC,EAOxC,YAPwC,EAQxC,QARwC,EASxC,cATwC,EAUxC,UAVwC,EAWxC,MAXwC,EAYxC,YAZwC,CAAhB,EAcvBb,WAduB,CAcX,+DAdW,EAevBM,YAfuB,CAeV,OAfU,CAtCM;;AAsDhC;AACF;AACA;AACEQ,EAAAA,wBAAwB,EAAEhB,SAAS,CAACiB,OAAV,CACxBjB,SAAS,CAACe,KAAV,CAAgB,CACd,WADc,EAEd,KAFc,EAGd,SAHc,EAId,aAJc,EAKd,OALc,EAMd,WANc,EAOd,YAPc,EAQd,QARc,EASd,cATc,EAUd,UAVc,EAWd,MAXc,EAYd,YAZc,CAAhB,CADwB,EAgBvBb,WAhBuB,CAgBX,yEAhBW,EAiBvBM,YAjBuB,CAiBV,oCAjBU,CAzDM;;AA2EhC;AACF;AACA;AACEU,EAAAA,MAAM,EAAElB,SAAS,CAACmB,MAAV,CAAiBjB,WAAjB,CAA6B,0BAA7B,EAAyDM,YAAzD,CAAsE,CAAtE,CA9EwB;;AA+EhC;AACF;AACA;AACEY,EAAAA,YAAY,EAAEpB,SAAS,CAACiB,OAAV,CAAkBjB,SAAS,CAACmB,MAA5B,EAAoCjB,WAApC,CAAgD,wBAAhD,EAA0EM,YAA1E,CAAuF,CAAC,CAAD,EAAI,EAAJ,CAAvF,CAlFkB;;AAmFhC;AACF;AACA;AACA;AACEa,EAAAA,SAAS,EAAErB,SAAS,CAACsB,KAAV,CACRpB,WADQ,CACI,gGADJ,EAERM,YAFQ,CAEK,CAFL,CAvFqB;;AA0FhC;AACF;AACA;AACEe,EAAAA,EAAE,EAAEvB,SAAS,CAACC,MAAV,CAAiBC,WAAjB,CAA6B,qCAA7B,EAAoEM,YAApE,CAAiF,EAAjF,CA7F4B;;AA8FhC;AACF;AACA;AACEgB,EAAAA,MAAM,EAAExB,SAAS,CAACyB,IAAV,CAAevB,WAAf,CAA2B,wDAA3B,EAAqFM,YAArF,CAAkG,UAAlG,CAjGwB;;AAkGhC;AACF;AACA;AACEkB,EAAAA,OAAO,EAAE1B,SAAS,CAACyB,IAAV,CACNvB,WADM,CACM,yDADN,EAENM,YAFM,CAEO,UAFP;AArGuB;;;;"}
1
+ {"version":3,"file":"propsTypes.js","sources":["../../../src/v3/propsTypes.tsx"],"sourcesContent":["import { PropTypes } from 'react-desc';\n\nexport const dsTooltipPropTypes = {\n /**\n * Tooltip text to be displayed on hover/focus\n */\n text: PropTypes.string.description('Tooltip text to be displayed on hover/focus').isRequired,\n /**\n * Tooltip text alignment\n */\n textAlign: PropTypes.oneOf(['left', 'right', 'center', 'justify', 'initial', 'inherit'])\n .description('Tooltip text alignment')\n .defaultValue('left'),\n /**\n * Element to tie the tooltip to, must be a single node\n */\n children: PropTypes.node.description('Element to tie the tooltip to, must be a single node').isRequired,\n /**\n * Wheter or not the tooltip content should appear in a DOM portal or not\n */\n withoutPortal: PropTypes.bool\n .description('Whether or not the tooltip content should appear in a DOM portal or not')\n .defaultValue(true),\n /**\n * Wheter or not the tooltip should use the arrow\n */\n withoutArrow: PropTypes.bool.description('Whether or not the tooltip should use the arrow').defaultValue(false),\n /**\n * Bounding element to calculate upon, defaults to it is \"clippingParents\",\n * which are the scrolling containers that may cause the element to be partially or fully cut off.\n */\n boundaryElement: PropTypes.element\n .description(\n 'Bounding element to calculate upon, defaults to \"clippingParents\",' +\n 'which are the scrolling containers that may cause element to be partially or fully cut off',\n )\n .defaultValue(undefined),\n /**\n * When using portal, the container in which to append the DOM content, defaults to document body\n */\n portalDOMContainer: PropTypes.element\n .description('When using portal, the container in which to append the DOM content, defaults to document body')\n .defaultValue(undefined),\n /**\n * start placement preferences, as per popperjs placement option\n */\n startPlacementPreference: PropTypes.oneOf([\n 'top-start',\n 'top',\n 'top-end',\n 'right-start',\n 'right',\n 'right-end',\n 'bottom-end',\n 'bottom',\n 'bottom-start',\n 'left-end',\n 'left',\n 'left-start',\n ])\n .description('start placement preferences, as per popperjs placement option')\n .defaultValue(\"'top'\"),\n /**\n * Array of placement preferences, as per popperjs \"flip\" placement option\n */\n placementOrderPreference: PropTypes.arrayOf(\n PropTypes.oneOf([\n 'top-start',\n 'top',\n 'top-end',\n 'right-start',\n 'right',\n 'right-end',\n 'bottom-end',\n 'bottom',\n 'bottom-start',\n 'left-end',\n 'left',\n 'left-start',\n ]),\n )\n .description('Array of placement preferences, as per popperjs \"flip\" placement option')\n .defaultValue(\"['top', 'bottom', 'left', 'right']\"),\n /**\n * tooltip wrapper z-index\n */\n zIndex: PropTypes.number.description('popperjs content z-index').defaultValue(1),\n /**\n * placement offset array\n */\n customOffset: PropTypes.arrayOf(PropTypes.number).description('placement offset array').defaultValue([0, 14]),\n /**\n * modifiers array for full-custom tooltip-js override\n * https://tooltip.js.org/docs/v2/modifiers/\n */\n modifiers: PropTypes.array\n .description('modifiers array for full-custom tooltip-js override, https://tooltip.js.org/docs/v2/modifiers/')\n .defaultValue(1),\n /**\n * Optional id appended to data-testid\n */\n id: PropTypes.string.description('Optional id appended to data-testid').defaultValue(''),\n /**\n * Optional callback to be invoked when the tooltip opens\n */\n onOpen: PropTypes.func.description('Optional callback to be invoked when the tooltip opens').defaultValue('() => {}'),\n /**\n * 'Optional callback to be invoked when the tooltip closes\n */\n onClose: PropTypes.func\n .description('Optional callback to be invoked when the tooltip closes')\n .defaultValue('() => {}'),\n};\n"],"names":["dsTooltipPropTypes","text","PropTypes","string","description","isRequired","textAlign","oneOf","defaultValue","children","node","withoutPortal","bool","withoutArrow","boundaryElement","element","undefined","portalDOMContainer","startPlacementPreference","placementOrderPreference","arrayOf","zIndex","number","customOffset","modifiers","array","id","onOpen","func","onClose"],"mappings":";;IAEaA,kBAAkB,GAAG;AAChC;AACF;AACA;AACEC,EAAAA,IAAI,EAAEC,SAAS,CAACC,MAAV,CAAiBC,WAAjB,CAA6B,6CAA7B,EAA4EC,UAJlD;;AAKhC;AACF;AACA;AACEC,EAAAA,SAAS,EAAEJ,SAAS,CAACK,KAAV,CAAgB,CAAC,MAAD,EAAS,OAAT,EAAkB,QAAlB,EAA4B,SAA5B,EAAuC,SAAvC,EAAkD,SAAlD,CAAhB,EACRH,WADQ,CACI,wBADJ,EAERI,YAFQ,CAEK,MAFL,CARqB;;AAWhC;AACF;AACA;AACEC,EAAAA,QAAQ,EAAEP,SAAS,CAACQ,IAAV,CAAeN,WAAf,CAA2B,sDAA3B,EAAmFC,UAd7D;;AAehC;AACF;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AAzD,CAAsE,CAAtE,CApFwB;;AAqFhC;AACF;AACA;AACEe,EAAAA,YAAY,EAAErB,SAAS,CAACkB,OAAV,CAAkBlB,SAAS,CAACoB,MAA5B,EAAoClB,WAApC,CAAgD,wBAAhD,EAA0EI,YAA1E,CAAuF,CAAC,CAAD,EAAI,EAAJ,CAAvF,CAxFkB;;AAyFhC;AACF;AACA;AACA;AACEgB,EAAAA,SAAS,EAAEtB,SAAS,CAACuB,KAAV,CACRrB,WADQ,CACI,gGADJ,EAERI,YAFQ,CAEK,CAFL,CA7FqB;;AAgGhC;AACF;AACA;AACEkB,EAAAA,EAAE,EAAExB,SAAS,CAACC,MAAV,CAAiBC,WAAjB,CAA6B,qCAA7B,EAAoEI,YAApE,CAAiF,EAAjF,CAnG4B;;AAoGhC;AACF;AACA;AACEmB,EAAAA,MAAM,EAAEzB,SAAS,CAAC0B,IAAV,CAAexB,WAAf,CAA2B,wDAA3B,EAAqFI,YAArF,CAAkG,UAAlG,CAvGwB;;AAwGhC;AACF;AACA;AACEqB,EAAAA,OAAO,EAAE3B,SAAS,CAAC0B,IAAV,CACNxB,WADM,CACM,yDADN,EAENI,YAFM,CAEO,UAFP;AA3GuB;;;;"}
package/esm/v3/styleds.js CHANGED
@@ -14,7 +14,16 @@ var StyledTooltipContainer = /*#__PURE__*/styled.div.withConfig({
14
14
  });
15
15
  var StyledTooltipText = /*#__PURE__*/styled.div.withConfig({
16
16
  componentId: "sc-18a4gem-1"
17
- })(["white-space:normal;word-wrap:break-word;display:inline-block;"]);
17
+ })(["white-space:normal;word-wrap:break-word;display:inline-block;text-align:", ";"], function (_ref4) {
18
+ var textAlign = _ref4.textAlign;
19
+ return textAlign;
20
+ });
21
+ var StyledMouseOverDetectionBox = /*#__PURE__*/styled.div.withConfig({
22
+ componentId: "sc-18a4gem-2"
23
+ })(["position:absolute;top:-15px;right:-15px;width:calc(100% + 30px);height:calc(100% + 30px);z-index:-1;"]);
24
+ var StyledTriggerWrapper = /*#__PURE__*/styled.div.withConfig({
25
+ componentId: "sc-18a4gem-3"
26
+ })(["display:inline-block;"]);
18
27
 
19
- export { StyledTooltipContainer, StyledTooltipText };
28
+ export { StyledMouseOverDetectionBox, StyledTooltipContainer, StyledTooltipText, StyledTriggerWrapper };
20
29
  //# sourceMappingURL=styleds.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"styleds.js","sources":["../../../src/v3/styleds.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nexport const StyledTooltipContainer = styled.div`\n text-align: center;\n min-width: ${({ theme }) => theme.space.l};\n max-width: 250px;\n min-height: 30px;\n display: grid;\n align-items: center;\n padding: ${({ theme }) => `${theme.space.xxxs} ${theme.space.xs}`};\n position: relative;\n background-color: white;\n border-radius: 2px;\n font-size: 13px;\n color: ${({ theme }) => theme.colors.neutral[600]};\n box-shadow: 0 1px 5px 0 rgb(0 0 0 / 13%), 0 2px 4px 0 rgb(0 0 0 / 20%);\n filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));\n transition: visibility 0.1s ease-in;\n`;\n\nexport const StyledTooltipText = styled.div`\n white-space: normal;\n word-wrap: break-word;\n display: inline-block;\n`;\n"],"names":["StyledTooltipContainer","styled","div","theme","space","l","xxxs","xs","colors","neutral","StyledTooltipText"],"mappings":";;IAEaA,sBAAsB,gBAAGC,MAAM,CAACC,GAAV;AAAA;AAAA,kWAEpB;AAAA,MAAGC,KAAH,QAAGA,KAAH;AAAA,SAAeA,KAAK,CAACC,KAAN,CAAYC,CAA3B;AAAA,CAFoB,EAOtB;AAAA,MAAGF,KAAH,SAAGA,KAAH;AAAA,mBAAkBA,KAAK,CAACC,KAAN,CAAYE,IAA9B,cAAsCH,KAAK,CAACC,KAAN,CAAYG,EAAlD;AAAA,CAPsB,EAYxB;AAAA,MAAGJ,KAAH,SAAGA,KAAH;AAAA,SAAeA,KAAK,CAACK,MAAN,CAAaC,OAAb,CAAqB,GAArB,CAAf;AAAA,CAZwB;IAkBtBC,iBAAiB,gBAAGT,MAAM,CAACC,GAAV;AAAA;AAAA;;;;"}
1
+ {"version":3,"file":"styleds.js","sources":["../../../src/v3/styleds.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nexport const StyledTooltipContainer = styled.div`\n text-align: center;\n min-width: ${({ theme }) => theme.space.l};\n max-width: 250px;\n min-height: 30px;\n display: grid;\n align-items: center;\n padding: ${({ theme }) => `${theme.space.xxxs} ${theme.space.xs}`};\n position: relative;\n background-color: white;\n border-radius: 2px;\n font-size: 13px;\n color: ${({ theme }) => theme.colors.neutral[600]};\n box-shadow: 0 1px 5px 0 rgb(0 0 0 / 13%), 0 2px 4px 0 rgb(0 0 0 / 20%);\n filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));\n transition: visibility 0.1s ease-in;\n`;\n\nexport const StyledTooltipText = styled.div<{ textAlign: string }>`\n white-space: normal;\n word-wrap: break-word;\n display: inline-block;\n text-align: ${({ textAlign }) => textAlign};\n`;\n\nexport const StyledMouseOverDetectionBox = styled.div`\n position: absolute;\n top: -15px;\n right: -15px;\n width: calc(100% + 30px);\n height: calc(100% + 30px);\n z-index: -1;\n`;\n\nexport const StyledTriggerWrapper = styled.div`\n display: inline-block;\n`;\n"],"names":["StyledTooltipContainer","styled","div","theme","space","l","xxxs","xs","colors","neutral","StyledTooltipText","textAlign","StyledMouseOverDetectionBox","StyledTriggerWrapper"],"mappings":";;IAEaA,sBAAsB,gBAAGC,MAAM,CAACC,GAAV;AAAA;AAAA,kWAEpB;AAAA,MAAGC,KAAH,QAAGA,KAAH;AAAA,SAAeA,KAAK,CAACC,KAAN,CAAYC,CAA3B;AAAA,CAFoB,EAOtB;AAAA,MAAGF,KAAH,SAAGA,KAAH;AAAA,mBAAkBA,KAAK,CAACC,KAAN,CAAYE,IAA9B,cAAsCH,KAAK,CAACC,KAAN,CAAYG,EAAlD;AAAA,CAPsB,EAYxB;AAAA,MAAGJ,KAAH,SAAGA,KAAH;AAAA,SAAeA,KAAK,CAACK,MAAN,CAAaC,OAAb,CAAqB,GAArB,CAAf;AAAA,CAZwB;IAkBtBC,iBAAiB,gBAAGT,MAAM,CAACC,GAAV;AAAA;AAAA,sFAId;AAAA,MAAGS,SAAH,SAAGA,SAAH;AAAA,SAAmBA,SAAnB;AAAA,CAJc;IAOjBC,2BAA2B,gBAAGX,MAAM,CAACC,GAAV;AAAA;AAAA;IAS3BW,oBAAoB,gBAAGZ,MAAM,CAACC,GAAV;AAAA;AAAA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-tooltip",
3
- "version": "1.57.0-rc.1",
3
+ "version": "1.57.0-rc.13",
4
4
  "license": "MIT",
5
5
  "description": "Ellie Mae - Dim Sum - Tooltip",
6
6
  "module": "esm/index.js",
@@ -16,13 +16,14 @@
16
16
  "build": "node ../../scripts/build/build.js"
17
17
  },
18
18
  "dependencies": {
19
- "@elliemae/ds-basic": "1.57.0-rc.1",
20
- "@elliemae/ds-classnames": "1.57.0-rc.1",
21
- "@elliemae/ds-popper": "1.57.0-rc.1",
22
- "@elliemae/ds-portal": "1.57.0-rc.1",
23
- "@elliemae/ds-shared": "1.57.0-rc.1",
24
- "@elliemae/ds-system": "1.57.0-rc.1",
25
- "@elliemae/ds-utilities": "1.57.0-rc.1",
19
+ "@elliemae/ds-basic": "1.57.0-rc.13",
20
+ "@elliemae/ds-classnames": "1.57.0-rc.13",
21
+ "@elliemae/ds-popper": "1.57.0-rc.13",
22
+ "@elliemae/ds-popperjs": "1.57.0-rc.13",
23
+ "@elliemae/ds-portal": "1.57.0-rc.13",
24
+ "@elliemae/ds-shared": "1.57.0-rc.13",
25
+ "@elliemae/ds-system": "1.57.0-rc.13",
26
+ "@elliemae/ds-utilities": "1.57.0-rc.13",
26
27
  "@popperjs/core": "2.9.2",
27
28
  "react-desc": "^4.1.2",
28
29
  "react-popper": "2.2.5"