@elastic/eui 95.7.0 → 95.8.0-backport.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 (319) hide show
  1. package/dist/eui_theme_dark.css +0 -1163
  2. package/dist/eui_theme_dark.min.css +1 -1
  3. package/dist/eui_theme_light.css +0 -1163
  4. package/dist/eui_theme_light.min.css +1 -1
  5. package/es/components/combo_box/combo_box_input/combo_box_input.js +2 -1
  6. package/es/components/combo_box/combo_box_input/combo_box_input.styles.js +1 -5
  7. package/es/components/datagrid/controls/column_selector.js +1 -2
  8. package/es/components/datagrid/data_grid.a11y.js +2 -2
  9. package/es/components/date_picker/date_picker.js +11 -11
  10. package/es/components/date_picker/date_picker.styles.js +14 -2
  11. package/es/components/date_picker/date_picker_range.js +2 -1
  12. package/es/components/date_picker/date_picker_range.styles.js +17 -2
  13. package/es/components/date_picker/super_date_picker/super_date_picker.js +14 -2
  14. package/es/components/date_picker/super_date_picker/super_date_picker.styles.js +4 -4
  15. package/es/components/form/checkbox/checkbox.js +28 -25
  16. package/es/components/form/checkbox/checkbox.styles.js +62 -0
  17. package/es/components/form/described_form_group/described_form_group.js +17 -9
  18. package/es/components/form/described_form_group/described_form_group.styles.js +26 -0
  19. package/es/components/form/field_number/field_number.js +1 -0
  20. package/es/components/form/field_number/field_number.styles.js +2 -1
  21. package/es/components/form/field_password/field_password.js +6 -3
  22. package/es/components/form/field_search/field_search.js +39 -29
  23. package/es/components/form/field_text/field_text.js +1 -0
  24. package/es/components/form/form.js +7 -4
  25. package/es/components/form/form.styles.js +87 -39
  26. package/es/components/form/form_control_layout/_num_icons.js +7 -33
  27. package/es/components/form/form_control_layout/form_control_layout.js +67 -32
  28. package/es/components/form/form_control_layout/form_control_layout.styles.js +72 -0
  29. package/es/components/form/form_control_layout/form_control_layout_clear_button.js +20 -23
  30. package/es/components/form/form_control_layout/form_control_layout_clear_button.styles.js +22 -0
  31. package/es/components/form/form_control_layout/form_control_layout_custom_icon.js +30 -5
  32. package/es/components/form/form_control_layout/form_control_layout_delimited.js +37 -7
  33. package/es/components/form/form_control_layout/form_control_layout_delimited.styles.js +52 -0
  34. package/es/components/form/form_control_layout/form_control_layout_icons.js +33 -13
  35. package/es/components/form/form_control_layout/form_control_layout_icons.styles.js +54 -0
  36. package/es/components/form/form_error_text/form_error_text.js +4 -0
  37. package/es/components/form/form_error_text/form_error_text.styles.js +16 -0
  38. package/es/components/form/form_fieldset/form_legend.js +6 -2
  39. package/es/components/form/form_fieldset/form_legend.styles.js +20 -0
  40. package/es/components/form/form_help_text/form_help_text.js +4 -0
  41. package/es/components/form/form_help_text/form_help_text.styles.js +16 -0
  42. package/es/components/form/form_label/form_label.js +6 -0
  43. package/es/components/form/form_label/form_label.styles.js +38 -0
  44. package/es/components/form/form_row/form_row.js +156 -223
  45. package/es/components/form/form_row/form_row.styles.js +49 -0
  46. package/es/components/form/radio/radio.js +21 -14
  47. package/es/components/form/radio/radio.styles.js +34 -0
  48. package/es/components/form/range/range.styles.js +1 -1
  49. package/es/components/form/range/range_input.styles.js +1 -1
  50. package/es/components/form/range/range_slider.styles.js +1 -4
  51. package/es/components/form/range/range_thumb.styles.js +1 -4
  52. package/es/components/form/switch/switch.js +43 -24
  53. package/es/components/form/switch/switch.styles.js +226 -0
  54. package/es/components/form/text_area/text_area.js +1 -0
  55. package/es/components/form/text_area/text_area.styles.js +1 -1
  56. package/es/components/header/header_links/header_link.js +9 -13
  57. package/es/components/header/header_links/header_links.js +1 -1
  58. package/es/components/header/header_links/header_links.styles.js +1 -1
  59. package/es/services/emotion/clone_element.js +5 -3
  60. package/eui.d.ts +403 -112
  61. package/i18ntokens.json +48 -30
  62. package/lib/components/combo_box/combo_box_input/combo_box_input.js +2 -1
  63. package/lib/components/combo_box/combo_box_input/combo_box_input.styles.js +1 -5
  64. package/lib/components/datagrid/controls/column_selector.js +1 -2
  65. package/lib/components/datagrid/data_grid.a11y.js +2 -2
  66. package/lib/components/date_picker/date_picker.js +11 -11
  67. package/lib/components/date_picker/date_picker.styles.js +14 -2
  68. package/lib/components/date_picker/date_picker_range.js +2 -1
  69. package/lib/components/date_picker/date_picker_range.styles.js +17 -4
  70. package/lib/components/date_picker/super_date_picker/super_date_picker.js +14 -2
  71. package/lib/components/date_picker/super_date_picker/super_date_picker.styles.js +4 -4
  72. package/lib/components/form/checkbox/checkbox.js +27 -23
  73. package/lib/components/form/checkbox/checkbox.styles.js +66 -0
  74. package/lib/components/form/described_form_group/described_form_group.js +17 -9
  75. package/lib/components/form/described_form_group/described_form_group.styles.js +32 -0
  76. package/lib/components/form/field_number/field_number.js +1 -0
  77. package/lib/components/form/field_number/field_number.styles.js +2 -1
  78. package/lib/components/form/field_password/field_password.js +6 -3
  79. package/lib/components/form/field_search/field_search.js +39 -29
  80. package/lib/components/form/field_text/field_text.js +1 -0
  81. package/lib/components/form/form.js +6 -3
  82. package/lib/components/form/form.styles.js +88 -40
  83. package/lib/components/form/form_control_layout/_num_icons.js +8 -33
  84. package/lib/components/form/form_control_layout/form_control_layout.js +65 -31
  85. package/lib/components/form/form_control_layout/form_control_layout.styles.js +76 -0
  86. package/lib/components/form/form_control_layout/form_control_layout_clear_button.js +20 -23
  87. package/lib/components/form/form_control_layout/form_control_layout_clear_button.styles.js +28 -0
  88. package/lib/components/form/form_control_layout/form_control_layout_custom_icon.js +34 -11
  89. package/lib/components/form/form_control_layout/form_control_layout_delimited.js +36 -9
  90. package/lib/components/form/form_control_layout/form_control_layout_delimited.styles.js +56 -0
  91. package/lib/components/form/form_control_layout/form_control_layout_icons.js +33 -13
  92. package/lib/components/form/form_control_layout/form_control_layout_icons.styles.js +58 -0
  93. package/lib/components/form/form_error_text/form_error_text.js +4 -0
  94. package/lib/components/form/form_error_text/form_error_text.styles.js +22 -0
  95. package/lib/components/form/form_fieldset/form_legend.js +6 -2
  96. package/lib/components/form/form_fieldset/form_legend.styles.js +26 -0
  97. package/lib/components/form/form_help_text/form_help_text.js +4 -0
  98. package/lib/components/form/form_help_text/form_help_text.styles.js +22 -0
  99. package/lib/components/form/form_label/form_label.js +6 -0
  100. package/lib/components/form/form_label/form_label.styles.js +43 -0
  101. package/lib/components/form/form_row/form_row.js +161 -226
  102. package/lib/components/form/form_row/form_row.styles.js +55 -0
  103. package/lib/components/form/radio/radio.js +21 -14
  104. package/lib/components/form/radio/radio.styles.js +40 -0
  105. package/lib/components/form/range/range.styles.js +1 -1
  106. package/lib/components/form/range/range_input.styles.js +1 -1
  107. package/lib/components/form/range/range_slider.styles.js +1 -4
  108. package/lib/components/form/range/range_thumb.styles.js +1 -4
  109. package/lib/components/form/switch/switch.js +46 -26
  110. package/lib/components/form/switch/switch.styles.js +230 -0
  111. package/lib/components/form/text_area/text_area.js +1 -0
  112. package/lib/components/form/text_area/text_area.styles.js +1 -1
  113. package/lib/components/header/header_links/header_link.js +9 -13
  114. package/lib/components/header/header_links/header_links.js +1 -1
  115. package/lib/components/header/header_links/header_links.styles.js +1 -1
  116. package/lib/services/emotion/clone_element.js +5 -3
  117. package/optimize/es/components/combo_box/combo_box_input/combo_box_input.js +2 -1
  118. package/optimize/es/components/combo_box/combo_box_input/combo_box_input.styles.js +1 -5
  119. package/optimize/es/components/datagrid/controls/column_selector.js +1 -2
  120. package/optimize/es/components/datagrid/data_grid.a11y.js +2 -2
  121. package/optimize/es/components/date_picker/date_picker.js +6 -9
  122. package/optimize/es/components/date_picker/date_picker.styles.js +14 -2
  123. package/optimize/es/components/date_picker/date_picker_range.js +2 -1
  124. package/optimize/es/components/date_picker/date_picker_range.styles.js +17 -2
  125. package/optimize/es/components/date_picker/super_date_picker/super_date_picker.js +13 -2
  126. package/optimize/es/components/date_picker/super_date_picker/super_date_picker.styles.js +4 -4
  127. package/optimize/es/components/form/checkbox/checkbox.js +28 -25
  128. package/optimize/es/components/form/checkbox/checkbox.styles.js +62 -0
  129. package/optimize/es/components/form/described_form_group/described_form_group.js +17 -9
  130. package/optimize/es/components/form/described_form_group/described_form_group.styles.js +26 -0
  131. package/optimize/es/components/form/field_number/field_number.js +1 -0
  132. package/optimize/es/components/form/field_number/field_number.styles.js +2 -1
  133. package/optimize/es/components/form/field_password/field_password.js +6 -3
  134. package/optimize/es/components/form/field_search/field_search.js +39 -29
  135. package/optimize/es/components/form/field_text/field_text.js +1 -0
  136. package/optimize/es/components/form/form.js +7 -4
  137. package/optimize/es/components/form/form.styles.js +87 -39
  138. package/optimize/es/components/form/form_control_layout/_num_icons.js +7 -33
  139. package/optimize/es/components/form/form_control_layout/form_control_layout.js +44 -29
  140. package/optimize/es/components/form/form_control_layout/form_control_layout.styles.js +72 -0
  141. package/optimize/es/components/form/form_control_layout/form_control_layout_clear_button.js +19 -22
  142. package/optimize/es/components/form/form_control_layout/form_control_layout_clear_button.styles.js +22 -0
  143. package/optimize/es/components/form/form_control_layout/form_control_layout_custom_icon.js +29 -4
  144. package/optimize/es/components/form/form_control_layout/form_control_layout_delimited.js +34 -7
  145. package/optimize/es/components/form/form_control_layout/form_control_layout_delimited.styles.js +52 -0
  146. package/optimize/es/components/form/form_control_layout/form_control_layout_icons.js +25 -11
  147. package/optimize/es/components/form/form_control_layout/form_control_layout_icons.styles.js +54 -0
  148. package/optimize/es/components/form/form_error_text/form_error_text.js +4 -0
  149. package/optimize/es/components/form/form_error_text/form_error_text.styles.js +16 -0
  150. package/optimize/es/components/form/form_fieldset/form_legend.js +6 -2
  151. package/optimize/es/components/form/form_fieldset/form_legend.styles.js +20 -0
  152. package/optimize/es/components/form/form_help_text/form_help_text.js +4 -0
  153. package/optimize/es/components/form/form_help_text/form_help_text.styles.js +16 -0
  154. package/optimize/es/components/form/form_label/form_label.js +6 -0
  155. package/optimize/es/components/form/form_label/form_label.styles.js +37 -0
  156. package/optimize/es/components/form/form_row/form_row.js +135 -201
  157. package/optimize/es/components/form/form_row/form_row.styles.js +49 -0
  158. package/optimize/es/components/form/radio/radio.js +21 -14
  159. package/optimize/es/components/form/radio/radio.styles.js +34 -0
  160. package/optimize/es/components/form/range/range.styles.js +1 -1
  161. package/optimize/es/components/form/range/range_input.styles.js +1 -1
  162. package/optimize/es/components/form/range/range_slider.styles.js +1 -4
  163. package/optimize/es/components/form/range/range_thumb.styles.js +1 -4
  164. package/optimize/es/components/form/switch/switch.js +29 -23
  165. package/optimize/es/components/form/switch/switch.styles.js +226 -0
  166. package/optimize/es/components/form/text_area/text_area.js +1 -0
  167. package/optimize/es/components/form/text_area/text_area.styles.js +1 -1
  168. package/optimize/es/components/header/header_links/header_link.js +9 -10
  169. package/optimize/es/components/header/header_links/header_links.js +1 -1
  170. package/optimize/es/components/header/header_links/header_links.styles.js +1 -1
  171. package/optimize/es/services/emotion/clone_element.js +5 -3
  172. package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.js +2 -1
  173. package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.styles.js +1 -5
  174. package/optimize/lib/components/datagrid/controls/column_selector.js +1 -2
  175. package/optimize/lib/components/datagrid/data_grid.a11y.js +2 -2
  176. package/optimize/lib/components/date_picker/date_picker.js +6 -9
  177. package/optimize/lib/components/date_picker/date_picker.styles.js +14 -2
  178. package/optimize/lib/components/date_picker/date_picker_range.js +2 -1
  179. package/optimize/lib/components/date_picker/date_picker_range.styles.js +17 -4
  180. package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.js +13 -2
  181. package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.styles.js +4 -4
  182. package/optimize/lib/components/form/checkbox/checkbox.js +27 -23
  183. package/optimize/lib/components/form/checkbox/checkbox.styles.js +66 -0
  184. package/optimize/lib/components/form/described_form_group/described_form_group.js +17 -9
  185. package/optimize/lib/components/form/described_form_group/described_form_group.styles.js +32 -0
  186. package/optimize/lib/components/form/field_number/field_number.js +1 -0
  187. package/optimize/lib/components/form/field_number/field_number.styles.js +2 -1
  188. package/optimize/lib/components/form/field_password/field_password.js +6 -3
  189. package/optimize/lib/components/form/field_search/field_search.js +39 -29
  190. package/optimize/lib/components/form/field_text/field_text.js +1 -0
  191. package/optimize/lib/components/form/form.js +6 -3
  192. package/optimize/lib/components/form/form.styles.js +88 -40
  193. package/optimize/lib/components/form/form_control_layout/_num_icons.js +8 -33
  194. package/optimize/lib/components/form/form_control_layout/form_control_layout.js +43 -28
  195. package/optimize/lib/components/form/form_control_layout/form_control_layout.styles.js +76 -0
  196. package/optimize/lib/components/form/form_control_layout/form_control_layout_clear_button.js +19 -22
  197. package/optimize/lib/components/form/form_control_layout/form_control_layout_clear_button.styles.js +28 -0
  198. package/optimize/lib/components/form/form_control_layout/form_control_layout_custom_icon.js +29 -6
  199. package/optimize/lib/components/form/form_control_layout/form_control_layout_delimited.js +34 -10
  200. package/optimize/lib/components/form/form_control_layout/form_control_layout_delimited.styles.js +56 -0
  201. package/optimize/lib/components/form/form_control_layout/form_control_layout_icons.js +25 -11
  202. package/optimize/lib/components/form/form_control_layout/form_control_layout_icons.styles.js +58 -0
  203. package/optimize/lib/components/form/form_error_text/form_error_text.js +4 -0
  204. package/optimize/lib/components/form/form_error_text/form_error_text.styles.js +22 -0
  205. package/optimize/lib/components/form/form_fieldset/form_legend.js +6 -2
  206. package/optimize/lib/components/form/form_fieldset/form_legend.styles.js +26 -0
  207. package/optimize/lib/components/form/form_help_text/form_help_text.js +4 -0
  208. package/optimize/lib/components/form/form_help_text/form_help_text.styles.js +22 -0
  209. package/optimize/lib/components/form/form_label/form_label.js +6 -0
  210. package/optimize/lib/components/form/form_label/form_label.styles.js +43 -0
  211. package/optimize/lib/components/form/form_row/form_row.js +136 -201
  212. package/optimize/lib/components/form/form_row/form_row.styles.js +55 -0
  213. package/optimize/lib/components/form/radio/radio.js +21 -14
  214. package/optimize/lib/components/form/radio/radio.styles.js +40 -0
  215. package/optimize/lib/components/form/range/range.styles.js +1 -1
  216. package/optimize/lib/components/form/range/range_input.styles.js +1 -1
  217. package/optimize/lib/components/form/range/range_slider.styles.js +1 -4
  218. package/optimize/lib/components/form/range/range_thumb.styles.js +1 -4
  219. package/optimize/lib/components/form/switch/switch.js +32 -25
  220. package/optimize/lib/components/form/switch/switch.styles.js +230 -0
  221. package/optimize/lib/components/form/text_area/text_area.js +1 -0
  222. package/optimize/lib/components/form/text_area/text_area.styles.js +1 -1
  223. package/optimize/lib/components/header/header_links/header_link.js +9 -10
  224. package/optimize/lib/components/header/header_links/header_links.js +1 -1
  225. package/optimize/lib/components/header/header_links/header_links.styles.js +1 -1
  226. package/optimize/lib/services/emotion/clone_element.js +5 -3
  227. package/package.json +3 -2
  228. package/src/components/datagrid/controls/_data_grid_toolbar.scss +1 -1
  229. package/src/components/index.scss +0 -1
  230. package/src/global_styling/mixins/_form.scss +0 -99
  231. package/src/global_styling/mixins/_index.scss +0 -1
  232. package/src/global_styling/variables/_form.scss +0 -21
  233. package/src/themes/amsterdam/global_styling/mixins/_index.scss +0 -1
  234. package/src/themes/amsterdam/overrides/_index.scss +0 -3
  235. package/test-env/components/combo_box/combo_box_input/combo_box_input.js +2 -1
  236. package/test-env/components/combo_box/combo_box_input/combo_box_input.styles.js +1 -5
  237. package/test-env/components/datagrid/controls/column_selector.js +1 -2
  238. package/test-env/components/datagrid/data_grid.a11y.js +2 -2
  239. package/test-env/components/date_picker/date_picker.js +6 -9
  240. package/test-env/components/date_picker/date_picker.styles.js +14 -2
  241. package/test-env/components/date_picker/date_picker_range.js +2 -1
  242. package/test-env/components/date_picker/date_picker_range.styles.js +17 -4
  243. package/test-env/components/date_picker/super_date_picker/super_date_picker.js +13 -2
  244. package/test-env/components/date_picker/super_date_picker/super_date_picker.styles.js +4 -4
  245. package/test-env/components/form/checkbox/checkbox.js +27 -23
  246. package/test-env/components/form/checkbox/checkbox.styles.js +66 -0
  247. package/test-env/components/form/described_form_group/described_form_group.js +17 -9
  248. package/test-env/components/form/described_form_group/described_form_group.styles.js +32 -0
  249. package/test-env/components/form/field_number/field_number.js +1 -0
  250. package/test-env/components/form/field_number/field_number.styles.js +2 -1
  251. package/test-env/components/form/field_password/field_password.js +6 -3
  252. package/test-env/components/form/field_search/field_search.js +39 -29
  253. package/test-env/components/form/field_text/field_text.js +1 -0
  254. package/test-env/components/form/form.js +6 -3
  255. package/test-env/components/form/form.styles.js +88 -40
  256. package/test-env/components/form/form_control_layout/_num_icons.js +8 -33
  257. package/test-env/components/form/form_control_layout/form_control_layout.js +58 -31
  258. package/test-env/components/form/form_control_layout/form_control_layout.styles.js +76 -0
  259. package/test-env/components/form/form_control_layout/form_control_layout_clear_button.js +20 -23
  260. package/test-env/components/form/form_control_layout/form_control_layout_clear_button.styles.js +28 -0
  261. package/test-env/components/form/form_control_layout/form_control_layout_custom_icon.js +30 -7
  262. package/test-env/components/form/form_control_layout/form_control_layout_delimited.js +34 -10
  263. package/test-env/components/form/form_control_layout/form_control_layout_delimited.styles.js +56 -0
  264. package/test-env/components/form/form_control_layout/form_control_layout_icons.js +28 -13
  265. package/test-env/components/form/form_control_layout/form_control_layout_icons.styles.js +58 -0
  266. package/test-env/components/form/form_error_text/form_error_text.js +4 -0
  267. package/test-env/components/form/form_error_text/form_error_text.styles.js +22 -0
  268. package/test-env/components/form/form_fieldset/form_legend.js +6 -2
  269. package/test-env/components/form/form_fieldset/form_legend.styles.js +26 -0
  270. package/test-env/components/form/form_help_text/form_help_text.js +4 -0
  271. package/test-env/components/form/form_help_text/form_help_text.styles.js +22 -0
  272. package/test-env/components/form/form_label/form_label.js +6 -0
  273. package/test-env/components/form/form_label/form_label.styles.js +43 -0
  274. package/test-env/components/form/form_row/form_row.js +153 -216
  275. package/test-env/components/form/form_row/form_row.styles.js +55 -0
  276. package/test-env/components/form/radio/radio.js +21 -14
  277. package/test-env/components/form/radio/radio.styles.js +40 -0
  278. package/test-env/components/form/range/range.styles.js +1 -1
  279. package/test-env/components/form/range/range_input.styles.js +1 -1
  280. package/test-env/components/form/range/range_slider.styles.js +1 -4
  281. package/test-env/components/form/range/range_thumb.styles.js +1 -4
  282. package/test-env/components/form/switch/switch.js +41 -26
  283. package/test-env/components/form/switch/switch.styles.js +230 -0
  284. package/test-env/components/form/text_area/text_area.js +1 -0
  285. package/test-env/components/form/text_area/text_area.styles.js +1 -1
  286. package/test-env/components/header/header_links/header_link.js +9 -10
  287. package/test-env/components/header/header_links/header_links.js +1 -1
  288. package/test-env/components/header/header_links/header_links.styles.js +1 -1
  289. package/test-env/services/emotion/clone_element.js +5 -3
  290. package/src/components/form/_form.scss +0 -8
  291. package/src/components/form/_index.scss +0 -11
  292. package/src/components/form/checkbox/_checkbox.scss +0 -115
  293. package/src/components/form/checkbox/_index.scss +0 -1
  294. package/src/components/form/described_form_group/_described_form_group.scss +0 -34
  295. package/src/components/form/described_form_group/_index.scss +0 -1
  296. package/src/components/form/form_control_layout/_form_control_layout.scss +0 -203
  297. package/src/components/form/form_control_layout/_form_control_layout_clear_button.scss +0 -7
  298. package/src/components/form/form_control_layout/_form_control_layout_custom_icon.scss +0 -24
  299. package/src/components/form/form_control_layout/_form_control_layout_delimited.scss +0 -67
  300. package/src/components/form/form_control_layout/_form_control_layout_icons.scss +0 -54
  301. package/src/components/form/form_control_layout/_index.scss +0 -5
  302. package/src/components/form/form_error_text/_form_error_text.scss +0 -5
  303. package/src/components/form/form_error_text/_index.scss +0 -1
  304. package/src/components/form/form_fieldset/_form_legend.scss +0 -11
  305. package/src/components/form/form_fieldset/_index.scss +0 -1
  306. package/src/components/form/form_help_text/_form_help_text.scss +0 -5
  307. package/src/components/form/form_help_text/_index.scss +0 -1
  308. package/src/components/form/form_label/_form_label.scss +0 -25
  309. package/src/components/form/form_label/_index.scss +0 -1
  310. package/src/components/form/form_row/_form_row.scss +0 -102
  311. package/src/components/form/form_row/_index.scss +0 -1
  312. package/src/components/form/radio/_index.scss +0 -1
  313. package/src/components/form/radio/_radio.scss +0 -87
  314. package/src/components/form/switch/_index.scss +0 -1
  315. package/src/components/form/switch/_switch.scss +0 -212
  316. package/src/global_styling/mixins/_icons.scss +0 -17
  317. package/src/themes/amsterdam/overrides/_form_control_layout.scss +0 -112
  318. package/src/themes/amsterdam/overrides/_form_control_layout_delimited.scss +0 -42
  319. package/src/themes/amsterdam/overrides/_form_controls.scss +0 -19
