Skip to content

Commit c630afd

Browse files
committed
alert solid and icon variant examples
1 parent 603e8a0 commit c630afd

File tree

7 files changed

+54
-4
lines changed

7 files changed

+54
-4
lines changed

app/(sink)/demo/components/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ export default function page() {
8888
</Alert.Description>
8989
</Alert>
9090

91-
<Alert variant="secondary">
91+
<Alert variant="solid">
9292
<Alert.Title>Heads up!</Alert.Title>
9393
<Alert.Description>
9494
You can add components to your app using the cli.
9595
</Alert.Description>
9696
</Alert>
97-
<Alert variant="secondary" className="flex items-center">
97+
<Alert variant="solid" className="flex items-center">
9898
<CheckCircle className="h-4 w-4 mr-4" />
9999
<div>
100100
<Alert.Title>Heads up!</Alert.Title>

config/components.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ export const componentConfig = {
4040
filePath: "preview/components/alert-style-default.tsx",
4141
preview: lazy(() => import("@/preview/components/alert-style-default")),
4242
},
43+
"alert-style-solid": {
44+
name: "alert-style-solid",
45+
filePath: "preview/components/alert-style-solid.tsx",
46+
preview: lazy(() => import("@/preview/components/alert-style-solid")),
47+
},
48+
"alert-style-with-icon": {
49+
name: "alert-style-with-icon",
50+
filePath: "preview/components/alert-style-with-icon.tsx",
51+
preview: lazy(() => import("@/preview/components/alert-style-with-icon")),
52+
},
4353
"avatar-style-circle": {
4454
name: "avatar-style-circle",
4555
filePath: "preview/components/avatar-style-circle.tsx",

content/docs/components/alert.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,15 @@ npm install class-variance-authority
3030
### Default
3131

3232
<ComponentShowcase name="alert-style-default" />
33+
<br />
34+
<br />
35+
36+
### Solid
37+
38+
<ComponentShowcase name="alert-style-solid" />
39+
<br />
40+
<br />
41+
42+
### With Icon
43+
44+
<ComponentShowcase name="alert-style-with-icon" />

packages/ui/Alerts/Alert.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const alertVariants = cva("relative w-full border-2 border-black p-4", {
88
variants: {
99
variant: {
1010
default: "bg-primary-300 text-foreground",
11-
secondary: "bg-black text-white",
11+
solid: "bg-black text-white",
1212
destructive:
1313
"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
1414
},

preview/components/alert-style-default.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default function AlertStyleDefault() {
55
<Alert>
66
<Alert.Title>Heads up!</Alert.Title>
77
<Alert.Description>
8-
You can add components to your app using the cli.
8+
This is where you can write description that no one reads...
99
</Alert.Description>
1010
</Alert>
1111
);
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Alert } from "@/packages/ui";
2+
3+
export default function AlertStyleDefault() {
4+
return (
5+
<Alert variant="solid">
6+
<Alert.Title>Heads up!</Alert.Title>
7+
<Alert.Description>
8+
This is where you can write description that no one reads...
9+
</Alert.Description>
10+
</Alert>
11+
);
12+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Alert } from "@/packages/ui";
2+
import { CheckCircle } from "lucide-react";
3+
4+
export default function AlertStyleDefault() {
5+
return (
6+
<Alert className="flex">
7+
<CheckCircle className="h-5 w-5 mr-4 mt-2" />
8+
<div>
9+
<Alert.Title>Heads up!</Alert.Title>
10+
<Alert.Description>
11+
This is where you can write description that no one reads...
12+
</Alert.Description>
13+
</div>
14+
</Alert>
15+
);
16+
}

0 commit comments

Comments
 (0)