@elastic/eui 64.0.1 → 65.0.2

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 (374) 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 +164 -1249
  4. package/dist/eui_theme_dark.json +0 -32
  5. package/dist/eui_theme_dark.json.d.ts +0 -32
  6. package/dist/eui_theme_dark.min.css +1 -1
  7. package/dist/eui_theme_light.css +136 -1221
  8. package/dist/eui_theme_light.json +0 -32
  9. package/dist/eui_theme_light.json.d.ts +0 -32
  10. package/dist/eui_theme_light.min.css +1 -1
  11. package/es/components/accessibility/screen_reader_only/screen_reader_only.styles.js +2 -1
  12. package/es/components/accessibility/skip_link/skip_link.js +4 -54
  13. package/es/components/accordion/accordion.js +2 -1
  14. package/es/components/accordion/accordion.styles.js +17 -27
  15. package/es/components/badge/beta_badge/beta_badge.js +16 -3
  16. package/es/components/basic_table/basic_table.js +1 -1
  17. package/es/components/basic_table/collapsed_item_actions.js +1 -1
  18. package/es/components/basic_table/in_memory_table.js +1 -1
  19. package/es/components/beacon/beacon.styles.js +2 -2
  20. package/es/components/button/button.js +112 -215
  21. package/es/components/button/button_display/_button_display.js +90 -40
  22. package/es/components/button/button_display/_button_display.styles.js +7 -16
  23. package/es/components/button/button_display/_button_display_content.js +6 -3
  24. package/es/components/button/button_display/_button_display_content.styles.js +7 -17
  25. package/es/components/button/button_empty/button_empty.js +63 -53
  26. package/es/components/button/button_empty/index.js +1 -1
  27. package/es/components/button/button_group/button_group.js +4 -12
  28. package/es/components/button/button_group/button_group_button.js +14 -4
  29. package/es/components/button/button_icon/button_icon.js +61 -42
  30. package/es/components/call_out/call_out.styles.js +2 -1
  31. package/es/components/card/card.js +173 -89
  32. package/es/components/card/card.styles.js +136 -0
  33. package/es/components/card/card_select/card_select.js +133 -0
  34. package/es/components/card/card_select/card_select.styles.js +25 -0
  35. package/es/components/card/card_select/index.js +8 -0
  36. package/es/components/card/checkable_card/checkable_card.js +14 -9
  37. package/es/components/card/checkable_card/checkable_card.styles.js +22 -0
  38. package/es/components/comment_list/comment_event.styles.js +1 -1
  39. package/es/components/datagrid/body/data_grid_body.js +7 -6
  40. package/es/components/datagrid/body/data_grid_cell.js +13 -12
  41. package/es/components/datagrid/body/header/data_grid_header_cell.js +7 -6
  42. package/es/components/datagrid/body/header/data_grid_header_row.js +7 -6
  43. package/es/components/datagrid/data_grid.js +7 -6
  44. package/es/components/datagrid/utils/in_memory.js +7 -6
  45. package/es/components/date_picker/auto_refresh/auto_refresh.js +3 -2
  46. package/es/components/date_picker/react-datepicker/original.package.json +124 -0
  47. package/es/components/date_picker/super_date_picker/super_date_picker.js +17 -1
  48. package/es/components/date_picker/super_date_picker/super_update_button.js +11 -1
  49. package/es/components/description_list/description_list_title.js +1 -1
  50. package/es/components/expression/expression.styles.js +13 -31
  51. package/es/components/facet/facet_button.js +5 -4
  52. package/es/components/header/header_links/header_link.js +5 -3
  53. package/es/components/icon/icon.js +2 -1
  54. package/es/components/image/image_button.styles.js +1 -1
  55. package/es/components/image/image_wrapper.styles.js +3 -3
  56. package/es/components/link/link.styles.js +2 -2
  57. package/es/components/list_group/list_group.js +2 -1
  58. package/es/components/list_group/list_group_item.js +2 -1
  59. package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +3 -2
  60. package/es/components/loading/loading_chart.styles.js +16 -26
  61. package/es/components/loading/loading_content.styles.js +2 -2
  62. package/es/components/loading/loading_logo.styles.js +4 -4
  63. package/es/components/loading/loading_spinner.styles.js +6 -6
  64. package/es/components/markdown_editor/markdown_editor_toolbar.js +2 -0
  65. package/es/components/modal/confirm_modal.js +1 -1
  66. package/es/components/notification/notification_event.js +5 -3
  67. package/es/components/notification/notification_event_read_button.js +2 -1
  68. package/es/components/page/page_template.js +2 -2
  69. package/es/components/page_template/inner/page_inner.styles.js +2 -2
  70. package/es/components/page_template/outer/page_outer.styles.js +3 -1
  71. package/es/components/pagination/pagination_button.js +5 -3
  72. package/es/components/panel/panel.js +1 -1
  73. package/es/components/panel/{panel.style.js → panel.styles.js} +2 -2
  74. package/es/components/progress/progress.styles.js +2 -2
  75. package/es/components/title/title.styles.js +2 -2
  76. package/es/components/toast/toast.styles.js +4 -4
  77. package/es/components/tool_tip/icon_tip.js +11 -1
  78. package/es/components/tool_tip/tool_tip.js +18 -6
  79. package/es/global_styling/functions/logicals.js +2 -72
  80. package/es/global_styling/functions/logicals.json +56 -0
  81. package/es/global_styling/functions/typography.js +2 -1
  82. package/es/global_styling/mixins/_color.js +1 -1
  83. package/es/global_styling/mixins/_helpers.js +7 -1
  84. package/es/global_styling/reset/global_styles.js +2 -1
  85. package/es/themes/amsterdam/global_styling/mixins/button.js +165 -16
  86. package/eui.d.ts +1062 -936
  87. package/i18ntokens.json +15 -15
  88. package/lib/components/accessibility/screen_reader_only/screen_reader_only.styles.js +3 -1
  89. package/lib/components/accessibility/skip_link/skip_link.js +4 -54
  90. package/lib/components/accordion/accordion.js +3 -1
  91. package/lib/components/accordion/accordion.styles.js +17 -26
  92. package/lib/components/badge/beta_badge/beta_badge.js +16 -3
  93. package/lib/components/basic_table/basic_table.js +1 -1
  94. package/lib/components/basic_table/collapsed_item_actions.js +1 -1
  95. package/lib/components/basic_table/in_memory_table.js +1 -1
  96. package/lib/components/beacon/beacon.styles.js +1 -1
  97. package/lib/components/button/button.js +124 -229
  98. package/lib/components/button/button_display/_button_display.js +94 -33
  99. package/lib/components/button/button_display/_button_display.styles.js +7 -16
  100. package/lib/components/button/button_display/_button_display_content.js +7 -3
  101. package/lib/components/button/button_display/_button_display_content.styles.js +7 -17
  102. package/lib/components/button/button_empty/button_empty.js +64 -54
  103. package/lib/components/button/button_empty/index.js +0 -6
  104. package/lib/components/button/button_group/button_group.js +4 -12
  105. package/lib/components/button/button_group/button_group_button.js +15 -4
  106. package/lib/components/button/button_icon/button_icon.js +61 -43
  107. package/lib/components/call_out/call_out.styles.js +2 -1
  108. package/lib/components/card/card.js +174 -88
  109. package/lib/components/card/card.styles.js +146 -0
  110. package/lib/components/card/card_select/card_select.js +144 -0
  111. package/lib/components/card/card_select/card_select.styles.js +27 -0
  112. package/lib/components/card/card_select/index.js +19 -0
  113. package/lib/components/card/checkable_card/checkable_card.js +16 -9
  114. package/lib/components/card/checkable_card/checkable_card.styles.js +33 -0
  115. package/lib/components/comment_list/comment_event.styles.js +1 -1
  116. package/lib/components/datagrid/body/data_grid_body.js +7 -6
  117. package/lib/components/datagrid/body/data_grid_cell.js +13 -12
  118. package/lib/components/datagrid/body/header/data_grid_header_cell.js +7 -6
  119. package/lib/components/datagrid/body/header/data_grid_header_row.js +7 -6
  120. package/lib/components/datagrid/data_grid.js +7 -6
  121. package/lib/components/datagrid/utils/in_memory.js +7 -6
  122. package/lib/components/date_picker/auto_refresh/auto_refresh.js +3 -2
  123. package/lib/components/date_picker/react-datepicker/original.package.json +124 -0
  124. package/lib/components/date_picker/super_date_picker/super_date_picker.js +17 -1
  125. package/lib/components/date_picker/super_date_picker/super_update_button.js +11 -1
  126. package/lib/components/description_list/description_list_title.js +1 -1
  127. package/lib/components/expression/expression.styles.js +12 -30
  128. package/lib/components/facet/facet_button.js +4 -3
  129. package/lib/components/header/header_links/header_link.js +5 -3
  130. package/lib/components/icon/icon.js +2 -1
  131. package/lib/components/image/image_button.styles.js +1 -1
  132. package/lib/components/image/image_wrapper.styles.js +2 -2
  133. package/lib/components/link/link.styles.js +1 -1
  134. package/lib/components/list_group/list_group.js +2 -1
  135. package/lib/components/list_group/list_group_item.js +2 -1
  136. package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +3 -2
  137. package/lib/components/loading/loading_chart.styles.js +16 -25
  138. package/lib/components/loading/loading_content.styles.js +1 -1
  139. package/lib/components/loading/loading_logo.styles.js +4 -4
  140. package/lib/components/loading/loading_spinner.styles.js +5 -5
  141. package/lib/components/markdown_editor/markdown_editor_toolbar.js +2 -0
  142. package/lib/components/modal/confirm_modal.js +1 -1
  143. package/lib/components/notification/notification_event.js +5 -3
  144. package/lib/components/notification/notification_event_read_button.js +2 -1
  145. package/lib/components/page/page_template.js +1 -1
  146. package/lib/components/page_template/inner/page_inner.styles.js +2 -2
  147. package/lib/components/page_template/outer/page_outer.styles.js +4 -1
  148. package/lib/components/panel/panel.js +1 -1
  149. package/{optimize/lib/components/panel/panel.style.js → lib/components/panel/panel.styles.js} +1 -1
  150. package/lib/components/progress/progress.styles.js +2 -2
  151. package/lib/components/title/title.styles.js +1 -1
  152. package/lib/components/toast/toast.styles.js +4 -4
  153. package/lib/components/tool_tip/icon_tip.js +11 -1
  154. package/lib/components/tool_tip/tool_tip.js +18 -6
  155. package/lib/global_styling/functions/logicals.js +3 -72
  156. package/lib/global_styling/functions/logicals.json +56 -0
  157. package/lib/global_styling/functions/typography.js +3 -1
  158. package/lib/global_styling/mixins/_color.js +1 -1
  159. package/lib/global_styling/mixins/_helpers.js +9 -2
  160. package/lib/global_styling/reset/global_styles.js +3 -1
  161. package/lib/themes/amsterdam/global_styling/mixins/button.js +178 -24
  162. package/optimize/es/components/accessibility/screen_reader_only/screen_reader_only.styles.js +2 -1
  163. package/optimize/es/components/accordion/accordion.js +2 -1
  164. package/optimize/es/components/accordion/accordion.styles.js +17 -27
  165. package/optimize/es/components/badge/beta_badge/beta_badge.js +6 -3
  166. package/optimize/es/components/beacon/beacon.styles.js +2 -2
  167. package/optimize/es/components/button/button.js +88 -100
  168. package/optimize/es/components/button/button_display/_button_display.js +67 -32
  169. package/optimize/es/components/button/button_display/_button_display.styles.js +7 -16
  170. package/optimize/es/components/button/button_display/_button_display_content.js +5 -2
  171. package/optimize/es/components/button/button_display/_button_display_content.styles.js +7 -17
  172. package/optimize/es/components/button/button_empty/button_empty.js +55 -47
  173. package/optimize/es/components/button/button_empty/index.js +1 -1
  174. package/optimize/es/components/button/button_group/button_group.js +2 -10
  175. package/optimize/es/components/button/button_group/button_group_button.js +13 -3
  176. package/optimize/es/components/button/button_icon/button_icon.js +54 -41
  177. package/optimize/es/components/call_out/call_out.styles.js +2 -1
  178. package/optimize/es/components/card/card.js +97 -31
  179. package/optimize/es/components/card/card.styles.js +136 -0
  180. package/optimize/es/components/card/{card_select.js → card_select/card_select.js} +16 -14
  181. package/optimize/es/components/card/card_select/card_select.styles.js +25 -0
  182. package/optimize/es/components/card/card_select/index.js +8 -0
  183. package/optimize/es/components/card/checkable_card/checkable_card.js +14 -9
  184. package/optimize/es/components/card/checkable_card/checkable_card.styles.js +22 -0
  185. package/optimize/es/components/comment_list/comment_event.styles.js +1 -1
  186. package/optimize/es/components/date_picker/react-datepicker/original.package.json +124 -0
  187. package/optimize/es/components/description_list/description_list_title.js +1 -1
  188. package/optimize/es/components/expression/expression.styles.js +13 -31
  189. package/optimize/es/components/facet/facet_button.js +5 -3
  190. package/optimize/es/components/icon/icon.js +2 -1
  191. package/optimize/es/components/image/image_button.styles.js +1 -1
  192. package/optimize/es/components/image/image_wrapper.styles.js +3 -3
  193. package/optimize/es/components/link/link.styles.js +2 -2
  194. package/optimize/es/components/loading/loading_chart.styles.js +16 -26
  195. package/optimize/es/components/loading/loading_content.styles.js +2 -2
  196. package/optimize/es/components/loading/loading_logo.styles.js +4 -4
  197. package/optimize/es/components/loading/loading_spinner.styles.js +6 -6
  198. package/optimize/es/components/markdown_editor/markdown_editor_toolbar.js +2 -0
  199. package/optimize/es/components/page/page_template.js +2 -2
  200. package/optimize/es/components/page_template/inner/page_inner.styles.js +2 -2
  201. package/optimize/es/components/page_template/outer/page_outer.styles.js +3 -1
  202. package/optimize/es/components/panel/panel.js +1 -1
  203. package/optimize/es/components/panel/{panel.style.js → panel.styles.js} +2 -2
  204. package/optimize/es/components/progress/progress.styles.js +2 -2
  205. package/optimize/es/components/title/title.styles.js +2 -2
  206. package/optimize/es/components/toast/toast.styles.js +4 -4
  207. package/optimize/es/components/tool_tip/tool_tip.js +7 -5
  208. package/optimize/es/global_styling/functions/logicals.js +2 -72
  209. package/optimize/es/global_styling/functions/logicals.json +56 -0
  210. package/optimize/es/global_styling/functions/typography.js +2 -1
  211. package/optimize/es/global_styling/mixins/_color.js +1 -1
  212. package/optimize/es/global_styling/mixins/_helpers.js +7 -1
  213. package/optimize/es/global_styling/reset/global_styles.js +2 -1
  214. package/optimize/es/themes/amsterdam/global_styling/mixins/button.js +155 -16
  215. package/optimize/lib/components/accessibility/screen_reader_only/screen_reader_only.styles.js +3 -1
  216. package/optimize/lib/components/accordion/accordion.js +3 -1
  217. package/optimize/lib/components/accordion/accordion.styles.js +17 -26
  218. package/optimize/lib/components/badge/beta_badge/beta_badge.js +6 -3
  219. package/optimize/lib/components/beacon/beacon.styles.js +1 -1
  220. package/optimize/lib/components/button/button.js +92 -103
  221. package/optimize/lib/components/button/button_display/_button_display.js +71 -25
  222. package/optimize/lib/components/button/button_display/_button_display.styles.js +7 -16
  223. package/optimize/lib/components/button/button_display/_button_display_content.js +6 -2
  224. package/optimize/lib/components/button/button_display/_button_display_content.styles.js +7 -17
  225. package/optimize/lib/components/button/button_empty/button_empty.js +59 -50
  226. package/optimize/lib/components/button/button_empty/index.js +0 -6
  227. package/optimize/lib/components/button/button_group/button_group.js +2 -10
  228. package/optimize/lib/components/button/button_group/button_group_button.js +15 -3
  229. package/optimize/lib/components/button/button_icon/button_icon.js +54 -41
  230. package/optimize/lib/components/call_out/call_out.styles.js +2 -1
  231. package/optimize/lib/components/card/card.js +97 -30
  232. package/optimize/lib/components/card/card.styles.js +146 -0
  233. package/optimize/lib/components/card/{card_select.js → card_select/card_select.js} +16 -14
  234. package/optimize/lib/components/card/card_select/card_select.styles.js +27 -0
  235. package/optimize/lib/components/card/card_select/index.js +19 -0
  236. package/optimize/lib/components/card/checkable_card/checkable_card.js +16 -9
  237. package/optimize/lib/components/card/checkable_card/checkable_card.styles.js +33 -0
  238. package/optimize/lib/components/comment_list/comment_event.styles.js +1 -1
  239. package/optimize/lib/components/date_picker/react-datepicker/original.package.json +124 -0
  240. package/optimize/lib/components/description_list/description_list_title.js +1 -1
  241. package/optimize/lib/components/expression/expression.styles.js +12 -30
  242. package/optimize/lib/components/facet/facet_button.js +4 -2
  243. package/optimize/lib/components/icon/icon.js +2 -1
  244. package/optimize/lib/components/image/image_button.styles.js +1 -1
  245. package/optimize/lib/components/image/image_wrapper.styles.js +2 -2
  246. package/optimize/lib/components/link/link.styles.js +1 -1
  247. package/optimize/lib/components/loading/loading_chart.styles.js +16 -25
  248. package/optimize/lib/components/loading/loading_content.styles.js +1 -1
  249. package/optimize/lib/components/loading/loading_logo.styles.js +4 -4
  250. package/optimize/lib/components/loading/loading_spinner.styles.js +5 -5
  251. package/optimize/lib/components/markdown_editor/markdown_editor_toolbar.js +2 -0
  252. package/optimize/lib/components/page/page_template.js +1 -1
  253. package/optimize/lib/components/page_template/inner/page_inner.styles.js +2 -2
  254. package/optimize/lib/components/page_template/outer/page_outer.styles.js +4 -1
  255. package/optimize/lib/components/panel/panel.js +1 -1
  256. package/{test-env/components/panel/panel.style.js → optimize/lib/components/panel/panel.styles.js} +1 -1
  257. package/optimize/lib/components/progress/progress.styles.js +2 -2
  258. package/optimize/lib/components/title/title.styles.js +1 -1
  259. package/optimize/lib/components/toast/toast.styles.js +4 -4
  260. package/optimize/lib/components/tool_tip/tool_tip.js +7 -5
  261. package/optimize/lib/global_styling/functions/logicals.js +10 -73
  262. package/optimize/lib/global_styling/functions/logicals.json +56 -0
  263. package/optimize/lib/global_styling/functions/typography.js +3 -1
  264. package/optimize/lib/global_styling/mixins/_color.js +1 -1
  265. package/optimize/lib/global_styling/mixins/_helpers.js +9 -2
  266. package/optimize/lib/global_styling/reset/global_styles.js +3 -1
  267. package/optimize/lib/themes/amsterdam/global_styling/mixins/button.js +170 -17
  268. package/package.json +2 -2
  269. package/src/components/badge/beta_badge/_beta_badge.scss +5 -1
  270. package/src/components/button/_index.scss +0 -1
  271. package/src/components/button/button_empty/_button_empty.scss +4 -48
  272. package/src/components/button/button_group/_button_group.scss +0 -1
  273. package/src/components/button/button_group/_button_group_button.scss +55 -83
  274. package/src/components/button/button_icon/_button_icon.scss +3 -103
  275. package/src/components/control_bar/_control_bar.scss +2 -6
  276. package/src/components/datagrid/_data_grid_data_row.scss +7 -0
  277. package/src/components/flyout/_flyout.scss +4 -1
  278. package/src/components/index.scss +0 -1
  279. package/src/global_styling/mixins/_button.scss +55 -11
  280. package/src/global_styling/mixins/_index.scss +0 -1
  281. package/src/themes/amsterdam/global_styling/mixins/_index.scss +0 -2
  282. package/src/themes/amsterdam/overrides/_header.scss +0 -2
  283. package/src/themes/amsterdam/overrides/_index.scss +0 -4
  284. package/test-env/components/accessibility/screen_reader_only/screen_reader_only.styles.js +3 -1
  285. package/test-env/components/accessibility/skip_link/skip_link.js +4 -54
  286. package/test-env/components/accordion/accordion.js +3 -1
  287. package/test-env/components/accordion/accordion.styles.js +17 -26
  288. package/test-env/components/badge/beta_badge/beta_badge.js +16 -3
  289. package/test-env/components/basic_table/basic_table.js +1 -1
  290. package/test-env/components/basic_table/collapsed_item_actions.js +1 -1
  291. package/test-env/components/basic_table/in_memory_table.js +1 -1
  292. package/test-env/components/beacon/beacon.styles.js +1 -1
  293. package/test-env/components/button/button.js +111 -225
  294. package/test-env/components/button/button_display/_button_display.js +93 -32
  295. package/test-env/components/button/button_display/_button_display.styles.js +7 -16
  296. package/test-env/components/button/button_display/_button_display_content.js +7 -3
  297. package/test-env/components/button/button_display/_button_display_content.styles.js +7 -17
  298. package/test-env/components/button/button_empty/button_empty.js +64 -53
  299. package/test-env/components/button/button_empty/index.js +0 -6
  300. package/test-env/components/button/button_group/button_group.js +4 -12
  301. package/test-env/components/button/button_group/button_group_button.js +16 -4
  302. package/test-env/components/button/button_icon/button_icon.js +61 -42
  303. package/test-env/components/call_out/call_out.styles.js +2 -1
  304. package/test-env/components/card/card.js +172 -88
  305. package/test-env/components/card/card.styles.js +146 -0
  306. package/test-env/components/card/card_select/card_select.js +141 -0
  307. package/test-env/components/card/card_select/card_select.styles.js +27 -0
  308. package/test-env/components/card/card_select/index.js +19 -0
  309. package/test-env/components/card/checkable_card/checkable_card.js +16 -9
  310. package/test-env/components/card/checkable_card/checkable_card.styles.js +33 -0
  311. package/test-env/components/comment_list/comment_event.styles.js +1 -1
  312. package/test-env/components/datagrid/body/data_grid_body.js +7 -6
  313. package/test-env/components/datagrid/body/data_grid_cell.js +13 -12
  314. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +7 -6
  315. package/test-env/components/datagrid/body/header/data_grid_header_row.js +7 -6
  316. package/test-env/components/datagrid/data_grid.js +7 -6
  317. package/test-env/components/datagrid/utils/in_memory.js +7 -6
  318. package/test-env/components/date_picker/auto_refresh/auto_refresh.js +3 -2
  319. package/test-env/components/date_picker/react-datepicker/original.package.json +124 -0
  320. package/test-env/components/date_picker/super_date_picker/super_date_picker.js +17 -1
  321. package/test-env/components/date_picker/super_date_picker/super_update_button.js +11 -1
  322. package/test-env/components/description_list/description_list_title.js +1 -1
  323. package/test-env/components/expression/expression.styles.js +12 -30
  324. package/test-env/components/facet/facet_button.js +4 -3
  325. package/test-env/components/header/header_links/header_link.js +5 -3
  326. package/test-env/components/image/image_button.styles.js +1 -1
  327. package/test-env/components/image/image_wrapper.styles.js +2 -2
  328. package/test-env/components/link/link.styles.js +1 -1
  329. package/test-env/components/list_group/list_group.js +2 -1
  330. package/test-env/components/list_group/list_group_item.js +2 -1
  331. package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +3 -2
  332. package/test-env/components/loading/loading_chart.styles.js +16 -25
  333. package/test-env/components/loading/loading_content.styles.js +1 -1
  334. package/test-env/components/loading/loading_logo.styles.js +4 -4
  335. package/test-env/components/loading/loading_spinner.styles.js +5 -5
  336. package/test-env/components/markdown_editor/markdown_editor_toolbar.js +2 -0
  337. package/test-env/components/modal/confirm_modal.js +1 -1
  338. package/test-env/components/notification/notification_event.js +5 -3
  339. package/test-env/components/notification/notification_event_read_button.js +2 -1
  340. package/test-env/components/page/page_template.js +1 -1
  341. package/test-env/components/page_template/inner/page_inner.styles.js +2 -2
  342. package/test-env/components/page_template/outer/page_outer.styles.js +4 -1
  343. package/test-env/components/panel/panel.js +1 -1
  344. package/{lib/components/panel/panel.style.js → test-env/components/panel/panel.styles.js} +1 -1
  345. package/test-env/components/progress/progress.styles.js +2 -2
  346. package/test-env/components/title/title.styles.js +1 -1
  347. package/test-env/components/toast/toast.styles.js +4 -4
  348. package/test-env/components/tool_tip/icon_tip.js +11 -1
  349. package/test-env/components/tool_tip/tool_tip.js +18 -6
  350. package/test-env/global_styling/functions/logicals.js +10 -73
  351. package/test-env/global_styling/functions/logicals.json +56 -0
  352. package/test-env/global_styling/functions/typography.js +3 -1
  353. package/test-env/global_styling/mixins/_color.js +1 -1
  354. package/test-env/global_styling/mixins/_helpers.js +9 -2
  355. package/test-env/global_styling/reset/global_styles.js +3 -1
  356. package/test-env/themes/amsterdam/global_styling/mixins/button.js +170 -17
  357. package/es/components/card/card_select.js +0 -176
  358. package/lib/components/card/card_select.js +0 -187
  359. package/src/components/button/_button.scss +0 -143
  360. package/src/components/button/button_icon/_variables.scss +0 -11
  361. package/src/components/card/_card.scss +0 -239
  362. package/src/components/card/_card_select.scss +0 -21
  363. package/src/components/card/_index.scss +0 -5
  364. package/src/components/card/_mixins.scss +0 -11
  365. package/src/components/card/_variables.scss +0 -25
  366. package/src/components/card/checkable_card/_checkable_card.scss +0 -29
  367. package/src/components/card/checkable_card/_index.scss +0 -1
  368. package/src/global_styling/mixins/_beta_badge.scss +0 -30
  369. package/src/themes/amsterdam/global_styling/mixins/_button.scss +0 -60
  370. package/src/themes/amsterdam/overrides/_button.scss +0 -119
  371. package/src/themes/amsterdam/overrides/_button_empty.scss +0 -20
  372. package/src/themes/amsterdam/overrides/_button_group.scss +0 -91
  373. package/src/themes/amsterdam/overrides/_card.scss +0 -6
  374. package/test-env/components/card/card_select.js +0 -184
