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

Extend size and variant prop types #213

Merged
merged 1 commit into from
May 24, 2024

Conversation

ghsteff
Copy link
Contributor

@ghsteff ghsteff commented May 23, 2024

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[x] Other... Please describe: improvement

What is the current behavior?

You can't easily add extra sizes or variants to components

What is the new behavior?

You can add custom sizes or variants to multiple component themes

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

e.g. custom destructive button variant

<Button
  theme={extendComponentTheme<ButtonTheme>(buttonTheme, {
    variants: {
      destructive: 'bg-red-500 hover:bg-red-600 border-red-500 text-white'
    }
  })}
  variant="destructive"
>
  Destructive
</Button>
image

e.g. custom XL radio button size

<Radio
  theme={extendComponentTheme<RadioTheme>(radioTheme, {
    sizes: {
      xl: 'h-8 w-8'
    },
    indicator: {
      sizes: {
        xl: 'w-6 h-6'
      }
    }
  })}
  size="xl"
  label="XL"
/>
image

@ghsteff ghsteff requested review from amcdnl, SerhiiTsybulskyi and steppy452 and removed request for amcdnl and SerhiiTsybulskyi May 23, 2024 20:10
Copy link

netlify bot commented May 23, 2024

Deploy Preview for reablocks-storybook ready!

Name Link
🔨 Latest commit 9f07966
🔍 Latest deploy log https://app.netlify.com/sites/reablocks-storybook/deploys/664fa2a23279430008abac1d
😎 Deploy Preview https://deploy-preview-213--reablocks-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@amcdnl amcdnl left a comment

Choose a reason for hiding this comment

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

we need to add docs for this

@amcdnl amcdnl merged commit 4b71ad8 into master May 24, 2024
5 checks passed
@amcdnl amcdnl deleted the Extend-sizes-and-variants-prop-types branch May 24, 2024 09:16
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.

3 participants