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

[Emotion] Convert EuiContextMenu, EuiContextMenuPanel, and EuiContextMenuItem #7312

Merged
merged 25 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
81a84ad
[EuiContextMenu] Set up basic styles file + HOC + variables
cee-chen Oct 24, 2023
0aed518
[EuiContextMenu] Convert more Sass to Emotion
cee-chen Oct 24, 2023
1464c26
Delete unused `.euiContextMenu__content` selector
cee-chen Oct 24, 2023
3ae4924
Convert child `__panel` styles
cee-chen Oct 24, 2023
2d4fecc
Convert margin CSS to flex gap
cee-chen Oct 24, 2023
5a31e89
[EuiContextMenuPanel] Set up Emotion file + HOC
cee-chen Oct 24, 2023
353179b
Convert panel transitions/animations to Emotion
cee-chen Oct 24, 2023
0e63a1a
[EuiContextMenuPanel] Convert title Sass to Emotion
cee-chen Oct 24, 2023
84a452d
[EuiContextMenuItem] Convert to function component
cee-chen Oct 24, 2023
c2a7ec7
[EuiContextMenuItem] Set up Emotion file + basic styles
cee-chen Oct 24, 2023
b145539
DRY out shared padding sizes
cee-chen Oct 24, 2023
53c9d3a
[EuiContextMenuItem] Convert more styles to Emotion
cee-chen Oct 24, 2023
b701691
[EuiContextMenuItem] Remove unnecessary `__itemLayout` div wrapper
cee-chen Oct 24, 2023
ed80b82
[cleanup] Fix broken styles + DRY out repeated CSS on `EuiContextMenu…
cee-chen Oct 24, 2023
e5ec89c
[docs] Fix docs examples without `onClick`s
cee-chen Oct 24, 2023
a8a0e70
[EuiContextMenuItem] Convert remaining child styles to Emotion
cee-chen Oct 24, 2023
a6ede35
[EuiContextMenu] Remove now unused size className modifiers
cee-chen Oct 24, 2023
6cc7b48
Delete Sass files
cee-chen Oct 24, 2023
1a23a45
Update tests
cee-chen Oct 24, 2023
39d39aa
Update downstream snapshots
cee-chen Oct 24, 2023
fd238d5
Fix Cypress tests
cee-chen Oct 24, 2023
e1f9cac
[EuiContextMenuItem] Fix height change caused by `euiFontSize` line h…
cee-chen Oct 24, 2023
3486c4b
changelog
cee-chen Oct 24, 2023
fc5f630
[docs] Test that context menus within EuiBottomBars are no longer vis…
cee-chen Oct 24, 2023
7c2c46f
[EuiContextMenu] Add missing reduced motion affordance
cee-chen Oct 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 32 additions & 3 deletions src-docs/src/views/bottom_bar/bottom_bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ import {
EuiFlexItem,
EuiButton,
EuiButtonEmpty,
EuiPopover,
EuiContextMenuPanel,
EuiContextMenuItem,
} from '../../../../src/components';

export default () => {
const [showBar, setShowBar] = useState(false);
const [showBarPopover, setShowBarPopover] = useState(false);
const closePopover = () => setShowBarPopover(false);

const button = (
<EuiButton color="primary" onClick={() => setShowBar((show) => !show)}>
Expand All @@ -25,9 +30,33 @@ export default () => {
<EuiFlexItem grow={false}>
<EuiFlexGroup gutterSize="s">
<EuiFlexItem grow={false}>
<EuiButton color="text" size="s" iconType="help">
Help
</EuiButton>
<EuiPopover
isOpen={showBarPopover}
closePopover={closePopover}
button={
<EuiButton
color="text"
size="s"
iconType="help"
onClick={() => setShowBarPopover(!showBarPopover)}
>
Help
</EuiButton>
}
panelPaddingSize="none"
repositionOnScroll
>
<EuiContextMenuPanel
items={[
<EuiContextMenuItem icon="link" onClick={closePopover}>
Link A
</EuiContextMenuItem>,
<EuiContextMenuItem icon="link" onClick={closePopover}>
Link B
</EuiContextMenuItem>,
]}
/>
</EuiPopover>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton color="text" size="s" iconType="user">
Expand Down
14 changes: 12 additions & 2 deletions src-docs/src/views/context_menu/content_panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,20 @@ export default () => {
anchorPosition="downLeft"
>
<EuiContextMenuPanel>
<EuiContextMenuItem key="item-1" icon="indexOpen" size="s">
<EuiContextMenuItem
key="item-1"
icon="indexOpen"
size="s"
onClick={closePopover}
>
Add a field to this data view
</EuiContextMenuItem>
<EuiContextMenuItem key="item-2" icon="indexSettings" size="s">
<EuiContextMenuItem
key="item-2"
icon="indexSettings"
size="s"
onClick={closePopover}
>
Manage this data view
</EuiContextMenuItem>

Expand Down
22 changes: 7 additions & 15 deletions src-docs/src/views/context_menu/context_menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ export default () => {
{
name: 'Handle an onClick',
icon: 'search',
onClick: () => {
closePopover();
},
onClick: closePopover,
},
{
name: 'Go to a link',
Expand All @@ -64,27 +62,25 @@ export default () => {
toolTipTitle: 'Optional tooltip',
toolTipContent: 'Optional content for a tooltip',
toolTipPosition: 'right',
onClick: () => {
closePopover();
},
onClick: closePopover,
},
{
name: 'Use an app icon',
icon: 'visualizeApp',
onClick: closePopover,
},
{
name: 'Pass an icon as a component to customize it',
icon: <EuiIcon type="trash" size="m" color="danger" />,
onClick: closePopover,
},
{
name: 'Disabled option',
icon: 'user',
toolTipContent: 'For reasons, this item is disabled',
toolTipPosition: 'right',
disabled: true,
onClick: () => {
closePopover();
},
onClick: closePopover,
},
],
},
Expand All @@ -96,9 +92,7 @@ export default () => {
{
name: 'PDF reports',
icon: 'user',
onClick: () => {
closePopover();
},
onClick: closePopover,
},
{
name: 'Embed code',
Expand All @@ -108,9 +102,7 @@ export default () => {
{
name: 'Permalinks',
icon: 'user',
onClick: () => {
closePopover();
},
onClick: closePopover,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ export default () => {
{
name: 'Show fullscreen',
icon: <EuiIcon type="search" size="m" />,
onClick: () => {
closePopover();
},
onClick: closePopover,
},
{
isSeparator: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ exports[`CollapsedItemActions render with href and _target provided 1`] = `
popoverRef={[Function]}
repositionToCrossAxis={true}
>
<EuiContextMenuPanel
<EuiContextMenuPanelClass
items={
Array [
<EuiContextMenuItem
Expand Down
Loading
Loading