@transferwise/components 0.0.0-experimental-a4db2ca → 0.0.0-experimental-2ce5185
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 -11
- package/build/index.js.map +1 -1
- package/build/index.mjs +35 -10
- package/build/index.mjs.map +1 -1
- package/build/types/button/Button.messages.d.ts +3 -3
- package/build/types/button/classMap.d.ts +6 -6
- package/build/types/common/panel/Panel.d.ts +1 -1
- package/build/types/common/responsivePanel/ResponsivePanel.d.ts +1 -1
- package/build/types/drawer/Drawer.d.ts +36 -19
- package/build/types/drawer/Drawer.d.ts.map +1 -1
- package/build/types/drawer/index.d.ts +1 -2
- package/build/types/drawer/index.d.ts.map +1 -1
- package/build/types/flowNavigation/backButton/BackButton.d.ts +3 -3
- package/build/types/flowNavigation/backButton/index.d.ts +1 -1
- package/build/types/flowNavigation/backButton/index.d.ts.map +1 -1
- package/build/types/index.d.ts +0 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/select/index.d.ts +1 -1
- package/build/types/select/index.d.ts.map +1 -1
- package/build/types/select/option/index.d.ts +1 -1
- package/build/types/select/option/index.d.ts.map +1 -1
- package/build/types/tabs/TabList.d.ts +1 -1
- package/build/types/tabs/TabPanel.d.ts +4 -4
- package/build/types/tabs/Tabs.d.ts.map +1 -1
- package/build/types/test-utils/story-config.d.ts.map +1 -1
- package/build/types/typeahead/Typeahead.d.ts.map +1 -1
- package/build/types/typeahead/typeaheadOption/TypeaheadOption.d.ts.map +1 -1
- package/build/types/upload/Upload.d.ts.map +1 -1
- package/build/types/upload/Upload.messages.d.ts +20 -20
- package/build/types/upload/steps/completeStep/completeStep.d.ts +10 -10
- package/build/types/upload/steps/mediaUploadStep/mediaUploadStep.d.ts +8 -8
- package/build/types/upload/steps/processingStep/processingStep.d.ts +8 -8
- package/build/types/upload/steps/uploadImageStep/uploadImageStep.d.ts +9 -9
- package/build/types/upload/steps/uploadImageStep/uploadImageStep.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/drawer/{Drawer.tsx → Drawer.js} +31 -26
- package/src/drawer/{Drawer.rtl.spec.tsx → Drawer.rtl.spec.js} +2 -4
- package/src/drawer/{Drawer.story.tsx → Drawer.story.js} +28 -20
- package/src/drawer/index.js +1 -0
- package/src/index.ts +0 -1
- package/src/drawer/index.ts +0 -2
- /package/src/drawer/__snapshots__/{Drawer.rtl.spec.tsx.snap → Drawer.rtl.spec.js.snap} +0 -0
package/build/index.js
CHANGED
|
@@ -11,13 +11,13 @@ var reactTransitionGroup = require('react-transition-group');
|
|
|
11
11
|
var focus = require('@react-aria/focus');
|
|
12
12
|
var reactDom = require('react-dom');
|
|
13
13
|
var neptuneValidation = require('@transferwise/neptune-validation');
|
|
14
|
+
var PropTypes = require('prop-types');
|
|
14
15
|
var formatting = require('@transferwise/formatting');
|
|
15
16
|
var react$1 = require('@headlessui/react');
|
|
16
17
|
var mergeProps = require('merge-props');
|
|
17
18
|
var react = require('@floating-ui/react');
|
|
18
19
|
var overlays = require('@react-aria/overlays');
|
|
19
20
|
var reactPopper = require('react-popper');
|
|
20
|
-
var PropTypes = require('prop-types');
|
|
21
21
|
var art = require('@wise/art');
|
|
22
22
|
var clamp$2 = require('lodash.clamp');
|
|
23
23
|
var debounce = require('lodash.debounce');
|
|
@@ -46,8 +46,8 @@ function _interopNamespace(e) {
|
|
|
46
46
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
47
47
|
var classNames__default = /*#__PURE__*/_interopDefault(classNames);
|
|
48
48
|
var commonmark__default = /*#__PURE__*/_interopDefault(commonmark);
|
|
49
|
-
var mergeProps__default = /*#__PURE__*/_interopDefault(mergeProps);
|
|
50
49
|
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
50
|
+
var mergeProps__default = /*#__PURE__*/_interopDefault(mergeProps);
|
|
51
51
|
var clamp__default = /*#__PURE__*/_interopDefault(clamp$2);
|
|
52
52
|
var debounce__default = /*#__PURE__*/_interopDefault(debounce);
|
|
53
53
|
|
|
@@ -2744,15 +2744,15 @@ const SlidingPanel = /*#__PURE__*/React.forwardRef(({
|
|
|
2744
2744
|
}));
|
|
2745
2745
|
});
|
|
2746
2746
|
|
|
2747
|
-
|
|
2747
|
+
const Drawer = ({
|
|
2748
2748
|
children,
|
|
2749
2749
|
className,
|
|
2750
2750
|
footerContent,
|
|
2751
2751
|
headerTitle,
|
|
2752
2752
|
onClose,
|
|
2753
|
-
open
|
|
2754
|
-
position
|
|
2755
|
-
}) {
|
|
2753
|
+
open,
|
|
2754
|
+
position
|
|
2755
|
+
}) => {
|
|
2756
2756
|
logActionRequiredIf('Drawer now expects `onClose`, and will soon make this prop required. Please update your usage to provide it.', !onClose);
|
|
2757
2757
|
const {
|
|
2758
2758
|
isMobile
|
|
@@ -2790,7 +2790,32 @@ function Drawer({
|
|
|
2790
2790
|
})
|
|
2791
2791
|
})
|
|
2792
2792
|
});
|
|
2793
|
-
}
|
|
2793
|
+
};
|
|
2794
|
+
Drawer.propTypes = {
|
|
2795
|
+
/** The content to appear in the drawer body. */
|
|
2796
|
+
children: PropTypes__default.default.node,
|
|
2797
|
+
className: PropTypes__default.default.string,
|
|
2798
|
+
/** The content to appear in the drawer footer. */
|
|
2799
|
+
footerContent: PropTypes__default.default.node,
|
|
2800
|
+
/** The content to appear in the drawer header. */
|
|
2801
|
+
headerTitle: PropTypes__default.default.node,
|
|
2802
|
+
/** The status of Drawer either open or not. */
|
|
2803
|
+
open: PropTypes__default.default.bool,
|
|
2804
|
+
/** The placement of Drawer on the screen either left or right. On mobile it will default to bottom. */
|
|
2805
|
+
position: PropTypes__default.default.oneOf(['left', 'right', 'bottom']),
|
|
2806
|
+
/** The action to perform on close click. */
|
|
2807
|
+
onClose: PropTypes__default.default.func
|
|
2808
|
+
};
|
|
2809
|
+
Drawer.defaultProps = {
|
|
2810
|
+
children: null,
|
|
2811
|
+
className: undefined,
|
|
2812
|
+
footerContent: null,
|
|
2813
|
+
headerTitle: null,
|
|
2814
|
+
onClose: null,
|
|
2815
|
+
open: false,
|
|
2816
|
+
position: exports.Position.RIGHT
|
|
2817
|
+
};
|
|
2818
|
+
var Drawer$1 = Drawer;
|
|
2794
2819
|
|
|
2795
2820
|
const INITIAL_Y_POSITION = 0;
|
|
2796
2821
|
const CONTENT_SCROLL_THRESHOLD = 1;
|
|
@@ -2920,7 +2945,7 @@ const BottomSheet$1 = props => {
|
|
|
2920
2945
|
};
|
|
2921
2946
|
}
|
|
2922
2947
|
const is400Zoom = useMedia(`(max-width: ${exports.Breakpoint.ZOOM_400}px)`);
|
|
2923
|
-
return is400Zoom ? /*#__PURE__*/jsxRuntime.jsx(Drawer, {
|
|
2948
|
+
return is400Zoom ? /*#__PURE__*/jsxRuntime.jsx(Drawer$1, {
|
|
2924
2949
|
open: props.open,
|
|
2925
2950
|
className: props.className,
|
|
2926
2951
|
onClose: close,
|
|
@@ -5513,7 +5538,7 @@ const Modal = ({
|
|
|
5513
5538
|
const noDivider = checkSpecialClasses('no-divider');
|
|
5514
5539
|
const contentReference = React.useRef(null);
|
|
5515
5540
|
const titleId = React.useId();
|
|
5516
|
-
return !isMedium ? /*#__PURE__*/jsxRuntime.jsx(Drawer, {
|
|
5541
|
+
return !isMedium ? /*#__PURE__*/jsxRuntime.jsx(Drawer$1, {
|
|
5517
5542
|
open: open,
|
|
5518
5543
|
headerTitle: title,
|
|
5519
5544
|
footerContent: footer,
|
|
@@ -10341,7 +10366,7 @@ function Select({
|
|
|
10341
10366
|
, {
|
|
10342
10367
|
className: classNames__default.default(s('tw-icon'), s('tw-chevron-up-icon'), s('tw-chevron'), s('bottom'), s('np-select-chevron'))
|
|
10343
10368
|
})]
|
|
10344
|
-
}), isMobile ? isSearchEnabled ? /*#__PURE__*/jsxRuntime.jsx(Drawer, {
|
|
10369
|
+
}), isMobile ? isSearchEnabled ? /*#__PURE__*/jsxRuntime.jsx(Drawer$1, {
|
|
10345
10370
|
open: open,
|
|
10346
10371
|
headerTitle: searchPlaceholder || formatMessage(messages$2.searchPlaceholder),
|
|
10347
10372
|
onClose: handleCloseOptions,
|
|
@@ -14665,7 +14690,7 @@ exports.DefinitionList = DefinitionList;
|
|
|
14665
14690
|
exports.Dimmer = Dimmer$1;
|
|
14666
14691
|
exports.DirectionProvider = DirectionProvider;
|
|
14667
14692
|
exports.Display = Display;
|
|
14668
|
-
exports.Drawer = Drawer;
|
|
14693
|
+
exports.Drawer = Drawer$1;
|
|
14669
14694
|
exports.DropFade = DropFade;
|
|
14670
14695
|
exports.Emphasis = Emphasis;
|
|
14671
14696
|
exports.Field = Field;
|