Skip to content

Commit 4adb397

Browse files
christophidespPanos Christophides
and
Panos Christophides
authored
fix table title, set new color vars, for dropdown table, progress bars etc (#449)
* fix table title, set new color vars, for dropdown table, progress bars etc * nit --------- Co-authored-by: Panos Christophides <[email protected]>
1 parent 76bf7dd commit 4adb397

File tree

6 files changed

+27
-5
lines changed

6 files changed

+27
-5
lines changed

src/components/tableV2/core/base-table.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const HeaderCell = styled(Box)`
2727

2828
const Table = forwardRef(({ children, width, ...props }, ref) => (
2929
<Box
30-
sx={{ borderCollapse: "separate", "table-layout": "fixed" }}
30+
sx={{ borderCollapse: "separate", "table-layout": "fixed", borderSpacing: "0" }}
3131
ref={ref}
3232
as="table"
3333
width={width}
@@ -40,7 +40,7 @@ const Table = forwardRef(({ children, width, ...props }, ref) => (
4040
Table.Head = forwardRef(({ children, ...props }, ref) => (
4141
<Box
4242
ref={ref}
43-
sx={{ whiteSpace: "nowrap", zIndex: 1, position: "sticky", top: 0 }}
43+
sx={{ whiteSpace: "nowrap", zIndex: 10, position: "sticky", top: 0 }}
4444
as="thead"
4545
{...props}
4646
>
@@ -287,7 +287,7 @@ Table.Cell = forwardRef(
287287
{...rest}
288288
background={
289289
!rest.background && isRowHovering
290-
? "elementBackground"
290+
? "tableRowBgHover"
291291
: rest.background || (index % 2 == 0 ? "mainBackground" : "tableRowBg")
292292
}
293293
backgroundOpacity={

src/components/tableV2/features/globalControls.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { memo } from "react"
22
import Flex from "src/components/templates/flex"
33
import SearchInput from "src/components/search"
44
import { Icon } from "src/components/icon"
5-
import { H4 } from "src/components/typography"
5+
import { TextBig } from "src/components/typography"
66
import { debounce } from "throttle-debounce"
77

88
const GlobalControls = ({
@@ -25,9 +25,14 @@ const GlobalControls = ({
2525
background="mainBackground"
2626
padding={[0, 0, 4]}
2727
gap={3}
28+
alignItems="center"
2829
{...tableMeta.bulkActionsStyles}
2930
>
30-
{!!title && <H4>{title}</H4>}
31+
{!!title && (
32+
<TextBig margin={[0, 0, 0, 3]} strong>
33+
{title}
34+
</TextBig>
35+
)}
3136
{handleSearch && (
3237
<Flex width={{ max: 100, base: "40%" }} {...tableMeta.searchContainerStyles}>
3338
<SearchInput

src/components/tableV2/netdataTable.stories.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ tableStories.add("Global Filters", () => {
157157
return (
158158
<Box width="800px">
159159
<NetdataTable
160+
title="Table Title"
160161
onGlobalSearchChange={onGlobalSearchChange}
161162
dataColumns={mockDataColumns}
162163
data={mockData()}

src/theme/dark/colors.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const appColors = {
1010
disabled: rawColors.neutral.tuna,
1111
disabledBackground: rawColors.neutral.outerSpace,
1212
dropdown: rawColors.neutral.arsenic,
13+
dropdownShadow: rawColors.shadows.dropdownDark,
1314
elementBackground: rawColors.neutral.outerSpace,
1415
elementBackgroundHover: rawColors.neutral.tuna,
1516
mainBackground: rawColors.neutral.gunmetal,
@@ -81,9 +82,14 @@ const appColors = {
8182
idleClear: rawColors.neutral.arsenic,
8283

8384
//Table
85+
dropdownTable: rawColors.neutral.eerieBlack,
86+
tableRowBgHover: rawColors.neutral.ratsbane,
8487
tableRowBg: rawColors.neutral.arsenic,
8588
columnHighlight: rawColors.green.poker,
8689

90+
//Progress Bare
91+
progressBg: rawColors.neutral.bluebayoux,
92+
8793
//IconButton
8894
iconColor: rawColors.neutral.iron,
8995

src/theme/default/colors.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const appColors = {
1010
disabled: rawColors.neutral.porcelain,
1111
disabledBackground: rawColors.neutral.porcelain,
1212
dropdown: rawColors.neutral.white,
13+
dropdownShadow: rawColors.shadows.dropdownLight,
1314
elementBackground: rawColors.neutral.blackhaze,
1415
elementBackgroundHover: rawColors.neutral.white,
1516
mainBackground: rawColors.neutral.white,
@@ -81,11 +82,16 @@ const appColors = {
8182
idleClear: rawColors.neutral.chineseWhite,
8283

8384
//Table
85+
dropdownTable: rawColors.neutral.white,
8486
tableRowBg: rawColors.neutral.blackhaze,
87+
tableRowBgHover: rawColors.neutral.porcelain,
8588
columnHighlight: rawColors.green.frostee,
8689
//IconButton
8790
iconColor: rawColors.neutral.limedSpruce,
8891

92+
//Progress Bare
93+
progressBg: rawColors.neutral.chineseWhite,
94+
8995
//table-resizer
9096
resizerLine: rawColors.green.vista,
9197
}

src/theme/rawColors.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ const rawColors = {
6161
indigo: "#5790FF",
6262
cyan: "#00BAE2",
6363
},
64+
shadows: {
65+
dropdownLight: "rgba(9, 30, 66, 0.15)",
66+
dropdownDark: "rgba(0, 0, 0, 0.4)",
67+
},
6468
}
6569

6670
export default rawColors

0 commit comments

Comments
 (0)