diff --git a/packages/core-components/api-report.md b/packages/core-components/api-report.md index 302ef7ef7d..4e3820967a 100644 --- a/packages/core-components/api-report.md +++ b/packages/core-components/api-report.md @@ -190,6 +190,7 @@ export function CopyTextButton(props: CopyTextButtonProps): JSX.Element; // @public export interface CopyTextButtonProps { + 'aria-label'?: string; text: string; tooltipDelay?: number; tooltipText?: string; diff --git a/packages/core-components/src/components/CopyTextButton/CopyTextButton.tsx b/packages/core-components/src/components/CopyTextButton/CopyTextButton.tsx index 2a6543b9cd..bd900a931d 100644 --- a/packages/core-components/src/components/CopyTextButton/CopyTextButton.tsx +++ b/packages/core-components/src/components/CopyTextButton/CopyTextButton.tsx @@ -47,11 +47,16 @@ export interface CopyTextButtonProps { * Default: "Text copied to clipboard" */ tooltipText?: string; -} -type LabelledCopyTextButtonProps = CopyTextButtonProps & { + /** + * Text to use as aria-label prop on the button + * + * @remarks + * + * Default: "Copy text" + */ 'aria-label'?: string; -}; +} /** * Copy text button with visual feedback @@ -72,7 +77,7 @@ type LabelledCopyTextButtonProps = CopyTextButtonProps & { * arial-label="Accessible label for this button" /> * ``` */ -export function CopyTextButton(props: LabelledCopyTextButtonProps) { +export function CopyTextButton(props: CopyTextButtonProps) { const { text, tooltipDelay = 1000,