@cypress-design/react-tooltip 0.3.1 → 0.3.3
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/CHANGELOG.md +12 -0
- package/Tooltip.rootstory.tsx +3 -3
- package/Tooltip.tsx +13 -11
- package/dist/Tooltip.d.ts.map +1 -1
- package/dist/index.es.mjs +11 -16
- package/dist/index.es.mjs.map +1 -1
- package/dist/index.umd.js +11 -16
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @cypress-design/react-tooltip
|
|
2
2
|
|
|
3
|
+
## 0.3.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#91](https://github.com/cypress-io/cypress-design/pull/91) [`d716000`](https://github.com/cypress-io/cypress-design/commit/d7160002406e8801fb1a77e57c39b61a1215c18a) Thanks [@elevatebart](https://github.com/elevatebart)! - fix: avoid blinky tooltips [for website](https://github.com/cypress-io/cypress.io/issues/247)
|
|
8
|
+
|
|
9
|
+
## 0.3.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#89](https://github.com/cypress-io/cypress-design/pull/89) [`eb1c9a6`](https://github.com/cypress-io/cypress-design/commit/eb1c9a6ea0fc2ceb4b506fa73f77d1245d2967bc) Thanks [@elevatebart](https://github.com/elevatebart)! - fix: remove border of tooltips (never been in designs)
|
|
14
|
+
|
|
3
15
|
## 0.3.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/Tooltip.rootstory.tsx
CHANGED
|
@@ -16,7 +16,7 @@ export default ({
|
|
|
16
16
|
<div className="center flex flex-col items-center gap-20">
|
|
17
17
|
<Tooltip
|
|
18
18
|
className="bg-red-200 p-4 w-1/2"
|
|
19
|
-
popper={<div className="bg-jade-200 text-gray-800 p-4">
|
|
19
|
+
popper={<div className="bg-jade-200 text-gray-800 p-4">PopovDyn</div>}
|
|
20
20
|
color={color}
|
|
21
21
|
placement={placement}
|
|
22
22
|
tabIndex={tabIndex}
|
|
@@ -27,7 +27,7 @@ export default ({
|
|
|
27
27
|
<Tooltip
|
|
28
28
|
className="bg-red-200 p-4 w-1/2"
|
|
29
29
|
popper={
|
|
30
|
-
<div className="h-200px flex items-center justify-center">
|
|
30
|
+
<div className="h-200px flex items-center justify-center">Popov</div>
|
|
31
31
|
}
|
|
32
32
|
color={color}
|
|
33
33
|
placement="top"
|
|
@@ -37,7 +37,7 @@ export default ({
|
|
|
37
37
|
</Tooltip>
|
|
38
38
|
<Tooltip
|
|
39
39
|
className="bg-red-200 p-4 w-1/2"
|
|
40
|
-
popper={<div>
|
|
40
|
+
popper={<div>PopovInt</div>}
|
|
41
41
|
color={color}
|
|
42
42
|
placement={placement}
|
|
43
43
|
interactive
|
package/Tooltip.tsx
CHANGED
|
@@ -103,7 +103,7 @@ export const Tooltip: React.FC<
|
|
|
103
103
|
fn: (obj) => obj,
|
|
104
104
|
}
|
|
105
105
|
: flip(),
|
|
106
|
-
offset(0),
|
|
106
|
+
offset(interactive ? 0 : 16),
|
|
107
107
|
arrow({ element: arrowRef, padding: 24 }),
|
|
108
108
|
],
|
|
109
109
|
whileElementsMounted: autoUpdate,
|
|
@@ -144,14 +144,14 @@ export const Tooltip: React.FC<
|
|
|
144
144
|
switch (color) {
|
|
145
145
|
case 'light':
|
|
146
146
|
return {
|
|
147
|
-
svg: 'stroke-
|
|
148
|
-
block: 'text-gray-900
|
|
147
|
+
svg: 'stroke-none fill-white',
|
|
148
|
+
block: 'text-gray-900 shadow-gray-100 border-transparent ',
|
|
149
149
|
background: 'bg-white',
|
|
150
150
|
}
|
|
151
151
|
case 'dark':
|
|
152
152
|
return {
|
|
153
|
-
svg: 'stroke-
|
|
154
|
-
block: 'text-white shadow-gray-800 border-
|
|
153
|
+
svg: 'stroke-none fill-gray-900',
|
|
154
|
+
block: 'text-white shadow-gray-800 border-transparent',
|
|
155
155
|
background: 'bg-gray-900',
|
|
156
156
|
}
|
|
157
157
|
default:
|
|
@@ -180,7 +180,7 @@ export const Tooltip: React.FC<
|
|
|
180
180
|
position: strategy,
|
|
181
181
|
top: y ?? '',
|
|
182
182
|
left: x ?? '',
|
|
183
|
-
padding: '16px',
|
|
183
|
+
...(interactive ? { padding: '16px' } : {}),
|
|
184
184
|
},
|
|
185
185
|
})}
|
|
186
186
|
>
|
|
@@ -193,18 +193,20 @@ export const Tooltip: React.FC<
|
|
|
193
193
|
>
|
|
194
194
|
<svg
|
|
195
195
|
ref={arrowRef}
|
|
196
|
-
viewBox="0 0 48
|
|
196
|
+
viewBox="0 0 48 24"
|
|
197
197
|
width="24"
|
|
198
|
-
height="
|
|
198
|
+
height="12"
|
|
199
199
|
className={clsx('absolute z-10', colors.svg)}
|
|
200
200
|
style={{
|
|
201
201
|
transform: `rotate(${arrowRotate}deg)`,
|
|
202
202
|
filter:
|
|
203
203
|
placementSide === 'bottom' || color === 'dark'
|
|
204
|
-
?
|
|
204
|
+
? 'drop-shadow(0 1px 1px rgba(225, 227, 237, .3))'
|
|
205
205
|
: 'drop-shadow(0 1px 1px rgba(225, 227, 237, .8))',
|
|
206
|
-
[arrowXRule]: `${arrowX ?? -
|
|
207
|
-
[arrowYRule]: `${
|
|
206
|
+
[arrowXRule]: `${arrowX ?? (interactive ? 0 : -16)}px`,
|
|
207
|
+
[arrowYRule]: `${
|
|
208
|
+
arrowY ? arrowY + 6 : interactive ? 6 : -10
|
|
209
|
+
}px`,
|
|
208
210
|
}}
|
|
209
211
|
fill="none"
|
|
210
212
|
>
|
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,EAaV,MAAM,qCAAqC,CAAA;AAE5C,MAAM,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AASD,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAC5B,YAAY,GAAG,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CA+K/C,CAAA;AAED,eAAe,OAAO,CAAA"}
|
package/dist/index.es.mjs
CHANGED
|
@@ -30341,7 +30341,7 @@ var Tooltip = function (_a) {
|
|
|
30341
30341
|
fn: function (obj) { return obj; }
|
|
30342
30342
|
}
|
|
30343
30343
|
: flip(),
|
|
30344
|
-
offset(0),
|
|
30344
|
+
offset(interactive ? 0 : 16),
|
|
30345
30345
|
arrow({ element: arrowRef, padding: 24 }),
|
|
30346
30346
|
],
|
|
30347
30347
|
whileElementsMounted: autoUpdate
|
|
@@ -30376,14 +30376,14 @@ var Tooltip = function (_a) {
|
|
|
30376
30376
|
switch (color) {
|
|
30377
30377
|
case 'light':
|
|
30378
30378
|
return {
|
|
30379
|
-
svg: 'stroke-
|
|
30380
|
-
block: 'text-gray-900
|
|
30379
|
+
svg: 'stroke-none fill-white',
|
|
30380
|
+
block: 'text-gray-900 shadow-gray-100 border-transparent ',
|
|
30381
30381
|
background: 'bg-white'
|
|
30382
30382
|
};
|
|
30383
30383
|
case 'dark':
|
|
30384
30384
|
return {
|
|
30385
|
-
svg: 'stroke-
|
|
30386
|
-
block: 'text-white shadow-gray-800 border-
|
|
30385
|
+
svg: 'stroke-none fill-gray-900',
|
|
30386
|
+
block: 'text-white shadow-gray-800 border-transparent',
|
|
30387
30387
|
background: 'bg-gray-900'
|
|
30388
30388
|
};
|
|
30389
30389
|
default:
|
|
@@ -30395,26 +30395,21 @@ var Tooltip = function (_a) {
|
|
|
30395
30395
|
React.createElement("div", __assign({}, getReferenceProps(), { ref: reference, className: className }, rest), children),
|
|
30396
30396
|
React.createElement(FloatingPortal, null, open && !disabled && (React.createElement("div", __assign({}, getFloatingProps({
|
|
30397
30397
|
ref: floating,
|
|
30398
|
-
style: {
|
|
30399
|
-
position: strategy,
|
|
30400
|
-
top: y !== null && y !== void 0 ? y : '',
|
|
30401
|
-
left: x !== null && x !== void 0 ? x : '',
|
|
30402
|
-
padding: '16px'
|
|
30403
|
-
}
|
|
30398
|
+
style: __assign({ position: strategy, top: y !== null && y !== void 0 ? y : '', left: x !== null && x !== void 0 ? x : '' }, (interactive ? { padding: '16px' } : {}))
|
|
30404
30399
|
})),
|
|
30405
30400
|
React.createElement("div", { className: clsx('rounded shadow border', [
|
|
30406
30401
|
colors.background,
|
|
30407
30402
|
colors.block,
|
|
30408
30403
|
(!x || !y) && 'invisible',
|
|
30409
30404
|
]) },
|
|
30410
|
-
React.createElement("svg", { ref: arrowRef, viewBox: "0 0 48
|
|
30405
|
+
React.createElement("svg", { ref: arrowRef, viewBox: "0 0 48 24", width: "24", height: "12", className: clsx('absolute z-10', colors.svg), style: (_b = {
|
|
30411
30406
|
transform: "rotate(" + arrowRotate + "deg)",
|
|
30412
30407
|
filter: placementSide === 'bottom' || color === 'dark'
|
|
30413
|
-
?
|
|
30408
|
+
? 'drop-shadow(0 1px 1px rgba(225, 227, 237, .3))'
|
|
30414
30409
|
: 'drop-shadow(0 1px 1px rgba(225, 227, 237, .8))'
|
|
30415
30410
|
},
|
|
30416
|
-
_b[arrowXRule] = (arrowX !== null && arrowX !== void 0 ? arrowX : -
|
|
30417
|
-
_b[arrowYRule] = (arrowY
|
|
30411
|
+
_b[arrowXRule] = (arrowX !== null && arrowX !== void 0 ? arrowX : (interactive ? 0 : -16)) + "px",
|
|
30412
|
+
_b[arrowYRule] = (arrowY ? arrowY + 6 : interactive ? 6 : -10) + "px",
|
|
30418
30413
|
_b), fill: "none" },
|
|
30419
30414
|
React.createElement("rect", { x: "0", y: "0", width: "48", height: "4", strokeWidth: "0" }),
|
|
30420
30415
|
React.createElement("path", { d: "M 0 3 C 12 3 18 18 24 18 C 30 18 36 3 48 3", strokeWidth: "2" })),
|
|
@@ -30423,5 +30418,5 @@ var Tooltip = function (_a) {
|
|
|
30423
30418
|
|
|
30424
30419
|
export { Tooltip as default };
|
|
30425
30420
|
|
|
30426
|
-
/* <windicss-keep class="container stroke-
|
|
30421
|
+
/* <windicss-keep class="container stroke-none fill-white text-gray-900 shadow-gray-100 border-transparent bg-white fill-gray-900 text-white shadow-gray-800 bg-gray-900 rounded shadow border invisible absolute z-10 text-16px leading-24px min-w-160px text-center p-8px relative z-20"> */
|
|
30427
30422
|
//# sourceMappingURL=index.es.mjs.map
|