@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
@@ -57,7 +57,7 @@ var _ref5 = process.env.NODE_ENV === "production" ? {
57
57
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
58
58
  };
59
59
 
60
- var euiCardStyles = function euiCardStyles(euiThemeContext, paddingSize, color) {
60
+ var euiCardStyles = function euiCardStyles(euiThemeContext, paddingSize) {
61
61
  var euiTheme = euiThemeContext.euiTheme;
62
62
  var paddingAmount = (0, _global_styling.euiPaddingSize)(euiThemeContext, paddingSize);
63
63
  var spacing = (0, _global_styling.euiPaddingSize)(euiThemeContext, paddingKey);
@@ -94,7 +94,10 @@ var euiCardStyles = function euiCardStyles(euiThemeContext, paddingSize, color)
94
94
  },
95
95
  disabled: _ref2
96
96
  },
97
- euiCard__image: /*#__PURE__*/(0, _react.css)("position:relative;overflow:hidden;", (0, _global_styling.logicalCSS)('width', "calc(100% + (".concat(paddingAmount, " * 2))")), ";", (0, _global_styling.logicalCSS)('left', "-".concat(paddingAmount)), ";", (0, _global_styling.logicalCSS)('top', "-".concat(paddingAmount)), ";", (0, _global_styling.logicalCSS)('margin-bottom', "-".concat(paddingAmount)), ";", (0, _global_styling.logicalCSS)('border-top-left-radius', "calc(".concat(euiTheme.border.radius.medium, " - ").concat(euiTheme.border.width.thin, ")")), " ", _global_styling.logicals['border-top-right-radius'], ":calc(", euiTheme.border.radius.medium, " - ", euiTheme.border.width.thin, ");", color === 'transparent' ? "border-radius: ".concat(euiTheme.border.radius.medium, ";") : undefined, " img{", (0, _global_styling.logicalCSS)('width', '100%'), ";};label:euiCard__image;"),
97
+ image: {
98
+ euiCard__image: /*#__PURE__*/(0, _react.css)("position:relative;overflow:hidden;", (0, _global_styling.logicalCSS)('width', "calc(100% + (".concat(paddingAmount, " * 2))")), ";", (0, _global_styling.logicalCSS)('left', "-".concat(paddingAmount)), ";", (0, _global_styling.logicalCSS)('top', "-".concat(paddingAmount)), ";", (0, _global_styling.logicalCSS)('margin-bottom', "-".concat(paddingAmount)), ";", (0, _global_styling.logicalCSS)('border-top-left-radius', "calc(".concat(euiTheme.border.radius.medium, " - ").concat(euiTheme.border.width.thin, ")")), " ", _global_styling.logicals['border-top-right-radius'], ":calc(", euiTheme.border.radius.medium, " - ", euiTheme.border.width.thin, ");img{", (0, _global_styling.logicalCSS)('width', '100%'), ";};label:euiCard__image;"),
99
+ transparent: /*#__PURE__*/(0, _react.css)("border-radius:", euiTheme.border.radius.medium, ";;label:transparent;")
100
+ },
98
101
  icon: {
99
102
  euiCard__icon: /*#__PURE__*/(0, _react.css)(";label:euiCard__icon;"),
100
103
  withImage: /*#__PURE__*/(0, _react.css)("position:absolute;", (0, _global_styling.logicalCSS)('top', '50%'), ";", (0, _global_styling.logicalCSS)('left', '50%'), ";transform:translate(-50%, calc(-50% + -", paddingAmount, "))!important;;label:withImage;"),
@@ -151,6 +151,7 @@ EuiCollapsibleNav.propTypes = {
151
151
  /**
152
152
  * Defines the width of the panel.
153
153
  * Pass a predefined size of `s | m | l`, or pass any number/string compatible with the CSS `width` attribute
154
+ * @default m
154
155
  */
155
156
  size: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.any.isRequired]),
156
157
 
@@ -160,21 +161,25 @@ EuiCollapsibleNav.propTypes = {
160
161
  * set to `false` to not restrict the width,
161
162
  * set to a number for a custom width in px,
162
163
  * set to a string for a custom width in custom measurement.
164
+ * @default false
163
165
  */
164
166
  maxWidth: _propTypes.default.oneOfType([_propTypes.default.bool.isRequired, _propTypes.default.number.isRequired, _propTypes.default.string.isRequired]),
165
167
 
166
168
  /**
167
169
  * Customize the padding around the content of the flyout header, body and footer
170
+ * @default l
168
171
  */
169
172
  paddingSize: _propTypes.default.any,
170
173
 
171
174
  /**
172
175
  * Adds an EuiOverlayMask and wraps in an EuiPortal
176
+ * @default true
173
177
  */
174
178
  ownFocus: _propTypes.default.bool,
175
179
 
176
180
  /**
177
181
  * Hides the default close button. You must provide another close button somewhere within the flyout.
182
+ * @default false
178
183
  */
179
184
  hideCloseButton: _propTypes.default.bool,
180
185
 
@@ -187,6 +192,7 @@ EuiCollapsibleNav.propTypes = {
187
192
  * Position of close button.
188
193
  * `inside`: Floating to just inside the flyout, always top right;
189
194
  * `outside`: Floating just outside the flyout near the top (side dependent on `side`). Helpful when the close button may cover other interactable content.
195
+ * @default inside
190
196
  */
191
197
  closeButtonPosition: _propTypes.default.oneOf(["inside", "outside"]),
192
198
 
@@ -224,12 +230,14 @@ EuiCollapsibleNav.propTypes = {
224
230
  /**
225
231
  * Which side of the window to attach to.
226
232
  * The `left` option should only be used for navigation.
233
+ * @default right
227
234
  */
228
235
  side: _propTypes.default.any,
229
236
 
230
237
  /**
231
238
  * Defaults to `dialog` which is best for most cases of the flyout.
232
239
  * Otherwise pass in your own, aria-role, or `null` to remove it and use the semantic `as` element instead
240
+ * @default dialog
233
241
  */
234
242
  role: _propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.string.isRequired]),
235
243
 
@@ -22,7 +22,9 @@ var _colorCSS = function _colorCSS(color) {
22
22
  var euiExpressionStyles = function euiExpressionStyles(euiThemeContext) {
23
23
  var euiTheme = euiThemeContext.euiTheme;
24
24
  return {
25
- euiExpression: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiTextBreakWord)(), ";display:inline-block;font-family:", euiTheme.font.familyCode, ";", (0, _global_styling.logicalCSS)('border-bottom', "".concat(euiTheme.border.width.thick, " solid transparent")), " ", (0, _global_styling.euiFontSize)(euiThemeContext, 's'), ";", (0, _global_styling.logicalTextAlignCSS)('left'), " padding:", parseFloat(euiTheme.size.s) / 2, "px 0;color:", euiTheme.colors.text, ";&:focus{", (0, _global_styling.logicalCSS)('border-bottom-style', 'solid'), ";}&+.euiExpression{", (0, _global_styling.logicalCSS)('margin-left', euiTheme.size.s), ";};label:euiExpression;"),
25
+ euiExpression: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiTextBreakWord)(), ";display:inline-block;font-family:", euiTheme.font.familyCode, ";", (0, _global_styling.logicalCSS)('border-bottom', "".concat(euiTheme.border.width.thick, " solid transparent")), " ", (0, _global_styling.euiFontSize)(euiThemeContext, 's'), ";", (0, _global_styling.logicalTextAlignCSS)('left'), " padding:", (0, _global_styling.mathWithUnits)(euiTheme.size.s, function (x) {
26
+ return x / 2;
27
+ }), " 0;color:", euiTheme.colors.text, ";&:focus{", (0, _global_styling.logicalCSS)('border-bottom-style', 'solid'), ";}&+.euiExpression{", (0, _global_styling.logicalCSS)('margin-left', euiTheme.size.s), ";};label:euiExpression;"),
26
28
  // Variants
27
29
  columns: /*#__PURE__*/(0, _react.css)("border-color:transparent;", (0, _global_styling.logicalCSS)('border-bottom-style', 'solid'), " ", (0, _global_styling.logicalCSS)('margin-bottom', euiTheme.size.xs), " ", (0, _global_styling.logicalCSS)('width', '100%'), " display:flex;padding:", euiTheme.size.xs, ";border-radius:", euiTheme.size.xs, ";;label:columns;"),
28
30
  truncate: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-width', '100%'), ";;label:truncate;"),
@@ -13,7 +13,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
14
  var _services = require("../../services");
15
15
 
16
- var _common = require("../common");
16
+ var _global_styling = require("../../global_styling");
17
17
 
18
18
  var _focus_trap = require("../focus_trap");
19
19
 
@@ -27,6 +27,8 @@ var _resize_observer = require("../observer/resize_observer");
27
27
 
28
28
  var _portal = require("../portal");
29
29
 
30
+ var _flyout = require("./flyout.styles");
31
+
30
32
  var _react2 = require("@emotion/react");
31
33
 
32
34
  var _excluded = ["className", "children", "as", "hideCloseButton", "closeButtonProps", "closeButtonAriaLabel", "closeButtonPosition", "onClose", "ownFocus", "side", "size", "paddingSize", "maxWidth", "style", "maskProps", "type", "outsideClickCloses", "role", "pushMinBreakpoint", "focusTrapProps"];
@@ -61,24 +63,11 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
61
63
 
62
64
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
63
65
 
64
- var typeToClassNameMap = {
65
- push: 'euiFlyout--push',
66
- overlay: null
67
- };
68
- var TYPES = (0, _common.keysOf)(typeToClassNameMap);
66
+ var TYPES = ['push', 'overlay'];
69
67
  exports.TYPES = TYPES;
70
- var sideToClassNameMap = {
71
- left: 'euiFlyout--left',
72
- right: null
73
- };
74
- var SIDES = (0, _common.keysOf)(sideToClassNameMap);
68
+ var SIDES = ['left', 'right'];
75
69
  exports.SIDES = SIDES;
76
- var sizeToClassNameMap = {
77
- s: 'euiFlyout--small',
78
- m: 'euiFlyout--medium',
79
- l: 'euiFlyout--large'
80
- };
81
- var SIZES = (0, _common.keysOf)(sizeToClassNameMap);
70
+ var SIZES = ['s', 'm', 'l'];
82
71
  exports.SIZES = SIZES;
83
72
 
84
73
  /**
@@ -89,13 +78,7 @@ function isEuiFlyoutSizeNamed(value) {
89
78
  return SIZES.includes(value);
90
79
  }
91
80
 
92
- var paddingSizeToClassNameMap = {
93
- none: 'euiFlyout--paddingNone',
94
- s: 'euiFlyout--paddingSmall',
95
- m: 'euiFlyout--paddingMedium',
96
- l: 'euiFlyout--paddingLarge'
97
- };
98
- var PADDING_SIZES = (0, _common.keysOf)(paddingSizeToClassNameMap);
81
+ var PADDING_SIZES = ['none', 's', 'm', 'l'];
99
82
  exports.PADDING_SIZES = PADDING_SIZES;
100
83
  var defaultElement = 'div';
101
84
  var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
@@ -187,41 +170,37 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
187
170
  onClose(event);
188
171
  }
189
172
  };
173
+ /**
174
+ * Set inline styles
175
+ */
190
176
 
191
- var newStyle;
192
- var widthClassName;
193
- var sizeClassName; // Setting max-width
194
177
 
195
- if (maxWidth === true) {
196
- widthClassName = 'euiFlyout--maxWidth-default';
197
- } else if (maxWidth !== false) {
198
- var value = typeof maxWidth === 'number' ? "".concat(maxWidth, "px") : maxWidth;
199
- newStyle = _objectSpread(_objectSpread({}, style), {}, {
200
- maxWidth: value
201
- });
202
- } // Setting size
178
+ var newStyle = style;
203
179
 
180
+ if (typeof maxWidth !== 'boolean') {
181
+ newStyle = _objectSpread(_objectSpread({}, newStyle), (0, _global_styling.logicalStyle)('max-width', maxWidth));
182
+ }
204
183
 
205
- if (isEuiFlyoutSizeNamed(size)) {
206
- sizeClassName = sizeToClassNameMap[size];
207
- } else if (newStyle) {
208
- newStyle.width = size;
209
- } else {
210
- newStyle = _objectSpread(_objectSpread({}, style), {}, {
211
- width: size
212
- });
184
+ if (!isEuiFlyoutSizeNamed(size)) {
185
+ newStyle = _objectSpread(_objectSpread({}, newStyle), (0, _global_styling.logicalStyle)('width', size));
213
186
  }
214
187
 
215
- var classes = (0, _classnames.default)('euiFlyout', typeToClassNameMap[type], sideToClassNameMap[side], sizeClassName, paddingSizeToClassNameMap[paddingSize], widthClassName, className);
188
+ var euiTheme = (0, _services.useEuiTheme)();
189
+ var styles = (0, _flyout.euiFlyoutStyles)(euiTheme);
190
+ var cssStyles = [styles.euiFlyout, styles.paddingSizes[paddingSize], isEuiFlyoutSizeNamed(size) && styles[size], maxWidth === false && styles.noMaxWidth, styles[type], type === 'push' && styles.pushSide[side], styles[side]];
191
+ var classes = (0, _classnames.default)('euiFlyout', className);
216
192
  var closeButton;
217
193
 
218
194
  if (onClose && !hideCloseButton) {
219
- var closeButtonClasses = (0, _classnames.default)('euiFlyout__closeButton', "euiFlyout__closeButton--".concat(closeButtonPosition), closeButtonProps === null || closeButtonProps === void 0 ? void 0 : closeButtonProps.className);
195
+ var closeButtonClasses = (0, _classnames.default)('euiFlyout__closeButton', closeButtonProps === null || closeButtonProps === void 0 ? void 0 : closeButtonProps.className);
196
+ var closeButtonStyles = (0, _flyout.euiFlyoutCloseButtonStyles)(euiTheme);
197
+ var closeButtonCssStyles = [closeButtonStyles.euiFlyout__closeButton, closeButtonStyles[closeButtonPosition], closeButtonPosition === 'outside' && closeButtonStyles.outsideSide[side]];
220
198
  closeButton = (0, _react2.jsx)(_i18n.EuiI18n, {
221
199
  token: "euiFlyout.closeAriaLabel",
222
200
  default: "Close this dialog"
223
201
  }, function (closeAriaLabel) {
224
202
  return (0, _react2.jsx)(_button.EuiButtonIcon, _extends({
203
+ css: closeButtonCssStyles,
225
204
  display: closeButtonPosition === 'outside' ? 'fill' : 'empty',
226
205
  iconType: "cross",
227
206
  color: "text",
@@ -278,8 +257,9 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
278
257
  role: role,
279
258
  className: classes,
280
259
  tabIndex: -1,
281
- style: newStyle || style,
282
- ref: setRef
260
+ style: newStyle,
261
+ ref: setRef,
262
+ css: cssStyles
283
263
  }), closeButton, children)); // If ownFocus is set, wrap with an overlay and allow the user to click it to close it.
284
264
 
285
265
  var mergedMaskProps = _objectSpread(_objectSpread({}, maskProps), {}, {
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.euiFlyoutStyles = exports.euiFlyoutCloseButtonStyles = void 0;
7
+
8
+ var _react = require("@emotion/react");
9
+
10
+ var _global_styling = require("../../global_styling");
11
+
12
+ var _mixins = require("../../themes/amsterdam/global_styling/mixins");
13
+
14
+ var _color = require("../../services/color");
15
+
16
+ var _form = require("../form/form.styles");
17
+
18
+ var _templateObject, _templateObject2;
19
+
20
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
21
+
22
+ var euiFlyoutSlideInRight = (0, _react.keyframes)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n opacity: 0;\n transform: translateX(100%);\n }\n 75% {\n opacity: 1;\n transform: translateX(0%);\n }\n"])));
23
+ var euiFlyoutSlideInLeft = (0, _react.keyframes)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n 0% {\n opacity: 0;\n transform: translateX(-100%);\n }\n 75% {\n opacity: 1;\n transform: translateX(0%);\n}\n"])));
24
+
25
+ var euiFlyoutCloseButtonStyles = function euiFlyoutCloseButtonStyles(euiThemeContext) {
26
+ var euiTheme = euiThemeContext.euiTheme;
27
+ return {
28
+ euiFlyout__closeButton: /*#__PURE__*/(0, _react.css)("position:absolute;", (0, _global_styling.logicalCSS)('right', euiTheme.size.s), " ", (0, _global_styling.logicalCSS)('top', euiTheme.size.s), " z-index:3;;label:euiFlyout__closeButton;"),
29
+ inside: /*#__PURE__*/(0, _react.css)("background-color:", (0, _color.transparentize)(euiTheme.colors.emptyShade, 0.9), ";;label:inside;"),
30
+ outside: /*#__PURE__*/(0, _react.css)((0, _mixins.euiShadowXLarge)(euiThemeContext), ";animation:none!important;;label:outside;"),
31
+ outsideSide: {
32
+ // `transforms` pull in close buttons a little
33
+ // `!important` is necessary here to override the hover/focus transitions of buttons
34
+ right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('left', 0), " ", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['m', 'xl']), "{transform:translateX(calc(-100% - ", euiTheme.size.l, "))!important;}", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['xs', 's']), "{transform:translateX(calc(-100% - ", euiTheme.size.xs, "))!important;};label:right;"),
35
+ left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('right', 0), " ", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['m', 'xl']), "{transform:translateX(calc(100% + ", euiTheme.size.l, "))!important;}", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['xs', 's']), "{transform:translateX(calc(100% + ", euiTheme.size.xs, "))!important;};label:left;")
36
+ }
37
+ };
38
+ };
39
+
40
+ exports.euiFlyoutCloseButtonStyles = euiFlyoutCloseButtonStyles;
41
+
42
+ var euiFlyoutStyles = function euiFlyoutStyles(euiThemeContext) {
43
+ var euiTheme = euiThemeContext.euiTheme;
44
+ return {
45
+ euiFlyout: /*#__PURE__*/(0, _react.css)("position:fixed;", (0, _global_styling.logicalCSS)('top', 0), " ", (0, _global_styling.logicalCSS)('bottom', 0), " ", (0, _global_styling.logicalCSS)('height', '100%'), " z-index:", euiTheme.levels.flyout, ";background:", euiTheme.colors.emptyShade, ";display:flex;flex-direction:column;align-items:stretch;&:focus{outline:none;}", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['xs', 's']), "{", (0, _global_styling.logicalCSS)('max-width', '90vw !important'), ";};label:euiFlyout;"),
46
+ // Flyout sizes
47
+ s: /*#__PURE__*/(0, _react.css)(composeFlyoutSizing(euiThemeContext, 's'), ";;label:s;"),
48
+ m: /*#__PURE__*/(0, _react.css)(composeFlyoutSizing(euiThemeContext, 'm'), ";;label:m;"),
49
+ l: /*#__PURE__*/(0, _react.css)(composeFlyoutSizing(euiThemeContext, 'l'), ";;label:l;"),
50
+ noMaxWidth: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-width', 'none'), ";;label:noMaxWidth;"),
51
+ // Side
52
+ right: /*#__PURE__*/(0, _react.css)("clip-path:polygon(-50% 0, 100% 0, 100% 100%, -50% 100%);", (0, _global_styling.logicalCSS)('right', 0), " ", _global_styling.euiCanAnimate, "{animation:", euiFlyoutSlideInRight, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";};label:right;"),
53
+ // Left-side flyouts should only be used for navigation
54
+ left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('left', 0), " clip-path:polygon(0 0, 150% 0, 150% 100%, 0 100%);", _global_styling.euiCanAnimate, "{animation:", euiFlyoutSlideInLeft, ";};label:left;"),
55
+ // Type
56
+ overlay: /*#__PURE__*/(0, _react.css)((0, _mixins.euiShadowXLarge)(euiThemeContext), ";;label:overlay;"),
57
+ push: /*#__PURE__*/(0, _react.css)("clip-path:none;animation-duration:0s!important;z-index:", Number(euiTheme.levels.flyout) - 1, ";;label:push;"),
58
+ pushSide: {
59
+ right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-left', euiTheme.border.thick), ";;label:right;"),
60
+ left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-right', euiTheme.border.thick), ";;label:left;")
61
+ },
62
+ // Padding
63
+ paddingSizes: {
64
+ none: /*#__PURE__*/(0, _react.css)(composeFlyoutPadding(euiThemeContext, 'none'), ";;label:none;"),
65
+ s: /*#__PURE__*/(0, _react.css)(composeFlyoutPadding(euiThemeContext, 's'), ";;label:s;"),
66
+ m: /*#__PURE__*/(0, _react.css)(composeFlyoutPadding(euiThemeContext, 'm'), ";;label:m;"),
67
+ l: /*#__PURE__*/(0, _react.css)(composeFlyoutPadding(euiThemeContext, 'l'), ";;label:l;")
68
+ }
69
+ };
70
+ };
71
+
72
+ exports.euiFlyoutStyles = euiFlyoutStyles;
73
+
74
+ var composeFlyoutSizing = function composeFlyoutSizing(euiThemeContext, size) {
75
+ var euiTheme = euiThemeContext.euiTheme; // 1. Calculating the minimum width based on the screen takeover breakpoint
76
+
77
+ var flyoutSizes = {
78
+ s: {
79
+ min: "".concat(Math.round(euiTheme.breakpoint.m * 0.5), "px"),
80
+ // 1.
81
+ width: '25vw',
82
+ max: "".concat(Math.round(euiTheme.breakpoint.s * 0.7), "px")
83
+ },
84
+ m: {
85
+ // Calculated for forms plus padding
86
+ min: "".concat((0, _global_styling.mathWithUnits)((0, _form.euiFormMaxWidth)(euiThemeContext), function (x) {
87
+ return x + 24;
88
+ })),
89
+ width: '50vw',
90
+ max: "".concat(euiTheme.breakpoint.m, "px")
91
+ },
92
+ l: {
93
+ min: "".concat(Math.round(euiTheme.breakpoint.m * 0.9), "px"),
94
+ // 1.
95
+ width: '75vw',
96
+ max: "".concat(euiTheme.breakpoint.l, "px")
97
+ }
98
+ };
99
+ return "\n ".concat((0, _global_styling.logicalCSS)('max-width', flyoutSizes[size].max), "\n\n ").concat((0, _global_styling.euiBreakpoint)(euiThemeContext, ['m', 'xl']), " {\n ").concat((0, _global_styling.logicalCSS)('min-width', flyoutSizes[size].min), "\n ").concat((0, _global_styling.logicalCSS)('width', flyoutSizes[size].width), "\n }\n ").concat((0, _global_styling.euiBreakpoint)(euiThemeContext, ['xs', 's']), " {\n ").concat((0, _global_styling.logicalCSS)('min-width', 0), "\n ").concat((0, _global_styling.logicalCSS)('width', flyoutSizes[size].min), "\n }\n ");
100
+ };
101
+
102
+ var composeFlyoutPadding = function composeFlyoutPadding(euiThemeContext, paddingSize) {
103
+ var euiTheme = euiThemeContext.euiTheme;
104
+ var paddingModifierMap = {
105
+ none: 0,
106
+ s: euiTheme.size.s,
107
+ m: euiTheme.size.base,
108
+ l: euiTheme.size.l
109
+ }; // Footer padding
110
+
111
+ var footerPaddingSizes = {
112
+ none: 0,
113
+ s: euiTheme.size.s,
114
+ m: "".concat((0, _global_styling.mathWithUnits)(euiTheme.size.base, function (x) {
115
+ return x * 0.75;
116
+ }), " ").concat(euiTheme.size.base, ";"),
117
+ l: "".concat((0, _global_styling.mathWithUnits)(euiTheme.size.l, function (x) {
118
+ return x / 1.5;
119
+ }), " ").concat(euiTheme.size.l, ";")
120
+ };
121
+ return "\n .euiFlyoutHeader {\n ".concat((0, _global_styling.logicalCSS)('padding-horizontal', paddingModifierMap[paddingSize]), "\n ").concat((0, _global_styling.logicalCSS)('padding-top', paddingModifierMap[paddingSize]), "\n }\n\n [class*='euiFlyoutHeader-hasBorder'] {\n ").concat((0, _global_styling.logicalCSS)('padding-bottom', paddingModifierMap[paddingSize]), "\n }\n\n .euiFlyoutBody__overflowContent {\n padding: ").concat(paddingModifierMap[paddingSize], ";\n }\n\n .euiFlyoutBody__banner .euiCallOut {\n ").concat((0, _global_styling.logicalCSS)('padding-horizontal', paddingModifierMap[paddingSize]), "\n }\n\n .euiFlyoutFooter {\n padding: ").concat(footerPaddingSizes[paddingSize], ";\n }\n ");
122
+ };
@@ -11,6 +11,10 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
+ var _services = require("../../services");
15
+
16
+ var _flyout_body = require("./flyout_body.styles");
17
+
14
18
  var _react2 = require("@emotion/react");
