@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.mjs CHANGED
@@ -10,13 +10,13 @@ import { CSSTransition } from 'react-transition-group';
10
10
  import { FocusScope } from '@react-aria/focus';
11
11
  import { createPortal } from 'react-dom';
12
12
  import { isUndefined, isNumber, isEmpty, isNull } from '@transferwise/neptune-validation';
13
- import PropTypes from 'prop-types';
14
13
  import { formatDate, formatMoney, formatAmount } from '@transferwise/formatting';
15
14
  import { Transition, Listbox } from '@headlessui/react';
16
15
  import mergeProps from 'merge-props';
17
16
  import { useFloating, useDismiss, useRole, useInteractions, FloatingPortal, FloatingFocusManager, offset, flip, shift, size, autoUpdate } from '@floating-ui/react';
18
17
  import { usePreventScroll } from '@react-aria/overlays';
19
18
  import { usePopper } from 'react-popper';
19
+ import PropTypes from 'prop-types';
20
20
  import { Flag, Illustration } from '@wise/art';
21
21
  import clamp$2 from 'lodash.clamp';
22
22
  import debounce from 'lodash.debounce';
@@ -2715,15 +2715,15 @@ const SlidingPanel = /*#__PURE__*/forwardRef(({
2715
2715
  }));
2716
2716
  });
2717
2717
 
2718
- const Drawer = ({
2718
+ function Drawer({
2719
2719
  children,
2720
2720
  className,
2721
2721
  footerContent,
2722
2722
  headerTitle,
2723
2723
  onClose,
2724
- open,
2725
- position
2726
- }) => {
2724
+ open = false,
2725
+ position = 'right'
2726
+ }) {
2727
2727
  logActionRequiredIf('Drawer now expects `onClose`, and will soon make this prop required. Please update your usage to provide it.', !onClose);
2728
2728
  const {
2729
2729
  isMobile
@@ -2761,32 +2761,7 @@ const Drawer = ({
2761
2761
  })
2762
2762
  })
2763
2763
  });
2764
- };
2765
- Drawer.propTypes = {
2766
- /** The content to appear in the drawer body. */
2767
- children: PropTypes.node,
2768
- className: PropTypes.string,
2769
- /** The content to appear in the drawer footer. */
2770
- footerContent: PropTypes.node,
2771
- /** The content to appear in the drawer header. */
2772
- headerTitle: PropTypes.node,
2773
- /** The status of Drawer either open or not. */
2774
- open: PropTypes.bool,
2775
- /** The placement of Drawer on the screen either left or right. On mobile it will default to bottom. */
2776
- position: PropTypes.oneOf(['left', 'right', 'bottom']),
2777
- /** The action to perform on close click. */
2778
- onClose: PropTypes.func
2779
- };
2780
- Drawer.defaultProps = {
2781
- children: null,
2782
- className: undefined,
2783
- footerContent: null,
2784
- headerTitle: null,
2785
- onClose: null,
2786
- open: false,
2787
- position: Position.RIGHT
2788
- };
2789
- var Drawer$1 = Drawer;
2764
+ }
2790
2765
 
2791
2766
  const INITIAL_Y_POSITION = 0;
2792
2767
  const CONTENT_SCROLL_THRESHOLD = 1;
@@ -2916,7 +2891,7 @@ const BottomSheet$1 = props => {
2916
2891
  };
2917
2892
  }
2918
2893
  const is400Zoom = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);
