@cypress-design/react-tooltip 0.7.0 → 0.7.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.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +6 -0
- package/Tooltip.tsx +5 -3
- package/dist/Tooltip.d.ts.map +1 -1
- package/dist/index.es.mjs +9 -3
- package/dist/index.es.mjs.map +1 -1
- package/dist/index.umd.js +9 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -2,5 +2,5 @@ $ yarn build:module && yarn build:types
|
|
|
2
2
|
$ rollup -c ./rollup.config.mjs
|
|
3
3
|
[36m
|
|
4
4
|
[1m./index.ts[22m → [1m./dist/index.umd.js, ./dist/index.es.mjs[22m...[39m
|
|
5
|
-
[32mcreated [1m./dist/index.umd.js, ./dist/index.es.mjs[22m in [
|
|
5
|
+
[32mcreated [1m./dist/index.umd.js, ./dist/index.es.mjs[22m in [1m47.7s[22m[39m
|
|
6
6
|
$ tsc --project ./tsconfig.build.json
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @cypress-design/react-tooltip
|
|
2
2
|
|
|
3
|
+
## 0.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#310](https://github.com/cypress-io/cypress-design/pull/310) [`a3a323f`](https://github.com/cypress-io/cypress-design/commit/a3a323fde7acf5e5407b298b4faa0c90314c6139) Thanks [@elevatebart](https://github.com/elevatebart)! - Add-eslint-react-hooks
|
|
8
|
+
|
|
3
9
|
## 0.7.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/Tooltip.tsx
CHANGED
|
@@ -109,6 +109,8 @@ export const Tooltip: React.FC<
|
|
|
109
109
|
whileElementsMounted: autoUpdate,
|
|
110
110
|
})
|
|
111
111
|
|
|
112
|
+
const contextHook = useDismiss(context)
|
|
113
|
+
|
|
112
114
|
const { getReferenceProps, getFloatingProps } = useInteractions([
|
|
113
115
|
useHover(context, {
|
|
114
116
|
handleClose: interactive ? safePolygon() : undefined,
|
|
@@ -118,11 +120,11 @@ export const Tooltip: React.FC<
|
|
|
118
120
|
enabled: !disabled && !forceOpen,
|
|
119
121
|
}),
|
|
120
122
|
useRole(context, { role: 'tooltip' }),
|
|
121
|
-
...(!forceOpen ? [
|
|
123
|
+
...(!forceOpen ? [contextHook] : []),
|
|
122
124
|
])
|
|
123
125
|
|
|
124
126
|
const placementSide = calculatedPlacement.split(
|
|
125
|
-
'-'
|
|
127
|
+
'-',
|
|
126
128
|
)[0] as keyof typeof ROTATE_MAP
|
|
127
129
|
const arrowRotate = ROTATE_MAP[placementSide]
|
|
128
130
|
|
|
@@ -220,7 +222,7 @@ export const Tooltip: React.FC<
|
|
|
220
222
|
<div
|
|
221
223
|
className={clsx(
|
|
222
224
|
'rounded text-[16px] leading-[24px] min-w-[160px] text-center p-[8px] relative z-20',
|
|
223
|
-
colors.background
|
|
225
|
+
colors.background,
|
|
224
226
|
)}
|
|
225
227
|
>
|
|
226
228
|
{popper}
|
package/dist/Tooltip.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"./","sources":["Tooltip.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EACL,SAAS,EAcV,MAAM,qCAAqC,CAAA;AAE5C,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AASD,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAC5B,YAAY,GAAG,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"./","sources":["Tooltip.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EACL,SAAS,EAcV,MAAM,qCAAqC,CAAA;AAE5C,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AASD,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAC5B,YAAY,GAAG,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CA8K/C,CAAA;AAED,eAAe,OAAO,CAAA"}
|
package/dist/index.es.mjs
CHANGED
|
@@ -16,7 +16,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
16
16
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
17
17
|
PERFORMANCE OF THIS SOFTWARE.
|
|
18
18
|
***************************************************************************** */
|
|
19
|
-
/* global Reflect, Promise */
|
|
19
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
var __assign = function() {
|
|
@@ -50,7 +50,12 @@ function __spreadArray(to, from, pack) {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
53
|
-
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
56
|
+
var e = new Error(message);
|
|
57
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
58
|
+
};
|
|
54
59
|
|
|
55
60
|
function getSide(placement) {
|
|
56
61
|
return placement.split('-')[0];
|
|
@@ -33552,6 +33557,7 @@ var Tooltip = function (_a) {
|
|
|
33552
33557
|
],
|
|
33553
33558
|
whileElementsMounted: autoUpdate,
|
|
33554
33559
|
}), x = _f.x, y = _f.y, reference = _f.reference, floating = _f.floating, strategy = _f.strategy, calculatedPlacement = _f.placement, context = _f.context, _g = _f.middlewareData.arrow, _h = _g === void 0 ? {} : _g, arrowX = _h.x, arrowY = _h.y;
|
|
33560
|
+
var contextHook = useDismiss(context);
|
|
33555
33561
|
var _j = useInteractions(__spreadArray([
|
|
33556
33562
|
useHover(context, {
|
|
33557
33563
|
handleClose: interactive ? safePolygon() : undefined,
|
|
@@ -33561,7 +33567,7 @@ var Tooltip = function (_a) {
|
|
|
33561
33567
|
enabled: !disabled && !forceOpen,
|
|
33562
33568
|
}),
|
|
33563
33569
|
useRole(context, { role: 'tooltip' })
|
|
33564
|
-
], (!forceOpen ? [
|
|
33570
|
+
], (!forceOpen ? [contextHook] : []), true)), getReferenceProps = _j.getReferenceProps, getFloatingProps = _j.getFloatingProps;
|
|
33565
33571
|
var placementSide = calculatedPlacement.split('-')[0];
|
|
33566
33572
|
var arrowRotate = ROTATE_MAP[placementSide];
|
|
33567
33573
|
var arrowXRule = 'left', arrowYRule = 'top';
|