Skip to content

Commit

Permalink
fix tag hierarchy issues (#5333)
Browse files Browse the repository at this point in the history
  • Loading branch information
lhbrennan authored Jun 27, 2024
1 parent d43fc06 commit 83c122a
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions documentation-site/examples/input/with-tags.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from "react";
import { useStyletron } from "baseui";
import { Input, StyledInput } from "baseui/input";
import { Tag, VARIANT as TAG_VARIANT } from "baseui/tag";
import { Tag, HIERARCHY } from "baseui/tag";

const InputReplacement = React.forwardRef(
({ tags, removeTag, ...restProps }: any, ref) => {
Expand All @@ -17,7 +17,7 @@ const InputReplacement = React.forwardRef(
>
{tags.map((tag: string, index: number) => (
<Tag
variant={TAG_VARIANT.solid}
hierarchy={HIERARCHY.primary}
onActionClick={() => removeTag(tag)}
key={index}
>
Expand Down
4 changes: 2 additions & 2 deletions documentation-site/examples/table-grid/nested.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function Tasks(props: { tasks: any[] }) {
<StyledBodyCell>
<Tag
closeable={false}
variant="outlined"
hierarchy="secondary"
kind={statusToTagKind(task[1])}
>
{task[1]}
Expand Down Expand Up @@ -184,7 +184,7 @@ function Row({ striped, row }: any) {
<CenteredBodyCell $striped={striped}>
<Tag
closeable={false}
variant="outlined"
hierarchy="secondary"
kind={statusToTagKind(row[1])}
>
{row[1]}
Expand Down
2 changes: 1 addition & 1 deletion documentation-site/pages/blog/base-web-v7/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ You can simply remove the `shape="square"` property.

## Tag

We've removed the deprecated `COLOR_STYLE_KEYS` export from the Tag component. Instead of that, please use the `KIND` and `VARIANT` exports.
We've removed the deprecated `COLOR_STYLE_KEYS` export from the Tag component. Instead of that, please use the `KIND` and `HIERARCHY` exports.

## RadioGroup

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LICENSE file in the root directory of this source tree.
//
import * as React from "react";
import Yard from "../../../components/yard/index";
import { Tag, KIND, VARIANT, SIZE } from "baseui/tag";
import { Tag, KIND, HIERARCHY, SIZE } from "baseui/tag";
import { PropTypes } from "react-view";

const tagYardConfig = {
Expand All @@ -20,7 +20,7 @@ const tagYardConfig = {
scope: {
Tag,
KIND,
VARIANT,
HIERARCHY,
SIZE,
},
theme: [
Expand Down Expand Up @@ -115,16 +115,16 @@ const tagYardConfig = {
type: PropTypes.String,
description: `The color theme to be applied to a Tag. To make this custom color active, you have to set kind to custom.`,
},
variant: {
value: "VARIANT.light",
defaultValue: "VARIANT.light",
options: VARIANT,
hierarchy: {
value: "HIERARCHY.secondary",
defaultValue: "HIERARCHY.secondary",
options: HIERARCHY,
type: PropTypes.Enum,
description:
"Defines tags look. Set it to one of VARIANT[key] values. Defaults to VARIANT.light.",
"Defines tags look. Set it to one of HIERARCHY[key] values. Defaults to HIERARCHY.secondary.",
imports: {
"baseui/tag": {
named: ["VARIANT"],
named: ["HIERARCHY"],
},
},
},
Expand Down
6 changes: 3 additions & 3 deletions documentation-site/pages/components/tag.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Layout from "../../components/layout";
import Exports from "../../components/exports";

import Basic from "examples/tag/basic.tsx";
import Variants from "examples/tag/variants.tsx";
import Hierarchy from "examples/tag/variants.tsx";
import Primitive from "examples/tag/primitive.tsx";
import Kinds from "examples/tag/kinds.tsx";
import Size from "examples/tag/size.tsx";
Expand Down Expand Up @@ -50,8 +50,8 @@ You can change the color of the tag by passing a value to the `kind` prop. Here

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`.

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

<Example title="Tag sizing" path="tag/size.tsx">
Expand Down
4 changes: 2 additions & 2 deletions src/table-grid/__tests__/table-grid-jobs.scenario.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ function Tasks(props: { tasks: Task[] }) {
<>
<StyledBodyCell>{task[0]}</StyledBodyCell>
<StyledBodyCell>
<Tag closeable={false} variant="outlined" kind={statusToTagKind(task[1])}>
<Tag closeable={false} hierarchy="secondary" kind={statusToTagKind(task[1])}>
{task[1]}
</Tag>
</StyledBodyCell>
Expand Down Expand Up @@ -205,7 +205,7 @@ function Row(props: RowProps) {
{props.row[0]}
</CenteredBodyCell>
<CenteredBodyCell {...props.getCellProps(1)} $striped={props.striped}>
<Tag closeable={false} variant="outlined" kind={statusToTagKind(props.row[1])}>
<Tag closeable={false} hierarchy="secondary" kind={statusToTagKind(props.row[1])}>
{props.row[1]}
</Tag>
</CenteredBodyCell>
Expand Down

0 comments on commit 83c122a

Please sign in to comment.