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

Upgrade EUI to v43.1.1 #120935

Merged
merged 47 commits into from
Dec 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
3d27dde
eui to v43.0.0
thompsongl Dec 9, 2021
ae5276c
update themeprovider types
thompsongl Dec 9, 2021
c233f80
Merge branch 'main' into eui/43.0
thompsongl Dec 9, 2021
9e49e8f
update sass import location
thompsongl Dec 9, 2021
d73dbee
storyshots
thompsongl Dec 9, 2021
138ab58
snapshots
thompsongl Dec 9, 2021
72de6ee
jest
thompsongl Dec 9, 2021
4ef571f
jest
thompsongl Dec 9, 2021
8c67812
Merge branch 'main' into eui/43.0
thompsongl Dec 9, 2021
0a4c8ed
timepicker functional test helpers
thompsongl Dec 9, 2021
1460999
snapshots
thompsongl Dec 9, 2021
655ab86
timepicker functional test helpers
thompsongl Dec 9, 2021
af37e56
invert checked logic
thompsongl Dec 9, 2021
d97e9fd
Merge branch 'main' into eui/43.0
thompsongl Dec 9, 2021
7f85b10
fix i18n token
thompsongl Dec 9, 2021
5e4a764
snapshots
thompsongl Dec 9, 2021
f370b20
handle new refresh interval operations order
thompsongl Dec 13, 2021
25d8b6b
Merge branch 'main' into eui/43.0
thompsongl Dec 13, 2021
9b530e0
refactor refresh interval logic, test
thompsongl Dec 13, 2021
719c5a8
jest
thompsongl Dec 13, 2021
104ba53
Merge branch 'main' into eui/43.0
thompsongl Dec 13, 2021
4616bc7
timepicker popover order
thompsongl Dec 13, 2021
1e9a278
eui to v43.1.0
thompsongl Dec 13, 2021
3f10425
jest
thompsongl Dec 13, 2021
5d514cc
Merge branch 'main' into eui/43.0
thompsongl Dec 13, 2021
35705e1
jest
thompsongl Dec 13, 2021
3a33df2
jest
thompsongl Dec 13, 2021
0f0ffb3
Merge branch 'main' into eui/43.0
thompsongl Dec 13, 2021
0ea0e51
euicode selector
thompsongl Dec 14, 2021
04db019
jest
thompsongl Dec 14, 2021
253e475
Merge branch 'main' into eui/43.0
thompsongl Dec 14, 2021
2e555b5
functional tests
thompsongl Dec 14, 2021
c179517
Merge branch 'main' into eui/43.0
thompsongl Dec 14, 2021
d67dd95
functional tests
thompsongl Dec 14, 2021
cc0b540
Merge branch 'main' into eui/43.0
thompsongl Dec 14, 2021
b579d27
timepicker
thompsongl Dec 14, 2021
db050f0
bump timeout
thompsongl Dec 14, 2021
9d0a26e
Merge branch 'main' into eui/43.0
thompsongl Dec 15, 2021
07eee93
conditional click to close
thompsongl Dec 15, 2021
5083a50
clean up
thompsongl Dec 15, 2021
d5b68ce
eui to v43.1.1
thompsongl Dec 15, 2021
75f7ac4
Merge branch 'main' into eui/43.0
thompsongl Dec 15, 2021
dc71e80
clean up
thompsongl Dec 16, 2021
b582282
Merge branch 'main' into eui/43.0
thompsongl Dec 16, 2021
69a308a
loading background
thompsongl Dec 17, 2021
b4c2ab7
Merge branch 'main' into eui/43.0
thompsongl Dec 17, 2021
a280d69
Merge branch 'main' into eui/43.0
kibanamachine Dec 20, 2021
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"@elastic/datemath": "link:bazel-bin/packages/elastic-datemath",
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.35",
"@elastic/ems-client": "8.0.0",
"@elastic/eui": "41.2.3",
"@elastic/eui": "43.1.1",
"@elastic/filesaver": "1.1.2",
"@elastic/node-crypto": "1.2.1",
"@elastic/numeral": "^2.5.1",
Expand Down
2 changes: 0 additions & 2 deletions packages/elastic-eslint-config-kibana/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ module.exports = {
...[
'@elastic/eui/dist/eui_theme_light.json',
'@elastic/eui/dist/eui_theme_dark.json',
'@elastic/eui/dist/eui_theme_amsterdam_light.json',
'@elastic/eui/dist/eui_theme_amsterdam_dark.json',
].map(from => ({
from,
to: false,
Expand Down
8 changes: 4 additions & 4 deletions packages/kbn-ui-shared-deps-npm/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ module.exports = (_, argv) => {
'@elastic/eui/dist/eui_charts_theme',
'@elastic/eui/lib/services',
'@elastic/eui/lib/services/format',
'@elastic/eui/dist/eui_theme_amsterdam_light.json',
'@elastic/eui/dist/eui_theme_amsterdam_dark.json',
'@elastic/eui/dist/eui_theme_light.json',
'@elastic/eui/dist/eui_theme_dark.json',
'@elastic/numeral',
'@emotion/react',
'classnames',
Expand All @@ -96,8 +96,8 @@ module.exports = (_, argv) => {
'styled-components',
'tslib',
],
'kbn-ui-shared-deps-npm.v8.dark': ['@elastic/eui/dist/eui_theme_amsterdam_dark.css'],
'kbn-ui-shared-deps-npm.v8.light': ['@elastic/eui/dist/eui_theme_amsterdam_light.css'],
'kbn-ui-shared-deps-npm.v8.dark': ['@elastic/eui/dist/eui_theme_dark.css'],
'kbn-ui-shared-deps-npm.v8.light': ['@elastic/eui/dist/eui_theme_light.css'],
},
context: __dirname,
devtool: 'cheap-source-map',
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-ui-shared-deps-src/src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
*/

/* eslint-disable-next-line @kbn/eslint/module_migration */
import { default as v8Light } from '@elastic/eui/dist/eui_theme_amsterdam_light.json';
import { default as v8Light } from '@elastic/eui/dist/eui_theme_light.json';
/* eslint-disable-next-line @kbn/eslint/module_migration */
import { default as v8Dark } from '@elastic/eui/dist/eui_theme_amsterdam_dark.json';
import { default as v8Dark } from '@elastic/eui/dist/eui_theme_dark.json';

const globals: any = typeof window === 'undefined' ? {} : window;

Expand Down
4 changes: 2 additions & 2 deletions src/core/public/core_app/styles/_globals_v8dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
//
// prepended to all .scss imports (from JS, when v8dark theme selected)

@import '@elastic/eui/src/themes/eui-amsterdam/eui_amsterdam_colors_dark';
@import '@elastic/eui/src/themes/eui-amsterdam/eui_amsterdam_globals';
@import '@elastic/eui/src/themes/amsterdam/colors_dark';
@import '@elastic/eui/src/themes/amsterdam/globals';

@import './mixins';

Expand Down
4 changes: 2 additions & 2 deletions src/core/public/core_app/styles/_globals_v8light.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
//
// prepended to all .scss imports (from JS, when v8light theme selected)

@import '@elastic/eui/src/themes/eui-amsterdam/eui_amsterdam_colors_light';
@import '@elastic/eui/src/themes/eui-amsterdam/eui_amsterdam_globals';
@import '@elastic/eui/src/themes/amsterdam/colors_light';
@import '@elastic/eui/src/themes/amsterdam/globals';

@import './mixins';

Expand Down
38 changes: 25 additions & 13 deletions src/core/public/i18n/__snapshots__/i18n_service.test.tsx.snap

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

142 changes: 90 additions & 52 deletions src/core/public/i18n/i18n_eui_mapping.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ export const getEuiContextMapping = (): EuiTokensObject => {
'euiAccordion.isLoading': i18n.translate('core.euiAccordion.isLoading', {
defaultMessage: 'Loading',
}),
'euiAutoRefresh.autoRefreshLabel': i18n.translate('core.euiAutoRefresh.autoRefreshLabel', {
defaultMessage: 'Auto refresh',
}),
'euiAutoRefresh.buttonLabelOff': i18n.translate('core.euiAutoRefresh.buttonLabelOff', {
defaultMessage: 'Auto refresh is off',
}),
'euiAutoRefresh.buttonLabelOn': ({ prettyInterval }: EuiValues) =>
i18n.translate('core.euiAutoRefresh.buttonLabelOn', {
defaultMessage: 'Auto refresh is on and set to {prettyInterval}',
values: { prettyInterval },
}),
'euiBasicTable.selectAllRows': i18n.translate('core.euiBasicTable.selectAllRows', {
defaultMessage: 'Select all rows',
description: 'ARIA and displayed label on a checkbox to select all table rows',
Expand Down Expand Up @@ -495,6 +506,42 @@ export const getEuiContextMapping = (): EuiTokensObject => {
defaultMessage: 'Update needed: {title}',
values: { title },
}),
'euiDisplaySelector.buttonText': i18n.translate('core.euiDisplaySelector.buttonText', {
defaultMessage: 'Display options',
}),
'euiDisplaySelector.resetButtonText': i18n.translate(
'core.euiDisplaySelector.resetButtonText',
{
defaultMessage: 'Reset to default',
}
),
'euiDisplaySelector.densityLabel': i18n.translate('core.euiDisplaySelector.densityLabel', {
defaultMessage: 'Density',
}),
'euiDisplaySelector.labelCompact': i18n.translate('core.euiDisplaySelector.labelCompact', {
defaultMessage: 'Compact',
}),
'euiDisplaySelector.labelNormal': i18n.translate('core.euiDisplaySelector.labelNormal', {
defaultMessage: 'Normal',
}),
'euiDisplaySelector.labelExpanded': i18n.translate('core.euiDisplaySelector.labelExpanded', {
defaultMessage: 'Expanded',
}),
'euiDisplaySelector.labelSingle': i18n.translate('core.euiDisplaySelector.labelSingle', {
defaultMessage: 'Single',
}),
'euiDisplaySelector.labelAuto': i18n.translate('core.euiDisplaySelector.labelAuto', {
defaultMessage: 'Auto fit',
}),
'euiDisplaySelector.labelCustom': i18n.translate('core.euiDisplaySelector.labelCustom', {
defaultMessage: 'Custom',
}),
'euiDisplaySelector.rowHeightLabel': i18n.translate('core.euiDisplaySelector.rowHeightLabel', {
defaultMessage: 'Row height',
}),
'euiDisplaySelector.lineCountLabel': i18n.translate('core.euiDisplaySelector.lineCountLabel', {
defaultMessage: 'Lines per row',
}),
'euiFieldPassword.showPassword': i18n.translate('core.euiFieldPassword.showPassword', {
defaultMessage:
'Show password as plain text. Note: this will visually expose your password on the screen.',
Expand Down Expand Up @@ -708,32 +755,13 @@ export const getEuiContextMapping = (): EuiTokensObject => {
defaultMessage: 'hide',
}
),
'euiPagination.nextPage': ({ page }: EuiValues) =>
i18n.translate('core.euiPagination.nextPage', {
defaultMessage: 'Next page, {page}',
values: { page },
}),
'euiPagination.pageOfTotalCompressed': ({ page, total }: EuiValues) => (
<FormattedMessage
id="core.euiPagination.pageOfTotalCompressed"
defaultMessage="{page} of {total}"
values={{ page, total }}
/>
),
'euiPagination.previousPage': ({ page }: EuiValues) =>
i18n.translate('core.euiPagination.previousPage', {
defaultMessage: 'Previous page, {page}',
values: { page },
}),
'euiPagination.disabledPreviousPage': i18n.translate(
'core.euiPagination.disabledPreviousPage',
{
defaultMessage: 'Previous page',
}
),
'euiPagination.disabledNextPage': i18n.translate('core.euiPagination.disabledNextPage', {
defaultMessage: 'Next page',
}),
'euiPagination.firstRangeAriaLabel': ({ lastPage }: EuiValues) =>
i18n.translate('core.euiPagination.firstRangeAriaLabel', {
defaultMessage: 'Skipping pages 2 to {lastPage}',
Expand All @@ -744,6 +772,21 @@ export const getEuiContextMapping = (): EuiTokensObject => {
defaultMessage: 'Skipping pages {firstPage} to {lastPage}',
values: { firstPage, lastPage },
}),
'euiPagination.last': i18n.translate('core.euiPagination.last', {
defaultMessage: 'Last',
}),
'euiPagination.page': i18n.translate('core.euiPagination.page', {
defaultMessage: 'Page',
}),
'euiPagination.of': i18n.translate('core.euiPagination.of', {
defaultMessage: 'of',
}),
'euiPagination.collection': i18n.translate('core.euiPagination.collection', {
defaultMessage: 'collection',
}),
'euiPagination.fromEndLabel': i18n.translate('core.euiPagination.fromEndLabel', {
defaultMessage: 'from end',
}),
'euiPaginationButton.longPageString': ({ page, totalPages }: EuiValues) =>
i18n.translate('core.euiPaginationButton.longPageString', {
defaultMessage: 'Page {page} of {totalPages}',
Expand All @@ -756,6 +799,24 @@ export const getEuiContextMapping = (): EuiTokensObject => {
values: { page },
description: 'Text to describe the current page of a paginated section',
}),
'euiPaginationButtonArrow.nextPage': i18n.translate('core.euiPaginationButtonArrow.nextPage', {
defaultMessage: 'Next page',
}),
'euiPaginationButtonArrow.previousPage': i18n.translate(
'core.euiPaginationButtonArrow.previousPage',
{
defaultMessage: 'Previous page',
}
),
'euiPaginationButtonArrow.firstPage': i18n.translate(
'core.euiPaginationButtonArrow.firstPage',
{
defaultMessage: 'First page',
}
),
'euiPaginationButtonArrow.lastPage': i18n.translate('core.euiPaginationButtonArrow.lastPage', {
defaultMessage: 'Last page',
}),
'euiPinnableListGroup.pinExtraActionLabel': i18n.translate(
'core.euiPinnableListGroup.pinExtraActionLabel',
{
Expand Down Expand Up @@ -811,20 +872,19 @@ export const getEuiContextMapping = (): EuiTokensObject => {
'euiRecentlyUsed.legend': i18n.translate('core.euiRecentlyUsed.legend', {
defaultMessage: 'Recently used date ranges',
}),
'euiRefreshInterval.fullDescription': ({ optionValue, optionText }: EuiValues) =>
i18n.translate('core.euiRefreshInterval.fullDescription', {
defaultMessage: 'Refresh interval currently set to {optionValue} {optionText}.',
values: { optionValue, optionText },
}),
'euiRefreshInterval.legend': i18n.translate('core.euiRefreshInterval.legend', {
defaultMessage: 'Refresh every',
}),
'euiRefreshInterval.start': i18n.translate('core.euiRefreshInterval.start', {
defaultMessage: 'Start',
}),
'euiRefreshInterval.stop': i18n.translate('core.euiRefreshInterval.stop', {
defaultMessage: 'Stop',
}),
'euiRefreshInterval.fullDescriptionOff': ({ optionValue, optionText }: EuiValues) =>
i18n.translate('core.euiRefreshInterval.fullDescriptionOff', {
defaultMessage: 'Refresh is off, interval set to {optionValue} {optionText}.',
values: { optionValue, optionText },
}),
'euiRefreshInterval.fullDescriptionOn': ({ optionValue, optionText }: EuiValues) =>
i18n.translate('core.euiRefreshInterval.fullDescriptionOn', {
defaultMessage: 'Refresh is on, interval set to {optionValue} {optionText}.',
values: { optionValue, optionText },
}),
'euiRelativeTab.fullDescription': ({ unit }: EuiValues) =>
i18n.translate('core.euiRelativeTab.fullDescription', {
defaultMessage: 'The unit is changeable. Currently set to {unit}.',
Expand Down Expand Up @@ -1028,28 +1088,6 @@ export const getEuiContextMapping = (): EuiTokensObject => {
defaultMessage: 'Step {number} is loading',
values: { number },
}),
'euiStyleSelector.buttonText': i18n.translate('core.euiStyleSelector.buttonText', {
defaultMessage: 'Density',
}),
'euiStyleSelector.buttonLegend': i18n.translate('core.euiStyleSelector.buttonLegend', {
defaultMessage: 'Select the display density for the data grid',
}),
'euiStyleSelector.labelExpanded': i18n.translate('core.euiStyleSelector.labelExpanded', {
defaultMessage: 'Expanded density',
}),
'euiStyleSelector.labelNormal': i18n.translate('core.euiStyleSelector.labelNormal', {
defaultMessage: 'Normal density',
}),
'euiStyleSelector.labelCompact': i18n.translate('core.euiStyleSelector.labelCompact', {
defaultMessage: 'Compact density',
}),
'euiSuperDatePicker.showDatesButtonLabel': i18n.translate(
'core.euiSuperDatePicker.showDatesButtonLabel',
{
defaultMessage: 'Show dates',
description: 'Displayed in a button that shows date picker',
}
),
'euiSuperSelect.screenReaderAnnouncement': i18n.translate(
'core.euiSuperSelect.screenReaderAnnouncement',
{
Expand Down
7 changes: 4 additions & 3 deletions src/core/public/theme/convert_core_theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@
* Side Public License, v 1.
*/

import type { EuiThemeSystem, EuiThemeColorMode } from '@elastic/eui';
import { COLOR_MODES_STANDARD } from '@elastic/eui';
import type { EuiThemeSystem, EuiThemeColorModeStandard } from '@elastic/eui';
import type { CoreTheme } from './types';

/** @internal */
export interface EuiTheme {
colorMode: EuiThemeColorMode;
colorMode: EuiThemeColorModeStandard;
euiThemeSystem?: EuiThemeSystem;
}

/** @internal */
export const convertCoreTheme = (coreTheme: CoreTheme): EuiTheme => {
const { darkMode } = coreTheme;
return {
colorMode: darkMode ? 'DARK' : 'LIGHT',
colorMode: darkMode ? COLOR_MODES_STANDARD.dark : COLOR_MODES_STANDARD.light,
Comment on lines 22 to +23
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thanks for that

};
};
3 changes: 2 additions & 1 deletion src/core/public/theme/core_theme_provider.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ import { act } from 'react-dom/test-utils';
import type { ReactWrapper } from 'enzyme';
import { of, BehaviorSubject } from 'rxjs';
import { useEuiTheme } from '@elastic/eui';
import type { UseEuiTheme } from '@elastic/eui';
import { mountWithIntl } from '@kbn/test/jest';
import { CoreThemeProvider } from './core_theme_provider';
import type { CoreTheme } from './types';

describe('CoreThemeProvider', () => {
let euiTheme: ReturnType<typeof useEuiTheme> | undefined;
let euiTheme: UseEuiTheme | undefined;

beforeEach(() => {
euiTheme = undefined;
Expand Down
Loading