-
Notifications
You must be signed in to change notification settings - Fork 117
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
[chore] - sparkle: enhance Tree
component
#6606
Conversation
These changes introduce a couple of breaking changes that are fixed in #6607 |
- Increment package version for release of new features or fixes - Ensure consistency across package-lock.json and package.json files
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.
LGTM but curious about the reasoning behind the type change of the visual
prop
sparkle/src/components/Tree.tsx
Outdated
@@ -49,13 +49,15 @@ interface TreeItemProps { | |||
label?: string; | |||
type?: "node" | "item" | "leaf"; | |||
variant?: "file" | "folder" | "database" | "channel"; | |||
visual?: React.ReactNode; | |||
size?: "sm" | "md"; | |||
visual?: ComponentType<{ className?: string }>; |
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.
why this change ?
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.
@fontanierh Yeah I don't know either, this is actually what breaks in #6607.
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.
Dunno what was the rational behind but it could be to render all visuals as Icon
and control the size?
…isuals - Changed the `visual` prop type from `ComponentType` to `React.ReactNode` to allow for direct JSX elements - Updated `Tree.stories.tsx` to pass JSX elements directly instead of as references to components
…mponent - Cleaned up Tree.tsx by removing an unused import to streamline the component's dependencies
FYI @fontanierh moved back to |
* Updating tree to accomodate to bigger tree element sizes * Changing copy * [sparkle] - feature: bump version to 0.2.196 - Increment package version for release of new features or fixes - Ensure consistency across package-lock.json and package.json files * [sparkle] - refactor: update Tree component to accept ReactNode for visuals - Changed the `visual` prop type from `ComponentType` to `React.ReactNode` to allow for direct JSX elements - Updated `Tree.stories.tsx` to pass JSX elements directly instead of as references to components * [sparkle] - refactor: remove unused ComponentType import from Tree component - Cleaned up Tree.tsx by removing an unused import to streamline the component's dependencies --------- Co-authored-by: Edouard Wautier <[email protected]> Co-authored-by: Jules <[email protected]>
Description
This PR enhances the Tree component in Sparkle to accommodate larger tree element sizes and improve its flexibility. The changes include:
All tributes to @Duncid I just tested it and fixed the breaking front issues in #6607
Risk
Breaking UX
Deploy Plan