"use client" import * as CheckboxPrimitive from "@radix-ui/react-checkbox" import * as React from "react" import { CheckboxCheckmarkIcon } from "../icons-v2-generated/signs-and-symbols/checkbox-checkmark-icon" import { cn } from "../../utils/cn" interface CheckboxBlockProps { id?: string checked?: boolean defaultChecked?: boolean onCheckedChange?: (checked: boolean) => void /** Primary label (supports rich text / ReactNode for inline links) */ label: React.ReactNode /** Optional secondary description below the label (supports rich text / ReactNode) */ description?: React.ReactNode /** Keep the label on one line and ellipsize on overflow instead of wrapping */ truncateLabel?: boolean /** * Optional trailing slot rendered at the end of the row (e.g. an action * button). Interactive content must call `preventDefault` on click to stop * the wrapping label from toggling the checkbox. */ trailing?: React.ReactNode disabled?: boolean /** Error message displayed below the block (also triggers red border) */ error?: string className?: string } const CheckboxBlock = React.forwardRef< React.ComponentRef, CheckboxBlockProps >(({ id, checked, defaultChecked, onCheckedChange, label, description, truncateLabel, trailing, disabled, error, className }, ref) => (
{error && (

{error}

)}
)) CheckboxBlock.displayName = "CheckboxBlock" export { CheckboxBlock } export type { CheckboxBlockProps }