@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.
Files changed (51) hide show
  1. package/build/common/closeButton/CloseButton.messages.js +2 -2
  2. package/build/common/closeButton/CloseButton.messages.js.map +1 -1
  3. package/build/common/closeButton/CloseButton.messages.mjs +2 -2
  4. package/build/common/closeButton/CloseButton.messages.mjs.map +1 -1
  5. package/build/common/closeButton/CloseButton.mjs +2 -2
  6. package/build/common/closeButton/CloseButton.mjs.map +1 -1
  7. package/build/common/hooks/useVirtualKeyboard.js +4 -3
  8. package/build/common/hooks/useVirtualKeyboard.js.map +1 -1
  9. package/build/common/hooks/useVirtualKeyboard.mjs +4 -3
  10. package/build/common/hooks/useVirtualKeyboard.mjs.map +1 -1
  11. package/build/drawer/Drawer.js +18 -9
  12. package/build/drawer/Drawer.js.map +1 -1
  13. package/build/drawer/Drawer.mjs +18 -9
  14. package/build/drawer/Drawer.mjs.map +1 -1
  15. package/build/i18n/nl.json +1 -1
  16. package/build/i18n/nl.json.js +1 -1
  17. package/build/i18n/nl.json.mjs +1 -1
  18. package/build/inputs/_BottomSheet.js +1 -1
  19. package/build/inputs/_BottomSheet.js.map +1 -1
  20. package/build/inputs/_BottomSheet.mjs +1 -1
  21. package/build/inputs/_BottomSheet.mjs.map +1 -1
  22. package/build/main.css +17 -127
  23. package/build/modal/Modal.js +20 -21
  24. package/build/modal/Modal.js.map +1 -1
  25. package/build/modal/Modal.mjs +20 -21
  26. package/build/modal/Modal.mjs.map +1 -1
  27. package/build/styles/drawer/Drawer.css +11 -58
  28. package/build/styles/main.css +17 -127
  29. package/build/styles/modal/Modal.css +6 -69
  30. package/build/types/common/hooks/useVirtualKeyboard.d.ts +2 -1
  31. package/build/types/common/hooks/useVirtualKeyboard.d.ts.map +1 -1
  32. package/build/types/drawer/Drawer.d.ts.map +1 -1
  33. package/build/types/modal/Modal.d.ts.map +1 -1
  34. package/package.json +2 -2
  35. package/src/accordion/Accordion.story.tsx +1 -1
  36. package/src/avatarLayout/AvatarLayout.story.tsx +1 -0
  37. package/src/avatarView/AvatarView.story.tsx +1 -0
  38. package/src/common/hooks/useVirtualKeyboard.ts +4 -3
  39. package/src/display/Display.story.tsx +1 -0
  40. package/src/drawer/Drawer.css +11 -58
  41. package/src/drawer/Drawer.less +14 -70
  42. package/src/drawer/Drawer.story.tsx +158 -100
  43. package/src/drawer/Drawer.tsx +26 -7
  44. package/src/i18n/nl.json +1 -1
  45. package/src/iconButton/IconButton.story.tsx +1 -0
  46. package/src/inputs/_BottomSheet.tsx +1 -1
  47. package/src/main.css +17 -127
  48. package/src/modal/Modal.css +6 -69
  49. package/src/modal/Modal.less +6 -76
  50. package/src/modal/Modal.tsx +23 -23
  51. package/src/provider/theme/ThemeProvider.story.tsx +23 -0
@@ -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: 0 5px 15px rgba(0, 0, 0, 0.2);
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
- .tw-modal-body {
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-top: var(--size-16);
132
- padding-bottom: var(--size-16);
62
+ padding: 0 var(--size-24);
133
63
  }
134
64
  }
135
65
  }
@@ -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 checkSpecialClasses = (classToCheck: string) =>
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
- <Title id={titleId} type={Typography.TITLE_BODY} className="tw-modal-title">
143
- {title}
144
- </Title>
145
- <CloseButton onClick={onClose} />
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
+ };