@elastic/eui 64.0.1 → 65.0.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 (354) 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 +160 -1248
  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 +132 -1220
  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/super_date_picker/super_date_picker.js +17 -1
  47. package/es/components/date_picker/super_date_picker/super_update_button.js +11 -1
  48. package/es/components/expression/expression.styles.js +13 -31
  49. package/es/components/facet/facet_button.js +5 -4
  50. package/es/components/header/header_links/header_link.js +5 -3
  51. package/es/components/image/image_button.styles.js +1 -1
  52. package/es/components/image/image_wrapper.styles.js +3 -3
  53. package/es/components/link/link.styles.js +2 -2
  54. package/es/components/list_group/list_group.js +2 -1
  55. package/es/components/list_group/list_group_item.js +2 -1
  56. package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +3 -2
  57. package/es/components/loading/loading_chart.styles.js +16 -26
  58. package/es/components/loading/loading_content.styles.js +2 -2
  59. package/es/components/loading/loading_logo.styles.js +4 -4
  60. package/es/components/loading/loading_spinner.styles.js +6 -6
  61. package/es/components/markdown_editor/markdown_editor_toolbar.js +2 -0
  62. package/es/components/modal/confirm_modal.js +1 -1
  63. package/es/components/notification/notification_event.js +5 -3
  64. package/es/components/notification/notification_event_read_button.js +2 -1
  65. package/es/components/page/page_template.js +2 -2
  66. package/es/components/page_template/inner/page_inner.styles.js +2 -2
  67. package/es/components/page_template/outer/page_outer.styles.js +3 -1
  68. package/es/components/pagination/pagination_button.js +5 -3
  69. package/es/components/panel/panel.js +1 -1
  70. package/es/components/panel/{panel.style.js → panel.styles.js} +2 -2
  71. package/es/components/progress/progress.styles.js +2 -2
  72. package/es/components/title/title.styles.js +2 -2
  73. package/es/components/toast/toast.styles.js +4 -4
  74. package/es/components/tool_tip/icon_tip.js +11 -1
  75. package/es/components/tool_tip/tool_tip.js +18 -6
  76. package/es/global_styling/functions/logicals.js +2 -72
  77. package/es/global_styling/functions/typography.js +2 -1
  78. package/es/global_styling/mixins/_color.js +1 -1
  79. package/es/global_styling/mixins/_helpers.js +7 -1
  80. package/es/global_styling/reset/global_styles.js +2 -1
  81. package/es/themes/amsterdam/global_styling/mixins/button.js +165 -16
  82. package/eui.d.ts +1062 -936
  83. package/i18ntokens.json +15 -15
  84. package/lib/components/accessibility/screen_reader_only/screen_reader_only.styles.js +3 -1
  85. package/lib/components/accessibility/skip_link/skip_link.js +4 -54
  86. package/lib/components/accordion/accordion.js +3 -1
  87. package/lib/components/accordion/accordion.styles.js +17 -26
  88. package/lib/components/badge/beta_badge/beta_badge.js +16 -3
  89. package/lib/components/basic_table/basic_table.js +1 -1
  90. package/lib/components/basic_table/collapsed_item_actions.js +1 -1
  91. package/lib/components/basic_table/in_memory_table.js +1 -1
  92. package/lib/components/beacon/beacon.styles.js +1 -1
  93. package/lib/components/button/button.js +124 -229
  94. package/lib/components/button/button_display/_button_display.js +94 -33
  95. package/lib/components/button/button_display/_button_display.styles.js +7 -16
  96. package/lib/components/button/button_display/_button_display_content.js +7 -3
  97. package/lib/components/button/button_display/_button_display_content.styles.js +7 -17
  98. package/lib/components/button/button_empty/button_empty.js +64 -54
  99. package/lib/components/button/button_empty/index.js +0 -6
  100. package/lib/components/button/button_group/button_group.js +4 -12
  101. package/lib/components/button/button_group/button_group_button.js +15 -4
  102. package/lib/components/button/button_icon/button_icon.js +61 -43
  103. package/lib/components/call_out/call_out.styles.js +2 -1
  104. package/lib/components/card/card.js +174 -88
  105. package/lib/components/card/card.styles.js +146 -0
  106. package/lib/components/card/card_select/card_select.js +144 -0
  107. package/lib/components/card/card_select/card_select.styles.js +27 -0
  108. package/lib/components/card/card_select/index.js +19 -0
  109. package/lib/components/card/checkable_card/checkable_card.js +16 -9
  110. package/lib/components/card/checkable_card/checkable_card.styles.js +33 -0
  111. package/lib/components/comment_list/comment_event.styles.js +1 -1
  112. package/lib/components/datagrid/body/data_grid_body.js +7 -6
  113. package/lib/components/datagrid/body/data_grid_cell.js +13 -12
  114. package/lib/components/datagrid/body/header/data_grid_header_cell.js +7 -6
  115. package/lib/components/datagrid/body/header/data_grid_header_row.js +7 -6
  116. package/lib/components/datagrid/data_grid.js +7 -6
  117. package/lib/components/datagrid/utils/in_memory.js +7 -6
  118. package/lib/components/date_picker/auto_refresh/auto_refresh.js +3 -2
  119. package/lib/components/date_picker/super_date_picker/super_date_picker.js +17 -1
  120. package/lib/components/date_picker/super_date_picker/super_update_button.js +11 -1
  121. package/lib/components/expression/expression.styles.js +12 -30
  122. package/lib/components/facet/facet_button.js +4 -3
  123. package/lib/components/header/header_links/header_link.js +5 -3
  124. package/lib/components/image/image_button.styles.js +1 -1
  125. package/lib/components/image/image_wrapper.styles.js +2 -2
  126. package/lib/components/link/link.styles.js +1 -1
  127. package/lib/components/list_group/list_group.js +2 -1
  128. package/lib/components/list_group/list_group_item.js +2 -1
  129. package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +3 -2
  130. package/lib/components/loading/loading_chart.styles.js +16 -25
  131. package/lib/components/loading/loading_content.styles.js +1 -1
  132. package/lib/components/loading/loading_logo.styles.js +4 -4
  133. package/lib/components/loading/loading_spinner.styles.js +5 -5
  134. package/lib/components/markdown_editor/markdown_editor_toolbar.js +2 -0
  135. package/lib/components/modal/confirm_modal.js +1 -1
  136. package/lib/components/notification/notification_event.js +5 -3
  137. package/lib/components/notification/notification_event_read_button.js +2 -1
  138. package/lib/components/page/page_template.js +1 -1
  139. package/lib/components/page_template/inner/page_inner.styles.js +2 -2
  140. package/lib/components/page_template/outer/page_outer.styles.js +4 -1
  141. package/lib/components/panel/panel.js +1 -1
  142. package/{optimize/lib/components/panel/panel.style.js → lib/components/panel/panel.styles.js} +1 -1
  143. package/lib/components/progress/progress.styles.js +2 -2
  144. package/lib/components/title/title.styles.js +1 -1
  145. package/lib/components/toast/toast.styles.js +4 -4
  146. package/lib/components/tool_tip/icon_tip.js +11 -1
  147. package/lib/components/tool_tip/tool_tip.js +18 -6
  148. package/lib/global_styling/functions/logicals.js +3 -72
  149. package/lib/global_styling/functions/typography.js +3 -1
  150. package/lib/global_styling/mixins/_color.js +1 -1
  151. package/lib/global_styling/mixins/_helpers.js +9 -2
  152. package/lib/global_styling/reset/global_styles.js +3 -1
  153. package/lib/themes/amsterdam/global_styling/mixins/button.js +178 -24
  154. package/optimize/es/components/accessibility/screen_reader_only/screen_reader_only.styles.js +2 -1
  155. package/optimize/es/components/accordion/accordion.js +2 -1
  156. package/optimize/es/components/accordion/accordion.styles.js +17 -27
  157. package/optimize/es/components/badge/beta_badge/beta_badge.js +6 -3
  158. package/optimize/es/components/beacon/beacon.styles.js +2 -2
  159. package/optimize/es/components/button/button.js +88 -100
  160. package/optimize/es/components/button/button_display/_button_display.js +67 -32
  161. package/optimize/es/components/button/button_display/_button_display.styles.js +7 -16
  162. package/optimize/es/components/button/button_display/_button_display_content.js +5 -2
  163. package/optimize/es/components/button/button_display/_button_display_content.styles.js +7 -17
  164. package/optimize/es/components/button/button_empty/button_empty.js +55 -47
  165. package/optimize/es/components/button/button_empty/index.js +1 -1
  166. package/optimize/es/components/button/button_group/button_group.js +2 -10
  167. package/optimize/es/components/button/button_group/button_group_button.js +13 -3
  168. package/optimize/es/components/button/button_icon/button_icon.js +54 -41
  169. package/optimize/es/components/call_out/call_out.styles.js +2 -1
  170. package/optimize/es/components/card/card.js +97 -31
  171. package/optimize/es/components/card/card.styles.js +136 -0
  172. package/optimize/es/components/card/{card_select.js → card_select/card_select.js} +16 -14
  173. package/optimize/es/components/card/card_select/card_select.styles.js +25 -0
  174. package/optimize/es/components/card/card_select/index.js +8 -0
  175. package/optimize/es/components/card/checkable_card/checkable_card.js +14 -9
  176. package/optimize/es/components/card/checkable_card/checkable_card.styles.js +22 -0
  177. package/optimize/es/components/comment_list/comment_event.styles.js +1 -1
  178. package/optimize/es/components/expression/expression.styles.js +13 -31
  179. package/optimize/es/components/facet/facet_button.js +5 -3
  180. package/optimize/es/components/image/image_button.styles.js +1 -1
  181. package/optimize/es/components/image/image_wrapper.styles.js +3 -3
  182. package/optimize/es/components/link/link.styles.js +2 -2
  183. package/optimize/es/components/loading/loading_chart.styles.js +16 -26
  184. package/optimize/es/components/loading/loading_content.styles.js +2 -2
  185. package/optimize/es/components/loading/loading_logo.styles.js +4 -4
  186. package/optimize/es/components/loading/loading_spinner.styles.js +6 -6
  187. package/optimize/es/components/markdown_editor/markdown_editor_toolbar.js +2 -0
  188. package/optimize/es/components/page/page_template.js +2 -2
  189. package/optimize/es/components/page_template/inner/page_inner.styles.js +2 -2
  190. package/optimize/es/components/page_template/outer/page_outer.styles.js +3 -1
  191. package/optimize/es/components/panel/panel.js +1 -1
  192. package/optimize/es/components/panel/{panel.style.js → panel.styles.js} +2 -2
  193. package/optimize/es/components/progress/progress.styles.js +2 -2
  194. package/optimize/es/components/title/title.styles.js +2 -2
  195. package/optimize/es/components/toast/toast.styles.js +4 -4
  196. package/optimize/es/components/tool_tip/tool_tip.js +7 -5
  197. package/optimize/es/global_styling/functions/logicals.js +2 -72
  198. package/optimize/es/global_styling/functions/typography.js +2 -1
  199. package/optimize/es/global_styling/mixins/_color.js +1 -1
  200. package/optimize/es/global_styling/mixins/_helpers.js +7 -1
  201. package/optimize/es/global_styling/reset/global_styles.js +2 -1
  202. package/optimize/es/themes/amsterdam/global_styling/mixins/button.js +155 -16
  203. package/optimize/lib/components/accessibility/screen_reader_only/screen_reader_only.styles.js +3 -1
  204. package/optimize/lib/components/accordion/accordion.js +3 -1
  205. package/optimize/lib/components/accordion/accordion.styles.js +17 -26
  206. package/optimize/lib/components/badge/beta_badge/beta_badge.js +6 -3
  207. package/optimize/lib/components/beacon/beacon.styles.js +1 -1
  208. package/optimize/lib/components/button/button.js +92 -103
  209. package/optimize/lib/components/button/button_display/_button_display.js +71 -25
  210. package/optimize/lib/components/button/button_display/_button_display.styles.js +7 -16
  211. package/optimize/lib/components/button/button_display/_button_display_content.js +6 -2
  212. package/optimize/lib/components/button/button_display/_button_display_content.styles.js +7 -17
  213. package/optimize/lib/components/button/button_empty/button_empty.js +59 -50
  214. package/optimize/lib/components/button/button_empty/index.js +0 -6
  215. package/optimize/lib/components/button/button_group/button_group.js +2 -10
  216. package/optimize/lib/components/button/button_group/button_group_button.js +15 -3
  217. package/optimize/lib/components/button/button_icon/button_icon.js +54 -41
  218. package/optimize/lib/components/call_out/call_out.styles.js +2 -1
  219. package/optimize/lib/components/card/card.js +97 -30
  220. package/optimize/lib/components/card/card.styles.js +146 -0
  221. package/optimize/lib/components/card/{card_select.js → card_select/card_select.js} +16 -14
  222. package/optimize/lib/components/card/card_select/card_select.styles.js +27 -0
  223. package/optimize/lib/components/card/card_select/index.js +19 -0
  224. package/optimize/lib/components/card/checkable_card/checkable_card.js +16 -9
  225. package/optimize/lib/components/card/checkable_card/checkable_card.styles.js +33 -0
  226. package/optimize/lib/components/comment_list/comment_event.styles.js +1 -1
  227. package/optimize/lib/components/expression/expression.styles.js +12 -30
  228. package/optimize/lib/components/facet/facet_button.js +4 -2
  229. package/optimize/lib/components/image/image_button.styles.js +1 -1
  230. package/optimize/lib/components/image/image_wrapper.styles.js +2 -2
  231. package/optimize/lib/components/link/link.styles.js +1 -1
  232. package/optimize/lib/components/loading/loading_chart.styles.js +16 -25
  233. package/optimize/lib/components/loading/loading_content.styles.js +1 -1
  234. package/optimize/lib/components/loading/loading_logo.styles.js +4 -4
  235. package/optimize/lib/components/loading/loading_spinner.styles.js +5 -5
  236. package/optimize/lib/components/markdown_editor/markdown_editor_toolbar.js +2 -0
  237. package/optimize/lib/components/page/page_template.js +1 -1
  238. package/optimize/lib/components/page_template/inner/page_inner.styles.js +2 -2
  239. package/optimize/lib/components/page_template/outer/page_outer.styles.js +4 -1
  240. package/optimize/lib/components/panel/panel.js +1 -1
  241. package/{test-env/components/panel/panel.style.js → optimize/lib/components/panel/panel.styles.js} +1 -1
  242. package/optimize/lib/components/progress/progress.styles.js +2 -2
  243. package/optimize/lib/components/title/title.styles.js +1 -1
  244. package/optimize/lib/components/toast/toast.styles.js +4 -4
  245. package/optimize/lib/components/tool_tip/tool_tip.js +7 -5
  246. package/optimize/lib/global_styling/functions/logicals.js +10 -73
  247. package/optimize/lib/global_styling/functions/typography.js +3 -1
  248. package/optimize/lib/global_styling/mixins/_color.js +1 -1
  249. package/optimize/lib/global_styling/mixins/_helpers.js +9 -2
  250. package/optimize/lib/global_styling/reset/global_styles.js +3 -1
  251. package/optimize/lib/themes/amsterdam/global_styling/mixins/button.js +170 -17
  252. package/package.json +2 -2
  253. package/src/components/badge/beta_badge/_beta_badge.scss +5 -1
  254. package/src/components/button/_index.scss +0 -1
  255. package/src/components/button/button_empty/_button_empty.scss +4 -48
  256. package/src/components/button/button_group/_button_group.scss +0 -1
  257. package/src/components/button/button_group/_button_group_button.scss +55 -83
  258. package/src/components/button/button_icon/_button_icon.scss +3 -103
  259. package/src/components/control_bar/_control_bar.scss +2 -6
  260. package/src/components/flyout/_flyout.scss +4 -1
  261. package/src/components/index.scss +0 -1
  262. package/src/global_styling/mixins/_button.scss +55 -11
  263. package/src/global_styling/mixins/_index.scss +0 -1
  264. package/src/themes/amsterdam/global_styling/mixins/_index.scss +0 -2
  265. package/src/themes/amsterdam/overrides/_header.scss +0 -2
  266. package/src/themes/amsterdam/overrides/_index.scss +0 -4
  267. package/test-env/components/accessibility/screen_reader_only/screen_reader_only.styles.js +3 -1
  268. package/test-env/components/accessibility/skip_link/skip_link.js +4 -54
  269. package/test-env/components/accordion/accordion.js +3 -1
  270. package/test-env/components/accordion/accordion.styles.js +17 -26
  271. package/test-env/components/badge/beta_badge/beta_badge.js +16 -3
  272. package/test-env/components/basic_table/basic_table.js +1 -1
  273. package/test-env/components/basic_table/collapsed_item_actions.js +1 -1
  274. package/test-env/components/basic_table/in_memory_table.js +1 -1
  275. package/test-env/components/beacon/beacon.styles.js +1 -1
  276. package/test-env/components/button/button.js +111 -225
  277. package/test-env/components/button/button_display/_button_display.js +93 -32
  278. package/test-env/components/button/button_display/_button_display.styles.js +7 -16
  279. package/test-env/components/button/button_display/_button_display_content.js +7 -3
  280. package/test-env/components/button/button_display/_button_display_content.styles.js +7 -17
  281. package/test-env/components/button/button_empty/button_empty.js +64 -53
  282. package/test-env/components/button/button_empty/index.js +0 -6
  283. package/test-env/components/button/button_group/button_group.js +4 -12
  284. package/test-env/components/button/button_group/button_group_button.js +16 -4
  285. package/test-env/components/button/button_icon/button_icon.js +61 -42
  286. package/test-env/components/call_out/call_out.styles.js +2 -1
  287. package/test-env/components/card/card.js +172 -88
  288. package/test-env/components/card/card.styles.js +146 -0
  289. package/test-env/components/card/card_select/card_select.js +141 -0
  290. package/test-env/components/card/card_select/card_select.styles.js +27 -0
  291. package/test-env/components/card/card_select/index.js +19 -0
  292. package/test-env/components/card/checkable_card/checkable_card.js +16 -9
  293. package/test-env/components/card/checkable_card/checkable_card.styles.js +33 -0
  294. package/test-env/components/comment_list/comment_event.styles.js +1 -1
  295. package/test-env/components/datagrid/body/data_grid_body.js +7 -6
  296. package/test-env/components/datagrid/body/data_grid_cell.js +13 -12
  297. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +7 -6
  298. package/test-env/components/datagrid/body/header/data_grid_header_row.js +7 -6
  299. package/test-env/components/datagrid/data_grid.js +7 -6
  300. package/test-env/components/datagrid/utils/in_memory.js +7 -6
  301. package/test-env/components/date_picker/auto_refresh/auto_refresh.js +3 -2
  302. package/test-env/components/date_picker/super_date_picker/super_date_picker.js +17 -1
  303. package/test-env/components/date_picker/super_date_picker/super_update_button.js +11 -1
  304. package/test-env/components/expression/expression.styles.js +12 -30
  305. package/test-env/components/facet/facet_button.js +4 -3
  306. package/test-env/components/header/header_links/header_link.js +5 -3
  307. package/test-env/components/image/image_button.styles.js +1 -1
  308. package/test-env/components/image/image_wrapper.styles.js +2 -2
  309. package/test-env/components/link/link.styles.js +1 -1
  310. package/test-env/components/list_group/list_group.js +2 -1
  311. package/test-env/components/list_group/list_group_item.js +2 -1
  312. package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +3 -2
  313. package/test-env/components/loading/loading_chart.styles.js +16 -25
  314. package/test-env/components/loading/loading_content.styles.js +1 -1
  315. package/test-env/components/loading/loading_logo.styles.js +4 -4
  316. package/test-env/components/loading/loading_spinner.styles.js +5 -5
  317. package/test-env/components/markdown_editor/markdown_editor_toolbar.js +2 -0
  318. package/test-env/components/modal/confirm_modal.js +1 -1
  319. package/test-env/components/notification/notification_event.js +5 -3
  320. package/test-env/components/notification/notification_event_read_button.js +2 -1
  321. package/test-env/components/page/page_template.js +1 -1
  322. package/test-env/components/page_template/inner/page_inner.styles.js +2 -2
  323. package/test-env/components/page_template/outer/page_outer.styles.js +4 -1
  324. package/test-env/components/panel/panel.js +1 -1
  325. package/{lib/components/panel/panel.style.js → test-env/components/panel/panel.styles.js} +1 -1
  326. package/test-env/components/progress/progress.styles.js +2 -2
  327. package/test-env/components/title/title.styles.js +1 -1
  328. package/test-env/components/toast/toast.styles.js +4 -4
  329. package/test-env/components/tool_tip/icon_tip.js +11 -1
  330. package/test-env/components/tool_tip/tool_tip.js +18 -6
  331. package/test-env/global_styling/functions/logicals.js +10 -73
  332. package/test-env/global_styling/functions/typography.js +3 -1
  333. package/test-env/global_styling/mixins/_color.js +1 -1
  334. package/test-env/global_styling/mixins/_helpers.js +9 -2
  335. package/test-env/global_styling/reset/global_styles.js +3 -1
  336. package/test-env/themes/amsterdam/global_styling/mixins/button.js +170 -17
  337. package/es/components/card/card_select.js +0 -176
  338. package/lib/components/card/card_select.js +0 -187
  339. package/src/components/button/_button.scss +0 -143
  340. package/src/components/button/button_icon/_variables.scss +0 -11
  341. package/src/components/card/_card.scss +0 -239
  342. package/src/components/card/_card_select.scss +0 -21
  343. package/src/components/card/_index.scss +0 -5
  344. package/src/components/card/_mixins.scss +0 -11
  345. package/src/components/card/_variables.scss +0 -25
  346. package/src/components/card/checkable_card/_checkable_card.scss +0 -29
  347. package/src/components/card/checkable_card/_index.scss +0 -1
  348. package/src/global_styling/mixins/_beta_badge.scss +0 -30
  349. package/src/themes/amsterdam/global_styling/mixins/_button.scss +0 -60
  350. package/src/themes/amsterdam/overrides/_button.scss +0 -119
  351. package/src/themes/amsterdam/overrides/_button_empty.scss +0 -20
  352. package/src/themes/amsterdam/overrides/_button_group.scss +0 -91
  353. package/src/themes/amsterdam/overrides/_card.scss +0 -6
  354. package/test-env/components/card/card_select.js +0 -184
@@ -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.
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _excluded = ["element", "children", "iconType", "iconSide", "size", "isDisabled", "isLoading", "isSelected", "fullWidth", "minWidth", "contentProps", "textProps"];
4
+ var _excluded = ["children", "iconType", "iconSide", "size", "isDisabled", "disabled", "isLoading", "isSelected", "fullWidth", "minWidth", "contentProps", "textProps", "href", "target", "rel", "type"];
5
5
 
6
6
  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; }
7
7
 
@@ -17,43 +17,56 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
17
17
  import React, { forwardRef } from 'react'; // @ts-ignore module doesn't export `createElement`
18
18
 
19
19
  import { createElement } from '@emotion/react';
20
- import { useEuiTheme } from '../../../services';
20
+ import { getSecureRelForTarget, useEuiTheme } from '../../../services';
21
21
  import { euiButtonDisplayStyles } from './_button_display.styles';
22
22
  import { EuiButtonDisplayContent } from './_button_display_content';
23
- /**
24
- * Extends EuiButtonDisplayContentProps which provides
25
- * `iconType`, `iconSide`, and `textProps`
26
- */
27
-
23
+ import { validateHref } from '../../../services/security/href_validator';
24
+ import { useEuiButtonRadiusCSS } from '../../../themes/amsterdam/global_styling/mixins';
28
25
  import { jsx as ___EmotionJSX } from "@emotion/react";
