Commit 69bdcccd by Torkel Ödegaard Committed by GitHub

NewPanelEdit: Minor style tweaks & fix to transparent panels (#23353)

* NewPanelEdit: Minor style tweaks

* Fixed ts issue

* Tweaked breakpoint
parent 7ab11027
...@@ -172,7 +172,7 @@ export const TabsBarContent: React.FC<{ ...@@ -172,7 +172,7 @@ export const TabsBarContent: React.FC<{
return ( return (
<> <>
{width < 377 ? ( {width < 352 ? (
<div className="flex-grow-1"> <div className="flex-grow-1">
<Select <Select
options={tabSelections} options={tabSelections}
......
...@@ -7,6 +7,7 @@ import { StoreState } from 'app/types'; ...@@ -7,6 +7,7 @@ import { StoreState } from 'app/types';
import { PanelModel } from '../../state/PanelModel'; import { PanelModel } from '../../state/PanelModel';
import { connect, MapStateToProps, MapDispatchToProps } from 'react-redux'; import { connect, MapStateToProps, MapDispatchToProps } from 'react-redux';
import { VizTypePicker } from '../../panel_editor/VizTypePicker'; import { VizTypePicker } from '../../panel_editor/VizTypePicker';
import { Field } from '@grafana/ui/src/components/Forms/Field';
interface OwnProps { interface OwnProps {
panel: PanelModel; panel: PanelModel;
...@@ -45,6 +46,7 @@ export const VisualizationTabUnconnected: FC<Props> = ({ panel, plugin, changePa ...@@ -45,6 +46,7 @@ export const VisualizationTabUnconnected: FC<Props> = ({ panel, plugin, changePa
return ( return (
<div className={styles.wrapper}> <div className={styles.wrapper}>
<div className={styles.search}> <div className={styles.search}>
<Field label="Filters">
<Input <Input
value={searchQuery} value={searchQuery}
onChange={e => setSearchQuery(e.currentTarget.value)} onChange={e => setSearchQuery(e.currentTarget.value)}
...@@ -53,6 +55,7 @@ export const VisualizationTabUnconnected: FC<Props> = ({ panel, plugin, changePa ...@@ -53,6 +55,7 @@ export const VisualizationTabUnconnected: FC<Props> = ({ panel, plugin, changePa
placeholder="Filter visualisations" placeholder="Filter visualisations"
autoFocus autoFocus
/> />
</Field>
</div> </div>
<div className={styles.visList}> <div className={styles.visList}>
<CustomScrollbar> <CustomScrollbar>
...@@ -78,12 +81,11 @@ const getStyles = stylesFactory((theme: GrafanaTheme) => { ...@@ -78,12 +81,11 @@ const getStyles = stylesFactory((theme: GrafanaTheme) => {
flex-direction: column; flex-direction: column;
flex-grow: 1; flex-grow: 1;
max-height: 100%; max-height: 100%;
padding: ${theme.spacing.md};
`, `,
search: css` search: css`
padding: ${theme.spacing.sm} ${theme.spacing.md};
flex-grow: 0; flex-grow: 0;
flex-shrink: 1; flex-shrink: 1;
margin-bottom: ${theme.spacing.sm};
`, `,
searchClear: css` searchClear: css`
color: ${theme.colors.gray60}; color: ${theme.colors.gray60};
...@@ -93,7 +95,6 @@ const getStyles = stylesFactory((theme: GrafanaTheme) => { ...@@ -93,7 +95,6 @@ const getStyles = stylesFactory((theme: GrafanaTheme) => {
flex-grow: 1; flex-grow: 1;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
padding-left: ${theme.spacing.md};
`, `,
}; };
}); });
......
...@@ -68,7 +68,8 @@ export const VizTypePicker: React.FC<Props> = ({ searchQuery, onTypeChange, curr ...@@ -68,7 +68,8 @@ export const VizTypePicker: React.FC<Props> = ({ searchQuery, onTypeChange, curr
const getStyles = stylesFactory((theme: GrafanaTheme) => { const getStyles = stylesFactory((theme: GrafanaTheme) => {
return { return {
wrapper: css` wrapper: css`
padding-right: ${theme.spacing.md}; // this needed here to make the box shadow not be clicked by the parent scroll container
padding-top: ${theme.spacing.md};
`, `,
grid: css` grid: css`
max-width: 100%; max-width: 100%;
......
...@@ -2,7 +2,6 @@ import React from 'react'; ...@@ -2,7 +2,6 @@ import React from 'react';
import { GrafanaTheme, PanelPluginMeta } from '@grafana/data'; import { GrafanaTheme, PanelPluginMeta } from '@grafana/data';
import { stylesFactory, useTheme } from '@grafana/ui'; import { stylesFactory, useTheme } from '@grafana/ui';
import { css, cx } from 'emotion'; import { css, cx } from 'emotion';
import tinycolor from 'tinycolor2';
interface Props { interface Props {
isCurrent: boolean; isCurrent: boolean;
...@@ -29,10 +28,11 @@ const VizTypePickerPlugin: React.FC<Props> = ({ isCurrent, plugin, onClick, disa ...@@ -29,10 +28,11 @@ const VizTypePickerPlugin: React.FC<Props> = ({ isCurrent, plugin, onClick, disa
}; };
const getStyles = stylesFactory((theme: GrafanaTheme) => { const getStyles = stylesFactory((theme: GrafanaTheme) => {
const itemBorder = `1px solid ${theme.isLight ? theme.colors.gray3 : theme.colors.dark10}`; const itemBorder = `1px solid ${theme.isLight ? theme.colors.gray85 : theme.colors.gray25}`;
return { return {
item: css` item: css`
background: ${theme.isLight ? theme.colors.white : theme.colors.gray05}; background: ${theme.isLight ? theme.colors.gray98 : theme.colors.gray15};
border: ${itemBorder}; border: ${itemBorder};
border-radius: 3px; border-radius: 3px;
height: 100px; height: 100px;
...@@ -44,27 +44,18 @@ const getStyles = stylesFactory((theme: GrafanaTheme) => { ...@@ -44,27 +44,18 @@ const getStyles = stylesFactory((theme: GrafanaTheme) => {
cursor: pointer; cursor: pointer;
display: flex; display: flex;
margin-right: 10px; margin-right: 10px;
margin-bottom: 10px;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding-bottom: 6px; padding-bottom: 6px;
transition: transform 1 ease;
&:hover { &:hover {
box-shadow: 0 0 4px ${theme.colors.blueLight}; box-shadow: 0 0 4px ${theme.colors.blueLight};
background: ${theme.isLight
? tinycolor(theme.colors.blueBase)
.lighten(45)
.toHexString()
: tinycolor(theme.colors.blueBase)
.darken(46)
.toHexString()};
border: 1px solid ${theme.colors.blueLight}; border: 1px solid ${theme.colors.blueLight};
} }
`, `,
current: css` current: css`
box-shadow: 0 0 6px ${theme.colors.orange} !important; box-shadow: 0 0 6px ${theme.colors.orange} !important;
border: 1px solid ${theme.colors.orange} !important; border: 1px solid ${theme.colors.orange} !important;
background: ${theme.isLight ? theme.colors.white : theme.colors.gray05};
`, `,
disabled: css` disabled: css`
opacity: 0.2; opacity: 0.2;
......
...@@ -95,6 +95,7 @@ export class StatPanel extends PureComponent<PanelProps<StatPanelOptions>> { ...@@ -95,6 +95,7 @@ export class StatPanel extends PureComponent<PanelProps<StatPanelOptions>> {
width={width} width={width}
height={height} height={height}
source={data} source={data}
itemSpacing={3}
renderCounter={renderCounter} renderCounter={renderCounter}
autoGrid={true} autoGrid={true}
orientation={options.orientation} orientation={options.orientation}
......
...@@ -52,8 +52,8 @@ div.flot-text { ...@@ -52,8 +52,8 @@ div.flot-text {
width: 100%; width: 100%;
&--transparent { &--transparent {
background-color: $page-bg; background-color: transparent;
border: none; border: 1px solid transparent;
} }
&:hover { &:hover {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment