@elastic/eui 67.0.0 → 67.1.1

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 (283) hide show
  1. package/dist/eui_theme_dark.css +0 -390
  2. package/dist/eui_theme_dark.json +0 -24
  3. package/dist/eui_theme_dark.json.d.ts +0 -24
  4. package/dist/eui_theme_dark.min.css +1 -1
  5. package/dist/eui_theme_light.css +0 -390
  6. package/dist/eui_theme_light.json +0 -24
  7. package/dist/eui_theme_light.json.d.ts +0 -24
  8. package/dist/eui_theme_light.min.css +1 -1
  9. package/es/components/accordion/accordion.js +5 -4
  10. package/es/components/accordion/accordion.styles.js +1 -1
  11. package/es/components/badge/badge.js +84 -78
  12. package/es/components/badge/badge.styles.js +62 -0
  13. package/es/components/basic_table/in_memory_table.js +8 -0
  14. package/es/components/breadcrumbs/breadcrumb.styles.js +4 -2
  15. package/es/components/button/button.js +0 -1
  16. package/es/components/button/button_display/_button_display.js +10 -5
  17. package/es/components/button/button_display/_button_display.styles.js +2 -2
  18. package/es/components/button/button_display/_button_display_content.js +5 -3
  19. package/es/components/button/button_display/_button_display_content.styles.js +4 -1
  20. package/es/components/button/button_icon/button_icon.js +11 -7
  21. package/es/components/card/card.js +2 -2
  22. package/es/components/card/card.styles.js +5 -2
  23. package/es/components/collapsible_nav/collapsible_nav.js +8 -0
  24. package/es/components/expression/expression.styles.js +4 -2
  25. package/es/components/flyout/flyout.js +27 -48
  26. package/es/components/flyout/flyout.styles.js +111 -0
  27. package/es/components/flyout/flyout_body.js +14 -6
  28. package/es/components/flyout/flyout_body.styles.js +21 -0
  29. package/es/components/flyout/flyout_footer.js +8 -1
  30. package/es/components/flyout/flyout_footer.styles.js +14 -0
  31. package/es/components/flyout/flyout_header.js +9 -4
  32. package/es/components/flyout/flyout_header.styles.js +28 -0
  33. package/es/components/image/image_wrapper.js +3 -3
  34. package/es/components/markdown_editor/markdown_format.styles.js +11 -6
  35. package/es/components/notification/notification_event.js +1 -1
  36. package/es/components/notification/notification_event_meta.js +1 -1
  37. package/es/components/page/page_header/page_header_content.js +1 -1
  38. package/es/components/page/page_section/page_section.js +3 -4
  39. package/es/components/pagination/pagination_button.styles.js +5 -3
  40. package/es/components/popover/popover_title.js +2 -2
  41. package/es/components/popover/popover_title.styles.js +18 -6
  42. package/es/components/progress/progress.js +2 -2
  43. package/es/components/search_bar/filters/custom_component_filter.js +16 -0
  44. package/es/components/search_bar/filters/filters.js +6 -0
  45. package/es/components/search_bar/query/ast.js +12 -0
  46. package/es/components/search_bar/query/ast_to_es_query_dsl.js +15 -10
  47. package/es/components/search_bar/query/query.js +17 -0
  48. package/es/components/search_bar/search_bar.js +4 -0
  49. package/es/components/search_bar/search_filters.js +4 -0
  50. package/es/components/selectable/selectable_list/selectable_list.js +2 -2
  51. package/es/components/selectable/selectable_list/selectable_list_item.js +2 -2
  52. package/es/components/text/text.styles.js +6 -3
  53. package/es/components/tool_tip/tool_tip.styles.js +7 -6
  54. package/es/components/tour/tour.styles.js +11 -6
  55. package/es/global_styling/functions/index.js +1 -0
  56. package/es/global_styling/functions/math.js +46 -0
  57. package/es/global_styling/mixins/_helpers.js +5 -2
  58. package/es/services/color/contrast.js +2 -0
  59. package/es/services/index.js +1 -1
  60. package/es/services/theme/context.js +2 -1
  61. package/es/services/theme/hooks.js +27 -1
  62. package/es/services/theme/index.js +1 -1
  63. package/es/services/theme/provider.js +15 -1
  64. package/eui.d.ts +199 -35
  65. package/i18ntokens.json +2 -2
  66. package/lib/components/accordion/accordion.js +5 -4
  67. package/lib/components/accordion/accordion.styles.js +1 -1
  68. package/lib/components/badge/badge.js +92 -80
  69. package/lib/components/badge/badge.styles.js +67 -0
  70. package/lib/components/basic_table/in_memory_table.js +8 -0
  71. package/lib/components/breadcrumbs/breadcrumb.styles.js +3 -1
  72. package/lib/components/button/button.js +0 -1
  73. package/lib/components/button/button_display/_button_display.js +10 -5
  74. package/lib/components/button/button_display/_button_display.styles.js +2 -2
  75. package/lib/components/button/button_display/_button_display_content.js +9 -4
  76. package/lib/components/button/button_display/_button_display_content.styles.js +4 -1
  77. package/lib/components/button/button_icon/button_icon.js +11 -7
  78. package/lib/components/card/card.js +2 -2
  79. package/lib/components/card/card.styles.js +5 -2
  80. package/lib/components/collapsible_nav/collapsible_nav.js +8 -0
  81. package/lib/components/expression/expression.styles.js +3 -1
  82. package/lib/components/flyout/flyout.js +27 -47
  83. package/lib/components/flyout/flyout.styles.js +122 -0
  84. package/lib/components/flyout/flyout_body.js +16 -6
  85. package/lib/components/flyout/flyout_body.styles.js +32 -0
  86. package/lib/components/flyout/flyout_footer.js +10 -1
  87. package/lib/components/flyout/flyout_footer.styles.js +24 -0
  88. package/lib/components/flyout/flyout_header.js +11 -4
  89. package/lib/components/flyout/flyout_header.styles.js +31 -0
  90. package/lib/components/image/image_wrapper.js +3 -3
  91. package/lib/components/markdown_editor/markdown_format.styles.js +10 -5
  92. package/lib/components/notification/notification_event.js +1 -1
  93. package/lib/components/notification/notification_event_meta.js +1 -1
  94. package/lib/components/page/page_header/page_header_content.js +1 -1
  95. package/lib/components/page/page_section/page_section.js +3 -4
  96. package/lib/components/pagination/pagination_button.styles.js +4 -2
  97. package/lib/components/popover/popover_title.js +2 -2
  98. package/lib/components/popover/popover_title.styles.js +19 -7
  99. package/lib/components/progress/progress.js +2 -2
  100. package/lib/components/search_bar/filters/custom_component_filter.js +29 -0
  101. package/lib/components/search_bar/filters/filters.js +7 -0
  102. package/lib/components/search_bar/query/ast.js +12 -0
  103. package/lib/components/search_bar/query/ast_to_es_query_dsl.js +16 -11
  104. package/lib/components/search_bar/query/query.js +17 -0
  105. package/lib/components/search_bar/search_bar.js +4 -0
  106. package/lib/components/search_bar/search_filters.js +4 -0
  107. package/lib/components/selectable/selectable_list/selectable_list.js +2 -2
  108. package/lib/components/selectable/selectable_list/selectable_list_item.js +2 -2
  109. package/lib/components/text/text.styles.js +5 -2
  110. package/lib/components/tool_tip/tool_tip.styles.js +6 -5
  111. package/lib/components/tour/tour.styles.js +10 -5
  112. package/lib/global_styling/functions/index.js +13 -0
  113. package/lib/global_styling/functions/math.js +55 -0
  114. package/lib/global_styling/mixins/_helpers.js +5 -2
  115. package/lib/services/color/contrast.js +6 -1
  116. package/lib/services/index.js +7 -0
  117. package/lib/services/theme/context.js +4 -2
  118. package/lib/services/theme/hooks.js +28 -0
  119. package/lib/services/theme/index.js +12 -0
  120. package/lib/services/theme/provider.js +23 -2
  121. package/optimize/es/components/accordion/accordion.js +5 -4
  122. package/optimize/es/components/accordion/accordion.styles.js +1 -1
  123. package/optimize/es/components/badge/badge.js +82 -76
  124. package/optimize/es/components/badge/badge.styles.js +62 -0
  125. package/optimize/es/components/basic_table/in_memory_table.js +4 -0
  126. package/optimize/es/components/breadcrumbs/breadcrumb.styles.js +4 -2
  127. package/optimize/es/components/button/button.js +0 -1
  128. package/optimize/es/components/button/button_display/_button_display.js +8 -3
  129. package/optimize/es/components/button/button_display/_button_display.styles.js +2 -2
  130. package/optimize/es/components/button/button_display/_button_display_content.js +3 -1
  131. package/optimize/es/components/button/button_display/_button_display_content.styles.js +4 -1
  132. package/optimize/es/components/button/button_icon/button_icon.js +11 -7
  133. package/optimize/es/components/card/card.js +2 -2
  134. package/optimize/es/components/card/card.styles.js +5 -2
  135. package/optimize/es/components/expression/expression.styles.js +4 -2
  136. package/optimize/es/components/flyout/flyout.js +27 -48
  137. package/optimize/es/components/flyout/flyout.styles.js +111 -0
  138. package/optimize/es/components/flyout/flyout_body.js +14 -6
  139. package/optimize/es/components/flyout/flyout_body.styles.js +21 -0
  140. package/optimize/es/components/flyout/flyout_footer.js +8 -1
  141. package/optimize/es/components/flyout/flyout_footer.styles.js +14 -0
  142. package/optimize/es/components/flyout/flyout_header.js +9 -4
  143. package/optimize/es/components/flyout/flyout_header.styles.js +28 -0
  144. package/optimize/es/components/image/image_wrapper.js +3 -3
  145. package/optimize/es/components/markdown_editor/markdown_format.styles.js +11 -6
  146. package/optimize/es/components/page/page_header/page_header_content.js +1 -1
  147. package/optimize/es/components/page/page_section/page_section.js +3 -4
  148. package/optimize/es/components/pagination/pagination_button.styles.js +5 -3
  149. package/optimize/es/components/popover/popover_title.js +2 -2
  150. package/optimize/es/components/popover/popover_title.styles.js +18 -6
  151. package/optimize/es/components/progress/progress.js +2 -2
  152. package/optimize/es/components/search_bar/filters/custom_component_filter.js +16 -0
  153. package/optimize/es/components/search_bar/filters/filters.js +6 -0
  154. package/optimize/es/components/search_bar/query/ast.js +12 -0
  155. package/optimize/es/components/search_bar/query/ast_to_es_query_dsl.js +14 -9
  156. package/optimize/es/components/search_bar/query/query.js +17 -0
  157. package/optimize/es/components/text/text.styles.js +6 -3
  158. package/optimize/es/components/tool_tip/tool_tip.styles.js +7 -6
  159. package/optimize/es/components/tour/tour.styles.js +11 -6
  160. package/optimize/es/global_styling/functions/index.js +1 -0
  161. package/optimize/es/global_styling/functions/math.js +44 -0
  162. package/optimize/es/global_styling/mixins/_helpers.js +5 -2
  163. package/optimize/es/services/color/contrast.js +2 -0
  164. package/optimize/es/services/index.js +1 -1
  165. package/optimize/es/services/theme/context.js +2 -1
  166. package/optimize/es/services/theme/hooks.js +27 -1
  167. package/optimize/es/services/theme/index.js +1 -1
  168. package/optimize/es/services/theme/provider.js +14 -1
  169. package/optimize/lib/components/accordion/accordion.js +5 -4
  170. package/optimize/lib/components/accordion/accordion.styles.js +1 -1
  171. package/optimize/lib/components/badge/badge.js +90 -78
  172. package/optimize/lib/components/badge/badge.styles.js +67 -0
  173. package/optimize/lib/components/basic_table/in_memory_table.js +4 -0
  174. package/optimize/lib/components/breadcrumbs/breadcrumb.styles.js +3 -1
  175. package/optimize/lib/components/button/button.js +0 -1
  176. package/optimize/lib/components/button/button_display/_button_display.js +8 -3
  177. package/optimize/lib/components/button/button_display/_button_display.styles.js +2 -2
  178. package/optimize/lib/components/button/button_display/_button_display_content.js +6 -2
  179. package/optimize/lib/components/button/button_display/_button_display_content.styles.js +4 -1
  180. package/optimize/lib/components/button/button_icon/button_icon.js +11 -7
  181. package/optimize/lib/components/card/card.js +2 -2
  182. package/optimize/lib/components/card/card.styles.js +5 -2
  183. package/optimize/lib/components/expression/expression.styles.js +3 -1
  184. package/optimize/lib/components/flyout/flyout.js +27 -47
  185. package/optimize/lib/components/flyout/flyout.styles.js +124 -0
  186. package/optimize/lib/components/flyout/flyout_body.js +16 -6
  187. package/optimize/lib/components/flyout/flyout_body.styles.js +32 -0
  188. package/optimize/lib/components/flyout/flyout_footer.js +10 -1
  189. package/optimize/lib/components/flyout/flyout_footer.styles.js +24 -0
  190. package/optimize/lib/components/flyout/flyout_header.js +11 -4
  191. package/optimize/lib/components/flyout/flyout_header.styles.js +31 -0
  192. package/optimize/lib/components/image/image_wrapper.js +3 -3
  193. package/optimize/lib/components/markdown_editor/markdown_format.styles.js +10 -5
  194. package/optimize/lib/components/page/page_header/page_header_content.js +1 -1
  195. package/optimize/lib/components/page/page_section/page_section.js +3 -4
  196. package/optimize/lib/components/pagination/pagination_button.styles.js +4 -2
  197. package/optimize/lib/components/popover/popover_title.js +2 -2
  198. package/optimize/lib/components/popover/popover_title.styles.js +19 -7
  199. package/optimize/lib/components/progress/progress.js +2 -2
  200. package/optimize/lib/components/search_bar/filters/custom_component_filter.js +29 -0
  201. package/optimize/lib/components/search_bar/filters/filters.js +7 -0
  202. package/optimize/lib/components/search_bar/query/ast.js +12 -0
  203. package/optimize/lib/components/search_bar/query/ast_to_es_query_dsl.js +16 -11
  204. package/optimize/lib/components/search_bar/query/query.js +17 -0
  205. package/optimize/lib/components/text/text.styles.js +5 -2
  206. package/optimize/lib/components/tool_tip/tool_tip.styles.js +6 -5
  207. package/optimize/lib/components/tour/tour.styles.js +10 -5
  208. package/optimize/lib/global_styling/functions/index.js +13 -0
  209. package/optimize/lib/global_styling/functions/math.js +57 -0
  210. package/optimize/lib/global_styling/mixins/_helpers.js +5 -2
  211. package/optimize/lib/services/color/contrast.js +5 -1
  212. package/optimize/lib/services/index.js +7 -0
  213. package/optimize/lib/services/theme/context.js +4 -2
  214. package/optimize/lib/services/theme/hooks.js +28 -0
  215. package/optimize/lib/services/theme/index.js +12 -0
  216. package/optimize/lib/services/theme/provider.js +23 -9
  217. package/package.json +5 -5
  218. package/src/components/badge/_index.scss +0 -1
  219. package/src/components/index.scss +0 -1
  220. package/src/themes/amsterdam/global_styling/variables/_index.scss +0 -1
  221. package/test-env/components/accordion/accordion.js +5 -4
  222. package/test-env/components/accordion/accordion.styles.js +1 -1
  223. package/test-env/components/badge/badge.js +92 -80
  224. package/test-env/components/badge/badge.styles.js +67 -0
  225. package/test-env/components/basic_table/in_memory_table.js +8 -0
  226. package/test-env/components/breadcrumbs/breadcrumb.styles.js +3 -1
  227. package/test-env/components/button/button.js +0 -1
  228. package/test-env/components/button/button_display/_button_display.js +10 -5
  229. package/test-env/components/button/button_display/_button_display.styles.js +2 -2
  230. package/test-env/components/button/button_display/_button_display_content.js +8 -4
  231. package/test-env/components/button/button_display/_button_display_content.styles.js +4 -1
  232. package/test-env/components/button/button_icon/button_icon.js +11 -7
  233. package/test-env/components/card/card.js +2 -2
  234. package/test-env/components/card/card.styles.js +5 -2
  235. package/test-env/components/collapsible_nav/collapsible_nav.js +8 -0
  236. package/test-env/components/expression/expression.styles.js +3 -1
  237. package/test-env/components/flyout/flyout.styles.js +124 -0
  238. package/test-env/components/flyout/flyout_body.js +16 -6
  239. package/test-env/components/flyout/flyout_body.styles.js +32 -0
  240. package/test-env/components/flyout/flyout_footer.js +10 -1
  241. package/test-env/components/flyout/flyout_footer.styles.js +24 -0
  242. package/test-env/components/flyout/flyout_header.js +11 -4
  243. package/test-env/components/flyout/flyout_header.styles.js +31 -0
  244. package/test-env/components/image/image_wrapper.js +3 -3
  245. package/test-env/components/markdown_editor/markdown_format.styles.js +10 -5
  246. package/test-env/components/notification/notification_event.js +1 -1
  247. package/test-env/components/notification/notification_event_meta.js +1 -1
  248. package/test-env/components/page/page_header/page_header_content.js +1 -1
  249. package/test-env/components/page/page_section/page_section.js +3 -4
  250. package/test-env/components/pagination/pagination_button.styles.js +4 -2
  251. package/test-env/components/popover/popover_title.js +2 -2
  252. package/test-env/components/popover/popover_title.styles.js +19 -7
  253. package/test-env/components/progress/progress.js +2 -2
  254. package/test-env/components/search_bar/filters/custom_component_filter.js +29 -0
  255. package/test-env/components/search_bar/filters/filters.js +7 -0
  256. package/test-env/components/search_bar/query/ast.js +12 -0
  257. package/test-env/components/search_bar/query/ast_to_es_query_dsl.js +16 -11
  258. package/test-env/components/search_bar/query/query.js +17 -0
  259. package/test-env/components/search_bar/search_bar.js +4 -0
  260. package/test-env/components/search_bar/search_filters.js +4 -0
  261. package/test-env/components/selectable/selectable_list/selectable_list.js +2 -2
  262. package/test-env/components/selectable/selectable_list/selectable_list_item.js +2 -2
  263. package/test-env/components/text/text.styles.js +5 -2
  264. package/test-env/components/tool_tip/tool_tip.styles.js +6 -5
  265. package/test-env/components/tour/tour.styles.js +10 -5
  266. package/test-env/global_styling/functions/index.js +13 -0
  267. package/test-env/global_styling/functions/math.js +57 -0
  268. package/test-env/global_styling/mixins/_helpers.js +5 -2
  269. package/test-env/services/color/contrast.js +5 -1
  270. package/test-env/services/index.js +7 -0
  271. package/test-env/services/theme/context.js +4 -2
  272. package/test-env/services/theme/hooks.js +28 -0
  273. package/test-env/services/theme/index.js +12 -0
  274. package/test-env/services/theme/provider.js +23 -9
  275. package/src/components/badge/_badge.scss +0 -133
  276. package/src/components/flyout/_flyout.scss +0 -196
  277. package/src/components/flyout/_flyout_body.scss +0 -18
  278. package/src/components/flyout/_flyout_footer.scss +0 -4
  279. package/src/components/flyout/_flyout_header.scss +0 -7
  280. package/src/components/flyout/_index.scss +0 -7
  281. package/src/components/flyout/_mixins.scss +0 -18
  282. package/src/components/flyout/_variables.scss +0 -8
  283. package/src/themes/amsterdam/global_styling/variables/_flyout.scss +0 -1
@@ -21,7 +21,9 @@ var _mixins = require("../../themes/amsterdam/global_styling/mixins");
21
21
  var euiPaginationButtonStyles = function euiPaginationButtonStyles(euiThemeContext) {
22
22
  var euiTheme = euiThemeContext.euiTheme;
23
23
  var fontSizeS = (0, _global_styling.euiFontSize)(euiThemeContext, 's');
24
- var halfSizeM = parseInt(euiTheme.size.m.replace('px', '')) / 2;
24
+ var halfSizeM = (0, _global_styling.mathWithUnits)(euiTheme.size.m, function (x) {
25
+ return x / 2;
26
+ });
25
27
  var disabled = (0, _mixins.euiButtonEmptyColor)(euiThemeContext, 'disabled'); // && to increase specificity. Can likely be removed once EuiButtonEmpty has been converted.
26
28
 
27
29
  return {
@@ -29,7 +31,7 @@ var euiPaginationButtonStyles = function euiPaginationButtonStyles(euiThemeConte
29
31
  euiPaginationButton: /*#__PURE__*/(0, _react.css)("&&{", fontSizeS, ";padding:0;", (0, _global_styling.logicalTextAlignCSS)('center'), " border-radius:", euiTheme.border.radius.medium, ";outline-offset:-", euiTheme.focus.width, ";};label:euiPaginationButton;"),
30
32
  // States
31
33
  isActive: /*#__PURE__*/(0, _react.css)("&&{font-weight:", euiTheme.font.weight.bold, ";color:", euiTheme.colors.primary, ";.euiButtonEmpty__content{cursor:default;}&&,&&:hover{text-decoration:underline;}};label:isActive;"),
32
- isPlaceholder: /*#__PURE__*/(0, _react.css)("&&{align-items:baseline;color:", disabled.color, ";", fontSizeS, ";", (0, _global_styling.logicalCSS)('padding-top', "".concat(halfSizeM, "px")), ";", (0, _global_styling.logicalCSS)('padding-bottom', 0), ";", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.s), ";", (0, _global_styling.logicalCSS)('height', euiTheme.size.l), ";};label:isPlaceholder;")
34
+ isPlaceholder: /*#__PURE__*/(0, _react.css)("&&{align-items:baseline;color:", disabled.color, ";", fontSizeS, ";", (0, _global_styling.logicalCSS)('padding-top', halfSizeM), ";", (0, _global_styling.logicalCSS)('padding-bottom', 0), ";", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.s), ";", (0, _global_styling.logicalCSS)('height', euiTheme.size.l), ";};label:isPlaceholder;")
33
35
  };
34
36
  };
35
37
 
@@ -47,9 +47,9 @@ var EuiPopoverTitle = function EuiPopoverTitle(_ref) {
47
47
  panelPadding = _useContext.paddingSize;
48
48
 
49
49
  var euiTheme = (0, _services.useEuiTheme)();
50
- var styles = (0, _popover_title.euiPopoverTitleStyles)(euiTheme, panelPadding);
50
+ var styles = (0, _popover_title.euiPopoverTitleStyles)(euiTheme);
51
51
  var paddingStyles = (0, _global_styling.useEuiPaddingCSS)();
52
- var cssStyles = [styles.euiPopoverTitle, // If a paddingSize is not directly provided, inherit from the EuiPopoverPanel
52
+ var cssStyles = [styles.euiPopoverTitle, styles.panelPaddingSizes[panelPadding], // If a paddingSize is not directly provided, inherit from the EuiPopoverPanel
53
53
  paddingStyles[paddingSize || panelPadding]];
54
54
  var classes = (0, _classnames.default)('euiPopoverTitle', className);
55
55
  return (0, _react2.jsx)("div", _extends({
@@ -18,15 +18,27 @@ var _title = require("../title/title.styles");
18
18
  * in compliance with, at your election, the Elastic License 2.0 or the Server
19
19
  * Side Public License, v 1.
20
20
  */
21
- var euiPopoverTitleStyles = function euiPopoverTitleStyles(euiThemeContext, panelPadding) {
22
- var euiTheme = euiThemeContext.euiTheme; // If the popover's containing panel has padding applied,
23
- // ensure the title expands to cover that padding and
24
-
25
- var panelPaddingSize = (0, _global_styling.euiPaddingSize)(euiThemeContext, panelPadding);
21
+ var euiPopoverTitleStyles = function euiPopoverTitleStyles(euiThemeContext) {
22
+ var euiTheme = euiThemeContext.euiTheme;
26
23
  return {
27
24
  // Base
28
- euiPopoverTitle: /*#__PURE__*/(0, _react.css)((0, _title.euiTitle)(euiThemeContext, 'xxs'), ";", (0, _global_styling.logicalCSS)('border-bottom', euiTheme.border.thin), ";margin:-", panelPaddingSize, " -", panelPaddingSize, " ", panelPaddingSize, ";;label:euiPopoverTitle;")
25
+ euiPopoverTitle: /*#__PURE__*/(0, _react.css)((0, _title.euiTitle)(euiThemeContext, 'xxs'), ";", (0, _global_styling.logicalCSS)('border-bottom', euiTheme.border.thin), ";;label:euiPopoverTitle;"),
26
+ // If the popover's containing panel has padding applied,
27
+ // ensure the title expands to cover that padding via negative margins
28
+ panelPaddingSizes: {
29
+ none: /*#__PURE__*/(0, _react.css)(";label:none;"),
30
+ xs: /*#__PURE__*/(0, _react.css)(getPaddingOffset(euiThemeContext, 'xs'), ";;label:xs;"),
31
+ s: /*#__PURE__*/(0, _react.css)(getPaddingOffset(euiThemeContext, 's'), ";;label:s;"),
32
+ m: /*#__PURE__*/(0, _react.css)(getPaddingOffset(euiThemeContext, 'm'), ";;label:m;"),
33
+ l: /*#__PURE__*/(0, _react.css)(getPaddingOffset(euiThemeContext, 'l'), ";;label:l;"),
34
+ xl: /*#__PURE__*/(0, _react.css)(getPaddingOffset(euiThemeContext, 'xl'), ";;label:xl;")
35
+ }
29
36
  };
30
37
  };
31
38
 
32
- exports.euiPopoverTitleStyles = euiPopoverTitleStyles;
39
+ exports.euiPopoverTitleStyles = euiPopoverTitleStyles;
40
+
41
+ var getPaddingOffset = function getPaddingOffset(euiThemeContext, size) {
42
+ var panelPaddingSize = (0, _global_styling.euiPaddingSize)(euiThemeContext, size);
43
+ return "margin: -".concat(panelPaddingSize, " -").concat(panelPaddingSize, " ").concat(panelPaddingSize, ";");
44
+ };
@@ -105,9 +105,9 @@ var EuiProgress = function EuiProgress(_ref) {
105
105
  }, label && (0, _react2.jsx)(_inner_text.EuiInnerText, null, function (ref, innerText) {
106
106
  return (0, _react2.jsx)("span", _extends({
107
107
  title: innerText,
108
- ref: ref
108
+ ref: ref,
109
+ css: labelCssStyles
109
110
  }, labelProps, {
110
- css: labelCssStyles,
111
111
  className: labelClasses
112
112
  }), label);
113
113
  }), valueRender && (0, _react2.jsx)(_inner_text.EuiInnerText, null, function (ref, innerText) {
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.CustomComponentFilter = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _react2 = require("@emotion/react");
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ /*
15
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
16
+ * or more contributor license agreements. Licensed under the Elastic License
17
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
18
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
19
+ * Side Public License, v 1.
20
+ */
21
+ var CustomComponentFilter = function CustomComponentFilter(props) {
22
+ var CustomComponent = props.config.component;
23
+ return (0, _react2.jsx)(CustomComponent, {
24
+ query: props.query,
25
+ onChange: props.onChange
26
+ });
27
+ };
28
+
29
+ exports.CustomComponentFilter = CustomComponentFilter;
@@ -15,6 +15,8 @@ var _field_value_toggle_filter = require("./field_value_toggle_filter");
15
15
 
16
16
  var _field_value_toggle_group_filter = require("./field_value_toggle_group_filter");
17
17
 
18
+ var _custom_component_filter = require("./custom_component_filter");
19
+
18
20
  var _react2 = require("@emotion/react");
19
21
 
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -53,6 +55,11 @@ var createFilter = function createFilter(index, config, query, onChange) {
53
55
  config: config
54
56
  }));
55
57
 
58
+ case 'custom_component':
59
+ return (0, _react2.jsx)(_custom_component_filter.CustomComponentFilter, _extends({}, props, {
60
+ config: config
61
+ }));
62
+
56
63
  default:
57
64
  // @ts-ignore TS knows that we've checked `config.type` exhaustively
58
65
  throw new Error("Unknown search filter type [".concat(config.type, "]"));
@@ -547,6 +547,18 @@ var _AST = /*#__PURE__*/function () {
547
547
  return !Is.isInstance(clause) || clause.flag !== flag;
548
548
  }));
549
549
  }
550
+ }, {
551
+ key: "removeIsClauses",
552
+ value: function removeIsClauses() {
553
+ return new _AST(this._clauses.filter(function (clause) {
554
+ return !Is.isInstance(clause);
555
+ }));
556
+ }
557
+ }, {
558
+ key: "removeAllClauses",
559
+ value: function removeAllClauses() {
560
+ return new _AST();
561
+ }
550
562
  }, {
551
563
  key: "getGroupClauses",
552
564
  value: function getGroupClauses() {
@@ -5,18 +5,20 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.astToEsQueryDsl = exports._termValuesToQuery = exports._isFlagToQuery = exports._fieldValuesToQuery = void 0;
7
7
 
8
- var _date_format = require("./date_format");
8
+ var _predicate = require("../../../services/predicate");
9
9
 
10
- var _date_value = require("./date_value");
10
+ var _common = require("../../common");
11
11
 
12
12
  var _ast = require("./ast");
13
13
 
14
- var _predicate = require("../../../services/predicate");
14
+ var _date_format = require("./date_format");
15
15
 
16
- var _common = require("../../common");
16
+ var _date_value = require("./date_value");
17
17
 
18
18
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
19
19
 
20
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21
+
20
22
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
21
23
 
22
24
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -29,8 +31,6 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
29
31
 
30
32
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
31
33
 
32
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
33
-
34
34
  var processDateOperation = function processDateOperation(value, operator) {
35
35
  var granularity = value.granularity,
36
36
  resolve = value.resolve;
@@ -122,12 +122,17 @@ var _fieldValuesToQuery = function _fieldValuesToQuery(field, operations, andOr)
122
122
  }
123
123
  });
124
124
 
125
- if (_terms.length > 0) {
125
+ if (_terms.length > 1) {
126
+ queries.push({
127
+ bool: _defineProperty({}, andOr === 'and' ? 'must' : 'should', _toConsumableArray(_terms.map(function (value) {
128
+ return {
129
+ match: _defineProperty({}, field, value)
130
+ };
131
+ })))
132
+ });
133
+ } else if (_terms.length === 1) {
126
134
  queries.push({
127
- match: _defineProperty({}, field, {
128
- query: _terms.join(' '),
129
- operator: andOr
130
- })
135
+ match: _defineProperty({}, field, _terms[0])
131
136
  });
132
137
  }
133
138
 
@@ -49,6 +49,11 @@ var Query = /*#__PURE__*/function () {
49
49
  }
50
50
 
51
51
  _createClass(Query, [{
52
+ key: "hasClauses",
53
+ value: function hasClauses() {
54
+ return this.ast.clauses.length > 0;
55
+ }
56
+ }, {
52
57
  key: "hasSimpleFieldClause",
53
58
  value: function hasSimpleFieldClause(field, value) {
54
59
  return this.ast.hasSimpleFieldClause(field, value);
@@ -108,6 +113,12 @@ var Query = /*#__PURE__*/function () {
108
113
  var ast = this.ast.removeOrFieldClauses(field);
109
114
  return new Query(ast, this.syntax);
110
115
  }
116
+ }, {
117
+ key: "removeAllClauses",
118
+ value: function removeAllClauses() {
119
+ var ast = this.ast.removeAllClauses();
120
+ return new Query(ast, this.syntax);
121
+ }
111
122
  }, {
112
123
  key: "hasIsClause",
113
124
  value: function hasIsClause(flag) {
@@ -136,6 +147,12 @@ var Query = /*#__PURE__*/function () {
136
147
  var ast = this.ast.removeIsClause(flag);
137
148
  return new Query(ast, this.syntax);
138
149
  }
150
+ }, {
151
+ key: "removeIsClauses",
152
+ value: function removeIsClauses() {
153
+ var ast = this.ast.removeIsClauses();
154
+ return new Query(ast, this.syntax);
155
+ }
139
156
  /**
140
157
  * Executes this query over the given iterable item and returns
141
158
  * an new array of all items that matched this query. Options:
@@ -437,6 +437,10 @@ EuiSearchBar.propTypes = {
437
437
  operator: _propTypes.default.oneOf(["eq", "exact", "gt", "gte", "lt", "lte"])
438
438
  }).isRequired).isRequired,
439
439
  available: _propTypes.default.func
440
+ }).isRequired, _propTypes.default.shape({
441
+ type: _propTypes.default.oneOf(["custom_component"]).isRequired,
442
+ component: _propTypes.default.elementType.isRequired,
443
+ available: _propTypes.default.func
440
444
  }).isRequired]).isRequired),
441
445
 
442
446
  /**
@@ -169,5 +169,9 @@ EuiSearchFilters.propTypes = {
169
169
  operator: _propTypes.default.oneOf(["eq", "exact", "gt", "gte", "lt", "lte"])
170
170
  }).isRequired).isRequired,
171
171
  available: _propTypes.default.func
172
+ }).isRequired, _propTypes.default.shape({
173
+ type: _propTypes.default.oneOf(["custom_component"]).isRequired,
174
+ component: _propTypes.default.elementType.isRequired,
175
+ available: _propTypes.default.func
172
176
  }).isRequired]).isRequired).isRequired
173
177
  };
@@ -454,12 +454,12 @@ EuiSelectableList.propTypes = {
454
454
  /**
455
455
  * The side of the badge the icon should sit
456
456
  */
457
- iconSide: _propTypes.default.oneOf(["left", "right"]),
457
+ iconSide: _propTypes.default.any,
458
458
 
459
459
  /**
460
460
  * Accepts either our palette colors (primary, success ..etc) or a hex value `#FFFFFF`, `#000`.
461
461
  */
462
- color: _propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.any.isRequired]),
462
+ color: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.string.isRequired]),
463
463
 
464
464
  /**
465
465
  * Will override any color passed through the `color` prop.
@@ -289,12 +289,12 @@ EuiSelectableListItem.propTypes = {
289
289
  /**
290
290
  * The side of the badge the icon should sit
291
291
  */
292
- iconSide: _propTypes.default.oneOf(["left", "right"]),
292
+ iconSide: _propTypes.default.any,
293
293
 
294
294
  /**
295
295
  * Accepts either our palette colors (primary, success ..etc) or a hex value `#FFFFFF`, `#000`.
296
296
  */
297
- color: _propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.any.isRequired]),
297
+ color: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.string.isRequired]),
298
298
 
299
299
  /**
300
300
  * Will override any color passed through the `color` prop.
@@ -61,8 +61,11 @@ var euiScaleText = function euiScaleText(euiThemeContext, options) {
61
61
  }; // Generate margins for headings based on customScale (not on heading level)
62
62
 
63
63
  var customScale = _customScale === 'xxxs' ? 'xxs' : _customScale || 'm';
64
- var headingMarginTop = "".concat(parseFloat(euiTheme.size[customScale]) * 2, "px");
65
- var headingMarginBottom = euiTheme.size[customScale];
64
+ var marginSize = euiTheme.size[customScale];
65
+ var headingMarginTop = (0, _global_styling.mathWithUnits)(marginSize, function (x) {
66
+ return x * 2;
67
+ });
68
+ var headingMarginBottom = marginSize;
66
69
  return "\n font-size: ".concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n\n h1 {\n font-size: ").concat(headings.h1.fontSize, ";\n line-height: ").concat(headings.h1.lineHeight, ";\n }\n h1:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n\n h2 {\n font-size: ").concat(headings.h2.fontSize, ";\n line-height: ").concat(headings.h2.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h3 {\n font-size: ").concat(headings.h3.fontSize, ";\n line-height: ").concat(headings.h3.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h4 {\n font-size: ").concat(headings.h4.fontSize, ";\n line-height: ").concat(headings.h4.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h5 {\n font-size: ").concat(headings.h5.fontSize, ";\n line-height: ").concat(headings.h5.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h6 {\n font-size: ").concat(headings.h6.fontSize, ";\n line-height: ").concat(headings.h6.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n p,\n ul,\n ol,\n dl,\n blockquote,\n img,\n pre {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', lineHeightSize), "\n }\n\n ul,\n ol {\n ").concat((0, _global_styling.logicalCSS)('margin-left', lineHeightSize), "\n }\n \n blockquote {\n font-size: ").concat(fontSize, ";\n padding: ").concat(lineHeightSize, ";\n }\n\n dd + dt {\n ").concat((0, _global_styling.logicalCSS)('margin-top', fontSize), "\n }\n\n dt,\n .eui-definitionListReverse dd {\n font-size: ").concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n }\n\n .eui-definitionListReverse dt {\n font-size: ").concat((0, _global_styling.euiFontSize)(euiThemeContext, 'xs', options).fontSize, ";\n color: ").concat(euiTheme.colors.text, ";\n }\n\n small {\n font-size: ").concat((0, _global_styling.euiFontSize)(euiThemeContext, 's', options).fontSize, ";\n }\n\n pre:not(.euiCodeBlock__pre) {\n padding: ").concat(lineHeightSize, ";\n }\n\n code:not(.euiCode):not(.euiCodeBlock__code) {\n font-size: .9em; // 90% of parent font size\n }\n ").concat( // when textSize is 'm', the 'kbd' element gets a line between the text and the border-bottom
67
70
  _customScale === 'm' ? "\n kbd {\n ".concat((0, _global_styling.logicalCSS)('padding-bottom', euiTheme.size.xs), "\n // ensures when only one character the shape looks like a square\n ").concat((0, _global_styling.logicalCSS)('min-width', euiTheme.size.l), "\n ").concat((0, _global_styling.logicalTextAlignCSS)('center'), "\n }\n \n kbd::after {\n content: '';\n ").concat((0, _global_styling.logicalCSS)('border-bottom', "".concat(euiTheme.border.width.thin, " solid ").concat(euiTheme.colors.text)), "\n position: absolute;\n ").concat((0, _global_styling.logicalCSS)('bottom', euiTheme.size.xxs), "\n ").concat((0, _global_styling.logicalCSS)('left', 0), "\n ").concat((0, _global_styling.logicalCSS)('width', '100%'), "\n }") : '', "\n ");
68
71
  };
@@ -48,12 +48,13 @@ var euiToolTipStyles = function euiToolTipStyles(euiThemeContext) {
48
48
  */
