@transferwise/components 0.0.0-experimental-bb41164 → 0.0.0-experimental-99ffc11

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
@@ -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');
15
14
  var formatting = require('@transferwise/formatting');
16
15
  var react$1 = require('@headlessui/react');
17
16
  var mergeProps = require('merge-props');
18
17
  var react = require('@floating-ui/react');
19
18
  var overlays = require('@react-aria/overlays');
20
19
  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 PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
50
49
  var mergeProps__default = /*#__PURE__*/_interopDefault(mergeProps);
50
+ var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
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
- const Drawer = ({
2747
+ function Drawer({
2748
2748
  children,
2749
2749
  className,
2750
2750
  footerContent,
2751
2751
  headerTitle,
2752
2752
  onClose,
2753
- open,
2754
- position
2755
- }) => {
2753
+ open = false,
2754
+ position = 'right'
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,32 +2790,7 @@ const Drawer = ({
2790
2790
  })
2791
2791
  })
2792
2792
  });
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;
2793
+ }
2819
2794
 
2820
2795
  const INITIAL_Y_POSITION = 0;
2821
2796
  const CONTENT_SCROLL_THRESHOLD = 1;
@@ -2945,7 +2920,7 @@ const BottomSheet$1 = props => {
2945
2920
  };
2946
2921
  }
2947
2922
  const is400Zoom = useMedia(`(max-width: ${exports.Breakpoint.ZOOM_400}px)`);
2948
- return is400Zoom ? /*#__PURE__*/jsxRuntime.jsx(Drawer$1, {
2923
+ return is400Zoom ? /*#__PURE__*/jsxRuntime.jsx(Drawer, {
2949
2924
  open: props.open,
2950
2925
  className: props.className,
2951
2926
  onClose: close,
@@ -5538,7 +5513,7 @@ const Modal = ({
5538
5513
  const noDivider = checkSpecialClasses('no-divider');
5539
5514
  const contentReference = React.useRef(null);
5540
5515
  const titleId = React.useId();
5541
- return !isMedium ? /*#__PURE__*/jsxRuntime.jsx(Drawer$1, {
5516
+ return !isMedium ? /*#__PURE__*/jsxRuntime.jsx(Drawer, {
5542
5517
  open: open,
5543
5518
  headerTitle: title,
5544
5519
  footerContent: footer,
@@ -10366,7 +10341,7 @@ function Select({
10366
10341
  , {
10367
10342
  className: classNames__default.default(s('tw-icon'), s('tw-chevron-up-icon'), s('tw-chevron'), s('bottom'), s('np-select-chevron'))
10368
10343
  })]
10369
- }), isMobile ? isSearchEnabled ? /*#__PURE__*/jsxRuntime.jsx(Drawer$1, {
10344
+ }), isMobile ? isSearchEnabled ? /*#__PURE__*/jsxRuntime.jsx(Drawer, {
10370
10345
  open: open,
10371
10346
  headerTitle: searchPlaceholder || formatMessage(messages$2.searchPlaceholder),
10372
10347
  onClose: handleCloseOptions,
@@ -14690,7 +14665,7 @@ exports.DefinitionList = DefinitionList;
14690
14665
  exports.Dimmer = Dimmer$1;
14691
14666
  exports.DirectionProvider = DirectionProvider;
14692
14667
  exports.Display = Display;
14693
- exports.Drawer = Drawer$1;
14668
+ exports.Drawer = Drawer;
14694
14669
  exports.DropFade = DropFade;
14695
14670
  exports.Emphasis = Emphasis;
14696
14671
  exports.Field = Field;