Skip to content
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

feat(TextInput): Update TextInput to use data attributes for styling #5242

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

hussam-i-am
Copy link
Collaborator

Changelog

New

Changed

  • As a precursor to feat(TextInput): Convert TextInput to CSS module behind feature flag #5227, updated the styled components to use data attributes for styling and moved away from using the functions
  • Replaced get calls with CSS variables and removed fallbacks
  • Updated test helper to include the data attributes
  • Updated snapshots to reflect reordered styles and CSS variables

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Not sure if it is a known issue but it seems that passing in small for size does not currently do anything, whereas with the changes made, we are getting smaller inputs

Merge checklist

@hussam-i-am hussam-i-am self-assigned this Nov 6, 2024
Copy link

changeset-bot bot commented Nov 6, 2024

🦋 Changeset detected

Latest commit: 779c1f3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Nov 6, 2024

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Nov 6, 2024
@github-actions github-actions bot temporarily deployed to storybook-preview-5242 November 6, 2024 17:21 Inactive
Copy link
Contributor

github-actions bot commented Nov 6, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 98.55 KB (+0.06% 🔺)
packages/react/dist/browser.umd.js 99.09 KB (+0.29% 🔺)

expect(defaultStyles).toEqual(expect.objectContaining(expectedStyles))
expect(blockStyles).not.toEqual(expect.objectContaining(expectedStyles))
expect(defaultStyles).not.toEqual(expect.objectContaining(expectedStyles))
expect(blockStyles).toEqual(expect.objectContaining(expectedStyles))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Update so that variables accurately reflect what is being tests.

@@ -56,56 +16,37 @@ export type StyledBaseWrapperProps = {
isInputFocused?: boolean
monospace?: boolean
validationStatus?: FormValidationStatus
/** @deprecated Use `size` prop instead */
variant?: TextInputSizes
size?: TextInputSizes
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved into the base props since that is where they are being used

@github-actions github-actions bot temporarily deployed to storybook-preview-5242 November 7, 2024 00:10 Inactive
@hussam-i-am hussam-i-am marked this pull request as ready for review November 7, 2024 00:17
@hussam-i-am hussam-i-am requested a review from a team as a code owner November 7, 2024 00:17
${minWidth}
${maxWidth}
${sx}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Wrapped in & {...} to ensure it has greater specificity than data attributes for passed in sx prors

${sx};
& {
${sx}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Wrapped in & {...} to ensure it has greater specificity than data attributes for passed in sx prors

@primer-integration
Copy link

primer-integration bot commented Nov 7, 2024

🔴 golden-jobs completed with status failure.

@github-actions github-actions bot added integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Nov 7, 2024
Copy link
Member

@jonrohan jonrohan left a comment

Choose a reason for hiding this comment

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

this change looks good to me, wanna tag in @joshblack to get his review

@primer-integration
Copy link

👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/350317

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: failing Changes in this PR cause breaking changes in gh/gh
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants