@elastic/eui 66.0.0 → 67.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (325) hide show
  1. package/dist/eui_theme_dark.css +0 -345
  2. package/dist/eui_theme_dark.json +0 -6
  3. package/dist/eui_theme_dark.json.d.ts +0 -6
  4. package/dist/eui_theme_dark.min.css +1 -1
  5. package/dist/eui_theme_light.css +0 -345
  6. package/dist/eui_theme_light.json +0 -6
  7. package/dist/eui_theme_light.json.d.ts +0 -6
  8. package/dist/eui_theme_light.min.css +1 -1
  9. package/es/components/badge/badge.js +84 -78
  10. package/es/components/badge/badge.styles.js +56 -0
  11. package/es/components/basic_table/in_memory_table.js +8 -0
  12. package/es/components/button/button.js +0 -1
  13. package/es/components/button/button_display/_button_display.js +20 -6
  14. package/es/components/button/button_display/_button_display.styles.js +2 -2
  15. package/es/components/button/button_display/_button_display_content.js +5 -3
  16. package/es/components/button/button_display/_button_display_content.styles.js +4 -1
  17. package/es/components/button/button_empty/button_empty.js +10 -1
  18. package/es/components/card/card.js +2 -2
  19. package/es/components/card/card.styles.js +5 -2
  20. package/es/components/collapsible_nav/collapsible_nav.js +0 -5
  21. package/es/components/date_picker/auto_refresh/auto_refresh.js +6 -1
  22. package/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js +6 -2
  23. package/es/components/expression/expression.js +12 -2
  24. package/es/components/header/header_links/header_link.js +10 -1
  25. package/es/components/image/image.js +6 -1
  26. package/es/components/image/image_fullscreen_wrapper.js +2 -3
  27. package/es/components/notification/notification_event.js +25 -6
  28. package/es/components/notification/notification_event_meta.js +1 -1
  29. package/es/components/overlay_mask/overlay_mask.js +27 -65
  30. package/es/components/overlay_mask/overlay_mask.styles.js +28 -0
  31. package/es/components/page/page_content/page_content.js +1 -2
  32. package/es/components/page/page_content/page_content_body.js +1 -2
  33. package/es/components/page/page_content/page_content_header.js +1 -2
  34. package/es/components/page/page_content/page_content_header_section.js +1 -2
  35. package/es/components/page/page_section/page_section.js +15 -3
  36. package/es/components/page/page_side_bar/page_side_bar.js +1 -2
  37. package/es/components/page/page_template.js +3 -1
  38. package/es/components/page_template/empty_prompt/page_empty_prompt.js +11 -1
  39. package/es/components/page_template/page_template.js +18 -2
  40. package/es/components/pagination/pagination.js +17 -4
  41. package/es/components/pagination/pagination.styles.js +31 -0
  42. package/es/components/pagination/pagination_button.js +17 -5
  43. package/es/components/pagination/pagination_button.styles.js +30 -0
  44. package/es/components/pagination/pagination_button_arrow.js +5 -0
  45. package/es/components/popover/popover_title.js +2 -2
  46. package/es/components/popover/popover_title.styles.js +18 -6
  47. package/es/components/progress/progress.js +6 -1
  48. package/es/components/provider/cache/cache_provider.js +3 -9
  49. package/es/components/provider/provider.js +25 -2
  50. package/es/components/resizable_container/resizable_panel.js +6 -1
  51. package/es/components/search_bar/filters/custom_component_filter.js +16 -0
  52. package/es/components/search_bar/filters/filters.js +6 -0
  53. package/es/components/search_bar/query/ast.js +12 -0
  54. package/es/components/search_bar/query/ast_to_es_query_dsl.js +15 -10
  55. package/es/components/search_bar/query/query.js +17 -0
  56. package/es/components/search_bar/search_bar.js +4 -0
  57. package/es/components/search_bar/search_filters.js +4 -0
  58. package/es/components/selectable/selectable_list/selectable_list.js +2 -2
  59. package/es/components/selectable/selectable_list/selectable_list_item.js +2 -2
  60. package/es/components/side_nav/side_nav.js +5 -0
  61. package/es/components/suggest/suggest.js +10 -1
  62. package/es/components/tool_tip/tool_tip.js +42 -66
  63. package/es/components/tool_tip/tool_tip.styles.js +107 -0
  64. package/es/components/tool_tip/tool_tip_anchor.js +73 -0
  65. package/es/components/tool_tip/tool_tip_arrow.js +20 -0
  66. package/es/components/tool_tip/tool_tip_popover.js +48 -101
  67. package/es/global_styling/index.js +2 -1
  68. package/es/global_styling/utility/animations.js +13 -0
  69. package/es/services/color/contrast.js +2 -0
  70. package/es/services/index.js +1 -1
  71. package/es/services/theme/context.js +2 -1
  72. package/es/services/theme/hooks.js +27 -1
  73. package/es/services/theme/index.js +1 -1
  74. package/es/services/theme/provider.js +15 -1
  75. package/eui.d.ts +232 -79
  76. package/i18ntokens.json +54 -54
  77. package/lib/components/badge/badge.js +92 -80
  78. package/lib/components/badge/badge.styles.js +61 -0
  79. package/lib/components/basic_table/in_memory_table.js +8 -0
  80. package/lib/components/button/button.js +0 -1
  81. package/lib/components/button/button_display/_button_display.js +20 -6
  82. package/lib/components/button/button_display/_button_display.styles.js +2 -2
  83. package/lib/components/button/button_display/_button_display_content.js +9 -4
  84. package/lib/components/button/button_display/_button_display_content.styles.js +4 -1
  85. package/lib/components/button/button_empty/button_empty.js +10 -1
  86. package/lib/components/card/card.js +2 -2
  87. package/lib/components/card/card.styles.js +5 -2
  88. package/lib/components/collapsible_nav/collapsible_nav.js +0 -5
  89. package/lib/components/date_picker/auto_refresh/auto_refresh.js +6 -1
  90. package/lib/components/date_picker/super_date_picker/date_popover/date_popover_button.js +6 -1
  91. package/lib/components/expression/expression.js +12 -2
  92. package/lib/components/header/header_links/header_link.js +10 -1
  93. package/lib/components/image/image.js +6 -1
  94. package/lib/components/image/image_fullscreen_wrapper.js +2 -3
  95. package/lib/components/notification/notification_event.js +28 -9
  96. package/lib/components/notification/notification_event_meta.js +1 -1
  97. package/lib/components/overlay_mask/overlay_mask.js +27 -65
  98. package/lib/components/overlay_mask/overlay_mask.styles.js +34 -0
  99. package/lib/components/page/page_content/page_content.js +1 -2
  100. package/lib/components/page/page_content/page_content_body.js +1 -2
  101. package/lib/components/page/page_content/page_content_header.js +1 -2
  102. package/lib/components/page/page_content/page_content_header_section.js +1 -2
  103. package/lib/components/page/page_section/page_section.js +15 -3
  104. package/lib/components/page/page_side_bar/page_side_bar.js +1 -2
  105. package/lib/components/page/page_template.js +3 -1
  106. package/lib/components/page_template/empty_prompt/page_empty_prompt.js +11 -1
  107. package/lib/components/page_template/page_template.js +18 -2
  108. package/lib/components/pagination/pagination.js +18 -3
  109. package/lib/components/pagination/pagination.styles.js +34 -0
  110. package/lib/components/pagination/pagination_button.js +9 -4
  111. package/lib/components/pagination/pagination_button.styles.js +45 -0
  112. package/lib/components/pagination/pagination_button_arrow.js +7 -0
  113. package/lib/components/popover/popover_title.js +2 -2
  114. package/lib/components/popover/popover_title.styles.js +19 -7
  115. package/lib/components/progress/progress.js +6 -1
  116. package/lib/components/provider/cache/cache_provider.js +3 -11
  117. package/lib/components/provider/provider.js +31 -6
  118. package/lib/components/resizable_container/resizable_panel.js +6 -1
  119. package/lib/components/search_bar/filters/custom_component_filter.js +29 -0
  120. package/lib/components/search_bar/filters/filters.js +7 -0
  121. package/lib/components/search_bar/query/ast.js +12 -0
  122. package/lib/components/search_bar/query/ast_to_es_query_dsl.js +16 -11
  123. package/lib/components/search_bar/query/query.js +17 -0
  124. package/lib/components/search_bar/search_bar.js +4 -0
  125. package/lib/components/search_bar/search_filters.js +4 -0
  126. package/lib/components/selectable/selectable_list/selectable_list.js +2 -2
  127. package/lib/components/selectable/selectable_list/selectable_list_item.js +2 -2
  128. package/lib/components/side_nav/side_nav.js +5 -0
  129. package/lib/components/suggest/suggest.js +10 -1
  130. package/lib/components/tool_tip/tool_tip.js +43 -64
  131. package/lib/components/tool_tip/tool_tip.styles.js +123 -0
  132. package/lib/components/tool_tip/tool_tip_anchor.js +87 -0
  133. package/lib/components/tool_tip/tool_tip_arrow.js +28 -0
  134. package/lib/components/tool_tip/tool_tip_popover.js +49 -98
  135. package/lib/global_styling/index.js +13 -0
  136. package/lib/global_styling/utility/animations.js +15 -0
  137. package/lib/services/color/contrast.js +6 -1
  138. package/lib/services/index.js +7 -0
  139. package/lib/services/theme/context.js +4 -2
  140. package/lib/services/theme/hooks.js +28 -0
  141. package/lib/services/theme/index.js +12 -0
  142. package/lib/services/theme/provider.js +23 -2
  143. package/optimize/es/components/badge/badge.js +82 -76
  144. package/optimize/es/components/badge/badge.styles.js +56 -0
  145. package/optimize/es/components/basic_table/in_memory_table.js +4 -0
  146. package/optimize/es/components/button/button.js +0 -1
  147. package/optimize/es/components/button/button_display/_button_display.js +8 -3
  148. package/optimize/es/components/button/button_display/_button_display.styles.js +2 -2
  149. package/optimize/es/components/button/button_display/_button_display_content.js +3 -1
  150. package/optimize/es/components/button/button_display/_button_display_content.styles.js +4 -1
  151. package/optimize/es/components/card/card.js +2 -2
  152. package/optimize/es/components/card/card.styles.js +5 -2
  153. package/optimize/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js +0 -1
  154. package/optimize/es/components/image/image_fullscreen_wrapper.js +2 -3
  155. package/optimize/es/components/notification/notification_event.js +10 -4
  156. package/optimize/es/components/overlay_mask/overlay_mask.js +27 -60
  157. package/optimize/es/components/overlay_mask/overlay_mask.styles.js +28 -0
  158. package/optimize/es/components/page/page_content/page_content.js +1 -2
  159. package/optimize/es/components/page/page_content/page_content_body.js +1 -2
  160. package/optimize/es/components/page/page_content/page_content_header.js +1 -2
  161. package/optimize/es/components/page/page_content/page_content_header_section.js +1 -2
  162. package/optimize/es/components/page/page_section/page_section.js +4 -2
  163. package/optimize/es/components/page/page_side_bar/page_side_bar.js +1 -2
  164. package/optimize/es/components/page/page_template.js +3 -1
  165. package/optimize/es/components/pagination/pagination.js +17 -4
  166. package/optimize/es/components/pagination/pagination.styles.js +31 -0
  167. package/optimize/es/components/pagination/pagination_button.js +7 -4
  168. package/optimize/es/components/pagination/pagination_button.styles.js +30 -0
  169. package/optimize/es/components/pagination/pagination_button_arrow.js +5 -0
  170. package/optimize/es/components/popover/popover_title.js +2 -2
  171. package/optimize/es/components/popover/popover_title.styles.js +18 -6
  172. package/optimize/es/components/provider/cache/cache_provider.js +3 -9
  173. package/optimize/es/components/provider/provider.js +25 -2
  174. package/optimize/es/components/search_bar/filters/custom_component_filter.js +16 -0
  175. package/optimize/es/components/search_bar/filters/filters.js +6 -0
  176. package/optimize/es/components/search_bar/query/ast.js +12 -0
  177. package/optimize/es/components/search_bar/query/ast_to_es_query_dsl.js +14 -9
  178. package/optimize/es/components/search_bar/query/query.js +17 -0
  179. package/optimize/es/components/suggest/suggest.js +4 -1
  180. package/optimize/es/components/tool_tip/tool_tip.js +42 -66
  181. package/optimize/es/components/tool_tip/tool_tip.styles.js +107 -0
  182. package/optimize/es/components/tool_tip/tool_tip_anchor.js +60 -0
  183. package/optimize/es/components/tool_tip/tool_tip_arrow.js +20 -0
  184. package/optimize/es/components/tool_tip/tool_tip_popover.js +46 -87
  185. package/optimize/es/global_styling/index.js +2 -1
  186. package/optimize/es/global_styling/utility/animations.js +13 -0
  187. package/optimize/es/services/color/contrast.js +2 -0
  188. package/optimize/es/services/index.js +1 -1
  189. package/optimize/es/services/theme/context.js +2 -1
  190. package/optimize/es/services/theme/hooks.js +27 -1
  191. package/optimize/es/services/theme/index.js +1 -1
  192. package/optimize/es/services/theme/provider.js +14 -1
  193. package/optimize/lib/components/badge/badge.js +90 -78
  194. package/optimize/lib/components/badge/badge.styles.js +61 -0
  195. package/optimize/lib/components/basic_table/in_memory_table.js +4 -0
  196. package/optimize/lib/components/button/button.js +0 -1
  197. package/optimize/lib/components/button/button_display/_button_display.js +8 -3
  198. package/optimize/lib/components/button/button_display/_button_display.styles.js +2 -2
  199. package/optimize/lib/components/button/button_display/_button_display_content.js +6 -2
  200. package/optimize/lib/components/button/button_display/_button_display_content.styles.js +4 -1
  201. package/optimize/lib/components/card/card.js +2 -2
  202. package/optimize/lib/components/card/card.styles.js +5 -2
  203. package/optimize/lib/components/image/image_fullscreen_wrapper.js +2 -3
  204. package/optimize/lib/components/notification/notification_event.js +11 -11
  205. package/optimize/lib/components/overlay_mask/overlay_mask.js +27 -59
  206. package/optimize/lib/components/overlay_mask/overlay_mask.styles.js +34 -0
  207. package/optimize/lib/components/page/page_content/page_content.js +1 -2
  208. package/optimize/lib/components/page/page_content/page_content_body.js +1 -2
  209. package/optimize/lib/components/page/page_content/page_content_header.js +1 -2
  210. package/optimize/lib/components/page/page_content/page_content_header_section.js +1 -2
  211. package/optimize/lib/components/page/page_section/page_section.js +4 -2
  212. package/optimize/lib/components/page/page_side_bar/page_side_bar.js +1 -2
  213. package/optimize/lib/components/page/page_template.js +3 -1
  214. package/optimize/lib/components/pagination/pagination.js +18 -3
  215. package/optimize/lib/components/pagination/pagination.styles.js +34 -0
  216. package/optimize/lib/components/pagination/pagination_button.js +9 -4
  217. package/optimize/lib/components/pagination/pagination_button.styles.js +45 -0
  218. package/optimize/lib/components/pagination/pagination_button_arrow.js +7 -0
  219. package/optimize/lib/components/popover/popover_title.js +2 -2
  220. package/optimize/lib/components/popover/popover_title.styles.js +19 -7
  221. package/optimize/lib/components/provider/cache/cache_provider.js +3 -11
  222. package/optimize/lib/components/provider/provider.js +31 -6
  223. package/optimize/lib/components/search_bar/filters/custom_component_filter.js +29 -0
  224. package/optimize/lib/components/search_bar/filters/filters.js +7 -0
  225. package/optimize/lib/components/search_bar/query/ast.js +12 -0
  226. package/optimize/lib/components/search_bar/query/ast_to_es_query_dsl.js +16 -11
  227. package/optimize/lib/components/search_bar/query/query.js +17 -0
  228. package/optimize/lib/components/suggest/suggest.js +4 -1
  229. package/optimize/lib/components/tool_tip/tool_tip.js +42 -64
  230. package/optimize/lib/components/tool_tip/tool_tip.styles.js +125 -0
  231. package/optimize/lib/components/tool_tip/tool_tip_anchor.js +75 -0
  232. package/optimize/lib/components/tool_tip/tool_tip_arrow.js +35 -0
  233. package/optimize/lib/components/tool_tip/tool_tip_popover.js +47 -88
  234. package/optimize/lib/global_styling/index.js +13 -0
  235. package/optimize/lib/global_styling/utility/animations.js +17 -0
  236. package/optimize/lib/services/color/contrast.js +5 -1
  237. package/optimize/lib/services/index.js +7 -0
  238. package/optimize/lib/services/theme/context.js +4 -2
  239. package/optimize/lib/services/theme/hooks.js +28 -0
  240. package/optimize/lib/services/theme/index.js +12 -0
  241. package/optimize/lib/services/theme/provider.js +23 -9
  242. package/package.json +5 -5
  243. package/src/components/badge/_index.scss +0 -1
  244. package/src/components/index.scss +0 -4
  245. package/src/global_styling/mixins/_tool_tip.scss +3 -6
  246. package/src/themes/amsterdam/overrides/_index.scss +0 -2
  247. package/test-env/components/badge/badge.js +92 -80
  248. package/test-env/components/badge/badge.styles.js +61 -0
  249. package/test-env/components/basic_table/in_memory_table.js +8 -0
  250. package/test-env/components/button/button.js +0 -1
  251. package/test-env/components/button/button_display/_button_display.js +20 -6
  252. package/test-env/components/button/button_display/_button_display.styles.js +2 -2
  253. package/test-env/components/button/button_display/_button_display_content.js +8 -4
  254. package/test-env/components/button/button_display/_button_display_content.styles.js +4 -1
  255. package/test-env/components/button/button_empty/button_empty.js +10 -1
  256. package/test-env/components/card/card.js +2 -2
  257. package/test-env/components/card/card.styles.js +5 -2
  258. package/test-env/components/collapsible_nav/collapsible_nav.js +0 -5
  259. package/test-env/components/date_picker/auto_refresh/auto_refresh.js +6 -1
  260. package/test-env/components/date_picker/super_date_picker/date_popover/date_popover_button.js +6 -1
  261. package/test-env/components/expression/expression.js +12 -2
  262. package/test-env/components/header/header_links/header_link.js +10 -1
  263. package/test-env/components/image/image.js +6 -1
  264. package/test-env/components/image/image_fullscreen_wrapper.js +2 -3
  265. package/test-env/components/notification/notification_event.js +25 -16
  266. package/test-env/components/notification/notification_event_meta.js +1 -1
  267. package/test-env/components/overlay_mask/overlay_mask.js +27 -64
  268. package/test-env/components/overlay_mask/overlay_mask.styles.js +34 -0
  269. package/test-env/components/page/page_content/page_content.js +1 -2
  270. package/test-env/components/page/page_content/page_content_body.js +1 -2
  271. package/test-env/components/page/page_content/page_content_header.js +1 -2
  272. package/test-env/components/page/page_content/page_content_header_section.js +1 -2
  273. package/test-env/components/page/page_section/page_section.js +15 -3
  274. package/test-env/components/page/page_side_bar/page_side_bar.js +1 -2
  275. package/test-env/components/page/page_template.js +3 -1
  276. package/test-env/components/page_template/empty_prompt/page_empty_prompt.js +11 -1
  277. package/test-env/components/page_template/page_template.js +18 -2
  278. package/test-env/components/pagination/pagination.js +18 -3
  279. package/test-env/components/pagination/pagination.styles.js +34 -0
  280. package/test-env/components/pagination/pagination_button.js +9 -4
  281. package/test-env/components/pagination/pagination_button.styles.js +45 -0
  282. package/test-env/components/pagination/pagination_button_arrow.js +7 -0
  283. package/test-env/components/popover/popover_title.js +2 -2
  284. package/test-env/components/popover/popover_title.styles.js +19 -7
  285. package/test-env/components/progress/progress.js +6 -1
  286. package/test-env/components/provider/cache/cache_provider.js +3 -11
  287. package/test-env/components/provider/provider.js +31 -6
  288. package/test-env/components/resizable_container/resizable_panel.js +6 -1
  289. package/test-env/components/search_bar/filters/custom_component_filter.js +29 -0
  290. package/test-env/components/search_bar/filters/filters.js +7 -0
  291. package/test-env/components/search_bar/query/ast.js +12 -0
  292. package/test-env/components/search_bar/query/ast_to_es_query_dsl.js +16 -11
  293. package/test-env/components/search_bar/query/query.js +17 -0
  294. package/test-env/components/search_bar/search_bar.js +4 -0
  295. package/test-env/components/search_bar/search_filters.js +4 -0
  296. package/test-env/components/selectable/selectable_list/selectable_list.js +2 -2
  297. package/test-env/components/selectable/selectable_list/selectable_list_item.js +2 -2
  298. package/test-env/components/side_nav/side_nav.js +5 -0
  299. package/test-env/components/suggest/suggest.js +10 -1
  300. package/test-env/components/tool_tip/tool_tip.js +42 -64
  301. package/test-env/components/tool_tip/tool_tip.styles.js +125 -0
  302. package/test-env/components/tool_tip/tool_tip_anchor.js +84 -0
  303. package/test-env/components/tool_tip/tool_tip_arrow.js +35 -0
  304. package/test-env/components/tool_tip/tool_tip_popover.js +49 -89
  305. package/test-env/global_styling/index.js +13 -0
  306. package/test-env/global_styling/utility/animations.js +17 -0
  307. package/test-env/services/color/contrast.js +5 -1
  308. package/test-env/services/index.js +7 -0
  309. package/test-env/services/theme/context.js +4 -2
  310. package/test-env/services/theme/hooks.js +28 -0
  311. package/test-env/services/theme/index.js +12 -0
  312. package/test-env/services/theme/provider.js +23 -9
  313. package/src/components/badge/_badge.scss +0 -133
  314. package/src/components/call_out/_index.scss +0 -3
  315. package/src/components/call_out/_mixins.scss +0 -23
  316. package/src/components/call_out/_variables.scss +0 -7
  317. package/src/components/overlay_mask/_index.scss +0 -1
  318. package/src/components/overlay_mask/_overlay_mask.scss +0 -33
  319. package/src/components/pagination/_index.scss +0 -2
  320. package/src/components/pagination/_pagination.scss +0 -30
  321. package/src/components/pagination/_pagination_button.scss +0 -37
  322. package/src/components/tool_tip/_index.scss +0 -1
  323. package/src/components/tool_tip/_tool_tip.scss +0 -121
  324. package/src/themes/amsterdam/overrides/_overlay_mask.scss +0 -3
  325. package/src/themes/amsterdam/overrides/_tooltip.scss +0 -7
