@elastic/eui 62.0.2 → 62.2.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 (313) hide show
  1. package/dist/eui_charts_theme.js +330 -330
  2. package/dist/eui_charts_theme.js.map +1 -1
  3. package/dist/eui_theme_dark.css +1 -783
  4. package/dist/eui_theme_dark.json +0 -57
  5. package/dist/eui_theme_dark.json.d.ts +0 -57
  6. package/dist/eui_theme_dark.min.css +1 -1
  7. package/dist/eui_theme_light.css +1 -783
  8. package/dist/eui_theme_light.json +0 -57
  9. package/dist/eui_theme_light.json.d.ts +0 -57
  10. package/dist/eui_theme_light.min.css +1 -1
  11. package/es/components/breadcrumbs/breadcrumb.js +199 -0
  12. package/es/components/breadcrumbs/breadcrumb.styles.js +61 -0
  13. package/es/components/breadcrumbs/breadcrumbs.js +115 -187
  14. package/es/components/breadcrumbs/breadcrumbs.styles.js +30 -0
  15. package/es/components/code/code_block.js +119 -107
  16. package/es/components/collapsible_nav/collapsible_nav.js +2 -2
  17. package/es/components/control_bar/control_bar.js +13 -0
  18. package/es/components/datagrid/body/data_grid_body.js +12 -2
  19. package/es/components/datagrid/body/data_grid_cell.js +31 -3
  20. package/es/components/datagrid/body/header/data_grid_header_row.js +1 -1
  21. package/es/components/datagrid/controls/column_sorting_draggable.js +1 -1
  22. package/es/components/datagrid/data_grid.js +10 -2
  23. package/es/components/datagrid/utils/row_heights.js +33 -4
  24. package/es/components/date_picker/super_date_picker/super_date_picker.js +2 -2
  25. package/es/components/date_picker/super_date_picker/super_update_button.js +1 -1
  26. package/es/components/description_list/description_list.js +22 -26
  27. package/es/components/description_list/description_list.styles.js +25 -0
  28. package/es/components/description_list/description_list_context.js +14 -0
  29. package/es/components/description_list/description_list_description.js +43 -2
  30. package/es/components/description_list/description_list_description.styles.js +47 -0
  31. package/es/components/description_list/description_list_title.js +43 -2
  32. package/es/components/description_list/description_list_title.styles.js +37 -0
  33. package/es/components/description_list/description_list_types.js +10 -0
  34. package/es/components/header/header.js +1 -27
  35. package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +22 -2
  36. package/es/components/header/header_breadcrumbs/header_breadcrumbs.styles.js +15 -0
  37. package/es/components/header/header_links/header_links.js +9 -9
  38. package/es/components/icon/assets/tokenStruct.js +1 -1
  39. package/es/components/page/page_header/page_header.js +1 -0
  40. package/es/components/page/page_header/page_header_content.js +2 -1
  41. package/es/components/page/page_template.js +1 -0
  42. package/es/components/pagination/pagination.js +1 -1
  43. package/es/components/panel/split_panel/split_panel.js +2 -2
  44. package/es/components/popover/wrapping_popover.js +88 -45
  45. package/es/components/portal/portal.js +84 -38
  46. package/es/components/provider/provider.js +2 -2
  47. package/es/components/responsive/hide_for.js +6 -38
  48. package/es/components/responsive/show_for.js +6 -38
  49. package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +17 -36
  50. package/es/components/side_nav/side_nav.js +1 -1
  51. package/es/components/table/table_row_cell.js +1 -2
  52. package/es/components/toast/global_toast_list.js +208 -241
  53. package/es/components/toast/global_toast_list.styles.js +38 -0
  54. package/es/components/toast/global_toast_list_item.js +12 -7
  55. package/es/components/toast/toast.js +25 -25
  56. package/es/components/toast/toast.styles.js +55 -0
  57. package/es/components/token/index.js +2 -1
  58. package/es/components/token/token.js +48 -112
  59. package/es/components/token/token.styles.js +93 -0
  60. package/es/components/token/token_map.js +6 -9
  61. package/es/components/token/token_types.js +11 -0
  62. package/es/global_styling/reset/global_styles.js +1 -1
  63. package/es/services/{breakpoint.js → breakpoint/breakpoint.js} +4 -9
  64. package/es/services/{hooks/useIsWithinBreakpoints.js → breakpoint/currentEuiBreakpoint.js} +36 -28
  65. package/es/services/breakpoint/index.js +10 -0
  66. package/es/services/breakpoint/useIsWithinBreakpoints.js +24 -0
  67. package/es/services/hooks/index.js +0 -1
  68. package/es/services/index.js +1 -1
  69. package/es/test/rtl/component_helpers.js +60 -1
  70. package/eui.d.ts +1787 -1550
  71. package/i18ntokens.json +36 -36
  72. package/lib/components/breadcrumbs/breadcrumb.js +225 -0
  73. package/lib/components/breadcrumbs/breadcrumb.styles.js +68 -0
  74. package/lib/components/breadcrumbs/breadcrumbs.js +125 -188
  75. package/lib/components/breadcrumbs/breadcrumbs.styles.js +33 -0
  76. package/lib/components/code/code_block.js +118 -106
  77. package/lib/components/collapsible_nav/collapsible_nav.js +2 -2
  78. package/lib/components/control_bar/control_bar.js +13 -0
  79. package/lib/components/datagrid/body/data_grid_body.js +12 -2
  80. package/lib/components/datagrid/body/data_grid_cell.js +31 -3
  81. package/lib/components/datagrid/body/header/data_grid_header_row.js +1 -1
  82. package/lib/components/datagrid/controls/column_sorting_draggable.js +1 -1
  83. package/lib/components/datagrid/data_grid.js +10 -2
  84. package/lib/components/datagrid/utils/row_heights.js +33 -4
  85. package/lib/components/date_picker/super_date_picker/super_date_picker.js +2 -2
  86. package/lib/components/date_picker/super_date_picker/super_update_button.js +1 -1
  87. package/lib/components/description_list/description_list.js +25 -31
  88. package/lib/components/description_list/description_list.styles.js +36 -0
  89. package/lib/components/description_list/description_list_context.js +24 -0
  90. package/lib/components/description_list/description_list_description.js +52 -2
  91. package/lib/components/description_list/description_list_description.styles.js +51 -0
  92. package/lib/components/description_list/description_list_title.js +52 -2
  93. package/lib/components/description_list/description_list_title.styles.js +50 -0
  94. package/lib/components/description_list/description_list_types.js +20 -0
  95. package/lib/components/header/header.js +1 -27
  96. package/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +24 -2
  97. package/lib/components/header/header_breadcrumbs/header_breadcrumbs.styles.js +26 -0
  98. package/lib/components/header/header_links/header_links.js +8 -8
  99. package/lib/components/icon/assets/tokenStruct.js +1 -1
  100. package/lib/components/icon/svgs/tokens/tokenStruct.svg +1 -1
  101. package/lib/components/page/page_header/page_header.js +1 -0
  102. package/lib/components/page/page_header/page_header_content.js +3 -2
  103. package/lib/components/page/page_template.js +1 -0
  104. package/lib/components/pagination/pagination.js +1 -1
  105. package/lib/components/panel/split_panel/split_panel.js +3 -3
  106. package/lib/components/popover/wrapping_popover.js +85 -44
  107. package/lib/components/portal/portal.js +87 -39
  108. package/lib/components/provider/provider.js +1 -1
  109. package/lib/components/responsive/hide_for.js +12 -44
  110. package/lib/components/responsive/show_for.js +12 -44
  111. package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +15 -35
  112. package/lib/components/side_nav/side_nav.js +1 -1
  113. package/lib/components/table/table_row_cell.js +1 -3
  114. package/lib/components/toast/global_toast_list.js +209 -238
  115. package/lib/components/toast/global_toast_list.styles.js +45 -0
  116. package/lib/components/toast/global_toast_list_item.js +14 -7
  117. package/lib/components/toast/toast.js +27 -25
  118. package/lib/components/toast/toast.styles.js +66 -0
  119. package/lib/components/token/index.js +5 -3
  120. package/lib/components/token/token.js +50 -120
  121. package/lib/components/token/token.styles.js +101 -0
  122. package/lib/components/token/token_map.js +6 -9
  123. package/lib/components/token/token_types.js +22 -0
  124. package/lib/global_styling/reset/global_styles.js +1 -1
  125. package/{test-env/services → lib/services/breakpoint}/breakpoint.js +5 -9
  126. package/lib/services/breakpoint/currentEuiBreakpoint.js +80 -0
  127. package/lib/services/breakpoint/index.js +44 -0
  128. package/lib/services/breakpoint/useIsWithinBreakpoints.js +34 -0
  129. package/lib/services/hooks/index.js +0 -13
  130. package/lib/services/index.js +28 -0
  131. package/lib/test/rtl/component_helpers.js +69 -3
  132. package/optimize/es/components/breadcrumbs/breadcrumb.js +136 -0
  133. package/optimize/es/components/breadcrumbs/breadcrumb.styles.js +61 -0
  134. package/optimize/es/components/breadcrumbs/breadcrumbs.js +92 -165
  135. package/optimize/es/components/breadcrumbs/breadcrumbs.styles.js +30 -0
  136. package/optimize/es/components/code/code_block.js +106 -107
  137. package/optimize/es/components/datagrid/body/data_grid_body.js +2 -0
  138. package/optimize/es/components/datagrid/body/data_grid_cell.js +13 -1
  139. package/optimize/es/components/datagrid/utils/row_heights.js +33 -4
  140. package/optimize/es/components/description_list/description_list.js +20 -24
  141. package/optimize/es/components/description_list/description_list.styles.js +25 -0
  142. package/optimize/es/components/description_list/description_list_context.js +14 -0
  143. package/optimize/es/components/description_list/description_list_description.js +32 -2
  144. package/optimize/es/components/description_list/description_list_description.styles.js +47 -0
  145. package/optimize/es/components/description_list/description_list_title.js +32 -2
  146. package/optimize/es/components/description_list/description_list_title.styles.js +37 -0
  147. package/optimize/es/components/description_list/description_list_types.js +10 -0
  148. package/optimize/es/components/header/header_breadcrumbs/header_breadcrumbs.js +8 -1
  149. package/optimize/es/components/header/header_breadcrumbs/header_breadcrumbs.styles.js +15 -0
  150. package/optimize/es/components/header/header_links/header_links.js +8 -8
  151. package/optimize/es/components/icon/assets/tokenStruct.js +1 -1
  152. package/optimize/es/components/page/page_header/page_header_content.js +1 -1
  153. package/optimize/es/components/panel/split_panel/split_panel.js +1 -1
  154. package/optimize/es/components/popover/wrapping_popover.js +79 -38
  155. package/optimize/es/components/portal/portal.js +66 -34
  156. package/optimize/es/components/provider/provider.js +2 -2
  157. package/optimize/es/components/responsive/hide_for.js +5 -27
  158. package/optimize/es/components/responsive/show_for.js +5 -27
  159. package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide.js +16 -35
  160. package/optimize/es/components/table/table_row_cell.js +1 -2
  161. package/optimize/es/components/toast/global_toast_list.js +199 -230
  162. package/optimize/es/components/toast/global_toast_list.styles.js +38 -0
  163. package/optimize/es/components/toast/global_toast_list_item.js +11 -6
  164. package/optimize/es/components/toast/toast.js +24 -24
  165. package/optimize/es/components/toast/toast.styles.js +55 -0
  166. package/optimize/es/components/token/index.js +2 -1
  167. package/optimize/es/components/token/token.js +46 -69
  168. package/optimize/es/components/token/token.styles.js +83 -0
  169. package/optimize/es/components/token/token_map.js +6 -9
  170. package/optimize/es/components/token/token_types.js +11 -0
  171. package/optimize/es/global_styling/reset/global_styles.js +1 -1
  172. package/optimize/es/services/{breakpoint.js → breakpoint/breakpoint.js} +4 -9
  173. package/optimize/es/services/breakpoint/currentEuiBreakpoint.js +53 -0
  174. package/optimize/es/services/breakpoint/index.js +10 -0
  175. package/optimize/es/services/breakpoint/useIsWithinBreakpoints.js +24 -0
  176. package/optimize/es/services/hooks/index.js +0 -1
  177. package/optimize/es/services/index.js +1 -1
  178. package/optimize/es/test/rtl/component_helpers.js +60 -1
  179. package/optimize/lib/components/breadcrumbs/breadcrumb.js +162 -0
  180. package/optimize/lib/components/breadcrumbs/breadcrumb.styles.js +68 -0
  181. package/optimize/lib/components/breadcrumbs/breadcrumbs.js +99 -164
  182. package/optimize/lib/components/breadcrumbs/breadcrumbs.styles.js +33 -0
  183. package/optimize/lib/components/code/code_block.js +105 -106
  184. package/optimize/lib/components/datagrid/body/data_grid_body.js +2 -0
  185. package/optimize/lib/components/datagrid/body/data_grid_cell.js +13 -1
  186. package/optimize/lib/components/datagrid/utils/row_heights.js +33 -4
  187. package/optimize/lib/components/description_list/description_list.js +23 -28
  188. package/optimize/lib/components/description_list/description_list.styles.js +36 -0
  189. package/optimize/lib/components/description_list/description_list_context.js +24 -0
  190. package/optimize/lib/components/description_list/description_list_description.js +43 -2
  191. package/optimize/lib/components/description_list/description_list_description.styles.js +51 -0
  192. package/optimize/lib/components/description_list/description_list_title.js +43 -2
  193. package/optimize/lib/components/description_list/description_list_title.styles.js +50 -0
  194. package/optimize/lib/components/description_list/description_list_types.js +20 -0
  195. package/optimize/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +10 -1
  196. package/optimize/lib/components/header/header_breadcrumbs/header_breadcrumbs.styles.js +26 -0
  197. package/optimize/lib/components/header/header_links/header_links.js +7 -7
  198. package/optimize/lib/components/icon/assets/tokenStruct.js +1 -1
  199. package/optimize/lib/components/icon/svgs/tokens/tokenStruct.svg +1 -1
  200. package/optimize/lib/components/page/page_header/page_header_content.js +2 -2
  201. package/optimize/lib/components/panel/split_panel/split_panel.js +2 -2
  202. package/optimize/lib/components/popover/wrapping_popover.js +78 -38
  203. package/optimize/lib/components/portal/portal.js +65 -44
  204. package/optimize/lib/components/provider/provider.js +1 -1
  205. package/optimize/lib/components/responsive/hide_for.js +4 -33
  206. package/optimize/lib/components/responsive/show_for.js +4 -33
  207. package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +14 -34
  208. package/optimize/lib/components/table/table_row_cell.js +1 -3
  209. package/optimize/lib/components/toast/global_toast_list.js +206 -220
  210. package/optimize/lib/components/toast/global_toast_list.styles.js +47 -0
  211. package/optimize/lib/components/toast/global_toast_list_item.js +14 -7
  212. package/optimize/lib/components/toast/toast.js +26 -24
  213. package/optimize/lib/components/toast/toast.styles.js +66 -0
  214. package/optimize/lib/components/token/index.js +5 -3
  215. package/optimize/lib/components/token/token.js +50 -76
  216. package/optimize/lib/components/token/token.styles.js +91 -0
  217. package/optimize/lib/components/token/token_map.js +6 -9
  218. package/optimize/lib/components/token/token_types.js +22 -0
  219. package/optimize/lib/global_styling/reset/global_styles.js +1 -1
  220. package/optimize/lib/services/{breakpoint.js → breakpoint/breakpoint.js} +5 -9
  221. package/optimize/lib/services/breakpoint/currentEuiBreakpoint.js +81 -0
  222. package/optimize/lib/services/breakpoint/index.js +44 -0
  223. package/optimize/lib/services/breakpoint/useIsWithinBreakpoints.js +34 -0
  224. package/optimize/lib/services/hooks/index.js +0 -13
  225. package/optimize/lib/services/index.js +28 -0
  226. package/optimize/lib/test/rtl/component_helpers.js +69 -3
  227. package/package.json +2 -2
  228. package/src/components/control_bar/_control_bar.scss +1 -1
  229. package/src/components/header/_index.scss +0 -1
  230. package/src/components/index.scss +0 -5
  231. package/src/themes/amsterdam/overrides/_breadcrumbs.scss +0 -12
  232. package/src/themes/amsterdam/overrides/_index.scss +0 -4
  233. package/test-env/components/breadcrumbs/breadcrumb.js +211 -0
  234. package/test-env/components/breadcrumbs/breadcrumb.styles.js +68 -0
  235. package/test-env/components/breadcrumbs/breadcrumbs.js +122 -174
  236. package/test-env/components/breadcrumbs/breadcrumbs.styles.js +33 -0
  237. package/test-env/components/collapsible_nav/collapsible_nav.js +2 -2
  238. package/test-env/components/control_bar/control_bar.js +13 -0
  239. package/test-env/components/datagrid/body/data_grid_body.js +12 -2
  240. package/test-env/components/datagrid/body/data_grid_cell.js +31 -3
  241. package/test-env/components/datagrid/body/header/data_grid_header_row.js +1 -1
  242. package/test-env/components/datagrid/controls/column_sorting_draggable.js +1 -1
  243. package/test-env/components/datagrid/data_grid.js +10 -2
  244. package/test-env/components/datagrid/utils/row_heights.js +33 -4
  245. package/test-env/components/date_picker/super_date_picker/super_date_picker.js +2 -2
  246. package/test-env/components/date_picker/super_date_picker/super_update_button.js +1 -1
  247. package/test-env/components/description_list/description_list.js +25 -30
  248. package/test-env/components/description_list/description_list.styles.js +36 -0
  249. package/test-env/components/description_list/description_list_context.js +24 -0
  250. package/test-env/components/description_list/description_list_description.js +43 -2
  251. package/test-env/components/description_list/description_list_description.styles.js +51 -0
  252. package/test-env/components/description_list/description_list_title.js +43 -2
  253. package/test-env/components/description_list/description_list_title.styles.js +50 -0
  254. package/test-env/components/description_list/description_list_types.js +20 -0
  255. package/test-env/components/header/header.js +1 -27
  256. package/test-env/components/header/header_breadcrumbs/header_breadcrumbs.js +24 -2
  257. package/test-env/components/header/header_breadcrumbs/header_breadcrumbs.styles.js +26 -0
  258. package/test-env/components/header/header_links/header_links.js +8 -8
  259. package/test-env/components/icon/assets/tokenStruct.js +1 -1
  260. package/test-env/components/observer/resize_observer/resize_observer.js +43 -126
  261. package/test-env/components/page/page_header/page_header.js +1 -0
  262. package/test-env/components/page/page_header/page_header_content.js +3 -2
  263. package/test-env/components/page/page_template.js +1 -0
  264. package/test-env/components/pagination/pagination.js +1 -1
  265. package/test-env/components/panel/split_panel/split_panel.js +3 -3
  266. package/test-env/components/popover/wrapping_popover.js +78 -38
  267. package/test-env/components/portal/portal.js +79 -45
  268. package/test-env/components/provider/provider.js +1 -1
  269. package/test-env/components/responsive/hide_for.js +5 -34
  270. package/test-env/components/responsive/show_for.js +5 -34
  271. package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +15 -35
  272. package/test-env/components/side_nav/side_nav.js +1 -1
  273. package/test-env/components/table/table_row_cell.js +1 -3
  274. package/test-env/components/toast/global_toast_list.js +206 -220
  275. package/test-env/components/toast/global_toast_list.styles.js +47 -0
  276. package/test-env/components/toast/global_toast_list_item.js +14 -7
  277. package/test-env/components/toast/toast.js +27 -25
  278. package/test-env/components/toast/toast.styles.js +66 -0
  279. package/test-env/components/token/index.js +5 -3
  280. package/test-env/components/token/token.js +51 -120
  281. package/test-env/components/token/token.styles.js +91 -0
  282. package/test-env/components/token/token_map.js +6 -9
  283. package/test-env/components/token/token_types.js +22 -0
  284. package/test-env/global_styling/reset/global_styles.js +1 -1
  285. package/{lib/services → test-env/services/breakpoint}/breakpoint.js +5 -9
  286. package/test-env/services/breakpoint/currentEuiBreakpoint.js +37 -0
  287. package/test-env/services/breakpoint/index.js +44 -0
  288. package/test-env/services/breakpoint/useIsWithinBreakpoints.js +34 -0
  289. package/test-env/services/hooks/index.js +0 -13
  290. package/test-env/services/index.js +28 -0
  291. package/test-env/test/rtl/component_helpers.js +69 -3
  292. package/lib/services/hooks/useIsWithinBreakpoints.js +0 -57
  293. package/optimize/es/services/hooks/useIsWithinBreakpoints.js +0 -46
  294. package/optimize/lib/services/hooks/useIsWithinBreakpoints.js +0 -57
  295. package/src/components/breadcrumbs/_breadcrumbs.scss +0 -79
  296. package/src/components/breadcrumbs/_index.scss +0 -2
  297. package/src/components/breadcrumbs/_variables.scss +0 -2
  298. package/src/components/description_list/_description_list.scss +0 -211
  299. package/src/components/description_list/_index.scss +0 -1
  300. package/src/components/header/header_breadcrumbs/_header_breadcrumbs.scss +0 -8
  301. package/src/components/header/header_breadcrumbs/_index.scss +0 -1
  302. package/src/components/portal/_index.scss +0 -1
  303. package/src/components/portal/_portal.scss +0 -6
  304. package/src/components/toast/_global_toast_list.scss +0 -90
  305. package/src/components/toast/_index.scss +0 -4
  306. package/src/components/toast/_toast.scss +0 -103
  307. package/src/components/token/_index.scss +0 -2
  308. package/src/components/token/_token.scss +0 -85
  309. package/src/components/token/_variables.scss +0 -13
  310. package/src/themes/amsterdam/overrides/_header_breadcrumbs.scss +0 -71
  311. package/src/themes/amsterdam/overrides/_toast.scss +0 -21
  312. package/src/themes/amsterdam/overrides/_token.scss +0 -4
  313. package/test-env/services/hooks/useIsWithinBreakpoints.js +0 -57
