Skip to content

Commit

Permalink
[EuiPopover] Increase visibility in dark mode (#7310)
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen authored Oct 30, 2023
1 parent 99aade6 commit cfa84f4
Show file tree
Hide file tree
Showing 20 changed files with 72 additions and 55 deletions.
1 change: 1 addition & 0 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {
// Enforce camelCase naming
'selector-class-pattern': camelCaseRegex,
'keyframes-name-pattern': camelCaseRegex,
'custom-property-pattern': camelCaseRegex,

// Opinionated rules
'declaration-no-important': true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ exports[`EuiBreadcrumbContent renders breadcrumbs with \`popoverContent\` with p
aria-describedby="generated-id"
aria-live="off"
aria-modal="true"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-isOpen-hasTransform-bottom"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-light-isOpen-hasTransform-bottom"
data-autofocus="true"
data-popover-open="true"
data-popover-panel="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ exports[`EuiCodeBlockAnnotation renders 1`] = `
aria-label="aria-label"
aria-live="off"
aria-modal="true"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-isOpen-hasTransform-bottom"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-light-isOpen-hasTransform-bottom"
data-autofocus="true"
data-popover-open="true"
data-popover-panel="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ exports[`EuiCollapsedNavPopover renders the title and sub-items within the popov
aria-label="aria-label"
aria-live="off"
aria-modal="true"
class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-isOpen-hasTransform-right-euiCollapsedNavPopover__panel"
class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-light-isOpen-hasTransform-right-euiCollapsedNavPopover__panel"
data-autofocus="true"
data-popover-open="true"
data-popover-panel="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ exports[`EuiComboBox renders the options list dropdown 1`] = `
<div
aria-live="assertive"
aria-modal="true"
class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-isOpen-isAttached-bottom"
class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-light-isOpen-isAttached-bottom"
data-popover-open="true"
data-popover-panel="true"
role="dialog"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ exports[`useDataGridColumnSelector columnSelector [React 16] renders a toolbar b
aria-describedby="generated-id"
aria-live="off"
aria-modal="true"
class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-hasDragDrop-bottom"
class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-light-hasDragDrop-bottom"
data-autofocus="true"
data-popover-panel="true"
role="dialog"
Expand Down Expand Up @@ -331,7 +331,7 @@ exports[`useDataGridColumnSelector columnSelector [React 17] renders a toolbar b
aria-describedby="generated-id"
aria-live="off"
aria-modal="true"
class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-hasDragDrop-bottom"
class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-light-hasDragDrop-bottom"
data-autofocus="true"
data-popover-panel="true"
role="dialog"
Expand Down Expand Up @@ -626,7 +626,7 @@ exports[`useDataGridColumnSelector columnSelector [React 18] renders a toolbar b
aria-describedby="generated-id"
aria-live="off"
aria-modal="true"
class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-hasDragDrop-bottom"
class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-light-hasDragDrop-bottom"
data-autofocus="true"
data-popover-panel="true"
role="dialog"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ exports[`useDataGridColumnSorting columnSorting [React 16] renders a toolbar but
aria-describedby="generated-id"
aria-live="off"
aria-modal="true"
class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-hasDragDrop-bottom"
class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-light-hasDragDrop-bottom"
data-autofocus="true"
data-popover-panel="true"
role="dialog"
Expand Down Expand Up @@ -326,7 +326,7 @@ exports[`useDataGridColumnSorting columnSorting [React 17] renders a toolbar but
aria-describedby="generated-id"
aria-live="off"
aria-modal="true"
class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-hasDragDrop-bottom"
class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-light-hasDragDrop-bottom"
data-autofocus="true"
data-popover-panel="true"
role="dialog"
Expand Down Expand Up @@ -616,7 +616,7 @@ exports[`useDataGridColumnSorting columnSorting [React 18] renders a toolbar but
aria-describedby="generated-id"
aria-live="off"
aria-modal="true"
class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-hasDragDrop-bottom"
class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-light-hasDragDrop-bottom"
data-autofocus="true"
data-popover-panel="true"
role="dialog"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ exports[`useDataGridKeyboardShortcuts [React 16] returns a popover containing a
aria-describedby="generated-id"
aria-live="off"
aria-modal="true"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-isOpen-hasTransform-bottom"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-light-isOpen-hasTransform-bottom"
data-autofocus="true"
data-popover-open="true"
data-popover-panel="true"
Expand Down Expand Up @@ -302,7 +302,7 @@ exports[`useDataGridKeyboardShortcuts [React 17] returns a popover containing a
aria-describedby="generated-id"
aria-live="off"
aria-modal="true"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-isOpen-hasTransform-bottom"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-light-isOpen-hasTransform-bottom"
data-autofocus="true"
data-popover-open="true"
data-popover-panel="true"
Expand Down Expand Up @@ -556,7 +556,7 @@ exports[`useDataGridKeyboardShortcuts [React 18] returns a popover containing a
aria-describedby="generated-id"
aria-live="off"
aria-modal="true"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-isOpen-hasTransform-bottom"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-light-isOpen-hasTransform-bottom"
data-autofocus="true"
data-popover-open="true"
data-popover-panel="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ exports[`EuiRange props slider should display in popover 1`] = `
aria-describedby="generated-id"
aria-live="assertive"
aria-modal="true"
class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-isAttached-bottom"
class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-light-isAttached-bottom"
data-popover-panel="true"
data-test-subj="test"
role="dialog"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ exports[`EuiSuperSelect props custom display is propagated to dropdown 1`] = `
<div
aria-live="assertive"
aria-modal="true"
class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-isAttached-bottom"
class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-light-isAttached-bottom"
data-popover-panel="true"
role="dialog"
style="top: 0px; left: -22px; will-change: transform, opacity; z-index: 2000; inline-size: 0px;"
Expand Down Expand Up @@ -365,7 +365,7 @@ exports[`EuiSuperSelect props more props are propogated to each option 1`] = `
<div
aria-live="assertive"
aria-modal="true"
class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-isAttached-bottom"
class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-light-isAttached-bottom"
data-popover-panel="true"
role="dialog"
style="top: 0px; left: -22px; will-change: transform, opacity; z-index: 2000; inline-size: 0px;"
Expand Down Expand Up @@ -499,7 +499,7 @@ exports[`EuiSuperSelect props options are rendered when select is open 1`] = `
<div
aria-live="assertive"
aria-modal="true"
class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-isAttached-bottom"
class="euiPanel euiPanel--plain euiPopover__panel emotion-euiPanel-grow-m-plain-euiPopover__panel-light-isAttached-bottom"
data-popover-panel="true"
role="dialog"
style="top: 0px; left: -22px; will-change: transform, opacity; z-index: 2000; inline-size: 0px;"
Expand Down Expand Up @@ -632,7 +632,7 @@ exports[`EuiSuperSelect props renders popoverProps on the underlying EuiPopover
<div
aria-live="assertive"
aria-modal="true"
class="euiPanel euiPanel--plain euiPopover__panel goes-on-popover-panel emotion-euiPanel-grow-m-plain-euiPopover__panel-isAttached-bottom"
class="euiPanel euiPanel--plain euiPopover__panel goes-on-popover-panel emotion-euiPanel-grow-m-plain-euiPopover__panel-light-isAttached-bottom"
data-popover-panel="true"
role="dialog"
style="top: 0px; left: -22px; will-change: transform, opacity; z-index: 2000; inline-size: 0px;"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ exports[`EuiPopover snapshot testing renders with popover contents 1`] = `
aria-label="aria-label"
aria-live="off"
aria-modal="true"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-isOpen-hasTransform-bottom"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-light-isOpen-hasTransform-bottom"
data-autofocus="true"
data-popover-open="true"
data-popover-panel="true"
Expand Down
22 changes: 11 additions & 11 deletions src/components/popover/__snapshots__/popover.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ exports[`EuiPopover props arrowChildren is rendered 1`] = `
aria-describedby="generated-id"
aria-live="off"
aria-modal="true"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-isOpen-hasTransform-bottom"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-light-isOpen-hasTransform-bottom"
data-autofocus="true"
data-popover-open="true"
data-popover-panel="true"
Expand Down Expand Up @@ -158,7 +158,7 @@ exports[`EuiPopover props buffer 1`] = `
aria-describedby="generated-id"
aria-live="off"
aria-modal="true"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-isOpen-hasTransform-bottom"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-light-isOpen-hasTransform-bottom"
data-autofocus="true"
data-popover-open="true"
data-popover-panel="true"
Expand Down Expand Up @@ -212,7 +212,7 @@ exports[`EuiPopover props buffer for all sides 1`] = `
aria-describedby="generated-id"
aria-live="off"
aria-modal="true"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-isOpen-hasTransform-bottom"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-light-isOpen-hasTransform-bottom"
data-autofocus="true"
data-popover-open="true"
data-popover-panel="true"
Expand Down Expand Up @@ -279,7 +279,7 @@ exports[`EuiPopover props focusTrapProps is rendered 1`] = `
aria-describedby="generated-id"
aria-live="off"
aria-modal="true"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-isOpen-hasTransform-bottom"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-light-isOpen-hasTransform-bottom"
data-autofocus="true"
data-popover-open="true"
data-popover-panel="true"
Expand Down Expand Up @@ -346,7 +346,7 @@ exports[`EuiPopover props isOpen renders true 1`] = `
aria-describedby="generated-id"
aria-live="off"
aria-modal="true"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-isOpen-hasTransform-bottom"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-light-isOpen-hasTransform-bottom"
data-autofocus="true"
data-popover-open="true"
data-popover-panel="true"
Expand Down Expand Up @@ -400,7 +400,7 @@ exports[`EuiPopover props ownFocus defaults to true 1`] = `
aria-describedby="generated-id"
aria-live="off"
aria-modal="true"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-isOpen-hasTransform-bottom"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-light-isOpen-hasTransform-bottom"
data-autofocus="true"
data-popover-open="true"
data-popover-panel="true"
Expand Down Expand Up @@ -453,7 +453,7 @@ exports[`EuiPopover props ownFocus renders false 1`] = `
<div
aria-live="assertive"
aria-modal="true"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-isOpen-hasTransform-bottom"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-light-isOpen-hasTransform-bottom"
data-popover-open="true"
data-popover-panel="true"
role="dialog"
Expand Down Expand Up @@ -499,7 +499,7 @@ exports[`EuiPopover props panelClassName is rendered 1`] = `
aria-describedby="generated-id"
aria-live="off"
aria-modal="true"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel test emotion-euiPanel-grow-m-m-plain-euiPopover__panel-isOpen-hasTransform-bottom"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel test emotion-euiPanel-grow-m-m-plain-euiPopover__panel-light-isOpen-hasTransform-bottom"
data-autofocus="true"
data-popover-open="true"
data-popover-panel="true"
Expand Down Expand Up @@ -553,7 +553,7 @@ exports[`EuiPopover props panelPaddingSize is rendered 1`] = `
aria-describedby="generated-id"
aria-live="off"
aria-modal="true"
class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-isOpen-hasTransform-bottom"
class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-light-isOpen-hasTransform-bottom"
data-autofocus="true"
data-popover-open="true"
data-popover-panel="true"
Expand Down Expand Up @@ -607,7 +607,7 @@ exports[`EuiPopover props panelProps is rendered 1`] = `
aria-describedby="generated-id"
aria-live="off"
aria-modal="true"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel testClass1 testClass2 emotion-euiPanel-grow-m-m-plain-euiPopover__panel-isOpen-hasTransform-bottom-euiTestCss"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel testClass1 testClass2 emotion-euiPanel-grow-m-m-plain-euiPopover__panel-light-isOpen-hasTransform-bottom-euiTestCss"
data-autofocus="true"
data-popover-open="true"
data-popover-panel="true"
Expand Down Expand Up @@ -662,7 +662,7 @@ exports[`EuiPopover props popoverScreenReaderText 1`] = `
aria-describedby="generated-id"
aria-live="assertive"
aria-modal="true"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-isOpen-hasTransform-bottom"
class="euiPanel euiPanel--plain euiPanel--paddingMedium euiPopover__panel emotion-euiPanel-grow-m-m-plain-euiPopover__panel-light-isOpen-hasTransform-bottom"
data-popover-open="true"
data-popover-panel="true"
role="dialog"
Expand Down
5 changes: 4 additions & 1 deletion src/components/popover/popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ export interface EuiPopoverProps extends PropsWithChildren, CommonProps {
/**
* Object of props passed to EuiPanel. See #EuiPopoverPanelProps
*/
panelProps?: Omit<EuiPopoverPanelProps, 'style' | 'hasShadow' | 'hasBorder'>;
panelProps?: Omit<
EuiPopoverPanelProps,
'style' | 'hasShadow' | 'hasBorder' | 'color'
>;
panelRef?: RefCallback<HTMLElement | null>;
/**
* Optional screen reader instructions to announce upon popover open,
Expand Down
9 changes: 2 additions & 7 deletions src/components/popover/popover_arrow/_popover_arrow.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,15 @@
*/

import { css } from '@emotion/react';
import {
euiBackgroundColor,
logicals,
logicalSizeCSS,
} from '../../../global_styling';
import { logicals, logicalSizeCSS } from '../../../global_styling';
import { UseEuiTheme } from '../../../services';

export const popoverArrowSize = 'm';

export const euiPopoverArrowStyles = (euiThemeContext: UseEuiTheme) => {
const { euiTheme } = euiThemeContext;

// Match the background color of panels
const borderColor = euiBackgroundColor(euiThemeContext, 'plain');
const borderColor = 'var(--euiPopoverBackgroundColor)';
const arrowSize = euiTheme.size[popoverArrowSize];

return {
Expand Down
Loading

0 comments on commit cfa84f4

Please sign in to comment.