Skip to content

Commit bc97bb3

Browse files
committed
Accessibility changes #1837
1 parent 440f50c commit bc97bb3

19 files changed

+62
-18
lines changed

src/docs/Navigation.svelte

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@
6060
><div class="flex justify-center py-2">
6161
<LightSwitch />
6262
</div>
63-
<AppRailTile label="General" title="Tile" value={'general'} on:click={onListItemClick}
63+
<AppRailTile label="General" title="General" value={'general'} on:click={onListItemClick}
6464
><i class="fa-solid fa-screwdriver-wrench text-2xl" /></AppRailTile
6565
>
66-
<AppRailTile label="Theme" title="Tile" value={'theme'} on:click={onListItemClick}
66+
<AppRailTile label="Theme" title="Theme" value={'theme'} on:click={onListItemClick}
6767
><i class="fa-solid fa-code-compare text-2xl" /></AppRailTile
6868
>
69-
<AppRailTile label="Components" title="Tile" value={'components'} on:click={onListItemClick}
69+
<AppRailTile label="Components" title="Components" value={'components'} on:click={onListItemClick}
7070
><i class="fa-solid fa-list-check text-2xl" /></AppRailTile
7171
>
7272
</svelte:fragment>
@@ -85,8 +85,8 @@
8585
<nav class="list-nav">
8686
<ul>
8787
{#each list as { href, label, badge }}
88-
<li on:click={onListItemClick} on:keypress>
89-
<a {href} class={classesActive(href)} data-sveltekit-preload-data="hover">
88+
<li>
89+
<a {href} class={classesActive(href)} data-sveltekit-preload-data="hover" on:click={onListItemClick} on:keypress>
9090
<span class="flex-auto">{@html label}</span>
9191
{#if badge}<span class="badge variant-filled-secondary">{badge}</span>{/if}
9292
</a>

src/lib/components/CodeEditor/CodeEditor.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
<div class="flex gap-2">
101101
<button
102102
class="btn variant-filled-warning"
103+
title="Reset"
103104
id="{id}-reset"
104105
on:click|preventDefault={() => modalStore.trigger(modal)}
105106
><Fa icon={faArrowRotateLeft} /></button
@@ -108,6 +109,7 @@
108109
class="btn border"
109110
class:bg-slate-700={dark}
110111
class:bg-white={!dark}
112+
title="Toggle dark mode"
111113
id="{id}-toggle"
112114
on:click|preventDefault={() => (dark = !dark)}
113115
>
@@ -124,11 +126,13 @@
124126
<div class="flex gap-2">
125127
<button
126128
class="btn variant-filled-warning"
129+
title="Cancel"
127130
id="{id}-cancel"
128131
on:click|preventDefault={() => dispatch('cancel')}><Fa icon={faXmark} /></button
129132
>
130133
<button
131134
class="btn variant-filled-primary"
135+
title="Save"
132136
id="{id}-save"
133137
disabled={!isValid}
134138
on:click|preventDefault={() => dispatch('save')}><Fa icon={faSave} /></button

src/lib/components/File/FileUploader.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@
193193
{/if}
194194
</div>
195195

196-
<button id={submitBt} color="primary" style="display:none"><Fa icon={faSave} /></button>
196+
<button title="Submit" id={submitBt} color="primary" style="display:none"><Fa icon={faSave} /></button>
197197
{:else}
198198
<!-- while data is not loaded show a loading information -->
199199

src/lib/components/Table/ColumnsMenu.svelte

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
<button
1616
type="button"
17+
title="Hide or show columns"
1718
class="btn btn-sm variant-filled-primary rounded-full order-last"
1819
use:popup={popupCombobox}>Columns</button
1920
>
@@ -24,8 +25,10 @@
2425
>
2526
{#each columns as column}
2627
<div class="flex gap-3 items-center">
28+
<label for={column.id} class="cursor-pointer" title={column.label}></label>
2729
<input
2830
type="checkbox"
31+
id = {column.id}
2932
bind:checked={column.visible}
3033
disabled={columns.filter((c) => c.visible).length === 1 && column.visible}
3134
/>

src/lib/components/Table/TableContent.svelte

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,19 +394,21 @@
394394
} else {
395395
sendModel.q = searchValue;
396396
}
397-
397+
398398
$filterValue = searchValue;
399399
}}
400400
>
401401
<div class="relative w-full flex items-center">
402402
<input
403403
class="input p-2 border border-primary-500"
404404
type="text"
405+
title="Search within all table rows"
405406
bind:value={searchValue}
406407
placeholder="Search rows..."
407408
id="{tableId}-search"
408409
/><button
409410
type="reset"
411+
title="Clear search"
410412
id="{tableId}-searchReset"
411413
class="absolute right-3 items-center"
412414
on:click|preventDefault={() => {
@@ -423,6 +425,7 @@
423425
</div>
424426
<button
425427
type="submit"
428+
title="Search"
426429
id="{tableId}-searchSubmit"
427430
class="btn variant-filled-primary"
428431
on:click|preventDefault={() => {
@@ -448,6 +451,7 @@
448451
{#if toggle}
449452
<SlideToggle
450453
name="slider-label"
454+
label="Fit to screen"
451455
active="bg-primary-500"
452456
size="sm"
453457
checked={fitToScreen}
@@ -461,6 +465,7 @@
461465
{#if resizable !== 'none'}
462466
<button
463467
type="button"
468+
title="Reset column and row sizing"
464469
class="btn btn-sm variant-filled-primary rounded-full order-last"
465470
on:click|preventDefault={() =>
466471
resetResize($headerRows, $pageRows, tableId, columns, resizable)}
@@ -470,6 +475,7 @@
470475
{#if exportable}
471476
<button
472477
type="button"
478+
title="Export table data as CSV"
473479
class="btn btn-sm variant-filled-primary rounded-full order-last"
474480
on:click|preventDefault={() => exportAsCsv(tableId, $exportedData)}
475481
>Export as CSV</button
@@ -486,6 +492,7 @@
486492
{...$tableAttrs}
487493
class="table table-auto table-compact bg-tertiary-500/30 dark:bg-tertiary-900/10 overflow-clip"
488494
id="{tableId}-table"
495+
title="Table"
489496
>
490497
<!-- If table height is provided, making the top row sticky -->
491498
<thead class={height != null && $pageRows.length > 0 ? `sticky top-0` : ''}>
@@ -511,6 +518,8 @@
511518
<div class="flex gap-1 whitespace-pre-wrap">
512519
<!-- Adding sorting config and styling -->
513520
<span
521+
role="button"
522+
tabindex="0"
514523
class:underline={props.sort.order}
515524
class:normal-case={cell.id !== cell.label}
516525
class:cursor-pointer={!props.sort.disabled}

src/lib/components/Table/TableFilter.svelte

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@
238238
class:variant-filled-primary={active}
239239
class="btn w-max p-2"
240240
type="button"
241+
title="Filter"
241242
use:popup={popupFeatured}
242243
id="{popupId}-button"
243244
>
@@ -249,6 +250,7 @@
249250
<button
250251
class="btn variant-filled-primary btn-sm"
251252
type="button"
253+
title="Clear Filters"
252254
on:click|preventDefault={() => {
253255
// Set the defaults when cleared
254256
clearFilters();
@@ -281,7 +283,10 @@
281283
</select>
282284
{#if dropdowns.length > 1}
283285
<div
286+
role="button"
287+
tabindex="0"
284288
class="btn variant-filled-warning btn-sm h-full"
289+
title="Remove filter"
285290
on:click|preventDefault={() => removeFilter(dropdown.option)}
286291
on:keydown|preventDefault={() => removeFilter(dropdown.option)}
287292
>
@@ -293,13 +298,15 @@
293298
{#if type === 'number' || type === 'string'}
294299
<input
295300
type="text"
301+
title="Filter value"
296302
class="input p-1 border border-primary-500"
297303
on:input={(e) => valueChangeHandler(e, index)}
298304
bind:value={dropdown.value}
299305
/>
300306
{:else}
301307
<input
302308
type="date"
309+
title="Filter value"
303310
class="input p-1 border border-primary-500"
304311
on:input={(e) => valueChangeHandler(e, index)}
305312
bind:value={dropdown.formValue}
@@ -315,6 +322,8 @@
315322
{#if remainingFilters.length}
316323
<div
317324
class="btn variant-filled-secondary btn-sm cursor-pointer"
325+
role="button"
326+
tabindex="0"
318327
on:click|stopPropagation={() => {
319328
addFilter(remainingFilters[0].value, undefined);
320329
}}
@@ -328,6 +337,7 @@
328337
<button
329338
class="btn variant-filled-primary btn-sm"
330339
type="button"
340+
title="Apply"
331341
on:click|preventDefault={() => {
332342
$pageIndex = 0;
333343
$filterValue = $filters[id];

src/lib/components/Table/TableFilterServer.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,8 @@
272272
</select>
273273
{#if dropdowns.length > 1}
274274
<div
275+
role="button"
276+
tabindex="0"
275277
class="btn variant-filled-warning btn-sm h-full"
276278
on:click|preventDefault={() => removeFilter(dropdown.option)}
277279
on:keydown|preventDefault={() => removeFilter(dropdown.option)}
@@ -313,6 +315,8 @@
313315
{#if remainingFilters.length}
314316
<div
315317
class="btn variant-filled-secondary btn-sm cursor-pointer"
318+
role="button"
319+
tabindex="0"
316320
on:click|stopPropagation={() => {
317321
addFilter(remainingFilters[0].value, undefined);
318322
}}

src/lib/components/Table/TablePagination.svelte

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
{/each}
6363
</select> -->
6464

65-
<button class="btn variant-filled-primary w-20 justify-between" use:popup={pageSizePopup}>
65+
<button class="btn variant-filled-primary w-20 justify-between" title="Change page size" use:popup={pageSizePopup}>
6666
<span class="capitalize font-semibold">{pageSizeDropdownValue}</span>
6767
<Fa icon={faChevronDown} size="xs" />
6868
</button>
@@ -81,6 +81,7 @@
8181
<div class="flex justify-center gap-1">
8282
<button
8383
class="btn btn-sm variant-filled-primary"
84+
title="Go to first page"
8485
on:click|preventDefault={goToFirstPage}
8586
disabled={goToFirstPageDisabled}
8687
id="{id}-first"
@@ -89,26 +90,30 @@
8990
>
9091
<button
9192
class="btn btn-sm variant-filled-primary"
93+
title="Go to previous page"
9294
id="{id}-previous"
9395
on:click|preventDefault={goToPreviousPage}
9496
disabled={goToPreviousPageDisabled}><Fa icon={faAngleLeft} /></button
9597
>
9698
<input
9799
type="number"
98100
class="input border border-primary-500 rounded flex w-24"
101+
title="Go to page"
99102
value={$pageIndex + 1}
100103
max={$pageCount}
101104
min={1}
102105
on:change={handleChange}
103106
/>
104107
<button
105108
class="btn btn-sm variant-filled-primary"
109+
title="Go to next page"
106110
id="{id}-next"
107111
on:click|preventDefault={goToNextPage}
108112
disabled={goToNextPageDisabled}><Fa icon={faAngleRight} /></button
109113
>
110114
<button
111115
class="btn btn-sm variant-filled-primary"
116+
title="Go to last page"
112117
id="{id}-last"
113118
on:click|preventDefault={goToLastPage}
114119
disabled={goToLastPageDisabled}><Fa icon={faAnglesRight} /></button

src/lib/components/Table/TablePaginationServer.svelte

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
<div class="flex justify-center gap-1">
8585
<button
8686
class="btn btn-sm variant-filled-primary"
87+
title="Go to first page"
8788
on:click|preventDefault={() => goTo('first')}
8889
disabled={goToFirstPageDisabled}
8990
id="{id}-first"
@@ -92,26 +93,30 @@
9293
>
9394
<button
9495
class="btn btn-sm variant-filled-primary"
96+
title="Go to previous page"
9597
id="{id}-previous"
9698
on:click|preventDefault={() => goTo('previous')}
9799
disabled={goToPreviousPageDisabled}><Fa icon={faAngleLeft} /></button
98100
>
99101
<input
100102
type="number"
101103
class="input border border-primary-500 rounded flex w-24"
104+
title="Go to page"
102105
value={$pageIndex + 1}
103106
max={pageCount}
104107
min={1}
105108
on:change={handleChange}
106109
/>
107110
<button
108111
class="btn btn-sm variant-filled-primary"
112+
title="Go to next page"
109113
id="{id}-next"
110114
on:click|preventDefault={() => goTo('next')}
111115
disabled={goToNextPageDisabled}><Fa icon={faAngleRight} /></button
112116
>
113117
<button
114118
class="btn btn-sm variant-filled-primary"
119+
title="Go to last page"
115120
id="{id}-last"
116121
on:click|preventDefault={() => goTo('last')}
117122
disabled={goToLastPageDisabled}><Fa icon={faAnglesRight} /></button

src/lib/components/form/CheckboxKvPList.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@
1515

1616
<InputContainer {id} label={title} {feedback} {required} {help}>
1717
{#each source as item}
18-
<label class="flex items-center space-x-2" for={key}>
18+
<label class="flex items-center space-x-2" for={item.key}>
1919
<input
2020
class="checkbox"
2121
type="checkbox"
2222
bind:group={target}
2323
checked={item.key}
2424
value={item.key}
25+
id={item.key}
2526
/>
2627
<p>{item.value}</p>
2728
</label>

0 commit comments

Comments
 (0)