From a9b87e3ec6f58bafb399485f7fcf9a449661354d Mon Sep 17 00:00:00 2001 From: Pedro Menezes Date: Fri, 19 Jun 2026 17:23:48 +0100 Subject: [PATCH 1/2] fix: improve accessibility across components and docs --- .changeset/accessibility-improvements.md | 38 ++ .../src/components/KumoMenuIcon.tsx | 40 +- .../src/components/SearchDialog.tsx | 26 +- .../src/components/SidebarNav.tsx | 518 +++++++++++++----- .../src/components/ThemeToggle.tsx | 8 +- .../src/components/demos/AutocompleteDemo.tsx | 39 +- .../src/components/demos/BreadcrumbsDemo.tsx | 20 + .../components/demos/Chart/ChartCard.astro | 2 +- .../demos/Chart/SankeyChartDemo.tsx | 4 +- .../src/components/demos/ComboboxDemo.tsx | 97 +++- .../src/components/demos/DialogDemo.tsx | 1 + .../src/components/demos/HomeGrid.tsx | 61 ++- .../src/components/demos/KumoPressDemo.tsx | 27 +- .../src/components/demos/PageHeaderDemo.tsx | 24 +- .../components/demos/SensitiveInputDemo.tsx | 23 + .../src/components/demos/SwitchDemo.tsx | 22 +- .../src/components/demos/TableDemo.tsx | 18 +- .../src/components/demos/TabsDemo.tsx | 10 +- .../src/components/docs/StickyDocHeader.tsx | 12 +- .../src/components/docs/TableOfContents.tsx | 11 +- .../src/layouts/MainLayout.astro | 42 ++ .../src/pages/blocks/page-header.mdx | 4 +- .../src/pages/charts/custom.mdx | 21 + .../src/pages/charts/sankey.astro | 35 +- .../src/pages/charts/timeseries.mdx | 74 ++- .../src/pages/components/autocomplete.mdx | 36 +- .../src/pages/components/banner.mdx | 48 ++ .../src/pages/components/breadcrumbs.mdx | 14 + .../src/pages/components/button.mdx | 10 +- .../src/pages/components/clipboard-text.mdx | 47 ++ .../src/pages/components/combobox.mdx | 93 +++- .../src/pages/components/command-palette.mdx | 54 +- .../src/pages/components/sensitive-input.mdx | 54 ++ .../src/pages/components/switch.mdx | 29 +- .../src/pages/components/table.mdx | 52 +- .../src/pages/components/tooltip.mdx | 12 +- .../scripts/component-registry/metadata.ts | 58 ++ .../delete-resource/delete-resource.test.tsx | 36 ++ .../delete-resource/delete-resource.tsx | 15 +- .../autocomplete/autocomplete.test.tsx | 123 ++++- .../components/autocomplete/autocomplete.tsx | 122 ++++- .../breadcrumbs/breadcrumbs.test.tsx | 161 ++++++ .../components/breadcrumbs/breadcrumbs.tsx | 154 +++++- .../kumo/src/components/breadcrumbs/index.ts | 3 + .../src/components/button/button.test.tsx | 98 +++- .../kumo/src/components/button/button.tsx | 91 ++- .../kumo/src/components/chart/EChart.test.tsx | 191 +++++++ packages/kumo/src/components/chart/EChart.tsx | 197 ++++++- .../kumo/src/components/chart/Legend.test.tsx | 129 +++++ packages/kumo/src/components/chart/Legend.tsx | 115 ++-- .../src/components/chart/SankeyChart.test.tsx | 97 +++- .../kumo/src/components/chart/SankeyChart.tsx | 148 ++++- .../components/chart/TimeseriesChart.test.tsx | 143 +++++ .../src/components/chart/TimeseriesChart.tsx | 279 +++++++++- packages/kumo/src/components/chart/index.ts | 1 + .../src/components/checkbox/checkbox.test.tsx | 34 ++ .../kumo/src/components/checkbox/checkbox.tsx | 32 +- .../src/components/combobox/combobox.test.tsx | 240 +++++++- .../kumo/src/components/combobox/combobox.tsx | 236 ++++++-- .../command-palette/command-palette.test.tsx | 56 +- .../command-palette/command-palette.tsx | 80 +-- .../src/components/command-palette/index.ts | 2 + .../src/components/command-palette/types.ts | 50 +- .../src/components/input-group/context.ts | 2 + .../input-group/input-group-input.tsx | 34 +- .../input-group/input-group.test.tsx | 40 +- .../components/input-group/input-group.tsx | 81 ++- .../kumo/src/components/input/input.test.tsx | 7 + .../kumo/src/components/link/link.test.tsx | 4 +- .../kumo/src/components/radio/radio.test.tsx | 20 +- packages/kumo/src/components/radio/radio.tsx | 21 +- .../src/components/select/select.test.tsx | 40 ++ .../kumo/src/components/select/select.tsx | 60 +- .../src/components/sensitive-input/index.ts | 1 + .../sensitive-input/sensitive-input.test.tsx | 259 ++++++++- .../sensitive-input/sensitive-input.tsx | 411 +++++++++----- .../src/components/sidebar/sidebar.test.tsx | 2 + .../kumo/src/components/sidebar/sidebar.tsx | 12 +- .../src/components/switch/switch.test.tsx | 144 +++++ .../kumo/src/components/switch/switch.tsx | 70 ++- .../table-of-contents.test.tsx | 5 +- .../kumo/src/components/table/table.test.tsx | 84 +++ packages/kumo/src/components/table/table.tsx | 56 +- .../kumo/src/components/tabs/tabs.test.tsx | 102 ++++ packages/kumo/src/components/tabs/tabs.tsx | 13 +- packages/kumo/src/index.ts | 14 +- packages/kumo/src/styles/kumo-binding.css | 24 + packages/kumo/src/styles/kumo.css | 23 + 88 files changed, 5304 insertions(+), 742 deletions(-) create mode 100644 .changeset/accessibility-improvements.md create mode 100644 packages/kumo/src/blocks/delete-resource/delete-resource.test.tsx create mode 100644 packages/kumo/src/components/breadcrumbs/breadcrumbs.test.tsx create mode 100644 packages/kumo/src/components/chart/EChart.test.tsx create mode 100644 packages/kumo/src/components/chart/Legend.test.tsx create mode 100644 packages/kumo/src/components/chart/TimeseriesChart.test.tsx create mode 100644 packages/kumo/src/components/checkbox/checkbox.test.tsx create mode 100644 packages/kumo/src/components/switch/switch.test.tsx create mode 100644 packages/kumo/src/components/tabs/tabs.test.tsx diff --git a/.changeset/accessibility-improvements.md b/.changeset/accessibility-improvements.md new file mode 100644 index 0000000000..5f1ec4c848 --- /dev/null +++ b/.changeset/accessibility-improvements.md @@ -0,0 +1,38 @@ +--- +"@cloudflare/kumo": minor +--- + +Improve accessibility across Kumo components, charts, and docs. + +### Components + +- Improve CommandPalette screen reader context with a dialog title, busy, loading, and empty-state announcements, and localizable labels for status and action text. +- Improve SensitiveInput semantics with localizable labels and status text, warnings for missing or generic primary names, clearer warning and error text, compact hit areas that do not change the visual layout where possible, and decorative icons that are hidden from assistive technology. +- Add accessible-name warnings for Switch, associate Switch groups with descriptions and errors, announce invalid and error states, and expand Switch hit areas without changing compact visuals where possible. +- Improve Button icon-only guidance with accessible-name warnings, decorative icon handling, and compact hit areas that preserve the existing visual size where possible. +- Associate Checkbox, Radio, and Switch groups with group descriptions and error messages so assistive technology receives the surrounding form context. +- Associate helper and error text for aria-label-only Select, Combobox, Autocomplete, SensitiveInput, and InputGroup patterns. +- Add Combobox and Autocomplete warnings for placeholder-only naming, and document localized clear, show, and remove labels. +- Make Breadcrumbs navigation and copy action labels localizable, hide decorative separators and icons from assistive technology, and keep clipboard actions focus-visible. +- Add localized Table selection and resize labels, slimmer resize hit areas, and more targeted metadata so row and column controls are announced clearly. +- Expand compact control hit areas without changing compact visuals where possible by using non-layout or pseudo-element targets. + +### Charts + +- Add chart wrapper label and description support so charts can expose concise names and longer context. +- Merge ECharts aria and reduced-motion options with Kumo defaults instead of replacing app-provided configuration. +- Announce Timeseries loading state and add non-drag range controls with localizable labels and value formatting. +- Improve Sankey labels and descriptions, enable aria support, add keyboard node and link actions, and make action labels localizable. +- Clarify ChartLegend static versus interactive semantics, use native buttons for interactive items, expose aria-pressed state, and expand compact hit areas without changing compact visuals where possible. + +### Blocks + +- Improve DeleteResource confirmation with alert-dialog semantics, a dialog description, and announced error messages. + +### Docs + +- Add skip link behavior and improve SidebarNav disclosure state, current-page announcements, mobile drawer focus management, and inert background behavior. +- Improve StickyDocHeader handling for hidden duplicate content and expand icon link hit areas without changing compact visuals where possible. +- Hide decorative icons from assistive technology and respect reduced-motion preferences in docs UI where motion is used. +- Clean up demos and snippets that used empty links, clickable divs, placeholder-only controls, unlabeled icons, and placeholder href values. +- Add accessibility and internationalization guidance to affected docs pages so examples call out labels, descriptions, clear, show, and remove actions, chart context, dialog errors, and compact target patterns. diff --git a/packages/kumo-docs-astro/src/components/KumoMenuIcon.tsx b/packages/kumo-docs-astro/src/components/KumoMenuIcon.tsx index fca0704945..597f6db598 100644 --- a/packages/kumo-docs-astro/src/components/KumoMenuIcon.tsx +++ b/packages/kumo-docs-astro/src/components/KumoMenuIcon.tsx @@ -7,6 +7,10 @@ interface KumoMenuIconProps { export function KumoMenuIcon({ className }: KumoMenuIconProps) { const [isHovered, setIsHovered] = useState(false); + const animatedPathClassName = + "origin-center-top transition-all duration-800 motion-reduce:transition-none"; + const animatedRectClassName = + "origin-left-center transition-all duration-800 motion-reduce:transition-none"; return (