@transferwise/components 0.0.0-experimental-d1715ff → 0.0.0-experimental-f81f868

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 (44) hide show
  1. package/build/i18n/en.json +2 -0
  2. package/build/i18n/en.json.js +2 -0
  3. package/build/i18n/en.json.js.map +1 -1
  4. package/build/i18n/en.json.mjs +2 -0
  5. package/build/i18n/en.json.mjs.map +1 -1
  6. package/build/main.css +215 -0
  7. package/build/styles/main.css +215 -0
  8. package/build/styles/table/Table.css +215 -0
  9. package/build/types/table/Table.d.ts +23 -0
  10. package/build/types/table/Table.d.ts.map +1 -0
  11. package/build/types/table/Table.messages.d.ts +12 -0
  12. package/build/types/table/Table.messages.d.ts.map +1 -0
  13. package/build/types/table/TableCell.d.ts +37 -0
  14. package/build/types/table/TableCell.d.ts.map +1 -0
  15. package/build/types/table/TableHeader.d.ts +12 -0
  16. package/build/types/table/TableHeader.d.ts.map +1 -0
  17. package/build/types/table/TableRow.d.ts +17 -0
  18. package/build/types/table/TableRow.d.ts.map +1 -0
  19. package/build/types/table/TableStatusText.d.ts +9 -0
  20. package/build/types/table/TableStatusText.d.ts.map +1 -0
  21. package/build/types/table/index.d.ts +6 -0
  22. package/build/types/table/index.d.ts.map +1 -0
  23. package/package.json +5 -5
  24. package/src/i18n/en.json +2 -0
  25. package/src/main.css +215 -0
  26. package/src/main.less +1 -0
  27. package/src/table/Table.css +215 -0
  28. package/src/table/Table.less +261 -0
  29. package/src/table/Table.messages.ts +12 -0
  30. package/src/table/Table.spec.tsx +87 -0
  31. package/src/table/Table.story.tsx +352 -0
  32. package/src/table/Table.tsx +121 -0
  33. package/src/table/TableCell.spec.tsx +298 -0
  34. package/src/table/TableCell.tsx +153 -0
  35. package/src/table/TableHeader.spec.tsx +58 -0
  36. package/src/table/TableHeader.tsx +50 -0
  37. package/src/table/TableRow.spec.tsx +104 -0
  38. package/src/table/TableRow.tsx +62 -0
  39. package/src/table/TableStatusText.spec.tsx +53 -0
  40. package/src/table/TableStatusText.tsx +35 -0
  41. package/src/table/index.ts +11 -0
  42. package/src/test-utils/assets/avatar-rectangle-fox.webp +0 -0
  43. package/src/test-utils/assets/avatar-square-dude.webp +0 -0
  44. package/src/test-utils/assets/tapestry-01.png +0 -0
@@ -0,0 +1,23 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,12 @@
1
+ declare const _default: {
2
+ refreshPage: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ };
6
+ emptyData: {
7
+ id: string;
8
+ defaultMessage: string;
9
+ };
10
+ };
11
+ export default _default;
12
+ //# sourceMappingURL=Table.messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Table.messages.d.ts","sourceRoot":"","sources":["../../../src/table/Table.messages.ts"],"names":[],"mappings":";;;;;;;;;;AAEA,wBASG"}
@@ -0,0 +1,37 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,12 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,17 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,9 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,6 @@
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
@@ -0,0 +1 @@
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "0.0.0-experimental-d1715ff",
3
+ "version": "0.0.0-experimental-f81f868",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -79,7 +79,7 @@
79
79
  "@types/react": "^18.3.11",
80
80
  "@types/react-dom": "^18.3.1",
81
81
  "@types/react-transition-group": "4.4.10",
82
- "@wise/art": "^2.16.3",
82
+ "@wise/art": "^2.7.0",
83
83
  "babel-plugin-formatjs": "^10.5.16",
84
84
  "babel-plugin-inline-react-svg": "^2.0.2",
85
85
  "enzyme": "^3.11.0",
@@ -92,13 +92,13 @@
92
92
  "rollup-preserve-directives": "^1.1.1",
93
93
  "storybook": "^8.2.2",
94
94
  "@transferwise/less-config": "3.1.0",
95
- "@transferwise/neptune-css": "14.19.1",
96
- "@wise/components-theming": "1.6.1"
95
+ "@wise/components-theming": "1.6.1",
96
+ "@transferwise/neptune-css": "14.19.1"
97
97
  },
