@elastic/eui 112.3.0 → 113.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (294) hide show
  1. package/es/components/badge/beta_badge/beta_badge.styles.js +1 -1
  2. package/es/components/badge/color_utils.js +1 -1
  3. package/es/components/badge/notification_badge/badge_notification.styles.js +1 -1
  4. package/es/components/button/button_display/_button_display.js +1 -0
  5. package/es/components/button/button_display/_button_display.styles.js +3 -3
  6. package/es/components/button/button_display/_button_display_content.js +6 -1
  7. package/es/components/button/button_display/_button_display_content.styles.js +6 -1
  8. package/es/components/button/button_empty/button_empty.js +1 -0
  9. package/es/components/button/button_empty/button_empty.styles.js +3 -3
  10. package/es/components/button/button_group/button_group.js +4 -27
  11. package/es/components/button/button_group/button_group_button.js +4 -27
  12. package/es/components/code/code_block_annotations.js +1 -1
  13. package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.styles.js +1 -1
  14. package/es/components/color_picker/color_picker.js +2 -1
  15. package/es/components/color_picker/color_picker.styles.js +1 -1
  16. package/es/components/color_picker/hue.styles.js +2 -2
  17. package/es/components/color_picker/saturation.styles.js +2 -2
  18. package/es/components/date_picker/auto_refresh/auto_refresh.js +8 -8
  19. package/es/components/date_picker/date_picker_range.js +12 -2
  20. package/es/components/date_picker/date_picker_range.styles.js +1 -1
  21. package/es/components/date_picker/super_date_picker/date_popover/date_popover_button.styles.js +6 -1
  22. package/es/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +9 -24
  23. package/es/components/date_picker/super_date_picker/super_date_picker.js +3 -1
  24. package/es/components/date_picker/super_date_picker/super_date_picker.styles.js +7 -13
  25. package/es/components/filter_group/filter_button.styles.js +1 -1
  26. package/es/components/flyout/flyout_body.js +10 -3
  27. package/es/components/flyout/manager/actions.js +11 -0
  28. package/es/components/flyout/manager/flyout_managed.js +4 -3
  29. package/es/components/flyout/manager/index.js +1 -1
  30. package/es/components/flyout/manager/reducer.js +19 -1
  31. package/es/components/flyout/manager/store.js +4 -1
  32. package/es/components/form/field_password/field_password.js +6 -3
  33. package/es/components/form/form.styles.js +18 -11
  34. package/es/components/form/form_control_button/form_control_button.js +30 -7
  35. package/es/components/form/form_control_button/form_control_button.styles.js +5 -2
  36. package/es/components/form/form_control_layout/append_prepend/form_append_prepend.js +149 -0
  37. package/es/components/form/form_control_layout/append_prepend/form_append_prepend.styles.js +28 -0
  38. package/es/components/form/form_control_layout/append_prepend/index.js +9 -0
  39. package/es/components/form/form_control_layout/form_control_layout.js +55 -24
  40. package/es/components/form/form_control_layout/form_control_layout.styles.js +46 -27
  41. package/es/components/form/form_control_layout/form_control_layout_context.js +21 -0
  42. package/es/components/form/form_control_layout/form_control_layout_delimited.styles.js +5 -12
  43. package/es/components/form/form_control_layout/index.js +2 -1
  44. package/es/components/form/form_label/form_label.js +17 -3
  45. package/es/components/form/range/range_levels.styles.js +1 -1
  46. package/es/components/form/range/range_tooltip.styles.js +1 -1
  47. package/es/components/header/header.styles.js +1 -1
  48. package/es/components/header/header_links/header_link.js +7 -0
  49. package/es/components/header/header_section/header_section_item_button.js +7 -0
  50. package/es/components/icon/icon.styles.js +1 -1
  51. package/es/components/image/image_caption.styles.js +1 -1
  52. package/es/components/link/link.styles.js +1 -1
  53. package/es/components/list_group/list_group_item.styles.js +1 -1
  54. package/es/components/markdown_editor/markdown_format.styles.js +1 -1
  55. package/es/components/pagination/pagination_button.js +7 -0
  56. package/es/components/pagination/pagination_button.styles.js +1 -1
  57. package/es/components/text/text_color.styles.js +1 -1
  58. package/es/components/token/token.styles.js +1 -1
  59. package/es/components/tool_tip/tool_tip.styles.js +1 -1
  60. package/es/global_styling/mixins/_button.js +7 -2
  61. package/eui.d.ts +180 -48
  62. package/lib/components/badge/beta_badge/beta_badge.styles.js +1 -1
  63. package/lib/components/badge/color_utils.js +1 -1
  64. package/lib/components/badge/notification_badge/badge_notification.styles.js +1 -1
  65. package/lib/components/button/button_display/_button_display.js +1 -0
  66. package/lib/components/button/button_display/_button_display.styles.js +2 -2
  67. package/lib/components/button/button_display/_button_display_content.js +6 -1
  68. package/lib/components/button/button_display/_button_display_content.styles.js +6 -1
  69. package/lib/components/button/button_empty/button_empty.js +2 -1
  70. package/lib/components/button/button_empty/button_empty.styles.js +2 -2
  71. package/lib/components/button/button_group/button_group.js +5 -28
  72. package/lib/components/button/button_group/button_group_button.js +4 -27
  73. package/lib/components/code/code_block_annotations.js +1 -1
  74. package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.styles.js +1 -1
  75. package/lib/components/color_picker/color_picker.js +2 -1
  76. package/lib/components/color_picker/color_picker.styles.js +1 -1
  77. package/lib/components/color_picker/hue.styles.js +2 -2
  78. package/lib/components/color_picker/saturation.styles.js +2 -2
  79. package/lib/components/date_picker/auto_refresh/auto_refresh.js +8 -8
  80. package/lib/components/date_picker/date_picker_range.js +12 -2
  81. package/lib/components/date_picker/date_picker_range.styles.js +1 -1
  82. package/lib/components/date_picker/super_date_picker/date_popover/date_popover_button.styles.js +8 -3
  83. package/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +9 -23
  84. package/lib/components/date_picker/super_date_picker/super_date_picker.js +3 -1
  85. package/lib/components/date_picker/super_date_picker/super_date_picker.styles.js +7 -13
  86. package/lib/components/filter_group/filter_button.styles.js +1 -1
  87. package/lib/components/flyout/flyout_body.js +10 -3
  88. package/lib/components/flyout/manager/actions.js +12 -1
  89. package/lib/components/flyout/manager/flyout_managed.js +4 -3
  90. package/lib/components/flyout/manager/index.js +6 -0
  91. package/lib/components/flyout/manager/reducer.js +18 -0
  92. package/lib/components/flyout/manager/store.js +3 -0
  93. package/lib/components/form/field_password/field_password.js +6 -3
  94. package/lib/components/form/form.styles.js +19 -12
  95. package/lib/components/form/form_control_button/form_control_button.js +29 -6
  96. package/lib/components/form/form_control_button/form_control_button.styles.js +3 -0
  97. package/lib/components/form/form_control_layout/append_prepend/form_append_prepend.js +158 -0
  98. package/lib/components/form/form_control_layout/append_prepend/form_append_prepend.styles.js +34 -0
  99. package/lib/components/form/form_control_layout/append_prepend/index.js +18 -0
  100. package/lib/components/form/form_control_layout/form_control_layout.js +55 -24
  101. package/lib/components/form/form_control_layout/form_control_layout.styles.js +45 -26
  102. package/lib/components/form/form_control_layout/form_control_layout_context.js +27 -0
  103. package/lib/components/form/form_control_layout/form_control_layout_delimited.styles.js +4 -11
  104. package/lib/components/form/form_control_layout/index.js +18 -1
  105. package/lib/components/form/form_label/form_label.js +17 -3
  106. package/lib/components/form/range/range_levels.styles.js +1 -1
  107. package/lib/components/form/range/range_tooltip.styles.js +1 -1
  108. package/lib/components/header/header.styles.js +1 -1
  109. package/lib/components/header/header_links/header_link.js +7 -0
  110. package/lib/components/header/header_section/header_section_item_button.js +7 -0
  111. package/lib/components/icon/icon.styles.js +1 -1
  112. package/lib/components/image/image_caption.styles.js +1 -1
  113. package/lib/components/inline_edit/inline_edit_form.js +1 -1
  114. package/lib/components/link/link.styles.js +1 -1
  115. package/lib/components/list_group/list_group_item.styles.js +1 -1
  116. package/lib/components/markdown_editor/markdown_format.styles.js +1 -1
  117. package/lib/components/pagination/pagination_button.js +7 -0
  118. package/lib/components/pagination/pagination_button.styles.js +1 -1
  119. package/lib/components/text/text_color.styles.js +1 -1
  120. package/lib/components/token/token.styles.js +1 -1
  121. package/lib/components/tool_tip/tool_tip.styles.js +1 -1
  122. package/lib/global_styling/mixins/_button.js +8 -3
  123. package/optimize/es/components/badge/beta_badge/beta_badge.styles.js +1 -1
  124. package/optimize/es/components/badge/color_utils.js +1 -1
  125. package/optimize/es/components/badge/notification_badge/badge_notification.styles.js +1 -1
  126. package/optimize/es/components/button/button_display/_button_display.js +1 -0
  127. package/optimize/es/components/button/button_display/_button_display.styles.js +3 -3
  128. package/optimize/es/components/button/button_display/_button_display_content.js +5 -1
  129. package/optimize/es/components/button/button_display/_button_display_content.styles.js +6 -1
  130. package/optimize/es/components/button/button_empty/button_empty.js +1 -0
  131. package/optimize/es/components/button/button_empty/button_empty.styles.js +3 -3
  132. package/optimize/es/components/code/code_block_annotations.js +1 -1
  133. package/optimize/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.styles.js +1 -1
  134. package/optimize/es/components/color_picker/color_picker.js +2 -1
  135. package/optimize/es/components/color_picker/color_picker.styles.js +1 -1
  136. package/optimize/es/components/color_picker/hue.styles.js +2 -2
  137. package/optimize/es/components/color_picker/saturation.styles.js +2 -2
  138. package/optimize/es/components/date_picker/auto_refresh/auto_refresh.js +8 -8
  139. package/optimize/es/components/date_picker/date_picker_range.js +8 -2
  140. package/optimize/es/components/date_picker/date_picker_range.styles.js +1 -1
  141. package/optimize/es/components/date_picker/super_date_picker/date_popover/date_popover_button.styles.js +6 -1
  142. package/optimize/es/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +9 -21
  143. package/optimize/es/components/date_picker/super_date_picker/super_date_picker.js +3 -1
  144. package/optimize/es/components/date_picker/super_date_picker/super_date_picker.styles.js +7 -13
  145. package/optimize/es/components/filter_group/filter_button.styles.js +1 -1
  146. package/optimize/es/components/flyout/flyout_body.js +5 -2
  147. package/optimize/es/components/flyout/manager/actions.js +11 -0
  148. package/optimize/es/components/flyout/manager/flyout_managed.js +4 -3
  149. package/optimize/es/components/flyout/manager/index.js +1 -1
  150. package/optimize/es/components/flyout/manager/reducer.js +19 -1
  151. package/optimize/es/components/flyout/manager/store.js +4 -1
  152. package/optimize/es/components/form/field_password/field_password.js +6 -3
  153. package/optimize/es/components/form/form.styles.js +18 -11
  154. package/optimize/es/components/form/form_control_button/form_control_button.js +23 -7
  155. package/optimize/es/components/form/form_control_button/form_control_button.styles.js +5 -2
  156. package/optimize/es/components/form/form_control_layout/append_prepend/form_append_prepend.js +102 -0
  157. package/optimize/es/components/form/form_control_layout/append_prepend/form_append_prepend.styles.js +28 -0
  158. package/optimize/es/components/form/form_control_layout/append_prepend/index.js +9 -0
  159. package/optimize/es/components/form/form_control_layout/form_control_layout.js +52 -23
  160. package/optimize/es/components/form/form_control_layout/form_control_layout.styles.js +46 -27
  161. package/optimize/es/components/form/form_control_layout/form_control_layout_context.js +21 -0
  162. package/optimize/es/components/form/form_control_layout/form_control_layout_delimited.styles.js +5 -12
  163. package/optimize/es/components/form/form_control_layout/index.js +2 -1
  164. package/optimize/es/components/form/form_label/form_label.js +9 -2
  165. package/optimize/es/components/form/range/range_levels.styles.js +1 -1
  166. package/optimize/es/components/form/range/range_tooltip.styles.js +1 -1
  167. package/optimize/es/components/header/header.styles.js +1 -1
  168. package/optimize/es/components/icon/icon.styles.js +1 -1
  169. package/optimize/es/components/image/image_caption.styles.js +1 -1
  170. package/optimize/es/components/link/link.styles.js +1 -1
  171. package/optimize/es/components/list_group/list_group_item.styles.js +1 -1
  172. package/optimize/es/components/markdown_editor/markdown_format.styles.js +1 -1
  173. package/optimize/es/components/pagination/pagination_button.styles.js +1 -1
  174. package/optimize/es/components/text/text_color.styles.js +1 -1
  175. package/optimize/es/components/token/token.styles.js +1 -1
  176. package/optimize/es/components/tool_tip/tool_tip.styles.js +1 -1
  177. package/optimize/es/global_styling/mixins/_button.js +7 -2
  178. package/optimize/lib/components/badge/beta_badge/beta_badge.styles.js +1 -1
  179. package/optimize/lib/components/badge/color_utils.js +1 -1
  180. package/optimize/lib/components/badge/notification_badge/badge_notification.styles.js +1 -1
  181. package/optimize/lib/components/button/button_display/_button_display.js +1 -0
  182. package/optimize/lib/components/button/button_display/_button_display.styles.js +2 -2
  183. package/optimize/lib/components/button/button_display/_button_display_content.js +5 -1
  184. package/optimize/lib/components/button/button_display/_button_display_content.styles.js +6 -1
  185. package/optimize/lib/components/button/button_empty/button_empty.js +1 -0
  186. package/optimize/lib/components/button/button_empty/button_empty.styles.js +2 -2
  187. package/optimize/lib/components/code/code_block_annotations.js +1 -1
  188. package/optimize/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.styles.js +1 -1
  189. package/optimize/lib/components/color_picker/color_picker.js +2 -1
  190. package/optimize/lib/components/color_picker/color_picker.styles.js +1 -1
  191. package/optimize/lib/components/color_picker/hue.styles.js +2 -2
  192. package/optimize/lib/components/color_picker/saturation.styles.js +2 -2
  193. package/optimize/lib/components/date_picker/auto_refresh/auto_refresh.js +7 -7
  194. package/optimize/lib/components/date_picker/date_picker_range.js +8 -2
  195. package/optimize/lib/components/date_picker/date_picker_range.styles.js +1 -1
  196. package/optimize/lib/components/date_picker/super_date_picker/date_popover/date_popover_button.styles.js +8 -3
  197. package/optimize/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +9 -21
  198. package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.js +3 -1
  199. package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.styles.js +7 -13
  200. package/optimize/lib/components/filter_group/filter_button.styles.js +1 -1
  201. package/optimize/lib/components/flyout/flyout_body.js +5 -2
  202. package/optimize/lib/components/flyout/manager/actions.js +12 -1
  203. package/optimize/lib/components/flyout/manager/flyout_managed.js +4 -3
  204. package/optimize/lib/components/flyout/manager/index.js +6 -0
  205. package/optimize/lib/components/flyout/manager/reducer.js +18 -0
  206. package/optimize/lib/components/flyout/manager/store.js +3 -0
  207. package/optimize/lib/components/form/field_password/field_password.js +6 -3
  208. package/optimize/lib/components/form/form.styles.js +19 -12
  209. package/optimize/lib/components/form/form_control_button/form_control_button.js +22 -6
  210. package/optimize/lib/components/form/form_control_button/form_control_button.styles.js +3 -0
  211. package/optimize/lib/components/form/form_control_layout/append_prepend/form_append_prepend.js +111 -0
  212. package/optimize/lib/components/form/form_control_layout/append_prepend/form_append_prepend.styles.js +34 -0
  213. package/optimize/lib/components/form/form_control_layout/append_prepend/index.js +18 -0
  214. package/optimize/lib/components/form/form_control_layout/form_control_layout.js +52 -23
  215. package/optimize/lib/components/form/form_control_layout/form_control_layout.styles.js +45 -26
  216. package/optimize/lib/components/form/form_control_layout/form_control_layout_context.js +27 -0
  217. package/optimize/lib/components/form/form_control_layout/form_control_layout_delimited.styles.js +4 -11
  218. package/optimize/lib/components/form/form_control_layout/index.js +18 -1
  219. package/optimize/lib/components/form/form_label/form_label.js +9 -2
  220. package/optimize/lib/components/form/range/range_levels.styles.js +1 -1
  221. package/optimize/lib/components/form/range/range_tooltip.styles.js +1 -1
  222. package/optimize/lib/components/header/header.styles.js +1 -1
  223. package/optimize/lib/components/icon/icon.styles.js +1 -1
  224. package/optimize/lib/components/image/image_caption.styles.js +1 -1
  225. package/optimize/lib/components/link/link.styles.js +1 -1
  226. package/optimize/lib/components/list_group/list_group_item.styles.js +1 -1
  227. package/optimize/lib/components/markdown_editor/markdown_format.styles.js +1 -1
  228. package/optimize/lib/components/pagination/pagination_button.styles.js +1 -1
  229. package/optimize/lib/components/text/text_color.styles.js +1 -1
  230. package/optimize/lib/components/token/token.styles.js +1 -1
  231. package/optimize/lib/components/tool_tip/tool_tip.styles.js +1 -1
  232. package/optimize/lib/global_styling/mixins/_button.js +8 -3
  233. package/package.json +4 -4
  234. package/test-env/components/badge/beta_badge/beta_badge.styles.js +1 -1
  235. package/test-env/components/badge/color_utils.js +1 -1
  236. package/test-env/components/badge/notification_badge/badge_notification.styles.js +1 -1
  237. package/test-env/components/button/button_display/_button_display.js +1 -0
  238. package/test-env/components/button/button_display/_button_display.styles.js +2 -2
  239. package/test-env/components/button/button_display/_button_display_content.js +6 -1
  240. package/test-env/components/button/button_display/_button_display_content.styles.js +6 -1
  241. package/test-env/components/button/button_empty/button_empty.js +2 -1
  242. package/test-env/components/button/button_empty/button_empty.styles.js +2 -2
  243. package/test-env/components/button/button_group/button_group.js +5 -28
  244. package/test-env/components/button/button_group/button_group_button.js +4 -27
  245. package/test-env/components/code/code_block_annotations.js +1 -1
  246. package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.styles.js +1 -1
  247. package/test-env/components/color_picker/color_picker.js +2 -1
  248. package/test-env/components/color_picker/color_picker.styles.js +1 -1
  249. package/test-env/components/color_picker/hue.styles.js +2 -2
  250. package/test-env/components/color_picker/saturation.styles.js +2 -2
  251. package/test-env/components/date_picker/auto_refresh/auto_refresh.js +8 -8
  252. package/test-env/components/date_picker/date_picker_range.js +12 -2
  253. package/test-env/components/date_picker/date_picker_range.styles.js +1 -1
  254. package/test-env/components/date_picker/super_date_picker/date_popover/date_popover_button.styles.js +8 -3
  255. package/test-env/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +9 -21
  256. package/test-env/components/date_picker/super_date_picker/super_date_picker.js +3 -1
  257. package/test-env/components/date_picker/super_date_picker/super_date_picker.styles.js +7 -13
  258. package/test-env/components/filter_group/filter_button.styles.js +1 -1
  259. package/test-env/components/flyout/flyout_body.js +10 -3
  260. package/test-env/components/flyout/manager/actions.js +12 -1
  261. package/test-env/components/flyout/manager/flyout_managed.js +4 -3
  262. package/test-env/components/flyout/manager/index.js +6 -0
  263. package/test-env/components/flyout/manager/reducer.js +18 -0
  264. package/test-env/components/flyout/manager/store.js +3 -0
  265. package/test-env/components/form/field_password/field_password.js +6 -3
  266. package/test-env/components/form/form.styles.js +19 -12
  267. package/test-env/components/form/form_control_button/form_control_button.js +29 -6
  268. package/test-env/components/form/form_control_button/form_control_button.styles.js +3 -0
  269. package/test-env/components/form/form_control_layout/append_prepend/form_append_prepend.js +157 -0
  270. package/test-env/components/form/form_control_layout/append_prepend/form_append_prepend.styles.js +34 -0
  271. package/test-env/components/form/form_control_layout/append_prepend/index.js +18 -0
  272. package/test-env/components/form/form_control_layout/form_control_layout.js +55 -24
  273. package/test-env/components/form/form_control_layout/form_control_layout.styles.js +45 -26
  274. package/test-env/components/form/form_control_layout/form_control_layout_context.js +27 -0
  275. package/test-env/components/form/form_control_layout/form_control_layout_delimited.styles.js +4 -11
  276. package/test-env/components/form/form_control_layout/index.js +18 -1
  277. package/test-env/components/form/form_label/form_label.js +17 -3
  278. package/test-env/components/form/range/range_levels.styles.js +1 -1
  279. package/test-env/components/form/range/range_tooltip.styles.js +1 -1
  280. package/test-env/components/header/header.styles.js +1 -1
  281. package/test-env/components/header/header_links/header_link.js +7 -0
  282. package/test-env/components/header/header_section/header_section_item_button.js +7 -0
  283. package/test-env/components/icon/icon.styles.js +1 -1
  284. package/test-env/components/image/image_caption.styles.js +1 -1
  285. package/test-env/components/inline_edit/inline_edit_form.js +1 -1
  286. package/test-env/components/link/link.styles.js +1 -1
  287. package/test-env/components/list_group/list_group_item.styles.js +1 -1
  288. package/test-env/components/markdown_editor/markdown_format.styles.js +1 -1
  289. package/test-env/components/pagination/pagination_button.js +7 -0
  290. package/test-env/components/pagination/pagination_button.styles.js +1 -1
  291. package/test-env/components/text/text_color.styles.js +1 -1
  292. package/test-env/components/token/token.styles.js +1 -1
  293. package/test-env/components/tool_tip/tool_tip.styles.js +1 -1
  294. package/test-env/global_styling/mixins/_button.js +8 -3
