-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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(Tile): add optional expand/collapse labels for chevron #7199
feat(Tile): add optional expand/collapse labels for chevron #7199
Conversation
✔️ Deploy preview for carbon-elements ready! 🔨 Explore the source changes: 09f8443 🔍 Inspect the deploy logs: https://app.netlify.com/sites/carbon-elements/deploys/6007361b9d161b000863efb9 😎 Browse the preview: https://deploy-preview-7199--carbon-elements.netlify.app |
✔️ Deploy preview for carbon-components-react ready! 🔨 Explore the source changes: 09f8443 🔍 Inspect the deploy logs: https://app.netlify.com/sites/carbon-components-react/deploys/6007361b2a207900087a5a6d 😎 Browse the preview: https://deploy-preview-7199--carbon-components-react.netlify.app |
@@ -442,7 +452,9 @@ export class ExpandableTile extends Component { | |||
onBeforeClick: () => true, | |||
handleClick: () => {}, | |||
tileCollapsedIconText: 'Interact to expand Tile', | |||
tileCollapsedLabel: null, |
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.
Do we need to add them to the defaultProps
if they are null?
Hey @ryanomackey, looks like this proposal was accepted but has a couple of issues that need to be addressed. Do you have time to work on these? |
Co-authored-by: emyarod <emyarod@users.noreply.github.com>
Thanks, @tw15egan. Should be ready for another review. |
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.
Tiny style nit, but otherwise looks great. Thanks for contributing! 👍 ✅
right: $carbon--spacing-05; | ||
bottom: $carbon--spacing-05; | ||
display: flex; | ||
flex-direction: row; |
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 the default property, so we can probably remove this line
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.
Ah, yeah. Good call.
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.
Props are working correctly and spacing looks good now. Thank you! 🙌🏻
Closes #6802
To help draw attention to the expand/collapse functionality, this PR adds two new props to the
ExpandableTile
component that allow the developer to add text labels next to the chevron.Changelog
New
ExpandableTile
:tileCollapsedLabel
: When "collapsed", a label to appear next to the chevron (e.g., "View more").tileExpandedLabel
: When "expanded", a label to appear next to the chevron (e.g., "View less").Changed
Removed
Testing / Reviewing
Demo GIF: