@elastic/eui 66.0.0 → 67.1.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 (325) hide show
  1. package/dist/eui_theme_dark.css +0 -345
  2. package/dist/eui_theme_dark.json +0 -6
  3. package/dist/eui_theme_dark.json.d.ts +0 -6
  4. package/dist/eui_theme_dark.min.css +1 -1
  5. package/dist/eui_theme_light.css +0 -345
  6. package/dist/eui_theme_light.json +0 -6
  7. package/dist/eui_theme_light.json.d.ts +0 -6
  8. package/dist/eui_theme_light.min.css +1 -1
  9. package/es/components/badge/badge.js +84 -78
  10. package/es/components/badge/badge.styles.js +56 -0
  11. package/es/components/basic_table/in_memory_table.js +8 -0
  12. package/es/components/button/button.js +0 -1
  13. package/es/components/button/button_display/_button_display.js +20 -6
  14. package/es/components/button/button_display/_button_display.styles.js +2 -2
  15. package/es/components/button/button_display/_button_display_content.js +5 -3
  16. package/es/components/button/button_display/_button_display_content.styles.js +4 -1
  17. package/es/components/button/button_empty/button_empty.js +10 -1
  18. package/es/components/card/card.js +2 -2
  19. package/es/components/card/card.styles.js +5 -2
  20. package/es/components/collapsible_nav/collapsible_nav.js +0 -5
  21. package/es/components/date_picker/auto_refresh/auto_refresh.js +6 -1
  22. package/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js +6 -2
  23. package/es/components/expression/expression.js +12 -2
  24. package/es/components/header/header_links/header_link.js +10 -1
  25. package/es/components/image/image.js +6 -1
  26. package/es/components/image/image_fullscreen_wrapper.js +2 -3
  27. package/es/components/notification/notification_event.js +25 -6
  28. package/es/components/notification/notification_event_meta.js +1 -1
  29. package/es/components/overlay_mask/overlay_mask.js +27 -65
  30. package/es/components/overlay_mask/overlay_mask.styles.js +28 -0
  31. package/es/components/page/page_content/page_content.js +1 -2
  32. package/es/components/page/page_content/page_content_body.js +1 -2
  33. package/es/components/page/page_content/page_content_header.js +1 -2
  34. package/es/components/page/page_content/page_content_header_section.js +1 -2
  35. package/es/components/page/page_section/page_section.js +15 -3
  36. package/es/components/page/page_side_bar/page_side_bar.js +1 -2
  37. package/es/components/page/page_template.js +3 -1
  38. package/es/components/page_template/empty_prompt/page_empty_prompt.js +11 -1
  39. package/es/components/page_template/page_template.js +18 -2
  40. package/es/components/pagination/pagination.js +17 -4
  41. package/es/components/pagination/pagination.styles.js +31 -0
  42. package/es/components/pagination/pagination_button.js +17 -5
  43. package/es/components/pagination/pagination_button.styles.js +30 -0
  44. package/es/components/pagination/pagination_button_arrow.js +5 -0
  45. package/es/components/popover/popover_title.js +2 -2
  46. package/es/components/popover/popover_title.styles.js +18 -6
  47. package/es/components/progress/progress.js +6 -1
  48. package/es/components/provider/cache/cache_provider.js +3 -9
  49. package/es/components/provider/provider.js +25 -2
  50. package/es/components/resizable_container/resizable_panel.js +6 -1
  51. package/es/components/search_bar/filters/custom_component_filter.js +16 -0
  52. package/es/components/search_bar/filters/filters.js +6 -0
  53. package/es/components/search_bar/query/ast.js +12 -0
  54. package/es/components/search_bar/query/ast_to_es_query_dsl.js +15 -10
  55. package/es/components/search_bar/query/query.js +17 -0
  56. package/es/components/search_bar/search_bar.js +4 -0
  57. package/es/components/search_bar/search_filters.js +4 -0
  58. package/es/components/selectable/selectable_list/selectable_list.js +2 -2
  59. package/es/components/selectable/selectable_list/selectable_list_item.js +2 -2
  60. package/es/components/side_nav/side_nav.js +5 -0
  61. package/es/components/suggest/suggest.js +10 -1
  62. package/es/components/tool_tip/tool_tip.js +42 -66
  63. package/es/components/tool_tip/tool_tip.styles.js +107 -0
  64. package/es/components/tool_tip/tool_tip_anchor.js +73 -0
  65. package/es/components/tool_tip/tool_tip_arrow.js +20 -0
  66. package/es/components/tool_tip/tool_tip_popover.js +48 -101
  67. package/es/global_styling/index.js +2 -1
  68. package/es/global_styling/utility/animations.js +13 -0
  69. package/es/services/color/contrast.js +2 -0
  70. package/es/services/index.js +1 -1
  71. package/es/services/theme/context.js +2 -1
  72. package/es/services/theme/hooks.js +27 -1
  73. package/es/services/theme/index.js +1 -1
  74. package/es/services/theme/provider.js +15 -1
  75. package/eui.d.ts +232 -79
  76. package/i18ntokens.json +54 -54
  77. package/lib/components/badge/badge.js +92 -80
  78. package/lib/components/badge/badge.styles.js +61 -0
  79. package/lib/components/basic_table/in_memory_table.js +8 -0
  80. package/lib/components/button/button.js +0 -1
  81. package/lib/components/button/button_display/_button_display.js +20 -6
  82. package/lib/components/button/button_display/_button_display.styles.js +2 -2
  83. package/lib/components/button/button_display/_button_display_content.js +9 -4
  84. package/lib/components/button/button_display/_button_display_content.styles.js +4 -1
  85. package/lib/components/button/button_empty/button_empty.js +10 -1
  86. package/lib/components/card/card.js +2 -2
  87. package/lib/components/card/card.styles.js +5 -2
  88. package/lib/components/collapsible_nav/collapsible_nav.js +0 -5
  89. package/lib/components/date_picker/auto_refresh/auto_refresh.js +6 -1
  90. package/lib/components/date_picker/super_date_picker/date_popover/date_popover_button.js +6 -1
  91. package/lib/components/expression/expression.js +12 -2
  92. package/lib/components/header/header_links/header_link.js +10 -1
  93. package/lib/components/image/image.js +6 -1
  94. package/lib/components/image/image_fullscreen_wrapper.js +2 -3
  95. package/lib/components/notification/notification_event.js +28 -9
  96. package/lib/components/notification/notification_event_meta.js +1 -1
  97. package/lib/components/overlay_mask/overlay_mask.js +27 -65
  98. package/lib/components/overlay_mask/overlay_mask.styles.js +34 -0
  99. package/lib/components/page/page_content/page_content.js +1 -2
  100. package/lib/components/page/page_content/page_content_body.js +1 -2
  101. package/lib/components/page/page_content/page_content_header.js +1 -2
  102. package/lib/components/page/page_content/page_content_header_section.js +1 -2
  103. package/lib/components/page/page_section/page_section.js +15 -3
  104. package/lib/components/page/page_side_bar/page_side_bar.js +1 -2
  105. package/lib/components/page/page_template.js +3 -1
  106. package/lib/components/page_template/empty_prompt/page_empty_prompt.js +11 -1
  107. package/lib/components/page_template/page_template.js +18 -2
  108. package/lib/components/pagination/pagination.js +18 -3
  109. package/lib/components/pagination/pagination.styles.js +34 -0
  110. package/lib/components/pagination/pagination_button.js +9 -4
  111. package/lib/components/pagination/pagination_button.styles.js +45 -0
  112. package/lib/components/pagination/pagination_button_arrow.js +7 -0
  113. package/lib/components/popover/popover_title.js +2 -2
  114. package/lib/components/popover/popover_title.styles.js +19 -7
  115. package/lib/components/progress/progress.js +6 -1
  116. package/lib/components/provider/cache/cache_provider.js +3 -11
  117. package/lib/components/provider/provider.js +31 -6
  118. package/lib/components/resizable_container/resizable_panel.js +6 -1
  119. package/lib/components/search_bar/filters/custom_component_filter.js +29 -0
  120. package/lib/components/search_bar/filters/filters.js +7 -0
  121. package/lib/components/search_bar/query/ast.js +12 -0
  122. package/lib/components/search_bar/query/ast_to_es_query_dsl.js +16 -11
  123. package/lib/components/search_bar/query/query.js +17 -0
  124. package/lib/components/search_bar/search_bar.js +4 -0
  125. package/lib/components/search_bar/search_filters.js +4 -0
  126. package/lib/components/selectable/selectable_list/selectable_list.js +2 -2
  127. package/lib/components/selectable/selectable_list/selectable_list_item.js +2 -2
  128. package/lib/components/side_nav/side_nav.js +5 -0
  129. package/lib/components/suggest/suggest.js +10 -1
  130. package/lib/components/tool_tip/tool_tip.js +43 -64
  131. package/lib/components/tool_tip/tool_tip.styles.js +123 -0
  132. package/lib/components/tool_tip/tool_tip_anchor.js +87 -0
  133. package/lib/components/tool_tip/tool_tip_arrow.js +28 -0
  134. package/lib/components/tool_tip/tool_tip_popover.js +49 -98
  135. package/lib/global_styling/index.js +13 -0
  136. package/lib/global_styling/utility/animations.js +15 -0
  137. package/lib/services/color/contrast.js +6 -1
  138. package/lib/services/index.js +7 -0
  139. package/lib/services/theme/context.js +4 -2
  140. package/lib/services/theme/hooks.js +28 -0
  141. package/lib/services/theme/index.js +12 -0
  142. package/lib/services/theme/provider.js +23 -2
  143. package/optimize/es/components/badge/badge.js +82 -76
  144. package/optimize/es/components/badge/badge.styles.js +56 -0
  145. package/optimize/es/components/basic_table/in_memory_table.js +4 -0
  146. package/optimize/es/components/button/button.js +0 -1
  147. package/optimize/es/components/button/button_display/_button_display.js +8 -3
  148. package/optimize/es/components/button/button_display/_button_display.styles.js +2 -2
  149. package/optimize/es/components/button/button_display/_button_display_content.js +3 -1
  150. package/optimize/es/components/button/button_display/_button_display_content.styles.js +4 -1
  151. package/optimize/es/components/card/card.js +2 -2
  152. package/optimize/es/components/card/card.styles.js +5 -2
  153. package/optimize/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js +0 -1
  154. package/optimize/es/components/image/image_fullscreen_wrapper.js +2 -3
  155. package/optimize/es/components/notification/notification_event.js +10 -4
  156. package/optimize/es/components/overlay_mask/overlay_mask.js +27 -60
  157. package/optimize/es/components/overlay_mask/overlay_mask.styles.js +28 -0
  158. package/optimize/es/components/page/page_content/page_content.js +1 -2
  159. package/optimize/es/components/page/page_content/page_content_body.js +1 -2
  160. package/optimize/es/components/page/page_content/page_content_header.js +1 -2
  161. package/optimize/es/components/page/page_content/page_content_header_section.js +1 -2
  162. package/optimize/es/components/page/page_section/page_section.js +4 -2
  163. package/optimize/es/components/page/page_side_bar/page_side_bar.js +1 -2
  164. package/optimize/es/components/page/page_template.js +3 -1
  165. package/optimize/es/components/pagination/pagination.js +17 -4
  166. package/optimize/es/components/pagination/pagination.styles.js +31 -0
  167. package/optimize/es/components/pagination/pagination_button.js +7 -4
  168. package/optimize/es/components/pagination/pagination_button.styles.js +30 -0
  169. package/optimize/es/components/pagination/pagination_button_arrow.js +5 -0
  170. package/optimize/es/components/popover/popover_title.js +2 -2
  171. package/optimize/es/components/popover/popover_title.styles.js +18 -6
  172. package/optimize/es/components/provider/cache/cache_provider.js +3 -9
  173. package/optimize/es/components/provider/provider.js +25 -2
  174. package/optimize/es/components/search_bar/filters/custom_component_filter.js +16 -0
  175. package/optimize/es/components/search_bar/filters/filters.js +6 -0
  176. package/optimize/es/components/search_bar/query/ast.js +12 -0
  177. package/optimize/es/components/search_bar/query/ast_to_es_query_dsl.js +14 -9
  178. package/optimize/es/components/search_bar/query/query.js +17 -0
  179. package/optimize/es/components/suggest/suggest.js +4 -1
  180. package/optimize/es/components/tool_tip/tool_tip.js +42 -66
  181. package/optimize/es/components/tool_tip/tool_tip.styles.js +107 -0
  182. package/optimize/es/components/tool_tip/tool_tip_anchor.js +60 -0
  183. package/optimize/es/components/tool_tip/tool_tip_arrow.js +20 -0
  184. package/optimize/es/components/tool_tip/tool_tip_popover.js +46 -87
  185. package/optimize/es/global_styling/index.js +2 -1
  186. package/optimize/es/global_styling/utility/animations.js +13 -0
  187. package/optimize/es/services/color/contrast.js +2 -0
  188. package/optimize/es/services/index.js +1 -1
  189. package/optimize/es/services/theme/context.js +2 -1
  190. package/optimize/es/services/theme/hooks.js +27 -1
  191. package/optimize/es/services/theme/index.js +1 -1
  192. package/optimize/es/services/theme/provider.js +14 -1
  193. package/optimize/lib/components/badge/badge.js +90 -78
  194. package/optimize/lib/components/badge/badge.styles.js +61 -0
  195. package/optimize/lib/components/basic_table/in_memory_table.js +4 -0
  196. package/optimize/lib/components/button/button.js +0 -1
  197. package/optimize/lib/components/button/button_display/_button_display.js +8 -3
  198. package/optimize/lib/components/button/button_display/_button_display.styles.js +2 -2
  199. package/optimize/lib/components/button/button_display/_button_display_content.js +6 -2
  200. package/optimize/lib/components/button/button_display/_button_display_content.styles.js +4 -1
  201. package/optimize/lib/components/card/card.js +2 -2
  202. package/optimize/lib/components/card/card.styles.js +5 -2
  203. package/optimize/lib/components/image/image_fullscreen_wrapper.js +2 -3
  204. package/optimize/lib/components/notification/notification_event.js +11 -11
  205. package/optimize/lib/components/overlay_mask/overlay_mask.js +27 -59
  206. package/optimize/lib/components/overlay_mask/overlay_mask.styles.js +34 -0
  207. package/optimize/lib/components/page/page_content/page_content.js +1 -2
  208. package/optimize/lib/components/page/page_content/page_content_body.js +1 -2
  209. package/optimize/lib/components/page/page_content/page_content_header.js +1 -2
  210. package/optimize/lib/components/page/page_content/page_content_header_section.js +1 -2
  211. package/optimize/lib/components/page/page_section/page_section.js +4 -2
  212. package/optimize/lib/components/page/page_side_bar/page_side_bar.js +1 -2
  213. package/optimize/lib/components/page/page_template.js +3 -1
  214. package/optimize/lib/components/pagination/pagination.js +18 -3
  215. package/optimize/lib/components/pagination/pagination.styles.js +34 -0
  216. package/optimize/lib/components/pagination/pagination_button.js +9 -4
  217. package/optimize/lib/components/pagination/pagination_button.styles.js +45 -0
  218. package/optimize/lib/components/pagination/pagination_button_arrow.js +7 -0
  219. package/optimize/lib/components/popover/popover_title.js +2 -2
  220. package/optimize/lib/components/popover/popover_title.styles.js +19 -7
  221. package/optimize/lib/components/provider/cache/cache_provider.js +3 -11
  222. package/optimize/lib/components/provider/provider.js +31 -6
  223. package/optimize/lib/components/search_bar/filters/custom_component_filter.js +29 -0
  224. package/optimize/lib/components/search_bar/filters/filters.js +7 -0
  225. package/optimize/lib/components/search_bar/query/ast.js +12 -0
  226. package/optimize/lib/components/search_bar/query/ast_to_es_query_dsl.js +16 -11
  227. package/optimize/lib/components/search_bar/query/query.js +17 -0
  228. package/optimize/lib/components/suggest/suggest.js +4 -1
  229. package/optimize/lib/components/tool_tip/tool_tip.js +42 -64
  230. package/optimize/lib/components/tool_tip/tool_tip.styles.js +125 -0
  231. package/optimize/lib/components/tool_tip/tool_tip_anchor.js +75 -0
  232. package/optimize/lib/components/tool_tip/tool_tip_arrow.js +35 -0
  233. package/optimize/lib/components/tool_tip/tool_tip_popover.js +47 -88
  234. package/optimize/lib/global_styling/index.js +13 -0
  235. package/optimize/lib/global_styling/utility/animations.js +17 -0
  236. package/optimize/lib/services/color/contrast.js +5 -1
  237. package/optimize/lib/services/index.js +7 -0
  238. package/optimize/lib/services/theme/context.js +4 -2
  239. package/optimize/lib/services/theme/hooks.js +28 -0
  240. package/optimize/lib/services/theme/index.js +12 -0
  241. package/optimize/lib/services/theme/provider.js +23 -9
  242. package/package.json +5 -5
  243. package/src/components/badge/_index.scss +0 -1
  244. package/src/components/index.scss +0 -4
  245. package/src/global_styling/mixins/_tool_tip.scss +3 -6
  246. package/src/themes/amsterdam/overrides/_index.scss +0 -2
  247. package/test-env/components/badge/badge.js +92 -80
  248. package/test-env/components/badge/badge.styles.js +61 -0
  249. package/test-env/components/basic_table/in_memory_table.js +8 -0
  250. package/test-env/components/button/button.js +0 -1
  251. package/test-env/components/button/button_display/_button_display.js +20 -6
  252. package/test-env/components/button/button_display/_button_display.styles.js +2 -2
  253. package/test-env/components/button/button_display/_button_display_content.js +8 -4
  254. package/test-env/components/button/button_display/_button_display_content.styles.js +4 -1
  255. package/test-env/components/button/button_empty/button_empty.js +10 -1
  256. package/test-env/components/card/card.js +2 -2
  257. package/test-env/components/card/card.styles.js +5 -2
  258. package/test-env/components/collapsible_nav/collapsible_nav.js +0 -5
  259. package/test-env/components/date_picker/auto_refresh/auto_refresh.js +6 -1
  260. package/test-env/components/date_picker/super_date_picker/date_popover/date_popover_button.js +6 -1
  261. package/test-env/components/expression/expression.js +12 -2
  262. package/test-env/components/header/header_links/header_link.js +10 -1
  263. package/test-env/components/image/image.js +6 -1
  264. package/test-env/components/image/image_fullscreen_wrapper.js +2 -3
  265. package/test-env/components/notification/notification_event.js +25 -16
  266. package/test-env/components/notification/notification_event_meta.js +1 -1
  267. package/test-env/components/overlay_mask/overlay_mask.js +27 -64
  268. package/test-env/components/overlay_mask/overlay_mask.styles.js +34 -0
  269. package/test-env/components/page/page_content/page_content.js +1 -2
  270. package/test-env/components/page/page_content/page_content_body.js +1 -2
  271. package/test-env/components/page/page_content/page_content_header.js +1 -2
  272. package/test-env/components/page/page_content/page_content_header_section.js +1 -2
  273. package/test-env/components/page/page_section/page_section.js +15 -3
  274. package/test-env/components/page/page_side_bar/page_side_bar.js +1 -2
  275. package/test-env/components/page/page_template.js +3 -1
  276. package/test-env/components/page_template/empty_prompt/page_empty_prompt.js +11 -1
  277. package/test-env/components/page_template/page_template.js +18 -2
  278. package/test-env/components/pagination/pagination.js +18 -3
  279. package/test-env/components/pagination/pagination.styles.js +34 -0
  280. package/test-env/components/pagination/pagination_button.js +9 -4
  281. package/test-env/components/pagination/pagination_button.styles.js +45 -0
  282. package/test-env/components/pagination/pagination_button_arrow.js +7 -0
  283. package/test-env/components/popover/popover_title.js +2 -2
  284. package/test-env/components/popover/popover_title.styles.js +19 -7
  285. package/test-env/components/progress/progress.js +6 -1
  286. package/test-env/components/provider/cache/cache_provider.js +3 -11
  287. package/test-env/components/provider/provider.js +31 -6
  288. package/test-env/components/resizable_container/resizable_panel.js +6 -1
  289. package/test-env/components/search_bar/filters/custom_component_filter.js +29 -0
  290. package/test-env/components/search_bar/filters/filters.js +7 -0
  291. package/test-env/components/search_bar/query/ast.js +12 -0
  292. package/test-env/components/search_bar/query/ast_to_es_query_dsl.js +16 -11
  293. package/test-env/components/search_bar/query/query.js +17 -0
  294. package/test-env/components/search_bar/search_bar.js +4 -0
  295. package/test-env/components/search_bar/search_filters.js +4 -0
  296. package/test-env/components/selectable/selectable_list/selectable_list.js +2 -2
  297. package/test-env/components/selectable/selectable_list/selectable_list_item.js +2 -2
  298. package/test-env/components/side_nav/side_nav.js +5 -0
  299. package/test-env/components/suggest/suggest.js +10 -1
  300. package/test-env/components/tool_tip/tool_tip.js +42 -64
  301. package/test-env/components/tool_tip/tool_tip.styles.js +125 -0
  302. package/test-env/components/tool_tip/tool_tip_anchor.js +84 -0
  303. package/test-env/components/tool_tip/tool_tip_arrow.js +35 -0
  304. package/test-env/components/tool_tip/tool_tip_popover.js +49 -89
  305. package/test-env/global_styling/index.js +13 -0
  306. package/test-env/global_styling/utility/animations.js +17 -0
  307. package/test-env/services/color/contrast.js +5 -1
  308. package/test-env/services/index.js +7 -0
  309. package/test-env/services/theme/context.js +4 -2
  310. package/test-env/services/theme/hooks.js +28 -0
  311. package/test-env/services/theme/index.js +12 -0
  312. package/test-env/services/theme/provider.js +23 -9
  313. package/src/components/badge/_badge.scss +0 -133
  314. package/src/components/call_out/_index.scss +0 -3
  315. package/src/components/call_out/_mixins.scss +0 -23
  316. package/src/components/call_out/_variables.scss +0 -7
  317. package/src/components/overlay_mask/_index.scss +0 -1
  318. package/src/components/overlay_mask/_overlay_mask.scss +0 -33
  319. package/src/components/pagination/_index.scss +0 -2
  320. package/src/components/pagination/_pagination.scss +0 -30
  321. package/src/components/pagination/_pagination_button.scss +0 -37
  322. package/src/components/tool_tip/_index.scss +0 -1
  323. package/src/components/tool_tip/_tool_tip.scss +0 -121
  324. package/src/themes/amsterdam/overrides/_overlay_mask.scss +0 -3
  325. package/src/themes/amsterdam/overrides/_tooltip.scss +0 -7
