diff --git a/package.json b/package.json index 905783b10e3d5..581d8ab605ec3 100644 --- a/package.json +++ b/package.json @@ -275,6 +275,7 @@ "@lezer/lr": "1.2.3", "@lingui/core": "3.14.0", "@lingui/react": "3.14.0", + "@mui/icons-material": "^5.11.11", "@mui/material": "^5.10.9", "@mui/styled-engine": "^5.10.8", "@opentelemetry/api": "1.2.0", diff --git a/public/app/features/dashboard/components/SubMenu/SubMenu.tsx b/public/app/features/dashboard/components/SubMenu/SubMenu.tsx index 28f611ae6179d..c275ecc63f69d 100644 --- a/public/app/features/dashboard/components/SubMenu/SubMenu.tsx +++ b/public/app/features/dashboard/components/SubMenu/SubMenu.tsx @@ -1,5 +1,7 @@ import { css } from '@emotion/css'; -import React, { PureComponent } from 'react'; +import FilterListIcon from '@mui/icons-material/FilterList'; +import { Box, styled } from '@mui/material'; +import React, { FC, PureComponent } from 'react'; import { connect, MapStateToProps } from 'react-redux'; import { AnnotationQuery, DataQuery } from '@grafana/data'; @@ -56,6 +58,7 @@ class SubMenuUnConnected extends PureComponent { return (
+ ( + + + FILTERS + +); + +const FilterWithIconStyled = styled(Box)({ + display: 'flex', + gap: 1, + alignItems: 'center', + color: '#3A785E', + fontWeight: 600, + lineHeight: '160%', + fontSize: 12, +}); diff --git a/public/app/features/variables/pickers/PickerRenderer.tsx b/public/app/features/variables/pickers/PickerRenderer.tsx index aab6d242d839a..2b33434da3b06 100644 --- a/public/app/features/variables/pickers/PickerRenderer.tsx +++ b/public/app/features/variables/pickers/PickerRenderer.tsx @@ -1,8 +1,10 @@ +import { css } from '@emotion/css'; import React, { CSSProperties, FunctionComponent, PropsWithChildren, ReactElement, useMemo } from 'react'; +// eslint-disable-next-line no-restricted-imports import { useSelector } from 'react-redux'; import { selectors } from '@grafana/e2e-selectors'; -import { Tooltip, useTheme2 } from '@grafana/ui'; +import { Tooltip } from '@grafana/ui'; import { FnGlobalState } from 'app/core/reducers/fn-slice'; import type { StoreState } from 'app/types'; @@ -14,6 +16,18 @@ interface Props { readOnly?: boolean; } +const renderWrapperStyle = css` + & button, + & span, + & label, + & input { + height: 24px; + font-size: 12px; + line-height: 24px; + align-self: center; + } +`; + export const PickerRenderer: FunctionComponent = (props) => { const PickerToRender = useMemo(() => variableAdapters.get(props.variable.type).picker, [props.variable]); @@ -25,28 +39,45 @@ export const PickerRenderer: FunctionComponent = (props) => {
{props.variable.hide !== VariableHide.hideVariable && PickerToRender && ( - +
+ +
)}
); }; const COMMON_PICKER_LABEL_STYLE: CSSProperties = { - borderRadius: '4px', + borderRadius: '2px', border: 'none', - fontWeight: 600, + fontWeight: 400, fontSize: '12px', + padding: '3px 6px', + letterSpacing: '0.15px', + height: '24px', }; function PickerLabel({ variable }: PropsWithChildren): ReactElement | null { const labelOrName = useMemo(() => variable.label || variable.name, [variable]); - const { FNDashboard } = useSelector(({ fnGlobalState }) => fnGlobalState); - const theme = useTheme2(); + const { FNDashboard, mode } = useSelector(({ fnGlobalState }) => fnGlobalState); + + const fnLabelStyle = useMemo( + () => ({ + ...COMMON_PICKER_LABEL_STYLE, + ...(FNDashboard + ? { + color: mode === 'light' ? '#2D333E' : '#DBD9D7', + backgroundColor: mode === 'light' ? '#E0E0E0' : '#56524D', + } + : {}), + }), + [mode, FNDashboard] + ); if (variable.hide !== VariableHide.dontHide) { return null; } - const fnLabelOrName = FNDashboard ? labelOrName.replace('druid', '') : labelOrName; + const fnLabelOrName = FNDashboard ? labelOrName.replace('druid_adhoc_filters', 'ad-hoc') : labelOrName; const elementId = `var-${variable.id}`; if (variable.description) { @@ -54,7 +85,7 @@ function PickerLabel({ variable }: PropsWithChildren): ReactElement | nul