From 6b2602ca24d5493b1a5a5b35732133090fc1c62e Mon Sep 17 00:00:00 2001 From: Arturo Castillo Delgado Date: Tue, 29 Apr 2025 13:13:40 +0200 Subject: [PATCH 1/2] Update EUI to v102.0.0 --- package.json | 2 +- src/dev/license_checker/config.ts | 2 +- yarn.lock | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 2aa230ed9ac7f..4c5d5d368ab34 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "@elastic/ecs": "^8.11.5", "@elastic/elasticsearch": "^8.18.2", "@elastic/ems-client": "8.6.3", - "@elastic/eui": "101.4.0-amsterdam.0", + "@elastic/eui": "102.0.0-amsterdam.0", "@elastic/filesaver": "1.1.2", "@elastic/node-crypto": "^1.2.3", "@elastic/numeral": "^2.5.1", diff --git a/src/dev/license_checker/config.ts b/src/dev/license_checker/config.ts index e722810a95caa..519f095bc5503 100644 --- a/src/dev/license_checker/config.ts +++ b/src/dev/license_checker/config.ts @@ -88,7 +88,7 @@ export const LICENSE_OVERRIDES = { 'jsts@1.6.2': ['Eclipse Distribution License - v 1.0'], // cf. https://github.com/bjornharrtell/jsts '@mapbox/jsonlint-lines-primitives@2.0.2': ['MIT'], // license in readme https://github.com/tmcw/jsonlint '@elastic/ems-client@8.6.3': ['Elastic License 2.0'], - '@elastic/eui@101.4.0-amsterdam.0': ['Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0'], + '@elastic/eui@102.0.0-amsterdam.0': ['Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0'], 'language-subtag-registry@0.3.21': ['CC-BY-4.0'], // retired ODC‑By license https://github.com/mattcg/language-subtag-registry 'buffers@0.1.1': ['MIT'], // license in importing module https://www.npmjs.com/package/binary '@bufbuild/protobuf@1.2.1': ['Apache-2.0'], // license (Apache-2.0 AND BSD-3-Clause) diff --git a/yarn.lock b/yarn.lock index 8bab5e2f37c76..80cbeacfe1a06 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2157,21 +2157,21 @@ resolved "https://registry.yarnpkg.com/@elastic/eslint-plugin-eui/-/eslint-plugin-eui-0.0.2.tgz#56b9ef03984a05cc213772ae3713ea8ef47b0314" integrity sha512-IoxURM5zraoQ7C8f+mJb9HYSENiZGgRVcG4tLQxE61yHNNRDXtGDWTZh8N1KIHcsqN1CEPETjuzBXkJYF/fDiQ== -"@elastic/eui-theme-common@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@elastic/eui-theme-common/-/eui-theme-common-0.2.0.tgz#570a988f58c24076c6f867475e70930769f3cff5" - integrity sha512-g2n38Uk4G9UqQU/wim+ZKWusWtO1bdudvDy/7+sdCYaxtgbINT5hhMHoU9M49D+7FJSsPuHn7gVfdYKMN9bTdQ== +"@elastic/eui-theme-common@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@elastic/eui-theme-common/-/eui-theme-common-1.0.0.tgz#c5e7b7597c4ebe71fc533b18458415a14a93794d" + integrity sha512-9+P21npVm05OmFr0OPkA5DSdts9teOo/OEotbJFAVkqBLkNf+Eevv6q89B8eQ6r383RnVwTl7vBzb6M9PnULJg== dependencies: "@types/lodash" "^4.14.202" chroma-js "^2.4.2" lodash "^4.17.21" -"@elastic/eui@101.4.0-amsterdam.0": - version "101.4.0-amsterdam.0" - resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-101.4.0-amsterdam.0.tgz#27360ebeb71e86052f99f5e88814b197ae97558e" - integrity sha512-zhWSRQYFFk2lm6mycBnpX8SJOeNzKjYJ7XwTv9RFfRUR6MGe/GfUIjHGCAg52NDNUTcYPlLuPhJKcNtAMasEOQ== +"@elastic/eui@102.0.0-amsterdam.0": + version "102.0.0-amsterdam.0" + resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-102.0.0-amsterdam.0.tgz#9fc738d18a4b148e97ac1b4d7ddfb311314d1b97" + integrity sha512-C6ZS83SyQ83d5sSqaZYf+nrJeRIU5WPoAWAAr5UIqloJGBk1nuMNY8wH12PT9GiqdXFUdf6ezSsQvYCqHrWWWw== dependencies: - "@elastic/eui-theme-common" "0.2.0" + "@elastic/eui-theme-common" "1.0.0" "@elastic/prismjs-esql" "^1.1.0" "@hello-pangea/dnd" "^16.6.0" "@types/lodash" "^4.14.202" From e15b9cd6054b0d58ae1324c5bdcf9d047ef56adf Mon Sep 17 00:00:00 2001 From: Arturo Castillo Delgado Date: Tue, 29 Apr 2025 14:23:44 +0200 Subject: [PATCH 2/2] Update types affecting euiTheme.colors --- .../config_panel/layer_actions/layer_actions.tsx | 13 +++++++++++-- .../public/components/rca/rca_panel/index.tsx | 6 +++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/x-pack/platform/plugins/shared/lens/public/editor_frame_service/editor_frame/config_panel/layer_actions/layer_actions.tsx b/x-pack/platform/plugins/shared/lens/public/editor_frame_service/editor_frame/config_panel/layer_actions/layer_actions.tsx index 9140c90f67d60..be32824a30ad9 100644 --- a/x-pack/platform/plugins/shared/lens/public/editor_frame_service/editor_frame/config_panel/layer_actions/layer_actions.tsx +++ b/x-pack/platform/plugins/shared/lens/public/editor_frame_service/editor_frame/config_panel/layer_actions/layer_actions.tsx @@ -100,6 +100,15 @@ const InContextMenuActions = (props: LayerActionsProps) => { setPopover(false); } }, [isPopoverOpen]); + // `neutral` and `risk` variants belong to `severity` so they're not + // available in `euiTheme.colors` directly + const getColorFromTheme = useCallback( + (color: LayerAction['color']) => + color === 'risk' || color === 'neutral' + ? euiTheme.colors.severity[color] + : euiTheme.colors[color!], + [euiTheme] + ); return ( @@ -144,9 +153,9 @@ const InContextMenuActions = (props: LayerActionsProps) => { {...(i.color ? { css: css` - color: ${euiTheme.colors[i.color]}; + color: ${getColorFromTheme(i.color)}; &:hover { - text-decoration-color: ${euiTheme.colors[i.color]} !important; + text-decoration-color: ${getColorFromTheme(i.color)} !important; } `, size: 's', // need to be explicit here as css prop will disable the default small size diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_panel/index.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_panel/index.tsx index 173bf8a2c96a0..89e673d82590f 100644 --- a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_panel/index.tsx +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_panel/index.tsx @@ -20,6 +20,7 @@ export function RootCauseAnalysisPanel({ }) { const theme = useTheme(); + const isSeverityColor = color === 'risk' || color === 'neutral'; const panelClassName = color && color !== 'transparent' && @@ -28,7 +29,10 @@ export function RootCauseAnalysisPanel({ color !== 'highlighted' ? css` border: 1px solid; - border-color: ${rgba(theme.colors[color], 0.25)}; + border-color: ${rgba( + isSeverityColor ? theme.colors.severity[color] : theme.colors[color], + 0.25 + )}; ` : undefined;