Skip to content

Commit c6892ed

Browse files
committed
feat(web-ts-results): make dropdown independent
1 parent 64311ba commit c6892ed

File tree

19 files changed

+219
-216
lines changed

19 files changed

+219
-216
lines changed

webdriver-ts-results/src/App.css

Lines changed: 36 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,43 @@
11
:root {
2-
box-sizing: border-box;
2+
--border-color: #ccc;
33
}
44
*,
5-
*::before,
6-
*::after {
7-
box-sizing: inherit;
5+
::before,
6+
::after {
7+
box-sizing: border-box;
88
}
9+
910
body {
1011
font-family: Helvetica, Arial, sans-serif;
1112
font-size: 14px;
1213
margin: 10px;
1314
}
15+
1416
a,
1517
a:active,
1618
a:hover {
1719
text-decoration: none;
1820
}
21+
1922
button,
2023
select {
2124
font-size: 14px;
2225
}
23-
.selectBar {
26+
2427
background-color: #fafafa;
25-
border-top: 1px solid #ccc;
26-
border-bottom: 1px solid #ccc;
28+
border-top: 1px solid var(--border-color);
29+
border-bottom: 1px solid var(--border-color);
2730
}
2831
select {
29-
border: 1px solid #ccc;
32+
border: 1px solid var(--border-color);
3033
border-radius: 4px;
3134
height: 29px;
3235
background: #fff;
3336
}
34-
.header-row {
35-
margin: 20px 0;
36-
}
37-
.dropdown-container > .shutter,
38-
.dropdown-container > .dropdown-menu {
39-
display: none;
40-
}
41-
.open > .shutter,
42-
.open > .dropdown-menu {
43-
display: block;
44-
}
45-
.dropdown-menu > .section {
46-
position: relative;
47-
}
48-
.open > .dropdown-menu {
49-
z-index: 1000;
50-
position: absolute;
51-
background: #fff;
52-
border: 1px solid #ccc;
53-
border-radius: 4px;
54-
box-shadow: 4px 4px 5px 5px rgba(0, 0, 0, 0.2);
55-
padding: 10px;
56-
}
57-
.dropdown,
58-
.dropdown:focus {
59-
border: 1px solid #ccc;
60-
border-radius: 4px;
61-
padding: 5px 10px;
62-
outline: none;
63-
box-shadow: 0px 0px 2px 2px rgba(0, 0, 0, 0);
64-
transition: all 0.5s;
65-
}
66-
.dropdown.open {
67-
box-shadow: 0px 0px 2px 2px rgba(0, 0, 0, 0.2);
68-
}
69-
70-
.dropdown > .caret {
71-
width: 10px;
72-
height: 5px;
73-
border-left: 5px solid transparent;
74-
border-right: 5px solid transparent;
75-
border-top: 5px solid #ccc;
76-
display: inline-block;
77-
}
78-
79-
.shutter {
80-
position: fixed;
81-
top: 0;
82-
left: 0;
83-
right: 0;
84-
bottom: 0;
85-
z-index: 999;
86-
display: none;
87-
}
8837

8938
input + label {
9039
margin-left: 5px;
9140
}
92-
93-
.float-rt {
94-
position: absolute;
95-
top: 10px;
96-
right: 10px;
97-
}
98-
99-
.grid {
100-
column-count: 3;
101-
}
102-
10341
.hspan {
10442
display: inline-block;
10543
width: 10px;
@@ -157,20 +95,24 @@ table.results th {
15795
td {
15896
text-align: center;
15997
}
98+
16099
.rowCount {
161100
font-size: 10px;
162101
}
102+
163103
.deviation {
164104
font-size: 8px;
165105
padding-left: 5px;
166106
}
167-
.deviation:before {
107+
.deviation::before {
168108
content: "± ";
169109
}
110+
170111
.factor {
171112
font-size: 8px;
172113
}
173-
.sortKey {
114+
115+
.sort-key {
174116
text-decoration: underline;
175117
}
176118

@@ -190,44 +132,49 @@ dd {
190132
padding: 0;
191133
margin: 0;
192134
}
135+
193136
.with-issues {
194137
background-color: #faa;
195138
}
196139

197-
.textButton {
198-
color: rgb(0, 0, 238);
140+
.button {
141+
cursor: pointer;
142+
}
143+
144+
.button__text {
145+
color: #00e;
199146
font-size: inherit;
200147
border: none;
201148
background: none;
202-
outline-style: none;
203-
cursor: pointer;
204149
}
205150

206-
.iconbutton {
207-
border: 1px solid #ccc;
151+
.button__text:disabled {
152+
color: #666;
153+
font-weight: normal;
154+
}
155+
156+
.button__icon {
157+
border: 1px solid var(--border-color);
208158
border-radius: 4px;
209-
padding: 2px 2px;
210-
outline: none;
211-
box-shadow: 0px 0px 2px 2px rgb(0 0 0 / 0%);
159+
padding: 2px;
212160
width: 26px;
213161
}
214-
.iconbutton:active {
162+
163+
.button__icon:active {
215164
border: 1px solid #888;
216165
}
166+
217167
.header-row {
218168
display: flex;
219169
}
220170
.header-row > * {
221171
align-self: center;
222172
}
223173

224-
button:disabled.textButton {
225-
color: #666;
226-
font-weight: normal;
227-
}
228174
.error {
229175
background-color: #f99;
230176
}
177+
231178
.warning {
232179
background-color: #ff6;
233180
}

webdriver-ts-results/src/components/BoxPlotTable/BoxPlotTableRow.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,9 @@ const BoxPlotTableRow = ({
4141
<tr key={benchmark.id} style={{ height: 400 }}>
4242
<th className="benchname">
4343
<button
44-
className={
45-
currentSortKey === benchmark.id
46-
? "sortKey textButton"
47-
: "textButton"
48-
}
44+
className={`button button__text ${
45+
currentSortKey === benchmark.id ? "sort-key" : ""
46+
}`}
4947
onClick={handleSortByBenchmarkResults}
5048
aria-label="Sort by benchmark results (from best to worst)"
5149
>

webdriver-ts-results/src/components/BoxPlotTable/index.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,9 @@ const BoxPlotTable = ({
3838
<tr>
3939
<th className="benchname">
4040
<button
41-
className={
42-
currentSortKey === SORT_BY_NAME
43-
? "sortKey textButton"
44-
: "textButton"
45-
}
41+
className={`button button__text ${
42+
currentSortKey === SORT_BY_NAME ? "sort-key" : ""
43+
}`}
4644
aria-label="Sort frameworks in ascending order (asc)"
4745
onClick={handleSortByName}
4846
>

webdriver-ts-results/src/components/DropDown/index.tsx

Lines changed: 0 additions & 52 deletions
This file was deleted.

webdriver-ts-results/src/components/selection/BenchmarkSelector/BenchmarkSelectorCategory.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react";
22
import { BenchmarkType } from "../../../Common";
33
import { useRootStore } from "../../../reducer";
4-
import DropDownContents from "../../DropDown/DropDownContents";
4+
import SelectorContentContainer from "../SelectorContentContainer";
55
import BenchmarkSelectorList from "./BenchmarkSelectorList";
66

77
interface Props {
@@ -26,19 +26,19 @@ const BenchmarkSelectorCategory = ({ label, benchmarkType }: Props) => {
2626
const selectBenchmark = useRootStore((state) => state.selectBenchmark);
2727

2828
return (
29-
<DropDownContents
29+
<SelectorContentContainer
3030
isNoneSelected={isNoneSelected(benchmarkType)}
3131
areAllSelected={areAllSelected(benchmarkType)}
3232
selectNone={() => selectAllBenchmarks(benchmarkType, false)}
3333
selectAll={() => selectAllBenchmarks(benchmarkType, true)}
34+
label={label}
3435
>
35-
<h3>{label}</h3>
3636
<BenchmarkSelectorList
3737
isSelected={(benchmark) => selectedBenchmarks.has(benchmark)}
3838
select={(benchmark, add) => selectBenchmark(benchmark, add)}
3939
benchmarks={benchmarks}
4040
/>
41-
</DropDownContents>
41+
</SelectorContentContainer>
4242
);
4343
};
4444

webdriver-ts-results/src/components/selection/BenchmarkSelector/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import React from "react";
22
import { BenchmarkType } from "../../../Common";
3-
import DropDown from "../../DropDown";
3+
import Dropdown from "../../ui/Dropdown";
44
import BenchmarkSelectorCategory from "./BenchmarkSelectorCategory";
55

66
const BenchmarkSelector = () => {
77
console.log("BenchmarkSelector");
88

99
return (
10-
<DropDown label="Which benchmarks?" width="300px">
10+
<Dropdown label="Which benchmarks?" width="300px">
1111
<BenchmarkSelectorCategory
1212
benchmarkType={BenchmarkType.CPU}
1313
label="Duration"
@@ -20,7 +20,7 @@ const BenchmarkSelector = () => {
2020
benchmarkType={BenchmarkType.MEM}
2121
label="Memory"
2222
/>
23-
</DropDown>
23+
</Dropdown>
2424
);
2525
};
2626

webdriver-ts-results/src/components/selection/CopyPasteSelection.tsx

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,22 @@ const CopyPasteSelection = () => {
8181
return (
8282
<>
8383
<p>Copy/paste current selection</p>
84-
<div className="hspan" />
85-
<button
86-
className="iconbutton"
87-
onClick={copy}
88-
aria-label="Copy selected frameworks and benchmarks"
89-
>
90-
<CopyIcon></CopyIcon>
91-
</button>
92-
<button
93-
className="iconbutton"
94-
onClick={handlePasteFromClipboard}
95-
aria-label="Paste selected items (or use ctrl/cmd + v for firefox)"
96-
>
97-
<PasteIcon></PasteIcon>
98-
</button>
84+
<div>
85+
<button
86+
className="button__icon"
87+
onClick={copy}
88+
aria-label="Copy selected frameworks and benchmarks"
89+
>
90+
<CopyIcon></CopyIcon>
91+
</button>
92+
<button
93+
className="button__icon"
94+
onClick={handlePasteFromClipboard}
95+
aria-label="Paste selected items (or use ctrl/cmd + v for firefox)"
96+
>
97+
<PasteIcon></PasteIcon>
98+
</button>
99+
</div>
99100
</>
100101
);
101102
};

0 commit comments

Comments
 (0)