operational-ui
operational-ui copied to clipboard
Refactor Card component prop types
Problem
It is hard to use the Card
component with all the possible props types it gets: CardPropsWithChildrenOrData
, CardPropsWithSections
, CardPropsWithTabs
since too many of the parameters of those types are intersecting and/or are optional. It needs better type discrimination.
Suggestion
- Improve type strictness and unleash the power of the discriminated types by improving typing of
CardPropsWithChildrenOrData
,CardPropsWithSections
andCardPropsWithTabs
, deriving fromBaseProps
- Add
naked
prop parameter to improveCard
styling possibilities
How about we just split them up into different components?
Card.Tabs
, Card.Sections
, etc.?
What is the update on this? Are you still up to split them up into different components?
I think there’s no conclusion here actually. We currently don’t have the time to look at Card
enough to make an informed decision on this so I think we can leave it up to the community.
What are your thoughts?