@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
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
class HistoryNavigator {
|
|
2
|
-
|
|
2
|
+
history: (string | number)[];
|
|
3
|
+
currIndex: number;
|
|
4
|
+
historyLimit: number | undefined;
|
|
5
|
+
|
|
6
|
+
constructor(history?: (string | number)[], historyLimit?: number) {
|
|
3
7
|
this.history = history && history.length > 0 ? history : [''];
|
|
4
8
|
this.currIndex = this.history.length - 1;
|
|
5
9
|
this.historyLimit = historyLimit;
|
|
6
10
|
}
|
|
7
11
|
|
|
8
|
-
reset = (newHistory
|
|
9
|
-
this.history = newHistory;
|
|
10
|
-
this.currIndex =
|
|
12
|
+
reset = (newHistory?: (string | number)[], historyLimit = 20) => {
|
|
13
|
+
this.history = newHistory && newHistory.length > 0 ? newHistory : [''];
|
|
14
|
+
this.currIndex = this.history.length - 1;
|
|
11
15
|
this.historyLimit = historyLimit;
|
|
12
16
|
};
|
|
13
17
|
|
|
14
|
-
add = (element) => {
|
|
18
|
+
add = (element: string | number) => {
|
|
15
19
|
if (!this.historyLimit || this.history.length <= this.historyLimit) {
|
|
16
20
|
this.history.push(element);
|
|
17
21
|
// Always keep the current Index to the latest change
|
|
@@ -4,6 +4,11 @@ import { Position } from '..';
|
|
|
4
4
|
import { render } from '../../test-utils';
|
|
5
5
|
|
|
6
6
|
import Panel from './Panel';
|
|
7
|
+
import type { PanelProps } from './Panel';
|
|
8
|
+
|
|
9
|
+
const mockAnchorRef: React.RefObject<HTMLAnchorElement> = {
|
|
10
|
+
current: document.createElement('a'),
|
|
11
|
+
};
|
|
7
12
|
|
|
8
13
|
describe('Panel', () => {
|
|
9
14
|
const props = {
|
|
@@ -11,9 +16,9 @@ describe('Panel', () => {
|
|
|
11
16
|
children: <div>children</div>,
|
|
12
17
|
open: true,
|
|
13
18
|
position: Position.TOP,
|
|
14
|
-
anchorRef:
|
|
19
|
+
anchorRef: mockAnchorRef,
|
|
15
20
|
onClose: jest.fn(),
|
|
16
|
-
};
|
|
21
|
+
} satisfies PanelProps;
|
|
17
22
|
|
|
18
23
|
it('renders', () => {
|
|
19
24
|
const { container } = render(<Panel {...props} />);
|
|
@@ -31,7 +36,7 @@ describe('Panel', () => {
|
|
|
31
36
|
expect(getArrow()).toBeInTheDocument();
|
|
32
37
|
});
|
|
33
38
|
|
|
34
|
-
it('opens/closes Panel based on open',
|
|
39
|
+
it('opens/closes Panel based on open', () => {
|
|
35
40
|
const { rerender } = render(<Panel {...props} open={false} />);
|
|
36
41
|
|
|
37
42
|
expect(getPanel()).not.toBeInTheDocument();
|
|
@@ -41,9 +46,9 @@ describe('Panel', () => {
|
|
|
41
46
|
expect(getPanel()).toBeInTheDocument();
|
|
42
47
|
});
|
|
43
48
|
|
|
44
|
-
it('does not set width for content as width of an anchor (by default)',
|
|
45
|
-
const anchorReference = createRef();
|
|
46
|
-
const panelReference = createRef();
|
|
49
|
+
it('does not set width for content as width of an anchor (by default)', () => {
|
|
50
|
+
const anchorReference = createRef<HTMLDivElement>();
|
|
51
|
+
const panelReference = createRef<HTMLDivElement>();
|
|
47
52
|
|
|
48
53
|
render(
|
|
49
54
|
<>
|
|
@@ -61,9 +66,9 @@ describe('Panel', () => {
|
|
|
61
66
|
expect(panelReference.current).toHaveStyle({ width: undefined });
|
|
62
67
|
});
|
|
63
68
|
|
|
64
|
-
it('sets same width for content as width of an anchor (anchorWidth={true})',
|
|
65
|
-
const anchorReference = createRef();
|
|
66
|
-
const panelReference = createRef();
|
|
69
|
+
it('sets same width for content as width of an anchor (anchorWidth={true})', () => {
|
|
70
|
+
const anchorReference = createRef<HTMLDivElement>();
|
|
71
|
+
const panelReference = createRef<HTMLDivElement>();
|
|
67
72
|
|
|
68
73
|
render(
|
|
69
74
|
<>
|
|
@@ -26,7 +26,7 @@ const fallbackPlacements = {
|
|
|
26
26
|
[Position.RIGHT]: [Position.LEFT, Position.TOP, Position.BOTTOM],
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
export type
|
|
29
|
+
export type PanelProps = PropsWithChildren<{
|
|
30
30
|
arrow?: boolean;
|
|
31
31
|
flip?: boolean;
|
|
32
32
|
altAxis?: boolean;
|
|
@@ -38,7 +38,7 @@ export type Props = PropsWithChildren<{
|
|
|
38
38
|
}> &
|
|
39
39
|
HTMLAttributes<HTMLDivElement>;
|
|
40
40
|
|
|
41
|
-
const Panel = forwardRef<HTMLDivElement,
|
|
41
|
+
const Panel = forwardRef<HTMLDivElement, PanelProps>(
|
|
42
42
|
(
|
|
43
43
|
{
|
|
44
44
|
arrow = false,
|
|
@@ -51,7 +51,7 @@ const Panel = forwardRef<HTMLDivElement, Props>(
|
|
|
51
51
|
anchorRef,
|
|
52
52
|
anchorWidth = false,
|
|
53
53
|
...rest
|
|
54
|
-
}:
|
|
54
|
+
}: PanelProps,
|
|
55
55
|
reference,
|
|
56
56
|
) => {
|
|
57
57
|
const [arrowElement, setArrowElement] = useState<HTMLDivElement | null>(null);
|
|
@@ -6,7 +6,7 @@ import { Position } from '..';
|
|
|
6
6
|
import BottomSheet from '../bottomSheet';
|
|
7
7
|
import { useLayout } from '../hooks';
|
|
8
8
|
import Panel from '../panel';
|
|
9
|
-
import {
|
|
9
|
+
import { PanelProps } from '../panel/Panel';
|
|
10
10
|
|
|
11
11
|
const ResponsivePanel = forwardRef<HTMLDivElement, PanelProps>(
|
|
12
12
|
(
|
package/src/dimmer/Dimmer.tsx
CHANGED
|
@@ -29,7 +29,7 @@ export const EXIT_ANIMATION = 350;
|
|
|
29
29
|
|
|
30
30
|
const dimmerManager = new DimmerManager();
|
|
31
31
|
|
|
32
|
-
type DimmerProps = CommonProps & {
|
|
32
|
+
export type DimmerProps = CommonProps & {
|
|
33
33
|
children?: ReactNode;
|
|
34
34
|
disableClickToClose?: boolean;
|
|
35
35
|
contentPosition?: PositionTop | PositionCenter | PositionBottom;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
|
-
import { useRef } from 'react';
|
|
3
2
|
import { useIntl } from 'react-intl';
|
|
4
3
|
|
|
5
4
|
import { Breakpoint, Layout } from '../common';
|
|
@@ -8,10 +7,10 @@ import FlowHeader from '../common/flowHeader/FlowHeader';
|
|
|
8
7
|
import Logo from '../logo';
|
|
9
8
|
import Stepper, { type Step } from '../stepper/Stepper';
|
|
10
9
|
|
|
10
|
+
import { useScreenSize } from '../common/hooks/useScreenSize';
|
|
11
11
|
import messages from './FlowNavigation.messages';
|
|
12
12
|
import AnimatedLabel from './animatedLabel';
|
|
13
13
|
import BackButton from './backButton';
|
|
14
|
-
import { useScreenSize } from '../common/hooks/useScreenSize';
|
|
15
14
|
|
|
16
15
|
export interface FlowNavigationProps {
|
|
17
16
|
activeStep?: number;
|
package/src/index.ts
CHANGED
|
@@ -1,24 +1,30 @@
|
|
|
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 {
|
|
11
|
+
BodyTypes,
|
|
12
|
+
DisplayTypes,
|
|
13
|
+
LayoutDirection,
|
|
14
|
+
LinkTypes,
|
|
15
|
+
TitleTypes,
|
|
16
|
+
TypographyTypes,
|
|
17
|
+
} from './common';
|
|
18
|
+
export type { BottomSheetProps } from './common/bottomSheet';
|
|
19
|
+
export type { DateInputProps } from './dateInput';
|
|
20
|
+
export type { DateLookupProps } from './dateLookup';
|
|
11
21
|
export type { DecisionProps } from './decision/Decision';
|
|
22
|
+
export type { DimmerProps } from './dimmer';
|
|
12
23
|
export type { EmphasisProps } from './emphasis';
|
|
13
24
|
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
25
|
export type { InputWithDisplayFormatProps } from './inputWithDisplayFormat';
|
|
26
|
+
export type { InputProps } from './inputs/Input';
|
|
19
27
|
export type { InputGroupProps } from './inputs/InputGroup';
|
|
20
|
-
export type { LoaderProps } from './loader';
|
|
21
|
-
export type { NavigationOptionListProps } from './navigationOptionsList';
|
|
22
28
|
export type { SearchInputProps } from './inputs/SearchInput';
|
|
23
29
|
export type {
|
|
24
30
|
SelectInputGroupItem,
|
|
@@ -30,50 +36,43 @@ export type {
|
|
|
30
36
|
SelectInputTriggerButtonProps,
|
|
31
37
|
} from './inputs/SelectInput';
|
|
32
38
|
export type { TextAreaProps } from './inputs/TextArea';
|
|
39
|
+
export type { InstructionsListProps } from './instructionsList';
|
|
40
|
+
export type { LoaderProps } from './loader';
|
|
41
|
+
export type { MarkdownProps } from './markdown';
|
|
42
|
+
export type { ModalProps } from './modal';
|
|
43
|
+
export type { MoneyProps } from './money';
|
|
44
|
+
export type {
|
|
45
|
+
CurrencyHeaderItem,
|
|
46
|
+
CurrencyItem,
|
|
47
|
+
CurrencyOptionItem,
|
|
48
|
+
MoneyInputProps,
|
|
49
|
+
} from './moneyInput';
|
|
50
|
+
export type { NavigationOptionListProps } from './navigationOptionsList';
|
|
33
51
|
export type { PhoneNumberInputProps } from './phoneNumberInput/PhoneNumberInput';
|
|
34
52
|
export type { PopoverProps } from './popover';
|
|
35
53
|
export type { ProgressProps } from './progress';
|
|
36
54
|
export type { ProgressBarProps } from './progressBar';
|
|
37
|
-
export type {
|
|
55
|
+
export type { DirectionProviderProps, LanguageProviderProps, ProviderProps } from './provider';
|
|
38
56
|
export type { RadioProps } from './radio';
|
|
39
57
|
export type { RadioGroupProps, RadioGroupRadio } from './radioGroup';
|
|
40
58
|
export type { RadioOptionProps } from './radioOption';
|
|
59
|
+
export type { SegmentedControlProps } from './segmentedControl';
|
|
60
|
+
export type { SlidingPanelProps } from './slidingPanel';
|
|
41
61
|
export type { SnackbarProps } from './snackbar/Snackbar';
|
|
42
62
|
export type { SnackbarContextType } from './snackbar/SnackbarContext';
|
|
43
63
|
export type { StatusIconProps } from './statusIcon';
|
|
44
64
|
export type { StickyProps } from './sticky';
|
|
65
|
+
export type { SummaryProps } from './summary';
|
|
45
66
|
export type { SwitchProps } from './switch';
|
|
46
67
|
export type { SwitchOptionProps } from './switchOption';
|
|
47
68
|
export type { TextareaWithDisplayFormatProps } from './textareaWithDisplayFormat';
|
|
48
69
|
export type { TooltipProps } from './tooltip';
|
|
49
|
-
export type {
|
|
50
|
-
export type {
|
|
51
|
-
export type { ModalProps } from './modal';
|
|
52
|
-
export type { MoneyProps } from './money';
|
|
53
|
-
export type {
|
|
54
|
-
CurrencyHeaderItem,
|
|
55
|
-
CurrencyItem,
|
|
56
|
-
CurrencyOptionItem,
|
|
57
|
-
MoneyInputProps,
|
|
58
|
-
} from './moneyInput';
|
|
59
|
-
export type { SlidingPanelProps } from './slidingPanel';
|
|
60
|
-
export type {
|
|
61
|
-
LayoutDirection,
|
|
62
|
-
TypographyTypes,
|
|
63
|
-
TitleTypes,
|
|
64
|
-
BodyTypes,
|
|
65
|
-
LinkTypes,
|
|
66
|
-
DisplayTypes,
|
|
67
|
-
} from './common';
|
|
68
|
-
export type { SegmentedControlProps } from './segmentedControl';
|
|
69
|
-
export type { TypeaheadProps, TypeaheadOption } from './typeahead';
|
|
70
|
-
export type { InstructionsListProps } from './instructionsList';
|
|
70
|
+
export type { TypeaheadOption, TypeaheadProps } from './typeahead';
|
|
71
|
+
export type { UploadError, UploadResponse, UploadedFile } from './uploadInput/types';
|
|
71
72
|
|
|
72
73
|
/**
|
|
73
74
|
* Components
|
|
74
75
|
*/
|
|
75
|
-
export { default as Title } from './title';
|
|
76
|
-
export { default as Body } from './body';
|
|
77
76
|
export { default as Accordion } from './accordion';
|
|
78
77
|
export { default as ActionButton } from './actionButton';
|
|
79
78
|
export { default as ActionOption } from './actionOption';
|
|
@@ -81,17 +80,19 @@ export { default as Alert } from './alert';
|
|
|
81
80
|
export { default as Avatar } from './avatar';
|
|
82
81
|
export { default as AvatarWrapper } from './avatarWrapper';
|
|
83
82
|
export { default as Badge } from './badge';
|
|
84
|
-
export { default as
|
|
83
|
+
export { default as Body } from './body';
|
|
85
84
|
export { default as Button } from './button';
|
|
86
|
-
export { default as Carousel } from './carousel';
|
|
87
85
|
export { default as Card } from './card';
|
|
88
|
-
export { default as BaseCard } from './common/card';
|
|
89
86
|
export { default as Checkbox } from './checkbox';
|
|
90
87
|
export { default as CheckboxButton } from './checkboxButton';
|
|
91
88
|
export { default as CheckboxOption } from './checkboxOption';
|
|
92
89
|
export { default as Chevron } from './chevron';
|
|
93
|
-
export { default as Chips
|
|
90
|
+
export { Chip, default as Chips } from './chips';
|
|
94
91
|
export { default as CircularButton } from './circularButton';
|
|
92
|
+
export { default as Option } from './common/Option';
|
|
93
|
+
export { default as BottomSheet } from './common/bottomSheet';
|
|
94
|
+
export { default as BaseCard } from './common/card';
|
|
95
|
+
export { default as CriticalCommsBanner } from './criticalBanner';
|
|
95
96
|
export { default as DateInput } from './dateInput';
|
|
96
97
|
export { default as DateLookup } from './dateLookup';
|
|
97
98
|
export { default as Decision } from './decision';
|
|
@@ -106,6 +107,7 @@ export { default as Header } from './header';
|
|
|
106
107
|
export { default as Image } from './image';
|
|
107
108
|
export { default as Info } from './info';
|
|
108
109
|
export { default as InlineAlert } from './inlineAlert';
|
|
110
|
+
export { default as InputWithDisplayFormat } from './inputWithDisplayFormat';
|
|
109
111
|
export { Input } from './inputs/Input';
|
|
110
112
|
export { InputGroup } from './inputs/InputGroup';
|
|
111
113
|
export { SearchInput } from './inputs/SearchInput';
|
|
@@ -115,9 +117,9 @@ export {
|
|
|
115
117
|
SelectInputTriggerButton,
|
|
116
118
|
} from './inputs/SelectInput';
|
|
117
119
|
export { TextArea } from './inputs/TextArea';
|
|
118
|
-
export { default as InputWithDisplayFormat } from './inputWithDisplayFormat';
|
|
119
120
|
export { default as InstructionsList } from './instructionsList';
|
|
120
121
|
export { default as Link } from './link';
|
|
122
|
+
export { default as ListItem } from './listItem';
|
|
121
123
|
export { default as Loader } from './loader';
|
|
122
124
|
export { default as Logo } from './logo';
|
|
123
125
|
export { default as Markdown } from './markdown';
|
|
@@ -127,24 +129,23 @@ export { default as MoneyInput } from './moneyInput';
|
|
|
127
129
|
export { default as NavigationOption } from './navigationOption';
|
|
128
130
|
export { default as NavigationOptionsList } from './navigationOptionsList';
|
|
129
131
|
export { default as Nudge } from './nudge';
|
|
130
|
-
export { default as Option } from './common/Option';
|
|
131
132
|
export { default as OverlayHeader } from './overlayHeader';
|
|
132
133
|
export { default as PhoneNumberInput } from './phoneNumberInput';
|
|
133
134
|
export { default as Popover } from './popover';
|
|
134
135
|
export { default as ProcessIndicator } from './processIndicator';
|
|
135
|
-
export { default as ProgressBar } from './progressBar';
|
|
136
136
|
export { default as Progress } from './progress';
|
|
137
|
-
export { default as
|
|
138
|
-
export { default as
|
|
139
|
-
export { default as Provider
|
|
137
|
+
export { default as ProgressBar } from './progressBar';
|
|
138
|
+
export { PromoCardGroup, default as PromoCard } from './promoCard';
|
|
139
|
+
export { DirectionProvider, LanguageProvider, default as Provider } from './provider';
|
|
140
140
|
export { default as Radio } from './radio';
|
|
141
141
|
export { default as RadioGroup } from './radioGroup';
|
|
142
142
|
export { default as RadioOption } from './radioOption';
|
|
143
143
|
export { default as Section } from './section';
|
|
144
|
-
export { default as Select } from './select';
|
|
145
144
|
export { default as SegmentedControl } from './segmentedControl';
|
|
145
|
+
export { default as Select } from './select';
|
|
146
146
|
export { default as SlidingPanel } from './slidingPanel';
|
|
147
147
|
export { default as SnackbarPortal } from './snackbar/Snackbar';
|
|
148
|
+
export { SnackbarConsumer, SnackbarContext } from './snackbar/SnackbarContext';
|
|
148
149
|
export { default as SnackbarProvider } from './snackbar/SnackbarProvider';
|
|
149
150
|
export { default as StatusIcon } from './statusIcon/StatusIcon';
|
|
150
151
|
export { default as Stepper } from './stepper/Stepper';
|
|
@@ -154,66 +155,65 @@ export { default as Switch } from './switch';
|
|
|
154
155
|
export { default as SwitchOption } from './switchOption';
|
|
155
156
|
export { default as Tabs } from './tabs';
|
|
156
157
|
export { default as TextareaWithDisplayFormat } from './textareaWithDisplayFormat';
|
|
158
|
+
export { default as Title } from './title';
|
|
157
159
|
export { default as Tooltip } from './tooltip';
|
|
158
160
|
export { default as Typeahead } from './typeahead';
|
|
159
161
|
export { default as Upload } from './upload';
|
|
160
162
|
export { default as UploadInput } from './uploadInput';
|
|
161
|
-
export { SnackbarConsumer, SnackbarContext } from './snackbar/SnackbarContext';
|
|
162
|
-
export { default as CriticalCommsBanner } from './criticalBanner';
|
|
163
|
-
export { default as ListItem } from './listItem';
|
|
164
163
|
|
|
165
164
|
/**
|
|
166
165
|
* Hooks
|
|
167
166
|
*/
|
|
168
|
-
export { default as useSnackbar } from './snackbar/useSnackbar';
|
|
169
167
|
export { useDirection, useLayout } from './common/hooks';
|
|
170
168
|
export { useScreenSize } from './common/hooks/useScreenSize';
|
|
169
|
+
export { default as useSnackbar } from './snackbar/useSnackbar';
|
|
171
170
|
|
|
172
171
|
/**
|
|
173
172
|
* Enums
|
|
174
173
|
*/
|
|
174
|
+
export { AlertArrowPosition } from './alert/Alert';
|
|
175
|
+
export { AvatarType } from './avatar';
|
|
175
176
|
export {
|
|
176
|
-
|
|
177
|
-
Size,
|
|
178
|
-
Width,
|
|
179
|
-
Sentiment,
|
|
180
|
-
Priority,
|
|
177
|
+
Breakpoint,
|
|
181
178
|
ControlType,
|
|
182
|
-
Type,
|
|
183
|
-
Theme,
|
|
184
179
|
DateMode,
|
|
180
|
+
Direction,
|
|
181
|
+
FileType,
|
|
182
|
+
Layout,
|
|
183
|
+
MarkdownNodeType,
|
|
185
184
|
MonthFormat,
|
|
186
185
|
Position,
|
|
187
|
-
|
|
186
|
+
Priority,
|
|
188
187
|
ProfileType,
|
|
189
|
-
|
|
190
|
-
|
|
188
|
+
Scroll,
|
|
189
|
+
Sentiment,
|
|
190
|
+
Size,
|
|
191
191
|
Status,
|
|
192
|
-
|
|
192
|
+
Theme,
|
|
193
|
+
Type,
|
|
193
194
|
Typography,
|
|
194
195
|
Variant,
|
|
196
|
+
Width,
|
|
195
197
|
} from './common';
|
|
196
|
-
export { AvatarType } from './avatar';
|
|
197
|
-
export { InfoPresentation } from './info';
|
|
198
|
-
export { UploadStep } from './upload';
|
|
199
198
|
export { DecisionPresentation, DecisionType } from './decision';
|
|
199
|
+
export { InfoPresentation } from './info';
|
|
200
200
|
export { LogoType } from './logo';
|
|
201
|
-
export {
|
|
201
|
+
export { UploadStep } from './upload';
|
|
202
202
|
|
|
203
203
|
/**
|
|
204
204
|
* Utils
|
|
205
205
|
*/
|
|
206
206
|
export {
|
|
207
|
-
adjustLocale,
|
|
208
207
|
DEFAULT_LANG,
|
|
209
208
|
DEFAULT_LOCALE,
|
|
209
|
+
RTL_LANGUAGES,
|
|
210
|
+
SUPPORTED_LANGUAGES,
|
|
211
|
+
adjustLocale,
|
|
210
212
|
getCountryFromLocale,
|
|
211
213
|
getDirectionFromLocale,
|
|
212
214
|
getLangFromLocale,
|
|
213
215
|
isBrowser,
|
|
214
216
|
isServerSide,
|
|
215
|
-
RTL_LANGUAGES,
|
|
216
|
-
SUPPORTED_LANGUAGES,
|
|
217
217
|
} from './common';
|
|
218
218
|
|
|
219
219
|
/**
|
package/src/main.css
CHANGED
|
@@ -643,144 +643,6 @@ div.critical-comms .critical-comms-body {
|
|
|
643
643
|
border-radius: 16px 16px 0 0;
|
|
644
644
|
border-radius: var(--radius-medium) var(--radius-medium) 0 0;
|
|
645
645
|
}
|
|
646
|
-
.carousel {
|
|
647
|
-
display: flex;
|
|
648
|
-
align-items: center;
|
|
649
|
-
overflow-x: scroll;
|
|
650
|
-
overflow-y: hidden;
|
|
651
|
-
scroll-snap-type: x mandatory;
|
|
652
|
-
scroll-behavior: smooth;
|
|
653
|
-
gap: 16px;
|
|
654
|
-
gap: var(--size-16);
|
|
655
|
-
}
|
|
656
|
-
@media (max-width: 767px) {
|
|
657
|
-
.carousel {
|
|
658
|
-
gap: 8px;
|
|
659
|
-
gap: var(--size-8);
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
.carousel__header {
|
|
663
|
-
display: flex;
|
|
664
|
-
align-items: center;
|
|
665
|
-
overflow: hidden;
|
|
666
|
-
min-height: 32px;
|
|
667
|
-
min-height: var(--size-32);
|
|
668
|
-
padding-bottom: 16px;
|
|
669
|
-
padding-bottom: var(--size-16);
|
|
670
|
-
}
|
|
671
|
-
.carousel__card,
|
|
672
|
-
.carousel__card:hover,
|
|
673
|
-
.carousel__card:focus,
|
|
674
|
-
.carousel__card:focus-within {
|
|
675
|
-
-webkit-text-decoration: none;
|
|
676
|
-
text-decoration: none;
|
|
677
|
-
outline: none !important;
|
|
678
|
-
}
|
|
679
|
-
.carousel__card {
|
|
680
|
-
display: block;
|
|
681
|
-
position: relative;
|
|
682
|
-
text-align: left;
|
|
683
|
-
border: none;
|
|
684
|
-
overflow: hidden;
|
|
685
|
-
background: rgba(134,167,189,0.10196);
|
|
686
|
-
background: var(--color-background-neutral);
|
|
687
|
-
border-radius: 32px;
|
|
688
|
-
border-radius: var(--size-32);
|
|
689
|
-
scroll-snap-align: center;
|
|
690
|
-
-webkit-scroll-snap-align: center;
|
|
691
|
-
transition: all 0.4s !important;
|
|
692
|
-
}
|
|
693
|
-
@media (min-width: 1200px) {
|
|
694
|
-
.carousel__card {
|
|
695
|
-
min-width: 280px;
|
|
696
|
-
width: 280px;
|
|
697
|
-
height: 280px;
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
@media (max-width: 1199px) {
|
|
701
|
-
.carousel__card {
|
|
702
|
-
min-width: 242px;
|
|
703
|
-
width: 242px;
|
|
704
|
-
height: 242px;
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
@media (max-width: 767px) {
|
|
708
|
-
.carousel__card {
|
|
709
|
-
min-width: 336px;
|
|
710
|
-
width: 336px;
|
|
711
|
-
height: 336px;
|
|
712
|
-
scroll-snap-stop: always;
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
.carousel__card:focus {
|
|
716
|
-
outline: 0;
|
|
717
|
-
}
|
|
718
|
-
.carousel__card:focus:after,
|
|
719
|
-
.carousel__card:focus-within:after {
|
|
720
|
-
content: '';
|
|
721
|
-
position: absolute;
|
|
722
|
-
z-index: 4;
|
|
723
|
-
top: 0;
|
|
724
|
-
left: 0;
|
|
725
|
-
width: 100%;
|
|
726
|
-
height: 100%;
|
|
727
|
-
border-radius: 32px;
|
|
728
|
-
border-radius: var(--size-32);
|
|
729
|
-
box-shadow: inset 0 0 0 2px var(--ring-outline-color);
|
|
730
|
-
}
|
|
731
|
-
.carousel__card:hover {
|
|
732
|
-
background-color: var(--color-background-neutral-hover);
|
|
733
|
-
}
|
|
734
|
-
.carousel__card:focus {
|
|
735
|
-
background-color: var(--color-background-neutral-hover);
|
|
736
|
-
}
|
|
737
|
-
.carousel__card-content {
|
|
738
|
-
height: 100%;
|
|
739
|
-
font-weight: normal;
|
|
740
|
-
padding: 24px;
|
|
741
|
-
padding: var(--size-24);
|
|
742
|
-
}
|
|
743
|
-
.carousel__scroll-button {
|
|
744
|
-
width: 32px;
|
|
745
|
-
width: var(--size-32);
|
|
746
|
-
height: 32px;
|
|
747
|
-
height: var(--size-32);
|
|
748
|
-
align-items: center;
|
|
749
|
-
justify-content: center;
|
|
750
|
-
}
|
|
751
|
-
.carousel__indicators {
|
|
752
|
-
display: flex;
|
|
753
|
-
justify-content: center;
|
|
754
|
-
padding-top: 8px;
|
|
755
|
-
padding-top: var(--size-8);
|
|
756
|
-
gap: 8px;
|
|
757
|
-
gap: var(--size-8);
|
|
758
|
-
}
|
|
759
|
-
.carousel__indicator {
|
|
760
|
-
width: 12px;
|
|
761
|
-
width: var(--size-12);
|
|
762
|
-
height: 12px;
|
|
763
|
-
height: var(--size-12);
|
|
764
|
-
border-radius: 8px;
|
|
765
|
-
border-radius: var(--size-8);
|
|
766
|
-
background: #c9cbce;
|
|
767
|
-
background: var(--color-interactive-secondary);
|
|
768
|
-
border: none;
|
|
769
|
-
-webkit-appearance: none;
|
|
770
|
-
-moz-appearance: none;
|
|
771
|
-
appearance: none;
|
|
772
|
-
transition: all 0.1s;
|
|
773
|
-
}
|
|
774
|
-
.carousel__indicator:hover {
|
|
775
|
-
width: 16px;
|
|
776
|
-
width: var(--size-16);
|
|
777
|
-
}
|
|
778
|
-
.carousel__indicator--selected,
|
|
779
|
-
.carousel__indicator--selected:hover {
|
|
780
|
-
background: var(--color-interactive-primary);
|
|
781
|
-
width: 24px;
|
|
782
|
-
width: var(--size-24);
|
|
783
|
-
}
|
|
784
646
|
.np-checkbox-button input[type="checkbox"] {
|
|
785
647
|
position: absolute;
|
|
786
648
|
width: 24px;
|
package/src/main.less
CHANGED
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
|
|
4
4
|
import { Size } from '../common';
|
|
5
5
|
import { CloseButton } from '../common/closeButton';
|
|
6
|
-
import FlowHeader from '../common/flowHeader
|
|
6
|
+
import FlowHeader from '../common/flowHeader';
|
|
7
7
|
import Logo from '../logo';
|
|
8
8
|
|
|
9
9
|
const OverlayHeader = ({ avatar, onClose, logo }) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { StarFill } from '@transferwise/icons';
|
|
3
3
|
|
|
4
|
-
import PromoCard, {
|
|
4
|
+
import PromoCard, { PromoCardCheckedProps, PromoCardLinkProps } from './PromoCard';
|
|
5
5
|
|
|
6
6
|
const meta: Meta<typeof PromoCard> = {
|
|
7
7
|
component: PromoCard,
|