@@ -1,6 +1,6 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["className", "children", "onClick", "headerZindexLocation", "maskRef", "css"];
3
+ var _excluded = ["className", "children", "headerZindexLocation", "maskRef", "css"];
4
4
 
5
5
  /*
6
6
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@@ -14,87 +14,54 @@ var _excluded = ["className", "children", "onClick", "headerZindexLocation", "ma
14
14
  * NOTE: We can't test this component because Enzyme doesn't support rendering
15
15
  * into portals.
16
16
  */
17
- import React, { useEffect, useRef, useState } from 'react';
18
- import { createPortal } from 'react-dom';
17
+ import React, { useEffect, useState } from 'react';
19
18
  import classNames from 'classnames';
19
+ import { Global } from '@emotion/react';
20
20
  import { keysOf } from '../common';
21
- import { useCombinedRefs } from '../../services';
21
+ import { useCombinedRefs, useEuiTheme } from '../../services';
22
+ import { EuiPortal } from '../portal';
23
+ import { euiOverlayMaskStyles, euiOverlayMaskBodyStyles } from './overlay_mask.styles';
22
24
  import { jsx as ___EmotionJSX } from "@emotion/react";
23
25
  export var EuiOverlayMask = function EuiOverlayMask(_ref) {
24
26
  var className = _ref.className,
25
27
  children = _ref.children,
26
- onClick = _ref.onClick,
27
28
  _ref$headerZindexLoca = _ref.headerZindexLocation,
28
29
  headerZindexLocation = _ref$headerZindexLoca === void 0 ? 'above' : _ref$headerZindexLoca,
29
30
  maskRef = _ref.maskRef,
30
31
  css = _ref.css,
31
32
  rest = _objectWithoutProperties(_ref, _excluded);
32
33
 
33
- var overlayMaskNode = useRef();
34
- var combinedMaskRef = useCombinedRefs([overlayMaskNode, maskRef]);
35
-
36
- var _useState = useState(false),
34
+ var _useState = useState(null),
37
35
  _useState2 = _slicedToArray(_useState, 2),
38
- isPortalTargetReady = _useState2[0],
39
- setIsPortalTargetReady = _useState2[1];
40
-
41
- useEffect(function () {
42
- document.body.classList.add('euiBody-hasOverlayMask');
43
- return function () {
44
- document.body.classList.remove('euiBody-hasOverlayMask');
45
- };
46
- }, []);
47
- useEffect(function () {
48
- if (typeof document !== 'undefined') {
49
- combinedMaskRef(document.createElement('div'));
50
- }
51
- }, []); // eslint-disable-line react-hooks/exhaustive-deps
52
-
53
- useEffect(function () {
54
- var portalTarget = overlayMaskNode.current;
36
+ overlayMaskNode = _useState2[0],
37
+ setOverlayMaskNode = _useState2[1];
55
38
 
56
- if (portalTarget) {
57
- document.body.appendChild(portalTarget);
58
- }
59
-
60
- setIsPortalTargetReady(true);
61
- return function () {
62
- if (portalTarget) {
63
- document.body.removeChild(portalTarget);
64
- }
65
- };
66
- }, []);
39
+ var combinedMaskRef = useCombinedRefs([setOverlayMaskNode, maskRef]);
40
+ var euiTheme = useEuiTheme();
41
+ var styles = euiOverlayMaskStyles(euiTheme);
42
+ var cssStyles = [styles.euiOverlayMask, styles["".concat(headerZindexLocation, "Header")]];
67
43
  useEffect(function () {
68
- if (!overlayMaskNode.current) return;
44
+ if (!overlayMaskNode) return;
69
45
  keysOf(rest).forEach(function (key) {
70
46
  if (typeof rest[key] !== 'string') {
71
47
  throw new Error("Unhandled property type. EuiOverlayMask property ".concat(key, " is not a string."));
72
48
  }
73
49
 
74
- if (overlayMaskNode.current) {
75
- overlayMaskNode.current.setAttribute(key, rest[key]);
50
+ if (overlayMaskNode) {
51
+ overlayMaskNode.setAttribute(key, rest[key]);
76
52
  }
77
53
  });
78
- }, []); // eslint-disable-line react-hooks/exhaustive-deps
54
+ }, [overlayMaskNode]); // eslint-disable-line react-hooks/exhaustive-deps
79
55
 
