Skip to content

Commit 56e5d6a

Browse files
committed
added badge error and success varients
1 parent 59a64b1 commit 56e5d6a

File tree

4 files changed

+72
-23
lines changed

4 files changed

+72
-23
lines changed

config/components.ts

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,33 @@ export const componentConfig = {
99
),
1010
codeHtml: `<div class="space-y-4 mx-auto">
1111
<details class="border-2 border-black shadow-md hover:shadow-sm transition-all overflow-hidden">
12-
<summary class="px-4 py-2 font-head text-black cursor-pointer focus:outline-none">
13-
Accordion Item 1
14-
</summary>
15-
<div class="px-4 py-2 font-body bg-white text-gray-700">
16-
This is the content of the first accordion item. It is styled with
17-
Tailwind CSS.
18-
</div>
12+
<summary class="px-4 py-2 font-head text-black cursor-pointer focus:outline-none">
13+
Accordion Item 1
14+
</summary>
15+
<div class="px-4 py-2 font-body bg-white text-gray-700">
16+
This is the content of the first accordion item. It is styled with
17+
Tailwind CSS.
18+
</div>
1919
</details>
2020
2121
<details class="border-2 border-black shadow-md hover:shadow-sm transition-all overflow-hidden">
22-
<summary class="px-4 py-2 font-head text-black cursor-pointer focus:outline-none">
23-
Accordion Item 2
24-
</summary>
25-
<div class="px-4 py-2 font-body bg-white text-gray-700">
26-
This is the content of the second accordion item. It has a similar
27-
style to maintain consistency.
28-
</div>
22+
<summary class="px-4 py-2 font-head text-black cursor-pointer focus:outline-none">
23+
Accordion Item 2
24+
</summary>
25+
<div class="px-4 py-2 font-body bg-white text-gray-700">
26+
This is the content of the second accordion item. It has a similar
27+
style to maintain consistency.
28+
</div>
2929
</details>
3030
3131
<details class="border-2 border-black shadow-md hover:shadow-sm transition-all overflow-hidden">
32-
<summary class="px-4 py-2 font-head text-black cursor-pointer focus:outline-none">
33-
Accordion Item 3
34-
</summary>
35-
<div class="px-4 py-2 font-body bg-white text-gray-700">
36-
This is the content of the third accordion item. The details element
37-
handles the toggle behavior.
38-
</div>
32+
<summary class="px-4 py-2 font-head text-black cursor-pointer focus:outline-none">
33+
Accordion Item 3
34+
</summary>
35+
<div class="px-4 py-2 font-body bg-white text-gray-700">
36+
This is the content of the third accordion item. The details element
37+
handles the toggle behavior.
38+
</div>
3939
</details>
4040
</div>`,
4141
},
@@ -55,6 +55,20 @@ export const componentConfig = {
5555
preview: lazy(() => import("@/preview/components/badge-style-default")),
5656
codeHtml: `<span className="border-black text-black border-2 px-2 py-1 text-sm">
5757
Badge
58+
</span>`,
59+
},
60+
"badge-style-success": {
61+
name: "badge-style-default",
62+
preview: lazy(() => import("@/preview/components/badge-style-success")),
63+
codeHtml: `<span className="border-green-600 text-green-600 bg-green-50 border-2 px-2 py-1 text-sm">
64+
Badge
65+
</span>`,
66+
},
67+
"badge-style-error": {
68+
name: "badge-style-default",
69+
preview: lazy(() => import("@/preview/components/badge-style-error")),
70+
codeHtml: `<span className="border-red-600 text-red-600 bg-red-50 border-2 px-2 py-1 text-sm">
71+
Badge
5872
</span>`,
5973
},
6074
"button-style-default": {

content/docs/components/badge.mdx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
11
---
2-
title: Default Badge
2+
title: Badge
33
description: The component that looks like a button that's not clickable!
44
lastUpdated: 30 Sep, 2024
55
---
66

7-
<ComponentShowcase name="badge-style-default" />
7+
## default
8+
<hr/>
9+
<br/>
10+
<ComponentShowcase name="badge-style-default" />
11+
<br/>
12+
<br/>
13+
14+
## Success
15+
<hr/>
16+
<br/>
17+
<ComponentShowcase name="badge-style-success" />
18+
<br/>
19+
<br/>
20+
21+
## Error
22+
<hr/>
23+
<br/>
24+
<ComponentShowcase name="badge-style-error" />
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from "react";
2+
3+
export default function BadgeStyleError() {
4+
return (
5+
<span className="border-2 px-2 py-1 text-sm border-red-600 text-red-600 bg-red-50">
6+
Badge
7+
</span>
8+
);
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from "react";
2+
3+
export default function BadgeStyleSuccess() {
4+
return (
5+
<span className=" border-2 px-2 py-1 text-sm border-green-600 text-green-600 bg-green-50">
6+
Badge
7+
</span>
8+
);
9+
}

0 commit comments

Comments
 (0)