@elastic/eui 72.1.0 → 72.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/eui_theme_dark.css +0 -3
  2. package/dist/eui_theme_dark.min.css +1 -1
  3. package/dist/eui_theme_light.css +0 -3
  4. package/dist/eui_theme_light.min.css +1 -1
  5. package/es/components/accordion/accordion.js +1 -1
  6. package/es/components/date_picker/super_date_picker/super_date_picker.js +9 -0
  7. package/es/components/date_picker/super_date_picker/super_update_button.js +8 -0
  8. package/es/components/image/image.js +9 -2
  9. package/es/components/image/image_fullscreen_wrapper.js +3 -1
  10. package/es/components/image/image_wrapper.js +3 -1
  11. package/es/components/markdown_editor/markdown_format.styles.js +2 -5
  12. package/es/components/text/text.styles.js +6 -3
  13. package/es/components/tool_tip/icon_tip.js +8 -0
  14. package/es/components/tool_tip/tool_tip.js +24 -1
  15. package/es/components/tour/tour.styles.js +1 -1
  16. package/eui.d.ts +12 -1
  17. package/lib/components/accordion/accordion.js +1 -1
  18. package/lib/components/date_picker/super_date_picker/super_date_picker.js +9 -0
  19. package/lib/components/date_picker/super_date_picker/super_update_button.js +8 -0
  20. package/lib/components/image/image.js +9 -2
  21. package/lib/components/image/image_fullscreen_wrapper.js +3 -1
  22. package/lib/components/image/image_wrapper.js +3 -1
  23. package/lib/components/markdown_editor/markdown_format.styles.js +1 -4
  24. package/lib/components/text/text.styles.js +5 -2
  25. package/lib/components/tool_tip/icon_tip.js +8 -0
  26. package/lib/components/tool_tip/tool_tip.js +24 -1
  27. package/lib/components/tour/tour.styles.js +1 -1
  28. package/optimize/es/components/accordion/accordion.js +1 -1
  29. package/optimize/es/components/image/image.js +4 -2
  30. package/optimize/es/components/image/image_fullscreen_wrapper.js +3 -1
  31. package/optimize/es/components/image/image_wrapper.js +3 -1
  32. package/optimize/es/components/markdown_editor/markdown_format.styles.js +2 -5
  33. package/optimize/es/components/text/text.styles.js +6 -3
  34. package/optimize/es/components/tool_tip/tool_tip.js +16 -1
  35. package/optimize/es/components/tour/tour.styles.js +1 -1
  36. package/optimize/lib/components/accordion/accordion.js +1 -1
  37. package/optimize/lib/components/image/image.js +4 -2
  38. package/optimize/lib/components/image/image_fullscreen_wrapper.js +3 -1
  39. package/optimize/lib/components/image/image_wrapper.js +3 -1
  40. package/optimize/lib/components/markdown_editor/markdown_format.styles.js +1 -4
  41. package/optimize/lib/components/text/text.styles.js +5 -2
  42. package/optimize/lib/components/tool_tip/tool_tip.js +16 -1
  43. package/optimize/lib/components/tour/tour.styles.js +1 -1
  44. package/package.json +2 -2
  45. package/src/components/markdown_editor/_markdown_format.scss +0 -4
  46. package/test-env/components/accordion/accordion.js +1 -1
  47. package/test-env/components/date_picker/super_date_picker/super_date_picker.js +9 -0
  48. package/test-env/components/date_picker/super_date_picker/super_update_button.js +8 -0
  49. package/test-env/components/image/image.js +9 -2
  50. package/test-env/components/image/image_fullscreen_wrapper.js +3 -1
  51. package/test-env/components/image/image_wrapper.js +3 -1
  52. package/test-env/components/markdown_editor/markdown_format.styles.js +1 -4
  53. package/test-env/components/text/text.styles.js +5 -2
  54. package/test-env/components/tool_tip/icon_tip.js +8 -0
  55. package/test-env/components/tool_tip/tool_tip.js +24 -1
  56. package/test-env/components/tour/tour.styles.js +1 -1
@@ -239,7 +239,7 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
239
239
  css: cssSpinnerStyles
