Skip to content

Commit

Permalink
Fixing a few more inputs and creating a few more variables
Browse files Browse the repository at this point in the history
  • Loading branch information
cchaos committed Sep 5, 2020
1 parent d9a2483 commit 3357e09
Show file tree
Hide file tree
Showing 15 changed files with 97 additions and 113 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
> .euiDatePickerRange {
max-width: none;
width: auto;
border-radius: 0 $euiFormControlBorderRadius $euiFormControlBorderRadius 0;
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions src/components/form/file_picker/_file_picker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@
position: relative;

&.euiFilePicker--large {
border-radius: $euiFormControlBorderRadius;
overflow: hidden;
height: auto;
}

&.euiFilePicker--large.euiFilePicker--compressed {
border-radius: $euiFormControlCompressedBorderRadius;
}
}

// The input is an invisiable dropzone / button
Expand Down Expand Up @@ -65,6 +71,7 @@
padding-right: $euiFormControlPadding;
padding-bottom: $euiFormControlPadding;
pointer-events: none; /* 1 */
border-radius: $euiFormControlBorderRadius;

// sass-lint:disable-block indentation
transition:
Expand All @@ -77,6 +84,7 @@
@include euiFormControlStyleCompressed($includeStates: false);
@include euiFormControlWithIcon($compressed: true); /* 2 */
height: $euiFormControlCompressedHeight;
border-radius: $euiFormControlCompressedBorderRadius;
}

.euiFilePicker--large & {
Expand Down
32 changes: 14 additions & 18 deletions src/components/suggest/__snapshots__/suggest.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,25 @@
exports[`EuiSuggest is rendered 1`] = `
<div>
<div
class="euiSuggestInput testClass1 testClass2"
class="euiPopover euiPopover--anchorDownLeft euiPopover--displayBlock euiInputPopover euiInputPopover--fullWidth euiSuggestInput testClass1 testClass2"
>
<div
class="euiPopover euiPopover--anchorDownLeft euiPopover--displayBlock euiInputPopover euiInputPopover--fullWidth"
class="euiPopover__anchor"
>
<div
class="euiPopover__anchor"
>
<div>
<div>
<div
class="euiFormControlLayout euiFormControlLayout--fullWidth"
>
<div
class="euiFormControlLayout euiFormControlLayout--fullWidth euiFormControlLayout--group"
class="euiFormControlLayout__childrenWrapper"
>
<div
class="euiFormControlLayout__childrenWrapper"
>
<input
aria-label="aria-label"
class="euiFieldText euiFieldText--fullWidth euiFieldText--inGroup"
data-test-subj="test subject string"
type="text"
value=""
/>
</div>
<input
aria-label="aria-label"
class="euiFieldText euiFieldText--fullWidth"
data-test-subj="test subject string"
type="text"
value=""
/>
</div>
</div>
</div>
Expand Down
50 changes: 23 additions & 27 deletions src/components/suggest/__snapshots__/suggest_input.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,35 @@

exports[`EuiSuggestInput is rendered 1`] = `
<div
class="euiSuggestInput testClass1 testClass2"
class="euiPopover euiPopover--anchorDownLeft euiPopover--displayBlock euiInputPopover euiInputPopover--fullWidth euiSuggestInput testClass1 testClass2"
>
<div
class="euiPopover euiPopover--anchorDownLeft euiPopover--displayBlock euiInputPopover euiInputPopover--fullWidth"
class="euiPopover__anchor"
>
<div
class="euiPopover__anchor"
>
<div>
<div>
<div
class="euiFormControlLayout euiFormControlLayout--fullWidth euiFormControlLayout--group"
>
<div
class="euiFormControlLayout euiFormControlLayout--fullWidth euiFormControlLayout--group"
class="euiFormControlLayout__childrenWrapper"
>
<div
class="euiFormControlLayout__childrenWrapper"
>
<input
aria-label="aria-label"
class="euiFieldText euiFieldText--fullWidth euiFieldText--inGroup"
data-test-subj="test subject string"
type="text"
value=""
/>
</div>
<span
class="euiToolTipAnchor"
>
<div
class="euiSuggestInput__statusIcon"
color="accent"
data-euiicon-type="dot"
/>
</span>
<input
aria-label="aria-label"
class="euiFieldText euiFieldText--fullWidth euiFieldText--inGroup"
data-test-subj="test subject string"
type="text"
value=""
/>
</div>
<span
class="euiToolTipAnchor"
>
<div
class="euiSuggestInput__statusIcon"
color="accent"
data-euiicon-type="dot"
/>
</span>
</div>
</div>
</div>
Expand Down
11 changes: 3 additions & 8 deletions src/components/suggest/_suggest_input.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
.euiSuggestInput {
font-size: $euiFontSizeS;
color: $euiColorPrimary;

.euiSuggestInput__statusIcon {
// sass-lint:disable-block no-important
background-color: transparent !important; // Override typical append coloring
}
.euiSuggestInput__statusIcon {
// sass-lint:disable-block no-important
background-color: transparent !important; // Override typical append coloring
}
21 changes: 10 additions & 11 deletions src/components/suggest/suggest_input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,23 +137,22 @@ export const EuiSuggestInput: FunctionComponent<EuiSuggestInputProps> = props =>
<EuiFieldText
value={value}
fullWidth
append={appendArray}
append={appendArray.length ? appendArray : undefined}
isLoading={status === 'loading' ? true : false}
onChange={onFieldChange}
{...rest}
/>
);

return (
<div className={classes}>
<EuiInputPopover
input={customInput}
isOpen={isPopoverOpen}
panelPaddingSize="none"
fullWidth
closePopover={closePopover}>
<div>{suggestions}</div>
</EuiInputPopover>
</div>
<EuiInputPopover
className={classes}
input={customInput}
isOpen={isPopoverOpen}
panelPaddingSize="none"
fullWidth
closePopover={closePopover}>
{suggestions}
</EuiInputPopover>
);
};
2 changes: 1 addition & 1 deletion src/global_styling/mixins/_form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
@if $type == 'round' {
border-radius: $size;
} @else if $type == 'square' {
border-radius: $euiBorderRadius;
border-radius: $euiCheckboxBorderRadius;
}
// sass-lint:disable-block indentation
transition: background-color $euiAnimSpeedFast ease-in,
Expand Down
3 changes: 2 additions & 1 deletion src/global_styling/variables/_form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ $euiFormControlHeight: $euiSizeXXL !default;
$euiFormControlCompressedHeight: $euiSizeXL !default;
$euiFormControlPadding: $euiSizeM !default;
$euiFormControlCompressedPadding: $euiSizeS !default;
$euiFormControlBorderRadius: 0;
$euiFormControlBorderRadius: 0 !default;
$euiFormControlCompressedBorderRadius: $euiBorderRadius / 2 !default;

$euiRadioSize: $euiSize !default;
$euiCheckBoxSize: $euiSize !default;
$euiCheckboxBorderRadius: $euiBorderRadius !default;

// Switch
$euiSwitchHeight: $euiSize * 1.25 !default;
Expand Down
48 changes: 21 additions & 27 deletions src/themes/eui-amsterdam/global_styling/mixins/_form.scss
Original file line number Diff line number Diff line change
@@ -1,30 +1,4 @@
@mixin euiFormControlDefaultShadow($borderOnly: false) {
// sass-lint:disable-block indentation
background-color: $euiFormBackgroundColor;
background-repeat: no-repeat;
background-size: 0% 100%; // 1

@if ($borderOnly) {
box-shadow: inset 0 0 0 1px $euiFormBorderColor;
} @else {
box-shadow:
inset 0 0 0 1px $euiFormBorderColor;
}

transition:
box-shadow $euiAnimSpeedFast ease-in,
background-image $euiAnimSpeedFast ease-in,
background-size $euiAnimSpeedFast ease-in,
background-color $euiAnimSpeedFast ease-in;

// Fixes bug in Firefox where adding a transition to the background-color
// caused a flash of differently styled dropdown.
@supports (-moz-appearance: none) { // sass-lint:disable-line no-vendor-prefixes
// List *must* be in the same order as the above.
transition-property: box-shadow, background-image, background-size;
}
}

