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

Implement "card" variant for Button component #121

Merged
merged 4 commits into from
Feb 3, 2025

Conversation

mkrause
Copy link
Collaborator

@mkrause mkrause commented Feb 2, 2025

Resolves #120

Screenshot 2025-02-02 at 17 42 01

GritQL migration script used for variant → kind change.

engine marzano(0.1)
language js

pattern element($component_name, $props, $children) {
    or {
        jsx_element(open_tag=jsx_opening_element(name=$tag, attribute=$props), close_tag=jsx_closing_element(name=$close_tag), children=$children),
        jsx_self_closing_element(name=$tag, attribute=$props),
    } where {
        $close_tag <: maybe $tag, // Does not always exist (may be a self-closing element)
        $tag <: or {
            $component_name,
            member_expression(object=$component_name), // `$component_name.$_`
            member_expression(object=member_expression(object=$component_name)), // `$component_name.$_.$_`
        },
    },
}

bubble element(`Button`, $props) where {
    $props <: maybe contains or {
        jsx_attribute(name="variant" => `kind`),
    }
}

@mkrause mkrause self-assigned this Feb 2, 2025
@mkrause mkrause marked this pull request as ready for review February 2, 2025 16:41
@mkrause mkrause requested a review from nighto February 3, 2025 13:35
Copy link
Collaborator

@nighto nighto left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@mkrause mkrause merged commit 3511fde into master Feb 3, 2025
2 checks passed
@mkrause mkrause deleted the feature/gh-120-button-variant-card branch February 3, 2025 14:43
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.

Implement "card" variant for the Button component
2 participants