15
19
 
16
20
  var _excluded = ["children", "className", "banner"];
@@ -30,16 +34,22 @@ var EuiFlyoutBody = function EuiFlyoutBody(_ref) {
30
34
  rest = _objectWithoutProperties(_ref, _excluded);
31
35
 
32
36
  var classes = (0, _classnames.default)('euiFlyoutBody', className);
33
- var overflowClasses = (0, _classnames.default)('euiFlyoutBody__overflow', {
34
- 'euiFlyoutBody__overflow--hasBanner': banner
35
- });
37
+ var euiTheme = (0, _services.useEuiTheme)();
38
+ var styles = (0, _flyout_body.euiFlyoutBodyStyles)(euiTheme);
39
+ var cssStyles = [styles.euiFlyoutBody];
40
+ var bannerCssStyles = [banner && styles.euiFlyoutBody__banner];
41
+ var overflowCssStyles = [banner ? styles.euiFlyoutBody__overflow.hasBanner : styles.euiFlyoutBody__overflow.noBanner];
36
42
  return (0, _react2.jsx)("div", _extends({
37
43
  className: classes
38
- }, rest), (0, _react2.jsx)("div", {
44
+ }, rest, {
45
+ css: cssStyles
46
+ }), (0, _react2.jsx)("div", {
39
47
  tabIndex: 0,
40
- className: overflowClasses
48
+ className: "euiFlyoutBody__overflow",
49
+ css: overflowCssStyles
41
50
  }, banner && (0, _react2.jsx)("div", {
42
- className: "euiFlyoutBody__banner"
51
+ className: "euiFlyoutBody__banner",
52
+ css: bannerCssStyles
43
53
  }, banner), (0, _react2.jsx)("div", {
44
54
  className: "euiFlyoutBody__overflowContent"
45
55
  }, children)));
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.euiFlyoutBodyStyles = void 0;
7
+
8
+ var _react = require("@emotion/react");
9
+
10
+ var _global_styling = require("../../global_styling");
11
+
12
+ /*
13
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
14
+ * or more contributor license agreements. Licensed under the Elastic License
15
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
16
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
17
+ * Side Public License, v 1.
18
+ */
19
+ var euiFlyoutBodyStyles = function euiFlyoutBodyStyles(euiThemeContext) {
20
+ return {
21
+ euiFlyoutBody: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSSWithFallback)('overflow-y', 'hidden'), " ", (0, _global_styling.logicalCSS)('height', '100%'), ";;label:euiFlyoutBody;"),
22
+ euiFlyoutBody__overflow: {
23
+ noBanner: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiYScrollWithShadows)(euiThemeContext), ";;label:noBanner;"),
24
+ hasBanner: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiYScrollWithShadows)(euiThemeContext, {
25
+ side: 'end'
26
+ }), ";;label:hasBanner;")
27
+ },
28
+ euiFlyoutBody__banner: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSSWithFallback)('overflow-x', 'hidden'), ";;label:euiFlyoutBody__banner;")
29
+ };
30
+ };
31
+
32
+ exports.euiFlyoutBodyStyles = euiFlyoutBodyStyles;
@@ -11,6 +11,10 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
+ var _services = require("../../services");
15
+
16
+ var _flyout_footer = require("./flyout_footer.styles");
17
+
14
18
  var _react2 = require("@emotion/react");
