@transferwise/components 46.41.1 → 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
@@ -4866,20 +4866,17 @@ function InlineAlert({
4866
4866
  className,
4867
4867
  children
4868
4868
  }) {
4869
- return /*#__PURE__*/jsxRuntime.jsx("div", {
4869
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
4870
4870
  role: "alert",
4871
4871
  id: id,
4872
4872
  className: classNames__default.default('alert alert-detach', `alert-${type === exports.Sentiment.NEGATIVE || type === exports.Sentiment.ERROR ? 'danger' : type}`, className),
4873
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
4874
- className: "d-inline-flex",
4875
- children: [type !== exports.Sentiment.NEUTRAL && type !== exports.Sentiment.PENDING && /*#__PURE__*/jsxRuntime.jsx(StatusIcon, {
4876
- sentiment: type,
4877
- size: exports.Size.SMALL
4878
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
4879
- className: "np-text-body-default",
4880
- children: children
4881
- })]
4882
- })
4873
+ children: [type !== exports.Sentiment.NEUTRAL && type !== exports.Sentiment.PENDING && /*#__PURE__*/jsxRuntime.jsx(StatusIcon, {
4874
+ sentiment: type,
4875
+ size: exports.Size.SMALL
4876
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
4877
+ className: "np-text-body-default",
4878
+ children: children
4879
+ })]
4883
4880
  });
4884
4881
  }
4885
4882
 
@@ -6265,6 +6262,26 @@ const PolymorphicWithOverrides = /*#__PURE__*/React.forwardRef(function Polymorp
6265
6262
  });
6266
6263
  });
6267
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
+
6268
6285
  function PreventScroll() {
6269
6286
  overlays.usePreventScroll();
6270
6287
  return null;
@@ -6280,6 +6297,7 @@ function BottomSheet({
6280
6297
  onClose,
6281
6298
  onCloseEnd
6282
6299
  }) {
6300
+ useVirtualKeyboard();
6283
6301
  const {
6284
6302
  refs,
6285
6303
  context
@@ -6319,29 +6337,21 @@ function BottomSheet({
6319
6337
  },
6320
6338
  afterLeave: onCloseEnd,
6321
6339
  children: [/*#__PURE__*/jsxRuntime.jsx(react$1.Transition.Child, {
6322
- enter: "np-bottom-sheet-v2-backdrop-container--enter",
6323
- enterFrom: "np-bottom-sheet-v2-backdrop-container--enter-from",
6324
- leave: "np-bottom-sheet-v2-backdrop-container--leave",
6325
- leaveTo: "np-bottom-sheet-v2-backdrop-container--leave-to",
6326
- children: /*#__PURE__*/jsxRuntime.jsx("div", {
6327
- className: "np-bottom-sheet-v2-backdrop"
6328
- })
6340
+ className: "np-bottom-sheet-v2-backdrop",
6341
+ enterFrom: "np-bottom-sheet-v2-backdrop--closed",
6342
+ leaveTo: "np-bottom-sheet-v2-backdrop--closed"
6329
6343
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
6330
6344
  className: "np-bottom-sheet-v2",
6331
- children: /*#__PURE__*/jsxRuntime.jsx(react$1.Transition.Child, {
6332
- className: "np-bottom-sheet-v2-content",
6333
- enter: "np-bottom-sheet-v2-content--enter",
6334
- enterFrom: "np-bottom-sheet-v2-content--enter-from",
6335
- leave: "np-bottom-sheet-v2-content--leave",
6336
- leaveTo: "np-bottom-sheet-v2-content--leave-to",
6337
- children: /*#__PURE__*/jsxRuntime.jsx(focus.FocusScope, {
6338
- children: /*#__PURE__*/jsxRuntime.jsx(react.FloatingFocusManager, {
6339
- context: context,
6340
- initialFocus: initialFocusRef,
6341
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
6342
- // 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, {
6343
6351
  ref: refs.setFloating,
6344
- 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",
6345
6355
  ...getFloatingProps(),
6346
6356
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
6347
6357
  className: "np-bottom-sheet-v2-header",
@@ -6352,9 +6362,7 @@ function BottomSheet({
6352
6362
  }
6353
6363
  })
6354
6364
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
6355
- className: classNames__default.default('np-bottom-sheet-v2-content-inner', title && 'np-bottom-sheet-v2-content-inner--has-title', {
6356
- 'np-bottom-sheet-v2-content-inner--padding-md': padding === 'md'
6357
- }),
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'),
6358
6366
  children: [title ? /*#__PURE__*/jsxRuntime.jsx("h2", {
6359
6367
  className: "np-bottom-sheet-v2-title np-text-title-body",
6360
6368
  children: title
@@ -6363,8 +6371,8 @@ function BottomSheet({
6363
6371
  children: children
6364
6372
  })]
6365
6373
  })]
6366
- }, floatingKey)
6367
- })
6374
+ })
6375
+ }, floatingKey)
6368
6376
  })
6369
6377
  })
6370
6378
  })]