@transferwise/components 0.0.0-experimental-fa56c29 → 0.0.0-experimental-644f437
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 +5594 -5803
- package/build/index.js.map +1 -1
- package/build/index.mjs +5573 -5781
- package/build/index.mjs.map +1 -1
- package/build/main.css +0 -138
- package/build/styles/main.css +0 -138
- package/build/types/common/DOMOperations/DOMOperations.d.ts +10 -2
- package/build/types/common/DOMOperations/DOMOperations.d.ts.map +1 -1
- package/build/types/common/DOMOperations/index.d.ts +1 -3
- package/build/types/common/DOMOperations/index.d.ts.map +1 -1
- package/build/types/common/bottomSheet/BottomSheet.d.ts +2 -2
- package/build/types/common/bottomSheet/BottomSheet.d.ts.map +1 -1
- package/build/types/common/bottomSheet/index.d.ts +2 -1
- package/build/types/common/bottomSheet/index.d.ts.map +1 -1
- package/build/types/common/card/Card.d.ts +2 -2
- package/build/types/common/card/Card.d.ts.map +1 -1
- package/build/types/common/closeButton/CloseButton.messages.d.ts +7 -7
- package/build/types/common/closeButton/CloseButton.messages.d.ts.map +1 -1
- package/build/types/common/closeButton/index.d.ts +0 -1
- package/build/types/common/closeButton/index.d.ts.map +1 -1
- package/build/types/common/deviceDetection/deviceDetection.d.ts +1 -1
- package/build/types/common/deviceDetection/deviceDetection.d.ts.map +1 -1
- package/build/types/common/deviceDetection/index.d.ts +1 -1
- package/build/types/common/deviceDetection/index.d.ts.map +1 -1
- package/build/types/common/domHelpers/documentIosClick.d.ts +7 -2
- package/build/types/common/domHelpers/documentIosClick.d.ts.map +1 -1
- package/build/types/common/domHelpers/index.d.ts +1 -6
- package/build/types/common/domHelpers/index.d.ts.map +1 -1
- package/build/types/common/flowHeader/index.d.ts +2 -0
- package/build/types/common/flowHeader/index.d.ts.map +1 -0
- package/build/types/common/focusBoundary/index.d.ts +1 -1
- package/build/types/common/focusBoundary/index.d.ts.map +1 -1
- package/build/types/common/historyNavigator/historyNavigator.d.ts +8 -8
- package/build/types/common/historyNavigator/historyNavigator.d.ts.map +1 -1
- package/build/types/common/historyNavigator/index.d.ts +1 -1
- package/build/types/common/historyNavigator/index.d.ts.map +1 -1
- package/build/types/common/panel/Panel.d.ts +1 -1
- package/build/types/common/panel/Panel.d.ts.map +1 -1
- package/build/types/common/panel/index.d.ts +1 -1
- package/build/types/common/panel/index.d.ts.map +1 -1
- package/build/types/dimmer/Dimmer.d.ts +1 -1
- package/build/types/dimmer/Dimmer.d.ts.map +1 -1
- package/build/types/dimmer/index.d.ts +2 -1
- package/build/types/dimmer/index.d.ts.map +1 -1
- package/build/types/flowNavigation/FlowNavigation.d.ts.map +1 -1
- package/build/types/index.d.ts +42 -43
- package/build/types/index.d.ts.map +1 -1
- package/build/types/promoCard/PromoCard.d.ts +5 -16
- package/build/types/promoCard/PromoCard.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/common/DOMOperations/index.ts +1 -0
- package/src/common/bottomSheet/BottomSheet.tsx +6 -3
- package/src/common/bottomSheet/index.ts +2 -0
- package/src/common/card/Card.tsx +43 -51
- package/src/common/closeButton/{CloseButton.spec.js → CloseButton.spec.tsx} +1 -0
- package/src/common/closeButton/index.ts +0 -1
- package/src/common/deviceDetection/{deviceDetection.spec.js → deviceDetection.spec.ts} +1 -1
- package/src/common/deviceDetection/deviceDetection.ts +7 -0
- package/src/common/domHelpers/{documentIosClick.spec.js → documentIosClick.spec.ts} +7 -13
- package/src/common/domHelpers/{documentIosClick.js → documentIosClick.ts} +23 -0
- package/src/common/domHelpers/index.ts +4 -23
- package/src/common/flowHeader/{FlowHeader.spec.js → FlowHeader.spec.tsx} +2 -1
- package/src/common/flowHeader/index.ts +1 -0
- package/src/common/historyNavigator/{historyNavigator.js → historyNavigator.ts} +9 -5
- package/src/common/panel/{Panel.spec.js → Panel.spec.tsx} +14 -9
- package/src/common/panel/Panel.tsx +3 -3
- package/src/common/responsivePanel/ResponsivePanel.tsx +1 -1
- package/src/dimmer/Dimmer.tsx +1 -1
- package/src/dimmer/index.ts +2 -0
- package/src/flowNavigation/FlowNavigation.tsx +1 -2
- package/src/index.ts +68 -68
- package/src/main.css +0 -138
- package/src/main.less +0 -1
- package/src/overlayHeader/OverlayHeader.js +1 -1
- package/src/promoCard/PromoCard.story.tsx +2 -2
- package/src/promoCard/PromoCard.tsx +10 -31
- package/src/withDisplayFormat/WithDisplayFormat.tsx +2 -2
- package/build/styles/carousel/Carousel.css +0 -138
- package/build/types/carousel/Carousel.d.ts +0 -26
- package/build/types/carousel/Carousel.d.ts.map +0 -1
- package/build/types/carousel/index.d.ts +0 -3
- package/build/types/carousel/index.d.ts.map +0 -1
- package/src/carousel/Carousel.css +0 -138
- package/src/carousel/Carousel.less +0 -137
- package/src/carousel/Carousel.spec.tsx +0 -221
- package/src/carousel/Carousel.story.tsx +0 -63
- package/src/carousel/Carousel.tsx +0 -345
- package/src/carousel/index.ts +0 -3
- package/src/common/DOMOperations/index.js +0 -3
- package/src/common/bottomSheet/index.js +0 -1
- package/src/common/deviceDetection/deviceDetection.js +0 -7
- package/src/dimmer/index.js +0 -1
- /package/src/common/DOMOperations/{DOMOperations.spec.js → DOMOperations.spec.tsx} +0 -0
- /package/src/common/DOMOperations/{DOMOperations.js → DOMOperations.ts} +0 -0
- /package/src/common/closeButton/{CloseButton.messages.js → CloseButton.messages.ts} +0 -0
- /package/src/common/closeButton/__snapshots__/{CloseButton.spec.js.snap → CloseButton.spec.tsx.snap} +0 -0
- /package/src/common/deviceDetection/{index.js → index.ts} +0 -0
- /package/src/common/flowHeader/__snapshots__/{FlowHeader.spec.js.snap → FlowHeader.spec.tsx.snap} +0 -0
- /package/src/common/focusBoundary/{index.js → index.ts} +0 -0
- /package/src/common/historyNavigator/{historyNavigator.spec.js → historyNavigator.spec.ts} +0 -0
- /package/src/common/historyNavigator/{index.js → index.ts} +0 -0
- /package/src/common/panel/__snapshots__/{Panel.spec.js.snap → Panel.spec.tsx.snap} +0 -0
- /package/src/common/panel/{index.js → index.ts} +0 -0
package/build/types/index.d.ts
CHANGED
|
@@ -1,58 +1,57 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Types
|
|
3
3
|
*/
|
|
4
|
-
export type {
|
|
5
|
-
export type { AvatarProps } from './avatar';
|
|
4
|
+
export type { AccordionItem, AccordionProps } from './accordion';
|
|
6
5
|
export type { ActionOptionProps } from './actionOption';
|
|
7
|
-
export type {
|
|
6
|
+
export type { AlertAction, AlertProps, AlertType } from './alert';
|
|
7
|
+
export type { AvatarProps } from './avatar';
|
|
8
8
|
export type { BadgeProps } from './badge';
|
|
9
|
-
export type { CarouselProps } from './carousel';
|
|
10
9
|
export type { CircularButtonProps } from './circularButton';
|
|
10
|
+
export type { BodyTypes, DisplayTypes, LayoutDirection, LinkTypes, TitleTypes, TypographyTypes, } from './common';
|
|
11
|
+
export type { BottomSheetProps } from './common/bottomSheet';
|
|
12
|
+
export type { DateInputProps } from './dateInput';
|
|
13
|
+
export type { DateLookupProps } from './dateLookup';
|
|
11
14
|
export type { DecisionProps } from './decision/Decision';
|
|
15
|
+
export type { DimmerProps } from './dimmer';
|
|
12
16
|
export type { EmphasisProps } from './emphasis';
|
|
13
17
|
export type { InfoProps } from './info';
|
|
14
|
-
export type { SummaryProps } from './summary';
|
|
15
|
-
export type { InputProps } from './inputs/Input';
|
|
16
|
-
export type { DateInputProps } from './dateInput';
|
|
17
|
-
export type { DateLookupProps } from './dateLookup';
|
|
18
18
|
export type { InputWithDisplayFormatProps } from './inputWithDisplayFormat';
|
|
19
|
+
export type { InputProps } from './inputs/Input';
|
|
19
20
|
export type { InputGroupProps } from './inputs/InputGroup';
|
|
20
|
-
export type { LoaderProps } from './loader';
|
|
21
|
-
export type { NavigationOptionListProps } from './navigationOptionsList';
|
|
22
21
|
export type { SearchInputProps } from './inputs/SearchInput';
|
|
23
22
|
export type { SelectInputGroupItem, SelectInputItem, SelectInputOptionContentProps, SelectInputOptionItem, SelectInputProps, SelectInputSeparatorItem, SelectInputTriggerButtonProps, } from './inputs/SelectInput';
|
|
24
23
|
export type { TextAreaProps } from './inputs/TextArea';
|
|
24
|
+
export type { InstructionsListProps } from './instructionsList';
|
|
25
|
+
export type { LoaderProps } from './loader';
|
|
26
|
+
export type { MarkdownProps } from './markdown';
|
|
27
|
+
export type { ModalProps } from './modal';
|
|
28
|
+
export type { MoneyProps } from './money';
|
|
29
|
+
export type { CurrencyHeaderItem, CurrencyItem, CurrencyOptionItem, MoneyInputProps, } from './moneyInput';
|
|
30
|
+
export type { NavigationOptionListProps } from './navigationOptionsList';
|
|
25
31
|
export type { PhoneNumberInputProps } from './phoneNumberInput/PhoneNumberInput';
|
|
26
32
|
export type { PopoverProps } from './popover';
|
|
27
33
|
export type { ProgressProps } from './progress';
|
|
28
34
|
export type { ProgressBarProps } from './progressBar';
|
|
29
|
-
export type {
|
|
35
|
+
export type { DirectionProviderProps, LanguageProviderProps, ProviderProps } from './provider';
|
|
30
36
|
export type { RadioProps } from './radio';
|
|
31
37
|
export type { RadioGroupProps, RadioGroupRadio } from './radioGroup';
|
|
32
38
|
export type { RadioOptionProps } from './radioOption';
|
|
39
|
+
export type { SegmentedControlProps } from './segmentedControl';
|
|
40
|
+
export type { SlidingPanelProps } from './slidingPanel';
|
|
33
41
|
export type { SnackbarProps } from './snackbar/Snackbar';
|
|
34
42
|
export type { SnackbarContextType } from './snackbar/SnackbarContext';
|
|
35
43
|
export type { StatusIconProps } from './statusIcon';
|
|
36
44
|
export type { StickyProps } from './sticky';
|
|
45
|
+
export type { SummaryProps } from './summary';
|
|
37
46
|
export type { SwitchProps } from './switch';
|
|
38
47
|
export type { SwitchOptionProps } from './switchOption';
|
|
39
48
|
export type { TextareaWithDisplayFormatProps } from './textareaWithDisplayFormat';
|
|
40
49
|
export type { TooltipProps } from './tooltip';
|
|
41
|
-
export type {
|
|
42
|
-
export type {
|
|
43
|
-
export type { ModalProps } from './modal';
|
|
44
|
-
export type { MoneyProps } from './money';
|
|
45
|
-
export type { CurrencyHeaderItem, CurrencyItem, CurrencyOptionItem, MoneyInputProps, } from './moneyInput';
|
|
46
|
-
export type { SlidingPanelProps } from './slidingPanel';
|
|
47
|
-
export type { LayoutDirection, TypographyTypes, TitleTypes, BodyTypes, LinkTypes, DisplayTypes, } from './common';
|
|
48
|
-
export type { SegmentedControlProps } from './segmentedControl';
|
|
49
|
-
export type { TypeaheadProps, TypeaheadOption } from './typeahead';
|
|
50
|
-
export type { InstructionsListProps } from './instructionsList';
|
|
50
|
+
export type { TypeaheadOption, TypeaheadProps } from './typeahead';
|
|
51
|
+
export type { UploadError, UploadResponse, UploadedFile } from './uploadInput/types';
|
|
51
52
|
/**
|
|
52
53
|
* Components
|
|
53
54
|
*/
|
|
54
|
-
export { default as Title } from './title';
|
|
55
|
-
export { default as Body } from './body';
|
|
56
55
|
export { default as Accordion } from './accordion';
|
|
57
56
|
export { default as ActionButton } from './actionButton';
|
|
58
57
|
export { default as ActionOption } from './actionOption';
|
|
@@ -60,17 +59,19 @@ export { default as Alert } from './alert';
|
|
|
60
59
|
export { default as Avatar } from './avatar';
|
|
61
60
|
export { default as AvatarWrapper } from './avatarWrapper';
|
|
62
61
|
export { default as Badge } from './badge';
|
|
63
|
-
export { default as
|
|
62
|
+
export { default as Body } from './body';
|
|
64
63
|
export { default as Button } from './button';
|
|
65
|
-
export { default as Carousel } from './carousel';
|
|
66
64
|
export { default as Card } from './card';
|
|
67
|
-
export { default as BaseCard } from './common/card';
|
|
68
65
|
export { default as Checkbox } from './checkbox';
|
|
69
66
|
export { default as CheckboxButton } from './checkboxButton';
|
|
70
67
|
export { default as CheckboxOption } from './checkboxOption';
|
|
71
68
|
export { default as Chevron } from './chevron';
|
|
72
|
-
export { default as Chips
|
|
69
|
+
export { Chip, default as Chips } from './chips';
|
|
73
70
|
export { default as CircularButton } from './circularButton';
|
|
71
|
+
export { default as Option } from './common/Option';
|
|
72
|
+
export { default as BottomSheet } from './common/bottomSheet';
|
|
73
|
+
export { default as BaseCard } from './common/card';
|
|
74
|
+
export { default as CriticalCommsBanner } from './criticalBanner';
|
|
74
75
|
export { default as DateInput } from './dateInput';
|
|
75
76
|
export { default as DateLookup } from './dateLookup';
|
|
76
77
|
export { default as Decision } from './decision';
|
|
@@ -85,14 +86,15 @@ export { default as Header } from './header';
|
|
|
85
86
|
export { default as Image } from './image';
|
|
86
87
|
export { default as Info } from './info';
|
|
87
88
|
export { default as InlineAlert } from './inlineAlert';
|
|
89
|
+
export { default as InputWithDisplayFormat } from './inputWithDisplayFormat';
|
|
88
90
|
export { Input } from './inputs/Input';
|
|
89
91
|
export { InputGroup } from './inputs/InputGroup';
|
|
90
92
|
export { SearchInput } from './inputs/SearchInput';
|
|
91
93
|
export { SelectInput, SelectInputOptionContent, SelectInputTriggerButton, } from './inputs/SelectInput';
|
|
92
94
|
export { TextArea } from './inputs/TextArea';
|
|
93
|
-
export { default as InputWithDisplayFormat } from './inputWithDisplayFormat';
|
|
94
95
|
export { default as InstructionsList } from './instructionsList';
|
|
95
96
|
export { default as Link } from './link';
|
|
97
|
+
export { default as ListItem } from './listItem';
|
|
96
98
|
export { default as Loader } from './loader';
|
|
97
99
|
export { default as Logo } from './logo';
|
|
98
100
|
export { default as Markdown } from './markdown';
|
|
@@ -102,24 +104,23 @@ export { default as MoneyInput } from './moneyInput';
|
|
|
102
104
|
export { default as NavigationOption } from './navigationOption';
|
|
103
105
|
export { default as NavigationOptionsList } from './navigationOptionsList';
|
|
104
106
|
export { default as Nudge } from './nudge';
|
|
105
|
-
export { default as Option } from './common/Option';
|
|
106
107
|
export { default as OverlayHeader } from './overlayHeader';
|
|
107
108
|
export { default as PhoneNumberInput } from './phoneNumberInput';
|
|
108
109
|
export { default as Popover } from './popover';
|
|
109
110
|
export { default as ProcessIndicator } from './processIndicator';
|
|
110
|
-
export { default as ProgressBar } from './progressBar';
|
|
111
111
|
export { default as Progress } from './progress';
|
|
112
|
-
export { default as
|
|
113
|
-
export { default as
|
|
114
|
-
export { default as Provider
|
|
112
|
+
export { default as ProgressBar } from './progressBar';
|
|
113
|
+
export { PromoCardGroup, default as PromoCard } from './promoCard';
|
|
114
|
+
export { DirectionProvider, LanguageProvider, default as Provider } from './provider';
|
|
115
115
|
export { default as Radio } from './radio';
|
|
116
116
|
export { default as RadioGroup } from './radioGroup';
|
|
117
117
|
export { default as RadioOption } from './radioOption';
|
|
118
118
|
export { default as Section } from './section';
|
|
119
|
-
export { default as Select } from './select';
|
|
120
119
|
export { default as SegmentedControl } from './segmentedControl';
|
|
120
|
+
export { default as Select } from './select';
|
|
121
121
|
export { default as SlidingPanel } from './slidingPanel';
|
|
122
122
|
export { default as SnackbarPortal } from './snackbar/Snackbar';
|
|
123
|
+
export { SnackbarConsumer, SnackbarContext } from './snackbar/SnackbarContext';
|
|
123
124
|
export { default as SnackbarProvider } from './snackbar/SnackbarProvider';
|
|
124
125
|
export { default as StatusIcon } from './statusIcon/StatusIcon';
|
|
125
126
|
export { default as Stepper } from './stepper/Stepper';
|
|
@@ -129,33 +130,31 @@ export { default as Switch } from './switch';
|
|
|
129
130
|
export { default as SwitchOption } from './switchOption';
|
|
130
131
|
export { default as Tabs } from './tabs';
|
|
131
132
|
export { default as TextareaWithDisplayFormat } from './textareaWithDisplayFormat';
|
|
133
|
+
export { default as Title } from './title';
|
|
132
134
|
export { default as Tooltip } from './tooltip';
|
|
133
135
|
export { default as Typeahead } from './typeahead';
|
|
134
136
|
export { default as Upload } from './upload';
|
|
135
137
|
export { default as UploadInput } from './uploadInput';
|
|
136
|
-
export { SnackbarConsumer, SnackbarContext } from './snackbar/SnackbarContext';
|
|
137
|
-
export { default as CriticalCommsBanner } from './criticalBanner';
|
|
138
|
-
export { default as ListItem } from './listItem';
|
|
139
138
|
/**
|
|
140
139
|
* Hooks
|
|
141
140
|
*/
|
|
142
|
-
export { default as useSnackbar } from './snackbar/useSnackbar';
|
|
143
141
|
export { useDirection, useLayout } from './common/hooks';
|
|
144
142
|
export { useScreenSize } from './common/hooks/useScreenSize';
|
|
143
|
+
export { default as useSnackbar } from './snackbar/useSnackbar';
|
|
145
144
|
/**
|
|
146
145
|
* Enums
|
|
147
146
|
*/
|
|
148
|
-
export {
|
|
147
|
+
export { AlertArrowPosition } from './alert/Alert';
|
|
149
148
|
export { AvatarType } from './avatar';
|
|
150
|
-
export {
|
|
151
|
-
export { UploadStep } from './upload';
|
|
149
|
+
export { Breakpoint, ControlType, DateMode, Direction, FileType, Layout, MarkdownNodeType, MonthFormat, Position, Priority, ProfileType, Scroll, Sentiment, Size, Status, Theme, Type, Typography, Variant, Width, } from './common';
|
|
152
150
|
export { DecisionPresentation, DecisionType } from './decision';
|
|
151
|
+
export { InfoPresentation } from './info';
|
|
153
152
|
export { LogoType } from './logo';
|
|
154
|
-
export {
|
|
153
|
+
export { UploadStep } from './upload';
|
|
155
154
|
/**
|
|
156
155
|
* Utils
|
|
157
156
|
*/
|
|
158
|
-
export {
|
|
157
|
+
export { DEFAULT_LANG, DEFAULT_LOCALE, RTL_LANGUAGES, SUPPORTED_LANGUAGES, adjustLocale, getCountryFromLocale, getDirectionFromLocale, getLangFromLocale, isBrowser, isServerSide, } from './common';
|
|
159
158
|
/**
|
|
160
159
|
* Translations
|
|
161
160
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACjE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAClE,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,YAAY,EA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,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
export type ReferenceType = React.Ref<HTMLInputElement
|
|
2
|
+
import { CardProps } from '../common/card';
|
|
3
|
+
import { PromoCardIndicatorProps } from './PromoCardIndicator';
|
|
4
|
+
export type ReferenceType = React.Ref<HTMLInputElement>;
|
|
5
5
|
export type RelatedTypes = '' | 'alternate' | 'author' | 'bookmark' | 'external' | 'help' | 'license' | 'next' | 'nofollow' | 'noreferrer' | 'noopener' | 'prev' | 'search' | 'tag';
|
|
6
6
|
export interface PromoCardCommonProps {
|
|
7
7
|
/** Optional prop to specify classNames onto the PromoCard */
|
|
@@ -30,15 +30,12 @@ export interface PromoCardCommonProps {
|
|
|
30
30
|
isDisabled?: boolean;
|
|
31
31
|
/** Specify an onClick event handler */
|
|
32
32
|
onClick?: () => void;
|
|
33
|
-
/** Specify an onKeyDown event handler */
|
|
34
|
-
onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
35
33
|
/** Optional prop to specify the ID used for testing */
|
|
36
34
|
testId?: string;
|
|
37
35
|
/** Required prop to specify the title text of the PromoCard */
|
|
38
36
|
title: string;
|
|
39
37
|
/** Set to false to use body font style for the title */
|
|
40
38
|
useDisplayFont?: boolean;
|
|
41
|
-
ref?: ReferenceType;
|
|
42
39
|
}
|
|
43
40
|
export interface PromoCardLinkProps extends PromoCardCommonProps, Omit<CardProps, 'children'> {
|
|
44
41
|
/**
|
|
@@ -50,12 +47,6 @@ export interface PromoCardLinkProps extends PromoCardCommonProps, Omit<CardProps
|
|
|
50
47
|
href?: string;
|
|
51
48
|
/** Optionally specify the language of the linked URL */
|
|
52
49
|
hrefLang?: string;
|
|
53
|
-
/** Optional property that can be pass a ref for the anchor. */
|
|
54
|
-
anchorRef?: React.Ref<HTMLAnchorElement>;
|
|
55
|
-
/**
|
|
56
|
-
* Optional prop to specify the ID of the anchor element which can be useful when using a ref.
|
|
57
|
-
*/
|
|
58
|
-
anchorId?: string;
|
|
59
50
|
/**
|
|
60
51
|
* Relationship between the PromoCard href URL and the current page. See
|
|
61
52
|
* [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).
|
|
@@ -68,7 +59,7 @@ export interface PromoCardLinkProps extends PromoCardCommonProps, Omit<CardProps
|
|
|
68
59
|
isChecked?: never;
|
|
69
60
|
tabIndex?: never;
|
|
70
61
|
type?: never;
|
|
71
|
-
|
|
62
|
+
reference?: never;
|
|
72
63
|
value?: never;
|
|
73
64
|
}
|
|
74
65
|
export interface PromoCardCheckedProps extends PromoCardCommonProps, Omit<CardProps, 'children'> {
|
|
@@ -79,7 +70,7 @@ export interface PromoCardCheckedProps extends PromoCardCommonProps, Omit<CardPr
|
|
|
79
70
|
/** Optional prop to specify the tabIndex of the PromoCard */
|
|
80
71
|
tabIndex?: number;
|
|
81
72
|
/** Optional property to provide component Ref */
|
|
82
|
-
|
|
73
|
+
reference?: ReferenceType;
|
|
83
74
|
/** Optional prop to specify the input type of the PromoCard */
|
|
84
75
|
type?: 'checkbox' | 'radio';
|
|
85
76
|
/** Specify the value attribute of the PromoCard if Checkbox or Radio */
|
|
@@ -87,8 +78,6 @@ export interface PromoCardCheckedProps extends PromoCardCommonProps, Omit<CardPr
|
|
|
87
78
|
/** Only applies to <a />s */
|
|
88
79
|
download?: never;
|
|
89
80
|
href?: never;
|
|
90
|
-
anchorRef?: never;
|
|
91
|
-
anchorId?: never;
|
|
92
81
|
hrefLang?: never;
|
|
93
82
|
rel?: never;
|
|
94
83
|
target?: never;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PromoCard.d.ts","sourceRoot":"","sources":["../../../src/promoCard/PromoCard.tsx"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"PromoCard.d.ts","sourceRoot":"","sources":["../../../src/promoCard/PromoCard.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA6D,MA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AAM,oBAAoB,GAAG,CACjC,KAAK,EAAE,kBAAkB,GAAG,qBAAqB,KAC9C,GAAG,CAAC,OAAO,CAAC;;AAoOjB,wBAAqC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transferwise/components",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-644f437",
|
|
4
4
|
"description": "Neptune React components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -97,8 +97,8 @@
|
|
|
97
97
|
"rollup": "^4.17.2",
|
|
98
98
|
"storybook": "^7.6.19",
|
|
99
99
|
"@transferwise/less-config": "3.1.0",
|
|
100
|
-
"@
|
|
101
|
-
"@
|
|
100
|
+
"@transferwise/neptune-css": "14.10.0",
|
|
101
|
+
"@wise/components-theming": "1.2.0"
|
|
102
102
|
},
|
|
103
103
|
"peerDependencies": {
|
|
104
104
|
"@transferwise/icons": "^3.7.0",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { addNoScrollClass, removeNoScrollClass } from './DOMOperations';
|
|
@@ -25,8 +25,11 @@ const CONTENT_SCROLL_THRESHOLD = 1;
|
|
|
25
25
|
|
|
26
26
|
const MOVE_OFFSET_THRESHOLD = 50;
|
|
27
27
|
|
|
28
|
-
type
|
|
29
|
-
{
|
|
28
|
+
export type BottomSheetProps = PropsWithChildren<
|
|
29
|
+
{
|
|
30
|
+
onClose?: (event: Event | SyntheticEvent) => void;
|
|
31
|
+
open: boolean;
|
|
32
|
+
} & CommonProps
|
|
30
33
|
>;
|
|
31
34
|
|
|
32
35
|
/**
|
|
@@ -35,7 +38,7 @@ type Props = PropsWithChildren<
|
|
|
35
38
|
* Neptune Web: https://transferwise.github.io/neptune-web/components/overlays/BottomSheet
|
|
36
39
|
*
|
|
37
40
|
*/
|
|
38
|
-
const BottomSheet = (props:
|
|
41
|
+
const BottomSheet = (props: BottomSheetProps): ReactElement => {
|
|
39
42
|
const bottomSheetReference = useRef<HTMLDivElement>(null);
|
|
40
43
|
const topBarReference = useRef<HTMLDivElement>(null);
|
|
41
44
|
const contentReference = useRef<HTMLDivElement>(null);
|
package/src/common/card/Card.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
|
-
import { MouseEvent,
|
|
2
|
+
import { MouseEvent, ReactNode, useRef } from 'react';
|
|
3
3
|
|
|
4
4
|
import { CloseButton } from '../closeButton';
|
|
5
5
|
import { stopPropagation } from '../domHelpers';
|
|
@@ -48,56 +48,48 @@ export interface CardProps {
|
|
|
48
48
|
* <p>Hello World!</p>
|
|
49
49
|
* </Card>
|
|
50
50
|
*/
|
|
51
|
-
const Card
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
ref,
|
|
64
|
-
) => {
|
|
65
|
-
const closeButtonReference = useRef(null);
|
|
51
|
+
const Card: React.FC<CardProps> = ({
|
|
52
|
+
className,
|
|
53
|
+
children = null,
|
|
54
|
+
id,
|
|
55
|
+
isDisabled = false,
|
|
56
|
+
isSmall = false,
|
|
57
|
+
onDismiss,
|
|
58
|
+
testId,
|
|
59
|
+
...props
|
|
60
|
+
}) => {
|
|
61
|
+
const closeButtonReference = useRef(null);
|
|
66
62
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
},
|
|
99
|
-
);
|
|
100
|
-
|
|
101
|
-
Card.displayName = 'Card';
|
|
63
|
+
return (
|
|
64
|
+
<div
|
|
65
|
+
className={classNames(
|
|
66
|
+
'np-Card',
|
|
67
|
+
{
|
|
68
|
+
'np-Card--small': !!isSmall,
|
|
69
|
+
'is-disabled': !!isDisabled,
|
|
70
|
+
},
|
|
71
|
+
className,
|
|
72
|
+
)}
|
|
73
|
+
id={id}
|
|
74
|
+
data-testid={testId}
|
|
75
|
+
{...props}
|
|
76
|
+
>
|
|
77
|
+
{onDismiss && (
|
|
78
|
+
<CloseButton
|
|
79
|
+
ref={closeButtonReference}
|
|
80
|
+
className="np-Card-closeButton"
|
|
81
|
+
size={isSmall ? 'sm' : 'md'}
|
|
82
|
+
isDisabled={isDisabled}
|
|
83
|
+
testId="close-button"
|
|
84
|
+
onClick={(e) => {
|
|
85
|
+
stopPropagation(e);
|
|
86
|
+
onDismiss();
|
|
87
|
+
}}
|
|
88
|
+
/>
|
|
89
|
+
)}
|
|
90
|
+
{children}
|
|
91
|
+
</div>
|
|
92
|
+
);
|
|
93
|
+
};
|
|
102
94
|
|
|
103
95
|
export default Card;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export function isIosDevice() {
|
|
2
|
+
const sampleTouchDevices = ['iphone', 'ipad', 'ipod'];
|
|
3
|
+
const matchString = sampleTouchDevices.map((device: string) => `(${device})`).join('|');
|
|
4
|
+
const regex = new RegExp(matchString, 'gi');
|
|
5
|
+
|
|
6
|
+
return typeof navigator !== 'undefined' && !!regex.test(navigator.userAgent);
|
|
7
|
+
}
|
|
@@ -8,19 +8,13 @@ import {
|
|
|
8
8
|
jest.mock('../deviceDetection');
|
|
9
9
|
|
|
10
10
|
describe('Document ios click', () => {
|
|
11
|
-
let add;
|
|
12
|
-
let remove;
|
|
11
|
+
let add: jest.SpyInstance;
|
|
12
|
+
let remove: jest.SpyInstance;
|
|
13
13
|
|
|
14
14
|
beforeEach(() => {
|
|
15
|
-
isIosDevice.mockReturnValue(false);
|
|
16
|
-
global.document =
|
|
17
|
-
|
|
18
|
-
classList: {
|
|
19
|
-
add: jest.fn(),
|
|
20
|
-
remove: jest.fn(),
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
};
|
|
15
|
+
(isIosDevice as jest.Mock).mockReturnValue(false);
|
|
16
|
+
global.document.documentElement.classList.add = jest.fn();
|
|
17
|
+
global.document.documentElement.classList.remove = jest.fn();
|
|
24
18
|
|
|
25
19
|
add = jest.spyOn(global.document.documentElement.classList, 'add');
|
|
26
20
|
remove = jest.spyOn(global.document.documentElement.classList, 'remove');
|
|
@@ -37,13 +31,13 @@ describe('Document ios click', () => {
|
|
|
37
31
|
});
|
|
38
32
|
|
|
39
33
|
it('does add ios click to document if it is ios device', () => {
|
|
40
|
-
isIosDevice.mockReturnValue(true);
|
|
34
|
+
(isIosDevice as jest.Mock).mockReturnValue(true);
|
|
41
35
|
addClickClassToDocumentOnIos();
|
|
42
36
|
expect(add).toHaveBeenCalledWith('ios-click');
|
|
43
37
|
});
|
|
44
38
|
|
|
45
39
|
it('does remove ios click from document if it is ios device', () => {
|
|
46
|
-
isIosDevice.mockReturnValue(true);
|
|
40
|
+
(isIosDevice as jest.Mock).mockReturnValue(true);
|
|
47
41
|
removeClickClassFromDocumentOnIos();
|
|
48
42
|
expect(remove).toHaveBeenCalledWith('ios-click');
|
|
49
43
|
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { SyntheticEvent } from 'react';
|
|
2
|
+
|
|
1
3
|
import { isIosDevice } from '../deviceDetection';
|
|
2
4
|
|
|
3
5
|
/*
|
|
@@ -17,3 +19,24 @@ export function removeClickClassFromDocumentOnIos() {
|
|
|
17
19
|
document.documentElement.classList.remove('ios-click');
|
|
18
20
|
}
|
|
19
21
|
}
|
|
22
|
+
|
|
23
|
+
export function isServerSide(): boolean {
|
|
24
|
+
return typeof window === 'undefined';
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function isBrowser(): boolean {
|
|
28
|
+
return !isServerSide();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function stopPropagation(event: SyntheticEvent) {
|
|
32
|
+
event.stopPropagation();
|
|
33
|
+
event.preventDefault();
|
|
34
|
+
if (event.nativeEvent && event.nativeEvent.stopImmediatePropagation) {
|
|
35
|
+
event.nativeEvent.stopImmediatePropagation();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function getSimpleRandomId(prefix: string): string {
|
|
40
|
+
const random = Math.ceil(Math.random() * 999999);
|
|
41
|
+
return `${prefix}${random}`;
|
|
42
|
+
}
|
|
@@ -1,27 +1,8 @@
|
|
|
1
|
-
import { SyntheticEvent } from 'react';
|
|
2
|
-
|
|
3
|
-
export function isServerSide(): boolean {
|
|
4
|
-
return typeof window === 'undefined';
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export function isBrowser(): boolean {
|
|
8
|
-
return !isServerSide();
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function stopPropagation(event: SyntheticEvent) {
|
|
12
|
-
event.stopPropagation();
|
|
13
|
-
event.preventDefault();
|
|
14
|
-
if (event.nativeEvent && event.nativeEvent.stopImmediatePropagation) {
|
|
15
|
-
event.nativeEvent.stopImmediatePropagation();
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function getSimpleRandomId(prefix: string): string {
|
|
20
|
-
const random = Math.ceil(Math.random() * 999999);
|
|
21
|
-
return `${prefix}${random}`;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
1
|
export {
|
|
25
2
|
addClickClassToDocumentOnIos,
|
|
3
|
+
getSimpleRandomId,
|
|
4
|
+
isBrowser,
|
|
5
|
+
isServerSide,
|
|
26
6
|
removeClickClassFromDocumentOnIos,
|
|
7
|
+
stopPropagation,
|
|
27
8
|
} from './documentIosClick';
|
|
@@ -4,6 +4,7 @@ import { render } from '@testing-library/react';
|
|
|
4
4
|
import { Layout } from '../propsValues/layouts';
|
|
5
5
|
|
|
6
6
|
import FlowHeader from './FlowHeader';
|
|
7
|
+
import type { FlowHeaderProps } from './FlowHeader';
|
|
7
8
|
|
|
8
9
|
describe('FlowHeader', () => {
|
|
9
10
|
const props = {
|
|
@@ -11,7 +12,7 @@ describe('FlowHeader', () => {
|
|
|
11
12
|
rightContent: 'rightContent',
|
|
12
13
|
bottomContent: 'bottomContent',
|
|
13
14
|
className: 'className',
|
|
14
|
-
};
|
|
15
|
+
} satisfies FlowHeaderProps;
|
|
15
16
|
it('renders as expected', () => {
|
|
16
17
|
expect(render(<FlowHeader {...props} />).container).toMatchSnapshot();
|
|
17
18
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './FlowHeader';
|