-
Notifications
You must be signed in to change notification settings - Fork 0
Improve action component accessibility and localized fallback UX #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
64cb54a
Initial plan
Copilot f14a741
feat: improve action component accessibility and i18n fallbacks
Copilot e450d14
chore: finalize accessibility and i18n action improvements
Copilot e47edf2
fix: refine button and icon-button link semantics
Copilot 0239136
fix: harden anchor action semantics
Copilot 9fa6158
fix: normalize button target handling
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| # Icon Button | ||
|
|
||
| Use `bq-icon-button` for compact icon-only actions such as refresh, close, open-menu, favorite, or toolbar controls. | ||
|
|
||
| ## Basic Usage | ||
|
|
||
| ```html | ||
| <bq-icon-button label="Open filters"> | ||
| <span aria-hidden="true">☰</span> | ||
| </bq-icon-button> | ||
| ``` | ||
|
|
||
| ## Title Fallback | ||
|
|
||
| If you already need a tooltip-like title, you can use `title` as the accessible-name fallback when `label` is omitted. If both are provided, `label` remains the primary accessible name. | ||
|
|
||
| ```html | ||
| <bq-icon-button title="Refresh results"> | ||
| <span aria-hidden="true">↻</span> | ||
| </bq-icon-button> | ||
| ``` | ||
|
|
||
| ## Loading State | ||
|
|
||
| ```html | ||
| <bq-icon-button label="Sync data" loading> | ||
| <span aria-hidden="true">⟳</span> | ||
| </bq-icon-button> | ||
| ``` | ||
|
|
||
| Loading icon buttons expose `aria-busy="true"` and attach a localized status description without changing the control's accessible name. | ||
|
|
||
| ## As a Link | ||
|
|
||
| ```html | ||
| <bq-icon-button | ||
| href="https://example.com/settings" | ||
| label="Open settings" | ||
| title="Settings" | ||
| > | ||
| <span aria-hidden="true">⚙</span> | ||
| </bq-icon-button> | ||
| ``` | ||
|
|
||
| ## Properties | ||
|
|
||
| | Property | Type | Default | Description | | ||
| |----------|------|---------|-------------| | ||
| | `variant` | `primary \| secondary \| outline \| ghost \| danger` | `ghost` | Visual style | | ||
| | `size` | `sm \| md \| lg` | `md` | Button size | | ||
| | `disabled` | `boolean` | `false` | Disables interaction | | ||
| | `loading` | `boolean` | `false` | Shows spinner and disables interaction | | ||
| | `label` | `string` | — | Preferred accessible label for the control | | ||
| | `title` | `string` | — | Optional tooltip and accessible-name fallback | | ||
| | `href` | `string` | — | Renders as `<a>` when set | | ||
|
|
||
| ## Events | ||
|
|
||
| | Event | Detail | Description | | ||
| |-------|--------|-------------| | ||
| | `bq-click` | `{ originalEvent: MouseEvent }` | Fired on click when not disabled/loading | | ||
|
|
||
| ## Slots | ||
|
|
||
| | Slot | Description | | ||
| |------|-------------| | ||
| | *(default)* | The icon content | | ||
|
|
||
| ## CSS Parts | ||
|
|
||
| | Part | Description | | ||
| |------|-------------| | ||
| | `button` | The inner `<button>` or `<a>` element | | ||
|
|
||
| ## Accessibility Notes | ||
|
|
||
| - Prefer `label` as the explicit accessible name. When `label` is omitted, `title` is used as the fallback name before the component falls back to a localized generic label. | ||
| - If neither `label` nor `title` is provided, the component falls back to a localized generic label so the control never becomes unnamed. | ||
| - Mark decorative icon content with `aria-hidden="true"` so screen readers announce only the control label. | ||
| - Prefer `bq-button` when the action should show visible text. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.