15
19
 
16
20
  var _excluded = ["children", "className"];
@@ -29,9 +33,14 @@ var EuiFlyoutFooter = function EuiFlyoutFooter(_ref) {
29
33
  rest = _objectWithoutProperties(_ref, _excluded);
30
34
 
31
35
  var classes = (0, _classnames.default)('euiFlyoutFooter', className);
36
+ var euiTheme = (0, _services.useEuiTheme)();
37
+ var styles = (0, _flyout_footer.euiFlyoutFooterStyles)(euiTheme);
38
+ var cssStyles = [styles.euiFlyoutFooter];
32
39
  return (0, _react2.jsx)("div", _extends({
33
40
  className: classes
34
- }, rest), children);
41
+ }, rest, {
42
+ css: cssStyles
43
+ }), children);
35
44
  };
36
45
 
37
46
  exports.EuiFlyoutFooter = EuiFlyoutFooter;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.euiFlyoutFooterStyles = void 0;
7
+
8
+ var _react = require("@emotion/react");
9
+
10
+ /*
11
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
12
+ * or more contributor license agreements. Licensed under the Elastic License
13
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
14
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
15
+ * Side Public License, v 1.
16
+ */
17
+ var euiFlyoutFooterStyles = function euiFlyoutFooterStyles(euiThemeContext) {
18
+ var euiTheme = euiThemeContext.euiTheme;
19
+ return {
20
+ euiFlyoutFooter: /*#__PURE__*/(0, _react.css)("background-color:", euiTheme.colors.lightestShade, ";flex-grow:0;;label:euiFlyoutFooter;")
21
+ };
22
+ };
23
+
24
+ exports.euiFlyoutFooterStyles = euiFlyoutFooterStyles;
@@ -11,6 +11,10 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
+ var _services = require("../../services");
15
+
16
+ var _flyout_header = require("./flyout_header.styles");
17
+
14
18
  var _react2 = require("@emotion/react");
