From d10dbc70a16d3c3cd3774061f117c1762432a3dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 14 Jan 2021 15:07:19 +0100 Subject: [PATCH] Icons: Adds custom icon support ands new panel and interpolation icons (#30277) * Icons: Adds custom icon support ands new panel and interpolation icons * Removed icon files * updated snapshot * Updates --- packages/grafana-data/src/types/select.ts | 1 + .../Forms/RadioButtonGroup/RadioButton.tsx | 4 +- .../RadioButtonGroup.story.tsx | 72 +++++++++-------- .../RadioButtonGroup/RadioButtonGroup.tsx | 4 +- .../grafana-ui/src/components/Icon/Icon.tsx | 39 ++++++---- .../src/components/Icon/custom/index.tsx | 78 +++++++++++++++++++ .../grafana-ui/src/components/uPlot/config.ts | 8 +- packages/grafana-ui/src/types/icon.ts | 10 ++- .../sidemenu/TopSectionItem.test.tsx | 1 + .../components/sidemenu/TopSectionItem.tsx | 6 +- .../TopSectionItem.test.tsx.snap | 26 ++++++- .../timeseries/img/icn-timeseries-panel.svg | 1 + .../app/plugins/panel/timeseries/plugin.json | 4 +- .../plugins/panel/xychart/img/icn-xychart.svg | 2 +- 14 files changed, 188 insertions(+), 68 deletions(-) create mode 100644 packages/grafana-ui/src/components/Icon/custom/index.tsx create mode 100644 public/app/plugins/panel/timeseries/img/icn-timeseries-panel.svg diff --git a/packages/grafana-data/src/types/select.ts b/packages/grafana-data/src/types/select.ts index d807a1a033b..db659062543 100644 --- a/packages/grafana-data/src/types/select.ts +++ b/packages/grafana-data/src/types/select.ts @@ -5,6 +5,7 @@ export interface SelectableValue { label?: string; value?: T; imgUrl?: string; + icon?: string; description?: string; [key: string]: any; } diff --git a/packages/grafana-ui/src/components/Forms/RadioButtonGroup/RadioButton.tsx b/packages/grafana-ui/src/components/Forms/RadioButtonGroup/RadioButton.tsx index 624e93e20e6..cdc17f07661 100644 --- a/packages/grafana-ui/src/components/Forms/RadioButtonGroup/RadioButton.tsx +++ b/packages/grafana-ui/src/components/Forms/RadioButtonGroup/RadioButton.tsx @@ -11,6 +11,7 @@ export interface RadioButtonProps { size?: RadioButtonSize; disabled?: boolean; name?: string; + description?: string; active: boolean; id: string; onChange: () => void; @@ -101,6 +102,7 @@ export const RadioButton: React.FC = ({ onChange, id, name = undefined, + description, fullWidth, }) => { const theme = useTheme(); @@ -117,7 +119,7 @@ export const RadioButton: React.FC = ({ checked={active} name={name} /> -