mirror of
https://github.com/cosscom/coss.git
synced 2026-09-14 20:06:50 +08:00
22 lines
1.8 KiB
JSON
22 lines
1.8 KiB
JSON
{
|
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
"name": "field",
|
|
"type": "registry:ui",
|
|
"dependencies": ["@base-ui-components/react"],
|
|
"files": [
|
|
{
|
|
"path": "registry/default/ui/field.tsx",
|
|
"content": "\"use client\"\n\nimport { Field as FieldPrimitive } from \"@base-ui-components/react/field\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Field({ className, ...props }: FieldPrimitive.Root.Props) {\n return (\n <FieldPrimitive.Root\n data-slot=\"field\"\n className={cn(\"flex flex-col items-start gap-2\", className)}\n {...props}\n />\n )\n}\n\nfunction FieldLabel({ className, ...props }: FieldPrimitive.Label.Props) {\n return (\n <FieldPrimitive.Label\n data-slot=\"field-label\"\n className={cn(\"inline-flex items-center gap-2 text-sm/4\", className)}\n {...props}\n />\n )\n}\n\nfunction FieldDescription({\n className,\n ...props\n}: FieldPrimitive.Description.Props) {\n return (\n <FieldPrimitive.Description\n data-slot=\"field-description\"\n className={cn(\"text-xs text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nfunction FieldError({ className, ...props }: FieldPrimitive.Error.Props) {\n return (\n <FieldPrimitive.Error\n data-slot=\"field-error\"\n className={cn(\"text-xs text-destructive-foreground\", className)}\n {...props}\n />\n )\n}\n\nconst FieldControl = FieldPrimitive.Control\nconst FieldValidity = FieldPrimitive.Validity\n\nexport {\n Field,\n FieldLabel,\n FieldDescription,\n FieldError,\n FieldControl,\n FieldValidity,\n}\n",
|
|
"type": "registry:ui"
|
|
}
|
|
],
|
|
"cssVars": {
|
|
"light": {
|
|
"destructive-foreground": "var(--color-red-700)"
|
|
},
|
|
"dark": {
|
|
"destructive-foreground": "var(--color-red-400)"
|
|
}
|
|
}
|
|
}
|