@elastic/eui 95.6.0 → 95.7.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 (181) hide show
  1. package/dist/eui_theme_dark.css +0 -642
  2. package/dist/eui_theme_dark.min.css +1 -1
  3. package/dist/eui_theme_light.css +0 -642
  4. package/dist/eui_theme_light.min.css +1 -1
  5. package/es/components/combo_box/combo_box.js +54 -50
  6. package/es/components/combo_box/combo_box.styles.js +14 -0
  7. package/es/components/combo_box/combo_box_input/combo_box_input.js +69 -62
  8. package/es/components/combo_box/combo_box_input/combo_box_input.styles.js +60 -0
  9. package/es/components/combo_box/combo_box_input/combo_box_pill.js +50 -138
  10. package/es/components/combo_box/combo_box_input/combo_box_pill.styles.js +25 -0
  11. package/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +31 -23
  12. package/es/components/combo_box/combo_box_options_list/combo_box_options_list.styles.js +22 -0
  13. package/es/components/combo_box/combo_box_options_list/index.js +0 -1
  14. package/es/components/combo_box/utils.js +26 -3
  15. package/es/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.styles.js +3 -4
  16. package/es/components/flyout/flyout.styles.js +3 -3
  17. package/es/components/form/form.styles.js +16 -8
  18. package/es/components/list_group/list_group.styles.js +3 -3
  19. package/es/components/popover/input_popover.js +3 -3
  20. package/es/components/search_bar/search_bar.styles.js +2 -4
  21. package/es/components/selectable/selectable.js +9 -8
  22. package/es/components/selectable/selectable.styles.js +22 -0
  23. package/es/components/selectable/selectable_list/selectable_list.js +38 -29
  24. package/es/components/selectable/selectable_list/selectable_list.styles.js +35 -0
  25. package/es/components/selectable/selectable_list/selectable_list_item.js +18 -17
  26. package/es/components/selectable/selectable_list/selectable_list_item.styles.js +56 -0
  27. package/es/components/selectable/selectable_message/selectable_message.js +6 -3
  28. package/es/components/selectable/selectable_message/selectable_message.styles.js +17 -0
  29. package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +12 -9
  30. package/es/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +47 -0
  31. package/es/components/selectable/selectable_templates/selectable_template_sitewide_option.js +40 -10
  32. package/es/services/theme/index.js +1 -1
  33. package/es/services/theme/style_memoization.js +14 -0
  34. package/eui.d.ts +146 -46
  35. package/i18ntokens.json +118 -118
  36. package/lib/components/combo_box/combo_box.js +53 -49
  37. package/lib/components/combo_box/combo_box.styles.js +20 -0
  38. package/lib/components/combo_box/combo_box_input/combo_box_input.js +68 -61
  39. package/lib/components/combo_box/combo_box_input/combo_box_input.styles.js +64 -0
  40. package/lib/components/combo_box/combo_box_input/combo_box_pill.js +55 -144
  41. package/lib/components/combo_box/combo_box_input/combo_box_pill.styles.js +31 -0
  42. package/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +31 -23
  43. package/lib/components/combo_box/combo_box_options_list/combo_box_options_list.styles.js +28 -0
  44. package/lib/components/combo_box/combo_box_options_list/index.js +0 -7
  45. package/lib/components/combo_box/utils.js +29 -9
  46. package/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.styles.js +2 -3
  47. package/lib/components/flyout/flyout.styles.js +2 -2
  48. package/lib/components/form/form.styles.js +16 -9
  49. package/lib/components/list_group/list_group.styles.js +2 -2
  50. package/lib/components/popover/input_popover.js +2 -2
  51. package/lib/components/search_bar/search_bar.styles.js +1 -3
  52. package/lib/components/selectable/selectable.js +9 -8
  53. package/lib/components/selectable/selectable.styles.js +26 -0
  54. package/lib/components/selectable/selectable_list/selectable_list.js +38 -29
  55. package/lib/components/selectable/selectable_list/selectable_list.styles.js +38 -0
  56. package/lib/components/selectable/selectable_list/selectable_list_item.js +18 -16
  57. package/lib/components/selectable/selectable_list/selectable_list_item.styles.js +60 -0
  58. package/lib/components/selectable/selectable_message/selectable_message.js +6 -3
  59. package/lib/components/selectable/selectable_message/selectable_message.styles.js +23 -0
  60. package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +11 -8
  61. package/lib/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +51 -0
  62. package/lib/components/selectable/selectable_templates/selectable_template_sitewide_option.js +40 -10
  63. package/lib/services/theme/index.js +6 -0
  64. package/lib/services/theme/style_memoization.js +15 -1
  65. package/optimize/es/components/combo_box/combo_box.js +54 -50
  66. package/optimize/es/components/combo_box/combo_box.styles.js +14 -0
  67. package/optimize/es/components/combo_box/combo_box_input/combo_box_input.js +64 -62
  68. package/optimize/es/components/combo_box/combo_box_input/combo_box_input.styles.js +60 -0
  69. package/optimize/es/components/combo_box/combo_box_input/combo_box_pill.js +51 -78
  70. package/optimize/es/components/combo_box/combo_box_input/combo_box_pill.styles.js +25 -0
  71. package/optimize/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +31 -23
  72. package/optimize/es/components/combo_box/combo_box_options_list/combo_box_options_list.styles.js +22 -0
  73. package/optimize/es/components/combo_box/combo_box_options_list/index.js +0 -1
  74. package/optimize/es/components/combo_box/utils.js +23 -3
  75. package/optimize/es/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.styles.js +3 -4
  76. package/optimize/es/components/flyout/flyout.styles.js +3 -3
  77. package/optimize/es/components/form/form.styles.js +16 -8
  78. package/optimize/es/components/list_group/list_group.styles.js +3 -3
  79. package/optimize/es/components/popover/input_popover.js +3 -3
  80. package/optimize/es/components/search_bar/search_bar.styles.js +2 -4
  81. package/optimize/es/components/selectable/selectable.js +9 -8
  82. package/optimize/es/components/selectable/selectable.styles.js +22 -0
  83. package/optimize/es/components/selectable/selectable_list/selectable_list.js +38 -29
  84. package/optimize/es/components/selectable/selectable_list/selectable_list.styles.js +35 -0
  85. package/optimize/es/components/selectable/selectable_list/selectable_list_item.js +18 -14
  86. package/optimize/es/components/selectable/selectable_list/selectable_list_item.styles.js +56 -0
  87. package/optimize/es/components/selectable/selectable_message/selectable_message.js +6 -3
  88. package/optimize/es/components/selectable/selectable_message/selectable_message.styles.js +17 -0
  89. package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide.js +12 -9
  90. package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +47 -0
  91. package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide_option.js +35 -10
  92. package/optimize/es/services/theme/index.js +1 -1
  93. package/optimize/es/services/theme/style_memoization.js +14 -0
  94. package/optimize/lib/components/combo_box/combo_box.js +53 -49
  95. package/optimize/lib/components/combo_box/combo_box.styles.js +20 -0
  96. package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.js +63 -61
  97. package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.styles.js +64 -0
  98. package/optimize/lib/components/combo_box/combo_box_input/combo_box_pill.js +52 -81
  99. package/optimize/lib/components/combo_box/combo_box_input/combo_box_pill.styles.js +31 -0
  100. package/optimize/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +31 -23
  101. package/optimize/lib/components/combo_box/combo_box_options_list/combo_box_options_list.styles.js +28 -0
  102. package/optimize/lib/components/combo_box/combo_box_options_list/index.js +0 -7
  103. package/optimize/lib/components/combo_box/utils.js +26 -9
  104. package/optimize/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.styles.js +2 -3
  105. package/optimize/lib/components/flyout/flyout.styles.js +2 -2
  106. package/optimize/lib/components/form/form.styles.js +16 -9
  107. package/optimize/lib/components/list_group/list_group.styles.js +2 -2
  108. package/optimize/lib/components/popover/input_popover.js +2 -2
  109. package/optimize/lib/components/search_bar/search_bar.styles.js +1 -3
  110. package/optimize/lib/components/selectable/selectable.js +9 -8
  111. package/optimize/lib/components/selectable/selectable.styles.js +26 -0
  112. package/optimize/lib/components/selectable/selectable_list/selectable_list.js +38 -29
  113. package/optimize/lib/components/selectable/selectable_list/selectable_list.styles.js +38 -0
  114. package/optimize/lib/components/selectable/selectable_list/selectable_list_item.js +18 -14
  115. package/optimize/lib/components/selectable/selectable_list/selectable_list_item.styles.js +60 -0
  116. package/optimize/lib/components/selectable/selectable_message/selectable_message.js +6 -3
  117. package/optimize/lib/components/selectable/selectable_message/selectable_message.styles.js +23 -0
  118. package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +11 -8
  119. package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +51 -0
  120. package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide_option.js +35 -10
  121. package/optimize/lib/services/theme/index.js +6 -0
  122. package/optimize/lib/services/theme/style_memoization.js +15 -1
  123. package/package.json +1 -1
  124. package/src/components/index.scss +0 -2
  125. package/src/themes/amsterdam/overrides/_index.scss +0 -1
  126. package/test-env/components/combo_box/combo_box.js +53 -49
  127. package/test-env/components/combo_box/combo_box.styles.js +20 -0
  128. package/test-env/components/combo_box/combo_box_input/combo_box_input.js +63 -61
  129. package/test-env/components/combo_box/combo_box_input/combo_box_input.styles.js +64 -0
  130. package/test-env/components/combo_box/combo_box_input/combo_box_pill.js +51 -135
  131. package/test-env/components/combo_box/combo_box_input/combo_box_pill.styles.js +31 -0
  132. package/test-env/components/combo_box/combo_box_options_list/combo_box_options_list.js +31 -23
  133. package/test-env/components/combo_box/combo_box_options_list/combo_box_options_list.styles.js +28 -0
  134. package/test-env/components/combo_box/combo_box_options_list/index.js +0 -7
  135. package/test-env/components/combo_box/utils.js +26 -9
  136. package/test-env/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.styles.js +2 -3
  137. package/test-env/components/flyout/flyout.styles.js +2 -2
  138. package/test-env/components/form/form.styles.js +16 -9
  139. package/test-env/components/list_group/list_group.styles.js +2 -2
  140. package/test-env/components/popover/input_popover.js +2 -2
  141. package/test-env/components/search_bar/search_bar.styles.js +1 -3
  142. package/test-env/components/selectable/selectable.js +9 -8
  143. package/test-env/components/selectable/selectable.styles.js +26 -0
  144. package/test-env/components/selectable/selectable_list/selectable_list.js +38 -29
  145. package/test-env/components/selectable/selectable_list/selectable_list.styles.js +38 -0
  146. package/test-env/components/selectable/selectable_list/selectable_list_item.js +18 -14
  147. package/test-env/components/selectable/selectable_list/selectable_list_item.styles.js +60 -0
  148. package/test-env/components/selectable/selectable_message/selectable_message.js +6 -3
  149. package/test-env/components/selectable/selectable_message/selectable_message.styles.js +23 -0
  150. package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +11 -8
  151. package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +51 -0
  152. package/test-env/components/selectable/selectable_templates/selectable_template_sitewide_option.js +35 -10
  153. package/test-env/services/theme/index.js +6 -0
  154. package/test-env/services/theme/style_memoization.js +15 -1
  155. package/es/components/combo_box/combo_box_options_list/combo_box_option.js +0 -153
  156. package/lib/components/combo_box/combo_box_options_list/combo_box_option.js +0 -160
  157. package/optimize/es/components/combo_box/combo_box_options_list/combo_box_option.js +0 -90
  158. package/optimize/lib/components/combo_box/combo_box_options_list/combo_box_option.js +0 -98
  159. package/src/components/combo_box/_combo_box.scss +0 -147
  160. package/src/components/combo_box/_index.scss +0 -3
  161. package/src/components/combo_box/combo_box_input/_combo_box_pill.scss +0 -38
  162. package/src/components/combo_box/combo_box_input/_index.scss +0 -1
  163. package/src/components/combo_box/combo_box_options_list/_combo_box_option.scss +0 -72
  164. package/src/components/combo_box/combo_box_options_list/_combo_box_options_list.scss +0 -28
  165. package/src/components/combo_box/combo_box_options_list/_combo_box_title.scss +0 -12
  166. package/src/components/combo_box/combo_box_options_list/_index.scss +0 -3
  167. package/src/components/selectable/_index.scss +0 -5
  168. package/src/components/selectable/_selectable.scss +0 -8
  169. package/src/components/selectable/selectable_list/_index.scss +0 -3
  170. package/src/components/selectable/selectable_list/_selectable_list.scss +0 -38
  171. package/src/components/selectable/selectable_list/_selectable_list_item.scss +0 -62
  172. package/src/components/selectable/selectable_list/_variables.scss +0 -2
  173. package/src/components/selectable/selectable_message/_index.scss +0 -1
  174. package/src/components/selectable/selectable_message/_selectable_message.scss +0 -19
  175. package/src/components/selectable/selectable_search/_index.scss +0 -1
  176. package/src/components/selectable/selectable_search/_selectable_search.scss +0 -3
  177. package/src/components/selectable/selectable_templates/_index.scss +0 -2
  178. package/src/components/selectable/selectable_templates/_selectable_template_sitewide_option.scss +0 -39
  179. package/src/components/selectable/selectable_templates/_variables.scss +0 -26
  180. package/src/themes/amsterdam/overrides/_combo_box.scss +0 -50
  181. package/test-env/components/combo_box/combo_box_options_list/combo_box_option.js +0 -154
@@ -0,0 +1,60 @@
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
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
4
+ * or more contributor license agreements. Licensed under the Elastic License
5
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
6
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
7
+ * Side Public License, v 1.
8
+ */
9
+
10
+ import { css } from '@emotion/react';
11
+ import { logicalCSS } from '../../../global_styling';
12
+ import { euiFormControlStyles, euiFormControlDefaultShadow, euiFormControlText } from '../../form/form.styles';
13
+ var _ref = process.env.NODE_ENV === "production" ? {
14
+ name: "kedu1h-plainText",
15
+ styles: "align-items:center;cursor:text;label:plainText;"
16
+ } : {
17
+ name: "kedu1h-plainText",
18
+ styles: "align-items:center;cursor:text;label:plainText;",
19
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
20
+ };
21
+ var _ref2 = process.env.NODE_ENV === "production" ? {
22
+ name: "dkzr1g-multiSelect",
23
+ styles: "flex-wrap:wrap;label:multiSelect;"
24
+ } : {
25
+ name: "dkzr1g-multiSelect",
26
+ styles: "flex-wrap:wrap;label:multiSelect;",
27
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
28
+ };
29
+ export var euiComboBoxInputStyles = function euiComboBoxInputStyles(euiThemeContext) {
30
+ var euiTheme = euiThemeContext.euiTheme;
31
+ var formStyles = euiFormControlStyles(euiThemeContext);
32
+ return {
33
+ // Wrapper which visually mimics a form control
34
+ euiComboBoxInputWrapper: /*#__PURE__*/css(euiFormControlDefaultShadow(euiThemeContext), " display:flex;;label:euiComboBoxInputWrapper;"),
35
+ multiSelect: _ref2,
36
+ uncompressed: "\n ".concat(formStyles.uncompressed, "\n ").concat(logicalCSS('height', 'auto'), "\n ").concat(logicalCSS('padding-vertical', euiTheme.size.s), "\n ").concat(logicalCSS('padding-left', euiTheme.size.s), "\n column-gap: ").concat(euiTheme.size.s, ";\n row-gap: ").concat(euiTheme.size.xs, ";\n "),
37
+ compressed: /*#__PURE__*/css(formStyles.compressed, " ", logicalCSS('height', 'auto'), " ", logicalCSS('padding-vertical', euiTheme.size.xs), " ", logicalCSS('padding-left', euiTheme.size.xs), " column-gap:", euiTheme.size.xs, ";row-gap:", euiTheme.size.xxs, ";;label:compressed;"),
38
+ plainText: {
39
+ plainText: _ref,
40
+ compressed: "\n ".concat(logicalCSS('padding-left', euiTheme.size.s), "\n "),
41
+ uncompressed: "\n ".concat(logicalCSS('padding-left', euiTheme.size.m), "\n ")
42
+ },
43
+ invalid: /*#__PURE__*/css(formStyles.invalid, ";label:invalid;"),
44
+ disabled: /*#__PURE__*/css(formStyles.disabled, ";label:disabled;"),
45
+ open: /*#__PURE__*/css(formStyles.focus, ";label:open;"),
46
+ inGroup: /*#__PURE__*/css(formStyles.inGroup, ";label:inGroup;"),
47
+ // Actual input element, which has variable width depending on its value
48
+ euiComboBoxInput: /*#__PURE__*/css(logicalCSS('height', euiTheme.size.l), " ", logicalCSS('min-width', '2px'), " ", logicalCSS('max-width', '100%'), euiFormControlText(euiThemeContext), " background:transparent;&:disabled{color:", euiTheme.colors.disabledText, ";}appearance:none!important;border:none!important;box-shadow:none!important;outline:none!important;;label:euiComboBoxInput;"),
49
+ // EuiFormControlLayout overrides
50
+ formLayout: {
51
+ euiComboBox__formControlLayout: /*#__PURE__*/css(";label:euiComboBox__formControlLayout;"),
52
+ // Allow the form control to expand to any height to accommodate multiple rows of pills
53
+ // TODO: Remove && specificity override once EuiFormControlLayout is on Emotion
54
+ multiSelect: /*#__PURE__*/css("&&{", logicalCSS('height', 'auto'), ";};label:multiSelect;"),
55
+ // Fix overflowing input wrapper background
56
+ prependOnly: /*#__PURE__*/css(".euiFormControlLayout__childrenWrapper{", logicalCSS('border-top-right-radius', 'inherit'), " ", logicalCSS('border-bottom-right-radius', 'inherit'), ";};label:prependOnly;"),
57
+ appendOnly: /*#__PURE__*/css(".euiFormControlLayout__childrenWrapper{", logicalCSS('border-top-left-radius', 'inherit'), " ", logicalCSS('border-bottom-left-radius', 'inherit'), ";};label:appendOnly;")
58
+ }
59
+ };
60
+ };
@@ -1,21 +1,7 @@
1
1
  var _excluded = ["children", "className", "color", "onClick", "onClickAriaLabel", "onClose", "option"];
2
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
3
2
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
4
3
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
5
4
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
6
- function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
7
- function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
8
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
9
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
10
- function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
11
- function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
12
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
13
- function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
14
- function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
15
- function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
16
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
17
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
19
5
  /*
20
6
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
21
7
  * or more contributor license agreements. Licensed under the Elastic License
@@ -24,139 +10,65 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
24
10
  * Side Public License, v 1.
25
11
  */
26
12
 
27
- import React, { Component } from 'react';
28
- import PropTypes from "prop-types";
13
+ import React from 'react';
29
14
  import classNames from 'classnames';
15
+ import { useEuiMemoizedStyles } from '../../../services';
30
16
  import { EuiBadge } from '../../badge';
31
17
  import { EuiI18n } from '../../i18n';
32
18
  import { EuiComboBoxOptionAppendPrepend } from '../utils';
19
+ import { euiComboBoxPillStyles } from './combo_box_pill.styles';
33
20
  import { jsx as ___EmotionJSX } from "@emotion/react";
34
- export var EuiComboBoxPill = /*#__PURE__*/function (_Component) {
35
- function EuiComboBoxPill() {
36
- var _this;
37
- _classCallCheck(this, EuiComboBoxPill);
38
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
39
- args[_key] = arguments[_key];
40
- }
41
- _this = _callSuper(this, EuiComboBoxPill, [].concat(args));
42
- _defineProperty(_this, "onCloseButtonClick", function () {
43
- var _this$props = _this.props,
44
- onClose = _this$props.onClose,
45
- option = _this$props.option;
46
- if (onClose) {
47
- onClose(option);
48
- }
49
- });
50
- return _this;
51
- }
52
- _inherits(EuiComboBoxPill, _Component);
53
- return _createClass(EuiComboBoxPill, [{
54
- key: "render",
55
- value: function render() {
56
- var _this2 = this;
57
- var _this$props2 = this.props,
58
- children = _this$props2.children,
59
- className = _this$props2.className,
60
- color = _this$props2.color,
61
- onClick = _this$props2.onClick,
62
- onClickAriaLabel = _this$props2.onClickAriaLabel,
63
- onClose = _this$props2.onClose,
64
- option = _this$props2.option,
65
- rest = _objectWithoutProperties(_this$props2, _excluded);
66
- var classes = classNames('euiComboBoxPill', className);
67
- var onClickProps = onClick && onClickAriaLabel ? {
68
- onClick: onClick,
69
- onClickAriaLabel: onClickAriaLabel
70
- } : {};
71
- var content = ___EmotionJSX(EuiComboBoxOptionAppendPrepend, {
72
- option: option,
73
- classNamePrefix: "euiComboBoxPill"
74
- }, ___EmotionJSX("span", {
75
- className: "eui-textTruncate"
76
- }, children));
77
- if (onClose) {
78
- return ___EmotionJSX(EuiI18n, {
79
- token: "euiComboBoxPill.removeSelection",
80
- default: "Remove {children} from selection in this group",
81
- values: {
82
- children: children
83
- }
84
- }, function (removeSelection) {
85
- return ___EmotionJSX(EuiBadge, _extends({
86
- className: classes,
87
- color: color,
88
- "data-test-subj": "euiComboBoxPill",
89
- iconOnClick: _this2.onCloseButtonClick,
90
- iconOnClickAriaLabel: removeSelection,
91
- iconSide: "right",
92
- iconType: "cross",
93
- title: children
94
- }, onClickProps, rest), content);
95
- });
21
+ export var EuiComboBoxPill = function EuiComboBoxPill(_ref) {
22
+ var children = _ref.children,
23
+ className = _ref.className,
24
+ _ref$color = _ref.color,
25
+ color = _ref$color === void 0 ? 'hollow' : _ref$color,
26
+ onClick = _ref.onClick,
27
+ onClickAriaLabel = _ref.onClickAriaLabel,
28
+ onClose = _ref.onClose,
29
+ option = _ref.option,
30
+ rest = _objectWithoutProperties(_ref, _excluded);
31
+ var classes = classNames('euiComboBoxPill', className);
32
+ var styles = useEuiMemoizedStyles(euiComboBoxPillStyles);
33
+ var cssStyles = styles.euiComboBoxPill;
34
+ var onClickProps = onClick && onClickAriaLabel ? {
35
+ onClick: onClick,
36
+ onClickAriaLabel: onClickAriaLabel
37
+ } : {};
38
+ var content = ___EmotionJSX(EuiComboBoxOptionAppendPrepend, {
39
+ option: option,
40
+ classNamePrefix: "euiComboBoxPill"
41
+ }, ___EmotionJSX("span", {
42
+ className: "eui-textTruncate"
43
+ }, children));
44
+ if (onClose) {
45
+ return ___EmotionJSX(EuiI18n, {
46
+ token: "euiComboBoxPill.removeSelection",
47
+ default: "Remove {children} from selection in this group",
48
+ values: {
49
+ children: children
96
50
  }
51
+ }, function (removeSelection) {
97
52
  return ___EmotionJSX(EuiBadge, _extends({
53
+ css: cssStyles,
98
54
  className: classes,
99
55
  color: color,
100
56
  "data-test-subj": "euiComboBoxPill",
57
+ iconOnClick: function iconOnClick() {
58
+ return onClose(option);
59
+ },
60
+ iconOnClickAriaLabel: removeSelection,
61
+ iconSide: "right",
62
+ iconType: "cross",
101
63
  title: children
102
- }, rest, onClickProps), content);
103
- }
104
- }]);
105
- }(Component);
106
- _defineProperty(EuiComboBoxPill, "defaultProps", {
107
- color: 'hollow'
108
- });
109
- EuiComboBoxPill.propTypes = {
110
- children: PropTypes.string,
111
- className: PropTypes.string,
112
- color: PropTypes.string,
113
- onClick: PropTypes.func,
114
- onClickAriaLabel: PropTypes.any,
115
- onClose: PropTypes.func,
116
- option: PropTypes.shape({
117
- isGroupLabelOption: PropTypes.bool,
118
- label: PropTypes.string.isRequired,
119
- key: PropTypes.string,
120
- options: PropTypes.arrayOf(PropTypes.shape({
121
- isGroupLabelOption: PropTypes.bool,
122
- label: PropTypes.string.isRequired,
123
- key: PropTypes.string,
124
- options: PropTypes.arrayOf(PropTypes.any.isRequired),
125
- value: PropTypes.any,
126
- prepend: PropTypes.node,
127
- append: PropTypes.node,
128
- truncationProps: PropTypes.any,
129
- /**
130
- * Optional custom tooltip content for the button
131
- */
132
- toolTipContent: PropTypes.node,
133
- /**
134
- * Optional props to pass to the underlying **[EuiToolTip](/#/display/tooltip)**
135
- */
136
- toolTipProps: PropTypes.any,
137
- className: PropTypes.string,
138
- "aria-label": PropTypes.string,
139
- "data-test-subj": PropTypes.string,
140
- css: PropTypes.any
141
- }).isRequired),
142
- value: PropTypes.any,
143
- prepend: PropTypes.node,
144
- append: PropTypes.node,
145
- truncationProps: PropTypes.any,
146
- /**
147
- * Optional custom tooltip content for the button
148
- */
149
- toolTipContent: PropTypes.node,
150
- /**
151
- * Optional props to pass to the underlying **[EuiToolTip](/#/display/tooltip)**
152
- */
153
- toolTipProps: PropTypes.any,
154
- className: PropTypes.string,
155
- "aria-label": PropTypes.string,
156
- "data-test-subj": PropTypes.string,
157
- css: PropTypes.any
158
- }).isRequired,
159
- "aria-label": PropTypes.string,
160
- "data-test-subj": PropTypes.string,
161
- css: PropTypes.any
64
+ }, onClickProps, rest), content);
65
+ });
66
+ }
67
+ return ___EmotionJSX(EuiBadge, _extends({
68
+ css: cssStyles,
69
+ className: classes,
70
+ color: color,
71
+ "data-test-subj": "euiComboBoxPill",
72
+ title: children
73
+ }, rest, onClickProps), content);
162
74
  };
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6
+ * Side Public License, v 1.
7
+ */
8
+
9
+ import { css } from '@emotion/react';
10
+ import { logicalCSS, mathWithUnits } from '../../../global_styling';
11
+ export var euiComboBoxPillStyles = function euiComboBoxPillStyles(euiThemeContext) {
12
+ var euiTheme = euiThemeContext.euiTheme;
13
+
14
+ // Ensure the input doesn't drop to the next line when the EuiBadge has a very long text
15
+ var pillMaxWidth = "calc(100% - ".concat(euiTheme.size.xxs, " - ").concat(euiTheme.size.base, ")");
16
+ var pillHeight = mathWithUnits(euiTheme.size.l, function (x) {
17
+ return x - 2;
18
+ });
19
+ var pillLineHeight = mathWithUnits(pillHeight, function (x) {
20
+ return x - 2;
21
+ });
22
+ return {
23
+ euiComboBoxPill: /*#__PURE__*/css(logicalCSS('max-width', pillMaxWidth), " ", logicalCSS('height', pillHeight), " line-height:", pillLineHeight, ";vertical-align:baseline;", logicalCSS('margin-vertical', '1px'), "&+.euiBadge{", logicalCSS('margin-left', 0), ";}.euiBadge__text{display:flex;align-items:center;.euiIcon{display:block;}};label:euiComboBoxPill;")
24
+ };
25
+ };
@@ -32,18 +32,20 @@ import React, { Component } from 'react';
32
32
  import PropTypes from "prop-types";
33
33
  import classNames from 'classnames';
34
34
  import { FixedSizeList } from 'react-window';
35
+ import { RenderWithEuiStylesMemoizer } from '../../../services';
35
36
  import { EuiFlexGroup, EuiFlexItem } from '../../flex';
36
37
  import { EuiHighlight } from '../../highlight';
37
38
  import { EuiMark } from '../../mark';
38
39
  import { EuiText } from '../../text';
39
40
  import { EuiLoadingSpinner } from '../../loading';
40
- import { EuiComboBoxTitle } from './combo_box_title';
41
41
  import { EuiI18n } from '../../i18n';
42
42
  import { EuiFilterSelectItem } from '../../filter_group/filter_select_item';
43
43
  import { EuiBadge } from '../../badge';
44
44
  import { EuiTextTruncate } from '../../text_truncate';
45
45
  import { EuiInputPopoverWidthContext } from '../../popover/input_popover';
46
46
  import { EuiComboBoxOptionAppendPrepend } from '../utils';
47
+ import { EuiComboBoxTitle } from './combo_box_title';
48
+ import { euiComboBoxOptionListStyles, LIST_MAX_HEIGHT } from './combo_box_options_list.styles';
47
49
  import { jsx as ___EmotionJSX } from "@emotion/react";
48
50
  var hitEnterBadge = ___EmotionJSX(EuiBadge, {
49
51
  className: "euiComboBoxOption__enterBadge",
@@ -127,7 +129,8 @@ export var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
127
129
  className: "euiComboBoxOption__contentWrapper"
128
130
  }, ___EmotionJSX(EuiComboBoxOptionAppendPrepend, {
129
131
  option: option,
130
- classNamePrefix: "euiComboBoxOption"
132
+ classNamePrefix: "euiComboBoxOption",
133
+ marginSize: "s"
131
134
  }, ___EmotionJSX("span", {
132
135
  className: "euiComboBoxOption__content"
133
136
  }, renderOption ? renderOption(option, searchValue, 'euiComboBoxOption__renderOption') : _this.renderTruncatedOption(label, truncationProps))), optionIsFocused && !optionIsDisabled ? hitEnterBadge : null));
@@ -185,6 +188,7 @@ export var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
185
188
  }, {
186
189
  key: "render",
187
190
  value: function render() {
191
+ var _this2 = this;
188
192
  var _this$props2 = this.props,
189
193
  dataTestSubj = _this$props2['data-test-subj'],
190
194
  activeOptionIndex = _this$props2.activeOptionIndex,
@@ -303,31 +307,35 @@ export var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
303
307
  default: "You've selected all available options"
304
308
  }));
305
309
  }
306
- var emptyState = emptyStateContent ? ___EmotionJSX(EuiText, {
307
- size: "xs",
308
- className: "euiComboBoxOptionsList__empty"
309
- }, emptyStateContent) : undefined;
310
310
  var numVisibleOptions = matchingOptions.length < 7 ? matchingOptions.length : 7;
311
311
  var height = numVisibleOptions * (rowHeight + 1); // Add one for the border
312
312
 
313
313
  // bounded by max-height of .euiComboBoxOptionsList
314
- var boundedHeight = height > 200 ? 200 : height;
315
- var optionsList = ___EmotionJSX(FixedSizeList, {
316
- className: "euiComboBoxOptionsList__virtualization",
317
- height: boundedHeight,
318
- onScroll: onScroll,
319
- itemCount: matchingOptions.length,
320
- itemSize: rowHeight,
321
- itemData: matchingOptions,
322
- ref: this.setListRef,
323
- innerElementType: this.ListInnerElement,
324
- width: this.context
325
- }, this.ListRow);
326
- return ___EmotionJSX("div", _extends({
327
- className: "euiComboBoxOptionsList",
328
- "data-test-subj": classNames('comboBoxOptionsList', dataTestSubj),
329
- ref: listRef
330
- }, rest), emptyState || optionsList);
314
+ var boundedHeight = height > LIST_MAX_HEIGHT ? LIST_MAX_HEIGHT : height;
315
+ return ___EmotionJSX(RenderWithEuiStylesMemoizer, null, function (stylesMemoizer) {
316
+ var styles = stylesMemoizer(euiComboBoxOptionListStyles);
317
+ return ___EmotionJSX("div", _extends({
318
+ css: styles.euiComboBoxOptionList,
319
+ className: "euiComboBoxOptionsList",
320
+ "data-test-subj": classNames('comboBoxOptionsList', dataTestSubj),
321
+ ref: listRef
322
+ }, rest), emptyStateContent ? ___EmotionJSX(EuiText, {
323
+ size: "xs",
324
+ css: styles.euiComboBoxOptionsList__empty,
325
+ className: "euiComboBoxOptionsList__empty"
326
+ }, emptyStateContent) : ___EmotionJSX(FixedSizeList, {
327
+ css: styles.euiComboBoxOptionList__virtualization,
328
+ className: "euiComboBoxOptionsList__virtualization",
329
+ height: boundedHeight,
330
+ onScroll: onScroll,
331
+ itemCount: matchingOptions.length,
332
+ itemSize: rowHeight,
333
+ itemData: matchingOptions,
334
+ ref: _this2.setListRef,
335
+ innerElementType: _this2.ListInnerElement,
336
+ width: _this2.context
337
+ }, _this2.ListRow));
338
+ });
331
339
  }
332
340
  }]);
333
341
  }(Component);
@@ -0,0 +1,22 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6
+ * Side Public License, v 1.
7
+ */
8
+
9
+ import { css } from '@emotion/react';
10
+ import { logicalCSS, mathWithUnits, euiScrollBarStyles, euiTextBreakWord, euiTextTruncate } from '../../../global_styling';
11
+ import { euiTitle } from '../../title/title.styles';
12
+ export var LIST_MAX_HEIGHT = 200;
13
+ export var euiComboBoxOptionListStyles = function euiComboBoxOptionListStyles(euiThemeContext) {
14
+ var euiTheme = euiThemeContext.euiTheme;
15
+ return {
16
+ euiComboBoxOptionList: /*#__PURE__*/css(logicalCSS('max-height', "".concat(LIST_MAX_HEIGHT, "px")), " overflow:hidden;.euiTextTruncate{pointer-events:none;}.euiComboBoxOption__contentWrapper{display:flex;align-items:center;}.euiComboBoxOption__content{flex:1;text-align:start;", euiTextTruncate(), ";}.euiComboBoxOption__emptyStateText{flex:1;text-align:start;", logicalCSS('margin-bottom', 0), ";}.euiComboBoxOption__enterBadge{", logicalCSS('margin-left', euiTheme.size.xs), ";}.euiComboBoxTitle{display:flex;", logicalCSS('padding-horizontal', euiTheme.size.s), logicalCSS('padding-top', mathWithUnits(euiTheme.size.s, function (x) {
17
+ return x + 1;
18
+ })), " ", logicalCSS('padding-bottom', euiTheme.size.xs), " ", euiTitle(euiThemeContext, 'xxxs'), ";};label:euiComboBoxOptionList;"),
19
+ euiComboBoxOptionList__virtualization: /*#__PURE__*/css(euiScrollBarStyles(euiThemeContext), ";;label:euiComboBoxOptionList__virtualization;"),
20
+ euiComboBoxOptionsList__empty: /*#__PURE__*/css("padding:", euiTheme.size.s, ";text-align:center;", euiTextBreakWord(), ";;label:euiComboBoxOptionsList__empty;")
21
+ };
22
+ };
@@ -7,5 +7,4 @@
7
7
  */
8
8
 
9
9
  export { EuiComboBoxOptionsList } from './combo_box_options_list';
10
- export { EuiComboBoxOption } from './combo_box_option';
11
10
  export { EuiComboBoxTitle } from './combo_box_title';
@@ -1,3 +1,10 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ import { css as _css } from "@emotion/react";
3
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1
8
  /*
2
9
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
10
  * or more contributor license agreements. Licensed under the Elastic License
@@ -7,6 +14,8 @@
7
14
  */
8
15
 
9
16
  import React from 'react';
17
+ import { useEuiTheme } from '../../services';
18
+ import { logicalStyle } from '../../global_styling';
10
19
  import { jsx as ___EmotionJSX } from "@emotion/react";
