diff --git a/packages/eui/.loki/reference/chrome_desktop_Forms_EuiRefreshInterval_Playground.png b/packages/eui/.loki/reference/chrome_desktop_Forms_EuiRefreshInterval_Playground.png
index 90b57c8c021..b89d7fae227 100644
Binary files a/packages/eui/.loki/reference/chrome_desktop_Forms_EuiRefreshInterval_Playground.png and b/packages/eui/.loki/reference/chrome_desktop_Forms_EuiRefreshInterval_Playground.png differ
diff --git a/packages/eui/.loki/reference/chrome_desktop_Forms_EuiSuperDatePicker_EuiSuperDatePicker_Custom_Quick_Select_Panel.png b/packages/eui/.loki/reference/chrome_desktop_Forms_EuiSuperDatePicker_EuiSuperDatePicker_Custom_Quick_Select_Panel.png
index 94a83b4771c..0ed7e06c6d5 100644
Binary files a/packages/eui/.loki/reference/chrome_desktop_Forms_EuiSuperDatePicker_EuiSuperDatePicker_Custom_Quick_Select_Panel.png and b/packages/eui/.loki/reference/chrome_desktop_Forms_EuiSuperDatePicker_EuiSuperDatePicker_Custom_Quick_Select_Panel.png differ
diff --git a/packages/eui/.loki/reference/chrome_desktop_Forms_EuiSuperDatePicker_EuiSuperDatePicker_Playground.png b/packages/eui/.loki/reference/chrome_desktop_Forms_EuiSuperDatePicker_EuiSuperDatePicker_Playground.png
index 94a83b4771c..0ed7e06c6d5 100644
Binary files a/packages/eui/.loki/reference/chrome_desktop_Forms_EuiSuperDatePicker_EuiSuperDatePicker_Playground.png and b/packages/eui/.loki/reference/chrome_desktop_Forms_EuiSuperDatePicker_EuiSuperDatePicker_Playground.png differ
diff --git a/packages/eui/.loki/reference/chrome_mobile_Forms_EuiRefreshInterval_Playground.png b/packages/eui/.loki/reference/chrome_mobile_Forms_EuiRefreshInterval_Playground.png
index 6f44f42f1ad..4eff6fb0bb5 100644
Binary files a/packages/eui/.loki/reference/chrome_mobile_Forms_EuiRefreshInterval_Playground.png and b/packages/eui/.loki/reference/chrome_mobile_Forms_EuiRefreshInterval_Playground.png differ
diff --git a/packages/eui/.loki/reference/chrome_mobile_Forms_EuiSuperDatePicker_EuiSuperDatePicker_Custom_Quick_Select_Panel.png b/packages/eui/.loki/reference/chrome_mobile_Forms_EuiSuperDatePicker_EuiSuperDatePicker_Custom_Quick_Select_Panel.png
index 05460196756..fa3393a4c64 100644
Binary files a/packages/eui/.loki/reference/chrome_mobile_Forms_EuiSuperDatePicker_EuiSuperDatePicker_Custom_Quick_Select_Panel.png and b/packages/eui/.loki/reference/chrome_mobile_Forms_EuiSuperDatePicker_EuiSuperDatePicker_Custom_Quick_Select_Panel.png differ
diff --git a/packages/eui/.loki/reference/chrome_mobile_Forms_EuiSuperDatePicker_EuiSuperDatePicker_Playground.png b/packages/eui/.loki/reference/chrome_mobile_Forms_EuiSuperDatePicker_EuiSuperDatePicker_Playground.png
index 05460196756..fa3393a4c64 100644
Binary files a/packages/eui/.loki/reference/chrome_mobile_Forms_EuiSuperDatePicker_EuiSuperDatePicker_Playground.png and b/packages/eui/.loki/reference/chrome_mobile_Forms_EuiSuperDatePicker_EuiSuperDatePicker_Playground.png differ
diff --git a/packages/eui/changelogs/upcoming/7909.md b/packages/eui/changelogs/upcoming/7909.md
new file mode 100644
index 00000000000..4856688794e
--- /dev/null
+++ b/packages/eui/changelogs/upcoming/7909.md
@@ -0,0 +1,3 @@
+**CSS-in-JS conversions**
+
+- Converted `EuiSuperDatePicker`'s quick select to Emotion
diff --git a/packages/eui/src/components/date_picker/_index.scss b/packages/eui/src/components/date_picker/_index.scss
index 08789b2448c..8054cc5308d 100644
--- a/packages/eui/src/components/date_picker/_index.scss
+++ b/packages/eui/src/components/date_picker/_index.scss
@@ -1,3 +1,2 @@
// The react-date-picker overrides exists in the global_styling folder
// to easily style differently between default and Amsterdam theme
-@import 'super_date_picker/index';
diff --git a/packages/eui/src/components/date_picker/auto_refresh/refresh_interval.tsx b/packages/eui/src/components/date_picker/auto_refresh/refresh_interval.tsx
index 9de28b0775e..9ace43ef5f0 100644
--- a/packages/eui/src/components/date_picker/auto_refresh/refresh_interval.tsx
+++ b/packages/eui/src/components/date_picker/auto_refresh/refresh_interval.tsx
@@ -11,15 +11,18 @@ import React, {
ChangeEventHandler,
KeyboardEventHandler,
} from 'react';
+
+import { htmlIdGenerator } from '../../../services';
import { EuiI18n } from '../../i18n';
import { EuiFlexGroup, EuiFlexItem } from '../../flex';
import { EuiSelect, EuiFieldNumber, EuiFormLabel, EuiSwitch } from '../../form';
-import { htmlIdGenerator } from '../../../services';
import { EuiScreenReaderOnly } from '../../accessibility';
+
import {
RenderI18nTimeOptions,
TimeOptions,
} from '../super_date_picker/time_options';
+import { EuiQuickSelectPanel } from '../super_date_picker/quick_select_popover/quick_select_panel';
import {
Milliseconds,
RefreshUnitsOptions,
@@ -127,7 +130,6 @@ export class EuiRefreshInterval extends Component<
};
generateId = htmlIdGenerator();
- legendId = this.generateId();
refreshSelectionId = this.generateId();
onValueChange: ChangeEventHandler = (event) => {
@@ -247,66 +249,84 @@ export class EuiRefreshInterval extends Component<
const { value, units, min } = this.state;
return (
-
- {({ refreshUnitsOptions }) => (
-
+
+ {([
+ toggleLabel,
+ toggleAriaLabel,
+ valueAriaLabel,
+ unitsAriaLabel,
+ ]: string[]) => (
+
+ {({ refreshUnitsOptions }) => (
+
+
+
+ {toggleLabel}}
+ aria-label={toggleAriaLabel}
+ aria-labelledby={undefined}
+ aria-describedby={this.refreshSelectionId}
+ />
+
+
+
+
+
+
+
+
+ {this.renderScreenReaderText(refreshUnitsOptions)}
+
+ )}
+
)}
-
+
);
}
}
diff --git a/packages/eui/src/components/date_picker/super_date_picker/__snapshots__/super_date_picker.test.tsx.snap b/packages/eui/src/components/date_picker/super_date_picker/__snapshots__/super_date_picker.test.tsx.snap
index 1abdff6c019..14166d5664d 100644
--- a/packages/eui/src/components/date_picker/super_date_picker/__snapshots__/super_date_picker.test.tsx.snap
+++ b/packages/eui/src/components/date_picker/super_date_picker/__snapshots__/super_date_picker.test.tsx.snap
@@ -13,13 +13,13 @@ exports[`EuiSuperDatePicker props accepts data-test-subj and passes to EuiFormCo
>
-
+
My custom panel
= ({ applyTime, commonlyUsedRanges }) => {
+ const title = useEuiI18n('euiCommonlyUsedTimeRanges.legend', 'Commonly used');
const legendId = useGeneratedHtmlId();
+
const links = commonlyUsedRanges.map(({ start, end, label }) => {
const applyCommonlyUsed = () => {
applyTime({ start, end });
@@ -31,11 +35,7 @@ export const EuiCommonlyUsedTimeRanges: FunctionComponent<
? `superDatePickerCommonlyUsed_${label.replace(' ', '_')}`
: undefined;
return (
-
+
{label}
@@ -44,28 +44,18 @@ export const EuiCommonlyUsedTimeRanges: FunctionComponent<
});
return (
-
+
+
+ {links}
+
+
);
};
diff --git a/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select.test.tsx b/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select.test.tsx
index 7299ea14330..d8c23146bda 100644
--- a/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select.test.tsx
+++ b/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select.test.tsx
@@ -7,10 +7,10 @@
*/
import React from 'react';
-import { shallow } from 'enzyme';
+import { render } from '../../../../test/rtl';
+import { RenderI18nTimeOptions } from '../time_options';
import { EuiQuickSelect } from './quick_select';
-import { RenderI18nTimeOptions } from '../time_options';
const noop = () => {};
const defaultProps = {
@@ -21,19 +21,19 @@ const defaultProps = {
describe('EuiQuickSelect', () => {
test('is rendered', () => {
- const component = shallow(
+ const { container } = render(
{(timeOptions) => (
)}
- ).dive();
+ );
- expect(component).toMatchSnapshot();
+ expect(container.firstChild).toMatchSnapshot();
});
test('prevQuickSelect', () => {
- const component = shallow(
+ const { container } = render(
{(timeOptions) => (
{
/>
)}
- ).dive();
+ );
- expect(component).toMatchSnapshot();
+ expect(container.firstChild).toMatchSnapshot();
});
});
diff --git a/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select.tsx b/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select.tsx
index 74c973701fc..722bd063e66 100644
--- a/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select.tsx
+++ b/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select.tsx
@@ -13,17 +13,19 @@ import React, {
} from 'react';
import moment from 'moment';
import dateMath from '@elastic/datemath';
+
import { htmlIdGenerator } from '../../../../services';
+import { EuiI18n } from '../../../i18n';
+import { EuiScreenReaderOnly } from '../../../accessibility';
import { EuiButton, EuiButtonIcon } from '../../../button';
import { EuiFlexGroup, EuiFlexItem } from '../../../flex';
-import { EuiSpacer } from '../../../spacer';
import { EuiSelect, EuiFieldNumber } from '../../../form';
import { EuiToolTip } from '../../../tool_tip';
-import { EuiI18n } from '../../../i18n';
-import { EuiScreenReaderOnly } from '../../../accessibility';
+
import { ApplyTime, QuickSelect, TimeUnitId } from '../../types';
import { TimeOptions, NEXT } from '../time_options';
import { parseTimeParts } from './quick_select_utils';
+import { EuiQuickSelectPanel } from './quick_select_panel';
type EuiQuickSelectState = QuickSelect;
@@ -158,77 +160,63 @@ export class EuiQuickSelect extends Component<
const timeUnit = matchedTimeUnit ? matchedTimeUnit.text : '';
return (
-
+
);
}
}
diff --git a/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_panel.styles.ts b/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_panel.styles.ts
new file mode 100644
index 00000000000..9540419cb7d
--- /dev/null
+++ b/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_panel.styles.ts
@@ -0,0 +1,48 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import { css } from '@emotion/react';
+
+import { UseEuiTheme } from '../../../../services';
+import {
+ euiFontSize,
+ euiScrollBarStyles,
+ logicalCSS,
+ logicalCSSWithFallback,
+ mathWithUnits,
+} from '../../../../global_styling';
+
+export const euiQuickSelectPanelStyles = (euiThemeContext: UseEuiTheme) => {
+ const { euiTheme } = euiThemeContext;
+
+ return {
+ euiQuickSelectPanel: css`
+ &:not(:first-child) {
+ ${logicalCSS('border-top', euiTheme.border.thin)}
+ ${logicalCSS('padding-top', euiTheme.size.m)}
+ ${logicalCSS('margin-top', euiTheme.size.m)}
+ }
+ `,
+ euiQuickSelectPanel__title: css`
+ float: left; /* Required for fieldset/legend elements */
+ ${logicalCSS('margin-bottom', euiTheme.size.m)}
+ `,
+ euiQuickSelectPanel__section: css`
+ clear: both; /* Required for fieldset/legend elements */
+ ${logicalCSS('margin-top', euiTheme.size.s)}
+ ${logicalCSS(
+ 'max-height',
+ mathWithUnits(euiTheme.size.m, (x) => x * 12)
+ )}
+ overflow: hidden;
+ ${logicalCSSWithFallback('overflow-y', 'auto')}
+ ${euiScrollBarStyles(euiThemeContext)}
+ ${euiFontSize(euiThemeContext, 's')}
+ `,
+ };
+};
diff --git a/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_panel.tsx b/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_panel.tsx
new file mode 100644
index 00000000000..4553ae7cc34
--- /dev/null
+++ b/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_panel.tsx
@@ -0,0 +1,51 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import React, { FunctionComponent, ReactNode } from 'react';
+
+import { useEuiMemoizedStyles } from '../../../../services';
+import { EuiTitle } from '../../../title';
+import type { CommonProps } from '../../../common';
+
+import { euiQuickSelectPanelStyles } from './quick_select_panel.styles';
+
+type EuiQuickSelectPanelProps = CommonProps & {
+ component?: 'div' | 'fieldset';
+ title?: ReactNode;
+ titleId?: string;
+ children?: ReactNode;
+};
+
+export const EuiQuickSelectPanel: FunctionComponent<
+ EuiQuickSelectPanelProps
+> = ({ component: Component = 'div', title, titleId, children, ...rest }) => {
+ const isFieldset = Component === 'fieldset';
+ const TitleComponent = isFieldset ? 'legend' : 'span';
+
+ const styles = useEuiMemoizedStyles(euiQuickSelectPanelStyles);
+
+ return (
+
+ {title ? (
+ <>
+
+
+ {title}
+
+
+ {children}
+ >
+ ) : (
+ children
+ )}
+
+ );
+};
diff --git a/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.styles.ts b/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.styles.ts
new file mode 100644
index 00000000000..144a67a0d21
--- /dev/null
+++ b/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.styles.ts
@@ -0,0 +1,37 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import { css } from '@emotion/react';
+
+import { UseEuiTheme } from '../../../../services';
+import { logicalCSS } from '../../../../global_styling';
+import { euiFormVariables } from '../../../form/form.styles';
+
+export const euiQuickSelectPopoverStyles = (euiThemeContext: UseEuiTheme) => {
+ const { euiTheme } = euiThemeContext;
+ const { maxWidth } = euiFormVariables(euiThemeContext);
+
+ return {
+ euiQuickSelectPopover: css`
+ ${logicalCSS('width', maxWidth)}
+ ${logicalCSS('max-width', '100%')}
+ `,
+ euiQuickSelectPopoverButton: css`
+ ${logicalCSS('border-top-right-radius', 0)}
+ ${logicalCSS('border-bottom-right-radius', 0)}
+
+ /* Adds slightly more width between the calendar icon and the dropdown arrow */
+ .euiIcon {
+ ${logicalCSS('width', euiTheme.size.base)}
+ }
+ `,
+ euiQuickSelectPopoverButton__content: css`
+ gap: ${euiTheme.size.xs};
+ `,
+ };
+};
diff --git a/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.test.tsx b/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.test.tsx
index c2da25261b6..1b1203a263e 100644
--- a/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.test.tsx
+++ b/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.test.tsx
@@ -7,9 +7,9 @@
*/
import React from 'react';
-import { shallow } from 'enzyme';
import { render } from '../../../../test/rtl';
+import { EuiLink } from '../../../link';
import { RenderI18nTimeOptions } from '../time_options';
import {
EuiQuickSelectPopover,
@@ -17,13 +17,6 @@ import {
EuiQuickSelectPanels,
} from './quick_select_popover';
-import { EuiLink } from '../../../link';
-
-import { EuiQuickSelect } from './quick_select';
-import { EuiCommonlyUsedTimeRanges } from './commonly_used_time_ranges';
-import { EuiRecentlyUsed } from './recently_used';
-import { EuiRefreshInterval } from '../../auto_refresh/refresh_interval';
-
const noop = () => {};
const defaultProps: Omit = {
@@ -87,7 +80,7 @@ describe('EuiQuickSelectPanels', () => {
describe('customQuickSelectRender', () => {
it('should render Quick Select sections in default order when customQuickSelectRender is not present', () => {
- const component = shallow(
+ const { getByTestSubject } = render(
{(timeOptions) => (
{
/>
)}
- ).dive();
-
- const menu = component.find(
- '[data-test-subj="superDatePickerQuickMenu"]'
);
-
- expect(menu.children()).toHaveLength(5);
- expect(menu.children().at(0).is(EuiQuickSelect)).toBeTruthy();
- expect(menu.children().at(1).is(EuiCommonlyUsedTimeRanges)).toBeTruthy();
- expect(menu.children().at(2).is(EuiRecentlyUsed)).toBeTruthy();
- expect(menu.children().at(3).is(EuiRefreshInterval)).toBeTruthy();
- expect(menu.children().at(4).is('div')).toBeTruthy();
+ const menu = getByTestSubject('superDatePickerQuickMenu');
+
+ expect(menu.childElementCount).toEqual(5);
+ expect(menu.children[0].textContent).toContain('Quick select');
+ expect(menu.children[1].textContent).toContain('Commonly used');
+ expect(menu.children[2].textContent).toContain('Recently used');
+ expect(menu.children[3].textContent).toContain('Refresh every');
+ expect(menu.children[4].textContent).toContain('My custom panel');
});
it('should render Quick Select sections in a custom order customQuickSelectRender is present', () => {
- const component = shallow(
+ const { getByTestSubject } = render(
{(timeOptions) => (
{
/>
)}
- ).dive();
-
- const menu = component.find(
- '[data-test-subj="superDatePickerQuickMenu"]'
);
-
- expect(menu.children()).toHaveLength(5);
- expect(menu.children().at(0).is('div')).toBeTruthy();
- expect(menu.children().at(1).is(EuiRefreshInterval)).toBeTruthy();
- expect(menu.children().at(2).is(EuiQuickSelect)).toBeTruthy();
- expect(menu.children().at(3).is(EuiCommonlyUsedTimeRanges)).toBeTruthy();
- expect(menu.children().at(4).is(EuiRecentlyUsed)).toBeTruthy();
+ const menu = getByTestSubject('superDatePickerQuickMenu');
+
+ expect(menu.childElementCount).toEqual(5);
+ expect(menu.children[0].textContent).toContain('My custom panel');
+ expect(menu.children[1].textContent).toContain('Refresh every');
+ expect(menu.children[2].textContent).toContain('Quick select');
+ expect(menu.children[3].textContent).toContain('Commonly used');
+ expect(menu.children[4].textContent).toContain('Recently used');
});
});
});
diff --git a/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.tsx b/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.tsx
index 72370d74240..b34326e509c 100644
--- a/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.tsx
+++ b/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.tsx
@@ -15,13 +15,14 @@ import React, {
ReactElement,
} from 'react';
+import { useEuiMemoizedStyles } from '../../../../services';
+import { useEuiI18n } from '../../../i18n';
import { EuiButtonEmpty } from '../../../button';
import { EuiIcon } from '../../../icon';
import { EuiPopover } from '../../../popover';
-import { EuiTitle } from '../../../title';
-import { EuiText } from '../../../text';
-import { useEuiI18n } from '../../../i18n';
+import { euiQuickSelectPopoverStyles } from './quick_select_popover.styles';
+import { EuiQuickSelectPanel } from './quick_select_panel';
import { EuiQuickSelect } from './quick_select';
import { EuiCommonlyUsedTimeRanges } from './commonly_used_time_ranges';
import { EuiRecentlyUsed } from './recently_used';
@@ -91,10 +92,12 @@ export const EuiQuickSelectPopover: FunctionComponent<
'Date quick select'
);
+ const styles = useEuiMemoizedStyles(euiQuickSelectPopoverStyles);
+
const quickSelectButton = (
{
+ const styles = useEuiMemoizedStyles(euiQuickSelectPopoverStyles);
+
const quickSelectElement = (
{
return (
-
-
- {title}
-
-
- {React.cloneElement(content, { applyTime })}
-
-
+
+ {React.cloneElement(content, { applyTime })}
+
);
});
}, [customQuickSelectPanels, applyTime]);
return (
{customQuickSelectRender ? (
diff --git a/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/recently_used.tsx b/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/recently_used.tsx
index 1734c9582b5..afce2eb881a 100644
--- a/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/recently_used.tsx
+++ b/packages/eui/src/components/date_picker/super_date_picker/quick_select_popover/recently_used.tsx
@@ -7,13 +7,15 @@
*/
import React, { FunctionComponent } from 'react';
-import { PrettyDuration } from '../pretty_duration';
-import { EuiI18n } from '../../../i18n';
import { useGeneratedHtmlId } from '../../../../services';
-import { EuiTitle } from '../../../title';
+import { useEuiI18n } from '../../../i18n';
+import { EuiFlexGroup, EuiFlexItem } from '../../../flex';
import { EuiLink } from '../../../link';
+
import { DurationRange, ApplyTime } from '../../types';
+import { PrettyDuration } from '../pretty_duration';
+import { EuiQuickSelectPanel } from './quick_select_panel';
export interface EuiRecentlyUsedProps {
applyTime: ApplyTime;
@@ -28,6 +30,10 @@ export const EuiRecentlyUsed: FunctionComponent
= ({
dateFormat,
recentlyUsedRanges = [],
}) => {
+ const title = useEuiI18n(
+ 'euiRecentlyUsed.legend',
+ 'Recently used date ranges'
+ );
const legendId = useGeneratedHtmlId();
if (recentlyUsedRanges.length === 0) {
@@ -39,10 +45,7 @@ export const EuiRecentlyUsed: FunctionComponent = ({
applyTime({ start, end });
};
return (
-
+
= ({
dateFormat={dateFormat}
/>
-
+
);
});
return (
-
+
+
+ {links}
+
+
);
};
diff --git a/packages/eui/src/components/date_picker/super_date_picker/super_date_picker.a11y.tsx b/packages/eui/src/components/date_picker/super_date_picker/super_date_picker.a11y.tsx
index 8742f127480..afb50029634 100644
--- a/packages/eui/src/components/date_picker/super_date_picker/super_date_picker.a11y.tsx
+++ b/packages/eui/src/components/date_picker/super_date_picker/super_date_picker.a11y.tsx
@@ -63,7 +63,7 @@ describe('EuiSuperDatePicker', () => {
});
it('has zero violations when quick select menu is open', () => {
- cy.get('button.euiFormControlLayout__prepend').click();
+ cy.get('[data-test-subj="superDatePickerToggleQuickMenuButton"]').click();
cy.get('div.euiPanel').contains('Quick select').should('exist');
cy.checkAxe();
});