chore: first commit

This commit is contained in:
Daniil
2026-02-17 23:36:55 +03:00
parent 2e4820ac91
commit 674d5d735b
116 changed files with 327 additions and 150 deletions
+32
View File
@@ -0,0 +1,32 @@
"use client"
import type { IAlertProps } from "./Alert.d"
import type { JSX } from "react"
import { Callout } from "@radix-ui/themes"
import { AlertCircle, CheckCircle, Info, TriangleAlert } from "lucide-react"
import { forwardRef } from "react"
const variantMap = {
info: { color: "blue", Icon: Info },
success: { color: "green", Icon: CheckCircle },
warning: { color: "yellow", Icon: TriangleAlert },
danger: { color: "red", Icon: AlertCircle },
} as const
export const Alert = forwardRef<HTMLDivElement, IAlertProps>(
({ variant = "info", children, ...props }, ref): JSX.Element => {
const { color, Icon } = variantMap[variant]
return (
<Callout.Root ref={ref} color={color} role="alert" {...props}>
<Callout.Icon>
<Icon size={16} />
</Callout.Icon>
<Callout.Text>{children}</Callout.Text>
</Callout.Root>
)
},
)
Alert.displayName = "Alert"