mirror of
https://github.com/cosscom/coss.git
synced 2026-09-14 20:06:50 +08:00
14 lines
2.8 KiB
JSON
14 lines
2.8 KiB
JSON
{
|
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
"name": "input",
|
|
"type": "registry:ui",
|
|
"dependencies": ["@base-ui-components/react"],
|
|
"files": [
|
|
{
|
|
"path": "registry/default/ui/input.tsx",
|
|
"content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Input as InputPrimitive } from \"@base-ui-components/react/input\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype InputProps = Omit<\n InputPrimitive.Props & React.RefAttributes<HTMLInputElement>,\n \"size\"\n> & {\n size?: \"sm\" | \"default\" | \"lg\" | number\n unstyled?: boolean\n}\n\nfunction Input({\n className,\n size = \"default\",\n unstyled = false,\n ...props\n}: InputProps) {\n return (\n <span\n data-slot=\"input-control\"\n data-size={size}\n className={\n cn(\n !unstyled &&\n \"relative inline-flex w-full rounded-lg border border-input bg-background bg-clip-padding text-base/5 shadow-xs ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] has-focus-visible:border-ring has-focus-visible:ring-[3px] has-disabled:opacity-64 has-aria-invalid:border-destructive/36 has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none sm:text-sm dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/8%)] dark:has-aria-invalid:ring-destructive/24\",\n className\n ) || undefined\n }\n >\n <InputPrimitive\n data-slot=\"input\"\n className={cn(\n \"w-full min-w-0 rounded-[inherit] px-[calc(--spacing(3)-1px)] py-[calc(--spacing(1.5)-1px)] outline-none placeholder:text-muted-foreground/64\",\n size === \"sm\" &&\n \"px-[calc(--spacing(2.5)-1px)] py-[calc(--spacing(1)-1px)]\",\n size === \"lg\" && \"py-[calc(--spacing(2)-1px)]\",\n props.type === \"search\" &&\n \"[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none\",\n props.type === \"file\" &&\n \"text-muted-foreground file:me-3 file:bg-transparent file:text-sm file:font-medium file:text-foreground\"\n )}\n size={typeof size === \"number\" ? size : undefined}\n {...props}\n />\n </span>\n )\n}\n\nexport { Input, type InputProps }\n",
|
|
"type": "registry:ui"
|
|
}
|
|
]
|
|
}
|