From 0166825201c08da2eb018cfc397fc38802ab4f14 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 10 Jan 2024 19:26:07 +0000 Subject: [PATCH] Chore (ui-shared-deps): Clean up direct usage of OUI theme JSON (#5662) * Chore (ui-shared-deps): Clean up direct usage of OUI theme JSON Signed-off-by: Josh Romero * add changelog Signed-off-by: Josh Romero --------- Signed-off-by: Josh Romero (cherry picked from commit a4ae399138b2993c298fdc080f9dbf6c76619975) Signed-off-by: github-actions[bot] --- .../expressions/public/react_expression_renderer.tsx | 5 +++-- .../public/components/create_button/create_button.tsx | 4 +--- .../public/code_editor/editor_theme.ts | 1 + .../public/vislib/components/tooltip/tooltip.js | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/plugins/expressions/public/react_expression_renderer.tsx b/src/plugins/expressions/public/react_expression_renderer.tsx index 838fa703a750..dd2d1bdccc42 100644 --- a/src/plugins/expressions/public/react_expression_renderer.tsx +++ b/src/plugins/expressions/public/react_expression_renderer.tsx @@ -34,7 +34,7 @@ import { Observable, Subscription } from 'rxjs'; import { filter } from 'rxjs/operators'; import useShallowCompareEffect from 'react-use/lib/useShallowCompareEffect'; import { EuiLoadingChart, EuiProgress } from '@elastic/eui'; -import theme from '@elastic/eui/dist/eui_theme_light.json'; +import { euiThemeVars } from '@osd/ui-shared-deps/theme'; import { IExpressionLoaderParams, ExpressionRenderError } from './types'; import { ExpressionAstExpression, IInterpreterRenderHandlers } from '../common'; import { ExpressionLoader } from './loader'; @@ -191,8 +191,9 @@ export const ReactExpressionRenderer = ({ const expressionStyles: React.CSSProperties = {}; + // TODO: refactor to SCSS instead of getting values from theme: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/5661 if (padding) { - expressionStyles.padding = theme.paddingSizes[padding]; + expressionStyles.padding = euiThemeVars.paddingSizes[padding]; } return ( diff --git a/src/plugins/index_pattern_management/public/components/create_button/create_button.tsx b/src/plugins/index_pattern_management/public/components/create_button/create_button.tsx index af67a5e317ce..28ba3b7afca6 100644 --- a/src/plugins/index_pattern_management/public/components/create_button/create_button.tsx +++ b/src/plugins/index_pattern_management/public/components/create_button/create_button.tsx @@ -28,8 +28,6 @@ * under the License. */ -// @ts-ignore -import { euiColorAccent } from '@elastic/eui/dist/eui_theme_light.json'; import React, { Component, Fragment } from 'react'; import { @@ -148,7 +146,7 @@ export class CreateButton extends Component { private renderBetaBadge = () => { return ( - +