Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit eccf23b

Browse files
committed
fix: lighten up the PaginatedTable UI
Fixes #4155
1 parent d48370b commit eccf23b

File tree

10 files changed

+59
-43
lines changed

10 files changed

+59
-43
lines changed

docs/readme/images/grid.png

-6.33 KB
Loading

docs/readme/images/namespaces.png

1.18 KB
Loading

plugins/plugin-carbon-themes/web/css/carbon-gray10.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ body[kui-theme="Carbon Gray10"] {
9696
--color-brand-03: #0062ff;
9797

9898
--color-ui-05: #171717;
99-
--color-ui-03: var(--color-background-inverted02);
99+
--color-ui-03: #e0e0e0;
100100
--color-text-02: #565656;
101101

102102
--color-map-key: #6ea6ff;

plugins/plugin-client-common/src/components/Table/PaginatedTable.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export default class PaginatedTable<P extends Props, S extends State> extends Re
114114
)
115115
)
116116

117-
return <Toolbar breadcrumbs={breadcrumbs.length > 0 && breadcrumbs} />
117+
return <Toolbar className="kui--data-table-toolbar-top" breadcrumbs={breadcrumbs.length > 0 && breadcrumbs} />
118118
}
119119
}
120120

@@ -131,7 +131,8 @@ export default class PaginatedTable<P extends Props, S extends State> extends Re
131131
return (
132132
this.props.toolbars && (
133133
<Toolbar
134-
frame={this.state.asGrid}
134+
framed
135+
className="kui--data-table-toolbar-bottom"
135136
asGrid={this.state.asGrid}
136137
gridableColumn={this.state.gridableColumn}
137138
setAsGrid={(asGrid: boolean) => this.setState({ asGrid })}

plugins/plugin-client-common/src/components/Table/Toolbar.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ import 'carbon-components/scss/components/pagination/_pagination.scss'
3030
export type Props = Partial<GridProps> &
3131
Partial<PaginationProps> &
3232
Partial<BreadcrumbProps> & {
33-
frame?: boolean
33+
framed?: boolean
34+
className?: string
3435
}
3536

3637
interface GridProps {
@@ -168,8 +169,10 @@ export default class Toolbar extends React.PureComponent<Props> {
168169
}
169170

170171
public render() {
172+
const className = 'kui--data-table-toolbar' + (this.props.className ? ` ${this.props.className}` : '')
173+
171174
return (
172-
<div className="kui--data-table-toolbar" data-frame={this.props.frame}>
175+
<div className={className} data-frame={this.props.framed}>
173176
{this.breadcrumbs()}
174177
{this.buttons()}
175178
{this.filler()}

plugins/plugin-client-common/web/css/static/ToolbarButton.scss

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,4 @@
1313
fill: var(--color-text-01) !important;
1414
}
1515
}
16-
17-
&[data-enabled='true'] {
18-
background-color: var(--color-base03);
19-
svg {
20-
fill: var(--color-base0D);
21-
}
22-
}
23-
&[data-enabled='false'] svg {
24-
filter: opacity(0.375);
25-
}
2616
}

plugins/plugin-client-common/web/scss/components/Table/Toolbar.scss

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,39 @@
1-
$toolbar-height: 2.375em;
1+
$toolbar-height: 1.875em;
22

33
body[kui-theme-style='light'] {
4-
.kui--data-table-toolbar,
5-
.bx--data-table-container.kui--data-table-container-with-toolbars.kui--data-table-container-with-title th {
6-
background-color: rgba(0, 0, 0, 0.0375);
7-
}
8-
}
9-
body[kui-theme-style='dark'] {
10-
.kui--data-table-toolbar,
11-
.bx--data-table-container.kui--data-table-container-with-toolbars.kui--data-table-container-with-title th {
12-
background-color: var(--color-base01);
4+
.bx--data-table-container.kui--data-table-container-with-toolbars.kui--data-table-container-with-title td,
5+
.bx--data-table.kui--data-table-as-grid {
6+
background-color: rgba(0, 0, 0, 0.01375);
137
}
148
}
159

1610
.bx--data-table-container.kui--data-table-container-with-toolbars.kui--data-table-container-with-title {
1711
padding-top: 0;
1812
}
1913

20-
body[kui-theme-style] .kui--data-table-toolbar {
21-
display: flex;
22-
border-radius: 2px / 4px;
14+
.kui--data-table-wrapper {
15+
/* so that captured screenshots have some padding away from the breadcrumbs */
16+
padding: 0 0.1875em;
17+
}
2318

24-
&:first-child {
25-
margin-top: 0.125em;
19+
.kui--toolbar-button-with-icon {
20+
&[data-enabled='true'] {
21+
svg {
22+
fill: var(--color-base0D);
23+
path {
24+
/* give the enabled button a bit more weight */
25+
stroke: var(--color-base0D);
26+
stroke-width: 1.1;
27+
}
28+
}
29+
}
30+
&[data-enabled='false'] svg {
31+
filter: opacity(0.375);
2632
}
33+
}
34+
35+
body[kui-theme-style] .kui--data-table-toolbar {
36+
display: flex;
2737

2838
nav[aria-label='Breadcrumb'] {
2939
overflow-x: unset;
@@ -38,10 +48,18 @@ body[kui-theme-style] .kui--data-table-toolbar {
3848
height: $toolbar-height;
3949
}
4050

41-
[aria-label='Breadcrumb'] {
51+
&.kui--data-table-toolbar-bottom {
52+
padding-top: 0.1875em;
53+
}
54+
55+
nav[aria-label='Breadcrumb'] {
4256
display: flex;
4357
align-items: center;
4458
flex: 1;
59+
60+
.bx--breadcrumb {
61+
padding-left: 0;
62+
}
4563
}
4664

4765
.kui--toolbar-button-with-icon {
@@ -64,7 +82,6 @@ body[kui-theme-style] .kui--data-table-toolbar {
6482
border: none;
6583
background-color: transparent;
6684
width: unset;
67-
height: $toolbar-height;
6885
align-items: unset;
6986

7087
.kui--data-table-toolbar-pagination-info {
@@ -75,8 +92,7 @@ body[kui-theme-style] .kui--data-table-toolbar {
7592
display: flex;
7693
justify-content: flex-end;
7794
align-items: center;
78-
border-left: 1px solid;
79-
border-color: var(--color-table-border3);
95+
border: none;
8096
}
8197
}
8298
}

plugins/plugin-client-common/web/scss/components/Table/kui-tables.scss

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,19 @@ body[kui-theme-style] {
99
tbody tr.bx--data-table--selected:hover {
1010
&,
1111
td {
12-
background-color: var(--color-base03);
12+
background-color: var(--color-ui-03);
1313
}
1414
}
1515

16-
&.bx--data-table--compact td {
17-
border-color: transparent;
18-
border-bottom: 1px solid var(--color-base03);
19-
vertical-align: middle;
16+
&.bx--data-table--compact {
17+
td {
18+
border-color: transparent;
19+
border-bottom: 1px solid var(--color-base03);
20+
vertical-align: middle;
21+
}
22+
tr:last-child td {
23+
border-bottom: none;
24+
}
2025
}
2126
}
2227
}

plugins/plugin-client-common/web/scss/components/Table/pagination.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ body[kui-theme-style] .bx--pagination {
3232

3333
.bx--pagination__button {
3434
fill: var(--color-text-01);
35-
padding: 0 0.875em;
35+
padding: 0 0.1875em;
3636

3737
&:focus {
3838
outline-color: var(--color-brand-03);
@@ -52,10 +52,10 @@ body[kui-theme-style] .bx--pagination {
5252

5353
.bx--select-input,
5454
.bx--pagination__button {
55-
border-color: var(--color-table-border3);
55+
border: none;
5656
}
5757

58-
.bx--pagination__button:hover {
58+
.bx--pagination__button:not(.bx--pagination__button--no-index):hover {
5959
background-color: var(--color-table-border3);
6060
}
6161
}

plugins/plugin-client-common/web/scss/components/Table/tables.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,10 @@ body .bx--data-table-container {
115115

116116
tbody {
117117
.bx--data-table--selected {
118+
background-color: var(--color-ui-03);
118119
td {
119120
color: var(--color-text-01);
120-
background-color: var(--color-ui-02);
121+
background-color: var(--color-ui-03);
121122
border-color: transparent;
122123
}
123124
}

0 commit comments

Comments
 (0)