Skip to content

Commit 7d7b797

Browse files
CopilotTylerJDev
andauthored
Deprecate TextInputWithTokens (#6713)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: TylerJDev <26746305+TylerJDev@users.noreply.github.com> Co-authored-by: Tyler Jones <tylerjdev@github.com>
1 parent 0466819 commit 7d7b797

File tree

6 files changed

+31
-20
lines changed

6 files changed

+31
-20
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@primer/react': major
3+
---
4+
5+
Deprecate TextInputWithTokens component. The component has been moved to the deprecated entrypoint due to low usage and accessibility implications. Import from `@primer/react/deprecated` instead of `@primer/react`.

e2e/components/TextInputWithTokens.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,31 @@ import {themes} from '../test-helpers/themes'
44

55
const stories = [
66
{
7-
id: 'components-textinputwithtokens--default',
7+
id: 'deprecated-components-textinputwithtokens--default',
88
title: 'Default',
99
},
1010
{
11-
id: 'components-textinputwithtokens-features--with-leading-visual',
11+
id: 'deprecated-components-textinputwithtokens-features--with-leading-visual',
1212
title: 'With Leading Visual',
1313
},
1414
{
15-
id: 'components-textinputwithtokens-features--with-trailing-visual',
15+
id: 'deprecated-components-textinputwithtokens-features--with-trailing-visual',
1616
title: 'With Trailing Visual',
1717
},
1818
{
19-
id: 'components-textinputwithtokens-features--max-height',
19+
id: 'deprecated-components-textinputwithtokens-features--max-height',
2020
title: 'Max Height',
2121
},
2222
{
23-
id: 'components-textinputwithtokens-features--prevent-tokens-from-wrapping',
23+
id: 'deprecated-components-textinputwithtokens-features--prevent-tokens-from-wrapping',
2424
title: 'Prevent Tokens From Wrapping',
2525
},
2626
{
27-
id: 'components-textinputwithtokens-features--size',
27+
id: 'deprecated-components-textinputwithtokens-features--size',
2828
title: 'Size',
2929
},
3030
{
31-
id: 'components-textinputwithtokens-features--truncated',
31+
id: 'deprecated-components-textinputwithtokens-features--truncated',
3232
title: 'Truncated',
3333
},
3434
] as const

packages/react/src/TextInputWithTokens/TextInputWithTokens.docs.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
{
22
"id": "text_input_with_tokens",
33
"name": "TextInputWithTokens",
4-
"status": "alpha",
4+
"status": "deprecated",
55
"a11yReviewed": "2025-01-08",
66
"stories": [
77
{
8-
"id": "components-textinputwithtokens--default"
8+
"id": "deprecated-components-textinputwithtokens--default"
99
},
1010
{
11-
"id": "components-textinputwithtokens-features--with-leading-visual"
11+
"id": "deprecated-components-textinputwithtokens-features--with-leading-visual"
1212
},
1313
{
14-
"id": "components-textinputwithtokens-features--with-trailing-visual"
14+
"id": "deprecated-components-textinputwithtokens-features--with-trailing-visual"
1515
},
1616
{
17-
"id": "components-textinputwithtokens-features--with-loading-indicator"
17+
"id": "deprecated-components-textinputwithtokens-features--with-loading-indicator"
1818
},
1919
{
20-
"id": "components-textinputwithtokens-features--using-issue-label-tokens"
20+
"id": "deprecated-components-textinputwithtokens-features--using-issue-label-tokens"
2121
},
2222
{
23-
"id": "components-textinputwithtokens-features--unstyled"
23+
"id": "deprecated-components-textinputwithtokens-features--unstyled"
2424
},
2525
{
26-
"id": "components-textinputwithtokens-features--prevent-tokens-from-wrapping"
26+
"id": "deprecated-components-textinputwithtokens-features--prevent-tokens-from-wrapping"
2727
},
2828
{
29-
"id": "components-textinputwithtokens-features--max-height"
29+
"id": "deprecated-components-textinputwithtokens-features--max-height"
3030
},
3131
{
32-
"id": "components-textinputwithtokens-features--size"
32+
"id": "deprecated-components-textinputwithtokens-features--size"
3333
},
3434
{
35-
"id": "components-textinputwithtokens-features--truncated"
35+
"id": "deprecated-components-textinputwithtokens-features--truncated"
3636
}
3737
],
3838
"importPath": "@primer/react",

packages/react/src/TextInputWithTokens/TextInputWithTokens.features.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import classes from './TextInputWithTokens.features.stories.module.css'
1111
const excludedControls = ['tokens', 'onTokenRemove', 'tokenComponent', ...textInputExcludedControlKeys]
1212

1313
export default {
14-
title: 'Components/TextInputWithTokens/Features',
14+
title: 'Deprecated/Components/TextInputWithTokens/Features',
1515
}
1616

1717
const mockTokens = [

packages/react/src/TextInputWithTokens/TextInputWithTokens.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import classes from './TextInputWithTokens.stories.module.css'
1818
const excludedControls = ['tokens', 'onTokenRemove', 'tokenComponent', ...textInputExcludedControlKeys]
1919

2020
export default {
21-
title: 'Components/TextInputWithTokens',
21+
title: 'Deprecated/Components/TextInputWithTokens',
2222
component: TextInputWithTokens,
2323
parameters: {controls: {exclude: excludedControls}},
2424
} as Meta

packages/react/src/TextInputWithTokens/TextInputWithTokens.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ type AnyReactComponent = React.ComponentType<React.PropsWithChildren<any>>
2323

2424
// NOTE: if these props or their JSDoc comments are updated, be sure to also update
2525
// the prop table in docs/content/TextInputTokens.mdx
26+
/**
27+
* @deprecated
28+
*/
2629
export type TextInputWithTokensProps<TokenComponentType extends AnyReactComponent = typeof Token> = {
2730
/**
2831
* The array of tokens to render
@@ -336,4 +339,7 @@ const TextInputWithTokens = React.forwardRef(TextInputWithTokensInnerComponent)
336339

337340
TextInputWithTokens.displayName = 'TextInputWithTokens'
338341

342+
/**
343+
* @deprecated
344+
*/
339345
export default TextInputWithTokens

0 commit comments

Comments
 (0)