@elliemae/ds-tooltip 3.0.0-alpha.0 → 3.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/cjs/v1/DSTooltip.js +65 -22
  2. package/dist/cjs/v1/DSTooltip.js.map +1 -1
  3. package/dist/cjs/v2/DSTooltip.js +21 -6
  4. package/dist/cjs/v2/DSTooltip.js.map +1 -1
  5. package/dist/cjs/v3/DSTooltipV3.js +138 -0
  6. package/dist/cjs/v3/DSTooltipV3.js.map +7 -0
  7. package/dist/cjs/v3/constants.js +50 -0
  8. package/dist/cjs/v3/constants.js.map +7 -0
  9. package/dist/cjs/v3/{config/useWithDefaultProps.js → defaultProps.js} +7 -8
  10. package/dist/cjs/v3/defaultProps.js.map +7 -0
  11. package/dist/cjs/v3/index.js +2 -88
  12. package/dist/cjs/v3/index.js.map +2 -2
  13. package/dist/cjs/v3/{propsTypes.js → propTypes.js} +11 -35
  14. package/dist/cjs/v3/propTypes.js.map +7 -0
  15. package/dist/cjs/v3/{styleds.js → styles.js} +6 -6
  16. package/dist/cjs/v3/styles.js.map +7 -0
  17. package/dist/cjs/v3/{index.d.js → utils.js} +17 -3
  18. package/dist/cjs/v3/utils.js.map +7 -0
  19. package/dist/esm/v1/DSTooltip.js +67 -22
  20. package/dist/esm/v1/DSTooltip.js.map +1 -1
  21. package/dist/esm/v2/DSTooltip.js +23 -6
  22. package/dist/esm/v2/DSTooltip.js.map +1 -1
  23. package/dist/esm/v3/DSTooltipV3.js +111 -0
  24. package/dist/esm/v3/DSTooltipV3.js.map +7 -0
  25. package/dist/esm/v3/constants.js +21 -0
  26. package/dist/esm/v3/constants.js.map +7 -0
  27. package/dist/esm/v3/defaultProps.js +14 -0
  28. package/dist/esm/v3/defaultProps.js.map +7 -0
  29. package/dist/esm/v3/index.js +2 -89
  30. package/dist/esm/v3/index.js.map +2 -2
  31. package/dist/esm/v3/{propsTypes.js → propTypes.js} +8 -32
  32. package/dist/esm/v3/propTypes.js.map +7 -0
  33. package/dist/esm/v3/{styleds.js → styles.js} +3 -3
  34. package/dist/esm/v3/styles.js.map +7 -0
  35. package/dist/esm/v3/utils.js +12 -0
  36. package/dist/esm/v3/utils.js.map +7 -0
  37. package/package.json +11 -10
  38. package/dist/cjs/v3/config/useWithDefaultProps.js.map +0 -7
  39. package/dist/cjs/v3/index.d.js.map +0 -7
  40. package/dist/cjs/v3/propsTypes.js.map +0 -7
  41. package/dist/cjs/v3/styleds.js.map +0 -7
  42. package/dist/esm/v3/config/useWithDefaultProps.js +0 -15
  43. package/dist/esm/v3/config/useWithDefaultProps.js.map +0 -7
  44. package/dist/esm/v3/index.d.js +0 -2
  45. package/dist/esm/v3/index.d.js.map +0 -7
  46. package/dist/esm/v3/propsTypes.js.map +0 -7
  47. package/dist/esm/v3/styleds.js.map +0 -7
  48. package/dist/types/index.d.ts +0 -6
  49. package/dist/types/v1/DSTooltip.d.ts +0 -89
  50. package/dist/types/v1/TooltipType.d.ts +0 -4
  51. package/dist/types/v2/DSTooltip.d.ts +0 -70
  52. package/dist/types/v2/DSTooltipArrow.d.ts +0 -4
  53. package/dist/types/v2/TooltipType.d.ts +0 -5
  54. package/dist/types/v2/propTypes.d.ts +0 -60
  55. package/dist/types/v2/styles.d.ts +0 -7
  56. package/dist/types/v2/tests/DSTooltipV2.test.d.ts +0 -1
  57. package/dist/types/v2/utils/setMultipleRefs.d.ts +0 -1
  58. package/dist/types/v2/utils/tooltipPositions.d.ts +0 -15
  59. package/dist/types/v3/TooltipV3DatatestId.d.ts +0 -4
  60. package/dist/types/v3/config/useWithDefaultProps.d.ts +0 -2
  61. package/dist/types/v3/index.d.ts +0 -6
  62. package/dist/types/v3/propsTypes.d.ts +0 -103
  63. package/dist/types/v3/styleds.d.ts +0 -6
