Skip to content

UI: Update Button types to allow for no children on iconOnly buttons#23735

Merged
kasperpeulen merged 4 commits into
nextfrom
charles-update-button-types
Aug 7, 2023
Merged

UI: Update Button types to allow for no children on iconOnly buttons#23735
kasperpeulen merged 4 commits into
nextfrom
charles-update-button-types

Conversation

@cdedreuille
Copy link
Copy Markdown
Contributor

What I did

I improved the types of the new Button component to allow for iconOnly buttons to not have children.

How to test

  1. Run this branch locally
  2. Test the Button anywhere with <Button iconOnly icon={<><>} />
  3. You should not see any typescript errors

Checklist

  • Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests)
  • Make sure to add/update documentation regarding your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli/src/sandbox-templates.ts
  • Make sure this PR contains one of the labels below.

["cleanup", "BREAKING CHANGE", "feature request", "bug", "build", "documentation", "maintenance", "dependencies", "other"]

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>

@cdedreuille cdedreuille added maintenance User-facing maintenance tasks ci:normal Run our default set of CI jobs (choose this for most PRs). patch:no labels Aug 7, 2023
@cdedreuille cdedreuille self-assigned this Aug 7, 2023
@cdedreuille cdedreuille requested a review from JReinhold as a code owner August 7, 2023 06:17
@cdedreuille cdedreuille changed the title Update Button types to allow for no children on iconOnly buttons UI: Update Button types to allow for no children on iconOnly buttons Aug 7, 2023
}

type ButtonIconOnlyProps = {
iconOnly?: true;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this should not be optional in this case

Copy link
Copy Markdown
Contributor Author

@cdedreuille cdedreuille Aug 7, 2023

Choose a reason for hiding this comment

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

Thanks. I made it mandatory.

Copy link
Copy Markdown
Member

@kasperpeulen kasperpeulen left a comment

Choose a reason for hiding this comment

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

LGTM!

@kasperpeulen kasperpeulen merged commit f21fde3 into next Aug 7, 2023
@kasperpeulen kasperpeulen deleted the charles-update-button-types branch August 7, 2023 08:45
@github-actions github-actions Bot mentioned this pull request Aug 7, 2023
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:normal Run our default set of CI jobs (choose this for most PRs). maintenance User-facing maintenance tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants