diff --git a/packages/grafana-ui/src/components/Button/Button.tsx b/packages/grafana-ui/src/components/Button/Button.tsx index 3f8e1b6f6422..23b5dc9edef8 100644 --- a/packages/grafana-ui/src/components/Button/Button.tsx +++ b/packages/grafana-ui/src/components/Button/Button.tsx @@ -14,7 +14,7 @@ import { PopoverContent, Tooltip, TooltipPlacement } from '../Tooltip'; export type ButtonVariant = 'primary' | 'secondary' | 'destructive' | 'success'; export const allButtonVariants: ButtonVariant[] = ['primary', 'secondary', 'destructive']; -export type ButtonFill = 'solid' | 'outline' | 'text'; +export type ButtonFill = 'solid' | 'outline' | 'text' | 'ghost'; export const allButtonFills: ButtonFill[] = ['solid', 'outline', 'text']; type CommonProps = { @@ -319,6 +319,17 @@ function getButtonVariantStyles(theme: GrafanaTheme2, color: ThemeRichColor, fil }; } + if (fill === 'ghost') { + return { + background: '#5d5a5990', + color: color.text, + border: `1px solid ${borderColor}`, + transition: theme.transitions.create(['background-color', 'box-shadow', 'border-color', 'color'], { + duration: theme.transitions.duration.short, + }), + }; + } + return { background: color.main, color: color.contrastText, diff --git a/packages/grafana-ui/src/components/DateTimePickers/TimeRangePicker/TimeRangeContent.tsx b/packages/grafana-ui/src/components/DateTimePickers/TimeRangePicker/TimeRangeContent.tsx index 1f3f5e1eff7d..420ba63db7bd 100644 --- a/packages/grafana-ui/src/components/DateTimePickers/TimeRangePicker/TimeRangeContent.tsx +++ b/packages/grafana-ui/src/components/DateTimePickers/TimeRangePicker/TimeRangeContent.tsx @@ -58,7 +58,7 @@ export const TimeRangeContent = (props: Props) => { onApply: onApplyFromProps, isReversed, fiscalYearStartMonth, - onError, + // onError, weekStart, } = props; const [fromValue, toValue] = valueToState(value.raw.from, value.raw.to, timeZone); @@ -112,28 +112,28 @@ export const TimeRangeContent = (props: Props) => { } }; - const onCopy = () => { - const raw: RawTimeRange = { from: from.value, to: to.value }; - navigator.clipboard.writeText(JSON.stringify(raw)); - }; - - const onPaste = async () => { - const raw = await navigator.clipboard.readText(); - let range; - - try { - range = JSON.parse(raw); - } catch (error) { - if (onError) { - onError(raw); - } - return; - } - - const [fromValue, toValue] = valueToState(range.from, range.to, timeZone); - setFrom(fromValue); - setTo(toValue); - }; + // const onCopy = () => { + // const raw: RawTimeRange = { from: from.value, to: to.value }; + // navigator.clipboard.writeText(JSON.stringify(raw)); + // }; + + // const onPaste = async () => { + // const raw = await navigator.clipboard.readText(); + // let range; + + // try { + // range = JSON.parse(raw); + // } catch (error) { + // if (onError) { + // onError(raw); + // } + // return; + // } + + // const [fromValue, toValue] = valueToState(range.from, range.to, timeZone); + // setFrom(fromValue); + // setTo(toValue); + // }; const fiscalYear = rangeUtil.convertRawToRange({ from: 'now/fy', to: 'now/fy' }, timeZone, fiscalYearStartMonth); const fiscalYearMessage = t('time-picker.range-content.fiscal-year', 'Fiscal year'); @@ -197,7 +197,7 @@ export const TimeRangeContent = (props: Props) => {
-