{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "adminlte-progress", "title": "AdminLTE Progress Bar", "description": "Progress bar with 6 colors (aqua/red/green/yellow/blue/purple), 4 sizes, striped and animated variants, vertical mode, and description labels.", "registryDependencies": [ "https://raw.githubusercontent.com/dnachavez/adminlte-next/master/public/r/adminlte-theme.json" ], "files": [ { "path": "registry/new-york/adminlte-progress/ui/adminlte-progress.tsx", "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"@/registry/new-york/adminlte-theme/lib/cn\"\n\ntype ProgressColor =\n | \"aqua\"\n | \"red\"\n | \"green\"\n | \"yellow\"\n | \"blue\"\n | \"purple\"\n | \"light-blue\"\n | \"primary\"\n | \"success\"\n | \"info\"\n | \"warning\"\n | \"danger\"\n\ntype ProgressSize = \"xs\" | \"sm\" | \"md\" | \"xxs\"\n\nconst progressColorStyles: Record = {\n aqua: \"bg-[#00c0ef]\",\n red: \"bg-[#dd4b39]\",\n green: \"bg-[#00a65a]\",\n yellow: \"bg-[#f39c12]\",\n blue: \"bg-[#3c8dbc]\",\n purple: \"bg-[#605ca8]\",\n \"light-blue\": \"bg-[#3c8dbc]\",\n primary: \"bg-[#3c8dbc]\",\n success: \"bg-[#00a65a]\",\n info: \"bg-[#00c0ef]\",\n warning: \"bg-[#f39c12]\",\n danger: \"bg-[#dd4b39]\",\n}\n\nconst progressSizeStyles: Record = {\n xxs: \"h-[3px]\",\n xs: \"h-[7px]\",\n sm: \"h-[10px]\",\n md: \"h-[20px]\",\n}\n\ninterface AdminLTEProgressProps extends React.HTMLAttributes {\n value: number\n color?: ProgressColor\n size?: ProgressSize\n striped?: boolean\n animated?: boolean\n showLabel?: boolean\n vertical?: boolean\n description?: string\n}\n\nconst AdminLTEProgress = React.forwardRef(\n (\n {\n className,\n value,\n color = \"light-blue\",\n size = \"md\",\n striped = false,\n animated = false,\n showLabel = false,\n vertical = false,\n description,\n ...props\n },\n ref\n ) => {\n const clampedValue = Math.max(0, Math.min(100, value))\n\n if (vertical) {\n return (\n \n
\n \n
\n \n )\n }\n\n return (\n
\n {description && (\n
\n {description}\n {clampedValue}%\n
\n )}\n \n \n {showLabel && `${clampedValue}%`}\n
\n \n \n )\n }\n)\nAdminLTEProgress.displayName = \"AdminLTEProgress\"\n\nexport { AdminLTEProgress }\nexport type { AdminLTEProgressProps, ProgressColor, ProgressSize }\n", "type": "registry:ui" } ], "type": "registry:ui" }