98
98
  "peerDependencies": {
99
99
  "@transferwise/icons": "^3.13.1",
100
100
  "@transferwise/neptune-css": "^14.9.6",
101
- "@wise/art": "^2.16",
101
+ "@wise/art": "^2.7.0",
102
102
  "@wise/components-theming": "^1.0.0",
103
103
  "react": ">=18",
104
104
  "react-dom": ">=18",
package/src/i18n/en.json CHANGED
@@ -30,6 +30,8 @@
30
30
  "neptune.Summary.statusDone": "Item done",
31
31
  "neptune.Summary.statusNotDone": "Item to do",
32
32
  "neptune.Summary.statusPending": "Item pending",
33
+ "neptune.Table.emptyData": "No results found",
34
+ "neptune.Table.refreshPage": "Refresh page",
33
35
  "neptune.Upload.csButtonText": "Upload another file?",
34
36
  "neptune.Upload.csFailureText": "Upload failed. Please, try again",
35
37
  "neptune.Upload.csSuccessText": "Upload complete!",
package/src/main.css CHANGED
@@ -5025,6 +5025,221 @@ html:not([dir="rtl"]) .np-navigation-option {
5025
5025
  padding: 0 var(--size-24);
5026
5026
  }
5027
5027
  }
5028
+ .np-table {
5029
+ width: 100%;
5030
+ background-color: transparent;
5031
+ }
5032
+ .np-table-container {
5033
+ padding: 8px;
5034
+ padding: var(--size-8);
5035
+ background-color: rgba(134,167,189,0.10196);
5036
+ background-color: var(--color-background-neutral);
5037
+ border-radius: 16px;
5038
+ border-radius: var(--radius-medium);
5039
+ }
5040
+ .np-table-container--loading .np-table-header {
5041
+ min-width: calc(160px * 2);
5042
+ }
5043
+ .np-table-container--center {
5044
+ margin-right: auto;
5045
+ margin-left: auto;
5046
+ }
5047
+ .np-table-container--full-width {
5048
+ width: 100%;
5049
+ }
5050
+ .np-table-inner-container {
5051
+ 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));
5052
+ background-position: left center, right center, left center, right center;
5053
+ background-repeat: no-repeat;
5054
+ background-color: var(--color-contrast-overlay);
5055
+ background-size: 15px 100%, 15px 100%, 15px 100%, 15px 100%;
5056
+ background-attachment: local, local, scroll, scroll;
5057
+ overflow-x: auto;
5058
+ border-radius: 10px;
5059
+ }
5060
+ .np-theme-personal--dark .np-table-inner-container {
5061
+ 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(255, 255, 255, 0.1), rgba(0, 0, 0, 0)), linear-gradient(to left, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0));
5062
+ }
5063
+ .np-table-row:last-child .np-table-cell:first-child {
5064
+ border-bottom-left-radius: 10px;
5065
+ }
5066
+ .np-table-row:last-child .np-table-cell:last-child {
5067
+ border-bottom-right-radius: 10px;
5068
+ }
5069
+ .np-table-row--clickable:hover .np-table-cell {
5070
+ background-color: var(--color-background-screen-hover);
5071
+ cursor: pointer;
5072
+ }
5073
+ .np-table-row--separator .np-table-cell {
5074
+ padding: 0;
5075
+ }
5076
+ .np-table-header,
5077
+ .np-table-cell {
5078
+ padding: 0;
5079
+ }
5080
+ .np-table-header:first-child,
5081
+ .np-table-cell:first-child {
5082
+ padding-left: 16px;
5083
+ padding-left: var(--size-16);
5084
+ }
5085
+ .np-table-header:first-child .np-table-header-content,
5086
+ .np-table-cell:first-child .np-table-header-content,
5087
+ .np-table-header:first-child .np-table-cell-content,
5088
+ .np-table-cell:first-child .np-table-cell-content {
5089
+ padding-left: 0;
5090
+ }
5091
+ .np-table-header:last-child,
5092
+ .np-table-cell:last-child {
5093
+ padding-right: 16px;
5094
+ padding-right: var(--size-16);
5095
+ }
5096
+ .np-table-header:last-child .np-table-header-content,
5097
+ .np-table-cell:last-child .np-table-header-content,
5098
+ .np-table-header:last-child .np-table-cell-content,
5099
+ .np-table-cell:last-child .np-table-cell-content {
5100
+ padding-right: 0;
5101
+ }
5102
+ .np-table-header .np-text-body-large-bold,
5103
+ .np-table-cell .np-text-body-large-bold {
5104
+ font-size: 0.875rem;
5105
+ font-size: var(--font-size-14);
5106
+ }
5107
+ .np-table-header.np-table-header--right,
5108
+ .np-table-cell.np-table-cell--right {
5109
+ padding-right: calc(8px + 12px);
5110
+ padding-right: calc(var(--size-8) + var(--size-12));
5111
+ }
5112
+ .np-table-header.np-table-header--right > .np-text-body-default,
5113
+ .np-table-cell.np-table-cell--right > .np-text-body-default {
5114
+ text-align: right;
5115
+ }
5116
+ .np-table-header.np-table-header--right .np-table-header-content,
5117
+ .np-table-cell.np-table-cell--right .np-table-content {
5118
+ justify-content: end;
5119
+ }
5120
+ .np-table-header-content,
5121
+ .np-table-content {
5122
+ display: flex;
5123
+ align-items: center;
5124
+ justify-content: start;
5125
+ }
5126
+ .np-table-header {
5127
+ min-width: 160px;
5128
+ padding-right: 8px;
5129
+ padding-right: var(--size-8);
5130
+ padding-bottom: 8px;
5131
+ padding-bottom: var(--size-8);
5132
+ padding-left: 8px;
5133
+ padding-left: var(--size-8);
5134
+ background-color: rgba(134,167,189,0.10196);
5135
+ background-color: var(--color-background-neutral);
5136
+ color: #37517e;
5137
+ color: var(--color-content-primary);
5138
+ }
5139
+ .np-table-header-content {
5140
+ padding-top: 5px;
5141
+ padding-bottom: 5px;
5142
+ white-space: nowrap;
5143
+ }
5144
+ .np-table-header--has-error {
5145
+ color: var(--color-sentiment-negative);
5146
+ }
5147
+ .np-table-cell {
5148
+ padding: 16px 8px;
5149
+ padding: var(--size-16) var(--size-8);
5150
+ }
5151
+ .np-table-cell--primary {
5152
+ min-width: 200px;
5153
+ }
5154
+ .np-table-cell--currency .np-text-body-default {
5155
+ white-space: nowrap;
5156
+ }
5157
+ .np-table-cell--status .status-circle {
5158
+ width: 24px;
5159
+ height: 24px;
5160
+ }
5161
+ .np-table-cell--status .status-circle .status-icon > svg {
5162
+ width: 21px;
5163
+ height: 21px;
5164
+ }
5165
+ .np-table-cell .tw-chevron {
5166
+ margin-left: 8px;
5167
+ margin-left: var(--size-8);
5168
+ }
5169
+ .np-table-cell-separator {
5170
+ margin-top: 4px;
5171
+ margin-top: var(--size-4);
5172
+ margin-bottom: 4px;
5173
+ margin-bottom: var(--size-4);
5174
+ height: 1px;
5175
+ padding: 0;
5176
+ background-color: rgba(134,167,189,0.10196);
5177
+ background-color: var(--color-background-neutral);
5178
+ }
5179
+ .np-table-cell .np-text-body-default {
5180
+ line-height: 1.375rem;
5181
+ line-height: var(--line-height-22);
5182
+ }
5183
+ .np-table-cell .np-text-body-large-bold {
5184
+ display: flex;
5185
+ align-items: center;
5186
+ color: #37517e;
5187
+ color: var(--color-content-primary);
5188
+ white-space: nowrap;
5189
+ }
5190
+ .np-table-cell .np-table-content--success {
5191
+ color: var(--color-sentiment-positive);
5192
+ }
5193
+ .np-table-cell .np-table-content--error {
5194
+ color: var(--color-sentiment-negative);
5195
+ }
5196
+ .np-table-cell .tw-loader {
5197
+ margin: 150px auto;
5198
+ }
5199
+ @media (max-width: 320px) {
5200
+ .np-table-cell .tw-loader {
5201
+ margin-top: 70px;
5202
+ margin-bottom: 70px;
5203
+ }
5204
+ }
5205
+ .np-table-content {
5206
+ gap: 12px;
5207
+ gap: var(--size-12);
5208
+ }
5209
+ .np-table-content--success,
5210
+ .np-table-content--error {
5211
+ gap: 4px;
5212
+ gap: var(--size-4);
5213
+ }
5214
+ .np-table-content--success .np-table-content-text,
5215
+ .np-table-content--error .np-table-content-text {
5216
+ line-height: 155%;
5217
+ }
5218
+ .np-table-content-media {
5219
+ flex-shrink: 0;
5220
+ }
5221
+ .np-table-content-body {
5222
+ display: flex;
5223
+ flex-direction: column;
5224
+ font-size: 0.75rem;
5225
+ font-size: var(--font-size-12);
5226
+ color: #768e9c;
5227
+ color: var(--color-content-tertiary);
5228
+ }
5229
+ .np-table-content--reversed {
5230
+ flex-direction: row-reverse;
5231
+ }
5232
+ .np-table-content--reversed .np-table-content-body {
5233
+ align-items: end;
5234
+ }
5235
+ .np-table-empty-data {
5236
+ display: flex;
5237
+ align-items: center;
5238
+ }
5239
+ .np-table-empty-data .status-circle {
5240
+ margin-right: 12px;
5241
+ margin-right: var(--size-12);
5242
+ }
5028
5243
  .np-tile {
5029
5244
  min-width: 120px;
5030
5245
  border-radius: 10px;
package/src/main.less CHANGED
@@ -60,6 +60,7 @@
60
60
  @import "./summary/Summary.less";
61
61
  @import "./switch/Switch.less";
62
62
  @import "./tabs/Tabs.less";
63
+ @import "./table/Table.less";
63
64
  @import "./tile/Tile.less";
64
65
  @import "./tooltip/Tooltip.less";
65
66
  @import "./typeahead/Typeahead.less";
@@ -0,0 +1,215 @@
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, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0)), linear-gradient(to left, rgba(255, 255, 255, 0.1), 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
+ }