@@ -3,55 +3,209 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useEuiButtonColorCSS = exports.euiButtonColor = exports.BUTTON_COLORS = void 0;
6
+ exports.useEuiButtonRadiusCSS = exports.useEuiButtonFocusCSS = exports.useEuiButtonColorCSS = exports.euiButtonFillColor = exports.euiButtonEmptyColor = exports.euiButtonColor = exports.BUTTON_COLORS = void 0;
7
7
 
8
8
  var _react = require("@emotion/react");
9
9
 
10
+ var _global_styling = require("../../../../global_styling");
11
+
10
12
  var _services = require("../../../../services");
11
13
 
12
- /*
13
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
14
- * or more contributor license agreements. Licensed under the Elastic License
15
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
16
- * in compliance with, at your election, the Elastic License 2.0 or the Server
17
- * Side Public License, v 1.
18
- */
19
- var BUTTON_COLORS = ['text', 'accent', 'primary', 'success', 'warning', 'danger', 'disabled'];
14
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
15
+
16
+ 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."); }
17
+
18
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
19
+
20
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
21
+
22
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
23
+
24
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
25
+
26
+ var BUTTON_COLORS = ['text', 'accent', 'primary', 'success', 'warning', 'danger'];
20
27
  exports.BUTTON_COLORS = BUTTON_COLORS;
