Skip to content

feat(pie): added aria hidden and disabled flag for arcs - #2852

Open
jingcai86 wants to merge 1 commit into
plouc:masterfrom
jingcai86:feat/pie-aria
Open

jingcai86 wants to merge 1 commit into
plouc:masterfrom
jingcai86:feat/pie-aria

Conversation

@jingcai86

Copy link
Copy Markdown
Contributor

Description

Similar to PR #2566 for @nivo/bar and PR #2851 for @nivo/line, this PR adds accessibility attributes for arc shapes in @nivo/pie:

  • arcAriaLabel
  • arcAriaLabelledBy
  • arcAriaDescribedBy
  • arcAriaHidden
  • arcAriaDisabled

This allows hiding or providing accessible descriptions/labels for individual pie arcs, ensuring screen readers can announce or ignore specific slices via aria-hidden and aria-disabled.

Changes

  • packages/arcs:
    • Added aria attributes to ArcShapeProps and applied them to <animated.path> in ArcShape
    • Added aria callbacks to ArcsLayerProps and forwarded them in ArcsLayer
  • packages/pie:
    • Added arcAria* props to PieSvgProps and CompletePieSvgProps in types.ts
    • Forwarded arcAria* props through Pie -> Arcs -> ArcsLayer
    • Added unit test suite for arc aria attributes in Pie.test.tsx
  • website:
    • Added documentation for the new props and common accessibility properties under the Accessibility group in website/src/data/components/pie/props.ts

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant