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
feat(Accordion): Added support for bordered, display large … #6085
Conversation
…and mutilple body content
PF4 preview: https://patternfly-react-pr-6085.surge.sh |
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.
Looks good to me. Thanks @tlabaj !
@@ -18,6 +19,8 @@ export interface AccordionContentProps extends React.HTMLProps<HTMLDivElement> { | |||
'aria-label'?: string; | |||
/** Component to use as content container */ | |||
component?: React.ElementType; | |||
/** Flag indicating content is custom. Expanded content Body wrapper will be removed from children. This allows multiple bodies to be rendered as content. */ | |||
isCustomContent?: React.ReactNode; |
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.
This is an interesting way to handle this. I think we don't usually conditionally expect the consumer to wrap elements in a body component. I wonder if it's be more consistent if we allowed people to just pass a single child, or an array of children? and we wrap things in body components for them?
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.
@nicole I was debating both approaches. I initially stared with the single Node or array. I was thinking in the long run it would be nice to handle this similar to other components with bodies (Card, Drawer) where the consumer composes it themself, that is why I took this approach.
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.
Would it be better then, to always tell the consumer to wrap content in a body?
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.
Maybe we could update to always wrapping the content in a body in the next breaking release?
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.
@nicolethoen that would break consumers who are already using the component.
@kmcfaul that is what I was thinking long term.
I am ok with either approach here... Like I said, I was debating which one to go with.
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.
I think either way will work, as long as it's clear.
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.
@kmcfaul what do you think?
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.
I think having the custom prop is good until we can refactor 👍
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!!
@@ -5,42 +5,45 @@ cssPrefix: pf-c-accordion | |||
propComponents: ['Accordion', 'AccordionItem', 'AccordionContent', 'AccordionToggle'] |
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.
Could you add AccordionExpandedContentBody
here
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.
Looks good!
…and multiple body content
What: Closes #5498