+
{
)}
- {this.props.panel.collapsed === true && (
+ {collapsed === true && (
/* disabling the a11y rules here as the button handles keyboard interactions */
/* this is just to provide a better experience for mouse users */
/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
-
+
)}
- {canEdit &&
}
+ {canEdit && (
+
+ )}
);
}
}
+
+export const DashboardRow = withTheme2(UnthemedDashboardRow);
+
+const getStyles = (theme: GrafanaTheme2) => {
+ const actions = css({
+ color: theme.colors.text.secondary,
+ opacity: 0,
+ [theme.transitions.handleMotion('no-preference', 'reduce')]: {
+ transition: '200ms opacity ease-in 200ms',
+ },
+
+ button: {
+ color: theme.colors.text.secondary,
+ paddingLeft: theme.spacing(2),
+ background: 'transparent',
+ border: 'none',
+
+ '&:hover': {
+ color: theme.colors.text.maxContrast,
+ },
+ },
+ });
+
+ return {
+ dashboardRow: css({
+ display: 'flex',
+ alignItems: 'center',
+ height: '100%',
+
+ '&:hover, &:focus-within': {
+ [`.${actions}`]: {
+ opacity: 1,
+ },
+ },
+ }),
+ dashboardRowCollapsed: css({
+ background: theme.components.panel.background,
+ }),
+ toggleTargetCollapsed: css({
+ flex: 1,
+ cursor: 'pointer',
+ marginRight: '15px',
+ }),
+ title: css({
+ flexGrow: 0,
+ fontSize: theme.typography.h5.fontSize,
+ fontWeight: theme.typography.fontWeightMedium,
+ color: theme.colors.text.primary,
+ background: 'transparent',
+ border: 'none',
+
+ '.fa': {
+ color: theme.colors.text.secondary,
+ fontSize: theme.typography.size.xs,
+ padding: theme.spacing(0, 1),
+ },
+ }),
+ actions,
+ count: css({
+ paddingLeft: theme.spacing(2),
+ color: theme.colors.text.secondary,
+ fontStyle: 'italic',
+ fontSize: theme.typography.size.sm,
+ fontWeight: 'normal',
+ display: 'none',
+ }),
+ countCollapsed: css({
+ display: 'inline-block',
+ }),
+ dragHandle: css({
+ cursor: 'move',
+ width: '16px',
+ height: '100%',
+ background: 'url("public/img/grab_dark.svg") no-repeat 50% 50%',
+ backgroundSize: '8px',
+ visibility: 'hidden',
+ position: 'absolute',
+ top: 0,
+ right: 0,
+ }),
+ dragHandleCollapsed: css({
+ visibility: 'visible',
+ opacity: 1,
+ }),
+ };
+};
diff --git a/public/sass/_grafana.scss b/public/sass/_grafana.scss
index 820c531beba..8d7228cf46f 100644
--- a/public/sass/_grafana.scss
+++ b/public/sass/_grafana.scss
@@ -39,7 +39,6 @@
@import 'components/query_editor';
@import 'components/tabbed_view';
@import 'components/query_part';
-@import 'components/row';
@import 'components/json_explorer';
@import 'components/dashboard_grid';
@import 'components/add_data_source';
diff --git a/public/sass/components/_row.scss b/public/sass/components/_row.scss
deleted file mode 100644
index b955988c7e9..00000000000
--- a/public/sass/components/_row.scss
+++ /dev/null
@@ -1,85 +0,0 @@
-.dashboard-row {
- display: flex;
- align-items: center;
-
- height: 100%;
-
- &--collapsed {
- background: $panel-bg;
-
- .dashboard-row__panel_count {
- display: inline-block;
- }
-
- .dashboard-row__drag {
- visibility: visible;
- opacity: 1;
- }
-
- .dashboard-row__toggle-target {
- flex: 1;
- cursor: pointer;
- margin-right: 15px;
- }
- }
-
- &:hover,
- &:focus-within {
- .dashboard-row__actions {
- opacity: 1;
- }
- }
-}
-
-.dashboard-row__title {
- flex-grow: 0;
- font-size: $font-size-h5;
- font-weight: $font-weight-semi-bold;
- color: $text-color;
- background: transparent;
- border: none;
-
- .fa {
- color: $text-muted;
- font-size: $font-size-xs;
- padding: 0 $space-sm;
- }
-}
-
-.dashboard-row__actions {
- color: $text-muted;
- opacity: 0;
- transition: 200ms opacity ease-in 200ms;
-
- button {
- color: $text-color-weak;
- padding-left: $spacer;
- background: transparent;
- border: none;
-
- &:hover {
- color: $link-hover-color;
- }
- }
-}
-
-.dashboard-row__panel_count {
- padding-left: $spacer;
- color: $text-color-weak;
- font-style: italic;
- font-size: $font-size-sm;
- font-weight: normal;
- display: none;
-}
-
-.dashboard-row__drag {
- cursor: move;
- width: 16px;
- height: 100%;
- background: url('../img/grab_dark.svg') no-repeat 50% 50%;
- background-size: 8px;
- visibility: hidden;
- position: absolute;
- top: 0;
- right: 0;
-}