@transferwise/components 0.0.0-experimental-cbd2a4c → 0.0.0-experimental-9dec57a

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
@@ -5,7 +5,6 @@ var classNames = require('classnames');
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
  var icons = require('@transferwise/icons');
7
7
  var reactIntl = require('react-intl');
8
- var PropTypes = require('prop-types');
9
8
  var commonmark = require('commonmark');
10
9
  var componentsTheming = require('@wise/components-theming');
11
10
  var reactTransitionGroup = require('react-transition-group');
@@ -18,6 +17,7 @@ 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,9 +46,9 @@ function _interopNamespace(e) {
46
46
 
47
47
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
48
48
  var classNames__default = /*#__PURE__*/_interopDefault(classNames);
49
- var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
50
49
  var commonmark__default = /*#__PURE__*/_interopDefault(commonmark);
51
50
  var mergeProps__default = /*#__PURE__*/_interopDefault(mergeProps);
51
+ var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
52
52
  var clamp__default = /*#__PURE__*/_interopDefault(clamp$2);
53
53
  var debounce__default = /*#__PURE__*/_interopDefault(debounce);
54
54
  var requiredIf__default = /*#__PURE__*/_interopDefault(requiredIf);
@@ -860,21 +860,14 @@ function stripNodes({
860
860
  }
861
861
 
862
862
  const allowList = [exports.MarkdownNodeType.STRONG];
863
- const InlineMarkdown = props => {
863
+ function InlineMarkdown(props) {
864
864
  return /*#__PURE__*/jsxRuntime.jsx(Markdown, {
865
865
  ...props,
866
866
  as: "span",
867
867
  allowList: allowList,
868
868
  blockList: undefined
869
869
  });
870
- };
871
- InlineMarkdown.propTypes = {
872
- children: PropTypes__default.default.string.isRequired,
873
- className: PropTypes__default.default.string
874
- };
875
- InlineMarkdown.defaultProps = {
876
- className: undefined
877
- };
870
+ }
878
871
 
879
872
  var messages$c = reactIntl.defineMessages({
880
873
  opensInNewTab: {
@@ -2779,15 +2772,15 @@ const SlidingPanel = /*#__PURE__*/React.forwardRef(({
2779
2772
  }));
2780
2773
  });
2781
2774
 
2782
- const Drawer = ({
2775
+ function Drawer({
2783
2776
  children,
2784
2777
  className,
2785
2778
  footerContent,
2786
2779
  headerTitle,
2787
2780
  onClose,
2788
- open,
2789
- position
2790
- }) => {
2781
+ open = false,
2782
+ position = 'right'
2783
+ }) {
2791
2784
  logActionRequiredIf('Drawer now expects `onClose`, and will soon make this prop required. Please update your usage to provide it.', !onClose);
2792
2785
  const {
2793
2786
  isMobile
@@ -2825,32 +2818,7 @@ const Drawer = ({
2825
2818
  })
2826
2819
  })
2827
2820
  });
2828
- };
2829
- Drawer.propTypes = {
2830
- /** The content to appear in the drawer body. */
2831
- children: PropTypes__default.default.node,
2832
- className: PropTypes__default.default.string,
2833
- /** The content to appear in the drawer footer. */
2834
- footerContent: PropTypes__default.default.node,
2835
- /** The content to appear in the drawer header. */
2836
- headerTitle: PropTypes__default.default.node,
2837
- /** The status of Drawer either open or not. */
2838
- open: PropTypes__default.default.bool,
2839
- /** The placement of Drawer on the screen either left or right. On mobile it will default to bottom. */
2840
- position: PropTypes__default.default.oneOf(['left', 'right', 'bottom']),
2841
- /** The action to perform on close click. */
2842
- onClose: PropTypes__default.default.func
2843
- };
2844
- Drawer.defaultProps = {
2845
- children: null,
2846
- className: undefined,
2847
- footerContent: null,
2848
- headerTitle: null,
2849
- onClose: null,
2850
- open: false,
2851
- position: exports.Position.RIGHT
2852
- };
2853
- var Drawer$1 = Drawer;
2821
+ }
2854
2822
 
2855
2823
  const INITIAL_Y_POSITION = 0;
2856
2824
  const CONTENT_SCROLL_THRESHOLD = 1;
@@ -2980,7 +2948,7 @@ const BottomSheet$1 = props => {
2980
2948
  };
2981
2949
  }
2982
2950
  const is400Zoom = useMedia(`(max-width: ${exports.Breakpoint.ZOOM_400}px)`);
2983
- return is400Zoom ? /*#__PURE__*/jsxRuntime.jsx(Drawer$1, {
2951
+ return is400Zoom ? /*#__PURE__*/jsxRuntime.jsx(Drawer, {
2984
2952
  open: props.open,
2985
2953
  className: props.className,
2986
2954
  onClose: close,
@@ -5573,7 +5541,7 @@ const Modal = ({
5573
5541
  const noDivider = checkSpecialClasses('no-divider');
5574
5542
  const contentReference = React.useRef(null);
5575
5543
  const titleId = React.useId();
5576
- return !isMedium ? /*#__PURE__*/jsxRuntime.jsx(Drawer$1, {
5544
+ return !isMedium ? /*#__PURE__*/jsxRuntime.jsx(Drawer, {
5577
5545
  open: open,
5578
5546
  headerTitle: title,
5579
5547
  footerContent: footer,
@@ -10401,7 +10369,7 @@ function Select({
10401
10369
  , {
10402
10370
  className: classNames__default.default(s('tw-icon'), s('tw-chevron-up-icon'), s('tw-chevron'), s('bottom'), s('np-select-chevron'))
10403
10371
  })]
10404
- }), isMobile ? isSearchEnabled ? /*#__PURE__*/jsxRuntime.jsx(Drawer$1, {
10372
+ }), isMobile ? isSearchEnabled ? /*#__PURE__*/jsxRuntime.jsx(Drawer, {
10405
10373
  open: open,
10406
10374
  headerTitle: searchPlaceholder || formatMessage(messages$2.searchPlaceholder),
10407
10375
  onClose: handleCloseOptions,
@@ -14725,7 +14693,7 @@ exports.DefinitionList = DefinitionList;
14725
14693
  exports.Dimmer = Dimmer$1;
14726
14694
  exports.DirectionProvider = DirectionProvider;
14727
14695
  exports.Display = Display;
14728
- exports.Drawer = Drawer$1;
14696
+ exports.Drawer = Drawer;
14729
14697
  exports.DropFade = DropFade;
14730
14698
  exports.Emphasis = Emphasis;
14731
14699
  exports.Field = Field;