@elastic/eui 62.0.2 → 62.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (313) hide show
  1. package/dist/eui_charts_theme.js +330 -330
  2. package/dist/eui_charts_theme.js.map +1 -1
  3. package/dist/eui_theme_dark.css +1 -783
  4. package/dist/eui_theme_dark.json +0 -57
  5. package/dist/eui_theme_dark.json.d.ts +0 -57
  6. package/dist/eui_theme_dark.min.css +1 -1
  7. package/dist/eui_theme_light.css +1 -783
  8. package/dist/eui_theme_light.json +0 -57
  9. package/dist/eui_theme_light.json.d.ts +0 -57
  10. package/dist/eui_theme_light.min.css +1 -1
  11. package/es/components/breadcrumbs/breadcrumb.js +199 -0
  12. package/es/components/breadcrumbs/breadcrumb.styles.js +61 -0
  13. package/es/components/breadcrumbs/breadcrumbs.js +115 -187
  14. package/es/components/breadcrumbs/breadcrumbs.styles.js +30 -0
  15. package/es/components/code/code_block.js +119 -107
  16. package/es/components/collapsible_nav/collapsible_nav.js +2 -2
  17. package/es/components/control_bar/control_bar.js +13 -0
  18. package/es/components/datagrid/body/data_grid_body.js +12 -2
  19. package/es/components/datagrid/body/data_grid_cell.js +31 -3
  20. package/es/components/datagrid/body/header/data_grid_header_row.js +1 -1
  21. package/es/components/datagrid/controls/column_sorting_draggable.js +1 -1
  22. package/es/components/datagrid/data_grid.js +10 -2
  23. package/es/components/datagrid/utils/row_heights.js +33 -4
  24. package/es/components/date_picker/super_date_picker/super_date_picker.js +2 -2
  25. package/es/components/date_picker/super_date_picker/super_update_button.js +1 -1
  26. package/es/components/description_list/description_list.js +22 -26
  27. package/es/components/description_list/description_list.styles.js +25 -0
  28. package/es/components/description_list/description_list_context.js +14 -0
  29. package/es/components/description_list/description_list_description.js +43 -2
  30. package/es/components/description_list/description_list_description.styles.js +47 -0
  31. package/es/components/description_list/description_list_title.js +43 -2
  32. package/es/components/description_list/description_list_title.styles.js +37 -0
  33. package/es/components/description_list/description_list_types.js +10 -0
  34. package/es/components/header/header.js +1 -27
  35. package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +22 -2
  36. package/es/components/header/header_breadcrumbs/header_breadcrumbs.styles.js +15 -0
  37. package/es/components/header/header_links/header_links.js +9 -9
  38. package/es/components/icon/assets/tokenStruct.js +1 -1
  39. package/es/components/page/page_header/page_header.js +1 -0
  40. package/es/components/page/page_header/page_header_content.js +2 -1
  41. package/es/components/page/page_template.js +1 -0
  42. package/es/components/pagination/pagination.js +1 -1
  43. package/es/components/panel/split_panel/split_panel.js +2 -2
  44. package/es/components/popover/wrapping_popover.js +88 -45
  45. package/es/components/portal/portal.js +84 -38
  46. package/es/components/provider/provider.js +2 -2
  47. package/es/components/responsive/hide_for.js +6 -38
  48. package/es/components/responsive/show_for.js +6 -38
  49. package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +17 -36
  50. package/es/components/side_nav/side_nav.js +1 -1
  51. package/es/components/table/table_row_cell.js +1 -2
  52. package/es/components/toast/global_toast_list.js +208 -241
  53. package/es/components/toast/global_toast_list.styles.js +38 -0
  54. package/es/components/toast/global_toast_list_item.js +12 -7
  55. package/es/components/toast/toast.js +25 -25
  56. package/es/components/toast/toast.styles.js +55 -0
  57. package/es/components/token/index.js +2 -1
  58. package/es/components/token/token.js +48 -112
  59. package/es/components/token/token.styles.js +93 -0
  60. package/es/components/token/token_map.js +6 -9
  61. package/es/components/token/token_types.js +11 -0
  62. package/es/global_styling/reset/global_styles.js +1 -1
  63. package/es/services/{breakpoint.js → breakpoint/breakpoint.js} +4 -9
  64. package/es/services/{hooks/useIsWithinBreakpoints.js → breakpoint/currentEuiBreakpoint.js} +36 -28
  65. package/es/services/breakpoint/index.js +10 -0
  66. package/es/services/breakpoint/useIsWithinBreakpoints.js +24 -0
  67. package/es/services/hooks/index.js +0 -1
  68. package/es/services/index.js +1 -1
  69. package/es/test/rtl/component_helpers.js +60 -1
  70. package/eui.d.ts +1787 -1550
  71. package/i18ntokens.json +36 -36
  72. package/lib/components/breadcrumbs/breadcrumb.js +225 -0
  73. package/lib/components/breadcrumbs/breadcrumb.styles.js +68 -0
  74. package/lib/components/breadcrumbs/breadcrumbs.js +125 -188
  75. package/lib/components/breadcrumbs/breadcrumbs.styles.js +33 -0
  76. package/lib/components/code/code_block.js +118 -106
  77. package/lib/components/collapsible_nav/collapsible_nav.js +2 -2
  78. package/lib/components/control_bar/control_bar.js +13 -0
  79. package/lib/components/datagrid/body/data_grid_body.js +12 -2
  80. package/lib/components/datagrid/body/data_grid_cell.js +31 -3
  81. package/lib/components/datagrid/body/header/data_grid_header_row.js +1 -1
  82. package/lib/components/datagrid/controls/column_sorting_draggable.js +1 -1
  83. package/lib/components/datagrid/data_grid.js +10 -2
  84. package/lib/components/datagrid/utils/row_heights.js +33 -4
  85. package/lib/components/date_picker/super_date_picker/super_date_picker.js +2 -2
  86. package/lib/components/date_picker/super_date_picker/super_update_button.js +1 -1
  87. package/lib/components/description_list/description_list.js +25 -31
  88. package/lib/components/description_list/description_list.styles.js +36 -0
  89. package/lib/components/description_list/description_list_context.js +24 -0
  90. package/lib/components/description_list/description_list_description.js +52 -2
  91. package/lib/components/description_list/description_list_description.styles.js +51 -0
  92. package/lib/components/description_list/description_list_title.js +52 -2
  93. package/lib/components/description_list/description_list_title.styles.js +50 -0
  94. package/lib/components/description_list/description_list_types.js +20 -0
  95. package/lib/components/header/header.js +1 -27
  96. package/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +24 -2
  97. package/lib/components/header/header_breadcrumbs/header_breadcrumbs.styles.js +26 -0
  98. package/lib/components/header/header_links/header_links.js +8 -8
  99. package/lib/components/icon/assets/tokenStruct.js +1 -1
  100. package/lib/components/icon/svgs/tokens/tokenStruct.svg +1 -1
  101. package/lib/components/page/page_header/page_header.js +1 -0
  102. package/lib/components/page/page_header/page_header_content.js +3 -2
  103. package/lib/components/page/page_template.js +1 -0
  104. package/lib/components/pagination/pagination.js +1 -1
  105. package/lib/components/panel/split_panel/split_panel.js +3 -3
  106. package/lib/components/popover/wrapping_popover.js +85 -44
  107. package/lib/components/portal/portal.js +87 -39
  108. package/lib/components/provider/provider.js +1 -1
  109. package/lib/components/responsive/hide_for.js +12 -44
  110. package/lib/components/responsive/show_for.js +12 -44
  111. package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +15 -35
  112. package/lib/components/side_nav/side_nav.js +1 -1
  113. package/lib/components/table/table_row_cell.js +1 -3
  114. package/lib/components/toast/global_toast_list.js +209 -238
  115. package/lib/components/toast/global_toast_list.styles.js +45 -0
  116. package/lib/components/toast/global_toast_list_item.js +14 -7
  117. package/lib/components/toast/toast.js +27 -25
  118. package/lib/components/toast/toast.styles.js +66 -0
  119. package/lib/components/token/index.js +5 -3
  120. package/lib/components/token/token.js +50 -120
  121. package/lib/components/token/token.styles.js +101 -0
  122. package/lib/components/token/token_map.js +6 -9
  123. package/lib/components/token/token_types.js +22 -0
  124. package/lib/global_styling/reset/global_styles.js +1 -1
  125. package/{test-env/services → lib/services/breakpoint}/breakpoint.js +5 -9
  126. package/lib/services/breakpoint/currentEuiBreakpoint.js +80 -0
  127. package/lib/services/breakpoint/index.js +44 -0
  128. package/lib/services/breakpoint/useIsWithinBreakpoints.js +34 -0
  129. package/lib/services/hooks/index.js +0 -13
  130. package/lib/services/index.js +28 -0
  131. package/lib/test/rtl/component_helpers.js +69 -3
  132. package/optimize/es/components/breadcrumbs/breadcrumb.js +136 -0
  133. package/optimize/es/components/breadcrumbs/breadcrumb.styles.js +61 -0
  134. package/optimize/es/components/breadcrumbs/breadcrumbs.js +92 -165
  135. package/optimize/es/components/breadcrumbs/breadcrumbs.styles.js +30 -0
  136. package/optimize/es/components/code/code_block.js +106 -107
  137. package/optimize/es/components/datagrid/body/data_grid_body.js +2 -0
  138. package/optimize/es/components/datagrid/body/data_grid_cell.js +13 -1
  139. package/optimize/es/components/datagrid/utils/row_heights.js +33 -4
  140. package/optimize/es/components/description_list/description_list.js +20 -24
  141. package/optimize/es/components/description_list/description_list.styles.js +25 -0
  142. package/optimize/es/components/description_list/description_list_context.js +14 -0
  143. package/optimize/es/components/description_list/description_list_description.js +32 -2
  144. package/optimize/es/components/description_list/description_list_description.styles.js +47 -0
  145. package/optimize/es/components/description_list/description_list_title.js +32 -2
  146. package/optimize/es/components/description_list/description_list_title.styles.js +37 -0
  147. package/optimize/es/components/description_list/description_list_types.js +10 -0
  148. package/optimize/es/components/header/header_breadcrumbs/header_breadcrumbs.js +8 -1
  149. package/optimize/es/components/header/header_breadcrumbs/header_breadcrumbs.styles.js +15 -0
  150. package/optimize/es/components/header/header_links/header_links.js +8 -8
  151. package/optimize/es/components/icon/assets/tokenStruct.js +1 -1
  152. package/optimize/es/components/page/page_header/page_header_content.js +1 -1
  153. package/optimize/es/components/panel/split_panel/split_panel.js +1 -1
  154. package/optimize/es/components/popover/wrapping_popover.js +79 -38
  155. package/optimize/es/components/portal/portal.js +66 -34
  156. package/optimize/es/components/provider/provider.js +2 -2
  157. package/optimize/es/components/responsive/hide_for.js +5 -27
  158. package/optimize/es/components/responsive/show_for.js +5 -27
  159. package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide.js +16 -35
  160. package/optimize/es/components/table/table_row_cell.js +1 -2
  161. package/optimize/es/components/toast/global_toast_list.js +199 -230
  162. package/optimize/es/components/toast/global_toast_list.styles.js +38 -0
  163. package/optimize/es/components/toast/global_toast_list_item.js +11 -6
  164. package/optimize/es/components/toast/toast.js +24 -24
  165. package/optimize/es/components/toast/toast.styles.js +55 -0
  166. package/optimize/es/components/token/index.js +2 -1
  167. package/optimize/es/components/token/token.js +46 -69
  168. package/optimize/es/components/token/token.styles.js +83 -0
  169. package/optimize/es/components/token/token_map.js +6 -9
  170. package/optimize/es/components/token/token_types.js +11 -0
  171. package/optimize/es/global_styling/reset/global_styles.js +1 -1
  172. package/optimize/es/services/{breakpoint.js → breakpoint/breakpoint.js} +4 -9
  173. package/optimize/es/services/breakpoint/currentEuiBreakpoint.js +53 -0
  174. package/optimize/es/services/breakpoint/index.js +10 -0
  175. package/optimize/es/services/breakpoint/useIsWithinBreakpoints.js +24 -0
  176. package/optimize/es/services/hooks/index.js +0 -1
  177. package/optimize/es/services/index.js +1 -1
  178. package/optimize/es/test/rtl/component_helpers.js +60 -1
  179. package/optimize/lib/components/breadcrumbs/breadcrumb.js +162 -0
  180. package/optimize/lib/components/breadcrumbs/breadcrumb.styles.js +68 -0
  181. package/optimize/lib/components/breadcrumbs/breadcrumbs.js +99 -164
  182. package/optimize/lib/components/breadcrumbs/breadcrumbs.styles.js +33 -0
  183. package/optimize/lib/components/code/code_block.js +105 -106
  184. package/optimize/lib/components/datagrid/body/data_grid_body.js +2 -0
  185. package/optimize/lib/components/datagrid/body/data_grid_cell.js +13 -1
  186. package/optimize/lib/components/datagrid/utils/row_heights.js +33 -4
  187. package/optimize/lib/components/description_list/description_list.js +23 -28
  188. package/optimize/lib/components/description_list/description_list.styles.js +36 -0
  189. package/optimize/lib/components/description_list/description_list_context.js +24 -0
  190. package/optimize/lib/components/description_list/description_list_description.js +43 -2
  191. package/optimize/lib/components/description_list/description_list_description.styles.js +51 -0
  192. package/optimize/lib/components/description_list/description_list_title.js +43 -2
  193. package/optimize/lib/components/description_list/description_list_title.styles.js +50 -0
  194. package/optimize/lib/components/description_list/description_list_types.js +20 -0
  195. package/optimize/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +10 -1
  196. package/optimize/lib/components/header/header_breadcrumbs/header_breadcrumbs.styles.js +26 -0
  197. package/optimize/lib/components/header/header_links/header_links.js +7 -7
  198. package/optimize/lib/components/icon/assets/tokenStruct.js +1 -1
  199. package/optimize/lib/components/icon/svgs/tokens/tokenStruct.svg +1 -1
  200. package/optimize/lib/components/page/page_header/page_header_content.js +2 -2
  201. package/optimize/lib/components/panel/split_panel/split_panel.js +2 -2
  202. package/optimize/lib/components/popover/wrapping_popover.js +78 -38
  203. package/optimize/lib/components/portal/portal.js +65 -44
  204. package/optimize/lib/components/provider/provider.js +1 -1
  205. package/optimize/lib/components/responsive/hide_for.js +4 -33
  206. package/optimize/lib/components/responsive/show_for.js +4 -33
  207. package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +14 -34
  208. package/optimize/lib/components/table/table_row_cell.js +1 -3
  209. package/optimize/lib/components/toast/global_toast_list.js +206 -220
  210. package/optimize/lib/components/toast/global_toast_list.styles.js +47 -0
  211. package/optimize/lib/components/toast/global_toast_list_item.js +14 -7
  212. package/optimize/lib/components/toast/toast.js +26 -24
  213. package/optimize/lib/components/toast/toast.styles.js +66 -0
  214. package/optimize/lib/components/token/index.js +5 -3
  215. package/optimize/lib/components/token/token.js +50 -76
  216. package/optimize/lib/components/token/token.styles.js +91 -0
  217. package/optimize/lib/components/token/token_map.js +6 -9
  218. package/optimize/lib/components/token/token_types.js +22 -0
  219. package/optimize/lib/global_styling/reset/global_styles.js +1 -1
  220. package/optimize/lib/services/{breakpoint.js → breakpoint/breakpoint.js} +5 -9
  221. package/optimize/lib/services/breakpoint/currentEuiBreakpoint.js +81 -0
  222. package/optimize/lib/services/breakpoint/index.js +44 -0
  223. package/optimize/lib/services/breakpoint/useIsWithinBreakpoints.js +34 -0
  224. package/optimize/lib/services/hooks/index.js +0 -13
  225. package/optimize/lib/services/index.js +28 -0
  226. package/optimize/lib/test/rtl/component_helpers.js +69 -3
  227. package/package.json +2 -2
  228. package/src/components/control_bar/_control_bar.scss +1 -1
  229. package/src/components/header/_index.scss +0 -1
  230. package/src/components/index.scss +0 -5
  231. package/src/themes/amsterdam/overrides/_breadcrumbs.scss +0 -12
  232. package/src/themes/amsterdam/overrides/_index.scss +0 -4
  233. package/test-env/components/breadcrumbs/breadcrumb.js +211 -0
  234. package/test-env/components/breadcrumbs/breadcrumb.styles.js +68 -0
  235. package/test-env/components/breadcrumbs/breadcrumbs.js +122 -174
  236. package/test-env/components/breadcrumbs/breadcrumbs.styles.js +33 -0
  237. package/test-env/components/collapsible_nav/collapsible_nav.js +2 -2
  238. package/test-env/components/control_bar/control_bar.js +13 -0
  239. package/test-env/components/datagrid/body/data_grid_body.js +12 -2
  240. package/test-env/components/datagrid/body/data_grid_cell.js +31 -3
  241. package/test-env/components/datagrid/body/header/data_grid_header_row.js +1 -1
  242. package/test-env/components/datagrid/controls/column_sorting_draggable.js +1 -1
  243. package/test-env/components/datagrid/data_grid.js +10 -2
  244. package/test-env/components/datagrid/utils/row_heights.js +33 -4
  245. package/test-env/components/date_picker/super_date_picker/super_date_picker.js +2 -2
  246. package/test-env/components/date_picker/super_date_picker/super_update_button.js +1 -1
  247. package/test-env/components/description_list/description_list.js +25 -30
  248. package/test-env/components/description_list/description_list.styles.js +36 -0
  249. package/test-env/components/description_list/description_list_context.js +24 -0
  250. package/test-env/components/description_list/description_list_description.js +43 -2
  251. package/test-env/components/description_list/description_list_description.styles.js +51 -0
  252. package/test-env/components/description_list/description_list_title.js +43 -2
  253. package/test-env/components/description_list/description_list_title.styles.js +50 -0
  254. package/test-env/components/description_list/description_list_types.js +20 -0
  255. package/test-env/components/header/header.js +1 -27
  256. package/test-env/components/header/header_breadcrumbs/header_breadcrumbs.js +24 -2
  257. package/test-env/components/header/header_breadcrumbs/header_breadcrumbs.styles.js +26 -0
  258. package/test-env/components/header/header_links/header_links.js +8 -8
  259. package/test-env/components/icon/assets/tokenStruct.js +1 -1
  260. package/test-env/components/observer/resize_observer/resize_observer.js +43 -126
  261. package/test-env/components/page/page_header/page_header.js +1 -0
  262. package/test-env/components/page/page_header/page_header_content.js +3 -2
  263. package/test-env/components/page/page_template.js +1 -0
  264. package/test-env/components/pagination/pagination.js +1 -1
  265. package/test-env/components/panel/split_panel/split_panel.js +3 -3
  266. package/test-env/components/popover/wrapping_popover.js +78 -38
  267. package/test-env/components/portal/portal.js +79 -45
  268. package/test-env/components/provider/provider.js +1 -1
  269. package/test-env/components/responsive/hide_for.js +5 -34
  270. package/test-env/components/responsive/show_for.js +5 -34
  271. package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +15 -35
  272. package/test-env/components/side_nav/side_nav.js +1 -1
  273. package/test-env/components/table/table_row_cell.js +1 -3
  274. package/test-env/components/toast/global_toast_list.js +206 -220
  275. package/test-env/components/toast/global_toast_list.styles.js +47 -0
  276. package/test-env/components/toast/global_toast_list_item.js +14 -7
  277. package/test-env/components/toast/toast.js +27 -25
  278. package/test-env/components/toast/toast.styles.js +66 -0
  279. package/test-env/components/token/index.js +5 -3
  280. package/test-env/components/token/token.js +51 -120
  281. package/test-env/components/token/token.styles.js +91 -0
  282. package/test-env/components/token/token_map.js +6 -9
  283. package/test-env/components/token/token_types.js +22 -0
  284. package/test-env/global_styling/reset/global_styles.js +1 -1
  285. package/{lib/services → test-env/services/breakpoint}/breakpoint.js +5 -9
  286. package/test-env/services/breakpoint/currentEuiBreakpoint.js +37 -0
  287. package/test-env/services/breakpoint/index.js +44 -0
  288. package/test-env/services/breakpoint/useIsWithinBreakpoints.js +34 -0
  289. package/test-env/services/hooks/index.js +0 -13
  290. package/test-env/services/index.js +28 -0
  291. package/test-env/test/rtl/component_helpers.js +69 -3
  292. package/lib/services/hooks/useIsWithinBreakpoints.js +0 -57
  293. package/optimize/es/services/hooks/useIsWithinBreakpoints.js +0 -46
  294. package/optimize/lib/services/hooks/useIsWithinBreakpoints.js +0 -57
  295. package/src/components/breadcrumbs/_breadcrumbs.scss +0 -79
  296. package/src/components/breadcrumbs/_index.scss +0 -2
  297. package/src/components/breadcrumbs/_variables.scss +0 -2
  298. package/src/components/description_list/_description_list.scss +0 -211
  299. package/src/components/description_list/_index.scss +0 -1
  300. package/src/components/header/header_breadcrumbs/_header_breadcrumbs.scss +0 -8
  301. package/src/components/header/header_breadcrumbs/_index.scss +0 -1
  302. package/src/components/portal/_index.scss +0 -1
  303. package/src/components/portal/_portal.scss +0 -6
  304. package/src/components/toast/_global_toast_list.scss +0 -90
  305. package/src/components/toast/_index.scss +0 -4
  306. package/src/components/toast/_toast.scss +0 -103
  307. package/src/components/token/_index.scss +0 -2
  308. package/src/components/token/_token.scss +0 -85
  309. package/src/components/token/_variables.scss +0 -13
  310. package/src/themes/amsterdam/overrides/_header_breadcrumbs.scss +0 -71
  311. package/src/themes/amsterdam/overrides/_toast.scss +0 -21
  312. package/src/themes/amsterdam/overrides/_token.scss +0 -4
  313. package/test-env/services/hooks/useIsWithinBreakpoints.js +0 -57
@@ -141,7 +141,7 @@ var EuiCodeBlock = function EuiCodeBlock(_ref) {
141
141
  }),
142
142
  innerTextRef = _useCopy.innerTextRef,
143
143
  showCopyButton = _useCopy.showCopyButton,
144
- CopyButton = _useCopy.CopyButton;
144
+ textToCopy = _useCopy.textToCopy;
145
145
 
146
146
  var _useOverflowDetection = useOverflowDetection(),
147
147
  setWrapperRef = _useOverflowDetection.setWrapperRef,
@@ -154,8 +154,8 @@ var EuiCodeBlock = function EuiCodeBlock(_ref) {
154
154
  }),
155
155
  showFullScreenButton = _useFullScreen.showFullScreenButton,
156
156
  onKeyDown = _useFullScreen.onKeyDown,
157
- FullScreenButton = _useFullScreen.FullScreenButton,
158
- FullScreenDisplay = _useFullScreen.FullScreenDisplay; // Classes used in both fullscreen and non-fullscreen mode
157
+ isFullScreen = _useFullScreen.isFullScreen,
158
+ toggleFullScreen = _useFullScreen.toggleFullScreen; // Classes used in both fullscreen and non-fullscreen mode
159
159
 
160
160
 
161
161
  var wrapperClasses = (0, _classnames.default)(className, 'euiCodeBlock', {
@@ -185,25 +185,32 @@ var EuiCodeBlock = function EuiCodeBlock(_ref) {
185
185
  onKeyDown: onKeyDown
186
186
  };
187
187
  }, [preClasses, onKeyDown]);
188
- var optionalStyles = {};
189
-
190
- if (overflowHeight) {
191
- var property = typeof overflowHeight === 'string' ? 'height' : 'maxHeight';
192
- optionalStyles[property] = overflowHeight;
193
- }
194
-
195
- var wrapperProps = {
196
- className: classes,
197
- style: optionalStyles
198
- };
199
- var codeBlockControls;
200
-
201
- if (showCopyButton || showFullScreenButton) {
202
- codeBlockControls = (0, _react2.jsx)("div", {
203
- className: "euiCodeBlock__controls"
204
- }, (0, _react2.jsx)(FullScreenButton, null), (0, _react2.jsx)(CopyButton, null));
205
- }
188
+ var overflowHeightStyles = (0, _react.useMemo)(function () {
189
+ if (overflowHeight) {
190
+ var property = typeof overflowHeight === 'string' ? 'height' : 'maxHeight';
191
+ return (0, _defineProperty2.default)({}, property, overflowHeight);
192
+ }
206
193
 
194
+ return {};
195
+ }, [overflowHeight]);
196
+ var wrapperProps = (0, _react.useMemo)(function () {
197
+ return {
198
+ className: classes,
199
+ style: overflowHeightStyles
200
+ };
201
+ }, [classes, overflowHeightStyles]);
202
+ var codeBlockControls = (0, _react.useMemo)(function () {
203
+ if (showCopyButton || showFullScreenButton) {
204
+ return (0, _react2.jsx)("div", {
205
+ className: "euiCodeBlock__controls"
206
+ }, showFullScreenButton && (0, _react2.jsx)(FullScreenButton, {
207
+ isFullScreen: isFullScreen,
208
+ toggleFullScreen: toggleFullScreen
209
+ }), showCopyButton && (0, _react2.jsx)(CopyButton, {
210
+ textToCopy: textToCopy
211
+ }));
212
+ }
213
+ }, [isFullScreen, toggleFullScreen, showCopyButton, showFullScreenButton, textToCopy]);
207
214
  return (0, _react2.jsx)("div", wrapperProps, isVirtualized ? (0, _react2.jsx)(VirtualizedCodeBlock, {
208
215
  data: data,
209
216
  rowHeight: fontSizeToRowHeightMap[fontSize],
@@ -213,10 +220,10 @@ var EuiCodeBlock = function EuiCodeBlock(_ref) {
213
220
  codeProps: codeProps
214
221
  }) : (0, _react2.jsx)("pre", {
215
222
  ref: combinedRef,
216
- style: optionalStyles,
223
+ style: overflowHeightStyles,
217
224
  className: preClasses,
218
225
  tabIndex: tabIndex
219
- }, (0, _react2.jsx)("code", codeProps, content)), codeBlockControls, (0, _react2.jsx)(FullScreenDisplay, {
226
+ }, (0, _react2.jsx)("code", codeProps, content)), codeBlockControls, isFullScreen && (0, _react2.jsx)(FullScreenDisplay, {
220
227
  className: wrapperClasses
221
228
  }, isVirtualized ? (0, _react2.jsx)(VirtualizedCodeBlock, {
222
229
  data: data,
@@ -276,10 +283,27 @@ var useOverflowDetection = function useOverflowDetection() {
276
283
  */
277
284
 
278
285
 
279
- var useCopy = function useCopy(_ref2) {
280
- var isCopyable = _ref2.isCopyable,
281
- isVirtualized = _ref2.isVirtualized,
282
- children = _ref2.children;
286
+ var CopyButton = function CopyButton(_ref3) {
287
+ var textToCopy = _ref3.textToCopy;
288
+ var copyButton = (0, _i18n.useEuiI18n)('euiCodeBlock.copyButton', 'Copy');
289
+ return (0, _react2.jsx)("div", {
290
+ className: "euiCodeBlock__copyButton"
291
+ }, (0, _react2.jsx)(_copy.EuiCopy, {
292
+ textToCopy: textToCopy
293
+ }, function (copy) {
294
+ return (0, _react2.jsx)(_button.EuiButtonIcon, {
295
+ onClick: copy,
296
+ iconType: "copyClipboard",
297
+ color: "text",
298
+ "aria-label": copyButton
299
+ });
300
+ }));
301
+ };
302
+
303
+ var useCopy = function useCopy(_ref4) {
304
+ var isCopyable = _ref4.isCopyable,
305
+ isVirtualized = _ref4.isVirtualized,
306
+ children = _ref4.children;
283
307
 
284
308
  var _useInnerText = (0, _inner_text.useInnerText)(''),
285
309
  _useInnerText2 = (0, _slicedToArray2.default)(_useInnerText, 2),
@@ -292,32 +316,10 @@ var useCopy = function useCopy(_ref2) {
292
316
  var textToCopy = isVirtualized ? "".concat(children) : innerText; // Virtualized code blocks do not have inner text
293
317
 
294
318
  var showCopyButton = isCopyable && textToCopy;
295
-
296
- var CopyButton = function CopyButton() {
297
- if (!showCopyButton) return null;
298
- return (0, _react2.jsx)("div", {
299
- className: "euiCodeBlock__copyButton"
300
- }, (0, _react2.jsx)(_i18n.EuiI18n, {
301
- token: "euiCodeBlock.copyButton",
302
- default: "Copy"
303
- }, function (copyButton) {
304
- return (0, _react2.jsx)(_copy.EuiCopy, {
305
- textToCopy: textToCopy
306
- }, function (copy) {
307
- return (0, _react2.jsx)(_button.EuiButtonIcon, {
308
- onClick: copy,
309
- iconType: "copyClipboard",
310
- color: "text",
311
- "aria-label": copyButton
312
- });
313
- });
314
- }));
315
- };
316
-
317
319
  return {
318
320
  innerTextRef: innerTextRef,
319
321
  showCopyButton: showCopyButton,
320
- CopyButton: CopyButton
322
+ textToCopy: textToCopy
321
323
  };
322
324
  };
323
325
  /**
@@ -325,18 +327,50 @@ var useCopy = function useCopy(_ref2) {
325
327
  */
326
328
 
327
329
 
328
- var useFullScreen = function useFullScreen(_ref3) {
329
- var overflowHeight = _ref3.overflowHeight;
330
+ var FullScreenButton = function FullScreenButton(_ref5) {
331
+ var isFullScreen = _ref5.isFullScreen,
332
+ toggleFullScreen = _ref5.toggleFullScreen;
333
+
334
+ var _useEuiI18n = (0, _i18n.useEuiI18n)(['euiCodeBlock.fullscreenCollapse', 'euiCodeBlock.fullscreenExpand'], ['Collapse', 'Expand']),
335
+ _useEuiI18n2 = (0, _slicedToArray2.default)(_useEuiI18n, 2),
336
+ fullscreenCollapse = _useEuiI18n2[0],
337
+ fullscreenExpand = _useEuiI18n2[1];
338
+
339
+ return (0, _react2.jsx)(_button.EuiButtonIcon, {
340
+ className: "euiCodeBlock__fullScreenButton",
341
+ onClick: toggleFullScreen,
342
+ iconType: isFullScreen ? 'fullScreenExit' : 'fullScreen',
343
+ color: "text",
344
+ "aria-label": isFullScreen ? fullscreenCollapse : fullscreenExpand
345
+ });
346
+ };
347
+
348
+ var FullScreenDisplay = function FullScreenDisplay(_ref6) {
349
+ var children = _ref6.children,
350
+ className = _ref6.className;
351
+ // Force fullscreen to use large font and padding.
352
+ var fullScreenClasses = (0, _classnames.default)(className, 'euiCodeBlock--fontLarge', 'euiCodeBlock--paddingLarge', 'euiCodeBlock-isFullScreen'); // Attaches to the body because of EuiOverlayMask's React portal usage.
353
+
354
+ return (0, _react2.jsx)(_overlay_mask.EuiOverlayMask, null, (0, _react2.jsx)(_focus_trap.EuiFocusTrap, {
355
+ clickOutsideDisables: true
356
+ }, (0, _react2.jsx)("div", {
357
+ className: fullScreenClasses
358
+ }, children)));
359
+ };
360
+
361
+ var useFullScreen = function useFullScreen(_ref7) {
362
+ var overflowHeight = _ref7.overflowHeight;
330
363
 
331
364
  var _useState5 = (0, _react.useState)(false),
332
365
  _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
333
366
  isFullScreen = _useState6[0],
334
367
  setIsFullScreen = _useState6[1];
335
368
 
336
- var toggleFullScreen = function toggleFullScreen() {
337
- setIsFullScreen(!isFullScreen);
338
- };
339
-
369
+ var toggleFullScreen = (0, _react.useCallback)(function () {
370
+ setIsFullScreen(function (isFullScreen) {
371
+ return !isFullScreen;
372
+ });
373
+ }, []);
340
374
  var onKeyDown = (0, _react.useCallback)(function (event) {
341
375
  if (event.key === _services.keys.ESCAPE) {
342
376
  event.preventDefault();
@@ -345,45 +379,10 @@ var useFullScreen = function useFullScreen(_ref3) {
345
379
  }
346
380
  }, []);
347
381
  var showFullScreenButton = !!overflowHeight;
348
-
349
- var FullScreenButton = function FullScreenButton() {
350
- if (!showFullScreenButton) return null;
351
- return (0, _react2.jsx)(_i18n.EuiI18n, {
352
- tokens: ['euiCodeBlock.fullscreenCollapse', 'euiCodeBlock.fullscreenExpand'],
353
- defaults: ['Collapse', 'Expand']
354
- }, function (_ref4) {
355
- var _ref5 = (0, _slicedToArray2.default)(_ref4, 2),
356
- fullscreenCollapse = _ref5[0],
357
- fullscreenExpand = _ref5[1];
358
-
359
- return (0, _react2.jsx)(_button.EuiButtonIcon, {
360
- className: "euiCodeBlock__fullScreenButton",
361
- onClick: toggleFullScreen,
362
- iconType: isFullScreen ? 'fullScreenExit' : 'fullScreen',
363
- color: "text",
364
- "aria-label": isFullScreen ? fullscreenCollapse : fullscreenExpand
365
- });
366
- });
367
- };
368
-
369
- var FullScreenDisplay = function FullScreenDisplay(_ref6) {
370
- var children = _ref6.children,
371
- className = _ref6.className;
372
- if (!isFullScreen) return null; // Force fullscreen to use large font and padding.
373
-
374
- var fullScreenClasses = (0, _classnames.default)(className, 'euiCodeBlock--fontLarge', 'euiCodeBlock--paddingLarge', 'euiCodeBlock-isFullScreen'); // Attaches to the body because of EuiOverlayMask's React portal usage.
375
-
376
- return (0, _react2.jsx)(_overlay_mask.EuiOverlayMask, null, (0, _react2.jsx)(_focus_trap.EuiFocusTrap, {
377
- clickOutsideDisables: true
378
- }, (0, _react2.jsx)("div", {
379
- className: fullScreenClasses
380
- }, children)));
381
- };
382
-
383
382
  return {
384
383
  showFullScreenButton: showFullScreenButton,
385
- FullScreenButton: FullScreenButton,
386
- FullScreenDisplay: FullScreenDisplay,
384
+ isFullScreen: isFullScreen,
385
+ toggleFullScreen: toggleFullScreen,
387
386
  onKeyDown: onKeyDown
388
387
  };
389
388
  };
@@ -392,21 +391,21 @@ var useFullScreen = function useFullScreen(_ref3) {
392
391
  */
393
392
 
394
393
 
395
- var ListRow = function ListRow(_ref7) {
396
- var data = _ref7.data,
397
- index = _ref7.index,
398
- style = _ref7.style;
394
+ var ListRow = function ListRow(_ref8) {
395
+ var data = _ref8.data,
396
+ index = _ref8.index,
397
+ style = _ref8.style;
399
398
  var row = data[index];
400
399
  row.properties.style = style;
401
400
  return (0, _utils.nodeToHtml)(row, index, data, 0);
402
401
  };
403
402
 
404
- var VirtualizedCodeBlock = function VirtualizedCodeBlock(_ref8) {
405
- var data = _ref8.data,
406
- rowHeight = _ref8.rowHeight,
407
- overflowHeight = _ref8.overflowHeight,
408
- preProps = _ref8.preProps,
409
- codeProps = _ref8.codeProps;
403
+ var VirtualizedCodeBlock = function VirtualizedCodeBlock(_ref9) {
404
+ var data = _ref9.data,
405
+ rowHeight = _ref9.rowHeight,
406
+ overflowHeight = _ref9.overflowHeight,
407
+ preProps = _ref9.preProps,
408
+ codeProps = _ref9.codeProps;
410
409
  var VirtualizedOuterElement = (0, _react.useMemo)(function () {
411
410
  return /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
412
411
  return (0, _react2.jsx)("pre", (0, _extends2.default)({}, props, {
@@ -423,9 +422,9 @@ var VirtualizedCodeBlock = function VirtualizedCodeBlock(_ref8) {
423
422
  }, [codeProps]);
424
423
  return (0, _react2.jsx)(_auto_sizer.EuiAutoSizer, {
425
424
  disableHeight: typeof overflowHeight === 'number'
426
- }, function (_ref9) {
427
- var height = _ref9.height,
428
- width = _ref9.width;
425
+ }, function (_ref10) {
426
+ var height = _ref10.height,
427
+ width = _ref10.width;
429
428
  return (0, _react2.jsx)(_reactWindow.FixedSizeList, {
430
429
  height: height !== null && height !== void 0 ? height : overflowHeight,
431
430
  width: width,
@@ -354,6 +354,8 @@ var EuiDataGridBody = function EuiDataGridBody(props) {
354
354
 
355
355
  var rowHeightUtils = (0, _row_heights.useRowHeightUtils)({
356
356
  gridRef: gridRef,
357
+ outerGridElementRef: outerGridRef,
358
+ gridItemsRenderedRef: gridItemsRendered,
357
359
  gridStyles: gridStyles,
358
360
  columns: columns,
359
361
  rowHeightsOptions: rowHeightsOptions
@@ -413,7 +413,7 @@ var EuiDataGridCell = /*#__PURE__*/function (_Component) {
413
413
  }, {
414
414
  key: "componentDidUpdate",
415
415
  value: function componentDidUpdate(prevProps) {
416
- var _this$props$rowHeight, _prevProps$rowHeights;
416
+ var _this$props$rowHeight, _prevProps$rowHeights, _this$props$rowHeight2, _this$props$style, _prevProps$style;
417
417
 
418
418
  this.recalculateAutoHeight();
419
419
 
@@ -421,6 +421,18 @@ var EuiDataGridCell = /*#__PURE__*/function (_Component) {
421
421
  this.recalculateLineHeight();
422
422
  }
423
423
 
424
+ if ((_this$props$rowHeight2 = this.props.rowHeightsOptions) !== null && _this$props$rowHeight2 !== void 0 && _this$props$rowHeight2.scrollAnchorRow && this.props.colIndex === 0 && // once per row
425
+ this.props.columnId === prevProps.columnId && // if this is still the same column
426
+ this.props.rowIndex === prevProps.rowIndex && // if this is still the same row
427
+ ((_this$props$style = this.props.style) === null || _this$props$style === void 0 ? void 0 : _this$props$style.top) !== ((_prevProps$style = prevProps.style) === null || _prevProps$style === void 0 ? void 0 : _prevProps$style.top) // if the top position has changed
428
+ ) {
429
+ var _prevProps$style2, _this$props$style2, _this$props$rowHeight3, _this$props$rowHeight4;
430
+
431
+ var previousTop = parseFloat((_prevProps$style2 = prevProps.style) === null || _prevProps$style2 === void 0 ? void 0 : _prevProps$style2.top);
432
+ var currentTop = parseFloat((_this$props$style2 = this.props.style) === null || _this$props$style2 === void 0 ? void 0 : _this$props$style2.top);
433
+ (_this$props$rowHeight3 = this.props.rowHeightUtils) === null || _this$props$rowHeight3 === void 0 ? void 0 : _this$props$rowHeight3.compensateForLayoutShift(this.props.rowIndex, currentTop - previousTop, (_this$props$rowHeight4 = this.props.rowHeightsOptions) === null || _this$props$rowHeight4 === void 0 ? void 0 : _this$props$rowHeight4.scrollAnchorRow);
434
+ }
435
+
424
436
  if (this.props.popoverContext.popoverIsOpen !== prevProps.popoverContext.popoverIsOpen || this.props.popoverContext.cellLocation !== prevProps.popoverContext.cellLocation || this.props.renderCellPopover !== prevProps.renderCellPopover) {
425
437
  this.handleCellPopover();
426
438
  }
@@ -19,10 +19,10 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
19
19
 
20
20
  var _react = require("react");
21
21
 
22
- var _predicate = require("../../../services/predicate");
23
-
24
22
  var _services = require("../../../services");
25
23
 
24
+ var _predicate = require("../../../services/predicate");
25
+
26
26
  var _sorting = require("./sorting");
27
27
 
28
28
  /*
@@ -45,11 +45,13 @@ var DEFAULT_ROW_HEIGHT = 34;
45
45
  exports.DEFAULT_ROW_HEIGHT = DEFAULT_ROW_HEIGHT;
46
46
 
47
47
  var RowHeightUtils = /*#__PURE__*/function () {
48
- function RowHeightUtils(gridRef, rerenderGridBodyRef) {
48
+ function RowHeightUtils(gridRef, outerGridElementRef, gridItemsRenderedRef, rerenderGridBodyRef) {
49
49
  var _this = this;
50
50
 
51
51
  (0, _classCallCheck2.default)(this, RowHeightUtils);
52
52
  this.gridRef = gridRef;
53
+ this.outerGridElementRef = outerGridElementRef;
54
+ this.gridItemsRenderedRef = gridItemsRenderedRef;
53
55
  this.rerenderGridBodyRef = rerenderGridBodyRef;
54
56
  (0, _defineProperty2.default)(this, "styles", {
55
57
  paddingTop: 0,
@@ -240,6 +242,31 @@ var RowHeightUtils = /*#__PURE__*/function () {
240
242
  (_this$gridRef$current = this.gridRef.current) === null || _this$gridRef$current === void 0 ? void 0 : _this$gridRef$current.resetAfterRowIndex(this.lastUpdatedRow);
241
243
  this.lastUpdatedRow = Infinity;
242
244
  }
245
+ }, {
246
+ key: "compensateForLayoutShift",
247
+ value: function compensateForLayoutShift(rowIndex, verticalLayoutShift, anchorRow) {
248
+ var grid = this.gridRef.current;
249
+ var outerGridElement = this.outerGridElementRef.current;
250
+ var renderedItems = this.gridItemsRenderedRef.current;
251
+
252
+ if (grid == null || outerGridElement == null || renderedItems == null || anchorRow == null || !Number.isFinite(verticalLayoutShift)) {
253
+ return;
254
+ } // skip if the start row is the anchor row but it hasn't shifted
255
+
256
+
257
+ if (anchorRow === 'start' && renderedItems.visibleRowStartIndex !== rowIndex) {
258
+ return;
259
+ } // skip if the center row is the anchor row but it hasn't shifted
260
+
261
+
262
+ if (anchorRow === 'center' && Math.floor((renderedItems.visibleRowStopIndex - renderedItems.visibleRowStartIndex) / 2) !== rowIndex) {
263
+ return;
264
+ }
265
+
266
+ grid.scrollTo({
267
+ scrollTop: outerGridElement.scrollTop + verticalLayoutShift
268
+ });
269
+ }
243
270
  }]);
244
271
  return RowHeightUtils;
245
272
  }();
@@ -253,13 +280,15 @@ exports.RowHeightUtils = RowHeightUtils;
253
280
 
254
281
  var useRowHeightUtils = function useRowHeightUtils(_ref2) {
255
282
  var gridRef = _ref2.gridRef,
283
+ outerGridElementRef = _ref2.outerGridElementRef,
284
+ gridItemsRenderedRef = _ref2.gridItemsRenderedRef,
256
285
  gridStyles = _ref2.gridStyles,
257
286
  columns = _ref2.columns,
258
287
  rowHeightsOptions = _ref2.rowHeightsOptions;
259
288
  var forceRenderRef = (0, _services.useLatest)((0, _services.useForceRender)());
260
289
 
261
290
  var _useState = (0, _react.useState)(function () {
262
- return new RowHeightUtils(gridRef, forceRenderRef);
291
+ return new RowHeightUtils(gridRef, outerGridElementRef, gridItemsRenderedRef, forceRenderRef);
263
292
  }),
264
293
  _useState2 = (0, _slicedToArray2.default)(_useState, 1),
265
294
  rowHeightUtils = _useState2[0]; // Forces a rerender whenever the row heights change, as this can cause the
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.TYPES = exports.TEXT_STYLES = exports.EuiDescriptionList = exports.ALIGNMENTS = void 0;
8
+ exports.EuiDescriptionList = void 0;
9
9
 
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
 
@@ -19,31 +19,15 @@ var _description_list_title = require("./description_list_title");
19
19
 
20
20
  var _description_list_description = require("./description_list_description");
21
21
 
22
- var _common = require("../common");
22
+ var _services = require("../../services");
23
+
24
+ var _description_list = require("./description_list.styles");
25
+
26
+ var _description_list_context = require("./description_list_context");
23
27
 
24
28
  var _react2 = require("@emotion/react");
25
29
 
26
30
  var _excluded = ["align", "children", "className", "compressed", "descriptionProps", "listItems", "textStyle", "titleProps", "type"];
27
- var typesToClassNameMap = {
28
- row: 'euiDescriptionList--row',
29
- inline: 'euiDescriptionList--inline',
30
- column: 'euiDescriptionList--column',
31
- responsiveColumn: 'euiDescriptionList--responsiveColumn'
32
- };
33
- var TYPES = (0, _common.keysOf)(typesToClassNameMap);
34
- exports.TYPES = TYPES;
35
- var alignmentsToClassNameMap = {
36
- center: 'euiDescriptionList--center',
37
- left: ''
38
- };
39
- var ALIGNMENTS = (0, _common.keysOf)(alignmentsToClassNameMap);
40
- exports.ALIGNMENTS = ALIGNMENTS;
41
- var textStylesToClassNameMap = {
42
- normal: '',
43
- reverse: 'euiDescriptionList--reverse'
44
- };
45
- var TEXT_STYLES = (0, _common.keysOf)(textStylesToClassNameMap);
46
- exports.TEXT_STYLES = TEXT_STYLES;
47
31
 
48
32
  var EuiDescriptionList = function EuiDescriptionList(_ref) {
49
33
  var _ref$align = _ref.align,
@@ -60,9 +44,10 @@ var EuiDescriptionList = function EuiDescriptionList(_ref) {
60
44
  _ref$type = _ref.type,
61
45
  type = _ref$type === void 0 ? 'row' : _ref$type,
62
46
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
63
- var classes = (0, _classnames.default)('euiDescriptionList', type ? typesToClassNameMap[type] : undefined, align ? alignmentsToClassNameMap[align] : undefined, textStyle ? textStylesToClassNameMap[textStyle] : undefined, {
64
- 'euiDescriptionList--compressed': compressed
65
- }, className);
47
+ var euiTheme = (0, _services.useEuiTheme)();
48
+ var styles = (0, _description_list.euiDescriptionListStyles)(euiTheme);
49
+ var cssStyles = [styles.euiDescriptionList, styles[type], styles[align]];
50
+ var classes = (0, _classnames.default)('euiDescriptionList', className);
66
51
  var childrenOrListItems = null;
67
52
 
68
53
  if (listItems) {
@@ -77,9 +62,19 @@ var EuiDescriptionList = function EuiDescriptionList(_ref) {
77
62
  childrenOrListItems = children;
78
63
  }
79
64
 
80
- return (0, _react2.jsx)("dl", (0, _extends2.default)({
81
- className: classes
82
- }, rest), childrenOrListItems);
65
+ return (0, _react2.jsx)(_description_list_context.EuiDescriptionListContext.Provider, {
66
+ value: {
67
+ type: type,
68
+ compressed: compressed,
69
+ textStyle: textStyle,
70
+ align: align
71
+ }
72
+ }, (0, _react2.jsx)("dl", (0, _extends2.default)({
73
+ className: classes,
74
+ css: cssStyles
75
+ }, rest, {
76
+ "data-type": type
77
+ }), childrenOrListItems));
83
78
  };
84
79
 
85
80
  exports.EuiDescriptionList = EuiDescriptionList;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.euiDescriptionListStyles = void 0;
7
+
8
+ var _react = require("@emotion/react");
9
+
10
+ var _global_styling = require("../../global_styling");
11
+
12
+ /*
13
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
14
+ * or more contributor license agreements. Licensed under the Elastic License
15
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
16
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
17
+ * Side Public License, v 1.
18
+ */
19
+ var euiDescriptionListStyles = function euiDescriptionListStyles(euiThemeContext) {
20
+ // Flex display for column and responsive column
21
+ var columnDisplay = "\n display: flex;\n align-items: baseline;\n flex-wrap: wrap; \n ";
22
+ return {
23
+ euiDescriptionList: /*#__PURE__*/(0, _react.css)(";label:euiDescriptionList;"),
24
+ // Types
25
+ row: /*#__PURE__*/(0, _react.css)(";label:row;"),
26
+ inline: /*#__PURE__*/(0, _react.css)(";label:inline;"),
27
+ column: /*#__PURE__*/(0, _react.css)(columnDisplay, ";;label:column;"),
28
+ // Responsive columns behave as a row on breakpoints xs-s
29
+ responsiveColumn: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiBreakpoint)(euiThemeContext, ['m', 'xl']), "{", columnDisplay, ";};label:responsiveColumn;"),
30
+ // Alignment
31
+ center: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('center'), ";;label:center;"),
32
+ left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('left'), ";;label:left;")
33
+ };
34
+ };
35
+
36
+ exports.euiDescriptionListStyles = euiDescriptionListStyles;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.contextDefaults = exports.EuiDescriptionListContext = void 0;
7
+
8
+ var _react = require("react");
9
+
10
+ /*
11
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
12
+ * or more contributor license agreements. Licensed under the Elastic License
13
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
14
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
15
+ * Side Public License, v 1.
16
+ */
17
+ var contextDefaults = {
18
+ type: 'row',
19
+ textStyle: 'normal',
20
+ align: 'left'
21
+ };
22
+ exports.contextDefaults = contextDefaults;
23
+ var EuiDescriptionListContext = /*#__PURE__*/(0, _react.createContext)(contextDefaults);
24
+ exports.EuiDescriptionListContext = EuiDescriptionListContext;
@@ -2,6 +2,8 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
 
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+
5
7
  Object.defineProperty(exports, "__esModule", {
6
8
  value: true
7
9
  });
@@ -9,23 +11,62 @@ exports.EuiDescriptionListDescription = void 0;
9
11
 
10
12
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
13
 
14
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
15
+
12
16
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
17
 
14
- var _react = _interopRequireDefault(require("react"));
18
+ var _react = _interopRequireWildcard(require("react"));
15
19
 
16
20
  var _classnames = _interopRequireDefault(require("classnames"));
17
21
 
22
+ var _services = require("../../services");
23
+
24
+ var _description_list_description = require("./description_list_description.styles");
25
+
26
+ var _description_list_context = require("./description_list_context");
27
+
18
28
  var _react2 = require("@emotion/react");
19
29
 
20
30
  var _excluded = ["children", "className"];
21
31
 
32
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
33
+
34
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
35
+
22
36
  var EuiDescriptionListDescription = function EuiDescriptionListDescription(_ref) {
23
37
  var children = _ref.children,
24
38
  className = _ref.className,
25
39
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
40
+
41
+ var _useContext = (0, _react.useContext)(_description_list_context.EuiDescriptionListContext),
42
+ type = _useContext.type,
43
+ textStyle = _useContext.textStyle,
44
+ compressed = _useContext.compressed,
45
+ align = _useContext.align;
46
+
47
+ var theme = (0, _services.useEuiTheme)();
48
+ var styles = (0, _description_list_description.euiDescriptionListDescriptionStyles)(theme);
49
+ var conditionalStyles = compressed && textStyle === 'reverse' ? [styles.fontStyles.compressed] : [styles.fontStyles[textStyle]];
50
+
51
+ switch (type) {
52
+ case 'inline':
53
+ conditionalStyles = compressed ? [styles.inlineStyles.compressed] : [styles.inlineStyles.normal];
54
+ break;
55
+
56
+ case 'responsiveColumn':
57
+ case 'column':
58
+ if (align === 'center') {
59
+ conditionalStyles.push(styles.left);
60
+ }
61
+
62
+ break;
63
+ }
64
+
65
+ var cssStyles = [styles.euiDescriptionList__description, styles[type]].concat((0, _toConsumableArray2.default)(conditionalStyles));
26
66
  var classes = (0, _classnames.default)('euiDescriptionList__description', className);
27
67
  return (0, _react2.jsx)("dd", (0, _extends2.default)({
28
- className: classes
68
+ className: classes,
69
+ css: cssStyles
29
70
  }, rest), children);
30
71
  };
31
72