@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",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elastic/eui",
|
|
3
3
|
"description": "Elastic UI Component Library",
|
|
4
|
-
"version": "102.
|
|
4
|
+
"version": "102.3.0",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "lib",
|
|
7
7
|
"module": "es",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"url": "https://github.com/elastic/eui.git"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@elastic/eui-theme-common": "1.
|
|
53
|
+
"@elastic/eui-theme-common": "1.1.0",
|
|
54
54
|
"@elastic/prismjs-esql": "^1.1.0",
|
|
55
55
|
"@hello-pangea/dnd": "^16.6.0",
|
|
56
56
|
"@types/lodash": "^4.14.202",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"@cypress/webpack-dev-server": "^1.7.0",
|
|
105
105
|
"@elastic/charts": "^64.1.0",
|
|
106
106
|
"@elastic/datemath": "^5.0.3",
|
|
107
|
-
"@elastic/eui-theme-borealis": "1.
|
|
107
|
+
"@elastic/eui-theme-borealis": "1.1.0",
|
|
108
108
|
"@emotion/babel-preset-css-prop": "^11.11.0",
|
|
109
109
|
"@emotion/cache": "^11.11.0",
|
|
110
110
|
"@emotion/css": "^11.11.0",
|
|
@@ -257,7 +257,7 @@
|
|
|
257
257
|
},
|
|
258
258
|
"peerDependencies": {
|
|
259
259
|
"@elastic/datemath": "^5.0.2",
|
|
260
|
-
"@elastic/eui-theme-borealis": "1.
|
|
260
|
+
"@elastic/eui-theme-borealis": "1.1.0",
|
|
261
261
|
"@emotion/css": "11.x",
|
|
262
262
|
"@emotion/react": "11.x",
|
|
263
263
|
"@types/react": "^16.9 || ^17.0 || ^18.0",
|
|
@@ -32,7 +32,6 @@ var euiBadgeColors = exports.euiBadgeColors = function euiBadgeColors(euiThemeCo
|
|
|
32
32
|
risk: (0, _button.euiButtonFillColor)(euiThemeContext, 'risk'),
|
|
33
33
|
danger: (0, _button.euiButtonFillColor)(euiThemeContext, 'danger'),
|
|
34
34
|
accent: (0, _button.euiButtonFillColor)(euiThemeContext, 'accent'),
|
|
35
|
-
accentSecondary: (0, _button.euiButtonFillColor)(euiThemeContext, 'accentSecondary'),
|
|
36
35
|
disabled: _objectSpread(_objectSpread({}, (0, _button.euiButtonColor)(euiThemeContext, 'disabled')), {}, {
|
|
37
36
|
borderColor: highContrastMode ? euiTheme.colors.textDisabled : ''
|
|
38
37
|
}),
|
|
@@ -50,8 +49,7 @@ var euiBadgeColors = exports.euiBadgeColors = function euiBadgeColors(euiThemeCo
|
|
|
50
49
|
}),
|
|
51
50
|
accentText: _objectSpread(_objectSpread({}, badgeColorsAccentText), {}, {
|
|
52
51
|
borderColor: highContrastMode ? badgeColorsAccentText.backgroundColor : ''
|
|
53
|
-
})
|
|
54
|
-
accentSecondaryText: getBadgeColors(euiThemeContext, euiTheme.colors.textAccentSecondary)
|
|
52
|
+
})
|
|
55
53
|
};
|
|
56
54
|
};
|
|
57
55
|
var getBadgeColors = exports.getBadgeColors = function getBadgeColors(euiThemeContext, backgroundColor) {
|
|
@@ -7,6 +7,7 @@ exports.euiNotificationBadgeStyles = void 0;
|
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
var _global_styling = require("../../../global_styling");
|
|
9
9
|
var _high_contrast = require("../../../global_styling/functions/high_contrast");
|
|
10
|
+
var _services = require("../../../services");
|
|
10
11
|
var _color_utils = require("../color_utils");
|
|
11
12
|
/*
|
|
12
13
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -18,9 +19,13 @@ var _color_utils = require("../color_utils");
|
|
|
18
19
|
|
|
19
20
|
var euiNotificationBadgeStyles = exports.euiNotificationBadgeStyles = function euiNotificationBadgeStyles(euiThemeContext) {
|
|
20
21
|
var euiTheme = euiThemeContext.euiTheme;
|
|
22
|
+
var isRefreshVariant = (0, _services.isEuiThemeRefreshVariant)(euiThemeContext, 'buttonVariant');
|
|
21
23
|
var badgeColors = (0, _color_utils.euiBadgeColors)(euiThemeContext);
|
|
24
|
+
var borderRadius = isRefreshVariant ? (0, _global_styling.mathWithUnits)(euiTheme.border.radius.small, function (x) {
|
|
25
|
+
return x / 2;
|
|
26
|
+
}) : euiTheme.border.radius.small;
|
|
22
27
|
return {
|
|
23
|
-
euiNotificationBadge: /*#__PURE__*/(0, _react.css)("flex-shrink:0;display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.xs), " border-radius:",
|
|
28
|
+
euiNotificationBadge: /*#__PURE__*/(0, _react.css)("flex-shrink:0;display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.xs), " border-radius:", borderRadius, ";", (0, _high_contrast.highContrastModeStyles)(euiThemeContext, {
|
|
24
29
|
preferred: "\n border: ".concat(euiTheme.border.thin, ";\n overflow: hidden; /* Fix text clipping */\n ")
|
|
25
30
|
}), " cursor:default;font-size:", (0, _global_styling.euiFontSizeFromScale)('xs', euiTheme), ";font-weight:", euiTheme.font.weight.medium, ";", (0, _global_styling.euiNumberFormat)(euiThemeContext), " text-align:center;", _global_styling.euiCanAnimate, "{transition:all ", euiTheme.animation.fast, " ease-in;};label:euiNotificationBadge;"),
|
|
26
31
|
// Sizes
|
|
@@ -1185,7 +1185,10 @@ EuiBasicTable.propTypes = {
|
|
|
1185
1185
|
render: _propTypes.default.func
|
|
1186
1186
|
}),
|
|
1187
1187
|
/**
|
|
1188
|
-
*
|
|
1188
|
+
* A custom renderer for this column's cell content.
|
|
1189
|
+
* Unlike computed columns or `mobileOptions.render`, this function receives:
|
|
1190
|
+
* - `value`: The value of the specified field for this row
|
|
1191
|
+
* - `item`: The full data item (row object)
|
|
1189
1192
|
*/
|
|
1190
1193
|
render: _propTypes.default.func,
|
|
1191
1194
|
/**
|
|
@@ -686,7 +686,10 @@ EuiInMemoryTable.propTypes = {
|
|
|
686
686
|
render: _propTypes.default.func
|
|
687
687
|
}),
|
|
688
688
|
/**
|
|
689
|
-
*
|
|
689
|
+
* A custom renderer for this column's cell content.
|
|
690
|
+
* Unlike computed columns or `mobileOptions.render`, this function receives:
|
|
691
|
+
* - `value`: The value of the specified field for this row
|
|
692
|
+
* - `item`: The full data item (row object)
|
|
690
693
|
*/
|
|
691
694
|
render: _propTypes.default.func,
|
|
692
695
|
/**
|
|
@@ -7,7 +7,6 @@ exports.euiBreadcrumbPopoverStyles = exports.euiBreadcrumbContentStyles = void 0
|
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
var _global_styling = require("../../global_styling");
|
|
9
9
|
var _high_contrast = require("../../global_styling/functions/high_contrast");
|
|
10
|
-
var _button = require("../../themes/amsterdam/global_styling/mixins/button");
|
|
11
10
|
/*
|
|
12
11
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
13
12
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -24,7 +23,11 @@ var euiBreadcrumbContentStyles = exports.euiBreadcrumbContentStyles = function e
|
|
|
24
23
|
highContrastMode = euiThemeContext.highContrastMode;
|
|
25
24
|
|
|
26
25
|
// Reuse button colors for `type="application`" clickable breadcrumbs
|
|
27
|
-
var
|
|
26
|
+
var buttonColors = (0, _global_styling.euiButtonColor)(euiThemeContext, 'primary');
|
|
27
|
+
var applicationButtonColors = {
|
|
28
|
+
backgroundColor: euiTheme.colors.backgroundLightPrimary,
|
|
29
|
+
color: buttonColors.color
|
|
30
|
+
};
|
|
28
31
|
|
|
29
32
|
// Create custom darker gray colors for non-clickable application breadcrumbs
|
|
30
33
|
// The numbers/ratios are fairly specific here to pass WCAG AA contrast minimums
|
|
@@ -80,7 +80,7 @@ var EuiButtonDisplay = exports.EuiButtonDisplay = /*#__PURE__*/(0, _react.forwar
|
|
|
80
80
|
isLoading: isLoading
|
|
81
81
|
});
|
|
82
82
|
var styles = (0, _services.useEuiMemoizedStyles)(_button_display.euiButtonDisplayStyles);
|
|
83
|
-
var cssStyles = [styles.euiButtonDisplay, styles[size], fullWidth && styles.fullWidth, minWidth == null && styles.defaultMinWidth, buttonIsDisabled && styles.isDisabled];
|
|
83
|
+
var cssStyles = [styles.euiButtonDisplay, styles[size], fullWidth && styles.fullWidth, minWidth == null && [styles.defaultMinWidth.defaultMinWidth, styles.defaultMinWidth[size]], buttonIsDisabled && styles.isDisabled];
|
|
84
84
|
var innerNode = (0, _react2.jsx)(_button_display_content.EuiButtonDisplayContent, (0, _extends2.default)({
|
|
85
85
|
isLoading: isLoading,
|
|
86
86
|
isDisabled: buttonIsDisabled,
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.euiButtonDisplayStyles = exports.euiButtonBaseCSS = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
|
+
var _services = require("../../../services");
|
|
8
9
|
var _global_styling = require("../../../global_styling");
|
|
9
10
|
var _mixins = require("../../../global_styling/mixins");
|
|
10
11
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /*
|
|
@@ -29,18 +30,26 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
29
30
|
};
|
|
30
31
|
var euiButtonDisplayStyles = exports.euiButtonDisplayStyles = function euiButtonDisplayStyles(euiThemeContext) {
|
|
31
32
|
var euiTheme = euiThemeContext.euiTheme;
|
|
33
|
+
var isRefreshVariant = (0, _services.isEuiThemeRefreshVariant)(euiThemeContext, 'buttonVariant');
|
|
32
34
|
var sizes = (0, _mixins.euiButtonSizeMap)(euiThemeContext);
|
|
33
35
|
var _buttonSize = function _buttonSize(sizeKey) {
|
|
34
36
|
var size = sizes[sizeKey];
|
|
35
37
|
return /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', size.height), " line-height:", size.height, ";", (0, _global_styling.euiFontSize)(euiThemeContext, size.fontScale), " border-radius:", size.radius, ";");
|
|
36
38
|
};
|
|
39
|
+
var classicVariantStyles = "\n &:hover:not(:disabled),\n &:focus {\n text-decoration: underline;\n }\n ";
|
|
37
40
|
return {
|
|
38
41
|
// Base
|
|
39
|
-
euiButtonDisplay: /*#__PURE__*/(0, _react.css)(euiButtonBaseCSS(), " font-weight:", euiTheme.font.weight.medium, ";", (0, _global_styling.logicalShorthandCSS)('padding', "0 ".concat(euiTheme.size.m)), "
|
|
42
|
+
euiButtonDisplay: /*#__PURE__*/(0, _react.css)(euiButtonBaseCSS(), " font-weight:", euiTheme.font.weight.medium, ";", (0, _global_styling.logicalShorthandCSS)('padding', "0 ".concat(euiTheme.size.m)), " ", !isRefreshVariant && classicVariantStyles, ";;label:euiButtonDisplay;"),
|
|
40
43
|
// States
|
|
41
44
|
isDisabled: _ref,
|
|
42
45
|
fullWidth: /*#__PURE__*/(0, _react.css)("display:block;", (0, _global_styling.logicalCSS)('width', '100%'), ";;label:fullWidth;"),
|
|
43
|
-
defaultMinWidth:
|
|
46
|
+
defaultMinWidth: {
|
|
47
|
+
defaultMinWidth: /*#__PURE__*/(0, _react.css)(";label:defaultMinWidth;"),
|
|
48
|
+
// Skip css`` for the sizes as we already add classes for sizes and defaultMinWidth
|
|
49
|
+
xs: "\n ".concat((0, _global_styling.logicalCSS)('min-width', "".concat(sizes.xs.minWidth, "px")), "\n "),
|
|
50
|
+
s: "\n ".concat((0, _global_styling.logicalCSS)('min-width', "".concat(sizes.s.minWidth, "px")), "\n "),
|
|
51
|
+
m: "\n ".concat((0, _global_styling.logicalCSS)('min-width', "".concat(sizes.m.minWidth, "px")), "\n ")
|
|
52
|
+
},
|
|
44
53
|
// Sizes
|
|
45
54
|
xs: /*#__PURE__*/(0, _react.css)(_buttonSize('xs'), ";label:xs;"),
|
|
46
55
|
s: /*#__PURE__*/(0, _react.css)(_buttonSize('s'), ";label:s;"),
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.euiButtonDisplayContentStyles = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
|
+
var _services = require("../../../services");
|
|
8
9
|
var _global_styling = require("../../../global_styling");
|
|
9
10
|
/*
|
|
10
11
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -14,10 +15,12 @@ var _global_styling = require("../../../global_styling");
|
|
|
14
15
|
* Side Public License, v 1.
|
|
15
16
|
*/
|
|
16
17
|
|
|
17
|
-
var euiButtonDisplayContentStyles = exports.euiButtonDisplayContentStyles = function euiButtonDisplayContentStyles(
|
|
18
|
-
var euiTheme =
|
|
18
|
+
var euiButtonDisplayContentStyles = exports.euiButtonDisplayContentStyles = function euiButtonDisplayContentStyles(euiThemeContext) {
|
|
19
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
20
|
+
var isRefreshVariant = (0, _services.isEuiThemeRefreshVariant)(euiThemeContext, 'buttonVariant');
|
|
21
|
+
var refreshVariantStyles = "\n /* ensure content stays ontop of hover pseudo element */\n position: relative;\n ";
|
|
19
22
|
return {
|
|
20
23
|
// Base
|
|
21
|
-
euiButtonDisplayContent: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', '100%'), " ", (0, _global_styling.logicalCSS)('width', '100%'), " display:flex;justify-content:center;align-items:center;vertical-align:middle;gap:", euiTheme.size.s, ";;label:euiButtonDisplayContent;")
|
|
24
|
+
euiButtonDisplayContent: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', '100%'), " ", (0, _global_styling.logicalCSS)('width', '100%'), " display:flex;justify-content:center;align-items:center;vertical-align:middle;gap:", euiTheme.size.s, ";", isRefreshVariant && refreshVariantStyles, ";;label:euiButtonDisplayContent;")
|
|
22
25
|
};
|
|
23
26
|
};
|
|
@@ -5,39 +5,38 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.euiButtonEmptyStyles = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
|
+
var _services = require("../../../services");
|
|
8
9
|
var _global_styling = require("../../../global_styling");
|
|
9
10
|
var _button_display = require("../button_display/_button_display.styles");
|
|
10
|
-
|
|
11
|
+
/*
|
|
11
12
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
12
13
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
13
14
|
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
14
15
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
15
16
|
* Side Public License, v 1.
|
|
16
17
|
*/
|
|
17
|
-
|
|
18
|
-
name: "1lywbid-flush",
|
|
19
|
-
styles: "padding-inline:0;label:flush;"
|
|
20
|
-
} : {
|
|
21
|
-
name: "1lywbid-flush",
|
|
22
|
-
styles: "padding-inline:0;label:flush;",
|
|
23
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
24
|
-
};
|
|
18
|
+
|
|
25
19
|
var euiButtonEmptyStyles = exports.euiButtonEmptyStyles = function euiButtonEmptyStyles(euiThemeContext) {
|
|
26
20
|
var euiTheme = euiThemeContext.euiTheme;
|
|
21
|
+
var isRefreshVariant = (0, _services.isEuiThemeRefreshVariant)(euiThemeContext, 'buttonVariant');
|
|
27
22
|
|
|
28
23
|
// EuiButtonEmpty uses the same size/font styling as EuiButtonDisplay,
|
|
29
24
|
// but does not share enough of the same colors/props to the point
|
|
30
25
|
// of using the actual component - so we'll reuse its styles instead
|
|
31
26
|
var displayStyles = (0, _button_display.euiButtonDisplayStyles)(euiThemeContext);
|
|
27
|
+
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((0, _global_styling.highContrastModeStyles)(euiThemeContext, {
|
|
28
|
+
forced: "\n /* hides HCM hover border, flush buttons use text-decoration */\n &::after {\n display: none;\n }\n "
|
|
29
|
+
}), "\n }\n ");
|
|
32
30
|
return {
|
|
33
31
|
euiButtonEmpty: /*#__PURE__*/(0, _react.css)(displayStyles.euiButtonDisplay, " ", (0, _global_styling.logicalShorthandCSS)('padding', "0 ".concat(euiTheme.size.s)), _global_styling.euiCanAnimate, "{transition-timing-function:ease-in;transition-duration:", euiTheme.animation.fast, ";};label:euiButtonEmpty;"),
|
|
34
32
|
isDisabled: displayStyles.isDisabled,
|
|
35
33
|
// Sizes
|
|
36
34
|
xs: displayStyles.xs,
|
|
37
35
|
s: displayStyles.s,
|
|
38
|
-
m
|
|
36
|
+
// uses array here to prevent adding duplicate "m" classname partial
|
|
37
|
+
m: [displayStyles.m, isRefreshVariant && "\n ".concat((0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.m), "\n ")],
|
|
39
38
|
// Flush sides
|
|
40
|
-
flush:
|
|
39
|
+
flush: /*#__PURE__*/(0, _react.css)("padding-inline:0;", isRefreshVariant && refreshFlushStyles, ";;label:flush;"),
|
|
41
40
|
left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-right', euiTheme.size.s), ";;label:left;"),
|
|
42
41
|
right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-left', euiTheme.size.s), ";;label:right;"),
|
|
43
42
|
both: /*#__PURE__*/(0, _react.css)(";label:both;")
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.euiButtonGroupStyles = exports.euiButtonGroupButtonsStyles = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
|
+
var _services = require("../../../services");
|
|
8
9
|
var _global_styling = require("../../../global_styling");
|
|
9
10
|
var _high_contrast = require("../../../global_styling/functions/high_contrast");
|
|
10
11
|
var _form = require("../../form/form.styles");
|
|
@@ -35,7 +36,7 @@ var euiButtonGroupButtonsStyles = exports.euiButtonGroupButtonsStyles = function
|
|
|
35
36
|
borderColor = _euiFormVariables.borderColor;
|
|
36
37
|
return {
|
|
37
38
|
// Base
|
|
38
|
-
euiButtonGroup__buttons: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-width', '100%'), " display:flex;;label:euiButtonGroup__buttons;"),
|
|
39
|
+
euiButtonGroup__buttons: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-width', '100%'), " display:flex;align-items:center;;label:euiButtonGroup__buttons;"),
|
|
39
40
|
fullWidth: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('width', '100%'), " .euiButtonGroupButton,.euiButtonGroup__tooltipWrapper{flex:1;", (0, _global_styling.logicalCSS)('width', '100%'), ";};label:fullWidth;"),
|
|
40
41
|
// Sizes
|
|
41
42
|
m: /*#__PURE__*/(0, _react.css)("border-radius:", euiTheme.border.radius.medium, ";", _highContrastStyles(euiThemeContext), ";;label:m;"),
|
|
@@ -45,6 +46,7 @@ var euiButtonGroupButtonsStyles = exports.euiButtonGroupButtonsStyles = function
|
|
|
45
46
|
};
|
|
46
47
|
var _highContrastStyles = function _highContrastStyles(euiThemeContext, compressed) {
|
|
47
48
|
var euiTheme = euiThemeContext.euiTheme;
|
|
49
|
+
var isRefreshVariant = (0, _services.isEuiThemeRefreshVariant)(euiThemeContext, 'buttonVariant');
|
|
48
50
|
|
|
49
51
|
// Account for buttons within tooltip wrappers in selectors
|
|
50
52
|
var getButtonChildSelectors = function getButtonChildSelectors(selector) {
|
|
@@ -54,7 +56,7 @@ var _highContrastStyles = function _highContrastStyles(euiThemeContext, compress
|
|
|
54
56
|
preferred: compressed ? "\n .euiButtonGroupButton {\n border: none;\n }\n " : // Conditionally unset the high contrast borders passed by `euiButtonColor` -
|
|
55
57
|
// faux borders between selected/unselected buttons are rendered by pseudo elements,
|
|
56
58
|
// and can flip colors depending on selected/unselected siblings
|
|
57
|
-
"\n ".concat(getButtonChildSelectors(':not(:first-child, :last-child)'), " {\n
|
|
58
|
-
forced: "\n .euiButtonGroupButton-isSelected {\n ".concat((0, _high_contrast.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 ")
|
|
59
|
+
"\n ".concat(!isRefreshVariant && "\n ".concat(getButtonChildSelectors(':not(:first-child, :last-child)'), " {\n ").concat((0, _global_styling.logicalCSS)('border-horizontal', 'none'), "\n }\n ").concat(getButtonChildSelectors(':first-child'), " {\n ").concat((0, _global_styling.logicalCSS)('border-right', 'none'), "\n }\n ").concat(getButtonChildSelectors(':last-child'), " {\n ").concat((0, _global_styling.logicalCSS)('border-left', 'none'), "\n }\n "), "\n "),
|
|
60
|
+
forced: "\n .euiButtonGroupButton-isSelected {\n ".concat((0, _high_contrast.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 ")
|
|
59
61
|
});
|
|
60
62
|
};
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.EuiButtonGroupButton = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
@@ -19,7 +19,7 @@ var _button_display = require("../button_display/_button_display");
|
|
|
19
19
|
var _button_group_button = require("./button_group_button.styles");
|
|
20
20
|
var _tool_tip = require("../../../components/tool_tip");
|
|
21
21
|
var _react2 = require("@emotion/react");
|
|
22
|
-
var _excluded = ["className", "id", "isDisabled", "isIconOnly", "isSelected", "label", "value", "size", "color", "toolTipContent", "toolTipProps"];
|
|
22
|
+
var _excluded = ["className", "id", "isDisabled", "isIconOnly", "isSelected", "label", "value", "size", "color", "toolTipContent", "toolTipProps", "contentProps"];
|
|
23
23
|
/*
|
|
24
24
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
25
25
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -43,17 +43,21 @@ var EuiButtonGroupButton = exports.EuiButtonGroupButton = function EuiButtonGrou
|
|
|
43
43
|
_color = _ref$color === void 0 ? 'primary' : _ref$color,
|
|
44
44
|
toolTipContent = _ref.toolTipContent,
|
|
45
45
|
toolTipProps = _ref.toolTipProps,
|
|
46
|
+
contentProps = _ref.contentProps,
|
|
46
47
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
48
|
+
var euiThemeContext = (0, _services.useEuiTheme)();
|
|
49
|
+
var isRefreshVariant = (0, _services.isEuiThemeRefreshVariant)(euiThemeContext, 'buttonVariant');
|
|
47
50
|
var isCompressed = size === 'compressed';
|
|
48
51
|
var color = isDisabled ? 'disabled' : _color;
|
|
49
|
-
var
|
|
52
|
+
var hasBorder = isRefreshVariant && color !== 'text' && !isCompressed;
|
|
53
|
+
var display = isSelected ? 'fill' : isCompressed || hasBorder ? 'empty' : 'base';
|
|
50
54
|
var hasToolTip = !!toolTipContent;
|
|
51
55
|
var styles = (0, _services.useEuiMemoizedStyles)(_button_group_button.euiButtonGroupButtonStyles);
|
|
52
56
|
var focusColorStyles = (0, _services.useEuiMemoizedStyles)(_button_group_button._compressedButtonFocusColors);
|
|
53
57
|
var buttonColorStyles = (0, _button.useEuiButtonColorCSS)({
|
|
54
58
|
display: display
|
|
55
59
|
})[color];
|
|
56
|
-
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]];
|
|
60
|
+
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];
|
|
57
61
|
var tooltipWrapperStyles = [styles.tooltipWrapper, !isCompressed && styles.uncompressed[size]];
|
|
58
62
|
var contentStyles = [styles.content.euiButtonGroupButton__content, isCompressed && styles.content.compressed];
|
|
59
63
|
var textStyles = [isIconOnly ? styles.text.euiButtonGroupButton__iconOnly : styles.text.euiButtonGroupButton__text];
|
|
@@ -81,9 +85,9 @@ var EuiButtonGroupButton = exports.EuiButtonGroupButton = function EuiButtonGrou
|
|
|
81
85
|
className: buttonClasses,
|
|
82
86
|
isDisabled: isDisabled,
|
|
83
87
|
size: size === 'compressed' ? 's' : size,
|
|
84
|
-
contentProps: {
|
|
85
|
-
css: contentStyles
|
|
86
|
-
},
|
|
88
|
+
contentProps: _objectSpread(_objectSpread({}, contentProps), {}, {
|
|
89
|
+
css: [contentStyles, contentProps === null || contentProps === void 0 ? void 0 : contentProps.css]
|
|
90
|
+
}),
|
|
87
91
|
textProps: {
|
|
88
92
|
css: textStyles,
|
|
89
93
|
ref: buttonTextRef,
|
|
@@ -172,7 +176,13 @@ EuiButtonGroupButton.propTypes = {
|
|
|
172
176
|
/**
|
|
173
177
|
* Inherit from EuiButtonGroup
|
|
174
178
|
*/
|
|
175
|
-
onClick: _propTypes.default.func.isRequired
|
|
179
|
+
onClick: _propTypes.default.func.isRequired,
|
|
180
|
+
contentProps: _propTypes.default.shape({
|
|
181
|
+
className: _propTypes.default.string,
|
|
182
|
+
"aria-label": _propTypes.default.string,
|
|
183
|
+
"data-test-subj": _propTypes.default.string,
|
|
184
|
+
css: _propTypes.default.any
|
|
185
|
+
})
|
|
176
186
|
};
|
|
177
187
|
var EuiButtonGroupButtonWithToolTip = function EuiButtonGroupButtonWithToolTip(_ref2) {
|
|
178
188
|
var _toolTipProps$anchorP, _toolTipProps$anchorP2;
|
|
@@ -23,11 +23,11 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
23
23
|
* Side Public License, v 1.
|
|
24
24
|
*/
|
|
25
25
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
26
|
-
name: "
|
|
27
|
-
styles: "overflow:hidden;label:tooltipWrapper;"
|
|
26
|
+
name: "m6ysua-tooltipWrapper",
|
|
27
|
+
styles: "overflow:hidden;&:has(:focus-visible){z-index:1;};label:tooltipWrapper;"
|
|
28
28
|
} : {
|
|
29
|
-
name: "
|
|
30
|
-
styles: "overflow:hidden;label:tooltipWrapper;",
|
|
29
|
+
name: "m6ysua-tooltipWrapper",
|
|
30
|
+
styles: "overflow:hidden;&:has(:focus-visible){z-index:1;};label:tooltipWrapper;",
|
|
31
31
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
32
32
|
};
|
|
33
33
|
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
@@ -41,48 +41,70 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
|
41
41
|
var euiButtonGroupButtonStyles = exports.euiButtonGroupButtonStyles = function euiButtonGroupButtonStyles(euiThemeContext) {
|
|
42
42
|
var euiTheme = euiThemeContext.euiTheme,
|
|
43
43
|
highContrastMode = euiThemeContext.highContrastMode;
|
|
44
|
+
var isRefreshVariant = (0, _services.isEuiThemeRefreshVariant)(euiThemeContext, 'buttonVariant');
|
|
44
45
|
var _euiFormVariables = (0, _form.euiFormVariables)(euiThemeContext),
|
|
45
46
|
controlCompressedHeight = _euiFormVariables.controlCompressedHeight,
|
|
46
47
|
controlCompressedBorderRadius = _euiFormVariables.controlCompressedBorderRadius;
|
|
47
48
|
var compressedButtonHeight = (0, _global_styling.mathWithUnits)([controlCompressedHeight, euiTheme.border.width.thin], function (x, y) {
|
|
48
|
-
return x - y * 2;
|
|
49
|
+
return isRefreshVariant ? x - y * 6 : x - y * 2;
|
|
49
50
|
});
|
|
51
|
+
var selectedSelectors = '.euiButtonGroupButton-isSelected, .euiButtonGroup__tooltipWrapper-isSelected';
|
|
50
52
|
var uncompressedBorderRadii = function uncompressedBorderRadii(radiusSize) {
|
|
51
|
-
return "\n border-radius: 0;\n\n &:first-child {\n ".concat((0, _global_styling.logicalShorthandCSS)('border-radius', "".concat(radiusSize, " 0 0 ").concat(radiusSize)), "\n }\n\n &:last-child {\n ").concat((0, _global_styling.logicalShorthandCSS)('border-radius', "0 ".concat(radiusSize, " ").concat(radiusSize, " 0")), "\n }\n ");
|
|
53
|
+
return "\n border-radius: 0;\n\n &:first-child {\n ".concat((0, _global_styling.logicalShorthandCSS)('border-radius', "".concat(radiusSize, " 0 0 ").concat(radiusSize)), "\n }\n\n &:last-child {\n ").concat((0, _global_styling.logicalShorthandCSS)('border-radius', "0 ".concat(radiusSize, " ").concat(radiusSize, " 0")), "\n }\n\n &:first-child:last-child {\n ").concat((0, _global_styling.logicalShorthandCSS)('border-radius', "".concat(radiusSize)), "\n }\n ");
|
|
52
54
|
};
|
|
55
|
+
var refreshVariantStyles = "\n &:is(".concat(selectedSelectors, ") {\n ").concat((0, _global_styling.highContrastModeStyles)(euiThemeContext, {
|
|
56
|
+
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((0, _global_styling.preventForcedColors)(euiThemeContext), "\n color: ").concat(euiTheme.colors.emptyShade, ";\n border: none;\n }\n ")
|
|
57
|
+
}), "\n }\n ");
|
|
58
|
+
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((0, _global_styling.highContrastModeStyles)(euiThemeContext, {
|
|
59
|
+
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((0, _global_styling.mathWithUnits)(euiTheme.border.width.thin, function (x) {
|
|
60
|
+
return x * 4;
|
|
61
|
+
}), ";\n }\n ")
|
|
62
|
+
}), "\n }\n ") : "\n &:is(.euiButtonGroupButton-isSelected) {\n font-weight: ".concat(euiTheme.font.weight.bold, ";\n }\n ");
|
|
63
|
+
var compressedStyles = isRefreshVariant ? "\n margin: ".concat(euiTheme.size.xxs, ";\n border-radius: ").concat((0, _global_styling.mathWithUnits)(euiTheme.border.radius.small, function (x) {
|
|
64
|
+
return x / 2;
|
|
65
|
+
}), ";\n\n & + .euiButtonGroupButton {\n ").concat((0, _global_styling.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((0, _global_styling.highContrastModeStyles)(euiThemeContext, {
|
|
66
|
+
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((0, _global_styling.mathWithUnits)(euiTheme.border.width.thin, function (x) {
|
|
67
|
+
return x * 3;
|
|
68
|
+
}), ";\n }\n ")
|
|
69
|
+
}), "\n }\n ") : "\n background-clip: content-box;\n /* Tweak border radius to account for the padding & background-clip */\n border-radius: ".concat((0, _global_styling.mathWithUnits)([controlCompressedBorderRadius, euiTheme.border.width.thin], function (x, y) {
|
|
70
|
+
return x + y;
|
|
71
|
+
}), ";\n\n &:is(.euiButtonGroupButton-isSelected) {\n font-weight: ").concat(euiTheme.font.weight.semiBold, ";\n }\n ");
|
|
53
72
|
return {
|
|
54
73
|
// Base
|
|
55
|
-
euiButtonGroupButton: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('min-width', 0), " flex-shrink:1;flex-grow:0;z-index:0;&:focus-visible{z-index:
|
|
74
|
+
euiButtonGroupButton: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('min-width', 0), " flex-shrink:1;flex-grow:0;z-index:0;&:focus-visible{z-index:2;}", _global_styling.euiCanAnimate, "{transition:background-color ", euiTheme.animation.normal, " ease-in-out,color ", euiTheme.animation.normal, " ease-in-out;}", isRefreshVariant && refreshVariantStyles, ";;label:euiButtonGroupButton;"),
|
|
56
75
|
iconOnly: /*#__PURE__*/(0, _react.css)("padding-inline:", euiTheme.size.s, ";;label:iconOnly;"),
|
|
57
76
|
// Sizes
|
|
58
77
|
uncompressed: {
|
|
59
|
-
uncompressed: /*#__PURE__*/(0, _react.css)("&:
|
|
78
|
+
uncompressed: /*#__PURE__*/(0, _react.css)("&:focus-visible{", (0, _global_styling.euiOutline)(euiThemeContext, 'inset', euiTheme.components.buttonGroupFocusColor), ";}", uncompressedStyles, ";;label:uncompressed;"),
|
|
60
79
|
get borders() {
|
|
61
80
|
// We use pseudo elements to avoid affecing button width, and to allow
|
|
62
81
|
// inheriting high contrast border colors
|
|
63
|
-
var selectors =
|
|
82
|
+
var selectors = selectedSelectors;
|
|
64
83
|
var selectedColor = highContrastMode ? euiTheme.colors.emptyShade : euiTheme.components.buttonGroupBorderColorSelected;
|
|
65
84
|
var unselectedColor = highContrastMode ? 'inherit' : euiTheme.components.buttonGroupBorderColor;
|
|
85
|
+
var borderWidth = euiTheme.border.width.thin;
|
|
86
|
+
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((0, _global_styling.logicalCSS)('left', 0), "\n ").concat((0, _global_styling.logicalCSS)('vertical', "-".concat(euiTheme.border.width.thin)), "\n ").concat((0, _global_styling.logicalCSS)('border-left-style', 'solid'), "\n ").concat((0, _global_styling.logicalCSS)('border-left-width', euiTheme.border.width.thin), "\n pointer-events: none;\n\n ").concat((0, _global_styling.preventForcedColors)(euiThemeContext), "\n }\n }\n ") : "\n &::before {\n position: absolute;\n ".concat((0, _global_styling.logicalCSS)('left', 0), "\n ").concat((0, _global_styling.logicalCSS)('vertical', highContrastMode ? "-".concat(euiTheme.border.width.thin) : 0), "\n ").concat((0, _global_styling.logicalCSS)('border-left-style', 'solid'), "\n ").concat((0, _global_styling.logicalCSS)('border-left-width', euiTheme.border.width.thin), "\n pointer-events: none;\n }\n ");
|
|
66
87
|
|
|
67
88
|
// "Borders" between buttons should be present between two of the same colored buttons,
|
|
68
89
|
// and absent between selected vs non-selected buttons (different colors)
|
|
69
|
-
return "\n position: relative;\n\n
|
|
90
|
+
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 ");
|
|
70
91
|
},
|
|
71
92
|
get s() {
|
|
72
93
|
return /*#__PURE__*/(0, _react.css)(this.borders, " ", uncompressedBorderRadii(euiTheme.border.radius.small), ";;label:s;");
|
|
73
94
|
},
|
|
74
95
|
get m() {
|
|
75
|
-
|
|
96
|
+
var radius = isRefreshVariant ? euiTheme.border.radius.small : euiTheme.border.radius.medium;
|
|
97
|
+
return /*#__PURE__*/(0, _react.css)(this.borders, " ", uncompressedBorderRadii(radius), ";;label:m;");
|
|
76
98
|
},
|
|
77
99
|
hasToolTip: _ref2
|
|
78
100
|
},
|
|
79
|
-
compressed: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', compressedButtonHeight), " line-height:", compressedButtonHeight, ";padding:", (0, _global_styling.mathWithUnits)(euiTheme.border.width.thin, function (x) {
|
|
101
|
+
compressed: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', compressedButtonHeight), " line-height:", compressedButtonHeight, ";font-weight:", euiTheme.font.weight.regular, ";padding:", isRefreshVariant ? '0' : (0, _global_styling.mathWithUnits)(euiTheme.border.width.thin, function (x) {
|
|
80
102
|
return x * 2;
|
|
81
|
-
}), ";
|
|
82
|
-
return x + y;
|
|
83
|
-
}), ";font-weight:", euiTheme.font.weight.regular, ";&:is(.euiButtonGroupButton-isSelected){font-weight:", euiTheme.font.weight.semiBold, ";};label:compressed;"),
|
|
103
|
+
}), ";", compressedStyles, ";;label:compressed;"),
|
|
84
104
|
// States
|
|
85
|
-
disabledAndSelected: /*#__PURE__*/(0, _react.css)("color:", (0, _services.makeDisabledContrastColor)(euiTheme.colors.textDisabled)(euiTheme.components.buttonGroupBackgroundDisabledSelected), ";background-color:", euiTheme.components.buttonGroupBackgroundDisabledSelected, ";border:", highContrastMode
|
|
105
|
+
disabledAndSelected: /*#__PURE__*/(0, _react.css)("color:", isRefreshVariant ? euiTheme.colors.textDisabled : (0, _services.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;"),
|
|
106
|
+
// Skip css`` to avoid generating a className
|
|
107
|
+
hasBorder: "\n border: ".concat(euiTheme.border.width.thin, " solid\n ").concat(euiTheme.colors.borderBasePlain, ";\n "),
|
|
86
108
|
// Tooltip anchor wrapper
|
|
87
109
|
tooltipWrapper: _ref,
|
|
88
110
|
// Content wrapper
|
|
@@ -98,10 +120,12 @@ var euiButtonGroupButtonStyles = exports.euiButtonGroupButtonStyles = function e
|
|
|
98
120
|
};
|
|
99
121
|
};
|
|
100
122
|
var _compressedButtonFocusColors = exports._compressedButtonFocusColors = function _compressedButtonFocusColors(euiThemeContext) {
|
|
123
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
124
|
+
var isRefreshVariant = (0, _services.isEuiThemeRefreshVariant)(euiThemeContext, 'buttonVariant');
|
|
101
125
|
var colors = [].concat((0, _toConsumableArray2.default)(_button.BUTTON_COLORS), ['disabled']);
|
|
102
126
|
return colors.reduce(function (acc, color) {
|
|
103
127
|
var _euiButtonFillColor = (0, _button.euiButtonFillColor)(euiThemeContext, color),
|
|
104
128
|
backgroundColor = _euiButtonFillColor.backgroundColor;
|
|
105
|
-
return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2.default)({}, color, /*#__PURE__*/(0, _react.css)("&:focus-visible{", (0, _global_styling.euiOutline)(euiThemeContext, 'center', backgroundColor), " &:is(.euiButtonGroupButton-isSelected){outline-offset:0;}
|
|
129
|
+
return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2.default)({}, color, /*#__PURE__*/(0, _react.css)("&:focus-visible{", (0, _global_styling.euiOutline)(euiThemeContext, isRefreshVariant ? 'outset' : 'center', isRefreshVariant ? euiTheme.focus.color : backgroundColor), " ", !isRefreshVariant && "\n &:is(.euiButtonGroupButton-isSelected) {\n outline-offset: 0;\n }\n ", ";}")));
|
|
106
130
|
}, {});
|
|
107
131
|
};
|
|
@@ -49,6 +49,8 @@ var EuiButtonIcon = exports.EuiButtonIcon = function EuiButtonIcon(_ref) {
|
|
|
49
49
|
isSelected = _ref.isSelected,
|
|
50
50
|
isLoading = _ref.isLoading,
|
|
51
51
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
52
|
+
var euiThemeContext = (0, _services.useEuiTheme)();
|
|
53
|
+
var isRefreshVariant = (0, _services.isEuiThemeRefreshVariant)(euiThemeContext, 'buttonVariant');
|
|
52
54
|
var isDisabled = (0, _button_display.isButtonDisabled)({
|
|
53
55
|
isDisabled: _isDisabled || disabled,
|
|
54
56
|
href: href,
|
|
@@ -65,7 +67,7 @@ var EuiButtonIcon = exports.EuiButtonIcon = function EuiButtonIcon(_ref) {
|
|
|
65
67
|
var buttonFocusStyle = (0, _button.useEuiButtonFocusCSS)();
|
|
66
68
|
var emptyHoverStyles = (0, _services.useEuiMemoizedStyles)(_button_icon._emptyHoverStyles);
|
|
67
69
|
var styles = (0, _services.useEuiMemoizedStyles)(_button_icon.euiButtonIconStyles);
|
|
68
|
-
var cssStyles = [styles.euiButtonIcon, styles[size], buttonColorStyles[isDisabled ? 'disabled' : color], buttonFocusStyle, display === 'empty' && !isDisabled && emptyHoverStyles[color], isDisabled && styles.isDisabled];
|
|
70
|
+
var cssStyles = [styles.euiButtonIcon, styles[size], buttonColorStyles[isDisabled ? 'disabled' : color], buttonFocusStyle, !isRefreshVariant && display === 'empty' && !isDisabled && emptyHoverStyles[color], isDisabled && styles.isDisabled];
|
|
69
71
|
var classes = (0, _classnames.default)('euiButtonIcon', className);
|
|
70
72
|
|
|
71
73
|
// Add an icon to the button if one exists.
|
|
@@ -206,6 +206,7 @@ EuiCollapsibleNav.propTypes = {
|
|
|
206
206
|
* Object of props passed to EuiFocusTrap.
|
|
207
207
|
* `shards` specifies an array of elements that will be considered part of the flyout, preventing the flyout from being closed when clicked.
|
|
208
208
|
* `closeOnMouseup` will delay the close callback, allowing time for external toggle buttons to handle close behavior.
|
|
209
|
+
* `returnFocus` defines the return focus behavior and provides the possibility to check the available target element or opt out of the behavior in favor of manually returning focus
|
|
209
210
|
*/
|
|
210
211
|
focusTrapProps: _propTypes.default.any,
|
|
211
212
|
/**
|
|
@@ -11,6 +11,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
var _react2 = require("@emotion/react");
|
|
14
|
+
var _services = require("../../../services");
|
|
14
15
|
var _button = require("../../button");
|
|
15
16
|
var _badge = require("../../badge");
|
|
16
17
|
var _i18n = require("../../i18n");
|
|
@@ -28,7 +29,12 @@ var EuiDataGridToolbarControl = exports.EuiDataGridToolbarControl = function Eui
|
|
|
28
29
|
badgeContent = _ref.badgeContent,
|
|
29
30
|
textProps = _ref.textProps,
|
|
30
31
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
32
|
+
var euiThemeContext = (0, _services.useEuiTheme)();
|
|
33
|
+
var isRefreshVariant = (0, _services.useEuiThemeRefreshVariant)('buttonVariant');
|
|
31
34
|
var classes = (0, _classnames.default)('euiDataGridToolbarControl', className);
|
|
35
|
+
var cssStyles = isRefreshVariant ?
|
|
36
|
+
// passes euiThemeContext here instead via `css` to ensure legacy Enzyme tests work
|
|
37
|
+
interactiveStyles(euiThemeContext) : underlineStyles;
|
|
32
38
|
var badgeAriaLabel = (0, _i18n.useEuiI18n)('euiDataGridToolbarControl.badgeAriaLabel', 'Active: {count}', {
|
|
33
39
|
count: typeof badgeContent === 'string' ? betterScreenReaderSlashes(badgeContent) : badgeContent
|
|
34
40
|
});
|
|
@@ -37,7 +43,7 @@ var EuiDataGridToolbarControl = exports.EuiDataGridToolbarControl = function Eui
|
|
|
37
43
|
size: "xs",
|
|
38
44
|
color: "text",
|
|
39
45
|
textProps: false,
|
|
40
|
-
css:
|
|
46
|
+
css: cssStyles
|
|
41
47
|
}, rest), (0, _react2.jsx)("span", (0, _extends2.default)({}, textProps, {
|
|
42
48
|
className: (0, _classnames.default)('euiDataGridToolbarControl__text', 'eui-textTruncate', textProps && textProps.className)
|
|
43
49
|
}), children), Boolean(badgeContent) && (0, _react2.jsx)(_badge.EuiNotificationBadge, {
|
|
@@ -154,6 +160,10 @@ var underlineStyles = process.env.NODE_ENV === "production" ? {
|
|
|
154
160
|
styles: "&:focus,&:hover:not(:disabled){text-decoration:none;.euiDataGridToolbarControl__text{text-decoration:underline;}};label:underlineStyles;",
|
|
155
161
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
156
162
|
};
|
|
163
|
+
var interactiveStyles = function interactiveStyles(_ref2) {
|
|
164
|
+
var euiTheme = _ref2.euiTheme;
|
|
165
|
+
return /*#__PURE__*/(0, _react2.css)("&:focus,&:hover:not(:disabled){.euiDataGridToolbarControl__badge{background-color:", euiTheme.components.filterButtonBadgeBackgroundHover, ";}};label:interactiveStyles;");
|
|
166
|
+
};
|
|
157
167
|
var badgeStyles = process.env.NODE_ENV === "production" ? {
|
|
158
168
|
name: "1968nw3-badgeStyles",
|
|
159
169
|
styles: "cursor:inherit;label:badgeStyles;"
|
|
@@ -62,7 +62,7 @@ var useFocus = exports.useFocus = function useFocus() {
|
|
|
62
62
|
});
|
|
63
63
|
}, []);
|
|
64
64
|
var previousCell = (0, _react.useRef)(undefined);
|
|
65
|
-
(0, _react.
|
|
65
|
+
(0, _react.useLayoutEffect)(function () {
|
|
66
66
|
if (previousCell.current) {
|
|
67
67
|
notifyCellOfFocusState(cellsUpdateFocus.current, previousCell.current, false);
|
|
68
68
|
}
|