@elastic/eui 67.1.0 → 67.1.2

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 (168) hide show
  1. package/dist/eui_theme_dark.css +0 -292
  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 -292
  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/avatar/avatar.js +7 -1
  12. package/es/components/badge/badge.styles.js +10 -4
  13. package/es/components/breadcrumbs/breadcrumb.styles.js +4 -2
  14. package/es/components/button/button_display/_button_display_content.js +2 -2
  15. package/es/components/button/button_icon/button_icon.js +11 -7
  16. package/es/components/collapsible_nav/collapsible_nav.js +8 -0
  17. package/es/components/expression/expression.styles.js +4 -2
  18. package/es/components/flyout/flyout.js +28 -48
  19. package/es/components/flyout/flyout.styles.js +111 -0
  20. package/es/components/flyout/flyout_body.js +14 -6
  21. package/es/components/flyout/flyout_body.styles.js +21 -0
  22. package/es/components/flyout/flyout_footer.js +8 -1
  23. package/es/components/flyout/flyout_footer.styles.js +14 -0
  24. package/es/components/flyout/flyout_header.js +9 -4
  25. package/es/components/flyout/flyout_header.styles.js +28 -0
  26. package/es/components/image/image_wrapper.js +3 -3
  27. package/es/components/markdown_editor/markdown_format.styles.js +11 -6
  28. package/es/components/notification/notification_event.js +2 -3
  29. package/es/components/page/page_header/page_header_content.js +1 -1
  30. package/es/components/page/page_section/page_section.js +3 -4
  31. package/es/components/pagination/pagination_button.styles.js +5 -3
  32. package/es/components/progress/progress.js +2 -2
  33. package/es/components/text/text.styles.js +6 -3
  34. package/es/components/tool_tip/tool_tip.styles.js +7 -6
  35. package/es/components/tour/tour.styles.js +11 -6
  36. package/es/global_styling/functions/index.js +1 -0
  37. package/es/global_styling/functions/math.js +46 -0
  38. package/es/global_styling/mixins/_helpers.js +5 -2
  39. package/eui.d.ts +95 -7
  40. package/i18ntokens.json +2 -2
  41. package/lib/components/accordion/accordion.js +5 -4
  42. package/lib/components/accordion/accordion.styles.js +1 -1
  43. package/lib/components/avatar/avatar.js +7 -1
  44. package/lib/components/badge/badge.styles.js +9 -3
  45. package/lib/components/breadcrumbs/breadcrumb.styles.js +3 -1
  46. package/lib/components/button/button_display/_button_display_content.js +2 -2
  47. package/lib/components/button/button_icon/button_icon.js +11 -7
  48. package/lib/components/collapsible_nav/collapsible_nav.js +8 -0
  49. package/lib/components/expression/expression.styles.js +3 -1
  50. package/lib/components/flyout/flyout.js +28 -47
  51. package/lib/components/flyout/flyout.styles.js +122 -0
  52. package/lib/components/flyout/flyout_body.js +16 -6
  53. package/lib/components/flyout/flyout_body.styles.js +32 -0
  54. package/lib/components/flyout/flyout_footer.js +10 -1
  55. package/lib/components/flyout/flyout_footer.styles.js +24 -0
  56. package/lib/components/flyout/flyout_header.js +11 -4
  57. package/lib/components/flyout/flyout_header.styles.js +31 -0
  58. package/lib/components/image/image_wrapper.js +3 -3
  59. package/lib/components/markdown_editor/markdown_format.styles.js +10 -5
  60. package/lib/components/notification/notification_event.js +2 -3
  61. package/lib/components/page/page_header/page_header_content.js +1 -1
  62. package/lib/components/page/page_section/page_section.js +3 -4
  63. package/lib/components/pagination/pagination_button.styles.js +4 -2
  64. package/lib/components/progress/progress.js +2 -2
  65. package/lib/components/text/text.styles.js +5 -2
  66. package/lib/components/tool_tip/tool_tip.styles.js +6 -5
  67. package/lib/components/tour/tour.styles.js +10 -5
  68. package/lib/global_styling/functions/index.js +13 -0
  69. package/lib/global_styling/functions/math.js +55 -0
  70. package/lib/global_styling/mixins/_helpers.js +5 -2
  71. package/optimize/es/components/accordion/accordion.js +5 -4
  72. package/optimize/es/components/accordion/accordion.styles.js +1 -1
  73. package/optimize/es/components/avatar/avatar.js +7 -1
  74. package/optimize/es/components/badge/badge.styles.js +10 -4
  75. package/optimize/es/components/breadcrumbs/breadcrumb.styles.js +4 -2
  76. package/optimize/es/components/button/button_display/_button_display_content.js +2 -2
  77. package/optimize/es/components/button/button_icon/button_icon.js +11 -7
  78. package/optimize/es/components/expression/expression.styles.js +4 -2
  79. package/optimize/es/components/flyout/flyout.js +28 -48
  80. package/optimize/es/components/flyout/flyout.styles.js +111 -0
  81. package/optimize/es/components/flyout/flyout_body.js +14 -6
  82. package/optimize/es/components/flyout/flyout_body.styles.js +21 -0
  83. package/optimize/es/components/flyout/flyout_footer.js +8 -1
  84. package/optimize/es/components/flyout/flyout_footer.styles.js +14 -0
  85. package/optimize/es/components/flyout/flyout_header.js +9 -4
  86. package/optimize/es/components/flyout/flyout_header.styles.js +28 -0
  87. package/optimize/es/components/image/image_wrapper.js +3 -3
  88. package/optimize/es/components/markdown_editor/markdown_format.styles.js +11 -6
  89. package/optimize/es/components/notification/notification_event.js +2 -3
  90. package/optimize/es/components/page/page_header/page_header_content.js +1 -1
  91. package/optimize/es/components/page/page_section/page_section.js +3 -4
  92. package/optimize/es/components/pagination/pagination_button.styles.js +5 -3
  93. package/optimize/es/components/progress/progress.js +2 -2
  94. package/optimize/es/components/text/text.styles.js +6 -3
  95. package/optimize/es/components/tool_tip/tool_tip.styles.js +7 -6
  96. package/optimize/es/components/tour/tour.styles.js +11 -6
  97. package/optimize/es/global_styling/functions/index.js +1 -0
  98. package/optimize/es/global_styling/functions/math.js +44 -0
  99. package/optimize/es/global_styling/mixins/_helpers.js +5 -2
  100. package/optimize/lib/components/accordion/accordion.js +5 -4
  101. package/optimize/lib/components/accordion/accordion.styles.js +1 -1
  102. package/optimize/lib/components/avatar/avatar.js +8 -1
  103. package/optimize/lib/components/badge/badge.styles.js +9 -3
  104. package/optimize/lib/components/breadcrumbs/breadcrumb.styles.js +3 -1
  105. package/optimize/lib/components/button/button_display/_button_display_content.js +2 -2
  106. package/optimize/lib/components/button/button_icon/button_icon.js +11 -7
  107. package/optimize/lib/components/expression/expression.styles.js +3 -1
  108. package/optimize/lib/components/flyout/flyout.js +28 -47
  109. package/optimize/lib/components/flyout/flyout.styles.js +124 -0
  110. package/optimize/lib/components/flyout/flyout_body.js +16 -6
  111. package/optimize/lib/components/flyout/flyout_body.styles.js +32 -0
  112. package/optimize/lib/components/flyout/flyout_footer.js +10 -1
  113. package/optimize/lib/components/flyout/flyout_footer.styles.js +24 -0
  114. package/optimize/lib/components/flyout/flyout_header.js +11 -4
  115. package/optimize/lib/components/flyout/flyout_header.styles.js +31 -0
  116. package/optimize/lib/components/image/image_wrapper.js +3 -3
  117. package/optimize/lib/components/markdown_editor/markdown_format.styles.js +10 -5
  118. package/optimize/lib/components/notification/notification_event.js +2 -3
  119. package/optimize/lib/components/page/page_header/page_header_content.js +1 -1
  120. package/optimize/lib/components/page/page_section/page_section.js +3 -4
  121. package/optimize/lib/components/pagination/pagination_button.styles.js +4 -2
  122. package/optimize/lib/components/progress/progress.js +2 -2
  123. package/optimize/lib/components/text/text.styles.js +5 -2
  124. package/optimize/lib/components/tool_tip/tool_tip.styles.js +6 -5
  125. package/optimize/lib/components/tour/tour.styles.js +10 -5
  126. package/optimize/lib/global_styling/functions/index.js +13 -0
  127. package/optimize/lib/global_styling/functions/math.js +57 -0
  128. package/optimize/lib/global_styling/mixins/_helpers.js +5 -2
  129. package/package.json +1 -1
  130. package/src/components/index.scss +0 -1
  131. package/src/themes/amsterdam/global_styling/variables/_index.scss +0 -1
  132. package/test-env/components/accordion/accordion.js +5 -4
  133. package/test-env/components/accordion/accordion.styles.js +1 -1
  134. package/test-env/components/avatar/avatar.js +8 -1
  135. package/test-env/components/badge/badge.styles.js +9 -3
  136. package/test-env/components/breadcrumbs/breadcrumb.styles.js +3 -1
  137. package/test-env/components/button/button_display/_button_display_content.js +2 -2
  138. package/test-env/components/button/button_icon/button_icon.js +11 -7
  139. package/test-env/components/collapsible_nav/collapsible_nav.js +8 -0
  140. package/test-env/components/expression/expression.styles.js +3 -1
  141. package/test-env/components/flyout/flyout.styles.js +124 -0
  142. package/test-env/components/flyout/flyout_body.js +16 -6
  143. package/test-env/components/flyout/flyout_body.styles.js +32 -0
  144. package/test-env/components/flyout/flyout_footer.js +10 -1
  145. package/test-env/components/flyout/flyout_footer.styles.js +24 -0
  146. package/test-env/components/flyout/flyout_header.js +11 -4
  147. package/test-env/components/flyout/flyout_header.styles.js +31 -0
  148. package/test-env/components/image/image_wrapper.js +3 -3
  149. package/test-env/components/markdown_editor/markdown_format.styles.js +10 -5
  150. package/test-env/components/notification/notification_event.js +2 -3
  151. package/test-env/components/page/page_header/page_header_content.js +1 -1
  152. package/test-env/components/page/page_section/page_section.js +3 -4
  153. package/test-env/components/pagination/pagination_button.styles.js +4 -2
  154. package/test-env/components/progress/progress.js +2 -2
  155. package/test-env/components/text/text.styles.js +5 -2
  156. package/test-env/components/tool_tip/tool_tip.styles.js +6 -5
  157. package/test-env/components/tour/tour.styles.js +10 -5
  158. package/test-env/global_styling/functions/index.js +13 -0
  159. package/test-env/global_styling/functions/math.js +57 -0
  160. package/test-env/global_styling/mixins/_helpers.js +5 -2
  161. package/src/components/flyout/_flyout.scss +0 -196
  162. package/src/components/flyout/_flyout_body.scss +0 -18
  163. package/src/components/flyout/_flyout_footer.scss +0 -4
  164. package/src/components/flyout/_flyout_header.scss +0 -7
  165. package/src/components/flyout/_index.scss +0 -7
  166. package/src/components/flyout/_mixins.scss +0 -18
  167. package/src/components/flyout/_variables.scss +0 -8
  168. package/src/themes/amsterdam/global_styling/variables/_flyout.scss +0 -1
