From 6a09b5644d181aa2acf6f768a98069300cc93e25 Mon Sep 17 00:00:00 2001 From: Mike Perrotti Date: Thu, 18 Sep 2025 14:20:54 -0400 Subject: [PATCH 1/3] passes aria-label prop to ActionBar toolbar --- .../react/src/ActionBar/ActionBar.stories.tsx | 2 +- packages/react/src/ActionBar/ActionBar.tsx | 21 +++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/packages/react/src/ActionBar/ActionBar.stories.tsx b/packages/react/src/ActionBar/ActionBar.stories.tsx index 30988947ed4..e24ed337b21 100644 --- a/packages/react/src/ActionBar/ActionBar.stories.tsx +++ b/packages/react/src/ActionBar/ActionBar.stories.tsx @@ -22,7 +22,7 @@ type Story = StoryObj export const Playground: Story = { render: args => ( - + diff --git a/packages/react/src/ActionBar/ActionBar.tsx b/packages/react/src/ActionBar/ActionBar.tsx index 2b220e306dd..bc98892438a 100644 --- a/packages/react/src/ActionBar/ActionBar.tsx +++ b/packages/react/src/ActionBar/ActionBar.tsx @@ -126,7 +126,14 @@ const overflowEffect = ( } export const ActionBar: React.FC> = props => { - const {size = 'medium', children, 'aria-label': ariaLabel, flush = false, className} = props + const { + size = 'medium', + children, + 'aria-label': ariaLabel, + 'aria-labelledby': ariaLabelledBy, + flush = false, + className, + } = props const [childWidthArray, setChildWidthArray] = useState([]) const setChildrenWidth = useCallback((size: ChildSize) => { setChildWidthArray(arr => { @@ -202,7 +209,13 @@ export const ActionBar: React.FC> = prop return (
-
+
{listItems} {menuItems.length > 0 && ( @@ -219,7 +232,7 @@ export const ActionBar: React.FC> = prop children: menuItemChildren, onClick, icon: Icon, - 'aria-label': ariaLabel, + 'aria-label': menuItemAriaLabel, disabled, } = menuItem.props return ( @@ -238,7 +251,7 @@ export const ActionBar: React.FC> = prop ) : null} - {ariaLabel} + {menuItemAriaLabel} ) } From 244687ad73e28bf51c6d086d2e02ad2f22bd2014 Mon Sep 17 00:00:00 2001 From: Mike Perrotti Date: Thu, 18 Sep 2025 14:22:37 -0400 Subject: [PATCH 2/3] adds changelog --- .changeset/flat-ears-wink.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/flat-ears-wink.md diff --git a/.changeset/flat-ears-wink.md b/.changeset/flat-ears-wink.md new file mode 100644 index 00000000000..783149846be --- /dev/null +++ b/.changeset/flat-ears-wink.md @@ -0,0 +1,5 @@ +--- +'@primer/react': patch +--- + +In `ActionBar`, `aria-label` now gets added to the `role="toolbar"` element. From 35c4c2c771f7898eaf1e752fc40acf858244c68f Mon Sep 17 00:00:00 2001 From: Mike Perrotti Date: Fri, 19 Sep 2025 18:30:53 -0400 Subject: [PATCH 3/3] fixes ActionBar Playground story by preventing aria-labelledby prop from being passed _with_ aria-label --- packages/react/src/ActionBar/ActionBar.stories.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react/src/ActionBar/ActionBar.stories.tsx b/packages/react/src/ActionBar/ActionBar.stories.tsx index e24ed337b21..e373a5da5d1 100644 --- a/packages/react/src/ActionBar/ActionBar.stories.tsx +++ b/packages/react/src/ActionBar/ActionBar.stories.tsx @@ -21,7 +21,7 @@ export default meta type Story = StoryObj export const Playground: Story = { - render: args => ( + render: ({'aria-labelledby': _, ...args}) => (