priceline / design-system

Priceline.com Design System
https://priceline.github.io/design-system/
MIT License
722 stars 119 forks source link

CloseButtonProps size type conflicts with inherited ButtonProps type #821

Open bmansell opened 4 years ago

bmansell commented 4 years ago

CloseButton uses its size prop to control the Close icon's size. This is a problem because CloseButtonProps extends ButtonProps which defines size as a specific string set so the resulting type is a mix of specific strings or a number.

https://github.com/priceline/design-system/blob/aede4ea27538802e7283c0c7d7e210cf1ca3a0c6/packages/types/types/index.d.ts#L73

We should refactor CloseButton's size prop to be more specific like iconSize so that these types don't have to be collapsed into one.

craigpalermo commented 4 years ago

Discussion notes: We can rename size for Icon in IconButton to iconSize, which will be the same prop type as size on the Icon component.