@elastic/eui 93.3.0 → 93.4.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 (286) hide show
  1. package/dist/eui_charts_theme.d.ts +9 -0
  2. package/dist/eui_charts_theme.js +56 -14
  3. package/dist/eui_charts_theme.js.map +1 -1
  4. package/es/components/breadcrumbs/_breadcrumb_content.js +362 -0
  5. package/es/components/breadcrumbs/_breadcrumb_content.styles.js +48 -0
  6. package/es/components/breadcrumbs/breadcrumb.js +10 -327
  7. package/es/components/breadcrumbs/breadcrumb.styles.js +5 -27
  8. package/es/components/breadcrumbs/breadcrumbs.js +4 -4
  9. package/es/components/breadcrumbs/types.js +1 -0
  10. package/es/components/button/button_group/button_group.js +16 -2
  11. package/es/components/button/button_group/button_group.styles.js +1 -1
  12. package/es/components/button/button_group/button_group_button.js +59 -5
  13. package/es/components/button/button_group/button_group_button.styles.js +39 -3
  14. package/es/components/datagrid/body/cell/data_grid_cell.js +97 -58
  15. package/es/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
  16. package/es/components/datagrid/body/cell/data_grid_cell_popover.js +64 -56
  17. package/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +32 -31
  18. package/es/components/datagrid/body/cell/index.js +1 -1
  19. package/es/components/datagrid/body/data_grid_body.js +13 -0
  20. package/es/components/datagrid/body/data_grid_body_custom.js +52 -36
  21. package/es/components/datagrid/body/data_grid_body_virtualized.js +84 -56
  22. package/es/components/datagrid/body/data_grid_row_manager.js +6 -4
  23. package/es/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
  24. package/es/components/datagrid/body/header/data_grid_control_header_cell.js +5 -4
  25. package/es/components/datagrid/body/header/data_grid_header_cell.js +73 -53
  26. package/es/components/datagrid/body/header/data_grid_header_row.js +15 -551
  27. package/es/components/datagrid/body/header/use_data_grid_header.js +7 -6
  28. package/es/components/datagrid/controls/column_selector.js +126 -123
  29. package/es/components/datagrid/controls/column_sorting.js +605 -103
  30. package/es/components/datagrid/controls/column_sorting_draggable.js +24 -22
  31. package/es/components/datagrid/controls/display_selector.js +109 -107
  32. package/es/components/datagrid/data_grid.a11y.js +13 -12
  33. package/es/components/datagrid/data_grid.js +45 -22
  34. package/es/components/datagrid/utils/col_widths.js +12 -8
  35. package/es/components/datagrid/utils/focus.js +10 -8
  36. package/es/components/datagrid/utils/grid_height_width.js +31 -30
  37. package/es/components/datagrid/utils/ref.js +1 -1
  38. package/es/components/datagrid/utils/row_heights.js +2 -2
  39. package/es/components/datagrid/utils/sorting.js +29 -27
  40. package/es/components/date_picker/super_date_picker/super_date_picker.js +9 -0
  41. package/es/components/date_picker/super_date_picker/super_update_button.js +57 -29
  42. package/es/components/flex/flex_grid.js +22 -8
  43. package/es/components/flex/flex_grid.styles.js +13 -6
  44. package/es/components/flex/flex_group.js +10 -11
  45. package/es/components/flex/flex_item.js +9 -11
  46. package/es/components/flex/flex_item.styles.js +107 -122
  47. package/es/components/flyout/flyout.js +16 -18
  48. package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
  49. package/es/components/modal/confirm_modal.js +2 -1
  50. package/es/components/modal/modal.js +12 -3
  51. package/es/components/observer/resize_observer/resize_observer.js +15 -24
  52. package/es/components/spacer/spacer.js +2 -3
  53. package/es/components/toast/global_toast_list.js +70 -73
  54. package/es/components/toast/toast.js +27 -42
  55. package/es/components/toast/toast.styles.js +2 -17
  56. package/es/services/color/eui_palettes.js +21 -13
  57. package/es/services/color/index.js +1 -1
  58. package/es/services/hooks/index.js +1 -0
  59. package/es/services/hooks/useDeepEqual.js +23 -0
  60. package/es/services/index.js +1 -1
  61. package/eui.d.ts +2442 -2337
  62. package/i18ntokens.json +259 -259
  63. package/lib/components/breadcrumbs/_breadcrumb_content.js +372 -0
  64. package/lib/components/breadcrumbs/_breadcrumb_content.styles.js +55 -0
  65. package/lib/components/breadcrumbs/breadcrumb.js +11 -331
  66. package/lib/components/breadcrumbs/breadcrumb.styles.js +5 -29
  67. package/lib/components/breadcrumbs/breadcrumbs.js +3 -3
  68. package/lib/components/breadcrumbs/types.js +5 -0
  69. package/lib/components/button/button_group/button_group.js +16 -2
  70. package/lib/components/button/button_group/button_group.styles.js +1 -1
  71. package/lib/components/button/button_group/button_group_button.js +59 -5
  72. package/lib/components/button/button_group/button_group_button.styles.js +45 -11
  73. package/lib/components/datagrid/body/cell/data_grid_cell.js +95 -57
  74. package/lib/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
  75. package/lib/components/datagrid/body/cell/data_grid_cell_popover.js +63 -55
  76. package/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +32 -31
  77. package/lib/components/datagrid/body/cell/index.js +2 -2
  78. package/lib/components/datagrid/body/data_grid_body.js +13 -0
  79. package/lib/components/datagrid/body/data_grid_body_custom.js +51 -35
  80. package/lib/components/datagrid/body/data_grid_body_virtualized.js +83 -55
  81. package/lib/components/datagrid/body/data_grid_row_manager.js +5 -3
  82. package/lib/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
  83. package/lib/components/datagrid/body/header/data_grid_control_header_cell.js +8 -4
  84. package/lib/components/datagrid/body/header/data_grid_header_cell.js +72 -52
  85. package/lib/components/datagrid/body/header/data_grid_header_row.js +14 -550
  86. package/lib/components/datagrid/body/header/use_data_grid_header.js +7 -6
  87. package/lib/components/datagrid/controls/column_selector.js +126 -123
  88. package/lib/components/datagrid/controls/column_sorting.js +615 -110
  89. package/lib/components/datagrid/controls/column_sorting_draggable.js +27 -22
  90. package/lib/components/datagrid/controls/display_selector.js +109 -107
  91. package/lib/components/datagrid/data_grid.a11y.js +13 -12
  92. package/lib/components/datagrid/data_grid.js +43 -20
  93. package/lib/components/datagrid/utils/col_widths.js +12 -8
  94. package/lib/components/datagrid/utils/focus.js +10 -8
  95. package/lib/components/datagrid/utils/grid_height_width.js +29 -28
  96. package/lib/components/datagrid/utils/ref.js +1 -1
  97. package/lib/components/datagrid/utils/row_heights.js +1 -1
  98. package/lib/components/datagrid/utils/sorting.js +31 -29
  99. package/lib/components/date_picker/super_date_picker/super_date_picker.js +9 -0
  100. package/lib/components/date_picker/super_date_picker/super_update_button.js +57 -29
  101. package/lib/components/flex/flex_grid.js +23 -7
  102. package/lib/components/flex/flex_grid.styles.js +13 -6
  103. package/lib/components/flex/flex_group.js +10 -10
  104. package/lib/components/flex/flex_item.js +13 -13
  105. package/lib/components/flex/flex_item.styles.js +107 -122
  106. package/lib/components/flyout/flyout.js +16 -18
  107. package/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
  108. package/lib/components/modal/confirm_modal.js +2 -1
  109. package/lib/components/modal/modal.js +12 -3
  110. package/lib/components/observer/resize_observer/resize_observer.js +15 -24
  111. package/lib/components/spacer/spacer.js +1 -2
  112. package/lib/components/toast/global_toast_list.js +68 -71
  113. package/lib/components/toast/toast.js +25 -40
  114. package/lib/components/toast/toast.styles.js +11 -25
  115. package/lib/services/color/eui_palettes.js +24 -14
  116. package/lib/services/color/index.js +14 -0
  117. package/lib/services/hooks/index.js +11 -0
  118. package/lib/services/hooks/useDeepEqual.js +30 -0
  119. package/lib/services/index.js +15 -1
  120. package/optimize/es/components/breadcrumbs/_breadcrumb_content.js +153 -0
  121. package/optimize/es/components/breadcrumbs/_breadcrumb_content.styles.js +48 -0
  122. package/optimize/es/components/breadcrumbs/breadcrumb.js +10 -110
  123. package/optimize/es/components/breadcrumbs/breadcrumb.styles.js +5 -27
  124. package/optimize/es/components/breadcrumbs/breadcrumbs.js +4 -4
  125. package/optimize/es/components/breadcrumbs/types.js +1 -0
  126. package/optimize/es/components/button/button_group/button_group.js +2 -2
  127. package/optimize/es/components/button/button_group/button_group.styles.js +1 -1
  128. package/optimize/es/components/button/button_group/button_group_button.js +36 -4
  129. package/optimize/es/components/button/button_group/button_group_button.styles.js +39 -3
  130. package/optimize/es/components/datagrid/body/cell/data_grid_cell.js +80 -55
  131. package/optimize/es/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
  132. package/optimize/es/components/datagrid/body/cell/data_grid_cell_popover.js +64 -56
  133. package/optimize/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +32 -31
  134. package/optimize/es/components/datagrid/body/cell/index.js +1 -1
  135. package/optimize/es/components/datagrid/body/data_grid_body_custom.js +39 -36
  136. package/optimize/es/components/datagrid/body/data_grid_body_virtualized.js +69 -49
  137. package/optimize/es/components/datagrid/body/data_grid_row_manager.js +6 -4
  138. package/optimize/es/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
  139. package/optimize/es/components/datagrid/body/header/data_grid_control_header_cell.js +4 -3
  140. package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +65 -49
  141. package/optimize/es/components/datagrid/body/header/data_grid_header_row.js +15 -13
  142. package/optimize/es/components/datagrid/body/header/use_data_grid_header.js +7 -6
  143. package/optimize/es/components/datagrid/controls/column_selector.js +126 -123
  144. package/optimize/es/components/datagrid/controls/column_sorting.js +121 -103
  145. package/optimize/es/components/datagrid/controls/column_sorting_draggable.js +24 -22
  146. package/optimize/es/components/datagrid/controls/display_selector.js +109 -107
  147. package/optimize/es/components/datagrid/data_grid.a11y.js +13 -12
  148. package/optimize/es/components/datagrid/data_grid.js +45 -22
  149. package/optimize/es/components/datagrid/utils/col_widths.js +9 -5
  150. package/optimize/es/components/datagrid/utils/focus.js +10 -8
  151. package/optimize/es/components/datagrid/utils/grid_height_width.js +31 -30
  152. package/optimize/es/components/datagrid/utils/ref.js +1 -1
  153. package/optimize/es/components/datagrid/utils/row_heights.js +2 -2
  154. package/optimize/es/components/datagrid/utils/sorting.js +29 -27
  155. package/optimize/es/components/date_picker/super_date_picker/super_update_button.js +49 -29
  156. package/optimize/es/components/flex/flex_grid.js +19 -8
  157. package/optimize/es/components/flex/flex_grid.styles.js +13 -6
  158. package/optimize/es/components/flex/flex_group.js +9 -10
  159. package/optimize/es/components/flex/flex_item.js +9 -11
  160. package/optimize/es/components/flex/flex_item.styles.js +107 -122
  161. package/optimize/es/components/flyout/flyout.js +16 -18
  162. package/optimize/es/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
  163. package/optimize/es/components/modal/confirm_modal.js +2 -1
  164. package/optimize/es/components/modal/modal.js +6 -2
  165. package/optimize/es/components/observer/resize_observer/resize_observer.js +15 -24
  166. package/optimize/es/components/spacer/spacer.js +2 -3
  167. package/optimize/es/components/toast/global_toast_list.js +70 -73
  168. package/optimize/es/components/toast/toast.js +27 -42
  169. package/optimize/es/components/toast/toast.styles.js +2 -17
  170. package/optimize/es/services/color/eui_palettes.js +21 -13
  171. package/optimize/es/services/color/index.js +1 -1
  172. package/optimize/es/services/hooks/index.js +1 -0
  173. package/optimize/es/services/hooks/useDeepEqual.js +23 -0
  174. package/optimize/es/services/index.js +1 -1
  175. package/optimize/lib/components/breadcrumbs/_breadcrumb_content.js +163 -0
  176. package/optimize/lib/components/breadcrumbs/_breadcrumb_content.styles.js +55 -0
  177. package/optimize/lib/components/breadcrumbs/breadcrumb.js +10 -113
  178. package/optimize/lib/components/breadcrumbs/breadcrumb.styles.js +5 -29
  179. package/optimize/lib/components/breadcrumbs/breadcrumbs.js +3 -3
  180. package/optimize/lib/components/breadcrumbs/types.js +5 -0
  181. package/optimize/lib/components/button/button_group/button_group.js +2 -2
  182. package/optimize/lib/components/button/button_group/button_group.styles.js +1 -1
  183. package/optimize/lib/components/button/button_group/button_group_button.js +37 -5
  184. package/optimize/lib/components/button/button_group/button_group_button.styles.js +45 -11
  185. package/optimize/lib/components/datagrid/body/cell/data_grid_cell.js +78 -54
  186. package/optimize/lib/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
  187. package/optimize/lib/components/datagrid/body/cell/data_grid_cell_popover.js +63 -55
  188. package/optimize/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +32 -31
  189. package/optimize/lib/components/datagrid/body/cell/index.js +2 -2
  190. package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +38 -35
  191. package/optimize/lib/components/datagrid/body/data_grid_body_virtualized.js +70 -50
  192. package/optimize/lib/components/datagrid/body/data_grid_row_manager.js +5 -3
  193. package/optimize/lib/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
  194. package/optimize/lib/components/datagrid/body/header/data_grid_control_header_cell.js +8 -4
  195. package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +65 -49
  196. package/optimize/lib/components/datagrid/body/header/data_grid_header_row.js +14 -12
  197. package/optimize/lib/components/datagrid/body/header/use_data_grid_header.js +7 -6
  198. package/optimize/lib/components/datagrid/controls/column_selector.js +126 -123
  199. package/optimize/lib/components/datagrid/controls/column_sorting.js +125 -107
  200. package/optimize/lib/components/datagrid/controls/column_sorting_draggable.js +27 -22
  201. package/optimize/lib/components/datagrid/controls/display_selector.js +109 -107
  202. package/optimize/lib/components/datagrid/data_grid.a11y.js +13 -12
  203. package/optimize/lib/components/datagrid/data_grid.js +43 -20
  204. package/optimize/lib/components/datagrid/utils/col_widths.js +9 -5
  205. package/optimize/lib/components/datagrid/utils/focus.js +10 -8
  206. package/optimize/lib/components/datagrid/utils/grid_height_width.js +29 -28
  207. package/optimize/lib/components/datagrid/utils/ref.js +1 -1
  208. package/optimize/lib/components/datagrid/utils/row_heights.js +1 -1
  209. package/optimize/lib/components/datagrid/utils/sorting.js +31 -29
  210. package/optimize/lib/components/date_picker/super_date_picker/super_update_button.js +49 -29
  211. package/optimize/lib/components/flex/flex_grid.js +21 -7
  212. package/optimize/lib/components/flex/flex_grid.styles.js +13 -6
  213. package/optimize/lib/components/flex/flex_group.js +9 -9
  214. package/optimize/lib/components/flex/flex_item.js +13 -13
  215. package/optimize/lib/components/flex/flex_item.styles.js +107 -122
  216. package/optimize/lib/components/flyout/flyout.js +16 -18
  217. package/optimize/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
  218. package/optimize/lib/components/modal/confirm_modal.js +2 -1
  219. package/optimize/lib/components/modal/modal.js +6 -2
  220. package/optimize/lib/components/observer/resize_observer/resize_observer.js +15 -24
  221. package/optimize/lib/components/spacer/spacer.js +1 -2
  222. package/optimize/lib/components/toast/global_toast_list.js +68 -71
  223. package/optimize/lib/components/toast/toast.js +25 -40
  224. package/optimize/lib/components/toast/toast.styles.js +11 -25
  225. package/optimize/lib/services/color/eui_palettes.js +24 -14
  226. package/optimize/lib/services/color/index.js +14 -0
  227. package/optimize/lib/services/hooks/index.js +11 -0
  228. package/optimize/lib/services/hooks/useDeepEqual.js +30 -0
  229. package/optimize/lib/services/index.js +15 -1
  230. package/package.json +2 -2
  231. package/test-env/components/breadcrumbs/_breadcrumb_content.js +363 -0
  232. package/test-env/components/breadcrumbs/_breadcrumb_content.styles.js +55 -0
  233. package/test-env/components/breadcrumbs/breadcrumb.js +11 -326
  234. package/test-env/components/breadcrumbs/breadcrumb.styles.js +5 -29
  235. package/test-env/components/breadcrumbs/breadcrumbs.js +3 -3
  236. package/test-env/components/breadcrumbs/types.js +5 -0
  237. package/test-env/components/button/button_group/button_group.js +16 -2
  238. package/test-env/components/button/button_group/button_group.styles.js +1 -1
  239. package/test-env/components/button/button_group/button_group_button.js +56 -5
  240. package/test-env/components/button/button_group/button_group_button.styles.js +45 -11
  241. package/test-env/components/datagrid/body/cell/data_grid_cell.js +95 -57
  242. package/test-env/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
  243. package/test-env/components/datagrid/body/cell/data_grid_cell_popover.js +63 -55
  244. package/test-env/components/datagrid/body/cell/data_grid_cell_wrapper.js +32 -31
  245. package/test-env/components/datagrid/body/cell/index.js +2 -2
  246. package/test-env/components/datagrid/body/data_grid_body.js +13 -0
  247. package/test-env/components/datagrid/body/data_grid_body_custom.js +51 -35
  248. package/test-env/components/datagrid/body/data_grid_body_virtualized.js +83 -55
  249. package/test-env/components/datagrid/body/data_grid_row_manager.js +5 -3
  250. package/test-env/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
  251. package/test-env/components/datagrid/body/header/data_grid_control_header_cell.js +8 -4
  252. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +72 -52
  253. package/test-env/components/datagrid/body/header/data_grid_header_row.js +14 -550
  254. package/test-env/components/datagrid/body/header/use_data_grid_header.js +7 -6
  255. package/test-env/components/datagrid/controls/column_selector.js +126 -123
  256. package/test-env/components/datagrid/controls/column_sorting.js +607 -106
  257. package/test-env/components/datagrid/controls/column_sorting_draggable.js +27 -22
  258. package/test-env/components/datagrid/controls/display_selector.js +109 -107
  259. package/test-env/components/datagrid/data_grid.a11y.js +13 -12
  260. package/test-env/components/datagrid/data_grid.js +43 -20
  261. package/test-env/components/datagrid/utils/col_widths.js +9 -5
  262. package/test-env/components/datagrid/utils/focus.js +10 -8
  263. package/test-env/components/datagrid/utils/grid_height_width.js +29 -28
  264. package/test-env/components/datagrid/utils/ref.js +1 -1
  265. package/test-env/components/datagrid/utils/row_heights.js +1 -1
  266. package/test-env/components/datagrid/utils/sorting.js +31 -29
  267. package/test-env/components/date_picker/super_date_picker/super_date_picker.js +9 -0
  268. package/test-env/components/date_picker/super_date_picker/super_update_button.js +57 -29
  269. package/test-env/components/flex/flex_grid.js +21 -7
  270. package/test-env/components/flex/flex_grid.styles.js +13 -6
  271. package/test-env/components/flex/flex_group.js +10 -10
  272. package/test-env/components/flex/flex_item.js +13 -13
  273. package/test-env/components/flex/flex_item.styles.js +107 -122
  274. package/test-env/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
  275. package/test-env/components/modal/confirm_modal.js +2 -1
  276. package/test-env/components/modal/modal.js +12 -3
  277. package/test-env/components/spacer/spacer.js +1 -2
  278. package/test-env/components/toast/global_toast_list.js +68 -71
  279. package/test-env/components/toast/toast.js +25 -40
  280. package/test-env/components/toast/toast.styles.js +11 -25
  281. package/test-env/services/color/eui_palettes.js +24 -14
  282. package/test-env/services/color/index.js +14 -0
  283. package/test-env/services/hooks/index.js +11 -0
  284. package/test-env/services/hooks/useDeepEqual.js +30 -0
  285. package/test-env/services/index.js +15 -1
  286. package/src/themes/charts/theme.scss +0 -5