package/i18ntokens.json CHANGED
@@ -1941,11 +1941,11 @@
1941
1941
  "highlighting": "string",
1942
1942
  "loc": {
1943
1943
  "start": {
1944
- "line": 92,
1944
+ "line": 93,
1945
1945
  "column": 23
1946
1946
  },
1947
1947
  "end": {
1948
- "line": 96,
1948
+ "line": 97,
1949
1949
  "column": 3
1950
1950
  }
1951
1951
  },
@@ -1957,11 +1957,11 @@
1957
1957
  "highlighting": "string",
1958
1958
  "loc": {
1959
1959
  "start": {
1960
- "line": 97,
1960
+ "line": 98,
1961
1961
  "column": 24
1962
1962
  },
1963
1963
  "end": {
1964
- "line": 101,
1964
+ "line": 102,
1965
1965
  "column": 3
1966
1966
  }
1967
1967
  },
@@ -2885,11 +2885,11 @@
2885
2885
  "highlighting": "string",
2886
2886
  "loc": {
2887
2887
  "start": {
2888
- "line": 124,
2888
+ "line": 126,
2889
2889
  "column": 6
2890
2890
  },
2891
2891
  "end": {
2892
- "line": 127,
2892
+ "line": 129,
2893
2893
  "column": 8
2894
2894
  }
2895
2895
  },
