diff --git a/packages/components/src/components/tag/_tag.scss b/packages/components/src/components/tag/_tag.scss index 218e6928f20d..070cf3972d4e 100644 --- a/packages/components/src/components/tag/_tag.scss +++ b/packages/components/src/components/tag/_tag.scss @@ -18,6 +18,7 @@ .#{$prefix}--tag { @include button-reset($width: false); @include type-style('label-01'); + @include tag-theme($ibm-color__gray-20, $ibm-color__gray-100); display: inline-flex; align-items: center; diff --git a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap index a189c9c43d6e..dd413f0a77f6 100644 --- a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap +++ b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap @@ -4726,7 +4726,6 @@ Map { "warm-gray", ], ], - "isRequired": true, "type": "oneOf", }, }, diff --git a/packages/react/src/components/Tag/Tag-story.js b/packages/react/src/components/Tag/Tag-story.js index 1b9ddcf8971a..ac070b5afe9e 100644 --- a/packages/react/src/components/Tag/Tag-story.js +++ b/packages/react/src/components/Tag/Tag-story.js @@ -21,9 +21,10 @@ const props = { ...acc, [`${type} (${type})`]: type, }), - {} - ), - 'red' + { + Default: undefined, + } + ) ), disabled: boolean('Disabled (disabled)', false), title: 'Clear Filter', diff --git a/packages/react/src/components/Tag/Tag.js b/packages/react/src/components/Tag/Tag.js index 2b484c81b6b8..9d0614705cb4 100644 --- a/packages/react/src/components/Tag/Tag.js +++ b/packages/react/src/components/Tag/Tag.js @@ -35,10 +35,11 @@ const Tag = ({ disabled, ...other }) => { - const tagClass = `${prefix}--tag--${type}`; - const tagClasses = classNames(`${prefix}--tag`, tagClass, className, { + const tagId = id || `tag-${getInstanceId()}`; + const tagClasses = classNames(`${prefix}--tag`, className, { [`${prefix}--tag--disabled`]: disabled, [`${prefix}--tag--filter`]: filter, + [`${prefix}--tag--${type}`]: type, }); return filter ? (