15
19
 
16
20
  var _excluded = ["children", "className", "hasBorder"];
@@ -30,12 +34,15 @@ var EuiFlyoutHeader = function EuiFlyoutHeader(_ref) {
30
34
  hasBorder = _ref$hasBorder === void 0 ? false : _ref$hasBorder,
31
35
  rest = _objectWithoutProperties(_ref, _excluded);
32
36
 
33
- var classes = (0, _classnames.default)('euiFlyoutHeader', {
34
- 'euiFlyoutHeader--hasBorder': hasBorder
35
- }, className);
37
+ var classes = (0, _classnames.default)('euiFlyoutHeader', className);
38
+ var euiTheme = (0, _services.useEuiTheme)();
39
+ var styles = (0, _flyout_header.euiFlyoutHeaderStyles)(euiTheme);
40
+ var cssStyles = [styles.euiFlyoutHeader, hasBorder && styles.hasBorder];
36
41
  return (0, _react2.jsx)("div", _extends({
37
42
  className: classes
38
- }, rest), children);
43
+ }, rest, {
44
+ css: cssStyles
45
+ }), children);
39
46
  };
40
47
 
41
48
  exports.EuiFlyoutHeader = EuiFlyoutHeader;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.euiFlyoutHeaderStyles = void 0;
7
+
8
+ var _react = require("@emotion/react");
9
+
10
+ var _global_styling = require("../../global_styling");
11
+
12
+ 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)."; }
13
+
14
+ var _ref = process.env.NODE_ENV === "production" ? {
15
+ name: "1hivny1-euiFlyoutHeader",
16
+ styles: "flex-grow:0;label:euiFlyoutHeader;"
17
+ } : {
18
+ name: "1hivny1-euiFlyoutHeader",
19
+ styles: "flex-grow:0;label:euiFlyoutHeader;",
20
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
21
+ };
22
+
23
+ var euiFlyoutHeaderStyles = function euiFlyoutHeaderStyles(euiThemeContext) {
24
+ var euiTheme = euiThemeContext.euiTheme;
25
+ return {
26
+ euiFlyoutHeader: _ref,
27
+ hasBorder: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-bottom', euiTheme.border.thin), ";;label:hasBorder;")
28
+ };
29
+ };
30
+
31
+ exports.euiFlyoutHeaderStyles = euiFlyoutHeaderStyles;
@@ -67,10 +67,10 @@ var EuiImageWrapper = function EuiImageWrapper(_ref) {
67
67
  optionalCaptionText = _useInnerText2[1];
68
68
 
69
69
  return (0, _react2.jsx)("figure", _extends({
70
- "aria-label": optionalCaptionText
71
- }, wrapperProps, {
72
- className: classes,
70
+ "aria-label": optionalCaptionText,
73
71
  css: cssFigureStyles
72
+ }, wrapperProps, {
73
+ className: classes
74
74
  }), allowFullScreen ? (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_image_button.EuiImageButton, {
75
75
  hasAlt: !!alt,
76
76
  hasShadow: hasShadow,
@@ -29,11 +29,16 @@ var euiScaleMarkdownFormatText = function euiScaleMarkdownFormatText(euiTheme, o
29
29
  var measurement = options.measurement;
30
30
  var lineHeightSize = measurement === 'em' ? "".concat(lineHeight, "em") : lineHeight; // Custom scales
31
31
 
32
- var fontSizeNumeric = parseFloat(String(fontSize));
33
- var blockQuoteBorderWidth = fontSizeNumeric / 4;
34
- var tablePaddingVertical = fontSizeNumeric / 4;
35
- var tablePaddingHorizontal = fontSizeNumeric / 2;
36
- return "\n .euiMarkdownFormat__blockquote {\n padding: 0 ".concat(fontSize, ";\n ").concat((0, _global_styling.logicalCSS)('border-left-width', "".concat(blockQuoteBorderWidth).concat(measurement)), "\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', fontSize), "\n }\n\n .euiCheckbox .euiCheckbox__input ~ .euiCheckbox__label { // Extra specificity necessary to override default checkbox CSS\n font-size: ").concat(fontSize, ";\n ").concat((0, _global_styling.logicalCSS)('padding-left', lineHeightSize), "\n line-height: ").concat(lineHeight, ";\n }\n\n .euiCheckbox + *:not(.euiCheckbox) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', fontSize), "\n }\n\n .euiMarkdownFormat__codeblockWrapper {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table th,\n .euiMarkdownFormat__table td {\n ").concat((0, _global_styling.logicalCSS)('padding-vertical', "".concat(tablePaddingVertical).concat(measurement)), "\n ").concat((0, _global_styling.logicalCSS)('padding-horizontal', "".concat(tablePaddingHorizontal).concat(measurement)), "\n }\n ");
32
+ var blockQuoteBorderWidth = (0, _global_styling.mathWithUnits)(fontSize, function (x) {
33
+ return x / 4;
34
+ });
35
+ var tablePaddingVertical = (0, _global_styling.mathWithUnits)(fontSize, function (x) {
36
+ return x / 4;
37
+ });
38
+ var tablePaddingHorizontal = (0, _global_styling.mathWithUnits)(fontSize, function (x) {
39
+ return x / 2;
40
+ });
41
+ return "\n .euiMarkdownFormat__blockquote {\n padding: 0 ".concat(fontSize, ";\n ").concat((0, _global_styling.logicalCSS)('border-left-width', blockQuoteBorderWidth), "\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', fontSize), "\n }\n\n .euiCheckbox .euiCheckbox__input ~ .euiCheckbox__label { // Extra specificity necessary to override default checkbox CSS\n font-size: ").concat(fontSize, ";\n ").concat((0, _global_styling.logicalCSS)('padding-left', lineHeightSize), "\n line-height: ").concat(lineHeight, ";\n }\n\n .euiCheckbox + *:not(.euiCheckbox) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', fontSize), "\n }\n\n .euiMarkdownFormat__codeblockWrapper {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table th,\n .euiMarkdownFormat__table td {\n ").concat((0, _global_styling.logicalCSS)('padding-vertical', tablePaddingVertical), "\n ").concat((0, _global_styling.logicalCSS)('padding-horizontal', tablePaddingHorizontal), "\n }\n ");
37
42
  };
38
43
  /**
39
44
  * Styles
@@ -144,7 +144,7 @@ EuiNotificationEvent.propTypes = {
144
144
  /**
145
145
  * Accepts either our palette colors (primary, success ..etc) or a hex value `#FFFFFF`, `#000`.
146
146
  */
147
- badgeColor: _propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.any.isRequired]),
147
+ badgeColor: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.string.isRequired]),
148
148
 
149
149
  /**
150
150
  * The icon used to visually represent this data type. Accepts any `EuiIcon IconType`.
@@ -165,7 +165,7 @@ EuiNotificationEventMeta.propTypes = {
165
165
  /**
166
166
  * Accepts either our palette colors (primary, success ..etc) or a hex value `#FFFFFF`, `#000`.
167
167
  */
168
- badgeColor: _propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.any.isRequired]),
168
+ badgeColor: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.string.isRequired]),
169
169
 
