Skip to content

Commit 729c0fa

Browse files
authored
feat(TextInput): Convert TextInput (Part 1) - Deprecate width props (#5253)
* feat(TextInput): Remove width props from TextInput * type fixes * lint fix * remove unused imports * Update to deprecate props * Properly mark props as deprecated
1 parent 0389f42 commit 729c0fa

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.changeset/clean-ligers-approve.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/react": minor
3+
---
4+
5+
Deprecate width, minWidth and maxWidth props from TextInput

packages/react/src/internal/components/TextInputWrapper.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import styled, {css} from 'styled-components'
2-
import type {MaxWidthProps, MinWidthProps, WidthProps} from 'styled-system'
2+
import type {ResponsiveValue} from 'styled-system'
33
import {maxWidth, minWidth, variant, width} from 'styled-system'
44
import {get} from '../../constants'
55
import type {SxProp} from '../../sx'
@@ -56,10 +56,13 @@ export type StyledBaseWrapperProps = {
5656
isInputFocused?: boolean
5757
monospace?: boolean
5858
validationStatus?: FormValidationStatus
59-
} & WidthProps &
60-
MinWidthProps &
61-
MaxWidthProps &
62-
SxProp
59+
/** @deprecated Update `width` using CSS modules or style. */
60+
width?: string | number | ResponsiveValue<string | number>
61+
/** @deprecated Update `min-width` using CSS modules or style. */
62+
minWidth?: string | number | ResponsiveValue<string | number>
63+
/** @deprecated Update `max-width` using CSS modules or style. */
64+
maxWidth?: string | number | ResponsiveValue<string | number>
65+
} & SxProp
6366

6467
export type StyledWrapperProps = {
6568
hasLeadingVisual?: boolean

0 commit comments

Comments
 (0)