Skip to content

Commit b53df25

Browse files
Merge pull request #789 from glints-dev/feature/data-table-style-adjustments
feat: Data Table style adjustments
2 parents 9db1896 + 4fbf1cd commit b53df25

9 files changed

Lines changed: 17 additions & 10 deletions

File tree

src/@next/DataTable/DataTable.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,7 @@ const DataTableComponent = React.forwardRef<HTMLTableElement, DataTableProps>(
139139
<tbody>
140140
<LoadingRow />
141141
{totalsRowMarkup && hasRows && (
142-
<StyledTableRow data-total="true">
143-
{totalsRowMarkup}
144-
</StyledTableRow>
142+
<StyledTableRow>{totalsRowMarkup}</StyledTableRow>
145143
)}
146144
{rowsMarkup}
147145
</tbody>

src/@next/DataTable/DataTableStyle.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import styled from 'styled-components';
2+
import * as DropShadow from '../utilities/dropShadow';
23
import { borderRadius8 } from '../utilities/borderRadius';
34
import { Blue, Neutral } from '../utilities/colors';
45
import { space16 } from '../utilities/spacing';
@@ -27,6 +28,10 @@ export const StyledTable = styled.table`
2728
max-width: 100vw;
2829
border-bottom: 0;
2930
31+
thead tr {
32+
background: ${Neutral.B99};
33+
}
34+
3035
&[data-has-footer='true'] {
3136
border-bottom: 1px solid ${Neutral.B85};
3237
}
@@ -50,9 +55,6 @@ export const StyledTableRow = styled.tr`
5055
&:hover {
5156
background: ${Neutral.B99};
5257
}
53-
&[data-total='true'] {
54-
background: ${Neutral.B99};
55-
}
5658
`;
5759

5860
export const StyledTabledHeader = styled.th`
@@ -67,6 +69,7 @@ export const StyledTabledHeader = styled.th`
6769
height: auto;
6870
border: none;
6971
box-shadow: none;
72+
background: ${Neutral.B99};
7073
}
7174
7275
button:hover {
@@ -99,7 +102,7 @@ export const StyledTableCell = styled.td`
99102
`;
100103

101104
export const StyledTableFooterRow = styled.tr`
102-
background: ${Neutral.B99};
105+
background: ${Neutral.B100};
103106
border-top: 0;
104107
border-radius: 0px 0px ${borderRadius8} ${borderRadius8};
105108
td {
@@ -138,4 +141,5 @@ export const StyledSpinnerContainer = styled.div`
138141
export const StyledDataTableContainer = styled.div`
139142
overflow-x: auto;
140143
scroll-behavior: smooth;
144+
box-shadow: ${DropShadow.card};
141145
`;

src/@next/DataTable/TableHeader.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react';
22
import { Button } from '../Button';
33
import { Icon } from '../Icon';
44
import { Typography } from '../Typography';
5+
import { Neutral } from '../utilities/colors';
56
import { SortDirection } from './DataTable';
67
import { StyledTabledHeader } from './DataTableStyle';
78

@@ -31,7 +32,12 @@ export const TableHeader = ({
3132

3233
const iconMarkup = sortDirection ? <Icon name={iconName} /> : null;
3334
const titleMarkup = (
34-
<Typography as="span" variant="body1" style={{ whiteSpace: 'nowrap' }}>
35+
<Typography
36+
as="span"
37+
variant="body2"
38+
color={Neutral.B18}
39+
style={{ whiteSpace: 'nowrap' }}
40+
>
3541
{title}
3642
</Typography>
3743
);

src/@next/utilities/dropShadow/DropShadow.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ export const deep = `0 0 0 1px rgba(6, 44, 82, 0.1),
77
export const button = '0 1px 0 rgba(0, 0, 0, 0.05)';
88
export const buttonFocused = '0px 0px 0px 2px rgba(106, 201, 236, 1)';
99
export const topBar = '0 2px 2px -1px rgba(0, 0, 0, 0.15)';
10-
export const card = `0 0 5px rgba(23, 24, 24, 0.05),
11-
0 1px 2px rgba(0, 0, 0, 0.15)`;
10+
export const card = `0px 1px 2px 0px rgb(71 71 71 / 20%), 0px 0px 5px 0px rgb(71 71 71 / 10%)`;
1211
export const popOver = `0 3px 6px -3px rgba(23, 24, 24, 0.08),
1312
0 8px 20px -4px rgba(23, 24, 24, 0.12)`;
1413
export const layer = `0 31px 41px 0 rgba(32, 42, 53, 0.2),
-280 Bytes
Loading
1.35 KB
Loading
1.67 KB
Loading
-277 Bytes
Loading
-521 Bytes
Loading

0 commit comments

Comments
 (0)