80
56
  useEffect(function () {
81
- if (!overlayMaskNode.current) return;
82
- overlayMaskNode.current.className = classNames('euiOverlayMask', "euiOverlayMask--".concat(headerZindexLocation, "Header"), className);
83
- }, [className, headerZindexLocation]);
84
- useEffect(function () {
85
- var portalTarget = overlayMaskNode.current;
86
- if (!portalTarget || !onClick) return;
87
-
88
- var listener = function listener(e) {
89
- if (e.target === portalTarget) {
90
- onClick();
91
- }
92
- };
93
-
94
- portalTarget.addEventListener('click', listener);
95
- return function () {
96
- portalTarget.removeEventListener('click', listener);
97
- };
98
- }, [onClick]);
99
- return isPortalTargetReady ? ___EmotionJSX(React.Fragment, null, /*#__PURE__*/createPortal(children, overlayMaskNode.current)) : null;
57
+ if (!overlayMaskNode) return;
58
+ overlayMaskNode.className = classNames('euiOverlayMask', className);
59
+ }, [overlayMaskNode, className]);
60
+ return ___EmotionJSX(EuiPortal, {
61
+ portalRef: combinedMaskRef
62
+ }, ___EmotionJSX(Global, {
63
+ styles: euiOverlayMaskBodyStyles
64
+ }), ___EmotionJSX(Global, {
65
+ styles: cssStyles
66
+ }), children);
100
67
  };
