@elastic/eui 64.0.0 → 64.0.3

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 (185) hide show
  1. package/dist/eui_charts_theme.js +330 -330
  2. package/dist/eui_charts_theme.js.map +1 -1
  3. package/dist/eui_theme_dark.css +7 -313
  4. package/dist/eui_theme_dark.min.css +1 -1
  5. package/dist/eui_theme_light.css +7 -313
  6. package/dist/eui_theme_light.min.css +1 -1
  7. package/es/components/basic_table/collapsed_item_actions.js +1 -2
  8. package/es/components/breadcrumbs/breadcrumb.styles.js +2 -2
  9. package/es/components/button/button_display/_button_display.js +6 -1
  10. package/es/components/button/button_empty/button_empty.js +10 -1
  11. package/es/components/card/card.js +10 -1
  12. package/es/components/card/card_select.js +10 -1
  13. package/es/components/date_picker/auto_refresh/auto_refresh.js +6 -1
  14. package/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js +6 -2
  15. package/es/components/description_list/description_list_title.js +1 -1
  16. package/es/components/expression/expression.js +12 -2
  17. package/es/components/header/header_links/header_link.js +10 -1
  18. package/es/components/header/header_section/header_section_item.js +4 -3
  19. package/es/components/image/image.js +6 -1
  20. package/es/components/image/image_button.styles.js +1 -1
  21. package/es/components/link/link.styles.js +6 -5
  22. package/es/components/notification/notification_event.js +10 -1
  23. package/es/components/page/page_content/page_content.js +1 -2
  24. package/es/components/page/page_content/page_content_body.js +1 -2
  25. package/es/components/page/page_content/page_content_header.js +1 -2
  26. package/es/components/page/page_content/page_content_header_section.js +1 -2
  27. package/es/components/page/page_section/page_section.js +15 -3
  28. package/es/components/page/page_side_bar/page_side_bar.js +1 -2
  29. package/es/components/page/page_sidebar/page_sidebar.js +5 -1
  30. package/es/components/page/page_template.js +3 -1
  31. package/es/components/page_template/empty_prompt/page_empty_prompt.js +11 -1
  32. package/es/components/page_template/page_template.js +18 -2
  33. package/es/components/pagination/pagination_button.js +10 -1
  34. package/es/components/progress/progress.js +6 -1
  35. package/es/components/provider/cache/cache_provider.js +3 -9
  36. package/es/components/provider/provider.js +25 -2
  37. package/es/components/resizable_container/resizable_panel.js +6 -1
  38. package/es/components/side_nav/side_nav.js +5 -0
  39. package/es/components/text/text.styles.js +1 -1
  40. package/es/components/toast/global_toast_list.styles.js +2 -2
  41. package/es/global_styling/functions/logicals.js +16 -2
  42. package/es/global_styling/mixins/_helpers.js +11 -4
  43. package/es/global_styling/mixins/_states.js +3 -4
  44. package/es/global_styling/mixins/_typography.js +3 -1
  45. package/es/global_styling/reset/global_styles.js +1 -1
  46. package/es/global_styling/utility/utility.js +10 -2
  47. package/es/services/theme/hooks.js +11 -16
  48. package/eui.d.ts +98 -79
  49. package/i18ntokens.json +8 -8
  50. package/lib/components/basic_table/collapsed_item_actions.js +1 -2
  51. package/lib/components/breadcrumbs/breadcrumb.styles.js +2 -2
  52. package/lib/components/button/button_display/_button_display.js +6 -1
  53. package/lib/components/button/button_empty/button_empty.js +10 -1
  54. package/lib/components/card/card.js +10 -1
  55. package/lib/components/card/card_select.js +10 -1
  56. package/lib/components/date_picker/auto_refresh/auto_refresh.js +6 -1
  57. package/lib/components/date_picker/super_date_picker/date_popover/date_popover_button.js +6 -1
  58. package/lib/components/description_list/description_list_title.js +1 -1
  59. package/lib/components/expression/expression.js +12 -2
  60. package/lib/components/header/header_links/header_link.js +10 -1
  61. package/lib/components/header/header_section/header_section_item.js +4 -3
  62. package/lib/components/image/image.js +6 -1
  63. package/lib/components/image/image_button.styles.js +1 -1
  64. package/lib/components/link/link.styles.js +6 -5
  65. package/lib/components/notification/notification_event.js +10 -1
  66. package/lib/components/page/page_content/page_content.js +1 -2
  67. package/lib/components/page/page_content/page_content_body.js +1 -2
  68. package/lib/components/page/page_content/page_content_header.js +1 -2
  69. package/lib/components/page/page_content/page_content_header_section.js +1 -2
  70. package/lib/components/page/page_section/page_section.js +15 -3
  71. package/lib/components/page/page_side_bar/page_side_bar.js +1 -2
  72. package/lib/components/page/page_sidebar/page_sidebar.js +5 -1
  73. package/lib/components/page/page_template.js +3 -1
  74. package/lib/components/page_template/empty_prompt/page_empty_prompt.js +11 -1
  75. package/lib/components/page_template/page_template.js +18 -2
  76. package/lib/components/progress/progress.js +6 -1
  77. package/lib/components/provider/cache/cache_provider.js +3 -11
  78. package/lib/components/provider/provider.js +31 -6
  79. package/lib/components/resizable_container/resizable_panel.js +6 -1
  80. package/lib/components/side_nav/side_nav.js +5 -0
  81. package/lib/components/text/text.styles.js +1 -1
  82. package/lib/components/toast/global_toast_list.styles.js +1 -1
  83. package/lib/global_styling/functions/logicals.js +21 -4
  84. package/lib/global_styling/mixins/_helpers.js +17 -6
  85. package/lib/global_styling/mixins/_states.js +3 -4
  86. package/lib/global_styling/mixins/_typography.js +4 -1
  87. package/lib/global_styling/reset/global_styles.js +1 -1
  88. package/lib/global_styling/utility/utility.js +16 -3
  89. package/lib/services/theme/hooks.js +10 -15
  90. package/optimize/es/components/basic_table/collapsed_item_actions.js +1 -2
  91. package/optimize/es/components/breadcrumbs/breadcrumb.styles.js +2 -2
  92. package/optimize/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js +0 -1
  93. package/optimize/es/components/description_list/description_list_title.js +1 -1
  94. package/optimize/es/components/header/header_section/header_section_item.js +4 -3
  95. package/optimize/es/components/image/image_button.styles.js +1 -1
  96. package/optimize/es/components/link/link.styles.js +6 -5
  97. package/optimize/es/components/page/page_content/page_content.js +1 -2
  98. package/optimize/es/components/page/page_content/page_content_body.js +1 -2
  99. package/optimize/es/components/page/page_content/page_content_header.js +1 -2
  100. package/optimize/es/components/page/page_content/page_content_header_section.js +1 -2
  101. package/optimize/es/components/page/page_section/page_section.js +4 -2
  102. package/optimize/es/components/page/page_side_bar/page_side_bar.js +1 -2
  103. package/optimize/es/components/page/page_sidebar/page_sidebar.js +5 -1
  104. package/optimize/es/components/page/page_template.js +3 -1
  105. package/optimize/es/components/provider/cache/cache_provider.js +3 -9
  106. package/optimize/es/components/provider/provider.js +25 -2
  107. package/optimize/es/components/text/text.styles.js +1 -1
  108. package/optimize/es/components/toast/global_toast_list.styles.js +2 -2
  109. package/optimize/es/global_styling/functions/logicals.js +16 -2
  110. package/optimize/es/global_styling/mixins/_helpers.js +11 -4
  111. package/optimize/es/global_styling/mixins/_states.js +3 -4
  112. package/optimize/es/global_styling/mixins/_typography.js +3 -1
  113. package/optimize/es/global_styling/reset/global_styles.js +1 -1
  114. package/optimize/es/global_styling/utility/utility.js +10 -2
  115. package/optimize/es/services/theme/hooks.js +11 -16
  116. package/optimize/lib/components/basic_table/collapsed_item_actions.js +1 -2
  117. package/optimize/lib/components/breadcrumbs/breadcrumb.styles.js +2 -2
  118. package/optimize/lib/components/description_list/description_list_title.js +1 -1
  119. package/optimize/lib/components/header/header_section/header_section_item.js +4 -3
  120. package/optimize/lib/components/image/image_button.styles.js +1 -1
  121. package/optimize/lib/components/link/link.styles.js +6 -5
  122. package/optimize/lib/components/page/page_content/page_content.js +1 -2
  123. package/optimize/lib/components/page/page_content/page_content_body.js +1 -2
  124. package/optimize/lib/components/page/page_content/page_content_header.js +1 -2
  125. package/optimize/lib/components/page/page_content/page_content_header_section.js +1 -2
  126. package/optimize/lib/components/page/page_section/page_section.js +4 -2
  127. package/optimize/lib/components/page/page_side_bar/page_side_bar.js +1 -2
  128. package/optimize/lib/components/page/page_sidebar/page_sidebar.js +5 -1
  129. package/optimize/lib/components/page/page_template.js +3 -1
  130. package/optimize/lib/components/provider/cache/cache_provider.js +3 -11
  131. package/optimize/lib/components/provider/provider.js +31 -6
  132. package/optimize/lib/components/text/text.styles.js +1 -1
  133. package/optimize/lib/components/toast/global_toast_list.styles.js +1 -1
  134. package/optimize/lib/global_styling/functions/logicals.js +21 -4
  135. package/optimize/lib/global_styling/mixins/_helpers.js +17 -6
  136. package/optimize/lib/global_styling/mixins/_states.js +3 -4
  137. package/optimize/lib/global_styling/mixins/_typography.js +4 -1
  138. package/optimize/lib/global_styling/reset/global_styles.js +1 -1
  139. package/optimize/lib/global_styling/utility/utility.js +16 -3
  140. package/optimize/lib/services/theme/hooks.js +10 -15
  141. package/package.json +1 -1
  142. package/src/components/datagrid/_data_grid_data_row.scss +7 -0
  143. package/src/components/header/header_section/_header_section_item.scss +1 -1
  144. package/src/global_styling/mixins/_helpers.scss +9 -0
  145. package/src/global_styling/utility/_utility.scss +0 -127
  146. package/test-env/components/basic_table/collapsed_item_actions.js +1 -2
  147. package/test-env/components/breadcrumbs/breadcrumb.styles.js +2 -2
  148. package/test-env/components/button/button_display/_button_display.js +6 -1
  149. package/test-env/components/button/button_empty/button_empty.js +10 -1
  150. package/test-env/components/card/card.js +10 -1
  151. package/test-env/components/card/card_select.js +10 -1
  152. package/test-env/components/date_picker/auto_refresh/auto_refresh.js +6 -1
  153. package/test-env/components/date_picker/super_date_picker/date_popover/date_popover_button.js +6 -1
  154. package/test-env/components/description_list/description_list_title.js +1 -1
  155. package/test-env/components/expression/expression.js +12 -2
  156. package/test-env/components/header/header_links/header_link.js +10 -1
  157. package/test-env/components/header/header_section/header_section_item.js +4 -3
  158. package/test-env/components/image/image.js +6 -1
  159. package/test-env/components/image/image_button.styles.js +1 -1
  160. package/test-env/components/link/link.styles.js +6 -5
  161. package/test-env/components/notification/notification_event.js +10 -1
  162. package/test-env/components/page/page_content/page_content.js +1 -2
  163. package/test-env/components/page/page_content/page_content_body.js +1 -2
  164. package/test-env/components/page/page_content/page_content_header.js +1 -2
  165. package/test-env/components/page/page_content/page_content_header_section.js +1 -2
  166. package/test-env/components/page/page_section/page_section.js +15 -3
  167. package/test-env/components/page/page_side_bar/page_side_bar.js +1 -2
  168. package/test-env/components/page/page_sidebar/page_sidebar.js +5 -1
  169. package/test-env/components/page/page_template.js +3 -1
  170. package/test-env/components/page_template/empty_prompt/page_empty_prompt.js +11 -1
  171. package/test-env/components/page_template/page_template.js +18 -2
  172. package/test-env/components/progress/progress.js +6 -1
  173. package/test-env/components/provider/cache/cache_provider.js +3 -11
  174. package/test-env/components/provider/provider.js +31 -6
  175. package/test-env/components/resizable_container/resizable_panel.js +6 -1
  176. package/test-env/components/side_nav/side_nav.js +5 -0
  177. package/test-env/components/text/text.styles.js +1 -1
  178. package/test-env/components/toast/global_toast_list.styles.js +1 -1
  179. package/test-env/global_styling/functions/logicals.js +21 -4
  180. package/test-env/global_styling/mixins/_helpers.js +17 -6
  181. package/test-env/global_styling/mixins/_states.js +3 -4
  182. package/test-env/global_styling/mixins/_typography.js +4 -1
  183. package/test-env/global_styling/reset/global_styles.js +1 -1
  184. package/test-env/global_styling/utility/utility.js +16 -3
  185. package/test-env/services/theme/hooks.js +10 -15
@@ -62,8 +62,8 @@ var logicalSize = {
62
62
  'min-width': 'min-inline-size'
63
63
  };
64
64
  var logicalOverflow = {
65
- 'overflow-x': 'overflow-block',
66
- 'overflow-y': 'overflow-inline'
65
+ 'overflow-x': 'overflow-inline',
66
+ 'overflow-y': 'overflow-block'
67
67
  };
68
68
  var logicalBorders = {
69
69
  'border-horizontal': 'border-inline',
@@ -107,6 +107,20 @@ export var LOGICAL_PROPERTIES = keysOf(logicals);
107
107
  export var logicalCSS = function logicalCSS(property, value) {
108
108
  return "".concat(logicals[property], ": ").concat(value, ";");
109
109
  };
110
+ /**
111
+ * Some logical properties are not yet fully supported by all browsers.
112
+ * For those cases, we should use the old property as a fallback for
113
+ * browsers missing support, while allowing supporting browsers to use
114
+ * the logical properties.
115
+ *
116
+ * Examples:
117
+ * https://caniuse.com/?search=overflow-block
118
+ * https://caniuse.com/mdn-css_properties_float_flow_relative_values
119
+ */
120
+
121
+ export var logicalCSSWithFallback = function logicalCSSWithFallback(property, value) {
122
+ return "\n ".concat(property, ": ").concat(value, ";\n ").concat(logicalCSS(property, value), "\n");
123
+ };
110
124
  /**
111
125
  *
112
126
  * @param property A string that is a valid CSS logical property
@@ -7,6 +7,7 @@
7
7
  */
8
8
  import { useEuiTheme } from '../../services/theme';
9
9
  import { transparentize } from '../../services/color';
10
+ import { logicalCSS, logicalCSSWithFallback } from '../functions';
10
11
  /**
11
12
  * Set scroll bar appearance on Chrome (and firefox).
12
13
  * All parameters are optional and default to specific global settings.
@@ -34,7 +35,7 @@ export var euiScrollBarStyles = function euiScrollBarStyles(_ref) {
34
35
  // so it's being added to this mixin for allowing support wherever custom scrollbars are
35
36
 
36
37
  var firefoxSupport = "scrollbar-color: ".concat(thumbColor, " ").concat(trackColor, ";");
37
- return "scrollbar-width: ".concat(width, ";\n\n &::-webkit-scrollbar {\n width: ").concat(scrollBarSize, ";\n height: ").concat(scrollBarSize, ";\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: ").concat(thumbColor, ";\n background-clip: content-box;\n border-radius: ").concat(scrollBarSize, ";\n border: ").concat(scrollBarCorner, " solid ").concat(trackColor, ";\n }\n\n &::-webkit-scrollbar-corner,\n &::-webkit-scrollbar-track {\n background-color: ").concat(trackColor, ";\n }\n\n ").concat(firefoxSupport, "\n ");
38
+ return "scrollbar-width: ".concat(width, ";\n\n &::-webkit-scrollbar {\n ").concat(logicalCSS('width', scrollBarSize), "\n ").concat(logicalCSS('height', scrollBarSize), "\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: ").concat(thumbColor, ";\n background-clip: content-box;\n border-radius: ").concat(scrollBarSize, ";\n border: ").concat(scrollBarCorner, " solid ").concat(trackColor, ";\n }\n\n &::-webkit-scrollbar-corner,\n &::-webkit-scrollbar-track {\n background-color: ").concat(trackColor, ";\n }\n\n ").concat(firefoxSupport, "\n ");
38
39
  };
39
40
  export var useEuiScrollBar = function useEuiScrollBar(options) {
40
41
  var euiTheme = useEuiTheme();
@@ -82,12 +83,11 @@ var euiOverflowShadowStyles = function euiOverflowShadowStyles(_ref3) {
82
83
  */
83
84
 
84
85
 
85
- // TODO: How do we use Emotion to output the CSS class utilities instead?
86
86
  export var euiYScroll = function euiYScroll(euiTheme) {
87
87
  var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
88
88
  height = _ref5.height;
89
89
 
90
- return "\n ".concat(euiScrollBarStyles(euiTheme), "\n height: ").concat(height || '100%', ";\n overflow-y: auto;\n overflow-x: hidden;\n &:focus {\n outline: none; /* 1 */\n }\n");
90
+ return "\n ".concat(euiScrollBarStyles(euiTheme), "\n ").concat(logicalCSS('height', height || '100%'), "\n ").concat(logicalCSSWithFallback('overflow-y', 'auto'), "\n ").concat(logicalCSSWithFallback('overflow-x', 'hidden'), "\n &:focus {\n outline: none; /* 1 */\n }\n");
91
91
  };
92
92
  export var useEuiYScroll = function useEuiYScroll() {
93
93
  var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
@@ -118,7 +118,7 @@ export var useEuiYScrollWithShadows = function useEuiYScrollWithShadows() {
118
118
  });
119
119
  };
