From 6320ba4eb8c665a889cb31e3a4ebca951ae88415 Mon Sep 17 00:00:00 2001 From: JonasPfalzgraf <20913954+JosunLP@users.noreply.github.com> Date: Tue, 24 Mar 2026 18:59:55 +0100 Subject: [PATCH 01/17] feat: enhance accessibility and improve components - Added accessibility features to `bq-table`, including keyboard navigation for sortable columns and aria attributes for better screen reader support. - Updated `bq-tooltip` to automatically link trigger elements with `aria-describedby` for improved accessibility. - Enhanced `bq-progress` to include localized aria-labels and value text for better screen reader support. - Improved `bq-select` to handle dynamic options and maintain accessibility with proper aria attributes. - Added tests for accessibility features in `bq-tooltip`, `bq-select`, and `bq-progress`. - Updated documentation for `bq-table` and `bq-tooltip` to reflect new accessibility features. --- docs/components/progress.md | 6 +- docs/components/select.md | 58 +++++++---- docs/components/table.md | 52 +++++----- docs/components/tooltip.md | 1 + src/components/pagination/BqPagination.ts | 3 +- src/components/progress/BqProgress.ts | 71 ++++++++++--- src/components/select/BqSelect.ts | 119 ++++++++++++++++++++-- src/components/slider/BqSlider.ts | 3 + src/components/table/BqTable.ts | 107 +++++++++++++------ src/components/tooltip/BqTooltip.ts | 90 +++++++++++++++- src/i18n/en.ts | 3 + stories/select.stories.ts | 37 +++++-- stories/table.stories.ts | 33 ++++-- tests/progress.test.ts | 49 +++++++++ tests/select.test.ts | 80 +++++++++++++++ tests/slider-pagination.test.ts | 11 ++ tests/tabs-tooltip.test.ts | 24 ++++- 17 files changed, 622 insertions(+), 125 deletions(-) create mode 100644 tests/progress.test.ts create mode 100644 tests/select.test.ts diff --git a/docs/components/progress.md b/docs/components/progress.md index 86b914f..cc9527f 100644 --- a/docs/components/progress.md +++ b/docs/components/progress.md @@ -58,4 +58,8 @@ The `bq-progress` component is a determinate or indeterminate progress bar. ## Accessibility -The component uses a native `` element or appropriate ARIA roles to communicate progress to assistive technology. The `label` prop provides a screen-reader-friendly description. +The component exposes `role="progressbar"` on the visual track element. + +- Determinate progress sets `aria-valuenow`, `aria-valuemin`, `aria-valuemax`, and a localized `aria-valuetext`. +- Indeterminate progress omits the numeric value and instead uses `aria-busy="true"` with localized loading text. +- The `label` prop provides the accessible name. When omitted, a localized fallback label is used. diff --git a/docs/components/select.md b/docs/components/select.md index e263e69..295ce1a 100644 --- a/docs/components/select.md +++ b/docs/components/select.md @@ -1,6 +1,6 @@ # Select -The `bq-select` component is a dropdown selection input with label, error state, and size options. +The `bq-select` component is a dropdown selection input with label, hint text, error state, form participation, and size options. ## Basic Usage @@ -35,6 +35,16 @@ The `bq-select` component is a dropdown selection input with label, error state, ``` +## Preselected Value + +```html + + + + + +``` + ## Disabled ```html @@ -63,34 +73,42 @@ The `bq-select` component is a dropdown selection input with label, error state, ## Properties -| Property | Type | Default | Description | -|----------|------|---------|-------------| -| `label` | `string` | — | Select label | -| `value` | `string` | — | Currently selected value | -| `placeholder` | `string` | — | Placeholder text when no option is selected | -| `name` | `string` | — | Form field name | -| `disabled` | `boolean` | `false` | Disables the select | -| `required` | `boolean` | `false` | Marks the field as required | -| `error` | `string` | — | Error message displayed below the select | -| `size` | `sm \| md \| lg` | `md` | Select size | +| Property | Type | Default | Description | +| ------------- | ---------------- | ------- | ----------------------------------------------- | +| `label` | `string` | — | Select label | +| `value` | `string` | — | Currently selected value | +| `placeholder` | `string` | — | Placeholder text when no option is selected | +| `name` | `string` | — | Form field name | +| `disabled` | `boolean` | `false` | Disables the select | +| `required` | `boolean` | `false` | Marks the field as required | +| `error` | `string` | — | Error message displayed below the select | +| `hint` | `string` | — | Helpful supporting text shown below the control | +| `size` | `sm \| md \| lg` | `md` | Select size | ## Events -| Event | Detail | Description | -|-------|--------|-------------| +| Event | Detail | Description | +| ----------- | ------------------- | ------------------------------------- | | `bq-change` | `{ value: string }` | Fired when the selected value changes | ## Slots -| Slot | Description | -|------|-------------| +| Slot | Description | +| ----------- | ----------------------------------------- | | *(default)* | `