From 1ea1878fe4fe8cb3b877cfebd1e74957c325402d Mon Sep 17 00:00:00 2001 From: Hussam Ghazzi Date: Fri, 8 Nov 2024 16:46:44 -0500 Subject: [PATCH] =?UTF-8?q?Revert=20"feat(TextInput):=20Update=20TextInput?= =?UTF-8?q?=20to=20use=20data=20attributes=20for=20styling=20=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 706d272e1e3e97809e2e3f5a91959b5e3aae5b93. --- .changeset/real-fans-tap.md | 5 - .../TextInputWithTokens.tsx | 6 +- .../react/src/__tests__/Textarea.test.tsx | 8 +- .../__snapshots__/Autocomplete.test.tsx.snap | 1141 +--- .../__snapshots__/TextInput.test.tsx.snap | 5607 ++++------------- .../TextInputWithTokens.test.tsx.snap | 4915 ++++----------- .../internal/components/TextInputWrapper.tsx | 363 +- packages/react/src/utils/testing.tsx | 12 +- 8 files changed, 2784 insertions(+), 9273 deletions(-) delete mode 100644 .changeset/real-fans-tap.md diff --git a/.changeset/real-fans-tap.md b/.changeset/real-fans-tap.md deleted file mode 100644 index f419b1ad11d..00000000000 --- a/.changeset/real-fans-tap.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@primer/react": minor ---- - -Convert TextInput to use data attributes diff --git a/packages/react/src/TextInputWithTokens/TextInputWithTokens.tsx b/packages/react/src/TextInputWithTokens/TextInputWithTokens.tsx index fa03c61a48e..e2c97ac77f1 100644 --- a/packages/react/src/TextInputWithTokens/TextInputWithTokens.tsx +++ b/packages/react/src/TextInputWithTokens/TextInputWithTokens.tsx @@ -13,7 +13,7 @@ import Token from '../Token/Token' import type {TokenSizeKeys} from '../Token/TokenBase' import type {TextInputSizes} from '../internal/components/TextInputWrapper' -import TextInputWrapper from '../internal/components/TextInputWrapper' +import TextInputWrapper, {textInputHorizPadding} from '../internal/components/TextInputWrapper' import UnstyledTextInput from '../internal/components/UnstyledTextInput' import TextInputInnerVisualSlot from '../internal/components/TextInputInnerVisualSlot' @@ -266,8 +266,8 @@ function TextInputWithTokensInnerComponent { width: '100%', display: 'flex', } - const defaultStyles = renderStyles(