11
20
  /**
12
21
  * DRY util for rendering an option with its prepend and append properties
@@ -14,10 +23,24 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
14
23
  export var EuiComboBoxOptionAppendPrepend = function EuiComboBoxOptionAppendPrepend(_ref) {
15
24
  var children = _ref.children,
16
25
  option = _ref.option,
17
- classNamePrefix = _ref.classNamePrefix;
26
+ classNamePrefix = _ref.classNamePrefix,
27
+ _ref$marginSize = _ref.marginSize,
28
+ marginSize = _ref$marginSize === void 0 ? 'xs' : _ref$marginSize;
29
+ var _useEuiTheme = useEuiTheme(),
30
+ euiTheme = _useEuiTheme.euiTheme;
31
+ var margin = euiTheme.size[marginSize];
18
32
  return ___EmotionJSX(React.Fragment, null, (option === null || option === void 0 ? void 0 : option.prepend) && ___EmotionJSX("span", {
19
- className: "".concat(classNamePrefix, "__prepend")
33
+ className: "".concat(classNamePrefix, "__prepend"),
34
+ css: /*#__PURE__*/_css(_objectSpread(_objectSpread({}, logicalStyle('margin-right', margin)), centerIcons), ";label:EuiComboBoxOptionAppendPrepend;")
20
35
  }, option.prepend), children, (option === null || option === void 0 ? void 0 : option.append) && ___EmotionJSX("span", {
21
- className: "".concat(classNamePrefix, "__append")
36
+ className: "".concat(classNamePrefix, "__append"),
37
+ css: /*#__PURE__*/_css(_objectSpread(_objectSpread({}, logicalStyle('margin-left', margin)), centerIcons), ";label:EuiComboBoxOptionAppendPrepend;")
22
38
  }, option.append));
39
+ };
40
+
41
+ // Fix vertical alignment of EuiIcons in prepend/append nodes
42
+ var centerIcons = {
43
+ '.euiIcon': {
44
+ display: 'block'
45
+ }
23
46
  };
@@ -8,13 +8,12 @@
8
8
 
9
9
  import { css } from '@emotion/react';
10
10
  import { logicalCSS } from '../../../../global_styling';
11
- import { euiFormVariables } from '../../../form/form.styles';
11
+ import { euiFormMaxWidth } from '../../../form/form.styles';
12
12
  export var euiQuickSelectPopoverStyles = function euiQuickSelectPopoverStyles(euiThemeContext) {
13
13
  var euiTheme = euiThemeContext.euiTheme;
14
- var _euiFormVariables = euiFormVariables(euiThemeContext),
15
- maxWidth = _euiFormVariables.maxWidth;
14
+ var formMaxWidth = euiFormMaxWidth(euiThemeContext);
16
15
  return {
17
- euiQuickSelectPopover: /*#__PURE__*/css(logicalCSS('width', maxWidth), " ", logicalCSS('max-width', '100%'), ";;label:euiQuickSelectPopover;"),
16
+ euiQuickSelectPopover: /*#__PURE__*/css(logicalCSS('width', formMaxWidth), " ", logicalCSS('max-width', '100%'), ";;label:euiQuickSelectPopover;"),
18
17
  euiQuickSelectPopoverButton: /*#__PURE__*/css(logicalCSS('border-top-right-radius', 0), " ", logicalCSS('border-bottom-right-radius', 0), ".euiIcon{", logicalCSS('width', euiTheme.size.base), ";};label:euiQuickSelectPopoverButton;"),
19
18
  euiQuickSelectPopoverButton__content: /*#__PURE__*/css("gap:", euiTheme.size.xs, ";;label:euiQuickSelectPopoverButton__content;")
20
19
  };
@@ -12,7 +12,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
12
12
  import { css, keyframes } from '@emotion/react';
13
13
  import { euiCanAnimate, euiMaxBreakpoint, euiMinBreakpoint, logicalCSS, mathWithUnits } from '../../global_styling';
14
14
  import { euiShadowXLarge } from '../../themes/amsterdam/global_styling/mixins';
15
- import { euiFormVariables } from '../form/form.styles';
15
+ import { euiFormMaxWidth } from '../form/form.styles';
16
16
  export var FLYOUT_BREAKPOINT = 'm';
17
17
  export var euiFlyoutSlideInRight = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n opacity: 0;\n transform: translateX(100%);\n }\n 75% {\n opacity: 1;\n transform: translateX(0%);\n }\n"])));
