@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.
- package/dist/eui_theme_dark.css +0 -1163
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -1163
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/combo_box/combo_box_input/combo_box_input.js +2 -1
- package/es/components/combo_box/combo_box_input/combo_box_input.styles.js +1 -5
- package/es/components/datagrid/controls/column_selector.js +1 -2
- package/es/components/datagrid/data_grid.a11y.js +2 -2
- package/es/components/date_picker/date_picker.js +11 -11
- package/es/components/date_picker/date_picker.styles.js +14 -2
- package/es/components/date_picker/date_picker_range.js +2 -1
- package/es/components/date_picker/date_picker_range.styles.js +17 -2
- package/es/components/date_picker/super_date_picker/super_date_picker.js +14 -2
- package/es/components/date_picker/super_date_picker/super_date_picker.styles.js +4 -4
- package/es/components/form/checkbox/checkbox.js +28 -25
- package/es/components/form/checkbox/checkbox.styles.js +62 -0
- package/es/components/form/described_form_group/described_form_group.js +17 -9
- package/es/components/form/described_form_group/described_form_group.styles.js +26 -0
- package/es/components/form/field_number/field_number.js +1 -0
- package/es/components/form/field_number/field_number.styles.js +2 -1
- package/es/components/form/field_password/field_password.js +6 -3
- package/es/components/form/field_search/field_search.js +39 -29
- package/es/components/form/field_text/field_text.js +1 -0
- package/es/components/form/form.js +7 -4
- package/es/components/form/form.styles.js +87 -39
- package/es/components/form/form_control_layout/_num_icons.js +7 -33
- package/es/components/form/form_control_layout/form_control_layout.js +67 -32
- package/es/components/form/form_control_layout/form_control_layout.styles.js +72 -0
- package/es/components/form/form_control_layout/form_control_layout_clear_button.js +20 -23
- package/es/components/form/form_control_layout/form_control_layout_clear_button.styles.js +22 -0
- package/es/components/form/form_control_layout/form_control_layout_custom_icon.js +30 -5
- package/es/components/form/form_control_layout/form_control_layout_delimited.js +37 -7
- package/es/components/form/form_control_layout/form_control_layout_delimited.styles.js +52 -0
- package/es/components/form/form_control_layout/form_control_layout_icons.js +33 -13
- package/es/components/form/form_control_layout/form_control_layout_icons.styles.js +54 -0
- package/es/components/form/form_error_text/form_error_text.js +4 -0
- package/es/components/form/form_error_text/form_error_text.styles.js +16 -0
- package/es/components/form/form_fieldset/form_legend.js +6 -2
- package/es/components/form/form_fieldset/form_legend.styles.js +20 -0
- package/es/components/form/form_help_text/form_help_text.js +4 -0
- package/es/components/form/form_help_text/form_help_text.styles.js +16 -0
- package/es/components/form/form_label/form_label.js +6 -0
- package/es/components/form/form_label/form_label.styles.js +38 -0
- package/es/components/form/form_row/form_row.js +156 -223
- package/es/components/form/form_row/form_row.styles.js +49 -0
- package/es/components/form/radio/radio.js +21 -14
- package/es/components/form/radio/radio.styles.js +34 -0
- package/es/components/form/range/range.styles.js +1 -1
- package/es/components/form/range/range_input.styles.js +1 -1
- package/es/components/form/range/range_slider.styles.js +1 -4
- package/es/components/form/range/range_thumb.styles.js +1 -4
- package/es/components/form/switch/switch.js +43 -24
- package/es/components/form/switch/switch.styles.js +226 -0
- package/es/components/form/text_area/text_area.js +1 -0
- package/es/components/form/text_area/text_area.styles.js +1 -1
- package/es/components/header/header_links/header_link.js +9 -13
- package/es/components/header/header_links/header_links.js +1 -1
- package/es/components/header/header_links/header_links.styles.js +1 -1
- package/es/services/emotion/clone_element.js +5 -3
- package/eui.d.ts +403 -112
- package/i18ntokens.json +48 -30
- package/lib/components/combo_box/combo_box_input/combo_box_input.js +2 -1
- package/lib/components/combo_box/combo_box_input/combo_box_input.styles.js +1 -5
- package/lib/components/datagrid/controls/column_selector.js +1 -2
- package/lib/components/datagrid/data_grid.a11y.js +2 -2
- package/lib/components/date_picker/date_picker.js +11 -11
- package/lib/components/date_picker/date_picker.styles.js +14 -2
- package/lib/components/date_picker/date_picker_range.js +2 -1
- package/lib/components/date_picker/date_picker_range.styles.js +17 -4
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +14 -2
- package/lib/components/date_picker/super_date_picker/super_date_picker.styles.js +4 -4
- package/lib/components/form/checkbox/checkbox.js +27 -23
- package/lib/components/form/checkbox/checkbox.styles.js +66 -0
- package/lib/components/form/described_form_group/described_form_group.js +17 -9
- package/lib/components/form/described_form_group/described_form_group.styles.js +32 -0
- package/lib/components/form/field_number/field_number.js +1 -0
- package/lib/components/form/field_number/field_number.styles.js +2 -1
- package/lib/components/form/field_password/field_password.js +6 -3
- package/lib/components/form/field_search/field_search.js +39 -29
- package/lib/components/form/field_text/field_text.js +1 -0
- package/lib/components/form/form.js +6 -3
- package/lib/components/form/form.styles.js +88 -40
- package/lib/components/form/form_control_layout/_num_icons.js +8 -33
- package/lib/components/form/form_control_layout/form_control_layout.js +65 -31
- package/lib/components/form/form_control_layout/form_control_layout.styles.js +76 -0
- package/lib/components/form/form_control_layout/form_control_layout_clear_button.js +20 -23
- package/lib/components/form/form_control_layout/form_control_layout_clear_button.styles.js +28 -0
- package/lib/components/form/form_control_layout/form_control_layout_custom_icon.js +34 -11
- package/lib/components/form/form_control_layout/form_control_layout_delimited.js +36 -9
- package/lib/components/form/form_control_layout/form_control_layout_delimited.styles.js +56 -0
- package/lib/components/form/form_control_layout/form_control_layout_icons.js +33 -13
- package/lib/components/form/form_control_layout/form_control_layout_icons.styles.js +58 -0
- package/lib/components/form/form_error_text/form_error_text.js +4 -0
- package/lib/components/form/form_error_text/form_error_text.styles.js +22 -0
- package/lib/components/form/form_fieldset/form_legend.js +6 -2
- package/lib/components/form/form_fieldset/form_legend.styles.js +26 -0
- package/lib/components/form/form_help_text/form_help_text.js +4 -0
- package/lib/components/form/form_help_text/form_help_text.styles.js +22 -0
- package/lib/components/form/form_label/form_label.js +6 -0
- package/lib/components/form/form_label/form_label.styles.js +43 -0
- package/lib/components/form/form_row/form_row.js +161 -226
- package/lib/components/form/form_row/form_row.styles.js +55 -0
- package/lib/components/form/radio/radio.js +21 -14
- package/lib/components/form/radio/radio.styles.js +40 -0
- package/lib/components/form/range/range.styles.js +1 -1
- package/lib/components/form/range/range_input.styles.js +1 -1
- package/lib/components/form/range/range_slider.styles.js +1 -4
- package/lib/components/form/range/range_thumb.styles.js +1 -4
- package/lib/components/form/switch/switch.js +46 -26
- package/lib/components/form/switch/switch.styles.js +230 -0
- package/lib/components/form/text_area/text_area.js +1 -0
- package/lib/components/form/text_area/text_area.styles.js +1 -1
- package/lib/components/header/header_links/header_link.js +9 -13
- package/lib/components/header/header_links/header_links.js +1 -1
- package/lib/components/header/header_links/header_links.styles.js +1 -1
- package/lib/services/emotion/clone_element.js +5 -3
- package/optimize/es/components/combo_box/combo_box_input/combo_box_input.js +2 -1
- package/optimize/es/components/combo_box/combo_box_input/combo_box_input.styles.js +1 -5
- package/optimize/es/components/datagrid/controls/column_selector.js +1 -2
- package/optimize/es/components/datagrid/data_grid.a11y.js +2 -2
- package/optimize/es/components/date_picker/date_picker.js +6 -9
- package/optimize/es/components/date_picker/date_picker.styles.js +14 -2
- package/optimize/es/components/date_picker/date_picker_range.js +2 -1
- package/optimize/es/components/date_picker/date_picker_range.styles.js +17 -2
- package/optimize/es/components/date_picker/super_date_picker/super_date_picker.js +13 -2
- package/optimize/es/components/date_picker/super_date_picker/super_date_picker.styles.js +4 -4
- package/optimize/es/components/form/checkbox/checkbox.js +28 -25
- package/optimize/es/components/form/checkbox/checkbox.styles.js +62 -0
- package/optimize/es/components/form/described_form_group/described_form_group.js +17 -9
- package/optimize/es/components/form/described_form_group/described_form_group.styles.js +26 -0
- package/optimize/es/components/form/field_number/field_number.js +1 -0
- package/optimize/es/components/form/field_number/field_number.styles.js +2 -1
- package/optimize/es/components/form/field_password/field_password.js +6 -3
- package/optimize/es/components/form/field_search/field_search.js +39 -29
- package/optimize/es/components/form/field_text/field_text.js +1 -0
- package/optimize/es/components/form/form.js +7 -4
- package/optimize/es/components/form/form.styles.js +87 -39
- package/optimize/es/components/form/form_control_layout/_num_icons.js +7 -33
- package/optimize/es/components/form/form_control_layout/form_control_layout.js +44 -29
- package/optimize/es/components/form/form_control_layout/form_control_layout.styles.js +72 -0
- package/optimize/es/components/form/form_control_layout/form_control_layout_clear_button.js +19 -22
- package/optimize/es/components/form/form_control_layout/form_control_layout_clear_button.styles.js +22 -0
- package/optimize/es/components/form/form_control_layout/form_control_layout_custom_icon.js +29 -4
- package/optimize/es/components/form/form_control_layout/form_control_layout_delimited.js +34 -7
- package/optimize/es/components/form/form_control_layout/form_control_layout_delimited.styles.js +52 -0
- package/optimize/es/components/form/form_control_layout/form_control_layout_icons.js +25 -11
- package/optimize/es/components/form/form_control_layout/form_control_layout_icons.styles.js +54 -0
- package/optimize/es/components/form/form_error_text/form_error_text.js +4 -0
- package/optimize/es/components/form/form_error_text/form_error_text.styles.js +16 -0
- package/optimize/es/components/form/form_fieldset/form_legend.js +6 -2
- package/optimize/es/components/form/form_fieldset/form_legend.styles.js +20 -0
- package/optimize/es/components/form/form_help_text/form_help_text.js +4 -0
- package/optimize/es/components/form/form_help_text/form_help_text.styles.js +16 -0
- package/optimize/es/components/form/form_label/form_label.js +6 -0
- package/optimize/es/components/form/form_label/form_label.styles.js +37 -0
- package/optimize/es/components/form/form_row/form_row.js +135 -201
- package/optimize/es/components/form/form_row/form_row.styles.js +49 -0
- package/optimize/es/components/form/radio/radio.js +21 -14
- package/optimize/es/components/form/radio/radio.styles.js +34 -0
- package/optimize/es/components/form/range/range.styles.js +1 -1
- package/optimize/es/components/form/range/range_input.styles.js +1 -1
- package/optimize/es/components/form/range/range_slider.styles.js +1 -4
- package/optimize/es/components/form/range/range_thumb.styles.js +1 -4
- package/optimize/es/components/form/switch/switch.js +29 -23
- package/optimize/es/components/form/switch/switch.styles.js +226 -0
- package/optimize/es/components/form/text_area/text_area.js +1 -0
- package/optimize/es/components/form/text_area/text_area.styles.js +1 -1
- package/optimize/es/components/header/header_links/header_link.js +9 -10
- package/optimize/es/components/header/header_links/header_links.js +1 -1
- package/optimize/es/components/header/header_links/header_links.styles.js +1 -1
- package/optimize/es/services/emotion/clone_element.js +5 -3
- package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.js +2 -1
- package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.styles.js +1 -5
- package/optimize/lib/components/datagrid/controls/column_selector.js +1 -2
- package/optimize/lib/components/datagrid/data_grid.a11y.js +2 -2
- package/optimize/lib/components/date_picker/date_picker.js +6 -9
- package/optimize/lib/components/date_picker/date_picker.styles.js +14 -2
- package/optimize/lib/components/date_picker/date_picker_range.js +2 -1
- package/optimize/lib/components/date_picker/date_picker_range.styles.js +17 -4
- package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.js +13 -2
- package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.styles.js +4 -4
- package/optimize/lib/components/form/checkbox/checkbox.js +27 -23
- package/optimize/lib/components/form/checkbox/checkbox.styles.js +66 -0
- package/optimize/lib/components/form/described_form_group/described_form_group.js +17 -9
- package/optimize/lib/components/form/described_form_group/described_form_group.styles.js +32 -0
- package/optimize/lib/components/form/field_number/field_number.js +1 -0
- package/optimize/lib/components/form/field_number/field_number.styles.js +2 -1
- package/optimize/lib/components/form/field_password/field_password.js +6 -3
- package/optimize/lib/components/form/field_search/field_search.js +39 -29
- package/optimize/lib/components/form/field_text/field_text.js +1 -0
- package/optimize/lib/components/form/form.js +6 -3
- package/optimize/lib/components/form/form.styles.js +88 -40
- package/optimize/lib/components/form/form_control_layout/_num_icons.js +8 -33
- package/optimize/lib/components/form/form_control_layout/form_control_layout.js +43 -28
- package/optimize/lib/components/form/form_control_layout/form_control_layout.styles.js +76 -0
- package/optimize/lib/components/form/form_control_layout/form_control_layout_clear_button.js +19 -22
- package/optimize/lib/components/form/form_control_layout/form_control_layout_clear_button.styles.js +28 -0
- package/optimize/lib/components/form/form_control_layout/form_control_layout_custom_icon.js +29 -6
- package/optimize/lib/components/form/form_control_layout/form_control_layout_delimited.js +34 -10
- package/optimize/lib/components/form/form_control_layout/form_control_layout_delimited.styles.js +56 -0
- package/optimize/lib/components/form/form_control_layout/form_control_layout_icons.js +25 -11
- package/optimize/lib/components/form/form_control_layout/form_control_layout_icons.styles.js +58 -0
- package/optimize/lib/components/form/form_error_text/form_error_text.js +4 -0
- package/optimize/lib/components/form/form_error_text/form_error_text.styles.js +22 -0
- package/optimize/lib/components/form/form_fieldset/form_legend.js +6 -2
- package/optimize/lib/components/form/form_fieldset/form_legend.styles.js +26 -0
- package/optimize/lib/components/form/form_help_text/form_help_text.js +4 -0
- package/optimize/lib/components/form/form_help_text/form_help_text.styles.js +22 -0
- package/optimize/lib/components/form/form_label/form_label.js +6 -0
- package/optimize/lib/components/form/form_label/form_label.styles.js +43 -0
- package/optimize/lib/components/form/form_row/form_row.js +136 -201
- package/optimize/lib/components/form/form_row/form_row.styles.js +55 -0
- package/optimize/lib/components/form/radio/radio.js +21 -14
- package/optimize/lib/components/form/radio/radio.styles.js +40 -0
- package/optimize/lib/components/form/range/range.styles.js +1 -1
- package/optimize/lib/components/form/range/range_input.styles.js +1 -1
- package/optimize/lib/components/form/range/range_slider.styles.js +1 -4
- package/optimize/lib/components/form/range/range_thumb.styles.js +1 -4
- package/optimize/lib/components/form/switch/switch.js +32 -25
- package/optimize/lib/components/form/switch/switch.styles.js +230 -0
- package/optimize/lib/components/form/text_area/text_area.js +1 -0
- package/optimize/lib/components/form/text_area/text_area.styles.js +1 -1
- package/optimize/lib/components/header/header_links/header_link.js +9 -10
- package/optimize/lib/components/header/header_links/header_links.js +1 -1
- package/optimize/lib/components/header/header_links/header_links.styles.js +1 -1
- package/optimize/lib/services/emotion/clone_element.js +5 -3
- package/package.json +3 -2
- package/src/components/datagrid/controls/_data_grid_toolbar.scss +1 -1
- package/src/components/index.scss +0 -1
- package/src/global_styling/mixins/_form.scss +0 -99
- package/src/global_styling/mixins/_index.scss +0 -1
- package/src/global_styling/variables/_form.scss +0 -21
- package/src/themes/amsterdam/global_styling/mixins/_index.scss +0 -1
- package/src/themes/amsterdam/overrides/_index.scss +0 -3
- package/test-env/components/combo_box/combo_box_input/combo_box_input.js +2 -1
- package/test-env/components/combo_box/combo_box_input/combo_box_input.styles.js +1 -5
- package/test-env/components/datagrid/controls/column_selector.js +1 -2
- package/test-env/components/datagrid/data_grid.a11y.js +2 -2
- package/test-env/components/date_picker/date_picker.js +6 -9
- package/test-env/components/date_picker/date_picker.styles.js +14 -2
- package/test-env/components/date_picker/date_picker_range.js +2 -1
- package/test-env/components/date_picker/date_picker_range.styles.js +17 -4
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +13 -2
- package/test-env/components/date_picker/super_date_picker/super_date_picker.styles.js +4 -4
- package/test-env/components/form/checkbox/checkbox.js +27 -23
- package/test-env/components/form/checkbox/checkbox.styles.js +66 -0
- package/test-env/components/form/described_form_group/described_form_group.js +17 -9
- package/test-env/components/form/described_form_group/described_form_group.styles.js +32 -0
- package/test-env/components/form/field_number/field_number.js +1 -0
- package/test-env/components/form/field_number/field_number.styles.js +2 -1
- package/test-env/components/form/field_password/field_password.js +6 -3
- package/test-env/components/form/field_search/field_search.js +39 -29
- package/test-env/components/form/field_text/field_text.js +1 -0
- package/test-env/components/form/form.js +6 -3
- package/test-env/components/form/form.styles.js +88 -40
- package/test-env/components/form/form_control_layout/_num_icons.js +8 -33
- package/test-env/components/form/form_control_layout/form_control_layout.js +58 -31
- package/test-env/components/form/form_control_layout/form_control_layout.styles.js +76 -0
- package/test-env/components/form/form_control_layout/form_control_layout_clear_button.js +20 -23
- package/test-env/components/form/form_control_layout/form_control_layout_clear_button.styles.js +28 -0
- package/test-env/components/form/form_control_layout/form_control_layout_custom_icon.js +30 -7
- package/test-env/components/form/form_control_layout/form_control_layout_delimited.js +34 -10
- package/test-env/components/form/form_control_layout/form_control_layout_delimited.styles.js +56 -0
- package/test-env/components/form/form_control_layout/form_control_layout_icons.js +28 -13
- package/test-env/components/form/form_control_layout/form_control_layout_icons.styles.js +58 -0
- package/test-env/components/form/form_error_text/form_error_text.js +4 -0
- package/test-env/components/form/form_error_text/form_error_text.styles.js +22 -0
- package/test-env/components/form/form_fieldset/form_legend.js +6 -2
- package/test-env/components/form/form_fieldset/form_legend.styles.js +26 -0
- package/test-env/components/form/form_help_text/form_help_text.js +4 -0
- package/test-env/components/form/form_help_text/form_help_text.styles.js +22 -0
- package/test-env/components/form/form_label/form_label.js +6 -0
- package/test-env/components/form/form_label/form_label.styles.js +43 -0
- package/test-env/components/form/form_row/form_row.js +153 -216
- package/test-env/components/form/form_row/form_row.styles.js +55 -0
- package/test-env/components/form/radio/radio.js +21 -14
- package/test-env/components/form/radio/radio.styles.js +40 -0
- package/test-env/components/form/range/range.styles.js +1 -1
- package/test-env/components/form/range/range_input.styles.js +1 -1
- package/test-env/components/form/range/range_slider.styles.js +1 -4
- package/test-env/components/form/range/range_thumb.styles.js +1 -4
- package/test-env/components/form/switch/switch.js +41 -26
- package/test-env/components/form/switch/switch.styles.js +230 -0
- package/test-env/components/form/text_area/text_area.js +1 -0
- package/test-env/components/form/text_area/text_area.styles.js +1 -1
- package/test-env/components/header/header_links/header_link.js +9 -10
- package/test-env/components/header/header_links/header_links.js +1 -1
- package/test-env/components/header/header_links/header_links.styles.js +1 -1
- package/test-env/services/emotion/clone_element.js +5 -3
- package/src/components/form/_form.scss +0 -8
- package/src/components/form/_index.scss +0 -11
- package/src/components/form/checkbox/_checkbox.scss +0 -115
- package/src/components/form/checkbox/_index.scss +0 -1
- package/src/components/form/described_form_group/_described_form_group.scss +0 -34
- package/src/components/form/described_form_group/_index.scss +0 -1
- package/src/components/form/form_control_layout/_form_control_layout.scss +0 -203
- package/src/components/form/form_control_layout/_form_control_layout_clear_button.scss +0 -7
- package/src/components/form/form_control_layout/_form_control_layout_custom_icon.scss +0 -24
- package/src/components/form/form_control_layout/_form_control_layout_delimited.scss +0 -67
- package/src/components/form/form_control_layout/_form_control_layout_icons.scss +0 -54
- package/src/components/form/form_control_layout/_index.scss +0 -5
- package/src/components/form/form_error_text/_form_error_text.scss +0 -5
- package/src/components/form/form_error_text/_index.scss +0 -1
- package/src/components/form/form_fieldset/_form_legend.scss +0 -11
- package/src/components/form/form_fieldset/_index.scss +0 -1
- package/src/components/form/form_help_text/_form_help_text.scss +0 -5
- package/src/components/form/form_help_text/_index.scss +0 -1
- package/src/components/form/form_label/_form_label.scss +0 -25
- package/src/components/form/form_label/_index.scss +0 -1
- package/src/components/form/form_row/_form_row.scss +0 -102
- package/src/components/form/form_row/_index.scss +0 -1
- package/src/components/form/radio/_index.scss +0 -1
- package/src/components/form/radio/_radio.scss +0 -87
- package/src/components/form/switch/_index.scss +0 -1
- package/src/components/form/switch/_switch.scss +0 -212
- package/src/global_styling/mixins/_icons.scss +0 -17
- package/src/themes/amsterdam/overrides/_form_control_layout.scss +0 -112
- package/src/themes/amsterdam/overrides/_form_control_layout_delimited.scss +0 -42
- package/src/themes/amsterdam/overrides/_form_controls.scss +0 -19
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["startControl", "endControl", "delimiter", "className"];
|
|
4
|
+
var _excluded = ["startControl", "endControl", "delimiter", "className", "fullWidth"];
|
|
5
|
+
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; }
|
|
6
|
+
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
7
|
/*
|
|
5
8
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
6
9
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -9,19 +12,27 @@ var _excluded = ["startControl", "endControl", "delimiter", "className"];
|
|
|
9
12
|
* Side Public License, v 1.
|
|
10
13
|
*/
|
|
11
14
|
|
|
12
|
-
import React
|
|
15
|
+
import React from 'react';
|
|
13
16
|
import classNames from 'classnames';
|
|
17
|
+
import { useEuiMemoizedStyles, cloneElementWithCss } from '../../../services';
|
|
14
18
|
import { useEuiI18n } from '../../i18n';
|
|
15
19
|
import { EuiIcon } from '../../icon';
|
|
16
20
|
import { EuiText } from '../../text';
|
|
21
|
+
import { FormContext, useFormContext } from '../eui_form_context';
|
|
17
22
|
import { EuiFormControlLayout } from './form_control_layout';
|
|
23
|
+
import { euiFormControlLayoutDelimitedStyles, euiFormControlLayoutDelimited__delimiter, euiFormControlLayoutDelimited__input } from './form_control_layout_delimited.styles';
|
|
18
24
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
19
25
|
export var EuiFormControlLayoutDelimited = function EuiFormControlLayoutDelimited(_ref) {
|
|
26
|
+
var _rest$wrapperProps;
|
|
20
27
|
var startControl = _ref.startControl,
|
|
21
28
|
endControl = _ref.endControl,
|
|
22
29
|
delimiter = _ref.delimiter,
|
|
23
30
|
className = _ref.className,
|
|
31
|
+
_fullWidth = _ref.fullWidth,
|
|
24
32
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
33
|
+
var _useFormContext = useFormContext(),
|
|
34
|
+
defaultFullWidth = _useFormContext.defaultFullWidth;
|
|
35
|
+
var fullWidth = _fullWidth !== null && _fullWidth !== void 0 ? _fullWidth : defaultFullWidth;
|
|
25
36
|
var isInvalid = rest.isInvalid,
|
|
26
37
|
isDisabled = rest.isDisabled,
|
|
27
38
|
readOnly = rest.readOnly;
|
|
@@ -29,24 +40,40 @@ export var EuiFormControlLayoutDelimited = function EuiFormControlLayoutDelimite
|
|
|
29
40
|
var classes = classNames('euiFormControlLayoutDelimited', className, {
|
|
30
41
|
'euiFormControlLayoutDelimited--isInvalid': showInvalidState
|
|
31
42
|
});
|
|
43
|
+
var styles = useEuiMemoizedStyles(euiFormControlLayoutDelimitedStyles);
|
|
44
|
+
var cssStyles = [styles.delimited, rest.isDisabled && styles.disabled, rest.readOnly && styles.readOnly];
|
|
45
|
+
var wrapperStyles = [styles.childrenWrapper.delimited, showInvalidState && styles.childrenWrapper.invalid, (_rest$wrapperProps = rest.wrapperProps) === null || _rest$wrapperProps === void 0 ? void 0 : _rest$wrapperProps.css];
|
|
32
46
|
return ___EmotionJSX(EuiFormControlLayout, _extends({
|
|
47
|
+
isDelimited: true,
|
|
48
|
+
css: cssStyles,
|
|
33
49
|
className: classes,
|
|
34
|
-
iconsPosition: "static"
|
|
35
|
-
|
|
50
|
+
iconsPosition: "static",
|
|
51
|
+
fullWidth: fullWidth
|
|
52
|
+
}, rest, {
|
|
53
|
+
wrapperProps: _objectSpread(_objectSpread({}, rest.wrapperProps), {}, {
|
|
54
|
+
css: wrapperStyles
|
|
55
|
+
})
|
|
56
|
+
}), ___EmotionJSX(FormContext.Provider, {
|
|
57
|
+
value: {
|
|
58
|
+
defaultFullWidth: fullWidth
|
|
59
|
+
}
|
|
60
|
+
}, addClassesToControl(startControl), ___EmotionJSX(EuiFormControlDelimiter, {
|
|
36
61
|
delimiter: delimiter,
|
|
37
62
|
isInvalid: showInvalidState
|
|
38
|
-
}), addClassesToControl(endControl));
|
|
63
|
+
}), addClassesToControl(endControl)));
|
|
39
64
|
};
|
|
40
65
|
var addClassesToControl = function addClassesToControl(control) {
|
|
41
|
-
return
|
|
66
|
+
return cloneElementWithCss(control, {
|
|
67
|
+
css: euiFormControlLayoutDelimited__input,
|
|
42
68
|
className: classNames(control.props.className, 'euiFormControlLayoutDelimited__input')
|
|
43
|
-
});
|
|
69
|
+
}, 'before');
|
|
44
70
|
};
|
|
45
71
|
var EuiFormControlDelimiter = function EuiFormControlDelimiter(_ref2) {
|
|
46
72
|
var delimiter = _ref2.delimiter,
|
|
47
73
|
isInvalid = _ref2.isInvalid;
|
|
48
74
|
var defaultAriaLabel = useEuiI18n('euiFormControlLayoutDelimited.delimiterLabel', 'to');
|
|
49
75
|
return ___EmotionJSX(EuiText, {
|
|
76
|
+
css: euiFormControlLayoutDelimited__delimiter,
|
|
50
77
|
className: "euiFormControlLayoutDelimited__delimiter",
|
|
51
78
|
size: "s",
|
|
52
79
|
color: isInvalid ? 'danger' : 'subdued'
|
package/optimize/es/components/form/form_control_layout/form_control_layout_delimited.styles.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
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 { logicalCSS } from '../../../global_styling';
|
|
12
|
+
import { euiFormControlDisabledStyles, euiFormControlReadOnlyStyles, euiFormControlDefaultShadow, euiFormControlInvalidStyles } from '../form.styles';
|
|
13
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
14
|
+
name: "1o1b8cl-delimited",
|
|
15
|
+
styles: "display:flex;label:delimited;"
|
|
16
|
+
} : {
|
|
17
|
+
name: "1o1b8cl-delimited",
|
|
18
|
+
styles: "display:flex;label:delimited;",
|
|
19
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
20
|
+
};
|
|
21
|
+
export var euiFormControlLayoutDelimitedStyles = function euiFormControlLayoutDelimitedStyles(euiThemeContext) {
|
|
22
|
+
return {
|
|
23
|
+
// Appended onto existing `euiFormControlLayout` styles
|
|
24
|
+
delimited: /*#__PURE__*/css(
|
|
25
|
+
// Transition smoothly between disabled/readOnly background color changes
|
|
26
|
+
euiFormControlDefaultShadow(euiThemeContext, {
|
|
27
|
+
withBorder: false,
|
|
28
|
+
withBackground: false,
|
|
29
|
+
withBackgroundAnimation: true
|
|
30
|
+
}), ";label:delimited;"),
|
|
31
|
+
disabled: /*#__PURE__*/css(euiFormControlDisabledStyles(euiThemeContext), ";label:disabled;"),
|
|
32
|
+
readOnly: /*#__PURE__*/css(euiFormControlReadOnlyStyles(euiThemeContext), ";label:readOnly;"),
|
|
33
|
+
// Appended onto existing `euiFormControlLayout__childrenWrapper` styles
|
|
34
|
+
childrenWrapper: {
|
|
35
|
+
delimited: _ref,
|
|
36
|
+
invalid: /*#__PURE__*/css(euiFormControlDefaultShadow(euiThemeContext, {
|
|
37
|
+
withBorder: false,
|
|
38
|
+
withBackgroundColor: false,
|
|
39
|
+
withBackgroundAnimation: false
|
|
40
|
+
}), euiFormControlInvalidStyles(euiThemeContext), ";label:invalid;")
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export var euiFormControlLayoutDelimited__delimiter = process.env.NODE_ENV === "production" ? {
|
|
45
|
+
name: "14bhjql-euiFormControlLayoutDelimited__delimiter",
|
|
46
|
+
styles: "align-self:stretch;flex-grow:0;display:flex;align-items:center;line-height:1;label:euiFormControlLayoutDelimited__delimiter;"
|
|
47
|
+
} : {
|
|
48
|
+
name: "14bhjql-euiFormControlLayoutDelimited__delimiter",
|
|
49
|
+
styles: "align-self:stretch;flex-grow:0;display:flex;align-items:center;line-height:1;label:euiFormControlLayoutDelimited__delimiter;",
|
|
50
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
51
|
+
};
|
|
52
|
+
export var euiFormControlLayoutDelimited__input = /*#__PURE__*/css("box-shadow:none;border-radius:0;text-align:center;", logicalCSS('height', '100%'), ";;label:euiFormControlLayoutDelimited__input;");
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
4
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
5
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
@@ -17,11 +18,12 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
17
18
|
*/
|
|
18
19
|
|
|
19
20
|
import React, { Component } from 'react';
|
|
20
|
-
import
|
|
21
|
+
import { RenderWithEuiStylesMemoizer } from '../../../services';
|
|
22
|
+
import { EuiIcon } from '../../icon';
|
|
21
23
|
import { EuiLoadingSpinner } from '../../loading';
|
|
22
24
|
import { EuiFormControlLayoutClearButton } from './form_control_layout_clear_button';
|
|
23
25
|
import { EuiFormControlLayoutCustomIcon } from './form_control_layout_custom_icon';
|
|
24
|
-
import {
|
|
26
|
+
import { euiFormControlLayoutIconsStyles } from './form_control_layout_icons.styles';
|
|
25
27
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
26
28
|
export var ICON_SIDES = ['left', 'right'];
|
|
27
29
|
export var isIconShape = function isIconShape(icon) {
|
|
@@ -40,23 +42,30 @@ export var EuiFormControlLayoutIcons = /*#__PURE__*/function (_Component) {
|
|
|
40
42
|
_this$props$side = _this$props.side,
|
|
41
43
|
side = _this$props$side === void 0 ? 'left' : _this$props$side,
|
|
42
44
|
_this$props$iconsPosi = _this$props.iconsPosition,
|
|
43
|
-
iconsPosition = _this$props$iconsPosi === void 0 ? 'absolute' : _this$props$iconsPosi
|
|
45
|
+
iconsPosition = _this$props$iconsPosi === void 0 ? 'absolute' : _this$props$iconsPosi,
|
|
46
|
+
compressed = _this$props.compressed,
|
|
47
|
+
isDisabled = _this$props.isDisabled;
|
|
44
48
|
var customIcon = this.renderCustomIcon();
|
|
45
49
|
var loadingSpinner = this.renderLoadingSpinner();
|
|
46
50
|
var clearButton = this.renderClearButton();
|
|
47
51
|
var invalidIcon = this.renderInvalidIcon();
|
|
48
52
|
var dropdownIcon = this.renderDropdownIcon();
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
return ___EmotionJSX(RenderWithEuiStylesMemoizer, null, function (stylesMemoizer) {
|
|
54
|
+
var styles = stylesMemoizer(euiFormControlLayoutIconsStyles);
|
|
55
|
+
var cssStyles = [styles.euiFormControlLayoutIcons, compressed ? styles.compressed : styles.uncompressed].concat(_toConsumableArray(iconsPosition === 'absolute' ? [styles.position.absolute.absolute, compressed ? styles.position.absolute.compressed[side] : styles.position.absolute.uncompressed[side]] : [styles.position.static.static, compressed ? styles.position.static.compressed : styles.position.static.uncompressed]), [isDisabled && styles.disabled]);
|
|
56
|
+
return ___EmotionJSX("div", {
|
|
57
|
+
css: cssStyles,
|
|
58
|
+
className: "euiFormControlLayoutIcons"
|
|
59
|
+
}, clearButton, loadingSpinner, invalidIcon, customIcon, dropdownIcon);
|
|
60
|
+
});
|
|
53
61
|
}
|
|
54
62
|
}, {
|
|
55
63
|
key: "renderCustomIcon",
|
|
56
64
|
value: function renderCustomIcon() {
|
|
57
65
|
var _this$props2 = this.props,
|
|
58
66
|
icon = _this$props2.icon,
|
|
59
|
-
compressed = _this$props2.compressed
|
|
67
|
+
compressed = _this$props2.compressed,
|
|
68
|
+
isDisabled = _this$props2.isDisabled;
|
|
60
69
|
if (!icon) {
|
|
61
70
|
return null;
|
|
62
71
|
}
|
|
@@ -70,6 +79,7 @@ export var EuiFormControlLayoutIcons = /*#__PURE__*/function (_Component) {
|
|
|
70
79
|
iconRest = _objectWithoutProperties(iconProps, _excluded);
|
|
71
80
|
return ___EmotionJSX(EuiFormControlLayoutCustomIcon, _extends({
|
|
72
81
|
size: compressed ? 's' : 'm',
|
|
82
|
+
disabled: isDisabled,
|
|
73
83
|
iconRef: iconRef
|
|
74
84
|
}, iconRest));
|
|
75
85
|
}
|
|
@@ -78,12 +88,14 @@ export var EuiFormControlLayoutIcons = /*#__PURE__*/function (_Component) {
|
|
|
78
88
|
value: function renderDropdownIcon() {
|
|
79
89
|
var _this$props3 = this.props,
|
|
80
90
|
isDropdown = _this$props3.isDropdown,
|
|
81
|
-
compressed = _this$props3.compressed
|
|
91
|
+
compressed = _this$props3.compressed,
|
|
92
|
+
isDisabled = _this$props3.isDisabled;
|
|
82
93
|
if (!isDropdown) {
|
|
83
94
|
return null;
|
|
84
95
|
}
|
|
85
96
|
return ___EmotionJSX(EuiFormControlLayoutCustomIcon, {
|
|
86
97
|
size: compressed ? 's' : 'm',
|
|
98
|
+
disabled: isDisabled,
|
|
87
99
|
type: "arrowDown"
|
|
88
100
|
});
|
|
89
101
|
}
|
|
@@ -105,12 +117,14 @@ export var EuiFormControlLayoutIcons = /*#__PURE__*/function (_Component) {
|
|
|
105
117
|
value: function renderClearButton() {
|
|
106
118
|
var _this$props5 = this.props,
|
|
107
119
|
clear = _this$props5.clear,
|
|
108
|
-
compressed = _this$props5.compressed
|
|
120
|
+
compressed = _this$props5.compressed,
|
|
121
|
+
isDisabled = _this$props5.isDisabled;
|
|
109
122
|
if (!clear) {
|
|
110
123
|
return null;
|
|
111
124
|
}
|
|
112
125
|
return ___EmotionJSX(EuiFormControlLayoutClearButton, _extends({
|
|
113
|
-
size: compressed ? 's' : 'm'
|
|
126
|
+
size: compressed ? 's' : 'm',
|
|
127
|
+
disabled: isDisabled
|
|
114
128
|
}, clear));
|
|
115
129
|
}
|
|
116
130
|
}, {
|
|
@@ -0,0 +1,54 @@
|
|
|
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 { logicalCSS, mathWithUnits } from '../../../global_styling';
|
|
12
|
+
import { euiFormVariables } from '../form.styles';
|
|
13
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
14
|
+
name: "3lf9c4-euiFormControlLayoutIcons",
|
|
15
|
+
styles: "pointer-events:none;display:flex;align-items:center;label:euiFormControlLayoutIcons;"
|
|
16
|
+
} : {
|
|
17
|
+
name: "3lf9c4-euiFormControlLayoutIcons",
|
|
18
|
+
styles: "pointer-events:none;display:flex;align-items:center;label:euiFormControlLayoutIcons;",
|
|
19
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
20
|
+
};
|
|
21
|
+
export var euiFormControlLayoutIconsStyles = function euiFormControlLayoutIconsStyles(euiThemeContext) {
|
|
22
|
+
var _euiFormVariables = euiFormVariables(euiThemeContext),
|
|
23
|
+
controlPadding = _euiFormVariables.controlPadding,
|
|
24
|
+
controlCompressedPadding = _euiFormVariables.controlCompressedPadding,
|
|
25
|
+
controlDisabledColor = _euiFormVariables.controlDisabledColor;
|
|
26
|
+
return {
|
|
27
|
+
euiFormControlLayoutIcons: _ref,
|
|
28
|
+
uncompressed: "\n gap: ".concat(mathWithUnits(controlPadding, function (x) {
|
|
29
|
+
return x / 2;
|
|
30
|
+
}), ";\n "),
|
|
31
|
+
compressed: /*#__PURE__*/css("gap:", mathWithUnits(controlCompressedPadding, function (x) {
|
|
32
|
+
return x / 2;
|
|
33
|
+
}), ";;label:compressed;"),
|
|
34
|
+
disabled: /*#__PURE__*/css("cursor:not-allowed;color:", controlDisabledColor, ";;label:disabled;"),
|
|
35
|
+
position: {
|
|
36
|
+
absolute: {
|
|
37
|
+
absolute: /*#__PURE__*/css("position:absolute;", logicalCSS('vertical', 0), ";;label:absolute;"),
|
|
38
|
+
uncompressed: {
|
|
39
|
+
left: /*#__PURE__*/css("z-index:1;", logicalCSS('left', controlPadding), ";;label:left;"),
|
|
40
|
+
right: /*#__PURE__*/css(logicalCSS('right', controlPadding), ";;label:right;")
|
|
41
|
+
},
|
|
42
|
+
compressed: {
|
|
43
|
+
left: /*#__PURE__*/css("z-index:1;", logicalCSS('left', controlCompressedPadding), ";;label:left;"),
|
|
44
|
+
right: /*#__PURE__*/css(logicalCSS('right', controlCompressedPadding), ";;label:right;")
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
static: {
|
|
48
|
+
static: /*#__PURE__*/css("position:static;", logicalCSS('height', '100%'), " align-self:stretch;flex-grow:0;", logicalCSS('padding-horizontal', '100%'), ";;label:static;"),
|
|
49
|
+
uncompressed: logicalCSS('padding-horizontal', controlPadding),
|
|
50
|
+
compressed: logicalCSS('padding-horizontal', controlCompressedPadding)
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
};
|
|
@@ -11,13 +11,17 @@ var _excluded = ["children", "className"];
|
|
|
11
11
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
|
+
import { useEuiMemoizedStyles } from '../../../services';
|
|
15
|
+
import { euiFormErrorTextStyles } from './form_error_text.styles';
|
|
14
16
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
15
17
|
export var EuiFormErrorText = function EuiFormErrorText(_ref) {
|
|
16
18
|
var children = _ref.children,
|
|
17
19
|
className = _ref.className,
|
|
18
20
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
19
21
|
var classes = classNames('euiFormErrorText', className);
|
|
22
|
+
var styles = useEuiMemoizedStyles(euiFormErrorTextStyles);
|
|
20
23
|
return ___EmotionJSX("div", _extends({
|
|
24
|
+
css: styles.euiFormErrorText,
|
|
21
25
|
className: classes,
|
|
22
26
|
"aria-live": "polite"
|
|
23
27
|
}, rest), children);
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
import { euiFontSize, logicalCSS } from '../../../global_styling';
|
|
11
|
+
export var euiFormErrorTextStyles = function euiFormErrorTextStyles(euiThemeContext) {
|
|
12
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
13
|
+
return {
|
|
14
|
+
euiFormErrorText: /*#__PURE__*/css(logicalCSS('padding-top', euiTheme.size.xs), " ", euiFontSize(euiThemeContext, 'xs'), " color:", euiTheme.colors.danger, ";;label:euiFormErrorText;")
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -11,7 +11,9 @@ var _excluded = ["children", "className", "display", "compressed"];
|
|
|
11
11
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
|
+
import { useEuiMemoizedStyles } from '../../../services';
|
|
14
15
|
import { EuiScreenReaderOnly } from '../../accessibility';
|
|
16
|
+
import { euiFormLegendStyles } from './form_legend.styles';
|
|
15
17
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
16
18
|
export var EuiFormLegend = function EuiFormLegend(_ref) {
|
|
17
19
|
var children = _ref.children,
|
|
@@ -21,11 +23,13 @@ export var EuiFormLegend = function EuiFormLegend(_ref) {
|
|
|
21
23
|
compressed = _ref.compressed,
|
|
22
24
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
23
25
|
var isLegendHidden = display === 'hidden';
|
|
26
|
+
var styles = useEuiMemoizedStyles(euiFormLegendStyles);
|
|
27
|
+
var cssStyles = [styles.euiFormLegend, !isLegendHidden && (compressed ? styles.compressed : styles.uncompressed)];
|
|
24
28
|
var classes = classNames('euiFormLegend', {
|
|
25
|
-
'euiFormLegend-isHidden': isLegendHidden
|
|
26
|
-
'euiFormLegend--compressed': compressed
|
|
29
|
+
'euiFormLegend-isHidden': isLegendHidden
|
|
27
30
|
}, className);
|
|
28
31
|
return ___EmotionJSX("legend", _extends({
|
|
32
|
+
css: cssStyles,
|
|
29
33
|
className: classes
|
|
30
34
|
}, rest), isLegendHidden ? ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span", null, children)) : children);
|
|
31
35
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
import { logicalCSS } from '../../../global_styling';
|
|
11
|
+
import { euiFormLabel } from '../form_label/form_label.styles';
|
|
12
|
+
export var euiFormLegendStyles = function euiFormLegendStyles(euiThemeContext) {
|
|
13
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
14
|
+
return {
|
|
15
|
+
euiFormLegend: /*#__PURE__*/css(euiFormLabel(euiThemeContext), ";;label:euiFormLegend;"),
|
|
16
|
+
// Skip css`` to avoid generating an extra Emotion className
|
|
17
|
+
uncompressed: logicalCSS('margin-bottom', euiTheme.size.s),
|
|
18
|
+
compressed: /*#__PURE__*/css(logicalCSS('margin-bottom', euiTheme.size.xs), ";label:compressed;")
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -11,13 +11,17 @@ var _excluded = ["children", "className"];
|
|
|
11
11
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
|
+
import { useEuiMemoizedStyles } from '../../../services';
|
|
15
|
+
import { euiFormHelpTextStyles } from './form_help_text.styles';
|
|
14
16
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
15
17
|
export var EuiFormHelpText = function EuiFormHelpText(_ref) {
|
|
16
18
|
var children = _ref.children,
|
|
17
19
|
className = _ref.className,
|
|
18
20
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
19
21
|
var classes = classNames('euiFormHelpText', className);
|
|
22
|
+
var styles = useEuiMemoizedStyles(euiFormHelpTextStyles);
|
|
20
23
|
return ___EmotionJSX("div", _extends({
|
|
24
|
+
css: styles.euiFormHelpText,
|
|
21
25
|
className: classes
|
|
22
26
|
}, rest), children);
|
|
23
27
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
import { euiFontSize, logicalCSS } from '../../../global_styling';
|
|
11
|
+
export var euiFormHelpTextStyles = function euiFormHelpTextStyles(euiThemeContext) {
|
|
12
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
13
|
+
return {
|
|
14
|
+
euiFormHelpText: /*#__PURE__*/css(logicalCSS('padding-top', euiTheme.size.xs), " ", euiFontSize(euiThemeContext, 'xs'), " color:", euiTheme.colors.darkShade, ";;label:euiFormHelpText;")
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -11,6 +11,8 @@ var _excluded = ["type", "isFocused", "isInvalid", "isDisabled", "children", "cl
|
|
|
11
11
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
|
+
import { useEuiMemoizedStyles } from '../../../services';
|
|
15
|
+
import { euiFormLabelStyles } from './form_label.styles';
|
|
14
16
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
15
17
|
export var EuiFormLabel = function EuiFormLabel(_ref) {
|
|
16
18
|
var _ref$type = _ref.type,
|
|
@@ -21,6 +23,8 @@ export var EuiFormLabel = function EuiFormLabel(_ref) {
|
|
|
21
23
|
children = _ref.children,
|
|
22
24
|
className = _ref.className,
|
|
23
25
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
26
|
+
var styles = useEuiMemoizedStyles(euiFormLabelStyles);
|
|
27
|
+
var cssStyles = [styles.euiFormLabel, !isDisabled && styles.notDisabled, isInvalid && styles.invalid, isFocused && styles.focused];
|
|
24
28
|
var classes = classNames('euiFormLabel', className, {
|
|
25
29
|
'euiFormLabel-isFocused': isFocused,
|
|
26
30
|
'euiFormLabel-isInvalid': isInvalid,
|
|
@@ -28,10 +32,12 @@ export var EuiFormLabel = function EuiFormLabel(_ref) {
|
|
|
28
32
|
});
|
|
29
33
|
if (type === 'legend') {
|
|
30
34
|
return ___EmotionJSX("legend", _extends({
|
|
35
|
+
css: cssStyles,
|
|
31
36
|
className: classes
|
|
32
37
|
}, rest), children);
|
|
33
38
|
} else {
|
|
34
39
|
return ___EmotionJSX("label", _extends({
|
|
40
|
+
css: cssStyles,
|
|
35
41
|
className: classes
|
|
36
42
|
}, rest), children);
|
|
37
43
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
|
+
var _excluded = ["fontWeight"];
|
|
3
|
+
/*
|
|
4
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
5
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
6
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
7
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
8
|
+
* Side Public License, v 1.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { css } from '@emotion/react';
|
|
12
|
+
import { serializeStyles } from '@emotion/serialize';
|
|
13
|
+
import { euiCanAnimate, euiTextBreakWord } from '../../../global_styling';
|
|
14
|
+
import { euiTitle } from '../../title/title.styles';
|
|
15
|
+
export var euiFormLabel = function euiFormLabel(euiThemeContext) {
|
|
16
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
17
|
+
// Exclude the fontWeight from the title, since we're setting our own later
|
|
18
|
+
var _euiTitle = euiTitle(euiThemeContext, 'xxxs'),
|
|
19
|
+
_ = _euiTitle.fontWeight,
|
|
20
|
+
_titleStyles = _objectWithoutProperties(_euiTitle, _excluded);
|
|
21
|
+
// Since we're not returning a css`` string (to avoid generating an extra Emotion
|
|
22
|
+
// className), we need to manually serialize the style object into a string
|
|
23
|
+
var titleStyles = serializeStyles([_titleStyles]).styles;
|
|
24
|
+
return "\n ".concat(titleStyles, "\n font-weight: ").concat(euiTheme.font.weight.semiBold, ";\n ").concat(euiTextBreakWord(), "\n ");
|
|
25
|
+
};
|
|
26
|
+
export var euiFormLabelStyles = function euiFormLabelStyles(euiThemeContext) {
|
|
27
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
28
|
+
return {
|
|
29
|
+
euiFormLabel: /*#__PURE__*/css(euiFormLabel(euiThemeContext), " display:inline-block;", euiCanAnimate, "{transition:color ", euiTheme.animation.fast, " ", euiTheme.animation.resistance, ";};label:euiFormLabel;"),
|
|
30
|
+
// Skip css`` to avoid generating an extra Emotion className
|
|
31
|
+
// Use :where to reduce specificity & make the CSS easier to override by prepend/append nodes
|
|
32
|
+
notDisabled: "\n &:where([for]) {\n cursor: pointer;\n }\n ",
|
|
33
|
+
invalid: /*#__PURE__*/css("color:", euiTheme.colors.danger, ";;label:invalid;"),
|
|
34
|
+
// Focused state should override invalid state
|
|
35
|
+
focused: /*#__PURE__*/css("color:", euiTheme.colors.primary, ";;label:focused;")
|
|
36
|
+
};
|
|
37
|
+
};
|