Skip to content

Deprecate textinput contrast #4991

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5 changes: 5 additions & 0 deletions .changeset/slow-boats-roll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': minor
---

Deprecate `contrast` prop of TextInput and TextInputWithTokens
1 change: 1 addition & 0 deletions packages/react/src/TextInput/TextInput.docs.json
Original file line number Diff line number Diff line change
@@ -77,6 +77,7 @@
"name": "contrast",
"type": "boolean",
"defaultValue": "false",
"deprecated": true,
"description": "Changes background color to a higher contrast color"
},
{
2 changes: 1 addition & 1 deletion packages/react/src/TextInput/TextInput.tsx
Original file line number Diff line number Diff line change
@@ -66,7 +66,6 @@ const TextInput = React.forwardRef<HTMLInputElement, TextInputProps>(
trailingAction,
block,
className,
contrast,
disabled,
loading,
loaderPosition = 'auto',
@@ -82,6 +81,7 @@ const TextInput = React.forwardRef<HTMLInputElement, TextInputProps>(
minWidth: minWidthProp,
maxWidth: maxWidthProp,
variant: variantProp,
contrast,
// end deprecated props
type = 'text',
required,
Original file line number Diff line number Diff line change
@@ -79,7 +79,7 @@ function TextInputWithTokensInnerComponent<TokenComponentType extends AnyReactCo
trailingVisual: TrailingVisual,
loading,
loaderPosition = 'auto',
contrast,
contrast, // deprecated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'd also want to add the @deprecated decorator to the contrast prop in the StyledTextInputBaseWrapperProps object.
Though I do see this is also used in Select in addition to TextInput,TextArea and TextInputWithTokens.
@mperrotti wondering if we're good to remove contrast for all of these or should we explore a different strategy? 🤔

className,
block,
disabled,