Files
cosscom__coss/apps/ui/public/r/checkbox.json
Volnei Munhoz d5a915e6d0 add biome
2025-11-13 19:19:31 -03:00

14 lines
3.0 KiB
JSON

{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "checkbox",
"type": "registry:ui",
"dependencies": ["@base-ui-components/react"],
"files": [
{
"path": "registry/default/ui/checkbox.tsx",
"content": "\"use client\"\n\nimport { Checkbox as CheckboxPrimitive } from \"@base-ui-components/react/checkbox\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"relative inline-flex size-4 shrink-0 items-center justify-center rounded-[0.25rem] border border-input bg-background bg-clip-padding shadow-xs ring-ring transition-shadow outline-none before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(0.25rem-1px)] not-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-64 aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:ring-destructive/48 dark:bg-clip-border dark:not-data-checked:bg-input/32 dark:not-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/8%)] dark:aria-invalid:ring-destructive/24 [&:is(:disabled,[data-checked],[aria-invalid])]:shadow-none\",\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"absolute -inset-px flex items-center justify-center rounded-[0.25rem] text-primary-foreground data-checked:bg-primary data-indeterminate:text-foreground data-unchecked:hidden\"\n render={(props, state) => (\n <span {...props}>\n {state.indeterminate ? (\n <svg\n className=\"size-3\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"3\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M5.252 12h13.496\" />\n </svg>\n ) : (\n <svg\n className=\"size-3\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"3\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M5.252 12.7 10.2 18.63 18.748 5.37\" />\n </svg>\n )}\n </span>\n )}\n />\n </CheckboxPrimitive.Root>\n )\n}\n\nexport { Checkbox }\n",
"type": "registry:ui"
}
]
}