Skip to content

Commit 9a471d4

Browse files
Updating docs and examples for tag component (#5379)
* tag: deprecation kind note * updating docs * next link
1 parent ba318d3 commit 9a471d4

3 files changed

Lines changed: 31 additions & 53 deletions

File tree

documentation-site/examples/tag/kinds.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@ export default function Scenario() {
55
return (
66
<React.Fragment>
77
{[
8-
KIND.primary,
9-
KIND.accent,
10-
KIND.positive,
11-
KIND.negative,
12-
KIND.warning,
8+
KIND.gray,
9+
KIND.blue,
10+
KIND.green,
11+
KIND.red,
12+
KIND.yellow,
13+
KIND.orange,
14+
KIND.purple,
15+
KIND.magenta,
16+
KIND.teal,
17+
KIND.lime,
1318
].map((kind) => (
1419
<div>
1520
<Tag

documentation-site/examples/tag/primitive.tsx

Lines changed: 0 additions & 39 deletions
This file was deleted.

documentation-site/pages/components/tag.mdx

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import Exports from "../../components/exports";
44

55
import Basic from "examples/tag/basic.tsx";
66
import Hierarchy from "examples/tag/variants.tsx";
7-
import Primitive from "examples/tag/primitive.tsx";
87
import Kinds from "examples/tag/kinds.tsx";
98
import Size from "examples/tag/size.tsx";
109
import NonClickable from "examples/tag/non-clickable.tsx";
@@ -16,6 +15,7 @@ import CustomColor from "examples/tag/custom-color.tsx";
1615

1716
import { Tag } from "baseui/tag";
1817
import * as TagExports from "baseui/tag";
18+
import { Notification, KIND as NOTIFICATION_KIND } from "baseui/notification";
1919

2020
import Yard from "../../components/yard/index";
2121
import tagYardConfig from "../../components/yard/config/tag";
@@ -38,17 +38,29 @@ Compact UI to display a collection of concise information.
3838
<Basic />
3939
</Example>
4040

41-
<Example title="Semantic KIND values" path="tag/kinds.tsx">
41+
<Example title="Supported KIND values" path="tag/kinds.tsx">
4242
<Kinds />
4343
</Example>
4444

45-
You can change the color of the tag by passing a value to the `kind` prop. Here we see the set of "semantic" color options. These will reflect the `negative`, `positive`, etc values that you use in your theme.
46-
47-
<Example title="Primitive KIND values" path="tag/primitive.tsx">
48-
<Primitive />
49-
</Example>
50-
51-
In addition to the "semantic" `kind` colors, you can also use "primitive" colors such as `blue` or `green`. Some of these simply alias the "semantic" colors (and therefore your theme), but there are also color-ways not contained in the "semantic" set, such as `orange`, `purple`, and `brown`.
45+
<Notification
46+
overrides={{ Body: { style: { width: "auto", margin: "16px 0 0 0" } } }}
47+
kind={NOTIFICATION_KIND.warning}
48+
>
49+
The following tag kinds are deprecated. Please migrate to the recommended
50+
primitive kinds shown in the example above:
51+
<ul>
52+
<li>`neutral` → use `gray`</li>
53+
<li>`primary` → use `gray`</li>
54+
<li>`accent` → use `blue`</li>
55+
<li>`positive` → use `green`</li>
56+
<li>`warning` → use `yellow`</li>
57+
<li>`negative` → use `red`</li>
58+
<li>`black` → use `gray` with custom styling</li>
59+
<li>`brown` → no direct replacement (deprecated color)</li>
60+
</ul>
61+
</Notification>
62+
63+
You can change the color of the tag by passing a value to the `kind` prop. Supported kinds include `gray`, `blue`, `green`, `yellow`, `red`, `orange`, `purple`, `magenta`, `teal`, and `lime`.
5264

5365
<Example title="Tag hierarchy Prop Type" path="tag/variants.tsx">
5466
<Hierarchy />

0 commit comments

Comments
 (0)