@elastic/eui 67.0.0 → 67.1.1

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 (283) hide show
  1. package/dist/eui_theme_dark.css +0 -390
  2. package/dist/eui_theme_dark.json +0 -24
  3. package/dist/eui_theme_dark.json.d.ts +0 -24
  4. package/dist/eui_theme_dark.min.css +1 -1
  5. package/dist/eui_theme_light.css +0 -390
  6. package/dist/eui_theme_light.json +0 -24
  7. package/dist/eui_theme_light.json.d.ts +0 -24
  8. package/dist/eui_theme_light.min.css +1 -1
  9. package/es/components/accordion/accordion.js +5 -4
  10. package/es/components/accordion/accordion.styles.js +1 -1
  11. package/es/components/badge/badge.js +84 -78
  12. package/es/components/badge/badge.styles.js +62 -0
  13. package/es/components/basic_table/in_memory_table.js +8 -0
  14. package/es/components/breadcrumbs/breadcrumb.styles.js +4 -2
  15. package/es/components/button/button.js +0 -1
  16. package/es/components/button/button_display/_button_display.js +10 -5
  17. package/es/components/button/button_display/_button_display.styles.js +2 -2
  18. package/es/components/button/button_display/_button_display_content.js +5 -3
  19. package/es/components/button/button_display/_button_display_content.styles.js +4 -1
  20. package/es/components/button/button_icon/button_icon.js +11 -7
  21. package/es/components/card/card.js +2 -2
  22. package/es/components/card/card.styles.js +5 -2
  23. package/es/components/collapsible_nav/collapsible_nav.js +8 -0
  24. package/es/components/expression/expression.styles.js +4 -2
  25. package/es/components/flyout/flyout.js +27 -48
  26. package/es/components/flyout/flyout.styles.js +111 -0
  27. package/es/components/flyout/flyout_body.js +14 -6
  28. package/es/components/flyout/flyout_body.styles.js +21 -0
  29. package/es/components/flyout/flyout_footer.js +8 -1
  30. package/es/components/flyout/flyout_footer.styles.js +14 -0
  31. package/es/components/flyout/flyout_header.js +9 -4
  32. package/es/components/flyout/flyout_header.styles.js +28 -0
  33. package/es/components/image/image_wrapper.js +3 -3
  34. package/es/components/markdown_editor/markdown_format.styles.js +11 -6
  35. package/es/components/notification/notification_event.js +1 -1
  36. package/es/components/notification/notification_event_meta.js +1 -1
  37. package/es/components/page/page_header/page_header_content.js +1 -1
  38. package/es/components/page/page_section/page_section.js +3 -4
  39. package/es/components/pagination/pagination_button.styles.js +5 -3
  40. package/es/components/popover/popover_title.js +2 -2
  41. package/es/components/popover/popover_title.styles.js +18 -6
  42. package/es/components/progress/progress.js +2 -2
  43. package/es/components/search_bar/filters/custom_component_filter.js +16 -0
  44. package/es/components/search_bar/filters/filters.js +6 -0
  45. package/es/components/search_bar/query/ast.js +12 -0
  46. package/es/components/search_bar/query/ast_to_es_query_dsl.js +15 -10
  47. package/es/components/search_bar/query/query.js +17 -0
  48. package/es/components/search_bar/search_bar.js +4 -0
  49. package/es/components/search_bar/search_filters.js +4 -0
  50. package/es/components/selectable/selectable_list/selectable_list.js +2 -2
  51. package/es/components/selectable/selectable_list/selectable_list_item.js +2 -2
  52. package/es/components/text/text.styles.js +6 -3
  53. package/es/components/tool_tip/tool_tip.styles.js +7 -6
  54. package/es/components/tour/tour.styles.js +11 -6
  55. package/es/global_styling/functions/index.js +1 -0
  56. package/es/global_styling/functions/math.js +46 -0
  57. package/es/global_styling/mixins/_helpers.js +5 -2
  58. package/es/services/color/contrast.js +2 -0
  59. package/es/services/index.js +1 -1
  60. package/es/services/theme/context.js +2 -1
  61. package/es/services/theme/hooks.js +27 -1
  62. package/es/services/theme/index.js +1 -1
  63. package/es/services/theme/provider.js +15 -1
  64. package/eui.d.ts +199 -35
  65. package/i18ntokens.json +2 -2
  66. package/lib/components/accordion/accordion.js +5 -4
  67. package/lib/components/accordion/accordion.styles.js +1 -1
  68. package/lib/components/badge/badge.js +92 -80
  69. package/lib/components/badge/badge.styles.js +67 -0
  70. package/lib/components/basic_table/in_memory_table.js +8 -0
  71. package/lib/components/breadcrumbs/breadcrumb.styles.js +3 -1
  72. package/lib/components/button/button.js +0 -1
  73. package/lib/components/button/button_display/_button_display.js +10 -5
  74. package/lib/components/button/button_display/_button_display.styles.js +2 -2
  75. package/lib/components/button/button_display/_button_display_content.js +9 -4
  76. package/lib/components/button/button_display/_button_display_content.styles.js +4 -1
  77. package/lib/components/button/button_icon/button_icon.js +11 -7
  78. package/lib/components/card/card.js +2 -2
  79. package/lib/components/card/card.styles.js +5 -2
  80. package/lib/components/collapsible_nav/collapsible_nav.js +8 -0
  81. package/lib/components/expression/expression.styles.js +3 -1
  82. package/lib/components/flyout/flyout.js +27 -47
  83. package/lib/components/flyout/flyout.styles.js +122 -0
  84. package/lib/components/flyout/flyout_body.js +16 -6
  85. package/lib/components/flyout/flyout_body.styles.js +32 -0
  86. package/lib/components/flyout/flyout_footer.js +10 -1
  87. package/lib/components/flyout/flyout_footer.styles.js +24 -0
  88. package/lib/components/flyout/flyout_header.js +11 -4
  89. package/lib/components/flyout/flyout_header.styles.js +31 -0
  90. package/lib/components/image/image_wrapper.js +3 -3
  91. package/lib/components/markdown_editor/markdown_format.styles.js +10 -5
  92. package/lib/components/notification/notification_event.js +1 -1
  93. package/lib/components/notification/notification_event_meta.js +1 -1
  94. package/lib/components/page/page_header/page_header_content.js +1 -1
  95. package/lib/components/page/page_section/page_section.js +3 -4
  96. package/lib/components/pagination/pagination_button.styles.js +4 -2
  97. package/lib/components/popover/popover_title.js +2 -2
  98. package/lib/components/popover/popover_title.styles.js +19 -7
  99. package/lib/components/progress/progress.js +2 -2
  100. package/lib/components/search_bar/filters/custom_component_filter.js +29 -0
  101. package/lib/components/search_bar/filters/filters.js +7 -0
  102. package/lib/components/search_bar/query/ast.js +12 -0
  103. package/lib/components/search_bar/query/ast_to_es_query_dsl.js +16 -11
  104. package/lib/components/search_bar/query/query.js +17 -0
  105. package/lib/components/search_bar/search_bar.js +4 -0
  106. package/lib/components/search_bar/search_filters.js +4 -0
  107. package/lib/components/selectable/selectable_list/selectable_list.js +2 -2
  108. package/lib/components/selectable/selectable_list/selectable_list_item.js +2 -2
  109. package/lib/components/text/text.styles.js +5 -2
  110. package/lib/components/tool_tip/tool_tip.styles.js +6 -5
  111. package/lib/components/tour/tour.styles.js +10 -5
  112. package/lib/global_styling/functions/index.js +13 -0
  113. package/lib/global_styling/functions/math.js +55 -0
  114. package/lib/global_styling/mixins/_helpers.js +5 -2
  115. package/lib/services/color/contrast.js +6 -1
  116. package/lib/services/index.js +7 -0
  117. package/lib/services/theme/context.js +4 -2
  118. package/lib/services/theme/hooks.js +28 -0
  119. package/lib/services/theme/index.js +12 -0
  120. package/lib/services/theme/provider.js +23 -2
  121. package/optimize/es/components/accordion/accordion.js +5 -4
  122. package/optimize/es/components/accordion/accordion.styles.js +1 -1
  123. package/optimize/es/components/badge/badge.js +82 -76
  124. package/optimize/es/components/badge/badge.styles.js +62 -0
  125. package/optimize/es/components/basic_table/in_memory_table.js +4 -0
  126. package/optimize/es/components/breadcrumbs/breadcrumb.styles.js +4 -2
  127. package/optimize/es/components/button/button.js +0 -1
  128. package/optimize/es/components/button/button_display/_button_display.js +8 -3
  129. package/optimize/es/components/button/button_display/_button_display.styles.js +2 -2
  130. package/optimize/es/components/button/button_display/_button_display_content.js +3 -1
  131. package/optimize/es/components/button/button_display/_button_display_content.styles.js +4 -1
  132. package/optimize/es/components/button/button_icon/button_icon.js +11 -7
  133. package/optimize/es/components/card/card.js +2 -2
  134. package/optimize/es/components/card/card.styles.js +5 -2
  135. package/optimize/es/components/expression/expression.styles.js +4 -2
  136. package/optimize/es/components/flyout/flyout.js +27 -48
  137. package/optimize/es/components/flyout/flyout.styles.js +111 -0
  138. package/optimize/es/components/flyout/flyout_body.js +14 -6
  139. package/optimize/es/components/flyout/flyout_body.styles.js +21 -0
  140. package/optimize/es/components/flyout/flyout_footer.js +8 -1
  141. package/optimize/es/components/flyout/flyout_footer.styles.js +14 -0
  142. package/optimize/es/components/flyout/flyout_header.js +9 -4
  143. package/optimize/es/components/flyout/flyout_header.styles.js +28 -0
  144. package/optimize/es/components/image/image_wrapper.js +3 -3
  145. package/optimize/es/components/markdown_editor/markdown_format.styles.js +11 -6
  146. package/optimize/es/components/page/page_header/page_header_content.js +1 -1
  147. package/optimize/es/components/page/page_section/page_section.js +3 -4
  148. package/optimize/es/components/pagination/pagination_button.styles.js +5 -3
  149. package/optimize/es/components/popover/popover_title.js +2 -2
  150. package/optimize/es/components/popover/popover_title.styles.js +18 -6
  151. package/optimize/es/components/progress/progress.js +2 -2
  152. package/optimize/es/components/search_bar/filters/custom_component_filter.js +16 -0
  153. package/optimize/es/components/search_bar/filters/filters.js +6 -0
  154. package/optimize/es/components/search_bar/query/ast.js +12 -0
  155. package/optimize/es/components/search_bar/query/ast_to_es_query_dsl.js +14 -9
  156. package/optimize/es/components/search_bar/query/query.js +17 -0
  157. package/optimize/es/components/text/text.styles.js +6 -3
  158. package/optimize/es/components/tool_tip/tool_tip.styles.js +7 -6
  159. package/optimize/es/components/tour/tour.styles.js +11 -6
  160. package/optimize/es/global_styling/functions/index.js +1 -0
  161. package/optimize/es/global_styling/functions/math.js +44 -0
  162. package/optimize/es/global_styling/mixins/_helpers.js +5 -2
  163. package/optimize/es/services/color/contrast.js +2 -0
  164. package/optimize/es/services/index.js +1 -1
  165. package/optimize/es/services/theme/context.js +2 -1
  166. package/optimize/es/services/theme/hooks.js +27 -1
  167. package/optimize/es/services/theme/index.js +1 -1
  168. package/optimize/es/services/theme/provider.js +14 -1
  169. package/optimize/lib/components/accordion/accordion.js +5 -4
  170. package/optimize/lib/components/accordion/accordion.styles.js +1 -1
  171. package/optimize/lib/components/badge/badge.js +90 -78
  172. package/optimize/lib/components/badge/badge.styles.js +67 -0
  173. package/optimize/lib/components/basic_table/in_memory_table.js +4 -0
  174. package/optimize/lib/components/breadcrumbs/breadcrumb.styles.js +3 -1
  175. package/optimize/lib/components/button/button.js +0 -1
  176. package/optimize/lib/components/button/button_display/_button_display.js +8 -3
  177. package/optimize/lib/components/button/button_display/_button_display.styles.js +2 -2
  178. package/optimize/lib/components/button/button_display/_button_display_content.js +6 -2
  179. package/optimize/lib/components/button/button_display/_button_display_content.styles.js +4 -1
  180. package/optimize/lib/components/button/button_icon/button_icon.js +11 -7
  181. package/optimize/lib/components/card/card.js +2 -2
  182. package/optimize/lib/components/card/card.styles.js +5 -2
  183. package/optimize/lib/components/expression/expression.styles.js +3 -1
  184. package/optimize/lib/components/flyout/flyout.js +27 -47
  185. package/optimize/lib/components/flyout/flyout.styles.js +124 -0
  186. package/optimize/lib/components/flyout/flyout_body.js +16 -6
  187. package/optimize/lib/components/flyout/flyout_body.styles.js +32 -0
  188. package/optimize/lib/components/flyout/flyout_footer.js +10 -1
  189. package/optimize/lib/components/flyout/flyout_footer.styles.js +24 -0
  190. package/optimize/lib/components/flyout/flyout_header.js +11 -4
  191. package/optimize/lib/components/flyout/flyout_header.styles.js +31 -0
  192. package/optimize/lib/components/image/image_wrapper.js +3 -3
  193. package/optimize/lib/components/markdown_editor/markdown_format.styles.js +10 -5
  194. package/optimize/lib/components/page/page_header/page_header_content.js +1 -1
  195. package/optimize/lib/components/page/page_section/page_section.js +3 -4
  196. package/optimize/lib/components/pagination/pagination_button.styles.js +4 -2
  197. package/optimize/lib/components/popover/popover_title.js +2 -2
  198. package/optimize/lib/components/popover/popover_title.styles.js +19 -7
  199. package/optimize/lib/components/progress/progress.js +2 -2
  200. package/optimize/lib/components/search_bar/filters/custom_component_filter.js +29 -0
  201. package/optimize/lib/components/search_bar/filters/filters.js +7 -0
  202. package/optimize/lib/components/search_bar/query/ast.js +12 -0
  203. package/optimize/lib/components/search_bar/query/ast_to_es_query_dsl.js +16 -11
  204. package/optimize/lib/components/search_bar/query/query.js +17 -0
  205. package/optimize/lib/components/text/text.styles.js +5 -2
  206. package/optimize/lib/components/tool_tip/tool_tip.styles.js +6 -5
  207. package/optimize/lib/components/tour/tour.styles.js +10 -5
  208. package/optimize/lib/global_styling/functions/index.js +13 -0
  209. package/optimize/lib/global_styling/functions/math.js +57 -0
  210. package/optimize/lib/global_styling/mixins/_helpers.js +5 -2
  211. package/optimize/lib/services/color/contrast.js +5 -1
  212. package/optimize/lib/services/index.js +7 -0
  213. package/optimize/lib/services/theme/context.js +4 -2
  214. package/optimize/lib/services/theme/hooks.js +28 -0
  215. package/optimize/lib/services/theme/index.js +12 -0
  216. package/optimize/lib/services/theme/provider.js +23 -9
  217. package/package.json +5 -5
  218. package/src/components/badge/_index.scss +0 -1
  219. package/src/components/index.scss +0 -1
  220. package/src/themes/amsterdam/global_styling/variables/_index.scss +0 -1
  221. package/test-env/components/accordion/accordion.js +5 -4
  222. package/test-env/components/accordion/accordion.styles.js +1 -1
  223. package/test-env/components/badge/badge.js +92 -80
  224. package/test-env/components/badge/badge.styles.js +67 -0
  225. package/test-env/components/basic_table/in_memory_table.js +8 -0
  226. package/test-env/components/breadcrumbs/breadcrumb.styles.js +3 -1
  227. package/test-env/components/button/button.js +0 -1
  228. package/test-env/components/button/button_display/_button_display.js +10 -5
  229. package/test-env/components/button/button_display/_button_display.styles.js +2 -2
  230. package/test-env/components/button/button_display/_button_display_content.js +8 -4
  231. package/test-env/components/button/button_display/_button_display_content.styles.js +4 -1
  232. package/test-env/components/button/button_icon/button_icon.js +11 -7
  233. package/test-env/components/card/card.js +2 -2
  234. package/test-env/components/card/card.styles.js +5 -2
  235. package/test-env/components/collapsible_nav/collapsible_nav.js +8 -0
  236. package/test-env/components/expression/expression.styles.js +3 -1
  237. package/test-env/components/flyout/flyout.styles.js +124 -0
  238. package/test-env/components/flyout/flyout_body.js +16 -6
  239. package/test-env/components/flyout/flyout_body.styles.js +32 -0
  240. package/test-env/components/flyout/flyout_footer.js +10 -1
  241. package/test-env/components/flyout/flyout_footer.styles.js +24 -0
  242. package/test-env/components/flyout/flyout_header.js +11 -4
  243. package/test-env/components/flyout/flyout_header.styles.js +31 -0
  244. package/test-env/components/image/image_wrapper.js +3 -3
  245. package/test-env/components/markdown_editor/markdown_format.styles.js +10 -5
  246. package/test-env/components/notification/notification_event.js +1 -1
  247. package/test-env/components/notification/notification_event_meta.js +1 -1
  248. package/test-env/components/page/page_header/page_header_content.js +1 -1
  249. package/test-env/components/page/page_section/page_section.js +3 -4
  250. package/test-env/components/pagination/pagination_button.styles.js +4 -2
  251. package/test-env/components/popover/popover_title.js +2 -2
  252. package/test-env/components/popover/popover_title.styles.js +19 -7
  253. package/test-env/components/progress/progress.js +2 -2
  254. package/test-env/components/search_bar/filters/custom_component_filter.js +29 -0
  255. package/test-env/components/search_bar/filters/filters.js +7 -0
  256. package/test-env/components/search_bar/query/ast.js +12 -0
  257. package/test-env/components/search_bar/query/ast_to_es_query_dsl.js +16 -11
  258. package/test-env/components/search_bar/query/query.js +17 -0
  259. package/test-env/components/search_bar/search_bar.js +4 -0
  260. package/test-env/components/search_bar/search_filters.js +4 -0
  261. package/test-env/components/selectable/selectable_list/selectable_list.js +2 -2
  262. package/test-env/components/selectable/selectable_list/selectable_list_item.js +2 -2
  263. package/test-env/components/text/text.styles.js +5 -2
  264. package/test-env/components/tool_tip/tool_tip.styles.js +6 -5
  265. package/test-env/components/tour/tour.styles.js +10 -5
  266. package/test-env/global_styling/functions/index.js +13 -0
  267. package/test-env/global_styling/functions/math.js +57 -0
  268. package/test-env/global_styling/mixins/_helpers.js +5 -2
  269. package/test-env/services/color/contrast.js +5 -1
  270. package/test-env/services/index.js +7 -0
  271. package/test-env/services/theme/context.js +4 -2
  272. package/test-env/services/theme/hooks.js +28 -0
  273. package/test-env/services/theme/index.js +12 -0
  274. package/test-env/services/theme/provider.js +23 -9
  275. package/src/components/badge/_badge.scss +0 -133
  276. package/src/components/flyout/_flyout.scss +0 -196
  277. package/src/components/flyout/_flyout_body.scss +0 -18
  278. package/src/components/flyout/_flyout_footer.scss +0 -4
  279. package/src/components/flyout/_flyout_header.scss +0 -7
  280. package/src/components/flyout/_index.scss +0 -7
  281. package/src/components/flyout/_mixins.scss +0 -18
  282. package/src/components/flyout/_variables.scss +0 -8
  283. package/src/themes/amsterdam/global_styling/variables/_flyout.scss +0 -1
