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

BEM managed by CVA in PButton #1250

Merged
merged 15 commits into from
Apr 29, 2024
Merged

BEM managed by CVA in PButton #1250

merged 15 commits into from
Apr 29, 2024

Conversation

aaazzam
Copy link
Collaborator

@aaazzam aaazzam commented Apr 25, 2024

This PR moves PButton to adopt CVA to manage it's BEM hierarchy.

  • While we're in the ugly haircut phase, a compat layer between old and new props are maintained.

Along the way, the styles for selected are properly handled via aria-selected.

This is likely the penultimate PR, which will free us from the ~80 CSS Vars to style buttons.

@aaazzam aaazzam requested a review from a team as a code owner April 25, 2024 17:34
Copy link

netlify bot commented Apr 25, 2024

Deploy Preview for prefect-design ready!

Name Link
🔨 Latest commit c069c72
🔍 Latest deploy log https://app.netlify.com/sites/prefect-design/deploys/662fd318c0089900084f2a22
😎 Deploy Preview https://deploy-preview-1250--prefect-design.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.

@znicholasbrown
Copy link
Contributor

Discussed this sync - there's a bit of cleanup to do here but largely this is the appropriate direction, we'll work out some of the hairier details in the next few days.

@aaazzam aaazzam enabled auto-merge April 29, 2024 17:05
@aaazzam
Copy link
Collaborator Author

aaazzam commented Apr 29, 2024

@znicholasbrown I think I've addressed the decisions made in Friday OH.

@aaazzam aaazzam requested review from a team and removed request for a team April 29, 2024 20:08
@aaazzam aaazzam merged commit 49a91f2 into main Apr 29, 2024
6 checks passed
@aaazzam aaazzam deleted the cva-button branch April 29, 2024 20:10
Comment on lines +69 to +73
type ButtonProps = VariantProps<typeof button>

const props = defineProps<{
variant?: 'default' | 'secondary' | 'destructive' | 'outline' | 'ghost' | 'link',
size?: 'default' | 'sm' | 'lg' | 'icon',
variant?: ButtonProps['variant'],
size?: ButtonProps['size'],
Copy link
Collaborator

Choose a reason for hiding this comment

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

❤️

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