Skip to content

Commit 4d99120

Browse files
[8.18] [Controls] Fix control styles and invalid selection icon for Borealis (#213851) (#216567)
# Backport This will backport the following commits from `main` to `8.18`: - [[Controls] Fix control styles and invalid selection icon for Borealis (#213851)](#213851) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Catherine Liu","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-04-01T00:04:43Z","message":"[Controls] Fix control styles and invalid selection icon for Borealis (#213851)\n\n## Summary\n\nCloses https://github.com/elastic/kibana/issues/210614.\nCloses https://github.com/elastic/kibana/issues/210615.\nCloses https://github.com/elastic/kibana/issues/210616.\n\nThis is a follow up to the Borealis updates to fix controls\ncolors/styles. This also fixes the text color of the range slider number\ninputs to match the invalid state.\n\n#### Light mode\n![Screenshot 2025-03-10 at 5 54\n28 PM](https://github.com/user-attachments/assets/1f3cfe7c-0a0f-4fed-9486-3aaee1b33fb1)\n\n#### Dark mode\n![Screenshot 2025-03-10 at 5 33\n48 PM](https://github.com/user-attachments/assets/dda36740-93fd-4adc-bffe-c12aa4be3b4c)\n\n#### Options List control with selection that results in no data\n\n![Screenshot 2025-03-10 at 5 49\n05 PM](https://github.com/user-attachments/assets/b8b6310b-c600-4703-af28-ee60d16339e0)\n\n#### Range Slider control with valid selection that results in no data\n![Screenshot 2025-03-10 at 5 49\n01 PM](https://github.com/user-attachments/assets/afbf971b-95df-414f-8b99-2e3e0822fc73)\n\n#### Range Slider control with invalid selection\n![Screenshot 2025-03-10 at 5 48\n48 PM](https://github.com/user-attachments/assets/dae00db3-8c94-47e5-a706-b43fa9e0787e)\n\n\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [ ] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n- [ ]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas added for features that require explanation or tutorials\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] If a plugin configuration key changed, check if it needs to be\nallowlisted in the cloud and added to the [docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n- [ ] This was checked for breaking HTTP API changes, and any breaking\nchanges have been approved by the breaking-change committee. The\n`release_note:breaking` label should be applied in these situations.\n- [ ] [Flaky Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\nused on any tests changed\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n### Identify risks\n\nDoes this PR introduce any risks? For example, consider risks like hard\nto test bugs, performance regression, potential of data loss.\n\nDescribe the risk, its severity, and mitigation for each identified\nrisk. Invite stakeholders and evaluate how to proceed before merging.\n\n- [ ] [See some risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n- [ ] ...","sha":"96598fc01956c0762ac50d8636c3e78ae5735863","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Platform-Design","Feature:Dashboard","Team:Presentation","loe:small","release_note:skip","impact:medium","backport:version","EUI Visual Refresh","v9.1.0","v8.19.0","v8.18.1","v9.0.1"],"title":"[Controls] Fix control styles and invalid selection icon for Borealis","number":213851,"url":"https://github.com/elastic/kibana/pull/213851","mergeCommit":{"message":"[Controls] Fix control styles and invalid selection icon for Borealis (#213851)\n\n## Summary\n\nCloses https://github.com/elastic/kibana/issues/210614.\nCloses https://github.com/elastic/kibana/issues/210615.\nCloses https://github.com/elastic/kibana/issues/210616.\n\nThis is a follow up to the Borealis updates to fix controls\ncolors/styles. This also fixes the text color of the range slider number\ninputs to match the invalid state.\n\n#### Light mode\n![Screenshot 2025-03-10 at 5 54\n28 PM](https://github.com/user-attachments/assets/1f3cfe7c-0a0f-4fed-9486-3aaee1b33fb1)\n\n#### Dark mode\n![Screenshot 2025-03-10 at 5 33\n48 PM](https://github.com/user-attachments/assets/dda36740-93fd-4adc-bffe-c12aa4be3b4c)\n\n#### Options List control with selection that results in no data\n\n![Screenshot 2025-03-10 at 5 49\n05 PM](https://github.com/user-attachments/assets/b8b6310b-c600-4703-af28-ee60d16339e0)\n\n#### Range Slider control with valid selection that results in no data\n![Screenshot 2025-03-10 at 5 49\n01 PM](https://github.com/user-attachments/assets/afbf971b-95df-414f-8b99-2e3e0822fc73)\n\n#### Range Slider control with invalid selection\n![Screenshot 2025-03-10 at 5 48\n48 PM](https://github.com/user-attachments/assets/dae00db3-8c94-47e5-a706-b43fa9e0787e)\n\n\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [ ] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n- [ ]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas added for features that require explanation or tutorials\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] If a plugin configuration key changed, check if it needs to be\nallowlisted in the cloud and added to the [docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n- [ ] This was checked for breaking HTTP API changes, and any breaking\nchanges have been approved by the breaking-change committee. The\n`release_note:breaking` label should be applied in these situations.\n- [ ] [Flaky Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\nused on any tests changed\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n### Identify risks\n\nDoes this PR introduce any risks? For example, consider risks like hard\nto test bugs, performance regression, potential of data loss.\n\nDescribe the risk, its severity, and mitigation for each identified\nrisk. Invite stakeholders and evaluate how to proceed before merging.\n\n- [ ] [See some risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n- [ ] ...","sha":"96598fc01956c0762ac50d8636c3e78ae5735863"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.18","9.0"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/213851","number":213851,"mergeCommit":{"message":"[Controls] Fix control styles and invalid selection icon for Borealis (#213851)\n\n## Summary\n\nCloses https://github.com/elastic/kibana/issues/210614.\nCloses https://github.com/elastic/kibana/issues/210615.\nCloses https://github.com/elastic/kibana/issues/210616.\n\nThis is a follow up to the Borealis updates to fix controls\ncolors/styles. This also fixes the text color of the range slider number\ninputs to match the invalid state.\n\n#### Light mode\n![Screenshot 2025-03-10 at 5 54\n28 PM](https://github.com/user-attachments/assets/1f3cfe7c-0a0f-4fed-9486-3aaee1b33fb1)\n\n#### Dark mode\n![Screenshot 2025-03-10 at 5 33\n48 PM](https://github.com/user-attachments/assets/dda36740-93fd-4adc-bffe-c12aa4be3b4c)\n\n#### Options List control with selection that results in no data\n\n![Screenshot 2025-03-10 at 5 49\n05 PM](https://github.com/user-attachments/assets/b8b6310b-c600-4703-af28-ee60d16339e0)\n\n#### Range Slider control with valid selection that results in no data\n![Screenshot 2025-03-10 at 5 49\n01 PM](https://github.com/user-attachments/assets/afbf971b-95df-414f-8b99-2e3e0822fc73)\n\n#### Range Slider control with invalid selection\n![Screenshot 2025-03-10 at 5 48\n48 PM](https://github.com/user-attachments/assets/dae00db3-8c94-47e5-a706-b43fa9e0787e)\n\n\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [ ] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n- [ ]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas added for features that require explanation or tutorials\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] If a plugin configuration key changed, check if it needs to be\nallowlisted in the cloud and added to the [docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n- [ ] This was checked for breaking HTTP API changes, and any breaking\nchanges have been approved by the breaking-change committee. The\n`release_note:breaking` label should be applied in these situations.\n- [ ] [Flaky Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\nused on any tests changed\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n### Identify risks\n\nDoes this PR introduce any risks? For example, consider risks like hard\nto test bugs, performance regression, potential of data loss.\n\nDescribe the risk, its severity, and mitigation for each identified\nrisk. Invite stakeholders and evaluate how to proceed before merging.\n\n- [ ] [See some risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n- [ ] ...","sha":"96598fc01956c0762ac50d8636c3e78ae5735863"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Catherine Liu <[email protected]>
1 parent f4ea861 commit 4d99120

File tree

9 files changed

+11
-23
lines changed

9 files changed

+11
-23
lines changed

src/platform/plugins/shared/controls/public/control_group/components/control_panel.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ $controlMinWidth: $euiSize * 14;
88
max-inline-size: 100% !important;
99
height: $euiButtonHeightSmall;
1010
box-shadow: none !important;
11-
background-color: $euiFormBackgroundColor !important;
1211
border-radius: 0 $euiBorderRadius $euiBorderRadius 0 !important;
1312

1413
&--roundedBorders {
@@ -89,7 +88,6 @@ $controlMinWidth: $euiSize * 14;
8988
.controlFrame__formControlLayout:after {
9089
content: '';
9190
position: absolute;
92-
background-color: transparentize($euiColorPrimary, .5);
9391
border-radius: $euiBorderRadius;
9492
top: 0;
9593
bottom: 0;
@@ -217,7 +215,6 @@ $controlMinWidth: $euiSize * 14;
217215
border-radius: $euiBorderRadius;
218216
font-weight: $euiFontWeightSemiBold;
219217
border: $euiBorderWidthThin solid $euiFormBorderColor;
220-
background-color: $euiFormInputGroupLabelBackground;
221218
min-width: $controlMinWidth;
222219
@include euiFontSizeXS;
223220
}

src/platform/plugins/shared/controls/public/controls/data_controls/options_list_control/components/options_list.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@
6969
padding-left: $euiSizeM;
7070
}
7171

72-
.optionsList__selectionInvalid {
73-
color: $euiColorWarningText;
74-
}
75-
7672
.optionslist--loadingMoreGroupLabel {
7773
text-align: center;
7874
padding: $euiSizeM;

src/platform/plugins/shared/controls/public/controls/data_controls/options_list_control/components/options_list_control.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export const OptionsListControl = ({
125125
tabIndex={0}
126126
iconType="alert"
127127
size="s"
128-
color="euiColorVis5"
128+
color="euiColorVis9"
129129
shape="square"
130130
fill="dark"
131131
title={OptionsListStrings.control.getInvalidSelectionWarningLabel(

src/platform/plugins/shared/controls/public/controls/data_controls/options_list_control/components/options_list_popover_footer.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
EuiProgress,
1919
useEuiBackgroundColor,
2020
useEuiPaddingSize,
21+
useEuiTheme,
2122
} from '@elastic/eui';
2223
import { css } from '@emotion/react';
2324
import { useBatchedPublishingSubjects } from '@kbn/presentation-publishing';
@@ -39,6 +40,7 @@ const aggregationToggleButtons = [
3940
];
4041

4142
export const OptionsListPopoverFooter = () => {
43+
const { euiTheme } = useEuiTheme();
4244
const { api, stateManager } = useOptionsListContext();
4345

4446
const [exclude, loading, allowExpensiveQueries] = useBatchedPublishingSubjects(
@@ -88,7 +90,7 @@ export const OptionsListPopoverFooter = () => {
8890
<EuiFlexItem data-test-subj="optionsList-allow-expensive-queries-warning" grow={false}>
8991
<EuiIconTip
9092
type="warning"
91-
color="warning"
93+
color={euiTheme.colors.textWarning}
9294
content={OptionsListStrings.popover.getAllowExpensiveQueriesWarning()}
9395
aria-label={OptionsListStrings.popover.getAllowExpensiveQueriesWarning()}
9496
/>

src/platform/plugins/shared/controls/public/controls/data_controls/options_list_control/components/options_list_popover_invalid_selections.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ export const OptionsListPopoverInvalidSelections = () => {
7171
<EuiFlexItem grow={false}>
7272
<EuiIcon
7373
type="warning"
74-
color="warning"
7574
title={OptionsListStrings.popover.getInvalidSelectionScreenReaderText()}
7675
size="s"
7776
/>

src/platform/plugins/shared/controls/public/controls/data_controls/range_slider/components/range_slider.styles.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export const rangeSliderControlStyles = (euiThemeContext: UseEuiTheme) => {
3030
}
3131
3232
.euiFormControlLayout {
33-
background-color: transparent;
3433
border: none;
3534
border-radius: 0;
3635
}
@@ -45,11 +44,11 @@ export const rangeSliderControlStyles = (euiThemeContext: UseEuiTheme) => {
4544
4645
/* Stretch the underline across the entire __childrenWrapper and set it to a custom warning color */
4746
background-size: 100% 100%;
48-
--euiFormControlStateColor: ${euiTheme.colors.warning};
47+
--euiFormControlStateColor: ${euiTheme.colors.textWarning};
4948
5049
/* But restore the danger color for truly invalid inputs (e.g. min larger than max) */
5150
&:has(input:invalid) {
52-
--euiFormControlStateColor: ${euiTheme.colors.danger};
51+
--euiFormControlStateColor: ${euiTheme.colors.textDanger};
5352
}
5453
5554
/* Remove the append background so the caution icon looks more natural */
@@ -62,7 +61,6 @@ export const rangeSliderControlStyles = (euiThemeContext: UseEuiTheme) => {
6261
fieldNumbers: {
6362
rangeSliderFieldNumber: css`
6463
font-weight: ${euiTheme.font.weight.medium};
65-
background-color: transparent;
6664
6765
&:placeholder-shown,
6866
&::placeholder {
@@ -72,9 +70,11 @@ export const rangeSliderControlStyles = (euiThemeContext: UseEuiTheme) => {
7270
`,
7371
invalid: css`
7472
&:not(:invalid) {
73+
--euiFormControlStateColor: ${euiTheme.colors.textWarning};
7574
color: ${euiTheme.colors.textWarning};
7675
}
7776
&:invalid {
77+
--euiFormControlStateColor: ${euiTheme.colors.textDanger};
7878
color: ${euiTheme.colors.textDanger};
7979
}
8080
`,

src/platform/plugins/shared/controls/public/controls/data_controls/range_slider/components/range_slider_control.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ export const RangeSliderControl: FC<Props> = ({
216216
tabIndex={0}
217217
iconType="alert"
218218
size="s"
219-
color="euiColorVis5"
219+
color="euiColorVis9"
220220
shape="square"
221221
fill="dark"
222222
title={RangeSliderStrings.control.getInvalidSelectionWarningLabel()}

src/platform/plugins/shared/controls/public/controls/data_controls/range_slider/get_range_slider_control_factory.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ export const getRangesliderControlFactory = (): DataControlFactory<
218218
return {
219219
api,
220220
Component: ({ className: controlPanelClassName }) => {
221-
const [dataLoading, fieldFormatter, max, min, selectionHasNotResults, step, value] =
221+
const [dataLoading, fieldFormatter, max, min, selectionHasNoResults, step, value] =
222222
useBatchedPublishingSubjects(
223223
dataLoading$,
224224
dataControl.api.fieldFormatter,
@@ -243,7 +243,7 @@ export const getRangesliderControlFactory = (): DataControlFactory<
243243
<RangeSliderControl
244244
controlPanelClassName={controlPanelClassName}
245245
fieldFormatter={fieldFormatter}
246-
isInvalid={selectionHasNotResults}
246+
isInvalid={Boolean(value) && selectionHasNoResults}
247247
isLoading={typeof dataLoading === 'boolean' ? dataLoading : false}
248248
max={max}
249249
min={min}

src/platform/plugins/shared/controls/public/controls/timeslider_control/components/index.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,13 @@
55
}
66
}
77

8-
.timeSlider-prependButton {
9-
background-color: transparent !important;
10-
}
11-
128
.timeSlider__anchor {
139
width: 100%;
1410
height: 100%;
1511
box-shadow: none;
1612
overflow: hidden;
1713

1814
.euiText {
19-
background-color: transparent !important;
20-
2115
&:hover {
2216
text-decoration: underline;
2317
}

0 commit comments

Comments
 (0)