From 65babb8d31f5ab5b86fe6b643a0b94cb3def0180 Mon Sep 17 00:00:00 2001 From: Dominic Carrington Date: Fri, 18 Oct 2024 18:23:20 +0100 Subject: [PATCH] fix(types): use AriaRole instead of string for role prop --- src/components/ButtonGroup/ButtonGroup.types.ts | 4 ++-- src/components/ButtonSimple/ButtonSimple.types.ts | 4 ++-- src/components/List/List.types.ts | 4 ++-- src/components/ListItemBase/ListItemBase.types.ts | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/ButtonGroup/ButtonGroup.types.ts b/src/components/ButtonGroup/ButtonGroup.types.ts index d55b481d06..a24c332c98 100644 --- a/src/components/ButtonGroup/ButtonGroup.types.ts +++ b/src/components/ButtonGroup/ButtonGroup.types.ts @@ -1,4 +1,4 @@ -import { CSSProperties, ReactElement } from 'react'; +import { AriaRole, CSSProperties, ReactElement } from 'react'; import { ButtonCircleProps } from '../ButtonCircle'; import { ButtonPillProps } from '../ButtonPill'; @@ -59,7 +59,7 @@ export interface Props { /** * Role for adding accessibility */ - role?: string; + role?: AriaRole; /** * Orientation of ButtonGroup diff --git a/src/components/ButtonSimple/ButtonSimple.types.ts b/src/components/ButtonSimple/ButtonSimple.types.ts index 64a4bff5c5..f60c65e62c 100644 --- a/src/components/ButtonSimple/ButtonSimple.types.ts +++ b/src/components/ButtonSimple/ButtonSimple.types.ts @@ -1,4 +1,4 @@ -import { CSSProperties, ReactNode } from 'react'; +import { AriaRole, CSSProperties, ReactNode } from 'react'; import { AriaButtonProps } from '@react-types/button'; import { HoverProps } from '@react-aria/interactions'; @@ -38,7 +38,7 @@ export interface Props extends AriaButtonProps, HoverProps { /** * Role for adding accessibility */ - role?: string; + role?: AriaRole; /** * Tabindex for accessibility diff --git a/src/components/List/List.types.ts b/src/components/List/List.types.ts index 62fe9bbe21..8e3b7dad53 100644 --- a/src/components/List/List.types.ts +++ b/src/components/List/List.types.ts @@ -1,4 +1,4 @@ -import { CSSProperties, Dispatch, ReactNode, SetStateAction } from 'react'; +import { AriaRole, CSSProperties, Dispatch, ReactNode, SetStateAction } from 'react'; export type ListOrientation = 'horizontal' | 'vertical'; @@ -36,7 +36,7 @@ export interface Props { /** * Aria role */ - role?: string; + role?: AriaRole; /** * Determines if the onPress handler should also focus the selected item diff --git a/src/components/ListItemBase/ListItemBase.types.ts b/src/components/ListItemBase/ListItemBase.types.ts index 0a77413c12..86a61d123d 100644 --- a/src/components/ListItemBase/ListItemBase.types.ts +++ b/src/components/ListItemBase/ListItemBase.types.ts @@ -1,4 +1,4 @@ -import { CSSProperties, ReactNode } from 'react'; +import { AriaRole, CSSProperties, ReactNode } from 'react'; import { PressEvents } from '@react-types/shared'; import { FocusProps, FocusWithinProps } from '@react-aria/interactions'; @@ -63,7 +63,7 @@ export interface Props * Aria role * @default "listitem" */ - role?: string; + role?: AriaRole; /** * Indicates wether this item is currently focusable