@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.
Files changed (233) hide show
  1. package/dist/eui_theme_amsterdam_dark.json +2 -0
  2. package/dist/eui_theme_amsterdam_dark.json.d.ts +2 -0
  3. package/dist/eui_theme_amsterdam_light.json +2 -0
  4. package/dist/eui_theme_amsterdam_light.json.d.ts +2 -0
  5. package/dist/eui_theme_borealis_dark.json +2 -0
  6. package/dist/eui_theme_borealis_dark.json.d.ts +2 -0
  7. package/dist/eui_theme_borealis_light.json +10 -8
  8. package/dist/eui_theme_borealis_light.json.d.ts +2 -0
  9. package/es/components/combo_box/combo_box_input/combo_box_input.js +65 -61
  10. package/es/components/combo_box/combo_box_input/combo_box_input.styles.js +6 -4
  11. package/es/components/date_picker/date_picker.styles.js +4 -1
  12. package/es/components/date_picker/date_picker_range.js +3 -2
  13. package/es/components/date_picker/date_picker_range.styles.js +11 -4
  14. package/es/components/date_picker/super_date_picker/super_date_picker.styles.js +23 -14
  15. package/es/components/flyout/_flyout_close_button.styles.js +10 -1
  16. package/es/components/flyout/flyout_child.js +8 -3
  17. package/es/components/flyout/flyout_child.styles.js +3 -2
  18. package/es/components/flyout/sessions/flyout_provider.js +7 -21
  19. package/es/components/flyout/sessions/flyout_reducer.js +5 -26
  20. package/es/components/flyout/sessions/use_eui_flyout.js +21 -10
  21. package/es/components/form/field_number/field_number.styles.js +4 -1
  22. package/es/components/form/field_text/field_text.styles.js +4 -1
  23. package/es/components/form/file_picker/file_picker.js +107 -101
  24. package/es/components/form/file_picker/file_picker.styles.js +18 -17
  25. package/es/components/form/form.styles.js +72 -22
  26. package/es/components/form/form_control_layout/form_control_layout.styles.js +28 -17
  27. package/es/components/form/form_control_layout/form_control_layout_clear_button.styles.js +7 -7
  28. package/es/components/form/form_control_layout/form_control_layout_delimited.js +10 -7
  29. package/es/components/form/form_control_layout/form_control_layout_delimited.styles.js +34 -29
  30. package/es/components/form/form_control_layout/form_control_layout_icons.js +35 -20
  31. package/es/components/form/form_control_layout/form_control_layout_icons.styles.js +6 -6
  32. package/es/components/form/form_error_text/form_error_text.styles.js +3 -1
  33. package/es/components/form/form_label/form_label.styles.js +4 -2
  34. package/es/components/header/header.styles.js +5 -3
  35. package/es/components/markdown_editor/markdown_editor_drop_zone.styles.js +6 -3
  36. package/es/components/progress/progress.a11y.js +7 -7
  37. package/es/components/progress/progress.js +18 -27
  38. package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +59 -23
  39. package/es/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +8 -2
  40. package/es/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +63 -0
  41. package/es/global_styling/mixins/_button.js +1 -1
  42. package/es/services/color/eui_palettes.js +26 -0
  43. package/es/services/color/vis_color_store.js +1 -1
  44. package/es/services/color/visualization_colors.js +4 -0
  45. package/es/services/theme/provider.js +13 -6
  46. package/es/themes/amsterdam/global_styling/variables/_colors.js +8 -3
  47. package/es/themes/amsterdam/global_styling/variables/_forms.js +96 -53
  48. package/es/themes/amsterdam/theme.js +2 -1
  49. package/es/themes/json/eui_theme_amsterdam_dark.json +2 -0
  50. package/es/themes/json/eui_theme_amsterdam_light.json +2 -0
  51. package/es/themes/json/eui_theme_borealis_dark.json +2 -0
  52. package/es/themes/json/eui_theme_borealis_light.json +10 -8
  53. package/eui.d.ts +461 -376
  54. package/i18ntokens.json +3595 -3523
  55. package/lib/components/combo_box/combo_box_input/combo_box_input.js +64 -60
  56. package/lib/components/combo_box/combo_box_input/combo_box_input.styles.js +6 -4
  57. package/lib/components/date_picker/date_picker.styles.js +4 -1
  58. package/lib/components/date_picker/date_picker_range.js +3 -2
  59. package/lib/components/date_picker/date_picker_range.styles.js +11 -4
  60. package/lib/components/date_picker/super_date_picker/super_date_picker.styles.js +21 -12
  61. package/lib/components/flyout/_flyout_close_button.styles.js +10 -3
  62. package/lib/components/flyout/flyout_child.js +8 -3
  63. package/lib/components/flyout/flyout_child.styles.js +3 -2
  64. package/lib/components/flyout/sessions/flyout_provider.js +7 -21
  65. package/lib/components/flyout/sessions/flyout_reducer.js +5 -26
  66. package/lib/components/flyout/sessions/use_eui_flyout.js +21 -10
  67. package/lib/components/form/field_number/field_number.styles.js +4 -1
  68. package/lib/components/form/field_text/field_text.styles.js +4 -1
  69. package/lib/components/form/file_picker/file_picker.js +106 -100
  70. package/lib/components/form/file_picker/file_picker.styles.js +16 -15
  71. package/lib/components/form/form.styles.js +72 -22
  72. package/lib/components/form/form_control_layout/form_control_layout.styles.js +28 -17
  73. package/lib/components/form/form_control_layout/form_control_layout_clear_button.styles.js +7 -7
  74. package/lib/components/form/form_control_layout/form_control_layout_delimited.js +9 -6
  75. package/lib/components/form/form_control_layout/form_control_layout_delimited.styles.js +34 -27
  76. package/lib/components/form/form_control_layout/form_control_layout_icons.js +34 -19
  77. package/lib/components/form/form_control_layout/form_control_layout_icons.styles.js +6 -6
  78. package/lib/components/form/form_error_text/form_error_text.styles.js +3 -1
  79. package/lib/components/form/form_label/form_label.styles.js +4 -2
  80. package/lib/components/header/header.styles.js +4 -2
  81. package/lib/components/markdown_editor/markdown_editor_drop_zone.styles.js +6 -3
  82. package/lib/components/progress/progress.a11y.js +7 -7
  83. package/lib/components/progress/progress.js +18 -27
  84. package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +57 -21
  85. package/lib/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +9 -3
  86. package/lib/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +69 -0
  87. package/lib/global_styling/mixins/_button.js +1 -1
  88. package/lib/services/color/eui_palettes.js +26 -0
  89. package/lib/services/color/vis_color_store.js +1 -1
  90. package/lib/services/color/visualization_colors.js +3 -0
  91. package/lib/services/theme/provider.js +13 -6
  92. package/lib/themes/amsterdam/global_styling/variables/_colors.js +8 -3
  93. package/lib/themes/amsterdam/global_styling/variables/_forms.js +96 -53
  94. package/lib/themes/amsterdam/theme.js +2 -1
  95. package/lib/themes/json/eui_theme_amsterdam_dark.json +2 -0
  96. package/lib/themes/json/eui_theme_amsterdam_light.json +2 -0
  97. package/lib/themes/json/eui_theme_borealis_dark.json +2 -0
  98. package/lib/themes/json/eui_theme_borealis_light.json +10 -8
  99. package/optimize/es/components/combo_box/combo_box_input/combo_box_input.js +65 -61
  100. package/optimize/es/components/combo_box/combo_box_input/combo_box_input.styles.js +6 -4
  101. package/optimize/es/components/date_picker/date_picker.styles.js +4 -1
  102. package/optimize/es/components/date_picker/date_picker_range.js +3 -2
  103. package/optimize/es/components/date_picker/date_picker_range.styles.js +11 -4
  104. package/optimize/es/components/date_picker/super_date_picker/super_date_picker.styles.js +23 -14
  105. package/optimize/es/components/flyout/_flyout_close_button.styles.js +10 -1
  106. package/optimize/es/components/flyout/flyout_child.js +4 -3
  107. package/optimize/es/components/flyout/flyout_child.styles.js +3 -2
  108. package/optimize/es/components/flyout/sessions/flyout_provider.js +7 -21
  109. package/optimize/es/components/flyout/sessions/flyout_reducer.js +5 -26
  110. package/optimize/es/components/flyout/sessions/use_eui_flyout.js +21 -10
  111. package/optimize/es/components/form/field_number/field_number.styles.js +4 -1
  112. package/optimize/es/components/form/field_text/field_text.styles.js +4 -1
  113. package/optimize/es/components/form/file_picker/file_picker.js +107 -101
  114. package/optimize/es/components/form/file_picker/file_picker.styles.js +18 -17
  115. package/optimize/es/components/form/form.styles.js +72 -22
  116. package/optimize/es/components/form/form_control_layout/form_control_layout.styles.js +28 -17
  117. package/optimize/es/components/form/form_control_layout/form_control_layout_clear_button.styles.js +7 -7
  118. package/optimize/es/components/form/form_control_layout/form_control_layout_delimited.js +10 -7
  119. package/optimize/es/components/form/form_control_layout/form_control_layout_delimited.styles.js +34 -29
  120. package/optimize/es/components/form/form_control_layout/form_control_layout_icons.js +35 -20
  121. package/optimize/es/components/form/form_control_layout/form_control_layout_icons.styles.js +6 -6
  122. package/optimize/es/components/form/form_error_text/form_error_text.styles.js +3 -1
  123. package/optimize/es/components/form/form_label/form_label.styles.js +4 -2
  124. package/optimize/es/components/header/header.styles.js +5 -3
  125. package/optimize/es/components/markdown_editor/markdown_editor_drop_zone.styles.js +6 -3
  126. package/optimize/es/components/progress/progress.a11y.js +7 -7
  127. package/optimize/es/components/progress/progress.js +18 -27
  128. package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide.js +47 -22
  129. package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +8 -2
  130. package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +52 -0
  131. package/optimize/es/global_styling/mixins/_button.js +1 -1
  132. package/optimize/es/services/color/eui_palettes.js +26 -0
  133. package/optimize/es/services/color/vis_color_store.js +1 -1
  134. package/optimize/es/services/color/visualization_colors.js +4 -0
  135. package/optimize/es/services/theme/provider.js +13 -6
  136. package/optimize/es/themes/amsterdam/global_styling/variables/_colors.js +8 -3
  137. package/optimize/es/themes/amsterdam/global_styling/variables/_forms.js +96 -53
  138. package/optimize/es/themes/amsterdam/theme.js +2 -1
  139. package/optimize/es/themes/json/eui_theme_amsterdam_dark.json +2 -0
  140. package/optimize/es/themes/json/eui_theme_amsterdam_light.json +2 -0
  141. package/optimize/es/themes/json/eui_theme_borealis_dark.json +2 -0
  142. package/optimize/es/themes/json/eui_theme_borealis_light.json +10 -8
  143. package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.js +64 -60
  144. package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.styles.js +6 -4
  145. package/optimize/lib/components/date_picker/date_picker.styles.js +4 -1
  146. package/optimize/lib/components/date_picker/date_picker_range.js +3 -2
  147. package/optimize/lib/components/date_picker/date_picker_range.styles.js +11 -4
  148. package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.styles.js +21 -12
  149. package/optimize/lib/components/flyout/_flyout_close_button.styles.js +10 -3
  150. package/optimize/lib/components/flyout/flyout_child.js +4 -3
  151. package/optimize/lib/components/flyout/flyout_child.styles.js +3 -2
  152. package/optimize/lib/components/flyout/sessions/flyout_provider.js +7 -21
  153. package/optimize/lib/components/flyout/sessions/flyout_reducer.js +5 -26
  154. package/optimize/lib/components/flyout/sessions/use_eui_flyout.js +21 -10
  155. package/optimize/lib/components/form/field_number/field_number.styles.js +4 -1
  156. package/optimize/lib/components/form/field_text/field_text.styles.js +4 -1
  157. package/optimize/lib/components/form/file_picker/file_picker.js +106 -100
  158. package/optimize/lib/components/form/file_picker/file_picker.styles.js +16 -15
  159. package/optimize/lib/components/form/form.styles.js +72 -22
  160. package/optimize/lib/components/form/form_control_layout/form_control_layout.styles.js +28 -17
  161. package/optimize/lib/components/form/form_control_layout/form_control_layout_clear_button.styles.js +7 -7
  162. package/optimize/lib/components/form/form_control_layout/form_control_layout_delimited.js +9 -6
  163. package/optimize/lib/components/form/form_control_layout/form_control_layout_delimited.styles.js +34 -27
  164. package/optimize/lib/components/form/form_control_layout/form_control_layout_icons.js +34 -19
  165. package/optimize/lib/components/form/form_control_layout/form_control_layout_icons.styles.js +6 -6
  166. package/optimize/lib/components/form/form_error_text/form_error_text.styles.js +3 -1
  167. package/optimize/lib/components/form/form_label/form_label.styles.js +4 -2
  168. package/optimize/lib/components/header/header.styles.js +4 -2
  169. package/optimize/lib/components/markdown_editor/markdown_editor_drop_zone.styles.js +6 -3
  170. package/optimize/lib/components/progress/progress.a11y.js +7 -7
  171. package/optimize/lib/components/progress/progress.js +18 -27
  172. package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +45 -20
  173. package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +9 -3
  174. package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +58 -0
  175. package/optimize/lib/global_styling/mixins/_button.js +1 -1
  176. package/optimize/lib/services/color/eui_palettes.js +26 -0
  177. package/optimize/lib/services/color/vis_color_store.js +1 -1
  178. package/optimize/lib/services/color/visualization_colors.js +3 -0
  179. package/optimize/lib/services/theme/provider.js +13 -6
  180. package/optimize/lib/themes/amsterdam/global_styling/variables/_colors.js +8 -3
  181. package/optimize/lib/themes/amsterdam/global_styling/variables/_forms.js +96 -53
  182. package/optimize/lib/themes/amsterdam/theme.js +2 -1
  183. package/optimize/lib/themes/json/eui_theme_amsterdam_dark.json +2 -0
  184. package/optimize/lib/themes/json/eui_theme_amsterdam_light.json +2 -0
  185. package/optimize/lib/themes/json/eui_theme_borealis_dark.json +2 -0
  186. package/optimize/lib/themes/json/eui_theme_borealis_light.json +10 -8
  187. package/package.json +12 -10
  188. package/src/themes/amsterdam/_colors_dark.scss +3 -0
  189. package/src/themes/amsterdam/_colors_light.scss +3 -0
  190. package/test-env/components/combo_box/combo_box_input/combo_box_input.js +64 -60
  191. package/test-env/components/combo_box/combo_box_input/combo_box_input.styles.js +6 -4
  192. package/test-env/components/date_picker/date_picker.styles.js +4 -1
  193. package/test-env/components/date_picker/date_picker_range.js +3 -2
  194. package/test-env/components/date_picker/date_picker_range.styles.js +11 -4
  195. package/test-env/components/date_picker/super_date_picker/super_date_picker.styles.js +21 -12
  196. package/test-env/components/flyout/_flyout_close_button.styles.js +10 -3
  197. package/test-env/components/flyout/flyout_child.js +8 -3
  198. package/test-env/components/flyout/flyout_child.styles.js +3 -2
  199. package/test-env/components/flyout/sessions/flyout_provider.js +7 -21
  200. package/test-env/components/flyout/sessions/flyout_reducer.js +5 -26
  201. package/test-env/components/flyout/sessions/use_eui_flyout.js +21 -10
  202. package/test-env/components/form/field_number/field_number.styles.js +4 -1
  203. package/test-env/components/form/field_text/field_text.styles.js +4 -1
  204. package/test-env/components/form/file_picker/file_picker.js +106 -100
  205. package/test-env/components/form/file_picker/file_picker.styles.js +16 -15
  206. package/test-env/components/form/form.styles.js +72 -22
  207. package/test-env/components/form/form_control_layout/form_control_layout.styles.js +28 -17
  208. package/test-env/components/form/form_control_layout/form_control_layout_clear_button.styles.js +7 -7
  209. package/test-env/components/form/form_control_layout/form_control_layout_delimited.js +9 -6
  210. package/test-env/components/form/form_control_layout/form_control_layout_delimited.styles.js +34 -27
  211. package/test-env/components/form/form_control_layout/form_control_layout_icons.js +34 -19
  212. package/test-env/components/form/form_control_layout/form_control_layout_icons.styles.js +6 -6
  213. package/test-env/components/form/form_error_text/form_error_text.styles.js +3 -1
  214. package/test-env/components/form/form_label/form_label.styles.js +4 -2
  215. package/test-env/components/header/header.styles.js +4 -2
  216. package/test-env/components/markdown_editor/markdown_editor_drop_zone.styles.js +6 -3
  217. package/test-env/components/progress/progress.a11y.js +7 -7
  218. package/test-env/components/progress/progress.js +18 -27
  219. package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +57 -21
  220. package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +9 -3
  221. package/test-env/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +68 -0
  222. package/test-env/global_styling/mixins/_button.js +1 -1
  223. package/test-env/services/color/eui_palettes.js +26 -0
  224. package/test-env/services/color/vis_color_store.js +1 -1
  225. package/test-env/services/color/visualization_colors.js +3 -0
  226. package/test-env/services/theme/provider.js +13 -6
  227. package/test-env/themes/amsterdam/global_styling/variables/_colors.js +8 -3
  228. package/test-env/themes/amsterdam/global_styling/variables/_forms.js +96 -53
  229. package/test-env/themes/amsterdam/theme.js +2 -1
  230. package/test-env/themes/json/eui_theme_amsterdam_dark.json +2 -0
  231. package/test-env/themes/json/eui_theme_amsterdam_light.json +2 -0
  232. package/test-env/themes/json/eui_theme_borealis_dark.json +2 -0
  233. 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