21
28
 
22
- var euiButtonColor = function euiButtonColor(color, _ref) {
23
- var euiTheme = _ref.euiTheme,
24
- colorMode = _ref.colorMode;
29
+ /**
30
+ * Creates the `base` version of button styles with proper text contrast.
31
+ * @param euiThemeContext
32
+ * @param color One of the named button colors or 'disabled'
33
+ * @returns Style object `{ backgroundColor, color }`
34
+ */
35
+ var euiButtonColor = function euiButtonColor(euiThemeContext, color) {
36
+ var euiTheme = euiThemeContext.euiTheme,
37
+ colorMode = euiThemeContext.colorMode;
25
38
 
26
39
  function tintOrShade(color) {
27
40
  return colorMode === 'DARK' ? (0, _services.shade)(color, 0.7) : (0, _services.tint)(color, 0.8);
28
41
  }
29
42
 
43
+ var foreground;
44
+ var background;
45
+
30
46
  switch (color) {
31
47
  case 'disabled':
32
- return (0, _services.transparentize)(euiTheme.colors.lightShade, 0.15);
48
+ return {
49
+ color: euiTheme.colors.disabledText,
50
+ backgroundColor: (0, _services.transparentize)(euiTheme.colors.lightShade, 0.15)
51
+ };
33
52
 
34
53
  case 'text':
35
- return colorMode === 'DARK' ? (0, _services.shade)(euiTheme.colors.lightShade, 0.2) : (0, _services.tint)(euiTheme.colors.lightShade, 0.5);
54
+ foreground = euiTheme.colors[color];
55
+ background = colorMode === 'DARK' ? (0, _services.shade)(euiTheme.colors.lightShade, 0.2) : (0, _services.tint)(euiTheme.colors.lightShade, 0.5);
56
+ break;
36
57
 
37
58
  default:
38
- return tintOrShade(euiTheme.colors[color]);
59
+ foreground = euiTheme.colors["".concat(color, "Text")];
60
+ background = tintOrShade(euiTheme.colors[color]);
61
+ break;
39
62
  }
63
+
64
+ return {
65
+ color: (0, _services.makeHighContrastColor)(foreground)(background),
66
+ backgroundColor: background
67
+ };
40
68
  };
69
+ /**
70
+ * Creates the `fill` version of buttons styles with proper text contrast.
71
+ * @param euiThemeContext
72
+ * @param color One of the named button colors or 'disabled'
73
+ * @returns Style object `{ backgroundColor, color }`
74
+ */
75
+
41
76
 
42
77
  exports.euiButtonColor = euiButtonColor;
43
78
 
79
+ var euiButtonFillColor = function euiButtonFillColor(euiThemeContext, color) {
80
+ var euiTheme = euiThemeContext.euiTheme,
81
+ colorMode = euiThemeContext.colorMode;
82
+ var background;
83
+ var foreground;
84
+
85
+ switch (color) {
86
+ case 'disabled':
87
+ background = euiButtonColor(euiThemeContext, color).backgroundColor;
88
+ foreground = euiButtonColor(euiThemeContext, color).color;
89
+ break;
90
+
91
+ case 'text':
92
+ background = colorMode === 'DARK' ? euiTheme.colors.text : euiTheme.colors.darkShade;
93
+ foreground = _services.isColorDark.apply(void 0, _toConsumableArray((0, _services.hexToRgb)(background))) ? euiTheme.colors.ghost : euiTheme.colors.ink;
94
+ break;
95
+
96
+ default:
97
+ background = euiTheme.colors[color];
98
+ foreground = _services.isColorDark.apply(void 0, _toConsumableArray((0, _services.hexToRgb)(euiTheme.colors[color]))) ? euiTheme.colors.ghost : euiTheme.colors.ink;
99
+ break;
100
+ }
101
+
102
+ return {
103
+ color: foreground,
104
+ backgroundColor: background
105
+ };
106
+ };
107
+ /**
108
+ * Creates the `empty` version of button styles using the text-variant and adding interactive styles.
109
+ * @param euiThemeContext
110
+ * @param color One of the named button colors or 'disabled'
111
+ * @returns Style object `{ backgroundColor, color }` where `background` is typically used for interactive states
112
+ */
113
+
114
+
115
+ exports.euiButtonFillColor = euiButtonFillColor;
116
+
117
+ var euiButtonEmptyColor = function euiButtonEmptyColor(euiThemeContext, color) {
118
+ var foreground;
119
+ var background;
120
+
121
+ switch (color) {
122
+ case 'disabled':
123
+ foreground = euiButtonColor(euiThemeContext, color).color;
124
+ background = 'transparent';
125
+ break;
126
+
127
+ case 'text':
128
+ foreground = euiButtonColor(euiThemeContext, color).color;
129
+ background = (0, _global_styling.euiBackgroundColor)(euiThemeContext, 'subdued', {
130
+ method: 'transparent'
131
+ });
132
+ break;
133
+
134
+ default:
135
+ foreground = euiButtonColor(euiThemeContext, color).color;
136
+ background = (0, _global_styling.euiBackgroundColor)(euiThemeContext, color, {
137
+ method: 'transparent'
138
+ });
139
+ break;
140
+ }
141
+
142
+ return {
143
+ color: foreground,
144
+ backgroundColor: background
145
+ };
146
+ };
147
+ /**
148
+ * Given the button display type, returns the Emotion based color keys.
149
+ * @param options Button display type
150
+ * @returns An object of `_EuiButtonColor` keys including `disabled`
151
+ */
152
+
153
+
154
+ exports.euiButtonEmptyColor = euiButtonEmptyColor;
155
+
44
156
  var useEuiButtonColorCSS = function useEuiButtonColorCSS() {
45
- var euiTheme = (0, _services.useEuiTheme)();
157
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
158
+ var euiThemeContext = (0, _services.useEuiTheme)();
159
+
160
+ function stylesByDisplay(color) {
161
+ return {
162
+ base: /*#__PURE__*/(0, _react.css)(euiButtonColor(euiThemeContext, color), ";;label:base;"),
163
+ fill: /*#__PURE__*/(0, _react.css)(euiButtonFillColor(euiThemeContext, color), "outline-color:", euiThemeContext.colorMode === 'DARK' && color === 'text' ? 'currentColor' : euiThemeContext.euiTheme.colors.fullShade, ";;label:fill;"),
164
+ empty: /*#__PURE__*/(0, _react.css)("color:", euiButtonEmptyColor(euiThemeContext, color).color, ";&:focus,&:active{background-color:", euiButtonEmptyColor(euiThemeContext, color).backgroundColor, ";};label:empty;")
165
+ };
166
+ }
167
+
168
+ return {
169
+ text: /*#__PURE__*/(0, _react.css)(stylesByDisplay('text')[options.display || 'base'], ";label:text;"),
170
+ accent: /*#__PURE__*/(0, _react.css)(stylesByDisplay('accent')[options.display || 'base'], ";label:accent;"),
171
+ primary: /*#__PURE__*/(0, _react.css)(stylesByDisplay('primary')[options.display || 'base'], ";label:primary;"),
172
+ success: /*#__PURE__*/(0, _react.css)(stylesByDisplay('success')[options.display || 'base'], ";label:success;"),
173
+ warning: /*#__PURE__*/(0, _react.css)(stylesByDisplay('warning')[options.display || 'base'], ";label:warning;"),
174
+ danger: /*#__PURE__*/(0, _react.css)(stylesByDisplay('danger')[options.display || 'base'], ";label:danger;"),
175
+ disabled: /*#__PURE__*/(0, _react.css)(stylesByDisplay('disabled')[options.display || 'base'], ";label:disabled;")
176
+ };
177
+ };
178
+ /**
179
+ * Based on the button size, creates the style properties.
180
+ * @returns An object of button size keys with Emption styles for `border-radius`
181
+ */
182
+
183
+
184
+ exports.useEuiButtonColorCSS = useEuiButtonColorCSS;
185
+
186
+ var useEuiButtonRadiusCSS = function useEuiButtonRadiusCSS() {
187
+ var _useEuiTheme = (0, _services.useEuiTheme)(),
188
+ euiTheme = _useEuiTheme.euiTheme;
189
+
46
190
  return {
47
- text: /*#__PURE__*/(0, _react.css)("background-color:", euiButtonColor('text', euiTheme), ";;label:text;"),
48
- accent: /*#__PURE__*/(0, _react.css)("background-color:", euiButtonColor('accent', euiTheme), ";;label:accent;"),
49
- primary: /*#__PURE__*/(0, _react.css)("background-color:", euiButtonColor('primary', euiTheme), ";;label:primary;"),
50
- success: /*#__PURE__*/(0, _react.css)("background-color:", euiButtonColor('success', euiTheme), ";;label:success;"),
51
- warning: /*#__PURE__*/(0, _react.css)("background-color:", euiButtonColor('warning', euiTheme), ";;label:warning;"),
52
- danger: /*#__PURE__*/(0, _react.css)("background-color:", euiButtonColor('danger', euiTheme), ";;label:danger;"),
53
- disabled: /*#__PURE__*/(0, _react.css)("background-color:", euiButtonColor('disabled', euiTheme), ";;label:disabled;")
191
+ xs: /*#__PURE__*/(0, _react.css)("border-radius:", euiTheme.border.radius.small, ";;label:xs;"),
192
+ s: /*#__PURE__*/(0, _react.css)("border-radius:", euiTheme.border.radius.small, ";;label:s;"),
193
+ m: /*#__PURE__*/(0, _react.css)("border-radius:", euiTheme.border.radius.medium, ";;label:m;")
54
194
  };
55
195
  };
196
+ /**
197
+ * Creates the translate animation when button is in focus.
198
+ * @returns string
199
+ */
200
+
201
+
202
+ exports.useEuiButtonRadiusCSS = useEuiButtonRadiusCSS;
203
+
204
+ var useEuiButtonFocusCSS = function useEuiButtonFocusCSS() {
205
+ var _useEuiTheme2 = (0, _services.useEuiTheme)(),
206
+ euiTheme = _useEuiTheme2.euiTheme;
207
+
208
+ return "\n ".concat(_global_styling.euiCanAnimate, " {\n transition: transform ").concat(euiTheme.animation.normal, " ease-in-out,\n background-color ").concat(euiTheme.animation.normal, " ease-in-out;\n\n &:hover:not(:disabled) {\n transform: translateY(-1px);\n }\n\n &:focus {\n animation: euiButtonActive ").concat(euiTheme.animation.normal, "\n ").concat(euiTheme.animation.bounce, ";\n }\n\n &:active:not(:disabled) {\n transform: translateY(1px);\n }\n }\n ");
209
+ };
56
210
 
57
- exports.useEuiButtonColorCSS = useEuiButtonColorCSS;
211
+ exports.useEuiButtonFocusCSS = useEuiButtonFocusCSS;
@@ -6,13 +6,14 @@
6
6
  * Side Public License, v 1.
7
7
  */
8
8
  import { css } from '@emotion/react';
9
+ import { logicalCSS, logicalSizeCSS } from '../../../global_styling';
9
10
  /*
10
11
  * Mixin that hides elements offscreen to only be read by screen reader
11
12
  * See https://github.com/elastic/eui/pull/5130 and https://github.com/elastic/eui/pull/5152 for more info
12
13
  */
13
14
 
14
15
  export var euiScreenReaderOnly = function euiScreenReaderOnly() {
15
- return "\n // Take the element out of the layout\n position: absolute;\n // Keep it vertically inline\n top: auto;\n // Chrome requires a left value, and Selenium (used by Kibana's FTR) requires an off-screen position for its .getVisibleText() to not register SR-only text\n left: -10000px;\n // The element must have a size (for some screen readers)\n width: 1px;\n height: 1px;\n // But reduce the visible size to nothing\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n // And ensure no overflows occur\n overflow: hidden;\n // Chrome requires the negative margin to not cause overflows of parent containers\n margin: -1px;\n";
16
+ return "\n // Take the element out of the layout\n position: absolute;\n // Keep it vertically inline\n ".concat(logicalCSS('top', 'auto'), "\n // Chrome requires a left value, and Selenium (used by Kibana's FTR) requires an off-screen position for its .getVisibleText() to not register SR-only text\n ").concat(logicalCSS('left', '-10000px'), "\n // The element must have a size (for some screen readers)\n ").concat(logicalSizeCSS('1px', '1px'), "\n // But reduce the visible size to nothing\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n // And ensure no overflows occur\n overflow: hidden;\n // Chrome requires the negative margin to not cause overflows of parent containers\n margin: -1px;\n");
16
17
  };
17
18
  /*
18
19
  * Styles
@@ -30,6 +30,7 @@ import { EuiI18n } from '../i18n';
30
30
  import { htmlIdGenerator, withEuiTheme } from '../../services';
31
31
  import { EuiButtonIcon } from '../button';
32
32
  import { euiAccordionButtonStyles, euiAccordionChildrenStyles, euiAccordionChildWrapperStyles, euiAccordionIconButtonStyles, euiAccordionOptionalActionStyles, euiAccordionSpinnerStyles, euiAccordionTriggerWrapperStyles } from './accordion.styles';
33
+ import { logicalCSS } from '../../global_styling';
33
34
  import { jsx as ___EmotionJSX } from "@emotion/react";
34
35
  var paddingSizeToClassNameMap = {
35
36
  none: '',
@@ -68,7 +69,7 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
68
69
  var forceState = _this.props.forceState;
69
70
  requestAnimationFrame(function () {
70
71
  var height = _this.childContent && (forceState ? forceState === 'open' : _this.state.isOpen) ? _this.childContent.clientHeight : 0;
71
- _this.childWrapper && _this.childWrapper.setAttribute('style', "height: ".concat(height, "px"));
72
+ _this.childWrapper && _this.childWrapper.setAttribute('style', logicalCSS('height', "".concat(height, "px")));
72
73
  });
73
74
  });
74
75
 
@@ -8,18 +8,18 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
8
8
  * Side Public License, v 1.
9
9
  */
10
10
  import { css } from '@emotion/react';
11
- import { euiFontSize } from '../../global_styling/mixins';
11
+ import { euiFontSize, logicals, logicalCSS, logicalTextAlignCSS } from '../../global_styling';
12
12
  export var euiAccordionButtonStyles = function euiAccordionButtonStyles(euiThemeContext) {
13
13
  var euiTheme = euiThemeContext.euiTheme;
14
14
  return {
15
- euiAccordion__button: /*#__PURE__*/css(euiFontSize(euiThemeContext, 's'), ";align-items:center;display:flex;flex-grow:1;line-height:", euiTheme.size.l, ";text-align:left;width:100%;&:hover,&:focus{cursor:pointer;text-decoration:underline;};label:euiAccordion__button;"),
15
+ euiAccordion__button: /*#__PURE__*/css(euiFontSize(euiThemeContext, 's'), ";align-items:center;display:flex;flex-grow:1;line-height:", euiTheme.size.l, ";", logicalTextAlignCSS('left'), " ", logicalCSS('width', '100%'), " &:hover,&:focus{cursor:pointer;text-decoration:underline;};label:euiAccordion__button;"),
16
16
  // Triggering button needs separate `disabled` key because the element that renders may not support `:disabled`;
17
17
  // Hover pseudo selector for specificity
18
18
  disabled: /*#__PURE__*/css("&,&:hover{cursor:not-allowed;color:", euiTheme.colors.disabledText, ";text-decoration:none;};label:disabled;")
19
19
  };
20
20
  };
21
21
 
22
- var _ref5 = process.env.NODE_ENV === "production" ? {
22
+ var _ref4 = process.env.NODE_ENV === "production" ? {
23
23
  name: "1xvjonu-isLoading",
24
24
  styles: "align-items:center;display:flex;label:isLoading;"
25
25
  } : {
@@ -28,11 +28,11 @@ var _ref5 = process.env.NODE_ENV === "production" ? {
28
28
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
29
29
  };
30
30
 
31
- export var euiAccordionChildrenStyles = function euiAccordionChildrenStyles(_ref6) {
32
- var euiTheme = _ref6.euiTheme;
31
+ export var euiAccordionChildrenStyles = function euiAccordionChildrenStyles(_ref5) {
32
+ var euiTheme = _ref5.euiTheme;
33
33
  return {
34
34
  euiAccordion__children: /*#__PURE__*/css(";label:euiAccordion__children;"),
35
- isLoading: _ref5,
35
+ isLoading: _ref4,
36
36
  xs: /*#__PURE__*/css("padding:", euiTheme.size.xs, ";;label:xs;"),
37
37
  s: /*#__PURE__*/css("padding:", euiTheme.size.s, ";;label:s;"),
38
38
  m: /*#__PURE__*/css("padding:", euiTheme.size.base, ";;label:m;"),
@@ -40,21 +40,11 @@ export var euiAccordionChildrenStyles = function euiAccordionChildrenStyles(_ref
40
40
  xl: /*#__PURE__*/css("padding:", euiTheme.size.xl, ";;label:xl;")
41
41
  };
42
42
  };
43
-
44
- var _ref4 = process.env.NODE_ENV === "production" ? {
45
- name: "xodlxj-isOpen",
46
- styles: "height:auto;opacity:1;visibility:visible;label:isOpen;"
47
- } : {
48
- name: "xodlxj-isOpen",
49
- styles: "height:auto;opacity:1;visibility:visible;label:isOpen;",
50
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__
51
- };
52
-
53
- export var euiAccordionChildWrapperStyles = function euiAccordionChildWrapperStyles(_ref7) {
54
- var euiTheme = _ref7.euiTheme;
43
+ export var euiAccordionChildWrapperStyles = function euiAccordionChildWrapperStyles(_ref6) {
44
+ var euiTheme = _ref6.euiTheme;
55
45
  return {
56
- euiAccordion__childWrapper: /*#__PURE__*/css("height:0;opacity:0;overflow:hidden;transition:height ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ",opacity ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";visibility:hidden;will-change:opacity,visibility,height;&:focus{outline:none;};label:euiAccordion__childWrapper;"),
57
- isOpen: _ref4
46
+ euiAccordion__childWrapper: /*#__PURE__*/css(logicalCSS('height', 0), " opacity:0;overflow:hidden;transition:", logicals.height, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ",opacity ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";visibility:hidden;will-change:opacity,visibility,", logicals.height, ";&:focus{outline:none;};label:euiAccordion__childWrapper;"),
47
+ isOpen: /*#__PURE__*/css(logicalCSS('height', 'auto'), " opacity:1;visibility:visible;;label:isOpen;")
58
48
  };
59
49
  };
60
50
 
@@ -67,12 +57,12 @@ var _ref3 = process.env.NODE_ENV === "production" ? {
67
57
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
68
58
  };
69
59
 
70
- export var euiAccordionIconButtonStyles = function euiAccordionIconButtonStyles(_ref8) {
71
- var euiTheme = _ref8.euiTheme;
60
+ export var euiAccordionIconButtonStyles = function euiAccordionIconButtonStyles(_ref7) {
61
+ var euiTheme = _ref7.euiTheme;
72
62
  return {
73
- euiAccordion__iconButton: /*#__PURE__*/css("flex-shrink:0;margin-inline-end:", euiTheme.size.xs, ";transform:rotate(0deg)!important;transform:rotate(0deg)!important;;label:euiAccordion__iconButton;"),
63
+ euiAccordion__iconButton: /*#__PURE__*/css("flex-shrink:0;", logicalCSS('margin-right', euiTheme.size.xs), " transform:rotate(0deg)!important;;label:euiAccordion__iconButton;"),
74
64
  isOpen: _ref3,
75
- arrowRight: /*#__PURE__*/css("margin-left:", euiTheme.size.xs, ";margin-right:0;;label:arrowRight;")
65
+ arrowRight: /*#__PURE__*/css(logicalCSS('margin-left', euiTheme.size.xs), " ", logicalCSS('margin-right', 0), ";;label:arrowRight;")
76
66
  };
77
67
  };
78
68
 
@@ -90,10 +80,10 @@ export var euiAccordionOptionalActionStyles = function euiAccordionOptionalActio
90
80
  euiAccordion__optionalAction: _ref2
91
81
  };
92
82
  };
93
- export var euiAccordionSpinnerStyles = function euiAccordionSpinnerStyles(_ref9) {
94
- var euiTheme = _ref9.euiTheme;
83
+ export var euiAccordionSpinnerStyles = function euiAccordionSpinnerStyles(_ref8) {
84
+ var euiTheme = _ref8.euiTheme;
95
85
  return {
96
- euiAccordion__spinner: /*#__PURE__*/css("margin-right:", euiTheme.size.xs, ";;label:euiAccordion__spinner;")
86
+ euiAccordion__spinner: /*#__PURE__*/css(logicalCSS('margin-right', euiTheme.size.xs), ";;label:euiAccordion__spinner;")
97
87
  };
98
88
  };
99
89
 
@@ -1,7 +1,7 @@
1
1
  import _typeof from "@babel/runtime/helpers/typeof";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _excluded = ["className", "label", "color", "tooltipContent", "tooltipPosition", "title", "iconType", "onClick", "onClickAriaLabel", "href", "rel", "target", "size"];
4
+ var _excluded = ["className", "label", "color", "tooltipContent", "tooltipPosition", "anchorProps", "title", "iconType", "onClick", "onClickAriaLabel", "href", "rel", "target", "size"];
5
5
 
6
6
  /*
7
7
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@@ -36,6 +36,7 @@ export var EuiBetaBadge = function EuiBetaBadge(_ref) {
36
36
  tooltipContent = _ref.tooltipContent,
37
37
  _ref$tooltipPosition = _ref.tooltipPosition,
38
38
  tooltipPosition = _ref$tooltipPosition === void 0 ? 'top' : _ref$tooltipPosition,
39
+ anchorProps = _ref.anchorProps,
39
40
  title = _ref.title,
40
41
  iconType = _ref.iconType,
41
42
  onClick = _ref.onClick,
@@ -101,7 +102,8 @@ export var EuiBetaBadge = function EuiBetaBadge(_ref) {
101
102
  return ___EmotionJSX(EuiToolTip, {
102
103
  position: tooltipPosition,
103
104
  content: tooltipContent,
104
- title: title || label
105
+ title: title || label,
106
+ anchorProps: anchorProps
105
107
  }, content);
106
108
  } else {
107
109
  return ___EmotionJSX(Fragment, null, content);
@@ -111,7 +113,8 @@ export var EuiBetaBadge = function EuiBetaBadge(_ref) {
111
113
  return ___EmotionJSX(EuiToolTip, {
112
114
  position: tooltipPosition,
113
115
  content: tooltipContent,
114
- title: title || label
116
+ title: title || label,
117
+ anchorProps: anchorProps
115
118
  }, ___EmotionJSX("span", _extends({
116
119
  tabIndex: 0,
117
120
  className: classes,
@@ -11,13 +11,13 @@ var _templateObject, _templateObject2;
11
11
  */
12
12
  import { keyframes, css } from '@emotion/react';
13
13
  import { euiPaletteColorBlind } from '../../services';
14
- import { euiCanAnimate } from '../../global_styling';
14
+ import { euiCanAnimate, logicalCSS, logicalSizeCSS } from '../../global_styling';
15
15
  var visColors = euiPaletteColorBlind();
16
16
  var euiBeaconPulseLarge = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n transform: scale(.1);\n opacity: 1;\n }\n\n 70% {\n transform: scale(3);\n opacity: 0;\n }\n\n 100% {\n opacity: 0;\n }\n"])));
17
17
  var euiBeaconPulseSmall = keyframes(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n 0% {\n transform: scale(.1);\n opacity: 1;\n }\n\n 70% {\n transform: scale(2);\n opacity: 0;\n }\n\n 100% {\n opacity: 0;\n }\n"])));
18
18
  export var euiBeaconStyles = function euiBeaconStyles() {
19
19
  return {
20
20
  // Base
21
- euiBeacon: /*#__PURE__*/css("position:relative;background-color:", visColors[0], ";border-radius:50%;&:before,&:after{position:absolute;content:'';height:100%;width:100%;inset-inline-start:0;inset-block-start:0;background-color:transparent;border-radius:50%;box-shadow:0 0 1px 1px ", visColors[0], ";}&:before{transform:scale(1.6);opacity:0.4;}&:after{opacity:0;}", euiCanAnimate, "{&:before{animation:", euiBeaconPulseLarge, " 2.5s infinite ease-out;}&:after{animation:", euiBeaconPulseSmall, " 2.5s infinite ease-out 0.25s;}};label:euiBeacon;")
21
+ euiBeacon: /*#__PURE__*/css("position:relative;background-color:", visColors[0], ";border-radius:50%;&:before,&:after{position:absolute;content:'';", logicalSizeCSS('100%', '100%'), " ", logicalCSS('left', 0), " ", logicalCSS('top', 0), " background-color:transparent;border-radius:50%;box-shadow:0 0 1px 1px ", visColors[0], ";}&:before{transform:scale(1.6);opacity:0.4;}&:after{opacity:0;}", euiCanAnimate, "{&:before{animation:", euiBeaconPulseLarge, " 2.5s infinite ease-out;}&:after{animation:", euiBeaconPulseSmall, " 2.5s infinite ease-out 0.25s;}};label:euiBeacon;")
22
22
  };
23
23
  };
@@ -1,8 +1,9 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _extends from "@babel/runtime/helpers/extends";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _excluded = ["isDisabled", "disabled", "href", "target", "rel", "type", "buttonRef"],
5
- _excluded2 = ["element", "baseClassName", "children", "className", "iconType", "iconSide", "color", "size", "fill", "isDisabled", "isLoading", "isSelected", "contentProps", "textProps", "fullWidth", "minWidth", "style"];
4
+ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
5
+ var _excluded = ["buttonRef", "color", "fill"],
6
+ _excluded2 = ["element", "baseClassName", "children", "className", "iconType", "iconSide", "color", "size", "isDisabled", "isLoading", "isSelected", "contentProps", "textProps", "fullWidth", "minWidth", "style"];
6
7
 
7
8
  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; }
8
9
 
@@ -17,87 +18,73 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
17
18
  */
18
19
  import React, { forwardRef } from 'react';
19
20
  import classNames from 'classnames';
20
- import { keysOf } from '../common';
21
- import { getSecureRelForTarget } from '../../services';
22
21
  import { EuiButtonContentDeprecated as EuiButtonContent } from './_button_content_deprecated';
23
- import { validateHref } from '../../services/security/href_validator';
22
+ import { BUTTON_COLORS, useEuiButtonColorCSS, useEuiButtonFocusCSS } from '../../themes/amsterdam/global_styling/mixins/button';
23
+ import { EuiButtonDisplay, isButtonDisabled } from './button_display/_button_display';
24
+ import { EuiThemeProvider } from '../../services';
24
25
  import { jsx as ___EmotionJSX } from "@emotion/react";
25
- export var colorToClassNameMap = {
26
- primary: '--primary',
27
- accent: '--accent',
28
- success: '--success',
29
- warning: '--warning',
30
- danger: '--danger',
31
- ghost: '--ghost',
32
- text: '--text'
33
- };
34
- export var COLORS = keysOf(colorToClassNameMap);
35
- export var sizeToClassNameMap = {
36
- s: '--small',
37
- m: null
38
- };
39
- export var SIZES = keysOf(sizeToClassNameMap);
40
- /**
41
- * Extends EuiButtonContentProps which provides
42
- * `iconType`, `iconSide`, and `textProps`
43
- */
26
+ export var COLORS = [].concat(_toConsumableArray(BUTTON_COLORS), ['ghost']);
27
+ export var SIZES = ['s', 'm'];
44
28
 
45
29
  /**
46
30
  * EuiButton is largely responsible for providing relevant props
47
31
  * and the logic for element-specific attributes
48
32
  */
49
- export var EuiButton = function EuiButton(_ref) {
50
- var _isDisabled = _ref.isDisabled,
51
- _disabled = _ref.disabled,
52
- href = _ref.href,
53
- target = _ref.target,
54
- rel = _ref.rel,
55
- _ref$type = _ref.type,
56
- type = _ref$type === void 0 ? 'button' : _ref$type,
57
- buttonRef = _ref.buttonRef,
58
- rest = _objectWithoutProperties(_ref, _excluded);
59
-
60
- var isHrefValid = !href || validateHref(href);
61
- var disabled = _disabled || !isHrefValid;
62
- var isDisabled = _isDisabled || !isHrefValid;
63
- var buttonIsDisabled = rest.isLoading || isDisabled || disabled;
64
- var element = href && !isDisabled ? 'a' : 'button';
65
- var elementProps = {}; // Props for all elements
66
-
67
- elementProps = _objectSpread(_objectSpread({}, elementProps), {}, {
68
- isDisabled: buttonIsDisabled
69
- }); // Element-specific attributes
70
-
71
- if (element === 'button') {
72
- elementProps = _objectSpread(_objectSpread({}, elementProps), {}, {
73
- disabled: buttonIsDisabled
74
- });
75
- }
76
-
77
- var relObj = {};
78
-
79
- if (href && !buttonIsDisabled) {
80
- relObj.href = href;
81
- relObj.rel = getSecureRelForTarget({
82
- href: href,
83
- target: target,
84
- rel: rel
85
- });
86
- relObj.target = target;
87
- } else {
88
- relObj.type = type;
33
+ export var EuiButton = function EuiButton(props) {
34
+ var buttonRef = props.buttonRef,
35
+ _props$color = props.color,
36
+ _color = _props$color === void 0 ? 'primary' : _props$color,
37
+ fill = props.fill,
38
+ rest = _objectWithoutProperties(props, _excluded);
39
+
40
+ var buttonIsDisabled = isButtonDisabled({
41
+ href: rest.href,
42
+ isDisabled: rest.isDisabled || rest.disabled,
43
+ isLoading: rest.isLoading
44
+ }); // eslint-disable-next-line no-nested-ternary
45
+
46
+ var color = buttonIsDisabled ? 'disabled' : _color;
47
+ var buttonColorStyles = useEuiButtonColorCSS({
48
+ display: fill ? 'fill' : 'base'
49
+ })[color === 'ghost' ? 'text' : color];
50
+ var buttonFocusStyle = useEuiButtonFocusCSS();
51
+ var cssStyles = [buttonColorStyles, buttonFocusStyle];
52
+
53
+ if (_color === 'ghost') {
54
+ // INCEPTION: If `ghost`, re-implement with a wrapping dark mode theme provider
55
+ return ___EmotionJSX(EuiThemeProvider, {
56
+ colorMode: "dark"
57
+ }, ___EmotionJSX(EuiButton, _extends({}, props, {
58
+ color: "text"
59
+ })));
89
60
  }
90
61
 
91
- return (// eslint-disable-next-line react/jsx-pascal-case
92
- ___EmotionJSX(EuiButtonDisplayDeprecated, _extends({
93
- element: element,
94
- baseClassName: "euiButton",
95
- ref: buttonRef
96
- }, elementProps, relObj, rest))
97
- );
62
+ return ___EmotionJSX(EuiButtonDisplay, _extends({
63
+ className: "euiButton",
64
+ ref: buttonRef,
65
+ css: cssStyles
66
+ }, rest));
98
67
  };
99
- EuiButton.displayName = 'EuiButton';
68
+ EuiButton.displayName = 'EuiButton'; // Use defaultProps for simple pass-through props
100
69
 
70
+ EuiButton.defaultProps = {
71
+ minWidth: 112,
72
+ size: 'm',
73
+ color: 'primary'
74
+ };
75
+ export var sizeToClassNameMap = {
76
+ s: '--small',
77
+ m: null
78
+ };
79
+ export var colorToClassNameMap = {
80
+ primary: '--primary',
81
+ accent: '--accent',
82
+ success: '--success',
83
+ warning: '--warning',
84
+ danger: '--danger',
85
+ ghost: '--ghost',
86
+ text: '--text'
87
+ };
101
88
  /**
102
89
  * *DEPRECATED*
103
90
  * EuiButtonDisplay is an internal-only component used for displaying
@@ -108,33 +95,34 @@ EuiButton.displayName = 'EuiButton';
108
95
  * This component has been deprecated in favor of the new EuiButtonDisplay
109
96
  * that can be found in `src/components/button/button_display/_button_display.tsx`
110
97
  */
111
- export var EuiButtonDisplayDeprecated = /*#__PURE__*/forwardRef(function (_ref2, ref) {
112
- var _ref2$element = _ref2.element,
113
- element = _ref2$element === void 0 ? 'button' : _ref2$element,
114
- baseClassName = _ref2.baseClassName,
115
- children = _ref2.children,
116
- className = _ref2.className,
117
- iconType = _ref2.iconType,
118
- _ref2$iconSide = _ref2.iconSide,
119
- iconSide = _ref2$iconSide === void 0 ? 'left' : _ref2$iconSide,
120
- _ref2$color = _ref2.color,
121
- color = _ref2$color === void 0 ? 'primary' : _ref2$color,
122
- _ref2$size = _ref2.size,
123
- size = _ref2$size === void 0 ? 'm' : _ref2$size,
124
- _ref2$fill = _ref2.fill,
125
- fill = _ref2$fill === void 0 ? false : _ref2$fill,
126
- isDisabled = _ref2.isDisabled,
127
- isLoading = _ref2.isLoading,
128
- isSelected = _ref2.isSelected,
129
- contentProps = _ref2.contentProps,
130
- textProps = _ref2.textProps,
131
- fullWidth = _ref2.fullWidth,
132
- minWidth = _ref2.minWidth,
133
- style = _ref2.style,
134
- rest = _objectWithoutProperties(_ref2, _excluded2);
135
-
136
- var buttonIsDisabled = isLoading || isDisabled;
137
- var classes = classNames(baseClassName, color && colorToClassNameMap[color] ? "".concat(baseClassName).concat(colorToClassNameMap[color]) : "".concat(baseClassName).concat(colorToClassNameMap.primary), size && sizeToClassNameMap[size] ? "".concat(baseClassName).concat(sizeToClassNameMap[size]) : null, fill && "".concat(baseClassName, "--fill"), fullWidth && "".concat(baseClassName, "--fullWidth"), buttonIsDisabled && "".concat(baseClassName, "-isDisabled"), className);
98
+
99
+ export var EuiButtonDisplayDeprecated = /*#__PURE__*/forwardRef(function (_ref, ref) {
100
+ var _ref$element = _ref.element,
101
+ element = _ref$element === void 0 ? 'button' : _ref$element,
102
+ baseClassName = _ref.baseClassName,
103
+ children = _ref.children,
104
+ className = _ref.className,
105
+ iconType = _ref.iconType,
106
+ _ref$iconSide = _ref.iconSide,
107
+ iconSide = _ref$iconSide === void 0 ? 'left' : _ref$iconSide,
108
+ color = _ref.color,
109
+ _ref$size = _ref.size,
110
+ size = _ref$size === void 0 ? 'm' : _ref$size,
111
+ isDisabled = _ref.isDisabled,
112
+ isLoading = _ref.isLoading,
113
+ isSelected = _ref.isSelected,
114
+ contentProps = _ref.contentProps,
115
+ textProps = _ref.textProps,
116
+ fullWidth = _ref.fullWidth,
117
+ minWidth = _ref.minWidth,
118
+ style = _ref.style,
119
+ rest = _objectWithoutProperties(_ref, _excluded2);
120
+
121
+ var buttonIsDisabled = isButtonDisabled({
122
+ isLoading: isLoading,
123
+ isDisabled: isDisabled
124
+ });
125
+ var classes = classNames(baseClassName, color && colorToClassNameMap[color] ? "".concat(baseClassName).concat(colorToClassNameMap[color]) : undefined, size && sizeToClassNameMap[size] ? "".concat(baseClassName).concat(sizeToClassNameMap[size]) : null, fullWidth && "".concat(baseClassName, "--fullWidth"), className);
138
126
  /**
139
127
  * Not changing the content or text class names to match baseClassName yet,
140
128
  * as it is a major breaking change.