-
Notifications
You must be signed in to change notification settings - Fork 0
refactor(ui-react): make Tile a composite component - DLS-476 #397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the Tile component from a prop-based API to a composite component pattern for both React and React Native implementations. The refactor introduces TileSpot, TileContent, TileTitle, and TileDescription sub-components (plus TileSecondaryAction for React) that compose together, providing greater flexibility for customization.
Key changes:
- Converts from prop-based API (
title,description,leadingContent,trailingContent) to a children-based composite pattern - Introduces a context provider to propagate the
disabledstate to all sub-components - Updates padding from uniform
s8to horizontals8and verticals12for improved visual balance
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| libs/ui-rnative/src/lib/Components/Tile/types.ts | Removes prop-based types, adds composite sub-component types and context type |
| libs/ui-rnative/src/lib/Components/Tile/index.ts | Updates exports to include all new sub-components |
| libs/ui-rnative/src/lib/Components/Tile/Tile.tsx | Refactors to composite pattern with context-based state sharing |
| libs/ui-rnative/src/lib/Components/Tile/Tile.test.tsx | Updates tests to use composite API, adds context propagation tests |
| libs/ui-rnative/src/lib/Components/Tile/Tile.stories.tsx | Updates all stories to demonstrate composite pattern usage |
| libs/ui-rnative/src/lib/Components/Tile/Tile.mdx | Updates documentation to reflect composite API |
| libs/ui-rnative/src/lib/Components/Tile/Tile.figma.tsx | Updates Figma integration to use composite components |
| libs/ui-react/src/lib/Components/Tile/types.ts | Removes prop-based types, adds composite sub-component types including TileSecondaryAction |
| libs/ui-react/src/lib/Components/Tile/index.ts | Updates exports to include all new sub-components |
| libs/ui-react/src/lib/Components/Tile/Tile.tsx | Refactors to composite pattern, adds TileSecondaryAction for hover actions |
| libs/ui-react/src/lib/Components/Tile/Tile.test.tsx | Comprehensive test updates for composite API and context propagation |
| libs/ui-react/src/lib/Components/Tile/Tile.stories.tsx | Updates all stories to demonstrate composite pattern including secondary actions |
| libs/ui-react/src/lib/Components/Tile/Tile.mdx | Updates documentation with advanced patterns and examples |
| libs/ui-react/src/lib/Components/Tile/Tile.figma.tsx | Updates Figma integration to use composite components |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Simon Bruneaud <[email protected]>
Signed-off-by: Simon Bruneaud <[email protected]>
e7f53e3 to
8754b2a
Compare
Signed-off-by: Simon Bruneaud <[email protected]>
1b73dac to
6c5511d
Compare
Signed-off-by: Simon Bruneaud <[email protected]>
Signed-off-by: Simon Bruneaud <[email protected]>
Signed-off-by: Simon Bruneaud <[email protected]>
824623f to
175513a
Compare
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Simon Bruneaud <[email protected]>
Signed-off-by: Simon Bruneaud <[email protected]>
Signed-off-by: Simon Bruneaud <[email protected]>
Signed-off-by: Simon Bruneaud <[email protected]>
153362a to
d82e285
Compare
Signed-off-by: Simon Bruneaud <[email protected]>
DLS-476
Results
Implementation API
BEFORE
AFTER Web
AFTER RN
Fix the focus outline