@@ -16,8 +16,9 @@ var _services = require("../../../services");
16
16
  var _button = require("../../button");
17
17
  var _form_control_button = require("./form_control_button.styles");
18
18
  var _inner_text = require("../../inner_text");
19
+ var _form_control_layout_context = require("../form_control_layout/form_control_layout_context");
19
20
  var _react2 = require("@emotion/react");
20
- var _excluded = ["children", "value", "placeholder", "className", "contentProps", "textProps", "compressed", "isInvalid", "fullWidth", "href", "rel"];
21
+ var _excluded = ["children", "value", "placeholder", "className", "contentProps", "textProps", "compressed", "isDisabled", "isInvalid", "fullWidth", "iconSide", "isLoading", "href", "rel"];
21
22
  /*
22
23
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
23
24
  * or more contributor license agreements. Licensed under the Elastic License
@@ -36,11 +37,13 @@ var EuiFormControlButton = exports.EuiFormControlButton = function EuiFormContro
36
37
  className = _ref.className,
37
38
  _contentProps = _ref.contentProps,
38
39
  _textProps = _ref.textProps,
39
- compressed = _ref.compressed,
40
- _ref$isInvalid = _ref.isInvalid,
41
- isInvalid = _ref$isInvalid === void 0 ? false : _ref$isInvalid,
40
+ _compressed = _ref.compressed,
41
+ _isDisabled = _ref.isDisabled,
42
+ _isInvalid = _ref.isInvalid,
42
43
  _ref$fullWidth = _ref.fullWidth,
43
44
  fullWidth = _ref$fullWidth === void 0 ? true : _ref$fullWidth,
45
+ iconSide = _ref.iconSide,
46
+ _isLoading = _ref.isLoading,
44
47
  href = _ref.href,
45
48
  rel = _ref.rel,
46
49
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
@@ -48,9 +51,19 @@ var EuiFormControlButton = exports.EuiFormControlButton = function EuiFormContro
48
51
  _useInnerText2 = (0, _slicedToArray2.default)(_useInnerText, 2),
49
52
  buttonTextRef = _useInnerText2[0],
50
53
  innerText = _useInnerText2[1];
54
+ var _useContext = (0, _react.useContext)(_form_control_layout_context.EuiFormControlLayoutContext),
55
+ formLayoutIsDisabled = _useContext.isDisabled,
56
+ formLayoutIsInvalid = _useContext.isInvalid,
57
+ formLayoutIsLoading = _useContext.isLoading,
58
+ formLayoutReadOnly = _useContext.readOnly,
59
+ formLayoutCompressed = _useContext.compressed;
60
+ var isDisabled = _isDisabled !== null && _isDisabled !== void 0 ? _isDisabled : formLayoutIsDisabled;
61
+ var isInvalid = _isInvalid !== null && _isInvalid !== void 0 ? _isInvalid : formLayoutIsInvalid;
62
+ var isLoading = formLayoutIsLoading === true ? false : _isLoading;
63
+ var compressed = _compressed !== null && _compressed !== void 0 ? _compressed : formLayoutCompressed;
51
64
  var styles = (0, _services.useEuiMemoizedStyles)(_form_control_button.euiFormControlButtonStyles);
52
65
  var classes = (0, _classnames.default)('euiFormControlButton', className);
53
- var cssStyles = [styles.euiFormControlButton, isInvalid && styles.isInvalid, compressed && styles.compressed, fullWidth ? styles.fullWidth : styles.formWidth];
66
+ var cssStyles = [styles.euiFormControlButton, isInvalid && styles.isInvalid, isLoading && styles.isLoading, formLayoutReadOnly && styles.readOnly, compressed && styles.compressed, fullWidth ? styles.fullWidth : styles.formWidth];
54
67
  var contentProps = _objectSpread(_objectSpread({}, _contentProps), {}, {
55
68
  css: [styles.euiFormControlButton__content, _contentProps === null || _contentProps === void 0 ? void 0 : _contentProps.css]
56
69
  });
@@ -73,7 +86,10 @@ var EuiFormControlButton = exports.EuiFormControlButton = function EuiFormContro
73
86
  className: classes,
74
87
  contentProps: contentProps,
75
88
  textProps: false,
76
- color: "text"
89
+ color: "text",
90
+ isDisabled: isDisabled,
91
+ isLoading: isLoading,
92
+ iconSide: isLoading ? 'right' : iconSide
77
93
  }, restProps), hasText && (0, _react2.jsx)("span", (0, _extends2.default)({}, customTextProps, {
78
94
  ref: buttonTextRef
79
95
  }), value || placeholder), hasText && content && ' ', content);
@@ -24,11 +24,14 @@ var _ref = process.env.NODE_ENV === "production" ? {
24
24
  };
25
25
  var euiFormControlButtonStyles = exports.euiFormControlButtonStyles = function euiFormControlButtonStyles(euiThemeContext) {
26
26
  var euiTheme = euiThemeContext.euiTheme;
27
+ var form = (0, _form.euiFormVariables)(euiThemeContext);
27
28
  var formStyles = (0, _form.euiFormControlStyles)(euiThemeContext);
28
29
  return {
29
30
  euiFormControlButton: /*#__PURE__*/(0, _react.css)(formStyles.shared, " ", formStyles.uncompressed, " font-weight:", euiTheme.font.weight.regular, ";transition:none;&:hover{&::before{display:none;}}&:focus{", formStyles.focus, ";}&:disabled{", formStyles.disabled, ";};label:euiFormControlButton;"),
