@elastic/eui 59.0.0 → 59.1.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 (147) hide show
  1. package/dist/eui_theme_dark.css +2 -136
  2. package/dist/eui_theme_dark.json +0 -6
  3. package/dist/eui_theme_dark.json.d.ts +0 -6
  4. package/dist/eui_theme_dark.min.css +1 -1
  5. package/dist/eui_theme_light.css +2 -136
  6. package/dist/eui_theme_light.json +0 -6
  7. package/dist/eui_theme_light.json.d.ts +0 -6
  8. package/dist/eui_theme_light.min.css +1 -1
  9. package/es/components/accessibility/skip_link/skip_link.js +39 -2
  10. package/es/components/accessibility/skip_link/skip_link.styles.js +1 -1
  11. package/es/components/button/{button_content.js → _button_content_deprecated.js} +4 -3
  12. package/es/components/button/button.js +16 -10
  13. package/es/components/button/button_display/_button_display.js +141 -0
  14. package/es/components/button/button_display/_button_display.styles.js +53 -0
  15. package/es/components/button/button_display/_button_display_content.js +100 -0
  16. package/es/components/button/button_display/_button_display_content.styles.js +61 -0
  17. package/es/components/button/button_empty/button_empty.js +3 -2
  18. package/es/components/button/button_group/button_group.js +2 -1
  19. package/es/components/button/button_group/button_group_button.js +3 -2
  20. package/es/components/call_out/call_out.js +2 -1
  21. package/es/components/card/card.js +2 -1
  22. package/es/components/card/card_select.js +2 -1
  23. package/es/components/date_picker/auto_refresh/auto_refresh.js +2 -1
  24. package/es/components/facet/facet_button.js +31 -15
  25. package/es/components/facet/facet_button.styles.js +64 -0
  26. package/es/components/facet/facet_group.js +12 -23
  27. package/es/components/facet/facet_group.styles.js +79 -0
  28. package/es/components/header/header_links/header_link.js +2 -1
  29. package/es/components/loading/loading_spinner.js +14 -3
  30. package/es/components/loading/loading_spinner.styles.js +4 -4
  31. package/es/components/notification/notification_event.js +2 -1
  32. package/es/components/pagination/pagination_button.js +2 -1
  33. package/es/components/text/text.js +1 -3
  34. package/es/components/text/text_align.js +2 -2
  35. package/es/components/text/text_color.js +7 -3
  36. package/es/themes/amsterdam/index.js +9 -0
  37. package/es/themes/index.js +2 -1
  38. package/eui.d.ts +200 -17
  39. package/lib/components/accessibility/skip_link/skip_link.js +39 -2
  40. package/lib/components/accessibility/skip_link/skip_link.styles.js +1 -1
  41. package/lib/components/button/{button_content.js → _button_content_deprecated.js} +6 -5
  42. package/lib/components/button/button.js +19 -13
  43. package/lib/components/button/button_display/_button_display.js +146 -0
  44. package/lib/components/button/button_display/_button_display.styles.js +59 -0
  45. package/lib/components/button/button_display/_button_display_content.js +111 -0
  46. package/lib/components/button/button_display/_button_display_content.styles.js +64 -0
  47. package/lib/components/button/button_empty/button_empty.js +4 -3
  48. package/lib/components/button/button_group/button_group.js +2 -1
  49. package/lib/components/button/button_group/button_group_button.js +3 -2
  50. package/lib/components/call_out/call_out.js +2 -1
  51. package/lib/components/card/card.js +2 -1
  52. package/lib/components/card/card_select.js +2 -1
  53. package/lib/components/date_picker/auto_refresh/auto_refresh.js +2 -1
  54. package/lib/components/facet/facet_button.js +35 -15
  55. package/lib/components/facet/facet_button.styles.js +79 -0
  56. package/lib/components/facet/facet_group.js +12 -23
  57. package/lib/components/facet/facet_group.styles.js +82 -0
  58. package/lib/components/header/header_links/header_link.js +2 -1
  59. package/lib/components/loading/loading_spinner.js +14 -3
  60. package/lib/components/loading/loading_spinner.styles.js +4 -4
  61. package/lib/components/notification/notification_event.js +2 -1
  62. package/lib/components/text/text.js +1 -3
  63. package/lib/components/text/text_align.js +8 -2
  64. package/lib/components/text/text_color.js +13 -3
  65. package/lib/themes/amsterdam/index.js +18 -0
  66. package/lib/themes/index.js +21 -1
  67. package/optimize/es/components/accessibility/skip_link/skip_link.js +23 -1
  68. package/optimize/es/components/accessibility/skip_link/skip_link.styles.js +1 -1
  69. package/optimize/es/components/button/{button_content.js → _button_content_deprecated.js} +1 -1
  70. package/optimize/es/components/button/button.js +13 -8
  71. package/optimize/es/components/button/button_display/_button_display.js +73 -0
  72. package/optimize/es/components/button/button_display/_button_display.styles.js +53 -0
  73. package/optimize/es/components/button/button_display/_button_display_content.js +67 -0
  74. package/optimize/es/components/button/button_display/_button_display_content.styles.js +61 -0
  75. package/optimize/es/components/button/button_empty/button_empty.js +1 -1
  76. package/optimize/es/components/button/button_group/button_group_button.js +1 -1
  77. package/optimize/es/components/call_out/call_out.js +2 -1
  78. package/optimize/es/components/facet/facet_button.js +31 -15
  79. package/optimize/es/components/facet/facet_button.styles.js +64 -0
  80. package/optimize/es/components/facet/facet_group.js +10 -21
  81. package/optimize/es/components/facet/facet_group.styles.js +79 -0
  82. package/optimize/es/components/loading/loading_spinner.js +3 -2
  83. package/optimize/es/components/loading/loading_spinner.styles.js +4 -4
  84. package/optimize/es/components/text/text.js +1 -3
  85. package/optimize/es/components/text/text_align.js +2 -2
  86. package/optimize/es/components/text/text_color.js +7 -3
  87. package/optimize/es/themes/amsterdam/index.js +9 -0
  88. package/optimize/es/themes/index.js +2 -1
  89. package/optimize/lib/components/accessibility/skip_link/skip_link.js +25 -1
  90. package/optimize/lib/components/accessibility/skip_link/skip_link.styles.js +1 -1
  91. package/optimize/lib/components/button/{button_content.js → _button_content_deprecated.js} +3 -3
  92. package/optimize/lib/components/button/button.js +16 -11
  93. package/optimize/lib/components/button/button_display/_button_display.js +79 -0
  94. package/optimize/lib/components/button/button_display/_button_display.styles.js +59 -0
  95. package/optimize/lib/components/button/button_display/_button_display_content.js +78 -0
  96. package/optimize/lib/components/button/button_display/_button_display_content.styles.js +64 -0
  97. package/optimize/lib/components/button/button_empty/button_empty.js +2 -2
  98. package/optimize/lib/components/button/button_group/button_group_button.js +1 -1
  99. package/optimize/lib/components/call_out/call_out.js +2 -1
  100. package/optimize/lib/components/facet/facet_button.js +35 -15
  101. package/optimize/lib/components/facet/facet_button.styles.js +79 -0
  102. package/optimize/lib/components/facet/facet_group.js +10 -21
  103. package/optimize/lib/components/facet/facet_group.styles.js +82 -0
  104. package/optimize/lib/components/loading/loading_spinner.js +3 -2
  105. package/optimize/lib/components/loading/loading_spinner.styles.js +4 -4
  106. package/optimize/lib/components/text/text.js +1 -3
  107. package/optimize/lib/components/text/text_align.js +8 -2
  108. package/optimize/lib/components/text/text_color.js +13 -3
  109. package/optimize/lib/themes/amsterdam/index.js +18 -0
  110. package/optimize/lib/themes/index.js +21 -1
  111. package/package.json +1 -1
  112. package/src/components/index.scss +0 -1
  113. package/src/components/selectable/selectable_message/_selectable_message.scss +1 -0
  114. package/src/themes/amsterdam/overrides/_index.scss +0 -1
  115. package/test-env/components/accessibility/skip_link/skip_link.js +40 -2
  116. package/test-env/components/accessibility/skip_link/skip_link.styles.js +1 -1
  117. package/test-env/components/button/{button_content.js → _button_content_deprecated.js} +6 -5
  118. package/test-env/components/button/button.js +19 -13
  119. package/test-env/components/button/button_display/_button_display.js +143 -0
  120. package/test-env/components/button/button_display/_button_display.styles.js +59 -0
  121. package/test-env/components/button/button_display/_button_display_content.js +108 -0
  122. package/test-env/components/button/button_display/_button_display_content.styles.js +64 -0
  123. package/test-env/components/button/button_empty/button_empty.js +4 -3
  124. package/test-env/components/button/button_group/button_group.js +2 -1
  125. package/test-env/components/button/button_group/button_group_button.js +3 -2
  126. package/test-env/components/call_out/call_out.js +2 -1
  127. package/test-env/components/card/card.js +2 -1
  128. package/test-env/components/card/card_select.js +2 -1
  129. package/test-env/components/date_picker/auto_refresh/auto_refresh.js +2 -1
  130. package/test-env/components/facet/facet_button.js +35 -15
  131. package/test-env/components/facet/facet_button.styles.js +79 -0
  132. package/test-env/components/facet/facet_group.js +12 -23
  133. package/test-env/components/facet/facet_group.styles.js +82 -0
  134. package/test-env/components/header/header_links/header_link.js +2 -1
  135. package/test-env/components/loading/loading_spinner.js +14 -3
  136. package/test-env/components/loading/loading_spinner.styles.js +4 -4
  137. package/test-env/components/notification/notification_event.js +2 -1
  138. package/test-env/components/text/text.js +1 -3
  139. package/test-env/components/text/text_align.js +8 -2
  140. package/test-env/components/text/text_color.js +13 -3
  141. package/test-env/themes/amsterdam/index.js +18 -0
  142. package/test-env/themes/index.js +21 -1
  143. package/src/components/facet/_facet_button.scss +0 -69
  144. package/src/components/facet/_facet_group.scss +0 -24
  145. package/src/components/facet/_index.scss +0 -4
  146. package/src/components/facet/_variables.scss +0 -6
  147. package/src/themes/amsterdam/overrides/_facet.scss +0 -10
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.euiFacetButtonTextStyles = exports.euiFacetButtonStyles = exports.euiFacetButtonQuantityStyles = exports.euiFacetButtonLoadingSpinnerStyles = exports.euiFacetButtonIconStyles = void 0;
7
+
8
+ var _react = require("@emotion/react");
9
+
10
+ var _global_styling = require("../../global_styling");
11
+
12
+ var _link = require("../link/link.styles");
13
+
14
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
15
+
16
+ var euiFacetButtonStyles = function euiFacetButtonStyles(_ref3) {
17
+ var euiTheme = _ref3.euiTheme;
18
+ return {
19
+ // Base
20
+ euiFacetButton: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('left'), ";&:hover,&:focus{&:not(:disabled) [class*='euiFacetButton__text']{text-decoration:underline;}}&:focus:not(:disabled) [class*='euiFacetButton__text']{", (0, _link.euiLinkFocusCSS)(euiTheme), ";}&:disabled{color:", euiTheme.colors.disabledText, ";pointer-events:none;&:hover,&:focus{text-decoration:none;}};label:euiFacetButton;")
21
+ };
22
+ };
23
+
24
+ exports.euiFacetButtonStyles = euiFacetButtonStyles;
25
+
26
+ var euiFacetButtonTextStyles = function euiFacetButtonTextStyles(_ref4) {
27
+ var euiTheme = _ref4.euiTheme;
28
+ return {
29
+ euiFacetButton__text: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiTextShift)('bold', 'data-text', euiTheme), " ", (0, _global_styling.euiTextTruncate)(), " flex-grow:1;;label:euiFacetButton__text;"),
30
+ isSelected: /*#__PURE__*/(0, _react.css)("font-weight:", euiTheme.font.weight.bold, ";;label:isSelected;"),
31
+ unSelected: /*#__PURE__*/(0, _react.css)(";label:unSelected;")
32
+ };
33
+ };
34
+
35
+ exports.euiFacetButtonTextStyles = euiFacetButtonTextStyles;
36
+
37
+ var _ref2 = process.env.NODE_ENV === "production" ? {
38
+ name: "mpq8zy-isDisabled",
39
+ styles: "opacity:0.5;label:isDisabled;"
40
+ } : {
41
+ name: "mpq8zy-isDisabled",
42
+ styles: "opacity:0.5;label:isDisabled;",
43
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
44
+ };
45
+
46
+ var euiFacetButtonIconStyles = function euiFacetButtonIconStyles() {
47
+ return {
48
+ euiFacetButton__icon: /*#__PURE__*/(0, _react.css)(";label:euiFacetButton__icon;"),
49
+ isDisabled: _ref2
50
+ };
51
+ };
52
+
53
+ exports.euiFacetButtonIconStyles = euiFacetButtonIconStyles;
54
+
55
+ var euiFacetButtonLoadingSpinnerStyles = function euiFacetButtonLoadingSpinnerStyles() {
56
+ return {
57
+ euiFacetButton__loadingSpinner: /*#__PURE__*/(0, _react.css)(";label:euiFacetButton__loadingSpinner;")
58
+ };
59
+ };
60
+
61
+ exports.euiFacetButtonLoadingSpinnerStyles = euiFacetButtonLoadingSpinnerStyles;
62
+
63
+ var _ref = process.env.NODE_ENV === "production" ? {
64
+ name: "mpq8zy-isDisabled",
65
+ styles: "opacity:0.5;label:isDisabled;"
66
+ } : {
67
+ name: "mpq8zy-isDisabled",
68
+ styles: "opacity:0.5;label:isDisabled;",
69
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
70
+ };
71
+
72
+ var euiFacetButtonQuantityStyles = function euiFacetButtonQuantityStyles() {
73
+ return {
74
+ euiFacetButton__quantity: /*#__PURE__*/(0, _react.css)(";label:euiFacetButton__quantity;"),
75
+ isDisabled: _ref
76
+ };
77
+ };
78
+
79
+ exports.euiFacetButtonQuantityStyles = euiFacetButtonQuantityStyles;
@@ -11,9 +11,9 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
- var _common = require("../common");
14
+ var _services = require("../../services");
15
15
 