49
49
 
50
50
  var arrowSize = euiTheme.size.m;
51
- var arrowSizeInt = parseInt(arrowSize, 10);
52
- var arrowPlusSize = "".concat((arrowSizeInt / 2 + 1) * -1, "px");
53
- /* 1 */
51
+ var arrowPlusSize = (0, _global_styling.mathWithUnits)(arrowSize, function (x) {
52
+ return (x / 2 + 1) * -1;
53
+ }); // 1.
54
54
 
55
- var arrowMinusSize = "".concat((arrowSizeInt / 2 - 1) * -1, "px");
56
- /* 1 */
55
+ var arrowMinusSize = (0, _global_styling.mathWithUnits)(arrowSize, function (x) {
56
+ return (x / 2 - 1) * -1;
57
+ }); // 1.
57
58
 
58
59
  return {
59
60
  // Base
@@ -40,15 +40,20 @@ exports.euiTourStyles = euiTourStyles;
40
40
  var euiTourBeaconStyles = function euiTourBeaconStyles(_ref2) {
41
41
  var euiTheme = _ref2.euiTheme;
42
42
  var arrowSize = euiTheme.size[_popover_arrow.popoverArrowSize];
43
- var arrowSizeInt = parseInt(arrowSize, 10);
43
+ var arrowHalfSize = (0, _global_styling.mathWithUnits)(arrowSize, function (x) {
44
+ return x / 2;
45
+ });
46
+ var arrowOffset = (0, _global_styling.mathWithUnits)(arrowSize, function (x) {
47
+ return x * -2;
48
+ });
44
49
  return {
45
50
  // Base
46
51
  euiTourBeacon: /*#__PURE__*/(0, _react.css)("pointer-events:none;position:absolute;opacity:0;transition:opacity 0s ", euiTheme.animation[_popover_panel.openAnimationTiming], ";;label:euiTourBeacon;"),
47
52
  // Positions
48
- right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', "".concat(arrowSizeInt / 2, "px")), ";", (0, _global_styling.logicalCSS)('left', "".concat(arrowSizeInt * -2, "px")), ";;label:right;"),
49
- left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', "".concat(arrowSizeInt / 2, "px")), ";", (0, _global_styling.logicalCSS)('left', arrowSize), ";;label:left;"),
50
- top: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', arrowSize), ";", (0, _global_styling.logicalCSS)('left', "".concat(arrowSizeInt / 2, "px")), ";;label:top;"),
51
- bottom: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', "".concat(arrowSizeInt * -2, "px")), ";", (0, _global_styling.logicalCSS)('left', "".concat(arrowSizeInt / 2, "px")), ";;label:bottom;")
53
+ right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', arrowHalfSize), ";", (0, _global_styling.logicalCSS)('left', arrowOffset), ";;label:right;"),
54
+ left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', arrowHalfSize), ";", (0, _global_styling.logicalCSS)('left', arrowSize), ";;label:left;"),
55
+ top: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', arrowSize), ";", (0, _global_styling.logicalCSS)('left', arrowHalfSize), ";;label:top;"),
56
+ bottom: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', arrowOffset), ";", (0, _global_styling.logicalCSS)('left', arrowHalfSize), ";;label:bottom;")
52
57
  };
53
58
  };
54
59
 
@@ -17,6 +17,19 @@ Object.keys(_logicals).forEach(function (key) {
17
17
  });
18
18
  });
