@transferwise/components 0.0.0-experimental-68d1b00 → 0.0.0-experimental-40e4505
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/i18n/en.json +0 -2
- package/build/i18n/en.json.js +0 -2
- package/build/i18n/en.json.js.map +1 -1
- package/build/i18n/en.json.mjs +0 -2
- package/build/i18n/en.json.mjs.map +1 -1
- package/build/main.css +0 -215
- package/build/styles/main.css +0 -215
- package/build/types/uploadInput/UploadInput.d.ts +9 -0
- package/build/types/uploadInput/UploadInput.d.ts.map +1 -1
- package/build/types/uploadInput/uploadItem/UploadItem.d.ts +3 -1
- package/build/types/uploadInput/uploadItem/UploadItem.d.ts.map +1 -1
- package/build/types/uploadInput/uploadItem/UploadItemLink.d.ts.map +1 -1
- package/build/uploadInput/UploadInput.js +57 -51
- package/build/uploadInput/UploadInput.js.map +1 -1
- package/build/uploadInput/UploadInput.mjs +57 -51
- package/build/uploadInput/UploadInput.mjs.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.js +8 -3
- package/build/uploadInput/uploadItem/UploadItem.js.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.mjs +8 -3
- package/build/uploadInput/uploadItem/UploadItem.mjs.map +1 -1
- package/build/uploadInput/uploadItem/UploadItemLink.js +1 -0
- package/build/uploadInput/uploadItem/UploadItemLink.js.map +1 -1
- package/build/uploadInput/uploadItem/UploadItemLink.mjs +1 -0
- package/build/uploadInput/uploadItem/UploadItemLink.mjs.map +1 -1
- package/package.json +3 -3
- package/src/i18n/en.json +0 -2
- package/src/main.css +0 -215
- package/src/main.less +0 -1
- package/src/uploadInput/UploadInput.spec.tsx +150 -6
- package/src/uploadInput/UploadInput.tsx +83 -60
- package/src/uploadInput/uploadItem/UploadItem.tsx +12 -6
- package/src/uploadInput/uploadItem/UploadItemLink.tsx +9 -1
- package/build/styles/table/Table.css +0 -215
- package/build/types/table/Table.d.ts +0 -23
- package/build/types/table/Table.d.ts.map +0 -1
- package/build/types/table/Table.messages.d.ts +0 -12
- package/build/types/table/Table.messages.d.ts.map +0 -1
- package/build/types/table/TableCell.d.ts +0 -37
- package/build/types/table/TableCell.d.ts.map +0 -1
- package/build/types/table/TableHeader.d.ts +0 -12
- package/build/types/table/TableHeader.d.ts.map +0 -1
- package/build/types/table/TableRow.d.ts +0 -17
- package/build/types/table/TableRow.d.ts.map +0 -1
- package/build/types/table/TableStatusText.d.ts +0 -9
- package/build/types/table/TableStatusText.d.ts.map +0 -1
- package/build/types/table/index.d.ts +0 -6
- package/build/types/table/index.d.ts.map +0 -1
- package/src/table/Table.css +0 -215
- package/src/table/Table.less +0 -261
- package/src/table/Table.messages.ts +0 -12
- package/src/table/Table.spec.tsx +0 -87
- package/src/table/Table.story.tsx +0 -352
- package/src/table/Table.tsx +0 -121
- package/src/table/TableCell.spec.tsx +0 -298
- package/src/table/TableCell.tsx +0 -153
- package/src/table/TableHeader.spec.tsx +0 -58
- package/src/table/TableHeader.tsx +0 -50
- package/src/table/TableRow.spec.tsx +0 -104
- package/src/table/TableRow.tsx +0 -62
- package/src/table/TableStatusText.spec.tsx +0 -53
- package/src/table/TableStatusText.tsx +0 -35
- package/src/table/index.ts +0 -11
|
@@ -4,9 +4,8 @@ import { forwardRef, useImperativeHandle, useRef } from 'react';
|
|
|
4
4
|
import { useIntl } from 'react-intl';
|
|
5
5
|
|
|
6
6
|
import Body from '../../body';
|
|
7
|
-
import { Size, Status, Typography
|
|
7
|
+
import { Size, Status, Typography } from '../../common';
|
|
8
8
|
import ProcessIndicator from '../../processIndicator/ProcessIndicator';
|
|
9
|
-
import StatusIcon from '../../statusIcon/StatusIcon';
|
|
10
9
|
import { UploadedFile, UploadError } from '../types';
|
|
11
10
|
|
|
12
11
|
import MESSAGES from './UploadItem.messages';
|
|
@@ -38,6 +37,8 @@ interface UploadItemRef {
|
|
|
38
37
|
export enum TEST_IDS {
|
|
39
38
|
uploadItem = 'uploadItem',
|
|
40
39
|
mediaBody = 'mediaBody',
|
|
40
|
+
link = 'link',
|
|
41
|
+
action = 'action',
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
const UploadItem = forwardRef<UploadItemRef, UploadItemProps>(
|
|
@@ -46,6 +47,7 @@ const UploadItem = forwardRef<UploadItemRef, UploadItemProps>(
|
|
|
46
47
|
const { status, filename, error, errors, url } = file;
|
|
47
48
|
const linkRef = useRef<HTMLAnchorElement>(null);
|
|
48
49
|
const buttonRef = useRef<HTMLButtonElement>(null);
|
|
50
|
+
const isSucceeded = [Status.SUCCEEDED, undefined].includes(status) && !!url;
|
|
49
51
|
|
|
50
52
|
useImperativeHandle<UploadItemRef, UploadItemRef>(ref, () => ({
|
|
51
53
|
focus: (): void => {
|
|
@@ -57,8 +59,6 @@ const UploadItem = forwardRef<UploadItemRef, UploadItemProps>(
|
|
|
57
59
|
},
|
|
58
60
|
}));
|
|
59
61
|
|
|
60
|
-
const isSucceeded = [Status.SUCCEEDED, undefined].includes(status) && !!url;
|
|
61
|
-
|
|
62
62
|
/**
|
|
63
63
|
* We're temporarily reverting to the regular icon components,
|
|
64
64
|
* until the StatusIcon receives 24px sizing. Some misalignment
|
|
@@ -152,16 +152,20 @@ const UploadItem = forwardRef<UploadItemRef, UploadItemProps>(
|
|
|
152
152
|
return (
|
|
153
153
|
<div
|
|
154
154
|
className={clsx('np-upload-input__item', { 'is-interactive': isSucceeded && url })}
|
|
155
|
-
data-testid={TEST_IDS.uploadItem}
|
|
155
|
+
data-testid={`${file.id}-${TEST_IDS.uploadItem}`}
|
|
156
156
|
>
|
|
157
157
|
<UploadItemLink
|
|
158
158
|
ref={linkRef}
|
|
159
159
|
url={isSucceeded ? url : undefined}
|
|
160
160
|
singleFileUpload={singleFileUpload}
|
|
161
|
+
data-testid={`${file.id}-${TEST_IDS.link}`}
|
|
161
162
|
onDownload={onDownloadFile}
|
|
162
163
|
>
|
|
163
164
|
<span className="np-upload-input__icon">{getIcon()}</span>
|
|
164
|
-
<div
|
|
165
|
+
<div
|
|
166
|
+
className="np-upload-input__item-content"
|
|
167
|
+
data-testid={`${file.id}-${TEST_IDS.mediaBody}`}
|
|
168
|
+
>
|
|
165
169
|
<Body type={Typography.BODY_LARGE} className="np-upload-input__title text-word-break">
|
|
166
170
|
{getTitle()}
|
|
167
171
|
</Body>
|
|
@@ -175,6 +179,8 @@ const UploadItem = forwardRef<UploadItemRef, UploadItemProps>(
|
|
|
175
179
|
aria-label={formatMessage(MESSAGES.removeFile, { filename })}
|
|
176
180
|
className="np-upload-input__item-button"
|
|
177
181
|
type="button"
|
|
182
|
+
tabIndex={0}
|
|
183
|
+
data-testid={`${file.id}-${TEST_IDS.action}`}
|
|
178
184
|
onClick={() => onDelete()}
|
|
179
185
|
>
|
|
180
186
|
<Bin size={16} />
|
|
@@ -10,7 +10,14 @@ type UploadItemLinkProps = PropsWithChildren<{
|
|
|
10
10
|
export const UploadItemLink = forwardRef<HTMLAnchorElement | HTMLDivElement, UploadItemLinkProps>(
|
|
11
11
|
({ children, url, onDownload, singleFileUpload }, ref) => {
|
|
12
12
|
if (!url) {
|
|
13
|
-
return
|
|
13
|
+
return (
|
|
14
|
+
<div
|
|
15
|
+
ref={ref as React.RefObject<HTMLDivElement>}
|
|
16
|
+
className={clsx('np-upload-input__item-container')}
|
|
17
|
+
>
|
|
18
|
+
{children}
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
14
21
|
}
|
|
15
22
|
|
|
16
23
|
return (
|
|
@@ -23,6 +30,7 @@ export const UploadItemLink = forwardRef<HTMLAnchorElement | HTMLDivElement, Upl
|
|
|
23
30
|
'np-upload-input__item-link',
|
|
24
31
|
singleFileUpload ? 'np-upload-input__item-link--single-file' : '',
|
|
25
32
|
)}
|
|
33
|
+
tabIndex={0}
|
|
26
34
|
onClick={onDownload}
|
|
27
35
|
>
|
|
28
36
|
{children}
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
.np-table {
|
|
2
|
-
width: 100%;
|
|
3
|
-
background-color: transparent;
|
|
4
|
-
}
|
|
5
|
-
.np-table-container {
|
|
6
|
-
padding: 8px;
|
|
7
|
-
padding: var(--size-8);
|
|
8
|
-
background-color: rgba(134,167,189,0.10196);
|
|
9
|
-
background-color: var(--color-background-neutral);
|
|
10
|
-
border-radius: 16px;
|
|
11
|
-
border-radius: var(--radius-medium);
|
|
12
|
-
}
|
|
13
|
-
.np-table-container--loading .np-table-header {
|
|
14
|
-
min-width: calc(160px * 2);
|
|
15
|
-
}
|
|
16
|
-
.np-table-container--center {
|
|
17
|
-
margin-right: auto;
|
|
18
|
-
margin-left: auto;
|
|
19
|
-
}
|
|
20
|
-
.np-table-container--full-width {
|
|
21
|
-
width: 100%;
|
|
22
|
-
}
|
|
23
|
-
.np-table-inner-container {
|
|
24
|
-
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));
|
|
25
|
-
background-position: left center, right center, left center, right center;
|
|
26
|
-
background-repeat: no-repeat;
|
|
27
|
-
background-color: var(--color-contrast-overlay);
|
|
28
|
-
background-size: 15px 100%, 15px 100%, 15px 100%, 15px 100%;
|
|
29
|
-
background-attachment: local, local, scroll, scroll;
|
|
30
|
-
overflow-x: auto;
|
|
31
|
-
border-radius: 10px;
|
|
32
|
-
}
|
|
33
|
-
.np-theme-personal--dark .np-table-inner-container {
|
|
34
|
-
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));
|
|
35
|
-
}
|
|
36
|
-
.np-table-row:last-child .np-table-cell:first-child {
|
|
37
|
-
border-bottom-left-radius: 10px;
|
|
38
|
-
}
|
|
39
|
-
.np-table-row:last-child .np-table-cell:last-child {
|
|
40
|
-
border-bottom-right-radius: 10px;
|
|
41
|
-
}
|
|
42
|
-
.np-table-row--clickable:hover .np-table-cell {
|
|
43
|
-
background-color: var(--color-background-screen-hover);
|
|
44
|
-
cursor: pointer;
|
|
45
|
-
}
|
|
46
|
-
.np-table-row--separator .np-table-cell {
|
|
47
|
-
padding: 0;
|
|
48
|
-
}
|
|
49
|
-
.np-table-header,
|
|
50
|
-
.np-table-cell {
|
|
51
|
-
padding: 0;
|
|
52
|
-
}
|
|
53
|
-
.np-table-header:first-child,
|
|
54
|
-
.np-table-cell:first-child {
|
|
55
|
-
padding-left: 16px;
|
|
56
|
-
padding-left: var(--size-16);
|
|
57
|
-
}
|
|
58
|
-
.np-table-header:first-child .np-table-header-content,
|
|
59
|
-
.np-table-cell:first-child .np-table-header-content,
|
|
60
|
-
.np-table-header:first-child .np-table-cell-content,
|
|
61
|
-
.np-table-cell:first-child .np-table-cell-content {
|
|
62
|
-
padding-left: 0;
|
|
63
|
-
}
|
|
64
|
-
.np-table-header:last-child,
|
|
65
|
-
.np-table-cell:last-child {
|
|
66
|
-
padding-right: 16px;
|
|
67
|
-
padding-right: var(--size-16);
|
|
68
|
-
}
|
|
69
|
-
.np-table-header:last-child .np-table-header-content,
|
|
70
|
-
.np-table-cell:last-child .np-table-header-content,
|
|
71
|
-
.np-table-header:last-child .np-table-cell-content,
|
|
72
|
-
.np-table-cell:last-child .np-table-cell-content {
|
|
73
|
-
padding-right: 0;
|
|
74
|
-
}
|
|
75
|
-
.np-table-header .np-text-body-large-bold,
|
|
76
|
-
.np-table-cell .np-text-body-large-bold {
|
|
77
|
-
font-size: 0.875rem;
|
|
78
|
-
font-size: var(--font-size-14);
|
|
79
|
-
}
|
|
80
|
-
.np-table-header.np-table-header--right,
|
|
81
|
-
.np-table-cell.np-table-cell--right {
|
|
82
|
-
padding-right: calc(8px + 12px);
|
|
83
|
-
padding-right: calc(var(--size-8) + var(--size-12));
|
|
84
|
-
}
|
|
85
|
-
.np-table-header.np-table-header--right > .np-text-body-default,
|
|
86
|
-
.np-table-cell.np-table-cell--right > .np-text-body-default {
|
|
87
|
-
text-align: right;
|
|
88
|
-
}
|
|
89
|
-
.np-table-header.np-table-header--right .np-table-header-content,
|
|
90
|
-
.np-table-cell.np-table-cell--right .np-table-content {
|
|
91
|
-
justify-content: end;
|
|
92
|
-
}
|
|
93
|
-
.np-table-header-content,
|
|
94
|
-
.np-table-content {
|
|
95
|
-
display: flex;
|
|
96
|
-
align-items: center;
|
|
97
|
-
justify-content: start;
|
|
98
|
-
}
|
|
99
|
-
.np-table-header {
|
|
100
|
-
min-width: 160px;
|
|
101
|
-
padding-right: 8px;
|
|
102
|
-
padding-right: var(--size-8);
|
|
103
|
-
padding-bottom: 8px;
|
|
104
|
-
padding-bottom: var(--size-8);
|
|
105
|
-
padding-left: 8px;
|
|
106
|
-
padding-left: var(--size-8);
|
|
107
|
-
background-color: rgba(134,167,189,0.10196);
|
|
108
|
-
background-color: var(--color-background-neutral);
|
|
109
|
-
color: #37517e;
|
|
110
|
-
color: var(--color-content-primary);
|
|
111
|
-
}
|
|
112
|
-
.np-table-header-content {
|
|
113
|
-
padding-top: 5px;
|
|
114
|
-
padding-bottom: 5px;
|
|
115
|
-
white-space: nowrap;
|
|
116
|
-
}
|
|
117
|
-
.np-table-header--has-error {
|
|
118
|
-
color: var(--color-sentiment-negative);
|
|
119
|
-
}
|
|
120
|
-
.np-table-cell {
|
|
121
|
-
padding: 16px 8px;
|
|
122
|
-
padding: var(--size-16) var(--size-8);
|
|
123
|
-
}
|
|
124
|
-
.np-table-cell--primary {
|
|
125
|
-
min-width: 200px;
|
|
126
|
-
}
|
|
127
|
-
.np-table-cell--currency .np-text-body-default {
|
|
128
|
-
white-space: nowrap;
|
|
129
|
-
}
|
|
130
|
-
.np-table-cell--status .status-circle {
|
|
131
|
-
width: 24px;
|
|
132
|
-
height: 24px;
|
|
133
|
-
}
|
|
134
|
-
.np-table-cell--status .status-circle .status-icon > svg {
|
|
135
|
-
width: 21px;
|
|
136
|
-
height: 21px;
|
|
137
|
-
}
|
|
138
|
-
.np-table-cell .tw-chevron {
|
|
139
|
-
margin-left: 8px;
|
|
140
|
-
margin-left: var(--size-8);
|
|
141
|
-
}
|
|
142
|
-
.np-table-cell-separator {
|
|
143
|
-
margin-top: 4px;
|
|
144
|
-
margin-top: var(--size-4);
|
|
145
|
-
margin-bottom: 4px;
|
|
146
|
-
margin-bottom: var(--size-4);
|
|
147
|
-
height: 1px;
|
|
148
|
-
padding: 0;
|
|
149
|
-
background-color: rgba(134,167,189,0.10196);
|
|
150
|
-
background-color: var(--color-background-neutral);
|
|
151
|
-
}
|
|
152
|
-
.np-table-cell .np-text-body-default {
|
|
153
|
-
line-height: 1.375rem;
|
|
154
|
-
line-height: var(--line-height-22);
|
|
155
|
-
}
|
|
156
|
-
.np-table-cell .np-text-body-large-bold {
|
|
157
|
-
display: flex;
|
|
158
|
-
align-items: center;
|
|
159
|
-
color: #37517e;
|
|
160
|
-
color: var(--color-content-primary);
|
|
161
|
-
white-space: nowrap;
|
|
162
|
-
}
|
|
163
|
-
.np-table-cell .np-table-content--success {
|
|
164
|
-
color: var(--color-sentiment-positive);
|
|
165
|
-
}
|
|
166
|
-
.np-table-cell .np-table-content--error {
|
|
167
|
-
color: var(--color-sentiment-negative);
|
|
168
|
-
}
|
|
169
|
-
.np-table-cell .tw-loader {
|
|
170
|
-
margin: 150px auto;
|
|
171
|
-
}
|
|
172
|
-
@media (max-width: 320px) {
|
|
173
|
-
.np-table-cell .tw-loader {
|
|
174
|
-
margin-top: 70px;
|
|
175
|
-
margin-bottom: 70px;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
.np-table-content {
|
|
179
|
-
gap: 12px;
|
|
180
|
-
gap: var(--size-12);
|
|
181
|
-
}
|
|
182
|
-
.np-table-content--success,
|
|
183
|
-
.np-table-content--error {
|
|
184
|
-
gap: 4px;
|
|
185
|
-
gap: var(--size-4);
|
|
186
|
-
}
|
|
187
|
-
.np-table-content--success .np-table-content-text,
|
|
188
|
-
.np-table-content--error .np-table-content-text {
|
|
189
|
-
line-height: 155%;
|
|
190
|
-
}
|
|
191
|
-
.np-table-content-media {
|
|
192
|
-
flex-shrink: 0;
|
|
193
|
-
}
|
|
194
|
-
.np-table-content-body {
|
|
195
|
-
display: flex;
|
|
196
|
-
flex-direction: column;
|
|
197
|
-
font-size: 0.75rem;
|
|
198
|
-
font-size: var(--font-size-12);
|
|
199
|
-
color: #768e9c;
|
|
200
|
-
color: var(--color-content-tertiary);
|
|
201
|
-
}
|
|
202
|
-
.np-table-content--reversed {
|
|
203
|
-
flex-direction: row-reverse;
|
|
204
|
-
}
|
|
205
|
-
.np-table-content--reversed .np-table-content-body {
|
|
206
|
-
align-items: end;
|
|
207
|
-
}
|
|
208
|
-
.np-table-empty-data {
|
|
209
|
-
display: flex;
|
|
210
|
-
align-items: center;
|
|
211
|
-
}
|
|
212
|
-
.np-table-empty-data .status-circle {
|
|
213
|
-
margin-right: 12px;
|
|
214
|
-
margin-right: var(--size-12);
|
|
215
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { TableHeaderType } from './TableHeader';
|
|
2
|
-
import { TableRowClickableType, TableRowType } from './TableRow';
|
|
3
|
-
export interface TableProps {
|
|
4
|
-
data: {
|
|
5
|
-
headers?: TableHeaderType[];
|
|
6
|
-
content?: TableRowType[] | TableRowClickableType[];
|
|
7
|
-
onRowClick?: (rowData: TableRowType | TableRowClickableType) => void;
|
|
8
|
-
};
|
|
9
|
-
loading?: boolean;
|
|
10
|
-
className?: string | undefined;
|
|
11
|
-
fullWidth?: boolean;
|
|
12
|
-
error?: {
|
|
13
|
-
message?: string;
|
|
14
|
-
action?: {
|
|
15
|
-
href?: string;
|
|
16
|
-
text?: string;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
onRetry?: () => void;
|
|
20
|
-
}
|
|
21
|
-
declare const Table: React.FC<TableProps>;
|
|
22
|
-
export default Table;
|
|
23
|
-
//# sourceMappingURL=Table.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../src/table/Table.tsx"],"names":[],"mappings":"AAEA,OAAoB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAiB,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAS3E,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE;QACJ,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;QAC5B,OAAO,CAAC,EAAE,YAAY,EAAE,GAAG,qBAAqB,EAAE,CAAC;QACnD,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,GAAG,qBAAqB,KAAK,IAAI,CAAC;KACtE,CAAC;IACF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE;QACN,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE;YACP,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,IAAI,CAAC,EAAE,MAAM,CAAC;SACf,CAAC;KACH,CAAC;IACF,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAuF/B,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Table.messages.d.ts","sourceRoot":"","sources":["../../../src/table/Table.messages.ts"],"names":[],"mappings":";;;;;;;;;;AAEA,wBASG"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface TextPropsType {
|
|
3
|
-
primaryText?: string;
|
|
4
|
-
secondaryText?: string;
|
|
5
|
-
}
|
|
6
|
-
interface StatusPropsType {
|
|
7
|
-
status?: 'error' | 'success';
|
|
8
|
-
}
|
|
9
|
-
export interface LeadingContentType extends TextPropsType, StatusPropsType {
|
|
10
|
-
initials?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface TextContentType extends StatusPropsType {
|
|
13
|
-
text?: string;
|
|
14
|
-
}
|
|
15
|
-
interface CurrencyType {
|
|
16
|
-
value: string | number;
|
|
17
|
-
currency: string;
|
|
18
|
-
}
|
|
19
|
-
export interface CurrencyContentType extends StatusPropsType {
|
|
20
|
-
primaryCurrency?: CurrencyType;
|
|
21
|
-
secondaryCurrency?: CurrencyType;
|
|
22
|
-
}
|
|
23
|
-
export interface StatusContentType extends TextPropsType {
|
|
24
|
-
sentiment?: 'negative' | 'neutral' | 'positive' | 'warning' | 'pending';
|
|
25
|
-
}
|
|
26
|
-
export interface TableCellProps {
|
|
27
|
-
type?: 'leading' | 'text' | 'currency' | 'status';
|
|
28
|
-
content?: LeadingContentType & TextContentType & CurrencyContentType & StatusContentType;
|
|
29
|
-
alignment?: 'right' | 'left';
|
|
30
|
-
className?: string;
|
|
31
|
-
colSpan?: number;
|
|
32
|
-
hasSeparator?: boolean;
|
|
33
|
-
children?: React.ReactNode;
|
|
34
|
-
}
|
|
35
|
-
declare const TableCell: ({ type, content, alignment, className, colSpan, hasSeparator, children, }: TableCellProps) => React.JSX.Element;
|
|
36
|
-
export default TableCell;
|
|
37
|
-
//# sourceMappingURL=TableCell.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableCell.d.ts","sourceRoot":"","sources":["../../../src/table/TableCell.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,aAAa;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAGD,UAAU,eAAe;IACvB,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC9B;AAGD,MAAM,WAAW,kBAAmB,SAAQ,aAAa,EAAE,eAAe;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,UAAU,YAAY;IACpB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAoB,SAAQ,eAAe;IAC1D,eAAe,CAAC,EAAE,YAAY,CAAC;IAC/B,iBAAiB,CAAC,EAAE,YAAY,CAAC;CAClC;AAED,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,SAAS,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;CACzE;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,CAAC;IAClD,OAAO,CAAC,EAAE,kBAAkB,GAAG,eAAe,GAAG,mBAAmB,GAAG,iBAAiB,CAAC;IACzF,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,QAAA,MAAM,SAAS,8EAQZ,cAAc,sBAwFhB,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface TableHeaderType {
|
|
2
|
-
header?: string;
|
|
3
|
-
className?: string;
|
|
4
|
-
alignment?: 'right' | 'left';
|
|
5
|
-
hasError?: boolean;
|
|
6
|
-
}
|
|
7
|
-
export interface TableHeaderProps extends TableHeaderType {
|
|
8
|
-
hasActionColumn?: boolean;
|
|
9
|
-
}
|
|
10
|
-
declare const TableHeader: React.FC<TableHeaderProps>;
|
|
11
|
-
export default TableHeader;
|
|
12
|
-
//# sourceMappingURL=TableHeader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableHeader.d.ts","sourceRoot":"","sources":["../../../src/table/TableHeader.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAgC3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TableCellProps } from './TableCell';
|
|
3
|
-
export interface TableRowType {
|
|
4
|
-
rowContent?: TableCellProps[];
|
|
5
|
-
}
|
|
6
|
-
export interface TableRowClickableType extends TableRowType {
|
|
7
|
-
id: number | string;
|
|
8
|
-
}
|
|
9
|
-
export interface TableRowProps {
|
|
10
|
-
rowData?: TableRowType | TableRowClickableType;
|
|
11
|
-
hasSeparator?: boolean;
|
|
12
|
-
children?: React.ReactNode;
|
|
13
|
-
onRowClick?: (rowData: TableRowType | TableRowClickableType) => void;
|
|
14
|
-
}
|
|
15
|
-
declare const TableRow: ({ rowData, hasSeparator, children, onRowClick }: TableRowProps) => React.JSX.Element;
|
|
16
|
-
export default TableRow;
|
|
17
|
-
//# sourceMappingURL=TableRow.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableRow.d.ts","sourceRoot":"","sources":["../../../src/table/TableRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAKxD,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,qBAAsB,SAAQ,YAAY;IACzD,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,YAAY,GAAG,qBAAqB,CAAC;IAC/C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,GAAG,qBAAqB,KAAK,IAAI,CAAC;CACtE;AAED,QAAA,MAAM,QAAQ,oDAA6D,aAAa,sBAsCvF,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export interface TableStatusTextProps {
|
|
2
|
-
text: string;
|
|
3
|
-
className?: string;
|
|
4
|
-
status?: 'success' | 'error';
|
|
5
|
-
typography?: 'default' | 'large-bold';
|
|
6
|
-
}
|
|
7
|
-
declare const TableStatusText: React.FC<TableStatusTextProps>;
|
|
8
|
-
export default TableStatusText;
|
|
9
|
-
//# sourceMappingURL=TableStatusText.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableStatusText.d.ts","sourceRoot":"","sources":["../../../src/table/TableStatusText.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC7B,UAAU,CAAC,EAAE,SAAS,GAAG,YAAY,CAAC;CACvC;AAED,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAsBnD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { default } from './Table';
|
|
2
|
-
export type { TableProps } from './Table';
|
|
3
|
-
export type { TableRowType, TableRowClickableType } from './TableRow';
|
|
4
|
-
export type { TableHeaderType } from './TableHeader';
|
|
5
|
-
export type { LeadingContentType, TextContentType, CurrencyContentType, StatusContentType, TableCellProps, } from './TableCell';
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/table/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,YAAY,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACtE,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,YAAY,EACV,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,GACf,MAAM,aAAa,CAAC"}
|
package/src/table/Table.css
DELETED
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
.np-table {
|
|
2
|
-
width: 100%;
|
|
3
|
-
background-color: transparent;
|
|
4
|
-
}
|
|
5
|
-
.np-table-container {
|
|
6
|
-
padding: 8px;
|
|
7
|
-
padding: var(--size-8);
|
|
8
|
-
background-color: rgba(134,167,189,0.10196);
|
|
9
|
-
background-color: var(--color-background-neutral);
|
|
10
|
-
border-radius: 16px;
|
|
11
|
-
border-radius: var(--radius-medium);
|
|
12
|
-
}
|
|
13
|
-
.np-table-container--loading .np-table-header {
|
|
14
|
-
min-width: calc(160px * 2);
|
|
15
|
-
}
|
|
16
|
-
.np-table-container--center {
|
|
17
|
-
margin-right: auto;
|
|
18
|
-
margin-left: auto;
|
|
19
|
-
}
|
|
20
|
-
.np-table-container--full-width {
|
|
21
|
-
width: 100%;
|
|
22
|
-
}
|
|
23
|
-
.np-table-inner-container {
|
|
24
|
-
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));
|
|
25
|
-
background-position: left center, right center, left center, right center;
|
|
26
|
-
background-repeat: no-repeat;
|
|
27
|
-
background-color: var(--color-contrast-overlay);
|
|
28
|
-
background-size: 15px 100%, 15px 100%, 15px 100%, 15px 100%;
|
|
29
|
-
background-attachment: local, local, scroll, scroll;
|
|
30
|
-
overflow-x: auto;
|
|
31
|
-
border-radius: 10px;
|
|
32
|
-
}
|
|
33
|
-
.np-theme-personal--dark .np-table-inner-container {
|
|
34
|
-
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));
|
|
35
|
-
}
|
|
36
|
-
.np-table-row:last-child .np-table-cell:first-child {
|
|
37
|
-
border-bottom-left-radius: 10px;
|
|
38
|
-
}
|
|
39
|
-
.np-table-row:last-child .np-table-cell:last-child {
|
|
40
|
-
border-bottom-right-radius: 10px;
|
|
41
|
-
}
|
|
42
|
-
.np-table-row--clickable:hover .np-table-cell {
|
|
43
|
-
background-color: var(--color-background-screen-hover);
|
|
44
|
-
cursor: pointer;
|
|
45
|
-
}
|
|
46
|
-
.np-table-row--separator .np-table-cell {
|
|
47
|
-
padding: 0;
|
|
48
|
-
}
|
|
49
|
-
.np-table-header,
|
|
50
|
-
.np-table-cell {
|
|
51
|
-
padding: 0;
|
|
52
|
-
}
|
|
53
|
-
.np-table-header:first-child,
|
|
54
|
-
.np-table-cell:first-child {
|
|
55
|
-
padding-left: 16px;
|
|
56
|
-
padding-left: var(--size-16);
|
|
57
|
-
}
|
|
58
|
-
.np-table-header:first-child .np-table-header-content,
|
|
59
|
-
.np-table-cell:first-child .np-table-header-content,
|
|
60
|
-
.np-table-header:first-child .np-table-cell-content,
|
|
61
|
-
.np-table-cell:first-child .np-table-cell-content {
|
|
62
|
-
padding-left: 0;
|
|
63
|
-
}
|
|
64
|
-
.np-table-header:last-child,
|
|
65
|
-
.np-table-cell:last-child {
|
|
66
|
-
padding-right: 16px;
|
|
67
|
-
padding-right: var(--size-16);
|
|
68
|
-
}
|
|
69
|
-
.np-table-header:last-child .np-table-header-content,
|
|
70
|
-
.np-table-cell:last-child .np-table-header-content,
|
|
71
|
-
.np-table-header:last-child .np-table-cell-content,
|
|
72
|
-
.np-table-cell:last-child .np-table-cell-content {
|
|
73
|
-
padding-right: 0;
|
|
74
|
-
}
|
|
75
|
-
.np-table-header .np-text-body-large-bold,
|
|
76
|
-
.np-table-cell .np-text-body-large-bold {
|
|
77
|
-
font-size: 0.875rem;
|
|
78
|
-
font-size: var(--font-size-14);
|
|
79
|
-
}
|
|
80
|
-
.np-table-header.np-table-header--right,
|
|
81
|
-
.np-table-cell.np-table-cell--right {
|
|
82
|
-
padding-right: calc(8px + 12px);
|
|
83
|
-
padding-right: calc(var(--size-8) + var(--size-12));
|
|
84
|
-
}
|
|
85
|
-
.np-table-header.np-table-header--right > .np-text-body-default,
|
|
86
|
-
.np-table-cell.np-table-cell--right > .np-text-body-default {
|
|
87
|
-
text-align: right;
|
|
88
|
-
}
|
|
89
|
-
.np-table-header.np-table-header--right .np-table-header-content,
|
|
90
|
-
.np-table-cell.np-table-cell--right .np-table-content {
|
|
91
|
-
justify-content: end;
|
|
92
|
-
}
|
|
93
|
-
.np-table-header-content,
|
|
94
|
-
.np-table-content {
|
|
95
|
-
display: flex;
|
|
96
|
-
align-items: center;
|
|
97
|
-
justify-content: start;
|
|
98
|
-
}
|
|
99
|
-
.np-table-header {
|
|
100
|
-
min-width: 160px;
|
|
101
|
-
padding-right: 8px;
|
|
102
|
-
padding-right: var(--size-8);
|
|
103
|
-
padding-bottom: 8px;
|
|
104
|
-
padding-bottom: var(--size-8);
|
|
105
|
-
padding-left: 8px;
|
|
106
|
-
padding-left: var(--size-8);
|
|
107
|
-
background-color: rgba(134,167,189,0.10196);
|
|
108
|
-
background-color: var(--color-background-neutral);
|
|
109
|
-
color: #37517e;
|
|
110
|
-
color: var(--color-content-primary);
|
|
111
|
-
}
|
|
112
|
-
.np-table-header-content {
|
|
113
|
-
padding-top: 5px;
|
|
114
|
-
padding-bottom: 5px;
|
|
115
|
-
white-space: nowrap;
|
|
116
|
-
}
|
|
117
|
-
.np-table-header--has-error {
|
|
118
|
-
color: var(--color-sentiment-negative);
|
|
119
|
-
}
|
|
120
|
-
.np-table-cell {
|
|
121
|
-
padding: 16px 8px;
|
|
122
|
-
padding: var(--size-16) var(--size-8);
|
|
123
|
-
}
|
|
124
|
-
.np-table-cell--primary {
|
|
125
|
-
min-width: 200px;
|
|
126
|
-
}
|
|
127
|
-
.np-table-cell--currency .np-text-body-default {
|
|
128
|
-
white-space: nowrap;
|
|
129
|
-
}
|
|
130
|
-
.np-table-cell--status .status-circle {
|
|
131
|
-
width: 24px;
|
|
132
|
-
height: 24px;
|
|
133
|
-
}
|
|
134
|
-
.np-table-cell--status .status-circle .status-icon > svg {
|
|
135
|
-
width: 21px;
|
|
136
|
-
height: 21px;
|
|
137
|
-
}
|
|
138
|
-
.np-table-cell .tw-chevron {
|
|
139
|
-
margin-left: 8px;
|
|
140
|
-
margin-left: var(--size-8);
|
|
141
|
-
}
|
|
142
|
-
.np-table-cell-separator {
|
|
143
|
-
margin-top: 4px;
|
|
144
|
-
margin-top: var(--size-4);
|
|
145
|
-
margin-bottom: 4px;
|
|
146
|
-
margin-bottom: var(--size-4);
|
|
147
|
-
height: 1px;
|
|
148
|
-
padding: 0;
|
|
149
|
-
background-color: rgba(134,167,189,0.10196);
|
|
150
|
-
background-color: var(--color-background-neutral);
|
|
151
|
-
}
|
|
152
|
-
.np-table-cell .np-text-body-default {
|
|
153
|
-
line-height: 1.375rem;
|
|
154
|
-
line-height: var(--line-height-22);
|
|
155
|
-
}
|
|
156
|
-
.np-table-cell .np-text-body-large-bold {
|
|
157
|
-
display: flex;
|
|
158
|
-
align-items: center;
|
|
159
|
-
color: #37517e;
|
|
160
|
-
color: var(--color-content-primary);
|
|
161
|
-
white-space: nowrap;
|
|
162
|
-
}
|
|
163
|
-
.np-table-cell .np-table-content--success {
|
|
164
|
-
color: var(--color-sentiment-positive);
|
|
165
|
-
}
|
|
166
|
-
.np-table-cell .np-table-content--error {
|
|
167
|
-
color: var(--color-sentiment-negative);
|
|
168
|
-
}
|
|
169
|
-
.np-table-cell .tw-loader {
|
|
170
|
-
margin: 150px auto;
|
|
171
|
-
}
|
|
172
|
-
@media (max-width: 320px) {
|
|
173
|
-
.np-table-cell .tw-loader {
|
|
174
|
-
margin-top: 70px;
|
|
175
|
-
margin-bottom: 70px;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
.np-table-content {
|
|
179
|
-
gap: 12px;
|
|
180
|
-
gap: var(--size-12);
|
|
181
|
-
}
|
|
182
|
-
.np-table-content--success,
|
|
183
|
-
.np-table-content--error {
|
|
184
|
-
gap: 4px;
|
|
185
|
-
gap: var(--size-4);
|
|
186
|
-
}
|
|
187
|
-
.np-table-content--success .np-table-content-text,
|
|
188
|
-
.np-table-content--error .np-table-content-text {
|
|
189
|
-
line-height: 155%;
|
|
190
|
-
}
|
|
191
|
-
.np-table-content-media {
|
|
192
|
-
flex-shrink: 0;
|
|
193
|
-
}
|
|
194
|
-
.np-table-content-body {
|
|
195
|
-
display: flex;
|
|
196
|
-
flex-direction: column;
|
|
197
|
-
font-size: 0.75rem;
|
|
198
|
-
font-size: var(--font-size-12);
|
|
199
|
-
color: #768e9c;
|
|
200
|
-
color: var(--color-content-tertiary);
|
|
201
|
-
}
|
|
202
|
-
.np-table-content--reversed {
|
|
203
|
-
flex-direction: row-reverse;
|
|
204
|
-
}
|
|
205
|
-
.np-table-content--reversed .np-table-content-body {
|
|
206
|
-
align-items: end;
|
|
207
|
-
}
|
|
208
|
-
.np-table-empty-data {
|
|
209
|
-
display: flex;
|
|
210
|
-
align-items: center;
|
|
211
|
-
}
|
|
212
|
-
.np-table-empty-data .status-circle {
|
|
213
|
-
margin-right: 12px;
|
|
214
|
-
margin-right: var(--size-12);
|
|
215
|
-
}
|