Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/addons/docs/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ type CanvasBlockParameters = {
disabled?: boolean;
onClick: () => void;
title: string | React.JSX.Element;
ariaLabel?: string | false;
}[];
/** Provide HTML class(es) to the preview element, for custom styling. */
className?: string;
Expand Down
11 changes: 9 additions & 2 deletions code/core/src/components/components/ActionBar/ActionBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export interface ActionItem {
className?: string;
onClick: (e: MouseEvent<HTMLButtonElement>) => void;
disabled?: boolean;
ariaLabel?: string | false;
}

export interface ActionBarProps {
Expand All @@ -89,8 +90,14 @@ export interface ActionBarProps {
export const ActionBar = ({ actionItems, flexLayout = false, ...props }: ActionBarProps) => {
return (
<Container {...props} $flexLayout={flexLayout}>
{actionItems.map(({ title, className, onClick, disabled }, index: number) => (
<ActionButton key={index} className={className} onClick={onClick} disabled={!!disabled}>
{actionItems.map(({ title, className, onClick, disabled, ariaLabel }, index: number) => (
<ActionButton
key={index}
className={className}
onClick={onClick}
disabled={!!disabled}
aria-label={ariaLabel === false ? undefined : ariaLabel}
>
{title}
</ActionButton>
))}
Expand Down
Loading