Skip to content

Commit

Permalink
Upgrade EUI to v95.2.0 (#186841)
Browse files Browse the repository at this point in the history
`v95.1.0`⏩`v95.2.0`

_[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_

---

## [`v95.2.0`](https://github.com/elastic/eui/releases/v95.2.0)

- Updated `EuiContextMenuItemIcon`'s type definition to explicitly
define support for `EuiIcon`'s `IconType`
([#7804](elastic/eui#7804))
- Updated `EuiSteps` to support a new `titleSize="xxs"` style, which
outputs the same title font size but smaller unnumbered step indicators
([#7813](elastic/eui#7813))
- Updated `EuiStepsHorizontal` to support a new `size="xs"` style, which
outputs smaller unnumbered step indicators
([#7813](elastic/eui#7813))
- Updated `EuiStepNumber` to support new `titleSize="none"` which omits
rendering step numbers, and will only render icons
([#7813](elastic/eui#7813))
- Updated `setEuiDevProviderWarning` to additionally accept a custom
callback function, which warning messages will be passed to
([#7820](elastic/eui#7820))
- Updated `EuiIcon` to feature updated `logoElasticStack` logo for
referencing Elastic Stack platform
([#7838](elastic/eui#7838))
- Updated `EuiIcon` to feature updated `casesApp` design.
([#7840](elastic/eui#7840))
- Updated `EuiComboBox` to no longer autocomplete searched text when
used within forms ([#7842](elastic/eui#7842))

**CSS-in-JS conversions**

- Converted `EuiFilePicker` to Emotion; Removed
`$euiFilePickerTallHeight`
([#7833](elastic/eui#7833))

---------

Co-authored-by: Jon <[email protected]>
  • Loading branch information
cee-chen and jbudz authored Jun 28, 2024
1 parent bebb273 commit 2bcc2fd
Show file tree
Hide file tree
Showing 19 changed files with 246 additions and 254 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"@elastic/ecs": "^8.11.1",
"@elastic/elasticsearch": "^8.14.0",
"@elastic/ems-client": "8.5.1",
"@elastic/eui": "95.1.0-backport.0",
"@elastic/eui": "95.2.0",
"@elastic/filesaver": "1.1.2",
"@elastic/node-crypto": "1.2.1",
"@elastic/numeral": "^2.5.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@

import React, { useImperativeHandle, useRef } from 'react';
import { i18n } from '@kbn/i18n';
import { EuiFilePicker, EuiFilePickerProps, EuiImage } from '@elastic/eui';
import { EuiFilePicker, EuiImage } from '@elastic/eui';
import type {
EuiFilePickerClass,
EuiFilePickerProps,
} from '@elastic/eui/src/components/form/file_picker/file_picker';

import { ResetInputRef } from '@kbn/management-settings-types';
import { getFieldInputValue, useUpdate } from '@kbn/management-settings-utilities';
Expand Down Expand Up @@ -45,7 +49,7 @@ const errorMessage = i18n.translate('management.settings.field.imageChangeErrorM
*/
export const ImageInput = React.forwardRef<ResetInputRef, ImageInputProps>(
({ field, unsavedChange, isSavingEnabled, onInputChange }, ref) => {
const inputRef = useRef<EuiFilePicker>(null);
const inputRef = useRef<EuiFilePickerClass>(null);

useImperativeHandle(ref, () => ({
reset: () => inputRef.current?.removeFiles(),
Expand Down Expand Up @@ -99,7 +103,7 @@ export const ImageInput = React.forwardRef<ResetInputRef, ImageInputProps>(
accept=".jpg,.jpeg,.png"
data-test-subj={`${TEST_SUBJ_PREFIX_FIELD}-${id}`}
disabled={!isSavingEnabled}
ref={inputRef}
ref={inputRef as React.Ref<Omit<EuiFilePickerProps, 'stylesMemoizer'>>}
fullWidth
{...{ onChange, ...a11yProps }}
/>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ import {
useEuiTheme,
useGeneratedHtmlId,
} from '@elastic/eui';
import type {
EuiFilePickerClass,
EuiFilePickerProps,
} from '@elastic/eui/src/components/form/file_picker/file_picker';
import { euiThemeVars } from '@kbn/ui-theme';
import { useBehaviorSubject } from '@kbn/shared-ux-file-util';
import { css } from '@emotion/react';
Expand Down Expand Up @@ -48,7 +52,7 @@ const styles = {
`,
};

export const FileUpload = React.forwardRef<EuiFilePicker, Props>(
export const FileUpload = React.forwardRef<EuiFilePickerClass, Props>(
(
{
compressed,
Expand Down Expand Up @@ -90,7 +94,7 @@ export const FileUpload = React.forwardRef<EuiFilePicker, Props>(
fullWidth={fullWidth}
aria-label={i18nTexts.defaultPickerLabel}
id={id}
ref={ref}
ref={ref as React.Ref<Omit<EuiFilePickerProps, 'stylesMemoizer'>>}
onChange={(fs) => {
uploadState.setFiles(Array.from(fs ?? []));
if (immediate && uploadState.hasFiles()) uploadState.upload(meta);
Expand Down
4 changes: 2 additions & 2 deletions packages/shared-ux/file/file_upload/impl/src/file_upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* Side Public License, v 1.
*/

import { EuiFilePicker } from '@elastic/eui';
import React, { type FunctionComponent, useRef, useEffect, useMemo } from 'react';
import type { EuiFilePickerClass } from '@elastic/eui/src/components/form/file_picker/file_picker';

import type { FileJSON } from '@kbn/shared-ux-file-types';
import { useFilesContext } from '@kbn/shared-ux-file-context';
Expand Down Expand Up @@ -136,7 +136,7 @@ export const FileUpload = <Kind extends string = string>({
className,
}: Props<Kind>): ReturnType<FunctionComponent> => {
const { client } = useFilesContext();
const ref = useRef<null | EuiFilePicker>(null);
const ref = useRef<null | EuiFilePickerClass>(null);
const fileKind = client.getFileKind(kindId);
const repeatedUploads = compressed || allowRepeatedUploads;
const uploadState = useMemo(
Expand Down
2 changes: 1 addition & 1 deletion src/dev/license_checker/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const LICENSE_OVERRIDES = {
'[email protected]': ['Eclipse Distribution License - v 1.0'], // cf. https://github.com/bjornharrtell/jsts
'@mapbox/[email protected]': ['MIT'], // license in readme https://github.com/tmcw/jsonlint
'@elastic/[email protected]': ['Elastic License 2.0'],
'@elastic/eui@95.1.0-backport.0': ['SSPL-1.0 OR Elastic License 2.0'],
'@elastic/eui@95.2.0': ['SSPL-1.0 OR Elastic License 2.0'],
'[email protected]': ['CC-BY-4.0'], // retired ODC‑By license https://github.com/mattcg/language-subtag-registry
'[email protected]': ['MIT'], // license in importing module https://www.npmjs.com/package/binary
'@bufbuild/[email protected]': ['Apache-2.0'], // license (Apache-2.0 AND BSD-3-Clause)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe('Flyout', () => {
component.update();

expect(component.state('file')).toBe(undefined);
component.find('EuiFilePicker').simulate('change', [mockFile]);
component.find('EuiFilePickerClass').simulate('change', [mockFile]);
expect(component.state('file')).toBe(mockFile);
});

Expand All @@ -86,9 +86,9 @@ describe('Flyout', () => {
component.update();

expect(component.state('file')).toBe(undefined);
component.find('EuiFilePicker').simulate('change', [mockFile]);
component.find('EuiFilePickerClass').simulate('change', [mockFile]);
expect(component.state('file')).toBe(mockFile);
component.find('EuiFilePicker').simulate('change', []);
component.find('EuiFilePickerClass').simulate('change', []);
expect(component.state('file')).toBe(undefined);
});

Expand All @@ -105,7 +105,7 @@ describe('Flyout', () => {
'EuiButton[data-test-subj="importSavedObjectsImportBtn"]'
);
expect(importButton.prop('isDisabled')).toBe(true);
component.find('EuiFilePicker').simulate('change', [mockFile]);
component.find('EuiFilePickerClass').simulate('change', [mockFile]);

// Ensure state changes are reflected
component.update();
Expand Down
Loading

0 comments on commit 2bcc2fd

Please sign in to comment.