19
19
 
20
+ var _math = require("./math");
21
+
22
+ Object.keys(_math).forEach(function (key) {
23
+ if (key === "default" || key === "__esModule") return;
24
+ if (key in exports && exports[key] === _math[key]) return;
25
+ Object.defineProperty(exports, key, {
26
+ enumerable: true,
27
+ get: function get() {
28
+ return _math[key];
29
+ }
30
+ });
31
+ });
32
+
20
33
  var _size = require("./size");
21
34
 
22
35
  Object.keys(_size).forEach(function (key) {
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.mathWithUnits = void 0;
9
+
10
+ function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(re, groups) { return new BabelRegExp(re, undefined, groups); }; var _super = RegExp.prototype; var _groups = new WeakMap(); function BabelRegExp(re, flags, groups) { var _this = new RegExp(re, flags); _groups.set(_this, groups || _groups.get(re)); return _setPrototypeOf(_this, BabelRegExp.prototype); } _inherits(BabelRegExp, RegExp); BabelRegExp.prototype.exec = function (str) { var result = _super.exec.call(this, str); if (result) result.groups = buildGroups(result, this); return result; }; BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { if (typeof substitution === "string") { var groups = _groups.get(this); return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { return "$" + groups[name]; })); } else if (typeof substitution === "function") { var _this = this; return _super[Symbol.replace].call(this, str, function () { var args = arguments; if (_typeof(args[args.length - 1]) !== "object") { args = [].slice.call(args); args.push(buildGroups(args, _this)); } return substitution.apply(this, args); }); } else { return _super[Symbol.replace].call(this, str, substitution); } }; function buildGroups(result, re) { var g = _groups.get(re); return Object.keys(g).reduce(function (groups, name) { groups[name] = result[g[name]]; return groups; }, Object.create(null)); } return _wrapRegExp.apply(this, arguments); }
11
+
12
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
13
+
14
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
15
+
16
+ /*
17
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
18
+ * or more contributor license agreements. Licensed under the Elastic License
19
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
20
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
21
+ * Side Public License, v 1.
22
+ */
23
+
24
+ /**
25
+ * Utility for performing math callbacks on a string with CSS units
26
+ * and returning a string with its unit preserved.
27
+ *
28
+ * Example usage:
29
+ * mathWithUnits('4px', (x) => x / 2) = '2px';
30
+ * mathWithUnits(euiTheme.size.xs, (x) => x + 2) = '6px';
31
+ */
32
+ var mathWithUnits = function mathWithUnits(value, callback) {
33
+ var unit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
34
+
35
+ if (typeof value === 'string') {
36
+ var _matches$groups;
37
+
38
+ var regex = /*#__PURE__*/_wrapRegExp(/(\x2D?[\.0-9]+)(%|[A-Za-z]*)/, {
39
+ value: 1,
40
+ unit: 2
41
+ });
42
+
43
+ var matches = regex.exec(value);
44
+ if (!(matches !== null && matches !== void 0 && (_matches$groups = matches.groups) !== null && _matches$groups !== void 0 && _matches$groups.value)) return value;
45
+ var numericValue = Number(matches.groups.value);
46
+ var passedUnit = matches.groups.unit || unit;
47
+ return "".concat(callback(numericValue)).concat(passedUnit);
48
+ } else if (typeof value === 'number') {
49
+ return "".concat(callback(value)).concat(unit);
50
+ } else {
51
+ return value;
52
+ }
53
+ };
54
+
55
+ exports.mathWithUnits = mathWithUnits;
@@ -117,12 +117,15 @@ exports.useEuiYScroll = useEuiYScroll;
117
117
 
