Skip to content

Commit

Permalink
[Dashboard] Compressed Styles for Controls (elastic#190636)
Browse files Browse the repository at this point in the history
## Summary

Closes elastic#190355

This builds off @ryankeairns work in
elastic#189839 to have the compressed
styles for controls

Applied to new controls in example apps: 

![Screenshot 2024-08-27 at 1 45
45 PM](https://github.com/user-attachments/assets/748204e2-66c3-4638-bce8-3cad34337848)


Applied to existing dashboard controls:

![Screenshot 2024-08-27 at 1 35
25 PM](https://github.com/user-attachments/assets/af1796ef-2fa9-4760-bcc2-18a4d69dcdcb)
  • Loading branch information
rshen91 authored Sep 3, 2024
1 parent 84c6815 commit 03bb0b2
Show file tree
Hide file tree
Showing 16 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export const ControlFrame = ({
'controlFrameFormControlLayout--twoLine': controlStyle === 'twoLine',
})}
fullWidth
compressed
prepend={
<>
{(embeddable && customPrepend) ?? null}
Expand Down
3 changes: 1 addition & 2 deletions src/plugins/controls/public/control_group/control_group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ $controlMinWidth: $euiSize * 14;
.controlsWrapper {
display: flex;
align-items: center;
min-height: $euiSize * 4;

.controlGroup--endButtonGroup {
align-self: end;
Expand Down Expand Up @@ -47,7 +46,7 @@ $controlMinWidth: $euiSize * 14;

.controlFrame__draggable {
cursor: grabbing;
height: $euiButtonHeight;
height: $euiButtonHeightSmall;
align-items: center;
border-radius: $euiBorderRadius;
font-weight: $euiFontWeightSemiBold;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}

.optionsList--filterBtn {
height: $euiButtonHeight;
height: $euiButtonHeightSmall;

&.optionsList--filterBtnPlaceholder {
color: $euiTextSubduedColor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ export const OptionsListControl = ({
className={classNames('optionsList--filterGroup', {
'optionsList--filterGroupSingle': controlStyle !== 'twoLine',
})}
compressed
>
<EuiInputPopover
id={popoverId}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ export const RangeSliderControl: FC = () => {
id={id}
fullWidth
showTicks
compressed
step={step}
ticks={ticks}
levels={levels}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.controlPanel {
width: 100%;
max-inline-size: 100% !important;
height: $euiButtonHeight;
height: $euiButtonHeightSmall;
box-shadow: none !important;
background-color: $euiFormBackgroundColor !important;
border-radius: 0 $euiBorderRadius $euiBorderRadius 0 !important;
Expand All @@ -11,11 +11,12 @@
}

&--labelWrapper {
height: 100%;
height: $euiFormControlCompressedHeight;

.controlPanel--label {
@include euiTextTruncate;
padding: 0;
height: $euiButtonHeightSmall;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,12 @@ export const ControlPanel = <ApiType extends DefaultControlApi = DefaultControlA
data-test-subj="control-frame-title"
fullWidth
label={usingTwoLineLayout ? panelTitle || defaultPanelTitle || '...' : undefined}
display="rowCompressed"
>
<EuiFormControlLayout
fullWidth
isLoading={Boolean(dataLoading)}
compressed
className="controlFrame__formControlLayout"
prepend={
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export const OptionsListControl = ({
);

return (
<EuiFilterGroup fullWidth className={controlPanelClassName}>
<EuiFilterGroup fullWidth compressed className={controlPanelClassName}>
<EuiInputPopover
id={popoverId}
ownFocus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ export const RangeSliderControl: FC<Props> = ({
min={displayedMin}
max={displayedMax}
isLoading={isLoading}
compressed
inputPopoverProps={{
className: controlPanelClassName,
panelMinWidth: MIN_POPOVER_WIDTH,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export function TimeSliderAnchoredRange(props: Props) {
max={props.timeRangeMax}
step={props.stepSize}
ticks={props.ticks}
compressed
/>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export function TimeSliderSlidingWindowRange(props: Props) {
step={props.stepSize}
ticks={props.ticks}
isDraggable
compressed
/>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
.dshDashboardViewport-controls {
margin: 0 $euiSizeS 0 $euiSizeS;
padding-top: $euiSizeS;
padding-bottom: $euiSizeXS;
}

.dashboardViewport--screenshotMode .controlsWrapper--empty {
Expand Down
Binary file modified test/functional/screenshots/baseline/area_chart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/functional/screenshots/baseline/tsvb_dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 03bb0b2

Please sign in to comment.