From b1b753d595cfb03b0bd2fa01e1311624e1f1e5b2 Mon Sep 17 00:00:00 2001 From: Qs-F Date: Mon, 8 Apr 2024 21:20:38 +0900 Subject: [PATCH 1/3] Fix Checkbox props type --- packages/for-ui/src/checkbox/Checkbox.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/for-ui/src/checkbox/Checkbox.tsx b/packages/for-ui/src/checkbox/Checkbox.tsx index dfdcb7f9e..06ac78cae 100644 --- a/packages/for-ui/src/checkbox/Checkbox.tsx +++ b/packages/for-ui/src/checkbox/Checkbox.tsx @@ -1,11 +1,11 @@ -import { FC, forwardRef, ReactNode } from 'react'; +import { FC, forwardRef, ReactNode, ComponentPropsWithRef } from 'react'; import { MdCheck, MdRemove } from 'react-icons/md'; import MuiCheckbox, { CheckboxProps as MuiCheckboxProps } from '@mui/material/Checkbox'; import { fsx } from '../system/fsx'; import { TextDefaultStyler } from '../system/TextDefaultStyler'; import { Text } from '../text'; -export type CheckboxProps = MuiCheckboxProps & { +type _CheckboxProps = MuiCheckboxProps & { label?: ReactNode; nopadding?: boolean; className?: string; @@ -32,7 +32,7 @@ const Indicator: FC<{ state: 'default' | 'checked' | 'intermediate'; disabled: b ); -export const Checkbox = forwardRef( +export const Checkbox = forwardRef( ({ label, nopadding = false, disabled, className, ...rest }, ref) => ( ( ), ); + +export type CheckboxProps = ComponentPropsWithRef From 4bca22b7254e7a9bc3659def02529a48629ba2d8 Mon Sep 17 00:00:00 2001 From: Qs-F Date: Mon, 8 Apr 2024 21:21:04 +0900 Subject: [PATCH 2/3] Fix Radio props type --- packages/for-ui/src/radio/Radio.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/for-ui/src/radio/Radio.tsx b/packages/for-ui/src/radio/Radio.tsx index 8edd072f4..806b16060 100644 --- a/packages/for-ui/src/radio/Radio.tsx +++ b/packages/for-ui/src/radio/Radio.tsx @@ -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 & { +type _RadioProps = Omit & { label?: ReactNode; nopadding?: boolean; className?: string; @@ -20,7 +20,7 @@ const Indicator: FC<{ checked: boolean; disabled: boolean }> = ({ checked, disab /> ); -export const Radio = forwardRef( +export const Radio = forwardRef( ({ nopadding, label, value, disabled, className, ...rest }, ref) => ( ( ), ); + +export type RadioProps = ComponentPropsWithRef From c81e433476bec1e68f223fc0acce5be2a16d4ead Mon Sep 17 00:00:00 2001 From: Qs-F Date: Mon, 8 Apr 2024 21:31:58 +0900 Subject: [PATCH 3/3] Fmt --- packages/for-ui/src/checkbox/Checkbox.tsx | 8 ++++---- packages/for-ui/src/radio/Radio.tsx | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/for-ui/src/checkbox/Checkbox.tsx b/packages/for-ui/src/checkbox/Checkbox.tsx index 06ac78cae..aac627166 100644 --- a/packages/for-ui/src/checkbox/Checkbox.tsx +++ b/packages/for-ui/src/checkbox/Checkbox.tsx @@ -1,11 +1,11 @@ -import { FC, forwardRef, ReactNode, ComponentPropsWithRef } from 'react'; +import { ComponentPropsWithRef, FC, forwardRef, ReactNode } from 'react'; import { MdCheck, MdRemove } from 'react-icons/md'; import MuiCheckbox, { CheckboxProps as MuiCheckboxProps } from '@mui/material/Checkbox'; import { fsx } from '../system/fsx'; import { TextDefaultStyler } from '../system/TextDefaultStyler'; import { Text } from '../text'; -type _CheckboxProps = MuiCheckboxProps & { +type InternalCheckboxProps = MuiCheckboxProps & { label?: ReactNode; nopadding?: boolean; className?: string; @@ -32,7 +32,7 @@ const Indicator: FC<{ state: 'default' | 'checked' | 'intermediate'; disabled: b ); -export const Checkbox = forwardRef( +export const Checkbox = forwardRef( ({ label, nopadding = false, disabled, className, ...rest }, ref) => ( ( ), ); -export type CheckboxProps = ComponentPropsWithRef +export type CheckboxProps = ComponentPropsWithRef; diff --git a/packages/for-ui/src/radio/Radio.tsx b/packages/for-ui/src/radio/Radio.tsx index 806b16060..4c328bccb 100644 --- a/packages/for-ui/src/radio/Radio.tsx +++ b/packages/for-ui/src/radio/Radio.tsx @@ -4,7 +4,7 @@ import { fsx } from '../system/fsx'; import { TextDefaultStyler } from '../system/TextDefaultStyler'; import { Text } from '../text'; -type _RadioProps = Omit & { +type InternalRadioProps = Omit & { label?: ReactNode; nopadding?: boolean; className?: string; @@ -20,7 +20,7 @@ const Indicator: FC<{ checked: boolean; disabled: boolean }> = ({ checked, disab /> ); -export const Radio = forwardRef( +export const Radio = forwardRef( ({ nopadding, label, value, disabled, className, ...rest }, ref) => ( ( ), ); -export type RadioProps = ComponentPropsWithRef +export type RadioProps = ComponentPropsWithRef;