@transferwise/components 46.114.0 → 46.115.0
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/common/closeButton/CloseButton.messages.js +2 -2
- package/build/common/closeButton/CloseButton.messages.js.map +1 -1
- package/build/common/closeButton/CloseButton.messages.mjs +2 -2
- package/build/common/closeButton/CloseButton.messages.mjs.map +1 -1
- package/build/common/closeButton/CloseButton.mjs +2 -2
- package/build/common/closeButton/CloseButton.mjs.map +1 -1
- package/build/common/hooks/useVirtualKeyboard.js +4 -3
- package/build/common/hooks/useVirtualKeyboard.js.map +1 -1
- package/build/common/hooks/useVirtualKeyboard.mjs +4 -3
- package/build/common/hooks/useVirtualKeyboard.mjs.map +1 -1
- package/build/drawer/Drawer.js +18 -9
- package/build/drawer/Drawer.js.map +1 -1
- package/build/drawer/Drawer.mjs +18 -9
- package/build/drawer/Drawer.mjs.map +1 -1
- package/build/i18n/nl.json +1 -1
- package/build/i18n/nl.json.js +1 -1
- package/build/i18n/nl.json.mjs +1 -1
- package/build/inputs/_BottomSheet.js +1 -1
- package/build/inputs/_BottomSheet.js.map +1 -1
- package/build/inputs/_BottomSheet.mjs +1 -1
- package/build/inputs/_BottomSheet.mjs.map +1 -1
- package/build/main.css +17 -127
- package/build/modal/Modal.js +20 -21
- package/build/modal/Modal.js.map +1 -1
- package/build/modal/Modal.mjs +20 -21
- package/build/modal/Modal.mjs.map +1 -1
- package/build/styles/drawer/Drawer.css +11 -58
- package/build/styles/main.css +17 -127
- package/build/styles/modal/Modal.css +6 -69
- package/build/types/common/hooks/useVirtualKeyboard.d.ts +2 -1
- package/build/types/common/hooks/useVirtualKeyboard.d.ts.map +1 -1
- package/build/types/drawer/Drawer.d.ts.map +1 -1
- package/build/types/modal/Modal.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/accordion/Accordion.story.tsx +1 -1
- package/src/avatarLayout/AvatarLayout.story.tsx +1 -0
- package/src/avatarView/AvatarView.story.tsx +1 -0
- package/src/common/hooks/useVirtualKeyboard.ts +4 -3
- package/src/display/Display.story.tsx +1 -0
- package/src/drawer/Drawer.css +11 -58
- package/src/drawer/Drawer.less +14 -70
- package/src/drawer/Drawer.story.tsx +158 -100
- package/src/drawer/Drawer.tsx +26 -7
- package/src/i18n/nl.json +1 -1
- package/src/iconButton/IconButton.story.tsx +1 -0
- package/src/inputs/_BottomSheet.tsx +1 -1
- package/src/main.css +17 -127
- package/src/modal/Modal.css +6 -69
- package/src/modal/Modal.less +6 -76
- package/src/modal/Modal.tsx +23 -23
- package/src/provider/theme/ThemeProvider.story.tsx +23 -0
package/src/modal/Modal.less
CHANGED
|
@@ -10,14 +10,9 @@
|
|
|
10
10
|
.tw-modal-dialog {
|
|
11
11
|
transition: transform 0.3s ease-out;
|
|
12
12
|
transform: translateY(-25%);
|
|
13
|
-
box-shadow:
|
|
13
|
+
box-shadow: none;
|
|
14
14
|
background: var(--color-background-elevated);
|
|
15
|
-
|
|
16
|
-
.np-theme-personal & {
|
|
17
|
-
background: var(--color-background-elevated);
|
|
18
|
-
box-shadow: none;
|
|
19
|
-
border-radius: var(--radius-large);
|
|
20
|
-
}
|
|
15
|
+
border-radius: var(--radius-large);
|
|
21
16
|
}
|
|
22
17
|
|
|
23
18
|
&.in {
|
|
@@ -28,6 +23,7 @@
|
|
|
28
23
|
|
|
29
24
|
.tw-modal-content {
|
|
30
25
|
width: 100%;
|
|
26
|
+
background-color: transparent;
|
|
31
27
|
|
|
32
28
|
.tw-modal-body {
|
|
33
29
|
flex: 1;
|
|
@@ -38,28 +34,6 @@
|
|
|
38
34
|
}
|
|
39
35
|
}
|
|
40
36
|
|
|
41
|
-
.tw-modal-header {
|
|
42
|
-
box-shadow: inset 0 -1px 0 0 rgb(226 230 232);
|
|
43
|
-
|
|
44
|
-
.np-theme-personal & {
|
|
45
|
-
box-shadow: inset 0 -1px 0 0 var(--color-border-neutral);
|
|
46
|
-
|
|
47
|
-
.np-close-button {
|
|
48
|
-
margin: calc(var(--size-8) * -1) calc(var(--size-8) * -1) calc(var(--size-8) * -1) 0;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
&.modal--withoutborder {
|
|
53
|
-
box-shadow: none;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.tw-icon {
|
|
57
|
-
fill: var(--color-content-accent);
|
|
58
|
-
cursor: pointer;
|
|
59
|
-
display: block;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
37
|
.tw-modal-header,
|
|
64
38
|
.tw-modal-footer,
|
|
65
39
|
.tw-modal-body {
|
|
@@ -73,63 +47,19 @@
|
|
|
73
47
|
.tw-modal-footer {
|
|
74
48
|
padding-top: var(--size-12);
|
|
75
49
|
padding-bottom: var(--size-12);
|
|
76
|
-
box-shadow: inset 0 1px 0 0 rgb(226 230 232);
|
|
77
|
-
|
|
78
|
-
.np-theme-personal & {
|
|
79
|
-
border-top: 1px solid var(--color-border-neutral);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.np-theme-personal &,
|
|
83
|
-
&.modal--withoutborder {
|
|
84
|
-
box-shadow: none;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
&.tw-modal-no-title {
|
|
89
|
-
.tw-modal-body {
|
|
90
|
-
padding-top: 0 !important;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.tw-modal-header {
|
|
94
|
-
min-height: var(--size-32);
|
|
95
|
-
padding-bottom: 4px !important;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.np-theme-personal {
|
|
100
|
-
background-color: transparent;
|
|
101
50
|
}
|
|
102
51
|
}
|
|
103
|
-
|
|
104
|
-
table, .table {
|
|
105
|
-
background-color: transparent;
|
|
106
|
-
}
|
|
107
52
|
}
|
|
108
53
|
|
|
109
54
|
@media (--screen-sm) {
|
|
110
55
|
.tw-modal {
|
|
111
56
|
.tw-modal-content {
|
|
112
57
|
.tw-modal-header,
|
|
113
|
-
.tw-modal-footer
|
|
114
|
-
|
|
115
|
-
padding: var(--size-32) var(--size-24);
|
|
116
|
-
|
|
117
|
-
.np-theme-personal & {
|
|
118
|
-
padding: var(--size-24);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.tw-modal-compact {
|
|
124
|
-
.tw-modal-header {
|
|
125
|
-
min-height: calc(var(--size-8) * 7);
|
|
58
|
+
.tw-modal-footer {
|
|
59
|
+
padding: var(--size-24);
|
|
126
60
|
}
|
|
127
|
-
|
|
128
|
-
.tw-modal-header,
|
|
129
|
-
.tw-modal-footer,
|
|
130
61
|
.tw-modal-body {
|
|
131
|
-
padding
|
|
132
|
-
padding-bottom: var(--size-16);
|
|
62
|
+
padding: 0 var(--size-24);
|
|
133
63
|
}
|
|
134
64
|
}
|
|
135
65
|
}
|
package/src/modal/Modal.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
2
|
import { ReactNode, useContext, useId, useRef } from 'react';
|
|
3
3
|
import { CSSTransition } from 'react-transition-group';
|
|
4
|
+
import { useIntl } from 'react-intl';
|
|
4
5
|
|
|
5
6
|
import {
|
|
6
7
|
Size,
|
|
@@ -17,12 +18,14 @@ import {
|
|
|
17
18
|
ScrollViewport,
|
|
18
19
|
Typography,
|
|
19
20
|
} from '../common';
|
|
20
|
-
import { CloseButton } from '../common/closeButton';
|
|
21
21
|
import { useLayout } from '../common/hooks';
|
|
22
22
|
import Dimmer from '../dimmer';
|
|
23
23
|
import Drawer from '../drawer';
|
|
24
24
|
import { OverlayIdContext } from '../provider/overlay/OverlayIdProvider';
|
|
25
25
|
import Title from '../title/Title';
|
|
26
|
+
import { Cross } from '@transferwise/icons';
|
|
27
|
+
import IconButton from '../iconButton';
|
|
28
|
+
import closeBtnMessages from '../common/closeButton/CloseButton.messages';
|
|
26
29
|
|
|
27
30
|
const TRANSITION_DURATION_IN_MILLISECONDS = 150;
|
|
28
31
|
|
|
@@ -53,14 +56,9 @@ const Modal = ({
|
|
|
53
56
|
disableDimmerClickToClose = false,
|
|
54
57
|
...otherProps
|
|
55
58
|
}: ModalProps) => {
|
|
56
|
-
const
|
|
57
|
-
className?.split(' ').includes(classToCheck);
|
|
59
|
+
const intl = useIntl();
|
|
58
60
|
const { isMedium } = useLayout();
|
|
59
61
|
|
|
60
|
-
// These should be replaced with props in breaking change.
|
|
61
|
-
const isCompact = checkSpecialClasses('compact');
|
|
62
|
-
const noDivider = checkSpecialClasses('no-divider');
|
|
63
|
-
|
|
64
62
|
const contentReference = useRef<HTMLDivElement>(null);
|
|
65
63
|
const titleId = useId();
|
|
66
64
|
|
|
@@ -121,10 +119,6 @@ const Modal = ({
|
|
|
121
119
|
'd-flex',
|
|
122
120
|
'flex-column',
|
|
123
121
|
'justify-content-between',
|
|
124
|
-
{
|
|
125
|
-
'tw-modal-compact': isCompact,
|
|
126
|
-
'tw-modal-no-title': !title,
|
|
127
|
-
},
|
|
128
122
|
)}
|
|
129
123
|
>
|
|
130
124
|
<div
|
|
@@ -132,17 +126,23 @@ const Modal = ({
|
|
|
132
126
|
'tw-modal-header',
|
|
133
127
|
'd-flex',
|
|
134
128
|
'align-items-center',
|
|
135
|
-
'justify-content-between',
|
|
129
|
+
title ? 'justify-content-between' : 'justify-content-end',
|
|
136
130
|
'flex-wrap',
|
|
137
|
-
{
|
|
138
|
-
'modal--withoutborder': !title || noDivider,
|
|
139
|
-
},
|
|
140
131
|
)}
|
|
141
132
|
>
|
|
142
|
-
|
|
143
|
-
{title
|
|
144
|
-
|
|
145
|
-
|
|
133
|
+
{title && (
|
|
134
|
+
<Title id={titleId} type={Typography.TITLE_SUBSECTION} className="tw-modal-title">
|
|
135
|
+
{title}
|
|
136
|
+
</Title>
|
|
137
|
+
)}
|
|
138
|
+
<IconButton
|
|
139
|
+
size={40}
|
|
140
|
+
priority="tertiary"
|
|
141
|
+
aria-label={intl.formatMessage(closeBtnMessages.ariaLabel)}
|
|
142
|
+
onClick={onClose}
|
|
143
|
+
>
|
|
144
|
+
<Cross />
|
|
145
|
+
</IconButton>
|
|
146
146
|
</div>
|
|
147
147
|
<div
|
|
148
148
|
className={clsx('tw-modal-body', {
|
|
@@ -151,14 +151,14 @@ const Modal = ({
|
|
|
151
151
|
>
|
|
152
152
|
{body}
|
|
153
153
|
</div>
|
|
154
|
-
{footer
|
|
154
|
+
{footer ? (
|
|
155
155
|
<div
|
|
156
|
-
className={clsx('tw-modal-footer', 'd-flex', 'align-items-center', 'flex-wrap'
|
|
157
|
-
'modal--withoutborder': noDivider,
|
|
158
|
-
})}
|
|
156
|
+
className={clsx('tw-modal-footer', 'd-flex', 'align-items-center', 'flex-wrap')}
|
|
159
157
|
>
|
|
160
158
|
{footer}
|
|
161
159
|
</div>
|
|
160
|
+
) : (
|
|
161
|
+
<div className="m-t-3" />
|
|
162
162
|
)}
|
|
163
163
|
</div>
|
|
164
164
|
</div>
|
|
@@ -2,6 +2,10 @@ import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
|
2
2
|
import { ThemeProvider } from '@wise/components-theming';
|
|
3
3
|
|
|
4
4
|
import Button from '../../button';
|
|
5
|
+
import { lorem100 } from '../../test-utils';
|
|
6
|
+
import Display from '../../display';
|
|
7
|
+
import Logo from '../../logo';
|
|
8
|
+
import Body from '../../body';
|
|
5
9
|
|
|
6
10
|
export default {
|
|
7
11
|
component: ThemeProvider,
|
|
@@ -17,3 +21,22 @@ export const PlatformTheme: Story = {
|
|
|
17
21
|
</ThemeProvider>
|
|
18
22
|
),
|
|
19
23
|
};
|
|
24
|
+
|
|
25
|
+
export const BusinessLandingPage: Story = {
|
|
26
|
+
render: () => (
|
|
27
|
+
<ThemeProvider theme="business">
|
|
28
|
+
<Display type="display-large">Wise Business</Display>
|
|
29
|
+
<Body type="body-large-bold">
|
|
30
|
+
{lorem100}
|
|
31
|
+
</Body>
|
|
32
|
+
<ThemeProvider theme="business--forest-green">
|
|
33
|
+
<Body type="body-large">
|
|
34
|
+
{lorem100}
|
|
35
|
+
</Body>
|
|
36
|
+
</ThemeProvider>
|
|
37
|
+
<Body type="body-large">
|
|
38
|
+
{lorem100}
|
|
39
|
+
</Body>
|
|
40
|
+
</ThemeProvider>
|
|
41
|
+
),
|
|
42
|
+
};
|