30
31
  isInvalid: /*#__PURE__*/(0, _react.css)(formStyles.invalid, " &:disabled{", formStyles.invalid, ";};label:isInvalid;"),
32
+ readOnly: /*#__PURE__*/(0, _react.css)(formStyles.readOnly, ";;label:readOnly;"),
31
33
  compressed: /*#__PURE__*/(0, _react.css)(formStyles.compressed, ";;label:compressed;"),
34
+ isLoading: /*#__PURE__*/(0, _react.css)("&:is(", _global_styling.euiDisabledSelector, "){background-color:", form.backgroundColor, ";}.euiLoadingSpinner{color:", euiTheme.colors.borderBasePlain, ";};label:isLoading;"),
32
35
  formWidth: formStyles.formWidth,
33
36
  fullWidth: /*#__PURE__*/(0, _react.css)(formStyles.fullWidth, ";label:fullWidth;"),
34
37
  euiFormControlButton__content: /*#__PURE__*/(0, _react.css)("justify-content:flex-start;", (0, _global_styling.logicalCSS)('width', '100%'), ";;label:euiFormControlButton__content;"),
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.EuiFormPrepend = exports.EuiFormAppendPrepend = exports.EuiFormAppend = void 0;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
+ var _react = _interopRequireWildcard(require("react"));
12
+ var _classnames = _interopRequireDefault(require("classnames"));
13
+ var _services = require("../../../../services");
14
+ var _icon = require("../../../icon");
15
+ var _form_label = require("../../form_label");
16
+ var _form_append_prepend = require("./form_append_prepend.styles");
17
+ var _form_control_layout_context = require("../form_control_layout_context");
18
+ var _react2 = require("@emotion/react");
19
+ var _excluded = ["className"],
20
+ _excluded2 = ["className"],
21
+ _excluded3 = ["element", "id", "side", "children", "className", "inputId", "compressed", "iconLeft", "iconRight", "label", "isDisabled", "disabled"];
22
+ /*
23
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
24
+ * or more contributor license agreements. Licensed under the Elastic License
25
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
26
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
27
+ * Side Public License, v 1.
28
+ */
29
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
30
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
31
+ var EuiFormAppend = exports.EuiFormAppend = function EuiFormAppend(_ref) {
32
+ var className = _ref.className,
33
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
34
+ var classes = (0, _classnames.default)('euiFormAppend', className);
35
+ return (0, _react2.jsx)(EuiFormAppendPrepend, (0, _extends2.default)({
36
+ className: classes
37
+ }, rest, {
38
+ side: "append"
39
+ }));
40
+ };
41
+ var EuiFormPrepend = exports.EuiFormPrepend = function EuiFormPrepend(_ref2) {
42
+ var className = _ref2.className,
43
+ rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
44
+ var classes = (0, _classnames.default)('euiFormPrepend', className);
45
+ return (0, _react2.jsx)(EuiFormAppendPrepend, (0, _extends2.default)({
46
+ className: classes
47
+ }, rest, {
48
+ side: "prepend"
49
+ }));
50
+ };
51
+ /* Internal component */
52
+
53
+ var EuiFormAppendPrepend = exports.EuiFormAppendPrepend = function EuiFormAppendPrepend(_ref3) {
54
+ var _ref3$element = _ref3.element,
55
+ element = _ref3$element === void 0 ? 'div' : _ref3$element,
56
+ id = _ref3.id,
57
+ side = _ref3.side,
58
+ children = _ref3.children,
59
+ className = _ref3.className,
60
+ _inputId = _ref3.inputId,
61
+ _compressed = _ref3.compressed,
62
+ _iconLeft = _ref3.iconLeft,
63
+ _iconRight = _ref3.iconRight,
64
+ _label = _ref3.label,
65
+ _isDisabled = _ref3.isDisabled,
66
+ disabled = _ref3.disabled,
67
+ rest = (0, _objectWithoutProperties2.default)(_ref3, _excluded3);
68
+ var styles = (0, _services.useEuiMemoizedStyles)(_form_append_prepend.euiFormAppendPrependStyles);
69
+ var _useContext = (0, _react.useContext)(_form_control_layout_context.EuiFormControlLayoutContext),
70
+ formLayoutCompressed = _useContext.compressed,
71
+ formLayoutInputId = _useContext.inputId,
72
+ formLayoutIsDisabled = _useContext.isDisabled;
73
+ var compressed = _compressed !== null && _compressed !== void 0 ? _compressed : formLayoutCompressed;
74
+ var inputId = _inputId !== null && _inputId !== void 0 ? _inputId : formLayoutInputId;
75
+
76
+ // Adding automatic check on onClick for DevX convenience, this doesn't replace defining `element`
77
+ var isButton = element === 'button' || typeof rest.onClick === 'function';
78
+ var isDisabled = _isDisabled || disabled || !isButton && formLayoutIsDisabled;
79
+ var iconLeft = _iconLeft && (0, _react2.jsx)(_icon.EuiIcon, {
80
+ type: _iconLeft
81
+ });
82
+ var iconRight = _iconRight && (0, _react2.jsx)(_icon.EuiIcon, {
83
+ type: _iconRight
84
+ });
85
+ var cssStyles = [styles.side, compressed ? styles.compressed : styles.uncompressed, isButton && !isDisabled && styles.isInteractive, isDisabled && styles.disabled];
86
+ var labelProps = isButton ? {
87
+ type: 'span',
88
+ id: id,
89
+ className: 'eui-textTruncate'
90
+ } : {
91
+ type: 'label',
92
+ id: id,
93
+ htmlFor: inputId || undefined
94
+ };
95
+ var label = _label && (0, _react2.jsx)(_form_label.EuiFormLabel, labelProps, _label);
96
+ var content = (0, _react2.jsx)(_react.default.Fragment, null, iconLeft, label, iconRight, children);
97
+ var component = (0, _react2.jsx)("div", (0, _extends2.default)({
98
+ className: className,
99
+ css: cssStyles
100
+ }, rest), content);
101
+ if (isButton) {
102
+ component = (0, _react2.jsx)("button", (0, _extends2.default)({
103
+ className: className,
104
+ css: cssStyles,
105
+ disabled: isDisabled
106
+ }, rest), content);
107
+ }
108
+ return (0, _react2.jsx)("div", {
109
+ css: styles.wrapper
110
+ }, component);
111
+ };
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.euiFormAppendPrependStyles = void 0;
7
+ var _react = require("@emotion/react");
8
+ var _global_styling = require("../../../../global_styling");
9
+ var _form_control_layout = require("../form_control_layout.styles");
10
+ var _form = require("../../form.styles");
11
+ /*
12
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
13
+ * or more contributor license agreements. Licensed under the Elastic License
14
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
15
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
16
+ * Side Public License, v 1.
17
+ */
18
+
19
+ var euiFormAppendPrependStyles = exports.euiFormAppendPrependStyles = function euiFormAppendPrependStyles(euiThemeContext) {
20
+ var euiTheme = euiThemeContext.euiTheme;
21
+ var form = (0, _form.euiFormVariables)(euiThemeContext);
22
+ var appendPrepend = _form_control_layout.appendPrependSelector;
23
+ var buttons = _form_control_layout.buttonSelector;
24
+ var text = _form_control_layout.textSelector;
25
+ var buttonStyles = (0, _global_styling.euiButtonDisplaysColors)(euiThemeContext);
26
+ return {
27
+ side: /*#__PURE__*/(0, _react.css)("position:relative;display:flex;align-items:center;gap:", euiTheme.size.s, ";block-size:100%;max-inline-size:100%;border-radius:", form.controlLayoutInnerBorderRadius, ";&:focus-visible{outline:none;};label:side;"),
28
+ uncompressed: /*#__PURE__*/(0, _react.css)("&:not(:has(> ", buttons, ":first-child, > *:first-child ", buttons, ")){", (0, _global_styling.logicalCSS)('padding-left', euiTheme.size.s), ";}&:not(:has(> ", buttons, ":last-child, > *:last-child ", buttons, ")){", (0, _global_styling.logicalCSS)('padding-right', euiTheme.size.s), ";};label:uncompressed;"),
29
+ compressed: /*#__PURE__*/(0, _react.css)("&:not(:has(> ", buttons, ":first-child, > *:first-child ", buttons, ")){", (0, _global_styling.logicalCSS)('padding-left', euiTheme.size.xs), ";}&:not(:has(> ", buttons, ":last-child, > *:last-child ", buttons, ")){", (0, _global_styling.logicalCSS)('padding-right', euiTheme.size.xs), ";};label:compressed;"),
30
+ wrapper: /*#__PURE__*/(0, _react.css)("position:relative;max-inline-size:100%;&:has(", appendPrepend, ":focus-visible){&::after{", (0, _form.euiFormControlFocusStyles)(euiThemeContext), " content:'';position:absolute;inset:-", euiTheme.size.xs, ";border-radius:", form.controlLayoutBorderRadius, ";pointer-events:none;}};label:wrapper;"),
31
+ isInteractive: /*#__PURE__*/(0, _react.css)(buttonStyles.empty.primary, ";background-color:", form.backgroundColor, ";*{cursor:pointer;}", text, "{color:currentColor;cursor:pointer;};label:isInteractive;"),
32
+ disabled: /*#__PURE__*/(0, _react.css)("color:", form.textColorDisabled, ";.euiFormLabel,.euiNotificationBadge{color:", form.textColorDisabled, ";};label:disabled;")
33
+ };
34
+ };
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "EuiFormAppend", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _form_append_prepend.EuiFormAppend;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "EuiFormPrepend", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _form_append_prepend.EuiFormPrepend;
16
+ }
17
+ });
18
+ var _form_append_prepend = require("./form_append_prepend");
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.EuiFormControlLayout = void 0;
9
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
12
12
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
13
  var _react = _interopRequireWildcard(require("react"));