@@ -7,19 +7,19 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.astToEsQueryDsl = exports._termValuesToQuery = exports._isFlagToQuery = exports._fieldValuesToQuery = void 0;
9
9
 
10
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
-
12
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
11
 
14
- var _date_format = require("./date_format");
12
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
15
13
 
16
- var _date_value = require("./date_value");
14
+ var _predicate = require("../../../services/predicate");
15
+
16
+ var _common = require("../../common");
17
17
 
18
18
  var _ast = require("./ast");
19
19
 
20
- var _predicate = require("../../../services/predicate");
20
+ var _date_format = require("./date_format");
21
21
 
22
- var _common = require("../../common");
22
+ var _date_value = require("./date_value");
23
23
 
24
24
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
25
25
 
@@ -118,12 +118,17 @@ var _fieldValuesToQuery = function _fieldValuesToQuery(field, operations, andOr)
118
118
  }
119
119
  });
120
120
 
121
- if (_terms.length > 0) {
121
+ if (_terms.length > 1) {
122
+ queries.push({
123
+ bool: (0, _defineProperty2.default)({}, andOr === 'and' ? 'must' : 'should', (0, _toConsumableArray2.default)(_terms.map(function (value) {
124
+ return {
125
+ match: (0, _defineProperty2.default)({}, field, value)
126
+ };
127
+ })))
128
+ });
129
+ } else if (_terms.length === 1) {
122
130
  queries.push({
123
- match: (0, _defineProperty2.default)({}, field, {
124
- query: _terms.join(' '),
125
- operator: andOr
126
- })
131
+ match: (0, _defineProperty2.default)({}, field, _terms[0])
127
132
  });
128
133
  }
129
134
 
@@ -52,6 +52,11 @@ var Query = /*#__PURE__*/function () {
52
52
  }
53
53
 
54
54
  (0, _createClass2.default)(Query, [{
55
+ key: "hasClauses",
56
+ value: function hasClauses() {
57
+ return this.ast.clauses.length > 0;
58
+ }
59
+ }, {
55
60
  key: "hasSimpleFieldClause",
56
61
  value: function hasSimpleFieldClause(field, value) {
57
62
  return this.ast.hasSimpleFieldClause(field, value);
@@ -111,6 +116,12 @@ var Query = /*#__PURE__*/function () {
111
116
  var ast = this.ast.removeOrFieldClauses(field);
112
117
  return new Query(ast, this.syntax);
113
118
  }
119
+ }, {
120
+ key: "removeAllClauses",
121
+ value: function removeAllClauses() {
122
+ var ast = this.ast.removeAllClauses();
123
+ return new Query(ast, this.syntax);
124
+ }
114
125
  }, {
115
126
  key: "hasIsClause",
116
127
  value: function hasIsClause(flag) {
@@ -139,6 +150,12 @@ var Query = /*#__PURE__*/function () {
139
150
  var ast = this.ast.removeIsClause(flag);
140
151
  return new Query(ast, this.syntax);
141
152
  }
153
+ }, {
154
+ key: "removeIsClauses",
155
+ value: function removeIsClauses() {
156
+ var ast = this.ast.removeIsClauses();
157
+ return new Query(ast, this.syntax);
158
+ }
142
159
  /**
143
160
  * Executes this query over the given iterable item and returns
144
161
  * an new array of all items that matched this query. Options:
@@ -425,6 +425,10 @@ EuiSearchBar.propTypes = {
425
425
  operator: _propTypes.default.oneOf(["eq", "exact", "gt", "gte", "lt", "lte"])
426
426
  }).isRequired).isRequired,
427
427
  available: _propTypes.default.func
428
+ }).isRequired, _propTypes.default.shape({
429
+ type: _propTypes.default.oneOf(["custom_component"]).isRequired,
430
+ component: _propTypes.default.elementType.isRequired,
431
+ available: _propTypes.default.func
428
432
  }).isRequired]).isRequired),
429
433
 
430
434
  /**
@@ -159,5 +159,9 @@ EuiSearchFilters.propTypes = {
159
159
  operator: _propTypes.default.oneOf(["eq", "exact", "gt", "gte", "lt", "lte"])
160
160
  }).isRequired).isRequired,
161
161
  available: _propTypes.default.func
162
+ }).isRequired, _propTypes.default.shape({
163
+ type: _propTypes.default.oneOf(["custom_component"]).isRequired,
164
+ component: _propTypes.default.elementType.isRequired,
165
+ available: _propTypes.default.func
162
166
  }).isRequired]).isRequired).isRequired
163
167
  };
@@ -431,12 +431,12 @@ EuiSelectableList.propTypes = {
431
431
  /**
432
432
  * The side of the badge the icon should sit
433
433
  */
434
- iconSide: _propTypes.default.oneOf(["left", "right"]),
434
+ iconSide: _propTypes.default.any,
435
435
 
436
436
  /**
437
437
  * Accepts either our palette colors (primary, success ..etc) or a hex value `#FFFFFF`, `#000`.
438
438
  */
439
- color: _propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.any.isRequired]),
439
+ color: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.string.isRequired]),
440
440
 
441
441
  /**
442
442
  * Will override any color passed through the `color` prop.
@@ -275,12 +275,12 @@ EuiSelectableListItem.propTypes = {
275
275
  /**
276
276
  * The side of the badge the icon should sit
277
277
  */
278
- iconSide: _propTypes.default.oneOf(["left", "right"]),
278
+ iconSide: _propTypes.default.any,
279
279
 
280
280
  /**
281
281
  * Accepts either our palette colors (primary, success ..etc) or a hex value `#FFFFFF`, `#000`.
282
282
  */
283
- color: _propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.any.isRequired]),
283
+ color: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.string.isRequired]),
284
284
 
285
285
  /**
286
286
  * Will override any color passed through the `color` prop.
@@ -61,8 +61,11 @@ var euiScaleText = function euiScaleText(euiThemeContext, options) {
61
61
  }; // Generate margins for headings based on customScale (not on heading level)
62
62
 
63
63
  var customScale = _customScale === 'xxxs' ? 'xxs' : _customScale || 'm';
64
- var headingMarginTop = "".concat(parseFloat(euiTheme.size[customScale]) * 2, "px");
65
- var headingMarginBottom = euiTheme.size[customScale];
64
+ var marginSize = euiTheme.size[customScale];
65
+ var headingMarginTop = (0, _global_styling.mathWithUnits)(marginSize, function (x) {
66
+ return x * 2;
67
+ });
68
+ var headingMarginBottom = marginSize;
66
69
  return "\n font-size: ".concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n\n h1 {\n font-size: ").concat(headings.h1.fontSize, ";\n line-height: ").concat(headings.h1.lineHeight, ";\n }\n h1:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n\n h2 {\n font-size: ").concat(headings.h2.fontSize, ";\n line-height: ").concat(headings.h2.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h3 {\n font-size: ").concat(headings.h3.fontSize, ";\n line-height: ").concat(headings.h3.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h4 {\n font-size: ").concat(headings.h4.fontSize, ";\n line-height: ").concat(headings.h4.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h5 {\n font-size: ").concat(headings.h5.fontSize, ";\n line-height: ").concat(headings.h5.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h6 {\n font-size: ").concat(headings.h6.fontSize, ";\n line-height: ").concat(headings.h6.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n p,\n ul,\n ol,\n dl,\n blockquote,\n img,\n pre {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', lineHeightSize), "\n }\n\n ul,\n ol {\n ").concat((0, _global_styling.logicalCSS)('margin-left', lineHeightSize), "\n }\n \n blockquote {\n font-size: ").concat(fontSize, ";\n padding: ").concat(lineHeightSize, ";\n }\n\n dd + dt {\n ").concat((0, _global_styling.logicalCSS)('margin-top', fontSize), "\n }\n\n dt,\n .eui-definitionListReverse dd {\n font-size: ").concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n }\n\n .eui-definitionListReverse dt {\n font-size: ").concat((0, _global_styling.euiFontSize)(euiThemeContext, 'xs', options).fontSize, ";\n color: ").concat(euiTheme.colors.text, ";\n }\n\n small {\n font-size: ").concat((0, _global_styling.euiFontSize)(euiThemeContext, 's', options).fontSize, ";\n }\n\n pre:not(.euiCodeBlock__pre) {\n padding: ").concat(lineHeightSize, ";\n }\n\n code:not(.euiCode):not(.euiCodeBlock__code) {\n font-size: .9em; // 90% of parent font size\n }\n ").concat( // when textSize is 'm', the 'kbd' element gets a line between the text and the border-bottom
67
70
  _customScale === 'm' ? "\n kbd {\n ".concat((0, _global_styling.logicalCSS)('padding-bottom', euiTheme.size.xs), "\n // ensures when only one character the shape looks like a square\n ").concat((0, _global_styling.logicalCSS)('min-width', euiTheme.size.l), "\n ").concat((0, _global_styling.logicalTextAlignCSS)('center'), "\n }\n \n kbd::after {\n content: '';\n ").concat((0, _global_styling.logicalCSS)('border-bottom', "".concat(euiTheme.border.width.thin, " solid ").concat(euiTheme.colors.text)), "\n position: absolute;\n ").concat((0, _global_styling.logicalCSS)('bottom', euiTheme.size.xxs), "\n ").concat((0, _global_styling.logicalCSS)('left', 0), "\n ").concat((0, _global_styling.logicalCSS)('width', '100%'), "\n }") : '', "\n ");
68
71
  };
@@ -50,12 +50,13 @@ var euiToolTipStyles = function euiToolTipStyles(euiThemeContext) {
50
50
  */
51
51
 
52
52
  var arrowSize = euiTheme.size.m;
53
- var arrowSizeInt = parseInt(arrowSize, 10);
54
- var arrowPlusSize = "".concat((arrowSizeInt / 2 + 1) * -1, "px");
55
- /* 1 */
53
+ var arrowPlusSize = (0, _global_styling.mathWithUnits)(arrowSize, function (x) {
54
+ return (x / 2 + 1) * -1;
55
+ }); // 1.
56
56
 
57
- var arrowMinusSize = "".concat((arrowSizeInt / 2 - 1) * -1, "px");
58
- /* 1 */
57
+ var arrowMinusSize = (0, _global_styling.mathWithUnits)(arrowSize, function (x) {
58
+ return (x / 2 - 1) * -1;
59
+ }); // 1.
59
60
 
60
61
  return {
61
62
  // Base
@@ -40,15 +40,20 @@ exports.euiTourStyles = euiTourStyles;
40
40
  var euiTourBeaconStyles = function euiTourBeaconStyles(_ref2) {
41
41
  var euiTheme = _ref2.euiTheme;
42
42
  var arrowSize = euiTheme.size[_popover_arrow.popoverArrowSize];
43
- var arrowSizeInt = parseInt(arrowSize, 10);
43
+ var arrowHalfSize = (0, _global_styling.mathWithUnits)(arrowSize, function (x) {
44
+ return x / 2;
45
+ });
46
+ var arrowOffset = (0, _global_styling.mathWithUnits)(arrowSize, function (x) {
47
+ return x * -2;
48
+ });
44
49
  return {
45
50
  // Base
46
51
  euiTourBeacon: /*#__PURE__*/(0, _react.css)("pointer-events:none;position:absolute;opacity:0;transition:opacity 0s ", euiTheme.animation[_popover_panel.openAnimationTiming], ";;label:euiTourBeacon;"),
47
52
  // Positions
48
- right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', "".concat(arrowSizeInt / 2, "px")), ";", (0, _global_styling.logicalCSS)('left', "".concat(arrowSizeInt * -2, "px")), ";;label:right;"),
49
- left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', "".concat(arrowSizeInt / 2, "px")), ";", (0, _global_styling.logicalCSS)('left', arrowSize), ";;label:left;"),
50
- top: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', arrowSize), ";", (0, _global_styling.logicalCSS)('left', "".concat(arrowSizeInt / 2, "px")), ";;label:top;"),
51
- bottom: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', "".concat(arrowSizeInt * -2, "px")), ";", (0, _global_styling.logicalCSS)('left', "".concat(arrowSizeInt / 2, "px")), ";;label:bottom;")
53
+ right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', arrowHalfSize), ";", (0, _global_styling.logicalCSS)('left', arrowOffset), ";;label:right;"),
54
+ left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', arrowHalfSize), ";", (0, _global_styling.logicalCSS)('left', arrowSize), ";;label:left;"),
55
+ top: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', arrowSize), ";", (0, _global_styling.logicalCSS)('left', arrowHalfSize), ";;label:top;"),
56
+ bottom: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', arrowOffset), ";", (0, _global_styling.logicalCSS)('left', arrowHalfSize), ";;label:bottom;")
52
57
  };
53
58
  };
54
59
 
@@ -17,6 +17,19 @@ Object.keys(_logicals).forEach(function (key) {
17
17
  });
18
18
  });
19
19
 
20
+ var _math = require("./math");
21
+
22
+ Object.keys(_math).forEach(function (key) {
23
+ if (key === "default" || key === "__esModule") return;
24
+ if (key in exports && exports[key] === _math[key]) return;
25
+ Object.defineProperty(exports, key, {
26
+ enumerable: true,
27
+ get: function get() {
28
+ return _math[key];
29
+ }
30
+ });
31
+ });
32
+
20
33
  var _size = require("./size");
21
34
 
22
35
  Object.keys(_size).forEach(function (key) {
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports.mathWithUnits = void 0;
11
+
12
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
+
14
+ var _setPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/setPrototypeOf"));
15
+
16
+ function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(re, groups) { return new BabelRegExp(re, undefined, groups); }; var _super = RegExp.prototype; var _groups = new WeakMap(); function BabelRegExp(re, flags, groups) { var _this = new RegExp(re, flags); _groups.set(_this, groups || _groups.get(re)); return (0, _setPrototypeOf2.default)(_this, BabelRegExp.prototype); } (0, _inherits2.default)(BabelRegExp, RegExp); BabelRegExp.prototype.exec = function (str) { var result = _super.exec.call(this, str); if (result) result.groups = buildGroups(result, this); return result; }; BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { if (typeof substitution === "string") { var groups = _groups.get(this); return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { return "$" + groups[name]; })); } else if (typeof substitution === "function") { var _this = this; return _super[Symbol.replace].call(this, str, function () { var args = arguments; if (_typeof(args[args.length - 1]) !== "object") { args = [].slice.call(args); args.push(buildGroups(args, _this)); } return substitution.apply(this, args); }); } else { return _super[Symbol.replace].call(this, str, substitution); } }; function buildGroups(result, re) { var g = _groups.get(re); return Object.keys(g).reduce(function (groups, name) { groups[name] = result[g[name]]; return groups; }, Object.create(null)); } return _wrapRegExp.apply(this, arguments); }
17
+
18
+ /*
19
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
20
+ * or more contributor license agreements. Licensed under the Elastic License
21
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
22
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
23
+ * Side Public License, v 1.
24
+ */
25
+
26
+ /**
27
+ * Utility for performing math callbacks on a string with CSS units
28
+ * and returning a string with its unit preserved.
29
+ *
30
+ * Example usage:
31
+ * mathWithUnits('4px', (x) => x / 2) = '2px';
32
+ * mathWithUnits(euiTheme.size.xs, (x) => x + 2) = '6px';
33
+ */
34
+ var mathWithUnits = function mathWithUnits(value, callback) {
35
+ var unit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
36
+
37
+ if (typeof value === 'string') {
38
+ var _matches$groups;
39
+
40
+ var regex = /*#__PURE__*/_wrapRegExp(/(\x2D?[\.0-9]+)(%|[A-Za-z]*)/, {
41
+ value: 1,
42
+ unit: 2
43
+ });
44
+
45
+ var matches = regex.exec(value);
46
+ if (!(matches !== null && matches !== void 0 && (_matches$groups = matches.groups) !== null && _matches$groups !== void 0 && _matches$groups.value)) return value;
47
+ var numericValue = Number(matches.groups.value);
48
+ var passedUnit = matches.groups.unit || unit;
49
+ return "".concat(callback(numericValue)).concat(passedUnit);
50
+ } else if (typeof value === 'number') {
51
+ return "".concat(callback(value)).concat(unit);
52
+ } else {
53
+ return value;
54
+ }
55
+ };
56
+
57
+ exports.mathWithUnits = mathWithUnits;
@@ -117,12 +117,15 @@ exports.useEuiYScroll = useEuiYScroll;
117
117
 
118
118
  var euiYScrollWithShadows = function euiYScrollWithShadows(euiTheme) {
119
119
  var _ref7 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
120
- height = _ref7.height;
120
+ height = _ref7.height,
121
+ _ref7$side = _ref7.side,
122
+ side = _ref7$side === void 0 ? 'both' : _ref7$side;
121
123
 
122
124
  return "\n ".concat(euiYScroll(euiTheme, {
123
125
  height: height
124
126
  }), "\n ").concat(euiOverflowShadowStyles(euiTheme, {
125
- direction: 'y'
127
+ direction: 'y',
128
+ side: side
126
129
  }), "\n");
127
130
  };
128
131
 
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.makeHighContrastColor = exports.makeDisabledContrastColor = void 0;
8
+ exports.wcagContrastMin = exports.makeHighContrastColor = exports.makeDisabledContrastColor = void 0;
9
9
 
10
10
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
11
11
 
@@ -22,6 +22,7 @@ var _utils = require("../theme/utils");
22
22
  * in compliance with, at your election, the Elastic License 2.0 or the Server
23
23
  * Side Public License, v 1.
24
24
  */
25
+ var wcagContrastMin = 4.5; // WCAG AA minimum contrast ratio for normal (non-large) text
25
26
 
26
27
  /**
27
28
  * Creates a new color that meets or exceeds WCAG level AA
@@ -30,6 +31,9 @@ var _utils = require("../theme/utils");
30
31
  * *
31
32
  * @param themeOrBackground - Color to use as the contrast basis or just pass EuiTheme
32
33
  */