170
170
  /**
171
171
  * The icon used to visually represent this data type. Accepts any `EuiIcon IconType`.
@@ -80,7 +80,7 @@ var EuiPageHeaderContent = function EuiPageHeaderContent(_ref) {
80
80
 
81
81
  var isResponsiveBreakpoint = (0, _services.useIsWithinBreakpoints)(['xs', 's'], !!responsive);
82
82
  var useTheme = (0, _services.useEuiTheme)();
83
- var classes = (0, _classnames.default)('euiPageHeaderContent');
83
+ var classes = (0, _classnames.default)('euiPageHeaderContent', className);
84
84
  var pageHeaderStyles = (0, _page_header.euiPageHeaderStyles)(useTheme);
85
85
  var contentStyles = (0, _page_header_content.euiPageHeaderContentStyles)(useTheme);
86
86
  var styles = (0, _restrict_width.setStyleForRestrictedPageWidth)(restrictWidth, style);
@@ -56,12 +56,11 @@ var EuiPageSection = function EuiPageSection(_ref) {
56
56
  var colors = (0, _global_styling.useEuiBackgroundColorCSS)();
57
57
  var cssStyles = [styles.euiPageSection, grow && styles.grow, inlinePadding[paddingSize], bottomBorder === 'extended' && styles.border, alignment && styles[alignment], colors[color]];
58
58
  var contentStyles = (0, _page_section.euiPageSectionContentStyles)();
59
- var cssContentStyles = [contentStyles.euiPageSection__content, blockPadding[paddingSize], bottomBorder === true && styles.border, alignment.toLowerCase().includes('center') && contentStyles.center, restrictWidth && contentStyles.restrictWidth];
59
+ var cssContentStyles = [contentStyles.euiPageSection__content, blockPadding[paddingSize], bottomBorder === true && styles.border, alignment.toLowerCase().includes('center') && contentStyles.center, restrictWidth && contentStyles.restrictWidth, (contentProps === null || contentProps === void 0 ? void 0 : contentProps.css) && contentProps.css];
60
60
  return (0, _react2.jsx)(Component, _extends({
61
61
  css: cssStyles
62
- }, rest), (0, _react2.jsx)("div", _extends({
63
- css: cssContentStyles
64
- }, contentProps, {
62
+ }, rest), (0, _react2.jsx)("div", _extends({}, contentProps, {
63
+ css: cssContentStyles,
65
64
  style: widthStyles
66
65
  }), children));
67
66
  };