@@ -18,6 +18,8 @@ var _eui_form_context = require("../eui_form_context");
18
18
  var _num_icons = require("./_num_icons");
19
19
  var _form_control_layout_icons = require("./form_control_layout_icons");
20
20
  var _form_control_layout = require("./form_control_layout.styles");
21
+ var _append_prepend = require("./append_prepend");
22
+ var _form_control_layout_context = require("./form_control_layout_context");
21
23
  var _react2 = require("@emotion/react");
22
24
  var _excluded = ["inputId", "className", "children", "icon", "iconsPosition", "clear", "isDropdown", "isLoading", "isInvalid", "isDisabled", "readOnly", "compressed", "prepend", "append", "isDelimited", "wrapperProps", "fullWidth"];
23
25
  /*
@@ -62,7 +64,7 @@ var EuiFormControlLayout = exports.EuiFormControlLayout = function EuiFormContro
62
64
  }, className);
63
65
  var styles = (0, _services.useEuiMemoizedStyles)(_form_control_layout.euiFormControlLayoutStyles);
64
66
  var cssStyles = [styles.euiFormControlLayout, compressed ? styles.compressed : styles.uncompressed, fullWidth ? styles.fullWidth : styles.formWidth].concat((0, _toConsumableArray2.default)(isGroup ? [styles.group.group, compressed ? styles.group.compressed : styles.group.uncompressed] : []));
65
- var childrenWrapperStyles = [styles.children.euiFormControlLayout__childrenWrapper, isGroup && styles.children.inGroup, isGroup && !append && styles.children.prependOnly, isGroup && !prepend && styles.children.appendOnly, wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.css];
67
+ var childrenWrapperStyles = [styles.children.euiFormControlLayout__childrenWrapper, isGroup && styles.children.inGroup, wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.css];
66
68
  var hasDropdownIcon = !readOnly && !isDisabled && isDropdown;
67
69
  var hasRightIcon = (0, _num_icons.isRightSideIcon)(icon);
68
70
  var hasLeftIcon = icon && !hasRightIcon;
@@ -78,15 +80,28 @@ var EuiFormControlLayout = exports.EuiFormControlLayout = function EuiFormContro
78
80
  isDropdown: hasDropdownIcon
79
81
  });
80
82
  }, [iconsPosition, icon, clear, isInvalid, isLoading, hasDropdownIcon]);
83
+ var sideNodeCommonProps = {
84
+ inputId: inputId,
85
+ compressed: compressed,
86
+ isDisabled: isDisabled,
87
+ readOnly: readOnly
88
+ };
81
89
  return (0, _react2.jsx)("div", (0, _extends2.default)({
82
90
  css: cssStyles,
83
91
  className: classes
84
- }, rest), (0, _react2.jsx)(EuiFormControlLayoutSideNodes, {
92
+ }, rest), (0, _react2.jsx)(_form_control_layout_context.EuiFormControlLayoutContextProvider, {
93
+ value: {
94
+ compressed: !!compressed,
95
+ inputId: inputId,
96
+ isDisabled: isDisabled,
97
+ isInvalid: isInvalid,
98
+ readOnly: readOnly,
99
+ isLoading: isLoading
100
+ }
101
+ }, (0, _react2.jsx)(EuiFormControlLayoutSideNodes, (0, _extends2.default)({
85
102
  side: "prepend",
86
- nodes: prepend,
87
- inputId: inputId,
88
- compressed: compressed
89
- }), (0, _react2.jsx)("div", (0, _extends2.default)({}, wrapperProps, {
103
+ nodes: prepend
104
+ }, sideNodeCommonProps)), (0, _react2.jsx)("div", (0, _extends2.default)({}, wrapperProps, {
90
105
  css: childrenWrapperStyles,
91
106
  className: (0, _classnames.default)('euiFormControlLayout__childrenWrapper', wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.className),
92
107
  style: _objectSpread(_objectSpread({}, iconAffordanceStyles), wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.style)
@@ -106,32 +121,46 @@ var EuiFormControlLayout = exports.EuiFormControlLayout = function EuiFormContro
106
121
  isInvalid: isInvalid,
107
122
  isDropdown: hasDropdownIcon,
108
123
  isDisabled: isDisabled
109
- })), (0, _react2.jsx)(EuiFormControlLayoutSideNodes, {
124
+ })), (0, _react2.jsx)(EuiFormControlLayoutSideNodes, (0, _extends2.default)({
110
125
  side: "append",
111
- nodes: append,
112
- inputId: inputId,
113
- compressed: compressed
114
- }));
126
+ nodes: append
127
+ }, sideNodeCommonProps))));
115
128
  };
116
129
 
117
130
  /**
118
131
  * Internal subcomponent utility for prepend/append nodes
119
132
  */
120
- var EuiFormControlLayoutSideNodes = function EuiFormControlLayoutSideNodes(_ref) {
121
- var side = _ref.side,
122
- nodes = _ref.nodes,
123
- inputId = _ref.inputId,
124
- compressed = _ref.compressed;
133
+ var EuiFormControlLayoutSideNodes = function EuiFormControlLayoutSideNodes(props) {
134
+ var side = props.side,
135
+ nodes = props.nodes,
136
+ inputId = props.inputId,
137
+ compressed = props.compressed,
138
+ isDisabled = props.isDisabled,
139
+ readOnly = props.readOnly;
125
140
  var className = "euiFormControlLayout__".concat(side);
126
141
  var styles = (0, _services.useEuiMemoizedStyles)(_form_control_layout.euiFormControlLayoutSideNodeStyles);
127
- var cssStyles = [styles.euiFormControlLayout__side, styles[side], compressed ? styles.compressed : styles.uncompressed];
142
+ var cssStyles = [styles.euiFormControlLayout__side, compressed ? [styles.compressed.compressed, styles.compressed[side]] : [styles.uncompressed.uncompressed, styles.uncompressed[side]], isDisabled && styles.disabled, readOnly && styles.readOnly];
128
143
  if (!nodes) return null;
144
+ var content;
145
+ var AppendOrPrepend = side === 'append' ? _append_prepend.EuiFormAppend : _append_prepend.EuiFormPrepend;
146
+ if (Array.isArray(nodes)) {
147
+ if (nodes.length === 0) return null;
148
+ content = _react.default.Children.map(nodes, function (node) {
149
+ return typeof node === 'string' ? (0, _react2.jsx)(_form_label.EuiFormLabel, {
150
+ htmlFor: inputId
151
+ }, node) : node;
152
+ });
153
+ } else if (typeof nodes === 'string') {
154
+ content = (0, _react2.jsx)(AppendOrPrepend, {
155
+ inputId: inputId,
156
+ compressed: compressed,
157
+ label: nodes
158
+ });
159
+ } else {
160
+ content = nodes;
161
+ }
129
162
  return (0, _react2.jsx)("div", {
130
163
  css: cssStyles,
131
164
  className: className
132
- }, _react.default.Children.map(nodes, function (node) {
133
- return typeof node === 'string' ? (0, _react2.jsx)(_form_label.EuiFormLabel, {
134
- htmlFor: inputId
135
- }, node) : node;
136
- }));
165
+ }, content);
137
166
  };
