Skip to content

Commit

Permalink
Small style fix + add tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
Heenawter committed Jul 5, 2024
1 parent bf391c3 commit 609a2f2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
border-radius: $euiBorderRadius !important;
}

&--label {
@include euiTextTruncate;
&--labelWrapper {
max-width: 40%;
background-color: transparent;
border-radius: $euiBorderRadius;

margin-left: 0 !important;
padding-left: 0 !important;

.controlPanel--label {
@include euiTextTruncate;
background-color: transparent;
border-radius: $euiBorderRadius;
margin-left: 0 !important;
padding-left: 0 !important;
}
}

&--hideComponent {
Expand Down
22 changes: 18 additions & 4 deletions examples/controls_example/public/react_controls/control_panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@
import classNames from 'classnames';
import React, { useState } from 'react';

import { EuiFlexItem, EuiFormControlLayout, EuiFormLabel, EuiFormRow, EuiIcon } from '@elastic/eui';
import {
EuiFlexGroup,
EuiFlexItem,
EuiFormControlLayout,
EuiFormLabel,
EuiFormRow,
EuiIcon,
EuiToolTip,
} from '@elastic/eui';
import { ViewMode } from '@kbn/embeddable-plugin/public';
import { i18n } from '@kbn/i18n';
import {
Expand Down Expand Up @@ -135,12 +143,18 @@ export const ControlPanel = <ApiType extends DefaultControlApi = DefaultControlA
controlTitle={panelTitle || defaultPanelTitle}
hideEmptyDragHandle={usingTwoLineLayout || Boolean(api?.CustomPrependComponent)}
/>

{api?.CustomPrependComponent ? (
<api.CustomPrependComponent />
) : usingTwoLineLayout ? null : (
<EuiFormLabel className="controlPanel--label">
{panelTitle || defaultPanelTitle}
</EuiFormLabel>
<EuiToolTip
anchorClassName="controlPanel--labelWrapper"
content={panelTitle || defaultPanelTitle}
>
<EuiFormLabel className="controlPanel--label">
{panelTitle || defaultPanelTitle}
</EuiFormLabel>
</EuiToolTip>
)}
</>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
}

.rangeSliderAnchor__fieldNumber {
min-width: auto !important;
font-weight: $euiFontWeightMedium;
height: calc($euiButtonHeight - 3px) !important;

Expand Down

0 comments on commit 609a2f2

Please sign in to comment.