Skip to content

Commit

Permalink
Fix Radio props type
Browse files Browse the repository at this point in the history
  • Loading branch information
Qs-F committed Apr 8, 2024
1 parent b1b753d commit 4bca22b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/for-ui/src/radio/Radio.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { FC, forwardRef, ReactNode } from 'react';
import { ComponentPropsWithRef, FC, forwardRef, ReactNode } from 'react';
import MuiRadio, { RadioProps as MuiRadioProps } from '@mui/material/Radio';
import { fsx } from '../system/fsx';
import { TextDefaultStyler } from '../system/TextDefaultStyler';
import { Text } from '../text';

export type RadioProps = Omit<MuiRadioProps, 'ref'> & {
type _RadioProps = Omit<MuiRadioProps, 'ref'> & {
label?: ReactNode;
nopadding?: boolean;
className?: string;
Expand All @@ -20,7 +20,7 @@ const Indicator: FC<{ checked: boolean; disabled: boolean }> = ({ checked, disab
/>
);

export const Radio = forwardRef<HTMLInputElement, RadioProps>(
export const Radio = forwardRef<HTMLInputElement, _RadioProps>(
({ nopadding, label, value, disabled, className, ...rest }, ref) => (
<Text as="label" className={fsx(`inline-flex w-fit flex-row items-center gap-1`, className)}>
<MuiRadio
Expand Down Expand Up @@ -48,3 +48,5 @@ export const Radio = forwardRef<HTMLInputElement, RadioProps>(
</Text>
),
);

export type RadioProps = ComponentPropsWithRef<typeof Radio>

0 comments on commit 4bca22b

Please sign in to comment.