Skip to content

Commit

Permalink
Changed EuiText color of EuiCallout
Browse files Browse the repository at this point in the history
  • Loading branch information
nancy2681 committed May 20, 2021
1 parent aa71e7a commit 7c8b501
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 38 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

**Bug fixes**

- Fixed `EuiText` color of `EuiCallout` to `default`([#4816](https://github.com/elastic/eui/pull/4816))
- Fixed `initialFocus` prop functionality in `EuiPopover` ([#4768](https://github.com/elastic/eui/pull/4768))
- Fixed `description` prop in `EuiTable`([#4754](https://github.com/elastic/eui/pull/4754))

Expand Down
12 changes: 10 additions & 2 deletions src/components/call_out/__snapshots__/call_out.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ exports[`EuiCallOut is rendered 1`] = `
<div
class="euiText euiText--small"
>
Content
<div
class="euiTextColor euiTextColor--default"
>
Content
</div>
</div>
</div>
`;
Expand Down Expand Up @@ -102,7 +106,11 @@ exports[`EuiCallOut props title is rendered 1`] = `
<div
class="euiText euiText--small"
>
Content
<div
class="euiTextColor euiTextColor--default"
>
Content
</div>
</div>
</div>
`;
12 changes: 10 additions & 2 deletions src/components/call_out/call_out.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,17 @@ export const EuiCallOut = forwardRef<HTMLDivElement, EuiCallOutProps>(

let optionalChildren;
if (children && size === 's') {
optionalChildren = <EuiText size="xs">{children}</EuiText>;
optionalChildren = (
<EuiText size="xs" color="default">
{children}
</EuiText>
);
} else if (children) {
optionalChildren = <EuiText size="s">{children}</EuiText>;
optionalChildren = (
<EuiText size="s" color="default">
{children}
</EuiText>
);
}

const H: any = heading ? `${heading}` : 'span';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ exports[`EuiContextMenuPanel props transitionDirection previous with transitionT

exports[`EuiContextMenuPanel updating items and content updates to items should not re-render if any items's watchedItemProps did not change 1`] = `
"<EuiContextMenuPanel items={{...}} hasFocus={true}>
<div className=\\"euiContextMenuPanel\\" onKeyDown={[Function]} tabIndex={0} onAnimationEnd={[Function]}>
<div className=\\"euiContextMenuPanel\\" onKeyDown={[Function (anonymous)]} tabIndex={0} onAnimationEnd={[Function (anonymous)]}>
<div>
<EuiResizeObserver onResize={[Function: onResize]}>
<div>
Expand Down Expand Up @@ -591,7 +591,7 @@ exports[`EuiContextMenuPanel updating items and content updates to items should
exports[`EuiContextMenuPanel updating items and content updates to items should not re-render if any items's watchedItemProps did not change 2`] = `
"<EuiContextMenuPanel items={{...}} hasFocus={true}>
<div className=\\"euiContextMenuPanel\\" onKeyDown={[Function]} tabIndex={0} onAnimationEnd={[Function]}>
<div className=\\"euiContextMenuPanel\\" onKeyDown={[Function (anonymous)]} tabIndex={0} onAnimationEnd={[Function (anonymous)]}>
<div>
<EuiResizeObserver onResize={[Function: onResize]}>
<div>
Expand Down Expand Up @@ -622,7 +622,7 @@ exports[`EuiContextMenuPanel updating items and content updates to items should
exports[`EuiContextMenuPanel updating items and content updates to items should re-render at all times when children exists 1`] = `
"<EuiContextMenuPanel hasFocus={true} items={{...}}>
<div className=\\"euiContextMenuPanel\\" onKeyDown={[Function]} tabIndex={0} onAnimationEnd={[Function]}>
<div className=\\"euiContextMenuPanel\\" onKeyDown={[Function (anonymous)]} tabIndex={0} onAnimationEnd={[Function (anonymous)]}>
<div>
<EuiResizeObserver onResize={[Function: onResize]}>
<div>
Expand All @@ -636,7 +636,7 @@ exports[`EuiContextMenuPanel updating items and content updates to items should
exports[`EuiContextMenuPanel updating items and content updates to items should re-render at all times when children exists 2`] = `
"<EuiContextMenuPanel hasFocus={true} items={{...}}>
<div className=\\"euiContextMenuPanel\\" onKeyDown={[Function]} tabIndex={0} onAnimationEnd={[Function]}>
<div className=\\"euiContextMenuPanel\\" onKeyDown={[Function (anonymous)]} tabIndex={0} onAnimationEnd={[Function (anonymous)]}>
<div>
<EuiResizeObserver onResize={[Function: onResize]}>
<div>
Expand All @@ -650,7 +650,7 @@ exports[`EuiContextMenuPanel updating items and content updates to items should
exports[`EuiContextMenuPanel updating items and content updates to items should re-render if any items's watchedItemProps did change 1`] = `
"<EuiContextMenuPanel watchedItemProps={{...}} items={{...}} hasFocus={true}>
<div className=\\"euiContextMenuPanel\\" onKeyDown={[Function]} tabIndex={0} onAnimationEnd={[Function]}>
<div className=\\"euiContextMenuPanel\\" onKeyDown={[Function (anonymous)]} tabIndex={0} onAnimationEnd={[Function (anonymous)]}>
<div>
<EuiResizeObserver onResize={[Function: onResize]}>
<div>
Expand Down Expand Up @@ -681,7 +681,7 @@ exports[`EuiContextMenuPanel updating items and content updates to items should
exports[`EuiContextMenuPanel updating items and content updates to items should re-render if any items's watchedItemProps did change 2`] = `
"<EuiContextMenuPanel watchedItemProps={{...}} items={{...}} hasFocus={true}>
<div className=\\"euiContextMenuPanel\\" onKeyDown={[Function]} tabIndex={0} onAnimationEnd={[Function]}>
<div className=\\"euiContextMenuPanel\\" onKeyDown={[Function (anonymous)]} tabIndex={0} onAnimationEnd={[Function (anonymous)]}>
<div>
<EuiResizeObserver onResize={[Function: onResize]}>
<div>
Expand Down
12 changes: 9 additions & 3 deletions src/components/datagrid/data_grid.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@ function extractGridData(datagrid: ReactWrapper<EuiDataGridProps>) {
}

function extractColumnWidths(datagrid: ReactWrapper) {
return (findTestSubject(datagrid, 'dataGridHeaderCell', '|=') as ReactWrapper<
any
>).reduce((widths: { [key: string]: number }, cell) => {
return (findTestSubject(
datagrid,
'dataGridHeaderCell',
'|='
) as ReactWrapper<any>).reduce((widths: { [key: string]: number }, cell) => {
const [, columnId] = cell
.props()
['data-test-subj'].match(/dataGridHeaderCell-(.*)/);
Expand Down Expand Up @@ -538,6 +540,7 @@ describe('EuiDataGrid', () => {
"height": 34,
"left": 0,
"position": "absolute",
"right": undefined,
"top": "100px",
"width": 100,
},
Expand All @@ -556,6 +559,7 @@ describe('EuiDataGrid', () => {
"height": 34,
"left": 100,
"position": "absolute",
"right": undefined,
"top": "100px",
"width": 100,
},
Expand All @@ -574,6 +578,7 @@ describe('EuiDataGrid', () => {
"height": 34,
"left": 0,
"position": "absolute",
"right": undefined,
"top": "134px",
"width": 100,
},
Expand All @@ -592,6 +597,7 @@ describe('EuiDataGrid', () => {
"height": 34,
"left": 100,
"position": "absolute",
"right": undefined,
"top": "134px",
"width": 100,
},
Expand Down
58 changes: 33 additions & 25 deletions src/components/form/__snapshots__/form.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,26 @@ exports[`EuiForm renders with error callout when isInvalid is "true" and has mul
<div
class="euiText euiText--small"
>
<ul>
<li
class="euiForm__error"
>
<span>
This is one error
</span>
</li>
<li
class="euiForm__error"
>
<span>
This is another error
</span>
</li>
</ul>
<div
class="euiTextColor euiTextColor--default"
>
<ul>
<li
class="euiForm__error"
>
<span>
This is one error
</span>
</li>
<li
class="euiForm__error"
>
<span>
This is another error
</span>
</li>
</ul>
</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -110,15 +114,19 @@ exports[`EuiForm renders with error callout when isInvalid is "true" and has one
<div
class="euiText euiText--small"
>
<ul>
<li
class="euiForm__error"
>
<span>
This is one error
</span>
</li>
</ul>
<div
class="euiTextColor euiTextColor--default"
>
<ul>
<li
class="euiForm__error"
>
<span>
This is one error
</span>
</li>
</ul>
</div>
</div>
</div>
</div>
Expand Down

0 comments on commit 7c8b501

Please sign in to comment.