design-system icon indicating copy to clipboard operation
design-system copied to clipboard

CloseButtonProps size type conflicts with inherited ButtonProps type

Open bmansell opened this issue 4 years ago • 1 comments

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.

bmansell avatar May 29 '20 16:05 bmansell

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.

craigpalermo avatar Jun 10 '20 18:06 craigpalermo