eui icon indicating copy to clipboard operation
eui copied to clipboard

feat: `EuiFlexGroup` and `EuiFlexItem` component prop type improvements

Open tkajtoch opened this issue 1 year ago • 2 comments

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/EuiFlexItem and confirm the types are correctly resolved, suggesting and type checking props of the passed component.

General checklist

  • Docs site QA
  • Code quality checklist
  • Release checklist
    • [x] A changelog entry exists and is marked appropriately.

tkajtoch avatar Apr 16 '24 14:04 tkajtoch

Preview staging links for this PR:

  • Docs site: https://eui.elastic.co/pr_7688/
  • Storybook: https://eui.elastic.co/pr_7688/storybook

kibanamachine avatar Apr 17 '24 12:04 kibanamachine

:green_heart: Build Succeeded

History

  • :green_heart: Build #1764 succeeded 41eecf2d8ac9f068a64f4cd5cf818168ae7c0d19

cc @tkajtoch

elasticmachine avatar Apr 17 '24 12:04 elasticmachine