118
118
  var euiYScrollWithShadows = function euiYScrollWithShadows(euiTheme) {
119
119
  var _ref7 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
120
- height = _ref7.height;
120
+ height = _ref7.height,
121
+ _ref7$side = _ref7.side,
122
+ side = _ref7$side === void 0 ? 'both' : _ref7$side;
121
123
 
122
124
  return "\n ".concat(euiYScroll(euiTheme, {
123
125
  height: height
124
126
  }), "\n ").concat(euiOverflowShadowStyles(euiTheme, {
125
- direction: 'y'
127
+ direction: 'y',
128
+ side: side
126
129
  }), "\n");
127
130
  };
128
131
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.makeHighContrastColor = exports.makeDisabledContrastColor = void 0;
6
+ exports.wcagContrastMin = exports.makeHighContrastColor = exports.makeDisabledContrastColor = void 0;
7
7
 
8
8
  var _chromaJs = _interopRequireDefault(require("chroma-js"));
9
9
 
@@ -15,6 +15,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
15
15
 
16
16
  function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
17
17
 
18
+ var wcagContrastMin = 4.5; // WCAG AA minimum contrast ratio for normal (non-large) text
19
+
18
20
  /**
19
21
  * Creates a new color that meets or exceeds WCAG level AA
20
22
  * @param foreground - Color to manipulate
@@ -22,6 +24,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
22
24
  * *
23
25
  * @param themeOrBackground - Color to use as the contrast basis or just pass EuiTheme
24
26
  */
