{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "mc-checkbox",
  "title": "MicroClub Checkbox",
  "description": "A checkbox component for MicroClub UI",
  "dependencies": [
    "@base-ui/react",
    "lucide-react"
  ],
  "files": [
    {
      "path": "registry/ui/mc-checkbox.tsx",
      "content": "'use client';\n\nimport * as React from 'react';\nimport { Checkbox as CheckboxPrimitive } from '@base-ui/react/checkbox';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { CheckIcon } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nconst checkboxVariants = cva(\n  'peer relative flex shrink-0 items-center justify-center rounded-[4px] border transition-colors outline-none disabled:cursor-not-allowed disabled:pointer-events-none disabled:opacity-50',\n  {\n    variants: {\n      size: {\n        sm: 'size-4 [&_[data-slot=checkbox-indicator]>svg]:size-3',\n        md: 'size-5 [&_[data-slot=checkbox-indicator]>svg]:size-3.5',\n      },\n    },\n    defaultVariants: {\n      size: 'sm',\n    },\n  }\n);\n\nconst textVariants = cva('font-medium transition-colors', {\n  variants: {\n    size: {\n      sm: 'text-sm',\n      md: 'text-base',\n    },\n    disabled: {\n      true: 'text-muted-foreground',\n      false: 'text-foreground',\n    },\n  },\n  defaultVariants: {\n    size: 'sm',\n    disabled: false,\n  },\n});\n\nconst supportTextVariants = cva('font-regular', {\n  variants: {\n    size: {\n      sm: 'text-sm',\n      md: 'text-base',\n    },\n  },\n  defaultVariants: {\n    size: 'sm',\n  },\n});\n\nexport interface McCheckboxProps\n  extends CheckboxPrimitive.Root.Props, VariantProps<typeof checkboxVariants> {\n  text?: string;\n  supportText?: string;\n}\n\nfunction McCheckbox({\n  className,\n  size = 'sm',\n  text,\n  supportText,\n  id,\n  disabled,\n  checked,\n  onCheckedChange,\n  ...props\n}: McCheckboxProps) {\n  const checkboxId = React.useId();\n  const finalId = id ?? checkboxId;\n  const labelId = text ? `${finalId}-label` : undefined;\n  const descriptionId = supportText ? `${finalId}-description` : undefined;\n\n  return (\n    <label\n      htmlFor={finalId}\n      className={cn(\n        'inline-flex',\n        size === 'sm' ? 'gap-2' : 'gap-3',\n        supportText ? 'items-start' : 'items-center',\n        disabled ? 'cursor-not-allowed' : 'cursor-pointer',\n        className\n      )}\n    >\n      <CheckboxPrimitive.Root\n        id={finalId}\n        data-slot=\"checkbox\"\n        className={cn(\n          checkboxVariants({ size }),\n          'self-start mt-0.5',\n          'bg-primary-foreground border-muted-foreground',\n          'hover:border-primary',\n          'focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring',\n          'focus-within:outline-none focus-within:ring-4 focus-within:ring-ring',\n          'data-disabled:border-muted-foreground data-disabled:hover:border-muted-foreground',\n          'data-checked:border-primary'\n        )}\n        checked={checked}\n        onCheckedChange={onCheckedChange}\n        disabled={disabled}\n        aria-labelledby={labelId}\n        aria-describedby={descriptionId}\n        {...props}\n      >\n        <CheckboxPrimitive.Indicator\n          data-slot=\"checkbox-indicator\"\n          className=\"flex items-center justify-center text-current data-disabled:text-muted-foreground\"\n        >\n          <CheckIcon className=\"stroke-3\" />\n        </CheckboxPrimitive.Indicator>\n      </CheckboxPrimitive.Root>\n\n      {(text || supportText) && (\n        <span className={cn('flex flex-col', size === 'sm' ? 'gap-0' : 'gap-0.5')}>\n          {text && (\n            <span id={labelId} className={textVariants({ size, disabled: !!disabled })}>\n              {text}\n            </span>\n          )}\n          {supportText && (\n            <span id={descriptionId} className={supportTextVariants({ size })}>\n              {supportText}\n            </span>\n          )}\n        </span>\n      )}\n    </label>\n  );\n}\n\nexport { McCheckbox };\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}