From 0edd098073607158aef64931488e134196b33df8 Mon Sep 17 00:00:00 2001 From: viraj-10 Date: Tue, 3 Dec 2024 18:04:05 +0530 Subject: [PATCH] fix: typing and accordion item hotfix --- .../nativewind/accordion/index.tsx | 10 ++++++- .../nativewind/actionsheet/index.tsx | 2 ++ .../nativewind/alert/index.tsx | 5 +++- .../nativewind/badge/index.tsx | 1 - .../nativewind/button/index.tsx | 2 ++ .../core-components/nativewind/fab/index.tsx | 5 +++- .../nativewind/form-control/index.tsx | 6 +++- .../nativewind/input/index.tsx | 9 ++++-- .../nativewind/radio/index.tsx | 5 +++- yarn.lock | 28 ------------------- 10 files changed, 36 insertions(+), 37 deletions(-) diff --git a/example/storybook-nativewind/src/core-components/nativewind/accordion/index.tsx b/example/storybook-nativewind/src/core-components/nativewind/accordion/index.tsx index 7dbe6f8f4..9bc213efc 100644 --- a/example/storybook-nativewind/src/core-components/nativewind/accordion/index.tsx +++ b/example/storybook-nativewind/src/core-components/nativewind/accordion/index.tsx @@ -76,7 +76,7 @@ const accordionHeaderStyle = tva({ base: 'mx-0 my-0', }); const accordionContentStyle = tva({ - base: 'mt-4', + base: 'pt-1 pb-3 px-4', }); const accordionTriggerStyle = tva({ base: 'w-full flex-row justify-between items-center web:outline-none focus:outline-none data-[disabled=true]:opacity-40 data-[disabled=true]:cursor-not-allowed data-[focus-visible=true]:bg-background-50 py-3 px-4', @@ -113,6 +113,12 @@ cssInterop(PrimitiveIcon, { }, }); +cssInterop(H3, { + className: { + target: 'style', + }, +}); + type IAccordionProps = React.ComponentPropsWithoutRef & VariantProps; @@ -134,6 +140,8 @@ type IAccordionContentTextProps = React.ComponentPropsWithoutRef< type IAccordionIconProps = VariantProps & React.ComponentPropsWithoutRef & { as?: React.ElementType; + height?: number; + width?: number; }; type IAccordionHeaderProps = React.ComponentPropsWithoutRef< diff --git a/example/storybook-nativewind/src/core-components/nativewind/actionsheet/index.tsx b/example/storybook-nativewind/src/core-components/nativewind/actionsheet/index.tsx index 0dc147635..aabdc6a39 100644 --- a/example/storybook-nativewind/src/core-components/nativewind/actionsheet/index.tsx +++ b/example/storybook-nativewind/src/core-components/nativewind/actionsheet/index.tsx @@ -272,6 +272,8 @@ type IActionsheetIconProps = VariantProps & React.ComponentPropsWithoutRef & { className?: string; as?: React.ElementType; + height?: number; + width?: number; }; const Actionsheet = React.forwardRef< diff --git a/example/storybook-nativewind/src/core-components/nativewind/alert/index.tsx b/example/storybook-nativewind/src/core-components/nativewind/alert/index.tsx index 90a2dfe9a..cd7816054 100644 --- a/example/storybook-nativewind/src/core-components/nativewind/alert/index.tsx +++ b/example/storybook-nativewind/src/core-components/nativewind/alert/index.tsx @@ -190,7 +190,10 @@ const AlertText = React.forwardRef< ); type IAlertIconProps = React.ComponentPropsWithoutRef & - VariantProps; + VariantProps & { + height?: number; + width?: number; + }; const AlertIcon = React.forwardRef< React.ElementRef, diff --git a/example/storybook-nativewind/src/core-components/nativewind/badge/index.tsx b/example/storybook-nativewind/src/core-components/nativewind/badge/index.tsx index 6363a340d..ed8c8988b 100644 --- a/example/storybook-nativewind/src/core-components/nativewind/badge/index.tsx +++ b/example/storybook-nativewind/src/core-components/nativewind/badge/index.tsx @@ -101,7 +101,6 @@ cssInterop(PrimitiveIcon, { nativeStyleToProp: { height: true, width: true, - //@ts-expect-error fill: true, color: 'classNameColor', stroke: true, diff --git a/example/storybook-nativewind/src/core-components/nativewind/button/index.tsx b/example/storybook-nativewind/src/core-components/nativewind/button/index.tsx index 112ca5044..0efc1a03a 100644 --- a/example/storybook-nativewind/src/core-components/nativewind/button/index.tsx +++ b/example/storybook-nativewind/src/core-components/nativewind/button/index.tsx @@ -341,6 +341,8 @@ type IButtonIcon = React.ComponentPropsWithoutRef & VariantProps & { className?: string | undefined; as?: React.ElementType; + height?: number; + width?: number; }; const ButtonIcon = React.forwardRef< diff --git a/example/storybook-nativewind/src/core-components/nativewind/fab/index.tsx b/example/storybook-nativewind/src/core-components/nativewind/fab/index.tsx index 98840f89b..da43f9777 100644 --- a/example/storybook-nativewind/src/core-components/nativewind/fab/index.tsx +++ b/example/storybook-nativewind/src/core-components/nativewind/fab/index.tsx @@ -169,7 +169,10 @@ const FabLabel = React.forwardRef< ); type IFabIconProps = React.ComponentPropsWithoutRef & - VariantProps; + VariantProps & { + height?: number; + width?: number; + }; const FabIcon = React.forwardRef< React.ElementRef, diff --git a/example/storybook-nativewind/src/core-components/nativewind/form-control/index.tsx b/example/storybook-nativewind/src/core-components/nativewind/form-control/index.tsx index 895b207a4..b982f4cca 100644 --- a/example/storybook-nativewind/src/core-components/nativewind/form-control/index.tsx +++ b/example/storybook-nativewind/src/core-components/nativewind/form-control/index.tsx @@ -317,7 +317,11 @@ const FormControlErrorText = React.forwardRef< type IFormControlErrorIconProps = React.ComponentProps< typeof UIFormControl.Error.Icon > & - VariantProps; + VariantProps & { + height?: number; + width?: number; + }; + const FormControlErrorIcon = React.forwardRef< React.ElementRef, IFormControlErrorIconProps diff --git a/example/storybook-nativewind/src/core-components/nativewind/input/index.tsx b/example/storybook-nativewind/src/core-components/nativewind/input/index.tsx index 97aa13519..0186496e3 100644 --- a/example/storybook-nativewind/src/core-components/nativewind/input/index.tsx +++ b/example/storybook-nativewind/src/core-components/nativewind/input/index.tsx @@ -116,9 +116,12 @@ const Input = React.forwardRef, IInputProps>( } ); -type IInputIconProps = React.ComponentProps & { - className?: string; -}; +type IInputIconProps = React.ComponentProps & + VariantProps & { + className?: string; + height?: number; + width?: number; + }; const InputIcon = React.forwardRef< React.ElementRef, diff --git a/example/storybook-nativewind/src/core-components/nativewind/radio/index.tsx b/example/storybook-nativewind/src/core-components/nativewind/radio/index.tsx index a32aee7da..ea0071a7a 100644 --- a/example/storybook-nativewind/src/core-components/nativewind/radio/index.tsx +++ b/example/storybook-nativewind/src/core-components/nativewind/radio/index.tsx @@ -164,7 +164,10 @@ const RadioLabel = React.forwardRef< }); type IRadioIconProps = React.ComponentProps & - VariantProps; + VariantProps & { + height?: number; + width?: number; + }; const RadioIcon = React.forwardRef< React.ElementRef, IRadioIconProps diff --git a/yarn.lock b/yarn.lock index e5d8e0624..257bd4536 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2612,22 +2612,6 @@ "@react-native-aria/focus" "^0.2.9" "@react-native-aria/interactions" "^0.2.11" -"@gluestack-ui/icon@0.1.24": - version "0.1.24-alpha.0" - dependencies: - "@gluestack-ui/provider" "^0.1.13" - "@gluestack-ui/utils" "^0.1.14" - "@react-native-aria/focus" "^0.2.9" - -"@gluestack-ui/icon@^0.1.3": - version "0.1.23" - resolved "https://registry.yarnpkg.com/@gluestack-ui/icon/-/icon-0.1.23.tgz#68ce538ef2e485d103e8d4192a54105a726e0e98" - integrity sha512-au4WIwtAQRsvXV9rSZEvLvv4w8O2ikaTQjaCmF1poZyZabeEIXjun7qFIRTKmJsxoRmWK7ziM22i4OER/BlTCQ== - dependencies: - "@gluestack-ui/provider" "^0.1.13" - "@gluestack-ui/utils" "^0.1.14" - "@react-native-aria/focus" "^0.2.9" - "@gluestack-ui/tabs@0.1.14": version "0.1.14" resolved "https://registry.yarnpkg.com/@gluestack-ui/tabs/-/tabs-0.1.14.tgz#5bcb5cc659927cde08f8e32497830257ed5cba4f" @@ -2648,18 +2632,6 @@ "@gluestack-ui/utils" "^0.1.12" "@react-native-aria/focus" "^0.2.9" -"@gluestack-ui/tooltip@0.1.35", "@gluestack-ui/tooltip@^0.1.30", "@gluestack-ui/tooltip@^0.1.6": - version "0.1.35" - resolved "https://registry.yarnpkg.com/@gluestack-ui/tooltip/-/tooltip-0.1.35.tgz#6b337eb889f87f21acb21898ed240a23a6e96eff" - integrity sha512-hS+xv4wOm8vuDvzeRMt+wuGNGTCk7WSABR2wNCgMj8NEhJiaKAwLSBYwkzA01SRJxjGP64uMk8scPUdrnaw8MQ== - dependencies: - "@gluestack-ui/hooks" "0.1.12" - "@gluestack-ui/overlay" "^0.1.16" - "@gluestack-ui/utils" "^0.1.14" - "@react-native-aria/focus" "^0.2.9" - "@react-native-aria/interactions" "0.2.13" - "@react-native-aria/overlays" "^0.3.12" - "@gluestack-ui/utils@0.1.12": version "0.1.12" resolved "https://registry.yarnpkg.com/@gluestack-ui/utils/-/utils-0.1.12.tgz#0bb3400c9315fb6c0fd1bc697b20d80f82cd3899"