-
Notifications
You must be signed in to change notification settings - Fork 377
feat(ExpandCollapse): introduce ExpandCollapse component #613
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(ExpandCollapse): introduce ExpandCollapse component #613
Conversation
| import { ExpandCollapse } from './index'; | ||
| import { ALIGN_TYPES } from './constants'; | ||
|
|
||
| const stories = storiesOf(`${storybookPackageName(name)}/${STORYBOOK_CATEGORY.WIDGETS}/Expand Collapse`, module); |
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 should be under STORYBOOK_CATEGORY.FORMS_AND_CONTROLS
| ); | ||
|
|
||
| stories.add( | ||
| 'ExpandCollapse', |
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 show the left/center better if we added a div around this with a set width and a border:
<div style={{ width: '400px', border: '1px solid lightgray' }}
<ExpandCollapse ...
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.
done
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.
@mareklibra the pattern doc shows that the label changes from "Show Information" to "Hide Information". Is that possible with the component?
Also, is it possible to only show the underline on the text (not the spaces)? Here's a screenshot from the storybook which shows the underline below blank spaces
|
@serenamarie125 , sure, I will change the underline and add property for text of the expanded state. Regarding default text values and moving under Forms and Controls:
I can imagine more coming in the future. We can either keep the component under the WIDGETS and let the user just provide proper properties or we can implement specialized components for each of these use cases by providing expected texts or alignment. What do you think? @jeff-phillips-18 , @serenamarie125 |
0415ecc to
092e5c9
Compare
Pull Request Test Coverage Report for Build 2592
💛 - Coveralls |
|
Changes: the link consists of text only (not the space or icon). Consuming code can provide props for both expanded and collapsed state. Storybook is updated (but requires cleaning of browser cache). |
|
I think that since the text can be set by the application there is no need for multiple components. I still feel this belongs under Forms and Controls to be consistent with ExpandCollapse pattern found on Patternfly.org. More Information is really just expand/collapse isn't it? Also, can we set the button's focus state to use |
|
@mareklibra the storybook link doesn't work for me now. Can you update that so I can approve? As long as we can modify the text & there is the ability to have 2 different labels based on if it's expanded or collapsed we should be fine. Agree that it likely needs to be in Forms & Controls |
08112c3 to
b8cbf55
Compare
|
The storybook worked for me once browser's cache is cleared. Anyway, redeployed to a new branch, can you please have a look? Changes:
Regarding |
898fa57 to
019bb66
Compare
|
@mareklibra I have a couple of more asks ... |
|
@jeff-phillips-18 , thanks, good idea with the use of |
jeff-phillips-18
left a comment
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 update the storybook please?
e61e689 to
ec6c55b
Compare
|
Storybook updated |
|
@mareklibra I'm still not seeing the updates in the storybook |
ec6c55b to
a507208
Compare
|
@jeff-phillips-18 , please excuse late answer. |
|
PatternFly-React preview: https://613-pr-patternfly-react-patternfly.surge.sh |
serenamarie125
left a comment
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 great @mareklibra thanks for the contribution!
|
hey @mareklibra - this looks excellent to me... I have one suggestion for allowing the consumer to explicitly override the expand/collapse if desired. I think the "controlled" pattern for simple UI state is a nice addition to a component like this. You can see the behavior in my storybook w/ new knob here Do you mind cherry-picking? Other than this...PR looks good to go to me! |
affects: patternfly-react Implementation for the Expand Collapse Section is provided. The component can be farther used for the "More Information" use-case, where additional text/components are hidden unless the user clicks on a link. Such a per-request rendered content is used for texts exceeding scope of a tooltip or when the user is expected to copy and paste part of the information.
affects: patternfly-react
52810ab
a507208 to
52810ab
Compare
|
@priley86 , thanks, cherry-picked. Last changes:
|
|
great! looks good @mareklibra - one last favor... can you update the snapshots? just run |
|
@mareklibra I know I'm late to the party but just wanted to say this looks great! Thanks so much for the contribution and looking forward to making use of it :) |
The propType and defaultProps added for the "expanded" property.
edcb4b8 to
763b622
Compare
|
Thanks for the nice feedback :-) I have updated the test snapshot for the |


What: introduce ExpandCollapse component
Link to Storybook: https://rawgit.com/mareklibra/patternfly-react/ExpandCollapse-sb4/index.html
Additional issues:
Additional info:
Implementation for the Expand Collapse Section is provided.
Patternfly.org Design
The component can be farther used for the "More Information" use-case,
where additional text/components are hidden unless the user clicks
on a link.
Such a per-request rendered content is used for texts exceeding scope of a tooltip or
when the user is expected to copy and paste part of the information.