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

[WIP] chore: surface card style regions in builder #4436

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

techfg
Copy link
Collaborator

@techfg techfg commented Jan 11, 2025

What does this PR do?

Add a default variant for Card component and surface style regions in Styles panel.

Changes

  • Explicit definition of the variant default via prop used for each sub-component
  • Added Signals so that builder can surface them for cards (the component supported it but it wasn't previously surfaced in builder UI
  • Surface all regions that can be used within the title and it's subcomponents

Notes

  1. The naming convention used for the regions wouldn't be my normal first choice (e.g., using prefixes of tile, panel, title), since it sort of ties to the implementation/usage of sub-component names, however for backwards compat had to follow the existing pattern
  2. Identifying all the regions across all the subcomponents is not trivial and really takes some time to ensure all regions that are used are found. This is only possible because the source of the subcomponent is available. If the subcomponents used where 3rd party and if they didn't properly surface all their regions and/or at document them, doing this would be nearly impossible or at minimum, extremely challenging. Really need to think through a good management solution for this since it's very common and from there, developing standards and documenting them so that there is consistency not only internally within the code base but across the ues.io ecosystem.
  3. As a best/recommended practice, the idea currently is to not expose variants as props for sub-components, however Card did this previously and for backwards compat purposes, these need to be maintained. This is less than ideal since it isn't what we want to be doing moving forward but for now, variant props remain on Card until dependent components can be updated or Card versioned so that breaking changes can be made. Variant prop was removed from being exposed in builder and only available via yaml.

Testing

Manual testing via Builder UI ensuring that styles applied to every region in builder are properly displayed/assigned in canvas & preview modes.

@techfg techfg marked this pull request as draft January 11, 2025 08:30
@techfg techfg changed the title chore: surface card sub component variants in builder [WIP] chore: surface card sub component variants in builder Jan 11, 2025
@techfg techfg changed the title [WIP] chore: surface card sub component variants in builder [WIP] chore: surface card style regions in builder Jan 14, 2025
@techfg techfg requested a review from humandad January 14, 2025 08:01
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.

1 participant