diff --git a/.changeset/deprecate-issue-label-token.md b/.changeset/deprecate-issue-label-token.md new file mode 100644 index 00000000000..1343e7741bd --- /dev/null +++ b/.changeset/deprecate-issue-label-token.md @@ -0,0 +1,5 @@ +--- +'@primer/react': minor +--- + +Deprecate `IssueLabelToken` in favor of `IssueLabel` from `@primer/react/experimental`. diff --git a/packages/react/src/Token/IssueLabelToken.tsx b/packages/react/src/Token/IssueLabelToken.tsx index 0ab2131e147..3e4cc52e903 100644 --- a/packages/react/src/Token/IssueLabelToken.tsx +++ b/packages/react/src/Token/IssueLabelToken.tsx @@ -11,6 +11,9 @@ import type {ForwardRefComponent as PolymorphicForwardRefComponent} from '../uti import classes from './IssueLabelToken.module.css' import {clsx} from 'clsx' +/** + * @deprecated Use `IssueLabel` from `@primer/react/experimental` instead. + */ export interface IssueLabelTokenProps extends TokenBaseProps { /** * The color that corresponds to the label @@ -18,6 +21,13 @@ export interface IssueLabelTokenProps extends TokenBaseProps { fillColor?: string } +/** + * @deprecated Use `IssueLabel` from `@primer/react/experimental` instead. + * `fillColor` carries over (as a `#hex` value). `IssueLabel` also accepts a `variant` for preset colors and + * renders a `span`, `a` (with `href`) or `button` (with `onClick`) based on the props provided. + * It has no `text`, `size`, `isSelected`, `onRemove` or `hideRemoveButton` props: pass the label text as `children` + * and render your own remove control if one is needed. `id` is forwarded to the root element, so convert numeric ids to strings. + */ const IssueLabelToken = forwardRef((props, forwardedRef) => { const { as, diff --git a/packages/react/src/Token/Token.docs.json b/packages/react/src/Token/Token.docs.json index ba6a2bdc11a..65a36ee7585 100644 --- a/packages/react/src/Token/Token.docs.json +++ b/packages/react/src/Token/Token.docs.json @@ -85,6 +85,7 @@ "subcomponents": [ { "name": "IssueLabelToken", + "deprecated": true, "props": [ { "name": "fillColor",