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

Flyout component #227

Merged
merged 16 commits into from
Dec 21, 2017
Merged

Flyout component #227

merged 16 commits into from
Dec 21, 2017

Conversation

snide
Copy link
Contributor

@snide snide commented Dec 20, 2017

Flyout component. Comes with props for ownFocus and size.

Todo before merge

  • Turn EuiModalOverlay into EuiOverlayMask so its usage is more generic.
  • Make these responsive and full width at small res.
  • Possible add an "X" icon that must always exist in the top right, so the consumer doesn't need to place a button.

Breaking change

EuiModalOverlay is now EuiOverlayMask. It operates the same way. You only need to do a search / replace against the string to apply your patch.

@snide
Copy link
Contributor Author

snide commented Dec 21, 2017

@cchaos Check this over for design beyond my todos. Only thing I'm wondering... should I put an X icon in the top right corner of these things? ESC closes them, and likely people would use these with action bars that had a close button, but I didn't know if I should add something like that. On one hand it makes sense, but it means i'd likely need to push the content in the header downa bit.

Copy link
Contributor

@bmcconaghy bmcconaghy left a comment

Choose a reason for hiding this comment

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

LGTM. The escape key did not close the flyout for me in my plugin, but we can address that later.

box-shadow: -$euiSizeXS 0px $euiSizeXS 0px rgba(0,0,0,.05);
}

$flyoutSizes: (
Copy link
Contributor

Choose a reason for hiding this comment

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

$euiFlyoutSizes?


flex-grow: 1;
overflow-y: auto;
padding: $euiSize;
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 increase the padding surrounding body, header, and footer at larger widths?

background: $euiColorLightestShade;
flex-grow: 0;
padding: $euiSize;
border-top: $euiBorderThin;
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't think a border necessary here.

flex-grow: 0;
padding: $euiSize;
padding-bottom: 0;
box-shadow: 0 $euiSize $euiSize (-$euiSize / 2) $euiColorEmptyShade;
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the box-shadow on the header for? I'm not seeing it visually.

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 gives a slight fade for the scroll to "shelf" the header.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh youp, I see

@@ -44,11 +44,3 @@ $flyoutSizes: (
border-left: none;
}
}

@include screenXSmall {
Copy link
Contributor

Choose a reason for hiding this comment

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

@snide I think you meant to remove the screenSmall selector 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.

Lol. yeah!

border-left: $euiBorderThin;
z-index: $euiZModal;
background: $euiColorEmptyShade;
animation: euiFlyout $euiAnimSpeedNormal $euiAnimSlightResistance;
Copy link
Contributor

Choose a reason for hiding this comment

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

Feels a bit quick to me for such a large sized component.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've done these kinds of systems before. We always had them slower, and then eventually sped them because they slowed down the work flow.

Copy link
Contributor

Choose a reason for hiding this comment

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

I just mean a tad bit slower, not significantly. Also there isn't a closing animation. Is that on purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Our animation rules have generally been to immediately dismiss items on actions (like clicks), but use fades when they are done by the system (like a toast disappearing after a set time). Again, it's just to be snappy.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I don't think I have a strong feeling either way.

transform: translateX(100%);
}
100% {
opacity: 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Because of the size, I think the opacity should get to the full 1 before it's completely in place. Like maybe at 70%?


@each $name, $size in $flyoutSizes {
.euiFlyout--#{$name} {
width: $size;
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 the flyouts should also have a minimum width. This will ensure that on smaller screens (before it goes fullscreen) it will be an appropriate size.

@cchaos
Copy link
Contributor

cchaos commented Dec 21, 2017

On the JS side, I'd recommend that we also (at least eventually) do the following:

  1. Trap scrolling focus so when using the scroll wheel to scroll the flyout, it doesn't also scroll the browser window.
    untitled- 1

  2. Currently you can have open all the flyouts on the example page at one time. I think clicking on the same triggering element should close it's own flyout, and triggering another flyout to open should close all open flyouts (at least by default). I understand that there might be case to have multiple open at once, but that is rare and should be a special case.

screen shot 2017-12-21 at 10 50 39 am

display: flex;
flex-direction: column;
align-items: strecth;
box-shadow: -$euiSizeXS 0px $euiSizeXS 0px rgba(0,0,0,.05);
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about giving it a little more depth via the box-shadow? Something like:

box-shadow: -8px 4px 12px 0px rgba(0, 0, 0, 0.05) in vars of course...

screen shot 2017-12-21 at 12 02 41 pm

@cchaos
Copy link
Contributor

cchaos commented Dec 21, 2017

Need to come up with a better dark theme implementation. It's hard to see the boundaries.

screen shot 2017-12-21 at 12 10 18 pm

animation: euiFlyout $euiAnimSpeedNormal $euiAnimSlightResistance;
display: flex;
flex-direction: column;
align-items: strecth;
Copy link
Contributor

Choose a reason for hiding this comment

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

spelling error: strecth -> stretch

@snide
Copy link
Contributor Author

snide commented Dec 21, 2017

OK. Got all the big issues and fixed some of the scrolling issues. Thanks to @cchaos for some mobile help. Gonna merge this in. Will make an issue for some other stuff we'd like to change (but aren't critical)

@snide snide merged commit 9456e43 into elastic:master Dec 21, 2017
@snide snide deleted the feature/flyout branch December 21, 2017 19:26
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.

3 participants