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

A couple fixes for 7.10 #4084

Merged
merged 6 commits into from
Sep 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
## [`master`](https://github.com/elastic/eui/tree/master)

- Added `both` option to `flush` prop of `EuiButtonEmpty` ([#4084](https://github.com/elastic/eui/pull/4084))

**Bug fixes**

- Fixed `EuiRange` and `EuiDualRange` display of internal spacer ([#4084](https://github.com/elastic/eui/pull/4084))
- Fixed `EuiFieldSearch` padding for the different states ([#4084](https://github.com/elastic/eui/pull/4084))
- Fixed `EuiCheckableCard` disabled but checked styles ([#4084](https://github.com/elastic/eui/pull/4084))

**Theme: Amsterdam**

- Fixed `line-height` on `EuiTitle` ([#4079](https://github.com/elastic/eui/pull/4079))
Expand Down
4 changes: 4 additions & 0 deletions src-docs/src/views/button/button_empty_flush.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,9 @@ export default () => (
<EuiFlexItem grow={false}>
<EuiButtonEmpty flush="right">Flush right</EuiButtonEmpty>
</EuiFlexItem>

<EuiFlexItem grow={false}>
<EuiButtonEmpty flush="both">Flush both</EuiButtonEmpty>
</EuiFlexItem>
</EuiFlexGroup>
);
1 change: 1 addition & 0 deletions src-docs/src/views/button/button_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ export const ButtonExample = {
the other content in the container.
</p>
),
props: { EuiButtonEmpty },
snippet: buttonOptionFlushSnippet,
demo: <ButtonOptionFlush />,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,21 @@ exports[`EuiButtonEmpty props contentProps is rendered 1`] = `
</button>
`;

exports[`EuiButtonEmpty props flush both is rendered 1`] = `
<button
class="euiButtonEmpty euiButtonEmpty--primary euiButtonEmpty--flushBoth"
type="button"
>
<span
class="euiButtonContent euiButtonEmpty__content"
>
<span
class="euiButtonEmpty__text"
/>
</span>
</button>
`;

exports[`EuiButtonEmpty props flush left is rendered 1`] = `
<button
class="euiButtonEmpty euiButtonEmpty--primary euiButtonEmpty--flushLeft"
Expand Down
37 changes: 18 additions & 19 deletions src/components/button/button_empty/_button_empty.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@
}
}


.euiButtonEmpty--flushLeft,
.euiButtonEmpty--flushRight,
.euiButtonEmpty--flushBoth {
.euiButtonEmpty__content {
padding-left: 0;
padding-right: 0;
}
}

.euiButtonEmpty--flushLeft {
margin-right: $euiSizeS;
}

.euiButtonEmpty--flushRight {
margin-left: $euiSizeS;
}

// Modifier naming and colors.
$euiButtonEmptyTypes: (
primary: $euiColorPrimary,
Expand Down Expand Up @@ -84,22 +102,3 @@ $euiButtonEmptyTypes: (
}
}

.euiButtonEmpty--flushLeft {
margin-right: $euiSizeS;

.euiButtonEmpty__content {
border-left: none;
padding-left: 0;
padding-right: 0;
}
}

.euiButtonEmpty--flushRight {
margin-left: $euiSizeS;

.euiButtonEmpty__content {
border-right: none;
padding-left: 0;
padding-right: 0;
}
}
3 changes: 2 additions & 1 deletion src/components/button/button_empty/button_empty.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export type EuiButtonEmptySizes = keyof typeof sizeToClassNameMap;
const flushTypeToClassNameMap = {
left: 'euiButtonEmpty--flushLeft',
right: 'euiButtonEmpty--flushRight',
both: 'euiButtonEmpty--flushBoth',
};

export const FLUSH_TYPES = keysOf(flushTypeToClassNameMap);
Expand All @@ -79,7 +80,7 @@ interface CommonEuiButtonEmptyProps extends EuiButtonContentProps, CommonProps {
color?: EuiButtonEmptyColor;
size?: EuiButtonEmptySizes;
/**
* Ensure the text of the button sits flush to the left or right side of its container
* Ensure the text of the button sits flush to the left, right, or both sides of its container
*/
flush?: keyof typeof flushTypeToClassNameMap;
/**
Expand Down
10 changes: 4 additions & 6 deletions src/components/card/checkable_card/_checkable_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@
overflow: hidden; // Hides background color inside panel rounded corners

&:not(.euiCheckableCard-isDisabled) {
&.euiCheckableCard-isChecked {
border-color: $euiColorPrimary;
}

&:focus-within {
@include euiFocusRing;
}
}
}

.euiCheckableCard-isChecked {
border-color: $euiColorPrimary;
}



.euiCheckableCard__row {
display: flex;
align-items: stretch;
Expand Down
28 changes: 24 additions & 4 deletions src/components/form/field_search/_field_search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,31 @@
display: none; /* 2 */
}

&.euiFieldSearch-isClearable {
@include euiFormControlLayoutPadding(1)
}

&.euiFieldSearch-isLoading {
@include euiFormControlLayoutPadding(1);
}

&.euiFieldSearch-isLoading.euiFieldSearch-isClearable {
@include euiFormControlLayoutPadding(2);
}

&.euiFieldSearch--compressed {
@include euiFormControlWithIcon($isIconOptional: false, $side: 'left', $compressed: true);
}

&.euiFieldSearch-isClearable {
@include euiFormControlLayoutPadding(1)
&.euiFieldSearch-isClearable {
@include euiFormControlLayoutPadding(1, $compressed: true);
}

&.euiFieldSearch-isLoading {
@include euiFormControlLayoutPadding(1, $compressed: true);
}

&.euiFieldSearch-isLoading.euiFieldSearch-isClearable {
@include euiFormControlLayoutPadding(2, $compressed: true);
}
}
}
}
66 changes: 0 additions & 66 deletions src/components/form/range/__snapshots__/dual_range.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ exports[`EuiDualRange allows value prop to accept empty strings 1`] = `
<div
class="euiRangeWrapper euiDualRange"
>
<div
class="euiRange__horizontalSpacer"
/>
<div
aria-hidden="false"
class="euiRangeTrack"
Expand All @@ -22,19 +19,13 @@ exports[`EuiDualRange allows value prop to accept empty strings 1`] = `
type="range"
/>
</div>
<div
class="euiRange__horizontalSpacer"
/>
</div>
`;

exports[`EuiDualRange allows value prop to accept numbers 1`] = `
<div
class="euiRangeWrapper euiDualRange"
>
<div
class="euiRange__horizontalSpacer"
/>
<div
aria-hidden="false"
class="euiRangeTrack"
Expand All @@ -58,9 +49,6 @@ exports[`EuiDualRange allows value prop to accept numbers 1`] = `
type="range"
/>
</div>
<div
class="euiRange__horizontalSpacer"
/>
</div>
`;

Expand Down Expand Up @@ -143,9 +131,6 @@ exports[`EuiDualRange is rendered 1`] = `
<div
class="euiRangeWrapper euiDualRange testClass1 testClass2"
>
<div
class="euiRange__horizontalSpacer"
/>
<div
aria-hidden="false"
class="euiRangeTrack"
Expand All @@ -172,19 +157,13 @@ exports[`EuiDualRange is rendered 1`] = `
type="range"
/>
</div>
<div
class="euiRange__horizontalSpacer"
/>
</div>
`;

exports[`EuiDualRange props compressed should render 1`] = `
<div
class="euiRangeWrapper euiRangeWrapper--compressed euiDualRange"
>
<div
class="euiRange__horizontalSpacer"
/>
<div
aria-hidden="false"
class="euiRangeTrack"
Expand All @@ -208,19 +187,13 @@ exports[`EuiDualRange props compressed should render 1`] = `
type="range"
/>
</div>
<div
class="euiRange__horizontalSpacer"
/>
</div>
`;

exports[`EuiDualRange props custom ticks should render 1`] = `
<div
class="euiRangeWrapper euiDualRange"
>
<div
class="euiRange__horizontalSpacer"
/>
<div
aria-hidden="false"
class="euiRangeTrack"
Expand Down Expand Up @@ -269,19 +242,13 @@ exports[`EuiDualRange props custom ticks should render 1`] = `
type="range"
/>
</div>
<div
class="euiRange__horizontalSpacer"
/>
</div>
`;

exports[`EuiDualRange props disabled should render 1`] = `
<div
class="euiRangeWrapper euiDualRange"
>
<div
class="euiRange__horizontalSpacer"
/>
<div
aria-hidden="false"
class="euiRangeTrack euiRangeTrack--disabled"
Expand All @@ -306,19 +273,13 @@ exports[`EuiDualRange props disabled should render 1`] = `
type="range"
/>
</div>
<div
class="euiRange__horizontalSpacer"
/>
</div>
`;

exports[`EuiDualRange props fullWidth should render 1`] = `
<div
class="euiRangeWrapper euiRangeWrapper--fullWidth euiDualRange"
>
<div
class="euiRange__horizontalSpacer"
/>
<div
aria-hidden="false"
class="euiRangeTrack"
Expand All @@ -342,9 +303,6 @@ exports[`EuiDualRange props fullWidth should render 1`] = `
type="range"
/>
</div>
<div
class="euiRange__horizontalSpacer"
/>
</div>
`;

Expand Down Expand Up @@ -429,9 +387,6 @@ exports[`EuiDualRange props labels should render 1`] = `
<div
class="euiRangeWrapper euiDualRange"
>
<div
class="euiRange__horizontalSpacer"
/>
<label
class="euiRangeLabel euiRangeLabel--min"
>
Expand Down Expand Up @@ -465,19 +420,13 @@ exports[`EuiDualRange props labels should render 1`] = `
>
100
</label>
<div
class="euiRange__horizontalSpacer"
/>
</div>
`;

exports[`EuiDualRange props levels should render 1`] = `
<div
class="euiRangeWrapper euiDualRange"
>
<div
class="euiRange__horizontalSpacer"
/>
<div
aria-hidden="false"
class="euiRangeTrack"
Expand Down Expand Up @@ -513,19 +462,13 @@ exports[`EuiDualRange props levels should render 1`] = `
type="range"
/>
</div>
<div
class="euiRange__horizontalSpacer"
/>
</div>
`;

exports[`EuiDualRange props range should render 1`] = `
<div
class="euiRangeWrapper euiDualRange"
>
<div
class="euiRange__horizontalSpacer"
/>
<div
aria-hidden="false"
class="euiRangeTrack"
Expand All @@ -549,9 +492,6 @@ exports[`EuiDualRange props range should render 1`] = `
type="range"
/>
</div>
<div
class="euiRange__horizontalSpacer"
/>
</div>
`;

Expand Down Expand Up @@ -609,9 +549,6 @@ exports[`EuiDualRange props ticks should render 1`] = `
<div
class="euiRangeWrapper euiDualRange"
>
<div
class="euiRange__horizontalSpacer"
/>
<div
aria-hidden="false"
class="euiRangeTrack"
Expand Down Expand Up @@ -695,8 +632,5 @@ exports[`EuiDualRange props ticks should render 1`] = `
type="range"
/>
</div>
<div
class="euiRange__horizontalSpacer"
/>
</div>
`;
Loading