@@ -0,0 +1,28 @@
1
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
2
+
3
+ /*
4
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
5
+ * or more contributor license agreements. Licensed under the Elastic License
6
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
7
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
8
+ * Side Public License, v 1.
9
+ */
10
+ import { css } from '@emotion/react';
11
+ import { logicalCSS, euiAnimFadeIn } from '../../global_styling';
12
+ import { transparentize } from '../../services';
13
+ export var euiOverlayMaskStyles = function euiOverlayMaskStyles(_ref) {
14
+ var euiTheme = _ref.euiTheme;
15
+ return {
16
+ euiOverlayMask: /*#__PURE__*/css(".euiOverlayMask{position:fixed;", logicalCSS('top', 0), " ", logicalCSS('left', 0), " ", logicalCSS('right', 0), " ", logicalCSS('bottom', 0), " display:flex;align-items:center;justify-content:center;", logicalCSS('padding-bottom', '10vh'), ";animation:", euiAnimFadeIn, " ", euiTheme.animation.fast, " ease-in;background:", transparentize(euiTheme.colors.ink, 0.5), ";};label:euiOverlayMask;"),
17
+ aboveHeader: /*#__PURE__*/css(".euiOverlayMask{z-index:", euiTheme.levels.mask, ";};label:aboveHeader;"),
18
+ belowHeader: /*#__PURE__*/css(".euiOverlayMask{z-index:", euiTheme.levels.maskBelowHeader, ";", logicalCSS('top', "".concat(euiTheme.base * 3, "px")), ";};label:belowHeader;")
19
+ };
20
+ };
21
+ export var euiOverlayMaskBodyStyles = process.env.NODE_ENV === "production" ? {
22
+ name: "131160-euiOverlayMaskBodyStyles",
23
+ styles: "body{overflow:hidden;};label:euiOverlayMaskBodyStyles;"
24
+ } : {
25
+ name: "131160-euiOverlayMaskBodyStyles",
26
+ styles: "body{overflow:hidden;};label:euiOverlayMaskBodyStyles;",
27
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
28
+ };
@@ -21,8 +21,7 @@ var horizontalPositionToClassNameMap = {
21
21
  };
