-
Notifications
You must be signed in to change notification settings - Fork 10
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
tech: Initial Card UI component #4705
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
4a9c939
to
2433437
Compare
a8ee15e
to
1732756
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! 👌 Just some comments
import { xStack, yStack } from '../../patterns' | ||
import { sprinkles, tokens } from '../../theme' | ||
|
||
export const cardRoot = recipe({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to use a recipe for this if we only have one size and variant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure how many we'll have for each. In a later PR we add a secondary
variant and I suppose we'll need to support different sizes as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also added another size
type RootProps = ComponentProps<'div'> & RootStyleProps | ||
|
||
function CardRoot({ variant, size, className, children }: PropsWithChildren<RootProps>) { | ||
return <article className={clsx(cardRoot({ variant, size }), className)}>{children}</article> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering if we will pass classNames to these components, their use cases would be covered by variants anyway right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand what you mean. This pattern normally merges the internal styles with whatever is being applied by consumers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Precisely! Just wondered if we should do that by default for all components or if it should be on a need basis? Most components we have we don't need to pass a class from the consumer right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I think we should do it by default. We only need clsx if we are adding some custom classes, otherwise it'll just be applied as part of ...props
1732756
to
60c5551
Compare
450ff64
to
56f7d65
Compare
60c5551
to
308f656
Compare
91519e1
to
7c2109f
Compare
b169ccd
to
c5faf10
Compare
57f769e
to
e08244b
Compare
c5faf10
to
138dd91
Compare
e08244b
to
042f570
Compare
138dd91
to
dab272e
Compare
dab272e
to
81d1fc2
Compare
Describe your changes
Justify why they are needed
Building block for ProductCards and other type of cards
https://www.figma.com/design/5kmmDdh6StpXzbEfr7WevV/Hedvig-UI-Kit?node-id=16269-14623&t=EyGtApoX5yoK0pGI-1
Checklist before requesting a review