@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
|
@@ -10,8 +10,14 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
11
|
import { euiShadowMedium } from '@elastic/eui-theme-common';
|
|
12
12
|
import { logicalCSS } from '../../global_styling';
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
import { isEuiThemeRefreshVariant } from '../../services';
|
|
14
|
+
import { disableFormControlHoverStyles } from '../form/form.styles';
|
|
15
|
+
export var euiDatePickerRangeStyles = function euiDatePickerRangeStyles(euiThemeContext) {
|
|
16
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
17
|
+
var refreshStyles = "\n .euiPopover:last-child {\n ".concat(logicalCSS('border-top-right-radius', 'inherit'), "\n ").concat(logicalCSS('border-bottom-right-radius', 'inherit'), "\n\n * {\n ").concat(logicalCSS('border-top-right-radius', 'inherit'), "\n ").concat(logicalCSS('border-bottom-right-radius', 'inherit'), "\n }\n }\n ");
|
|
18
|
+
return {
|
|
19
|
+
euiDatePickerRange: /*#__PURE__*/css(".euiPopover,.react-datepicker__input-container,.euiDatePicker{", logicalCSS('height', '100%'), ";}.euiPopover{flex:1;}", isRefreshVariant && refreshStyles, ";;label:euiDatePickerRange;")
|
|
20
|
+
};
|
|
15
21
|
};
|
|
16
22
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
17
23
|
name: "bicgs9-noShadow",
|
|
@@ -23,6 +29,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
23
29
|
};
|
|
24
30
|
export var euiDatePickerRangeInlineStyles = function euiDatePickerRangeInlineStyles(euiThemeContext) {
|
|
25
31
|
var euiTheme = euiThemeContext.euiTheme;
|
|
32
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
26
33
|
|
|
27
34
|
// Use a container query to stack date pickers vertically if the container is
|
|
28
35
|
// not wide enough to fit both. We need a fn for this to render two width queries,
|
|
@@ -32,12 +39,12 @@ export var euiDatePickerRangeInlineStyles = function euiDatePickerRangeInlineSty
|
|
|
32
39
|
return "\n display: block;\n container-type: inline-size;\n\n .euiFormControlLayout__childrenWrapper {\n /* Use static px widths for now, since render behavior comes from a third party library */\n @container (max-width: ".concat(datePickerWidth * 2 + delimiterWidth, "px) {\n /* Unset grid display */\n display: block !important;\n\n /* Center and point the default delimiter arrow downwards */\n .euiFormControlLayoutDelimited__delimiter .euiIcon {\n transform: rotate(90deg);\n margin-inline: auto;\n }\n }\n }");
|
|
33
40
|
};
|
|
34
41
|
return {
|
|
35
|
-
euiDatePickerRangeInline: /*#__PURE__*/css(".euiFormControlLayoutDelimited{", logicalCSS('height', 'auto'), " ", logicalCSS('width', 'fit-content'), " ", logicalCSS('max-width', '100%'), " border:none;padding:0;.euiFormControlLayout__childrenWrapper{display:grid;grid-template-columns:1fr auto 1fr;grid-template-rows:auto;align-items:stretch;background-color:transparent;}.euiFormControlLayoutIcons{justify-content:center;grid-column:1/span 3;", logicalCSS('height', 'auto'), " ", logicalCSS('padding-bottom', euiTheme.size.s), ";}}.react-datepicker{position:relative;};label:euiDatePickerRangeInline;"),
|
|
42
|
+
euiDatePickerRangeInline: /*#__PURE__*/css(".euiFormControlLayoutDelimited{", logicalCSS('height', 'auto'), " ", logicalCSS('width', 'fit-content'), " ", logicalCSS('max-width', '100%'), " border:none;padding:0;", isRefreshVariant && "\n &::after {\n display: none;\n }\n ", ";.euiFormControlLayout__childrenWrapper{display:grid;grid-template-columns:1fr auto 1fr;grid-template-rows:auto;align-items:stretch;background-color:transparent;}.euiFormControlLayoutIcons{justify-content:center;grid-column:1/span 3;", logicalCSS('height', 'auto'), " ", logicalCSS('padding-bottom', euiTheme.size.s), ";}}.react-datepicker{position:relative;};label:euiDatePickerRangeInline;"),
|
|
36
43
|
responsive: /*#__PURE__*/css(containerQuery(268), ";;label:responsive;"),
|
|
37
44
|
responsiveWithTimeSelect: /*#__PURE__*/css(containerQuery(374), ";;label:responsiveWithTimeSelect;"),
|
|
38
45
|
shadow: /*#__PURE__*/css(".euiFormControlLayoutDelimited{", euiShadowMedium(euiThemeContext, {
|
|
39
46
|
borderAllInHighContrastMode: true
|
|
40
|
-
}), ";};label:shadow;"),
|
|
47
|
+
}), " ", isRefreshVariant && "\n /* the form layout is not part of the interactive behavior but rather a container in this variant */\n ".concat(disableFormControlHoverStyles(), "\n\n .euiFormControlLayout__childrenWrapper {\n box-shadow: none;\n ").concat(disableFormControlHoverStyles(), "\n }\n "), ";};label:shadow;"),
|
|
41
48
|
// Applied directly to EuiFormControlLayout so we can check if `disabled`
|
|
42
49
|
// and allow the disabled background-color to take precedence
|
|
43
50
|
formLayout: {
|
|
@@ -8,10 +8,10 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
|
-
import { makeHighContrastColor } from '../../../services';
|
|
11
|
+
import { isEuiThemeRefreshVariant, makeHighContrastColor } from '../../../services';
|
|
12
12
|
import { euiFontSize, euiMaxBreakpoint, logicalCSS, mathWithUnits } from '../../../global_styling';
|
|
13
13
|
import { highContrastModeStyles } from '../../../global_styling/functions/high_contrast';
|
|
14
|
-
import { euiFormVariables, euiFormControlDefaultShadow, euiFormControlInvalidStyles, euiFormControlDisabledStyles,
|
|
14
|
+
import { euiFormVariables, euiFormControlDefaultShadow, euiFormControlInvalidStyles, euiFormControlDisabledStyles, euiFormControlShowBackgroundLine, euiFormControlFocusStyles, euiFormControlHighlightBorderStyles } from '../../form/form.styles';
|
|
15
15
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
16
16
|
name: "1e4qgxg-euiSuperDatePicker__range",
|
|
17
17
|
styles: "flex-grow:1;overflow:hidden;label:euiSuperDatePicker__range;"
|
|
@@ -22,6 +22,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
22
22
|
};
|
|
23
23
|
export var euiSuperDatePickerStyles = function euiSuperDatePickerStyles(euiThemeContext) {
|
|
24
24
|
var euiTheme = euiThemeContext.euiTheme;
|
|
25
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
25
26
|
var forms = euiFormVariables(euiThemeContext);
|
|
26
27
|
var inputWidth = euiTheme.base * 30;
|
|
27
28
|
var buttonWidth = euiTheme.base * 7; // @see _button_display.styles.ts
|
|
@@ -41,6 +42,18 @@ export var euiSuperDatePickerStyles = function euiSuperDatePickerStyles(euiTheme
|
|
|
41
42
|
// Needs updating colors
|
|
42
43
|
var needsUpdatingBackgroundColor = euiTheme.components.superDatePickerBackgroundSuccees;
|
|
43
44
|
var needsUpdatingTextColor = makeHighContrastColor(euiTheme.colors.success)(needsUpdatingBackgroundColor);
|
|
45
|
+
var formLayoutStyles = "\n /* using wrapper hover styles instead */\n .euiDatePopoverButton:not(.euiDatePopoverButton-isSelected):hover {\n outline: none;\n }\n\n .euiPopover {\n /* mimic input border-radius */\n border-radius: ".concat(forms.controlBorderRadius, ";\n\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 }\n\n .euiDatePopoverButton {\n background-color: transparent;\n border-radius: inherit;\n }\n ");
|
|
46
|
+
var popoverButtonFocusStyles = isRefreshVariant ? "\n ".concat(euiFormControlFocusStyles(euiThemeContext), "\n ") : "\n --euiFormControlStateColor: ".concat(euiTheme.colors.primary, ";\n ").concat(euiFormControlShowBackgroundLine(euiThemeContext, euiTheme.colors.primary), "\n ");
|
|
47
|
+
var invalidStyles = isRefreshVariant ? "\n &:has(.euiPopover-isOpen, .euiDatePopoverButton:focus) {\n --euiFormControlStateColor: ".concat(forms.borderColor, ";\n --euiFormControlStateHoverColor: ").concat(forms.borderHovered, ";\n }\n\n &:not(:has(.euiPopover-isOpen, .euiDatePopoverButton:focus)) {\n ").concat(euiFormControlInvalidStyles(euiThemeContext), "\n }\n\n .euiDatePopoverButton:focus,\n .euiPopover-isOpen .euiDatePopoverButton {\n ").concat(euiFormControlFocusStyles(euiThemeContext), "\n }\n ") : "\n ".concat(euiFormControlInvalidStyles(euiThemeContext), "\n ");
|
|
48
|
+
var needsUpdatingStyles = "\n --euiFormControlStateColor: ".concat(euiTheme.colors.success, ";\n --euiFormControlStateHoverColor: ").concat(euiTheme.colors.success, ";\n --euiFormControlStateWidth: ").concat(euiTheme.border.width.thin, ";\n ").concat(euiFormControlHighlightBorderStyles, "\n \n &:has(.euiPopover-isOpen),\n &:focus-within {\n --euiFormControlStateColor: ").concat(forms.borderColor, ";\n --euiFormControlStateHoverColor: ").concat(forms.borderHovered, ";\n }\n ");
|
|
49
|
+
var needsUpdatingPopoverButtonFocusStyles = isRefreshVariant ? "\n ".concat(euiFormControlFocusStyles(euiThemeContext), "\n ") : "\n --euiFormControlStateColor: ".concat(euiTheme.colors.success, ";\n ").concat(euiFormControlShowBackgroundLine(euiThemeContext, euiTheme.colors.success), "\n\n ").concat(highContrastModeStyles(euiThemeContext, {
|
|
50
|
+
// Force the fill color of all icons/svgs to give a bit more indication of state,
|
|
51
|
+
// since Windows high contrast themes otherwise override background/text color
|
|
52
|
+
forced: "\n svg,\n & + * svg {\n fill: ".concat(euiTheme.colors.success, ";\n }\n ")
|
|
53
|
+
}), "\n ");
|
|
54
|
+
var prettyFormatStyles = "\n --euiFormControlStateHoverColor: ".concat(forms.borderHovered, ";\n ").concat(euiFormControlDefaultShadow(euiThemeContext), "\n \n ").concat(highContrastModeStyles(euiThemeContext, {
|
|
55
|
+
preferred: "\n border: none;\n "
|
|
56
|
+
}), "\n\n &:focus {\n ").concat(euiFormControlFocusStyles(euiThemeContext), "\n }\n ");
|
|
44
57
|
return {
|
|
45
58
|
euiSuperDatePicker: /*#__PURE__*/css("display:flex;gap:", gap, ";", logicalCSS('max-width', '100%'), " ", euiMaxBreakpoint(euiThemeContext, 'm'), "{", logicalCSS('width', '100%'), ";};label:euiSuperDatePicker;"),
|
|
46
59
|
widths: {
|
|
@@ -65,27 +78,23 @@ export var euiSuperDatePickerStyles = function euiSuperDatePickerStyles(euiTheme
|
|
|
65
78
|
isQuickSelectOnly: /*#__PURE__*/css(logicalCSS('min-width', 0), ".euiFormControlLayout__prepend{", logicalCSS('max-width', 'none'), ";};label:isQuickSelectOnly;"),
|
|
66
79
|
euiSuperDatePicker__range: _ref,
|
|
67
80
|
euiSuperDatePicker__rangeInput: /*#__PURE__*/css("flex-grow:1;", logicalCSS('width', 'auto'), " overflow:hidden;;label:euiSuperDatePicker__rangeInput;"),
|
|
68
|
-
euiSuperDatePicker__prettyFormat: /*#__PURE__*/css(_buttonStyles(euiThemeContext), " text-align:start;;label:euiSuperDatePicker__prettyFormat;"),
|
|
81
|
+
euiSuperDatePicker__prettyFormat: /*#__PURE__*/css(_buttonStyles(euiThemeContext), " text-align:start;", isRefreshVariant && prettyFormatStyles, ";;label:euiSuperDatePicker__prettyFormat;"),
|
|
69
82
|
// Form states
|
|
70
83
|
states: {
|
|
71
|
-
euiSuperDatePicker__formControlLayout: /*#__PURE__*/css(".euiFormControlLayout__childrenWrapper{", euiFormControlDefaultShadow(euiThemeContext), " ", highContrastModeStyles(euiThemeContext, {
|
|
84
|
+
euiSuperDatePicker__formControlLayout: /*#__PURE__*/css(".euiFormControlLayout__childrenWrapper{--euiFormControlStateHoverColor:", forms.borderHovered, ";", euiFormControlDefaultShadow(euiThemeContext), " ", highContrastModeStyles(euiThemeContext, {
|
|
72
85
|
none: 'box-shadow: none;',
|
|
73
86
|
preferred: 'border: none;'
|
|
74
|
-
}), ";};label:euiSuperDatePicker__formControlLayout;"),
|
|
75
|
-
default: /*#__PURE__*/css(".euiFormControlLayout__childrenWrapper{color:", forms.textColor, ";background-color:", forms.backgroundColor, ";}.euiDatePopoverButton{", euiFormControlDefaultShadow(euiThemeContext, {
|
|
87
|
+
}), " ", isRefreshVariant && formLayoutStyles, ";};label:euiSuperDatePicker__formControlLayout;"),
|
|
88
|
+
default: /*#__PURE__*/css(".euiFormControlLayout__childrenWrapper{color:", forms.textColor, ";background-color:", forms.backgroundColor, ";}.euiDatePopoverButton{--euiFormControlStateHoverColor:", forms.borderHovered, ";", !isRefreshVariant && euiFormControlDefaultShadow(euiThemeContext, {
|
|
76
89
|
withBorder: false,
|
|
77
90
|
withBackgroundColor: false
|
|
78
|
-
}), ";}.euiDatePopoverButton:focus,.euiPopover-isOpen .euiDatePopoverButton{
|
|
91
|
+
}), " box-shadow:none;}.euiDatePopoverButton:focus,.euiPopover-isOpen .euiDatePopoverButton{", popoverButtonFocusStyles, ";};label:default;"),
|
|
79
92
|
disabled: /*#__PURE__*/css(".euiFormControlLayout__childrenWrapper{", euiFormControlDisabledStyles(euiThemeContext), ";};label:disabled;"),
|
|
80
|
-
invalid: /*#__PURE__*/css(".euiFormControlLayout__childrenWrapper{color:", euiTheme.colors.textDanger, ";background-color:", forms.backgroundColor, ";",
|
|
81
|
-
needsUpdating: /*#__PURE__*/css(".euiFormControlLayout__childrenWrapper{color:", needsUpdatingTextColor, ";background-color:", needsUpdatingBackgroundColor, ";}.euiFormControlLayoutDelimited__delimiter{color:inherit;}.euiDatePopoverButton{", euiFormControlDefaultShadow(euiThemeContext, {
|
|
93
|
+
invalid: /*#__PURE__*/css(".euiFormControlLayout__childrenWrapper{color:", euiTheme.colors.textDanger, ";background-color:", forms.backgroundColor, ";", invalidStyles, ";};label:invalid;"),
|
|
94
|
+
needsUpdating: /*#__PURE__*/css(".euiFormControlLayout__childrenWrapper{color:", needsUpdatingTextColor, ";background-color:", needsUpdatingBackgroundColor, ";", isRefreshVariant && needsUpdatingStyles, ";}.euiFormControlLayoutDelimited__delimiter{color:inherit;}.euiDatePopoverButton{", euiFormControlDefaultShadow(euiThemeContext, {
|
|
82
95
|
withBorder: false,
|
|
83
96
|
withBackgroundColor: false
|
|
84
|
-
}), ";}.euiDatePopoverButton:focus,.euiPopover-isOpen .euiDatePopoverButton{
|
|
85
|
-
// Force the fill color of all icons/svgs to give a bit more indication of state,
|
|
86
|
-
// since Windows high contrast themes otherwise override background/text color
|
|
87
|
-
forced: "\n svg,\n & + * svg {\n fill: ".concat(euiTheme.colors.success, ";\n }\n ")
|
|
88
|
-
}), ";;label:needsUpdating;")
|
|
97
|
+
}), " background-color:inherit;box-shadow:none;}.euiDatePopoverButton:focus,.euiPopover-isOpen .euiDatePopoverButton{", needsUpdatingPopoverButtonFocusStyles, ";};label:needsUpdating;")
|
|
89
98
|
}
|
|
90
99
|
};
|
|
91
100
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
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)."; }
|
|
1
2
|
/*
|
|
2
3
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
4
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -10,11 +11,19 @@ import { css } from '@emotion/react';
|
|
|
10
11
|
import { euiShadowXLarge } from '@elastic/eui-theme-common';
|
|
11
12
|
import { euiMaxBreakpoint, euiMinBreakpoint, logicalCSS } from '../../global_styling';
|
|
12
13
|
import { FLYOUT_BREAKPOINT } from './flyout.styles';
|
|
14
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
15
|
+
name: "1ffeobd-inside",
|
|
16
|
+
styles: "background-color:transparent;label:inside;"
|
|
17
|
+
} : {
|
|
18
|
+
name: "1ffeobd-inside",
|
|
19
|
+
styles: "background-color:transparent;label:inside;",
|
|
20
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
21
|
+
};
|
|
13
22
|
export var euiFlyoutCloseButtonStyles = function euiFlyoutCloseButtonStyles(euiThemeContext) {
|
|
14
23
|
var euiTheme = euiThemeContext.euiTheme;
|
|
15
24
|
return {
|
|
16
25
|
euiFlyout__closeButton: /*#__PURE__*/css("position:absolute;", logicalCSS('right', euiTheme.size.s), " ", logicalCSS('top', euiTheme.size.s), " z-index:3;;label:euiFlyout__closeButton;"),
|
|
17
|
-
inside:
|
|
26
|
+
inside: _ref,
|
|
18
27
|
outside: /*#__PURE__*/css(euiShadowXLarge(euiThemeContext, {
|
|
19
28
|
borderAllInHighContrastMode: true
|
|
20
29
|
}), "animation:none!important;;label:outside;"),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["children", "className", "banner", "hideCloseButton", "onClose", "scrollableTabIndex", "size"];
|
|
3
|
+
var _excluded = ["children", "backgroundStyle", "className", "banner", "hideCloseButton", "onClose", "scrollableTabIndex", "size"];
|
|
4
4
|
/*
|
|
5
5
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
6
6
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -28,6 +28,8 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
|
28
28
|
*/
|
|
29
29
|
export var EuiFlyoutChild = function EuiFlyoutChild(_ref) {
|
|
30
30
|
var children = _ref.children,
|
|
31
|
+
_ref$backgroundStyle = _ref.backgroundStyle,
|
|
32
|
+
backgroundStyle = _ref$backgroundStyle === void 0 ? 'default' : _ref$backgroundStyle,
|
|
31
33
|
className = _ref.className,
|
|
32
34
|
banner = _ref.banner,
|
|
33
35
|
_ref$hideCloseButton = _ref.hideCloseButton,
|
|
@@ -120,7 +122,7 @@ export var EuiFlyoutChild = function EuiFlyoutChild(_ref) {
|
|
|
120
122
|
var styles = useEuiMemoizedStyles(euiFlyoutChildStyles);
|
|
121
123
|
var childLayoutMode = flyoutContext.childLayoutMode,
|
|
122
124
|
parentFlyoutRef = flyoutContext.parentFlyoutRef;
|
|
123
|
-
var flyoutChildCss = [styles.euiFlyoutChild, size === 's' ? styles.s : styles.m, childLayoutMode === 'side-by-side' ? styles.sidePosition : styles.stackedPosition];
|
|
125
|
+
var flyoutChildCss = [styles.euiFlyoutChild, backgroundStyle === 'shaded' ? styles.backgroundShaded : styles.backgroundDefault, size === 's' ? styles.s : styles.m, childLayoutMode === 'side-by-side' ? styles.sidePosition : styles.stackedPosition];
|
|
124
126
|
return ___EmotionJSX(EuiFocusTrap, {
|
|
125
127
|
returnFocus: function returnFocus() {
|
|
126
128
|
if (parentFlyoutRef !== null && parentFlyoutRef !== void 0 && parentFlyoutRef.current) {
|
|
@@ -147,7 +149,6 @@ export var EuiFlyoutChild = function EuiFlyoutChild(_ref) {
|
|
|
147
149
|
className: "euiScreenReaderOnly"
|
|
148
150
|
}, flyoutTitleText), !hideCloseButton && ___EmotionJSX(EuiFlyoutCloseButton, {
|
|
149
151
|
className: "euiFlyoutChild__closeButton",
|
|
150
|
-
css: styles.closeButton,
|
|
151
152
|
onClose: handleClose,
|
|
152
153
|
side: "right",
|
|
153
154
|
closeButtonPosition: "inside",
|
|
@@ -13,13 +13,14 @@ export var euiFlyoutChildStyles = function euiFlyoutChildStyles(euiThemeContext)
|
|
|
13
13
|
var euiTheme = euiThemeContext.euiTheme;
|
|
14
14
|
return {
|
|
15
15
|
// Base styles for the child flyout
|
|
16
|
-
euiFlyoutChild: /*#__PURE__*/css("position:absolute;inset-block-start:0;inset-inline-start:0;block-size:100%;
|
|
16
|
+
euiFlyoutChild: /*#__PURE__*/css("position:absolute;inset-block-start:0;inset-inline-start:0;block-size:100%;display:flex;flex-direction:column;", logicalCSSWithFallback('overflow-y', 'hidden'), " ", logicalCSS('height', '100%'), " z-index:", Number(euiTheme.levels.flyout) + 1, ";border-inline-start:", euiTheme.border.thin, ";", maxedFlyoutWidth(euiThemeContext), ";;label:euiFlyoutChild;"),
|
|
17
|
+
backgroundDefault: /*#__PURE__*/css("background:", euiTheme.colors.backgroundBasePlain, ";;label:backgroundDefault;"),
|
|
18
|
+
backgroundShaded: /*#__PURE__*/css("background:", euiTheme.colors.backgroundBaseSubdued, ";;label:backgroundShaded;"),
|
|
17
19
|
// Position variants based on screen size
|
|
18
20
|
sidePosition: /*#__PURE__*/css("transform:translateX(-100%);border-inline-end:", euiTheme.border.thin, ";;label:sidePosition;"),
|
|
19
21
|
stackedPosition: /*#__PURE__*/css("inset-inline-end:0;inline-size:100%;border-block-end:", euiTheme.border.thin, ";;label:stackedPosition;"),
|
|
20
22
|
s: /*#__PURE__*/css(composeFlyoutSizing(euiThemeContext, 's'), ";;label:s;"),
|
|
21
23
|
m: /*#__PURE__*/css(composeFlyoutSizing(euiThemeContext, 'm'), ";;label:m;"),
|
|
22
|
-
closeButton: /*#__PURE__*/css("position:absolute;inset-block-start:", euiTheme.size.s, ";inset-inline-end:", euiTheme.size.s, ";z-index:1;;label:closeButton;"),
|
|
23
24
|
overflow: {
|
|
24
25
|
overflow: /*#__PURE__*/css("flex-grow:1;display:flex;flex-direction:column;", euiYScroll(euiThemeContext), ";;label:overflow;"),
|
|
25
26
|
wrapper: /*#__PURE__*/css("display:flex;flex-direction:column;flex-grow:1;", logicalCSS('overflow-x', 'auto'), ";;label:wrapper;")
|
|
@@ -39,7 +39,8 @@ export var useEuiFlyoutSessionContext = function useEuiFlyoutSessionContext() {
|
|
|
39
39
|
export var EuiFlyoutSessionProvider = function EuiFlyoutSessionProvider(_ref) {
|
|
40
40
|
var children = _ref.children,
|
|
41
41
|
renderMainFlyoutContent = _ref.renderMainFlyoutContent,
|
|
42
|
-
renderChildFlyoutContent = _ref.renderChildFlyoutContent
|
|
42
|
+
renderChildFlyoutContent = _ref.renderChildFlyoutContent,
|
|
43
|
+
onUnmount = _ref.onUnmount;
|
|
43
44
|
var _useReducer = useReducer(flyoutReducer, initialFlyoutState),
|
|
44
45
|
_useReducer2 = _slicedToArray(_useReducer, 2),
|
|
45
46
|
state = _useReducer2[0],
|
|
@@ -58,29 +59,13 @@ export var EuiFlyoutSessionProvider = function EuiFlyoutSessionProvider(_ref) {
|
|
|
58
59
|
var mainFlyoutContentNode = null;
|
|
59
60
|
var childFlyoutContentNode = null;
|
|
60
61
|
if (activeFlyoutGroup) {
|
|
61
|
-
var
|
|
62
|
-
flyoutProps: activeFlyoutGroup.config.mainFlyoutProps || {},
|
|
63
|
-
flyoutSize: activeFlyoutGroup.config.mainSize,
|
|
64
|
-
flyoutType: 'main',
|
|
65
|
-
dispatch: dispatch,
|
|
62
|
+
var renderContext = {
|
|
66
63
|
activeFlyoutGroup: activeFlyoutGroup,
|
|
67
|
-
onCloseFlyout: handleClose,
|
|
68
|
-
onCloseChildFlyout: handleCloseChild,
|
|
69
64
|
meta: activeFlyoutGroup.meta
|
|
70
65
|
};
|
|
71
|
-
mainFlyoutContentNode = renderMainFlyoutContent(
|
|
66
|
+
mainFlyoutContentNode = renderMainFlyoutContent(renderContext);
|
|
72
67
|
if (activeFlyoutGroup.isChildOpen && renderChildFlyoutContent) {
|
|
73
|
-
|
|
74
|
-
flyoutProps: activeFlyoutGroup.config.childFlyoutProps || {},
|
|
75
|
-
flyoutSize: activeFlyoutGroup.config.childSize,
|
|
76
|
-
flyoutType: 'child',
|
|
77
|
-
dispatch: dispatch,
|
|
78
|
-
activeFlyoutGroup: activeFlyoutGroup,
|
|
79
|
-
onCloseFlyout: handleClose,
|
|
80
|
-
onCloseChildFlyout: handleCloseChild,
|
|
81
|
-
meta: activeFlyoutGroup.meta
|
|
82
|
-
};
|
|
83
|
-
childFlyoutContentNode = renderChildFlyoutContent(childRenderContext);
|
|
68
|
+
childFlyoutContentNode = renderChildFlyoutContent(renderContext);
|
|
84
69
|
} else if (activeFlyoutGroup.isChildOpen && !renderChildFlyoutContent) {
|
|
85
70
|
console.warn('EuiFlyoutSessionProvider: A child flyout is open, but renderChildFlyoutContent was not provided.');
|
|
86
71
|
}
|
|
@@ -91,7 +76,8 @@ export var EuiFlyoutSessionProvider = function EuiFlyoutSessionProvider(_ref) {
|
|
|
91
76
|
return ___EmotionJSX(EuiFlyoutSessionContext.Provider, {
|
|
92
77
|
value: {
|
|
93
78
|
state: state,
|
|
94
|
-
dispatch: dispatch
|
|
79
|
+
dispatch: dispatch,
|
|
80
|
+
onUnmount: onUnmount
|
|
95
81
|
}
|
|
96
82
|
}, children, (activeFlyoutGroup === null || activeFlyoutGroup === void 0 ? void 0 : activeFlyoutGroup.isMainOpen) && ___EmotionJSX(EuiFlyout, _extends({
|
|
97
83
|
onClose: handleClose,
|
|
@@ -57,8 +57,7 @@ export function flyoutReducer(state, action) {
|
|
|
57
57
|
var _state$activeFlyoutGr, _state$activeFlyoutGr2;
|
|
58
58
|
var _action$payload = action.payload,
|
|
59
59
|
size = _action$payload.size,
|
|
60
|
-
flyoutProps = _action$payload.flyoutProps
|
|
61
|
-
onUnmount = _action$payload.onUnmount;
|
|
60
|
+
flyoutProps = _action$payload.flyoutProps;
|
|
62
61
|
var newHistory = _toConsumableArray(state.history);
|
|
63
62
|
if (state.activeFlyoutGroup) {
|
|
64
63
|
newHistory.push(state.activeFlyoutGroup);
|
|
@@ -72,8 +71,6 @@ export function flyoutReducer(state, action) {
|
|
|
72
71
|
mainFlyoutProps: flyoutProps,
|
|
73
72
|
childFlyoutProps: {}
|
|
74
73
|
},
|
|
75
|
-
mainOnUnmount: onUnmount,
|
|
76
|
-
childOnUnmount: undefined,
|
|
77
74
|
meta: action.payload.meta !== undefined ? ((_state$activeFlyoutGr = state.activeFlyoutGroup) === null || _state$activeFlyoutGr === void 0 ? void 0 : _state$activeFlyoutGr.meta) !== undefined ? _objectSpread(_objectSpread({}, state.activeFlyoutGroup.meta), action.payload.meta) : action.payload.meta : (_state$activeFlyoutGr2 = state.activeFlyoutGroup) === null || _state$activeFlyoutGr2 === void 0 ? void 0 : _state$activeFlyoutGr2.meta
|
|
78
75
|
};
|
|
79
76
|
return {
|
|
@@ -89,15 +86,13 @@ export function flyoutReducer(state, action) {
|
|
|
89
86
|
}
|
|
90
87
|
var _action$payload2 = action.payload,
|
|
91
88
|
_size = _action$payload2.size,
|
|
92
|
-
_flyoutProps = _action$payload2.flyoutProps
|
|
93
|
-
_onUnmount = _action$payload2.onUnmount;
|
|
89
|
+
_flyoutProps = _action$payload2.flyoutProps;
|
|
94
90
|
var updatedActiveGroup = _objectSpread(_objectSpread({}, state.activeFlyoutGroup), {}, {
|
|
95
91
|
isChildOpen: true,
|
|
96
92
|
config: _objectSpread(_objectSpread({}, state.activeFlyoutGroup.config), {}, {
|
|
97
93
|
childSize: _size,
|
|
98
94
|
childFlyoutProps: _flyoutProps
|
|
99
95
|
}),
|
|
100
|
-
childOnUnmount: _onUnmount,
|
|
101
96
|
meta: action.payload.meta !== undefined ? state.activeFlyoutGroup.meta !== undefined ? _objectSpread(_objectSpread({}, state.activeFlyoutGroup.meta), action.payload.meta) : action.payload.meta : state.activeFlyoutGroup.meta
|
|
102
97
|
});
|
|
103
98
|
return {
|
|
@@ -126,8 +121,6 @@ export function flyoutReducer(state, action) {
|
|
|
126
121
|
mainFlyoutProps: main.flyoutProps,
|
|
127
122
|
childFlyoutProps: child.flyoutProps
|
|
128
123
|
},
|
|
129
|
-
mainOnUnmount: main.onUnmount,
|
|
130
|
-
childOnUnmount: child.onUnmount,
|
|
131
124
|
meta: meta
|
|
132
125
|
};
|
|
133
126
|
return {
|
|
@@ -137,18 +130,15 @@ export function flyoutReducer(state, action) {
|
|
|
137
130
|
}
|
|
138
131
|
case 'CLOSE_CHILD_FLYOUT':
|
|
139
132
|
{
|
|
140
|
-
var _state$activeFlyoutGr3, _state$activeFlyoutGr4;
|
|
141
133
|
if (!state.activeFlyoutGroup || !state.activeFlyoutGroup.isChildOpen) {
|
|
142
134
|
console.warn('Cannot close child flyout: no child is open or no active group.');
|
|
143
135
|
return state;
|
|
144
136
|
}
|
|
145
|
-
(_state$activeFlyoutGr3 = (_state$activeFlyoutGr4 = state.activeFlyoutGroup).childOnUnmount) === null || _state$activeFlyoutGr3 === void 0 || _state$activeFlyoutGr3.call(_state$activeFlyoutGr4);
|
|
146
137
|
var _updatedActiveGroup = _objectSpread(_objectSpread({}, state.activeFlyoutGroup), {}, {
|
|
147
138
|
isChildOpen: false,
|
|
148
139
|
config: _objectSpread(_objectSpread({}, state.activeFlyoutGroup.config), {}, {
|
|
149
140
|
childFlyoutProps: {}
|
|
150
|
-
})
|
|
151
|
-
childOnUnmount: undefined
|
|
141
|
+
})
|
|
152
142
|
});
|
|
153
143
|
return {
|
|
154
144
|
history: state.history,
|
|
@@ -157,13 +147,7 @@ export function flyoutReducer(state, action) {
|
|
|
157
147
|
}
|
|
158
148
|
case 'GO_BACK':
|
|
159
149
|
{
|
|
160
|
-
var _state$activeFlyoutGr7, _state$activeFlyoutGr8;
|
|
161
150
|
if (!state.activeFlyoutGroup) return initialFlyoutState;
|
|
162
|
-
if (state.activeFlyoutGroup.isChildOpen) {
|
|
163
|
-
var _state$activeFlyoutGr5, _state$activeFlyoutGr6;
|
|
164
|
-
(_state$activeFlyoutGr5 = (_state$activeFlyoutGr6 = state.activeFlyoutGroup).childOnUnmount) === null || _state$activeFlyoutGr5 === void 0 || _state$activeFlyoutGr5.call(_state$activeFlyoutGr6);
|
|
165
|
-
}
|
|
166
|
-
(_state$activeFlyoutGr7 = (_state$activeFlyoutGr8 = state.activeFlyoutGroup).mainOnUnmount) === null || _state$activeFlyoutGr7 === void 0 || _state$activeFlyoutGr7.call(_state$activeFlyoutGr8);
|
|
167
151
|
|
|
168
152
|
// Restore from history or return to initial state
|
|
169
153
|
if (state.history.length > 0) {
|
|
@@ -183,14 +167,9 @@ export function flyoutReducer(state, action) {
|
|
|
183
167
|
console.warn('Cannot update config: no active flyout group.');
|
|
184
168
|
return state;
|
|
185
169
|
}
|
|
186
|
-
var
|
|
187
|
-
configChanges = _action$payload4.configChanges,
|
|
188
|
-
newMainOnUnmount = _action$payload4.newMainOnUnmount,
|
|
189
|
-
newChildOnUnmount = _action$payload4.newChildOnUnmount;
|
|
170
|
+
var configChanges = action.payload.configChanges;
|
|
190
171
|
var _updatedActiveGroup2 = _objectSpread(_objectSpread({}, state.activeFlyoutGroup), {}, {
|
|
191
|
-
config: _objectSpread(_objectSpread({}, state.activeFlyoutGroup.config), configChanges)
|
|
192
|
-
mainOnUnmount: newMainOnUnmount !== undefined ? newMainOnUnmount : state.activeFlyoutGroup.mainOnUnmount,
|
|
193
|
-
childOnUnmount: newChildOnUnmount !== undefined ? newChildOnUnmount : state.activeFlyoutGroup.childOnUnmount
|
|
172
|
+
config: _objectSpread(_objectSpread({}, state.activeFlyoutGroup.config), configChanges)
|
|
194
173
|
});
|
|
195
174
|
var finalUpdatedActiveGroup = applySizeConstraints(_updatedActiveGroup2);
|
|
196
175
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* Side Public License, v 1.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import { useEffect, useRef } from 'react';
|
|
9
10
|
import { useEuiFlyoutSessionContext } from './flyout_provider';
|
|
10
11
|
|
|
11
12
|
/**
|
|
@@ -22,12 +23,24 @@ import { useEuiFlyoutSessionContext } from './flyout_provider';
|
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
25
|
* Hook for accessing the flyout API
|
|
26
|
+
* @public
|
|
25
27
|
*/
|
|
26
28
|
export function useEuiFlyoutSession() {
|
|
27
29
|
var _state$activeFlyoutGr, _state$activeFlyoutGr2;
|
|
28
30
|
var _useEuiFlyoutSessionC = useEuiFlyoutSessionContext(),
|
|
29
31
|
state = _useEuiFlyoutSessionC.state,
|
|
30
|
-
dispatch = _useEuiFlyoutSessionC.dispatch
|
|
32
|
+
dispatch = _useEuiFlyoutSessionC.dispatch,
|
|
33
|
+
onUnmount = _useEuiFlyoutSessionC.onUnmount;
|
|
34
|
+
var isInitialMount = useRef(true);
|
|
35
|
+
useEffect(function () {
|
|
36
|
+
// When there is no active flyout, we should call the onUnmount callback.
|
|
37
|
+
// Ensure this is not called on the initial render, only on subsequent state changes.
|
|
38
|
+
if (isInitialMount.current) {
|
|
39
|
+
isInitialMount.current = false;
|
|
40
|
+
} else if (state.activeFlyoutGroup === null) {
|
|
41
|
+
onUnmount === null || onUnmount === void 0 || onUnmount();
|
|
42
|
+
}
|
|
43
|
+
}, [state.activeFlyoutGroup, onUnmount]);
|
|
31
44
|
var openFlyout = function openFlyout(options) {
|
|
32
45
|
dispatch({
|
|
33
46
|
type: 'OPEN_MAIN_FLYOUT',
|
|
@@ -50,13 +63,11 @@ export function useEuiFlyoutSession() {
|
|
|
50
63
|
payload: {
|
|
51
64
|
main: {
|
|
52
65
|
size: options.main.size,
|
|
53
|
-
flyoutProps: options.main.flyoutProps
|
|
54
|
-
onUnmount: options.main.onUnmount
|
|
66
|
+
flyoutProps: options.main.flyoutProps
|
|
55
67
|
},
|
|
56
68
|
child: {
|
|
57
69
|
size: options.child.size,
|
|
58
|
-
flyoutProps: options.child.flyoutProps
|
|
59
|
-
onUnmount: options.child.onUnmount
|
|
70
|
+
flyoutProps: options.child.flyoutProps
|
|
60
71
|
},
|
|
61
72
|
meta: options.meta
|
|
62
73
|
}
|
|
@@ -72,23 +83,23 @@ export function useEuiFlyoutSession() {
|
|
|
72
83
|
type: 'GO_BACK'
|
|
73
84
|
});
|
|
74
85
|
};
|
|
75
|
-
var canGoBack = !!state.activeFlyoutGroup;
|
|
76
|
-
var isFlyoutOpen = !!((_state$activeFlyoutGr = state.activeFlyoutGroup) !== null && _state$activeFlyoutGr !== void 0 && _state$activeFlyoutGr.isMainOpen);
|
|
77
|
-
var isChildFlyoutOpen = !!((_state$activeFlyoutGr2 = state.activeFlyoutGroup) !== null && _state$activeFlyoutGr2 !== void 0 && _state$activeFlyoutGr2.isChildOpen);
|
|
78
86
|
var clearHistory = function clearHistory() {
|
|
79
87
|
dispatch({
|
|
80
88
|
type: 'CLEAR_HISTORY'
|
|
81
89
|
});
|
|
82
90
|
};
|
|
91
|
+
var isFlyoutOpen = !!((_state$activeFlyoutGr = state.activeFlyoutGroup) !== null && _state$activeFlyoutGr !== void 0 && _state$activeFlyoutGr.isMainOpen);
|
|
92
|
+
var isChildFlyoutOpen = !!((_state$activeFlyoutGr2 = state.activeFlyoutGroup) !== null && _state$activeFlyoutGr2 !== void 0 && _state$activeFlyoutGr2.isChildOpen);
|
|
93
|
+
var canGoBack = !!state.history.length;
|
|
83
94
|
return {
|
|
84
95
|
openFlyout: openFlyout,
|
|
85
96
|
openChildFlyout: openChildFlyout,
|
|
86
97
|
openFlyoutGroup: openFlyoutGroup,
|
|
87
98
|
closeChildFlyout: closeChildFlyout,
|
|
88
99
|
goBack: goBack,
|
|
89
|
-
|
|
100
|
+
clearHistory: clearHistory,
|
|
90
101
|
isFlyoutOpen: isFlyoutOpen,
|
|
91
102
|
isChildFlyoutOpen: isChildFlyoutOpen,
|
|
92
|
-
|
|
103
|
+
canGoBack: canGoBack
|
|
93
104
|
};
|
|
94
105
|
}
|
|
@@ -7,12 +7,15 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { css } from '@emotion/react';
|
|
10
|
+
import { isEuiThemeRefreshVariant } from '../../../services';
|
|
10
11
|
import { euiFormControlStyles } from '../form.styles';
|
|
11
12
|
export var euiFieldNumberStyles = function euiFieldNumberStyles(euiThemeContext) {
|
|
12
13
|
var colorMode = euiThemeContext.colorMode;
|
|
14
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
13
15
|
var formStyles = euiFormControlStyles(euiThemeContext);
|
|
16
|
+
var invalidStyles = isRefreshVariant ? "\n &:is(:invalid, [aria-invalid='true']):not(\n .euiFormControlLayoutDelimited__input, :focus\n ) {\n ".concat(formStyles.invalid, "\n }\n ") : "\n /* Account for native validity detection as well via [aria-invalid=\"true\"] */\n &:is(:invalid, [aria-invalid='true']) {\n ".concat(formStyles.invalid, "\n }\n ");
|
|
14
17
|
return {
|
|
15
|
-
euiFieldNumber: /*#__PURE__*/css(formStyles.shared, "color-scheme:", colorMode === 'DARK' ? 'dark' : 'light', "
|
|
18
|
+
euiFieldNumber: /*#__PURE__*/css(formStyles.shared, "color-scheme:", colorMode === 'DARK' ? 'dark' : 'light', ";", invalidStyles, " &:focus{", formStyles.focus, ";}&:disabled{", formStyles.disabled, ";}&[readOnly]{", formStyles.readOnly, ";}&:autofill{", formStyles.autoFill, ";};label:euiFieldNumber;"),
|
|
16
19
|
// Skip the css() on the default height to avoid generating a className
|
|
17
20
|
uncompressed: formStyles.uncompressed,
|
|
18
21
|
compressed: /*#__PURE__*/css(formStyles.compressed, ";label:compressed;"),
|
|
@@ -7,11 +7,14 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { css } from '@emotion/react';
|
|
10
|
+
import { isEuiThemeRefreshVariant } from '../../../services';
|
|
10
11
|
import { euiFormControlStyles } from '../form.styles';
|
|
11
12
|
export var euiFieldTextStyles = function euiFieldTextStyles(euiThemeContext) {
|
|
13
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
12
14
|
var formStyles = euiFormControlStyles(euiThemeContext);
|
|
15
|
+
var invalidStyles = isRefreshVariant ? "\n &:is(:invalid, [aria-invalid='true']):not(\n .euiFormControlLayoutDelimited__input, :focus\n ) {\n ".concat(formStyles.invalid, "\n }\n ") : "\n &:is(:invalid){\n ".concat(formStyles.invalid, "\n }\n ");
|
|
13
16
|
return {
|
|
14
|
-
euiFieldText: /*#__PURE__*/css(formStyles.shared, "
|
|
17
|
+
euiFieldText: /*#__PURE__*/css(formStyles.shared, " ", invalidStyles, " &:focus{", formStyles.focus, ";}&[readOnly]{", formStyles.readOnly, ";}&:disabled{", formStyles.disabled, ";}&:autofill{", formStyles.autoFill, ";};label:euiFieldText;"),
|
|
15
18
|
// Skip the css() on the default height to avoid generating a className
|
|
16
19
|
uncompressed: formStyles.uncompressed,
|
|
17
20
|
compressed: /*#__PURE__*/css(formStyles.compressed, ";label:compressed;"),
|