From 98f6182963252ce27e008c447f81a6ef8c8ab34d Mon Sep 17 00:00:00 2001 From: Josh Romero Date: Thu, 4 Jan 2024 02:44:40 +0000 Subject: [PATCH 1/2] Chore (ui-shared-deps): Clean up direct usage of OUI theme JSON Signed-off-by: Josh Romero --- .../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 ( - + Date: Fri, 5 Jan 2024 18:42:51 +0000 Subject: [PATCH 2/2] add changelog Signed-off-by: Josh Romero --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31d65e5cf6bd..bcff78a1767a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -74,6 +74,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - [Console] Remove unused ul element and its custom styling ([#3993](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3993)) - Remove unused Sass in `tile_map` plugin ([#4110](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4110)) - [Home] Remove unused tutorials ([#5212](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5212)) +- [UiSharedDeps] Standardize theme JSON imports to be light/dark-mode aware ([#5662](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5662)) ### 🔩 Tests @@ -954,4 +955,4 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### 🔩 Tests -- Update caniuse to fix failed integration tests ([#2322](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2322)) \ No newline at end of file +- Update caniuse to fix failed integration tests ([#2322](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2322))