@@ -1,91 +1,4 @@
1
1
  import * as React from "react";
2
- import React2, { useState, useCallback, useEffect } from "react";
3
- import { DSPopperJS } from "@elliemae/ds-popperjs";
4
- import { describe } from "react-desc";
5
- import { dsTooltipPropTypes } from "./propsTypes";
6
- import { useWithDefaultProps } from "./config/useWithDefaultProps";
7
- import { TooltipV3DatatestId } from "./TooltipV3DatatestId";
8
- import {
9
- StyledTooltipContainer,
10
- StyledTooltipText,
11
- StyledMouseOverDetectionBox,
12
- StyledTriggerWrapper
13
- } from "./styleds";
14
- const useGlobalKeyboardListener = (func) => {
15
- useEffect(() => {
16
- document.addEventListener("keydown", func);
17
- return () => document.removeEventListener("keydown", func);
18
- }, [func]);
19
- };
20
- const DSTooltipV3 = (props) => {
21
- const { text, children, onOpen, onClose, id, textAlign, ...extraPopperJsProps } = useWithDefaultProps(props);
22
- const [isFocused, setIsFocused] = useState(false);
23
- const [isHover, setIsHover] = useState(false);
24
- const [latestOpenInteraction, setLatestOpenInteraction] = useState("");
25
- const [referenceElement, setReferenceElement] = useState();
26
- const [showPopover, setShowPopover] = useState(false);
27
- const showTooltip = useCallback(() => {
28
- setShowPopover(true);
29
- onOpen();
30
- }, [onOpen]);
31
- const hideTooltip = useCallback(() => {
32
- setShowPopover(false);
33
- onClose();
34
- }, [onClose]);
35
- const onFocus = useCallback(() => {
36
- setIsFocused(true);
37
- if (!showPopover) {
38
- showTooltip();
39
- setLatestOpenInteraction("onFocus");
40
- }
41
- }, [showPopover, showTooltip]);
42
- const onBlur = useCallback(() => {
43
- setIsFocused(false);
44
- if (!isHover || latestOpenInteraction === "onFocus")
45
- hideTooltip();
46
- }, [hideTooltip, isHover, latestOpenInteraction]);
47
- const onMouseEnter = useCallback(() => {
48
- setIsHover(true);
49
- if (!showPopover) {
50
- showTooltip();
51
- setLatestOpenInteraction("onMouseEnter");
52
- }
53
- }, [showPopover, showTooltip]);
54
- const onMouseLeave = useCallback(() => {
55
- setIsHover(false);
56
- if (!isFocused || latestOpenInteraction === "onMouseEnter")
57
- hideTooltip();
58
- }, [hideTooltip, isFocused, latestOpenInteraction]);
59
- const handleEscKey = useCallback(({ key }) => {
60
- if (key === "Escape")
61
- hideTooltip();
62
- }, [hideTooltip]);
63
- useGlobalKeyboardListener(handleEscKey);
64
- return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(StyledTriggerWrapper, {
65
- onMouseEnter,
66
- onMouseLeave,
67
- onFocus,
68
- onBlur,
69
- ref: setReferenceElement,
70
- "data-testid": `${TooltipV3DatatestId.TRIGGER_WRAPPER}${id !== "" ? `_${id}` : ""}`
71
- }, /* @__PURE__ */ React2.createElement(DSPopperJS, {
72
- referenceElement,
73
- showPopover,
74
- withoutPortal: true,
75
- ...extraPopperJsProps
76
- }, /* @__PURE__ */ React2.createElement("div", {
77
- "data-testid": `${TooltipV3DatatestId.TOOLTIP_TEXT_WRAPPER}${id !== "" ? `_${id}` : ""}`
78
- }, /* @__PURE__ */ React2.createElement(StyledTooltipContainer, null, /* @__PURE__ */ React2.createElement(StyledTooltipText, {
79
- textAlign
80
- }, text), /* @__PURE__ */ React2.createElement(StyledMouseOverDetectionBox, null)))), children));
81
- };
82
- DSTooltipV3.propTypes = dsTooltipPropTypes;
83
- const DSTooltipV3WithSchema = describe(DSTooltipV3).description("A tooltip component");
84
- DSTooltipV3WithSchema.propTypes = dsTooltipPropTypes;
85
- var v3_default = DSTooltipV3;
86
- export {
87
- DSTooltipV3,
88
- DSTooltipV3WithSchema,
89
- v3_default as default
90
- };
2
+ export * from "./DSTooltipV3";
3
+ export * from "./TooltipV3DatatestId";
91
4
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/v3/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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 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 <StyledTriggerWrapper\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onFocus={onFocus}\n onBlur={onBlur}\n ref={setReferenceElement}\n data-testid={`${TooltipV3DatatestId.TRIGGER_WRAPPER}${id !== '' ? `_${id}` : ''}`}\n >\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\n {children}\n </StyledTriggerWrapper>\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"],
5
- "mappings": "AAAA;ACCA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,MAAM,4BAA4B,CAAC,SAAS;AAC1C,YAAU,MAAM;AACd,aAAS,iBAAiB,WAAW;AACrC,WAAO,MAAM,SAAS,oBAAoB,WAAW;AAAA,KACpD,CAAC;AAAA;AAGN,MAAM,cAAoD,CAAC,UAAU;AACnE,QAAM,EAAE,MAAM,UAAU,QAAQ,SAAS,IAAI,cAAc,uBAAuB,oBAAoB;AAEtG,QAAM,CAAC,WAAW,gBAAgB,SAAS;AAC3C,QAAM,CAAC,SAAS,cAAc,SAAS;AACvC,QAAM,CAAC,uB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Y,YAAY;AAExB,MAAM,wBAAwB,SAAS,aAAa,YAAY;AAChE,sBAAsB,YAAY;AAGlC,IAAO,aAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSTooltipV3';\nexport * from './TooltipV3DatatestId';\n"],
5
+ "mappings": "AAAA;ACAA;AACA;",
6
6
  "names": []
