Skip to content

Commit

Permalink
Chore (ui-shared-deps): Clean up direct usage of OUI theme JSON (open…
Browse files Browse the repository at this point in the history
…search-project#5662) (opensearch-project#5680)

* Chore (ui-shared-deps): Clean up direct usage of OUI theme JSON



* add changelog



---------


(cherry picked from commit a4ae399)

Signed-off-by: Josh Romero <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent edfc6ce commit 54aca34
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
5 changes: 3 additions & 2 deletions src/plugins/expressions/public/react_expression_renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -191,8 +191,9 @@ export const ReactExpressionRenderer = ({

const expressionStyles: React.CSSProperties = {};

// TODO: refactor to SCSS instead of getting values from theme: https:/opensearch-project/OpenSearch-Dashboards/issues/5661
if (padding) {
expressionStyles.padding = theme.paddingSizes[padding];
expressionStyles.padding = euiThemeVars.paddingSizes[padding];
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -148,7 +146,7 @@ export class CreateButton extends Component<Props, State> {

private renderBetaBadge = () => {
return (
<EuiBadge color={euiColorAccent}>
<EuiBadge color="accent">
<FormattedMessage
id="indexPatternManagement.indexPatternList.createButton.betaLabel"
defaultMessage="Beta"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export function createTheme(
};
}

// TODO: Refactor to use packages/osd-ui-shared-deps/theme.ts: https:/opensearch-project/OpenSearch-Dashboards/issues/5661
const DARK_THEME = createTheme(darkTheme, '#343551');
const LIGHT_THEME = createTheme(lightTheme, '#E3E4ED');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ import $ from 'jquery';

import { Binder } from '../../lib/binder';
import { positionTooltip } from './position_tooltip';
import theme from '@elastic/eui/dist/eui_theme_light.json';
import { euiThemeVars } from '@osd/ui-shared-deps/theme';

let allContents = [];

const tooltipColumnPadding = parseInt(theme.euiSizeXS || 0, 10) * 2;
const tooltipTableMargin = parseInt(theme.euiSizeS || 0, 10) * 2;
const tooltipMaxWidth = parseInt(theme.euiSizeXL || 0, 10) * 10;
const tooltipColumnPadding = parseInt(euiThemeVars.euiSizeXS || 0, 10) * 2;
const tooltipTableMargin = parseInt(euiThemeVars.euiSizeS || 0, 10) * 2;
const tooltipMaxWidth = parseInt(euiThemeVars.euiSizeXL || 0, 10) * 10;

/**
* Add tooltip and listeners to visualization elements
Expand Down

0 comments on commit 54aca34

Please sign in to comment.