@@ -2901,11 +2901,11 @@
2901
2901
  "highlighting": "string",
2902
2902
  "loc": {
2903
2903
  "start": {
2904
- "line": 131,
2904
+ "line": 133,
2905
2905
  "column": 8
2906
2906
  },
2907
2907
  "end": {
2908
- "line": 134,
2908
+ "line": 136,
2909
2909
  "column": 10
2910
2910
  }
2911
2911
  },
@@ -2917,11 +2917,11 @@
2917
2917
  "highlighting": "string",
2918
2918
  "loc": {
2919
2919
  "start": {
2920
- "line": 136,
2920
+ "line": 138,
2921
2921
  "column": 8
2922
2922
  },
2923
2923
  "end": {
2924
- "line": 139,
2924
+ "line": 141,
2925
2925
  "column": 10
2926
2926
  }
2927
2927
  },
@@ -2933,11 +2933,11 @@
2933
2933
  "highlighting": "string",
2934
2934
  "loc": {
2935
2935
  "start": {
2936
- "line": 146,
2936
+ "line": 148,
2937
2937
  "column": 8
2938
2938
  },
2939
2939
  "end": {
2940
- "line": 149,
2940
+ "line": 151,
2941
2941
  "column": 10
2942
2942
  }
2943
2943
  },
