@vibe/core 3.9.4-alpha-7b07f.0 → 3.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,7 +40,7 @@ export interface TipseenProps extends VibeComponentProps {
40
40
  */
41
41
  modifiers?: Array<Modifier<unknown>>;
42
42
  closeAriaLabel?: string;
43
- onClose?: () => void;
43
+ onClose?: (event?: React.MouseEvent<HTMLButtonElement>) => void;
44
44
  content: ElementContent;
45
45
  /**
46
46
  * Control the color of the Tipseen close button. Dark theme can be useful while presenting bright images under the tipseen image
@@ -1,2 +1,2 @@
1
- import{__rest as e}from"../_virtual/_tslib.js";import*as r from"react";var t=function(t){var C=t.size,l=e(t,["size"]);return r.createElement("svg",Object.assign({viewBox:"0 0 20 20",fill:"currentColor",width:C||"20",height:C||"20"},l),r.createElement("path",{d:"M10.002 10.75C9.58775 10.75 9.25196 10.4142 9.25196 9.99998L9.25196 6.38963C9.25196 5.97542 9.58775 5.63963 10.002 5.63963 10.4162 5.63963 10.752 5.97542 10.752 6.38963L10.752 9.99998C10.752 10.4142 10.4162 10.75 10.002 10.75zM10.4623 13.9068C10.2962 14.0178 10.101 14.077 9.90126 14.077 9.63345 14.077 9.37661 13.9706 9.18724 13.7813 8.99787 13.5919 8.89149 13.3351 8.89149 13.0672 8.89149 12.8675 8.95071 12.6723 9.06167 12.5063 9.17262 12.3402 9.33033 12.2108 9.51484 12.1343 9.69935 12.0579 9.90238 12.0379 10.0983 12.0769 10.2941 12.1158 10.4741 12.212 10.6153 12.3532 10.7565 12.4945 10.8527 12.6744 10.8916 12.8703 10.9306 13.0661 10.9106 13.2692 10.8342 13.4537 10.7577 13.6382 10.6283 13.7959 10.4623 13.9068z",fill:"currentColor"}),r.createElement("path",{d:"M15.6381 15.6361C14.1433 17.1309 12.1159 17.9707 10.002 17.9707C7.88801 17.9707 5.86063 17.1309 4.36583 15.6361C2.87104 14.1413 2.03127 12.114 2.03127 10C2.03127 7.88606 2.87104 5.85868 4.36583 4.36388C5.86063 2.86909 7.88801 2.02932 10.002 2.02932C12.1159 2.02932 14.1433 2.86909 15.6381 4.36388C17.1329 5.85868 17.9727 7.88605 17.9727 10C17.9727 12.114 17.1329 14.1413 15.6381 15.6361ZM10.002 16.4707C11.7181 16.4707 13.3639 15.789 14.5774 14.5755C15.7909 13.362 16.4727 11.7161 16.4727 10C16.4727 8.28388 15.7909 6.63803 14.5774 5.42454C13.3639 4.21105 11.7181 3.52932 10.002 3.52932C8.28583 3.52932 6.63998 4.21105 5.42649 5.42454C4.21301 6.63803 3.53127 8.28388 3.53127 10C3.53127 11.7161 4.21301 13.362 5.4265 14.5755C6.63998 15.789 8.28583 16.4707 10.002 16.4707Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))};t.displayName="Warning";export{t as default};
1
+ import{__rest as e}from"../_virtual/_tslib.js";import*as t from"react";var a=function(a){var r=a.size,i=e(a,["size"]);return t.createElement("svg",Object.assign({viewBox:"0 0 20 20",fill:"currentColor",width:r||"20",height:r||"20"},i),t.createElement("path",{d:"M10 10.977c-.414 0-.75-.355-.75-.793V6.369c0-.438.336-.792.75-.792s.75.354.75.792v3.815c0 .438-.336.793-.75.793Zm0 3.1a1 1 0 1 0 0-2.002 1 1 0 0 0 0 2.002Z"}),t.createElement("path",{d:"M15.638 15.636A7.97 7.97 0 1 1 4.366 4.364a7.97 7.97 0 0 1 11.272 11.272Zm-5.636.835a6.471 6.471 0 1 0 0-12.942 6.471 6.471 0 0 0 0 12.942Z",fillRule:"evenodd",clipRule:"evenodd"}))};a.displayName="Warning";export{a as default};
2
2
  //# sourceMappingURL=Warning.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Warning.js","sources":["../../../../../icons/dist/react/Warning.js"],"sourcesContent":["import{__rest as e}from\"../_virtual/_tslib.js\";import*as r from\"react\";const t=t=>{var{size:C}=t,l=e(t,[\"size\"]);return r.createElement(\"svg\",Object.assign({viewBox:\"0 0 20 20\",fill:\"currentColor\",width:C||\"20\",height:C||\"20\"},l),r.createElement(\"path\",{d:\"M10.002 10.75C9.58775 10.75 9.25196 10.4142 9.25196 9.99998L9.25196 6.38963C9.25196 5.97542 9.58775 5.63963 10.002 5.63963 10.4162 5.63963 10.752 5.97542 10.752 6.38963L10.752 9.99998C10.752 10.4142 10.4162 10.75 10.002 10.75zM10.4623 13.9068C10.2962 14.0178 10.101 14.077 9.90126 14.077 9.63345 14.077 9.37661 13.9706 9.18724 13.7813 8.99787 13.5919 8.89149 13.3351 8.89149 13.0672 8.89149 12.8675 8.95071 12.6723 9.06167 12.5063 9.17262 12.3402 9.33033 12.2108 9.51484 12.1343 9.69935 12.0579 9.90238 12.0379 10.0983 12.0769 10.2941 12.1158 10.4741 12.212 10.6153 12.3532 10.7565 12.4945 10.8527 12.6744 10.8916 12.8703 10.9306 13.0661 10.9106 13.2692 10.8342 13.4537 10.7577 13.6382 10.6283 13.7959 10.4623 13.9068z\",fill:\"currentColor\"}),r.createElement(\"path\",{d:\"M15.6381 15.6361C14.1433 17.1309 12.1159 17.9707 10.002 17.9707C7.88801 17.9707 5.86063 17.1309 4.36583 15.6361C2.87104 14.1413 2.03127 12.114 2.03127 10C2.03127 7.88606 2.87104 5.85868 4.36583 4.36388C5.86063 2.86909 7.88801 2.02932 10.002 2.02932C12.1159 2.02932 14.1433 2.86909 15.6381 4.36388C17.1329 5.85868 17.9727 7.88605 17.9727 10C17.9727 12.114 17.1329 14.1413 15.6381 15.6361ZM10.002 16.4707C11.7181 16.4707 13.3639 15.789 14.5774 14.5755C15.7909 13.362 16.4727 11.7161 16.4727 10C16.4727 8.28388 15.7909 6.63803 14.5774 5.42454C13.3639 4.21105 11.7181 3.52932 10.002 3.52932C8.28583 3.52932 6.63998 4.21105 5.42649 5.42454C4.21301 6.63803 3.53127 8.28388 3.53127 10C3.53127 11.7161 4.21301 13.362 5.4265 14.5755C6.63998 15.789 8.28583 16.4707 10.002 16.4707Z\",fill:\"currentColor\",fillRule:\"evenodd\",clipRule:\"evenodd\"}))};t.displayName=\"Warning\";export{t as default};\n"],"names":["t","C","size","l","e","r","createElement","Object","assign","viewBox","fill","width","height","d","fillRule","clipRule","displayName"],"mappings":"uEAAuE,IAAMA,EAAE,SAAAA,GAAO,IAAMC,EAAGD,EAARE,KAAUC,EAAEC,EAAEJ,EAAE,CAAC,SAAS,OAAOK,EAAEC,cAAc,MAAMC,OAAOC,OAAO,CAACC,QAAQ,YAAYC,KAAK,eAAeC,MAAMV,GAAG,KAAKW,OAAOX,GAAG,MAAME,GAAGE,EAAEC,cAAc,OAAO,CAACO,EAAE,itBAAitBH,KAAK,iBAAiBL,EAAEC,cAAc,OAAO,CAACO,EAAE,qwBAAqwBH,KAAK,eAAeI,SAAS,UAAUC,SAAS,YAAY,EAAEf,EAAEgB,YAAY"}
1
+ {"version":3,"file":"Warning.js","sources":["../../../../../icons/dist/react/Warning.js"],"sourcesContent":["import{__rest as e}from\"../_virtual/_tslib.js\";import*as t from\"react\";const a=a=>{var{size:r}=a,i=e(a,[\"size\"]);return t.createElement(\"svg\",Object.assign({viewBox:\"0 0 20 20\",fill:\"currentColor\",width:r||\"20\",height:r||\"20\"},i),t.createElement(\"path\",{d:\"M10 10.977c-.414 0-.75-.355-.75-.793V6.369c0-.438.336-.792.75-.792s.75.354.75.792v3.815c0 .438-.336.793-.75.793Zm0 3.1a1 1 0 1 0 0-2.002 1 1 0 0 0 0 2.002Z\"}),t.createElement(\"path\",{d:\"M15.638 15.636A7.97 7.97 0 1 1 4.366 4.364a7.97 7.97 0 0 1 11.272 11.272Zm-5.636.835a6.471 6.471 0 1 0 0-12.942 6.471 6.471 0 0 0 0 12.942Z\",fillRule:\"evenodd\",clipRule:\"evenodd\"}))};a.displayName=\"Warning\";export{a as default};\n"],"names":["a","r","size","i","e","t","createElement","Object","assign","viewBox","fill","width","height","d","fillRule","clipRule","displayName"],"mappings":"uEAAuE,IAAMA,EAAE,SAAAA,GAAO,IAAMC,EAAGD,EAARE,KAAUC,EAAEC,EAAEJ,EAAE,CAAC,SAAS,OAAOK,EAAEC,cAAc,MAAMC,OAAOC,OAAO,CAACC,QAAQ,YAAYC,KAAK,eAAeC,MAAMV,GAAG,KAAKW,OAAOX,GAAG,MAAME,GAAGE,EAAEC,cAAc,OAAO,CAACO,EAAE,gKAAgKR,EAAEC,cAAc,OAAO,CAACO,EAAE,8IAA8IC,SAAS,UAAUC,SAAS,YAAY,EAAEf,EAAEgB,YAAY"}
@@ -40,7 +40,7 @@ export interface TipseenProps extends VibeComponentProps {
40
40
  */
41
41
  modifiers?: Array<Modifier<unknown>>;
42
42
  closeAriaLabel?: string;
43
- onClose?: () => void;
43
+ onClose?: (event?: React.MouseEvent<HTMLButtonElement>) => void;
44
44
  content: ElementContent;
45
45
  /**
46
46
  * Control the color of the Tipseen close button. Dark theme can be useful while presenting bright images under the tipseen image
@@ -1,2 +1,2 @@
1
- import{__rest as e}from"../_virtual/_tslib.js";import*as r from"react";var t=function(t){var C=t.size,l=e(t,["size"]);return r.createElement("svg",Object.assign({viewBox:"0 0 20 20",fill:"currentColor",width:C||"20",height:C||"20"},l),r.createElement("path",{d:"M10.002 10.75C9.58775 10.75 9.25196 10.4142 9.25196 9.99998L9.25196 6.38963C9.25196 5.97542 9.58775 5.63963 10.002 5.63963 10.4162 5.63963 10.752 5.97542 10.752 6.38963L10.752 9.99998C10.752 10.4142 10.4162 10.75 10.002 10.75zM10.4623 13.9068C10.2962 14.0178 10.101 14.077 9.90126 14.077 9.63345 14.077 9.37661 13.9706 9.18724 13.7813 8.99787 13.5919 8.89149 13.3351 8.89149 13.0672 8.89149 12.8675 8.95071 12.6723 9.06167 12.5063 9.17262 12.3402 9.33033 12.2108 9.51484 12.1343 9.69935 12.0579 9.90238 12.0379 10.0983 12.0769 10.2941 12.1158 10.4741 12.212 10.6153 12.3532 10.7565 12.4945 10.8527 12.6744 10.8916 12.8703 10.9306 13.0661 10.9106 13.2692 10.8342 13.4537 10.7577 13.6382 10.6283 13.7959 10.4623 13.9068z",fill:"currentColor"}),r.createElement("path",{d:"M15.6381 15.6361C14.1433 17.1309 12.1159 17.9707 10.002 17.9707C7.88801 17.9707 5.86063 17.1309 4.36583 15.6361C2.87104 14.1413 2.03127 12.114 2.03127 10C2.03127 7.88606 2.87104 5.85868 4.36583 4.36388C5.86063 2.86909 7.88801 2.02932 10.002 2.02932C12.1159 2.02932 14.1433 2.86909 15.6381 4.36388C17.1329 5.85868 17.9727 7.88605 17.9727 10C17.9727 12.114 17.1329 14.1413 15.6381 15.6361ZM10.002 16.4707C11.7181 16.4707 13.3639 15.789 14.5774 14.5755C15.7909 13.362 16.4727 11.7161 16.4727 10C16.4727 8.28388 15.7909 6.63803 14.5774 5.42454C13.3639 4.21105 11.7181 3.52932 10.002 3.52932C8.28583 3.52932 6.63998 4.21105 5.42649 5.42454C4.21301 6.63803 3.53127 8.28388 3.53127 10C3.53127 11.7161 4.21301 13.362 5.4265 14.5755C6.63998 15.789 8.28583 16.4707 10.002 16.4707Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))};t.displayName="Warning";export{t as default};
1
+ import{__rest as e}from"../_virtual/_tslib.js";import*as t from"react";var a=function(a){var r=a.size,i=e(a,["size"]);return t.createElement("svg",Object.assign({viewBox:"0 0 20 20",fill:"currentColor",width:r||"20",height:r||"20"},i),t.createElement("path",{d:"M10 10.977c-.414 0-.75-.355-.75-.793V6.369c0-.438.336-.792.75-.792s.75.354.75.792v3.815c0 .438-.336.793-.75.793Zm0 3.1a1 1 0 1 0 0-2.002 1 1 0 0 0 0 2.002Z"}),t.createElement("path",{d:"M15.638 15.636A7.97 7.97 0 1 1 4.366 4.364a7.97 7.97 0 0 1 11.272 11.272Zm-5.636.835a6.471 6.471 0 1 0 0-12.942 6.471 6.471 0 0 0 0 12.942Z",fillRule:"evenodd",clipRule:"evenodd"}))};a.displayName="Warning";export{a as default};
2
2
  //# sourceMappingURL=Warning.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Warning.js","sources":["../../../../../../icons/dist/react/Warning.js"],"sourcesContent":["import{__rest as e}from\"../_virtual/_tslib.js\";import*as r from\"react\";const t=t=>{var{size:C}=t,l=e(t,[\"size\"]);return r.createElement(\"svg\",Object.assign({viewBox:\"0 0 20 20\",fill:\"currentColor\",width:C||\"20\",height:C||\"20\"},l),r.createElement(\"path\",{d:\"M10.002 10.75C9.58775 10.75 9.25196 10.4142 9.25196 9.99998L9.25196 6.38963C9.25196 5.97542 9.58775 5.63963 10.002 5.63963 10.4162 5.63963 10.752 5.97542 10.752 6.38963L10.752 9.99998C10.752 10.4142 10.4162 10.75 10.002 10.75zM10.4623 13.9068C10.2962 14.0178 10.101 14.077 9.90126 14.077 9.63345 14.077 9.37661 13.9706 9.18724 13.7813 8.99787 13.5919 8.89149 13.3351 8.89149 13.0672 8.89149 12.8675 8.95071 12.6723 9.06167 12.5063 9.17262 12.3402 9.33033 12.2108 9.51484 12.1343 9.69935 12.0579 9.90238 12.0379 10.0983 12.0769 10.2941 12.1158 10.4741 12.212 10.6153 12.3532 10.7565 12.4945 10.8527 12.6744 10.8916 12.8703 10.9306 13.0661 10.9106 13.2692 10.8342 13.4537 10.7577 13.6382 10.6283 13.7959 10.4623 13.9068z\",fill:\"currentColor\"}),r.createElement(\"path\",{d:\"M15.6381 15.6361C14.1433 17.1309 12.1159 17.9707 10.002 17.9707C7.88801 17.9707 5.86063 17.1309 4.36583 15.6361C2.87104 14.1413 2.03127 12.114 2.03127 10C2.03127 7.88606 2.87104 5.85868 4.36583 4.36388C5.86063 2.86909 7.88801 2.02932 10.002 2.02932C12.1159 2.02932 14.1433 2.86909 15.6381 4.36388C17.1329 5.85868 17.9727 7.88605 17.9727 10C17.9727 12.114 17.1329 14.1413 15.6381 15.6361ZM10.002 16.4707C11.7181 16.4707 13.3639 15.789 14.5774 14.5755C15.7909 13.362 16.4727 11.7161 16.4727 10C16.4727 8.28388 15.7909 6.63803 14.5774 5.42454C13.3639 4.21105 11.7181 3.52932 10.002 3.52932C8.28583 3.52932 6.63998 4.21105 5.42649 5.42454C4.21301 6.63803 3.53127 8.28388 3.53127 10C3.53127 11.7161 4.21301 13.362 5.4265 14.5755C6.63998 15.789 8.28583 16.4707 10.002 16.4707Z\",fill:\"currentColor\",fillRule:\"evenodd\",clipRule:\"evenodd\"}))};t.displayName=\"Warning\";export{t as default};\n"],"names":["t","C","size","l","e","r","createElement","Object","assign","viewBox","fill","width","height","d","fillRule","clipRule","displayName"],"mappings":"uEAAuE,IAAMA,EAAE,SAAAA,GAAO,IAAMC,EAAGD,EAARE,KAAUC,EAAEC,EAAEJ,EAAE,CAAC,SAAS,OAAOK,EAAEC,cAAc,MAAMC,OAAOC,OAAO,CAACC,QAAQ,YAAYC,KAAK,eAAeC,MAAMV,GAAG,KAAKW,OAAOX,GAAG,MAAME,GAAGE,EAAEC,cAAc,OAAO,CAACO,EAAE,itBAAitBH,KAAK,iBAAiBL,EAAEC,cAAc,OAAO,CAACO,EAAE,qwBAAqwBH,KAAK,eAAeI,SAAS,UAAUC,SAAS,YAAY,EAAEf,EAAEgB,YAAY"}
1
+ {"version":3,"file":"Warning.js","sources":["../../../../../../icons/dist/react/Warning.js"],"sourcesContent":["import{__rest as e}from\"../_virtual/_tslib.js\";import*as t from\"react\";const a=a=>{var{size:r}=a,i=e(a,[\"size\"]);return t.createElement(\"svg\",Object.assign({viewBox:\"0 0 20 20\",fill:\"currentColor\",width:r||\"20\",height:r||\"20\"},i),t.createElement(\"path\",{d:\"M10 10.977c-.414 0-.75-.355-.75-.793V6.369c0-.438.336-.792.75-.792s.75.354.75.792v3.815c0 .438-.336.793-.75.793Zm0 3.1a1 1 0 1 0 0-2.002 1 1 0 0 0 0 2.002Z\"}),t.createElement(\"path\",{d:\"M15.638 15.636A7.97 7.97 0 1 1 4.366 4.364a7.97 7.97 0 0 1 11.272 11.272Zm-5.636.835a6.471 6.471 0 1 0 0-12.942 6.471 6.471 0 0 0 0 12.942Z\",fillRule:\"evenodd\",clipRule:\"evenodd\"}))};a.displayName=\"Warning\";export{a as default};\n"],"names":["a","r","size","i","e","t","createElement","Object","assign","viewBox","fill","width","height","d","fillRule","clipRule","displayName"],"mappings":"uEAAuE,IAAMA,EAAE,SAAAA,GAAO,IAAMC,EAAGD,EAARE,KAAUC,EAAEC,EAAEJ,EAAE,CAAC,SAAS,OAAOK,EAAEC,cAAc,MAAMC,OAAOC,OAAO,CAACC,QAAQ,YAAYC,KAAK,eAAeC,MAAMV,GAAG,KAAKW,OAAOX,GAAG,MAAME,GAAGE,EAAEC,cAAc,OAAO,CAACO,EAAE,gKAAgKR,EAAEC,cAAc,OAAO,CAACO,EAAE,8IAA8IC,SAAS,UAAUC,SAAS,YAAY,EAAEf,EAAEgB,YAAY"}
@@ -1 +1 @@
1
- {"version":3,"file":"Tipseen.js","sources":["../../../../../src/components/Tipseen/Tipseen.tsx"],"sourcesContent":["import { forwardRef, Fragment, ReactElement, useEffect, useMemo, useRef, useState } from \"react\";\nimport cx from \"classnames\";\nimport { AnimationType as AnimationTypeEnum, HideShowEvent as HideShowEventEnum } from \"../Dialog/DialogConstants\";\nimport { DialogAnimationType, DialogTriggerEvent } from \"../Dialog/Dialog.types\";\nimport useMergeRef from \"../../hooks/useMergeRef\";\nimport Tooltip from \"../../components/Tooltip/Tooltip\";\nimport IconButton from \"../../components/IconButton/IconButton\";\nimport { CloseSmall } from \"@vibe/icons\";\nimport TipseenTitle from \"./TipseenTitle\";\nimport {\n TIPSEEN_CLOSE_BUTTON_ARIA_LABEL,\n TipseenCloseButtonTheme as TipseenCloseButtonThemeEnum,\n TipseenColor as TipseenColorEnum\n} from \"./TipseenConstants\";\nimport { TipseenCloseButtonTheme, TipseenColor } from \"./Tipseen.types\";\nimport { ElementContent, VibeComponent, VibeComponentProps, withStaticProps } from \"../../types\";\nimport { MoveBy } from \"../../types/MoveBy\";\nimport { Modifier } from \"react-popper\";\nimport { ComponentDefaultTestId } from \"../../tests/constants\";\nimport { getTestId } from \"../../tests/test-ids-utils\";\nimport Text from \"../Text/Text\";\nimport styles from \"./Tipseen.module.scss\";\nimport { ButtonColor } from \"../Button/ButtonConstants\";\nimport React from \"react\";\nimport { TooltipPositions } from \"../Tooltip/Tooltip.types\";\nimport { TooltipPositions as TooltipPositionsEnum } from \"../Tooltip/TooltipConstants\";\n\nexport interface TipseenProps extends VibeComponentProps {\n /**\n * Classname for overriding TipseenTitle styles\n */\n titleClassName?: string;\n position?: TooltipPositions;\n animationType?: DialogAnimationType;\n hideDelay?: number;\n showDelay?: number;\n title?: string;\n hideCloseButton?: boolean;\n children?: ReactElement;\n containerSelector?: string;\n hideTrigger?: DialogTriggerEvent | Array<DialogTriggerEvent>;\n showTrigger?: DialogTriggerEvent | Array<DialogTriggerEvent>;\n width?: number;\n moveBy?: MoveBy;\n hideWhenReferenceHidden?: boolean;\n referenceWrapperClassName?: string;\n /**\n * when false, the arrow of the tooltip is hidden\n */\n tip?: boolean;\n /** Class name for a tooltip's arrow */\n tooltipArrowClassName?: string;\n /**\n * PopperJS Modifiers type\n * https://popper.js.org/docs/v2/modifiers/\n */\n modifiers?: Array<Modifier<unknown>>;\n closeAriaLabel?: string;\n onClose?: () => void;\n content: ElementContent;\n /**\n * Control the color of the Tipseen close button. Dark theme can be useful while presenting bright images under the tipseen image\n */\n closeButtonTheme?: TipseenCloseButtonTheme;\n floating?: boolean;\n /** The color of the Tipseen */\n color?: TipseenColor;\n}\n\nexport const TipseenContext = React.createContext<TipseenColor>(\"primary\");\n\nconst Tipseen: VibeComponent<TipseenProps> & {\n closeButtonThemes?: typeof TipseenCloseButtonThemeEnum;\n animationTypes?: typeof AnimationTypeEnum;\n hideShowTriggers?: typeof HideShowEventEnum;\n colors?: typeof TipseenColorEnum;\n positions?: typeof TooltipPositionsEnum;\n} = forwardRef(\n (\n {\n className,\n id,\n position = \"bottom\",\n animationType = \"expand\",\n hideDelay = 0,\n showDelay = 100,\n title,\n titleClassName,\n hideCloseButton,\n closeButtonTheme = \"light\",\n onClose,\n closeAriaLabel,\n children = null,\n content,\n containerSelector,\n hideTrigger = [],\n showTrigger = [],\n width,\n moveBy,\n hideWhenReferenceHidden = false,\n referenceWrapperClassName,\n tip = true,\n tooltipArrowClassName,\n modifiers = [],\n floating = false,\n color: colorProp,\n \"data-testid\": dataTestId\n }: TipseenProps,\n ref\n ) => {\n const color = colorProp ?? \"inverted\";\n\n const defaultDelayOpen =\n Array.isArray(showTrigger) && Array.isArray(hideTrigger) && showTrigger.length === 0 && showDelay > 0;\n\n const componentRef = useRef(null);\n const mergedRef = useMergeRef(ref, componentRef);\n const [delayedOpen, setDelayOpen] = useState(!defaultDelayOpen);\n const overrideCloseAriaLabel = closeAriaLabel || TIPSEEN_CLOSE_BUTTON_ARIA_LABEL;\n\n useEffect(() => {\n let timeout: NodeJS.Timeout;\n if (showDelay) {\n timeout = setTimeout(() => {\n setDelayOpen(true);\n }, showDelay);\n }\n return () => {\n clearTimeout(timeout);\n };\n }, [showDelay, setDelayOpen]);\n\n const textColor = useMemo(() => {\n return color === \"inverted\" ? \"onInverted\" : \"onPrimary\";\n }, [color]);\n const closeButtonColor = useMemo(() => {\n if (closeButtonTheme === \"light\") {\n return color === \"inverted\" ? ButtonColor.ON_INVERTED_BACKGROUND : ButtonColor.ON_PRIMARY_COLOR;\n } else {\n return closeButtonTheme;\n }\n }, [color, closeButtonTheme]);\n\n const TipseenWrapper = ref || id ? \"div\" : Fragment;\n const tooltipContent = (\n <div>\n <div className={cx(styles.tipseenHeader)}>\n {hideCloseButton ? null : (\n <IconButton\n hideTooltip\n className={cx(styles.tipseenCloseButton, {\n [styles.dark]: closeButtonTheme === \"dark\" || closeButtonTheme === \"fixed-dark\"\n })}\n onClick={onClose}\n size=\"xs\"\n kind=\"tertiary\"\n // @ts-ignore\n color={closeButtonColor}\n ariaLabel={overrideCloseAriaLabel}\n icon={CloseSmall}\n />\n )}\n <TipseenTitle text={title} className={cx(styles.tipseenTitle, titleClassName)} />\n </div>\n <Text color={textColor} type=\"text2\" element=\"p\" className={cx(styles.tipseenContent)}>\n <TipseenContext.Provider value={color}>{content}</TipseenContext.Provider>\n </Text>\n </div>\n );\n\n return (\n <TipseenWrapper ref={mergedRef} id={id} data-testid={dataTestId || getTestId(ComponentDefaultTestId.TIPSEEN, id)}>\n <Tooltip\n className={cx(styles.tipseenWrapper, className, {\n [styles.tipseenWrapperWithoutCustomWidth]: !width,\n [styles.floating]: floating\n })}\n arrowClassName={tooltipArrowClassName}\n style={width ? { width } : undefined}\n shouldShowOnMount={!defaultDelayOpen}\n position={position}\n animationType={animationType}\n hideDelay={hideDelay}\n showDelay={showDelay}\n hideTrigger={hideTrigger}\n showTrigger={showTrigger}\n content={tooltipContent}\n theme={color === \"inverted\" ? \"dark\" : \"primary\"}\n containerSelector={containerSelector}\n disableDialogSlide={false}\n moveBy={moveBy}\n hideWhenReferenceHidden={hideWhenReferenceHidden}\n referenceWrapperClassName={referenceWrapperClassName}\n tip={tip && !floating}\n modifiers={modifiers}\n open={defaultDelayOpen ? delayedOpen : undefined}\n forceRenderWithoutChildren={floating}\n >\n {children}\n </Tooltip>\n </TipseenWrapper>\n );\n }\n);\n\nexport default withStaticProps(Tipseen, {\n closeButtonThemes: TipseenCloseButtonThemeEnum,\n animationTypes: AnimationTypeEnum,\n hideShowTriggers: HideShowEventEnum,\n colors: TipseenColorEnum,\n positions: TooltipPositionsEnum\n});\n"],"names":["TipseenContext","React","createContext","withStaticProps","forwardRef","_ref","ref","className","id","_ref$position","position","_ref$animationType","animationType","_ref$hideDelay","hideDelay","_ref$showDelay","showDelay","title","titleClassName","hideCloseButton","_ref$closeButtonTheme","closeButtonTheme","onClose","closeAriaLabel","_ref$children","children","content","containerSelector","_ref$hideTrigger","hideTrigger","_ref$showTrigger","showTrigger","width","moveBy","_ref$hideWhenReferenc","hideWhenReferenceHidden","referenceWrapperClassName","_ref$tip","tip","tooltipArrowClassName","_ref$modifiers","modifiers","_ref$floating","floating","colorProp","color","dataTestId","defaultDelayOpen","Array","isArray","length","componentRef","useRef","mergedRef","useMergeRef","_useState","useState","_useState2","_slicedToArray","delayedOpen","setDelayOpen","overrideCloseAriaLabel","TIPSEEN_CLOSE_BUTTON_ARIA_LABEL","useEffect","timeout","setTimeout","clearTimeout","textColor","useMemo","closeButtonColor","ButtonColor","ON_INVERTED_BACKGROUND","ON_PRIMARY_COLOR","TipseenWrapper","Fragment","tooltipContent","createElement","cx","styles","tipseenHeader","IconButton","hideTooltip","tipseenCloseButton","_defineProperty","dark","onClick","size","kind","ariaLabel","icon","CloseSmall","TipseenTitle","text","tipseenTitle","Text","type","element","tipseenContent","Provider","value","getTestId","ComponentDefaultTestId","TIPSEEN","Tooltip","tipseenWrapper","tipseenWrapperWithoutCustomWidth","arrowClassName","style","undefined","shouldShowOnMount","theme","disableDialogSlide","open","forceRenderWithoutChildren","closeButtonThemes","TipseenCloseButtonThemeEnum","animationTypes","AnimationTypeEnum","hideShowTriggers","HideShowEventEnum","colors","TipseenColorEnum","positions","TooltipPositionsEnum"],"mappings":"iiCAqEO,IAAMA,EAAiBC,EAAMC,cAA4B,WAwIjDC,EAAAA,EAhIXC,GACF,SAAAC,EA8BEC,GACE,IA7BAC,EAASF,EAATE,UACAC,EAAEH,EAAFG,GAAEC,EAAAJ,EACFK,SAAAA,OAAW,IAAHD,EAAG,SAAQA,EAAAE,EAAAN,EACnBO,cAAAA,OAAgB,IAAHD,EAAG,SAAQA,EAAAE,EAAAR,EACxBS,UAAAA,OAAY,IAAHD,EAAG,EAACA,EAAAE,EAAAV,EACbW,UAAAA,OAAY,IAAHD,EAAG,IAAGA,EACfE,EAAKZ,EAALY,MACAC,EAAcb,EAAda,eACAC,EAAed,EAAfc,gBAAeC,EAAAf,EACfgB,iBAAAA,OAAmB,IAAHD,EAAG,QAAOA,EAC1BE,EAAOjB,EAAPiB,QACAC,EAAclB,EAAdkB,eAAcC,EAAAnB,EACdoB,SAAAA,OAAW,IAAHD,EAAG,KAAIA,EACfE,EAAOrB,EAAPqB,QACAC,EAAiBtB,EAAjBsB,kBAAiB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BC,OAAQC,EACRC,UAAWC"}
1
+ {"version":3,"file":"Tipseen.js","sources":["../../../../../src/components/Tipseen/Tipseen.tsx"],"sourcesContent":["import { forwardRef, Fragment, ReactElement, useEffect, useMemo, useRef, useState } from \"react\";\nimport cx from \"classnames\";\nimport { AnimationType as AnimationTypeEnum, HideShowEvent as HideShowEventEnum } from \"../Dialog/DialogConstants\";\nimport { DialogAnimationType, DialogTriggerEvent } from \"../Dialog/Dialog.types\";\nimport useMergeRef from \"../../hooks/useMergeRef\";\nimport Tooltip from \"../../components/Tooltip/Tooltip\";\nimport IconButton from \"../../components/IconButton/IconButton\";\nimport { CloseSmall } from \"@vibe/icons\";\nimport TipseenTitle from \"./TipseenTitle\";\nimport {\n TIPSEEN_CLOSE_BUTTON_ARIA_LABEL,\n TipseenCloseButtonTheme as TipseenCloseButtonThemeEnum,\n TipseenColor as TipseenColorEnum\n} from \"./TipseenConstants\";\nimport { TipseenCloseButtonTheme, TipseenColor } from \"./Tipseen.types\";\nimport { ElementContent, VibeComponent, VibeComponentProps, withStaticProps } from \"../../types\";\nimport { MoveBy } from \"../../types/MoveBy\";\nimport { Modifier } from \"react-popper\";\nimport { ComponentDefaultTestId } from \"../../tests/constants\";\nimport { getTestId } from \"../../tests/test-ids-utils\";\nimport Text from \"../Text/Text\";\nimport styles from \"./Tipseen.module.scss\";\nimport { ButtonColor } from \"../Button/ButtonConstants\";\nimport React from \"react\";\nimport { TooltipPositions } from \"../Tooltip/Tooltip.types\";\nimport { TooltipPositions as TooltipPositionsEnum } from \"../Tooltip/TooltipConstants\";\n\nexport interface TipseenProps extends VibeComponentProps {\n /**\n * Classname for overriding TipseenTitle styles\n */\n titleClassName?: string;\n position?: TooltipPositions;\n animationType?: DialogAnimationType;\n hideDelay?: number;\n showDelay?: number;\n title?: string;\n hideCloseButton?: boolean;\n children?: ReactElement;\n containerSelector?: string;\n hideTrigger?: DialogTriggerEvent | Array<DialogTriggerEvent>;\n showTrigger?: DialogTriggerEvent | Array<DialogTriggerEvent>;\n width?: number;\n moveBy?: MoveBy;\n hideWhenReferenceHidden?: boolean;\n referenceWrapperClassName?: string;\n /**\n * when false, the arrow of the tooltip is hidden\n */\n tip?: boolean;\n /** Class name for a tooltip's arrow */\n tooltipArrowClassName?: string;\n /**\n * PopperJS Modifiers type\n * https://popper.js.org/docs/v2/modifiers/\n */\n modifiers?: Array<Modifier<unknown>>;\n closeAriaLabel?: string;\n onClose?: (event?: React.MouseEvent<HTMLButtonElement>) => void;\n content: ElementContent;\n /**\n * Control the color of the Tipseen close button. Dark theme can be useful while presenting bright images under the tipseen image\n */\n closeButtonTheme?: TipseenCloseButtonTheme;\n floating?: boolean;\n /** The color of the Tipseen */\n color?: TipseenColor;\n}\n\nexport const TipseenContext = React.createContext<TipseenColor>(\"primary\");\n\nconst Tipseen: VibeComponent<TipseenProps> & {\n closeButtonThemes?: typeof TipseenCloseButtonThemeEnum;\n animationTypes?: typeof AnimationTypeEnum;\n hideShowTriggers?: typeof HideShowEventEnum;\n colors?: typeof TipseenColorEnum;\n positions?: typeof TooltipPositionsEnum;\n} = forwardRef(\n (\n {\n className,\n id,\n position = \"bottom\",\n animationType = \"expand\",\n hideDelay = 0,\n showDelay = 100,\n title,\n titleClassName,\n hideCloseButton,\n closeButtonTheme = \"light\",\n onClose,\n closeAriaLabel,\n children = null,\n content,\n containerSelector,\n hideTrigger = [],\n showTrigger = [],\n width,\n moveBy,\n hideWhenReferenceHidden = false,\n referenceWrapperClassName,\n tip = true,\n tooltipArrowClassName,\n modifiers = [],\n floating = false,\n color: colorProp,\n \"data-testid\": dataTestId\n }: TipseenProps,\n ref\n ) => {\n const color = colorProp ?? \"inverted\";\n\n const defaultDelayOpen =\n Array.isArray(showTrigger) && Array.isArray(hideTrigger) && showTrigger.length === 0 && showDelay > 0;\n\n const componentRef = useRef(null);\n const mergedRef = useMergeRef(ref, componentRef);\n const [delayedOpen, setDelayOpen] = useState(!defaultDelayOpen);\n const overrideCloseAriaLabel = closeAriaLabel || TIPSEEN_CLOSE_BUTTON_ARIA_LABEL;\n\n useEffect(() => {\n let timeout: NodeJS.Timeout;\n if (showDelay) {\n timeout = setTimeout(() => {\n setDelayOpen(true);\n }, showDelay);\n }\n return () => {\n clearTimeout(timeout);\n };\n }, [showDelay, setDelayOpen]);\n\n const textColor = useMemo(() => {\n return color === \"inverted\" ? \"onInverted\" : \"onPrimary\";\n }, [color]);\n const closeButtonColor = useMemo(() => {\n if (closeButtonTheme === \"light\") {\n return color === \"inverted\" ? ButtonColor.ON_INVERTED_BACKGROUND : ButtonColor.ON_PRIMARY_COLOR;\n } else {\n return closeButtonTheme;\n }\n }, [color, closeButtonTheme]);\n\n const TipseenWrapper = ref || id ? \"div\" : Fragment;\n const tooltipContent = (\n <div>\n <div className={cx(styles.tipseenHeader)}>\n {hideCloseButton ? null : (\n <IconButton\n hideTooltip\n className={cx(styles.tipseenCloseButton, {\n [styles.dark]: closeButtonTheme === \"dark\" || closeButtonTheme === \"fixed-dark\"\n })}\n onClick={onClose}\n size=\"xs\"\n kind=\"tertiary\"\n // @ts-ignore\n color={closeButtonColor}\n ariaLabel={overrideCloseAriaLabel}\n icon={CloseSmall}\n />\n )}\n <TipseenTitle text={title} className={cx(styles.tipseenTitle, titleClassName)} />\n </div>\n <Text color={textColor} type=\"text2\" element=\"p\" className={cx(styles.tipseenContent)}>\n <TipseenContext.Provider value={color}>{content}</TipseenContext.Provider>\n </Text>\n </div>\n );\n\n return (\n <TipseenWrapper ref={mergedRef} id={id} data-testid={dataTestId || getTestId(ComponentDefaultTestId.TIPSEEN, id)}>\n <Tooltip\n className={cx(styles.tipseenWrapper, className, {\n [styles.tipseenWrapperWithoutCustomWidth]: !width,\n [styles.floating]: floating\n })}\n arrowClassName={tooltipArrowClassName}\n style={width ? { width } : undefined}\n shouldShowOnMount={!defaultDelayOpen}\n position={position}\n animationType={animationType}\n hideDelay={hideDelay}\n showDelay={showDelay}\n hideTrigger={hideTrigger}\n showTrigger={showTrigger}\n content={tooltipContent}\n theme={color === \"inverted\" ? \"dark\" : \"primary\"}\n containerSelector={containerSelector}\n disableDialogSlide={false}\n moveBy={moveBy}\n hideWhenReferenceHidden={hideWhenReferenceHidden}\n referenceWrapperClassName={referenceWrapperClassName}\n tip={tip && !floating}\n modifiers={modifiers}\n open={defaultDelayOpen ? delayedOpen : undefined}\n forceRenderWithoutChildren={floating}\n >\n {children}\n </Tooltip>\n </TipseenWrapper>\n );\n }\n);\n\nexport default withStaticProps(Tipseen, {\n closeButtonThemes: TipseenCloseButtonThemeEnum,\n animationTypes: AnimationTypeEnum,\n hideShowTriggers: HideShowEventEnum,\n colors: TipseenColorEnum,\n positions: TooltipPositionsEnum\n});\n"],"names":["TipseenContext","React","createContext","withStaticProps","forwardRef","_ref","ref","className","id","_ref$position","position","_ref$animationType","animationType","_ref$hideDelay","hideDelay","_ref$showDelay","showDelay","title","titleClassName","hideCloseButton","_ref$closeButtonTheme","closeButtonTheme","onClose","closeAriaLabel","_ref$children","children","content","containerSelector","_ref$hideTrigger","hideTrigger","_ref$showTrigger","showTrigger","width","moveBy","_ref$hideWhenReferenc","hideWhenReferenceHidden","referenceWrapperClassName","_ref$tip","tip","tooltipArrowClassName","_ref$modifiers","modifiers","_ref$floating","floating","colorProp","color","dataTestId","defaultDelayOpen","Array","isArray","length","componentRef","useRef","mergedRef","useMergeRef","_useState","useState","_useState2","_slicedToArray","delayedOpen","setDelayOpen","overrideCloseAriaLabel","TIPSEEN_CLOSE_BUTTON_ARIA_LABEL","useEffect","timeout","setTimeout","clearTimeout","textColor","useMemo","closeButtonColor","ButtonColor","ON_INVERTED_BACKGROUND","ON_PRIMARY_COLOR","TipseenWrapper","Fragment","tooltipContent","createElement","cx","styles","tipseenHeader","IconButton","hideTooltip","tipseenCloseButton","_defineProperty","dark","onClick","size","kind","ariaLabel","icon","CloseSmall","TipseenTitle","text","tipseenTitle","Text","type","element","tipseenContent","Provider","value","getTestId","ComponentDefaultTestId","TIPSEEN","Tooltip","tipseenWrapper","tipseenWrapperWithoutCustomWidth","arrowClassName","style","undefined","shouldShowOnMount","theme","disableDialogSlide","open","forceRenderWithoutChildren","closeButtonThemes","TipseenCloseButtonThemeEnum","animationTypes","AnimationTypeEnum","hideShowTriggers","HideShowEventEnum","colors","TipseenColorEnum","positions","TooltipPositionsEnum"],"mappings":"iiCAqEO,IAAMA,EAAiBC,EAAMC,cAA4B,WAwIjDC,EAAAA,EAhIXC,GACF,SAAAC,EA8BEC,GACE,IA7BAC,EAASF,EAATE,UACAC,EAAEH,EAAFG,GAAEC,EAAAJ,EACFK,SAAAA,OAAW,IAAHD,EAAG,SAAQA,EAAAE,EAAAN,EACnBO,cAAAA,OAAgB,IAAHD,EAAG,SAAQA,EAAAE,EAAAR,EACxBS,UAAAA,OAAY,IAAHD,EAAG,EAACA,EAAAE,EAAAV,EACbW,UAAAA,OAAY,IAAHD,EAAG,IAAGA,EACfE,EAAKZ,EAALY,MACAC,EAAcb,EAAda,eACAC,EAAed,EAAfc,gBAAeC,EAAAf,EACfgB,iBAAAA,OAAmB,IAAHD,EAAG,QAAOA,EAC1BE,EAAOjB,EAAPiB,QACAC,EAAclB,EAAdkB,eAAcC,EAAAnB,EACdoB,SAAAA,OAAW,IAAHD,EAAG,KAAIA,EACfE,EAAOrB,EAAPqB,QACAC,EAAiBtB,EAAjBsB,kBAAiBC,EAAAvB,EACjBwB,YAAAA,OAAc,IAAHD,EAAG,GAAEA,EAAAE,EAAAzB,EAChB0B,YAAAA,OAAc,IAAHD,EAAG,GAAEA,EAChBE,EAAK3B,EAAL2B,MACAC,EAAM5B,EAAN4B,OAAMC,EAAA7B,EACN8B,wBAAAA,OAA0B,IAAHD,GAAQA,EAC/BE,EAAyB/B,EAAzB+B,0BAAyBC,EAAAhC,EACzBiC,IAAAA,QAAM,IAAHD,GAAOA,EACVE,GAAqBlC,EAArBkC,sBAAqBC,GAAAnC,EACrBoC,UAAAA,QAAY,IAAHD,GAAG,GAAEA,GAAAE,GAAArC,EACdsC,SAAAA,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C,QAAQ,IAAIzF,UAAWsE,EAAGC,EAAOmB,iBACpEhG,EAAA2E,cAAC5E,EAAekG,SAAQ,CAACC,MAAOtD,IAAQnB,KAK9C,OACEzB,gBAACwE,GAAc,CAACnE,IAAK+C,GAAW7C,GAAIA,EAAiB,cAAAsC,IAAcsD,EAAUC,EAAuBC,QAAS9F,IAC3GP,EAAC2E,cAAA2B,EACC,CAAAhG,UAAWsE,EAAGC,EAAO0B,eAAgBjG,EAAS4E,EAAAA,EAAA,CAAA,EAC3CL,EAAO2B,kCAAoCzE,GAC3C8C,EAAOnC,SAAWA,KAErB+D,eAAgBnE,GAChBoE,MAAO3E,EAAQ,CAAEA,MAAAA,QAAU4E,EAC3BC,mBAAoB9D,GACpBrC,SAAUA,EACVE,cAAeA,EACfE,UAAWA,EACXE,UAAWA,EACXa,YAAaA,EACbE,YAAaA,EACbL,QAASiD,GACTmC,MAAiB,aAAVjE,GAAuB,OAAS,UACvClB,kBAAmBA,EACnBoF,oBAAoB,EACpB9E,OAAQA,EACRE,wBAAyBA,EACzBC,0BAA2BA,EAC3BE,IAAKA,KAAQK,GACbF,UAAWA,GACXuE,KAAMjE,GAAmBY,QAAciD,EACvCK,2BAA4BtE,IAE3BlB,GAIT,IAGsC,CACtCyF,kBAAmBC,EACnBC,eAAgBC,EAChBC,iBAAkBC,EAClBC,OAAQC,EACRC,UAAWC"}
@@ -1,2 +1,2 @@
1
- import{slicedToArray as r}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{useState as e,useCallback as t}from"react";import i from"../useResizeObserver.js";function n(r,e){return!!r&&(r.scrollWidth>r.clientWidth||!e&&r.scrollHeight>r.clientHeight+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:0))}function o(o){var l=o.ref,u=o.ignoreHeightOverflow,c=void 0!==u&&u,a=o.tolerance,f=e((function(){return n(null==l?void 0:l.current,c,a)})),s=r(f,2),v=s[0],d=s[1],m=t((function(){var r=null==l?void 0:l.current;if(r){var e=n(r,c,a);d((function(r){return r!==e?e:r}))}}),[c,l,a]);return i({ref:l,callback:m,debounceTime:0}),v}export{o as default};
1
+ import{slicedToArray as e}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{useState as r,useCallback as l}from"react";import o from"../useResizeObserver.js";function t(e,r){var l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!e)return!1;var o=e.style.overflow;o&&"visible"!==o||(e.style.overflow="hidden");var t=e.scrollWidth>e.clientWidth||!r&&e.scrollHeight>e.clientHeight+l;return e.style.overflow=o,t}function i(i){var n=i.ref,u=i.ignoreHeightOverflow,c=void 0!==u&&u,f=i.tolerance,s=r((function(){return t(null==n?void 0:n.current,c,f)})),v=e(s,2),a=v[0],d=v[1],h=l((function(){d(t(null==n?void 0:n.current,c,f))}),[c,n,f]);return o({ref:n,callback:h,debounceTime:0}),a}export{i as default};
2
2
  //# sourceMappingURL=useIsOverflowing.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useIsOverflowing.js","sources":["../../../../../src/hooks/useIsOverflowing/useIsOverflowing.ts"],"sourcesContent":["import { RefObject, useCallback, useState } from \"react\";\nimport useResizeObserver from \"../useResizeObserver\";\n\nfunction checkOverflow(element: HTMLElement, ignoreHeightOverflow: boolean, tolerance = 0) {\n if (!element) {\n return false;\n }\n const isOverflowingWidth = element.clientWidth < element.scrollWidth;\n const isOverflowingHeight = !ignoreHeightOverflow && element.clientHeight + tolerance < element.scrollHeight;\n return isOverflowingWidth || isOverflowingHeight;\n}\n\nexport default function useIsOverflowing({\n ref,\n ignoreHeightOverflow = false,\n tolerance\n}: {\n ref: RefObject<HTMLElement>;\n ignoreHeightOverflow?: boolean;\n tolerance?: number;\n}) {\n const [isOverflowing, setIsOverflowing] = useState<boolean>(() =>\n checkOverflow(ref?.current, ignoreHeightOverflow, tolerance)\n );\n const callback = useCallback(() => {\n const element = ref?.current;\n if (!element) return;\n\n const newOverflowState = checkOverflow(element, ignoreHeightOverflow, tolerance);\n setIsOverflowing(prevState => (prevState !== newOverflowState ? newOverflowState : prevState));\n }, [ignoreHeightOverflow, ref, tolerance]);\n\n useResizeObserver({\n ref,\n callback,\n debounceTime: 0\n });\n\n return isOverflowing;\n}\n"],"names":["checkOverflow","element","ignoreHeightOverflow","scrollWidth","clientWidth","scrollHeight","clientHeight","arguments","length","undefined","useIsOverflowing","_ref","ref","_ref$ignoreHeightOver","tolerance","_useState","useState","current","_useState2","_slicedToArray","isOverflowing","setIsOverflowing","callback","useCallback","newOverflowState","prevState","useResizeObserver","debounceTime"],"mappings":"wKAGA,SAASA,EAAcC,EAAsBC,GAC3C,QAAKD,IAG4CA,EAAQE,YAA9BF,EAAQG,cACNF,GAA2DD,EAAQI,aAA3CJ,EAAQK,cALsBC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,GAOxF,CAEwB,SAAAG,EAAgBC,GAQvC,IAPCC,EAAGD,EAAHC,IAAGC,EAAAF,EACHT,qBAAAA,OAAuB,IAAHW,GAAQA,EAC5BC,EAASH,EAATG,UAMAC,EAA0CC,GAAkB,WAAA,OAC1DhB,EAAcY,aAAA,EAAAA,EAAKK,QAASf,EAAsBY,MACnDI,EAAAC,EAAAJ,EAAA,GAFMK,EAAaF,EAAA,GAAEG,EAAgBH,EAAA,GAGhCI,EAAWC,GAAY,WAC3B,IAAMtB,EAAUW,aAAA,EAAAA,EAAKK,QACrB,GAAKhB,EAAL,CAEA,IAAMuB,EAAmBxB,EAAcC,EAASC,EAAsBY,GACtEO,GAAiB,SAAAI,GAAS,OAAKA,IAAcD,EAAmBA,EAAmBC,CAAS,GAH9E,CAIf,GAAE,CAACvB,EAAsBU,EAAKE,IAQ/B,OANAY,EAAkB,CAChBd,IAAAA,EACAU,SAAAA,EACAK,aAAc,IAGTP,CACT"}
