diff --git a/packages/grafana-ui/src/components/TimePicker/TimePicker.tsx b/packages/grafana-ui/src/components/TimePicker/TimePicker.tsx index 4ede24dbc49..e9660e07356 100644 --- a/packages/grafana-ui/src/components/TimePicker/TimePicker.tsx +++ b/packages/grafana-ui/src/components/TimePicker/TimePicker.tsx @@ -1,7 +1,6 @@ // Libraries import React, { PureComponent, createRef } from 'react'; import { css } from 'emotion'; -import memoizeOne from 'memoize-one'; import classNames from 'classnames'; // Components @@ -11,17 +10,16 @@ import { TimePickerPopover } from './TimePickerPopover'; import { ClickOutsideWrapper } from '../ClickOutsideWrapper/ClickOutsideWrapper'; // Utils & Services -import { isDateTime, DateTime } from '@grafana/data'; -import { rangeUtil } from '@grafana/data'; +import { isDateTime, DateTime, rangeUtil } from '@grafana/data'; import { rawToTimeRange } from './time'; +import { stylesFactory } from '../../themes/stylesFactory'; import { withTheme } from '../../themes/ThemeContext'; // Types -import { TimeRange, TimeOption, TimeZone, TIME_FORMAT, SelectableValue, dateMath } from '@grafana/data'; -import { GrafanaTheme } from '@grafana/data'; +import { TimeRange, TimeOption, TimeZone, TIME_FORMAT, SelectableValue, dateMath, GrafanaTheme } from '@grafana/data'; import { Themeable } from '../../types'; -const getStyles = memoizeOne((theme: GrafanaTheme) => { +const getStyles = stylesFactory((theme: GrafanaTheme) => { return { timePickerSynced: css` label: timePickerSynced; @@ -198,6 +196,7 @@ class UnThemedTimePicker extends PureComponent { )} { options={options} maxMenuHeight={600} onChange={this.onSelectChanged} - iconClass={'fa fa-clock-o fa-fw'} + iconClass={classNames('fa fa-clock-o fa-fw', isSynced && timeSyncButton && 'icon-brand-gradient')} tooltipContent={} /> diff --git a/packages/grafana-ui/src/themes/_variables.dark.scss.tmpl.ts b/packages/grafana-ui/src/themes/_variables.dark.scss.tmpl.ts index 6c5b5e04c2a..bc7eb1fa0ea 100644 --- a/packages/grafana-ui/src/themes/_variables.dark.scss.tmpl.ts +++ b/packages/grafana-ui/src/themes/_variables.dark.scss.tmpl.ts @@ -187,6 +187,8 @@ $btn-drag-image: '../img/grab_dark.svg'; $navbar-btn-gicon-brightness: brightness(0.5); +$btn-active-box-shadow: 0px 0px 4px rgba(255,120,10,0.5); + // Forms // ------------------------- $input-bg: $input-black; diff --git a/packages/grafana-ui/src/themes/_variables.light.scss.tmpl.ts b/packages/grafana-ui/src/themes/_variables.light.scss.tmpl.ts index 353e5da3c54..ce90786ae19 100644 --- a/packages/grafana-ui/src/themes/_variables.light.scss.tmpl.ts +++ b/packages/grafana-ui/src/themes/_variables.light.scss.tmpl.ts @@ -180,6 +180,8 @@ $btn-drag-image: '../img/grab_light.svg'; $navbar-btn-gicon-brightness: brightness(1.5); +$btn-active-box-shadow: 0px 0px 4px rgba(234, 161, 51, 0.6); + // Forms // ------------------------- $input-bg: $white; diff --git a/public/app/features/explore/ExploreToolbar.tsx b/public/app/features/explore/ExploreToolbar.tsx index ccab0f915e2..d1891f0e0f0 100644 --- a/public/app/features/explore/ExploreToolbar.tsx +++ b/public/app/features/explore/ExploreToolbar.tsx @@ -278,15 +278,16 @@ export class UnConnectedExploreToolbar extends PureComponent { )} -
- -
+ {!isLive && ( +
+ +
+ )}
{ +//Components +import { ResponsiveButton } from './ResponsiveButton'; + +const getStyles = stylesFactory((theme: GrafanaTheme) => { + const bgColor = selectThemeVariant({ light: theme.colors.gray5, dark: theme.colors.dark1 }, theme.type); const orangeLighter = tinycolor(theme.colors.orangeDark) .lighten(10) .toString(); const pulseTextColor = tinycolor(theme.colors.orangeDark) .desaturate(90) .toString(); - return { noRightBorderStyle: css` label: noRightBorderStyle; @@ -33,9 +33,13 @@ const getStyles = memoizeOne((theme: GrafanaTheme) => { color: ${theme.colors.orangeDark}; background: transparent; &:focus { + background: transparent; border-color: ${theme.colors.orangeDark}; color: ${theme.colors.orangeDark}; } + &:hover { + background-color: ${bgColor}; + } &:active, &:hover { border-color: ${orangeLighter}; @@ -48,8 +52,12 @@ const getStyles = memoizeOne((theme: GrafanaTheme) => { background: transparent; animation: pulse 3s ease-out 0s infinite normal forwards; &:focus { + background: transparent; border-color: ${theme.colors.orangeDark}; } + &:hover { + background-color: ${bgColor}; + } &:active, &:hover { border-color: ${orangeLighter}; @@ -119,11 +127,15 @@ export function LiveTailButton(props: LiveTailButtonProps) { @@ -141,8 +153,11 @@ export function LiveTailButton(props: LiveTailButtonProps) { }} >
-
diff --git a/public/app/features/explore/TimeSyncButton.tsx b/public/app/features/explore/TimeSyncButton.tsx index 6331e0715fd..93e0a07fdad 100644 --- a/public/app/features/explore/TimeSyncButton.tsx +++ b/public/app/features/explore/TimeSyncButton.tsx @@ -47,12 +47,12 @@ export function TimeSyncButton(props: TimeSyncButtonProps) { ); diff --git a/public/app/features/explore/__snapshots__/TimeSyncButton.test.tsx.snap b/public/app/features/explore/__snapshots__/TimeSyncButton.test.tsx.snap index 21a407c9d46..a569d62af9e 100644 --- a/public/app/features/explore/__snapshots__/TimeSyncButton.test.tsx.snap +++ b/public/app/features/explore/__snapshots__/TimeSyncButton.test.tsx.snap @@ -15,13 +15,13 @@ exports[`TimeSyncButton should render component 1`] = ` > diff --git a/public/sass/_variables.dark.generated.scss b/public/sass/_variables.dark.generated.scss index 137bb5ebf6a..ad8e6fd5664 100644 --- a/public/sass/_variables.dark.generated.scss +++ b/public/sass/_variables.dark.generated.scss @@ -190,6 +190,8 @@ $btn-drag-image: '../img/grab_dark.svg'; $navbar-btn-gicon-brightness: brightness(0.5); +$btn-active-box-shadow: 0px 0px 4px rgba(255, 120, 10, 0.5); + // Forms // ------------------------- $input-bg: $input-black; diff --git a/public/sass/_variables.light.generated.scss b/public/sass/_variables.light.generated.scss index 6064c5685ff..7ddc54564cd 100644 --- a/public/sass/_variables.light.generated.scss +++ b/public/sass/_variables.light.generated.scss @@ -183,6 +183,8 @@ $btn-drag-image: '../img/grab_light.svg'; $navbar-btn-gicon-brightness: brightness(1.5); +$btn-active-box-shadow: 0px 0px 4px rgba(234, 161, 51, 0.6); + // Forms // ------------------------- $input-bg: $white; diff --git a/public/sass/pages/_explore.scss b/public/sass/pages/_explore.scss index 3d57514f2b2..36d7af6359a 100644 --- a/public/sass/pages/_explore.scss +++ b/public/sass/pages/_explore.scss @@ -6,6 +6,14 @@ } } +.icon-brand-gradient { + text-shadow: none; + background: linear-gradient(180deg, #f05a28 30%, #fbca0a 100%); + background-clip: text; + -webkit-text-fill-color: transparent; + -moz-text-fill-color: transparent; +} + .icon-margin-left { margin-left: 0.25em; @@ -14,6 +22,9 @@ } } +.explore-active-button-glow { + box-shadow: $btn-active-box-shadow; +} .explore-ds-picker { min-width: 200px; max-width: 300px;