From fbdf9a1f4abc5cdec6bf8a68519405c2fec62a24 Mon Sep 17 00:00:00 2001 From: rizky Date: Wed, 14 Aug 2024 08:38:33 -0700 Subject: [PATCH] fix field --- comps/form/base/BaseField.tsx | 2 +- comps/form/field/Field.tsx | 4 +- comps/ui/input-otp.tsx | 73 ----------------------------------- 3 files changed, 3 insertions(+), 76 deletions(-) delete mode 100755 comps/ui/input-otp.tsx diff --git a/comps/form/base/BaseField.tsx b/comps/form/base/BaseField.tsx index 36d58d5..59408b7 100755 --- a/comps/form/base/BaseField.tsx +++ b/comps/form/base/BaseField.tsx @@ -123,7 +123,7 @@ export const BaseField = (prop: { {errors.length > 0 && (
= (arg) => { arg={arg} /> {field.desc && ( -
0 && "c-pb-1")}> +
0 && "c-pb-1")}> {field.desc}
)} {errors.length ? (
, - React.ComponentPropsWithoutRef ->(({ className, containerClassName, ...props }, ref) => ( - -)); -InputOTP.displayName = "InputOTP"; - -const InputOTPGroup = React.forwardRef< - React.ElementRef<"div">, - React.ComponentPropsWithoutRef<"div"> ->(({ className, ...props }, ref) => ( -
-)); -InputOTPGroup.displayName = "InputOTPGroup"; - -const InputOTPSlot = React.forwardRef< - React.ElementRef<"div">, - React.ComponentPropsWithoutRef<"div"> & { index: number } ->(({ index, className, ...props }, ref) => { - const inputOTPContext = React.useContext(OTPInputContext); - const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index]; - - return ( -
- {char} - {hasFakeCaret && ( -
-
-
- )} -
- ); -}); -InputOTPSlot.displayName = "InputOTPSlot"; - -const InputOTPSeparator = React.forwardRef< - React.ElementRef<"div">, - React.ComponentPropsWithoutRef<"div"> ->(({ ...props }, ref) => ( -
- -
-)); -InputOTPSeparator.displayName = "InputOTPSeparator"; - -export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };