@elastic/eui 97.1.0 → 97.3.0-borealis.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 (517) hide show
  1. package/es/components/badge/badge.js +1 -1
  2. package/es/components/badge/badge.styles.js +2 -2
  3. package/es/components/badge/beta_badge/beta_badge.js +1 -1
  4. package/es/components/badge/beta_badge/beta_badge.styles.js +1 -0
  5. package/es/components/badge/color_utils.js +8 -7
  6. package/es/components/badge/notification_badge/badge_notification.js +1 -1
  7. package/es/components/badge/notification_badge/badge_notification.styles.js +1 -0
  8. package/es/components/bottom_bar/bottom_bar.styles.js +1 -2
  9. package/es/components/breadcrumbs/_breadcrumb_content.styles.js +4 -6
  10. package/es/components/button/button.js +1 -1
  11. package/es/components/button/button_display/_button_display.styles.js +1 -1
  12. package/es/components/button/button_empty/button_empty.js +1 -1
  13. package/es/components/button/button_group/button_group_button.js +1 -1
  14. package/es/components/button/button_group/button_group_button.styles.js +4 -4
  15. package/es/components/button/button_icon/button_icon.js +1 -1
  16. package/es/components/card/card.styles.js +1 -1
  17. package/es/components/code/code_block_annotations.js +1 -1
  18. package/es/components/code/code_block_line.styles.js +1 -2
  19. package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.styles.js +3 -5
  20. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +1 -1
  21. package/es/components/color_picker/color_palette_display/color_palette_display.styles.js +1 -2
  22. package/es/components/color_picker/color_picker.styles.js +1 -2
  23. package/es/components/color_picker/color_picker_swatch.styles.js +1 -1
  24. package/es/components/combo_box/combo_box.js +9 -6
  25. package/es/components/common.js +0 -28
  26. package/es/components/context_menu/context_menu_panel.js +17 -1
  27. package/es/components/datagrid/body/cell/data_grid_cell.js +31 -8
  28. package/es/components/datagrid/body/data_grid_body.js +8 -0
  29. package/es/components/datagrid/body/data_grid_body_custom.js +8 -1
  30. package/es/components/datagrid/body/data_grid_body_virtualized.js +8 -1
  31. package/es/components/datagrid/controls/data_grid_toolbar.styles.js +2 -2
  32. package/es/components/datagrid/controls/display_selector.js +277 -207
  33. package/es/components/datagrid/data_grid.stories.utils.js +28 -2
  34. package/es/components/datagrid/data_grid.styles.js +4 -6
  35. package/es/components/datagrid/utils/col_widths.js +7 -13
  36. package/es/components/datagrid/utils/grid_height_width.js +1 -1
  37. package/es/components/datagrid/utils/row_heights.js +29 -13
  38. package/es/components/date_picker/react_date_picker.styles.js +2 -1
  39. package/es/components/date_picker/super_date_picker/super_date_picker.styles.js +3 -4
  40. package/es/components/drag_and_drop/droppable.styles.js +2 -4
  41. package/es/components/empty_prompt/empty_prompt.styles.js +5 -2
  42. package/es/components/filter_group/filter_select_item.styles.js +1 -2
  43. package/es/components/flyout/_flyout_close_button.styles.js +1 -2
  44. package/es/components/form/form.styles.js +21 -28
  45. package/es/components/form/range/range_tooltip.styles.js +3 -7
  46. package/es/components/form/switch/switch.js +3 -7
  47. package/es/components/form/switch/switch.styles.js +16 -19
  48. package/es/components/header/header.styles.js +12 -6
  49. package/es/components/header/header_links/header_links.js +1 -1
  50. package/es/components/header/header_links/header_links.styles.js +1 -0
  51. package/es/components/icon/icon.styles.js +9 -8
  52. package/es/components/icon/named_colors.js +1 -1
  53. package/es/components/inline_edit/inline_edit_form.styles.js +1 -2
  54. package/es/components/key_pad_menu/key_pad_menu_item.styles.js +1 -2
  55. package/es/components/list_group/list_group_item.styles.js +9 -11
  56. package/es/components/mark/mark.styles.js +2 -9
  57. package/es/components/markdown_editor/markdown_editor_drop_zone.styles.js +2 -3
  58. package/es/components/markdown_editor/markdown_format.styles.js +2 -2
  59. package/es/components/overlay_mask/overlay_mask.styles.js +1 -2
  60. package/es/components/page_template/inner/page_inner.styles.js +2 -2
  61. package/es/components/popover/popover_footer.styles.js +1 -1
  62. package/es/components/popover/popover_panel/_popover_panel.styles.js +3 -4
  63. package/es/components/progress/progress.js +1 -1
  64. package/es/components/progress/progress.styles.js +8 -6
  65. package/es/components/selectable/selectable_list/selectable_list_item.styles.js +1 -2
  66. package/es/components/side_nav/side_nav_item.styles.js +1 -2
  67. package/es/components/skeleton/utils.js +3 -5
  68. package/es/components/steps/step_number.styles.js +1 -1
  69. package/es/components/table/table_cells_shared.styles.js +2 -7
  70. package/es/components/table/table_row.styles.js +8 -10
  71. package/es/components/text/text.styles.js +2 -2
  72. package/es/components/text/text_color.js +1 -1
  73. package/es/components/text/text_color.styles.js +6 -5
  74. package/es/components/tool_tip/tool_tip.styles.js +8 -10
  75. package/es/components/tour/_tour_footer.styles.js +2 -4
  76. package/es/components/tree_view/tree_view_item.styles.js +1 -2
  77. package/es/global_styling/functions/size.js +1 -17
  78. package/es/global_styling/mixins/_button.js +159 -0
  79. package/es/global_styling/mixins/_color.js +40 -31
  80. package/es/global_styling/mixins/index.js +2 -1
  81. package/es/global_styling/reset/global_styles.js +2 -2
  82. package/es/global_styling/variables/_colors_vis.js +1 -53
  83. package/es/global_styling/variables/animations.js +1 -22
  84. package/es/global_styling/variables/breakpoint.js +1 -7
  85. package/es/global_styling/variables/levels.js +1 -17
  86. package/es/global_styling/variables/shadow.js +1 -11
  87. package/es/global_styling/variables/size.js +1 -1
  88. package/es/global_styling/variables/typography.js +1 -32
  89. package/es/services/hooks/useDeepEqual.js +18 -6
  90. package/es/services/theme/provider.js +11 -0
  91. package/es/services/theme/types.js +1 -6
  92. package/es/services/theme/utils.js +1 -303
  93. package/es/themes/amsterdam/global_styling/mixins/button.js +1 -203
  94. package/es/themes/amsterdam/global_styling/variables/_buttons.js +281 -0
  95. package/es/themes/amsterdam/global_styling/variables/_colors.js +587 -18
  96. package/es/themes/amsterdam/global_styling/variables/_components.js +442 -0
  97. package/es/themes/amsterdam/global_styling/variables/_forms.js +149 -0
  98. package/es/themes/amsterdam/theme.js +3 -1
  99. package/es/themes/index.js +1 -1
  100. package/es/themes/themes.js +7 -0
  101. package/eui.d.ts +2121 -2627
  102. package/i18ntokens.json +92 -110
  103. package/lib/components/badge/badge.js +1 -1
  104. package/lib/components/badge/badge.styles.js +2 -2
  105. package/lib/components/badge/beta_badge/beta_badge.js +1 -1
  106. package/lib/components/badge/beta_badge/beta_badge.styles.js +1 -0
  107. package/lib/components/badge/color_utils.js +13 -12
  108. package/lib/components/badge/notification_badge/badge_notification.js +1 -1
  109. package/lib/components/badge/notification_badge/badge_notification.styles.js +1 -0
  110. package/lib/components/bottom_bar/bottom_bar.styles.js +1 -2
  111. package/lib/components/breadcrumbs/_breadcrumb_content.styles.js +4 -6
  112. package/lib/components/button/button.js +1 -1
  113. package/lib/components/button/button_display/_button_display.styles.js +1 -1
  114. package/lib/components/button/button_empty/button_empty.js +1 -1
  115. package/lib/components/button/button_group/button_group_button.js +1 -1
  116. package/lib/components/button/button_group/button_group_button.styles.js +3 -3
  117. package/lib/components/button/button_icon/button_icon.js +1 -1
  118. package/lib/components/card/card.styles.js +1 -1
  119. package/lib/components/code/code_block_annotations.js +1 -1
  120. package/lib/components/code/code_block_line.styles.js +1 -2
  121. package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.styles.js +3 -5
  122. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +1 -1
  123. package/lib/components/color_picker/color_palette_display/color_palette_display.styles.js +1 -2
  124. package/lib/components/color_picker/color_picker.styles.js +1 -2
  125. package/lib/components/color_picker/color_picker_swatch.styles.js +1 -1
  126. package/lib/components/combo_box/combo_box.js +9 -6
  127. package/lib/components/common.js +0 -28
  128. package/lib/components/context_menu/context_menu_panel.js +17 -1
  129. package/lib/components/datagrid/body/cell/data_grid_cell.js +31 -8
  130. package/lib/components/datagrid/body/data_grid_body.js +8 -0
  131. package/lib/components/datagrid/body/data_grid_body_custom.js +8 -1
  132. package/lib/components/datagrid/body/data_grid_body_virtualized.js +8 -1
  133. package/lib/components/datagrid/controls/data_grid_toolbar.styles.js +2 -2
  134. package/lib/components/datagrid/controls/display_selector.js +275 -204
  135. package/lib/components/datagrid/data_grid.stories.utils.js +28 -2
  136. package/lib/components/datagrid/data_grid.styles.js +4 -6
  137. package/lib/components/datagrid/utils/col_widths.js +7 -13
  138. package/lib/components/datagrid/utils/grid_height_width.js +1 -1
  139. package/lib/components/datagrid/utils/row_heights.js +29 -13
  140. package/lib/components/date_picker/react_date_picker.styles.js +3 -2
  141. package/lib/components/date_picker/super_date_picker/super_date_picker.styles.js +2 -3
  142. package/lib/components/drag_and_drop/droppable.styles.js +2 -4
  143. package/lib/components/empty_prompt/empty_prompt.styles.js +4 -1
  144. package/lib/components/filter_group/filter_select_item.styles.js +1 -2
  145. package/lib/components/flyout/_flyout_close_button.styles.js +1 -2
  146. package/lib/components/form/form.styles.js +20 -27
  147. package/lib/components/form/range/range_tooltip.styles.js +3 -7
  148. package/lib/components/form/switch/switch.js +3 -7
  149. package/lib/components/form/switch/switch.styles.js +16 -19
  150. package/lib/components/header/header.styles.js +11 -5
  151. package/lib/components/header/header_links/header_links.js +1 -1
  152. package/lib/components/header/header_links/header_links.styles.js +1 -0
  153. package/lib/components/icon/icon.styles.js +9 -8
  154. package/lib/components/icon/named_colors.js +1 -1
  155. package/lib/components/inline_edit/inline_edit_form.styles.js +1 -2
  156. package/lib/components/key_pad_menu/key_pad_menu_item.styles.js +1 -2
  157. package/lib/components/list_group/list_group_item.styles.js +8 -10
  158. package/lib/components/mark/mark.styles.js +2 -9
  159. package/lib/components/markdown_editor/markdown_editor_drop_zone.styles.js +2 -3
  160. package/lib/components/markdown_editor/markdown_format.styles.js +2 -2
  161. package/lib/components/overlay_mask/overlay_mask.styles.js +1 -2
  162. package/lib/components/page_template/inner/page_inner.styles.js +1 -1
  163. package/lib/components/popover/popover_footer.styles.js +1 -1
  164. package/lib/components/popover/popover_panel/_popover_panel.styles.js +3 -4
  165. package/lib/components/progress/progress.js +1 -1
  166. package/lib/components/progress/progress.styles.js +8 -6
  167. package/lib/components/selectable/selectable_list/selectable_list_item.styles.js +1 -2
  168. package/lib/components/side_nav/side_nav_item.styles.js +1 -2
  169. package/lib/components/skeleton/utils.js +3 -5
  170. package/lib/components/steps/step_number.styles.js +1 -1
  171. package/lib/components/table/table_cells_shared.styles.js +2 -7
  172. package/lib/components/table/table_row.styles.js +7 -9
  173. package/lib/components/text/text.styles.js +1 -1
  174. package/lib/components/text/text_color.js +1 -1
  175. package/lib/components/text/text_color.styles.js +6 -5
  176. package/lib/components/tool_tip/tool_tip.styles.js +8 -10
  177. package/lib/components/tour/_tour_footer.styles.js +2 -4
  178. package/lib/components/tree_view/tree_view_item.styles.js +1 -2
  179. package/lib/global_styling/functions/size.js +7 -26
  180. package/lib/global_styling/mixins/_button.js +164 -0
  181. package/lib/global_styling/mixins/_color.js +39 -30
  182. package/lib/global_styling/mixins/index.js +11 -0
  183. package/lib/global_styling/reset/global_styles.js +1 -1
  184. package/lib/global_styling/variables/_colors_vis.js +6 -61
  185. package/lib/global_styling/variables/animations.js +25 -31
  186. package/lib/global_styling/variables/breakpoint.js +7 -16
  187. package/lib/global_styling/variables/levels.js +7 -26
  188. package/lib/global_styling/variables/shadow.js +13 -20
  189. package/lib/global_styling/variables/size.js +7 -10
  190. package/lib/global_styling/variables/typography.js +19 -41
  191. package/lib/services/hooks/useDeepEqual.js +17 -7
  192. package/lib/services/theme/provider.js +11 -0
  193. package/lib/services/theme/types.js +13 -14
  194. package/lib/services/theme/utils.js +54 -303
  195. package/lib/themes/amsterdam/global_styling/mixins/button.js +45 -206
  196. package/lib/themes/amsterdam/global_styling/variables/_buttons.js +285 -0
  197. package/lib/themes/amsterdam/global_styling/variables/_colors.js +586 -18
  198. package/lib/themes/amsterdam/global_styling/variables/_components.js +446 -0
  199. package/lib/themes/amsterdam/global_styling/variables/_forms.js +153 -0
  200. package/lib/themes/amsterdam/theme.js +3 -1
  201. package/lib/themes/index.js +7 -0
  202. package/lib/themes/themes.js +8 -1
  203. package/optimize/es/components/badge/badge.js +1 -1
  204. package/optimize/es/components/badge/badge.styles.js +2 -2
  205. package/optimize/es/components/badge/beta_badge/beta_badge.js +1 -1
  206. package/optimize/es/components/badge/beta_badge/beta_badge.styles.js +1 -0
  207. package/optimize/es/components/badge/color_utils.js +8 -7
  208. package/optimize/es/components/badge/notification_badge/badge_notification.js +1 -1
  209. package/optimize/es/components/badge/notification_badge/badge_notification.styles.js +1 -0
  210. package/optimize/es/components/bottom_bar/bottom_bar.styles.js +1 -2
  211. package/optimize/es/components/breadcrumbs/_breadcrumb_content.styles.js +4 -6
  212. package/optimize/es/components/button/button.js +1 -1
  213. package/optimize/es/components/button/button_display/_button_display.styles.js +1 -1
  214. package/optimize/es/components/button/button_empty/button_empty.js +1 -1
  215. package/optimize/es/components/button/button_group/button_group_button.js +1 -1
  216. package/optimize/es/components/button/button_group/button_group_button.styles.js +4 -4
  217. package/optimize/es/components/button/button_icon/button_icon.js +1 -1
  218. package/optimize/es/components/card/card.styles.js +1 -1
  219. package/optimize/es/components/code/code_block_annotations.js +1 -1
  220. package/optimize/es/components/code/code_block_line.styles.js +1 -2
  221. package/optimize/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.styles.js +3 -5
  222. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +1 -1
  223. package/optimize/es/components/color_picker/color_palette_display/color_palette_display.styles.js +1 -2
  224. package/optimize/es/components/color_picker/color_picker.styles.js +1 -2
  225. package/optimize/es/components/color_picker/color_picker_swatch.styles.js +1 -1
  226. package/optimize/es/components/combo_box/combo_box.js +9 -6
  227. package/optimize/es/components/common.js +0 -28
  228. package/optimize/es/components/context_menu/context_menu_panel.js +11 -1
  229. package/optimize/es/components/datagrid/body/cell/data_grid_cell.js +15 -8
  230. package/optimize/es/components/datagrid/body/data_grid_body_custom.js +0 -1
  231. package/optimize/es/components/datagrid/body/data_grid_body_virtualized.js +0 -1
  232. package/optimize/es/components/datagrid/controls/data_grid_toolbar.styles.js +2 -2
  233. package/optimize/es/components/datagrid/controls/display_selector.js +277 -207
  234. package/optimize/es/components/datagrid/data_grid.styles.js +4 -6
  235. package/optimize/es/components/datagrid/utils/col_widths.js +7 -13
  236. package/optimize/es/components/datagrid/utils/grid_height_width.js +1 -1
  237. package/optimize/es/components/datagrid/utils/row_heights.js +29 -13
  238. package/optimize/es/components/date_picker/react_date_picker.styles.js +2 -1
  239. package/optimize/es/components/date_picker/super_date_picker/super_date_picker.styles.js +3 -4
  240. package/optimize/es/components/drag_and_drop/droppable.styles.js +2 -4
  241. package/optimize/es/components/empty_prompt/empty_prompt.styles.js +5 -2
  242. package/optimize/es/components/filter_group/filter_select_item.styles.js +1 -2
  243. package/optimize/es/components/flyout/_flyout_close_button.styles.js +1 -2
  244. package/optimize/es/components/form/form.styles.js +21 -28
  245. package/optimize/es/components/form/range/range_tooltip.styles.js +3 -7
  246. package/optimize/es/components/form/switch/switch.js +3 -2
  247. package/optimize/es/components/form/switch/switch.styles.js +16 -19
  248. package/optimize/es/components/header/header.styles.js +12 -6
  249. package/optimize/es/components/header/header_links/header_links.js +1 -1
  250. package/optimize/es/components/header/header_links/header_links.styles.js +1 -0
  251. package/optimize/es/components/icon/icon.styles.js +9 -8
  252. package/optimize/es/components/icon/named_colors.js +1 -1
  253. package/optimize/es/components/inline_edit/inline_edit_form.styles.js +1 -2
  254. package/optimize/es/components/key_pad_menu/key_pad_menu_item.styles.js +1 -2
  255. package/optimize/es/components/list_group/list_group_item.styles.js +9 -11
  256. package/optimize/es/components/mark/mark.styles.js +2 -9
  257. package/optimize/es/components/markdown_editor/markdown_editor_drop_zone.styles.js +2 -3
  258. package/optimize/es/components/markdown_editor/markdown_format.styles.js +2 -2
  259. package/optimize/es/components/overlay_mask/overlay_mask.styles.js +1 -2
  260. package/optimize/es/components/page_template/inner/page_inner.styles.js +2 -2
  261. package/optimize/es/components/popover/popover_footer.styles.js +1 -1
  262. package/optimize/es/components/popover/popover_panel/_popover_panel.styles.js +3 -4
  263. package/optimize/es/components/progress/progress.js +1 -1
  264. package/optimize/es/components/progress/progress.styles.js +8 -6
  265. package/optimize/es/components/selectable/selectable_list/selectable_list_item.styles.js +1 -2
  266. package/optimize/es/components/side_nav/side_nav_item.styles.js +1 -2
  267. package/optimize/es/components/skeleton/utils.js +3 -5
  268. package/optimize/es/components/steps/step_number.styles.js +1 -1
  269. package/optimize/es/components/table/table_cells_shared.styles.js +2 -7
  270. package/optimize/es/components/table/table_row.styles.js +8 -10
  271. package/optimize/es/components/text/text.styles.js +2 -2
  272. package/optimize/es/components/text/text_color.js +1 -1
  273. package/optimize/es/components/text/text_color.styles.js +6 -5
  274. package/optimize/es/components/tool_tip/tool_tip.styles.js +8 -10
  275. package/optimize/es/components/tour/_tour_footer.styles.js +2 -4
  276. package/optimize/es/components/tree_view/tree_view_item.styles.js +1 -2
  277. package/optimize/es/global_styling/functions/size.js +1 -17
  278. package/optimize/es/global_styling/mixins/_button.js +159 -0
  279. package/optimize/es/global_styling/mixins/_color.js +40 -31
  280. package/optimize/es/global_styling/mixins/index.js +2 -1
  281. package/optimize/es/global_styling/reset/global_styles.js +2 -2
  282. package/optimize/es/global_styling/variables/_colors_vis.js +1 -53
  283. package/optimize/es/global_styling/variables/animations.js +1 -22
  284. package/optimize/es/global_styling/variables/breakpoint.js +1 -7
  285. package/optimize/es/global_styling/variables/levels.js +1 -17
  286. package/optimize/es/global_styling/variables/shadow.js +1 -11
  287. package/optimize/es/global_styling/variables/size.js +1 -1
  288. package/optimize/es/global_styling/variables/typography.js +1 -32
  289. package/optimize/es/services/hooks/useDeepEqual.js +13 -6
  290. package/optimize/es/services/theme/provider.js +11 -0
  291. package/optimize/es/services/theme/types.js +1 -6
  292. package/optimize/es/services/theme/utils.js +1 -295
  293. package/optimize/es/themes/amsterdam/global_styling/mixins/button.js +1 -198
  294. package/optimize/es/themes/amsterdam/global_styling/variables/_buttons.js +270 -0
  295. package/optimize/es/themes/amsterdam/global_styling/variables/_colors.js +587 -18
  296. package/optimize/es/themes/amsterdam/global_styling/variables/_components.js +434 -0
  297. package/optimize/es/themes/amsterdam/global_styling/variables/_forms.js +141 -0
  298. package/optimize/es/themes/amsterdam/theme.js +3 -1
  299. package/optimize/es/themes/index.js +1 -1
  300. package/optimize/es/themes/themes.js +7 -0
  301. package/optimize/lib/components/badge/badge.js +1 -1
  302. package/optimize/lib/components/badge/badge.styles.js +2 -2
  303. package/optimize/lib/components/badge/beta_badge/beta_badge.js +1 -1
  304. package/optimize/lib/components/badge/beta_badge/beta_badge.styles.js +1 -0
  305. package/optimize/lib/components/badge/color_utils.js +13 -12
  306. package/optimize/lib/components/badge/notification_badge/badge_notification.js +1 -1
  307. package/optimize/lib/components/badge/notification_badge/badge_notification.styles.js +1 -0
  308. package/optimize/lib/components/bottom_bar/bottom_bar.styles.js +1 -2
  309. package/optimize/lib/components/breadcrumbs/_breadcrumb_content.styles.js +4 -6
  310. package/optimize/lib/components/button/button.js +1 -1
  311. package/optimize/lib/components/button/button_display/_button_display.styles.js +1 -1
  312. package/optimize/lib/components/button/button_empty/button_empty.js +1 -1
  313. package/optimize/lib/components/button/button_group/button_group_button.js +1 -1
  314. package/optimize/lib/components/button/button_group/button_group_button.styles.js +3 -3
  315. package/optimize/lib/components/button/button_icon/button_icon.js +1 -1
  316. package/optimize/lib/components/card/card.styles.js +1 -1
  317. package/optimize/lib/components/code/code_block_annotations.js +1 -1
  318. package/optimize/lib/components/code/code_block_line.styles.js +1 -2
  319. package/optimize/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.styles.js +3 -5
  320. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +1 -1
  321. package/optimize/lib/components/color_picker/color_palette_display/color_palette_display.styles.js +1 -2
  322. package/optimize/lib/components/color_picker/color_picker.styles.js +1 -2
  323. package/optimize/lib/components/color_picker/color_picker_swatch.styles.js +1 -1
  324. package/optimize/lib/components/combo_box/combo_box.js +9 -6
  325. package/optimize/lib/components/common.js +0 -28
  326. package/optimize/lib/components/context_menu/context_menu_panel.js +11 -1
  327. package/optimize/lib/components/datagrid/body/cell/data_grid_cell.js +15 -8
  328. package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +0 -1
  329. package/optimize/lib/components/datagrid/body/data_grid_body_virtualized.js +0 -1
  330. package/optimize/lib/components/datagrid/controls/data_grid_toolbar.styles.js +2 -2
  331. package/optimize/lib/components/datagrid/controls/display_selector.js +274 -204
  332. package/optimize/lib/components/datagrid/data_grid.styles.js +4 -6
  333. package/optimize/lib/components/datagrid/utils/col_widths.js +7 -13
  334. package/optimize/lib/components/datagrid/utils/grid_height_width.js +1 -1
  335. package/optimize/lib/components/datagrid/utils/row_heights.js +29 -13
  336. package/optimize/lib/components/date_picker/react_date_picker.styles.js +3 -2
  337. package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.styles.js +2 -3
  338. package/optimize/lib/components/drag_and_drop/droppable.styles.js +2 -4
  339. package/optimize/lib/components/empty_prompt/empty_prompt.styles.js +4 -1
  340. package/optimize/lib/components/filter_group/filter_select_item.styles.js +1 -2
  341. package/optimize/lib/components/flyout/_flyout_close_button.styles.js +1 -2
  342. package/optimize/lib/components/form/form.styles.js +20 -27
  343. package/optimize/lib/components/form/range/range_tooltip.styles.js +3 -7
  344. package/optimize/lib/components/form/switch/switch.js +3 -2
  345. package/optimize/lib/components/form/switch/switch.styles.js +16 -19
  346. package/optimize/lib/components/header/header.styles.js +11 -5
  347. package/optimize/lib/components/header/header_links/header_links.js +1 -1
  348. package/optimize/lib/components/header/header_links/header_links.styles.js +1 -0
  349. package/optimize/lib/components/icon/icon.styles.js +9 -8
  350. package/optimize/lib/components/icon/named_colors.js +1 -1
  351. package/optimize/lib/components/inline_edit/inline_edit_form.styles.js +1 -2
  352. package/optimize/lib/components/key_pad_menu/key_pad_menu_item.styles.js +1 -2
  353. package/optimize/lib/components/list_group/list_group_item.styles.js +8 -10
  354. package/optimize/lib/components/mark/mark.styles.js +2 -9
  355. package/optimize/lib/components/markdown_editor/markdown_editor_drop_zone.styles.js +2 -3
  356. package/optimize/lib/components/markdown_editor/markdown_format.styles.js +2 -2
  357. package/optimize/lib/components/overlay_mask/overlay_mask.styles.js +1 -2
  358. package/optimize/lib/components/page_template/inner/page_inner.styles.js +1 -1
  359. package/optimize/lib/components/popover/popover_footer.styles.js +1 -1
  360. package/optimize/lib/components/popover/popover_panel/_popover_panel.styles.js +3 -4
  361. package/optimize/lib/components/progress/progress.js +1 -1
  362. package/optimize/lib/components/progress/progress.styles.js +8 -6
  363. package/optimize/lib/components/selectable/selectable_list/selectable_list_item.styles.js +1 -2
  364. package/optimize/lib/components/side_nav/side_nav_item.styles.js +1 -2
  365. package/optimize/lib/components/skeleton/utils.js +3 -5
  366. package/optimize/lib/components/steps/step_number.styles.js +1 -1
  367. package/optimize/lib/components/table/table_cells_shared.styles.js +2 -7
  368. package/optimize/lib/components/table/table_row.styles.js +7 -9
  369. package/optimize/lib/components/text/text.styles.js +1 -1
  370. package/optimize/lib/components/text/text_color.js +1 -1
  371. package/optimize/lib/components/text/text_color.styles.js +6 -5
  372. package/optimize/lib/components/tool_tip/tool_tip.styles.js +8 -10
  373. package/optimize/lib/components/tour/_tour_footer.styles.js +2 -4
  374. package/optimize/lib/components/tree_view/tree_view_item.styles.js +1 -2
  375. package/optimize/lib/global_styling/functions/size.js +7 -27
  376. package/optimize/lib/global_styling/mixins/_button.js +165 -0
  377. package/optimize/lib/global_styling/mixins/_color.js +39 -30
  378. package/optimize/lib/global_styling/mixins/index.js +11 -0
  379. package/optimize/lib/global_styling/reset/global_styles.js +1 -1
  380. package/optimize/lib/global_styling/variables/_colors_vis.js +6 -61
  381. package/optimize/lib/global_styling/variables/animations.js +25 -31
  382. package/optimize/lib/global_styling/variables/breakpoint.js +7 -16
  383. package/optimize/lib/global_styling/variables/levels.js +7 -26
  384. package/optimize/lib/global_styling/variables/shadow.js +13 -20
  385. package/optimize/lib/global_styling/variables/size.js +7 -10
  386. package/optimize/lib/global_styling/variables/typography.js +19 -41
  387. package/optimize/lib/services/hooks/useDeepEqual.js +12 -5
  388. package/optimize/lib/services/theme/provider.js +11 -0
  389. package/optimize/lib/services/theme/types.js +13 -14
  390. package/optimize/lib/services/theme/utils.js +54 -296
  391. package/optimize/lib/themes/amsterdam/global_styling/mixins/button.js +45 -203
  392. package/optimize/lib/themes/amsterdam/global_styling/variables/_buttons.js +275 -0
  393. package/optimize/lib/themes/amsterdam/global_styling/variables/_colors.js +586 -18
  394. package/optimize/lib/themes/amsterdam/global_styling/variables/_components.js +439 -0
  395. package/optimize/lib/themes/amsterdam/global_styling/variables/_forms.js +146 -0
  396. package/optimize/lib/themes/amsterdam/theme.js +3 -1
  397. package/optimize/lib/themes/index.js +7 -0
  398. package/optimize/lib/themes/themes.js +8 -1
  399. package/package.json +8 -3
  400. package/src/global_styling/functions/_index.scss +1 -5
  401. package/src/global_styling/index.scss +1 -16
  402. package/src/global_styling/variables/_animations.scss +1 -8
  403. package/src/global_styling/variables/_borders.scss +1 -9
  404. package/src/global_styling/variables/_buttons.scss +1 -18
  405. package/src/global_styling/variables/_colors_vis.scss +1 -70
  406. package/src/global_styling/variables/_font_weight.scss +1 -7
  407. package/src/global_styling/variables/_form.scss +2 -21
  408. package/src/global_styling/variables/_responsive.scss +1 -9
  409. package/src/global_styling/variables/_shadows.scss +1 -1
  410. package/src/global_styling/variables/_size.scss +1 -15
  411. package/src/global_styling/variables/_states.scss +1 -14
  412. package/src/global_styling/variables/_typography.scss +1 -75
  413. package/src/global_styling/variables/_z_index.scss +1 -33
  414. package/src/themes/amsterdam/_colors_dark.scss +80 -8
  415. package/src/themes/amsterdam/_colors_light.scss +80 -8
  416. package/src/themes/amsterdam/global_styling/variables/_forms.scss +12 -0
  417. package/src/themes/amsterdam/global_styling/variables/_index.scss +1 -0
  418. package/test-env/components/badge/badge.js +1 -1
  419. package/test-env/components/badge/badge.styles.js +2 -2
  420. package/test-env/components/badge/beta_badge/beta_badge.js +1 -1
  421. package/test-env/components/badge/beta_badge/beta_badge.styles.js +1 -0
  422. package/test-env/components/badge/color_utils.js +13 -12
  423. package/test-env/components/badge/notification_badge/badge_notification.js +1 -1
  424. package/test-env/components/badge/notification_badge/badge_notification.styles.js +1 -0
  425. package/test-env/components/bottom_bar/bottom_bar.styles.js +1 -2
  426. package/test-env/components/breadcrumbs/_breadcrumb_content.styles.js +4 -6
  427. package/test-env/components/button/button.js +1 -1
  428. package/test-env/components/button/button_display/_button_display.styles.js +1 -1
  429. package/test-env/components/button/button_empty/button_empty.js +1 -1
  430. package/test-env/components/button/button_group/button_group_button.js +1 -1
  431. package/test-env/components/button/button_group/button_group_button.styles.js +3 -3
  432. package/test-env/components/button/button_icon/button_icon.js +1 -1
  433. package/test-env/components/card/card.styles.js +1 -1
  434. package/test-env/components/code/code_block_annotations.js +1 -1
  435. package/test-env/components/code/code_block_line.styles.js +1 -2
  436. package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.styles.js +3 -5
  437. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +1 -1
  438. package/test-env/components/color_picker/color_palette_display/color_palette_display.styles.js +1 -2
  439. package/test-env/components/color_picker/color_picker.styles.js +1 -2
  440. package/test-env/components/color_picker/color_picker_swatch.styles.js +1 -1
  441. package/test-env/components/combo_box/combo_box.js +9 -6
  442. package/test-env/components/common.js +0 -28
  443. package/test-env/components/context_menu/context_menu_panel.js +17 -1
  444. package/test-env/components/datagrid/body/cell/data_grid_cell.js +31 -8
  445. package/test-env/components/datagrid/body/data_grid_body.js +8 -0
  446. package/test-env/components/datagrid/body/data_grid_body_custom.js +8 -1
  447. package/test-env/components/datagrid/body/data_grid_body_virtualized.js +8 -1
  448. package/test-env/components/datagrid/controls/data_grid_toolbar.styles.js +2 -2
  449. package/test-env/components/datagrid/controls/display_selector.js +274 -204
  450. package/test-env/components/datagrid/data_grid.stories.utils.js +28 -2
  451. package/test-env/components/datagrid/data_grid.styles.js +4 -6
  452. package/test-env/components/datagrid/utils/col_widths.js +7 -13
  453. package/test-env/components/datagrid/utils/grid_height_width.js +1 -1
  454. package/test-env/components/datagrid/utils/row_heights.js +29 -13
  455. package/test-env/components/date_picker/react_date_picker.styles.js +3 -2
  456. package/test-env/components/date_picker/super_date_picker/super_date_picker.styles.js +2 -3
  457. package/test-env/components/drag_and_drop/droppable.styles.js +2 -4
  458. package/test-env/components/empty_prompt/empty_prompt.styles.js +4 -1
  459. package/test-env/components/filter_group/filter_select_item.styles.js +1 -2
  460. package/test-env/components/flyout/_flyout_close_button.styles.js +1 -2
  461. package/test-env/components/form/form.styles.js +20 -27
  462. package/test-env/components/form/range/range_tooltip.styles.js +3 -7
  463. package/test-env/components/form/switch/switch.js +3 -2
  464. package/test-env/components/form/switch/switch.styles.js +16 -19
  465. package/test-env/components/header/header.styles.js +11 -5
  466. package/test-env/components/header/header_links/header_links.js +1 -1
  467. package/test-env/components/header/header_links/header_links.styles.js +1 -0
  468. package/test-env/components/icon/icon.styles.js +9 -8
  469. package/test-env/components/icon/named_colors.js +1 -1
  470. package/test-env/components/inline_edit/inline_edit_form.styles.js +1 -2
  471. package/test-env/components/key_pad_menu/key_pad_menu_item.styles.js +1 -2
  472. package/test-env/components/list_group/list_group_item.styles.js +8 -10
  473. package/test-env/components/mark/mark.styles.js +2 -9
  474. package/test-env/components/markdown_editor/markdown_editor_drop_zone.styles.js +2 -3
  475. package/test-env/components/markdown_editor/markdown_format.styles.js +2 -2
  476. package/test-env/components/overlay_mask/overlay_mask.styles.js +1 -2
  477. package/test-env/components/page_template/inner/page_inner.styles.js +1 -1
  478. package/test-env/components/popover/popover_footer.styles.js +1 -1
  479. package/test-env/components/popover/popover_panel/_popover_panel.styles.js +3 -4
  480. package/test-env/components/progress/progress.js +1 -1
  481. package/test-env/components/progress/progress.styles.js +8 -6
  482. package/test-env/components/selectable/selectable_list/selectable_list_item.styles.js +1 -2
  483. package/test-env/components/side_nav/side_nav_item.styles.js +1 -2
  484. package/test-env/components/skeleton/utils.js +3 -5
  485. package/test-env/components/steps/step_number.styles.js +1 -1
  486. package/test-env/components/table/table_cells_shared.styles.js +2 -7
  487. package/test-env/components/table/table_row.styles.js +7 -9
  488. package/test-env/components/text/text.styles.js +1 -1
  489. package/test-env/components/text/text_color.js +1 -1
  490. package/test-env/components/text/text_color.styles.js +6 -5
  491. package/test-env/components/tool_tip/tool_tip.styles.js +8 -10
  492. package/test-env/components/tour/_tour_footer.styles.js +2 -4
  493. package/test-env/components/tree_view/tree_view_item.styles.js +1 -2
  494. package/test-env/global_styling/functions/size.js +7 -27
  495. package/test-env/global_styling/mixins/_button.js +165 -0
  496. package/test-env/global_styling/mixins/_color.js +39 -30
  497. package/test-env/global_styling/mixins/index.js +11 -0
  498. package/test-env/global_styling/reset/global_styles.js +1 -1
  499. package/test-env/global_styling/variables/_colors_vis.js +6 -61
  500. package/test-env/global_styling/variables/animations.js +25 -31
  501. package/test-env/global_styling/variables/breakpoint.js +7 -16
  502. package/test-env/global_styling/variables/levels.js +7 -26
  503. package/test-env/global_styling/variables/shadow.js +13 -20
  504. package/test-env/global_styling/variables/size.js +7 -10
  505. package/test-env/global_styling/variables/typography.js +19 -41
  506. package/test-env/services/hooks/useDeepEqual.js +12 -5
  507. package/test-env/services/theme/provider.js +11 -0
  508. package/test-env/services/theme/types.js +13 -14
  509. package/test-env/services/theme/utils.js +54 -296
  510. package/test-env/themes/amsterdam/global_styling/mixins/button.js +45 -203
  511. package/test-env/themes/amsterdam/global_styling/variables/_buttons.js +275 -0
  512. package/test-env/themes/amsterdam/global_styling/variables/_colors.js +586 -18
  513. package/test-env/themes/amsterdam/global_styling/variables/_components.js +439 -0
  514. package/test-env/themes/amsterdam/global_styling/variables/_forms.js +146 -0
  515. package/test-env/themes/amsterdam/theme.js +3 -1
  516. package/test-env/themes/index.js +7 -0
  517. package/test-env/themes/themes.js +8 -1
@@ -0,0 +1,159 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
+ var _templateObject;
3
+ /*
4
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
5
+ * or more contributor license agreements. Licensed under the Elastic License
6
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
7
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
8
+ * Side Public License, v 1.
9
+ */
10
+
11
+ import { css, keyframes } from '@emotion/react';
12
+ import { getTokenName, euiCanAnimate } from '@elastic/eui-theme-common';
13
+ import { makeHighContrastColor, useEuiMemoizedStyles } from '../../services';
14
+ export var BUTTON_COLORS = ['text', 'accent', 'accentSecondary', 'primary', 'success', 'warning', 'danger'];
15
+ export var BUTTON_DISPLAYS = ['base', 'fill', 'empty'];
16
+ /**
17
+ * Creates the `base` version of button styles with proper text contrast.
18
+ * @param euiThemeContext
19
+ * @param color One of the named button colors or 'disabled'
20
+ * @returns Style object `{ backgroundColor, color }`
21
+ */
22
+ export var euiButtonColor = function euiButtonColor(euiThemeContext, color) {
23
+ var euiTheme = euiThemeContext.euiTheme;
24
+ var backgroundTokenName = getTokenName('background', color);
25
+ var textTokenName = getTokenName('textColor', color);
26
+ var foreground = euiTheme.components.buttons[textTokenName];
27
+ var background = euiTheme.components.buttons[backgroundTokenName];
28
+ return {
29
+ color: background === 'transparent' || color === 'disabled' ? foreground : makeHighContrastColor(foreground)(background),
30
+ backgroundColor: background
31
+ };
32
+ };
33
+
34
+ /**
35
+ * Creates the `fill` version of buttons styles with proper text contrast.
36
+ * @param euiThemeContext
37
+ * @param color One of the named button colors or 'disabled'
38
+ * @returns Style object `{ backgroundColor, color }`
39
+ */
40
+ export var euiButtonFillColor = function euiButtonFillColor(euiThemeContext, color) {
41
+ var euiTheme = euiThemeContext.euiTheme;
42
+ var backgroundTokenName = getTokenName('backgroundFilled', color);
43
+ var textColorTokenName = getTokenName('textColorFilled', color);
44
+ var foreground = euiTheme.components.buttons[textColorTokenName];
45
+ var background = euiTheme.components.buttons[backgroundTokenName];
46
+ return {
47
+ color: foreground,
48
+ backgroundColor: background
49
+ };
50
+ };
51
+
52
+ /**
53
+ * Creates the `empty` version of button styles using the text-variant and adding interactive styles.
54
+ * @param euiThemeContext
55
+ * @param color One of the named button colors or 'disabled'
56
+ * @returns Style object `{ backgroundColor, color }` where `background` is typically used for interactive states
57
+ */
58
+ export var euiButtonEmptyColor = function euiButtonEmptyColor(euiThemeContext, color) {
59
+ var foreground;
60
+ var background;
61
+ switch (color) {
62
+ case 'disabled':
63
+ foreground = euiButtonColor(euiThemeContext, color).color;
64
+ background = 'transparent';
65
+ break;
66
+ default:
67
+ {
68
+ var backgroundToken = getTokenName('backgroundEmpty', color, 'hover');
69
+ foreground = euiButtonColor(euiThemeContext, color).color;
70
+ background = euiThemeContext.euiTheme.components.buttons[backgroundToken];
71
+ break;
72
+ }
73
+ }
74
+ return {
75
+ color: foreground,
76
+ backgroundColor: background
77
+ };
78
+ };
79
+
80
+ /**
81
+ * Given the button display type, returns the Emotion based color keys.
82
+ * @param options Button display type
83
+ * @returns An object of `_EuiButtonColor` keys including `disabled`
84
+ */
85
+ export var useEuiButtonColorCSS = function useEuiButtonColorCSS() {
86
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
87
+ var _options$display = options.display,
88
+ display = _options$display === void 0 ? 'base' : _options$display;
89
+ var colorsDisplaysMap = useEuiMemoizedStyles(euiButtonDisplaysColors);
90
+ return colorsDisplaysMap[display];
91
+ };
92
+ var euiButtonDisplaysColors = function euiButtonDisplaysColors(euiThemeContext) {
93
+ var COLORS = [].concat(BUTTON_COLORS, ['disabled']);
94
+ var displaysColorsMap = {};
95
+ BUTTON_DISPLAYS.forEach(function (display) {
96
+ displaysColorsMap[display] = {};
97
+ COLORS.forEach(function (color) {
98
+ switch (display) {
99
+ case 'base':
100
+ displaysColorsMap[display][color] = /*#__PURE__*/css(euiButtonColor(euiThemeContext, color), ";;label:displaysColorsMap-display-color;");
101
+ break;
102
+ case 'fill':
103
+ displaysColorsMap[display][color] = /*#__PURE__*/css(euiButtonFillColor(euiThemeContext, color), "outline-color:", euiThemeContext.colorMode === 'DARK' && color === 'text' ? 'currentColor' : euiThemeContext.euiTheme.colors.fullShade, ";;label:displaysColorsMap-display-color;");
104
+ break;
105
+ case 'empty':
106
+ displaysColorsMap[display][color] = /*#__PURE__*/css("color:", euiButtonEmptyColor(euiThemeContext, color).color, ";&:focus,&:active{background-color:", euiButtonEmptyColor(euiThemeContext, color).backgroundColor, ";};label:displaysColorsMap-display-color;");
107
+ break;
108
+ }
109
+
110
+ // Tweak auto-generated Emotion label/className output
111
+ var emotionOutput = displaysColorsMap[display][color];
112
+ emotionOutput.styles = emotionOutput.styles.replace('label:displaysColorsMap-display-color;', "label:".concat(display, "-").concat(color, ";"));
113
+ });
114
+ });
115
+ return displaysColorsMap;
116
+ };
117
+
118
+ /**
119
+ * Creates the translate animation when button is in focus.
120
+ * @returns string
121
+ */
122
+ export var useEuiButtonFocusCSS = function useEuiButtonFocusCSS() {
123
+ return useEuiMemoizedStyles(euiButtonFocusCSS);
124
+ };
125
+ var euiButtonFocusAnimation = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 50% {\n transform: translateY(1px);\n }\n"])));
126
+ var euiButtonFocusCSS = function euiButtonFocusCSS(_ref) {
127
+ var euiTheme = _ref.euiTheme;
128
+ var focusCSS = /*#__PURE__*/css(euiCanAnimate, "{transition:transform ", euiTheme.animation.normal, " ease-in-out,background-color ", euiTheme.animation.normal, " ease-in-out;&:hover:not(:disabled){transform:translateY(-1px);}&:focus{animation:", euiButtonFocusAnimation, " ", euiTheme.animation.normal, " ", euiTheme.animation.bounce, ";}&:active:not(:disabled){transform:translateY(1px);}};label:focusCSS;");
129
+ // Remove the auto-generated label.
130
+ // We could typically avoid a label by using a plain string `` instead of css``,
131
+ // but we need css`` for keyframes`` to work for the focus animation
132
+ focusCSS.styles = focusCSS.styles.replace('label:focusCSS;', '');
133
+ return focusCSS;
134
+ };
135
+
136
+ /**
137
+ * Map of `size` props to various sizings/scales
138
+ * that should remain consistent across all buttons
139
+ */
140
+ export var euiButtonSizeMap = function euiButtonSizeMap(_ref2) {
141
+ var euiTheme = _ref2.euiTheme;
142
+ return {
143
+ xs: {
144
+ height: euiTheme.size.l,
145
+ radius: euiTheme.border.radius.small,
146
+ fontScale: 'xs'
147
+ },
148
+ s: {
149
+ height: euiTheme.size.xl,
150
+ radius: euiTheme.border.radius.small,
151
+ fontScale: 's'
152
+ },
153
+ m: {
154
+ height: euiTheme.size.xxl,
155
+ radius: euiTheme.border.radius.medium,
156
+ fontScale: 's'
157
+ }
158
+ };
159
+ };
@@ -10,41 +10,29 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
10
10
  */
11
11
 
12
12
  import { css } from '@emotion/react';
13
- import { shade, tint, tintOrShade, transparentize, useEuiMemoizedStyles } from '../../services';
14
- export var BACKGROUND_COLORS = ['transparent', 'plain', 'subdued', 'accent', 'primary', 'success', 'warning', 'danger'];
13
+ import { useEuiMemoizedStyles } from '../../services';
14
+ import { getTokenName } from '@elastic/eui-theme-common';
15
+ export var BACKGROUND_COLORS = ['transparent', 'plain', 'subdued', 'accent', 'accentSecondary', 'primary', 'success', 'warning', 'danger'];
15
16
  /**
17
+ * @deprecated - use background tokens directly
16
18
  * @returns A single background color with optional alpha transparency
17
19
  */
18
20
  export var euiBackgroundColor = function euiBackgroundColor(_ref, color) {
19
- var euiTheme = _ref.euiTheme,
20
- colorMode = _ref.colorMode;
21
+ var euiTheme = _ref.euiTheme;
21
22
  var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
22
23
  method = _ref2.method;
23
24
  if (color === 'transparent') return 'transparent';
24
25
  if (method === 'transparent') {
25
- if (color === 'plain') {
26
- return transparentize(euiTheme.colors.ghost, 0.2);
27
- } else if (color === 'subdued') {
28
- return colorMode === 'DARK' ? transparentize(euiTheme.colors.lightShade, 0.4) : transparentize(euiTheme.colors.lightShade, 0.2);
29
- } else {
30
- return transparentize(euiTheme.colors[color], 0.1);
31
- }
26
+ var tokenName = getTokenName('backgroundTransparent', color);
27
+ return euiTheme.colors[tokenName];
32
28
  } else {
33
- var _tintOrShade = function _tintOrShade(color) {
34
- return colorMode === 'DARK' ? shade(color, 0.8) : tint(color, 0.9);
35
- };
36
- switch (color) {
37
- case 'plain':
38
- return euiTheme.colors.emptyShade;
39
- case 'subdued':
40
- return euiTheme.colors.body;
41
- default:
42
- return _tintOrShade(euiTheme.colors[color]);
43
- }
29
+ var _tokenName = getTokenName('backgroundBase', color);
30
+ return euiTheme.colors[_tokenName];
44
31
  }
45
32
  };
46
33
 
47
34
  /**
35
+ * @deprecated
48
36
  * @returns An object map of color keys to color values, categorized by
49
37
  * opaque (default) vs transparency (hover/focus states) methods.
50
38
  * e.g. {
@@ -64,6 +52,10 @@ var _euiBackgroundColorMap = function _euiBackgroundColorMap(euiThemeContext) {
64
52
  }, {})
65
53
  };
66
54
  };
55
+
56
+ /**
57
+ * @deprecated
58
+ */
67
59
  export var useEuiBackgroundColor = function useEuiBackgroundColor(color) {
68
60
  var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
69
61
  method = _ref3.method;
@@ -72,34 +64,44 @@ export var useEuiBackgroundColor = function useEuiBackgroundColor(color) {
72
64
  };
73
65
 
74
66
  /**
67
+ * @deprecated
75
68
  * @returns An object map of color keys to CSS,
76
69
  * e.g. { danger: css``, success: css``, ... }
77
70
  */
78
71
  var _euiBackgroundColors = function _euiBackgroundColors(euiThemeContext) {
79
72
  return BACKGROUND_COLORS.reduce(function (acc, color) {
80
- return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, color, /*#__PURE__*/css("background-color:", euiBackgroundColor(euiThemeContext, color), ";label:", color, ";")));
73
+ var tokenName = getTokenName('backgroundBase', color);
74
+ var backgroundColor = color === 'transparent' ? 'transparent' : euiThemeContext.euiTheme.colors[tokenName];
75
+ return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, color, /*#__PURE__*/css("background-color:", backgroundColor, ";label:", color, ";")));
81
76
  }, {});
82
77
  };
78
+
79
+ /**
80
+ * @deprecated - use background tokens directly
81
+ * Hook to retrieve background style for a background color variant
82
+ * @returns An object map of color keys to CSS,
83
+ * e.g. { danger: css``, success: css``, ... }
84
+ */
83
85
  export var useEuiBackgroundColorCSS = function useEuiBackgroundColorCSS() {
84
86
  return useEuiMemoizedStyles(_euiBackgroundColors);
85
87
  };
86
88
 
87
89
  /**
88
90
  * Border colors
91
+ * @deprecated - use border tokens directly or use
92
+ * `useEuiBorderColorCSS()` for composed styles
89
93
  */
90
94
 
91
95
  export var euiBorderColor = function euiBorderColor(_ref4, color) {
92
- var euiTheme = _ref4.euiTheme,
93
- colorMode = _ref4.colorMode;
96
+ var euiTheme = _ref4.euiTheme;
94
97
  switch (color) {
95
98
  case 'transparent':
96
- case 'plain':
97
- case 'subdued':
98
99
  return euiTheme.border.color;
99
- case 'warning':
100
- return tintOrShade(euiTheme.colors.warning, 0.4, colorMode);
101
100
  default:
102
- return tintOrShade(euiTheme.colors[color], 0.6, colorMode);
101
+ {
102
+ var tokenName = getTokenName('borderStrong', color);
103
+ return euiTheme.colors[tokenName];
104
+ }
103
105
  }
104
106
  };
105
107
 
@@ -109,9 +111,16 @@ export var euiBorderColor = function euiBorderColor(_ref4, color) {
109
111
  */
110
112
  var _euiBorderColors = function _euiBorderColors(euiThemeContext) {
111
113
  return BACKGROUND_COLORS.reduce(function (acc, color) {
112
- return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, color, /*#__PURE__*/css("border-color:", euiBorderColor(euiThemeContext, color), ";label:", color, ";")));
114
+ var borderToken = getTokenName('borderBase', color);
115
+ return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, color, /*#__PURE__*/css("border-color:", euiThemeContext.euiTheme.colors[borderToken], ";label:", color, ";")));
113
116
  }, {});
114
117
  };
118
+
119
+ /**
120
+ * Hook to retrieve border style for a border variant
121
+ * @returns An object map of color keys to CSS,
122
+ * e.g. { danger: css``, success: css``, ... }
123
+ */
115
124
  export var useEuiBorderColorCSS = function useEuiBorderColorCSS() {
116
125
  return useEuiMemoizedStyles(_euiBorderColors);
117
126
  };
@@ -11,4 +11,5 @@ export * from './_helpers';
11
11
  export * from './_padding';
12
12
  export * from './_states';
13
13
  export * from './_typography';
14
- export * from './_responsive';
14
+ export * from './_responsive';
15
+ export * from './_button';
@@ -14,7 +14,7 @@ import React from 'react';
14
14
  import { Global, css } from '@emotion/react';
15
15
  import { euiFocusRing, euiScrollBarStyles } from '../mixins';
16
16
  import { logicalCSS } from '../functions';
17
- import { shade, tint, transparentize } from '../../services/color';
17
+ import { transparentize } from '../../services/color';
18
18
  import { useEuiTheme } from '../../services/theme';
19
19
  import { resetStyles as reset } from './reset';
20
20
  import { jsx as ___EmotionJSX } from "@emotion/react";
@@ -32,7 +32,7 @@ export var EuiGlobalStyles = function EuiGlobalStyles(_ref) {
32
32
  * so that it knows to use custom styles. Therefore, we just reuse the same scrollbar mixin with thick size.
33
33
  */
34
34
  var scrollbarStyles = euiScrollBarStyles(euiThemeContext, {
35
- trackColor: colorMode === 'LIGHT' ? shade(colors.body, 0.03) : tint(colors.body, 0.07),
35
+ trackColor: euiTheme.components.scrollbarTrackColor,
36
36
  width: 'auto'
37
37
  });
38
38
 
@@ -6,56 +6,4 @@
6
6
  * Side Public License, v 1.
7
7
  */
8
8
 
9
- /**
10
- * NOTE: These were quick conversions of their Sass counterparts.
11
- * They have yet to be used/tested.
12
- * TODO: Make the graphic version available from `euiPaletteColorBlind()`
13
- */
14
-
15
- // Maps allow for easier JSON usage
16
- // Use map_merge(euiColorVisColors, $yourMap) to change individual colors after importing ths file
17
- // The `behindText` variant is a direct copy of the hex output by the JS euiPaletteColorBlindBehindText() function
18
- var euiPaletteColorBlind = {
19
- euiColorVis0: {
20
- graphic: '#54B399'
21
- },
22
- euiColorVis1: {
23
- graphic: '#6092C0'
24
- },
25
- euiColorVis2: {
26
- graphic: '#D36086'
27
- },
28
- euiColorVis3: {
29
- graphic: '#9170B8'
30
- },
31
- euiColorVis4: {
32
- graphic: '#CA8EAE'
33
- },
34
- euiColorVis5: {
35
- graphic: '#D6BF57'
36
- },
37
- euiColorVis6: {
38
- graphic: '#B9A888'
39
- },
40
- euiColorVis7: {
41
- graphic: '#DA8B45'
42
- },
43
- euiColorVis8: {
44
- graphic: '#AA6556'
45
- },
46
- euiColorVis9: {
47
- graphic: '#E7664C'
48
- }
49
- };
50
- export var colorVis = {
51
- euiColorVis0: euiPaletteColorBlind.euiColorVis0.graphic,
52
- euiColorVis1: euiPaletteColorBlind.euiColorVis1.graphic,
53
- euiColorVis2: euiPaletteColorBlind.euiColorVis2.graphic,
54
- euiColorVis3: euiPaletteColorBlind.euiColorVis3.graphic,
55
- euiColorVis4: euiPaletteColorBlind.euiColorVis4.graphic,
56
- euiColorVis5: euiPaletteColorBlind.euiColorVis5.graphic,
57
- euiColorVis6: euiPaletteColorBlind.euiColorVis6.graphic,
58
- euiColorVis7: euiPaletteColorBlind.euiColorVis7.graphic,
59
- euiColorVis8: euiPaletteColorBlind.euiColorVis8.graphic,
60
- euiColorVis9: euiPaletteColorBlind.euiColorVis9.graphic
61
- };
9
+ export { colorVis } from '@elastic/eui-theme-common';
@@ -6,25 +6,4 @@
6
6
  * Side Public License, v 1.
7
7
  */
8
8
 
9
- /**
10
- * A constant storing the `prefers-reduced-motion` media query
11
- * so that when it is turned off, animations are not run.
12
- */
13
- export var euiCanAnimate = '@media screen and (prefers-reduced-motion: no-preference)';
14
-
15
- /**
16
- * A constant storing the `prefers-reduced-motion` media query that will
17
- * only apply the content if the setting is off (reduce).
18
- */
19
- export var euiCantAnimate = '@media screen and (prefers-reduced-motion: reduce)';
20
-
21
- /**
22
- * Speeds / Durations / Delays
23
- */
24
-
25
- export var EuiThemeAnimationSpeeds = ['extraFast', 'fast', 'normal', 'slow', 'extraSlow'];
26
- /**
27
- * Easings / Timing functions
28
- */
29
-
30
- export var EuiThemeAnimationEasings = ['bounce', 'resistance'];
9
+ export { euiCanAnimate, euiCantAnimate, EuiThemeAnimationSpeeds, EuiThemeAnimationEasings } from '@elastic/eui-theme-common';
@@ -6,10 +6,4 @@
6
6
  * Side Public License, v 1.
7
7
  */
8
8
 
9
- export var EuiThemeBreakpoints = ['xs', 's', 'm', 'l', 'xl'];
10
-
11
- // This type cannot be a string enum / must be a generic string
12
- // in case consumers add custom breakpoint sizes, such as xxl or xxs
13
-
14
- // Explicitly list out each key so we can document default values
15
- // via JSDoc (which is available to devs in IDE via intellisense)
9
+ export { EuiThemeBreakpoints } from '@elastic/eui-theme-common';
@@ -6,20 +6,4 @@
6
6
  * Side Public License, v 1.
7
7
  */
8
8
 
9
- /**
10
- * Z-Index
11
- *
12
- * Remember that z-index is relative to parent and based on the stacking context.
13
- * z-indexes only compete against other z-indexes when they exist as children of
14
- * that shared parent.
15
- *
16
- * That means a popover with a settings of 2, will still show above a modal
17
- * with a setting of 100, if it is within that modal and not besides it.
18
- *
19
- * Generally that means it's a good idea to consider things added to this file
20
- * as competitive only as siblings.
21
- *
22
- * https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context
23
- */
24
-
25
- export var EuiThemeLevels = ['toast', 'modal', 'mask', 'navigation', 'menu', 'header', 'flyout', 'maskBelowHeader', 'content'];
9
+ export { EuiThemeLevels } from '@elastic/eui-theme-common';
@@ -6,14 +6,4 @@
6
6
  * Side Public License, v 1.
7
7
  */
8
8
 
9
- export var EuiThemeShadowSizes = ['xs', 's', 'm', 'l', 'xl'];
10
- /**
11
- * Shadow t-shirt sizes descriptions
12
- */
13
- export var _EuiShadowSizesDescriptions = {
14
- xs: 'Very subtle shadow used on small components.',
15
- s: 'Adds subtle depth, usually used in conjunction with a border.',
16
- m: 'Used on small sized portalled content like popovers.',
17
- l: 'Primary shadow used in most cases to add visible depth.',
18
- xl: 'Very large shadows used for large portalled style containers like modals and flyouts.'
19
- };
9
+ export { EuiThemeShadowSizes, _EuiShadowSizesDescriptions } from '@elastic/eui-theme-common';
@@ -6,4 +6,4 @@
6
6
  * Side Public License, v 1.
7
7
  */
8
8
 
9
- export var EuiThemeSizes = ['xxs', 'xs', 's', 'm', 'base', 'l', 'xl', 'xxl', 'xxxl', 'xxxxl'];
9
+ export { EuiThemeSizes } from '@elastic/eui-theme-common';
@@ -6,35 +6,4 @@
6
6
  * Side Public License, v 1.
7
7
  */
8
8
 
9
- /**
10
- * Font units of measure
11
- */
12
-
13
- export var EuiThemeFontUnits = ['rem', 'px', 'em'];
14
- /*
15
- * Font scale
16
- */
17
-
18
- export var EuiThemeFontScales = ['xxxs', 'xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl'];
19
-
20
- /*
21
- * Font base settings
22
- */
23
-
24
- /*
25
- * Font weights
26
- */
27
-
28
- export var EuiThemeFontWeights = ['light', 'regular', 'medium', 'semiBold', 'bold'];
29
-
30
- /**
31
- * Body / Base styles
32
- */
33
-
34
- /**
35
- * Title styles
36
- */
37
-
38
- /*
39
- * Font
40
- */
9
+ export { EuiThemeFontUnits, EuiThemeFontScales, EuiThemeFontWeights } from '@elastic/eui-theme-common';
@@ -1,3 +1,4 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
1
2
  /*
2
3
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
4
  * or more contributor license agreements. Licensed under the Elastic License
@@ -6,8 +7,9 @@
6
7
  * Side Public License, v 1.
7
8
  */
8
9
 
9
- import { useRef } from 'react';
10
+ import { useState } from 'react';
10
11
  import isEqual from 'lodash/isEqual';
12
+ import { useUpdateEffect } from './useUpdateEffect';
11
13
 
12
14
  /**
13
15
  * This hook is mostly a performance concern for third-party objs/arrays that EUI
@@ -15,9 +17,14 @@ import isEqual from 'lodash/isEqual';
15
17
  * reference on every rerender unless passed through this hook).
16
18
  */
17
19
  export var useDeepEqual = function useDeepEqual(object) {
18
- var ref = useRef(object);
19
- if (!isEqual(object, ref.current)) {
20
- ref.current = object;
21
- }
22
- return ref.current;
20
+ var _useState = useState(object),
21
+ _useState2 = _slicedToArray(_useState, 2),
22
+ memoizedObject = _useState2[0],
23
+ setMemoizedObject = _useState2[1];
24
+ useUpdateEffect(function () {
25
+ if (!isEqual(object, memoizedObject)) {
26
+ setMemoizedObject(object);
27
+ }
28
+ }, [object]);
29
+ return memoizedObject;
23
30
  };
@@ -19,6 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
19
19
  import React, { useContext, useEffect, useRef, useMemo, useState, useCallback, Fragment } from 'react';
20
20
  import { Global } from '@emotion/react';
21
21
  import isEqual from 'lodash/isEqual';
22
+ import { EUI_EXPERIMENTAL_THEME_ENABLED_KEY } from '../../themes/themes';
22
23
  import { cloneElementWithCss } from '../emotion';
23
24
  import { css, cx } from '../emotion/css';
24
25
  import { CurrentEuiBreakpointProvider } from '../breakpoint/current_breakpoint';
@@ -70,6 +71,16 @@ export var EuiThemeProvider = function EuiThemeProvider(_ref) {
70
71
  _useState8 = _slicedToArray(_useState7, 2),
71
72
  theme = _useState8[0],
72
73
  setTheme = _useState8[1];
74
+
75
+ // TODO: temp. testing code only, remove once obsolete
76
+ useEffect(function () {
77
+ if (process.env.NODE_ENV === 'development') {
78
+ var isEnabled = localStorage.getItem(EUI_EXPERIMENTAL_THEME_ENABLED_KEY) != null;
79
+ if (!isEnabled) {
80
+ localStorage.setItem(EUI_EXPERIMENTAL_THEME_ENABLED_KEY, 'true');
81
+ }
82
+ }
83
+ }, []);
73
84
  useEffect(function () {
74
85
  var newSystem = _system || parentSystem;
75
86
  if (prevSystemKey.current !== newSystem.key) {
@@ -5,9 +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
-
9
- export var COLOR_MODES_STANDARD = {
10
- light: 'LIGHT',
11
- dark: 'DARK'
12
- };
13
- export var COLOR_MODES_INVERSE = 'INVERSE';
8
+ export { COLOR_MODES_STANDARD, COLOR_MODES_INVERSE } from '@elastic/eui-theme-common';