@@ -2949,11 +2949,11 @@
2949
2949
  "highlighting": "string",
2950
2950
  "loc": {
2951
2951
  "start": {
2952
- "line": 153,
2952
+ "line": 155,
2953
2953
  "column": 8
2954
2954
  },
2955
2955
  "end": {
2956
- "line": 156,
2956
+ "line": 158,
2957
2957
  "column": 10
2958
2958
  }
2959
2959
  },
@@ -4437,11 +4437,11 @@
4437
4437
  "highlighting": "string",
4438
4438
  "loc": {
4439
4439
  "start": {
4440
- "line": 43,
4440
+ "line": 48,
4441
4441
  "column": 11
4442
4442
  },
4443
4443
  "end": {
4444
- "line": 43,
4444
+ "line": 48,
4445
4445
  "column": 73
4446
4446
  }
4447
4447
  },
@@ -4453,11 +4453,11 @@
4453
4453
  "highlighting": "string",
4454
4454
  "loc": {
4455
4455
  "start": {
4456
- "line": 44,
4456
+ "line": 49,
4457
4457
  "column": 14
4458
4458
  },
4459
4459
  "end": {
4460
- "line": 47,
4460
+ "line": 52,
4461
4461
  "column": 5
4462
4462
  }
4463
4463
  },