240
240
  }), ___EmotionJSX(EuiText, {
241
241
  size: "s"
242
- }, ___EmotionJSX("p", null, isLoadingMessage && isLoadingMessage !== true ? isLoadingMessage : ___EmotionJSX(EuiI18n, {
242
+ }, ___EmotionJSX("p", null, isLoadingMessage !== true ? isLoadingMessage : ___EmotionJSX(EuiI18n, {
243
243
  token: "euiAccordion.isLoading",
244
244
  default: "Loading"
245
245
  }))));
@@ -693,6 +693,14 @@ EuiSuperDatePickerInternal.propTypes = {
693
693
  */
694
694
  position: PropTypes.oneOf(["top", "right", "bottom", "left"]).isRequired,
695
695
 
696
+ /**
697
+ * When `true`, the tooltip's position is re-calculated when the user
698
+ * scrolls. This supports having fixed-position tooltip anchors.
699
+ *
700
+ * When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
701
+ */
702
+ repositionOnScroll: PropTypes.bool,
703
+
696
704
  /**
697
705
  * If supplied, called when mouse movement causes the tool tip to be
698
706
  * hidden.
@@ -861,6 +869,7 @@ EuiSuperDatePicker.propTypes = {
861
869
  title: PropTypes.node,
862
870
  id: PropTypes.string,
863
871
  position: PropTypes.oneOf(["top", "right", "bottom", "left"]).isRequired,
872
+ repositionOnScroll: PropTypes.bool,
864
873
  onMouseOut: PropTypes.func
865
874
  }),
866
875
  iconOnly: PropTypes.bool,
@@ -281,6 +281,14 @@ EuiSuperUpdateButton.propTypes = {
281
281
  */
282
282
  position: PropTypes.oneOf(["top", "right", "bottom", "left"]).isRequired,
283
283
 
284
+ /**
285
+ * When `true`, the tooltip's position is re-calculated when the user
286
+ * scrolls. This supports having fixed-position tooltip anchors.
287
+ *
288
+ * When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
289
+ */
290
+ repositionOnScroll: PropTypes.bool,
291
+
284
292
  /**
285
293
  * If supplied, called when mouse movement causes the tool tip to be
286
294
  * hidden.
@@ -1,4 +1,4 @@
1
- var _excluded = ["className", "alt", "url", "src", "size", "hasShadow", "style", "wrapperProps", "fullScreenIconColor", "allowFullScreen", "caption", "float", "margin"];
1
+ var _excluded = ["className", "alt", "url", "src", "size", "hasShadow", "style", "wrapperProps", "fullScreenIconColor", "allowFullScreen", "caption", "float", "margin", "onFullScreen"];
2
2
 
3
3
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
 
@@ -55,6 +55,7 @@ export var EuiImage = function EuiImage(_ref) {
55
55
  caption = _ref.caption,
56
56
  float = _ref.float,
57
57
  margin = _ref.margin,
58
+ onFullScreen = _ref.onFullScreen,
58
59
  rest = _objectWithoutProperties(_ref, _excluded);
59
60
 
60
61
  var _useState = useState(false),
@@ -85,7 +86,8 @@ export var EuiImage = function EuiImage(_ref) {
85
86
  alt: alt,
86
87
  caption: caption,
87
88
  float: float,
88
- margin: margin
89
+ margin: margin,
90
+ onFullScreen: onFullScreen
89
91
  };
90
92
 
91
93
  var commonImgProps = _objectSpread({
@@ -157,6 +159,11 @@ EuiImage.propTypes = {
157
159
  */
158
160
  allowFullScreen: PropTypes.bool,
159
161
 
162
+ /**
163
+ * Callback when the image is clicked and `allowFullScreen` is `true`
164
+ */
165
+ onFullScreen: PropTypes.func,
166
+
160
167
  /**
161
168
  * Changes the color of the icon that floats above the image when it can be clicked to fullscreen.
162
169
  * The default value of `light` is fine unless your image has a white background, in which case you should change it to `dark`.
@@ -40,7 +40,8 @@ export var EuiImageFullScreenWrapper = function EuiImageFullScreenWrapper(_ref)
40
40
  setIsFullScreen = _ref.setIsFullScreen,
41
41
  wrapperProps = _ref.wrapperProps,
42
42
  isFullWidth = _ref.isFullWidth,
43
- fullScreenIconColor = _ref.fullScreenIconColor;
43
+ fullScreenIconColor = _ref.fullScreenIconColor,
44
+ onFullScreen = _ref.onFullScreen;
44
45
  var euiTheme = useEuiTheme();
45
46
  var styles = euiImageFullscreenWrapperStyles(euiTheme);
46
47
  var cssStyles = [styles.euiImageFullscreenWrapper];
@@ -56,6 +57,7 @@ export var EuiImageFullScreenWrapper = function EuiImageFullScreenWrapper(_ref)
56
57
 
57
58
  var closeFullScreen = function closeFullScreen() {
58
59
  setIsFullScreen(false);
60
+ onFullScreen === null || onFullScreen === void 0 ? void 0 : onFullScreen(false);
59
61
  };
60
62
 
61
63
  var _useInnerText = useInnerText(),
@@ -39,10 +39,12 @@ export var EuiImageWrapper = function EuiImageWrapper(_ref) {
39
39
  setIsFullScreen = _ref.setIsFullScreen,
40
40
  wrapperProps = _ref.wrapperProps,
41
41
  fullScreenIconColor = _ref.fullScreenIconColor,
42
- isFullWidth = _ref.isFullWidth;
42
+ isFullWidth = _ref.isFullWidth,
43
+ onFullScreen = _ref.onFullScreen;
43
44
 
44
45
  var openFullScreen = function openFullScreen() {
45
46
  setIsFullScreen(true);
47
+ onFullScreen === null || onFullScreen === void 0 ? void 0 : onFullScreen(true);
46
48
  };
47
49
 
48
50
  var classes = classNames('euiImageWrapper', wrapperProps && wrapperProps.className);
@@ -6,7 +6,7 @@
6
6
  * Side Public License, v 1.
7
7
  */
8
8
  import { css } from '@emotion/react';
9
- import { logicalCSS, logicalShorthandCSS, euiFontSize, mathWithUnits } from '../../global_styling';
9
+ import { logicalCSS, euiFontSize, mathWithUnits } from '../../global_styling';
10
10
  /**
11
11
  * Mixins
12
12
  */
@@ -20,16 +20,13 @@ var euiScaleMarkdownFormatText = function euiScaleMarkdownFormatText(euiTheme, o
20
20
  var measurement = options.measurement;
21
21
  var lineHeightSize = measurement === 'em' ? "".concat(lineHeight, "em") : lineHeight; // Custom scales
22
22
 
23
- var blockQuoteBorderWidth = mathWithUnits(fontSize, function (x) {
24
- return x / 4;
25
- });
26
23
  var tablePaddingVertical = mathWithUnits(fontSize, function (x) {
27
24
  return x / 4;
28
25
  });
29
26
  var tablePaddingHorizontal = mathWithUnits(fontSize, function (x) {
30
27
  return x / 2;
31
28
  });
32
- return "\n .euiMarkdownFormat__blockquote {\n ".concat(logicalShorthandCSS('padding', "0 ".concat(fontSize)), "\n ").concat(logicalCSS('border-left-width', blockQuoteBorderWidth), "\n ").concat(logicalCSS('margin-bottom', fontSize), "\n }\n\n .euiCheckbox .euiCheckbox__input ~ .euiCheckbox__label { // Extra specificity necessary to override default checkbox CSS\n font-size: ").concat(fontSize, ";\n ").concat(logicalCSS('padding-left', lineHeightSize), "\n line-height: ").concat(lineHeight, ";\n }\n\n .euiCheckbox + *:not(.euiCheckbox) {\n ").concat(logicalCSS('margin-top', fontSize), "\n }\n\n .euiMarkdownFormat__codeblockWrapper {\n ").concat(logicalCSS('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table {\n ").concat(logicalCSS('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table th,\n .euiMarkdownFormat__table td {\n ").concat(logicalCSS('padding-vertical', tablePaddingVertical), "\n ").concat(logicalCSS('padding-horizontal', tablePaddingHorizontal), "\n }\n ");
29
+ return "\n .euiCheckbox .euiCheckbox__input ~ .euiCheckbox__label { // Extra specificity necessary to override default checkbox CSS\n font-size: ".concat(fontSize, ";\n ").concat(logicalCSS('padding-left', lineHeightSize), "\n line-height: ").concat(lineHeight, ";\n }\n\n .euiCheckbox + *:not(.euiCheckbox) {\n ").concat(logicalCSS('margin-top', fontSize), "\n }\n\n .euiMarkdownFormat__codeblockWrapper {\n ").concat(logicalCSS('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table {\n ").concat(logicalCSS('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table th,\n .euiMarkdownFormat__table td {\n ").concat(logicalCSS('padding-vertical', tablePaddingVertical), "\n ").concat(logicalCSS('padding-horizontal', tablePaddingHorizontal), "\n }\n ");
33
30
  };
34
31
  /**
35
32
  * Styles
@@ -6,7 +6,7 @@
6
6
  * Side Public License, v 1.
7
7
  */
8
8
  import { css } from '@emotion/react';
9
- import { logicalCSS, logicalTextAlignCSS, euiFontSize, euiBackgroundColor, mathWithUnits } from '../../global_styling';
9
+ import { logicalCSS, logicalShorthandCSS, logicalTextAlignCSS, euiFontSize, euiBackgroundColor, mathWithUnits } from '../../global_styling';
10
10
  import { euiLinkCSS } from '../link/link.styles';
11
11
  import { euiTitle } from '../title/title.styles';
12
12
  /**
@@ -50,7 +50,10 @@ var euiScaleText = function euiScaleText(euiThemeContext, options) {
50
50
  return x * 2;
51
51
  });
52
52
  var headingMarginBottom = marginSize;
53
- return "\n font-size: ".concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n\n h1 {\n font-size: ").concat(headings.h1.fontSize, ";\n line-height: ").concat(headings.h1.lineHeight, ";\n }\n h1:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n\n h2 {\n font-size: ").concat(headings.h2.fontSize, ";\n line-height: ").concat(headings.h2.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h3 {\n font-size: ").concat(headings.h3.fontSize, ";\n line-height: ").concat(headings.h3.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h4 {\n font-size: ").concat(headings.h4.fontSize, ";\n line-height: ").concat(headings.h4.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h5 {\n font-size: ").concat(headings.h5.fontSize, ";\n line-height: ").concat(headings.h5.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h6 {\n font-size: ").concat(headings.h6.fontSize, ";\n line-height: ").concat(headings.h6.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n p,\n ul,\n ol,\n dl,\n blockquote,\n img,\n pre {\n ").concat(logicalCSS('margin-bottom', lineHeightSize), "\n }\n\n ul,\n ol {\n ").concat(logicalCSS('margin-left', lineHeightSize), "\n }\n \n blockquote {\n font-size: ").concat(fontSize, ";\n padding: ").concat(lineHeightSize, ";\n }\n\n dd + dt {\n ").concat(logicalCSS('margin-top', fontSize), "\n }\n\n dt,\n .eui-definitionListReverse dd {\n font-size: ").concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n }\n\n .eui-definitionListReverse dt {\n font-size: ").concat(euiFontSize(euiThemeContext, 'xs', options).fontSize, ";\n color: ").concat(euiTheme.colors.text, ";\n }\n\n small {\n font-size: ").concat(euiFontSize(euiThemeContext, 's', options).fontSize, ";\n }\n\n pre:not(.euiCodeBlock__pre) {\n padding: ").concat(lineHeightSize, ";\n }\n\n code:not(.euiCode):not(.euiCodeBlock__code) {\n font-size: .9em; // 90% of parent font size\n }\n ").concat( // when textSize is 'm', the 'kbd' element gets a line between the text and the border-bottom
53
+ var blockQuoteBorderWidth = mathWithUnits(fontSize, function (x) {
54
+ return x / 4;
55
+ });
56
+ return "\n font-size: ".concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n\n h1 {\n font-size: ").concat(headings.h1.fontSize, ";\n line-height: ").concat(headings.h1.lineHeight, ";\n }\n h1:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n\n h2 {\n font-size: ").concat(headings.h2.fontSize, ";\n line-height: ").concat(headings.h2.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h3 {\n font-size: ").concat(headings.h3.fontSize, ";\n line-height: ").concat(headings.h3.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h4 {\n font-size: ").concat(headings.h4.fontSize, ";\n line-height: ").concat(headings.h4.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h5 {\n font-size: ").concat(headings.h5.fontSize, ";\n line-height: ").concat(headings.h5.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h6 {\n font-size: ").concat(headings.h6.fontSize, ";\n line-height: ").concat(headings.h6.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n p,\n ul,\n ol,\n dl,\n blockquote,\n img,\n pre {\n ").concat(logicalCSS('margin-bottom', lineHeightSize), "\n }\n\n ul,\n ol {\n ").concat(logicalCSS('margin-left', lineHeightSize), "\n }\n \n blockquote {\n font-size: ").concat(fontSize, ";\n ").concat(logicalShorthandCSS('padding', "0 ".concat(fontSize)), "\n ").concat(logicalCSS('border-left-width', blockQuoteBorderWidth), "\n ").concat(logicalCSS('margin-bottom', fontSize), "\n }\n\n dd + dt {\n ").concat(logicalCSS('margin-top', fontSize), "\n }\n\n dt,\n .eui-definitionListReverse dd {\n font-size: ").concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n }\n\n .eui-definitionListReverse dt {\n font-size: ").concat(euiFontSize(euiThemeContext, 'xs', options).fontSize, ";\n color: ").concat(euiTheme.colors.text, ";\n }\n\n small {\n font-size: ").concat(euiFontSize(euiThemeContext, 's', options).fontSize, ";\n }\n\n pre:not(.euiCodeBlock__pre) {\n padding: ").concat(lineHeightSize, ";\n }\n\n code:not(.euiCode):not(.euiCodeBlock__code) {\n font-size: .9em; // 90% of parent font size\n }\n ").concat( // when textSize is 'm', the 'kbd' element gets a line between the text and the border-bottom
54
57
  _customScale === 'm' ? "\n kbd {\n ".concat(logicalCSS('padding-bottom', euiTheme.size.xs), "\n // ensures when only one character the shape looks like a square\n ").concat(logicalCSS('min-width', euiTheme.size.l), "\n ").concat(logicalTextAlignCSS('center'), "\n }\n \n kbd::after {\n content: '';\n ").concat(logicalCSS('border-bottom', "".concat(euiTheme.border.width.thin, " solid ").concat(euiTheme.colors.text)), "\n position: absolute;\n ").concat(logicalCSS('bottom', euiTheme.size.xxs), "\n ").concat(logicalCSS('left', 0), "\n ").concat(logicalCSS('width', '100%'), "\n }") : '', "\n ");
55
58
  };
56
59
  /**
@@ -61,7 +64,7 @@ var euiScaleText = function euiScaleText(euiThemeContext, options) {
61
64
  export var euiTextStyles = function euiTextStyles(euiThemeContext) {
62
65
  var euiTheme = euiThemeContext.euiTheme;
63
66
  return {
64
- euiText: /*#__PURE__*/css(euiText(euiTheme, true), ";clear:both;a:not([class]){", euiLinkCSS(euiThemeContext), ";}img{display:block;", logicalCSS('max-width', '100%'), ";}ul{list-style:disc;}ol{list-style:decimal;}blockquote:not(.euiMarkdownFormat__blockquote){position:relative;", logicalTextAlignCSS('center'), " ", logicalCSS('margin-horizontal', 'auto'), " font-family:", euiTheme.font.familySerif, ";font-style:italic;letter-spacing:normal;p:last-child{", logicalCSS('margin-bottom', '0'), ";}&:before,&:after{position:absolute;content:'';", logicalCSS('height', euiTheme.border.width.thick), " ", logicalCSS('width', '50%'), " ", logicalCSS('left', '25%'), " ", logicalCSS('right', '25%'), " background:", euiTheme.colors.darkShade, ";}&:before{", logicalCSS('top', '0'), ";}&:after{", logicalCSS('bottom', '0'), ";}}h1{", euiTitle(euiThemeContext, 'l'), ";}h2{", euiTitle(euiThemeContext, 'm'), ";}h3{", euiTitle(euiThemeContext, 's'), ";}h4,dt{", euiTitle(euiThemeContext, 'xs'), ";}h5{", euiTitle(euiThemeContext, 'xxs'), ";}h6{", euiTitle(euiThemeContext, 'xxxs'), " text-transform:uppercase;}h1,h2,h3,h4,h5,h6,dt{color:inherit;}pre:not(.euiCodeBlock__pre){white-space:pre-wrap;background:", euiBackgroundColor(euiThemeContext, 'subdued'), ";color:", euiTheme.colors.text, ";}pre:not(.euiCodeBlock__pre),pre:not(.euiCodeBlock__pre) code{display:block;}>:last-child{", logicalCSS('margin-bottom', '0 !important'), ";}kbd{position:relative;display:inline-block;", logicalCSS('padding-vertical', euiTheme.size.xxs), " ", logicalCSS('padding-horizontal', euiTheme.size.xs), " line-height:1;border:", euiTheme.border.width.thin, " solid ", euiTheme.colors.text, ";border-radius:", mathWithUnits(euiTheme.border.radius.small, function (x) {
67
+ euiText: /*#__PURE__*/css(euiText(euiTheme, true), ";clear:both;a:not([class]){", euiLinkCSS(euiThemeContext), ";}img{display:block;", logicalCSS('max-width', '100%'), ";}ul{list-style:disc;}ol{list-style:decimal;}blockquote{border-inline-start-color:", euiTheme.border.color, ";border-inline-start-style:solid;}blockquote:not(.euiMarkdownFormat__blockquote){color:", euiTheme.colors.subduedText, ";}h1{", euiTitle(euiThemeContext, 'l'), ";}h2{", euiTitle(euiThemeContext, 'm'), ";}h3{", euiTitle(euiThemeContext, 's'), ";}h4,dt{", euiTitle(euiThemeContext, 'xs'), ";}h5{", euiTitle(euiThemeContext, 'xxs'), ";}h6{", euiTitle(euiThemeContext, 'xxxs'), " text-transform:uppercase;}h1,h2,h3,h4,h5,h6,dt{color:inherit;}pre:not(.euiCodeBlock__pre){white-space:pre-wrap;background:", euiBackgroundColor(euiThemeContext, 'subdued'), ";color:", euiTheme.colors.text, ";}pre:not(.euiCodeBlock__pre),pre:not(.euiCodeBlock__pre) code{display:block;}>:last-child{", logicalCSS('margin-bottom', '0 !important'), ";}kbd{position:relative;display:inline-block;", logicalCSS('padding-vertical', euiTheme.size.xxs), " ", logicalCSS('padding-horizontal', euiTheme.size.xs), " line-height:1;border:", euiTheme.border.width.thin, " solid ", euiTheme.colors.text, ";border-radius:", mathWithUnits(euiTheme.border.radius.small, function (x) {
65
68
  return x / 2;
66
69
  }), ";};label:euiText;"),
67
70
  constrainedWidth: /*#__PURE__*/css(logicalCSS('max-width', euiTextConstrainedMaxWidth), ";;label:constrainedWidth;"),
@@ -84,6 +84,14 @@ EuiIconTip.propTypes = {
84
84
  */
85
85
  id: PropTypes.string,
86
86
 
87
+ /**
88
+ * When `true`, the tooltip's position is re-calculated when the user
89
+ * scrolls. This supports having fixed-position tooltip anchors.
90
+ *
91
+ * When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
92
+ */
93
+ repositionOnScroll: PropTypes.bool,
94
+
87
95
  /**
88
96
  * If supplied, called when mouse movement causes the tool tip to be
89
97
  * hidden.
@@ -1,6 +1,6 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
2
2
 
3
- var _excluded = ["children", "className", "anchorClassName", "anchorProps", "content", "title", "delay", "display"];
3
+ var _excluded = ["children", "className", "anchorClassName", "anchorProps", "content", "title", "delay", "display", "repositionOnScroll"];
4
4
 
5
5
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
6
6
 
@@ -246,18 +246,32 @@ export var EuiToolTip = /*#__PURE__*/function (_Component) {
246
246
  key: "componentDidMount",
247
247
  value: function componentDidMount() {
248
248
  this._isMounted = true;
249
+
250
+ if (this.props.repositionOnScroll) {
251
+ window.addEventListener('scroll', this.positionToolTip, true);
252
+ }
249
253
  }
250
254
  }, {
251
255
  key: "componentWillUnmount",
252
256
  value: function componentWillUnmount() {
253
257
  this.clearAnimationTimeout();
254
258
  this._isMounted = false;
259
+ window.removeEventListener('scroll', this.positionToolTip, true);
255
260
  }
256
261
  }, {
257
262
  key: "componentDidUpdate",
258
263
  value: function componentDidUpdate(prevProps, prevState) {
259
264
  if (prevState.visible === false && this.state.visible === true) {
260
265
  requestAnimationFrame(this.testAnchor);
266
+ } // update scroll listener
267
+
268
+
269
+ if (prevProps.repositionOnScroll !== this.props.repositionOnScroll) {
270
+ if (this.props.repositionOnScroll) {
271
+ window.addEventListener('scroll', this.positionToolTip, true);
272
+ } else {
273
+ window.removeEventListener('scroll', this.positionToolTip, true);
274
+ }
261
275
  }
262
276
  }
263
277
  }, {
@@ -272,6 +286,7 @@ export var EuiToolTip = /*#__PURE__*/function (_Component) {
272
286
  title = _this$props.title,
273
287
  delay = _this$props.delay,
274
288
  display = _this$props.display,
289
+ repositionOnScroll = _this$props.repositionOnScroll,
275
290
  rest = _objectWithoutProperties(_this$props, _excluded);
276
291
 
277
292
  var _this$state = this.state,
@@ -380,6 +395,14 @@ EuiToolTip.propTypes = {
380
395
  */
381
396
  position: PropTypes.oneOf(["top", "right", "bottom", "left"]).isRequired,
382
397
 
398
+ /**
399
+ * When `true`, the tooltip's position is re-calculated when the user
400
+ * scrolls. This supports having fixed-position tooltip anchors.
401
+ *
402
+ * When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
403
+ */
404
+ repositionOnScroll: PropTypes.bool,
405
+
383
406
  /**
384
407
  * If supplied, called when mouse movement causes the tool tip to be
385
408
  * hidden.
@@ -50,7 +50,7 @@ export var euiTourHeaderStyles = function euiTourHeaderStyles(_ref3) {
50
50
  euiTourHeader: /*#__PURE__*/css(logicalCSS('border-bottom', 'none'), ";", logicalCSS('margin-bottom', euiTheme.size.s), ";;label:euiTourHeader;"),
51
51
  // Elements
52
52
  euiTourHeader__title: /*#__PURE__*/css(logicalCSS('margin-top', 0), ";;label:euiTourHeader__title;"),
53
- euiTourHeader__subtitle: /*#__PURE__*/css("color:", euiTheme.colors.subduedText, ";;label:euiTourHeader__subtitle;")
53
+ euiTourHeader__subtitle: /*#__PURE__*/css("color:", euiTheme.colors.subduedText, ";padding-block-end:", euiTheme.size.xs, ";;label:euiTourHeader__subtitle;")
54
54
  };
55
55
  };
56
56
  export var euiTourFooterStyles = function euiTourFooterStyles(_ref4) {
package/eui.d.ts CHANGED
@@ -5753,6 +5753,13 @@ declare module '@elastic/eui/src/components/tool_tip/tool_tip' {
5753
5753
  * Suggested position. If there is not enough room for it this will be changed.
5754
5754
  */
5755
5755
  position: ToolTipPositions;
5756
+ /**
5757
+ * When `true`, the tooltip's position is re-calculated when the user
5758
+ * scrolls. This supports having fixed-position tooltip anchors.
5759
+ *
5760
+ * When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
5761
+ */
5762
+ repositionOnScroll?: boolean;
5756
5763
  /**
5757
5764
  * If supplied, called when mouse movement causes the tool tip to be
5758
5765
  * hidden.
@@ -15123,6 +15130,10 @@ declare module '@elastic/eui/src/components/image/image_types' {
15123
15130
  * When set to `true` will make the image clickable to a larger version
15124
15131
  */
15125
15132
  allowFullScreen?: boolean;
15133
+ /**
15134
+ * Callback when the image is clicked and `allowFullScreen` is `true`
15135
+ */
15136
+ onFullScreen?: (isFullScreen: boolean) => void;
15126
15137
  /**
15127
15138
  * Changes the color of the icon that floats above the image when it can be clicked to fullscreen.
15128
15139
  * The default value of `light` is fine unless your image has a white background, in which case you should change it to `dark`.
@@ -15133,7 +15144,7 @@ declare module '@elastic/eui/src/components/image/image_types' {
15133
15144
  */
15134
15145
  wrapperProps?: CommonProps & HTMLAttributes<HTMLDivElement>;
15135
15146
  };
15136
- export type EuiImageWrapperProps = Pick<EuiImageProps, 'alt' | 'caption' | 'float' | 'margin' | 'hasShadow' | 'wrapperProps' | 'fullScreenIconColor' | 'allowFullScreen'> & {
15147
+ export type EuiImageWrapperProps = Pick<EuiImageProps, 'alt' | 'caption' | 'float' | 'margin' | 'hasShadow' | 'wrapperProps' | 'fullScreenIconColor' | 'allowFullScreen' | 'onFullScreen'> & {
15137
15148
  isFullWidth: boolean;
15138
15149
  setIsFullScreen: (isFullScreen: boolean) => void;
15139
15150
  };
@@ -260,7 +260,7 @@ var EuiAccordionClass = /*#__PURE__*/function (_Component) {
260
260
  css: cssSpinnerStyles
261
261
  }), (0, _react2.jsx)(_text.EuiText, {
262
262
  size: "s"
263
- }, (0, _react2.jsx)("p", null, isLoadingMessage && isLoadingMessage !== true ? isLoadingMessage : (0, _react2.jsx)(_i18n.EuiI18n, {
263
+ }, (0, _react2.jsx)("p", null, isLoadingMessage !== true ? isLoadingMessage : (0, _react2.jsx)(_i18n.EuiI18n, {
264
264
  token: "euiAccordion.isLoading",
265
265
  default: "Loading"
266
266
  }))));
@@ -717,6 +717,14 @@ EuiSuperDatePickerInternal.propTypes = {
717
717
  */
718
718
  position: _propTypes.default.oneOf(["top", "right", "bottom", "left"]).isRequired,
719
719
 
720
+ /**
721
+ * When `true`, the tooltip's position is re-calculated when the user
722
+ * scrolls. This supports having fixed-position tooltip anchors.
723
+ *
724
+ * When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
725
+ */
726
+ repositionOnScroll: _propTypes.default.bool,
727
+
720
728
  /**
721
729
  * If supplied, called when mouse movement causes the tool tip to be
722
730
  * hidden.
@@ -888,6 +896,7 @@ EuiSuperDatePicker.propTypes = {
888
896
  title: _propTypes.default.node,
889
897
  id: _propTypes.default.string,
890
898
  position: _propTypes.default.oneOf(["top", "right", "bottom", "left"]).isRequired,
899
+ repositionOnScroll: _propTypes.default.bool,
891
900
  onMouseOut: _propTypes.default.func
892
901
  }),
893
902
  iconOnly: _propTypes.default.bool,
@@ -296,6 +296,14 @@ EuiSuperUpdateButton.propTypes = {
296
296
  */
297
297
  position: _propTypes.default.oneOf(["top", "right", "bottom", "left"]).isRequired,
298
298
 
299
+ /**
300
+ * When `true`, the tooltip's position is re-calculated when the user
301
+ * scrolls. This supports having fixed-position tooltip anchors.
302
+ *
303
+ * When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
304
+ */
305
+ repositionOnScroll: _propTypes.default.bool,
306
+
299
307
  /**
300
308
  * If supplied, called when mouse movement causes the tool tip to be
301
309
  * hidden.
@@ -25,7 +25,7 @@ var _image_types = require("./image_types");
25
25
 
26
26
  var _react2 = require("@emotion/react");
27
27
 
28
- var _excluded = ["className", "alt", "url", "src", "size", "hasShadow", "style", "wrapperProps", "fullScreenIconColor", "allowFullScreen", "caption", "float", "margin"];
28
+ var _excluded = ["className", "alt", "url", "src", "size", "hasShadow", "style", "wrapperProps", "fullScreenIconColor", "allowFullScreen", "caption", "float", "margin", "onFullScreen"];
29
29
 
30
30
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
31
 
@@ -72,6 +72,7 @@ var EuiImage = function EuiImage(_ref) {
72
72
  caption = _ref.caption,
73
73
  float = _ref.float,
74
74
  margin = _ref.margin,
75
+ onFullScreen = _ref.onFullScreen,
75
76
  rest = _objectWithoutProperties(_ref, _excluded);
76
77
 
77
78
  var _useState = (0, _react.useState)(false),
@@ -103,7 +104,8 @@ var EuiImage = function EuiImage(_ref) {
103
104
  alt: alt,
104
105
  caption: caption,
105
106
  float: float,
106
- margin: margin
107
+ margin: margin,
108
+ onFullScreen: onFullScreen
107
109
  };
108
110
 
109
111
  var commonImgProps = _objectSpread({
@@ -177,6 +179,11 @@ EuiImage.propTypes = {
177
179
  */
178
180
  allowFullScreen: _propTypes.default.bool,
179
181
 
182
+ /**
183
+ * Callback when the image is clicked and `allowFullScreen` is `true`
184
+ */
185
+ onFullScreen: _propTypes.default.func,
186
+
180
187
  /**
181
188
  * Changes the color of the icon that floats above the image when it can be clicked to fullscreen.
182
189
  * The default value of `light` is fine unless your image has a white background, in which case you should change it to `dark`.
@@ -55,7 +55,8 @@ var EuiImageFullScreenWrapper = function EuiImageFullScreenWrapper(_ref) {
55
55
  setIsFullScreen = _ref.setIsFullScreen,
56
56
  wrapperProps = _ref.wrapperProps,
57
57
  isFullWidth = _ref.isFullWidth,
58
- fullScreenIconColor = _ref.fullScreenIconColor;
58
+ fullScreenIconColor = _ref.fullScreenIconColor,
59
+ onFullScreen = _ref.onFullScreen;
59
60
  var euiTheme = (0, _services.useEuiTheme)();
60
61
  var styles = (0, _image_fullscreen_wrapper.euiImageFullscreenWrapperStyles)(euiTheme);
61
62
  var cssStyles = [styles.euiImageFullscreenWrapper];
@@ -71,6 +72,7 @@ var EuiImageFullScreenWrapper = function EuiImageFullScreenWrapper(_ref) {
71
72
 
72
73
  var closeFullScreen = function closeFullScreen() {
73
74
  setIsFullScreen(false);
75
+ onFullScreen === null || onFullScreen === void 0 ? void 0 : onFullScreen(false);
74
76
  };
75
77
 
76
78
  var _useInnerText = (0, _inner_text.useInnerText)(),
@@ -50,10 +50,12 @@ var EuiImageWrapper = function EuiImageWrapper(_ref) {
50
50
  setIsFullScreen = _ref.setIsFullScreen,
51
51
  wrapperProps = _ref.wrapperProps,
52
52
  fullScreenIconColor = _ref.fullScreenIconColor,
53
- isFullWidth = _ref.isFullWidth;
53
+ isFullWidth = _ref.isFullWidth,
54
+ onFullScreen = _ref.onFullScreen;
54
55
 
55
56
  var openFullScreen = function openFullScreen() {
56
57
  setIsFullScreen(true);
58
+ onFullScreen === null || onFullScreen === void 0 ? void 0 : onFullScreen(true);
57
59
  };
58
60
 
59
61
  var classes = (0, _classnames.default)('euiImageWrapper', wrapperProps && wrapperProps.className);
@@ -29,16 +29,13 @@ var euiScaleMarkdownFormatText = function euiScaleMarkdownFormatText(euiTheme, o
29
29
  var measurement = options.measurement;
30
30
  var lineHeightSize = measurement === 'em' ? "".concat(lineHeight, "em") : lineHeight; // Custom scales
31
31
 
32
- var blockQuoteBorderWidth = (0, _global_styling.mathWithUnits)(fontSize, function (x) {
33
- return x / 4;
34
- });
35
32
  var tablePaddingVertical = (0, _global_styling.mathWithUnits)(fontSize, function (x) {
36
33
  return x / 4;
37
34
  });
38
35
  var tablePaddingHorizontal = (0, _global_styling.mathWithUnits)(fontSize, function (x) {
39
36
  return x / 2;
40
37
  });
41
- return "\n .euiMarkdownFormat__blockquote {\n ".concat((0, _global_styling.logicalShorthandCSS)('padding', "0 ".concat(fontSize)), "\n ").concat((0, _global_styling.logicalCSS)('border-left-width', blockQuoteBorderWidth), "\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', fontSize), "\n }\n\n .euiCheckbox .euiCheckbox__input ~ .euiCheckbox__label { // Extra specificity necessary to override default checkbox CSS\n font-size: ").concat(fontSize, ";\n ").concat((0, _global_styling.logicalCSS)('padding-left', lineHeightSize), "\n line-height: ").concat(lineHeight, ";\n }\n\n .euiCheckbox + *:not(.euiCheckbox) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', fontSize), "\n }\n\n .euiMarkdownFormat__codeblockWrapper {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table th,\n .euiMarkdownFormat__table td {\n ").concat((0, _global_styling.logicalCSS)('padding-vertical', tablePaddingVertical), "\n ").concat((0, _global_styling.logicalCSS)('padding-horizontal', tablePaddingHorizontal), "\n }\n ");
38
+ return "\n .euiCheckbox .euiCheckbox__input ~ .euiCheckbox__label { // Extra specificity necessary to override default checkbox CSS\n font-size: ".concat(fontSize, ";\n ").concat((0, _global_styling.logicalCSS)('padding-left', lineHeightSize), "\n line-height: ").concat(lineHeight, ";\n }\n\n .euiCheckbox + *:not(.euiCheckbox) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', fontSize), "\n }\n\n .euiMarkdownFormat__codeblockWrapper {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table th,\n .euiMarkdownFormat__table td {\n ").concat((0, _global_styling.logicalCSS)('padding-vertical', tablePaddingVertical), "\n ").concat((0, _global_styling.logicalCSS)('padding-horizontal', tablePaddingHorizontal), "\n }\n ");
42
39
  };
43
40
  /**
44
41
  * Styles
@@ -66,7 +66,10 @@ var euiScaleText = function euiScaleText(euiThemeContext, options) {
66
66
  return x * 2;
67
67
  });
68
68
  var headingMarginBottom = marginSize;
69
- return "\n font-size: ".concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n\n h1 {\n font-size: ").concat(headings.h1.fontSize, ";\n line-height: ").concat(headings.h1.lineHeight, ";\n }\n h1:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n\n h2 {\n font-size: ").concat(headings.h2.fontSize, ";\n line-height: ").concat(headings.h2.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h3 {\n font-size: ").concat(headings.h3.fontSize, ";\n line-height: ").concat(headings.h3.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h4 {\n font-size: ").concat(headings.h4.fontSize, ";\n line-height: ").concat(headings.h4.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h5 {\n font-size: ").concat(headings.h5.fontSize, ";\n line-height: ").concat(headings.h5.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h6 {\n font-size: ").concat(headings.h6.fontSize, ";\n line-height: ").concat(headings.h6.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n p,\n ul,\n ol,\n dl,\n blockquote,\n img,\n pre {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', lineHeightSize), "\n }\n\n ul,\n ol {\n ").concat((0, _global_styling.logicalCSS)('margin-left', lineHeightSize), "\n }\n \n blockquote {\n font-size: ").concat(fontSize, ";\n padding: ").concat(lineHeightSize, ";\n }\n\n dd + dt {\n ").concat((0, _global_styling.logicalCSS)('margin-top', fontSize), "\n }\n\n dt,\n .eui-definitionListReverse dd {\n font-size: ").concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n }\n\n .eui-definitionListReverse dt {\n font-size: ").concat((0, _global_styling.euiFontSize)(euiThemeContext, 'xs', options).fontSize, ";\n color: ").concat(euiTheme.colors.text, ";\n }\n\n small {\n font-size: ").concat((0, _global_styling.euiFontSize)(euiThemeContext, 's', options).fontSize, ";\n }\n\n pre:not(.euiCodeBlock__pre) {\n padding: ").concat(lineHeightSize, ";\n }\n\n code:not(.euiCode):not(.euiCodeBlock__code) {\n font-size: .9em; // 90% of parent font size\n }\n ").concat( // when textSize is 'm', the 'kbd' element gets a line between the text and the border-bottom
69
+ var blockQuoteBorderWidth = (0, _global_styling.mathWithUnits)(fontSize, function (x) {
70
+ return x / 4;
71
+ });
72
+ return "\n font-size: ".concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n\n h1 {\n font-size: ").concat(headings.h1.fontSize, ";\n line-height: ").concat(headings.h1.lineHeight, ";\n }\n h1:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n\n h2 {\n font-size: ").concat(headings.h2.fontSize, ";\n line-height: ").concat(headings.h2.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h3 {\n font-size: ").concat(headings.h3.fontSize, ";\n line-height: ").concat(headings.h3.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h4 {\n font-size: ").concat(headings.h4.fontSize, ";\n line-height: ").concat(headings.h4.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h5 {\n font-size: ").concat(headings.h5.fontSize, ";\n line-height: ").concat(headings.h5.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h6 {\n font-size: ").concat(headings.h6.fontSize, ";\n line-height: ").concat(headings.h6.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n p,\n ul,\n ol,\n dl,\n blockquote,\n img,\n pre {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', lineHeightSize), "\n }\n\n ul,\n ol {\n ").concat((0, _global_styling.logicalCSS)('margin-left', lineHeightSize), "\n }\n \n blockquote {\n font-size: ").concat(fontSize, ";\n ").concat((0, _global_styling.logicalShorthandCSS)('padding', "0 ".concat(fontSize)), "\n ").concat((0, _global_styling.logicalCSS)('border-left-width', blockQuoteBorderWidth), "\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', fontSize), "\n }\n\n dd + dt {\n ").concat((0, _global_styling.logicalCSS)('margin-top', fontSize), "\n }\n\n dt,\n .eui-definitionListReverse dd {\n font-size: ").concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n }\n\n .eui-definitionListReverse dt {\n font-size: ").concat((0, _global_styling.euiFontSize)(euiThemeContext, 'xs', options).fontSize, ";\n color: ").concat(euiTheme.colors.text, ";\n }\n\n small {\n font-size: ").concat((0, _global_styling.euiFontSize)(euiThemeContext, 's', options).fontSize, ";\n }\n\n pre:not(.euiCodeBlock__pre) {\n padding: ").concat(lineHeightSize, ";\n }\n\n code:not(.euiCode):not(.euiCodeBlock__code) {\n font-size: .9em; // 90% of parent font size\n }\n ").concat( // when textSize is 'm', the 'kbd' element gets a line between the text and the border-bottom
70
73
  _customScale === 'm' ? "\n kbd {\n ".concat((0, _global_styling.logicalCSS)('padding-bottom', euiTheme.size.xs), "\n // ensures when only one character the shape looks like a square\n ").concat((0, _global_styling.logicalCSS)('min-width', euiTheme.size.l), "\n ").concat((0, _global_styling.logicalTextAlignCSS)('center'), "\n }\n \n kbd::after {\n content: '';\n ").concat((0, _global_styling.logicalCSS)('border-bottom', "".concat(euiTheme.border.width.thin, " solid ").concat(euiTheme.colors.text)), "\n position: absolute;\n ").concat((0, _global_styling.logicalCSS)('bottom', euiTheme.size.xxs), "\n ").concat((0, _global_styling.logicalCSS)('left', 0), "\n ").concat((0, _global_styling.logicalCSS)('width', '100%'), "\n }") : '', "\n ");
71
74
  };
72
75
  /**
@@ -77,7 +80,7 @@ var euiScaleText = function euiScaleText(euiThemeContext, options) {
77
80
  var euiTextStyles = function euiTextStyles(euiThemeContext) {
78
81
  var euiTheme = euiThemeContext.euiTheme;
79
82
  return {
80
- 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:", (0, _global_styling.mathWithUnits)(euiTheme.border.radius.small, function (x) {
83
+ 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{border-inline-start-color:", euiTheme.border.color, ";border-inline-start-style:solid;}blockquote:not(.euiMarkdownFormat__blockquote){color:", euiTheme.colors.subduedText, ";}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:", (0, _global_styling.mathWithUnits)(euiTheme.border.radius.small, function (x) {
81
84
  return x / 2;
82
85
  }), ";};label:euiText;"),
83
86
  constrainedWidth: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-width', euiTextConstrainedMaxWidth), ";;label:constrainedWidth;"),
@@ -93,6 +93,14 @@ EuiIconTip.propTypes = {
93
93
  */
94
94
  id: _propTypes.default.string,
95
95
 
96
+ /**
97
+ * When `true`, the tooltip's position is re-calculated when the user
98
+ * scrolls. This supports having fixed-position tooltip anchors.
99
+ *
100
+ * When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
101
+ */
102
+ repositionOnScroll: _propTypes.default.bool,
103
+
96
104
  /**
97
105
  * If supplied, called when mouse movement causes the tool tip to be
98
106
  * hidden.
@@ -31,7 +31,7 @@ var _resize_observer = require("../observer/resize_observer");
31
31
 
32
32
  var _react3 = require("@emotion/react");
33
33
 
34
- var _excluded = ["children", "className", "anchorClassName", "anchorProps", "content", "title", "delay", "display"];
34
+ var _excluded = ["children", "className", "anchorClassName", "anchorProps", "content", "title", "delay", "display", "repositionOnScroll"];
35
35
 
36
36
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
37
37
 
@@ -266,18 +266,32 @@ var EuiToolTip = /*#__PURE__*/function (_Component) {
266
266
  key: "componentDidMount",
267
267
  value: function componentDidMount() {
268
268
  this._isMounted = true;
269
+
270
+ if (this.props.repositionOnScroll) {
271
+ window.addEventListener('scroll', this.positionToolTip, true);
272
+ }
269
273
  }
270
274
  }, {
271
275
  key: "componentWillUnmount",
272
276
  value: function componentWillUnmount() {
273
277
  this.clearAnimationTimeout();
274
278
  this._isMounted = false;
279
+ window.removeEventListener('scroll', this.positionToolTip, true);
275
280
  }
276
281
  }, {
277
282
  key: "componentDidUpdate",
278
283
  value: function componentDidUpdate(prevProps, prevState) {
279
284
  if (prevState.visible === false && this.state.visible === true) {
280
285
  requestAnimationFrame(this.testAnchor);
286
+ } // update scroll listener
287
+
288
+
289
+ if (prevProps.repositionOnScroll !== this.props.repositionOnScroll) {
290
+ if (this.props.repositionOnScroll) {
291
+ window.addEventListener('scroll', this.positionToolTip, true);
292
+ } else {
293
+ window.removeEventListener('scroll', this.positionToolTip, true);
294
+ }
281
295
  }
282
296
  }
283
297
  }, {
@@ -292,6 +306,7 @@ var EuiToolTip = /*#__PURE__*/function (_Component) {
292
306
  title = _this$props.title,
293
307
  delay = _this$props.delay,
294
308
  display = _this$props.display,
309
+ repositionOnScroll = _this$props.repositionOnScroll,
295
310
  rest = _objectWithoutProperties(_this$props, _excluded);
296
311
 
297
312
  var _this$state = this.state,
@@ -402,6 +417,14 @@ EuiToolTip.propTypes = {
402
417
  */
403
418
  position: _propTypes.default.oneOf(["top", "right", "bottom", "left"]).isRequired,
404
419
 
420
+ /**
421
+ * When `true`, the tooltip's position is re-calculated when the user
422
+ * scrolls. This supports having fixed-position tooltip anchors.
423
+ *
424
+ * When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
425
+ */
426
+ repositionOnScroll: _propTypes.default.bool,
427
+
405
428
  /**
406
429
  * If supplied, called when mouse movement causes the tool tip to be
407
430
  * hidden.
@@ -67,7 +67,7 @@ var euiTourHeaderStyles = function euiTourHeaderStyles(_ref3) {
67
67
  euiTourHeader: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-bottom', 'none'), ";", (0, _global_styling.logicalCSS)('margin-bottom', euiTheme.size.s), ";;label:euiTourHeader;"),
68
68
  // Elements
69
69
  euiTourHeader__title: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-top', 0), ";;label:euiTourHeader__title;"),
70
- euiTourHeader__subtitle: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.subduedText, ";;label:euiTourHeader__subtitle;")
70
+ euiTourHeader__subtitle: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.subduedText, ";padding-block-end:", euiTheme.size.xs, ";;label:euiTourHeader__subtitle;")
71
71
  };
72
72
  };
73
73
 
@@ -221,7 +221,7 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
221
221
  css: cssSpinnerStyles
222
222
  }), ___EmotionJSX(EuiText, {
223
223
  size: "s"
224
- }, ___EmotionJSX("p", null, isLoadingMessage && isLoadingMessage !== true ? isLoadingMessage : ___EmotionJSX(EuiI18n, {
224
+ }, ___EmotionJSX("p", null, isLoadingMessage !== true ? isLoadingMessage : ___EmotionJSX(EuiI18n, {
225
225
  token: "euiAccordion.isLoading",
226
226
  default: "Loading"
227
227
  }))));