@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
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.euiRangeSliderThumbStyles = exports.euiRangeSliderStyles = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
var _services = require("../../../services");
|
|
9
|
-
var _form = require("../form.styles");
|
|
10
9
|
var _range = require("./range.styles");
|
|
11
10
|
/*
|
|
12
11
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -20,9 +19,7 @@ var euiRangeSliderStyles = exports.euiRangeSliderStyles = function euiRangeSlide
|
|
|
20
19
|
var range = (0, _range.euiRangeVariables)(euiThemeContext);
|
|
21
20
|
return {
|
|
22
21
|
// Base
|
|
23
|
-
euiRangeSlider: /*#__PURE__*/(0, _react.css)("appearance:none;background:transparent;inline-size:100%;block-size:100%;position:relative;cursor:pointer;z-index:", range.thumbZIndex, ";", (0, _range.euiRangeThumbPerBrowser)("\n ".concat((0,
|
|
24
|
-
type: 'round'
|
|
25
|
-
}), "\n ").concat((0, _range.euiRangeThumbStyle)(euiThemeContext), "\n ")), " &:disabled{cursor:not-allowed;", (0, _range.euiRangeThumbPerBrowser)('cursor: not-allowed'), ";}&::-webkit-slider-thumb{-webkit-appearance:none;}&:focus{outline:none;}&:focus-visible{", (0, _range.euiRangeThumbPerBrowser)((0, _range.euiRangeThumbFocus)(euiThemeContext)), " &~.euiRangeTooltip .euiRangeTooltip__value{transform:translateX(0) translateY(-50%) scale(1.1);}};label:euiRangeSlider;"),
|
|
22
|
+
euiRangeSlider: /*#__PURE__*/(0, _react.css)("appearance:none;background:transparent;inline-size:100%;block-size:100%;position:relative;cursor:pointer;z-index:", range.thumbZIndex, ";", (0, _range.euiRangeThumbPerBrowser)("\n ".concat((0, _range.euiRangeThumbStyle)(euiThemeContext), "\n ")), " &:disabled{cursor:not-allowed;", (0, _range.euiRangeThumbPerBrowser)('cursor: not-allowed'), ";}&::-webkit-slider-thumb{-webkit-appearance:none;}&:focus{outline:none;}&:focus-visible{", (0, _range.euiRangeThumbPerBrowser)((0, _range.euiRangeThumbFocus)(euiThemeContext)), " &~.euiRangeTooltip .euiRangeTooltip__value{transform:translateX(0) translateY(-50%) scale(1.1);}};label:euiRangeSlider;"),
|
|
26
23
|
hasTicks: /*#__PURE__*/(0, _react.css)("block-size:", range.thumbHeight, ";;label:hasTicks;"),
|
|
27
24
|
hasRange: /*#__PURE__*/(0, _react.css)((0, _range.euiRangeTrackPerBrowser)("\n background-color: transparent;\n border-color: ".concat((0, _services.transparentize)(range.trackBorderColor, 0.6), "\n ")), ";;label:hasRange;"),
|
|
28
25
|
hasLevels: /*#__PURE__*/(0, _react.css)((0, _range.euiRangeThumbPerBrowser)("background-color: ".concat(range.thumbBackgroundColor)), ";;label:hasLevels;")
|
|
@@ -7,7 +7,6 @@ exports.euiRangeThumbStyles = void 0;
|
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
var _global_styling = require("../../../global_styling");
|
|
9
9
|
var _range = require("./range.styles");
|
|
10
|
-
var _form = require("../form.styles");
|
|
11
10
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /*
|
|
12
11
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
13
12
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -27,9 +26,7 @@ var euiRangeThumbStyles = exports.euiRangeThumbStyles = function euiRangeThumbSt
|
|
|
27
26
|
var range = (0, _range.euiRangeVariables)(euiThemeContext);
|
|
28
27
|
return {
|
|
29
28
|
// Base
|
|
30
|
-
euiRangeThumb: /*#__PURE__*/(0, _react.css)((0,
|
|
31
|
-
type: 'round'
|
|
32
|
-
}), " ", (0, _range.euiRangeThumbStyle)(euiThemeContext), " content:'';position:absolute;inset-inline-start:0;inset-block-start:50%;margin-block-start:", (0, _global_styling.mathWithUnits)(range.thumbHeight, function (x) {
|
|
29
|
+
euiRangeThumb: /*#__PURE__*/(0, _react.css)((0, _range.euiRangeThumbStyle)(euiThemeContext), " content:'';position:absolute;inset-inline-start:0;inset-block-start:50%;margin-block-start:", (0, _global_styling.mathWithUnits)(range.thumbHeight, function (x) {
|
|
33
30
|
return x / 2 * -1;
|
|
34
31
|
}), ";pointer-events:none;z-index:", range.thumbZIndex, ";&:focus{", (0, _range.euiRangeThumbFocus)(euiThemeContext), " outline:none;};label:euiRangeThumb;"),
|
|
35
32
|
hasTicks: _ref
|
|
@@ -7,11 +7,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.EuiSwitch = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
-
var _react2 = require("@emotion/react");
|
|
11
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
|
-
var
|
|
11
|
+
var _services = require("../../../services");
|
|
13
12
|
var _icon = require("../../icon");
|
|
14
|
-
var
|
|
13
|
+
var _switch = require("./switch.styles");
|
|
14
|
+
var _react2 = require("@emotion/react");
|
|
15
|
+
var _excluded = ["label", "id", "checked", "disabled", "compressed", "mini", "onChange", "className", "showLabel", "type", "labelProps"];
|
|
15
16
|
/*
|
|
16
17
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
17
18
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -23,6 +24,12 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
23
24
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
24
25
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
25
26
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
27
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
28
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
29
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
30
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
31
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
32
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
26
33
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
27
34
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
28
35
|
var EuiSwitch = exports.EuiSwitch = function EuiSwitch(_ref) {
|
|
@@ -31,19 +38,19 @@ var EuiSwitch = exports.EuiSwitch = function EuiSwitch(_ref) {
|
|
|
31
38
|
checked = _ref.checked,
|
|
32
39
|
disabled = _ref.disabled,
|
|
33
40
|
compressed = _ref.compressed,
|
|
41
|
+
mini = _ref.mini,
|
|
34
42
|
onChange = _ref.onChange,
|
|
35
43
|
className = _ref.className,
|
|
36
|
-
customCss = _ref.css,
|
|
37
44
|
_ref$showLabel = _ref.showLabel,
|
|
38
45
|
showLabel = _ref$showLabel === void 0 ? true : _ref$showLabel,
|
|
39
46
|
_ref$type = _ref.type,
|
|
40
47
|
type = _ref$type === void 0 ? 'button' : _ref$type,
|
|
41
48
|
labelProps = _ref.labelProps,
|
|
42
49
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
43
|
-
var switchId = (0,
|
|
50
|
+
var switchId = (0, _services.useGeneratedHtmlId)({
|
|
44
51
|
conditionalId: id
|
|
45
52
|
});
|
|
46
|
-
var labelId = (0,
|
|
53
|
+
var labelId = (0, _services.useGeneratedHtmlId)({
|
|
47
54
|
conditionalId: labelProps === null || labelProps === void 0 ? void 0 : labelProps.id
|
|
48
55
|
});
|
|
49
56
|
var onClick = (0, _react.useCallback)(function (e) {
|
|
@@ -54,23 +61,26 @@ var EuiSwitch = exports.EuiSwitch = function EuiSwitch(_ref) {
|
|
|
54
61
|
event.target.checked = !checked;
|
|
55
62
|
onChange(event);
|
|
56
63
|
}, [checked, disabled, onChange]);
|
|
57
|
-
var classes = (0, _classnames.default)('euiSwitch',
|
|
58
|
-
'euiSwitch--compressed': compressed
|
|
59
|
-
}, className);
|
|
64
|
+
var classes = (0, _classnames.default)('euiSwitch', className);
|
|
60
65
|
var labelClasses = (0, _classnames.default)('euiSwitch__label', labelProps === null || labelProps === void 0 ? void 0 : labelProps.className);
|
|
61
66
|
if (showLabel === false && typeof label !== 'string') {
|
|
62
67
|
console.warn('EuiSwitch `label` must be a string when `showLabel` is false.');
|
|
63
68
|
}
|
|
64
|
-
var
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
var
|
|
69
|
+
var size = mini ? 'mini' : compressed ? 'compressed' : 'uncompressed';
|
|
70
|
+
var styles = (0, _services.useEuiMemoizedStyles)(_switch.euiSwitchStyles);
|
|
71
|
+
var cssStyles = [styles.euiSwitch, disabled ? styles.disabled : styles.enabled];
|
|
72
|
+
var buttonStyles = [styles.button.euiSwitch__button, styles.button[size]];
|
|
73
|
+
var bodyStyles = [styles.body.euiSwitch__body, disabled ? styles.body.disabled[size] : checked ? styles.body.on : styles.body.off];
|
|
74
|
+
var iconsStyles = [styles.icons.euiSwitch__icons, checked ? styles.icons.on : styles.icons.off, disabled ? styles.icons.disabled : styles.icons.enabled];
|
|
75
|
+
var thumbStyles = [styles.thumb.euiSwitch__thumb, checked ? styles.thumb.on[size] : styles.thumb.off].concat(_toConsumableArray(disabled ? [styles.thumb.disabled.disabled, styles.thumb.disabled[size]] : [styles.thumb.enabled.enabled, styles.thumb.enabled[size]]));
|
|
76
|
+
var labelStyles = [styles.label.euiSwitch__label, styles.label[size], disabled && styles.label.disabled, labelProps === null || labelProps === void 0 ? void 0 : labelProps.css];
|
|
68
77
|
return (0, _react2.jsx)("div", {
|
|
69
78
|
css: cssStyles,
|
|
70
79
|
className: classes
|
|
71
80
|
}, (0, _react2.jsx)("button", _extends({
|
|
72
81
|
id: switchId,
|
|
73
82
|
"aria-checked": checked || false,
|
|
83
|
+
css: buttonStyles,
|
|
74
84
|
className: "euiSwitch__button",
|
|
75
85
|
role: "switch",
|
|
76
86
|
type: type,
|
|
@@ -79,24 +89,26 @@ var EuiSwitch = exports.EuiSwitch = function EuiSwitch(_ref) {
|
|
|
79
89
|
"aria-label": showLabel ? undefined : label,
|
|
80
90
|
"aria-labelledby": showLabel ? labelId : undefined
|
|
81
91
|
}, rest), (0, _react2.jsx)("span", {
|
|
92
|
+
css: bodyStyles,
|
|
82
93
|
className: "euiSwitch__body"
|
|
83
|
-
}, (0, _react2.jsx)("span", {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}, !compressed && (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_icon.EuiIcon, {
|
|
88
|
-
type: "cross",
|
|
89
|
-
size: "m",
|
|
90
|
-
className: "euiSwitch__icon"
|
|
91
|
-
}), (0, _react2.jsx)(_icon.EuiIcon, {
|
|
94
|
+
}, !(compressed || mini) && (0, _react2.jsx)("span", {
|
|
95
|
+
css: iconsStyles,
|
|
96
|
+
className: "euiSwitch__icons"
|
|
97
|
+
}, (0, _react2.jsx)(_icon.EuiIcon, {
|
|
92
98
|
type: "check",
|
|
93
|
-
size: "m"
|
|
94
|
-
|
|
95
|
-
|
|
99
|
+
size: "m"
|
|
100
|
+
}), (0, _react2.jsx)(_icon.EuiIcon, {
|
|
101
|
+
type: "cross",
|
|
102
|
+
size: "m"
|
|
103
|
+
}))), (0, _react2.jsx)("span", {
|
|
104
|
+
css: thumbStyles,
|
|
105
|
+
className: "euiSwitch__thumb"
|
|
106
|
+
})), showLabel &&
|
|
96
107
|
// <button> + <label> has poor screen reader support.
|
|
97
108
|
// Click handler added to simulate natural, secondary <label> interactivity.
|
|
98
109
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
99
110
|
(0, _react2.jsx)("span", _extends({}, labelProps, {
|
|
111
|
+
css: labelStyles,
|
|
100
112
|
className: labelClasses,
|
|
101
113
|
id: labelId,
|
|
102
114
|
onClick: onClick
|
|
@@ -118,6 +130,9 @@ EuiSwitch.propTypes = {
|
|
|
118
130
|
checked: _propTypes.default.bool.isRequired,
|
|
119
131
|
onChange: _propTypes.default.func.isRequired,
|
|
120
132
|
disabled: _propTypes.default.bool,
|
|
133
|
+
/**
|
|
134
|
+
* Compressed switches are smaller and contain no icon signifiers
|
|
135
|
+
*/
|
|
121
136
|
compressed: _propTypes.default.bool,
|
|
122
137
|
/**
|
|
123
138
|
* Object of props passed to the label's `<span />`
|
|
@@ -127,5 +142,10 @@ EuiSwitch.propTypes = {
|
|
|
127
142
|
"aria-label": _propTypes.default.string,
|
|
128
143
|
"data-test-subj": _propTypes.default.string,
|
|
129
144
|
css: _propTypes.default.any
|
|
130
|
-
})
|
|
145
|
+
}),
|
|
146
|
+
/**
|
|
147
|
+
* Mini styling is similar to compressed, but even smaller.
|
|
148
|
+
* It's undocumented because it has very specific uses.
|
|
149
|
+
*/
|
|
150
|
+
mini: _propTypes.default.bool
|
|
131
151
|
};
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiSwitchStyles = void 0;
|
|
7
|
+
var _react = require("@emotion/react");
|
|
8
|
+
var _services = require("../../../services");
|
|
9
|
+
var _global_styling = require("../../../global_styling");
|
|
10
|
+
var _form = require("../form.styles");
|
|
11
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /*
|
|
12
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
13
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
14
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
15
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
16
|
+
* Side Public License, v 1.
|
|
17
|
+
*/
|
|
18
|
+
var euiSwitchVars = function euiSwitchVars(euiThemeContext) {
|
|
19
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
20
|
+
var formVars = (0, _form.euiFormCustomControlVariables)(euiThemeContext);
|
|
21
|
+
var colors = {
|
|
22
|
+
on: formVars.colors.selected,
|
|
23
|
+
off: formVars.colors.unselectedBorder,
|
|
24
|
+
disabled: formVars.colors.disabled,
|
|
25
|
+
thumb: formVars.colors.selectedIcon,
|
|
26
|
+
thumbBorder: formVars.colors.unselectedBorder,
|
|
27
|
+
thumbBorderDisabled: formVars.colors.unselectedBorder
|
|
28
|
+
};
|
|
29
|
+
var sizes = {
|
|
30
|
+
uncompressed: {
|
|
31
|
+
height: (0, _global_styling.mathWithUnits)(euiTheme.size.base, function (x) {
|
|
32
|
+
return x * 1.25;
|
|
33
|
+
}),
|
|
34
|
+
width: (0, _global_styling.mathWithUnits)([euiTheme.size.xxl, euiTheme.size.xs], function (x, y) {
|
|
35
|
+
return x + y;
|
|
36
|
+
}),
|
|
37
|
+
thumbScales: {
|
|
38
|
+
default: 1,
|
|
39
|
+
hover: 1.05,
|
|
40
|
+
active: 0.9
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
compressed: {
|
|
44
|
+
height: euiTheme.size.base,
|
|
45
|
+
width: (0, _global_styling.mathWithUnits)(euiTheme.size.base, function (x) {
|
|
46
|
+
return x * 1.75;
|
|
47
|
+
}),
|
|
48
|
+
thumbScales: {
|
|
49
|
+
default: 0.9,
|
|
50
|
+
hover: 0.95,
|
|
51
|
+
active: 0.8
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
get mini() {
|
|
55
|
+
return {
|
|
56
|
+
height: (0, _global_styling.mathWithUnits)(this.uncompressed.height, function (x) {
|
|
57
|
+
return x / 2;
|
|
58
|
+
}),
|
|
59
|
+
width: (0, _global_styling.mathWithUnits)(this.uncompressed.width, function (x) {
|
|
60
|
+
return x / 2;
|
|
61
|
+
}),
|
|
62
|
+
thumbScales: {
|
|
63
|
+
default: 0.8,
|
|
64
|
+
hover: undefined,
|
|
65
|
+
active: undefined
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
var animation = {
|
|
71
|
+
speed: euiTheme.animation.normal,
|
|
72
|
+
easing: euiTheme.animation.bounce
|
|
73
|
+
};
|
|
74
|
+
var label = {
|
|
75
|
+
disabled: formVars.colors.disabledLabel,
|
|
76
|
+
gap: formVars.sizes.labelGap
|
|
77
|
+
};
|
|
78
|
+
return {
|
|
79
|
+
sizes: sizes,
|
|
80
|
+
colors: colors,
|
|
81
|
+
animation: animation,
|
|
82
|
+
label: label
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
86
|
+
name: "b86pnw-disabled",
|
|
87
|
+
styles: "cursor:not-allowed;label:disabled;"
|
|
88
|
+
} : {
|
|
89
|
+
name: "b86pnw-disabled",
|
|
90
|
+
styles: "cursor:not-allowed;label:disabled;",
|
|
91
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
92
|
+
};
|
|
93
|
+
var _ref3 = process.env.NODE_ENV === "production" ? {
|
|
94
|
+
name: "eg68pp-euiSwitch",
|
|
95
|
+
styles: "position:relative;display:inline-flex;align-items:flex-start;/* Required for inline-flex CSS to not render an extra 2-3px of strut height\n * @see https://stackoverflow.com/a/27536461/4294462 */vertical-align:middle;label:euiSwitch;"
|
|
96
|
+
} : {
|
|
97
|
+
name: "eg68pp-euiSwitch",
|
|
98
|
+
styles: "position:relative;display:inline-flex;align-items:flex-start;/* Required for inline-flex CSS to not render an extra 2-3px of strut height\n * @see https://stackoverflow.com/a/27536461/4294462 */vertical-align:middle;label:euiSwitch;",
|
|
99
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
100
|
+
};
|
|
101
|
+
var euiSwitchStyles = exports.euiSwitchStyles = function euiSwitchStyles(euiThemeContext) {
|
|
102
|
+
var switchVars = euiSwitchVars(euiThemeContext);
|
|
103
|
+
return {
|
|
104
|
+
euiSwitch: _ref3,
|
|
105
|
+
// Skip css`` to avoid generating an extra Emotion className
|
|
106
|
+
enabled: "\n cursor: pointer;\n ",
|
|
107
|
+
disabled: _ref2,
|
|
108
|
+
button: buttonStyles(euiThemeContext, switchVars),
|
|
109
|
+
// The track body must be separate from the button wrapper, because the
|
|
110
|
+
// icons have their overflow hidden outside the button, but the thumb doesn't
|
|
111
|
+
body: bodyStyles(euiThemeContext, switchVars),
|
|
112
|
+
icons: iconStyles(euiThemeContext, switchVars),
|
|
113
|
+
thumb: thumbStyles(euiThemeContext, switchVars),
|
|
114
|
+
label: labelStyles(euiThemeContext, switchVars)
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
var buttonStyles = function buttonStyles(euiThemeContext, switchVars) {
|
|
118
|
+
var _switchVars$sizes = switchVars.sizes,
|
|
119
|
+
uncompressed = _switchVars$sizes.uncompressed,
|
|
120
|
+
compressed = _switchVars$sizes.compressed,
|
|
121
|
+
mini = _switchVars$sizes.mini;
|
|
122
|
+
return {
|
|
123
|
+
euiSwitch__button: /*#__PURE__*/(0, _react.css)("flex-shrink:0;line-height:0;position:relative;cursor:inherit;", (0, _global_styling.euiFocusRing)(euiThemeContext, 'outset'), ";;label:euiSwitch__button;"),
|
|
124
|
+
// Skip css`` to avoid generating an Emotion className
|
|
125
|
+
uncompressed: "\n ".concat((0, _global_styling.logicalSizeCSS)(uncompressed.width, uncompressed.height), "\n border-radius: ").concat(uncompressed.height, ";\n "),
|
|
126
|
+
compressed: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalSizeCSS)(compressed.width, compressed.height), " border-radius:", compressed.height, ";;label:compressed;"),
|
|
127
|
+
mini: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalSizeCSS)(mini.width, mini.height), " border-radius:", mini.height, ";;label:mini;")
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
131
|
+
name: "19cwu6v-euiSwitch__body",
|
|
132
|
+
styles: "position:absolute;inset:0;overflow:hidden;border-radius:inherit;pointer-events:none;label:euiSwitch__body;"
|
|
133
|
+
} : {
|
|
134
|
+
name: "19cwu6v-euiSwitch__body",
|
|
135
|
+
styles: "position:absolute;inset:0;overflow:hidden;border-radius:inherit;pointer-events:none;label:euiSwitch__body;",
|
|
136
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
137
|
+
};
|
|
138
|
+
var bodyStyles = function bodyStyles(_ref4, _ref5) {
|
|
139
|
+
var colorMode = _ref4.colorMode;
|
|
140
|
+
var colors = _ref5.colors;
|
|
141
|
+
// This is probably very extra, but the visual weight of the default
|
|
142
|
+
// disabled custom control feels different in light mode depending
|
|
143
|
+
// on the size of the switch, so I'm tinting it based on that.
|
|
144
|
+
// Gotta justify my stupidly expensive art degree!
|
|
145
|
+
var _calculateDisabledColor = function _calculateDisabledColor(tintAmount) {
|
|
146
|
+
return /*#__PURE__*/(0, _react.css)("label:disabled;background-color:", colorMode === 'DARK' ? colors.disabled : (0, _services.tint)(colors.disabled, tintAmount), ";");
|
|
147
|
+
};
|
|
148
|
+
return {
|
|
149
|
+
euiSwitch__body: _ref,
|
|
150
|
+
on: /*#__PURE__*/(0, _react.css)("background-color:", colors.on, ";;label:on;"),
|
|
151
|
+
off: /*#__PURE__*/(0, _react.css)("background-color:", colors.off, ";;label:off;"),
|
|
152
|
+
disabled: {
|
|
153
|
+
uncompressed: _calculateDisabledColor(0.5),
|
|
154
|
+
compressed: _calculateDisabledColor(0.25),
|
|
155
|
+
mini: _calculateDisabledColor(0)
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
var iconStyles = function iconStyles(_ref6, _ref7) {
|
|
160
|
+
var euiTheme = _ref6.euiTheme;
|
|
161
|
+
var colors = _ref7.colors,
|
|
162
|
+
animation = _ref7.animation;
|
|
163
|
+
return {
|
|
164
|
+
euiSwitch__icons: /*#__PURE__*/(0, _react.css)("position:absolute;", (0, _global_styling.logicalCSS)('vertical', 0), " ", (0, _global_styling.logicalCSS)('left', '-50%'), " ", (0, _global_styling.logicalCSS)('width', '200%'), " display:flex;justify-content:space-around;align-items:center;", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.xs), " ", _global_styling.euiCanAnimate, "{transition-property:inset-inline-start;transition-duration:", animation.speed, ";transition-timing-function:", animation.easing, ";};label:euiSwitch__icons;"),
|
|
165
|
+
on: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('left', '-25%'), ";;label:on;"),
|
|
166
|
+
off: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('left', '-75%'), ";;label:off;"),
|
|
167
|
+
enabled: /*#__PURE__*/(0, _react.css)("color:", colors.thumb, ";;label:enabled;"),
|
|
168
|
+
disabled: /*#__PURE__*/(0, _react.css)("color:", colors.thumbBorderDisabled, ";;label:disabled;")
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
var thumbStyles = function thumbStyles(_ref8, switchVars) {
|
|
172
|
+
var euiTheme = _ref8.euiTheme;
|
|
173
|
+
var sizes = switchVars.sizes,
|
|
174
|
+
colors = switchVars.colors,
|
|
175
|
+
animation = switchVars.animation;
|
|
176
|
+
var uncompressed = sizes.uncompressed,
|
|
177
|
+
compressed = sizes.compressed,
|
|
178
|
+
mini = sizes.mini;
|
|
179
|
+
var _calculateScale = function _calculateScale(size, hoverActiveStates) {
|
|
180
|
+
var baseScale = "transform: scale(".concat(sizes[size].thumbScales.default, ");");
|
|
181
|
+
var states = hoverActiveStates ? "\n .euiSwitch:hover & {\n transform: scale(".concat(sizes[size].thumbScales.hover, ");\n }\n .euiSwitch:active & {\n transform: scale(").concat(sizes[size].thumbScales.active, ");\n }") : '';
|
|
182
|
+
return "".concat(baseScale).concat(states);
|
|
183
|
+
};
|
|
184
|
+
return {
|
|
185
|
+
euiSwitch__thumb: /*#__PURE__*/(0, _react.css)("position:absolute;", (0, _global_styling.logicalCSS)('vertical', 0), " aspect-ratio:1;", (0, _global_styling.logicalCSS)('width', 'fit-content'), " ", (0, _global_styling.logicalCSS)('height', '100%'), " border-radius:50%;pointer-events:none;", _global_styling.euiCanAnimate, "{transition-property:inset-inline-start,transform,background-color,border-color;transition-duration:", animation.speed, ";transition-timing-function:", animation.easing, ";};label:euiSwitch__thumb;"),
|
|
186
|
+
off: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('left', 0), ";;label:off;"),
|
|
187
|
+
get on() {
|
|
188
|
+
// right: 0 works but doesn't transition/animate, so we need to
|
|
189
|
+
// manually calculate the left position per switch size
|
|
190
|
+
var _calculateLeft = function _calculateLeft(bodyWidth, thumbWidth) {
|
|
191
|
+
var leftPosition = (0, _global_styling.mathWithUnits)([bodyWidth, thumbWidth], function (x, y) {
|
|
192
|
+
return x - y;
|
|
193
|
+
});
|
|
194
|
+
return /*#__PURE__*/(0, _react.css)("label:on;", (0, _global_styling.logicalCSS)('left', leftPosition), ";");
|
|
195
|
+
};
|
|
196
|
+
return {
|
|
197
|
+
uncompressed: _calculateLeft(uncompressed.width, uncompressed.height),
|
|
198
|
+
compressed: _calculateLeft(compressed.width, compressed.height),
|
|
199
|
+
mini: _calculateLeft(mini.width, mini.height)
|
|
200
|
+
};
|
|
201
|
+
},
|
|
202
|
+
enabled: {
|
|
203
|
+
enabled: "\n background-color: ".concat(colors.thumb, ";\n border: ").concat(euiTheme.border.width.thin, " solid ").concat(colors.thumbBorder, ";\n "),
|
|
204
|
+
uncompressed: _calculateScale('uncompressed', true),
|
|
205
|
+
compressed: _calculateScale('compressed', true),
|
|
206
|
+
mini: _calculateScale('mini', false)
|
|
207
|
+
},
|
|
208
|
+
disabled: {
|
|
209
|
+
disabled: /*#__PURE__*/(0, _react.css)("background-color:transparent;border:", euiTheme.border.width.thin, " solid ", colors.thumbBorderDisabled, ";;label:disabled;"),
|
|
210
|
+
uncompressed: _calculateScale('uncompressed', false),
|
|
211
|
+
compressed: _calculateScale('compressed', false),
|
|
212
|
+
mini: _calculateScale('mini', false)
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
var labelStyles = function labelStyles(euiThemeContext, _ref9) {
|
|
217
|
+
var sizes = _ref9.sizes,
|
|
218
|
+
label = _ref9.label;
|
|
219
|
+
var uncompressed = sizes.uncompressed,
|
|
220
|
+
compressed = sizes.compressed,
|
|
221
|
+
mini = sizes.mini;
|
|
222
|
+
return {
|
|
223
|
+
euiSwitch__label: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('padding-left', label.gap), ";;label:euiSwitch__label;"),
|
|
224
|
+
// Skip css`` to avoid generating an Emotion className
|
|
225
|
+
uncompressed: "\n font-size: ".concat((0, _global_styling.euiFontSize)(euiThemeContext, 's').fontSize, ";\n line-height: ").concat(uncompressed.height, ";\n "),
|
|
226
|
+
compressed: /*#__PURE__*/(0, _react.css)("font-size:", (0, _global_styling.euiFontSize)(euiThemeContext, 's').fontSize, ";line-height:", compressed.height, ";;label:compressed;"),
|
|
227
|
+
mini: /*#__PURE__*/(0, _react.css)("font-size:", (0, _global_styling.euiFontSize)(euiThemeContext, 'xs').fontSize, ";line-height:", mini.height, ";;label:mini;"),
|
|
228
|
+
disabled: /*#__PURE__*/(0, _react.css)("color:", label.disabled, ";;label:disabled;")
|
|
229
|
+
};
|
|
230
|
+
};
|
|
@@ -66,7 +66,7 @@ var euiTextAreaStyles = exports.euiTextAreaStyles = function euiTextAreaStyles(e
|
|
|
66
66
|
fullWidth: /*#__PURE__*/(0, _react.css)(formStyles.fullWidth, ";label:fullWidth;"),
|
|
67
67
|
// EuiFormControlLayout styles
|
|
68
68
|
formControlLayout: {
|
|
69
|
-
euiTextArea: /*#__PURE__*/(0, _react.css)(
|
|
69
|
+
euiTextArea: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', 'auto'), " .euiFormControlLayoutIcons{", (0, _global_styling.logicalCSS)('top', 'auto'), " ", (0, _global_styling.logicalCSS)('bottom', formVars.controlPadding), ";};label:euiTextArea;")
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
72
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -10,7 +9,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
10
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
10
|
var _button = require("../../button");
|
|
12
11
|
var _react2 = require("@emotion/react");
|
|
13
|
-
var _excluded = ["isActive", "className"];
|
|
12
|
+
var _excluded = ["isActive", "className", "size"];
|
|
14
13
|
/*
|
|
15
14
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
16
15
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -19,26 +18,23 @@ var _excluded = ["isActive", "className"];
|
|
|
19
18
|
* Side Public License, v 1.
|
|
20
19
|
*/
|
|
21
20
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
|
-
function
|
|
23
|
-
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; }
|
|
24
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
25
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
26
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
21
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
27
22
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
28
23
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
29
24
|
var EuiHeaderLink = exports.EuiHeaderLink = function EuiHeaderLink(_ref) {
|
|
30
25
|
var isActive = _ref.isActive,
|
|
31
26
|
className = _ref.className,
|
|
27
|
+
_ref$size = _ref.size,
|
|
28
|
+
size = _ref$size === void 0 ? 's' : _ref$size,
|
|
32
29
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
33
30
|
var classes = (0, _classnames.default)('euiHeaderLink', {
|
|
34
31
|
'euiHeaderLink-isActive': isActive
|
|
35
32
|
}, className);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
});
|
|
41
|
-
return (0, _react2.jsx)(_button.EuiButtonEmpty, props);
|
|
33
|
+
return (0, _react2.jsx)(_button.EuiButtonEmpty, _extends({
|
|
34
|
+
className: classes,
|
|
35
|
+
color: isActive ? 'primary' : 'text',
|
|
36
|
+
size: size
|
|
37
|
+
}, rest));
|
|
42
38
|
};
|
|
43
39
|
EuiHeaderLink.propTypes = {
|
|
44
40
|
href: _propTypes.default.string,
|
|
@@ -108,7 +108,7 @@ var EuiHeaderLinks = exports.EuiHeaderLinks = function EuiHeaderLinks(_ref) {
|
|
|
108
108
|
isOpen: mobileMenuIsOpen,
|
|
109
109
|
anchorPosition: "downRight",
|
|
110
110
|
closePopover: closeMenu,
|
|
111
|
-
panelPaddingSize: "
|
|
111
|
+
panelPaddingSize: "s",
|
|
112
112
|
repositionOnScroll: true
|
|
113
113
|
}, popoverProps), (0, _react2.jsx)("div", {
|
|
114
114
|
className: "euiHeaderLinks__mobileList",
|
|
@@ -40,6 +40,6 @@ var euiHeaderLinksStyles = exports.euiHeaderLinksStyles = function euiHeaderLink
|
|
|
40
40
|
m: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.base, ";;label:m;"),
|
|
41
41
|
l: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.l, ";;label:l;")
|
|
42
42
|
},
|
|
43
|
-
euiHeaderLinks__mobileList: /*#__PURE__*/(0, _react.css)(".euiHeaderLink{display:block;", (0, _global_styling.logicalCSS)('width', '100%'), "
|
|
43
|
+
euiHeaderLinks__mobileList: /*#__PURE__*/(0, _react.css)(".euiHeaderLink{display:block;", (0, _global_styling.logicalCSS)('width', '100%'), "&>.euiButtonEmpty__content{justify-content:flex-start;}};label:euiHeaderLinks__mobileList;")
|
|
44
44
|
};
|
|
45
45
|
};
|
|
@@ -23,14 +23,16 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
23
23
|
* See https://github.com/emotion-js/emotion/issues/1404
|
|
24
24
|
*/
|
|
25
25
|
var cloneElementWithCss = exports.cloneElementWithCss = function cloneElementWithCss(element, props) {
|
|
26
|
+
var cssOrder = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'after';
|
|
26
27
|
var clonedElement = element.props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__ || element.type; // EMOTION_TYPE handles non-React elements (native JSX/HTML nodes)
|
|
27
28
|
|
|
28
|
-
var clonedProps = _objectSpread(_objectSpread({
|
|
29
|
-
key: element.key
|
|
29
|
+
var clonedProps = _objectSpread(_objectSpread(_objectSpread({}, element.key ? {
|
|
30
|
+
key: element.key
|
|
31
|
+
} : {}), {}, {
|
|
30
32
|
ref: element.ref
|
|
31
33
|
}, element.props), props);
|
|
32
34
|
if (props.css || element.props.css) {
|
|
33
|
-
clonedProps.css = [element.props.css, props.css];
|
|
35
|
+
clonedProps.css = cssOrder === 'before' ? [props.css, element.props.css] : [element.props.css, props.css];
|
|
34
36
|
}
|
|
35
37
|
return (0, _react.jsx)(clonedElement, clonedProps);
|
|
36
38
|
};
|
|
@@ -238,13 +238,14 @@ export var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
|
|
|
238
238
|
return ___EmotionJSX(RenderWithEuiStylesMemoizer, null, function (stylesMemoizer) {
|
|
239
239
|
var styles = stylesMemoizer(euiComboBoxInputStyles);
|
|
240
240
|
var cssStyles = [styles.euiComboBoxInputWrapper, !singleSelection && styles.multiSelect, compressed ? styles.compressed : styles.uncompressed].concat(_toConsumableArray(_this2.asPlainText || showPlaceholder ? [styles.plainText.plainText, compressed ? styles.plainText.compressed : styles.plainText.uncompressed] : []), [isDisabled ? styles.disabled : isInvalid ? styles.invalid : isListOpen ? styles.open : undefined, isInGroup && styles.inGroup]);
|
|
241
|
-
var formLayoutStyles = [styles.formLayout.euiComboBox__formControlLayout, !singleSelection && styles.formLayout.multiSelect
|
|
241
|
+
var formLayoutStyles = [styles.formLayout.euiComboBox__formControlLayout, !singleSelection && styles.formLayout.multiSelect];
|
|
242
242
|
return ___EmotionJSX(EuiFormControlLayout, _extends({
|
|
243
243
|
icon: icon
|
|
244
244
|
}, clickProps, {
|
|
245
245
|
inputId: id,
|
|
246
246
|
isLoading: isLoading,
|
|
247
247
|
isInvalid: isInvalid,
|
|
248
|
+
isDisabled: isDisabled,
|
|
248
249
|
compressed: compressed,
|
|
249
250
|
fullWidth: fullWidth,
|
|
250
251
|
prepend: prepend,
|
|
@@ -50,11 +50,7 @@ export var euiComboBoxInputStyles = function euiComboBoxInputStyles(euiThemeCont
|
|
|
50
50
|
formLayout: {
|
|
51
51
|
euiComboBox__formControlLayout: /*#__PURE__*/css(";label:euiComboBox__formControlLayout;"),
|
|
52
52
|
// Allow the form control to expand to any height to accommodate multiple rows of pills
|
|
53
|
-
|
|
54
|
-
multiSelect: /*#__PURE__*/css("&&{", logicalCSS('height', 'auto'), ";};label:multiSelect;"),
|
|
55
|
-
// Fix overflowing input wrapper background
|
|
56
|
-
prependOnly: /*#__PURE__*/css(".euiFormControlLayout__childrenWrapper{", logicalCSS('border-top-right-radius', 'inherit'), " ", logicalCSS('border-bottom-right-radius', 'inherit'), ";};label:prependOnly;"),
|
|
57
|
-
appendOnly: /*#__PURE__*/css(".euiFormControlLayout__childrenWrapper{", logicalCSS('border-top-left-radius', 'inherit'), " ", logicalCSS('border-bottom-left-radius', 'inherit'), ";};label:appendOnly;")
|
|
53
|
+
multiSelect: /*#__PURE__*/css(logicalCSS('height', 'auto'), ";;label:multiSelect;")
|
|
58
54
|
}
|
|
59
55
|
};
|
|
60
56
|
};
|
|
@@ -151,8 +151,7 @@ export var useDataGridColumnSelector = function useDataGridColumnSelector(availa
|
|
|
151
151
|
label: displayValues[id] || id,
|
|
152
152
|
showLabel: false,
|
|
153
153
|
checked: visibleColumnIds.has(id),
|
|
154
|
-
|
|
155
|
-
className: "euiSwitch--mini",
|
|
154
|
+
mini: true,
|
|
156
155
|
onChange: function onChange(event) {
|
|
157
156
|
var checked = event.target.checked;
|
|
158
157
|
var nextVisibleColumns = sortedColumns.filter(function (columnId) {
|
|
@@ -174,7 +174,7 @@ describe('EuiDataGrid', function () {
|
|
|
174
174
|
it('has zero violations when the columns reorder searchbox returns multiple results', function () {
|
|
175
175
|
cy.get('button[data-test-subj="dataGridColumnSelectorButton"]').realClick();
|
|
176
176
|
cy.get('input[data-test-subj="dataGridColumnSelectorSearch"]').type('a');
|
|
177
|
-
cy.get('
|
|
177
|
+
cy.get('.euiSwitch').should(function ($s) {
|
|
178
178
|
expect($s).to.have.length(5);
|
|
179
179
|
});
|
|
180
180
|
cy.checkAxe();
|
|
@@ -182,7 +182,7 @@ describe('EuiDataGrid', function () {
|
|
|
182
182
|
it('has zero violations when the columns reorder searchbox returns 1 result', function () {
|
|
183
183
|
cy.get('button[data-test-subj="dataGridColumnSelectorButton"]').realClick();
|
|
184
184
|
cy.get('input[data-test-subj="dataGridColumnSelectorSearch"]').type('favorite');
|
|
185
|
-
cy.get('
|
|
185
|
+
cy.get('.euiSwitch').should(function ($s) {
|
|
186
186
|
expect($s).to.have.length(1);
|
|
187
187
|
});
|
|
188
188
|
cy.checkAxe();
|