design-system
design-system copied to clipboard
CloseButtonProps size type conflicts with inherited ButtonProps type
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.
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.