Update radio buttons

This commit is contained in:
2026-02-14 16:55:54 -05:00
parent 6c86fdd58b
commit 1743ed6ce4
11 changed files with 33 additions and 99 deletions

View File

@@ -1,10 +1,9 @@
import type { RadioButtonProps } from "$/types/InputTypes";
import { Radio } from "@headlessui/react";
import clsx from "clsx";
import { forwardRef } from "react";
const RadioButton = forwardRef<HTMLInputElement, RadioButtonProps>(({
export default function RadioButton({
id = crypto.randomUUID().replaceAll("-", ""),
className,
labelClassName,
@@ -12,7 +11,7 @@ const RadioButton = forwardRef<HTMLInputElement, RadioButtonProps>(({
value,
disabled,
children
}, ref ) => {
}: Readonly<RadioButtonProps>){
return (
<Radio
id={id}
@@ -28,7 +27,6 @@ const RadioButton = forwardRef<HTMLInputElement, RadioButtonProps>(({
)}
disabled={disabled}
aria-labelledby={`${id}Label`}
ref={ref}
>
<div
className={clsx(
@@ -55,8 +53,4 @@ const RadioButton = forwardRef<HTMLInputElement, RadioButtonProps>(({
}
</Radio>
);
});
RadioButton.displayName = "RadioButton";
export default RadioButton;
}