Skip to content

Commit

Permalink
refactor: fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaCG committed Nov 3, 2023
1 parent 3f53700 commit 152d969
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/hooks/private/useRadioGroup/useRadioGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,24 @@ import React from 'react';
import {useUniqId} from '../..';
import type {ControlGroupOption, ControlGroupProps} from '../../../components/types';

interface OptionsProps
extends Omit<
ControlGroupProps,
'options' | 'defaultValue' | 'aria-label' | 'aria-labelledby' | 'onUpdate' | 'value'
> {
value: string;
checked: boolean;
content: ControlGroupOption['content'];
}

export type UseRadioGroupProps = ControlGroupProps;

export type UseRadioGroupResult = {
containerProps: Pick<ControlGroupProps, 'aria-label' | 'aria-labelledby'> & {
role: string;
'aria-disabled': ControlGroupProps['disabled'];
};
optionsProps: Omit<
ControlGroupProps,
'options' | 'defaultValue' | 'aria-label' | 'aria-labelledby' | 'onUpdate'
> &
{checked: boolean; content: ControlGroupOption['content']}[];
optionsProps: OptionsProps[];
};

export function useRadioGroup(props: UseRadioGroupProps): UseRadioGroupResult {
Expand Down

0 comments on commit 152d969

Please sign in to comment.