@elastic/eui 104.1.0 → 105.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 (320) hide show
  1. package/es/components/avatar/avatar.js +1 -1
  2. package/es/components/badge/badge.js +1 -1
  3. package/es/components/badge/beta_badge/beta_badge.js +1 -1
  4. package/es/components/basic_table/basic_table.js +4 -4
  5. package/es/components/basic_table/in_memory_table.js +4 -4
  6. package/es/components/button/button.js +1 -1
  7. package/es/components/button/button_display/_button_display.js +1 -1
  8. package/es/components/button/button_display/_button_display_content.js +1 -1
  9. package/es/components/button/button_empty/button_empty.js +1 -1
  10. package/es/components/button/button_group/button_group.js +1 -1
  11. package/es/components/button/button_group/button_group_button.js +1 -1
  12. package/es/components/button/button_icon/button_icon.js +1 -1
  13. package/es/components/call_out/call_out.js +1 -1
  14. package/es/components/card/card.js +2 -2
  15. package/es/components/card/card_select/card_select.js +1 -1
  16. package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
  17. package/es/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +1 -1
  18. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +1 -1
  19. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
  20. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +2 -2
  21. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
  22. package/es/components/combo_box/combo_box.a11y.js +53 -2
  23. package/es/components/combo_box/combo_box.js +26 -8
  24. package/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +9 -3
  25. package/es/components/comment_list/comment.js +2 -2
  26. package/es/components/comment_list/comment_event.js +1 -1
  27. package/es/components/comment_list/comment_list.js +2 -2
  28. package/es/components/comment_list/comment_timeline.js +1 -1
  29. package/es/components/context_menu/context_menu_item.js +1 -1
  30. package/es/components/datagrid/body/cell/data_grid_cell.js +12 -12
  31. package/es/components/datagrid/body/cell/data_grid_cell.styles.js +9 -4
  32. package/es/components/datagrid/body/data_grid_body.js +7 -7
  33. package/es/components/datagrid/body/data_grid_body_custom.js +7 -7
  34. package/es/components/datagrid/body/data_grid_body_virtualized.js +7 -7
  35. package/es/components/datagrid/body/header/data_grid_header_cell.js +6 -6
  36. package/es/components/datagrid/controls/column_sorting.js +7 -7
  37. package/es/components/datagrid/controls/column_sorting_draggable.js +1 -1
  38. package/es/components/datagrid/controls/data_grid_toolbar_control.js +1 -1
  39. package/es/components/datagrid/data_grid.styles.js +4 -1
  40. package/es/components/datagrid/utils/in_memory.js +6 -6
  41. package/es/components/date_picker/date_picker.js +2 -2
  42. package/es/components/date_picker/date_picker_range.js +1 -1
  43. package/es/components/empty_prompt/empty_prompt.js +1 -1
  44. package/es/components/facet/facet_button.js +1 -1
  45. package/es/components/filter_group/filter_select_item.js +21 -17
  46. package/es/components/flyout/flyout.js +88 -21
  47. package/es/components/flyout/flyout.styles.js +9 -5
  48. package/es/components/flyout/flyout_child.js +209 -0
  49. package/es/components/flyout/flyout_child.styles.js +31 -0
  50. package/es/components/flyout/flyout_child_manager.js +112 -0
  51. package/es/components/flyout/flyout_context.js +16 -0
  52. package/es/components/flyout/index.js +3 -1
  53. package/es/components/flyout/sessions/flyout_provider.js +109 -0
  54. package/es/components/flyout/sessions/flyout_reducer.js +217 -0
  55. package/es/components/flyout/sessions/index.js +10 -0
  56. package/es/components/flyout/sessions/types.js +1 -0
  57. package/es/components/flyout/sessions/use_eui_flyout.js +94 -0
  58. package/es/components/form/field_number/field_number.js +2 -2
  59. package/es/components/form/field_text/field_text.js +2 -2
  60. package/es/components/form/form_control_layout/form_control_layout.js +2 -2
  61. package/es/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
  62. package/es/components/form/form_control_layout/form_control_layout_icons.js +2 -2
  63. package/es/components/form/text_area/text_area.js +2 -2
  64. package/es/components/header/header_links/header_link.js +1 -1
  65. package/es/components/header/header_links/header_links.js +1 -1
  66. package/es/components/header/header_logo/header_logo.js +1 -1
  67. package/es/components/header/header_section/header_section_item_button.js +1 -1
  68. package/es/components/icon/icon.js +1 -1
  69. package/es/components/icon/icon_map.js +1 -4
  70. package/es/components/key_pad_menu/key_pad_menu_item.js +1 -1
  71. package/es/components/list_group/list_group.js +2 -2
  72. package/es/components/list_group/list_group_item.js +2 -2
  73. package/es/components/list_group/list_group_item_extra_action.js +1 -1
  74. package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
  75. package/es/components/loading/loading_logo.js +1 -1
  76. package/es/components/markdown_editor/markdown_editor.js +1 -1
  77. package/es/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
  78. package/es/components/markdown_editor/markdown_editor_footer.js +1 -1
  79. package/es/components/markdown_editor/markdown_editor_toolbar.js +1 -1
  80. package/es/components/page/page_header/page_header_content.js +1 -1
  81. package/es/components/pagination/pagination_button.js +1 -1
  82. package/es/components/progress/progress.js +51 -11
  83. package/es/components/selectable/selectable_list/selectable_list.js +1 -1
  84. package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
  85. package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  86. package/es/components/table/table_header_cell.js +1 -1
  87. package/es/components/table/table_row.styles.js +11 -6
  88. package/es/components/timeline/timeline_item_icon.js +1 -1
  89. package/es/components/toast/global_toast_list.js +1 -1
  90. package/es/components/toast/toast.js +1 -1
  91. package/es/components/tool_tip/icon_tip.js +1 -1
  92. package/es/themes/amsterdam/global_styling/variables/_components.js +305 -270
  93. package/eui.d.ts +400 -77
  94. package/lib/components/avatar/avatar.js +1 -1
  95. package/lib/components/badge/badge.js +1 -1
  96. package/lib/components/badge/beta_badge/beta_badge.js +1 -1
  97. package/lib/components/basic_table/basic_table.js +4 -4
  98. package/lib/components/basic_table/in_memory_table.js +4 -4
  99. package/lib/components/button/button.js +1 -1
  100. package/lib/components/button/button_display/_button_display.js +1 -1
  101. package/lib/components/button/button_display/_button_display_content.js +1 -1
  102. package/lib/components/button/button_empty/button_empty.js +1 -1
  103. package/lib/components/button/button_group/button_group.js +1 -1
  104. package/lib/components/button/button_group/button_group_button.js +1 -1
  105. package/lib/components/button/button_icon/button_icon.js +1 -1
  106. package/lib/components/call_out/call_out.js +1 -1
  107. package/lib/components/card/card.js +2 -2
  108. package/lib/components/card/card_select/card_select.js +1 -1
  109. package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
  110. package/lib/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +1 -1
  111. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +1 -1
  112. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
  113. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +2 -2
  114. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
  115. package/lib/components/combo_box/combo_box.a11y.js +53 -2
  116. package/lib/components/combo_box/combo_box.js +26 -8
  117. package/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +9 -3
  118. package/lib/components/comment_list/comment.js +2 -2
  119. package/lib/components/comment_list/comment_event.js +1 -1
  120. package/lib/components/comment_list/comment_list.js +2 -2
  121. package/lib/components/comment_list/comment_timeline.js +1 -1
  122. package/lib/components/context_menu/context_menu_item.js +1 -1
  123. package/lib/components/datagrid/body/cell/data_grid_cell.js +12 -12
  124. package/lib/components/datagrid/body/cell/data_grid_cell.styles.js +9 -4
  125. package/lib/components/datagrid/body/data_grid_body.js +7 -7
  126. package/lib/components/datagrid/body/data_grid_body_custom.js +7 -7
  127. package/lib/components/datagrid/body/data_grid_body_virtualized.js +7 -7
  128. package/lib/components/datagrid/body/header/data_grid_header_cell.js +6 -6
  129. package/lib/components/datagrid/controls/column_sorting.js +7 -7
  130. package/lib/components/datagrid/controls/column_sorting_draggable.js +1 -1
  131. package/lib/components/datagrid/controls/data_grid_toolbar_control.js +1 -1
  132. package/lib/components/datagrid/data_grid.styles.js +4 -1
  133. package/lib/components/datagrid/utils/in_memory.js +6 -6
  134. package/lib/components/date_picker/date_picker.js +2 -2
  135. package/lib/components/date_picker/date_picker_range.js +1 -1
  136. package/lib/components/empty_prompt/empty_prompt.js +1 -1
  137. package/lib/components/facet/facet_button.js +1 -1
  138. package/lib/components/filter_group/filter_select_item.js +21 -17
  139. package/lib/components/flyout/flyout.js +88 -21
  140. package/lib/components/flyout/flyout.styles.js +10 -6
  141. package/lib/components/flyout/flyout_child.js +217 -0
  142. package/lib/components/flyout/flyout_child.styles.js +37 -0
  143. package/lib/components/flyout/flyout_child_manager.js +120 -0
  144. package/lib/components/flyout/flyout_context.js +21 -0
  145. package/lib/components/flyout/index.js +21 -1
  146. package/lib/components/flyout/sessions/flyout_provider.js +116 -0
  147. package/lib/components/flyout/sessions/flyout_reducer.js +224 -0
  148. package/lib/components/flyout/sessions/index.js +25 -0
  149. package/lib/components/flyout/sessions/types.js +5 -0
  150. package/lib/components/flyout/sessions/use_eui_flyout.js +99 -0
  151. package/lib/components/form/field_number/field_number.js +2 -2
  152. package/lib/components/form/field_text/field_text.js +2 -2
  153. package/lib/components/form/form_control_layout/form_control_layout.js +2 -2
  154. package/lib/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
  155. package/lib/components/form/form_control_layout/form_control_layout_icons.js +2 -2
  156. package/lib/components/form/text_area/text_area.js +2 -2
  157. package/lib/components/header/header_links/header_link.js +1 -1
  158. package/lib/components/header/header_links/header_links.js +1 -1
  159. package/lib/components/header/header_logo/header_logo.js +1 -1
  160. package/lib/components/header/header_section/header_section_item_button.js +1 -1
  161. package/lib/components/icon/icon.js +1 -1
  162. package/lib/components/icon/icon_map.js +1 -4
  163. package/lib/components/key_pad_menu/key_pad_menu_item.js +1 -1
  164. package/lib/components/list_group/list_group.js +2 -2
  165. package/lib/components/list_group/list_group_item.js +2 -2
  166. package/lib/components/list_group/list_group_item_extra_action.js +1 -1
  167. package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
  168. package/lib/components/loading/loading_logo.js +1 -1
  169. package/lib/components/markdown_editor/markdown_editor.js +1 -1
  170. package/lib/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
  171. package/lib/components/markdown_editor/markdown_editor_footer.js +1 -1
  172. package/lib/components/markdown_editor/markdown_editor_toolbar.js +1 -1
  173. package/lib/components/page/page_header/page_header_content.js +1 -1
  174. package/lib/components/pagination/pagination_button.js +1 -1
  175. package/lib/components/progress/progress.js +54 -11
  176. package/lib/components/selectable/selectable_list/selectable_list.js +1 -1
  177. package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
  178. package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  179. package/lib/components/table/table_header_cell.js +1 -1
  180. package/lib/components/table/table_row.styles.js +11 -6
  181. package/lib/components/timeline/timeline_item_icon.js +1 -1
  182. package/lib/components/toast/global_toast_list.js +1 -1
  183. package/lib/components/toast/toast.js +1 -1
  184. package/lib/components/tool_tip/icon_tip.js +1 -1
  185. package/lib/themes/amsterdam/global_styling/variables/_components.js +305 -270
  186. package/optimize/es/components/combo_box/combo_box.a11y.js +53 -2
  187. package/optimize/es/components/combo_box/combo_box.js +26 -8
  188. package/optimize/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +8 -3
  189. package/optimize/es/components/datagrid/body/cell/data_grid_cell.styles.js +9 -4
  190. package/optimize/es/components/datagrid/data_grid.styles.js +4 -1
  191. package/optimize/es/components/filter_group/filter_select_item.js +20 -17
  192. package/optimize/es/components/flyout/flyout.js +88 -21
  193. package/optimize/es/components/flyout/flyout.styles.js +9 -5
  194. package/optimize/es/components/flyout/flyout_child.js +168 -0
  195. package/optimize/es/components/flyout/flyout_child.styles.js +31 -0
  196. package/optimize/es/components/flyout/flyout_child_manager.js +98 -0
  197. package/optimize/es/components/flyout/flyout_context.js +16 -0
  198. package/optimize/es/components/flyout/index.js +3 -1
  199. package/optimize/es/components/flyout/sessions/flyout_provider.js +104 -0
  200. package/optimize/es/components/flyout/sessions/flyout_reducer.js +209 -0
  201. package/optimize/es/components/flyout/sessions/index.js +10 -0
  202. package/optimize/es/components/flyout/sessions/types.js +1 -0
  203. package/optimize/es/components/flyout/sessions/use_eui_flyout.js +94 -0
  204. package/optimize/es/components/icon/icon_map.js +1 -4
  205. package/optimize/es/components/progress/progress.js +38 -9
  206. package/optimize/es/components/table/table_row.styles.js +11 -6
  207. package/optimize/es/themes/amsterdam/global_styling/variables/_components.js +305 -270
  208. package/optimize/lib/components/combo_box/combo_box.a11y.js +53 -2
  209. package/optimize/lib/components/combo_box/combo_box.js +26 -8
  210. package/optimize/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +8 -3
  211. package/optimize/lib/components/datagrid/body/cell/data_grid_cell.styles.js +9 -4
  212. package/optimize/lib/components/datagrid/data_grid.styles.js +4 -1
  213. package/optimize/lib/components/filter_group/filter_select_item.js +20 -17
  214. package/optimize/lib/components/flyout/flyout.js +88 -21
  215. package/optimize/lib/components/flyout/flyout.styles.js +10 -6
  216. package/optimize/lib/components/flyout/flyout_child.js +176 -0
  217. package/optimize/lib/components/flyout/flyout_child.styles.js +37 -0
  218. package/optimize/lib/components/flyout/flyout_child_manager.js +108 -0
  219. package/optimize/lib/components/flyout/flyout_context.js +21 -0
  220. package/optimize/lib/components/flyout/index.js +21 -1
  221. package/optimize/lib/components/flyout/sessions/flyout_provider.js +114 -0
  222. package/optimize/lib/components/flyout/sessions/flyout_reducer.js +217 -0
  223. package/optimize/lib/components/flyout/sessions/index.js +25 -0
  224. package/optimize/lib/components/flyout/sessions/types.js +5 -0
  225. package/optimize/lib/components/flyout/sessions/use_eui_flyout.js +99 -0
  226. package/optimize/lib/components/icon/icon_map.js +1 -4
  227. package/optimize/lib/components/progress/progress.js +41 -9
  228. package/optimize/lib/components/table/table_row.styles.js +11 -6
  229. package/optimize/lib/themes/amsterdam/global_styling/variables/_components.js +305 -270
  230. package/package.json +4 -4
  231. package/test-env/components/avatar/avatar.js +1 -1
  232. package/test-env/components/badge/badge.js +1 -1
  233. package/test-env/components/badge/beta_badge/beta_badge.js +1 -1
  234. package/test-env/components/basic_table/basic_table.js +4 -4
  235. package/test-env/components/basic_table/in_memory_table.js +4 -4
  236. package/test-env/components/button/button.js +1 -1
  237. package/test-env/components/button/button_display/_button_display.js +1 -1
  238. package/test-env/components/button/button_display/_button_display_content.js +1 -1
  239. package/test-env/components/button/button_empty/button_empty.js +1 -1
  240. package/test-env/components/button/button_group/button_group.js +1 -1
  241. package/test-env/components/button/button_group/button_group_button.js +1 -1
  242. package/test-env/components/button/button_icon/button_icon.js +1 -1
  243. package/test-env/components/call_out/call_out.js +1 -1
  244. package/test-env/components/card/card.js +2 -2
  245. package/test-env/components/card/card_select/card_select.js +1 -1
  246. package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
  247. package/test-env/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +1 -1
  248. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +1 -1
  249. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
  250. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +2 -2
  251. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
  252. package/test-env/components/combo_box/combo_box.a11y.js +53 -2
  253. package/test-env/components/combo_box/combo_box.js +26 -8
  254. package/test-env/components/combo_box/combo_box_options_list/combo_box_options_list.js +9 -3
  255. package/test-env/components/comment_list/comment.js +2 -2
  256. package/test-env/components/comment_list/comment_event.js +1 -1
  257. package/test-env/components/comment_list/comment_list.js +2 -2
  258. package/test-env/components/comment_list/comment_timeline.js +1 -1
  259. package/test-env/components/context_menu/context_menu_item.js +1 -1
  260. package/test-env/components/datagrid/body/cell/data_grid_cell.js +12 -12
  261. package/test-env/components/datagrid/body/cell/data_grid_cell.styles.js +9 -4
  262. package/test-env/components/datagrid/body/data_grid_body.js +7 -7
  263. package/test-env/components/datagrid/body/data_grid_body_custom.js +7 -7
  264. package/test-env/components/datagrid/body/data_grid_body_virtualized.js +7 -7
  265. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +6 -6
  266. package/test-env/components/datagrid/controls/column_sorting.js +7 -7
  267. package/test-env/components/datagrid/controls/column_sorting_draggable.js +1 -1
  268. package/test-env/components/datagrid/controls/data_grid_toolbar_control.js +1 -1
  269. package/test-env/components/datagrid/data_grid.styles.js +4 -1
  270. package/test-env/components/datagrid/utils/in_memory.js +6 -6
  271. package/test-env/components/date_picker/date_picker.js +2 -2
  272. package/test-env/components/date_picker/date_picker_range.js +1 -1
  273. package/test-env/components/empty_prompt/empty_prompt.js +1 -1
  274. package/test-env/components/facet/facet_button.js +1 -1
  275. package/test-env/components/filter_group/filter_select_item.js +21 -17
  276. package/test-env/components/flyout/flyout.styles.js +10 -6
  277. package/test-env/components/flyout/flyout_child.js +216 -0
  278. package/test-env/components/flyout/flyout_child.styles.js +37 -0
  279. package/test-env/components/flyout/flyout_child_manager.js +117 -0
  280. package/test-env/components/flyout/flyout_context.js +21 -0
  281. package/test-env/components/flyout/index.js +21 -1
  282. package/test-env/components/flyout/sessions/flyout_provider.js +114 -0
  283. package/test-env/components/flyout/sessions/flyout_reducer.js +217 -0
  284. package/test-env/components/flyout/sessions/index.js +25 -0
  285. package/test-env/components/flyout/sessions/types.js +5 -0
  286. package/test-env/components/flyout/sessions/use_eui_flyout.js +99 -0
  287. package/test-env/components/form/field_number/field_number.js +2 -2
  288. package/test-env/components/form/field_text/field_text.js +2 -2
  289. package/test-env/components/form/form_control_layout/form_control_layout.js +2 -2
  290. package/test-env/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
  291. package/test-env/components/form/form_control_layout/form_control_layout_icons.js +2 -2
  292. package/test-env/components/form/text_area/text_area.js +2 -2
  293. package/test-env/components/header/header_links/header_link.js +1 -1
  294. package/test-env/components/header/header_links/header_links.js +1 -1
  295. package/test-env/components/header/header_logo/header_logo.js +1 -1
  296. package/test-env/components/header/header_section/header_section_item_button.js +1 -1
  297. package/test-env/components/icon/icon_map.js +1 -4
  298. package/test-env/components/key_pad_menu/key_pad_menu_item.js +1 -1
  299. package/test-env/components/list_group/list_group.js +2 -2
  300. package/test-env/components/list_group/list_group_item.js +2 -2
  301. package/test-env/components/list_group/list_group_item_extra_action.js +1 -1
  302. package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
  303. package/test-env/components/loading/loading_logo.js +1 -1
  304. package/test-env/components/markdown_editor/markdown_editor.js +1 -1
  305. package/test-env/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
  306. package/test-env/components/markdown_editor/markdown_editor_footer.js +1 -1
  307. package/test-env/components/markdown_editor/markdown_editor_toolbar.js +1 -1
  308. package/test-env/components/page/page_header/page_header_content.js +1 -1
  309. package/test-env/components/pagination/pagination_button.js +1 -1
  310. package/test-env/components/progress/progress.js +49 -11
  311. package/test-env/components/selectable/selectable_list/selectable_list.js +1 -1
  312. package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
  313. package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  314. package/test-env/components/table/table_header_cell.js +1 -1
  315. package/test-env/components/table/table_row.styles.js +11 -6
  316. package/test-env/components/timeline/timeline_item_icon.js +1 -1
  317. package/test-env/components/toast/global_toast_list.js +1 -1
  318. package/test-env/components/toast/toast.js +1 -1
  319. package/test-env/components/tool_tip/icon_tip.js +1 -1
  320. package/test-env/themes/amsterdam/global_styling/variables/_components.js +305 -270
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.euiFlyoutStyles = exports.euiFlyoutSlideInRight = exports.euiFlyoutSlideInLeft = exports.FLYOUT_BREAKPOINT = void 0;
6
+ exports.maxedFlyoutWidth = exports.euiFlyoutStyles = exports.euiFlyoutSlideInRight = exports.euiFlyoutSlideInLeft = exports.composeFlyoutSizing = exports.FLYOUT_BREAKPOINT = void 0;
7
7
  var _react = require("@emotion/react");
