@elastic/eui 102.2.0 → 102.3.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_borealis_dark.json +1 -1
- package/es/components/badge/color_utils.js +1 -3
- package/es/components/badge/notification_badge/badge_notification.styles.js +6 -1
- package/es/components/basic_table/basic_table.js +4 -1
- package/es/components/basic_table/in_memory_table.js +4 -1
- package/es/components/breadcrumbs/_breadcrumb_content.styles.js +6 -3
- package/es/components/button/button_display/_button_display.js +1 -1
- package/es/components/button/button_display/_button_display.styles.js +11 -2
- package/es/components/button/button_display/_button_display_content.styles.js +6 -3
- package/es/components/button/button_empty/button_empty.styles.js +9 -12
- package/es/components/button/button_group/button_group.styles.js +5 -3
- package/es/components/button/button_group/button_group_button.js +19 -9
- package/es/components/button/button_group/button_group_button.styles.js +43 -19
- package/es/components/button/button_icon/button_icon.js +4 -2
- package/es/components/collapsible_nav/collapsible_nav.js +1 -0
- package/es/components/datagrid/controls/data_grid_toolbar_control.js +11 -1
- package/es/components/datagrid/utils/focus.js +2 -2
- package/es/components/filter_group/filter_button.js +88 -23
- package/es/components/filter_group/filter_button.styles.js +51 -15
- package/es/components/filter_group/filter_group.styles.js +18 -6
- package/es/components/markdown_editor/markdown_editor_footer.js +9 -4
- package/es/components/search_bar/filters/field_value_selection_filter.js +1 -0
- package/es/components/search_bar/filters/field_value_toggle_filter.js +3 -1
- package/es/components/search_bar/filters/field_value_toggle_group_filter.js +3 -1
- package/es/components/search_bar/filters/is_filter.js +3 -1
- package/es/components/search_bar/search_bar.a11y.js +3 -3
- package/es/global_styling/mixins/_button.js +95 -28
- package/es/services/theme/index.js +2 -1
- package/es/services/theme/provider.js +28 -2
- package/es/services/theme/theme_variant.js +22 -0
- package/es/themes/amsterdam/global_styling/variables/_buttons.js +348 -147
- package/es/themes/amsterdam/global_styling/variables/_components.js +229 -224
- package/es/themes/amsterdam/theme.js +2 -1
- package/es/themes/json/eui_theme_borealis_dark.json +1 -1
- package/eui.d.ts +194 -161
- package/lib/components/badge/color_utils.js +1 -3
- package/lib/components/badge/notification_badge/badge_notification.styles.js +6 -1
- package/lib/components/basic_table/basic_table.js +4 -1
- package/lib/components/basic_table/in_memory_table.js +4 -1
- package/lib/components/breadcrumbs/_breadcrumb_content.styles.js +5 -2
- package/lib/components/button/button_display/_button_display.js +1 -1
- package/lib/components/button/button_display/_button_display.styles.js +11 -2
- package/lib/components/button/button_display/_button_display_content.styles.js +6 -3
- package/lib/components/button/button_empty/button_empty.styles.js +10 -11
- package/lib/components/button/button_group/button_group.styles.js +5 -3
- package/lib/components/button/button_group/button_group_button.js +18 -8
- package/lib/components/button/button_group/button_group_button.styles.js +41 -17
- package/lib/components/button/button_icon/button_icon.js +3 -1
- package/lib/components/collapsible_nav/collapsible_nav.js +1 -0
- package/lib/components/datagrid/controls/data_grid_toolbar_control.js +11 -1
- package/lib/components/datagrid/utils/focus.js +1 -1
- package/lib/components/filter_group/filter_button.js +86 -21
- package/lib/components/filter_group/filter_button.styles.js +51 -15
- package/lib/components/filter_group/filter_group.styles.js +18 -6
- package/lib/components/markdown_editor/markdown_editor_footer.js +8 -3
- package/lib/components/search_bar/filters/field_value_selection_filter.js +1 -0
- package/lib/components/search_bar/filters/field_value_toggle_filter.js +3 -1
- package/lib/components/search_bar/filters/field_value_toggle_group_filter.js +3 -1
- package/lib/components/search_bar/filters/is_filter.js +3 -1
- package/lib/components/search_bar/search_bar.a11y.js +3 -3
- package/lib/global_styling/mixins/_button.js +94 -27
- package/lib/services/theme/index.js +42 -1
- package/lib/services/theme/provider.js +28 -2
- package/lib/services/theme/theme_variant.js +28 -0
- package/lib/themes/amsterdam/global_styling/variables/_buttons.js +348 -147
- package/lib/themes/amsterdam/global_styling/variables/_components.js +229 -224
- package/lib/themes/amsterdam/theme.js +2 -1
- package/lib/themes/json/eui_theme_borealis_dark.json +1 -1
- package/optimize/es/components/badge/color_utils.js +1 -3
- package/optimize/es/components/badge/notification_badge/badge_notification.styles.js +6 -1
- package/optimize/es/components/breadcrumbs/_breadcrumb_content.styles.js +6 -3
- package/optimize/es/components/button/button_display/_button_display.js +1 -1
- package/optimize/es/components/button/button_display/_button_display.styles.js +11 -2
- package/optimize/es/components/button/button_display/_button_display_content.styles.js +6 -3
- package/optimize/es/components/button/button_empty/button_empty.styles.js +9 -12
- package/optimize/es/components/button/button_group/button_group.styles.js +5 -3
- package/optimize/es/components/button/button_group/button_group_button.js +12 -8
- package/optimize/es/components/button/button_group/button_group_button.styles.js +43 -19
- package/optimize/es/components/button/button_icon/button_icon.js +4 -2
- package/optimize/es/components/datagrid/controls/data_grid_toolbar_control.js +11 -1
- package/optimize/es/components/datagrid/utils/focus.js +2 -2
- package/optimize/es/components/filter_group/filter_button.js +78 -21
- package/optimize/es/components/filter_group/filter_button.styles.js +51 -15
- package/optimize/es/components/filter_group/filter_group.styles.js +18 -6
- package/optimize/es/components/markdown_editor/markdown_editor_footer.js +9 -4
- package/optimize/es/components/search_bar/filters/field_value_selection_filter.js +1 -0
- package/optimize/es/components/search_bar/filters/field_value_toggle_filter.js +3 -1
- package/optimize/es/components/search_bar/filters/field_value_toggle_group_filter.js +3 -1
- package/optimize/es/components/search_bar/filters/is_filter.js +3 -1
- package/optimize/es/components/search_bar/search_bar.a11y.js +3 -3
- package/optimize/es/global_styling/mixins/_button.js +95 -28
- package/optimize/es/services/theme/index.js +2 -1
- package/optimize/es/services/theme/provider.js +28 -2
- package/optimize/es/services/theme/theme_variant.js +22 -0
- package/optimize/es/themes/amsterdam/global_styling/variables/_buttons.js +348 -147
- package/optimize/es/themes/amsterdam/global_styling/variables/_components.js +229 -224
- package/optimize/es/themes/amsterdam/theme.js +2 -1
- package/optimize/es/themes/json/eui_theme_borealis_dark.json +1 -1
- package/optimize/lib/components/badge/color_utils.js +1 -3
- package/optimize/lib/components/badge/notification_badge/badge_notification.styles.js +6 -1
- package/optimize/lib/components/breadcrumbs/_breadcrumb_content.styles.js +5 -2
- package/optimize/lib/components/button/button_display/_button_display.js +1 -1
- package/optimize/lib/components/button/button_display/_button_display.styles.js +11 -2
- package/optimize/lib/components/button/button_display/_button_display_content.styles.js +6 -3
- package/optimize/lib/components/button/button_empty/button_empty.styles.js +10 -11
- package/optimize/lib/components/button/button_group/button_group.styles.js +5 -3
- package/optimize/lib/components/button/button_group/button_group_button.js +11 -7
- package/optimize/lib/components/button/button_group/button_group_button.styles.js +41 -17
- package/optimize/lib/components/button/button_icon/button_icon.js +3 -1
- package/optimize/lib/components/datagrid/controls/data_grid_toolbar_control.js +11 -1
- package/optimize/lib/components/datagrid/utils/focus.js +1 -1
- package/optimize/lib/components/filter_group/filter_button.js +76 -19
- package/optimize/lib/components/filter_group/filter_button.styles.js +51 -15
- package/optimize/lib/components/filter_group/filter_group.styles.js +18 -6
- package/optimize/lib/components/markdown_editor/markdown_editor_footer.js +8 -3
- package/optimize/lib/components/search_bar/filters/field_value_selection_filter.js +1 -0
- package/optimize/lib/components/search_bar/filters/field_value_toggle_filter.js +3 -1
- package/optimize/lib/components/search_bar/filters/field_value_toggle_group_filter.js +3 -1
- package/optimize/lib/components/search_bar/filters/is_filter.js +3 -1
- package/optimize/lib/components/search_bar/search_bar.a11y.js +3 -3
- package/optimize/lib/global_styling/mixins/_button.js +94 -27
- package/optimize/lib/services/theme/index.js +42 -1
- package/optimize/lib/services/theme/provider.js +28 -2
- package/optimize/lib/services/theme/theme_variant.js +28 -0
- package/optimize/lib/themes/amsterdam/global_styling/variables/_buttons.js +348 -147
- package/optimize/lib/themes/amsterdam/global_styling/variables/_components.js +229 -224
- package/optimize/lib/themes/amsterdam/theme.js +2 -1
- package/optimize/lib/themes/json/eui_theme_borealis_dark.json +1 -1
- package/package.json +4 -4
- package/test-env/components/badge/color_utils.js +1 -3
- package/test-env/components/badge/notification_badge/badge_notification.styles.js +6 -1
- package/test-env/components/basic_table/basic_table.js +4 -1
- package/test-env/components/basic_table/in_memory_table.js +4 -1
- package/test-env/components/breadcrumbs/_breadcrumb_content.styles.js +5 -2
- package/test-env/components/button/button_display/_button_display.js +1 -1
- package/test-env/components/button/button_display/_button_display.styles.js +11 -2
- package/test-env/components/button/button_display/_button_display_content.styles.js +6 -3
- package/test-env/components/button/button_empty/button_empty.styles.js +10 -11
- package/test-env/components/button/button_group/button_group.styles.js +5 -3
- package/test-env/components/button/button_group/button_group_button.js +18 -8
- package/test-env/components/button/button_group/button_group_button.styles.js +41 -17
- package/test-env/components/button/button_icon/button_icon.js +3 -1
- package/test-env/components/collapsible_nav/collapsible_nav.js +1 -0
- package/test-env/components/datagrid/controls/data_grid_toolbar_control.js +11 -1
- package/test-env/components/datagrid/utils/focus.js +1 -1
- package/test-env/components/filter_group/filter_button.js +86 -21
- package/test-env/components/filter_group/filter_button.styles.js +51 -15
- package/test-env/components/filter_group/filter_group.styles.js +18 -6
- package/test-env/components/markdown_editor/markdown_editor_footer.js +8 -3
- package/test-env/components/search_bar/filters/field_value_selection_filter.js +1 -0
- package/test-env/components/search_bar/filters/field_value_toggle_filter.js +3 -1
- package/test-env/components/search_bar/filters/field_value_toggle_group_filter.js +3 -1
- package/test-env/components/search_bar/filters/is_filter.js +3 -1
- package/test-env/components/search_bar/search_bar.a11y.js +3 -3
- package/test-env/global_styling/mixins/_button.js +94 -27
- package/test-env/services/theme/index.js +42 -1
- package/test-env/services/theme/provider.js +28 -2
- package/test-env/services/theme/theme_variant.js +28 -0
- package/test-env/themes/amsterdam/global_styling/variables/_buttons.js +348 -147
- package/test-env/themes/amsterdam/global_styling/variables/_components.js +229 -224
- package/test-env/themes/amsterdam/theme.js +2 -1
- package/test-env/themes/json/eui_theme_borealis_dark.json +1 -1
|
@@ -36,7 +36,8 @@ var euiThemeAmsterdam = exports.euiThemeAmsterdam = {
|
|
|
36
36
|
components: _components.components,
|
|
37
37
|
flags: {
|
|
38
38
|
hasGlobalFocusColor: false,
|
|
39
|
-
hasVisColorAdjustment: true
|
|
39
|
+
hasVisColorAdjustment: true,
|
|
40
|
+
buttonVariant: 'classic'
|
|
40
41
|
}
|
|
41
42
|
};
|
|
42
43
|
var EuiThemeAmsterdam = exports.EuiThemeAmsterdam = (0, _utils.buildTheme)(euiThemeAmsterdam, AMSTERDAM_NAME_KEY);
|
|
@@ -392,7 +392,7 @@
|
|
|
392
392
|
"euiColorBackgroundLightWarning": "#3D3014",
|
|
393
393
|
"euiColorBackgroundLightRisk": "#4A221C",
|
|
394
394
|
"euiColorBackgroundLightDanger": "#491D27",
|
|
395
|
-
"euiColorBackgroundLightText": "#
|
|
395
|
+
"euiColorBackgroundLightText": "#2B394F",
|
|
396
396
|
"euiColorBackgroundFilledPrimary": "#61A2FF",
|
|
397
397
|
"euiColorBackgroundFilledAccent": "#EE72A6",
|
|
398
398
|
"euiColorBackgroundFilledAccentSecondary": "#16C5C0",
|
|
@@ -27,7 +27,6 @@ export var euiBadgeColors = function euiBadgeColors(euiThemeContext) {
|
|
|
27
27
|
risk: euiButtonFillColor(euiThemeContext, 'risk'),
|
|
28
28
|
danger: euiButtonFillColor(euiThemeContext, 'danger'),
|
|
29
29
|
accent: euiButtonFillColor(euiThemeContext, 'accent'),
|
|
30
|
-
accentSecondary: euiButtonFillColor(euiThemeContext, 'accentSecondary'),
|
|
31
30
|
disabled: _objectSpread(_objectSpread({}, euiButtonColor(euiThemeContext, 'disabled')), {}, {
|
|
32
31
|
borderColor: highContrastMode ? euiTheme.colors.textDisabled : ''
|
|
33
32
|
}),
|
|
@@ -45,8 +44,7 @@ export var euiBadgeColors = function euiBadgeColors(euiThemeContext) {
|
|
|
45
44
|
}),
|
|
46
45
|
accentText: _objectSpread(_objectSpread({}, badgeColorsAccentText), {}, {
|
|
47
46
|
borderColor: highContrastMode ? badgeColorsAccentText.backgroundColor : ''
|
|
48
|
-
})
|
|
49
|
-
accentSecondaryText: getBadgeColors(euiThemeContext, euiTheme.colors.textAccentSecondary)
|
|
47
|
+
})
|
|
50
48
|
};
|
|
51
49
|
};
|
|
52
50
|
export var getBadgeColors = function getBadgeColors(euiThemeContext, backgroundColor) {
|
|
@@ -9,12 +9,17 @@
|
|
|
9
9
|
import { css } from '@emotion/react';
|
|
10
10
|
import { logicalCSS, euiCanAnimate, euiFontSizeFromScale, euiNumberFormat, mathWithUnits } from '../../../global_styling';
|
|
11
11
|
import { highContrastModeStyles } from '../../../global_styling/functions/high_contrast';
|
|
12
|
+
import { isEuiThemeRefreshVariant } from '../../../services';
|
|
12
13
|
import { euiBadgeColors } from '../color_utils';
|
|
13
14
|
export var euiNotificationBadgeStyles = function euiNotificationBadgeStyles(euiThemeContext) {
|
|
14
15
|
var euiTheme = euiThemeContext.euiTheme;
|
|
16
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'buttonVariant');
|
|
15
17
|
var badgeColors = euiBadgeColors(euiThemeContext);
|
|
18
|
+
var borderRadius = isRefreshVariant ? mathWithUnits(euiTheme.border.radius.small, function (x) {
|
|
19
|
+
return x / 2;
|
|
20
|
+
}) : euiTheme.border.radius.small;
|
|
16
21
|
return {
|
|
17
|
-
euiNotificationBadge: /*#__PURE__*/css("flex-shrink:0;display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;", logicalCSS('padding-horizontal', euiTheme.size.xs), " border-radius:",
|
|
22
|
+
euiNotificationBadge: /*#__PURE__*/css("flex-shrink:0;display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;", logicalCSS('padding-horizontal', euiTheme.size.xs), " border-radius:", borderRadius, ";", highContrastModeStyles(euiThemeContext, {
|
|
18
23
|
preferred: "\n border: ".concat(euiTheme.border.thin, ";\n overflow: hidden; /* Fix text clipping */\n ")
|
|
19
24
|
}), " cursor:default;font-size:", euiFontSizeFromScale('xs', euiTheme), ";font-weight:", euiTheme.font.weight.medium, ";", euiNumberFormat(euiThemeContext), " text-align:center;", euiCanAnimate, "{transition:all ", euiTheme.animation.fast, " ease-in;};label:euiNotificationBadge;"),
|
|
20
25
|
// Sizes
|
|
@@ -7,9 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { css } from '@emotion/react';
|
|
10
|
-
import { euiFontSize, euiTextTruncate, euiFocusRing, logicalCSS, logicalBorderRadiusCSS, mathWithUnits } from '../../global_styling';
|
|
10
|
+
import { euiFontSize, euiTextTruncate, euiFocusRing, logicalCSS, logicalBorderRadiusCSS, mathWithUnits, euiButtonColor } from '../../global_styling';
|
|
11
11
|
import { highContrastModeStyles } from '../../global_styling/functions/high_contrast';
|
|
12
|
-
import { euiButtonColor } from '../../themes/amsterdam/global_styling/mixins/button';
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
14
|
* Styles cast to inner <a>, <button>, <span> elements
|
|
@@ -19,7 +18,11 @@ export var euiBreadcrumbContentStyles = function euiBreadcrumbContentStyles(euiT
|
|
|
19
18
|
highContrastMode = euiThemeContext.highContrastMode;
|
|
20
19
|
|
|
21
20
|
// Reuse button colors for `type="application`" clickable breadcrumbs
|
|
22
|
-
var
|
|
21
|
+
var buttonColors = euiButtonColor(euiThemeContext, 'primary');
|
|
22
|
+
var applicationButtonColors = {
|
|
23
|
+
backgroundColor: euiTheme.colors.backgroundLightPrimary,
|
|
24
|
+
color: buttonColors.color
|
|
25
|
+
};
|
|
23
26
|
|
|
24
27
|
// Create custom darker gray colors for non-clickable application breadcrumbs
|
|
25
28
|
// The numbers/ratios are fairly specific here to pass WCAG AA contrast minimums
|
|
@@ -71,7 +71,7 @@ export var EuiButtonDisplay = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
71
71
|
isLoading: isLoading
|
|
72
72
|
});
|
|
73
73
|
var styles = useEuiMemoizedStyles(euiButtonDisplayStyles);
|
|
74
|
-
var cssStyles = [styles.euiButtonDisplay, styles[size], fullWidth && styles.fullWidth, minWidth == null && styles.defaultMinWidth, buttonIsDisabled && styles.isDisabled];
|
|
74
|
+
var cssStyles = [styles.euiButtonDisplay, styles[size], fullWidth && styles.fullWidth, minWidth == null && [styles.defaultMinWidth.defaultMinWidth, styles.defaultMinWidth[size]], buttonIsDisabled && styles.isDisabled];
|
|
75
75
|
var innerNode = ___EmotionJSX(EuiButtonDisplayContent, _extends({
|
|
76
76
|
isLoading: isLoading,
|
|
77
77
|
isDisabled: buttonIsDisabled,
|
|
@@ -7,6 +7,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
7
7
|
* Side Public License, v 1.
|
|
8
8
|
*/
|
|
9
9
|
import { css } from '@emotion/react';
|
|
10
|
+
import { isEuiThemeRefreshVariant } from '../../../services';
|
|
10
11
|
import { euiFontSize, logicalCSS, logicalShorthandCSS, logicalTextAlignCSS } from '../../../global_styling';
|
|
11
12
|
import { euiButtonSizeMap } from '../../../global_styling/mixins';
|
|
12
13
|
// Provides a solid reset and base for handling sizing layout
|
|
@@ -24,18 +25,26 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
24
25
|
};
|
|
25
26
|
export var euiButtonDisplayStyles = function euiButtonDisplayStyles(euiThemeContext) {
|
|
26
27
|
var euiTheme = euiThemeContext.euiTheme;
|
|
28
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'buttonVariant');
|
|
27
29
|
var sizes = euiButtonSizeMap(euiThemeContext);
|
|
28
30
|
var _buttonSize = function _buttonSize(sizeKey) {
|
|
29
31
|
var size = sizes[sizeKey];
|
|
30
32
|
return /*#__PURE__*/css(logicalCSS('height', size.height), " line-height:", size.height, ";", euiFontSize(euiThemeContext, size.fontScale), " border-radius:", size.radius, ";");
|
|
31
33
|
};
|
|
34
|
+
var classicVariantStyles = "\n &:hover:not(:disabled),\n &:focus {\n text-decoration: underline;\n }\n ";
|
|
32
35
|
return {
|
|
33
36
|
// Base
|
|
34
|
-
euiButtonDisplay: /*#__PURE__*/css(euiButtonBaseCSS(), " font-weight:", euiTheme.font.weight.medium, ";", logicalShorthandCSS('padding', "0 ".concat(euiTheme.size.m)), "
|
|
37
|
+
euiButtonDisplay: /*#__PURE__*/css(euiButtonBaseCSS(), " font-weight:", euiTheme.font.weight.medium, ";", logicalShorthandCSS('padding', "0 ".concat(euiTheme.size.m)), " ", !isRefreshVariant && classicVariantStyles, ";;label:euiButtonDisplay;"),
|
|
35
38
|
// States
|
|
36
39
|
isDisabled: _ref,
|
|
37
40
|
fullWidth: /*#__PURE__*/css("display:block;", logicalCSS('width', '100%'), ";;label:fullWidth;"),
|
|
38
|
-
defaultMinWidth:
|
|
41
|
+
defaultMinWidth: {
|
|
42
|
+
defaultMinWidth: /*#__PURE__*/css(";label:defaultMinWidth;"),
|
|
43
|
+
// Skip css`` for the sizes as we already add classes for sizes and defaultMinWidth
|
|
44
|
+
xs: "\n ".concat(logicalCSS('min-width', "".concat(sizes.xs.minWidth, "px")), "\n "),
|
|
45
|
+
s: "\n ".concat(logicalCSS('min-width', "".concat(sizes.s.minWidth, "px")), "\n "),
|
|
46
|
+
m: "\n ".concat(logicalCSS('min-width', "".concat(sizes.m.minWidth, "px")), "\n ")
|
|
47
|
+
},
|
|
39
48
|
// Sizes
|
|
40
49
|
xs: /*#__PURE__*/css(_buttonSize('xs'), ";label:xs;"),
|
|
41
50
|
s: /*#__PURE__*/css(_buttonSize('s'), ";label:s;"),
|
|
@@ -6,11 +6,14 @@
|
|
|
6
6
|
* Side Public License, v 1.
|
|
7
7
|
*/
|
|
8
8
|
import { css } from '@emotion/react';
|
|
9
|
+
import { isEuiThemeRefreshVariant } from '../../../services';
|
|
9
10
|
import { logicalCSS } from '../../../global_styling';
|
|
10
|
-
export var euiButtonDisplayContentStyles = function euiButtonDisplayContentStyles(
|
|
11
|
-
var euiTheme =
|
|
11
|
+
export var euiButtonDisplayContentStyles = function euiButtonDisplayContentStyles(euiThemeContext) {
|
|
12
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
13
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'buttonVariant');
|
|
14
|
+
var refreshVariantStyles = "\n /* ensure content stays ontop of hover pseudo element */\n position: relative;\n ";
|
|
12
15
|
return {
|
|
13
16
|
// Base
|
|
14
|
-
euiButtonDisplayContent: /*#__PURE__*/css(logicalCSS('height', '100%'), " ", logicalCSS('width', '100%'), " display:flex;justify-content:center;align-items:center;vertical-align:middle;gap:", euiTheme.size.s, ";;label:euiButtonDisplayContent;")
|
|
17
|
+
euiButtonDisplayContent: /*#__PURE__*/css(logicalCSS('height', '100%'), " ", logicalCSS('width', '100%'), " display:flex;justify-content:center;align-items:center;vertical-align:middle;gap:", euiTheme.size.s, ";", isRefreshVariant && refreshVariantStyles, ";;label:euiButtonDisplayContent;")
|
|
15
18
|
};
|
|
16
19
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
2
1
|
/*
|
|
3
2
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
3
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -8,32 +7,30 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
8
7
|
*/
|
|
9
8
|
|
|
10
9
|
import { css } from '@emotion/react';
|
|
11
|
-
import {
|
|
10
|
+
import { isEuiThemeRefreshVariant } from '../../../services';
|
|
11
|
+
import { logicalCSS, logicalShorthandCSS, euiCanAnimate, highContrastModeStyles } from '../../../global_styling';
|
|
12
12
|
import { euiButtonDisplayStyles } from '../button_display/_button_display.styles';
|
|
13
|
-
var _ref = process.env.NODE_ENV === "production" ? {
|
|
14
|
-
name: "1lywbid-flush",
|
|
15
|
-
styles: "padding-inline:0;label:flush;"
|
|
16
|
-
} : {
|
|
17
|
-
name: "1lywbid-flush",
|
|
18
|
-
styles: "padding-inline:0;label:flush;",
|
|
19
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
20
|
-
};
|
|
21
13
|
export var euiButtonEmptyStyles = function euiButtonEmptyStyles(euiThemeContext) {
|
|
22
14
|
var euiTheme = euiThemeContext.euiTheme;
|
|
15
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'buttonVariant');
|
|
23
16
|
|
|
24
17
|
// EuiButtonEmpty uses the same size/font styling as EuiButtonDisplay,
|
|
25
18
|
// but does not share enough of the same colors/props to the point
|
|
26
19
|
// of using the actual component - so we'll reuse its styles instead
|
|
27
20
|
var displayStyles = euiButtonDisplayStyles(euiThemeContext);
|
|
21
|
+
var refreshFlushStyles = "\n /* using duplicate selector to ensure specificity */\n &&:hover,\n &&:active {\n background-color: transparent;\n\n /* removes hover overlay */\n &::before {\n display: none;\n }\n }\n\n &:hover:not(:disabled),\n &:focus {\n text-decoration: underline;\n\n ".concat(highContrastModeStyles(euiThemeContext, {
|
|
22
|
+
forced: "\n /* hides HCM hover border, flush buttons use text-decoration */\n &::after {\n display: none;\n }\n "
|
|
23
|
+
}), "\n }\n ");
|
|
28
24
|
return {
|
|
29
25
|
euiButtonEmpty: /*#__PURE__*/css(displayStyles.euiButtonDisplay, " ", logicalShorthandCSS('padding', "0 ".concat(euiTheme.size.s)), euiCanAnimate, "{transition-timing-function:ease-in;transition-duration:", euiTheme.animation.fast, ";};label:euiButtonEmpty;"),
|
|
30
26
|
isDisabled: displayStyles.isDisabled,
|
|
31
27
|
// Sizes
|
|
32
28
|
xs: displayStyles.xs,
|
|
33
29
|
s: displayStyles.s,
|
|
34
|
-
m
|
|
30
|
+
// uses array here to prevent adding duplicate "m" classname partial
|
|
31
|
+
m: [displayStyles.m, isRefreshVariant && "\n ".concat(logicalCSS('padding-horizontal', euiTheme.size.m), "\n ")],
|
|
35
32
|
// Flush sides
|
|
36
|
-
flush:
|
|
33
|
+
flush: /*#__PURE__*/css("padding-inline:0;", isRefreshVariant && refreshFlushStyles, ";;label:flush;"),
|
|
37
34
|
left: /*#__PURE__*/css(logicalCSS('margin-right', euiTheme.size.s), ";;label:left;"),
|
|
38
35
|
right: /*#__PURE__*/css(logicalCSS('margin-left', euiTheme.size.s), ";;label:right;"),
|
|
39
36
|
both: /*#__PURE__*/css(";label:both;")
|
|
@@ -8,6 +8,7 @@ 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 { highContrastModeStyles, preventForcedColors } from '../../../global_styling/functions/high_contrast';
|
|
13
14
|
import { euiFormVariables } from '../../form/form.styles';
|
|
@@ -31,7 +32,7 @@ export var euiButtonGroupButtonsStyles = function euiButtonGroupButtonsStyles(eu
|
|
|
31
32
|
borderColor = _euiFormVariables.borderColor;
|
|
32
33
|
return {
|
|
33
34
|
// Base
|
|
34
|
-
euiButtonGroup__buttons: /*#__PURE__*/css(logicalCSS('max-width', '100%'), " display:flex;;label:euiButtonGroup__buttons;"),
|
|
35
|
+
euiButtonGroup__buttons: /*#__PURE__*/css(logicalCSS('max-width', '100%'), " display:flex;align-items:center;;label:euiButtonGroup__buttons;"),
|
|
35
36
|
fullWidth: /*#__PURE__*/css(logicalCSS('width', '100%'), " .euiButtonGroupButton,.euiButtonGroup__tooltipWrapper{flex:1;", logicalCSS('width', '100%'), ";};label:fullWidth;"),
|
|
36
37
|
// Sizes
|
|
37
38
|
m: /*#__PURE__*/css("border-radius:", euiTheme.border.radius.medium, ";", _highContrastStyles(euiThemeContext), ";;label:m;"),
|
|
@@ -41,6 +42,7 @@ export var euiButtonGroupButtonsStyles = function euiButtonGroupButtonsStyles(eu
|
|
|
41
42
|
};
|
|
42
43
|
var _highContrastStyles = function _highContrastStyles(euiThemeContext, compressed) {
|
|
43
44
|
var euiTheme = euiThemeContext.euiTheme;
|
|
45
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'buttonVariant');
|
|
44
46
|
|
|
45
47
|
// Account for buttons within tooltip wrappers in selectors
|
|
46
48
|
var getButtonChildSelectors = function getButtonChildSelectors(selector) {
|
|
@@ -50,7 +52,7 @@ var _highContrastStyles = function _highContrastStyles(euiThemeContext, compress
|
|
|
50
52
|
preferred: compressed ? "\n .euiButtonGroupButton {\n border: none;\n }\n " : // Conditionally unset the high contrast borders passed by `euiButtonColor` -
|
|
51
53
|
// faux borders between selected/unselected buttons are rendered by pseudo elements,
|
|
52
54
|
// and can flip colors depending on selected/unselected siblings
|
|
53
|
-
"\n ".concat(getButtonChildSelectors(':not(:first-child, :last-child)'), " {\n
|
|
54
|
-
forced: "\n .euiButtonGroupButton-isSelected {\n ".concat(preventForcedColors(euiThemeContext), "\n color: ").concat(euiTheme.colors.emptyShade, ";\n background-color: ").concat(euiTheme.colors.fullShade, ";\n }\n\n .euiButtonGroupButton[disabled] {\n opacity: 0.5;\n }\n ")
|
|
55
|
+
"\n ".concat(!isRefreshVariant && "\n ".concat(getButtonChildSelectors(':not(:first-child, :last-child)'), " {\n ").concat(logicalCSS('border-horizontal', 'none'), "\n }\n ").concat(getButtonChildSelectors(':first-child'), " {\n ").concat(logicalCSS('border-right', 'none'), "\n }\n ").concat(getButtonChildSelectors(':last-child'), " {\n ").concat(logicalCSS('border-left', 'none'), "\n }\n "), "\n "),
|
|
56
|
+
forced: "\n .euiButtonGroupButton-isSelected {\n ".concat(preventForcedColors(euiThemeContext), "\n color: ").concat(euiTheme.colors.emptyShade, ";\n background-color: ").concat(euiTheme.colors.fullShade, ";\n\n ").concat(isRefreshVariant && "\n &:is(:hover, :focus):not(:disabled) {\n &::before {\n border-color: ".concat(euiTheme.colors.textInverse, ";\n }\n }\n "), "\n }\n\n .euiButtonGroupButton[disabled] {\n opacity: 0.5;\n }\n ")
|
|
55
57
|
});
|
|
56
58
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["className", "id", "isDisabled", "isIconOnly", "isSelected", "label", "value", "size", "color", "toolTipContent", "toolTipProps"];
|
|
5
|
+
var _excluded = ["className", "id", "isDisabled", "isIconOnly", "isSelected", "label", "value", "size", "color", "toolTipContent", "toolTipProps", "contentProps"];
|
|
6
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
8
|
/*
|
|
@@ -15,7 +15,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
15
15
|
|
|
16
16
|
import classNames from 'classnames';
|
|
17
17
|
import React from 'react';
|
|
18
|
-
import { useEuiMemoizedStyles } from '../../../services';
|
|
18
|
+
import { isEuiThemeRefreshVariant, useEuiMemoizedStyles, useEuiTheme } from '../../../services';
|
|
19
19
|
import { useEuiButtonColorCSS } from '../../../global_styling/mixins/_button';
|
|
20
20
|
import { useInnerText } from '../../inner_text';
|
|
21
21
|
import { EuiButtonDisplay } from '../button_display/_button_display';
|
|
@@ -36,17 +36,21 @@ export var EuiButtonGroupButton = function EuiButtonGroupButton(_ref) {
|
|
|
36
36
|
_color = _ref$color === void 0 ? 'primary' : _ref$color,
|
|
37
37
|
toolTipContent = _ref.toolTipContent,
|
|
38
38
|
toolTipProps = _ref.toolTipProps,
|
|
39
|
+
contentProps = _ref.contentProps,
|
|
39
40
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
41
|
+
var euiThemeContext = useEuiTheme();
|
|
42
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'buttonVariant');
|
|
40
43
|
var isCompressed = size === 'compressed';
|
|
41
44
|
var color = isDisabled ? 'disabled' : _color;
|
|
42
|
-
var
|
|
45
|
+
var hasBorder = isRefreshVariant && color !== 'text' && !isCompressed;
|
|
46
|
+
var display = isSelected ? 'fill' : isCompressed || hasBorder ? 'empty' : 'base';
|
|
43
47
|
var hasToolTip = !!toolTipContent;
|
|
44
48
|
var styles = useEuiMemoizedStyles(euiButtonGroupButtonStyles);
|
|
45
49
|
var focusColorStyles = useEuiMemoizedStyles(_compressedButtonFocusColors);
|
|
46
50
|
var buttonColorStyles = useEuiButtonColorCSS({
|
|
47
51
|
display: display
|
|
48
52
|
})[color];
|
|
49
|
-
var cssStyles = [styles.euiButtonGroupButton, isIconOnly && styles.iconOnly, !isCompressed && (hasToolTip ? styles.uncompressed.hasToolTip : styles.uncompressed[size]), isCompressed ? styles.compressed : styles.uncompressed.uncompressed, isDisabled && isSelected ? styles.disabledAndSelected : buttonColorStyles, !isDisabled && isCompressed && focusColorStyles[color]];
|
|
53
|
+
var cssStyles = [styles.euiButtonGroupButton, isIconOnly && styles.iconOnly, !isCompressed && (hasToolTip ? styles.uncompressed.hasToolTip : styles.uncompressed[size]), isCompressed ? styles.compressed : styles.uncompressed.uncompressed, isDisabled && isSelected ? styles.disabledAndSelected : buttonColorStyles, !isDisabled && isCompressed && focusColorStyles[color], hasBorder && styles.hasBorder];
|
|
50
54
|
var tooltipWrapperStyles = [styles.tooltipWrapper, !isCompressed && styles.uncompressed[size]];
|
|
51
55
|
var contentStyles = [styles.content.euiButtonGroupButton__content, isCompressed && styles.content.compressed];
|
|
52
56
|
var textStyles = [isIconOnly ? styles.text.euiButtonGroupButton__iconOnly : styles.text.euiButtonGroupButton__text];
|
|
@@ -74,9 +78,9 @@ export var EuiButtonGroupButton = function EuiButtonGroupButton(_ref) {
|
|
|
74
78
|
className: buttonClasses,
|
|
75
79
|
isDisabled: isDisabled,
|
|
76
80
|
size: size === 'compressed' ? 's' : size,
|
|
77
|
-
contentProps: {
|
|
78
|
-
css: contentStyles
|
|
79
|
-
},
|
|
81
|
+
contentProps: _objectSpread(_objectSpread({}, contentProps), {}, {
|
|
82
|
+
css: [contentStyles, contentProps === null || contentProps === void 0 ? void 0 : contentProps.css]
|
|
83
|
+
}),
|
|
80
84
|
textProps: {
|
|
81
85
|
css: textStyles,
|
|
82
86
|
ref: buttonTextRef,
|
|
@@ -12,17 +12,17 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import { css } from '@emotion/react';
|
|
15
|
-
import { makeDisabledContrastColor } from '../../../services';
|
|
16
|
-
import { mathWithUnits, logicalCSS, logicalShorthandCSS, euiTextShift, euiOutline, euiCanAnimate } from '../../../global_styling';
|
|
15
|
+
import { isEuiThemeRefreshVariant, makeDisabledContrastColor } from '../../../services';
|
|
16
|
+
import { mathWithUnits, logicalCSS, logicalShorthandCSS, euiTextShift, euiOutline, euiCanAnimate, preventForcedColors, highContrastModeStyles } from '../../../global_styling';
|
|
17
17
|
import { euiButtonFillColor, BUTTON_COLORS } from '../../../global_styling/mixins/_button';
|
|
18
18
|
import { euiScreenReaderOnly } from '../../accessibility';
|
|
19
19
|
import { euiFormVariables } from '../../form/form.styles';
|
|
20
20
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
21
|
-
name: "
|
|
22
|
-
styles: "overflow:hidden;label:tooltipWrapper;"
|
|
21
|
+
name: "m6ysua-tooltipWrapper",
|
|
22
|
+
styles: "overflow:hidden;&:has(:focus-visible){z-index:1;};label:tooltipWrapper;"
|
|
23
23
|
} : {
|
|
24
|
-
name: "
|
|
25
|
-
styles: "overflow:hidden;label:tooltipWrapper;",
|
|
24
|
+
name: "m6ysua-tooltipWrapper",
|
|
25
|
+
styles: "overflow:hidden;&:has(:focus-visible){z-index:1;};label:tooltipWrapper;",
|
|
26
26
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
27
27
|
};
|
|
28
28
|
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
@@ -36,48 +36,70 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
|
36
36
|
export var euiButtonGroupButtonStyles = function euiButtonGroupButtonStyles(euiThemeContext) {
|
|
37
37
|
var euiTheme = euiThemeContext.euiTheme,
|
|
38
38
|
highContrastMode = euiThemeContext.highContrastMode;
|
|
39
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'buttonVariant');
|
|
39
40
|
var _euiFormVariables = euiFormVariables(euiThemeContext),
|
|
40
41
|
controlCompressedHeight = _euiFormVariables.controlCompressedHeight,
|
|
41
42
|
controlCompressedBorderRadius = _euiFormVariables.controlCompressedBorderRadius;
|
|
42
43
|
var compressedButtonHeight = mathWithUnits([controlCompressedHeight, euiTheme.border.width.thin], function (x, y) {
|
|
43
|
-
return x - y * 2;
|
|
44
|
+
return isRefreshVariant ? x - y * 6 : x - y * 2;
|
|
44
45
|
});
|
|
46
|
+
var selectedSelectors = '.euiButtonGroupButton-isSelected, .euiButtonGroup__tooltipWrapper-isSelected';
|
|
45
47
|
var uncompressedBorderRadii = function uncompressedBorderRadii(radiusSize) {
|
|
46
|
-
return "\n border-radius: 0;\n\n &:first-child {\n ".concat(logicalShorthandCSS('border-radius', "".concat(radiusSize, " 0 0 ").concat(radiusSize)), "\n }\n\n &:last-child {\n ").concat(logicalShorthandCSS('border-radius', "0 ".concat(radiusSize, " ").concat(radiusSize, " 0")), "\n }\n ");
|
|
48
|
+
return "\n border-radius: 0;\n\n &:first-child {\n ".concat(logicalShorthandCSS('border-radius', "".concat(radiusSize, " 0 0 ").concat(radiusSize)), "\n }\n\n &:last-child {\n ").concat(logicalShorthandCSS('border-radius', "0 ".concat(radiusSize, " ").concat(radiusSize, " 0")), "\n }\n\n &:first-child:last-child {\n ").concat(logicalShorthandCSS('border-radius', "".concat(radiusSize)), "\n }\n ");
|
|
47
49
|
};
|
|
50
|
+
var refreshVariantStyles = "\n &:is(".concat(selectedSelectors, ") {\n ").concat(highContrastModeStyles(euiThemeContext, {
|
|
51
|
+
forced: "\n --highContrastHoverIndicatorColor: ".concat(euiTheme.colors.textInverse, ";\n border: none;\n\n /* styles the content manually instead of the button itself to preserve the system\n focus style, as otherwise preventForcedColors() would require manual styling */\n > [class*=\"euiButtonDisplayContent\"] {\n ").concat(preventForcedColors(euiThemeContext), "\n color: ").concat(euiTheme.colors.emptyShade, ";\n border: none;\n }\n ")
|
|
52
|
+
}), "\n }\n ");
|
|
53
|
+
var uncompressedStyles = isRefreshVariant ? "\n &:is(".concat(selectedSelectors, "):not(:disabled) {\n z-index: 1;\n /* prevent layout jumps due to missing border for selected/filled buttons */\n border: ").concat(euiTheme.border.width.thin, " solid transparent;\n\n ").concat(highContrastModeStyles(euiThemeContext, {
|
|
54
|
+
forced: "\n /* use inset focus outline to ensure visibility, same as custom hover.\n NOTE: temp solution - this will be revisited once we handle global focus styles */\n &:focus-visible {\n outline-color: ".concat(euiTheme.colors.textInverse, ";\n /* has to be inset due to overflow: hidden */\n outline-offset: -").concat(mathWithUnits(euiTheme.border.width.thin, function (x) {
|
|
55
|
+
return x * 4;
|
|
56
|
+
}), ";\n }\n ")
|
|
57
|
+
}), "\n }\n ") : "\n &:is(.euiButtonGroupButton-isSelected) {\n font-weight: ".concat(euiTheme.font.weight.bold, ";\n }\n ");
|
|
58
|
+
var compressedStyles = isRefreshVariant ? "\n margin: ".concat(euiTheme.size.xxs, ";\n border-radius: ").concat(mathWithUnits(euiTheme.border.radius.small, function (x) {
|
|
59
|
+
return x / 2;
|
|
60
|
+
}), ";\n\n & + .euiButtonGroupButton {\n ").concat(logicalCSS('margin-left', '0'), "\n }\n\n &:is(").concat(selectedSelectors, "):not(:disabled) {\n /* prevent layout jumps due to missing border for non-selected buttons */\n border: none;\n\n ").concat(highContrastModeStyles(euiThemeContext, {
|
|
61
|
+
forced: "\n /* use inset focus outline to ensure visibility, same as custom hover.\n NOTE: temp solution - this will be revisited once we handle global focus styles */\n &:focus-visible {\n outline-color: ".concat(euiTheme.colors.textInverse, ";\n /* has to be inset due to overflow: hidden */\n outline-offset: -").concat(mathWithUnits(euiTheme.border.width.thin, function (x) {
|
|
62
|
+
return x * 3;
|
|
63
|
+
}), ";\n }\n ")
|
|
64
|
+
}), "\n }\n ") : "\n background-clip: content-box;\n /* Tweak border radius to account for the padding & background-clip */\n border-radius: ".concat(mathWithUnits([controlCompressedBorderRadius, euiTheme.border.width.thin], function (x, y) {
|
|
65
|
+
return x + y;
|
|
66
|
+
}), ";\n\n &:is(.euiButtonGroupButton-isSelected) {\n font-weight: ").concat(euiTheme.font.weight.semiBold, ";\n }\n ");
|
|
48
67
|
return {
|
|
49
68
|
// Base
|
|
50
|
-
euiButtonGroupButton: /*#__PURE__*/css(logicalCSS('min-width', 0), " flex-shrink:1;flex-grow:0;z-index:0;&:focus-visible{z-index:
|
|
69
|
+
euiButtonGroupButton: /*#__PURE__*/css(logicalCSS('min-width', 0), " flex-shrink:1;flex-grow:0;z-index:0;&:focus-visible{z-index:2;}", euiCanAnimate, "{transition:background-color ", euiTheme.animation.normal, " ease-in-out,color ", euiTheme.animation.normal, " ease-in-out;}", isRefreshVariant && refreshVariantStyles, ";;label:euiButtonGroupButton;"),
|
|
51
70
|
iconOnly: /*#__PURE__*/css("padding-inline:", euiTheme.size.s, ";;label:iconOnly;"),
|
|
52
71
|
// Sizes
|
|
53
72
|
uncompressed: {
|
|
54
|
-
uncompressed: /*#__PURE__*/css("&:
|
|
73
|
+
uncompressed: /*#__PURE__*/css("&:focus-visible{", euiOutline(euiThemeContext, 'inset', euiTheme.components.buttonGroupFocusColor), ";}", uncompressedStyles, ";;label:uncompressed;"),
|
|
55
74
|
get borders() {
|
|
56
75
|
// We use pseudo elements to avoid affecing button width, and to allow
|
|
57
76
|
// inheriting high contrast border colors
|
|
58
|
-
var selectors =
|
|
77
|
+
var selectors = selectedSelectors;
|
|
59
78
|
var selectedColor = highContrastMode ? euiTheme.colors.emptyShade : euiTheme.components.buttonGroupBorderColorSelected;
|
|
60
79
|
var unselectedColor = highContrastMode ? 'inherit' : euiTheme.components.buttonGroupBorderColor;
|
|
80
|
+
var borderWidth = euiTheme.border.width.thin;
|
|
81
|
+
var borderStyles = isRefreshVariant ? "\n &:not(:first-child) {\n margin-inline-start: -".concat(borderWidth, ";\n }\n\n &:is(").concat(selectors, ") {\n &::before {\n position: absolute;\n z-index: 1;\n ").concat(logicalCSS('left', 0), "\n ").concat(logicalCSS('vertical', "-".concat(euiTheme.border.width.thin)), "\n ").concat(logicalCSS('border-left-style', 'solid'), "\n ").concat(logicalCSS('border-left-width', euiTheme.border.width.thin), "\n pointer-events: none;\n\n ").concat(preventForcedColors(euiThemeContext), "\n }\n }\n ") : "\n &::before {\n position: absolute;\n ".concat(logicalCSS('left', 0), "\n ").concat(logicalCSS('vertical', highContrastMode ? "-".concat(euiTheme.border.width.thin) : 0), "\n ").concat(logicalCSS('border-left-style', 'solid'), "\n ").concat(logicalCSS('border-left-width', euiTheme.border.width.thin), "\n pointer-events: none;\n }\n ");
|
|
61
82
|
|
|
62
83
|
// "Borders" between buttons should be present between two of the same colored buttons,
|
|
63
84
|
// and absent between selected vs non-selected buttons (different colors)
|
|
64
|
-
return "\n position: relative;\n\n
|
|
85
|
+
return "\n position: relative;\n\n ".concat(borderStyles, "\n\n &:not(").concat(selectors, ") + *:not(").concat(selectors, ") {\n &::before {\n content: '';\n border-color: ").concat(unselectedColor, ";\n }\n }\n\n &:is(").concat(selectors, ") + *:is(").concat(selectors, ") {\n &::before {\n content: '';\n border-color: ").concat(selectedColor, ";\n }\n }\n ");
|
|
65
86
|
},
|
|
66
87
|
get s() {
|
|
67
88
|
return /*#__PURE__*/css(this.borders, " ", uncompressedBorderRadii(euiTheme.border.radius.small), ";;label:s;");
|
|
68
89
|
},
|
|
69
90
|
get m() {
|
|
70
|
-
|
|
91
|
+
var radius = isRefreshVariant ? euiTheme.border.radius.small : euiTheme.border.radius.medium;
|
|
92
|
+
return /*#__PURE__*/css(this.borders, " ", uncompressedBorderRadii(radius), ";;label:m;");
|
|
71
93
|
},
|
|
72
94
|
hasToolTip: _ref2
|
|
73
95
|
},
|
|
74
|
-
compressed: /*#__PURE__*/css(logicalCSS('height', compressedButtonHeight), " line-height:", compressedButtonHeight, ";padding:", mathWithUnits(euiTheme.border.width.thin, function (x) {
|
|
96
|
+
compressed: /*#__PURE__*/css(logicalCSS('height', compressedButtonHeight), " line-height:", compressedButtonHeight, ";font-weight:", euiTheme.font.weight.regular, ";padding:", isRefreshVariant ? '0' : mathWithUnits(euiTheme.border.width.thin, function (x) {
|
|
75
97
|
return x * 2;
|
|
76
|
-
}), ";
|
|
77
|
-
return x + y;
|
|
78
|
-
}), ";font-weight:", euiTheme.font.weight.regular, ";&:is(.euiButtonGroupButton-isSelected){font-weight:", euiTheme.font.weight.semiBold, ";};label:compressed;"),
|
|
98
|
+
}), ";", compressedStyles, ";;label:compressed;"),
|
|
79
99
|
// States
|
|
80
|
-
disabledAndSelected: /*#__PURE__*/css("color:", makeDisabledContrastColor(euiTheme.colors.textDisabled)(euiTheme.components.buttonGroupBackgroundDisabledSelected), ";background-color:", euiTheme.components.buttonGroupBackgroundDisabledSelected, ";border:", highContrastMode
|
|
100
|
+
disabledAndSelected: /*#__PURE__*/css("color:", isRefreshVariant ? euiTheme.colors.textDisabled : makeDisabledContrastColor(euiTheme.colors.textDisabled)(euiTheme.components.buttonGroupBackgroundDisabledSelected), ";background-color:", euiTheme.components.buttonGroupBackgroundDisabledSelected, ";border:", highContrastMode ? "".concat(euiTheme.border.width.thin, " solid ").concat(euiTheme.components.buttonGroupBackgroundDisabledSelected) : isRefreshVariant ? "".concat(euiTheme.border.width.thin, " solid ").concat(euiTheme.colors.borderBasePlain) : '', ";;label:disabledAndSelected;"),
|
|
101
|
+
// Skip css`` to avoid generating a className
|
|
102
|
+
hasBorder: "\n border: ".concat(euiTheme.border.width.thin, " solid\n ").concat(euiTheme.colors.borderBasePlain, ";\n "),
|
|
81
103
|
// Tooltip anchor wrapper
|
|
82
104
|
tooltipWrapper: _ref,
|
|
83
105
|
// Content wrapper
|
|
@@ -93,10 +115,12 @@ export var euiButtonGroupButtonStyles = function euiButtonGroupButtonStyles(euiT
|
|
|
93
115
|
};
|
|
94
116
|
};
|
|
95
117
|
export var _compressedButtonFocusColors = function _compressedButtonFocusColors(euiThemeContext) {
|
|
118
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
119
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'buttonVariant');
|
|
96
120
|
var colors = [].concat(_toConsumableArray(BUTTON_COLORS), ['disabled']);
|
|
97
121
|
return colors.reduce(function (acc, color) {
|
|
98
122
|
var _euiButtonFillColor = euiButtonFillColor(euiThemeContext, color),
|
|
99
123
|
backgroundColor = _euiButtonFillColor.backgroundColor;
|
|
100
|
-
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, color, /*#__PURE__*/css("&:focus-visible{", euiOutline(euiThemeContext, 'center', backgroundColor), " &:is(.euiButtonGroupButton-isSelected){outline-offset:0;}
|
|
124
|
+
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, color, /*#__PURE__*/css("&:focus-visible{", euiOutline(euiThemeContext, isRefreshVariant ? 'outset' : 'center', isRefreshVariant ? euiTheme.focus.color : backgroundColor), " ", !isRefreshVariant && "\n &:is(.euiButtonGroupButton-isSelected) {\n outline-offset: 0;\n }\n ", ";}")));
|
|
101
125
|
}, {});
|
|
102
126
|
};
|
|
@@ -11,7 +11,7 @@ var _excluded = ["className", "iconType", "iconSize", "color", "isDisabled", "di
|
|
|
11
11
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
|
-
import { getSecureRelForTarget, useEuiMemoizedStyles } from '../../../services';
|
|
14
|
+
import { getSecureRelForTarget, isEuiThemeRefreshVariant, useEuiMemoizedStyles, useEuiTheme } from '../../../services';
|
|
15
15
|
import { EuiIcon } from '../../icon';
|
|
16
16
|
import { EuiLoadingSpinner } from '../../loading';
|
|
17
17
|
import { useEuiButtonColorCSS, useEuiButtonFocusCSS } from '../../../global_styling/mixins/_button';
|
|
@@ -42,6 +42,8 @@ export var EuiButtonIcon = function EuiButtonIcon(_ref) {
|
|
|
42
42
|
isSelected = _ref.isSelected,
|
|
43
43
|
isLoading = _ref.isLoading,
|
|
44
44
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
45
|
+
var euiThemeContext = useEuiTheme();
|
|
46
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'buttonVariant');
|
|
45
47
|
var isDisabled = isButtonDisabled({
|
|
46
48
|
isDisabled: _isDisabled || disabled,
|
|
47
49
|
href: href,
|
|
@@ -58,7 +60,7 @@ export var EuiButtonIcon = function EuiButtonIcon(_ref) {
|
|
|
58
60
|
var buttonFocusStyle = useEuiButtonFocusCSS();
|
|
59
61
|
var emptyHoverStyles = useEuiMemoizedStyles(_emptyHoverStyles);
|
|
60
62
|
var styles = useEuiMemoizedStyles(euiButtonIconStyles);
|
|
61
|
-
var cssStyles = [styles.euiButtonIcon, styles[size], buttonColorStyles[isDisabled ? 'disabled' : color], buttonFocusStyle, display === 'empty' && !isDisabled && emptyHoverStyles[color], isDisabled && styles.isDisabled];
|
|
63
|
+
var cssStyles = [styles.euiButtonIcon, styles[size], buttonColorStyles[isDisabled ? 'disabled' : color], buttonFocusStyle, !isRefreshVariant && display === 'empty' && !isDisabled && emptyHoverStyles[color], isDisabled && styles.isDisabled];
|
|
62
64
|
var classes = classNames('euiButtonIcon', className);
|
|
63
65
|
|
|
64
66
|
// Add an icon to the button if one exists.
|
|
@@ -13,6 +13,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import classNames from 'classnames';
|
|
15
15
|
import { css } from '@emotion/react';
|
|
16
|
+
import { useEuiTheme, useEuiThemeRefreshVariant } from '../../../services';
|
|
16
17
|
import { EuiButtonEmpty } from '../../button';
|
|
17
18
|
import { EuiNotificationBadge } from '../../badge';
|
|
18
19
|
import { useEuiI18n } from '../../i18n';
|
|
@@ -23,7 +24,12 @@ export var EuiDataGridToolbarControl = function EuiDataGridToolbarControl(_ref)
|
|
|
23
24
|
badgeContent = _ref.badgeContent,
|
|
24
25
|
textProps = _ref.textProps,
|
|
25
26
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
27
|
+
var euiThemeContext = useEuiTheme();
|
|
28
|
+
var isRefreshVariant = useEuiThemeRefreshVariant('buttonVariant');
|
|
26
29
|
var classes = classNames('euiDataGridToolbarControl', className);
|
|
30
|
+
var cssStyles = isRefreshVariant ?
|
|
31
|
+
// passes euiThemeContext here instead via `css` to ensure legacy Enzyme tests work
|
|
32
|
+
interactiveStyles(euiThemeContext) : underlineStyles;
|
|
27
33
|
var badgeAriaLabel = useEuiI18n('euiDataGridToolbarControl.badgeAriaLabel', 'Active: {count}', {
|
|
28
34
|
count: typeof badgeContent === 'string' ? betterScreenReaderSlashes(badgeContent) : badgeContent
|
|
29
35
|
});
|
|
@@ -32,7 +38,7 @@ export var EuiDataGridToolbarControl = function EuiDataGridToolbarControl(_ref)
|
|
|
32
38
|
size: "xs",
|
|
33
39
|
color: "text",
|
|
34
40
|
textProps: false,
|
|
35
|
-
css:
|
|
41
|
+
css: cssStyles
|
|
36
42
|
}, rest), ___EmotionJSX("span", _extends({}, textProps, {
|
|
37
43
|
className: classNames('euiDataGridToolbarControl__text', 'eui-textTruncate', textProps && textProps.className)
|
|
38
44
|
}), children), Boolean(badgeContent) && ___EmotionJSX(EuiNotificationBadge, {
|
|
@@ -60,6 +66,10 @@ var underlineStyles = process.env.NODE_ENV === "production" ? {
|
|
|
60
66
|
styles: "&:focus,&:hover:not(:disabled){text-decoration:none;.euiDataGridToolbarControl__text{text-decoration:underline;}};label:underlineStyles;",
|
|
61
67
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
62
68
|
};
|
|
69
|
+
var interactiveStyles = function interactiveStyles(_ref2) {
|
|
70
|
+
var euiTheme = _ref2.euiTheme;
|
|
71
|
+
return /*#__PURE__*/css("&:focus,&:hover:not(:disabled){.euiDataGridToolbarControl__badge{background-color:", euiTheme.components.filterButtonBadgeBackgroundHover, ";}};label:interactiveStyles;");
|
|
72
|
+
};
|
|
63
73
|
var badgeStyles = process.env.NODE_ENV === "production" ? {
|
|
64
74
|
name: "1968nw3-badgeStyles",
|
|
65
75
|
styles: "cursor:inherit;label:badgeStyles;"
|
|
@@ -7,7 +7,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
7
7
|
* Side Public License, v 1.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { createContext, useCallback,
|
|
10
|
+
import { createContext, useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
11
11
|
import { tabbable } from 'tabbable';
|
|
12
12
|
import { keys } from '../../../services';
|
|
13
13
|
export var DataGridFocusContext = /*#__PURE__*/createContext({
|
|
@@ -55,7 +55,7 @@ export var useFocus = function useFocus() {
|
|
|
55
55
|
});
|
|
56
56
|
}, []);
|
|
57
57
|
var previousCell = useRef(undefined);
|
|
58
|
-
|
|
58
|
+
useLayoutEffect(function () {
|
|
59
59
|
if (previousCell.current) {
|
|
60
60
|
notifyCellOfFocusState(cellsUpdateFocus.current, previousCell.current, false);
|
|
61
61
|
}
|