"use client";
import { Checkbox as BaseCheckbox } from "@base-ui/react/checkbox";
import { Check, Minus } from "lucide-react";
import { cn } from "@/lib/utils";
export type CheckboxProps = React.ComponentProps<typeof BaseCheckbox.Root>;
/**
* A small machined well that fills when checked: the accent surface and
* check glyph rise to embossed, so state reads through color, shape, and
* depth together.
*
* @example
* <Checkbox defaultChecked aria-label="Enable limiter" />
*/
function Checkbox({ className, ...props }: CheckboxProps) {
return (
<BaseCheckbox.Root
data-slot="checkbox"
className={cn(
"group inline-flex size-4.5 shrink-0 cursor-pointer items-center justify-center rounded-xs bg-well shadow-deboss-1 focus-ring transition-[background-color,box-shadow] duration-(--duration-settle) ease-(--ease-settle) data-checked:bg-accent data-checked:shadow-emboss-1 data-disabled:pointer-events-none data-disabled:opacity-50 data-indeterminate:bg-accent data-indeterminate:shadow-emboss-1",
className,
)}
{...props}
>
<BaseCheckbox.Indicator
data-slot="checkbox-indicator"
className="flex text-accent-fg transition-[scale,opacity] duration-(--duration-press) ease-(--ease-press) data-starting-style:scale-50 data-starting-style:opacity-0"
>
<Check
className="size-3.5 group-data-indeterminate:hidden"
strokeWidth={3}
aria-hidden
/>
<Minus
className="hidden size-3.5 group-data-indeterminate:block"
strokeWidth={3}
aria-hidden
/>
</BaseCheckbox.Indicator>
</BaseCheckbox.Root>
);
}
export { Checkbox };