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

Tweaks to v2 components based on Sam's notes #1649

Merged
merged 5 commits into from
Aug 6, 2024

Conversation

jessepinho
Copy link
Contributor

@jessepinho jessepinho commented Aug 6, 2024

Based on a recent convo with Sam, we decided to make some a few tweaks to existing v2 components:

  • Button's no longer have to be of primary priority by default. There are a number of contexts in which they can be secondary. Thus, priority is now a prop, rather than a context, to make it easier to set priority.
  • The first button in a button group is no longer required to be primary, because there are many cases where all buttons in a group will be of equal priority (e.g., the Staking page, where someone can delegate or undelegate).
    • Instead, button groups now have a hasPrimaryButton boolean prop. When set to true, the first button in a button group will be marked as primary.
  • When a button has iconOnly='adornment', there will no longer be a focus outline on the button when it is clicked, since it didn't really look good.
  • Use a real <Button /> for closing a dialog.

Copy link

changeset-bot bot commented Aug 6, 2024

⚠️ No Changeset found

Latest commit: 4463753

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link
Contributor

github-actions bot commented Aug 6, 2024

Visit the preview URL for this PR (updated for commit 4463753):

https://penumbra-ui-preview--pr1649-jessepinho-component-uhxpia21.web.app

(expires Tue, 13 Aug 2024 05:25:15 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 709d729610ef7a6369b23f1cb2b820a60cc685b1

@@ -88,24 +96,31 @@ export const ButtonGroup = ({
*/}
{isIconOnly(props) &&
props.buttons.map((button, index) => (
<ButtonPriorityContext.Provider key={index} value={index === 0 ? 'primary' : 'secondary'}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We got rid of the context, so now we just pass the priority directly to the button.

Comment on lines +231 to +237
<Density compact>
<RadixDialog.Close asChild>
<Button icon={X} iconOnly priority='secondary'>
Close
</Button>
</RadixDialog.Close>
</Density>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

@jessepinho jessepinho marked this pull request as ready for review August 6, 2024 05:27
@jessepinho jessepinho changed the title WIP: Tweaks to v2 components based on Sam's notes Tweaks to v2 components based on Sam's notes Aug 6, 2024
@jessepinho jessepinho requested a review from a team August 6, 2024 05:27
Copy link
Contributor

@VanishMax VanishMax left a comment

Choose a reason for hiding this comment

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

Dialog is 🔥🔥🔥

@jessepinho jessepinho merged commit afaaee9 into main Aug 6, 2024
8 checks passed
@jessepinho jessepinho deleted the jessepinho/component-tweaks branch August 6, 2024 18:07
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.

2 participants