@@ -208,10 +208,10 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
208
208
 
209
209
  if (_arrowDisplay !== 'none') {
210
210
  iconButton = ___EmotionJSX(EuiButtonIcon, _extends({
211
- color: "text"
211
+ color: "text",
212
+ css: cssIconButtonStyles
212
213
  }, arrowProps, {
213
214
  className: iconButtonClasses,
214
- css: cssIconButtonStyles,
215
215
  iconType: "arrowRight",
216
216
  onClick: this.onToggle,
217
217
  "aria-controls": id,
@@ -247,10 +247,11 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
247
247
  childrenContent = children;
248
248
  }
249
249
 
250
- var button = ___EmotionJSX(ButtonElement, _extends({}, buttonProps, {
250
+ var button = ___EmotionJSX(ButtonElement, _extends({
251
+ css: cssButtonStyles
252
+ }, buttonProps, {
251
253
  id: buttonId,
252
254
  className: buttonClasses,
253
- css: cssButtonStyles,
254
255
  "aria-controls": id,
255
256
  "aria-expanded": isOpen,
256
257
  onClick: isDisabled ? undefined : this.onToggle,
@@ -43,7 +43,7 @@ export var euiAccordionChildrenStyles = function euiAccordionChildrenStyles(_ref
43
43
  export var euiAccordionChildWrapperStyles = function euiAccordionChildWrapperStyles(_ref6) {
44
44
  var euiTheme = _ref6.euiTheme;
45
45
  return {
46
- euiAccordion__childWrapper: /*#__PURE__*/css(logicalCSS('height', 0), " opacity:0;overflow:hidden;transition:", logicals.height, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ",opacity ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";visibility:hidden;will-change:opacity,visibility,", logicals.height, ";&:focus{outline:none;};label:euiAccordion__childWrapper;"),
46
+ euiAccordion__childWrapper: /*#__PURE__*/css(logicalCSS('height', 0), " opacity:0;overflow:hidden;transition:", logicals.height, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ",opacity ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";visibility:hidden;&:focus{outline:none;};label:euiAccordion__childWrapper;"),
47
47
  isOpen: /*#__PURE__*/css(logicalCSS('height', 'auto'), " opacity:1;visibility:visible;;label:isOpen;")
48
48
  };
49
49
  };
@@ -14,6 +14,10 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
14
14
 
15
15
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
16
16
 
17
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
18
+
19
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
20
+
17
21
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
18
22
 
19
23
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
@@ -66,7 +70,9 @@ export var EuiAvatar = function EuiAvatar(_ref) {
66
70
  var classes = classNames('euiAvatar', (_classNames = {}, _defineProperty(_classNames, "euiAvatar--".concat(size), size), _defineProperty(_classNames, "euiAvatar--".concat(type), type), _defineProperty(_classNames, 'euiAvatar-isDisabled', isDisabled), _classNames), className);
67
71
  var cssStyles = [styles.euiAvatar, styles[size], styles[type], isPlain && styles.plain, isSubdued && styles.subdued, isDisabled && styles.isDisabled];
68
72
  checkValidInitials(initials);
69
- var avatarStyle = style || {};
73
+
74
+ var avatarStyle = _objectSpread({}, style);
75
+
70
76
  var iconCustomColor = iconColor;
71
77
  var isNamedColor = color === 'plain' || color === 'subdued' || color === null;
72
78
 
@@ -8,7 +8,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
8
8
  * Side Public License, v 1.
9
9
  */
10
10
  import { css } from '@emotion/react';
11
- import { euiFontSize, euiFocusRing, euiTextTruncate, logicalCSS, logicalTextAlignCSS } from '../../global_styling';
11
+ import { euiFontSize, euiFocusRing, euiTextTruncate, logicalCSS, logicalTextAlignCSS, mathWithUnits } from '../../global_styling';
12
12
  import { euiButtonColor } from '../../themes/amsterdam/global_styling/mixins';
13
13
  import { tint, transparentize } from '../../services';
14
14
 
@@ -25,14 +25,18 @@ export var euiBadgeStyles = function euiBadgeStyles(euiThemeContext) {
25
25
  var euiTheme = euiThemeContext.euiTheme,
26
26
  colorMode = euiThemeContext.colorMode;
27
27
  return {
28
- euiBadge: /*#__PURE__*/css("display:inline-block;vertical-align:middle;padding:0 ", euiTheme.size.s, ";", logicalCSS('max-width', '100%'), " font-size:", euiFontSize(euiThemeContext, 'xs').fontSize, ";line-height:", euiTheme.base + 2, "px;font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:default;background-color:transparent;border:", euiTheme.border.width.thin, " solid transparent;border-radius:", parseFloat(String(euiTheme.border.radius.medium)) / 2, "px;", logicalTextAlignCSS('left'), " &:focus-within{", euiFocusRing(euiThemeContext), ";}&+.euiBadge{", logicalCSS('margin-left', euiTheme.size.xs), ";};label:euiBadge;"),
28
+ euiBadge: /*#__PURE__*/css("display:inline-block;vertical-align:middle;padding:0 ", euiTheme.size.s, ";", logicalCSS('max-width', '100%'), " font-size:", euiFontSize(euiThemeContext, 'xs').fontSize, ";line-height:", euiTheme.base + 2, "px;font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:default;background-color:transparent;border:", euiTheme.border.width.thin, " solid transparent;border-radius:", mathWithUnits(euiTheme.border.radius.medium, function (x) {
29
+ return x / 2;
30
+ }), ";", logicalTextAlignCSS('left'), " &:focus-within{", euiFocusRing(euiThemeContext), ";}&+.euiBadge{", logicalCSS('margin-left', euiTheme.size.xs), ";};label:euiBadge;"),
29
31
  clickable: /*#__PURE__*/css("&:not(:disabled){&:hover,&:focus{text-decoration:underline;}}&:focus{", euiFocusRing(euiThemeContext), ";}&:disabled{cursor:not-allowed;};label:clickable;"),
30
32
  disabled: /*#__PURE__*/css("color:", euiButtonColor(euiThemeContext, 'disabled').color, "!important;background-color:", euiButtonColor(euiThemeContext, 'disabled').backgroundColor, "!important;;label:disabled;"),
31
33
  // Hollow has a border and is mostly used for autocompleters.
32
34
  hollow: /*#__PURE__*/css("background-color:", euiTheme.colors.emptyShade, ";border-color:", colorMode === 'DARK' ? tint(euiTheme.border.color, 0.15) : euiTheme.border.color, ";color:", euiTheme.colors.text, ";;label:hollow;"),
33
35
  // Content wrapper
34
36
  euiBadge__content: /*#__PURE__*/css(logicalCSS( // Ensure proper height in case of just displaying an icon
35
- 'min-height', "".concat(euiTheme.base + parseFloat(String(euiTheme.border.width.thin)) * 2, "px")), " display:flex;align-items:center;overflow:hidden;;label:euiBadge__content;"),
37
+ 'min-height', "".concat(mathWithUnits(euiTheme.border.width.thin, function (x) {
38
+ return euiTheme.base + x * 2;
39
+ }))), " display:flex;align-items:center;overflow:hidden;;label:euiBadge__content;"),
36
40
  // Text
37
41
  text: {
38
42
  euiBadge__text: /*#__PURE__*/css(euiTextTruncate(), " cursor:inherit;;label:euiBadge__text;"),
@@ -46,7 +50,9 @@ export var euiBadgeStyles = function euiBadgeStyles(euiThemeContext) {
46
50
  },
47
51
  // Clickable icons (iconOnClick)
48
52
  iconButton: {
49
- euiBadge__iconButton: /*#__PURE__*/css("font-size:0;&:focus{background-color:", transparentize(euiTheme.colors.ghost, 0.8), ";color:", euiTheme.colors.ink, ";border-radius:", parseFloat(String(euiTheme.border.radius.small)) / 2, "px;}&:disabled{cursor:not-allowed;}.euiBadge__icon{margin:0!important;};label:euiBadge__iconButton;"),
53
+ euiBadge__iconButton: /*#__PURE__*/css("font-size:0;&:focus{background-color:", transparentize(euiTheme.colors.ghost, 0.8), ";color:", euiTheme.colors.ink, ";border-radius:", mathWithUnits(euiTheme.border.radius.small, function (x) {
54
+ return x / 2;
55
+ }), ";}&:disabled{cursor:not-allowed;}.euiBadge__icon{margin:0!important;};label:euiBadge__iconButton;"),
50
56
  right: /*#__PURE__*/css(logicalCSS('margin-left', euiTheme.size.xs), ";;label:right;"),
51
57
  left: /*#__PURE__*/css(logicalCSS('margin-right', euiTheme.size.xs), ";;label:left;")
52
58
  },
@@ -9,7 +9,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
9
9
  */
10
10
  import { css } from '@emotion/react';
11
11
  import { transparentize } from '../../services/color';
12
- import { euiFontSize, euiTextTruncate, euiFocusRing, logicalCSS } from '../../global_styling';
12
+ import { euiFontSize, euiTextTruncate, euiFocusRing, logicalCSS, mathWithUnits } from '../../global_styling';
13
13
 
14
14
  var _ref = process.env.NODE_ENV === "production" ? {
15
15
  name: "1k7t4ns-isCollapsed",
@@ -47,7 +47,9 @@ export var euiBreadcrumbContentStyles = function euiBreadcrumbContentStyles(euiT
47
47
  var euiTheme = euiThemeContext.euiTheme;
48
48
  return {
49
49
  euiBreadcrumb__content: /*#__PURE__*/css("font-weight:", euiTheme.font.weight.medium, ";text-align:center;vertical-align:baseline;;label:euiBreadcrumb__content;"),
50
- isTruncated: /*#__PURE__*/css(euiTextTruncate("".concat(parseFloat(euiTheme.size.base) * 10, "px")), ";;label:isTruncated;"),
50
+ isTruncated: /*#__PURE__*/css(euiTextTruncate(mathWithUnits(euiTheme.size.base, function (x) {
51
+ return x * 10;
52
+ })), ";;label:isTruncated;"),
51
53
  isTruncatedLast: /*#__PURE__*/css(euiTextTruncate('none'), ";;label:isTruncatedLast;"),
52
54
  // Types
53
55
  page: /*#__PURE__*/css("&:is(a):focus{", euiFocusRing(euiThemeContext, 'inset'), ";}&:is(button):focus{", euiFocusRing(euiThemeContext, 'center'), ";};label:page;"),
@@ -69,9 +69,9 @@ export var EuiButtonDisplayContent = function EuiButtonDisplayContent(_ref) {
69
69
  }
70
70
 
71
71
  var isText = typeof children === 'string';
72
- return ___EmotionJSX("span", _extends({}, contentProps, {
72
+ return ___EmotionJSX("span", _extends({
73
73
  css: cssStyles
74
- }), icon, isText ? ___EmotionJSX("span", _extends({}, textProps, {
74
+ }, contentProps), icon, isText ? ___EmotionJSX("span", _extends({}, textProps, {
75
75
  className: classNames('eui-textTruncate', textProps === null || textProps === void 0 ? void 0 : textProps.className)
76
76
  }), children) : children);
77
77
  };
@@ -74,11 +74,15 @@ export var EuiButtonIcon = function EuiButtonIcon(props) {
74
74
 
75
75
 
76
76
  var color = isDisabled ? 'disabled' : _color === 'ghost' ? 'text' : _color;
77
- var buttonColorStyles = useEuiButtonColorCSS({
78
- display: display
79
- })[color]; // Temporary extra style for empty `:hover` state until we decide how to handle universally
80
-
81
- var hoverStyles = display === 'empty' ? /*#__PURE__*/css("&:hover{background-color:", euiButtonEmptyColor(euiThemeContext, color).backgroundColor, ";};label:hoverStyles;") : /*#__PURE__*/css(";label:hoverStyles;");
77
+ var styles = {
78
+ euiButtonIcon: /*#__PURE__*/css(";label:euiButtonIcon;"),
79
+ colors: useEuiButtonColorCSS({
80
+ display: display
81
+ }),
82
+ // Temporary extra style for empty `:hover` state until we decide how to handle universally
83
+ hoverStyles: /*#__PURE__*/css("&:hover{background-color:", euiButtonEmptyColor(euiThemeContext, color).backgroundColor, ";};label:hoverStyles;")
84
+ };
85
+ var cssStyles = [styles.euiButtonIcon, styles.colors[color], display === 'empty' && styles.hoverStyles];
82
86
  var classes = classNames('euiButtonIcon', size && sizeToClassNameMap[size], className);
83
87
 
84
88
  if (_color === 'ghost') {
@@ -124,7 +128,7 @@ export var EuiButtonIcon = function EuiButtonIcon(props) {
124
128
  rel: rel
125
129
  });
126
130
  return ___EmotionJSX("a", _extends({
127
- css: [buttonColorStyles, hoverStyles, ";label:EuiButtonIcon;"],
131
+ css: cssStyles,
128
132
  tabIndex: isAriaHidden ? -1 : undefined,
129
133
  className: classes,
130
134
  href: href,
@@ -136,7 +140,7 @@ export var EuiButtonIcon = function EuiButtonIcon(props) {
136
140
 
137
141
  var buttonType;
138
142
  return ___EmotionJSX("button", _extends({
139
- css: [buttonColorStyles, hoverStyles, ";label:EuiButtonIcon;"],
143
+ css: cssStyles,
140
144
  tabIndex: isAriaHidden ? -1 : undefined,
141
145
  disabled: isDisabled,
142
146
  className: classes,
@@ -138,6 +138,7 @@ EuiCollapsibleNav.propTypes = {
138
138
  /**
139
139
  * Defines the width of the panel.
140
140
  * Pass a predefined size of `s | m | l`, or pass any number/string compatible with the CSS `width` attribute
141
+ * @default m
141
142
  */
142
143
  size: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.any.isRequired]),
143
144
 
@@ -147,21 +148,25 @@ EuiCollapsibleNav.propTypes = {
147
148
  * set to `false` to not restrict the width,
148
149
  * set to a number for a custom width in px,
149
150
  * set to a string for a custom width in custom measurement.
151
+ * @default false
150
152
  */
151
153
  maxWidth: PropTypes.oneOfType([PropTypes.bool.isRequired, PropTypes.number.isRequired, PropTypes.string.isRequired]),
152
154
 
153
155
  /**
154
156
  * Customize the padding around the content of the flyout header, body and footer
157
+ * @default l
155
158
  */
156
159
  paddingSize: PropTypes.any,
157
160
 
158
161
  /**
159
162
  * Adds an EuiOverlayMask and wraps in an EuiPortal
163
+ * @default true
160
164
  */
161
165
  ownFocus: PropTypes.bool,
162
166
 
163
167
  /**
164
168
  * Hides the default close button. You must provide another close button somewhere within the flyout.
169
+ * @default false
165
170
  */
166
171
  hideCloseButton: PropTypes.bool,
167
172
 
@@ -174,6 +179,7 @@ EuiCollapsibleNav.propTypes = {
174
179
  * Position of close button.
175
180
  * `inside`: Floating to just inside the flyout, always top right;
176
181
  * `outside`: Floating just outside the flyout near the top (side dependent on `side`). Helpful when the close button may cover other interactable content.
182
+ * @default inside
177
183
  */
178
184
  closeButtonPosition: PropTypes.oneOf(["inside", "outside"]),
179
185
 
@@ -211,12 +217,14 @@ EuiCollapsibleNav.propTypes = {
211
217
  /**
212
218
  * Which side of the window to attach to.
213
219
  * The `left` option should only be used for navigation.
220
+ * @default right
214
221
  */
215
222
  side: PropTypes.any,
216
223
 
217
224
  /**
218
225
  * Defaults to `dialog` which is best for most cases of the flyout.
219
226
  * Otherwise pass in your own, aria-role, or `null` to remove it and use the semantic `as` element instead
227
+ * @default dialog
220
228
  */
221
229
  role: PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.string.isRequired]),
222
230
 
@@ -10,7 +10,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
10
10
  * Side Public License, v 1.
11
11
  */
12
12
  import { css } from '@emotion/react';
13
- import { euiFontSize, logicalCSS, logicalTextAlignCSS, euiTextBreakWord, euiTextTruncate } from '../../global_styling';
13
+ import { euiFontSize, logicalCSS, logicalTextAlignCSS, euiTextBreakWord, euiTextTruncate, mathWithUnits } from '../../global_styling';
14
14
  import { transparentize } from '../../services/color';
15
15
 
16
16
  var _colorCSS = function _colorCSS(color) {
@@ -20,7 +20,9 @@ var _colorCSS = function _colorCSS(color) {
20
20
  export var euiExpressionStyles = function euiExpressionStyles(euiThemeContext) {
21
21
  var euiTheme = euiThemeContext.euiTheme;
22
22
  return {
23
- euiExpression: /*#__PURE__*/css(euiTextBreakWord(), ";display:inline-block;font-family:", euiTheme.font.familyCode, ";", logicalCSS('border-bottom', "".concat(euiTheme.border.width.thick, " solid transparent")), " ", euiFontSize(euiThemeContext, 's'), ";", logicalTextAlignCSS('left'), " padding:", parseFloat(euiTheme.size.s) / 2, "px 0;color:", euiTheme.colors.text, ";&:focus{", logicalCSS('border-bottom-style', 'solid'), ";}&+.euiExpression{", logicalCSS('margin-left', euiTheme.size.s), ";};label:euiExpression;"),
23
+ euiExpression: /*#__PURE__*/css(euiTextBreakWord(), ";display:inline-block;font-family:", euiTheme.font.familyCode, ";", logicalCSS('border-bottom', "".concat(euiTheme.border.width.thick, " solid transparent")), " ", euiFontSize(euiThemeContext, 's'), ";", logicalTextAlignCSS('left'), " padding:", mathWithUnits(euiTheme.size.s, function (x) {
24
+ return x / 2;
25
+ }), " 0;color:", euiTheme.colors.text, ";&:focus{", logicalCSS('border-bottom-style', 'solid'), ";}&+.euiExpression{", logicalCSS('margin-left', euiTheme.size.s), ";};label:euiExpression;"),
24
26
  // Variants
25
27
  columns: /*#__PURE__*/css("border-color:transparent;", logicalCSS('border-bottom-style', 'solid'), " ", logicalCSS('margin-bottom', euiTheme.size.xs), " ", logicalCSS('width', '100%'), " display:flex;padding:", euiTheme.size.xs, ";border-radius:", euiTheme.size.xs, ";;label:columns;"),
26
28
  truncate: /*#__PURE__*/css(logicalCSS('max-width', '100%'), ";;label:truncate;"),
@@ -33,31 +33,19 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
33
33
  */
34
34
  import React, { useEffect, useRef, useState, forwardRef, Fragment } from 'react';
35
35
  import classnames from 'classnames';
36
- import { keys, EuiWindowEvent, useCombinedRefs, useIsWithinMinBreakpoint } from '../../services';
37
- import { keysOf } from '../common';
36
+ import { keys, EuiWindowEvent, useCombinedRefs, useIsWithinMinBreakpoint, useEuiTheme } from '../../services';
37
+ import { logicalStyle } from '../../global_styling';
38
38
  import { EuiFocusTrap } from '../focus_trap';
39
39
  import { EuiOverlayMask } from '../overlay_mask';
40
40
  import { EuiButtonIcon } from '../button';
41
41
  import { EuiI18n } from '../i18n';
42
42
  import { useResizeObserver } from '../observer/resize_observer';
43
43
  import { EuiPortal } from '../portal';
44
+ import { euiFlyoutStyles, euiFlyoutCloseButtonStyles } from './flyout.styles';
44
45
  import { jsx as ___EmotionJSX } from "@emotion/react";
45
- var typeToClassNameMap = {
46
- push: 'euiFlyout--push',
47
- overlay: null
48
- };
49
- export var TYPES = keysOf(typeToClassNameMap);
50
- var sideToClassNameMap = {
51
- left: 'euiFlyout--left',
52
- right: null
53
- };
54
- export var SIDES = keysOf(sideToClassNameMap);
55
- var sizeToClassNameMap = {
56
- s: 'euiFlyout--small',
57
- m: 'euiFlyout--medium',
58
- l: 'euiFlyout--large'
59
- };
60
- export var SIZES = keysOf(sizeToClassNameMap);
46
+ export var TYPES = ['push', 'overlay'];
47
+ export var SIDES = ['left', 'right'];
48
+ export var SIZES = ['s', 'm', 'l'];
61
49
 
62
50
  /**
63
51
  * Custom type checker for named flyout sizes since the prop
@@ -67,13 +55,7 @@ function isEuiFlyoutSizeNamed(value) {
67
55
  return SIZES.includes(value);
68
56
  }
69
57
 
70
- var paddingSizeToClassNameMap = {
71
- none: 'euiFlyout--paddingNone',
72
- s: 'euiFlyout--paddingSmall',
73
- m: 'euiFlyout--paddingMedium',
74
- l: 'euiFlyout--paddingLarge'
75
- };
76
- export var PADDING_SIZES = keysOf(paddingSizeToClassNameMap);
58
+ export var PADDING_SIZES = ['none', 's', 'm', 'l'];
77
59
  var defaultElement = 'div';
78
60
  export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
79
61
  var className = _ref.className,
@@ -164,41 +146,37 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
164
146
  onClose(event);
165
147
  }
166
148
  };
149
+ /**
150
+ * Set inline styles
151
+ */
167
152
 
168
- var newStyle;
169
- var widthClassName;
170
- var sizeClassName; // Setting max-width
171
153
 
172
- if (maxWidth === true) {
173
- widthClassName = 'euiFlyout--maxWidth-default';
174
- } else if (maxWidth !== false) {
175
- var value = typeof maxWidth === 'number' ? "".concat(maxWidth, "px") : maxWidth;
176
- newStyle = _objectSpread(_objectSpread({}, style), {}, {
177
- maxWidth: value
178
- });
179
- } // Setting size
154
+ var newStyle = style;
180
155
 
156
+ if (typeof maxWidth !== 'boolean') {
157
+ newStyle = _objectSpread(_objectSpread({}, newStyle), logicalStyle('max-width', maxWidth));
158
+ }
181
159
 
182
- if (isEuiFlyoutSizeNamed(size)) {
183
- sizeClassName = sizeToClassNameMap[size];
184
- } else if (newStyle) {
185
- newStyle.width = size;
186
- } else {
187
- newStyle = _objectSpread(_objectSpread({}, style), {}, {
188
- width: size
189
- });
160
+ if (!isEuiFlyoutSizeNamed(size)) {
161
+ newStyle = _objectSpread(_objectSpread({}, newStyle), logicalStyle('width', size));
190
162
  }
191
163
 
192
- var classes = classnames('euiFlyout', typeToClassNameMap[type], sideToClassNameMap[side], sizeClassName, paddingSizeToClassNameMap[paddingSize], widthClassName, className);
164
+ var euiTheme = useEuiTheme();
165
+ var styles = euiFlyoutStyles(euiTheme);
166
+ var cssStyles = [styles.euiFlyout, styles.paddingSizes[paddingSize], isEuiFlyoutSizeNamed(size) && styles[size], maxWidth === false && styles.noMaxWidth, styles[type], type === 'push' && styles.pushSide[side], styles[side]];
167
+ var classes = classnames('euiFlyout', className);
193
168
  var closeButton;
194
169
 
195
170
  if (onClose && !hideCloseButton) {
196
- var closeButtonClasses = classnames('euiFlyout__closeButton', "euiFlyout__closeButton--".concat(closeButtonPosition), closeButtonProps === null || closeButtonProps === void 0 ? void 0 : closeButtonProps.className);
171
+ var closeButtonClasses = classnames('euiFlyout__closeButton', closeButtonProps === null || closeButtonProps === void 0 ? void 0 : closeButtonProps.className);
172
+ var closeButtonStyles = euiFlyoutCloseButtonStyles(euiTheme);
173
+ var closeButtonCssStyles = [closeButtonStyles.euiFlyout__closeButton, closeButtonStyles[closeButtonPosition], closeButtonPosition === 'outside' && closeButtonStyles.outsideSide[side]];
197
174
  closeButton = ___EmotionJSX(EuiI18n, {
198
175
  token: "euiFlyout.closeAriaLabel",
199
176
  default: "Close this dialog"
200
177
  }, function (closeAriaLabel) {
201
178
  return ___EmotionJSX(EuiButtonIcon, _extends({
179
+ css: closeButtonCssStyles,
202
180
  display: closeButtonPosition === 'outside' ? 'fill' : 'empty',
203
181
  iconType: "cross",
204
182
  color: "text",
@@ -251,11 +229,13 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
251
229
  disabled: isPushed,
252
230
  clickOutsideDisables: !ownFocus,
253
231
  onClickOutside: onClickOutside
254
- }, focusTrapProps), ___EmotionJSX(Element, _extends({}, rest, {
232
+ }, focusTrapProps), ___EmotionJSX(Element, _extends({
233
+ css: cssStyles
234
+ }, rest, {
255
235
  role: role,
256
236
  className: classes,
257
237
  tabIndex: -1,
258
- style: newStyle || style,
238
+ style: newStyle,
259
239
  ref: setRef
260
240
  }), closeButton, children)); // If ownFocus is set, wrap with an overlay and allow the user to click it to close it.
261
241
 
@@ -0,0 +1,111 @@
1
+ var _templateObject, _templateObject2;
2
+
3
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
4
+
5
+ /*
6
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
7
+ * or more contributor license agreements. Licensed under the Elastic License
8
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
9
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
10
+ * Side Public License, v 1.
11
+ */
12
+ import { css, keyframes } from '@emotion/react';
13
+ import { euiCanAnimate, euiBreakpoint, logicalCSS, mathWithUnits } from '../../global_styling';
14
+ import { euiShadowXLarge } from '../../themes/amsterdam/global_styling/mixins';
15
+ import { transparentize } from '../../services/color';
16
+ import { euiFormMaxWidth } from '../form/form.styles';
17
+ var euiFlyoutSlideInRight = 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"])));
18
+ var euiFlyoutSlideInLeft = 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"])));
19
+ export var euiFlyoutCloseButtonStyles = function euiFlyoutCloseButtonStyles(euiThemeContext) {
20
+ var euiTheme = euiThemeContext.euiTheme;
21
+ return {
22
+ euiFlyout__closeButton: /*#__PURE__*/css("position:absolute;", logicalCSS('right', euiTheme.size.s), " ", logicalCSS('top', euiTheme.size.s), " z-index:3;;label:euiFlyout__closeButton;"),
23
+ inside: /*#__PURE__*/css("background-color:", transparentize(euiTheme.colors.emptyShade, 0.9), ";;label:inside;"),
24
+ outside: /*#__PURE__*/css(euiShadowXLarge(euiThemeContext), ";animation:none!important;;label:outside;"),
25
+ outsideSide: {
26
+ // `transforms` pull in close buttons a little
27
+ // `!important` is necessary here to override the hover/focus transitions of buttons
28
+ right: /*#__PURE__*/css(logicalCSS('left', 0), " ", euiBreakpoint(euiThemeContext, ['m', 'xl']), "{transform:translateX(calc(-100% - ", euiTheme.size.l, "))!important;}", euiBreakpoint(euiThemeContext, ['xs', 's']), "{transform:translateX(calc(-100% - ", euiTheme.size.xs, "))!important;};label:right;"),
29
+ left: /*#__PURE__*/css(logicalCSS('right', 0), " ", euiBreakpoint(euiThemeContext, ['m', 'xl']), "{transform:translateX(calc(100% + ", euiTheme.size.l, "))!important;}", euiBreakpoint(euiThemeContext, ['xs', 's']), "{transform:translateX(calc(100% + ", euiTheme.size.xs, "))!important;};label:left;")
30
+ }
31
+ };
32
+ };
33
+ export var euiFlyoutStyles = function euiFlyoutStyles(euiThemeContext) {
34
+ var euiTheme = euiThemeContext.euiTheme;
35
+ return {
36
+ euiFlyout: /*#__PURE__*/css("position:fixed;", logicalCSS('top', 0), " ", logicalCSS('bottom', 0), " ", logicalCSS('height', '100%'), " z-index:", euiTheme.levels.flyout, ";background:", euiTheme.colors.emptyShade, ";display:flex;flex-direction:column;align-items:stretch;&:focus{outline:none;}", euiBreakpoint(euiThemeContext, ['xs', 's']), "{", logicalCSS('max-width', '90vw !important'), ";};label:euiFlyout;"),
37
+ // Flyout sizes
38
+ s: /*#__PURE__*/css(composeFlyoutSizing(euiThemeContext, 's'), ";;label:s;"),
39
+ m: /*#__PURE__*/css(composeFlyoutSizing(euiThemeContext, 'm'), ";;label:m;"),
40
+ l: /*#__PURE__*/css(composeFlyoutSizing(euiThemeContext, 'l'), ";;label:l;"),
41
+ noMaxWidth: /*#__PURE__*/css(logicalCSS('max-width', 'none'), ";;label:noMaxWidth;"),
42
+ // Side
43
+ right: /*#__PURE__*/css("clip-path:polygon(-50% 0, 100% 0, 100% 100%, -50% 100%);", logicalCSS('right', 0), " ", euiCanAnimate, "{animation:", euiFlyoutSlideInRight, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";};label:right;"),
44
+ // Left-side flyouts should only be used for navigation
45
+ left: /*#__PURE__*/css(logicalCSS('left', 0), " clip-path:polygon(0 0, 150% 0, 150% 100%, 0 100%);", euiCanAnimate, "{animation:", euiFlyoutSlideInLeft, ";};label:left;"),
46
+ // Type
47
+ overlay: /*#__PURE__*/css(euiShadowXLarge(euiThemeContext), ";;label:overlay;"),
48
+ push: /*#__PURE__*/css("clip-path:none;animation-duration:0s!important;z-index:", Number(euiTheme.levels.flyout) - 1, ";;label:push;"),
49
+ pushSide: {
50
+ right: /*#__PURE__*/css(logicalCSS('border-left', euiTheme.border.thick), ";;label:right;"),
51
+ left: /*#__PURE__*/css(logicalCSS('border-right', euiTheme.border.thick), ";;label:left;")
52
+ },
53
+ // Padding
54
+ paddingSizes: {
55
+ none: /*#__PURE__*/css(composeFlyoutPadding(euiThemeContext, 'none'), ";;label:none;"),
56
+ s: /*#__PURE__*/css(composeFlyoutPadding(euiThemeContext, 's'), ";;label:s;"),
57
+ m: /*#__PURE__*/css(composeFlyoutPadding(euiThemeContext, 'm'), ";;label:m;"),
58
+ l: /*#__PURE__*/css(composeFlyoutPadding(euiThemeContext, 'l'), ";;label:l;")
59
+ }
60
+ };
61
+ };
62
+
63
+ var composeFlyoutSizing = function composeFlyoutSizing(euiThemeContext, size) {
64
+ var euiTheme = euiThemeContext.euiTheme; // 1. Calculating the minimum width based on the screen takeover breakpoint
65
+
66
+ var flyoutSizes = {
67
+ s: {
68
+ min: "".concat(Math.round(euiTheme.breakpoint.m * 0.5), "px"),
69
+ // 1.
70
+ width: '25vw',
71
+ max: "".concat(Math.round(euiTheme.breakpoint.s * 0.7), "px")
72
+ },
73
+ m: {
74
+ // Calculated for forms plus padding
75
+ min: "".concat(mathWithUnits(euiFormMaxWidth(euiThemeContext), function (x) {
76
+ return x + 24;
77
+ })),
78
+ width: '50vw',
79
+ max: "".concat(euiTheme.breakpoint.m, "px")
80
+ },
81
+ l: {
82
+ min: "".concat(Math.round(euiTheme.breakpoint.m * 0.9), "px"),
83
+ // 1.
84
+ width: '75vw',
85
+ max: "".concat(euiTheme.breakpoint.l, "px")
86
+ }
87
+ };
88
+ return "\n ".concat(logicalCSS('max-width', flyoutSizes[size].max), "\n\n ").concat(euiBreakpoint(euiThemeContext, ['m', 'xl']), " {\n ").concat(logicalCSS('min-width', flyoutSizes[size].min), "\n ").concat(logicalCSS('width', flyoutSizes[size].width), "\n }\n ").concat(euiBreakpoint(euiThemeContext, ['xs', 's']), " {\n ").concat(logicalCSS('min-width', 0), "\n ").concat(logicalCSS('width', flyoutSizes[size].min), "\n }\n ");
89
+ };
90
+
91
+ var composeFlyoutPadding = function composeFlyoutPadding(euiThemeContext, paddingSize) {
92
+ var euiTheme = euiThemeContext.euiTheme;
93
+ var paddingModifierMap = {
94
+ none: 0,
95
+ s: euiTheme.size.s,
96
+ m: euiTheme.size.base,
97
+ l: euiTheme.size.l
98
+ }; // Footer padding
99
+
100
+ var footerPaddingSizes = {
101
+ none: 0,
102
+ s: euiTheme.size.s,
103
+ m: "".concat(mathWithUnits(euiTheme.size.base, function (x) {
104
+ return x * 0.75;
105
+ }), " ").concat(euiTheme.size.base, ";"),
106
+ l: "".concat(mathWithUnits(euiTheme.size.l, function (x) {
107
+ return x / 1.5;
108
+ }), " ").concat(euiTheme.size.l, ";")
109
+ };
110
+ return "\n .euiFlyoutHeader {\n ".concat(logicalCSS('padding-horizontal', paddingModifierMap[paddingSize]), "\n ").concat(logicalCSS('padding-top', paddingModifierMap[paddingSize]), "\n }\n\n [class*='euiFlyoutHeader-hasBorder'] {\n ").concat(logicalCSS('padding-bottom', paddingModifierMap[paddingSize]), "\n }\n\n .euiFlyoutBody__overflowContent {\n padding: ").concat(paddingModifierMap[paddingSize], ";\n }\n\n .euiFlyoutBody__banner .euiCallOut {\n ").concat(logicalCSS('padding-horizontal', paddingModifierMap[paddingSize]), "\n }\n\n .euiFlyoutFooter {\n padding: ").concat(footerPaddingSizes[paddingSize], ";\n }\n ");
111
+ };
@@ -16,6 +16,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
16
16
  import React from 'react';
17
17
  import PropTypes from "prop-types";
18
18
  import classNames from 'classnames';
19
+ import { useEuiTheme } from '../../services';
20
+ import { euiFlyoutBodyStyles } from './flyout_body.styles';
19
21
  import { jsx as ___EmotionJSX } from "@emotion/react";
20
22
  export var EuiFlyoutBody = function EuiFlyoutBody(_ref) {
21
23
  var children = _ref.children,
@@ -24,16 +26,22 @@ export var EuiFlyoutBody = function EuiFlyoutBody(_ref) {
24
26
  rest = _objectWithoutProperties(_ref, _excluded);
25
27
 
26
28
  var classes = classNames('euiFlyoutBody', className);
27
- var overflowClasses = classNames('euiFlyoutBody__overflow', {
28
- 'euiFlyoutBody__overflow--hasBanner': banner
29
- });
29
+ var euiTheme = useEuiTheme();
30
+ var styles = euiFlyoutBodyStyles(euiTheme);
31
+ var cssStyles = [styles.euiFlyoutBody];
32
+ var bannerCssStyles = [banner && styles.euiFlyoutBody__banner];
33
+ var overflowCssStyles = [banner ? styles.euiFlyoutBody__overflow.hasBanner : styles.euiFlyoutBody__overflow.noBanner];
30
34
  return ___EmotionJSX("div", _extends({
31
35
  className: classes
32
- }, rest), ___EmotionJSX("div", {
36
+ }, rest, {
37
+ css: cssStyles
38
+ }), ___EmotionJSX("div", {
33
39
  tabIndex: 0,
34
- className: overflowClasses
40
+ className: "euiFlyoutBody__overflow",
41
+ css: overflowCssStyles
35
42
  }, banner && ___EmotionJSX("div", {
36
- className: "euiFlyoutBody__banner"
43
+ className: "euiFlyoutBody__banner",
44
+ css: bannerCssStyles
37
45
  }, banner), ___EmotionJSX("div", {
38
46
  className: "euiFlyoutBody__overflowContent"
39
47
  }, children)));
@@ -0,0 +1,21 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6
+ * Side Public License, v 1.
7
+ */
8
+ import { css } from '@emotion/react';
9
+ import { logicalCSS, logicalCSSWithFallback, euiYScrollWithShadows } from '../../global_styling';
10
+ export var euiFlyoutBodyStyles = function euiFlyoutBodyStyles(euiThemeContext) {
11
+ return {
12
+ euiFlyoutBody: /*#__PURE__*/css(logicalCSSWithFallback('overflow-y', 'hidden'), " ", logicalCSS('height', '100%'), ";;label:euiFlyoutBody;"),
13
+ euiFlyoutBody__overflow: {
14
+ noBanner: /*#__PURE__*/css(euiYScrollWithShadows(euiThemeContext), ";;label:noBanner;"),
15
+ hasBanner: /*#__PURE__*/css(euiYScrollWithShadows(euiThemeContext, {
16
+ side: 'end'
17
+ }), ";;label:hasBanner;")
18
+ },
19
+ euiFlyoutBody__banner: /*#__PURE__*/css(logicalCSSWithFallback('overflow-x', 'hidden'), ";;label:euiFlyoutBody__banner;")
20
+ };
21
+ };
@@ -16,6 +16,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
16
16
  import React from 'react';
17
17
  import PropTypes from "prop-types";
18
18
  import classNames from 'classnames';
19
+ import { useEuiTheme } from '../../services';
20
+ import { euiFlyoutFooterStyles } from './flyout_footer.styles';
19
21
  import { jsx as ___EmotionJSX } from "@emotion/react";
20
22
  export var EuiFlyoutFooter = function EuiFlyoutFooter(_ref) {
21
23
  var children = _ref.children,
@@ -23,9 +25,14 @@ export var EuiFlyoutFooter = function EuiFlyoutFooter(_ref) {
23
25
  rest = _objectWithoutProperties(_ref, _excluded);
24
26
 
25
27
  var classes = classNames('euiFlyoutFooter', className);
28
+ var euiTheme = useEuiTheme();
29
+ var styles = euiFlyoutFooterStyles(euiTheme);
30
+ var cssStyles = [styles.euiFlyoutFooter];
26
31
  return ___EmotionJSX("div", _extends({
27
32
  className: classes
28
- }, rest), children);
33
+ }, rest, {
34
+ css: cssStyles
35
+ }), children);
29
36
  };
30
37
  EuiFlyoutFooter.propTypes = {
31
38
  className: PropTypes.string,
@@ -0,0 +1,14 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6
+ * Side Public License, v 1.
7
+ */
8
+ import { css } from '@emotion/react';
9
+ export var euiFlyoutFooterStyles = function euiFlyoutFooterStyles(euiThemeContext) {
10
+ var euiTheme = euiThemeContext.euiTheme;
11
+ return {
12
+ euiFlyoutFooter: /*#__PURE__*/css("background-color:", euiTheme.colors.lightestShade, ";flex-grow:0;;label:euiFlyoutFooter;")
13
+ };
14
+ };
@@ -16,6 +16,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
16
16
  import React from 'react';
17
17
  import PropTypes from "prop-types";
18
18
  import classNames from 'classnames';
19
+ import { useEuiTheme } from '../../services';
20
+ import { euiFlyoutHeaderStyles } from './flyout_header.styles';
19
21
  import { jsx as ___EmotionJSX } from "@emotion/react";
20
22
  export var EuiFlyoutHeader = function EuiFlyoutHeader(_ref) {
21
23
  var children = _ref.children,
@@ -24,12 +26,15 @@ export var EuiFlyoutHeader = function EuiFlyoutHeader(_ref) {
24
26
  hasBorder = _ref$hasBorder === void 0 ? false : _ref$hasBorder,
25
27
  rest = _objectWithoutProperties(_ref, _excluded);
26
28
 
27
- var classes = classNames('euiFlyoutHeader', {
28
- 'euiFlyoutHeader--hasBorder': hasBorder
29
- }, className);
29
+ var classes = classNames('euiFlyoutHeader', className);
30
+ var euiTheme = useEuiTheme();
31
+ var styles = euiFlyoutHeaderStyles(euiTheme);
32
+ var cssStyles = [styles.euiFlyoutHeader, hasBorder && styles.hasBorder];
30
33
  return ___EmotionJSX("div", _extends({
31
34
  className: classes
32
- }, rest), children);
35
+ }, rest, {
36
+ css: cssStyles
37
+ }), children);
33
38
  };
34
39
  EuiFlyoutHeader.propTypes = {
35
40
  className: PropTypes.string,