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] feat(vital-card): JEPZ-408 | Hero Card 2.0 #2211

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

Conversation

samlynndavis
Copy link
Collaborator

Changes

Test Instructions

Related Issues

@vercel
Copy link

vercel bot commented Aug 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
bodiless-js ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 22, 2023 3:58pm
bodiless-js-examples ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 22, 2023 3:58pm
bodiless-js-gatsby ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 22, 2023 3:58pm
bodiless-js-next ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 22, 2023 3:58pm
bodiless-js-perf-gatsby 🔄 Building (Inspect) Visit Preview 💬 Add feedback Aug 22, 2023 3:58pm
bodiless-js-starter ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 22, 2023 3:58pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
bodiless-js-perf-next ⬜️ Ignored (Inspect) Visit Preview Aug 22, 2023 3:58pm

@github-actions
Copy link

Thank you for creating a pull request on GitHub! We appreciate your contribution to our repository.

In order to enable our tests to run on your changes, we kindly ask that you wait until one of our repository members adds the ready-to-test label to your pull request. (Please request on the GitHub issue you are addressing.) This will ensure that our testing process runs smoothly and we can quickly verify the changes you've made.

Thank you for your understanding and we look forward to reviewing your changes soon!

* Tertiary Hero Card Button.
* Plain vital button with `WithTertiaryStyle` token and `READ MORE` placeholder.
*/
const TertiaryHeroCardButton = asButtonToken(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd probably combine these cards, they have a lot in common. Something like this:

const PlainButton = asButtonToken(vitalButton.Plain, {
    Content: {
      Body: withPlaceholder('BUTTON'),
    },
});

// And then

const PrimaryHeroCardButton = asButtonToken(PlainButton, vitalButton.WithPrimaryStyle),
const SecondaryHeroCardButton = asButtonToken(PlainButton, vitalButton.WithSecondaryStyle),
// ...

ImageWrapper: 'px-16px md:px-0px',
},
});
const HorizontalWithImageLeft = asHeroCardToken(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think these orientational tokens should also be named with WithHorizontalWithImageLeft and With HorizontalWithImageRight.

I'd also keep the names consistent. We have WithHorizontalRightOrientation exported from base. I thought keeping the names of these tokens may help us in future. What I did for some other cards is changing the names of imports like

import Base, {
  WithHorizontalLeftOrientation as WithHorizontalLeftOrientationBase,
  WithHorizontalRightOrientation as WithHorizontalRightOrientationBase,
  // ...
} from '../../Card/tokens/Base';

and then in this file define WithHorizontalLeftOrientation and WithHorizontalRightOrientation that will be part of the token collection.

This way we would have consistent token names across multiple cards

}
});

const WithSecondaryButton = asHeroCardToken({
Copy link
Collaborator

Choose a reason for hiding this comment

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

We could probably consolidate these as well:

const WithButton = asHeroCardToken({
  Components: {
    CTALink: on(ButtonClean)(vitalButton.Plain),
  },
  Content: {
    CTAText: withPlaceholder('Button Text'),
  },
});


const WithPrimaryButton = asHeroCardToken(WithButton, {
  Theme: {
    CTALink: vitalButton.WithPrimaryStyle,
  }
});

const WithSecondaryButton = asHeroCardToken(WithButton, {
  Theme: {
    CTALink: vitalButton.WithSecondaryStyle,
  }
});

I think this way you could also remove PrimaryHeroCardButton, SecondaryHeroCardButton and TertiaryHeroCardButton above.

}
});

const WithNoSubtitle = asHeroCardToken({
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we were trying to avoid WithNo... tokens. cc @hvanyo . Why would we have both WithSubtitle and WithNoSubtitle tokens.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I forgot that this slot isn't part of the component by default when I was quickly writing all of the WithNo... tokens.

I'll remove this one.

However, the AC does ask for a token to remove both the description and image (both default slots).

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.

None yet

2 participants