Skip to content

Add new Card component #418

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

Conversation

dobromir-hristov
Copy link
Contributor

@dobromir-hristov dobromir-hristov commented Aug 22, 2022

Bug/issue #, if applicable: 97714707

Summary

This introduces a new Card component, that will be used as a building block for TopicSectionsStyle and Links.

imageimage

Most props are optional, and the cards self-adjust, so they can act as simple or detailed as need be.

Dependencies

Testing

NA

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests
  • Ran npm test, and it succeeded
  • Updated documentation if necessary

@mportiz08
Copy link
Contributor

Dependencies

Testing

NA

😅

@mportiz08
Copy link
Contributor

I can try to review the code on its own, but it will be super helpful to have at least some sort of idea for what the spec for this new data might be and ideally some example test data would be awesome.

Copy link
Contributor

@mportiz08 mportiz08 left a comment

Choose a reason for hiding this comment

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

Tried to do an initial pass on just code review but will need some more info to start testing this new feature.

},
url: {
type: String,
required: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

This prop type seems slightly incompatible with the Reference.url prop type which always requires a URL. Is this truly optional and if so, do we need to make other changes to accommodate that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think if you pass an empty url it should just render an inactive Reference. I will add a default state so we dont have undefined and potential errors from Vue.

@@ -190,4 +190,9 @@
--color-tutorial-hero-text: #{dark-color(figure-gray)};
--color-tutorial-hero-background: #{dark-color(fill)};
--color-navigator-item-hover: #{change-color(light-color(fill-blue), $alpha: 0.05)};

--color-card-background: var(--color-fill);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a little hard to say without some example data, but is it an expected scenario to have a card without an image? Depending on how common that scenario is, we might want to consider eliminating special color values for them to avoid bloating the very large number of special colors we already have. Ignoring the shadow, the only benefit to including these new variables would be so that these could potentially be specialized on their own through theming, right?

Not necessarily advocating for one approach of the other yet—just making sure we've thought through the common use case before we add new global color variables.

@dobromir-hristov dobromir-hristov force-pushed the dhristov/r97714707-introduce-card-component branch from 00de731 to 026e400 Compare September 7, 2022 09:09
@dobromir-hristov
Copy link
Contributor Author

Hey I took into account both of your feedback. You can give it another look.

@mportiz08
Copy link
Contributor

Not totally sure how I should be testing this.

@dobromir-hristov
Copy link
Contributor Author

Not totally sure how I should be testing this.

This is part of #419, unfortunately as of now, there isnt an isolated way to test this specific PR, unless we build a Storybook-like page with example components.

@dobromir-hristov dobromir-hristov force-pushed the dhristov/r97714707-introduce-card-component branch from c894277 to 24ac1cf Compare September 19, 2022 07:36
Copy link
Member

@marinaaisa marinaaisa left a comment

Choose a reason for hiding this comment

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

I tested it and it looks good!

I added a blocking comment about AX and a suggesting about images.

Thanks Dobri!

@dobromir-hristov
Copy link
Contributor Author

@swift-ci test

@dobromir-hristov
Copy link
Contributor Author

@marinaaisa please review again, I have updated the code to fit both your comments.

@dobromir-hristov
Copy link
Contributor Author

@swift-ci test

Copy link
Member

@marinaaisa marinaaisa left a comment

Choose a reason for hiding this comment

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

Looks good!

@dobromir-hristov dobromir-hristov merged commit 437098f into swiftlang:main Sep 20, 2022
@dobromir-hristov dobromir-hristov deleted the dhristov/r97714707-introduce-card-component branch September 20, 2022 15:49
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