( props: AriaStepListProps<T>, state: StepListState<T>, ref: RefObject<HTMLOListElement | null> )
| 26 | } |
| 27 | |
| 28 | export function useStepList<T>( |
| 29 | props: AriaStepListProps<T>, |
| 30 | state: StepListState<T>, |
| 31 | ref: RefObject<HTMLOListElement | null> |
| 32 | ): StepListAria { |
| 33 | let {'aria-label': ariaLabel} = props; |
| 34 | let {listProps} = useSelectableList({ |
| 35 | ...props, |
| 36 | ...state, |
| 37 | allowsTabNavigation: true, |
| 38 | ref |
| 39 | }); |
| 40 | |
| 41 | const strings = useLocalizedStringFormatter(intlMessages, '@react-aria/steplist'); |
| 42 | const stepListProps: HTMLAttributes<HTMLElement> = { |
| 43 | ...mergeProps(listProps, filterDOMProps(props, {labelable: true})), |
| 44 | 'aria-label': ariaLabel || strings.format('steplist') |
| 45 | }; |
| 46 | |
| 47 | return { |
| 48 | listProps: { |
| 49 | ...stepListProps, |
| 50 | tabIndex: undefined |
| 51 | } |
| 52 | }; |
| 53 | } |
no test coverage detected