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(list-box): introduce size variants #4731

Merged
merged 6 commits into from
Dec 9, 2019

Conversation

asudoh
Copy link
Contributor

@asudoh asudoh commented Nov 20, 2019

Refs #3513.

Changelog

New

  • xl/sm size variants for <Dropdown>, <ComboBox>, <MultiSelect> (and its filterable variant).

Testing / Reviewing

Testing should make sure above components are not broken.

@netlify
Copy link

netlify bot commented Nov 20, 2019

Deploy preview for the-carbon-components ready!

Built with commit 28cf82e

https://deploy-preview-4731--the-carbon-components.netlify.com

@netlify
Copy link

netlify bot commented Nov 20, 2019

Deploy preview for carbon-components-react ready!

Built with commit 28cf82e

https://deploy-preview-4731--carbon-components-react.netlify.com

@netlify
Copy link

netlify bot commented Nov 20, 2019

Deploy preview for carbon-elements failed.

Built with commit 28cf82e

https://app.netlify.com/sites/carbon-elements/deploys/5deeb5cb3843a200073a88cd

Copy link
Member

@aagonzales aagonzales left a comment

Choose a reason for hiding this comment

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

Looks good from a visual perspective!

@@ -66,6 +66,36 @@
}
}

.#{$prefix}--dropdown--xl {
Copy link
Contributor

Choose a reason for hiding this comment

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

Style nit: should not be nesting styles

max-height: rem(48px);

.#{$prefix}--dropdown-text {
padding-top: rem(11px);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any way we can center what is rendered instead of specifying exact pixel values and position relative?

max-height: rem(48px);

.#{$prefix}--list-box__field {
height: rem(48px);
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense for the field to be height: 100%?

@asudoh
Copy link
Contributor Author

asudoh commented Nov 21, 2019

Simplified the styles without the paddings and removed nesting.

Copy link
Member

@emyarod emyarod left a comment

Choose a reason for hiding this comment

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

just one thing, the top positioning rule for the invalid icons needs to be a relative unit now since we have variable size

image

Copy link
Member

@emyarod emyarod left a comment

Choose a reason for hiding this comment

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

seen in React dropdown and multiselect, combobox does not seem to have the issue

@asudoh asudoh dismissed joshblack’s stale review November 22, 2019 11:53

Resetting the review status as all comments has been addressed.

Copy link
Contributor

@joshblack joshblack left a comment

Choose a reason for hiding this comment

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

How are we handling text that is being forced to truncate if it hits the bounding height with these sizes?

}

.#{$prefix}--dropdown--sm {
height: rem(32px);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it safe to set height and max-height if default text size changes? Should we use min-height?

Copy link
Member

@emyarod emyarod left a 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, just the one note about using min-height instead of height for the different size variants

@asudoh
Copy link
Contributor Author

asudoh commented Nov 25, 2019

Usage of max-height seems to have been an error (and was not needed). Fixed. Wrt the long text, it doesn't cause increased height because it doesn't word-wrap.

@asudoh asudoh dismissed joshblack’s stale review December 3, 2019 00:09

Updating the review status as all the review comments have been addressed.

@@ -86,6 +86,16 @@ $list-box-menu-width: rem(300px);
}
}

.#{$prefix}--list-box--xl {
height: rem(48px);
max-height: rem(48px);
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like max-height is still being used? Context from previous review comments that were said to have been addressed: https://github.com/carbon-design-system/carbon/pull/4731/files#r349730150

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For this part, the list box gets shrunk down if we remove max-height rule here, given .bx--list-box has max-height rule.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it, thanks!

@asudoh asudoh dismissed joshblack’s stale review December 6, 2019 23:04

All open questions have been addressed.

@asudoh asudoh merged commit 0723836 into carbon-design-system:master Dec 9, 2019
@asudoh asudoh deleted the list-box-sizes branch December 9, 2019 21:19
@@ -66,6 +66,22 @@
}
}

.#{$prefix}--dropdown--xl {
Copy link
Contributor

@vpicone vpicone Dec 18, 2019

Choose a reason for hiding this comment

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

@asudoh Where is these classes used? Why was it added?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Started with targeted search, but designer told us that such dropdown's size variant should not be just for targeted search but also for dropdown in general. You can try this at Storybook.

Copy link
Contributor

Choose a reason for hiding this comment

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

@asudoh dropdown uses the listbox class for size though. This isn't used at all as far as i can tell?

Copy link
Contributor

Choose a reason for hiding this comment

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

@asudoh am I missing something or are these classes never used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Though there is no demonstration, vanilla users should be able to use the class.

Copy link
Contributor

@vpicone vpicone Jan 3, 2020

Choose a reason for hiding this comment

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

@asudoh So we added classes that are strictly meant for a specific framework? That seems...not great. At the very least I don't think they should have been lumped in to this PR unused.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not for a specific framework, but for a legacy markup. Removing the legacy markup of the dropdown didn't fit in v10 timeframe.

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.

None yet

6 participants