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

[UI Framework][K7]: Side nav component #13304

Merged
merged 12 commits into from
Aug 3, 2017
Merged

Conversation

snide
Copy link
Contributor

@snide snide commented Aug 2, 2017

Adds a side nav component. While building it I realized we needed to fix some spacing / depth issues in the overall design.

Notes

  • Works responsively. Adjusted a bunch of page layout stuff to work better responsively as well.
  • Added depth to elements.
  • Decreased whitespace in page layouts so everything isn't so airy.
  • Click events aren't tied up. Leaving that to @cjcenizal.
  • For some reason, the doc view loads as a sandbox. Couldn't figure it out.

image

@cjcenizal cjcenizal self-requested a review August 3, 2017 17:12
Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

Awesome!! Just had a few suggestions.

@@ -33,6 +33,9 @@ import LoadingExample
import PopoverExample
from '../../views/popover/popover_example';

import SideNavExample
from '../../views/side_nav/side_nav';
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to import side_nav/side_nav_example.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh man. I'm a dunce! Thanks.

}]}
>
<GuideText>
Description needed: how to use the SideNav component.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe a better description, or no description at all?

{/* Hidden from view, except in mobile */}
<button className="kuiSideNav__mobileToggle kuiLink">
<span className="kuiSideNav__mobileTitle">Navigate within management</span>
<span><KuiIcon className="kuiSideNav__mobileIcon" type="apps" size="medium"/></span>
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you format this and similar JSX like this:

<span>
  <KuiIcon
    className="kuiSideNav__mobileIcon"
    type="apps"
    size="medium"
  />
</span>

This adheres to our HTML style guide rules. Oddly, the linter should be catching this. Do you have the latest NPM dependencies installed? You can also run npm run lintroller to autofix a lot of this style guide stuff.

* 1. Animation doesn't work against height. Need max-height instead.
* We set a value larger than what is needed to fake "auto".
*/
.kuiSideNav.isOpenMobile .kuiSideNav__content {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we rename this to be .kuiSideNav-isOpenMobile?

<KuiSideNavItem>Users</KuiSideNavItem>
<KuiSideNavItem>Roles</KuiSideNavItem>
<KuiSideNavItem isSelected>Watches</KuiSideNavItem>
<KuiSideNavItem>Extremely long item is long</KuiSideNavItem>
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make this example much longer, so we can see how content wraps? Maybe it should truncate with an ellipsis instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does trunctate! That's what this shows. :)

}

.kuiSideNav__mobileToggle {
display: flex;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we'll need to add a <span> element inside of the <button> and use that as our flexbox container due to problems with buttons being flex elements in some browsers.

Copy link
Contributor

Choose a reason for hiding this comment

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

And once we do that, we can add justify-content: space-between to that element, and remove flex-grow: 1 from .kuiSideNav__mobileTitle.

border: $kuiBorderThin;
border-color: transparent;

&.isSelected {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make this .kuiSideNavItem-isSelected?

display: block;
width: 100%;
text-align: left;
@include kuiFontSizeS;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we put all of our mixins at the top of the class declaration?

border-left: $kuiBorderThick;
border-left-color: $kuiColorSecondary;
background-color: $kuiColorEmptyShade;
@include kuiBottomShadowSmall;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we move this to the top?

margin-top: $kuiSize;

&:first-of-type {
margin-top: 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment-worthy?

@snide
Copy link
Contributor Author

snide commented Aug 3, 2017

Feedback addressed. Merging.

@snide snide merged commit d5d8c3a into elastic:k7-ui-framework Aug 3, 2017
@snide snide deleted the k7/sidenav branch August 3, 2017 23:12
@cjcenizal cjcenizal mentioned this pull request Aug 4, 2017
51 tasks
cjcenizal pushed a commit to cjcenizal/kibana that referenced this pull request Aug 16, 2017
Adds a responsive side nav component to KUI.
cjcenizal pushed a commit to cjcenizal/kibana that referenced this pull request Aug 26, 2017
Adds a responsive side nav component to KUI.
cjcenizal pushed a commit that referenced this pull request Sep 19, 2017
Adds a responsive side nav component to KUI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants