@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,73 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
+ var _excluded = ["element", "children", "iconType", "iconSide", "size", "isDisabled", "isLoading", "isSelected", "fullWidth", "minWidth", "contentProps", "textProps"];
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; }
9
+
10
+ /*
11
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
12
+ * or more contributor license agreements. Licensed under the Elastic License
13
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
14
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
15
+ * Side Public License, v 1.
16
+ */
17
+ import React, { forwardRef } from 'react'; // @ts-ignore module doesn't export `createElement`
18
+
19
+ import { createElement } from '@emotion/react';
20
+ import { useEuiTheme } from '../../../services';
21
+ import { euiButtonDisplayStyles } from './_button_display.styles';
22
+ import { EuiButtonDisplayContent } from './_button_display_content';
23
+ /**
24
+ * Extends EuiButtonDisplayContentProps which provides
25
+ * `iconType`, `iconSide`, and `textProps`
26
+ */
27
+
28
+ import { jsx as ___EmotionJSX } from "@emotion/react";
29
+
30
+ /**
31
+ * EuiButtonDisplay is an internal-only component used for displaying
32
+ * any element as a button.
33
+ */
34
+ export var EuiButtonDisplay = /*#__PURE__*/forwardRef(function (_ref, ref) {
35
+ var _ref$element = _ref.element,
36
+ element = _ref$element === void 0 ? 'button' : _ref$element,
37
+ children = _ref.children,
38
+ iconType = _ref.iconType,
39
+ iconSide = _ref.iconSide,
40
+ _ref$size = _ref.size,
41
+ size = _ref$size === void 0 ? 'm' : _ref$size,
42
+ _ref$isDisabled = _ref.isDisabled,
43
+ isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
44
+ isLoading = _ref.isLoading,
45
+ isSelected = _ref.isSelected,
46
+ fullWidth = _ref.fullWidth,
47
+ minWidth = _ref.minWidth,
48
+ contentProps = _ref.contentProps,
49
+ textProps = _ref.textProps,
50
+ rest = _objectWithoutProperties(_ref, _excluded);
51
+
52
+ var buttonIsDisabled = isLoading || isDisabled;
53
+ var minWidthPx = minWidth === 'number' ? "".concat(minWidth, "px") : minWidth;
54
+ var theme = useEuiTheme();
55
+ var styles = euiButtonDisplayStyles(theme, minWidthPx);
56
+ var cssStyles = [styles.euiButtonDisplay, styles[size], fullWidth && styles.fullWidth, isDisabled && styles.isDisabled];
57
+
58
+ var innerNode = ___EmotionJSX(EuiButtonDisplayContent, _extends({
59
+ isLoading: isLoading,
60
+ isDisabled: buttonIsDisabled,
61
+ iconType: iconType,
62
+ iconSide: iconSide,
63
+ textProps: _objectSpread({}, textProps)
64
+ }, contentProps), children);
65
+
66
+ return createElement(element, _objectSpread({
67
+ css: cssStyles,
68
+ disabled: element === 'button' && buttonIsDisabled,
69
+ 'aria-pressed': element === 'button' ? isSelected : undefined,
70
+ ref: ref
71
+ }, rest), innerNode);
72
+ });
73
+ EuiButtonDisplay.displayName = 'EuiButtonDisplay';
@@ -0,0 +1,53 @@
1
+ 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)."; }
2
+
3
+ /*
4
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
5
+ * or more contributor license agreements. Licensed under the Elastic License
6
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
7
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
8
+ * Side Public License, v 1.
9
+ */
10
+ import { css } from '@emotion/react';
11
+ import { euiFontSize, logicalCSS, logicalTextAlignStyle } from '../../../global_styling'; // Provides a solid reset and base for handling sizing layout
12
+ // Does not include any visual styles
13
+
14
+ export var euiButtonBaseCSS = function euiButtonBaseCSS() {
15
+ return "\n display: inline-block;\n appearance: none;\n cursor: pointer;\n ".concat(logicalTextAlignStyle('center'), ";\n white-space: nowrap;\n ").concat(logicalCSS('max-width', '100%'), ";\n vertical-align: middle;\n ");
16
+ };
17
+
18
+ var _buttonSize = function _buttonSize(size) {
19
+ return "\n ".concat(logicalCSS('height', size), ";\n // prevents descenders from getting cut off\n line-height: ").concat(size, ";\n ");
20
+ };
21
+
22
+ var _ref = process.env.NODE_ENV === "production" ? {
23
+ name: "15xpz7k-fullWidth",
24
+ styles: "display:block;width:100%;label:fullWidth;"
25
+ } : {
26
+ name: "15xpz7k-fullWidth",
27
+ styles: "display:block;width:100%;label:fullWidth;",
28
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
29
+ };
30
+
31
+ var _ref2 = process.env.NODE_ENV === "production" ? {
32
+ name: "8595p9-isDisabled",
33
+ styles: "cursor:not-allowed;label:isDisabled;"
34
+ } : {
35
+ name: "8595p9-isDisabled",
36
+ styles: "cursor:not-allowed;label:isDisabled;",
37
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
38
+ };
39
+
40
+ export var euiButtonDisplayStyles = function euiButtonDisplayStyles(euiThemeContext, minWidth) {
41
+ var euiTheme = euiThemeContext.euiTheme;
42
+ return {
43
+ // Base
44
+ euiButtonDisplay: /*#__PURE__*/css(euiButtonBaseCSS(), ";", minWidth && logicalCSS('min-width', minWidth), ";;label:euiButtonDisplay;"),
45
+ // States
46
+ isDisabled: _ref2,
47
+ fullWidth: _ref,
48
+ // Sizes
49
+ xs: /*#__PURE__*/css(_buttonSize(euiTheme.size.l), euiFontSize(euiThemeContext, 'xs'), ";label:xs;"),
50
+ s: /*#__PURE__*/css(_buttonSize(euiTheme.size.xl), euiFontSize(euiThemeContext, 's'), ";label:s;"),
51
+ m: /*#__PURE__*/css(_buttonSize(euiTheme.size.xxl), euiFontSize(euiThemeContext, 's'), ";label:m;")
52
+ };
53
+ };
@@ -0,0 +1,67 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["children", "textProps", "isLoading", "isDisabled", "iconType", "iconSize", "iconSide"];
4
+
5
+ /*
6
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
7
+ * or more contributor license agreements. Licensed under the Elastic License
8
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
9
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
10
+ * Side Public License, v 1.
11
+ */
12
+ import React from 'react';
13
+ import { useEuiTheme } from '../../../services';
14
+ import { EuiLoadingSpinner } from '../../loading';
15
+ import { EuiIcon } from '../../icon';
16
+ import { euiButtonDisplayContentStyles } from './_button_display_content.styles';
17
+ import { jsx as ___EmotionJSX } from "@emotion/react";
18
+ export var EuiButtonDisplayContent = function EuiButtonDisplayContent(_ref) {
19
+ var children = _ref.children,
20
+ textProps = _ref.textProps,
21
+ _ref$isLoading = _ref.isLoading,
22
+ isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
23
+ _ref$isDisabled = _ref.isDisabled,
24
+ isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
25
+ iconType = _ref.iconType,
26
+ _ref$iconSize = _ref.iconSize,
27
+ iconSize = _ref$iconSize === void 0 ? 'm' : _ref$iconSize,
28
+ iconSide = _ref.iconSide,
29
+ contentProps = _objectWithoutProperties(_ref, _excluded);
30
+
31
+ var theme = useEuiTheme();
32
+ var styles = euiButtonDisplayContentStyles(theme);
33
+ var cssStyles = [styles.euiButtonDisplayContent, iconSide && styles[iconSide], isDisabled && styles.isDisabled];
34
+ var cssSpinnerStyles = [styles.euiButtonDisplayContent__spinner];
35
+ var cssIconStyles = [styles.euiButtonDisplayContent__icon]; // Add an icon to the button if one exists.
36
+
37
+ var icon; // When the button is disabled the text gets gray
38
+ // and in some buttons the background gets a light gray
39
+ // for better contrast we want to change the border of the spinner
40
+ // to have the same color of the text. This way we ensure the borders
41
+ // are always visible. The default spinner color could be very light.
42
+
43
+ var loadingSpinnerColor = isDisabled ? {
44
+ border: 'currentColor'
45
+ } : undefined;
46
+
47
+ if (isLoading) {
48
+ icon = ___EmotionJSX(EuiLoadingSpinner, {
49
+ css: cssSpinnerStyles,
50
+ size: iconSize,
51
+ color: loadingSpinnerColor
52
+ });
53
+ } else if (iconType) {
54
+ icon = ___EmotionJSX(EuiIcon, {
55
+ css: cssIconStyles,
56
+ type: iconType,
57
+ size: iconSize,
58
+ color: "inherit" // forces the icon to inherit its parent color
59
+
60
+ });
61
+ }
62
+
63
+ var isText = typeof children === 'string';
64
+ return ___EmotionJSX("span", _extends({}, contentProps, {
65
+ css: cssStyles
66
+ }), icon, isText ? ___EmotionJSX("span", textProps, children) : children);
67
+ };
@@ -0,0 +1,61 @@
1
+ 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)."; }
2
+
3
+ /*
4
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
5
+ * or more contributor license agreements. Licensed under the Elastic License
6
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
7
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
8
+ * Side Public License, v 1.
9
+ */
10
+ import { css } from '@emotion/react';
11
+ import { logicalCSS } from '../../../global_styling';
12
+
13
+ var _ref = process.env.NODE_ENV === "production" ? {
14
+ name: "ske5nx-isDisabled",
15
+ styles: "pointer-events:auto;cursor:not-allowed;label:isDisabled;"
16
+ } : {
17
+ name: "ske5nx-isDisabled",
18
+ styles: "pointer-events:auto;cursor:not-allowed;label:isDisabled;",
19
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
20
+ };
21
+
22
+ var _ref2 = process.env.NODE_ENV === "production" ? {
23
+ name: "gtg6j-euiButtonDisplayContent__icon",
24
+ styles: "flex-shrink:0;label:euiButtonDisplayContent__icon;"
25
+ } : {
26
+ name: "gtg6j-euiButtonDisplayContent__icon",
27
+ styles: "flex-shrink:0;label:euiButtonDisplayContent__icon;",
28
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
29
+ };
30
+
31
+ var _ref3 = process.env.NODE_ENV === "production" ? {
32
+ name: "10wlo76-euiButtonDisplayContent__spinner",
33
+ styles: "flex-shrink:0;label:euiButtonDisplayContent__spinner;"
34
+ } : {
35
+ name: "10wlo76-euiButtonDisplayContent__spinner",
36
+ styles: "flex-shrink:0;label:euiButtonDisplayContent__spinner;",
37
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
38
+ };
39
+
40
+ var _ref4 = process.env.NODE_ENV === "production" ? {
41
+ name: "qfl6yj-right",
42
+ styles: "flex-direction:row-reverse;label:right;"
43
+ } : {
44
+ name: "qfl6yj-right",
45
+ styles: "flex-direction:row-reverse;label:right;",
46
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
47
+ };
48
+
49
+ export var euiButtonDisplayContentStyles = function euiButtonDisplayContentStyles(_ref5) {
50
+ var euiTheme = _ref5.euiTheme;
51
+ return {
52
+ // Base
53
+ euiButtonDisplayContent: /*#__PURE__*/css(logicalCSS('height', '100%'), ";", logicalCSS('width', '100%'), ";display:flex;justify-content:center;align-items:center;vertical-align:middle;gap:", euiTheme.size.s, ";;label:euiButtonDisplayContent;"),
54
+ // Icon side
55
+ left: /*#__PURE__*/css(";label:left;"),
56
+ right: _ref4,
57
+ euiButtonDisplayContent__spinner: _ref3,
58
+ euiButtonDisplayContent__icon: _ref2,
59
+ isDisabled: _ref
60
+ };
61
+ };
@@ -18,7 +18,7 @@ import React from 'react';
18
18
  import classNames from 'classnames';
19
19
  import { keysOf } from '../../common';
20
20
  import { getSecureRelForTarget } from '../../../services';
21
- import { EuiButtonContent } from '../button_content';
21
+ import { EuiButtonContentDeprecated as EuiButtonContent } from '../_button_content_deprecated';
22
22
  import { validateHref } from '../../../services/security/href_validator';
23
23
  import { jsx as ___EmotionJSX } from "@emotion/react";
24
24
  var colorToClassNameMap = {
@@ -17,7 +17,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
17
17
  */
18
18
  import classNames from 'classnames';
19
19
  import React from 'react';
20
- import { EuiButtonDisplay } from '../button';
20
+ import { EuiButtonDisplayDeprecated as EuiButtonDisplay } from '../button';
21
21
  import { useInnerText } from '../../inner_text';
22
22
  import { useGeneratedHtmlId } from '../../../services';
23
23
  import { jsx as ___EmotionJSX } from "@emotion/react";
@@ -83,7 +83,8 @@ export var EuiCallOut = /*#__PURE__*/forwardRef(function (_ref, ref) {
83
83
  css: cssStyles,
84
84
  paddingSize: size === 's' ? 's' : 'm',
85
85
  className: classes,
86
- panelRef: ref
86
+ panelRef: ref,
87
+ grow: false
87
88
  }, rest), header, optionalChildren);
88
89
  });
89
90
  EuiCallOut.displayName = 'EuiCallOut';
@@ -14,6 +14,10 @@ import classNames from 'classnames';
14
14
  import { EuiNotificationBadge } from '../badge';
15
15
  import { EuiLoadingSpinner } from '../loading';
16
16
  import { EuiInnerText } from '../inner_text';
17
+ import { cloneElementWithCss } from '../../services/theme/clone_element';
18
+ import { useEuiTheme } from '../../services';
19
+ import { euiFacetButtonStyles, euiFacetButtonTextStyles, euiFacetButtonIconStyles, euiFacetButtonQuantityStyles, euiFacetButtonLoadingSpinnerStyles } from './facet_button.styles';
20
+ import { EuiButtonDisplay } from '../button/button_display/_button_display';
17
21
  import { jsx as ___EmotionJSX } from "@emotion/react";
18
22
  export var EuiFacetButton = function EuiFacetButton(_ref) {
19
23
  var children = _ref.children,
@@ -31,20 +35,30 @@ export var EuiFacetButton = function EuiFacetButton(_ref) {
31
35
 
32
36
  // If in the loading state, force disabled to true
33
37
  isDisabled = isLoading ? true : isDisabled;
34
- var classes = classNames('euiFacetButton', {
35
- 'euiFacetButton--isSelected': isSelected,
36
- 'euiFacetButton--unSelected': !isSelected
37
- }, className); // Add quantity number if provided or loading indicator
38
+ var selection = isSelected ? 'isSelected' : 'unSelected';
39
+ var classes = classNames('euiFacetButton', className);
40
+ var theme = useEuiTheme();
41
+ var styles = euiFacetButtonStyles(theme);
42
+ var cssStyles = [styles.euiFacetButton];
43
+ var textStyles = euiFacetButtonTextStyles(theme);
44
+ var cssTextStyles = [textStyles.euiFacetButton__text, textStyles[selection]];
45
+ var quantityStyles = euiFacetButtonQuantityStyles();
46
+ var cssQuantityStyles = [quantityStyles.euiFacetButton__quantity, isDisabled && quantityStyles.isDisabled];
47
+ var iconStyles = euiFacetButtonIconStyles();
48
+ var cssIconStyles = [iconStyles.euiFacetButton__icon, isDisabled && quantityStyles.isDisabled];
49
+ var loadingSpinnerStyles = euiFacetButtonLoadingSpinnerStyles();
50
+ var cssLoadingSpinnerStyles = [loadingSpinnerStyles.euiFacetButton__loadingSpinner]; // Add quantity number if provided or loading indicator
38
51
 
39
52
  var buttonQuantity;
40
53
 
41
54
  if (isLoading) {
42
55
  buttonQuantity = ___EmotionJSX(EuiLoadingSpinner, {
43
- className: "euiFacetButton__spinner",
56
+ css: cssLoadingSpinnerStyles,
44
57
  size: "m"
45
58
  });
46
59
  } else if (typeof quantity === 'number') {
47
60
  buttonQuantity = ___EmotionJSX(EuiNotificationBadge, {
61
+ css: cssQuantityStyles,
48
62
  className: "euiFacetButton__quantity",
49
63
  size: "m",
50
64
  color: !isSelected || isDisabled ? 'subdued' : 'accent'
@@ -55,24 +69,26 @@ export var EuiFacetButton = function EuiFacetButton(_ref) {
55
69
  var buttonIcon;
56
70
 
57
71
  if ( /*#__PURE__*/React.isValidElement(icon)) {
58
- buttonIcon = /*#__PURE__*/React.cloneElement(icon, {
59
- className: classNames(icon.props.className, 'euiFacetButton__icon')
72
+ buttonIcon = cloneElementWithCss(icon, {
73
+ css: cssIconStyles,
74
+ className: 'euiFacetButton__icon'
60
75
  });
61
76
  }
62
77
 
63
78
  return ___EmotionJSX(EuiInnerText, null, function (ref, innerText) {
64
- return ___EmotionJSX("button", _extends({
79
+ return ___EmotionJSX(EuiButtonDisplay, _extends({
65
80
  className: classes,
66
- disabled: isDisabled,
67
- type: "button",
81
+ css: cssStyles,
82
+ element: "button",
83
+ isDisabled: isDisabled,
68
84
  ref: buttonRef,
69
- title: rest['aria-label'] || innerText
70
- }, rest), ___EmotionJSX("span", {
71
- className: "euiFacetButton__content"
72
- }, buttonIcon, ___EmotionJSX("span", {
85
+ title: rest['aria-label'] || innerText,
86
+ size: "s"
87
+ }, rest), buttonIcon, ___EmotionJSX("span", {
88
+ css: cssTextStyles,
73
89
  className: "euiFacetButton__text",
74
90
  "data-text": innerText,
75
91
  ref: ref
76
- }, children), buttonQuantity));
92
+ }, children), buttonQuantity);
77
93
  });
78
94
  };
@@ -0,0 +1,64 @@
1
+ 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)."; }
2
+
3
+ /*
4
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
5
+ * or more contributor license agreements. Licensed under the Elastic License
6
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
7
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
8
+ * Side Public License, v 1.
9
+ */
10
+ import { css } from '@emotion/react';
11
+ import { euiTextTruncate, euiTextShift, logicalTextAlignCSS } from '../../global_styling';
12
+ import { euiLinkFocusCSS } from '../link/link.styles';
13
+ export var euiFacetButtonStyles = function euiFacetButtonStyles(_ref3) {
14
+ var euiTheme = _ref3.euiTheme;
15
+ return {
16
+ // Base
17
+ euiFacetButton: /*#__PURE__*/css(logicalTextAlignCSS('left'), ";&:hover,&:focus{&:not(:disabled) [class*='euiFacetButton__text']{text-decoration:underline;}}&:focus:not(:disabled) [class*='euiFacetButton__text']{", euiLinkFocusCSS(euiTheme), ";}&:disabled{color:", euiTheme.colors.disabledText, ";pointer-events:none;&:hover,&:focus{text-decoration:none;}};label:euiFacetButton;")
18
+ };
19
+ };
20
+ export var euiFacetButtonTextStyles = function euiFacetButtonTextStyles(_ref4) {
21
+ var euiTheme = _ref4.euiTheme;
22
+ return {
23
+ euiFacetButton__text: /*#__PURE__*/css(euiTextShift('bold', 'data-text', euiTheme), " ", euiTextTruncate(), " flex-grow:1;;label:euiFacetButton__text;"),
24
+ isSelected: /*#__PURE__*/css("font-weight:", euiTheme.font.weight.bold, ";;label:isSelected;"),
25
+ unSelected: /*#__PURE__*/css(";label:unSelected;")
26
+ };
27
+ };
28
+
29
+ var _ref2 = process.env.NODE_ENV === "production" ? {
30
+ name: "mpq8zy-isDisabled",
31
+ styles: "opacity:0.5;label:isDisabled;"
32
+ } : {
33
+ name: "mpq8zy-isDisabled",
34
+ styles: "opacity:0.5;label:isDisabled;",
35
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
36
+ };
37
+
38
+ export var euiFacetButtonIconStyles = function euiFacetButtonIconStyles() {
39
+ return {
40
+ euiFacetButton__icon: /*#__PURE__*/css(";label:euiFacetButton__icon;"),
41
+ isDisabled: _ref2
42
+ };
43
+ };
44
+ export var euiFacetButtonLoadingSpinnerStyles = function euiFacetButtonLoadingSpinnerStyles() {
45
+ return {
46
+ euiFacetButton__loadingSpinner: /*#__PURE__*/css(";label:euiFacetButton__loadingSpinner;")
47
+ };
48
+ };
49
+
50
+ var _ref = process.env.NODE_ENV === "production" ? {
51
+ name: "mpq8zy-isDisabled",
52
+ styles: "opacity:0.5;label:isDisabled;"
53
+ } : {
54
+ name: "mpq8zy-isDisabled",
55
+ styles: "opacity:0.5;label:isDisabled;",
56
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
57
+ };
58
+
59
+ export var euiFacetButtonQuantityStyles = function euiFacetButtonQuantityStyles() {
60
+ return {
61
+ euiFacetButton__quantity: /*#__PURE__*/css(";label:euiFacetButton__quantity;"),
62
+ isDisabled: _ref
63
+ };
64
+ };
@@ -11,21 +11,11 @@ var _excluded = ["children", "className", "layout", "gutterSize"];
11
11
  */
12
12
  import React from 'react';
13
13
  import classNames from 'classnames';
14
- import { keysOf } from '../common';
15
- import { EuiFlexGroup } from '../flex';
14
+ import { useEuiTheme } from '../../services';
15
+ import { euiFacetGroupStyles } from './facet_group.styles';
16
16
  import { jsx as ___EmotionJSX } from "@emotion/react";
17
- var layoutToClassNameMap = {
18
- vertical: 'euiFacetGroup--vertical',
19
- horizontal: 'euiFacetGroup--horizontal'
20
- };
21
- export var LAYOUTS = keysOf(layoutToClassNameMap);
22
- var gutterSizeToClassNameMap = {
23
- none: 'euiFacetGroup--gutterNone',
24
- s: 'euiFacetGroup--gutterSmall',
25
- m: 'euiFacetGroup--gutterMedium',
26
- l: 'euiFacetGroup--gutterLarge'
27
- };
28
- export var GUTTER_SIZES = keysOf(gutterSizeToClassNameMap);
17
+ export var LAYOUTS = ['vertical', 'horizontal'];
18
+ export var GUTTER_SIZES = ['none', 's', 'm', 'l'];
29
19
  export var EuiFacetGroup = function EuiFacetGroup(_ref) {
30
20
  var children = _ref.children,
31
21
  className = _ref.className,
@@ -35,13 +25,12 @@ export var EuiFacetGroup = function EuiFacetGroup(_ref) {
35
25
  gutterSize = _ref$gutterSize === void 0 ? 'm' : _ref$gutterSize,
36
26
  rest = _objectWithoutProperties(_ref, _excluded);
37
27
 
38
- var classes = classNames('euiFacetGroup', layoutToClassNameMap[layout], gutterSizeToClassNameMap[gutterSize], className);
39
- var direction = layout === 'vertical' ? 'column' : 'row';
40
- var wrap = layout === 'vertical' ? false : true;
41
- return ___EmotionJSX(EuiFlexGroup, _extends({
28
+ var theme = useEuiTheme();
29
+ var styles = euiFacetGroupStyles(theme, layout);
30
+ var cssStyles = [styles.euiFacetGroup, styles[gutterSize], styles[layout]];
31
+ var classes = classNames('euiFacetGroup', className);
32
+ return ___EmotionJSX("div", _extends({
42
33
  className: classes,
43
- direction: direction,
44
- wrap: wrap,
45
- gutterSize: "none"
34
+ css: cssStyles
46
35
  }, rest), children);
47
36
  };
@@ -0,0 +1,79 @@
1
+ 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)."; }
2
+
3
+ /*
4
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
5
+ * or more contributor license agreements. Licensed under the Elastic License
6
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
7
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
8
+ * Side Public License, v 1.
9
+ */
10
+ import { css } from '@emotion/react';
11
+ import { useEuiTheme } from '../../services';
12
+
13
+ var _facetGroupGutterSize = function _facetGroupGutterSize(_ref4) {
14
+ var gutterSize = _ref4.gutterSize,
15
+ layout = _ref4.layout;
16
+
17
+ var _useEuiTheme = useEuiTheme(),
18
+ euiTheme = _useEuiTheme.euiTheme;
19
+
20
+ var isHorizontalLayout = layout === 'horizontal';
21
+ var gutterHorizontal = "calc(".concat(euiTheme.size.m, " + ").concat(gutterSize, ")");
22
+ var gutterVertical = gutterSize;
23
+ return isHorizontalLayout ? "gap: ".concat(gutterVertical, " ").concat(gutterHorizontal, ";") : "gap: ".concat(gutterVertical, " 0;");
24
+ };
25
+
26
+ var _ref = process.env.NODE_ENV === "production" ? {
27
+ name: "omnk2l-vertical",
28
+ styles: "flex-direction:column;label:vertical;"
29
+ } : {
30
+ name: "omnk2l-vertical",
31
+ styles: "flex-direction:column;label:vertical;",
32
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
33
+ };
34
+
35
+ var _ref2 = process.env.NODE_ENV === "production" ? {
36
+ name: "envaaw-horizontal",
37
+ styles: "flex-direction:row;flex-wrap:wrap;label:horizontal;"
38
+ } : {
39
+ name: "envaaw-horizontal",
40
+ styles: "flex-direction:row;flex-wrap:wrap;label:horizontal;",
41
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
42
+ };
43
+
44
+ var _ref3 = process.env.NODE_ENV === "production" ? {
45
+ name: "1g68sie-euiFacetGroup",
46
+ styles: "display:flex;flex-grow:1;label:euiFacetGroup;"
47
+ } : {
48
+ name: "1g68sie-euiFacetGroup",
49
+ styles: "display:flex;flex-grow:1;label:euiFacetGroup;",
50
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
51
+ };
52
+
53
+ export var euiFacetGroupStyles = function euiFacetGroupStyles(_ref5, layout) {
54
+ var euiTheme = _ref5.euiTheme;
55
+ return {
56
+ // Base
57
+ euiFacetGroup: _ref3,
58
+ // Gutter sizes
59
+ none: /*#__PURE__*/css(_facetGroupGutterSize({
60
+ gutterSize: '0',
61
+ layout: layout
62
+ }), ";label:none;"),
63
+ s: /*#__PURE__*/css(_facetGroupGutterSize({
64
+ gutterSize: euiTheme.size.xs,
65
+ layout: layout
66
+ }), ";label:s;"),
67
+ m: /*#__PURE__*/css(_facetGroupGutterSize({
68
+ gutterSize: euiTheme.size.s,
69
+ layout: layout
70
+ }), ";label:m;"),
71
+ l: /*#__PURE__*/css(_facetGroupGutterSize({
72
+ gutterSize: euiTheme.size.m,
73
+ layout: layout
74
+ }), ";label:l;"),
75
+ // layouts
76
+ horizontal: _ref2,
77
+ vertical: _ref
78
+ };
79
+ };
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["size", "className", "aria-label"];
3
+ var _excluded = ["size", "className", "aria-label", "color"];
4
4
 
5
5
  /*
6
6
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@@ -21,10 +21,11 @@ export var EuiLoadingSpinner = function EuiLoadingSpinner(_ref) {
21
21
  size = _ref$size === void 0 ? 'm' : _ref$size,
22
22
  className = _ref.className,
23
23
  ariaLabel = _ref['aria-label'],
24
+ color = _ref.color,
24
25
  rest = _objectWithoutProperties(_ref, _excluded);
25
26
 
26
27
  var euiTheme = useEuiTheme();
27
- var styles = euiLoadingSpinnerStyles(euiTheme);
28
+ var styles = euiLoadingSpinnerStyles(euiTheme, color);
28
29
  var cssStyles = [styles.euiLoadingSpinner, styles[size]];
29
30
  var classes = classNames('euiLoadingSpinner', className);
30
31
  var defaultLabel = useLoadingAriaLabel();
@@ -22,14 +22,14 @@ var spinnerSizes = {
22
22
  xxl: 'xxl'
23
23
  };
24
24
 
25
- var spinnerColors = function spinnerColors(main, highlight) {
26
- return "".concat(highlight, " ").concat(main, " ").concat(main, " ").concat(main);
25
+ var spinnerColorsCSS = function spinnerColorsCSS(border, highlight) {
26
+ return "\n border-color: ".concat(highlight, " ").concat(border, " ").concat(border, " ").concat(border, ";\n ");
27
27
  };
28
28
 
29
- export var euiLoadingSpinnerStyles = function euiLoadingSpinnerStyles(_ref) {
29
+ export var euiLoadingSpinnerStyles = function euiLoadingSpinnerStyles(_ref, color) {
30
30
  var euiTheme = _ref.euiTheme;
31
31
  return {
32
- euiLoadingSpinner: /*#__PURE__*/css("flex-shrink:0;display:inline-block;border-radius:50%;border:", euiTheme.border.thick, ";border-color:", spinnerColors(euiTheme.border.color, euiTheme.colors.primary), ";", euiCanAnimate, "{animation:", _loadingSpinner, " 0.6s infinite linear;};label:euiLoadingSpinner;"),
32
+ euiLoadingSpinner: /*#__PURE__*/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), ";", euiCanAnimate, "{animation:", _loadingSpinner, " 0.6s infinite linear;};label:euiLoadingSpinner;"),
33
33
  // Sizes
34
34
  s: /*#__PURE__*/css("width:", euiTheme.size[spinnerSizes.s], ";height:", euiTheme.size[spinnerSizes.s], ";border-width:calc(", euiTheme.border.width.thin, " * 1.5);;label:s;"),
35
35
  m: /*#__PURE__*/css("width:", euiTheme.size[spinnerSizes.m], ";height:", euiTheme.size[spinnerSizes.m], ";border-width:calc(", euiTheme.border.width.thin, " * 1.5);;label:m;"),
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["size", "color", "grow", "textAlign", "children", "className", "style"];
3
+ var _excluded = ["size", "color", "grow", "textAlign", "children", "className"];
4
4
 
5
5
  /*
6
6
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@@ -26,7 +26,6 @@ export var EuiText = function EuiText(_ref) {
26
26
  textAlign = _ref.textAlign,
27
27
  children = _ref.children,
28
28
  className = _ref.className,
29
- style = _ref.style,
30
29
  rest = _objectWithoutProperties(_ref, _excluded);
31
30
 
32
31
  var euiTheme = useEuiTheme();
@@ -42,7 +41,6 @@ export var EuiText = function EuiText(_ref) {
42
41
  if (color) {
43
42
  text = ___EmotionJSX(EuiTextColor, {
44
43
  color: color,
45
- style: style,
46
44
  cloneElement: true
47
45
  }, text);
48
46
  }
@@ -13,7 +13,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
13
13
  * in compliance with, at your election, the Elastic License 2.0 or the Server
14
14
  * Side Public License, v 1.
15
15
  */
16
- import React from 'react';
16
+ import React, { isValidElement } from 'react';
17
17
  import { cloneElementWithCss } from '../../services/theme/clone_element';
18
18
  import { euiTextAlignStyles } from './text_align.styles';
19
19
  import { jsx as ___EmotionJSX } from "@emotion/react";
@@ -33,7 +33,7 @@ export var EuiTextAlign = function EuiTextAlign(_ref) {
33
33
  css: cssStyles
34
34
  }, rest);
35
35
 
36
- if (cloneElement) {
36
+ if ( /*#__PURE__*/isValidElement(children) && cloneElement) {
37
37
  return cloneElementWithCss(children, props);
38
38
  } else {
39
39
  return ___EmotionJSX("div", props, children);