{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "alert",
"title": "Alert",
"description": "TDDS-styled alert with info, warning, error, and success variants",
"dependencies": [
"class-variance-authority"
],
"registryDependencies": [
"utils"
],
"files": [
{
"path": "registry/ui/alert.tsx",
"content": "import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\n// USWDS-style filled circle icons (black background, white symbol)\nconst AlertInfoIcon = () => (\n \n)\n\nconst AlertWarningIcon = () => (\n \n)\n\nconst AlertErrorIcon = () => (\n \n)\n\nconst AlertSuccessIcon = () => (\n \n)\n\nconst alertVariants = cva(\n \"flex gap-3 border-l-8 px-4 py-3 text-left text-sm w-full relative group/alert text-treasury-ink\",\n {\n variants: {\n variant: {\n default: \"border-l-treasury-base bg-treasury-base-lightest\",\n info: \"border-l-treasury-primary-light bg-treasury-primary-lightest\",\n warning: \"border-l-treasury-accent bg-treasury-accent-lightest\",\n error: \"border-l-treasury-warning bg-treasury-warning-lightest\",\n success: \"border-l-treasury-secondary bg-treasury-secondary-lightest\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nfunction Alert({\n className,\n variant,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps) {\n const IconComponent = {\n default: null,\n info: AlertInfoIcon,\n warning: AlertWarningIcon,\n error: AlertErrorIcon,\n success: AlertSuccessIcon,\n }[variant || \"default\"]\n\n return (\n \n {IconComponent &&
}\n
{children}
\n
\n )\n}\n\nfunction AlertTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction AlertDescription({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nfunction AlertAction({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n )\n}\n\nexport { Alert, AlertTitle, AlertDescription, AlertAction }\n",
"type": "registry:ui"
}
],
"type": "registry:ui"
}