22
22
 
23
23
  /**
24
- * **DEPRECATED**
25
- * Use EuiPageSection instead
24
+ * @deprecated Use EuiPageSection instead
26
25
  */
27
26
  export var EuiPageContent_Deprecated = function EuiPageContent_Deprecated(_ref) {
28
27
  var verticalPosition = _ref.verticalPosition,
@@ -24,8 +24,7 @@ var paddingSizeToClassNameMap = {
24
24
  export var PADDING_SIZES = keysOf(paddingSizeToClassNameMap);
25
25
 
26
26
  /**
27
- * **DEPRECATED**
28
- * Use EuiPageSection instead
27
+ * @deprecated Use EuiPageSection instead
29
28
  */
30
29
  export var EuiPageContentBody_Deprecated = function EuiPageContentBody_Deprecated(_ref) {
31
30
  var children = _ref.children,
@@ -14,8 +14,7 @@ import classNames from 'classnames';
14
14
  import { jsx as ___EmotionJSX } from "@emotion/react";
15
15
 
16
16
  /**
17
- * **DEPRECATED**
18
- * Use EuiPageHeader instead
17
+ * @deprecated Use EuiPageHeader instead
19
18
  */
20
19
  export var EuiPageContentHeader_Deprecated = function EuiPageContentHeader_Deprecated(_ref) {
21
20
  var children = _ref.children,
@@ -14,8 +14,7 @@ import classNames from 'classnames';
14
14
  import { jsx as ___EmotionJSX } from "@emotion/react";
15
15
 
16
16
  /**
17
- * **DEPRECATED**
18
- * Use EuiPageHeader instead
17
+ * @deprecated Use EuiPageHeader instead
19
18
  */
20
19
  export var EuiPageContentHeaderSection_Deprecated = function EuiPageContentHeaderSection_Deprecated(_ref) {
21
20
  var children = _ref.children,
@@ -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", "alignment", "restrictWidth", "bottomBorder", "paddingSize", "color", "grow", "contentProps"];
3
+ var _excluded = ["children", "alignment", "restrictWidth", "bottomBorder", "paddingSize", "color", "grow", "contentProps", "component"];
4
4
 
5
5
  /*
6
6
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@@ -29,6 +29,8 @@ export var EuiPageSection = function EuiPageSection(_ref) {
29
29
  _ref$grow = _ref.grow,
30
30
  grow = _ref$grow === void 0 ? false : _ref$grow,
31
31
  contentProps = _ref.contentProps,
32
+ _ref$component = _ref.component,
33
+ Component = _ref$component === void 0 ? 'section' : _ref$component,
32
34
  rest = _objectWithoutProperties(_ref, _excluded);
33
35
 
34
36
  // Set max-width as a style prop
@@ -41,7 +43,7 @@ export var EuiPageSection = function EuiPageSection(_ref) {
41
43
  var cssStyles = [styles.euiPageSection, grow && styles.grow, inlinePadding[paddingSize], bottomBorder === 'extended' && styles.border, alignment && styles[alignment], colors[color]];
42
44
  var contentStyles = euiPageSectionContentStyles();
43
45
  var cssContentStyles = [contentStyles.euiPageSection__content, blockPadding[paddingSize], bottomBorder === true && styles.border, alignment.toLowerCase().includes('center') && contentStyles.center, restrictWidth && contentStyles.restrictWidth];
44
- return ___EmotionJSX("div", _extends({
46
+ return ___EmotionJSX(Component, _extends({
45
47
  css: cssStyles
46
48
  }, rest), ___EmotionJSX("div", _extends({
47
49
  css: cssContentStyles
@@ -22,8 +22,7 @@ var paddingSizeToClassNameMap = {
22
22
  export var PADDING_SIZES = keysOf(paddingSizeToClassNameMap);
23
23
 
24
24
  /**
25
- * **DEPRECATED**
26
- * Use the new EuiPageSidebar instead
25
+ * @deprecated Use the new EuiPageSidebar in page/page_sidebar instead
27
26
  */
28
27
  export var EuiPageSideBar_Deprecated = function EuiPageSideBar_Deprecated(_ref) {
29
28
  var children = _ref.children,
@@ -32,7 +32,9 @@ export var TEMPLATES = ['default', 'centeredBody', 'centeredContent', 'empty'];
32
32
  /**
33
33
  * This component has been deprecated in favor of the new
34
34
  * namespaced version. You can still import this component
35
- * for a period of time by importing `as EuiPageTemplate`.
35
+ * until August 2023 by importing `as EuiPageTemplate`.
36
+ *
37
+ * @deprecated use EuiPageTemplate from page_template/page_template instead
36
38
  */
37
39
  export var EuiPageTemplate_Deprecated = function EuiPageTemplate_Deprecated(_ref) {
38
40
  var _pageBodyProps2;
@@ -20,8 +20,10 @@ import { EuiPaginationButton } from './pagination_button';
20
20
  import { EuiI18n, useEuiI18n } from '../i18n';
21
21
  import { EuiText } from '../text';
22
22
  import { EuiPaginationButtonArrow } from './pagination_button_arrow';
23
- import { useIsWithinBreakpoints } from '../../services';
23
+ import { useIsWithinBreakpoints, useEuiTheme } from '../../services';
24
24
  import { EuiScreenReaderOnly } from '../accessibility';
25
+ import { euiPaginationStyles } from './pagination.styles';
26
+ import { euiPaginationButtonStyles } from './pagination_button.styles';
25
27
  import { jsx as ___EmotionJSX } from "@emotion/react";
26
28
  var MAX_VISIBLE_PAGES = 5;
27
29
  var NUMBER_SURROUNDING_PAGES = Math.floor(MAX_VISIBLE_PAGES * 0.5);
@@ -39,7 +41,13 @@ export var EuiPagination = function EuiPagination(_ref) {
39
41
  responsive = _ref$responsive === void 0 ? ['xs', 's'] : _ref$responsive,
40
42
  rest = _objectWithoutProperties(_ref, _excluded);
41
43
 
42
- var isResponsive = useIsWithinBreakpoints(responsive, !!responsive); // Force to `compressed` version if specified or within the responsive breakpoints
44
+ var isResponsive = useIsWithinBreakpoints(responsive, !!responsive);
45
+ var euiTheme = useEuiTheme();
46
+ var paginationStyles = euiPaginationStyles(euiTheme);
47
+
48
+ var _euiPaginationButtonS = euiPaginationButtonStyles(euiTheme),
49
+ isPlaceholder = _euiPaginationButtonS.isPlaceholder; // Force to `compressed` version if specified or within the responsive breakpoints
50
+
43
51
 
44
52
  var compressed = _compressed || isResponsive;
45
53
 
@@ -108,6 +116,7 @@ export var EuiPagination = function EuiPagination(_ref) {
108
116
  if (compressed) {
109
117
  centerPageCount = ___EmotionJSX(EuiText, {
110
118
  size: "s",
119
+ css: paginationStyles.euiPagination__compressedText,
111
120
  className: "euiPagination__compressedText"
112
121
  }, ___EmotionJSX(EuiI18n, {
113
122
  token: "euiPagination.pageOfTotalCompressed",
@@ -148,7 +157,8 @@ export var EuiPagination = function EuiPagination(_ref) {
148
157
  }, function (firstRangeAriaLabel) {
149
158
  return ___EmotionJSX("li", {
150
159
  "aria-label": firstRangeAriaLabel,
151
- className: "euiPaginationButton-isPlaceholder euiPagination__item"
160
+ className: "euiPagination__item",
161
+ css: isPlaceholder
152
162
  }, "\u2026");
153
163
  }));
154
164
  } else if (firstPageInRange === 2) {
@@ -179,7 +189,8 @@ export var EuiPagination = function EuiPagination(_ref) {
179
189
  }, function (lastRangeAriaLabel) {
180
190
  return ___EmotionJSX("li", {
181
191
  "aria-label": lastRangeAriaLabel,
182
- className: "euiPaginationButton-isPlaceholder euiPagination__item"
192
+ className: "euiPagination__item",
193
+ css: isPlaceholder
183
194
  }, "\u2026");
184
195
  }));
185
196
  }
@@ -199,6 +210,7 @@ export var EuiPagination = function EuiPagination(_ref) {
199
210
  });
200
211
 
201
212
  centerPageCount = ___EmotionJSX("ul", _extends({}, accessibleName, {
213
+ css: paginationStyles.euiPagination__list,
202
214
  className: "euiPagination__list"
203
215
  }), firstPageButtons, selectablePages, lastPageButtons);
204
216
  }
@@ -223,6 +235,7 @@ export var EuiPagination = function EuiPagination(_ref) {
223
235
 
224
236
  var accessiblePageCount = "".concat(accessiblePageString(), " ").concat(ofLabel, " ").concat(accessibleCollectionString);
225
237
  return ___EmotionJSX("nav", _extends({
238
+ css: [paginationStyles.euiPagination, ";label:EuiPagination;"],
226
239
  className: classes
227
240
  }, rest), ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span", {
228
241
  "aria-atomic": "true",
@@ -0,0 +1,31 @@
1
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
2
+
3
+ /*
4
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
5
+ * or more contributor license agreements. Licensed under the Elastic License
6
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
7
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
8
+ * Side Public License, v 1.
9
+ */
10
+ import { css } from '@emotion/react';
11
+ import { logicalCSS, logicalCSSWithFallback, euiScrollBarStyles } from '../../global_styling';
12
+
13
+ var _ref = process.env.NODE_ENV === "production" ? {
14
+ name: "1dbd2rc-euiPagination__list",
15
+ styles: "display:flex;align-items:baseline;label:euiPagination__list;"
16
+ } : {
17
+ name: "1dbd2rc-euiPagination__list",
18
+ styles: "display:flex;align-items:baseline;label:euiPagination__list;",
19
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
20
+ };
21
+
22
+ export var euiPaginationStyles = function euiPaginationStyles(euiThemeContext) {
23
+ var euiTheme = euiThemeContext.euiTheme;
24
+ return {
25
+ // Base
26
+ euiPagination: /*#__PURE__*/css(euiScrollBarStyles(euiThemeContext), ";display:flex;align-items:center;", logicalCSSWithFallback('overflow-y', 'hidden'), ";", logicalCSSWithFallback('overflow-x', 'auto'), ";;label:euiPagination;"),
27
+ // Elements
28
+ euiPagination__compressedText: /*#__PURE__*/css("display:inline-flex;align-items:center;line-height:1!important;>span{", logicalCSS('margin-horizontal', euiTheme.size.s), ";font-weight:", euiTheme.font.weight.semiBold, ";&:first-of-type{color:", euiTheme.colors.primaryText, ";}};label:euiPagination__compressedText;"),
29
+ euiPagination__list: _ref
30
+ };
31
+ };
@@ -18,6 +18,8 @@ import React from 'react';
18
18
  import classNames from 'classnames';
19
19
  import { EuiButtonEmpty } from '../button';
20
20
  import { EuiI18n } from '../i18n';
21
+ import { useEuiTheme } from '../../services';
22
+ import { euiPaginationButtonStyles } from './pagination_button.styles';
21
23
  import { jsx as ___EmotionJSX } from "@emotion/react";
22
24
  export var EuiPaginationButton = function EuiPaginationButton(_ref) {
23
25
  var className = _ref.className,
@@ -27,12 +29,13 @@ export var EuiPaginationButton = function EuiPaginationButton(_ref) {
27
29
  totalPages = _ref.totalPages,
28
30
  rest = _objectWithoutProperties(_ref, _excluded);
29
31
 
30
- var classes = classNames('euiPaginationButton', className, {
31
- 'euiPaginationButton-isActive': isActive,
32
- 'euiPaginationButton-isPlaceholder': isPlaceholder
33
- });
32
+ var euiTheme = useEuiTheme();
33
+ var styles = euiPaginationButtonStyles(euiTheme);
34
+ var paginationButtonCss = [styles.euiPaginationButton, isActive && styles.isActive, isPlaceholder && styles.isPlaceholder];
35
+ var classes = classNames('euiPaginationButton', className);
34
36
 
35
37
  var props = _objectSpread(_objectSpread(_objectSpread({
38
+ css: paginationButtonCss,
36
39
  className: classes,
37
40
  size: 's',
38
41
  color: 'text',
@@ -0,0 +1,30 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6
+ * Side Public License, v 1.
7
+ */
8
+ import { css } from '@emotion/react';
9
+ import { logicalCSS, logicalTextAlignCSS, euiFontSize } from '../../global_styling';
10
+ import { euiButtonEmptyColor } from '../../themes/amsterdam/global_styling/mixins';
11
+ export var euiPaginationButtonStyles = function euiPaginationButtonStyles(euiThemeContext) {
12
+ var euiTheme = euiThemeContext.euiTheme;
13
+ var fontSizeS = euiFontSize(euiThemeContext, 's');
14
+ var halfSizeM = parseInt(euiTheme.size.m.replace('px', '')) / 2;
15
+ var disabled = euiButtonEmptyColor(euiThemeContext, 'disabled'); // && to increase specificity. Can likely be removed once EuiButtonEmpty has been converted.
16
+
17
+ return {
18
+ // Base
19
+ euiPaginationButton: /*#__PURE__*/css("&&{", fontSizeS, ";padding:0;", logicalTextAlignCSS('center'), " border-radius:", euiTheme.border.radius.medium, ";outline-offset:-", euiTheme.focus.width, ";};label:euiPaginationButton;"),
20
+ // States
21
+ isActive: /*#__PURE__*/css("&&{font-weight:", euiTheme.font.weight.bold, ";color:", euiTheme.colors.primary, ";.euiButtonEmpty__content{cursor:default;}&&,&&:hover{text-decoration:underline;}};label:isActive;"),
22
+ isPlaceholder: /*#__PURE__*/css("&&{align-items:baseline;color:", disabled.color, ";", fontSizeS, ";", logicalCSS('padding-top', "".concat(halfSizeM, "px")), ";", logicalCSS('padding-bottom', 0), ";", logicalCSS('padding-horizontal', euiTheme.size.s), ";", logicalCSS('height', euiTheme.size.l), ";};label:isPlaceholder;")
23
+ };
24
+ };
25
+ export var euiPaginationButtonArrowStyles = function euiPaginationButtonArrowStyles(_ref) {
26
+ var euiTheme = _ref.euiTheme;
27
+ return {
28
+ euiPaginationArrowButton: /*#__PURE__*/css("outline-offset:-", euiTheme.focus.width, ";;label:euiPaginationArrowButton;")
29
+ };
30
+ };
@@ -12,6 +12,8 @@ import classNames from 'classnames';
12
12
  import { EuiButtonIcon } from '../button/button_icon';
13
13
  import { keysOf } from '../common';
14
14
  import { useEuiI18n } from '../i18n';
15
+ import { useEuiTheme } from '../../services';
16
+ import { euiPaginationButtonArrowStyles } from './pagination_button.styles';
15
17
  import { jsx as ___EmotionJSX } from "@emotion/react";
16
18
  var typeToIconTypeMap = {
17
19
  first: 'arrowStart',
@@ -26,6 +28,8 @@ export var EuiPaginationButtonArrow = function EuiPaginationButtonArrow(_ref) {
26
28
  disabled = _ref.disabled,
27
29
  ariaControls = _ref.ariaControls,
28
30
  onClick = _ref.onClick;
31
+ var euiTheme = useEuiTheme();
32
+ var styles = euiPaginationButtonArrowStyles(euiTheme);
29
33
  var labels = {
30
34
  first: useEuiI18n('euiPaginationButtonArrow.firstPage', 'First page'),
31
35
  previous: useEuiI18n('euiPaginationButtonArrow.previousPage', 'Previous page'),
@@ -40,6 +44,7 @@ export var EuiPaginationButtonArrow = function EuiPaginationButtonArrow(_ref) {
40
44
  }
41
45
 
42
46
  return ___EmotionJSX(EuiButtonIcon, _extends({
47
+ css: styles.euiPaginationArrowButton,
43
48
  className: classNames('euiPaginationArrowButton', className),
44
49
  color: "text",
45
50
  "aria-label": labels[type],
@@ -26,9 +26,9 @@ export var EuiPopoverTitle = function EuiPopoverTitle(_ref) {
26
26
  panelPadding = _useContext.paddingSize;
27
27
 
28
28
  var euiTheme = useEuiTheme();
29
- var styles = euiPopoverTitleStyles(euiTheme, panelPadding);
29
+ var styles = euiPopoverTitleStyles(euiTheme);
30
30
  var paddingStyles = useEuiPaddingCSS();
31
- var cssStyles = [styles.euiPopoverTitle, // If a paddingSize is not directly provided, inherit from the EuiPopoverPanel
31
+ var cssStyles = [styles.euiPopoverTitle, styles.panelPaddingSizes[panelPadding], // If a paddingSize is not directly provided, inherit from the EuiPopoverPanel
32
32
  paddingStyles[paddingSize || panelPadding]];
33
33
  var classes = classNames('euiPopoverTitle', className);
34
34
  return ___EmotionJSX("div", _extends({
@@ -8,13 +8,25 @@
8
8
  import { css } from '@emotion/react';
9
9
  import { euiPaddingSize, logicalCSS } from '../../global_styling';
10
10
  import { euiTitle } from '../title/title.styles';
11
- export var euiPopoverTitleStyles = function euiPopoverTitleStyles(euiThemeContext, panelPadding) {
12
- var euiTheme = euiThemeContext.euiTheme; // If the popover's containing panel has padding applied,
13
- // ensure the title expands to cover that padding and
14
-
15
- var panelPaddingSize = euiPaddingSize(euiThemeContext, panelPadding);
11
+ export var euiPopoverTitleStyles = function euiPopoverTitleStyles(euiThemeContext) {
12
+ var euiTheme = euiThemeContext.euiTheme;
16
13
  return {
17
14
  // Base
18
- euiPopoverTitle: /*#__PURE__*/css(euiTitle(euiThemeContext, 'xxs'), ";", logicalCSS('border-bottom', euiTheme.border.thin), ";margin:-", panelPaddingSize, " -", panelPaddingSize, " ", panelPaddingSize, ";;label:euiPopoverTitle;")
15
+ euiPopoverTitle: /*#__PURE__*/css(euiTitle(euiThemeContext, 'xxs'), ";", logicalCSS('border-bottom', euiTheme.border.thin), ";;label:euiPopoverTitle;"),
16
+ // If the popover's containing panel has padding applied,
17
+ // ensure the title expands to cover that padding via negative margins
18
+ panelPaddingSizes: {
19
+ none: /*#__PURE__*/css(";label:none;"),
20
+ xs: /*#__PURE__*/css(getPaddingOffset(euiThemeContext, 'xs'), ";;label:xs;"),
21
+ s: /*#__PURE__*/css(getPaddingOffset(euiThemeContext, 's'), ";;label:s;"),
22
+ m: /*#__PURE__*/css(getPaddingOffset(euiThemeContext, 'm'), ";;label:m;"),
23
+ l: /*#__PURE__*/css(getPaddingOffset(euiThemeContext, 'l'), ";;label:l;"),
24
+ xl: /*#__PURE__*/css(getPaddingOffset(euiThemeContext, 'xl'), ";;label:xl;")
25
+ }
19
26
  };
27
+ };
28
+
29
+ var getPaddingOffset = function getPaddingOffset(euiThemeContext, size) {
30
+ var panelPaddingSize = euiPaddingSize(euiThemeContext, size);
31
+ return "margin: -".concat(panelPaddingSize, " -").concat(panelPaddingSize, " ").concat(panelPaddingSize, ";");
20
32
  };
@@ -6,18 +6,12 @@
6
6
  * Side Public License, v 1.
7
7
  */
8
8
  import React from 'react';
9
- import createCache from '@emotion/cache';
10
9
  import { CacheProvider } from '@emotion/react';
11
10
  import { jsx as ___EmotionJSX } from "@emotion/react";
12
- var defaultCache = createCache({
13
- key: 'css'
14
- });
15
- defaultCache.compat = true;
16
11
  export var EuiCacheProvider = function EuiCacheProvider(_ref) {
17
- var _ref$cache = _ref.cache,
18
- cache = _ref$cache === void 0 ? defaultCache : _ref$cache,
12
+ var cache = _ref.cache,
19
13
  children = _ref.children;
20
- return ___EmotionJSX(CacheProvider, {
14
+ return children && cache ? ___EmotionJSX(CacheProvider, {
21
15
  value: cache
22
- }, children);
16
+ }, children) : ___EmotionJSX(React.Fragment, null, children);
23
17
  };
@@ -6,6 +6,7 @@
6
6
  * Side Public License, v 1.
7
7
  */
8
8
  import React from 'react';
9
+ import createCache from '@emotion/cache';
9
10
  import { EuiGlobalStyles } from '../../global_styling/reset/global_styles';
10
11
  import { EuiUtilityClasses } from '../../global_styling/utility/utility';
11
12
  import { EuiThemeProvider, CurrentEuiBreakpointProvider } from '../../services';
@@ -17,8 +18,15 @@ var isEmotionCacheObject = function isEmotionCacheObject(obj) {
17
18
  return obj.hasOwnProperty('key');
18
19
  };
19
20
 
21
+ var fallbackCache = createCache({
22
+ key: 'css'
23
+ });
24
+ fallbackCache.compat = true;
20
25
  export var EuiProvider = function EuiProvider(_ref) {
21
- var cache = _ref.cache,
26
+ var _defaultCache;
27
+
28
+ var _ref$cache = _ref.cache,
29
+ cache = _ref$cache === void 0 ? fallbackCache : _ref$cache,
22
30
  _ref$theme = _ref.theme,
23
31
  theme = _ref$theme === void 0 ? EuiThemeAmsterdam : _ref$theme,
24
32
  _ref$globalStyles = _ref.globalStyles,
@@ -34,16 +42,31 @@ export var EuiProvider = function EuiProvider(_ref) {
34
42
 
35
43
  if (cache) {
36
44
  if (isEmotionCacheObject(cache)) {
45
+ cache.compat = true;
37
46
  defaultCache = cache;
38
47
  } else {
48
+ if (cache.default) {
49
+ cache.default.compat = true;
50
+ }
51
+
39
52
  defaultCache = cache.default;
53
+
54
+ if (cache.global) {
55
+ cache.global.compat = true;
56
+ }
57
+
40
58
  globalCache = cache.global;
59
+
60
+ if (cache.utility) {
61
+ cache.utility.compat = true;
62
+ }
63
+
41
64
  utilityCache = cache.utility;
42
65
  }
43
66
  }
44
67
 
45
68
  return ___EmotionJSX(EuiCacheProvider, {
46
- cache: defaultCache
69
+ cache: (_defaultCache = defaultCache) !== null && _defaultCache !== void 0 ? _defaultCache : fallbackCache
47
70
  }, ___EmotionJSX(EuiThemeProvider, {
48
71
  theme: theme !== null && theme !== void 0 ? theme : undefined,
49
72
  colorMode: colorMode,
@@ -0,0 +1,16 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6
+ * Side Public License, v 1.
7
+ */
8
+ import React from 'react';
9
+ import { jsx as ___EmotionJSX } from "@emotion/react";
10
+ export var CustomComponentFilter = function CustomComponentFilter(props) {
11
+ var CustomComponent = props.config.component;
12
+ return ___EmotionJSX(CustomComponent, {
13
+ query: props.query,
14
+ onChange: props.onChange
15
+ });
16
+ };
@@ -12,6 +12,7 @@ import { IsFilter } from './is_filter';
12
12
  import { FieldValueSelectionFilter } from './field_value_selection_filter';
13
13
  import { FieldValueToggleFilter } from './field_value_toggle_filter';
14
14
  import { FieldValueToggleGroupFilter } from './field_value_toggle_group_filter';
15
+ import { CustomComponentFilter } from './custom_component_filter';
15
16
  import { jsx as ___EmotionJSX } from "@emotion/react";
16
17
  export var createFilter = function createFilter(index, config, query, onChange) {
17
18
  var props = {
@@ -45,6 +46,11 @@ export var createFilter = function createFilter(index, config, query, onChange)
45
46
  config: config
46
47
  }));
47
48
 
49
+ case 'custom_component':
50
+ return ___EmotionJSX(CustomComponentFilter, _extends({}, props, {
51
+ config: config
52
+ }));
53
+
48
54
  default:
49
55
  // @ts-ignore TS knows that we've checked `config.type` exhaustively
50
56
  throw new Error("Unknown search filter type [".concat(config.type, "]"));
@@ -528,6 +528,18 @@ export var _AST = /*#__PURE__*/function () {
528
528
  return !Is.isInstance(clause) || clause.flag !== flag;
529
529
  }));
530
530
  }
531
+ }, {
532
+ key: "removeIsClauses",
533
+ value: function removeIsClauses() {
534
+ return new _AST(this._clauses.filter(function (clause) {
535
+ return !Is.isInstance(clause);
536
+ }));
537
+ }
538
+ }, {
539
+ key: "removeAllClauses",
540
+ value: function removeAllClauses() {
541
+ return new _AST();
542
+ }
531
543
  }, {
532
544
  key: "getGroupClauses",
533
545
  value: function getGroupClauses() {