@elastic/eui 105.0.0 → 106.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eui_theme_amsterdam_dark.json +2 -0
- package/dist/eui_theme_amsterdam_dark.json.d.ts +2 -0
- package/dist/eui_theme_amsterdam_light.json +2 -0
- package/dist/eui_theme_amsterdam_light.json.d.ts +2 -0
- package/dist/eui_theme_borealis_dark.json +2 -0
- package/dist/eui_theme_borealis_dark.json.d.ts +2 -0
- package/dist/eui_theme_borealis_light.json +10 -8
- package/dist/eui_theme_borealis_light.json.d.ts +2 -0
- package/es/components/combo_box/combo_box_input/combo_box_input.js +65 -61
- package/es/components/combo_box/combo_box_input/combo_box_input.styles.js +6 -4
- package/es/components/date_picker/date_picker.styles.js +4 -1
- package/es/components/date_picker/date_picker_range.js +3 -2
- package/es/components/date_picker/date_picker_range.styles.js +11 -4
- package/es/components/date_picker/super_date_picker/super_date_picker.styles.js +23 -14
- package/es/components/flyout/_flyout_close_button.styles.js +10 -1
- package/es/components/flyout/flyout_child.js +8 -3
- package/es/components/flyout/flyout_child.styles.js +3 -2
- package/es/components/flyout/sessions/flyout_provider.js +7 -21
- package/es/components/flyout/sessions/flyout_reducer.js +5 -26
- package/es/components/flyout/sessions/use_eui_flyout.js +21 -10
- package/es/components/form/field_number/field_number.styles.js +4 -1
- package/es/components/form/field_text/field_text.styles.js +4 -1
- package/es/components/form/file_picker/file_picker.js +107 -101
- package/es/components/form/file_picker/file_picker.styles.js +18 -17
- package/es/components/form/form.styles.js +72 -22
- package/es/components/form/form_control_layout/form_control_layout.styles.js +28 -17
- package/es/components/form/form_control_layout/form_control_layout_clear_button.styles.js +7 -7
- package/es/components/form/form_control_layout/form_control_layout_delimited.js +10 -7
- package/es/components/form/form_control_layout/form_control_layout_delimited.styles.js +34 -29
- package/es/components/form/form_control_layout/form_control_layout_icons.js +35 -20
- package/es/components/form/form_control_layout/form_control_layout_icons.styles.js +6 -6
- package/es/components/form/form_error_text/form_error_text.styles.js +3 -1
- package/es/components/form/form_label/form_label.styles.js +4 -2
- package/es/components/header/header.styles.js +5 -3
- package/es/components/markdown_editor/markdown_editor_drop_zone.styles.js +6 -3
- package/es/components/progress/progress.a11y.js +7 -7
- package/es/components/progress/progress.js +18 -27
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +59 -23
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +8 -2
- package/es/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +63 -0
- package/es/global_styling/mixins/_button.js +1 -1
- package/es/services/color/eui_palettes.js +26 -0
- package/es/services/color/vis_color_store.js +1 -1
- package/es/services/color/visualization_colors.js +4 -0
- package/es/services/theme/provider.js +13 -6
- package/es/themes/amsterdam/global_styling/variables/_colors.js +8 -3
- package/es/themes/amsterdam/global_styling/variables/_forms.js +96 -53
- package/es/themes/amsterdam/theme.js +2 -1
- package/es/themes/json/eui_theme_amsterdam_dark.json +2 -0
- package/es/themes/json/eui_theme_amsterdam_light.json +2 -0
- package/es/themes/json/eui_theme_borealis_dark.json +2 -0
- package/es/themes/json/eui_theme_borealis_light.json +10 -8
- package/eui.d.ts +461 -376
- package/i18ntokens.json +3595 -3523
- package/lib/components/combo_box/combo_box_input/combo_box_input.js +64 -60
- package/lib/components/combo_box/combo_box_input/combo_box_input.styles.js +6 -4
- package/lib/components/date_picker/date_picker.styles.js +4 -1
- package/lib/components/date_picker/date_picker_range.js +3 -2
- package/lib/components/date_picker/date_picker_range.styles.js +11 -4
- package/lib/components/date_picker/super_date_picker/super_date_picker.styles.js +21 -12
- package/lib/components/flyout/_flyout_close_button.styles.js +10 -3
- package/lib/components/flyout/flyout_child.js +8 -3
- package/lib/components/flyout/flyout_child.styles.js +3 -2
- package/lib/components/flyout/sessions/flyout_provider.js +7 -21
- package/lib/components/flyout/sessions/flyout_reducer.js +5 -26
- package/lib/components/flyout/sessions/use_eui_flyout.js +21 -10
- package/lib/components/form/field_number/field_number.styles.js +4 -1
- package/lib/components/form/field_text/field_text.styles.js +4 -1
- package/lib/components/form/file_picker/file_picker.js +106 -100
- package/lib/components/form/file_picker/file_picker.styles.js +16 -15
- package/lib/components/form/form.styles.js +72 -22
- package/lib/components/form/form_control_layout/form_control_layout.styles.js +28 -17
- package/lib/components/form/form_control_layout/form_control_layout_clear_button.styles.js +7 -7
- package/lib/components/form/form_control_layout/form_control_layout_delimited.js +9 -6
- package/lib/components/form/form_control_layout/form_control_layout_delimited.styles.js +34 -27
- package/lib/components/form/form_control_layout/form_control_layout_icons.js +34 -19
- package/lib/components/form/form_control_layout/form_control_layout_icons.styles.js +6 -6
- package/lib/components/form/form_error_text/form_error_text.styles.js +3 -1
- package/lib/components/form/form_label/form_label.styles.js +4 -2
- package/lib/components/header/header.styles.js +4 -2
- package/lib/components/markdown_editor/markdown_editor_drop_zone.styles.js +6 -3
- package/lib/components/progress/progress.a11y.js +7 -7
- package/lib/components/progress/progress.js +18 -27
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +57 -21
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +9 -3
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +69 -0
- package/lib/global_styling/mixins/_button.js +1 -1
- package/lib/services/color/eui_palettes.js +26 -0
- package/lib/services/color/vis_color_store.js +1 -1
- package/lib/services/color/visualization_colors.js +3 -0
- package/lib/services/theme/provider.js +13 -6
- package/lib/themes/amsterdam/global_styling/variables/_colors.js +8 -3
- package/lib/themes/amsterdam/global_styling/variables/_forms.js +96 -53
- package/lib/themes/amsterdam/theme.js +2 -1
- package/lib/themes/json/eui_theme_amsterdam_dark.json +2 -0
- package/lib/themes/json/eui_theme_amsterdam_light.json +2 -0
- package/lib/themes/json/eui_theme_borealis_dark.json +2 -0
- package/lib/themes/json/eui_theme_borealis_light.json +10 -8
- package/optimize/es/components/combo_box/combo_box_input/combo_box_input.js +65 -61
- package/optimize/es/components/combo_box/combo_box_input/combo_box_input.styles.js +6 -4
- package/optimize/es/components/date_picker/date_picker.styles.js +4 -1
- package/optimize/es/components/date_picker/date_picker_range.js +3 -2
- package/optimize/es/components/date_picker/date_picker_range.styles.js +11 -4
- package/optimize/es/components/date_picker/super_date_picker/super_date_picker.styles.js +23 -14
- package/optimize/es/components/flyout/_flyout_close_button.styles.js +10 -1
- package/optimize/es/components/flyout/flyout_child.js +4 -3
- package/optimize/es/components/flyout/flyout_child.styles.js +3 -2
- package/optimize/es/components/flyout/sessions/flyout_provider.js +7 -21
- package/optimize/es/components/flyout/sessions/flyout_reducer.js +5 -26
- package/optimize/es/components/flyout/sessions/use_eui_flyout.js +21 -10
- package/optimize/es/components/form/field_number/field_number.styles.js +4 -1
- package/optimize/es/components/form/field_text/field_text.styles.js +4 -1
- package/optimize/es/components/form/file_picker/file_picker.js +107 -101
- package/optimize/es/components/form/file_picker/file_picker.styles.js +18 -17
- package/optimize/es/components/form/form.styles.js +72 -22
- package/optimize/es/components/form/form_control_layout/form_control_layout.styles.js +28 -17
- package/optimize/es/components/form/form_control_layout/form_control_layout_clear_button.styles.js +7 -7
- package/optimize/es/components/form/form_control_layout/form_control_layout_delimited.js +10 -7
- package/optimize/es/components/form/form_control_layout/form_control_layout_delimited.styles.js +34 -29
- package/optimize/es/components/form/form_control_layout/form_control_layout_icons.js +35 -20
- package/optimize/es/components/form/form_control_layout/form_control_layout_icons.styles.js +6 -6
- package/optimize/es/components/form/form_error_text/form_error_text.styles.js +3 -1
- package/optimize/es/components/form/form_label/form_label.styles.js +4 -2
- package/optimize/es/components/header/header.styles.js +5 -3
- package/optimize/es/components/markdown_editor/markdown_editor_drop_zone.styles.js +6 -3
- package/optimize/es/components/progress/progress.a11y.js +7 -7
- package/optimize/es/components/progress/progress.js +18 -27
- package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide.js +47 -22
- package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +8 -2
- package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +52 -0
- package/optimize/es/global_styling/mixins/_button.js +1 -1
- package/optimize/es/services/color/eui_palettes.js +26 -0
- package/optimize/es/services/color/vis_color_store.js +1 -1
- package/optimize/es/services/color/visualization_colors.js +4 -0
- package/optimize/es/services/theme/provider.js +13 -6
- package/optimize/es/themes/amsterdam/global_styling/variables/_colors.js +8 -3
- package/optimize/es/themes/amsterdam/global_styling/variables/_forms.js +96 -53
- package/optimize/es/themes/amsterdam/theme.js +2 -1
- package/optimize/es/themes/json/eui_theme_amsterdam_dark.json +2 -0
- package/optimize/es/themes/json/eui_theme_amsterdam_light.json +2 -0
- package/optimize/es/themes/json/eui_theme_borealis_dark.json +2 -0
- package/optimize/es/themes/json/eui_theme_borealis_light.json +10 -8
- package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.js +64 -60
- package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.styles.js +6 -4
- package/optimize/lib/components/date_picker/date_picker.styles.js +4 -1
- package/optimize/lib/components/date_picker/date_picker_range.js +3 -2
- package/optimize/lib/components/date_picker/date_picker_range.styles.js +11 -4
- package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.styles.js +21 -12
- package/optimize/lib/components/flyout/_flyout_close_button.styles.js +10 -3
- package/optimize/lib/components/flyout/flyout_child.js +4 -3
- package/optimize/lib/components/flyout/flyout_child.styles.js +3 -2
- package/optimize/lib/components/flyout/sessions/flyout_provider.js +7 -21
- package/optimize/lib/components/flyout/sessions/flyout_reducer.js +5 -26
- package/optimize/lib/components/flyout/sessions/use_eui_flyout.js +21 -10
- package/optimize/lib/components/form/field_number/field_number.styles.js +4 -1
- package/optimize/lib/components/form/field_text/field_text.styles.js +4 -1
- package/optimize/lib/components/form/file_picker/file_picker.js +106 -100
- package/optimize/lib/components/form/file_picker/file_picker.styles.js +16 -15
- package/optimize/lib/components/form/form.styles.js +72 -22
- package/optimize/lib/components/form/form_control_layout/form_control_layout.styles.js +28 -17
- package/optimize/lib/components/form/form_control_layout/form_control_layout_clear_button.styles.js +7 -7
- package/optimize/lib/components/form/form_control_layout/form_control_layout_delimited.js +9 -6
- package/optimize/lib/components/form/form_control_layout/form_control_layout_delimited.styles.js +34 -27
- package/optimize/lib/components/form/form_control_layout/form_control_layout_icons.js +34 -19
- package/optimize/lib/components/form/form_control_layout/form_control_layout_icons.styles.js +6 -6
- package/optimize/lib/components/form/form_error_text/form_error_text.styles.js +3 -1
- package/optimize/lib/components/form/form_label/form_label.styles.js +4 -2
- package/optimize/lib/components/header/header.styles.js +4 -2
- package/optimize/lib/components/markdown_editor/markdown_editor_drop_zone.styles.js +6 -3
- package/optimize/lib/components/progress/progress.a11y.js +7 -7
- package/optimize/lib/components/progress/progress.js +18 -27
- package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +45 -20
- package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +9 -3
- package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +58 -0
- package/optimize/lib/global_styling/mixins/_button.js +1 -1
- package/optimize/lib/services/color/eui_palettes.js +26 -0
- package/optimize/lib/services/color/vis_color_store.js +1 -1
- package/optimize/lib/services/color/visualization_colors.js +3 -0
- package/optimize/lib/services/theme/provider.js +13 -6
- package/optimize/lib/themes/amsterdam/global_styling/variables/_colors.js +8 -3
- package/optimize/lib/themes/amsterdam/global_styling/variables/_forms.js +96 -53
- package/optimize/lib/themes/amsterdam/theme.js +2 -1
- package/optimize/lib/themes/json/eui_theme_amsterdam_dark.json +2 -0
- package/optimize/lib/themes/json/eui_theme_amsterdam_light.json +2 -0
- package/optimize/lib/themes/json/eui_theme_borealis_dark.json +2 -0
- package/optimize/lib/themes/json/eui_theme_borealis_light.json +10 -8
- package/package.json +12 -10
- package/src/themes/amsterdam/_colors_dark.scss +3 -0
- package/src/themes/amsterdam/_colors_light.scss +3 -0
- package/test-env/components/combo_box/combo_box_input/combo_box_input.js +64 -60
- package/test-env/components/combo_box/combo_box_input/combo_box_input.styles.js +6 -4
- package/test-env/components/date_picker/date_picker.styles.js +4 -1
- package/test-env/components/date_picker/date_picker_range.js +3 -2
- package/test-env/components/date_picker/date_picker_range.styles.js +11 -4
- package/test-env/components/date_picker/super_date_picker/super_date_picker.styles.js +21 -12
- package/test-env/components/flyout/_flyout_close_button.styles.js +10 -3
- package/test-env/components/flyout/flyout_child.js +8 -3
- package/test-env/components/flyout/flyout_child.styles.js +3 -2
- package/test-env/components/flyout/sessions/flyout_provider.js +7 -21
- package/test-env/components/flyout/sessions/flyout_reducer.js +5 -26
- package/test-env/components/flyout/sessions/use_eui_flyout.js +21 -10
- package/test-env/components/form/field_number/field_number.styles.js +4 -1
- package/test-env/components/form/field_text/field_text.styles.js +4 -1
- package/test-env/components/form/file_picker/file_picker.js +106 -100
- package/test-env/components/form/file_picker/file_picker.styles.js +16 -15
- package/test-env/components/form/form.styles.js +72 -22
- package/test-env/components/form/form_control_layout/form_control_layout.styles.js +28 -17
- package/test-env/components/form/form_control_layout/form_control_layout_clear_button.styles.js +7 -7
- package/test-env/components/form/form_control_layout/form_control_layout_delimited.js +9 -6
- package/test-env/components/form/form_control_layout/form_control_layout_delimited.styles.js +34 -27
- package/test-env/components/form/form_control_layout/form_control_layout_icons.js +34 -19
- package/test-env/components/form/form_control_layout/form_control_layout_icons.styles.js +6 -6
- package/test-env/components/form/form_error_text/form_error_text.styles.js +3 -1
- package/test-env/components/form/form_label/form_label.styles.js +4 -2
- package/test-env/components/header/header.styles.js +4 -2
- package/test-env/components/markdown_editor/markdown_editor_drop_zone.styles.js +6 -3
- package/test-env/components/progress/progress.a11y.js +7 -7
- package/test-env/components/progress/progress.js +18 -27
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +57 -21
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +9 -3
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +68 -0
- package/test-env/global_styling/mixins/_button.js +1 -1
- package/test-env/services/color/eui_palettes.js +26 -0
- package/test-env/services/color/vis_color_store.js +1 -1
- package/test-env/services/color/visualization_colors.js +3 -0
- package/test-env/services/theme/provider.js +13 -6
- package/test-env/themes/amsterdam/global_styling/variables/_colors.js +8 -3
- package/test-env/themes/amsterdam/global_styling/variables/_forms.js +96 -53
- package/test-env/themes/amsterdam/theme.js +2 -1
- package/test-env/themes/json/eui_theme_amsterdam_dark.json +2 -0
- package/test-env/themes/json/eui_theme_amsterdam_light.json +2 -0
- package/test-env/themes/json/eui_theme_borealis_dark.json +2 -0
- package/test-env/themes/json/eui_theme_borealis_light.json +10 -8
|
@@ -12,7 +12,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
12
12
|
* Side Public License, v 1.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { makeHighContrastColor } from '../../services';
|
|
15
|
+
import { isEuiThemeRefreshVariant, makeHighContrastColor } from '../../services';
|
|
16
16
|
import { logicalCSS, mathWithUnits, euiCanAnimate, euiFontSize } from '../../global_styling';
|
|
17
17
|
import { highContrastModeStyles } from '../../global_styling/functions/high_contrast';
|
|
18
18
|
|
|
@@ -26,6 +26,7 @@ export var euiFormMaxWidth = function euiFormMaxWidth(_ref) {
|
|
|
26
26
|
export var euiFormVariables = function euiFormVariables(euiThemeContext) {
|
|
27
27
|
var euiTheme = euiThemeContext.euiTheme,
|
|
28
28
|
highContrastMode = euiThemeContext.highContrastMode;
|
|
29
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
29
30
|
var backgroundColor = highContrastMode ? euiTheme.colors.emptyShade : euiTheme.components.forms.background;
|
|
30
31
|
var controlHeight = euiTheme.size.xxl;
|
|
31
32
|
var controlCompressedHeight = euiTheme.size.xl;
|
|
@@ -35,12 +36,12 @@ export var euiFormVariables = function euiFormVariables(euiThemeContext) {
|
|
|
35
36
|
controlCompressedHeight: controlCompressedHeight,
|
|
36
37
|
controlPadding: euiTheme.size.m,
|
|
37
38
|
controlCompressedPadding: euiTheme.size.s,
|
|
38
|
-
controlBorderRadius: euiTheme.border.radius.medium,
|
|
39
|
+
controlBorderRadius: isRefreshVariant ? euiTheme.border.radius.small : euiTheme.border.radius.medium,
|
|
39
40
|
controlCompressedBorderRadius: euiTheme.border.radius.small,
|
|
40
41
|
iconAffordance: mathWithUnits(euiTheme.size.base, function (x) {
|
|
41
42
|
return x * 1.5;
|
|
42
43
|
}),
|
|
43
|
-
iconCompressedAffordance: mathWithUnits(euiTheme.size.m, function (x) {
|
|
44
|
+
iconCompressedAffordance: mathWithUnits(isRefreshVariant ? euiTheme.size.base : euiTheme.size.m, function (x) {
|
|
44
45
|
return x * 1.5;
|
|
45
46
|
}),
|
|
46
47
|
stateUnderlineHeight: highContrastMode ? mathWithUnits(euiTheme.border.width.thick, function (x) {
|
|
@@ -54,9 +55,13 @@ export var euiFormVariables = function euiFormVariables(euiThemeContext) {
|
|
|
54
55
|
backgroundDisabledColor: euiTheme.components.forms.backgroundDisabled,
|
|
55
56
|
backgroundReadOnlyColor: euiTheme.components.forms.backgroundReadOnly,
|
|
56
57
|
borderColor: highContrastMode ? euiTheme.border.color : euiTheme.components.forms.border,
|
|
58
|
+
borderHovered: euiTheme.components.forms.borderHovered,
|
|
59
|
+
borderFocused: euiTheme.components.forms.borderFocused,
|
|
60
|
+
borderInvalid: euiTheme.components.forms.borderInvalid,
|
|
61
|
+
borderInvalidHovered: euiTheme.components.forms.borderInvalidHovered,
|
|
57
62
|
controlDisabledColor: euiTheme.components.forms.controlBackgroundDisabled,
|
|
58
63
|
controlBoxShadow: '0 0 transparent',
|
|
59
|
-
controlPlaceholderText: makeHighContrastColor(euiTheme.colors.textSubdued)(backgroundColor),
|
|
64
|
+
controlPlaceholderText: isRefreshVariant ? highContrastMode ? makeHighContrastColor(euiTheme.components.forms.colorDisabled)(backgroundColor) : euiTheme.components.forms.colorDisabled : makeHighContrastColor(euiTheme.colors.textSubdued)(backgroundColor),
|
|
60
65
|
appendPrependBackground: euiTheme.components.forms.prependBackground
|
|
61
66
|
};
|
|
62
67
|
var controlLayout = {
|
|
@@ -81,7 +86,9 @@ export var euiFormVariables = function euiFormVariables(euiThemeContext) {
|
|
|
81
86
|
animationTiming: "".concat(euiTheme.animation.fast, " ease-in")
|
|
82
87
|
});
|
|
83
88
|
};
|
|
89
|
+
var formControlLayoutWrapperSelector = '.euiFormControlLayout__childrenWrapper';
|
|
84
90
|
export var euiFormControlStyles = function euiFormControlStyles(euiThemeContext) {
|
|
91
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
85
92
|
var form = euiFormVariables(euiThemeContext);
|
|
86
93
|
return {
|
|
87
94
|
shared: "\n ".concat(euiFormControlText(euiThemeContext), "\n ").concat(euiFormControlDefaultShadow(euiThemeContext), "\n "),
|
|
@@ -92,7 +99,7 @@ export var euiFormControlStyles = function euiFormControlStyles(euiThemeContext)
|
|
|
92
99
|
inGroup: "\n ".concat(logicalCSS('height', '100%'), "\n ").concat(highContrastModeStyles(euiThemeContext, {
|
|
93
100
|
none: 'box-shadow: none;',
|
|
94
101
|
preferred: 'border: none;'
|
|
95
|
-
}), "\n border-radius: 0;\n "),
|
|
102
|
+
}), "\n border-radius: ").concat(isRefreshVariant ? 'inherit' : '0', ";\n "),
|
|
96
103
|
// Widths
|
|
97
104
|
formWidth: "\n ".concat(logicalCSS('max-width', form.maxWidth), "\n ").concat(logicalCSS('width', '100%'), "\n "),
|
|
98
105
|
fullWidth: "\n ".concat(logicalCSS('max-width', '100%'), "\n ").concat(logicalCSS('width', '100%'), "\n "),
|
|
@@ -122,44 +129,75 @@ export var euiFormControlDefaultShadow = function euiFormControlDefaultShadow(eu
|
|
|
122
129
|
_ref2$withBackgroundA = _ref2.withBackgroundAnimation,
|
|
123
130
|
withBackgroundAnimation = _ref2$withBackgroundA === void 0 ? withBackground : _ref2$withBackgroundA;
|
|
124
131
|
var euiTheme = euiThemeContext.euiTheme;
|
|
132
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
125
133
|
var form = euiFormVariables(euiThemeContext);
|
|
126
134
|
var border = highContrastModeStyles(euiThemeContext, {
|
|
127
135
|
// We use inset box-shadow instead of border to skip extra height calculations
|
|
128
|
-
none: "\n border: none;\n box-shadow: inset 0 0 0 ".concat(euiTheme.border.width.thin, " ").concat(form.borderColor, ";\n "),
|
|
136
|
+
none: isRefreshVariant ? "\n --euiFormControlStateColor: ".concat(form.borderColor, ";\n border: none;\n box-shadow: inset 0 0 0 ").concat(euiTheme.border.width.thin, " var(--euiFormControlStateColor);\n\n ").concat(euiFormControlHoverStyles(euiThemeContext), "\n ") : "\n border: none;\n box-shadow: inset 0 0 0 ".concat(euiTheme.border.width.thin, " ").concat(form.borderColor, ";\n "),
|
|
129
137
|
// In high contrast mode, this doesn't matter - we need to prioritize visibility
|
|
130
|
-
preferred: "\n border: ".concat(euiTheme.border.width.thin, " solid ").concat(euiTheme.border.color, ";\n ")
|
|
138
|
+
preferred: "\n border: ".concat(euiTheme.border.width.thin, " solid ").concat(euiTheme.border.color, ";\n\n ").concat(euiFormControlHoverStyles(euiThemeContext), "\n ")
|
|
131
139
|
});
|
|
132
140
|
var backgroundColor = "\n background-color: ".concat(form.backgroundColor, ";\n ").trim();
|
|
133
141
|
var backgroundGradient = highContrastModeStyles(euiThemeContext, {
|
|
134
|
-
none: "\n background-repeat: no-repeat;\n background-size: 0% 100%;\n background-image: linear-gradient(to top,\n var(--euiFormControlStateColor),\n var(--euiFormControlStateColor) ".concat(
|
|
142
|
+
none: !isRefreshVariant ? "\n background-repeat: no-repeat;\n background-size: 0% 100%;\n background-image: linear-gradient(to top,\n var(--euiFormControlStateColor),\n var(--euiFormControlStateColor) ".concat(isRefreshVariant ? mathWithUnits([euiTheme.border.width.thick, euiTheme.border.width.thin], function (x, y) {
|
|
143
|
+
return x + y;
|
|
144
|
+
} // account for pseudo element border
|
|
145
|
+
) : form.stateUnderlineHeight, ",\n transparent ").concat(form.stateUnderlineHeight, ",\n transparent 100%\n );\n ") : '',
|
|
135
146
|
// Windows high contrast mode overrides/hides background gradients - we'll need another approach
|
|
136
147
|
forced: "\n background-repeat: no-repeat;\n background-size: 0% ".concat(form.stateUnderlineHeight, ";\n background-position: bottom left;\n background-origin: border-box;\n ")
|
|
137
148
|
});
|
|
138
|
-
var backgroundAnimation = "\n ".concat(euiCanAnimate, " {\n transition:\n background-image ").concat(form.animationTiming, ",\n background-size ").concat(form.animationTiming, ",\n background-color ").concat(form.animationTiming, ";\n }\n ").trim();
|
|
149
|
+
var backgroundAnimation = !isRefreshVariant ? "\n ".concat(euiCanAnimate, " {\n transition:\n background-image ").concat(form.animationTiming, ",\n background-size ").concat(form.animationTiming, ",\n background-color ").concat(form.animationTiming, ";\n }\n ").trim() : '';
|
|
139
150
|
return "\n ".concat(withBorder ? border : '', "\n ").concat(withBackgroundColor ? backgroundColor : '', "\n ").concat(withBackground ? backgroundGradient : '', "\n ").concat(withBackgroundAnimation ? backgroundAnimation : '', "\n ");
|
|
140
151
|
};
|
|
152
|
+
var hoverSelector = '&:hover:not(:disabled, :focus, input[readonly], [class*="readOnly"])';
|
|
153
|
+
export var disableFormControlHoverStyles = function disableFormControlHoverStyles() {
|
|
154
|
+
return "\n ".concat(hoverSelector, " {\n outline: none;\n }\n");
|
|
155
|
+
};
|
|
156
|
+
export var euiFormControlHoverStyles = function euiFormControlHoverStyles(euiThemeContext) {
|
|
157
|
+
var euiTheme = euiThemeContext.euiTheme,
|
|
158
|
+
highContrastMode = euiThemeContext.highContrastMode;
|
|
159
|
+
var form = euiFormVariables(euiThemeContext);
|
|
160
|
+
return "\n ".concat(hoverSelector, " {\n --borderWidthBase: var(--euiFormControlStateWidth, ").concat(euiTheme.border.width.thin, ");\n --borderWidth: ").concat(highContrastMode ? euiTheme.border.width.thick : 'var(--borderWidthBase)', ";\n --borderColor: var(--euiFormControlStateHoverColor, ").concat(highContrastMode ? euiTheme.border.color : form.borderHovered, ");\n position: relative;\n z-index: 1;\n outline: var(--borderWidth) solid var(--borderColor);\n outline-offset: calc(-1 * var(--borderWidth));\n }\n ");
|
|
161
|
+
};
|
|
162
|
+
export var euiFormControlHighlightBorderStyles = "\n position: relative;\n z-index: 1;\n box-shadow: none;\n outline: var(--euiFormControlStateWidth) solid var(--euiFormControlStateColor);\n outline-offset: calc(-1 * var(--euiFormControlStateWidth));\n";
|
|
141
163
|
export var euiFormControlFocusStyles = function euiFormControlFocusStyles(euiThemeContext) {
|
|
142
164
|
var euiTheme = euiThemeContext.euiTheme;
|
|
165
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
166
|
+
var form = euiFormVariables(euiThemeContext);
|
|
143
167
|
var focusColor = euiTheme.colors.primary;
|
|
144
|
-
return "\n
|
|
168
|
+
return isRefreshVariant ? "\n --euiFormControlStateColor: ".concat(form.borderFocused, ";\n --euiFormControlStateHoverColor: ").concat(form.borderFocused, ";\n --euiFormControlStateWidth: ").concat(euiTheme.border.width.thick, ";\n ").concat(euiFormControlHighlightBorderStyles, "\n ").concat(highContrastModeStyles(euiThemeContext, {
|
|
169
|
+
forced: "\n ".concat(euiFormControlShowBackgroundLine(euiThemeContext, focusColor), "\n ")
|
|
170
|
+
}), "\n ") : "\n --euiFormControlStateColor: ".concat(focusColor, ";\n background-color: ").concat(euiTheme.components.forms.backgroundFocused, ";\n ").concat(euiFormControlShowBackgroundLine(euiThemeContext, focusColor), "\n outline: none; /* Remove all outlines and rely on our own bottom border gradient */\n ");
|
|
145
171
|
};
|
|
146
172
|
export var euiFormControlInvalidStyles = function euiFormControlInvalidStyles(euiThemeContext) {
|
|
147
|
-
var euiTheme = euiThemeContext.euiTheme
|
|
173
|
+
var euiTheme = euiThemeContext.euiTheme,
|
|
174
|
+
highContrastMode = euiThemeContext.highContrastMode;
|
|
175
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
176
|
+
var form = euiFormVariables(euiThemeContext);
|
|
148
177
|
var invalidColor = euiTheme.colors.danger;
|
|
149
|
-
return "\n --euiFormControlStateColor: ".concat(invalidColor, ";\n
|
|
178
|
+
return isRefreshVariant ? "\n --euiFormControlStateColor: ".concat(form.borderInvalid, ";\n --euiFormControlStateHoverColor: ").concat(form.borderInvalidHovered, ";\n --euiFormControlStateWidth: ").concat(highContrastMode === 'preferred' ? euiTheme.border.width.thick : euiTheme.border.width.thin, ";\n \n ").concat(euiFormControlHighlightBorderStyles, "\n ").concat(euiFormControlShowBackgroundLine(euiThemeContext, invalidColor), "\n ") : "\n --euiFormControlStateColor: ".concat(invalidColor, ";\n ").concat(euiFormControlShowBackgroundLine(euiThemeContext, invalidColor), "\n ");
|
|
150
179
|
};
|
|
151
180
|
export var euiFormControlDisabledStyles = function euiFormControlDisabledStyles(euiThemeContext) {
|
|
181
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
152
182
|
var form = euiFormVariables(euiThemeContext);
|
|
153
|
-
|
|
183
|
+
var refreshVariantStyles = "\n --euiFormControlStateHoverColor: transparent;\n --euiFormControlStateColor: ".concat(form.borderColor, ";\n ");
|
|
184
|
+
return "\n color: ".concat(form.textColorDisabled, ";\n /* Required for Safari */\n -webkit-text-fill-color: ").concat(form.textColorDisabled, ";\n background-color: ").concat(form.backgroundDisabledColor, ";\n cursor: not-allowed;\n --euiFormControlStateColor: transparent;\n\n ").concat(isRefreshVariant && refreshVariantStyles, "\n\n ").concat(euiPlaceholderPerBrowser("\n color: ".concat(form.textColorDisabled, ";\n opacity: 1;\n ")), "\n ");
|
|
154
185
|
};
|
|
155
186
|
export var euiFormControlReadOnlyStyles = function euiFormControlReadOnlyStyles(euiThemeContext) {
|
|
187
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
188
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
156
189
|
var form = euiFormVariables(euiThemeContext);
|
|
157
|
-
|
|
190
|
+
var styles = isRefreshVariant ? "\n --euiFormControlStateColor: ".concat(form.borderColor, ";\n --euiFormControlStateHoverColor: ").concat(form.borderColor, ";\n --euiFormControlStateWidth: ").concat(euiTheme.border.width.thin, ";\n /* keep the input below wrapper borders */\n position: relative;\n z-index: 0;\n outline: none;\n box-shadow: inset 0 0 0 var(--euiFormControlStateWidth) var(--euiFormControlStateColor);\n\n ").concat(formControlLayoutWrapperSelector, "[class*=inGroup] & {\n box-shadow: none;\n }\n ").concat(highContrastModeStyles(euiThemeContext, {
|
|
191
|
+
preferred: 'box-shadow: none;'
|
|
192
|
+
}), "\n ") : "\n --euiFormControlStateColor: transparent;\n ".concat(highContrastModeStyles(euiThemeContext, {
|
|
158
193
|
forced: 'background-image: none;'
|
|
159
|
-
}), "\n
|
|
194
|
+
}), "\n ");
|
|
195
|
+
return "\n background-color: ".concat(form.backgroundReadOnlyColor, ";\n cursor: default;\n color: ").concat(form.textColor, ";\n -webkit-text-fill-color: ").concat(form.textColor, "; /* Required for Safari */\n\n ").concat(styles, "\n ");
|
|
160
196
|
};
|
|
161
197
|
export var euiFormControlAutoFillStyles = function euiFormControlAutoFillStyles(euiThemeContext) {
|
|
162
198
|
var euiTheme = euiThemeContext.euiTheme;
|
|
199
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
200
|
+
var form = euiFormVariables(euiThemeContext);
|
|
163
201
|
|
|
164
202
|
// Make the text color slightly less prominent than the default colors.text
|
|
165
203
|
var textColor = euiTheme.colors.darkestShade;
|
|
@@ -171,27 +209,39 @@ export var euiFormControlAutoFillStyles = function euiFormControlAutoFillStyles(
|
|
|
171
209
|
// Re-create the border, since the above webkit box shadow overrides the default border box-shadow
|
|
172
210
|
// + change the border color to match states, since the underline background gradient no longer works
|
|
173
211
|
var borderColor = euiTheme.components.forms.borderAutofilled;
|
|
174
|
-
var
|
|
212
|
+
var borderHovered = euiTheme.components.forms.borderAutofilledHovered;
|
|
213
|
+
var borderInvalid = form.borderInvalid;
|
|
214
|
+
var borderInvalidHovered = form.borderInvalidHovered;
|
|
175
215
|
var borderShadow = function borderShadow(color) {
|
|
176
216
|
return "inset 0 0 0 ".concat(euiTheme.border.width.thin, " ").concat(color);
|
|
177
217
|
};
|
|
218
|
+
var interactiveStyles = isRefreshVariant ? "\n &:hover,\n &:focus {\n -webkit-box-shadow: ".concat(borderShadow(borderHovered), ", ").concat(backgroundShadow, ";\n }\n\n &:invalid {\n -webkit-box-shadow: ").concat(borderShadow(borderInvalid), ", ").concat(backgroundShadow, ";\n\n &:hover {\n -webkit-box-shadow: ").concat(borderShadow(borderInvalidHovered), ", ").concat(backgroundShadow, ";\n }\n }\n ") : "\n &:invalid {\n -webkit-box-shadow: ".concat(borderShadow(borderInvalid), ", ").concat(backgroundShadow, ";\n }\n ");
|
|
178
219
|
|
|
179
220
|
// These styles only apply/override Chrome/webkit browsers - Firefox does not set autofill styles
|
|
180
|
-
return "\n &:-webkit-autofill {\n -webkit-text-fill-color: ".concat(textColor, ";\n -webkit-box-shadow: ").concat(borderShadow(borderColor), ", ").concat(backgroundShadow, ";\n\n
|
|
221
|
+
return "\n &:-webkit-autofill {\n -webkit-text-fill-color: ".concat(textColor, ";\n -webkit-box-shadow: ").concat(borderShadow(borderColor), ", ").concat(backgroundShadow, ";\n\n ").concat(interactiveStyles, "\n }\n ");
|
|
181
222
|
};
|
|
182
|
-
export var
|
|
183
|
-
|
|
223
|
+
export var euiFormControlShowBackgroundLine = function euiFormControlShowBackgroundLine(euiThemeContext, color) {
|
|
224
|
+
var euiTheme = euiThemeContext.euiTheme,
|
|
225
|
+
highContrastMode = euiThemeContext.highContrastMode;
|
|
226
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
227
|
+
if (highContrastMode !== 'forced') {
|
|
184
228
|
return 'background-size: 100% 100%;';
|
|
185
229
|
}
|
|
230
|
+
var _euiFormVariables = euiFormVariables(euiThemeContext),
|
|
231
|
+
stateUnderlineHeight = _euiFormVariables.stateUnderlineHeight;
|
|
186
232
|
|
|
187
233
|
// Windows high contrast themes ignore all background-images that aren't url-based,
|
|
188
234
|
// so to restore the linear-gradient that provides important visual information, we're
|
|
189
235
|
// using a static inline SVG workaround
|
|
190
236
|
var fill = encodeURIComponent(color);
|
|
237
|
+
var strokeWidth = stateUnderlineHeight !== null && stateUnderlineHeight !== void 0 ? stateUnderlineHeight : '4px';
|
|
191
238
|
var inlineSVG = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' fill='".concat(fill, "' /%3E%3C/svg%3E");
|
|
192
|
-
var
|
|
193
|
-
|
|
194
|
-
|
|
239
|
+
var refreshInlineSVG = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' style='fill:transparent;stroke-width:".concat(strokeWidth, ";stroke:").concat(fill, "' /%3E%3C/svg%3E");
|
|
240
|
+
return isRefreshVariant ? "\n background-size: calc(100% - ".concat(mathWithUnits(strokeWidth, function (x) {
|
|
241
|
+
return x / 2;
|
|
242
|
+
}), ") calc(100% - ").concat(mathWithUnits(strokeWidth, function (x) {
|
|
243
|
+
return x / 2;
|
|
244
|
+
}), ");\n background-position: ").concat(euiTheme.border.width.thin, ";\n background-image: url(\"").concat(refreshInlineSVG, "\");\n ") : "\n background-size: 100% ".concat(stateUnderlineHeight, ";\n background-image: url(\"").concat(inlineSVG, "\");\n ");
|
|
195
245
|
};
|
|
196
246
|
var euiPlaceholderPerBrowser = function euiPlaceholderPerBrowser(content) {
|
|
197
247
|
return "\n &::-webkit-input-placeholder { ".concat(content, " }\n &::-moz-placeholder { ").concat(content, " }\n &:-ms-input-placeholder { ").concat(content, " }\n &:-moz-placeholder { ").concat(content, " }\n &::placeholder { ").concat(content, " }\n");
|
|
@@ -8,18 +8,11 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
|
+
import { isEuiThemeRefreshVariant } from '../../../services';
|
|
11
12
|
import { euiTextTruncate, logicalCSS, mathWithUnits } from '../../../global_styling';
|
|
12
13
|
import { highContrastModeStyles } from '../../../global_styling/functions/high_contrast';
|
|
13
14
|
import { euiFormVariables } from '../form.styles';
|
|
14
15
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
15
|
-
name: "1w10n1m-inGroup",
|
|
16
|
-
styles: "flex-grow:1;overflow:hidden;label:inGroup;"
|
|
17
|
-
} : {
|
|
18
|
-
name: "1w10n1m-inGroup",
|
|
19
|
-
styles: "flex-grow:1;overflow:hidden;label:inGroup;",
|
|
20
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
21
|
-
};
|
|
22
|
-
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
23
16
|
name: "1lbfa6m-euiFormControlLayout__childrenWrapper",
|
|
24
17
|
styles: "position:relative;label:euiFormControlLayout__childrenWrapper;"
|
|
25
18
|
} : {
|
|
@@ -27,11 +20,24 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
|
27
20
|
styles: "position:relative;label:euiFormControlLayout__childrenWrapper;",
|
|
28
21
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
29
22
|
};
|
|
23
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
24
|
+
name: "12dhv84-euiFormControlLayout",
|
|
25
|
+
styles: "position:relative;z-index:0;label:euiFormControlLayout;"
|
|
26
|
+
} : {
|
|
27
|
+
name: "12dhv84-euiFormControlLayout",
|
|
28
|
+
styles: "position:relative;z-index:0;label:euiFormControlLayout;",
|
|
29
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
30
|
+
};
|
|
30
31
|
export var euiFormControlLayoutStyles = function euiFormControlLayoutStyles(euiThemeContext) {
|
|
31
32
|
var euiTheme = euiThemeContext.euiTheme;
|
|
33
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
32
34
|
var form = euiFormVariables(euiThemeContext);
|
|
35
|
+
var groupStyles = "\n /* use pseudo element for borders to prevent dimension changes and support nested elements better */\n &::after {\n content: '';\n position: absolute;\n inset: 0;\n z-index: 0;\n border: ".concat(euiTheme.border.width.thin, " solid ").concat(form.borderColor, ";\n border-radius: inherit;\n pointer-events: none;\n }\n\n /* the filter group will use the form layout border instead */\n .euiFilterGroup {\n border-radius: 0;\n /* creating extra space to prevent the focus indicator being cut off */\n ").concat(logicalCSS('padding-right', euiTheme.border.width.thin), "\n\n &::after {\n display: none;\n }\n }\n\n .euiFilterButton__wrapper:first-of-type::before,\n .euiFilterButton__wrapper::after {\n display: none;\n }\n ");
|
|
36
|
+
var wrapperGroupStyles = "\n > :first-child {\n ".concat(logicalCSS('border-top-left-radius', '0'), "\n ").concat(logicalCSS('border-bottom-left-radius', '0'), "\n }\n\n > :last-child {\n ").concat(logicalCSS('border-top-right-radius', '0'), "\n ").concat(logicalCSS('border-bottom-right-radius', '0'), "\n }\n ");
|
|
37
|
+
var prependOnlyStyles = "\n > :last-child {\n ".concat(logicalCSS('border-top-right-radius', 'inherit'), "\n ").concat(logicalCSS('border-bottom-right-radius', 'inherit'), "\n }\n ");
|
|
38
|
+
var appendOnlyStyles = "\n > :first-child {\n ".concat(logicalCSS('border-top-left-radius', 'inherit'), "\n ").concat(logicalCSS('border-bottom-left-radius', 'inherit'), "\n }\n ");
|
|
33
39
|
return {
|
|
34
|
-
euiFormControlLayout:
|
|
40
|
+
euiFormControlLayout: _ref2,
|
|
35
41
|
// Skip the css`` on the default height to avoid generating a className
|
|
36
42
|
uncompressed: "\n ".concat(logicalCSS('height', form.controlHeight), "\n "),
|
|
37
43
|
compressed: /*#__PURE__*/css(logicalCSS('height', form.controlCompressedHeight), ";;label:compressed;"),
|
|
@@ -39,36 +45,41 @@ export var euiFormControlLayoutStyles = function euiFormControlLayoutStyles(euiT
|
|
|
39
45
|
formWidth: "\n ".concat(logicalCSS('max-width', form.maxWidth), "\n ").concat(logicalCSS('width', '100%'), "\n "),
|
|
40
46
|
fullWidth: /*#__PURE__*/css(logicalCSS('max-width', '100%'), " ", logicalCSS('width', '100%'), ";;label:fullWidth;"),
|
|
41
47
|
group: {
|
|
42
|
-
group: /*#__PURE__*/css("display:flex;align-items:stretch;border:", euiTheme.border.width.thin, " solid "
|
|
48
|
+
group: /*#__PURE__*/css("position:relative;display:flex;align-items:stretch;border:", isRefreshVariant ? 'none' : "".concat(euiTheme.border.width.thin, " solid ").concat(form.borderColor), ";background-color:", form.backgroundColor, ";overflow:hidden;", isRefreshVariant && groupStyles, ">*{", logicalCSS('height', '100%'), ";};label:group;"),
|
|
43
49
|
// Skipping css`` to avoid repeated compressed/uncompressed classNames
|
|
44
50
|
uncompressed: "\n border-radius: ".concat(form.controlBorderRadius, ";\n "),
|
|
45
51
|
compressed: "\n border-radius: ".concat(form.controlCompressedBorderRadius, ";\n ")
|
|
46
52
|
},
|
|
47
53
|
children: {
|
|
48
|
-
euiFormControlLayout__childrenWrapper:
|
|
49
|
-
inGroup:
|
|
50
|
-
prependOnly: /*#__PURE__*/css(logicalCSS('border-top-right-radius', 'inherit'), " ", logicalCSS('border-bottom-right-radius', 'inherit'), ";;label:prependOnly;"),
|
|
51
|
-
appendOnly: /*#__PURE__*/css(logicalCSS('border-top-left-radius', 'inherit'), " ", logicalCSS('border-bottom-left-radius', 'inherit'), ";;label:appendOnly;")
|
|
54
|
+
euiFormControlLayout__childrenWrapper: _ref,
|
|
55
|
+
inGroup: /*#__PURE__*/css("flex-grow:1;overflow:hidden;", isRefreshVariant && wrapperGroupStyles, ";;label:inGroup;"),
|
|
56
|
+
prependOnly: /*#__PURE__*/css(logicalCSS('border-top-right-radius', 'inherit'), " ", logicalCSS('border-bottom-right-radius', 'inherit'), " ", isRefreshVariant && prependOnlyStyles, ";;label:prependOnly;"),
|
|
57
|
+
appendOnly: /*#__PURE__*/css(logicalCSS('border-top-left-radius', 'inherit'), " ", logicalCSS('border-bottom-left-radius', 'inherit'), " ", isRefreshVariant && appendOnlyStyles, ";;label:appendOnly;")
|
|
52
58
|
}
|
|
53
59
|
};
|
|
54
60
|
};
|
|
55
61
|
export var euiFormControlLayoutSideNodeStyles = function euiFormControlLayoutSideNodeStyles(euiThemeContext) {
|
|
56
62
|
var euiTheme = euiThemeContext.euiTheme;
|
|
63
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
57
64
|
var form = euiFormVariables(euiThemeContext);
|
|
58
65
|
var uncompressedHeight = mathWithUnits([form.controlHeight, euiTheme.border.width.thin], function (x, y) {
|
|
59
|
-
return x - y * 2;
|
|
66
|
+
return isRefreshVariant ? x : x - y * 2;
|
|
60
67
|
});
|
|
61
68
|
var compressedHeight = mathWithUnits([form.controlCompressedHeight, euiTheme.border.width.thin], function (x, y) {
|
|
62
|
-
return x - y * 2;
|
|
69
|
+
return isRefreshVariant ? x : x - y * 2;
|
|
63
70
|
});
|
|
64
71
|
var buttons = '*:is(.euiButton, .euiButtonEmpty, .euiButtonIcon)';
|
|
65
72
|
var text = '*:is(.euiFormLabel, .euiText)';
|
|
73
|
+
var appendStyles = "\n position: relative;\n ".concat(logicalCSS('margin-left', "-".concat(euiTheme.border.width.thin)), "\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n border-inline-start: \n ").concat(euiTheme.border.width.thin, " solid ").concat(form.borderColor, ";\n }\n ");
|
|
74
|
+
var prependStyles = "\n position: relative;\n ".concat(logicalCSS('margin-right', "-".concat(euiTheme.border.width.thin)), "\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n z-index: 1;\n pointer-events: none;\n border-inline-end: \n ").concat(euiTheme.border.width.thin, " solid ").concat(form.borderColor, ";\n }\n ");
|
|
66
75
|
return {
|
|
67
|
-
euiFormControlLayout__side: /*#__PURE__*/css(logicalCSS('height', '100%'), " ", euiTextTruncate('50%'), " flex-shrink:0;display:flex;align-items:center;gap:", euiTheme.size.xs, ";background-color:", form.appendPrependBackground, ";", buttons, "{transform:none!important;&:focus-visible{outline-offset:-", euiTheme.focus.width, ";}}", text, "{cursor:default;overflow:hidden;text-overflow:ellipsis;}&:not(:has(> ", buttons, ":first-child, > *:first-child > ", buttons, ")){", logicalCSS('padding-left', euiTheme.size.s), ";}&:not(:has(> ", buttons, ":last-child, > *:last-child > ", buttons, ")){", logicalCSS('padding-right', euiTheme.size.s), ";};label:euiFormControlLayout__side;"),
|
|
76
|
+
euiFormControlLayout__side: /*#__PURE__*/css(logicalCSS('height', '100%'), " ", euiTextTruncate('50%'), " flex-shrink:0;display:flex;align-items:center;gap:", euiTheme.size.xs, ";background-color:", form.appendPrependBackground, ";", buttons, "{transform:none!important;line-height:1;&:focus-visible{outline-offset:-", euiTheme.focus.width, ";}}", text, "{cursor:default;overflow:hidden;text-overflow:ellipsis;}&:not(:has(> ", buttons, ":first-child, > *:first-child > ", buttons, ")){", logicalCSS('padding-left', euiTheme.size.s), ";}&:not(:has(> ", buttons, ":last-child, > *:last-child > ", buttons, ")){", logicalCSS('padding-right', euiTheme.size.s), ";};label:euiFormControlLayout__side;"),
|
|
68
77
|
append: /*#__PURE__*/css(highContrastModeStyles(euiThemeContext, {
|
|
78
|
+
none: "\n ".concat(isRefreshVariant && appendStyles, "\n "),
|
|
69
79
|
preferred: logicalCSS('border-left', euiTheme.border.thin)
|
|
70
80
|
}), ";label:append;"),
|
|
71
81
|
prepend: /*#__PURE__*/css(highContrastModeStyles(euiThemeContext, {
|
|
82
|
+
none: "\n ".concat(isRefreshVariant && prependStyles, "\n "),
|
|
72
83
|
preferred: logicalCSS('border-right', euiTheme.border.thin)
|
|
73
84
|
}), ";label:prepend;"),
|
|
74
85
|
uncompressed: "\n ".concat(text, " {\n ").concat(logicalCSS('padding-horizontal', euiTheme.size.xs), "\n line-height: ").concat(uncompressedHeight, ";\n }\n\n ").concat(buttons, " {\n ").concat(logicalCSS('height', uncompressedHeight), "\n }\n\n .euiButtonIcon {\n flex-shrink: 0;\n ").concat(logicalCSS('width', euiTheme.size.xl), "\n }\n "),
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
|
|
9
9
|
import { css } from '@emotion/react';
|
|
10
10
|
import { logicalSizeCSS, mathWithUnits } from '../../../global_styling';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
highContrastMode =
|
|
15
|
-
var
|
|
16
|
-
? euiTheme.colors.darkShade : euiTheme.
|
|
11
|
+
import { isEuiThemeRefreshVariant } from '../../../services';
|
|
12
|
+
export var EuiFormControlLayoutClearButtonStyles = function EuiFormControlLayoutClearButtonStyles(euiThemeContext) {
|
|
13
|
+
var euiTheme = euiThemeContext.euiTheme,
|
|
14
|
+
highContrastMode = euiThemeContext.highContrastMode;
|
|
15
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
16
|
+
var backgroundColor = highContrastMode ? euiTheme.colors.darkShade : euiTheme.components.forms.clearButtonBackground;
|
|
17
17
|
return {
|
|
18
|
-
euiFormControlLayoutClearButton: /*#__PURE__*/css("pointer-events:all;display:flex;justify-content:center;align-items:center;border-radius:50%;border-style:solid;border-color:", backgroundColor, ";&:disabled{cursor:not-allowed;background-color:", euiTheme.colors.disabled, ";};label:euiFormControlLayoutClearButton;"),
|
|
18
|
+
euiFormControlLayoutClearButton: /*#__PURE__*/css("pointer-events:all;display:flex;justify-content:center;align-items:center;border-radius:50%;border-style:solid;border-color:", backgroundColor, ";&:disabled{cursor:not-allowed;background-color:", isRefreshVariant ? euiTheme.colors.backgroundBaseDisabled : euiTheme.colors.disabled, ";};label:euiFormControlLayoutClearButton;"),
|
|
19
19
|
size: {
|
|
20
20
|
s: "\n ".concat(logicalSizeCSS(euiTheme.size.m), "\n border-width: ").concat(mathWithUnits(euiTheme.size.m, function (x) {
|
|
21
21
|
return x / 2;
|
|
@@ -19,7 +19,7 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
19
19
|
import React from 'react';
|
|
20
20
|
import PropTypes from "prop-types";
|
|
21
21
|
import classNames from 'classnames';
|
|
22
|
-
import { useEuiMemoizedStyles, cloneElementWithCss } from '../../../services';
|
|
22
|
+
import { useEuiMemoizedStyles, cloneElementWithCss, useEuiTheme, useEuiThemeRefreshVariant } from '../../../services';
|
|
23
23
|
import { useEuiI18n } from '../../i18n';
|
|
24
24
|
import { EuiIcon } from '../../icon';
|
|
25
25
|
import { EuiText } from '../../text';
|
|
@@ -35,6 +35,8 @@ export var EuiFormControlLayoutDelimited = function EuiFormControlLayoutDelimite
|
|
|
35
35
|
className = _ref.className,
|
|
36
36
|
_fullWidth = _ref.fullWidth,
|
|
37
37
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
38
|
+
var euiThemeContext = useEuiTheme();
|
|
39
|
+
var isRefreshVariant = useEuiThemeRefreshVariant('formVariant');
|
|
38
40
|
var _useFormContext = useFormContext(),
|
|
39
41
|
defaultFullWidth = _useFormContext.defaultFullWidth;
|
|
40
42
|
var fullWidth = _fullWidth !== null && _fullWidth !== void 0 ? _fullWidth : defaultFullWidth;
|
|
@@ -47,7 +49,7 @@ export var EuiFormControlLayoutDelimited = function EuiFormControlLayoutDelimite
|
|
|
47
49
|
});
|
|
48
50
|
var styles = useEuiMemoizedStyles(euiFormControlLayoutDelimitedStyles);
|
|
49
51
|
var cssStyles = [styles.delimited, rest.isDisabled && styles.disabled, rest.readOnly && styles.readOnly];
|
|
50
|
-
var wrapperStyles = [styles.childrenWrapper.delimited, showInvalidState && styles.childrenWrapper.invalid, (_rest$wrapperProps = rest.wrapperProps) === null || _rest$wrapperProps === void 0 ? void 0 : _rest$wrapperProps.css];
|
|
52
|
+
var wrapperStyles = [styles.childrenWrapper.delimited, showInvalidState && styles.childrenWrapper.invalid, (_rest$wrapperProps = rest.wrapperProps) === null || _rest$wrapperProps === void 0 ? void 0 : _rest$wrapperProps.css, isRefreshVariant && rest.readOnly && styles.childrenWrapper.readOnly];
|
|
51
53
|
return ___EmotionJSX(EuiFormControlLayout, _extends({
|
|
52
54
|
isDelimited: true,
|
|
53
55
|
css: cssStyles,
|
|
@@ -62,10 +64,10 @@ export var EuiFormControlLayoutDelimited = function EuiFormControlLayoutDelimite
|
|
|
62
64
|
value: {
|
|
63
65
|
defaultFullWidth: fullWidth
|
|
64
66
|
}
|
|
65
|
-
}, startControl && addClassesToControl(startControl), ___EmotionJSX(EuiFormControlDelimiter, {
|
|
67
|
+
}, startControl && addClassesToControl(euiThemeContext, startControl), ___EmotionJSX(EuiFormControlDelimiter, {
|
|
66
68
|
delimiter: delimiter,
|
|
67
69
|
isInvalid: showInvalidState
|
|
68
|
-
}), endControl && addClassesToControl(endControl)));
|
|
70
|
+
}), endControl && addClassesToControl(euiThemeContext, endControl)));
|
|
69
71
|
};
|
|
70
72
|
EuiFormControlLayoutDelimited.propTypes = {
|
|
71
73
|
/**
|
|
@@ -83,18 +85,19 @@ EuiFormControlLayoutDelimited.propTypes = {
|
|
|
83
85
|
delimiter: PropTypes.node,
|
|
84
86
|
className: PropTypes.string
|
|
85
87
|
};
|
|
86
|
-
var addClassesToControl = function addClassesToControl(control) {
|
|
88
|
+
var addClassesToControl = function addClassesToControl(euiThemeContext, control) {
|
|
87
89
|
return cloneElementWithCss(control, {
|
|
88
|
-
css: euiFormControlLayoutDelimited__input,
|
|
90
|
+
css: euiFormControlLayoutDelimited__input(euiThemeContext),
|
|
89
91
|
className: classNames(control.props.className, 'euiFormControlLayoutDelimited__input')
|
|
90
92
|
}, 'before');
|
|
91
93
|
};
|
|
92
94
|
var EuiFormControlDelimiter = function EuiFormControlDelimiter(_ref2) {
|
|
93
95
|
var delimiter = _ref2.delimiter,
|
|
94
96
|
isInvalid = _ref2.isInvalid;
|
|
97
|
+
var euiThemeContext = useEuiTheme();
|
|
95
98
|
var defaultAriaLabel = useEuiI18n('euiFormControlLayoutDelimited.delimiterLabel', 'to');
|
|
96
99
|
return ___EmotionJSX(EuiText, {
|
|
97
|
-
css: euiFormControlLayoutDelimited__delimiter,
|
|
100
|
+
css: euiFormControlLayoutDelimited__delimiter(euiThemeContext),
|
|
98
101
|
className: "euiFormControlLayoutDelimited__delimiter",
|
|
99
102
|
size: "s",
|
|
100
103
|
color: isInvalid ? 'danger' : 'subdued'
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
2
1
|
/*
|
|
3
2
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
3
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -8,45 +7,51 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
8
7
|
*/
|
|
9
8
|
|
|
10
9
|
import { css } from '@emotion/react';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
name: "1o1b8cl-delimited",
|
|
15
|
-
styles: "display:flex;label:delimited;"
|
|
16
|
-
} : {
|
|
17
|
-
name: "1o1b8cl-delimited",
|
|
18
|
-
styles: "display:flex;label:delimited;",
|
|
19
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
20
|
-
};
|
|
10
|
+
import { isEuiThemeRefreshVariant } from '../../../services';
|
|
11
|
+
import { logicalCSS, mathWithUnits } from '../../../global_styling';
|
|
12
|
+
import { euiFormControlDisabledStyles, euiFormControlReadOnlyStyles, euiFormControlDefaultShadow, euiFormControlInvalidStyles, euiFormControlHoverStyles, euiFormVariables } from '../form.styles';
|
|
21
13
|
export var euiFormControlLayoutDelimitedStyles = function euiFormControlLayoutDelimitedStyles(euiThemeContext) {
|
|
14
|
+
var highContrastMode = euiThemeContext.highContrastMode;
|
|
15
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
16
|
+
var form = euiFormVariables(euiThemeContext);
|
|
17
|
+
var invalidStyles = isRefreshVariant ? "\n :not(.euiFormControlLayoutDelimited__input, .euiFormControlLayoutDelimited__delimiter) {\n ".concat(euiFormControlInvalidStyles(euiThemeContext), "\n }\n\n &:focus-within {\n --euiFormControlStateColor: ").concat(form.borderColor, ";\n --euiFormControlStateHoverColor: ").concat(form.borderHovered, ";\n }\n\n .euiFormControlLayoutDelimited__input {\n background-color: transparent;\n }\n ") : "\n ".concat(euiFormControlInvalidStyles(euiThemeContext), ";\n ");
|
|
18
|
+
var readOnlyStyles = "\n & .euiFormControlLayoutDelimited__input {\n outline: none; \n box-shadow: none;\n --euiFormControlStateColor: transparent;\n }\n ";
|
|
19
|
+
var delimitedStyles = "\n /* Transition smoothly between disabled/readOnly background color changes */\n ".concat(euiFormControlDefaultShadow(euiThemeContext, {
|
|
20
|
+
withBorder: isRefreshVariant && !highContrastMode ? true : false,
|
|
21
|
+
withBackground: false,
|
|
22
|
+
withBackgroundAnimation: isRefreshVariant ? false : true
|
|
23
|
+
}), "\n ").trim();
|
|
24
|
+
var delimitedWrapperStyles = "\n ".concat(euiFormControlDefaultShadow(euiThemeContext, {
|
|
25
|
+
withBorder: !highContrastMode,
|
|
26
|
+
withBackground: false,
|
|
27
|
+
withBackgroundAnimation: true
|
|
28
|
+
}), "\n \n &:hover {\n ").concat(euiFormControlHoverStyles(euiThemeContext), "\n box-shadow: none;\n\n /* using hover styling on wrapper instead of the children inputs */\n .euiFormControlLayoutDelimited__input:not(:focus) {\n outline: none;\n background-color: transparent;\n }\n }\n\n /* adjust for delimited behavior differing from default form layout */\n > :first-child {\n ").concat(logicalCSS('border-top-left-radius', 'inherit'), "\n ").concat(logicalCSS('border-bottom-left-radius', 'inherit'), "\n }\n\n > :last-child {\n ").concat(logicalCSS('border-top-right-radius', 'inherit'), "\n ").concat(logicalCSS('border-bottom-right-radius', 'inherit'), "\n }\n ");
|
|
22
29
|
return {
|
|
23
30
|
// Appended onto existing `euiFormControlLayout` styles
|
|
24
|
-
delimited: /*#__PURE__*/css(
|
|
25
|
-
// Transition smoothly between disabled/readOnly background color changes
|
|
26
|
-
euiFormControlDefaultShadow(euiThemeContext, {
|
|
27
|
-
withBorder: false,
|
|
28
|
-
withBackground: false,
|
|
29
|
-
withBackgroundAnimation: true
|
|
30
|
-
}), ";label:delimited;"),
|
|
31
|
+
delimited: /*#__PURE__*/css(delimitedStyles, ";label:delimited;"),
|
|
31
32
|
disabled: /*#__PURE__*/css(euiFormControlDisabledStyles(euiThemeContext), ";label:disabled;"),
|
|
32
|
-
readOnly: /*#__PURE__*/css(euiFormControlReadOnlyStyles(euiThemeContext), "
|
|
33
|
+
readOnly: /*#__PURE__*/css(euiFormControlReadOnlyStyles(euiThemeContext), " ", isRefreshVariant && readOnlyStyles, ";;label:readOnly;"),
|
|
33
34
|
// Appended onto existing `euiFormControlLayout__childrenWrapper` styles
|
|
34
35
|
childrenWrapper: {
|
|
35
|
-
delimited:
|
|
36
|
+
delimited: /*#__PURE__*/css("display:flex;", isRefreshVariant && delimitedWrapperStyles, ";;label:delimited;"),
|
|
36
37
|
invalid: /*#__PURE__*/css(euiFormControlDefaultShadow(euiThemeContext, {
|
|
37
38
|
withBorder: false,
|
|
38
39
|
withBackgroundColor: false,
|
|
39
40
|
withBackgroundAnimation: false
|
|
40
|
-
}),
|
|
41
|
+
}), "\n ".concat(invalidStyles, "\n "), ";label:invalid;"),
|
|
42
|
+
readOnly: /*#__PURE__*/css(";label:readOnly;")
|
|
41
43
|
}
|
|
42
44
|
};
|
|
43
45
|
};
|
|
44
|
-
export var euiFormControlLayoutDelimited__delimiter =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
export var euiFormControlLayoutDelimited__delimiter = function euiFormControlLayoutDelimited__delimiter(euiThemeContext) {
|
|
47
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
48
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
49
|
+
var experimentalStyles = isRefreshVariant && "\n ".concat(logicalCSS('padding-horizontal', mathWithUnits([euiTheme.size.xs, euiTheme.size.xxs], function (x, y) {
|
|
50
|
+
return x + y;
|
|
51
|
+
})), "\n ");
|
|
52
|
+
return /*#__PURE__*/css("display:flex;align-self:stretch;flex-grow:0;align-items:center;line-height:1;", experimentalStyles, ";;label:euiFormControlLayoutDelimited__delimiter;");
|
|
51
53
|
};
|
|
52
|
-
export var euiFormControlLayoutDelimited__input =
|
|
54
|
+
export var euiFormControlLayoutDelimited__input = function euiFormControlLayoutDelimited__input(euiThemeContext) {
|
|
55
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
56
|
+
return /*#__PURE__*/css("box-shadow:none;border:none;border-radius:", isRefreshVariant ? '' : '0', ";text-align:center;", logicalCSS('height', '100%'), ";;label:euiFormControlLayoutDelimited__input;");
|
|
57
|
+
};
|
|
@@ -31,7 +31,7 @@ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf
|
|
|
31
31
|
|
|
32
32
|
import React, { Component } from 'react';
|
|
33
33
|
import PropTypes from "prop-types";
|
|
34
|
-
import { RenderWithEuiStylesMemoizer } from '../../../services';
|
|
34
|
+
import { isEuiThemeRefreshVariant, RenderWithEuiStylesMemoizer, RenderWithEuiTheme } from '../../../services';
|
|
35
35
|
import { EuiIcon } from '../../icon';
|
|
36
36
|
import { EuiLoadingSpinner } from '../../loading';
|
|
37
37
|
import { EuiFormControlLayoutClearButton } from './form_control_layout_clear_button';
|
|
@@ -90,11 +90,14 @@ export var EuiFormControlLayoutIcons = /*#__PURE__*/function (_Component) {
|
|
|
90
90
|
var iconRef = iconProps.ref,
|
|
91
91
|
side = iconProps.side,
|
|
92
92
|
iconRest = _objectWithoutProperties(iconProps, _excluded);
|
|
93
|
-
return ___EmotionJSX(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
93
|
+
return ___EmotionJSX(RenderWithEuiTheme, null, function (euiThemeContext) {
|
|
94
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
95
|
+
return ___EmotionJSX(EuiFormControlLayoutCustomIcon, _extends({
|
|
96
|
+
size: compressed && !isRefreshVariant ? 's' : 'm',
|
|
97
|
+
disabled: isDisabled,
|
|
98
|
+
iconRef: iconRef
|
|
99
|
+
}, iconRest));
|
|
100
|
+
});
|
|
98
101
|
}
|
|
99
102
|
}, {
|
|
100
103
|
key: "renderDropdownIcon",
|
|
@@ -106,10 +109,13 @@ export var EuiFormControlLayoutIcons = /*#__PURE__*/function (_Component) {
|
|
|
106
109
|
if (!isDropdown) {
|
|
107
110
|
return null;
|
|
108
111
|
}
|
|
109
|
-
return ___EmotionJSX(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
return ___EmotionJSX(RenderWithEuiTheme, null, function (euiThemeContext) {
|
|
113
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
114
|
+
return ___EmotionJSX(EuiFormControlLayoutCustomIcon, {
|
|
115
|
+
size: compressed && !isRefreshVariant ? 's' : 'm',
|
|
116
|
+
disabled: isDisabled,
|
|
117
|
+
type: "arrowDown"
|
|
118
|
+
});
|
|
113
119
|
});
|
|
114
120
|
}
|
|
115
121
|
}, {
|
|
@@ -121,8 +127,11 @@ export var EuiFormControlLayoutIcons = /*#__PURE__*/function (_Component) {
|
|
|
121
127
|
if (!isLoading) {
|
|
122
128
|
return null;
|
|
123
129
|
}
|
|
124
|
-
return ___EmotionJSX(
|
|
125
|
-
|
|
130
|
+
return ___EmotionJSX(RenderWithEuiTheme, null, function (euiThemeContext) {
|
|
131
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
132
|
+
return ___EmotionJSX(EuiLoadingSpinner, {
|
|
133
|
+
size: compressed && !isRefreshVariant ? 's' : 'm'
|
|
134
|
+
});
|
|
126
135
|
});
|
|
127
136
|
}
|
|
128
137
|
}, {
|
|
@@ -135,10 +144,13 @@ export var EuiFormControlLayoutIcons = /*#__PURE__*/function (_Component) {
|
|
|
135
144
|
if (!clear) {
|
|
136
145
|
return null;
|
|
137
146
|
}
|
|
138
|
-
return ___EmotionJSX(
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
147
|
+
return ___EmotionJSX(RenderWithEuiTheme, null, function (euiThemeContext) {
|
|
148
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
149
|
+
return ___EmotionJSX(EuiFormControlLayoutClearButton, _extends({
|
|
150
|
+
size: compressed && !isRefreshVariant ? 's' : 'm',
|
|
151
|
+
disabled: isDisabled
|
|
152
|
+
}, clear));
|
|
153
|
+
});
|
|
142
154
|
}
|
|
143
155
|
}, {
|
|
144
156
|
key: "renderInvalidIcon",
|
|
@@ -149,10 +161,13 @@ export var EuiFormControlLayoutIcons = /*#__PURE__*/function (_Component) {
|
|
|
149
161
|
if (!isInvalid) {
|
|
150
162
|
return null;
|
|
151
163
|
}
|
|
152
|
-
return ___EmotionJSX(
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
164
|
+
return ___EmotionJSX(RenderWithEuiTheme, null, function (euiThemeContext) {
|
|
165
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
166
|
+
return ___EmotionJSX(EuiIcon, {
|
|
167
|
+
size: compressed && !isRefreshVariant ? 's' : 'm',
|
|
168
|
+
color: "danger",
|
|
169
|
+
type: "warning"
|
|
170
|
+
});
|
|
156
171
|
});
|
|
157
172
|
}
|
|
158
173
|
}]);
|