- export var euiDatePickerRangeStyles = {
14
- euiDatePickerRange: /*#__PURE__*/css(".euiPopover,.react-datepicker__input-container,.euiDatePicker{", logicalCSS('height', '100%'), ";}.euiPopover{flex:1;};label:euiDatePickerRange;")
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, euiFormControlShowBackgroundUnderline } from '../../form/form.styles';
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{--euiFormControlStateColor:", euiTheme.colors.primary, ";", euiFormControlShowBackgroundUnderline(euiThemeContext, euiTheme.colors.primary), ";};label:default;"),
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, ";", euiFormControlInvalidStyles(euiThemeContext), ";};label:invalid;"),
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{--euiFormControlStateColor:", euiTheme.colors.success, ";", euiFormControlShowBackgroundUnderline(euiThemeContext, euiTheme.colors.success), ";}", highContrastModeStyles(euiThemeContext, {
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: /*#__PURE__*/css("background-color:", euiTheme.components.flyoutCloseButtonInsideBackground, ";;label: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%;background:", euiTheme.colors.backgroundBaseSubdued, ";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;"),
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 mainRenderContext = {
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(mainRenderContext);
66
+ mainFlyoutContentNode = renderMainFlyoutContent(renderContext);
72
67
  if (activeFlyoutGroup.isChildOpen && renderChildFlyoutContent) {
73
- var childRenderContext = {
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 _action$payload4 = action.payload,
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
- canGoBack: canGoBack,
100
+ clearHistory: clearHistory,
90
101
  isFlyoutOpen: isFlyoutOpen,
91
102
  isChildFlyoutOpen: isChildFlyoutOpen,
92
- clearHistory: clearHistory
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', ";&:is(:invalid, [aria-invalid='true']){", formStyles.invalid, ";}&:focus{", formStyles.focus, ";}&:disabled{", formStyles.disabled, ";}&[readOnly]{", formStyles.readOnly, ";}&:autofill{", formStyles.autoFill, ";};label:euiFieldNumber;"),
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, " &:invalid{", formStyles.invalid, ";}&:focus{", formStyles.focus, ";}&[readOnly]{", formStyles.readOnly, ";}&:disabled{", formStyles.disabled, ";}&:autofill{", formStyles.autoFill, ";};label:euiFieldText;"),
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;"),