Skip to content

Conversation

@mgadewoll
Copy link
Contributor

@mgadewoll mgadewoll commented Mar 27, 2025

Summary

closes #8429

Important

This PR includes changes from this previous PR to enable the wanted behavior.
✅ The previous PR should be merged first and this PR rebased after.

This PR adds color labels to EuiColorPickerSwatch to ensure that colors can be distinguished by more than just color itself (WCAG 1.4.1). The tooltip is shown on hover and focus of the swatch and is by default always enabled.

Screenshot 2025-03-27 at 16 42 21

QA

  • verify color label tooltips are shown on hover/focus of color swatches in EuiColorPicker (docs)
  • verify the tooltip content is not read by screen readers for EuiColorPickerSwatch (storybook) (instead only the trigger aria-label is read as it contains all required information)

General checklist

  • Browser QA
    • Checked in both light and dark modes
    • Checked in both MacOS and Windows high contrast modes
    • Checked in mobile
    • Checked in Chrome, Safari, Edge, and Firefox
    • Checked for accessibility including keyboard-only and screenreader modes
  • Docs site QA
  • Code quality checklist
  • Release checklist
    • A changelog entry exists and is marked appropriately.
    • If applicable, added the breaking change issue label (and filled out the breaking change checklist)
  • Designer checklist
    • If applicable, file an issue to update EUI's Figma library with any corresponding UI changes. (This is an internal repo, if you are external to Elastic, ask a maintainer to submit this request)

@mgadewoll mgadewoll self-assigned this Mar 27, 2025
@mgadewoll mgadewoll marked this pull request as ready for review March 28, 2025 08:50
@mgadewoll mgadewoll requested a review from a team as a code owner March 28, 2025 08:50
@acstll acstll self-requested a review March 28, 2025 10:16
Copy link
Contributor

@acstll acstll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

- adds prop showToolTip for conditional toggling, by default we do want the tooltips to render
- these usages are not used as color swatches but rather as decor element to demonstrate styling
@mgadewoll mgadewoll force-pushed the colorpicker/8429-color-swatch-labels branch from 060b673 to d06444b Compare March 28, 2025 16:57
@kibanamachine
Copy link

Preview staging links for this PR:

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @mgadewoll

@mgadewoll mgadewoll merged commit 46d9533 into elastic:main Mar 28, 2025
5 checks passed
weronikaolejniczak added a commit to elastic/kibana that referenced this pull request Apr 10, 2025
> [!Note]
> This PR is a manual backport of the already merged
#217491

`101.0.1` ⏩ `101.3.0-classic.0`

[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)

## Package updates

### `@elastic/eui`

#### [`v101.3.0`](https://github.com/elastic/eui/releases/v101.3.0)

- Updated 78 existing and added two new glyphs (`code` and
`checkCircle`) for `EuiIcon`
([#8530](elastic/eui#8530))
- Changed `gutterSize` to `m` between right side items on
`EuiPageHeader` ([#8529](elastic/eui#8529))

**Bug fixes**

- Fixed a visual bug on disabled `EuiButton` in high contrast mode where
wrong text colors were applied
([#8550](elastic/eui#8550))

#### [`v101.2.0`](https://github.com/elastic/eui/releases/v101.2.0)

- Added `showToolTip` prop on `EuiColorPickerSwatch`
([#8512](elastic/eui#8512))

**Bug fixes**

- Fixed a visual issue of overlapping borders for layered `EuiPanel`s
([#8519](elastic/eui#8519))
- Fixes wrong `colorMode` styling for the search in `EuiHeader` with
`theme="dark"` ([#8496](elastic/eui#8496))

**Accessibility**

- Improved the accessibility of `EuiColorPicker` by adding color label
tooltips on hover and focus for color swatches
([#8512](elastic/eui#8512))
- Added `disableScreenReaderOutput` prop on `EuiToolTip` to manually
control if the tooltip content should be read when focusing the trigger.
This prevents duplicate screen reader output when the tooltip content
and `aria-label` on the trigger element have the same text content.
([#8508](elastic/eui#8508))
- Improves text color contrast for `EuiButton` with `color="warning"` in
high contrast mode ([#8496](elastic/eui#8496))
- Improves contrast and visible distinction of the following components
in high contrast mode:
([#8496](elastic/eui#8496))
  - `EuiCode`
  - `EuiBadge`
  - `EuiBetaBadge`
  - `EuiNotificationBadge`

**Dependency updates**

- Updated `prismjs` to v1.30.0
([#8506](elastic/eui#8506))

#### [`v101.1.0`](https://github.com/elastic/eui/releases/v101.1.0)

- Updates `EuiTableRow` styles to check support for `:has(+)` selector
([#8498](elastic/eui#8498))


<!--ONMERGE {"backportTargets":["9.0"]} ONMERGE-->

---------

Co-authored-by: Weronika Olejniczak <weronika.olejniczak@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[EuiColorPicker][A11y] Add accessible color swatch labels

4 participants