1
+ {"version":3,"file":"useIsOverflowing.js","sources":["../../../../../src/hooks/useIsOverflowing/useIsOverflowing.ts"],"sourcesContent":["import { RefObject, useCallback, useState } from \"react\";\nimport useResizeObserver from \"../useResizeObserver\";\n\nfunction checkOverflow(element: HTMLElement, ignoreHeightOverflow: boolean, tolerance = 0) {\n if (!element) {\n return false;\n }\n const curOverflow = element.style.overflow;\n if (!curOverflow || curOverflow === \"visible\") element.style.overflow = \"hidden\";\n const isOverflowing =\n element.clientWidth < element.scrollWidth ||\n (!ignoreHeightOverflow && element.clientHeight + tolerance < element.scrollHeight);\n element.style.overflow = curOverflow;\n return isOverflowing;\n}\n\nexport default function useIsOverflowing({\n ref,\n ignoreHeightOverflow = false,\n tolerance\n}: {\n ref: RefObject<HTMLElement>;\n ignoreHeightOverflow?: boolean;\n tolerance?: number;\n}) {\n const [isOverflowing, setIsOverflowing] = useState<boolean>(() =>\n checkOverflow(ref?.current, ignoreHeightOverflow, tolerance)\n );\n const callback = useCallback(() => {\n setIsOverflowing(checkOverflow(ref?.current, ignoreHeightOverflow, tolerance));\n }, [ignoreHeightOverflow, ref, tolerance]);\n\n useResizeObserver({\n ref,\n callback,\n debounceTime: 0\n });\n\n return isOverflowing;\n}\n"],"names":["checkOverflow","element","ignoreHeightOverflow","tolerance","arguments","length","undefined","curOverflow","style","overflow","isOverflowing","scrollWidth","clientWidth","scrollHeight","clientHeight","useIsOverflowing","_ref","ref","_ref$ignoreHeightOver","_useState","useState","current","_useState2","_slicedToArray","setIsOverflowing","callback","useCallback","useResizeObserver","debounceTime"],"mappings":"wKAGA,SAASA,EAAcC,EAAsBC,GAA4C,IAAbC,EAASC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,EACtF,IAAKH,EACH,OAAO,EAET,IAAMM,EAAcN,EAAQO,MAAMC,SAC7BF,GAA+B,YAAhBA,IAA2BN,EAAQO,MAAMC,SAAW,UACxE,IAAMC,EACkBT,EAAQU,YAA9BV,EAAQW,cACNV,GAA2DD,EAAQY,aAA3CZ,EAAQa,aAAeX,EAEnD,OADAF,EAAQO,MAAMC,SAAWF,EAClBG,CACT,CAEwB,SAAAK,EAAgBC,GAQvC,IAPCC,EAAGD,EAAHC,IAAGC,EAAAF,EACHd,qBAAAA,OAAuB,IAAHgB,GAAQA,EAC5Bf,EAASa,EAATb,UAMAgB,EAA0CC,GAAkB,WAAA,OAC1DpB,EAAciB,aAAA,EAAAA,EAAKI,QAASnB,EAAsBC,MACnDmB,EAAAC,EAAAJ,EAAA,GAFMT,EAAaY,EAAA,GAAEE,EAAgBF,EAAA,GAGhCG,EAAWC,GAAY,WAC3BF,EAAiBxB,EAAciB,aAAA,EAAAA,EAAKI,QAASnB,EAAsBC,GACpE,GAAE,CAACD,EAAsBe,EAAKd,IAQ/B,OANAwB,EAAkB,CAChBV,IAAAA,EACAQ,SAAAA,EACAG,aAAc,IAGTlB,CACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"Tipseen.js","sources":["../../../../src/components/Tipseen/Tipseen.tsx"],"sourcesContent":["import { forwardRef, Fragment, ReactElement, useEffect, useMemo, useRef, useState } from \"react\";\nimport cx from \"classnames\";\nimport { AnimationType as AnimationTypeEnum, HideShowEvent as HideShowEventEnum } from \"../Dialog/DialogConstants\";\nimport { DialogAnimationType, DialogTriggerEvent } from \"../Dialog/Dialog.types\";\nimport useMergeRef from \"../../hooks/useMergeRef\";\nimport Tooltip from \"../../components/Tooltip/Tooltip\";\nimport IconButton from \"../../components/IconButton/IconButton\";\nimport { CloseSmall } from \"@vibe/icons\";\nimport TipseenTitle from \"./TipseenTitle\";\nimport {\n TIPSEEN_CLOSE_BUTTON_ARIA_LABEL,\n TipseenCloseButtonTheme as TipseenCloseButtonThemeEnum,\n TipseenColor as TipseenColorEnum\n} from \"./TipseenConstants\";\nimport { TipseenCloseButtonTheme, TipseenColor } from \"./Tipseen.types\";\nimport { ElementContent, VibeComponent, VibeComponentProps, withStaticProps } from \"../../types\";\nimport { MoveBy } from \"../../types/MoveBy\";\nimport { Modifier } from \"react-popper\";\nimport { ComponentDefaultTestId } from \"../../tests/constants\";\nimport { getTestId } from \"../../tests/test-ids-utils\";\nimport Text from \"../Text/Text\";\nimport styles from \"./Tipseen.module.scss\";\nimport { ButtonColor } from \"../Button/ButtonConstants\";\nimport React from \"react\";\nimport { TooltipPositions } from \"../Tooltip/Tooltip.types\";\nimport { TooltipPositions as TooltipPositionsEnum } from \"../Tooltip/TooltipConstants\";\n\nexport interface TipseenProps extends VibeComponentProps {\n /**\n * Classname for overriding TipseenTitle styles\n */\n titleClassName?: string;\n position?: TooltipPositions;\n animationType?: DialogAnimationType;\n hideDelay?: number;\n showDelay?: number;\n title?: string;\n hideCloseButton?: boolean;\n children?: ReactElement;\n containerSelector?: string;\n hideTrigger?: DialogTriggerEvent | Array<DialogTriggerEvent>;\n showTrigger?: DialogTriggerEvent | Array<DialogTriggerEvent>;\n width?: number;\n moveBy?: MoveBy;\n hideWhenReferenceHidden?: boolean;\n referenceWrapperClassName?: string;\n /**\n * when false, the arrow of the tooltip is hidden\n */\n tip?: boolean;\n /** Class name for a tooltip's arrow */\n tooltipArrowClassName?: string;\n /**\n * PopperJS Modifiers type\n * https://popper.js.org/docs/v2/modifiers/\n */\n modifiers?: Array<Modifier<unknown>>;\n closeAriaLabel?: string;\n onClose?: () => void;\n content: ElementContent;\n /**\n * Control the color of the Tipseen close button. Dark theme can be useful while presenting bright images under the tipseen image\n */\n closeButtonTheme?: TipseenCloseButtonTheme;\n floating?: boolean;\n /** The color of the Tipseen */\n color?: TipseenColor;\n}\n\nexport const TipseenContext = React.createContext<TipseenColor>(\"primary\");\n\nconst Tipseen: VibeComponent<TipseenProps> & {\n closeButtonThemes?: typeof TipseenCloseButtonThemeEnum;\n animationTypes?: typeof AnimationTypeEnum;\n hideShowTriggers?: typeof HideShowEventEnum;\n colors?: typeof TipseenColorEnum;\n positions?: typeof TooltipPositionsEnum;\n} = forwardRef(\n (\n {\n className,\n id,\n position = \"bottom\",\n animationType = \"expand\",\n hideDelay = 0,\n showDelay = 100,\n title,\n titleClassName,\n hideCloseButton,\n closeButtonTheme = \"light\",\n onClose,\n closeAriaLabel,\n children = null,\n content,\n containerSelector,\n hideTrigger = [],\n showTrigger = [],\n width,\n moveBy,\n hideWhenReferenceHidden = false,\n referenceWrapperClassName,\n tip = true,\n tooltipArrowClassName,\n modifiers = [],\n floating = false,\n color: colorProp,\n \"data-testid\": dataTestId\n }: TipseenProps,\n ref\n ) => {\n const color = colorProp ?? \"inverted\";\n\n const defaultDelayOpen =\n Array.isArray(showTrigger) && Array.isArray(hideTrigger) && showTrigger.length === 0 && showDelay > 0;\n\n const componentRef = useRef(null);\n const mergedRef = useMergeRef(ref, componentRef);\n const [delayedOpen, setDelayOpen] = useState(!defaultDelayOpen);\n const overrideCloseAriaLabel = closeAriaLabel || TIPSEEN_CLOSE_BUTTON_ARIA_LABEL;\n\n useEffect(() => {\n let timeout: NodeJS.Timeout;\n if (showDelay) {\n timeout = setTimeout(() => {\n setDelayOpen(true);\n }, showDelay);\n }\n return () => {\n clearTimeout(timeout);\n };\n }, [showDelay, setDelayOpen]);\n\n const textColor = useMemo(() => {\n return color === \"inverted\" ? \"onInverted\" : \"onPrimary\";\n }, [color]);\n const closeButtonColor = useMemo(() => {\n if (closeButtonTheme === \"light\") {\n return color === \"inverted\" ? ButtonColor.ON_INVERTED_BACKGROUND : ButtonColor.ON_PRIMARY_COLOR;\n } else {\n return closeButtonTheme;\n }\n }, [color, closeButtonTheme]);\n\n const TipseenWrapper = ref || id ? \"div\" : Fragment;\n const tooltipContent = (\n <div>\n <div className={cx(styles.tipseenHeader)}>\n {hideCloseButton ? null : (\n <IconButton\n hideTooltip\n className={cx(styles.tipseenCloseButton, {\n [styles.dark]: closeButtonTheme === \"dark\" || closeButtonTheme === \"fixed-dark\"\n })}\n onClick={onClose}\n size=\"xs\"\n kind=\"tertiary\"\n // @ts-ignore\n color={closeButtonColor}\n ariaLabel={overrideCloseAriaLabel}\n icon={CloseSmall}\n />\n )}\n <TipseenTitle text={title} className={cx(styles.tipseenTitle, titleClassName)} />\n </div>\n <Text color={textColor} type=\"text2\" element=\"p\" className={cx(styles.tipseenContent)}>\n <TipseenContext.Provider value={color}>{content}</TipseenContext.Provider>\n </Text>\n </div>\n );\n\n return (\n <TipseenWrapper ref={mergedRef} id={id} data-testid={dataTestId || getTestId(ComponentDefaultTestId.TIPSEEN, id)}>\n <Tooltip\n className={cx(styles.tipseenWrapper, className, {\n [styles.tipseenWrapperWithoutCustomWidth]: !width,\n [styles.floating]: floating\n })}\n arrowClassName={tooltipArrowClassName}\n style={width ? { width } : undefined}\n shouldShowOnMount={!defaultDelayOpen}\n position={position}\n animationType={animationType}\n hideDelay={hideDelay}\n showDelay={showDelay}\n hideTrigger={hideTrigger}\n showTrigger={showTrigger}\n content={tooltipContent}\n theme={color === \"inverted\" ? \"dark\" : \"primary\"}\n containerSelector={containerSelector}\n disableDialogSlide={false}\n moveBy={moveBy}\n hideWhenReferenceHidden={hideWhenReferenceHidden}\n referenceWrapperClassName={referenceWrapperClassName}\n tip={tip && !floating}\n modifiers={modifiers}\n open={defaultDelayOpen ? delayedOpen : undefined}\n forceRenderWithoutChildren={floating}\n >\n {children}\n </Tooltip>\n </TipseenWrapper>\n );\n }\n);\n\nexport default withStaticProps(Tipseen, {\n closeButtonThemes: TipseenCloseButtonThemeEnum,\n animationTypes: AnimationTypeEnum,\n hideShowTriggers: HideShowEventEnum,\n colors: TipseenColorEnum,\n positions: TooltipPositionsEnum\n});\n"],"names":["TipseenContext","React","createContext","withStaticProps","forwardRef","_ref","ref","className","id","_ref$position","position","_ref$animationType","animationType","_ref$hideDelay","hideDelay","_ref$showDelay","showDelay","title","titleClassName","hideCloseButton","_ref$closeButtonTheme","closeButtonTheme","onClose","closeAriaLabel","_ref$children","children","content","containerSelector","_ref$hideTrigger","hideTrigger","_ref$showTrigger","showTrigger","width","moveBy","_ref$hideWhenReferenc","hideWhenReferenceHidden","referenceWrapperClassName","_ref$tip","tip","tooltipArrowClassName","_ref$modifiers","modifiers","_ref$floating","floating","colorProp","color","dataTestId","defaultDelayOpen","Array","isArray","length","componentRef","useRef","mergedRef","useMergeRef","_useState","useState","_useState2","_slicedToArray","delayedOpen","setDelayOpen","overrideCloseAriaLabel","TIPSEEN_CLOSE_BUTTON_ARIA_LABEL","useEffect","timeout","setTimeout","clearTimeout","textColor","useMemo","closeButtonColor","ButtonColor","ON_INVERTED_BACKGROUND","ON_PRIMARY_COLOR","TipseenWrapper","Fragment","tooltipContent","createElement","cx","styles","tipseenHeader","IconButton","hideTooltip","tipseenCloseButton","_defineProperty","dark","onClick","size","kind","ariaLabel","icon","CloseSmall","TipseenTitle","text","tipseenTitle","Text","type","element","tipseenContent","Provider","value","getTestId","ComponentDefaultTestId","TIPSEEN","Tooltip","tipseenWrapper","tipseenWrapperWithoutCustomWidth","arrowClassName","style","undefined","shouldShowOnMount","theme","disableDialogSlide","open","forceRenderWithoutChildren","closeButtonThemes","TipseenCloseButtonThemeEnum","animationTypes","AnimationTypeEnum","hideShowTriggers","HideShowEventEnum","colors","TipseenColorEnum","positions","TooltipPositionsEnum"],"mappings":"iiCAqEO,IAAMA,EAAiBC,EAAMC,cAA4B,WAwIjDC,EAAAA,EAhIXC,GACF,SAAAC,EA8BEC,GACE,IA7BAC,EAASF,EAATE,UACAC,EAAEH,EAAFG,GAAEC,EAAAJ,EACFK,SAAAA,OAAW,IAAHD,EAAG,SAAQA,EAAAE,EAAAN,EACnBO,cAAAA,OAAgB,IAAHD,EAAG,SAAQA,EAAAE,EAAAR,EACxBS,UAAAA,OAAY,IAAHD,EAAG,EAACA,EAAAE,EAAAV,EACbW,UAAAA,OAAY,IAAHD,EAAG,IAAGA,EACfE,EAAKZ,EAALY,MACAC,EAAcb,EAAda,eACAC,EAAed,EAAfc,gBAAeC,EAAAf,EACfgB,iBAAAA,OAAmB,IAAHD,EAAG,QAAOA,EAC1BE,EAAOjB,EAAPiB,QACAC,EAAclB,EAAdkB,eAAcC,EAAAnB,EACdoB,SAAAA,OAAW,IAAHD,EAAG,KAAIA,EACfE,EAAOrB,EAAPqB,QACAC,EAAiBtB,EAAjBsB,kBAAiBC,EAAAvB,EACjBwB,Y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WC"}
1
+ {"version":3,"file":"Tipseen.js","sources":["../../../../src/components/Tipseen/Tipseen.tsx"],"sourcesContent":["import { forwardRef, Fragment, ReactElement, useEffect, useMemo, useRef, useState } from \"react\";\nimport cx from \"classnames\";\nimport { AnimationType as AnimationTypeEnum, HideShowEvent as HideShowEventEnum } from \"../Dialog/DialogConstants\";\nimport { DialogAnimationType, DialogTriggerEvent } from \"../Dialog/Dialog.types\";\nimport useMergeRef from \"../../hooks/useMergeRef\";\nimport Tooltip from \"../../components/Tooltip/Tooltip\";\nimport IconButton from \"../../components/IconButton/IconButton\";\nimport { CloseSmall } from \"@vibe/icons\";\nimport TipseenTitle from \"./TipseenTitle\";\nimport {\n TIPSEEN_CLOSE_BUTTON_ARIA_LABEL,\n TipseenCloseButtonTheme as TipseenCloseButtonThemeEnum,\n TipseenColor as TipseenColorEnum\n} from \"./TipseenConstants\";\nimport { TipseenCloseButtonTheme, TipseenColor } from \"./Tipseen.types\";\nimport { ElementContent, VibeComponent, VibeComponentProps, withStaticProps } from \"../../types\";\nimport { MoveBy } from \"../../types/MoveBy\";\nimport { Modifier } from \"react-popper\";\nimport { ComponentDefaultTestId } from \"../../tests/constants\";\nimport { getTestId } from \"../../tests/test-ids-utils\";\nimport Text from \"../Text/Text\";\nimport styles from \"./Tipseen.module.scss\";\nimport { ButtonColor } from \"../Button/ButtonConstants\";\nimport React from \"react\";\nimport { TooltipPositions } from \"../Tooltip/Tooltip.types\";\nimport { TooltipPositions as TooltipPositionsEnum } from \"../Tooltip/TooltipConstants\";\n\nexport interface TipseenProps extends VibeComponentProps {\n /**\n * Classname for overriding TipseenTitle styles\n */\n titleClassName?: string;\n position?: TooltipPositions;\n animationType?: DialogAnimationType;\n hideDelay?: number;\n showDelay?: number;\n title?: string;\n hideCloseButton?: boolean;\n children?: ReactElement;\n containerSelector?: string;\n hideTrigger?: DialogTriggerEvent | Array<DialogTriggerEvent>;\n showTrigger?: DialogTriggerEvent | Array<DialogTriggerEvent>;\n width?: number;\n moveBy?: MoveBy;\n hideWhenReferenceHidden?: boolean;\n referenceWrapperClassName?: string;\n /**\n * when false, the arrow of the tooltip is hidden\n */\n tip?: boolean;\n /** Class name for a tooltip's arrow */\n tooltipArrowClassName?: string;\n /**\n * PopperJS Modifiers type\n * https://popper.js.org/docs/v2/modifiers/\n */\n modifiers?: Array<Modifier<unknown>>;\n closeAriaLabel?: string;\n onClose?: (event?: React.MouseEvent<HTMLButtonElement>) => void;\n content: ElementContent;\n /**\n * Control the color of the Tipseen close button. Dark theme can be useful while presenting bright images under the tipseen image\n */\n closeButtonTheme?: TipseenCloseButtonTheme;\n floating?: boolean;\n /** The color of the Tipseen */\n color?: TipseenColor;\n}\n\nexport const TipseenContext = React.createContext<TipseenColor>(\"primary\");\n\nconst Tipseen: VibeComponent<TipseenProps> & {\n closeButtonThemes?: typeof TipseenCloseButtonThemeEnum;\n animationTypes?: typeof AnimationTypeEnum;\n hideShowTriggers?: typeof HideShowEventEnum;\n colors?: typeof TipseenColorEnum;\n positions?: typeof TooltipPositionsEnum;\n} = forwardRef(\n (\n {\n className,\n id,\n position = \"bottom\",\n animationType = \"expand\",\n hideDelay = 0,\n showDelay = 100,\n title,\n titleClassName,\n hideCloseButton,\n closeButtonTheme = \"light\",\n onClose,\n closeAriaLabel,\n children = null,\n content,\n containerSelector,\n hideTrigger = [],\n showTrigger = [],\n width,\n moveBy,\n hideWhenReferenceHidden = false,\n referenceWrapperClassName,\n tip = true,\n tooltipArrowClassName,\n modifiers = [],\n floating = false,\n color: colorProp,\n \"data-testid\": dataTestId\n }: TipseenProps,\n ref\n ) => {\n const color = colorProp ?? \"inverted\";\n\n const defaultDelayOpen =\n Array.isArray(showTrigger) && Array.isArray(hideTrigger) && showTrigger.length === 0 && showDelay > 0;\n\n const componentRef = useRef(null);\n const mergedRef = useMergeRef(ref, componentRef);\n const [delayedOpen, setDelayOpen] = useState(!defaultDelayOpen);\n const overrideCloseAriaLabel = closeAriaLabel || TIPSEEN_CLOSE_BUTTON_ARIA_LABEL;\n\n useEffect(() => {\n let timeout: NodeJS.Timeout;\n if (showDelay) {\n timeout = setTimeout(() => {\n setDelayOpen(true);\n }, showDelay);\n }\n return () => {\n clearTimeout(timeout);\n };\n }, [showDelay, setDelayOpen]);\n\n const textColor = useMemo(() => {\n return color === \"inverted\" ? \"onInverted\" : \"onPrimary\";\n }, [color]);\n const closeButtonColor = useMemo(() => {\n if (closeButtonTheme === \"light\") {\n return color === \"inverted\" ? ButtonColor.ON_INVERTED_BACKGROUND : ButtonColor.ON_PRIMARY_COLOR;\n } else {\n return closeButtonTheme;\n }\n }, [color, closeButtonTheme]);\n\n const TipseenWrapper = ref || id ? \"div\" : Fragment;\n const tooltipContent = (\n <div>\n <div className={cx(styles.tipseenHeader)}>\n {hideCloseButton ? null : (\n <IconButton\n hideTooltip\n className={cx(styles.tipseenCloseButton, {\n [styles.dark]: closeButtonTheme === \"dark\" || closeButtonTheme === \"fixed-dark\"\n })}\n onClick={onClose}\n size=\"xs\"\n kind=\"tertiary\"\n // @ts-ignore\n color={closeButtonColor}\n ariaLabel={overrideCloseAriaLabel}\n icon={CloseSmall}\n />\n )}\n <TipseenTitle text={title} className={cx(styles.tipseenTitle, titleClassName)} />\n </div>\n <Text color={textColor} type=\"text2\" element=\"p\" className={cx(styles.tipseenContent)}>\n <TipseenContext.Provider value={color}>{content}</TipseenContext.Provider>\n </Text>\n </div>\n );\n\n return (\n <TipseenWrapper ref={mergedRef} id={id} data-testid={dataTestId || getTestId(ComponentDefaultTestId.TIPSEEN, id)}>\n <Tooltip\n className={cx(styles.tipseenWrapper, className, {\n [styles.tipseenWrapperWithoutCustomWidth]: !width,\n [styles.floating]: floating\n })}\n arrowClassName={tooltipArrowClassName}\n style={width ? { width } : undefined}\n shouldShowOnMount={!defaultDelayOpen}\n position={position}\n animationType={animationType}\n hideDelay={hideDelay}\n showDelay={showDelay}\n hideTrigger={hideTrigger}\n showTrigger={showTrigger}\n content={tooltipContent}\n theme={color === \"inverted\" ? \"dark\" : \"primary\"}\n containerSelector={containerSelector}\n disableDialogSlide={false}\n moveBy={moveBy}\n hideWhenReferenceHidden={hideWhenReferenceHidden}\n referenceWrapperClassName={referenceWrapperClassName}\n tip={tip && !floating}\n modifiers={modifiers}\n open={defaultDelayOpen ? delayedOpen : undefined}\n forceRenderWithoutChildren={floating}\n >\n {children}\n </Tooltip>\n </TipseenWrapper>\n );\n }\n);\n\nexport default withStaticProps(Tipseen, {\n closeButtonThemes: TipseenCloseButtonThemeEnum,\n animationTypes: AnimationTypeEnum,\n hideShowTriggers: HideShowEventEnum,\n colors: TipseenColorEnum,\n positions: TooltipPositionsEnum\n});\n"],"names":["TipseenContext","React","createContext","withStaticProps","forwardRef","_ref","ref","className","id","_ref$position","position","_ref$animationType","animationType","_ref$hideDelay","hideDelay","_ref$showDelay","showDelay","title","titleClassName","hideCloseButton","_ref$closeButtonTheme","closeButtonTheme","onClose","closeAriaLabel","_ref$children","children","content","containerSelector","_ref$hideTrigger","hideTrigger","_ref$showTrigger","showTrigger","width","moveBy","_ref$hideWhenReferenc","hideWhenReferenceHidden","referenceWrapperClassName","_ref$tip","tip","tooltipArrowClassName","_ref$modifiers","modifiers","_ref$floating","floating","colorProp","color","dataTestId","defaultDelayOpen","Array","isArray","length","componentRef","useRef","mergedRef","useMergeRef","_useState","useState","_useState2","_slicedToArray","delayedOpen","setDelayOpen","overrideCloseAriaLabel","TIPSEEN_CLOSE_BUTTON_ARIA_LABEL","useEffect","timeout","setTimeout","clearTimeout","textColor","useMemo","closeButtonColor","ButtonColor","ON_INVERTED_BACKGROUND","ON_PRIMARY_COLOR","TipseenWrapper","Fragment","tooltipContent","createElement","cx","styles","tipseenHeader","IconButton","hideTooltip","tipseenCloseButton","_defineProperty","dark","onClick","size","kind","ariaLabel","icon","CloseSmall","TipseenTitle","text","tipseenTitle","Text","type","element","tipseenContent","Provider","value","getTestId","ComponentDefaultTestId","TIPSEEN","Tooltip","tipseenWrapper","tipseenWrapperWithoutCustomWidth","arrowClassName","style","undefined","shouldShowOnMount","theme","disableDialogSlide","open","forceRenderWithoutChildren","closeButtonThemes","TipseenCloseButtonThemeEnum","animationTypes","AnimationTypeEnum","hideShowTriggers","HideShowEventEnum","colors","TipseenColorEnum","positions","TooltipPositionsEnum"],"mappings":"iiCAqEO,IAAMA,EAAiBC,EAAMC,cAA4B,WAwIjDC,EAAAA,EAhIXC,GACF,SAAAC,EA8BEC,GACE,IA7BAC,EAASF,EAATE,UACAC,EAAEH,EAAFG,GAAEC,EAAAJ,EACFK,SAAAA,OAAW,IAAHD,EAAG,SAAQA,EAAAE,EAAAN,EACnBO,cAAAA,OAAgB,IAAHD,EAAG,SAAQA,EAAAE,EAAAR,EACxBS,UAAAA,OAAY,IAAHD,EAAG,EAACA,EAAAE,EAAAV,EACbW,UAAAA,OAAY,IAAHD,EAAG,IAAGA,EACfE,EAAKZ,EAALY,MACAC,EAAcb,EAAda,eACAC,EAAed,EAAfc,gBAAeC,EAAAf,EACfgB,iBAAAA,OAAmB,IAAHD,EAAG,QAAOA,EAC1BE,EAAOjB,EAAPiB,QACAC,EAAclB,EAAdkB,eAAcC,EAAAnB,EACdoB,SAAAA,OAAW,IAAHD,EAAG,KAAIA,EACfE,EAAOrB,EAAPqB,QACAC,EAAiBtB,EAAjBsB,kBAAiBC,EAAAvB,EACjBwB,YAAAA,OAAc,IAAHD,EAAG,GAAEA,EAAAE,EAAAzB,EAChB0B,YAAAA,OAAc,IAAHD,EAAG,GAAEA,EAChBE,EAAK3B,EAAL2B,MACAC,EAAM5B,EAAN4B,OAAMC,EAAA7B,EACN8B,wBAAAA,OAA0B,IAAHD,GAAQA,EAC/BE,EAAyB/B,EAAzB+B,0BAAyBC,EAAAhC,EACzBiC,IAAAA,QAAM,IAAHD,GAAOA,EACVE,GAAqBlC,EAArBkC,sBAAqBC,GAAAnC,EACrBoC,UAAAA,QAAY,IAAHD,GAAG,GAAEA,GAAAE,GAAArC,EACdsC,SAAAA,QAAW,IAAHD,IAAQA,G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WsE,EAAGC,EAAOmB,iBACpEhG,EAAA2E,cAAC5E,EAAekG,SAAQ,CAACC,MAAOtD,IAAQnB,KAK9C,OACEzB,gBAACwE,GAAc,CAACnE,IAAK+C,GAAW7C,GAAIA,EAAiB,cAAAsC,IAAcsD,EAAUC,EAAuBC,QAAS9F,IAC3GP,EAAC2E,cAAA2B,EACC,CAAAhG,UAAWsE,EAAGC,EAAO0B,eAAgBjG,EAAS4E,EAAAA,EAAA,CAAA,EAC3CL,EAAO2B,kCAAoCzE,GAC3C8C,EAAOnC,SAAWA,KAErB+D,eAAgBnE,GAChBoE,MAAO3E,EAAQ,CAAEA,MAAAA,QAAU4E,EAC3BC,mBAAoB9D,GACpBrC,SAAUA,EACVE,cAAeA,EACfE,UAAWA,EACXE,UAAWA,EACXa,YAAaA,EACbE,YAAaA,EACbL,QAASiD,GACTmC,MAAiB,aAAVjE,GAAuB,OAAS,UACvClB,kBAAmBA,EACnBoF,oBAAoB,EACpB9E,OAAQA,EACRE,wBAAyBA,EACzBC,0BAA2BA,EAC3BE,IAAKA,KAAQK,GACbF,UAAWA,GACXuE,KAAMjE,GAAmBY,QAAciD,EACvCK,2BAA4BtE,IAE3BlB,GAIT,IAGsC,CACtCyF,kBAAmBC,EACnBC,eAAgBC,EAChBC,iBAAkBC,EAClBC,OAAQC,EACRC,UAAWC"}
@@ -1,2 +1,2 @@
1
- import{slicedToArray as r}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{useState as e,useCallback as t}from"react";import i from"../useResizeObserver.js";function n(r,e){return!!r&&(r.scrollWidth>r.clientWidth||!e&&r.scrollHeight>r.clientHeight+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:0))}function o(o){var l=o.ref,u=o.ignoreHeightOverflow,c=void 0!==u&&u,a=o.tolerance,f=e((function(){return n(null==l?void 0:l.current,c,a)})),s=r(f,2),v=s[0],d=s[1],m=t((function(){var r=null==l?void 0:l.current;if(r){var e=n(r,c,a);d((function(r){return r!==e?e:r}))}}),[c,l,a]);return i({ref:l,callback:m,debounceTime:0}),v}export{o as default};
1
+ import{slicedToArray as e}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{useState as r,useCallback as l}from"react";import o from"../useResizeObserver.js";function t(e,r){var l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!e)return!1;var o=e.style.overflow;o&&"visible"!==o||(e.style.overflow="hidden");var t=e.scrollWidth>e.clientWidth||!r&&e.scrollHeight>e.clientHeight+l;return e.style.overflow=o,t}function i(i){var n=i.ref,u=i.ignoreHeightOverflow,c=void 0!==u&&u,f=i.tolerance,s=r((function(){return t(null==n?void 0:n.current,c,f)})),v=e(s,2),a=v[0],d=v[1],h=l((function(){d(t(null==n?void 0:n.current,c,f))}),[c,n,f]);return o({ref:n,callback:h,debounceTime:0}),a}export{i as default};
2
2
  //# sourceMappingURL=useIsOverflowing.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useIsOverflowing.js","sources":["../../../../src/hooks/useIsOverflowing/useIsOverflowing.ts"],"sourcesContent":["import { RefObject, useCallback, useState } from \"react\";\nimport useResizeObserver from \"../useResizeObserver\";\n\nfunction checkOverflow(element: HTMLElement, ignoreHeightOverflow: boolean, tolerance = 0) {\n if (!element) {\n return false;\n }\n const isOverflowingWidth = element.clientWidth < element.scrollWidth;\n const isOverflowingHeight = !ignoreHeightOverflow && element.clientHeight + tolerance < element.scrollHeight;\n return isOverflowingWidth || isOverflowingHeight;\n}\n\nexport default function useIsOverflowing({\n ref,\n ignoreHeightOverflow = false,\n tolerance\n}: {\n ref: RefObject<HTMLElement>;\n ignoreHeightOverflow?: boolean;\n tolerance?: number;\n}) {\n const [isOverflowing, setIsOverflowing] = useState<boolean>(() =>\n checkOverflow(ref?.current, ignoreHeightOverflow, tolerance)\n );\n const callback = useCallback(() => {\n const element = ref?.current;\n if (!element) return;\n\n const newOverflowState = checkOverflow(element, ignoreHeightOverflow, tolerance);\n setIsOverflowing(prevState => (prevState !== newOverflowState ? newOverflowState : prevState));\n }, [ignoreHeightOverflow, ref, tolerance]);\n\n useResizeObserver({\n ref,\n callback,\n debounceTime: 0\n });\n\n return isOverflowing;\n}\n"],"names":["checkOverflow","element","ignoreHeightOverflow","scrollWidth","clientWidth","scrollHeight","clientHeight","arguments","length","undefined","useIsOverflowing","_ref","ref","_ref$ignoreHeightOver","tolerance","_useState","useState","current","_useState2","_slicedToArray","isOverflowing","setIsOverflowing","callback","useCallback","newOverflowState","prevState","useResizeObserver","debounceTime"],"mappings":"wKAGA,SAASA,EAAcC,EAAsBC,GAC3C,QAAKD,IAG4CA,EAAQE,YAA9BF,EAAQG,cACNF,GAA2DD,EAAQI,aAA3CJ,EAAQK,cALsBC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,GAOxF,CAEwB,SAAAG,EAAgBC,GAQvC,IAPCC,EAAGD,EAAHC,IAAGC,EAAAF,EACHT,qBAAAA,OAAuB,IAAHW,GAAQA,EAC5BC,EAASH,EAATG,UAMAC,EAA0CC,GAAkB,WAAA,OAC1DhB,EAAcY,aAAA,EAAAA,EAAKK,QAASf,EAAsBY,MACnDI,EAAAC,EAAAJ,EAAA,GAFMK,EAAaF,EAAA,GAAEG,EAAgBH,EAAA,GAGhCI,EAAWC,GAAY,WAC3B,IAAMtB,EAAUW,aAAA,EAAAA,EAAKK,QACrB,GAAKhB,EAAL,CAEA,IAAMuB,EAAmBxB,EAAcC,EAASC,EAAsBY,GACtEO,GAAiB,SAAAI,GAAS,OAAKA,IAAcD,EAAmBA,EAAmBC,CAAS,GAH9E,CAIf,GAAE,CAACvB,EAAsBU,EAAKE,IAQ/B,OANAY,EAAkB,CAChBd,IAAAA,EACAU,SAAAA,EACAK,aAAc,IAGTP,CACT"}
1
+ {"version":3,"file":"useIsOverflowing.js","sources":["../../../../src/hooks/useIsOverflowing/useIsOverflowing.ts"],"sourcesContent":["import { RefObject, useCallback, useState } from \"react\";\nimport useResizeObserver from \"../useResizeObserver\";\n\nfunction checkOverflow(element: HTMLElement, ignoreHeightOverflow: boolean, tolerance = 0) {\n if (!element) {\n return false;\n }\n const curOverflow = element.style.overflow;\n if (!curOverflow || curOverflow === \"visible\") element.style.overflow = \"hidden\";\n const isOverflowing =\n element.clientWidth < element.scrollWidth ||\n (!ignoreHeightOverflow && element.clientHeight + tolerance < element.scrollHeight);\n element.style.overflow = curOverflow;\n return isOverflowing;\n}\n\nexport default function useIsOverflowing({\n ref,\n ignoreHeightOverflow = false,\n tolerance\n}: {\n ref: RefObject<HTMLElement>;\n ignoreHeightOverflow?: boolean;\n tolerance?: number;\n}) {\n const [isOverflowing, setIsOverflowing] = useState<boolean>(() =>\n checkOverflow(ref?.current, ignoreHeightOverflow, tolerance)\n );\n const callback = useCallback(() => {\n setIsOverflowing(checkOverflow(ref?.current, ignoreHeightOverflow, tolerance));\n }, [ignoreHeightOverflow, ref, tolerance]);\n\n useResizeObserver({\n ref,\n callback,\n debounceTime: 0\n });\n\n return isOverflowing;\n}\n"],"names":["checkOverflow","element","ignoreHeightOverflow","tolerance","arguments","length","undefined","curOverflow","style","overflow","isOverflowing","scrollWidth","clientWidth","scrollHeight","clientHeight","useIsOverflowing","_ref","ref","_ref$ignoreHeightOver","_useState","useState","current","_useState2","_slicedToArray","setIsOverflowing","callback","useCallback","useResizeObserver","debounceTime"],"mappings":"wKAGA,SAASA,EAAcC,EAAsBC,GAA4C,IAAbC,EAASC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,EACtF,IAAKH,EACH,OAAO,EAET,IAAMM,EAAcN,EAAQO,MAAMC,SAC7BF,GAA+B,YAAhBA,IAA2BN,EAAQO,MAAMC,SAAW,UACxE,IAAMC,EACkBT,EAAQU,YAA9BV,EAAQW,cACNV,GAA2DD,EAAQY,aAA3CZ,EAAQa,aAAeX,EAEnD,OADAF,EAAQO,MAAMC,SAAWF,EAClBG,CACT,CAEwB,SAAAK,EAAgBC,GAQvC,IAPCC,EAAGD,EAAHC,IAAGC,EAAAF,EACHd,qBAAAA,OAAuB,IAAHgB,GAAQA,EAC5Bf,EAASa,EAATb,UAMAgB,EAA0CC,GAAkB,WAAA,OAC1DpB,EAAciB,aAAA,EAAAA,EAAKI,QAASnB,EAAsBC,MACnDmB,EAAAC,EAAAJ,EAAA,GAFMT,EAAaY,EAAA,GAAEE,EAAgBF,EAAA,GAGhCG,EAAWC,GAAY,WAC3BF,EAAiBxB,EAAciB,aAAA,EAAAA,EAAKI,QAASnB,EAAsBC,GACpE,GAAE,CAACD,EAAsBe,EAAKd,IAQ/B,OANAwB,EAAkB,CAChBV,IAAAA,EACAQ,SAAAA,EACAG,aAAc,IAGTlB,CACT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibe/core",
3
- "version": "3.9.4-alpha-7b07f.0",
3
+ "version": "3.10.0",
4
4
  "description": "Official monday.com UI resources for application development in React.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -82,7 +82,7 @@
82
82
  },
83
83
  "dependencies": {
84
84
  "@popperjs/core": "2.11.6",
85
- "@vibe/icons": "1.2.0",
85
+ "@vibe/icons": "1.3.0",
86
86
  "a11y-dialog": "^7.5.2",
87
87
  "body-scroll-lock": "^4.0.0-beta.0",
88
88
  "browserslist-config-monday": "1.0.6",
@@ -268,5 +268,5 @@
268
268
  "browserslist": [
269
269
  "extends browserslist-config-monday"
270
270
  ],
271
- "gitHead": "7d8f3878bd83d17feb8f710371e7b9d66a3a6906"
271
+ "gitHead": "dcbba68233537cc594d28e235e1c849d76e152af"
272
272
  }