@@ -61,6 +61,7 @@ export var EuiFieldText = function EuiFieldText(props) {
61
61
  fullWidth: fullWidth,
62
62
  isLoading: isLoading,
63
63
  isInvalid: isInvalid,
64
+ isDisabled: rest.disabled,
64
65
  compressed: compressed,
65
66
  readOnly: readOnly,
66
67
  prepend: prepend,
@@ -9,10 +9,11 @@ var _excluded = ["children", "className", "isInvalid", "error", "component", "in
9
9
  * Side Public License, v 1.
10
10
  */
11
11
 
12
- import React, { useCallback, forwardRef } from 'react';
12
+ import React, { useCallback, useMemo, forwardRef } from 'react';
13
13
  import classNames from 'classnames';
14
14
  import { EuiCallOut } from '../call_out';
15
15
  import { EuiI18n } from '../i18n';
16
+ import { EuiSpacer } from '../spacer';
16
17
  import { FormContext } from './eui_form_context';
17
18
  import { jsx as ___EmotionJSX } from "@emotion/react";
18
19
  export var EuiForm = /*#__PURE__*/forwardRef(function (_ref, ref) {
@@ -26,7 +27,7 @@ export var EuiForm = /*#__PURE__*/forwardRef(function (_ref, ref) {
26
27
  invalidCallout = _ref$invalidCallout === void 0 ? 'above' : _ref$invalidCallout,
27
28
  fullWidth = _ref.fullWidth,
28
29
  rest = _objectWithoutProperties(_ref, _excluded);
29
- var formContext = React.useMemo(function () {
30
+ var formContext = useMemo(function () {
30
31
  return {
31
32
  defaultFullWidth: fullWidth !== null && fullWidth !== void 0 ? fullWidth : false
32
33
  };
@@ -51,7 +52,7 @@ export var EuiForm = /*#__PURE__*/forwardRef(function (_ref, ref) {
51
52
  token: "euiForm.addressFormErrors",
52
53
  default: "Please address the highlighted errors."
53
54
  }, function (addressFormErrors) {
54
- return ___EmotionJSX(EuiCallOut, {
55
+ return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiCallOut, {
55
56
  tabIndex: -1,
56
57
  ref: handleFocus,
57
58
  className: "euiForm__errors",
@@ -59,7 +60,9 @@ export var EuiForm = /*#__PURE__*/forwardRef(function (_ref, ref) {
59
60
  color: "danger",
60
61
  role: "alert",
61
62
  "aria-live": "assertive"
62
- }, optionalErrors);
63
+ }, optionalErrors), ___EmotionJSX(EuiSpacer, {
64
+ size: "m"
65
+ }));
63
66
  });
64
67
  }
65
68
  var Element = component;
@@ -53,14 +53,7 @@ export var euiFormVariables = function euiFormVariables(euiThemeContext) {
53
53
  controlDisabledColor: euiTheme.colors.mediumShade,
54
54
  controlBoxShadow: '0 0 transparent',
55
55
  controlPlaceholderText: makeHighContrastColor(euiTheme.colors.subduedText)(backgroundColor),
56
- inputGroupLabelBackground: isColorDark ? shade(euiTheme.colors.lightShade, 0.15) : tint(euiTheme.colors.lightShade, 0.5),
57
- inputGroupBorder: 'none'
58
- };
59
-
60
- // Colors - specific to checkboxes, radios, switches, and range thumbs
61
- var customControlColors = {
62
- customControlDisabledIconColor: isColorDark ? shade(euiTheme.colors.mediumShade, 0.38) : tint(euiTheme.colors.mediumShade, 0.485),
63
- customControlBorderColor: isColorDark ? shade(euiTheme.colors.lightestShade, 0.4) : tint(euiTheme.colors.lightestShade, 0.31)
56
+ appendPrependBackground: isColorDark ? shade(euiTheme.colors.lightShade, 0.15) : tint(euiTheme.colors.lightShade, 0.5)
64
57
  };
65
58
  var controlLayout = {
66
59
  controlLayoutGroupInputHeight: mathWithUnits(controlHeight, function (x) {
@@ -80,7 +73,7 @@ export var euiFormVariables = function euiFormVariables(euiThemeContext) {
80
73
  xxl: euiTheme.size.xxl
81
74
  }
82
75
  };
83
- return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, sizes), colors), customControlColors), iconSizes), controlLayout), {}, {
76
+ return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, sizes), colors), iconSizes), controlLayout), {}, {
84
77
  animationTiming: "".concat(euiTheme.animation.fast, " ease-in")
85
78
  });
86
79
  };
@@ -104,29 +97,6 @@ export var euiFormControlStyles = function euiFormControlStyles(euiThemeContext)
104
97
  autoFill: euiFormControlAutoFillStyles(euiThemeContext)
105
98
  };