18
18
  export var euiFlyoutSlideInLeft = keyframes(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n 0% {\n opacity: 0;\n transform: translateX(-100%);\n }\n 75% {\n opacity: 1;\n transform: translateX(0%);\n }\n"])));
@@ -56,7 +56,7 @@ export var euiFlyoutStyles = function euiFlyoutStyles(euiThemeContext) {
56
56
  };
57
57
  var composeFlyoutSizing = function composeFlyoutSizing(euiThemeContext, size) {
58
58
  var euiTheme = euiThemeContext.euiTheme;
59
- var form = euiFormVariables(euiThemeContext);
59
+ var formMaxWidth = euiFormMaxWidth(euiThemeContext);
60
60
 
61
61
  // 1. Calculating the minimum width based on the screen takeover breakpoint
62
62
  var flyoutSizes = {
@@ -68,7 +68,7 @@ var composeFlyoutSizing = function composeFlyoutSizing(euiThemeContext, size) {
68
68
  },
69
69
  m: {
70
70
  // Calculated for forms plus padding
71
- min: "".concat(mathWithUnits(form.maxWidth, function (x) {
71
+ min: "".concat(mathWithUnits(formMaxWidth, function (x) {
72
72
  return x + 24;
73
73
  })),
74
74
  width: '50vw',
@@ -15,6 +15,16 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
15
15
  import { shade, tint, darken, transparentize, makeHighContrastColor } from '../../services';
16
16
  import { logicalCSS, mathWithUnits, euiCanAnimate, euiFontSize } from '../../global_styling';
17
17
  import { euiButtonColor } from '../../themes/amsterdam/global_styling/mixins';
18
+
19
+ // There are multiple components that only need the form max-width size &
20
+ // don't need the extra overhead/color computing expense of every form var.
21
+ // For microperf, we're making this its own util
22
+ export var euiFormMaxWidth = function euiFormMaxWidth(_ref) {
23
+ var euiTheme = _ref.euiTheme;
24
+ return mathWithUnits(euiTheme.size.base, function (x) {
25
+ return x * 25;
26
+ });
27
+ };
18
28
  export var euiFormVariables = function euiFormVariables(euiThemeContext) {
19
29
  var euiTheme = euiThemeContext.euiTheme,
20
30
  colorMode = euiThemeContext.colorMode;
@@ -23,9 +33,7 @@ export var euiFormVariables = function euiFormVariables(euiThemeContext) {
23
33
  var controlHeight = euiTheme.size.xxl;
24
34
  var controlCompressedHeight = euiTheme.size.xl;
25
35
  var sizes = {
26
- maxWidth: mathWithUnits(euiTheme.size.base, function (x) {
27
- return x * 25;
28
- }),
36
+ maxWidth: euiFormMaxWidth(euiThemeContext),
29
37
  controlHeight: controlHeight,
30
38
  controlCompressedHeight: controlCompressedHeight,
31
39
  controlPadding: euiTheme.size.m,
@@ -134,13 +142,13 @@ export var euiFormControlDefaultShadow = function euiFormControlDefaultShadow(eu
134
142
  var form = euiFormVariables(euiThemeContext);
135
143
  return "\n /* We use inset box-shadow instead of border to skip extra hight calculations */\n border: none;\n box-shadow: inset 0 0 0 ".concat(euiTheme.border.width.thin, " ").concat(form.borderColor, ";\n background-color: ").concat(form.backgroundColor, ";\n\n background-repeat: no-repeat;\n background-size: 0% 100%;\n background-image: linear-gradient(to top,\n var(--euiFormControlStateColor),\n var(--euiFormControlStateColor) ").concat(euiTheme.border.width.thick, ",\n transparent ").concat(euiTheme.border.width.thick, ",\n transparent 100%\n );\n\n ").concat(euiCanAnimate, " {\n transition:\n box-shadow ").concat(form.animationTiming, ",\n background-image ").concat(form.animationTiming, ",\n background-size ").concat(form.animationTiming, ",\n background-color ").concat(form.animationTiming, ";\n }\n ");
136
144
  };
137
- export var euiFormControlFocusStyles = function euiFormControlFocusStyles(_ref) {
138
- var euiTheme = _ref.euiTheme,
139
- colorMode = _ref.colorMode;
145
+ export var euiFormControlFocusStyles = function euiFormControlFocusStyles(_ref2) {
146
+ var euiTheme = _ref2.euiTheme,
147
+ colorMode = _ref2.colorMode;
140
148
  return "\n --euiFormControlStateColor: ".concat(euiTheme.colors.primary, ";\n background-color: ").concat(colorMode === 'DARK' ? shade(euiTheme.colors.emptyShade, 0.4) : euiTheme.colors.emptyShade, ";\n background-size: 100% 100%;\n outline: none; /* Remove all outlines and rely on our own bottom border gradient */\n");
141
149
  };
142
- export var euiFormControlInvalidStyles = function euiFormControlInvalidStyles(_ref2) {
143
- var euiTheme = _ref2.euiTheme;
150
+ export var euiFormControlInvalidStyles = function euiFormControlInvalidStyles(_ref3) {
151
+ var euiTheme = _ref3.euiTheme;
144
152
  return "\n --euiFormControlStateColor: ".concat(euiTheme.colors.danger, ";\n background-size: 100% 100%;\n");
145
153
  };
146
154
  export var euiFormControlDisabledStyles = function euiFormControlDisabledStyles(euiThemeContext) {
@@ -9,7 +9,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
9
9
 
10
10
  import { css } from '@emotion/react';
11
11
  import { logicalCSS } from '../../global_styling';
12
- import { euiFormVariables } from '../form/form.styles';
12
+ import { euiFormMaxWidth } from '../form/form.styles';
13
13
  var _ref = process.env.NODE_ENV === "production" ? {
14
14
  name: "1urrzow-flush",
15
15
  styles: "padding:0;border:none;.euiListGroupItem{border-radius:0;};label:flush;"
@@ -28,14 +28,14 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
28
28
  };
29
29
  export var euiListGroupStyles = function euiListGroupStyles(euiThemeContext) {
30
30
  var euiTheme = euiThemeContext.euiTheme;
31
- var form = euiFormVariables(euiThemeContext);
31
+ var formMaxWidth = euiFormMaxWidth(euiThemeContext);
32
32
  return {
33
33
  // Base
34
34
  euiListGroup: _ref2,
35
35
  // Variants
36
36
  flush: _ref,
37
37
  bordered: /*#__PURE__*/css("border-radius:", euiTheme.border.radius.medium, ";border:", euiTheme.border.thin, ";;label:bordered;"),
38
- maxWidthDefault: /*#__PURE__*/css(logicalCSS('max-width', form.maxWidth), ";;label:maxWidthDefault;"),
38
+ maxWidthDefault: /*#__PURE__*/css(logicalCSS('max-width', formMaxWidth), ";;label:maxWidthDefault;"),
39
39
  // Gutter sizes
40
40
  none: /*#__PURE__*/css(";label:none;"),
41
41
  s: /*#__PURE__*/css("padding:", euiTheme.size.s, ";gap:", euiTheme.size.s, ";;label:s;"),
@@ -31,7 +31,7 @@ import { logicalCSS } from '../../global_styling';
31
31
  import { keys, useCombinedRefs, useEuiTheme } from '../../services';
32
32
  import { useResizeObserver } from '../observer/resize_observer';
33
33
  import { EuiFocusTrap } from '../focus_trap';
34
- import { euiFormVariables } from '../form/form.styles';
34
+ import { euiFormMaxWidth } from '../form/form.styles';
35
35
  import { EuiPopover } from './popover';
36
36
  import { jsx as ___EmotionJSX } from "@emotion/react";
37
37
  // Used by child components that want to know the parent popover width
@@ -69,7 +69,7 @@ export var EuiInputPopover = function EuiInputPopover(_ref) {
69
69
  props = _objectWithoutProperties(_ref, _excluded);
70
70
  var classes = classnames('euiInputPopover', className);
71
71
  var euiTheme = useEuiTheme();
72
- var form = euiFormVariables(euiTheme);
72
+ var formMaxWidth = euiFormMaxWidth(euiTheme);
73
73
 
74
74
  /**
75
75
  * Ref setup
@@ -189,7 +189,7 @@ export var EuiInputPopover = function EuiInputPopover(_ref) {
189
189
  }, [closeOnScroll, closePopover, panelEl, inputEl]);
190
190
  return ___EmotionJSX(EuiPopover, _extends({
191
191
  className: classes,
192
- css: /*#__PURE__*/css(fullWidth ? undefined : logicalCSS('max-width', form.maxWidth), ";label:EuiInputPopover;"),
192
+ css: /*#__PURE__*/css(fullWidth ? undefined : logicalCSS('max-width', formMaxWidth), ";label:EuiInputPopover;"),
193
193
  display: display,
194
194
  button: input,
195
195
  popoverRef: inputRef,