Skip to content
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

Conversation

ryanomackey
Copy link
Contributor

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

  • Adds two new props to 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

  • N/A

Removed

  • N/A

Testing / Reviewing

Demo GIF:
2020-11-02 11 21 11

@ryanomackey ryanomackey requested review from a team as code owners November 2, 2020 17:36
@netlify
Copy link

netlify bot commented Nov 2, 2020

✔️ 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

@netlify
Copy link

netlify bot commented Nov 2, 2020

✔️ Deploy preview for carbon-components-react ready!
Built without sensitive environment variables

🔨 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

@emyarod emyarod requested review from a team and shinytoyrobots and removed request for a team November 4, 2020 19:35
@ghost ghost requested a review from johnbister November 4, 2020 19:35
@emyarod emyarod removed the request for review from shinytoyrobots November 4, 2020 19:36
@@ -442,7 +452,9 @@ export class ExpandableTile extends Component {
onBeforeClick: () => true,
handleClick: () => {},
tileCollapsedIconText: 'Interact to expand Tile',
tileCollapsedLabel: null,
Copy link
Collaborator

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?

@aagonzales
Copy link
Member

Not sure if this is related to this PR or would be a separate one but the padding for chevron (and now label) is off. It should be have that 16px padding on right and bottom.
image

@tw15egan
Copy link
Collaborator

tw15egan commented Dec 4, 2020

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?

@ryanomackey
Copy link
Contributor Author

Thanks, @tw15egan. Should be ready for another review.

Copy link
Collaborator

@tw15egan tw15egan left a 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;
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yeah. Good call.

@tw15egan tw15egan requested review from a team and removed request for a team December 7, 2020 16:08
@tw15egan tw15egan requested review from shinytoyrobots and laurenmrice and removed request for shinytoyrobots December 7, 2020 16:08
Copy link
Member

@laurenmrice laurenmrice left a 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! 🙌🏻

@andreancardona andreancardona merged commit d45f466 into carbon-design-system:master Jan 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: Allow "ExpandableTile" to accept a label for the expansion trigger
7 participants