// Removes some box-shadows
@mixin euiFormControlFocusStyle($borderOnly: false) {
// sass-lint:disable-block indentation, empty-args
background-color: tintOrShade($euiColorEmptyShade, 0%, 40%);
Expand All @@ -38,3 +12,23 @@
inset 0 0 0 1px $euiFormBorderColor;
}
}

// Removes euiSlightShadow
@mixin euiCustomControl($type: null, $size: $euiSize) {
@if $size {
$size: $size - 2px; // subtract 2px from size to account for border size
padding: $size / 2;
}

border: 1px solid $euiFormCustomControlBorderColor;
background: $euiColorEmptyShade no-repeat center;

@if $type == 'round' {
border-radius: $size;
} @else if $type == 'square' {
border-radius: $euiCheckboxBorderRadius;
}
// sass-lint:disable-block indentation
transition: background-color $euiAnimSpeedFast ease-in,
border-color $euiAnimSpeedFast ease-in;
}
4 changes: 4 additions & 0 deletions src/themes/eui-amsterdam/global_styling/variables/_form.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
$euiFormControlBorderRadius: $euiBorderRadius;
$euiFormControlCompressedBorderRadius: $euiBorderRadiusSmall;

$euiFormControlBoxShadow: 0 0;

$euiCheckboxBorderRadius: $euiBorderRadiusSmall;
3 changes: 0 additions & 3 deletions src/themes/eui-amsterdam/overrides/_checkbox.scss

This file was deleted.

3 changes: 0 additions & 3 deletions src/themes/eui-amsterdam/overrides/_file_picker.scss

This file was deleted.

10 changes: 4 additions & 6 deletions src/themes/eui-amsterdam/overrides/_form_control_layout.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
.euiFormControlLayout {
$leftSideRadius: $euiBorderRadius 0 0 $euiBorderRadius;
$rightSideRadius: 0 $euiBorderRadius $euiBorderRadius 0;
.euiFormControlLayout--group {
$leftSideRadius: $euiFormControlBorderRadius 0 0 $euiFormControlBorderRadius;
$rightSideRadius: 0 $euiFormControlBorderRadius $euiFormControlBorderRadius 0;
$leftSideRadiusSmall: $euiFormControlCompressedBorderRadius 0 0 $euiFormControlCompressedBorderRadius;
$rightSideRadiusSmall: 0 $euiFormControlCompressedBorderRadius $euiFormControlCompressedBorderRadius 0;
}

.euiFormControlLayout--group {
border-radius: $euiBorderRadius;
border-radius: $euiFormControlBorderRadius;

.euiFormControlLayout__prepend:first-child {
border-radius: $leftSideRadius;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
.euiFormControlLayoutDelimited {
border-radius: $euiBorderRadius;
border-radius: $euiFormControlBorderRadius;

&.euiFormControlLayout--group {
.euiFormControlLayout__childrenWrapper:first-child {
border-radius: $euiBorderRadius 0 0 $euiBorderRadius;
border-radius: $euiFormControlBorderRadius 0 0 $euiFormControlBorderRadius;
}
}

.euiFormControlLayout__childrenWrapper:only-child {
border-radius: $euiBorderRadius;
border-radius: $euiFormControlBorderRadius;
overflow: hidden;
}

.euiFormControlLayout__prepend +
.euiFormControlLayout__childrenWrapper {
&:last-child {
border-radius: 0 $euiBorderRadius $euiBorderRadius 0;
border-radius: 0 $euiFormControlBorderRadius $euiFormControlBorderRadius 0;
}
}

Expand All @@ -38,4 +38,4 @@
}
}
}
}
}
4 changes: 1 addition & 3 deletions src/themes/eui-amsterdam/overrides/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
@import 'button_empty';
@import 'button_group';
@import 'call_out';
@import 'checkbox';
@import 'code';
@import 'file_picker';
@import 'filter_group';
@import 'header';
@import 'image';
Expand All @@ -15,4 +13,4 @@
@import 'progress';
@import 'text';
@import 'form_control_layout';
@import 'form_control_layout_delimited';
@import 'form_control_layout_delimited';

0 comments on commit 3357e09

Please sign in to comment.