Skip to content

Commit

Permalink
Merge branch 'main' into emotion/form-layout-3
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Aug 14, 2024
2 parents b95def4 + e143ed0 commit ed88622
Show file tree
Hide file tree
Showing 51 changed files with 594 additions and 389 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions packages/eui/changelogs/upcoming/7957.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
**Bug fixes**

- Fixed a visual bug with `<EuiDualRange showInput="inputWithPopover" />` form controls

**CSS-in-JS conversions**

- Converted `EuiFormLayoutDelimited` to Emotion
- Fixed `cloneElementWithCss` throwing an error when used multiple times without a `key` prop
- Updated `cloneElementWithCss` utility to support a third argument that allows prepending vs. appending the cloned Emotion css className
3 changes: 3 additions & 0 deletions packages/eui/changelogs/upcoming/7961.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Updated `EuiHeaderLinks`'s mobile menu to set a slight popover padding by default
- This can be overridden via `popoverProps.panelPaddingSize` if needed.
- Updated `EuiHeaderLink` to default to a size of `s` (down from `m`)
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import React, { useState, useMemo } from 'react';
import React, { useMemo } from 'react';

import {
EuiBadge,
EuiButtonEmpty,
EuiFlexGroup,
EuiFlexItem,
EuiHeader,
EuiHeaderLink,
EuiHeaderLinks,
EuiHeaderLogo,
EuiHeaderSectionItemButton,
EuiIcon,
EuiPopover,
EuiToolTip,
} from '../../../../src/components';
import { useIsWithinBreakpoints } from '../../../../src/services';
Expand Down Expand Up @@ -69,14 +67,9 @@ export const GuidePageHeader: React.FunctionComponent<GuidePageHeaderProps> = ({
const github = useMemo(() => {
const label = 'EUI GitHub repo';
return isMobileSize ? (
<EuiButtonEmpty
size="s"
flush="both"
iconType="logoGithub"
href={GITHUB_URL}
>
<EuiHeaderLink color="primary" iconType="logoGithub" href={GITHUB_URL}>
{label}
</EuiButtonEmpty>
</EuiHeaderLink>
) : (
<EuiToolTip content="Github">
<EuiHeaderSectionItemButton aria-label={label} href={GITHUB_URL}>
Expand All @@ -90,9 +83,9 @@ export const GuidePageHeader: React.FunctionComponent<GuidePageHeaderProps> = ({
const label = 'Codesandbox';
return isMobileSize ? (
<CodeSandboxLink type="tsx">
<EuiButtonEmpty size="s" flush="both" iconType="logoCodesandbox">
<EuiHeaderLink color="primary" iconType="logoCodesandbox">
{label}
</EuiButtonEmpty>
</EuiHeaderLink>
</CodeSandboxLink>
) : (
<EuiToolTip content="Codesandbox" key="codesandbox">
Expand All @@ -105,39 +98,18 @@ export const GuidePageHeader: React.FunctionComponent<GuidePageHeaderProps> = ({
);
}, [isMobileSize]);

const [mobilePopoverIsOpen, setMobilePopoverIsOpen] = useState(false);

const mobileMenu = useMemo(() => {
const button = (
<EuiHeaderSectionItemButton
aria-label="Open EUI options menu"
onClick={() => setMobilePopoverIsOpen((isOpen) => !isOpen)}
>
<EuiIcon type="apps" aria-hidden="true" />
</EuiHeaderSectionItemButton>
);

return (
<EuiPopover
button={button}
isOpen={mobilePopoverIsOpen}
closePopover={() => setMobilePopoverIsOpen(false)}
<EuiHeaderLinks
popoverButtonProps={{ 'aria-label': 'Open EUI options menu' }}
popoverBreakpoints="all"
>
<EuiFlexGroup
direction="column"
alignItems="flexStart"
gutterSize="none"
responsive={false}
>
<EuiFlexItem>{github}</EuiFlexItem>
<EuiFlexItem>
<GuideFigmaLink />
</EuiFlexItem>
<EuiFlexItem>{codesandbox}</EuiFlexItem>
</EuiFlexGroup>
</EuiPopover>
{github}
<GuideFigmaLink />
{codesandbox}
</EuiHeaderLinks>
);
}, [mobilePopoverIsOpen, codesandbox, github]);
}, [codesandbox, github]);

const rightSideItems = isMobileSize
? [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
/* eslint-disable no-restricted-globals */
import React from 'react';

import { EuiButtonEmpty } from '../../../../src/components/button';
import { useIsWithinBreakpoints } from '../../../../src/services';

import { ThemeContext } from '../with_theme';
import { EuiHeaderSectionItemButton } from '../../../../src/components/header';
import {
EuiHeaderLink,
EuiHeaderSectionItemButton,
} from '../../../../src/components/header';
import { EuiToolTip } from '../../../../src/components/tool_tip';
import { EuiIcon } from '../../../../src/components/icon';
import logoFigma from '../../images/logo-figma.svg';

import { ThemeContext } from '../with_theme';

type GuideFigmaLinkProps = {
context?: any;
};
Expand All @@ -34,9 +36,9 @@ const GuideFigmaLinkComponent: React.FunctionComponent<
const label = 'EUI Figma Design Library';

return isMobileSize ? (
<EuiButtonEmpty size="s" flush="both" iconType={logoFigma} href={href}>
<EuiHeaderLink color="primary" iconType={logoFigma} href={href}>
{label}
</EuiButtonEmpty>
</EuiHeaderLink>
) : (
<EuiToolTip
title={label}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ export default () => (
fullWidth
startControl={
<EuiFieldNumber
controlOnly
placeholder="0"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
endControl={
<EuiFieldNumber
controlOnly
placeholder="100"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
Expand All @@ -36,15 +36,15 @@ export default () => (
<EuiFormControlLayoutDelimited
startControl={
<EuiFieldNumber
controlOnly
placeholder="0"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
endControl={
<EuiFieldNumber
controlOnly
placeholder="100"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
Expand All @@ -54,15 +54,15 @@ export default () => (
append={<EuiFormLabel>px</EuiFormLabel>}
startControl={
<EuiFieldNumber
controlOnly
placeholder="0"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
endControl={
<EuiFieldNumber
controlOnly
placeholder="100"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
Expand All @@ -73,14 +73,14 @@ export default () => (
startControl={
<EuiFieldNumber
placeholder="0"
className="euiFieldNumber"
controlOnly
aria-label="Use aria labels when no actual label is in use"
/>
}
endControl={
<EuiFieldNumber
controlOnly
placeholder="100"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
Expand All @@ -91,15 +91,15 @@ export default () => (
isLoading
startControl={
<EuiFieldNumber
controlOnly
placeholder="0"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
endControl={
<EuiFieldNumber
controlOnly
placeholder="100"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
Expand All @@ -109,15 +109,15 @@ export default () => (
isLoading
startControl={
<EuiFieldNumber
controlOnly
placeholder="0"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
endControl={
<EuiFieldNumber
controlOnly
placeholder="100"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
Expand All @@ -127,15 +127,15 @@ export default () => (
compressed
startControl={
<EuiFieldNumber
controlOnly
placeholder="0"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
endControl={
<EuiFieldNumber
controlOnly
placeholder="100"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
Expand All @@ -145,16 +145,16 @@ export default () => (
prepend={<EuiFormLabel>Add</EuiFormLabel>}
startControl={
<EuiFieldNumber
controlOnly
placeholder="0"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
delimiter="+"
endControl={
<EuiFieldNumber
controlOnly
placeholder="100"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
Expand All @@ -164,16 +164,16 @@ export default () => (
prepend={<EuiFormLabel>Merge</EuiFormLabel>}
startControl={
<EuiFieldNumber
controlOnly
placeholder="0"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
delimiter={<EuiIcon type="merge" />}
endControl={
<EuiFieldNumber
controlOnly
placeholder="100"
className="euiFieldNumber"
aria-label="Use aria labels when no actual label is in use"
/>
}
Expand All @@ -184,16 +184,16 @@ export default () => (
prepend={<EuiFormLabel>Read only</EuiFormLabel>}
startControl={
<EuiFieldNumber
controlOnly
placeholder="0"
className="euiFieldNumber"
readOnly
aria-label="Use aria labels when no actual label is in use"
/>
}
endControl={
<EuiFieldNumber
controlOnly
placeholder="100"
className="euiFieldNumber"
readOnly
aria-label="Use aria labels when no actual label is in use"
/>
Expand All @@ -205,16 +205,16 @@ export default () => (
prepend={<EuiFormLabel>Disabled</EuiFormLabel>}
startControl={
<EuiFieldNumber
controlOnly
placeholder="0"
className="euiFieldNumber"
disabled
aria-label="Use aria labels when no actual label is in use"
/>
}
endControl={
<EuiFieldNumber
controlOnly
placeholder="100"
className="euiFieldNumber"
disabled
aria-label="Use aria labels when no actual label is in use"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ exports[`EuiDatePicker localization accepts the locale prop 1`] = `
class="euiDatePicker testClass1 testClass2 emotion-euiDatePicker-inline-shadow-euiTestCss"
>
<div
class="euiFormControlLayout euiFormControlLayoutDelimited emotion-euiFormControlLayout"
class="euiFormControlLayout emotion-euiFormControlLayout-group"
>
<div
class="euiFormControlLayout__childrenWrapper emotion-euiFormControlLayout__childrenWrapper"
class="euiFormControlLayout__childrenWrapper emotion-euiFormControlLayout__childrenWrapper-inGroup-prependOnly-appendOnly"
>
<div
class="react-datepicker emotion-euiReactDatePicker"
Expand Down Expand Up @@ -484,10 +484,10 @@ exports[`EuiDatePicker localization inherits locale from context 1`] = `
class="euiDatePicker testClass1 testClass2 emotion-euiDatePicker-inline-shadow-euiTestCss"
>
<div
class="euiFormControlLayout euiFormControlLayoutDelimited emotion-euiFormControlLayout"
class="euiFormControlLayout emotion-euiFormControlLayout-group"
>
<div
class="euiFormControlLayout__childrenWrapper emotion-euiFormControlLayout__childrenWrapper"
class="euiFormControlLayout__childrenWrapper emotion-euiFormControlLayout__childrenWrapper-inGroup-prependOnly-appendOnly"
>
<div
class="react-datepicker emotion-euiReactDatePicker"
Expand Down
Loading

0 comments on commit ed88622

Please sign in to comment.