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

[RFC]: Add new prop to Button that describes its tone #674

Open
krzysztofzuraw opened this issue Dec 6, 2023 · 2 comments
Open

[RFC]: Add new prop to Button that describes its tone #674

krzysztofzuraw opened this issue Dec 6, 2023 · 2 comments
Assignees

Comments

@krzysztofzuraw
Copy link
Member

krzysztofzuraw commented Dec 6, 2023

Short description of the feature

Add a new tone property to the Button component. The tone can be one of the following: default, critical, info, success or warning.

Full description

Currently, I can't have a Button component with the critical or info state if it is also the secondary or tertiary variant. To fix that let's add new prop tone to Button component so new API will look like this:

type ButtonProps = {
  tone?: 'default' | 'critical' | 'info' | 'success' | 'warning'
  variant: 'primary' | 'secondary' | 'tertiary'
}

<Button variant="primary" /> // if not provided tone is `default`
<Button variant="secondary" />
<Button variant="tertiary" />

<Button variant="primary" tone="critical" />
<Button variant="secondary" tone="critical" />
<Button variant="tertiary" tone="critical" />

<Button variant="primary" tone="info" />
<Button variant="secondary" tone="info" />
<Button variant="tertiary" tone="info" />

<Button variant="primary" tone="success" />
<Button variant="secondary" tone="success" />
<Button variant="tertiary" tone="success" />

<Button variant="primary" tone="warning" />
<Button variant="secondary" tone="warning" />
<Button variant="tertiary" tone="warning" />

Adding those roles will require additional tokens to be created inside contract.

Acceptance Criteria

  • Add new tokens to MacawUI:
buttonCriticalDisabled
buttonCriticalPrimary
buttonCriticalPrimaryFocused
buttonCriticalPrimaryHovered
buttonCriticalPrimaryPressed
buttonCriticalSecondary
buttonCriticalSecondaryFocused
buttonCriticalSecondaryHovered
buttonCriticalSecondaryPressed
buttonCriticalTertiary
buttonCriticalTertiaryFocused
buttonCriticalTertiaryHovered
buttonCriticalTertiaryPressed

buttonInfoDisabled
buttonInfoPrimary
buttonInfoPrimaryFocused
buttonInfoPrimaryHovered
buttonInfoPrimaryPressed
buttonInfoSecondary
buttonInfoSecondaryFocused
buttonInfoSecondaryHovered
buttonInfoSecondaryPressed
buttonInfoTertiary
buttonInfoTertiaryFocused
buttonInfoTertiaryHovered
buttonInfoTertiaryPressed

buttonSuccessDisabled
buttonSuccessPrimary
buttonSuccessPrimaryFocused
buttonSuccessPrimaryHovered
buttonSuccessPrimaryPressed
buttonSuccessSecondary
buttonSuccessSecondaryFocused
buttonSuccessSecondaryHovered
buttonSuccessSecondaryPressed
buttonSuccessTertiary
buttonSuccessTertiaryFocused
buttonSuccessTertiaryHovered
buttonSuccessTertiaryPressed

buttonWarningDisabled
buttonWarningPrimary
buttonWarningPrimaryFocused
buttonWarningPrimaryHovered
buttonWarningPrimaryPressed
buttonWarningSecondary
buttonWarningSecondaryFocused
buttonWarningSecondaryHovered
buttonWarningSecondaryPressed
buttonWarningTertiary
buttonWarningTertiaryFocused
buttonWarningTertiaryHovered
buttonWarningTertiaryPressed
  • Use new tokens to create button component with tones: default, critical, warning, info and success

Additional notes

No response

@krzysztofzuraw krzysztofzuraw self-assigned this Dec 6, 2023
@krzysztofzuraw krzysztofzuraw changed the title [RFC]: Add new prop to Button that describes its role [RFC]: Add new prop to Button that describes its tone Dec 6, 2023
@lkostrowski
Copy link
Member

LGTM

Copy link
Contributor

This issue is stale because it has been open 14 days with no activity.

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

No branches or pull requests

2 participants