@cypress-design/react-tooltip 0.7.0 → 0.8.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.
@@ -2,5 +2,5 @@ $ yarn build:module && yarn build:types
2
2
  $ rollup -c ./rollup.config.mjs
3
3
  
4
4
  ./index.ts → ./dist/index.umd.js, ./dist/index.es.mjs...
5
- created ./dist/index.umd.js, ./dist/index.es.mjs in 42.9s
5
+ created ./dist/index.umd.js, ./dist/index.es.mjs in 47.5s
6
6
  $ tsc --project ./tsconfig.build.json
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @cypress-design/react-tooltip
2
2
 
3
+ ## 0.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#321](https://github.com/cypress-io/cypress-design/pull/321) [`1c61ac8`](https://github.com/cypress-io/cypress-design/commit/1c61ac8b242e085c3a6a0c93890110d8b17072fe) Thanks [@emilmilanov](https://github.com/emilmilanov)! - increasing drop-shadow for two increments
8
+
9
+ ## 0.7.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#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
14
+
3
15
  ## 0.7.0
4
16
 
5
17
  ### 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 ? [useDismiss(context)] : []),
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
 
@@ -145,13 +147,13 @@ export const Tooltip: React.FC<
145
147
  case 'light':
146
148
  return {
147
149
  svg: 'stroke-none fill-white',
148
- block: 'text-gray-900 shadow-gray-100 border-transparent ',
150
+ block: 'text-gray-900 border-transparent',
149
151
  background: 'bg-white',
150
152
  }
151
153
  case 'dark':
152
154
  return {
153
155
  svg: 'stroke-none fill-gray-900',
154
- block: 'text-white shadow-gray-800 border-transparent',
156
+ block: 'text-white border-transparent',
155
157
  background: 'bg-gray-900',
156
158
  }
157
159
  default:
@@ -186,7 +188,7 @@ export const Tooltip: React.FC<
186
188
  })}
187
189
  >
188
190
  <div
189
- className={clsx('rounded shadow border', [
191
+ className={clsx('rounded shadow-tooltip border', [
190
192
  colors.background,
191
193
  colors.block,
192
194
  (!x || !y) && 'invisible',
@@ -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}
@@ -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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HETHER 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 ? [useDismiss(context)] : []), true)), getReferenceProps = _j.getReferenceProps, getFloatingProps = _j.getFloatingProps;
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';
@@ -33582,13 +33588,13 @@ var Tooltip = function (_a) {
33582
33588
  case 'light':
33583
33589
  return {
33584
33590
  svg: 'stroke-none fill-white',
33585
- block: 'text-gray-900 shadow-gray-100 border-transparent ',
33591
+ block: 'text-gray-900 border-transparent',
33586
33592
  background: 'bg-white',
33587
33593
  };
33588
33594
  case 'dark':
33589
33595
  return {
33590
33596
  svg: 'stroke-none fill-gray-900',
33591
- block: 'text-white shadow-gray-800 border-transparent',
33597
+ block: 'text-white border-transparent',
33592
33598
  background: 'bg-gray-900',
33593
33599
  };
33594
33600
  default:
@@ -33602,7 +33608,7 @@ var Tooltip = function (_a) {
33602
33608
  ref: floating,
33603
33609
  style: __assign({ position: strategy, top: y !== null && y !== void 0 ? y : '', left: x !== null && x !== void 0 ? x : '' }, (interactive ? { padding: '16px' } : {})),
33604
33610
  })),
33605
- React.createElement("div", { className: clsx('rounded shadow border', [
33611
+ React.createElement("div", { className: clsx('rounded shadow-tooltip border', [
33606
33612
  colors.background,
33607
33613
  colors.block,
33608
33614
  (!x || !y) && 'invisible',
@@ -33624,4 +33630,4 @@ var Tooltip = function (_a) {
33624
33630
  export { Tooltip as default };
33625
33631
  //# sourceMappingURL=index.es.mjs.map
33626
33632
 
33627
- /* <wind-keep class="stroke-none fill-white block 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 transform filter text-[16px] leading-[24px] min-w-[160px] text-center p-[8px] relative z-20 drop-shadow"> */
33633
+ /* <wind-keep class="stroke-none fill-white block text-gray-900 border-transparent bg-white fill-gray-900 text-white bg-gray-900 rounded shadow-tooltip border invisible absolute z-10 transform filter text-[16px] leading-[24px] min-w-[160px] text-center p-[8px] relative z-20 drop-shadow"> */