Skip to content

Commit d743afb

Browse files
authored
Merge pull request #149 from eviltester/icons
icons tidy
2 parents b1c5e68 + 3c43948 commit d743afb

25 files changed

Lines changed: 621 additions & 104 deletions

apps/web/images/.gitkeep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

apps/web/images/circle-question-solid.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

apps/web/images/readme.md

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

apps/web/src/tests/browser/app/abstractions/components/grid-editor.component.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@ class GridEditorComponent {
66
constructor(page) {
77
this.page = page;
88
this.container = page.locator('#main-grid-view');
9+
this.toolbar = this.container.locator('[data-role="grid-toolbar-root"]');
910
this.grid = page.locator('#myGrid');
1011
this.renderer = new GridRendererComponent(page, this.grid);
1112
this.header = new GridHeaderComponent(page, this.grid, this.renderer);
12-
this.addRowButton = page.getByRole('button', { name: 'Add Row', exact: true });
13-
this.addRowsAboveButton = page.getByRole('button', { name: 'Add Rows Above' });
14-
this.addRowsBelowButton = page.getByRole('button', { name: 'Add Rows Below' });
15-
this.deleteSelectedRowsButton = page.getByRole('button', { name: 'Delete Selected Rows' });
16-
this.quickFilterInput = page.getByLabel('Filter:');
17-
this.clearFiltersButton = page.getByRole('button', { name: 'Clear Filters' });
18-
this.clearSortButton = page.getByRole('button', { name: 'Clear Sort' });
19-
this.resetTableButton = page.getByRole('button', { name: 'Reset Table' });
20-
this.uniqueColumnNamesCheckbox = page.locator('#uniqueColumnNamesCheckbox');
13+
this.addRowButton = this.toolbar.getByRole('button', { name: 'Add Row', exact: true });
14+
this.addRowsAboveButton = this.toolbar.getByRole('button', { name: 'Add Rows Above' });
15+
this.addRowsBelowButton = this.toolbar.getByRole('button', { name: 'Add Rows Below' });
16+
this.deleteSelectedRowsButton = this.toolbar.getByRole('button', { name: 'Delete Selected Rows' });
17+
this.quickFilterInput = this.toolbar.getByLabel('Filter:');
18+
this.clearFiltersButton = this.toolbar.getByRole('button', { name: 'Clear Filters' });
19+
this.clearSortButton = this.toolbar.getByRole('button', { name: 'Clear Sort' });
20+
this.resetTableButton = this.toolbar.getByRole('button', { name: 'Reset Table' });
21+
this.uniqueColumnNamesCheckbox = this.toolbar.getByRole('checkbox', { name: 'Unique Column Names' });
2122
}
2223

2324
async expectVisible() {

apps/web/src/tests/browser/app/abstractions/components/grid-header.component.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@ class GridHeaderComponent {
3030
async clickAction(columnName, action) {
3131
const headerTitle = this._headerTitleByName(columnName);
3232
const actionTitleMap = {
33-
rename: 'rename',
34-
delete: 'delete',
35-
duplicate: 'duplicate',
36-
'add-left': 'add left',
37-
'add-right': 'add right',
38-
'sort-asc': 'Sort Asc',
39-
'sort-desc': 'Sort Desc',
40-
'sort-none': 'Clear Sort',
33+
rename: 'Rename column',
34+
delete: 'Delete column',
35+
duplicate: 'Duplicate column',
36+
'add-left': 'Add column left',
37+
'add-right': 'Add column right',
38+
'sort-asc': 'Sort ascending',
39+
'sort-desc': 'Sort descending',
40+
'sort-none': 'Clear sort',
4141
};
4242
const title = actionTitleMap[action] || action;
4343
const headerRoot = headerTitle.locator(`xpath=ancestor::*[contains(@class,'tabulator-col')]`);
44-
const actionLocator = headerRoot.locator(`[title="${title}"], [title*="${title}"]`).first();
44+
const actionLocator = headerRoot.locator(`[aria-label="${title}"], [title="${title}"]`).first();
4545
await actionLocator.click();
4646
}
4747

apps/web/src/tests/browser/app/functional/grid-editor/column-operations/add-columns.spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ test.describe('2. Column Operations', () => {
66
const { appPage, pageErrors } = await openApp(page);
77
const [base] = await appPage.gridEditor.header.getColumnNames();
88

9-
await expect(page.locator('#myGrid [title="add left"]')).toBeVisible();
10-
await expect(page.locator('#myGrid [title="rename"]')).toBeVisible();
11-
await expect(page.locator('#myGrid [title="delete"]')).toBeVisible();
12-
await expect(page.locator('#myGrid [title="duplicate"]')).toBeVisible();
13-
await expect(page.locator('#myGrid [title="add right"]')).toBeVisible();
9+
await expect(page.locator('#myGrid [aria-label="Add column left"]')).toBeVisible();
10+
await expect(page.locator('#myGrid [aria-label="Rename column"]')).toBeVisible();
11+
await expect(page.locator('#myGrid [aria-label="Delete column"]')).toBeVisible();
12+
await expect(page.locator('#myGrid [aria-label="Duplicate column"]')).toBeVisible();
13+
await expect(page.locator('#myGrid [aria-label="Add column right"]')).toBeVisible();
1414

1515
await appPage.gridEditor.header.addColumnLeft(base, 'Left Col');
1616
await expect.poll(async () => appPage.gridEditor.header.getColumnNames()).toEqual(['Left Col', base]);

apps/web/styles.css

Lines changed: 89 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,21 @@ details[open] ul li:last-child {
227227
padding-bottom: 10px;
228228
}
229229

230+
.instruction-item-icon {
231+
display: inline-flex;
232+
align-items: center;
233+
justify-content: center;
234+
width: 1.25rem;
235+
margin-right: 0.25rem;
236+
color: currentcolor;
237+
vertical-align: -0.2rem;
238+
}
239+
240+
.instruction-action-icon {
241+
width: 1rem;
242+
height: 1rem;
243+
}
244+
230245
.appheading {
231246
text-align: center;
232247
margin: 0px;
@@ -358,6 +373,15 @@ Custom header styles for default items
358373
.headerWrapper {
359374
width: 100%;
360375
}
376+
377+
.app-icon {
378+
display: inline-block;
379+
flex: none;
380+
color: currentcolor;
381+
vertical-align: -0.15em;
382+
pointer-events: none;
383+
}
384+
361385
.customHeaderTop {
362386
display: flex;
363387
}
@@ -373,28 +397,26 @@ Custom header styles for default items
373397
margin: 0 3px 0 3px;
374398
}
375399

400+
.customFilterMenuButton {
401+
flex: 0;
402+
}
403+
376404
.customHeaderLabel {
377405
flex: 3;
378406
text-align: center;
379407
}
380408

381409
.customSortDownLabel {
382410
margin: 0 0 0 6px;
383-
padding: 0 2px;
384-
cursor: pointer;
385411
}
386412

387413
.customSortUpLabel {
388414
margin: 0;
389-
padding: 0 2px;
390-
cursor: pointer;
391415
}
392416

393417
.customSortRemoveLabel {
394418
margin: 0 0 0 2px;
395-
padding: 0 2px;
396419
font-size: 11px;
397-
cursor: pointer;
398420
}
399421

400422
.active {
@@ -403,10 +425,53 @@ Custom header styles for default items
403425

404426
/* The grid heading control buttons */
405427
.headerbuttons {
428+
display: inline-flex;
429+
align-items: center;
430+
justify-content: center;
431+
gap: 2px;
432+
width: 100%;
406433
text-align: center;
407434
color: #1e4a01;
408435
}
409436

437+
.header-icon-button {
438+
display: inline-flex;
439+
align-items: center;
440+
justify-content: center;
441+
width: 1.35rem;
442+
height: 1.35rem;
443+
padding: 0;
444+
color: inherit;
445+
background: transparent;
446+
border: 1px solid transparent;
447+
border-radius: 3px;
448+
cursor: pointer;
449+
line-height: 1;
450+
}
451+
452+
.header-icon-button:hover,
453+
.header-icon-button:focus-visible {
454+
background: color-mix(in srgb, currentcolor 10%, transparent);
455+
border-color: color-mix(in srgb, currentcolor 35%, transparent);
456+
}
457+
458+
.customHeaderDeleteButton:hover,
459+
.customHeaderDeleteButton:focus-visible,
460+
.header-icon-button[data-action='delete']:hover,
461+
.header-icon-button[data-action='delete']:focus-visible {
462+
color: #8d1b1b;
463+
}
464+
465+
.header-action-icon {
466+
width: 0.95rem;
467+
height: 0.95rem;
468+
}
469+
470+
.header-sort-icon {
471+
width: 0.8rem;
472+
height: 0.8rem;
473+
}
474+
410475
/* Docs */
411476

412477
.bodycontent {
@@ -472,13 +537,17 @@ Custom header styles for default items
472537
/* Styling for inline application help */
473538
/* use in a div or span to avoid having a border, which would happen on img if no src attribute present */
474539
.helpicon {
475-
background: url('./images/circle-question-solid.svg');
476540
width: 1em;
477541
height: 1em;
478-
display: inline-block;
479-
background-repeat: no-repeat;
480-
background-position: center;
481-
background-size: contain;
542+
display: inline-flex;
543+
align-items: center;
544+
justify-content: center;
545+
color: currentcolor;
546+
}
547+
548+
.helpicon-svg {
549+
width: 1em;
550+
height: 1em;
482551
}
483552

484553
button.helpicon {
@@ -488,14 +557,13 @@ button.helpicon {
488557
padding: 0;
489558
margin: 0;
490559
background-color: transparent;
491-
vertical-align: middle;
492-
line-height: 1;
560+
line-height: 0;
493561
cursor: pointer;
494562
flex: 0 0 auto;
495563
}
496564

497565
body.theme-dark .helpicon {
498-
filter: invert(1) brightness(1.2);
566+
color: var(--page-text);
499567
}
500568

501569
.helplink {
@@ -587,26 +655,10 @@ body.theme-dark .helpicon {
587655
}
588656

589657
.generator-file-icon {
590-
display: inline-block;
591-
width: 0.8rem;
592-
height: 0.95rem;
658+
width: 1rem;
659+
height: 1rem;
593660
margin-right: 0.4rem;
594-
vertical-align: -0.1rem;
595-
background: var(--panel-bg);
596-
border: 1px solid #d8f3dc;
597-
border-radius: 1px;
598-
position: relative;
599-
}
600-
601-
.generator-file-icon::after {
602-
content: '';
603-
position: absolute;
604-
top: -1px;
605-
right: -1px;
606-
width: 0.28rem;
607-
height: 0.28rem;
608-
background: #74c69d;
609-
clip-path: polygon(100% 0, 0 0, 100% 100%);
661+
vertical-align: -0.2rem;
610662
}
611663

612664
.generator-options-wrapper {
@@ -860,8 +912,12 @@ body.theme-dark .generator-status-text[data-severity='info'] {
860912
}
861913

862914
.icon-button {
915+
display: inline-flex;
916+
align-items: center;
917+
justify-content: center;
863918
min-width: 2rem;
864919
height: 2rem;
920+
padding: 0;
865921
line-height: 1;
866922
color: var(--button-text);
867923
}

0 commit comments

Comments
 (0)