@@ -3,10 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.euiFormControlLayoutStyles = exports.euiFormControlLayoutSideNodeStyles = void 0;
6
+ exports.textSelector = exports.euiFormControlLayoutStyles = exports.euiFormControlLayoutSideNodeStyles = exports.buttonSelector = exports.appendPrependSelector = void 0;
7
7
  var _react = require("@emotion/react");
8
8
  var _global_styling = require("../../../global_styling");
9
- var _high_contrast = require("../../../global_styling/functions/high_contrast");
10
9
  var _form = require("../form.styles");
11
10
  function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /*
12
11
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@@ -15,12 +14,16 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
15
14
  * in compliance with, at your election, the Elastic License 2.0 or the Server
16
15
  * Side Public License, v 1.
17
16
  */
17
+ var buttonSelector = exports.buttonSelector = '*:is(.euiButton, .euiButtonEmpty, .euiButtonIcon, .euiFormAppend, .euiFormPrepend)';
18
+ var emptyButtonSelector = '*:is(.euiButtonEmpty, .euiButtonIcon:not([class*="fill"]))';
19
+ var textSelector = exports.textSelector = '*:is(.euiFormLabel, .euiText)';
20
+ var appendPrependSelector = exports.appendPrependSelector = '*:is(.euiFormAppend, .euiFormPrepend)';
18
21
  var _ref = process.env.NODE_ENV === "production" ? {
19
- name: "1lbfa6m-euiFormControlLayout__childrenWrapper",
20
- styles: "position:relative;label:euiFormControlLayout__childrenWrapper;"
22
+ name: "1iumk9q-euiFormControlLayout__childrenWrapper",
23
+ styles: "position:relative;border-radius:inherit;label:euiFormControlLayout__childrenWrapper;"
21
24
  } : {
22
- name: "1lbfa6m-euiFormControlLayout__childrenWrapper",
23
- styles: "position:relative;label:euiFormControlLayout__childrenWrapper;",
25
+ name: "1iumk9q-euiFormControlLayout__childrenWrapper",
26
+ styles: "position:relative;border-radius:inherit;label:euiFormControlLayout__childrenWrapper;",
24
27
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
25
28
  };
26
29
  var _ref2 = process.env.NODE_ENV === "production" ? {
@@ -32,7 +35,8 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
32
35
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
33
36
  };
34
37
  var euiFormControlLayoutStyles = exports.euiFormControlLayoutStyles = function euiFormControlLayoutStyles(euiThemeContext) {
35
- var euiTheme = euiThemeContext.euiTheme;
38
+ var euiTheme = euiThemeContext.euiTheme,
39
+ highContrastMode = euiThemeContext.highContrastMode;
36
40
  var form = (0, _form.euiFormVariables)(euiThemeContext);
37
41
  return {
38
42
  euiFormControlLayout: _ref2,
@@ -43,37 +47,52 @@ var euiFormControlLayoutStyles = exports.euiFormControlLayoutStyles = function e
43
47
  formWidth: "\n ".concat((0, _global_styling.logicalCSS)('max-width', form.maxWidth), "\n ").concat((0, _global_styling.logicalCSS)('width', '100%'), "\n "),
44
48
  fullWidth: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-width', '100%'), " ", (0, _global_styling.logicalCSS)('width', '100%'), ";;label:fullWidth;"),
45
49
  group: {
46
- group: /*#__PURE__*/(0, _react.css)("position:relative;display:flex;align-items:stretch;border:none;background-color:", form.backgroundColor, ";overflow:hidden;&::after{content:'';position:absolute;inset:0;z-index:0;border:", euiTheme.border.width.thin, " solid ", form.borderColor, ";border-radius:inherit;pointer-events:none;}.euiFilterGroup{border-radius:0;", (0, _global_styling.logicalCSS)('padding-right', euiTheme.border.width.thin), " &::after{display:none;}}.euiFilterButton__wrapper:first-of-type::before,.euiFilterButton__wrapper::after{display:none;}.euiFormControlButton{border-radius:inherit;box-shadow:none;}>*{", (0, _global_styling.logicalCSS)('height', '100%'), ";};label:group;"),
50
+ group: /*#__PURE__*/(0, _react.css)("position:relative;display:flex;align-items:stretch;border:none;background-color:", form.backgroundColor, ";overflow:hidden;&::after{content:'';position:absolute;inset:0;z-index:0;border:", euiTheme.border.width.thin, " solid ", form.borderColor, ";border-radius:inherit;pointer-events:none;}&:where(:not(:has(*:is(", _global_styling.euiDisabledSelector, "), [readOnly])):hover){&::after{border:", highContrastMode ? euiTheme.border.width.thick : euiTheme.border.width.thin, " solid ", highContrastMode ? form.borderColor : form.borderHovered, ";}}&:has(:autofill){background:", form.backgroundAutoFilled, ";&:not(:hover)::after{border-color:", form.borderAutofilled, ";}*:-webkit-autofill,*:autofill{--euiFormControlStateAutofillColor:", form.backgroundAutoFilled, ";background-clip:content-box;&:hover,&:focus{--euiFormControlStateAutofillColor:", form.backgroundAutoFilled, ";}}}.euiFilterGroup{border-radius:0;", (0, _global_styling.logicalCSS)('padding-right', euiTheme.border.width.thin), " &::after{display:none;}}.euiFilterButton__wrapper:first-of-type::before,.euiFilterButton__wrapper::after{display:none;}>*{", (0, _global_styling.logicalCSS)('height', '100%'), ";};label:group;"),
47
51
  // Skipping css`` to avoid repeated compressed/uncompressed classNames
48
52
  uncompressed: "\n border-radius: ".concat(form.controlBorderRadius, ";\n "),
49
53
  compressed: "\n border-radius: ".concat(form.controlCompressedBorderRadius, ";\n ")
50
54
  },
51
55
  children: {
52
56
  euiFormControlLayout__childrenWrapper: _ref,
53
- inGroup: /*#__PURE__*/(0, _react.css)("flex-grow:1;overflow:hidden;>:first-child{border-radius:inherit;", (0, _global_styling.logicalCSS)('border-top-left-radius', '0'), " ", (0, _global_styling.logicalCSS)('border-bottom-left-radius', '0'), ";}>:last-child{border-radius:inherit;", (0, _global_styling.logicalCSS)('border-top-right-radius', '0'), " ", (0, _global_styling.logicalCSS)('border-bottom-right-radius', '0'), ";};label:inGroup;"),
54
- prependOnly: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-top-right-radius', 'inherit'), " ", (0, _global_styling.logicalCSS)('border-bottom-right-radius', 'inherit'), ">:last-child{", (0, _global_styling.logicalCSS)('border-top-right-radius', 'inherit'), " ", (0, _global_styling.logicalCSS)('border-bottom-right-radius', 'inherit'), ";};label:prependOnly;"),
55
- appendOnly: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-top-left-radius', 'inherit'), " ", (0, _global_styling.logicalCSS)('border-bottom-left-radius', 'inherit'), ">:first-child{", (0, _global_styling.logicalCSS)('border-top-left-radius', 'inherit'), " ", (0, _global_styling.logicalCSS)('border-bottom-left-radius', 'inherit'), ";};label:appendOnly;")
57
+ inGroup: /*#__PURE__*/(0, _react.css)("flex-grow:1;overflow:hidden;--euiFormControlStateColor:transparent;--euiFormControlStateHoverColor:transparent;.euiFormControlButton{box-shadow:none;", (0, _global_styling.highContrastModeStyles)(euiThemeContext, {
58
+ none: 'box-shadow: none;',
59
+ preferred: 'border: none;'
60
+ }), ";};label:inGroup;")
56
61
  }
57
62
  };
58
63
  };