27
+
28
+ exports.wcagContrastMin = wcagContrastMin;
29
+
25
30
  var makeHighContrastColor = function makeHighContrastColor(_foreground) {
26
31
  var ratio = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 4.85;
27
32
  return function (themeOrBackground) {
@@ -57,6 +57,7 @@ var _exportNames = {
57
57
  lightness: true,
58
58
  makeHighContrastColor: true,
59
59
  makeDisabledContrastColor: true,
60
+ wcagContrastMin: true,
60
61
  useColorPickerState: true,
61
62
  useColorStopsState: true,
62
63
  copyToClipboard: true,
@@ -569,6 +570,12 @@ Object.defineProperty(exports, "useIsWithinMinBreakpoint", {
569
570
  return _breakpoint.useIsWithinMinBreakpoint;
570
571
  }
571
572
  });
573
+ Object.defineProperty(exports, "wcagContrastMin", {
574
+ enumerable: true,
575
+ get: function get() {
576
+ return _color.wcagContrastMin;
577
+ }
578
+ });
572
579
 
573
580
  var keys = _interopRequireWildcard(require("./keys"));
574
581
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.EuiThemeContext = exports.EuiSystemContext = exports.EuiModificationsContext = exports.EuiColorModeContext = void 0;
6
+ exports.defaultComputedTheme = exports.EuiThemeContext = exports.EuiSystemContext = exports.EuiModificationsContext = exports.EuiColorModeContext = void 0;
7
7
 
8
8
  var _react = require("react");
9
9
 
@@ -24,5 +24,7 @@ var EuiModificationsContext = /*#__PURE__*/(0, _react.createContext)({});
24
24
  exports.EuiModificationsContext = EuiModificationsContext;
25
25
  var EuiColorModeContext = /*#__PURE__*/(0, _react.createContext)(_utils.DEFAULT_COLOR_MODE);
26
26
  exports.EuiColorModeContext = EuiColorModeContext;
27
- var EuiThemeContext = /*#__PURE__*/(0, _react.createContext)((0, _utils.getComputed)(_theme.EuiThemeAmsterdam, {}, _utils.DEFAULT_COLOR_MODE));
27
+ var defaultComputedTheme = (0, _utils.getComputed)(_theme.EuiThemeAmsterdam, {}, _utils.DEFAULT_COLOR_MODE);
28
+ exports.defaultComputedTheme = defaultComputedTheme;
29
+ var EuiThemeContext = /*#__PURE__*/(0, _react.createContext)(defaultComputedTheme);
28
30
  exports.EuiThemeContext = EuiThemeContext;
@@ -11,6 +11,8 @@ var _react = _interopRequireWildcard(require("react"));
11
11
 
12
12
  var _context = require("./context");
13
13
 
14
+ var _provider = require("./provider");
15
+
14
16
  var _react2 = require("@emotion/react");
15
17
 
16
18
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -19,10 +21,36 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
19
21
 
20
22
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
21
23
 
24
+ var providerMessage = "`EuiProvider` is missing which can result in negative effects.\nWrap your component in `EuiProvider`: https://ela.st/euiprovider.";
25
+
22
26
  var useEuiTheme = function useEuiTheme() {
23
27
  var theme = (0, _react.useContext)(_context.EuiThemeContext);
24
28
  var colorMode = (0, _react.useContext)(_context.EuiColorModeContext);
25
29
  var modifications = (0, _react.useContext)(_context.EuiModificationsContext);
30
+
31
+ if (process.env.NODE_ENV !== 'production') {
32
+ var isFallback = theme === _context.defaultComputedTheme;
33
+ var warningLevel = (0, _provider.getEuiDevProviderWarning)();
34
+
35
+ if (isFallback && typeof warningLevel !== 'undefined') {
36
+ switch (warningLevel) {
37
+ case 'log':
38
+ console.log(providerMessage);
39
+ break;
40
+
41
+ case 'warn':
42
+ console.warn(providerMessage);
43
+ break;
44
+
45
+ case 'error':
46
+ throw new Error(providerMessage);
47
+
48
+ default:
49
+ break;
50
+ }
51
+ }
52
+ }
53
+
26
54
  var assembledTheme = (0, _react.useMemo)(function () {
27
55
  return {
28
56
  euiTheme: theme,
@@ -69,6 +69,12 @@ Object.defineProperty(exports, "getComputed", {
69
69
  return _utils.getComputed;
70
70
  }
71
71
  });
72
+ Object.defineProperty(exports, "getEuiDevProviderWarning", {
73
+ enumerable: true,
74
+ get: function get() {
75
+ return _provider.getEuiDevProviderWarning;
76
+ }
77
+ });
72
78
  Object.defineProperty(exports, "getOn", {
73
79
  enumerable: true,
74
80
  get: function get() {
@@ -87,6 +93,12 @@ Object.defineProperty(exports, "mergeDeep", {
87
93
  return _utils.mergeDeep;
88
94
  }
89
95
  });
96
+ Object.defineProperty(exports, "setEuiDevProviderWarning", {
97
+ enumerable: true,
98
+ get: function get() {
99
+ return _provider.setEuiDevProviderWarning;
100
+ }
101
+ });
90
102
  Object.defineProperty(exports, "setOn", {
91
103
  enumerable: true,
92
104
  get: function get() {