@transferwise/components 46.42.0 → 46.42.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/build/index.js CHANGED
@@ -6262,6 +6262,26 @@ const PolymorphicWithOverrides = /*#__PURE__*/React.forwardRef(function Polymorp
6262
6262
  });
6263
6263
  });
6264
6264
 
6265
+ /**
6266
+ * This progressive enhancement uses an experimental API, it might change,
6267
+ * and at the time of authoring is not supported on iOS or mobile Firefox.
6268
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/VirtualKeyboard
6269
+ */
6270
+ function useVirtualKeyboard() {
6271
+ React.useEffect(() => {
6272
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access, functional/immutable-data */
6273
+ if ('virtualKeyboard' in navigator) {
6274
+ const virtualKeyboard = navigator.virtualKeyboard;
6275
+ const initialOverlaysContent = virtualKeyboard.overlaysContent;
6276
+ virtualKeyboard.overlaysContent = true;
6277
+ return () => {
6278
+ virtualKeyboard.overlaysContent = initialOverlaysContent;
6279
+ };
6280
+ }
6281
+ /* eslint-enable @typescript-eslint/no-unsafe-member-access, functional/immutable-data */
6282
+ }, []);
6283
+ }
6284
+
6265
6285
  function PreventScroll() {
6266
6286
  overlays.usePreventScroll();
6267
6287
  return null;
@@ -6277,6 +6297,7 @@ function BottomSheet({
6277
6297
  onClose,
6278
6298
  onCloseEnd
6279
6299
  }) {
6300
+ useVirtualKeyboard();
6280
6301
  const {
6281
6302
  refs,
6282
6303
  context
@@ -6316,29 +6337,21 @@ function BottomSheet({
6316
6337
  },
6317
6338
  afterLeave: onCloseEnd,
6318
6339
  children: [/*#__PURE__*/jsxRuntime.jsx(react$1.Transition.Child, {
6319
- enter: "np-bottom-sheet-v2-backdrop-container--enter",
6320
- enterFrom: "np-bottom-sheet-v2-backdrop-container--enter-from",
6321
- leave: "np-bottom-sheet-v2-backdrop-container--leave",
6322
- leaveTo: "np-bottom-sheet-v2-backdrop-container--leave-to",
6323
- children: /*#__PURE__*/jsxRuntime.jsx("div", {
6324
- className: "np-bottom-sheet-v2-backdrop"
6325
- })
6340
+ className: "np-bottom-sheet-v2-backdrop",
6341
+ enterFrom: "np-bottom-sheet-v2-backdrop--closed",
6342
+ leaveTo: "np-bottom-sheet-v2-backdrop--closed"
6326
6343
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
6327
6344
  className: "np-bottom-sheet-v2",
6328
- children: /*#__PURE__*/jsxRuntime.jsx(react$1.Transition.Child, {
6329
- className: "np-bottom-sheet-v2-content",
6330
- enter: "np-bottom-sheet-v2-content--enter",
6331
- enterFrom: "np-bottom-sheet-v2-content--enter-from",
6332
- leave: "np-bottom-sheet-v2-content--leave",
6333
- leaveTo: "np-bottom-sheet-v2-content--leave-to",
6334
- children: /*#__PURE__*/jsxRuntime.jsx(focus.FocusScope, {
6335
- children: /*#__PURE__*/jsxRuntime.jsx(react.FloatingFocusManager, {
6336
- context: context,
6337
- initialFocus: initialFocusRef,
6338
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
6339
- // Force inner state invalidation on open
6345
+ children: /*#__PURE__*/jsxRuntime.jsx(focus.FocusScope, {
6346
+ children: /*#__PURE__*/jsxRuntime.jsx(react.FloatingFocusManager, {
6347
+ context: context,
6348
+ initialFocus: initialFocusRef,
6349
+ children: /*#__PURE__*/jsxRuntime.jsx(React.Fragment, {
6350
+ children: /*#__PURE__*/jsxRuntime.jsxs(react$1.Transition.Child, {
6340
6351
  ref: refs.setFloating,
6341
- className: "np-bottom-sheet-v2-content-inner-container",
6352
+ className: "np-bottom-sheet-v2-content",
6353
+ enterFrom: "np-bottom-sheet-v2-content--closed",
6354
+ leaveTo: "np-bottom-sheet-v2-content--closed",
6342
6355
  ...getFloatingProps(),
6343
6356
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
6344
6357
  className: "np-bottom-sheet-v2-header",
@@ -6349,9 +6362,7 @@ function BottomSheet({
6349
6362
  }
6350
6363
  })
6351
6364
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
6352
- className: classNames__default.default('np-bottom-sheet-v2-content-inner', title && 'np-bottom-sheet-v2-content-inner--has-title', {
6353
- 'np-bottom-sheet-v2-content-inner--padding-md': padding === 'md'
6354
- }),
6365
+ className: classNames__default.default('np-bottom-sheet-v2-content-inner', title && 'np-bottom-sheet-v2-content-inner--has-title', padding === 'md' && 'np-bottom-sheet-v2-content-inner--padding-md'),
6355
6366
  children: [title ? /*#__PURE__*/jsxRuntime.jsx("h2", {
6356
6367
  className: "np-bottom-sheet-v2-title np-text-title-body",
6357
6368
  children: title
@@ -6360,8 +6371,8 @@ function BottomSheet({
6360
6371
  children: children
6361
6372
  })]
6362
6373
  })]
6363
- }, floatingKey)
6364
- })
6374
+ })
6375
+ }, floatingKey)
6365
6376
  })
6366
6377
  })
6367
6378
  })]