8
8
  var _euiThemeCommon = require("@elastic/eui-theme-common");
9
9
  var _global_styling = require("../../global_styling");
@@ -32,14 +32,15 @@ var euiFlyoutStyles = exports.euiFlyoutStyles = function euiFlyoutStyles(euiThem
32
32
  var euiTheme = euiThemeContext.euiTheme,
33
33
  colorMode = euiThemeContext.colorMode;
34
34
  return {
35
- euiFlyout: /*#__PURE__*/(0, _react.css)("position:fixed;", (0, _global_styling.logicalCSS)('bottom', 0), " ", (0, _global_styling.logicalCSS)('top', 'var(--euiFixedHeadersOffset, 0)'), " ", (0, _global_styling.logicalCSS)('height', 'inherit'), " z-index:", euiTheme.levels.flyout, ";background:", euiTheme.colors.emptyShade, ";display:flex;flex-direction:column;align-items:stretch;&:focus{outline:none;}", (0, _global_styling.euiMaxBreakpoint)(euiThemeContext, FLYOUT_BREAKPOINT), "{", (0, _global_styling.logicalCSS)('max-width', '90vw !important'), ";};label:euiFlyout;"),
35
+ euiFlyout: /*#__PURE__*/(0, _react.css)("position:fixed;", (0, _global_styling.logicalCSS)('bottom', 0), " ", (0, _global_styling.logicalCSS)('top', 'var(--euiFixedHeadersOffset, 0)'), " ", (0, _global_styling.logicalCSS)('height', 'inherit'), " z-index:", euiTheme.levels.flyout, ";background:", euiTheme.colors.emptyShade, ";display:flex;flex-direction:column;align-items:stretch;&:focus{outline:none;}", maxedFlyoutWidth(euiThemeContext), ";;label:euiFlyout;"),
36
36
  // Flyout sizes
37
- s: /*#__PURE__*/(0, _react.css)(composeFlyoutSizing(euiThemeContext, 's'), ";;label:s;"),
38
- m: /*#__PURE__*/(0, _react.css)(composeFlyoutSizing(euiThemeContext, 'm'), ";;label:m;"),
37
+ // When a child flyout is stacked on top of the parent, the parent flyout size will match the child flyout size
38
+ s: /*#__PURE__*/(0, _react.css)(composeFlyoutSizing(euiThemeContext, 's'), " &.euiFlyout--hasChild--stacked.euiFlyout--hasChild--m{", composeFlyoutSizing(euiThemeContext, 'm'), ";};label:s;"),
39
+ m: /*#__PURE__*/(0, _react.css)(composeFlyoutSizing(euiThemeContext, 'm'), " &.euiFlyout--hasChild--stacked.euiFlyout--hasChild--s{", composeFlyoutSizing(euiThemeContext, 's'), ";};label:m;"),
39
40
  l: /*#__PURE__*/(0, _react.css)(composeFlyoutSizing(euiThemeContext, 'l'), ";;label:l;"),
40
41
  noMaxWidth: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-width', 'none'), ";;label:noMaxWidth;"),
41
42
  // Side
42
- right: /*#__PURE__*/(0, _react.css)("clip-path:polygon(-50% 0, 100% 0, 100% 100%, -50% 100%);", (0, _global_styling.logicalCSS)('right', 0), " ", _global_styling.euiCanAnimate, "{animation:", euiFlyoutSlideInRight, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";};label:right;"),
43
+ right: /*#__PURE__*/(0, _react.css)("clip-path:polygon(-50% 0, 100% 0, 100% 100%, -50% 100%);", (0, _global_styling.logicalCSS)('right', 0), " ", _global_styling.euiCanAnimate, "{animation:", euiFlyoutSlideInRight, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";}&.euiFlyout--hasChild{clip-path:none;};label:right;"),
43
44
  // Left-side flyouts should only be used for navigation
44
45
  left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('left', 0), " clip-path:polygon(0 0, 150% 0, 150% 100%, 0 100%);", _global_styling.euiCanAnimate, "{animation:", euiFlyoutSlideInLeft, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";};label:left;"),
45
46
  // Type
@@ -65,7 +66,10 @@ var euiFlyoutStyles = exports.euiFlyoutStyles = function euiFlyoutStyles(euiThem
65
66
  }
66
67
  };