120
120
  export var euiXScroll = function euiXScroll(euiTheme) {
121
- return "\n ".concat(euiScrollBarStyles(euiTheme), "\n overflow-x: auto;\n &:focus {\n outline: none; /* 1 */\n }\n");
121
+ return "\n ".concat(euiScrollBarStyles(euiTheme), "\n ").concat(logicalCSSWithFallback('overflow-x', 'auto'), "\n &:focus {\n outline: none; /* 1 */\n }\n");
122
122
  };
123
123
  export var useEuiXScroll = function useEuiXScroll() {
124
124
  var euiTheme = useEuiTheme();
@@ -158,4 +158,11 @@ export var useEuiOverflowScroll = function useEuiOverflowScroll(direction) {
158
158
  direction: direction,
159
159
  mask: mask
160
160
  });
161
+ };
162
+ /**
163
+ * For quickly applying a full-height element whether using flex or not
164
+ */
165
+
166
+ export var euiFullHeight = function euiFullHeight() {
167
+ return "\n ".concat(logicalCSS('height', '100%'), "\n flex: 1 1 auto;\n overflow: hidden;\n");
161
168
  };
@@ -15,7 +15,8 @@ import { useEuiTheme } from '../../services';
15
15
  * @param offset Accepts a specific measurement or 'inset', 'outset' or 'center' to adjust outline position
16
16
  * @param color Accepts any CSS color, **Note: only works in -webkit-**
17
17
  */
18
- export var euiFocusRing = function euiFocusRing(euiTheme) {
18
+ export var euiFocusRing = function euiFocusRing(_ref) {
19
+ var euiTheme = _ref.euiTheme;
19
20
  var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'center';
20
21
  var options = arguments.length > 2 ? arguments[2] : undefined;
21
22
  // Width is enforced as a constant at the global theme layer
@@ -40,9 +41,7 @@ export var euiFocusRing = function euiFocusRing(euiTheme) {
40
41
  return "\n outline: ".concat(outlineWidth, " solid ").concat(outlineColor, ";\n outline-offset: ").concat(outlineOffset, ";\n\n // \uD83D\uDC40 Chrome respects :focus-visible and allows coloring the `auto` style\n &:focus-visible {\n outline-style: auto;\n }\n\n // \uD83D\uDE45\u200D\u2640\uFE0F But Chrome also needs to have the outline forcefully removed from regular `:focus` state\n &:not(:focus-visible) {\n outline: none;\n }\n ");
41
42
  };
42
43
  export var useEuiFocusRing = function useEuiFocusRing(offset, color) {
43
- var _useEuiTheme = useEuiTheme(),
44
- euiTheme = _useEuiTheme.euiTheme;
45
-
44
+ var euiTheme = useEuiTheme();
46
45
  return euiFocusRing(euiTheme, offset, {
47
46
  color: color
48
47
  });
@@ -7,6 +7,7 @@
7
7
  */
8
8
  import { euiLineHeightFromBaseline, euiFontSizeFromScale } from '../functions/typography';
9
9
  import { useEuiTheme } from '../../services/theme/hooks';
10
+ import { logicalCSS } from '../functions';
10
11
 
11
12
  /**
12
13
  * Returns font-size and line-height
@@ -36,7 +37,8 @@ export var euiTextBreakWord = function euiTextBreakWord() {
36
37
 
37
38
  export var euiTextTruncate = function euiTextTruncate() {
38
39
  var maxWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '100%';
39
- return "\n max-width: ".concat(maxWidth, "; // Ensure that the node has a maximum width after which truncation can occur\n overflow: hidden !important;\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n");
40
+ return "\n ".concat(logicalCSS('max-width', maxWidth) // Ensure that the node has a maximum width after which truncation can occur
41
+ , "\n overflow: hidden !important;\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n");
40
42
  };
41
43
  /**
42
44
  * Fixed-width numbers for tabular data
@@ -42,7 +42,7 @@ export var EuiGlobalStyles = function EuiGlobalStyles(_ref) {
42
42
  * Final styles
43
43
  */
44
44
 
45
- var styles = /*#__PURE__*/css(reset, " html{", scrollbarStyles, " ", fontReset, " text-size-adjust:100%;font-kerning:normal;height:100%;background-color:", colors.body, ";color:", colors.text, ";}code,pre,kbd,samp{font-family:", font.familyCode, ";}input,textarea,select{", fontReset, ";}button{font-family:", font.family, ";}em{font-style:italic;}strong{font-weight:", font.weight.bold, ";}*:focus{", euiFocusRing(euiTheme), ";}::selection{background:", transparentize(colors.primary, colorMode === 'LIGHT' ? 0.1 : 0.2), ";}a{color:", colors.primaryText, ";&,&:hover,&:focus{text-decoration:none;}}.euiBody-hasPortalContent{position:relative;};label:styles;");
45
+ var styles = /*#__PURE__*/css(reset, " html{", scrollbarStyles, " ", fontReset, " text-size-adjust:100%;font-kerning:normal;height:100%;background-color:", colors.body, ";color:", colors.text, ";}code,pre,kbd,samp{font-family:", font.familyCode, ";}input,textarea,select{", fontReset, ";}button{font-family:", font.family, ";}em{font-style:italic;}strong{font-weight:", font.weight.bold, ";}*:focus{", euiFocusRing(euiThemeContext), ";}::selection{background:", transparentize(colors.primary, colorMode === 'LIGHT' ? 0.1 : 0.2), ";}a{color:", colors.primaryText, ";&,&:hover,&:focus{text-decoration:none;}}.euiBody-hasPortalContent{position:relative;};label:styles;");
46
46
  return ___EmotionJSX(Global, {
47
47
  styles: styles
48
48
  });
@@ -7,11 +7,19 @@
7
7
  */
8
8
  import React from 'react';
9
9
  import { Global, css } from '@emotion/react';
10
+ import { useEuiTheme } from '../../services/theme/hooks';
10
11
  import { euiScreenReaderOnly } from '../../components/accessibility/screen_reader_only/screen_reader_only.styles';
12
+ import { euiFullHeight, euiTextBreakWord, euiTextTruncate, euiNumberFormat, euiScrollBarStyles, euiYScroll, euiXScroll, euiYScrollWithShadows, euiXScrollWithShadows, euiBreakpoint } from '../mixins';
13
+ import { logicalCSS } from '../functions';
11
14
  import { jsx as ___EmotionJSX } from "@emotion/react";
12
- var globalStyles = /*#__PURE__*/css(".euiScreenReaderOnly{", euiScreenReaderOnly(), ";};label:globalStyles;");
15
+ export var globalStyles = function globalStyles(euiThemeContext) {
16
+ return /*#__PURE__*/css(".euiScreenReaderOnly{", euiScreenReaderOnly(), ";}.eui-alignBaseline{vertical-align:baseline!important;}.eui-alignBottom{vertical-align:bottom!important;}.eui-alignMiddle{vertical-align:middle!important;}.eui-alignTop{vertical-align:top!important;}.eui-displayBlock{display:block!important;}.eui-displayInline{display:inline!important;}.eui-displayInlineBlock{display:inline-block!important;}.eui-fullWidth{display:block!important;", logicalCSS('width', '100% !important'), ";}.eui-fullHeight{", euiFullHeight(), ";}.eui-textCenter{text-align:center!important;}.eui-textLeft{text-align:start!important;}.eui-textRight{text-align:end!important;}.eui-textNoWrap{white-space:nowrap!important;}.eui-textInheritColor{color:inherit!important;}.eui-textBreakWord{", euiTextBreakWord(), ";}.eui-textBreakAll{overflow-wrap:break-word!important;word-break:break-all!important;}.eui-textBreakNormal{overflow-wrap:normal!important;word-wrap:normal!important;word-break:normal!important;}.eui-textTruncate{", euiTextTruncate(), ";}.eui-textNumber{", euiNumberFormat(euiThemeContext), ";}.eui-scrollBar{", euiScrollBarStyles(euiThemeContext), ";}.eui-yScroll{", euiYScroll(euiThemeContext), ";}.eui-xScroll{", euiXScroll(euiThemeContext), ";}.eui-yScrollWithShadows{", euiYScrollWithShadows(euiThemeContext), ";}.eui-xScrollWithShadows{", euiXScrollWithShadows(euiThemeContext), ";}[class*='eui-showFor']{display:none!important;}", Object.keys(euiThemeContext.euiTheme.breakpoint).map(function (size) {
17
+ return "\n .eui-hideFor--".concat(size, " {\n ").concat(euiBreakpoint(euiThemeContext, [size]), " {\n display: none !important;\n }\n }\n .eui-showFor--").concat(size, " {\n ").concat(euiBreakpoint(euiThemeContext, [size]), " {\n display: inline !important;\n }\n }\n .eui-showFor--").concat(size, "--block {\n ").concat(euiBreakpoint(euiThemeContext, [size]), " {\n display: block !important;\n }\n }\n .eui-showFor--").concat(size, "--inlineBlock {\n ").concat(euiBreakpoint(euiThemeContext, [size]), " {\n display: inline-block !important;\n }\n }\n .eui-showFor--").concat(size, "--flex {\n ").concat(euiBreakpoint(euiThemeContext, [size]), " {\n display: flex !important;\n }\n }");
18
+ }), ";;label:globalStyles;");
19
+ };
13
20
  export var EuiUtilityClasses = function EuiUtilityClasses() {
21
+ var euiTheme = useEuiTheme();
14
22
  return ___EmotionJSX(Global, {
15
- styles: globalStyles
23
+ styles: globalStyles(euiTheme)
16
24
  });
17
25
  };
@@ -7,18 +7,21 @@ import _extends from "@babel/runtime/helpers/extends";
7
7
  * in compliance with, at your election, the Elastic License 2.0 or the Server
8
8
  * Side Public License, v 1.
9
9
  */
10
- import React, { forwardRef, useContext } from 'react';
10
+ import React, { forwardRef, useContext, useMemo } from 'react';
11
11
  import { EuiThemeContext, EuiModificationsContext, EuiColorModeContext } from './context';
12
12
  import { jsx as ___EmotionJSX } from "@emotion/react";
13
13
  export var useEuiTheme = function useEuiTheme() {
14
14
  var theme = useContext(EuiThemeContext);
15
15
  var colorMode = useContext(EuiColorModeContext);
16
16
  var modifications = useContext(EuiModificationsContext);
17
- return {
18
- euiTheme: theme,
19
- colorMode: colorMode,
20
- modifications: modifications
21
- };
17
+ var assembledTheme = useMemo(function () {
18
+ return {
19
+ euiTheme: theme,
20
+ colorMode: colorMode,
21
+ modifications: modifications
22
+ };
23
+ }, [theme, colorMode, modifications]);
24
+ return assembledTheme;
22
25
  };
23
26
  // Provide the component props interface as the generic to allow the docs props table to populate.
24
27
  // e.g., `const EuiComponent = withEuiTheme<EuiComponentProps>(_EuiComponent)`
@@ -26,17 +29,9 @@ export var withEuiTheme = function withEuiTheme(Component) {
26
29
  var componentName = Component.displayName || Component.name || 'ComponentWithTheme';
27
30
 
28
31
  var Render = function Render(props, ref) {
29
- var _useEuiTheme = useEuiTheme(),
30
- euiTheme = _useEuiTheme.euiTheme,
31
- colorMode = _useEuiTheme.colorMode,
32
- modifications = _useEuiTheme.modifications;
33
-
32
+ var theme = useEuiTheme();
34
33
  return ___EmotionJSX(Component, _extends({
35
- theme: {
36
- euiTheme: euiTheme,
37
- colorMode: colorMode,
38
- modifications: modifications
39
- },
34
+ theme: theme,
40
35
  ref: ref
41
36
  }, props));
42
37
  };
@@ -96,8 +96,7 @@ var CollapsedItemActions = /*#__PURE__*/function (_Component) {
96
96
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "registerPopoverDiv", function (popoverDiv) {
97
97
  if (!_this.popoverDiv) {
98
98
  _this.popoverDiv = popoverDiv;
99
-
100
- _this.popoverDiv.addEventListener('focusout', _this.onPopoverBlur);
99
+ _this.popoverDiv && _this.popoverDiv.addEventListener('focusout', _this.onPopoverBlur);
101
100
  }
102
101
  });
103
102
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onClickItem", function (onClickAction) {
@@ -55,8 +55,8 @@ var euiBreadcrumbContentStyles = function euiBreadcrumbContentStyles(euiThemeCon
55
55
  isTruncated: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiTextTruncate)("".concat(parseFloat(euiTheme.size.base) * 10, "px")), ";;label:isTruncated;"),
56
56
  isTruncatedLast: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiTextTruncate)('none'), ";;label:isTruncatedLast;"),
57
57
  // Types
58
- page: /*#__PURE__*/(0, _react.css)("&:is(a):focus{", (0, _global_styling.euiFocusRing)(euiTheme, 'inset'), ";}&:is(button):focus{", (0, _global_styling.euiFocusRing)(euiTheme, 'center'), ";};label:page;"),
59
- application: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiFontSize)(euiThemeContext, 'xs'), ";background-color:", (0, _color.transparentize)(euiTheme.colors.darkestShade, 0.2), ";clip-path:polygon(\n 0 0,\n calc(100% - ", euiTheme.size.s, ") 0,\n 100% 50%,\n calc(100% - ", euiTheme.size.s, ") 100%,\n 0 100%,\n ", euiTheme.size.s, " 50%\n );color:", euiTheme.colors.darkestShade, ";line-height:", euiTheme.size.base, ";", (0, _global_styling.logicalCSS)('padding-vertical', euiTheme.size.xs), " ", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.base), " &:is(a),&:is(button){background-color:", (0, _color.transparentize)(euiTheme.colors.primary, 0.2), ";color:", euiTheme.colors.link, ";:focus{", (0, _global_styling.euiFocusRing)(euiTheme, 'inset'), ";:focus-visible{border-radius:", euiTheme.border.radius.medium, ";clip-path:none;}}};label:application;"),
58
+ page: /*#__PURE__*/(0, _react.css)("&:is(a):focus{", (0, _global_styling.euiFocusRing)(euiThemeContext, 'inset'), ";}&:is(button):focus{", (0, _global_styling.euiFocusRing)(euiThemeContext, 'center'), ";};label:page;"),
59
+ application: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiFontSize)(euiThemeContext, 'xs'), ";background-color:", (0, _color.transparentize)(euiTheme.colors.darkestShade, 0.2), ";clip-path:polygon(\n 0 0,\n calc(100% - ", euiTheme.size.s, ") 0,\n 100% 50%,\n calc(100% - ", euiTheme.size.s, ") 100%,\n 0 100%,\n ", euiTheme.size.s, " 50%\n );color:", euiTheme.colors.darkestShade, ";line-height:", euiTheme.size.base, ";", (0, _global_styling.logicalCSS)('padding-vertical', euiTheme.size.xs), " ", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.base), " &:is(a),&:is(button){background-color:", (0, _color.transparentize)(euiTheme.colors.primary, 0.2), ";color:", euiTheme.colors.link, ";:focus{", (0, _global_styling.euiFocusRing)(euiThemeContext, 'inset'), ";:focus-visible{border-radius:", euiTheme.border.radius.medium, ";clip-path:none;}}};label:application;"),
60
60
  applicationStyles: {
61
61
  onlyChild: /*#__PURE__*/(0, _react.css)("border-radius:", euiTheme.border.radius.medium, ";clip-path:none;", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.m), ",;;label:onlyChild;"),
