Update dependencies
This commit is contained in:
@@ -1,20 +1,24 @@
|
||||
import type { RadioButtonProps } from "$/types/InputTypes";
|
||||
import { Radio } from "@headlessui/react";
|
||||
import clsx from "clsx";
|
||||
import { useId } from "react";
|
||||
|
||||
|
||||
export default function RadioButton({
|
||||
id = crypto.randomUUID().replaceAll("-", ""),
|
||||
id,
|
||||
className,
|
||||
labelClassName,
|
||||
size = "sm",
|
||||
value,
|
||||
disabled,
|
||||
children
|
||||
}: Readonly<RadioButtonProps>){
|
||||
}: Readonly<RadioButtonProps>) {
|
||||
const reactId = useId();
|
||||
const effectiveId = id ?? reactId;
|
||||
|
||||
return (
|
||||
<Radio
|
||||
id={id}
|
||||
id={effectiveId}
|
||||
value={value}
|
||||
className={clsx(
|
||||
"group",
|
||||
@@ -26,7 +30,7 @@ export default function RadioButton({
|
||||
}
|
||||
)}
|
||||
disabled={disabled}
|
||||
aria-labelledby={`${id}Label`}
|
||||
aria-labelledby={`${effectiveId}Label`}
|
||||
>
|
||||
<div
|
||||
className={clsx(
|
||||
@@ -45,7 +49,7 @@ export default function RadioButton({
|
||||
{
|
||||
children &&
|
||||
<span
|
||||
id={`${id}Label`}
|
||||
id={`${effectiveId}Label`}
|
||||
className={labelClassName}
|
||||
>
|
||||
{children}
|
||||
|
||||
Reference in New Issue
Block a user