@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 +36 -25
- package/build/index.js.map +1 -1
- package/build/index.mjs +37 -26
- package/build/index.mjs.map +1 -1
- package/build/main.css +41 -51
- package/build/styles/inputs/SelectInput.css +41 -51
- package/build/styles/main.css +41 -51
- package/build/types/common/hooks/useVirtualKeyboard.d.ts +7 -0
- package/build/types/common/hooks/useVirtualKeyboard.d.ts.map +1 -0
- package/build/types/inputs/_BottomSheet.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/circularButton/CircularButton.story.tsx +53 -84
- package/src/common/hooks/useVirtualKeyboard.ts +21 -0
- package/src/inputs/SelectInput.css +41 -51
- package/src/inputs/_BottomSheet.less +35 -49
- package/src/inputs/_BottomSheet.tsx +22 -27
- package/src/inputs/_Popover.less +2 -2
- package/src/main.css +41 -51
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
|
-
|
|
6320
|
-
enterFrom: "np-bottom-sheet-v2-backdrop
|
|
6321
|
-
|
|
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(
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
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
|
|
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
|
-
}
|
|
6364
|
-
})
|
|
6374
|
+
})
|
|
6375
|
+
}, floatingKey)
|
|
6365
6376
|
})
|
|
6366
6377
|
})
|
|
6367
6378
|
})]
|