29
-
26
+ var SIZES = ['xs', 's', 'm'];
27
+ export function isButtonDisabled(_ref) {
28
+ var href = _ref.href,
29
+ isDisabled = _ref.isDisabled,
30
+ isLoading = _ref.isLoading;
31
+ var isHrefValid = !href || validateHref(href);
32
+ return isLoading || isDisabled || !isHrefValid;
33
+ }
30
34
  /**
31
35
  * EuiButtonDisplay is an internal-only component used for displaying
32
36
  * any element as a button.
33
37
  */
34
- export var EuiButtonDisplay = /*#__PURE__*/forwardRef(function (_ref, ref) {
35
- var _ref$element = _ref.element,
36
- element = _ref$element === void 0 ? 'button' : _ref$element,
37
- children = _ref.children,
38
- iconType = _ref.iconType,
39
- iconSide = _ref.iconSide,
40
- _ref$size = _ref.size,
41
- size = _ref$size === void 0 ? 'm' : _ref$size,
42
- _ref$isDisabled = _ref.isDisabled,
43
- isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
44
- isLoading = _ref.isLoading,
45
- isSelected = _ref.isSelected,
46
- fullWidth = _ref.fullWidth,
47
- minWidth = _ref.minWidth,
48
- contentProps = _ref.contentProps,
49
- textProps = _ref.textProps,
50
- rest = _objectWithoutProperties(_ref, _excluded);
51
38
 
52
- var buttonIsDisabled = isLoading || isDisabled;
53
- var minWidthPx = minWidth === 'number' ? "".concat(minWidth, "px") : minWidth;
39
+ export var EuiButtonDisplay = /*#__PURE__*/forwardRef(function (_ref2, ref) {
40
+ var children = _ref2.children,
41
+ iconType = _ref2.iconType,
42
+ iconSide = _ref2.iconSide,
43
+ _ref2$size = _ref2.size,
44
+ size = _ref2$size === void 0 ? 'm' : _ref2$size,
45
+ isDisabled = _ref2.isDisabled,
46
+ disabled = _ref2.disabled,
47
+ isLoading = _ref2.isLoading,
48
+ isSelected = _ref2.isSelected,
49
+ fullWidth = _ref2.fullWidth,
50
+ minWidth = _ref2.minWidth,
51
+ contentProps = _ref2.contentProps,
52
+ textProps = _ref2.textProps,
53
+ href = _ref2.href,
54
+ target = _ref2.target,
55
+ rel = _ref2.rel,
56
+ _ref2$type = _ref2.type,
57
+ type = _ref2$type === void 0 ? 'button' : _ref2$type,
58
+ rest = _objectWithoutProperties(_ref2, _excluded);
59
+
60
+ var buttonIsDisabled = isButtonDisabled({
61
+ href: href,
62
+ isDisabled: isDisabled || disabled,
63
+ isLoading: isLoading
64
+ });
65
+ var minWidthPx = typeof minWidth === 'number' ? "".concat(minWidth, "px") : minWidth;
54
66
  var theme = useEuiTheme();
55
67
  var styles = euiButtonDisplayStyles(theme, minWidthPx);
56
- var cssStyles = [styles.euiButtonDisplay, styles[size], fullWidth && styles.fullWidth, isDisabled && styles.isDisabled];
68
+ var buttonRadiusStyle = useEuiButtonRadiusCSS()[size];
69
+ var cssStyles = [styles.euiButtonDisplay, styles[size], fullWidth && styles.fullWidth, buttonIsDisabled && styles.isDisabled, buttonRadiusStyle];
57
70
 
58
71
  var innerNode = ___EmotionJSX(EuiButtonDisplayContent, _extends({
59
72
  isLoading: isLoading,
@@ -63,11 +76,33 @@ export var EuiButtonDisplay = /*#__PURE__*/forwardRef(function (_ref, ref) {
63
76
  textProps: _objectSpread({}, textProps)
64
77
  }, contentProps), children);
65
78
 
66
- return createElement(element, _objectSpread({
79
+ var element = href && !buttonIsDisabled ? 'a' : 'button';
80
+ var elementProps = {}; // Element-specific attributes
81
+
82
+ if (element === 'button') {
83
+ elementProps = _objectSpread(_objectSpread({}, elementProps), {}, {
84
+ disabled: buttonIsDisabled,
85
+ 'aria-pressed': isSelected
86
+ });
87
+ }
88
+
89
+ var relObj = {};
90
+
91
+ if (href && !buttonIsDisabled) {
92
+ relObj.href = href;
93
+ relObj.rel = getSecureRelForTarget({
94
+ href: href,
95
+ target: target,
96
+ rel: rel
97
+ });
98
+ relObj.target = target;
99
+ } else {
100
+ relObj.type = type;
101
+ }
102
+
103
+ return createElement(element, _objectSpread(_objectSpread(_objectSpread({
67
104
  css: cssStyles,
68
- disabled: element === 'button' && buttonIsDisabled,
69
- 'aria-pressed': element === 'button' ? isSelected : undefined,
70
105
  ref: ref
71
- }, rest), innerNode);
106
+ }, elementProps), relObj), rest), innerNode);
72
107
  });
73
108
  EuiButtonDisplay.displayName = 'EuiButtonDisplay';
@@ -20,20 +20,11 @@ var _buttonSize = function _buttonSize(size) {
20
20
  };
21
21
 
22
22
  var _ref = process.env.NODE_ENV === "production" ? {
23
- name: "15xpz7k-fullWidth",
24
- styles: "display:block;width:100%;label:fullWidth;"
23
+ name: "vifhyf-isDisabled",
24
+ styles: "pointer-events:none;cursor:not-allowed;label:isDisabled;"
25
25
  } : {
26
- name: "15xpz7k-fullWidth",
27
- styles: "display:block;width:100%;label:fullWidth;",
28
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__
29
- };
30
-
31
- var _ref2 = process.env.NODE_ENV === "production" ? {
32
- name: "8595p9-isDisabled",
33
- styles: "cursor:not-allowed;label:isDisabled;"
34
- } : {
35
- name: "8595p9-isDisabled",
36
- styles: "cursor:not-allowed;label:isDisabled;",
26
+ name: "vifhyf-isDisabled",
27
+ styles: "pointer-events:none;cursor:not-allowed;label:isDisabled;",
37
28
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
38
29
  };
39
30
 
@@ -41,10 +32,10 @@ export var euiButtonDisplayStyles = function euiButtonDisplayStyles(euiThemeCont
41
32
  var euiTheme = euiThemeContext.euiTheme;
42
33
  return {
43
34
  // Base
44
- euiButtonDisplay: /*#__PURE__*/css(euiButtonBaseCSS(), ";", minWidth && logicalCSS('min-width', minWidth), ";;label:euiButtonDisplay;"),
35
+ euiButtonDisplay: /*#__PURE__*/css(euiButtonBaseCSS(), ";", minWidth && logicalCSS('min-width', minWidth), ";font-weight:", euiTheme.font.weight.medium, ";padding:0 ", euiTheme.size.m, ";&:hover:not(:disabled),&:focus{text-decoration:underline;};label:euiButtonDisplay;"),
45
36
  // States
46
- isDisabled: _ref2,
47
- fullWidth: _ref,
37
+ isDisabled: _ref,
38
+ fullWidth: /*#__PURE__*/css("display:block;", logicalCSS('width', '100%'), ";;label:fullWidth;"),
48
39
  // Sizes
49
40
  xs: /*#__PURE__*/css(_buttonSize(euiTheme.size.l), euiFontSize(euiThemeContext, 'xs'), ";label:xs;"),
50
41
  s: /*#__PURE__*/css(_buttonSize(euiTheme.size.xl), euiFontSize(euiThemeContext, 's'), ";label:s;"),
@@ -14,6 +14,7 @@ import { useEuiTheme } from '../../../services';
14
14
  import { EuiLoadingSpinner } from '../../loading';
15
15
  import { EuiIcon } from '../../icon';
16
16
  import { euiButtonDisplayContentStyles } from './_button_display_content.styles';
17
+ import classNames from 'classnames';
17
18
  import { jsx as ___EmotionJSX } from "@emotion/react";
18
19
  export var EuiButtonDisplayContent = function EuiButtonDisplayContent(_ref) {
19
20
  var children = _ref.children,
@@ -30,7 +31,7 @@ export var EuiButtonDisplayContent = function EuiButtonDisplayContent(_ref) {
30
31
 
31
32
  var theme = useEuiTheme();
32
33
  var styles = euiButtonDisplayContentStyles(theme);
33
- var cssStyles = [styles.euiButtonDisplayContent, iconSide && styles[iconSide], isDisabled && styles.isDisabled];
34
+ var cssStyles = [styles.euiButtonDisplayContent, iconSide && styles[iconSide]];
34
35
  var cssSpinnerStyles = [styles.euiButtonDisplayContent__spinner];
35
36
  var cssIconStyles = [styles.euiButtonDisplayContent__icon]; // Add an icon to the button if one exists.
36
37
 
@@ -63,5 +64,7 @@ export var EuiButtonDisplayContent = function EuiButtonDisplayContent(_ref) {
63
64
  var isText = typeof children === 'string';
64
65
  return ___EmotionJSX("span", _extends({}, contentProps, {
65
66
  css: cssStyles
66
- }), icon, isText ? ___EmotionJSX("span", textProps, children) : children);
67
+ }), icon, isText ? ___EmotionJSX("span", _extends({}, textProps, {
68
+ className: classNames('eui-textTruncate', textProps === null || textProps === void 0 ? void 0 : textProps.className)
69
+ }), children) : children);
67
70
  };
@@ -11,15 +11,6 @@ import { css } from '@emotion/react';
11
11
  import { logicalCSS } from '../../../global_styling';
12
12
 
13
13
  var _ref = process.env.NODE_ENV === "production" ? {
14
- name: "ske5nx-isDisabled",
15
- styles: "pointer-events:auto;cursor:not-allowed;label:isDisabled;"
16
- } : {
17
- name: "ske5nx-isDisabled",
18
- styles: "pointer-events:auto;cursor:not-allowed;label:isDisabled;",
19
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__
20
- };
21
-
22
- var _ref2 = process.env.NODE_ENV === "production" ? {
23
14
  name: "gtg6j-euiButtonDisplayContent__icon",
24
15
  styles: "flex-shrink:0;label:euiButtonDisplayContent__icon;"
25
16
  } : {
@@ -28,7 +19,7 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
28
19
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
29
20
  };
30
21
 
31
- var _ref3 = process.env.NODE_ENV === "production" ? {
22
+ var _ref2 = process.env.NODE_ENV === "production" ? {
32
23
  name: "10wlo76-euiButtonDisplayContent__spinner",
33
24
  styles: "flex-shrink:0;label:euiButtonDisplayContent__spinner;"
34
25
  } : {
@@ -37,7 +28,7 @@ var _ref3 = process.env.NODE_ENV === "production" ? {
37
28
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
38
29
  };
39
30
 
40
- var _ref4 = process.env.NODE_ENV === "production" ? {
31
+ var _ref3 = process.env.NODE_ENV === "production" ? {
41
32
  name: "qfl6yj-right",
42
33
  styles: "flex-direction:row-reverse;label:right;"
43
34
  } : {
@@ -46,16 +37,15 @@ var _ref4 = process.env.NODE_ENV === "production" ? {
46
37
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
47
38
  };
48
39
 
49
- export var euiButtonDisplayContentStyles = function euiButtonDisplayContentStyles(_ref5) {
50
- var euiTheme = _ref5.euiTheme;
40
+ export var euiButtonDisplayContentStyles = function euiButtonDisplayContentStyles(_ref4) {
41
+ var euiTheme = _ref4.euiTheme;
51
42
  return {
52
43
  // Base
53
44
  euiButtonDisplayContent: /*#__PURE__*/css(logicalCSS('height', '100%'), ";", logicalCSS('width', '100%'), ";display:flex;justify-content:center;align-items:center;vertical-align:middle;gap:", euiTheme.size.s, ";;label:euiButtonDisplayContent;"),
54
45
  // Icon side
55
46
  left: /*#__PURE__*/css(";label:left;"),
56
- right: _ref4,
57
- euiButtonDisplayContent__spinner: _ref3,
58
- euiButtonDisplayContent__icon: _ref2,
59
- isDisabled: _ref
47
+ right: _ref3,
48
+ euiButtonDisplayContent__spinner: _ref2,
49
+ euiButtonDisplayContent__icon: _ref
60
50
  };
61
51
  };
@@ -1,5 +1,5 @@
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
4
  var _excluded = ["children", "className", "iconType", "iconSide", "iconSize", "color", "size", "flush", "isDisabled", "disabled", "isLoading", "href", "target", "rel", "type", "buttonRef", "contentProps", "textProps", "isSelected"];
5
5
 
@@ -17,19 +17,11 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
17
17
  import React from 'react';
18
18
  import classNames from 'classnames';
19
19
  import { keysOf } from '../../common';
20
- import { getSecureRelForTarget } from '../../../services';
20
+ import { EuiThemeProvider, getSecureRelForTarget } from '../../../services';
21
21
  import { EuiButtonContentDeprecated as EuiButtonContent } from '../_button_content_deprecated';
22
- import { validateHref } from '../../../services/security/href_validator';
22
+ import { useEuiButtonColorCSS } from '../../../themes/amsterdam/global_styling/mixins/button';
23
+ import { isButtonDisabled } from '../button_display/_button_display';
23
24
  import { jsx as ___EmotionJSX } from "@emotion/react";
24
- var colorToClassNameMap = {
25
- primary: 'euiButtonEmpty--primary',
26
- danger: 'euiButtonEmpty--danger',
27
- text: 'euiButtonEmpty--text',
28
- ghost: 'euiButtonEmpty--ghost',
29
- success: 'euiButtonEmpty--success',
30
- warning: 'euiButtonEmpty--warning'
31
- };
32
- export var COLORS = keysOf(colorToClassNameMap);
33
25
  var sizeToClassNameMap = {
34
26
  xs: 'euiButtonEmpty--xSmall',
35
27
  s: 'euiButtonEmpty--small',
@@ -47,43 +39,57 @@ export var FLUSH_TYPES = keysOf(flushTypeToClassNameMap);
47
39
  * `iconType`, `iconSide`, and `textProps`
48
40
  */
49
41
 
50
- export var EuiButtonEmpty = function EuiButtonEmpty(_ref) {
51
- var children = _ref.children,
52
- className = _ref.className,
53
- iconType = _ref.iconType,
54
- _ref$iconSide = _ref.iconSide,
55
- iconSide = _ref$iconSide === void 0 ? 'left' : _ref$iconSide,
56
- _ref$iconSize = _ref.iconSize,
57
- iconSize = _ref$iconSize === void 0 ? 'm' : _ref$iconSize,
58
- _ref$color = _ref.color,
59
- color = _ref$color === void 0 ? 'primary' : _ref$color,
60
- _ref$size = _ref.size,
61
- size = _ref$size === void 0 ? 'm' : _ref$size,
62
- flush = _ref.flush,
63
- _isDisabled = _ref.isDisabled,
64
- _disabled = _ref.disabled,
65
- isLoading = _ref.isLoading,
66
- href = _ref.href,
67
- target = _ref.target,
68
- rel = _ref.rel,
69
- _ref$type = _ref.type,
70
- type = _ref$type === void 0 ? 'button' : _ref$type,
71
- buttonRef = _ref.buttonRef,
72
- contentProps = _ref.contentProps,
73
- textProps = _ref.textProps,
74
- isSelected = _ref.isSelected,
75
- rest = _objectWithoutProperties(_ref, _excluded);
42
+ export var EuiButtonEmpty = function EuiButtonEmpty(props) {
43
+ var children = props.children,
44
+ className = props.className,
45
+ iconType = props.iconType,
46
+ _props$iconSide = props.iconSide,
47
+ iconSide = _props$iconSide === void 0 ? 'left' : _props$iconSide,
48
+ _props$iconSize = props.iconSize,
49
+ iconSize = _props$iconSize === void 0 ? 'm' : _props$iconSize,
50
+ _props$color = props.color,
51
+ _color = _props$color === void 0 ? 'primary' : _props$color,
52
+ _props$size = props.size,
53
+ size = _props$size === void 0 ? 'm' : _props$size,
54
+ flush = props.flush,
55
+ _isDisabled = props.isDisabled,
56
+ disabled = props.disabled,
57
+ isLoading = props.isLoading,
58
+ href = props.href,
59
+ target = props.target,
60
+ rel = props.rel,
61
+ _props$type = props.type,
62
+ type = _props$type === void 0 ? 'button' : _props$type,
63
+ buttonRef = props.buttonRef,
64
+ contentProps = props.contentProps,
65
+ textProps = props.textProps,
66
+ isSelected = props.isSelected,
67
+ rest = _objectWithoutProperties(props, _excluded);
76
68
 
77
- var isHrefValid = !href || validateHref(href);
78
- var disabled = _disabled || !isHrefValid;
79
- var isDisabled = _isDisabled || !isHrefValid; // If in the loading state, force disabled to true
69
+ var isDisabled = isButtonDisabled({
70
+ isDisabled: _isDisabled || disabled,
71
+ href: href,
72
+ isLoading: isLoading
73
+ }); // eslint-disable-next-line no-nested-ternary
74
+
75
+ var color = isDisabled ? 'disabled' : _color === 'ghost' ? 'text' : _color;
76
+ var buttonColorStyles = useEuiButtonColorCSS({
77
+ display: 'empty'
78
+ })[color];
79
+
80
+ if (_color === 'ghost') {
81
+ // INCEPTION: If `ghost`, re-implement with a wrapping dark mode theme provider
82
+ return ___EmotionJSX(EuiThemeProvider, {
83
+ colorMode: "dark"
84
+ }, ___EmotionJSX(EuiButtonEmpty, _extends({}, props, {
85
+ color: "text"
86
+ })));
87
+ }
80
88
 
81
- var buttonIsDisabled = isLoading || isDisabled || disabled;
82
- var classes = classNames('euiButtonEmpty', colorToClassNameMap[color], size ? sizeToClassNameMap[size] : null, flush ? flushTypeToClassNameMap[flush] : null, {
83
- 'euiButtonEmpty-isDisabled': buttonIsDisabled
84
- }, className);
89
+ var classes = classNames('euiButtonEmpty', size ? sizeToClassNameMap[size] : null, flush ? flushTypeToClassNameMap[flush] : null, className);
85
90
  var contentClassNames = classNames('euiButtonEmpty__content', contentProps && contentProps.className);
86
91
  var textClassNames = classNames('euiButtonEmpty__text', textProps && textProps.className);
92
+ var cssStyles = [buttonColorStyles];
87
93
 
88
94
  var innerNode = ___EmotionJSX(EuiButtonContent, _extends({
89
95
  isLoading: isLoading,
@@ -100,7 +106,7 @@ export var EuiButtonEmpty = function EuiButtonEmpty(_ref) {
100
106
  // this is a button and piggyback off its disabled styles.
101
107
 
102
108
 
103
- if (href && !buttonIsDisabled) {
109
+ if (href && !isDisabled) {
104
110
  var secureRel = getSecureRelForTarget({
105
111
  href: href,
106
112
  target: target,
@@ -108,6 +114,7 @@ export var EuiButtonEmpty = function EuiButtonEmpty(_ref) {
108
114
  });
109
115
  return ___EmotionJSX("a", _extends({
110
116
  className: classes,
117
+ css: cssStyles,
111
118
  href: href,
112
119
  target: target,
113
120
  rel: secureRel,
@@ -116,8 +123,9 @@ export var EuiButtonEmpty = function EuiButtonEmpty(_ref) {
116
123
  }
117
124
 
118
125
  return ___EmotionJSX("button", _extends({
119
- disabled: buttonIsDisabled,
126
+ disabled: isDisabled,
120
127
  className: classes,
128
+ css: cssStyles,
121
129
  type: type,
122
130
  ref: buttonRef,
123
131
  "aria-pressed": isSelected
@@ -5,4 +5,4 @@
5
5
  * in compliance with, at your election, the Elastic License 2.0 or the Server
6
6
  * Side Public License, v 1.
7
7
  */
8
- export { COLORS, EuiButtonEmpty } from './button_empty';
8
+ export { EuiButtonEmpty } from './button_empty';