2919
- return is400Zoom ? /*#__PURE__*/jsx(Drawer$1, {
2894
+ return is400Zoom ? /*#__PURE__*/jsx(Drawer, {
2920
2895
  open: props.open,
2921
2896
  className: props.className,
2922
2897
  onClose: close,
@@ -5509,7 +5484,7 @@ const Modal = ({
5509
5484
  const noDivider = checkSpecialClasses('no-divider');
5510
5485
  const contentReference = useRef(null);
5511
5486
  const titleId = useId();
5512
- return !isMedium ? /*#__PURE__*/jsx(Drawer$1, {
5487
+ return !isMedium ? /*#__PURE__*/jsx(Drawer, {
5513
5488
  open: open,
5514
5489
  headerTitle: title,
5515
5490
  footerContent: footer,
@@ -10337,7 +10312,7 @@ function Select({
10337
10312
  , {
10338
10313
  className: classNames(s('tw-icon'), s('tw-chevron-up-icon'), s('tw-chevron'), s('bottom'), s('np-select-chevron'))
10339
10314
  })]
10340
- }), isMobile ? isSearchEnabled ? /*#__PURE__*/jsx(Drawer$1, {
10315
+ }), isMobile ? isSearchEnabled ? /*#__PURE__*/jsx(Drawer, {
10341
10316
  open: open,
10342
10317
  headerTitle: searchPlaceholder || formatMessage(messages$2.searchPlaceholder),
10343
10318
  onClose: handleCloseOptions,
@@ -14631,5 +14606,5 @@ const translations = {
14631
14606
  'zh-HK': zhHK
14632
14607
  };
14633
14608
 
14634
- export { Accordion, ActionButton, ActionOption, Alert, AlertArrowPosition, Avatar, AvatarType, AvatarWrapper, Badge, Card$1 as BaseCard, Body, BottomSheet$1 as BottomSheet, Breakpoint, Button, Card, Carousel, Checkbox, CheckboxButton, CheckboxOption, Chevron, Chip, Chips, CircularButton, ControlType, CriticalCommsBanner, DEFAULT_LANG, DEFAULT_LOCALE, DateInput, DateLookup$1 as DateLookup, DateMode, Decision, DecisionPresentation, DecisionType, DefinitionList, Dimmer$1 as Dimmer, Direction, DirectionProvider, Display, Drawer$1 as Drawer, DropFade, Emphasis, Field, FileType, FlowNavigation, Header, Image, Info, InfoPresentation, InlineAlert, Input, InputGroup, InputWithDisplayFormat, InstructionsList, Label, LanguageProvider, Layout, Link, ListItem$1 as ListItem, Loader, Logo, LogoType, Markdown, MarkdownNodeType, Modal, Money, MoneyInput$1 as MoneyInput, MonthFormat, NavigationOption, NavigationOptionList as NavigationOptionsList, Nudge, Option$2 as Option, OverlayHeader$1 as OverlayHeader, PhoneNumberInput, Popover$1 as Popover, Position, Priority, ProcessIndicator, ProfileType, Progress, ProgressBar, PromoCard$1 as PromoCard, PromoCardGroup$1 as PromoCardGroup, Provider, RTL_LANGUAGES, Radio, RadioGroup, RadioOption, SUPPORTED_LANGUAGES, Scroll, SearchInput, Section, SegmentedControl, Select, SelectInput, SelectInputOptionContent, SelectInputTriggerButton, Sentiment, Size, SlidingPanel, SnackbarConsumer, SnackbarContext, SnackbarPortal, SnackbarProvider, Status, StatusIcon, Stepper, Sticky, Summary, Switch, SwitchOption, Tabs$1 as Tabs, TextArea, TextareaWithDisplayFormat, Theme, Title, Tooltip, Type, Typeahead$1 as Typeahead, Typography, Upload$1 as Upload, UploadInput, UploadStep, Variant, Width, adjustLocale, getCountryFromLocale, getDirectionFromLocale, getLangFromLocale, isBrowser, isServerSide, translations, useDirection, useLayout, useScreenSize, useSnackbar };
14609
+ export { Accordion, ActionButton, ActionOption, Alert, AlertArrowPosition, Avatar, AvatarType, AvatarWrapper, Badge, Card$1 as BaseCard, Body, BottomSheet$1 as BottomSheet, Breakpoint, Button, Card, Carousel, Checkbox, CheckboxButton, CheckboxOption, Chevron, Chip, Chips, CircularButton, ControlType, CriticalCommsBanner, DEFAULT_LANG, DEFAULT_LOCALE, DateInput, DateLookup$1 as DateLookup, DateMode, Decision, DecisionPresentation, DecisionType, DefinitionList, Dimmer$1 as Dimmer, Direction, DirectionProvider, Display, Drawer, DropFade, Emphasis, Field, FileType, FlowNavigation, Header, Image, Info, InfoPresentation, InlineAlert, Input, InputGroup, InputWithDisplayFormat, InstructionsList, Label, LanguageProvider, Layout, Link, ListItem$1 as ListItem, Loader, Logo, LogoType, Markdown, MarkdownNodeType, Modal, Money, MoneyInput$1 as MoneyInput, MonthFormat, NavigationOption, NavigationOptionList as NavigationOptionsList, Nudge, Option$2 as Option, OverlayHeader$1 as OverlayHeader, PhoneNumberInput, Popover$1 as Popover, Position, Priority, ProcessIndicator, ProfileType, Progress, ProgressBar, PromoCard$1 as PromoCard, PromoCardGroup$1 as PromoCardGroup, Provider, RTL_LANGUAGES, Radio, RadioGroup, RadioOption, SUPPORTED_LANGUAGES, Scroll, SearchInput, Section, SegmentedControl, Select, SelectInput, SelectInputOptionContent, SelectInputTriggerButton, Sentiment, Size, SlidingPanel, SnackbarConsumer, SnackbarContext, SnackbarPortal, SnackbarProvider, Status, StatusIcon, Stepper, Sticky, Summary, Switch, SwitchOption, Tabs$1 as Tabs, TextArea, TextareaWithDisplayFormat, Theme, Title, Tooltip, Type, Typeahead$1 as Typeahead, Typography, Upload$1 as Upload, UploadInput, UploadStep, Variant, Width, adjustLocale, getCountryFromLocale, getDirectionFromLocale, getLangFromLocale, isBrowser, isServerSide, translations, useDirection, useLayout, useScreenSize, useSnackbar };
14635
14610
  //# sourceMappingURL=index.mjs.map