62
62
  firstChild: /*#__PURE__*/(0, _react.css)("border-radius:", euiTheme.border.radius.medium, " 0 0 ", euiTheme.border.radius.medium, ";clip-path:polygon(\n 0 0,\n calc(100% - ", euiTheme.size.s, ") 0,\n 100% 50%,\n calc(100% - ", euiTheme.size.s, ") 100%,\n 0 100%\n );", (0, _global_styling.logicalCSS)('padding-left', euiTheme.size.m), ",;;label:firstChild;"),
@@ -46,7 +46,7 @@ var EuiDescriptionListTitle = function EuiDescriptionListTitle(_ref) {
46
46
 
47
47
  var theme = (0, _services.useEuiTheme)();
48
48
  var styles = (0, _description_list_title.euiDescriptionListTitleStyles)(theme);
49
- var conditionalStyles = compressed && textStyle === 'reverse' ? [styles.fontStyles.compressed] : [styles.fontStyles[textStyle]];
49
+ var conditionalStyles = compressed && textStyle !== 'reverse' ? [styles.fontStyles.compressed] : [styles.fontStyles[textStyle]];
50
50
 
51
51
  switch (type) {
52
52
  case 'inline':
@@ -30,10 +30,11 @@ var EuiHeaderSectionItem = function EuiHeaderSectionItem(_ref) {
30
30
  children = _ref.children,
31
31
  className = _ref.className,
32
32
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
33
- var classes = (0, _classnames.default)('euiHeaderSectionItem', borderToClassNameMap[border], className);
34
- return (0, _react2.jsx)("div", (0, _extends2.default)({
33
+ var classes = (0, _classnames.default)('euiHeaderSectionItem', borderToClassNameMap[border], className); // we check if there is any children and if not, we don't render anything
34
+
35
+ return children ? (0, _react2.jsx)("div", (0, _extends2.default)({
35
36
  className: classes
36
- }, rest), children);
37
+ }, rest), children) : null;
37
38
  };
38
39
 
39
40
  exports.EuiHeaderSectionItem = EuiHeaderSectionItem;
@@ -17,7 +17,7 @@ var euiImageButtonStyles = function euiImageButtonStyles(euiThemeContext) {
17
17
  var euiTheme = euiThemeContext.euiTheme;
18
18
  return {
19
19
  // Base
20
- euiImageButton: /*#__PURE__*/(0, _react.css)("position:relative;cursor:pointer;text-align:match-parent;line-height:0;&::before{opacity:0;content:'';pointer-events:none;position:absolute;top:0;bottom:0;left:0;right:0;", _global_styling.euiCanAnimate, "{transition:opacity ", euiTheme.animation.fast, " ", euiTheme.animation.resistance, ";}}&:hover,&:focus{&::before{opacity:1;}[class*='euiImageButton__icon']{opacity:1;}}&:focus{", (0, _global_styling.euiFocusRing)(euiTheme, 'outset'), ";};label:euiImageButton;"),
20
+ euiImageButton: /*#__PURE__*/(0, _react.css)("position:relative;cursor:pointer;text-align:match-parent;line-height:0;&::before{opacity:0;content:'';pointer-events:none;position:absolute;top:0;bottom:0;left:0;right:0;", _global_styling.euiCanAnimate, "{transition:opacity ", euiTheme.animation.fast, " ", euiTheme.animation.resistance, ";}}&:hover,&:focus{&::before{opacity:1;}[class*='euiImageButton__icon']{opacity:1;}}&:focus{", (0, _global_styling.euiFocusRing)(euiThemeContext, 'outset'), ";};label:euiImageButton;"),
21
21
  fullWidth: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('width', '100%'), ";;label:fullWidth;"),
22
22
  shadowHover: /*#__PURE__*/(0, _react.css)("&::before{", (0, _mixins.euiShadow)(euiThemeContext, 's'), ";};label:shadowHover;"),
23
23
  hasShadowHover: /*#__PURE__*/(0, _react.css)("&::before{", (0, _mixins.euiShadow)(euiThemeContext, 'm'), ";};label:hasShadowHover;")
@@ -27,8 +27,9 @@ var euiLinkFocusCSS = function euiLinkFocusCSS(euiTheme) {
27
27
 
28
28
  exports.euiLinkFocusCSS = euiLinkFocusCSS;
29
29
 
30
- var euiLinkCSS = function euiLinkCSS(euiTheme) {
31
- return "\n font-weight: ".concat(euiTheme.font.weight.medium, ";\n text-align: left;\n\n &:hover {\n ").concat(euiLinkHoverCSS(), "\n }\n\n &:focus {\n ").concat((0, _global_styling.euiFocusRing)(euiTheme, 'outset'), "\n ").concat(euiLinkFocusCSS(euiTheme), "\n }\n ");
30
+ var euiLinkCSS = function euiLinkCSS(euiThemeContext) {
31
+ var euiTheme = euiThemeContext.euiTheme;
32
+ return "\n font-weight: ".concat(euiTheme.font.weight.medium, ";\n text-align: left;\n\n &:hover {\n ").concat(euiLinkHoverCSS(), "\n }\n\n &:focus {\n ").concat((0, _global_styling.euiFocusRing)(euiThemeContext, 'outset'), "\n ").concat(euiLinkFocusCSS(euiTheme), "\n }\n ");
32
33
  };
33
34
 
34
35
  exports.euiLinkCSS = euiLinkCSS;
@@ -42,10 +43,10 @@ var _ref = process.env.NODE_ENV === "production" ? {
42
43
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
43
44
  };
44
45
 
45
- var euiLinkStyles = function euiLinkStyles(_ref2) {
46
- var euiTheme = _ref2.euiTheme;
46
+ var euiLinkStyles = function euiLinkStyles(euiThemeContext) {
47
+ var euiTheme = euiThemeContext.euiTheme;
47
48
  return {
48
- euiLink: /*#__PURE__*/(0, _react.css)(euiLinkCSS(euiTheme), " user-select:text;&[target='_blank']{position:relative;};label:euiLink;"),
49
+ euiLink: /*#__PURE__*/(0, _react.css)(euiLinkCSS(euiThemeContext), " user-select:text;&[target='_blank']{position:relative;};label:euiLink;"),
49
50
  disabled: _ref,
50
51
  // Color styles
51
52
  primary: /*#__PURE__*/(0, _react.css)(_colorCSS(euiTheme.colors.primaryText), ";label:primary;"),
@@ -28,8 +28,7 @@ var horizontalPositionToClassNameMap = {
28
28
  };
29
29
 
30
30
  /**
31
- * **DEPRECATED**
32
- * Use EuiPageSection instead
31
+ * @deprecated Use EuiPageSection instead
33
32
  */
34
33
  var EuiPageContent_Deprecated = function EuiPageContent_Deprecated(_ref) {
35
34
  var verticalPosition = _ref.verticalPosition,
@@ -34,8 +34,7 @@ var PADDING_SIZES = (0, _common.keysOf)(paddingSizeToClassNameMap);
34
34
  exports.PADDING_SIZES = PADDING_SIZES;
35
35
 
36
36
  /**
37
- * **DEPRECATED**
38
- * Use EuiPageSection instead
37
+ * @deprecated Use EuiPageSection instead
39
38
  */
40
39
  var EuiPageContentBody_Deprecated = function EuiPageContentBody_Deprecated(_ref) {
41
40
  var children = _ref.children,
@@ -20,8 +20,7 @@ var _react2 = require("@emotion/react");
20
20
  var _excluded = ["children", "className", "responsive"];
21
21
 
22
22
  /**
23
- * **DEPRECATED**
24
- * Use EuiPageHeader instead
23
+ * @deprecated Use EuiPageHeader instead
25
24
  */
26
25
  var EuiPageContentHeader_Deprecated = function EuiPageContentHeader_Deprecated(_ref) {
27
26
  var children = _ref.children,
@@ -20,8 +20,7 @@ var _react2 = require("@emotion/react");
20
20
  var _excluded = ["children", "className"];
21
21
 
22
22
  /**
23
- * **DEPRECATED**
24
- * Use EuiPageHeader instead
23
+ * @deprecated Use EuiPageHeader instead
25
24
  */
26
25
  var EuiPageContentHeaderSection_Deprecated = function EuiPageContentHeaderSection_Deprecated(_ref) {
27
26
  var children = _ref.children,
@@ -23,7 +23,7 @@ var _global_styling = require("../../../global_styling");
23
23
 
24
24
  var _react2 = require("@emotion/react");
25
25
 
26
- var _excluded = ["children", "alignment", "restrictWidth", "bottomBorder", "paddingSize", "color", "grow", "contentProps"];
26
+ var _excluded = ["children", "alignment", "restrictWidth", "bottomBorder", "paddingSize", "color", "grow", "contentProps", "component"];
27
27
 
28
28
  var EuiPageSection = function EuiPageSection(_ref) {
29
29
  var children = _ref.children,
@@ -39,6 +39,8 @@ var EuiPageSection = function EuiPageSection(_ref) {
39
39
  _ref$grow = _ref.grow,
40
40
  grow = _ref$grow === void 0 ? false : _ref$grow,
41
41
  contentProps = _ref.contentProps,
42
+ _ref$component = _ref.component,
43
+ Component = _ref$component === void 0 ? 'section' : _ref$component,
42
44
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
43
45
  // Set max-width as a style prop
44
46
  var widthStyles = (0, _restrict_width.setStyleForRestrictedPageWidth)(restrictWidth, contentProps === null || contentProps === void 0 ? void 0 : contentProps.style);
@@ -50,7 +52,7 @@ var EuiPageSection = function EuiPageSection(_ref) {
50
52
  var cssStyles = [styles.euiPageSection, grow && styles.grow, inlinePadding[paddingSize], bottomBorder === 'extended' && styles.border, alignment && styles[alignment], colors[color]];
51
53
  var contentStyles = (0, _page_section.euiPageSectionContentStyles)();
52
54
  var cssContentStyles = [contentStyles.euiPageSection__content, blockPadding[paddingSize], bottomBorder === true && styles.border, alignment.toLowerCase().includes('center') && contentStyles.center, restrictWidth && contentStyles.restrictWidth];
53
- return (0, _react2.jsx)("div", (0, _extends2.default)({
55
+ return (0, _react2.jsx)(Component, (0, _extends2.default)({
54
56
  css: cssStyles
55
57
  }, rest), (0, _react2.jsx)("div", (0, _extends2.default)({
56
58
  css: cssContentStyles
@@ -30,8 +30,7 @@ var PADDING_SIZES = (0, _common.keysOf)(paddingSizeToClassNameMap);
30
30
  exports.PADDING_SIZES = PADDING_SIZES;
31
31
 
32
32
  /**
33
- * **DEPRECATED**
34
- * Use the new EuiPageSidebar instead
33
+ * @deprecated Use the new EuiPageSidebar in page/page_sidebar instead
35
34
  */
36
35
  var EuiPageSideBar_Deprecated = function EuiPageSideBar_Deprecated(_ref) {
37
36
  var children = _ref.children,
@@ -63,13 +63,17 @@ var EuiPageSidebar = function EuiPageSidebar(_ref) {
63
63
  setInlineStyles = _useState2[1];
64
64
 
65
65
  (0, _react.useEffect)(function () {
66
+ var updatedStyles = _objectSpread(_objectSpread({}, style), (0, _global_styling.logicalStyle)('min-width', isResponding ? '100%' : minWidth));
67
+
66
68
  if (sticky) {
67
69
  var _document$body$datase;
68
70
 
69
71
  var euiHeaderFixedCounter = Number((_document$body$datase = document.body.dataset.fixedHeaders) !== null && _document$body$datase !== void 0 ? _document$body$datase : 0);
70
72
  var offset = (0, _typeof2.default)(sticky) === 'object' ? sticky === null || sticky === void 0 ? void 0 : sticky.offset : themeContext.euiTheme.base * 3 * euiHeaderFixedCounter;
71
- setInlineStyles(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, style), (0, _global_styling.logicalStyle)('min-width', isResponding ? '100%' : minWidth)), (0, _global_styling.logicalStyle)('top', offset)), (0, _global_styling.logicalStyle)('max-height', "calc(100vh - ".concat(offset, "px)"))));
73
+ updatedStyles = _objectSpread(_objectSpread(_objectSpread({}, updatedStyles), (0, _global_styling.logicalStyle)('top', offset)), (0, _global_styling.logicalStyle)('max-height', "calc(100vh - ".concat(offset, "px)")));
72
74
  }
75
+
76
+ setInlineStyles(updatedStyles);
73
77
  }, [style, sticky, themeContext.euiTheme.base, isResponding, minWidth]);
74
78
  return (0, _react2.jsx)("div", (0, _extends2.default)({
75
79
  className: className,
@@ -49,7 +49,9 @@ exports.TEMPLATES = TEMPLATES;
49
49
  /**
50
50
  * This component has been deprecated in favor of the new
51
51
  * namespaced version. You can still import this component
52
- * for a period of time by importing `as EuiPageTemplate`.
52
+ * until August 2023 by importing `as EuiPageTemplate`.
53
+ *
54
+ * @deprecated use EuiPageTemplate from page_template/page_template instead
53
55
  */
54
56
  var EuiPageTemplate_Deprecated = function EuiPageTemplate_Deprecated(_ref) {
55
57
  var _pageBodyProps2;
@@ -9,8 +9,6 @@ exports.EuiCacheProvider = void 0;
9
9
 
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
 
12
- var _cache = _interopRequireDefault(require("@emotion/cache"));
13
-
14
12
  var _react2 = require("@emotion/react");
15
13
 
16
14
  /*
@@ -20,18 +18,12 @@ var _react2 = require("@emotion/react");
20
18
  * in compliance with, at your election, the Elastic License 2.0 or the Server
21
19
  * Side Public License, v 1.
22
20
  */
23
- var defaultCache = (0, _cache.default)({
24
- key: 'css'
25
- });
26
- defaultCache.compat = true;
27
-
28
21
  var EuiCacheProvider = function EuiCacheProvider(_ref) {
29
- var _ref$cache = _ref.cache,
30
- cache = _ref$cache === void 0 ? defaultCache : _ref$cache,
22
+ var cache = _ref.cache,
31
23
  children = _ref.children;
32
- return (0, _react2.jsx)(_react2.CacheProvider, {
24
+ return children && cache ? (0, _react2.jsx)(_react2.CacheProvider, {
33
25
  value: cache
34
- }, children);
26
+ }, children) : (0, _react2.jsx)(_react.default.Fragment, null, children);
35
27
  };
36
28
 
37
29
  exports.EuiCacheProvider = EuiCacheProvider;
@@ -9,6 +9,8 @@ exports.EuiProvider = void 0;
9
9
 
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
 
12
+ var _cache = _interopRequireDefault(require("@emotion/cache"));
13
+
12
14
  var _global_styles = require("../../global_styling/reset/global_styles");
13
15
 
14
16
  var _utility = require("../../global_styling/utility/utility");
@@ -17,7 +19,7 @@ var _services = require("../../services");
17
19
 
18
20
  var _themes = require("../../themes");
19
21
 
20
- var _cache = require("./cache");
22
+ var _cache2 = require("./cache");
21
23
 
22
24
  var _react2 = require("@emotion/react");
23
25
 
@@ -32,8 +34,16 @@ var isEmotionCacheObject = function isEmotionCacheObject(obj) {
32
34
  return obj.hasOwnProperty('key');
33
35
  };
34
36
 
37
+ var fallbackCache = (0, _cache.default)({
38
+ key: 'css'
39
+ });
40
+ fallbackCache.compat = true;
41
+
35
42
  var EuiProvider = function EuiProvider(_ref) {
36
- var cache = _ref.cache,
43
+ var _defaultCache;
44
+
45
+ var _ref$cache = _ref.cache,
46
+ cache = _ref$cache === void 0 ? fallbackCache : _ref$cache,
37
47
  _ref$theme = _ref.theme,
38
48
  theme = _ref$theme === void 0 ? _themes.EuiThemeAmsterdam : _ref$theme,
39
49
  _ref$globalStyles = _ref.globalStyles,
@@ -49,24 +59,39 @@ var EuiProvider = function EuiProvider(_ref) {
49
59
 
50
60
  if (cache) {
51
61
  if (isEmotionCacheObject(cache)) {
62
+ cache.compat = true;
52
63
  defaultCache = cache;
53
64
  } else {
65
+ if (cache.default) {
66
+ cache.default.compat = true;
67
+ }
68
+
54
69
  defaultCache = cache.default;
70
+
71
+ if (cache.global) {
72
+ cache.global.compat = true;
73
+ }
74
+
55
75
  globalCache = cache.global;
76
+
77
+ if (cache.utility) {
78
+ cache.utility.compat = true;
79
+ }
80
+
56
81
  utilityCache = cache.utility;
57
82
  }
58
83
  }
59
84
 
60
- return (0, _react2.jsx)(_cache.EuiCacheProvider, {
61
- cache: defaultCache
85
+ return (0, _react2.jsx)(_cache2.EuiCacheProvider, {
86
+ cache: (_defaultCache = defaultCache) !== null && _defaultCache !== void 0 ? _defaultCache : fallbackCache
62
87
  }, (0, _react2.jsx)(_services.EuiThemeProvider, {
63
88
  theme: theme !== null && theme !== void 0 ? theme : undefined,
64
89
  colorMode: colorMode,
65
90
  modify: modify
66
- }, theme && (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_cache.EuiCacheProvider, {
91
+ }, theme && (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_cache2.EuiCacheProvider, {
67
92
  cache: globalCache,
68
93
  children: Globals && (0, _react2.jsx)(Globals, null)
69
- }), (0, _react2.jsx)(_cache.EuiCacheProvider, {
94
+ }), (0, _react2.jsx)(_cache2.EuiCacheProvider, {
70
95
  cache: utilityCache,
71
96
  children: Utilities && (0, _react2.jsx)(Utilities, null)
72
97
  })), (0, _react2.jsx)(_services.CurrentEuiBreakpointProvider, null, children)));
@@ -74,7 +74,7 @@ var euiScaleText = function euiScaleText(euiThemeContext, options) {
74
74
  var euiTextStyles = function euiTextStyles(euiThemeContext) {
75
75
  var euiTheme = euiThemeContext.euiTheme;
76
76
  return {
77
- euiText: /*#__PURE__*/(0, _react.css)(euiText(euiTheme, true), ";clear:both;a:not([class]){", (0, _link.euiLinkCSS)(euiTheme), ";}img{display:block;", (0, _global_styling.logicalCSS)('max-width', '100%'), ";}ul{list-style:disc;}ol{list-style:decimal;}blockquote:not(.euiMarkdownFormat__blockquote){position:relative;", (0, _global_styling.logicalTextAlignCSS)('center'), " ", (0, _global_styling.logicalCSS)('margin-horizontal', 'auto'), " font-family:", euiTheme.font.familySerif, ";font-style:italic;letter-spacing:normal;p:last-child{", (0, _global_styling.logicalCSS)('margin-bottom', '0'), ";}&:before,&:after{position:absolute;content:'';", (0, _global_styling.logicalCSS)('height', euiTheme.border.width.thick), " ", (0, _global_styling.logicalCSS)('width', '50%'), " ", (0, _global_styling.logicalCSS)('left', '25%'), " ", (0, _global_styling.logicalCSS)('right', '25%'), " background:", euiTheme.colors.darkShade, ";}&:before{", (0, _global_styling.logicalCSS)('top', '0'), ";}&:after{", (0, _global_styling.logicalCSS)('bottom', '0'), ";}}h1{", (0, _title.euiTitle)(euiThemeContext, 'l'), ";}h2{", (0, _title.euiTitle)(euiThemeContext, 'm'), ";}h3{", (0, _title.euiTitle)(euiThemeContext, 's'), ";}h4,dt{", (0, _title.euiTitle)(euiThemeContext, 'xs'), ";}h5{", (0, _title.euiTitle)(euiThemeContext, 'xxs'), ";}h6{", (0, _title.euiTitle)(euiThemeContext, 'xxxs'), " text-transform:uppercase;}h1,h2,h3,h4,h5,h6,dt{color:inherit;}pre:not(.euiCodeBlock__pre){white-space:pre-wrap;background:", (0, _global_styling.euiBackgroundColor)(euiThemeContext, 'subdued'), ";color:", euiTheme.colors.text, ";}pre:not(.euiCodeBlock__pre),pre:not(.euiCodeBlock__pre) code{display:block;}>:last-child{", (0, _global_styling.logicalCSS)('margin-bottom', '0 !important'), ";}kbd{position:relative;display:inline-block;", (0, _global_styling.logicalCSS)('padding-vertical', euiTheme.size.xxs), " ", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.xs), " line-height:1;border:", euiTheme.border.width.thin, " solid ", euiTheme.colors.text, ";border-radius:calc(", euiTheme.border.radius.small, " / 2);};label:euiText;"),
77
+ euiText: /*#__PURE__*/(0, _react.css)(euiText(euiTheme, true), ";clear:both;a:not([class]){", (0, _link.euiLinkCSS)(euiThemeContext), ";}img{display:block;", (0, _global_styling.logicalCSS)('max-width', '100%'), ";}ul{list-style:disc;}ol{list-style:decimal;}blockquote:not(.euiMarkdownFormat__blockquote){position:relative;", (0, _global_styling.logicalTextAlignCSS)('center'), " ", (0, _global_styling.logicalCSS)('margin-horizontal', 'auto'), " font-family:", euiTheme.font.familySerif, ";font-style:italic;letter-spacing:normal;p:last-child{", (0, _global_styling.logicalCSS)('margin-bottom', '0'), ";}&:before,&:after{position:absolute;content:'';", (0, _global_styling.logicalCSS)('height', euiTheme.border.width.thick), " ", (0, _global_styling.logicalCSS)('width', '50%'), " ", (0, _global_styling.logicalCSS)('left', '25%'), " ", (0, _global_styling.logicalCSS)('right', '25%'), " background:", euiTheme.colors.darkShade, ";}&:before{", (0, _global_styling.logicalCSS)('top', '0'), ";}&:after{", (0, _global_styling.logicalCSS)('bottom', '0'), ";}}h1{", (0, _title.euiTitle)(euiThemeContext, 'l'), ";}h2{", (0, _title.euiTitle)(euiThemeContext, 'm'), ";}h3{", (0, _title.euiTitle)(euiThemeContext, 's'), ";}h4,dt{", (0, _title.euiTitle)(euiThemeContext, 'xs'), ";}h5{", (0, _title.euiTitle)(euiThemeContext, 'xxs'), ";}h6{", (0, _title.euiTitle)(euiThemeContext, 'xxxs'), " text-transform:uppercase;}h1,h2,h3,h4,h5,h6,dt{color:inherit;}pre:not(.euiCodeBlock__pre){white-space:pre-wrap;background:", (0, _global_styling.euiBackgroundColor)(euiThemeContext, 'subdued'), ";color:", euiTheme.colors.text, ";}pre:not(.euiCodeBlock__pre),pre:not(.euiCodeBlock__pre) code{display:block;}>:last-child{", (0, _global_styling.logicalCSS)('margin-bottom', '0 !important'), ";}kbd{position:relative;display:inline-block;", (0, _global_styling.logicalCSS)('padding-vertical', euiTheme.size.xxs), " ", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.xs), " line-height:1;border:", euiTheme.border.width.thin, " solid ", euiTheme.colors.text, ";border-radius:calc(", euiTheme.border.radius.small, " / 2);};label:euiText;"),
78
78
  constrainedWidth: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-width', euiTextConstrainedMaxWidth), ";;label:constrainedWidth;"),
79
79
  // Sizes
80
80
  m: /*#__PURE__*/(0, _react.css)(euiScaleText(euiThemeContext, {
@@ -24,7 +24,7 @@ var euiGlobalToastListStyles = function euiGlobalToastListStyles(euiThemeContext
24
24
  * 2. Allow some padding for shadow
25
25
  */
26
26
  // Base
27
- euiGlobalToastList: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiScrollBarStyles)(euiThemeContext), " display:flex;flex-direction:column;align-items:stretch;position:fixed;z-index:", euiTheme.levels.toast, ";", (0, _global_styling.logicalCSS)('bottom', 0), ";", (0, _global_styling.logicalCSS)('width', "".concat(euiToastWidth + euiTheme.base * 5, "px")), ";", (0, _global_styling.logicalCSS)('max-height', '100vh'), ";overflow-y:auto;", (0, _global_styling.logicalCSS)('overflow-y', 'auto'), ";scrollbar-width:none;&::-webkit-scrollbar{", (0, _global_styling.logicalSizeCSS)(0, 0), ";}&:not(:empty){", (0, _global_styling.logicalCSS)('padding-left', euiTheme.size.base), ";", (0, _global_styling.logicalCSS)('padding-right', euiTheme.size.base), ";", (0, _global_styling.logicalCSS)('padding-vertical', euiTheme.size.base), ";}", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['xs', 's']), "{&:not(:empty){", (0, _global_styling.logicalCSS)('left', 0), ";", (0, _global_styling.logicalCSS)('width', '100%'), ";}};label:euiGlobalToastList;"),
27
+ euiGlobalToastList: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiScrollBarStyles)(euiThemeContext), " display:flex;flex-direction:column;align-items:stretch;position:fixed;z-index:", euiTheme.levels.toast, ";", (0, _global_styling.logicalCSS)('bottom', 0), ";", (0, _global_styling.logicalCSS)('width', "".concat(euiToastWidth + euiTheme.base * 5, "px")), ";", (0, _global_styling.logicalCSS)('max-height', '100vh'), ";", (0, _global_styling.logicalCSSWithFallback)('overflow-y', 'auto'), ";scrollbar-width:none;&::-webkit-scrollbar{", (0, _global_styling.logicalSizeCSS)(0, 0), ";}&:not(:empty){", (0, _global_styling.logicalCSS)('padding-left', euiTheme.size.base), ";", (0, _global_styling.logicalCSS)('padding-right', euiTheme.size.base), ";", (0, _global_styling.logicalCSS)('padding-vertical', euiTheme.size.base), ";}", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['xs', 's']), "{&:not(:empty){", (0, _global_styling.logicalCSS)('left', 0), ";", (0, _global_styling.logicalCSS)('width', '100%'), ";}};label:euiGlobalToastList;"),
28
28
  // Variants
29
29
  right: /*#__PURE__*/(0, _react.css)("&:not(:empty){", (0, _global_styling.logicalCSS)('right', 0), ";", (0, _global_styling.logicalCSS)('padding-left', "".concat(euiTheme.base * 4, "px")), ";}", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['xs', 's']), "{&:not(:empty){", (0, _global_styling.logicalCSS)('padding-left', euiTheme.size.base), ";}};label:right;"),
30
30
  left: /*#__PURE__*/(0, _react.css)("&:not(:empty){", (0, _global_styling.logicalCSS)('left', 0), ";", (0, _global_styling.logicalCSS)('padding-right', "".concat(euiTheme.base * 4, "px")), ";}", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['xs', 's']), "{&:not(:empty){", (0, _global_styling.logicalCSS)('padding-right', euiTheme.size.base), ";}};label:left;")
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.logicals = exports.logicalTextAlignStyle = exports.logicalTextAlignCSS = exports.logicalText = exports.logicalStyle = exports.logicalSizeStyle = exports.logicalSizeCSS = exports.logicalSide = exports.logicalCSS = exports.LOGICAL_TEXT_ALIGNMENT = exports.LOGICAL_SIDES = exports.LOGICAL_PROPERTIES = void 0;
8
+ exports.logicals = exports.logicalTextAlignStyle = exports.logicalTextAlignCSS = exports.logicalText = exports.logicalStyle = exports.logicalSizeStyle = exports.logicalSizeCSS = exports.logicalSide = exports.logicalCSSWithFallback = exports.logicalCSS = exports.LOGICAL_TEXT_ALIGNMENT = exports.LOGICAL_SIDES = exports.LOGICAL_PROPERTIES = void 0;
9
9
 
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
 
@@ -66,8 +66,8 @@ var logicalSize = {
66
66
  'min-width': 'min-inline-size'
67
67
  };
68
68
  var logicalOverflow = {
69
- 'overflow-x': 'overflow-block',
70
- 'overflow-y': 'overflow-inline'
69
+ 'overflow-x': 'overflow-inline',
70
+ 'overflow-y': 'overflow-block'
71
71
  };
72
72
  var logicalBorders = {
73
73
  'border-horizontal': 'border-inline',
@@ -115,6 +115,23 @@ exports.LOGICAL_PROPERTIES = LOGICAL_PROPERTIES;
115
115
  var logicalCSS = function logicalCSS(property, value) {
116
116
  return "".concat(logicals[property], ": ").concat(value, ";");
117
117
  };
118
+ /**
119
+ * Some logical properties are not yet fully supported by all browsers.
120
+ * For those cases, we should use the old property as a fallback for
121
+ * browsers missing support, while allowing supporting browsers to use
122
+ * the logical properties.
123
+ *
124
+ * Examples:
125
+ * https://caniuse.com/?search=overflow-block
126
+ * https://caniuse.com/mdn-css_properties_float_flow_relative_values
127
+ */
128
+
129
+
130
+ exports.logicalCSS = logicalCSS;
131
+
132
+ var logicalCSSWithFallback = function logicalCSSWithFallback(property, value) {
133
+ return "\n ".concat(property, ": ").concat(value, ";\n ").concat(logicalCSS(property, value), "\n");
134
+ };
118
135
  /**
119
136
  *
120
137
  * @param property A string that is a valid CSS logical property
@@ -123,7 +140,7 @@ var logicalCSS = function logicalCSS(property, value) {
123
140
  */
124
141
 
125
142
 
126
- exports.logicalCSS = logicalCSS;
143
+ exports.logicalCSSWithFallback = logicalCSSWithFallback;
127
144
 
128
145
  var logicalStyle = function logicalStyle(property, value) {
129
146
  // Strip hyphens and camelCase the CSS logical property so React doesn't throw errors