@@ -4469,11 +4469,11 @@
4469
4469
  "highlighting": "string",
4470
4470
  "loc": {
4471
4471
  "start": {
4472
- "line": 48,
4472
+ "line": 53,
4473
4473
  "column": 10
4474
4474
  },
4475
4475
  "end": {
4476
- "line": 48,
4476
+ "line": 53,
4477
4477
  "column": 70
4478
4478
  }
4479
4479
  },
@@ -4485,11 +4485,11 @@
4485
4485
  "highlighting": "string",
4486
4486
  "loc": {
4487
4487
  "start": {
4488
- "line": 49,
4488
+ "line": 54,
4489
4489
  "column": 10
4490
4490
  },
4491
4491
  "end": {
4492
- "line": 49,
4492
+ "line": 54,
4493
4493
  "column": 70
4494
4494
  }
4495
4495
  },
@@ -4501,11 +4501,11 @@
4501
4501
  "highlighting": "string",
4502
4502
  "loc": {
4503
4503
  "start": {
4504
- "line": 66,
4504
+ "line": 74,
4505
4505
  "column": 4
4506
4506
  },
4507
4507
  "end": {
4508
- "line": 70,
4508
+ "line": 78,
4509
4509
  "column": 5
4510
4510
  }
4511
4511
  },
@@ -4517,11 +4517,11 @@
4517
4517
  "highlighting": "string",
4518
4518
  "loc": {
4519
4519
  "start": {
4520
- "line": 72,
4520
+ "line": 80,
4521
4521
  "column": 8
4522
4522
  },
4523
4523
  "end": {
4524
- "line": 76,
4524
+ "line": 84,
4525
4525
  "column": 9
4526
4526
  }
4527
4527
  },
@@ -4533,11 +4533,11 @@
4533
4533
  "highlighting": "string",
4534
4534
  "loc": {
4535
4535
  "start": {
4536
- "line": 146,
4536
+ "line": 160,
4537
4537
  "column": 10
4538
4538
  },
4539
4539
  "end": {
4540
- "line": 153,
4540
+ "line": 167,
4541
4541
  "column": 12
4542
4542
  }
4543
4543
  },
@@ -4549,11 +4549,11 @@
4549
4549
  "highlighting": "string",
4550
4550
  "loc": {
4551
4551
  "start": {
4552
- "line": 198,
4552
+ "line": 212,
4553
4553
  "column": 12
4554
4554
  },
4555
4555
  "end": {
4556
- "line": 203,
4556
+ "line": 217,
4557
4557
  "column": 13
4558
4558
  }
4559
4559
  },
@@ -4565,11 +4565,11 @@
4565
4565
  "highlighting": "string",
4566
4566
  "loc": {
4567
4567
  "start": {
4568
- "line": 238,
4568
+ "line": 253,
4569
4569
  "column": 12
4570
4570
  },
4571
4571
  "end": {
4572
- "line": 246,
4572
+ "line": 261,
4573
4573
  "column": 13
4574
4574
  }
4575
4575
  },
@@ -4581,11 +4581,11 @@
4581
4581
  "highlighting": "string",
4582
4582
  "loc": {
4583
4583
  "start": {
4584
- "line": 288,
4584
+ "line": 308,
4585
4585
  "column": 20
4586
4586
  },
4587
4587
  "end": {
4588
- "line": 288,
4588
+ "line": 308,
4589
4589
  "column": 60
4590
4590
  }
4591
4591
  },
@@ -4597,11 +4597,11 @@
4597
4597
  "highlighting": "string",
4598
4598
  "loc": {
4599
4599
  "start": {
4600
- "line": 289,
4600
+ "line": 309,
4601
4601
  "column": 20
4602
4602
  },
4603
4603
  "end": {
4604
- "line": 289,
4604
+ "line": 309,
4605
4605
  "column": 60
4606
4606
  }
4607
4607
  },
@@ -4613,11 +4613,11 @@
4613
4613
  "highlighting": "string",
4614
4614
  "loc": {
4615
4615
  "start": {
4616
- "line": 290,
4616
+ "line": 310,
4617
4617
  "column": 18
4618
4618
  },
4619
4619
  "end": {
4620
- "line": 290,
4620
+ "line": 310,
4621
4621
  "column": 54
4622
4622
  }
4623
4623
  },
@@ -4629,11 +4629,11 @@
4629
4629
  "highlighting": "string",
4630
4630
  "loc": {
4631
4631
  "start": {
4632
- "line": 291,
4632
+ "line": 311,
4633
4633
  "column": 26
4634
4634
  },
4635
4635
  "end": {
4636
- "line": 291,
4636
+ "line": 311,
4637
4637
  "column": 78
4638
4638
  }
4639
4639
  },
@@ -4645,11 +4645,11 @@
4645
4645
  "highlighting": "string",
4646
4646
  "loc": {
4647
4647
  "start": {
4648
- "line": 292,
4648
+ "line": 312,
4649
4649
  "column": 23
4650
4650
  },
4651
4651
  "end": {
4652
- "line": 292,
4652
+ "line": 312,
4653
4653
  "column": 75
4654
4654
  }
4655
4655
  },
@@ -5301,11 +5301,11 @@
5301
5301
  "highlighting": "string",
5302
5302
  "loc": {
5303
5303
  "start": {
5304
- "line": 194,
5304
+ "line": 201,
5305
5305
  "column": 39
5306
5306
  },
5307
5307
  "end": {
5308
- "line": 197,
5308
+ "line": 204,
5309
5309
  "column": 3
5310
5310
  }
5311
5311
  },
@@ -5317,11 +5317,11 @@
5317
5317
  "highlighting": "string",
5318
5318
  "loc": {
5319
5319
  "start": {
5320
- "line": 194,
5320
+ "line": 201,
5321
5321
  "column": 39
5322
5322
  },
5323
5323
  "end": {
5324
- "line": 197,
5324
+ "line": 204,
5325
5325
  "column": 3
5326
5326
  }
5327
5327
  },
@@ -5333,11 +5333,11 @@
5333
5333
  "highlighting": "string",
5334
5334
  "loc": {
5335
5335
  "start": {
5336
- "line": 220,
5336
+ "line": 227,
5337
5337
  "column": 67
5338
5338
  },
5339
5339
  "end": {
5340
- "line": 228,
5340
+ "line": 235,
5341
5341
  "column": 3
5342
5342
  }
5343
5343
  },
@@ -5349,11 +5349,11 @@
5349
5349
  "highlighting": "string",
5350
5350
  "loc": {
5351
5351
  "start": {
5352
- "line": 220,
5352
+ "line": 227,
5353
5353
  "column": 67
5354
5354
  },
5355
5355
  "end": {
5356
- "line": 228,
5356
+ "line": 235,
5357
5357
  "column": 3
5358
5358
  }
5359
5359
  },
@@ -5365,11 +5365,11 @@
5365
5365
  "highlighting": "string",
5366
5366
  "loc": {
5367
5367
  "start": {
5368
- "line": 220,
5368
+ "line": 227,
5369
5369
  "column": 67
5370
5370
  },
5371
5371
  "end": {
5372
- "line": 228,
5372
+ "line": 235,
5373
5373
  "column": 3
5374
5374
  }
5375
5375
  },
@@ -5381,11 +5381,11 @@
5381
5381
  "highlighting": "string",
5382
5382
  "loc": {
5383
5383
  "start": {
5384
- "line": 220,
5384
+ "line": 227,
5385
5385
  "column": 67
5386
5386
  },
5387
5387
  "end": {
5388
- "line": 228,
5388
+ "line": 235,
5389
5389
  "column": 3
5390
5390
  }
5391
5391
  },
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
8
  exports.ICON_SIDES = exports.EuiBadge = exports.COLORS = void 0;
7
9
 
8
- var _react = _interopRequireDefault(require("react"));
10
+ var _react = _interopRequireWildcard(require("react"));
9
11
 
10
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
13
 
@@ -13,8 +15,6 @@ var _classnames = _interopRequireDefault(require("classnames"));
13
15
 
14
16
  var _chromaJs = _interopRequireDefault(require("chroma-js"));
15
17
 
16
- var _common = require("../common");
17
-
18
18
  var _services = require("../../services");
19
19
 
20
20
  var _inner_text = require("../inner_text");
@@ -25,12 +25,18 @@ var _utils = require("../color_picker/utils");
25
25
 
26
26
  var _href_validator = require("../../services/security/href_validator");
27
27
 
28
+ var _badge = require("./badge.styles");
29
+
28
30
  var _react2 = require("@emotion/react");
29
31
 
30
32
  var _excluded = ["children", "color", "iconType", "iconSide", "className", "isDisabled", "onClick", "iconOnClick", "onClickAriaLabel", "iconOnClickAriaLabel", "closeButtonProps", "href", "rel", "target", "style"];
31
33
 
32
34
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
33
35
 
36
+ 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); }
37
+
38
+ 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; }
39
+
34
40
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
35
41
 
36
42
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -55,30 +61,14 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
55
61
 
56
62
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
57
63
 
58
- // TODO - replace with variables once https://github.com/elastic/eui/issues/2731 is closed
59
- var colorInk = '#000';
60
- var colorGhost = '#fff'; // The color blind palette has some stricter accessibility needs with regards to
64
+ var ICON_SIDES = ['left', 'right'];
65
+ exports.ICON_SIDES = ICON_SIDES;
66
+ var COLORS = ['default', 'hollow', 'primary', 'success', 'accent', 'warning', 'danger'];
67
+ exports.COLORS = COLORS;
68
+ // The color blind palette has some stricter accessibility needs with regards to
61
69
  // charts and contrast. We use the euiPaletteColorBlindBehindText variant here since our