67
68
  };
68
- var composeFlyoutSizing = function composeFlyoutSizing(euiThemeContext, size) {
69
+ var maxedFlyoutWidth = exports.maxedFlyoutWidth = function maxedFlyoutWidth(euiThemeContext) {
70
+ return "\n ".concat((0, _global_styling.euiMaxBreakpoint)(euiThemeContext, FLYOUT_BREAKPOINT), " {\n ").concat((0, _global_styling.logicalCSS)('max-width', '90vw !important'), "\n }\n");
71
+ };
72
+ var composeFlyoutSizing = exports.composeFlyoutSizing = function composeFlyoutSizing(euiThemeContext, size) {
69
73
  var euiTheme = euiThemeContext.euiTheme;
70
74
  var formMaxWidth = (0, _form.euiFormMaxWidth)(euiThemeContext);
71
75
 
@@ -0,0 +1,217 @@
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.EuiFlyoutChild = void 0;
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _propTypes = _interopRequireDefault(require("prop-types"));
10
+ var _classnames = _interopRequireDefault(require("classnames"));
11
+ var _services = require("../../services");
12
+ var _flyout_child = require("./flyout_child.styles");
13
+ var _flyout_close_button = require("./_flyout_close_button");
14
+ var _flyout_context = require("./flyout_context");
15
+ var _flyout_body = require("./flyout_body");
16
+ var _focus_trap = require("../focus_trap");
17
+ var _react2 = require("@emotion/react");
18
+ var _excluded = ["children", "className", "banner", "hideCloseButton", "onClose", "scrollableTabIndex", "size"];
19
+ /*
20
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
21
+ * or more contributor license agreements. Licensed under the Elastic License
22
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
23
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
24
+ * Side Public License, v 1.
25
+ */
26
+ /**
27
+ * Props used to render and configure the child flyout panel
28
+ */
29
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
30
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
31
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
32
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
33
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
34
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
35
+ /**
36
+ * The child flyout is a panel that appears to the left of the parent flyout.
37
+ * It is only visible when the parent flyout is open.
38
+ */
39
+ var EuiFlyoutChild = exports.EuiFlyoutChild = function EuiFlyoutChild(_ref) {
40
+ var children = _ref.children,
41
+ className = _ref.className,
42
+ banner = _ref.banner,
43
+ _ref$hideCloseButton = _ref.hideCloseButton,
44
+ hideCloseButton = _ref$hideCloseButton === void 0 ? false : _ref$hideCloseButton,
45
+ onClose = _ref.onClose,
46
+ _ref$scrollableTabInd = _ref.scrollableTabIndex,
47
+ scrollableTabIndex = _ref$scrollableTabInd === void 0 ? 0 : _ref$scrollableTabInd,
48
+ _ref$size = _ref.size,
49
+ size = _ref$size === void 0 ? 's' : _ref$size,
50
+ rest = _objectWithoutProperties(_ref, _excluded);
51
+ var flyoutContext = (0, _react.useContext)(_flyout_context.EuiFlyoutContext);
52
+ if (!flyoutContext) {
53
+ throw new Error('EuiFlyoutChild must be used as a child of EuiFlyout.');
54
+ }
55
+ var setIsChildFlyoutOpen = flyoutContext.setIsChildFlyoutOpen,
56
+ parentSize = flyoutContext.parentSize;
57
+ (0, _react.useEffect)(function () {
58
+ setIsChildFlyoutOpen === null || setIsChildFlyoutOpen === void 0 || setIsChildFlyoutOpen(true);
59
+ return function () {
60
+ setIsChildFlyoutOpen === null || setIsChildFlyoutOpen === void 0 || setIsChildFlyoutOpen(false);
61
+ };
62
+ }, [setIsChildFlyoutOpen]);
63
+ if (_react.default.Children.count(children) === 0) {
64
+ console.warn('EuiFlyoutChild was rendered with no children!');
65
+ }
66
+ if (parentSize === 'm' && size === 'm') {
67
+ throw new Error('When the parent EuiFlyout size is "m", the EuiFlyoutChild size cannot be "m". Please use size "s" for the EuiFlyoutChild.');
68
+ }
69
+ var handleClose = function handleClose(event) {
70
+ setIsChildFlyoutOpen === null || setIsChildFlyoutOpen === void 0 || setIsChildFlyoutOpen(false);
71
+ onClose(event);
72
+ };
73
+ var flyoutTitleText;
74
+ var hasDescribedByBody = false;
75
+ _react.Children.forEach(children, function (child) {
76
+ if ( /*#__PURE__*/_react.default.isValidElement(child)) {
77
+ var _child$type;
78
+ if (((_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) === 'EuiFlyoutHeader') {
79
+ // Attempt to extract string content from header for ARIA
80
+ var headerChildren = child.props.children;
81
+ if (typeof headerChildren === 'string') {
82
+ flyoutTitleText = headerChildren;
83
+ } else if ( /*#__PURE__*/_react.default.isValidElement(headerChildren) &&
84
+ // Check if props exist and children is a string
85
+ typeof headerChildren.props.children === 'string') {
86
+ flyoutTitleText = headerChildren.props.children;
87
+ } else if (Array.isArray(headerChildren)) {
88
+ // Find the first string child if headerChildren is an array
89
+ flyoutTitleText = headerChildren.find(function (cNode) {
90
+ return typeof cNode === 'string';
91
+ });
92
+ }
93
+ }
94
+ if (child.type === _flyout_body.EuiFlyoutBody) {
95
+ hasDescribedByBody = true;
96
+ }
97
+ }
98
+ });
99
+ var titleIdGenerated = (0, _services.useGeneratedHtmlId)({
100
+ prefix: 'euiFlyoutChildTitle'
101
+ });
102
+ var bodyIdGenerated = (0, _services.useGeneratedHtmlId)({
103
+ prefix: 'euiFlyoutChildBody'
104
+ });
105
+ var ariaLabelledBy = flyoutTitleText ? titleIdGenerated : undefined;
106
+ var ariaDescribedBy = hasDescribedByBody ? bodyIdGenerated : undefined;
107
+ // Use existing aria-label if provided, otherwise fallback if no labelledby can be derived
108
+ var ariaLabel = rest['aria-label'] || (!ariaLabelledBy && !flyoutTitleText ? 'Flyout panel' : undefined);
109
+ var processedChildren = (0, _react.useMemo)(function () {
110
+ return _react.Children.map(children, function (child) {
111
+ if ( /*#__PURE__*/_react.default.isValidElement(child)) {
112
+ var _child$type2, _child$type3;
113
+ if ((child.type === _flyout_body.EuiFlyoutBody || ((_child$type2 = child.type) === null || _child$type2 === void 0 ? void 0 : _child$type2.displayName) === 'EuiFlyoutBody') && hasDescribedByBody) {
114
+ return /*#__PURE__*/_react.default.cloneElement(child, {
115
+ id: bodyIdGenerated
116
+ });
117
+ }
118
+ // If EuiFlyoutHeader is found and we derived flyoutTitleText, set its ID
119
+ if (((_child$type3 = child.type) === null || _child$type3 === void 0 ? void 0 : _child$type3.displayName) === 'EuiFlyoutHeader' && flyoutTitleText && ariaLabelledBy) {
120
+ return /*#__PURE__*/_react.default.cloneElement(child, {
121
+ id: titleIdGenerated
122
+ });
123
+ }
124
+ }
125
+ return child;
126
+ });
127
+ }, [children, bodyIdGenerated, titleIdGenerated, hasDescribedByBody, flyoutTitleText, ariaLabelledBy]);
128
+ var flyoutWrapperRef = (0, _react.useRef)(null);
129
+ var classes = (0, _classnames.default)('euiFlyoutChild', className);
130
+ var styles = (0, _services.useEuiMemoizedStyles)(_flyout_child.euiFlyoutChildStyles);
131
+ var childLayoutMode = flyoutContext.childLayoutMode,
132
+ parentFlyoutRef = flyoutContext.parentFlyoutRef;
133
+ var flyoutChildCss = [styles.euiFlyoutChild, size === 's' ? styles.s : styles.m, childLayoutMode === 'side-by-side' ? styles.sidePosition : styles.stackedPosition];
134
+ return (0, _react2.jsx)(_focus_trap.EuiFocusTrap, {
135
+ returnFocus: function returnFocus() {
136
+ if (parentFlyoutRef !== null && parentFlyoutRef !== void 0 && parentFlyoutRef.current) {
137
+ parentFlyoutRef.current.focus();
138
+ return false; // We've handled focus
139
+ }
140
+ return true;
141
+ },
142
+ shards: [],
143
+ disabled: false
144
+ }, (0, _react2.jsx)("div", _extends({
145
+ ref: flyoutWrapperRef,
146
+ className: classes,
147
+ css: flyoutChildCss,
148
+ "data-test-subj": "euiFlyoutChild",
149
+ role: "dialog",
150
+ "aria-modal": "true",
151
+ "aria-label": ariaLabel,
152
+ "aria-labelledby": ariaLabelledBy,
153
+ "aria-describedby": ariaDescribedBy,
154
+ tabIndex: -1
155
+ }, rest), flyoutTitleText && !ariaLabelledBy && (0, _react2.jsx)("h2", {
156
+ id: titleIdGenerated,
157
+ className: "euiScreenReaderOnly"
158
+ }, flyoutTitleText), !hideCloseButton && (0, _react2.jsx)(_flyout_close_button.EuiFlyoutCloseButton, {
159
+ className: "euiFlyoutChild__closeButton",
160
+ css: styles.closeButton,
161
+ onClose: handleClose,
162
+ side: "right",
163
+ closeButtonPosition: "inside",
164
+ "data-test-subj": "euiFlyoutChildCloseButton"
165
+ }), (0, _react2.jsx)("div", {
166
+ tabIndex: scrollableTabIndex,
167
+ className: "euiFlyoutChild__overflow",
168
+ css: styles.overflow.overflow
169
+ }, banner && (0, _react2.jsx)("div", {
170
+ className: "euiFlyoutChild__banner",
171
+ css: styles.banner,
172
+ "data-test-subj": "euiFlyoutChildBanner"
173
+ }, banner), (0, _react2.jsx)("div", {
174
+ className: "euiFlyoutChild__overflowContent",
175
+ css: styles.overflow.wrapper
176
+ }, processedChildren))));
177
+ };
178
+ EuiFlyoutChild.propTypes = {
179
+ /**
180
+ * Called when the child panel's close button is clicked
181
+ */
182
+ onClose: _propTypes.default.func.isRequired,
183
+ /**
184
+ * Use to display a banner at the top of the child. It is suggested to use `EuiCallOut` for it.
185
+ */
186
+ banner: _propTypes.default.node,
187
+ /**
188
+ * Hides the default close button. You must provide another close button somewhere within the child flyout.
189
+ * @default false
190
+ */
191
+ hideCloseButton: _propTypes.default.bool,
192
+ /**
193
+ * [Scrollable regions (or their children) should be focusable](https://dequeuniversity.com/rules/axe/4.0/scrollable-region-focusable)
194
+ * to allow keyboard users to scroll the region via arrow keys.
195
+ *
196
+ * By default, EuiFlyoutChild's scroll overflow wrapper sets a `tabIndex` of `0`.
197
+ * If you know your flyout child content already contains focusable children
198
+ * that satisfy keyboard accessibility requirements, you can use this prop
199
+ * to override this default.
200
+ */
201
+ scrollableTabIndex: _propTypes.default.number,
202
+ /**
203
+ * Size of the child flyout panel.
204
+ * When the parent flyout is 'm', child is limited to 's'.
205
+ * @default 's'
206
+ */
207
+ size: _propTypes.default.oneOf(["s", "m"]),
208
+ /**
209
+ * Children are implicitly part of FunctionComponent, but good to have if props type is standalone.
210
+ */
211
+ children: _propTypes.default.node,
212
+ className: _propTypes.default.string,
213
+ "aria-label": _propTypes.default.string,
214
+ "data-test-subj": _propTypes.default.string,
215
+ css: _propTypes.default.any
216
+ };
217
+ EuiFlyoutChild.displayName = 'EuiFlyoutChild';
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.euiFlyoutChildStyles = void 0;
7
+ var _react = require("@emotion/react");
8
+ var _global_styling = require("../../global_styling");
9
+ var _flyout = require("./flyout.styles");
10
+ /*
11
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
12
+ * or more contributor license agreements. Licensed under the Elastic License
13
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
14
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
15
+ * Side Public License, v 1.
16
+ */
17
+
18
+ var euiFlyoutChildStyles = exports.euiFlyoutChildStyles = function euiFlyoutChildStyles(euiThemeContext) {
19
+ var euiTheme = euiThemeContext.euiTheme;
20
+ return {
21
+ // Base styles for the child flyout
22
+ euiFlyoutChild: /*#__PURE__*/(0, _react.css)("position:absolute;inset-block-start:0;inset-inline-start:0;block-size:100%;background:", euiTheme.colors.backgroundBaseSubdued, ";display:flex;flex-direction:column;", (0, _global_styling.logicalCSSWithFallback)('overflow-y', 'hidden'), " ", (0, _global_styling.logicalCSS)('height', '100%'), " z-index:", Number(euiTheme.levels.flyout) + 1, ";border-inline-start:", euiTheme.border.thin, ";", (0, _flyout.maxedFlyoutWidth)(euiThemeContext), ";;label:euiFlyoutChild;"),
23
+ // Position variants based on screen size
24
+ sidePosition: /*#__PURE__*/(0, _react.css)("transform:translateX(-100%);border-inline-end:", euiTheme.border.thin, ";;label:sidePosition;"),
25
+ stackedPosition: /*#__PURE__*/(0, _react.css)("inset-inline-end:0;inline-size:100%;border-block-end:", euiTheme.border.thin, ";;label:stackedPosition;"),
26
+ s: /*#__PURE__*/(0, _react.css)((0, _flyout.composeFlyoutSizing)(euiThemeContext, 's'), ";;label:s;"),
27
+ m: /*#__PURE__*/(0, _react.css)((0, _flyout.composeFlyoutSizing)(euiThemeContext, 'm'), ";;label:m;"),
28
+ closeButton: /*#__PURE__*/(0, _react.css)("position:absolute;inset-block-start:", euiTheme.size.s, ";inset-inline-end:", euiTheme.size.s, ";z-index:1;;label:closeButton;"),
29
+ overflow: {
30
+ overflow: /*#__PURE__*/(0, _react.css)("flex-grow:1;display:flex;flex-direction:column;", (0, _global_styling.euiYScroll)(euiThemeContext), ";;label:overflow;"),
31
+ wrapper: /*#__PURE__*/(0, _react.css)("display:flex;flex-direction:column;flex-grow:1;", (0, _global_styling.logicalCSS)('overflow-x', 'auto'), ";;label:wrapper;")
32
+ },
33
+ banner: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSSWithFallback)('overflow-x', 'hidden'), " ", (0, _global_styling.highContrastModeStyles)(euiThemeContext, {
34
+ preferred: (0, _global_styling.logicalCSS)('border-bottom', euiTheme.border.thin)
35
+ }), ";;label:banner;")
36
+ };
37
+ };
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.EuiFlyoutChildProvider = void 0;
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _propTypes = _interopRequireDefault(require("prop-types"));
10
+ var _services = require("../../services");
11
+ var _flyout_context = require("./flyout_context");
12
+ var _react2 = require("@emotion/react");
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
15
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
17
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
18
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
19
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
20
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
21
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } /*
22
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
23
+ * or more contributor license agreements. Licensed under the Elastic License
24
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
25
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
26
+ * Side Public License, v 1.
27
+ */
28
+ /**
29
+ * An intermediate component between EuiFlyout and EuiFlyoutChild.
30
+ * It is responsible for managing the state of the child flyout, and passing it to EuiFlyoutContext.
31
+ * It removes the responsibility of managing child flyout state from EuiFlyout, which is especially important there might not be a child flyout.
32
+ */
33
+ var EuiFlyoutChildProvider = exports.EuiFlyoutChildProvider = function EuiFlyoutChildProvider(_ref) {
34
+ var parentSize = _ref.parentSize,
35
+ parentFlyoutRef = _ref.parentFlyoutRef,
36
+ childElement = _ref.childElement,
37
+ childrenToRender = _ref.childrenToRender,
38
+ reportIsChildOpen = _ref.reportIsChildOpen,
39
+ reportChildLayoutMode = _ref.reportChildLayoutMode;
40
+ var _useEuiTheme = (0, _services.useEuiTheme)(),
41
+ euiTheme = _useEuiTheme.euiTheme;
42
+ var _useState = (0, _react.useState)(false),
43
+ _useState2 = _slicedToArray(_useState, 2),
44
+ isChildFlyoutOpen = _useState2[0],
45
+ setIsChildFlyoutOpen = _useState2[1];
46
+ var _useState3 = (0, _react.useState)(typeof window !== 'undefined' ? window.innerWidth : Infinity),
47
+ _useState4 = _slicedToArray(_useState3, 2),
48
+ windowWidth = _useState4[0],
49
+ setWindowWidth = _useState4[1];
50
+ var _useState5 = (0, _react.useState)('side-by-side'),
51
+ _useState6 = _slicedToArray(_useState5, 2),
52
+ childLayoutMode = _useState6[0],
53
+ setChildLayoutMode = _useState6[1];
54
+
55
+ // update windowWidth on resize
56
+ (0, _react.useEffect)(function () {
57
+ if (typeof window === 'undefined') return;
58
+ var handleResize = function handleResize() {
59
+ setWindowWidth(window.innerWidth);
60
+ };
61
+ window.addEventListener('resize', handleResize);
62
+ handleResize();
63
+ return function () {
64
+ return window.removeEventListener('resize', handleResize);
65
+ };
66
+ }, []);
67
+
68
+ // Calculate stacking breakpoint value for child flyout.
69
+ // Stacking breakpoint value is a sum of parent breakpoint value and child breakpoint value.
70
+ var stackingBreakpointValue = (0, _react.useMemo)(function () {
71
+ var parentSizeName = parentSize;
72
+ var childSizeName = childElement.props.size || 's';
73
+ var parentNumericValue = 0;
74
+ if (parentSizeName === 's') parentNumericValue = euiTheme.breakpoint.s;else if (parentSizeName === 'm') parentNumericValue = euiTheme.breakpoint.m;
75
+ // Parent 'l' size is not allowed when child is present, so no need to check here
76
+
77
+ var childNumericValue = 0;
78
+ if (childSizeName === 's') childNumericValue = euiTheme.breakpoint.s;else if (childSizeName === 'm') childNumericValue = euiTheme.breakpoint.m;
79
+ return parentNumericValue + childNumericValue;
80
+ }, [parentSize, childElement.props.size, euiTheme.breakpoint]);
81
+
82
+ // update childLayoutMode based on windowWidth and the calculated stackingBreakpoint
83
+ (0, _react.useEffect)(function () {
84
+ if (windowWidth >= stackingBreakpointValue) {
85
+ setChildLayoutMode('side-by-side');
86
+ } else {
87
+ setChildLayoutMode('stacked');
88
+ }
89
+ }, [windowWidth, stackingBreakpointValue]);
90
+
91
+ // report isChildFlyoutOpen changes to the parent EuiFlyout
92
+ (0, _react.useEffect)(function () {
93
+ reportIsChildOpen(isChildFlyoutOpen);
94
+ }, [isChildFlyoutOpen, reportIsChildOpen]);
95
+
96
+ // report childLayoutMode changes to the parent EuiFlyout
97
+ (0, _react.useEffect)(function () {
98
+ reportChildLayoutMode(childLayoutMode);
99
+ }, [childLayoutMode, reportChildLayoutMode]);
100
+ var contextValue = (0, _react.useMemo)(function () {
101
+ return {
102
+ parentSize: parentSize,
103
+ parentFlyoutRef: parentFlyoutRef,
104
+ isChildFlyoutOpen: isChildFlyoutOpen,
105
+ setIsChildFlyoutOpen: setIsChildFlyoutOpen,
106
+ childLayoutMode: childLayoutMode
107
+ };
108
+ }, [parentSize, parentFlyoutRef, isChildFlyoutOpen, setIsChildFlyoutOpen, childLayoutMode]);
109
+ return (0, _react2.jsx)(_flyout_context.EuiFlyoutContext.Provider, {
110
+ value: contextValue
111
+ }, childrenToRender);
112
+ };
113
+ EuiFlyoutChildProvider.propTypes = {
114
+ parentSize: _propTypes.default.oneOf(["s", "m"]).isRequired,
115
+ parentFlyoutRef: _propTypes.default.any.isRequired,
116
+ childElement: _propTypes.default.element.isRequired,
117
+ childrenToRender: _propTypes.default.node.isRequired,
118
+ reportIsChildOpen: _propTypes.default.func.isRequired,
119
+ reportChildLayoutMode: _propTypes.default.func.isRequired
120
+ };
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.EuiFlyoutContext = void 0;
7
+ var _react = require("react");
8
+ /*
9
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
10
+ * or more contributor license agreements. Licensed under the Elastic License
11
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
12
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
13
+ * Side Public License, v 1.
14
+ */
15
+
16
+ /**
17
+ * Context shared between the main and child flyouts
18
+ * @internal
19
+ */
20
+
21
+ var EuiFlyoutContext = exports.EuiFlyoutContext = /*#__PURE__*/(0, _react.createContext)(null);
@@ -15,6 +15,12 @@ Object.defineProperty(exports, "EuiFlyoutBody", {
15
15
  return _flyout_body.EuiFlyoutBody;
16
16
  }
17
17
  });