34
+
35
+ exports.wcagContrastMin = wcagContrastMin;
36
+
33
37
  var makeHighContrastColor = function makeHighContrastColor(_foreground) {
34
38
  var ratio = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 4.85;
35
39
  return function (themeOrBackground) {
@@ -57,6 +57,7 @@ var _exportNames = {
57
57
  lightness: true,
58
58
  makeHighContrastColor: true,
59
59
  makeDisabledContrastColor: true,
60
+ wcagContrastMin: true,
60
61
  useColorPickerState: true,
61
62
  useColorStopsState: true,
62
63
  copyToClipboard: true,
@@ -569,6 +570,12 @@ Object.defineProperty(exports, "useIsWithinMinBreakpoint", {
569
570
  return _breakpoint.useIsWithinMinBreakpoint;
570
571
  }
571
572
  });
573
+ Object.defineProperty(exports, "wcagContrastMin", {
574
+ enumerable: true,
575
+ get: function get() {
576
+ return _color.wcagContrastMin;
577
+ }
578
+ });
572
579
 
573
580
  var keys = _interopRequireWildcard(require("./keys"));
574
581
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.EuiThemeContext = exports.EuiSystemContext = exports.EuiModificationsContext = exports.EuiColorModeContext = void 0;
6
+ exports.defaultComputedTheme = exports.EuiThemeContext = exports.EuiSystemContext = exports.EuiModificationsContext = exports.EuiColorModeContext = void 0;
7
7
 
8
8
  var _react = require("react");
9
9
 
@@ -24,5 +24,7 @@ var EuiModificationsContext = /*#__PURE__*/(0, _react.createContext)({});
24
24
  exports.EuiModificationsContext = EuiModificationsContext;
25
25
  var EuiColorModeContext = /*#__PURE__*/(0, _react.createContext)(_utils.DEFAULT_COLOR_MODE);
26
26
  exports.EuiColorModeContext = EuiColorModeContext;
27
- var EuiThemeContext = /*#__PURE__*/(0, _react.createContext)((0, _utils.getComputed)(_theme.EuiThemeAmsterdam, {}, _utils.DEFAULT_COLOR_MODE));
27
+ var defaultComputedTheme = (0, _utils.getComputed)(_theme.EuiThemeAmsterdam, {}, _utils.DEFAULT_COLOR_MODE);
28
+ exports.defaultComputedTheme = defaultComputedTheme;
29
+ var EuiThemeContext = /*#__PURE__*/(0, _react.createContext)(defaultComputedTheme);
28
30
  exports.EuiThemeContext = EuiThemeContext;
@@ -15,6 +15,8 @@ var _react = _interopRequireWildcard(require("react"));
15
15
 
16
16
  var _context = require("./context");
17
17
 
18
+ var _provider = require("./provider");
19
+
18
20
  var _react2 = require("@emotion/react");
19
21
 
20
22
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -28,10 +30,36 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
28
30
  * in compliance with, at your election, the Elastic License 2.0 or the Server
29
31
  * Side Public License, v 1.
30
32
  */
33
+ var providerMessage = "`EuiProvider` is missing which can result in negative effects.\nWrap your component in `EuiProvider`: https://ela.st/euiprovider.";
34
+
31
35
  var useEuiTheme = function useEuiTheme() {
32
36
  var theme = (0, _react.useContext)(_context.EuiThemeContext);
33
37
  var colorMode = (0, _react.useContext)(_context.EuiColorModeContext);
34
38
  var modifications = (0, _react.useContext)(_context.EuiModificationsContext);
39
+
40
+ if (process.env.NODE_ENV !== 'production') {
41
+ var isFallback = theme === _context.defaultComputedTheme;
42
+ var warningLevel = (0, _provider.getEuiDevProviderWarning)();
43
+
44
+ if (isFallback && typeof warningLevel !== 'undefined') {
45
+ switch (warningLevel) {
46
+ case 'log':
47
+ console.log(providerMessage);
48
+ break;
49
+
50
+ case 'warn':
51
+ console.warn(providerMessage);
52
+ break;
53
+
54
+ case 'error':
55
+ throw new Error(providerMessage);
56
+
57
+ default:
58
+ break;
59
+ }
60
+ }
61
+ }
62
+
35
63
  var assembledTheme = (0, _react.useMemo)(function () {
36
64
  return {
37
65
  euiTheme: theme,
@@ -69,6 +69,12 @@ Object.defineProperty(exports, "getComputed", {
69
69
  return _utils.getComputed;
70
70
  }
71
71
  });
72
+ Object.defineProperty(exports, "getEuiDevProviderWarning", {
73
+ enumerable: true,
74
+ get: function get() {
75
+ return _provider.getEuiDevProviderWarning;
76
+ }
77
+ });
72
78
  Object.defineProperty(exports, "getOn", {
73
79
  enumerable: true,
74
80
  get: function get() {
@@ -87,6 +93,12 @@ Object.defineProperty(exports, "mergeDeep", {
87
93
  return _utils.mergeDeep;
88
94
  }
89
95
  });
96
+ Object.defineProperty(exports, "setEuiDevProviderWarning", {
97
+ enumerable: true,
98
+ get: function get() {
99
+ return _provider.setEuiDevProviderWarning;
100
+ }
101
+ });
90
102
  Object.defineProperty(exports, "setOn", {
91
103
  enumerable: true,
92
104
  get: function get() {
@@ -7,7 +7,9 @@ var _typeof = require("@babel/runtime/helpers/typeof");
7
7
  Object.defineProperty(exports, "__esModule", {
8
8
  value: true
9
9
  });
10
- exports.EuiThemeProvider = void 0;
10
+ exports.setEuiDevProviderWarning = exports.getEuiDevProviderWarning = exports.EuiThemeProvider = void 0;
11
+
12
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
13
 
12
14
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
15
 
@@ -25,13 +27,24 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
25
27
 
26
28
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
29
 
28
- /*
29
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
30
- * or more contributor license agreements. Licensed under the Elastic License
31
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
32
- * in compliance with, at your election, the Elastic License 2.0 or the Server
33
- * Side Public License, v 1.
34
- */
30
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
31
+
32
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(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; }
33
+
34
+ var providerWarning = undefined;
35
+
36
+ var setEuiDevProviderWarning = function setEuiDevProviderWarning(level) {
37
+ return providerWarning = level;
38
+ };
39
+
40
+ exports.setEuiDevProviderWarning = setEuiDevProviderWarning;
41
+
42
+ var getEuiDevProviderWarning = function getEuiDevProviderWarning() {
43
+ return providerWarning;
44
+ };
45
+
46
+ exports.getEuiDevProviderWarning = getEuiDevProviderWarning;
47
+
35
48
  var EuiThemeProvider = function EuiThemeProvider(_ref) {
36
49
  var _system = _ref.theme,
37
50
  _colorMode = _ref.colorMode,
@@ -64,7 +77,8 @@ var EuiThemeProvider = function EuiThemeProvider(_ref) {
64
77
  var prevColorMode = (0, _react.useRef)(colorMode);
65
78
  var isParentTheme = (0, _react.useRef)(prevSystemKey.current === parentSystem.key && colorMode === parentColorMode && (0, _isEqual.default)(parentModifications, modifications));
66
79
 
67
- var _useState7 = (0, _react.useState)(isParentTheme.current && Object.keys(parentTheme).length ? parentTheme : (0, _utils.getComputed)(system, (0, _utils.buildTheme)(modifications, "_".concat(system.key)), colorMode)),
80
+ var _useState7 = (0, _react.useState)(isParentTheme.current && Object.keys(parentTheme).length ? _objectSpread({}, parentTheme) // Intentionally create a new object to break referential equality
81
+ : (0, _utils.getComputed)(system, (0, _utils.buildTheme)(modifications, "_".concat(system.key)), colorMode)),
68
82
  _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
69
83
  theme = _useState8[0],
70
84
  setTheme = _useState8[1];
@@ -1,133 +0,0 @@
1
- /**
2
- * 1. Accounts for the border
3
- */
4
- .euiBadge {
5
- font-size: $euiFontSizeXS;
6
- font-weight: $euiFontWeightMedium;
7
- line-height: $euiSize + 2px; /* 1 */
8
- padding: 0 $euiSizeS;
9
- display: inline-block;
10
- text-decoration: none;
11
- border-radius: $euiBorderRadius / 2;
12
- border: solid 1px transparent;
13
- background-color: transparent;
14
- white-space: nowrap;
15
- vertical-align: middle;
16
- cursor: default;
17
- max-width: 100%;
18
- // The badge will only ever be as wide as its content
19
- // So, make the text left aligned to ensure all badges line up the same
20
- text-align: left;
21
-
22
- &.euiBadge-isDisabled {
23
- // sass-lint:disable-block no-important
24
- // Using !important to override inline styles
25
- color: makeHighContrastColor($euiButtonColorDisabled, $euiButtonColorDisabled, 2) !important;
26
- background-color: $euiButtonColorDisabled !important;
27
- }
28
-
29
- &:focus-within {
30
- @include euiFocusRing('small');
31
- }
32
-
33
- + .euiBadge {
34
- margin-left: $euiSizeXS;
35
- }
36
-
37
- .euiBadge__content {
38
- min-height: $euiSize + ($euiBorderWidthThin * 2); // Ensure proper height in case of just displaying an icon
39
- display: flex;
40
- align-items: center;
41
- overflow: hidden;
42
- }
43
-
44
- .euiBadge__childButton {
45
- @include euiTextTruncate;
46
- text-align: inherit;
47
- font-weight: inherit;
48
- line-height: inherit;
49
- color: inherit;
50
-
51
- &:disabled {
52
- cursor: not-allowed;
53
- }
54
-
55
- &:not(:disabled) {
56
- &:hover,
57
- &:focus {
58
- text-decoration: underline;
59
- }
60
- }
61
- }
62
-
63
- .euiBadge__iconButton {
64
- font-size: 0; // Makes the button only as large as the icon so it aligns vertically better
65
- margin-left: $euiSizeXS;
66
-
67
- &:focus {
68
- background-color: transparentize($euiColorGhost, .2);
69
- color: $euiColorInk;
70
- border-radius: 2px;
71
- }
72
-
73
- &:disabled {
74
- cursor: not-allowed;
75
- }
76
-
77
- .euiBadge__icon {
78
- // Remove margins from icon itself so that focus state doesn't include that space
79
- margin: 0 !important; // sass-lint:disable-line no-important
80
- }
81
- }
82
-
83
- .euiBadge__text {
84
- @include euiTextTruncate;
85
- cursor: default;
86
- }
87
-
88
- .euiBadge__icon {
89
- &:not(:only-child) {
90
- margin-left: $euiSizeXS;
91
- }
92
- }
93
-
94
- &.euiBadge--iconLeft {
95
- .euiBadge__content {
96
- flex-direction: row-reverse;
97
- }
98
-
99
- .euiBadge__iconButton,
100
- .euiBadge__icon:not(:only-child) {
101
- margin-right: $euiSizeXS;
102
- margin-left: 0;
103
- }
104
- }
105
- }
106
-
107
- .euiBadge-isClickable {
108
- &:not(:disabled) {
109
- &:hover,
110
- &:focus {
111
- text-decoration: underline;
112
- }
113
- }
114
-
115
- &.euiBadge-isDisabled {
116
- cursor: not-allowed;
117
- }
118
-
119
- &:focus {
120
- @include euiFocusRing('small');
121
- }
122
-
123
- .euiBadge__text {
124
- cursor: inherit;
125
- }
126
- }
127
-
128
- // Hollow has a border and is mostly used for autocompleters.
129
- .euiBadge--hollow {
130
- background-color: $euiColorEmptyShade;
131
- border-color: lightOrDarkTheme($euiBorderColor, tint($euiBorderColor, 15%));
132
- color: $euiTextColor;
133
- }