106
99
  };
107
- export var euiCustomControl = function euiCustomControl(euiThemeContext) {
108
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
109
- var euiTheme = euiThemeContext.euiTheme;
110
- var form = euiFormVariables(euiThemeContext);
111
- var type = options.type,
112
- _options$size = options.size,
113
- size = _options$size === void 0 ? euiTheme.size.base : _options$size;
114
- var padddingStyle = '';
115
- var borderRadiusStyle = '';
116
- if (size) {
117
- var borderSize = parseFloat(String(euiTheme.border.width.thin));
118
- var paddingSize = mathWithUnits(size, function (x) {
119
- return (x - borderSize * 2) / 2;
120
- });
121
- padddingStyle = "padding: ".concat(paddingSize, ";");
122
- }
123
- if (type === 'round') {
124
- borderRadiusStyle = "border-radius: ".concat(size, ";");
125
- } else if (type === 'square') {
126
- borderRadiusStyle = "border-radius: ".concat(form.controlCompressedBorderRadius, ";");
127
- }
128
- return "\n ".concat(padddingStyle, "\n ").concat(borderRadiusStyle, "\n border: ").concat(euiTheme.border.width.thin, " solid ").concat(form.customControlBorderColor, ";\n background: ").concat(euiTheme.colors.emptyShade, " no-repeat center;\n\n ").concat(euiCanAnimate, " {\n transition: background-color ").concat(form.animationTiming, ",\n border-color ").concat(form.animationTiming, ";\n }\n ");
129
- };
130
100
  export var euiFormControlText = function euiFormControlText(euiThemeContext) {
131
101
  var euiTheme = euiThemeContext.euiTheme;
132
102
  var _euiFontSize = euiFontSize(euiThemeContext, 's'),
@@ -135,22 +105,37 @@ export var euiFormControlText = function euiFormControlText(euiThemeContext) {
135
105
  return "\n font-family: ".concat(euiTheme.font.family, ";\n font-size: ").concat(fontSize, ";\n color: ").concat(form.textColor, ";\n\n ").concat(euiPlaceholderPerBrowser("\n color: ".concat(form.controlPlaceholderText, ";\n opacity: 1;\n ")), "\n ");
136
106
  };
137
107
  export var euiFormControlDefaultShadow = function euiFormControlDefaultShadow(euiThemeContext) {
108
+ var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
109
+ _ref2$withBorder = _ref2.withBorder,
110
+ withBorder = _ref2$withBorder === void 0 ? true : _ref2$withBorder,
111
+ _ref2$withBackground = _ref2.withBackground,
112
+ withBackground = _ref2$withBackground === void 0 ? true : _ref2$withBackground,
113
+ _ref2$withBackgroundC = _ref2.withBackgroundColor,
114
+ withBackgroundColor = _ref2$withBackgroundC === void 0 ? withBackground : _ref2$withBackgroundC,
115
+ _ref2$withBackgroundA = _ref2.withBackgroundAnimation,
116
+ withBackgroundAnimation = _ref2$withBackgroundA === void 0 ? withBackground : _ref2$withBackgroundA;
138
117
  var euiTheme = euiThemeContext.euiTheme;
139
118
  var form = euiFormVariables(euiThemeContext);
140
- return "\n /* We use inset box-shadow instead of border to skip extra hight calculations */\n border: none;\n box-shadow: inset 0 0 0 ".concat(euiTheme.border.width.thin, " ").concat(form.borderColor, ";\n background-color: ").concat(form.backgroundColor, ";\n\n background-repeat: no-repeat;\n background-size: 0% 100%;\n background-image: linear-gradient(to top,\n var(--euiFormControlStateColor),\n var(--euiFormControlStateColor) ").concat(euiTheme.border.width.thick, ",\n transparent ").concat(euiTheme.border.width.thick, ",\n transparent 100%\n );\n\n ").concat(euiCanAnimate, " {\n transition:\n box-shadow ").concat(form.animationTiming, ",\n background-image ").concat(form.animationTiming, ",\n background-size ").concat(form.animationTiming, ",\n background-color ").concat(form.animationTiming, ";\n }\n ");
119
+
120
+ // We use inset box-shadow instead of border to skip extra height calculations
121
+ var border = "\n border: none;\n box-shadow: inset 0 0 0 ".concat(euiTheme.border.width.thin, " ").concat(form.borderColor, ";\n ").trim();
122
+ var backgroundColor = "\n background-color: ".concat(form.backgroundColor, ";\n ").trim();
123
+ var backgroundGradient = "\n background-repeat: no-repeat;\n background-size: 0% 100%;\n background-image: linear-gradient(to top,\n var(--euiFormControlStateColor),\n var(--euiFormControlStateColor) ".concat(euiTheme.border.width.thick, ",\n transparent ").concat(euiTheme.border.width.thick, ",\n transparent 100%\n );\n ").trim();
124
+ var backgroundAnimation = "\n ".concat(euiCanAnimate, " {\n transition:\n background-image ").concat(form.animationTiming, ",\n background-size ").concat(form.animationTiming, ",\n background-color ").concat(form.animationTiming, ";\n }\n ").trim();
125
+ return "\n ".concat(withBorder ? border : '', "\n ").concat(withBackgroundColor ? backgroundColor : '', "\n ").concat(withBackground ? backgroundGradient : '', "\n ").concat(withBackgroundAnimation ? backgroundAnimation : '', "\n ");
141
126
  };
142
- export var euiFormControlFocusStyles = function euiFormControlFocusStyles(_ref2) {
143
- var euiTheme = _ref2.euiTheme,
144
- colorMode = _ref2.colorMode;
127
+ export var euiFormControlFocusStyles = function euiFormControlFocusStyles(_ref3) {
128
+ var euiTheme = _ref3.euiTheme,
129
+ colorMode = _ref3.colorMode;
145
130
  return "\n --euiFormControlStateColor: ".concat(euiTheme.colors.primary, ";\n background-color: ").concat(colorMode === 'DARK' ? shade(euiTheme.colors.emptyShade, 0.4) : euiTheme.colors.emptyShade, ";\n background-size: 100% 100%;\n outline: none; /* Remove all outlines and rely on our own bottom border gradient */\n");
146
131
  };
147
- export var euiFormControlInvalidStyles = function euiFormControlInvalidStyles(_ref3) {
148
- var euiTheme = _ref3.euiTheme;
132
+ export var euiFormControlInvalidStyles = function euiFormControlInvalidStyles(_ref4) {
133
+ var euiTheme = _ref4.euiTheme;
149
134
  return "\n --euiFormControlStateColor: ".concat(euiTheme.colors.danger, ";\n background-size: 100% 100%;\n");
150
135
  };
151
136
  export var euiFormControlDisabledStyles = function euiFormControlDisabledStyles(euiThemeContext) {
152
137
  var form = euiFormVariables(euiThemeContext);
153
- return "\n color: ".concat(form.controlDisabledColor, ";\n /* Required for Safari */\n -webkit-text-fill-color: ").concat(form.controlDisabledColor, ";\n background-color: ").concat(form.backgroundDisabledColor, ";\n cursor: not-allowed;\n\n ").concat(euiPlaceholderPerBrowser("\n color: ".concat(form.controlDisabledColor, ";\n opacity: 1;\n ")), "\n ");
138
+ return "\n color: ".concat(form.controlDisabledColor, ";\n /* Required for Safari */\n -webkit-text-fill-color: ").concat(form.controlDisabledColor, ";\n background-color: ").concat(form.backgroundDisabledColor, ";\n cursor: not-allowed;\n --euiFormControlStateColor: transparent;\n\n ").concat(euiPlaceholderPerBrowser("\n color: ".concat(form.controlDisabledColor, ";\n opacity: 1;\n ")), "\n ");
154
139
  };
155
140
  export var euiFormControlReadOnlyStyles = function euiFormControlReadOnlyStyles(euiThemeContext) {
156
141
  var form = euiFormVariables(euiThemeContext);
@@ -182,4 +167,67 @@ export var euiFormControlAutoFillStyles = function euiFormControlAutoFillStyles(
182
167
  };
183
168
  var euiPlaceholderPerBrowser = function euiPlaceholderPerBrowser(content) {
184
169
  return "\n &::-webkit-input-placeholder { ".concat(content, " }\n &::-moz-placeholder { ").concat(content, " }\n &:-ms-input-placeholder { ").concat(content, " }\n &:-moz-placeholder { ").concat(content, " }\n &::placeholder { ").concat(content, " }\n");
170
+ };
171
+
172
+ /**
173
+ * Selection custom controls - checkboxes, radios, and switches
174
+ */
175
+
176
+ export var euiFormCustomControlVariables = function euiFormCustomControlVariables(euiThemeContext) {
177
+ var euiTheme = euiThemeContext.euiTheme,
178
+ colorMode = euiThemeContext.colorMode;
179
+ var sizes = {
180
+ control: euiTheme.size.base,
181
+ lineHeight: euiTheme.size.l,
182
+ labelGap: euiTheme.size.s
183
+ };
184
+ var colors = {
185
+ unselected: euiTheme.colors.emptyShade,
186
+ unselectedBorder: colorMode === 'DARK' ? tint(euiTheme.colors.lightestShade, 0.31) // WCAG AA requirements
187
+ : shade(euiTheme.colors.lightestShade, 0.4),
188
+ selected: euiTheme.colors.primary,
189
+ selectedIcon: euiTheme.colors.emptyShade,
190
+ disabled: euiTheme.colors.lightShade,
191
+ disabledIcon: euiTheme.colors.darkShade,
192
+ disabledLabel: euiTheme.colors.disabledText // Lighter than formVars.disabledColor because it typically doesn't have as dark a background
193
+ };
194
+ var animation = {
195
+ speed: euiTheme.animation.fast,
196
+ easing: 'ease-in'
197
+ };
198
+ return {
199
+ sizes: sizes,
200
+ colors: colors,
201
+ animation: animation
202
+ };
203
+ };
204
+ export var euiFormCustomControlStyles = function euiFormCustomControlStyles(euiThemeContext) {
205
+ var euiTheme = euiThemeContext.euiTheme;
206
+ var controlVars = euiFormCustomControlVariables(euiThemeContext);
207
+ var centerWithLabel = mathWithUnits([controlVars.sizes.lineHeight, controlVars.sizes.control], function (x, y) {
208
+ return (x - y) / 2;
209
+ });
210
+ return {
211
+ wrapper: "\n display: flex;\n align-items: flex-start;\n ",
212
+ input: {
213
+ fauxInput: "\n position: relative;\n ".concat(logicalCSS('height', controlVars.sizes.control), "\n ").concat(logicalCSS('width', controlVars.sizes.control), "\n display: flex;\n justify-content: center;\n align-items: center;\n\n &:has(+ label) {\n ").concat(logicalCSS('margin-top', centerWithLabel), "\n }\n\n &:has(input:focus-visible) {\n outline: ").concat(euiTheme.focus.width, " solid ").concat(controlVars.colors.selected, ";\n outline-offset: ").concat(euiTheme.focus.width, ";\n }\n\n ").concat(euiCanAnimate, " {\n transition-property: background-color, color;\n transition-duration: ").concat(controlVars.animation.speed, ";\n transition-timing-function: ").concat(controlVars.animation.easing, ";\n }\n "),
214
+ enabled: {
215
+ selected: "\n color: ".concat(controlVars.colors.selectedIcon, ";\n background-color: ").concat(controlVars.colors.selected, ";\n "),
216
+ unselected: "\n color: transparent;\n background-color: ".concat(controlVars.colors.unselected, ";\n border: ").concat(euiTheme.border.width.thin, " solid ").concat(controlVars.colors.unselectedBorder, ";\n\n &:has(input:focus) {\n border-color: ").concat(controlVars.colors.selected, ";\n }\n ")
217
+ },
218
+ disabled: {
219
+ selected: "\n label: disabled;\n color: ".concat(controlVars.colors.disabledIcon, ";\n background-color: ").concat(controlVars.colors.disabled, ";\n "),
220
+ unselected: "\n label: disabled;\n color: ".concat(controlVars.colors.disabled, ";\n background-color: ").concat(controlVars.colors.disabled, ";\n cursor: not-allowed;\n ")
221
+ },
222
+ // Looks better centered at different zoom levels than just <EuiIcon size="s" />
223
+ icon: "\n transform: scale(0.75);\n ",
224
+ // Hidden input sits on top of the visible element
225
+ hiddenInput: "\n position: absolute;\n inset: 0;\n opacity: 0 !important;\n cursor: pointer;\n\n &:disabled {\n cursor: not-allowed;\n }\n "
226
+ },
227
+ label: {
228
+ label: "\n /* Needs to use padding and not flex gap for extra mouse click area */\n ".concat(logicalCSS('padding-left', controlVars.sizes.labelGap), "\n line-height: ").concat(controlVars.sizes.lineHeight, ";\n font-size: ").concat(euiFontSize(euiThemeContext, 's').fontSize, ";\n "),
229
+ enabled: "\n cursor: pointer;\n ",
230
+ disabled: "\n cursor: not-allowed;\n color: ".concat(controlVars.colors.disabledLabel, ";\n ")
231
+ }
232
+ };
185
233
  };
@@ -8,41 +8,15 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
8
8
  */
9
9
 
10
10
  import { isIconShape } from './form_control_layout_icons';
11
-
12
- /**
13
- * The `getFormControlClassNameForIconCount` function helps setup the className appendum
14
- * depending on the form control's current settings/state.
15
- *
16
- * @param icon {boolean} Does it contain a static icon like arrowDown
17
- * @param clear {boolean} Is it currently clearable
18
- * @param isLoading {boolean} Is is currently loading
19
- * @param isInvalid {boolean} It is currently invalid
20
- * @param isDropdown {boolean} It is as dropdown
21
- * @returns {string | undefined} Returns the string to append to the base className of the form control; or `undefined` if all evaluate to false
22
- */
23
-
24
- export var getFormControlClassNameForIconCount = function getFormControlClassNameForIconCount(_ref) {
11
+ export var isRightSideIcon = function isRightSideIcon(icon) {
12
+ return !!icon && isIconShape(icon) && icon.side === 'right';
13
+ };
14
+ export var getIconAffordanceStyles = function getIconAffordanceStyles(_ref) {
25
15
  var icon = _ref.icon,
26
16
  clear = _ref.clear,
27
17
  isLoading = _ref.isLoading,
28
18
  isInvalid = _ref.isInvalid,
29
19
  isDropdown = _ref.isDropdown;
30
- var numIcons = [icon, clear, isInvalid, isLoading, isDropdown].filter(function (item) {
31
- return item === true;
32
- }).length;
33
-
34
- // This className is also specifically used in `src/global_styling/mixins/_form.scss`
35
- return numIcons > 0 ? "euiFormControlLayout--".concat(numIcons, "icons") : undefined;
36
- };
37
- export var isRightSideIcon = function isRightSideIcon(icon) {
38
- return !!icon && isIconShape(icon) && icon.side === 'right';
39
- };
40
- export var getIconAffordanceStyles = function getIconAffordanceStyles(_ref2) {
41
- var icon = _ref2.icon,
42
- clear = _ref2.clear,
43
- isLoading = _ref2.isLoading,
44
- isInvalid = _ref2.isInvalid,
45
- isDropdown = _ref2.isDropdown;
46
20
  var cssVariables = {
47
21
  '--euiFormControlLeftIconsCount': 0,
48
22
  '--euiFormControlRightIconsCount': 0
@@ -58,9 +32,9 @@ export var getIconAffordanceStyles = function getIconAffordanceStyles(_ref2) {
58
32
  if (isLoading) cssVariables['--euiFormControlRightIconsCount']++;
59
33
  if (isInvalid) cssVariables['--euiFormControlRightIconsCount']++;
60
34
  if (isDropdown) cssVariables['--euiFormControlRightIconsCount']++;
61
- var filtered = Object.entries(cssVariables).filter(function (_ref3) {
62
- var _ref4 = _slicedToArray(_ref3, 2),
63
- count = _ref4[1];
35
+ var filtered = Object.entries(cssVariables).filter(function (_ref2) {
36
+ var _ref3 = _slicedToArray(_ref2, 2),
37
+ count = _ref3[1];
64
38
  return count > 0;
65
39
  });
66
40
  return filtered.length ? Object.fromEntries(filtered) : undefined;
@@ -1,6 +1,10 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
4
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["inputId", "className", "children", "icon", "iconsPosition", "clear", "isDropdown", "isLoading", "isInvalid", "isDisabled", "readOnly", "compressed", "prepend", "append", "fullWidth"];
5
+ var _excluded = ["inputId", "className", "children", "icon", "iconsPosition", "clear", "isDropdown", "isLoading", "isInvalid", "isDisabled", "readOnly", "compressed", "prepend", "append", "isDelimited", "wrapperProps", "fullWidth"];
6
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
7
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
8
  /*
5
9
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
6
10
  * or more contributor license agreements. Licensed under the Elastic License
@@ -9,12 +13,14 @@ var _excluded = ["inputId", "className", "children", "icon", "iconsPosition", "c
9
13
  * Side Public License, v 1.
10
14
  */
11
15
 
12
- import React, { cloneElement, useCallback, useMemo } from 'react';
16
+ import React, { useMemo } from 'react';
13
17
  import classNames from 'classnames';
14
- import { getIconAffordanceStyles, isRightSideIcon } from './_num_icons';
15
- import { EuiFormControlLayoutIcons } from './form_control_layout_icons';
18
+ import { useEuiMemoizedStyles } from '../../../services';
16
19
  import { EuiFormLabel } from '../form_label';
17
20
  import { useFormContext } from '../eui_form_context';
21
+ import { getIconAffordanceStyles, isRightSideIcon } from './_num_icons';
22
+ import { EuiFormControlLayoutIcons } from './form_control_layout_icons';
23
+ import { euiFormControlLayoutStyles, euiFormControlLayoutSideNodeStyles } from './form_control_layout.styles';
18
24
  import { jsx as ___EmotionJSX } from "@emotion/react";
19
25
  export var EuiFormControlLayout = function EuiFormControlLayout(props) {
20
26
  var _useFormContext = useFormContext(),
@@ -34,16 +40,20 @@ export var EuiFormControlLayout = function EuiFormControlLayout(props) {
34
40
  compressed = props.compressed,
35
41
  prepend = props.prepend,
36
42
  append = props.append,
43
+ isDelimited = props.isDelimited,
44
+ wrapperProps = props.wrapperProps,
37
45
  _props$fullWidth = props.fullWidth,
38
46
  fullWidth = _props$fullWidth === void 0 ? defaultFullWidth : _props$fullWidth,
39
47
  rest = _objectWithoutProperties(props, _excluded);
48
+ var isGroup = !!(prepend || append || isDelimited);
40
49
  var classes = classNames('euiFormControlLayout', {
41
- 'euiFormControlLayout--fullWidth': fullWidth,
42
- 'euiFormControlLayout--compressed': compressed,
43
- 'euiFormControlLayout--readOnly': readOnly,
44
- 'euiFormControlLayout--group': prepend || append,
45
- 'euiFormControlLayout-isDisabled': isDisabled
50
+ 'euiFormControlLayout--group': isGroup && !isDelimited,
51
+ 'euiFormControlLayout-isDisabled': isDisabled,
52
+ 'euiFormControlLayout-readOnly': readOnly
46
53
  }, className);
54
+ var styles = useEuiMemoizedStyles(euiFormControlLayoutStyles);
55
+ var cssStyles = [styles.euiFormControlLayout, compressed ? styles.compressed : styles.uncompressed, fullWidth ? styles.fullWidth : styles.formWidth].concat(_toConsumableArray(isGroup ? [styles.group.group, compressed ? styles.group.compressed : styles.group.uncompressed] : []));
56
+ 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];
47
57
  var hasDropdownIcon = !readOnly && !isDisabled && isDropdown;
48
58
  var hasRightIcon = isRightSideIcon(icon);
49
59
  var hasLeftIcon = icon && !hasRightIcon;
@@ -60,19 +70,23 @@ export var EuiFormControlLayout = function EuiFormControlLayout(props) {
60
70
  });
61
71
  }, [iconsPosition, icon, clear, isInvalid, isLoading, hasDropdownIcon]);
62
72
  return ___EmotionJSX("div", _extends({
73
+ css: cssStyles,
63
74
  className: classes
64
75
  }, rest), ___EmotionJSX(EuiFormControlLayoutSideNodes, {
65
76
  side: "prepend",
66
77
  nodes: prepend,
67
- inputId: inputId
68
- }), ___EmotionJSX("div", {
69
- className: "euiFormControlLayout__childrenWrapper",
70
- style: iconAffordanceStyles
71
- }, hasLeftIcon && ___EmotionJSX(EuiFormControlLayoutIcons, {
78
+ inputId: inputId,
79
+ compressed: compressed
80
+ }), ___EmotionJSX("div", _extends({}, wrapperProps, {
81
+ css: childrenWrapperStyles,
82
+ className: classNames('euiFormControlLayout__childrenWrapper', wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.className),
83
+ style: _objectSpread(_objectSpread({}, iconAffordanceStyles), wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.style)
84
+ }), hasLeftIcon && ___EmotionJSX(EuiFormControlLayoutIcons, {
72
85
  side: "left",
73
86
  icon: icon,
74
87
  iconsPosition: iconsPosition,
75
- compressed: compressed
88
+ compressed: compressed,
89
+ isDisabled: isDisabled
76
90
  }), children, hasRightIcons && ___EmotionJSX(EuiFormControlLayoutIcons, {
77
91
  side: "right",
78
92
  icon: hasRightIcon ? icon : undefined,
@@ -81,11 +95,13 @@ export var EuiFormControlLayout = function EuiFormControlLayout(props) {
81
95
  clear: clear,
82
96
  isLoading: isLoading,
83
97
  isInvalid: isInvalid,
84
- isDropdown: hasDropdownIcon
98
+ isDropdown: hasDropdownIcon,
99
+ isDisabled: isDisabled
85
100
  })), ___EmotionJSX(EuiFormControlLayoutSideNodes, {
86
101
  side: "append",
87
102
  nodes: append,
88
- inputId: inputId
103
+ inputId: inputId,
104
+ compressed: compressed
89
105
  }));
90
106
  };
91
107
 
@@ -95,19 +111,18 @@ export var EuiFormControlLayout = function EuiFormControlLayout(props) {
95
111
  var EuiFormControlLayoutSideNodes = function EuiFormControlLayoutSideNodes(_ref) {
96
112
  var side = _ref.side,
97
113
  nodes = _ref.nodes,
98
- inputId = _ref.inputId;
114
+ inputId = _ref.inputId,
115
+ compressed = _ref.compressed;
99
116
  var className = "euiFormControlLayout__".concat(side);
100
- var renderFormLabel = useCallback(function (label) {
101
- return ___EmotionJSX(EuiFormLabel, {
102
- htmlFor: inputId,
103
- className: className
104
- }, label);
105
- }, [inputId, className]);
117
+ var styles = useEuiMemoizedStyles(euiFormControlLayoutSideNodeStyles);
118
+ var cssStyles = [styles.euiFormControlLayout__side, styles[side], compressed ? styles.compressed : styles.uncompressed];
106
119
  if (!nodes) return null;
107
- return ___EmotionJSX(React.Fragment, null, React.Children.map(nodes, function (node, index) {
108
- return typeof node === 'string' ? renderFormLabel(node) : /*#__PURE__*/cloneElement(node, {
109
- className: classNames(className, node.props.className),
110
- key: index
111
- });
120
+ return ___EmotionJSX("div", {
121
+ css: cssStyles,
122
+ className: className
123
+ }, React.Children.map(nodes, function (node) {
124
+ return typeof node === 'string' ? ___EmotionJSX(EuiFormLabel, {
125
+ htmlFor: inputId
126
+ }, node) : node;
112
127
  }));
113
128
  };
@@ -0,0 +1,72 @@
1
+ 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)."; }
2
+ /*
3
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
4
+ * or more contributor license agreements. Licensed under the Elastic License
5
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
6
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
7
+ * Side Public License, v 1.
8
+ */
9
+
10
+ import { css } from '@emotion/react';
11
+ import { euiTextTruncate, logicalCSS, mathWithUnits } from '../../../global_styling';
12
+ import { euiFormVariables } from '../form.styles';
13
+ var _ref = process.env.NODE_ENV === "production" ? {
14
+ name: "1w10n1m-inGroup",
15
+ styles: "flex-grow:1;overflow:hidden;label:inGroup;"
16
+ } : {
17
+ name: "1w10n1m-inGroup",
18
+ styles: "flex-grow:1;overflow:hidden;label:inGroup;",
19
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
20
+ };
21
+ var _ref2 = process.env.NODE_ENV === "production" ? {
22
+ name: "1lbfa6m-euiFormControlLayout__childrenWrapper",
23
+ styles: "position:relative;label:euiFormControlLayout__childrenWrapper;"
24
+ } : {
25
+ name: "1lbfa6m-euiFormControlLayout__childrenWrapper",
26
+ styles: "position:relative;label:euiFormControlLayout__childrenWrapper;",
27
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
28
+ };
29
+ export var euiFormControlLayoutStyles = function euiFormControlLayoutStyles(euiThemeContext) {
30
+ var euiTheme = euiThemeContext.euiTheme;
31
+ var form = euiFormVariables(euiThemeContext);
32
+ return {
33
+ euiFormControlLayout: /*#__PURE__*/css(";label:euiFormControlLayout;"),
34
+ // Skip the css`` on the default height to avoid generating a className
35
+ uncompressed: "\n ".concat(logicalCSS('height', form.controlHeight), "\n "),
36
+ compressed: /*#__PURE__*/css(logicalCSS('height', form.controlCompressedHeight), ";;label:compressed;"),
37
+ // Skip the css`` on the default width to avoid generating a className
38
+ formWidth: "\n ".concat(logicalCSS('max-width', form.maxWidth), "\n ").concat(logicalCSS('width', '100%'), "\n "),
39
+ fullWidth: /*#__PURE__*/css(logicalCSS('max-width', '100%'), " ", logicalCSS('width', '100%'), ";;label:fullWidth;"),
40
+ group: {
41
+ group: /*#__PURE__*/css("display:flex;align-items:stretch;border:", euiTheme.border.width.thin, " solid ", form.borderColor, ";background-color:", form.backgroundColor, ";overflow:hidden;>*{", logicalCSS('height', '100%'), ";};label:group;"),
42
+ // Skipping css`` to avoid repeated compressed/uncompressed classNames
43
+ uncompressed: "\n border-radius: ".concat(form.controlBorderRadius, ";\n "),
44
+ compressed: "\n border-radius: ".concat(form.controlCompressedBorderRadius, ";\n ")
45
+ },
46
+ children: {
47
+ euiFormControlLayout__childrenWrapper: _ref2,
48
+ inGroup: _ref,
49
+ prependOnly: /*#__PURE__*/css(logicalCSS('border-top-right-radius', 'inherit'), " ", logicalCSS('border-bottom-right-radius', 'inherit'), ";;label:prependOnly;"),
50
+ appendOnly: /*#__PURE__*/css(logicalCSS('border-top-left-radius', 'inherit'), " ", logicalCSS('border-bottom-left-radius', 'inherit'), ";;label:appendOnly;")
51
+ }
52
+ };
53
+ };
54
+ export var euiFormControlLayoutSideNodeStyles = function euiFormControlLayoutSideNodeStyles(euiThemeContext) {
55
+ var euiTheme = euiThemeContext.euiTheme;
56
+ var form = euiFormVariables(euiThemeContext);
57
+ var uncompressedHeight = mathWithUnits([form.controlHeight, euiTheme.border.width.thin], function (x, y) {
58
+ return x - y * 2;
59
+ });
60
+ var compressedHeight = mathWithUnits([form.controlCompressedHeight, euiTheme.border.width.thin], function (x, y) {
61
+ return x - y * 2;
62
+ });
63
+ var buttons = '*:is(.euiButton, .euiButtonEmpty, .euiButtonIcon)';
64
+ var text = '*:is(.euiFormLabel, .euiText)';
65
+ return {
66
+ euiFormControlLayout__side: /*#__PURE__*/css(logicalCSS('height', '100%'), " ", 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, ")){", logicalCSS('padding-left', euiTheme.size.s), ";}&:not(:has(> ", buttons, ":last-child, > *:last-child > ", buttons, ")){", logicalCSS('padding-right', euiTheme.size.s), ";};label:euiFormControlLayout__side;"),
67
+ append: /*#__PURE__*/css(";label:append;"),
68
+ prepend: /*#__PURE__*/css(";label:prepend;"),
69
+ uncompressed: "\n ".concat(text, " {\n ").concat(logicalCSS('padding-horizontal', euiTheme.size.xs), "\n line-height: ").concat(uncompressedHeight, ";\n }\n\n ").concat(buttons, " {\n ").concat(logicalCSS('height', uncompressedHeight), "\n }\n\n .euiButtonIcon {\n flex-shrink: 0;\n ").concat(logicalCSS('width', euiTheme.size.xl), "\n }\n "),
70
+ compressed: /*#__PURE__*/css(text, "{", logicalCSS('padding-horizontal', euiTheme.size.xxs), " line-height:", compressedHeight, ";}", buttons, "{", logicalCSS('height', compressedHeight), ";}.euiButtonIcon{flex-shrink:0;", logicalCSS('width', euiTheme.size.xl), ";};label:compressed;")
71
+ };
72
+ };
@@ -11,34 +11,31 @@ var _excluded = ["className", "onClick", "size"];
11
11
 
12
12
  import React from 'react';
13
13
  import classNames from 'classnames';
14
- import { keysOf } from '../../common';
14
+ import { useEuiMemoizedStyles } from '../../../services';
15
15
  import { EuiIcon } from '../../icon';
16
- import { EuiI18n } from '../../i18n';
16
+ import { useEuiI18n } from '../../i18n';
17
+ import { EuiFormControlLayoutClearButtonStyles } from './form_control_layout_clear_button.styles';
17
18
  import { jsx as ___EmotionJSX } from "@emotion/react";
18
- var sizeToClassNameMap = {
19
- s: 'euiFormControlLayoutClearButton--small',
20
- m: null
21
- };
22
- export var SIZES = keysOf(sizeToClassNameMap);
23
19
  export var EuiFormControlLayoutClearButton = function EuiFormControlLayoutClearButton(_ref) {
24
20
  var className = _ref.className,
25
21
  onClick = _ref.onClick,
26
22
  _ref$size = _ref.size,
27
23
  size = _ref$size === void 0 ? 'm' : _ref$size,
28
24
  rest = _objectWithoutProperties(_ref, _excluded);
29
- var classes = classNames('euiFormControlLayoutClearButton', sizeToClassNameMap[size], className);
30
- return ___EmotionJSX(EuiI18n, {
31
- token: "euiFormControlLayoutClearButton.label",
32
- default: "Clear input"
33
- }, function (label) {
34
- return ___EmotionJSX("button", _extends({
35
- type: "button",
36
- className: classes,
37
- onClick: onClick,
38
- "aria-label": label
39
- }, rest), ___EmotionJSX(EuiIcon, {
40
- className: "euiFormControlLayoutClearButton__icon",
41
- type: "cross"
42
- }));
43
- });
25
+ var classes = classNames('euiFormControlLayoutClearButton', className);
26
+ var styles = useEuiMemoizedStyles(EuiFormControlLayoutClearButtonStyles);
27
+ var iconStyles = [styles.euiFormControlLayoutClearButton__icon, styles.size[size]];
28
+ var ariaLabel = useEuiI18n('euiFormControlLayoutClearButton.label', 'Clear input');
29
+ return ___EmotionJSX("button", _extends({
30
+ type: "button",
31
+ css: styles.euiFormControlLayoutClearButton,
32
+ className: classes,
33
+ onClick: onClick,
34
+ "aria-label": ariaLabel
35
+ }, rest), ___EmotionJSX(EuiIcon, {
36
+ css: iconStyles,
37
+ className: "euiFormControlLayoutClearButton__icon",
38
+ type: "cross",
39
+ size: size
40
+ }));
44
41
  };
@@ -0,0 +1,22 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6
+ * Side Public License, v 1.
7
+ */
8
+
9
+ import { css } from '@emotion/react';
10
+ export var EuiFormControlLayoutClearButtonStyles = function EuiFormControlLayoutClearButtonStyles(_ref) {
11
+ var euiTheme = _ref.euiTheme,
12
+ colorMode = _ref.colorMode;
13
+ var backgroundColor = colorMode === 'DARK' ? euiTheme.colors.darkShade : euiTheme.colors.mediumShade;
14
+ return {
15
+ euiFormControlLayoutClearButton: /*#__PURE__*/css("pointer-events:all;background-color:", backgroundColor, ";border-radius:50%;line-height:0;&:disabled{cursor:not-allowed;background-color:", euiTheme.colors.disabled, ";};label:euiFormControlLayoutClearButton;"),
16
+ euiFormControlLayoutClearButton__icon: /*#__PURE__*/css("transform:scale(0.5);fill:", euiTheme.colors.emptyShade, ";stroke:", euiTheme.colors.emptyShade, ";;label:euiFormControlLayoutClearButton__icon;"),
17
+ size: {
18
+ s: /*#__PURE__*/css("stroke-width:", euiTheme.size.xs, ";;label:s;"),
19
+ m: /*#__PURE__*/css("stroke-width:", euiTheme.size.xxs, ";;label:m;")
20
+ }
21
+ };
22
+ };
@@ -1,6 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["className", "onClick", "type", "iconRef", "size", "color"];
3
+ var _excluded = ["className", "onClick", "type", "iconRef", "size", "color", "disabled"];
4
+ 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)."; }
4
5
  /*
5
6
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
6
7
  * or more contributor license agreements. Licensed under the Elastic License
@@ -10,6 +11,7 @@ var _excluded = ["className", "onClick", "type", "iconRef", "size", "color"];
10
11
  */
11
12
 
12
13
  import React from 'react';
14
+ import { css } from '@emotion/react';
13
15
  import classNames from 'classnames';
14
16
  import { EuiIcon } from '../../icon';
15
17
  import { jsx as ___EmotionJSX } from "@emotion/react";
@@ -20,14 +22,16 @@ export var EuiFormControlLayoutCustomIcon = function EuiFormControlLayoutCustomI
20
22
  iconRef = _ref.iconRef,
21
23
  size = _ref.size,
22
24
  color = _ref.color,
25
+ disabled = _ref.disabled,
23
26
  rest = _objectWithoutProperties(_ref, _excluded);
24
- var classes = classNames('euiFormControlLayoutCustomIcon', className, {
25
- 'euiFormControlLayoutCustomIcon--clickable': onClick
26
- });
27
+ var classes = classNames('euiFormControlLayoutCustomIcon', className);
28
+ var cssStyles = [styles.euiFormControlLayoutCustomIcon, onClick ? styles.clickable : styles.unclickable];
27
29
  if (onClick) {
28
30
  return ___EmotionJSX("button", _extends({
29
31
  type: "button",
30
32
  onClick: onClick,
33
+ disabled: disabled,
34
+ css: cssStyles,
31
35
  className: classes,
32
36
  ref: iconRef
33
37
  }, rest), ___EmotionJSX(EuiIcon, {
@@ -39,6 +43,7 @@ export var EuiFormControlLayoutCustomIcon = function EuiFormControlLayoutCustomI
39
43
  }));
40
44
  }
41
45
  return ___EmotionJSX("span", _extends({
46
+ css: cssStyles,
42
47
  className: classes,
43
48
  ref: iconRef
44
49
  }, rest), ___EmotionJSX(EuiIcon, {
@@ -48,4 +53,24 @@ export var EuiFormControlLayoutCustomIcon = function EuiFormControlLayoutCustomI
48
53
  type: type,
49
54
  color: color
50
55
  }));
56
+ };
57
+ var styles = {
58
+ euiFormControlLayoutCustomIcon: process.env.NODE_ENV === "production" ? {
59
+ name: "7d1ma8-euiFormControlLayoutCustomIcon",
60
+ styles: "font-size:0;label:euiFormControlLayoutCustomIcon;"
61
+ } : {
62
+ name: "7d1ma8-euiFormControlLayoutCustomIcon",
63
+ styles: "font-size:0;label:euiFormControlLayoutCustomIcon;",
64
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
65
+ },
66
+ // Skip css`` here to avoid generating an Emotion className
67
+ unclickable: "\n pointer-events: none;\n ",
68
+ clickable: process.env.NODE_ENV === "production" ? {
69
+ name: "1j8wgxj-clickable",
70
+ styles: "pointer-events:all;&:disabled{cursor:not-allowed;color:currentColor;};label:clickable;"
71
+ } : {
72
+ name: "1j8wgxj-clickable",
73
+ styles: "pointer-events:all;&:disabled{cursor:not-allowed;color:currentColor;};label:clickable;",
74
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
75
+ }
51
76
  };