Skip to content

Conversation

@pablonete
Copy link
Contributor

@pablonete pablonete commented Feb 1, 2024

sx was supported but it wasn't applied on top of standard Header styles.

<Dialog.Header sx={{borderBottomWidth: 0}}>

This does nothing because sx is listed on the props but it's ignored on the component. It's the only component missing it (see Title, Subtitle, Body, and Footer).

Our use case is dropping the section borders in the dialog for a design where the dialog content has its own border, so we don't want separators on Header or Footer.
Based on this, I'm also leaving the feedback that removing section borders requires repeating the header/footer template, which is risky (we had to duplicate even the focusZone in the Footer) as it will get out of sync of future improvements in the dialog. Quickly thinking, I'd suggest something like headerSx or footerSx in the Dialog to prevent this duplication: we're using renderHeader only to modify the style, not to fully replace the template. Any feedback here is welcome.

Changelog

No API changes.

New

Changed

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

When using renderHeader, we couldn't use Dialog.Header to change the style, so we had to use a Box and copy & change the styles from the Dialog.Header definition.

Merge checklist

@pablonete pablonete requested review from a team and pksjce February 1, 2024 12:36
@changeset-bot
Copy link

changeset-bot bot commented Feb 1, 2024

🦋 Changeset detected

Latest commit: 4b9648a

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 Patch

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
Copy link
Contributor

github-actions bot commented Feb 1, 2024

size-limit report 📦

Path Size
dist/browser.esm.js 113.23 KB (-0.01% 🔽)
dist/browser.umd.js 113.88 KB (-0.01% 🔽)

Copy link
Member

@broccolinisoup broccolinisoup left a comment

Choose a reason for hiding this comment

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

Hello @pablonete 👋🏻 Thanks so much for raising this PR. It looks good to me! 👍🏻

We appreciate the feedback as well. I'll share it with the team, it is a super reasonable point 🙏🏻

@pablonete pablonete added this pull request to the merge queue Feb 6, 2024
Merged via the queue into main with commit ff35460 Feb 6, 2024
@pablonete pablonete deleted the pablonete/honor-sx-dialog-header branch February 6, 2024 08:12
@primer primer bot mentioned this pull request Feb 6, 2024
@siddharthkp
Copy link
Member

@pablonete That's very good feedback, thanks! renderHeader is not a great API because it recommends ejecting out of future updates :(

re: headerSx, there is another way to do that already which might work for you. You can target the header from an sx on the Dialog like this:

<Dialog 
  sx={{
    [Dialog.Header]: {boxShadow: 'none'},
}}/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants