{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "color-text", "title": "ColorText", "description": "Polymorphic text with color, size, lineClamp and margin variants.", "dependencies": [ "class-variance-authority" ], "registryDependencies": [ "andre-hctulc/react-base/variants-util" ], "files": [ { "path": "src/components/color-text.tsx", "content": "import { type FC, type ComponentProps } from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"@/lib/utils.js\";\nimport { msz } from \"@/lib/variants.util.js\";\nimport { Slot } from \"radix-ui\";\n\nconst colorTextVariants = cva(\"\", {\n variants: {\n color: {\n error: \"text-destructive\",\n success: \"text-success\",\n warning: \"text-warning\",\n info: \"text-info\",\n },\n textSize: {\n xs: \"text-xs\",\n sm: \"text-sm\",\n base: \"text-base\",\n md: \"text-md\",\n lg: \"text-lg\",\n xl: \"text-xl\",\n \"2xl\": \"text-2xl\",\n \"3xl\": \"text-3xl\",\n \"4xl\": \"text-4xl\",\n \"5xl\": \"text-5xl\",\n \"6xl\": \"text-6xl\",\n \"7xl\": \"text-7xl\",\n },\n lineClamp: {\n none: \"\",\n \"1\": \"line-clamp-1\",\n \"2\": \"line-clamp-2\",\n \"3\": \"line-clamp-3\",\n \"4\": \"line-clamp-4\",\n \"5\": \"line-clamp-5\",\n \"6\": \"line-clamp-6\",\n \"7\": \"line-clamp-7\",\n \"8\": \"line-clamp-8\",\n \"9\": \"line-clamp-9\",\n \"10\": \"line-clamp-10\",\n },\n m: msz(\"m\"),\n mx: msz(\"mx\"),\n my: msz(\"my\"),\n mt: msz(\"mt\"),\n mr: msz(\"mr\"),\n mb: msz(\"mb\"),\n ml: msz(\"ml\"),\n me: msz(\"me\"),\n ms: msz(\"ms\"),\n },\n defaultVariants: { color: \"info\" },\n});\n\nexport interface ColorTextProps\n extends Omit, \"color\">, VariantProps {\n asChild?: boolean;\n}\n\nexport const ColorText: FC = (props) => {\n const {\n color,\n textSize,\n lineClamp,\n m,\n mx,\n my,\n mt,\n mr,\n mb,\n ml,\n me,\n ms,\n className,\n children,\n asChild,\n ...restProps\n } = props;\n const Comp: any = asChild ? Slot : \"p\";\n return (\n \n {children}\n \n );\n};\n\nexport const SuccessText: FC = (props) => ;\n\nexport const ErrorText: FC = (props) => ;\n", "type": "registry:ui" } ], "type": "registry:ui" }