@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
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
5
- var _excluded = ["className", "alt", "url", "src", "size", "hasShadow", "style", "wrapperProps", "fullScreenIconColor", "allowFullScreen", "caption", "float", "margin"];
5
+ var _excluded = ["className", "alt", "url", "src", "size", "hasShadow", "style", "wrapperProps", "fullScreenIconColor", "allowFullScreen", "caption", "float", "margin", "onFullScreen"];
6
6
 
7
7
  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; }
8
8
 
@@ -38,6 +38,7 @@ export var EuiImage = function EuiImage(_ref) {
38
38
  caption = _ref.caption,
39
39
  float = _ref.float,
40
40
  margin = _ref.margin,
41
+ onFullScreen = _ref.onFullScreen,
41
42
  rest = _objectWithoutProperties(_ref, _excluded);
42
43
 
43
44
  var _useState = useState(false),
@@ -68,7 +69,8 @@ export var EuiImage = function EuiImage(_ref) {
68
69
  alt: alt,
69
70
  caption: caption,
70
71
  float: float,
71
- margin: margin
72
+ margin: margin,
73
+ onFullScreen: onFullScreen
72
74
  };
73
75
 
74
76
  var commonImgProps = _objectSpread({
@@ -28,7 +28,8 @@ export var EuiImageFullScreenWrapper = function EuiImageFullScreenWrapper(_ref)
28
28
  setIsFullScreen = _ref.setIsFullScreen,
29
29
  wrapperProps = _ref.wrapperProps,
30
30
  isFullWidth = _ref.isFullWidth,
31
- fullScreenIconColor = _ref.fullScreenIconColor;
31
+ fullScreenIconColor = _ref.fullScreenIconColor,
32
+ onFullScreen = _ref.onFullScreen;
32
33
  var euiTheme = useEuiTheme();
33
34
  var styles = euiImageFullscreenWrapperStyles(euiTheme);
34
35
  var cssStyles = [styles.euiImageFullscreenWrapper];
@@ -44,6 +45,7 @@ export var EuiImageFullScreenWrapper = function EuiImageFullScreenWrapper(_ref)
44
45
 
45
46
  var closeFullScreen = function closeFullScreen() {
46
47
  setIsFullScreen(false);
48
+ onFullScreen === null || onFullScreen === void 0 ? void 0 : onFullScreen(false);
47
49
  };
48
50
 
49
51
  var _useInnerText = useInnerText(),
@@ -27,10 +27,12 @@ export var EuiImageWrapper = function EuiImageWrapper(_ref) {
27
27
  setIsFullScreen = _ref.setIsFullScreen,
28
28
  wrapperProps = _ref.wrapperProps,
29
29
  fullScreenIconColor = _ref.fullScreenIconColor,
30
- isFullWidth = _ref.isFullWidth;
30
+ isFullWidth = _ref.isFullWidth,
31
+ onFullScreen = _ref.onFullScreen;
31
32
 
32
33
  var openFullScreen = function openFullScreen() {
33
34
  setIsFullScreen(true);
35
+ onFullScreen === null || onFullScreen === void 0 ? void 0 : onFullScreen(true);
34
36
  };
35
37
 
36
38
  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;"),
@@ -7,7 +7,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
7
7
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
8
8
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
9
9
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
10
- var _excluded = ["children", "className", "anchorClassName", "anchorProps", "content", "title", "delay", "display"];
10
+ var _excluded = ["children", "className", "anchorClassName", "anchorProps", "content", "title", "delay", "display", "repositionOnScroll"];
11
11
 
12
12
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
13
13
 
@@ -228,18 +228,32 @@ export var EuiToolTip = /*#__PURE__*/function (_Component) {
228
228
  key: "componentDidMount",
229
229
  value: function componentDidMount() {
230
230
  this._isMounted = true;
231
+
232
+ if (this.props.repositionOnScroll) {
233
+ window.addEventListener('scroll', this.positionToolTip, true);
234
+ }
231
235
  }
232
236
  }, {
233
237
  key: "componentWillUnmount",
234
238
  value: function componentWillUnmount() {
235
239
  this.clearAnimationTimeout();
236
240
  this._isMounted = false;
241
+ window.removeEventListener('scroll', this.positionToolTip, true);
237
242
  }
238
243
  }, {
239
244
  key: "componentDidUpdate",
240
245
  value: function componentDidUpdate(prevProps, prevState) {
241
246
  if (prevState.visible === false && this.state.visible === true) {
242
247
  requestAnimationFrame(this.testAnchor);
248
+ } // update scroll listener
249
+
250
+
251
+ if (prevProps.repositionOnScroll !== this.props.repositionOnScroll) {
252
+ if (this.props.repositionOnScroll) {
253
+ window.addEventListener('scroll', this.positionToolTip, true);
254
+ } else {
255
+ window.removeEventListener('scroll', this.positionToolTip, true);
256
+ }
243
257
  }
244
258
  }
245
259
  }, {
@@ -254,6 +268,7 @@ export var EuiToolTip = /*#__PURE__*/function (_Component) {
254
268
  title = _this$props.title,
255
269
  delay = _this$props.delay,
256
270
  display = _this$props.display,
271
+ repositionOnScroll = _this$props.repositionOnScroll,
257
272
  rest = _objectWithoutProperties(_this$props, _excluded);
258
273
 
259
274
  var _this$state = this.state,
@@ -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) {
@@ -242,7 +242,7 @@ var EuiAccordionClass = /*#__PURE__*/function (_Component) {
242
242
  css: cssSpinnerStyles
243
243
  }), (0, _react2.jsx)(_text.EuiText, {
244
244
  size: "s"
245
- }, (0, _react2.jsx)("p", null, isLoadingMessage && isLoadingMessage !== true ? isLoadingMessage : (0, _react2.jsx)(_i18n.EuiI18n, {
245
+ }, (0, _react2.jsx)("p", null, isLoadingMessage !== true ? isLoadingMessage : (0, _react2.jsx)(_i18n.EuiI18n, {
246
246
  token: "euiAccordion.isLoading",
247
247
  default: "Loading"
248
248
  }))));
@@ -33,7 +33,7 @@ var _image_types = require("./image_types");
33
33
 
34
34
  var _react2 = require("@emotion/react");
35
35
 
36
- var _excluded = ["className", "alt", "url", "src", "size", "hasShadow", "style", "wrapperProps", "fullScreenIconColor", "allowFullScreen", "caption", "float", "margin"];
36
+ var _excluded = ["className", "alt", "url", "src", "size", "hasShadow", "style", "wrapperProps", "fullScreenIconColor", "allowFullScreen", "caption", "float", "margin", "onFullScreen"];
37
37
 
38
38
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
39
39
 
@@ -58,6 +58,7 @@ var EuiImage = function EuiImage(_ref) {
58
58
  caption = _ref.caption,
59
59
  float = _ref.float,
60
60
  margin = _ref.margin,
61
+ onFullScreen = _ref.onFullScreen,
61
62
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
62
63
 
63
64
  var _useState = (0, _react.useState)(false),
@@ -89,7 +90,8 @@ var EuiImage = function EuiImage(_ref) {
89
90
  alt: alt,
90
91
  caption: caption,
91
92
  float: float,
92
- margin: margin
93
+ margin: margin,
94
+ onFullScreen: onFullScreen
93
95
  };
94
96
 
95
97
  var commonImgProps = _objectSpread({
@@ -50,7 +50,8 @@ var EuiImageFullScreenWrapper = function EuiImageFullScreenWrapper(_ref) {
50
50
  setIsFullScreen = _ref.setIsFullScreen,
51
51
  wrapperProps = _ref.wrapperProps,
52
52
  isFullWidth = _ref.isFullWidth,
53
- fullScreenIconColor = _ref.fullScreenIconColor;
53
+ fullScreenIconColor = _ref.fullScreenIconColor,
54
+ onFullScreen = _ref.onFullScreen;
54
55
  var euiTheme = (0, _services.useEuiTheme)();
55
56
  var styles = (0, _image_fullscreen_wrapper.euiImageFullscreenWrapperStyles)(euiTheme);
56
57
  var cssStyles = [styles.euiImageFullscreenWrapper];
@@ -66,6 +67,7 @@ var EuiImageFullScreenWrapper = function EuiImageFullScreenWrapper(_ref) {
66
67
 
67
68
  var closeFullScreen = function closeFullScreen() {
68
69
  setIsFullScreen(false);
70
+ onFullScreen === null || onFullScreen === void 0 ? void 0 : onFullScreen(false);
69
71
  };
70
72
 
71
73
  var _useInnerText = (0, _inner_text.useInnerText)(),
@@ -45,10 +45,12 @@ var EuiImageWrapper = function EuiImageWrapper(_ref) {
45
45
  setIsFullScreen = _ref.setIsFullScreen,
46
46
  wrapperProps = _ref.wrapperProps,
47
47
  fullScreenIconColor = _ref.fullScreenIconColor,
48
- isFullWidth = _ref.isFullWidth;
48
+ isFullWidth = _ref.isFullWidth,
49
+ onFullScreen = _ref.onFullScreen;
49
50
 
50
51
  var openFullScreen = function openFullScreen() {
51
52
  setIsFullScreen(true);
53
+ onFullScreen === null || onFullScreen === void 0 ? void 0 : onFullScreen(true);
52
54
  };
53
55
 
54
56
  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;"),
@@ -49,7 +49,7 @@ var _resize_observer = require("../observer/resize_observer");
49
49
 
50
50
  var _react3 = require("@emotion/react");
51
51
 
52
- var _excluded = ["children", "className", "anchorClassName", "anchorProps", "content", "title", "delay", "display"];
52
+ var _excluded = ["children", "className", "anchorClassName", "anchorProps", "content", "title", "delay", "display", "repositionOnScroll"];
53
53
 
54
54
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
55
55
 
@@ -242,18 +242,32 @@ var EuiToolTip = /*#__PURE__*/function (_Component) {
242
242
  key: "componentDidMount",
243
243
  value: function componentDidMount() {
244
244
  this._isMounted = true;
245
+
246
+ if (this.props.repositionOnScroll) {
247
+ window.addEventListener('scroll', this.positionToolTip, true);
248
+ }
245
249
  }
246
250
  }, {
247
251
  key: "componentWillUnmount",
248
252
  value: function componentWillUnmount() {
249
253
  this.clearAnimationTimeout();
250
254
  this._isMounted = false;
255
+ window.removeEventListener('scroll', this.positionToolTip, true);
251
256
  }
252
257
  }, {
253
258
  key: "componentDidUpdate",
254
259
  value: function componentDidUpdate(prevProps, prevState) {
255
260
  if (prevState.visible === false && this.state.visible === true) {
256
261
  requestAnimationFrame(this.testAnchor);
262
+ } // update scroll listener
263
+
264
+
265
+ if (prevProps.repositionOnScroll !== this.props.repositionOnScroll) {
266
+ if (this.props.repositionOnScroll) {
267
+ window.addEventListener('scroll', this.positionToolTip, true);
268
+ } else {
269
+ window.removeEventListener('scroll', this.positionToolTip, true);
270
+ }
257
271
  }
258
272
  }
259
273
  }, {
@@ -268,6 +282,7 @@ var EuiToolTip = /*#__PURE__*/function (_Component) {
268
282
  title = _this$props.title,
269
283
  delay = _this$props.delay,
270
284
  display = _this$props.display,
285
+ repositionOnScroll = _this$props.repositionOnScroll,
271
286
  rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
272
287
  var _this$state = this.state,
273
288
  arrowStyles = _this$state.arrowStyles,
@@ -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
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elastic/eui",
3
3
  "description": "Elastic UI Component Library",
4
- "version": "72.1.0",
4
+ "version": "72.2.0",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "lib",
7
7
  "module": "es",
@@ -113,7 +113,7 @@
113
113
  "@cypress/code-coverage": "^3.10.0",
114
114
  "@cypress/react": "^5.10.3",
115
115
  "@cypress/webpack-dev-server": "^1.7.0",
116
- "@elastic/charts": "^51.2.0",
116
+ "@elastic/charts": "^51.3.0",
117
117
  "@elastic/datemath": "^5.0.3",
118
118
  "@elastic/eslint-config-kibana": "^0.15.0",
119
119
  "@emotion/babel-preset-css-prop": "^11.10.0",
@@ -56,10 +56,6 @@
56
56
  }
57
57
  }
58
58
 
59
- .euiMarkdownFormat__blockquote {
60
- border-left-style: solid;
61
- }
62
-
63
59
  .euiCheckbox {
64
60
  // stylelint-disable-next-line declaration-no-important
65
61
  margin-bottom: 0 !important;
@@ -244,7 +244,7 @@ var EuiAccordionClass = /*#__PURE__*/function (_Component) {
244
244
  css: cssSpinnerStyles
245
245
  }), (0, _react2.jsx)(_text.EuiText, {
246
246
  size: "s"
247
- }, (0, _react2.jsx)("p", null, isLoadingMessage && isLoadingMessage !== true ? isLoadingMessage : (0, _react2.jsx)(_i18n.EuiI18n, {
247
+ }, (0, _react2.jsx)("p", null, isLoadingMessage !== true ? isLoadingMessage : (0, _react2.jsx)(_i18n.EuiI18n, {
248
248
  token: "euiAccordion.isLoading",
249
249
  default: "Loading"
250
250
  }))));
@@ -688,6 +688,14 @@ EuiSuperDatePickerInternal.propTypes = {
688
688
  */
689
689
  position: _propTypes.default.oneOf(["top", "right", "bottom", "left"]).isRequired,
690
690
 
691
+ /**
692
+ * When `true`, the tooltip's position is re-calculated when the user
693
+ * scrolls. This supports having fixed-position tooltip anchors.
694
+ *
695
+ * When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
696
+ */
697
+ repositionOnScroll: _propTypes.default.bool,
698
+
691
699
  /**
692
700
  * If supplied, called when mouse movement causes the tool tip to be
693
701
  * hidden.
@@ -859,6 +867,7 @@ EuiSuperDatePicker.propTypes = {
859
867
  title: _propTypes.default.node,
860
868
  id: _propTypes.default.string,
861
869
  position: _propTypes.default.oneOf(["top", "right", "bottom", "left"]).isRequired,
870
+ repositionOnScroll: _propTypes.default.bool,
862
871
  onMouseOut: _propTypes.default.func
863
872
  }),
864
873
  iconOnly: _propTypes.default.bool,
@@ -279,6 +279,14 @@ EuiSuperUpdateButton.propTypes = {
279
279
  */
280
280
  position: _propTypes.default.oneOf(["top", "right", "bottom", "left"]).isRequired,
281
281
 
282
+ /**
283
+ * When `true`, the tooltip's position is re-calculated when the user
284
+ * scrolls. This supports having fixed-position tooltip anchors.
285
+ *
286
+ * When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
287
+ */
288
+ repositionOnScroll: _propTypes.default.bool,
289
+
282
290
  /**
283
291
  * If supplied, called when mouse movement causes the tool tip to be
284
292
  * hidden.
@@ -35,7 +35,7 @@ var _image_types = require("./image_types");
35
35
 
36
36
  var _react2 = require("@emotion/react");
37
37
 
38
- var _excluded = ["className", "alt", "url", "src", "size", "hasShadow", "style", "wrapperProps", "fullScreenIconColor", "allowFullScreen", "caption", "float", "margin"];
38
+ var _excluded = ["className", "alt", "url", "src", "size", "hasShadow", "style", "wrapperProps", "fullScreenIconColor", "allowFullScreen", "caption", "float", "margin", "onFullScreen"];
39
39
 
40
40
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
41
41
 
@@ -60,6 +60,7 @@ var EuiImage = function EuiImage(_ref) {
60
60
  caption = _ref.caption,
61
61
  float = _ref.float,
62
62
  margin = _ref.margin,
63
+ onFullScreen = _ref.onFullScreen,
63
64
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
64
65
 
65
66
  var _useState = (0, _react.useState)(false),
@@ -91,7 +92,8 @@ var EuiImage = function EuiImage(_ref) {
91
92
  alt: alt,
92
93
  caption: caption,
93
94
  float: float,
94
- margin: margin
95
+ margin: margin,
96
+ onFullScreen: onFullScreen
95
97
  };
96
98
 
97
99
  var commonImgProps = _objectSpread({
@@ -165,6 +167,11 @@ EuiImage.propTypes = {
165
167
  */
166
168
  allowFullScreen: _propTypes.default.bool,
167
169
 
170
+ /**
171
+ * Callback when the image is clicked and `allowFullScreen` is `true`
172
+ */
173
+ onFullScreen: _propTypes.default.func,
174
+
168
175
  /**
169
176
  * Changes the color of the icon that floats above the image when it can be clicked to fullscreen.
170
177
  * The default value of `light` is fine unless your image has a white background, in which case you should change it to `dark`.
@@ -52,7 +52,8 @@ var EuiImageFullScreenWrapper = function EuiImageFullScreenWrapper(_ref) {
52
52
  setIsFullScreen = _ref.setIsFullScreen,
53
53
  wrapperProps = _ref.wrapperProps,
54
54
  isFullWidth = _ref.isFullWidth,
55
- fullScreenIconColor = _ref.fullScreenIconColor;
55
+ fullScreenIconColor = _ref.fullScreenIconColor,
56
+ onFullScreen = _ref.onFullScreen;
56
57
  var euiTheme = (0, _services.useEuiTheme)();
57
58
  var styles = (0, _image_fullscreen_wrapper.euiImageFullscreenWrapperStyles)(euiTheme);
58
59
  var cssStyles = [styles.euiImageFullscreenWrapper];
@@ -68,6 +69,7 @@ var EuiImageFullScreenWrapper = function EuiImageFullScreenWrapper(_ref) {
68
69
 
69
70
  var closeFullScreen = function closeFullScreen() {
70
71
  setIsFullScreen(false);
72
+ onFullScreen === null || onFullScreen === void 0 ? void 0 : onFullScreen(false);
71
73
  };
72
74
 
73
75
  var _useInnerText = (0, _inner_text.useInnerText)(),
@@ -47,10 +47,12 @@ var EuiImageWrapper = function EuiImageWrapper(_ref) {
47
47
  setIsFullScreen = _ref.setIsFullScreen,
48
48
  wrapperProps = _ref.wrapperProps,
49
49
  fullScreenIconColor = _ref.fullScreenIconColor,
50
- isFullWidth = _ref.isFullWidth;
50
+ isFullWidth = _ref.isFullWidth,
51
+ onFullScreen = _ref.onFullScreen;
51
52
 
52
53
  var openFullScreen = function openFullScreen() {
53
54
  setIsFullScreen(true);
55
+ onFullScreen === null || onFullScreen === void 0 ? void 0 : onFullScreen(true);
54
56
  };
55
57
 
56
58
  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