@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.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';
|
|
13
14
|
import { formatDate, formatMoney, formatAmount } from '@transferwise/formatting';
|
|
14
15
|
import { Transition, Listbox } from '@headlessui/react';
|
|
15
16
|
import mergeProps from 'merge-props';
|
|
16
17
|
import { useFloating, useDismiss, useRole, useInteractions, FloatingPortal, FloatingFocusManager, offset, flip, shift, size, autoUpdate } from '@floating-ui/react';
|
|
17
18
|
import { usePreventScroll } from '@react-aria/overlays';
|
|
18
19
|
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
|
-
|
|
2718
|
+
const Drawer = ({
|
|
2719
2719
|
children,
|
|
2720
2720
|
className,
|
|
2721
2721
|
footerContent,
|
|
2722
2722
|
headerTitle,
|
|
2723
2723
|
onClose,
|
|
2724
|
-
open
|
|
2725
|
-
position
|
|
2726
|
-
}) {
|
|
2724
|
+
open,
|
|
2725
|
+
position
|
|
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,7 +2761,32 @@ function Drawer({
|
|
|
2761
2761
|
})
|
|
2762
2762
|
})
|
|
2763
2763
|
});
|
|
2764
|
-
}
|
|
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;
|
|
2765
2790
|
|
|
2766
2791
|
const INITIAL_Y_POSITION = 0;
|
|
2767
2792
|
const CONTENT_SCROLL_THRESHOLD = 1;
|
|
@@ -2891,7 +2916,7 @@ const BottomSheet$1 = props => {
|
|
|
2891
2916
|
};
|
|
2892
2917
|
}
|
|
2893
2918
|
const is400Zoom = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);
|
|
2894
|
-
return is400Zoom ? /*#__PURE__*/jsx(Drawer, {
|
|
2919
|
+
return is400Zoom ? /*#__PURE__*/jsx(Drawer$1, {
|
|
2895
2920
|
open: props.open,
|
|
2896
2921
|
className: props.className,
|
|
2897
2922
|
onClose: close,
|
|
@@ -5484,7 +5509,7 @@ const Modal = ({
|
|
|
5484
5509
|
const noDivider = checkSpecialClasses('no-divider');
|
|
5485
5510
|
const contentReference = useRef(null);
|
|
5486
5511
|
const titleId = useId();
|
|
5487
|
-
return !isMedium ? /*#__PURE__*/jsx(Drawer, {
|
|
5512
|
+
return !isMedium ? /*#__PURE__*/jsx(Drawer$1, {
|
|
5488
5513
|
open: open,
|
|
5489
5514
|
headerTitle: title,
|
|
5490
5515
|
footerContent: footer,
|
|
@@ -10312,7 +10337,7 @@ function Select({
|
|
|
10312
10337
|
, {
|
|
10313
10338
|
className: classNames(s('tw-icon'), s('tw-chevron-up-icon'), s('tw-chevron'), s('bottom'), s('np-select-chevron'))
|
|
10314
10339
|
})]
|
|
10315
|
-
}), isMobile ? isSearchEnabled ? /*#__PURE__*/jsx(Drawer, {
|
|
10340
|
+
}), isMobile ? isSearchEnabled ? /*#__PURE__*/jsx(Drawer$1, {
|
|
10316
10341
|
open: open,
|
|
10317
10342
|
headerTitle: searchPlaceholder || formatMessage(messages$2.searchPlaceholder),
|
|
10318
10343
|
onClose: handleCloseOptions,
|
|
@@ -14606,5 +14631,5 @@ const translations = {
|
|
|
14606
14631
|
'zh-HK': zhHK
|
|
14607
14632
|
};
|
|
14608
14633
|
|
|
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 };
|
|
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 };
|
|
14610
14635
|
//# sourceMappingURL=index.mjs.map
|