@@ -1,11 +1,4 @@
1
- var _excluded = ["children", "className", "type", "truncate"],
2
- _excluded2 = ["text", "truncate", "type", "href", "rel", "onClick", "popoverContent", "popoverProps", "className", "color", "isFirstBreadcrumb", "isLastBreadcrumb", "isOnlyBreadcrumb", "highlightLastBreadcrumb", "truncateLastBreadcrumb"];
3
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
5
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
7
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
8
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1
+ var _excluded = ["children", "className", "type", "truncate"];
9
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
10
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
11
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
@@ -17,19 +10,12 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
17
10
  * Side Public License, v 1.
18
11
  */
19
12
 
20
- import React, { useState } from 'react';
21
- import PropTypes from "prop-types";
13
+ import React from 'react';
22
14
  import classNames from 'classnames';
23
- import { useEuiTheme } from '../../services';
24
- import { EuiInnerText } from '../inner_text';
25
- import { EuiTextColor } from '../text';
26
- import { EuiLink } from '../link';
27
- import { EuiPopover } from '../popover';
28
- import { EuiIcon } from '../icon';
15
+ import { useEuiMemoizedStyles } from '../../services';
29
16
  import { useEuiI18n } from '../i18n';
30
- import { euiBreadcrumbStyles, euiBreadcrumbContentStyles } from './breadcrumb.styles';
31
-
32
- // Used internally only by the parent EuiBreadcrumbs
17
+ import { EuiBreadcrumbContent } from './_breadcrumb_content';
18
+ import { euiBreadcrumbStyles } from './breadcrumb.styles';
33
19
  import { jsx as ___EmotionJSX } from "@emotion/react";
