@transferwise/components 46.114.1 → 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/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/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/drawer/Drawer.d.ts.map +1 -1
- package/build/types/modal/Modal.d.ts.map +1 -1
- package/package.json +1 -1
- 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/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/iconButton/IconButton.story.tsx +1 -0
- 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/main.css
CHANGED
|
@@ -2326,89 +2326,42 @@ button.np-option {
|
|
|
2326
2326
|
}
|
|
2327
2327
|
}
|
|
2328
2328
|
.np-drawer .np-drawer-header {
|
|
2329
|
-
display: flex;
|
|
2330
|
-
align-items: center;
|
|
2331
|
-
flex-wrap: nowrap;
|
|
2332
2329
|
min-height: 56px;
|
|
2333
2330
|
min-height: var(--size-56);
|
|
2334
|
-
padding: 24px 16px;
|
|
2335
|
-
padding: var(--size-24) var(--size-16);
|
|
2336
|
-
}
|
|
2337
|
-
.np-theme-personal .np-drawer .np-drawer-header {
|
|
2338
2331
|
padding: 24px;
|
|
2339
2332
|
padding: var(--size-24);
|
|
2340
2333
|
}
|
|
2341
2334
|
@media (max-width: 320px) {
|
|
2342
|
-
.np-
|
|
2335
|
+
.np-drawer .np-drawer-header {
|
|
2343
2336
|
padding: 16px;
|
|
2344
2337
|
padding: var(--size-16);
|
|
2345
2338
|
}
|
|
2346
2339
|
}
|
|
2347
|
-
.np-
|
|
2348
|
-
|
|
2349
|
-
margin-top: calc(var(--size-8) * -1);
|
|
2350
|
-
margin-right: calc(8px * -1);
|
|
2351
|
-
margin-right: calc(var(--size-8) * -1);
|
|
2352
|
-
margin-bottom: calc(8px * -1);
|
|
2353
|
-
margin-bottom: calc(var(--size-8) * -1);
|
|
2354
|
-
}
|
|
2355
|
-
.np-drawer .np-drawer-header.np-drawer-header--withborder {
|
|
2356
|
-
box-shadow: inset 0 -1px 0 0 #e2e6e8;
|
|
2357
|
-
}
|
|
2358
|
-
.np-theme-personal .np-drawer .np-drawer-header.np-drawer-header--withborder {
|
|
2359
|
-
box-shadow: inset 0 -1px 0 0 rgba(0,0,0,0.10196);
|
|
2360
|
-
box-shadow: inset 0 -1px 0 0 var(--color-border-neutral);
|
|
2361
|
-
}
|
|
2362
|
-
.np-drawer .np-drawer-header .np-text-title-body {
|
|
2363
|
-
margin-right: 16px;
|
|
2364
|
-
margin-right: var(--size-16);
|
|
2365
|
-
font-size: 1.125rem;
|
|
2366
|
-
font-size: var(--font-size-18);
|
|
2367
|
-
letter-spacing: -0.01em;
|
|
2368
|
-
letter-spacing: var(--letter-spacing-negative-xs);
|
|
2369
|
-
line-height: 1.5rem;
|
|
2370
|
-
line-height: var(--line-height-24);
|
|
2371
|
-
}
|
|
2372
|
-
.np-drawer .np-drawer-header .np-close-button {
|
|
2373
|
-
margin-left: auto;
|
|
2374
|
-
}
|
|
2375
|
-
.np-drawer .np-drawer-header .tw-icon {
|
|
2376
|
-
display: block;
|
|
2377
|
-
cursor: pointer;
|
|
2378
|
-
fill: #00b9ff;
|
|
2340
|
+
.np-drawer .np-drawer-title {
|
|
2341
|
+
max-width: 85%;
|
|
2379
2342
|
}
|
|
2380
2343
|
.np-drawer .np-drawer-content {
|
|
2381
2344
|
overflow-y: auto;
|
|
2382
2345
|
flex: 1;
|
|
2383
|
-
}
|
|
2384
|
-
.np-drawer .np-drawer-content .np-theme-personal {
|
|
2385
2346
|
background-color: transparent;
|
|
2386
2347
|
}
|
|
2387
|
-
.np-drawer .np-drawer-footer
|
|
2388
|
-
.np-drawer .np-drawer-content {
|
|
2348
|
+
.np-drawer .np-drawer-footer {
|
|
2389
2349
|
padding: 16px;
|
|
2390
2350
|
padding: var(--size-16);
|
|
2391
2351
|
}
|
|
2392
|
-
.np-drawer .np-drawer-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
.np-theme-personal .np-drawer .np-drawer-footer {
|
|
2396
|
-
box-shadow: inset 0 1px 0 0 rgba(0,0,0,0.10196);
|
|
2397
|
-
box-shadow: inset 0 1px 0 0 var(--color-border-neutral);
|
|
2352
|
+
.np-drawer .np-drawer-content {
|
|
2353
|
+
padding: 0 16px;
|
|
2354
|
+
padding: 0 var(--size-16);
|
|
2398
2355
|
}
|
|
2399
2356
|
@media (min-width: 768px) {
|
|
2400
|
-
.np-drawer .np-drawer-header
|
|
2401
|
-
|
|
2402
|
-
padding: var(--size-32) var(--size-24);
|
|
2403
|
-
}
|
|
2404
|
-
.np-theme-personal .np-drawer .np-drawer-header {
|
|
2357
|
+
.np-drawer .np-drawer-header,
|
|
2358
|
+
.np-drawer .np-drawer-footer {
|
|
2405
2359
|
padding: 24px;
|
|
2406
2360
|
padding: var(--size-24);
|
|
2407
2361
|
}
|
|
2408
|
-
.np-drawer .np-drawer-footer,
|
|
2409
2362
|
.np-drawer .np-drawer-content {
|
|
2410
|
-
padding: 24px;
|
|
2411
|
-
padding: var(--size-24);
|
|
2363
|
+
padding: 0 24px;
|
|
2364
|
+
padding: 0 var(--size-24);
|
|
2412
2365
|
}
|
|
2413
2366
|
}
|
|
2414
2367
|
.wds-Divider {
|
|
@@ -4231,14 +4184,9 @@ button.np-link {
|
|
|
4231
4184
|
.tw-modal .tw-modal-dialog {
|
|
4232
4185
|
transition: transform 0.3s ease-out;
|
|
4233
4186
|
transform: translateY(-25%);
|
|
4234
|
-
box-shadow:
|
|
4235
|
-
background: #ffffff;
|
|
4236
|
-
background: var(--color-background-elevated);
|
|
4237
|
-
}
|
|
4238
|
-
.np-theme-personal .tw-modal .tw-modal-dialog {
|
|
4187
|
+
box-shadow: none;
|
|
4239
4188
|
background: #ffffff;
|
|
4240
4189
|
background: var(--color-background-elevated);
|
|
4241
|
-
box-shadow: none;
|
|
4242
4190
|
border-radius: 24px;
|
|
4243
4191
|
border-radius: var(--radius-large);
|
|
4244
4192
|
}
|
|
@@ -4247,6 +4195,7 @@ button.np-link {
|
|
|
4247
4195
|
}
|
|
4248
4196
|
.tw-modal .tw-modal-content {
|
|
4249
4197
|
width: 100%;
|
|
4198
|
+
background-color: transparent;
|
|
4250
4199
|
}
|
|
4251
4200
|
.tw-modal .tw-modal-content .tw-modal-body {
|
|
4252
4201
|
flex: 1;
|
|
@@ -4255,26 +4204,6 @@ button.np-link {
|
|
|
4255
4204
|
.tw-modal .tw-modal-content .tw-modal-body--scrollable {
|
|
4256
4205
|
overflow-y: auto;
|
|
4257
4206
|
}
|
|
4258
|
-
.tw-modal .tw-modal-content .tw-modal-header {
|
|
4259
|
-
box-shadow: inset 0 -1px 0 0 #e2e6e8;
|
|
4260
|
-
}
|
|
4261
|
-
.np-theme-personal .tw-modal .tw-modal-content .tw-modal-header {
|
|
4262
|
-
box-shadow: inset 0 -1px 0 0 rgba(0,0,0,0.10196);
|
|
4263
|
-
box-shadow: inset 0 -1px 0 0 var(--color-border-neutral);
|
|
4264
|
-
}
|
|
4265
|
-
.np-theme-personal .tw-modal .tw-modal-content .tw-modal-header .np-close-button {
|
|
4266
|
-
margin: calc(8px * -1) calc(8px * -1) calc(8px * -1) 0;
|
|
4267
|
-
margin: calc(var(--size-8) * -1) calc(var(--size-8) * -1) calc(var(--size-8) * -1) 0;
|
|
4268
|
-
}
|
|
4269
|
-
.tw-modal .tw-modal-content .tw-modal-header.modal--withoutborder {
|
|
4270
|
-
box-shadow: none;
|
|
4271
|
-
}
|
|
4272
|
-
.tw-modal .tw-modal-content .tw-modal-header .tw-icon {
|
|
4273
|
-
fill: #0097c7;
|
|
4274
|
-
fill: var(--color-content-accent);
|
|
4275
|
-
cursor: pointer;
|
|
4276
|
-
display: block;
|
|
4277
|
-
}
|
|
4278
4207
|
.tw-modal .tw-modal-content .tw-modal-header,
|
|
4279
4208
|
.tw-modal .tw-modal-content .tw-modal-footer,
|
|
4280
4209
|
.tw-modal .tw-modal-content .tw-modal-body {
|
|
@@ -4289,55 +4218,16 @@ button.np-link {
|
|
|
4289
4218
|
padding-top: var(--size-12);
|
|
4290
4219
|
padding-bottom: 12px;
|
|
4291
4220
|
padding-bottom: var(--size-12);
|
|
4292
|
-
box-shadow: inset 0 1px 0 0 #e2e6e8;
|
|
4293
|
-
}
|
|
4294
|
-
.np-theme-personal .tw-modal .tw-modal-content .tw-modal-footer {
|
|
4295
|
-
border-top: 1px solid rgba(0,0,0,0.10196);
|
|
4296
|
-
border-top: 1px solid var(--color-border-neutral);
|
|
4297
|
-
}
|
|
4298
|
-
.np-theme-personal .tw-modal .tw-modal-content .tw-modal-footer,
|
|
4299
|
-
.tw-modal .tw-modal-content .tw-modal-footer.modal--withoutborder {
|
|
4300
|
-
box-shadow: none;
|
|
4301
|
-
}
|
|
4302
|
-
.tw-modal .tw-modal-content.tw-modal-no-title .tw-modal-body {
|
|
4303
|
-
padding-top: 0 !important;
|
|
4304
|
-
}
|
|
4305
|
-
.tw-modal .tw-modal-content.tw-modal-no-title .tw-modal-header {
|
|
4306
|
-
min-height: 32px;
|
|
4307
|
-
min-height: var(--size-32);
|
|
4308
|
-
padding-bottom: 4px !important;
|
|
4309
|
-
}
|
|
4310
|
-
.tw-modal .tw-modal-content .np-theme-personal {
|
|
4311
|
-
background-color: transparent;
|
|
4312
|
-
}
|
|
4313
|
-
.tw-modal table,
|
|
4314
|
-
.tw-modal .table {
|
|
4315
|
-
background-color: transparent;
|
|
4316
4221
|
}
|
|
4317
4222
|
@media (min-width: 576px) {
|
|
4318
4223
|
.tw-modal .tw-modal-content .tw-modal-header,
|
|
4319
|
-
.tw-modal .tw-modal-content .tw-modal-footer
|
|
4320
|
-
.tw-modal .tw-modal-content .tw-modal-body {
|
|
4321
|
-
padding: 32px 24px;
|
|
4322
|
-
padding: var(--size-32) var(--size-24);
|
|
4323
|
-
}
|
|
4324
|
-
.np-theme-personal .tw-modal .tw-modal-content .tw-modal-header,
|
|
4325
|
-
.np-theme-personal .tw-modal .tw-modal-content .tw-modal-footer,
|
|
4326
|
-
.np-theme-personal .tw-modal .tw-modal-content .tw-modal-body {
|
|
4224
|
+
.tw-modal .tw-modal-content .tw-modal-footer {
|
|
4327
4225
|
padding: 24px;
|
|
4328
4226
|
padding: var(--size-24);
|
|
4329
4227
|
}
|
|
4330
|
-
.tw-modal .tw-modal-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
}
|
|
4334
|
-
.tw-modal .tw-modal-compact .tw-modal-header,
|
|
4335
|
-
.tw-modal .tw-modal-compact .tw-modal-footer,
|
|
4336
|
-
.tw-modal .tw-modal-compact .tw-modal-body {
|
|
4337
|
-
padding-top: 16px;
|
|
4338
|
-
padding-top: var(--size-16);
|
|
4339
|
-
padding-bottom: 16px;
|
|
4340
|
-
padding-bottom: var(--size-16);
|
|
4228
|
+
.tw-modal .tw-modal-content .tw-modal-body {
|
|
4229
|
+
padding: 0 24px;
|
|
4230
|
+
padding: 0 var(--size-24);
|
|
4341
4231
|
}
|
|
4342
4232
|
}
|
|
4343
4233
|
@media (min-width: 480px) {
|
package/src/modal/Modal.css
CHANGED
|
@@ -6,14 +6,9 @@
|
|
|
6
6
|
.tw-modal .tw-modal-dialog {
|
|
7
7
|
transition: transform 0.3s ease-out;
|
|
8
8
|
transform: translateY(-25%);
|
|
9
|
-
box-shadow:
|
|
10
|
-
background: #ffffff;
|
|
11
|
-
background: var(--color-background-elevated);
|
|
12
|
-
}
|
|
13
|
-
.np-theme-personal .tw-modal .tw-modal-dialog {
|
|
9
|
+
box-shadow: none;
|
|
14
10
|
background: #ffffff;
|
|
15
11
|
background: var(--color-background-elevated);
|
|
16
|
-
box-shadow: none;
|
|
17
12
|
border-radius: 24px;
|
|
18
13
|
border-radius: var(--radius-large);
|
|
19
14
|
}
|
|
@@ -22,6 +17,7 @@
|
|
|
22
17
|
}
|
|
23
18
|
.tw-modal .tw-modal-content {
|
|
24
19
|
width: 100%;
|
|
20
|
+
background-color: transparent;
|
|
25
21
|
}
|
|
26
22
|
.tw-modal .tw-modal-content .tw-modal-body {
|
|
27
23
|
flex: 1;
|
|
@@ -30,26 +26,6 @@
|
|
|
30
26
|
.tw-modal .tw-modal-content .tw-modal-body--scrollable {
|
|
31
27
|
overflow-y: auto;
|
|
32
28
|
}
|
|
33
|
-
.tw-modal .tw-modal-content .tw-modal-header {
|
|
34
|
-
box-shadow: inset 0 -1px 0 0 #e2e6e8;
|
|
35
|
-
}
|
|
36
|
-
.np-theme-personal .tw-modal .tw-modal-content .tw-modal-header {
|
|
37
|
-
box-shadow: inset 0 -1px 0 0 rgba(0,0,0,0.10196);
|
|
38
|
-
box-shadow: inset 0 -1px 0 0 var(--color-border-neutral);
|
|
39
|
-
}
|
|
40
|
-
.np-theme-personal .tw-modal .tw-modal-content .tw-modal-header .np-close-button {
|
|
41
|
-
margin: calc(8px * -1) calc(8px * -1) calc(8px * -1) 0;
|
|
42
|
-
margin: calc(var(--size-8) * -1) calc(var(--size-8) * -1) calc(var(--size-8) * -1) 0;
|
|
43
|
-
}
|
|
44
|
-
.tw-modal .tw-modal-content .tw-modal-header.modal--withoutborder {
|
|
45
|
-
box-shadow: none;
|
|
46
|
-
}
|
|
47
|
-
.tw-modal .tw-modal-content .tw-modal-header .tw-icon {
|
|
48
|
-
fill: #0097c7;
|
|
49
|
-
fill: var(--color-content-accent);
|
|
50
|
-
cursor: pointer;
|
|
51
|
-
display: block;
|
|
52
|
-
}
|
|
53
29
|
.tw-modal .tw-modal-content .tw-modal-header,
|
|
54
30
|
.tw-modal .tw-modal-content .tw-modal-footer,
|
|
55
31
|
.tw-modal .tw-modal-content .tw-modal-body {
|
|
@@ -64,55 +40,16 @@
|
|
|
64
40
|
padding-top: var(--size-12);
|
|
65
41
|
padding-bottom: 12px;
|
|
66
42
|
padding-bottom: var(--size-12);
|
|
67
|
-
box-shadow: inset 0 1px 0 0 #e2e6e8;
|
|
68
|
-
}
|
|
69
|
-
.np-theme-personal .tw-modal .tw-modal-content .tw-modal-footer {
|
|
70
|
-
border-top: 1px solid rgba(0,0,0,0.10196);
|
|
71
|
-
border-top: 1px solid var(--color-border-neutral);
|
|
72
|
-
}
|
|
73
|
-
.np-theme-personal .tw-modal .tw-modal-content .tw-modal-footer,
|
|
74
|
-
.tw-modal .tw-modal-content .tw-modal-footer.modal--withoutborder {
|
|
75
|
-
box-shadow: none;
|
|
76
|
-
}
|
|
77
|
-
.tw-modal .tw-modal-content.tw-modal-no-title .tw-modal-body {
|
|
78
|
-
padding-top: 0 !important;
|
|
79
|
-
}
|
|
80
|
-
.tw-modal .tw-modal-content.tw-modal-no-title .tw-modal-header {
|
|
81
|
-
min-height: 32px;
|
|
82
|
-
min-height: var(--size-32);
|
|
83
|
-
padding-bottom: 4px !important;
|
|
84
|
-
}
|
|
85
|
-
.tw-modal .tw-modal-content .np-theme-personal {
|
|
86
|
-
background-color: transparent;
|
|
87
|
-
}
|
|
88
|
-
.tw-modal table,
|
|
89
|
-
.tw-modal .table {
|
|
90
|
-
background-color: transparent;
|
|
91
43
|
}
|
|
92
44
|
@media (min-width: 576px) {
|
|
93
45
|
.tw-modal .tw-modal-content .tw-modal-header,
|
|
94
|
-
.tw-modal .tw-modal-content .tw-modal-footer
|
|
95
|
-
.tw-modal .tw-modal-content .tw-modal-body {
|
|
96
|
-
padding: 32px 24px;
|
|
97
|
-
padding: var(--size-32) var(--size-24);
|
|
98
|
-
}
|
|
99
|
-
.np-theme-personal .tw-modal .tw-modal-content .tw-modal-header,
|
|
100
|
-
.np-theme-personal .tw-modal .tw-modal-content .tw-modal-footer,
|
|
101
|
-
.np-theme-personal .tw-modal .tw-modal-content .tw-modal-body {
|
|
46
|
+
.tw-modal .tw-modal-content .tw-modal-footer {
|
|
102
47
|
padding: 24px;
|
|
103
48
|
padding: var(--size-24);
|
|
104
49
|
}
|
|
105
|
-
.tw-modal .tw-modal-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
.tw-modal .tw-modal-compact .tw-modal-header,
|
|
110
|
-
.tw-modal .tw-modal-compact .tw-modal-footer,
|
|
111
|
-
.tw-modal .tw-modal-compact .tw-modal-body {
|
|
112
|
-
padding-top: 16px;
|
|
113
|
-
padding-top: var(--size-16);
|
|
114
|
-
padding-bottom: 16px;
|
|
115
|
-
padding-bottom: var(--size-16);
|
|
50
|
+
.tw-modal .tw-modal-content .tw-modal-body {
|
|
51
|
+
padding: 0 24px;
|
|
52
|
+
padding: 0 var(--size-24);
|
|
116
53
|
}
|
|
117
54
|
}
|
|
118
55
|
@media (min-width: 480px) {
|
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>
|