@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 +44 -36
- package/build/index.js.map +1 -1
- package/build/index.mjs +45 -37
- 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/inlineAlert/InlineAlert.d.ts.map +1 -1
- package/build/types/inputs/_BottomSheet.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/circularButton/CircularButton.story.tsx +53 -84
- package/src/common/hooks/useVirtualKeyboard.ts +21 -0
- package/src/inlineAlert/InlineAlert.tsx +4 -6
- 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
|
@@ -4866,20 +4866,17 @@ function InlineAlert({
|
|
|
4866
4866
|
className,
|
|
4867
4867
|
children
|
|
4868
4868
|
}) {
|
|
4869
|
-
return /*#__PURE__*/jsxRuntime.
|
|
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.
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
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
|
-
|
|
6323
|
-
enterFrom: "np-bottom-sheet-v2-backdrop
|
|
6324
|
-
|
|
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(
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
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
|
|
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
|
-
}
|
|
6367
|
-
})
|
|
6374
|
+
})
|
|
6375
|
+
}, floatingKey)
|
|
6368
6376
|
})
|
|
6369
6377
|
})
|
|
6370
6378
|
})]
|