7
7
  }
@@ -1,8 +1,10 @@
1
1
  import * as React from "react";
2
2
  import { PropTypes } from "react-desc";
3
- const dsTooltipPropTypes = {
3
+ import { PLACEMENT, TEXT_ALIGNMENT } from "./constants";
4
+ const propTypes = {
4
5
  text: PropTypes.string.description("Tooltip text to be displayed on hover/focus").isRequired,
5
- textAlign: PropTypes.oneOf(["left", "right", "center", "justify", "initial", "inherit"]).description("Tooltip text alignment").defaultValue("left"),
6
+ textAlign: PropTypes.oneOf(TEXT_ALIGNMENT).description("Tooltip text alignment").defaultValue("left"),
7
+ wrapWords: PropTypes.bool.description("Break words into a new line. Useful when words exceed tooltip max-lenght.").defaultValue(false),
6
8
  children: PropTypes.node.description("Element to tie the tooltip to, must be a single node").isRequired,
7
9
  withoutPortal: PropTypes.bool.description("Whether or not the tooltip content should appear in a DOM portal or not").defaultValue(true),
8
10
  withoutArrow: PropTypes.bool.description("Whether or not the tooltip should use the arrow").defaultValue(false),
@@ -10,34 +12,8 @@ const dsTooltipPropTypes = {
10
12
  withoutAnimation: PropTypes.bool.description("Whether or not the popper context menu should be animated").defaultValue(false),
11
13
  animationDuration: PropTypes.number.description("Popper context menus Animation duration in ms").defaultValue(100),
12
14
  portalDOMContainer: PropTypes.element.description("When using portal, the container in which to append the DOM content, defaults to document body").defaultValue(void 0),
13
- startPlacementPreference: PropTypes.oneOf([
14
- "top-start",
15
- "top",
16
- "top-end",
17
- "right-start",
18
- "right",
19
- "right-end",
20
- "bottom-end",
21
- "bottom",
22
- "bottom-start",
23
- "left-end",
24
- "left",
25
- "left-start"
26
- ]).description("start placement preferences, as per popperjs placement option").defaultValue("'top'"),
27
- placementOrderPreference: PropTypes.arrayOf(PropTypes.oneOf([
28
- "top-start",
29
- "top",
30
- "top-end",
31
- "right-start",
32
- "right",
33
- "right-end",
34
- "bottom-end",
35
- "bottom",
36
- "bottom-start",
37
- "left-end",
38
- "left",
39
- "left-start"
40
- ])).description('Array of placement preferences, as per popperjs "flip" placement option').defaultValue("['top', 'bottom', 'left', 'right']"),
15
+ startPlacementPreference: PropTypes.oneOf(PLACEMENT).description("start placement preferences, as per popperjs placement option").defaultValue("'top'"),
16
+ placementOrderPreference: PropTypes.arrayOf(PropTypes.oneOf(PLACEMENT)).description('Array of placement preferences, as per popperjs "flip" placement option').defaultValue("['top', 'bottom', 'left', 'right']"),
41
17
  zIndex: PropTypes.number.description("popperjs content z-index").defaultValue(1),
42
18
  customOffset: PropTypes.arrayOf(PropTypes.number).description("placement offset array").defaultValue([0, 14]),
43
19
  modifiers: PropTypes.array.description("modifiers array for full-custom tooltip-js override, https://tooltip.js.org/docs/v2/modifiers/").defaultValue(1),
@@ -46,6 +22,6 @@ const dsTooltipPropTypes = {
46
22
  onClose: PropTypes.func.description("Optional callback to be invoked when the tooltip closes").defaultValue("() => {}")
47
23
  };
48
24
  export {
49
- dsTooltipPropTypes
25
+ propTypes
50
26
  };
51
- //# sourceMappingURL=propsTypes.js.map
27
+ //# sourceMappingURL=propTypes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/v3/propTypes.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from 'react-desc';\nimport { PLACEMENT, TEXT_ALIGNMENT } from './constants';\n\nexport declare namespace DSTooltipV3T {\n export type Placement = typeof PLACEMENT[number];\n export type TextAlignment = typeof TEXT_ALIGNMENT[number];\n\n export interface DefaultProps {\n onOpen: () => void;\n onClose: () => void;\n id: string;\n textAlign: TextAlignment;\n wrapWords: boolean;\n }\n\n export interface PropsOptional {\n zIndex?: number;\n withoutPortal?: boolean;\n withoutArrow?: boolean;\n withoutAnimation?: boolean;\n boundaryElement?: React.ReactNode;\n animationDuraction?: number;\n portalDOMContainer?: React.ReactNode;\n startPlacementPreference?: Placement;\n placementOrderPreference?: Placement;\n customOffset?: [number, number];\n modifiers?: Record<string, unknown>[];\n }\n\n export interface PropsRequired {\n children: React.ReactNode;\n text: string;\n }\n\n export interface Props extends Partial<DefaultProps>, PropsRequired, PropsOptional {}\n\n export interface InternalProps extends DefaultProps, PropsRequired, PropsOptional {}\n}\n\nexport const propTypes = {\n text: PropTypes.string.description('Tooltip text to be displayed on hover/focus').isRequired,\n textAlign: PropTypes.oneOf(TEXT_ALIGNMENT as unknown as unknown[])\n .description('Tooltip text alignment')\n .defaultValue('left'),\n wrapWords: PropTypes.bool\n .description('Break words into a new line. Useful when words exceed tooltip max-lenght.')\n .defaultValue(false),\n children: PropTypes.node.description('Element to tie the tooltip to, must be a single node').isRequired,\n withoutPortal: PropTypes.bool\n .description('Whether or not the tooltip content should appear in a DOM portal or not')\n .defaultValue(true),\n withoutArrow: PropTypes.bool.description('Whether or not the tooltip should use the arrow').defaultValue(false),\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 withoutAnimation: PropTypes.bool\n .description('Whether or not the popper context menu should be animated')\n .defaultValue(false),\n animationDuration: PropTypes.number.description('Popper context menus Animation duration in ms').defaultValue(100),\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 startPlacementPreference: PropTypes.oneOf(PLACEMENT as unknown as unknown[])\n .description('start placement preferences, as per popperjs placement option')\n .defaultValue(\"'top'\"),\n placementOrderPreference: PropTypes.arrayOf(PropTypes.oneOf(PLACEMENT as unknown as unknown[]))\n .description('Array of placement preferences, as per popperjs \"flip\" placement option')\n .defaultValue(\"['top', 'bottom', 'left', 'right']\"),\n zIndex: PropTypes.number.description('popperjs content z-index').defaultValue(1),\n customOffset: PropTypes.arrayOf(PropTypes.number).description('placement offset array').defaultValue([0, 14]),\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 id: PropTypes.string.description('Optional id appended to data-testid').defaultValue(''),\n onOpen: PropTypes.func.description('Optional callback to be invoked when the tooltip opens').defaultValue('() => {}'),\n onClose: PropTypes.func\n .description('Optional callback to be invoked when the tooltip closes')\n .defaultValue('() => {}'),\n};\n"],
5
+ "mappings": "AAAA;ACAA;AACA;AAsCO,MAAM,YAAY;AAAA,EACvB,MAAM,UAAU,OAAO,YAAY,+CAA+C;AAAA,EAClF,WAAW,UAAU,MAAM,gBACxB,YAAY,0BACZ,aAAa;AAAA,EAChB,WAAW,UAAU,KAClB,YAAY,6EACZ,aAAa;AAAA,EAChB,UAAU,UAAU,KAAK,YAAY,wDAAwD;AAAA,EAC7F,eAAe,UAAU,KACtB,YAAY,2EACZ,aAAa;AAAA,EAChB,cAAc,UAAU,KAAK,YAAY,mDAAmD,aAAa;AAAA,EACzG,iBAAiB,UAAU,QACxB,YACC,gKAGD,aAAa;AAAA,EAChB,kBAAkB,UAAU,KACzB,YAAY,6DACZ,aAAa;AAAA,EAChB,mBAAmB,UAAU,OAAO,YAAY,iDAAiD,aAAa;AAAA,EAC9G,oBAAoB,UAAU,QAC3B,YAAY,kGACZ,aAAa;AAAA,EAChB,0BAA0B,UAAU,MAAM,WACvC,YAAY,iEACZ,aAAa;AAAA,EAChB,0BAA0B,UAAU,QAAQ,UAAU,MAAM,YACzD,YAAY,2EACZ,aAAa;AAAA,EAChB,QAAQ,UAAU,OAAO,YAAY,4BAA4B,aAAa;AAAA,EAC9E,cAAc,UAAU,QAAQ,UAAU,QAAQ,YAAY,0BAA0B,aAAa,CAAC,GAAG;AAAA,EACzG,WAAW,UAAU,MAClB,YAAY,kGACZ,aAAa;AAAA,EAChB,IAAI,UAAU,OAAO,YAAY,uCAAuC,aAAa;AAAA,EACrF,QAAQ,UAAU,KAAK,YAAY,0DAA0D,aAAa;AAAA,EAC1G,SAAS,UAAU,KAChB,YAAY,2DACZ,aAAa;AAAA;",
6
+ "names": []
7
+ }
@@ -15,10 +15,10 @@ const StyledTooltipContainer = styled.div`
15
15
  color: ${({ theme }) => theme.colors.neutral[600]};
16
16
  `;
17
17
  const StyledTooltipText = styled.div`
18
- white-space: normal;
19
- word-wrap: break-word;
20
18
  display: inline-block;
21
19
  text-align: ${({ textAlign }) => textAlign};
20
+ word-wrap: break-word;
21
+ ${({ wrapWords }) => wrapWords ? `word-break: break-all;` : `white-space: normal;`}
22
22
  `;
23
23
  const StyledMouseOverDetectionBox = styled.div`
24
24
  position: absolute;
@@ -38,4 +38,4 @@ export {
38
38
  StyledTooltipText,
39
39
  StyledTriggerWrapper
40
40
  };
41
- //# sourceMappingURL=styleds.js.map
41
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/v3/styles.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import styled from 'styled-components';\nimport type { DSTooltipV3T } from './propTypes';\n\ninterface StyledTooltipTextT {\n wrapWords: boolean;\n textAlign: DSTooltipV3T.TextAlignment;\n}\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`;\n\nexport const StyledTooltipText = styled.div<StyledTooltipTextT>`\n display: inline-block;\n text-align: ${({ textAlign }) => textAlign};\n word-wrap: break-word;\n ${({ wrapWords }) => (wrapWords ? `word-break: break-all;` : `white-space: normal;`)}\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-flex;\n width: 100%;\n`;\n"],
5
+ "mappings": "AAAA;ACAA;AAQO,MAAM,yBAAyB,OAAO;AAAA;AAAA,eAE9B,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,aAK7B,CAAC,EAAE,YAAY,GAAG,MAAM,MAAM,QAAQ,MAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,WAKpD,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAGxC,MAAM,oBAAoB,OAAO;AAAA;AAAA,gBAExB,CAAC,EAAE,gBAAgB;AAAA;AAAA,IAE/B,CAAC,EAAE,gBAAiB,YAAY,2BAA2B;AAAA;AAGxD,MAAM,8BAA8B,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS3C,MAAM,uBAAuB,OAAO;AAAA;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ import { useEffect } from "react";
3
+ const useGlobalKeyboardListener = (func) => {
4
+ useEffect(() => {
5
+ document.addEventListener("keydown", func);
6
+ return () => document.removeEventListener("keydown", func);
7
+ }, [func]);
8
+ };
9
+ export {
10
+ useGlobalKeyboardListener
11
+ };
12
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/v3/utils.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useEffect } from 'react';\n\nexport const useGlobalKeyboardListener = (func: ({ key }: { key: string }) => void) => {\n useEffect(() => {\n document.addEventListener('keydown', func);\n return () => document.removeEventListener('keydown', func);\n }, [func]);\n};\n"],
5
+ "mappings": "AAAA;ACAA;AAEO,MAAM,4BAA4B,CAAC,SAA6C;AACrF,YAAU,MAAM;AACd,aAAS,iBAAiB,WAAW;AACrC,WAAO,MAAM,SAAS,oBAAoB,WAAW;AAAA,KACpD,CAAC;AAAA;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-tooltip",
3
- "version": "3.0.0-alpha.0",
3
+ "version": "3.0.0-alpha.1",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Tooltip",
6
6
  "files": [
@@ -95,15 +95,15 @@
95
95
  "indent": 4
96
96
  },
97
97
  "dependencies": {
98
- "@elliemae/ds-button": "3.0.0-alpha.0",
99
- "@elliemae/ds-classnames": "3.0.0-alpha.0",
100
- "@elliemae/ds-popper": "3.0.0-alpha.0",
101
- "@elliemae/ds-popperjs": "3.0.0-alpha.0",
102
- "@elliemae/ds-portal": "3.0.0-alpha.0",
103
- "@elliemae/ds-props-helpers": "3.0.0-alpha.0",
104
- "@elliemae/ds-shared": "3.0.0-alpha.0",
105
- "@elliemae/ds-system": "3.0.0-alpha.0",
106
- "@elliemae/ds-utilities": "3.0.0-alpha.0",
98
+ "@elliemae/ds-button": "3.0.0-alpha.1",
99
+ "@elliemae/ds-classnames": "3.0.0-alpha.1",
100
+ "@elliemae/ds-popper": "3.0.0-alpha.1",
101
+ "@elliemae/ds-popperjs": "3.0.0-alpha.1",
102
+ "@elliemae/ds-portal": "3.0.0-alpha.1",
103
+ "@elliemae/ds-props-helpers": "3.0.0-alpha.1",
104
+ "@elliemae/ds-shared": "3.0.0-alpha.1",
105
+ "@elliemae/ds-system": "3.0.0-alpha.1",
106
+ "@elliemae/ds-utilities": "3.0.0-alpha.1",
107
107
  "@popperjs/core": "~2.9.3",
108
108
  "react-desc": "~4.1.3",
109
109
  "react-popper": "~2.2.5"
@@ -129,6 +129,7 @@
129
129
  "dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
130
130
  "test": "node ../../scripts/testing/test.mjs",
131
131
  "lint": "node ../../scripts/lint.mjs",
132
+ "dts": "node ../../scripts/dts.mjs",
132
133
  "build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
133
134
  }
134
135
  }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/v3/config/useWithDefaultProps.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "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", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA6C;AAI7C,MAAM,OAAO,MAAM;AAAA;AAEnB,MAAM,eAAe;AAAA,EACnB,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,IAAI;AAAA,EACJ,WAAW;AAAA;AAGN,MAAM,sBAAsB,CAAC,UAClC,0DAA6B,OAAO;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/v3/index.d.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["export type PopperPlacementsT =\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\nexport interface TooltipV3PropsT {\n text: string;\n textAlign: 'left' | 'right' | 'center' | 'justify' | 'initial' | 'inherit';\n children: React.ReactElement;\n withoutPortal?: boolean;\n withoutArrow?: boolean;\n withoutAnimation?: boolean;\n boundaryElement?: HTMLElement;\n portalDOMContainer?: HTMLElement;\n placementOrderPreference?: PopperPlacementsT[];\n startPlacementPreference?: PopperPlacementsT;\n modifiers?: Record<string, unknown>[];\n customOffset?: [number, number];\n zIndex?: number;\n onOpen?: () => void;\n onClose?: () => void;\n id?: string;\n}\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA,YAAuB;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/v3/propsTypes.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "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 * Whether or not the popper context menu should be animated\n */\n withoutAnimation: PropTypes.bool\n .description('Whether or not the popper context menu should be animated')\n .defaultValue(false),\n /**\n * Popper context menus Animation duration in ms\n */\n animationDuration: PropTypes.number.description('Popper context menus Animation duration in ms').defaultValue(100),\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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G,WAAW,4BAAU,MAClB,YAAY,kGACZ,aAAa;AAAA,EAIhB,IAAI,4BAAU,OAAO,YAAY,uCAAuC,aAAa;AAAA,EAIrF,QAAQ,4BAAU,KAAK,YAAY,0DAA0D,aAAa;AAAA,EAI1G,SAAS,4BAAU,KAChB,YAAY,2DACZ,aAAa;AAAA;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/v3/styleds.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "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`;\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-flex;\n width: 100%;\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,+BAAmB;AAEZ,MAAM,yBAAyB,iCAAO;AAAA;AAAA,eAE9B,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,aAK7B,CAAC,EAAE,YAAY,GAAG,MAAM,MAAM,QAAQ,MAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,WAKpD,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAGxC,MAAM,oBAAoB,iCAAO;AAAA;AAAA;AAAA;AAAA,gBAIxB,CAAC,EAAE,gBAAgB;AAAA;AAG5B,MAAM,8BAA8B,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS3C,MAAM,uBAAuB,iCAAO;AAAA;AAAA;AAAA;",
6
- "names": []
7
- }
@@ -1,15 +0,0 @@
1
- import * as React from "react";
2
- import { useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
3
- const noop = () => {
4
- };
5
- const defaultProps = {
6
- onOpen: noop,
7
- onClose: noop,
8
- id: "",
9
- textAlign: "left"
10
- };
11
- const useWithDefaultProps = (props) => useMemoMergePropsWithDefault(props, defaultProps);
12
- export {
13
- useWithDefaultProps
14
- };
15
- //# sourceMappingURL=useWithDefaultProps.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/v3/config/useWithDefaultProps.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
5
- "mappings": "AAAA;ACAA;AAIA,MAAM,OAAO,MAAM;AAAA;AAEnB,MAAM,eAAe;AAAA,EACnB,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,IAAI;AAAA,EACJ,WAAW;AAAA;AAGN,MAAM,sBAAsB,CAAC,UAClC,6BAA6B,OAAO;",
6
- "names": []
7
- }
@@ -1,2 +0,0 @@
1
- import * as React from "react";
2
- //# sourceMappingURL=index.d.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n"],
5
- "mappings": "AAAA;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/v3/propsTypes.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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 * Whether or not the popper context menu should be animated\n */\n withoutAnimation: PropTypes.bool\n .description('Whether or not the popper context menu should be animated')\n .defaultValue(false),\n /**\n * Popper context menus Animation duration in ms\n */\n animationDuration: PropTypes.number.description('Popper context menus Animation duration in ms').defaultValue(100),\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"],
5
- "mappings": "AAAA;ACAA;AAEO,MAAM,qBAAqB;AAAA,EAIhC,MAAM,UAAU,OAAO,YAAY,+CAA+C;AAAA,EAIlF,WAAW,UAAU,MAAM,CAAC,QAAQ,SAA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/transpile/react-shim.js", "../../../src/v3/styleds.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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`;\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-flex;\n width: 100%;\n`;\n"],
5
- "mappings": "AAAA;ACAA;AAEO,MAAM,yBAAyB,OAAO;AAAA;AAAA,eAE9B,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,aAK7B,CAAC,EAAE,YAAY,GAAG,MAAM,MAAM,QAAQ,MAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,WAKpD,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAGxC,MAAM,oBAAoB,OAAO;AAAA;AAAA;AAAA;AAAA,gBAIxB,CAAC,EAAE,gBAAgB;AAAA;AAG5B,MAAM,8BAA8B,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS3C,MAAM,uBAAuB,OAAO;AAAA;AAAA;AAAA;",
6
- "names": []
7
- }
@@ -1,6 +0,0 @@
1
- export * from './v1/DSTooltip';
2
- export * from './v2/DSTooltip';
3
- export { tooltipPositions } from './v2/utils/tooltipPositions';
4
- export * from './v2/TooltipType';
5
- export * from './v3';
6
- export { default } from './v1/DSTooltip';
@@ -1,89 +0,0 @@
1
- /// <reference path="../../../../../shared/typings/react-desc.d.ts" />
2
- import React from 'react';
3
- declare const TooltipContainer: React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
4
- declare const TooltipText: React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
5
- declare const DSTooltip: {
6
- ({ containerProps, innerRef, placement, title, delayClose, delayOpen, interactionType, triggerComponent, className, isOpen, onOpen, springAnimationComponent, tooltipType, showArrow, zIndex, ...otherTooltipProps }: {
7
- [x: string]: any;
8
- containerProps?: {} | undefined;
9
- innerRef: any;
10
- placement?: string | undefined;
11
- title?: string | undefined;
12
- delayClose?: any;
13
- delayOpen?: any;
14
- interactionType?: string | undefined;
15
- triggerComponent?: null | undefined;
16
- className?: string | undefined;
17
- isOpen?: undefined;
18
- onOpen?: (() => null) | undefined;
19
- springAnimationComponent?: undefined;
20
- tooltipType?: string | undefined;
21
- showArrow?: boolean | undefined;
22
- zIndex: any;
23
- }): JSX.Element;
24
- propTypes: {
25
- containerProps: {
26
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
27
- deprecated: import("react-desc").PropTypesDescValidator;
28
- };
29
- isRequired: import("react-desc").PropTypesDescValue;
30
- };
31
- placement: {
32
- deprecated: import("react-desc").PropTypesDescValidator;
33
- };
34
- title: import("react-desc").PropTypesDescValue;
35
- delayClose: {
36
- deprecated: import("react-desc").PropTypesDescValidator;
37
- };
38
- delayOpen: {
39
- deprecated: import("react-desc").PropTypesDescValidator;
40
- };
41
- interactionType: {
42
- deprecated: import("react-desc").PropTypesDescValidator;
43
- };
44
- triggerComponent: import("react-desc").PropTypesDescValue;
45
- isOpen: {
46
- deprecated: import("react-desc").PropTypesDescValidator;
47
- };
48
- onOpen: {
49
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
50
- deprecated: import("react-desc").PropTypesDescValidator;
51
- };
52
- isRequired: import("react-desc").PropTypesDescValue;
53
- };
54
- springAnimationComponent: {
55
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
56
- deprecated: import("react-desc").PropTypesDescValidator;
57
- };
58
- isRequired: import("react-desc").PropTypesDescValue;
59
- };
60
- showArrow: {
61
- deprecated: import("react-desc").PropTypesDescValidator;
62
- };
63
- className: {
64
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
65
- deprecated: import("react-desc").PropTypesDescValidator;
66
- };
67
- isRequired: import("react-desc").PropTypesDescValue;
68
- };
69
- tooltipType: {
70
- deprecated: import("react-desc").PropTypesDescValidator;
71
- };
72
- zIndex: {
73
- deprecated: import("react-desc").PropTypesDescValidator;
74
- };
75
- innerRef: {
76
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
77
- deprecated: import("react-desc").PropTypesDescValidator;
78
- };
79
- isRequired: import("react-desc").PropTypesDescValue;
80
- };
81
- };
82
- };
83
- declare const TooltipWithSchema: {
84
- (props?: unknown): JSX.Element;
85
- propTypes: unknown;
86
- toTypescript: () => import("react-desc").TypescriptSchema;
87
- };
88
- export { DSTooltip, TooltipContainer, TooltipText, TooltipWithSchema };
89
- export default DSTooltip;
@@ -1,4 +0,0 @@
1
- export declare const TooltipType: {
2
- TOOLTIP: string;
3
- TOOLBAR: string;
4
- };
@@ -1,70 +0,0 @@
1
- /// <reference path="../../../../../shared/typings/react-desc.d.ts" />
2
- import React from 'react';
3
- import { DSTooltipT } from '.';
4
- declare const DSTooltipV2: {
5
- ({ containerProps, innerRef, placement, title, delayClose, delayOpen, triggerComponent, className, getIsOpen, onOpen, tooltipType, showArrow, offset, zIndex, extraModifiers, }: DSTooltipT): React.ReactElement;
6
- propTypes: {
7
- containerProps: {
8
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
9
- deprecated: import("react-desc").PropTypesDescValidator;
10
- };
11
- isRequired: import("react-desc").PropTypesDescValue;
12
- };
13
- placement: {
14
- deprecated: import("react-desc").PropTypesDescValidator;
15
- };
16
- title: import("react-desc").PropTypesDescValue;
17
- delayClose: {
18
- deprecated: import("react-desc").PropTypesDescValidator;
19
- };
20
- delayOpen: {
21
- deprecated: import("react-desc").PropTypesDescValidator;
22
- };
23
- triggerComponent: import("react-desc").PropTypesDescValue;
24
- getIsOpen: {
25
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
26
- deprecated: import("react-desc").PropTypesDescValidator;
27
- };
28
- isRequired: import("react-desc").PropTypesDescValue;
29
- };
30
- onOpen: {
31
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
32
- deprecated: import("react-desc").PropTypesDescValidator;
33
- };
34
- isRequired: import("react-desc").PropTypesDescValue;
35
- };
36
- showArrow: {
37
- deprecated: import("react-desc").PropTypesDescValidator;
38
- };
39
- className: {
40
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
41
- deprecated: import("react-desc").PropTypesDescValidator;
42
- };
43
- isRequired: import("react-desc").PropTypesDescValue;
44
- };
45
- tooltipType: {
46
- deprecated: import("react-desc").PropTypesDescValidator;
47
- };
48
- zIndex: {
49
- deprecated: import("react-desc").PropTypesDescValidator;
50
- };
51
- innerRef: {
52
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
53
- deprecated: import("react-desc").PropTypesDescValidator;
54
- };
55
- isRequired: import("react-desc").PropTypesDescValue;
56
- };
57
- offset: {
58
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
59
- deprecated: import("react-desc").PropTypesDescValidator;
60
- };
61
- isRequired: import("react-desc").PropTypesDescValue;
62
- };
63
- };
64
- };
65
- declare const TooltipV2WithSchema: {
66
- (props?: unknown): JSX.Element;
67
- propTypes: unknown;
68
- toTypescript: () => import("react-desc").TypescriptSchema;
69
- };
70
- export { DSTooltipV2, TooltipV2WithSchema };
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { DSTooltipArrowT } from './index.d';
3
- declare const DSTooltipArrow: ({ placement, style, arrowElementRef }: DSTooltipArrowT) => React.ReactElement;
4
- export { DSTooltipArrow };
@@ -1,5 +0,0 @@
1
- declare const TooltipType: {
2
- TOOLTIP: "tooltip";
3
- TOOLBAR: "toolbar";
4
- };
5
- export { TooltipType };