Skip to content

fix(ProgressBar): pass-through style props #6169

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

Merged
merged 3 commits into from
Jun 11, 2025
Merged

Conversation

hussam-i-am
Copy link
Contributor

@hussam-i-am hussam-i-am commented Jun 5, 2025

Changelog

New

Changed

  • Appends the passed in style props to the existing styles object

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

Merge checklist

@hussam-i-am hussam-i-am self-assigned this Jun 5, 2025
@Copilot Copilot AI review requested due to automatic review settings June 5, 2025 02:39
@hussam-i-am hussam-i-am requested a review from a team as a code owner June 5, 2025 02:39
@hussam-i-am hussam-i-am requested a review from francinelucca June 5, 2025 02:39
Copy link

changeset-bot bot commented Jun 5, 2025

🦋 Changeset detected

Latest commit: 3202498

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

@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 Jun 5, 2025
Copy link
Contributor

github-actions bot commented Jun 5, 2025

👋 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!

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enables consumers to pass a style prop to the ProgressBar.Item component and have it merged with the component’s internal CSS custom properties.

  • Destructure and forward the style prop in ProgressBar.Item
  • Change internal styles object to React.CSSProperties
  • Merge internal styles and consumer-provided styles when rendering

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/react/src/ProgressBar/ProgressBar.tsx Destructure style, convert styles to React.CSSProperties, and merge it with incoming style
.changeset/small-baboons-press.md Add changeset for style prop pass-through
Comments suppressed due to low confidence (2)

packages/react/src/ProgressBar/ProgressBar.tsx:35

  • New style prop pass-through functionality lacks unit tests. Consider adding tests to verify that custom style properties are correctly merged and override internal styles.
style,

packages/react/src/ProgressBar/ProgressBar.tsx:35

  • Component documentation and Storybook stories should be updated to reflect that the style prop is now supported and passed through to the root element.
style,

export * from 'react'

declare module 'react' {
interface CSSProperties {
Copy link
Member

Choose a reason for hiding this comment

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

can you elaborate as to why this is needed? 🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, forgot to mention it in the description, this updates the definition of CSSProperties to allow for CSS variables, so that we can just used React.CSS properties as the type in https://github.com/primer/react/pull/6169/files#diff-c755511099c2739a4276dc3b714e3ad5083385129f4fb3a461115179c50cbcbcR52, instead of {[key: string]: string} which is a bit too generic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually looks like its causing the build to fail, so reverting that part of the change

@github-actions github-actions bot requested a deployment to storybook-preview-6169 June 5, 2025 02:49 Abandoned
@hussam-i-am hussam-i-am changed the title fix(ProgressBar): pass through style prop fix(ProgressBar): pass-through style prop Jun 5, 2025
@github-actions github-actions bot requested a deployment to storybook-preview-6169 June 5, 2025 02:56 Abandoned
Copy link
Contributor

github-actions bot commented Jun 5, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 94.55 KB (+0.06% 🔺)
packages/react/dist/browser.umd.js 94.71 KB (+0.08% 🔺)

@hussam-i-am hussam-i-am changed the title fix(ProgressBar): pass-through style prop fix(ProgressBar): pass-through style props Jun 5, 2025
@jonrohan jonrohan added this pull request to the merge queue Jun 11, 2025
Merged via the queue into main with commit 15f942d Jun 11, 2025
38 checks passed
@jonrohan jonrohan deleted the hussam-i-am/fix-progress-bar branch June 11, 2025 18:30
@primer primer bot mentioned this pull request Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ProgressBar.Item does not pass through style prop
3 participants