@transferwise/components 0.0.0-experimental-5bcac43 → 0.0.0-experimental-14afc1f
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 +63 -60
- package/build/index.js.map +1 -1
- package/build/index.mjs +63 -60
- package/build/index.mjs.map +1 -1
- package/build/main.css +16 -0
- package/build/styles/logo/Logo.css +16 -0
- package/build/styles/main.css +16 -0
- package/build/types/inputs/_BottomSheet.d.ts.map +1 -1
- package/build/types/inputs/_Popover.d.ts.map +1 -1
- package/build/types/logo/Logo.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/inputs/_BottomSheet.tsx +33 -28
- package/src/inputs/_Popover.tsx +23 -20
- package/src/logo/Logo.css +16 -0
- package/src/logo/Logo.js +2 -7
- package/src/logo/Logo.less +16 -0
- package/src/logo/__snapshots__/Logo.spec.js.snap +104 -8
- package/src/main.css +16 -0
- package/src/provider/theme/ThemeProvider.story.tsx +0 -21
package/build/index.mjs
CHANGED
|
@@ -13,11 +13,11 @@ import { Transition, Listbox } from '@headlessui/react';
|
|
|
13
13
|
import mergeProps from 'merge-props';
|
|
14
14
|
import { useSyncExternalStore } from 'use-sync-external-store/shim/index.js';
|
|
15
15
|
import { useFloating, useDismiss, useRole, useInteractions, FloatingPortal, FloatingFocusManager, offset, flip, shift, size, autoUpdate } from '@floating-ui/react';
|
|
16
|
+
import { FocusScope } from '@react-aria/focus';
|
|
16
17
|
import { usePreventScroll } from '@react-aria/overlays';
|
|
17
18
|
import { CSSTransition } from 'react-transition-group';
|
|
18
19
|
import { isUndefined, isNumber, isEmpty, isNull } from '@transferwise/neptune-validation';
|
|
19
20
|
import { createPortal } from 'react-dom';
|
|
20
|
-
import { FocusScope } from '@react-aria/focus';
|
|
21
21
|
import { usePopper } from 'react-popper';
|
|
22
22
|
import throttle from 'lodash.throttle';
|
|
23
23
|
import { Flag, Illustration } from '@wise/art';
|
|
@@ -4551,15 +4551,14 @@ const Logo = ({
|
|
|
4551
4551
|
}) => {
|
|
4552
4552
|
const LogoSm = svgPaths[`WISE_FLAG${type === LogoType.WISE_PLATFORM ? '_PLATFORM' : ''}${inverse ? '_INVERSE' : ''}`];
|
|
4553
4553
|
const LogoMd = svgPaths[`${type}${inverse ? '_INVERSE' : ''}`];
|
|
4554
|
-
const screenMd = useScreenSize(Breakpoint.MEDIUM);
|
|
4555
4554
|
return /*#__PURE__*/jsxs("span", {
|
|
4556
4555
|
"aria-label": type === LogoType.WISE ? 'Wise' : 'Wise Business' | type === LogoType.WISE_PLATFORM ? 'Wise Platform' : 'Wise Business',
|
|
4557
4556
|
role: "img",
|
|
4558
4557
|
className: classNames(className, 'np-logo'),
|
|
4559
|
-
children: [
|
|
4560
|
-
className: "np-logo-svg"
|
|
4561
|
-
}),
|
|
4562
|
-
className: "np-logo-svg"
|
|
4558
|
+
children: [/*#__PURE__*/jsx(LogoSm, {
|
|
4559
|
+
className: "np-logo-svg np-logo-svg--size-sm"
|
|
4560
|
+
}), /*#__PURE__*/jsx(LogoMd, {
|
|
4561
|
+
className: "np-logo-svg np-logo-svg--size-md"
|
|
4563
4562
|
})]
|
|
4564
4563
|
});
|
|
4565
4564
|
};
|
|
@@ -5490,35 +5489,37 @@ function BottomSheet({
|
|
|
5490
5489
|
enterFrom: "np-bottom-sheet-v2-content--enter-from",
|
|
5491
5490
|
leave: "np-bottom-sheet-v2-content--leave",
|
|
5492
5491
|
leaveTo: "np-bottom-sheet-v2-content--leave-to",
|
|
5493
|
-
children: /*#__PURE__*/jsx(
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
'np-bottom-sheet-v2-content-inner
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5492
|
+
children: /*#__PURE__*/jsx(FocusScope, {
|
|
5493
|
+
children: /*#__PURE__*/jsx(FloatingFocusManager, {
|
|
5494
|
+
context: context,
|
|
5495
|
+
initialFocus: initialFocusRef,
|
|
5496
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
5497
|
+
// Force inner state invalidation on open
|
|
5498
|
+
ref: refs.setFloating,
|
|
5499
|
+
className: "np-bottom-sheet-v2-content-inner-container",
|
|
5500
|
+
...getFloatingProps(),
|
|
5501
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
5502
|
+
className: "np-bottom-sheet-v2-header",
|
|
5503
|
+
children: /*#__PURE__*/jsx(CloseButton, {
|
|
5504
|
+
size: Size.SMALL,
|
|
5505
|
+
onClick: () => {
|
|
5506
|
+
onClose?.();
|
|
5507
|
+
}
|
|
5508
|
+
})
|
|
5509
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
5510
|
+
className: classNames('np-bottom-sheet-v2-content-inner', title && 'np-bottom-sheet-v2-content-inner--has-title', {
|
|
5511
|
+
'np-bottom-sheet-v2-content-inner--padding-md': padding === 'md'
|
|
5512
|
+
}),
|
|
5513
|
+
children: [title ? /*#__PURE__*/jsx("h2", {
|
|
5514
|
+
className: "np-bottom-sheet-v2-title np-text-title-body",
|
|
5515
|
+
children: title
|
|
5516
|
+
}) : null, /*#__PURE__*/jsx("div", {
|
|
5517
|
+
className: "np-bottom-sheet-v2-body np-text-body-default",
|
|
5518
|
+
children: children
|
|
5519
|
+
})]
|
|
5519
5520
|
})]
|
|
5520
|
-
})
|
|
5521
|
-
}
|
|
5521
|
+
}, floatingKey)
|
|
5522
|
+
})
|
|
5522
5523
|
})
|
|
5523
5524
|
})
|
|
5524
5525
|
})]
|
|
@@ -5619,32 +5620,34 @@ function Popover({
|
|
|
5619
5620
|
setFloatingKey(prev => prev + 1);
|
|
5620
5621
|
},
|
|
5621
5622
|
afterLeave: onCloseEnd,
|
|
5622
|
-
children: /*#__PURE__*/jsx(
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
'np-popover-v2-container
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
'np-popover-v2
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5623
|
+
children: /*#__PURE__*/jsx(FocusScope, {
|
|
5624
|
+
children: /*#__PURE__*/jsx(FloatingFocusManager, {
|
|
5625
|
+
context: context,
|
|
5626
|
+
children: /*#__PURE__*/jsx("div", {
|
|
5627
|
+
// Force inner state invalidation on open
|
|
5628
|
+
ref: refs.setFloating,
|
|
5629
|
+
className: classNames('np-popover-v2-container', {
|
|
5630
|
+
'np-popover-v2-container--size-md': size$1 === 'md',
|
|
5631
|
+
'np-popover-v2-container--size-lg': size$1 === 'lg'
|
|
5632
|
+
})
|
|
5633
|
+
// eslint-disable-next-line react/forbid-dom-props
|
|
5634
|
+
,
|
|
5635
|
+
style: floatingStyles,
|
|
5636
|
+
...getFloatingProps(),
|
|
5637
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
5638
|
+
className: classNames('np-popover-v2', title && 'np-popover-v2--has-title', {
|
|
5639
|
+
'np-popover-v2--padding-md': padding === 'md'
|
|
5640
|
+
}),
|
|
5641
|
+
children: [title ? /*#__PURE__*/jsx("h2", {
|
|
5642
|
+
className: "np-popover-v2-title np-text-title-body",
|
|
5643
|
+
children: title
|
|
5644
|
+
}) : null, /*#__PURE__*/jsx("div", {
|
|
5645
|
+
className: "np-popover-v2-content np-text-body-default",
|
|
5646
|
+
children: children
|
|
5647
|
+
})]
|
|
5648
|
+
})
|
|
5649
|
+
}, floatingKey)
|
|
5650
|
+
})
|
|
5648
5651
|
})
|
|
5649
5652
|
})
|
|
5650
5653
|
})
|