62
70
  // accessibility concerns pertain to foreground (text) and background contrast
63
-
64
71
  var visColors = (0, _services.euiPaletteColorBlindBehindText)();
65
- var colorToHexMap = {
66
- // TODO - replace with variable once https://github.com/elastic/eui/issues/2731 is closed
67
- default: '#d3dae6',
68
- primary: visColors[1],
69
- success: visColors[0],
70
- accent: visColors[2],
71
- warning: visColors[5],
72
- danger: visColors[9]
73
- };
74
- var COLORS = (0, _common.keysOf)(colorToHexMap);
75
- exports.COLORS = COLORS;
76
- var iconSideToClassNameMap = {
77
- left: 'euiBadge--iconLeft',
78
- right: 'euiBadge--iconRight'
79
- };
80
- var ICON_SIDES = (0, _common.keysOf)(iconSideToClassNameMap);
81
- exports.ICON_SIDES = ICON_SIDES;
82
72
 
83
73
  var EuiBadge = function EuiBadge(_ref) {
84
74
  var children = _ref.children,
@@ -100,53 +90,63 @@ var EuiBadge = function EuiBadge(_ref) {
100
90
  style = _ref.style,
101
91
  rest = _objectWithoutProperties(_ref, _excluded);
102
92
 
93
+ var euiTheme = (0, _services.useEuiTheme)();
103
94
  var isHrefValid = !href || (0, _href_validator.validateHref)(href);
104
95
  var isDisabled = _isDisabled || !isHrefValid;
105
- var optionalCustomStyles = style;
106
- var textColor = null; // TODO - replace with variable once https://github.com/elastic/eui/issues/2731 is closed
107
-
108
- var wcagContrastBase = 4.5; // WCAG AA contrast level
109
-
110
- var wcagContrast = null;
111
- var colorHex = null; // Check if a valid color name was provided
112
-
113
- try {
114
- if (COLORS.indexOf(color) > -1) {
115
- // Get the hex equivalent for the provided color name
116
- colorHex = colorToHexMap[color]; // Set dark or light text color based upon best contrast
117
-
118
- textColor = setTextColor(colorHex);
119
- optionalCustomStyles = _objectSpread({
120
- backgroundColor: colorHex,
121
- color: textColor
122
- }, optionalCustomStyles);
123
- } else if (color !== 'hollow') {
124
- // This is a custom color that is neither from the base palette nor hollow
125
- // Let's do our best to ensure that it provides sufficient contrast
126
- // Set dark or light text color based upon best contrast
127
- textColor = setTextColor(color); // Check the contrast
128
-
129
- wcagContrast = getColorContrast(textColor, color);
130
-
131
- if (wcagContrast < wcagContrastBase) {
132
- // It's low contrast, so lets show a warning in the console
133
- console.warn('Warning: ', color, ' badge has low contrast of ', wcagContrast.toFixed(2), '. Should be above ', wcagContrastBase, '.');
96
+ var optionalCustomStyles = (0, _react.useMemo)(function () {
97
+ var colorToHexMap = {
98
+ default: euiTheme.euiTheme.colors.lightShade,
99
+ hollow: '',
100
+ primary: visColors[1],
101
+ success: visColors[0],
102
+ accent: visColors[2],
103
+ warning: visColors[5],
104
+ danger: visColors[9]
105
+ };
106
+ var textColor = null;
107
+ var contrastRatio = null;
108
+ var colorHex = null;
109
+
110
+ try {
111
+ // Check if a valid color name was provided
112
+ if (COLORS.includes(color)) {
113
+ if (color === 'hollow') return style; // hollow uses its own CSS class
114
+ // Get the hex equivalent for the provided color name
115
+
116
+ colorHex = colorToHexMap[color]; // Set dark or light text color based upon best contrast
117
+
118
+ textColor = setTextColor(euiTheme, colorHex);
119
+ return _objectSpread({
120
+ backgroundColor: colorHex,
121
+ color: textColor
122
+ }, style);
123
+ } else {
124
+ // This is a custom color- let's do our best to ensure that it provides sufficient contrast
125
+ // Set dark or light text color based upon best contrast
126
+ textColor = setTextColor(euiTheme, color); // Check the contrast
127
+
128
+ contrastRatio = getColorContrast(textColor, color);
129
+
130
+ if (contrastRatio < _services.wcagContrastMin) {
131
+ // It's low contrast, so lets show a warning in the console
132
+ console.warn('Warning: ', color, ' badge has low contrast of ', contrastRatio.toFixed(2), '. Should be above ', _services.wcagContrastMin, '.');
133
+ }
134
+
135
+ return _objectSpread({
136
+ backgroundColor: color,
137
+ color: textColor
138
+ }, style);
134
139
  }
135
-
136
- optionalCustomStyles = _objectSpread({
137
- backgroundColor: color,
138
- color: textColor
139
- }, optionalCustomStyles);
140
+ } catch (err) {
141
+ handleInvalidColor(color);
140
142
  }
141
- } catch (err) {
142
- handleInvalidColor(color);
143
- }
144
-
145
- var classes = (0, _classnames.default)('euiBadge', {
146
- 'euiBadge-isClickable': (onClick || href) && !iconOnClick,
147
- 'euiBadge-isDisabled': isDisabled,
148
- 'euiBadge--hollow': color === 'hollow'
149
- }, iconSideToClassNameMap[iconSide], className);
143
+ }, [color, style, euiTheme]);
144
+ var styles = (0, _badge.euiBadgeStyles)(euiTheme);
145
+ var cssStyles = [styles.euiBadge, (onClick || href) && !iconOnClick && styles.clickable, isDisabled && styles.disabled, color === 'hollow' && styles.hollow];
146
+ var textCssStyles = [styles.text.euiBadge__text, (onClick || href) && !isDisabled && styles.text.clickable];
147
+ var iconCssStyles = [styles.icon.euiBadge__icon, styles.icon[iconSide]];
148
+ var iconButtonCssStyles = [styles.iconButton.euiBadge__iconButton, styles.iconButton[iconSide]];
149
+ var classes = (0, _classnames.default)('euiBadge', className);
150
150
  var closeClassNames = (0, _classnames.default)('euiBadge__icon', closeButtonProps && closeButtonProps.className);
151
151
  var Element = href && !isDisabled ? 'a' : 'button';
152
152
  var relObj = {};
@@ -176,6 +176,7 @@ var EuiBadge = function EuiBadge(_ref) {
176
176
  optionalIcon = (0, _react2.jsx)("button", {
177
177
  type: "button",
178
178
  className: "euiBadge__iconButton",
179
+ css: iconButtonCssStyles,
179
180
  "aria-label": iconOnClickAriaLabel,
180
181
  disabled: isDisabled,
181
182
  title: iconOnClickAriaLabel,
@@ -184,7 +185,8 @@ var EuiBadge = function EuiBadge(_ref) {
184
185
  type: iconType,
185
186
  size: "s",
186
187
  color: "inherit" // forces the icon to inherit its parent color
187
-
188
+ ,
189
+ css: iconCssStyles
188
190
  }, closeButtonProps, {
189
191
  className: closeClassNames
190
192
  })));
@@ -193,6 +195,7 @@ var EuiBadge = function EuiBadge(_ref) {
193
195
  type: iconType,
194
196
  size: children ? 's' : 'm',
195
197
  className: "euiBadge__icon",
198
+ css: iconCssStyles,
196
199
  color: "inherit" // forces the icon to inherit its parent color
197
200
 
198
201
  });
@@ -204,28 +207,34 @@ var EuiBadge = function EuiBadge(_ref) {
204
207
  }
205
208
 
206
209
  var content = (0, _react2.jsx)("span", {
207
- className: "euiBadge__content"
208
- }, children && (0, _react2.jsx)("span", {
209
- className: "euiBadge__text"
210
- }, children), optionalIcon);
210
+ className: "euiBadge__content",
211
+ css: styles.euiBadge__content
212
+ }, iconSide === 'left' && optionalIcon, children && (0, _react2.jsx)("span", {
213
+ className: "euiBadge__text",
214
+ css: textCssStyles
215
+ }, children), iconSide === 'right' && optionalIcon);
211
216
 
212
217
  if (iconOnClick) {
213
218
  return onClick || href ? (0, _react2.jsx)("span", {
214
219
  className: classes,
220
+ css: cssStyles,
215
221
  style: optionalCustomStyles
216
222
  }, (0, _react2.jsx)("span", {
217
- className: "euiBadge__content"
218
- }, (0, _react2.jsx)(_inner_text.EuiInnerText, null, function (ref, innerText) {
223
+ className: "euiBadge__content",
224
+ css: styles.euiBadge__content
225
+ }, iconSide === 'left' && optionalIcon, (0, _react2.jsx)(_inner_text.EuiInnerText, null, function (ref, innerText) {
219
226
  return (0, _react2.jsx)(Element, _extends({
220
227
  className: "euiBadge__childButton",
228
+ css: styles.euiBadge__childButton,
221
229
  disabled: isDisabled,
222
230
  "aria-label": onClickAriaLabel,
223
231
  ref: ref,
224
232
  title: innerText
225
233
  }, relObj, rest), children);
226
- }), optionalIcon)) : (0, _react2.jsx)(_inner_text.EuiInnerText, null, function (ref, innerText) {
234
+ }), iconSide === 'right' && optionalIcon)) : (0, _react2.jsx)(_inner_text.EuiInnerText, null, function (ref, innerText) {
227
235
  return (0, _react2.jsx)("span", _extends({
228
236
  className: classes,
237
+ css: cssStyles,
229
238
  style: optionalCustomStyles,
230
239
  ref: ref,
231
240
  title: innerText
@@ -237,6 +246,7 @@ var EuiBadge = function EuiBadge(_ref) {
237
246
  disabled: isDisabled,
238
247
  "aria-label": onClickAriaLabel,
239
248
  className: classes,
249
+ css: cssStyles,
240
250
  style: optionalCustomStyles,
241
251
  ref: ref,
242
252
  title: innerText
@@ -246,6 +256,7 @@ var EuiBadge = function EuiBadge(_ref) {
246
256
  return (0, _react2.jsx)(_inner_text.EuiInnerText, null, function (ref, innerText) {
247
257
  return (0, _react2.jsx)("span", _extends({
248
258
  className: classes,
259
+ css: cssStyles,
249
260
  style: optionalCustomStyles,
250
261
  ref: ref,
251
262
  title: innerText
@@ -264,12 +275,12 @@ EuiBadge.propTypes = {
264
275
  /**
265
276
  * The side of the badge the icon should sit
266
277
  */
267
- iconSide: _propTypes.default.oneOf(["left", "right"]),
278
+ iconSide: _propTypes.default.any,
268
279
 
269
280
  /**
270
281
  * Accepts either our palette colors (primary, success ..etc) or a hex value `#FFFFFF`, `#000`.
271
282
  */
272
- 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]),
273
284
 
274
285
  /**
275
286
  * Will override any color passed through the `color` prop.
@@ -315,13 +326,14 @@ function getColorContrast(textColor, color) {
315
326
  return contrastValue;
316
327
  }
317
328
 
318
- function setTextColor(bgColor) {
319
- var textColor = _services.isColorDark.apply(void 0, _toConsumableArray((0, _chromaJs.default)(bgColor).rgb())) ? colorGhost : colorInk;
329
+ function setTextColor(_ref2, bgColor) {
330
+ var euiTheme = _ref2.euiTheme;
331
+ var textColor = _services.isColorDark.apply(void 0, _toConsumableArray((0, _chromaJs.default)(bgColor).rgb())) ? euiTheme.colors.ghost : euiTheme.colors.ink;
320
332
  return textColor;
321
333
  }
322
334
 
323
335
  function handleInvalidColor(color) {
324
- var isNamedColor = color && COLORS.includes(color) || color === 'hollow';
336
+ var isNamedColor = COLORS.includes(color);
325
337
  var isValidColorString = color && (0, _utils.chromaValid)((0, _utils.parseColor)(color) || '');
326
338
 
327
339
  if (!isNamedColor && !isValidColorString) {