@@ -17,26 +17,24 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
17
17
 
18
18
  var _classnames = _interopRequireDefault(require("classnames"));
19
19
 
20
- var _common = require("../common");
20
+ var _services = require("../../services");
21
21
 
22
22
  var _accessibility = require("../accessibility");
23
23
 
24
+ var _button = require("../button");
25
+
24
26
  var _i18n = require("../i18n");
25
27
 
26
28
  var _icon = require("../icon");
27
29
 
28
30
  var _text = require("../text");
29
31
 
32
+ var _toast = require("./toast.styles");
33
+
30
34
  var _react2 = require("@emotion/react");
31
35
 
32
36
  var _excluded = ["title", "color", "iconType", "onClose", "children", "className"];
33
- var colorToClassNameMap = {
34
- primary: 'euiToast--primary',
35
- success: 'euiToast--success',
36
- warning: 'euiToast--warning',
37
- danger: 'euiToast--danger'
38
- };
39
- var COLORS = (0, _common.keysOf)(colorToClassNameMap);
37
+ var COLORS = ['primary', 'success', 'warning', 'danger'];
40
38
  exports.COLORS = COLORS;
41
39
 
42
40
  var EuiToast = function EuiToast(_ref) {
@@ -47,15 +45,18 @@ var EuiToast = function EuiToast(_ref) {
47
45
  children = _ref.children,
48
46
  className = _ref.className,
49
47
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
50
- var classes = (0, _classnames.default)('euiToast', color ? colorToClassNameMap[color] : null, className);
51
- var headerClasses = (0, _classnames.default)('euiToastHeader', {
52
- 'euiToastHeader--withBody': children
53
- });
48
+ var euiTheme = (0, _services.useEuiTheme)();
49
+ var baseStyles = (0, _toast.euiToastStyles)(euiTheme);
50
+ var baseCss = [baseStyles.euiToast, color && baseStyles[color]];
51
+ var bodyStyles = (0, _toast.euiToastBodyStyles)();
52
+ var headerStyles = (0, _toast.euiToastHeaderStyles)(euiTheme);
53
+ var headerCss = [headerStyles.euiToastHeader, children && headerStyles.withBody];
54
+ var classes = (0, _classnames.default)('euiToast', className);
54
55
  var headerIcon;
55
56
 
56
57
  if (iconType) {
57
58
  headerIcon = (0, _react2.jsx)(_icon.EuiIcon, {
58
- className: "euiToastHeader__icon",
59
+ css: headerStyles.euiToastHeader__icon,
59
60
  type: iconType,
60
61
  size: "m",
61
62
  "aria-hidden": "true"
@@ -69,17 +70,15 @@ var EuiToast = function EuiToast(_ref) {
69
70
  token: "euiToast.dismissToast",
70
71
  default: "Dismiss toast"
71
72
  }, function (dismissToast) {
72
- return (0, _react2.jsx)("button", {
73
- type: "button",
74
- className: "euiToast__closeButton",
73
+ return (0, _react2.jsx)(_button.EuiButtonIcon, {
74
+ css: baseStyles.euiToast__closeButton,
75
+ iconType: "cross",
76
+ color: "text",
77
+ size: "xs",
75
78
  "aria-label": dismissToast,
76
79
  onClick: onClose,
77
80
  "data-test-subj": "toastCloseButton"
78
- }, (0, _react2.jsx)(_icon.EuiIcon, {
79
- type: "cross",
80
- size: "m",
81
- "aria-hidden": "true"
82
- }));
81
+ });
83
82
  });
84
83
  }
85
84
 
@@ -87,12 +86,14 @@ var EuiToast = function EuiToast(_ref) {
87
86
 
88
87
  if (children) {
89
88
  optionalBody = (0, _react2.jsx)(_text.EuiText, {
89
+ css: bodyStyles.euiToastBody,
90
90
  size: "s",
91
- className: "euiToastBody"
91
+ "data-test-subj": "euiToastBody"
92
92
  }, children);
93
93
  }
94
94
 
95
95
  return (0, _react2.jsx)("div", (0, _extends2.default)({
96
+ css: baseCss,
96
97
  className: classes
97
98
  }, rest), (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("p", null, (0, _react2.jsx)(_i18n.EuiI18n, {
98
99
  token: "euiToast.newNotification",
@@ -102,11 +103,12 @@ var EuiToast = function EuiToast(_ref) {
102
103
  default: "Notification"
103
104
  }, function (notification) {
104
105
  return (0, _react2.jsx)("div", {
105
- className: headerClasses,
106
+ css: headerCss,
106
107
  "aria-label": notification,
107
108
  "data-test-subj": "euiToastHeader"
108
109
  }, headerIcon, (0, _react2.jsx)("span", {
109
- className: "euiToastHeader__title"
110
+ css: headerStyles.euiToastHeader__title,
111
+ "data-test-subj": "euiToastHeader__title"
110
112
  }, title));
111
113
  }), closeButton, optionalBody);
112
114
  };
@@ -114,7 +116,7 @@ var EuiToast = function EuiToast(_ref) {
114
116
  exports.EuiToast = EuiToast;
115
117
  EuiToast.propTypes = {
116
118
  title: _propTypes.default.node,
117
- color: _propTypes.default.oneOf(["primary", "success", "warning", "danger"]),
119
+ color: _propTypes.default.any,
118
120
  iconType: _propTypes.default.oneOfType([_propTypes.default.oneOf(["accessibility", "addDataApp", "advancedSettingsApp", "agentApp", "aggregate", "alert", "analyzeEvent", "annotation", "apmApp", "apmTrace", "appSearchApp", "apps", "arrowDown", "arrowLeft", "arrowRight", "arrowUp", "arrowStart", "arrowEnd", "asterisk", "auditbeatApp", "beaker", "bell", "bellSlash", "bolt", "boxesHorizontal", "boxesVertical", "branch", "branchUser", "broom", "brush", "bug", "bullseye", "calendar", "canvasApp", "casesApp", "check", "checkInCircleFilled", "cheer", "classificationJob", "clock", "cloudDrizzle", "cloudStormy", "cloudSunny", "cluster", "codeApp", "color", "compute", "console", "consoleApp", "container", "continuityAbove", "continuityAboveBelow", "continuityBelow", "continuityWithin", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "createAdvancedJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crossInACircleFilled", "crosshairs", "currency", "cut", "dashboardApp", "dataVisualizer", "database", "desktop", "devToolsApp", "discoverApp", "document", "documentEdit", "documentation", "documents", "dot", "doubleArrowLeft", "doubleArrowRight", "download", "editorAlignCenter", "editorAlignLeft", "editorAlignRight", "editorBold", "editorChecklist", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "editorItalic", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignLeft", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "editorStrike", "editorTable", "editorUnderline", "editorUndo", "editorUnorderedList", "email", "empty", "emsApp", "eql", "eraser", "exit", "expand", "expandMini", "exportAction", "eye", "eyeClosed", "faceHappy", "faceNeutral", "faceSad", "filebeatApp", "filter", "flag", "fleetApp", "fold", "folderCheck", "folderClosed", "folderExclamation", "folderOpen", "frameNext", "framePrevious", "fullScreen", "fullScreenExit", "function", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "home", "iInCircle", "image", "importAction", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexRuntime", "indexSettings", "inputOutput", "inspect", "invert", "ip", "keyboard", "kqlField", "kqlFunction", "kqlOperand", "kqlSelector", "kqlValue", "kubernetesNode", "kubernetesPod", "layers", "lensApp", "lettering", "lineDashed", "lineDotted", "lineSolid", "link", "list", "listAdd", "lock", "lockOpen", "logoAWS", "logoAWSMono", "logoAerospike", "logoApache", "logoAppSearch", "logoAzure", "logoAzureMono", "logoBeats", "logoBusinessAnalytics", "logoCeph", "logoCloud", "logoCloudEnterprise", "logoCode", "logoCodesandbox", "logoCouchbase", "logoDocker", "logoDropwizard", "logoElastic", "logoElasticStack", "logoElasticsearch", "logoEnterpriseSearch", "logoEtcd", "logoGCP", "logoGCPMono", "logoGithub", "logoGmail", "logoGolang", "logoGoogleG", "logoHAproxy", "logoIBM", "logoIBMMono", "logoKafka", "logoKibana", "logoKubernetes", "logoLogging", "logoLogstash", "logoMaps", "logoMemcached", "logoMetrics", "logoMongodb", "logoMySQL", "logoNginx", "logoObservability", "logoOsquery", "logoPhp", "logoPostgres", "logoPrometheus", "logoRabbitmq", "logoRedis", "logoSecurity", "logoSiteSearch", "logoSketch", "logoSlack", "logoUptime", "logoWebhook", "logoWindows", "logoWorkplaceSearch", "logsApp", "logstashFilter", "logstashIf", "logstashInput", "logstashOutput", "logstashQueue", "machineLearningApp", "magnet", "magnifyWithExclamation", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "mapMarker", "memory", "menu", "menuDown", "menuLeft", "menuRight", "menuUp", "merge", "metricbeatApp", "metricsApp", "minimize", "minus", "minusInCircle", "minusInCircleFilled", "mobile", "monitoringApp", "moon", "namespace", "nested", "node", "notebookApp", "number", "offline", "online", "outlierDetectionJob", "package", "packetbeatApp", "pageSelect", "pagesSelect", "paperClip", "partial", "pause", "payment", "pencil", "percent", "pin", "pinFilled", "pipelineApp", "play", "playFilled", "plus", "plusInCircle", "plusInCircleFilled", "popout", "push", "questionInCircle", "quote", "recentlyViewedApp", "refresh", "regressionJob", "reporter", "reportingApp", "returnKey", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "securityAnalyticsApp", "securityApp", "securitySignal", "securitySignalDetected", "securitySignalResolved", "sessionViewer", "shard", "share", "snowflake", "sortDown", "sortLeft", "sortRight", "sortUp", "sortable", "spacesApp", "sqlApp", "starEmpty", "starEmptySpace", "starFilled", "starFilledSpace", "starMinusEmpty", "starMinusFilled", "starPlusEmpty", "starPlusFilled", "stats", "stop", "stopFilled", "stopSlash", "storage", "string", "submodule", "sun", "swatchInput", "symlink", "tableDensityCompact", "tableDensityExpanded", "tableDensityNormal", "tableOfContents", "tag", "tear", "temperature", "timeline", "timelionApp", "timeRefresh", "timeslider", "training", "trash", "unfold", "unlink", "upgradeAssistantApp", "uptimeApp", "user", "userAvatar", "users", "usersRolesApp", "vector", "videoPlayer", "visArea", "visAreaStacked", "visBarHorizontal", "visBarHorizontalStacked", "visBarVertical", "visBarVerticalStacked", "visGauge", "visGoal", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visVega", "visVisualBuilder", "visualizeApp", "watchesApp", "wordWrap", "wordWrapDisabled", "workplaceSearchApp", "wrench", "tokenAlias", "tokenAnnotation", "tokenArray", "tokenBinary", "tokenBoolean", "tokenClass", "tokenCompletionSuggester", "tokenConstant", "tokenDate", "tokenDenseVector", "tokenElement", "tokenEnum", "tokenEnumMember", "tokenEvent", "tokenException", "tokenField", "tokenFile", "tokenFlattened", "tokenFunction", "tokenGeo", "tokenHistogram", "tokenInterface", "tokenIP", "tokenJoin", "tokenKey", "tokenKeyword", "tokenMethod", "tokenMetricCounter", "tokenMetricGauge", "tokenModule", "tokenNamespace", "tokenNested", "tokenNull", "tokenNumber", "tokenObject", "tokenOperator", "tokenPackage", "tokenParameter", "tokenPercolator", "tokenProperty", "tokenRange", "tokenRankFeature", "tokenRankFeatures", "tokenRepo", "tokenSearchType", "tokenShape", "tokenString", "tokenStruct", "tokenSymbol", "tokenTag", "tokenText", "tokenTokenCount", "tokenVariable"]).isRequired, _propTypes.default.string.isRequired, _propTypes.default.elementType.isRequired]),
119
121
  onClose: _propTypes.default.func,
120
122
  className: _propTypes.default.string,
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.euiToastStyles = exports.euiToastHeaderStyles = exports.euiToastBodyStyles = void 0;
7
+
8
+ var _react = require("@emotion/react");
9
+
10
+ var _global_styling = require("../../global_styling");
11
+
12
+ var _amsterdam = require("../../themes/amsterdam");
13
+
14
+ var _title = require("../title/title.styles");
15
+
16
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
17
+
18
+ var euiToastStyles = function euiToastStyles(euiThemeContext) {
19
+ var euiTheme = euiThemeContext.euiTheme;
20
+ return {
21
+ // Base
22
+ euiToast: /*#__PURE__*/(0, _react.css)("border-radius:", euiTheme.border.radius.medium, ";", (0, _amsterdam.euiShadowLarge)(euiThemeContext), ";position:relative;", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.base), ";", (0, _global_styling.logicalCSS)('padding-vertical', euiTheme.size.base), ";background-color:", euiTheme.colors.emptyShade, ";", (0, _global_styling.logicalCSS)('width', '100%'), ";&:hover,&:focus{[class*='euiToast__closeButton']{opacity:1;}};label:euiToast;"),
23
+ // Elements
24
+ euiToast__closeButton: /*#__PURE__*/(0, _react.css)("position:absolute;", (0, _global_styling.logicalCSS)('top', euiTheme.size.base), ";", (0, _global_styling.logicalCSS)('right', euiTheme.size.base), ";;label:euiToast__closeButton;"),
25
+ // Variants
26
+ primary: /*#__PURE__*/(0, _react.css)("border-top:2px solid ", euiTheme.colors.primary, ";;label:primary;"),
27
+ success: /*#__PURE__*/(0, _react.css)("border-top:2px solid ", euiTheme.colors.success, ";;label:success;"),
28
+ warning: /*#__PURE__*/(0, _react.css)("border-top:2px solid ", euiTheme.colors.warning, ";;label:warning;"),
29
+ danger: /*#__PURE__*/(0, _react.css)("border-top:2px solid ", euiTheme.colors.danger, ";;label:danger;")
30
+ };
31
+ };
32
+
33
+ exports.euiToastStyles = euiToastStyles;
34
+
35
+ var euiToastHeaderStyles = function euiToastHeaderStyles(euiThemeContext) {
36
+ var euiTheme = euiThemeContext.euiTheme;
37
+ return {
38
+ // Base
39
+ euiToastHeader: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('padding-right', euiTheme.size.l), ";display:flex;align-items:baseline;>*+*{", (0, _global_styling.logicalCSS)('margin-left', euiTheme.size.s), ";};label:euiToastHeader;"),
40
+ // Elements
41
+ euiToastHeader__icon: /*#__PURE__*/(0, _react.css)("flex:0 0 auto;fill:", euiTheme.colors.title, ";transform:translateY(2px);;label:euiToastHeader__icon;"),
42
+ euiToastHeader__title: /*#__PURE__*/(0, _react.css)((0, _title.euiTitle)(euiThemeContext, 'xs'), ";font-weight:", euiTheme.font.weight.bold, ";;label:euiToastHeader__title;"),
43
+ // Variants
44
+ withBody: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-bottom', euiTheme.size.s), ";;label:withBody;")
45
+ };
46
+ };
47
+
48
+ exports.euiToastHeaderStyles = euiToastHeaderStyles;
49
+
50
+ var _ref = process.env.NODE_ENV === "production" ? {
51
+ name: "1xv63y1-euiToastBody",
52
+ styles: "word-wrap:break-word;label:euiToastBody;"
53
+ } : {
54
+ name: "1xv63y1-euiToastBody",
55
+ styles: "word-wrap:break-word;label:euiToastBody;",
56
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
57
+ };
58
+
59
+ var euiToastBodyStyles = function euiToastBodyStyles() {
60
+ return {
61
+ // Base
62
+ euiToastBody: _ref
63
+ };
64
+ };
65
+
66
+ exports.euiToastBodyStyles = euiToastBodyStyles;
@@ -12,20 +12,22 @@ Object.defineProperty(exports, "EuiToken", {
12
12
  Object.defineProperty(exports, "TOKEN_COLORS", {
13
13
  enumerable: true,
14
14
  get: function get() {
15
- return _token.COLORS;
15
+ return _token_types.COLORS;
16
16
  }
17
17
  });
18
18
  Object.defineProperty(exports, "TOKEN_SHAPES", {
19
19
  enumerable: true,
20
20
  get: function get() {
21
- return _token.SHAPES;
21
+ return _token_types.SHAPES;
22
22
  }
23
23
  });
24
24
  Object.defineProperty(exports, "TOKEN_SIZES", {
25
25
  enumerable: true,
26
26
  get: function get() {
27
- return _token.SIZES;
27
+ return _token_types.SIZES;
28
28
  }
29
29
  });
30
30
 
31
+ var _token_types = require("./token_types");
32
+
31
33
  var _token = require("./token");
@@ -5,70 +5,41 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.SIZES = exports.SHAPES = exports.FILLS = exports.EuiToken = exports.COLORS = void 0;
8
+ exports.EuiToken = void 0;
9
9
 
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
 
12
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
+
12
14
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
13
15
 
14
16
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
15
17
 
16
18
  var _react = _interopRequireDefault(require("react"));
17
19
 
18
- var _propTypes = _interopRequireDefault(require("prop-types"));
19
-
20
- var _defaults = _interopRequireDefault(require("lodash/defaults"));
21
-
22
20
  var _classnames = _interopRequireDefault(require("classnames"));
23
21
 
24
- var _common = require("../common");
25
-
26
22
  var _services = require("../../services");
27
23
 
28
24
  var _icon = require("../icon");
29
25
 
30
26
  var _token_map = require("./token_map");
31
27
 
28
+ var _token_types = require("./token_types");
29
+
30
+ var _token = require("./token.styles");
31
+
32
32
  var _react2 = require("@emotion/react");
33
33
 
34
34
  var _excluded = ["iconType", "color", "fill", "shape", "size", "style", "className", "title", "aria-label", "aria-labelledby", "aria-describedby"];
35
- var sizeToClassMap = {
36
- xs: 'euiToken--xsmall',
37
- s: 'euiToken--small',
38
- m: 'euiToken--medium',
39
- l: 'euiToken--large'
40
- };
41
- var SIZES = (0, _common.keysOf)(sizeToClassMap);
42
- exports.SIZES = SIZES;
43
- var shapeToClassMap = {
44
- circle: 'euiToken--circle',
45
- square: 'euiToken--square',
46
- rectangle: 'euiToken--rectangle'
47
- };
48
- var SHAPES = (0, _common.keysOf)(shapeToClassMap);
49
- exports.SHAPES = SHAPES;
50
- var fillToClassMap = {
51
- none: null,
52
- light: 'euiToken--light',
53
- dark: 'euiToken--dark'
54
- };
55
- var FILLS = (0, _common.keysOf)(fillToClassMap);
56
- exports.FILLS = FILLS;
57
- var colorToClassMap = {
58
- euiColorVis0: 'euiToken--euiColorVis0',
59
- euiColorVis1: 'euiToken--euiColorVis1',
60
- euiColorVis2: 'euiToken--euiColorVis2',
61
- euiColorVis3: 'euiToken--euiColorVis3',
62
- euiColorVis4: 'euiToken--euiColorVis4',
63
- euiColorVis5: 'euiToken--euiColorVis5',
64
- euiColorVis6: 'euiToken--euiColorVis6',
65
- euiColorVis7: 'euiToken--euiColorVis7',
66
- euiColorVis8: 'euiToken--euiColorVis8',
67
- euiColorVis9: 'euiToken--euiColorVis9',
68
- gray: 'euiToken--gray'
35
+
36
+ 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; }
37
+
38
+ 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; }
39
+
40
+ var isTokenColor = function isTokenColor(color) {
41
+ return _token_types.COLORS.includes(color);
69
42
  };
70
- var COLORS = (0, _common.keysOf)(colorToClassMap);
71
- exports.COLORS = COLORS;
72
43
 
73
44
  var EuiToken = function EuiToken(_ref) {
74
45
  var iconType = _ref.iconType,
@@ -92,48 +63,49 @@ var EuiToken = function EuiToken(_ref) {
92
63
 
93
64
  if (typeof iconType === 'string' && iconType.indexOf('token') === 0 && size === 's') {
94
65
  finalSize = 'm';
95
- }
96
-
97
- var currentDisplay = {
98
- color: color,
99
- fill: fill,
100
- shape: shape
101
- };
102
- var finalDisplay; // If the iconType passed is one of the prefab token types,
66
+ } // If the iconType passed is one of the prefab token types,
103
67
  // grab its properties
104
68
 
105
- if (typeof iconType === 'string' && iconType in _token_map.TOKEN_MAP) {
106
- var tokenDisplay = _token_map.TOKEN_MAP[iconType];
107
- finalDisplay = (0, _defaults.default)(currentDisplay, tokenDisplay);
108
- } else {
109
- finalDisplay = currentDisplay;
110
- }
111
69
 
112
- var finalColor = finalDisplay.color || 'gray';
113
- var finalShape = finalDisplay.shape || 'circle';
114
- var finalFill = finalDisplay.fill || 'light'; // Color can be a named space via euiColorVis
115
-
116
- var colorClass;
117
-
118
- if (finalColor in colorToClassMap) {
119
- colorClass = colorToClassMap[finalColor];
120
- } // Or it can be a string which adds inline styles for the
121
- else {
122
- // text color if fill='none' or
123
- if (finalFill === 'none') {
124
- style.color = finalColor;
125
- } // full background color if fill='dark' and overrides fill='light' with dark
126
- else {
127
- finalFill = 'dark';
128
- style.backgroundColor = finalColor;
129
- style.color = _services.isColorDark.apply(void 0, (0, _toConsumableArray2.default)((0, _services.hexToRgb)(finalColor))) ? '#FFFFFF' : '#000000';
130
- }
70
+ var tokenDefaults = typeof iconType === 'string' && iconType in _token_map.TOKEN_MAP ? _token_map.TOKEN_MAP[iconType] : {};
71
+ var finalColor = color || tokenDefaults.color || 'gray';
72
+ var finalShape = shape || tokenDefaults.shape || 'circle';
73
+ var finalFill = fill || 'light';
74
+ var euiTheme = (0, _services.useEuiTheme)();
75
+ var styles = (0, _token.euiTokenStyles)(euiTheme, finalFill);
76
+ var cssStyles = [styles.euiToken, styles[finalShape], styles[finalFill], styles[size]];
77
+ var finalStyle = style;
78
+
79
+ if (isTokenColor(finalColor)) {
80
+ cssStyles = [].concat((0, _toConsumableArray2.default)(cssStyles), [styles[finalColor]]);
81
+ } else if (finalFill === 'none') {
82
+ // When a custom HEX color is passed and the token doesn't have any fill (no background),
83
+ // the icon gets that passed color
84
+ cssStyles = [].concat((0, _toConsumableArray2.default)(cssStyles), [styles.customColor]);
85
+ finalStyle = _objectSpread({
86
+ color: finalColor
87
+ }, style);
88
+ } else {
89
+ // When a custom HEX color is passed and the token has a fill (light or dark),
90
+ // the background gets the custom color and the icon gets white or black based on the passed color
91
+ // The fill='light' (lightened background) will always be overridden by fill='dark' (opaque background)
92
+ // to better handle custom colors
93
+ var isFinalColorDark = _services.isColorDark.apply(void 0, (0, _toConsumableArray2.default)((0, _services.hexToRgb)(finalColor)));
94
+
95
+ var lightOrDarkColor = isFinalColorDark ? '#FFFFFF' : '#000000';
96
+ cssStyles = [].concat((0, _toConsumableArray2.default)(cssStyles), [styles.customColor]);
97
+ finalFill = 'dark';
98
+ finalStyle = _objectSpread({
99
+ color: lightOrDarkColor,
100
+ backgroundColor: finalColor
101
+ }, style);
131
102
  }
132
103
 
133
- var classes = (0, _classnames.default)('euiToken', colorClass, shapeToClassMap[finalShape], fillToClassMap[finalFill], sizeToClassMap[size], className);
104
+ var classes = (0, _classnames.default)('euiToken', className);
134
105
  return (0, _react2.jsx)("span", (0, _extends2.default)({
135
106
  className: classes,
136
- style: style
107
+ css: cssStyles,
108
+ style: finalStyle
137
109
  }, rest), (0, _react2.jsx)(_icon.EuiIcon, {
138
110
  type: iconType,
139
111
  size: finalSize,
@@ -144,45 +116,4 @@ var EuiToken = function EuiToken(_ref) {
144
116
  }));
145
117
  };
146
118
 
147
- exports.EuiToken = EuiToken;
148
- EuiToken.propTypes = {
149
- className: _propTypes.default.string,
150
- "aria-label": _propTypes.default.string,
151
- "data-test-subj": _propTypes.default.string,
152
-
153
- /**
154
- * An EUI icon type
155
- */
156
- iconType: _propTypes.default.oneOfType([_propTypes.default.oneOf(["accessibility", "addDataApp", "advancedSettingsApp", "agentApp", "aggregate", "alert", "analyzeEvent", "annotation", "apmApp", "apmTrace", "appSearchApp", "apps", "arrowDown", "arrowLeft", "arrowRight", "arrowUp", "arrowStart", "arrowEnd", "asterisk", "auditbeatApp", "beaker", "bell", "bellSlash", "bolt", "boxesHorizontal", "boxesVertical", "branch", "branchUser", "broom", "brush", "bug", "bullseye", "calendar", "canvasApp", "casesApp", "check", "checkInCircleFilled", "cheer", "classificationJob", "clock", "cloudDrizzle", "cloudStormy", "cloudSunny", "cluster", "codeApp", "color", "compute", "console", "consoleApp", "container", "continuityAbove", "continuityAboveBelow", "continuityBelow", "continuityWithin", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "createAdvancedJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crossInACircleFilled", "crosshairs", "currency", "cut", "dashboardApp", "dataVisualizer", "database", "desktop", "devToolsApp", "discoverApp", "document", "documentEdit", "documentation", "documents", "dot", "doubleArrowLeft", "doubleArrowRight", "download", "editorAlignCenter", "editorAlignLeft", "editorAlignRight", "editorBold", "editorChecklist", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "editorItalic", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignLeft", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "editorStrike", "editorTable", "editorUnderline", "editorUndo", "editorUnorderedList", "email", "empty", "emsApp", "eql", "eraser", "exit", "expand", "expandMini", "exportAction", "eye", "eyeClosed", "faceHappy", "faceNeutral", "faceSad", "filebeatApp", "filter", "flag", "fleetApp", "fold", "folderCheck", "folderClosed", "folderExclamation", "folderOpen", "frameNext", "framePrevious", "fullScreen", "fullScreenExit", "function", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "home", "iInCircle", "image", "importAction", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexRuntime", "indexSettings", "inputOutput", "inspect", "invert", "ip", "keyboard", "kqlField", "kqlFunction", "kqlOperand", "kqlSelector", "kqlValue", "kubernetesNode", "kubernetesPod", "layers", "lensApp", "lettering", "lineDashed", "lineDotted", "lineSolid", "link", "list", "listAdd", "lock", "lockOpen", "logoAWS", "logoAWSMono", "logoAerospike", "logoApache", "logoAppSearch", "logoAzure", "logoAzureMono", "logoBeats", "logoBusinessAnalytics", "logoCeph", "logoCloud", "logoCloudEnterprise", "logoCode", "logoCodesandbox", "logoCouchbase", "logoDocker", "logoDropwizard", "logoElastic", "logoElasticStack", "logoElasticsearch", "logoEnterpriseSearch", "logoEtcd", "logoGCP", "logoGCPMono", "logoGithub", "logoGmail", "logoGolang", "logoGoogleG", "logoHAproxy", "logoIBM", "logoIBMMono", "logoKafka", "logoKibana", "logoKubernetes", "logoLogging", "logoLogstash", "logoMaps", "logoMemcached", "logoMetrics", "logoMongodb", "logoMySQL", "logoNginx", "logoObservability", "logoOsquery", "logoPhp", "logoPostgres", "logoPrometheus", "logoRabbitmq", "logoRedis", "logoSecurity", "logoSiteSearch", "logoSketch", "logoSlack", "logoUptime", "logoWebhook", "logoWindows", "logoWorkplaceSearch", "logsApp", "logstashFilter", "logstashIf", "logstashInput", "logstashOutput", "logstashQueue", "machineLearningApp", "magnet", "magnifyWithExclamation", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "mapMarker", "memory", "menu", "menuDown", "menuLeft", "menuRight", "menuUp", "merge", "metricbeatApp", "metricsApp", "minimize", "minus", "minusInCircle", "minusInCircleFilled", "mobile", "monitoringApp", "moon", "namespace", "nested", "node", "notebookApp", "number", "offline", "online", "outlierDetectionJob", "package", "packetbeatApp", "pageSelect", "pagesSelect", "paperClip", "partial", "pause", "payment", "pencil", "percent", "pin", "pinFilled", "pipelineApp", "play", "playFilled", "plus", "plusInCircle", "plusInCircleFilled", "popout", "push", "questionInCircle", "quote", "recentlyViewedApp", "refresh", "regressionJob", "reporter", "reportingApp", "returnKey", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "securityAnalyticsApp", "securityApp", "securitySignal", "securitySignalDetected", "securitySignalResolved", "sessionViewer", "shard", "share", "snowflake", "sortDown", "sortLeft", "sortRight", "sortUp", "sortable", "spacesApp", "sqlApp", "starEmpty", "starEmptySpace", "starFilled", "starFilledSpace", "starMinusEmpty", "starMinusFilled", "starPlusEmpty", "starPlusFilled", "stats", "stop", "stopFilled", "stopSlash", "storage", "string", "submodule", "sun", "swatchInput", "symlink", "tableDensityCompact", "tableDensityExpanded", "tableDensityNormal", "tableOfContents", "tag", "tear", "temperature", "timeline", "timelionApp", "timeRefresh", "timeslider", "training", "trash", "unfold", "unlink", "upgradeAssistantApp", "uptimeApp", "user", "userAvatar", "users", "usersRolesApp", "vector", "videoPlayer", "visArea", "visAreaStacked", "visBarHorizontal", "visBarHorizontalStacked", "visBarVertical", "visBarVerticalStacked", "visGauge", "visGoal", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visVega", "visVisualBuilder", "visualizeApp", "watchesApp", "wordWrap", "wordWrapDisabled", "workplaceSearchApp", "wrench", "tokenAlias", "tokenAnnotation", "tokenArray", "tokenBinary", "tokenBoolean", "tokenClass", "tokenCompletionSuggester", "tokenConstant", "tokenDate", "tokenDenseVector", "tokenElement", "tokenEnum", "tokenEnumMember", "tokenEvent", "tokenException", "tokenField", "tokenFile", "tokenFlattened", "tokenFunction", "tokenGeo", "tokenHistogram", "tokenInterface", "tokenIP", "tokenJoin", "tokenKey", "tokenKeyword", "tokenMethod", "tokenMetricCounter", "tokenMetricGauge", "tokenModule", "tokenNamespace", "tokenNested", "tokenNull", "tokenNumber", "tokenObject", "tokenOperator", "tokenPackage", "tokenParameter", "tokenPercolator", "tokenProperty", "tokenRange", "tokenRankFeature", "tokenRankFeatures", "tokenRepo", "tokenSearchType", "tokenShape", "tokenString", "tokenStruct", "tokenSymbol", "tokenTag", "tokenText", "tokenTokenCount", "tokenVariable"]).isRequired, _propTypes.default.string.isRequired, _propTypes.default.elementType.isRequired]).isRequired,
157
-
158
- /**
159
- * For best results use one of the vis color names (or 'gray').
160
- * Or supply your own color (can be used with dark or no fill only).
161
- * Default: `gray`
162
- */
163
- color: _propTypes.default.oneOfType([_propTypes.default.oneOf(["euiColorVis0", "euiColorVis1", "euiColorVis2", "euiColorVis3", "euiColorVis4", "euiColorVis5", "euiColorVis6", "euiColorVis7", "euiColorVis8", "euiColorVis9", "gray"]).isRequired, _propTypes.default.string.isRequired]),
164
-
165
- /**
166
- * Outer shape surrounding the icon
167
- * Default: `circle`
168
- */
169
- shape: _propTypes.default.oneOf(["circle", "square", "rectangle"]),
170
-
171
- /**
172
- * `light` for lightened color with border, `dark` for solid, or `none`
173
- * Default: `light`
174
- */
175
- fill: _propTypes.default.oneOf(["dark", "light", "none"]),
176
-
177
- /**
178
- * Size of the token
179
- */
180
- size: _propTypes.default.oneOf(["xs", "s", "m", "l"]),
181
-
182
- /**
183
- * The icon's title. Required for accessibility
184
- */
185
- title: _propTypes.default.string,
186
- "aria-labelledby": _propTypes.default.string,
187
- "aria-describedby": _propTypes.default.string
188
- };
119
+ exports.EuiToken = EuiToken;
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.euiTokenStyles = void 0;
9
+
10
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
+
12
+ var _react = require("@emotion/react");
13
+
14
+ var _chromaJs = _interopRequireDefault(require("chroma-js"));
15
+
16
+ var _global_styling = require("../../global_styling");
17
+
18
+ var _services = require("../../services");
19
+
20
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
21
+
22
+ var visColors = (0, _services.euiPaletteColorBlind)();
23
+ var visColorsBehindText = (0, _services.euiPaletteColorBlindBehindText)();
24
+
25
+ var getTokenColor = function getTokenColor(euiTheme, colorMode, fill, color) {
26
+ var isVizColor = typeof color === 'number';
27
+ var iconColor = isVizColor ? visColors[color] : euiTheme.colors.darkShade;
28
+ var isDarkMode = colorMode === 'DARK';
29
+ var backgroundDarkColor = isVizColor ? visColorsBehindText[color] : euiTheme.colors.darkShade;
30
+ var backgroundLightColor = isDarkMode ? (0, _services.shade)(iconColor, 0.7) : (0, _services.tint)(iconColor, 0.9);
31
+ var lightColor = (0, _services.makeHighContrastColor)(iconColor)(backgroundLightColor);
32
+ var boxShadowColor = isDarkMode ? (0, _services.shade)(iconColor, 0.6) : (0, _services.tint)(iconColor, 0.7);
33
+ var darkColor = _services.isColorDark.apply(void 0, (0, _toConsumableArray2.default)((0, _chromaJs.default)(backgroundDarkColor).rgb())) ? euiTheme.colors.ghost : euiTheme.colors.ink;
34
+
35
+ switch (fill) {
36
+ case 'none':
37
+ return "\n // Without a background, the fill color should be the graphic color\n color: ".concat(iconColor, ";\n ");
38
+
39
+ case 'light':
40
+ return "\n color: ".concat(lightColor, ";\n background-color: ").concat(backgroundLightColor, ";\n box-shadow: inset 0 0 0 1px ").concat(boxShadowColor, ";\n ");
41
+
42
+ case 'dark':
43
+ return "\n color: ".concat(darkColor, ";\n background-color: ").concat(backgroundDarkColor, ";\n ");
44
+ }
45
+ };
46
+
47
+ var _ref = process.env.NODE_ENV === "production" ? {
48
+ name: "1ab5xb2-circle",
49
+ styles: "border-radius:50%;label:circle;"
50
+ } : {
51
+ name: "1ab5xb2-circle",
52
+ styles: "border-radius:50%;label:circle;",
53
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
54
+ };
55
+
56
+ var euiTokenStyles = function euiTokenStyles(_ref2, fill) {
57
+ var euiTheme = _ref2.euiTheme,
58
+ colorMode = _ref2.colorMode;
59
+ return {
60
+ // Base
61
+ euiToken: /*#__PURE__*/(0, _react.css)("display:inline-flex;align-items:center;justify-content:center;svg{", (0, _global_styling.logicalCSS)('height', '100%'), " margin:auto;};label:euiToken;"),
62
+ // Shapes
63
+ circle: _ref,
64
+ square: /*#__PURE__*/(0, _react.css)("border-radius:", euiTheme.border.radius.small, ";;label:square;"),
65
+ rectangle: /*#__PURE__*/(0, _react.css)("box-sizing:content-box;border-radius:", euiTheme.border.radius.small, ";;label:rectangle;"),
66
+ // Sizes
67
+ xs: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalSizeCSS)(euiTheme.size.s, euiTheme.size.s), ";&[class*='-square']{border-radius:calc(", euiTheme.border.radius.small, " / 2);}&[class*='-rectangle']{", (0, _global_styling.logicalCSS)('padding-vertical', '1px'), ";", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.xs), ";border-radius:calc(", euiTheme.border.radius.small, " / 2);};label:xs;"),
68
+ s: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalSizeCSS)(euiTheme.size.base, euiTheme.size.base), ";&[class*='-rectangle']{", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.xs), ";};label:s;"),
69
+ m: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalSizeCSS)(euiTheme.size.l, euiTheme.size.l), ";&[class*='-rectangle']{", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.s), ";};label:m;"),
70
+ l: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalSizeCSS)(euiTheme.size.xl, euiTheme.size.xl), ";&[class*='-rectangle']{", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.s), ";};label:l;"),
71
+ // Colors
72
+ euiColorVis0: /*#__PURE__*/(0, _react.css)(getTokenColor(euiTheme, colorMode, fill, 0), ";label:euiColorVis0;"),
73
+ euiColorVis1: /*#__PURE__*/(0, _react.css)(getTokenColor(euiTheme, colorMode, fill, 1), ";label:euiColorVis1;"),
74
+ euiColorVis2: /*#__PURE__*/(0, _react.css)(getTokenColor(euiTheme, colorMode, fill, 2), ";label:euiColorVis2;"),
75
+ euiColorVis3: /*#__PURE__*/(0, _react.css)(getTokenColor(euiTheme, colorMode, fill, 3), ";label:euiColorVis3;"),
76
+ euiColorVis4: /*#__PURE__*/(0, _react.css)(getTokenColor(euiTheme, colorMode, fill, 4), ";label:euiColorVis4;"),
77
+ euiColorVis5: /*#__PURE__*/(0, _react.css)(getTokenColor(euiTheme, colorMode, fill, 5), ";label:euiColorVis5;"),
78
+ euiColorVis6: /*#__PURE__*/(0, _react.css)(getTokenColor(euiTheme, colorMode, fill, 6), ";label:euiColorVis6;"),
79
+ euiColorVis7: /*#__PURE__*/(0, _react.css)(getTokenColor(euiTheme, colorMode, fill, 7), ";label:euiColorVis7;"),
80
+ euiColorVis8: /*#__PURE__*/(0, _react.css)(getTokenColor(euiTheme, colorMode, fill, 8), ";label:euiColorVis8;"),
81
+ euiColorVis9: /*#__PURE__*/(0, _react.css)(getTokenColor(euiTheme, colorMode, fill, 9), ";label:euiColorVis9;"),
82
+ gray: /*#__PURE__*/(0, _react.css)(getTokenColor(euiTheme, colorMode, fill, 'gray'), ";label:gray;"),
83
+ customColor: /*#__PURE__*/(0, _react.css)(";label:customColor;"),
84
+ // Fills
85
+ light: /*#__PURE__*/(0, _react.css)(";label:light;"),
86
+ dark: /*#__PURE__*/(0, _react.css)(";label:dark;"),
87
+ none: /*#__PURE__*/(0, _react.css)(";label:none;")
88
+ };
89
+ };
90
+
91
+ exports.euiTokenStyles = euiTokenStyles;
@@ -84,9 +84,8 @@ var TOKEN_MAP = {
84
84
  color: 'euiColorVis0'
85
85
  },
86
86
  tokenFile: {
87
- shape: 'rectangle',
88
- color: 'gray',
89
- fill: 'dark'
87
+ shape: 'square',
88
+ color: 'euiColorVis2'
90
89
  },
91
90
  tokenFlattened: {
92
91
  shape: 'square',
@@ -193,9 +192,8 @@ var TOKEN_MAP = {
193
192
  color: 'euiColorVis3'
194
193
  },
195
194
  tokenRepo: {
196
- shape: 'rectangle',
197
- color: 'euiColorVis1',
198
- fill: 'dark'
195
+ shape: 'square',
196
+ color: 'euiColorVis1'
199
197
  },
200
198
  tokenSearchType: {
201
199
  shape: 'square',
@@ -214,9 +212,8 @@ var TOKEN_MAP = {
214
212
  color: 'euiColorVis0'
215
213
  },
216
214
  tokenSymbol: {
217
- shape: 'rectangle',
218
- color: 'euiColorVis0',
219
- fill: 'dark'
215
+ shape: 'square',
216
+ color: 'euiColorVis0'
220
217
  },
221
218
  tokenTag: {
222
219
  shape: 'square',
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SIZES = exports.SHAPES = exports.FILLS = exports.COLORS = void 0;
7
+
8
+ /*
9
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
10
+ * or more contributor license agreements. Licensed under the Elastic License
11
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
12
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
13
+ * Side Public License, v 1.
14
+ */
15
+ var SIZES = ['xs', 's', 'm', 'l'];
16
+ exports.SIZES = SIZES;
17
+ var SHAPES = ['circle', 'square', 'rectangle'];
18
+ exports.SHAPES = SHAPES;
19
+ var FILLS = ['light', 'dark', 'none'];
20
+ exports.FILLS = FILLS;
21
+ var COLORS = ['euiColorVis0', 'euiColorVis1', 'euiColorVis2', 'euiColorVis3', 'euiColorVis4', 'euiColorVis5', 'euiColorVis6', 'euiColorVis7', 'euiColorVis8', 'euiColorVis9', 'gray'];
22
+ exports.COLORS = COLORS;
@@ -55,7 +55,7 @@ var EuiGlobalStyles = function EuiGlobalStyles(_ref) {
55
55
  * Final styles
56
56
  */
57
57
 
58
- var styles = /*#__PURE__*/(0, _react2.css)(_reset.resetStyles, " html{", scrollbarStyles, " ", fontReset, " text-size-adjust:100%;font-kerning:normal;height:100%;background-color:", colors.body, ";color:", colors.text, ";}code,pre,kbd,samp{font-family:", font.familyCode, ";}input,textarea,select{", fontReset, ";}button{font-family:", font.family, ";}em{font-style:italic;}strong{font-weight:", font.weight.bold, ";}*:focus{", (0, _mixins.euiFocusRing)(euiTheme), ";}::selection{background:", (0, _color.transparentize)(colors.primary, colorMode === 'LIGHT' ? 0.1 : 0.2), ";}a{color:", colors.primaryText, ";&,&:hover,&:focus{text-decoration:none;}};label:styles;");
58
+ var styles = /*#__PURE__*/(0, _react2.css)(_reset.resetStyles, " html{", scrollbarStyles, " ", fontReset, " text-size-adjust:100%;font-kerning:normal;height:100%;background-color:", colors.body, ";color:", colors.text, ";}code,pre,kbd,samp{font-family:", font.familyCode, ";}input,textarea,select{", fontReset, ";}button{font-family:", font.family, ";}em{font-style:italic;}strong{font-weight:", font.weight.bold, ";}*:focus{", (0, _mixins.euiFocusRing)(euiTheme), ";}::selection{background:", (0, _color.transparentize)(colors.primary, colorMode === 'LIGHT' ? 0.1 : 0.2), ";}a{color:", colors.primaryText, ";&,&:hover,&:focus{text-decoration:none;}}.euiBody-hasPortalContent{position:relative;};label:styles;");
59
59
  return (0, _react2.jsx)(_react2.Global, {
60
60
  styles: styles
61
61
  });