@transferwise/components 46.80.0 → 46.82.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/avatar/Avatar.js +3 -0
- package/build/avatar/Avatar.js.map +1 -1
- package/build/avatar/Avatar.mjs +3 -0
- package/build/avatar/Avatar.mjs.map +1 -1
- package/build/avatarView/AvatarView.js +175 -0
- package/build/avatarView/AvatarView.js.map +1 -0
- package/build/avatarView/AvatarView.mjs +173 -0
- package/build/avatarView/AvatarView.mjs.map +1 -0
- package/build/avatarView/NotificationDot.js +59 -0
- package/build/avatarView/NotificationDot.js.map +1 -0
- package/build/avatarView/NotificationDot.mjs +57 -0
- package/build/avatarView/NotificationDot.mjs.map +1 -0
- package/build/avatarWrapper/AvatarWrapper.js +10 -4
- package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
- package/build/avatarWrapper/AvatarWrapper.mjs +10 -4
- package/build/avatarWrapper/AvatarWrapper.mjs.map +1 -1
- package/build/badge/Badge.js +16 -4
- package/build/badge/Badge.js.map +1 -1
- package/build/badge/Badge.mjs +15 -3
- package/build/badge/Badge.mjs.map +1 -1
- package/build/badge/BadgeAssets.js +60 -0
- package/build/badge/BadgeAssets.js.map +1 -0
- package/build/badge/BadgeAssets.mjs +58 -0
- package/build/badge/BadgeAssets.mjs.map +1 -0
- package/build/common/circle/Circle.js +19 -1
- package/build/common/circle/Circle.js.map +1 -1
- package/build/common/circle/Circle.mjs +19 -1
- package/build/common/circle/Circle.mjs.map +1 -1
- package/build/i18n/en.json +5 -0
- package/build/i18n/en.json.js +5 -0
- package/build/i18n/en.json.js.map +1 -1
- package/build/i18n/en.json.mjs +5 -0
- package/build/i18n/en.json.mjs.map +1 -1
- package/build/i18n/zh-HK.json +5 -0
- package/build/i18n/zh-HK.json.js +5 -0
- package/build/i18n/zh-HK.json.js.map +1 -1
- package/build/i18n/zh-HK.json.mjs +5 -0
- package/build/i18n/zh-HK.json.mjs.map +1 -1
- package/build/index.js +18 -13
- package/build/index.js.map +1 -1
- package/build/index.mjs +10 -7
- package/build/index.mjs.map +1 -1
- package/build/main.css +348 -5
- package/build/money/Money.js +5 -2
- package/build/money/Money.js.map +1 -1
- package/build/money/Money.mjs +5 -2
- package/build/money/Money.mjs.map +1 -1
- package/build/styles/avatarView/AvatarView.css +36 -0
- package/build/styles/avatarView/NotificationDot.css +20 -0
- package/build/styles/badge/Badge.css +6 -5
- package/build/styles/common/circle/Circle.css +32 -0
- package/build/styles/main.css +348 -5
- package/build/styles/table/Table.css +274 -0
- package/build/types/avatar/Avatar.d.ts +3 -0
- package/build/types/avatar/Avatar.d.ts.map +1 -1
- package/build/types/avatarView/AvatarView.d.ts +26 -0
- package/build/types/avatarView/AvatarView.d.ts.map +1 -0
- package/build/types/avatarView/NotificationDot.d.ts +8 -0
- package/build/types/avatarView/NotificationDot.d.ts.map +1 -0
- package/build/types/avatarView/index.d.ts +3 -0
- package/build/types/avatarView/index.d.ts.map +1 -0
- package/build/types/avatarWrapper/AvatarWrapper.d.ts +3 -0
- package/build/types/avatarWrapper/AvatarWrapper.d.ts.map +1 -1
- package/build/types/badge/Badge.d.ts +9 -4
- package/build/types/badge/Badge.d.ts.map +1 -1
- package/build/types/badge/BadgeAssets.d.ts +14 -0
- package/build/types/badge/BadgeAssets.d.ts.map +1 -0
- package/build/types/badge/index.d.ts +2 -0
- package/build/types/badge/index.d.ts.map +1 -1
- package/build/types/common/circle/Circle.d.ts +2 -0
- package/build/types/common/circle/Circle.d.ts.map +1 -1
- package/build/types/index.d.ts +3 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/money/Money.d.ts +2 -1
- package/build/types/money/Money.d.ts.map +1 -1
- package/build/types/table/Table.d.ts +23 -0
- package/build/types/table/Table.d.ts.map +1 -0
- package/build/types/table/Table.messages.d.ts +24 -0
- package/build/types/table/Table.messages.d.ts.map +1 -0
- package/build/types/table/TableCell.d.ts +40 -0
- package/build/types/table/TableCell.d.ts.map +1 -0
- package/build/types/table/TableHeader.d.ts +13 -0
- package/build/types/table/TableHeader.d.ts.map +1 -0
- package/build/types/table/TableRow.d.ts +17 -0
- package/build/types/table/TableRow.d.ts.map +1 -0
- package/build/types/table/TableStatusText.d.ts +10 -0
- package/build/types/table/TableStatusText.d.ts.map +1 -0
- package/build/types/table/index.d.ts +6 -0
- package/build/types/table/index.d.ts.map +1 -0
- package/build/types/test-utils/index.d.ts +10 -0
- package/build/types/test-utils/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/avatar/Avatar.tsx +3 -0
- package/src/avatarView/AvatarView.css +36 -0
- package/src/avatarView/AvatarView.less +27 -0
- package/src/avatarView/AvatarView.story.tsx +467 -0
- package/src/avatarView/AvatarView.tsx +171 -0
- package/src/avatarView/NotificationDot.css +20 -0
- package/src/avatarView/NotificationDot.less +24 -0
- package/src/avatarView/NotificationDot.tsx +35 -0
- package/src/avatarView/index.ts +2 -0
- package/src/avatarWrapper/AvatarWrapper.story.tsx +19 -0
- package/src/avatarWrapper/AvatarWrapper.tsx +3 -0
- package/src/badge/Badge.css +6 -5
- package/src/badge/Badge.less +4 -3
- package/src/badge/Badge.tsx +20 -6
- package/src/badge/BadgeAssets.tsx +61 -0
- package/src/badge/index.ts +3 -0
- package/src/circularButton/CircularButton.spec.tsx +0 -36
- package/src/common/circle/Circle.css +32 -0
- package/src/common/circle/Circle.less +35 -0
- package/src/common/circle/Circle.tsx +24 -1
- package/src/flowNavigation/FlowNavigation.story.tsx +19 -52
- package/src/i18n/en.json +5 -0
- package/src/i18n/zh-HK.json +5 -0
- package/src/index.ts +3 -0
- package/src/listItem/ListItem.story.tsx +5 -47
- package/src/main.css +348 -5
- package/src/main.less +2 -0
- package/src/money/Money.tsx +9 -2
- package/src/overlayHeader/OverlayHeader.story.tsx +6 -14
- package/src/table/Table.css +274 -0
- package/src/table/Table.less +334 -0
- package/src/table/Table.messages.ts +24 -0
- package/src/table/Table.spec.tsx +82 -0
- package/src/table/Table.story.tsx +356 -0
- package/src/table/Table.tsx +167 -0
- package/src/table/TableCell.spec.tsx +298 -0
- package/src/table/TableCell.tsx +149 -0
- package/src/table/TableHeader.spec.tsx +50 -0
- package/src/table/TableHeader.tsx +74 -0
- package/src/table/TableRow.spec.tsx +112 -0
- package/src/table/TableRow.tsx +70 -0
- package/src/table/TableStatusText.spec.tsx +53 -0
- package/src/table/TableStatusText.tsx +40 -0
- package/src/table/index.ts +11 -0
- package/src/circularButton/__snapshots__/CircularButton.spec.tsx.snap +0 -381
package/src/money/Money.tsx
CHANGED
|
@@ -4,11 +4,18 @@ import { useIntl } from 'react-intl';
|
|
|
4
4
|
export interface MoneyProps {
|
|
5
5
|
amount: number;
|
|
6
6
|
currency: string;
|
|
7
|
+
alwaysShowDecimals?: boolean;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
|
-
const Money = ({ amount, currency }: MoneyProps) => {
|
|
10
|
+
const Money = ({ amount, currency, alwaysShowDecimals = false }: MoneyProps) => {
|
|
10
11
|
const { locale } = useIntl();
|
|
11
|
-
return
|
|
12
|
+
return (
|
|
13
|
+
<>
|
|
14
|
+
{formatMoney(amount, currency, locale, {
|
|
15
|
+
alwaysShowDecimals,
|
|
16
|
+
})}
|
|
17
|
+
</>
|
|
18
|
+
);
|
|
12
19
|
};
|
|
13
20
|
|
|
14
21
|
export default Money;
|
|
@@ -2,9 +2,8 @@ import { action } from '@storybook/addon-actions';
|
|
|
2
2
|
import { select, text } from '@storybook/addon-knobs';
|
|
3
3
|
import { Person as ProfileIcon, Briefcase as BriefcaseIcon } from '@transferwise/icons';
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { ProfileType, Size } from '../common';
|
|
5
|
+
import AvatarView from '../avatarView';
|
|
6
|
+
import { ProfileType } from '../common';
|
|
8
7
|
import Logo from '../logo';
|
|
9
8
|
|
|
10
9
|
import OverlayHeader from './OverlayHeader';
|
|
@@ -29,30 +28,23 @@ export const Basic = () => {
|
|
|
29
28
|
return (
|
|
30
29
|
<OverlayHeader
|
|
31
30
|
logo={<Logo />}
|
|
32
|
-
avatar={
|
|
33
|
-
<Avatar type={AvatarType.ICON} size={Size.MEDIUM}>
|
|
34
|
-
{avatarProfiles[showAvatar]}
|
|
35
|
-
</Avatar>
|
|
36
|
-
}
|
|
31
|
+
avatar={<AvatarView>{avatarProfiles[showAvatar]}</AvatarView>}
|
|
37
32
|
onClose={action('Close clicked')}
|
|
38
33
|
/>
|
|
39
34
|
);
|
|
40
35
|
};
|
|
41
36
|
|
|
42
37
|
export const WithAvatarWrapper = () => {
|
|
43
|
-
const avatarURL = text(
|
|
44
|
-
'avatarURL',
|
|
45
|
-
'https://wise.com/web-art/assets/illustrations/heart-small@2x.webp',
|
|
46
|
-
);
|
|
38
|
+
const avatarURL = text('avatarURL', '../tapestry-01.png');
|
|
47
39
|
const profileType = select(
|
|
48
40
|
'profileType',
|
|
49
|
-
|
|
41
|
+
[ProfileType.PERSONAL, ProfileType.BUSINESS],
|
|
50
42
|
undefined,
|
|
51
43
|
);
|
|
52
44
|
return (
|
|
53
45
|
<OverlayHeader
|
|
54
46
|
logo={<Logo />}
|
|
55
|
-
avatar={<
|
|
47
|
+
avatar={<AvatarView imgSrc={avatarURL} profileType={profileType} />}
|
|
56
48
|
onClose={action('Close clicked')}
|
|
57
49
|
/>
|
|
58
50
|
);
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
.np-table {
|
|
2
|
+
width: 100%;
|
|
3
|
+
background-color: transparent;
|
|
4
|
+
}
|
|
5
|
+
.np-table-outer-container {
|
|
6
|
+
border-radius: 16px;
|
|
7
|
+
border-radius: var(--radius-medium);
|
|
8
|
+
}
|
|
9
|
+
.np-table-outer-container:focus {
|
|
10
|
+
outline: none;
|
|
11
|
+
}
|
|
12
|
+
.np-table-outer-container:focus-visible {
|
|
13
|
+
outline: var(--ring-outline-color) solid var(--ring-outline-width);
|
|
14
|
+
outline-offset: var(--ring-outline-offset);
|
|
15
|
+
}
|
|
16
|
+
.np-table-outer-container:focus-visible {
|
|
17
|
+
outline-offset: 0;
|
|
18
|
+
}
|
|
19
|
+
.np-table-outer-container--center {
|
|
20
|
+
margin-right: auto;
|
|
21
|
+
margin-left: auto;
|
|
22
|
+
}
|
|
23
|
+
@media (max-width: 767px) {
|
|
24
|
+
.np-table-outer-container--center {
|
|
25
|
+
width: 100%;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
.np-table-outer-container--full-width {
|
|
29
|
+
width: 100%;
|
|
30
|
+
}
|
|
31
|
+
.np-table-container {
|
|
32
|
+
padding: 8px;
|
|
33
|
+
padding: var(--size-8);
|
|
34
|
+
background-color: rgba(134,167,189,0.10196);
|
|
35
|
+
background-color: var(--color-background-neutral);
|
|
36
|
+
border-radius: inherit;
|
|
37
|
+
}
|
|
38
|
+
.np-table-container--loading .np-table-inner-container {
|
|
39
|
+
background-image: none;
|
|
40
|
+
}
|
|
41
|
+
.np-table-inner-container {
|
|
42
|
+
background-image: linear-gradient(to right, var(--color-contrast-overlay), var(--color-contrast-overlay)), linear-gradient(to right, var(--color-contrast-overlay), var(--color-contrast-overlay)), linear-gradient(to right, rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0)), linear-gradient(to left, rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0));
|
|
43
|
+
background-position: left center, right center, left center, right center;
|
|
44
|
+
background-repeat: no-repeat;
|
|
45
|
+
background-color: var(--color-contrast-overlay);
|
|
46
|
+
background-size: 15px 100%, 15px 100%, 15px 100%, 15px 100%;
|
|
47
|
+
background-attachment: local, local, scroll, scroll;
|
|
48
|
+
overflow-x: auto;
|
|
49
|
+
border-radius: 10px;
|
|
50
|
+
}
|
|
51
|
+
.np-theme-personal--dark .np-table-inner-container {
|
|
52
|
+
background-image: linear-gradient(to right, var(--color-contrast-overlay), var(--color-contrast-overlay)), linear-gradient(to right, var(--color-contrast-overlay), var(--color-contrast-overlay)), linear-gradient(to right, #000000, rgba(0, 0, 0, 0)), linear-gradient(to left, #000000, rgba(0, 0, 0, 0));
|
|
53
|
+
}
|
|
54
|
+
.np-table-row:last-child .np-table-cell:first-child {
|
|
55
|
+
border-bottom-left-radius: 10px;
|
|
56
|
+
}
|
|
57
|
+
.np-table-row:last-child .np-table-cell:last-child {
|
|
58
|
+
border-bottom-right-radius: 10px;
|
|
59
|
+
}
|
|
60
|
+
.np-table-row:focus {
|
|
61
|
+
outline: none;
|
|
62
|
+
}
|
|
63
|
+
.np-table-row:focus-visible {
|
|
64
|
+
outline: var(--ring-outline-color) solid var(--ring-outline-width);
|
|
65
|
+
outline-offset: var(--ring-outline-offset);
|
|
66
|
+
}
|
|
67
|
+
.np-table-row:focus-visible {
|
|
68
|
+
outline-offset: -2px;
|
|
69
|
+
border-radius: 6px;
|
|
70
|
+
}
|
|
71
|
+
.np-table-row--clickable .np-table-cell {
|
|
72
|
+
position: relative;
|
|
73
|
+
}
|
|
74
|
+
.np-table-row--clickable .np-table-cell:before {
|
|
75
|
+
display: none;
|
|
76
|
+
content: "";
|
|
77
|
+
position: absolute;
|
|
78
|
+
height: 100%;
|
|
79
|
+
width: 100%;
|
|
80
|
+
top: 0;
|
|
81
|
+
left: 0;
|
|
82
|
+
background-color: var(--color-background-screen-hover);
|
|
83
|
+
}
|
|
84
|
+
.np-table-row--clickable .np-table-cell:first-child:before,
|
|
85
|
+
.np-table-row--clickable .np-table-cell:last-child:before {
|
|
86
|
+
width: calc(100% - 8px);
|
|
87
|
+
width: calc(100% - var(--size-8));
|
|
88
|
+
}
|
|
89
|
+
.np-table-row--clickable .np-table-cell:first-child:before {
|
|
90
|
+
left: 8px;
|
|
91
|
+
left: var(--size-8);
|
|
92
|
+
border-top-left-radius: 6px;
|
|
93
|
+
border-bottom-left-radius: 6px;
|
|
94
|
+
}
|
|
95
|
+
.np-table-row--clickable .np-table-cell:last-child:before {
|
|
96
|
+
border-top-right-radius: 6px;
|
|
97
|
+
border-bottom-right-radius: 6px;
|
|
98
|
+
}
|
|
99
|
+
.np-table-row--clickable:hover .np-table-cell:before {
|
|
100
|
+
display: block;
|
|
101
|
+
}
|
|
102
|
+
.np-table-row--clickable:hover:focus-visible .np-table-cell:first-child:before,
|
|
103
|
+
.np-table-row--clickable:hover:focus-visible .np-table-cell:last-child:before {
|
|
104
|
+
width: 100%;
|
|
105
|
+
}
|
|
106
|
+
.np-table-row--clickable:hover:focus-visible .np-table-cell:first-child:before {
|
|
107
|
+
left: 0;
|
|
108
|
+
}
|
|
109
|
+
.np-table-row--cosmetic .np-table-cell {
|
|
110
|
+
height: 8px;
|
|
111
|
+
height: var(--size-8);
|
|
112
|
+
padding: 0;
|
|
113
|
+
}
|
|
114
|
+
.np-table-header,
|
|
115
|
+
.np-table-cell {
|
|
116
|
+
padding: 0;
|
|
117
|
+
}
|
|
118
|
+
.np-table-header:first-child,
|
|
119
|
+
.np-table-cell:first-child {
|
|
120
|
+
padding-left: 16px;
|
|
121
|
+
padding-left: var(--size-16);
|
|
122
|
+
}
|
|
123
|
+
.np-table-header:first-child .np-table-header-content,
|
|
124
|
+
.np-table-cell:first-child .np-table-header-content,
|
|
125
|
+
.np-table-header:first-child .np-table-cell-content,
|
|
126
|
+
.np-table-cell:first-child .np-table-cell-content {
|
|
127
|
+
padding-left: 0;
|
|
128
|
+
}
|
|
129
|
+
.np-table-header:last-child,
|
|
130
|
+
.np-table-cell:last-child {
|
|
131
|
+
padding-right: 16px;
|
|
132
|
+
padding-right: var(--size-16);
|
|
133
|
+
}
|
|
134
|
+
.np-table-header:last-child .np-table-header-content,
|
|
135
|
+
.np-table-cell:last-child .np-table-header-content,
|
|
136
|
+
.np-table-header:last-child .np-table-cell-content,
|
|
137
|
+
.np-table-cell:last-child .np-table-cell-content {
|
|
138
|
+
padding-right: 0;
|
|
139
|
+
}
|
|
140
|
+
.np-table-header.np-table-header--right > .np-text-body-default,
|
|
141
|
+
.np-table-cell.np-table-cell--right > .np-text-body-default {
|
|
142
|
+
text-align: right;
|
|
143
|
+
}
|
|
144
|
+
.np-table-header.np-table-header--right + .np-table-header:not(.np-table-header--right),
|
|
145
|
+
.np-table-cell.np-table-cell--right + .np-table-cell:not(.np-table-cell--right) {
|
|
146
|
+
padding-left: calc(8px + 12px);
|
|
147
|
+
padding-left: calc(var(--size-8) + var(--size-12));
|
|
148
|
+
}
|
|
149
|
+
.np-table-header.np-table-header--right .np-table-header-content,
|
|
150
|
+
.np-table-cell.np-table-cell--right .np-table-content {
|
|
151
|
+
justify-content: end;
|
|
152
|
+
}
|
|
153
|
+
.np-table-header-content,
|
|
154
|
+
.np-table-content {
|
|
155
|
+
display: flex;
|
|
156
|
+
align-items: center;
|
|
157
|
+
justify-content: start;
|
|
158
|
+
}
|
|
159
|
+
.np-table-header {
|
|
160
|
+
min-width: 160px;
|
|
161
|
+
padding-right: 8px;
|
|
162
|
+
padding-right: var(--size-8);
|
|
163
|
+
padding-bottom: 8px;
|
|
164
|
+
padding-bottom: var(--size-8);
|
|
165
|
+
padding-left: 8px;
|
|
166
|
+
padding-left: var(--size-8);
|
|
167
|
+
background-color: rgba(134,167,189,0.10196);
|
|
168
|
+
background-color: var(--color-background-neutral);
|
|
169
|
+
color: var(--color-interactive-primary);
|
|
170
|
+
}
|
|
171
|
+
.np-table-header-content {
|
|
172
|
+
padding-top: 5px;
|
|
173
|
+
padding-bottom: 5px;
|
|
174
|
+
white-space: nowrap;
|
|
175
|
+
line-height: 1.375rem;
|
|
176
|
+
line-height: var(--line-height-22);
|
|
177
|
+
letter-spacing: 0.0125em;
|
|
178
|
+
letter-spacing: var(--letter-spacing-sm);
|
|
179
|
+
}
|
|
180
|
+
.np-table-header--error {
|
|
181
|
+
color: var(--color-sentiment-negative);
|
|
182
|
+
}
|
|
183
|
+
.np-table-header--action {
|
|
184
|
+
min-width: 0;
|
|
185
|
+
padding: 0;
|
|
186
|
+
}
|
|
187
|
+
.np-table-cell {
|
|
188
|
+
padding: 16px 8px;
|
|
189
|
+
padding: var(--size-16) var(--size-8);
|
|
190
|
+
position: relative;
|
|
191
|
+
}
|
|
192
|
+
.np-table-cell--cosmetic {
|
|
193
|
+
padding: 0;
|
|
194
|
+
}
|
|
195
|
+
.np-table-cell--primary {
|
|
196
|
+
min-width: 200px;
|
|
197
|
+
}
|
|
198
|
+
.np-table-cell--currency .np-text-body-default {
|
|
199
|
+
white-space: nowrap;
|
|
200
|
+
}
|
|
201
|
+
.np-table-cell .tw-chevron {
|
|
202
|
+
margin-left: 8px;
|
|
203
|
+
margin-left: var(--size-8);
|
|
204
|
+
}
|
|
205
|
+
.np-table-cell-separator {
|
|
206
|
+
margin-top: 4px;
|
|
207
|
+
margin-top: var(--size-4);
|
|
208
|
+
margin-bottom: 4px;
|
|
209
|
+
margin-bottom: var(--size-4);
|
|
210
|
+
height: 1px;
|
|
211
|
+
background-color: rgba(134,167,189,0.10196);
|
|
212
|
+
background-color: var(--color-background-neutral);
|
|
213
|
+
padding: 0;
|
|
214
|
+
}
|
|
215
|
+
.np-table-cell .np-text-body-default-bold {
|
|
216
|
+
display: flex;
|
|
217
|
+
align-items: center;
|
|
218
|
+
color: #37517e;
|
|
219
|
+
color: var(--color-content-primary);
|
|
220
|
+
white-space: nowrap;
|
|
221
|
+
}
|
|
222
|
+
.np-table-cell .np-table-content--success {
|
|
223
|
+
color: var(--color-sentiment-positive);
|
|
224
|
+
}
|
|
225
|
+
.np-table-cell .np-table-content--error {
|
|
226
|
+
color: var(--color-sentiment-negative);
|
|
227
|
+
}
|
|
228
|
+
.np-table-cell .tw-loader {
|
|
229
|
+
margin: 150px auto;
|
|
230
|
+
}
|
|
231
|
+
@media (max-width: 320px) {
|
|
232
|
+
.np-table-cell .tw-loader {
|
|
233
|
+
margin-top: 70px;
|
|
234
|
+
margin-bottom: 70px;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
.np-table-content {
|
|
238
|
+
gap: 12px;
|
|
239
|
+
gap: var(--size-12);
|
|
240
|
+
}
|
|
241
|
+
.np-table-content--success,
|
|
242
|
+
.np-table-content--error {
|
|
243
|
+
gap: 4px;
|
|
244
|
+
gap: var(--size-4);
|
|
245
|
+
}
|
|
246
|
+
.np-table-content--success .np-table-content-text,
|
|
247
|
+
.np-table-content--error .np-table-content-text {
|
|
248
|
+
line-height: 155%;
|
|
249
|
+
}
|
|
250
|
+
.np-table-content-media {
|
|
251
|
+
flex-shrink: 0;
|
|
252
|
+
}
|
|
253
|
+
.np-table-content-body {
|
|
254
|
+
display: flex;
|
|
255
|
+
flex-direction: column;
|
|
256
|
+
font-size: 0.75rem;
|
|
257
|
+
font-size: var(--font-size-12);
|
|
258
|
+
color: #768e9c;
|
|
259
|
+
color: var(--color-content-tertiary);
|
|
260
|
+
}
|
|
261
|
+
.np-table-content--reversed {
|
|
262
|
+
flex-direction: row-reverse;
|
|
263
|
+
}
|
|
264
|
+
.np-table-content--reversed .np-table-content-body {
|
|
265
|
+
align-items: end;
|
|
266
|
+
}
|
|
267
|
+
.np-table-empty-data {
|
|
268
|
+
display: flex;
|
|
269
|
+
align-items: center;
|
|
270
|
+
}
|
|
271
|
+
.np-table-empty-data .status-circle {
|
|
272
|
+
margin-right: 12px;
|
|
273
|
+
margin-right: var(--size-12);
|
|
274
|
+
}
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
@import (reference) "../../node_modules/@transferwise/neptune-css/src/less/ring.less";
|
|
2
|
+
|
|
3
|
+
.np-table {
|
|
4
|
+
@table-background-color: var(--color-background-neutral);
|
|
5
|
+
@table-border-width: var(--size-8);
|
|
6
|
+
@table-border-radius: var(--radius-small);
|
|
7
|
+
@table-border-radius: var(--radius-medium);
|
|
8
|
+
@table-inner-border-radius: 10px;
|
|
9
|
+
@table-cell-border-radius: 6px;
|
|
10
|
+
|
|
11
|
+
@table-spacing-sm: var(--size-4);
|
|
12
|
+
@table-spacing-md: var(--size-8);
|
|
13
|
+
@table-spacing-lg: var(--size-12);
|
|
14
|
+
@table-spacing-xl: var(--size-16);
|
|
15
|
+
|
|
16
|
+
@header-min-width: 160px;
|
|
17
|
+
@header-min-width-loading: calc(@header-min-width * 2);
|
|
18
|
+
|
|
19
|
+
width: 100%;
|
|
20
|
+
background-color: transparent;
|
|
21
|
+
|
|
22
|
+
&-outer-container {
|
|
23
|
+
border-radius: @table-border-radius;
|
|
24
|
+
|
|
25
|
+
.focus-ring();
|
|
26
|
+
&:focus-visible {
|
|
27
|
+
outline-offset: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&--center {
|
|
31
|
+
margin-right: auto;
|
|
32
|
+
margin-left: auto;
|
|
33
|
+
|
|
34
|
+
@media (--screen-sm-max) {
|
|
35
|
+
width: 100%;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&--full-width {
|
|
40
|
+
width: 100%;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&-container {
|
|
45
|
+
padding: @table-spacing-md;
|
|
46
|
+
background-color: @table-background-color;
|
|
47
|
+
border-radius: inherit;
|
|
48
|
+
|
|
49
|
+
&--loading {
|
|
50
|
+
.np-table-inner-container {
|
|
51
|
+
background-image: none;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&-inner-container {
|
|
57
|
+
background-image:
|
|
58
|
+
linear-gradient(to right, var(--color-contrast-overlay), var(--color-contrast-overlay)),
|
|
59
|
+
linear-gradient(to right, var(--color-contrast-overlay), var(--color-contrast-overlay)),
|
|
60
|
+
linear-gradient(to right, rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0)),
|
|
61
|
+
linear-gradient(to left, rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0));
|
|
62
|
+
background-position: left center, right center, left center, right center;
|
|
63
|
+
background-repeat: no-repeat;
|
|
64
|
+
background-color: var(--color-contrast-overlay);
|
|
65
|
+
background-size: 15px 100%, 15px 100%, 15px 100%, 15px 100%;
|
|
66
|
+
background-attachment: local, local, scroll, scroll;
|
|
67
|
+
overflow-x: auto;
|
|
68
|
+
border-radius: @table-inner-border-radius;
|
|
69
|
+
|
|
70
|
+
.np-theme-personal--dark & {
|
|
71
|
+
background-image:
|
|
72
|
+
linear-gradient(to right, var(--color-contrast-overlay), var(--color-contrast-overlay)),
|
|
73
|
+
linear-gradient(to right, var(--color-contrast-overlay), var(--color-contrast-overlay)),
|
|
74
|
+
linear-gradient(to right, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0)),
|
|
75
|
+
linear-gradient(to left, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&-row {
|
|
80
|
+
&:last-child {
|
|
81
|
+
.np-table-cell {
|
|
82
|
+
&:first-child {
|
|
83
|
+
border-bottom-left-radius: @table-inner-border-radius;
|
|
84
|
+
}
|
|
85
|
+
&:last-child {
|
|
86
|
+
border-bottom-right-radius: @table-inner-border-radius;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.focus-ring();
|
|
92
|
+
&:focus-visible {
|
|
93
|
+
outline-offset: -2px;
|
|
94
|
+
border-radius: @table-cell-border-radius;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&--clickable {
|
|
98
|
+
.np-table-cell {
|
|
99
|
+
position: relative;
|
|
100
|
+
&:before {
|
|
101
|
+
display: none;
|
|
102
|
+
content: "";
|
|
103
|
+
position: absolute;
|
|
104
|
+
height: 100%;
|
|
105
|
+
width: 100%;
|
|
106
|
+
top: 0;
|
|
107
|
+
left: 0;
|
|
108
|
+
background-color: var(--color-background-screen-hover);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&:first-child,
|
|
112
|
+
&:last-child {
|
|
113
|
+
&:before {
|
|
114
|
+
width: calc(100% - @table-spacing-md);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&:first-child {
|
|
119
|
+
&:before {
|
|
120
|
+
left: @table-spacing-md;
|
|
121
|
+
border-top-left-radius: @table-cell-border-radius;
|
|
122
|
+
border-bottom-left-radius: @table-cell-border-radius;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&:last-child {
|
|
127
|
+
&:before {
|
|
128
|
+
border-top-right-radius: @table-cell-border-radius;
|
|
129
|
+
border-bottom-right-radius: @table-cell-border-radius;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&:hover {
|
|
135
|
+
.np-table-cell:before {
|
|
136
|
+
display: block;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&:focus-visible {
|
|
140
|
+
.np-table-cell {
|
|
141
|
+
&:first-child,
|
|
142
|
+
&:last-child {
|
|
143
|
+
&:before {
|
|
144
|
+
width: 100%;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&:first-child {
|
|
149
|
+
&:before {
|
|
150
|
+
left: 0;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&--cosmetic {
|
|
159
|
+
.np-table-cell {
|
|
160
|
+
height: @table-spacing-md;
|
|
161
|
+
padding: 0;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&-header,
|
|
167
|
+
&-cell {
|
|
168
|
+
padding: 0;
|
|
169
|
+
|
|
170
|
+
&:first-child {
|
|
171
|
+
padding-left: @table-spacing-xl;
|
|
172
|
+
|
|
173
|
+
.np-table-header-content,
|
|
174
|
+
.np-table-cell-content {
|
|
175
|
+
padding-left: 0;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
&:last-child {
|
|
180
|
+
padding-right: @table-spacing-xl;
|
|
181
|
+
|
|
182
|
+
.np-table-header-content,
|
|
183
|
+
.np-table-cell-content {
|
|
184
|
+
padding-right: 0;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
&-header.np-table-header--right,
|
|
190
|
+
&-cell.np-table-cell--right {
|
|
191
|
+
> .np-text-body-default {
|
|
192
|
+
text-align: right;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
&-header.np-table-header--right + .np-table-header:not(.np-table-header--right),
|
|
197
|
+
&-cell.np-table-cell--right + .np-table-cell:not(.np-table-cell--right) {
|
|
198
|
+
padding-left: calc(@table-spacing-md + @table-spacing-lg);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
&-header.np-table-header--right .np-table-header-content,
|
|
202
|
+
&-cell.np-table-cell--right .np-table-content {
|
|
203
|
+
justify-content: end;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
&-header-content,
|
|
207
|
+
&-content {
|
|
208
|
+
display: flex;
|
|
209
|
+
align-items: center;
|
|
210
|
+
justify-content: start;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
&-header {
|
|
214
|
+
min-width: @header-min-width;
|
|
215
|
+
padding-right: @table-spacing-md;
|
|
216
|
+
padding-bottom: @table-spacing-md;
|
|
217
|
+
padding-left: @table-spacing-md;
|
|
218
|
+
background-color: var(--color-background-neutral);
|
|
219
|
+
color: var(--color-interactive-primary);
|
|
220
|
+
|
|
221
|
+
&-content {
|
|
222
|
+
padding-top: 5px;
|
|
223
|
+
padding-bottom: 5px;
|
|
224
|
+
white-space: nowrap;
|
|
225
|
+
line-height: var(--line-height-22);
|
|
226
|
+
letter-spacing: var(--letter-spacing-sm);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
&--error {
|
|
230
|
+
color: var(--color-sentiment-negative);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
&--action {
|
|
234
|
+
min-width: 0;
|
|
235
|
+
padding: 0;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
&-cell {
|
|
240
|
+
padding: @table-spacing-xl @table-spacing-md;
|
|
241
|
+
position: relative;
|
|
242
|
+
|
|
243
|
+
&--cosmetic {
|
|
244
|
+
padding: 0;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
&--primary {
|
|
248
|
+
min-width: 200px;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
&--currency {
|
|
252
|
+
.np-text-body-default {
|
|
253
|
+
white-space: nowrap;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.tw-chevron {
|
|
258
|
+
margin-left: @table-spacing-md;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
&-separator {
|
|
262
|
+
margin-top: @table-spacing-sm;
|
|
263
|
+
margin-bottom: @table-spacing-sm;
|
|
264
|
+
height: 1px;
|
|
265
|
+
background-color: @table-background-color;
|
|
266
|
+
padding: 0;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.np-text-body-default-bold {
|
|
270
|
+
display: flex;
|
|
271
|
+
align-items: center;
|
|
272
|
+
color: var(--color-content-primary);
|
|
273
|
+
white-space: nowrap;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.np-table-content--success {
|
|
277
|
+
color: var(--color-sentiment-positive);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.np-table-content--error {
|
|
281
|
+
color: var(--color-sentiment-negative);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.tw-loader {
|
|
285
|
+
// The loading area of the table should equals to 5 rows of the table for huge screens and 3 rows for small screens
|
|
286
|
+
margin: 150px auto;
|
|
287
|
+
@media (--screen-400-zoom) {
|
|
288
|
+
margin-top: 70px;
|
|
289
|
+
margin-bottom: 70px;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
&-content {
|
|
295
|
+
gap: @table-spacing-lg;
|
|
296
|
+
|
|
297
|
+
&--success,
|
|
298
|
+
&--error {
|
|
299
|
+
gap: @table-spacing-sm;
|
|
300
|
+
|
|
301
|
+
.np-table-content-text {
|
|
302
|
+
line-height: 155%;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
&-media {
|
|
307
|
+
flex-shrink: 0;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
&-body {
|
|
311
|
+
display: flex;
|
|
312
|
+
flex-direction: column;
|
|
313
|
+
font-size: var(--font-size-12);
|
|
314
|
+
color: var(--color-content-tertiary);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
&--reversed {
|
|
318
|
+
flex-direction: row-reverse;
|
|
319
|
+
|
|
320
|
+
.np-table-content-body {
|
|
321
|
+
align-items: end;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
&-empty-data {
|
|
327
|
+
display: flex;
|
|
328
|
+
align-items: center;
|
|
329
|
+
|
|
330
|
+
.status-circle {
|
|
331
|
+
margin-right: @table-spacing-lg;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl';
|
|
2
|
+
|
|
3
|
+
export default defineMessages({
|
|
4
|
+
loading: {
|
|
5
|
+
id: 'neptune.Table.loading',
|
|
6
|
+
defaultMessage: 'Table data is loading',
|
|
7
|
+
},
|
|
8
|
+
loaded: {
|
|
9
|
+
id: 'neptune.Table.loaded',
|
|
10
|
+
defaultMessage: 'Table data has loaded',
|
|
11
|
+
},
|
|
12
|
+
emptyData: {
|
|
13
|
+
id: 'neptune.Table.emptyData',
|
|
14
|
+
defaultMessage: 'No results found',
|
|
15
|
+
},
|
|
16
|
+
refreshPage: {
|
|
17
|
+
id: 'neptune.Table.refreshPage',
|
|
18
|
+
defaultMessage: 'Refresh page',
|
|
19
|
+
},
|
|
20
|
+
actionHeader: {
|
|
21
|
+
id: 'neptune.Table.actionHeader',
|
|
22
|
+
defaultMessage: 'Action',
|
|
23
|
+
},
|
|
24
|
+
});
|