From 54aca34d04c9a7d88722be1b25e9ab304c4c6d53 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 30 Jan 2024 19:46:54 -0800 Subject: [PATCH] Chore (ui-shared-deps): Clean up direct usage of OUI theme JSON (#5662) (#5680) * Chore (ui-shared-deps): Clean up direct usage of OUI theme JSON * add changelog --------- (cherry picked from commit a4ae399138b2993c298fdc080f9dbf6c76619975) Signed-off-by: Josh Romero Signed-off-by: github-actions[bot] Co-authored-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 ( - +