18
+ Object.defineProperty(exports, "EuiFlyoutChild", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _flyout_child.EuiFlyoutChild;
22
+ }
23
+ });
18
24
  Object.defineProperty(exports, "EuiFlyoutFooter", {
19
25
  enumerable: true,
20
26
  get: function get() {
@@ -33,6 +39,12 @@ Object.defineProperty(exports, "EuiFlyoutResizable", {
33
39
  return _flyout_resizable.EuiFlyoutResizable;
34
40
  }
35
41
  });
42
+ Object.defineProperty(exports, "EuiFlyoutSessionProvider", {
43
+ enumerable: true,
44
+ get: function get() {
45
+ return _sessions.EuiFlyoutSessionProvider;
46
+ }
47
+ });
36
48
  Object.defineProperty(exports, "euiFlyoutSlideInLeft", {
37
49
  enumerable: true,
38
50
  get: function get() {
@@ -45,9 +57,17 @@ Object.defineProperty(exports, "euiFlyoutSlideInRight", {
45
57
  return _flyout2.euiFlyoutSlideInRight;
46
58
  }
47
59
  });
60
+ Object.defineProperty(exports, "useEuiFlyoutSession", {
61
+ enumerable: true,
62
+ get: function get() {
63
+ return _sessions.useEuiFlyoutSession;
64
+ }
65
+ });
48
66
  var _flyout = require("./flyout");
49
67
  var _flyout_body = require("./flyout_body");
50
68
  var _flyout_footer = require("./flyout_footer");
51
69
  var _flyout_header = require("./flyout_header");
52
70
  var _flyout2 = require("./flyout.styles");
53
- var _flyout_resizable = require("./flyout_resizable");
71
+ var _flyout_resizable = require("./flyout_resizable");
72
+ var _flyout_child = require("./flyout_child");
73
+ var _sessions = require("./sessions");
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.useEuiFlyoutSessionContext = exports.EuiFlyoutSessionProvider = void 0;
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _index = require("../index");
10
+ var _flyout_reducer = require("./flyout_reducer");
11
+ var _react2 = require("@emotion/react");
12
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
13
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
15
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
16
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
17
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
18
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
19
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
20
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } /*
21
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
22
+ * or more contributor license agreements. Licensed under the Elastic License
23
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
24
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
25
+ * Side Public License, v 1.
26
+ */
27
+ var EuiFlyoutSessionContext = /*#__PURE__*/(0, _react.createContext)(null);
28
+
29
+ /**
30
+ * Accesses the state data and dispatch function from the context of EuiFlyoutSessionProvider
31
+ * Use this if you need to debug the state or need direct access to the dispatch function, otherwise use useEuiFlyoutSession hook.
32
+ */
33
+ var useEuiFlyoutSessionContext = exports.useEuiFlyoutSessionContext = function useEuiFlyoutSessionContext() {
34
+ var context = (0, _react.useContext)(EuiFlyoutSessionContext);
35
+ if (!context) {
36
+ throw new Error('useEuiFlyoutSessionContext must be used within a EuiFlyoutSessionProvider');
37
+ }
38
+ return context;
39
+ };
40
+
41
+ /**
42
+ * FlyoutProvider is a component that provides a context for Flyout components.
43
+ * It is used to manage the state of the Flyout and its child.
44
+ * It also renders the Flyout and FlyoutChild components.
45
+ *
46
+ * @param children - The children of the FlyoutProvider component.
47
+ * @param renderMainFlyoutContent - A function that renders the content of the main Flyout.
48
+ * @param renderChildFlyoutContent - A function that renders the content of the child Flyout.
49
+ * @returns The FlyoutProvider component.
50
+ */
51
+ var EuiFlyoutSessionProvider = exports.EuiFlyoutSessionProvider = function EuiFlyoutSessionProvider(_ref) {
52
+ var children = _ref.children,
53
+ renderMainFlyoutContent = _ref.renderMainFlyoutContent,
54
+ renderChildFlyoutContent = _ref.renderChildFlyoutContent;
55
+ var _useReducer = (0, _react.useReducer)(_flyout_reducer.flyoutReducer, _flyout_reducer.initialFlyoutState),
56
+ _useReducer2 = _slicedToArray(_useReducer, 2),
57
+ state = _useReducer2[0],
58
+ dispatch = _useReducer2[1];
59
+ var activeFlyoutGroup = state.activeFlyoutGroup;
60
+ var handleClose = function handleClose() {
61
+ dispatch({
62
+ type: 'CLEAR_HISTORY'
63
+ });
64
+ };
65
+ var handleCloseChild = function handleCloseChild() {
66
+ dispatch({
67
+ type: 'CLOSE_CHILD_FLYOUT'
68
+ });
69
+ };
70
+ var mainFlyoutContentNode = null;
71
+ var childFlyoutContentNode = null;
72
+ if (activeFlyoutGroup) {
73
+ var mainRenderContext = {
74
+ flyoutProps: activeFlyoutGroup.config.mainFlyoutProps || {},
75
+ flyoutSize: activeFlyoutGroup.config.mainSize,
76
+ flyoutType: 'main',
77
+ dispatch: dispatch,
78
+ activeFlyoutGroup: activeFlyoutGroup,
79
+ onCloseFlyout: handleClose,
80
+ onCloseChildFlyout: handleCloseChild,
81
+ meta: activeFlyoutGroup.meta
82
+ };
83
+ mainFlyoutContentNode = renderMainFlyoutContent(mainRenderContext);
84
+ if (activeFlyoutGroup.isChildOpen && renderChildFlyoutContent) {
85
+ var childRenderContext = {
86
+ flyoutProps: activeFlyoutGroup.config.childFlyoutProps || {},
87
+ flyoutSize: activeFlyoutGroup.config.childSize,
88
+ flyoutType: 'child',
89
+ dispatch: dispatch,
90
+ activeFlyoutGroup: activeFlyoutGroup,
91
+ onCloseFlyout: handleClose,
92
+ onCloseChildFlyout: handleCloseChild,
93
+ meta: activeFlyoutGroup.meta
94
+ };
95
+ childFlyoutContentNode = renderChildFlyoutContent(childRenderContext);
96
+ } else if (activeFlyoutGroup.isChildOpen && !renderChildFlyoutContent) {
97
+ console.warn('EuiFlyoutSessionProvider: A child flyout is open, but renderChildFlyoutContent was not provided.');
98
+ }
99
+ }
100
+ var config = activeFlyoutGroup === null || activeFlyoutGroup === void 0 ? void 0 : activeFlyoutGroup.config;
101
+ var flyoutPropsMain = (config === null || config === void 0 ? void 0 : config.mainFlyoutProps) || {};
102
+ var flyoutPropsChild = (config === null || config === void 0 ? void 0 : config.childFlyoutProps) || {};
103
+ return (0, _react2.jsx)(EuiFlyoutSessionContext.Provider, {
104
+ value: {
105
+ state: state,
106
+ dispatch: dispatch
107
+ }
108
+ }, children, (activeFlyoutGroup === null || activeFlyoutGroup === void 0 ? void 0 : activeFlyoutGroup.isMainOpen) && (0, _react2.jsx)(_index.EuiFlyout, _extends({
109
+ onClose: handleClose,
110
+ size: activeFlyoutGroup.config.mainSize,
111
+ ownFocus: !activeFlyoutGroup.isChildOpen
112
+ }, flyoutPropsMain), mainFlyoutContentNode, activeFlyoutGroup.isChildOpen && childFlyoutContentNode && (0, _react2.jsx)(_index.EuiFlyoutChild, _extends({
113
+ onClose: handleCloseChild,
114
+ size: activeFlyoutGroup.config.childSize
115
+ }, flyoutPropsChild), childFlyoutContentNode)));
116
+ };