diff --git a/src/components/ui/Alert.stories.tsx b/src/components/ui/Alert.stories.tsx
index c8df6b2..438524e 100644
--- a/src/components/ui/Alert.stories.tsx
+++ b/src/components/ui/Alert.stories.tsx
@@ -1,5 +1,29 @@
import type { Meta, StoryObj } from "@storybook/react";
-import { Alert, AlertTitle, AlertDescription } from "./alert";
+import React from "react";
+import {
+ AlertTriangle,
+ CheckCircle,
+ Info as InfoIcon,
+ X,
+ XCircle,
+} from "lucide-react";
+import { Alert, AlertAction, AlertDescription, AlertTitle } from "./alert";
+import { Button } from "./button";
+
+const VARIANT_ICONS = {
+ default: InfoIcon,
+ destructive: XCircle,
+ success: CheckCircle,
+ warning: AlertTriangle,
+ info: InfoIcon,
+} as const;
+
+type AlertVariant = keyof typeof VARIANT_ICONS;
+
+function AlertIcon({ variant }: { variant: AlertVariant }) {
+ const Icon = VARIANT_ICONS[variant] ?? InfoIcon;
+ return ;
+}
const meta = {
title: "UI/Alert",
@@ -19,8 +43,9 @@ export default meta;
type Story = StoryObj;
export const Default: Story = {
- render: () => (
-
+ args: { variant: "default" },
+ render: (args) => (
+ TitleDescription text goes here.
@@ -28,8 +53,9 @@ export const Default: Story = {
};
export const Destructive: Story = {
- render: () => (
-
+ args: { variant: "destructive" },
+ render: (args) => (
+ ErrorSomething went wrong.
@@ -37,21 +63,19 @@ export const Destructive: Story = {
};
export const Success: Story = {
- args: {
- variant: "default"
- },
-
- render: () => (
-
+ args: { variant: "success" },
+ render: (args) => (
+ SuccessYour changes have been saved.
- )
+ ),
};
export const Warning: Story = {
- render: () => (
-
+ args: { variant: "warning" },
+ render: (args) => (
+ WarningPlease review before continuing.
@@ -59,10 +83,90 @@ export const Warning: Story = {
};
export const Info: Story = {
- render: () => (
-
+ args: { variant: "info" },
+ render: (args) => (
+ InfoNew update available.
),
};
+
+const defaultVariant: AlertVariant = "default";
+
+export const WithDescription: Story = {
+ args: { variant: defaultVariant },
+ render: (args) => (
+
+
+ Hold on I need at least a few minutes!
+
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry.
+
+
+
+
+
+ ),
+};
+
+export const WithoutDescription: Story = {
+ args: { variant: defaultVariant },
+ render: (args) => (
+
+
+ Hold on I need at least a few minutes!
+
+
+
+
+ ),
+};
+
+export const WithButtons: Story = {
+ args: { variant: defaultVariant },
+ render: (args) => (
+
+
+
+ Hold on I need at least a few minutes!
+
+
+
+
+
+
+
+
+
+ ),
+};
+
+export const WithDescriptionAndButtons: Story = {
+ args: { variant: defaultVariant },
+ render: (args) => (
+
+
+ Hold on I need at least a few minutes!
+
+ This process may take a few minutes to complete. See the{" "}
+ documentation for more details.
+
+
+
+
+
+
+
+
+
+ ),
+};
diff --git a/src/components/ui/Confirmation.stories.tsx b/src/components/ui/Confirmation.stories.tsx
new file mode 100644
index 0000000..169356a
--- /dev/null
+++ b/src/components/ui/Confirmation.stories.tsx
@@ -0,0 +1,128 @@
+import type { Meta, StoryObj } from "@storybook/react";
+import React, { useState } from "react";
+import { Confirmation, Button, Notice } from "./index";
+import { CircleMinus } from "lucide-react";
+
+function LeaveWithUnsavedChangesDemo() {
+ const [open, setOpen] = useState(false);
+ return (
+ <>
+
+ setOpen(false)}
+ title="Are you sure you want to leave?"
+ body="You have unsaved changes."
+ confirmLabel="Leave"
+ cancelLabel="Stay in page"
+ onConfirm={() => setOpen(false)}
+ />
+ >
+ );
+}
+
+function CancelSubscriptionDemo() {
+ const [open, setOpen] = useState(false);
+ return (
+ <>
+
+ setOpen(false)}
+ title="Are you sure you want to cancel the subscription plan?"
+ body={
+
+
+ Next billing date is 25th March 2024 and reassign
+ is not possible for recurring subscription
+