mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-17 11:21:35 +03:00
d9f6ce4e68
Issue: https://github.com/StanGirard/quivr/issues/1832 Demo: https://github.com/StanGirard/quivr/assets/63923024/e9c0e9b8-04b1-4f12-a8ef-b27f0f489e48 <img width="1503" alt="Screenshot 2023-12-06 at 15 23 12" src="https://github.com/StanGirard/quivr/assets/63923024/11e6960b-c1c3-4abf-aeed-c226f034246f"> <img width="1503" alt="Screenshot 2023-12-06 at 15 23 23" src="https://github.com/StanGirard/quivr/assets/63923024/09681a9d-ce2e-42bb-8151-1986e27f7312">
27 lines
1.0 KiB
TypeScript
27 lines
1.0 KiB
TypeScript
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
import * as React from "react";
|
|
import { LuCheck } from "react-icons/lu";
|
|
|
|
import { cn } from "@/lib/utils";
|
|
|
|
export const Checkbox = React.forwardRef<
|
|
React.ElementRef<typeof CheckboxPrimitive.Root>,
|
|
React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
|
|
>(({ className, ...props }, ref) => (
|
|
<CheckboxPrimitive.Root
|
|
ref={ref}
|
|
className={cn(
|
|
"peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
|
|
className
|
|
)}
|
|
{...props}
|
|
>
|
|
<CheckboxPrimitive.Indicator
|
|
className={cn("flex items-center justify-center text-current")}
|
|
>
|
|
<LuCheck className="h-4 w-4" />
|
|
</CheckboxPrimitive.Indicator>
|
|
</CheckboxPrimitive.Root>
|
|
));
|
|
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|