import("@/preview/components/accordion-style-default")
),
},
+ "alert-style-default": {
+ name: "alert-style-default",
+ filePath: "preview/components/alert-style-default.tsx",
+ preview: lazy(() => import("@/preview/components/alert-style-default")),
+ },
+ "alert-style-solid": {
+ name: "alert-style-solid",
+ filePath: "preview/components/alert-style-solid.tsx",
+ preview: lazy(() => import("@/preview/components/alert-style-solid")),
+ },
+ "alert-style-with-icon": {
+ name: "alert-style-with-icon",
+ filePath: "preview/components/alert-style-with-icon.tsx",
+ preview: lazy(() => import("@/preview/components/alert-style-with-icon")),
+ },
+ "alert-style-all-status": {
+ name: "alert-style-all-status",
+ filePath: "preview/components/alert-style-all-status.tsx",
+ preview: lazy(
+ () => import("@/preview/components/alert-style-all-status")
+ ),
+ },
"avatar-style-circle": {
name: "avatar-style-circle",
filePath: "preview/components/avatar-style-circle.tsx",
diff --git a/config/navigation.ts b/config/navigation.ts
index e8cd3ac..d40ede8 100644
--- a/config/navigation.ts
+++ b/config/navigation.ts
@@ -17,6 +17,7 @@ export const navConfig: INavigationConfig = {
title: "Components",
children: [
{ title: "Accordion", href: `${componentsRoute}/accordion` },
+ { title: "Alert", href: `${componentsRoute}/alert` },
{ title: "Avatar", href: `${componentsRoute}/avatar` },
{ title: "Badge", href: `${componentsRoute}/badge` },
{ title: "Button", href: `${componentsRoute}/button` },
diff --git a/content/docs/components/alert.mdx b/content/docs/components/alert.mdx
new file mode 100644
index 0000000..bd6b3f3
--- /dev/null
+++ b/content/docs/components/alert.mdx
@@ -0,0 +1,50 @@
+---
+title: Alert
+description: Notify your users about important events and updates. 📣
+lastUpdated: 24 Oct, 2024
+---
+
+
+
+
+
+## Installation
+
+#### 1. Install dependencies:
+
+```sh
+npm install class-variance-authority
+```
+
+
+
+#### 2. Copy the code 👇 into your project:
+
+
+
+
+
+
+## Examples
+
+### Default
+
+
+
+
+
+### Solid
+
+
+
+
+
+### With Icon
+
+
+
+
+
+### Status
+
+
diff --git a/packages/ui/Alerts/Alert.tsx b/packages/ui/Alerts/Alert.tsx
new file mode 100644
index 0000000..1c4c1d6
--- /dev/null
+++ b/packages/ui/Alerts/Alert.tsx
@@ -0,0 +1,59 @@
+import { HtmlHTMLAttributes } from "react";
+import { cva, type VariantProps } from "class-variance-authority";
+
+import { cn } from "@/lib/utils";
+import { Text } from "../Text";
+
+const alertVariants = cva("relative w-full border-2 border-black p-4", {
+ variants: {
+ variant: {
+ default: "bg-primary-300 text-foreground",
+ solid: "bg-black text-white",
+ destructive:
+ "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
+ },
+ status: {
+ error: "bg-red-300 text-red-800 border-red-800",
+ success: "bg-green-300 text-green-800 border-green-800",
+ warning: "bg-yellow-300 text-yellow-800 border-yellow-800",
+ info: "bg-blue-300 text-blue-800 border-blue-800",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ },
+});
+
+interface IAlertProps
+ extends HtmlHTMLAttributes
,
+ VariantProps {}
+
+const Alert = ({ className, variant, status, ...props }: IAlertProps) => (
+
+);
+Alert.displayName = "Alert";
+
+interface IAlertTitleProps extends HtmlHTMLAttributes {}
+const AlertTitle = ({ className, ...props }: IAlertTitleProps) => (
+
+);
+AlertTitle.displayName = "AlertTitle";
+
+interface IAlertDescriptionProps
+ extends HtmlHTMLAttributes {}
+const AlertDescription = ({ className, ...props }: IAlertDescriptionProps) => (
+
+);
+
+AlertDescription.displayName = "AlertDescription";
+
+const AlertComponent = Object.assign(Alert, {
+ Title: AlertTitle,
+ Description: AlertDescription,
+});
+
+export { AlertComponent as Alert };
diff --git a/packages/ui/Alerts/index.ts b/packages/ui/Alerts/index.ts
new file mode 100644
index 0000000..b8e17a0
--- /dev/null
+++ b/packages/ui/Alerts/index.ts
@@ -0,0 +1 @@
+export * from "./Alert";
diff --git a/packages/ui/index.ts b/packages/ui/index.ts
index 47bbd77..ad7e609 100644
--- a/packages/ui/index.ts
+++ b/packages/ui/index.ts
@@ -2,6 +2,7 @@ export * from "./Buttons";
export * from "./Form";
export * from "./Text";
export * from "./Accordions";
+export * from "./Alerts";
export * from "./Cards";
export * from "./Avatars";
export * from "./Badges";
diff --git a/preview/components/alert-style-all-status.tsx b/preview/components/alert-style-all-status.tsx
new file mode 100644
index 0000000..fe25394
--- /dev/null
+++ b/preview/components/alert-style-all-status.tsx
@@ -0,0 +1,25 @@
+import { Alert } from "@/packages/ui";
+import { CheckCircle, InfoIcon, XIcon } from "lucide-react";
+
+export default function AlertAllStatus() {
+ return (
+
+
+
+ This is a success alert!
+
+
+
+ This is an info alert!
+
+
+
+ This is an error alert!
+
+
+
+ This is an error alert!
+
+
+ );
+}
diff --git a/preview/components/alert-style-default.tsx b/preview/components/alert-style-default.tsx
new file mode 100644
index 0000000..5cb12b5
--- /dev/null
+++ b/preview/components/alert-style-default.tsx
@@ -0,0 +1,12 @@
+import { Alert } from "@/packages/ui";
+
+export default function AlertStyleDefault() {
+ return (
+
+ Heads up!
+
+ This is where you can write description that no one reads...
+
+
+ );
+}
diff --git a/preview/components/alert-style-solid.tsx b/preview/components/alert-style-solid.tsx
new file mode 100644
index 0000000..fd4239a
--- /dev/null
+++ b/preview/components/alert-style-solid.tsx
@@ -0,0 +1,12 @@
+import { Alert } from "@/packages/ui";
+
+export default function AlertStyleDefault() {
+ return (
+
+ Heads up!
+
+ This is where you can write description that no one reads...
+
+
+ );
+}
diff --git a/preview/components/alert-style-with-icon.tsx b/preview/components/alert-style-with-icon.tsx
new file mode 100644
index 0000000..7172a93
--- /dev/null
+++ b/preview/components/alert-style-with-icon.tsx
@@ -0,0 +1,16 @@
+import { Alert } from "@/packages/ui";
+import { CheckCircle } from "lucide-react";
+
+export default function AlertStyleDefault() {
+ return (
+
+
+
+
Heads up!
+
+ This is where you can write description that no one reads...
+
+
+
+ );
+}