34
20
  export var EuiBreadcrumb = function EuiBreadcrumb(_ref) {
35
21
  var children = _ref.children,
@@ -38,8 +24,7 @@ export var EuiBreadcrumb = function EuiBreadcrumb(_ref) {
38
24
  truncate = _ref.truncate,
39
25
  rest = _objectWithoutProperties(_ref, _excluded);
40
26
  var classes = classNames('euiBreadcrumb', className);
41
- var euiTheme = useEuiTheme();
42
- var styles = euiBreadcrumbStyles(euiTheme);
27
+ var styles = useEuiMemoizedStyles(euiBreadcrumbStyles);
43
28
  var cssStyles = [styles.euiBreadcrumb, styles[type], truncate && styles.isTruncated];
44
29
  return ___EmotionJSX("li", _extends({
45
30
  className: classes,
@@ -47,305 +32,11 @@ export var EuiBreadcrumb = function EuiBreadcrumb(_ref) {
47
32
  "data-test-subj": "euiBreadcrumb"
48
33
  }, rest), children);
49
34
  };
50
- EuiBreadcrumb.propTypes = {
51
- type: PropTypes.oneOf(["page", "application"]).isRequired,
52
- isFirstBreadcrumb: PropTypes.bool,
53
- isLastBreadcrumb: PropTypes.bool,
54
- isOnlyBreadcrumb: PropTypes.bool,
55
- highlightLastBreadcrumb: PropTypes.bool,
56
- truncateLastBreadcrumb: PropTypes.bool
57
- };
58
- export var EuiBreadcrumbContent = function EuiBreadcrumbContent(_ref2) {
59
- var text = _ref2.text,
60
- truncate = _ref2.truncate,
61
- type = _ref2.type,
62
- href = _ref2.href,
63
- rel = _ref2.rel,
64
- onClick = _ref2.onClick,
65
- popoverContent = _ref2.popoverContent,
66
- popoverProps = _ref2.popoverProps,
67
- className = _ref2.className,
68
- color = _ref2.color,
35
+ export var EuiBreadcrumbCollapsed = function EuiBreadcrumbCollapsed(_ref2) {
36
+ var children = _ref2.children,
69
37
  isFirstBreadcrumb = _ref2.isFirstBreadcrumb,
70
- isLastBreadcrumb = _ref2.isLastBreadcrumb,
71
- isOnlyBreadcrumb = _ref2.isOnlyBreadcrumb,
72
- highlightLastBreadcrumb = _ref2.highlightLastBreadcrumb,
73
- truncateLastBreadcrumb = _ref2.truncateLastBreadcrumb,
74
- rest = _objectWithoutProperties(_ref2, _excluded2);
75
- var classes = classNames('euiBreadcrumb__content', className);
76
- var euiTheme = useEuiTheme();
77
- var styles = euiBreadcrumbContentStyles(euiTheme);
78
- var cssStyles = [styles.euiBreadcrumb__content, styles[type], truncate && !truncateLastBreadcrumb && styles.isTruncated, truncateLastBreadcrumb && styles.isTruncatedLast];
79
- if (type === 'application') {
80
- if (isOnlyBreadcrumb) {
81
- cssStyles.push(styles.applicationStyles.onlyChild);
82
- } else if (isFirstBreadcrumb) {
83
- cssStyles.push(styles.applicationStyles.firstChild);
84
- } else if (isLastBreadcrumb) {
85
- cssStyles.push(styles.applicationStyles.lastChild);
86
- }
87
- }
88
- var isInteractiveBreadcrumb = href || onClick;
89
- var linkColor = color || (highlightLastBreadcrumb ? 'text' : 'subdued');
90
- var plainTextColor = highlightLastBreadcrumb ? 'default' : 'subdued'; // Does not inherit `color` prop
91
- var ariaCurrent = highlightLastBreadcrumb ? 'page' : undefined;
92
- var isPopoverBreadcrumb = !!popoverContent;
93
- var _useState = useState(false),
94
- _useState2 = _slicedToArray(_useState, 2),
95
- isPopoverOpen = _useState2[0],
96
- setIsPopoverOpen = _useState2[1];
97
- var popoverAriaLabel = useEuiI18n('euiBreadcrumb.popoverAriaLabel', 'Clicking this button will toggle a popover dialog.');
98
- return ___EmotionJSX(EuiInnerText, null, function (ref, innerText) {
99
- var title = innerText === '' ? undefined : innerText;
100
- var baseProps = {
101
- ref: ref,
102
- title: title,
103
- 'aria-current': ariaCurrent
104
- };
105
- var styleProps = {
106
- className: classes,
107
- css: cssStyles
108
- };
109
- if (isPopoverBreadcrumb) {
110
- var _closePopover = function _closePopover() {
111
- return setIsPopoverOpen(false);
112
- };
113
- return ___EmotionJSX(EuiPopover, _extends({}, popoverProps, {
114
- isOpen: isPopoverOpen,
115
- closePopover: _closePopover,
116
- css: !isLastBreadcrumb && styles.euiBreadcrumb__popoverWrapper,
117
- button: ___EmotionJSX(EuiLink, _extends({}, baseProps, {
118
- color: linkColor,
119
- css: styles.euiBreadcrumb__popoverButton
120
- // Avoid passing href and onClick - should only toggle the popover
121
- ,
122
- onClick: function onClick() {
123
- return setIsPopoverOpen(function (isOpen) {
124
- return !isOpen;
125
- });
126
- }
127
- }, rest), ___EmotionJSX("span", styleProps, text), ___EmotionJSX(EuiIcon, {
128
- type: "arrowDown",
129
- size: "s",
130
- "aria-label": " - ".concat(popoverAriaLabel)
131
- }))
132
- }), typeof popoverContent === 'function' ? popoverContent(_closePopover) : popoverContent);
133
- } else if (isInteractiveBreadcrumb) {
134
- return ___EmotionJSX(EuiLink, _extends({}, baseProps, styleProps, {
135
- color: linkColor,
136
- onClick: onClick,
137
- href: href,
138
- rel: rel
139
- }, rest), text);
140
- } else {
141
- return ___EmotionJSX(EuiTextColor, {
142
- color: plainTextColor,
143
- cloneElement: true
144
- }, ___EmotionJSX("span", _extends({}, baseProps, styleProps, rest), text));
145
- }
146
- });
147
- };
148
- EuiBreadcrumbContent.propTypes = {
149
- className: PropTypes.string,
150
- "aria-label": PropTypes.string,
151
- "data-test-subj": PropTypes.string,
152
- css: PropTypes.any,
153
- href: PropTypes.string,
154
- rel: PropTypes.string,
155
- onClick: PropTypes.func,
156
- /**
157
- * Visible label of the breadcrumb
158
- */
159
- text: PropTypes.node.isRequired,
160
- /**
161
- * Force a max-width on the breadcrumb text
162
- */
163
- truncate: PropTypes.bool,
164
- /**
165
- * Accepts any EuiLink `color` when rendered as one (has `href`, `onClick`, or `popoverContent`)
166
- */
167
- color: PropTypes.any,
168
- /**
169
- * Override the existing `aria-current` which defaults to `page` for the last breadcrumb
170
- */
171
- "aria-current": PropTypes.any,
172
- /**
173
- * Creates a breadcrumb that toggles a popover dialog. Takes any rendered node(s),
174
- * or a render function that will pass callback allowing you to close the
175
- * breadcrumb popover from within your popover content.
176
- *
177
- * If passed, both `href` and `onClick` will be ignored - the breadcrumb's
178
- * click behavior should only trigger a popover.
179
- */
180
- popoverContent: PropTypes.oneOfType([PropTypes.node.isRequired, PropTypes.func.isRequired]),
181
- /**
182
- * Allows customizing the popover if necessary. Accepts any props that
183
- * [EuiPopover](/#/layout/popover) accepts, except for props that control state.
184
- */
185
- popoverProps: PropTypes.shape({
186
- /**
187
- * Alignment of the popover and arrow relative to the button
188
- */
189
- anchorPosition: PropTypes.any,
190
- /**
191
- * Style and position alteration for arrow-less attachment.
192
- * Intended for use with inputs as anchors, e.g. EuiInputPopover
193
- */
194
- attachToAnchor: PropTypes.bool,
195
- /**
196
- * Restrict the popover's position within this element
197
- */
198
- container: PropTypes.any,
199
- /**
200
- * CSS display type for both the popover and anchor
201
- */
202
- display: PropTypes.any,
203
- /**
204
- * Object of props passed to EuiFocusTrap
205
- */
206
- focusTrapProps: PropTypes.any,
207
- /**
208
- * Show arrow indicating to originating button
209
- */
210
- hasArrow: PropTypes.bool,
211
- /**
212
- * Specifies what element should initially have focus; Can be a DOM
213
- * node, or a selector string (which will be passed to
214
- * document.querySelector() to find the DOM node), or a function that
215
- * returns a DOM node.
216
- *
217
- * If not passed, initial focus defaults to the popover panel.
218
- */
219
- initialFocus: PropTypes.any,
220
- /**
221
- * Passed directly to EuiPortal for DOM positioning. Both properties are
222
- * required if prop is specified
223
- */
224
- insert: PropTypes.shape({
225
- sibling: PropTypes.any.isRequired,
226
- position: PropTypes.oneOf(["before", "after"]).isRequired
227
- }),
228
- /**
229
- * Traps tab focus within the popover contents
230
- */
231
- ownFocus: PropTypes.bool,
232
- /**
233
- * Custom class added to the EuiPanel containing the popover contents
234
- */
235
- panelClassName: PropTypes.string,
236
- /**
237
- * EuiPanel padding on all sides
238
- */
239
- panelPaddingSize: PropTypes.any,
240
- /**
241
- * Standard DOM `style` attribute. Passed to the EuiPanel
242
- */
243
- panelStyle: PropTypes.any,
244
- /**
245
- * Object of props passed to EuiPanel. See #EuiPopoverPanelProps
246
- */
247
- panelProps: PropTypes.shape({
248
- element: PropTypes.oneOf(["div"]),
249
- /**
250
- * Padding for all four sides
251
- */
252
- paddingSize: PropTypes.any,
253
- /**
254
- * Corner border radius
255
- */
256
- borderRadius: PropTypes.any,
257
- /**
258
- * When true the panel will grow in height to match `EuiFlexItem`
259
- */
260
- grow: PropTypes.bool,
261
- panelRef: PropTypes.any,
262
- className: PropTypes.string,
263
- "aria-label": PropTypes.string,
264
- "data-test-subj": PropTypes.string,
265
- css: PropTypes.any
266
- }),
267
- panelRef: PropTypes.any,
268
- /**
269
- * Optional screen reader instructions to announce upon popover open,
270
- * in addition to EUI's default popover instructions for Escape on close.
271
- * Useful for popovers that may have additional keyboard capabilities such as
272
- * arrow navigation.
273
- */
274
- popoverScreenReaderText: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.node.isRequired]),
275
- popoverRef: PropTypes.any,
276
- /**
277
- * When `true`, the popover's position is re-calculated when the user
278
- * scrolls, this supports having fixed-position popover anchors. When nesting
279
- * an `EuiPopover` in a scrollable container, `repositionOnScroll` should be `true`
280
- */
281
- repositionOnScroll: PropTypes.bool,
282
- /**
283
- * By default, popovers will attempt to position themselves along the initial
284
- * axis specified. If there is not enough room either vertically or horizontally
285
- * however, the popover will attempt to reposition itself along the secondary
286
- * cross axis if there is room there instead.
287
- *
288
- * If you do not not want this repositioning to occur (and it is acceptable for
289
- * the popover to appear offscreen), set this to false to disable this behavior.
290
- *
291
- * @default true
292
- */
293
- repositionToCrossAxis: PropTypes.bool,
294
- /**
295
- * Must be set to true if using `EuiDragDropContext` within a popover,
296
- * otherwise your nested drag & drop will have incorrect positioning
297
- */
298
- hasDragDrop: PropTypes.bool,
299
- /**
300
- * By default, popover content inherits the z-index of the anchor
301
- * component; pass `zIndex` to override
302
- */
303
- zIndex: PropTypes.number,
304
- /**
305
- * Distance away from the anchor that the popover will render
306
- */
307
- offset: PropTypes.number,
308
- /**
309
- * Minimum distance between the popover and the bounding container;
310
- * Pass an array of 4 values to adjust each side differently: `[top, right, bottom, left]`
311
- * Default is 16
312
- */
313
- buffer: PropTypes.oneOfType([PropTypes.number.isRequired, PropTypes.any.isRequired]),
314
- /**
315
- * Element to pass as the child element of the arrow;
316
- * Use case is typically limited to an accompanying `EuiBeacon`
317
- */
318
- arrowChildren: PropTypes.node,
319
- /**
320
- * Provide a name to the popover panel
321
- */
322
- "aria-label": PropTypes.string,
323
- /**
324
- * Alternative option to `aria-label` that takes an `id`.
325
- * Usually takes the `id` of the popover title
326
- */
327
- "aria-labelledby": PropTypes.string,
328
- /**
329
- * Function callback for when the popover positon changes
330
- */
331
- onPositionChange: PropTypes.func,
332
- className: PropTypes.string,
333
- "data-test-subj": PropTypes.string,
334
- css: PropTypes.any
335
- }),
336
- type: PropTypes.oneOf(["page", "application"]).isRequired,
337
- isFirstBreadcrumb: PropTypes.bool,
338
- isLastBreadcrumb: PropTypes.bool,
339
- isOnlyBreadcrumb: PropTypes.bool,
340
- highlightLastBreadcrumb: PropTypes.bool,
341
- truncateLastBreadcrumb: PropTypes.bool
342
- };
343
- export var EuiBreadcrumbCollapsed = function EuiBreadcrumbCollapsed(_ref3) {
344
- var children = _ref3.children,
345
- isFirstBreadcrumb = _ref3.isFirstBreadcrumb,
346
- type = _ref3.type;
347
- var euiTheme = useEuiTheme();
348
- var styles = euiBreadcrumbStyles(euiTheme);
38
+ type = _ref2.type;
39
+ var styles = useEuiMemoizedStyles(euiBreadcrumbStyles);
349
40
  var cssStyles = [styles.isCollapsed];
350
41
  var ariaLabel = useEuiI18n('euiBreadcrumb.collapsedBadge.ariaLabel', 'See collapsed breadcrumbs');
351
42
  return ___EmotionJSX(EuiBreadcrumb, {
@@ -361,12 +52,4 @@ export var EuiBreadcrumbCollapsed = function EuiBreadcrumbCollapsed(_ref3) {
361
52
  isFirstBreadcrumb: isFirstBreadcrumb,
362
53
  type: type
363
54
  }));
364
- };
365
- EuiBreadcrumbCollapsed.propTypes = {
366
- type: PropTypes.oneOf(["page", "application"]).isRequired,
367
- isFirstBreadcrumb: PropTypes.bool,
368
- isLastBreadcrumb: PropTypes.bool,
369
- isOnlyBreadcrumb: PropTypes.bool,
370
- highlightLastBreadcrumb: PropTypes.bool,
371
- truncateLastBreadcrumb: PropTypes.bool
372
55
  };
@@ -8,8 +8,11 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
8
8
  */
9
9
 
10
10
  import { css } from '@emotion/react';
11
- import { transparentize } from '../../services/color';
12
- import { euiFontSize, euiTextTruncate, euiFocusRing, logicalCSS, logicalBorderRadiusCSS, mathWithUnits } from '../../global_styling';
11
+ import { logicalCSS } from '../../global_styling';
12
+
13
+ /**
14
+ * Styles cast to <li> element
15
+ */
13
16
  var _ref = process.env.NODE_ENV === "production" ? {
14
17
  name: "1k7t4ns-isCollapsed",
15
18
  styles: "flex-shrink:0;label:isCollapsed;"
@@ -27,7 +30,6 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
27
30
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
28
31
  };
29
32
  export var euiBreadcrumbStyles = function euiBreadcrumbStyles(euiThemeContext) {
30
- // Styles cast to <li> element
31
33
  var euiTheme = euiThemeContext.euiTheme;
32
34
  return {
33
35
  euiBreadcrumb: /*#__PURE__*/css("align-items:center;display:flex;", logicalCSS(
@@ -39,28 +41,4 @@ export var euiBreadcrumbStyles = function euiBreadcrumbStyles(euiThemeContext) {
39
41
  page: /*#__PURE__*/css("&:not(:last-of-type){&::after{background:", euiTheme.colors.lightShade, ";content:'';flex-shrink:0;", logicalCSS('margin-top', euiTheme.size.xs), " ", logicalCSS('margin-bottom', 0), " ", logicalCSS('margin-horizontal', euiTheme.size.s), " ", logicalCSS('height', euiTheme.size.base), " ", logicalCSS('width', '1px'), " transform:translateY(-1px) rotate(15deg);}};label:page;"),
40
42
  application: /*#__PURE__*/css("&:not(:last-of-type){", logicalCSS('margin-right', "-".concat(euiTheme.size.xs)), ";};label:application;")
41
43
  };
42
- };
43
- export var euiBreadcrumbContentStyles = function euiBreadcrumbContentStyles(euiThemeContext) {
44
- // Styles cast to <a>, <span>, or collapsed <button> elements
45
- var euiTheme = euiThemeContext.euiTheme;
46
- return {
47
- euiBreadcrumb__content: /*#__PURE__*/css("font-weight:", euiTheme.font.weight.medium, ";text-align:center;vertical-align:baseline;;label:euiBreadcrumb__content;"),
48
- isTruncated: /*#__PURE__*/css(euiTextTruncate(mathWithUnits(euiTheme.size.base, function (x) {
49
- return x * 10;
50
- })), ";;label:isTruncated;"),
51
- isTruncatedLast: /*#__PURE__*/css(euiTextTruncate('none'), ";;label:isTruncatedLast;"),
52
- // Popover styles
53
- euiBreadcrumb__popoverButton: /*#__PURE__*/css("max-inline-size:100%;display:inline-flex;align-items:center;gap:", euiTheme.size.xs, ";;label:euiBreadcrumb__popoverButton;"),
54
- euiBreadcrumb__popoverWrapper: /*#__PURE__*/css("max-inline-size:calc(\n 100% - ", mathWithUnits(euiTheme.size.base, function (x) {
55
- return x + 1;
56
- }), "\n );;label:euiBreadcrumb__popoverWrapper;"),
57
- // Types
58
- page: /*#__PURE__*/css("&:is(a):focus{", euiFocusRing(euiThemeContext, 'inset'), ";}&:is(button):focus{", euiFocusRing(euiThemeContext, 'center'), ";};label:page;"),
59
- application: /*#__PURE__*/css(euiFontSize(euiThemeContext, 'xs'), " background-color:", transparentize(euiTheme.colors.darkestShade, 0.2), ";clip-path:polygon(\n 0 0,\n calc(100% - ", euiTheme.size.s, ") 0,\n 100% 50%,\n calc(100% - ", euiTheme.size.s, ") 100%,\n 0 100%,\n ", euiTheme.size.s, " 50%\n );color:", euiTheme.colors.darkestShade, ";line-height:", euiTheme.size.base, ";", logicalCSS('padding-vertical', euiTheme.size.xs), " ", logicalCSS('padding-horizontal', euiTheme.size.base), " &:is(a),&:is(button){background-color:", transparentize(euiTheme.colors.primary, 0.2), ";color:", euiTheme.colors.link, ";:focus{", euiFocusRing(euiThemeContext, 'inset'), " :focus-visible{border-radius:", euiTheme.border.radius.medium, ";clip-path:none;}}};label:application;"),
60
- applicationStyles: {
61
- onlyChild: /*#__PURE__*/css("border-radius:", euiTheme.border.radius.medium, ";clip-path:none;", logicalCSS('padding-horizontal', euiTheme.size.m), ";;label:onlyChild;"),
62
- firstChild: /*#__PURE__*/css(logicalBorderRadiusCSS("".concat(euiTheme.border.radius.medium, " 0 0 ").concat(euiTheme.border.radius.medium), true), " clip-path:polygon(\n 0 0,\n calc(100% - ", euiTheme.size.s, ") 0,\n 100% 50%,\n calc(100% - ", euiTheme.size.s, ") 100%,\n 0 100%\n );", logicalCSS('padding-left', euiTheme.size.m), ";;label:firstChild;"),
63
- lastChild: /*#__PURE__*/css(logicalBorderRadiusCSS("0 ".concat(euiTheme.border.radius.medium, " ").concat(euiTheme.border.radius.medium, " 0"), true), " clip-path:polygon(\n 0 0,\n 100% 0,\n 100% 100%,\n 0 100%,\n ", euiTheme.size.s, " 50%\n );", logicalCSS('padding-right', euiTheme.size.m), ";;label:lastChild;")
64
- }
65
- };
66
44
  };
@@ -15,8 +15,9 @@ import React, { useMemo } from 'react';
15
15
  import PropTypes from "prop-types";
16
16
  import classNames from 'classnames';
17
17
  import { useEuiI18n } from '../i18n';
18
- import { useEuiTheme, useCurrentEuiBreakpoint } from '../../services';
19
- import { EuiBreadcrumb, EuiBreadcrumbContent, EuiBreadcrumbCollapsed } from './breadcrumb';
18
+ import { useEuiMemoizedStyles, useCurrentEuiBreakpoint } from '../../services';
19
+ import { EuiBreadcrumb, EuiBreadcrumbCollapsed } from './breadcrumb';
20
+ import { EuiBreadcrumbContent } from './_breadcrumb_content';
20
21
  import { euiBreadcrumbsListStyles } from './breadcrumbs.styles';
21
22
  import { jsx as ___EmotionJSX } from "@emotion/react";
22
23
  var responsiveDefault = {
@@ -39,8 +40,7 @@ export var EuiBreadcrumbs = function EuiBreadcrumbs(_ref) {
39
40
  lastBreadcrumbIsCurrentPage = _ref$lastBreadcrumbIs === void 0 ? true : _ref$lastBreadcrumbIs,
40
41
  rest = _objectWithoutProperties(_ref, _excluded);
41
42
  var ariaLabel = useEuiI18n('euiBreadcrumbs.nav.ariaLabel', 'Breadcrumbs');
42
- var euiTheme = useEuiTheme();
43
- var breadcrumbsListStyles = euiBreadcrumbsListStyles(euiTheme);
43
+ var breadcrumbsListStyles = useEuiMemoizedStyles(euiBreadcrumbsListStyles);
44
44
  var cssBreadcrumbsListStyles = [breadcrumbsListStyles.euiBreadcrumbs__list, truncate && breadcrumbsListStyles.isTruncated];
45
45
  var responsiveMax = useResponsiveMax(responsive, max);
46
46
  var visibleBreadcrumbs = useMemo(function () {
@@ -0,0 +1 @@
1
+ export {};
@@ -57,9 +57,9 @@ export var EuiButtonGroup = function EuiButtonGroup(_ref) {
57
57
  }), ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("legend", null, legend)), ___EmotionJSX("div", {
58
58
  css: cssStyles,
59
59
  className: "euiButtonGroup__buttons"
60
- }, options.map(function (option, index) {
60
+ }, options.map(function (option) {
61
61
  return ___EmotionJSX(EuiButtonGroupButton, _extends({
62
- key: index,
62
+ key: option.id,
63
63
  isDisabled: isDisabled
64
64
  }, option, {
65
65
  onClick: typeIsSingle ? function () {
@@ -133,6 +133,20 @@ EuiButtonGroup.propTypes = {
133
133
  * The type of the underlying HTML button
134
134
  */
135
135
  type: PropTypes.any,
136
+ /**
137
+ * By default, will use the button text for the native browser title.
138
+ *
139
+ * This can be either customized or unset via `title: ''` if necessary.
140
+ */
141
+ title: PropTypes.any,
142
+ /**
143
+ * Optional custom tooltip content for the button
144
+ */
145
+ toolTipContent: PropTypes.node,
146
+ /**
147
+ * Optional props to pass to the underlying **[EuiToolTip](/#/display/tooltip)**
148
+ */
149
+ toolTipProps: PropTypes.any,
136
150
  /**
137
151
  * Any `type` accepted by EuiIcon
138
152
  */
@@ -31,7 +31,7 @@ export var euiButtonGroupButtonsStyles = function euiButtonGroupButtonsStyles(eu
31
31
  return {
32
32
  // Base
33
33
  euiButtonGroup__buttons: /*#__PURE__*/css(logicalCSS('max-width', '100%'), " display:flex;;label:euiButtonGroup__buttons;"),
34
- fullWidth: /*#__PURE__*/css(logicalCSS('width', '100%'), " .euiButtonGroupButton{flex:1;};label:fullWidth;"),
34
+ fullWidth: /*#__PURE__*/css(logicalCSS('width', '100%'), " .euiButtonGroupButton,.euiButtonGroup__tooltipWrapper{flex:1;", logicalCSS('width', '100%'), ";};label:fullWidth;"),
35
35
  // Sizes
36
36
  m: /*#__PURE__*/css("border-radius:", euiTheme.border.radius.medium, ";;label:m;"),
37
37
  s: /*#__PURE__*/css("border-radius:", euiTheme.border.radius.small, ";;label:s;"),
@@ -1,4 +1,10 @@
1
- var _excluded = ["className", "id", "isDisabled", "isIconOnly", "isSelected", "label", "value", "size", "color"];
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ var _excluded = ["className", "id", "isDisabled", "isIconOnly", "isSelected", "label", "value", "size", "color", "toolTipContent", "toolTipProps"];
3
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
5
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
2
8
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
9
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
10
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -24,6 +30,7 @@ import { useEuiButtonColorCSS } from '../../../themes/amsterdam/global_styling/m
24
30
  import { useInnerText } from '../../inner_text';
25
31
  import { EuiButtonDisplay } from '../button_display/_button_display';
26
32
  import { euiButtonGroupButtonStyles, _compressedButtonFocusColor, _uncompressedButtonFocus } from './button_group_button.styles';
33
+ import { EuiToolTip } from '../../../components/tool_tip';
27
34
  import { jsx as ___EmotionJSX } from "@emotion/react";
28
35
  export var EuiButtonGroupButton = function EuiButtonGroupButton(_ref) {
29
36
  var className = _ref.className,
@@ -37,17 +44,21 @@ export var EuiButtonGroupButton = function EuiButtonGroupButton(_ref) {
37
44
  size = _ref.size,
38
45
  _ref$color = _ref.color,
39
46
  _color = _ref$color === void 0 ? 'primary' : _ref$color,
47
+ toolTipContent = _ref.toolTipContent,
48
+ toolTipProps = _ref.toolTipProps,
40
49
  rest = _objectWithoutProperties(_ref, _excluded);
41
50
  var isCompressed = size === 'compressed';
42
51
  var color = isDisabled ? 'disabled' : _color;
43
52
  var display = isSelected ? 'fill' : isCompressed ? 'empty' : 'base';
53
+ var hasToolTip = !!toolTipContent;
44
54
  var euiTheme = useEuiTheme();
45
55
  var buttonColorStyles = useEuiButtonColorCSS({
46
56
  display: display
47
57
  })[color];
48
58
  var focusColorStyles = isCompressed ? _compressedButtonFocusColor(euiTheme, color) : _uncompressedButtonFocus(euiTheme);
49
59
  var styles = euiButtonGroupButtonStyles(euiTheme);
50
- var cssStyles = [styles.euiButtonGroupButton, isIconOnly && styles.iconOnly, styles[size], !isCompressed && styles.uncompressed, isDisabled && isSelected ? styles.disabledAndSelected : buttonColorStyles, !isDisabled && focusColorStyles];
60
+ var cssStyles = [styles.euiButtonGroupButton, isIconOnly && styles.iconOnly, !isCompressed && (hasToolTip ? styles.uncompressed.hasToolTip : styles.uncompressed[size]), isCompressed ? styles.compressed : styles.uncompressed.uncompressed, isDisabled && isSelected ? styles.disabledAndSelected : buttonColorStyles, !isDisabled && focusColorStyles];
61
+ var tooltipWrapperStyles = [styles.tooltipWrapper, !isCompressed && styles.uncompressed[size]];
51
62
  var contentStyles = [styles.content.euiButtonGroupButton__content, isCompressed && styles.content.compressed];
52
63
  var textStyles = [isIconOnly ? styles.text.euiButtonGroupButton__iconOnly : styles.text.euiButtonGroupButton__text];
53
64
  var buttonClasses = classNames('euiButtonGroupButton', {
@@ -64,7 +75,12 @@ export var EuiButtonGroupButton = function EuiButtonGroupButton(_ref) {
64
75
  _useInnerText2 = _slicedToArray(_useInnerText, 2),
65
76
  buttonTextRef = _useInnerText2[0],
66
77
  innerText = _useInnerText2[1];
67
- return ___EmotionJSX(EuiButtonDisplay, _extends({
78
+ return ___EmotionJSX(EuiButtonGroupButtonWithToolTip, {
79
+ toolTipContent: toolTipContent,
80
+ toolTipProps: toolTipProps,
81
+ wrapperCss: tooltipWrapperStyles,
82
+ isSelected: isSelected
83
+ }, ___EmotionJSX(EuiButtonDisplay, _extends({
68
84
  css: cssStyles,
69
85
  className: buttonClasses,
70
86
  isDisabled: isDisabled,
@@ -80,7 +96,7 @@ export var EuiButtonGroupButton = function EuiButtonGroupButton(_ref) {
80
96
  title: innerText,
81
97
  "data-test-subj": id,
82
98
  isSelected: isSelected
83
- }, rest), label);
99
+ }, rest), label));
84
100
  };
85
101
  EuiButtonGroupButton.propTypes = {
86
102
  /**
@@ -100,6 +116,20 @@ EuiButtonGroupButton.propTypes = {
100
116
  * The type of the underlying HTML button
101
117
  */
102
118
  type: PropTypes.any,
119
+ /**
120
+ * By default, will use the button text for the native browser title.
121
+ *
122
+ * This can be either customized or unset via `title: ''` if necessary.
123
+ */
124
+ title: PropTypes.any,
125
+ /**
126
+ * Optional custom tooltip content for the button
127
+ */
128
+ toolTipContent: PropTypes.node,
129
+ /**
130
+ * Optional props to pass to the underlying **[EuiToolTip](/#/display/tooltip)**
131
+ */
132
+ toolTipProps: PropTypes.any,
103
133
  /**
104
134
  * Any `type` accepted by EuiIcon
105
135
  */
@@ -138,7 +168,7 @@ EuiButtonGroupButton.propTypes = {
138
168
  /**
139
169
  * Inherit from EuiButtonGroup
140
170
  */
141
- size: PropTypes.oneOf(["s", "m", "compressed"]).isRequired,
171
+ size: PropTypes.any.isRequired,
142
172
  /**
143
173
  * Inherit from EuiButtonGroup
144
174
  */
@@ -147,4 +177,28 @@ EuiButtonGroupButton.propTypes = {
147
177
  * Inherit from EuiButtonGroup
148
178
  */
149
179
  onClick: PropTypes.func.isRequired
180
+ };
181
+ var EuiButtonGroupButtonWithToolTip = function EuiButtonGroupButtonWithToolTip(_ref2) {
182
+ var _toolTipProps$anchorP, _toolTipProps$anchorP2;
183
+ var toolTipContent = _ref2.toolTipContent,
184
+ toolTipProps = _ref2.toolTipProps,
185
+ wrapperCss = _ref2.wrapperCss,
186
+ isSelected = _ref2.isSelected,
187
+ children = _ref2.children;
188
+ return toolTipContent ? ___EmotionJSX(EuiToolTip, _extends({
189
+ content: toolTipContent,
190
+ position: "top"
191
+ }, toolTipProps, {
192
+ anchorProps: _objectSpread(_objectSpread({}, toolTipProps === null || toolTipProps === void 0 ? void 0 : toolTipProps.anchorProps), {}, {
193
+ className: classNames('euiButtonGroup__tooltipWrapper', {
194
+ 'euiButtonGroup__tooltipWrapper-isSelected': isSelected
195
+ }, toolTipProps === null || toolTipProps === void 0 ? void 0 : (_toolTipProps$anchorP = toolTipProps.anchorProps) === null || _toolTipProps$anchorP === void 0 ? void 0 : _toolTipProps$anchorP.className),
196
+ css: [wrapperCss, toolTipProps === null || toolTipProps === void 0 ? void 0 : (_toolTipProps$anchorP2 = toolTipProps.anchorProps) === null || _toolTipProps$anchorP2 === void 0 ? void 0 : _toolTipProps$anchorP2.css]
197
+ })
198
+ }), children) : children;
199
+ };
200
+ EuiButtonGroupButtonWithToolTip.propTypes = {
201
+ children: PropTypes.element.isRequired,
202
+ wrapperCss: PropTypes.any.isRequired,
203
+ isSelected: PropTypes.bool.isRequired
150
204
  };