16
- var _flex = require("../flex");
16
+ var _facet_group = require("./facet_group.styles");
17
17
 
18
18
  var _react2 = require("@emotion/react");
19
19
 
@@ -27,19 +27,9 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
27
27
 
28
28
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
29
29
 
30
- var layoutToClassNameMap = {
31
- vertical: 'euiFacetGroup--vertical',
32
- horizontal: 'euiFacetGroup--horizontal'
33
- };
34
- var LAYOUTS = (0, _common.keysOf)(layoutToClassNameMap);
30
+ var LAYOUTS = ['vertical', 'horizontal'];
35
31
  exports.LAYOUTS = LAYOUTS;
36
- var gutterSizeToClassNameMap = {
37
- none: 'euiFacetGroup--gutterNone',
38
- s: 'euiFacetGroup--gutterSmall',
39
- m: 'euiFacetGroup--gutterMedium',
40
- l: 'euiFacetGroup--gutterLarge'
41
- };
42
- var GUTTER_SIZES = (0, _common.keysOf)(gutterSizeToClassNameMap);
32
+ var GUTTER_SIZES = ['none', 's', 'm', 'l'];
43
33
  exports.GUTTER_SIZES = GUTTER_SIZES;
44
34
 
45
35
  var EuiFacetGroup = function EuiFacetGroup(_ref) {
@@ -51,14 +41,13 @@ var EuiFacetGroup = function EuiFacetGroup(_ref) {
51
41
  gutterSize = _ref$gutterSize === void 0 ? 'm' : _ref$gutterSize,
52
42
  rest = _objectWithoutProperties(_ref, _excluded);
53
43
 
54
- var classes = (0, _classnames.default)('euiFacetGroup', layoutToClassNameMap[layout], gutterSizeToClassNameMap[gutterSize], className);
55
- var direction = layout === 'vertical' ? 'column' : 'row';
56
- var wrap = layout === 'vertical' ? false : true;
57
- return (0, _react2.jsx)(_flex.EuiFlexGroup, _extends({
44
+ var theme = (0, _services.useEuiTheme)();
45
+ var styles = (0, _facet_group.euiFacetGroupStyles)(theme, layout);
46
+ var cssStyles = [styles.euiFacetGroup, styles[gutterSize], styles[layout]];
47
+ var classes = (0, _classnames.default)('euiFacetGroup', className);
48
+ return (0, _react2.jsx)("div", _extends({
58
49
  className: classes,
59
- direction: direction,
60
- wrap: wrap,
61
- gutterSize: "none"
50
+ css: cssStyles
62
51
  }, rest), children);
63
52
  };
64
53
 
@@ -71,11 +60,11 @@ EuiFacetGroup.propTypes = {
71
60
  /**
72
61
  * Vertically in a column, or horizontally in one wrapping line
73
62
  */
74
- layout: _propTypes.default.oneOf(["vertical", "horizontal"]),
63
+ layout: _propTypes.default.any,
75
64
 
76
65
  /**
77
66
  * Distance between facet buttons.
78
67
  * Horizontal layout always adds more distance horizontally between buttons.
79
68
  */
80
- gutterSize: _propTypes.default.oneOf(["none", "s", "m", "l"])
69
+ gutterSize: _propTypes.default.any
81
70
  };
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.euiFacetGroupStyles = void 0;
7
+
8
+ var _react = require("@emotion/react");
9
+
10
+ var _services = require("../../services");
11
+
12
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
13
+
14
+ var _facetGroupGutterSize = function _facetGroupGutterSize(_ref4) {
15
+ var gutterSize = _ref4.gutterSize,
16
+ layout = _ref4.layout;
17
+
18
+ var _useEuiTheme = (0, _services.useEuiTheme)(),
19
+ euiTheme = _useEuiTheme.euiTheme;
20
+
21
+ var isHorizontalLayout = layout === 'horizontal';
22
+ var gutterHorizontal = "calc(".concat(euiTheme.size.m, " + ").concat(gutterSize, ")");
23
+ var gutterVertical = gutterSize;
24
+ return isHorizontalLayout ? "gap: ".concat(gutterVertical, " ").concat(gutterHorizontal, ";") : "gap: ".concat(gutterVertical, " 0;");
25
+ };
26
+
27
+ var _ref = process.env.NODE_ENV === "production" ? {
28
+ name: "omnk2l-vertical",
29
+ styles: "flex-direction:column;label:vertical;"
30
+ } : {
31
+ name: "omnk2l-vertical",
32
+ styles: "flex-direction:column;label:vertical;",
33
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
34
+ };
35
+
36
+ var _ref2 = process.env.NODE_ENV === "production" ? {
37
+ name: "envaaw-horizontal",
38
+ styles: "flex-direction:row;flex-wrap:wrap;label:horizontal;"
39
+ } : {
40
+ name: "envaaw-horizontal",
41
+ styles: "flex-direction:row;flex-wrap:wrap;label:horizontal;",
42
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
43
+ };
44
+
45
+ var _ref3 = process.env.NODE_ENV === "production" ? {
46
+ name: "1g68sie-euiFacetGroup",
47
+ styles: "display:flex;flex-grow:1;label:euiFacetGroup;"
48
+ } : {
49
+ name: "1g68sie-euiFacetGroup",
50
+ styles: "display:flex;flex-grow:1;label:euiFacetGroup;",
51
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
52
+ };
53
+
54
+ var euiFacetGroupStyles = function euiFacetGroupStyles(_ref5, layout) {
55
+ var euiTheme = _ref5.euiTheme;
56
+ return {
57
+ // Base
58
+ euiFacetGroup: _ref3,
59
+ // Gutter sizes
60
+ none: /*#__PURE__*/(0, _react.css)(_facetGroupGutterSize({
61
+ gutterSize: '0',
62
+ layout: layout
63
+ }), ";label:none;"),
64
+ s: /*#__PURE__*/(0, _react.css)(_facetGroupGutterSize({
65
+ gutterSize: euiTheme.size.xs,
66
+ layout: layout
67
+ }), ";label:s;"),
68
+ m: /*#__PURE__*/(0, _react.css)(_facetGroupGutterSize({
69
+ gutterSize: euiTheme.size.s,
70
+ layout: layout
71
+ }), ";label:m;"),
72
+ l: /*#__PURE__*/(0, _react.css)(_facetGroupGutterSize({
73
+ gutterSize: euiTheme.size.m,
74
+ layout: layout
75
+ }), ";label:l;"),
76
+ // layouts
77
+ horizontal: _ref2,
78
+ vertical: _ref
79
+ };
80
+ };
81
+
82
+ exports.euiFacetGroupStyles = euiFacetGroupStyles;
@@ -120,7 +120,8 @@ EuiHeaderLink.propTypes = {
120
120
  iconSide: _propTypes.default.oneOf(["left", "right"]),
121
121
 
122
122
  /**
123
- * Object of props passed to the <span/> wrapping the content's text/children only (not icon)
123
+ * Object of props passed to the <span/> wrapping the content's text (only if the children is a `string`)
124
+ * It doesn't apply to the icon.
124
125
  */
125
126
  textProps: _propTypes.default.shape({
126
127
  className: _propTypes.default.string,
@@ -19,7 +19,7 @@ var _loading_spinner = require("./loading_spinner.styles");
19
19
 
20
20
  var _react2 = require("@emotion/react");
21
21
 
22
- var _excluded = ["size", "className", "aria-label"];
22
+ var _excluded = ["size", "className", "aria-label", "color"];
23
23
 
24
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
25
 
@@ -37,10 +37,11 @@ var EuiLoadingSpinner = function EuiLoadingSpinner(_ref) {
37
37
  size = _ref$size === void 0 ? 'm' : _ref$size,
38
38
  className = _ref.className,
39
39
  ariaLabel = _ref['aria-label'],
40
+ color = _ref.color,
40
41
  rest = _objectWithoutProperties(_ref, _excluded);
41
42
 
42
43
  var euiTheme = (0, _services.useEuiTheme)();
43
- var styles = (0, _loading_spinner.euiLoadingSpinnerStyles)(euiTheme);
44
+ var styles = (0, _loading_spinner.euiLoadingSpinnerStyles)(euiTheme, color);
44
45
  var cssStyles = [styles.euiLoadingSpinner, styles[size]];
45
46
  var classes = (0, _classnames.default)('euiLoadingSpinner', className);
46
47
  var defaultLabel = (0, _loading_strings.useLoadingAriaLabel)();
@@ -57,5 +58,15 @@ EuiLoadingSpinner.propTypes = {
57
58
  className: _propTypes.default.string,
58
59
  "aria-label": _propTypes.default.string,
59
60
  "data-test-subj": _propTypes.default.string,
60
- size: _propTypes.default.any
61
+ size: _propTypes.default.any,
62
+
63
+ /**
64
+ * Sets the color of the border and highlight.
65
+ * Each key accepts any valid CSS color value as a `string`
66
+ * See #EuiLoadingSpinnerColor
67
+ */
68
+ color: _propTypes.default.shape({
69
+ border: _propTypes.default.any,
70
+ highlight: _propTypes.default.any
71
+ })
61
72
  };
@@ -23,14 +23,14 @@ var spinnerSizes = {
23
23
  xxl: 'xxl'
24
24
  };
25
25
 
26
- var spinnerColors = function spinnerColors(main, highlight) {
27
- return "".concat(highlight, " ").concat(main, " ").concat(main, " ").concat(main);
26
+ var spinnerColorsCSS = function spinnerColorsCSS(border, highlight) {
27
+ return "\n border-color: ".concat(highlight, " ").concat(border, " ").concat(border, " ").concat(border, ";\n ");
28
28
  };
29
29
 
30
- var euiLoadingSpinnerStyles = function euiLoadingSpinnerStyles(_ref) {
30
+ var euiLoadingSpinnerStyles = function euiLoadingSpinnerStyles(_ref, color) {
31
31
  var euiTheme = _ref.euiTheme;
32
32
  return {
33
- euiLoadingSpinner: /*#__PURE__*/(0, _react.css)("flex-shrink:0;display:inline-block;border-radius:50%;border:", euiTheme.border.thick, ";border-color:", spinnerColors(euiTheme.border.color, euiTheme.colors.primary), ";", _global_styling.euiCanAnimate, "{animation:", _loadingSpinner, " 0.6s infinite linear;};label:euiLoadingSpinner;"),
33
+ euiLoadingSpinner: /*#__PURE__*/(0, _react.css)("flex-shrink:0;display:inline-block;border-radius:50%;border:", euiTheme.border.thick, ";", spinnerColorsCSS((color === null || color === void 0 ? void 0 : color.border) || euiTheme.colors.lightShade, (color === null || color === void 0 ? void 0 : color.highlight) || euiTheme.colors.primary), ";", _global_styling.euiCanAnimate, "{animation:", _loadingSpinner, " 0.6s infinite linear;};label:euiLoadingSpinner;"),
34
34
  // Sizes
35
35
  s: /*#__PURE__*/(0, _react.css)("width:", euiTheme.size[spinnerSizes.s], ";height:", euiTheme.size[spinnerSizes.s], ";border-width:calc(", euiTheme.border.width.thin, " * 1.5);;label:s;"),
36
36
  m: /*#__PURE__*/(0, _react.css)("width:", euiTheme.size[spinnerSizes.m], ";height:", euiTheme.size[spinnerSizes.m], ";border-width:calc(", euiTheme.border.width.thin, " * 1.5);;label:m;"),
@@ -275,7 +275,8 @@ EuiNotificationEvent.propTypes = {
275
275
  iconSide: _propTypes.default.oneOf(["left", "right"]),
276
276
 
277
277
  /**
278
- * Object of props passed to the <span/> wrapping the content's text/children only (not icon)
278
+ * Object of props passed to the <span/> wrapping the content's text (only if the children is a `string`)
279
+ * It doesn't apply to the icon.
279
280
  */
280
281
  textProps: _propTypes.default.shape({
281
282
  className: _propTypes.default.string,
@@ -21,7 +21,7 @@ var _text_align = require("./text_align");
21
21
 
22
22
  var _react2 = require("@emotion/react");
23
23
 
24
- var _excluded = ["size", "color", "grow", "textAlign", "children", "className", "style"];
24
+ var _excluded = ["size", "color", "grow", "textAlign", "children", "className"];
25
25
 
26
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
27
 
@@ -43,7 +43,6 @@ var EuiText = function EuiText(_ref) {
43
43
  textAlign = _ref.textAlign,
44
44
  children = _ref.children,
45
45
  className = _ref.className,
46
- style = _ref.style,
47
46
  rest = _objectWithoutProperties(_ref, _excluded);
48
47
 
49
48
  var euiTheme = (0, _services.useEuiTheme)();
@@ -58,7 +57,6 @@ var EuiText = function EuiText(_ref) {
58
57
  if (color) {
59
58
  text = (0, _react2.jsx)(_text_color.EuiTextColor, {
60
59
  color: color,
61
- style: style,
62
60
  cloneElement: true
63
61
  }, text);
64
62
  }
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
 
3
+ 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); }
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
8
  exports.EuiTextAlign = exports.ALIGNMENTS = void 0;
7
9
 
8
- var _react = _interopRequireDefault(require("react"));
10
+ var _react = _interopRequireWildcard(require("react"));
9
11
 
10
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
13
 
@@ -19,6 +21,10 @@ var _excluded = ["children", "textAlign", "cloneElement"];
19
21
 
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
23
 
24
+ 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); }
25
+
26
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
+
22
28
  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; }
23
29
 
24
30
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
@@ -47,7 +53,7 @@ var EuiTextAlign = function EuiTextAlign(_ref) {
47
53
  css: cssStyles
48
54
  }, rest);
49
55
 
50
- if (cloneElement) {
56
+ if ( /*#__PURE__*/(0, _react.isValidElement)(children) && cloneElement) {
51
57
  return (0, _clone_element.cloneElementWithCss)(children, props);
52
58
  } else {
53
59
  return (0, _react2.jsx)("div", props, children);
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
 
3
+ 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); }
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
8
  exports.EuiTextColor = exports.COLORS = void 0;
7
9
 
8
- var _react = _interopRequireDefault(require("react"));
10
+ var _react = _interopRequireWildcard(require("react"));
9
11
 
10
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
13
 
@@ -21,6 +23,10 @@ var _excluded = ["children", "color", "component", "cloneElement", "style"];
21
23
 
22
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
25
 
26
+ 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); }
27
+
28
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
29
+
24
30
  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; }
25
31
 
26
32
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
@@ -61,8 +67,12 @@ var EuiTextColor = function EuiTextColor(_ref) {
61
67
  style: euiTextStyle
62
68
  }, rest);
63
69
 
64
- if (cloneElement) {
65
- return (0, _clone_element.cloneElementWithCss)(children, props);
70
+ if ( /*#__PURE__*/(0, _react.isValidElement)(children) && cloneElement) {
71
+ var childrenStyle = _objectSpread(_objectSpread({}, children.props.style), euiTextStyle);
72
+
73
+ return (0, _clone_element.cloneElementWithCss)(children, _objectSpread(_objectSpread({}, props), {}, {
74
+ style: childrenStyle
75
+ }));
66
76
  } else {
67
77
  var Component = component;
68
78
  return (0, _react2.jsx)(Component, props, children);
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _shadow = require("./global_styling/mixins/shadow");
8
+
9
+ Object.keys(_shadow).forEach(function (key) {
10
+ if (key === "default" || key === "__esModule") return;
11
+ if (key in exports && exports[key] === _shadow[key]) return;
12
+ Object.defineProperty(exports, key, {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _shadow[key];
16
+ }
17
+ });
18
+ });
@@ -3,6 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ var _exportNames = {
7
+ EUI_THEMES: true,
8
+ isDefaultTheme: true,
9
+ AMSTERDAM_NAME_KEY: true,
10
+ EuiThemeAmsterdam: true
11
+ };
6
12
  Object.defineProperty(exports, "AMSTERDAM_NAME_KEY", {
7
13
  enumerable: true,
8
14
  get: function get() {
@@ -30,4 +36,18 @@ Object.defineProperty(exports, "isDefaultTheme", {
30
36
 
31
37
  var _themes = require("./themes");
32
38
 
33
- var _theme = require("./amsterdam/theme");
39
+ var _theme = require("./amsterdam/theme");
40
+
41
+ var _amsterdam = require("./amsterdam");
42
+
43
+ Object.keys(_amsterdam).forEach(function (key) {
44
+ if (key === "default" || key === "__esModule") return;
45
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
46
+ if (key in exports && exports[key] === _amsterdam[key]) return;
47
+ Object.defineProperty(exports, key, {
48
+ enumerable: true,
49
+ get: function get() {
50
+ return _amsterdam[key];
51
+ }
52
+ });
53
+ });
@@ -1,6 +1,11 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["destinationId", "tabIndex", "position", "children", "className"];
4
+ var _excluded = ["destinationId", "overrideLinkBehavior", "tabIndex", "position", "children", "className"];
5
+
6
+ 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; }
7
+
8
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
4
9
 
5
10
  /*
6
11
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@@ -19,6 +24,7 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
19
24
  export var POSITIONS = ['static', 'fixed', 'absolute'];
20
25
  export var EuiSkipLink = function EuiSkipLink(_ref) {
21
26
  var destinationId = _ref.destinationId,
27
+ overrideLinkBehavior = _ref.overrideLinkBehavior,
22
28
  tabIndex = _ref.tabIndex,
23
29
  _ref$position = _ref.position,
24
30
  position = _ref$position === void 0 ? 'static' : _ref$position,
@@ -39,6 +45,22 @@ export var EuiSkipLink = function EuiSkipLink(_ref) {
39
45
  };
40
46
  }
41
47
 
48
+ if (overrideLinkBehavior) {
49
+ optionalProps = _objectSpread(_objectSpread({}, optionalProps), {}, {
50
+ onClick: function onClick(e) {
51
+ e.preventDefault();
52
+ var destinationEl = document.getElementById(destinationId);
53
+ if (!destinationEl) return;
54
+ destinationEl.scrollIntoView();
55
+ destinationEl.tabIndex = -1; // Ensure the destination content is focusable
56
+
57
+ destinationEl.focus({
58
+ preventScroll: true
59
+ }); // Scrolling is already handled above, and focus's autoscroll behaves oddly around fixed headers
60
+ }
61
+ });
62
+ }
63
+
42
64
  return ___EmotionJSX(EuiScreenReaderOnly, {
43
65
  showOnFocus: true
44
66
  }, ___EmotionJSX(EuiButton, _extends({
@@ -35,6 +35,6 @@ export var euiSkipLinkStyles = function euiSkipLinkStyles(_ref3) {
35
35
  // Set positions on focus only as to not override screenReaderOnly position
36
36
  // When positioned absolutely, consumers still need to tell it WHERE (top,left,etc...)
37
37
  absolute: _ref,
38
- fixed: /*#__PURE__*/css("&:focus{position:fixed;inset-block-start:", euiTheme.size.xs, ";inset-inline-start:", euiTheme.size.xs, ";z-index:", Number(euiTheme.levels.header) + 1, ";};label:fixed;")
38
+ fixed: /*#__PURE__*/css("position:fixed!important;&:focus{inset-block-start:", euiTheme.size.xs, ";inset-inline-start:", euiTheme.size.xs, ";z-index:", Number(euiTheme.levels.header) + 1, ";};label:fixed;")
39
39
  };
40
40
  };
@@ -20,7 +20,7 @@ var iconSideToClassNameMap = {
20
20
  right: 'euiButtonContent--iconRight'
21
21
  };
22
22
  export var ICON_SIDES = keysOf(iconSideToClassNameMap);
23
- export var EuiButtonContent = function EuiButtonContent(_ref) {
23
+ export var EuiButtonContentDeprecated = function EuiButtonContentDeprecated(_ref) {
24
24
  var children = _ref.children,
25
25
  textProps = _ref.textProps,
26
26
  _ref$isLoading = _ref.isLoading,
@@ -19,7 +19,7 @@ import React, { forwardRef } from 'react';
19
19
  import classNames from 'classnames';
20
20
  import { keysOf } from '../common';
21
21
  import { getSecureRelForTarget } from '../../services';
22
- import { EuiButtonContent } from './button_content';
22
+ import { EuiButtonContentDeprecated as EuiButtonContent } from './_button_content_deprecated';
23
23
  import { validateHref } from '../../services/security/href_validator';
24
24
  import { jsx as ___EmotionJSX } from "@emotion/react";
25
25
  export var colorToClassNameMap = {
@@ -88,22 +88,27 @@ export var EuiButton = function EuiButton(_ref) {
88
88
  relObj.type = type;
89
89
  }
90
90
 
91
- return ___EmotionJSX(EuiButtonDisplay, _extends({
92
- element: element,
93
- baseClassName: "euiButton",
94
- ref: buttonRef
95
- }, elementProps, relObj, rest));
91
+ return (// eslint-disable-next-line react/jsx-pascal-case
92
+ ___EmotionJSX(EuiButtonDisplayDeprecated, _extends({
93
+ element: element,
94
+ baseClassName: "euiButton",
95
+ ref: buttonRef
96
+ }, elementProps, relObj, rest))
97
+ );
96
98
  };
97
99
  EuiButton.displayName = 'EuiButton';
98
100
 
99
101
  /**
102
+ * *DEPRECATED*
100
103
  * EuiButtonDisplay is an internal-only component used for displaying
101
104
  * any element as a button.
102
105
  * NOTE: This component *must* be below EuiButton in the file and
103
106
  * EuiButton must also set a displayName for react-docgen-typescript
104
107
  * to correctly set EuiButton's docgenInfo and display a props table.
108
+ * This component has been deprecated in favor of the new EuiButtonDisplay
109
+ * that can be found in `src/components/button/button_display/_button_display.tsx`
105
110
  */
106
- export var EuiButtonDisplay = /*#__PURE__*/forwardRef(function (_ref2, ref) {
111
+ export var EuiButtonDisplayDeprecated = /*#__PURE__*/forwardRef(function (_ref2, ref) {
107
112
  var _ref2$element = _ref2.element,
108
113
  element = _ref2$element === void 0 ? 'button' : _ref2$element,
109
114
  baseClassName = _ref2.baseClassName,
@@ -166,4 +171,4 @@ export var EuiButtonDisplay = /*#__PURE__*/forwardRef(function (_ref2, ref) {
166
171
  ref: ref
167
172
  }, rest), innerNode);
168
173
  });
169
- EuiButtonDisplay.displayName = 'EuiButtonDisplay';
174
+ EuiButtonDisplayDeprecated.displayName = 'EuiButtonDisplay';