-
Notifications
You must be signed in to change notification settings - Fork 841
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
[EuiContextMenu] Add size prop #4409
Conversation
Preview documentation changes for this PR: https://eui.elastic.co/pr_4409/ |
Thanks, good pickup! This one always felt too airy to me. Should we possibly make this the default size (since it just affects padding)? cc @cchaos |
🎉 Thanks @andreadelrio for getting this one started! I think we can take it even further than just adjusting the padding. They way I think about our components is how they're going to be used and common scenarios. For instance, with context menus, there are 3 main usages
For now, we'll concentrate on the first 2 options. So to address the "default" comment, I think it's important to not assume intent and err on keeping the current display as default. We can adjust component level implementations, like the EuiBasicTableActions component to use the small size, but I don't think we should change the default for all usages. As for the current design, I think the small version could also benefit from a decrease in font size. It's still using the base Here's a re-paste of the original idea/screenshot: Also based on the descriptions above, it would be great to include some "guidelines" about when it's best to use which size in the documentation. |
@cchaos thanks for the feedback. I adjusted the font size and added some guidelines to the docs. |
Preview documentation changes for this PR: https://eui.elastic.co/pr_4409/ |
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.
Thanks for making those changes. The screenshots you pasted of the default theme look great, but I think there's still some work to do for the Amsterdam theme.
The spacing doesn't actually seem as tightened up as it could be, my suggestion would be to reduce just the top/bottom padding a bit like:
Also, the font size of the title is now too small. It should really stay at 14px
aka $euiFontSizeS
and then match the same padding as mentioned above:
Preview documentation changes for this PR: https://eui.elastic.co/pr_4409/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_4409/ |
58b152e
to
6a9878b
Compare
Preview documentation changes for this PR: https://eui.elastic.co/pr_4409/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_4409/ |
- Swapped actual examples between Sizes and Single panel - Added some more to a few snippets
- Also updated the euiPopoverTitle mixin to accept a size prop and re-created it for Amsterdam for better adjustments.
Context menu follow up
Preview documentation changes for this PR: https://eui.elastic.co/pr_4409/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_4409/ |
src/components/context_menu/__snapshots__/context_menu_panel.test.tsx.snap
Outdated
Show resolved
Hide resolved
PR4U: andreadelrio#14 |
Prevents passing undefined size through to menu items
Preview documentation changes for this PR: https://eui.elastic.co/pr_4409/ |
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.
👍 LGTM! But Jenkins is failing because of an accessibility issue:
12:19:19 [duplicate-id]: Ensures every id attribute value is unique
12:19:19 Help: https://dequeuniversity.com/rules/axe/3.5/duplicate-id?application=axe-puppeteer
12:19:19 Elements:
12:19:19 - #context-menu > div:nth-child(2) > .euiPopover--anchorDownLeft.euiPopover
12:29:19 1 accessibility errors
Preview documentation changes for this PR: https://eui.elastic.co/pr_4409/ |
Jenkins, test this |
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.
🎉
Preview documentation changes for this PR: https://eui.elastic.co/pr_4409/ |
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.
Just the type changes, otherwise LGTM!
/** | ||
* Alters the size of the items and the title | ||
*/ | ||
size?: typeof SIZES[number]; |
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.
size?: typeof SIZES[number]; | |
size?: keyof typeof sizeToClassNameMap; |
/** | ||
* Reduce the size to `s` when in need of a more compressed menu | ||
*/ | ||
size?: typeof SIZES[number]; |
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.
size?: typeof SIZES[number]; | |
size?: keyof typeof sizeToClassNameMap; |
/** | ||
* Alters the size of the items and the title | ||
*/ | ||
size?: typeof SIZES[number]; |
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.
size?: typeof SIZES[number]; | |
size?: keyof typeof titleSizeToClassNameMap; |
Co-authored-by: Greg Thompson <[email protected]>
Preview documentation changes for this PR: https://eui.elastic.co/pr_4409/ |
Summary
size
toEuiContextMenu
to support a small size.EuiContextMenuPanel
section for more clarity.Checklist
- [ ] Checked Code Sandbox works for the any docs examples- [ ] Checked for breaking changes and labeled appropriately- [ ] Checked for accessibility including keyboard-only and screenreader modes