59
64
  var euiFormControlLayoutSideNodeStyles = exports.euiFormControlLayoutSideNodeStyles = function euiFormControlLayoutSideNodeStyles(euiThemeContext) {
60
65
  var euiTheme = euiThemeContext.euiTheme;
61
66
  var form = (0, _form.euiFormVariables)(euiThemeContext);
62
- var uncompressedHeight = form.controlHeight;
63
- var compressedHeight = form.controlCompressedHeight;
64
- var buttons = '*:is(.euiButton, .euiButtonEmpty, .euiButtonIcon)';
65
- var text = '*:is(.euiFormLabel, .euiText)';
67
+ var buttonSizes = (0, _global_styling.euiButtonSizeMap)(euiThemeContext);
68
+ var uncompressedHeight = (0, _global_styling.mathWithUnits)([form.controlHeight, euiTheme.size.s], function (x, y) {
69
+ return x - y;
70
+ });
71
+ var compressedHeight = (0, _global_styling.mathWithUnits)([form.controlCompressedHeight, euiTheme.size.s], function (x, y) {
72
+ return x - y;
73
+ });
74
+ var buttons = buttonSelector;
75
+ var text = textSelector;
76
+ var appendPrepend = appendPrependSelector;
77
+ var _buttonPadding = function _buttonPadding(size) {
78
+ return (0, _global_styling.logicalCSS)('padding-horizontal', buttonSizes[size].padding);
79
+ };
80
+ var dividerStyles = function dividerStyles(side, compressed) {
81
+ return "\n position: relative;\n ".concat("margin-inline-".concat(side), ": -", euiTheme.border.width.thin, ";\n\n &::before {\n content: '';\n position: absolute;\n inset-inline-").concat(side, ": 0;\n z-index: ").concat(side === 'end' ? 1 : 0, ";\n block-size: ").concat(compressed ? euiTheme.size.base : euiTheme.size.l, ";\n inline-size: ").concat(euiTheme.border.width.thin, ";\n pointer-events: none;\n border-inline-").concat(side, ": \n ").concat(euiTheme.border.width.thin, " solid ").concat(form.borderColor, ";\n }\n ");
82
+ };
66
83
  return {
67
- euiFormControlLayout__side: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', '100%'), " ", (0, _global_styling.euiTextTruncate)('50%'), " flex-shrink:0;display:flex;align-items:center;gap:", euiTheme.size.xs, ";background-color:", form.appendPrependBackground, ";", buttons, "{transform:none!important;&:focus-visible{outline-offset:-", euiTheme.focus.width, ";}}", text, "{cursor:default;overflow:hidden;text-overflow:ellipsis;}&:not(:has(> ", buttons, ":first-child, > *:first-child > ", buttons, ")){", (0, _global_styling.logicalCSS)('padding-left', euiTheme.size.s), ";}&:not(:has(> ", buttons, ":last-child, > *:last-child > ", buttons, ")){", (0, _global_styling.logicalCSS)('padding-right', euiTheme.size.s), ";};label:euiFormControlLayout__side;"),
68
- append: /*#__PURE__*/(0, _react.css)((0, _high_contrast.highContrastModeStyles)(euiThemeContext, {
69
- none: "\n position: relative;\n ".concat((0, _global_styling.logicalCSS)('margin-left', "-".concat(euiTheme.border.width.thin)), "\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n border-inline-start: \n ").concat(euiTheme.border.width.thin, " solid ").concat(form.borderColor, ";\n }\n "),
70
- preferred: (0, _global_styling.logicalCSS)('border-left', euiTheme.border.thin)
71
- }), ";label:append;"),
72
- prepend: /*#__PURE__*/(0, _react.css)((0, _high_contrast.highContrastModeStyles)(euiThemeContext, {
73
- none: "\n position: relative;\n ".concat((0, _global_styling.logicalCSS)('margin-right', "-".concat(euiTheme.border.width.thin)), "\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n z-index: 1;\n pointer-events: none;\n border-inline-end: \n ").concat(euiTheme.border.width.thin, " solid ").concat(form.borderColor, ";\n }\n "),
74
- preferred: (0, _global_styling.logicalCSS)('border-right', euiTheme.border.thin)
75
- }), ";label:prepend;"),
76
- uncompressed: "\n ".concat(text, " {\n ").concat((0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.xs), "\n line-height: ").concat(uncompressedHeight, ";\n }\n\n ").concat(buttons, " {\n ").concat((0, _global_styling.logicalCSS)('height', uncompressedHeight), "\n }\n\n .euiButtonIcon {\n flex-shrink: 0;\n ").concat((0, _global_styling.logicalCSS)('width', euiTheme.size.xl), "\n }\n "),
77
- compressed: /*#__PURE__*/(0, _react.css)(text, "{", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.xxs), " line-height:", compressedHeight, ";}", buttons, "{", (0, _global_styling.logicalCSS)('height', compressedHeight), ";}.euiButtonIcon{flex-shrink:0;", (0, _global_styling.logicalCSS)('width', euiTheme.size.xl), ";};label:compressed;")
84
+ euiFormControlLayout__side: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', '100%'), " ", (0, _global_styling.euiTextTruncate)('50%'), " flex-shrink:0;display:flex;align-items:center;gap:", euiTheme.size.s, ";padding:", euiTheme.size.xs, ";", buttons, "{block-size:100%;border-radius:", form.controlLayoutInnerBorderRadius, ";transform:none!important;&:focus-visible{z-index:1;outline-offset:", euiTheme.focus.width, ";}}", text, "{cursor:default;overflow:hidden;text-overflow:ellipsis;}&:where(:has(", buttons, ":focus-visible):has(> *:only-child)){*:not(", appendPrepend, "){outline:none;}&::after{", (0, _form.euiFormControlFocusStyles)(euiThemeContext), " content:'';position:absolute;inset:0;border-radius:", form.controlLayoutBorderRadius, ";pointer-events:none;}}:where(:not(:has(:disabled))) label{color:", form.labelColor, ";};label:euiFormControlLayout__side;"),
85
+ uncompressed: {
86
+ uncompressed: "\n &:not(:has(> ".concat(buttons, ":first-child, > *:first-child ").concat(buttons, ")) {\n ").concat((0, _global_styling.logicalCSS)('padding-left', euiTheme.size.s), "\n }\n\n &:not(:has(> ").concat(buttons, ":last-child, > *:last-child ").concat(buttons, ")) {\n ").concat((0, _global_styling.logicalCSS)('padding-right', euiTheme.size.s), "\n }\n\n ").concat(text, " {\n line-height: ").concat(uncompressedHeight, ";\n\n &:first-child {\n ").concat((0, _global_styling.logicalCSS)('padding-left', euiTheme.size.xs), "\n }\n\n &:last-child {\n ").concat((0, _global_styling.logicalCSS)('padding-right', euiTheme.size.xs), "\n }\n }\n\n ").concat(buttons, " {\n ").concat((0, _global_styling.logicalCSS)('height', uncompressedHeight), "\n ").concat(_buttonPadding('s'), "\n }\n\n .euiButtonIcon {\n flex-shrink: 0;\n ").concat((0, _global_styling.logicalCSS)('width', uncompressedHeight), "\n }\n "),
87
+ append: "\n ".concat(dividerStyles('start'), "\n "),
88
+ prepend: "\n ".concat(dividerStyles('end'), "\n ")
89
+ },
90
+ compressed: {
91
+ compressed: /*#__PURE__*/(0, _react.css)("&:not(:has(", appendPrepend, ")):not(\n :has(> ", buttons, ":first-child, > *:first-child ", buttons, ")\n ){", (0, _global_styling.logicalCSS)('padding-left', euiTheme.size.s), ";}&:not(:has(", appendPrepend, ")):not(\n :has(> ", buttons, ":last-child, > *:last-child ", buttons, ")\n ){", (0, _global_styling.logicalCSS)('padding-right', euiTheme.size.s), ";}", text, "{line-height:", compressedHeight, ";&:first-child{", (0, _global_styling.logicalCSS)('padding-left', euiTheme.size.xxs), ";}&:last-child{", (0, _global_styling.logicalCSS)('padding-right', euiTheme.size.xxs), ";}}", buttons, "{", (0, _global_styling.logicalCSS)('height', compressedHeight), " &:where(:not(.euiButtonIcon)){", _buttonPadding('xs'), ";}}.euiButtonIcon{flex-shrink:0;", (0, _global_styling.logicalCSS)('width', compressedHeight), ";};label:compressed;"),
92
+ append: "\n ".concat(dividerStyles('start', true), "\n "),
93
+ prepend: "\n ".concat(dividerStyles('end', true), "\n ")
94
+ },
95
+ disabled: /*#__PURE__*/(0, _react.css)("background-color:", form.backgroundDisabledColor, ";&:where(:not(:has(", appendPrepend, ", ", buttonSelector, ")))>*,&:where(:not(:has(", appendPrepend, "))) .euiFormLabel{color:", form.textColorDisabled, ";}", emptyButtonSelector, ":not(\n ", _global_styling.euiDisabledSelector, "\n ){background-color:", form.backgroundColor, ";};label:disabled;"),
96
+ readOnly: /*#__PURE__*/(0, _react.css)("background-color:", form.backgroundDisabledColor, ";", emptyButtonSelector, ":not(\n ", _global_styling.euiDisabledSelector, "\n ){background-color:", form.backgroundColor, ";};label:readOnly;")
78
97
  };
79
98
  };
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.EuiFormControlLayoutContextProvider = exports.EuiFormControlLayoutContext = void 0;
7
+ var _react = require("react");
8
+ /*
9
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
10
+ * or more contributor license agreements. Licensed under the Elastic License
11
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
12
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
13
+ * Side Public License, v 1.
14
+ */
15
+
16
+ /**
17
+ * Context to share props between `EuiFormControlLayout` and passed children like e.g. EuiFormAppend/Prepend
18
+ */
19
+ var EuiFormControlLayoutContext = exports.EuiFormControlLayoutContext = /*#__PURE__*/(0, _react.createContext)({
20
+ compressed: false,
21
+ inputId: '',
22
+ isDisabled: false,
23
+ isInvalid: false,
24
+ isLoading: false,
25
+ readOnly: false
26
+ });
27
+ var EuiFormControlLayoutContextProvider = exports.EuiFormControlLayoutContextProvider = EuiFormControlLayoutContext.Provider;
@@ -16,12 +16,8 @@ var _form = require("../form.styles");
16
16
  */
17
17
 
18
18
  var euiFormControlLayoutDelimitedStyles = exports.euiFormControlLayoutDelimitedStyles = function euiFormControlLayoutDelimitedStyles(euiThemeContext) {
19
- var highContrastMode = euiThemeContext.highContrastMode;
20
- var form = (0, _form.euiFormVariables)(euiThemeContext);
21
- var delimitedStyles = "\n /* Transition smoothly between disabled/readOnly background color changes */\n ".concat((0, _form.euiFormControlDefaultShadow)(euiThemeContext, {
22
- withBorder: !highContrastMode ? true : false,
23
- withBackground: false
24
- }), "\n ").trim();
19
+ var euiTheme = euiThemeContext.euiTheme;
20
+ var delimitedStyles = "\n border-radius: ".concat(euiTheme.border.radius.small, ";\n ").trim();
25
21
  return {
26
22
  // Appended onto existing `euiFormControlLayout` styles
27
23
  delimited: /*#__PURE__*/(0, _react.css)(delimitedStyles, ";label:delimited;"),
@@ -29,14 +25,11 @@ var euiFormControlLayoutDelimitedStyles = exports.euiFormControlLayoutDelimitedS
29
25
  readOnly: /*#__PURE__*/(0, _react.css)((0, _form.euiFormControlReadOnlyStyles)(euiThemeContext), " & .euiFormControlLayoutDelimited__input{--euiFormControlStateColor:transparent;outline:none;box-shadow:none;};label:readOnly;"),
30
26
  // Appended onto existing `euiFormControlLayout__childrenWrapper` styles
31
27
  childrenWrapper: {
32
- delimited: /*#__PURE__*/(0, _react.css)("display:flex;", (0, _form.euiFormControlDefaultShadow)(euiThemeContext, {
33
- withBorder: !highContrastMode,
34
- withBackground: false
35
- }), " &:hover{", (0, _form.euiFormControlHoverStyles)(euiThemeContext), " box-shadow:none;.euiFormControlLayoutDelimited__input:not(:focus){outline:none;background-color:transparent;}}>:first-child{", (0, _global_styling.logicalCSS)('border-top-left-radius', 'inherit'), " ", (0, _global_styling.logicalCSS)('border-bottom-left-radius', 'inherit'), ";}>:last-child{", (0, _global_styling.logicalCSS)('border-top-right-radius', 'inherit'), " ", (0, _global_styling.logicalCSS)('border-bottom-right-radius', 'inherit'), ";};label:delimited;"),
28
+ delimited: /*#__PURE__*/(0, _react.css)("display:flex;&:hover{", (0, _form.euiFormControlHoverStyles)(euiThemeContext), " box-shadow:none;.euiFormControlLayoutDelimited__input:not(:focus){outline:none;background-color:transparent;}};label:delimited;"),
36
29
  invalid: /*#__PURE__*/(0, _react.css)((0, _form.euiFormControlDefaultShadow)(euiThemeContext, {
37
30
  withBorder: false,
38
31
  withBackgroundColor: false
39
- }), "\n :not(.euiFormControlLayoutDelimited__input, .euiFormControlLayoutDelimited__delimiter) {\n ".concat((0, _form.euiFormControlInvalidStyles)(euiThemeContext), "\n }\n\n &:focus-within {\n --euiFormControlStateColor: ").concat(form.borderColor, ";\n --euiFormControlStateHoverColor: ").concat(form.borderHovered, ";\n }\n\n .euiFormControlLayoutDelimited__input {\n background-color: transparent;\n }\n "), ";label:invalid;"),
32
+ }), "\n :not(.euiFormControlLayoutDelimited__input, .euiFormControlLayoutDelimited__delimiter) {\n ".concat((0, _form.euiFormControlInvalidStyles)(euiThemeContext), "\n }\n\n &:focus-within {\n --euiFormControlStateColor: transparent;\n --euiFormControlStateHoverColor: transparent;\n }\n\n .euiFormControlLayoutDelimited__input {\n background-color: transparent;\n }\n "), ";label:invalid;"),
40
33
  readOnly: /*#__PURE__*/(0, _react.css)(";label:readOnly;")
41
34
  }
42
35
  };
@@ -3,6 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ var _exportNames = {
7
+ EuiFormControlLayout: true,
8
+ EuiFormControlLayoutDelimited: true,
9
+ EuiFormControlLayoutIcons: true
10
+ };
6
11
  Object.defineProperty(exports, "EuiFormControlLayout", {
7
12
  enumerable: true,
8
13
  get: function get() {
@@ -23,4 +28,16 @@ Object.defineProperty(exports, "EuiFormControlLayoutIcons", {
23
28
  });
24
29
  var _form_control_layout = require("./form_control_layout");
25
30
  var _form_control_layout_delimited = require("./form_control_layout_delimited");
26
- var _form_control_layout_icons = require("./form_control_layout_icons");
31
+ var _form_control_layout_icons = require("./form_control_layout_icons");
32
+ var _append_prepend = require("./append_prepend");
33
+ Object.keys(_append_prepend).forEach(function (key) {
34
+ if (key === "default" || key === "__esModule") return;
35
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
36
+ if (key in exports && exports[key] === _append_prepend[key]) return;
37
+ Object.defineProperty(exports, key, {
38
+ enumerable: true,
39
+ get: function get() {
40
+ return _append_prepend[key];
41
+ }
42
+ });
43
+ });