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

EuiFilePicker dropzone style updates #6479

Merged
merged 21 commits into from
Dec 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ exports[`EuiFilePicker is rendered 1`] = `
<span
aria-hidden="true"
class="euiFilePicker__icon"
color="primary"
data-euiicon-type="importAction"
/>
<div
Expand Down
28 changes: 14 additions & 14 deletions src/components/form/file_picker/_file_picker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,30 +64,28 @@
/**
* 1. Don't block the user from dropping files onto the filepicker.
* 2. Ensure space for import icon, loading spinner, and clear button (only if it has files)
* 3. Delay focus gradient or else it will only partially transition while file chooser opens
* 4. Static height so that it doesn't shift its surrounding contents around
*/
.euiFilePicker__prompt {
@include euiFormControlDefaultShadow;
@include euiFormControlWithIcon; /* 2 */
height: $euiFormControlHeight;
padding-top: $euiFormControlPadding;
padding-right: $euiFormControlPadding;
padding-bottom: $euiFormControlPadding;
pointer-events: none; /* 1 */
border: $euiBorderWidthThick dashed $euiColorLightShade;
border-radius: $euiFormControlBorderRadius;

transition:
box-shadow $euiAnimSpeedFast ease-in,
background-color $euiAnimSpeedFast ease-in,
background-image $euiAnimSpeedFast ease-in,
background-size $euiAnimSpeedFast ease-in $euiAnimSpeedFast; /* 3 */
border-color $euiAnimSpeedFast ease-in,
background-color $euiAnimSpeedFast ease-in;

.euiFilePicker--compressed & {
@include euiFormControlStyleCompressed($includeStates: false);
@include euiFormControlWithIcon($compressed: true); /* 2 */
height: $euiFormControlCompressedHeight;
border-radius: $euiFormControlCompressedBorderRadius;
box-shadow: none;
}

.euiFilePicker--large & {
Expand All @@ -104,7 +102,7 @@
}

.euiFilePicker-isInvalid & {
@include euiFormControlInvalidStyle;
border: $euiBorderWidthThick dashed $euiColorDanger;
}
}

Expand All @@ -113,9 +111,14 @@
@include euiTextTruncate;
line-height: $euiSize;

// make normal sized prompt look like placeholder
// Make normal sized prompt stand out a bit more - on the large size we don't need this as it's already identifiable
.euiFilePicker:not(.euiFilePicker--large):not(.euiFilePicker-hasFiles) & {
color: $euiColorMediumShade;
color: $euiColorPrimaryText;
}

// Offset/center prompt text for non-large file-pickers
.euiFilePicker:not(.euiFilePicker--large) & {
margin-top: $euiSizeXS / -2;
}
}

Expand Down Expand Up @@ -150,16 +153,13 @@
// Focus
.euiFilePicker__showDrop .euiFilePicker__prompt,
.euiFilePicker__input:focus + .euiFilePicker__prompt {
@include euiFormControlFocusStyle;

.euiFilePicker--compressed & {
@include euiFormControlFocusStyle($borderOnly: true);
}
border-color: $euiColorPrimary;
}

// Disabled
.euiFilePicker__input:disabled + .euiFilePicker__prompt {
@include euiFormControlDisabledStyle;
box-shadow: none;
}

// Make space for the icons on the right
Expand Down
1 change: 1 addition & 0 deletions src/components/form/file_picker/file_picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ export class EuiFilePicker extends Component<EuiFilePickerProps> {
<div className="euiFilePicker__prompt" id={promptId}>
<EuiIcon
className="euiFilePicker__icon"
color={disabled ? 'subdued' : 'primary'}
type="importAction"
size={normalFormControl ? 'm' : 'l'}
aria-hidden="true"
Expand Down
1 change: 1 addition & 0 deletions upcoming_changelogs/6479.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- `EuiFilePicker` styles have been updated to look more like an interactive element.