@elastic/eui 105.0.0 → 106.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eui_theme_amsterdam_dark.json +2 -0
- package/dist/eui_theme_amsterdam_dark.json.d.ts +2 -0
- package/dist/eui_theme_amsterdam_light.json +2 -0
- package/dist/eui_theme_amsterdam_light.json.d.ts +2 -0
- package/dist/eui_theme_borealis_dark.json +2 -0
- package/dist/eui_theme_borealis_dark.json.d.ts +2 -0
- package/dist/eui_theme_borealis_light.json +10 -8
- package/dist/eui_theme_borealis_light.json.d.ts +2 -0
- package/es/components/combo_box/combo_box_input/combo_box_input.js +65 -61
- package/es/components/combo_box/combo_box_input/combo_box_input.styles.js +6 -4
- package/es/components/date_picker/date_picker.styles.js +4 -1
- package/es/components/date_picker/date_picker_range.js +3 -2
- package/es/components/date_picker/date_picker_range.styles.js +11 -4
- package/es/components/date_picker/super_date_picker/super_date_picker.styles.js +23 -14
- package/es/components/flyout/_flyout_close_button.styles.js +10 -1
- package/es/components/flyout/flyout_child.js +8 -3
- package/es/components/flyout/flyout_child.styles.js +3 -2
- package/es/components/flyout/sessions/flyout_provider.js +7 -21
- package/es/components/flyout/sessions/flyout_reducer.js +5 -26
- package/es/components/flyout/sessions/use_eui_flyout.js +21 -10
- package/es/components/form/field_number/field_number.styles.js +4 -1
- package/es/components/form/field_text/field_text.styles.js +4 -1
- package/es/components/form/file_picker/file_picker.js +107 -101
- package/es/components/form/file_picker/file_picker.styles.js +18 -17
- package/es/components/form/form.styles.js +72 -22
- package/es/components/form/form_control_layout/form_control_layout.styles.js +28 -17
- package/es/components/form/form_control_layout/form_control_layout_clear_button.styles.js +7 -7
- package/es/components/form/form_control_layout/form_control_layout_delimited.js +10 -7
- package/es/components/form/form_control_layout/form_control_layout_delimited.styles.js +34 -29
- package/es/components/form/form_control_layout/form_control_layout_icons.js +35 -20
- package/es/components/form/form_control_layout/form_control_layout_icons.styles.js +6 -6
- package/es/components/form/form_error_text/form_error_text.styles.js +3 -1
- package/es/components/form/form_label/form_label.styles.js +4 -2
- package/es/components/header/header.styles.js +5 -3
- package/es/components/markdown_editor/markdown_editor_drop_zone.styles.js +6 -3
- package/es/components/progress/progress.a11y.js +7 -7
- package/es/components/progress/progress.js +18 -27
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +59 -23
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +8 -2
- package/es/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +63 -0
- package/es/global_styling/mixins/_button.js +1 -1
- package/es/services/color/eui_palettes.js +26 -0
- package/es/services/color/vis_color_store.js +1 -1
- package/es/services/color/visualization_colors.js +4 -0
- package/es/services/theme/provider.js +13 -6
- package/es/themes/amsterdam/global_styling/variables/_colors.js +8 -3
- package/es/themes/amsterdam/global_styling/variables/_forms.js +96 -53
- package/es/themes/amsterdam/theme.js +2 -1
- package/es/themes/json/eui_theme_amsterdam_dark.json +2 -0
- package/es/themes/json/eui_theme_amsterdam_light.json +2 -0
- package/es/themes/json/eui_theme_borealis_dark.json +2 -0
- package/es/themes/json/eui_theme_borealis_light.json +10 -8
- package/eui.d.ts +461 -376
- package/i18ntokens.json +3595 -3523
- package/lib/components/combo_box/combo_box_input/combo_box_input.js +64 -60
- package/lib/components/combo_box/combo_box_input/combo_box_input.styles.js +6 -4
- package/lib/components/date_picker/date_picker.styles.js +4 -1
- package/lib/components/date_picker/date_picker_range.js +3 -2
- package/lib/components/date_picker/date_picker_range.styles.js +11 -4
- package/lib/components/date_picker/super_date_picker/super_date_picker.styles.js +21 -12
- package/lib/components/flyout/_flyout_close_button.styles.js +10 -3
- package/lib/components/flyout/flyout_child.js +8 -3
- package/lib/components/flyout/flyout_child.styles.js +3 -2
- package/lib/components/flyout/sessions/flyout_provider.js +7 -21
- package/lib/components/flyout/sessions/flyout_reducer.js +5 -26
- package/lib/components/flyout/sessions/use_eui_flyout.js +21 -10
- package/lib/components/form/field_number/field_number.styles.js +4 -1
- package/lib/components/form/field_text/field_text.styles.js +4 -1
- package/lib/components/form/file_picker/file_picker.js +106 -100
- package/lib/components/form/file_picker/file_picker.styles.js +16 -15
- package/lib/components/form/form.styles.js +72 -22
- package/lib/components/form/form_control_layout/form_control_layout.styles.js +28 -17
- package/lib/components/form/form_control_layout/form_control_layout_clear_button.styles.js +7 -7
- package/lib/components/form/form_control_layout/form_control_layout_delimited.js +9 -6
- package/lib/components/form/form_control_layout/form_control_layout_delimited.styles.js +34 -27
- package/lib/components/form/form_control_layout/form_control_layout_icons.js +34 -19
- package/lib/components/form/form_control_layout/form_control_layout_icons.styles.js +6 -6
- package/lib/components/form/form_error_text/form_error_text.styles.js +3 -1
- package/lib/components/form/form_label/form_label.styles.js +4 -2
- package/lib/components/header/header.styles.js +4 -2
- package/lib/components/markdown_editor/markdown_editor_drop_zone.styles.js +6 -3
- package/lib/components/progress/progress.a11y.js +7 -7
- package/lib/components/progress/progress.js +18 -27
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +57 -21
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +9 -3
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +69 -0
- package/lib/global_styling/mixins/_button.js +1 -1
- package/lib/services/color/eui_palettes.js +26 -0
- package/lib/services/color/vis_color_store.js +1 -1
- package/lib/services/color/visualization_colors.js +3 -0
- package/lib/services/theme/provider.js +13 -6
- package/lib/themes/amsterdam/global_styling/variables/_colors.js +8 -3
- package/lib/themes/amsterdam/global_styling/variables/_forms.js +96 -53
- package/lib/themes/amsterdam/theme.js +2 -1
- package/lib/themes/json/eui_theme_amsterdam_dark.json +2 -0
- package/lib/themes/json/eui_theme_amsterdam_light.json +2 -0
- package/lib/themes/json/eui_theme_borealis_dark.json +2 -0
- package/lib/themes/json/eui_theme_borealis_light.json +10 -8
- package/optimize/es/components/combo_box/combo_box_input/combo_box_input.js +65 -61
- package/optimize/es/components/combo_box/combo_box_input/combo_box_input.styles.js +6 -4
- package/optimize/es/components/date_picker/date_picker.styles.js +4 -1
- package/optimize/es/components/date_picker/date_picker_range.js +3 -2
- package/optimize/es/components/date_picker/date_picker_range.styles.js +11 -4
- package/optimize/es/components/date_picker/super_date_picker/super_date_picker.styles.js +23 -14
- package/optimize/es/components/flyout/_flyout_close_button.styles.js +10 -1
- package/optimize/es/components/flyout/flyout_child.js +4 -3
- package/optimize/es/components/flyout/flyout_child.styles.js +3 -2
- package/optimize/es/components/flyout/sessions/flyout_provider.js +7 -21
- package/optimize/es/components/flyout/sessions/flyout_reducer.js +5 -26
- package/optimize/es/components/flyout/sessions/use_eui_flyout.js +21 -10
- package/optimize/es/components/form/field_number/field_number.styles.js +4 -1
- package/optimize/es/components/form/field_text/field_text.styles.js +4 -1
- package/optimize/es/components/form/file_picker/file_picker.js +107 -101
- package/optimize/es/components/form/file_picker/file_picker.styles.js +18 -17
- package/optimize/es/components/form/form.styles.js +72 -22
- package/optimize/es/components/form/form_control_layout/form_control_layout.styles.js +28 -17
- package/optimize/es/components/form/form_control_layout/form_control_layout_clear_button.styles.js +7 -7
- package/optimize/es/components/form/form_control_layout/form_control_layout_delimited.js +10 -7
- package/optimize/es/components/form/form_control_layout/form_control_layout_delimited.styles.js +34 -29
- package/optimize/es/components/form/form_control_layout/form_control_layout_icons.js +35 -20
- package/optimize/es/components/form/form_control_layout/form_control_layout_icons.styles.js +6 -6
- package/optimize/es/components/form/form_error_text/form_error_text.styles.js +3 -1
- package/optimize/es/components/form/form_label/form_label.styles.js +4 -2
- package/optimize/es/components/header/header.styles.js +5 -3
- package/optimize/es/components/markdown_editor/markdown_editor_drop_zone.styles.js +6 -3
- package/optimize/es/components/progress/progress.a11y.js +7 -7
- package/optimize/es/components/progress/progress.js +18 -27
- package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide.js +47 -22
- package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +8 -2
- package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +52 -0
- package/optimize/es/global_styling/mixins/_button.js +1 -1
- package/optimize/es/services/color/eui_palettes.js +26 -0
- package/optimize/es/services/color/vis_color_store.js +1 -1
- package/optimize/es/services/color/visualization_colors.js +4 -0
- package/optimize/es/services/theme/provider.js +13 -6
- package/optimize/es/themes/amsterdam/global_styling/variables/_colors.js +8 -3
- package/optimize/es/themes/amsterdam/global_styling/variables/_forms.js +96 -53
- package/optimize/es/themes/amsterdam/theme.js +2 -1
- package/optimize/es/themes/json/eui_theme_amsterdam_dark.json +2 -0
- package/optimize/es/themes/json/eui_theme_amsterdam_light.json +2 -0
- package/optimize/es/themes/json/eui_theme_borealis_dark.json +2 -0
- package/optimize/es/themes/json/eui_theme_borealis_light.json +10 -8
- package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.js +64 -60
- package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.styles.js +6 -4
- package/optimize/lib/components/date_picker/date_picker.styles.js +4 -1
- package/optimize/lib/components/date_picker/date_picker_range.js +3 -2
- package/optimize/lib/components/date_picker/date_picker_range.styles.js +11 -4
- package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.styles.js +21 -12
- package/optimize/lib/components/flyout/_flyout_close_button.styles.js +10 -3
- package/optimize/lib/components/flyout/flyout_child.js +4 -3
- package/optimize/lib/components/flyout/flyout_child.styles.js +3 -2
- package/optimize/lib/components/flyout/sessions/flyout_provider.js +7 -21
- package/optimize/lib/components/flyout/sessions/flyout_reducer.js +5 -26
- package/optimize/lib/components/flyout/sessions/use_eui_flyout.js +21 -10
- package/optimize/lib/components/form/field_number/field_number.styles.js +4 -1
- package/optimize/lib/components/form/field_text/field_text.styles.js +4 -1
- package/optimize/lib/components/form/file_picker/file_picker.js +106 -100
- package/optimize/lib/components/form/file_picker/file_picker.styles.js +16 -15
- package/optimize/lib/components/form/form.styles.js +72 -22
- package/optimize/lib/components/form/form_control_layout/form_control_layout.styles.js +28 -17
- package/optimize/lib/components/form/form_control_layout/form_control_layout_clear_button.styles.js +7 -7
- package/optimize/lib/components/form/form_control_layout/form_control_layout_delimited.js +9 -6
- package/optimize/lib/components/form/form_control_layout/form_control_layout_delimited.styles.js +34 -27
- package/optimize/lib/components/form/form_control_layout/form_control_layout_icons.js +34 -19
- package/optimize/lib/components/form/form_control_layout/form_control_layout_icons.styles.js +6 -6
- package/optimize/lib/components/form/form_error_text/form_error_text.styles.js +3 -1
- package/optimize/lib/components/form/form_label/form_label.styles.js +4 -2
- package/optimize/lib/components/header/header.styles.js +4 -2
- package/optimize/lib/components/markdown_editor/markdown_editor_drop_zone.styles.js +6 -3
- package/optimize/lib/components/progress/progress.a11y.js +7 -7
- package/optimize/lib/components/progress/progress.js +18 -27
- package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +45 -20
- package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +9 -3
- package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +58 -0
- package/optimize/lib/global_styling/mixins/_button.js +1 -1
- package/optimize/lib/services/color/eui_palettes.js +26 -0
- package/optimize/lib/services/color/vis_color_store.js +1 -1
- package/optimize/lib/services/color/visualization_colors.js +3 -0
- package/optimize/lib/services/theme/provider.js +13 -6
- package/optimize/lib/themes/amsterdam/global_styling/variables/_colors.js +8 -3
- package/optimize/lib/themes/amsterdam/global_styling/variables/_forms.js +96 -53
- package/optimize/lib/themes/amsterdam/theme.js +2 -1
- package/optimize/lib/themes/json/eui_theme_amsterdam_dark.json +2 -0
- package/optimize/lib/themes/json/eui_theme_amsterdam_light.json +2 -0
- package/optimize/lib/themes/json/eui_theme_borealis_dark.json +2 -0
- package/optimize/lib/themes/json/eui_theme_borealis_light.json +10 -8
- package/package.json +12 -10
- package/src/themes/amsterdam/_colors_dark.scss +3 -0
- package/src/themes/amsterdam/_colors_light.scss +3 -0
- package/test-env/components/combo_box/combo_box_input/combo_box_input.js +64 -60
- package/test-env/components/combo_box/combo_box_input/combo_box_input.styles.js +6 -4
- package/test-env/components/date_picker/date_picker.styles.js +4 -1
- package/test-env/components/date_picker/date_picker_range.js +3 -2
- package/test-env/components/date_picker/date_picker_range.styles.js +11 -4
- package/test-env/components/date_picker/super_date_picker/super_date_picker.styles.js +21 -12
- package/test-env/components/flyout/_flyout_close_button.styles.js +10 -3
- package/test-env/components/flyout/flyout_child.js +8 -3
- package/test-env/components/flyout/flyout_child.styles.js +3 -2
- package/test-env/components/flyout/sessions/flyout_provider.js +7 -21
- package/test-env/components/flyout/sessions/flyout_reducer.js +5 -26
- package/test-env/components/flyout/sessions/use_eui_flyout.js +21 -10
- package/test-env/components/form/field_number/field_number.styles.js +4 -1
- package/test-env/components/form/field_text/field_text.styles.js +4 -1
- package/test-env/components/form/file_picker/file_picker.js +106 -100
- package/test-env/components/form/file_picker/file_picker.styles.js +16 -15
- package/test-env/components/form/form.styles.js +72 -22
- package/test-env/components/form/form_control_layout/form_control_layout.styles.js +28 -17
- package/test-env/components/form/form_control_layout/form_control_layout_clear_button.styles.js +7 -7
- package/test-env/components/form/form_control_layout/form_control_layout_delimited.js +9 -6
- package/test-env/components/form/form_control_layout/form_control_layout_delimited.styles.js +34 -27
- package/test-env/components/form/form_control_layout/form_control_layout_icons.js +34 -19
- package/test-env/components/form/form_control_layout/form_control_layout_icons.styles.js +6 -6
- package/test-env/components/form/form_error_text/form_error_text.styles.js +3 -1
- package/test-env/components/form/form_label/form_label.styles.js +4 -2
- package/test-env/components/header/header.styles.js +4 -2
- package/test-env/components/markdown_editor/markdown_editor_drop_zone.styles.js +6 -3
- package/test-env/components/progress/progress.a11y.js +7 -7
- package/test-env/components/progress/progress.js +18 -27
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +57 -21
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +9 -3
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide_popover.js +68 -0
- package/test-env/global_styling/mixins/_button.js +1 -1
- package/test-env/services/color/eui_palettes.js +26 -0
- package/test-env/services/color/vis_color_store.js +1 -1
- package/test-env/services/color/visualization_colors.js +3 -0
- package/test-env/services/theme/provider.js +13 -6
- package/test-env/themes/amsterdam/global_styling/variables/_colors.js +8 -3
- package/test-env/themes/amsterdam/global_styling/variables/_forms.js +96 -53
- package/test-env/themes/amsterdam/theme.js +2 -1
- package/test-env/themes/json/eui_theme_amsterdam_dark.json +2 -0
- package/test-env/themes/json/eui_theme_amsterdam_light.json +2 -0
- package/test-env/themes/json/eui_theme_borealis_dark.json +2 -0
- package/test-env/themes/json/eui_theme_borealis_light.json +10 -8
|
@@ -11,11 +11,11 @@ import { css } from '@emotion/react';
|
|
|
11
11
|
import { logicalCSS, mathWithUnits } from '../../../global_styling';
|
|
12
12
|
import { euiFormVariables } from '../form.styles';
|
|
13
13
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
14
|
-
name: "
|
|
15
|
-
styles: "
|
|
14
|
+
name: "oaqulw-euiFormControlLayoutIcons",
|
|
15
|
+
styles: "position:relative;z-index:1;display:flex;align-items:center;pointer-events:none;label:euiFormControlLayoutIcons;"
|
|
16
16
|
} : {
|
|
17
|
-
name: "
|
|
18
|
-
styles: "
|
|
17
|
+
name: "oaqulw-euiFormControlLayoutIcons",
|
|
18
|
+
styles: "position:relative;z-index:1;display:flex;align-items:center;pointer-events:none;label:euiFormControlLayoutIcons;",
|
|
19
19
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
20
20
|
};
|
|
21
21
|
export var euiFormControlLayoutIconsStyles = function euiFormControlLayoutIconsStyles(euiThemeContext) {
|
|
@@ -38,11 +38,11 @@ export var euiFormControlLayoutIconsStyles = function euiFormControlLayoutIconsS
|
|
|
38
38
|
absolute: {
|
|
39
39
|
absolute: /*#__PURE__*/css("position:absolute;", logicalCSS('vertical', 0), ";;label:absolute;"),
|
|
40
40
|
uncompressed: {
|
|
41
|
-
left: /*#__PURE__*/css("z-index:
|
|
41
|
+
left: /*#__PURE__*/css("z-index:2;", logicalCSS('left', controlPadding), ";;label:left;"),
|
|
42
42
|
right: /*#__PURE__*/css(logicalCSS('right', controlPadding), ";;label:right;")
|
|
43
43
|
},
|
|
44
44
|
compressed: {
|
|
45
|
-
left: /*#__PURE__*/css("z-index:
|
|
45
|
+
left: /*#__PURE__*/css("z-index:2;", logicalCSS('left', controlCompressedPadding), ";;label:left;"),
|
|
46
46
|
right: /*#__PURE__*/css(logicalCSS('right', controlCompressedPadding), ";;label:right;")
|
|
47
47
|
}
|
|
48
48
|
},
|
|
@@ -7,10 +7,12 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { css } from '@emotion/react';
|
|
10
|
+
import { isEuiThemeRefreshVariant } from '../../../services';
|
|
10
11
|
import { euiFontSize, logicalCSS } from '../../../global_styling';
|
|
11
12
|
export var euiFormErrorTextStyles = function euiFormErrorTextStyles(euiThemeContext) {
|
|
12
13
|
var euiTheme = euiThemeContext.euiTheme;
|
|
14
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
13
15
|
return {
|
|
14
|
-
euiFormErrorText: /*#__PURE__*/css(logicalCSS('padding-top', euiTheme.size.xs), " ", euiFontSize(euiThemeContext, 'xs'), " color:", euiTheme.colors.danger, ";;label:euiFormErrorText;")
|
|
16
|
+
euiFormErrorText: /*#__PURE__*/css(logicalCSS('padding-top', euiTheme.size.xs), " ", euiFontSize(euiThemeContext, 'xs'), " color:", isRefreshVariant ? euiTheme.colors.textDanger : euiTheme.colors.danger, ";;label:euiFormErrorText;")
|
|
15
17
|
};
|
|
16
18
|
};
|
|
@@ -11,6 +11,7 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
11
11
|
|
|
12
12
|
import { css } from '@emotion/react';
|
|
13
13
|
import { serializeStyles } from '@emotion/serialize';
|
|
14
|
+
import { isEuiThemeRefreshVariant } from '../../../services';
|
|
14
15
|
import { euiCanAnimate, euiTextBreakWord } from '../../../global_styling';
|
|
15
16
|
import { euiTitle } from '../../title/title.styles';
|
|
16
17
|
export var euiFormLabel = function euiFormLabel(euiThemeContext) {
|
|
@@ -26,13 +27,14 @@ export var euiFormLabel = function euiFormLabel(euiThemeContext) {
|
|
|
26
27
|
};
|
|
27
28
|
export var euiFormLabelStyles = function euiFormLabelStyles(euiThemeContext) {
|
|
28
29
|
var euiTheme = euiThemeContext.euiTheme;
|
|
30
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
29
31
|
return {
|
|
30
32
|
euiFormLabel: /*#__PURE__*/css(euiFormLabel(euiThemeContext), " display:inline-block;", euiCanAnimate, "{transition:color ", euiTheme.animation.fast, " ", euiTheme.animation.resistance, ";};label:euiFormLabel;"),
|
|
31
33
|
// Skip css`` to avoid generating an extra Emotion className
|
|
32
34
|
// Use :where to reduce specificity & make the CSS easier to override by prepend/append nodes
|
|
33
35
|
notDisabled: "\n &:where([for]) {\n cursor: pointer;\n }\n ",
|
|
34
|
-
invalid: /*#__PURE__*/css("color:", euiTheme.colors.danger, ";;label:invalid;"),
|
|
36
|
+
invalid: /*#__PURE__*/css("color:", isRefreshVariant ? euiTheme.colors.textDanger : euiTheme.colors.danger, ";;label:invalid;"),
|
|
35
37
|
// Focused state should override invalid state
|
|
36
|
-
focused: /*#__PURE__*/css("color:", euiTheme.colors.primary, ";;label:focused;")
|
|
38
|
+
focused: /*#__PURE__*/css("color:", isRefreshVariant ? '' : euiTheme.colors.primary, ";;label:focused;")
|
|
37
39
|
};
|
|
38
40
|
};
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { css } from '@emotion/react';
|
|
10
10
|
import { euiShadowXSmall } from '@elastic/eui-theme-common';
|
|
11
11
|
import { logicalCSS } from '../../global_styling';
|
|
12
|
-
import { makeHighContrastColor } from '../../services';
|
|
12
|
+
import { isEuiThemeRefreshVariant, makeHighContrastColor } from '../../services';
|
|
13
13
|
export var euiHeaderVariables = function euiHeaderVariables(euiThemeContext) {
|
|
14
14
|
var euiTheme = euiThemeContext.euiTheme;
|
|
15
15
|
return {
|
|
@@ -47,6 +47,7 @@ import { euiFormVariables } from '../form/form.styles';
|
|
|
47
47
|
var euiHeaderDarkStyles = function euiHeaderDarkStyles(euiThemeContext) {
|
|
48
48
|
var euiTheme = euiThemeContext.euiTheme,
|
|
49
49
|
highContrastMode = euiThemeContext.highContrastMode;
|
|
50
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
50
51
|
var _euiFormVariables = euiFormVariables(euiThemeContext),
|
|
51
52
|
controlPlaceholderText = _euiFormVariables.controlPlaceholderText;
|
|
52
53
|
var backgroundColor = euiTheme.components.headerDarkBackground;
|
|
@@ -57,8 +58,9 @@ var euiHeaderDarkStyles = function euiHeaderDarkStyles(euiThemeContext) {
|
|
|
57
58
|
borderColor: euiTheme.components.headerDarkSearchBorderColor,
|
|
58
59
|
placeholderColor: makeHighContrastColor(controlPlaceholderText, 8)(backgroundColor)
|
|
59
60
|
};
|
|
60
|
-
|
|
61
|
+
var formLayoutStyles = "\n .euiSelectableTemplateSitewide .euiFormControlLayout {\n background-color: transparent;\n\n input {\n box-shadow: inset 0 0 0 ".concat(euiTheme.border.width.thin, " ").concat(selectableSitewide.borderColor, ";\n }\n\n &--group {\n border-color: ").concat(
|
|
61
62
|
// the header is in a faux dark mode, we can't rely on color
|
|
62
63
|
// switch tokens as they'd be in the wrong color mode
|
|
63
|
-
highContrastMode ? euiTheme.colors.plainLight : euiTheme.components.headerDarkSearchBorderColor, ";\n\n input {\n box-shadow: none;\n }\n }\n\n &__append {\n border-color: ").concat(highContrastMode ? euiTheme.colors.plainLight : '', "\n }\n\n &:not(:focus-within) {\n /* Increase contrast of filled text to be more than placeholder text */\n color: ").concat(selectableSitewide.color, ";\n\n input {\n /* Increase contrast of placeholder text */\n &::placeholder {\n color: ").concat(selectableSitewide.placeholderColor, ";\n }\n\n /* Inherit color from form control layout */\n color: inherit;\n background-color: transparent;\n }\n\n .euiFormControlLayout__append,\n .euiFormControlLayout__prepend {\n background-color: transparent;\n }\n\n .euiFormLabel {\n color: inherit;\n }\n }\n
|
|
64
|
+
highContrastMode ? euiTheme.colors.plainLight : euiTheme.components.headerDarkSearchBorderColor, ";\n\n input {\n box-shadow: none;\n }\n }\n\n &__append {\n border-color: ").concat(highContrastMode ? euiTheme.colors.plainLight : '', "\n }\n\n &:not(:focus-within) {\n /* Increase contrast of filled text to be more than placeholder text */\n color: ").concat(selectableSitewide.color, ";\n\n input {\n /* Increase contrast of placeholder text */\n &::placeholder {\n color: ").concat(selectableSitewide.placeholderColor, ";\n }\n\n /* Inherit color from form control layout */\n color: inherit;\n background-color: transparent;\n }\n\n .euiFormControlLayout__append,\n .euiFormControlLayout__prepend {\n background-color: transparent;\n }\n\n .euiFormLabel {\n color: inherit;\n }\n }\n }\n ");
|
|
65
|
+
return "\n background-color: ".concat(backgroundColor, ";\n\n .euiHeaderLogo__text,\n .euiHeaderLink,\n .euiHeaderSectionItemButton {\n color: ").concat(euiTheme.colors.ghost, ";\n }\n\n .euiHeaderLink-isActive {\n color: ").concat(makeHighContrastColor(euiTheme.colors.primary)(backgroundColor), ";\n }\n\n .euiHeaderLogo,\n .euiHeaderLink,\n .euiHeaderSectionItemButton {\n &:focus {\n background-color: ").concat(euiTheme.components.headerDarkSectionItemBackgroundFocus, ";\n }\n }\n\n .euiHeaderSectionItemButton__notification--badge {\n box-shadow: 0 0 0 ").concat(euiTheme.border.width.thin, " ").concat(backgroundColor, ";\n }\n\n .euiHeaderSectionItemButton__notification--dot {\n stroke: ").concat(backgroundColor, ";\n }\n\n ").concat(!isRefreshVariant && formLayoutStyles, " \n ");
|
|
64
66
|
};
|
|
@@ -8,8 +8,10 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
|
+
import { isEuiThemeRefreshVariant } from '../../services';
|
|
11
12
|
import { logicalCSS } from '../../global_styling';
|
|
12
13
|
import { euiMarkdownEditorVariables } from './markdown_editor.styles';
|
|
14
|
+
import { euiFormControlInvalidStyles } from '../form/form.styles';
|
|
13
15
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
14
16
|
name: "gwjnpv-euiMarkdownEditorDropZone__input",
|
|
15
17
|
styles: "position:absolute;inset:0;opacity:0;overflow:hidden;&:hover{cursor:pointer;}&:hover:disabled{cursor:not-allowed;};label:euiMarkdownEditorDropZone__input;"
|
|
@@ -20,13 +22,14 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
20
22
|
};
|
|
21
23
|
export var euiMarkdownEditorDropZoneStyles = function euiMarkdownEditorDropZoneStyles(euiThemeContext) {
|
|
22
24
|
var euiTheme = euiThemeContext.euiTheme;
|
|
25
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'formVariant');
|
|
23
26
|
var _euiMarkdownEditorVar = euiMarkdownEditorVariables(euiThemeContext),
|
|
24
27
|
minHeight = _euiMarkdownEditorVar.minHeight;
|
|
25
28
|
return {
|
|
26
29
|
euiMarkdownEditorDropZone: /*#__PURE__*/css("position:relative;display:flex;flex-direction:column;", logicalCSS('min-height', minHeight), ";;label:euiMarkdownEditorDropZone;"),
|
|
27
|
-
isDragging: /*#__PURE__*/css(".euiMarkdownEditorFooter,.euiMarkdownEditorTextArea{background-color:", euiTheme.colors.backgroundTransparentPrimary, "!important;};label:isDragging;"),
|
|
28
|
-
isDraggingError: /*#__PURE__*/css(".euiMarkdownEditorFooter,.euiMarkdownEditorTextArea{background-color:", euiTheme.colors.backgroundTransparentDanger, "!important;};label:isDraggingError;"),
|
|
29
|
-
hasError: /*#__PURE__*/css(".euiMarkdownEditorTextArea{--euiFormControlStateColor:", euiTheme.colors.danger, "
|
|
30
|
+
isDragging: /*#__PURE__*/css(".euiMarkdownEditorFooter,.euiMarkdownEditorTextArea{background-color:", isRefreshVariant ? euiTheme.colors.backgroundBasePrimary : euiTheme.colors.backgroundTransparentPrimary, "!important;};label:isDragging;"),
|
|
31
|
+
isDraggingError: /*#__PURE__*/css(".euiMarkdownEditorFooter,.euiMarkdownEditorTextArea{background-color:", isRefreshVariant ? euiTheme.colors.backgroundBaseDanger : euiTheme.colors.backgroundTransparentDanger, "!important;};label:isDraggingError;"),
|
|
32
|
+
hasError: /*#__PURE__*/css(".euiMarkdownEditorTextArea{--euiFormControlStateColor:", euiTheme.colors.danger, ";background-size:100% 100%;", isRefreshVariant && euiFormControlInvalidStyles(euiThemeContext), ";};label:hasError;"),
|
|
30
33
|
euiMarkdownEditorDropZone__input: _ref
|
|
31
34
|
};
|
|
32
35
|
};
|
|
@@ -72,13 +72,13 @@ describe('EuiProgress', function () {
|
|
|
72
72
|
cy.checkAxe();
|
|
73
73
|
});
|
|
74
74
|
it('displays correct progress values and labels', function () {
|
|
75
|
-
cy.get('div[data-test-subj="cy-progress-1"]
|
|
76
|
-
cy.get('div[data-test-subj="cy-progress-2"]
|
|
77
|
-
cy.get('div[data-test-subj="cy-progress-3"]
|
|
78
|
-
cy.get('div[data-test-subj="cy-progress-4"]
|
|
79
|
-
cy.get('div[data-test-subj="cy-progress-5"]
|
|
80
|
-
cy.get('div[data-test-subj="cy-progress-5"]
|
|
81
|
-
cy.get('div[data-test-subj="cy-progress-infinite"]
|
|
75
|
+
cy.get('div[data-test-subj="cy-progress-1"] div.euiProgress__valueText').contains('0');
|
|
76
|
+
cy.get('div[data-test-subj="cy-progress-2"] div.euiProgress__valueText').contains('33');
|
|
77
|
+
cy.get('div[data-test-subj="cy-progress-3"] div.euiProgress__valueText').contains('66');
|
|
78
|
+
cy.get('div[data-test-subj="cy-progress-4"] div.euiProgress__valueText').contains('100');
|
|
79
|
+
cy.get('div[data-test-subj="cy-progress-5"] div.euiProgress__label').contains('Basic percentage');
|
|
80
|
+
cy.get('div[data-test-subj="cy-progress-5"] div.euiProgress__valueText').contains('100');
|
|
81
|
+
cy.get('div[data-test-subj="cy-progress-infinite"] div.euiProgress__valueText').should('not.exist');
|
|
82
82
|
});
|
|
83
83
|
});
|
|
84
84
|
});
|
|
@@ -20,7 +20,6 @@ import React, { useState, useRef, useEffect } from 'react';
|
|
|
20
20
|
import PropTypes from "prop-types";
|
|
21
21
|
import classNames from 'classnames';
|
|
22
22
|
import { EuiI18n } from '../i18n';
|
|
23
|
-
import { EuiInnerText } from '../inner_text';
|
|
24
23
|
import { isNil } from '../../services/predicate';
|
|
25
24
|
import { useEuiTheme, makeHighContrastColor } from '../../services';
|
|
26
25
|
import { EuiScreenReaderOnly } from '../accessibility';
|
|
@@ -99,34 +98,26 @@ export var EuiProgress = function EuiProgress(_ref) {
|
|
|
99
98
|
return ___EmotionJSX(React.Fragment, null, label || valueText ? ___EmotionJSX("div", {
|
|
100
99
|
css: dataCssStyles,
|
|
101
100
|
className: "euiProgress__data"
|
|
102
|
-
}, label && ___EmotionJSX(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
_ref3 === null || _ref3 === void 0 || _ref3(node);
|
|
120
|
-
},
|
|
121
|
-
style: customTextColorStyles,
|
|
122
|
-
css: valueTextCssStyles,
|
|
123
|
-
className: "euiProgress__valueText",
|
|
124
|
-
"aria-hidden": "true"
|
|
125
|
-
}, valueRender);
|
|
126
|
-
})) : undefined, ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("div", {
|
|
101
|
+
}, label && ___EmotionJSX("div", _extends({
|
|
102
|
+
ref: function ref(node) {
|
|
103
|
+
labelRef.current = node;
|
|
104
|
+
}
|
|
105
|
+
}, labelProps, {
|
|
106
|
+
className: labelClasses,
|
|
107
|
+
css: labelCssStyles,
|
|
108
|
+
"aria-hidden": "true"
|
|
109
|
+
}), label), valueRender && ___EmotionJSX("div", {
|
|
110
|
+
ref: function ref(node) {
|
|
111
|
+
valueTextRef.current = node;
|
|
112
|
+
},
|
|
113
|
+
style: customTextColorStyles,
|
|
114
|
+
css: valueTextCssStyles,
|
|
115
|
+
className: "euiProgress__valueText",
|
|
116
|
+
"aria-hidden": "true"
|
|
117
|
+
}, valueRender)) : undefined, ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("div", {
|
|
127
118
|
"aria-live": "polite",
|
|
128
119
|
"aria-atomic": "true"
|
|
129
|
-
}, ___EmotionJSX("span", null, label &&
|
|
120
|
+
}, ___EmotionJSX("span", null, label && ___EmotionJSX(React.Fragment, null, labelText, " "), valueRender || value))), ___EmotionJSX("progress", _extends({
|
|
130
121
|
css: cssStyles,
|
|
131
122
|
className: classes,
|
|
132
123
|
style: customColorStyles,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
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); }
|
|
2
|
-
var _excluded = ["children", "className", "options", "popoverProps", "popoverTitle", "popoverFooter", "searchProps", "listProps", "isLoading", "popoverButton", "popoverButtonBreakpoints"],
|
|
2
|
+
var _excluded = ["children", "className", "options", "popoverProps", "popoverTitle", "popoverFooter", "searchProps", "listProps", "isLoading", "popoverButton", "popoverButtonBreakpoints", "colorModes"],
|
|
3
3
|
_excluded2 = ["closePopover", "panelRef", "width"];
|
|
4
4
|
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); }
|
|
5
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; }
|
|
@@ -23,22 +23,21 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
23
23
|
* Side Public License, v 1.
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
import React, { useState, useMemo, useCallback } from 'react';
|
|
26
|
+
import React, { useState, useMemo, useCallback, useContext } from 'react';
|
|
27
27
|
import PropTypes from "prop-types";
|
|
28
28
|
import classNames from 'classnames';
|
|
29
|
-
import { useCombinedRefs, useCurrentEuiBreakpoint, useEuiMemoizedStyles } from '../../../services';
|
|
29
|
+
import { COLOR_MODES_STANDARD, EuiNestedThemeContext, EuiThemeProvider, useCombinedRefs, useCurrentEuiBreakpoint, useEuiMemoizedStyles, useEuiTheme, useEuiThemeRefreshVariant } from '../../../services';
|
|
30
30
|
import { ENTER } from '../../../services/keys';
|
|
31
31
|
import { useEuiI18n, EuiI18n } from '../../i18n';
|
|
32
|
-
import { EuiPopoverTitle, EuiPopoverFooter } from '../../popover';
|
|
33
|
-
import { EuiPopover } from '../../popover/popover';
|
|
34
32
|
import { EuiLoadingSpinner } from '../../loading';
|
|
35
|
-
import { EuiSpacer } from '../../spacer';
|
|
36
33
|
import { EuiSelectable } from '../selectable';
|
|
37
34
|
import { EuiSelectableMessage } from '../selectable_message';
|
|
38
35
|
import { euiSelectableTemplateSitewideFormatOptions, euiSelectableTemplateSitewideRenderOptions } from './selectable_template_sitewide_option';
|
|
39
36
|
import { euiSelectableTemplateSitewideStyles } from './selectable_template_sitewide.styles';
|
|
37
|
+
import { EuiSelectableTemplateSitewidePopover } from './selectable_template_sitewide_popover';
|
|
40
38
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
41
39
|
export var EuiSelectableTemplateSitewide = function EuiSelectableTemplateSitewide(_ref) {
|
|
40
|
+
var _colorModes$search, _colorModes$popover;
|
|
42
41
|
var children = _ref.children,
|
|
43
42
|
className = _ref.className,
|
|
44
43
|
options = _ref.options,
|
|
@@ -50,7 +49,30 @@ export var EuiSelectableTemplateSitewide = function EuiSelectableTemplateSitewid
|
|
|
50
49
|
isLoading = _ref.isLoading,
|
|
51
50
|
popoverButton = _ref.popoverButton,
|
|
52
51
|
popoverButtonBreakpoints = _ref.popoverButtonBreakpoints,
|
|
52
|
+
_ref$colorModes = _ref.colorModes,
|
|
53
|
+
colorModes = _ref$colorModes === void 0 ? {
|
|
54
|
+
search: 'default',
|
|
55
|
+
popover: 'default'
|
|
56
|
+
} : _ref$colorModes,
|
|
53
57
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
58
|
+
var _useEuiTheme = useEuiTheme(),
|
|
59
|
+
colorMode = _useEuiTheme.colorMode;
|
|
60
|
+
var isRefreshVariant = useEuiThemeRefreshVariant('formVariant');
|
|
61
|
+
var _useContext = useContext(EuiNestedThemeContext),
|
|
62
|
+
hasDifferentColorFromGlobalTheme = _useContext.hasDifferentColorFromGlobalTheme;
|
|
63
|
+
var _searchColorMode = colorModes === null || colorModes === void 0 || (_colorModes$search = colorModes.search) === null || _colorModes$search === void 0 ? void 0 : _colorModes$search.toLowerCase();
|
|
64
|
+
var _popoverColorMode = colorModes === null || colorModes === void 0 || (_colorModes$popover = colorModes.popover) === null || _colorModes$popover === void 0 ? void 0 : _colorModes$popover.toLowerCase();
|
|
65
|
+
var searchColorMode = useMemo(function () {
|
|
66
|
+
var isStaticTheme = [COLOR_MODES_STANDARD.light.toLowerCase(), COLOR_MODES_STANDARD.dark.toLowerCase()].includes(_searchColorMode);
|
|
67
|
+
return isStaticTheme ? _searchColorMode : _searchColorMode === 'inverse' ? colorMode === COLOR_MODES_STANDARD.dark ? COLOR_MODES_STANDARD.light : COLOR_MODES_STANDARD.dark : colorMode;
|
|
68
|
+
}, [colorMode, _searchColorMode]);
|
|
69
|
+
var popoverColorMode = useMemo(function () {
|
|
70
|
+
var isStaticTheme = [COLOR_MODES_STANDARD.light.toLowerCase(), COLOR_MODES_STANDARD.dark.toLowerCase()].includes(_popoverColorMode);
|
|
71
|
+
var inverseColorMode = colorMode === COLOR_MODES_STANDARD.dark ? COLOR_MODES_STANDARD.light : COLOR_MODES_STANDARD.dark;
|
|
72
|
+
var globalColorMode = hasDifferentColorFromGlobalTheme ? colorMode === COLOR_MODES_STANDARD.dark ? COLOR_MODES_STANDARD.light : COLOR_MODES_STANDARD.dark : colorMode;
|
|
73
|
+
return isStaticTheme ? _popoverColorMode : _popoverColorMode === 'inverse' ? inverseColorMode : _popoverColorMode === 'global' ? globalColorMode : colorMode;
|
|
74
|
+
}, [hasDifferentColorFromGlobalTheme, colorMode, _popoverColorMode]);
|
|
75
|
+
|
|
54
76
|
/**
|
|
55
77
|
* i18n text
|
|
56
78
|
*/
|
|
@@ -204,25 +226,28 @@ export var EuiSelectableTemplateSitewide = function EuiSelectableTemplateSitewid
|
|
|
204
226
|
}, rest, {
|
|
205
227
|
searchable: true
|
|
206
228
|
}), function (list, search) {
|
|
207
|
-
|
|
208
|
-
|
|
229
|
+
var _search = isRefreshVariant && !popoverTrigger ? ___EmotionJSX(EuiThemeProvider, {
|
|
230
|
+
colorMode: searchColorMode
|
|
231
|
+
}, search) : search;
|
|
232
|
+
|
|
233
|
+
// uses standalone subcomponent to ensure scoped style/theme context
|
|
234
|
+
var popover = ___EmotionJSX(EuiSelectableTemplateSitewidePopover, _extends({
|
|
209
235
|
isOpen: popoverIsOpen,
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
236
|
+
trigger: popoverTrigger,
|
|
237
|
+
search: _search,
|
|
238
|
+
list: list,
|
|
239
|
+
title: popoverTitle,
|
|
240
|
+
footer: popoverFooter,
|
|
241
|
+
width: popoverWidth,
|
|
213
242
|
panelRef: setPanelRef,
|
|
214
|
-
button: popoverTrigger ? popoverTrigger : search,
|
|
215
243
|
closePopover: closePopover
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}, popoverTitle, popoverTitle && search && ___EmotionJSX(EuiSpacer, null), search) : undefined, list, popoverFooter && ___EmotionJSX(EuiPopoverFooter, {
|
|
224
|
-
paddingSize: "s"
|
|
225
|
-
}, popoverFooter)));
|
|
244
|
+
}, popoverRest));
|
|
245
|
+
return isRefreshVariant ? ___EmotionJSX(EuiThemeProvider, {
|
|
246
|
+
wrapperProps: {
|
|
247
|
+
cloneElement: true
|
|
248
|
+
},
|
|
249
|
+
colorMode: popoverColorMode
|
|
250
|
+
}, popover) : popover;
|
|
226
251
|
});
|
|
227
252
|
};
|
|
228
253
|
EuiSelectableTemplateSitewide.propTypes = {
|
|
@@ -441,5 +466,16 @@ EuiSelectableTemplateSitewide.propTypes = {
|
|
|
441
466
|
* Pass an array of named breakpoints for which to show the `popoverButton`.
|
|
442
467
|
* If `undefined`, the `popoverButton` will always show (if provided)
|
|
443
468
|
*/
|
|
444
|
-
popoverButtonBreakpoints: PropTypes.arrayOf(PropTypes.any.isRequired)
|
|
469
|
+
popoverButtonBreakpoints: PropTypes.arrayOf(PropTypes.any.isRequired),
|
|
470
|
+
/**
|
|
471
|
+
* Manually sets the color mode for the search input and popover. It supports the common `colorMode`
|
|
472
|
+
* values: `light`, `dark`, `inverse` and additionally `default` and `global`.
|
|
473
|
+
*
|
|
474
|
+
* `default` applies the local (nearest) context `colorMode`.
|
|
475
|
+
* `global` applies the global context `colorMode`
|
|
476
|
+
*/
|
|
477
|
+
colorModes: PropTypes.shape({
|
|
478
|
+
search: PropTypes.oneOfType([PropTypes.oneOf(["default", "global"]), PropTypes.any.isRequired]).isRequired,
|
|
479
|
+
popover: PropTypes.oneOfType([PropTypes.oneOf(["default", "global"]), PropTypes.any.isRequired]).isRequired
|
|
480
|
+
})
|
|
445
481
|
};
|
package/es/components/selectable/selectable_templates/selectable_template_sitewide.styles.js
CHANGED
|
@@ -33,8 +33,8 @@ export var euiSelectableTemplateSitewideStyles = function euiSelectableTemplateS
|
|
|
33
33
|
euiSelectableTemplateSitewide: _ref2,
|
|
34
34
|
// Override EuiSelectable's default item underline
|
|
35
35
|
euiSelectableTemplateSitewide__listItem: _ref,
|
|
36
|
-
euiSelectableTemplateSitewide__optionMetasList: /*#__PURE__*/css("display:block;", logicalCSS('margin-top', euiTheme.size.xs), " ", euiFontSize(euiThemeContext, 'xs'), " color:", euiTheme.colors.
|
|
37
|
-
euiSelectableTemplateSitewide__optionMeta: /*#__PURE__*/css("&:not(:last-of-type)::after{content:'\u2022';", logicalCSS('margin-horizontal', euiTheme.size.xs), " color:", euiTheme.colors.
|
|
36
|
+
euiSelectableTemplateSitewide__optionMetasList: /*#__PURE__*/css("display:block;", logicalCSS('margin-top', euiTheme.size.xs), " ", euiFontSize(euiThemeContext, 'xs'), " color:", euiTheme.colors.textSubdued, ";;label:euiSelectableTemplateSitewide__optionMetasList;"),
|
|
37
|
+
euiSelectableTemplateSitewide__optionMeta: /*#__PURE__*/css("&:not(:last-of-type)::after{content:'\u2022';", logicalCSS('margin-horizontal', euiTheme.size.xs), " color:", euiTheme.colors.textSubdued, ";};label:euiSelectableTemplateSitewide__optionMeta;"),
|
|
38
38
|
metaTypes: {
|
|
39
39
|
fontWeight: "\n font-weight: ".concat(euiTheme.font.weight.medium, ";\n "),
|
|
40
40
|
application: /*#__PURE__*/css("color:", makeHighContrastColor(visColors[1])(euiTheme), ";;label:application;"),
|
|
@@ -44,4 +44,10 @@ export var euiSelectableTemplateSitewideStyles = function euiSelectableTemplateS
|
|
|
44
44
|
platform: /*#__PURE__*/css("color:", makeHighContrastColor(visColors[5])(euiTheme), ";;label:platform;")
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
|
+
};
|
|
48
|
+
export var euiSelectableTemplateSitewidePopoverStyles = function euiSelectableTemplateSitewidePopoverStyles(euiThemeContext) {
|
|
49
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
50
|
+
return {
|
|
51
|
+
euiSelectableTemplateSitewide__popover: /*#__PURE__*/css("color:", euiTheme.colors.textParagraph, ";;label:euiSelectableTemplateSitewide__popover;")
|
|
52
|
+
};
|
|
47
53
|
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
var _excluded = ["trigger", "search", "list", "title", "footer", "width", "isOpen", "panelRef", "closePopover"];
|
|
2
|
+
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); }
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
/*
|
|
6
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
7
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
8
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
9
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
10
|
+
* Side Public License, v 1.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import PropTypes from "prop-types";
|
|
15
|
+
import { useEuiMemoizedStyles } from '../../../services';
|
|
16
|
+
import { EuiPopover, EuiPopoverFooter, EuiPopoverTitle } from '../../popover';
|
|
17
|
+
import { EuiSpacer } from '../../spacer';
|
|
18
|
+
import { euiSelectableTemplateSitewidePopoverStyles } from './selectable_template_sitewide.styles';
|
|
19
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
20
|
+
export var EuiSelectableTemplateSitewidePopover = function EuiSelectableTemplateSitewidePopover(_ref) {
|
|
21
|
+
var trigger = _ref.trigger,
|
|
22
|
+
search = _ref.search,
|
|
23
|
+
list = _ref.list,
|
|
24
|
+
title = _ref.title,
|
|
25
|
+
footer = _ref.footer,
|
|
26
|
+
width = _ref.width,
|
|
27
|
+
isOpen = _ref.isOpen,
|
|
28
|
+
panelRef = _ref.panelRef,
|
|
29
|
+
closePopover = _ref.closePopover,
|
|
30
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
31
|
+
var styles = useEuiMemoizedStyles(euiSelectableTemplateSitewidePopoverStyles);
|
|
32
|
+
return ___EmotionJSX(EuiPopover, _extends({
|
|
33
|
+
panelPaddingSize: "none",
|
|
34
|
+
isOpen: isOpen,
|
|
35
|
+
ownFocus: !!trigger,
|
|
36
|
+
display: trigger ? 'inline-block' : 'block'
|
|
37
|
+
}, rest, {
|
|
38
|
+
panelRef: panelRef,
|
|
39
|
+
button: trigger ? trigger : search,
|
|
40
|
+
closePopover: closePopover,
|
|
41
|
+
panelProps: {
|
|
42
|
+
css: styles.euiSelectableTemplateSitewide__popover
|
|
43
|
+
}
|
|
44
|
+
}), ___EmotionJSX("div", {
|
|
45
|
+
style: {
|
|
46
|
+
width: width,
|
|
47
|
+
maxWidth: '100%'
|
|
48
|
+
}
|
|
49
|
+
}, title || trigger ? ___EmotionJSX(EuiPopoverTitle, {
|
|
50
|
+
paddingSize: "s"
|
|
51
|
+
}, title, title && search && ___EmotionJSX(EuiSpacer, null), search) : undefined, list, footer && ___EmotionJSX(EuiPopoverFooter, {
|
|
52
|
+
paddingSize: "s"
|
|
53
|
+
}, footer)));
|
|
54
|
+
};
|
|
55
|
+
EuiSelectableTemplateSitewidePopover.propTypes = {
|
|
56
|
+
search: PropTypes.node.isRequired,
|
|
57
|
+
list: PropTypes.node.isRequired,
|
|
58
|
+
trigger: PropTypes.node,
|
|
59
|
+
title: PropTypes.node,
|
|
60
|
+
footer: PropTypes.node,
|
|
61
|
+
width: PropTypes.any.isRequired,
|
|
62
|
+
isOpen: PropTypes.bool.isRequired
|
|
63
|
+
};
|
|
@@ -195,7 +195,7 @@ export var euiButtonSizeMap = function euiButtonSizeMap(euiThemeContext) {
|
|
|
195
195
|
minWidth: euiTheme.base * (isRefreshVariant ? 6 : 7),
|
|
196
196
|
height: euiTheme.size.l,
|
|
197
197
|
radius: euiTheme.border.radius.small,
|
|
198
|
-
fontScale: 'xs'
|
|
198
|
+
fontScale: isRefreshVariant ? 's' : 'xs'
|
|
199
199
|
},
|
|
200
200
|
s: {
|
|
201
201
|
minWidth: euiTheme.base * (isRefreshVariant ? 6 : 7),
|
|
@@ -31,6 +31,8 @@ var euiPalette = function euiPalette(colors, steps) {
|
|
|
31
31
|
return colorPalette(colors, steps, diverge, categorical);
|
|
32
32
|
};
|
|
33
33
|
/**
|
|
34
|
+
* For usage in React use the `useEuiPaletteColorBlind` hook instead.
|
|
35
|
+
*
|
|
34
36
|
* NOTE: These functions rely on base vis colors of the theme which are provided via a global
|
|
35
37
|
* singleton instance `EUI_VIS_COLOR_STORE` that's updated by the EuiProvider on theme change.
|
|
36
38
|
* Make sure the function is recalled on theme change to retrieve theme-related colors.
|
|
@@ -97,6 +99,8 @@ export var euiPaletteColorBlind = function euiPaletteColorBlind() {
|
|
|
97
99
|
};
|
|
98
100
|
|
|
99
101
|
/**
|
|
102
|
+
* For usage in React use the `useEuiPaletteColorBlindBehindText` hook instead.
|
|
103
|
+
*
|
|
100
104
|
* Color blind palette with text is meant for use when text is applied on top of the color.
|
|
101
105
|
* It increases the brightness of the color to give the text more contrast.
|
|
102
106
|
*
|
|
@@ -155,6 +159,8 @@ export var euiPaletteForDarkBackground = function euiPaletteForDarkBackground()
|
|
|
155
159
|
};
|
|
156
160
|
|
|
157
161
|
/**
|
|
162
|
+
* For usage in React use the `useEuiPaletteForStatus` hook instead.
|
|
163
|
+
*
|
|
158
164
|
* NOTE: This function is not pure. It relies on `EUI_VIS_COLOR_STORE` which is updated by the
|
|
159
165
|
* EuiProvider on theme change. Ensure to recall the function on theme change or subscribe to the store.
|
|
160
166
|
*/
|
|
@@ -172,6 +178,8 @@ export var euiPaletteForStatus = function euiPaletteForStatus(steps) {
|
|
|
172
178
|
};
|
|
173
179
|
|
|
174
180
|
/**
|
|
181
|
+
* For usage in React use the `useEuiPaletteForTemperature` hook instead.
|
|
182
|
+
*
|
|
175
183
|
* NOTE: This function is not pure. It relies on `EUI_VIS_COLOR_STORE` which is updated by the
|
|
176
184
|
* EuiProvider on theme change. Ensure to recall the function on theme change or subscribe to the store.
|
|
177
185
|
*/
|
|
@@ -193,6 +201,8 @@ export var euiPaletteForTemperature = function euiPaletteForTemperature(steps) {
|
|
|
193
201
|
};
|
|
194
202
|
|
|
195
203
|
/**
|
|
204
|
+
* For usage in React use the `useEuiPaletteComplementary` hook instead.
|
|
205
|
+
*
|
|
196
206
|
* NOTE: This function is not pure. It relies on `EUI_VIS_COLOR_STORE` which is updated by the
|
|
197
207
|
* EuiProvider on theme change. Ensure to recall the function on theme change or subscribe to the store.
|
|
198
208
|
*/
|
|
@@ -210,6 +220,8 @@ export var euiPaletteComplementary = function euiPaletteComplementary(steps) {
|
|
|
210
220
|
};
|
|
211
221
|
|
|
212
222
|
/**
|
|
223
|
+
* For usage in React use the `useEuiPaletteRed` hook instead.
|
|
224
|
+
*
|
|
213
225
|
* NOTE: This function is not pure. It relies on `EUI_VIS_COLOR_STORE` which is updated by the
|
|
214
226
|
* EuiProvider on theme change. Ensure to recall the function on theme change or subscribe to the store.
|
|
215
227
|
*/
|
|
@@ -224,6 +236,8 @@ export var euiPaletteRed = function euiPaletteRed(steps) {
|
|
|
224
236
|
};
|
|
225
237
|
|
|
226
238
|
/**
|
|
239
|
+
* For usage in React use the `useEuiPaletteGreen` hook instead.
|
|
240
|
+
*
|
|
227
241
|
* NOTE: This function is not pure. It relies on `EUI_VIS_COLOR_STORE` which is updated by the
|
|
228
242
|
* EuiProvider on theme change. Ensure to recall the function on theme change or subscribe to the store.
|
|
229
243
|
*/
|
|
@@ -238,6 +252,8 @@ export var euiPaletteGreen = function euiPaletteGreen(steps) {
|
|
|
238
252
|
};
|
|
239
253
|
|
|
240
254
|
/**
|
|
255
|
+
* For usage in React use the `useEuiPaletteSkyBlue` hook instead.
|
|
256
|
+
*
|
|
241
257
|
* NOTE: This function is not pure. It relies on `EUI_VIS_COLOR_STORE` which is updated by the
|
|
242
258
|
* EuiProvider on theme change. Ensure to recall the function on theme change or subscribe to the store.
|
|
243
259
|
*/
|
|
@@ -252,6 +268,8 @@ export var euiPaletteSkyBlue = function euiPaletteSkyBlue(steps) {
|
|
|
252
268
|
};
|
|
253
269
|
|
|
254
270
|
/**
|
|
271
|
+
* For usage in React use the `useEuiPaletteYellow` hook instead.
|
|
272
|
+
*
|
|
255
273
|
* NOTE: This function is not pure. It relies on `EUI_VIS_COLOR_STORE` which is updated by the
|
|
256
274
|
* EuiProvider on theme change. Ensure to recall the function on theme change or subscribe to the store.
|
|
257
275
|
*/
|
|
@@ -266,6 +284,8 @@ export var euiPaletteYellow = function euiPaletteYellow(steps) {
|
|
|
266
284
|
};
|
|
267
285
|
|
|
268
286
|
/**
|
|
287
|
+
* For usage in React use the `useEuiPaletteOrange` hook instead.
|
|
288
|
+
*
|
|
269
289
|
* NOTE: This function is not pure. It relies on `EUI_VIS_COLOR_STORE` which is updated by the
|
|
270
290
|
* EuiProvider on theme change. Ensure to recall the function on theme change or subscribe to the store.
|
|
271
291
|
*/
|
|
@@ -280,6 +300,8 @@ export var euiPaletteOrange = function euiPaletteOrange(steps) {
|
|
|
280
300
|
};
|
|
281
301
|
|
|
282
302
|
/**
|
|
303
|
+
* For usage in React use the `useEuiPaletteCool` hook instead.
|
|
304
|
+
*
|
|
283
305
|
* NOTE: This function is not pure. It relies on `EUI_VIS_COLOR_STORE` which is updated by the
|
|
284
306
|
* EuiProvider on theme change. Ensure to recall the function on theme change or subscribe to the store.
|
|
285
307
|
*/
|
|
@@ -296,6 +318,8 @@ export var euiPaletteCool = function euiPaletteCool(steps) {
|
|
|
296
318
|
};
|
|
297
319
|
|
|
298
320
|
/**
|
|
321
|
+
* For usage in React use the `useEuiPaletteWarm` hook instead.
|
|
322
|
+
*
|
|
299
323
|
* NOTE: This function is not pure. It relies on `EUI_VIS_COLOR_STORE` which is updated by the
|
|
300
324
|
* EuiProvider on theme change. Ensure to recall the function on theme change or subscribe to the store.
|
|
301
325
|
*/
|
|
@@ -310,6 +334,8 @@ export var euiPaletteWarm = function euiPaletteWarm(steps) {
|
|
|
310
334
|
};
|
|
311
335
|
|
|
312
336
|
/**
|
|
337
|
+
* For usage in React use the `useEuiPaletteGray` hook instead.
|
|
338
|
+
*
|
|
313
339
|
* NOTE: This function is not pure. It relies on `EUI_VIS_COLOR_STORE` which is updated by the
|
|
314
340
|
* EuiProvider on theme change. Ensure to recall the function on theme change or subscribe to the store.
|
|
315
341
|
*/
|
|
@@ -10,4 +10,4 @@ import { EuiVisColorStore } from '@elastic/eui-theme-common';
|
|
|
10
10
|
import { colorVis } from '@elastic/eui-theme-borealis';
|
|
11
11
|
|
|
12
12
|
// initialsetup of Vis color storage with default colors
|
|
13
|
-
export var EUI_VIS_COLOR_STORE = EuiVisColorStore.getInstance(colorVis,
|
|
13
|
+
export var EUI_VIS_COLOR_STORE = EuiVisColorStore.getInstance(colorVis, false);
|
|
@@ -9,5 +9,9 @@
|
|
|
9
9
|
// Array of color-blind safe colors to use in visualizations or other
|
|
10
10
|
// spots that need a large range of varied, qualitative colors.
|
|
11
11
|
import { euiPaletteColorBlind } from '../../services/color/eui_palettes';
|
|
12
|
+
|
|
13
|
+
/** @deprecated - use the data vis colors on `euiTheme.colors.vis` instead */
|
|
12
14
|
export var VISUALIZATION_COLORS = euiPaletteColorBlind();
|
|
15
|
+
|
|
16
|
+
/** @deprecated - use the data vis colors on `euiTheme.colors.vis` instead */
|
|
13
17
|
export var DEFAULT_VISUALIZATION_COLOR = VISUALIZATION_COLORS[1];
|
|
@@ -95,14 +95,16 @@ export var EuiThemeProvider = function EuiThemeProvider(_ref) {
|
|
|
95
95
|
modifications: modifications
|
|
96
96
|
});
|
|
97
97
|
var isParentTheme = useRef(isGlobalTheme ? prevSystemKey.current === DEFAULTS.system.key && colorMode === DEFAULTS.colorMode && highContrastMode === DEFAULTS.highContrastMode && !_modifications : prevSystemKey.current === parentSystem.key && colorMode === parentColorMode && highContrastMode === parentHighContrastMode && isEqual(parentModifications, modifications));
|
|
98
|
-
var updateVisColorStore = useCallback(function (theme) {
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
var updateVisColorStore = useCallback(function (theme, isGlobalTheme) {
|
|
99
|
+
if (isGlobalTheme) {
|
|
100
|
+
var _theme$flags$hasVisCo, _theme$flags;
|
|
101
|
+
EUI_VIS_COLOR_STORE.setVisColors(theme.colors.vis, (_theme$flags$hasVisCo = (_theme$flags = theme.flags) === null || _theme$flags === void 0 ? void 0 : _theme$flags.hasVisColorAdjustment) !== null && _theme$flags$hasVisCo !== void 0 ? _theme$flags$hasVisCo : true);
|
|
102
|
+
}
|
|
101
103
|
}, []);
|
|
102
104
|
var getInitialTheme = function getInitialTheme() {
|
|
103
105
|
var theme = getComputed(system, buildTheme(modificationsWithHighContrast, "_".concat(system.key)), colorMode, highContrastMode);
|
|
104
106
|
setTimeout(function () {
|
|
105
|
-
updateVisColorStore(theme);
|
|
107
|
+
updateVisColorStore(theme, isGlobalTheme);
|
|
106
108
|
});
|
|
107
109
|
return theme;
|
|
108
110
|
};
|
|
@@ -117,9 +119,11 @@ export var EuiThemeProvider = function EuiThemeProvider(_ref) {
|
|
|
117
119
|
setSystem(newSystem);
|
|
118
120
|
prevSystemKey.current = newSystem.key;
|
|
119
121
|
isParentTheme.current = false;
|
|
120
|
-
updateVisColorStore(theme);
|
|
121
122
|
}
|
|
122
123
|
}, [_system, parentSystem, theme, updateVisColorStore]);
|
|
124
|
+
useEffect(function () {
|
|
125
|
+
updateVisColorStore(theme, isGlobalTheme);
|
|
126
|
+
}, [theme, colorMode, isGlobalTheme, updateVisColorStore]);
|
|
123
127
|
useEffect(function () {
|
|
124
128
|
var newModifications = mergeDeep(parentModifications, _modifications);
|
|
125
129
|
if (!isEqual(prevModifications.current, newModifications)) {
|
|
@@ -143,12 +147,15 @@ export var EuiThemeProvider = function EuiThemeProvider(_ref) {
|
|
|
143
147
|
}, [highContrastMode]);
|
|
144
148
|
useEffect(function () {
|
|
145
149
|
if (!isParentTheme.current) {
|
|
146
|
-
/* Enables recomputation of component colors when flags are overridden on the provider
|
|
150
|
+
/* Enables recomputation of component colors when flags are overridden on the provider
|
|
147
151
|
by adding the respective key to modifications to trigger a recomputation. */
|
|
148
152
|
// TODO: remove once visual refresh is completed and flags are obsolete
|
|
149
153
|
var flagsToRecompute = [{
|
|
150
154
|
flag: 'buttonVariant',
|
|
151
155
|
componentKey: 'buttons'
|
|
156
|
+
}, {
|
|
157
|
+
flag: 'formVariant',
|
|
158
|
+
componentKey: 'forms'
|
|
152
159
|
}];
|
|
153
160
|
var keys = {};
|
|
154
161
|
var forceRecomputeComponents = flagsToRecompute.some(function (item) {
|