diff --git a/.changeset/khaki-baboons-deliver.md b/.changeset/khaki-baboons-deliver.md new file mode 100644 index 0000000000..18795c6141 --- /dev/null +++ b/.changeset/khaki-baboons-deliver.md @@ -0,0 +1,5 @@ +--- +'@sumup/circuit-ui': major +--- + +Changed the signature of the ImageInput's `component` prop. The `component` should now accept `aria-hidden` instead of `alt`. diff --git a/packages/circuit-ui/components/ImageInput/ImageInput.tsx b/packages/circuit-ui/components/ImageInput/ImageInput.tsx index fe7951db4c..605d60ac54 100644 --- a/packages/circuit-ui/components/ImageInput/ImageInput.tsx +++ b/packages/circuit-ui/components/ImageInput/ImageInput.tsx @@ -43,10 +43,11 @@ export interface ImageInputProps */ label: string; /** - * The visual component to render as an image input. It should accept an src - * prop to render the image. + * The visual component to render as an image input. + * It should accept a `src` prop to render the image, and `aria-hidden` to + * hide it from assistive technology. */ - component: (props: { src?: string; alt: string }) => JSX.Element; + component: (props: { 'src'?: string; 'aria-hidden': 'true' }) => JSX.Element; /** * A callback function to call when the user has selected an image. */ @@ -458,7 +459,7 @@ export const ImageInput = ({ onDrop={handleDrop} > {label} - +