-
Notifications
You must be signed in to change notification settings - Fork 538
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
UnderlineNav with updated design for states and counter #2277
Conversation
🦋 Changeset detectedLatest commit: 0699ae0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
size-limit report 📦
|
|
||
const UnderlineNav = Object.assign(Nav, { | ||
Link: UnderlineNavLink | ||
Item: UnderlineNavItem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be a breaking change wrt to the old UnderlineNav. We will need to mention it in the changelog.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The focus rings work so well! 💯
I can see two things out of place.
- The underline from the nav seems to have gone away.
- The selected underline seems a bit longer on both sides compared to the Item.
Also I'm sceptical about the name change from UnderlineNav.Link to UnderlineNav.Item. It would break existing API. Though, I agree its a change that makes full sense. Not sure how to proceed with it honestly.
Thanks for the review @pksjce !
I used the states reference from Figma and there is no underline there so I though this line must have been removed with the updated design but for all the other references in Figma, the line is there! I added it back ✨ Sorry for the confusion!
Yes, you are right! I might have missed that. I also realised there was way too much margin between the li items. So all together, I re-styled them and this is for the reference to compare before and after. (I updated the PR description as well with the new screenshots) Before And the design
Yeah I agree. It makes sense to me too and I see other "new" components such as ActionList uses Item too so it is good to be consistent. I guess we can discuss with others as well and find the best strategy to move forward with the major release. |
Sorry for the confusion about the removal of the underline. I initially intentionally removed it so that with the removal of But now that we have a clearer idea of what needs to be supported (and not) and how we'll move forward in the mid-long term, we should bring the underline back. |
I think the name change from |
d87eb23
to
fcf6cf5
Compare
<Box as="ul" sx={merge<BetterSystemStyleObject>(overflowStyles, ulStyles)}> | ||
{responsiveProps.items} | ||
</Box> | ||
|
||
{actions.length > 0 && ( | ||
<ActionMenu> | ||
<ActionMenu.Button>More</ActionMenu.Button> | ||
<ActionMenu.Button sx={{m: 0}}>More</ActionMenu.Button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to fix extra margin around the button on safari
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow, can you add a comment here about this?
/** | ||
* Counter | ||
*/ | ||
counter?: number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danielguillan - Wondering if we are going to support loading state for counters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just making a comment here for the types. I added the counter prop with only number type just to make the Counter component redundant. We can add another type for the loading state if we are going to support 😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we are going to support loading states. We can add support incrementally in another PR if that makes things easier.
.changeset/thirty-mayflies-travel.md
Outdated
@@ -0,0 +1,5 @@ | |||
--- | |||
'@primer/react': major |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this should be a major change yet. We'll kind of block ourselves doing that. Once we make all the changes, we can graduate from drafts to main folder with a major change. Could you do that before merging?
Closes #1240
UnderlineNav has updated design and this PR is for the updated states (default, selected, hover and focus state) as well as adding counter as a prop.
Screenshots
Screen Recording
UnderlineNav.focus._.hover._.selected.states.mp4
Merge checklist
Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.