@contentful/f36-tooltip
Advanced tools
Comparing version 4.0.1-beta.2558 to 4.0.1-beta.2590
105
dist/main.js
@@ -7,2 +7,3 @@ var $9z4kG$emotion = require("emotion"); | ||
var $9z4kG$contentfulf36core = require("@contentful/f36-core"); | ||
var $9z4kG$reactjsxruntime = require("react/jsx-runtime"); | ||
@@ -22,2 +23,3 @@ function $parcel$export(e, n, v, s) { | ||
const $a07a638cc7489f76$var$tooltipMargin = `calc(-1 * ((1rem * (10 / ${$parcel$interopDefault($9z4kG$contentfulf36tokens).fontBaseDefault})) / 2))`; | ||
@@ -142,7 +144,8 @@ const $a07a638cc7489f76$var$tooltipChevronSize = `calc(1rem * (10 / ${$parcel$interopDefault($9z4kG$contentfulf36tokens).fontBaseDefault}))`; | ||
}; | ||
if (!content || isDisabled) return(/*#__PURE__*/ $parcel$interopDefault($9z4kG$react).createElement($9z4kG$contentfulf36core.Box, { | ||
if (!content || isDisabled) return(/*#__PURE__*/ $9z4kG$reactjsxruntime.jsx($9z4kG$contentfulf36core.Box, { | ||
as: HtmlTag, | ||
className: targetWrapperClassName | ||
}, children)); | ||
const tooltip = /*#__PURE__*/ $parcel$interopDefault($9z4kG$react).createElement($9z4kG$contentfulf36core.Box, { | ||
className: targetWrapperClassName, | ||
children: children | ||
})); | ||
const tooltip = /*#__PURE__*/ $9z4kG$reactjsxruntime.jsxs($9z4kG$contentfulf36core.Box, { | ||
as: "span", | ||
@@ -161,42 +164,58 @@ id: tooltipId, | ||
}, | ||
...attributes.popper | ||
}, /*#__PURE__*/ $parcel$interopDefault($9z4kG$react).createElement("span", null, content), /*#__PURE__*/ $parcel$interopDefault($9z4kG$react).createElement("span", { | ||
className: styles.tooltipArrow, | ||
"data-placement": attributes.popper && attributes.popper['data-popper-placement'], | ||
ref: setArrowRef, | ||
style: popperStyles.arrow | ||
...attributes.popper, | ||
children: [ | ||
/*#__PURE__*/ $9z4kG$reactjsxruntime.jsx("span", { | ||
children: content | ||
}), | ||
/*#__PURE__*/ $9z4kG$reactjsxruntime.jsx("span", { | ||
className: styles.tooltipArrow, | ||
"data-placement": attributes.popper && attributes.popper['data-popper-placement'], | ||
ref: setArrowRef, | ||
style: popperStyles.arrow | ||
}) | ||
] | ||
}); | ||
return(/*#__PURE__*/ $9z4kG$reactjsxruntime.jsxs($9z4kG$reactjsxruntime.Fragment, { | ||
children: [ | ||
show ? /*#__PURE__*/ $9z4kG$reactjsxruntime.jsx($9z4kG$reactjsxruntime.Fragment, { | ||
children: usePortal ? /*#__PURE__*/ $9z4kG$reactjsxruntime.jsx($9z4kG$contentfulf36utils.Portal, { | ||
children: tooltip | ||
}) : tooltip | ||
}) : null, | ||
/*#__PURE__*/ $9z4kG$reactjsxruntime.jsx($9z4kG$contentfulf36core.Box, { | ||
as: HtmlTag, | ||
ref: elementRef, | ||
className: $9z4kG$emotion.cx(styles.tooltipContainer, targetWrapperClassName), | ||
onMouseEnter: (evt)=>{ | ||
setIsHoveringTarget(true); | ||
if (onMouseOver) onMouseOver(evt); | ||
}, | ||
onMouseLeave: (evt)=>{ | ||
setTimeout(()=>setIsHoveringTarget(false) | ||
, hideDelay); | ||
if (onMouseLeave) onMouseLeave(evt); | ||
}, | ||
onFocus: (evt)=>{ | ||
setIsHoveringTarget(true); | ||
if (onFocus) onFocus(evt); | ||
}, | ||
onBlur: (evt)=>{ | ||
setTimeout(()=>setIsHoveringTarget(false) | ||
, hideDelay); | ||
if (onBlur) onBlur(evt); | ||
}, | ||
onKeyDown: (evt)=>{ | ||
if (evt.key === 'Escape') setTimeout(()=>setIsHoveringTarget(false) | ||
, hideDelay); | ||
if (onKeyDown) onKeyDown(evt); | ||
}, | ||
...otherProps, | ||
children: $parcel$interopDefault($9z4kG$react).Children.map(children, (child)=>{ | ||
if (/*#__PURE__*/ $parcel$interopDefault($9z4kG$react).isValidElement(child)) return(/*#__PURE__*/ $parcel$interopDefault($9z4kG$react).cloneElement(child, { | ||
'aria-describedby': tooltipId | ||
})); | ||
}) | ||
}) | ||
] | ||
})); | ||
return(/*#__PURE__*/ $parcel$interopDefault($9z4kG$react).createElement($parcel$interopDefault($9z4kG$react).Fragment, null, show ? /*#__PURE__*/ $parcel$interopDefault($9z4kG$react).createElement($parcel$interopDefault($9z4kG$react).Fragment, null, usePortal ? /*#__PURE__*/ $parcel$interopDefault($9z4kG$react).createElement($9z4kG$contentfulf36utils.Portal, null, tooltip) : tooltip) : null, /*#__PURE__*/ $parcel$interopDefault($9z4kG$react).createElement($9z4kG$contentfulf36core.Box, { | ||
as: HtmlTag, | ||
ref: elementRef, | ||
className: $9z4kG$emotion.cx(styles.tooltipContainer, targetWrapperClassName), | ||
onMouseEnter: (evt)=>{ | ||
setIsHoveringTarget(true); | ||
if (onMouseOver) onMouseOver(evt); | ||
}, | ||
onMouseLeave: (evt)=>{ | ||
setTimeout(()=>setIsHoveringTarget(false) | ||
, hideDelay); | ||
if (onMouseLeave) onMouseLeave(evt); | ||
}, | ||
onFocus: (evt)=>{ | ||
setIsHoveringTarget(true); | ||
if (onFocus) onFocus(evt); | ||
}, | ||
onBlur: (evt)=>{ | ||
setTimeout(()=>setIsHoveringTarget(false) | ||
, hideDelay); | ||
if (onBlur) onBlur(evt); | ||
}, | ||
onKeyDown: (evt)=>{ | ||
if (evt.key === 'Escape') setTimeout(()=>setIsHoveringTarget(false) | ||
, hideDelay); | ||
if (onKeyDown) onKeyDown(evt); | ||
}, | ||
...otherProps | ||
}, $parcel$interopDefault($9z4kG$react).Children.map(children, (child)=>{ | ||
if (/*#__PURE__*/ $parcel$interopDefault($9z4kG$react).isValidElement(child)) return(/*#__PURE__*/ $parcel$interopDefault($9z4kG$react).cloneElement(child, { | ||
'aria-describedby': tooltipId | ||
})); | ||
})))); | ||
}; | ||
@@ -203,0 +222,0 @@ |
@@ -7,2 +7,3 @@ import {cx as $7kzxa$cx, css as $7kzxa$css} from "emotion"; | ||
import {useId as $7kzxa$useId, Box as $7kzxa$Box} from "@contentful/f36-core"; | ||
import {jsx as $7kzxa$jsx, jsxs as $7kzxa$jsxs, Fragment as $7kzxa$Fragment} from "react/jsx-runtime"; | ||
@@ -14,2 +15,3 @@ | ||
const $49750c3007fb3a4b$var$tooltipMargin = `calc(-1 * ((1rem * (10 / ${$7kzxa$contentfulf36tokens.fontBaseDefault})) / 2))`; | ||
@@ -134,7 +136,8 @@ const $49750c3007fb3a4b$var$tooltipChevronSize = `calc(1rem * (10 / ${$7kzxa$contentfulf36tokens.fontBaseDefault}))`; | ||
}; | ||
if (!content || isDisabled) return(/*#__PURE__*/ $7kzxa$react.createElement($7kzxa$Box, { | ||
if (!content || isDisabled) return(/*#__PURE__*/ $7kzxa$jsx($7kzxa$Box, { | ||
as: HtmlTag, | ||
className: targetWrapperClassName | ||
}, children)); | ||
const tooltip = /*#__PURE__*/ $7kzxa$react.createElement($7kzxa$Box, { | ||
className: targetWrapperClassName, | ||
children: children | ||
})); | ||
const tooltip = /*#__PURE__*/ $7kzxa$jsxs($7kzxa$Box, { | ||
as: "span", | ||
@@ -153,42 +156,58 @@ id: tooltipId, | ||
}, | ||
...attributes.popper | ||
}, /*#__PURE__*/ $7kzxa$react.createElement("span", null, content), /*#__PURE__*/ $7kzxa$react.createElement("span", { | ||
className: styles.tooltipArrow, | ||
"data-placement": attributes.popper && attributes.popper['data-popper-placement'], | ||
ref: setArrowRef, | ||
style: popperStyles.arrow | ||
...attributes.popper, | ||
children: [ | ||
/*#__PURE__*/ $7kzxa$jsx("span", { | ||
children: content | ||
}), | ||
/*#__PURE__*/ $7kzxa$jsx("span", { | ||
className: styles.tooltipArrow, | ||
"data-placement": attributes.popper && attributes.popper['data-popper-placement'], | ||
ref: setArrowRef, | ||
style: popperStyles.arrow | ||
}) | ||
] | ||
}); | ||
return(/*#__PURE__*/ $7kzxa$jsxs($7kzxa$Fragment, { | ||
children: [ | ||
show ? /*#__PURE__*/ $7kzxa$jsx($7kzxa$Fragment, { | ||
children: usePortal ? /*#__PURE__*/ $7kzxa$jsx($7kzxa$Portal, { | ||
children: tooltip | ||
}) : tooltip | ||
}) : null, | ||
/*#__PURE__*/ $7kzxa$jsx($7kzxa$Box, { | ||
as: HtmlTag, | ||
ref: elementRef, | ||
className: $7kzxa$cx(styles.tooltipContainer, targetWrapperClassName), | ||
onMouseEnter: (evt)=>{ | ||
setIsHoveringTarget(true); | ||
if (onMouseOver) onMouseOver(evt); | ||
}, | ||
onMouseLeave: (evt)=>{ | ||
setTimeout(()=>setIsHoveringTarget(false) | ||
, hideDelay); | ||
if (onMouseLeave) onMouseLeave(evt); | ||
}, | ||
onFocus: (evt)=>{ | ||
setIsHoveringTarget(true); | ||
if (onFocus) onFocus(evt); | ||
}, | ||
onBlur: (evt)=>{ | ||
setTimeout(()=>setIsHoveringTarget(false) | ||
, hideDelay); | ||
if (onBlur) onBlur(evt); | ||
}, | ||
onKeyDown: (evt)=>{ | ||
if (evt.key === 'Escape') setTimeout(()=>setIsHoveringTarget(false) | ||
, hideDelay); | ||
if (onKeyDown) onKeyDown(evt); | ||
}, | ||
...otherProps, | ||
children: $7kzxa$react.Children.map(children, (child)=>{ | ||
if (/*#__PURE__*/ $7kzxa$react.isValidElement(child)) return(/*#__PURE__*/ $7kzxa$react.cloneElement(child, { | ||
'aria-describedby': tooltipId | ||
})); | ||
}) | ||
}) | ||
] | ||
})); | ||
return(/*#__PURE__*/ $7kzxa$react.createElement($7kzxa$react.Fragment, null, show ? /*#__PURE__*/ $7kzxa$react.createElement($7kzxa$react.Fragment, null, usePortal ? /*#__PURE__*/ $7kzxa$react.createElement($7kzxa$Portal, null, tooltip) : tooltip) : null, /*#__PURE__*/ $7kzxa$react.createElement($7kzxa$Box, { | ||
as: HtmlTag, | ||
ref: elementRef, | ||
className: $7kzxa$cx(styles.tooltipContainer, targetWrapperClassName), | ||
onMouseEnter: (evt)=>{ | ||
setIsHoveringTarget(true); | ||
if (onMouseOver) onMouseOver(evt); | ||
}, | ||
onMouseLeave: (evt)=>{ | ||
setTimeout(()=>setIsHoveringTarget(false) | ||
, hideDelay); | ||
if (onMouseLeave) onMouseLeave(evt); | ||
}, | ||
onFocus: (evt)=>{ | ||
setIsHoveringTarget(true); | ||
if (onFocus) onFocus(evt); | ||
}, | ||
onBlur: (evt)=>{ | ||
setTimeout(()=>setIsHoveringTarget(false) | ||
, hideDelay); | ||
if (onBlur) onBlur(evt); | ||
}, | ||
onKeyDown: (evt)=>{ | ||
if (evt.key === 'Escape') setTimeout(()=>setIsHoveringTarget(false) | ||
, hideDelay); | ||
if (onKeyDown) onKeyDown(evt); | ||
}, | ||
...otherProps | ||
}, $7kzxa$react.Children.map(children, (child)=>{ | ||
if (/*#__PURE__*/ $7kzxa$react.isValidElement(child)) return(/*#__PURE__*/ $7kzxa$react.cloneElement(child, { | ||
'aria-describedby': tooltipId | ||
})); | ||
})))); | ||
}; | ||
@@ -195,0 +214,0 @@ |
{ | ||
"name": "@contentful/f36-tooltip", | ||
"version": "4.0.1-beta.2558+269facc7", | ||
"version": "4.0.1-beta.2590+bfd9a9a5", | ||
"description": "Forma 36: Tooltip component", | ||
@@ -10,5 +10,5 @@ "scripts": { | ||
"@babel/runtime": "^7.6.2", | ||
"@contentful/f36-core": "4.0.1-beta.2558+269facc7", | ||
"@contentful/f36-tokens": "4.0.1-beta.2558+269facc7", | ||
"@contentful/f36-utils": "4.0.1-beta.2558+269facc7", | ||
"@contentful/f36-core": "4.0.1-beta.2590+bfd9a9a5", | ||
"@contentful/f36-tokens": "4.0.1-beta.2590+bfd9a9a5", | ||
"@contentful/f36-utils": "4.0.1-beta.2590+bfd9a9a5", | ||
"@popperjs/core": "^2.4.4", | ||
@@ -39,3 +39,3 @@ "csstype": "^3.0.5", | ||
}, | ||
"gitHead": "269facc7450d443ce6caf11f590c5957cbfdcfa0" | ||
"gitHead": "bfd9a9a5affcb943abbc97639ebae3abc67844fd" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
57588
485