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

feat(button): add destructive, secondary button type #1424

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

cooper-joe
Copy link
Member

@cooper-joe cooper-joe commented Nov 15, 2023

Implements LIBS-544 / UX-157


Description

This PR implements, or allows, buttons that are both destructive and secondary. secondary prop is now used as a modifier rather than a standalone type, as it can be applied to both basic and destructive types. (Using secondary alone is considered a modifier applied to the default basic type.)

In order to allow this, the secondary prop is no longer part of the shared prop types provided by UI constants.

Question: is this a breaking change? I believe all button usages are unaffected by this change, but I'm not sure if changing PropType definitions always counts as a breaking change.


Checklist

  • API docs are generated
  • Tests were added
  • Storybook demos were added

All points above should be relevant for feature PRs. For bugfixes, some points might not be relevant. In that case, just check them anyway to signal the work is done.


Screenshots

image

@cooper-joe cooper-joe requested a review from a team as a code owner November 15, 2023 18:50
@dhis2-bot
Copy link
Contributor

dhis2-bot commented Nov 15, 2023

🚀 Deployed on https://pr-1424--dhis2-ui.netlify.app

@dhis2-bot dhis2-bot temporarily deployed to netlify November 15, 2023 18:53 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify November 16, 2023 14:32 Inactive
Copy link

cypress bot commented Nov 16, 2023

Passing run #3133 ↗︎

0 583 0 0 Flakiness 0

Details:

feat(button): destructive secondary variant
Project: ui Commit: b72a04a93c
Status: Passed Duration: 06:29 💡
Started: Nov 27, 2023 1:21 PM Ended: Nov 27, 2023 1:27 PM

Review all test suite changes for PR #1424 ↗︎

Copy link
Collaborator

@kabaros kabaros left a comment

Choose a reason for hiding this comment

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

@Birkbjo - please note this change to propTypes, probably affects the TypeScript types you're working on

@Birkbjo
Copy link
Member

Birkbjo commented Nov 20, 2023

@Birkbjo - please note this change to propTypes, probably affects the TypeScript types you're working on

Thanks for the heads up. This should just be a simple boolean in the types. I will update the alpha branch once this is merged, and create a PR for it. I abandoned the XOR typings, as I don't think it's worth the complexity (and readability of the resulting types). Which is also in line with option 3 of @Mohammer5 suggestion above.

@dhis2-bot dhis2-bot temporarily deployed to netlify November 23, 2023 10:40 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify November 23, 2023 10:45 Inactive
feat(shared-prop-types): extract secondary button prop from exclusive props

style(button): adjust secondary destructive font weight

fix(button): remove exclusivity of type props

docs(button): add destructive secondary example
@cooper-joe cooper-joe force-pushed the button-secondary-destructive branch from 184c64a to b72a04a Compare November 27, 2023 13:14
@dhis2-bot dhis2-bot temporarily deployed to netlify November 27, 2023 13:19 Inactive
@cooper-joe cooper-joe merged commit 838610b into master Nov 27, 2023
11 checks passed
@cooper-joe cooper-joe deleted the button-secondary-destructive branch November 27, 2023 13:58
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 8.15.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants