Update themed components with refs and css
This commit is contained in:
@@ -1,24 +1,30 @@
|
||||
import type { CheckboxProps } from "$/types/InputTypes";
|
||||
import clsx from "clsx";
|
||||
import { forwardRef } from "react";
|
||||
import MattrixwvCheckbox from "./MattrixwvCheckbox";
|
||||
|
||||
|
||||
export default function PrimaryCheckbox({
|
||||
const PrimaryCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
|
||||
className,
|
||||
box = true,
|
||||
...props
|
||||
}: CheckboxProps){
|
||||
}, ref) => {
|
||||
return (
|
||||
<MattrixwvCheckbox
|
||||
className={clsx(
|
||||
className,
|
||||
{
|
||||
"group-data-checked:bg-blue-600 group-data-checked:stroke-white": box,
|
||||
"group-data-checked:stroke-blue-600": !box
|
||||
"group-data-checked:bg-primary group-data-checked:stroke-white": box,
|
||||
"group-data-checked:stroke-primary": !box
|
||||
}
|
||||
)}
|
||||
box={box}
|
||||
{...props}
|
||||
ref={ref}
|
||||
/>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
PrimaryCheckbox.displayName = "PrimaryCheckbox";
|
||||
|
||||
export default PrimaryCheckbox;
|
||||
|
||||
Reference in New Issue
Block a user