[EuiButtonEmptyProps & EuiButtonIconProps & EuiButtonProps] Type don't match expectations
Expectation is:
import { PropsOf, EuiButtonEmpty, EuiButtonIcon, EuiButton } from '@elastic/eui'
type EuiButtonEmptyProps = PropsOf<typeof EuiButtonEmpty>
type EuiButtonIconProps = PropsOf<typeof EuiButtonIcon>
type EuiButtonProps = PropsOf<typeof EuiButton>
But those aren't the types we export
I agree with this one and should be easy enough to implement without breaks. Essentially bumping up the props that each of these exported types contains, while creating a new internal-only type for reuse with the smaller amount of props.
Explicit set of criteria for this PR (since types have changed significantly since :
EuiButtonEmpty exports an ExclusiveUnion, but EuiButton/EuiButtonIcon does not:
Exclusive union:
https://github.com/elastic/eui/blob/f1dea0a25e7d06f3b9d2a6af0d384457072556b0/src/components/button/button_empty/button_empty.tsx#L96-L99
Non-exclusive union exports:
https://github.com/elastic/eui/blob/34c1bf52913dd64ca428c16cc22328729e040ce2/src/components/button/button_icon/button_icon.tsx#L107-L110
https://github.com/elastic/eui/blob/d1a1cb7ed9025a657141b76535ab49f00747ff70/src/components/button/button.tsx#L86-L89
We should most likely update EuiButton / EuiButtonIcon to match EuiButtonEmpty. However, this will likely have major downstream Kibana typing implications, so a requirement of this change would be to test the branch in local Kibana and run a Typescript check (node scripts/type_check.js) to see how many instances fail first.
If the answer is "many failures", one other option is we can change EuiButtonEmpty to simply match EuiButton/EuiButtonIcon instead. Or also just close this issue out 🤷
👋 Hi there - this issue hasn't had any activity in 6 months. If the EUI team has not explicitly expressed that this is something on our roadmap, it's unlikely that we'll pick this issue up. We would sincerely appreciate a PR/community contribution if this is something that matters to you! If not, and there is no further activity on this issue for another 6 months (i.e. it's stale for over a year), the issue will be auto-closed.
Closing this old issue as it has gone stale. Feel free to re-open it if you feel it is still important.