eui
eui copied to clipboard
feat: `EuiFlexGroup` and `EuiFlexItem` component prop type improvements
Summary
This resolves https://github.com/elastic/eui/issues/7612 by updating EuiFlexGroup and EuiFlexItem to support dynamic prop type resolution with generics. It also cleans up the code and adds ref forwarding to EuiFlexItem to keep these two consistent.
The generic argument falls back to 'div' to keep the API backward compatible in cases where a customer would import and use the EuiFlexGroupProps or EuiFlexItemProps type.
There are a couple of type casts added to ensure TypeScript and IDEs can resolve the full complex type and provide meaningful code suggestions.
QA
- [ ] Ensure all tests are passing
- [ ] Checkout the branch locally, import
EuiFlexGroup/EuiFlexItemand confirm the types are correctly resolved, suggesting and type checking props of the passedcomponent.
General checklist
- Docs site QA
- [x] Added documentation
- [x] Props have proper autodocs (using
@defaultif default values are missing) and playground toggles
- Code quality checklist
- Release checklist
- [x] A changelog entry exists and is marked appropriately.
Preview staging links for this PR:
- Docs site: https://eui.elastic.co/pr_7688/
- Storybook: https://eui.elastic.co/pr_7688/storybook
:green_heart: Build Succeeded
- Buildkite Build
- Commit: bc12d648b0567bbd7b15ee37bab447abf3e11bdc
History
- :green_heart: Build #1764 succeeded 41eecf2d8ac9f068a64f4cd5cf818168ae7c0d19
cc @tkajtoch